!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"substack@538433c"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3f854aa6-c7a6-4333-afba-158fae15bfb7",e._sentryDebugIdIdentifier="sentry-dbid-3f854aa6-c7a6-4333-afba-158fae15bfb7")}catch(e){}}();"use strict";(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["44648"],{61060:function(e,t,n){n.d(t,{A:()=>l});let l={root:"root-LeqPP3",badge:"badge-WYVub3",circle:"circle-_ZTVoA"}},38217:function(e,t,n){n.d(t,{U:()=>_});var l=n(69277),r=n(70408),i=n(4006),o=n(69843),a=n.n(o),s=n(71464),d=n(84934),c=n(17402),u=n(84605),h=n(31651),m=n(31392),f=n(68349),p=n(24078),g=n(89490),v=n(35369),b=n(76977),w=n(23168),Y=n(46058),k=n(66246);function _(e){let{user:t,onChangePhoto:n}=e,{iString:o}=(0,u.GO)(),[_,y]=(0,c.useState)(null),[C,x]=(0,c.useState)(null),[{isDragging:I},{openFileDialog:S,getInputProps:N,getDragProps:F}]=(0,w.l)({accept:"image/*",multiple:!1,onFilesAdded:async e=>{let t=e[0];if(t)try{let e=t.file instanceof File?t.file:null;if(!e)return;let l=await (0,f.Sd)(e);if(!l||a()(l.url))return;let r=await (0,h.J)(l.url),i=await (0,f.Sd)(r);if(!i)return;let{url:o,orientation:s}=i;y(null!=s?s:null),o&&(x(o),n({photo_url:o}))}catch(e){console.error("Error processing image:",e)}}}),A=(0,c.useMemo)(()=>({transform:(0,f.FK)(_)}),[_]),{darkMode:L}=(0,m.D2)(),E=C||(0,Y.pI)(t,{darkMode:L});return(0,i.FD)(g.az,(0,r._)((0,l._)({position:"relative"},F()),{children:[(0,i.FD)(v.Nm,{resetCss:!0,onClick:S,"aria-label":o("Edit profile photo"),children:[(0,i.FD)(b.ov,{style:A,position:"relative",width:120,height:120,border:"detail",radius:"full",bg:I?"secondary":"primary",overflow:"hidden",children:[E?(0,i.Y)(p.eu,{photoUrl:E,size:120}):(0,i.Y)(s.A,{size:24}),I&&(0,i.Y)(b.ov,{position:"absolute",inset:0,style:{backgroundColor:"rgba(0, 0, 0, 0.3)"},children:(0,i.Y)(s.A,{size:24})})]}),(0,i.Y)("input",(0,l._)({},N()))]}),(0,i.Y)(g.az,{position:"absolute",className:k.A.button,bg:"primary",radius:"full",children:(0,i.Y)(v.K0,{rounded:!0,priority:"secondary-outline",onClick:S,"aria-label":o("Edit profile photo"),children:(0,i.Y)(d.A,{size:18})})})]}))}},110:function(e,t,n){n.d(t,{A:()=>E});var l=n(4006);n(1683);var r=n(76199),i=n(58475),o=n(51419),a=n(52820),s=n(84565),d=n(69324),c=n(84605),u=n(46275),h=n(51440),m=n(40691),f=n(97640),p=n(13505),g=n(95899),v=n(25006),b=n(99145),w=n(53989),Y=n(3084),k=n(85478),_=n(98747),y=n(46271),C=n(57446),x=n(56007),I=n(3011),S=n(87370),N=n(2481),F=n(32848),A=n(14984),L=n(40659);function E(e){let{user:t=null,pub:n=null,children:E,siteConfigs:D={},hasThemedBackground:B=!1,language:M="en",preferredLanguage:R=null,locale:T,country:z,experimentInfo:W={variantOverrides:{},experimentFeatures:{},experimentExposures:{}},portalRoot:P,shouldLoad:O,shouldPollNotifications:q=!1,publicationSettings:H={},userSettings:V,publicationUserSettings:U={},activityToken:J,loadPubClientSearch:j,enablePubClientSearchShortcuts:K=!0,loadGlobalSearch:$,context:G="reader",isMarketingPage:X=!1,browser:Z,webviewPlatform:Q=null}=e;void 0===O&&(O=!!t);let ee=(0,F.Of)({isLoggedIn:!!t});return(0,l.Y)(o.WJ,{browser:Z,webviewPlatform:Q,children:(0,l.Y)(h.PC,{country:z||"US",children:(0,l.Y)(c.Pz,{language:M||"en",preferredLanguage:R,locale:T,children:(0,l.Y)(_.wX,{value:{hasThemedBackground:B},children:(0,l.Y)(k.eE,{siteConfigs:D,children:(0,l.Y)(a.S$,{siteConfigs:D,experimentInfo:W,children:(0,l.Y)(s.sV,{siteConfigs:D,experimentInfo:W,children:(0,l.Y)(w.Fm,{settings:H,children:(0,l.Y)(Y.iB,{preloadPubUserSettings:U,children:(0,l.Y)(f._b,{shouldLoad:O,shouldPoll:q,activityToken:J,children:(0,l.Y)(i.G,{root:P,children:(0,l.Y)(y.vu,{defaultValue:t,userSettings:V,children:(0,l.Y)(C.Q,{children:(0,l.Y)(g.HW,{children:(0,l.Y)(u.Sn,{children:(0,l.Y)(x.tE,{children:(0,l.Y)(I.B,{children:(0,l.Y)(m.Zn,{children:(0,l.Y)(N.wG,{children:(0,l.Y)(r.ZD,{context:G,pub:n,children:(0,l.Y)(F.C8.Provider,{value:ee,children:(0,l.Y)(S.b,{children:(0,l.Y)(v.pP.Provider,{value:n,children:(0,l.Y)(A.tB,{user:t,children:(0,l.Y)(d.yl,{load:$,useLocalNavigation:!X,children:(0,l.Y)(b.BR,{load:j,pub:n,enableShortcuts:K,children:(0,l.Y)(p.kL,{children:(0,l.Y)(L.Fg,{children:E})})})})})})})})})})})})})})})})})})})})})})})})})})})})}},21738:function(e,t,n){n.d(t,{X:()=>a});var l=n(4006),r=n(13950),i=n(85478),o=n(32087);function a(e){let{pub:t,prefix:n,children:a}=e,s=(0,i.mJ)().getConfigFor("profile_portal_theme");return"profile"===t.homepage_type&&s?(0,l.Y)(o.m,{theme:t.portalAppTheme,children:a}):(0,l.Y)(r.DH,{prefix:n,children:a})}},42250:function(e,t,n){n.d(t,{A:()=>a});var l=n(99851),r=n(4006),i=n(17402);let o=!1;"undefined"!=typeof window&&(window.__captchaOnloadCallback=function(){if(o&&Array.isArray(o)){let e=o;for(let t of(o=!0,e))t()}});class a extends i.Component{async componentDidMount(){await new Promise(e=>{if(!0===o)e();else if(!1===o){var t;let n,l;o=[e],n=document.getElementsByTagName("script")[0],(l=document.createElement("script")).type="text/javascript",l.async=!0,l.defer=!0,l.src="proxy.php?url=https://www.google.com/recaptcha/api.js?render=explicit&onload=__captchaOnloadCallback",null==n||null==(t=n.parentNode)||t.insertBefore(l,n)}else o.push(e)}),this.captchaId=window.grecaptcha.render(this.base,{sitekey:window._preloads.captcha_site_key,size:"compact"})}getResponse(){var e;return null==(e=window.grecaptcha)?void 0:e.getResponse(this.captchaId)}render(){let{className:e}=this.props;return(0,r.Y)("div",{className:e})}constructor(...e){super(...e),(0,l._)(this,"captchaId",void 0)}}},77043:function(e,t,n){n.d(t,{$L:()=>o,Rc:()=>r,TB:()=>a,YR:()=>i,be:()=>l});let l=20,r=24,i=24;function o(e,t,n){let l=t/16;return l+(e-t)/(n-t)*(n/16-l)}function a(e){let{layout:t,navPosition:n,navStyle:r,isPostView:i=!1}=e;return"stacked"===t?i?{min:l,max:110}:"top"===n?{min:l,max:220}:{min:l,max:110}:"stacked"===r?{min:l,max:110}:{min:l,max:80}}},92825:function(e,t,n){n.d(t,{f:()=>I,S:()=>x});var l=n(4006),r=n(17402),i=n(89490),o=n(63136);function a(e){let{pub:t}=e,n=t.hero_text,r=t.rankingDetailFreeSubscriberCount;return n||r?(0,l.FD)(s,{children:[n&&(0,l.Y)(o.EY.B4,{clamp:3,children:n}),r&&(0,l.Y)(o.EY.B4,{color:"secondary",children:r})]}):null}let s=(0,i.I4)({display:"flex",direction:"column",gap:2});var d=n(84605),c=n(46271),u=n(35369),h=n(85050),m=n(39318),f=n(57324);function p(e){let{pub:t,isContributor:n,isSubscribed:r,utmSource:i}=e,{iString:o}=(0,d.GO)(),a=(0,c.Jd)(),s=(0,h.s)({surface:"profile"}),p=(0,m.eV6)(t,{user:a,addBase:!0,utm_source:i||f.VU.pubHoverCard,utm_medium:f.Jn.web,utm_campaign:f._9.profilePage});return n?null:(0,l.Y)(g,{children:r?(0,l.Y)(u.$n,{priority:"secondary-outline",href:p,size:"sm",children:o("Subscribed")}):(0,l.Y)(u.$n,{priority:"primary",href:p,onClick:s(t),size:"sm",children:o("Subscribe")})})}let g=(0,i.I4)({display:"flex",direction:"column",paddingTop:4});var v=n(45974);function b(e){var t;let{pub:n}=e,r=(0,m.fOI)(n),i=n.name||"",a=null!=(t=n.subdomain)?t:"";return(0,l.FD)(w,{children:[(0,l.FD)(Y,{children:[(0,l.Y)(o.EY.B2,{weight:"medium",children:(0,l.Y)(o.Yq,{href:r,children:i})}),(0,l.Y)(o.EY.B4,{color:"secondary",children:(0,l.Y)(o.Yq,{href:r,children:a})})]}),(0,l.Y)(v.wg,{pub:n,size:48})]})}let w=(0,i.I4)({display:"flex",direction:"row",gap:12}),Y=(0,i.I4)({display:"flex",direction:"column",flex:"grow",gap:2});var k=n(57820);function _(){return(0,l.Y)(I,{children:(0,l.Y)(k.y$,{flex:"grow",padding:40})})}var y=n(86500),C=n(76528);function x(e){var t;let{pubId:n,utmSource:i,trackOnShow:o}=e,{data:s}=(0,C.OU)("/api/v1/publication/public/".concat(n),{shouldRevalidate:!1});return((0,r.useEffect)(()=>{o&&s&&(0,y.u4)(y.qY.PUBLICATION_HOVER_CARD_SHOWN,{publication_id:n})},[o,null==s||null==(t=s.pub)?void 0:t.id]),s)?(0,l.FD)(I,{children:[(0,l.Y)(b,{pub:s.pub}),(0,l.Y)(a,{pub:s.pub}),(0,l.Y)(p,{isContributor:s.isContributor,isSubscribed:s.isSubscribed,pub:s.pub,utmSource:i})]}):(0,l.Y)(_,{})}let I=(0,i.I4)({display:"flex",direction:"column",sizing:"border-box",width:320,gap:12,padding:12})},59307:function(e,t,n){n.d(t,{A:()=>a});var l=n(69277),r=n(70408),i=n(4006),o=n(97731);let a=e=>(0,i.Y)(o.A,(0,r._)((0,l._)({},e),{name:"PlayIconRounded",svgParams:{height:16,width:16},stroke:"none",children:(0,i.Y)("path",{d:"M3.35866 16C2.58101 16 2 15.4101 2 14.4447V1.55531C2 0.598883 2.58101 0 3.35866 0C3.75196 0 4.10056 0.134078 4.54749 0.393296L15.1575 6.54302C15.9531 7.00782 16.3106 7.39218 16.3106 8C16.3106 8.61676 15.9531 9.00112 15.1575 9.45698L4.54749 15.6067C4.10056 15.8659 3.75196 16 3.35866 16Z"})}))},40615:function(e,t,n){n.d(t,{AI:()=>eD,at:()=>eB,TV:()=>eq,jB:()=>eT,I:()=>eE,Z1:()=>eR,sZ:()=>eW,cX:()=>eM,W1:()=>eV,mj:()=>ez,H$:()=>eP,b3:()=>eO});var l=n(69277),r=n(4006),i=n(32485),o=n.n(i),a=n(69843),s=n.n(a),d=n(60250),c=n(17402),u=n(78895),h=n(70408),m=n(90883),f=n(77043),p=n(2977),g=n(21738),v=n(84605),b=n(53989),w=n(85478),Y=n(78338);let k=e=>{let{pub:t,isChatActive:n,isMeetingsActive:l}=e,{language:r}=(0,v.GO)(),{getSettingFor:i}=(0,b.Pu)(),{getConfigFor:o}=(0,w.mJ)(),a=!!o("publication_tabs_reorder"),s=!!i("notes_feed_enabled"),d=!!(i("reader_referrals_enabled")&&i("reader_referrals_leaderboard_enabled")),u=!!i("group_sections_and_podcasts_in_menu_enabled"),h=(0,c.useMemo)(()=>(0,Y.Bf)(t.navigationBarItems||[],{isFeedEnabled:s,isChatActive:!!n,isChatEnabled:!!t.threads_v2_enabled,isMeetingsActive:!!l,hasMultipleNewsletters:t.sections&&t.sections.length>0,isReaderReferralsLeaderboardActive:d,language:r,useReordering:a}).filter(e=>!e.is_hidden),[t.navigationBarItems,t.threads_v2_enabled,t.sections,s,n,l,d,r,a]);return(0,c.useMemo)(()=>P({groupNewsletters:u,navBarItems:h,pub:t,language:r}),[u,h,t,r])};var _=n(75107),y=n(87677),C=n(8853),x=n(37767),I=n(68410),S=n(76977),N=n(45859),F=n(52673);let A=e=>{var t,n;return null!=(n=null==(t=e.subItems)?void 0:t.some(e=>e.subItems&&e.subItems.length>0))&&n};function L(e){let{className:t,hideBorders:n,items:l,menuItemClassName:i,selectedMenuItemClassName:a,selectedSlug:s,pub:u,maxWidth:h}=e,{isMobile:m}=(0,I.sM)(),f=(0,c.useRef)(null),[p,g]=(0,c.useState)(!1),[v,b]=(0,c.useState)(!1);function w(e){let{scrollLeft:t,scrollWidth:n,clientWidth:l}=e;g(t>10),b(n-(l+t)>10)}let Y=e=>()=>{let{current:t}=f;t&&t.scrollBy({left:250*e,behavior:"smooth"})};return(0,c.useEffect)(()=>{w(f.current)},[]),(0,r.Y)("div",{className:o()("overflow-list-container",t),style:{maxWidth:h},children:(0,r.FD)(S.Ye,{borderBottom:n?void 0:"detail",borderTop:n||m?void 0:"detail",className:o()("section-bar",{scroll:!0,"overflow-left":p,"overflow-right":v}),font:"text",height:m?44:48,justifyContent:m?"start":"center",paddingX:4,position:"relative",children:[(0,r.Y)("div",{ref:f,className:"overflow-items",onScroll:e=>w(e.target),children:l.map(e=>{let{label:t,href:n,slug:l,isNative:d,onClick:c,noFollow:h,subItems:m,newTab:f}=e;return m?(0,r.Y)(N.W1,{align:"start",trigger:(0,r.Y)("div",{className:o()("menu-item",{selected:l===s},i,a&&{[a]:l===s}),children:(0,r.FD)(x.A,{native:d,rel:h?"nofollow":null,onClick:c,children:[(0,r.Y)("span",{className:"overflow-item-text",children:t}),(0,r.Y)(_.A,{className:F.A.chevron,size:16})]})}),children:m.map(e=>{let{label:t,href:n,isNative:l,onClick:i,noFollow:o,logoUrl:a}=e,s=a||(null==u?void 0:u.logo_url);return(0,r.Y)(N.Dr,{href:n,leading:s?(0,r.Y)(C.c,{height:24,radius:"xs",src:s,width:24}):null,native:l,rel:o?"nofollow":void 0,onClick:i,children:t})})}):(0,r.Y)("div",{className:o()("menu-item",{selected:l===s},i,a&&{[a]:l===s}),children:(0,r.Y)(x.A,{href:n,native:d,newTab:f,rel:h?"nofollow":null,onClick:c,children:(0,r.Y)("span",{className:"overflow-item-text",children:t})})})})}),(0,r.Y)("div",{className:"left-button",children:(0,r.Y)("div",{className:"scroll-button-hitbox",role:"button",onClick:Y(-1),children:(0,r.Y)(d.A,{strokeWidth:1.5})})}),(0,r.Y)("div",{className:"right-button",children:(0,r.Y)("div",{className:"scroll-button-hitbox",role:"button",onClick:Y(1),children:(0,r.Y)(y.A,{strokeWidth:1.5})})})]})})}var E=n(96400),D=n(4016),B=n(49807),M=n(82776);let R={zeteo:{121146:"We’re Not Kidding"}},T=["/about","/chat","/archive","/newsletters","/videos","/watch"],z=e=>{let{isChatActive:t,isMeetingsActive:n,pub:l,selectedSectionId:i,hideBorders:o,maxWidth:a}=e,s=k({pub:l,isChatActive:t,isMeetingsActive:n}).filter(e=>!A(e)&&(!e.subItems||e.subItems.length>0));return(0,r.Y)(L,{items:s,className:"sections-overflow",selectedSlug:i,pub:l,hideBorders:o,maxWidth:a})},W={label:"Recipe Index",subItems:[{label:"By Protein",subItems:[{href:"https://whattocook.substack.com/t/beef",label:"Beef"},{href:"https://whattocook.substack.com/t/chicken",label:"Chicken"},{href:"https://whattocook.substack.com/t/lamb",label:"Lamb"},{href:"https://whattocook.substack.com/t/pork",label:"Pork"},{href:"https://whattocook.substack.com/t/seafood",label:"Seafood"},{href:"https://whattocook.substack.com/t/vegetarian",label:"Vegetarian"},{href:"https://whattocook.substack.com/t/ground-meat",label:"Ground meat"}]},{label:"By Season",subItems:[{href:"https://whattocook.substack.com/t/spring",label:"Spring"},{href:"https://whattocook.substack.com/t/summer",label:"Summer"},{href:"https://whattocook.substack.com/t/fall",label:"Fall"},{href:"https://whattocook.substack.com/t/winter",label:"Winter"}]},{label:"By Meal Type",subItems:[{href:"https://whattocook.substack.com/t/one-pot",label:"One-pot"},{href:"https://whattocook.substack.com/t/sheet-pan",label:"Sheet-pan dinners"},{href:"https://whattocook.substack.com/t/kid-friendly",label:"Kid-friendly"},{href:"https://whattocook.substack.com/t/freezer-friendly",label:"Freezer-friendly"},{href:"https://whattocook.substack.com/t/grill",label:"Grill"},{href:"https://whattocook.substack.com/t/soup",label:"Soup"},{href:"https://whattocook.substack.com/t/salad",label:"Salad"},{href:"https://whattocook.substack.com/t/breakfast",label:"Breakfast"},{href:"https://whattocook.substack.com/t/dessert",label:"Dessert"},{href:"https://whattocook.substack.com/t/15-minute-meals",label:"15-minute meals"},{href:"https://whattocook.substack.com/t/30-minute-meals",label:"30-minute meals"}]},{label:"Meal Plans and More",subItems:[{href:"https://whattocook.substack.com/t/meal-plan",label:"Really simple meal plans"},{href:"https://whattocook.substack.com/t/entertaining-menus",label:"Entertaining Menus"},{href:"https://whattocook.substack.com/t/cooking-tips",label:"Cooking tips"},{href:"https://whattocook.substack.com/t/cooking-videos",label:"Cooking videos"},{href:"https://whattocook.substack.com/t/holiday-meal-plans",label:"Holiday meal plans"}]}]},P=e=>{let{groupNewsletters:t,navBarItems:n,pub:l,language:r}=e,{iString:i}=E.TH.i(r),o=[];o.push({href:"/",label:i("Home"),slug:"/home"}),l.podcast_enabled&&l.show_pub_podcast_tab&&o.push({href:"/podcast",label:i("Podcast"),slug:"/podcast"});let a=[];(0,D.ob)({pub:l})?a=O({navBarItems:n,groups:[{label:"Shows",condition:e=>!!e.section}]}):(0,D.wj)({pub:l})?a=O({navBarItems:n,groups:[{condition:e=>{var t;return(null==(t=e.section)?void 0:t.id)===118995},excludeFromOthers:!0,isStandalone:!0},{condition:e=>{var t;return(null==(t=e.section)?void 0:t.id)===121146},excludeFromOthers:!0,isStandalone:!0},{label:"Shows",condition:e=>{var t,n;return!!(null==(t=e.section)?void 0:t.is_podcast)||(null==(n=e.postTag)?void 0:n.slug)==="townhall"}},{label:"Columns",condition:e=>{var t,n,l;return!!e.section&&!(null==(t=e.section)?void 0:t.is_podcast)&&![132068,243259,214805].includes(null!=(l=null==(n=e.section)?void 0:n.id)?l:-1)}},{label:"Documentaries",condition:e=>{var t,n;return[132068,214805,243259].includes(null!=(n=null==(t=e.section)?void 0:t.id)?n:-1)}}]}):(0,D.s7)({pub:l})?(o.push({href:"/watch",label:"Watch",slug:"/watch"}),o.push({href:"/listen",label:"Shows",slug:"/listen"}),a=O({navBarItems:n.filter(e=>"/watch"!==e.link_url&&(!e.section||!e.section.is_podcast||(0,M.sectionIsSpecificallyMarkedAsNewsletter)({section:e.section,pub:l}))),groups:[{label:"Newsletters",condition:e=>!!e.section}]})):a=(0,D.d4)({pub:l})?O({navBarItems:n,groups:[{label:"Projects",condition:e=>{var t,n;return[146942,146943,150226].includes(null!=(n=null==(t=e.section)?void 0:t.id)?n:-1)},excludeFromOthers:!0},{label:"News / Research",condition:e=>{var t,n;return[146936,146935].includes(null!=(n=null==(t=e.section)?void 0:t.id)?n:-1)},excludeFromOthers:!0},{label:"Calls-to-Action",condition:e=>{var t,n;return[146939,146941,146949].includes(null!=(n=null==(t=e.section)?void 0:t.id)?n:-1)},excludeFromOthers:!0},{label:"Recommendations",condition:e=>{var t,n;return[146958].includes(null!=(n=null==(t=e.section)?void 0:t.id)?n:-1)||"https://bookshop.org/shop/globalfreedoms"===e.link_url},excludeFromOthers:!0},{label:"Podcasts",condition:e=>{var t;return!!(null==(t=e.section)?void 0:t.is_podcast)},excludeFromOthers:!0}]}):t?O({navBarItems:n,groups:[{label:i("Newsletters"),condition:e=>{var t;return!!e.section&&!(null==(t=e.section)?void 0:t.is_podcast)}},{label:i("Podcasts"),condition:e=>{var t;return!!(null==(t=e.section)?void 0:t.is_podcast)}}]}):n;let s=[...o,...q({groupedNavBarItems:a,pub:l})];if((0,D.O3)({pub:l})){var d,c;if((null==(c=l.theme)||null==(d=c.custom_header)?void 0:d.navStyle)==="stacked"){let e=s.findIndex(e=>"RECIPE INDEX"===e.label);-1!==e&&(s[e]=W)}}return s},O=e=>{let{navBarItems:t,groups:n}=e,l=[...t],r=[],i=[...t];for(let e of n)if(e.isStandalone){let t=l.find(e.condition);if(!t)continue;r.push(t),i=i.filter(e=>e!==t),e.excludeFromOthers&&(l=l.filter(e=>e!==t))}else{var o;let t=l.filter(e.condition);if(0===t.length)continue;r.push({label:null!=(o=e.label)?o:"Other",navBarItems:t}),i=i.filter(t=>!e.condition(t)),e.excludeFromOthers&&(l=l.filter(t=>!e.condition(t)))}return[...r,...i]},q=e=>{let{groupedNavBarItems:t,pub:n}=e;return t.map(e=>"navBarItems"in e?{label:e.label,subItems:e.navBarItems.map(e=>H({navBarItem:e,pub:n}))}:H({navBarItem:e,pub:n}))},H=e=>{var t,n,r,i,o,a,s;let{navBarItem:d,pub:c}=e;if(d.is_group)return{label:(0,M.truncateText)((0,Y.ly)(d),30),subItems:(null!=(t=d.children)?t:[]).map(e=>H({navBarItem:e,pub:c}))};if(d.section){let e=d.section,t=e.is_podcast&&null!=(o=null==(r=c.sections.find(t=>t.id===e.id))||null==(n=r.podcastSettings)?void 0:n.podcast_art_url)?o:e.logo_url;return(0,h._)((0,l._)({label:null!=(a=null==(i=R[c.subdomain])?void 0:i[e.id])?a:(0,M.truncateText)(e.name,30),href:(0,B.Dor)(c,{section:e})},t?{logoUrl:t}:null),{slug:e.id})}let u=(0,Y.DF)(d),m="link"===u&&!(d.standard_key||T.includes(null!=(s=d.link_url)?s:"")),f=m&&c.tier<2;return(0,h._)((0,l._)({href:(0,B.cSL)(c,d,{addBase:m}),label:(0,M.truncateText)((0,Y.ly)(d),30)},f?{noFollow:f}:null,"page"===u?{isNative:!0}:null),{slug:(0,B.cSL)(c,d,{addBase:!1}),newTab:m})};var V=n(68349),U=n(35369);let J="visible-S5xqLB",j=e=>{let{isChatActive:t,isMeetingsActive:n,pub:l,selectedSectionId:i,maxWidth:a,withoutLeftPadding:s=!1,withoutRightPadding:d=!1}=e,{language:u}=(0,v.GO)(),{getSettingFor:h}=(0,b.Pu)(),{getConfigFor:m}=(0,w.mJ)(),f=!!m("publication_tabs_reorder"),p="100%"===a,[g,k]=(0,c.useState)(!1),y=!!h("notes_feed_enabled"),x=!!(h("reader_referrals_enabled")&&h("reader_referrals_leaderboard_enabled")),I=P({groupNewsletters:!!h("group_sections_and_podcasts_in_menu_enabled"),navBarItems:(0,Y.Bf)(l.navigationBarItems||[],{isFeedEnabled:y,isChatActive:!!t,isChatEnabled:!!l.threads_v2_enabled,isMeetingsActive:!!n,hasMultipleNewsletters:l.sections&&l.sections.length>0,isReaderReferralsLeaderboardActive:x,language:u,useReordering:f}).filter(e=>!e.is_hidden),pub:l,language:u}).filter(e=>!A(e)&&(!e.subItems||e.subItems.length>0)),F=(0,c.useRef)(null),[L,E]=(0,c.useState)(!1),[D,B]=(0,c.useState)(!1),M=(0,c.useCallback)(e=>{let{scrollLeft:t,scrollWidth:n,clientWidth:l}=e;p||E(t>10),B(n-(l+t)>10)},[p]);(0,c.useLayoutEffect)(()=>{F.current&&M(F.current)},[I,M]);let R=(0,c.useCallback)(()=>{F.current&&(F.current.scrollWidth>F.current.clientWidth?k(!0):k(!1))},[]);return(0,c.useLayoutEffect)(()=>(window.addEventListener("resize",R),R(),()=>{window.removeEventListener("resize",R)}),[R]),(0,r.Y)(S.pT,{justifyContent:"center",alignItems:"center",style:{width:a,minWidth:280},paddingX:16*!!p,children:(0,r.FD)("div",{className:"scrollWrapper-acnikR",children:[!p&&(0,r.Y)("div",{className:o()("fadeLeft-eSWM6i",L&&J),style:{marginRight:p?"16px":0}}),(0,r.Y)(S.Ye,{ref:F,justifyContent:g?"start":"center",gap:8,wrap:"nowrap",className:"scrollContainer-Zw8XO7",onScroll:e=>{M(e.target)},paddingY:8,paddingLeft:p||s?0:40,paddingRight:p||d?0:40,children:I.map(e=>{var t,n;if(e.subItems&&e.subItems.length>0)return(0,r.Y)(N.W1,{align:"start",trigger:(0,r.FD)(U.$n,{priority:"secondary-outline",size:"sm",rounded:!0,color:"secondary",children:[e.label,(0,r.Y)(_.A,{className:"chevron-W36cpG",size:16})]}),children:e.subItems.map(e=>{var t;let n=e.noFollow?null:e.logoUrl;return(0,r.Y)(N.Dr,{href:e.href,native:e.isNative,onClick:e.onClick,leading:n?(0,r.Y)(C.c,{height:24,radius:"xs",src:n,width:24}):null,children:e.label},null!=(t=e.slug)?t:e.label)})},null!=(t=e.slug)?t:e.label);let l=e.slug===i;return(0,r.Y)(U.$n,{priority:l?"primary":"secondary-outline",size:"sm",onClick:()=>{e.onClick?e.onClick():e.href&&(0,V.V2)(e.href,{local_navigation:!e.isNative})},rounded:!0,color:l?"inherit":"secondary",children:e.label},null!=(n=e.slug)?n:e.label)})}),(0,r.Y)("div",{className:o()("fadeRight-6i2p1g",D&&J),style:{marginLeft:p?"16px":0}})]})})},K=e=>{let{menuItems:t,maxWidth:n,itemGap:l,moreButtonWidth:r,containerPadding:i=32,isFullWidth:o=!1,windowWidth:a="undefined"!=typeof window?window.innerWidth:0,isSmallScreen:s=!1,reservedWidth:d=0}=e,u=(0,c.useRef)(null),h=(0,c.useRef)(null),m=(0,c.useRef)(null),[f,p]=(0,c.useState)([]),[g,v]=(0,c.useState)([]),[b,w]=(0,c.useState)(!1),Y=(0,c.useCallback)(()=>{let e;if(!m.current)return;if(o)e=a-(s?20:40)-i;else if("number"==typeof n&&n>=0)e=n;else if(u.current)e=u.current.offsetWidth-i;else{if(!h.current)return;e=h.current.offsetWidth}e=Math.max(0,e-d);let c=[];m.current.querySelectorAll(".measure-item").forEach((e,n)=>{let l=e.querySelector(".menu-item")||e.querySelector("button"),r=l?l.offsetWidth:e.offsetWidth;t[n]&&c.push({item:t[n],width:r,index:n})});let f=0,g=0;for(let t=0;t0?l:0)+n.width;if(t===c.length-1){i<=e&&(f=i,g++);break}if(i+(l+r)<=e)f=i,g++;else break}let b=t.slice(0,g),Y=t.slice(g);p(e=>e.length!==b.length||e.some((e,t)=>{var n;return e.slug!==(null==(n=b[t])?void 0:n.slug)})?b:e),v(e=>e.length!==Y.length||e.some((e,t)=>{var n;return e.slug!==(null==(n=Y[t])?void 0:n.slug)})?Y:e),w(!0)},[t,n,o,a,s,l,r,i,d]);return(0,c.useLayoutEffect)(()=>{if(Y(),!o)return window.addEventListener("resize",Y),()=>{window.removeEventListener("resize",Y)}},[Y,o]),{measurementRef:m,containerRef:h,outerContainerRef:u,visibleItems:f,overflowItems:g,isReady:b}},$="chevron-fUHuKc",G="measurementContainer-Wd518f",X=e=>{let{isChatActive:t,isMeetingsActive:n,pub:l,selectedSectionId:i,hideBorders:a,maxWidth:s,alignStart:d}=e,{iString:u}=(0,v.GO)(),{isMobile:h}=(0,I.sM)(),m="100%"===s,[f,p]=(0,c.useState)("undefined"!=typeof window?window.innerWidth:0),g=f<=992,b=k({pub:l,isChatActive:t,isMeetingsActive:n}).filter(e=>!A(e)&&(!e.subItems||e.subItems.length>0)),w=b.filter(e=>e.subItems&&e.subItems.length>0),Y=b.filter(e=>!e.subItems||0===e.subItems.length),y=(0,c.useRef)(null),[F,L]=(0,c.useState)(0),{measurementRef:E,containerRef:D,outerContainerRef:B,visibleItems:M,overflowItems:R,isReady:T}=K({menuItems:Y,maxWidth:s,itemGap:0,moreButtonWidth:80,containerPadding:0,isFullWidth:m,windowWidth:f,isSmallScreen:g,reservedWidth:F}),z=(0,c.useMemo)(()=>new Set(M.map(e=>{var t;return null!=(t=e.slug)?t:e.label})),[M]);(0,c.useLayoutEffect)(()=>{if(!y.current)return;let e=y.current.querySelectorAll(".measure-group-item"),t=0;e.forEach(e=>{t+=e.offsetWidth}),L(t)},[w]),(0,c.useLayoutEffect)(()=>{let e=()=>{p(window.innerWidth)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);let W=(e,t,n)=>{let{label:l,href:i,isNative:a,onClick:s,noFollow:d,subItems:c,newTab:u}=e;return c?(0,r.Y)(N.W1,{align:"start",trigger:(0,r.Y)("div",{className:o()("menu-item",{selected:t}),children:(0,r.FD)(x.A,{native:a,rel:d?"nofollow":null,onClick:s,children:[(0,r.Y)("span",{className:"overflow-item-text",children:l}),(0,r.Y)(_.A,{className:$,size:16})]})}),children:c.map(e=>{let t=e.logoUrl;return(0,r.Y)(N.Dr,{href:e.href,leading:t?(0,r.Y)(C.c,{height:24,radius:"xs",src:t,width:24}):null,native:e.isNative,rel:e.noFollow?"nofollow":void 0,onClick:e.onClick,children:e.label},e.slug)})},n):(0,r.Y)("div",{className:o()("menu-item",{selected:t}),children:(0,r.Y)(x.A,{href:i,native:a,newTab:u,rel:d?"nofollow":null,onClick:s,children:(0,r.Y)("span",{className:"overflow-item-text",children:l})})},n)};return(0,r.FD)(r.FK,{children:[(0,r.Y)("div",{ref:E,className:o()(G,"section-bar","overflow-items"),children:Y.map((e,t)=>(0,r.Y)("div",{className:"measure-item",children:W(e,!1,"measure-".concat(t))},t))}),(0,r.Y)("div",{ref:y,className:o()(G,"section-bar","overflow-items"),children:w.map((e,t)=>(0,r.Y)("div",{className:"measure-group-item",children:W(e,!1,"measure-group-".concat(t))},t))}),(0,r.Y)("div",{ref:B,className:o()("overflow-list-container","sections-overflow"),style:{maxWidth:m?"100%":s,width:m?"100%":void 0,paddingLeft:m&&!g?20:void 0,paddingRight:m?20:void 0,visibility:T?"visible":"hidden"},children:(0,r.Y)(S.Ye,{ref:D,borderBottom:a?void 0:"detail",borderTop:a||h?void 0:"detail",className:"section-bar",font:"text",height:h?44:48,justifyContent:h||g||d?"start":"center",position:"relative",children:(0,r.FD)("div",{className:"overflow-items",children:[b.map(e=>{var t;let n=e.subItems&&e.subItems.length>0,l=null!=(t=e.slug)?t:e.label;if(!(n||!T||z.has(l)))return null;let r=e.slug===i;return W(e,r,l)}),R.length>0&&(0,r.Y)(N.W1,{align:"start",trigger:(0,r.Y)("div",{className:"menu-item",children:(0,r.FD)(x.A,{children:[(0,r.Y)("span",{className:"overflow-item-text",children:u("More")}),(0,r.Y)(_.A,{className:$,size:16})]})}),children:R.map(e=>{let t=e.noFollow?null:e.logoUrl;return(0,r.Y)(N.Dr,{href:e.href,leading:t?(0,r.Y)(C.c,{height:24,radius:"xs",src:t,width:24}):null,native:e.isNative,rel:e.noFollow?"nofollow":void 0,onClick:e.onClick,children:e.label},e.slug)})},"more-menu")]})})})]})},Z="measurementContainer-lK1Sqq",Q="chevron-J7_gYb",ee=e=>{let{isChatActive:t,isMeetingsActive:n,pub:l,selectedSectionId:i,maxWidth:a,alignStart:s}=e,{iString:d}=(0,v.GO)(),u="100%"===a,[h,m]=(0,c.useState)("undefined"!=typeof window?window.innerWidth:0),f=k({pub:l,isChatActive:t,isMeetingsActive:n}).filter(e=>!A(e)&&(!e.subItems||e.subItems.length>0)),p=f.filter(e=>e.subItems&&e.subItems.length>0),g=f.filter(e=>!e.subItems||0===e.subItems.length),b=(0,c.useRef)(null),[w,Y]=(0,c.useState)(0),{measurementRef:y,containerRef:x,outerContainerRef:I,visibleItems:F,overflowItems:L,isReady:E}=K({menuItems:g,maxWidth:a,itemGap:6,moreButtonWidth:80,containerPadding:s?40:32,isFullWidth:u,windowWidth:h,reservedWidth:w});return(0,c.useLayoutEffect)(()=>{if(!b.current)return;let e=b.current.querySelectorAll(".measure-group-item"),t=0;e.forEach((n,l)=>{let r=n.querySelector("button");t+=r?r.offsetWidth:n.offsetWidth,l{let e=()=>{m(window.innerWidth)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),(0,r.FD)(r.FK,{children:[(0,r.Y)("div",{ref:y,className:o()(Z),children:g.map((e,t)=>(0,r.Y)("div",{className:"measure-item",children:(0,r.Y)(U.$n,{priority:"secondary-outline",size:"sm",rounded:!0,color:"secondary",children:e.label})},t))}),(0,r.Y)("div",{ref:b,className:o()(Z),children:p.map((e,t)=>(0,r.Y)("div",{className:"measure-group-item",children:(0,r.FD)(U.$n,{priority:"secondary-outline",size:"sm",rounded:!0,color:"secondary",children:[e.label,(0,r.Y)(_.A,{className:Q,size:16})]})},t))}),(0,r.Y)(S.pT,{ref:I,justifyContent:s?"start":"center",alignItems:"center",style:{width:u?"100%":a,minWidth:160,visibility:E?"visible":"hidden"},paddingX:16*!!u,paddingLeft:u||s?8:0,children:(0,r.FD)(S.Ye,{ref:x,justifyContent:s?"start":"center",gap:6,wrap:"nowrap",paddingY:8,children:[F.map(e=>{var t;let n=e.slug===i;return(0,r.Y)(U.$n,{priority:n?"primary":"secondary-outline",size:"sm",onClick:()=>{e.onClick?e.onClick():e.href&&(0,V.V2)(e.href,{local_navigation:!e.isNative})},rounded:!0,color:n?"inherit":"secondary",children:e.label},null!=(t=e.slug)?t:e.label)}),p.map(e=>{var t,n;return(0,r.Y)(N.W1,{align:"start",trigger:(0,r.FD)(U.$n,{priority:"secondary-outline",size:"sm",rounded:!0,color:"secondary",children:[e.label,(0,r.Y)(_.A,{className:Q,size:16})]}),children:null==(t=e.subItems)?void 0:t.map(e=>{var t;let n=e.noFollow?null:e.logoUrl;return(0,r.Y)(N.Dr,{href:e.href,native:e.isNative,onClick:e.onClick,leading:n?(0,r.Y)(C.c,{height:24,radius:"xs",src:n,width:24}):null,children:e.label},null!=(t=e.slug)?t:e.label)})},null!=(n=e.slug)?n:e.label)}),L.length>0&&(0,r.Y)(N.W1,{align:"start",trigger:(0,r.FD)(U.$n,{priority:"secondary-outline",size:"sm",rounded:!0,color:"secondary",children:[d("More"),(0,r.Y)(_.A,{className:Q,size:16})]}),children:L.map(e=>{let t=e.noFollow?null:e.logoUrl;return(0,r.Y)(N.Dr,{href:e.href,native:e.isNative,onClick:e.onClick,leading:t?(0,r.Y)(C.c,{height:24,radius:"xs",src:t,width:24}):null,children:e.label},e.slug)})})]})})]})};var et=n(89230),en=n(48697),el=n(33764),er=n(89490),ei=n(91401),eo=n(45974),ea=n(75303),es=n(63136),ed=n(8312);let ec="menuItem-DLEJaw",eu=e=>{let{item:t,pub:n,selectedSectionId:l,onClose:i,depth:o=0}=e,[a,s]=(0,c.useState)(!1),d=t.logoUrl;if(t.subItems&&t.subItems.length>0)return(0,r.FD)(S.VP,{children:[(0,r.Y)(U.$n,{onClick:()=>s(!a),className:ec,priority:"tertiary",children:(0,r.FD)(S.Ye,{alignItems:"center",justifyContent:"space-between",gap:12,paddingY:12,children:[(0,r.Y)(S.Ye,{alignItems:"center",gap:12,children:(0,r.Y)(es.EY,{weight:"regular",font:"text",children:t.label})}),(0,r.Y)(_.A,{size:20,style:{transform:a?"rotate(0deg)":"rotate(-90deg)",transition:"transform 0.2s ease"}})]})}),a&&(0,r.Y)(S.VP,{paddingTop:8,paddingLeft:0===o?8:16,children:t.subItems.map(e=>(0,r.Y)(eu,{item:e,pub:n,selectedSectionId:l,onClose:i,depth:o+1},e.label))})]});if(t.subItems)return null;let u=t.slug===l;return(0,r.Y)(x.A,{href:t.href,native:t.isNative,rel:t.noFollow?"nofollow":void 0,onClick:()=>{var e;null==(e=t.onClick)||e.call(t),i()},className:ec,"data-selected":u,children:(0,r.FD)(S.Ye,{alignItems:"center",gap:12,paddingLeft:16*!d,paddingY:12,children:[d&&(0,r.Y)(C.c,{height:24,radius:"xs",src:d,width:24}),(0,r.Y)(es.EY,{font:"text",children:t.label})]})})},eh=e=>{var t;let{item:n,pub:l,selectedSectionId:i,onClose:o,onToggleExpand:a,isExpanded:s}=e;return(0,r.FD)(S.VP,{gap:0,children:[(0,r.Y)(U.$n,{size:"sm",onClick:()=>null==a?void 0:a(n.label),className:ec,priority:"tertiary",children:(0,r.FD)(S.Ye,{alignItems:"center",justifyContent:"space-between",gap:12,paddingY:4,paddingLeft:8,children:[(0,r.Y)(S.Ye,{alignItems:"center",gap:12,children:(0,r.Y)(es.EY,{weight:"regular",font:"text",children:n.label})}),(0,r.Y)(_.A,{size:20,style:{transform:s?"rotate(0deg)":"rotate(-90deg)",transition:"transform 0.2s ease"}})]})}),s&&(0,r.Y)(S.VP,{gap:0,paddingTop:8,paddingLeft:8,children:null==(t=n.subItems)?void 0:t.map(e=>(0,r.Y)(eu,{item:e,pub:l,selectedSectionId:i,onClose:o,depth:1},e.label))})]})},em=e=>{let{item:t,selectedSectionId:n,onClose:l}=e,i=t.slug===n,o=t.logoUrl;return(0,r.Y)(x.A,{href:t.href,native:t.isNative,rel:t.noFollow?"nofollow":void 0,onClick:()=>{var e;null==(e=t.onClick)||e.call(t),l()},className:ec,"data-selected":i,children:(0,r.FD)(S.Ye,{alignItems:"center",gap:12,paddingLeft:o?8:16,paddingY:4,sizing:"border-box",height:32,children:[o&&(0,r.Y)(C.c,{height:24,radius:"xs",src:o,width:24}),(0,r.Y)(es.EY,{font:"text",children:t.label})]})})},ef=e=>{var t,n,i,o,a,s;let{isChatActive:d,isMeetingsActive:u,pub:m,selectedSectionId:f,showLogo:p}=e,{iString:g}=(0,v.GO)(),[b,w]=(0,c.useState)(!1),[Y,_]=(0,c.useState)(new Set),y=k({pub:m,isChatActive:d,isMeetingsActive:u}).filter(e=>"/"!==e.href&&(!e.subItems||e.subItems.length>0)),C=null==(n=m.theme)||null==(t=n.font_options)?void 0:t.wordmark,x=null!=(s=null==(o=m.theme)||null==(i=o.font_options)?void 0:i.heading)?s:null==(a=m.theme)?void 0:a.font_preset_heading,I=null!=C?C:x,N=I?(0,ed.OK)(I):null,F=()=>{w(!1)},A=e=>{_(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,r.FD)(r.FK,{children:[p?(0,r.FD)(U.$n,{"aria-label":g("Navigation menu"),priority:"tertiary",onClick:()=>w(!0),style:{gap:6,padding:"0 4px"},children:[(0,r.Y)(eo.Nq,{pub:m,size:32}),(0,r.Y)(et.A,{size:18})]}):(0,r.Y)(U.K0,{size:"md",priority:"tertiary","aria-label":g("Navigation menu"),onClick:()=>w(!0),children:(0,r.Y)(et.A,{size:20})}),(0,r.Y)(ei._,{isOpen:b,onClose:F,width:320,className:"drawer-_gS8Z4",style:b?{}:{visibility:"hidden"},children:(0,r.Y)(ei._.Body,{radius:"none",children:(0,r.FD)(S.VP,{gap:16,children:[(0,r.Y)(S.Ye,{alignItems:"start",paddingX:8,gap:12,children:(0,r.Y)(er.az,{onClick:F,cursor:"pointer",children:(0,r.Y)(en.A,{size:24})})}),(0,r.Y)(S.Ye,{paddingX:8,paddingBottom:4,justifyContent:"center",children:(0,r.Y)(ea.AE,{href:"/",onClick:F,children:m.logo_url_wide?(0,r.Y)(el.o,{src:m.logo_url_wide,maxWidth:224,useRetinaSizing:!0,imageIsFixedWidth:!0}):(0,r.Y)("span",{style:(0,h._)((0,l._)({},N),{width:"224px",textAlign:"center"}),children:m.name})})}),y.map(e=>{var t;return(null==(t=e.subItems)?void 0:t.length)?(0,r.Y)(eh,{item:e,pub:m,selectedSectionId:f,onClose:F,onToggleExpand:A,isExpanded:Y.has(e.label)},e.label):(0,r.Y)(em,{item:e,pub:m,selectedSectionId:f,onClose:F},e.label)})]})})})]})},ep=()=>Math.max(document.documentElement.scrollTop||document.body.scrollTop,0),eg=e=>{let{alwaysShow:t,disable:n,menuContentRef:l,menuHeight:r,ignoreScroll:i=!1}=e,o=(0,c.useRef)(!1),a=(0,c.useRef)(ep()),s=(0,c.useRef)(ep()),d=(0,c.useCallback)((e,t)=>{a.current=t,l.current&&(l.current.style.position=e,l.current.style.top="fixed"===e&&t>=0?"":"".concat(t,"px"))},[l]),u=(0,c.useCallback)(()=>{d("absolute",ep()-r),o.current=!1},[r,d]),h=(0,c.useCallback)(e=>{let t=e.target;((null==t?void 0:t.classList.contains("footnote-number"))||(null==t?void 0:t.classList.contains("footnote-anchor")))&&(o.current=!0,setTimeout(u,0))},[u]),m=(0,c.useCallback)(()=>{var e;if(t)return void d("fixed",0);if(o.current)return;let i=s.current;s.current=ep();let c=s.current,u=(null==(e=l.current)?void 0:e.style.position)==="fixed",h=c<=0||0>=(0,V.A9)(),m=c>=(0,V.A9)(),f=c>i,p=c=0)return void d("absolute",c);if(!u&&a.currentc)return void d("fixed",c);let e=Math.max(c-r,0);if(a.current{if("undefined"!=typeof window&&!i)return window.addEventListener("scroll",m),window.addEventListener("click",h),m(),()=>{window.removeEventListener("scroll",m),window.removeEventListener("click",h)}},[n,h,m,d,i])};var ev=n(86500),eb=n(44333),ew=n(72682),eY=n(71783),ek=n(37764),e_=n(39318),ey=n(57324);let eC={mainMenuContent:"mainMenuContent-DME8DR",profileContext:"profileContext-urkyyv",relative:"relative-ozgOAS",topBar:"topBar-pIF0J1",titleWithWordmark:"titleWithWordmark-GfqxEZ",titleContainer:"titleContainer-DJYq5v",overflowVisible:"overflowVisible-joA5t0",fullScreen:"fullScreen-Zzi89N",title:"title-oOnUGd",buttonsContainer:"buttonsContainer-SJBuep",logoContainer:"logoContainer-p12gJb",wordmark:"wordmark-WcDTTu",logoLeftAvatar:"logoLeftAvatar-XEWHpd",logoLeftWordmark:"logoLeftWordmark-FeTNhG",logoCenterPostAvatar:"logoCenterPostAvatar-MJBapZ",logoCenterPostWordmark:"logoCenterPostWordmark-j7Svao",logoLeftPostWordmark:"logoLeftPostWordmark-ERptdm",logoLeftNav:"logoLeftNav-eAaUI5",logoCenterSlot:"logoCenterSlot-xJtI3r",logoCenterPostSlot:"logoCenterPostSlot-qYOnTB",logoTopCenterSlot:"logoTopCenterSlot-hss6WZ",stackedTopCenter:"stackedTopCenter-TPTTqw",logoCenterPostLeftSlot:"logoCenterPostLeftSlot-EIqNto"},ex=e=>{let{pub:t,wordmarkHeight:n,isMinimized:i=!1,maxWordmarkSize:o,wordmarkFont:a,headingFont:s}=e;if(t.logo_url_wide)return(0,r.Y)("img",{alt:t.name,src:(0,B.dJ9)(t.logo_url_wide,null,{height:2*n,crop:"limit",leadingSegments:["e_trim:10:white","e_trim:10:transparent"],aspect:1318/252}),className:eC.wordmark,style:{maxHeight:Math.max(20,i?eB:n)}});let d=(0,f.$L)(n,f.Rc,o/2),c=null!=a?a:s,u=c?(0,ed.OK)(c):null;return(0,r.Y)("span",{style:(0,l._)({fontSize:"min(".concat(d,"rem, 5vw)"),lineHeight:1},u),children:t.name})},eI=e=>{var t;let{pub:n,wordmarkHeight:l,maxWordmarkSize:i,homeHref:a,fullScreen:s=!1,isMinimized:d=!1,anchor:c="center",wordmarkFont:u,headingFont:h}=e,m=n.logo_url_wide?f.be:f.Rc,p=n.logo_url_wide?i:i/2,g=n.logo_url_wide?l:l&&l!==eD?Math.min(Math.max(l,m),p):f.YR;return(0,r.Y)("div",{className:o()(eC.titleContainer,n.logo_url_wide&&eC.overflowVisible,s&&eC.fullScreen),style:{flexGrow:0},children:(0,r.Y)(es.EY,{as:"h1",className:o()(eC.title,{[null!=(t=eC.titleWithWordmark)?t:""]:n.logo_url_wide}),font:"pub-headings",id:"wordlogo",children:(0,r.Y)(ea.AE,{href:a,children:(0,r.Y)(ew.c,{anchor:c,max:p,min:m,property:"wordmarkLogoSize",value:g,children:e=>(0,r.Y)(ex,{headingFont:h,isMinimized:d,maxWordmarkSize:i,pub:n,wordmarkFont:u,wordmarkHeight:e})})})})})},eS=e=>{var t,n,i,a,s,v,b,Y,k,_,y,C,x,N,F,A,L,E,M,R;let{className:T,freeSignup:W,freeSignupEmail:P,hideNavBar:O,hideTitle:q,isAccountContext:H,isChatActive:V,isMeetingsActive:J,isPostView:K,pub:$,selectedSectionId:G,showCustomerSupportModeModal:Z,user:Q}=e;q="profile"===$.homepage_type||q;let{getConfigFor:et}=(0,w.mJ)(),{isMobile:en}=(0,I.sM)(),[el,er]=(0,c.useState)(!1),[ei,ea]=(0,c.useState)(!1),[es,ed]=(0,c.useState)(!1),ec=(0,m.md)(eY.Jv),eu=(0,m.md)(eY.MS),{path:eh}=(0,eb.zy)(),em=(0,c.useRef)(null),ep=(0,c.useRef)(null),ew=(0,c.useRef)(null),ex=(0,c.useRef)(null),[eS,eF]=(0,c.useState)(null),eA=(0,c.useRef)(null),eL=(0,c.useRef)(null),[eB,eM]=(0,c.useState)(null);(0,c.useLayoutEffect)(()=>{let e=()=>{er(window.innerWidth<=992),ea(window.innerWidth<=768),ed(window.innerWidth<=600)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);let eR="profile"===$.homepage_type,eT=eR&&eh.match(/\/profile\/(subscribers|followers|following)/),ez=!eR&&!!$.logo_url&&!(0,D.S2)({pub:$}),eO=!q,eq=!!et("show_menu_on_posts"),eH=K?eq:!O,eV=(e=>{var t,n,l,r,i,o,a;let s,{theme:d,isPostView:c=!1,showNavOnPosts:u=!1}=e,h=(null==d||null==(t=d.custom_header)?void 0:t.layout)||ek.Tb.layout,m=(null==d||null==(n=d.custom_header)?void 0:n.navPosition)||ek.Tb.navPosition,p=(null==d||null==(l=d.custom_header)?void 0:l.navStyle)||ek.Tb.navStyle,{max:g}=(0,f.TB)({layout:h,navPosition:m,navStyle:p,isPostView:c}),v="stacked"===h?"top"===m&&(!c||u)?"bottom-center":"top-center":"logo_left"===h?"top-left":"top-center";return s="stacked"===h?"top"===m?"top-left":"bottom-center":"logo_left"===h?"top-center":"top-left",{layout:h,wordmarkLogoSize:Math.min((null==d||null==(r=d.custom_header)?void 0:r.wordmarkLogoSize)||eD,g),maxWordmarkSize:g,wordmarkPosition:v,publicNavPosition:s,publicNavStyle:(null==d||null==(i=d.custom_header)?void 0:i.navStyle)||"text",backgroundColor:null!=(a=null==d||null==(o=d.custom_header)?void 0:o.backgroundColor)?a:void 0}})({theme:ec&&$.theme?(0,h._)((0,l._)({},$.theme),{custom_header:(0,l._)({},ek.Tb,$.theme.custom_header,ec)}):$.theme,isPostView:K,showNavOnPosts:eq}),{wordmarkPosition:eU,wordmarkLogoSize:eJ,maxWordmarkSize:ej,publicNavPosition:eK,layout:e$}=eV,eG=null!=eu?eu:null==(n=$.theme)||null==(t=n.font_options)?void 0:t.wordmark,eX=null!=(_=null==(a=$.theme)||null==(i=a.font_options)?void 0:i.heading)?_:null==(s=$.theme)?void 0:s.font_preset_heading,eZ="buttons"===eV.publicNavStyle,eQ="stacked"===eV.publicNavStyle,e0="logo_center"===e$&&eQ?"stacked":e$,e1=el&&"logo_left"===e0,e4=el&&"logo_center"===e0,e2=ei&&eQ&&"stacked"===e0,e6=es&&"stacked"===e0&&"top-left"===eK&&!eQ,e3=en?240:340,e8=en?160:370,e7=en&&("bottom-center"!==eU||eQ)?eE:eJ||($.logo_url_wide?eD:f.YR),{currentTopBarHeight:e9,currentMenuHeight:e5,isMinimized:te}=eN({forceMaximized:!K&&!H,forceMinimized:!!H,isMobile:en,showNavBar:"stacked"===e0&&"bottom-center"===eK&&eH,showWordmark:eO,themeLayoutOptions:eV,scaledWordmarkHeight:e7,isTextWordmark:!$.logo_url_wide}),tt=en?eW:eP,tn=!en&&"top-center"===eU&&("stacked"===e0||"logo_center"===e0),tl="bottom-center"===eU&&!(en&&eQ);eg({alwaysShow:!1,disable:!K,menuContentRef:em,menuHeight:e5,ignoreScroll:tl});let tr=H?(0,B.$_T)($):"/",ti=eR&&!K&&!H&&!en,to=()=>{(0,ev.u4)(ev.qY.NAV_BAR_HOME_LINK_CLICKED)},ta=!!eV.backgroundColor,ts="logo_left"===e0||eH&&"stacked"===e0&&"top-left"===eK&&!eQ,td=el&&"stacked"===e0;(0,c.useLayoutEffect)(()=>{let e=()=>{var e,t;let n;if(!ex.current||!ep.current)return;let l=ex.current.getBoundingClientRect(),r=ep.current.getBoundingClientRect(),i=null==(e=ew.current)?void 0:e.getBoundingClientRect(),o=null!=(t=null==i?void 0:i.right)?t:l.left+tt;if(td){let e=l.left+tt;n=Math.max(0,Math.floor(r.left-e-32))}else{let e=l.left+l.width/2,t=r.left-e;n=Math.max(0,Math.floor((Math.min(e-o,t)-32)*2))}eF(n)};eF(null);let t=requestAnimationFrame(e);return window.addEventListener("resize",e),()=>{cancelAnimationFrame(t),window.removeEventListener("resize",e)}},[td,tt,e0,eU,eK]);let tc="stacked"===e0&&"top-left"===eK&&!eQ;return(0,c.useLayoutEffect)(()=>{if(!tc)return void eM(null);let e=()=>{var e;if(!eA.current||!ep.current)return;let t=eA.current.getBoundingClientRect(),n=ep.current.getBoundingClientRect(),l=null==(e=eL.current)?void 0:e.getBoundingClientRect(),r=l?l.right+12:t.left;eM(Math.max(0,Math.floor(n.left-r-32)))};eM(null);let t=requestAnimationFrame(e);return window.addEventListener("resize",e),()=>{cancelAnimationFrame(t),window.removeEventListener("resize",e)}},[tc]),(0,r.Y)(g.X,{pub:$,prefix:ta?"header":void 0,children:(0,r.FD)("div",{className:o()("main-menu",T),"data-testid":"navbar",children:[(0,r.FD)("div",{ref:em,className:o()(eC.mainMenuContent,ti&&eC.profileContext,tl&&eC.relative),children:[(0,r.FD)(S.Ye,{ref:ex,alignItems:"center",borderBottom:eH?void 0:"detail",className:eC.topBar,gap:12,justifyContent:"space-between",paddingBottom:en?eH&&"bottom-center"===eK?0:12:0,paddingTop:12*!!en,paddingX:tt,style:en?void 0:{position:"relative",height:e9-1},children:[(e1||e4)&&eH||e2||e6?(0,r.FD)("div",{ref:ew,style:{display:"flex",alignItems:"center",gap:12},children:[(0,r.Y)(ef,{isChatActive:V,pub:$,selectedSectionId:G,showLogo:!e6&&(null==(b=$.theme)||null==(v=b.custom_header)?void 0:v.showLogo)!==!1}),!e6&&(0,r.Y)("div",{className:eC.logoLeftWordmark,children:(0,r.Y)(eI,{anchor:"left",headingFont:eX,homeHref:tr,maxWordmarkSize:ej,pub:$,wordmarkFont:eG,wordmarkHeight:e7,isMinimized:te})})]}):q||"top-left"!==eU?eH&&"top-left"===eK?(0,r.FD)("div",{ref:eA,className:o()(eC.logoContainer,{[null!=(x=eC.logoLeftNav)?x:""]:"logo_center"===e0}),style:{display:eR?"none":"flex",alignItems:"center",flexBasis:0,flexGrow:1,gap:12},children:["stacked"===e0&&ez&&!eQ&&!ei&&(0,r.Y)("div",{ref:eL,children:(0,r.Y)(eo.wg,{href:tr,pub:$,size:40,onClick:to})}),eZ?(0,r.Y)(ee,{isChatActive:!0,isMeetingsActive:!1,maxWidth:tc?null!=eB?eB:void 0:e8,pub:$,selectedSectionId:G,alignStart:!0}):eQ?(0,r.Y)(ef,{isChatActive:V,pub:$,selectedSectionId:G,showLogo:(null==(k=$.theme)||null==(Y=k.custom_header)?void 0:Y.showLogo)!==!1}):(0,r.Y)(X,{alignStart:!0,hideBorders:!0,isChatActive:V,isMeetingsActive:J,pub:$,selectedSectionId:G,maxWidth:tc?null!=eB?eB:void 0:e3})]}):(0,r.FD)("div",{className:o()(eC.logoContainer,{[null!=(N=eC.stackedTopCenter)?N:""]:"stacked"===e0&&"top-center"===eK,[null!=(F=eC.logoCenterPostLeftSlot)?F:""]:"logo_center"===e0&&K}),style:{display:eR||en&&"stacked"===e0?"none":null,visibility:ez?"visible":"hidden",flex:en||ts?"0 0 auto":"1 0 0"},children:[eR&&(0,r.FD)(S.Ye,{alignItems:"center",gap:40,children:[(0,r.Y)(S.pT,{alignItems:"center",as:"a",height:20,href:(0,B.yRP)((0,B.$_T)(),{utm_content:ey.fL.islandSubstackLogo}),justifyContent:"center",tabIndex:-1,width:20,children:(0,r.Y)(u.A,{style:{transform:"scale(1.4)"}})}),eT&&(0,r.Y)(U.K0,{className:eC.backButton,href:(0,e_.fOI)($),size:"md",children:(0,r.Y)(d.A,{size:20})})]}),ez&&!(en&&"stacked"===e0)&&(0,r.Y)(eo.wg,{href:tr,pub:$,size:40,onClick:to})]}):(0,r.Y)("div",{ref:ew,style:{display:"flex",alignItems:"center",gap:12},children:"logo_left"===eV.layout?(0,r.FD)(r.FK,{children:[(0,r.Y)("div",{className:o()(eC.logoLeftAvatar,{[null!=(y=eC.logoLeftPostAvatar)?y:""]:K}),children:(0,r.Y)(eo.wg,{href:tr,pub:$,size:40,onClick:to})}),(0,r.Y)("div",{className:o()(eC.logoLeftWordmark,{[null!=(C=eC.logoLeftPostWordmark)?C:""]:K}),children:(0,r.Y)(eI,{anchor:"left",headingFont:eX,homeHref:tr,maxWordmarkSize:ej,pub:$,wordmarkFont:eG,wordmarkHeight:e7,isMinimized:te})})]}):(0,r.Y)(eI,{anchor:"left",headingFont:eX,homeHref:tr,maxWordmarkSize:ej,pub:$,wordmarkFont:eG,wordmarkHeight:e7,isMinimized:te})}),!q&&"top-center"===eU&&!e4&&!e2&&(0,r.Y)("div",{className:o()({[null!=(A=eC.logoCenterSlot)?A:""]:"logo_center"===e0,[null!=(L=eC.logoCenterPostSlot)?L:""]:"logo_center"===e0&&K,[null!=(E=eC.logoTopCenterSlot)?E:""]:"stacked"===e0}),style:{flexBasis:0,flexGrow:tn||en?2:0,display:"flex",justifyContent:en?"flex-start":"center"},children:"logo_center"===e0?(0,r.FD)(r.FK,{children:[(0,r.Y)("div",{className:o()(eC.logoLeftAvatar,{[null!=(M=eC.logoCenterPostAvatar)?M:""]:K}),style:{visibility:ez?"visible":"hidden"},children:(0,r.Y)(eo.wg,{href:tr,pub:$,size:40,onClick:to})}),(0,r.Y)("div",{className:o()(eC.logoLeftWordmark,{[null!=(R=eC.logoCenterPostWordmark)?R:""]:K}),children:(0,r.Y)(eI,{headingFont:eX,homeHref:tr,maxWordmarkSize:ej,pub:$,wordmarkFont:eG,wordmarkHeight:e7,isMinimized:te})})]}):(0,r.Y)(eI,{headingFont:eX,homeHref:tr,maxWordmarkSize:ej,pub:$,wordmarkFont:eG,wordmarkHeight:e7,isMinimized:te})}),eH&&"top-center"===eK&&!e1&&!e4&&(0,r.Y)("div",{style:ts?{flex:"1 1 0",minWidth:0}:el&&"stacked"===e0?{flex:"0 0 auto"}:{position:"absolute",left:"50%",transform:"translateX(-50%)",visibility:null!==eS?"visible":"hidden"},children:eZ?(0,r.Y)(ee,{alignStart:ts,isChatActive:!0,isMeetingsActive:!1,maxWidth:ts?void 0:null!=eS?eS:e8,pub:$,selectedSectionId:G}):(0,r.Y)(X,{alignStart:ts||el&&"stacked"===e0,hideBorders:!0,isChatActive:V,isMeetingsActive:J,pub:$,selectedSectionId:G,maxWidth:ts?void 0:null!=eS?eS:e3})}),(0,r.Y)(S.Ye,{alignItems:"center",justifyContent:"end",style:{flexBasis:0,flexGrow:+!ts,minWidth:"fit-content"},children:(0,r.Y)("div",{ref:ep,className:eC.buttonsContainer,children:(0,r.Y)(p.A,{freeSignup:W,freeSignupEmail:P,isMeetingsActive:J,pub:$,showCustomerSupportModeModal:Z,user:Q})})})]}),eH&&"bottom-center"===eK&&("buttons"===eV.publicNavStyle?(0,r.Y)(S.pT,{alignItems:"center",justifyContent:"start",children:(0,r.Y)(j,{isChatActive:!0,isMeetingsActive:!1,maxWidth:"100%",pub:$,selectedSectionId:G})}):(0,r.Y)(z,{isChatActive:V,isMeetingsActive:J,pub:$,selectedSectionId:G})),!q&&"bottom-center"===eU&&!e2&&(0,r.Y)(S.Ye,{justifyContent:"center",paddingY:8,children:(0,r.Y)(eI,{fullScreen:!0,headingFont:eX,homeHref:tr,maxWordmarkSize:ej,pub:$,wordmarkFont:eG,wordmarkHeight:e7})})]}),!tl&&(0,r.Y)("div",{style:{height:e5}})]})})},eN=e=>{let{forceMaximized:t,forceMinimized:n,isMobile:l,showNavBar:r,showWordmark:i,themeLayoutOptions:o,scaledWordmarkHeight:a,isTextWordmark:d=!1}=e,[u,h]=(0,c.useState)(!1),m=(0,c.useRef)(null),p=!!n||!t&&u,g=e=>{if(l)return r?eM:eR;if(i){let e=d?f.Rc:eD;return(d?eT:ez)+("bottom-center"!==o.wordmarkPosition&&!p&&a>e?a-e:0)}return eT},v=r?l?eO:eq:0,b=g(p),w=g(!1),Y="bottom-center"!==o.wordmarkPosition||l&&"stacked"===o.publicNavStyle?0:a,k=w+v+Y,_=(0,c.useCallback)(()=>{let e=m.current,t=document.documentElement.scrollTop||document.body.scrollTop;m.current=t,s()(e)||(t>e?t>k+5&&h(!0):t<=0&&h(!1))},[k]);return(0,c.useEffect)(()=>{h(!1)},[o.wordmarkPosition,o.layout]),(0,c.useEffect)(()=>(window.addEventListener("scroll",_),()=>window.removeEventListener("scroll",_)),[_]),{currentTopBarHeight:b,currentMenuHeight:b+v+Y,isMinimized:p}};var eF=n(73815),eA=n(13950),eL=n(32087);let eE=20,eD=36,eB=40,eM=44,eR=56,eT=72,ez=88,eW=12,eP=20,eO=45,eq=50,eH=e=>{var t;let{className:n,freeSignup:i,freeSignupEmail:a,hideNavBar:s,hideTitle:h,isAccountContext:m,isChatActive:f,isMeetingsActive:g,isPostView:v,pub:b,selectedSectionId:Y,showCustomerSupportModeModal:k,user:_,profile:y}=e;h="profile"===b.homepage_type&&!v||h;let{getConfigFor:C}=(0,w.mJ)(),{isMobile:x}=(0,I.sM)(),{path:N}=(0,eb.zy)(),F=(0,c.useRef)(null),A=(0,c.useRef)(null),L=(0,c.useRef)(null),E="profile"===b.homepage_type,M=E&&N.match(/\/profile\/(subscribers|followers|following)/),R=!E&&!!b.logo_url&&!(0,D.S2)({pub:b}),T=!!(!h&&b.logo_url_wide),W=v?!!C("show_menu_on_posts"):!s,P=(0,D.S2)({pub:b})||!!(C("larger_wordmark_on_publication_homepage")&&T),{currentMenuHeight:O,currentTopBarHeight:q,isMinimized:H,maxMenuHeight:V}=eU({hasExpandableTopBar:P,forceMaximized:!v&&!m,forceMinimized:!!m,isMobile:x,showNavBar:W,showWordmark:T}),J=x?eW:P?40:eP,j=!x&&P&&H?20:0,K=x?P?32:eE:P?72:eD,$=!x&&P&&H?eB/72:1;eg({alwaysShow:!1,disable:!v,menuContentRef:F,menuHeight:O});let{shouldCenterTitle:G}=eJ({buttonsRef:L,titleRef:A,horizontalGap:12,horizontalPadding:P?40:eP}),X=x||!G,Z=m?(0,B.$_T)(b):"/",Q=E&&!v&&!m&&!x;return(0,r.Y)(ej,{profile:y,pub:b,useAccentTheme:!!m,children:(0,r.FD)("div",{className:o()("main-menu",n),"data-testid":"navbar",children:[(0,r.FD)("div",{ref:F,className:o()(eC.mainMenuContent,Q&&eC.profileContext),children:[(0,r.FD)(S.Ye,{alignItems:"center",borderBottom:W?void 0:"detail",className:eC.topBar,gap:12,justifyContent:"space-between",paddingBottom:x?12*!W:void 0,paddingTop:x?12:void 0,paddingX:J,style:x?void 0:{position:"relative",height:q-1},children:[(0,r.FD)("div",{className:eC.logoContainer,style:(0,l._)({display:E&&!v||!R&&X?"none":null,flexBasis:0,flexGrow:+!X},P?{transform:"translateX(-".concat(j,"px)")}:null),children:[E&&(0,r.FD)(S.Ye,{alignItems:"center",gap:40,children:[(0,r.Y)(S.pT,{alignItems:"center",as:"a",height:20,href:(0,B.yRP)((0,B.$_T)(),{utm_content:ey.fL.islandSubstackLogo}),justifyContent:"center",tabIndex:-1,width:20,children:x?(0,r.Y)(u.A,{height:24}):(0,r.Y)(u.A,{style:{transform:"scale(1.4)"}})}),M&&(0,r.Y)(U.K0,{className:eC.backButton,href:(0,e_.fOI)(b),size:x?"sm":"md",children:(0,r.Y)(d.A,{size:20})})]}),R&&(0,r.Y)(eo.wg,{href:Z,pub:b,size:x?32:40,onClick:()=>{(0,ev.u4)(ev.qY.NAV_BAR_HOME_LINK_CLICKED)}})]}),!h&&(0,r.Y)("div",{ref:A,className:eC.titleContainer,style:(0,l._)({flexGrow:0},P?{transform:"translateX(".concat(X?-j:0,"px)")}:null),children:(0,r.Y)(es.EY,{as:"h1",className:o()(eC.title,{[null!=(t=eC.titleWithWordmark)?t:""]:b.logo_url_wide}),font:"pub-headings",children:(0,r.Y)(ea.AE,{href:Z,children:b.logo_url_wide?(0,r.Y)("img",{alt:b.name,src:(0,B.dJ9)(b.logo_url_wide,null,{height:2*K,crop:"limit",leadingSegments:["e_trim:10:white","e_trim:10:transparent"]}),style:(0,l._)({display:"block",height:K},P?{transform:"scale(".concat($,")"),transformOrigin:X?"left":"center"}:null)}):E?b.author_name:b.name})})}),(0,r.Y)(S.Ye,{alignItems:"center",justifyContent:"end",style:{flexBasis:0,flexGrow:1},children:(0,r.Y)("div",{ref:L,className:eC.buttonsContainer,style:P?{transform:"translateX(".concat(j,"px)")}:void 0,children:(0,r.Y)(p.A,{freeSignup:i,freeSignupEmail:a,isMeetingsActive:g,pub:b,showCustomerSupportModeModal:k,user:_})})})]}),W&&(0,r.Y)(z,{isChatActive:f,isMeetingsActive:g,pub:b,selectedSectionId:Y})]}),(0,r.Y)("div",{style:{height:V}})]})})},eV=e=>{var t;return(null==(t=e.pub.theme)?void 0:t.custom_header)?(0,r.Y)(eS,(0,l._)({},e)):(0,r.Y)(eH,(0,l._)({},e))},eU=e=>{let{forceMaximized:t,forceMinimized:n,hasExpandableTopBar:l,isMobile:r,showNavBar:i,showWordmark:o}=e,[a,d]=(0,c.useState)(!1),u=(0,c.useRef)(null),h=!!n||!t&&a,m=e=>r?i?l?44:eM:eR:l?e?72:120:o?ez:eT,f=i?r?eO:eq:0,p=m(n)+f,g=m(h),v=(0,c.useCallback)(()=>{let e=u.current,t=document.documentElement.scrollTop||document.body.scrollTop;u.current=t,s()(e)||(t>e?t>p+5&&d(!0):t<=0&&d(!1))},[p]);return(0,c.useEffect)(()=>(window.addEventListener("scroll",v),()=>window.removeEventListener("scroll",v)),[v]),{currentMenuHeight:g+f,currentTopBarHeight:g,isMinimized:h,maxMenuHeight:p}},eJ=e=>{let{buttonsRef:t,titleRef:n,horizontalGap:l,horizontalPadding:r}=e,{isMobile:i}=(0,I.sM)(),[o,a]=(0,c.useState)(!i),s=(0,c.useCallback)(()=>{if(!t.current||!n.current)return;if(i)return void a(!1);let e=t.current.getBoundingClientRect().width,o=n.current.getBoundingClientRect().width;a(.5*document.body.clientWidth-e-l-r>.5*o)},[t,l,r,i,n]);return(0,c.useEffect)(()=>(window.addEventListener("resize",s),s(),setTimeout(s,0),()=>{window.removeEventListener("resize",s)}),[s]),{shouldCenterTitle:o}},ej=e=>{let{profile:t,pub:n,useAccentTheme:l,children:i}=e;return l?(0,r.Y)(eF.Z,{children:i}):"profile"===n.homepage_type&&t?(0,r.Y)(eL.b,{theme:t.theme,children:i}):(0,r.Y)(eA.DH,{children:i})}},6641:function(e,t,n){n.d(t,{S:()=>v});var l=n(4006),r=n(35426),i=n(38390),o=n(32485),a=n.n(o),s=n(48697),d=n(17402),c=n(13950),u=n(35369),h=n(76977),m=n(80988),f=n(45346),p=n(48028),g=n(98793);let v=e=>{let{children:t,disableCloseOnBackdropClick:n=!1,fullscreenMobile:o,hideCloseButton:v,initialFocus:b,isOpen:w,testId:Y="modal",width:k=660,stretchModal:_=!1,onClose:y=()=>void 0}=e,C=(0,d.useRef)(null);return(0,l.Y)(c.DH,{children:(0,l.Y)(i.bL,{open:w,onOpenChange:e=>{e||y()},children:(0,l.Y)(i.ZL,{forceMount:!0,children:(0,l.Y)(r.e.Root,{show:w,children:(0,l.FD)(m.k,{children:[(0,l.Y)(f.B,{children:(0,l.Y)(f.k,{disableCloseOnBackdropClick:n,onClose:y})}),(0,l.Y)(g.p,{children:(0,l.FD)(p.I,{className:_?a()("modalBodyStretched-aq1p4E","the-free-press-theme"):a()("modalBody-s4SL_V","the-free-press-theme"),disableCloseOnBackdropClick:n,fullscreenMobile:o,initialFocus:void 0===b?C:b,testId:Y,width:k,children:[(0,l.Y)("div",{ref:C,"aria-hidden":"true",style:{position:"absolute",left:"-9999px"},tabIndex:-1}),(0,l.Y)(c.DH,{children:(0,l.FD)(h.I1,{paddingTop:v?24:8,children:[!v&&(0,l.Y)(h.Ye,{justifyContent:"end",children:(0,l.Y)(i.bm,{asChild:!0,children:(0,l.Y)(u.K0,{priority:"quaternary",onClick:y,children:(0,l.Y)(s.A,{})})})}),t]})})]})})]})})})})})}},46275:function(e,t,n){n.d(t,{BR:()=>s,Sn:()=>a});var l=n(4006),r=n(17402),i=n(92636);let o=(0,r.createContext)({isOnDestination:(0,i.Sg)()});function a(e){let{children:t}=e,n=(0,r.useMemo)(()=>({isOnDestination:(0,i.Sg)()}),[]);return(0,l.Y)(o.Provider,{value:n,children:t})}function s(){return(0,r.useContext)(o)}o.displayName="IsDestinationContext"},97640:function(e,t,n){n.d(t,{Vd:()=>p,_b:()=>m});var l=n(4006),r=n(17402),i=n(79909),o=n(25006),a=n(94729),s=n(59922),d=n(12501),c=n(82772),u=n(68349),h=n(4016);function m(e){let{defaultState:t,shouldLoad:n=!0,shouldPoll:r=!1,activityToken:i,children:o}=e;return(0,l.Y)(g,{defaultState:null==t?void 0:t.activity,shouldLoad:n,shouldPoll:r,activityToken:i,children:o})}let f=(0,r.createContext)({lastViewedAt:null,activityUnreadCount:0,activityUnreadAtMax:!1,refetch:async()=>!0,markAllAsRead:async()=>{},hasLoadedOnce:!1});function p(){return(0,r.useContext)(f)}function g(e){let{defaultState:t,shouldLoad:n=!0,shouldPoll:m=!1,activityToken:p,children:g}=e,v=(0,d.st)({pathname:"/api/v1/activity/unread",deps:[],auto:n,initialResult:t,query:{token:p}}),b=(0,o.df)(),w=!!b&&(0,h.lu)({pub:b}),Y=!(0,c.ov)()&&!w,k=async()=>{let e=await (0,a.x6)("/api/v1/activity/unread",{method:"post",json:{after:new Date().toISOString(),token:p}});v.setResult(e)};(0,s.A)(async()=>{if(m&&n&&(0,u.Tf)()){var e;let t=(null==(e=v.result)?void 0:e.count)||0,n=await v.refetch();if(t!==(!(n instanceof Error)&&n.count||0))return!0}},6e4);let _=null!=v.result?v.result.count:0;return(0,r.useEffect)(()=>{try{var e,t;null==(e=(t=navigator).setAppBadge)||e.call(t,_)}catch(e){console.warn(e)}},[_]),(0,l.FD)(f.Provider,{value:{lastViewedAt:null!=v.result?v.result.lastViewedAt:null,activityUnreadCount:_,activityUnreadAtMax:null!=v.result&&v.result.max,refetch:v.refetch,markAllAsRead:k,hasLoadedOnce:v.hasLoadedOnce},children:[(0,l.Y)(i.Metadata,{badge:Y?_:void 0}),g]})}f.displayName="NotificationsContext"},27749:function(e,t,n){n.d(t,{IJ:()=>u,PK:()=>m});var l=n(4006),r=n(17402),i=n(78479),o=n(5180),a=n(68391),s=n(46453),d=n(2481),c=n(62088);function u(e){let{state:t,dispatch:n,surface:u,children:m}=e,{onboardingModal:f}=(0,s.eE)(),p=(0,r.useMemo)(()=>({dispatch:n}),[]);return(0,l.Y)(h.Provider,{value:u,children:(0,l.Y)(o.et.Provider,{value:p,children:(0,l.Y)(o.tO.Provider,{value:t,children:(0,l.Y)(i.sc,{children:(0,l.Y)(d.wG,{children:(0,l.FD)(a.Kl,{children:[m,(0,l.Y)(c.M9,{isOpen:!!t.isSigningIn,onCancel:()=>n({type:"sign_in",payload:{isSigningIn:!1}}),onSuccess:()=>{n({type:"sign_in",payload:{isSigningIn:!1}}),document.location.reload()},onSignup:()=>{n({type:"sign_in",payload:{isSigningIn:!1}}),null==f||f.open()},noExit:t.signInNoExit})]})})})})})})}let h=(0,r.createContext)("feed");function m(){return(0,r.useContext)(h)}},43294:function(e,t,n){n.d(t,{X:()=>r});var l=n(17402);function r(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=(0,l.useRef)(e);return(0,l.useEffect)(()=>{var e;null==(e=t.current)||e.focus()},[]),t}},57446:function(e,t,n){n.d(t,{Q:()=>p});var l=n(4006),r=n(17402),i=n(85478),o=n(46271),a=n(44333),s=n(68349),d=n(83873),c=n(39318),u=n(92636),h=n(41086);let m=(0,r.createContext)({ageVerification:null,isLoading:!1});m.displayName="AgeVerificationContext";let f=["/settings","/account","/action/disable_email","/newsletters","/publish/home","/publish/settings","/publish/payments"];function p(e){var t;let{children:n}=e,p=(0,o.Jd)(),{path:g}=(0,a.zy)(),v=(0,a.lq)(),{getConfigFor:b}=(0,i.mJ)(),w=null!=(t=b("mobile_age_verification_learn_more_link"))?t:null,[Y,k]=(0,r.useState)(null);return(0,r.useEffect)(()=>{let e=()=>{let e=(0,h.y)(window.location.href,"redirect_url");e?(0,s.V2)(e,{local_navigation:!1}):v("/",!0)},t=window.location.hostname.replace(/\.localhost$/,""),n=t===u.xJ||t==="reader.".concat(u.xJ)||t==="www.".concat(u.xJ);if(function(e,t){let n=e=>"/"===e?e:e.replace(/\/$/,""),l=n(e);for(let e of f)if(l===e||l.startsWith("".concat(e,"/")))return!0;return!!t&&n((0,s.Hm)(t))===l}(g,w))return void k(null);if(!(null==p?void 0:p.id)){k(null),"/age-verification-required"===g&&e();return}let l=null==p?void 0:p.age_verification;if(!l||!l.force_verification){k(null),"/age-verification-required"===g&&e();return}if("/age-verification-required"===g){if(!n){let e=(0,c.q$g)(),t=new URL(window.location.href),n="".concat(e).concat(t.pathname).concat(t.search);(0,s.V2)(n,{local_navigation:!1});return}if(l.status===d.Y.CompletedAdult){k(null),e();return}k(l);return}if(k(l),l.status===d.Y.NotCompleted||l.status===d.Y.CompletedUnderage){let e=window.location.href;if(n)v((0,c.yRP)("/age-verification-required",{redirect_url:e}),!0);else{let t=(0,c.q$g)(),n=(0,c.yRP)("".concat(t,"/age-verification-required"),{redirect_url:e});(0,s.V2)(n,{local_navigation:!1})}}},[null==p?void 0:p.id,null==p?void 0:p.age_verification,g,v]),(0,l.Y)(m.Provider,{value:{ageVerification:Y,isLoading:!1},children:n})}},55200:function(e,t,n){n.d(t,{l:()=>r});var l=n(39318);function r(e,t){return(null==e?void 0:e.profile_set_up_at)?(0,l.gYq)(e,t):(0,l.W$o)((null==t?void 0:t.utm_source)?{utm_source:t.utm_source}:void 0)}},44333:function(e,t,n){n.d(t,{W5:()=>c,lq:()=>s,wN:()=>a,zy:()=>d});var l=n(99862),r=n(17402),i=n(73970),o=n(88377);function a(e,t){(0,r.useEffect)(()=>{let t=t=>{e(t)};return l.subscribers.push(t),()=>{l.subscribers.splice(l.subscribers.indexOf(t)>>>0,1)}},t)}function s(){if("react-router"===(0,r.useContext)(o.J)){let e=(0,i.Zp)();return(t,n)=>(e(t,{replace:n}),!0)}return l.route}function d(){if("react-router"===(0,r.useContext)(o.J)){let e=(0,i.zy)();return{url:"".concat(e.pathname).concat(e.search).concat(e.hash),path:e.pathname}}let[e]=function(){let[e,t]=(0,r.useState)({}),n=(0,r.useRef)(null);a(e=>{n.current=e,t({})},[]);let i=n.current||(0,l.getCurrentUrl)(),o=i.replace(/\?.+$/,"");return n.current=null,[{url:i,path:o},l.route]}();return e}function c(e){if("react-router"===(0,r.useContext)(o.J)){let t=e.replace(/:(\w+)\*/,"*"),n=(0,i.RQ)(t);return null==n?void 0:n.params}let{path:t}=d(),n=(0,l.exec)(t,e,{});return!1===n?null:n}},20562:function(e,t,n){n.d(t,{t:()=>d});var l=n(69277),r=n(4006),i=n(76977),o=n(63136),a=n(92636),s=n(49807);let d=e=>{let{firehoseFeedUrl:t,pub:n,section:d,trackingSource:c,variant:u="default"}=e,h=(0,a.yR)("/p/how-do-i-add-a-bulwark-member-only",(0,l._)({utm_source:c},d?{utm_content:d.id}:null)),m=(0,a.yR)("/account/add-all-podcasts",(0,l._)({utm_source:c},d?{utm_content:d.id}:null)),f=t?(0,r.FD)(o.EY.B3,{as:"li",font:"text",children:["Click here to set up your podcast app for"," ",(0,r.Y)("a",{href:t,rel:"noopener noreferrer",target:"_blank",children:"everything in one feed"})]}):null,p=(0,s.eV6)(n,{params:{utm_source:c}});return(0,r.Y)("div",{className:"container-o06YlK",children:"member-only"===u?(0,r.FD)(i.I1,{as:"ul",gap:4,children:[(0,r.FD)(o.EY.B3,{as:"li",font:"text",children:["Want to listen without ads? Join Bulwark+ for exclusive ad-free versions of all Bulwark shows."," ",(0,r.Y)("a",{href:p,rel:"noopener noreferrer",target:"_blank",children:"Upgrade now"})]}),(0,r.FD)(o.EY.B3,{as:"li",font:"text",children:["Already a Bulwark+ member? Login to access premium shows. ",(0,r.Y)("a",{href:h,children:"Learn more here"})]})]}):(0,r.FD)(i.I1,{as:"ul",gap:4,children:[(0,r.FD)(o.EY.B3,{as:"li",font:"text",children:["Learn about"," ",(0,r.Y)("a",{href:h,rel:"noopener noreferrer",target:"_blank",children:"setting up your Bulwark+ private podcast feeds"})]}),f||(0,r.FD)(o.EY.B3,{as:"li",font:"text",children:["Add the Bulwark Premium Show"," ",(0,r.Y)("a",{href:m,rel:"noopener noreferrer",target:"_blank",children:"super feed"})]})]})})}},12592:function(e,t,n){n.d(t,{c:()=>a});var l=n(4006),r=n(32485),i=n.n(r),o=n(89490);let a=e=>{let{children:t,columns:n=2,paddingTop:r=24}=e,a=(0,o.iF)({paddingTop:r,paddingX:16,paddingBottom:32});return(0,l.Y)("div",{className:i()("container-kIrj2N",a,{"containerThreeColumn-Rot594":3===n,"containerFourColumn-vOHVwe":4===n}),children:t})}},91401:function(e,t,n){n.d(t,{_:()=>B});var l=n(4006),r=n(35426),i=n(38390),o=n(89490);let a="transition-w_bxsw",s="from-z8IAhO",d="to-tJ4gLS";function c(e){let{onClose:t,disableCloseOnBackdropClick:n}=e;return(0,l.Y)(i.hJ,{forceMount:!0,className:"backdrop-XhnYC7",onClick:()=>{n||t()}})}let u=e=>{let{children:t}=e;return(0,l.Y)(r.e.Child,{enter:a,enterFrom:s,enterTo:d,leave:a,leaveFrom:d,leaveTo:s,children:t})};var h=n(20347),m=n(3849),f=n(69277),p=n(76977),g=n(12601);let v={paddingTop:20,paddingBottom:20};var b=n(84843);let w={paddingTop:20,paddingBottom:20},Y={flex:"1",justifyContent:"center"};var k=n(32485),_=n.n(k),y=n(17402),C=n(11510);let x=(0,y.forwardRef)((e,t)=>{let{children:n,className:r,width:o,initialFocus:a,disableCloseOnBackdropClick:s=!1,testId:d,style:c}=e,u=(0,C.Iu)();return(0,l.Y)(i.UC,{forceMount:!0,ref:t,"data-testid":d,className:_()(r,"panel-kkbipN",u&&"mobile-_09kdk"),style:(0,f._)({width:u?void 0:o},c),onOpenAutoFocus:e=>{(null==a?void 0:a.current)&&(e.preventDefault(),a.current.focus())},onCloseAutoFocus:e=>{e.preventDefault()},onPointerDownOutside:e=>{e.preventDefault()},onEscapeKeyDown:e=>{s&&e.preventDefault()},children:n})});x.displayName="DrawerPanel";let I="transition-yXnIcD",S="from-ohdinI",N="to-pJrLpA",F=e=>{let{children:t}=e;return(0,l.Y)(r.e.Child,{as:y.Fragment,enter:I,enterFrom:S,enterTo:N,leave:I,leaveFrom:N,leaveTo:S,children:t})};var A=n(90460),L=n(10996),E=n(53168);function D(e){let{children:t}=e;return(0,l.Y)(o.az,{className:"layout-oewxMQ",style:{zIndex:E.Up},children:t})}let B=e=>{let{isOpen:t,onClose:n=()=>void 0,children:o,testId:a="drawer",className:s,width:d=440,disableCloseOnBackdropClick:h=!1,initialFocus:m,style:f}=e;return(0,A.h)(t),(0,l.Y)(i.bL,{open:t,onOpenChange:e=>{e||null==n||n()},children:(0,l.Y)(i.ZL,{forceMount:!0,children:(0,l.Y)(r.e.Root,{show:t,children:(0,l.FD)(D,{children:[(0,l.Y)(u,{children:(0,l.Y)(c,{onClose:n,disableCloseOnBackdropClick:h})}),(0,l.Y)(L.e$,{children:(0,l.Y)(F,{children:(0,l.Y)(x,{width:d,className:s,initialFocus:m,disableCloseOnBackdropClick:h,testId:a,style:f,children:o})})})]})})})})};B.Header=e=>{let{onClose:t,showClose:n=!0,title:r,description:i,showDivider:o=!1}=e,a=o?b.P0:b.UG;return(0,l.Y)(a,{style:(0,f._)({},w),children:(0,l.FD)(p.fI,{children:[(0,l.FD)(b.fS,{style:(0,f._)({},Y),children:[r&&(0,l.Y)(b.$q,{text:r,isInsideDialog:!1}),i&&(0,l.Y)(b.ph,{text:i,isInsideDialog:!1})]}),n&&t&&(0,l.Y)(b.J,{onClose:t,position:"relative"})]})})},B.Body=function(e){var t=(0,h._)({},(0,m._)(e));return(0,l.Y)(p.VP,(0,f._)({flex:"grow",overflow:"auto",padding:20},t))},B.Footer=e=>{let{primaryButton:t,secondaryButton:n,showDivider:r,direction:i="row"}=e,o="column"===i,a=!!n||!!t,s=r?o?g.X_:g.RY:o?g.MM:g.It,d=o?g.iF:g.Y9,c=[n,t].filter(Boolean);return(0,l.Y)(s,{style:(0,f._)({},v),children:a&&(0,l.Y)(d,{children:c})})}},56007:function(e,t,n){n.d(t,{Ho:()=>h,bn:()=>d,dj:()=>m,tE:()=>u});var l=n(69277),r=n(70408),i=n(4006),o=n(28001),a=n(17402),s=n(58526);let d=5e3,c=(0,a.createContext)({popToast:()=>{throw Error("Popping toast requires a ToastProvider.")},addOffset:()=>{}});function u(e){let{children:t}=e,[n,l]=(0,a.useState)([]),[r,u]=(0,a.useState)(0),h=(0,a.useRef)(0);return(0,i.Y)(o.Kq,{duration:d,swipeThreshold:20,swipeDirection:"down",children:(0,i.FD)(c.Provider,{value:{popToast:(e,t)=>{let{dedupeKey:n}=null!=t?t:{},r="toast-".concat(h.current++),i=e(),o=a.default.cloneElement(i,{key:r,onOpenChange:e=>{e||setTimeout(()=>{l(e=>e.filter(e=>e.id!==r))},200)}});l(e=>[...n?e.filter(e=>e.dedupeKey!==n):e,{id:r,element:o,dedupeKey:n}])},addOffset:e=>{u(Math.min(r+e,0))}},children:[t,n.map(e=>e.element),(0,i.Y)(s.U,{offset:r})]})})}let h=e=>{let t=(0,a.forwardRef)((t,n)=>{let o=m();return(0,i.Y)(e,(0,r._)((0,l._)({},o,t),{ref:n}))});return t.displayName="withToastContext(".concat(e.name||e.displayName||"Anonymous",")"),t};function m(){return(0,a.useContext)(c)}},30192:function(e,t,n){n.d(t,{j:()=>c});var l=n(4006),r=n(61133),i=n(17402),o=n(75313),a=n(49365),s=n(53168),d=n(39957);function c(e){let{trigger:t,children:n,onOpen:c,onClose:u,onFetch:h,disabled:m,side:f,align:p,loading:g}=e,[v,b]=(0,i.useState)(!1),w=(0,i.useRef)(!1);(0,i.useEffect)(()=>{v&&!w.current&&h&&(w.current=!0,h())},[v,h]);let Y={zIndex:s.iC,"--shift":"".concat(o.k,"px"),"--scale":"".concat(o.R)};return m||!n?(0,l.Y)(l.FK,{children:t}):(0,l.FD)(r.bL,{openDelay:o.A1,closeDelay:o.TJ,open:v,onOpenChange:e=>{b(e),e?null==c||c():null==u||u()},children:[(0,l.Y)(r.l9,{asChild:!0,children:(0,l.Y)("span",{style:{minWidth:"0"},children:t})}),(0,l.Y)(r.ZL,{children:(0,l.Y)(r.UC,{side:f,align:p,sideOffset:o.k,collisionPadding:o.k,className:d.A.content,style:Y,children:!g&&(0,l.Y)(a.d,{children:"function"==typeof n?n({close:()=>b(!1)}):n})})})]})}},72682:function(e,t,n){n.d(t,{c:()=>p});var l=n(69277),r=n(70408),i=n(4006),o=n(32485),a=n.n(o),s=n(17402),d=n(45387),c=n(90839),u=n(99156);let h={container:"container-Zymr63",dragging:"dragging-DRHmIF",cornerHandle:"cornerHandle-kfhB90",topLeft:"topLeft-tcLuIp",topRight:"topRight-JvUgIs",bottomLeft:"bottomLeft-n_juA8",bottomRight:"bottomRight-uyYwbn"},m="theme-editor-dragging",f=["topLeft","topRight","bottomLeft","bottomRight"],p=e=>{var t;let{children:n,value:o,min:p,max:g,property:v,disabled:b,anchor:w="center"}=e,{isPreviewMode:Y,sendThemePropertyDragEnd:k}=(0,u.T)(),_=(0,c.sb)(),y=(0,c.Z4)(),{isActive:C}=(0,d.k6)(_),{isDragging:x,previewValue:I,getHandleProps:S}=function(e){let{value:t,min:n,max:l,onDragEnd:r,anchor:i="center"}=e,[o,a]=(0,s.useState)(t),[d,c]=(0,s.useState)(!1),u=(0,s.useRef)(null),h=(0,s.useRef)(t),m=(0,s.useRef)(r);m.current=r;let f=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(!d){if(null!==f.current)if(t!==f.current)return;else f.current=null;a(t),h.current=t}},[t,d]);let p=(0,s.useCallback)(e=>Math.round(Math.max(n,Math.min(l,e))),[n,l]),g=(0,s.useCallback)((e,t)=>{let n;e.preventDefault(),e.stopPropagation(),f.current=null;let l=e.target.parentElement;if(!l)return;let r=(l.querySelector("img")||l).getBoundingClientRect(),o=r.width/r.height,a=r.top+r.height/2,s=!1;"center"===i?(n=r.left+r.width/2,s=!0):n="left"===i?r.left:r.right,u.current={anchorX:n,anchorY:a,symmetric:s,aspectRatio:o},c(!0)},[i]),v=(0,s.useCallback)(e=>{let t=u.current;if(!t)return;let n=Math.abs(e.clientX-t.anchorX),l=p(Math.min(2*Math.abs(e.clientY-t.anchorY),(t.symmetric?2*n:n)/t.aspectRatio));h.current=l,a(l)},[p]),b=(0,s.useCallback)(()=>{u.current&&(f.current=h.current,m.current(h.current),u.current=null,c(!1))},[]);return(0,s.useEffect)(()=>{if(d)return window.addEventListener("mousemove",v),window.addEventListener("mouseup",b),()=>{window.removeEventListener("mousemove",v),window.removeEventListener("mouseup",b)}},[d,v,b]),{isDragging:d,previewValue:o,getHandleProps:(0,s.useCallback)(e=>({onMouseDown:t=>g(t,e)}),[g])}}({value:o,min:p,max:g,onDragEnd:(0,s.useCallback)(e=>{k({property:v,value:e})},[v,k]),anchor:w});return((0,s.useEffect)(()=>{if(x){document.documentElement.classList.add(m);let e=e=>{e.preventDefault(),e.stopPropagation()};return document.addEventListener("click",e,!0),()=>{setTimeout(()=>{document.removeEventListener("click",e,!0),document.documentElement.classList.remove(m)},100)}}},[x]),Y&&C&&!b&&!y)?(0,i.FD)("div",{className:a()(h.container,{[null!=(t=h.dragging)?t:""]:x}),style:{margin:-5},children:[(0,i.Y)("div",{style:{margin:5},children:n(I)}),f.map(e=>(0,i.Y)("div",(0,r._)((0,l._)({},S(e)),{className:a()(h.cornerHandle,h[e])}),e))]}):(0,i.Y)(i.FK,{children:n(o)})}},2247:function(e,t,n){n.d(t,{U:()=>l});function l(e){if(!e)return{selection:null,picker:null};switch(e.type){case"home-design":case"post-design":case"welcome-design":case"section":case"podcast":return{selection:null,picker:null};case"header":return{selection:{block:{type:"header"}},picker:null};case"home-hero":return{selection:{block:{type:"home-hero"}},picker:null};case"home-body":return{selection:{block:{type:"home-body"}},picker:null};case"content-block":return{selection:{block:{type:"content-block",id:e.contentBlockId}},picker:null};case"footer":return{selection:{block:{type:"footer"}},picker:null};case"sidebar-module":return{selection:{block:{type:"content-block",id:e.parentContentBlockId},item:{type:"sidebar-module",moduleId:e.moduleId}},picker:null};case"post-pin":var t;return{selection:{block:"home-hero"===e.parentBlockType?{type:"home-hero"}:{type:"content-block",id:null!=(t=e.parentContentBlockId)?t:""},item:{type:"post-pin",postId:e.postId,slotIndex:e.slotIndex}},picker:null};case"block-picker":return{selection:null,picker:{type:"block-picker",insertAfterIndex:e.insertAfterIndex}};case"module-picker":return{selection:{block:{type:"content-block",id:e.parentContentBlockId}},picker:{type:"module-picker",parentBlockId:e.parentContentBlockId,column:e.column,insertAtIndex:e.insertAtIndex}}}}},15663:function(e,t,n){n.d(t,{r:()=>p});var l=n(4006),r=n(35426),i=n(17402),o=n(78649),a=n(97640),s=n(46271),d=n(86500),c=n(12501),u=n(76977),h=n(21398),m=n(16291);let f="transition-FsyEAS";function p(){var e;let{activityUnreadCount:t}=(0,a.Vd)(),{isLoading:p,result:g,refetch:v}=(0,c.st)({pathname:"/api/v1/activity-feed-web",query:{limit:1},auto:!1});(0,i.useEffect)(()=>{t>0&&v()},[t]);let[b,w]=(0,i.useState)(!1),[Y,k]=(0,i.useState)(!1),{isLoading:_,fetch:y,result:C}=(0,h.vZ)({module:"./MiniNotificationsViewer",onRequest:()=>Promise.all([n.e("39966"),n.e("41129"),n.e("76439")]).then(n.bind(n,47737)),fetchImmediately:!1}),x=(0,m.A)(),{userSettings:I,changeSetting:S}=(0,s.ur)(),N=null==g||null==(e=g.activityItems)?void 0:e[0],F=(null==N?void 0:N.created_at)?(0,m.A)(null==N?void 0:N.created_at):x.subtract(100,"year"),A=(null==I?void 0:I.last_notification_alert_shown_at)?(0,m.A)(I.last_notification_alert_shown_at):x.subtract(100,"year"),L=7>x.diff(F,"day")&&F.diff(A,"hour")>2,E=(0,i.useRef)(null),D=()=>{E.current&&window.clearTimeout(E.current)},B=()=>{D(),E.current=window.setTimeout(()=>{w(!1)},6e3)};return(0,i.useEffect)(()=>{L&&t>0&&(C&&!b?window.setTimeout(()=>{w(!0),S("last_notification_alert_shown_at",(0,m.A)().toISOString()),(0,d.u4)(d.qY.NOTIFICATIONS_ALERT_SHOWN,["comment_audience","comment_id","community_comment_id","created_at","id","mention_id","publication_id","sender_count","target_comment_id","target_community_comment_id","target_community_post_id","target_post_id","target_user_id","type"].reduce((e,t)=>(e[t]=null==N?void 0:N[t],e),{})),B()},2e3):C||_||y())},[p,g,t,_,L,b,w]),(0,l.Y)(l.FK,{children:(b||Y)&&g&&(0,l.Y)(r.e,{style:{position:"fixed",left:"auto",right:20,top:92,zIndex:100},appear:!0,show:b,beforeEnter:()=>k(!0),afterLeave:()=>k(!1),enter:f,enterFrom:"enterFrom-dljIVN",enterTo:"enterTo-HLLVxF",leave:f,leaveFrom:"leaveFrom-aHkaAL",leaveTo:"leaveTo-k1oI5e",children:(0,l.Y)(o.Q,{children:(0,l.Y)(u.pT,{radius:"md",border:"detail",className:"alert-pEnrFa",onMouseEnter:D,onMouseLeave:B,shadow:"lg",bg:"primary",children:(0,l.Y)(h.Ic,{module:"@/frontend/reader2/activity/MiniNotificationsViewer",resolve:e=>e.MiniNotificationsStack,onRequest:()=>Promise.all([n.e("39966"),n.e("41129"),n.e("76439")]).then(n.bind(n,47737)),result:g,isReadOnly:!0})})})})})}},11710:function(e,t,n){n.d(t,{_:()=>c});var l=n(4006),r=n(51487),i=n(84605),o=n(17028),a=n(28911),s=n(22238),d=n(74055);function c(e){let{isOpen:t,onClose:n,scheduledLiveStreams:c,onCancelStream:u}=e,{iString:h}=(0,i.GO)(),m=(0,l.Y)(o.pT,{bg:"accent-red",radius:"full",width:48,height:48,alignItems:"center",justifyContent:"center",children:(0,l.Y)(r.A,{color:"var(--color-accent-fg-red)"})});return(0,l.FD)(a.aF,{isOpen:t,onClose:n,width:540,children:[(0,l.Y)(a.rQ,{title:h("Scheduled live videos"),icon:m,onClose:n}),(0,l.Y)(o.I1,{paddingX:20,paddingY:20,gap:20,className:d.A.streamList,children:c.map(e=>(0,l.Y)(s.Q,{stream:e,onCancelStream:u},e.liveStream.id))})]})}},15144:function(e,t,n){n.d(t,{D1:()=>r,d9:()=>i});var l=n(94729);function r(){let{tab:e="all",cursor:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return async n=>{try{var r,i;let o=await (0,l.x6)("/api/v1/messages/inbox",{query:{tab:e,cursor:t}});n({type:"inbox-new_items",payload:{threads:null==o?void 0:o.threads,nextCursor:o.nextCursor,directMessagesUnreadCount:null==o?void 0:o.directMessagesUnreadCount,pendingInviteCount:null==o?void 0:o.pendingInviteCount,pendingInviteUnreadCount:null!=(r=null==o?void 0:o.pendingInviteUnreadCount)?r:null==o?void 0:o.pendingInviteCount,pubChatUnreadCount:null!=(i=null==o?void 0:o.pubChatUnreadCount)?i:0,mostRecentChatTimestamp:o.mostRecentChatTimestamp}})}catch(e){if(console.warn("error",e),e instanceof l.fk)n({type:"inbox-new_error",payload:{error:e}});else throw e}}}let i=e=>async t=>{"direct-message"===e&&t(r({tab:"people"})),t({type:"inbox-set_filter",payload:e})}},68601:function(e,t,n){n.d(t,{M:()=>c,S:()=>d});var l=n(69277),r=n(70408),i=n(17402),o=n(12501),a=n(76528);let s="/api/v1/messages/suggestions/search";function d(){let[e,t]=(0,i.useState)(""),n=(0,a.OU)(s,{query:{query:e},deps:[e]}),d=(0,o.lW)(e=>{t(e)},100,[]);return(0,r._)((0,l._)({},n),{query:e,handleSearch:d})}function c(){(0,a.AA)(s,{query:{query:""},deps:[""]})}},85050:function(e,t,n){n.d(t,{s:()=>o}),n(17402);var l=n(46271),r=n(86500),i=n(46453);function o(e){let{surface:t}=e,n=(0,l.Jd)(),{onboardingModal:o}=(0,i.eE)();return(e,l)=>i=>{if(!e)return void console.warn("No publication provided to usePubOnboardingHandler handler");if(!n){if(!o)return;i.preventDefault(),l?o.openForPub(e,l):o.openToPubSignup(e);return}(0,r.fN)(e,t)}}},78338:function(e,t,n){n.d(t,{Bf:()=>s,DF:()=>a,ly:()=>o});var l=n(69277),r=n(70408),i=n(38123);function o(e){var t,n,l;return e.link_title||(null==(t=e.postTag)?void 0:t.name)||(null==(n=e.section)?void 0:n.name)||(null==(l=e.post)?void 0:l.title)||""}function a(e){var t;return e.postTag?"tag":e.section?"section":(null==(t=e.post)?void 0:t.type)==="page"?"page":e.post?"post":"link"}function s(e,t){let{isChatActive:n,isMeetingsActive:o,hasMultipleNewsletters:a,isChatEnabled:s,isFeedEnabled:d,isReaderReferralsLeaderboardActive:c,language:u="en",useReordering:h=!1}=t,m=(function(e){let t=new Map;for(let n of e)t.set(n.id,(0,r._)((0,l._)({},n),{children:[]}));let n=[];for(let e of t.values())if(e.parent_id){let n=t.get(e.parent_id);n&&n.children.push(e)}else n.push(e);for(let e of t.values())e.children.length>0&&e.children.sort((e,t)=>e.sibling_rank-t.sibling_rank);return n.sort((e,t)=>e.sibling_rank-t.sibling_rank)})(e).filter(e=>!e.standard_key),f=new Map(e.filter(e=>e.standard_key).map(e=>[e.standard_key,e])),{iString:p}=I18N.i(u);for(let e of m){var g;(null==(g=e.section)?void 0:g.hide_from_navbar)&&(e.is_hidden=!0)}let v=[d&&{standard_key:"notes",link_title:"Notes",link_url:"/notes"},s&&{standard_key:"chat",link_title:"Chat",link_url:"/chat",is_hidden:!n},o&&{standard_key:"meetings",link_title:"Meetings",link_url:"/meetings"},...m,{standard_key:"archive",link_title:p("Archive"),link_url:"/archive"},a&&{standard_key:"newsletters",link_title:p("Newsletters"),link_url:"/newsletters",is_hidden:!0},c&&{standard_key:"leaderboard",link_title:p("Leaderboard"),link_url:"/leaderboard"},{standard_key:"about",link_title:p("About"),link_url:"/about"}].filter(e=>!!e).map(e=>{if(e.standard_key){let t=f.get(e.standard_key);if(t)return(0,i.qy)(e,t)}return e});if(h){let e=["about","notes","chat","archive"];return[...v.filter(t=>!e.includes(t.standard_key||"")),...e.map(e=>v.find(t=>t.standard_key===e)).filter(e=>!!e)].filter(e=>!!e)}return v}}}]);