!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@c7747fb"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d77b9218-63c1-4d7c-8672-d16f4ec089b3",e._sentryDebugIdIdentifier="sentry-dbid-d77b9218-63c1-4d7c-8672-d16f4ec089b3")}catch(e){}}();"use strict";(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["49513"],{39625:function(e,t,n){n.d(t,{A:()=>i});let i={textInput:"textInput-kYr7wC"}},34372:function(e,t,n){n.d(t,{A:()=>i});let i={modalTitle:"modalTitle-uFJ1Ep",qrCode:"qrCode-zZoQdZ",appBadge:"appBadge-Vbgl8S",phoneInput:"phoneInput-PdUisS",noGrow:"noGrow-lP58Da"}},72032:function(e,t,n){n.d(t,{A:()=>i});let i={header:"header-m3czQu",headerWithJustTitle:"headerWithJustTitle-AWuTLu",noImage:"noImage-VVe5Lh",actions:"actions-mMxsK2",thickRule:"thickRule-c8r1qH",bodyWrapperTwoMiddleColumns:"bodyWrapperTwoMiddleColumns-EOoshF",notifyButton:"notifyButton-wkevVH",hoverText:"hoverText-OtXqlP",notifyButtonInternal:"notifyButtonInternal-wv0x02",titleNotifyButton:"titleNotifyButton-bWyjlY",caret:"caret-vNjCU3",collapsed:"collapsed-KQpXLZ"}},28627:function(e,t,n){n.d(t,{A:()=>i});let i={"container--empty":"container--empty-D_rgwk",containerEmpty:"container--empty-D_rgwk",liveStreamContainer:"liveStreamContainer-t0i18u"}},45663:function(e,t,n){n.d(t,{A:()=>i});let i={specialFeatureHeaderContainer:"specialFeatureHeaderContainer-Skrlng",thickRule:"thickRule-oguYhe",threeColumnContainer:"threeColumnContainer-ziuSvf",mediumRule:"mediumRule-wQbBfo",headerButtonMobile:"headerButtonMobile-DURJFG",america250HomepageHeader:"america250HomepageHeader-Gp7Pmn",a250Rule:"a250Rule-oAzvtB",a250Logo:"a250Logo-sb3SfS"}},22232:function(e,t,n){n.d(t,{A:()=>i});let i={noAnimation:"noAnimation-jU0t5u",placeholderImage:"placeholderImage-rKHUr9"}},88946:function(e,t,n){n.d(t,{A:()=>i});let i={chip:"chip-lJKwY5",textOnly:"textOnly-SPwDNp",leading:"leading-TvXpau",trailing:"trailing-lhDVKn",clickable:"clickable-IxUlBk",disabled:"disabled-F1nG5l",fillIcon:"fillIcon-jYnt2U"}},13166:function(e,t,n){n.d(t,{u:()=>c});var i=n(69277),l=n(70408),r=n(32641),o=n(4006),a=n(32485),s=n.n(a),d=n(76977);let c=e=>{var{className:t,children:n}=e,a=(0,r._)(e,["className","children"]);return(0,o.Y)(d.I1,(0,l._)((0,i._)({className:s()("container-v2ozZi",t)},a),{children:n}))}},30796:function(e,t,n){n.d(t,{h:()=>c});var i=n(4006),l=n(32485),r=n.n(l),o=n(17402),a=n(10278),s=n(76977),d=n(71305);function c(e){let{className:t,assets:n,readOnly:l,onClick:c,maxHeight:p=420,children:h,feedItem:m,commentId:g}=e,v=(0,a.Cu)(n),[f,Y]=(0,o.useState)(null),b=(0,o.useRef)(null),_=(0,a.wY)(b,0),[y,w]=v;if(!y||!w)return null;let k=y.width&&y.height?y.width/y.height:1,I=w.width&&w.height?w.width/w.height:1,C=k+I,S=_-6,D=Math.min(p,S/C),F=[S*k/C,S*I/C];return(0,i.FD)(s.pT,{ref:b,className:r()(d.A.imageDiptych,t),gap:6,overflow:"hidden",children:[v.map((e,t)=>(0,i.Y)(u,{asset:e.src,explicit:e.explicit,readOnly:l,width:F[t],height:D,index:t,onClick:l?void 0:n=>{n.preventDefault(),c&&c({attachmentId:e.id,attachmentType:"image"}),Y({index:t})},children:h},e.src)),!l&&(0,i.Y)(a.yx,{assets:v,imageViewer:f,setImageViewer:Y,readOnly:l,feedItem:m,commentId:g})]})}function u(e){let{asset:t,explicit:n,onClick:l,readOnly:o,width:s=500,height:c,children:u,index:p}=e;return(0,i.Y)(a.Vn,{asset:t,explicit:n,onClick:l,readOnly:o,width:s,height:c,className:r()(d.A.diptychImage,d.A["index-".concat(p+1)]),children:u})}},30653:function(e,t,n){n.d(t,{M:()=>F});var i=n(79785),l=n(4006),r=n(17402),o=n(8853),a=n(71900),s=n(9599),d=n(2538),c=n(84605),u=n(86500),p=n(68349),h=n(24078),m=n(89490),g=n(35369),v=n(16993),f=n(84843),Y=n(45974),b=n(46453),_=n(11510),y=n(39318),w=n(57324),k=n(82130);function I(){let e=(0,i._)(["Tell "," you appreciate their post"]);return I=function(){return e},e}function C(){let e=(0,i._)(["Join the discussion for ","'s post"]);return C=function(){return e},e}function S(){let e=(0,i._)(["Quickly share posts with your followers"]);return S=function(){return e},e}let D=[{angle:-25,rotation:5,scale:1,flip:!1},{angle:135,rotation:-5,scale:.66,flip:!0}];function F(e){let{isOpen:t,setOpen:n,author:i,pub:o,action:a,postId:s,postSlug:d}=e,h=(0,_.Iu)(),{iString:m,iTemplate:Y}=(0,c.GO)(),{requireLogin:k}=(0,b.eE)();if((0,r.useEffect)(()=>{t&&(0,u.u4)(u.qY.POST_UFI_APP_UPSELL_SHOWN,{action:a,author_id:null==i?void 0:i.id,post_id:s})},[t,a,i,s]),!i||!o)return null;let D=()=>{(0,u.u4)(u.qY.POST_UFI_APP_UPSELL_DISMISSED,{action:a,author_id:null==i?void 0:i.id,post_id:s}),n(!1)},F={like:m("Like this in the app"),comment:m("Comment in the app"),restack:m("Restack this in the app")},P={like:Y(I(),i.name),comment:Y(C(),i.name),restack:Y(S())},T=F[a],A=P[a];return(0,l.FD)(v.aF,{isOpen:t,onClose:D,children:[(0,l.Y)(f.rQ,{icon:(0,l.Y)(x,{action:a,author:i,pub:o}),alignItems:"center",title:T,description:A,onClose:D}),(0,l.Y)(v.q1,{}),(0,l.Y)(v.jl,{direction:"column",primaryButton:(0,l.Y)(g.$n,{priority:"primary",onClick:()=>{if((0,u.u4)(u.qY.POST_UFI_APP_UPSELL_GET_APP_CLICKED,{action:a,author_id:null==i?void 0:i.id,post_id:s,is_mobile:h}),h){let e=(0,y.XV8)(o.subdomain,d,{redirect:"app-store",source:w.VU.postUfiModal});(0,p.V2)(e,{newTab:!0}),n(!1)}},children:m(h?"Open Substack":"Get the app")}),secondaryButton:(0,l.Y)(g.$n,{priority:"secondary",onClick:()=>{(0,u.u4)(u.qY.POST_UFI_APP_UPSELL_SIGN_IN_CLICKED,{action:a,author_id:null==i?void 0:i.id,post_id:s}),n(!1),null==k||k()},children:m("Sign in")})})]})}function x(e){let{action:t,author:n,pub:i}=e,r=n.photo_url?(0,l.Y)(h.eu,{photoUrl:n.photo_url,size:84,className:k.A.avatar}):i.logo_url?(0,l.Y)(Y.Nq,{pub:i,size:84,className:k.A.avatar}):(0,l.Y)(o.c,{src:"/img/substack-app-icon.png",width:84,height:84});return(0,l.FD)(m.az,{position:"relative",width:84,height:84,children:[r,D.map((e,n)=>(0,l.Y)(P,{config:e,action:t},n))]})}function P(e){let{config:t,action:n}=e,i=t.angle*Math.PI/180,r=46*Math.cos(i),o=46*Math.sin(i);return(0,l.Y)(m.az,{className:k.A.stickerContainer,style:{"--sticker-x":"".concat(r,"px"),"--sticker-y":"".concat(o,"px"),"--sticker-scale":t.scale,"--sticker-rotation":"".concat(t.rotation,"deg"),"--sticker-flip":t.flip?"-1":"1"},children:(0,l.Y)(T,{action:n})})}function T(e){let{action:t}=e;return"like"===t?(0,l.Y)(s.A,{size:32,className:k.A.sticker}):"comment"===t?(0,l.Y)(a.A,{size:32,className:k.A.sticker}):"restack"===t?(0,l.Y)(d.A,{size:32,className:k.A.sticker}):null}},5396:function(e,t,n){n.d(t,{F:()=>H});var i=n(4006),l=n(32485),r=n.n(l),o=n(17402),a=n(12386),s=n(89230),d=n(48697),c=n(69277),u=n(79785),p=n(15734),h=n.n(p),m=n(17715),g=n(84605),v=n(99145),f=n(86500),Y=n(1683),b=n(76583),_=n(68349),y=n(40659),w=n(39318),k=n(41086),I=n(49807),C=n(57324);function S(){let e=(0,u._)(["Signed in as ",""]);return S=function(){return e},e}function D(){let e=(0,u._)(["Signed in as ",""]);return D=function(){return e},e}var F=n(35369),x=n(91401);let P="menuRow-pMfEmA",T="accountRow-WHnVU6",A="drawerFooter-kDs6bK";function E(e){let{pub:t,user:n,freeSignup:l,freeSignupEmail:r,showCustomerSupportModeModal:a}=e,{iString:u}=(0,g.GO)(),[p,T]=(0,o.useState)(!1),{navItems:A,accountItems:E,subscribe:M,modalElement:R,openSearchModal:O}=function(e){let{pub:t,user:n,freeSignup:i,freeSignupEmail:l,showCustomerSupportModeModal:r,utmSource:o}=e,{iString:a,iTemplate:s}=(0,g.GO)(),d=(0,v.v9)(),u=(0,m.h)({pub:t}),p=(0,y.rG)(),{enableCustomerServiceMode:F,disableCustomerServiceMode:x,modalElement:P}=(0,b.UU)({showCustomerSupportModeModal:r}),T=u.filter(e=>{var t;return!(null==(t=e.subItems)?void 0:t.length)}),A=n?n.is_subscribed||n.is_contributor?"paid":n.is_free_subscribed?"free":"signed_out":"signed_out",E=i&&"signed_out"===A?"free":A,N=n&&!n.is_magic?n.email:void 0,B="undefined"!=typeof document?document.location.href:void 0,M=function(e){var t;if("undefined"==typeof window||!(null==(t=e.sections)?void 0:t.length))return;let n=window.location.pathname.match(/^\/s\/([^/]+)/);if(!n)return;let i=e.sections.find(e=>e.slug===n[1]);return i?String(i.id):void 0}(t),R="free"===E?(0,I.eV6)(t,{addBase:!0,params:{utm_source:o,simple:!0,next:B,referring_pub_ids:(0,k.y)("referring_pub_ids"),specific_section_ids:M}}):(0,I.eV6)(t,{addBase:!0,params:{utm_source:o,next:B,specific_section_ids:M}}),O=async e=>{var n,i,l,r;let a;(0,f.u4)(f.qY.NAV_BAR_CTA_CLICKED,{type:"free-subscription",homepage_type:t.homepage_type});let s=(0,k.y)("referring_pub_ids"),d=null==s||null==(i=s.split)||null==(n=i.call(s,","))?void 0:n[0],u=null==s||null==(r=s.split)||null==(l=r.call(s,","))?void 0:l.slice(1);if(!e)return void(0,_.V2)((0,I.eV6)(t,{addBase:!0,params:{utm_source:o,simple:!0,next:B,referring_pub_ids:s,specific_section_ids:M}}),{local_navigation:!1});try{let t=await h().post("/api/v1/free").send((0,c._)({source:"menu",email:e,first_url:Y.R9,first_referrer:Y.b7,current_url:Y.AT,current_referrer:Y.uC,first_session_url:Y.K0,first_session_referrer:Y.OG,referring_pub_id:d,additional_referring_pub_ids:u},p));a=t.body.referral_token,(0,f.$5)(t.body.requires_confirmation)}catch(e){(0,f.u4)(f.qY.FREE_SIGNUP_FAILED,{reason:e instanceof Error?e.message:String(e),source:"menu"})}(0,_.V2)((0,I.eV6)(t,{addBase:!0,params:{utm_source:o,simple:!0,next:B,skip_redirect_check:!0,just_signed_up:!0,referral_token:a,specific_section_ids:M}}),{local_navigation:!1})},L=[];if(n){let e=n.profile_set_up_at&&n.name?n.name:n.email;L.push({kind:"label",key:"signed_in_as",text:s(S(),e)});let i=(0,w.yRA)(n,{params:{utm_source:C.VU.userMenu}});i&&L.push({kind:"link",key:"dashboard",label:a("Dashboard"),href:i}),L.push({kind:"link",key:"settings",label:a("Settings"),href:(0,w.tFi)({utm_source:C.VU.userMenu})}),L.push({kind:"link",key:"support",label:a("Support"),href:"".concat("https://support.substack.com/hc/en-us/","?utm_source=").concat(C.VU.userMenu)}),L.push({kind:"link",key:"sign_out",label:a("Sign out"),href:(0,w.bgT)({utm_source:C.VU.userMenu,for_pub:t.subdomain})}),n.is_global_admin&&(F&&L.push({kind:"admin_action",key:"enter_support_mode",label:"Enter support mode",onClick:F}),x&&L.push({kind:"admin_action",key:"exit_support_mode",label:"Exit support mode",onClick:x}),L.push({kind:"admin_link",key:"open_in_underground",label:"Open in Underground",href:"".concat((0,I.$_T)({subdomain:"admin"}),"/publications/").concat(t.id)}))}else i&&(l&&L.push({kind:"label",key:"signed_in_as",text:s(D(),l)}),L.push({kind:"link",key:"sign_out",label:a("Sign out"),href:(0,w.bgT)({utm_source:C.VU.userMenu,for_pub:t.subdomain})}));return{navItems:T,accountItems:L,subscribe:{state:E,href:R,prefilledEmail:null!=N?N:l,emailLocked:!!N,onClick:()=>{"free"===E&&(0,f.u4)(f.qY.NAV_BAR_CTA_CLICKED,{type:"upgrade-subscription"})},onSubmit:O},modalElement:P,openSearchModal:d.open}}({pub:t,user:n,freeSignup:l,freeSignupEmail:r,showCustomerSupportModeModal:a,utmSource:"dropsite_hamburger_menu"}),L=(0,o.useCallback)(()=>T(!0),[]),z=(0,o.useCallback)(()=>T(!1),[]),U=(0,o.useCallback)(()=>{z(),O()},[z,O]);return(0,i.FD)(i.FK,{children:[(0,i.Y)(F.K0,{"aria-label":u("Open menu"),className:"triggerButton-NDBTW8",priority:"tertiary",style:{color:"#fff"},onClick:L,children:(0,i.Y)(s.A,{size:24,style:{stroke:"#fff"}})}),(0,i.Y)(x._,{className:"drawer-ZH3uS_",isOpen:p,width:480,onClose:z,children:(0,i.FD)(x._.Body,{padding:0,radius:"none",children:[(0,i.Y)("header",{className:"drawerHeader-AJ3U2v",children:(0,i.Y)(F.K0,{"aria-label":u("Close menu"),className:"closeButton-n3kNRN",priority:"tertiary",style:{color:"#fff"},onClick:z,children:(0,i.Y)(d.A,{size:24,style:{stroke:"#fff"}})})}),(0,i.FD)("nav",{className:"drawerBody-wNzCoN",children:[(0,i.Y)("button",{className:P,type:"button",onClick:U,children:u("Search")}),A.map(e=>{var t,n;let l=String(null!=(n=null!=(t=e.slug)?t:e.href)?n:e.label),r=()=>{var t;z(),null==(t=e.onClick)||t.call(e)};return e.href?(0,i.Y)("a",{className:P,href:e.href,onClick:r,children:e.label},l):(0,i.Y)("button",{className:P,type:"button",onClick:r,children:e.label},l)})]}),E.length>0&&(0,i.Y)(N,{items:E}),(0,i.Y)(B,{subscribe:M})]})}),R]})}function N(e){let{items:t}=e;return(0,i.Y)("section",{className:"accountSection-WaxkKV",children:t.map(e=>{switch(e.kind){case"label":return(0,i.Y)("span",{className:"accountLabel-bIOSgp",children:e.text},e.key);case"link":case"admin_link":return(0,i.Y)("a",{className:T,href:e.href,children:e.label},e.key);case"admin_action":return(0,i.Y)("button",{className:T,type:"button",onClick:e.onClick,children:e.label},e.key)}})})}function B(e){var t;let{subscribe:n}=e,{iString:l}=(0,g.GO)();return"paid"===n.state?null:"free"===n.state?(0,i.Y)("footer",{className:A,children:(0,i.Y)("a",{className:"footerUpgradeButton-CyQ54_",href:n.href,onClick:n.onClick,children:l("Upgrade")})}):(0,i.Y)("footer",{className:A,children:(0,i.FD)("form",{className:"footerForm-vp4dwP",onSubmit:e=>{var t;e.preventDefault();let i=e.currentTarget.elements.namedItem("email");n.onSubmit(null!=(t=null==i?void 0:i.value)?t:"")},children:[(0,i.Y)(a.s6,{asChild:!0,children:(0,i.Y)("label",{htmlFor:"dropsite-hamburger-email",children:l("Email address")})}),(0,i.Y)("input",{className:"footerEmailInput-uZWQ0y",defaultValue:null!=(t=n.prefilledEmail)?t:"",id:"dropsite-hamburger-email",name:"email",placeholder:l("Sign up for our newsletter"),readOnly:n.emailLocked,type:"email"}),(0,i.Y)("button",{className:"footerSubmitButton-JIAFYB",type:"submit",children:l("Subscribe")})]})})}var M=n(13950);function R(e){let{pub:t,user:n,freeSignup:l,freeSignupEmail:a,showCustomerSupportModeModal:s}=e,[d,c]=(0,o.useState)(!1),u=(0,o.useCallback)(()=>{c(window.scrollY>300)},[]);return(0,o.useEffect)(()=>(window.addEventListener("scroll",u,{passive:!0}),u(),()=>window.removeEventListener("scroll",u)),[u]),(0,i.Y)(M.DH,{children:(0,i.FD)("nav",{className:r()("nav-ospuJx",{[String("navScrolled-dwyi4s")]:d}),children:[(0,i.FD)("a",{className:"logo-l3Qw2x",href:"/",children:[(0,i.Y)("span",{children:"Drop"}),(0,i.Y)("span",{className:"bracketWrap-B_F6mS",children:(0,i.Y)("span",{className:"bracketLeft-MfCNdN",children:"Site"})})]}),(0,i.Y)("span",{className:"tagline-Hdrgxk",children:"Independent News on Politics and War."}),(0,i.Y)(E,{freeSignup:l,freeSignupEmail:a,pub:t,showCustomerSupportModeModal:s,user:n})]})})}var O=n(3533),L=n(21919),z=n(60030),U=n(4016);function H(e){let{pub:t,user:n,freeSignup:l,freeSignupEmail:r,showCustomerSupportModeModal:o,hideNavBar:a,isChatActive:s,isMeetingsActive:d,isPostView:c,selectedSectionId:u,profile:p,activeLiveStream:h}=e,m=(0,z.P)();return(0,U.lu)({pub:t})?(0,i.Y)(L.G,{activeLiveStream:null!=h?h:null,freeSignup:null!=l&&l,pub:t,showCustomerSupportModeModal:null!=o&&o,user:n}):(0,U.K)({pub:t})&&m?(0,i.Y)(R,{freeSignup:l,freeSignupEmail:r,pub:t,showCustomerSupportModeModal:o,user:n}):(0,i.Y)(O.W1,{freeSignup:l,freeSignupEmail:r,hideNavBar:a,isChatActive:s,isMeetingsActive:d,isPostView:c,pub:t,selectedSectionId:null!=u?u:null,showCustomerSupportModeModal:o,user:n,profile:p})}},13950:function(e,t,n){n.d(t,{DH:()=>u,av:()=>m,xF:()=>h});var i=n(4006),l=n(32485),r=n.n(l),o=n(17402),a=n(10996),s=n(4016),d=n(6045);let c={header:String(d.A.headerTheme),footer:String(d.A.footerTheme),footer_secondary:String(d.A.footerSecondaryTheme),subscribe:String(d.A.subscribeTheme)};function u(e){let{prefix:t,children:n}=e;return t?(0,i.Y)(p.Provider,{value:t,children:(0,i.Y)("div",{className:r()(d.A.pubTheme,c[t]),children:n})}):(0,i.Y)(a.NP,{theme:d.A.pubTheme,children:n})}let p=(0,o.createContext)(null);function h(){let e=(0,o.useContext)(p);return{onOpen:o.default.useCallback(()=>{let t=document.getElementById("menu-portal");t&&e&&(t.className=r()(d.A.pubTheme,c[e]))},[e]),onClose:o.default.useCallback(()=>{let e=document.getElementById("menu-portal");e&&(e.className="")},[])}}function m(e){let{pub:t,useCustomTheme:n=!1}=e;return(0,s.lu)({pub:t})?"the-free-press-theme":(0,s.K)({pub:t})&&n?"dropsite-news-theme":null}},7e4:function(e,t,n){n.d(t,{b:()=>C});var i=n(79785),l=n(4006),r=n(17402),o=n(15734),a=n.n(o),s=n(84605),d=n(35369),c=n(33727),u=n(60322),p=n(76977),h=n(16993),m=n(45974),g=n(63136),v=n(36372),f=n(39318),Y=n(82776);function b(){let e=(0,i._)(["Recommend ","?"]);return b=function(){return e},e}function _(){let e=(0,i._)(["Recommend "," and "," other Substacks?"]);return _=function(){return e},e}function y(){let e=(0,i._)(["Since you embedded "," in your post, we thought you might like to recommend them to your subscribers."]);return y=function(){return e},e}function w(){let e=(0,i._)(["Since you embedded these Substacks in your post, we thought you might like to recommend them to your subscribers."]);return w=function(){return e},e}function k(){let e=(0,i._)(["Recommend "," Substack"]);return k=function(){return e},e}function I(){let e=(0,i._)(["Recommend "," Substacks"]);return I=function(){return e},e}function C(e){var t,n;let{pub:i,pubsToRecommend:o}=e,{iString:c,iTemplate:u,iPlural:m}=(0,s.GO)(),g=(0,v.d)(),[f,Y]=(0,r.useState)(!0),[C,D]=(0,r.useState)(!1),[F,x]=(0,r.useState)(new Set((o||[]).map(e=>e.id)));if(0===o.length||!o[0])return null;let P=()=>{Y(!1)},T=async()=>{try{D(!0);let e=Array.from(F);await a().put("/api/v1/recommendations/multiple").send({recommending_publication_id:i.id,recommended_publication_ids:e,source:"post_publish_cta",suggested:e.map(()=>!0)}),e.length&&g.popToast(()=>(0,l.Y)(v.y,{text:m("Added %1 recommendation","Added %1 recommendations",e.length)})),P()}catch(e){console.error("Failed to add recommendations: ",e),g.popToast(()=>(0,l.Y)(v.y,{text:c("Failed to add recommendations")})),P()}finally{D(!1)}},A=F.size,E=1===o.length?u(b(),o[0].name):u(_(),o[0].name,o.length-1),N=1===o.length?u(y(),null!=(n=null==(t=o[0])?void 0:t.name)?n:""):u(w());return(0,l.Y)(l.FK,{children:f?(0,l.FD)(h.aF,{isOpen:f,onClose:P,children:[(0,l.Y)(h.rQ,{title:E,description:N,onClose:P,showDivider:!0}),(0,l.Y)(h.cw,{children:(0,l.Y)(p.VP,{gap:16,children:o.map(e=>(0,l.Y)(S,{pub:e,checked:F.has(e.id),onChange:()=>{var t;let n;return t=e.id,void((n=new Set(F)).has(t)?n.delete(t):n.add(t),x(n))}},e.id))})}),(0,l.Y)(h.jl,{showDivider:!0,primaryButton:(0,l.Y)(d.$n,{onClick:T,disabled:0===A,loading:C,children:0===A?c("Recommend"):u(1===A?k():I(),A)}),secondaryButton:(0,l.Y)(d.$n,{onClick:P,priority:"secondary",children:c("Cancel")})})]}):null})}function S(e){let{pub:t,checked:n,onChange:i}=e;return(0,l.Y)("label",{children:(0,l.FD)(c.Z,{padding:12,gap:12,direction:"row",alignItems:"center",cursor:"pointer",children:[(0,l.Y)(m.wg,{pub:t,size:40,openInNewTab:!0}),(0,l.FD)(p.VP,{gap:2,flex:"grow",children:[(0,l.Y)(g.EY.B3,{children:(0,l.Y)(g.Yq,{href:(0,f.$_T)(t),target:"_blank",children:t.name})}),(0,l.Y)(g.EY.B4,{color:"secondary",children:(0,Y.getByLine)(t)})]}),(0,l.Y)(u.S,{name:"pub-".concat(t.id),checked:n,onChange:i,size:"sm"})]})})}},84236:function(e,t,n){n.d(t,{Jq:()=>u,pJ:()=>p});var i=n(69277),l=n(70408),r=n(4006),o=n(76977),a=n(63136),s=n(39318),d=n(49807);let c=(e,t)=>(e.sponsorshipCampaigns?Object.values(e.sponsorshipCampaigns):[]).find(e=>{let n="podcast"===e.campaign_type,i=e.section_id&&t&&e.section_id===t.id,l=!e.section_id&&!t;return n&&(i||l)}),u=(e,t)=>!!c(e,t),p=e=>{var t;let{align:n="left",direction:u="row",gap:p=16,pub:h,post:m=null,section:g=null,textField:v="short_text",imageHeight:f=16,paddingY:Y,paddingX:b}=e,_=c(h,g);if(!_)return null;let y="episode_short_text"===v?_.episode_short_text:_.short_text;if(!y)return null;let w=(0,s.qCG)({campaignId:_.id,medium:"podcast",pubId:h.id,url:_.link_url,postId:null==m?void 0:m.id,referrer:"undefined"!=typeof window?window.location.href:void 0}),k=(0,r.FD)(r.FK,{children:[(0,r.Y)(a.EY.Digit,{color:"pub-secondary-text",weight:"regular",children:y}),_.image_url&&(0,r.Y)("img",{alt:null!=(t=_.image_alt_text)?t:"",src:(0,d.dJ9)(_.image_url,250),style:{width:"auto",height:f}})]}),I=(0,i._)({alignItems:"center",as:"a",gap:p,href:w,target:"_blank",justifyContent:(()=>{switch(n){case"center":return"center";case"right":return"end";default:return}})()},Y&&{paddingY:Y},b&&{paddingX:b});return"column"===u?(0,r.Y)(o.I1,(0,l._)((0,i._)({},I),{children:k})):(0,r.Y)(o.Ye,(0,l._)((0,i._)({},I),{children:k}))}},68743:function(e,t,n){n.d(t,{L:()=>C});var i=n(4006),l=n(83673),r=n.n(l),o=n(32485),a=n.n(o),s=n(27437),d=n(68349),c=n(28528),u=n(29042),p=n(88553),h=n(76977),m=n(9624),g=n(39318),v=n(82776),f=n(69706);let Y={container:"container-nWkTkI",image:"image-w45kBV",category:"category-bMSZyq",title:"title-HxaOBG",titleMedium:"titleMedium-NVLjDy",titleLarge:"titleLarge-gZ3y5C",author:"author-ArxGUj",authorLink:"authorLink-iNQ3Dq",subtitle:"subtitle-lBxwli",subtitleMedium:"subtitleMedium-m_1ubQ",subtitleLarge:"subtitleLarge-XUyWBf"},b=new Set(["drop site daily"]);function _(e){var t;let{post:n,slotIndex:l,variant:r}=e,{pub:o,utm:_}=(0,c.np)();if(!n)return null;let y=null==(t=n.postTags)?void 0:t.find(e=>!b.has(e.name.toLowerCase())),w=(0,p.U)({linkToComments:!1,post:n,pub:o,utm:_});return(0,i.Y)(m.z,{overlayInset:12,postId:n.id,slotIndex:l,children:(0,i.FD)(h.I1,{className:a()(Y.container,Y[r]),role:"article",tabIndex:0,onClick:e=>(0,d.V2)(w,{event:e}),children:[(0,i.Y)(u.t,{className:Y.image,imageAspectRatio:f.fo,imageWidth:"large"===r?1250:800,isBelowTheFold:!1,playButtonSize:"large"===r?72:40,post:n}),y?(0,i.Y)("span",{className:Y.category,children:y.name}):null,(0,i.Y)("a",{className:a()(Y.title,{[String(Y.titleMedium)]:"medium"===r,[String(Y.titleLarge)]:"large"===r}),href:w,tabIndex:-1,children:(0,v.smartenQuotes)((0,v.truncateWords)(n.title,140))}),(0,v.getBylineUsers)(n).length>0&&(0,i.Y)("span",{className:Y.author,children:(0,v.getBylineUsers)(n).map((e,t)=>(0,i.FD)("span",{children:[t>0&&", ",(0,i.Y)(s.ProfileHoverCard,{subject:e,trigger:(0,i.Y)("a",{className:Y.authorLink,href:(0,g.laT)(e,o),onClick:e=>e.stopPropagation(),children:e.name}),utmSource:"byline"})]},e.id))}),n.subtitle?(0,i.Y)("p",{className:a()(Y.subtitle,{[String(Y.subtitleMedium)]:"medium"===r,[String(Y.subtitleLarge)]:"large"===r}),children:(0,v.smartenQuotes)((0,v.truncateWords)(n.subtitle,200))}):null]})})}var y=n(68410);let w="divider-CY0iMV",k="seeAll-uE_OEJ";function I(e){let{posts:t,title:n,viewAllUrl:l}=e,{isMobile:r}=(0,y.sM)(),o=t.slice(0,2),a=t.slice(2,5),s=t.slice(0,3);return(0,i.FD)(h.I1,{gap:r?36:72,children:[(0,i.FD)(h.I1,{gap:r?8:12,children:[(0,i.Y)("div",{className:"accentBar-HFK9Sw"}),(0,i.Y)("h2",{className:"title-xYdSPd",children:n})]}),!r&&(0,i.FD)("div",{className:"columns-pXZKkd",children:[(0,i.FD)("div",{className:"leftColumn-jnVAM4",children:[o.map((e,t)=>(0,i.FD)("div",{children:[t>0&&!r&&(0,i.Y)("hr",{className:w}),(0,i.Y)(_,{post:e,slotIndex:t,variant:"large"})]},e.id)),l&&(0,i.Y)(h.I1,{paddingTop:40,children:(0,i.Y)("a",{className:k,href:l,children:"See all"})})]}),!r&&(0,i.Y)("div",{className:"verticalDivider-WFI1op"}),(0,i.Y)("div",{className:"rightColumn-JEahQm",children:a.map((e,t)=>(0,i.FD)("div",{children:[t>0&&!r&&(0,i.Y)("hr",{className:w}),(0,i.Y)(_,{post:e,slotIndex:o.length+t,variant:"medium"})]},e.id))})]}),r&&(0,i.FD)(h.I1,{gap:32,children:[s.map((e,t)=>(0,i.Y)("div",{children:(0,i.Y)(_,{post:e,slotIndex:t,variant:"large"})},e.id)),l&&(0,i.Y)(h.I1,{children:(0,i.Y)("a",{className:k,href:l,children:"See all"})})]})]})}function C(e){let{contentBlock:t,posts:n,title:l,viewAllUrl:o}=e;return"feature"===t.block_type?(0,i.Y)(I,{posts:r()(n),title:l,viewAllUrl:o}):null}},53023:function(e,t,n){n.d(t,{i:()=>h});var i=n(4006),l=n(13166),r=n(17402),o=n(7761),a=n(9624),s=n(90839);function d(e){let{children:t,editButtonPosition:n,homeHeroPins:l,posts:d,pub:c,onEditClick:u}=e,p=(0,r.useMemo)(()=>({type:"home-hero"}),[]);return(0,i.Y)(s.kT,{editButtonPosition:n,previewBlockId:p,onEditClick:u,children:(0,i.Y)(o.WO,{pinnedPostIds:null==l?void 0:l.map(e=>e.post_id),pub:c,showPubPins:!0,showSectionPins:!1,children:(0,i.Y)(a.y,{posts:d,children:t})})})}var c=n(68410),u=n(76977),p=n(39318);function h(e){var t,n;let{homeHeroPins:r,posts:o,pub:s,onEditClick:h}=e,m=o[0],{isMobile:g}=(0,c.sM)();return(0,i.Y)(d,{editButtonPosition:"bottom-right",homeHeroPins:r,posts:o,pub:s,onEditClick:h,children:(0,i.FD)("div",{className:"heroContainer-jDKSoQ",children:[(null==m?void 0:m.cover_image)&&(0,i.Y)("img",{alt:"",className:"heroImage-xoNbeA",src:m.cover_image}),(0,i.Y)("div",{className:"heroOverlay-eTvO5r"}),m&&(0,i.Y)(l.u,{className:"heroContentContainer-c_0___",children:(0,i.Y)(a.z,{overlayInset:12,postId:m.id,slotIndex:0,children:(0,i.Y)("a",{className:"heroLink-rb6oKe",href:(0,p.wu9)(s,m),children:(0,i.FD)(u.I1,{gap:8,paddingBottom:g?40:80,style:{maxWidth:700},children:[(0,i.Y)("h2",{className:"heroTitle-cQUffs",children:m.title}),(null==(n=m.publishedBylines)||null==(t=n[0])?void 0:t.name)&&(0,i.Y)("div",{className:"heroAuthor-rSiU6l",children:m.publishedBylines[0].name})]})})})})]})})}},32999:function(e,t,n){n.d(t,{A:()=>s});var i=n(69277),l=n(70408),r=n(32641),o=n(4006),a=n(97731);let s=e=>{var{size:t=24,color:n="var(--color-utility-white)",className:s}=e,d=(0,r._)(e,["size","color","className"]);return(0,o.Y)(a.A,(0,l._)((0,i._)({},d),{name:"EyeIconFilled",svgParams:{viewBox:"0 0 24 24"},stroke:"none",width:t,height:t,fill:n,className:s,children:(0,o.Y)("path",{d:"M11.869 18.1925C17.6987 18.1925 21.7307 13.4687 21.7307 11.9962C21.7307 10.5163 17.6914 5.7998 11.869 5.7998C6.11209 5.7998 2 10.5163 2 11.9962C2 13.4687 6.11209 18.1925 11.869 18.1925ZM11.869 16.0566C9.59825 16.0566 7.79331 14.2123 7.79331 11.9962C7.79331 9.72174 9.59825 7.93573 11.869 7.93573C14.1179 7.93573 15.9374 9.72174 15.9374 11.9962C15.9374 14.2123 14.1179 16.0566 11.869 16.0566ZM11.869 13.4614C12.6769 13.4614 13.3464 12.7981 13.3464 11.9962C13.3464 11.187 12.6769 10.5236 11.869 10.5236C11.0538 10.5236 10.3843 11.187 10.3843 11.9962C10.3843 12.7981 11.0538 13.4614 11.869 13.4614Z"})}))}},89839:function(e,t,n){n.d(t,{A:()=>s});var i=n(69277),l=n(70408),r=n(4006),o=n(57157),a=n(97731);let s=function(e){return(0,r.Y)(a.A,(0,l._)((0,i._)({},e),{name:"LucideBookmark",svgParams:{height:24,width:24,fill:"#000000",strokeWidth:0},children:(0,r.Y)(o.A,{height:24,stroke:e.stroke,fill:e.fill,strokeWidth:e.strokeWidth})}))}},14394:function(e,t,n){n.d(t,{A:()=>s});var i=n(69277),l=n(70408),r=n(4006),o=n(60927),a=n(97731);let s=e=>(0,r.Y)(a.A,(0,l._)((0,i._)({},e),{name:"LucideArrowLeftRight",svgParams:{height:24,width:24,fill:"#000000",strokeWidth:0},children:(0,r.Y)(o.A,{height:24,stroke:e.stroke,fill:e.fill,strokeWidth:e.strokeWidth})}))},84824:function(e,t,n){n.d(t,{A:()=>s});var i=n(69277),l=n(70408),r=n(32641),o=n(4006),a=n(97731);let s=e=>{var{stroke:t="var(--color-fg-primary)"}=e,n=(0,r._)(e,["stroke"]);return(0,o.FD)(a.A,(0,l._)((0,i._)({},n),{name:"badges__FoundingBadgeIcon",svgParams:{height:14,width:14,viewBox:"0 0 14 14"},stroke:t,children:[(0,o.Y)("circle",{cx:"3.93749",cy:"5.97916",r:"3.4375"}),(0,o.Y)("path",{d:"M8.39583 9.49273C8.39583 11.3912 6.85681 12.9302 4.95833 12.9302C3.05985 12.9302 1.52083 11.3912 1.52083 9.49273C1.52083 7.59425 3.05985 6.05523 4.95833 6.05523C6.85681 6.05523 8.39583 7.59425 8.39583 9.49273Z"}),(0,o.Y)("path",{d:"M12.4792 9.49273C12.4792 11.3912 10.9402 12.9302 9.04172 12.9302C7.14324 12.9302 5.60422 11.3912 5.60422 9.49273C5.60422 7.59425 7.14324 6.05523 9.04172 6.05523C10.9402 6.05523 12.4792 7.59425 12.4792 9.49273Z"}),(0,o.Y)("circle",{cx:"6.99999",cy:"3.9375",r:"3.4375"}),(0,o.Y)("circle",{cx:"10.0625",cy:"5.97916",r:"3.4375"})]}))}},34957:function(e,t,n){n.d(t,{A:()=>s});var i=n(69277),l=n(70408),r=n(32641),o=n(4006),a=n(97731);let s=e=>{var{size:t=24,color:n="var(--color-fg-primary)",className:s}=e,d=(0,r._)(e,["size","color","className"]);return(0,o.Y)(a.A,(0,l._)((0,i._)({},d),{name:"notes__NoteRestackQuoteIcon",svgParams:{viewBox:"0 0 24 24"},width:t,height:t,stroke:n,strokeWidth:2,fill:"none",className:s,children:(0,o.Y)("path",{d:"M13.4147 2.09993C10.4072 1.67249 7.2423 2.61548 4.92891 4.92887C1.02366 8.83411 1.02366 15.1658 4.92891 19.071C8.83415 22.9762 15.1658 22.9762 19.071 19.071C21.3844 16.7576 22.3274 13.5927 21.9 10.5852M18.5 2.62126C18.8978 2.22343 19.4374 1.99994 20 1.99994C20.5626 1.99994 21.1021 2.22343 21.5 2.62126C21.8978 3.01908 22.1213 3.55865 22.1213 4.12126C22.1213 4.68387 21.8978 5.22343 21.5 5.62126L13 14.1213L8.99998 15.1213L9.99998 11.1213L18.5 2.62126Z",strokeLinecap:"round",strokeLinejoin:"round"})}))}},9292:function(e,t,n){n.d(t,{Sb:()=>o});var i=n(69277),l=n(70408),r=n(4006);function o(e){return(0,r.Y)("svg",(0,l._)((0,i._)({width:"12",height:"12",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg"},e),{children:(0,r.Y)("path",{d:"M5.67709 10C6.02484 10 6.28151 9.73617 6.28151 9.37872V7.91489H6.37259C7.82981 7.91489 8.69917 8.39574 9.30773 9.54894C9.48574 9.88085 9.69273 9.97021 9.93698 9.97021C10.2682 9.97021 10.5 9.64255 10.5 9.00426C10.5 5.94894 9.16283 4.10638 6.37259 4.10638H6.28151V2.64255C6.28151 2.28511 6.02484 2 5.66881 2C5.43698 2 5.27139 2.09787 5.01886 2.33617L1.73183 5.4766C1.56624 5.6383 1.5 5.82553 1.5 6C1.5 6.16596 1.57038 6.36596 1.73183 6.5234L5.01886 9.68511C5.24655 9.90213 5.43698 10 5.67709 10Z"})}))}n(97731)},37767:function(e,t,n){n.d(t,{A:()=>a});var i=n(69277),l=n(70408),r=n(32641),o=n(4006);let a=e=>{var{children:t,href:n,onClick:a,newTab:s}=e,d=(0,r._)(e,["children","href","onClick","newTab"]);return(0,o.Y)("a",(0,l._)((0,i._)({role:"button",tabIndex:0,href:null!=n?n:"javascript:void(0)"},s&&{target:"_blank",rel:"noopener noreferrer"},a&&{onClick:e=>{e.stopPropagation(),a(e)}},d),{children:t}))}},97683:function(e,t,n){n.d(t,{B:()=>et,D:()=>ee});var i=n(79785),l=n(4006),r=n(38376),o=n(49436),a=n(70010),s=n(12723),d=n(25005),c=n(27775),u=n(35404),p=n(14520),h=n(44435),m=n(3549),g=n(56195),v=n(12203),f=n(80827),Y=n(61250),b=n(27786),_=n(3160),y=n(93540),w=n(50180),k=n(33167),I=n(54718),C=n(17402),S=n(15734),D=n.n(S),F=n(37767),x=n(41935),P=n(69277),T=n(70408),A=n(68349),E=n(35369),N=n(76977),B=n(67211),M=n(84270),R=n(16993),O=n(36372);function L(e){var t,n;let{isOpen:i,onClose:r,post:o}=e,a=(0,O.d)(),[s,d]=(0,C.useState)(!1),c=null==(n=o.postTheme)||null==(t=n.variant_config)?void 0:t.fullWidthImage,u={hideOverlay:(null==c?void 0:c.hideOverlay)||!1,hideSectionLink:(null==c?void 0:c.hideSectionLink)||!1,textColor:(null==c?void 0:c.textColor)||"black"},[p,h]=(0,C.useState)(u),m=async()=>{d(!0);try{var e;let t=(0,T._)((0,P._)({},null==(e=o.postTheme)?void 0:e.variant_config),{fullWidthImage:p});await D().patch("/api/v1/post/".concat(o.id,"/theme")).send({variant_config:t}),location.reload()}catch(e){a.popToast(()=>(0,l.Y)(O.y,{text:(0,A.uX)(e)}))}finally{d(!1)}},g=()=>{h(u),r()};return(0,l.FD)(R.aF,{isOpen:i,onClose:g,children:[(0,l.Y)(R.rQ,{title:"Full Width Image Options",onClose:g}),(0,l.Y)(R.cw,{children:(0,l.FD)(N.I1,{gap:12,children:[(0,l.Y)(M.z,{label:"Text Color",options:[{value:"black",label:"Black"},{value:"red",label:"Red"},{value:"white",label:"White"}],value:p.textColor,onChange:e=>h((0,T._)((0,P._)({},p),{textColor:e}))}),(0,l.Y)(B.Y,{label:"Hide overlay",value:p.hideOverlay,onChange:e=>h((0,T._)((0,P._)({},p),{hideOverlay:e}))}),(0,l.Y)(B.Y,{label:"Hide section link",value:p.hideSectionLink,onChange:e=>h((0,T._)((0,P._)({},p),{hideSectionLink:e}))})]})}),(0,l.Y)(R.jl,{primaryButton:(0,l.Y)(E.$n,{disabled:s,priority:"primary",onClick:m,children:"Save"}),secondaryButton:(0,l.Y)(E.$n,{disabled:s,priority:"secondary",onClick:g,children:"Cancel"})})]})}var z=n(84605),U=n(86500),H=n(94729),q=n(13022),G=n(28528),W=n(7761),K=n(45859),V=n(52145),j=n(16291),X=n(4016),J=n(39318),Z=n(49807),Q=n(82776);function $(){let e=(0,i._)([""," top posts"]);return $=function(){return e},e}function ee(e){var t,n,i,I;let{pub:S,post:F,hideDropCapOption:P,hidePinning:T,hidePostHeaderOptions:E,user:N,emailSent:B,allowSendEmail:M,handleCrossPost:R,onToggleMenu:U,onSummaryOpen:ee,trigger:et,disabled:en}=e,{cropGravity:ei}=(0,C.useContext)(G.wZ),{canPinToSection:el}=(0,W.b$)(),er=(0,O.d)(),{iString:eo,iTemplate:ea}=(0,z.GO)(),[es,ed]=(0,C.useState)(!1),[ec,eu]=(0,C.useState)(!1),[ep,eh]=(0,C.useState)(!1),[em,eg]=(0,C.useState)(!1),[ev,ef]=(0,C.useState)(!1),[eY,eb]=(0,C.useState)(null),[e_,ey]=(0,C.useState)(null),[ew,ek]=(0,C.useState)(null),[eI,eC]=(0,C.useState)(!1);(0,C.useEffect)(()=>{(async()=>{ef(!!await (0,H.x6)("/api/v1/notification_settings/post/".concat(F.id,"/mute"),{method:"GET"}))})()},[F.id]);let eS=async e=>{let t;switch(e){case"1hour":t=1;break;case"8hours":t=8;break;case"24hours":t=24}let n=t?{expires_at:(0,j.A)().add(t,"hour").toISOString()}:{};await (0,H.x6)("/api/v1/notification_settings/post/".concat(F.id,"/mute"),{method:"POST",json:n}),ef(!0),er.popToast(()=>(0,l.Y)(O.y,{text:eo("Paused notifications"),Icon:r.A}))},eD=async()=>{await (0,H.x6)("/api/v1/notification_settings/post/".concat(F.id,"/mute"),{method:"DELETE"}),ef(!1),er.popToast(()=>(0,l.Y)(O.y,{text:eo("Unpaused notifications"),Icon:o.A}))},eF=async()=>{let e={everyone:"everyone",only_free:"free subscribers",only_paid:"paid subscribers",founding:"founding members"}[F.audience];if(confirm("Send this published post as an email to ".concat(e,"?")))try{await D().post("/api/v1/drafts/".concat(F.id,"/publish")).send({send:!0,only_send:!0}),location.reload()}catch(e){alert((0,A.uX)(e))}},ex=async()=>{try{await D().put("/api/v1/posts/".concat(F.id,"/clear_cache")),location.reload()}catch(e){alert((0,A.uX)(e))}},eP=async()=>{ed(!0);try{let e=await D().post("/api/v1/posts/".concat(F.id,"/duplicate"));(0,A.V2)((0,J.I_S)(S,e.body.id),{local_navigation:!1})}catch(e){alert((0,A.uX)(e)),ed(!1)}},eT=async e=>{eh(!0),await D().patch("/api/v1/post/".concat(F.id,"/theme")).send({post_preview_crop_gravity:e}),location.reload()},eA=async e=>{eg(!0),await D().patch("/api/v1/post/".concat(F.id,"/theme")).send({disable_drop_cap:e}),location.reload()},eE=async()=>{if(eY)return;eb(S.id);let e=F.pins.includes(S.id),t="/api/v1/publication/".concat(S.id,"/pin/").concat(F.id);try{e?(await D().del(t),F.pins=F.pins.filter(e=>e!==S.id)):(await D().post(t),S.multiple_pins||(F.pins=[]),F.pins.push(S.id)),["/","/beta","/publish"].includes(location.pathname)&&location.reload()}catch(e){alert((0,A.uX)(e))}finally{eb(null)}},eN=async()=>{if(e_)return;let e=F.section_id;if(!e)return;ey(e);let t="/api/v1/publication/".concat(S.id,"/section/").concat(e,"/pin/").concat(F.id);try{F.is_section_pinned?(await D().del(t),F.is_section_pinned=!1):(await D().post(t),F.is_section_pinned=!0),(["/","/beta","/publish"].includes(location.pathname)||location.pathname.startsWith("/s/"))&&location.reload()}catch(e){alert((0,A.uX)(e))}finally{ey(null)}},eB=async()=>{if(ew)return;ek(S.id);let e=F.top_exclusions.includes(S.id),t="/api/v1/publication/".concat(S.id,"/exclusion/").concat(F.id);try{e?(await D().del(t),F.top_exclusions=[]):(await D().post(t),F.top_exclusions=[S.id]),["/","/beta","/publish"].includes(location.pathname)&&location.reload()}catch(e){alert((0,A.uX)(e))}finally{ek(null)}},eM=(null==(t=F.postTheme)?void 0:t.post_preview_crop_gravity)||ei,eR=!(null==(n=F.postTheme)?void 0:n.disable_drop_cap),eO=null==(i=S.sections)?void 0:i.find(e=>e.id===F.section_id),eL="undefined"!=typeof window?window.location.pathname:"",ez=!!(0,q.Ay)("enable_post_summarization"),eU=(0,X.lu)({pub:S}),eH=F.is_section_pinned!==(e_===F.section_id),eq=F.pins.includes(S.id)!==(eY===S.id),eG=F.top_exclusions.includes(S.id)!==(ew===S.id),eW=eU&&!E&&(null==(I=F.postTheme)?void 0:I.header_variant)==="full-width-image";return(0,l.FD)(l.FK,{children:[(0,l.Y)(x.Cg,{isOpen:ec,setIsOpen:eu}),(0,l.Y)(L,{isOpen:eI,onClose:()=>eC(!1),post:F}),(0,l.FD)(K.W1,{trigger:et,onOpen:()=>{null==U||U({active:!0})},onClose:()=>{null==U||U({active:!1})},disabled:en,children:[(0,l.FD)(K.H9,{isFirst:!0,children:[(0,l.Y)(K.Dr,{leading:(0,l.Y)(a.A,{}),href:(0,Z.PuM)(S,F.id,{referrer:eL}),"data-native":!0,children:eo("View stats")}),(0,l.Y)(K.Dr,{leading:(0,l.Y)(s.A,{}),href:(0,Z.U_V)(S,F.id,{referrer:eL}),"data-native":!0,children:eo("Share assets")})]}),(0,l.FD)(K.H9,{children:[(0,l.Y)(K.Dr,{leading:(0,l.Y)(d.A,{}),href:(0,J.wu9)(S,F,{edit:!0}),children:eo("Edit")}),!B&&M&&F.is_published&&(0,l.Y)(K.Dr,{leading:(0,l.Y)(c.A,{}),onClick:eF,children:eo("Send as email")}),(0,l.Y)(K.Dr,{leading:(0,l.Y)(u.A,{}),disabled:es,onClick:eP,children:es?"Duplicating...":"Duplicate"}),R&&(0,l.Y)(K.Dr,{leading:(0,l.Y)(p.A,{}),onClick:R,children:eo("Cross post")}),eU&&(0,l.Y)(K.Dr,{disabled:ep,leading:(0,l.Y)(h.A,{}),onClick:()=>eT("auto"===eM?"center":"auto"),children:ep?"Updating...":"auto"===eM?"Disable smart cropping":"Enable smart cropping"}),eU&&!P&&(0,l.Y)(K.Dr,{disabled:em,leading:(0,l.Y)(m.A,{}),onClick:()=>eA(eR),children:em?"Updating...":eR?"Disable drop cap":"Enable drop cap"}),eW&&(0,l.Y)(K.Dr,{leading:(0,l.Y)(g.A,{}),onClick:()=>eC(!0),children:eo("Edit full width image options")}),ez&&ee&&(0,l.Y)(K.Dr,{leading:(0,l.Y)(v.A,{}),onClick:ee,children:eo("Reader guide")}),(0,q.Ay)("show_open_post_as_pdf_button")&&(0,l.Y)(K.Dr,{leading:(0,l.Y)(f.A,{}),onClick:()=>{eu(!0),(0,A.V2)((0,Z.MGs)(S,F.id),{local_navigation:!1})},children:eo("Open as PDF")})]}),(0,l.FD)(K.H9,{children:[!T&&F.slug&&(0,l.FD)(l.FK,{children:[(0,Q.isPinnable)(S)&&el&&F.section_id&&(F.section_name||(null==eO?void 0:eO.name))&&(0,l.FD)(K.Dr,{leading:eH?(0,l.Y)(Y.A,{}):(0,l.Y)(b.A,{}),onClick:eN,children:[eH?"Unpin from":"Pin to"," ",F.section_name||(null==eO?void 0:eO.name)]}),(0,Q.isPinnable)(S)&&(0,l.Y)(K.Dr,{leading:eq?(0,l.Y)(Y.A,{}):(0,l.Y)(b.A,{}),onClick:eE,children:eq?"Unpin from homepage":"Pin to homepage"})]}),F.slug&&"adhoc_email"!==F.type&&(0,l.Y)(K.Dr,{leading:eG?(0,l.Y)(_.A,{}):(0,l.Y)(y.A,{}),onClick:eB,children:ea($(),eG?"Include in":"Hide from")}),ev?(0,l.Y)(V.MI,{onClick:eD,customLabel:eo("Unpause notifications")}):(0,l.Y)(V.DE,{onMute:e=>eS(e),customLabel:eo("Pause notifications")})]}),(null==N?void 0:N.is_global_admin)&&(0,l.FD)(K.H9,{children:[(0,l.Y)(K.Dr,{priority:"secondary",onClick:ex,leading:(0,l.Y)(w.A,{}),children:eo("Clear from cache")}),(0,l.Y)(K.Dr,{priority:"secondary",href:"".concat((0,J.$_T)({subdomain:"admin"}),"/posts/").concat(F.id),leading:(0,l.Y)(k.A,{}),children:eo("Open in Underground")})]})]})]})}function et(e){let{pub:t,post:n,iconHeight:i,hidePinning:r,user:o,emailSent:a,allowSendEmail:s,iconClassName:d}=e,c=(0,l.Y)(F.A,{onClick:()=>{(0,U.u4)(U.qY.EDIT_POST_DROPDOWN_MENU_OPENED)},children:(0,l.Y)(I.A,{stroke:"var(--color-fg-secondary)",size:i,className:d})});return(0,l.Y)(ee,{trigger:c,pub:t,post:n,hidePinning:r,user:o,emailSent:a,allowSendEmail:s})}},15667:function(e,t,n){n.d(t,{H:()=>I,w:()=>k});var i=n(79785),l=n(4006),r=n(37946),o=n(44471),a=n(17402),s=n(84605),d=n(68349),c=n(35369),u=n(76977),p=n(16993),h=n(19832),m=n(84843),g=n(94996),v=n(63136),f=n(11587),Y=n(36372),b=n(74588);function _(){let e=(0,i._)(["Report to the "," admins"]);return _=function(){return e},e}function y(){let e=(0,i._)(["Your report and profile will be shared with the admins of ","."]);return y=function(){return e},e}let w=["hate","private_information","plagiarism","impersonation","illegal_activity","spam","pornography","other"],k=["impersonation","spam","pornography","other"];function I(e){var t,n;let{isOpen:i,pub:k,onClose:I,onSubmit:S=()=>Promise.resolve(),canReportToAdmins:D=!1,reasons:F=w}=e,[x,P]=(0,a.useState)(null),{iString:T,iTemplate:A,language:E}=(0,s.GO)(),[N,B]=(0,a.useState)(null),[M,R]=(0,a.useState)(!1),[O,L]=(0,a.useState)(!1),[z,U]=(0,a.useState)(!D),{popToast:H}=(0,Y.d)();if((0,a.useEffect)(()=>{i&&U(!D)},[i,D,F]),(0,a.useEffect)(()=>{z?L(!!x):L(!!N)},[z,x,N,F]),D&&!k)return console.error("Must supply pub if reporting to pub admins is possible"),null;let q=z?T("Report to Substack"):A(_(),null!=(t=null==k?void 0:k.name)?t:"");return(0,l.FD)(l.FK,{children:[(0,l.FD)(p.aF,{isOpen:i,onClose:I,disableCloseOnBackdropClick:M||z,children:[(0,l.Y)(p.rQ,{title:q,icon:(0,l.Y)(m.qx,{bg:"accent-red",icon:(0,l.Y)(r.A,{stroke:"var(--color-semantic-error-fg-primary)"})}),description:(0,l.Y)(C,{reportingToSubstack:z,pub:null!=k?k:null,onReportToSubstackClicked:()=>{U(!0)}}),onClose:I}),(0,l.Y)(p.cw,{children:(0,l.FD)(u.I1,{gap:20,children:[z&&(0,l.Y)(l.FK,{children:(0,l.FD)(u.I1,{gap:8,children:[(0,l.Y)(v.EY.B4,{weight:"bold",translated:!0,children:"Reason"}),(0,l.FD)(g.I,{value:null!=x?x:void 0,onChange:e=>{P(e.target.value)},children:[(0,l.Y)(g.K,{children:T("Select a reason")}),F.map(e=>(0,l.Y)("option",{value:e,children:(e=>{let{category:t,language:n="en"}=e;return(0,b.j)({category:t,language:n})})({category:e,language:E})},e))]})]})}),(0,l.FD)(u.I1,{gap:8,children:[(0,l.FD)(u.Ye,{justifyContent:"space-between",children:[z?(0,l.Y)(v.EY.B4,{weight:"bold",translated:!0,children:"Additional details"}):(0,l.Y)(v.EY.B4,{weight:"bold",translated:!0,children:"Reason"}),z&&(0,l.Y)(v.EY.B4,{color:"secondary",translated:!0,children:"Optional"})]}),(0,l.Y)(f.T,{onChange:e=>{B(e.currentTarget.value||null)},placeholder:T("Describe why you're reporting this...")})]})]})}),(0,l.Y)(p.jl,{alignButtons:"stretch",primaryButton:(0,l.Y)(c.$n,{disabled:!O,priority:"destructive",onClick:()=>{R(!0)},children:T("Submit")})})]}),(0,l.Y)(h.m,{isOpen:M,onClose:()=>{R(!1)},title:T("Submit report?"),description:z?T("Reported content will be reviewed and removed if it violates our Content Guidelines."):A(y(),null!=(n=null==k?void 0:k.name)?n:"this publication"),primaryButton:(0,l.Y)(c.$n,{priority:"destructive",onClick:async()=>{R(!1);try{await S({reportCategory:z?x:null,details:N,reportedToSubstack:z})}catch(n){console.error("could not submit report",n);let e=(0,d.uX)(n),t=e&&e.startsWith("Something went wrong")?e:"Something went wrong: ".concat(e);H(()=>(0,l.Y)(Y.y,{text:t}));return}H(()=>(0,l.Y)(Y.y,{text:"Your report was submitted",Icon:o.A}))},children:T("Submit report")}),secondaryButton:(0,l.Y)(c.$n,{priority:"secondary",onClick:()=>{R(!1)},children:T("Cancel")})})]})}function C(e){var t;let{reportingToSubstack:n,pub:i,onReportToSubstackClicked:r}=e;return n?(0,l.FD)(v.EY,{translated:!0,children:["Report content that violates Substack's"," ",(0,l.Y)(v.Yq,{color:"highlight",href:"https://substack.com/content",target:"_blank",rel:"noreferrer",children:"Content Guidelines"})," ","below. Your report is only viewed by our staff. Find additional reporting options and information in our"," ",(0,l.Y)(v.Yq,{color:"highlight",href:"https://support.substack.com/hc/en-us/articles/23248646000532",target:"_blank",rel:"noreferrer",children:"Standards and Enforcement Help Center"}),"."]}):(0,l.FD)(v.EY,{translated:!0,children:[(0,l.FD)(v.EY.B3,{color:"secondary",translated:!0,children:["Your report and profile will be shared with the admins of ",(0,l.Y)("strong",{children:I18N.p(null!=(t=null==i?void 0:i.name)?t:"")}),", since at Substack we believe publication owners are best able to moderate their communities."]}),(0,l.FD)(v.EY.B3,{translated:!0,color:"secondary",children:["If you believe something violates Substack's"," ",(0,l.Y)(v.Yq,{color:"highlight",href:"https://substack.com/content",target:"_blank",rel:"noreferrer",children:"Content Guidelines"}),", you can"," ",(0,l.Y)(v.Yq,{color:"highlight",onClick:()=>{r()},children:"report it to Substack"})," ","instead."]})]})}},50883:function(e,t,n){n.d(t,{T:()=>T});var i=n(69277),l=n(4006),r=n(17402),o=n(15734),a=n.n(o),s=n(84605),d=n(86500),c=n(69618),u=n(68349),p=n(35369),h=n(8149),m=n(48535),g=n(76977),v=n(67211),f=n(20500),Y=n(88762),b=n(16993),_=n(45974),y=n(94996),w=n(63136),k=n(11587),I=n(65842),C=n(36372),S=n(16291),D=n(98111),F=n(56262),x=n(39318);let P={everyone:"Everyone",only_paid:"Paid subscribers",founding:"Founding members"},T=e=>{let{pub:t,post:n,user:o,open:_,setOpen:D,placeholderText:T=""}=e,E=(0,S.A)().add(2,"minutes"),[N,B]=(0,r.useState)(null),[M,R]=(0,r.useState)(T),[O,L]=(0,r.useState)(!1),[z,U]=(0,r.useState)(!0),[H,q]=(0,r.useState)("PREAMBLE"),[G,W]=(0,r.useState)(null),[K,V]=(0,r.useState)(void 0),[j,X]=(0,r.useState)(!0),[J,Z]=(0,r.useState)(!0),[Q,$]=(0,r.useState)(!1),[ee,et]=(0,r.useState)((0,S.A)().add(1,"day").toDate()),[en,ei]=(0,r.useState)(""),{iString:el}=(0,s.GO)(),er={everyone:"to everyone",founding:"to founding members",only_paid:"to paid subscribers"}[null!=K?K:"null"],eo=j?"Send":"Publish",ea=Q&&ee?(0,S.A)(ee).max(E).fromNow():"",es=j?er:"",ed="".concat(eo," cross-post ").concat(es," ").concat(ea),ec=null==N?void 0:N.find(e=>e.id===G),eu=(0,C.d)();(0,r.useEffect)(()=>{let e=async()=>{try{var e;let t=await a().get("/api/v1/restack/restackable-pubs"),n=(null==t||null==(e=t.body)?void 0:e.publications)||[];B(n),U(!1),n.length>0&&(W(n[0].id),V("everyone"))}catch(e){console.error("Failed to load user profile for restacking: ",e)}};_&&!N&&z&&e()},[_,o,z,U,N,B]),(0,r.useEffect)(()=>{_&&N&&0===N.length&&!z&&(0,u.V2)((0,x.f5H)())},[_,N,z]);let ep=(e,i)=>{D(!_,i),q("PREAMBLE"),ei(null),U(!1),i&&(R(""),(0,d.u4)(d.qY.RESTACK_POST_SUBMITTED,{restacked_publication_id:t.id,restacked_post_id:n.id,restacking_user_id:o.id,restacking_publication_id:null==ec?void 0:ec.id,restacking_blurb:M}),eu.popToast(()=>(0,l.Y)(C.y,{text:Q?"This post is scheduled to cross-post ".concat(ea):"This post was cross-posted to your subscribers"}))),(0,d.u4)(d.qY.CROSS_POST_MODAL_CLOSED,{didRestack:i})},eh=async()=>{(0,d.u4)(d.qY.CROSS_POST_MODAL_SUBMIT_CLICKED),U(!0);try{if(Q){let e=(0,S.A)(ee).max(E).toDate();if(!ec)throw Error("no selectedPub");await a().post("/api/v1/restack/".concat(n.id,"/schedule")).send({audience:K,restackingPubId:ec.id,introText:M,sendEmail:j,publishToWeb:J,scheduledAt:e})}else{if(!ec)throw Error("no selectedPub");await a().post("/api/v1/restack/".concat(n.id)).send({audience:K,restackingPubId:ec.id,introText:M,sendEmail:j,publishToWeb:J})}(0,d.u4)(d.qY.CROSS_POST_MODAL_SUBMITTED),ep({},!0);return}catch(e){if((0,d.u4)(d.qY.CROSS_POST_MODAL_SUBMIT_FAILED,{error:(0,u.uX)(e,"Could not retrieve error message")}),console.error("Failed to restack post:",e),e instanceof TypeError)throw ei("An unknown error ocurred. This post was not recommended."),U(!1),e;ei((0,u.uX)(e,"This post could not be recommended.")),U(!1)}};return(0,l.FD)(b.aF,{isOpen:_,onClose:ep,children:[(0,l.Y)(b.rQ,{onClose:ep,title:el("Cross-post to your Substack"),showDivider:!0}),"PREAMBLE"===H?(0,l.FD)(l.FK,{children:[(0,l.Y)(b.cw,{children:(0,l.FD)(g.I1,{gap:20,children:[(0,l.Y)(A,{post:n,pub:t}),(0,l.Y)(k.T,(0,i._)({placeholder:el("Say why this post is worth reading..."),onChange:e=>{O||(L(!0),(0,d.u4)(d.qY.CROSS_POST_MODAL_TYPING_STARTED)),R(e.target.value)},value:M,maxLength:800,rows:5},c.b)),en&&(0,l.Y)(f.yn,{children:en})]})}),(0,l.Y)(b.jl,{direction:"column",primaryButton:(0,l.Y)(p.$n,{priority:"primary",onClick:()=>{if((0,d.u4)(d.qY.CROSS_POST_MODAL_CONTINUE_CLICKED),!M){ei("Please write something to your subscribers to continue"),(0,d.u4)(d.qY.CROSS_POST_MODAL_CONTINUE_FAILED);return}ei(""),q("AUDIENCE_SELECTION"),(0,d.u4)(d.qY.CROSS_POST_MODAL_CONTINUED)},disabled:!M,loading:z,children:el("Continue")})})]}):(0,l.FD)(l.FK,{children:[(0,l.Y)(b.cw,{children:(0,l.FD)(g.I1,{gap:20,children:[(0,l.FD)(I.A0,{children:[(0,l.Y)(Y.JU,{children:el("Post to")}),(0,l.Y)(y.I,{value:null==ec?void 0:ec.id,onChange:e=>{let t=e.currentTarget.value;V("everyone"),W(Number(t))},children:null==N?void 0:N.map(e=>(0,l.Y)("option",{value:e.id,children:e.name}))})]}),(0,l.FD)(I.A0,{children:[(0,l.Y)(Y.JU,{children:el("Send to")}),(0,l.Y)(y.I,{value:K,onChange:e=>V(e.target.value),children:((null==ec?void 0:ec.payments_state)==="enabled"?(0,F.getAudiencesForPublicListing)():["everyone"]).map(e=>(0,l.Y)("option",{value:e,children:P[e]}))})]}),(0,l.FD)(g.I1,{gap:12,children:[(0,l.Y)(Y.JU,{children:el("Delivery")}),(0,l.Y)(v.Y,{value:j,label:el("Send cross-post via email"),onChange:e=>X(e)}),(0,l.Y)(v.Y,{value:J,label:el("Publish cross-post to web"),onChange:e=>Z(e)}),(0,l.Y)(v.Y,{value:Q,label:el("Schedule time to publish cross-post"),onChange:e=>$(e),contentBelow:(0,l.Y)(h.N,{open:Q,children:(0,l.Y)(g.I1,{paddingTop:8,children:(0,l.Y)(m.ZZ,{value:null!=ee?ee:new Date,max:(0,S.A)().add(92,"days").toDate(),onChange:e=>{et(new Date(e.currentTarget.value))}})})})})]}),en&&(0,l.Y)(w.EY.B4,{color:"error",children:en})]})}),(0,l.Y)(b.jl,{direction:"column",primaryButton:(0,l.Y)(p.$n,{priority:j||J?"primary":"secondary",onClick:eh,disabled:z||!j&&!J,children:ed})})]})]})},A=e=>{let{post:t,pub:n}=e;return(0,l.FD)(g.I1,{gap:12,border:"detail",radius:"md",shadow:"xs",bg:"secondary",padding:12,children:[(0,l.FD)(g.Ye,{alignItems:"center",gap:8,children:[(0,l.Y)(_.Nq,{pub:n,size:20}),(0,l.Y)(w.EY.Meta,{weight:"medium",children:n.name})]}),(0,l.FD)(g.I1,{gap:2,children:[(0,l.Y)(w.EY.B3,{weight:"semibold",clamp:2,children:t.title}),(0,l.Y)(w.EY.B4,{color:"secondary",clamp:2,children:t.truncated_body_text?(t.truncated_body_text||"").replace(D.T.PUBLICATION_NAME,n.name):t.subtitle||""})]})]})}},73869:function(e,t,n){n.d(t,{m:()=>Q});var i=n(4006),l=n(65892),r=n(17402),o=n(69277),a=n(70408),s=n(90179),d=n.n(s),c=n(15871),u=n(43627),p=n(74979),h=n(83673),m=n.n(h),g=n(38970),v=n.n(g),f=n(33031),Y=n.n(f),b=n(48697),_=n(84605),y=n(35369),w=n(76977),k=n(25318),I=n(94996),C=n(63136),S=n(46009);let D=e=>{let{addLabel:t,hideAdd:n,isValidSection:l,metadata:o,pub:a,renderEditMetadata:s,renderMetadata:d,selectedIds:p,selectedLabel:h,validateMetadata:g,onChangeMetadata:f,onChangeSelectedIds:Y}=e,[b,_]=(0,r.useState)(null),y=(0,c.FR)((0,c.MS)(c.AN,{activationConstraint:{distance:5}})),I=v()(a.sections,"id"),D=(0,S.j_)({pub:a}),T=m()(p.map(e=>{var t;return -1===e?{id:-1,name:null!=(t=D.title)?t:""}:I[e]})),A=e=>{Y(p.filter(t=>t!==e))},E=e=>{_(e)};return(0,i.FD)(w.I1,{gap:16,children:[(0,i.Y)(k.D,{label:h,children:(0,i.Y)(w.I1,{gap:8,children:p.length?(0,i.Y)(c.Mp,{collisionDetection:c.fp,sensors:y,onDragEnd:e=>{let{active:t,over:n}=e;if(t.id!==n.id){let e=p.findIndex(e=>e===t.id),i=p.findIndex(e=>e===n.id);Y((0,u.be)(p,e,i))}},children:(0,i.Y)(u.gB,{items:T,strategy:u.kL,children:T.map(e=>{var t;return(0,i.Y)(x,{disableDrag:!!b,id:e.id,children:(0,i.Y)(P,{isEditing:b===e.id,renderEditMetadata:s,renderMetadata:d,sectionId:e.id,sectionMetadata:null!=(t=null==o?void 0:o[e.id])?t:null,sectionName:e.name,validateMetadata:g,onChangeMetadata:f,onEdit:E,onRemove:A},e.id)},e.id)})})}):(0,i.Y)(C.EY.B3,{color:"pub-secondary-text",children:"No sections selected"})})}),!n&&(0,i.Y)(k.D,{label:null!=t?t:"Add section",children:(0,i.Y)(F,{excludedSectionIds:[...T.map(e=>e.id),...l?a.sections.filter(e=>!l(e)).map(e=>e.id):[]],pub:a,onSelect:e=>{Y([...p,e])}})})]})},F=e=>{let{excludedSectionIds:t,pub:n,onSelect:l}=e,{iString:r}=(0,_.GO)(),o=n.sections.filter(e=>!(null==t?void 0:t.includes(e.id)));return(0,i.FD)(I.I,{value:"",onChange:e=>{let t=e.target.value;t&&l(parseInt(t))},children:[(0,i.Y)(I.K,{children:r("Select a section")}),Y()(o,"name").map(e=>(0,i.Y)("option",{value:e.id,children:e.name}))]})},x=e=>{let{children:t,disableDrag:n,id:l}=e,{attributes:r,isDragging:s,listeners:d,setNodeRef:c,transform:h,transition:m}=(0,u.gl)({id:l}),g={transform:p.Ks.Translate.toString(h),transition:m,zIndex:+!!s,cursor:s?"grabbing":"grab"};return n?(0,i.Y)("div",{children:t}):(0,i.Y)("div",(0,a._)((0,o._)({ref:c},r,d),{role:"button",style:g,children:t}))},P=e=>{let{isEditing:t,renderEditMetadata:n,renderMetadata:o,sectionId:a,sectionName:s,sectionMetadata:d,validateMetadata:c,onChangeMetadata:u,onEdit:p,onRemove:h}=e,[m,g]=(0,r.useState)(d),[v,f]=(0,r.useState)(null);return(0,i.FD)(w.Ye,{alignItems:"start",bg:"white",border:"detail-themed",justifyContent:"space-between",paddingLeft:12,paddingRight:8,paddingY:8,radius:"sm",children:[(0,i.FD)(w.I1,{children:[(0,i.Y)(C.EY.B4,{weight:"semibold",children:s}),!t&&o&&(0,i.Y)("div",{children:o(d)}),t&&n&&(0,i.FD)(w.I1,{alignItems:"start",gap:12,paddingTop:12,children:[n({errors:v,value:m,onChange:g}),u&&(0,i.FD)(w.Ye,{gap:8,children:[(0,i.Y)(y.$n,{size:"sm",onClick:()=>{if(u){if(c){let{isValid:e,message:t}=c(m);if(!e&&t)return void f([t]);f(null)}u({sectionId:a,value:m}),p(null)}},children:"Done"}),(0,i.Y)(y.$n,{priority:"secondary",size:"sm",onClick:()=>{p(null)},children:"Cancel"})]})]})]}),!t&&(0,i.FD)(w.Ye,{alignItems:"center",gap:8,children:[!!n&&(0,i.Y)(y.K0,{size:"xs",onClick:()=>{p(a)},children:(0,i.Y)(l.A,{size:14})}),(0,i.Y)(y.K0,{size:"xs",onClick:()=>{h(a)},children:(0,i.Y)(b.A,{size:14})})]})]})},T=e=>{let{emptyText:t,label:n,value:l}=e;return(0,i.FD)(w.Ye,{alignItems:"baseline",gap:4,children:[(0,i.FD)(C.EY.B4,{fontWeight:"semibold",children:[n,":"]}),(0,i.Y)(C.EY.B4,{color:l?"primary":"secondary",children:l||t})]})};var A=n(89160),E=n(79796),N=n(60141),B=n(16993);let M=e=>{let{pub:t,onClose:n}=e,{isSaving:l,metadata:r,ids:s,onChangeMetadata:c,onChangeOrder:u,onSave:p}=(0,E.i)({pub:t}),{isSaving:h,metadata:m,ids:g,onChangeMetadata:v,onChangeOrder:f,onSave:Y}=(0,E.i)({pub:t,pubSetting:"fp_primary_column_section_ids"}),{ids:b,isSaving:_,onChange:k,onSave:I}=(0,A.G)({pub:t}),C=async()=>{await p(),await Y(),await I(),window.location.reload()};return(0,i.FD)(B.aF,{isOpen:!0,onClose:n,children:[(0,i.Y)(B.rQ,{title:"Edit featured and archived sections",onClose:n}),(0,i.Y)(B.cw,{children:(0,i.FD)(w.I1,{gap:36,children:[(0,i.Y)(D,{addLabel:"Add From the Free Press section",metadata:m,pub:t,renderEditMetadata:e=>{var t,n;let{value:l,onChange:r}=e;return(0,i.FD)(w.I1,{gap:8,children:[(0,i.Y)(N.A,{label:"Tagline",value:null!=(t=null==l?void 0:l.tagline)?t:"",width:260,onChange:e=>{var t;r({frequency:null!=(t=null==l?void 0:l.frequency)?t:"",tagline:e})}}),(0,i.Y)(N.A,{label:"Frequency",value:null!=(n=null==l?void 0:l.frequency)?n:"",width:260,onChange:e=>{r((0,a._)((0,o._)({},l),{frequency:e}))}})]})},renderMetadata:e=>{var t,n;return(0,i.FD)(w.I1,{children:[(0,i.Y)(T,{emptyText:"no tagline set",label:"Tagline",value:null!=(t=null==e?void 0:e.tagline)?t:""}),(0,i.Y)(T,{emptyText:"no frequency set",label:"Frequency",value:null!=(n=null==e?void 0:e.frequency)?n:""})]})},selectedIds:g,selectedLabel:"From The Free Press sections",onChangeMetadata:e=>{var t;let{sectionId:n,value:i}=e;v({metadata:i?(0,a._)((0,o._)({},r),{[n]:(0,a._)((0,o._)({},i),{frequency:null!=(t=null==i?void 0:i.frequency)?t:""})}):d()(r,n)})},onChangeSelectedIds:e=>{f({ids:e})}}),(0,i.Y)(D,{addLabel:"Add featured section",metadata:r,pub:t,renderEditMetadata:e=>{var t,n;let{value:l,onChange:r}=e;return(0,i.FD)(w.I1,{gap:8,children:[(0,i.Y)(N.A,{label:"Tagline",value:null!=(t=null==l?void 0:l.tagline)?t:"",width:260,onChange:e=>{var t;r({frequency:null!=(t=null==l?void 0:l.frequency)?t:"",tagline:e})}}),(0,i.Y)(N.A,{label:"Frequency",value:null!=(n=null==l?void 0:l.frequency)?n:"",width:260,onChange:e=>{r((0,a._)((0,o._)({},l),{frequency:e}))}})]})},renderMetadata:e=>{var t,n;return(0,i.FD)(w.I1,{children:[(0,i.Y)(T,{emptyText:"no tagline set",label:"Tagline",value:null!=(t=null==e?void 0:e.tagline)?t:""}),(0,i.Y)(T,{emptyText:"no frequency set",label:"Frequency",value:null!=(n=null==e?void 0:e.frequency)?n:""})]})},selectedIds:s,selectedLabel:"Featured sections",onChangeMetadata:e=>{var t;let{sectionId:n,value:i}=e;c({metadata:i?(0,a._)((0,o._)({},r),{[n]:(0,a._)((0,o._)({},i),{frequency:null!=(t=null==i?void 0:i.frequency)?t:""})}):d()(r,n)})},onChangeSelectedIds:e=>{u({ids:e})}}),(0,i.Y)(D,{addLabel:"Add archived section",pub:t,selectedIds:b,selectedLabel:"Archived sections",onChangeSelectedIds:e=>{k({ids:e})}})]})}),(0,i.Y)(B.jl,{primaryButton:(0,i.Y)(y.$n,{disabled:l||_||h,onClick:C,children:"Save"}),secondaryButton:(0,i.Y)(y.$n,{disabled:l||_||h,priority:"secondary",onClick:n,children:"Cancel"})})]})};var R=n(27428);let O=e=>{let{pub:t,onClose:n}=e,{isSaving:l,ids:r,onSave:o,onChange:a}=(0,R.M)({pub:t}),s=async()=>{await o(),window.location.reload()};return(0,i.FD)(B.aF,{isOpen:!0,onClose:n,children:[(0,i.Y)(B.rQ,{title:"Edit event sections",onClose:n}),(0,i.Y)(B.cw,{children:(0,i.Y)(D,{addLabel:"Add event section",pub:t,selectedIds:r,selectedLabel:"Event sections",onChangeSelectedIds:e=>{a({ids:e})}})}),(0,i.Y)(B.jl,{primaryButton:(0,i.Y)(y.$n,{disabled:l,onClick:s,children:"Save"}),secondaryButton:(0,i.Y)(y.$n,{disabled:l,priority:"secondary",onClick:n,children:"Cancel"})})]})};var L=n(77124),z=n(57753),U=n(84270);let H=e=>{let{pub:t,onClose:n}=e,{ids:l,metadata:s,onChangeOrder:d,onChangeMetadata:c,onSave:u}=(0,L.q)({pub:t}),[p,h]=(0,r.useState)(!1),m=async()=>{h(!0),await u(),window.location.reload()};return(0,i.FD)(B.aF,{isOpen:!0,onClose:n,children:[(0,i.Y)(B.rQ,{title:"Edit podcast sections",onClose:n}),(0,i.Y)(B.cw,{children:(0,i.Y)(D,{addLabel:"Add podcast section",isValidSection:e=>e.is_podcast&&e.is_live,metadata:s,pub:t,renderEditMetadata:e=>{var t;let{value:n,onChange:l}=e;return(0,i.Y)(w.I1,{gap:12,children:(0,i.Y)(U.z,{label:"Carousel color",options:z.ek.map(e=>({label:e,value:e})),value:null!=(t=null==n?void 0:n.carouselColor)?t:"black",onChange:e=>{l({carouselColor:e})}})})},renderMetadata:e=>{var t;return(0,i.Y)(w.Ye,{height:20,radius:"xs",style:{backgroundColor:z.Q3[null!=(t=null==e?void 0:e.carouselColor)?t:"black"].hex},width:20})},selectedIds:l,selectedLabel:"Podcast sections",onChangeMetadata:e=>{let{sectionId:t,value:n}=e;c({metadata:(0,a._)((0,o._)({},s),{[t]:n})})},onChangeSelectedIds:e=>{d({ids:e})}})}),(0,i.Y)(B.jl,{primaryButton:(0,i.Y)(y.$n,{disabled:p,onClick:m,children:"Save"}),secondaryButton:(0,i.Y)(y.$n,{disabled:p,priority:"secondary",onClick:n,children:"Cancel"})})]})};var q=n(95691),G=n(7755);let W=e=>{let{pub:t,onClose:n}=e,{isSaving:l,metadata:r,ids:s,onChangeMetadata:d,onChangeOrder:c,onSave:u}=(0,q.P)({pub:t}),p=async()=>{await u(),window.location.reload()};return(0,i.FD)(B.aF,{isOpen:!0,onClose:n,children:[(0,i.Y)(B.rQ,{title:"Edit video sections",onClose:n}),(0,i.Y)(B.cw,{children:(0,i.Y)(D,{addLabel:"Add video section",metadata:r,pub:t,renderEditMetadata:e=>{var t,n;let{errors:l,value:r,onChange:o}=e;return(0,i.FD)(w.I1,{gap:12,children:[(0,i.Y)(U.z,{label:"Carousel color",options:z.ek.map(e=>({label:e,value:e})),value:null!=(t=null==r?void 0:r.carouselColor)?t:"black",onChange:e=>{var t;o({carouselColor:e,youtubeUrl:null!=(t=null==r?void 0:r.youtubeUrl)?t:""})}}),(0,i.Y)(N.A,{errors:l,label:"YouTube URL",value:null!=(n=null==r?void 0:r.youtubeUrl)?n:"",width:260,onChange:e=>{var t;o({carouselColor:null!=(t=null==r?void 0:r.carouselColor)?t:"black",youtubeUrl:e})}})]})},renderMetadata:e=>{var t;return(0,i.FD)(w.Ye,{alignItems:"center",gap:8,children:[(0,i.Y)(w.Ye,{height:20,radius:"xs",style:{backgroundColor:z.Q3[null!=(t=null==e?void 0:e.carouselColor)?t:"black"].hex},width:20}),(null==e?void 0:e.youtubeUrl)?(0,i.Y)(C.EY.B4,{children:(0,i.Y)("a",{href:null==e?void 0:e.youtubeUrl,rel:"noopener noreferrer",target:"_blank",children:"YouTube link"})}):(0,i.Y)(C.EY.B4,{color:"pub-secondary-text",children:"No YouTube link set"})]})},selectedIds:s,selectedLabel:"Video sections",validateMetadata:e=>{var t;let n=(null!=(t=null==e?void 0:e.youtubeUrl)?t:"").trim();if(!n)return{isValid:!0,message:null};let{isValid:i,message:l}=(0,G.Hx)({platform:"youtube",url:n,language:"en"});return{isValid:i,message:l}},onChangeMetadata:e=>{var t,n;let{sectionId:i,value:l}=e;d({metadata:(0,a._)((0,o._)({},r),{[i]:(0,a._)((0,o._)({},l),{carouselColor:null!=(t=null==l?void 0:l.carouselColor)?t:"black",youtubeUrl:null!=(n=null==l?void 0:l.youtubeUrl)?n:""})})})},onChangeSelectedIds:e=>{c({ids:e})}})}),(0,i.Y)(B.jl,{primaryButton:(0,i.Y)(y.$n,{disabled:l,onClick:p,children:"Save"}),secondaryButton:(0,i.Y)(y.$n,{disabled:l,priority:"secondary",onClick:n,children:"Cancel"})})]})},K=e=>{let{pub:t,selectedIds:n,selectedLabel:l,onChangeSelectedIds:r}=e,s=(0,c.FR)((0,c.MS)(c.AN,{activationConstraint:{distance:5}})),d=v()(t.authorPagesInfo,"user_id"),p=m()(n.map(e=>d[e]?(0,a._)((0,o._)({},d[e]),{id:e}):null)),h=e=>{r(n.filter(t=>t!==e))};return(0,i.FD)(w.I1,{gap:16,children:[(0,i.Y)(k.D,{label:l,children:(0,i.Y)(w.I1,{gap:8,children:n.length?(0,i.Y)(c.Mp,{collisionDetection:c.fp,sensors:s,onDragEnd:e=>{let{active:t,over:i}=e;if(t.id!==i.id){let e=n.findIndex(e=>e===t.id),l=n.findIndex(e=>e===i.id);r((0,u.be)(n,e,l))}},children:(0,i.Y)(u.gB,{items:p,strategy:u.kL,children:p.map(e=>(0,i.Y)(j,{id:e.user_id,children:(0,i.Y)(X,{authorId:e.user_id,authorName:e.name,onRemove:h})},e.user_id))})}):(0,i.Y)(C.EY.B3,{color:"pub-secondary-text",children:"No authors selected"})})}),(0,i.Y)(k.D,{label:"Add an author",children:(0,i.Y)(V,{excludedAuthorIds:p.map(e=>e.id),pub:t,onSelect:e=>{r([...n,e])}})})]})},V=e=>{var t,n;let{excludedAuthorIds:l,pub:r,onSelect:o}=e,{iString:a}=(0,_.GO)(),s=null!=(n=null==(t=r.authorPagesInfo)?void 0:t.filter(e=>!!e.name&&!!e.bio&&!!e.photo_url).filter(e=>!(null==l?void 0:l.includes(e.user_id))))?n:[];return(0,i.FD)(I.I,{value:"",onChange:e=>{let t=e.target.value;t&&o(parseInt(t))},children:[(0,i.Y)(I.K,{children:a("Select a section")}),Y()(s,"name").map(e=>(0,i.Y)("option",{value:e.user_id,children:e.name}))]})},j=e=>{let{children:t,disableDrag:n,id:l}=e,{attributes:r,isDragging:s,listeners:d,setNodeRef:c,transform:h,transition:m}=(0,u.gl)({id:l}),g={transform:p.Ks.Translate.toString(h),transition:m,zIndex:+!!s,cursor:s?"grabbing":"grab"};return n?(0,i.Y)("div",{children:t}):(0,i.Y)("div",(0,a._)((0,o._)({ref:c},r,d),{role:"button",style:g,children:t}))},X=e=>{let{authorId:t,authorName:n,onRemove:l}=e;return(0,i.FD)(w.Ye,{alignItems:"start",bg:"white",border:"detail-themed",justifyContent:"space-between",paddingLeft:12,paddingRight:8,paddingY:8,radius:"sm",children:[(0,i.Y)(w.I1,{children:(0,i.Y)(C.EY.B4,{weight:"semibold",children:n})}),(0,i.Y)(y.K0,{size:"xs",onClick:()=>{l(t)},children:(0,i.Y)(b.A,{size:14})})]})};var J=n(1918);let Z=e=>{let{pub:t,onClose:n}=e,{ids:l,onSave:o,onChange:a}=(0,J.i)({pub:t}),[s,d]=(0,r.useState)(!1),c=async()=>{d(!0),await o(),window.location.reload()};return(0,i.FD)(B.aF,{isOpen:!0,onClose:n,children:[(0,i.Y)(B.rQ,{title:"Edit authors",onClose:n}),(0,i.Y)(B.cw,{children:(0,i.Y)(K,{pub:t,selectedIds:l,selectedLabel:"Authors to show",onChangeSelectedIds:e=>{a({ids:e})}})}),(0,i.Y)(B.jl,{primaryButton:(0,i.Y)(y.$n,{disabled:s,onClick:c,children:"Save"}),secondaryButton:(0,i.Y)(y.$n,{disabled:s,priority:"secondary",onClick:n,children:"Cancel"})})]})},Q=e=>{let{pub:t,sectionType:n,user:o}=e,[a,s]=(0,r.useState)(!1);return(null==o?void 0:o.is_admin)?(0,i.FD)(i.FK,{children:[(0,i.Y)(y.K0,{priority:"primary-mono",size:"sm",onClick:()=>{s(!0)},children:(0,i.Y)(l.A,{size:16})}),a&&"columns"===n&&(0,i.Y)(M,{pub:t,onClose:()=>{s(!1)}}),a&&"event"===n&&(0,i.Y)(O,{pub:t,onClose:()=>{s(!1)}}),a&&"podcast"===n&&(0,i.Y)(H,{pub:t,onClose:()=>{s(!1)}}),a&&"video"===n&&(0,i.Y)(W,{pub:t,onClose:()=>{s(!1)}}),a&&"who-we-are"===n&&(0,i.Y)(Z,{pub:t,onClose:()=>{s(!1)}})]}):null}},22076:function(e,t,n){n.d(t,{n:()=>s});var i=n(4006),l=n(25006),r=n(86500),o=n(38914),a=n(49807);let s=e=>{var t;let{trigger:n,liveStream:s,trackingSurface:d}=e,c=(0,l.df)();if(!c)return null;let u=null==s||null==(t=s.id)?void 0:t.toString(),p={title:s.title,description:s.description||"",location:(0,a.QMq)({pub:c,utm_campaign:u,utm_source:"add_to_calendar_button",utm_medium:"web"}),start:s.scheduled_at||new Date,duration:[1,"hour"],allDay:!1,busy:!0};return(0,i.Y)(o.L,{event:p,handleClick:e=>{(0,r.u4)(r.qY.ADD_TO_CALENDAR_CLICKED,{liveStreamId:s.id,surface:d,type:e})},menuProps:{trigger:n}})}},82528:function(e,t,n){n.d(t,{y:()=>v});var i=n(69277),l=n(70408),r=n(4006),o=n(32485),a=n.n(o),s=n(79909),d=n(13950),c=n(53696),u=n(15894),p=n(17306),h=n(68410),m=n(76977),g=n(72032);let v=e=>{let{actions:t,aboveTitle:n,belowDescription:o,bodyWrapperVariant:v,children:f,description:Y,image:b,isLoading:_,metadata:y,title:w,pageCTA:k,hideDivider:I=!1}=e,{isMobile:C}=(0,h.sM)(),S=!!(w&&!Y&&!n&&!o&&!t&&!b),{markdownProps:D}=(0,p.$)(Y);return(0,r.FD)(d.DH,{children:[y&&(0,r.Y)(s.Metadata,(0,i._)({},y)),(0,r.Y)(c.r,{paddingTop:C?40:64,children:!_&&(0,r.FD)(m.I1,{gap:C?24:40,paddingBottom:64,children:[(0,r.Y)("div",{className:a()(g.A.header,{[g.A.noImage]:!b,[g.A.headerWithJustTitle]:S}),children:C?(0,r.FD)(m.I1,{gap:24,children:[n&&(0,r.Y)(m.Ye,{alignSelf:"start",children:n}),(0,r.Y)(u.T,{preset:"h1-serif",children:w}),b&&(0,r.Y)(m.Ye,{children:b}),Y&&(0,r.Y)(u.T,(0,l._)((0,i._)({},D),{preset:"d1-sans-regular"})),o]}):(0,r.FD)(r.FK,{children:[(0,r.FD)(m.I1,{children:[n&&(0,r.Y)(m.Ye,{alignSelf:"start",children:n}),(0,r.Y)(u.T,{preset:"h1-serif",children:w}),(0,r.FD)(m.I1,{gap:24,children:[Y&&(0,r.Y)(u.T,(0,l._)((0,i._)({},D),{preset:"d1-sans-regular"})),o]})]}),b&&(0,r.Y)(m.Ye,{justifyContent:"end",children:b}),t&&(0,r.Y)("div",{className:g.A.actions,children:t})]})}),!I&&(0,r.Y)("div",{className:g.A.thickRule,children:k}),(0,r.Y)("div",{className:a()({[g.A.bodyWrapperTwoMiddleColumns]:"two-middle-columns"===v}),children:f})]})})]})}},53696:function(e,t,n){n.d(t,{r:()=>r});var i=n(4006),l=n(76977);let r=e=>{let{children:t,paddingTop:n}=e;return(0,i.Y)(l.I1,{className:"container-Y7VoFt",paddingTop:n,children:t})}},82180:function(e,t,n){n.d(t,{Z:()=>b});var i=n(69277),l=n(70408),r=n(4006),o=n(13589),a=n(40408),s=n(85612),d=n(57753),c=n(84605),u=n(85478),p=n(74894),h=n(68349),m=n(68410),g=n(76977),v=n(36372),f=n(59294),Y=n(7755);let b=e=>{let{pub:t,section:n,user:b,post:_}=e,{iString:y}=(0,c.GO)(),{getConfigFor:w}=(0,u.mJ)(),{isMobile:k}=(0,m.sM)(),[I,C]=(0,o.Mk)(),[S,D]=(0,o.Mk)(),[F,x]=(0,o.Mk)(),P=(0,v.d)(),{feedUrl:T}=(0,f.Zq)({pub:t,user:null!=b?b:null,section:n}),A=_&&!!w("thefp_show_pub_app_callout_on_post"),E=(0,Y.Em)({pub:t,section:n,spotifySettings:(0,p.Om)({pub:t,section:null!=n?n:null})}),N={as:"a",cursor:"pointer",rel:"noreferrer noopener",target:"_blank"},B=(0,r.FD)(g.Ye,{alignItems:"center",gap:16,children:[E.spotify_url&&(0,r.Y)(g.Ye,(0,l._)((0,i._)({},C,N),{href:E.spotify_url,children:(0,r.Y)(s.MO,{fill:I?"#1DB954":d.Q3.black.hex,size:24})})),E.apple_podcasts_url&&(0,r.Y)(g.Ye,(0,l._)((0,i._)({},D,N),{href:E.apple_podcasts_url,children:(0,r.Y)(s.uv,{fill:S?"#B53CD9":d.Q3.black.hex,size:24})})),(0,r.Y)(g.Ye,(0,l._)((0,i._)({},x),{cursor:"pointer",onClick:()=>{P.popToast(()=>(0,r.Y)(v.y,{text:y("RSS feed URL copied")})),(0,h.lW)(T)},children:(0,r.Y)(s.It,{fill:F?"#F88800":d.Q3.black.hex,size:24})}))]});return k&&A?(0,r.FD)(g.Ye,{alignItems:"center",alignSelf:"stretch",justifyContent:"space-between",children:[B,(0,r.Y)(a.s,{post:_})]}):(0,r.FD)(g.Ye,{alignItems:"center",gap:12,children:[B,A&&(0,r.Y)(a.s,{post:_})]})}},22240:function(e,t,n){n.d(t,{L:()=>o});var i=n(4006),l=n(15894),r=n(76977);let o=e=>{let{children:t}=e;return(0,i.Y)(r.Ye,{children:(0,i.Y)(r.Ye,{className:"container-f0oiU0",paddingBottom:8,children:(0,i.Y)(l.T,{preset:"detail-large",children:t})})})}},70103:function(e,t,n){n.d(t,{Z:()=>l});var i=n(4006);let l=e=>{let{children:t}=e;return(0,i.Y)("div",{className:"container-mcXs8_",children:t})}},73062:function(e,t,n){n.d(t,{i:()=>u});var i=n(4006),l=n(32485),r=n.n(l),o=n(45773),a=n(49436),s=n(63446),d=n(76977);let c="hoverText-TwVQuR",u=e=>{let{isSubscribed:t,onClick:n,className:l,grow:u,minimize:p,subscribedText:h="Notified",unsubscribedText:m="Get Notified",visible:g=!0}=e;return(0,i.Y)(s.v,{className:r()("notifyButton-lmtipU",p?"minimize-yxTwzX":void 0,t&&"subscribed-oEC2qb",l),"data-subscribed":t,flex:u?"grow":void 0,size:"sm",style:{visibility:g?"visible":"hidden"},variant:"outline",onClick:n,onMouseOver:e=>{e.stopPropagation()},children:(0,i.Y)(d.Ye,{alignItems:"center",className:"notifyButtonInternal-e4KibS",gap:8*!p,justifyContent:"space-between",position:"relative",children:t?(0,i.FD)(i.FK,{children:[(0,i.Y)("div",{className:r()(p?c:null),children:h}),(0,i.Y)(o.A,{size:16})]}):(0,i.FD)(i.FK,{children:[(0,i.Y)("div",{className:r()(p?c:null),children:m}),(0,i.Y)(a.A,{size:16})]})})})}},78956:function(e,t,n){n.d(t,{A:()=>d});var i=n(4006),l=n(83673),r=n.n(l),o=n(17402),a=n(16074),s=n(76977);let d=e=>{let{children:t,gap:n=32,includeBottomDivider:l,includeTopDivider:d,paddingTop:c=0}=e,u=o.Children.toArray(t),p=r()(u).flatMap((e,t)=>0!==t||d?[(0,i.Y)(a.c,{flex:"auto"}),e]:[e]);return(0,i.FD)(s.I1,{gap:n,paddingTop:c,children:[p,l&&(0,i.Y)(a.c,{flex:"auto"})]})}},86227:function(e,t,n){n.d(t,{u:()=>a});var i=n(4006),l=n(86673),r=n(68410),o=n(76977);let a=e=>{let{post:t,pub:n,user:a}=e,{isMobile:s}=(0,r.sM)();return(0,i.FD)(o.Ye,{gap:s?16:40,justifyContent:"center",children:[(0,i.Y)(l.qS,{cta:s?"Comment":"Make a comment",post:t,pub:n,showCounts:!1,size:"large"}),(0,i.Y)(l.ct,{cta:s?"Like":"Like article",post:t,pub:n,showCounts:!1,size:"large",user:a}),(0,i.Y)(l.wu,{cta:s?"Share":"Share article",post:t,pub:n,user:a})]})}},36027:function(e,t,n){n.d(t,{E:()=>h});var i=n(4006),l=n(15894),r=n(68410),o=n(28528),a=n(84032),s=n(47173),d=n(76977),c=n(56262),u=n(82776);let p="verticalDivider-JbC7L1",h=e=>{let{post:t}=e,{isMobile:n}=(0,r.sM)(),{pub:h}=(0,o.np)(),m=(0,c.getDurationForPostPreview)({post:t});return(0,i.Y)(l.T,{color:"tertiary",preset:"caption",style:{lineHeight:1},children:(0,i.FD)(d.Ye,{gap:16,children:[(0,i.Y)(a.aR,{customFormat:"MMMM D, YYYY",post:t}),(0,i.Y)("div",{className:p}),(0,i.Y)(s.q,{clamp:1,post:t,pub:h}),!!m&&!n&&(0,i.FD)(i.FK,{children:[(0,i.Y)("div",{className:p}),(0,u.formatPodcastDuration)(m)]})]})})}},64703:function(e,t,n){n.d(t,{k:()=>d});var i=n(4006),l=n(22076),r=n(63446),o=n(15894),a=n(76977),s=n(16291);let d=e=>{let{liveStream:t,trackingSurface:n}=e,d=(0,s.A)(t.scheduled_at).format("dddd MMMM D, YYYY"),c=(0,s.A)(t.scheduled_at).format("h:mm A");return(0,i.FD)(a.I1,{gap:24,children:[(0,i.FD)(a.I1,{gap:8,children:[(0,i.Y)(o.T,{preset:"h5-serif",children:t.title}),(0,i.Y)(o.T,{preset:"d3-serif",children:t.description}),(0,i.Y)(o.T,{preset:"timestamp",children:d}),(0,i.Y)(o.T,{preset:"timestamp",children:c})]}),(0,i.Y)(a.Ye,{children:(0,i.Y)(l.n,{liveStream:t,trackingSurface:n,trigger:(0,i.Y)("div",{children:(0,i.Y)(r.v,{size:"sm",trailingIcon:"plus",variant:"outline",children:"Add to calendar"})})})})]})}},24466:function(e,t,n){n.d(t,{N:()=>D});var i=n(4006),l=n(17402),r=n(33764),o=n(82528),a=n(82180),s=n(73090),d=n(22240),c=n(64703),u=n(16074),p=n(76977);let h=e=>{let{scheduledLiveStreams:t}=e;return(0,i.FD)(p.I1,{gap:40,children:[(0,i.Y)(d.L,{children:"Upcoming livestreams"}),(0,i.Y)(p.I1,{gap:24,children:t.map((e,t)=>(0,i.FD)(i.FK,{children:[0!==t&&(0,i.Y)(u.c,{}),(0,i.Y)(c.k,{liveStream:e,trackingSurface:"section-page"})]}))})]})};var m=n(7903),g=n(98695),v=n(65590),f=n(15894),Y=n(95691),b=n(57753);let _=e=>{var t;let{pub:n,section:l}=e,{metadata:r}=(0,Y.P)({pub:n}),o=null==(t=r[l.id])?void 0:t.youtubeUrl;return o?(0,i.FD)(p.Ye,{alignItems:"center",as:"a",gap:8,href:o,rel:"noopener noreferrer",target:"_blank",children:[(0,i.Y)(f.T,{preset:"d1-sans-medium",children:"Watch on YouTube"}),(0,i.Y)(v.A,{fill:b.Q3.black.hex,size:30})]}):null};var y=n(27428),w=n(79454),k=n(16447),I=n(68410),C=n(46009),S=n(22092);let D=e=>{let t,n,d,{freeSignup:c,freeSignupEmail:v,isPodcast:f,isTagPage:b=!1,newPosts:D,pub:F,scheduledLiveStreams:x,section:P,tag:T,user:A,utm:E}=e,{isMobile:N}=(0,I.sM)(),[B,M]=(0,l.useState)(null!=x?x:null),{ids:R}=(0,y.M)({pub:F}),{ids:O}=(0,Y.P)({pub:F}),L=(0,S.Eu)({pub:F,section:P});if((0,l.useEffect)(()=>{let e=async()=>{M(await (0,w.f7)())};L&&!B&&e()},[L,B]),!P&&!b&&!f)return console.warn("Needs to be a section, tag, or pub-level podcast"),null;let z=!!P&&O.includes(P.id),U=!!P&&R.includes(P.id);if(f){let e=P?(0,C.lL)({pub:F,section:P}):(0,C.j_)({pub:F});t=e.title,n=e.description,d=e.artUrl}else z?(t=null==P?void 0:P.name,n=null==P?void 0:P.description,d=null==P?void 0:P.logo_url):b?(t=(null==T?void 0:T.name)||"Page not found",n=null):(t=null==P?void 0:P.name,n=null==P?void 0:P.description);return(0,i.Y)(o.y,{belowDescription:(0,i.FD)(p.pT,{direction:N?"column":"row",justifyContent:"space-between",children:[f?(0,i.Y)(a.Z,{pub:F,section:P,user:A}):z?(0,i.Y)(_,{pub:F,section:P}):void 0,P&&(f||z)&&(0,i.Y)(m.S,{freeSignup:c,freeSignupEmail:v,isPodcastOrVideo:!0,pub:F,section:P,user:A})]}),bodyWrapperVariant:"two-middle-columns",description:n,image:d?(0,i.Y)(r.o,{className:"sectionImage-AFt6TD",imageIsFixedWidth:!1,maxWidth:540,src:d,useRetinaSizing:!0}):void 0,pageCTA:!P||b||f||z?void 0:(0,i.Y)(m.S,{freeSignup:c,freeSignupEmail:v,isPodcastOrVideo:!1,pub:F,section:P,user:A}),title:t,children:(0,i.FD)(p.I1,{gap:40,children:[B&&B.length>0&&(0,i.FD)(i.FK,{children:[(0,i.Y)(h,{scheduledLiveStreams:B}),(0,i.Y)(u.c,{})]}),(0,i.Y)(k.M,{hideCommunity:!0,hideTop:b,isPodcast:f&&!P,newPosts:D,postTagId:null==T?void 0:T.id,pub:F,renderLoading:()=>null,renderTabs:e=>{let{activeTabId:t,tabs:n,onClick:l}=e;return n.length<=1||f?null:(0,i.Y)(p.I1,{alignItems:"center",className:"tabsContainer-P8p3c9",paddingBottom:N?40:64,children:(0,i.Y)(g.p,{activeTabId:t,tabs:n,onClick:l})})},sectionId:null==P?void 0:P.id,source:b?"tag-archive":void 0,user:A,utm:E,children:e=>{let{posts:t}=e;return(0,i.Y)(s.R,{isEvents:U,posts:t})}})]})})}},7903:function(e,t,n){n.d(t,{S:()=>m});var i=n(4006),l=n(45773),r=n(17402),o=n(63446),a=n(73062),s=n(84605),d=n(12501),c=n(76977),u=n(36372),p=n(39318),h=n(22092);let m=e=>{let{pub:t,section:n,isPodcastOrVideo:m,user:g,grow:v,minimize:f,freeSignup:Y,freeSignupEmail:b}=e,{iString:_}=(0,s.GO)(),{popToast:y}=(0,u.d)(),[w,k]=(0,r.useState)(!1),[I,C]=(0,r.useState)(!1),S=!!g||!!b&&!!Y,{refetch:D}=(0,d.st)({pathname:"/api/v1/subscription/sections/email",auto:!1,method:"PATCH"}),{result:F,refetch:x}=(0,d.st)({pathname:"/api/v1/subscription",auto:!1});(0,r.useEffect)(()=>{(async()=>{let e=(0,p.Dlv)(window.location.href);if((null==e?void 0:e.searchParams.get("subscribe"))==="true"&&S){await D({json:{[n.id]:{setting:"individual"}}});let e=new URL(window.location.href);e.searchParams.delete("subscribe"),window.history.replaceState({},"",e.toString())}S&&await x(),C(!0)})()},[S]),(0,r.useEffect)(()=>{(null==F?void 0:F.email_settings)&&k("individual"===F.email_settings[n.id])},[F,n.id]);let P=async()=>{if(!S){let e=(0,h._Y)(t,{sectionSlug:n.slug,next:(0,p.yRP)(window.location.href,{subscribe:!0})});window.location.href=e;return}let e=!w;await D({json:{[n.id]:{setting:e?"individual":"disabled"}}}).then(()=>{k(e),y(()=>(0,i.Y)(u.y,{Icon:l.A,text:e?"Subscription updated!":"Unsubscribed!"}))})};return(0,i.Y)(c.Ye,{flex:v?"grow":void 0,justifyContent:m?void 0:"end",children:m?(0,i.Y)(a.i,{grow:v,isSubscribed:w,minimize:f,visible:I,onClick:P}):(0,i.Y)(o.v,{style:{visibility:I?"visible":"hidden"},variant:"tertiary",onClick:P,children:w?"".concat(_("Subscribed")," ✓"):"".concat(_("Subscribe")," +")})})}},1918:function(e,t,n){n.d(t,{i:()=>a});var i=n(38970),l=n.n(i),r=n(17402),o=n(13770);let a=e=>{let{pub:t}=e,n=l()(t.authorPagesInfo,"user_id"),{setting:i,save:a}=(0,o.E)({key:"about_us_author_ids",fallback:[]}),[s,d]=(0,r.useState)(i),c=async()=>{await a({setting:s})};return{ids:s,onChange:e=>{let{ids:t}=e;d(t.filter(e=>n[e]))},onSave:c}}},79454:function(e,t,n){n.d(t,{Cr:()=>r,N7:()=>o,f7:()=>s,zG:()=>a});var i=n(15734),l=n.n(i);let r=async e=>{let{extraText:t,extraLink:n}=e;await l().put("/api/v1/publication_settings").send({homepage_message_text:t,homepage_message_link:n})},o=async e=>{let{slug:t}=e;try{var n;return null!=(n=(await l().get("/api/v1/posts/".concat(t))).body)?n:null}catch(e){return null}},a=async e=>{let{pub:t}=e;try{var n;return null!=(n=(await l().get("/api/v1/live_streams/active/pub/".concat(t.id))).body.activeLiveStream)?n:null}catch(e){return null}},s=async()=>{try{var e;return null!=(e=(await l().get("/api/v1/live_streams/scheduled")).body.scheduledLiveStreams)?e:[]}catch(e){return[]}}},29098:function(e,t,n){n.d(t,{A:()=>l});var i=n(17402);function l(){let{root:e=null,threshold:t=0,rootMargin:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("undefined"==typeof window||"undefined"==typeof IntersectionObserver)return[null,null];let[l,r]=(0,i.useState)(null),[o,a]=(0,i.useState)(null),s=(0,i.useRef)(new IntersectionObserver(e=>{let[t]=e;return r(t)},{root:e,threshold:t,rootMargin:n}));return(0,i.useEffect)(()=>{var e;let t=(null==o||null==(e=o.base)?void 0:e.addEventListener)?o.base:(null==o?void 0:o.addEventListener)?o:null,{current:n}=s;return n.disconnect(),t&&n.observe(t),()=>n.disconnect()},[o]),[a,l]}},99145:function(e,t,n){n.d(t,{BR:()=>c,bf:()=>d,v9:()=>s});var i=n(4006),l=n(6411),r=n.n(l),o=n(17402),a=n(21398);function s(){return(0,o.useContext)(d)}let d=(0,o.createContext)({open:()=>void 0});function c(e){let{children:t,load:l,pub:s,enableShortcuts:c=!0}=e,[u,p]=(0,o.useState)(!1),[h,m]=(0,o.useState)(!1),[g,v]=(0,o.useState)(),[f,Y]=(0,o.useState)();(0,o.useEffect)(()=>{if(!l||!s)return;let e=()=>p(!0);if(c)return r().bind(["/","command+k"],e),()=>{r().unbind(["/"],e),r().unbind(["command+k"],e)}},[]);let b=(0,o.useMemo)(()=>({open:e=>{m(!!(null==e?void 0:e.postsOnly)),v(()=>null==e?void 0:e.onSelectResult),Y(()=>null==e?void 0:e.onClose),p(!0)}}),[]);return l&&s?(0,i.FD)(d.Provider,{value:b,children:[t,(0,i.Y)(a.Ic,{module:"@/frontend/substack/search/PublicationSearch",resolve:e=>e.PublicationSearch,isOpen:u,postsOnly:h,pub:s,onClose:()=>{null==f||f(),p(!1)},onRequest:()=>Promise.all([n.e("53307"),n.e("93975"),n.e("33357")]).then(n.bind(n,43288)),onSelectResult:g})]}):(0,i.Y)(i.FK,{children:t})}},82936:function(e,t,n){n.d(t,{Hv:()=>_,_N:()=>b,bd:()=>y,hU:()=>I,uL:()=>k});var i=n(79785),l=n(4006),r=n(63122),o=n(40972),a=n(17402),s=n(84605),d=n(46271),c=n(94729);n(12501);var u=n(68349),p=n(45859),h=n(36372);function m(){let e=(0,i._)([""," muted"]);return m=function(){return e},e}function g(){let e=(0,i._)([""," unmuted"]);return g=function(){return e},e}function v(){let e=(0,i._)([""," blocked"]);return v=function(){return e},e}function f(){let e=(0,i._)([""," unblocked"]);return f=function(){return e},e}let Y=(0,a.createContext)({result:{mutes:[],blocks:[],blocked:[]},refetch:async()=>null,isBlockingUser:()=>!1,isMutedByUser:()=>!1,isBlockedByUser:()=>!1});function b(e){let{isBlockingUser:t,isBlockedByUser:n}=(0,a.useContext)(Y);return e?n(e)?"blocking":t(e)?"blocked":null:null}function _(e){let{isBlockingUser:t,isBlockedByUser:n,isMutedByUser:i}=(0,a.useContext)(Y);return e?i(e)?"muting":n(e)?"blocking":t(e)?"blocked":null:null}function y(e,t){let{surface:n,noteId:i,onClick:b}=t,{iString:y,iTemplate:w}=(0,s.GO)(),k=(0,d.Jd)(),I=!!(k&&e&&k.id!==e.id),C=(0,a.useContext)(Y),S=_(null==e?void 0:e.id),D=(0,h.d)(),F=async()=>{if(e){try{await (0,c.x6)("/api/v1/blocks/".concat(e.id),{method:"POST",json:{type:"mute",surface:n,noteId:i}})}catch(e){D.popToast(()=>(0,l.Y)(h.y,{text:(0,u.uX)(e)}));return}C.refetch(),D.popToast(()=>(0,l.Y)(h.y,{text:w(m(),e.name||"User"),Icon:r.A})),null==b||b("mute")}},x=async()=>{if(e){try{await (0,c.x6)("/api/v1/blocks/".concat(e.id),{method:"DELETE",query:{surface:n,noteId:i}})}catch(e){D.popToast(()=>(0,l.Y)(h.y,{text:(0,u.uX)(e)}));return}C.refetch(),D.popToast(()=>(0,l.Y)(h.y,{text:w(g(),e.name||"User"),Icon:r.A})),null==b||b("unmute")}},P=async()=>{if(e){try{await (0,c.x6)("/api/v1/blocks/".concat(e.id),{method:"POST",json:{type:"block",surface:n,noteId:i}})}catch(e){D.popToast(()=>(0,l.Y)(h.y,{text:(0,u.uX)(e)}));return}C.refetch(),D.popToast(()=>(0,l.Y)(h.y,{text:w(v(),e.name||"User"),Icon:o.A})),null==b||b("block")}},T=async()=>{if(e){try{await (0,c.x6)("/api/v1/blocks/".concat(e.id),{method:"DELETE",query:{surface:n,noteId:i}})}catch(e){D.popToast(()=>(0,l.Y)(h.y,{text:(0,u.uX)(e)}));return}C.refetch(),D.popToast(()=>(0,l.Y)(h.y,{text:w(f(),e.name||"User"),Icon:o.A})),null==b||b("unblock")}},A=[];return I&&("blocking"!==S&&A.push((0,l.Y)(p.Dr,{leading:(0,l.Y)(r.A,{}),priority:"destructive",onClick:"muting"===S?x:F,children:y("muting"===S?"Unmute":"Mute")})),A.push((0,l.Y)(p.Dr,{leading:(0,l.Y)(o.A,{}),priority:"destructive",onClick:"blocking"===S?T:P,children:y("blocking"===S?"Unblock":"Block")}))),A}Y.displayName="UserBlockContext";let w=(0,a.createContext)(!1);function k(e){let{muteFree:t=!0,children:n}=e;return(0,l.Y)(w.Provider,{value:t,children:n})}function I(){return(0,a.useContext)(w)}w.displayName="MuteFreeZone"},58050:function(e,t,n){n.d(t,{A:()=>x,cC:()=>P,km:()=>T,ku:()=>S,tg:()=>F,uy:()=>D});var i=n(69277),l=n(79785),r=n(4006),o=n(91648),a=n.n(o),s=n(74242),d=n(31062),c=n(17402),u=n(25250),p=n(82936),h=n(84605),m=n(46271),g=n(72026),v=n(6547),f=n(94729),Y=n(76528),b=n(68349),_=n(45859),y=n(36372),w=n(46453),k=n(50963);function I(){let e=(0,l._)(["Followed ",""]);return I=function(){return e},e}function C(){let e=(0,l._)(["Unfollowed ",""]);return C=function(){return e},e}function S(e){let t=(0,m.Jd)();return(0,Y.OU)("/api/v1/feed/following",(0,i._)({auto:!!t},e))}function D(){let{mutate:e}=(0,u.iX)();return function(){for(var t=arguments.length,n=Array(t),i=0;i{if(e){if(!l&&o)return void(c?c():o.open());p(function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return i?[...t,e.id]:a()(t,e.id)},{revalidate:!1});try{await (0,f.x6)("/api/v1/feed/".concat(e.id,"/follow"),{method:i?"POST":"DELETE",json:{surface:t,noteId:n}}),v.popToast(()=>(0,r.Y)(y.y,{Icon:i?s.A:d.A,text:i?D(I(),Y):D(C(),Y),cta:_("Undo"),onAccept:()=>x(!i)}))}catch(e){v.popToast(()=>(0,r.Y)(y.y,{text:(0,b.uX)(e)}));return}}};return{isFollowing:u,toggle:()=>x(!u),isLoaded:!!g}}function T(e,t,n){let{isFollowing:i,toggle:l}=P(e,t,n),[r,o]=(0,c.useState)(!1);return{isFollowing:i,buttonProps:{onClick:()=>{l(),i||o(!0)},onMouseLeave:()=>o(!1)}}}},95282:function(e,t,n){n.d(t,{MT:()=>G,YU:()=>z,qN:()=>L});var i=n(69277),l=n(70408),r=n(79785),o=n(4006),a=n(17402),s=n(43262),d=n(27437);n(84777);var c=n(84605),u=n(42686),p=n(89607),h=n(27749),m=n(51498),g=n(22434),v=n(27332),f=n(40740),Y=n(6950),b=n(75840),_=n(25859),y=n(4560),w=n(58292),k=n(60897),I=n(86500),C=n(56804),S=n(12501),D=n(68349),F=n(76977),x=n(63136),P=n(504),T=n(5180),A=n(83629),E=n(56262),N=n(83873),B=n(28700),M=n(49807),R=n(44307);function O(){let e=(0,r._)(["This comment is only visible to paid subscribers of ",""]);return O=function(){return e},e}function L(e){var t,n,r,s,d,p;let{comment:_,item:k,isParent:x,showReplyingTo:N,showContext:B,utm_content:R,parentCommentUserId:O,hideable:L=!1}=e,U=(0,h.PK)(),H=(0,b.T)(),G=(0,T.l$)(k),{language:W}=(0,c.GO)(),[K,V]=(0,a.useState)(!1),[j,X]=(0,a.useState)(()=>_.autotranslate_to===W),[J,Z]=(0,a.useState)(()=>_.autotranslate_to===W?_:void 0),Q=J?(0,l._)((0,i._)({},_),{translation:J.translation,attachments:J.attachments}):_,$=()=>(0,P.Qb)(k,U,"profile",{tabId:H,extraEventProps:{is_translated:j}}),ee=!Q.ancestor_path,et=null==(t=k.context.users[0])?void 0:t.id,en=k.publication&&k.post&&(0,E.getPostAuthor)(k.publication,k.post,{preferredUserId:et}),ei=(0,S.st)({pathname:"/api/v1/trending-topics/toggle",method:"POST"}),el=null;if(!ee){let e=null==(n=Q.ancestor_path)?void 0:n.split(".").pop(),t=e&&Number(e);el=null!=(s=null==(r=k.parentComments)?void 0:r.find(e=>(null==e?void 0:e.id)===t))?s:null}let er=!!(N&&(ee&&en||!ee&&el)),eo=async()=>{var e,t,n,i,l;(0,P.Qb)(k,U,"context",{tabId:H,extraEventProps:{is_translated:j}}),(0,I.u4)(I.qY.SEE_MORE_NOTES_IN_CATEGORY_CLICKED,{tagId:null==(e=k.context.tag)?void 0:e.id,noteId:null==(t=k.comment)?void 0:t.id}),await ei.refetch({method:"POST",json:{enable:!0,categoryID:null==(i=k.context)||null==(n=i.tag)?void 0:n.id}}),(0,D.V2)("/home/category/".concat(null==(l=k.context.tag)?void 0:l.id),{local_navigation:!1})},ea=(0,E.getCommentAuthor)(Q),es=(0,a.useRef)(Q.reaction),[ed,ec]=(0,a.useState)(!1);(0,a.useEffect)(()=>{!es.current&&Q.reaction&&k.canShowFollowUpsell&&ec(!0),es.current&&!Q.reaction&&ec(!1),es.current=Q.reaction},[Q.reaction,k.canShowFollowUpsell]);let eu=!x&&["comment_like","comment_restack","note_like","generic"].includes(k.context.type);return(0,o.Y)(w.CF,{showGutter:x,hasContext:B,onClick:e=>{if(!e.defaultPrevented&&!G){(0,P.Qb)(k,U,"item",{tabId:H,extraEventProps:{is_translated:j}});let t="search"===U&&"undefined"!=typeof location?location.pathname:null,n=(0,M.Zgx)(Q,{noBase:!Q.hidden&&A.Z,urlParams:{utmSource:t}});(0,C.o)(e,Q.hidden&&k.publication?(0,M.eV6)(k.publication,{addBase:!0,params:{next:n}}):n,{newTab:!!Q.hidden,native:Q.hidden,state:{showBack:!0}})}},entityKey:k.entity_key,children:(0,o.FD)(f.k,{user:ea,item:k,comment:Q,children:[B||eu?(0,o.Y)(g.x,{context:k.context,onClick:()=>(0,P.Qb)(k,U,"context",{tabId:H,extraEventProps:{is_translated:j}}),utm_content:R}):null,k.context.tag?(0,o.Y)(g.x,{context:(0,l._)((0,i._)({},k.context),{type:"topic"}),onClick:eo,utm_content:R}):null,K?(0,o.Y)(m.B,{item:k,author:ea,comment:Q,onCancel:()=>V(!1)}):(0,o.FD)(F.Ye,{gap:12,alignItems:"start",children:[(0,o.Y)(w.NT,{user:ea,onClick:$,utm_content:R}),(0,o.FD)(F.I1,{gap:8,flex:"grow",minWidth:0,children:[(0,o.FD)(F.I1,{gap:12,children:[(0,o.FD)(F.I1,{gap:4,children:[(0,o.Y)(v.LY,{author:ea,post:null!=(d=k.post)?d:void 0,comment:Q,onClick:$,utm_content:R,publication:null!=(p=k.publication)?p:void 0,item:k,allowHide:L,parentCommentUserId:O,onDismiss:()=>V(!0),isShowingTranslation:j,onToggleTranslation:e=>{e?(Z(e),X(!0)):X(!1)}}),er&&(0,o.Y)(q,{isTopLevel:ee,postAuthor:null!=en?en:null,parentComment:el,item:k}),Q.body&&(0,o.Y)(z,{comment:Q,item:k,isShowingTranslation:j})]}),Q.attachments&&(0,o.Y)(u.ti,{parent:Q,attachments:Q.attachments,onAttachmentClick:function(){let{commentId:e,attachmentType:t,attachmentId:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,P.Qb)(k,U,"attachment",{tabId:H,extraEventProps:{commentId:e,clicked_attachment_type:t,clicked_attachment_id:n,is_translated:j}})},onSavePostClick:e=>{(0,P.Qb)(k,U,e,{tabId:H,extraEventProps:{is_translated:j}})},utm_content:R,item:k,isShowingTranslation:j})]}),!Q.hidden&&(0,o.Y)(y.M,{item:k,comment:Q}),ed&&(0,o.Y)(Y.Z,{author:ea,noteId:k.entity_key,onDismiss:()=>ec(!1)})]})]})]})})}function z(e){let{comment:t,item:n,large:i,paddingRight:l,isShowingTranslation:r}=e,d=(0,h.PK)(),c=(0,b.T)(),{bodyJson:u,truncatedBodyJson:m,isTruncated:g,shouldExpandInline:v}=(0,k.A)(t,{isShowingTranslation:r}),[f,Y]=(0,a.useState)(!1),_=i||!g||f,y=_?u:m;return t.age_verification&&t.age_verification.status!==N.Y.CompletedAdult?(0,o.Y)(F.VP,{paddingTop:8,children:(0,o.Y)(s.T,{content:t,description:t.body,source:"feed"})}):(0,o.FD)(F.I1,{className:R.A.feedCommentBody,paddingRight:l,children:[(0,o.Y)(w.Wz,{children:t.hidden&&n?(0,o.Y)(U,{pub:null==n?void 0:n.publication}):y&&(0,o.Y)(p.w,{content:y,onLinkClicked:()=>{n&&(0,P.Qb)(n,d,"link",{tabId:c,extraEventProps:{commentId:t.id,is_translated:r}})},attachedLinks:G(t)},_)}),!_&&(0,o.Y)(H,{onClick:e=>{n&&(0,P.Qb)(n,d,"see_more",{tabId:c,extraEventProps:{commentId:t.id,is_translated:r}}),v?(e.preventDefault(),Y(!0)):(0,D.V2)((0,M.Zgx)(t,{noBase:A.Z,urlParams:{utmSource:"search"===d&&"undefined"!=typeof location?location.pathname:null}}),{event:e,state:{showBack:!0}})}})]})}function U(e){let{pub:t}=e,{iString:n,iTemplate:i}=(0,c.GO)(),l=(null==t?void 0:t.name)||"";return(0,o.FD)(o.FK,{children:[(0,o.Y)("i",{children:i(O(),l)}),(0,o.Y)("br",{}),(0,o.Y)("b",{children:n("Subscribe to view →")})]})}function H(e){let{iString:t}=(0,c.GO)();return(0,o.FD)(F.pT,{className:R.A.seeMore,children:[(0,o.Y)(F.pT,{className:R.A.seeMoreFade}),(0,o.Y)(x.EY.B3,{color:"secondary",weight:"medium",className:R.A.seeMoreText,children:(0,o.Y)(_.Yq,(0,l._)((0,i._)({},e),{children:t("See more")}))})]})}function q(e){var t;let{isTopLevel:n,postAuthor:i,parentComment:l,item:r}=e,a=n?i:l?{id:l.user_id,user_id:l.user_id,name:l.name,photo_url:l.photo_url,handle:l.handle}:i,s=n?(0,M.q$n)(r.publication,r.post,{noBase:A.Z}):(0,M.Zgx)(l,{noBase:A.Z}),c=(null==(t=n?i:l)?void 0:t.name)||"";return a?(0,o.FD)(x.EY.B5,{color:"secondary",translated:!0,children:["Replying to"," ",(0,o.Y)(d.ProfileHoverCard,{subject:a,utmSource:"feed",trigger:(0,o.Y)(_.Yq,{href:s,children:I18N.p(c)})})]}):null}function G(e){return e.attachments?e.attachments.map(e=>"link"===e.type?e.linkMetadata.url:"post"===e.type?(0,M.wu9)(e.publication,e.post):"publication"===e.type?(0,M.$_T)(e.publication):"comment"===e.type?(0,M.Zgx)(e.comment):"user"===e.type?(0,B.gY)(e.user):"").filter(Boolean):[]}},44451:function(e,t,n){n.d(t,{GJ:()=>Q,XZ:()=>_.XZ});var i=n(69277),l=n(70408),r=n(4006),o=n(32485),a=n.n(o),s=n(3213),d=n(17402),c=n(84605),u=n(46271),p=n(95282),h=n(27749),m=n(51498),g=n(2675),v=n(42652),f=n(2192),Y=n(53906),b=n(25979),_=n(20482),y=n(60346),w=n(40144),k=n(22434),I=n(27332),C=n(40740),S=n(48214),D=n(75840),F=n(25859),x=n(99289),P=n(58292),T=n(94328),A=n(58418),E=n(56804),N=n(82772),B=n(17028),M=n(44552),R=n(75303),O=n(95187),L=n(504),z=n(5180),U=n(60281),H=n(83629),q=n(91563),G=n(2548),W=n(11510),K=n(20437),V=n(56262),j=n(75914),X=n(70189),J=n(49807),Z=n(44307);let Q=(0,d.memo)(function(e){let{item:t,className:n,showLoginPrompt:i}=e,l=$[t.type];return l?(0,r.Y)(l,{item:t,className:n,children:i&&(0,r.Y)(y.H,{version:"login"})}):null}),$={post:function(e){let{item:t,className:n,children:i}=e,l=(0,h.PK)(),o=(0,d.useContext)(D.P),{iString:a}=(0,c.GO)();return(0,r.FD)(_.B_,{item:t,className:n,ariaLabel:a("Post"),children:[i,(0,r.Y)(ee,{item:t,context:(0,r.Y)(k.x,{context:t.context,onClick:()=>(0,L.Qb)(t,l,"context",{tabId:o}),utm_content:t.entity_key}),hideable:!0})]})},comment:function(e){var t,n;let{item:i,className:l,children:o}=e,{iString:a,language:s}=(0,c.GO)(),{publication:u,post:m,comment:g,parentComments:v}=i,f=u||m||!v||1===v.length?void 0:v[0],Y=null!=(n=v&&v[v.length-1])?n:null,b=u&&m&&(0,V.getPostAuthor)(u,m),y=(0,h.PK)(),w="comment_restack"!==i.context.type&&"comment_like"!==i.context.type&&"post-discussion"!==y,k=(0,d.useContext)(D.P),I="comment_restack"===i.context.type||"comment_like"===i.context.type?"user/".concat(null==(t=i.context.users[0])?void 0:t.id):i.entity_key;return(0,r.Y)(_.B_,{item:i,className:l,ariaLabel:a("Note"),isTranslated:g.autotranslate_to===s,children:(0,r.FD)(r.FK,{children:[o,(0,r.FD)(et,{children:[w&&(0,r.Y)(en,{author:b,rootFeedComment:f,parentComments:v,parentComment:Y,item:i,utm_content:I,feedSurface:y,tabId:k}),(0,r.Y)(p.qN,{comment:g,item:i,showReplyingTo:!w,utm_content:I,hideable:!0})]})]})})},userSuggestions:function(e){let{item:t}=e,n=(0,W.Iu)(),{iString:o}=(0,c.GO)(),a=(0,d.useRef)(null),s=(0,M.h9)(a),{state:p,handleArrowClick:h}=(0,G.jA)(a,{scrollFullPage:!0}),m=(0,u.ur)(),g=(0,X.st)();return(0,N.S8)(a,()=>{m.changeSetting("suggestions_feed_item_last_shown_at",new Date().toISOString())},{threshold:.2}),(0,r.Y)(_.B_,{item:t,children:(0,r.FD)(B.I1,{paddingTop:16,children:[(0,r.FD)(B.pT,{alignItems:"center",justifyContent:"space-between",paddingLeft:{mobile:16,desktop:0},children:[(0,r.Y)(B.EY.H4,{children:(0,r.Y)(F.Yq,{onClick:e=>(0,E.o)(e,g),children:o("Suggestions")})}),(0,r.Y)(B.$n,{size:"sm",priority:"tertiary",onClick:e=>(0,E.o)(e,g),children:o("See all")})]}),(0,r.FD)(B.pT,{className:Z.A.peopleYouMayKnowContainer,alignItems:"center",flex:"grow",position:"relative",children:[(0,r.Y)(B.pT,{flex:"grow",overflow:"hidden",children:(0,r.FD)(B.pT,(0,l._)((0,i._)({},s.props),{ref:a,className:Z.A.peopleYouMayKnow,alignItems:"center",gap:8,paddingX:{desktop:0,mobile:16},paddingBottom:16,paddingTop:12,children:[!1,t.userSuggestions.map(e=>(0,r.Y)(U.pp,{feedUserSuggestion:e,surface:"feed"},e.user.id))]}))}),!n&&(0,r.FD)(r.FK,{children:[(0,r.Y)(O.p_,{direction:"left",isVisible:p.showLeft,onClick:h(-1)}),(0,r.Y)(O.p_,{direction:"right",isVisible:p.showRight,onClick:h(1)})]})]})]})})},facebookConnect:function(e){let{item:t}=e;return(0,r.Y)(_.B_,{item:t,children:(0,r.Y)(B.pT,{paddingY:20,children:(0,r.Y)(U.h8,{})})})},inviteFriends:function(e){let{item:t}=e,[n]=(0,A.A)(U.Ft);return n?null:(0,r.Y)(_.B_,{item:t,children:(0,r.Y)(B.pT,{paddingY:20,paddingX:20,children:(0,r.Y)(U.pS,{utmSource:"feed_item"})})})},chat:function(e){let{item:t}=e,{iString:n}=(0,c.GO)();return t.community_post.user&&(0,r.Y)(_.B_,{item:t,ariaLabel:n("Chat"),children:(0,r.Y)(v.H,{item:t,author:t.community_post.user})})},profileSearchResults:function(e){let{item:t}=e;return(0,r.Y)(_.B_,{item:t,children:(0,r.Y)(f.T,{item:t})})},categoryLeaderboard:b.b,trendingTopicsExplore:function(e){let{item:t}=e;return(0,r.Y)(_.B_,{item:t,children:(0,r.Y)(Y.q,{item:t})})},videoSuggestionsExplore:w.b,stockPrice:S.B};function ee(e){var t,n,i;let{item:l,showGutter:o,context:a,hideable:s=!1}=e,{publication:c,post:u}=l,p=null==(t=l.context.users[0])?void 0:t.id,v=c&&u?(0,V.getPostAuthor)(c,u,{preferredUserId:p}):void 0,f=(0,h.PK)(),Y=(0,d.useContext)(D.P),b=(0,z.l$)(l),[_,y]=(0,d.useState)(!1),w=()=>(0,L.Qb)(l,f,"profile",{tabId:Y}),k="post"===l.type&&l.mediaClip?l.mediaClip.clip_info:null;return c&&u&&v?(0,r.Y)(P.CF,{onClick:e=>{e.defaultPrevented||b||((0,L.Qb)(l,f,"item",{tabId:Y}),(0,E.o)(e,(0,J.q$n)(c,u,{noBase:H.Z,mediaClip:"post"===l.type&&l.mediaClip||void 0})))},showGutter:o,hasContext:!!a,entityKey:l.entity_key,children:(0,r.FD)(C.k,{user:v,item:l,children:[a,_?(0,r.Y)(m.B,{item:l,author:v,post:u,onCancel:()=>y(!1)}):(0,r.FD)(B.pT,{gap:12,alignItems:"start",children:[(0,r.Y)(P.NT,{user:v,onClick:w,utm_content:l.entity_key}),(0,r.FD)(B.I1,{gap:8,flex:"grow",minWidth:0,children:[(0,r.FD)(B.I1,{gap:12,children:[(0,r.Y)(I.LY,{author:v,post:u,onClick:w,utm_content:l.entity_key,publication:c,item:l,allowHide:s,onDismiss:()=>y(!0)}),u&&(null==(i=u.liveStream)||null==(n=i.liveStream)?void 0:n.status)&&["scheduled","pending","active"].includes(u.liveStream.liveStream.status)?(0,r.Y)(q.S,{liveStream:u.liveStream,post:u,feedItem:l}):(0,j.tL)(l)&&u.videoUpload?(0,r.Y)(K.R8,{tag:(0,r.Y)(T.b_,{item:l,pub:c,post:u}),composing:!1,mediaUpload:u.videoUpload,videoPlayerProps:(0,g.g2)({post:u,item:l,clipInfo:k})}):(0,r.Y)(g.Sp,{item:l,publication:c,post:u,onClick:()=>(0,L.Qb)(l,f,"attachment",{tabId:Y}),clipInfo:k})]}),(0,r.Y)(x.j,{item:l,pub:c,post:u})]})]})]})}):null}let et=(0,R.I4)({gap:8},R.VP);function en(e){var t,n;let{author:i,rootFeedComment:l,parentComments:o,parentComment:a,item:s,utm_content:d,feedSurface:c,tabId:u}=e,h="note_reply"===s.context.type&&s.comment.user_id!==(null!=(n=null==i?void 0:i.id)?n:null==o||null==(t=o[0])?void 0:t.user_id);return(0,r.FD)(r.FK,{children:[i?(0,r.FD)(r.FK,{children:[(0,r.Y)(ee,{item:s,showGutter:!0,context:h?(0,r.Y)(k.x,{context:s.context,onClick:()=>(0,L.Qb)(s,c,"context",{tabId:u}),utm_content:d}):void 0}),o&&o.length>1&&a&&(0,r.Y)(ei,{url:(0,J.Zgx)(a,{noBase:H.Z}),showGutter:!0})]}):l?(0,r.FD)(r.FK,{children:[(0,r.Y)(p.qN,{isParent:!0,comment:l,item:s,showContext:h,utm_content:d}),o&&o.length>2&&a&&(0,r.Y)(ei,{url:(0,J.Zgx)(a,{noBase:H.Z}),showGutter:!0})]}):null,a&&o&&o.length>0&&(0,r.Y)(p.qN,{showReplyingTo:o.length>2,isParent:!0,comment:a,item:s,showContext:h&&!(i||l),utm_content:d})]})}function ei(e){let{url:t,showGutter:n}=e,{iString:i}=(0,c.GO)();return(0,r.Y)(P.CF,{onClick:e=>(0,E.o)(e,t),showGutter:n,hasAvatar:!1,children:(0,r.FD)(B.Ye,{children:[(0,r.FD)(B.I1,{alignItems:"center",justifyContent:"center",className:Z.A.seeMoreThread,children:[(0,r.Y)(B.I1,{className:a()(Z.A.seeMoreThreadSegment,Z.A.top)}),(0,r.Y)(s.A,{size:16,stroke:"var(--color-utility-detail)"}),(0,r.Y)(B.I1,{className:Z.A.seeMoreThreadSegment,flex:"grow"})]}),(0,r.Y)(B.I1,{className:Z.A.seeMoreReplies,flex:"grow",minWidth:0,children:(0,r.Y)(B.EY.B4,{color:"highlight",children:(0,r.Y)(F.Yq,{href:t,children:i("See more replies")})})})]})})}},92538:function(e,t,n){n.d(t,{n:()=>l});var i=n(84605);let l=()=>{let{iString:e}=(0,i.GO)();return[["1d",e("For 1 day")],["30d",e("For 30 days")],["90d",e("For 90 days")],["1y",e("For 1 year")],["1000y",e("Forever")]]}},5646:function(e,t,n){n.d(t,{T:()=>l});var i=n(84605);let l=()=>{let{iString:e}=(0,i.GO)();return[["visible",e("Do not delete comments")],["delete_this_comment",e("Delete this comment")],["delete_all_comments",e("Also delete all comments")]]}},60030:function(e,t,n){n.d(t,{P:()=>s});var i=n(17402),l=n(53989),r=n(85478),o=n(46271),a=n(41086);function s(){let{getConfigFor:e}=(0,r.mJ)(),{getSettingFor:t}=(0,l.Pu)(),{user:n}=(0,o.ur)(),[s,d]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{"1"===(0,a.y)("preview_custom_theme")&&d(!0)},[]),!!e("enable_custom_theme")&&(!!t("use_custom_theme")||!!((null==n?void 0:n.is_admin)||(null==n?void 0:n.is_editor))&&s)}},40075:function(e,t,n){n.d(t,{Y:()=>r});var i=n(17402),l=n(94729);let r=e=>{let{pub:t,user:n,preloadedActiveLiveStream:r,disabled:o}=e,[a,s]=(0,i.useState)(null!=r?r:null);return(0,i.useEffect)(()=>{n||o||(0,l.x6)("/api/v1/live_streams/active/pub/".concat(t.id)).then(e=>{let{activeLiveStream:t}=e;return s(t)})},[t,n,o]),{activeLiveStream:a}}},26289:function(e,t,n){n.d(t,{By:()=>r,sY:()=>o,yr:()=>l});var i=n(17402);let l=e=>{var t,n;let l=null==e||null==(t=e.current)?void 0:t.player,[r,o]=(0,i.useState)("number"==typeof(null==l?void 0:l.currentTime)?l.currentTime:0),[a,s]=(0,i.useState)(!!l&&!l.paused);return(0,i.useEffect)(()=>{var t;let n=null==(t=e.current)?void 0:t.player;if(n){let e=e=>{"number"==typeof e.target.currentTime&&o(e.target.currentTime)},t=()=>s(!0),i=()=>s(!1),l=()=>s(!1);return n.addEventListener("timeupdate",e),n.addEventListener("play",t),n.addEventListener("pause",i),n.addEventListener("ended",l),n.paused||a||s(!0),()=>{n.removeEventListener("timeupdate",e),n.removeEventListener("play",t),n.removeEventListener("pause",i),n.removeEventListener("ended",l)}}},[null==e||null==(n=e.current)?void 0:n.player]),{currentTime:r,isPlaying:a}},r=e=>o(e.current),o=e=>{let t=null==e?void 0:e.player,[n,l]=(0,i.useState)(!!t&&!t.paused);return(0,i.useEffect)(()=>{let t=null==e?void 0:e.player;if(t){let e=()=>l(!0),i=()=>l(!1),r=()=>l(!1);return t.addEventListener("play",e),t.addEventListener("pause",i),t.addEventListener("ended",r),t.paused||n||l(!0),()=>{t.removeEventListener("play",e),t.removeEventListener("pause",i),t.removeEventListener("ended",r)}}},[null==e?void 0:e.player]),n}},60285:function(e,t,n){n.d(t,{k:()=>s});var i=n(76703),l=n.n(i),r=n(17402),o=n(39318),a=n(41086);let s=e=>{let{alwaysPersistQuery:t,initialValue:n,key:i,type:s,isArray:d,disable:c}=e,u=(0,a.y)(i),p=n;u&&!c&&(p=d?u.split(",").map(e=>"number"===s?parseInt(e):e):"number"===s?parseInt(u):u);let[h,m]=(0,r.useState)(p),g=h&&(h!==n||t)?l()(h).join(","):"";return(0,r.useEffect)(()=>{if(!c)if(g)window.history.replaceState({},"",(0,o.oRR)({[i]:g}));else{let e=new URL(document.location.href);e.searchParams.delete(i),window.history.replaceState({},"",e.toString())}},[c,i,g]),[h,m]}},53594:function(e,t,n){function i(e,t){return e&&"rgba(".concat(e.join(","),",").concat(t,")")}n.d(t,{Vu:()=>r,hO:()=>o,iL:()=>i,p4:()=>l});let l=e=>{var t,n;let{palette:l,colorKey:r="DarkMuted",defaultColor:o="var(--color-dark-bg-secondary)",bgColor:a="var(--color-dark-bg-secondary)"}=e;if(!l&&!o)return null;let s=null!=(n=i(null==l||null==(t=l[r])?void 0:t.rgb,.75))?n:o;return{background:"linear-gradient(180deg, ".concat(s,", ").concat(s,"), ").concat(a)}},r=e=>{var t,n,l,r,o,a;let{palette:s,defaultColor:d="var(--color-dark-bg-primary)",bgColor:c="var(--color-dark-bg-primary)"}=e;if(!s&&!d)return null;let u=null!=(r=i(null==s||null==(t=s.Muted)?void 0:t.rgb,.75))?r:d,p=null!=(o=i(null==s||null==(n=s.DarkMuted)?void 0:n.rgb,.75))?o:d,h=null!=(a=i(null==s||null==(l=s.DarkVibrant)?void 0:l.rgb,.75))?a:d;return{background:"linear-gradient(135deg, ".concat(u,", ").concat(p,", ").concat(h,"), ").concat(c),backgroundSize:"400% 400%"}};function o(e){let t,n;if(!e)return!1;let i=(t=e.replace(/^#/,""),(n=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t))?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16)}:null);return!!i&&function(e,t,n){let i=Math.max(e/=255,t/=255,n/=255),l=Math.min(e,t,n),r=(i+l)/2;if(i===l)return{h:0,s:0,l:r};let o=i-l;return{h:i===e?((t-n)/o+6*(t.5?o/(2-i-l):o/(i+l),l:r}}(i.r,i.g,i.b).l<.3}},48531:function(e,t,n){n.d(t,{C:()=>s,N:()=>d});var i=n(4006),l=n(17402),r=n(68349),o=n(36372),a=n(56007);function s(){let{toastText:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,o.d)(),{justCopied:n,markCopied:a}=d();return{copy:(0,l.useCallback)(n=>{n&&((0,r.lW)(n),e&&t.popToast(()=>(0,i.Y)(o.y,{text:e})),a())},[e,t,a]),justCopied:n}}function d(){let[e,t]=(0,l.useState)(!1),n=(0,l.useRef)(null);return(0,l.useEffect)(()=>()=>{n.current&&clearTimeout(n.current)},[]),{justCopied:e,markCopied:(0,l.useCallback)(()=>{t(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>t(!1),a.bn)},[])}}},90250:function(e,t,n){n.d(t,{At:()=>l,eb:()=>o,fE:()=>r,ng:()=>i}),n(47307);let i=e=>{let{finishedSelection:t,transcriptionRows:n}=e,i=n[t.begin.rowIndex],l=n[t.finish.rowIndex],r=i.words[t.begin.wordIndex],o=l.words[t.finish.wordIndex];return{start:r.start,end:o.end}},l=e=>{let{startRow:t,endRow:n,startOffset:i,endOffset:l,startNodeText:r,endNodeText:o}=e,a=0!==i&&" "!==r[i-1]&&" "!==r[i],s=r.slice(0,i).trim(),d=0===s.length?0:s.split(/\s+/).length-!!a,c=t.words[d],u=o.slice(0,l).trim().split(/\s+/).length,p=n.words[u-1];return{start:c.start,end:p.end}},r=e=>{let{selectStart:t,selectEnd:n,alignedRows:i}=e,l=e=>{var t;let{rowIndex:n,offset:l,text:r}=e,o=i[n];o||console.error("Row at index",n,"does not exist");let a=r.slice(0,l).trim().split(/\s+/).length;(a<1||a>o.words.length)&&console.error("Calculated number of words",a,"is out of bounds");let s=o.words[a-1];return"number"!=typeof s.originalIndex&&console.error("Word's original index is not a number",s.originalIndex),null!=(t=null==s?void 0:s.originalIndex)?t:0};return[l(t),l(n)]},o=e=>{let{virtualizedListRef:t,start:n,end:i,duration:l}=e,r=performance.now(),o=e=>{let a,s=e-r,d=(a=Math.min(s/l,1))<.5?2*a*a:-1+(4-2*a)*a;t.current&&(t.current.scrollTo(n+(i-n)*d),sF});var i=n(99851),l=n(4006),r=n(17402),o=n(15734),a=n.n(o),s=n(9266),d=n(6212),c=n(58398),u=n(58997),p=n(36233),h=n(56778),m=n(85478),g=n(86500),v=n(13022),f=n(68349),Y=n(24782),b=n(76977),_=n(47639),y=n(27747);let w=e=>{var t;let{post:n,pub:i,user:o,freeSignup:a}=e,s=n.section_id&&i.sections&&null!=(t=i.sections.find(e=>e.id===n.section_id))?t:null,c=(0,r.useRef)(null);return(0,l.FD)(b.I1,{className:"post",paddingY:32,children:[(0,l.Y)(d.I0,{allowEdit:!0,hideAudience:"page"===n.type,hideDate:"page"===n.type,isOnPostPage:!0,post:n,pub:i,showCommentRestack:!i.hide_post_restacks,showLabel:!0,showPhoto:!0,showShare:!0,showSubtitle:!0,user:o}),n.videoUpload&&(0,l.Y)(_.U,{contentType:"post",disableAutoPlay:!0,entityKey:String(n.id),entityType:"post",isFreeSubscribed:!!((null==o?void 0:o.is_free_subscribed)||a),isSubscribed:!!(null==o?void 0:o.is_subscribed),mediaUpload:n.videoUpload,post:n,pub:i,surface:"publication",variant:"inbox",videoPlayerRef:c,videoType:"post"}),n.podcastUpload&&!n.videoUpload&&(0,l.Y)(y.KQ,{isFreeSubscribed:!!((null==o?void 0:o.is_free_subscribed)||a),isSubscribed:!!(null==o?void 0:o.is_subscribed),post:n,pub:i,section:s,trackingProps:{surface:"media_feed",entityKey:n.id,entityType:"post",contentType:"post"},variant:"notes-full"})]})};var k=n(56262),I=n(39318),C=n(41086),S=n(9036),D=n(57324);class F extends r.Component{async componentDidMount(){this.triggerShareOnLoad(),await this.loadMore()}getBatchSize(){return 5}async loadMore(){!this.state.hasMore||await (0,f.vL)(this,"loading",async e=>{let{hasMore:t,posts:n}=e;if(t){n=n||[];try{let e=(await a().get("/api/v1/posts").query({limit:this.getBatchSize(),offset:n.length})).body;n=n.concat(e),t=e.length>=this.getBatchSize(),this.makeSureIosCookiesArentBroken(e),this.setState({posts:n,hasMore:t})}catch(e){console.error(e)}return t}})&&this.loader&&this.loader.checkVisibility()}triggerShareOnLoad(){"share"===(0,C.y)("action")&&(window.history.replaceState({},document.title,(0,I.oRR)({action:null})),this.setState({share_on_load:!0,shareModalOpen:!0}))}makeSureIosCookiesArentBroken(e){if(!/iPad|iPhone|iPod/.test(navigator.userAgent)||this.props.user&&this.props.user.is_subscribed||!e||0===e.filter(e=>(0,k.isPaidAudience)(e.audience)&&!e.hidden).length)return;let t="__cookie_checked",n=(0,S.m)(window.location.search);n[t]||(n[t]="true",window.location.search="?".concat((0,I.BpC)(n)))}onChange(e){let{post:t}=e||{};if(t){var n;let e=(this.state.posts||[]).map(e=>e.id).indexOf(t&&t.id);-1!==e&&(null==(n=this.state.posts)?void 0:n[e])&&(this.state.posts[e]=t,this.setState({posts:this.state.posts}))}}render(){var e;let{user:t,pub:n,freeSignup:i,freeSignupEmail:r,preloadedPosts:o,hide_intro_popup:a,children:d,blurbs:u,launchWelcomePage:p,skipIntroPopupRender:m,activeLiveStream:g}=this.props,{posts:v,hasMore:f,share_on_load:b}=null!=(e=this.state)?e:{},_=[];for(let e of v||o||[]){let t=_[_.length-1];e.hidden?Array.isArray(t)?t.push(e):_.push([e]):_.push(e)}return(0,l.FD)("div",{className:"classic-home-page",children:[!!(null==g?void 0:g.liveStream.id)&&(0,l.Y)(Y.A,{activeLiveStream:g}),(0,l.Y)(c.Z,{isOpen:!!this.state.shareModalOpen,onClose:()=>this.setState({shareModalOpen:!1}),user:t,pub:n,medium:"web"}),m?null:(0,l.Y)(s.Ay,{freeSignup:i,freeSignupEmail:r,user:t,post:null,publication:n,hidden:a||b,blurbs:u,launchWelcomePage:p}),(0,l.FD)("div",{className:"post-list",children:[0===_.length&&!f&&(0,l.Y)("div",{className:"container-border coming-soon",children:(0,l.Y)("div",{className:"container",children:(0,l.Y)("p",{children:"Coming soon"})})}),_.map((e,t)=>Array.isArray(e)?this.renderHiddenPosts(e,t):this.renderPost(e)),f?(0,l.Y)("div",{className:"post-loader",children:(0,l.Y)("div",{className:"container",children:(0,l.Y)(h.A,{ref:this.assignLoader,noDedupe:!0,threshold:1280,onVisible:()=>this.loadMore(),children:(0,l.Y)("p",{children:"Loading more posts…"})})})}):n.has_posts&&v&&v.length>0&&(0,l.Y)("div",{className:"container",children:(0,l.Y)("a",{className:"archive-link button invis",href:(0,I.Xt9)(n),children:"View archive"})})]}),d]})}renderPost(e){return(0,l.Y)("div",{className:"container-border post-list-post",children:(0,l.Y)("div",{className:"container",children:"thread"===e.type?(0,l.Y)(u.X,{post:e,user:this.props.user,pub:this.props.pub,freeSignup:this.props.freeSignup,freeSignupEmail:this.props.freeSignupEmail,invisible:!this.props.hide_intro_popup,showCta:!0,showReactions:!!this.likesEnabled}):"podcast"===e.type||"video"===e.type?(0,l.Y)(w,{post:e,pub:this.props.pub,user:this.props.user,freeSignup:this.props.freeSignup}):(0,l.Y)(d.L4,{post:e,user:this.props.user,freeSignup:this.props.freeSignup,freeSignupEmail:this.props.freeSignupEmail,pub:this.props.pub,invisible:!this.props.hide_intro_popup,truncateAt:1e4,truncateTo:8e3,onChange:e=>this.onChange(e),noTitleLink:!!this.props.disableInteractive,disableSubscribePrompt:!0})})})}renderHiddenPosts(e,t){let n,i;return 0===t?(n=e.slice(0,1),i=e.slice(1)):e.length<=3?(n=e,i=[]):(n=e.slice(0,2),i=e.slice(2)),(0,l.Y)(x,{user:this.props.user,pub:this.props.pub,posts:n,collapsedPosts:i,onChange:e=>this.onChange(e)})}constructor(e,t){super(e,t),(0,i._)(this,"loader",void 0),(0,i._)(this,"assignLoader",e=>{this.loader=e}),(0,i._)(this,"likesEnabled",(0,v.Ay)("like_posts_enabled")),this.state={posts:null,hasMore:!0,loading:!1,shareModalOpen:!1},this.props.notify_user&&"undefined"!=typeof window&&(0,p.Ay)(this.props.notify_user)}}(0,i._)(F,"contextType",m.W8);class x extends r.Component{toggle(){this.state.showing?this.setState({showing:!1}):(this.state.toggled||(0,g.u4)(g.qY.COLLAPSED_POSTS_SHOWN,{num_visible_posts:this.props.posts.length,num_collapsed_posts:this.props.collapsedPosts.length}),this.setState({showing:!0,toggled:!0}))}render(){var e;let{user:t,pub:n,posts:i,collapsedPosts:r,onChange:o}=this.props,{showing:a}=null!=(e=this.state)?e:{};return(0,l.Y)("div",{className:"container-border post-list-hidden-posts ".concat(a?"showing":""),children:(0,l.FD)("div",{className:"container",children:[i.map(e=>(0,l.Y)(d.I0,{user:t,pub:n,post:e,onChange:o})),r.length>0&&(0,l.Y)("div",{className:"collapse-toggle",onClick:()=>this.toggle(),children:a?"hide":"+".concat(r.length," more")}),r.map(e=>(0,l.Y)(d.I0,{className:"collapsed",user:t,pub:n,post:e,utm_source:D.VU.home,onChange:o}))]})})}}},16447:function(e,t,n){n.d(t,{M:()=>H});var i=n(69277),l=n(70408),r=n(4006),o=n(48697),a=n(98445),s=n(99851),d=n(79785),c=n(32485),u=n.n(c),p=n(87677),h=n(17402),m=n(15734),g=n.n(m),v=n(56778),f=n(84605),Y=n(99145),b=n(85478),_=n(86500),y=n(68349),w=n(16291),k=n(39318),I=n(49807),C=n(82776);function S(){let e=(0,d._)(["Search ",""]);return S=function(){return e},e}class D extends h.Component{componentDidMount(){this.loadTab(this.state.tab.id)}componentWillUnmount(){"search"===this.state.tab.id&&this.searchInput&&this.searchInput.blur()}componentDidUpdate(e){(e.hideTop!==this.props.hideTop||e.newPosts!==this.props.newPosts)&&this.setState(this.getTabs())}getTabs(){var e,t,n;let i=[],{iString:l}=this.props,r={id:"new",title:l("Latest"),posts:this.props.newPosts,fullyLoaded:!!(this.props.maxPosts&&this.props.newPosts)};i.push(r),(!this.props.newPosts||this.props.newPosts.length>=this.getFetchLimit())&&(this.props.hideTop||i.push({id:"top",title:l("Top"),posts:this.props.topPosts,fullyLoaded:!!(this.props.maxPosts&&this.props.topPosts)}),(null==(e=this.props.pub)?void 0:e.community_enabled)&&(null==(t=this.props.pub)?void 0:t.has_community_content)&&!this.props.hideCommunity&&i.push({id:"community",title:l("Discussions"),posts:this.props.communityPosts,fullyLoaded:!!(this.props.maxPosts&&this.props.communityPosts)})),this.props.postId&&i.push({id:"related",title:l("Related"),posts:this.props.relatedPosts,fullyLoaded:!!this.props.relatedPosts}),i=this.props.sortTabs&&this.props.sortTabs(i)||i,"search"!==this.props.sort&&this.props.newPosts&&this.props.newPosts.lengthe.id===this.props.sort)||this.props.search&&i.find(e=>"search"===e.id)||i[0])?n:r;return{tabs:i,tab:o}}getFetchLimit(){return this.props.maxPosts||12}render(){var e,t,n;let{className:i,filterPostsPredicate:l,hideSearchTab:o,isPodcast:a,maxPosts:s,pinnedPosts:d,pub:c,renderLoading:h,renderPosts:m,renderTabs:g,renderSeeAll:f,sectionId:_,showMonthDividers:y,user:w,iString:D,iTemplate:F}=this.props,{emptyMessage:P}=this.props,{tabs:T,tab:A}=null!=(e=this.state)?e:{};P=P||D("No posts");let E=y&&(null==A?void 0:A.id)==="new",N=T.find(e=>"search"===e.id),B=T.find(e=>"community"===e.id),M=Array.isArray(A.posts)?A.posts.filter(e=>!(c&&"top"===A.id&&e.top_exclusions.includes(c.id))).filter(e=>null==c||!c.section||null==d||!d.length||!d.find(t=>t.id===e.id)).filter(e=>!C.hidePaidPostsFor.includes(null==c?void 0:c.subdomain)||"everyone"===e.audience||(null==w?void 0:w.is_subscribed)).filter(l||(()=>!0)):[];(null==c?void 0:c.section)&&(null==d?void 0:d.length)&&["new","top"].includes(null!=(t=A.id)?t:"")&&(M=[...d,...M]);let R=0===M.length,O=!M&&!A.loadingError,L=s?M.slice(0,s):M,z=m?m({posts:L,linkToComments:A===B,onClickPost:e=>{let{event:t,post:n,index:i,source:l}=e;return this.onPostClicked(t,n.id,i,l)},postGroups:E?x(L,c.language):null}):[],U=_&&null!=(n=null==c?void 0:c.sections.find(e=>e.id===_))?n:null,H=a?(0,I.erJ)({pub:c,section:U,params:{sort:A.id,search:A.query}}):(0,k.qy7)(c,{section:U,params:{sort:A.id,search:A.query}}),q=f?f({url:H}):(0,r.FD)("a",{className:"portable-archive-all",href:H,"data-native":!0,children:[D("See all")," ",(0,r.Y)(p.A,{size:12})]}),G=h?h():null;return(0,r.Y)(b.W8.Consumer,{children:e=>{let{getConfigFor:t}=e;return(0,r.Y)(Y.bf.Consumer,{children:e=>{let{open:n}=e;return(0,r.FD)("div",{className:u()("portable-archive",i,{"empty-list":R}),children:[g&&g({activeTabId:A.id,isSearching:A===N,showSearch:!!(N&&!o),searchInputProps:{value:null==N?void 0:N.query,onKeyDown:this.onSearchKeyDown,onChange:e=>{"search"===this.state.tab.id&&this.loadTab("search",e)},onBlur:this.onSearchBlur},searchRef:e=>{this.searchInput=e},tabs:T.filter(e=>!e.hidden),onClick:e=>{this.loadTab(e)},onClickSearch:()=>{t("fallback_to_archive_search_on_section_pages")&&_?this.loadTab("search"):n()},onClickSearchClose:()=>{var e;this.loadTab(null==(e=T[0])?void 0:e.id)}}),(0,r.FD)("div",{className:"portable-archive-list",children:[A.loadingError?(0,r.Y)("p",{className:"portable-archive-empty",children:D("Failed to load posts")}):0!==M.length||A.loading?(0,r.FD)(r.FK,{children:[z,!s&&!O&&!A.loading&&!A.fullyLoaded&&(0,r.Y)(v.A,{threshold:640,onVisible:()=>this.loadTab(A.id,A.query)})]}):(0,r.Y)("p",{className:"portable-archive-empty",children:"search"!==A.id?P:A.query?D("No results"):F(S(),U?U.name:c?c.name:"")}),A.loading||O?G:s&&M.length>=s&&q]})]})}})}})}constructor(e,t){if(super(e,t),(0,s._)(this,"searchInput",void 0),(0,s._)(this,"onTabClick",e=>t=>{t.preventDefault(),this.loadTab(e)}),(0,s._)(this,"onSearchInput",e=>{"search"===this.state.tab.id&&this.loadTab("search",e.currentTarget.value)}),(0,s._)(this,"onSearchKeyDown",e=>{if("search"===this.state.tab.id&&"Escape"===e.key){var t,n,i;null==(n=e.target)||null==(t=n.blur)||t.call(n),this.loadTab(null==(i=this.state.tabs[0])?void 0:i.id)}}),(0,s._)(this,"onPostClicked",(e,t,n,i)=>{(0,_.u4)(_.qY.ARCHIVE_PAGE_POST_CLICKED,{post_id:t,tab:this.state.tab.id,rank_in_feed:n,source:null!=i?i:this.props.source})}),(0,s._)(this,"onSearchBlur",e=>{if("search"===this.state.tab.id&&!e.target.value){var t;if(!this.state.tab.fullyLoaded)return void setTimeout(()=>{var e;null==(e=this.searchInput)||e.focus()},0);this.loadTab(null==(t=this.state.tabs[0])?void 0:t.id,"")}}),(0,s._)(this,"loadTab",async(e,t)=>{let n=this.state.tabs.find(t=>t.id===e);if(!n)return void console.error("couldnot find tab with id [".concat(e,"]"));let l=!1;if("search"===n.id&&"string"==typeof t&&n.query!==t&&(l=!0,n.query=t,n.posts=null,n.fullyLoaded=!1,n.loading=!1,n.loadingError=null),n.id!==this.state.tab.id?(this.setState({tab:n},()=>{"search"===n.id&&this.searchInput&&(this.searchInput.focus(),this.searchInput.select())}),this.props.stateInUrl&&"undefined"!=typeof window&&window.history.replaceState&&window.history.replaceState({},document.title,(0,k.oRR)({sort:n.id,search:n.query||null}))):l&&this.props.stateInUrl&&"undefined"!=typeof window&&window.history.replaceState&&window.history.replaceState({},document.title,(0,k.oRR)({search:n.query||null})),n.loading)return;if(n.fullyLoaded){this.props.onPostsLoaded&&this.props.onPostsLoaded({posts:n.posts});return}if("search"===n.id&&!n.query){n.posts=[],n.fullyLoaded=!0,this.setState({tabs:this.state.tabs});return}let r=(0,C.randomString)();if(n.loading=r,n.loadingError=null,this.setState({tabs:this.state.tabs}),"search"===n.id&&n.query&&(await new Promise(e=>setTimeout(e,300)),n.loading!==r))return;!this.state.tabs.find(e=>e.posts||e.fullyLoaded||e.loading||e.loadingError)&&this.props.delayFirstLoad&&await new Promise(e=>setTimeout(e,this.props.delayFirstLoad));let o=this.props.pub?"/api/v1/archive":this.props.profile?"/api/v1/profile-archive":"";try{let e,t,l=this.props.maxPosts?2*this.props.maxPosts:this.getFetchLimit();if("related"===n.id)e=(await g().get("/api/v1/posts/".concat(this.props.postId,"/related")).query({limit:l,offset:(n.posts||[]).length})).body;else{let r=(0,i._)({type:this.props.isPodcast?"podcast":void 0,rss_episodes_only:!!this.props.isPodcast&&!this.props.sectionId||void 0},this.props.authorId&&{author_id:this.props.authorId},this.props.postTagId&&{post_tag_id:this.props.postTagId},this.props.sectionId&&{section_id:this.props.sectionId},this.props.profile&&{profile_user_id:this.props.profile.id});"new"===n.id&&this.props.includePins&&!n.posts&&(t=(await g().get(o).query((0,i._)({sort:"pinned",offset:0,limit:1},r))).body),e=(await g().get(o).query((0,i._)({sort:"search"===n.id?"new":n.id,search:"search"===n.id?n.query:"",offset:(n.posts||[]).length,limit:l},r))).body,e=[...t||[],...e.filter(e=>!(null==t?void 0:t.find(t=>t.id===e.id)))]}if(this.props.onPostsLoaded&&this.props.onPostsLoaded({posts:e}),n.loading!==r)return;n.posts=n.posts?n.posts.concat(e):e,n.fullyLoaded=e.length=this.props.maxPosts)}catch(e){console.error("Failed to load tab:",e),n.loadingError=e}n.loading=!1,this.setState({tabs:this.state.tabs.map(e=>e.id===n.id?n:e),tab:n})}),(0,s._)(this,"onChange",e=>{let{post:t}=e;t&&((0,y.qr)(this,e=>{let n=!1;for(let i of e.tabs.map(e=>e.posts).filter(e=>Array.isArray(e))){let e=null==i?void 0:i.findIndex(e=>e.id===t.id);-1!==e&&i&&(i[null!=e?e:""]=t,n=!0)}n&&this.setState({tabs:e.tabs})}),this.props.onChange&&this.props.onChange(t))}),!(this.props.pub||this.props.profile))throw Error("Archive must be loaded for a publication or a profile");this.loadTab=this.loadTab.bind(this),this.state=this.getTabs()}}let F=(0,f.wr)(D),x=function(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en",i=[];return e.forEach((e,l)=>{let r=(0,w.A)(e.post_date).locale(n).format("MMMM YYYY");if(r!==t)0===l?i.push({label:"",posts:[e]}):i.push({label:r,posts:[e]}),t=r;else{let t=i[i.length-1];t&&t.posts.push(e)}}),i};var P=n(53989),T=n(10939),A=n(68410),E=n(28528),N=n(24634),B=n(72692),M=n(35369),R=n(76977),O=n(40837),L=n(21356),z=n(63136),U=n(4016);let H=e=>{var t;let{authorId:n,children:s,communityPosts:d,delayFirstLoad:c,filterPostsPredicate:u,hideCommunity:p,hideTop:h,includePins:m,isBelowTheFold:g,isPodcast:v,maxPosts:Y,newPosts:_,pinnedPosts:y,postTagId:w,pub:k,renderLoading:I,renderTabs:S,search:D,searchPosts:x,postId:H,sectionId:q,showMonthDividers:G,sort:W,sortTabs:K,source:V,topPosts:j,user:X,utm:J,variant:Z="list",onPostsLoaded:Q}=e,{iString:$}=(0,f.GO)(),{isMobile:ee}=(0,A.sM)(),{getSettingFor:et}=(0,P.Pu)(),en=(0,b.mJ)(),ei=(0,C.ensureInList)(et("post_preview_crop_gravity"),["center","auto"]),el=(0,U.lu)({pub:k}),er=null!=(t=en.getConfigFor("related_posts_enabled"))&&t;return(0,r.Y)(E.XL,{authorPagesEnabled:!!en.getConfigFor("enable_author_pages"),cropGravity:ei,highlightByline:!!en.getConfigFor("post_preview_highlight_byline"),pub:k,user:X,utm:J,children:(0,r.Y)(F,{authorId:n,communityPosts:d,delayFirstLoad:c,filterPostsPredicate:u,hideCommunity:p,hideTop:h,includePins:m,isBelowTheFold:g,isPodcast:v,maxPosts:Y,newPosts:_,pinnedPosts:y,postId:er?H:void 0,postTagId:w,pub:k,renderLoading:null!=I?I:()=>(0,r.Y)(N.t,{postCount:null!=Y?Y:7,variant:Z}),renderPosts:e=>{let{posts:t,linkToComments:n,onClickPost:i,postGroups:l}=e;return l?l.map(e=>{let{label:t,posts:l}=e;return(0,r.FD)(r.FK,{children:[t&&(0,r.FD)(r.FK,{children:[(0,r.Y)(T.r,{paddingBottom:8,paddingTop:8}),(0,r.Y)(z.EY.Meta,{as:"h3",className:"monthHeader-nt8KgE",color:"accent",paddingBottom:24,children:t})]}),s({posts:l,linkToComments:n,onClickPost:i})]})}):s({posts:t,linkToComments:n,onClickPost:i})},renderSeeAll:e=>{let{url:t}=e;return"grid-groups"===Z||el?null:(0,r.Y)(B.k,{url:t})},renderTabs:null!=S?S:e=>{let{activeTabId:t,isSearching:n,tabs:s,searchInputProps:d,searchRef:c,showSearch:u,onClick:p,onClickSearch:h,onClickSearchClose:m}=e;if("grid-groups"===Z||el)return null;if(n)return(0,r.FD)(R.Ye,{alignItems:"center",gap:12,justifyContent:"space-between",paddingBottom:16,paddingX:8*!ee,children:[(0,r.Y)(O.D,(0,l._)((0,i._)({},d),{ref:c,autoFocus:!0,flex:"grow",placeholder:$("Search..."),showClear:!1})),(0,r.Y)(M.K0,{priority:"tertiary",onClick:m,children:(0,r.Y)(o.A,{size:20})})]});if(u||s.length>1){var g,v;return(0,r.FD)(R.Ye,{alignItems:"center","aria-label":$("Archive sort tabs"),gap:12,justifyContent:"space-between",paddingBottom:16,paddingX:8*!ee,role:"navigation",children:[(0,r.Y)(L.T,{tabs:s.map(e=>({value:e.id,label:e.title})),value:null!=(v=null!=t?t:null==(g=s[0])?void 0:g.id)?v:"",onChange:e=>p(e||void 0)}),u&&(0,r.Y)(M.K0,{priority:"tertiary",onClick:h,children:(0,r.Y)(a.A,{size:20})})]})}return null},search:D,searchPosts:x,sectionId:q,showMonthDividers:G,sort:W,sortTabs:K,source:V,stateInUrl:!0,topPosts:j,user:X,onPostsLoaded:Q})})}},46497:function(e,t,n){n.d(t,{U:()=>ey});var i=n(4006),l=n(13264),r=n(17402),o=n(53023),a=n(69277),s=n(70408),d=n(31452),c=n(32485),u=n.n(c),p=n(68410),h=n(60355),m=n(76977),g=n(92636),v=n(39891);let f=e=>{let{posts:t}=e,{isMobile:n,isTablet:l}=(0,p.sM)();return(0,i.FD)("div",{className:u()("container-d4zBPi",{"containerTablet-tpTBc6":l,"containerMobile-VpmHH6":n}),children:[(0,i.FD)(m.Ye,{paddingLeft:20,position:"relative",children:[(0,i.Y)("div",{className:"latestArrowEndContainer-gx613b",children:(0,i.Y)("img",{className:"latestArrowEnd-kWO5qL",src:(0,v.dJ)("".concat((0,g.Ew)(),"/img/thefp/more-arrow-end-3.svg"),430)})}),(0,i.Y)("img",{className:"latestArrow-Z7Zn2b",src:(0,v.dJ)("".concat((0,g.Ew)(),"/img/thefp/more-arrow.svg"),430)})]}),t.map((e,t)=>(0,i.Y)(m.Ye,(0,s._)((0,a._)({},n?{borderTop:0===t?void 0:"detail-themed"}:{borderLeft:"detail-themed"}),{paddingX:20,paddingY:n?16:24,children:(0,i.Y)(h.R,{hideUfi:!0,post:e,variant:"mini"})})))]})};var Y=n(70103),b=n(78956),_=n(15894),y=n(53989),w=n(41477),k=n(80098),I=n(16291),C=n(39318);let S="fullWidthRow-lUGCvS",D=e=>{let{posts:t,showIntroModule:n=!1,isPortraitLayout:l=!1}=e,{isMobile:o,isTablet:a}=(0,p.sM)(),{activeLiveStream:s}=(0,r.useContext)(w.c),{getSettingFor:d}=(0,y.Pu)(),c=null;"autoPlay"===d("live_stream_homepage_style")&&(null==s?void 0:s.liveStream.id)&&(c=s);let u=t.slice(6,6+(a?3:5));return o?(0,i.Y)(A,{activeLiveStreamForHero:c,isPortraitLayout:l,posts:t,showIntroModule:n}):(0,i.FD)(m.I1,{className:"container-8llGPE",gap:64,paddingBottom:a?40:64,children:[(0,i.Y)(T,{activeLiveStreamForHero:c,isPortraitLayout:l,posts:t,showIntroModule:n}),(0,i.Y)(f,{posts:u})]})},F=e=>{var t;let{activeLiveStream:n}=e,{isMobile:l}=(0,p.sM)();return(0,i.FD)(m.Ye,{as:"a",className:"live-stream-video-container-uqPjYo",href:"/livestream",overflow:"hidden",position:"relative",children:[(0,i.Y)(d.N,{autoPlay:!0,disableClickToPlayPause:!0,liveStreamId:n.liveStream.id,mediaUpload:{id:"ls-".concat(n.liveStream.id),width:1920,height:1080},noControls:!0,noJoin:!0,noKeyboardShortcuts:!0,pub:null!=(t=n.pub)?t:null,startMuted:!0,thumbnailUrl:n.liveStreamInformation.desktopThumbnailPhotoUrl}),"active"===n.liveStream.status&&(0,i.Y)("div",{className:"live-stream-overlay-y3S_YV",children:(0,i.FD)(m.Ye,{alignItems:"center",className:"live-tag-HiCqnj",gap:8,children:[(0,i.Y)("div",{className:"live-tag-dot-pyPCBN"}),(0,i.Y)(_.T,{color:"white",preset:l?"detail-small":"detail-large",children:"LIVE"})]})})]})},x=e=>{let{activeLiveStream:t}=e,{isMobile:n}=(0,p.sM)(),{title:l,description:r,started_streaming_at:o}=t.liveStream,a=t.user.name,s=(0,I.A)(o).format("MM.DD.YY"),d=(0,C.rfn)(t.user.id,t.user.name,{noBase:!0});return(0,i.Y)(m.Ye,{as:"a",href:"/livestream",children:(0,i.FD)(m.I1,{paddingX:16,children:[(0,i.Y)(m.I1,{paddingBottom:8,children:(0,i.Y)(_.T,{align:"center",preset:"h3-compressed",children:l})}),(0,i.Y)(m.I1,{alignSelf:"stretch",paddingBottom:8,children:(0,i.Y)(F,{activeLiveStream:t})}),(0,i.FD)(m.I1,{alignItems:"center",gap:n?8:12,children:[r&&(0,i.Y)(_.T,{align:"center",preset:"d2-serif",children:r}),(0,i.FD)(_.T,{align:"center",preset:"lg-preview-byline",children:[(0,i.Y)(_.T,{as:"a",className:"live-stream-author-link-NYmyEI",href:d,preset:"lg-preview-byline",children:a})," — ",s]})]})]})})},P=()=>(0,i.FD)("a",{className:"introModule-WDoR9y","data-native":!0,href:"/intro-to-tfp",children:[(0,i.Y)("img",{alt:"The Free Press",className:"introModuleImage-b5tjpb",src:(0,C.dJ9)("".concat((0,g.Ew)(),"/img/thefp/fp-flag-red.png"))}),(0,i.Y)(_.T,{align:"center",className:"introModuleText-tL6vMV",preset:"h7-serif",children:"An\xa0Introduction\xa0to The\xa0Free\xa0Press"})]}),T=e=>{let{activeLiveStreamForHero:t,isPortraitLayout:n=!1,posts:l,showIntroModule:r=!1}=e,{isTablet:o,isDesktop:d}=(0,p.sM)(),c={align:"center"};return n&&d?(0,i.FD)(k.P,{variant:"three-column-one-column-one-column",children:[(0,i.Y)(b.A,{children:[l[0]&&(0,i.Y)(h.R,(0,s._)((0,a._)({},c),{align:"left",post:l[0],variant:"portrait"}))]}),(0,i.Y)(b.A,{paddingTop:40,children:[l[1]&&(0,i.Y)(h.R,(0,s._)((0,a._)({},c),{hideDescription:!0,hideImage:!0,post:l[1],variant:"square"})),l[2]&&(0,i.Y)(h.R,(0,s._)((0,a._)({},c),{hideDescription:!0,hideImage:!0,post:l[2],variant:"square"})),r?(0,i.Y)(P,{}):l[3]&&(0,i.Y)(h.R,(0,s._)((0,a._)({},c),{hideImage:!0,post:l[3],variant:"square"}))]}),(0,i.Y)(b.A,{paddingTop:40,children:[l[4]&&(0,i.Y)(h.R,(0,s._)((0,a._)({},c),{hideDescription:!0,post:l[4],variant:"square"})),l[5]&&(0,i.Y)(h.R,(0,s._)((0,a._)({},c),{post:l[5],variant:"square"}))]})]}):n&&o?(0,i.FD)("div",{className:"tabletPortraitLayout-eMAKhD",children:[l[0]&&(0,i.Y)(h.R,(0,s._)((0,a._)({},c),{align:"left",post:l[0],variant:"portrait"})),(0,i.Y)("hr",{}),(0,i.FD)(m.Ye,{alignItems:"center",className:S,justifyContent:"space-between",children:[l[1]&&(0,i.Y)(h.R,(0,s._)((0,a._)({},c),{hideDescription:!0,hideImage:!0,post:l[1],variant:"square"})),l[2]&&(0,i.Y)(h.R,(0,s._)((0,a._)({},c),{hideDescription:!0,hideImage:!0,post:l[2],variant:"square"})),l[3]&&(0,i.Y)(h.R,(0,s._)((0,a._)({},c),{hideDescription:!0,hideImage:!0,post:l[3],variant:"square"}))]}),(0,i.Y)("hr",{}),(0,i.FD)(m.Ye,{className:S,justifyContent:"space-between",children:[(0,i.Y)("div",{className:"wideContent-tdvs4B",children:l[4]&&(0,i.Y)(h.R,(0,s._)((0,a._)({},c),{post:l[4],titlePreset:"h4-sans-condensed",variant:"content-block-listing"}))}),(0,i.Y)("div",{className:"narrowContent-CJLDbf",children:l[5]&&(0,i.Y)(h.R,(0,s._)((0,a._)({},c),{hideDescription:!0,post:l[5],variant:"square"}))})]})]}):(0,i.FD)(k.P,{hideVerticalDividers:!0,variant:"one-column-two-column-one-column",children:[t?(0,i.Y)(b.A,{children:(0,i.Y)(x,{activeLiveStream:t})}):l[0]&&(0,i.FD)(b.A,{children:[(0,i.Y)(h.R,(0,s._)((0,a._)({},c),{align:"center",post:l[0],showImageLast:!0,variant:"large"})),o&&(0,i.FD)(m.Ye,{gap:40,children:[l[1]&&(0,i.Y)(h.R,(0,s._)((0,a._)({},c),{hideImage:!0,post:l[1],variant:"square"})),l[3]&&(0,i.Y)(h.R,(0,s._)((0,a._)({},c),{hideImage:!0,post:l[3],variant:"square"}))]})]}),o&&(0,i.FD)(b.A,{children:[r?(0,i.Y)(P,{}):l[2]&&(0,i.Y)(h.R,(0,s._)((0,a._)({},c),{hideDescription:!0,post:l[2],variant:"square"})),l[4]&&(0,i.Y)(h.R,(0,s._)((0,a._)({},c),{hideDescription:!0,post:l[4],variant:"square"})),l[5]&&(0,i.Y)(h.R,(0,s._)((0,a._)({},c),{hideDescription:!0,post:l[5],variant:"square"}))]}),d&&(0,i.FD)(b.A,{paddingTop:40,children:[l[1]&&(0,i.Y)(h.R,(0,s._)((0,a._)({},c),{hideDescription:!0,hideImage:!0,post:l[1],variant:"square"})),r?(0,i.Y)(P,{}):l[2]&&(0,i.Y)(h.R,(0,s._)((0,a._)({},c),{hideDescription:!0,post:l[2],variant:"square"})),l[3]&&(0,i.Y)(h.R,(0,s._)((0,a._)({},c),{hideImage:!0,post:l[3],variant:"square"}))]}),d&&(0,i.FD)(b.A,{paddingTop:40,children:[l[4]&&(0,i.Y)(h.R,(0,s._)((0,a._)({},c),{post:l[4],variant:"square"})),l[5]&&(0,i.Y)(h.R,(0,s._)((0,a._)({},c),{post:l[5],variant:"square"}))]})]})},A=e=>{let{activeLiveStreamForHero:t,posts:n,showIntroModule:l=!1,isPortraitLayout:r=!1}=e,o=n.slice(6,11);return(0,i.FD)(m.I1,{gap:32,paddingBottom:64,children:[t&&(0,i.Y)(x,{activeLiveStream:t}),r?n[0]&&(0,i.Y)(h.R,{align:"left",imageAspectRatio:"portrait",post:n[0],variant:"large"}):n[0]&&(0,i.Y)(h.R,{align:"left",post:n[0],variant:"large"}),l?(0,i.Y)(P,{}):n[2]&&(0,i.Y)(h.R,{post:n[2],variant:"square"}),(0,i.FD)(Y.Z,{children:[n[1]&&(0,i.Y)(h.R,{hideDescription:!0,post:n[1],variant:"square"}),n[3]&&(0,i.Y)(h.R,{hideDescription:!0,post:n[3],variant:"square"}),n[4]&&(0,i.Y)(h.R,{post:n[4],variant:"mini"}),n[5]&&(0,i.Y)(h.R,{post:n[5],variant:"mini"})]}),(0,i.Y)(f,{posts:o})]})};var E=n(60030),N=n(32641),B=n(56877),M=n(98002),R=n(93800),O=n(86898);let L=O.O.feature.postCount.desktop,z=e=>{let{noFirstImage:t,posts:n}=e,{breakpoint:l}=(0,p.sM)(),r=O.O["magazine-5"].postCount[l],o=Array.from({length:t?r+2:r},(e,t)=>{var i;return null!=(i=n[t])?i:null});return(0,i.Y)(R.m,{hideHorizontalDividers:!0,posts:o,variant:t?"two-three-two":"five-up"})},U=e=>(0,i.Y)(z,(0,s._)((0,a._)({},e),{noFirstImage:!0}));var H=n(84605),q=n(78120),G=n(67190),W=n(88218),K=n(4016);let V=e=>{let{hideViewAll:t,isLatestPosts:n,pub:l,showPlaceholderTitle:r}=e,{iString:o}=(0,H.GO)(),a=(0,K.S2)({pub:l}),s=o(n?"Latest":"Most Popular");return(0,i.FD)(m.Ye,{alignItems:"baseline",justifyContent:"space-between",paddingX:8,children:[r?(0,i.Y)(m.Ye,{paddingY:4,children:(0,i.Y)(G.x,{size:"md",width:100})}):a?(0,i.Y)("div",{className:"pillarTitle-JAEuZo",children:s}):(0,i.Y)(W.F,{children:s}),!n&&!t&&(0,i.Y)(q.M,{href:(0,C.qy7)(l,n?void 0:{params:{sort:"top"}}),children:o("View all")})]})};var j=n(28528),X=n(7761),J=n(89490),Z=n(90839);let Q=O.O.magaziney.postCount.desktop,$=e=>{var t;let{noFirstImage:n,posts:l,replaceTopPostsWithLatest:r,topPosts:o}=e,{isTablet:a,isMobile:s}=(0,p.sM)(),{pub:d}=(0,j.np)();if(s)return null;let c=n?5:Q,u=r?l.slice(0,c):l,h=r?l.slice(c):o,g=Array.from({length:c},(e,t)=>{var n;return null!=(n=u[t])?n:null}),v=(null!=(t=null==h?void 0:h.length)?t:0)===0,f=a?3:6,Y=h?Array.from({length:f},(e,t)=>{var n;return null!=(n=h[t])?n:null}):null;return(0,i.FD)(k.P,{showContentBelowOnMobile:!0,variant:"full-width-with-border-and-sidebar",children:[(0,i.Y)(R.m,{flex:"grow",hideHorizontalDividers:!0,posts:g,variant:n?"two-small-three-medium":"two-small-one-large"}),Y&&(0,i.Y)(Z.l3,{children:(0,i.Y)(X.WO,{pub:d,showPubPins:!1,showSectionPins:!1,children:(0,i.FD)(m.I1,{gap:12,paddingTop:8,children:[v?(0,i.Y)(J.az,{paddingX:8,paddingY:4,children:(0,i.Y)(G.x,{size:"md",width:"30%"})}):(0,i.Y)(V,{isLatestPosts:r,pub:d}),(0,i.Y)(R.m,{hideHorizontalDividers:!0,posts:Y.slice(0,f),variant:a?"mini-row":(0,K.S2)({pub:d})?"one-column-list-flex":"one-column-list"})]})})})]})},ee=e=>(0,i.Y)($,(0,s._)((0,a._)({},e),{noFirstImage:!0}));var et=n(16074);let en=e=>{let{posts:t}=e;return t.length?(0,i.FD)(m.I1,{gap:12,children:[t[0]&&(0,i.Y)(M.z,{post:t[0],variant:"mobile-hero"}),t.length>1&&(0,i.FD)(m.I1,{paddingX:16,children:[(0,i.Y)(et.c,{paddingY:4}),(0,i.Y)(R.m,{posts:t.slice(1),variant:"two-column-list"})]})]}):null},ei=e=>{let{isSmall:t,posts:n}=e;return n.length&&n[0]?(0,i.Y)(k.P,{variant:t?"three-column-width":"full-width",children:(0,i.Y)(M.z,{post:n[0],variant:t?"jumbo-small":"jumbo"})}):null},el=e=>(0,i.Y)(ei,(0,s._)((0,a._)({},e),{isSmall:!0}));var er=n(64648),eo=n(64232),ea=n(13790);let es={magaziney:$,"magazine-5":z,newspaper:ei,feature:e=>{var t;let{posts:n}=e,{isTablet:l}=(0,p.sM)(),r=null!=(t=n[0])?t:null,o=Array.from({length:L-1},(e,t)=>{var i;return null!=(i=n[t+1])?i:null});return(0,i.Y)(B.h,{leftContent:(0,i.Y)(M.z,{imageAspectRatio:"wide",post:r,variant:"large"}),mobileContent:(0,i.Y)(R.m,{posts:n.slice(0,L),variant:"two-column-list"}),rightContent:(0,i.Y)(R.m,{hideHorizontalDividers:!0,posts:o,slotIndexOffset:1,variant:l?"one-column-list":"two-column-list"})})},podcast:e=>{var t,n,l;let{columns:r,hasMiniPostsRowUnderneath:o,heroAlignment:a,posts:s,showPodcastLinks:d,user:c}=e,{isMobile:u}=(0,p.sM)(),{pub:h}=(0,j.np)(),g=h.podcast_description,v=h.podcast_art_url,f=h.podcast_title,Y=24*!!o;return u?(0,i.Y)(m.I1,{paddingBottom:24,children:(0,i.Y)(ea._,{description:g,imageUrl:v,name:f,post:null!=(t=s[0])?t:null,pub:h,section:null,showPodcastLinks:d,user:c})}):"center"===a?(0,i.Y)(m.I1,{paddingBottom:Y,children:(0,i.Y)(eo.i,{description:g,imageUrl:v,name:f,post:null!=(n=s[0])?n:null,pub:h,section:null,showPodcastLinks:d,user:c})}):(0,i.Y)(m.I1,{paddingBottom:Y,children:(0,i.Y)(er.S,{columns:r,description:g,imageUrl:v,name:f,post:null!=(l=s[0])?l:null,pub:h,section:null,showPodcastLinks:d,user:c})})}},ed=e=>{var{firstPostMissingImage:t,bodyVariant:n,isMobile:l,variant:r}=e,o=(0,N._)(e,["firstPostMissingImage","bodyVariant","isMobile","variant"]);let s=es[r],d={};return(l&&"podcast"!==r?s=en:"newspaper"===r&&"list"===n?s=el:"magaziney"===r&&t?s=ee:"magazine-5"===r&&t?s=U:"podcast"===r&&(d.columns="list"===n?3:4),s)?(0,i.Y)(s,(0,a._)({},o,d)):(console.error("Component not found, add one to HomeHero"),null)};var ec=n(10939),eu=n(68349),ep=n(70557),eh=n(56458);let em=e=>{let{posts:t,pub:n,user:l,utm:r}=e,{isMobile:o}=(0,p.sM)();if(!t.length||!t[0])return null;let a=t[0],s=a.section_id?n.sections.find(e=>e.id===a.section_id):void 0,d=(0,eh.rI)({post:a,section:null!=s?s:null,pub:n});return(0,i.Y)(m.I1,{cursor:"pointer",paddingX:16*!!o,onClick:()=>{let e=a.canonical_url;"video"===a.type?e=(0,C.oRR)(a.canonical_url,{autoPlay:!0}):r&&(e=(0,C.yRP)(a.canonical_url,{utm:r})),(0,eu.V2)(e)},children:(0,i.Y)(ep.X,{columns:4,highlightPost:!0,isPodcast:!d,post:t[0],pub:n,section:s,user:null!=l?l:null})})},eg=e=>{let{columns:t=4,posts:n,pub:l}=e,{isMobile:r}=(0,p.sM)(),o=Array.from({length:t},(e,t)=>{var i;return null!=(i=n[t])?i:null}),a=n.length>=t;return r?null:(0,i.Y)(k.P,{variant:3===t?"three-column-width":"full-width",children:(0,i.FD)(m.I1,{gap:12,children:[(0,i.Y)(V,{hideViewAll:!a,pub:l,showPlaceholderTitle:0===n.length}),(0,i.Y)(R.m,{posts:o,variant:3===t?"three-column-mini-row":"mini-row"})]})})};var ev=n(9624),ef=n(90800),eY=n(99156),eb=n(71783),e_=n(57459);let ey=(0,r.memo)(e=>{var t,n,r;let{bodyVariant:a,heroAlignment:s,homeHeroPins:d,heroVariant:c,isMobile:u,isPortraitLayout:p,posts:h,pub:g,replaceTopPostsWithLatest:v,showIntroModule:f,showPodcastLinks:Y,showTopPosts:b,topPosts:_,user:y,utm:w,onEditClick:k}=e,I=(0,l.md)(eb.Nu),C=null!=(n=null==I?void 0:I.heroId)?n:c,S=null!=(r=null==I?void 0:I.alignment)?r:s,{isPreviewMode:F}=(0,eY.T)(),x={type:"home-hero"},P=(0,ef.tP)(x),T=(0,E.P)(),A=(0,e_.be)({pub:g,useCustomTheme:T}),N=!(null==(t=h[0])?void 0:t.cover_image),B=["newspaper","podcast"].includes(C)&&"list"===a,M=!!(b&&_&&"magaziney"!==C&&!u),R=()=>{if((0,K.K)({pub:g})&&T)return(0,i.Y)(o.i,{homeHeroPins:d,posts:h,pub:g,onEditClick:k});if((0,K.lu)({pub:g}))return(0,i.Y)(Z.kT,{previewBlockId:x,onEditClick:k,children:(0,i.Y)(X.WO,{pinnedPostIds:null==d?void 0:d.map(e=>e.post_id),pub:g,showPubPins:!0,showSectionPins:!1,children:(0,i.Y)(ev.y,{posts:h,children:(0,i.Y)(D,{isPortraitLayout:p,posts:h,showIntroModule:f})})})});if("feature-media"===C){var e;let t=u?16:8;return(0,i.Y)(Z.kT,{previewBlockId:x,onEditClick:k,children:(0,i.FD)(m.I1,{gap:24,paddingBottom:t,paddingTop:t,children:[(0,i.Y)(ev.y,{posts:h,children:(0,i.Y)(ev.z,{postId:null==(e=h[0])?void 0:e.id,slotIndex:0,children:(0,i.Y)(em,{posts:h,pub:g,user:y,utm:w})})}),M&&_&&(0,i.Y)(Z.l3,{children:(0,i.Y)(eg,{columns:B?3:4,posts:_,pub:g})})]})})}return(0,i.FD)(Z.kT,{disabled:A.disabledPreviewBlocks.includes("home-hero"),layoutVariant:B?"three-column":void 0,previewBlockId:x,onEditClick:k,children:[(0,i.Y)(X.WO,{pinnedPostIds:null==d?void 0:d.map(e=>e.post_id),pub:g,showPubPins:!0,showSectionPins:!1,children:(0,i.Y)(ed,{bodyVariant:a,firstPostMissingImage:N,hasMiniPostsRowUnderneath:M,heroAlignment:S,isMobile:u,posts:h,replaceTopPostsWithLatest:v,showPodcastLinks:Y,topPosts:_,variant:C})}),M&&_&&(0,i.FD)(Z.l3,{children:[!["feature-media","podcast"].includes(C)&&(0,i.Y)(ec.r,{numColumns:B?3:4,paddingBottom:16,paddingTop:16}),(0,i.Y)(eg,{columns:B?3:4,posts:_,pub:g})]})]})};return(0,i.FD)(i.FK,{children:[F?(0,i.Y)("div",{id:P,children:R()}):R(),"feature-media"===C?(0,i.Y)("div",{style:{height:u?8:M?16:32}}):null]})})},83840:function(e,t,n){n.d(t,{h:()=>nt});var i=n(69277),l=n(4006),r=n(32485),o=n.n(r),a=n(17402),s=n(73869),d=n(60030),c=n(98445),u=n(13950),p=n(84605),h=n(99145),m=n(68410),g=n(78120),v=n(88218),f=n(35369),Y=n(76977),b=n(63136),_=n(4016);let y=e=>{let{pub:t,showSearch:n,title:i,viewAllUrl:r}=e,a=(0,_.S2)({pub:t}),{isMobile:s}=(0,m.sM)(),{iString:d}=(0,p.GO)(),{open:y}=(0,h.v9)();return(0,l.FD)(Y.Ye,{alignItems:"baseline",borderBottom:a?"detail-themed":void 0,className:o()({"pillarHeader-EpU7EL":a}),justifyContent:"space-between",paddingBottom:s?12:16,paddingX:8*!s,children:[a?(0,l.Y)("div",{className:"pillarTitle-Eyi3Nu",children:i}):s?(0,l.Y)(v.F,{children:i}):(0,l.Y)(b.EY.H3,{color:"pub-primary-text",font:"pub-headings",children:i}),r&&(0,l.FD)(Y.Ye,{alignItems:"center",gap:16,style:{whiteSpace:"nowrap"},children:[n&&(0,l.Y)(u.DH,{children:(0,l.Y)(f.K0,{priority:"tertiary",onClick:e=>{e.preventDefault(),y()},children:(0,l.Y)(c.A,{size:20})})}),(0,l.Y)(g.M,{href:r,children:d("View all")})]})]})};var w=n(80098),k=n(56877),I=n(98002),C=n(93800),S=n(86898);let D=S.O.feature.postCount.desktop,F=e=>{let{posts:t,pub:n,showSearch:i,title:r,viewAllUrl:o,variant:a="focus-left-list"}=e,s=a.includes("-grid"),d=t.filter(Boolean).length;return(0,l.FD)(l.FK,{children:[r&&(0,l.Y)(y,{pub:n,showSearch:i,title:r,viewAllUrl:d>=(s?D:4)?o:void 0}),(0,l.Y)(x,{posts:t,variant:a})]})},x=e=>{var t;let{posts:n,variant:i}=e,{isMobile:r,isTablet:o}=(0,m.sM)(),a=null!=(t=n[0])?t:null,s=Array.from({length:Math.max(i.includes("-grid")?D:4,Math.min(n.length,D))-1},(e,t)=>{var i;return null!=(i=n[t+1])?i:null});if(r){let e=Array.from({length:4},(e,t)=>{var i;return null!=(i=n[t])?i:null});return(0,l.Y)(C.m,{posts:e,variant:"two-column-list"})}if(o)return(0,l.FD)(w.P,{variant:"one-column-two-column-one-column",children:[(0,l.Y)(I.z,{post:a,slotIndex:0,variant:"large"}),(0,l.Y)(C.m,{flex:"grow",hideHorizontalDividers:!0,posts:s,slotIndexOffset:1,variant:"one-column-list"})]});if(i.startsWith("focus-left")){let e="focus-left-list"===i?(0,l.Y)(C.m,{posts:s,slotIndexOffset:1,variant:"two-column-list"}):(0,l.Y)(C.m,{hideHorizontalDividers:!0,posts:s,slotIndexOffset:1,variant:"two-column-grid"});return(0,l.Y)(k.h,{leftContent:(0,l.Y)(I.z,{post:a,slotIndex:0,variant:"large"}),rightContent:e})}if(i.startsWith("focus-center")){let e=Array.from({length:2},(e,t)=>{var i;return null!=(i=n[t+1])?i:null}),t=Array.from({length:2},(e,t)=>{var i;return null!=(i=n[t+3])?i:null});return(0,l.FD)(w.P,{variant:"one-column-two-column-one-column",children:[(0,l.Y)(I.z,{post:a,slotIndex:0,variant:"large"}),(0,l.Y)(C.m,{flex:"grow",hideHorizontalDividers:!0,posts:e,slotIndexOffset:1,variant:"square-square-column"}),(0,l.Y)(C.m,{flex:"grow",hideHorizontalDividers:!0,posts:t,slotIndexOffset:3,variant:"square-square-column"})]})}if(i.startsWith("focus-right")){let e="focus-right-list"===i?(0,l.Y)(C.m,{posts:s,slotIndexOffset:1,variant:"two-column-list"}):(0,l.Y)(C.m,{hideHorizontalDividers:!0,posts:s,slotIndexOffset:1,variant:"two-column-grid"});return(0,l.Y)(k.h,{leftContent:e,rightContent:(0,l.Y)(I.z,{post:a,slotIndex:0,variant:"large"})})}return null};var P=n(32641),T=n(13264),A=n(49869),E=n(90620),N=n(80697),B=n(17028),M=n(15871);let R=e=>{let{children:t,column:n}=e,{isActive:i,isDragging:r,setHoveredColumn:o}=(0,E.H)(),{isOver:s,setNodeRef:d}=(0,M.zM)({id:"column-".concat(n),disabled:!i});(0,a.useEffect)(()=>{r&&s?o(n):r&&!s&&o(e=>e===n?null:e)},[n,r,s,o]);let c="function"==typeof t?t({isOver:s}):t;return i?(0,l.Y)(Y.I1,{ref:d,className:"dropZone-e4cHxw",children:c}):c};var O=n(45387),L=n(99156);let z=e=>{let{column:t}=e,{iString:n}=(0,p.GO)(),{contentBlockId:i,draggedHeight:r,isActive:s,isDragging:d}=(0,E.H)(),{deactivatePreviewBlock:c,requestModulePicker:u}=(0,L.T)(),h=(0,a.useMemo)(()=>({type:"module-picker",parentContentBlockId:i,column:t,insertAtIndex:0}),[i,t]),{isActive:m,clickAction:g}=(0,O.k6)(h),v=d||"activate"!==g&&!m,f=(0,a.useCallback)(e=>{e.stopPropagation(),m?c():u({parentContentBlockId:i,column:t,insertAtIndex:0})},[i,t,c,m,u]);return(0,l.Y)(R,{column:t,children:e=>{let{isOver:t}=e;return(0,l.Y)(B.I1,{alignItems:"center",className:o()("emptyState-MF3YDQ",{[String("active-llAkyd")]:s&&!v,[String("dropTarget-g9F8QT")]:d}),cursor:v?void 0:"pointer",gap:8,justifyContent:d?"start":"center",minHeight:d?200:120,paddingX:8,radius:"sm",role:"button",tabIndex:0,textAlign:"center",width:"100%",onClick:v?void 0:f,children:d?t&&(0,l.Y)("div",{className:"placeholder-tcxm_U",style:{height:null!=r?r:void 0}}):(0,l.FD)("div",{className:o()("ctaContent-poF8iJ",{[String("ctaContentVisible-BZYXLS")]:s}),children:[(0,l.Y)(N.A,{className:"icon-X2nAHP",size:16}),(0,l.Y)(b.EY.B3,{color:"secondary",children:n("Add module")})]})})}})},U="emptyColumn-wbqk2v",H="emptyColumnActive-mTDRtK",q="emptyColumnExpanded-g4LiNt",G="emptyColumnContent-oiyCuv",W=e=>{let{children:t,emptyLeft:n,emptyRight:i}=e,{isDesktop:r}=(0,m.sM)(),{hoveredColumn:s,isActive:d,isDragging:c}=(0,E.H)(),{isMobileEditor:u,isPreviewMode:p}=(0,L.T)(),h=(0,a.useRef)(null),{width:g}=(0,A.w)({containerRef:h}),v=(0,a.useMemo)(()=>g<=0?{one:1,two:1}:{one:(g-100)/g,two:(g-200)/g},[g]);if(!p||!r||u)return t;let f=n&&i,Y=c&&"left"===s&&n,b=c&&"right"===s&&i,_=Y||b,y=n||i;return(0,l.FD)("div",{ref:h,className:o()("wrapper-iARQWw",{[String("dragging-wqUrPl")]:c}),style:{"--content-scale-one":v.one,"--content-scale-two":v.two},children:[y&&n&&(0,l.Y)("div",{className:o()(U,"emptyColumnLeft-muN01M",{[String(H)]:d,[String(q)]:Y}),children:(0,l.Y)("div",{className:G,children:(0,l.Y)(z,{column:"left"})})}),(0,l.Y)("div",{className:o()("content-OehGzR",{[String("contentOriginLeft-Kso11C")]:y&&i&&!n,[String("contentOriginRight-iAt4QB")]:y&&n&&!i,[String("contentOriginCenter-Cp9SmS")]:y&&f,[String("contentScaleOne-SI8mOq")]:y&&d&&!f&&!_,[String("contentScaleTwo-IthkKa")]:y&&d&&f&&!_,[String("contentScaleFull-riG7qC")]:y&&_}),children:t}),y&&i&&(0,l.Y)("div",{className:o()(U,"emptyColumnRight-k7Rev2",{[String(H)]:d,[String(q)]:b}),children:(0,l.Y)("div",{className:G,children:(0,l.Y)(z,{column:"right"})})})]})};var K=n(9757),V=n(67190),j=n(72692),X=n(85965),J=n(26761),Z=n(70408),Q=n(65670),$=n(90800),ee=n(86503),et=n(71783);let en=e=>{let{children:t,column:n,contentBlockId:r,disabled:s,dragId:d,moduleId:c}=e,{iString:u}=(0,p.GO)(),{activatePreviewBlock:h,deactivatePreviewBlock:m,isMobileEditor:g,isPreviewMode:v,sendSidebarModuleRemove:f}=(0,L.T)(),Y=(0,Q.kG)(),b=(0,T.md)(et.nJ),_=(0,O.MS)(r,c),y=(0,a.useMemo)(()=>({type:"sidebar-module",parentContentBlockId:r,moduleId:c}),[r,c]),w=(0,$.tP)(y),k=(null==Y?void 0:Y.type)==="module-picker"&&(null==b?void 0:b.moduleId)===c&&(null==b?void 0:b.contentBlockId)===r,{attributes:I,listeners:C,setNodeRef:S}=(0,M.PM)({id:null!=d?d:"disabled",disabled:!d||_||g}),{activeDragId:D,draggedHeight:F,isDragging:x}=(0,E.H)(),P=(0,a.useMemo)(()=>n?{type:"sidebar-module",parentContentBlockId:r,moduleId:c}:null,[n,r,c]),{clickAction:A,showOverlay:N}=(0,O.k6)(P),B="activate"===A,R=(0,a.useCallback)(e=>{e.stopPropagation(),P&&"none"!==A&&("activate"===A?h(P):m())},[P,A,h,m]),z=(0,a.useCallback)(e=>{e.stopPropagation(),f({contentBlockId:r,moduleId:c})},[r,c,f]),U=(0,a.useCallback)(e=>{d&&S(e)},[d,S]);if(!P||!v||s||g)return t;let H=(0,J._9)(null!=D?D:void 0),q=void 0!==d&&H===c,G=void 0!==d&&!q&&!_&&!g,W=_||k,K=!x&&(N||W)&&!g,V=B&&!k,j=q&&F?{minHeight:F-24}:void 0;return(0,l.FD)("div",(0,Z._)((0,i._)({ref:U,className:o()("draggableModule-Bf288k",{[String("draggableModuleDragging-LZeAjH")]:q,[String("defaultCursor-mUq6Y6")]:!V||W,[String("pointerCursor-IZ99JQ")]:V&&!K}),"data-draggable-id":d,id:w,style:j,onClick:k?void 0:R},G?I:{},G?C:{}),{children:[(0,l.Y)("div",{className:"draggableModuleContent-tYdch3","data-draggable-content":!0,children:!q&&t}),K&&!W&&(0,l.Y)(ee.O,{isDraggable:!0,label:u("Click to edit / Drag to move"),size:"sm",onClick:R,onRemove:z})]}))};var ei=n(10939),el=n(81929),er=n(53168);let eo=(0,a.forwardRef)((e,t)=>{let{disabled:n,isActive:i,label:r,spaceHeight:a=32,onClick:s,variant:d="default"}=e,c="none"===d?null:"space"===d?(0,l.Y)(Y.Ye,{paddingBottom:a}):(0,l.Y)(ei.r,{});return n?c:(0,l.FD)("div",{ref:t,className:o()("container-UZDvpD",{[String("active-Xwi0XX")]:i}),children:[c&&(0,l.Y)("div",{className:"content-w5CYL3",children:c}),(0,l.Y)("div",{className:"overlay-TizwXu",style:{zIndex:er.AG},onClick:s,children:r&&!i&&(0,l.Y)(el.vw,{className:"tag-FgJVof",priority:"primary",theme:"accent",children:r})})]})});var ea=n(63950),es=n.n(ea),ed=n(42308),ec=n(89490);let eu=e=>{var t;let{contentBlock:n}=e,{iString:i}=(0,p.GO)(),r=(null==(t=n.attrs.polymarket_iframe)?void 0:t.title)||i("Polymarket");return(0,l.FD)(Y.I1,{gap:16,children:[(0,l.Y)(Y.Ye,{paddingX:8,children:(0,l.Y)(v.F,{children:r})}),(0,l.Y)(ec.az,{children:(0,l.Y)("iframe",{sandbox:"allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox",src:"https://thespread.news/embed",style:{width:"100%",border:"none",minHeight:"700px"},title:r})})]})};var ep=n(97904),eh=n(11419),em=n(41477);let eg=e=>{var t;let{topPostsSettings:n}=e,{iString:i}=(0,p.GO)(),{topPosts:r}=(0,a.useContext)(em.c),{isMobile:o}=(0,m.sM)(),s=null!=(t=null==n?void 0:n.num_posts)?t:5;return r?(0,l.FD)(Y.I1,{gap:16,children:[(0,l.Y)(ec.az,{paddingX:8*!o,children:(0,l.Y)(v.F,{children:i("Top posts")})}),(0,l.Y)(C.m,{posts:r.slice(0,s),variant:"one-column-list-flex"})]}):null};var ev=n(71834),ef=n(24078),eY=n(4277);let eb=e=>{var t;let{contributor:n,latestPost:i}=e;if(!i)return null;let r="undefined"==typeof window,o=(0,l.Y)(eY.u,{hoverBackground:"light",padding:8,radius:"sm",children:(0,l.FD)(Y.Ye,{alignItems:"center",gap:16,children:[(0,l.FD)(Y.I1,{flex:"grow",children:[(0,l.Y)(b.EY.Meta,{color:"accent",children:n.name}),(0,l.Y)(ev.Z,{post:i,preset:"sm"})]}),(0,l.Y)(Y.pT,{flex:"auto",children:(0,l.Y)(ef.eu,{photoUrl:null!=(t=n.photo_url)?t:void 0,size:48})})]})});return r?o:(0,l.Y)("a",{href:i.canonical_url,style:{textDecoration:"none",display:"block"},children:o})};var e_=n(90456);function ey(e){let{items:t,excludedIds:n=[],order:i,fallbackSort:l}=e,r=new Set(n),o=t.filter(e=>!r.has(e.id));if(null==i?void 0:i.length){let e=new Map(i.map((e,t)=>[e,t]));return[...o].sort((t,n)=>{var i,l;return(null!=(i=e.get(t.id))?i:Number.MAX_SAFE_INTEGER)-(null!=(l=e.get(n.id))?l:Number.MAX_SAFE_INTEGER)})}return l?[...o].sort((e,t)=>l(e)-l(t)):o}let ew=e=>{let{contributors:t,latestPostByContributorId:n}=(0,a.useContext)(em.c),i=(0,a.useMemo)(()=>(null!=t?t:[]).filter(e=>e.name&&(null==n?void 0:n[e.id])),[t,n]);return{contributors:(0,a.useMemo)(()=>ey({items:i,excludedIds:null==e?void 0:e.excluded_user_ids,order:null==e?void 0:e.contributor_order}).slice(0,10),[i,e]),latestPostByContributorId:n}},ek=e=>{let{contributorSettings:t}=e,{iString:n}=(0,p.GO)(),{contributors:i,latestPostByContributorId:r}=ew(t);return(0,l.FD)(Y.I1,{gap:16,children:[(0,l.Y)(Y.Ye,{paddingX:8,children:(0,l.Y)(v.F,{children:n("The latest from")})}),(0,l.Y)(Y.I1,{gap:4,children:i.length?i.map(e=>(0,l.Y)(eb,{contributor:e,latestPost:null==r?void 0:r[e.id]},e.id)):(0,l.Y)(e_.v,{type:"contributor"})})]})};var eI=n(83673),eC=n.n(eI);let eS=e=>{let{children:t,dragOverlayId:n,id:r,onRemove:s}=e,{iString:d}=(0,p.GO)(),{isMobileEditor:c}=(0,L.T)(),{attributes:u,listeners:h,setNodeRef:m}=(0,M.PM)({id:r,disabled:c}),g=n===r,v=(0,a.useCallback)(e=>{e.stopPropagation(),null==s||s(r)},[r,s]);return c?t:(0,l.FD)("div",(0,Z._)((0,i._)({ref:m,className:o()("draggableItem-SJ4YDF",{[String("isDragging-jRLhA9")]:g}),"data-reorderable-id":r},u,h),{children:[(0,l.Y)("div",{className:"itemContent-boSI7u",children:t}),null===n&&(0,l.Y)(ee.O,{isDraggable:!0,label:d("Drag to reorder"),size:"sm",onClick:es(),onRemove:s?v:void 0})]}))};var eD=n(2404),eF=n.n(eD),ex=n(35755);function eP(e){let{items:t,title:n,onReorder:i,onRemove:r,renderItem:o,emptyStateType:s}=e,{iString:d}=(0,p.GO)(),{dragOverlayId:c,handleDragEnd:u,handleDragMove:h,handleDragStart:m,orderedItems:g,sensors:f}=function(e){let{items:t,getElement:n,onReorder:i}=e,[l,r]=(0,a.useState)(null),[o,s]=(0,a.useState)(null),[d,c]=(0,a.useState)([]),u=(0,a.useRef)([]),p=(0,a.useRef)(!1);(0,ex.h)(null!==l),(0,a.useEffect)(()=>{p.current&&(p.current=!1,r(null),s(null),c([]))},[t]);let h=(0,M.FR)((0,M.MS)(M.AN,{activationConstraint:{distance:5}})),m=(0,a.useCallback)(e=>{let i=e.active.id;r(i),s(i),c(t),u.current=(0,J.Fo)({items:t,draggedId:i,getElement:n})},[t,n]),g=(0,a.useCallback)(e=>{if(!l)return;let n=e.active.rect.current.translated;if(!n)return;let i=n.top+window.scrollY,r=(0,J.tG)({draggedY:i,thresholds:u.current}),o=(0,J.C3)({items:t,draggedId:l,targetIndex:r});c(e=>eF()(e,o)?e:o)},[l,t]),v=(0,a.useCallback)(()=>{if(u.current=[],l&&d.length>0&&d.some((e,n)=>e!==t[n])){p.current=!0,i(d);return}r(null),s(null),c([])},[l,t,i,d]),f=l&&d.length>0?d:t;return{activeDragId:l,dragOverlayId:o,handleDragEnd:v,handleDragMove:g,handleDragStart:m,orderedItems:f,sensors:h}}({items:t.map(e=>e.id),getElement:e=>document.querySelector('[data-reorderable-id="'.concat(e,'"]')),onReorder:i}),b=null!=c?t.find(e=>e.id===c):null,_=eC()(g.map(e=>t.find(t=>t.id===e)));return(0,l.FD)(Y.I1,{gap:16,children:[(0,l.Y)(Y.Ye,{paddingX:8,children:(0,l.Y)(v.F,{children:d(n)})}),(0,l.FD)(M.Mp,{sensors:f,onDragEnd:u,onDragMove:h,onDragStart:m,children:[(0,l.Y)(Y.I1,{gap:4,children:_.length?_.map(e=>(0,l.Y)(eS,{dragOverlayId:c,id:e.id,onRemove:r,children:o(e)},e.id)):(0,l.Y)(e_.v,{type:s})}),(0,l.Y)(M.Hd,{dropAnimation:null,children:b&&(0,l.Y)("div",{className:"dragOverlay-wQ1KF4",children:o(b)})})]})]})}let eT=e=>{let{contentBlock:t}=e,{iString:n}=(0,p.GO)(),{sendPreviewBlockUpdate:i}=(0,L.T)(),r=(0,O.MS)(t.id,"contributors"),o=(0,a.useCallback)(e=>{i({previewBlockId:{type:"sidebar-module",contentBlockId:t.id,moduleId:"contributors"},updates:{contributor_order:e}})},[t.id,i]),s=(0,a.useCallback)(e=>{i({previewBlockId:{type:"sidebar-module",contentBlockId:t.id,moduleId:"contributors"},updates:{_add_excluded_user_id:e}})},[t.id,i]),{contributors:d,latestPostByContributorId:c}=ew(t.attrs.contributors);return r?(0,l.Y)(eP,{emptyStateType:"contributor",items:d,renderItem:e=>(0,l.Y)(eb,{contributor:e,latestPost:null==c?void 0:c[e.id]}),title:n("The latest from"),onRemove:s,onReorder:o}):(0,l.Y)(ek,{contributorSettings:t.attrs.contributors})};var eA=n(39318);let eE="logo-ulupBr",eN="logo-64-VEaVRL",eB="logo-72-fFbpYn",eM="logo-auto-l6jK_D",eR=e=>{let{altText:t="Section logo",size:n=64,url:i,showPlaceholder:r}=e;return i?(0,l.Y)("img",{alt:t,className:o()(eE,{[eN]:64===n,[eB]:72===n,[eM]:"auto"===n}),src:(0,eA.dJ9)(i,"auto"===n?200:2*n)}):r?(0,l.Y)("div",{className:o()(eE,"logoPlaceholder-RbJEuS",{[eN]:64===n,[eB]:72===n,[eM]:"auto"===n})}):null};var eO=n(1117),eL=n(28528),ez=n(82776);let eU=e=>{let{pub:t}=(0,eL.np)(),n=(0,a.useMemo)(()=>t.sections.filter(e=>(0,ez.sectionIsSpecificallyMarkedAsNewsletter)({section:e,pub:t})||!e.is_podcast),[t]),i=(0,a.useMemo)(()=>ey({items:n,excludedIds:null==e?void 0:e.excluded_section_ids,order:null==e?void 0:e.section_order}),[n,e]),l=(0,a.useMemo)(()=>i.some(e=>e.logo_url),[i]);return{newsletters:i,allNewsletters:n,someNewslettersHaveLogos:l,pub:t}};var eH=n(49807);let eq=e=>{let{newsletterSettings:t}=e,{iString:n}=(0,p.GO)(),{newsletters:i,someNewslettersHaveLogos:r,pub:o}=eU(t);return(0,l.FD)(Y.I1,{gap:16,children:[(0,l.Y)(Y.Ye,{paddingX:8,children:(0,l.Y)(v.F,{children:n("Newsletters")})}),(0,l.Y)(Y.I1,{gap:4,children:i.length?i.map(e=>(0,l.Y)(eO.d,{image:e.logo_url||r?(0,l.Y)(eR,{altText:"Logo for ".concat(e.name),showPlaceholder:!0,size:64,url:e.logo_url}):null,pub:o,subtitle:e.description,title:e.name,url:(0,eH.Dor)(o,{section:e,addBase:!0})},e.id)):(0,l.Y)(e_.v,{type:"newsletter"})})]})},eG=e=>{let{contentBlock:t}=e,{iString:n}=(0,p.GO)(),{sendPreviewBlockUpdate:i}=(0,L.T)(),r=(0,O.MS)(t.id,"newsletters"),o=(0,a.useCallback)(e=>{i({previewBlockId:{type:"sidebar-module",contentBlockId:t.id,moduleId:"newsletters"},updates:{section_order:e}})},[t.id,i]),s=(0,a.useCallback)(e=>{i({previewBlockId:{type:"sidebar-module",contentBlockId:t.id,moduleId:"newsletters"},updates:{_add_excluded_section_id:e}})},[t.id,i]),{newsletters:d,someNewslettersHaveLogos:c,pub:u}=eU(t.attrs.newsletters);return r?(0,l.Y)(eP,{emptyStateType:"newsletter",items:d,renderItem:e=>(0,l.Y)(eO.d,{image:e.logo_url||c?(0,l.Y)(eR,{altText:"Logo for ".concat(e.name),showPlaceholder:!0,size:64,url:e.logo_url}):null,pub:u,subtitle:e.description,title:e.name,url:(0,eH.Dor)(u,{section:e,addBase:!0})}),title:n("Newsletters"),onRemove:s,onReorder:o}):(0,l.Y)(eq,{newsletterSettings:t.attrs.newsletters})};var eW=n(79785);function eK(){let e=(0,eW._)(["Logo for ",""]);return eK=function(){return e},e}let eV=e=>{let{latestPost:t,podcastArtUrl:n,podcastTitle:i,podcastUrl:r,showPlaceholder:o}=e,{iString:a,iTemplate:s}=(0,p.GO)(),d="undefined"==typeof window,c=t?t.canonical_url:r,u=(0,l.Y)(eY.u,{hoverBackground:"light",padding:8,radius:"sm",children:(0,l.FD)(Y.Ye,{alignItems:"start",gap:16,children:[(n||o)&&(0,l.Y)(Y.pT,{flex:"auto",children:(0,l.Y)(eR,{altText:s(eK(),i),showPlaceholder:!0,size:64,url:n})}),(0,l.FD)(Y.I1,{flex:"grow",children:[(0,l.Y)(b.EY.Meta,{color:"accent",children:i}),t?(0,l.Y)(ev.Z,{noIcons:!0,post:t,preset:"sm"}):(0,l.Y)(b.EY.B4,{color:"pub-secondary-text",paddingTop:8,style:{fontStyle:"italic"},children:a("Coming soon")})]})]})});return d?u:(0,l.Y)("a",{href:c,style:{textDecoration:"none",display:"block"},children:u})};var ej=n(24713),eX=n.n(ej);let eJ=e=>{let{contentBlock:t,pub:n}=e,i=t.attrs.podcasts,l=(0,a.useMemo)(()=>{let e=[];return n.podcast_enabled&&e.push({id:-1,name:n.podcast_title||n.name,description:n.podcast_description||"",logo_url:n.podcast_art_url,isPubPodcast:!0}),e.push(...n.sections.filter(e=>e.is_podcast).map(e=>({id:e.id,name:e.name,description:e.description||"",logo_url:e.logo_url,isPubPodcast:!1}))),e},[n]);return{podcasts:(0,a.useMemo)(()=>ey({items:l,excludedIds:null==i?void 0:i.excluded_section_ids,order:null==i?void 0:i.section_order,fallbackSort:e=>{var t;return e.isPubPodcast?-1:null!=(t=eX()(n.navigationBarItems,t=>t.section_id===e.id))?t:999}}),[l,n.navigationBarItems,i]),pub:n}},eZ=e=>{let{contentBlock:t}=e,{iString:n}=(0,p.GO)(),{pub:i}=(0,eL.np)(),{podcasts:r}=eJ({contentBlock:t,pub:i}),{latestPodcastPosts:o}=(0,a.useContext)(em.c);return(0,l.FD)(Y.I1,{gap:16,children:[(0,l.Y)(Y.Ye,{paddingX:8,children:(0,l.Y)(v.F,{children:n("Podcasts")})}),(0,l.Y)(Y.I1,{gap:4,children:r.length?r.map(e=>{var t,n;let r=e.isPubPodcast?null!=(t=null==o?void 0:o.pubPodcast)?t:null:null!=(n=null==o?void 0:o.sectionPodcasts[e.id])?n:null,a=e.isPubPodcast?null:i.sections.find(t=>t.id===e.id),s=e.isPubPodcast?(0,eA.t6y)({pub:i,section:null}):a?(0,eH.Dor)(i,{section:a,addBase:!0}):"#";return(0,l.Y)(eV,{latestPost:r,podcastArtUrl:e.logo_url,podcastSubtitle:e.description,podcastTitle:e.name,podcastUrl:s,showPlaceholder:!0},e.id)}):(0,l.Y)(e_.v,{type:"podcast"})})]})},eQ=e=>{let{contentBlock:t}=e,{iString:n}=(0,p.GO)(),{sendPreviewBlockUpdate:i}=(0,L.T)(),r=(0,O.MS)(t.id,"podcasts"),o=(0,a.useCallback)(e=>{i({previewBlockId:{type:"sidebar-module",contentBlockId:t.id,moduleId:"podcasts"},updates:{section_order:e}})},[t.id,i]),s=(0,a.useCallback)(e=>{i({previewBlockId:{type:"sidebar-module",contentBlockId:t.id,moduleId:"podcasts"},updates:{_add_excluded_section_id:e}})},[t.id,i]),{pub:d}=(0,eL.np)(),{podcasts:c}=eJ({contentBlock:t,pub:d}),{latestPodcastPosts:u}=(0,a.useContext)(em.c);return r?(0,l.Y)(eP,{emptyStateType:"podcast",items:c,renderItem:e=>{var t,n;return(0,l.Y)(eV,{latestPost:e.isPubPodcast?null!=(t=null==u?void 0:u.pubPodcast)?t:null:null!=(n=null==u?void 0:u.sectionPodcasts[e.id])?n:null,podcastArtUrl:e.logo_url,podcastSubtitle:e.description,podcastTitle:e.name,podcastUrl:(e=>{if(e.isPubPodcast)return(0,eA.t6y)({pub:d,section:null});let t=d.sections.find(t=>t.id===e.id);return t?(0,eH.Dor)(d,{section:t,addBase:!0}):"#"})(e),showPlaceholder:!0})},title:n("Podcasts"),onRemove:s,onReorder:o}):(0,l.Y)(eZ,{contentBlock:t})},e$=e=>{let{contentBlock:t,moduleId:n}=e;switch(n){case"subscribe":return(0,l.Y)(eh.V,{});case"recommendations":return(0,l.Y)(ep.l,{hideHeaderBorder:!0,showEmptyState:!0});case"links":return(0,l.Y)(ed.U,{hideHeaderBorder:!0,showEmptyState:!0});case"contributors":return(0,l.Y)(eT,{contentBlock:t});case"podcasts":return(0,l.Y)(eQ,{contentBlock:t});case"newsletters":return(0,l.Y)(eG,{contentBlock:t});case"polymarket-iframe":return(0,l.Y)(eu,{contentBlock:t});case"top-posts":return(0,l.Y)(eg,{topPostsSettings:t.attrs.top_posts});default:return null}},e0=e=>{var t;let{column:n,contentBlock:i,insertAtIndex:r,variant:o="default"}=e,{iString:s}=(0,p.GO)(),{isActive:d}=(0,E.H)(),{deactivatePreviewBlock:c,requestModulePicker:u}=(0,L.T)(),h=(0,T.md)(et.nJ),m=(0,a.useMemo)(()=>n?{type:"module-picker",parentContentBlockId:i.id,column:n,insertAtIndex:r}:null,[i.id,n,r]),g=m?(0,$.tP)(m):void 0,{isActive:v,clickAction:f}=(0,O.k6)(m),Y=(0,a.useCallback)(e=>{e.stopPropagation(),n&&(v?c():u({parentContentBlockId:i.id,column:n,insertAtIndex:r}))},[n,i.id,v,c,u,r]),b=v&&h&&h.contentBlockId===i.id&&h.column===n&&(null!=(t=h.insertAtIndex)?t:0)===r?h.moduleId:null;if(b){let e=0===r;return(0,l.FD)(l.FK,{children:[!e&&(0,l.Y)(eo,{disabled:!0,label:"",variant:"default",onClick:es()}),(0,l.Y)("div",{id:g,style:{padding:"12px 4px",margin:"-12px -4px"},children:(0,l.Y)(en,{column:n,contentBlockId:i.id,disabled:!0,dragId:d?(0,J.MJ)({column:n,moduleId:b}):void 0,moduleId:b,children:(0,l.Y)(e$,{contentBlock:i,moduleId:b})})}),(0,l.Y)(eo,{disabled:!0,label:"",variant:"default",onClick:es()})]})}let _=!m||"activate"!==f&&!v;return(0,l.Y)("div",{id:g,children:(0,l.Y)(eo,{disabled:_,isActive:v,label:s("Click to add module"),variant:o,onClick:Y})})},e1=e=>{let{column:t,insertAtIndex:n,variant:i="default"}=e,{iString:r}=(0,p.GO)(),{activeBlockId:o,isDragging:s}=(0,E.H)(),{isPreviewMode:d,requestModulePicker:c}=(0,L.T)(),u=(0,Q.Cd)(),h=!!(null==u?void 0:u.item),m=!o||!t||!d||s||h,g=(0,a.useCallback)(e=>{e.stopPropagation(),t&&o&&c({parentContentBlockId:o,column:t,insertAtIndex:n})},[t,o,c,n]);return(0,l.Y)(eo,{disabled:m,isActive:!1,label:r("Click to add module"),variant:i,onClick:g})},e2=e=>{let{ids:t,column:n,contentBlock:i}=e,{getColumnItems:r,isActive:o}=(0,E.H)();(0,T.md)(et.CL);let s=(0,O.JQ)(),d=(0,Q.kG)(),c=(null==d?void 0:d.type)==="module-picker"&&d.parentBlockId===i.id&&d.column===n,u=o?r(n):t;return 0===t.length&&o?c?(0,l.Y)(R,{column:n,children:(0,l.Y)(e0,{column:n,contentBlock:i,insertAtIndex:0})}):(0,l.Y)("div",{style:{pointerEvents:"auto",minHeight:100,height:"100%"},children:(0,l.Y)(z,{column:n})}):0===u.length?null:(0,l.Y)(R,{column:n,children:(0,l.FD)(Y.I1,{children:[u.map((e,t)=>(0,l.FD)(a.Fragment,{children:[(0,l.Y)(en,{column:n,contentBlockId:i.id,disabled:s!==i.id,dragId:o?(0,J.MJ)({column:n,moduleId:e}):void 0,moduleId:e,children:(0,l.Y)(e$,{contentBlock:i,moduleId:e})}),c&&t{var{contentBlock:t,posts:n,postsBySource:r,sourcePosts:o}=e,a=(0,P._)(e,["contentBlock","posts","postsBySource","sourcePosts"]);let s=t.secondary_sidebar_modules,d=t.primary_sidebar_modules;return(0,l.Y)(E.n,{attrs:t.attrs,contentBlockId:t.id,leftItems:null!=s?s:[],renderModule:e=>(0,l.Y)(e$,{contentBlock:t,moduleId:e}),rightItems:null!=d?d:[],children:(0,l.Y)(e6,(0,i._)({contentBlock:t,posts:n,postsBySource:r,sourcePosts:o},a))})},e6=e=>{var t;let n,i,r,{contentBlock:o,posts:s,postsBySource:d,pub:c,showSearch:u,showSeeAllLink:p,sourcePosts:h,title:g,viewAllUrl:v}=e,{isDesktop:f,isTablet:b,isMobile:_}=(0,m.sM)(),{isDragging:w}=(0,E.H)(),k=(0,T.md)(et.nJ),I=(0,T.md)(et.y2),C=(0,Q.kG)(),D=o.secondary_sidebar_modules,F=o.primary_sidebar_modules,x=D&&D.length>0,P=F&&F.length>0,A=(null==k?void 0:k.contentBlockId)===o.id&&(null==k?void 0:k.column)==="left",N=(null==k?void 0:k.contentBlockId)===o.id&&(null==k?void 0:k.column)==="right",B=(null==C?void 0:C.type)==="module-picker"&&C.parentBlockId===o.id&&"left"===C.column,M=(null==C?void 0:C.type)==="module-picker"&&C.parentBlockId===o.id&&"right"===C.column,R=x||w||A||B,O=P||w||N||M,L=(null==I?void 0:I.contentBlockId)===o.id?null==I?void 0:I.updates.num_rows:null,z=null!=(t=null!=L?L:o.num_rows)?t:S.AD.rows.default,U=null!=L&&h?h:s;f?(n=R?(0,l.Y)(e2,{column:"left",contentBlock:o,ids:null!=D?D:[]}):void 0,i=O?(0,l.Y)(e2,{column:"right",contentBlock:o,ids:null!=F?F:[]}):void 0,r=4-!!O-!!R):b?P?(i=(0,l.Y)(e2,{column:"right",contentBlock:o,ids:[...F,...null!=D?D:[]]}),r=2):x?(n=(0,l.Y)(e2,{column:"left",contentBlock:o,ids:D}),r=2):r=3:r=1;let H=d&&d.length>0,q="multiple"===o.post_source&&!H,G=r,J=H?(0,l.Y)(Y.I1,{gap:_?24:32,children:d.map((e,t)=>{var n,i;let o=e.source.title_override||(null==(n=e.source.section)?void 0:n.name)||(null==(i=e.source.post_tag)?void 0:i.name)||"",s=e.source.section?(0,eH.Dor)(c,{section:e.source.section}):e.source.post_tag?(0,eH.ii9)(c,e.source.post_tag):void 0,d=e.posts.length>=G;return(0,l.Y)(a.Fragment,{children:(0,l.FD)(Y.I1,{children:[o&&(0,l.Y)(y,{pub:c,showSearch:0===t&&u,title:o,viewAllUrl:d?s:void 0}),(0,l.Y)(X.C,{numColumns:r,posts:Array.from({length:G},(t,n)=>{var i;return null!=(i=e.posts[n])?i:null})})]})},"".concat(e.source.section_id||e.source.tag_id,"-").concat(t))})}):q?(0,l.FD)(l.FK,{children:[(0,l.Y)(Y.I1,{paddingBottom:16,paddingTop:4,paddingX:8,children:(0,l.Y)(V.x,{size:"lg",width:"20%"})}),(0,l.Y)(X.C,{numColumns:r,posts:Array.from({length:r},()=>null)})]}):(0,l.FD)(l.FK,{children:[g&&(0,l.Y)(y,{pub:c,showSearch:u,title:g,viewAllUrl:U.length>=r*z?v:void 0}),(0,l.Y)(X.C,{numColumns:r,posts:Array.from({length:r*z},(e,t)=>{var n;return null!=(n=U[t])?n:null})}),p&&v&&U.length>=r*z&&(0,l.Y)(j.k,{url:v})]});return(0,l.Y)(W,{emptyLeft:!R,emptyRight:!O,children:(0,l.Y)(K.I,{leftContent:n,mainContent:J,rightContent:i,stretchToFullWidth:!0})})},e7=e=>{var{contentBlock:t,posts:n,sourcePosts:r}=e,o=(0,P._)(e,["contentBlock","posts","sourcePosts"]);let a=t.secondary_sidebar_modules,s=t.primary_sidebar_modules;return(0,l.Y)(E.n,{attrs:t.attrs,contentBlockId:t.id,leftItems:null!=a?a:[],renderModule:e=>(0,l.Y)(e$,{contentBlock:t,moduleId:e}),rightItems:null!=s?s:[],children:(0,l.Y)(e8,(0,i._)({contentBlock:t,posts:n,sourcePosts:r},o))})},e8=e=>{var t;let n,i,r,{contentBlock:o,posts:a,pub:s,showSearch:d,showSeeAllLink:c,sourcePosts:u,title:p,viewAllUrl:h}=e,{isTablet:g,isDesktop:v}=(0,m.sM)(),{activeBlockId:f}=(0,E.H)(),{isPreviewMode:Y}=(0,L.T)(),b=(0,T.md)(et.nJ),_=(0,T.md)(et.y2),w=o.secondary_sidebar_modules,k=o.primary_sidebar_modules,I=(null==_?void 0:_.contentBlockId)===o.id?null==_?void 0:_.updates.num_posts:null,D=null!=(t=null!=I?I:o.num_posts)?t:S.AD.posts.default,F=(null==w?void 0:w.includes("polymarket-iframe"))||(null==k?void 0:k.includes("polymarket-iframe"));if(null!=I&&u){let e=new Set(a.filter(e=>null!==e).map(e=>e.id)),t=u.filter(t=>!e.has(t.id)),i=0;n=Array.from({length:D},(e,n)=>{var l,r;return n{var n;return null!=(n=a[t])?n:null});let x=n.filter(e=>null!==e),P=x.length>0&&x.every(e=>!e.cover_image),A=x.length>=D,N=w&&w.length>0,B=k&&k.length>0,M=(null==b?void 0:b.contentBlockId)===o.id&&(null==b?void 0:b.column)==="left",R=(null==b?void 0:b.contentBlockId)===o.id&&(null==b?void 0:b.column)==="right",O=(0,l.FD)(l.FK,{children:[p&&(0,l.Y)(y,{pub:s,showSearch:d,title:p,viewAllUrl:A?h:void 0}),(0,l.Y)(C.m,{hideImages:P,posts:n,variant:"two-column-list"}),c&&h&&A&&(0,l.Y)(j.k,{url:h})]});return v?(i=N||f||M?(0,l.Y)(e2,{column:"left",contentBlock:o,ids:null!=w?w:[]}):void 0,r=B||f||R?(0,l.Y)(e2,{column:"right",contentBlock:o,ids:null!=k?k:[]}):void 0):g&&(B?r=(0,l.Y)(e2,{column:"right",contentBlock:o,ids:[...k,...null!=w?w:[]]}):N&&(i=(0,l.Y)(e2,{column:"left",contentBlock:o,ids:w}))),(0,l.Y)(K.I,{animateColumns:Y,hasPolymarketEmbed:F,leftContent:i,mainContent:O,rightContent:r})};var e3=n(53989),e9=n(85478),e5=n(56458);function te(e){let{contentBlock:t,freeSignup:n,pub:i,pubSettings:l,siteConfigs:r,user:o}=e,a=n||(null==o?void 0:o.is_free_subscribed),s="enabled"===i.payments_state,d=!r.getConfigFor("pledges_disabled")&&!!l.getSettingFor("payment_pledges_enabled"),c=null==o?void 0:o.is_subscribed,u=null==o?void 0:o.is_founding,p=(0,e5.QN)(i);return{cta:a?s?c?!u&&p?"upgrade_founding":"gift":"upgrade":d?"pledge":null:"subscribe",message:u&&p?t.attrs.founding_member_message:c&&s?t.attrs.paid_subscriber_message:a?t.attrs.free_subscriber_message:t.attrs.non_subscriber_message}}var tt=n(45974),tn=n(41086),ti=n(57324);let tl="outerContainer-cCKm5T",tr="innerContainer-hMBAPa",to="balancedText-exEuQC";function ta(e){let{contentBlock:t}=e,{iString:n}=(0,p.GO)(),{freeSignup:i}=(0,a.useContext)(em.c),{pub:r,user:s}=(0,eL.np)(),d=(0,e9.mJ)(),c=(0,e3.Pu)(),{isMobile:h}=(0,m.sM)(),{cta:g,message:v}=te({contentBlock:t,freeSignup:i,pub:r,pubSettings:c,siteConfigs:d,user:s}),_=(0,eH.eV6)(r,{addBase:!0,user:s,params:{utm_source:ti.VU.subscribeContentBlock,simple:!0,next:document.location.href,referring_pub_ids:(0,tn.y)("referring_pub_ids")}}),y=(0,eH.RKl)({pub:r,user:s,params:{utm_source:ti.VU.subscribeContentBlock,next:document.location.href}}),w=(0,eH.LG3)({pub:r});return(0,l.Y)("div",{className:o()(tl,"outerContainer-g3bqCp"),children:(0,l.Y)(u.DH,{prefix:"subscribe",children:(0,l.Y)(ec.az,{className:tr,paddingY:40,children:(0,l.FD)(Y.Ye,{alignItems:"center",direction:h?"column":"row",gap:h?16:40,justifyContent:"space-between",paddingX:8,children:[(0,l.FD)(Y.Ye,{alignItems:"center",className:"logoContainer-ovXkHt",gap:4,children:[(0,l.Y)(tt.wg,{pub:r,size:56}),!h&&(0,l.Y)(b.EY,{color:"primary",font:"pub-headings",nowrap:!0,size:20,children:"The Bulwark +"})]}),v&&(0,l.Y)(Y.Ye,{alignItems:"center",direction:h?"column":"row",gap:8,children:(0,l.Y)(b.EY,{align:"center",className:"message-oSd3Dg",color:"primary",font:"pub-headings",lineHeight:30,size:20,children:(0,ez.preventOrphans)(v)})}),g&&(0,l.Y)(ec.az,{className:"ctaContainer-UVP2j6",flex:"auto",children:"subscribe"===g||"upgrade"===g?(0,l.Y)(f.$n,{href:_,localNavigation:!1,priority:"primary",children:"Join Bulwark +"}):"upgrade_founding"===g?(0,l.Y)(f.$n,{href:y,localNavigation:!1,priority:"primary",children:n("Upgrade to founding")}):"pledge"===g?(0,l.Y)(f.$n,{href:_,localNavigation:!1,priority:"primary",children:n("Pledge your support")}):"gift"===g?(0,l.Y)(f.$n,{href:w,localNavigation:!1,priority:"primary",children:n("Gift a subscription")}):null})]})})})})}var ts=n(72682);function td(e){var t,n,i,r,s,d,c;let{contentBlock:h}=e,{iString:g}=(0,p.GO)(),{freeSignup:v}=(0,a.useContext)(em.c),{pub:_,user:y}=(0,eL.np)(),w=(0,e9.mJ)(),k=(0,e3.Pu)(),{isMobile:I}=(0,m.sM)(),C=null==(n=_.theme)||null==(t=n.custom_subscribe)?void 0:t.imageUrl,S=null!=(d=null==(r=_.theme)||null==(i=r.custom_subscribe)?void 0:i.imageSize)?d:320,D=["e_trim:10:white","e_trim:10:transparent"],F=C?(0,eH.dJ9)(C,null,{height:2*S,crop:"limit",leadingSegments:D}):null,x=C?(0,eH.dJ9)(C,null,{height:160,crop:"limit",leadingSegments:D}):null,P=null!=(c=null==(s=h.attrs)?void 0:s.subscribe_layout)?c:"inline",T=F&&("image-left"===P||"image-right"===P),A=v||(null==y?void 0:y.is_free_subscribed),E=null==y?void 0:y.is_pledged,N=!w.getConfigFor("pledges_disabled")&&!!k.getSettingFor("payment_pledges_enabled"),{cta:B,message:M}=te({contentBlock:h,freeSignup:v,pub:_,pubSettings:k,siteConfigs:w,user:y}),R=(0,eH.eV6)(_,{params:{utm_source:ti.VU.subscribeContentBlock,gift:!0,next:document.location.href}}),O=(0,eH.eV6)(_,{addBase:!0,user:y,params:{utm_source:ti.VU.subscribeContentBlock,simple:!0,next:document.location.href,referring_pub_ids:(0,tn.y)("referring_pub_ids")}}),L=(0,eH.RKl)({pub:_,user:y,params:{utm_source:ti.VU.subscribeContentBlock,next:document.location.href}}),z=B?"subscribe"===B||"upgrade"===B?(0,l.Y)(f.$n,{href:O,localNavigation:!1,priority:"primary",children:(0,ez.getSubscribeText)(_,{isFreeSubscribed:A,isPledged:E,pledgesEnabled:N})}):"upgrade_founding"===B?(0,l.Y)(f.$n,{href:L,localNavigation:!1,priority:"primary",children:g("Upgrade to founding")}):"pledge"===B?(0,l.Y)(f.$n,{href:O,localNavigation:!1,priority:"primary",children:g("Pledge your support")}):"gift"===B?(0,l.Y)(f.$n,{href:R,localNavigation:!1,priority:"primary",children:g("Gift a subscription")}):null:null;return(0,l.Y)("div",{className:tl,children:(0,l.Y)(u.DH,{prefix:"subscribe",children:(0,l.Y)(ec.az,{className:tr,paddingY:I?40:48,children:T&&!I?(0,l.FD)(Y.Ye,{alignItems:"center",direction:"image-right"===P?"row-reverse":"row",gap:40,paddingX:8,children:[(0,l.Y)(Y.Ye,{className:"twoColumnImageContainer-OGPLlV",justifyContent:"image-right"===P?"end":"start",children:(0,l.Y)(ts.c,{anchor:"image-left"===P?"left":"right",max:320,min:40,property:"subscribeImageSize",value:S,children:e=>(0,l.Y)("img",{alt:_.name,className:"image-right"===P?"twoColumnImageRight-H8XjaP":"twoColumnImage-YSNrg_",src:F,style:{maxHeight:e}})})}),(0,l.FD)(Y.I1,{alignItems:"image-left"===P?"end":"start",className:"twoColumnContent-nJljVo",flex:"grow",gap:16,children:[M&&(0,l.Y)(b.EY,{align:"image-left"===P?"right":"left",className:to,color:"primary",font:"pub-headings",lineHeight:30,size:24,children:(0,ez.preventOrphans)(M)}),z&&(0,l.Y)(ec.az,{children:z})]})]}):(0,l.FD)(Y.Ye,{alignItems:"center",direction:I?"column":"row",gap:I?F?16:24:40,justifyContent:F?"space-between":"center",paddingX:8,children:[F&&(0,l.Y)(ec.az,{className:"imageContainer-qbzxmD",children:(0,l.Y)("img",{alt:_.name,className:"subscribeImage-Igd_9i",src:null!=x?x:void 0})}),M&&(0,l.Y)(Y.Ye,{alignItems:"center",direction:I?"column":"row",gap:8,children:(0,l.Y)(b.EY,{align:F||I?"center":"left",className:to,color:"primary",font:"pub-headings",lineHeight:30,size:F?20:24,children:(0,ez.preventOrphans)(M)})}),z&&(0,l.Y)(ec.az,{className:o()(F&&"ctaContainerBalanced-SYVfwN"),flex:F?void 0:"auto",children:z})]})})})})}let tc=e=>{let{contentBlock:t}=e,{pub:n}=(0,eL.np)();return(0,_.s7)({pub:n,includeTheRampart:!0})?(0,l.Y)(ta,{contentBlock:t}):(0,l.Y)(td,{contentBlock:t})};var tu=n(11574),tp=n(77433),th=n(60355);let tm=e=>{let{posts:t,title:n,viewAllUrl:i}=e,{isMobile:r,isTablet:o}=(0,m.sM)();return r?(0,l.Y)(tg,{posts:t,title:n,viewAllUrl:i}):(0,l.FD)(Y.I1,{gap:40,children:[(0,l.Y)(tp.M,{title:n,titlePreset:"st2"}),(0,l.FD)(Y.I1,{gap:32,children:[t[0]&&(0,l.Y)(th.R,{post:t[0],titlePreset:"h4-sans-condensed",variant:"content-block-listing"}),(0,l.Y)(Y.Ye,{gap:40,children:t.slice(1,o?3:4).map(e=>(0,l.Y)(Y.I1,{borderTop:"detail-themed",flex:"grow",paddingTop:32,children:(0,l.Y)(th.R,{post:e,variant:"mini"})}))})]})]})},tg=e=>{let{posts:t,title:n,viewAllUrl:i}=e;return(0,l.FD)(Y.I1,{gap:20,children:[(0,l.Y)(tp.M,{title:n,titlePreset:"st2",viewAllUrl:i}),(0,l.FD)(Y.I1,{gap:32,children:[t[0]&&(0,l.Y)(th.R,{align:"left",post:t[0],titlePreset:"h3-condensed",variant:"large"}),(0,l.Y)(Y.I1,{children:t.slice(1,4).map(e=>(0,l.Y)(Y.I1,{borderTop:"detail-themed",paddingY:16,children:(0,l.Y)(th.R,{post:e,variant:"mini"})}))})]})]})};var tv=n(33031),tf=n.n(tv),tY=n(60250),tb=n(87677),t_=n(33764),ty=n(15894),tw=n(77124),tk=n(95691),tI=n(57753),tC=n(74894),tS=n(95294);let tD="panel-K8JY99",tF="navButton-hcrBJt",tx="primaryButton-AbjjpI",tP="secondaryButton-GUipKK",tT="podcastArt-U81yKg",tA=e=>{var t,n,i,r,o,s,d,c,u,p,h,g;let{contentBlock:v}=e,{isMobile:f}=(0,m.sM)(),{pub:b}=(0,eL.np)(),{sections:_,metadata:y}=(0,tk.P)({pub:b}),{ids:w,metadata:k}=(0,tw.q)({pub:b}),{latestPodcastPosts:I}=(0,a.useContext)(em.c),[C,S]=(0,a.useState)(2),[D,F]=(0,a.useState)(!1),[x,P]=(0,a.useState)(0),T=(0,a.useRef)(null),A=(0,a.useRef)(null),E=(0,a.useRef)(null),N=(0,a.useRef)(null),B=(null==(n=v.attrs)||null==(t=n.media_carousel)?void 0:t.variant)==="videos"?"videos":"podcasts",M=(0,tC.Zu)(b).filter(e=>{var t;return!!e.sectionId&&w.includes(null!=(t=e.sectionId)?t:-1)}),R=tf()(M,e=>{var t;return w.indexOf(null!=(t=e.sectionId)?t:-1)}),O="podcasts"===B?R.length:_.length,L=[...R.slice(-2),...R,...R.slice(0,2)],z=[..._.slice(-2),..._,..._.slice(0,2)],U=()=>{S(e=>e+1)},H=()=>{S(e=>e-1)};return((0,a.useEffect)(()=>{1===C?setTimeout(()=>{F(!0),S(O+1),setTimeout(()=>{F(!1)},100)},300):C===O+2&&setTimeout(()=>{F(!0),S(2),setTimeout(()=>{F(!1)},100)},300)},[C,O]),0===O)?null:1===O?"podcasts"===B&&R[0]?(0,l.Y)(tN,{colorString:null!=(s=null==(i=k[null!=(o=R[0].sectionId)?o:"pub"])?void 0:i.carouselColor)?s:"black",podcast:R[0],post:R[0].sectionId?null!=(d=null==I||null==(r=I.sectionPodcasts)?void 0:r[R[0].sectionId])?d:null:null!=(c=null==I?void 0:I.pubPodcast)?c:null}):"videos"===B&&_[0]?(0,l.Y)(tE,{colorString:null!=(h=null==(u=y[_[0].id])?void 0:u.carouselColor)?h:"black",post:null!=(g=null==I||null==(p=I.sectionPodcasts)?void 0:p[_[0].id])?g:null,section:_[0]}):null:(0,l.FD)(Y.I1,{gap:16,children:[f&&(0,l.Y)(ty.T,{align:"center",preset:"st2",children:"podcasts"===B?"Listen to Our Latest":"Scroll Through Our Shows"}),(0,l.FD)(Y.I1,{className:"container-opjHc4",children:[!f&&(0,l.Y)("div",{className:tF,role:"button",onClick:H,children:(0,l.Y)(tY.A,{size:32,strokeWidth:1.5})}),(0,l.Y)(Y.Ye,{className:"track-bJrNCJ",style:{transform:"translateX(calc(".concat(f?32+64*C:80+160*C,"px - ").concat(100*C,"% + ").concat(x,"px))"),transition:D||0!==x?"none":f?"transform 0.15s ease-out":"transform 0.3s ease-in-out"},onTouchEnd:f?()=>{if(null===T.current||null===E.current||null===A.current||null===N.current)return void P(0);let e=E.current-T.current;Math.abs(e)>Math.abs(N.current-A.current)&&Math.abs(e)>50&&(e>0?H():U()),P(0)}:void 0,onTouchMove:f?e=>{var t,n,i,l;if(E.current=null!=(i=null==(t=e.touches[0])?void 0:t.clientX)?i:null,N.current=null!=(l=null==(n=e.touches[0])?void 0:n.clientY)?l:null,null!==T.current&&null!==A.current&&null!==E.current&&null!==N.current){let t=E.current-T.current;Math.abs(t)>Math.abs(N.current-A.current)&&(e.preventDefault(),P(t))}}:void 0,onTouchStart:f?e=>{var t,n,i,l;T.current=null!=(i=null==(t=e.touches[0])?void 0:t.clientX)?i:null,A.current=null!=(l=null==(n=e.touches[0])?void 0:n.clientY)?l:null,E.current=null,N.current=null,P(0)}:void 0,children:"podcasts"===B?L.map(e=>{var t,n,i,r,o,a;return(0,l.Y)("div",{className:tD,children:(0,l.Y)(tN,{colorString:null!=(r=null==(t=k[null!=(i=e.sectionId)?i:-1])?void 0:t.carouselColor)?r:"black",podcast:e,post:e.sectionId?null!=(o=null==I||null==(n=I.sectionPodcasts)?void 0:n[e.sectionId])?o:null:null!=(a=null==I?void 0:I.pubPodcast)?a:null})})}):z.map(e=>{var t,n,i,r;return(0,l.Y)("div",{className:tD,children:(0,l.Y)(tE,{colorString:null!=(i=null==(t=y[e.id])?void 0:t.carouselColor)?i:"black",post:null!=(r=null==I||null==(n=I.sectionPodcasts)?void 0:n[e.id])?r:null,section:e})})})}),!f&&(0,l.Y)("div",{className:tF,role:"button",onClick:U,children:(0,l.Y)(tb.A,{size:32,strokeWidth:1.5})})]})]})},tE=e=>{var t;let{colorString:n,post:i,section:r}=e,{pub:o}=(0,eL.np)(),{isMobile:a}=(0,m.sM)(),s=(0,eH.Dor)(o,{section:r}),d=null!=(t=tI.Q3[n])?t:tI.Q3.black,c=d.hex;return(0,l.Y)(Y.I1,{style:{backgroundColor:c,height:"100%"},children:a?(0,l.Y)(Y.I1,{alignItems:"center",className:"videoPanelContentMobile-r5D1RZ",paddingX:16,paddingY:24,children:(0,l.Y)(tM,{image:i&&(0,l.Y)(tS.D,{imageAspectRatio:16/9,imageWidth:1080,isBelowTheFold:!0,post:i}),isInverted:d.invertTextColors,post:i,sectionName:r.name,sectionOrPodcastUrl:s})}):(0,l.FD)(Y.Ye,{alignItems:"center",className:"videoPanelContentDesktop-ecA07Z",paddingX:64,paddingY:32,children:[(0,l.Y)(tB,{isInverted:d.invertTextColors,isVideo:!0,post:i,sectionTitle:r.name,sectionUrl:s}),(0,l.Y)(Y.I1,{flex:"grow",paddingRight:8,children:i&&(0,l.Y)(tS.D,{imageAspectRatio:16/9,imageWidth:1080,isBelowTheFold:!0,post:i})})]})})},tN=e=>{var t,n,i;let{colorString:r,podcast:o,post:a}=e,{isMobile:s}=(0,m.sM)(),{pub:d}=(0,eL.np)(),c=(0,eA.t6y)({pub:d,section:o.sectionId&&null!=(i=d.sections.find(e=>e.id===o.sectionId))?i:null}),u=null==(t=tI.Q3[r])?void 0:t.hex,p=null==(n=tI.Q3[r])?void 0:n.invertTextColors;return(0,l.Y)(Y.I1,{style:{backgroundColor:u,height:"100%"},children:s?(0,l.Y)(Y.I1,{alignItems:"center",className:"podcastPanelContentMobile-En_Ak9",paddingX:16,paddingY:24,children:(0,l.Y)(tM,{image:o.artUrl?(0,l.Y)(t_.o,{className:tT,maxWidth:360,src:o.artUrl}):null,isInverted:p,post:a,sectionName:o.podcastTitle,sectionOrPodcastUrl:c})}):(0,l.FD)(Y.Ye,{alignItems:"center",className:"podcastPanelContentDesktop-NIL93C",gap:40,justifyContent:"center",paddingX:64,paddingY:32,children:[o.artUrl&&(0,l.Y)(t_.o,{className:tT,maxWidth:300,src:o.artUrl}),(0,l.Y)(tB,{isInverted:p,isVideo:!1,post:a,sectionTitle:o.podcastTitle,sectionUrl:c})]})})},tB=e=>{let{isInverted:t,isVideo:n,post:i,sectionTitle:r,sectionUrl:o}=e,a=t?"white":"primary";return(0,l.FD)(Y.I1,{gap:24,paddingLeft:8,style:{width:426},children:[(0,l.Y)(Y.I1,{paddingBottom:8,style:{borderBottom:"1px solid ".concat(t?"white":"var(--color-fg-primary-themed)")},children:(0,l.Y)(ty.T,{color:a,preset:"h6-serif",children:r})}),(0,l.FD)(Y.I1,{gap:24,children:[i&&(0,l.FD)(Y.I1,{gap:12,children:[(0,l.Y)(ty.T,{clamp:2,color:a,preset:"h6-sans",children:i.title}),(0,l.Y)(ty.T,{clamp:3,color:a,preset:"d3-serif",children:i.description})]}),(0,l.FD)(Y.Ye,{alignItems:"center",gap:16,children:[i&&(0,l.Y)(ty.T,{as:"a",href:i.canonical_url,preset:"detail-large",children:(0,l.Y)(Y.Ye,{className:tx,padding:16,children:n?"Watch now":"Listen now"})}),(0,l.Y)(ty.T,{as:"a",className:tP,color:a,href:o,preset:"detail-large",children:"View all episodes"})]})]})]})},tM=e=>{let{image:t,isInverted:n,post:i,sectionName:r,sectionOrPodcastUrl:o}=e,a=n?"white":"primary";return(0,l.FD)(Y.I1,{alignItems:"center",gap:16,children:[(0,l.Y)(ty.T,{color:a,preset:"h6-serif",children:r}),(0,l.FD)(Y.I1,{gap:32,children:[i&&(0,l.FD)(Y.I1,{alignItems:"center",gap:28,children:[t,(0,l.FD)(Y.I1,{gap:8,children:[(0,l.Y)(ty.T,{align:"center",clamp:2,color:a,preset:"h4-sans-condensed",children:i.title}),(0,l.Y)(ty.T,{align:"center",clamp:3,color:a,preset:"d3-serif",children:i.description})]})]}),(0,l.FD)(Y.I1,{alignItems:"center",gap:16,children:[i&&(0,l.Y)(ty.T,{as:"a",href:i.canonical_url,preset:"detail-large",children:(0,l.Y)(Y.Ye,{className:tx,padding:16,children:"Watch now"})}),(0,l.Y)(ty.T,{as:"a",className:tP,color:a,href:o,preset:"detail-large",children:"View all episodes"})]})]})]})};var tR=n(78956);let tO="miniPost-O80hP6",tL=e=>{let{posts:t}=e,{latestPostFromSections:n}=(0,a.useContext)(em.c),{isMobile:i}=(0,m.sM)(),{pub:r}=(0,eL.np)(),o=(0,_.JQ)({pub:r}),s=eC()(o.map(e=>null==n?void 0:n[e]));return i?(0,l.Y)(tz,{posts:t,sectionPosts:s}):(0,l.FD)("div",{className:"container-YOdLMp",children:[(0,l.FD)(Y.Ye,{className:"podcastEpisodeContainer-nd115M",gap:20,children:[t[0]&&(0,l.Y)(th.R,{post:t[0],variant:"content-block-episode"}),(0,l.Y)(Y.I1,{children:(0,l.Y)(tR.A,{gap:24,children:s.map(e=>(0,l.Y)(th.R,{hideUfi:!0,post:e,showStar:!0,variant:"mini"}))})})]}),(0,l.FD)("div",{className:"plusThreeContainer-VOEUMx",children:[t[1]&&(0,l.Y)(th.R,{post:t[1],titlePreset:"h6-sans",variant:"content-block-listing"}),(0,l.FD)(Y.Ye,{gap:40,children:[t[2]&&(0,l.Y)("div",{className:tO,children:(0,l.Y)(th.R,{post:t[2],showDescription:!0,variant:"mini"})}),t[3]&&(0,l.Y)("div",{className:tO,children:(0,l.Y)(th.R,{post:t[3],showDescription:!0,variant:"mini"})})]})]})]})},tz=e=>{let{posts:t,sectionPosts:n}=e;return(0,l.FD)(Y.I1,{gap:32,children:[t[0]&&(0,l.Y)(th.R,{post:t[0],variant:"content-block-episode"}),(0,l.Y)(tR.A,{gap:24,includeBottomDivider:!0,includeTopDivider:!0,children:n.map(e=>(0,l.Y)(th.R,{post:e,showStar:!0,variant:"mini"}))}),t[1]&&(0,l.Y)(th.R,{post:t[1],variant:"content-block-listing"}),(0,l.FD)(Y.Ye,{gap:24,children:[t[2]&&(0,l.Y)(Y.Ye,{flex:"grow",children:(0,l.Y)(th.R,{post:t[2],variant:"mini"})}),t[3]&&(0,l.Y)(Y.Ye,{flex:"grow",children:(0,l.Y)(th.R,{post:t[3],variant:"mini"})})]})]})},tU=e=>{let{posts:t}=e;return t[0]?(0,l.Y)(Y.I1,{className:"container-nYRgUV",children:(0,l.Y)(th.R,{post:t[0],variant:"content-block-single-large"})}):null};var tH=n(53971),tq=n(81209),tG=n(63446),tW=n(92636),tK=n(39891);let tV=()=>{let{isMobile:e,isTablet:t}=(0,m.sM)(),{freeSignup:n,freeSignupEmail:i}=(0,a.useContext)(em.c),{pub:r,user:o}=(0,eL.np)();return(0,l.FD)(Y.I1,{alignItems:"center",className:"container-liQ2Vy",gap:24,justifyContent:"center",paddingX:t?16:40,style:{backgroundImage:"url(".concat((0,tK.dJ)("".concat((0,tW.Ew)(),"/img/thefp/fp-subscribe-block-bg.jpg"),304),")"),backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundBlendMode:"multiply"},children:[(0,l.Y)(ty.T,{align:"center",color:"white",preset:e?"lg-preview-byline":"h6-sans",children:(null==o?void 0:o.is_subscribed)?(0,l.FD)(l.FK,{children:["Share ",(0,l.Y)("em",{children:"The Free Press"})," with other free thinkers."]}):(null==o?void 0:o.is_free_subscribed)?"Become a Paid Subscriber to access our comments section, special columns, and more.":(0,l.FD)(l.FK,{children:["Sign up for your daily window into the world of ",(0,l.Y)("em",{children:"The Free Press"}),"—and our take on the world at large"]})}),(0,l.Y)("div",{children:(null==o?void 0:o.is_subscribed)?(0,l.Y)(tG.v,{href:(0,eA.eV6)(r,{utm_source:ti.VU.subscribeContentBlock,gift:!0,next:document.location.href,addBase:!0}),native:!0,variant:"primary-accent",children:"Send Gift"}):(null==o?void 0:o.is_free_subscribed)?(0,l.Y)(tG.v,{href:(0,eA.eV6)(r,{utm_source:ti.VU.freePressPromoBox,simple:!0,next:document.location.href,addBase:!0}),native:!0,variant:"primary-accent",children:"Upgrade"}):(0,l.Y)(tq.A,{align:"left",expectTruncation:!0,freeSignup:n,freeSignupEmail:i,isStatic:!1,pub:r,source:"the-fp-subscribe-block",user:o})})]})};var tj=n(18947);let tX=()=>{let{isMobile:e}=(0,m.sM)();return(0,l.FD)("div",{className:o()("container-Q2UekY",{"containerMobile-op5rRO":e}),children:[(0,l.Y)(tJ,{}),(0,l.Y)(tZ,{}),(0,l.Y)(tV,{})]})},tJ=()=>(0,l.Y)("a",{className:o()("promoContainer-M2SbsD","merchContainer-rvwMsY"),href:"https://shop.thefp.com/",rel:"noopener noreferrer",target:"_blank",children:(0,l.FD)(Y.I1,{justifyContent:"space-between",padding:32,children:[(0,l.FD)(ty.T,{color:"white",preset:"h5-serif",children:["Get (or give!) a",(0,l.Y)("br",{}),"Free Press hat,",(0,l.Y)("br",{}),"tote, or TGIF socks."]}),(0,l.FD)(Y.Ye,{alignItems:"center",gap:8,children:[(0,l.Y)(ty.T,{color:"white",preset:"detail-large",children:"Shop Merch"}),(0,l.Y)(tH.A,{size:16,stroke:"white"})]}),(0,l.Y)("img",{alt:"Socks",className:"merchSocks-lut01J",src:(0,tK.dJ)("".concat((0,tW.Ew)(),"/img/thefp/thefp-socks.png"))})]})}),tZ=()=>{let{pub:e}=(0,eL.np)(),t=(0,tj.st)(e,"fp-cupid");return(0,l.Y)("a",{"aria-label":"Free Press Cupid",className:"cupidContainer-XRgiVQ",href:t,children:(0,l.Y)("img",{alt:"Free Press Cupid",className:"cupidImage-dyHUIU",loading:"lazy",src:(0,tK.dJ)("".concat((0,tW.Ew)(),"/img/thefp/fp-cupid-2.jpg"))})})},tQ=(0,a.memo)(e=>{let{contentBlock:t,posts:n,postsBySource:i,pub:r,showSearch:o=!1,showSeeAllLink:a,sourcePosts:s,title:d,viewAllUrl:c}=e,u=(0,_.lu)({pub:r}),p=n.filter(e=>null!==e);if("list"===t.block_type)return(0,l.Y)(e7,{contentBlock:t,posts:n,pub:r,showSearch:o,showSeeAllLink:a,sourcePosts:s,title:d,viewAllUrl:c});if("grid"===t.block_type)return(0,l.Y)(e4,{contentBlock:t,posts:n,postsBySource:i,pub:r,showSearch:o,showSeeAllLink:a,sourcePosts:s,title:d,viewAllUrl:c});if("feature"===t.block_type){var h;let e=null==(h=t.attrs.feature)?void 0:h.variant;return u?(0,l.Y)(tu.$,{posts:p,title:d,variant:e,viewAllUrl:c}):(0,l.Y)(F,{posts:n,pub:r,showSearch:o,title:d,variant:e,viewAllUrl:c})}return"subscribe"===t.block_type?(0,l.Y)(tc,{contentBlock:t}):"podcast_plus_three"===t.block_type?(0,l.Y)(tL,{posts:p}):"subscribe_plus_five"===t.block_type?(0,l.Y)(tX,{}):"single_post"===t.block_type?(0,l.Y)(tU,{posts:p}):"half_feature"===t.block_type?(0,l.Y)(tm,{posts:p,title:d,viewAllUrl:c}):"media_carousel"===t.block_type?(0,l.Y)(tA,{contentBlock:t}):null});var t$=n(24634);let t0=()=>(0,l.Y)(ec.az,{paddingBottom:120,children:(0,l.Y)(K.I,{leftContent:(0,l.Y)("div",{children:"\xa0"}),mainContent:(0,l.Y)(t$.t,{postCount:4,variant:"list"}),rightContent:(0,l.Y)("div",{children:"\xa0"})})});var t1=n(55364),t2=n.n(t1),t4=n(25112);let t6={contentBlocks:[],postsBySectionId:{},postsByTagId:{},postsForContentBlockPins:{},postsByContentBlockId:void 0};var t7=n(7761),t8=n(9624),t3=n(90839);let t9=e=>{let{insertAfterIndex:t,previewBlockData:n,pub:i,spaceHeight:r,variant:o="default"}=e,{iString:s}=(0,p.GO)(),{deactivatePreviewBlock:d,isPreviewMode:c,requestBlockPicker:u,hasReceivedInitialPreviewUIState:h}=(0,L.T)(),m=(0,T.md)(et.lw),g=(0,a.useMemo)(()=>({type:"block-picker",insertAfterIndex:t}),[t]),v=(0,$.tP)(g),{isActive:f,clickAction:Y}=(0,O.k6)(g);if(f&&m&&m.insertAfterIndex===t&&n&&n.insertAfterIndex===t&&n){let e="subscribe"===n.block.block_type?"space":o;return(0,l.FD)(l.FK,{children:[(0,l.Y)(eo,{disabled:!0,label:"",variant:e,onClick:()=>{}}),(0,l.Y)("div",{id:v,children:(0,l.Y)(tQ,{contentBlock:n.block,posts:n.posts,pub:i,showSearch:!1,showSeeAllLink:!1,title:""})}),(0,l.Y)(eo,{disabled:!0,label:"",variant:e,onClick:()=>{}})]})}return(0,l.Y)("div",{id:v,children:(0,l.Y)(eo,{disabled:!c||!h||"activate"!==Y&&!f,isActive:f,label:s("Click to add block"),spaceHeight:r,variant:o,onClick:e=>{e.stopPropagation(),f?d():u({insertAfterIndex:t})}})})};var t5=n(57459),ne=n(21398);let nt=e=>{var t;let{editingContentBlockId:r,dividerVariant:c="default",dividerSpaceHeight:u,firstDividerVariant:p,homepageData:h,preloadedContainerRef:g,preloadedIframeRef:v,recentPosts:f,refetchHomepageData:b,renderContentBlock:y,setEditingContentBlockId:w,showEmptyStates:k}=e,{isMobile:I}=(0,m.sM)(),{pub:C,user:D,onUpdatePub:F}=(0,eL.np)(),{isPreviewMode:x}=(0,L.T)(),P=(0,_.S2)({pub:C}),A=(0,_.lu)({pub:C}),E=(0,d.P)(),N=!(0,t5.be)({pub:C,useCustomTheme:E}).disabledPreviewBlocks.includes("home-body"),[B,M]=(0,a.useState)(null),R=null!=r?r:B,O=null!=w?w:M,{groups:z,contentBlocks:U,hasMultipleLatest:H,isEmpty:q,previewBlockData:G}=function(e){let{contentBlockData:t,recentPosts:n}=e,{contentBlocks:l,postsBySectionId:r,postsByTagId:o,postsByContentBlockId:s,postsForContentBlockPins:d}=(0,i._)({},t6,t),{breakpoint:c}=(0,m.sM)(),{pub:u,user:p}=(0,eL.np)(),{canRender:h}=(e=>{let{pub:t,user:n}=e,{freeSignup:i}=(0,a.useContext)(em.c),l=(0,e3.Pu)(),r=(0,e9.mJ)();return{canRender:(0,a.useCallback)(e=>{let{contentBlock:o}=e,{cta:a,message:s}=te({contentBlock:o,freeSignup:i,pub:t,pubSettings:l,siteConfigs:r,user:n});return!!(a||s)},[i,t,l,r,n])}})({pub:u,user:p}),g=(0,T.md)(et.y2),v=(0,T.md)(et.lw),f=(0,_.lu)({pub:u}),Y=(0,_.K)({pub:u}),b=(0,a.useMemo)(()=>l.filter(e=>"subscribe"!==e.block_type||h({contentBlock:e})),[l,h]),y=(0,a.useMemo)(()=>{if(!g)return b;let{contentBlockId:e,updates:t}=g;return b.map(n=>n.id===e?t2()({},n,t):n)},[b,g]),w=(0,a.useMemo)(()=>(0,S.cD)({contentBlocks:b,breakpoint:c,isTheFP:f,isDropsiteNews:Y,recentPosts:n,postsBySectionId:r,postsByTagId:o,postsByContentBlockId:s,postsForContentBlockPins:d}),[b,c,f,Y,n,r,o,s,d]),k=(0,a.useMemo)(()=>{if(!v)return null;let{blockType:e,insertAfterIndex:t}=v,i={attrs:{},block_type:e,id:t4.vK,order:t+1,post_source:"subscribe"===e?"none":"latest",post_tag_id:null,primary_sidebar_modules:[],publication_id:u.id,secondary_sidebar_modules:[],section_id:null},l=0;for(let e=0;e<=t&&el.filter(e=>"latest"===e.post_source).length>1,[l]);return{groups:(0,a.useMemo)(()=>{let e=[],t=[],i="full-width",l=0;for(let h of y){var a,s,d,c,u,p;let m,g="half_feature"===h.block_type?"half-width":"full-width",v=null!=(s=null==(a=w[h.id])?void 0:a.posts)?s:[],f=[];"latest"===h.post_source?(f=n.slice(l),l+=v.length):"section"===h.post_source&&h.section_id?f=null!=(d=r[h.section_id])?d:[]:"tag"===h.post_source&&h.post_tag_id?f=null!=(c=o[h.post_tag_id])?c:[]:"multiple"===h.post_source&&(f=null!=(p=null==(m=null==(u=w[h.id])?void 0:u.postsBySource)?void 0:m.flatMap(e=>e.posts))?p:[]),g!==i&&(t.length&&(e.push({groupType:i,items:t}),t=[]),i=g),t.push({contentBlock:h,posts:v,sourcePosts:f,postsBySource:m})}return t.length&&e.push({groupType:i,items:t}),e},[y,w,n,r,o]),contentBlocks:y,hasMultipleLatest:I,isEmpty:0===y.length,previewBlockData:k}}({contentBlockData:null!=(t=null==h?void 0:h.contentBlockData)?t:null,recentPosts:f});if(q&&k)return(0,l.Y)(t0,{});let W=A||P,K=e=>{if(W)return"none";if(-1===e&&p)return p;let t=U[e],n=U[e+1];return(null==t?void 0:t.block_type)==="subscribe"||(null==n?void 0:n.block_type)==="subscribe"?"space":"default"},V=!1;return(0,l.FD)(Y.I1,{paddingBottom:40,children:[N&&U.length>0&&(0,l.Y)(t9,{insertAfterIndex:-1,previewBlockData:G,pub:C,variant:K(-1)}),z.map(e=>{let{groupType:t,items:n}=e;return(0,l.Y)("div",{className:o()({"halfWidthContainer-OZxoCR":"half-width"===t&&!I,"pillarContentBlocks-pkmgrG":P}),children:n.map(e=>{var n,i,r,o,d,p;let{contentBlock:h,posts:m,postsBySource:g,sourcePosts:v}=e,{title:f,viewAllUrl:b}=nn({contentBlock:h,hideRecentPostsTitle:H&&!A,pub:C}),_=(null==(n=null!=(d=h.attrs.titleOverride)?d:null==(i=h.attrs.feature)?void 0:i.title)?void 0:n.trim())||f,w=!1,k=U.findIndex(e=>e.id===h.id),S=U.slice(k+1),F="latest"===h.post_source&&S.every(e=>"latest"!==e.post_source);return"latest"!==h.post_source||V||(w=!0,V=!0),(0,l.FD)(a.Fragment,{children:[(0,l.Y)(t7.WO,{pinnedPostIds:null==(r=h.contentBlockPins)?void 0:r.map(e=>e.post_id),pub:C,showPubPins:"latest"===h.post_source,showSectionPins:!1,children:(0,l.FD)(Y.I1,{className:"contentBlockContainer-BNIIae",id:"block-".concat(h.id),paddingBottom:A?I?64:80:0,style:{scrollMarginTop:48},children:["media_carousel"===h.block_type&&((null==D?void 0:D.is_admin)||(null==D?void 0:D.is_editor))&&(0,l.Y)("div",{className:"contentBlockEditButton-g_2FSh",children:(0,l.Y)(s.m,{pub:C,sectionType:(null==(o=h.attrs.media_carousel)?void 0:o.variant)==="videos"?"video":"podcast",user:D})}),(0,l.Y)(t3.kT,{disabled:!N,pinningEnabled:"multiple"!==h.post_source,previewBlockId:{type:"content-block",contentBlockId:h.id},onEditClick:"multiple"!==h.post_source&&((null==D?void 0:D.is_admin)||(null==D?void 0:D.is_editor))?()=>O(h.id):void 0,children:(0,l.Y)(t8.y,{posts:m,children:null!=(p=null==y?void 0:y({contentBlock:h,posts:m,postsBySource:g,pub:C,showSearch:w,showSeeAllLink:F,sourcePosts:v,title:_,viewAllUrl:b}))?p:(0,l.Y)(tQ,{contentBlock:h,posts:m,postsBySource:g,pub:C,showSearch:w,showSeeAllLink:F,sourcePosts:v,title:_,viewAllUrl:b})})})]})}),N&&k0&&x&&(0,l.Y)(t9,{insertAfterIndex:U.length-1,previewBlockData:G,pub:C,variant:"space"}),R&&(0,l.Y)(ne.Ic,{contentBlockId:R,homepageData:null!=h?h:null,module:"@/frontend/publish/theme_editor/editor_v3/ContentBlockEditorModal",preloadedContainerRef:g,preloadedIframeRef:v,pub:C,refetchHomepageData:b,resolve:e=>e.ContentBlockEditorModal,whileLoading:(0,l.Y)("div",{}),onClose:()=>O(null),onRequest:()=>Promise.all([n.e("42985"),n.e("93975"),n.e("55674"),n.e("9933"),n.e("62871")]).then(n.bind(n,53025)),onSaved:()=>{O(null),null==b||b()},onThemeChanged:e=>{F({theme:(0,i._)({},C.theme,e)})}})]})},nn=e=>{let t,{contentBlock:n,hideRecentPostsTitle:i,pub:l}=e,r="";if("latest"===n.post_source)r=i?"":"Recent posts",t=(0,eA.Xt9)(l);else if("section"===n.post_source&&n.section){let e=n.section;r=(null==e?void 0:e.name)||"",t=e?(0,eH.Dor)(l,{section:e}):null}else if("tag"===n.post_source&&n.postTag){let e=n.postTag;r=(null==e?void 0:e.name)||"",t=e?(0,eH.ii9)(l,e):null}else"multiple"===n.post_source&&(r="Selected posts");return{title:r,viewAllUrl:t}}},10939:function(e,t,n){n.d(t,{r:()=>o});var i=n(4006),l=n(80098),r=n(76977);let o=e=>{let{numColumns:t=4,paddingBottom:n=24,paddingTop:o=24}=e;return(0,i.Y)(l.P,{variant:4===t?"full-width":3===t?"three-column-width":"two-column-width",children:(0,i.Y)(r.I1,{paddingBottom:n,paddingTop:o,paddingX:8,children:(0,i.Y)(r.pT,{borderBottom:"detail-themed"})})})}},6094:function(e,t,n){n.d(t,{Z:()=>tU});var i=n(69277),l=n(70408),r=n(32641),o=n(4006),a=n(13264),s=n(83673),d=n.n(s),c=n(90179),u=n.n(c),p=n(17402),h=n(36233),m=n(60030),g=n(79531),v=n(77043),f=n(13166),Y=n(83126),b=n(49031),_=n(84713),y=n(34581),w=n(65217),k=n(65590),I=n(13950),C=n(81209),S=n(84605),D=n(41477),F=n(68410),x=n(89490),P=n(76977),T=n(63136),A=n(72682),E=n(71783),N=n(8312),B=n(39318),M=n(49807);let R=e=>{let{customFooterTheme:t,isPreview:n,pub:l,socialMediaLinks:r,user:s}=e,{isMobile:d,isTablet:c}=(0,F.sM)(),u=(0,a.md)(E.vB),p=u?(0,i._)({},t,u):t,{showPublicationName:h,publicationNamePosition:m}=p,g=64;c?g=48:d&&(g=24);let v={customFooterTheme:p,paddingY:g,pub:l},f={customFooterTheme:p,isPreview:n,paddingY:g,pub:l,socialMediaLinks:r,user:s},Y=h&&"default"!==p.layout?(0,o.Y)(L,(0,i._)({},v)):null;return(0,o.FD)(P.VP,{style:{marginTop:24},children:["top"===m&&Y,(0,o.Y)(O,(0,i._)({},f)),"bottom"===m&&Y]})},O=e=>{let{customFooterTheme:t,isPreview:n,paddingY:i,pub:l,socialMediaLinks:r,user:a}=e,{iString:s}=(0,S.GO)(),{isMobile:d}=(0,F.sM)(),{layout:c}=t,u=(0,o.Y)(H,{isPreview:n,socialMediaLinks:r}),p=t.showPublicationName,h=null;return"centered"===c&&(h=(0,o.FD)(P.VP,{alignItems:"center",gap:20,children:[(0,o.FD)(P.VP,{alignItems:"center",gap:8,children:[(0,o.Y)(T.EY.H2,{color:"primary",font:"pub-headings",children:p?s("Subscribe"):l.name}),(0,o.Y)(T.EY.B2,{color:"primary",font:"text",maxWidth:540,textAlign:"center",children:l.hero_text})]}),(0,o.Y)(z,{pub:l,user:a}),(0,o.Y)(U,{pub:l}),u]})),"two-column"===c&&(h=(0,o.FD)("div",{className:"twoColumnGrid-NSUThY",children:[(0,o.FD)(P.VP,{gap:16,children:[(0,o.FD)(P.VP,{gap:4,children:[(0,o.Y)(T.EY.H2,{color:"primary",font:"pub-headings",children:l.name}),(0,o.Y)(T.EY.B2,{color:"primary",font:"text",children:l.hero_text})]}),(0,o.Y)(U,{pub:l})]}),(0,o.FD)(P.VP,{alignItems:d?"center":"end",gap:24,children:[(0,o.Y)(z,{align:"left",pub:l,user:a}),u]})]})),"three-column"===c&&(h=(0,o.FD)("div",{className:"threeColumnGrid-nUueeH",children:[(0,o.Y)(P.VP,{alignItems:d?"center":"start",justifyContent:"center",style:d?{order:3}:void 0,children:u}),(0,o.FD)(P.VP,{alignItems:"center",gap:16,justifyContent:"center",children:[(0,o.FD)(P.VP,{alignItems:"center",gap:8,children:[(0,o.Y)(T.EY.H3,{color:"primary",font:"pub-headings",children:p?s("Subscribe"):l.name}),(0,o.Y)(T.EY.B2,{color:"primary",font:"text",children:l.hero_text})]}),(0,o.Y)(z,{pub:l,user:a})]}),(0,o.Y)(P.VP,{alignItems:d?"center":"end",justifyContent:"center",children:(0,o.Y)(U,{pub:l})})]})),(0,o.Y)(I.DH,{prefix:"footer",children:(0,o.Y)(x.az,{borderTop:"detail",paddingY:i,children:(0,o.Y)(f.u,{children:(0,o.Y)(P.VP,{paddingX:8,children:h})})})})},L=e=>{var t,n,l,r,s,d;let{customFooterTheme:c,paddingY:u,pub:p}=e,h=(0,a.md)(E.MS),{publicationNameStyle:m,publicationNameSize:g}=c,f="wordmark"===m&&p.logo_url_wide,Y=null!=h?h:null==(n=p.theme)||null==(t=n.font_options)?void 0:t.wordmark,b=null!=(d=null==(r=p.theme)||null==(l=r.font_options)?void 0:l.heading)?d:null==(s=p.theme)?void 0:s.font_preset_heading,_=p.logo_url_wide?b:null!=Y?Y:b,y=_?(0,N.OK)(_):null,w=f?20:v.Rc,k=f?120:60,C=20+g,S=f?C:50===g?v.YR:Math.min(Math.max(C,w),k);return(0,o.Y)(I.DH,{prefix:"footer_secondary",children:(0,o.Y)(P.fI,{borderTop:"detail",justifyContent:"center",paddingY:u,children:(0,o.Y)(A.c,{anchor:"center",max:k,min:w,property:"footerPublicationNameSize",value:S,children:e=>{if(f)return(0,o.Y)("img",{alt:p.name,src:(0,M.dJ9)(p.logo_url_wide,null,{height:Math.round(2*e),crop:"limit",leadingSegments:["e_trim:10:white","e_trim:10:transparent"]}),style:{display:"block",height:e,objectFit:"contain",width:"100%"}});let t=(0,v.$L)(e,w,k);return(0,o.Y)(T.EY.H2,{color:"primary",font:"pub-headings",style:(0,i._)({fontSize:"".concat(t,"rem"),lineHeight:1},y),children:p.name})}})})})},z=e=>{let{align:t="center",pub:n,user:i}=e,{freeSignup:l,freeSignupEmail:r}=(0,p.useContext)(D.c);return(0,o.Y)(C.A,{align:t,freeSignup:l,freeSignupEmail:r,noMargin:!0,pub:n,source:"custom-footer",user:i})},U=e=>{let{pub:t}=e,{iString:n}=(0,S.GO)();return(0,o.FD)(P.fI,{gap:12,children:[(0,o.Y)(T.EY.B4,{as:"a",color:"primary",decoration:"underline",href:(0,B.DNs)(t),children:n("About")}),(0,o.Y)(T.EY.B4,{as:"a",color:"primary",decoration:"underline",href:(0,B.Xt9)(t),children:n("Archive")}),t.has_recommendations&&(0,o.Y)(T.EY.B4,{as:"a",color:"primary","data-native":!0,decoration:"underline",href:(0,B.nUM)(t),children:n("Recommendations")}),t.can_have_sitemap&&(0,o.Y)(T.EY.B4,{as:"a",color:"primary","data-native":!0,decoration:"underline",href:(0,B.bGb)(t),children:n("Sitemap")})]})},H=e=>{let{isPreview:t,socialMediaLinks:n}=e,i=t&&(!n||Object.values(n).every(e=>!e)),l=[{platform:"instagram",icon:_.A,value:i?"#":null==n?void 0:n.instagram},{platform:"tiktok",icon:w.A,value:i?"#":null==n?void 0:n.tiktok},{platform:"youtube",icon:k.A,value:i?"#":null==n?void 0:n.youtube},{platform:"facebook",icon:b.A,value:i?"#":null==n?void 0:n.facebook},{platform:"linkedin",icon:y.A,value:i?"#":null==n?void 0:n.linkedin},{platform:"bluesky",icon:Y.A,value:i?"#":null==n?void 0:n.bluesky}].filter(e=>e.value);return 0===l.length?null:(0,o.Y)(P.fI,{alignItems:"center",gap:16,children:l.map(e=>{let{platform:t,icon:n,value:l}=e;if(!l)return null;let r=((e,t)=>{if(t.startsWith("http://")||t.startsWith("https://"))return t;let n=t.startsWith("@")?t.slice(1):t;switch(e){case"instagram":if(n.startsWith("instagram.com"))return"https://".concat(n);return"https://instagram.com/".concat(n);case"tiktok":if(n.startsWith("tiktok.com"))return"https://".concat(n);return"https://tiktok.com/@".concat(n);case"youtube":if(n.startsWith("youtube.com"))return"https://".concat(n);return"https://youtube.com/@".concat(n);case"facebook":if(n.startsWith("facebook.com"))return"https://".concat(n);return"https://facebook.com/".concat(n);case"linkedin":return"https://".concat(n);case"bluesky":if(n.startsWith("bsky.app/profile"))return"https://".concat(n);return"https://bsky.app/profile/".concat(n);default:return"https://".concat(t)}})(t,l);return(0,o.Y)("a",{href:r,rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",color:"inherit",opacity:i?.2:1},target:"_blank",children:(0,o.Y)(n,{"aria-label":t,size:20})},t)})})};var q=n(80098),G=n(32485),W=n.n(G),K=n(97432),V=n(82776),j=n(57324);function X(e){let{className:t="",pub:n,user:r}=e,{iString:a,language:s}=(0,S.GO)(),{freeSignup:d,freeSignupEmail:c}=(0,p.useContext)(D.c);return(0,o.FD)("div",{className:W()("home-sitemap",t),children:[(0,o.Y)("h4",{className:"home-sitemap-title",children:n.name}),d||r&&r.is_free_subscribed?!(r&&r.is_subscribed)&&n.plans?(0,o.Y)("a",{className:"button primary home-sitemap-subscribe subscribe-btn",href:(0,B.eV6)(n,{utm_source:j.VU.homeSitemap}),"data-native":!0,children:(0,V.getSubscribeText)(n,{language:s})}):null:(0,o.Y)(x.az,{paddingTop:20,children:(0,o.Y)(K.A,{className:"home-sitemap-signup-form",freeSignup:d,freeSignupEmail:c,pub:n,source:"home-sitemap",user:r,onSuccess:e=>{e.body.prompt_to_login?setTimeout(()=>{document.location.href=(0,B.yRP)("/account/login",{redirect:document.location.href,email:e.body.email})},30):n.plans?document.location.href=(0,B.yRP)("/subscribe",(0,l._)((0,i._)({next:document.location.href,later:!0,just_signed_up:!0},e.body.subscription_id&&{subscription_id:e.body.subscription_id},e.body.referral_token&&{referral_token:e.body.referral_token}),{requires_confirmation:e.body.requires_confirmation?"true":""})):document.location.reload()},onConfirmationRequired:(null==n?void 0:n.payments_state)==="enabled"?()=>null:void 0})}),(0,o.FD)("div",{className:"home-sitemap-links",children:[(0,o.Y)("a",{href:(0,B.DNs)(n),children:a("About")}),(0,o.Y)("a",{href:(0,B.Xt9)(n),children:a("Archive")}),n.has_recommendations&&(0,o.Y)("a",{href:(0,B.nUM)(n),"data-native":!0,children:a("Recommendations")}),n.can_have_sitemap&&(0,o.Y)("a",{href:(0,B.bGb)(n),"data-native":!0,children:a("Sitemap")})]})]})}let J=()=>{let{iString:e}=(0,S.GO)();return(0,o.Y)("div",{className:"emptyState-G3KBxq",children:(0,o.Y)(T.EY.B3,{color:"secondary",children:e("Click to add footer")})})};var Z=n(28627);let Q={grid:"full-width","grid-groups":"full-width",list:"three-column-width"},$={newspaper:"three-column-width",magaziney:"full-width","magazine-5":"full-width",feature:"full-width","feature-media":"full-width",podcast:"full-width"},ee=e=>{var t,n,i,l;let{activeBodyLayout:r,hasBodyPosts:s,heroLayout:d,isPreview:c,pub:u,user:p}=e,{isMobile:h}=(0,F.sM)(),m=(0,a.md)(E.vB),g=null==(t=u.theme)?void 0:t.custom_footer,v=null!=(i=null!=(n=null==m?void 0:m.layout)?n:null==g?void 0:g.layout)?i:"default";if(g&&"default"!==v)return(0,o.Y)(R,{customFooterTheme:g,isPreview:c,pub:u,socialMediaLinks:null==(l=u.theme)?void 0:l.social_media_links,user:p});if("custom"===r&&c)return(0,o.Y)(J,{});if("custom"!==r){let e=s?Q[r]:$[d];return(0,o.Y)("div",{className:Z.A.container,style:{width:"100%"},children:(0,o.Y)(q.P,{variant:e,children:(0,o.Y)(P.I1,{paddingX:h?16:8,width:"100%",children:(0,o.Y)(X,{pub:u,user:p})})})})}return null};var et=n(98188),en=n(68743),ei=n(53023),el=n(83840);function er(e){let{canPinPosts:t,editingContentBlockId:n,heroPosts:i,homepageData:l,isPreview:r,preloadedContainerRef:a,preloadedIframeRef:s,pub:d,recentPostsForBody:c,refetchHomepageData:u,setEditingContentBlockId:p,onEditHeroClick:h}=e,{isMobile:m}=(0,F.sM)();return(0,o.FD)(P.I1,{gap:m?48:80,children:[(0,o.Y)(ei.i,{homeHeroPins:l.homeHeroPins,posts:i,pub:d,onEditClick:h}),(0,o.Y)(f.u,{children:(0,o.Y)(el.h,{dividerSpaceHeight:m?48:80,dividerVariant:"space",editingContentBlockId:n,firstDividerVariant:"none",homepageData:l,preloadedContainerRef:t?a:void 0,preloadedIframeRef:t?s:void 0,recentPosts:c,refetchHomepageData:u,renderContentBlock:en.L,setEditingContentBlockId:p,showEmptyStates:r})})]})}var eo=n(56195),ea=n(65892),es=n(75107),ed=n(15734),ec=n.n(ed),eu=n(63446),ep=n(6641),eh=n(15894),em=n(25006),eg=n(46271),ev=n(17306),ef=n(12501),eY=n(35369),eb=n(67211),e_=n(60141);let ey=e=>{var t;let{isOpen:n,onClose:i,onSave:l,currentValues:r}=e,[a,s]=(0,p.useState)(r.hedDesktop),[d,c]=(0,p.useState)(r.dekDesktop),[u,h]=(0,p.useState)(r.collapsedHedDesktop),[m,g]=(0,p.useState)(r.collapsedHedMobile),[v,f]=(0,p.useState)(r.hedMobile),[Y,b]=(0,p.useState)(r.dekMobile),[_,y]=(0,p.useState)(r.isBlueTheme),[w,k]=(0,p.useState)(r.ctaCopy),[I,C]=(0,p.useState)(r.ctaLink),[S,D]=(0,p.useState)(null==(t=r.enabledForNonPaid)||t),[F,x]=(0,p.useState)(!1),T=(0,p.useRef)(null),A=async e=>{e.preventDefault(),x(!0);try{await ec().put("/api/v1/islands/client/config?key=toaster_data").send({value:{hedDesktop:a,hedMobile:v,dekDesktop:d,dekMobile:Y,collapsedHedDesktop:u,collapsedHedMobile:m,ctaCopy:w,ctaLink:I,isBlueTheme:_,enabledForNonPaid:S}}),l(),i()}catch(e){console.error("Failed to save toaster config:",e),alert("Failed to save changes. Please try again.")}finally{x(!1)}};return(0,p.useEffect)(()=>{var e;s(r.hedDesktop),c(r.dekDesktop),h(r.collapsedHedDesktop),g(r.collapsedHedMobile),f(r.hedMobile),b(r.dekMobile),y(r.isBlueTheme),k(r.ctaCopy),C(r.ctaLink),D(null==(e=r.enabledForNonPaid)||e)},[r]),(0,o.Y)(ep.S,{initialFocus:T,isOpen:n,width:500,onClose:i,children:(0,o.FD)(P.I1,{gap:24,padding:32,children:[(0,o.Y)(P.Ye,{alignItems:"center",justifyContent:"space-between",children:(0,o.Y)(eh.T,{preset:"h4-serif",children:"Edit Footer Banner"})}),(0,o.Y)("form",{onSubmit:A,children:(0,o.FD)(P.I1,{gap:20,children:[(0,o.Y)(e_.A,{inputRef:T,label:"Heading",placeHolder:"Support independent journalism",value:a,onChange:s}),(0,o.Y)(e_.A,{label:"Heading (collapsed)",placeHolder:"Support independent journalism",value:u,onChange:h}),(0,o.Y)(e_.A,{label:"Description",placeHolder:"Join *The Free Press* today for unlimited access",value:d,onChange:c}),(0,o.Y)(e_.A,{label:"Heading (mobile)",placeHolder:"Support independent journalism",value:v,onChange:f}),(0,o.Y)(e_.A,{label:"Heading (collapsed mobile)",placeHolder:"Support independent journalism",value:m,onChange:g}),(0,o.Y)(e_.A,{label:"Description (mobile)",placeHolder:"Join *The Free Press* today for unlimited access",value:Y,onChange:b}),(0,o.Y)(e_.A,{label:"Button Text",placeHolder:"Subscribe now",value:w,onChange:k}),(0,o.Y)(e_.A,{label:"Button Link",placeHolder:"/subscribe",value:I,onChange:C}),(0,o.Y)(eb.Y,{label:"Blue Theme",value:_,onChange:y}),(0,o.Y)(eb.Y,{label:"Enable for non-paid users",value:S,onChange:D}),(0,o.FD)(P.Ye,{gap:12,justifyContent:"end",children:[(0,o.Y)(eY.$n,{disabled:F,priority:"secondary",onClick:i,children:"Cancel"}),(0,o.Y)(eY.$n,{disabled:F,priority:"primary",type:"submit",children:F?"Saving...":"Save Changes"})]})]})})]})})},ew=()=>{let[e,t]=(0,p.useState)(!0),[n,l]=(0,p.useState)(!1),[r,a]=(0,p.useState)(!1),{hedDesktop:s,dekDesktop:d,isBlueTheme:c,collapsedHedMobile:u,collapsedHedDesktop:h,hedMobile:m,dekMobile:g,ctaCopy:v,ctaLink:f,enabledForNonPaid:Y,refetch:b,isLoading:_}=(()=>{let[e,t]=(0,p.useState)({hedDesktop:"Support independent journalism",hedMobile:"Support independent journalism",collapsedHedMobile:"Support independent journalism",collapsedHedDesktop:"Support independent journalism",dekDesktop:"Join *The Free Press* today for unlimited access",dekMobile:"Join *The Free Press* today for unlimited access",ctaCopy:"Subscribe now",ctaLink:"/subscribe",isBlueTheme:!1,enabledForNonPaid:!0}),[n,i]=(0,p.useState)(!0),{result:l,refetch:r}=(0,ef.st)({pathname:"/api/v1/islands/client/config",query:{key:"toaster_data"},auto:!0});return(0,p.useEffect)(()=>{var e;(null==l||null==(e=l.config)?void 0:e.value)&&(t(l.config.value),i(!1))},[l]),{hedDesktop:e.hedDesktop,hedMobile:e.hedMobile,collapsedHedMobile:e.collapsedHedMobile,collapsedHedDesktop:e.collapsedHedDesktop,dekDesktop:e.dekDesktop,dekMobile:e.dekMobile,ctaCopy:e.ctaCopy,ctaLink:e.ctaLink,isBlueTheme:e.isBlueTheme,enabledForNonPaid:e.enabledForNonPaid,refetch:r,isLoading:n}})(),y=(0,eg.Jd)(),w=(0,em.df)(),{isMobile:k}=(0,F.sM)(),I=k?m:s,C=k?u:h,{markdownProps:S}=(0,ev.$)(k?g:d),D=(null==y?void 0:y.is_admin)&&!r,x=!(null==y?void 0:y.is_subscribed),T=null==y?void 0:y.is_admin;if(!(Y&&x&&(!_||T))&&!(null==y?void 0:y.is_admin))return null;let A=()=>(0,o.Y)(eY.K0,{priority:"tertiary",size:"sm",style:{position:"fixed",left:16,bottom:16,zIndex:10,backgroundColor:"var(--color-bg-primary)",border:"1px solid var(--color-border-light)"},title:"Preview toaster",onClick:()=>a(!r),children:(0,o.Y)(eo.A,{size:20})});if(D)return(0,o.Y)(A,{});let E=!e,N="h5-sans";e||(N="lg-preview-byline");let M=w&&"undefined"!=typeof window?(0,B.eV6)(w,{addBase:!0,next:(0,B.yRP)(window.location.href,{follow:!0}),utm_source:j.VU.fixedFooterPaywall,utm_medium:j.Jn.web}):"/subscribe";return(0,o.FD)(o.FK,{children:[(null==y?void 0:y.is_admin)&&(0,o.Y)(A,{}),(0,o.FD)("div",{className:"".concat("container-liQ2Od"," ").concat(e?"open-NsIljP":""),style:{backgroundColor:c?"var(--color-blue)":"white"},children:[(0,o.FD)(P.pT,{alignItems:"center",direction:k?"column":"row",gap:k?8:24,justifyContent:"center",style:{width:k?"100%":"auto"},children:[(0,o.Y)(P.Ye,{alignItems:"center",gap:0,children:(0,o.FD)(P.I1,{gap:8*!!k,children:[(0,o.Y)(eh.T,{align:k?"center":"left",color:c?"white":"primary",preset:N,children:e?I:C}),e&&(0,o.Y)(eh.T,(0,i._)({align:k?"center":"left",color:c?"white":"primary",preset:"d3-serif"},S))]})}),(0,o.Y)(eu.v,{className:"subscribeButton-KC1zy_",href:"/subscribe"===f?M:f,native:!0,size:"md",style:{width:k?"100%":"auto",textDecoration:E?"underline":"none",color:E?c?"white":"var(--color-accent-themed)":void 0,padding:E?"0":void 0},variant:E?"tertiary":"primary-accent",children:v})]}),(null==y?void 0:y.is_admin)&&(0,o.Y)(eY.K0,{priority:"tertiary",size:"sm",style:{position:"absolute",right:0,bottom:0},title:"Edit footer banner",onClick:()=>l(!0),children:(0,o.Y)(ea.A,{size:20,style:{color:c?"white":"var(--color-primary)"}})}),(0,o.Y)(eY.Nm,{className:"chevronButton-xCmt1F",onClick:()=>t(!e),children:(0,o.Y)(es.A,{style:{transform:e?"rotate(0deg)":"rotate(180deg)",color:c?"white":"var(--color-primary)"}})})]}),(null==y?void 0:y.is_admin)&&(0,o.Y)(ey,{currentValues:{hedDesktop:s,dekDesktop:d,hedMobile:m,dekMobile:g,collapsedHedMobile:u,collapsedHedDesktop:h,ctaCopy:v,ctaLink:f,isBlueTheme:c,enabledForNonPaid:Y},isOpen:n,onClose:()=>l(!1),onSave:()=>{b()}})]})};var ek=n(40075),eI=n(46497),eC=n(19945),eS=n(16447),eD=n(28528),eF=n(42308),ex=n(97904),eP=n(11419);let eT=()=>{let{pub:e}=(0,eD.np)(),{isMobile:t}=(0,F.sM)();return(0,o.FD)(P.I1,{gap:40,children:[!t&&(0,o.Y)(eP.V,{}),e.show_recs_on_homepage&&(0,o.Y)(ex.l,{}),(0,o.Y)(eF.U,{})]})};var eA=n(2404),eE=n.n(eA),eN=n(83128),eB=n(29098),eM=n(78120),eR=n(24634),eO=n(93800);let eL="homePageGroupsGrid-dfyTM6",ez=e=>"email_from_name"in e,eU=e=>{var t;let[n,a]=(0,p.useState)(null!=(t=e.postsByGroupId)?t:{}),[s,d]=(0,p.useState)(!1),{posts:c,bodyPostGroups:u,hasEmptyGroupOptions:h,setHasInvalidGroupSelection:m}=e,g=(0,r._)(e,["posts","bodyPostGroups","hasEmptyGroupOptions","setHasInvalidGroupSelection"]);(0,p.useEffect)(()=>{let e=async e=>{let t=(0,i._)({},n);for(let n of e){let e={limit:6};if(ez(n)?e.section_id=n.id:e.post_tag_id=n.id,!t[n.id]){let{body:i}=await ec().get("/api/v1/archive").query(e);t[n.id]=i}}eE()(t,n)||(a(t),d(!1))};0===Object.keys(n).length&&u&&(null==u?void 0:u.length)>0&&(d(!0),e(u))},[u,a,n]);let v=(0,p.useCallback)(e=>{var t;let r=null!=(t=e.post_tag_id)?t:e.section_id;if(!r)throw Error("Must supply section_id or post_tag_id");n&&n[r]||ec().get("/api/v1/archive").query((0,i._)({limit:3},e)).then(e=>{let{body:t}=e;a((0,l._)((0,i._)({},n),{[r]:t}))})},[n,a]),f=(0,p.useCallback)(e=>{var t;return n&&(!n||0!==Object.keys(n).length)&&n[e]?null==(t=n[e])?void 0:t.slice(0,3):null},[n]);return h||!u||(null==u?void 0:u.length)===0?m?(m(!0),(0,o.Y)(eH,{message:"No groups selected"})):(0,o.FD)(P.I1,{children:[(0,o.Y)(eq,{pub:e.pub}),(0,o.Y)(eO.m,(0,l._)((0,i._)({},g),{posts:c.slice(0,3),variant:"three-column-grid"}))]}):(0,o.FD)("div",{className:eL,children:[u.map(t=>{let n=f(t.id);return(0,o.FD)(P.I1,{paddingBottom:24,children:[(0,o.Y)(eq,{pub:e.pub,row:t}),(0,o.Y)(eG,(0,l._)((0,i._)({},g),{groupModel:t,loadingSync:s,posts:c,postsForId:n,setHasInvalidGroupSelection:m,onIntersectCallback:()=>{v(ez(t)?{section_id:t.id}:{post_tag_id:t.id})}}))]})}),u.length<3?(0,o.FD)(P.I1,{children:[(0,o.Y)(eq,{pub:e.pub}),(0,o.Y)(eO.m,(0,l._)((0,i._)({},g),{posts:c.slice(0,3),variant:"three-column-grid"}))]}):null]})},eH=e=>{let{groupModel:t,message:n}=e;return(0,o.Y)(x.az,{paddingBottom:40,paddingTop:8,children:(0,o.FD)(P.I1,{alignItems:"center",className:W()(eL,t?"emptyGroupView-kLS4e3":"emptyRowsView-Yo2IhI"),justifyContent:"center",children:[(0,o.Y)(eN.A,{className:"emptyContentIcon-mKbS2t"}),n&&(0,o.Y)(T.EY.B4,{color:"pub-secondary-text",paddingTop:20,weight:"semibold",children:n}),t&&(0,o.FD)(T.EY.B4,{color:"pub-secondary-text",paddingTop:4,children:["Add posts to this ",ez(t)?"section":"tag"," to include it on your homepage."]})]})})},eq=e=>{var t;let{row:n,pub:i}=e,{isMobile:l}=(0,F.sM)(),r="/archive";return n&&(r=ez(n)?(0,M.Dor)(i,{section:n}):(0,M.ii9)(i,n)),(0,o.Y)(P.I1,{paddingBottom:12,paddingX:8*!l,children:(0,o.FD)(P.Ye,{alignItems:"center",justifyContent:"space-between",children:[(0,o.Y)(T.EY.H2,{color:"pub-primary-text",font:"pub-headings",children:null!=(t=null==n?void 0:n.name)?t:"Recent posts"}),(0,o.Y)(eM.M,{href:r,children:"See all"})]})})},eG=e=>{let{onIntersectCallback:t,groupModel:n,loadingSync:a,postsForId:s,setHasInvalidGroupSelection:d}=e,c=(0,r._)(e,["onIntersectCallback","groupModel","loadingSync","postsForId","setHasInvalidGroupSelection"]),[u,h]=(0,eB.A)();return((0,p.useEffect)(()=>{(null==h?void 0:h.isIntersecting)&&!a&&t()},[null==h?void 0:h.isIntersecting,t,a]),s)?0===s.length?d?(d(!0),(0,o.Y)(eH,{groupModel:n})):(0,o.Y)(eO.m,(0,l._)((0,i._)({},c),{posts:c.posts.slice(0,3),variant:"three-column-grid"})):(0,o.Y)(eO.m,(0,l._)((0,i._)({},c),{posts:s,variant:"three-column-grid"})):(0,o.Y)(eR.t,{ref:u,postCount:3,variant:"grid-groups"})};var eW=n(7761),eK=n(90839),eV=n(57459);let ej={grid:"full-width-with-sidebar","grid-groups":"full-width-with-sidebar",list:"three-column-width-with-sidebar"},eX={grid:"three-column-grid",list:"two-column-list"},eJ=e=>{let t;var{hasCustomFooter:n,hideImagesFromList:a,posts:s,pub:d,source:c,user:u,variant:p,bodyPostGroups:h,postsByGroupId:g}=e,v=(0,r._)(e,["hasCustomFooter","hideImagesFromList","posts","pub","source","user","variant","bodyPostGroups","postsByGroupId"]);let{isMobile:f,isTablet:Y,breakpoint:b}=(0,F.sM)(),_=(0,m.P)(),y=(0,eV.be)({pub:d,useCustomTheme:_}),w=(t=(()=>{let{iString:e}=(0,S.GO)();return{list:{id:"list",label:e("List"),description:e("A list of posts"),postCount:{desktop:7,tablet:7,mobile:7}},grid:{id:"grid",label:e("Grid"),description:e("A grid of nine posts"),postCount:{desktop:9,tablet:9,mobile:7}},"grid-groups":{id:"grid-groups",label:e("Groups (sections or tags)"),description:e("A grid of nine posts, grouped by section or tag"),postCount:{desktop:9,tablet:9,mobile:7}},custom:{id:"custom",label:e("Advanced"),description:e("Advanced layout options"),postCount:{desktop:0,tablet:0,mobile:0}}}})(),eC.pQ.reduce((e,n)=>(0,l._)((0,i._)({},e),{[n]:t[n].postCount}),{}))[p][b],k="list"===p&&(a||s.slice(0,w).every(e=>!e.cover_image));return(0,o.Y)(eW.WO,{pub:d,showPubPins:!0,showSectionPins:!1,children:s.length>0&&(0,o.Y)(eK.kT,{disabled:y.disabledPreviewBlocks.includes("home-body"),layoutVariant:"list"===p?"three-column":void 0,previewBlockId:{type:"home-body"},children:(0,o.FD)(q.P,{showContentBelowOnMobile:!0,variant:ej[p],children:[(0,o.Y)(eS.M,(0,l._)((0,i._)({},v),{maxPosts:w,newPosts:s,pub:d,user:u,variant:p,children:e=>{let{posts:t,linkToComments:n,onClickPost:r}=e,a={hideImages:k,linkToComments:n,posts:t,pub:d,source:c,user:u,onClickPost:r};return"grid-groups"===p?(0,o.Y)(eU,(0,l._)((0,i._)({},a),{bodyPostGroups:h,hasEmptyGroupOptions:v.hasEmptyGroupOptions,postsByGroupId:g,setHasInvalidGroupSelection:v.setHasInvalidGroupSelection})):(0,o.Y)(eO.m,(0,l._)((0,i._)({},a),{variant:eX[p]}))}})),(!f&&!Y||!n)&&(0,o.Y)(eT,{})]})})})};var eZ=n(10939),eQ=n(79785),e$=n(48697),e0=n(45773),e1=n(47963),e2=n(85048),e4=n(86500),e6=n(94729),e7=n(68349),e8=n(24078),e3=n(16993),e9=n(45974),e5=n(11510),te=n(41086);let tt="giftBackground-I9xH3b";var tn=n(27569);function ti(){let e=(0,eQ._)(["All of ","'s gifts have been claimed."]);return ti=function(){return e},e}function tl(){let e=(0,eQ._)(["Get your free guest pass to ",""]);return tl=function(){return e},e}function tr(){let e=(0,eQ._)([""," gifted you "," free days of ","."]);return tr=function(){return e},e}function to(){let e=(0,eQ._)(["Gift from ",""]);return to=function(){return e},e}function ta(){let e=(0,eQ._)(["Gift from someone"]);return ta=function(){return e},e}function ts(){let e=(0,eQ._)(["","-Day Guest Pass ("," value)"]);return ts=function(){return e},e}function td(){let e=(0,eQ._)(["","-Day Guest Pass"]);return td=function(){return e},e}function tc(){let e=(0,eQ._)(["Accept your gift to get "," days of free access to exclusive posts, chats, videos, and more."]);return tc=function(){return e},e}function tu(){let e=(0,eQ._)(["Accept your gift to get "," days of free access to exclusive posts, chats, videos, and more."]);return tu=function(){return e},e}function tp(){let e=(0,eQ._)(["Accept ","'s gift"]);return tp=function(){return e},e}function th(){let e=(0,eQ._)(["Accept gift"]);return th=function(){return e},e}function tm(){let e=(0,eQ._)(["Accept ","'s gift"]);return tm=function(){return e},e}let tg=e=>{var t,n,l;let{isOpen:r,onClose:a,pub:s,giftCard:d,abTestingId:c}=e,{iString:u,iTemplate:h}=(0,S.GO)(),m=(0,e5.Iu)(),g=(0,eg.Jd)(),{freeSignup:v,freeSignupEmail:f}=(0,p.useContext)(D.c),[Y,b]=(0,p.useState)((null==g?void 0:g.email)||f||""),[_,y]=(0,p.useState)(!1),[w,k]=(0,p.useState)(!1),[F,x]=(0,p.useState)(null),[A,E]=(0,p.useState)(null),N=(null==g?void 0:g.is_free_subscribed)||v,B=s.author_photo_url||s.logo_url;if(null==d?void 0:d.expired)return(0,o.Y)(e3.aF,{isOpen:r,onClose:a,width:500,children:(0,o.FD)(P.I1,{alignItems:"center",paddingTop:24,paddingX:24,gap:24*!N,paddingBottom:24*!N,children:[(0,o.Y)(eY.K0,{rounded:!0,onClick:a,"aria-label":u("Close"),priority:"tertiary",tabIndex:-1,style:{position:"absolute",top:"12px",right:"12px"},children:(0,o.Y)(e$.A,{size:20})}),(0,o.FD)(P.I1,{alignItems:"center",gap:16,children:[B&&(0,o.Y)(e8.eu,{size:80,photoUrl:B}),(0,o.Y)(P.I1,{alignItems:"center",gap:2,children:(0,o.Y)(T.EY.B2,{textAlign:"center",translated:!0,children:"Sorry, this gift has already expired."})})]}),(0,o.FD)(P.I1,{textAlign:"center",alignItems:"center",paddingX:24,children:[(0,o.Y)(C.A,{pub:s,user:g,freeSignup:v,freeSignupEmail:f,isStatic:!1,source:"viral-gift-fallback"}),!N&&(0,o.Y)(e2.qd,{publication:s})]})]})});if(null==g?void 0:g.is_subscribed){let e=(0,M.eV6)(s,{params:{utm_source:j.VU.viralGiftModal,gift:!0}});return(0,o.Y)(e3.aF,{isOpen:r,onClose:a,width:500,children:(0,o.Y)(P.I1,{alignItems:"center",padding:24,gap:24,children:(0,o.FD)(P.I1,{alignItems:"center",gap:16,children:[B&&(0,o.Y)(e8.eu,{size:80,photoUrl:B}),(0,o.FD)(P.I1,{alignItems:"center",gap:2,children:[(0,o.FD)(T.EY.H4,{textAlign:"center",translated:!0,children:["Give a gift to ",I18N.p(s.name)]}),(0,o.FD)(T.EY.B3,{textAlign:"center",translated:!0,children:["You currently have an active paid subscription to ",I18N.p(s.name),", so you're not able to accept a gift. Would you like to give a gift instead?"]})]}),(0,o.Y)(eY.$n,{href:e,localNavigation:!1,children:u("Give a gift")})]})})})}if(!d||!(null==d?void 0:d.days)){if(null==d?void 0:d.gifter){let e=d.gifter.name||d.gifter.handle&&"@".concat(d.gifter.handle);return(0,o.Y)(e3.aF,{isOpen:r,onClose:a,width:500,children:(0,o.FD)(P.I1,{alignItems:"center",paddingTop:24,paddingX:24,gap:24*!N,paddingBottom:24*!N,children:[(0,o.FD)(P.I1,{alignItems:"center",gap:16,children:[B&&(0,o.Y)(e8.eu,{size:80,photoUrl:B}),(0,o.FD)(P.I1,{alignItems:"center",gap:2,children:[(0,o.FD)(T.EY.H4,{textAlign:"center",translated:!0,children:["Subscribe to ",I18N.p(s.name)]}),(0,o.Y)(T.EY.B3,{textAlign:"center",children:e?h(ti(),e):u("All of your friend's gifts have been claimed.")})]})]}),(0,o.FD)(P.I1,{textAlign:"center",alignItems:"center",paddingX:24,children:[(0,o.Y)(C.A,{pub:s,user:g,freeSignup:v,freeSignupEmail:f,isStatic:!1,source:"viral-gift-fallback"}),!N&&(0,o.Y)(e2.qd,{publication:s})]})]})})}return null}let R=d.gifter&&d.gifter.id!==s.author_id,O=(null==(t=d.gifter)?void 0:t.name)||(null==(n=d.gifter)?void 0:n.handle)&&"@".concat(null==(l=d.gifter)?void 0:l.handle),L=async()=>{if(!Y)return void x("Please enter your email");k(!0);try{var e,t;(0,e4.u4)(e4.qY.ACCEPT_GIFT_MODAL_CTA_CLICKED,{gifter_user_id:null==(e=d.gifter)?void 0:e.id,has_sender_token:!!(0,te.y)(window._preloads.original_url,"senderToken")});let n=await (0,e6.x6)("/api/v1/viral_gifts/create_for_email",{method:"POST",json:(0,i._)({email:Y},R&&(0,te.y)(window._preloads.original_url,"senderToken")&&{senderToken:(0,te.y)(window._preloads.original_url,"senderToken")})}),l=null==n||null==(t=n.gift)?void 0:t.id;if(l)E(l),y(!0),x(null),m&&setTimeout(()=>{window.location.href=(0,M.xdH)({giftId:l}),a()},1e3);else throw Error()}catch(e){(0,e7.uX)(e)?x((0,e7.uX)(e)):x("Something went wrong. Please try again.")}k(!1)},z=_?u("Finish activating your guest pass in the Substack app"):R?h(tl(),s.name):h(tr(),s.author_name,d.days,s.name),U=(0,o.FD)(o.FK,{children:[R?(0,o.Y)(e8.eu,{user:d.gifter,size:80}):(0,o.Y)(e9.Nq,{logoUrl:s.logo_url,size:64,radius:"sm"}),(0,o.Y)(T.EY.H3,{textAlign:"center",fontWeight:"heavy",color:"white",paddingTop:12,children:R?O?h(to(),O):h(ta()):s.name}),(0,o.Y)(T.EY.B3,{className:"guestPassText-_ibww7",children:d.value?h(ts(),d.days,d.value):h(td(),d.days)})]});return(0,o.Y)(e3.aF,{isOpen:r,onClose:a,width:500,children:(0,o.FD)(P.I1,{alignItems:"stretch",paddingBottom:48*!m,children:[!m&&(0,o.Y)(P.I1,{className:W()(tt,"giftBackgroundHeader-tb4ks8"),children:(0,o.FD)(P.I1,{justifyContent:"center",alignItems:"center",gap:4,children:[U,(0,o.Y)(eY.K0,{rounded:!0,onClick:a,"aria-label":u("Close"),priority:"tertiary",className:"headerCloseButton-m0sKZi",children:(0,o.Y)(e$.A,{size:20})})]})}),(0,o.Y)(P.I1,{alignItems:"stretch",maxWidth:m?void 0:400,style:{margin:"auto"},children:(0,o.FD)(P.I1,{paddingTop:24,paddingX:{mobile:24,desktop:0},paddingBottom:{mobile:24,desktop:0},gap:8,children:[m&&(0,o.Y)(P.I1,{className:tt,justifyContent:"center",alignItems:"center",gap:4,children:U}),(0,o.Y)(T.EY.H4,{weight:"semibold",fontStyle:"normal",textAlign:"center",children:z}),(0,o.Y)(T.EY.B3,{color:"secondary",align:"center",paddingBottom:16,children:m?N?u("Download the Substack app to claim your guest pass"):R?h(tc(),d.days):u("Subscribe and download the Substack app to claim your guest pass"):_?u("Available for iOS and Android"):R?h(tu(),d.days):u("Subscribe free to claim your guest pass")}),N||_?!m&&_&&A?(0,o.Y)(P.I1,{alignItems:"center",gap:16,children:(0,o.Y)(P.pT,{className:"qrCode-MxgyfH",padding:20,children:(0,o.Y)(e1.hj,{size:142,utm_campaign:"accept_gift",utm_source:"accept_gift_modal",abTestingId:c,openUrl:(0,M.xdH)({giftId:A})})})}):_?(0,o.FD)(P.Ye,{gap:8,alignItems:"center",justifyContent:"center",children:[(0,o.Y)(e0.A,{size:24,stroke:"var(--color-semantic-success-fg-primary)"}),(0,o.Y)(T.EY.B3,{color:"secondary",align:"center",translated:!0,children:"Subscribed"})]}):(0,o.Y)(I.DH,{children:(0,o.Y)(eY.$n,{priority:"primary",onClick:L,disabled:w,children:R?O?h(tp(),O):h(th()):h(tm(),s.author_name)})}):(0,o.FD)(P.I1,{gap:24,className:"emailInputWrapper-SzmWNd",children:[(0,o.FD)(P.Ye,{justifyContent:"center",alignItems:"center",gap:0,style:{borderRadius:8},children:[(0,o.Y)("input",{className:W()("pencraft",tn.A.emailInput,"emailInput-JqukPr"),style:{border:"1px solid var(--color-utility-detail)"},type:"text",value:Y,onInput:e=>b(e.currentTarget.value),placeholder:u("Your email"),tabIndex:-1}),(0,o.Y)(eY.$n,{disabled:w,className:"acceptButton-TrYdu7",priority:"primary",onClick:L,children:u("Accept gift")})]}),(0,o.Y)(e2.qd,{className:"tos-RHY2Hj",publication:s})]}),F&&(0,o.Y)(T.EY.B4,{align:"center",style:{color:"red"},children:F})]})})]})})};function tv(e){var t;let{abTestingId:n,giftCard:i,pub:l}=e,{open:r,modal:a}=(0,e1.El)({utm_campaign:(null==i||null==(t=i.gifter)?void 0:t.id)===l.author_id?j._9.viralGiftAppIncentiveFromPub:j._9.viralGiftAppIncentive,utm_source:j.VU.substack,giftCard:i,pub:l,abTestingId:n}),{open:s,modal:d}=function(e){let{pub:t,abTestingId:n,startingOpen:i,giftCard:l}=e,[r,a]=(0,p.useState)(null!=i&&i),[s,d]=(0,p.useState)(l),c=(0,p.useCallback)(e=>{d(e),a(!0),(0,e4.u4)(e4.qY.ACCEPT_GIFT_MODAL_OPENED,{has_sender_token:!!(0,te.y)(window._preloads.original_url,"senderToken"),starting_open:i})},[]),u=(0,p.useCallback)(()=>{a(!1)},[]);return{open:c,modal:(0,o.Y)(tg,{isOpen:r,onClose:u,pub:t,giftCard:s,abTestingId:n})}}({pub:l,abTestingId:n,startingOpen:!!(0,te.y)("accepting_gift"),giftCard:i});return(0,p.useEffect)(()=>{(0,te.y)("accepting_gift")?((0,e7.qm)("accepting_gift"),(0,e7.qm)("senderToken"),s(i)):i&&l&&(i.expired?s(i):r())},[]),(0,o.FD)(o.FK,{children:[d,a]})}var tf=n(61143),tY=n(53989),tb=n(24782),t_=n(16291);function ty(e){let{activeLiveStream:t,disabled:n}=e,{getSettingFor:i}=(0,tY.Pu)();return n||!(null==t?void 0:t.liveStream.id)||(0,t_.A)(t.liveStream.started_streaming_at).isAfter((0,t_.A)().subtract(1,"minute"))?null:t.liveStreamInformation.desktopPlaybackUrl&&"autoPlay"===i("live_stream_homepage_style")?(0,o.Y)(P.I1,{alignItems:"center",paddingTop:24,children:(0,o.Y)(x.az,{className:Z.A.liveStreamContainer,position:"relative",children:(0,o.Y)(tf.q,{activeLiveStream:t,fromPub:!0})})}):(0,o.Y)(tb.A,{activeLiveStream:t})}var tw=n(85478),tk=n(4016);function tI(e){let{activeLiveStream:t,children:n,freeSignup:i,freeSignupEmail:l,homepageData:r,pub:a,user:s,utm:d}=e,{getSettingFor:c}=(0,tY.Pu)(),u=(0,tw.mJ)(),p=(0,V.ensureInList)(c("post_preview_crop_gravity"),["center","auto"]);return(0,o.Y)(eD.XL,{authorPagesEnabled:!!u.getConfigFor("enable_author_pages"),cropGravity:p,highlightByline:!!u.getConfigFor("post_preview_highlight_byline"),pub:a,showSectionOrTag:(0,tk.S2)({pub:a}),user:s,utm:d,children:(0,o.Y)(D.c.Provider,{value:{activeLiveStream:null!=t?t:void 0,contributors:r.contentBlockData.contributors,freeSignup:i,freeSignupEmail:l,homepageLinks:r.homepageLinks,latestPodcastPosts:r.contentBlockData.latestPodcastPosts,latestPostByContributorId:r.contentBlockData.latestPostByContributorId,latestPostFromSections:r.contentBlockData.latestPostFromSections,numRecommendations:r.numRecommendations,recommendations:r.recommendations,topPosts:r.topPosts},children:(0,o.Y)(I.DH,{children:n})})})}var tC=n(10974),tS=n(53168);let tD=e=>{let{containerRef:t,homepageData:n,iframeRef:i,isActive:l}=e,[r,a]=(0,p.useState)(!1);return((0,p.useEffect)(()=>{a(!0)},[]),(0,p.useEffect)(()=>{let e=e=>{var t,l,r;(null==(t=e.data)?void 0:t.type)===tC.Em.REQUEST_INITIAL&&n&&(null==(r=i.current)||null==(l=r.contentWindow)||l.postMessage({type:tC.Em.HOMEPAGE_DATA,value:n},"*"))};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[n,i]),(0,p.useEffect)(()=>{var e,t;n&&(null==(t=i.current)||null==(e=t.contentWindow)||e.postMessage({type:tC.Em.HOMEPAGE_DATA,value:n},"*"))},[n,i]),r)?(0,p.createPortal)((0,o.Y)("div",{ref:t,style:{position:"fixed",left:l?void 0:-9999,top:0,width:1440,height:900,visibility:l?"visible":"hidden",opacity:+!!l,transition:l?"opacity var(--animation-timing-fast) var(--animation-smooth)":void 0,overflow:"hidden",zIndex:l?tS.sI:void 0},children:(0,o.Y)("iframe",{ref:i,src:"/publish/website-editor-preview?mode=isolation",style:{border:"none",display:"block",width:1440,height:900}})}),document.body):null};var tF=n(21919),tx=n(73443),tP=n(92019);let tT=e=>{let{pub:t,user:n}=e,[i,l]=(0,p.useState)(!0),{isMobile:r}=(0,F.sM)(),{changeSetting:a}=(0,eg.ur)(),{refetch:s}=(0,ef.st)({pathname:"/api/v1/subscription/sections/email?utm_source=newsletters-modal",auto:!1,method:"PATCH"}),d=async()=>{await a("hasSeenOnboardingNewslettersScreen",!0),l(!1)},c=async(e,t)=>{try{let n=Object.fromEntries([...e.map(e=>[e,{setting:"individual"}]),...t.map(e=>[e,{setting:"disabled"}])]);await s({json:n}),await d()}catch(e){console.error("Failed to update newsletter preferences:",e)}};return(0,o.Y)(o.FK,{children:(0,o.FD)(ep.S,{isOpen:i,width:894,onClose:d,stretchModal:r,fullscreenMobile:!0,children:[r&&(0,o.FD)(P.Ye,{style:{width:"100%"},children:[(0,o.Y)("div",{className:tP.A.topBorder}),(0,o.Y)(tF.G,{logoOnly:!0,pub:t,user:n,activeLiveStream:null,freeSignup:!1,showCustomerSupportModeModal:!1}),(0,o.Y)(eY.Nm,{className:tP.A.closeButton,onClick:d,children:(0,o.Y)(e$.A,{size:24})})]}),(0,o.Y)(tx.k,{isNewSubscriber:!1,pub:t,fullScreen:!1,onSkip:d,onSubmit:c})]})})};var tA=n(97515),tE=n(90800),tN=n(26392),tB=n(21398),tM=n(56458);let tR=(0,p.memo)(e=>{let t,{activeLiveStream:r,bodyPostGroups:s,freeSignup:c,freeSignupEmail:u,homepageData:h,isPreview:v,pub:Y,refetchHomepageData:b,theme:_,user:y,utm:w,giftCard:k,abTestingId:I,setHasInvalidGroupSelection:C}=e,S=(0,tk.lu)({pub:Y}),D=(0,tk.S2)({pub:Y}),x=(0,m.P)(),T=(0,p.useMemo)(()=>S&&h?d()(Object.values(h.contentBlockData.latestPostFromSections).map(e=>null==e?void 0:e.id)):[],[S,h]),A=(0,p.useMemo)(()=>{var e;let t=new Set(T);return(null!=(e=null==h?void 0:h.newPosts)?e:[]).filter(e=>!t.has(e.id))},[null==h?void 0:h.newPosts,T]),{activeLiveStream:N}=(0,ek.Y)({pub:Y,user:y,preloadedActiveLiveStream:r,disabled:v}),{breakpoint:B,isMobile:M,isDesktop:R}=(0,F.sM)(),[O,L]=(0,p.useState)({}),[z,U]=(0,p.useState)({}),H=(0,p.useCallback)(e=>U(t=>(0,i._)({},t,e)),[]),q=(0,p.useMemo)(()=>(0,i._)({},_,O),[_,O]),G=(0,p.useMemo)(()=>(0,l._)((0,i._)({},Y),{theme:q}),[Y,q]),W=D&&"magaziney"===q.home_hero,K=(0,a.md)(E.jd),V=null!=K?K:q.home_posts,{userSettings:j}=(0,eg.ur)(),X=S&&y&&(null==j?void 0:j.hasSeenOnboardingNewslettersScreen)!==!0,[J,Q]=(0,p.useState)(!1),$=(0,p.useCallback)(()=>Q(!0),[]),[ee,et]=(0,p.useState)(null),en=!!((null==y?void 0:y.is_admin)||(null==y?void 0:y.is_editor)),ei=en?$:null,eo=(0,p.useRef)(null),ea=(0,p.useRef)(null),{heroPosts:es,bodyPosts:ed}=(0,p.useMemo)(()=>{var e,t,n;return(0,g.t)({heroVariant:q.home_hero,breakpoint:B,pub:Y,useCustomTheme:x,homeHeroPins:null!=(e=null==h?void 0:h.homeHeroPins)?e:[],postsForHomeHeroPins:null!=(t=null==h?void 0:h.postsForHomeHeroPins)?t:{},legacyPinnedPosts:null!=(n=null==h?void 0:h.pinnedPosts)?n:[],recentPosts:A})},[q.home_hero,B,Y,x,null==h?void 0:h.homeHeroPins,null==h?void 0:h.postsForHomeHeroPins,null==h?void 0:h.pinnedPosts,A]),ec=es[0],eu=(0,p.useMemo)(()=>{var e;return null==h||null==(e=h.topPosts)?void 0:e.filter(e=>!ec||e.id!==ec.id)},[ec,null==h?void 0:h.topPosts]);if(!h)return(0,o.Y)(f.u,{alignItems:"center",className:Z.A["container--empty"],justifyContent:"center",children:(0,o.Y)("div",{className:"more-loader"})});if(0===A.length&&0===es.length)return(0,o.Y)(tO,{user:y});if(x&&(0,tk.K)({pub:Y}))t=(0,o.Y)(er,{canPinPosts:en,editingContentBlockId:ee,heroPosts:es,homepageData:h,isPreview:v,preloadedContainerRef:en?ea:void 0,preloadedIframeRef:en?eo:void 0,pub:Y,recentPostsForBody:ed,refetchHomepageData:b,setEditingContentBlockId:et,onEditHeroClick:ei});else{var ep,eh,em,ev,ef;let n=q.home_hero,i="podcast"===n,l=(0,tE.tP)({type:"home-body"}),r=["newspaper","podcast"].includes(n)&&"list"===V,a=!!(q.home_show_top_posts&&eu&&"magaziney"!==n&&!M),d=ed.length>0&&"custom"!==V;["feature-media","podcast"].includes(n)&&!a&&(d=!1),(S||D)&&(d=!1);let c=!1,u=!1;S&&(c=null!=(em=null!=(eh=z.showIntroModule)?eh:Y.showIntroModule)&&em,u=null!=(ef=null!=(ev=z.isPortraitLayout)?ev:Y.isPortraitLayout)&&ef);let p=!!((null==(ep=Y.theme)?void 0:ep.custom_footer)&&"default"!==Y.theme.custom_footer.layout);t=(0,o.FD)(f.u,{paddingTop:i||S?0:16,children:[(0,o.Y)(P.I1,{paddingTop:S?R?56:28:0,style:!S&&M?{marginLeft:-16,marginRight:-16}:void 0,children:(0,o.Y)(eI.U,{bodyVariant:q.home_posts,heroAlignment:q.home_hero_alignment,heroVariant:q.home_hero,homeHeroPins:h.homeHeroPins,isMobile:M,isPortraitLayout:u,posts:es,pub:Y,replaceTopPostsWithLatest:W,showIntroModule:c,showPodcastLinks:q.home_hero_show_podcast_links,showTopPosts:q.home_show_top_posts,topPosts:eu,user:y,utm:w,onEditClick:ei})}),(0,o.FD)(P.I1,{id:"modular-home-posts",paddingTop:i&&!a&&"custom"!==V?40:void 0,children:[d&&(0,o.Y)(eZ.r,{numColumns:r?3:4}),(0,o.FD)("div",{id:"home-body",style:{scrollMarginTop:48,paddingTop:D?M?40:64:void 0},children:["custom"!==V&&(0,o.Y)("div",{id:l,children:(0,o.Y)(eJ,{bodyPostGroups:s,hasCustomFooter:p,hasEmptyGroupOptions:e.hasEmptyGroupOptions,hideImagesFromList:(0,tM.$P)({pub:Y}),posts:ed,postsByGroupId:h.postsByGroupId,pub:Y,setHasInvalidGroupSelection:C,source:"".concat(q.home_hero,"-").concat(V,"-home"),user:y,variant:V})}),"custom"===V&&(0,o.Y)(el.h,{editingContentBlockId:ee,firstDividerVariant:i&&!a?"space":void 0,homepageData:h,preloadedContainerRef:en?ea:void 0,preloadedIframeRef:en?eo:void 0,recentPosts:ed,refetchHomepageData:b,setEditingContentBlockId:et,showEmptyStates:v})]})]})]})}return(0,o.FD)(tI,{activeLiveStream:N,freeSignup:c,freeSignupEmail:u,homepageData:h,pub:Y,user:y,utm:w,children:[(0,o.Y)(ty,{activeLiveStream:N,disabled:S}),X&&(0,o.Y)(tT,{pub:Y,user:y}),(0,o.Y)(tv,{abTestingId:I,giftCard:k,pub:Y}),(0,o.Y)(tN.o,{children:t}),S&&(0,o.Y)(ew,{}),J&&(0,o.Y)(tB.Ic,{homepageData:h,module:"@/frontend/publish/theme_editor/editor_v3/HeroEditorModal",preloadedContainerRef:ea,preloadedIframeRef:eo,pub:G,refetchHomepageData:b,resolve:e=>e.HeroEditorModal,whileLoading:(0,o.Y)("div",{}),onClose:()=>Q(!1),onCustomConfigSaved:H,onRequest:()=>Promise.all([n.e("93975"),n.e("55674"),n.e("85915")]).then(n.bind(n,32037)),onSaved:e=>{e&&L(t=>(0,i._)({},t,e)),Q(!1),null==b||b()},onThemeSaveUndone:e=>L(e)}),en&&(0,o.Y)(tD,{containerRef:ea,homepageData:h,iframeRef:eo,isActive:J||!!ee})]})});function tO(e){let{user:t}=e,{iString:n}=(0,S.GO)(),i=!!((null==t?void 0:t.is_admin)||(null==t?void 0:t.is_editor)||(null==t?void 0:t.is_contributor));return(0,o.Y)(f.u,{alignItems:"center",flex:"grow",justifyContent:"center",children:i?(0,o.Y)(P.pT,{flex:"grow",paddingY:64,children:(0,o.Y)(tA.p,{button:(0,o.Y)(eY.$n,{"data-testid":"modular-home-create-first-post",href:(0,B.yRP)("/publish/post",{back:"undefined"!=typeof window?window.location.href:void 0}),localNavigation:!1,children:n("Create your first post")}),description:n("Share your ideas with the world."),icon:(0,o.Y)(et.A,{}),title:n("You haven't published any posts yet.")})}):(0,o.Y)(T.EY.H3,{color:"secondary",paddingY:120,translated:!0,children:"Coming Soon"})})}var tL=n(91089),tz=n(57961);let tU=e=>{var t,n,s,c,v,f,Y,{blurbs:b,freeSignup:_,freeSignupEmail:y,hasEmptyGroupOptions:w,hide_intro_popup:k,homepageData:I,isPreview:C,notify_user:S,pub:D,referralCode:x,showWelcome:P,user:T,postTags:A,launchWelcomePage:N,skipIntroPopupRender:B}=e,M=(0,r._)(e,["blurbs","freeSignup","freeSignupEmail","hasEmptyGroupOptions","hide_intro_popup","homepageData","isPreview","notify_user","pub","referralCode","showWelcome","user","postTags","launchWelcomePage","skipIntroPopupRender"]);let{data:R,refetch:O}=(0,F.bH)({preloadedHomepageData:I}),L=(0,m.P)(),z=(0,eV.be)({pub:D,useCustomTheme:L}),{breakpoint:U}=(0,F.sM)(),H=(0,a.md)(E.jd),q=null!=(v=null!=H?H:null==(t=D.theme)?void 0:t.home_posts)?v:"grid",G=null!=(f=null==(n=D.theme)?void 0:n.home_hero)?f:"newspaper",W=null!=(Y=null==R?void 0:R.newPosts)?Y:[],K=(0,g.z)({breakpoint:U,firstPostMissingImage:!(null==(s=W[0])?void 0:s.cover_image),heroVariant:G,pub:D,useCustomTheme:L}),V=W.length>K;(0,p.useEffect)(()=>{S&&"undefined"!=typeof window&&(0,h.Ay)(S)},[S]);let j=(0,p.useMemo)(()=>{var e,t;return d()(null==(t=D.theme)||null==(e=t.body_post_groups)?void 0:e.map(e=>{var t,n,i,l,r;return e.tag_id?null!=(n=null!=(t=e.post_tag)?t:null==A?void 0:A.find(t=>t.id===e.tag_id))?n:null:e.section_id&&null!=(r=null!=(l=e.section)?l:null==(i=D.sections)?void 0:i.find(t=>t.id===e.section_id))?r:null}))},[A,D.sections,null==(c=D.theme)?void 0:c.body_post_groups]);return D.theme?(0,o.FD)("div",{className:"home-page home-page--modular",children:[(0,o.Y)(tL.PageMetaData,{isHomepage:!0,pub:D}),(0,o.Y)("div",{style:{flex:1},children:(0,o.Y)(tR,(0,l._)((0,i._)({},u()(M,"matches")),{bodyPostGroups:j,freeSignup:_,freeSignupEmail:y,hasEmptyGroupOptions:w,homepageData:R,isPreview:C,pub:D,refetchHomepageData:O,theme:D.theme,user:T}))}),!z.hiddenPreviewBlocks.includes("footer")&&(0,o.Y)(eK.kT,{disabled:z.disabledPreviewBlocks.includes("footer"),flushBottom:!0,previewBlockId:{type:"footer"},children:(0,o.Y)(ee,{activeBodyLayout:q,hasBodyPosts:V,heroLayout:G,isPreview:C,pub:D,user:T})}),B?null:(0,o.Y)(tz.l,{blurbs:b,freeSignup:_,freeSignupEmail:y,hide_intro_popup:k,launchWelcomePage:N,pub:D,referralCode:x,showWelcome:P,user:T})]}):null}},80098:function(e,t,n){n.d(t,{P:()=>s});var i=n(4006),l=n(32485),r=n.n(l),o=n(76977);let a={container:"container-k4OAt1","full-width":"full-width-zjiPxJ",fullWidth:"full-width-zjiPxJ","full-width-with-sidebar":"full-width-with-sidebar-epMpKX",fullWidthWithSidebar:"full-width-with-sidebar-epMpKX","show-below":"show-below-NE36A8",showBelow:"show-below-NE36A8","full-width-with-border-and-sidebar":"full-width-with-border-and-sidebar-aSAAEB",fullWidthWithBorderAndSidebar:"full-width-with-border-and-sidebar-aSAAEB","vertical-divider":"vertical-divider-Z42nad",verticalDivider:"vertical-divider-Z42nad","three-column-width":"three-column-width-gNtKSr",threeColumnWidth:"three-column-width-gNtKSr","three-column-width-with-sidebar":"three-column-width-with-sidebar-cRFEVE",threeColumnWidthWithSidebar:"three-column-width-with-sidebar-cRFEVE","two-column-width":"two-column-width-f6IAWT",twoColumnWidth:"two-column-width-f6IAWT","one-column-two-column":"one-column-two-column-dAuMkN",oneColumnTwoColumn:"one-column-two-column-dAuMkN","two-column-one-column-one-column":"two-column-one-column-one-column-GnEn49",twoColumnOneColumnOneColumn:"two-column-one-column-one-column-GnEn49","one-column-two-column-one-column":"one-column-two-column-one-column-g_nrA3",oneColumnTwoColumnOneColumn:"one-column-two-column-one-column-g_nrA3","one-column-one-column-two-column":"one-column-one-column-two-column-e79cH1",oneColumnOneColumnTwoColumn:"one-column-one-column-two-column-e79cH1","one-column-three-columns":"one-column-three-columns-lf36oo",oneColumnThreeColumns:"one-column-three-columns-lf36oo","three-column-one-column-one-column":"three-column-one-column-one-column-MC1z4c",threeColumnOneColumnOneColumn:"three-column-one-column-one-column-MC1z4c"},s=e=>{let{children:t,hideVerticalDividers:n,showContentBelowOnMobile:l,stretchVertically:s,variant:d}=e,c=n?void 0:"detail-themed";return"none"===d?(0,i.Y)("div",{children:t}):(0,i.Y)("div",{style:s?{flexGrow:1,display:"flex",alignItems:"stretch"}:void 0,children:(0,i.FD)("div",{className:r()(a.container,a[d],{[a["show-below"]]:l}),style:s?{width:"100%"}:void 0,children:[t,"full-width-with-border-and-sidebar"===d&&(0,i.Y)(o.pT,{borderRight:c,className:a["vertical-divider"]}),["two-column-one-column-one-column","one-column-two-column-one-column","one-column-one-column-two-column","three-column-one-column-one-column"].includes(d)&&(0,i.FD)(i.FK,{children:[(0,i.Y)(o.pT,{borderRight:c,className:a["vertical-divider"]}),(0,i.Y)(o.pT,{borderRight:c,className:a["vertical-divider"]})]}),"one-column-two-column"===d&&(0,i.Y)(o.pT,{borderRight:c,className:a["vertical-divider"]})]})})}},9757:function(e,t,n){n.d(t,{I:()=>p});var i=n(4006),l=n(32485),r=n.n(l),o=n(68410),a=n(89490);let s="column-O67nhJ",d="column1-pd0Ws0",c="containerHasPolymarketEmbed-dETYN9",u="columnCollapsed-hX4lgc",p=e=>{let{animateColumns:t,leftContent:n,mainContent:l,rightContent:p,hasPolymarketEmbed:h=!1,stretchToFullWidth:m}=e,{isMobile:g,isTablet:v,isDesktop:f}=(0,o.sM)(),Y=2;m&&(f?Y=4-!!n-!!p:v&&(Y=3-(n||p?1:0))),g&&(Y=1);let b=n||t,_=p||t;return(0,i.Y)("div",{className:"outerContainer-p1amnX",children:(0,i.FD)("div",{className:"container-uYF5Qm",children:[b&&(0,i.Y)(a.az,{className:r()(s,d,{[String(u)]:t&&!n,[String(c)]:n&&h}),paddingTop:8,position:"relative",children:n}),(0,i.Y)(a.az,{className:r()(s,{"column2-jVKqxY":2===Y,"column3-Brgr2S":3===Y,"column4-Z0B2N_":4===Y}),children:l}),_&&(0,i.Y)(a.az,{className:r()(s,d,{[String(u)]:t&&!p,[String(c)]:p&&h}),paddingTop:8,position:"relative",children:p})]})})}},56877:function(e,t,n){n.d(t,{h:()=>d});var i=n(4006),l=n(32485),r=n.n(l),o=n(68410),a=n(76977);let s="column-HNiwn6",d=e=>{let{leftContent:t,rightContent:n,mobileContent:l}=e,{isMobile:d}=(0,o.sM)();return d&&l?l:(0,i.FD)("div",{className:"container-dOq2Em",children:[(0,i.Y)("div",{className:r()(s,"left-jXwsmK"),children:t}),(0,i.Y)(a.Ye,{borderRight:"detail",style:{margin:"8px 0"}}),(0,i.Y)("div",{className:r()(s,"right-koj6uE"),children:n})]})}},24782:function(e,t,n){n.d(t,{A:()=>s});var i=n(4006),l=n(76977),r=n(63136),o=n(49807),a=n(57324);let s=e=>{let{activeLiveStream:t}=e;return(0,i.Y)(l.Ye,{className:"liveStreamBanner-Petbnm",justifyContent:"center",children:(0,i.Y)("a",{href:(0,o.Xrv)({liveStreamId:t.liveStream.id,utm_source:a.VU.web,utm_campaign:a._9.liveStreamPubBanner}),style:{textDecoration:"none"},children:(0,i.FD)(l.Ye,{alignItems:"center",gap:8,padding:12,paddingTop:{desktop:12,mobile:16},children:[(0,i.Y)("div",{className:"liveBadge-f3ITqf",children:(0,i.Y)(r.EY.B5,{color:"white",translated:!0,weight:"semibold",children:"Live"})}),(0,i.FD)(r.EY.B3,{color:"white",translated:!0,weight:"semibold",children:[(0,i.Y)("span",{style:{textTransform:"uppercase"},children:"Live Video"}),": ",I18N.p(t.liveStream.title)]})]})})})}},78120:function(e,t,n){n.d(t,{M:()=>r});var i=n(4006),l=n(63136);let r=e=>{let{children:t,href:n,testid:r,onClick:o}=e;return(0,i.Y)(l.EY.Meta,{as:"a",className:"link-dTkJzr",color:"pub-primary-text","data-native":!0,"data-testid":r,href:n,onClick:o?e=>{e.preventDefault(),o()}:void 0,children:t})}},68265:function(e,t,n){n.d(t,{v:()=>a});var i=n(4006),l=n(76977);let r=e=>{let{children:t,paddingTop:n,paddingBottom:r}=e;return(0,i.Y)("div",{className:"container-FJSDzM",children:(0,i.Y)(l.I1,{paddingBottom:r,paddingTop:n,paddingX:16,children:t})})};var o=n(68410);let a=e=>{let{children:t}=e,{isMobile:n}=(0,o.sM)();return(0,i.Y)(l.I1,{bg:"secondary",className:"container-_aNEvf",paddingY:n?32:64,children:(0,i.Y)(r,{children:t})})}},64648:function(e,t,n){n.d(t,{S:()=>p});var i=n(4006),l=n(33764),r=n(84236),o=n(80098),a=n(68265),s=n(38501),d=n(89490),c=n(76977),u=n(63136);let p=e=>{let{columns:t,description:n,imageUrl:p,name:h,post:m,pub:g,section:v,showPodcastLinks:f,user:Y}=e,b=(0,d.iF)({radius:"lg",shadow:"xl"});return(0,i.Y)(a.v,{children:(0,i.Y)(o.P,{variant:4===t?"full-width-with-sidebar":"three-column-width",children:(0,i.FD)(c.Ye,{alignItems:"center",gap:40,paddingX:8,children:[p&&(0,i.Y)(l.o,{className:b,imageIsFixedWidth:!0,maxWidth:250,src:p,useRetinaSizing:!0}),(0,i.FD)(c.I1,{gap:16,children:[(0,i.FD)(c.I1,{gap:8,children:[(0,i.Y)(u.EY.H2,{color:"pub-primary-text",font:"pub-headings",children:h}),(0,i.Y)(u.EY.B2,{color:"pub-secondary-text",children:n}),(0,i.Y)(r.pJ,{align:"right",post:m,pub:g,section:v})]}),f&&(0,i.Y)(s.D,{post:m,pub:g,section:v,user:Y})]})]})})})}},64232:function(e,t,n){n.d(t,{i:()=>h});var i=n(4006),l=n(33764),r=n(84236),o=n(68410),a=n(80098),s=n(68265),d=n(38501),c=n(89490),u=n(76977),p=n(63136);let h=e=>{let{description:t,imageUrl:n,name:h,post:m,pub:g,section:v,showPodcastLinks:f,user:Y}=e,{isMobile:b}=(0,o.sM)(),_=(0,c.iF)({radius:"sm",shadow:"lg"});return(0,i.Y)(s.v,{children:(0,i.Y)(a.P,{variant:"two-column-width",children:(0,i.FD)(u.I1,{alignItems:"center",gap:24,paddingX:8*!b,children:[n&&(0,i.Y)(l.o,{className:_,imageIsFixedWidth:!0,maxWidth:100,src:n,useRetinaSizing:!0}),(0,i.FD)(u.I1,{gap:8,children:[(0,i.Y)(p.EY.H2,{align:"center",color:"pub-primary-text",font:"pub-headings",children:h}),(0,i.Y)(p.EY.B2,{align:"center",color:"pub-secondary-text",children:t})]}),(0,i.Y)(r.pJ,{align:"center",paddingX:8,post:m,pub:g,section:v}),f&&(0,i.Y)(d.D,{align:"center",post:m,pub:g,section:v,user:Y})]})})})}},13790:function(e,t,n){n.d(t,{_:()=>u});var i=n(4006),l=n(33764),r=n(84236),o=n(68265),a=n(38501),s=n(89490),d=n(76977),c=n(63136);let u=e=>{let{description:t,imageUrl:n,name:u,post:p,pub:h,section:m,showPodcastLinks:g,user:v}=e,f=(0,s.iF)({radius:"lg",shadow:"xl",width:160});return(0,i.Y)(o.v,{children:(0,i.FD)(d.I1,{alignItems:"center",gap:24,children:[n&&(0,i.Y)("div",{children:(0,i.Y)(l.o,{className:f,imageIsFixedWidth:!0,maxWidth:160,src:n,useRetinaSizing:!0})}),(0,i.FD)(d.I1,{gap:16,children:[(0,i.FD)(d.I1,{gap:8,children:[(0,i.Y)(c.EY.H2,{align:"center",color:"pub-primary-text",font:"pub-headings",children:u}),(0,i.Y)(c.EY.B2,{align:"center",color:"pub-secondary-text",children:t}),(0,i.Y)(r.pJ,{align:"center",paddingY:8,post:p,pub:h,section:m})]}),g&&(0,i.Y)(a.D,{limit:2,post:p,pub:h,section:m,stretch:!0,user:v})]})]})})}},38501:function(e,t,n){n.d(t,{D:()=>w});var i=n(69277),l=n(70408),r=n(32641),o=n(4006),a=n(17402),s=n(82519),d=n(13950),c=n(36233),u=n(84605),p=n(86500),h=n(74894),m=n(68349),g=n(35369),v=n(76977),f=n(45859),Y=n(59294),b=n(60816),_=n(7755),y=n(39318);let w=e=>{let{align:t="left",limit:n=4,post:i,pub:l,section:r,stretch:g,user:w}=e,{iString:I}=(0,u.GO)(),{feedUrl:C,isLoaded:S}=(0,Y.Zq)({pub:l,section:r,user:w}),[D,F]=(0,a.useState)(!1),x=i?n-1:n,P=(0,_.Em)({pub:l,section:r,spotifySettings:(0,h.Om)({pub:l,section:null!=r?r:null})}),T=(0,_.dV)({feedUrl:C,isApple:(0,m.cX)()||(0,m.gI)(),isMobile:!1,showLinks:P,userIsSubscribed:!!(null==w?void 0:w.is_subscribed)}),A=T.length+ +!!C>x;(0,a.useEffect)(()=>{S&&F(!0)},[S]);let E=()=>{(0,p.u4)(p.qY.PODCAST_FEED_URL_COPIED,{feedUrl:C}),(0,c.Ay)("RSS feed URL copied"),(0,m.lW)(C)},N=e=>{let{label:t,url:n}=e;return()=>{(0,p.u4)(p.qY.PODCAST_APP_LINK_CLICK,{appName:t,feedUrl:C,url:n}),window.open(n,"_blank")}};return(0,o.Y)(d.DH,{children:(0,o.FD)(v.Ye,{gap:8,justifyContent:"center"===t?"center":void 0,opacity:100*!!D,wrap:"wrap",children:[i&&(0,o.FD)(k,{stretch:g,onClick:N({label:"Substack",url:(0,y.XV8)(l.subdomain,i.slug,{redirect:"app-marketing",source:"podcast-player-link"})}),children:[(0,o.Y)(b.l,{platformKey:"substack"}),"Substack"]}),T.slice(0,x).map(e=>{let{label:t,platform:n,url:i}=e;return(0,o.FD)(k,{stretch:g,onClick:N({label:t,url:i}),children:[(0,o.Y)(b.l,{platformKey:n}),t]})}),C&&!A&&(0,o.FD)(k,{stretch:g,onClick:E,children:[(0,o.Y)(b.l,{platformKey:"rss"}),I("RSS feed")]}),A&&(0,o.FD)(f.W1,{trigger:(0,o.FD)(k,{children:[I("More"),(0,o.Y)(s.A,{})]}),children:[T.slice(x).map(e=>{let{label:t,platform:n,url:i}=e;return(0,o.Y)(f.Dr,{leading:(0,o.Y)(b.l,{platformKey:n}),onClick:N({label:t,url:i}),children:t})}),(0,o.Y)(f.Dr,{leading:(0,o.Y)(b.l,{platformKey:"rss"}),onClick:E,children:I("RSS feed")})]})]})})},k=(0,a.forwardRef)((e,t)=>{var{children:n,stretch:a,onClick:s}=e,d=(0,r._)(e,["children","stretch","onClick"]);return(0,o.Y)(g.$n,(0,l._)((0,i._)({ref:t},d,a?{flex:"grow",justifyContent:"center"}:null),{className:"podcast-player-button",priority:"secondary",onClick:s,children:n}))})},16831:function(e,t,n){n.d(t,{b:()=>c});var i=n(4006),l=n(49802),r=n(50802),o=n(76977),a=n(63136);let s={audio:l.A,video:r.A},d={audio:"Audio",video:"Video"},c=e=>{let{medium:t}=e,n=s[t];return(0,i.FD)(o.Ye,{alignItems:"center",bg:"secondary",color:"pub-secondary-text",gap:4,paddingX:6,radius:"sm",children:[(0,i.Y)(n,{size:12}),(0,i.Y)(a.EY,{font:"text",lineHeight:20,size:12,weight:"semibold",children:d[t]})]})}},24634:function(e,t,n){n.d(t,{t:()=>u});var i=n(4006),l=n(32485),r=n.n(l),o=n(17402),a=n(76977),s=n(22602),d=n(69706);let c=(0,o.forwardRef)((e,t)=>{let{variant:n}=e;return["grid","grid-groups"].includes(n)?(0,i.FD)(a.I1,{ref:t,gap:12,children:[(0,i.Y)("div",{style:{aspectRatio:"".concat(d.qr)},children:(0,i.Y)(s.O,{height:"100%"})}),(0,i.FD)(a.I1,{gap:8,children:[(0,i.Y)(s.O,{height:24,width:"70%"}),(0,i.Y)(s.O,{height:20,width:"90%"}),(0,i.Y)(s.O,{height:20,width:"50%"})]})]}):"list"===n?(0,i.FD)(a.I1,{ref:t,gap:8,children:[(0,i.Y)(s.O,{height:28,width:"60%"}),(0,i.Y)(s.O,{height:24,width:"80%"}),(0,i.Y)(s.O,{height:20,width:"20%"})]}):null}),u=(0,o.forwardRef)((e,t)=>{let{postCount:n,variant:l}=e;return(0,i.Y)("div",{ref:t,className:r()({"loadingContainerGrid-ydRZVl":["grid","grid-groups"].includes(l),"loadingContainerList-gZ_Mu2":"list"===l}),children:Array.from(Array(n)).map(()=>(0,i.Y)(c,{variant:l}))})})},72692:function(e,t,n){n.d(t,{k:()=>d});var i=n(4006),l=n(87677),r=n(84605),o=n(68410),a=n(35369),s=n(76977);let d=e=>{let{url:t}=e,{isMobile:n}=(0,o.sM)(),{iString:d}=(0,r.GO)();return(0,i.Y)(s.Ye,{paddingTop:16,paddingX:8*!n,children:(0,i.Y)(a.$n,{"data-testid":"archive-view-all",href:t,priority:"secondary",trailing:(0,i.Y)(l.A,{size:20}),children:d("See all")})})}},85965:function(e,t,n){n.d(t,{C:()=>u});var i=n(4006),l=n(32485),r=n.n(l),o=n(21013),a=n.n(o),s=n(68410),d=n(98002),c=n(76977);let u=e=>{let{hideDescriptions:t,posts:n,numColumns:l,slotIndexOffset:o=0,onClickPost:u}=e,{isMobile:p}=(0,s.sM)(),h=n.filter(e=>null!==e),m=h.length>0&&h.every(e=>!e.cover_image),g=a()(n,l);return(0,i.Y)(c.I1,{gap:p?28:4,children:g.map((e,n)=>(0,i.Y)(c.Ye,{className:"postRow-schahZ",children:e.map((e,a)=>(0,i.Y)("div",{className:r()("postContainer-okMiTM",{"postContainerTwoColumn-OPvMmL":2===l,"postContainerThreeColumn-W6tLrW":3===l,"postContainerFourColumn-WylYbU":4===l}),children:(0,i.Y)(d.z,{hideDescription:t,hideImage:m,post:e,slotIndex:o+n*l+a,variant:"square",onClick:e?u:void 0})}))}))})}},93800:function(e,t,n){n.d(t,{m:()=>h});var i=n(69277),l=n(70408),r=n(32641),o=n(4006),a=n(32485),s=n.n(a),d=n(80098),c=n(98002),u=n(76977);let p={container:"container-O1YsI6",divider:"divider-QOeHtM",dividerVertical:"dividerVertical-pPOkXS","long-divider":"long-divider-CDn5cl",longDivider:"long-divider-CDn5cl","two-small-one-large":"two-small-one-large-QUGVE5",twoSmallOneLarge:"two-small-one-large-QUGVE5","two-column-grid":"two-column-grid-h3GUav",twoColumnGrid:"two-column-grid-h3GUav","three-column-grid":"three-column-grid-tc6QOt",threeColumnGrid:"three-column-grid-tc6QOt","four-column-grid":"four-column-grid-IPXx88",fourColumnGrid:"four-column-grid-IPXx88","one-column-list":"one-column-list-YqnT5h",oneColumnList:"one-column-list-YqnT5h","one-column-list-flex":"one-column-list-flex-kqNmJm",oneColumnListFlex:"one-column-list-flex-kqNmJm","large-listing-listing-column":"large-listing-listing-column-feCdFL",largeListingListingColumn:"large-listing-listing-column-feCdFL","square-square-column":"square-square-column-b5mOve",squareSquareColumn:"square-square-column-b5mOve","two-column-list":"two-column-list-BLHtzo",twoColumnList:"two-column-list-BLHtzo","two-column-list--with-dividers":"two-column-list--with-dividers-cHfR0M",twoColumnListWithDividers:"two-column-list--with-dividers-cHfR0M","five-up":"five-up-H_hegz",fiveUp:"five-up-H_hegz","vertical-divider":"vertical-divider-GcHWq8",verticalDivider:"vertical-divider-GcHWq8","mini-row":"mini-row-KFztmA",miniRow:"mini-row-KFztmA","three-column-mini-row":"three-column-mini-row-ep3LFs",threeColumnMiniRow:"three-column-mini-row-ep3LFs"},h=e=>{var t;let{flex:n,hideImages:l,hideHorizontalDividers:r,hideVerticalDividers:a,linkToComments:d,posts:h,slotIndexOffset:Y=0,source:b,variant:_,onClickPost:y}=e;if("two-three-two"===_)return(0,o.Y)(g,(0,i._)({},e));if("two-small-three-medium"===_)return(0,o.Y)(m,(0,i._)({},e));if(["mini-row","three-column-mini-row"].includes(_))return(0,o.Y)(v,(0,i._)({},e));let w=a?void 0:"detail-themed",k=r?void 0:"detail-themed";return(0,o.Y)("div",{style:"grow"===n?{flexGrow:1,display:"flex",alignItems:"stretch"}:void 0,children:(0,o.Y)("div",{className:s()(p.container,p[_],{[null!=(t=p["two-column-list--with-dividers"])?t:""]:"two-column-list"===_&&!r}),children:h.map((e,t)=>(0,o.FD)(o.FK,{children:[t>0&&["one-column-list","two-column-list","two-column-grid","three-column-grid","four-column-grid","large-listing-listing-column"].includes(_)&&(0,o.Y)(u.Ye,{borderBottom:k,className:p.divider}),t%2==0&&t>0&&["two-column-grid"].includes(_)&&(0,o.Y)(u.Ye,{borderBottom:k,className:p["long-divider"]}),t%4==0&&t>0&&["four-column-grid"].includes(_)&&(0,o.Y)(u.Ye,{borderBottom:k,className:p["long-divider"]}),(0,o.Y)(c.z,{hideImage:l,linkToComments:d,post:e,slotIndex:Y+t,testid:["large-listing-listing-column","two-small-one-large"].includes(_)?"magazine-spot-".concat(t+1):void 0,variant:f(_,t),onClick:y&&b&&e?n=>{let{event:i}=n;y({event:i,post:e,index:t,source:b})}:void 0}),"five-up"===_&&t===h.length-1&&(0,o.FD)(o.FK,{children:[(0,o.Y)(u.Ye,{borderBottom:k,className:p.divider}),(0,o.Y)(u.Ye,{borderBottom:k,className:p.divider}),(0,o.Y)(u.Ye,{borderRight:w,className:p["vertical-divider"]}),(0,o.Y)(u.Ye,{borderRight:w,className:p["vertical-divider"]})]}),"two-small-one-large"===_&&t===h.length-1&&(0,o.FD)(o.FK,{children:[(0,o.Y)(u.Ye,{borderBottom:k,className:p.divider}),(0,o.Y)(u.Ye,{borderRight:w,className:p["vertical-divider"]})]}),"square-square-column"===_&&1===t&&(0,o.Y)(u.Ye,{borderBottom:k,className:p.divider})]}))})})},m=e=>{let{posts:t,hideVerticalDividers:n,slotIndexOffset:a=0}=e,s=(0,r._)(e,["posts","hideVerticalDividers","slotIndexOffset"]),c=t.slice(0,3),u=t.slice(3);return(0,o.FD)(d.P,{hideVerticalDividers:n,stretchVertically:!0,variant:"one-column-two-column",children:[(0,o.Y)(h,(0,l._)((0,i._)({},s),{flex:"grow",hideImages:!0,posts:c,slotIndexOffset:a,variant:"large-listing-listing-column"})),(0,o.Y)(h,(0,l._)((0,i._)({},s),{flex:"grow",hideImages:!1,posts:u,slotIndexOffset:a+c.length,variant:"square-square-column"}))]})},g=e=>{let{hideVerticalDividers:t,posts:n,slotIndexOffset:a=0}=e,s=(0,r._)(e,["hideVerticalDividers","posts","slotIndexOffset"]),c=n.slice(0,3),u=n.slice(3,5),p=n.slice(5);return(0,o.FD)(d.P,{hideVerticalDividers:t,variant:"one-column-two-column-one-column",children:[(0,o.Y)(h,(0,l._)((0,i._)({},s),{flex:"grow",hideImages:!0,posts:c,slotIndexOffset:a,variant:"large-listing-listing-column"})),(0,o.Y)(h,(0,l._)((0,i._)({},s),{flex:"grow",hideImages:!1,posts:u,slotIndexOffset:a+c.length,variant:"square-square-column"})),(0,o.Y)(h,(0,l._)((0,i._)({},s),{flex:"grow",hideImages:!1,posts:p,slotIndexOffset:a+c.length+u.length,variant:"square-square-column"}))]})},v=e=>{let{linkToComments:t,posts:n,slotIndexOffset:i=0,source:l,variant:r,onClickPost:a}=e;return(0,o.Y)("div",{children:(0,o.Y)("div",{className:s()(p.container,p[r]),children:n.slice(0,"mini-row"===r?4:3).map((e,n)=>(0,o.FD)(o.FK,{children:[n>0&&(0,o.Y)(u.Ye,{alignItems:"center",className:s()(p.divider,p.dividerVertical),paddingY:8,children:(0,o.Y)(u.Ye,{borderLeft:"detail-themed"})}),(0,o.Y)(c.z,{linkToComments:t,post:e,slotIndex:i+n,variant:f(r,n),onClick:a&&l&&e?t=>{let{event:i}=t;a({event:i,post:e,index:n,source:l})}:void 0})]}))})})},f=(e,t)=>"square-square-column"===e?"square":"large-listing-listing-column"===e?0===t?"large":"listing":"two-small-one-large"===e?0===t?"large":"square":"two-column-list"===e?"listing":"five-up"===e?0===t?"large":"square":["mini-row","three-column-mini-row","one-column-list","one-column-list-flex"].includes(e)?"mini":"square"},72750:function(e,t,n){n.d(t,{h:()=>Q});var i=n(69277),l=n(70408),r=n(4006),o=n(13264),a=n(17402),s=n(13950),d=n(24466),c=n(36233),u=n(16447),p=n(33764),h=n(20562),m=n(68410),g=n(16831),v=n(76977),f=n(63136),Y=n(4016),b=n(57324);let _=e=>{let{description:t,logoUrl:n,name:i,pub:l,section:o,user:a}=e,{isMobile:s}=(0,m.sM)(),d=(0,Y.s7)({pub:l,includeTheRampart:!0});return(0,r.FD)(v.Ye,{alignItems:"center",direction:s?"column":"row",gap:32,paddingBottom:24,paddingTop:16,paddingX:8*!s,children:[n&&(0,r.Y)(p.o,{alt:i,className:"logo-vqxCjr",imageIsFixedWidth:!0,maxWidth:300,src:n,useRetinaSizing:!0}),(0,r.FD)(v.I1,{gap:16,children:[(0,r.FD)(v.I1,{children:[d&&(null==a?void 0:a.is_subscribed)&&(0,Y.rD)({sectionId:null==o?void 0:o.id})&&(0,r.Y)(f.EY.Meta,{color:"accent",paddingBottom:8,children:"+ Member-Only"}),(0,r.Y)(f.EY.H1,{color:"pub-primary-text",font:"pub-headings",children:i}),d&&(0,r.Y)(v.Ye,{alignItems:"center",gap:8,paddingBottom:12,paddingTop:8,children:(0,Y.ot)({sectionId:null==o?void 0:o.id}).map(e=>(0,r.Y)(g.b,{medium:e}))}),t&&(0,r.Y)(v.I1,{gap:8,children:t.split("\n").map(e=>(0,r.Y)(f.EY.B3,{color:"pub-secondary-text",children:e}))})]}),d&&(0,r.Y)(h.t,{pub:l,section:o,trackingSource:b.VU.sectionPage,variant:(null==a?void 0:a.is_subscribed)?"default":"member-only"})]})]})};var y=n(84605),w=n(74894),k=n(59294),I=n(66728),C=n(7755);let S=e=>{let{firstPodcastPost:t,pub:n,user:i,section:l=null}=e,{iString:o}=(0,y.GO)(),{isMobile:a}=(0,m.sM)(),{feedUrl:s}=(0,k.Zq)({pub:n,user:i,section:l}),d=(0,C.Em)({pub:n,section:l,spotifySettings:(0,w.Om)({pub:n,section:null!=l?l:null})});return(0,r.Y)(v.pT,{paddingX:8*!a,children:(0,r.Y)(I.b,{description:o("Add this podcast to your player of choice:"),feedUrl:s,post:null!=t?t:null,pub:n,section:l,showLinks:d,user:i})})};var D=n(10939),F=n(91089),x=n(93800),P=n(12592),T=n(56458),A=n(82776);let E=e=>{var t,n,i,l;let{newPosts:o,pinnedPosts:a,podcastSettings:d,pub:c,search:p,section:h,sort:g,user:v,utm:f,welcomeAndShareElement:Y}=e,{isMobile:b}=(0,m.sM)(),y=(0,A.sectionIsSpecificallyMarkedAsNewsletter)({pub:c,section:h});return(0,r.Y)(s.DH,{children:(0,r.FD)(P.c,{columns:3,children:[(0,r.Y)(F.PageMetaData,{isPodcast:!0,pub:c,section:h}),(0,r.Y)(_,{description:null!=(t=d.description)?t:"",logoUrl:(null==v?void 0:v.is_subscribed)&&null!=(n=d.paidEpisodeArtUrl)?n:d.artUrl,name:null!=(i=d.title)?i:"",pub:c,section:h,user:v}),!b&&(0,r.Y)(D.r,{numColumns:4}),(0,r.FD)("div",{className:"bodyContainer-P2vZHh",children:[(0,r.Y)(u.M,{isPodcast:!y,maxPosts:7,newPosts:o,pinnedPosts:a,pub:c,search:p,sectionId:null==h?void 0:h.id,sort:g,user:v,utm:f,variant:"list",children:e=>{let{posts:t,linkToComments:n,onClickPost:i}=e;return(0,r.Y)(x.m,{hideImages:(0,T.$P)({pub:c}),linkToComments:n,posts:t,variant:"two-column-list",onClickPost:i})}}),(0,r.Y)(S,{firstPodcastPost:null!=(l=null==o?void 0:o.filter(e=>"podcast"===e.type)[0])?l:null,pub:c,section:h,user:v})]}),Y]})})};var N=n(32485),B=n.n(N),M=n(80098),R=n(9757),O=n(89490);let L=e=>{let{align:t,columns:n,description:i,imageUrl:l,name:o,pub:a}=e,{isMobile:s}=(0,m.sM)(),d=(0,O.iF)({radius:"md",width:80}),c=(0,r.FD)(v.I1,{paddingTop:16,children:[(0,r.FD)(v.I1,{alignItems:"center"===t?"center":void 0,gap:12,paddingX:8*!s,children:[l&&(0,r.Y)(p.o,{className:d,imageIsFixedWidth:!0,maxWidth:80,src:l,useRetinaSizing:!0}),(0,r.Y)(f.EY.H1,{className:B()({"pillarHeader-Bn88EX":(0,Y.S2)({pub:a})}),color:"pub-primary-text",font:"pub-headings",children:o}),(0,r.Y)(f.EY.B2,{align:t,color:"pub-secondary-text",children:i})]}),(0,r.Y)(D.r,{paddingBottom:0,paddingTop:32})]});return 2===n?(0,r.Y)(R.I,{mainContent:c}):(0,r.Y)(M.P,{variant:"three-column-width",children:c})};var z=n(64648),U=n(64232),H=n(13790),q=n(70557),G=n(49807);let W=e=>{var t;let{columns:n,podcastSettings:i,firstPost:l,hasNoPosts:o,heroAlignment:a,pub:s,section:d,showPodcastLinks:c,user:u,utm:p,variant:h}=e,{isMobile:g}=(0,m.sM)(),Y=null!=(t=i?i.description:null==d?void 0:d.description)?t:"",b=i?i.artUrl:null==d?void 0:d.logo_url,_=i?i.title:null==d?void 0:d.name,y=(0,G.ScI)(b);if("feature-media"===h&&2!==n){let e;return e=l?(0,r.Y)(q.X,{columns:n,hideLogo:!b||y,isPodcast:!!i,post:l,pub:s,section:d,showPodcastLinks:c,user:null!=u?u:null,utm:p}):o?(0,r.Y)(v.I1,{alignItems:"center",justifyContent:"center",paddingTop:32,children:(0,r.Y)(f.EY.MarketingHeading2,{font:"pub-headings",translated:!0,children:"Coming Soon"})}):null,(0,r.Y)(v.I1,{paddingTop:g?16:24,children:e})}return"podcast"===h&&g?(0,r.Y)(H._,{description:Y,imageUrl:b,name:_,post:l,pub:s,section:null!=d?d:null,showPodcastLinks:c,user:u}):"podcast"===h&&"center"===a?(0,r.Y)(U.i,{description:Y,imageUrl:b,name:_,post:l,pub:s,section:null!=d?d:null,showPodcastLinks:c,user:u}):"podcast"===h&&i?(0,r.Y)(z.S,{columns:Math.max(n,3),description:Y,imageUrl:b,name:_,post:l,pub:s,section:null!=d?d:null,showPodcastLinks:c,user:u}):(0,r.Y)(L,{align:a,columns:Math.min(n,3),description:Y,imageUrl:y?null:b,name:_,pub:s})};var K=n(28528),V=n(7761);let j=e=>{let{columns:t,isPodcast:n,newPosts:i,pinnedPosts:l,pub:o,search:a,section:s,sort:d,user:c,utm:p,variant:h,onChangeFirstPost:m}=e,g=7;"grid"===h&&(4===t&&(g=8),3===t&&(g=9));let v=(0,r.Y)(u.M,{includePins:!(n&&!s),isPodcast:n,maxPosts:g,newPosts:i,pinnedPosts:l,pub:o,search:a,sectionId:null==s?void 0:s.id,sort:d,user:c,utm:p,variant:h,onPostsLoaded:e=>{var t;let{posts:n}=e;m({post:null!=(t=n[0])?t:null})},children:e=>{let{posts:n,linkToComments:i,onClickPost:l}=e;return(0,r.Y)(V.WO,{canPinToSection:!0,pub:o,showPubPins:!1,showSectionPins:!0,children:(0,r.Y)(x.m,{hideHorizontalDividers:"grid"===h,hideImages:(0,T.$P)({pub:o}),linkToComments:i,posts:n,variant:function(e){let{columns:t,variant:n}=e;return"list"===n?"two-column-list":4===t?"four-column-grid":"three-column-grid"}({columns:t,variant:h}),onClickPost:l})})}});return"list"===h?(0,r.Y)(R.I,{mainContent:v}):(0,r.Y)(M.P,{variant:function(e){let{columns:t}=e;return 4===t?"full-width":"three-column-width"}({columns:t}),children:v})};var X=n(57961),J=n(71783),Z=n(46009);let Q=e=>{var t,n,u,p,h,g,f,b,_,y,w,k,I,C;let{blurbs:S,freeSignup:D,freeSignupEmail:x,hide_intro_popup:T,isPodcast:A,newPostsForPubPodcast:N,notify_user:B,pageTheme:M,pub:R,referralCode:O,search:L,slug:z,sort:U,showWelcome:H,user:q,utm:G,launchWelcomePage:V,sectionPageData:Q,skipIntroPopupRender:ee}=e,{isMobile:et,isTablet:en}=(0,m.sM)(),ei=(0,o.md)(J.cd),el=(0,o.md)(J.qG),er=(0,o.md)(J.$G),eo=(0,o.md)(J.n6),ea=(0,i._)({},ei,el),es=(0,i._)({},er,eo),ed=z?R.sections.find(e=>e.slug===z):void 0,ec=A&&!ed,eu=null!=(g=null!=(h=null!=M?M:ec?null==(t=R.pageThemes)?void 0:t.podcast:null==ed?void 0:ed.pageTheme)?h:null==(n=R.theme)?void 0:n.section_template)?g:null,ep=A&&!ed?N:null==Q||null==(u=Q[null!=(f=null==ed?void 0:ed.id)?f:0])?void 0:u.newPosts,eh=null==Q||null==(p=Q[null!=(b=null==ed?void 0:ed.id)?b:0])?void 0:p.pinnedPosts,em=null!=(_=[...null!=eh?eh:[],...null!=ep?ep:[]][0])?_:null,[eg,ev]=(0,a.useState)(em?{[ed?ed.id:"pubPodcast"]:em}:{}),[ef,eY]=(0,a.useState)(!1),eb=null!=(y=eg[ed?ed.id:"pubPodcast"])?y:null,e_=(0,a.useCallback)(e=>{let{post:t}=e;eb||(t?(ev(e=>(0,l._)((0,i._)({},e),{[ed?ed.id:"pubPodcast"]:t})),eY(!1)):eY(!0))},[eb,ed]);if((0,a.useEffect)(()=>{B&&"undefined"!=typeof window&&(0,c.Ay)(B)},[B]),!ed&&!A)return console.warn("Should be either a section or podcast or both"),null;let ey=null;if((A||(null==ed?void 0:ed.is_podcast))&&(ey=ed?(0,Z.lL)({pub:R,section:ed}):(0,Z.j_)({pub:R})),(0,Y.lu)({pub:R})&&(A||ed))return(0,r.Y)(d.N,{freeSignup:D,freeSignupEmail:x,isPodcast:!!A,newPosts:ep,pub:R,scheduledLiveStreams:null==Q||null==(w=Q[null!=(k=null==ed?void 0:ed.id)?k:0])?void 0:w.scheduledLiveStreams,section:null!=ed?ed:null,user:q,utm:G},null!=(I=null==ed?void 0:ed.id)?I:-1);let ew=(0,Y.s7)({pub:R,includeTheRampart:!0})&&ey,ek=(0,r.Y)(X.l,{blurbs:S,freeSignup:D,freeSignupEmail:x,hide_intro_popup:T,isPodcast:A,launchWelcomePage:V,pub:R,referralCode:O,showWelcome:H,user:q});if(ew&&ey&&ed)return(0,r.Y)(E,{newPosts:ep,pinnedPosts:eh,podcastSettings:ey,pub:R,search:L,section:ed,sort:U,user:q,utm:G,welcomeAndShareElement:ee?null:ek});let eI=eu;eI||(eI=((null==ed?void 0:ed.is_podcast)||A)&&!ef?{hero_alignment:"left",page_hero:"feature-media",page_posts:"grid",show_podcast_links:!1}:{hero_alignment:"left",page_hero:"default",page_posts:"list",show_podcast_links:!1}),eI.page_hero=$(eI.page_hero);let eC=2,eS="grid"===(eI=(0,i._)({},eI,A?ea:es)).page_posts?3:2;return"feature-media"===eI.page_hero?"grid"===eI.page_posts?eC=eS=en?3:4:"list"===eI.page_posts&&(eC=3,eS=2):eC=eS,(0,r.Y)(K.XL,{pub:R,children:(0,r.Y)(s.DH,{children:(0,r.FD)(P.c,{columns:4,paddingTop:"podcast"===eI.page_hero||"feature-media"===eI.page_hero?0:void 0,children:[(0,r.Y)(F.PageMetaData,{isPodcast:A,pub:R,section:ed}),(0,r.Y)(W,{columns:eC,firstPost:eb,hasNoPosts:ef,heroAlignment:eI.hero_alignment,podcastSettings:ey,pub:R,section:ed,showPodcastLinks:eI.show_podcast_links,user:q,utm:G,variant:eI.page_hero}),(0,r.Y)(v.I1,{opacity:"feature-media"!==eI.page_hero||eb?100:0,paddingBottom:32,paddingTop:et?24:32,children:(0,r.Y)(j,{columns:eS,isPodcast:!!A,newPosts:ep,pinnedPosts:eh,pub:R,search:L,section:ed,sort:U,user:q,utm:G,variant:eI.page_posts,onChangeFirstPost:e_},null!=(C=null==ed?void 0:ed.id)?C:-1)}),!ee&&ek]})})})},$=e=>null!=e?e:"default"},57961:function(e,t,n){n.d(t,{l:()=>h});var i=n(4006),l=n(17402),r=n(9266),o=n(58398),a=n(12215);let s=["astralcodexten","thecoddlingmovie","bariweiss","theprepress"];var d=n(41086),c=n(82776),u=n(68349),p=n(39318);let h=e=>{let{blurbs:t,freeSignup:n,freeSignupEmail:h,hide_intro_popup:m,pub:g,referralCode:v,showWelcome:f,user:Y,launchWelcomePage:b}=e,[_,y]=(0,l.useState)(!1),w=(e=>{let{pub:t,user:n,freeSignup:i}=e,l=new Date(Date.now()-864e5);if((0,d.y)("no_cover")||(0,d.y)("hide_intro_popup"))return!0;if((0,d.y)("showWelcome"))return!1;if("share"===(0,d.y)("action")||(0,d.y)("accepting_gift")||!t||s.includes(t.subdomain)||i||n&&(n.is_free_subscribed||n.is_subscribed||n.is_contributor))return!0;let r=a.get("intro_popup_last_hidden_at");return!!(r&&new Date(r)>=l||"undefined"!=typeof navigator&&(0,c.isSearchEngineCrawlerQuick)(navigator.userAgent))})({pub:g,user:Y,freeSignup:n});return(0,l.useEffect)(()=>{"share"===(0,d.y)("action")&&(window.history.replaceState({},document.title,(0,p.oRR)({action:null})),y(!0)),"undefined"!=typeof window&&f&&(0,u.qm)("showWelcome")},[f]),(0,i.FD)(i.FK,{children:[(0,i.Y)(o.Z,{isOpen:_,medium:"web",pub:g,user:Y,onClose:()=>y(!1)}),(0,i.Y)(r.Ay,{blurbs:t,freeSignup:n,freeSignupEmail:h,hidden:m||_||w,launchWelcomePage:b,publication:g,referralCode:v,showOnMount:f,user:Y})]})}},91704:function(e,t,n){n.d(t,{i:()=>o});var i=n(69277);let l={sm:{size:15,lineHeight:20},md:{size:19,lineHeight:26},lg:{size:30,lineHeight:38},mobileMd:{size:17,lineHeight:24},mobileLg:{size:30,lineHeight:38}},r={sinocism:{sm:{size:13,lineHeight:20},md:{size:16,lineHeight:24},lg:{size:27,lineHeight:36},mobileMd:{size:16,lineHeight:24},mobileLg:{size:27,lineHeight:36}},thepillar:{sm:{size:16,lineHeight:20,fontFamily:"Georgia, serif"},md:{size:22,lineHeight:28,fontFamily:"Georgia, serif"},lg:{size:36,lineHeight:42,fontFamily:"Georgia, serif"},mobileMd:{size:20,lineHeight:26,fontFamily:"Georgia, serif"},mobileLg:{size:28,lineHeight:36,fontFamily:"Georgia, serif"}}},o=e=>{let{preset:t,pub:n}=e;return(n?(0,i._)({},l,r[n.subdomain]):l)[t]}},11574:function(e,t,n){n.d(t,{$:()=>Y});var i=n(69277),l=n(70408),r=n(4006),o=n(32485),a=n.n(o),s=n(70103),d=n(78956),c=n(15894),u=n(77433),p=n(68410),h=n(80098),m=n(60355),g=n(76977),v=n(49807),f=n(45663);let Y=e=>{let{posts:t,title:n,variant:o,viewAllUrl:a,headerVariant:s="align-left-with-see-all"}=e,d={posts:t,title:n,viewAllUrl:a,headerVariant:s};switch(o){case"special-feature":return(0,r.Y)(b,(0,i._)({},d));case"large-in-middle":return(0,r.Y)(w,(0,l._)((0,i._)({},d),{largeColumnPosition:"middle"}));case"large-on-left":return(0,r.Y)(w,(0,l._)((0,i._)({},d),{largeColumnPosition:"left"}));case"large-on-right":return(0,r.Y)(w,(0,l._)((0,i._)({},d),{largeColumnPosition:"right"}));default:return null}},b=e=>{let{posts:t,title:n}=e,{isMobile:i,isTablet:l,isDesktop:o}=(0,p.sM)();return i?(0,r.Y)(_,{posts:t,title:n}):(0,r.FD)("div",{children:[(0,r.Y)(y,{title:n}),(0,r.FD)(h.P,{hideVerticalDividers:!0,variant:"one-column-two-column-one-column",children:[t[0]&&(0,r.Y)(m.R,{align:o?"center":"left",post:t[0],showImageLast:o,titlePreset:"h2-serif",variant:"large"}),(0,r.Y)(d.A,{paddingTop:64*!!o,children:t.slice(1,l?5:3).map(e=>(0,r.Y)(m.R,{align:"center",hideDescription:!0,post:e,titlePreset:"h5-sans",variant:"square"}))}),o&&(0,r.Y)(d.A,{paddingTop:64,children:t.slice(3,5).map(e=>(0,r.Y)(m.R,{align:"center",hideDescription:!0,post:e,titlePreset:"h5-sans",variant:"square"}))})]}),(0,r.Y)("div",{className:f.A.threeColumnContainer,children:t.slice(5,8).map(e=>(0,r.Y)(g.I1,{borderTop:"detail-themed",paddingTop:24,children:(0,r.Y)(m.R,{align:"center",hideDescription:!0,hideImage:!0,post:e,variant:"square"})}))})]})},_=e=>{let{title:t,posts:n}=e;return(0,r.FD)("div",{children:[(0,r.Y)(y,{title:t}),(0,r.FD)(g.I1,{gap:32,children:[n[0]&&(0,r.Y)(m.R,{align:"left",post:n[0],titlePreset:"h2-serif",variant:"large"}),(0,r.Y)(s.Z,{children:n.slice(1,5).map(e=>(0,r.Y)(m.R,{hideDescription:!0,post:e,titlePreset:"h5-sans",variant:"square"}))}),(0,r.Y)(d.A,{gap:16,includeTopDivider:!0,children:n.slice(5,8).map(e=>(0,r.Y)(m.R,{post:e,variant:"mini"}))})]})]})},y=e=>{let{title:t}=e,{isMobile:n}=(0,p.sM)(),i="America at 250"===t;return(0,r.FD)(g.Ye,{alignItems:"center",className:f.A.specialFeatureHeaderContainer,gap:20,paddingBottom:n?28:56,children:[(0,r.Y)("div",{className:i?a()(f.A.thickRule,f.A.a250Rule):f.A.thickRule}),i?(0,r.Y)("a",{className:f.A.america250HomepageHeader,href:"/america250",children:(0,r.Y)("img",{className:f.A.a250Logo,src:(0,v.dJ9)("".concat((0,v.Ewe)(),"/img/thefp/a250_homepage.png"),500,{quality:"auto:good",crop:"limit"}),width:446})}):(0,r.Y)(c.T,{color:"accent",preset:"st3",children:t}),(0,r.Y)("div",{className:i?a()(f.A.thickRule,f.A.a250Rule):f.A.thickRule})]})},w=e=>{let{largeColumnPosition:t,posts:n,title:i,viewAllUrl:l,headerVariant:o}=e,{isMobile:a,isTablet:s,isDesktop:c}=(0,p.sM)();return a?(0,r.Y)(k,{headerVariant:o,posts:n,title:i,viewAllUrl:l}):(0,r.FD)(g.I1,{gap:28,children:[(0,r.Y)(u.M,{title:i,titlePreset:"st2",variant:o,viewAllUrl:l}),(0,r.FD)(h.P,{hideVerticalDividers:!0,variant:{middle:"one-column-two-column-one-column",left:"two-column-one-column-one-column",right:"one-column-one-column-two-column"}[t],children:[n[0]&&(0,r.Y)(m.R,{align:"left",post:n[0],titlePreset:"h3-condensed",variant:"large"}),(0,r.Y)(d.A,{paddingTop:40*!!c,children:n.slice(1,s?5:3).map(e=>(0,r.Y)(m.R,{hideDescription:s,post:e,variant:"square"}))}),c&&(0,r.Y)(d.A,{paddingTop:40,children:n.slice(3,5).map(e=>(0,r.Y)(m.R,{post:e,variant:"square"}))})]})]})},k=e=>{let{posts:t,title:n,viewAllUrl:i,headerVariant:l}=e;return(0,r.FD)(g.I1,{gap:20,children:[(0,r.Y)(u.M,{title:n,titlePreset:"st2",variant:l,viewAllUrl:i}),(0,r.FD)(g.I1,{gap:32,children:[t[0]&&(0,r.Y)(m.R,{align:"left",post:t[0],titlePreset:"h3-condensed",variant:"large"}),(0,r.Y)(s.Z,{children:t.slice(1,5).map(e=>(0,r.Y)(m.R,{hideDescription:!0,post:e,variant:"square"}))})]})]})}},77433:function(e,t,n){n.d(t,{M:()=>p});var i=n(69277),l=n(32641),r=n(4006),o=n(63446),a=n(15894),s=n(84605),d=n(68410),c=n(76977),u=n(45663);let p=e=>{var{variant:t="align-left-with-see-all"}=e,n=(0,l._)(e,["variant"]);return"align-left-with-see-all"===t?(0,r.Y)(h,(0,i._)({},n)):(0,r.Y)(m,(0,i._)({},n))},h=e=>{let{titlePreset:t,title:n,viewAllUrl:i}=e,{iString:l}=(0,s.GO)(),{isMobile:p}=(0,d.sM)();return(0,r.FD)(c.Ye,{alignItems:"baseline",flex:"grow",gap:16,position:"relative",children:[(0,r.Y)(a.T,{preset:t,children:n}),(0,r.FD)(c.Ye,{alignItems:"end",flex:"grow",children:[(0,r.Y)("div",{className:u.A.mediumRule}),i&&(p?(0,r.Y)(c.Ye,{className:u.A.headerButtonMobile,position:"absolute",children:(0,r.Y)(o.v,{href:i,size:"md",trailingIcon:"chevron-right",variant:"tertiary",children:l("See all")})}):(0,r.Y)(o.v,{href:i,trailingIcon:"chevron-right",children:l("See all")}))]})]})},m=e=>{let{titlePreset:t,title:n}=e;return(0,r.FD)(c.Ye,{alignItems:"baseline",flex:"grow",gap:16,position:"relative",children:[(0,r.Y)("div",{className:u.A.mediumRule}),(0,r.Y)(a.T,{preset:t,children:n})]})}},79531:function(e,t,n){n.d(t,{t:()=>o,z:()=>r});var i=n(4016),l=n(86898);function r(e){var t,n,r;let{breakpoint:o,firstPostMissingImage:a,heroVariant:s,pub:d,useCustomTheme:c}=e;if((0,i.lu)({pub:d}))return"tablet"===o?9:11;if((0,i.S2)({pub:d})&&"magaziney"===s)return(null!=(n=null==(t=l.O[s])?void 0:t.postCount)?n:l.O.newspaper.postCount)[o]+("tablet"===o?3:6);if(c&&(0,i.K)({pub:d}))return 1;let u=(null!=(r=l.O[s])?r:l.O.newspaper).postCount[o];return a&&["magaziney","magazine-5"].includes(s)&&["desktop","tablet"].includes(o)&&(u+=2),u}function o(e){var t;let{heroVariant:n,breakpoint:i,pub:o,useCustomTheme:a,homeHeroPins:s,postsForHomeHeroPins:d,legacyPinnedPosts:c,recentPosts:u}=e,p=s.length>0,h=p?s.find(e=>0===e.position):void 0,m=h?d[h.post_id]:p?u[0]:null!=(t=c[0])?t:u[0],g=r({breakpoint:i,firstPostMissingImage:!(null==m?void 0:m.cover_image),heroVariant:n,pub:o,useCustomTheme:a});return p?function(e){let{numSlots:t,homeHeroPins:n,postsForHomeHeroPins:i,recentPosts:r}=e,o=new Set(n.map(e=>e.post_id)),a=r.filter(e=>!o.has(e.id)),{posts:s}=(0,l.wJ)({posts:a,contentBlockPins:n,pinnedPosts:i,capAtOriginalLength:!1}),d=s.filter(e=>null!==e),c=d.slice(0,t),u=d.slice(t),p=new Set(c.map(e=>e.id)),h=new Set(u.map(e=>e.id));return{heroPosts:c,bodyPosts:[...u,...a.filter(e=>!p.has(e.id)&&!h.has(e.id))]}}({numSlots:g,homeHeroPins:s,postsForHomeHeroPins:d,recentPosts:u}):c.length>0?function(e){let{numSlots:t,legacyPinnedPosts:n,recentPosts:i}=e,l=new Set(n.map(e=>e.id)),r=[...n,...i.filter(e=>!l.has(e.id))];return{heroPosts:r.slice(0,t),bodyPosts:r.slice(t)}}({numSlots:g,legacyPinnedPosts:c,recentPosts:u}):{heroPosts:u.slice(0,g),bodyPosts:u.slice(g)}}},41477:function(e,t,n){n.d(t,{c:()=>i});let i=(0,n(17402).createContext)({activeLiveStream:void 0,latestPostByContributorId:void 0,latestPodcastPosts:void 0,latestPostFromSections:void 0,contributors:void 0,freeSignup:void 0,freeSignupEmail:void 0,homepageLinks:void 0,numRecommendations:void 0,recommendations:void 0,topPosts:void 0})},28528:function(e,t,n){n.d(t,{XL:()=>c,np:()=>u,wZ:()=>d});var i=n(69277),l=n(70408),r=n(4006),o=n(69843),a=n.n(o),s=n(17402);let d=(0,s.createContext)({authorPagesEnabled:!1,cropGravity:"center",disableInteractive:!1,hideUfi:!1,highlightByline:!1,linkToComments:!1,pub:null,modifiedPosts:{},user:null,onChangePost:()=>void 0,onUpdatePub:()=>void 0}),c=e=>{let{actionsClassName:t,authorPagesEnabled:n,children:o,cropGravity:c,disableInteractive:u,hideUfi:p,highlightByline:h,linkToComments:m,postPreviewUrl:g,pub:v,showSectionOrTag:f,user:Y,utm:b,onClickPost:_,onToggleMenu:y}=e,w=(0,s.useContext)(d),[k,I]=(0,s.useState)({}),[C,S]=(0,s.useState)({}),D=(0,s.useCallback)(e=>{let{post:t}=e;I(e=>(0,l._)((0,i._)({},e),{[t.id]:t}))},[]),F=(0,s.useCallback)(e=>{S(t=>(0,i._)({},t,e))},[]),x=(0,s.useMemo)(()=>{let e=null!=v?v:w.pub;return e&&0!==Object.keys(C).length?(0,i._)({},e,C):e},[v,w.pub,C]);return(0,r.Y)(d.Provider,{value:(0,l._)((0,i._)({},w,a()(t)?null:{actionsClassName:t},a()(n)?null:{authorPagesEnabled:n},a()(c)?null:{cropGravity:c},a()(u)?null:{disableInteractive:u},a()(p)?null:{hideUfi:p},a()(h)?null:{highlightByline:h},a()(m)?null:{linkToComments:m},a()(g)?null:{postPreviewUrl:g},a()(x)?null:{pub:x},a()(f)?null:{showSectionOrTag:f},a()(Y)?null:{user:Y},a()(b)?null:{utm:b},a()(_)?null:{onClickPost:_},a()(y)?null:{onToggleMenu:y}),{modifiedPosts:k,onChangePost:D,onUpdatePub:F}),children:o})},u=()=>{let e=(0,s.useContext)(d);if(!e.pub)throw Error("No pub provided to PostPreviewContext");return e}},31856:function(e,t,n){n.d(t,{z:()=>d});var i=n(4006),l=n(32485),r=n.n(l),o=n(22602),a=n(69706),s=n(22232);let d=e=>{let{aspectRatio:t=a.B7,radius:n,width:l}=e,d=l?{width:l,height:l/t}:{width:"100%",paddingBottom:"".concat(100/t,"%"),position:"relative"};return(0,i.FD)("div",{className:r()(s.A.noAnimation,!n&&s.A.placeholderImage),style:d,children:[!l&&(0,i.Y)("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0},children:(0,i.Y)(o.O,{height:"100%",radius:null!=n?n:"none",width:"100%"})}),l&&(0,i.Y)(o.O,{height:"100%",radius:null!=n?n:"none",width:"100%"})]})}},67190:function(e,t,n){n.d(t,{x:()=>a});var i=n(4006),l=n(22602),r=n(22232);let o={sm:12,md:16,lg:24},a=e=>{let{size:t="md",width:n}=e;return(0,i.Y)("div",{className:r.A.noAnimation,children:(0,i.Y)(l.O,{height:o[t],radius:"xs",width:n})})}},98002:function(e,t,n){n.d(t,{z:()=>W});var i=n(69277),l=n(70408),r=n(32641),o=n(79785),a=n(4006),s=n(32485),d=n.n(s),c=n(17402),u=n(84605),p=n(68349),h=n(68410),m=n(28528),g=n(41935),v=n(76977),f=n(82776);let Y=e=>{let{justified:t,post:n}=e,{actionsClassName:i,pub:l,user:r,onChangePost:o,onToggleMenu:s}=(0,m.np)(),d="restack"===n.type;return d?null:(0,a.Y)(v.I1,{className:i,children:(0,a.Y)(g.xx,{allowEdit:!d,editButtonIsLast:!0,hideComments:!(0,f.showCommentsOnPost)({publication:l,post:n}),hideReactions:!l.community_enabled,hideShare:d,isStatic:!1,justified:t,labelStyle:"counts-or-none",position:"pub-preview",post:n,pub:l,showRestackButton:!0,user:r,variant:"compressed",onChange:o,onToggleMenu:s})})};var b=n(84032),_=n(29042),y=n(63136),w=n(65942),k=n(4016);let I=e=>{let{align:t,clamp:n,lineHeight:i=20,maxLength:l=152,paddingBottom:r,post:o,size:s=14,textWrap:d}=e,{postPreviewUrl:c,pub:u}=(0,m.np)();return(0,a.Y)(v.I1,{paddingBottom:r,children:(0,a.Y)(y.EY,{align:t,as:"a",clamp:n,color:"primary",font:"text",href:c,lineHeight:i,size:s,style:(0,k.S2)({pub:u})?{fontFamily:"Georgia, serif"}:void 0,tabIndex:-1,textWrap:d,children:(0,w.A)((0,f.truncateWords)(o.description,l))})})};var C=n(38970),S=n.n(C),D=n(99862),F=n(49807);let x=e=>{var t,n;let{paddingBottom:i,post:l}=e,{pub:r,showSectionOrTag:o}=(0,m.np)();if(!o)return null;let s=null,d=null;if(l.section_id){let e=r.sections.find(e=>e.id===l.section_id);e&&(s=e.name,d=(0,F.Dor)(r,{section:e}))}else if(null==(t=l.postTags)?void 0:t.length){let e=S()(r.navigationBarItems.filter(e=>e.postTag).map(e=>e.postTag),"id"),t=null==(n=l.postTags)?void 0:n.find(t=>e[t.id]);t&&(s=t.name,d=(0,F.ii9)(r,t))}return s&&d?(0,a.Y)(v.pT,{paddingBottom:i,children:(0,a.Y)(y.EY.Meta,{as:"a",color:"primary",href:d,onClick:e=>{e.stopPropagation(),e.preventDefault(),(0,D.route)(d)},children:s})}):null};var P=n(71834),T=n(56262),A=n(69706);let E=e=>{let{isSmall:t,post:n}=e,{hideUfi:i}=(0,m.np)(),{isTablet:l}=(0,h.sM)(),r=!!(0,T.getCoverImageUrl)(n);return(0,a.FD)("div",{className:d()("container-m3tNBN",{"containerNoImage-bRvPTc":!r}),children:[r&&(0,a.Y)(_.t,{className:"image-e4U1t2",imageAspectRatio:t?A.fo:A.qr,imageWidth:1280,isBelowTheFold:!1,playButtonSize:72,post:n,squareImageSize:"large"}),(0,a.FD)(v.I1,{alignItems:"center",className:"content-jHL69Q",justifyContent:"center",paddingBottom:64*!r,paddingTop:r?24:64,paddingX:r?32:64,children:[(0,a.Y)(x,{paddingBottom:4,post:n}),(0,a.Y)(P.Z,{align:"center",clamp:3,paddingBottom:8,post:n,preset:l?"mobileLg":"lg",preventOrphans:!0}),(0,a.Y)(I,{align:"center",clamp:3,lineHeight:24,paddingBottom:8,post:n,size:17}),(0,a.Y)(b.xx,{post:n}),!i&&(0,a.Y)(v.I1,{paddingTop:8,children:(0,a.Y)(Y,{post:n})})]})]})};var N=n(86500),B=n(82772),M=n(27437),R=n(31856),O=n(67190);let L=e=>{let{size:t,width:n}=e;return(0,a.Y)("div",{style:{width:n,margin:"0 auto"},children:(0,a.Y)(O.x,{size:t,width:"100%"})})},z=e=>{let{variant:t}=e;switch(t){case"mini":case"mini-episode":case"mini-video":return(0,a.Y)(v.I1,{gap:4,padding:8,paddingBottom:36,children:(0,a.FD)(v.Ye,{gap:12,children:[(0,a.FD)(v.I1,{flex:"grow",gap:8,paddingTop:4,children:[(0,a.Y)(O.x,{size:"sm",width:"80%"}),(0,a.Y)(O.x,{size:"sm",width:"50%"})]}),(0,a.Y)(R.z,{aspectRatio:A.Zi,width:64})]})});case"listing":return(0,a.Y)(v.I1,{gap:8,padding:8,paddingBottom:56,children:(0,a.FD)(v.Ye,{gap:16,children:[(0,a.FD)(v.I1,{flex:"grow",gap:8,children:[(0,a.Y)(O.x,{width:"70%"}),(0,a.Y)(O.x,{width:"80%"}),(0,a.Y)(O.x,{width:"50%"})]}),(0,a.Y)(R.z,{aspectRatio:A.qr,width:160})]})});case"square":return(0,a.FD)(v.I1,{padding:8,style:{paddingBottom:90,gap:18},children:[(0,a.Y)(R.z,{aspectRatio:A.fo}),(0,a.FD)(v.I1,{flex:"grow",style:{gap:10},children:[(0,a.Y)(O.x,{width:"80%"}),(0,a.Y)(O.x,{width:"90%"}),(0,a.Y)(O.x,{width:"50%"})]})]});case"large":return(0,a.FD)(v.I1,{gap:40,padding:8,paddingBottom:100,children:[(0,a.Y)(R.z,{aspectRatio:A.fo}),(0,a.FD)(v.I1,{gap:16,children:[(0,a.Y)(L,{size:"lg",width:"70%"}),(0,a.Y)(L,{size:"lg",width:"50%"}),(0,a.Y)(L,{size:"lg",width:"60%"})]})]});case"jumbo":case"jumbo-small":case"mobile-hero":return(0,a.FD)(v.I1,{gap:16,padding:8,children:[(0,a.Y)(R.z,{aspectRatio:A.B7}),(0,a.FD)(v.I1,{gap:8,children:[(0,a.Y)(O.x,{width:"20%"}),(0,a.Y)(O.x,{width:"90%"}),(0,a.Y)(O.x,{width:"75%"}),(0,a.Y)(O.x,{width:"35%"})]})]});default:return null}};var U=n(88553),H=n(9624);function q(){let e=(0,o._)(["Post preview for ",""]);return q=function(){return e},e}let G={jumbo:E,"jumbo-small":e=>(0,a.Y)(E,(0,l._)((0,i._)({},e),{isSmall:!0})),large:e=>{let{align:t="center",hideImage:n,imageAspectRatio:i="standard",post:l}=e,{hideUfi:r,pub:o}=(0,m.np)();return(0,a.FD)(v.I1,{children:[!n&&(0,a.Y)(_.t,{className:"image-QTMr_S",imageAspectRatio:"wide"===i?A.qr:A.fo,imageWidth:1250,isBelowTheFold:!1,playButtonSize:72,post:l,squareImageSize:"large"}),(0,a.FD)(v.I1,{alignItems:"center"===t?"center":"start",flex:"grow",justifyContent:(0,k.S2)({pub:o})?"start":"center",paddingBottom:0,paddingTop:32,paddingX:16*("left"!==t),children:[(0,a.Y)(x,{paddingBottom:4,post:l}),(0,a.Y)(P.Z,{align:t,clamp:4,paddingBottom:8,post:l,preset:"lg",preventOrphans:!0,textWrap:"balance"}),(0,a.Y)(I,{align:t,clamp:2,lineHeight:(0,k.S2)({pub:o})?28:24,paddingBottom:8,post:l,size:(0,k.S2)({pub:o})?20:17,textWrap:"balance"}),(0,a.Y)(b.xx,{post:l}),!r&&(0,a.Y)(v.I1,{paddingTop:8,children:(0,a.Y)(Y,{post:l})})]})]})},listing:e=>{let{hideImage:t,post:n}=e,{hideUfi:i,pub:l}=(0,m.np)(),{isMobile:r}=(0,h.sM)(),o=!!l.community_enabled;return t&&!r&&(o=!1),(0,a.FD)("div",{className:d()("container-Qnseki",{"container--no-image-zKZVLo":t}),children:[(0,a.FD)(v.I1,{flex:"grow",gap:4,position:"relative",children:[(0,a.Y)(x,{post:n}),(0,a.Y)(P.Z,{clamp:3,post:n,preset:r?"mobileMd":"md"}),!(0,k.S2)({pub:l})&&(0,a.Y)(I,{clamp:2,lineHeight:t?24:20,post:n,size:15}),(0,a.Y)(b.xx,{post:n}),!i&&(0,a.Y)(Y,{justified:o,post:n})]}),!t&&(0,a.Y)(_.t,{className:"image-tkPTAj",hidePlaceholder:!0,imageAspectRatio:r?A.Zi:A.fo,imageWidth:r?150:320,isBelowTheFold:!0,playButtonSize:r?32:40,post:n,squareImageSize:"small"})]})},mini:e=>{let{post:t}=e,{hideUfi:n,pub:i}=(0,m.np)(),l=!!i.community_enabled;return(0,a.FD)(v.I1,{gap:4,children:[(0,a.FD)(v.Ye,{gap:12,children:[(0,a.FD)(v.I1,{flex:"grow",gap:4,children:[(0,a.Y)(x,{post:t}),(0,a.Y)(P.Z,{clamp:2,post:t,preset:"sm"}),(0,a.Y)(b.xx,{clamp:1,post:t})]}),(0,a.Y)(_.t,{className:"image-tBOtsv",hidePlaceholder:!0,hideTimestamp:!0,imageAspectRatio:A.Zi,imageWidth:150,isBelowTheFold:!1,playButtonSize:32,post:t})]}),!n&&(0,a.Y)(Y,{justified:l,post:t})]})},"mini-episode":e=>{let{post:t}=e,n=(0,c.useRef)(null);return(0,B.S8)(n,()=>{(0,N.u4)(N.qY.RECENT_EPISODE_ITEM_SEEN,{post_id:t.id})}),(0,a.FD)(v.Ye,{ref:n,gap:16,children:[(0,a.Y)(_.t,{className:"image-UySkN_",hidePlaceholder:!0,hideTimestamp:!0,imageAspectRatio:A.Zi,imageWidth:150,isBelowTheFold:!1,playButtonSize:32,post:t}),(0,a.FD)(v.I1,{flex:"grow",children:[(0,a.Y)(P.Z,{clamp:2,paddingBottom:4,post:t,preset:"sm"}),(0,a.Y)(b.xx,{clamp:1,post:t})]})]})},"mini-video":e=>{let{post:t}=e;return(0,a.FD)(v.Ye,{gap:16,children:[(0,a.FD)(v.I1,{flex:"grow",gap:4,children:[t.section_name?(0,a.Y)(y.EY.Meta,{color:"accent",children:t.section_name}):null,(0,a.Y)(y.EY.B3,{clamp:2,color:"primary",weight:"semibold",children:t.title}),(0,a.Y)(y.EY.Meta,{color:"secondary",children:t.publishedBylines.map((e,t)=>(0,a.FD)(a.FK,{children:[t>0?", ":null,(0,a.Y)(M.ProfileHoverCard,{disabled:!1,subject:e,trigger:(0,a.Y)(y.EY,{as:"a",decoration:"hover-underline",children:e.name}),utmSource:"byline"})]}))})]}),(0,a.Y)(_.t,{className:"image-XZMKsB",hidePlaceholder:!0,hideTimestampIcon:!0,imageAspectRatio:A.qr,imageWidth:120,isBelowTheFold:!1,playButtonSize:null,post:t})]})},"mobile-hero":e=>{let{hidePlaceholder:t,post:n}=e,{hideUfi:i,pub:l}=(0,m.np)(),r=!!l.community_enabled;return(0,a.FD)(v.I1,{children:[n.cover_image&&(0,a.Y)(_.t,{className:"image-vqosjM",hidePlaceholder:t,imageAspectRatio:A.qr,imageWidth:1250,isBelowTheFold:!1,playButtonSize:72,post:n,squareImageSize:"large"}),(0,a.FD)(v.I1,{flex:"grow",justifyContent:"center",paddingTop:16,paddingX:16,children:[(0,a.Y)(x,{paddingBottom:4,post:n}),(0,a.FD)(v.I1,{gap:8,paddingBottom:12,children:[(0,a.Y)(P.Z,{clamp:3,post:n,preset:"mobileLg",preventOrphans:!0}),(0,a.Y)(I,{clamp:3,lineHeight:20,post:n,size:15}),(0,a.Y)(b.xx,{post:n})]}),!i&&(0,a.Y)(Y,{justified:r,post:n})]})]})},square:e=>{let{hideDescription:t,hideImage:n,post:i}=e,{hideUfi:l,pub:r}=(0,m.np)(),o=!!r.community_enabled,s=t||(0,k.S2)({pub:r});return(0,a.FD)(v.I1,{gap:12,children:[!n&&(0,a.Y)(_.t,{className:d()("image-Ac018u"),imageAspectRatio:A.fo,imageWidth:600,isBelowTheFold:!0,playButtonSize:56,post:i,squareImageSize:"medium"}),(0,a.FD)(v.I1,{flex:"grow",gap:4,children:[(0,a.Y)(x,{post:i}),(0,a.Y)(P.Z,{clamp:3,post:i,preset:"md"}),!s&&(0,a.Y)(I,{clamp:1,post:i}),(0,a.Y)(b.xx,{post:i}),!l&&(0,a.Y)(Y,{justified:o,post:i})]})]})}},W=e=>{var t,{linkToComments:n,post:o,slotIndex:s,testid:g,variant:f,onClick:Y}=e,b=(0,r._)(e,["linkToComments","post","slotIndex","testid","variant","onClick"]);let{iTemplate:_}=(0,u.GO)(),{isMobile:y}=(0,h.sM)(),{disableInteractive:w,pub:I,modifiedPosts:C,utm:S}=(0,m.np)(),[D,F]=(0,c.useState)(!1),x=(0,c.useCallback)(e=>{let{active:t}=e;F(!!t)},[]);if(!o)return(0,a.Y)(H.z,{slotIndex:s,children:(0,a.Y)(v.I1,{style:{width:"100%"},children:(0,a.Y)(z,{variant:f})})});let P=null!=(t=C[o.id])?t:o,T=G[f];if(!T)return console.warn("PostPreview: ".concat(f," not implemented")),null;let A=(0,U.U)({linkToComments:!!n,post:P,pub:I,utm:S});return(0,a.Y)(H.z,{postId:P.id,slotIndex:s,children:(0,a.Y)(m.XL,{actionsClassName:d()("actions-YFg47u",{"actions--menu-open-bDkeVH":D}),hideUfi:(0,k.S2)({pub:I}),postPreviewUrl:A,onToggleMenu:x,children:(0,a.Y)(v.I1,{"aria-label":_(q(),P.title),className:d()("container-H2dyKk",{"container--menu-open-RRT2Fw":D}),"data-testid":g,padding:8*!y,position:"relative",radius:"sm",role:"article",tabIndex:0,onClick:e=>{Y&&Y({event:e,post:P}),w||(0,p.V2)(A,{event:e})},children:(0,a.Y)(T,(0,l._)((0,i._)({},b),{post:P}))})})})}},84032:function(e,t,n){n.d(t,{xx:()=>D,aR:()=>x});var i=n(69277),l=n(70408),r=n(79785),o=n(4006),a=n(38970),s=n.n(a),d=n(27786),c=n(36066),u=n(27437),p=n(41935),h=n(84605),m=n(85478),g=n(28528),v=n(7761),f=n(63136),Y=n(16291),b=n(4016),_=n(56262),y=n(39318),w=n(82776);let k="icon-cvHqCn",I="link-HFGLqU",C="dividerChar-SbAJEi";function S(){let e=(0,r._)(["Published on ",""]);return S=function(){return e},e}let D=e=>{let{clamp:t,hideLock:n,post:i}=e,{iTemplate:l}=(0,h.GO)(),{getPinInfo:r,getPubPinInfo:a,getSectionPinInfo:s}=(0,v.b$)(),{highlightByline:u,pub:p,user:m}=(0,g.np)(),{showPin:Y}=a({post:i}),{showPin:y}=s({post:i}),{showPin:I}=r({post:i}),D=(Y||y||I)&&(!(0,b.S2)({pub:p})||!!(null==m?void 0:m.is_contributor)),P=!n&&(0,_.isPaidAudience)(i.audience)&&!(0,b.zM)({post:i})&&!(0,b.S2)({pub:p}),T=(0,w.getBylineUsers)(i);return(0,o.FD)(f.EY.Meta,{clamp:t,color:"pub-secondary-text",display:"inline",children:[D&&(0,o.Y)("div",{className:k,children:(0,o.Y)(d.A,{size:12})}),P&&(0,o.Y)("div",{className:k,children:(0,o.Y)(c.A,{audience:i.audience,size:12})}),i.restacked_pub_name?(0,o.FD)(o.FK,{children:[(0,o.Y)("span",{children:l(S(),i.restacked_pub_name)}),"\xa0",(0,o.Y)("span",{className:C,children:"•"}),"\xa0"]}):null,(0,o.Y)(x,{post:i}),"restack"!==i.type&&T.length>0&&p.bylines_enabled&&(0,o.FD)(o.FK,{children:["\xa0",(0,o.Y)("span",{className:C,children:"•"}),"\xa0",(0,o.Y)(f.EY,{as:"span",color:u?"accent":void 0,children:(0,o.Y)(F,{clamp:t,post:i,pub:p})})]})]})},F=e=>{let{post:t,clamp:n,pub:r}=e,a=(0,w.getBylineUsers)(t),{getConfigFor:d}=(0,m.mJ)(),c=!!d("enable_author_pages"),p=s()(r.contributors,"user_id"),h=e=>{let t=c?(0,y.cxh)({userId:e.id,pub:r}):null;return t?{href:t,onClick:e=>e.stopPropagation()}:c?{href:void 0,onClick:void 0}:{href:(0,y.laT)(e,r),onClick:e=>e.stopPropagation()}},g=e=>{var t,n,i;return null!=(i=null!=(n=null==(t=p[e.id])?void 0:t.name)?n:e.name)?i:""};return(0,o.Y)(o.FK,{children:(0,w.oxfordComma)(a.map(e=>n?(0,o.Y)("a",(0,l._)((0,i._)({className:I},h(e)),{children:g(e)})):(0,o.Y)(u.ProfileHoverCard,{disabled:c,subject:e,trigger:h(e).href?(0,o.Y)("a",(0,l._)((0,i._)({className:I},h(e)),{children:g(e)})):(0,o.Y)("span",{className:"notLink-oAjaXn",children:g(e)}),utmSource:"byline"})),{noBreakSpace:!0})})},x=e=>{let{customFormat:t="MM.DD.YY",post:n}=e,{language:i}=(0,h.GO)(),{pub:l}=(0,g.np)();return(0,o.Y)("time",{className:"date-rtYe1v",dateTime:(0,Y.A)(n.post_date).toISOString(),children:(0,b.lu)({pub:l})?(0,Y.A)(n.post_date).format(t):(0,b.S2)({pub:l})?(0,Y.A)(n.post_date).format("MMMM D, YYYY"):(0,p.sq)({post:n,showDatetime:!1,language:i})})}},70557:function(e,t,n){n.d(t,{X:()=>P});var i=n(4006),l=n(50802),r=n(49802),o=n(48635),a=n(17402),s=n(23623),d=n(41935),c=n(84236),u=n(84605),p=n(68349),h=n(68410),m=n(80098),g=n(38501),v=n(29042),f=n(88553),Y=n(89490),b=n(35369),_=n(76977),y=n(63136),w=n(13348),k=n(91496),I=n(7755),C=n(56262),S=n(82776),D=n(69706);let F={container:"container-pFhu3n",containerNoImage:"containerNoImage-W5VZl3",videoLayer:"videoLayer-gwRrVN",contentLayer:"contentLayer-OGm4Y9",content:"content-iO1vNE",imageContainer:"imageContainer-ddA7f9",image:"image-deX_la",flippedImageContainer:"flippedImageContainer-rBB6TZ",flippedImage:"flippedImage-rChY0M",blurOverlay:"blurOverlay-xN2HYo",darkOverlay:"darkOverlay-jsLZzF",noImageBackground:"noImageBackground-gL1zkp",postTitleMobile:"postTitleMobile-ut7sIL"},x=(0,Y.yw)({position:"absolute",inset:0,pointerEvents:"none"}),P=e=>{let{columns:t,hideLogo:n,highlightPost:l=!1,isPodcast:r,post:o,pub:u,section:Y,showPodcastLinks:b,user:w,utm:S}=e,P=(0,a.useRef)(null),{isMobile:E}=(0,h.sM)(),N=(0,C.getDurationForPostPreview)({post:o}),{title:B,description:M}=(0,I.ed)({pub:u,podcastUpload:o.podcastUpload,section:null!=Y?Y:null}),R=l?o.title:B,O=l?o.subtitle:M,L=!!o.cover_image,z=e=>{let t=(0,f.U)({linkToComments:!1,post:o,pub:u,utm:S});(0,p.V2)(t,{event:e})};return E?(0,i.FD)(_.I1,{gap:12,children:[(0,i.Y)(_.I1,{onClick:z,children:(0,i.FD)(_.Ye,{ref:P,flex:"fill",position:"relative",style:{minHeight:400},children:[(0,i.FD)(_.Ye,{className:F.videoLayer,direction:"column",position:"absolute",children:[(0,i.Y)(_.Ye,{flex:"grow",position:"relative",style:{width:"100%"},children:(0,i.Y)(v.t,{className:F.image,hideTimestamp:!0,imageAspectRatio:D.qr,imageWidth:1280,isBelowTheFold:!1,playButtonSize:null,post:o,presenceRef:P,squareImageSize:"large"})}),(0,i.Y)(_.Ye,{className:F.flippedImageContainer,flex:"grow",overflow:"hidden",position:"relative",children:(0,i.Y)(v.t,{className:F.flippedImage,hideTimestamp:!0,imageAspectRatio:D.qr,imageWidth:1280,isBelowTheFold:!1,playButtonSize:null,post:o,presenceRef:P,squareImageSize:"large"})}),(0,i.Y)(x,{className:L?F.darkOverlay:F.noImageBackground}),L&&(0,i.Y)(_.Ye,{className:F.blurOverlay,inset:0,overflow:"hidden",pointerEvents:"none",position:"absolute"})]}),(0,i.Y)(_.Ye,{className:F.contentLayer,pointerEvents:"none",position:"absolute",children:(0,i.Y)(s.a,{disable:!L,children:(0,i.Y)(_.Ye,{flex:"grow",children:(0,i.FD)(_.I1,{gap:16,padding:16,paddingBottom:24,children:[!n&&!l&&(0,i.Y)(k.M,{post:o,pub:u,section:null!=Y?Y:null,size:48,useSection:!r}),(0,i.FD)(_.I1,{gap:8,children:[(0,i.Y)(y.EY.H4,{color:"primary",font:"pub-headings",children:R}),(0,i.Y)(y.EY.B4,{clamp:2,className:F.descriptionMobile,color:"primary",children:O}),(0,i.Y)(_.Ye,{flex:"grow"})]}),o.videoUpload||o.podcastUpload||o.podcast_url?(0,i.Y)(T,{duration:N,hasImage:L,highlightPost:l,post:o}):(0,i.Y)(A,{hasImage:L,highlightPost:l,post:o})]})})})})]})}),(0,i.Y)(c.pJ,{align:"center",post:o,pub:u,section:Y}),b&&r&&(0,i.Y)(g.D,{limit:2,post:o,pub:u,section:null!=Y?Y:null,stretch:!0,user:w})]}):(0,i.Y)(m.P,{variant:4===t?"full-width":"three-column-width",children:(0,i.FD)(_.I1,{gap:12,children:[(0,i.Y)(_.I1,{paddingX:8,onClick:z,children:(0,i.FD)(_.Ye,{ref:P,flex:"fill",position:"relative",style:{minHeight:400},children:[(0,i.Y)(_.Ye,{position:"absolute",style:{bottom:16,right:16,zIndex:1},children:(0,i.Y)(d.xx,{allowEdit:!0,hideComments:!0,hideFeedRestackButton:!0,hideReactions:!0,hideSavePost:!0,hideShare:!0,isStatic:!1,labelStyle:"counts-or-none",post:o,pub:u,user:w,variant:"compressed",onChange:()=>void 0})}),(0,i.FD)(_.Ye,{className:F.videoLayer,position:"absolute",children:[(0,i.Y)(_.Ye,{flex:"grow",position:"relative",children:(0,i.Y)(_.Ye,{className:F.flippedImageContainer,flex:"grow",overflow:"hidden",position:"relative",children:(0,i.Y)(v.t,{className:F.flippedImage,disableVideoHover:!0,hideTimestamp:!0,imageAspectRatio:D.qr,imageWidth:1280,isBelowTheFold:!1,playButtonSize:null,post:o,presenceRef:P,squareImageSize:"large"})})}),(0,i.Y)(_.Ye,{className:F.imageContainer,position:"relative",children:(0,i.Y)(v.t,{className:F.image,hideTimestamp:!0,imageAspectRatio:D.qr,imageWidth:1280,isBelowTheFold:!1,playButtonSize:null,post:o,presenceRef:P,squareImageSize:"large"})}),(0,i.Y)(x,{className:L?F.darkOverlay:F.noImageBackground}),L&&(0,i.Y)(_.Ye,{className:F.blurOverlay,inset:0,overflow:"hidden",pointerEvents:"none",position:"absolute"})]}),(0,i.FD)(_.Ye,{pointerEvents:"none",position:"absolute",style:{width:"100%",height:"100%"},children:[(0,i.Y)(s.a,{disable:!L,children:(0,i.Y)(_.Ye,{flex:"grow",children:(0,i.Y)(_.I1,{justifyContent:n||l?"end":"center",padding:48,children:(0,i.FD)(_.I1,{gap:24,children:[!n&&!l&&(0,i.Y)(k.M,{post:o,pub:u,section:null!=Y?Y:null,size:72,useSection:!r}),(0,i.FD)(_.I1,{gap:8,children:[(0,i.Y)(y.EY.H2,{clamp:3,color:"primary",font:"pub-headings",children:R}),(0,i.Y)(y.EY.B4,{clamp:3,color:"primary",children:O}),(0,i.Y)(_.Ye,{flex:"grow"})]}),o.videoUpload||o.podcastUpload||o.podcast_url?(0,i.Y)(T,{duration:N,hasImage:L,highlightPost:l,post:o}):(0,i.Y)(A,{hasImage:L,highlightPost:l,post:o})]})})})}),(0,i.Y)(_.Ye,{flex:"grow",pointerEvents:"none"})]})]})}),(0,i.Y)(c.pJ,{align:"right",paddingX:8,post:o,pub:u,section:Y}),b&&r&&(0,i.Y)(_.I1,{paddingX:8,children:(0,i.Y)(g.D,{post:o,pub:u,section:null!=Y?Y:null,stretch:!0,user:w})})]})})},T=e=>{let{duration:t,hasImage:n,highlightPost:o,post:s}=e,{iString:d}=(0,u.GO)(),{isMobile:c}=(0,h.sM)(),p=n?"white":"var(--color-text-primary)";return(0,i.FD)(_.Ye,{alignItems:"center",gap:c?16:24,pointerEvents:"auto",children:[(0,i.Y)(_.Ye,{flex:"auto",children:(0,i.Y)(w.ro,{isPlaying:!1,size:c?56:72})}),(0,i.Y)(_.Ye,{alignItems:"center",children:(0,i.FD)(_.I1,{children:[(0,i.FD)(_.Ye,{alignItems:"center",gap:4,children:[(0,i.Y)(_.Ye,{gap:4,width:16,children:s.videoUpload?(0,i.Y)(l.A,{size:14,stroke:p}):(0,i.Y)(r.A,{size:14,stroke:p})}),(0,i.Y)(y.EY.Meta,{color:"primary",children:d("LATEST")}),t>0&&(0,i.FD)(a.Fragment,{children:[(0,i.Y)(y.EY.Meta,{color:"primary",children:"\xb7"}),(0,i.Y)(y.EY.Meta,{color:"primary",children:(0,S.secondsToHHMMSS)(t)})]})]}),!o&&(0,i.Y)(y.EY.Meta,{color:"primary",children:s.title})]})})]})},A=e=>{let{hasImage:t,highlightPost:n,post:l}=e,{iString:r}=(0,u.GO)();return(0,i.FD)(_.Ye,{alignItems:"center",gap:16,pointerEvents:"auto",children:[(0,i.Y)(b.K0,{priority:t?"primary-mono":"primary",rounded:!0,size:"md",children:(0,i.Y)(o.A,{size:20})}),(0,i.FD)(_.I1,{children:[(0,i.Y)(y.EY.Meta,{color:"primary",children:r(n?"READ THE LATEST":"LATEST")}),!n&&(0,i.Y)(y.EY.B2,{clamp:1,color:"primary",weight:"semibold",children:l.title})]})]})}},98920:function(e,t,n){n.d(t,{Z:()=>c});var i=n(69277),l=n(70408),r=n(4006),o=n(46271),a=n(41842),s=n(97307),d=n(62088);let c=e=>{let{displaySignInModal:t,onCloseSignInModal:n,isStatic:c,entry:u}=e,p=(0,s.n)(),{user:h,setUser:m}=(0,o.ur)();if(c)return null;let g=()=>{p.open({skipRedirectOnExit:!0})};return(0,r.FD)(r.FK,{children:[(0,r.Y)(d.M9,{isOpen:!!t,onCancel:n,onSignup:()=>{n(),g()},onSuccess:()=>{document.location.reload()},onUserCreated:e=>{n(),m(e),g()}}),(0,r.Y)(a.K,(0,l._)((0,i._)({},p.modalProps),{entry:u||"post-preview",onAfterClose:()=>{h&&document.location.reload()}}))]})}},71834:function(e,t,n){n.d(t,{Z:()=>h});var i=n(69277),l=n(70408),r=n(4006),o=n(54687),a=n(91704),s=n(28528),d=n(76977),c=n(63136),u=n(4016),p=n(82776);let h=e=>{let{align:t,clamp:n,maxLength:h=140,noIcons:m,paddingBottom:g,post:v,preset:f,preventOrphans:Y,textWrap:b}=e,{linkToComments:_,postPreviewUrl:y,pub:w}=(0,s.np)(),{lineHeight:k,size:I,fontFamily:C}=(0,a.i)({preset:f,pub:w}),S=(0,u.S2)({pub:w}),D=I>=28;return(0,r.Y)(d.I1,{paddingBottom:g,children:(0,r.FD)(c.EY,(0,l._)((0,i._)({},y?{as:"a",href:y,tabIndex:-1}:null),{align:t,clamp:S?void 0:n,color:"pub-primary-text","data-testid":"post-preview-title",font:"pub-headings",style:{fontSize:I,lineHeight:"".concat(k,"px"),fontFamily:C},textWrap:b,children:["thread"===v.type&&!m&&(0,r.Y)(o.A,{className:"icon-cUpv7d",size:D?26:17}),_&&"thread"!==v.type&&"Comments on: ",Y?(0,p.preventOrphans)((0,p.truncateWords)(v.title,h)):(0,p.truncateWords)(v.title,h)]}))})}},47173:function(e,t,n){n.d(t,{q:()=>h});var i=n(69277),l=n(70408),r=n(4006),o=n(32485),a=n.n(o),s=n(38970),d=n.n(s),c=n(85478),u=n(39318),p=n(82776);let h=e=>{let{post:t,clamp:n,pub:o}=e,s=(0,p.getBylineUsers)(t),{getConfigFor:h}=(0,c.mJ)(),m=!!h("enable_author_pages"),g=d()(o.contributors,"user_id"),v=e=>{let t=m?(0,u.cxh)({userId:e.id,pub:o}):null;return t?{href:t,onClick:e=>e.stopPropagation()}:m?{href:void 0,onClick:void 0}:{href:(0,u.laT)(e,o),onClick:e=>e.stopPropagation()}},f=e=>{var t,n,i;return null!=(i=null!=(n=null==(t=g[e.id])?void 0:t.name)?n:e.name)?i:""};return(0,r.Y)("div",{className:a()("container-Mw45dL",{"containerSingleLine-xWghSN":1===n}),children:(0,p.oxfordComma)(s.map(e=>v(e).href?(0,r.Y)("a",(0,l._)((0,i._)({className:"link-iknc0_"},v(e)),{children:f(e)})):(0,r.Y)("span",{className:"notLink-U0WbwD",children:f(e)})),{noBreakSpace:!0})})}},60355:function(e,t,n){n.d(t,{R:()=>N});var i=n(69277),l=n(70408),r=n(32641),o=n(4006),a=n(32485),s=n.n(a),d=n(68349),c=n(28528),u=n(36027),p=n(68410),h=n(95294),m=n(15894),g=n(76977),v=n(65942),f=n(82776);let Y=e=>{let{align:t="left",clamp:n,color:i,paddingBottom:l,post:r,preset:a}=e,{postPreviewUrl:s}=(0,c.np)();return(0,o.Y)(g.I1,{paddingBottom:l,children:(0,o.Y)(m.T,{align:t,as:"a",clamp:n,color:i,href:s,preset:a,wrap:"center"===t?"balance":"pretty",children:(0,v.A)((0,f.truncateWords)(r.subtitle,152))})})},b=e=>{var{align:t="left",clamp:n,color:a,paddingBottom:d,post:u,preset:p,preventOrphans:h=!0}=e,v=(0,r._)(e,["align","clamp","color","paddingBottom","post","preset","preventOrphans"]);let{postPreviewUrl:Y}=(0,c.np)(),b=(0,f.truncateWords)(u.title,140),_=h?(0,f.preventOrphans)(b):b;return(0,o.Y)(g.I1,{paddingBottom:d,children:(0,o.Y)(m.T,(0,l._)((0,i._)({},v,Y?{as:"a",href:Y}:null),{align:t,clamp:n,className:s()("post-preview-title","title-vqpS7B",{"hoverColor-w9y2tS":"white"!==a}),color:a,preset:p,wrap:"center"===t?"balance":"pretty",children:_}))})};var _=n(86673);let y=e=>{let{post:t}=e,{pub:n,user:i,onChangePost:l}=(0,c.np)(),r=(0,f.showCommentsOnPost)({publication:n,post:t}),a=n.community_enabled,s=!!(null==i?void 0:i.is_contributor);return"restack"===t.type?null:(0,o.FD)(g.Ye,{alignItems:"center",gap:6,children:[r&&(0,o.Y)(_.qS,{post:t,pub:n,size:"small"}),a&&(0,o.Y)(_.ct,{post:t,pub:n,size:"small",user:i,onChange:l}),s&&(0,o.Y)(_.xn,{context:"post-preview",post:t,pub:n,user:i})]})};var w=n(84032),k=n(47173);let I=e=>{let{align:t="left",color:n,paddingBottom:i,post:l,preset:r}=e,{pub:a}=(0,c.np)();return(0,o.Y)(g.I1,{paddingBottom:i,children:(0,o.FD)(m.T,{align:t,color:null!=n?n:"sm-preview-byline"===r?"accent":void 0,preset:r,children:[(0,o.Y)(k.q,{post:l,pub:a})," — ",(0,o.Y)(w.aR,{post:l})]})})};var C=n(69706);let S=e=>{let{align:t,hideDescription:n,hideImage:i,post:l,titlePreset:r}=e;return(0,o.FD)(g.I1,{children:[!i&&(0,o.Y)(h.D,{className:"image-EaGmDd",imageAspectRatio:C.B7,imageWidth:600,isBelowTheFold:!0,post:l}),(0,o.FD)(g.I1,{gap:4,paddingTop:8*!i,children:[(0,o.Y)(b,{align:t,post:l,preset:null!=r?r:i?"h5-serif":"h7-serif"}),!n&&(0,o.Y)(Y,{align:t,clamp:3,post:l,preset:"d4-serif"}),(0,o.Y)(g.I1,{alignItems:"center"===t?"center":"start",paddingY:4,children:(0,o.Y)(y,{post:l})}),(0,o.Y)(I,{align:t,post:l,preset:"sm-preview-byline"})]})]})};var D=n(13589);let F=e=>{let{post:t}=e;return(0,o.FD)(g.I1,{alignItems:"center",children:[(0,o.Y)(g.I1,{alignSelf:"stretch",paddingBottom:32,children:(0,o.Y)(h.D,{imageAspectRatio:4/3,imageWidth:700,isBelowTheFold:!0,post:t})}),(0,o.Y)(b,{align:"center",color:"white",paddingBottom:32,post:t,preset:"h2-serif"}),(0,o.Y)(Y,{align:"center",color:"white",paddingBottom:32,post:t,preset:"d1-sans-medium"}),(0,o.Y)(I,{color:"white",post:t,preset:"lg-preview-byline"})]})};var x=n(39318),P=n(92636),T=n(88553),A=n(9624);let E={archive:e=>{let{forceShowPlayButton:t,post:n}=e,{isMobile:i}=(0,p.sM)();return(0,o.FD)(g.Ye,{gap:i?24:40,children:[(0,o.Y)(g.I1,{flex:"auto",children:(0,o.Y)(h.D,{className:"image-YTYBVT",forceShowPlayButton:t,imageAspectRatio:1,imageWidth:150,isBelowTheFold:!0,post:n})}),(0,o.FD)(g.I1,{gap:8*!i,overflow:"hidden",children:[(0,o.Y)(b,{post:n,preset:"h5-serif"}),(0,o.Y)(g.I1,{flex:i?void 0:"grow",paddingBottom:16*!!i,children:(0,o.Y)(Y,{clamp:3,post:n,preset:"d3-serif"})}),(0,o.Y)(u.E,{post:n})]})]})},"content-block-episode":e=>{let{post:t}=e,{isMobile:n}=(0,p.sM)();return n?(0,o.Y)(S,{align:"left",post:t,titlePreset:"h4-sans-condensed"}):(0,o.FD)(g.Ye,{gap:20,children:[(0,o.Y)(h.D,{className:"image-Vu2JCA",imageAspectRatio:22/31,imageWidth:440,isBelowTheFold:!0,post:t}),(0,o.FD)(g.I1,{flex:"grow",gap:8,children:[(0,o.Y)(b,{post:t,preset:"h4-sans-condensed"}),(0,o.FD)(g.I1,{gap:8,children:[(0,o.Y)(Y,{clamp:3,post:t,preset:"d4-serif"}),(0,o.Y)(y,{post:t}),(0,o.Y)(I,{post:t,preset:"sm-preview-byline"})]})]})]})},"content-block-listing":e=>{let{post:t,titlePreset:n="h6-sans"}=e,i="h4-sans-condensed"===n;return(0,o.FD)(g.Ye,{gap:20,children:[(0,o.Y)(g.I1,{flex:"auto",children:(0,o.Y)(h.D,{className:i?"image220-p05U5w":"image140-mQ92WN",imageAspectRatio:1,imageWidth:300,isBelowTheFold:!0,post:t})}),(0,o.FD)(g.I1,{gap:i?8:4,children:[(0,o.Y)(b,{post:t,preset:n}),(0,o.FD)(g.I1,{gap:8,children:[(0,o.Y)(Y,{clamp:3,post:t,preset:"d4-serif"}),(0,o.Y)(y,{post:t}),(0,o.Y)(I,{post:t,preset:"sm-preview-byline"})]})]})]})},"content-block-single-large":e=>{let{post:t}=e,{isMobile:n}=(0,p.sM)(),[r,a]=(0,D.Mk)();return n?(0,o.Y)(F,{post:t}):(0,o.FD)(g.Ye,{alignItems:"center",gap:40,children:[(0,o.FD)(g.I1,{alignItems:"center",flex:"grow",children:[(0,o.Y)(I,{color:"white",paddingBottom:56,post:t,preset:"lg-preview-byline"}),(0,o.Y)(b,(0,l._)((0,i._)({},a),{align:"center",color:"white",paddingBottom:40,post:t,preset:"h2-serif"})),(0,o.Y)(g.I1,{width:360,children:(0,o.Y)(Y,{align:"center",color:"white",post:t,preset:"d1-sans-medium"})})]}),(0,o.Y)(g.I1,{flex:"grow",children:(0,o.FD)(g.I1,(0,l._)((0,i._)({},a),{className:"imageContainer-LhpEMl",position:"relative",children:[(0,o.Y)(h.D,{imageAspectRatio:4/3,imageWidth:700,isBelowTheFold:!0,post:t}),(0,o.Y)(g.Ye,{className:"imageContainerOverlay-L73_9b",inset:0,position:"absolute",style:{opacity:+!!r}})]}))})]})},"event-page":e=>{let{post:t}=e;return(0,o.FD)(g.I1,{gap:20,children:[(0,o.Y)(b,{post:t,preset:"h4-sans-regular"}),(0,o.Y)(h.D,{className:"image-J1_9gh",imageAspectRatio:16/9,imageWidth:660,isBelowTheFold:!0,post:t})]})},large:e=>{let{align:t="center",hideImage:n,imageAspectRatio:i="standard",post:l,showImageLast:r,titlePreset:a="h3-compressed"}=e,{isMobile:s}=(0,p.sM)(),d=!n&&(0,o.Y)(h.D,{className:"image-v6H72k",imageAspectRatio:"wide"===i?C.B7:"portrait"===i?3/4:C.fo,imageWidth:1250,isBelowTheFold:!1,post:l});return(0,o.FD)(g.I1,{children:[!r&&d,(0,o.FD)(g.I1,{alignItems:"center"===t?"center":"start",justifyContent:"center",paddingBottom:8*!!r,paddingTop:r?0:s?16:32,paddingX:16*("left"!==t),children:[(0,o.Y)(b,{align:t,paddingBottom:8,post:l,preset:a}),r&&(0,o.Y)(g.I1,{alignSelf:"stretch",paddingBottom:8,children:d}),(0,o.FD)(g.I1,{alignItems:"center"===t?"center":"start",gap:s?8:12,children:[(0,o.Y)(Y,{align:t,post:l,preset:"d2-serif"}),(0,o.FD)(g.Ye,{alignItems:"center",gap:24,justifyContent:"center",children:[(0,o.Y)(I,{align:t,post:l,preset:"lg-preview-byline"}),(0,o.Y)(y,{post:l})]})]})]})]})},mini:e=>{let{clampTitle:t,hideUfi:n,post:i,showDescription:l,showStar:r}=e;return(0,o.FD)(g.Ye,{alignItems:"start",gap:16,children:[r&&(0,o.Y)("img",{alt:"star",height:24,src:(0,x.dJ9)("".concat((0,P.Ew)(),"/img/thefp/thefp-star.svg")),width:24}),(0,o.FD)(g.I1,{gap:4,children:[(0,o.Y)(b,{clamp:t,post:i,preset:"h6-serif"}),l&&(0,o.Y)(Y,{clamp:3,post:i,preset:"d4-serif"}),!n&&(0,o.Y)(g.I1,{paddingY:4,children:(0,o.Y)(y,{post:i})}),(0,o.Y)(I,{post:i,preset:"sm-preview-byline"})]})]})},portrait:e=>{let{align:t="center",hideImage:n,post:i,titlePreset:l="h3-compressed"}=e,{isMobile:r}=(0,p.sM)(),a=!n&&(0,o.Y)(h.D,{className:"image-UumsF2",imageAspectRatio:3/4,imageWidth:1250,isBelowTheFold:!1,post:i});return(0,o.FD)(g.Ye,{className:"container-lZcN1f",gap:24,children:[a,(0,o.FD)(g.I1,{alignItems:"center"===t?"center":"start",className:"text-WvW3re",justifyContent:"space-between",paddingBottom:0,paddingX:16*("left"!==t),children:[(0,o.FD)(g.I1,{className:"contentWrapper-NnSZwz",justifyContent:"center",children:[(0,o.Y)(b,{align:t,paddingBottom:8,post:i,preset:l,preventOrphans:!1}),(0,o.Y)(Y,{align:t,post:i,preset:"d2-serif"})]}),(0,o.FD)(g.I1,{alignItems:"center"===t?"center":"start",gap:r?8:12,children:[(0,o.Y)(y,{post:i}),(0,o.Y)(I,{align:t,post:i,preset:"lg-preview-byline"})]})]})]})},square:S},N=e=>{var t,n,a,{linkToComments:u,post:p,testid:h,variant:m,onClick:v}=e,f=(0,r._)(e,["linkToComments","post","testid","variant","onClick"]);let{cropGravity:Y,disableInteractive:b,pub:_,modifiedPosts:y,utm:w,onClickPost:k}=(0,c.np)(),I=null!=(n=y[p.id])?n:p,C=null!=(a=null==(t=I.postTheme)?void 0:t.post_preview_crop_gravity)?a:Y,S=E[m];if(!S)return console.warn("PostPreview: ".concat(m," not implemented")),null;let D=(0,T.U)({linkToComments:!!u,post:I,pub:_,utm:w});return(0,o.Y)(A.z,{overlayInset:12,postId:I.id,children:(0,o.Y)(c.XL,{cropGravity:C,linkToComments:u,postPreviewUrl:D,children:(0,o.Y)(g.I1,{className:s()("container-r9Uobv","post-preview-container"),"data-testid":h,position:"relative",radius:"sm",onClick:e=>{v&&v({event:e,post:I}),k&&k({event:e,post:I}),b||(0,d.V2)(D,{event:e})},children:(0,o.Y)(S,(0,l._)((0,i._)({},f),{post:I}))})})})}},95294:function(e,t,n){n.d(t,{D:()=>Y});var i=n(4006),l=n(32485),r=n.n(l),o=n(17402),a=n(36534),s=n(59307),d=n(33764),c=n(68410),u=n(28528),p=n(91694),h=n(73066),m=n(76977),g=n(59294),v=n(56262),f=n(39318);let Y=e=>{var t,n,l,Y,b;let{className:_,disableVideoHover:y,disableVideoHoverFade:w,forceShowPlayButton:k,hidePlaceholder:I,imageAspectRatio:C,imageWidth:S,isBelowTheFold:D,post:F,videoPlayIconVariant:x="default"}=e,{cropGravity:P,pub:T}=(0,u.np)(),{isMobile:A}=(0,c.sM)(),E=(0,o.useRef)(null),[N]=(0,g.TR)(E),B=!!F.videoUpload,M=!!(!B&&"podcast"===F.type),R=(0,v.getCoverImageUrl)(F);!R&&((null==(Y=F.videoUpload)?void 0:Y.thumbnail_id)?R=(0,f.Pzx)(F.videoUpload):(null==(b=F.podcastUpload)?void 0:b.thumbnail_id)&&(R=(0,f.Pzx)(F.podcastUpload,{post:F})));let O=S<=640;if(!R&&I)return null;let L=S||C?C:1.32,z=S||336,U=!!(null==(t=F.videoUpload)?void 0:t.live_stream_id);return(0,i.FD)("div",{ref:E,className:r()(_,"container-XQwt8c","post-preview-image",{[String("containerEmpty-v9lUvg")]:!R}),style:{aspectRatio:"".concat(L)},children:[(M||B||k)&&(0,i.Y)(m.Ye,{alignItems:"center",className:r()("fpPodcastOverlay-F_ObU8",{"fpPodcastOverlayHover-j8gEjt":!w}),inset:0,justifyContent:"center",position:"absolute",children:"default"===x?(0,i.Y)(a.A,{fill:"white",height:36,stroke:"none"}):(0,i.Y)("div",{className:"redPlayContainer-gIeqLa",children:(0,i.Y)(s.A,{fill:"white",height:A?12:20,stroke:"none"})})}),B&&(O?(0,i.Y)(p.A,{aspectRatio:(null==(n=F.videoUpload)?void 0:n.width)&&(null==(l=F.videoUpload)?void 0:l.height)?F.videoUpload.width/F.videoUpload.height:L,containerRef:E,post:F,size:S>320?"large":"medium"}):(0,i.Y)(h.A,{isHovered:N&&!y,post:F,pub:T})),R?(0,i.Y)(d.o,{alt:"",className:"image-wHmpR_",imageProps:L?{height:Math.round(z/L),smartCrop:!0,gravity:U?"auto":P}:{},imageSizingCss:"(min-width:768px) 50vw, 100vw",loading:D?"lazy":void 0,maxWidth:z,src:R,style:{aspectRatio:"".concat(L)}}):null]})}},90456:function(e,t,n){n.d(t,{v:()=>s});var i=n(4006),l=n(31856),r=n(67190),o=n(89490),a=n(76977);let s=e=>{let{type:t}=e;return"link"===t?(0,i.FD)(a.I1,{gap:12,children:[(0,i.Y)(r.x,{width:"40%"}),(0,i.Y)(r.x,{width:"70%"})]}):"recommendation"===t?(0,i.Y)(o.az,{padding:8,children:(0,i.FD)(a.Ye,{gap:16,children:[(0,i.Y)(l.z,{aspectRatio:1,width:40}),(0,i.FD)(a.I1,{flex:"grow",gap:8,justifyContent:"center",children:[(0,i.Y)(r.x,{width:"60%"}),(0,i.Y)(r.x,{size:"sm",width:"40%"})]})]})}):"contributor"===t?(0,i.Y)(o.az,{padding:8,children:(0,i.FD)(a.Ye,{alignItems:"center",gap:16,children:[(0,i.FD)(a.I1,{flex:"grow",gap:8,children:[(0,i.Y)(r.x,{size:"sm",width:"30%"}),(0,i.Y)(r.x,{width:"70%"})]}),(0,i.Y)(l.z,{aspectRatio:1,radius:"full",width:48})]})}):"polymarket-iframe"===t?(0,i.Y)(i.FK,{}):(0,i.Y)(o.az,{padding:8,children:(0,i.FD)(a.Ye,{gap:16,children:[(0,i.Y)(l.z,{aspectRatio:1,width:64}),(0,i.FD)(a.I1,{flex:"grow",gap:8,children:[(0,i.Y)(r.x,{width:"40%"}),(0,i.Y)(r.x,{size:"sm",width:"60%"}),(0,i.Y)(r.x,{size:"sm",width:"50%"})]})]})})}},1117:function(e,t,n){n.d(t,{n:()=>m,d:()=>h});var i=n(69277),l=n(70408),r=n(32641),o=n(4006),a=n(91704),s=n(68410),d=n(89490),c=n(76977),u=n(63136),p=n(4277);let h=e=>{var{body:t,clampTitle:n,image:s,linkProps:h,pub:m,subtitle:g,title:v,url:f}=e,Y=(0,r._)(e,["body","clampTitle","image","linkProps","pub","subtitle","title","url"]);let{size:b,lineHeight:_}=(0,a.i)({preset:"sm",pub:m}),y="undefined"==typeof window,w=(0,o.Y)(p.u,{hoverBackground:"light",padding:8,radius:"sm",children:(0,o.FD)(c.Ye,(0,l._)((0,i._)({},Y),{gap:16,children:[s&&(0,o.Y)(d.az,{alignSelf:"start",children:s}),(0,o.FD)(c.I1,{alignSelf:"stretch",gap:8,justifyContent:"center",children:[(0,o.FD)(c.I1,{gap:2,style:{wordBreak:"break-word"},children:[(0,o.Y)(u.EY,{clamp:n,color:"pub-primary-text",font:"pub-headings",style:{fontSize:b,lineHeight:"".concat(_,"px")},children:y?(0,o.Y)("a",(0,l._)((0,i._)({},h),{href:f,style:{textDecoration:"none",display:"block"},children:v})):v}),g&&(0,o.Y)(u.EY.B4,{clamp:3,color:"pub-secondary-text",size:12,children:g})]}),t&&(0,o.Y)("div",{children:t})]})]}))});return y?w:(0,o.Y)("a",(0,l._)((0,i._)({},h),{href:f,style:{textDecoration:"none",display:"block"},children:w}))},m=e=>{let{linkProps:t,pub:n,subtitle:r,title:d,url:p}=e,{isMobile:h}=(0,s.sM)(),{size:m,lineHeight:g}=(0,a.i)({preset:"sm",pub:n});return(0,o.Y)("a",(0,l._)((0,i._)({className:"homepageLink-cE_DZ1",href:p},t),{children:(0,o.Y)(c.I1,{gap:8,paddingX:8*!h,children:(0,o.FD)(c.I1,{style:{wordBreak:"break-word"},children:[(0,o.Y)(u.EY,{className:"title-QddVTB",color:"pub-primary-text",font:"pub-body",style:{fontSize:m,lineHeight:"".concat(g,"px")},children:d}),r&&(0,o.Y)(u.EY.B4,{clamp:3,color:"pub-secondary-text",size:12,children:r})]})})}))}},42308:function(e,t,n){n.d(t,{U:()=>I});var i=n(4006),l=n(17402),r=n(41477),o=n(68410),a=n(69277),s=n(70408),d=n(32485),c=n.n(d),u=n(94394),p=n.n(u),h=n(33031),m=n.n(h),g=n(98188),v=n(35369);let f=e=>{let{homepageLinks:t,pub:n,renderGroup:l,renderLink:r}=e,o=p()(t,"group"),a=m()(Object.keys(o),e=>o[e][0].rank);return(0,i.Y)(i.FK,{children:a.map(e=>(0,i.Y)(Y,{group:e,items:o[e],newTab:!0,pub:n,renderGroup:l,renderLink:r}))})},Y=e=>{let{group:t,items:n,newTab:l,pub:r,renderGroup:o,renderLink:d}=e,u=[],p=null;l&&(p="_blank",u.push("noopener")),(!r||(null==r?void 0:r.no_follow))&&u.push("ugc nofollow");let h={rel:u.join(" "),target:p},m=(0,i.Y)(i.FK,{children:n.map(e=>{let{title:t,url:n,subtitle:l,subtitleUrl:r,edit:o,className:u}=e;return d?d({title:t,url:n,subtitle:l,linkProps:h}):(0,i.FD)("div",{className:c()("home-right-col",u),children:[o?(0,i.FD)("div",{className:"home-right-col-editable",children:[(0,i.Y)("a",{className:"home-right-col-title","data-native":!0,href:n,children:t}),(0,i.Y)(v.K0,{href:o,priority:"quaternary",size:"sm",title:"edit",children:(0,i.Y)(g.A,{size:20})})]}):(0,i.Y)("a",(0,s._)((0,a._)({className:"home-right-col-title","data-native":!0,href:n},h),{children:t})),l&&(0,i.Y)("a",(0,s._)((0,a._)({className:"home-right-col-sub","data-native":!0,href:r||n},h),{children:l}))]})})});return o?o({title:t,links:m}):(0,i.FD)("div",{className:"home-right-group",children:[(0,i.Y)("div",{className:"home-right-group-title",children:t}),m]})};var b=n(28528),_=n(90456),y=n(1117),w=n(88218),k=n(76977);let I=e=>{let{hideHeaderBorder:t,showEmptyState:n}=e,{homepageLinks:a}=(0,l.useContext)(r.c),{pub:s}=(0,b.np)(),{isMobile:d}=(0,o.sM)();return a&&0!==a.length?(0,i.Y)(k.I1,{"data-testid":"homepage-links",gap:24,children:(0,i.Y)(f,{homepageLinks:a,pub:s,renderGroup:e=>{let{title:n,links:l}=e;return(0,i.FD)(k.I1,{gap:16,children:[(0,i.Y)(k.Ye,{alignItems:"center",paddingX:8*!d,children:(0,i.Y)(k.Ye,{borderBottom:t?void 0:"detail-themed",flex:"grow",paddingBottom:t?void 0:8,children:(0,i.Y)(w.F,{children:n})})}),(0,i.Y)(k.I1,{gap:12,children:l})]})},renderLink:e=>{let{linkProps:t,subtitle:n,title:l,url:r}=e;return(0,i.Y)(y.n,{linkProps:t,pub:s,subtitle:n,title:l,url:r})}})}):n&&a&&0===a.length?(0,i.Y)(k.I1,{paddingX:8*!d,children:(0,i.Y)(_.v,{type:"link"})}):null}},97904:function(e,t,n){n.d(t,{l:()=>_});var i=n(69277),l=n(70408),r=n(79785),o=n(4006),a=n(17402),s=n(84605),d=n(41477),c=n(68410),u=n(78120),p=n(28528),h=n(90456),m=n(1117),g=n(88218),v=n(41167),f=n(76977),Y=n(45974);function b(){let e=(0,r._)(["View all ",""]);return b=function(){return e},e}let _=e=>{let{showEmptyState:t,hideHeaderBorder:n}=e,{iString:r,iTemplate:_}=(0,s.GO)(),{numRecommendations:y,recommendations:w}=(0,a.useContext)(d.c),{pub:k,user:I}=(0,p.np)(),{isMobile:C}=(0,c.sM)();return w&&(0!==w.length||t)?(0,o.Y)(v.A,{numRecommendations:y,pub:k,recommendations:w,render:e=>{let{recommendations:t,canManage:i,manageUrl:l,hasMore:a,hasMoreUrl:s,recommendationsCount:d}=e;return(0,o.FD)(f.I1,{gap:16,children:[(0,o.Y)(f.Ye,{paddingX:8*!C,children:(0,o.FD)(f.Ye,{alignItems:"baseline",borderBottom:n?void 0:"detail-themed",flex:"grow",justifyContent:"space-between",paddingBottom:n?void 0:8,children:[(0,o.Y)(g.F,{children:r("Recommendations")}),i?(0,o.Y)(u.M,{href:l,children:r("Manage")}):a?(0,o.Y)(u.M,{href:s,testid:"homepage-recommendations-view-all",children:_(b(),null!=d?d:0)}):null]})}),(0,o.Y)(f.I1,{"data-testid":"homepage-recommendations",gap:4,children:0===y?(0,o.Y)(h.v,{type:"recommendation"}):t})]})},renderRecommendation:e=>{let{url:t,onClick:n,pubAvatarProps:r,pubName:a,pubAuthor:s}=e;return(0,o.Y)(m.d,{"data-testid":"homepage-recommendation",image:(0,o.Y)(Y.wg,(0,l._)((0,i._)({},r),{size:40})),linkProps:{onClick:n,target:"_blank",rel:"noopener"},pub:k,subtitle:s,title:a,url:t})},user:I}):null}},11419:function(e,t,n){n.d(t,{V:()=>h});var i=n(4006),l=n(17402),r=n(81209),o=n(41477),a=n(68410),s=n(28528),d=n(88218),c=n(76977),u=n(63136),p=n(39318);let h=()=>{let{freeSignup:e,freeSignupEmail:t}=(0,l.useContext)(o.c),{pub:n,user:h}=(0,s.np)(),{isMobile:m}=(0,a.sM)();return(0,i.FD)(c.I1,{className:"container-rEYFE5",gap:24,paddingX:8*!m,children:[(0,i.FD)(c.I1,{gap:8,children:[n.logo_url&&(0,i.Y)("img",{alt:n.name,className:"pubLogo-DpnXOb","data-testid":"homepage-sidebar-pub-logo",src:(0,p.dJ9)(n.logo_url,88)}),(0,i.FD)(c.I1,{gap:2,children:[(0,i.Y)(d.F,{children:n.name}),n.hero_text&&(0,i.Y)(u.EY,{color:"pub-secondary-text",font:"text",lineHeight:20,size:12,children:n.hero_text})]})]}),(0,i.Y)(r.A,{align:"left",expectTruncation:!0,freeSignup:e,freeSignupEmail:t,isStatic:!1,pub:n,source:"magaziney-home-page",user:h})]})}},88218:function(e,t,n){n.d(t,{F:()=>r});var i=n(4006),l=n(63136);let r=e=>{let{align:t,children:n}=e;return(0,i.Y)(l.EY.B2,{align:t,color:"pub-primary-text",font:"pub-headings",weight:"bold",children:n})}},15040:function(e,t,n){n.d(t,{$o:()=>C,Ex:()=>Y,Ff:()=>T,Pk:()=>x,w4:()=>D});var i=n(69277),l=n(70408),r=n(32641),o=n(4006),a=n(32485),s=n.n(a),d=n(14701),c=n(14647),u=n(20713),p=n(76977),h=n(45974),m=n(63136),g=n(49095),v=n(6986),f=n(62614);let Y=e=>{let t;var{content:n,children:l}=e,a=(0,r._)(e,["content","children"]);return t=n?"number"==typeof n?(0,o.Y)(k,(0,i._)({number:n},a)):"string"==typeof n?(0,o.Y)(w,(0,i._)({text:n},a)):(0,o.Y)(I,(0,i._)({icon:n},a)):(0,o.Y)(y,(0,i._)({},a)),(0,o.Y)(b,{badge:t,children:l})},b=e=>{let{children:t,badge:n}=e;return(0,o.FD)(p.pT,{position:"relative",className:v.A.container,children:[t,n]})},_=e=>{let{priority:t="primary",theme:n="accent",placement:i="top-right",shape:l="circle",radius:r="full",className:a,children:d,style:c}=e;return(0,o.Y)(p.pT,{alignItems:"center",justifyContent:"center",position:"absolute",userSelect:"none",sizing:"border-box",radius:r,className:s()(v.A.badge,v.A["placement_".concat(i)],v.A["shape_".concat(l)],f.A["theme_".concat(n)],f.A["priority_".concat(t)],a),style:c,children:d})},y=e=>{var{className:t}=e,n=(0,r._)(e,["className"]);return(0,o.Y)(_,(0,l._)((0,i._)({},n),{className:s()(v.A.dot,t)}))},w=e=>{var{text:t,className:n}=e,a=(0,r._)(e,["text","className"]);let d=1===t.length;return(0,o.Y)(_,(0,l._)((0,i._)({},a),{className:s()(v.A.text,d&&v.A.singleElement,n),children:(0,o.Y)(m.EY.Meta,{as:"span",color:"inherit",children:t})}))},k=e=>{var{number:t,className:n}=e,a=(0,r._)(e,["number","className"]);let d=1===t.toString().length;return(0,o.Y)(_,(0,l._)((0,i._)({},a),{className:s()(v.A.text,d&&v.A.singleElement,n),children:(0,o.Y)(m.EY.Meta,{as:"span",color:"inherit",children:t})}))},I=e=>{var{icon:t,fillIcon:n,className:a,style:d}=e,c=(0,r._)(e,["icon","fillIcon","className","style"]);return(0,o.Y)(_,(0,l._)((0,i._)({},c),{className:s()(v.A.singleElement,n&&v.A.fillIcon,a),style:d,children:t}))},C=e=>{var{children:t,placement:n="bottom-right",tier:l}=e,a=(0,r._)(e,["children","placement","tier"]);let s=(0,o.Y)(S,(0,i._)({placement:n,tier:l},a));return l?(0,o.Y)(b,{badge:s,children:t}):(0,o.Y)(o.FK,{children:t})},S=e=>{var{userId:t,tier:n,className:a}=e,d=(0,r._)(e,["userId","tier","className"]);return(0,o.Y)(_,(0,l._)((0,i._)({},d),{className:s()(v.A.singleElement,v.A.empty,a),children:(0,o.Y)(g.UserStatusSymbols,{tier:n,userId:t,size:"sm"})}))},D=e=>{var{children:t,placement:n="bottom-right"}=e,l=(0,r._)(e,["children","placement"]);let a=(0,o.Y)(F,(0,i._)({placement:n},l));return(0,o.Y)(b,{badge:a,children:t})},F=e=>{var{tier:t,fgOverride:n,bgOverride:l}=e,a=(0,r._)(e,["tier","fgOverride","bgOverride"]);return"author"===t?(0,o.Y)(I,(0,i._)({theme:"accent",fillIcon:!0,icon:(0,o.Y)(u.A,{size:12}),style:(0,i._)({},l&&{"--color-tag-bg":l}||{},n&&{"--color-tag-fg":n}||{})},a)):"founding"===t?(0,o.Y)(I,(0,i._)({theme:"default",priority:"secondary",icon:(0,o.Y)(d.A,{size:12})},a)):"paid"===t?(0,o.Y)(I,(0,i._)({theme:"default",priority:"secondary",icon:(0,o.Y)(c.A,{size:12})},a)):null},x=e=>{var{children:t}=e,n=(0,r._)(e,["children"]);return(0,o.Y)(b,{badge:(0,o.Y)(P,(0,i._)({},n)),children:t})},P=e=>{var{badge:t,placement:n="bottom-right",className:a}=e,d=(0,r._)(e,["badge","placement","className"]);return(0,o.Y)(_,(0,l._)((0,i._)({},d),{placement:n,className:s()(v.A.singleElement,v.A.empty,a),children:(0,o.Y)(g.UserBadge,{userBadge:t,size:"sm"})}))},T=e=>{var{pub:t,children:n,placement:l="bottom-right"}=e,a=(0,r._)(e,["pub","children","placement"]);let s=(0,o.Y)(A,(0,i._)({pub:t,placement:l},a));return t?(0,o.Y)(b,{badge:s,children:n}):(0,o.Y)(o.FK,{children:n})},A=e=>{var{pub:t,className:n}=e,a=(0,r._)(e,["pub","className"]);return(0,o.Y)(_,(0,l._)((0,i._)({},a),{radius:"xs",className:s()(v.A.singleElement,v.A.empty,n),children:(0,o.Y)(h.Nq,{pub:t,size:16,radius:"xs"})}))}},82100:function(e,t,n){n.d(t,{Q:()=>s});var i=n(69277),l=n(70408),r=n(32641),o=n(4006),a=n(33727);function s(e){var{isDragging:t,dragProps:n,children:s}=e,d=(0,r._)(e,["isDragging","dragProps","children"]);return(0,o.Y)(a.Z,(0,l._)((0,i._)({outline:"none",border:"detail",borderStyle:t?"solid":"dashed",bg:t?"primary-hover":"primary",animate:!0,pressable:"lg"},n,d),{children:s}))}},88762:function(e,t,n){n.d(t,{JU:()=>m,sb:()=>g,oP:()=>f,Sy:()=>v});var i=n(69277),l=n(70408),r=n(32641),o=n(4006),a=n(75159),s=n(32485),d=n.n(s),c=n(17402),u=n(76977),p=n(63136),h=n(66511);let m=(0,c.forwardRef)((e,t)=>{var{className:n,children:s,htmlFor:c}=e,u=(0,r._)(e,["className","children","htmlFor"]);return(0,o.Y)(a.b,{asChild:!0,htmlFor:c,children:(0,o.Y)(p.EY.B4,(0,l._)((0,i._)({as:"label",weight:"medium",color:"primary",ref:t,cursor:"inherit",className:d()("pencraft",n)},u),{children:s}))})}),g=(0,c.forwardRef)((e,t)=>{var{className:n,children:a}=e,s=(0,r._)(e,["className","children"]);return(0,o.Y)(m,(0,l._)((0,i._)({ref:t,className:n},s),{children:(0,o.FD)(u.Ye,{gap:4,alignItems:"center",children:[a,(0,o.Y)(b,{})]})}))}),v=(0,c.forwardRef)((e,t)=>{var{className:n,children:a,hint:s}=e,d=(0,r._)(e,["className","children","hint"]);return(0,o.Y)(m,(0,l._)((0,i._)({ref:t,className:n},d),{children:(0,o.FD)(u.Ye,{gap:4,justifyContent:"space-between",children:[a,(0,o.Y)(Y,{text:s})]})}))}),f=(0,c.forwardRef)((e,t)=>{var{className:n,children:a,tooltip:s}=e,c=(0,r._)(e,["className","children","tooltip"]);return(0,o.Y)(h.m_,{side:"top",text:s,children:(0,o.Y)(m,(0,l._)((0,i._)({ref:t,className:d()("tooltipTrigger-JZ7ToC",n)},c),{children:a}))})}),Y=e=>{let{text:t}=e;return(0,o.Y)(p.EY,{color:"secondary",weight:"regular",children:t})},b=()=>(0,o.Y)(p.EY,{as:"span",color:"error",children:"*"})},51177:function(e,t,n){n.d(t,{gm:()=>Y,q7:()=>f,t7:()=>v});var i=n(69277),l=n(70408),r=n(32641),o=n(4006),a=n(32485),s=n.n(a),d=n(17402),c=n(82519),u=n(84605),p=n(35369),h=n(76977),m=n(45859);n(48625);var g=n(5370);let v=e=>{var{priority:t="secondary-outline",size:n="md"}=e,l=(0,r._)(e,["priority","size"]);"secondary-outline"===t&&(t="tertiary");let a="tertiary"===t;return(0,o.Y)(_.Provider,{value:{priority:t,size:n},children:(0,o.Y)(h.fI,(0,i._)({radius:"sm"===n?"xs":"sm",className:s()(g.A.group,a&&g.A.outlined)},l))})},f=e=>{var{children:t,priority:n="primary",size:a="md",menuItems:s,additionalMenuProps:d={}}=e,p=(0,r._)(e,["children","priority","size","menuItems","additionalMenuProps"]);let{iString:h}=(0,u.GO)();return(0,o.FD)(v,{priority:n,size:a,children:[(0,o.Y)(Y,(0,l._)((0,i._)({},p),{children:t})),(0,o.Y)(m.W1,(0,l._)((0,i._)({},d),{align:"end",trigger:(0,o.Y)(b,(0,l._)((0,i._)({},p),{"aria-label":h("Dropdown menu"),children:(0,o.Y)(c.A,{size:"sm"===a?16:"md"===a?20:24})})),children:s}))]})},Y=(0,d.forwardRef)((e,t)=>{var{className:n}=e,a=(0,r._)(e,["className"]);let{priority:c,size:u}=(0,d.useContext)(_);return(0,o.Y)(p.$n,(0,l._)((0,i._)({priority:c,size:u,className:s()(g.A.segment,n)},a),{ref:t}))}),b=(0,d.forwardRef)((e,t)=>{var{className:n}=e,a=(0,r._)(e,["className"]);let{priority:c,size:u}=(0,d.useContext)(_);return(0,o.Y)(p.K0,(0,l._)((0,i._)({priority:c,size:u,className:s()(g.A.segment,n)},a),{ref:t}))}),_=(0,d.createContext)({priority:"primary",size:"md"})},61084:function(e,t,n){n.d(t,{Jm:()=>w,UC:()=>y,eB:()=>_});var i=n(69277),l=n(70408),r=n(32641),o=n(4006),a=n(32485),s=n.n(a),d=n(45773),c=n(17402),u=n(82519),p=n(84605),h=n(35369),m=n(76977),g=n(45859),v=n(43145),f=n(63136),Y=n(65842),b=n(25879);let _=(0,c.forwardRef)((e,t)=>{var{className:n,error:a=!1,children:s,flex:d="auto",label:c,placeholder:u,disabled:p,leading:h,size:m="md",priority:v="secondary-outline",onClose:f}=e,Y=(0,r._)(e,["className","error","children","flex","label","placeholder","disabled","leading","size","priority","onClose"]);let b=(0,o.Y)(y,(0,l._)((0,i._)({},Y),{className:n,error:a,flex:d,label:c,placeholder:u,disabled:p,leading:h,size:m,priority:v,ref:t}));return(0,o.Y)(g.W1,{trigger:b,disabled:p,matchReferenceWidth:!0,onClose:f,children:s})});_.displayName="SelectMenu";let y=(0,c.forwardRef)((e,t)=>{var{className:n,error:a=!1,flex:d="auto",label:c,placeholder:g,disabled:v,leading:_,size:y="md",priority:w="secondary-outline"}=e,k=(0,r._)(e,["className","error","flex","label","placeholder","disabled","leading","size","priority"]);let{iString:I}=(0,p.GO)(),C=!c,S=null!=g?g:I("Select an option");return(0,o.FD)(h.Nm,(0,l._)((0,i._)({},k),{className:s()(n,b.A.select,b.A.trailing,b.A.menu,b.A["size_".concat(y)],b.A["priority_".concat(w)],!!_&&b.A.leading,!!a&&b.A.error,!!v&&b.A.disabled),display:"flex",position:"relative",textAlign:"left",minWidth:0,flex:d,disabled:v,ref:t,resetCss:!0,children:[_&&(0,o.Y)(Y.uk,{position:"leading",size:y,className:s()(a&&b.A.error),disabled:!!v,children:_}),C?(0,o.Y)(f.EY,{flex:"grow",ellipsis:!0,color:"secondary",children:S}):"string"==typeof c?(0,o.Y)(f.EY,{flex:"grow",ellipsis:!0,color:"primary",children:c}):(0,o.Y)(m.fI,{flex:"grow",alignItems:"center",ellipsis:!0,children:c}),(0,o.Y)(Y.uk,{position:"trailing",size:y,className:s()(a&&b.A.error),disabled:!!v,children:(0,o.Y)(u.A,{})})]}))});function w(e){var{selected:t,trailing:n,onClick:a}=e,s=(0,r._)(e,["selected","trailing","onClick"]);return(0,o.Y)(v.Dr,(0,l._)((0,i._)({},s),{trailing:t?(0,o.Y)(d.A,{}):n,onClick:a}))}y.displayName="SelectMenuTrigger"},72879:function(e,t,n){n.d(t,{M:()=>d});var i=n(4006),l=n(17402),r=n(76977),o=n(20500),a=n(88762),s=n(65842);let d=e=>{let{className:t,children:n,detail:r,label:o,alignment:a="vertical",error:s=!1}=e;return(0,i.Y)("vertical"===a?c:u,{className:t,detail:r,error:s,label:o,children:l.Children.map(n,e=>(0,l.isValidElement)(e)?(0,l.cloneElement)(e,{error:s}):e)})},c=e=>{let{children:t,className:n,detail:l,error:r,label:d}=e;return(0,i.FD)(s.A0,{className:n,children:[(0,i.Y)(a.JU,{weight:"semibold",color:r?"error":"primary",children:d}),t,l?(0,i.Y)(o.EE,{children:l}):r?(0,i.Y)(o.yn,{children:r}):null]})},u=e=>{let{children:t,className:n,detail:l,error:d,label:c}=e;return(0,i.FD)(r.Ye,{className:n,justifyContent:"space-between",alignItems:"start",gap:12,children:[(0,i.FD)(s.A0,{children:[c&&(0,i.Y)(a.JU,{children:c}),l&&(0,i.Y)(o.EE,{children:l}),d&&(0,i.Y)(o.yn,{children:d})]}),t]})}},99484:function(e,t,n){n.d(t,{E:()=>r});var i=n(86500),l=n(39318);let r=e=>{let{feedUrl:t,pub:n,post:r}=e;(0,i.u4)(i.qY.PODCAST_APP_LINK_CLICK,{appName:"Substack App",feedUrl:t}),document.location.href=(0,l.XV8)(null==n?void 0:n.subdomain,null==r?void 0:r.slug,{redirect:"app-marketing",source:"podcast-dropdown"})}},25758:function(e,t,n){n.d(t,{r:()=>b});var i=n(4006),l=n(70511),r=n(78834),o=n(17402),a=n(84605),s=n(89490),d=n(35369),c=n(76977),u=n(16993),p=n(57820),h=n(75303),m=n(21356),g=n(92563),v=n(83447);let f=[{value:"card",label:"Card"},{value:"poster",label:"Poster"},{value:"split",label:"Split"},{value:"overlay",label:"Overlay"},{value:"title",label:"Title"},{value:"app",label:"App"},{value:"solid",label:"Solid"}],Y={card:["composed","sticker","background"],poster:["composed","sticker","background"],split:["composed"],overlay:["composed"],title:["composed","sticker","background"],app:["composed"],solid:["composed"]};function b(e){var t;let{isOpen:n,onClose:h,post:b}=e,{iString:y}=(0,a.GO)(),[I,C]=(0,o.useState)("card"),[S,D]=(0,o.useState)("composed"),[F,x]=(0,o.useState)("stories"),[P,T]=(0,o.useState)("light"),[A,E]=(0,o.useState)(!1);(0,o.useEffect)(()=>{E(!1)},[I,S,F]),(0,o.useEffect)(()=>{Y[I].includes(S)||D("composed")},[I,S]);let{width:N,height:B}=(0,g.S8)(F),M="/api/v1/press_kit/asset/".concat(b.id,"/").concat(I,"/").concat(S,"?aspectRatio=").concat(F,"&mode=").concat(P,"&contentType=text/html"),R="/api/v1/press_kit/asset/".concat(b.id,"/").concat(I,"/").concat(S,"?aspectRatio=").concat(F,"&mode=").concat(P,"&contentType=image/png"),O="".concat(null==(t=b.title)?void 0:t.replace(/[^a-z0-9]/gi,"_").toLowerCase(),"_").concat(I,"_").concat(S,"_").concat(P,".png"),L="composed"===S?w:k,z=[{value:"stories",label:(0,i.Y)(m.s,{children:(0,i.Y)(l.A,{size:20})})},{value:"grid",label:(0,i.Y)(m.s,{children:(0,i.Y)(r.A,{size:20})})}],U=[{value:"light",label:(0,i.Y)(_,{backgroundColor:"var(--color-light-bg-primary)"})},{value:"dark",label:(0,i.Y)(_,{backgroundColor:"var(--color-dark-bg-primary)"})},{value:"accent",label:(0,i.Y)(_,{backgroundColor:"var(--color-accent)"})}];return(0,i.FD)(u.aF,{isOpen:n,onClose:h,width:500,children:[(0,i.Y)(u.rQ,{title:y("Social assets"),onClose:h,showDivider:!0}),(0,i.Y)(u.cw,{children:(0,i.FD)(c.VP,{gap:20,children:[(0,i.FD)(c.fI,{justifyContent:"center",gap:12,children:[(0,i.Y)(m.T,{tabs:z,value:F,onChange:x}),"solid"===I&&(0,i.Y)(m.T,{tabs:U,value:P,onChange:T})]}),(0,i.Y)(c.ov,{children:(0,i.FD)(L,{style:{width:N,height:B},children:[!A&&(0,i.Y)(c.ov,{className:v.A.spinner,children:(0,i.Y)(p.y$,{})}),(0,i.Y)(s.az,{as:"iframe",src:M,onLoad:()=>{E(!0)},style:{width:N,height:B},border:"unset"})]})}),(0,i.Y)(c.ov,{children:(0,i.Y)(m.T,{tabs:f,value:I,onChange:C})})]})}),(0,i.Y)(u.jl,{direction:"column",primaryButton:(0,i.Y)(d.vx,{priority:"primary",href:R,download:O,children:y("Download")})})]})}function _(e){let{backgroundColor:t}=e;return(0,i.Y)(y,{children:(0,i.Y)(s.az,{height:20,width:20,style:{backgroundColor:t}})})}let y=(0,h.I4)({height:20,width:20,radius:"xs",overflow:"hidden",border:"detail"}),w=(0,h.I4)({position:"relative",overflow:"hidden",radius:"md",outline:"detail",bg:"secondary"}),k=(0,h.I4)({position:"relative",overflow:"hidden",radius:"md",outline:"detail",className:v.A.transparent})},90620:function(e,t,n){n.d(t,{n:()=>_,H:()=>b});var i=n(4006),l=n(15871),r=n(13264),o=n(2404),a=n.n(o),s=n(63950),d=n.n(s),c=n(17402),u=n(68410),p=n(26761),h=n(35755),m=n(65670),g=n(99156),v=n(71783),f=n(53168);let Y=(0,c.createContext)({activeBlockId:null,activeDragId:null,attrs:void 0,contentBlockId:"",draggedHeight:null,getColumnItems:()=>[],hoveredColumn:null,isActive:!1,isDragging:!1,setHoveredColumn:d()}),b=()=>(0,c.useContext)(Y),_=e=>{var t;let{attrs:n,children:o,contentBlockId:s,leftItems:d,renderModule:b,rightItems:_}=e,{isDesktop:w}=(0,u.sM)(),{isMobileEditor:k,sendPreviewBlockUpdate:I}=(0,g.T)(),C=(0,m.Cd)(),S=(0,r.Xr)(v.CL),D=(null==C?void 0:C.block.type)==="content-block"?C.block.id:null,F=w&&D===s,x=(null==C||null==(t=C.item)?void 0:t.type)==="sidebar-module",P=F&&!x&&!k,[T,A]=(0,c.useState)(null),[E,N]=(0,c.useState)(null),[B,M]=(0,c.useState)(null),[R,O]=(0,c.useState)([]),[L,z]=(0,c.useState)([]),U=(0,c.useRef)([]),H=(0,c.useRef)([]),q=(0,c.useRef)(!1),G=(0,c.useRef)([]),W=(0,c.useRef)([]);(0,h.h)(null!==T),(0,c.useEffect)(()=>{q.current&&(q.current=!1,A(null),N(null),M(null),O([]),z([]),G.current=[],W.current=[])},[d,_]);let K=(0,l.FR)((0,l.MS)(l.AN,{activationConstraint:{distance:5}})),V=(0,c.useCallback)(e=>{let t=(0,p.XX)({event:e,leftThresholds:U.current,rightThresholds:H.current});if(!t)return;let{newLeftItems:n,newRightItems:i}=(0,p.An)({dragResult:t,leftItems:d,rightItems:_}),l=!a()(G.current,n),r=!a()(W.current,i);(l||r)&&(l&&(G.current=n,O(n)),r&&(W.current=i,z(i)),S(e=>e+1))},[d,_]),j=(0,c.useCallback)(e=>{let t="left"===e?d:_,n="left"===e?G.current:W.current;return T?n:t},[T,d,_]),X=(0,c.useMemo)(()=>{var e;return{activeBlockId:F?s:null,activeDragId:T,attrs:n,contentBlockId:s,draggedHeight:null!=(e=null==E?void 0:E.height)?e:null,getColumnItems:j,hoveredColumn:B,isActive:P,isDragging:!!T,setHoveredColumn:M}},[P,T,n,s,null==E?void 0:E.height,j,B,F]);return(0,i.Y)(l.Mp,{autoScroll:!0,collisionDetection:p.t5,sensors:K,onDragEnd:()=>{document.documentElement.classList.remove("theme-editor-dragging");let e=R.length!==d.length||R.some((e,t)=>e!==d[t]),t=L.length!==_.length||L.some((e,t)=>e!==_[t]);U.current=[],H.current=[],e||t?(q.current=!0,I({previewBlockId:{type:"content-block",contentBlockId:s},updates:{secondary_sidebar_modules:R,primary_sidebar_modules:L}})):(A(null),N(null),M(null),O([]),z([]),G.current=[],W.current=[])},onDragMove:V,onDragStart:e=>{let t=e.active.id,n=(0,p._9)(t);if(!n)return;U.current=(0,p.Fo)({items:d,draggedId:n,getElement:e=>document.querySelector('[data-draggable-id="left-'.concat(e,'"]'))}),H.current=(0,p.Fo)({items:_,draggedId:n,getElement:e=>document.querySelector('[data-draggable-id="right-'.concat(e,'"]'))}),document.documentElement.classList.add("theme-editor-dragging");let{width:i,height:l}=y(t);A(t),N({moduleId:n,width:i,height:l}),O(d),z(_),G.current=d,W.current=_},children:(0,i.FD)(Y.Provider,{value:X,children:[o,(0,i.Y)(l.Hd,{dropAnimation:null,zIndex:f.Up+10,children:T&&E?(0,i.Y)("div",{className:"dragOverlay-Slsz_M",style:{width:E.width-8},children:b(E.moduleId)}):null})]})})},y=e=>{var t,n;let i=document.querySelector('[data-draggable-id="'.concat(e,'"]'));return{width:null!=(t=null==i?void 0:i.offsetWidth)?t:0,height:null!=(n=null==i?void 0:i.offsetHeight)?n:0}}},26761:function(e,t,n){n.d(t,{An:()=>r,C3:()=>u,Fo:()=>d,MJ:()=>a,XX:()=>l,_9:()=>s,t5:()=>o,tG:()=>c});var i=n(15871);function l(e){var t,n,i,l,r;let{event:o,leftThresholds:a,rightThresholds:d}=e,c=o.active.id;if(!c)return null;let u=o.active.rect.current.translated;if(!u)return null;let p=null!=(n=null==(t=o.over)?void 0:t.id)?n:null,h=(l=c).startsWith("left-")?"left":l.startsWith("right-")?"right":null;if(!h)return null;let m=s(c);if(!m)return null;let g=null!=(i=p?"drop-zone-left"===(r=p)||"column-left"===r?"left":"drop-zone-right"===r||"column-right"===r?"right":null:null)?i:h,v=function(e,t,n){let i=n.filter(t=>t.itemId!==e);for(let e=0;ee!==l),s=i.filter(e=>e!==l);return"left"===r?a.splice(o,0,l):s.splice(o,0,l),{newLeftItems:a,newRightItems:s}}let o=e=>{let{collisionRect:t}=e;return t?(0,i.Qo)(e).filter(e=>e.id.startsWith("column-")):[]},a=e=>{let{column:t,moduleId:n}=e;return"".concat(t,"-").concat(n)},s=e=>e?e.replace(/^(left|right)-/,""):null;function d(e){let{items:t,draggedId:n,getElement:i}=e,l=[],r=0;for(let e of t){let t=i(e);if(t){let n=t.getBoundingClientRect();0===r&&(r=n.top+window.scrollY),l.push({itemId:e,height:n.height})}}let o=[],a=r;for(let{itemId:e,height:t}of l)e!==n&&(o.push({itemId:e,centerY:a+t/2}),a+=t);return o}function c(e){let{draggedY:t,thresholds:n}=e;for(let e=0;ee!==n);return[...l.slice(0,i),n,...l.slice(i)]}},35755:function(e,t,n){n.d(t,{h:()=>l});var i=n(17402);function l(e){let t=(0,i.useRef)(null);(0,i.useEffect)(()=>{if(!e){t.current=null;return}let n=document.documentElement;t.current=n.scrollLeft;let i=()=>{null!==t.current&&n.scrollLeft!==t.current&&(n.scrollLeft=t.current)};return window.addEventListener("scroll",i,{passive:!1,capture:!0}),()=>{window.removeEventListener("scroll",i,{capture:!0})}},[e])}},63026:function(e,t,n){n.d(t,{P:()=>l});var i=n(17402);function l(e){(0,i.useEffect)(()=>{let t=t=>{var n,i;let l=e[null==(n=t.data)?void 0:n.type];l&&l(null==(i=t.data)?void 0:i.value)};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)},[e])}},45387:function(e,t,n){n.d(t,{JQ:()=>s,MS:()=>c,k6:()=>d});var i=n(13264),l=n(17402),r=n(90800),o=n(71783),a=n(2247);function s(){let e=(0,i.md)(o.c5);return(0,l.useMemo)(()=>e&&"content-block"===e.block.type?e.block.id:null,[e])}function d(e){let t=(0,i.md)(o.c5),n=(0,i.md)(o.SH);return(0,l.useMemo)(()=>{if(!e)return{isActive:null===t&&null===n,clickAction:"none",showOverlay:!1};let{selection:i,picker:l}=(0,a.U)(e);return(0,r.uz)(i,l,t,n)},[n,e,t])}function c(e,t){let n=(0,i.md)(o.c5);return(0,l.useMemo)(()=>!!n&&"content-block"===n.block.type&&n.block.id===e&&!!n.item&&"sidebar-module"===n.item.type&&n.item.moduleId===t,[e,t,n])}},65670:function(e,t,n){n.d(t,{Cd:()=>c,er:()=>d,kG:()=>p,u2:()=>u});var i=n(13264),l=n(17402),r=n(47787),o=n(40960),a=n(90800),s=n(71783);function d(){let[e,t]=(0,i.fp)(s.Xk),[n,d]=(0,i.fp)(s.c5),[c,u]=(0,i.fp)(s.SH),p=(0,i.md)(s.Ye),{postMessageToIframe:h,scrollToBlock:m}=(0,r.i)(),g=(0,l.useCallback)(e=>{h(o.bM.SELECTION_CHANGED,e),d(e)},[h,d]),v=(0,l.useCallback)(e=>{h(o.bM.PICKER_CHANGED,e),u(e)},[h,u]),f=(0,l.useCallback)(e=>{let t={block:e};(0,a.BJ)(n,t)||(g(t),m(e))},[n,g,m]),Y=(0,l.useCallback)(e=>{if(!n)return;let t={block:n.block,item:e};(0,a.BJ)(n,t)||(g(t),m(n.block))},[n,g,m]),b=(0,l.useCallback)(()=>{if(c)return void v(null);if(null!==n){if(p&&n.item)return void g({block:n.block});g(null)}},[p,c,n,v,g]),_=(0,l.useCallback)(e=>{v(e)},[v]),y=(0,l.useCallback)(()=>{v(null)},[v]),w=(0,l.useCallback)(()=>{v(null),p?g({block:p}):g(null)},[p,v,g]),k=(0,l.useCallback)(()=>{t("panel"),v(null),p?g({block:p}):g(null)},[p,t,v,g]),I=(0,l.useCallback)(()=>{t("fullscreen")},[t]);return{mode:e,selection:n,picker:c,setMode:t,selectBlock:f,selectItem:Y,close:b,goToRoot:k,minimize:I,openPicker:_,closePicker:y,selectFromClick:(0,l.useCallback)(e=>{let{selection:t,picker:n}=e;if(n){t&&g(t),v(n);return}t?(g(t),m(t.block)):w()},[w,m,v,g])}}function c(){return(0,i.md)(s.c5)}function u(){let e=(0,i.md)(s.c5);return(0,l.useMemo)(()=>(0,a.nA)(e),[e])}function p(){return(0,i.md)(s.SH)}},17705:function(e,t,n){n.d(t,{r:()=>r});var i=n(4006),l=n(76438);let r=()=>(0,i.Y)("div",{className:"indicator-EPTRC9",children:(0,i.Y)(l.A,{fill:"white",size:12})})},9624:function(e,t,n){n.d(t,{y:()=>Y,z:()=>b});var i=n(4006),l=n(32485),r=n.n(l),o=n(17402),a=n(73815),s=n(84605),d=n(90620),c=n(45387),u=n(17705),p=n(90800),h=n(90839),m=n(86503),g=n(99156);let v=new Map,f=(0,o.createContext)(v),Y=e=>{let{posts:t,children:n}=e,l=(0,o.useMemo)(()=>{let e=new Map;return t.forEach((t,n)=>{t&&e.set(t.id,n)}),e},[t]);return(0,i.Y)(f.Provider,{value:l,children:n})},b=e=>{var t,n;let{children:l,overlayInset:v,postId:Y,slotIndex:b}=e,{iString:_}=(0,s.GO)(),{isDragging:y}=(0,d.H)(),w=(0,h.sb)(),{activatePreviewBlock:k,deactivatePreviewBlock:I,isMobileEditor:C,isPreviewMode:S,pinnedPostIdsByBlock:D}=(0,g.T)(),F=(0,h.p$)(),x=(0,o.useContext)(f),P=void 0!==Y?null!=(n=null!=(t=x.get(Y))?t:b)?n:0:null!=b?b:0,T=(null==w?void 0:w.type)==="content-block"?w.contentBlockId:(null==w?void 0:w.type)==="home-hero"?"home-hero":null,A=T?D.get(T):void 0,E=!!A&&void 0!==Y&&!0===A.pinnedPostIds.has(Y),N=E||(null==A?void 0:A.nextPinSlot)===null||P===(null==A?void 0:A.nextPinSlot),B=(0,o.useMemo)(()=>w?"home-hero"===w.type?{type:"post-pin",parentBlockType:"home-hero",postId:Y,slotIndex:P}:"content-block"===w.type?{type:"post-pin",parentBlockType:"content-block",parentContentBlockId:w.contentBlockId,postId:Y,slotIndex:P}:null:null,[w,Y,P]),{isActive:M,clickAction:R,showOverlay:O}=(0,c.k6)(B),L="activate"===R,z=S&&F&&(O||M||L||"deactivate"===R)&&!C,U=(0,o.useCallback)(e=>{e.stopPropagation(),B&&"none"!==R&&("deactivate"===R?I():N&&k(B))},[B,R,N,k,I]);if(!z||!B)return l;let H=(0,p.tP)(B);return(0,i.FD)("div",{className:r()("container-lqAJMv",{[String("containerInset12-hhXeHr")]:12===v,[String("containerClickable-XZK03S")]:N&&L&&!y}),id:H,onClick:y?void 0:U,children:[(0,i.Y)("div",{className:"content-Alnzbs",children:l}),!y&&N&&O&&!M?(0,i.Y)(m.O,{label:_("Click to pin"),size:"sm"}):!y&&N&&L?(0,i.Y)("div",{className:"clickCatcher-rTYOj8",onClick:U}):y||"deactivate"!==R||M?null:(0,i.Y)("div",{className:"clickCatcherPassive-HgyfdO",onClick:U}),E&&(0,i.Y)("div",{className:"unpinButtonWrapper-ExZTwo",children:(0,i.Y)(a.Z,{children:(0,i.Y)(u.r,{})})})]})}},90839:function(e,t,n){n.d(t,{p$:()=>y,Z4:()=>_,sb:()=>b,l3:()=>w,kT:()=>k});var i=n(69277),l=n(70408),r=n(4006),o=n(32485),a=n.n(o),s=n(65892),d=n(17402),c=n(84605),u=n(35369),p=n(25112),h=n(45387),m=n(65670),g=n(90800),v=n(86503),f=n(99156);let Y=(0,d.createContext)({previewBlockId:null,disabled:!1,pinningEnabled:!0}),b=()=>(0,d.useContext)(Y).previewBlockId,_=()=>(0,d.useContext)(Y).disabled,y=()=>(0,d.useContext)(Y).pinningEnabled,w=e=>{let{children:t}=e,n=(0,d.useContext)(Y),o=(0,d.useMemo)(()=>(0,l._)((0,i._)({},n),{pinningEnabled:!1}),[n]);return(0,r.Y)(Y.Provider,{value:o,children:t})},k=e=>{let{children:t,disabled:n,editButtonPosition:i="top-right",flushBottom:l,flushTop:o,layoutVariant:b,onEditClick:_,pinningEnabled:y=!0,previewBlockId:w}=e,{iString:k}=(0,c.GO)(),{isMobileEditor:I,isPreviewMode:C}=(0,f.T)(),S=(0,m.Cd)(),D=(0,m.kG)(),{isClickable:F,handleClick:x,isSelf:P,shouldHideOverlay:T,showOverlay:A}=function(e){let{activatePreviewBlock:t,deactivatePreviewBlock:n}=(0,f.T)(),{isActive:i,clickAction:l,showOverlay:r}=(0,h.k6)(e),o="activate"===l;return{isClickable:o,handleClick:(0,d.useCallback)(i=>{"none"===l||document.documentElement.classList.contains("theme-editor-dragging")||(i.stopPropagation(),"activate"===l?t(e):n())},[l,e,t,n]),isSelf:i,shouldHideOverlay:!o,showOverlay:r}}(w),E=(0,g.tP)(w),N=(0,d.useMemo)(()=>!!(null==S?void 0:S.item)&&("content-block"===w.type?"content-block"===S.block.type&&S.block.id===w.contentBlockId:"home-hero"===w.type&&"home-hero"===S.block.type),[S,w]),B=(0,d.useMemo)(()=>({previewBlockId:w,disabled:null!=n&&n,pinningEnabled:y}),[w,n,y]);if(!C||n)return!C&&_?(0,r.Y)(Y.Provider,{value:B,children:(0,r.Y)("div",{className:"editableWrapper-_KbpdF",children:(0,r.FD)("div",{className:a()("editableInner-oJ1XcS",{[String("editableInnerThreeColumn-Vu9RZC")]:"three-column"===b}),children:[(0,r.Y)("div",{className:a()("editButton-ptHFjJ",{[String("editButtonBottomRight-1D36eX")]:"bottom-right"===i}),children:(0,r.Y)(u.K0,{priority:"tertiary",size:"sm",onClick:_,children:(0,r.Y)(s.A,{size:16})})}),t]})})}):(0,r.Y)(Y.Provider,{value:B,children:t});let M="content-block"===w.type&&w.contentBlockId===p.vK&&(null==D?void 0:D.type)==="block-picker",R=F&&!M,O=A&&!(P||M)&&(0,r.Y)(v.O,{flushBottom:l,flushTop:o,isClickable:R,isHidden:T||I,label:k("Click to edit"),size:"md",onClick:x});return(0,r.Y)(Y.Provider,{value:B,children:(0,r.FD)("div",{className:a()("container-QjkLOY",{[String("containerClickable-y3Lkil")]:R,[String("containerParentOfActive-ol8TRC")]:N,[String("threeColumn-Bky0HP")]:"three-column"===b}),id:E,onClick:M?void 0:x,children:[(0,r.Y)("div",{className:"content-SqAaA1",children:t}),(0,r.Y)("div",{className:"overlayWrapper-m1uuha","data-spotlight-target":!0,children:O})]})})}},86503:function(e,t,n){n.d(t,{O:()=>h});var i=n(4006),l=n(32485),r=n.n(l),o=n(32708),a=n(17402),s=n(35369),d=n(76977),c=n(81929);let u=e=>{let{children:t,className:n}=e;return(0,i.Y)(c.vw,{className:r()("label-XuJdtO",n),priority:"primary",theme:"accent",children:t})};var p=n(53168);let h=e=>{let{flushBottom:t,flushTop:n,isClickable:l=!0,isDraggable:c,isHidden:h,label:m,size:g,onClick:v,onRemove:f}=e,Y=(0,a.useCallback)(e=>{e.stopPropagation(),null==f||f(e)},[f]);return(0,i.FD)(d.pT,{alignItems:"start",className:r()("overlay-eiZ8aN",{[String("flushBottom-kP5XHz")]:t,[String("flushTop-OmnylT")]:n,[String("hoverDisabled-gnX9_W")]:!l,[String("sidebarModule-EK8DQl")]:"sm"===g}),cursor:c?"grab":l?"pointer":"default",justifyContent:"center",opacity:h?0:void 0,position:"absolute",style:{zIndex:"sm"===g?p.AG+1:p.AG},onClick:v,children:[(0,i.Y)(u,{children:m}),f&&(0,i.Y)(s.K0,{className:"removeButton-uczOyA",priority:"tertiary-accent",size:"xs",onClick:Y,children:(0,i.Y)(o.A,{size:16})})]})}},26392:function(e,t,n){n.d(t,{o:()=>s});var i=n(4006),l=n(32485),r=n.n(l),o=n(99156);let a="fullHeight-adKNT4",s=e=>{let{children:t,fullHeight:n}=e,{isPreviewMode:l}=(0,o.T)();return l?(0,i.Y)("div",{className:r()("container-EyuCoW",{[String(a)]:n}),children:(0,i.Y)("div",{className:r()("content-ybzYkV",{[String(a)]:n}),children:t})}):t}},10527:function(e,t,n){n.d(t,{z:()=>D});var i=n(4006),l=n(46271),r=n(69277),o=n(82853),a=n(48309),s=n(43954),d=n(49031),c=n(34581),u=n(80548),p=n(86500),h=n(68349),m=n(35369),g=n(76977),v=n(63136),f=n(36372),Y=n(39318),b=n(49807);function _(e){let{shareUrl:t,shareText:n,shareEventType:l,itemKey:r,shareSource:m,comment:v,onShare:_}=e,C=(0,f.d)(),S=(e,t)=>{(0,p.u4)(p.qY.SHARE_LINK_CLICKED,{name:e,type:l,item_entity_key:r,source:m});let n=t();n&&(n.startsWith("http")?window.open(n,"_blank"):document.location.href=n),null==_||_()};return(0,i.Y)(g.I1,{flex:"grow",justifyContent:"center",children:(0,i.FD)(g.pT,{gap:8,children:[(0,i.FD)(y,{children:[(0,i.Y)(k,{onClick:()=>{S("twitter",()=>(0,Y.gKg)({url:t,text:n}))},children:(0,i.Y)(u.A,{size:48})}),(0,i.Y)(w,{children:"Twitter"})]}),(0,i.FD)(y,{children:[(0,i.Y)(k,{onClick:()=>{S("facebook",()=>(0,Y.yRP)("https://www.facebook.com/sharer/sharer.php",{u:t}))},children:(0,i.Y)(d.A,{size:48})}),(0,i.Y)(w,{children:"Facebook"})]}),(0,i.FD)(y,{children:[(0,i.Y)(k,{onClick:()=>{S("linkedin",()=>(0,Y.yRP)("https://www.linkedin.com/sharing/share-offsite/",{url:t}))},children:(0,i.Y)(c.A,{size:48})}),(0,i.Y)(w,{children:"LinkedIn"})]}),(0,i.FD)(y,{children:[(0,i.Y)(I,{onClick:()=>{S("copy",()=>{(0,h.lW)(t)}),C.popToast(()=>(0,i.Y)(f.y,{text:"Copied link to clipboard",Icon:o.A}))},children:(0,i.Y)(o.A,{size:20,style:{stroke:"var(--color-fg-primary)"}})}),(0,i.Y)(w,{children:"Copy link"})]}),v?(0,i.FD)(y,{children:[(0,i.Y)(I,{onClick:()=>{C.popToast(()=>(0,i.Y)(f.y,{text:"Downloading image...",Icon:a.A}))},href:(0,b.Hr8)(v.id),target:"_blank",download:!0,children:(0,i.Y)(a.A,{size:20,style:{stroke:"var(--color-fg-primary)"}})}),(0,i.Y)(w,{children:"Save image"})]}):(0,i.FD)(y,{children:[(0,i.Y)(I,{onClick:()=>{S("email",()=>(0,Y.yRP)("mailto:",{subject:n,body:t}))},children:(0,i.Y)(s.A,{size:20,style:{stroke:"var(--color-fg-primary)"}})}),(0,i.Y)(w,{children:"Email"})]})]})})}function y(e){return(0,i.Y)(g.I1,(0,r._)({gap:8,alignItems:"center",flex:"grow"},e))}function w(e){return(0,i.Y)(v.EY.B5,(0,r._)({align:"center",color:"primary"},e))}function k(e){return(0,i.Y)(m.Nm,(0,r._)({resetCss:!0,className:"button-D5uF7U"},e))}function I(e){return(0,i.Y)(m.K0,(0,r._)({size:"lg",rounded:!0,priority:"tertiary"},e))}var C=n(24078),S=n(16993);let D=e=>{let{isOpen:t,utmSource:n,onClose:r,setShared:o}=e,{user:a}=(0,l.ur)();if(!a)return(0,i.Y)(i.FK,{});let s=(0,b.gYq)(a,{utm_source:n}),d="/img/profile_cards/card-bg-".concat(Math.ceil((null==a?void 0:a.id)?a.id%9+1:8*Math.random()),".png");return(0,i.FD)(S.aF,{isOpen:t,onClose:r,width:480,children:[(0,i.Y)(S.rQ,{onClose:r}),(0,i.FD)(g.I1,{paddingX:32,paddingTop:16,paddingBottom:24,gap:20,children:[(0,i.FD)(g.I1,{alignItems:"center",gap:8,children:[(0,i.Y)(v.EY.H2,{weight:"semibold",children:"Invite your friends"}),(0,i.Y)(v.EY.B3,{align:"center",color:"secondary",children:"Share your profile to help your friends and followers find you on Substack."})]}),(0,i.FD)(g.I1,{justifyContent:"center",alignItems:"center",border:"detail",radius:"md",shadow:"lg",className:"card-qnekae",children:[(0,i.Y)(g.I1,{flex:"grow",className:"cardTop-yLKLMp",children:(0,i.Y)("img",{className:"cardOverlay-BwDmPh",src:(0,b.dJ9)(d,800)})}),(0,i.FD)(g.I1,{flex:"grow",alignSelf:"stretch",className:"cardBottom-eN66Vc",gap:16,paddingX:20,paddingBottom:20,paddingTop:0,children:[(0,i.FD)(g.pT,{justifyContent:"space-between",alignItems:"end",children:[(0,i.Y)(C.eu,{user:a,size:112,className:"cardAvatar-lmAiQ1"}),(0,i.Y)(m.$n,{priority:"secondary",rounded:!0,className:"fakeButton-UNdCaV",children:"Subscribe"})]}),(0,i.FD)(g.I1,{flex:"grow",gap:8,children:[(0,i.Y)(v.EY.H2,{children:a.name}),(0,i.Y)(v.EY.Meta,{className:"cardUrl-Ccl_69",size:12,color:"substack",children:s.replace(/^(http|https):\/\//,"").replace(/\?.*$/,"")}),a.bio&&(0,i.Y)(v.EY.B4,{color:"secondary",children:a.bio})]})]})]}),(0,i.Y)(v.EY.Meta,{align:"center",children:"Share via"}),(0,i.Y)(_,{shareUrl:s,shareEventType:"profile",shareText:"Subscribe to me on Substack",itemKey:a.id,onShare:()=>{o&&o()}})]})]})}},83357:function(e,t,n){n.d(t,{N:()=>p,g:()=>h});var i=n(69277),l=n(70408),r=n(32641),o=n(4006),a=n(99862),s=n(17402),d=n(72343),c=n(99662),u=n(89490);let p=(0,s.forwardRef)((e,t)=>{var{href:n,onClick:a,campaign:s,replace:d,state:c,showBack:p}=e,m=(0,r._)(e,["href","onClick","campaign","replace","state","showBack"]);let g=h({href:n,onClick:a,campaign:s,replace:d,state:c=p?(0,l._)((0,i._)({},c),{showBack:!0}):c});return(0,o.Y)(u.az,(0,i._)((0,l._)((0,i._)({as:"a"},m),{ref:t}),g))});function h(e){let{onClick:t,href:n,campaign:l,replace:r,state:o}=e,s=!1;if(n&&!(0,c.y)()){let e;try{e=new URL(n)}catch(t){try{e=new URL("".concat(document.location.origin).concat(n))}catch(e){}}if(e)if((s=e.origin!==document.location.origin)||l)s&&l&&(n=(0,d.P)(n,l));else{let t=new URLSearchParams,i={};for(let[n,l]of e.searchParams)n.startsWith("utm_")?"utm_campaign"===n?i.name=l:i[n.replace(/^utm_/,"")]=l:t.append(n,l);l=i;let r=t.toString();n="".concat(e.pathname).concat(r?"?".concat(r):"").concat(e.hash)}}return{href:n,onClick:e=>{if(null==t||t(e),!s&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey&&n&&!(0,c.y)()){if(e.defaultPrevented)return void e.stopPropagation();(0,d.x4)((0,i._)({},l)),e.preventDefault(),e.stopPropagation(),(0,a.route)(n,r),o&&history.replaceState(o,"")}}}}},2481:function(e,t,n){n.d(t,{Ay:()=>x,L6:()=>R,NP:()=>M,um:()=>P,wG:()=>B});var i=n(69277),l=n(70408),r=n(32641),o=n(4006),a=n(32485),s=n.n(a),d=n(17402),c=n(78649),u=n(84605),p=n(46271),h=n(86998),m=n(98920),g=n(24078),v=n(35369),f=n(76977),Y=n(16993),b=n(63136),_=n(2824),y=(n(81870),n(5180)),w=n(21398),k=n(46453),I=n(11510),C=n(16884),S=n(70515),D=n(57423);function F(e){var t,a,{isOpen:s}=e,c=(0,r._)(e,["isOpen"]);let{iString:p}=(0,u.GO)(),h=(0,d.useRef)(()=>c.onClose());return(0,o.FD)(Y.aF,{className:D.A.composerModal,isOpen:s,onClose:()=>h.current(),fullscreenMobile:!0,width:600,children:[(0,o.Y)(Y.lR,{title:p("New note")}),(0,o.Y)(w.Ic,(0,l._)((0,i._)({},c),{requestCloseRef:h,module:"../feed/NoteComposer",resolve:e=>e.NoteComposer,onRequest:()=>Promise.all([n.e("31023"),n.e("37911"),n.e("44176"),n.e("36667"),n.e("81669"),n.e("73151")]).then(n.bind(n,56879)),whileLoading:(0,o.Y)("div",{style:{height:336}})}),null!=(a=null==(t=c.editComment)?void 0:t.id)?a:"new")]})}function x(e){let{disabled:t,parentPubId:n,parentPostId:r,parentCommentId:a,restackUrl:d,placeholder:m,tabId:Y,surface:_,initialText:y,className:w,textClassName:I,parentMediaClipId:C}=e,{iString:S}=(0,u.GO)(),F=M(),x=(0,p.Jd)(),{requireLogin:P}=(0,k.eE)(),T=(0,h.zj)({onAddFiles:e=>{F.open((0,i._)({parentPubId:n,parentPostId:r,parentCommentId:a,restackUrl:d,initialFiles:e,tabId:Y,surface:_,initialText:y},C&&{parentMediaClipId:C}))},acceptFile:h.um});return(0,o.Y)(f.I1,(0,l._)((0,i._)({},T.props),{position:"relative",children:(0,o.Y)(v.Nm,{onClick:()=>{t||(x?F.open((0,i._)({parentPubId:n,parentPostId:r,parentCommentId:a,restackUrl:d,tabId:Y,surface:_,initialText:y},C&&{parentMediaClipId:C})):null==P||P())},disabled:t,radius:"md",resetCss:!0,showFocus:!0,animate:!0,"aria-label":S("New post"),children:(0,o.Y)(c.Q,{children:(0,o.FD)(f.Ye,{padding:16,gap:12,radius:"md",alignItems:"center",bg:"primary",border:"detail",shadow:"xs",cursor:"pointer",userSelect:"none",className:s()(D.A.inlineComposer,T.isDragging&&D.A.isDragging,w),animate:!0,children:[x?(0,o.Y)(g.eu,{size:36,user:x,"aria-hidden":!0}):(0,o.Y)(f.pT,{flex:"auto",children:(0,o.Y)(g.eu,{size:36,"aria-hidden":!0})}),(0,o.Y)(b.EY.B2,{align:"left",color:"secondary",flex:"grow",ellipsis:!0,className:I,children:m||S("What's on your mind?")})]})})})}))}function P(e){let{disabled:t,parentPubId:n,parentPostId:r,parentCommentId:a,placeholder:d,tabId:c,surface:u,parentMediaClipId:m}=e,Y=M(),_=(0,p.Jd)(),y=(0,I.Iu)(),{requireLogin:w}=(0,k.eE)(),C=(0,h.zj)({onAddFiles:e=>{Y.open((0,i._)({parentPubId:n,parentPostId:r,parentCommentId:a,initialFiles:e,tabId:c,surface:u},m&&{parentMediaClipId:m}))},acceptFile:h.um});return(0,o.Y)(f.I1,(0,l._)((0,i._)({},C.props),{children:(0,o.Y)(v.Nm,{onClick:()=>{t||(_?Y.open((0,i._)({parentPubId:n,parentPostId:r,parentCommentId:a,tabId:c,surface:u},m&&{parentMediaClipId:m})):null==w||w())},disabled:t,resetCss:!0,children:(0,o.FD)(f.Ye,{padding:16,gap:12,alignItems:"center",bg:"primary",cursor:"pointer",className:s()(D.A.mobileInlineComposer,{[D.A.isDropping]:C.isDragging}),children:[_?(0,o.Y)(g.eu,{size:36,user:_}):(0,o.Y)(f.pT,{flex:"auto",children:(0,o.Y)(g.eu,{size:36})}),(0,o.Y)(b.EY.B3,{align:"left",color:"secondary",flex:"grow",children:d||"What's on your mind?"}),!y&&(0,o.Y)(T,{})]})})}))}function T(){return(0,o.Y)(f.pT,{fontSize:14,fontWeight:"semibold",font:"text",style:{backgroundColor:"var(--color-button-primary-bg)",opacity:.5},alignItems:"center",justifyContent:"center",height:40,paddingX:12,radius:"sm",color:"white",children:"Post"})}let A={isOpen:!1,firstComment:void 0,pendingFirstComment:void 0};function E(e){return!e.isOpen&&!!e.pendingFirstComment}let N=(0,d.createContext)({state:A,open:async()=>{throw Error("Not implemented")}});function B(e){var t,r,a;let{children:s}=e,c=(0,p.Jd)(),u=!(null==c?void 0:c.name),h=(0,y.wA)(),[g,v]=(0,d.useState)(A),[f,b]=(0,d.useState)(!1),{feedItem:k}=g,I=R(k),C=(null==k?void 0:k.type)==="comment"?null!=(r=null==(t=k.parentComments)?void 0:t[0])?r:k.comment:null;(0,d.useEffect)(()=>{c&&Promise.all([n.e("31023"),n.e("37911"),n.e("44176"),n.e("36667"),n.e("81669"),n.e("73151")]).then(n.bind(n,56879))},[c]),(0,d.useEffect)(()=>{g.isOpen&&n.e("22679").then(n.bind(n,15722))},[g.isOpen]),(0,d.useEffect)(()=>{g.isOpen&&u&&b(!0)},[u,g.isOpen]),(0,d.useEffect)(()=>{E(g)&&v(e=>E(e)?(0,l._)((0,i._)({},e),{firstComment:e.pendingFirstComment,pendingFirstComment:void 0}):e)},[g.isOpen,g.pendingFirstComment]);let S=(0,d.useMemo)(()=>({state:g,open:e=>new Promise((t,n)=>{v((0,l._)((0,i._)({},A,e),{isOpen:!0,resolve:t,reject:n}))})}),[g]),D=function(){var e,t,n;let l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;null==(t=document.activeElement)||null==(e=t.blur)||e.call(t),(null==r?void 0:r.skipOnDismiss)||null==(n=g.onDismiss)||n.call(g),v((0,i._)({},A,l))};return(0,o.FD)(N.Provider,{value:S,children:[s,u?(0,o.Y)(m.Z,{displaySignInModal:f,onCloseSignInModal:()=>{b(!1),v((0,l._)((0,i._)({},g),{isOpen:!1}))},isStatic:!1,entry:"composer-new-post"}):I?(0,o.Y)(_.a,{isOpen:g.isOpen,onClose:()=>D(),requirement:I,writerId:null!=(a=null==C?void 0:C.user_id)?a:0}):(0,o.Y)(F,(0,l._)((0,i._)({},g),{isOpen:g.isOpen,onClose:()=>D(),onSuccess:e=>{var t,n;e.isFirstFeedCommentByUser&&"share_center"!==g.surface?D({pendingFirstComment:e}):D(),g.editComment?h({type:"edit_comment",payload:{comment:e}}):h({type:"new_comment",payload:{comment:e,skipFeedInsertion:!!(g.restackUrl||"draft"===e.status)}}),null==(t=g.onCompose)||t.call(g,e),null==(n=g.resolve)||n.call(g,e)},onError:g.reject})),(0,o.Y)(Y.aF,{isOpen:!!g.firstComment,width:500,children:g.firstComment&&(0,o.Y)(w.Ic,{module:"@/frontend/feed/NuxModal",resolve:e=>e.FeedNuxShareFirstNote,onRequest:()=>n.e("22679").then(n.bind(n,15722)),onClose:()=>D({},{skipOnDismiss:!0}),comment:g.firstComment})})]})}function M(){return(0,d.useContext)(N)}function R(e){var t,n;let i=(0,p.Jd)(),l=null==e?void 0:e.post,r=(null==e?void 0:e.type)=="comment"?null!=(n=null==(t=e.parentComments)?void 0:t[0])?n:e.comment:null,{user_id:o}=null!=r?r:{},{reply_minimum_role:a}=null!=r?r:{},s=(0,C.GQ)(null!=o?o:0);if(null==a&&(null==l?void 0:l.write_comment_permissions)==="only_paid"&&(a="paid_subscriber"),!o||!a||(null==e?void 0:e.canReply)||r&&i&&(0,S.fP)(r,i.id))return null;if(a){if("free_subscriber"===a&&(!s||!["free_subscription","subscribed"].includes(s)))return"free_subscriber";if("paid_subscriber"===a&&"subscribed"!==s)return"paid_subscriber"}return null}},45795:function(e,t,n){n.d(t,{CF:()=>V,i3:()=>ep});var i=n(69277),l=n(70408),r=n(32641),o=n(4006),a=n(32485),s=n.n(a),d=n(23345),c=n(57157),u=n(3831),p=n(38637),h=n(82853),m=n(17402),g=n(8853),v=n(38305),f=n(84777),Y=n(26966),b=n(898),_=n(1585),y=n(41935),w=n(84605),k=n(46271),I=n(60346),C=n(72569),S=n(82772),D=n(68349),F=n(93946),x=n(89490),P=n(35369),T=n(76977),A=n(22602),E=n(45974),N=n(63136),B=n(504),M=n(2548),R=n(90389),O=n(93427),L=n(89088),z=n(11510),U=n(32848),H=n(49095),q=n(65942),G=n(39318),W=n(49807),K=n(8636);function V(e){var t,{post:n,pub:a,openInPostViewer:s,canonicalUrl:d,searchTrackingParams:c}=e,u=(0,r._)(e,["post","pub","openInPostViewer","canonicalUrl","searchTrackingParams"]);let p=!!(0,k.Jd)(),{formatPostConsumptionTime:h}=(0,L.I)(),{subscription:m}=(0,U.K5)(a.id);return(0,o.Y)(j,(0,l._)((0,i._)({},u),{post:n,postId:n.id,title:n.title,description:(0,q.A)(n.description),bylines:n.publishedBylines,consumptionTime:h(n),coverImage:n.cover_image,type:(0,F.Zq)(n),Icon:"podcast"===(t=(0,F.Zq)(n))?Y.k:"video"===t?_.N:null,canonicalUrl:null!=d?d:(0,G.wu9)(a,n,{signedIn:p}),noNewTab:s,timestamp:n.post_date,pub:a,searchTrackingParams:c,audienceBadge:["only_paid","founding"].includes(n.audience)?(null==m?void 0:m.membership_state)==="free_signup"&&n.should_send_free_preview?"preview":"founding"===n.audience?"founding":"paid":void 0}))}function j(e){var{post:t,bylines:n,consumptionTime:a,Icon:s,audienceBadge:d,showBestsellerBadge:c,highlights:u,excerpt:p,noNewTab:h,pub:m,showLoginPrompt:g,searchTrackingParams:v}=e,f=(0,r._)(e,["post","bylines","consumptionTime","Icon","audienceBadge","showBestsellerBadge","highlights","excerpt","noNewTab","pub","showLoginPrompt","searchTrackingParams"]);return(0,o.FD)(X,(0,l._)((0,i._)({},f),{highlights:u,noNewTab:h,pub:m,children:[g&&(0,o.Y)(I.H,{version:"login"}),(0,o.Y)(en,{post:t,pub:m,bylines:n,consumptionTime:a,Icon:s,audienceBadge:d,showBestsellerBadge:c,highlights:u,excerpt:p,searchTrackingParams:v})]}))}function X(e){let{children:t,pub:n,publisherName:i,logoUrl:l,timestamp:r,isViewed:a,isArchived:d,isSelected:c,isLiked:u,isSaved:p,onLike:h,onClick:g,canonicalUrl:v,postId:f,defaultSaved:Y,onSave:b,onArchive:_,onMouseEnter:y,onVisible:w,utmSource:I,highlights:C,noNewTab:F}=e,x=(0,k.Jd)(),[P,A]=(0,O.kw)(!a),E=(0,D.rr)(),N=(0,m.useRef)();return(0,S.S8)(N,()=>w&&w(),{threshold:.2}),(0,o.FD)(Z,{ref:N,href:v,onClick:e=>{A(),g&&g(e)},className:"reader2-post-container",utmSource:I,isSelected:c,onMouseMove:()=>{null==y||y(f)},noNewTab:F,children:[(0,o.Y)(Q,{pub:n,publisherName:i,logoUrl:l,highlights:C,children:(0,o.FD)(T.fI,{gap:12,alignItems:"center",className:s()("reader2-post-info",x&&"hasUser"),children:[(0,o.Y)($,{className:"inbox-item-timestamp",value:r}),(0,o.Y)(J,{isMobile:E,postId:f,defaultSaved:Y,isSaved:p,isArchived:d,onSave:b,user:x,onArchive:_,isLiked:u,onLike:h,canonicalUrl:v,communityEnabled:null==n?void 0:n.community_enabled}),P]})}),t]})}function J(e){let{isMobile:t,postId:n,defaultSaved:i,isLiked:l,onLike:r,isSaved:a,onSave:d,user:c,isArchived:u,onArchive:p,canonicalUrl:h,communityEnabled:m}=e,{iString:g}=(0,w.GO)(),{isSaved:v,onSave:f}=(0,y.ln)({postId:n,defaultSaved:i}),Y=()=>{null==p||p()},b=(0,C.c)();return t?null:(0,o.FD)(T.pT,{padding:4,gap:4,position:"absolute",className:s()("inbox-item-actions-menu",K.A.actionMenu),onClick:e=>{e.stopPropagation(),e.preventDefault()},radius:"md",border:"detail",bg:"primary",children:[r&&m&&(0,o.Y)(P.$n,{size:"sm",priority:"tertiary","aria-label":g("Like"),title:g("Like"),onClick:()=>r(n),children:(0,o.Y)(ea,{isActive:l})}),(0,o.Y)(P.$n,{size:"sm",priority:"tertiary","aria-label":g("Copy link"),title:g("Copy link"),onClick:()=>b(h),children:(0,o.Y)(eu,{})}),c&&(0,o.Y)(P.$n,{size:"sm",priority:"tertiary","aria-label":g(v?"Unsave":"Save"),title:g(v?"Unsave":"Save"),onClick:()=>{d?d(n,!v):f()},children:(0,o.Y)(es,{isActive:null!=a?a:v})}),p&&(u?(0,o.Y)(P.$n,{size:"sm",priority:"tertiary","aria-label":g("Unarchive"),title:g("Unarchive"),onClick:Y,children:(0,o.Y)(ec,{})}):(0,o.Y)(P.$n,{size:"sm",priority:"tertiary","aria-label":g("Archive"),title:g("Archive"),onClick:Y,children:(0,o.Y)(ed,{})}))]})}let Z=(0,m.forwardRef)((e,t)=>{var{noNewTab:n}=e,l=(0,r._)(e,["noNewTab"]);return(0,o.Y)(M.h1,(0,i._)({ref:t,linkClassName:s()("reader2-inbox-post",null==l.isSelected&&"hover-action-menu",K.A.inboxItem),"data-native":!0,isPadded:!1,newTab:!n},l))});function Q(e){let{pub:t,logoUrl:n,publisherName:i,children:l,highlights:r={}}=e;return(0,o.FD)("div",{className:"reader2-post-head reader2-text-meta",children:[(t||n)&&(0,o.Y)(E.Nq,{pub:t,logoUrl:n,publicationName:i,size:20,radius:"xs"}),(0,o.Y)("div",{className:"pub-name",children:i||t&&(0,o.Y)(f.m,{pubId:t.id,trigger:(0,o.Y)(M.IE,{href:t.base_url,onClick:e=>e.stopPropagation(),children:(0,R.S)(t.name,r["publication.name"])})})}),l]})}function $(e){let{value:t,className:n}=e;return(0,o.Y)(N.EY.Meta,{className:n,nowrap:!0,children:(0,D.Wy)(t)})}let ee=(e,t)=>({entity_key:(0,W.pi1)(e.id),type:"post",context:{type:"post",timestamp:new Date().toISOString(),fallbackReason:"//TODO: create fallback reasons",fallbackUrl:null,users:e.publishedBylines.map(e=>({id:e.id,name:e.name}))},publication:t,post:"section_id"in e?e:(0,l._)((0,i._)({},e),{section_id:null,updated_at:e.post_date,audience:"everyone",should_send_free_preview:!1,write_comment_permissions:"everyone",show_guest_bios:!1,is_section_pinned:!1,podcast_url:null,meter_type:"none",reactions:{"❤":0},reaction_count:0,top_exclusions:[],pins:[],section_pins:[],share_url_override:void 0,reactor_names:[],email_sent_at:void 0,reaction:!1}),mediaClip:null,canReply:!1,isMuted:!1,trackingParameters:{}});function et(e){let{post:t,pub:n,image:i,metaText:l,highlights:r={},excerpt:a,searchTrackingParams:s}=e,d=(0,m.useRef)(null);return(0,S.S8)(d,()=>{(e=>{let{post:t,pub:n,searchTrackingParams:i}=e;i&&(0,B.Q$)(ee(t,n),"search",{tabId:"post-search",extraEventProps:i})})({post:t,pub:n,searchTrackingParams:s})}),(0,o.FD)("div",{ref:d,className:"reader2-post-body",onClick:()=>(e=>{let{post:t,pub:n,searchTrackingParams:i}=e;i&&(0,B.Qb)(ee(t,n),"search","attachment",{tabId:"post-search",extraEventProps:i})})({post:t,pub:n,searchTrackingParams:s}),children:[(0,o.FD)(M.I1,{minWidth:0,gap:8,children:[(0,o.Y)("div",{className:"reader2-post-title reader2-clamp-lines",children:(0,R.S)(t.title,r.title||r["posts.title"],"heavy")}),t.description&&(0,o.Y)(M.fz,{variant:"secondary",isConstrained:!a,children:a?(0,o.FD)(N.EY,{as:"span",fontStyle:"italic",children:["“...",(0,R.S)(a,r.body_text,"heavy"),"”"]}):(0,R.S)((0,q.A)(t.description),r.subtitle||r["posts.subtitle"],"heavy")}),l]}),i]})}function en(e){let{bylines:t,consumptionTime:n,Icon:i,audienceBadge:l,showBestsellerBadge:r,post:a,pub:s,highlights:d,excerpt:c,searchTrackingParams:u}=e;return(0,o.Y)(et,{post:a,pub:s,searchTrackingParams:u,metaText:(0,o.Y)(ei,{bylines:t,consumptionTime:n,Icon:i,audienceBadge:l,showBestsellerBadge:r,highlights:d}),image:a.cover_image&&(0,o.Y)(eo,{post:a}),highlights:d,excerpt:c})}function ei(e){let{bylines:t,consumptionTime:n,Icon:i,audienceBadge:l,showBestsellerBadge:r,highlights:a={}}=e;return(0,o.FD)(M.bi,{children:[l&&(0,o.FD)(o.FK,{children:[(0,o.Y)("span",{className:"meta-audience-badge",children:l}),(0,o.Y)(er,{})]}),t.length>0?(0,o.FD)(o.FK,{children:[(0,o.Y)(v.K,{array:t,limit:3,formatter:e=>r?(0,o.Y)(el,{name:e.name||"",tier:e.bestseller_tier,userId:e.id}):(0,R.S)(e.name||"",a["publication.author_name"])}),n&&(0,o.Y)(er,{})]}):null,i&&(0,o.FD)(o.FK,{children:[(0,o.Y)(i,{className:"meta-icon"})," "]}),n]})}let el=e=>{let{name:t,tier:n,userId:i}=e;return n?(0,o.FD)(M.Ye,{inline:!0,gap:4,alignItems:"center",children:[t," ",(0,o.Y)(H.UserStatusSymbols,{userId:i,tier:n,size:"sm"})]}):(0,o.Y)(o.FK,{children:t})},er=()=>(0,o.Y)("span",{className:"meta-bullet",children:"∙"});function eo(e){let{post:t}=e,n=t.cover_image,i=(0,F.Zq)(t),[l,r]=(0,m.useState)(!1);return l||!n?null:(0,o.FD)(x.az,{position:"relative",children:[(0,o.Y)(g.c,{src:n,width:160,aspectRatio:"thumb",loading:"lazy",radius:"sm",outline:"detail",bg:"primary-hover",style:{objectFit:"cover"},onError:()=>r(!0),options:{smartCrop:!0}}),("podcast"===i||"video"===i)&&(0,o.Y)(b.o,{className:K.A.playIcon})]})}function ea(e){let{isActive:t}=e;return(0,o.Y)(d.A,{className:t?K.A.activeLike:"",size:20})}function es(e){let{isActive:t}=e;return(0,o.Y)(c.A,{className:t?K.A.activeSave:"",size:20})}function ed(){return(0,o.Y)(u.A,{size:20})}function ec(){return(0,o.Y)(p.A,{size:20})}function eu(){return(0,o.Y)(h.A,{size:20})}function ep(){return(0,o.Y)(o.FK,{children:Array(6).fill(0).map((e,t)=>(0,o.Y)(eh,{},t))})}function eh(){let e=(0,z.Iu)();return(0,o.Y)(M.h1,{isPadded:!1,children:(0,o.FD)(M.I1,{flex:"grow",gap:12,padding:e?8:12,children:[(0,o.FD)(T.fI,{gap:12,justifyContent:"space-between",alignItems:"center",children:[(0,o.FD)(T.fI,{gap:12,alignItems:"center",flex:"grow",children:[(0,o.Y)(A.O,{width:24,height:24,radius:"sm"}),(0,o.Y)(A.O,{maxWidth:120,flex:"grow"})]}),(0,o.Y)(A.O,{maxWidth:80,flex:"grow"})]}),(0,o.FD)("div",{className:"reader2-post-body",children:[(0,o.FD)(M.I1,{minWidth:0,gap:4,children:[(0,o.Y)(A.O,{width:"70%"}),(0,o.Y)(A.O,{width:"80%"}),(0,o.Y)(A.O,{width:"50%"})]}),(0,o.Y)(A.O,{width:e?64:160,height:e?64:"auto",aspectRatio:e?"square":"thumb"})]})]})})}},43296:function(e,t,n){n.d(t,{$P:()=>m,F$:()=>p,XW:()=>h});var i=n(99851),l=n(69277),r=n(70408),o=n(4006),a=n(17402),s=n(94729),d=n(35666);class c{async connect(){try{if(!this.host)throw Error("Attempted to connect without a token");this.ws=new WebSocket(this.host),this.ws.addEventListener("open",()=>{for(let[e,t]of this.channels)t.size>0&&this.send({action:"subscribe",channel:e})}),this.ws.addEventListener("error",e=>{console.error(e),"closed"!==this.connectivityState&&(this.error=Error("Generic error"),this.handleError())}),this.ws.addEventListener("close",e=>{"closed"!==this.connectivityState&&(this.error={code:e.code,reason:e.reason,wasClean:e.wasClean},this.handleError())}),this.ws.addEventListener("message",e=>{"open"!==this.connectivityState&&(this.connectivityState="open",clearTimeout(this.timeoutId),this.reconnectInterval=900,this.notifyConnectivityChange());let t=JSON.parse(e.data),n=(0,r._)((0,l._)({},t),{data:t.data?(0,r._)((0,l._)({},t.data),{message:"string"==typeof t.data.message?JSON.parse(t.data.message):null}):null});if(n.data){var i;for(let e of null!=(i=this.channels.get(n.data.channel))?i:[])e(n)}}),clearTimeout(this.timeoutId);let e=this.ws;this.timeoutId=setTimeout(()=>{"connecting"===this.connectivityState&&(this.error=Error("Timeout"),e.close(),this.handleError())},3e4)}catch(e){this.error=e instanceof Error?e:Error(String(e)),this.handleError()}}async refreshToken(){let e;this.channels.size>0&&(e=Array.from(this.channels.keys()).join(","));let t=await (0,s.x6)("/api/v1/realtime/token",{query:{channels:e}});return this.token=t.token,this.expiry=t.expiry,this.host=t.endpoint,this.ws||this.connect(),t}send(e){let{ws:t}=this;if(!t)throw Error("Cannot send without a connection.");t.send(JSON.stringify((0,l._)({token:this.token},e)))}publish(e,t){this.send({action:"publish",channel:e,message:JSON.stringify(t)})}listen(e){let t=[],n=new Set(this.channels.keys());return this.subscriptionQueue=this.subscriptionQueue.then(async()=>{for(let[n,i]of Object.entries(e)){let e=this.channels.get(n);e||(e=new Set,this.channels.set(n,e)),e.add(i),t.push(()=>{var e;let t=this.channels.get(n);null==t||t.delete(i),(null==t?void 0:t.size)===0&&(null==(e=this.ws)?void 0:e.readyState)===WebSocket.OPEN&&(this.send({action:"unsubscribe",channel:n}),this.channels.delete(n))})}let i=(0,d.iv)(new Set(this.channels.keys()),n);if(i.size>0){var l;if(await this.refreshToken(),(null==(l=this.ws)?void 0:l.readyState)===WebSocket.OPEN)for(let e of i)this.send({action:"subscribe",channel:e})}}),()=>{let e=new Set(this.channels.keys());for(let e of t)e();(0,d.iv)(e,new Set(this.channels.keys())).size>0&&this.refreshToken()}}onConnectivityChange(e){return this.connectivityHandlers.add(e),()=>{this.connectivityHandlers.delete(e)}}destroy(){var e;this.channels.clear(),this.connectivityHandlers.clear(),this.connectivityState="closed",null==(e=this.ws)||e.close(),clearTimeout(this.reconnectTimeoutId),clearTimeout(this.timeoutId)}notifyConnectivityChange(){for(let e of this.connectivityHandlers)e(this.connectivityState)}handleError(){console.info("ZyncSocket: Connection closed"),clearTimeout(this.timeoutId),"closed"!==this.connectivityState&&(this.connectivityState="closed",this.notifyConnectivityChange()),0===this.reconnectTimeoutId&&(console.info("ZyncSocket: Attempting to reconnect..."),this.reconnectTimeoutId=setTimeout(()=>{this.reconnectTimeoutId=0,this.reconnectInterval=Math.min(2*this.reconnectInterval,6e4),this.connect()},this.reconnectInterval+.2*this.reconnectInterval))}constructor(){(0,i._)(this,"token",void 0),(0,i._)(this,"expiry",void 0),(0,i._)(this,"host",void 0),(0,i._)(this,"ws",void 0),(0,i._)(this,"connectivityState","closed"),(0,i._)(this,"error",void 0),(0,i._)(this,"reconnectInterval",900),(0,i._)(this,"reconnectTimeoutId",0),(0,i._)(this,"channels",new Map),(0,i._)(this,"connectivityHandlers",new Set),(0,i._)(this,"timeoutId",0),(0,i._)(this,"subscriptionQueue",Promise.resolve())}}let u=(0,a.createContext)(null);function p(e){let{children:t}=e,[n,i]=(0,a.useState)(null);return(0,a.useEffect)(()=>{null==n||n.destroy();let e=new c;return i(e),()=>{e.destroy()}},[]),(0,o.Y)(u.Provider,{value:n,children:t})}function h(){return(0,a.useContext)(u)}function m(){var e;let t=h(),[n,i]=(0,a.useState)(null!=(e=null==t?void 0:t.connectivityState)?e:"closed");return(0,a.useEffect)(()=>null==t?void 0:t.onConnectivityChange(i),[t]),n}},26606:function(e,t,n){n.d(t,{i:()=>l});var i=n(94729);let l=e=>async t=>{let n="before";t({type:"conversation-request_initial",payload:{conversationId:e}});try{let l=await (0,i.x6)("/api/v1/messages/dm/".concat(e));t({type:"conversation-load_more",payload:{edge:n,cursor:null,page:l}})}catch(i){t({type:"conversation-request_error",payload:{conversationId:e,edge:n,cursor:null,error:i}})}}},504:function(e,t,n){n.d(t,{Q$:()=>s,Qb:()=>c,Si:()=>f,aK:()=>Y,fP:()=>u,n5:()=>m,qx:()=>_,rX:()=>v,tR:()=>d});var i=n(69277),l=n(70408),r=n(62193),o=n.n(r);n(27749);var a=n(86500);function s(e,t){var n;let{extraEventProps:i={},tabId:l,primaryItem:r,isLoggedIn:o}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a="trackingParameters"in e&&"item_entity_key"in e.trackingParameters?null==(n=e.trackingParameters)?void 0:n.item_entity_key:null;a&&o&&fetch("/api/v1/reader/feed/".concat(a,"/seen"),{method:"POST"}),g("seen",e,t,{extraEventProps:i,tabId:l,primaryItem:r})}function d(e,t,n){let{extraEventProps:r={},tabId:o,primaryItem:a}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};g("seen_for_duration",e,t,{extraEventProps:(0,l._)((0,i._)({},r),{timeVisible:n}),tabId:o,primaryItem:a})}function c(e,t,n){let{extraEventProps:r={},tabId:o,primaryItem:a}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};g("clicked",e,t,{extraEventProps:(0,l._)((0,i._)({clicked_element:n},r),{tabId:o,primaryItem:a})})}function u(e,t){let{extraEventProps:n={},tabId:r,primaryItem:o}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};g("swiped",e,t,{extraEventProps:(0,l._)((0,i._)({},n),{tabId:r,primaryItem:o})})}function p(e){var t,n,i,l,r,o,a,s,d,c,u,p,h,m,g;let v=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,{primaryItem:f}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return{item_primary_entity_key:f&&"entity_key"in f?f.entity_key:"entity_key"in e?e.entity_key:"",item_entity_key:"entity_key"in e?e.entity_key:"",item_type:e.type,item_content_user_id:"comment"in e?e.comment&&e.comment.user_id?e.comment.user_id:0:"post"in e?null!=(h=null==(n=e.post.publishedBylines)||null==(t=n[0])?void 0:t.id)?h:e.publication.author_id:0,item_content_timestamp:"comment"in e&&(null==(i=e.comment)?void 0:i.date)?new Date(e.comment.date).toISOString():"post"in e&&(null==(l=e.post)?void 0:l.post_date)?new Date(e.post.post_date).toISOString():"community_post"in e&&(null==(r=e.community_post)?void 0:r.created_at)?new Date(e.community_post.created_at).toISOString():null,item_context_type:"context"in e?e.context.type:"",item_context_type_bucket:"context"in e&&null!=(m=e.context.typeBucket)?m:"",item_context_timestamp:new Date("context"in e?e.context.timestamp:new Date).toISOString(),item_context_user_id:"context"in e?null==(o=e.context.users[0])?void 0:o.id:void 0,item_context_user_ids:"context"in e&&(null!=(g=null==(a=e.context.users)?void 0:a.length)?g:0)>0?e.context.users.map(e=>{let{id:t}=e;return t}):[],item_publication_id:"publication"in e?null==(s=e.publication)?void 0:s.id:void 0,item_post_id:null==(d=e.post)?void 0:d.id,item_comment_id:null==(c=e.comment)?void 0:c.id,item_can_reply:!("canReply"in e)||e.canReply,item_source:"frontend",item_model_rank:null,item_model_score:null,tab_id:null!=v?v:void 0,item_module_id:"id"in e&&"string"==typeof e.id?e.id:void 0,followed_user_count:0,subscribed_publication_count:0,is_following:!1,is_explicitly_subscribed:!1,trending_topic_id:"trendingTopic"in e?null==(u=e.trendingTopic)?void 0:u.id:void 0,trending_topic_query:"trendingTopic"in e?null==(p=e.trendingTopic)?void 0:p.query:void 0}}function h(e,t){let{primaryItem:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return"comment"===e.type||"post"===e.type||"chat"===e.type?o()(e.trackingParameters)?p(e,t,{primaryItem:n}):e.trackingParameters:p(e,t,{primaryItem:n})}function m(e){let{primaryItem:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,l._)((0,i._)({},e),{trackingParameters:p(e,null,{primaryItem:t})})}function g(e,t,n){let{extraEventProps:l={},tabId:r,primaryItem:o}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=h(t,null!=r?r:null,{primaryItem:o});(0,a.u4)("seen"===e?a.qY.FEED_ITEM_SEEN:"seen_for_duration"===e?a.qY.FEED_ITEM_SEEN_FOR_DURATION:"swiped"===e?a.qY.FEED_ITEM_SWIPED:a.qY.FEED_ITEM_CLICKED,(0,i._)({surface:n,tabId:r},s,l))}function v(e,t,n){let{extraEventProps:l={},tabId:r,primaryItem:o}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=h(t,null!=r?r:null,{primaryItem:o});(0,a.u4)("seen"===e?a.qY.FEED_MODULE_ITEM_SEEN:a.qY.FEED_MODULE_ITEM_CLICKED,(0,i._)({surface:n,tabId:r},s,l))}function f(e,t){let{extraEventProps:n={}}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};b("seen",e,t,{extraEventProps:n})}function Y(e,t,n){let{extraEventProps:l={}}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};b("clicked",e,t,{extraEventProps:(0,i._)({clicked_element:n},l)})}function b(e,t,n){var l,r,o;let{extraEventProps:s={}}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};(0,a.u4)("seen"===e?a.qY.FEED_USER_SUGGESTION_SEEN:a.qY.FEED_USER_SUGGESTION_CLICKED,(0,i._)({suggested_user_id:t.user.id,suggested_publication_id:null!=(r=null==(l=t.publication)?void 0:l.id)?r:null,suggestion_source:null!=(o=t.source)?o:null,surface:n},t.trackingParameters,s))}function _(e,t){let{tabId:n,noteId:i}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,a.u4)(a.qY.FEED_HIDDEN_ATTACHMENT_SHOWN,{attachmentId:e,reason:t,tabId:n,noteId:i})}n(40659),n(82776)},5180:function(e,t,n){n.d(t,{B9:()=>I,Ro:()=>w,To:()=>b,_0:()=>y,bL:()=>A,et:()=>f,l$:()=>k,tO:()=>_,wA:()=>Y});var i=n(69277),l=n(70408),r=n(83673),o=n.n(r),a=n(2404),s=n.n(a),d=n(17402),c=n(96467),u=n(12501),p=n(68349),h=n(504),m=n(16291),g=n(70189),v=n(49807);let f=(0,d.createContext)({dispatch:()=>Promise.resolve()});function Y(){return(0,d.useContext)(f).dispatch}let b={isSigningIn:!1,signInNoExit:!1,pages:[],readingQueue:[],posts:new Map,mediaClipsAsPosts:new Map,publications:new Map,referringPubByPostId:{},comments:new Map,inboxItems:new Map,hiddenItems:[],publicationSettings:new Map,publicationRecommendations:new Map,feedItemStats:new Map,activeLiveStreams:[],mutedFeedItems:new Set},_=(0,d.createContext)(b);function y(){let{initialData:e={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,c.K)(I,e,e=>{let{feedItem:t,readingQueue:n,initialPost:i}=e,l=b;return t&&(l=D(l,t)),n&&(l=P(l,n)),i&&(l=x(l,{posts:[i.post],publications:o()([i.publication,i.referringPub]),publicationSettings:new Map([[i.publication.id,i.publicationSettings]]),recommendationsByPubId:i.referringRecommendation?new Map([[i.referringRecommendation.recommended_publication_id,i.referringRecommendation]]):void 0})),l})}function w(){return(0,d.useContext)(_)}function k(e){let t=w();return!!e&&"entity_key"in e&&t.hiddenItems.includes(e.entity_key)}function I(e,t){var n,r,o,a,d,c,f,Y,_,y,w;switch(t.type){case"sign_in":return(0,l._)((0,i._)({},e),{lastDispatchType:t.type,isSigningIn:t.payload.isSigningIn,signInNoExit:null!=(n=t.payload.signInNoExit)&&n});case"page_load":{let{result:n}=t.payload;return(0,l._)((0,i._)({},S(e,n.items)),{lastDispatchType:t.type,pages:(0,u.VL)(e.pages,t)})}case"post_load":{let{post:n,publication:i}=t.payload;return x(e,{posts:[n],publications:[i]})}case"post_like":{let{postId:n,mediaClipId:i,isLiked:l}=t.payload,r=i?e.mediaClipsAsPosts.get(i):e.posts.get(n);return F(e,t.type,n,(f=r,{reaction:null!=(Y=l)?Y:!f.reaction,reactions:{"❤":((null==(_=f.reactions)?void 0:_["❤"])||0)+(Y?1:-1)}}),i)}case"post_restack":{let{postId:n,mediaClipId:i,isRestacked:l}=t.payload,r=i?e.mediaClipsAsPosts.get(i):e.posts.get(n);return r?F(e,t.type,n,(y=r,{restacked:w=l,restacks:(y.restacks||0)+(w?1:-1)}),i):e}case"post_delete":{let{publication:n,post:r}=t.payload,o=new Map(e.posts),a=new Map(e.mediaClipsAsPosts);r.media_clip_id&&a.delete(r.media_clip_id),o.delete(r.id);let s=new Map([...e.comments].filter(e=>{let[t,n]=e;return n.post_id!==r.id}));return[(0,v.kGL)(r.id,{noBase:!0}),(0,v.q$n)(n,r,{noBase:!0})].includes(window.location.pathname)&&(0,p.V2)("/",{replace:!0}),(0,l._)((0,i._)({},e),{lastDispatchType:t.type,posts:o,mediaClipsAsPosts:a,comments:s,pages:e.pages.map(e=>(0,l._)((0,i._)({},e),{result:e.result?(0,l._)((0,i._)({},e.result),{items:e.result.items.filter(e=>{var t;return(null==(t=e.post)?void 0:t.id)!==r.id})}):e.result}))})}case"post_save":{let{postId:n,isSaved:i}=t.payload,l=e.posts.get(n),r=null==i?!(null==l?void 0:l.is_saved):i;return l?F(e,t.type,n,{is_saved:r}):e}case"comment_like":{let{commentId:n,isLiked:o}=t.payload,a=e.comments.get(n);if(!a)return e;return(0,l._)((0,i._)({},e),{lastDispatchType:t.type,comments:T(e.comments,n,(0,l._)((0,i._)({},a),{reaction:o?"❤":void 0,reactions:(0,l._)((0,i._)({},a.reactions),{"❤":((null==(r=a.reactions)?void 0:r["❤"])||0)+(o?1:-1)}),reaction_count:(a.reaction_count||0)+(o?1:-1)}))})}case"comment_restack":{let{commentId:n,isRestacked:r}=t.payload,o=e.comments.get(n);return(0,l._)((0,i._)({},e),{lastDispatchType:t.type,comments:o?T(e.comments,n,(0,l._)((0,i._)({},o),{restacked:r,restacks:(o.restacks||0)+(r?1:-1)})):e.comments})}case"comment_delete":{let{comment:n}=t.payload,r=new Map(e.posts),o=new Map(e.mediaClipsAsPosts),a=new Map([...e.comments].filter(e=>{let[t,i]=e;return i.id!==n.id&&!new RegExp("(^|.)".concat(n.id,"(.|$)")).test(i.ancestor_path)})),s=r.get(n.post_id),d=n.media_clip_id?o.get(n.media_clip_id):null,c=n.ancestor_path&&a.get(Number(n.ancestor_path.split(".").pop()));return c?a.set(c.id,(0,l._)((0,i._)({},c),{children_count:(c.children_count||1)-1,children:(c.children||[]).filter(e=>e.id!==n.id)})):(s||d)&&(s&&r.set(s.id,(0,l._)((0,i._)({},s),{child_comment_count:(s.child_comment_count||1)-1})),d&&o.set(n.media_clip_id,(0,l._)((0,i._)({},d),{child_comment_count:(d.child_comment_count||1)-1}))),[(0,v.Zgx)(n,{noBase:!0})].includes(window.location.pathname)&&(0,p.V2)("/",{replace:!0}),(0,l._)((0,i._)({},e),{lastDispatchType:t.type,posts:r,mediaClipsAsPosts:o,comments:a,pages:e.pages.map(e=>(0,l._)((0,i._)({},e),{result:e.result?(0,l._)((0,i._)({},e.result),{items:e.result.items.filter(e=>{var t;return(null==(t=e.comment)?void 0:t.id)!==n.id&&!(e.parentComments||[]).filter(Boolean).map(e=>e.id).includes(n.id)})}):e.result}))})}case"clip_delete":{let{mediaClip:n,author:r}=t.payload;return[(0,g.w1)(n,r,{noBase:!0})].includes(window.location.pathname)&&(0,p.V2)("/",{replace:!0}),(0,l._)((0,i._)({},e),{lastDispatchType:t.type,pages:e.pages.map(e=>(0,l._)((0,i._)({},e),{result:e.result?(0,l._)((0,i._)({},e.result),{items:e.result.items.filter(e=>{var t;return"post"!==e.type||(null==(t=e.mediaClip)?void 0:t.id)!==n.id})}):e.result}))})}case"new_post":return(0,l._)((0,i._)({},e),{lastDispatchType:t.type,publications:new Map([...e.publications].concat([[t.payload.publication.id,t.payload.publication]])),posts:new Map([...e.posts].concat([[t.payload.post.id,t.payload.post]])),pages:[{error:null,isLoading:!1,result:{items:[{type:"post",entity_key:(0,g.pi)(t.payload.post.id),publication:t.payload.publication,post:t.payload.post,context:t.payload.context||{}}]}},...e.pages]});case"new_comment":{let{comment:n,skipFeedInsertion:r}=t.payload,s=new Map(e.posts),d=new Map(e.mediaClipsAsPosts),c=s.get(n.post_id),u=n.media_clip_id?d.get(n.media_clip_id):null;c&&s.set(c.id,(0,l._)((0,i._)({},c),{child_comment_count:(c.child_comment_count||0)+1})),u&&d.set(n.media_clip_id,(0,l._)((0,i._)({},u),{child_comment_count:(u.child_comment_count||0)+1}));let p=new Map(e.comments);p.set(n.id,n);let m=((null==(o=n.ancestor_path)?void 0:o.split("."))||[]).map(Number).filter(Boolean).map(e=>p.get(e)||null),v=null!=(a=m[m.length-1])?a:null;v&&p.set(v.id,(0,l._)((0,i._)({},v),{children_count:(v.children_count||0)+1,children:[n].concat(v.children||[])}));let f=!!n.ancestor_path,Y=e.pages;return f||r||(Y=[{error:null,isLoading:!1,result:{items:[(0,h.n5)({type:"comment",entity_key:(0,g.a5)(n.id),comment:n,parentComments:m,publication:null,post:null,canReply:!0,context:{type:"comment",timestamp:new Date().toISOString(),users:[],fallbackReason:"",fallbackUrl:null}})]}},...e.pages]),(0,l._)((0,i._)({},e),{lastDispatchType:t.type,posts:s,mediaClipsAsPosts:d,comments:p,pages:Y})}case"edit_comment":{let{comment:n}=t.payload,r=new Map(e.comments);return r.set(n.id,n),(0,l._)((0,i._)({},e),{lastDispatchType:t.type,comments:r})}case"comments_load":{let{comments:n}=t.payload,r=[],o=n.slice();for(;o.length>0;){let e=o.pop();r.push(e),o.push(...e.children||[])}return(0,l._)((0,i._)({},e),{lastDispatchType:t.type,comments:new Map([...e.comments].concat(r.map(e=>[e.id,e])))})}case"item_load":{let{item:n}=t.payload;return(0,l._)((0,i._)({},D(e,n)),{lastDispatchType:t.type})}case"items_load":{let{items:n}=t.payload;return(0,l._)((0,i._)({},S(e,n)),{lastDispatchType:t.type})}case"new_feed_items":{let n=[...e.pages];if(t.payload.insertLocation){let e={error:null,isLoading:!1,result:{items:t.payload.feedItems}};"prepend"===t.payload.insertLocation?n.unshift(e):"append"===t.payload.insertLocation&&n.push(e)}return(0,l._)((0,i._)({},S(C(e,10),t.payload.feedItems)),{lastDispatchType:t.type,pages:n})}case"items_cull":{let t=null==(c=e.pages.find(e=>{var t;return null==(t=e.result)?void 0:t.originalCursorTimestamp}))||null==(d=c.result)?void 0:d.originalCursorTimestamp;if(t&&(0,m.A)(t).isBefore((0,m.A)().subtract(10,"minutes")))return b;return C(e,10)}case"inbox_load":return P(e,t.payload);case"active_live_streams_load":if(s()(e.activeLiveStreams,t.payload))return e;return(0,l._)((0,i._)({},e),{activeLiveStreams:t.payload.filter(e=>(0,m.A)(e.liveStream.started_streaming_at).isBefore((0,m.A)().subtract(1,"minute")))});case"inbox_item_archive":{let{contentKey:n,isArchived:r}=t.payload,o=e.inboxItems.get(n);return(0,l._)((0,i._)({},e),{inboxItems:T(e.inboxItems,n,(0,l._)((0,i._)({},o),{archived_at:r?new Date().toISOString():null}))})}case"item_hide":{let{entityKey:n}=t.payload;return(0,l._)((0,i._)({},e),{lastDispatchType:t.type,hiddenItems:[...e.hiddenItems,n]})}case"item_unhide":{let{entityKey:n}=t.payload;return(0,l._)((0,i._)({},e),{lastDispatchType:t.type,hiddenItems:e.hiddenItems.filter(e=>e!==n)})}case"item_dismiss":{let{entityKey:n}=t.payload;return(0,l._)((0,i._)({},e),{lastDispatchType:t.type,pages:e.pages.map(e=>(0,l._)((0,i._)({},e),{result:e.result?(0,l._)((0,i._)({},e.result),{items:e.result.items.filter(e=>"entity_key"in e&&e.entity_key!==n)}):e.result}))})}case"update_paused_notifications":{let n=new Set([...e.mutedFeedItems,...t.payload.map(e=>e.entity_key)]);return(0,l._)((0,i._)({},e),{mutedFeedItems:n})}case"item_pause_notifications":{let{entityKey:n}=t.payload,r=new Set(e.mutedFeedItems);return r.add(n),(0,l._)((0,i._)({},e),{mutedFeedItems:r})}case"item_unpause_notifications":{let{entityKey:n}=t.payload,r=new Set(e.mutedFeedItems);return r.delete(n),(0,l._)((0,i._)({},e),{mutedFeedItems:r})}}return(0,l._)((0,i._)({},e),{lastDispatchType:t.type,pages:(0,u.VL)(e.pages,t)})}function C(e,t){let n,r=0,o=[];for(let i of e.pages){var a;let e=null==(a=i.result)?void 0:a.items;if(!e||i.error||i.isLoading)break;for(let t of(n=i,e))o.push(t),r++;if(r>t)break}if(!(null==n?void 0:n.result))return e;let s=(0,l._)((0,i._)({},n),{result:(0,l._)((0,i._)({},n.result),{items:o})});return(0,l._)((0,i._)({},e),{pages:[s]})}function S(e,t){let n=new Map(e.publications),r=new Map(e.posts),o=new Map(e.mediaClipsAsPosts),a=new Map(e.comments),s=new Set(e.mutedFeedItems);for(let e of t){if("publication"in e&&e.publication&&n.set(e.publication.id,e.publication),"post"in e){let{post:t,mediaClip:n}=e;n?o.set(n.id,t):t&&r.set(t.id,t),e.isMuted&&s.add(e.entity_key)}if("comment"in e){let{comment:t}=e;if(t&&(a.set(t.id,t),t.attachments)){for(let e of t.attachments)if("post"===e.type){var d;(null==(d=e.mediaClip)?void 0:d.id)?o.set(e.mediaClip.id,e.post):r.set(e.post.id,e.post),n.set(e.publication.id,e.publication)}}e.isMuted&&s.add(e.entity_key)}if("parentComments"in e)for(let t of e.parentComments)t&&a.set(t.id,t)}return(0,l._)((0,i._)({},e),{publications:n,posts:r,mediaClipsAsPosts:o,comments:a,mutedFeedItems:s})}function D(e,t){var n;return(0,l._)((0,i._)({},e),{posts:t.post&&!t.mediaClip?T(e.posts,t.post.id,t.post):e.posts,mediaClipsAsPosts:t.post&&t.mediaClip?T(e.mediaClipsAsPosts,t.mediaClip.id,t.post):e.mediaClipsAsPosts,publications:t.publication?T(e.publications,t.publication.id,t.publication):e.publications,comments:new Map([...e.comments].concat([t.comment,...null!=(n=t.parentComments)?n:[]].filter(Boolean).map(e=>[e.id,e]))),feedItemStats:t.feedItemStats&&t.feedItemStats.entity_key?T(e.feedItemStats,t.feedItemStats.entity_key,t.feedItemStats):e.feedItemStats,mutedFeedItems:new Set(t.entity_key&&t.isMuted?[t.entity_key]:void 0)})}function F(e,t,n,r,o){let a=new Map(e.posts),s=new Map(e.mediaClipsAsPosts),d=o?s.get(o):a.get(n);return d&&(o?s.set(o,(0,i._)({},d,r)):a.set(d.id,(0,i._)({},d,r))),(0,l._)((0,i._)({},e),{lastDispatchType:t,posts:a,mediaClipsAsPosts:s})}function x(e,t){let{posts:n,publications:r,publicationSettings:o,recommendationsByPubId:a}=t,s=new Map(e.posts);for(let e of n)s.set(e.id,(0,i._)({},s.get(e.id),e));let d=new Map(e.publications);for(let e of r)d.set(e.id,(0,i._)({},d.get(e.id),e));let c=new Map([...e.publicationSettings.entries(),...o?o.entries():[]]),u=new Map([...e.publicationRecommendations.entries(),...a?a.entries():[]]);return(0,l._)((0,i._)({},e),{posts:s,publications:d,publicationSettings:c,publicationRecommendations:u})}function P(e,t){return(0,l._)((0,i._)({},x(e,t)),{readingQueue:t.inboxItems.map(e=>e.content_key),inboxItems:new Map([...e.inboxItems].concat(t.inboxItems.map(e=>[e.content_key,e]))),referringPubByPostId:(0,i._)({},e.referringPubByPostId,t.referringPubByPostId)})}function T(e,t,n){let i=new Map(e);return i.set(t,n),i}function A(e,t){var n;return(n=e,[t].map(e=>{var t,l,r,o;let a=(0,i._)({},e);return"publication"in a&&a.publication&&(a.publication=null!=(t=n.publications.get(a.publication.id))?t:a.publication),"post"in a&&a.post&&(a.post=null!=(l="mediaClip"in a&&a.mediaClip&&n.mediaClipsAsPosts.get(a.mediaClip.id)||n.posts.get(a.post.id))?l:a.post),"mediaClip"in a&&a.mediaClip&&(a.mediaClip=null!=(r=n.mediaClipsAsPosts.get(a.mediaClip.id))?r:a.mediaClip),"comment"in a&&a.comment&&(a.comment=null!=(o=n.comments.get(a.comment.id))?o:a.comment),"parentComments"in a&&a.parentComments&&(a.parentComments=a.parentComments.map(e=>e&&n.comments.get(e.id)||null)),a}))[0]}},9761:function(e,t,n){n.d(t,{QH:()=>C});var i=n(69277),l=n(70408),r=n(4006),o=n(17402),a=n(45773),s=n(80697),d=n(46271),c=n(82772),u=n(24078),p=n(35369),h=n(76977);n(22602);var m=n(45974),g=n(63136),v=n(2548),f=n(85050),Y=n(32848),b=n(49095),_=n(73030),y=n(96301),w=n(39318),k=n(49807),I=n(57324);function C(e){let{items:t,surface:n,page_num:a=0,focusedPubId:s,onClickItem:d,onItemFirstVisible:c}=e,u=(0,Y.n7)(),p=a*_.Ew,h=new Map(t.map(e=>{var t,n;let{publication:i}=e;return[i.id,null==(n=u.result)||null==(t=n.subscriptions)?void 0:t.some(e=>e.publication_id===i.id&&e.membership_state&&(0,y.KB)(e.membership_state))]}));return(0,r.Y)(v.I1,{gap:8,children:t.map((e,t)=>{var r;return(0,o.createElement)(S,(0,l._)((0,i._)({},e),{key:e.publication.id,isSubscribed:null!=(r=h.get(e.publication.id))&&r,rank:t+p+1,surface:n,isFocused:s===e.publication.id,onClick:d,onFirstVisible:c}))})})}function S(e){let{user:t,publication:n,rank:i,isSubscribed:l,surface:a,isFocused:s,onClick:p,onFirstVisible:f,trackingParameters:Y}=e,_=(0,d.Jd)(),y=(0,o.useRef)(null),I=!!_&&_.id===(null==t?void 0:t.id);return(0,c.S8)(y,()=>{null==f||f({publication:n,rank:i,trackingParameters:Y})}),(0,r.Y)(v.Qe,{id:n.id.toString(),bg:I||s?"accent-orange":void 0,href:t?(0,k.gYq)(t):(0,w.$_T)(n),onClick:()=>p({publication:n,rank:i,trackingParameters:Y}),children:(0,r.FD)(h.pT,{justifyContent:"space-between",flex:"grow",alignItems:"center",paddingX:12,ref:y,children:[(0,r.FD)(h.pT,{gap:16,alignItems:"center",children:[(0,r.Y)(g.EY.Digit,{minWidth:16,children:i}),t&&(0,r.FD)(r.FK,{children:[(0,r.Y)(u.eu,{user:t,size:40}),(0,r.FD)(v.I1,{children:[(0,r.FD)(h.pT,{alignItems:"center",gap:4,children:[(0,r.Y)(g.EY.B3,{weight:"semibold",children:t.name}),(0,r.Y)(b.UserStatusSymbols,{tier:t.bestseller_tier,status:t.status,userId:t.id,size:"sm"})]}),(0,r.Y)(g.EY.B4,{color:"secondary",children:n.name})]})]}),!t&&(0,r.FD)(r.FK,{children:[(0,r.Y)(m.Nq,{radius:"full",pub:n,size:32}),(0,r.Y)(v.I1,{children:(0,r.Y)(g.EY.B3,{weight:"bold",children:n.name})})]})]}),!I&&(0,r.Y)(D,{pub:n,user:t,surface:a,isSubscribed:l,currentUser:_})]})})}function D(e){let{pub:t,user:n,surface:i,isSubscribed:l,currentUser:o}=e,d=(0,Y.n7)(),c=(0,f.s)({surface:i})(t);return l?(0,r.Y)(h.pT,{alignItems:"center",justifyContent:"center",padding:8,children:(0,r.Y)(a.A,{size:16,stroke:"var(--color-fg-tertiary)"})}):(0,r.Y)(p.K0,{priority:"secondary",size:"sm",newTab:!0,href:(0,w.eV6)(t,{addBase:!0,user:o,utm_source:I.VU.substack,utm_medium:I.Jn.web,utm_campaign:I._9.reader2}),onClick:e=>{if(e.stopPropagation(),n){let e="visibilitychange",n=()=>{"visible"===document.visibilityState&&(document.removeEventListener(e,n),d.refetchPublication(t.id))};document.addEventListener(e,n)}c(e)},children:(0,r.Y)(s.A,{size:20})})}},63840:function(e,t,n){n.d(t,{a:()=>P});var i=n(79785),l=n(4006),r=n(36049),o=n.n(r),a=n(45773),s=n(1839),d=n(40972),c=n(17402),u=n(84605),p=n(55561),h=n(86500),m=n(94729),g=n(35369),v=n(76977),f=n(16993),Y=n(45974),b=n(63136),_=n(65842),y=n(36372),w=n(49807),k=n(57324),I=n(96583);function C(){let e=(0,i._)([""," added"]);return C=function(){return e},e}function S(){let e=(0,i._)([""," removed"]);return S=function(){return e},e}function D(){let e=(0,i._)([""," updated"]);return D=function(){return e},e}function F(){let e=(0,i._)([""," created"]);return F=function(){return e},e}function x(){let e=(0,i._)(["Manage Substacks (",")"]);return x=function(){return e},e}let P=e=>{let{reads:t,open:n,close:i}=e;return(0,l.Y)(T,{reads:t,open:n,close:i})},T=e=>{var t,n,i;let{list:r,reads:o,open:d,close:p}=e,{popToast:Y}=(0,y.d)(),{iTemplate:w,iString:k}=(0,u.GO)(),[x,P]=(0,c.useState)(null!=(t=null==r?void 0:r.name)?t:"My list"),[T]=(0,c.useState)(null!=(n=null==r?void 0:r.slug)?n:""),[E,B]=(0,c.useState)(null!=(i=null==r?void 0:r.publications)?i:[]),[M,R]=(0,c.useState)(!1),O=E?null==o?void 0:o.filter(e=>!(null==E?void 0:E.map(e=>e.id).includes(e.id))):o;(0,c.useEffect)(()=>{(0,h.u4)(h.qY.LIST_MANAGEMENT_MODAL_SEEN,{editing:!!r})},[]);let L=()=>{var e,t;P(null!=(e=null==r?void 0:r.name)?e:"My list"),B(null!=(t=null==r?void 0:r.publications)?t:[]),R(!1)},z=e=>{B(null==E?void 0:E.filter(t=>t.id!==e.id)),R(!0),(0,h.u4)(h.qY.LIST_MANAGEMENT_MODAL_PUBLICATION_REMOVED,{pub_id:e.id}),Y(()=>(0,l.Y)(y.y,{Icon:s.A,text:w(S(),e.name)}))},U=async()=>{let e,t,n={name:x,slug:T.length>0?T:void 0,publications:null==E?void 0:E.map(e=>e.id)};try{var i;r?(e=w(D(),x),t=await (0,m.x6)("/api/v1/list/".concat(r.id),{method:"PUT",json:n})):(e=w(F(),x),t=await (0,m.x6)("/api/v1/list",{method:"POST",json:n})),(0,h.u4)(h.qY.LIST_MANAGEMENT_MODAL_SUBMITTED,{data:n,editing:!!r}),Y(()=>(0,l.Y)(y.y,{Icon:a.A,text:e})),L(),p(null!=(i=null==t?void 0:t.list)?i:{})}catch(e){Y(()=>(0,l.Y)(y.y,{text:k("Something went wrong. Please try again")}))}},H=()=>{(0,h.u4)(h.qY.LIST_MANAGEMENT_MODAL_CLOSED,{editing:!!r}),L(),p()};return(0,l.FD)(f.aF,{isOpen:d,onClose:H,className:I.A.modalContainer,children:[(0,l.Y)(f.rQ,{onClose:H,title:r?k("Edit list"):k("Create new list")}),(0,l.Y)(f.cw,{children:(0,l.FD)(v.I1,{gap:48,alignItems:"stretch",justifyContent:"start",children:[(0,l.FD)(v.I1,{flex:"grow",gap:8,children:[(0,l.Y)(b.EY.B3,{translated:!0,weight:"semibold",children:"List Name"}),(0,l.Y)(_.ks,{placeholder:k("My List"),value:x,onChange:e=>{P(e.currentTarget.value),M||R(!0)}})]}),(0,l.Y)(A,{currentPublicationIds:null==E?void 0:E.map(e=>e.id),existingSubscriptions:null==o?void 0:o.map(e=>e.id),possibleSuggestions:O,onAdd:e=>{B([...E,e]),R(!0),(0,h.u4)(h.qY.LIST_MANAGEMENT_MODAL_PUBLICATION_ADDED,{pub_id:e.id}),Y(()=>(0,l.Y)(y.y,{Icon:a.A,text:w(C(),e.name)}))},onRemove:z}),E.length>0&&(0,l.Y)(N,{pubs:E,removePub:z})]})}),(0,l.Y)(f.jl,{primaryButton:(0,l.Y)(g.$n,{priority:"primary",disabled:!(M&&x&&E.length>=1),onClick:U,children:(0,l.Y)(b.EY.B3,{color:"primary",children:r?k("Update"):k("Create")})}),secondaryButton:(0,l.Y)(g.$n,{priority:"secondary",onClick:H,children:(0,l.Y)(b.EY.B3,{translated:!0,children:"Cancel"})}),showDivider:!0})]})},A=e=>{let t,{currentPublicationIds:n,existingSubscriptions:i,possibleSuggestions:r,onAdd:a,onRemove:s}=e,{iString:m}=(0,u.GO)(),[g,f]=(0,c.useState)(""),[Y,y]=(0,c.useState)(),{language:w}=(0,u.GO)(),{allResults:k,onSearch:C,isLoading:S}=(0,p.z)({defaultQuery:g,language:w}),D=new Set(i);(0,c.useEffect)(()=>{g&&(C(g),(0,h.u4)(h.qY.LIST_MANAGEMENT_MODAL_PUBLICATION_SEARCHED,{query:g}))},[g]),(0,c.useEffect)(()=>{r&&y(o()(r).slice(0,3))},[n,r]);let F=k.results;return t=""===g?[]:F.sort((e,t)=>!D.has(e.id)-!D.has(t.id)||F.indexOf(e)-F.indexOf(t)),(0,l.FD)(v.I1,{justifyContent:"start",gap:20,flex:"grow",children:[(0,l.Y)(b.EY.B3,{translated:!0,align:"left",className:I.A.fullWidth,weight:"semibold",children:"Add Substacks"}),(0,l.FD)(v.Ye,{justifyContent:"space-between",alignItems:"center",children:[(0,l.Y)(_.ks,{placeholder:"Search for Substacks",value:g,onChange:e=>f(e.currentTarget.value)}),!!t.length&&(0,l.Y)("div",{onClick:()=>f(""),children:(0,l.Y)(d.A,{width:30,style:{cursor:"pointer"}})})]}),(0,l.Y)(l.FK,{children:t.length?(0,l.Y)(v.I1,{flex:"grow",gap:20,justifyContent:"start",paddingTop:4,children:t.map(e=>{let t=null==n?void 0:n.includes(e.id);return(0,l.Y)(B,{pub:e,buttonText:t?m("Remove"):m("Add"),onClick:t?()=>s(e):()=>a(e)},e.id)})}):g&&S?(0,l.Y)(b.EY.Meta,{translated:!0,children:"Searching..."}):g&&0===t.length?(0,l.Y)(b.EY.Meta,{translated:!0,children:"No publications found"}):(0,l.Y)(E,{pubs:Y,onAdd:a,onRemove:s})})]})},E=e=>{let{pubs:t,currentPubs:n,onAdd:i,onRemove:r}=e,{iString:o}=(0,u.GO)();return(null==t?void 0:t.length)?(0,l.FD)(v.I1,{justifyContent:"start",gap:12,children:[(0,l.Y)(b.EY.Meta,{translated:!0,children:"Suggestions"}),t.map(e=>{let t=null==n?void 0:n.includes(e.id);return(0,l.Y)(B,{pub:e,buttonText:t?o("Remove"):o("Add"),onClick:()=>{t?r(e):((0,h.u4)(h.qY.LIST_MANAGEMENT_MODAL_PUBLICATION_SUGGESTION_ADDED,{pub_id:e.id}),i(e))}},e.id)})]}):(0,l.Y)(b.EY.Meta,{translated:!0,children:"Search publications to get started"})},N=e=>{let{pubs:t,removePub:n}=e,{iTemplate:i}=(0,u.GO)();return(0,l.FD)(v.I1,{justifyContent:"start",gap:20,flex:"grow",children:[(0,l.Y)(b.EY.B3,{align:"left",weight:"semibold",children:i(x(),t.length)}),(0,l.Y)(v.I1,{justifyContent:"start",gap:16,flex:"grow",children:t.map(e=>(0,l.Y)(B,{pub:e,buttonText:"Remove",onClick:()=>n(e)},e.id))})]})},B=e=>{let{pub:t,buttonText:n,onClick:i,disable:r}=e;return(0,l.Y)("a",{href:(0,w.yRP)((0,w.$_T)(t),{utm_source:k.VU.listManagementModal}),target:"_blank",rel:"noopener",children:(0,l.FD)(v.Ye,{alignItems:"center",justifyContent:"space-between",gap:12,flex:"grow",children:[(0,l.Y)(Y.Nq,{pub:t,size:40}),(0,l.FD)(v.I1,{minWidth:0,flex:"grow",children:[(0,l.Y)(b.EY.B4,{weight:"semibold",ellipsis:!0,children:t.name}),(0,l.Y)(b.EY.B4,{color:"secondary",ellipsis:!0,children:t.author_name})]}),(0,l.Y)(g.$n,{onClick:e=>{e.preventDefault(),i()},priority:"secondary",disabled:r,children:n})]})})}},28916:function(e,t,n){n.d(t,{I:()=>C,w:()=>S});var i=n(69277),l=n(4006),r=n(15977),o=n(50180),a=n(17402),s=n(34957),d=n(84605),c=n(46271),u=n(12501),p=n(68349),h=n(35369),m=n(76977),g=n(45859),v=n(16993),f=n(63136),Y=n(36372),b=n(5180),_=n(2481),y=n(90554),w=n(70189),k=n(18947),I=n(49807);function C(e){var t,n;let{pub:h,post:m,comment:v,feedItem:f,onRestack:C,tabId:D,surface:F,renderWithoutUser:x=!1}=e,P=(0,c.Jd)(),T=(0,Y.d)(),A=(!!P||x)&&!(null==h?void 0:h.hide_post_restacks)&&!(null==h?void 0:h.invite_only),E=!!(null==(t=v||m)?void 0:t.restacked),N=(null==(n=v||m)?void 0:n.restacks)||0,B=(0,b.wA)(),M=(0,_.NP)(),[R,O]=(0,a.useState)(!1),L=(0,u.st)({pathname:"/api/v1/restack/feed"}),{iString:z}=(0,d.GO)(),{nuxModal:U,showRestackNux:H}=S(v&&!v.post_id?"note":v?"comment":"post"),q=async()=>{var e,t;if(!P)return void O(!0);null==C||C(!0);let n=await L.refetch({method:"POST",json:{postId:v?null:null==m?void 0:m.id,commentId:(null==v?void 0:v.id)||null,mediaClipId:(null==f?void 0:f.type)==="post"?null==(e=f.mediaClip)?void 0:e.id:void 0,tabId:D,surface:F}});if(n instanceof Error){null==C||C(!1),alert((0,p.uX)(n));return}if(T.popToast(()=>(0,l.Y)(Y.y,{text:n.comment?z("Note restacked"):z("Post restacked"),Icon:r.A,cta:z("View now"),href:(0,w.oT)()})),n.comment)B({type:"comment_restack",payload:{commentId:n.comment.id,isRestacked:!0}});else{B({type:"post_restack",payload:{postId:n.post.id,isRestacked:!0}});let e=(null==f?void 0:f.type)==="post"?null==(t=f.mediaClip)?void 0:t.id:void 0;e&&B({type:"post_restack",payload:{postId:n.post.id,mediaClipId:e,isRestacked:!0}})}H()},G=async()=>{var e,t;null==C||C(!1);let n=await L.refetch({method:"DELETE",json:{postId:v?null:null==m?void 0:m.id,commentId:(null==v?void 0:v.id)||null,mediaClipId:(null==f?void 0:f.type)==="post"?null==(e=f.mediaClip)?void 0:e.id:void 0,tabId:D}});if(n instanceof Error){null==C||C(!0),alert((0,p.uX)(n));return}if(T.popToast(()=>(0,l.Y)(Y.y,{text:z("Restack undone"),Icon:o.A})),v)B({type:"comment_restack",payload:{commentId:v.id,isRestacked:!1}});else if(m){B({type:"post_restack",payload:{postId:m.id,isRestacked:!1}});let e=(null==f?void 0:f.type)==="post"?null==(t=f.mediaClip)?void 0:t.id:void 0;e&&B({type:"post_restack",payload:{postId:m.id,mediaClipId:e,isRestacked:!1}})}},W=async()=>{if(!P)return void O(!0);try{var e;await M.open((0,i._)({feedItem:f,restackUrl:v?(0,k.XB)(m,v,h):(0,I.wu9)(h,m),tabId:D,surface:F},(null==f?void 0:f.type)==="post"&&{mediaClipId:null==(e=f.mediaClip)?void 0:e.id})),H()}catch(e){}};return(0,y.y)({name:"restack-comment",action:()=>{A&&W()}}),{canRestack:A,isRestacked:E,restacks:N,nuxModal:U,loggedOutRestackAttempt:R,menuItems:[E?(0,l.Y)(g.Dr,{leading:(0,l.Y)(o.A,{}),onClick:G,children:z("Undo restack")}):(0,l.Y)(g.Dr,{leading:(0,l.Y)(r.A,{}),onClick:q,children:z("Restack")}),(0,l.Y)(g.Dr,{leading:(0,l.Y)(s.A,{}),onClick:W,children:z("Restack with a note")})]}}function S(e){let t=function(e){let{entityType:t}=e,[n,i]=(0,a.useState)(!1),r=()=>{i(!1)};return{open:()=>{i(!0)},element:(0,l.Y)(v.aF,{isOpen:n,onClose:r,children:(0,l.Y)(D,{onClose:r,entityType:t})})}}({entityType:e}),n=(0,u.st)({pathname:"/api/v1/feed/has-restacked",auto:!1,cacheTtl:1/0}),i=async()=>{var e;let i=null!=(e=n.result)?e:await n.refetch();i instanceof Error||(null==i?void 0:i.hasRestacked)!==!1||(t.open(),n.setResult({hasRestacked:!0}))};return{nuxModal:t.element,showRestackNux:i}}function D(e){let{onClose:t,entityType:n}=e,{iString:i}=(0,d.GO)();return(0,l.FD)(m.I1,{paddingX:16,children:[(0,l.Y)(m.pT,{justifyContent:"center",paddingTop:32,paddingBottom:24,children:(0,l.Y)(r.A,{size:40,stroke:"var(--color-fg-primary)"})}),(0,l.FD)(m.I1,{gap:12,children:[(0,l.FD)(f.EY.H3,{align:"center",children:["comment"===n&&i("You restacked a comment"),"note"===n&&i("You restacked a note"),"post"===n&&i("You restacked a post")]}),(0,l.FD)(f.EY.B3,{color:"secondary",align:"center",children:["comment"===n&&i("Restack comments that inspire you to share them with more people."),"note"===n&&i("Restack notes that inspire you to share them with more people."),"post"===n&&i("Restack posts that inspire you to share them with more people.")," ",i("Subscribers can see your restacks in the Notes tab and on your profile.")]})]}),(0,l.FD)(m.I1,{paddingBottom:16,paddingTop:20,gap:8,children:[(0,l.Y)(h.$n,{priority:"primary",href:(0,w.oT)(),children:i("View now")}),(0,l.Y)(h.$n,{priority:"secondary-outline",onClick:t,children:i("OK")})]})]})}},60816:function(e,t,n){n.d(t,{l:()=>a});var i=n(4006),l=n(43954),r=n(89490);let o={apple_podcasts:"/img/shows_app_icons/apple_podcasts.svg?v=1",overcast:"/img/shows_app_icons/overcast.svg?v=1",pocket_casts:"/img/shows_app_icons/pocket_casts.svg?v=1",rss:"/img/shows_app_icons/rss.svg?v=1",spotify:"/img/shows_app_icons/spotify.svg?v=1",spotify_for_paid_users:"/img/shows_app_icons/spotify.svg?v=1",spotify_open_access:"/img/shows_app_icons/spotify.svg?v=1",substack:"/img/shows_app_icons/substack.svg?v=1",youtube:"/img/shows_app_icons/youtube.svg?v=1",youtube_music:"/img/shows_app_icons/youtube_music.svg?v=1"},a=e=>{let{platformKey:t,size:n=20}=e;return"email"===t?(0,i.Y)(l.A,{size:n,stroke:"var(--color-fg-secondary)"}):(0,i.Y)(r.az,{width:n,height:n,className:"image-aVeTJg",style:{backgroundImage:"url(".concat(o[t],")")}})}},66728:function(e,t,n){n.d(t,{b:()=>b});var i=n(4006),l=n(32485),r=n.n(l),o=n(17402),a=n(15734),s=n.n(a),d=n(36233),c=n(84605),u=n(86500),p=n(68349),h=n(88218),m=n(76977),g=n(63136),v=n(99484),f=n(60816),Y=n(7755);let b=e=>{let{description:t,feedUrl:n,pub:l,post:r,section:o,showLinks:a,user:s}=e,{iString:d}=(0,c.GO)();return(0,i.FD)(m.I1,{gap:t?8:16,"data-testid":"shows-listen-on",role:"region","aria-label":d("Listen on"),"aria-hidden":!0,children:[(0,i.Y)(h.F,{children:d("Listen on")}),t&&(0,i.Y)(g.EY.B3,{color:"pub-secondary-text",paddingBottom:8,children:t}),(0,i.FD)(m.Ye,{gap:8,wrap:"wrap",children:[r&&(0,i.Y)(_,{platformKey:"substack",label:d("Substack App"),onClick:()=>{(0,v.E)({feedUrl:n,pub:l,post:r})}}),(0,Y.RM)({feedUrl:n,isApple:(0,p.cX)(),isMobile:!1,showLinks:a,user:s,render:e=>{let{label:t,key:n,onClick:l}=e;return(0,i.Y)(_,{label:t,platformKey:n,onClick:l})}}),(null==s?void 0:s.is_subscribed)&&(0,i.Y)(y,{section:o})]})]})},_=e=>{let{disabled:t,label:n,platformKey:l,onClick:o}=e;return(0,i.FD)(m.Ye,{alignItems:"center",bg:"secondary",className:r()("listen-on-item-yiZDJR",{"listen-on-item--disabled-S4EzSi":t}),gap:8,paddingX:12,radius:"sm",onClick:t?void 0:o,children:[(0,i.Y)(m.pT,{opacity:t?40:100,children:(0,i.Y)(f.l,{platformKey:l})}),(0,i.Y)(g.EY.B4,{weight:"semibold",color:"pub-secondary-text",opacity:t?80:100,nowrap:!0,children:n})]})},y=e=>{let{section:t}=e,{iString:n}=(0,c.GO)(),[l,r]=(0,o.useState)(!1),a=async()=>{try{(0,u.u4)(u.qY.PODCAST_EMAIL_LINK_CLICKED),await s().post("/api/v1/subscription/send_podcast_email").send({section_id:null==t?void 0:t.id}),(0,d.Ay)(n("Email sent")),r(!0)}catch(e){(null==e?void 0:e.status)===429?((0,d.Ay)(n("Email already sent")),r(!0)):(0,d.Ay)(n("Something went wrong sending email"))}};return(0,i.Y)(_,{disabled:l,label:l?n("Email sent"):n("Email mobile setup link"),platformKey:"email",onClick:()=>{a()}})}},57538:function(e,t,n){n.d(t,{H:()=>tH});var i=n(69277),l=n(70408),r=n(4006),o=n(17402),a=n(15734),s=n.n(a),d=n(69715),c=n(71328),u=n(6212),p=n(13918),h=n(41935),m=n(86227),g=n(59057),v=n(85478),f=n(46271),Y=n(95064),b=n(26289),_=n(86500),y=n(74894),w=n(68349),k=n(68410),I=n(16074),C=n(76977),S=n(45994);let D=e=>{let{visible:t,className:n,style:i={}}=e,[l,o]=(0,S.J0)(!1),[a,s]=(0,S.J0)(t);return((0,S.vJ)(()=>{t?(s(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{o(!0)})})):o(!1)},[t]),(0,S.vJ)(()=>{t&&s(!0)},[t]),a)?(0,r.Y)("div",{className:"".concat("backdrop-_YQndu"," ").concat(l?"backdropVisible-eL7zZp":"backdropHidden-pg_NJc"," ").concat(n),onTransitionEnd:function(){t||s(!1)},style:i}):null};var F=n(59294),x=n(32485),P=n.n(x),T=n(27747),A=n(4016);let E=e=>{let{audioPlayerRef:t,hasPaywall:n,feedUrl:i,isPrivateFeed:l,isServingFreePodcastUrl:o,post:a,pub:s,section:d,user:c,onChange:u,onCommentsClick:p,freeSignup:m,reaction_token:g}=e,{isMobile:v}=(0,k.sM)(),f=(0,A.lu)({pub:s});return(0,r.Y)("div",{className:P()("player-wrapper-outer-eAOhcD",{"playerWrapperOuterFP-bKWoVB":f}),children:(0,r.Y)("div",{className:P()("player-wrapper-inner-KUdif0",{"playerWrapperInnerFP-Cm0O_q":f}),children:(0,r.Y)(T.Uz,{audioPlayerRef:t,explicitHeight:f?340:void 0,feedUrl:i,hasPaywall:n,isPrivateFeed:l,isServingFreePodcastUrl:o,post:a,pub:s,radius:f&&v?"none":void 0,section:d,user:c,freeSignup:m,ufiComponent:f?null:(0,r.Y)(h.xx,{isStatic:!1,labelStyle:"counts-or-none",position:"shows-episode-player",post:a,pub:s,variant:"large-on-dark",user:c,onChange:u,onCommentsClick:p}),reaction_token:g})})})};var N=n(20674),B=n(13950),M=n(84236),R=n(63446),O=n(82180),L=n(36027),z=n(7903),U=n(15894),H=n(28528),q=n(63136),G=n(69308),W=n(73164),K=n(84605),V=n(35369),j=n(16993),X=n(75303),J=n(36372),Z=n(99484),Q=n(60816),$=n(7755),ee=n(98949);let et=e=>{let{feedUrl:t,isStandaloneVideo:n,eligibleForPodcast:i,post:l,pub:a,showLinks:s,user:d,onTranscriptClick:c}=e,{iString:u}=(0,K.GO)(),[p,h]=(0,o.useState)(!1);return(0,r.FD)(r.FK,{children:[(0,r.FD)(C.Ye,{gap:8,overflowX:"auto",className:"horizontalScrolling-CUpSMl",children:[(0,r.Y)(V.$n,{leading:(0,r.Y)(W.A,{height:18,style:{stroke:"none"}}),priority:"secondary",onClick:()=>(0,Z.E)({feedUrl:t,pub:a,post:l}),children:u("Open in app")}),c&&(0,r.Y)(V.$n,{leading:(0,r.Y)(G.A,{size:20}),priority:"secondary",onClick:c,children:u("Transcript")}),!n&&i&&(0,r.Y)(V.$n,{priority:"secondary",onClick:()=>{h(!0)},children:u("Listen via...")})]}),(0,r.Y)(en,{isModalOpen:p,setIsModalOpen:h,feedUrl:t,showLinks:s,user:d})]})},en=e=>{let{isModalOpen:t,setIsModalOpen:n,feedUrl:i,showLinks:l,user:o}=e,{iString:a}=(0,K.GO)(),s=(0,J.d)();return(0,r.FD)(j.aF,{isOpen:t,onClose:()=>n(!1),children:[(0,r.Y)(j.rQ,{title:a("Listen via..."),description:a("Select your favorite podcast app from the list below."),showDivider:!0,onClose:()=>n(!1)}),(0,r.Y)(j.cw,{children:(0,r.Y)(C.I1,{gap:20,children:l&&(0,$.RM)({feedUrl:i,isApple:(0,ee.aR)(),isMobile:!0,showLinks:l,user:o,render:e=>{let{key:t,label:n,url:i,onClick:l}=e;return(0,r.Y)(ei,{platformKey:t,label:n,url:i,onClick:l})}})})}),(0,r.Y)(j.jl,{direction:"column",secondaryButton:(0,r.Y)(V.$n,{priority:"secondary",onClick:()=>{s.popToast(()=>(0,r.Y)(J.y,{text:a("Copied link to clipboard")})),(0,w.lW)(i)},children:a("Copy RSS feed URL")})})]})},ei=e=>{let{platformKey:t,label:n,url:i,onClick:l}=e;return(0,r.Y)(X.AE,{href:i,children:(0,r.FD)(C.Ye,{alignItems:"center",gap:12,onClick:l,children:[(0,r.Y)(Q.l,{platformKey:t,size:40}),(0,r.Y)(q.EY.B3,{weight:"bold",children:n})]})})};var el=n(39318),er=n(49807),eo=n(96063);let ea=e=>{let{feedUrl:t,isStandaloneVideo:n,eligibleForPodcast:i,post:l,pub:o,magicToken:a,section:s,showLinks:d,user:c,onChange:u,onCommentsClick:p,onToggleRestackModal:m,onTranscriptClick:g}=e,{isMobile:v}=(0,k.sM)();return(0,A.lu)({pub:o})?(0,r.Y)(es,{onTranscriptClick:g,post:l,pub:o,section:s,user:c}):(0,r.Y)(B.DH,{children:(0,r.FD)(C.I1,{gap:16,children:[v&&(0,r.Y)(et,{feedUrl:t,isStandaloneVideo:n,eligibleForPodcast:i,post:l,pub:o,showLinks:d,user:c,onTranscriptClick:g}),v&&(0,r.Y)(M.pJ,{align:"center",direction:"column",gap:8,paddingY:8,post:l,pub:o,section:s,textField:"episode_short_text"}),(0,r.FD)(C.I1,{gap:8,children:[(0,r.Y)(q.EY.H2,{color:"pub-primary-text",font:"pub-headings",dir:"auto",className:eo.A.title,children:l.title}),l.subtitle&&(0,r.Y)(q.EY.B2,{color:"pub-secondary-text",font:"pub-headings",weight:"regular",dir:"auto",className:eo.A.subtitle,children:l.subtitle})]}),(0,r.Y)(N.D,{variant:"shows",post:l,pub:o}),!v&&(0,r.Y)(h.bW,{post:l,pub:o,user:c,onChange:u,postReactionToken:a,onCommentsClick:p,onToggleRestackModal:m,onTranscriptClick:g,position:"shows-episode-player"})]})})},es=e=>{var t;let{onTranscriptClick:n,post:i,pub:l,section:o,user:a}=e,s=(0,el.t6y)({pub:l,section:o}),d=!!i.videoUpload,c=null!=(t=null==o?void 0:o.is_podcast)&&t||!d,{isMobile:u}=(0,k.sM)();return(0,r.Y)(H.XL,{pub:l,children:(0,r.Y)(B.DH,{children:(0,r.FD)(C.I1,{gap:24,children:[(0,r.FD)(C.I1,{gap:12,children:[(0,r.FD)(C.I1,{gap:8,children:[o&&(0,r.Y)(R.v,{alignSelf:"start",href:c?s:(0,er.Dor)(l,{section:o}),variant:"tertiary",size:"md",leadingIcon:"chevron-left",children:"View all episodes"}),(0,r.Y)(U.T,{preset:"h4-serif",children:i.title}),(0,r.Y)(L.E,{post:i})]}),i.subtitle&&(0,r.Y)(U.T,{preset:"d3-serif",children:i.subtitle})]}),(0,r.FD)(C.pT,{alignItems:"center",direction:u?"column":"row",gap:16,justifyContent:"space-between",paddingBottom:24,children:[c&&(0,r.Y)(O.Z,{pub:l,section:o,user:a,post:i}),(0,r.FD)(C.Ye,{alignSelf:u?"stretch":void 0,gap:16,children:[n&&(0,r.Y)(R.v,{flex:u?"grow":void 0,trailingIcon:"transcript",variant:"outline",size:"sm",onClick:n,children:"Transcript"}),o&&(0,r.Y)(z.S,{grow:u,pub:l,section:o,user:a,isPodcastOrVideo:!0})]})]})]})})})};var ed=n(88218),ec=n(24078),eu=n(15040);let ep=e=>{let{bylines:t,variant:n}=e;return(0,r.Y)(C.pT,(0,l._)((0,i._)({},"shows"===n?{direction:"row",gap:12,wrap:"wrap"}:{direction:"column",gap:24}),{children:t.map(e=>(0,r.FD)(C.Ye,{alignItems:"center",gap:8,children:[(0,r.Y)(eu.$o,{tier:e.bestseller_tier,children:(0,r.Y)(ec.tp,{user:e,utmSource:"author-byline-face-podcast",size:32})}),(0,r.FD)(C.I1,{children:[(0,r.Y)(q.EY.B4,{color:"pub-primary-text",children:(0,r.Y)("a",{href:(0,el.gYq)(e),style:{color:"inherit",textDecoration:"none"},children:e.name})}),e.primaryPublicationName&&(e.primaryPublicationUrl?(0,r.FD)(q.EY.B4,{color:"pub-secondary-text",translated:!0,children:["Writes"," ",(0,r.Y)("a",{style:{textDecoration:"none"},href:e.primaryPublicationUrl,children:I18N.p(e.primaryPublicationName)})," ",(0,r.Y)("a",{href:"".concat(e.primaryPublicationUrl,"/subscribe"),children:"Subscribe"})]}):(0,r.FD)(q.EY.B4,{color:"pub-secondary-text",translated:!0,children:["Writes ",I18N.p(e.primaryPublicationName)]}))]})]}))}))},eh=e=>{let{bylines:t,isStandaloneVideo:n,eligibleForPodcast:i}=e,{iString:l}=(0,K.GO)();return(0,r.FD)(C.I1,{gap:16,"aria-label":"Appears in episode",role:"region",children:[(0,r.Y)(ed.F,{children:l(n||!i?"Authors":"Appears in episode")}),(0,r.Y)(ep,{bylines:t,variant:"shows"})]})};var em=n(81209),eg=n(16831),ev=n(91496);let ef=e=>{let{post:t,pub:n,section:i,user:l,isStandaloneVideo:o}=e,{title:a,description:s,url:d}=(0,$.ed)({pub:n,section:i,useSection:o});return(0,r.FD)(C.I1,{border:"detail-themed",className:"container-MuztBl",gap:24,paddingX:16,paddingY:24,radius:"md",shadow:"lg",onClick:()=>{window.location.href=d},children:[(0,r.FD)(C.I1,{gap:8,alignItems:"center",children:[(0,r.Y)(ev.M,{post:t,pub:n,section:i,useSection:o}),a&&(0,r.Y)(ed.F,{align:"center",children:a}),(0,A.s7)({pub:n,includeTheRampart:!0})&&(0,r.Y)(C.Ye,{alignItems:"center",gap:8,children:(0,A.ot)({sectionId:null==i?void 0:i.id}).map(e=>(0,r.Y)(eg.b,{medium:e}))}),s&&(0,r.FD)(C.I1,{gap:8,children:[s.split("\n").map(e=>(0,r.Y)(q.EY.B4,{className:"description-ij0plp",color:"pub-secondary-text",align:"center",children:e})),(0,r.Y)("span",{hidden:!0,"data-testid":"podcast-description",children:s})]})]}),!(null==l?void 0:l.is_subscribed)&&(0,r.Y)("div",{className:"subscribe-container-_pmqCv",onClick:e=>{e.stopPropagation()},children:(0,r.Y)(em.A,{expectTruncation:!0,pub:n,source:"episode-page-sidebar",user:l})})]})};var eY=n(66728),eb=n(98002);let e_=e=>{let{isStandaloneVideo:t,pub:n,recentEpisodes:i,user:l}=e,{iString:o}=(0,K.GO)(),{isMobile:a}=(0,k.sM)();return(0,r.Y)(H.XL,{pub:n,user:l,children:(0,r.FD)(C.I1,{gap:a?12:8,"aria-label":o("Recent episodes"),role:"region",children:[(0,r.Y)(ed.F,{children:o(t?"Recent Posts":"Recent Episodes")}),(0,r.Y)(C.I1,{gap:12,style:{margin:a?void 0:"0 -8px"},"aria-label":o("Recent episodes"),role:"region",children:i.map(e=>(0,r.Y)(eb.z,{post:e,variant:"mini-episode",onClick:()=>{(0,_.u4)(_.qY.RECENT_EPISODE_ITEM_CLICKED,{post_id:e.id})}}))})]})})};var ey=n(82776);let ew=e=>{var t;let{feedUrl:n,isStandaloneVideo:l,eligibleForPodcast:a,post:d,pub:c,recentEpisodes:u,section:p,showLinks:h,user:m}=e,{iString:g}=(0,K.GO)(),{isMobile:v}=(0,k.sM)(),[f,Y]=(0,o.useState)(u),b=(0,o.useMemo)(()=>{var e;return null!=(e=null==f?void 0:f.filter(e=>e.id!==d.id))?e:null},[f,d.id]),_=(0,M.Jq)(c,p),y=(0,ey.getBylineUsers)(d).sort((e,t)=>e.id===c.author_id?-1:t.id===c.author_id?1:e.is_guest&&!t.is_guest?-1:!e.is_guest&&t.is_guest?1:(e.name||"").localeCompare(t.name||""));return(0,o.useEffect)(()=>{let e=async()=>{var e,t;Y(null!=(t=(await s().get("/api/v1/recent_posts").query((0,i._)({rss_episodes_only:!(null==(e=d.podcastFields)?void 0:e.hide_from_feed)},(null==p?void 0:p.id)?{section_id:p.id}:{}))).body)?t:[])};u||e()},[d.id,null==(t=d.podcastFields)?void 0:t.hide_from_feed,u,c.id,null==p?void 0:p.id]),(0,r.FD)(C.I1,{gap:_?24:32,"aria-label":g("Sidebar content"),role:"complementary",children:[!v&&(0,r.Y)(M.pJ,{align:"center",direction:"column",gap:8,post:d,pub:c,section:p,textField:"episode_short_text"}),!v&&(0,r.Y)(ef,{post:d,pub:c,section:p,user:m,isStandaloneVideo:l}),(0,r.FD)(C.I1,{gap:32,children:[!v&&!l&&a&&(0,r.Y)(eY.b,{feedUrl:n,showLinks:h,post:d,pub:c,section:p,user:m}),!v&&c.bylines_enabled&&y.length>0&&(0,r.Y)(eh,{bylines:y,isStandaloneVideo:l,eligibleForPodcast:a}),b&&b.length>0&&(0,r.Y)(e_,{isStandaloneVideo:l,pub:c,recentEpisodes:b,user:m})]})]})};var ek=n(26747),eI=n(72536),eC=n(48697),eS=n(82853),eD=n(54718),eF=n(52077),ex=n(45859),eP=n(9036);let eT="showTranscript";function eA(e){let t=(0,eP.m)(e)[eT];return"true"===t||"1"===t}var eE=n(18291),eN=n(89490);let eB="transcriptionWords-u5CRAD",eM="transcription-timestamp-mDeQkH",eR="transcription-text-align-left-V7cht2",eO=e=>{let{activeRowIndex:t,isPlaying:n,postId:i,row:l,rowIndex:a,showSpeaker:s,speakerName:d,words:c,onPause:u,onPlay:p}=e,{searchTerm:h,focusedItemStart:m}=(0,Y.IS)(),g=(0,o.useRef)(null),v=h&&l.text.toLowerCase().includes(h.toLowerCase());(0,o.useEffect)(()=>{if(m&&g.current&&l.start===m){var e;null==(e=g.current)||e.scrollIntoView({behavior:"smooth",block:"center"})}},[m,l.start]);let f=()=>v?(0,r.Y)(eE.x,{isFocused:l.start===m,searchTerm:h,rowIndex:a,text:l.text.trim()}):(0,r.Y)(eN.az,{display:"inline",className:eB,lineHeight:20,radius:"sm","data-chunk-index":a,children:((null==c?void 0:c.length)?c.map(e=>e.word).join(" "):l.text).trim()});return(0,r.Y)("div",{ref:g,children:(0,r.Y)(eF.vo,{onPlay:p,onPause:u,postId:i,isActiveRow:t==a,isPlaying:n,row:l,rowIndex:a,className:"transcription-chunk-YeZNdv",activeClassName:"transcription-chunk--active-HnAU7N",children:d&&s?(0,r.FD)(C.I1,{paddingTop:2,children:[(0,r.FD)(C.Ye,{alignItems:"baseline",gap:12,children:[(0,r.Y)(q.EY.B4,{className:P()(eM,eR),color:"pub-secondary-text",children:d?(0,ey.secondsToHHMMSS)(l.start):""}),(0,r.Y)(q.EY.Meta,{padding:2,paddingTop:4,color:"accent",weight:"semibold",children:d})]}),(0,r.FD)(C.Ye,{alignItems:"baseline",gap:12,"data-chunk-index":a,children:[(0,r.Y)(q.EY.B4,{className:P()(eM,eR),color:"pub-secondary-text",children:d?"":(0,ey.secondsToHHMMSS)(l.start)}),(0,r.Y)(eN.az,{display:"inline",className:eB,lineHeight:20,padding:2,radius:"sm","data-chunk-index":a,children:f()})]})]}):(0,r.FD)(C.Ye,{alignItems:"baseline",gap:12,"data-chunk-index":a,children:[(0,r.Y)(q.EY.B4,{className:P()(eM,eR),color:"pub-secondary-text",children:d?"":(0,ey.secondsToHHMMSS)(l.start)}),(0,r.Y)(eN.az,{display:"inline",className:eB,padding:2,radius:"sm","data-chunk-index":a,children:f()})]})})},a)},eL=e=>{let{isPublicationContributor:t,post:n,playerRef:a,transcription:s,fullWidth:d,onClose:c,onExpand:u,onCollapse:p,showExpandButton:h=!0}=e,{isMobile:m}=(0,k.sM)(),[g,v]=(0,o.useState)(0),f=(0,o.useRef)(null),[b,_]=(0,o.useState)(!1),[y,w]=(0,o.useState)(0),{searchTerm:I}=(0,Y.IS)(),S=()=>{if(f.current){let e=f.current.getBoundingClientRect().top,t=window.scrollY||window.scrollY;t>y&&e<=0?_(!0):t<=y&&_(!1)}};return(0,o.useEffect)(()=>{let e=f.current,t=()=>{e&&!b&&w(e.offsetTop)};t();let n=new ResizeObserver(t);return e&&n.observe(e),window.addEventListener("scroll",S),()=>{e&&n.unobserve(e),window.removeEventListener("scroll",S)}},[b]),(0,r.Y)(B.DH,{children:(0,r.FD)(C.I1,{gap:24,flex:"grow",children:[(0,r.FD)(C.Ye,{gap:8,alignItems:"center",children:[(0,r.Y)(C.Ye,{flex:"grow",ref:f,className:b?"sticky-zutBDd":"",display:!I&&b?"none":void 0,children:(0,r.Y)(C.Ye,{paddingLeft:m&&b?8:0,children:(0,r.Y)(Y.Qj,{postId:n.id,closeAlwaysVisible:!1})})}),(0,r.Y)(ez,{isPublicationContributor:t,postId:n.id,transcription:s}),!m&&h&&(0,r.FD)(o.Fragment,{children:[!d&&(0,r.Y)(V.K0,{onClick:u,children:(0,r.Y)(ek.A,{})}),d&&(0,r.Y)(V.K0,{onClick:p,children:(0,r.Y)(eI.A,{})})]}),(0,r.Y)(V.K0,{onClick:c,children:(0,r.Y)(eC.A,{})})]}),(0,r.Y)("div",{className:"transcription-full-body-container-LXFSNv",children:(0,r.Y)(eF.Ay,{player:a,postId:n.id,renderTranscriptionChunk:e=>(0,r.Y)(eO,(0,l._)((0,i._)({},e),{activeRowIndex:g,postId:n.id})),transcription:s,onUpdateActiveRowIndex:v})})]})})};function ez(e){let{isPublicationContributor:t,postId:n,transcription:i}=e,{iString:l}=(0,K.GO)(),{popToast:o}=(0,J.d)(),a=!!(i.cdn_unaligned_url&&i.cdn_url),s=!!i.cdn_url,d=()=>{var e;if("undefined"==typeof window)return;let t=(e=window.location.href,(0,el.oRR)(e,{[eT]:!0}));(0,_.u4)(_.qY.SHARE_LINK_CLICKED,{name:"transcript",post_id:n,source:"shows-transcript-menu"}),(0,w.lW)(t),o(()=>(0,r.Y)(J.y,{text:l("Copied link to clipboard")}))};return t?(0,r.FD)(ex.W1,{trigger:(0,r.Y)(V.K0,{"aria-label":l("More options"),children:(0,r.Y)(eD.A,{})}),children:[(0,r.Y)(ex.Dr,{onClick:()=>{d()},children:l("Copy transcript URL")}),(0,r.Y)(ex.Dr,{disabled:!a,onClick:()=>{(0,_.u4)(_.qY.TRANSCRIPTION_DOWNLOAD_CLICKED,{post_id:n,type:"txt"}),(0,Y.bH)(i)},children:l("Download .txt")}),(0,r.Y)(ex.Dr,{disabled:!s,onClick:()=>{(0,_.u4)(_.qY.TRANSCRIPTION_DOWNLOAD_CLICKED,{post_id:n,type:"json"}),(0,Y.lk)(i)},children:l("Download .json")})]}):(0,r.Y)(V.K0,{"aria-label":l("Copy transcript URL"),onClick:()=>{d()},children:(0,r.Y)(eS.A,{})})}var eU=n(99851),eH=n(32641),eq=n(77849),eG=n(41873),eW=n(16784),eK=n(83137),eV=n(70107),ej=n(60285),eX=n(49869),eJ=n(13348),eZ=n(99070),eQ=n(33764),e$=n(28734),e0=n(8734),e1=n(4246),e2=n(46009);let e4=e=>{var t,n,i,l;let{alternateAudioSource:a,audioPlayerRef:s,hideControls:d,isIdle:c,post:u,pub:p,showPaywall:h,onFinishAudio:m,onSetAudioIsPlaying:g}=e,{iString:v}=(0,K.GO)(),{isMobile:f}=(0,k.sM)(),Y=(0,b.By)(s),_=u.section_id&&null!=(t=p.sections.find(e=>e.id===u.section_id))?t:null,{artUrl:y}=_?(0,e2.lL)({pub:p,section:_}):(0,e2.j_)({pub:p}),w=_?null!=(n=_.podcastPalette)?n:null:null!=(i=p.podcastPalette)?i:null,I=["extra_audio_preview","alternate_audio_preview"].includes(a.type);return(0,o.useEffect)(()=>{g(Y)},[Y,g]),(0,r.Y)(eZ.A,{ref:s,src:a.url,updateOnEveryFrame:(null!=(l=u.podcast_duration)?l:0)<300,onFinishAudio:m,trackingProps:{contentType:"post",entityKey:u.id,entityType:"post",surface:"post"},render:e=>{var t;let{duration:n,isPlaying:i,togglePlayback:l}=e,o=e=>e.stopPropagation();return(0,r.FD)(C.I1,{alignItems:"center",bg:"primary",flex:"grow",justifyContent:"center",position:"relative",overflow:f?"auto":"hidden",onClick:()=>{l()},children:[(0,r.Y)(e$._,{backgroundUrl:y,blurAmount:40,isBlurred:!0,palette:w,radius:"none"}),(0,r.Y)(C.Ye,{className:"darkenBottom-zaTJyO",position:"absolute",inset:0}),(0,r.FD)(C.Ye,{position:"relative",children:[y&&!h&&(0,r.Y)(eQ.o,{imageIsFixedWidth:!0,maxWidth:f?160:340,radius:"md",src:y,useRetinaSizing:!0}),(0,r.Y)(C.Ye,{alignItems:"center",inset:0,justifyContent:"center",position:"absolute",children:(0,r.Y)(C.Ye,{onClick:o,opacity:100*!d,children:(0,r.Y)(eJ.ro,{isPlaying:null!=i&&i,size:f?56:72,onTogglePlayback:l})})})]}),(0,r.Y)(C.Ye,{onClick:o,children:(0,r.Y)(e1.Jf,{disableShortcuts:!0,disableTooltips:!0,duration:n,handle:null,isActive:(!i||!c)&&!h,isAudio:!0,isFocused:!1,post:u,pub:p,mediaUpload:null,mediaRef:s,showPaywall:!1})}),I&&(0,r.Y)(C.Ye,{position:"absolute",style:{top:12,left:12},children:(0,r.Y)(e0.d,{avoidBackgroundBlur:!0,children:(null==(t=u.podcastFields)?void 0:t.preview_contains_ad)?v("Sponsored"):v("Preview")})})]})}})};var e6=n(31790),e7=n(50802),e8=n(49802),e3=n(66511);let e9={unselectedButton:"unselectedButton-LnSrSa"},e5="switcher-audio-button",te=e=>{let{selected:t,sourceType:n,onSelect:i}=e,{iString:l}=(0,K.GO)(),{isMobile:o}=(0,k.sM)(),a={alternate_audio_preview:l("Switch to audio"),alternate_full_audio:l("Switch to audio"),extra_audio_preview:l("Switch to the audio preview"),free_podcast_url:l("Switch to the full ad-supported audio")}[n];return(0,r.FD)(C.I1,{bg:"glass-inverted-medium",gap:4*!o,padding:4,pointerEvents:o?"none":"auto",radius:"full",children:[(0,r.Y)(e3.m_,{disabled:o,side:"right",text:l("Switch to video"),children:(0,r.Y)(V.mZ,{className:P()({[e9.unselectedButton]:"video"!==t}),rounded:!0,size:o?"sm":"md",onClick:()=>{null==i||i("video")},children:(0,r.Y)(e7.A,{size:o?18:20})})}),(0,r.Y)(C.Ye,{position:"relative",className:e9.audioButtonContainer,children:(0,r.Y)(e3.m_,{disabled:o,side:"right",text:a,children:(0,r.Y)(V.mZ,{id:e5,className:P()({[e9.unselectedButton]:"audio"!==t}),rounded:!0,size:o?"sm":"md",onClick:()=>{null==i||i("audio")},children:(0,r.Y)(e8.A,{size:o?16:18})})})})]})},tt=(0,o.createContext)({containerRef:{current:null},clearSelection:()=>void 0,finishedSelection:null,isSelecting:!1,selectionBegin:null,selectionFinish:null,selectionRef:{current:null}}),tn=e=>{let{children:t}=e,n=(0,o.useRef)(null),i=(0,o.useRef)(null),[l,a]=(0,o.useState)(!1),[s,d]=(0,o.useState)(!1),[c,u]=(0,o.useState)(null),[p,h]=(0,o.useState)(null),m=c&&p&&(p.rowIndexs&&g&&v?{begin:g,finish:v}:null,[g,v,s]);(0,o.useEffect)(()=>{if(!n.current)return;let e=n.current,t=e=>{s&&(d(!1),a(!1),u(null),h(null));let t=Number(e.target.dataset.rowIndex),n=Number(e.target.dataset.wordIndex);isNaN(t)||isNaN(n)||u({rowIndex:t,wordIndex:n})},i=e=>{if(!c||s)return;l||a(!0);let t=e.target.dataset;if("true"===t.inBetween){let e=Number(t.prevRowIndex),n=Number(t.prevWordIndex),i=Number(t.nextRowIndex),l=Number(t.nextWordIndex);if(isNaN(e)||isNaN(n)||isNaN(i)||isNaN(l))return;c.rowIndex{d(!0)};return e.addEventListener("mousedown",t),e.addEventListener("mousemove",i),e.addEventListener("mouseup",r),()=>{e.removeEventListener("mousedown",t),e.removeEventListener("mousemove",i),e.removeEventListener("mouseup",r)}},[n,s,l,c]);let Y=(0,o.useCallback)(()=>{d(!1),a(!1),u(null),h(null);let e=window.getSelection();e&&(e.removeAllRanges?e.removeAllRanges():e.empty&&e.empty())},[]);return(0,r.Y)(tt.Provider,{value:{clearSelection:Y,finishedSelection:f,isSelecting:l,containerRef:n,selectionBegin:g,selectionFinish:v,selectionRef:i},children:t})},ti=()=>(0,o.useContext)(tt);var tl=n(78659),tr=n.n(tl),to=n(69843),ta=n.n(to),ts=n(7350),td=n.n(ts),tc=n(6632),tu=n(43241),tp=n(23623),th=n(90250),tm=n(58390),tg=n(6579),tv=n(90128),tf=n.n(tv),tY=n(16858),tb=n(92967);let t_="hideSelectionBackground-vjEoVj",ty=(0,o.memo)(e=>{var t;let{clipWordEnd:n,clipWordStart:a,isFinishedSelecting:s,focusedItemStart:d,isClipping:c,isFaded:u,isFirstInSelection:p,isMeasuring:h,isScrolling:m,isSelecting:g,listContainerRef:v,postId:f,rowIndex:Y,rows:b,searchTerm:y,selectedWordEnd:w,selectionRef:k,selectedWordStart:I,speakerMap:S,onClickRow:D,onCreateClip:F}=e,x=(0,o.useRef)(null),T=b[Y];T||console.error("Transcript row at index ".concat(Y," is missing"));let A=0===Y?null:b[Y-1],E=Y===b.length-1?null:b[Y+1],N=0===Y?null:b[Y-1],B=(!N||N.speaker!==T.speaker)&&T.speaker?null!=(t=S[T.speaker])?t:function(e){if(!e)return"Unknown Speaker";let t=e.split("_"),n=parseInt(t[1]);return"".concat(tf()(t[0])," ").concat(n+1)}(T.speaker):null,M=y&&T.text.toLowerCase().includes(y.toLowerCase()),R=A?{"data-in-between":!0,"data-prev-row-index":Y-1,"data-prev-word-index":A.words.length-1,"data-next-row-index":Y,"data-next-word-index":0}:{},O=E?{"data-in-between":!0,"data-prev-row-index":Y,"data-prev-word-index":T.words.length-1,"data-next-row-index":Y+1,"data-next-word-index":0}:{};return(0,r.FD)(C.Ye,{alignItems:"start",gap:12,paddingX:16,"data-transcript-row-index":Y,onClick:()=>{var e;(null==(e=window.getSelection())||!e.toString())&&D&&f&&((0,_.u4)(_.qY.TRANSCRIPTION_TIMESTAMP_CLICKED,{post_id:f,timestamp:(0,tb.kq)(T.start)}),D({rowIndex:Y}))},style:h?{overflowY:"scroll"}:void 0,children:[(0,r.Y)(C.Ye,{bg:"glass-inverted-medium",paddingX:4,radius:"sm",userSelect:"none",children:(0,r.Y)(q.EY.Meta,{color:"white",lineHeight:20,children:(0,ey.secondsToHHMMSS)(T.start)})}),(0,r.FD)(C.I1,{flex:"grow",gap:2,children:[B&&(0,r.Y)(q.EY.Meta,(0,l._)((0,i._)({color:"white",opacity:60,userSelect:"none",weight:"semibold"},R),{children:B})),(0,r.FD)(C.I1,{position:"relative",children:[M&&(0,r.Y)(tw,{isFocused:T.start===d,searchTerm:y,text:T.text.trim()}),(0,r.FD)(C.I1,{ref:x,position:"relative",children:[(0,r.Y)(q.EY.B3,(0,l._)((0,i._)({className:P()(t_,{"textContainerFadedShows-pHGywl":u}),cursor:"pointer",lineHeight:20,paddingBottom:12},O),{children:!T.words.length||m&&!c&&ta()(I)&&ta()(w)?T.text:T.words.map((e,t)=>{let i=!ta()(I)&&!ta()(w)&&t>=I&&t<=w,l=p&&t===I,o=c&&!g&&!ta()(n)&&!ta()(a)&&t>=a&&t<=n;return(0,r.FD)(r.FK,{children:[(0,r.Y)("span",{ref:l?k:null,className:P()("word-IefdhU",{"wordSelectedShows-Tf85j5":o||i}),"data-row-index":Y,"data-word-index":t,children:e.word})," "]})})})),p&&s&&F&&v&&!c&&(0,r.Y)(tI,{firstWordRef:k,listContainerRef:v,rowElemRef:x,children:(0,r.Y)(tC,{onClick:F})})]})]})]})]})}),tw=e=>{let{searchTerm:t,isFocused:n,text:i}=e,l=RegExp("(".concat(t,")"),"gi"),o=i.split(l);return(0,r.Y)(q.EY.B3,{className:"textHidden-zukLlK",position:"absolute",inset:0,children:o.map(e=>e.match(l)?(0,r.Y)("span",{className:P()("searchResult-cbPSuC",{"isFocused-wy1BKg":n}),children:e}):(0,r.Y)("span",{children:e}))})},tk=(0,o.memo)(e=>{let{style:t,index:n,data:i,isScrolling:l}=e,{activeRowIndex:o,listContainerRef:a,postId:s,rows:c,speakerMap:u,onClickRow:p,onCreateClip:h}=i,{finishedSelection:m,isSelecting:g,selectionBegin:v,selectionFinish:f,selectionRef:b}=ti(),{searchTerm:_,focusedItemStart:y}=(0,Y.IS)(),{clipTimes:w,isClipping:k}=(0,d.MC)(),I=c[n];I||console.error("Transcript row at index ".concat(n," is missing"));let C=!!(v&&v.rowIndex===n),S=null,D=null;if(v&&f){let e=n===v.rowIndex&&n===f.rowIndex,t=n===v.rowIndex,i=n===f.rowIndex,l=n>v.rowIndex&&nw.start&&t.start{let{children:t,firstWordRef:n,listContainerRef:i,rowElemRef:l}=e;if(!(null==n?void 0:n.current)||!l.current||!i.current)return null;let o=n.current.offsetTop,{top:a}=l.current.getBoundingClientRect(),{top:s,height:d}=i.current.getBoundingClientRect(),c=tr()(o-8,s-a+8+32,s+d-a-8);return(0,r.Y)(C.I1,{position:"absolute",style:{top:c,left:"45%",transform:"translate(-50%, -100%)"},onClick:tS,onMouseDown:tS,onMouseMove:tS,onMouseUp:tS,userSelect:"none",zIndex:1,children:t})},tC=e=>{let{onClick:t}=e,{iString:n}=(0,K.GO)();return(0,r.Y)(V.$n,{leading:(0,r.Y)(tY.A,{size:16}),priority:"secondary",onClick:t,children:n("Create clip")})},tS=e=>{e.stopPropagation()},tD=e=>{let{activeRowIndex:t,height:n,id:i,listContainerRef:l,listRef:a,postId:s,rows:d,speakerMap:c,width:u,onClickRow:p,onCreateClip:h,onScroll:m}=e,[g,v]=(0,o.useState)(null);(0,o.useLayoutEffect)(()=>{if(g||!u)return;let e=document.createElement("div");e.style.position="absolute",e.style.top="0",e.style.width="".concat(u,"px"),e.style.pointerEvents="none",e.style.visibility="hidden",v(e),document.body.appendChild(e)},[g,u]);let f=(0,o.useCallback)(e=>g?(g.innerHTML=(0,tm.F0)((0,r.Y)(ty,{isMeasuring:!0,isScrolling:!1,rows:d,rowIndex:e,selectedWordEnd:null,selectedWordStart:null,speakerMap:c})),g.clientHeight||0):0,[g,d,c]),Y=(0,o.useMemo)(()=>({activeRowIndex:t,listContainerRef:l,postId:s,rows:d,speakerMap:c,onClickRow:p,onCreateClip:h}),[t,l,s,d,c,p,h]);return g?(0,r.Y)("div",{id:i,children:(0,r.Y)(tg._m,{ref:a,itemCount:d.length,itemSize:f,height:n,width:u,itemData:Y,outerElementType:tF,useIsScrolling:!0,onScroll:m,children:tk})}):null},tF=(0,o.forwardRef)((e,t)=>{var{style:n}=e,o=(0,eH._)(e,["style"]);return(0,r.Y)("div",(0,i._)({ref:t,style:(0,l._)((0,i._)({},n),{overflowY:"scroll"})},o))});var tx=n(50874);let tP="video-transcription",tT=e=>{let{isClipping:t,playerRef:n,postId:l,transcription:a,onClose:s,surface:c}=e,{iString:u}=(0,K.GO)(),{clipTimes:p,virtualizedListRef:h,onStartClipping:m}=(0,d.MC)(),g=(0,o.useRef)(null),{containerRef:v,finishedSelection:f,clearSelection:y,isSelecting:w}=ti(),{rows:k,speakerMap:I}=(0,F.Fy)({transcription:a,processAlignedRows:tx.qD}),{isPlaying:S,currentTime:D}=(0,b.yr)(n),{setItems:x,focusedItemStart:P,searchTerm:T}=(0,Y.IS)(),[A,E]=(0,o.useState)(null),[N,B]=(0,o.useState)(!1),{width:M,height:R}=(0,eX.w)({containerRef:g}),[O,L]=(0,o.useState)("in-view"),[z,U]=(0,o.useState)("in-view"),[H,G]=(0,o.useState)("in-view"),W=!!(null==T?void 0:T.trim()),j=S&&!W&&!t&&!f,X=p&&tA(k,p.start),J=p&&tA(k,p.end);(0,o.useEffect)(()=>{x(k)},[k,x]),(0,o.useEffect)(()=>{var e,t,i,l;!w||(null==(t=n.current)||null==(e=t.player)?void 0:e.paused)||null==(l=n.current)||null==(i=l.player)||i.pause()},[w,n]),(0,o.useEffect)(()=>{if(N)return;let e=k.findIndex(e=>e.start<=D&&e.end>D);-1!==e&&e!==A&&E(e)},[A,D,N,k]),(0,o.useEffect)(()=>{if(!W||!(null==h?void 0:h.current))return;let e=k.findIndex(e=>e.start===P);h.current.scrollToItem(e,"start")},[P,W,k,h]),(0,o.useEffect)(()=>{var e,t;if(!j||!(null==h?void 0:h.current))return;let n=document.querySelector("#".concat(tP,' [data-transcript-row-index="').concat(A,'"]'));if(!n)return;let i=n.parentElement,l=document.querySelector("#".concat(tP," > div")),r=null!=(e=null==l?void 0:l.children[0])?e:null;if(!l||!i||!r)return;let o=r.offsetHeight-l.offsetHeight,a=parseInt(null!=(t=i.style.top.split("px")[0])?t:""),s=l.scrollTop,d=tr()(a-32,0,o);(0,th.eb)({virtualizedListRef:h,start:s,end:d,duration:300})},[A,j,h]);let Z=(0,o.useCallback)(td()(()=>{if("number"!=typeof A)return;if(document.querySelector("#".concat(tP,' [data-transcript-row-index="').concat(A,'"]')))return void L("in-view");let e=document.querySelector("#".concat(tP," [data-transcript-row-index]"));e&&L(((null==e?void 0:e.dataset.transcriptRowIndex)?parseInt(e.dataset.transcriptRowIndex):-1)>A?"is-before":"is-after")},100),[A]),Q=(0,o.useCallback)(td()(()=>{if(ta()(X)||ta()(J))return;let e=document.querySelector("#".concat(tP,' [data-transcript-row-index="').concat(X,'"]')),t=document.querySelector("#".concat(tP,' [data-transcript-row-index="').concat(J,'"]')),n=document.querySelector("#".concat(tP," [data-transcript-row-index]"));if(!n)return;let i=(null==n?void 0:n.dataset.transcriptRowIndex)?parseInt(n.dataset.transcriptRowIndex):-1;e||t||i>X&&iX?"is-before":"is-after")},100),[J,X]),$=(0,o.useCallback)(td()(()=>{if(!f)return;let e=f.begin.rowIndex;if(document.querySelector("#".concat(tP,' [data-transcript-row-index="').concat(e,'"]')))return void G("in-view");let t=document.querySelector("#".concat(tP," [data-transcript-row-index]"));t&&G(((null==t?void 0:t.dataset.transcriptRowIndex)?parseInt(t.dataset.transcriptRowIndex):-1)>e?"is-before":"is-after")}),[f]),ee=(0,o.useCallback)(e=>{let{scrollUpdateWasRequested:n}=e;n||(f?$():t?Q():Z())},[f,t,Z,Q,$]);(0,o.useEffect)(()=>{S&&Z()},[S,Z]),(0,o.useEffect)(()=>{if(!p||!(null==h?void 0:h.current))return;let e=tA(k,p.start);h.current.scrollToItem(Math.max(e,0),"smart"),U("in-view")},[p,k,Q,h]);let et=(0,o.useCallback)(()=>{(null==h?void 0:h.current)&&(h.current.scrollToItem(A,"start"),L("in-view"))},[A,h]),en=(0,o.useCallback)(()=>{(null==h?void 0:h.current)&&(h.current.scrollToItem(X,"start"),U("in-view"))},[X,h]),ei=(0,o.useCallback)(()=>{if(!f||!k)return;let{start:e,end:t}=(0,th.ng)({finishedSelection:f,transcriptionRows:k});y(),(0,_.u4)(_.qY.MEDIA_CLIP_BUTTON_CLICKED,{button:"create",source:"post transcript",surface:c}),m({start:e,end:t,source:"side-by-side-transcript",title:null})},[y,f,m,k,c]);(0,o.useEffect)(()=>{f&&(t?ei():$())},[f,ei,t,$]);let el=(0,o.useCallback)(async e=>{var i;let{rowIndex:l}=e;if(null==(i=n.current)?void 0:i.player){if(t){let e=k[l];m({start:e.start,end:e.end,source:"side-by-side-transcript",title:null});return}if(S&&l===A)return void n.current.player.pause();n.current.player.currentTime=k[l].start,E(l),B(!0),await n.current.player.play(),B(!1)}},[A,t,S,m,n,k]);return(0,r.Y)(tp.a,{children:(0,r.FD)(C.I1,{inset:0,position:"absolute",style:{backgroundColor:"#161718"},children:[(0,r.FD)(C.Ye,{alignItems:"center",justifyContent:"space-between",padding:16,children:[(0,r.Y)(q.EY.B2,{color:"primary",weight:"semibold",children:u(t?"Create clip":"Transcript")}),s&&(0,r.Y)(V.K0,{priority:"secondary",size:"sm",onClick:s,children:(0,r.Y)(eC.A,{size:20})})]}),(0,r.Y)(C.Ye,{paddingX:16,paddingBottom:16,onKeyDown:e=>{e.stopPropagation()},children:(0,r.Y)(Y.Qj,{postId:l,closeAlwaysVisible:!1})}),(0,r.FD)(C.I1,{ref:g,flex:"grow",position:"relative",children:[(0,r.Y)(C.I1,{ref:v,position:"absolute",inset:0,children:!!M&&(0,r.Y)(tD,{activeRowIndex:S?A:null,height:R,id:tP,listContainerRef:g,listRef:h,postId:l,rows:k,speakerMap:I,width:M,onClickRow:el,onCreateClip:ei,onScroll:ee})}),j&&"in-view"!==O&&(0,r.Y)(C.I1,{position:"absolute",style:(0,i._)({left:16,right:16},"is-before"===O?{top:0}:{bottom:16}),children:(0,r.Y)(V.$n,{leading:"is-before"===O?(0,r.Y)(tc.A,{size:16}):(0,r.Y)(tu.A,{size:16}),priority:"secondary",onClick:et,children:u("Back to current time")})}),t&&!w&&"in-view"!==z&&(0,r.Y)(C.I1,{position:"absolute",style:(0,i._)({left:16,right:16},"is-before"===z?{top:0}:{bottom:16}),children:(0,r.Y)(V.$n,{leading:"is-before"===z?(0,r.Y)(tc.A,{size:16}):(0,r.Y)(tu.A,{size:16}),priority:"secondary",onClick:en,children:u("Back to clipped segment")})}),f&&"in-view"!==H&&!t&&(0,r.Y)(C.Ye,{position:"absolute",justifyContent:"center",style:(0,i._)({left:0,right:0},"is-before"===H?{top:0}:{bottom:16}),children:(0,r.Y)(tC,{onClick:ei})})]})]})})},tA=(e,t)=>{for(let n=0;n=t)return n;if(t0?n-1:0}return e.length-1},tE="video-wrapper-lforaE",tN="preview-label-container-RuWmAN",tB="sidebar-NzGH2W",tM="sidebar--hidden-xMFnhp";class tR extends eG.A{constructor(...e){super(...e),(0,eU._)(this,"playbackEnabled",()=>!!this.props.showPreview)}}let tO=e=>{var t,n,a,s,c,u,p,m,g,v,{alternateAudioSource:f,audioIsPlaying:b,audioPlayerHasMounted:y,audioPlayerRef:w,containerRef:I,disableShortcuts:S,hasPaywall:D,isIdle:x,isPostPreview:T,mediaUpload:E,post:N,pub:B,selectedMedium:M,showAudioPaywall:R,showVideoPaywall:O,style:L,transcription:z,user:U,videoIsPlaying:H,videoPlayerRef:q,onChange:G,onCommentsClick:W,onFinishAudio:V,onSelectMedium:j,onSetAudioIsPlaying:X}=e,J=(0,eH._)(e,["alternateAudioSource","audioIsPlaying","audioPlayerHasMounted","audioPlayerRef","containerRef","disableShortcuts","hasPaywall","isIdle","isPostPreview","mediaUpload","post","pub","selectedMedium","showAudioPaywall","showVideoPaywall","style","transcription","user","videoIsPlaying","videoPlayerRef","onChange","onCommentsClick","onFinishAudio","onSelectMedium","onSetAudioIsPlaying"]);let{iString:Z}=(0,K.GO)(),Q=(0,A.lu)({pub:B}),{isClipping:$,onCancelClipping:ee}=(0,d.MC)(),[et,en]=(0,o.useState)(!1),ei=(0,eq.V)(),el=(0,o.useRef)(null),{width:er}=(0,eX.w)({containerRef:el}),[eo,ea]=(0,o.useState)(ei.active&&"undefined"!=typeof window?window.innerWidth:null!=(u=null==(t=el.current)?void 0:t.offsetWidth)?u:1100),[es,ed]=(0,eV.f)({key:"video_player:show_transcript",initialValue:!1}),ec=(es||$)&&!!z,{isMobile:eu}=(0,k.sM)(),ep=(0,F.AC)(I),eh=(null!=(p=E.preview_duration)?p:0)>0,[em,eg]=(0,o.useState)(!1),ev=ec?(eo-360-36)/eo:1,ef="post";return(0,o.useEffect)(()=>{$&&(0,_.u4)(_.qY.MEDIA_CLIP_CREATE_MODAL_OPENED,{video_upload_id:E.id,post_id:null==N?void 0:N.id,is_post_editor:!1,source:"create",surface:ef})},[$,E.id,null==N?void 0:N.id]),(0,o.useEffect)(()=>{ei.active&&"undefined"!=typeof window?setTimeout(()=>{ea(window.innerWidth)},10):ea(null!=er?er:1100)},[ei.active,er]),(0,r.FD)("div",{ref:el,className:P()(tE,{"video-full-screen-K4tmIj":ei.active}),style:L,children:[(0,r.FD)("div",{style:{visibility:"audio"===M?"hidden":void 0},children:[(0,r.Y)(eq.m,{handle:ei,children:(0,r.FD)(C.Ye,{justifyContent:"center",position:"relative",overflow:$?"visible":"hidden",style:{width:"100%",height:"100%",backgroundColor:"#000"},children:[(0,r.Y)(C.Ye,{flex:"grow",position:"relative",style:{transform:"scale(".concat(ev,")"),transformOrigin:"0 50%",transition:"transform 0.15s ease-in-out",zIndex:$?1:void 0},children:(0,r.Y)(tR,(0,l._)((0,i._)({},J),{ref:q,doNotResetOnEnd:!0,hidePlayButton:O,isClipping:$,mediaUpload:E,showPreview:!D||eh,noControls:!0,noKeyboardShortcuts:!0,stopPropagation:!0,post:N,pub:B,renderPlayButton:()=>(0,r.Y)(eJ.ro,{isPlaying:!1,size:eu?56:72}),usePreview:D&&eh,videoType:"post",onAutoplayMuted:()=>eg(!0)}))}),(0,r.Y)(C.Ye,{position:"absolute",style:{left:0,right:0,bottom:0,width:"".concat(100*ev,"%"),transition:"width 0.15s ease-in-out"},children:(0,r.Y)(e1.Jf,{disableShortcuts:S,handle:ei,hasPaywall:D,hasTranscript:!!z,hideNextVideoButton:T||Q,isActive:null!=(m=et||!x||$)&&m,isFocused:ep,mediaRef:q,mediaUpload:E,podcastUpload:null!=(g=null==(n=N.videoUpload)?void 0:n.extractedAudio)?g:N.podcastUpload,post:N,pub:B,showPaywall:O,showTranscript:ec,onShareMenuClose:()=>en(!1),onShareMenuOpen:()=>en(!0),onToggleShowTranscript:()=>{ed(!ec)},autoPlayMuted:em})}),z&&(0,r.Y)(C.Ye,{color:"white",opacity:100*!!ec,overflow:"auto",pointerEvents:ec?"auto":"none",position:"absolute",style:{top:0,bottom:0,right:0,transform:ec?"translateX(0)":"translateX(20%)",transition:ec?"transform 0.1s ease-in-out 0.05s, opacity 0.1s ease-in-out 0.05s":"transform 0.15s ease-in-out, opacity 0.15s ease-in-out",width:360,zIndex:$?1:void 0},children:(0,r.Y)(Y.Of,{children:(0,r.Y)(tn,{children:(0,r.Y)(tT,{isClipping:null!=$&&$,playerRef:q,postId:N.id,transcription:z,onClose:()=>{if($){var e;(0,_.u4)(_.qY.VIDEO_CLIP_CREATE_MODAL_CLOSED,{post_id:N.id,surface:ef}),H&&(null==(e=q.current)?void 0:e.player)&&q.current.player.pause(),ee()}else ed(!1)},surface:ef})})})})]})}),eh&&D&&!O&&(0,r.Y)("div",{className:tN,children:(0,r.Y)(e0.d,{children:Z("Preview")})}),(null==(a=q.current)?void 0:a.player)&&(0,r.Y)(eW.p,{containerRef:I,post:N,pub:B,visible:$,videoPlayerRef:q,videoUpload:E,surface:ef})]}),("audio"===M||y)&&f&&(0,r.Y)(C.pT,{inset:0,position:"absolute",style:{visibility:"audio"!==M?"hidden":void 0},children:(0,r.Y)(e4,{alternateAudioSource:f,audioPlayerRef:w,isIdle:x,hideControls:(H||b)&&x,post:N,pub:B,showPaywall:R,onFinishAudio:V,onSetAudioIsPlaying:X})}),!eu&&!O&&!T&&!Q&&(0,r.Y)("div",{className:P()(tB,"sidebar-right-ktL8if",{[tM]:(H||b)&&x}),children:(0,r.Y)(C.pT,{className:P()("sidebar-icons-YDR6ix"),bg:"glass-inverted-thick",paddingX:8,paddingY:16,children:(0,r.Y)(h.xx,{hideSavePost:!0,initialShareTimestamp:null!=(v=null==(c=q.current)||null==(s=c.player)?void 0:s.currentTime)?v:0,isStatic:!1,labelStyle:"counts-or-none",position:"shows-episode-player",post:N,pub:B,showClipping:!!N.videoUpload,variant:"large-on-dark",user:U,onChange:G,onCommentsClick:W})})}),f&&!Q&&(0,r.Y)("div",{className:P()(tB,"sidebar-left-K3vrOP",{[tM]:(H||b)&&x}),style:{zIndex:O?1:void 0},children:(0,r.Y)(te,{selected:M,sourceType:f.type,onSelect:j})})]})},tL=e=>{var t;let{audioPlayerRef:n,hasPaywall:a,isPostPreview:s,mediaUpload:d,post:c,pub:u,user:p,videoIsPlaying:h,videoPlayerRef:m,onFinishVideo:g,freeSignup:v,reaction_token:f}=e,Y=(0,eH._)(e,["audioPlayerRef","hasPaywall","isPostPreview","mediaUpload","post","pub","user","videoIsPlaying","videoPlayerRef","onFinishVideo","freeSignup","reaction_token"]),{isMobile:b}=(0,k.sM)(),{iString:y}=(0,K.GO)(),w=(0,A.lu)({pub:u}),I=(0,$.Ei)({post:c,pub:u,user:p}),[S,D]=(0,o.useState)(!1),[F,x]=(0,o.useState)(!1),[T,E]=(0,o.useState)(!1),N=(null!=(t=d.preview_duration)?t:0)>0,B=!!I&&!N&&a,[M,R]=(0,ej.k)({initialValue:B?"audio":"video",key:"initial_medium",type:"string",isArray:!1,disable:!I}),[O,L]=(0,o.useState)(B),z=(0,o.useRef)(null),{isIdle:U}=(0,eK.U)({idleAfter:2e3,element:z.current}),H="video"===M&&a&&(!N||F),q="audio"===M&&a&&S&&!!I&&"free_podcast_url"!==I.type,G=!(0,ee.Fr)(),W=e=>{var t,i;if(e===M)return;let l=(e,t)=>5>Math.abs(e-t),r=null==(t=m.current)?void 0:t.player,o=null==(i=n.current)?void 0:i.player;"audio"===e&&(null==r?void 0:r.currentTime)&&o?r.currentTime>0&&l(o.duration,r.duration)&&(o.currentTime=r.currentTime,r.paused||o.play()):"video"===e&&(null==o?void 0:o.currentTime)&&r&&o.currentTime>0&&l(o.duration,r.duration)&&(r.currentTime=o.currentTime,o.paused||r.play()),h&&(null==r||r.pause()),"video"===e&&o&&o.pause(),F&&(x(!1),r&&(r.currentTime=0)),"audio"!==e||O||L(!0),(0,_.u4)(_.qY.AUDIO_VIDEO_SWITCHER_CLICKED,{post_id:c.id,selected:e}),R(e)},V=()=>{D(!0)};return(0,r.FD)("div",{className:P()("container-dlhqPD",{"postPreview-mgizmD":s}),ref:z,children:[G?(0,r.Y)(tO,(0,l._)((0,i._)({},e),{alternateAudioSource:I,audioIsPlaying:T,audioPlayerHasMounted:O,audioPlayerRef:n,containerRef:z,isIdle:U,selectedMedium:M,showAudioPaywall:q,showVideoPaywall:H,videoIsPlaying:h,onFinishAudio:V,onFinishVideo:()=>{if((null==I?void 0:I.type)==="free_podcast_url"){var e,t;null==(t=document.getElementById(e5))||null==(e=t.parentNode)||e.dispatchEvent(new Event("mouseenter"))}x(!0)},onSelectMedium:W,onSetAudioIsPlaying:E})):(0,r.FD)("div",{className:P()(tE),children:[(0,r.Y)(tR,(0,l._)((0,i._)({},Y),{ref:m,doNotResetOnEnd:!0,hidePlayButton:H,mediaUpload:d,showPreview:!a||N,noControls:H&&!a,stopPropagation:!0,post:c,pub:u,renderPlayButton:()=>(0,r.Y)(eJ.ro,{isPlaying:!1,size:b?56:72}),usePreview:a&&N,onFinishVideo:g,style:{visibility:"audio"===M?"hidden":void 0}})),N&&a&&!H&&"video"===M&&(0,r.Y)("div",{className:tN,children:(0,r.Y)(e0.d,{children:y("Preview")})}),("audio"===M||O)&&I&&(0,r.Y)(C.Ye,{position:"absolute",inset:0,style:{visibility:"audio"===M?"visible":"hidden"},children:(0,r.Y)(e4,{alternateAudioSource:I,audioPlayerRef:n,hideControls:!1,isIdle:U,post:c,pub:u,showPaywall:q,onFinishAudio:V,onSetAudioIsPlaying:E})}),I&&!w&&(0,r.Y)(C.Ye,{position:"absolute",padding:12,onClick:()=>{W("audio"===M?"video":"audio")},style:{top:"50%",left:0,transform:"translateY(-50%)",visibility:"video"===M&&h&&U?"hidden":"visible"},children:(0,r.Y)(te,{selected:M,sourceType:I.type,onSelect:null})})]}),H&&(0,r.Y)(e6.v,{disableButtons:s,isFreeSubscribed:!!((null==p?void 0:p.is_free_subscribed)||v),medium:"video",post:c,pub:u,variant:"dialog",onRestart:N?()=>{var e;(null==(e=m.current)?void 0:e.player)&&(x(!1),m.current.player.currentTime=0,m.current.player.play())}:void 0,magicToken:f}),q&&(0,r.Y)(e6.v,{disableButtons:s,isFreeSubscribed:!!((null==p?void 0:p.is_free_subscribed)||v),medium:"audio",post:c,pub:u,variant:"dialog",onRestart:()=>{var e;(null==(e=n.current)?void 0:e.player)&&(D(!1),n.current.player.currentTime=0,n.current.player.play())},magicToken:f})]})};var tz=n(56458);let tU=(0,o.forwardRef)((e,t)=>{var n;let{isServingFreePodcastUrl:a,paywall:S,post:x,pub:P,reaction_token:T,recentEpisodes:N,showComments:B,user:M,videoPlayerRef:R,onChange:O,freeSignup:L}=e,{getConfigFor:z}=(0,v.mJ)(),U=(0,f.Qg)().autoPlayVideo,{isMobile:H}=(0,k.sM)(),[q,G]=(0,o.useState)(null),[W,K]=(0,o.useState)(null),[V,j]=(0,o.useState)(()=>"undefined"!=typeof window&&eA(window.location.href)),[X,J]=(0,o.useState)(!1),[Z,Q]=(0,o.useState)(!1),ee=(0,o.useRef)(null),{isClipping:et,onStartClipping:en}=(0,d.MC)(),ei=(0,tz.NJ)(x),el=(0,A.lu)({pub:P}),er=!!z("hide_post_sidebar"),eo=!S||(0,A.NO)({pub:P});el&&(eo=eo&&!!z("thefp_enable_transcripts"));let es=(null==ei?void 0:ei.approved_at)&&eo,{isPlaying:ed}=(0,b.yr)(R),ec=e=>{(0,_.u4)(_.qY.TRANSCRIPTION_TOGGLED,{state:e?"expanded":"collapsed",post_id:x.id,transcript_as_content:!0}),j(e)};(0,o.useEffect)(()=>{if("undefined"==typeof window)return;let e=window.location.href;eA(e)&&(0,w.qm)(eT),(0,eP.m)(e).clippingMode&&(setTimeout(()=>{en({source:"query-param",title:null})},10),(0,w.qm)("clippingMode"))},[en]);let eu=x.section_id&&null!=(n=P.sections.find(e=>e.id===x.section_id))?n:null,{feedUrl:ep,isPrivateFeed:eh}=(0,F.Zq)({pub:P,magicToken:T,user:null!=M?M:null,section:eu}),em=(0,$.Em)({pub:P,section:eu,spotifySettings:(0,y.Om)({pub:P,section:eu})}),eg=(0,tz.rI)({post:x,section:eu,pub:P}),ev=(0,tz.Xk)({post:x,section:eu,pub:P}),ef=!!q&&q.length>0,eY=e=>{e.preventDefault(),(0,_.u4)(_.qY.COMMENTS_CLICKED,{post_id:x.id});let t=document.getElementById($.R4);t&&t.scrollIntoView({behavior:"smooth"})};(0,o.useEffect)(()=>{(async()=>{let e=await s().get("/api/v1/post/".concat(x.id,"/facepile"));G(e.body.reactors),K(e.body.restackers)})()},[x.id]);let eb=!1;return"undefined"!=typeof window&&(eb=new URLSearchParams(window.location.search).has("postPreview")),(0,r.Y)(u.L4,(0,l._)((0,i._)({},e),{ref:t,isShowsPost:!0,renderContent:e=>{let{comments:t,crossPostInfo:n,postContent:i}=e;return(0,r.FD)("div",{children:[(0,r.Y)(D,{visible:et,style:{zIndex:1}}),x.videoUpload?(0,r.Y)(tL,{audioPlayerRef:ee,autoPlay:U,disableShortcuts:Z||et,duration:x.videoUpload.duration,hasPaywall:null!=S&&S,isClipping:et,isPostPreview:eb,mediaUpload:x.videoUpload,post:x,pub:P,freeSignup:L,reaction_token:T,restorePlaybackLocation:!eb,transcription:es?ei:null,user:null!=M?M:null,videoIsPlaying:ed,videoPlayerRef:R,onChange:O,onCommentsClick:eY,surface:"post",entityKey:x.id,entityType:"post",contentType:"post"}):(0,r.Y)(E,{audioPlayerRef:ee,feedUrl:ep,hasPaywall:null!=S&&S,isPrivateFeed:eh,isServingFreePodcastUrl:a,post:x,pub:P,section:eu,user:null!=M?M:null,freeSignup:L,onChange:O,onCommentsClick:eY,reaction_token:T}),(0,r.FD)("div",{className:el?"mainContentFP-GnDHcW":"main-content-and-sidebar-fw1PHW",children:[(0,r.FD)("div",{className:el?"":X?"main-content-full-width-eYkBTb":"main-content-qKkUCg",children:[(el||!V||!es)&&(0,r.Y)(ea,{feedUrl:ep,isStandaloneVideo:eg,eligibleForPodcast:ev,magicToken:T,post:x,pub:P,section:eu,showLinks:em,user:null!=M?M:null,onChange:O,onCommentsClick:eY,onToggleRestackModal:Q,onTranscriptClick:es?()=>ec(!V):void 0}),el&&(0,r.Y)(I.c,{}),(!V||!es)&&(0,r.FD)(C.I1,{gap:16,paddingTop:16*!el,children:[el&&(0,r.Y)(g.L,{post:x,pub:P,user:null!=M?M:null,variant:"shows-post"}),n&&(0,r.Y)(c.k,{crossPostInfo:n,postType:x.type}),(0,r.FD)("div",{className:"postContentWrapper-MYe7fH",children:[i,el?(0,r.Y)(C.I1,{paddingTop:40,paddingBottom:20,children:(0,r.Y)(m.u,{post:x,pub:P,user:M})}):z("like_posts_enabled")&&P.community_enabled&&ef&&!S&&(0,r.Y)(C.pT,{borderTop:"detail-themed",paddingY:16,children:(0,r.Y)(p.d2,{post:x,pub:P,user:M,reactors:q,secondaryFaces:W})}),!S&&B&&t]})]}),V&&es&&(0,r.Y)(C.Ye,{paddingTop:el?24:X?32:void 0,children:(0,r.Y)(Y.Of,{children:(0,r.Y)(eL,{fullWidth:X,isPublicationContributor:!!(null==M?void 0:M.is_contributor),playerRef:x.videoUpload?R:ee,post:x,transcription:ei,onClose:()=>{ec(!1),J(!1)},onCollapse:()=>J(!1),onExpand:()=>J(!0),showExpandButton:!el})})})]}),!X&&!el&&!er&&(0,r.Y)(C.I1,{className:"sidebar-RUDMha",borderLeft:H?void 0:"detail-themed",children:(0,r.Y)(ew,{feedUrl:ep,isStandaloneVideo:eg,eligibleForPodcast:ev,post:x,pub:P,recentEpisodes:null!=N?N:null,section:eu,showLinks:em,user:null!=M?M:null})})]}),H&&!el&&(0,r.Y)(h.I2,{allowEdit:null==M?void 0:M.is_contributor,hideComments:!B,isStatic:!1,post:x,postReactionToken:T,pub:P,user:M,onCommentsClick:eY,onChange:O})]})}}))}),tH=(0,o.forwardRef)((e,t)=>{let n=(0,o.useRef)(null),a=(0,o.useRef)(null);return(0,r.Y)(d.UQ,{postId:e.post.id,videoPlayerRef:n,virtualizedListRef:a,children:(0,r.Y)(tU,(0,l._)((0,i._)({},e),{ref:t,videoPlayerRef:n}))})})},73030:function(e,t,n){n.d(t,{Ew:()=>a,kN:()=>s});var i=n(79785);function l(){let e=(0,i._)(["#"," in ",""]);return l=function(){return e},e}function r(){let e=(0,i._)(["#"," New bestseller"]);return r=function(){return e},e}function o(){let e=(0,i._)(["#"," Rising in ",""]);return o=function(){return e},e}let a=25,s=(e,t)=>{let{iTemplate:n}=I18N.i(t);return"paid"===e.ranking?n(l(),e.rank,e.category_name):"bestseller"===e.category_id?n(r(),e.rank):n(o(),e.rank,e.category_name)}},19601:function(e,t,n){n.d(t,{A:()=>l});var i=n(56262);let l=(e,t,n,l,r)=>!(!r&&!(null==e?void 0:e.has_publication)||l.invite_only||(0,i.isPaidAudience)(n.audience))&&!!t.enable_restacking},85520:function(e,t,n){n.d(t,{B9:()=>i});let i="choose_handle"},86007:function(e,t,n){n.d(t,{JQ:()=>i});let i=["none","xs","sm","md","lg","full"];[...new Set(["block_ai_crawlers","credit_token_enabled","custom_tos_and_privacy","did_identity","disable_optimistic_bank_payments","display_welcome_page_details","enable_meetings","payment_pledges_enabled","enable_drop_caps","enable_post_page_conversion","enable_prev_next_nav","enable_restacking","gifts_from_substack_disabled","google_analytics_4_token","group_sections_and_podcasts_in_menu_enabled","live_stream_homepage_visibility","live_stream_homepage_style","live_stream_replay_enabled","medium_length_description","notes_feed_enabled","paywall_unlock_tokens","post_preview_crop_gravity","post_preview_radius","reader_referrals_enabled","reader_referrals_leaderboard_enabled","seen_coming_soon_explainer","seen_google_analytics_migration_modal","local_currency_modal_seen","local_payment_methods_modal_seen","twitter_pixel_signup_event_id","twitter_pixel_subscribe_event_id","use_local_currency","welcome_page_opt_out_text","cookie_settings","show_restacks_below_posts","holiday_gifting_post_header","homepage_message_text","homepage_message_link","about_us_author_ids","archived_section_ids","column_section_ids","fp_primary_column_section_ids","event_section_ids","podcasts_metadata","video_section_ids","post_metering_enabled","use_custom_theme"])]},22092:function(e,t,n){n.d(t,{Eu:()=>o,_Y:()=>s,o1:()=>a});var i=n(4016),l=n(39318),r=n(49807);let o=e=>{let{pub:t,section:n}=e;return(0,i.lu)({pub:t})&&!!n&&"the-free-press-live"===n.slug},a=e=>"".concat((0,r.$_T)(e),"/settings?tab=subscription&open_change_plan=true"),s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,l.a7q)({for_pub:e.subdomain,justTrying:!0,redirect:(0,l.eV6)(e,t)})}},17031:function(e,t,n){n.d(t,{DK:()=>c});var i=n(69277),l=n(70408),r=n(11993),o=n(95147),a=n(41245);let s={large:{desktop:{charactersTruncateTo:800,charactersTruncateIfOver:860,linesTruncateTo:8,linesTruncateIfOver:9},mobile:{charactersTruncateTo:440,charactersTruncateIfOver:500,linesTruncateTo:8,linesTruncateIfOver:9}},medium:{desktop:{charactersTruncateTo:500,charactersTruncateIfOver:560,linesTruncateTo:6,linesTruncateIfOver:8},mobile:{charactersTruncateTo:320,charactersTruncateIfOver:420,linesTruncateTo:6,linesTruncateIfOver:8}},small:{desktop:{charactersTruncateTo:340,charactersTruncateIfOver:400,linesTruncateTo:4,linesTruncateIfOver:6},mobile:{charactersTruncateTo:210,charactersTruncateIfOver:210,linesTruncateTo:4,linesTruncateIfOver:4}}},d={desktop:{TRUNCATED_LINES:32,TRUNCATED_CHARACTERS:2400},mobile:{TRUNCATED_LINES:20,TRUNCATED_CHARACTERS:1e3}};function c(e,t){var n,c,u,p;let{truncationProfile:h="medium",isMobile:m}=t,{charactersTruncateTo:g,charactersTruncateIfOver:v,linesTruncateTo:f,linesTruncateIfOver:Y}=s[c=e,"small"!==(u=h)&&(null==(p=c.attachments)?void 0:p.length)?"small":u][m?"mobile":"desktop"],b=function e(t){let n=null;if(t)if(n=(0,l._)((0,i._)({},t),{content:void 0,text:void 0}),null==t?void 0:t.content)for(let i of(n.content=[],t.content)){let t=e(i);t&&n.content.push(t)}else{var o,a;let e=null==(o=t.marks)?void 0:o.find(e=>"link"===e.type);(null==e||null==(a=e.attrs)?void 0:a.href)?n.text=(0,r.H)(e.attrs.href):n.text=t.text}return n}(null!=(n=null==e?void 0:e.body_json)?n:(null==e?void 0:e.body)?{type:"doc",attrs:{schemaVersion:"v1"},content:e.body.split("\n\n").map(e=>({type:"paragraph",content:[{type:"text",text:e}]}))}:null),_=(0,o.B)(b)>v,y=(0,o.M)(b)>Y;if(!b||!(_||y))return{bodyJson:b,truncatedBodyJson:b,isTruncated:!1,shouldExpandInline:!1};let w=b,k=!1,I=0;if(_){let e=(0,a.x)(w,{limit:g});w=e.doc,k=e.isTruncated,I=(0,o.B)(b)-(0,o.B)(w)}let C=!1,S=0;if(y&&w){let e=(0,a.Z)(w,f);w=e.doc,C=e.isTruncated,S=(0,o.M)(b)-(0,o.M)(w)}return{bodyJson:b,truncatedBodyJson:w,isTruncated:k||C,shouldExpandInline:S