"use strict";(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["8790"],{89451:function(e,t,i){i.d(t,{Z:()=>n});let n={placeholder:"placeholder-lQYQJg",placeholderMessage:"placeholderMessage-GZJPyX"}},77686:function(e,t,i){i.d(t,{Z:()=>n});let n={button:"button-NT7dt3",avatarWithPubLogo:"avatarWithPubLogo-FS3Qv7",avatar:"avatar-mn4drz",pubLogo:"pubLogo-cMWGpU",displayedBadge:"displayedBadge-gAo5ie",pubAvatar:"pubAvatar-QXvrAG",offer:"offer-BpTfs_",unavailable:"unavailable-hONyuw",description:"description-Ca932u",check:"check-lUurJO",disabledCheck:"disabledCheck-I9na7Z",originalPrice:"originalPrice-GLByyh",closeButton:"closeButton-l2SNve"}},54416:function(e,t,i){i.d(t,{Z:()=>n});let n={visitedSurfacesIFrame:"visitedSurfacesIFrame-yy8AJL"}},93974:function(e,t,i){i.d(t,{Jg:()=>em,Q4:()=>eL,V8:()=>eX,mZ:()=>te,qp:()=>eg,rk:()=>eU,xn:()=>ta});var n=i(7409),r=i(99282),o=i(98848),a=i(58865),l=i(16584),s=i(6400),c=i(30396),d=i(94184),u=i.n(d),p=i(28175),h=i.n(p),m=i(10293),g=i(28058),v=i(88812),f=i(85200),b=i(45609),_=i(99869),y=i(26141),Z=i(7617),w=i(47976),k=i(7073),C=i(49770),S=i(17048),B=i(27194),x=i(887),I=i(2564),P=i(13639),N=i(77747),T=i(36412),E=i(51534),X=i(45530),L=i(3880);i(20888);var F=i(28905),R=i(19548),M=i(95441),U=i(60807),A=i(37663),D=i(67348),O=i(68833),z=i(15367),j=i(48980),H=i(12799),W=i(98914),q=i(94874),Y=i(17540),V=i(15771),J=i(80026),K=i(36500),G=i(84747),Q=i(63474),$=i(43570),ee=i(70379),et=i(33451),ei=i(16913),en=i(32223),er=i(97842),eo=i(11308);i(70125);var ea=i(64172),el=i(76820),es=i(23398),ec=i(63651),ed=i(32440),eu=i(23710),ep=i(77859);function eh(){let e=(0,a._)(["You are not allowed to post or react to this chat. ",""]);return eh=function(){return e},e}function em(e){var t,i,n;let{communityPost:r,author:o,pubRole:a,extras:s,withAttribution:d,flex:u,hideReply:p,isReadOnly:h,onReply:g,onDelete:v,pub:f,truncate:b=!0,surface:_,useClientSideRouting:y,utmSource:Z,isPaid:w,isFounding:k}=e,{iString:C}=(0,M.M1)(),S=(0,c.sO)(null),B=y?(0,ec.xC8)({pubId:r.publication_id,postId:r.id,noBase:!0}):(0,ec._5K)({postId:r.id,utm_source:Z}),x=(0,eo.o)({entityType:"communityPost",publication:f}),I=(0,R.KG)(r.user_id);return(0,l.BX)(eO,{pubThemeAccentColor:null!==(n=null==f?void 0:null===(t=f.theme)||void 0===t?void 0:t.background_pop_color)&&void 0!==n?n:null==f?void 0:f.theme_var_background_pop,pubThemePrintOnPopColor:null==f?void 0:null===(i=f.theme)||void 0===i?void 0:i.print_on_pop,user:o,pubRole:a,flex:u,containerRef:S,extras:s,children:[d&&(0,l.tZ)(ta,{text:"From ".concat(o.name,"’s subscriber chat")}),!I&&(0,l.tZ)(et.KV,{user:o}),(0,l.tZ)(ef,{actionMenuProps:{communityEntity:r,publicationId:r.publication_id,replyAction:g&&!p&&(0,l.tZ)(G.u,{leading:(0,l.tZ)(m.Z,{}),disabled:r.is_locked,onClick:g,children:C("Reply")}),onReply:h||p||r.is_locked?void 0:g,onDelete:v,onReport:x,isReadOnly:h,isFlagged:r.reported_by_user},flex:u,children:(0,l.tZ)(eg,{communityPost:r,hideReply:p,userBlockStatus:I,isFounding:k,isPaid:w,isReadOnly:h,useClientSideRouting:y,utmSource:Z,pub:f,truncate:b,surface:_,author:o})}),!p&&(0,l.tZ)(Q.A0,{href:B,children:(0,l.tZ)(te,{onClick:g,direction:"incoming",commenters:r.recent_commenters,count:r.comment_count,hasUnread:!!(r.most_recent_comment_created_at&&r.user_last_viewed_timestamp&&r.user_last_viewed_timestamp0||S),x=null!=b?b:{type:"posts",id:t.id},{audience:I}=t,{canReply:P,shouldShowToken:N}=tn({audience:I,isFounding:s,isPaid:c,chatPaywallStatus:null==d?void 0:d.paywall_chat}),T=(0,er.I0)(),E=m?(0,ec.xC8)({pubId:t.publication_id,postId:t.id,noBase:!0,params:{backAction:w}}):(0,ec._5K)({postId:t.id,utm_source:g}),X=function(e,t){if(!e||!(null==t?void 0:t.url))return e;let i=t.url,n=e.trim();return n.startsWith(i)?n.slice(i.length).trim():n.endsWith(i)?n.slice(0,-i.length).trim():e}(t.body,t.link_metadata),F=e=>{"feed-recommended"!==x.type&&(_?_({id:t.id,reaction:e}):eb(t.id,"posts",T,t.reaction)(e))},R=null!=y?y:t.reaction,M=null!=Z?Z:t.reactions,U=p&&(p.startsWith("chat_inbox")?"chat_inbox":(0,A.T)(p));return(0,l.BX)(e4,{hasFooter:!i,children:[!o&&"media"===t.type&&(C.length>0||S)&&(0,l.BX)(en.c,{context:x,reactions:M,currentReaction:R,onReactionClick:F,isReadOnly:a,children:[S&&(0,l.tZ)(el.Jl,{mediaUpload:S.mediaUpload,composing:!1,maxWidth:400,videoPlayerProps:{surface:U,entityType:"community_post",entityKey:t.id,contentType:"communityPost",primaryEntityKey:h,primaryEntityType:h?"post":void 0}},S.mediaUpload.id),C&&(0,l.BX)(J.xu,{children:[(0,l.tZ)(L.E,{assets:C.filter(e=>e.url).map(e=>({src:e.url,explicit:e.explicit,width:e.width,height:e.height})),className:u()(ed.Z.imageGroup,i&&!t.body&&ed.Z.isLast),maxWidth:400,maxHeight:420,readOnly:a,isContained:!0,outline:k}),N&&!t.body&&(0,l.tZ)(e3,{className:ed.Z.right,canReply:!!P,audience:t.audience,style:"media"})]})]}),!o&&t.link_metadata&&(0,l.tZ)(en.c,{context:x,reactions:M,currentReaction:null!=y?y:t.reaction,onReactionClick:F,setReactions:!!(B&&t.link_metadata),isReadOnly:a,alignSelf:"stretch",children:(0,l.tZ)(et.xk,{metadata:t.link_metadata,isFirst:B,direction:"incoming"})}),(t.body||B&&!t.link_metadata)&&(0,l.tZ)(en.c,{context:x,reactions:M,currentReaction:null!=y?y:t.reaction,onReactionClick:F,setReactions:B&&!t.link_metadata,isReadOnly:a,alignSelf:"stretch",children:X&&(0,l.tZ)(Q.A0,{href:E,style:{display:"flex"},children:(0,l.tZ)(e8,{publication:d,communityEntity:(0,r._)((0,n._)({},t),{body:X}),onClick:e=>{!e.defaultPrevented&&f&&f(e)},truncate:v,isPaid:c,isFounding:s,outline:k})})})]})}let ev=e=>{let t=[],i=null;for(let n of e)"image"===n.type?t.push(n):i||(i=n);return{images:t,video:i}};function ef(e){let{children:t,actionMenuProps:i,flex:r="grow"}=e;return(0,l.BX)(J.gq,{alignItems:"start",gap:12,flex:r,children:[(0,l.tZ)(et.pc,{children:t}),(0,l.tZ)(eH,(0,n._)({},i))]})}let eb=(e,t,i,n)=>async r=>{n===r?i(ey(r,e,t)):i(e_(r,e,t,n))},e_=(e,t,i,n)=>async(r,o)=>{let{iString:a,iTemplate:l}=I18N.i("en");r({type:"".concat(i,"-new_reaction"),payload:{id:t,reaction:e}});let s=await (0,N.oQ)(e,t,i);if(s instanceof j.kp){var c,d;(null===(c=s.body)||void 0===c?void 0:c.status)==="PUBLICATION_BAN"?alert(l(eh(),null===(d=s.body)||void 0===d?void 0:d.error)):alert(a("We failed post your reaction. Please try again later."))}else(0,z.H)(s,{message:"Failed to add reaction"});s instanceof Error&&r(n?{type:"".concat(i,"-new_reaction"),payload:{id:t,reaction:n}}:{type:"".concat(i,"-remove_reaction"),payload:{id:t,reaction:e}})},ey=(e,t,i)=>async(n,r)=>{n({type:"".concat(i,"-remove_reaction"),payload:{id:t,reaction:e}}),await (0,N.aQ)(e,t,i) instanceof Error&&n({type:"".concat(i,"-new_reaction"),payload:{id:t,reaction:e}})},eZ=(e,t)=>async(i,n)=>{i({type:"posts-delete_post",payload:{id:e,publication_id:t}});let r=await eE(e);r instanceof Error&&console.warn("error deleting thread",r)},ew=(e,t,i)=>async(n,r)=>{n({type:"comments-delete_comment",payload:{id:e,postId:t}});let o=await eP(e);if(o instanceof Error&&console.warn("error deleting comment",o),i){let e=await eN(i);e instanceof Error||n({type:"comments-update_comment",payload:{id:i,comment:e.comment}})}let a=await eT(t);a instanceof Error||n({type:"posts-update_post",payload:{id:t,post:a.communityPost}})},ek=(e,t)=>async(i,n)=>{i({type:"posts-lock_replies",payload:{id:e,isLocked:t}});let r=await eB(e,t);r instanceof Error&&(console.warn("error locking post",r),alert("There was an error ".concat(t?"locking":"unlocking"," replies to this post. Please try again later.")),i({type:"posts-lock_replies",payload:{id:e,isLocked:!t}}))},eC=(e,t)=>async(i,n)=>{i({type:"comments-lock_replies",payload:{id:e,isLocked:t}});let r=await ex(e,t);r instanceof Error&&(console.warn("error locking comment",r),alert("There was an error ".concat(t?"locking":"unlocking"," replies to this comment. Please try again later.")),i({type:"comments-lock_replies",payload:{id:e,isLocked:!t}}))},eS=(e,t)=>async(i,n)=>{i({type:"comments-ban_author",payload:{id:e,ban:t}});let r=await eI(e,t);r instanceof Error&&(console.warn("error toggling ban for comment author",r),alert("There was an error ".concat(t?"banning":"unbanning"," this user. Please try again later.")),i({type:"comments-ban_author",payload:{id:e,ban:!t}}))};async function eB(e,t){try{return await fetch("/api/v1/community/posts/".concat(e),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({is_locked:t})})}catch(e){return e}}async function ex(e,t){try{return await fetch("/api/v1/community/comments/".concat(e),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({is_locked:t})})}catch(e){return e}}async function eI(e,t){try{return await fetch("/api/v1/community/comments/".concat(e,"/publication_bans?ban=").concat(t.toString()),{method:"POST"})}catch(e){return e}}async function eP(e){try{return await (0,j.rd)("/api/v1/community/comments/".concat(e),{method:"DELETE",json:{commentId:e}})}catch(e){return e}}async function eN(e){try{return await (0,j.rd)("/api/v1/community/comments/".concat(e),{method:"GET"})}catch(e){return console.warn(e),e}}async function eT(e){try{return await (0,j.rd)("/api/v1/community/posts/".concat(e),{method:"GET"})}catch(e){return console.warn(e),e}}async function eE(e){try{return await (0,j.rd)("/api/v1/community/posts/".concat(e),{method:"DELETE",json:{postId:e}})}catch(e){return e}}function eX(e){let{author:t,extras:i,showReply:o=!0,analyticsParams:a,commenters:s,count:d,audience:u,paywallInfo:p,onClick:h}=e;return(0,c.d4)(()=>{var e;a&&(0,O.j)(O.FP.THREAD_PAYWALL_SCREEN_VIEWED,(0,r._)((0,n._)({},a),{audience:u&&("only_founding"===(e=u)?"founding":"only_paid"===e?"paid":"free")}))},[]),(0,l.BX)(eO,{user:t,extras:i,children:[t&&(0,l.tZ)(et.KV,{user:t}),(0,l.BX)(e4,{children:[p?(0,l.tZ)(tr,{audience:u,paywallInfo:p,onClick:h}):(0,l.tZ)(tt,{audience:u,onClick:h}),o&&(0,l.tZ)(te,{isLocked:!0,direction:"incoming",commenters:s,count:d,onClick:h})]})]})}function eL(e){let{author:t,extras:i,showReply:n=!0,commenters:r,count:o}=e;return(0,l.tZ)(eO,{user:t,extras:i,children:(0,l.BX)(e4,{children:[(0,l.tZ)(ti,{}),n&&(0,l.tZ)(te,{isLocked:!0,direction:"incoming",commenters:r,count:o})]})})}function eF(e){return"string"==typeof e.message}function eR(e){let{text:t,rawText:i,specialText:n,mentionMap:r,direction:o="incoming",limit:a=600,linkify:s=!0}=e,{iString:d}=(0,M.M1)(),[p,h]=(0,c.eJ)(!1);if(n)return(0,l.tZ)("em",{children:n});if(!t)return(0,l.tZ)(l.HY,{});let m=[{characters:t.length,message:t}];i&&r&&(m=function(e,t,i){let n=/\$\{(\d+)\}/g,r=n.exec(e),o=[],a=0;for(;r;){var s,c,d,u;let p=t[Number(r[1])],h=p.text.slice(1);p?(r.index>a&&o.push({characters:r.index-a,message:e.slice(a,r.index)}),o.push({characters:p.text.length,message:(s=p.user_id,c=0,d=h,u=i,(0,l.tZ)(D.p,{id:s,label:d,type:"user",unstyled:"outgoing"===u}))})):o.push({characters:n.lastIndex-a,message:e.slice(a,n.lastIndex)}),a=n.lastIndex,r=n.exec(e)}return at&&eF(e)){let n=t-i,o={characters:n,message:e.message.slice(0,n)},a={characters:e.characters-n,message:e.message.slice(n)};e=o,r.push(a)}i+=e.characters,n.push(e)}else r.push(e)}return{alwaysShow:n,afterExpansion:r}}(m,a),f=v.length>0;return(0,l.BX)(l.HY,{children:[g.map(e=>s&&eF(e)?(0,l.tZ)(eM,{children:e.message}):e.message),f&&!p&&(0,l.BX)(l.HY,{children:[(0,l.tZ)("span",{children:" "}),(0,l.tZ)(V.kG,{resetCss:!0,className:u()(ed.Z.readMore,ed.Z[o]),onClick:e=>{e.preventDefault(),h(!0)},children:d("See more")})]}),f&&p&&(0,l.tZ)(l.HY,{children:v.map(e=>s&&eF(e)?(0,l.tZ)(eM,{children:e.message}):e.message)})]})}function eM(e){let{children:t}=e;return(0,l.tZ)(h(),{options:{attributes:{rel:"nofollow ugc",onClick:e=>e.stopPropagation()},className:ed.Z.textLink,format:(e,t)=>"url"===t?(0,es.u)(e,64):e},children:t})}function eU(e){var{communityComment:t,quoteReply:i,isTargeted:r,isBanned:a,pubRole:s,isNew:c,error:d}=e,u=(0,o._)(e,["communityComment","quoteReply","isTargeted","isBanned","pubRole","isNew","error"]);return(0,l.tZ)(eA,(0,n._)({isTargeted:r,isNew:c,comments:[{communityComment:t,quoteReply:i,isBanned:a,pubRole:s,isNew:c,error:d}]},u))}function eA(e){let{comments:t,author:i,isNew:n,chatPublicationId:r,hideReply:o,onReply:a,onNewQuote:c,onQuoteReplyClick:d,onDelete:u,commentRef:p,isTargeted:h,isReadOnly:m,chatAuthorNameAttribution:v,extras:f,flex:b,pub:_}=e,y=(0,er.I0)(),Z=t[t.length-1].communityComment,{reply_count:w=0,recent_commenters:k=[]}=null!=Z?Z:{},C=(0,eo.o)({entityType:"communityComment",publication:_}),S=!o&&w>0,B=t[0],{communityComment:x}=B;return(0,l.BX)(eO,{user:i,pubRole:t[0].pubRole,containerRef:p,id:"comment-".concat(null==Z?void 0:Z.id),flex:b,extras:f,children:[v&&(0,l.tZ)(ta,{text:"Comment from ".concat(v,"’s subscriber chat")}),(0,l.tZ)(ef,{actionMenuProps:{communityEntity:x,isBanned:B.isBanned,isFlagged:x.reported_by_user,replyAction:a&&(0,l.tZ)(G.u,{disabled:!!x.is_locked,onClick:a,leading:(0,l.tZ)(g.Z,{}),children:"Reply in ".concat(0===w?"a new":"","thread")}),onDelete:u,onNewQuote:c,onReport:C,isReadOnly:m,publicationId:r,isNew:n},flex:b,children:(0,l.tZ)(e4,{hasFooter:S,children:t.map((e,i)=>{var n,r;let{communityComment:{id:o,body:c,quote_id:u,media_uploads:p,reactions:g,reaction:v,reported_by_user:f},quoteReply:b,isNew:_,error:Z}=e;return(0,l.BX)(s.Fragment,{children:[!_&&!f&&p&&p.length>0&&null===u&&(0,l.BX)(en.c,{context:{type:"comments",id:o},reactions:g,currentReaction:v,onReactionClick:eb(o,"comments",y,v),isReadOnly:m||_,children:[(0,l.tZ)(F.z,{mediaAssets:(null!=p?p:[]).filter(e=>e.media_upload_id).map(e=>({media_upload_id:e.media_upload_id})),surface:"chat_inbox",entityType:"community_comment",entityKey:o,contentType:"communityComment"}),(0,l.tZ)(L.E,{assets:p.filter(e=>e.url).map(e=>({src:e.url,explicit:!!e.is_explicit,width:e.image_width,height:e.image_height})),className:ed.Z.ImageGrid,maxWidth:400,maxHeight:420,readOnly:m,isContained:!0})]}),c&&(0,l.tZ)(en.c,{context:{type:"comments",id:o},reactions:g,currentReaction:v,onReactionClick:eb(o,"comments",y,v),setReactions:!p||0===p.length,isReadOnly:m||_,children:(0,l.BX)(e2,{isTargeted:h,onClick:a,children:[b&&(0,l.tZ)(e9,{body:b.comment.body,author:null!==(r=null===(n=b.user)||void 0===n?void 0:n.name)&&void 0!==r?r:"",onClick:d,direction:"outgoing"}),(0,l.tZ)(e7,{communityEntity:t[i].communityComment})]})}),Z&&(0,l.tZ)(J.xv.B5,{color:"error",children:"\uDBC0\uDC5F Not delivered."})]},o)})})}),S&&(0,l.tZ)(te,{direction:"incoming",commenters:k,count:w,onClick:a})]})}function eD(e){return void 0===e.post_id}function eO(e){var t;let{user:i,children:n,extras:r,flex:o="grow",containerRef:a,id:s,pubRole:c,pubThemeAccentColor:d,pubThemePrintOnPopColor:p}=e,h=(0,R.KG)(null!==(t=null==i?void 0:i.id)&&void 0!==t?t:0);return(0,l.BX)(J.tu,{id:s,flex:o,gap:2,ref:a,className:u()(eu.Z.reactionsHoverZone,ed.Z.avatarContainer),children:[(0,l.BX)(J.hs,{alignItems:"end",gap:12,children:[(0,l.tZ)(J.hs,{paddingTop:4,children:h?(0,l.tZ)(ez,{user:i}):i?(0,l.tZ)(tl,{pubThemeAccentColor:d,pubThemePrintOnPopColor:p,user:i,pubRole:c,size:32}):(0,l.tZ)(ej,{})}),(0,l.tZ)(J.tu,{flex:"grow",gap:2,position:"relative",alignItems:"start",children:n})]}),r&&(0,l.BX)(J.hs,{gap:12,children:[(0,l.tZ)(J.xu,{width:32}),(0,l.tZ)(J.tu,{flex:"grow",gap:4,children:r})]})]})}function ez(e){let{user:t}=e;return(0,l.tZ)(Q.A0,{href:t?(0,ec.NNq)(t,{noBase:!0}):void 0,children:(0,l.tZ)(ej,{children:(0,l.tZ)(v.Z,{size:20,color:"var(--color-fg-tertiary)"})})})}let ej=(0,Q.zo)({radius:"full",width:32,height:32,bg:"secondary"},Q.M5);function eH(e){var{isNew:t}=e,i=(0,o._)(e,["isNew"]);if(t)return null;let{onNewQuote:r,onReply:a,communityEntity:s}=i;return(0,l.BX)(J.hs,{alignItems:"center",gap:4,className:ed.Z.actions,children:[r&&s&&(0,l.tZ)(eq,{onNewQuote:r,communityComment:s}),a&&s&&(0,l.tZ)(eY,{onReply:a}),(0,l.tZ)(G.M,{trigger:(0,l.tZ)(V.hU,{"aria-label":"Options",size:"sm",priority:"tertiary",children:(0,l.tZ)(f.Z,{size:20})}),hideOnScroll:!0,children:(0,l.tZ)(eW,(0,n._)({},i))})]})}function eW(e){let{communityEntity:t,replyAction:i,onDelete:n,onReport:r,isReadOnly:o,publicationId:a,isBanned:s,isFlagged:c,onNewQuote:d}=e,u=(0,U.aF)(),{isAuthor:p}=(0,ea.Y0)(null!=a?a:0),h=a&&p,m=t&&u&&t.user_id===u.id,g=t&&!eD(t),v=g&&"parent_id"in t&&null!==t.parent_id,f=m||h,b=m||h,_=!m&&!c,y=h&&g&&!m,Z=!g&&u&&(null==t?void 0:t.user_id)===u.id;return t?(0,l.BX)(l.HY,{children:[(0,l.tZ)(eK,{communityEntity:t}),t.body&&(0,l.tZ)(eJ,{communityEntity:t}),!o&&d&&g&&(0,l.tZ)(eV,{onNewQuote:d,communityComment:t}),!o&&i,Z&&(0,l.tZ)(eQ,{communityEntity:t}),(0,l.BX)(K.xw,{children:[!o&&!v&&b&&(0,l.tZ)(eG,{communityEntity:t}),!o&&f&&(0,l.tZ)(e1,{communityEntity:t,onDelete:n}),!o&&void 0!==s&&y&&(0,l.tZ)(e0,{communityEntity:t,isBanned:s}),!o&&_&&(0,l.tZ)(e$,{onReport:r,communityEntity:t})]}),(0,l.tZ)(K.dW,{children:(0,l.tZ)(J.hs,{paddingY:4,children:(0,l.tZ)(ei.E,{conjunction:!0,timestamp:t.created_at})})})]}):null}function eq(e){let{onNewQuote:t,communityComment:i}=e;return(0,l.tZ)(V.hU,{size:"sm",priority:"tertiary","aria-label":"Reply",onClick:()=>{t(i)},children:(0,l.tZ)(m.Z,{size:20})})}function eY(e){let{onReply:t}=e;return(0,l.tZ)(V.hU,{size:"sm",priority:"tertiary","aria-label":"Reply",onClick:t,children:(0,l.tZ)(m.Z,{size:20})})}function eV(e){let{onNewQuote:t,communityComment:i}=e,{iString:n}=(0,M.M1)();return(0,l.tZ)(G.u,{leading:(0,l.tZ)(m.Z,{}),onClick:()=>{t(i)},children:n("Reply")})}function eJ(e){let{communityEntity:t}=e,{iString:i}=(0,M.M1)(),o=(0,ee.pm)();return(0,l.tZ)(G.u,{leading:(0,l.tZ)(b.Z,{}),onClick:()=>{if(t){let{body:e}=t;(0,W.vQ)(e),o.popToast(e=>(0,l.tZ)(ee.FN,(0,r._)((0,n._)({},e),{text:i("Text copied to clipboard"),Icon:b.Z})))}},children:i("Copy text")})}function eK(e){let{communityEntity:t}=e,{iString:i}=(0,M.M1)(),n=(0,H.g)(),{id:r}=t,o=eD(t);return(0,l.tZ)(G.u,{leading:(0,l.tZ)(_.Z,{}),onClick:()=>{let e;if(o)e=(0,ec._5K)({postId:r});else if(t.parent_id){var i;e=(0,ec.lsD)({commentId:null!==(i=t.parent_id)&&void 0!==i?i:r,targetReplyId:t.parent_id?r:void 0,showTarget:!0})}else e=(0,ec._5K)({postId:t.post_id,targetReplyId:t.id,showTarget:!0});n(e)},children:i("Copy link")})}function eG(e){let{communityEntity:t}=e,{iString:i}=(0,M.M1)(),o=(0,er.I0)(),a=(0,ee.pm)(),{id:s,is_locked:c}=t,d=eD(t),u=async()=>{d?o(ek(s,!c)):o(eC(s,!c)),c?a.popToast(e=>(0,l.tZ)(ee.FN,(0,r._)((0,n._)({},e),{text:i("Enabled replies"),Icon:Z.Z}))):a.popToast(e=>(0,l.tZ)(ee.FN,(0,r._)((0,n._)({},e),{text:i("Disabled replies"),Icon:y.Z})))};return(0,l.tZ)(G.u,{leading:(0,l.tZ)(y.Z,{}),onClick:u,priority:"destructive",children:c?i("Re-enable replies"):i("Disable replies")})}function eQ(e){let{communityEntity:t}=e,i=(0,er.I0)(),n=eD(t),r=async()=>{n&&i({type:"posts-edit_post",payload:{post:t}})};return(0,l.tZ)(G.u,{leading:(0,l.tZ)(w.Z,{}),onClick:r,priority:"primary",children:"Edit"})}function e$(e){let{onReport:t,communityEntity:i}=e,{iString:n}=(0,M.M1)();return(0,l.tZ)(l.HY,{children:(0,l.tZ)(G.u,{leading:(0,l.tZ)(k.Z,{}),onClick:()=>{t(i.id,"admin"!==i.user_pub_role)},priority:"destructive",children:n("Report")})})}function e0(e){let{communityEntity:t,isBanned:i}=e,{iString:n}=(0,M.M1)(),r=(0,er.I0)(),o=async()=>{if(confirm("Are you sure you want to ban this user?")){let{id:e}=t;r(eS(e,!i))}};return(0,l.tZ)(G.u,{leading:i?(0,l.tZ)(C.Z,{}):(0,l.tZ)(S.Z,{}),onClick:o,priority:"destructive",children:n(i?"Unban":"Ban")})}function e1(e){let{communityEntity:t,onDelete:i}=e,{iString:n}=(0,M.M1)(),r=(0,er.I0)(),o=eD(t),a=async()=>{if(confirm("Are you sure you want to delete this ".concat(o?"thread":"comment","?"))){let{id:e}=t;if(o){let{publication_id:i}=t;r(eZ(e,i))}else{let{post_id:i,parent_id:n}=t;r(ew(e,i,n))}i&&setTimeout(i,500)}};return(0,l.tZ)(G.u,{leading:(0,l.tZ)(B.Z,{}),onClick:a,priority:"destructive",children:n("Delete")})}function e4(e){var{hasFooter:t}=e,i=(0,o._)(e,["hasFooter"]);return(0,l.tZ)(J.tu,(0,n._)({className:u()(ed.Z.bubbleStack,t&&ed.Z.hasFooter),gap:2,alignItems:"start"},i))}function e2(e){var{isTargeted:t,className:i}=e,r=(0,o._)(e,["isTargeted","className"]);return(0,l.tZ)(J.tu,(0,n._)({className:u()(ed.Z.bubble,t&&ed.Z.highlight,i),sizing:"border-box",paddingY:8,paddingX:12,bg:"secondary",minWidth:0,gap:8},r))}function e8(e){let{communityEntity:t,publication:i,isTargeted:n,onClick:r,truncate:o=!0,isPaid:a,isFounding:s,outline:c}=e,{audience:d}=t,{canReply:u,shouldShowToken:p}=tn({audience:d,isFounding:s,isPaid:a,chatPaywallStatus:null==i?void 0:i.paywall_chat}),h=p||t.is_edited,m=t.reactions?Object.keys(t.reactions).length:0;return(0,l.BX)(e2,{isTargeted:n,onClick:r,className:ep.Z[m>0?"reactions-".concat(m):""],outline:c,children:[(0,l.tZ)(e7,{communityEntity:t,truncate:o}),h&&(0,l.BX)(J.gq,{justifyContent:"end",gap:2,children:[p&&(0,l.tZ)(e3,{canReply:!!u,audience:d}),t.is_edited&&(0,l.tZ)(e5,{})]})]})}function e3(e){let{canReply:t,audience:i,style:n="default",showLabel:r=!0,className:o}=e,a=r?"media"===n?"var(--vibrance-primary)":"var(--color-chat-incoming-fg-primary)":"var(--color-fg-primary)";return(0,l.BX)($.Vp,{className:u()(ed.Z.paywallReplyTag,"media"===n&&ed.Z.media,!r&&ed.Z.iconOnly,o),priority:"secondary",children:[t?(0,l.tZ)(X.Z,{size:12,color:a}):(0,l.tZ)(E.Z,{size:12,color:a}),r&&(0,l.tZ)(J.xv.B5,{weight:"medium",children:e6.get(i)})]})}let e6=new Map([["only_paid","Paid subscribers only"],["only_paid_replies","Paid subscriber replies"],["only_founding","Founding members only"],["only_founding_replies","Founding member replies"]]);function e5(){return(0,l.BX)($.Vp,{className:ed.Z.paywallReplyTag,priority:"secondary",children:[(0,l.tZ)(x.Z,{size:12}),(0,l.tZ)(J.xv.B5,{weight:"medium",children:"Edited"})]})}function e9(e){let{author:t,body:i,direction:n,onClick:r,children:o,isFirst:a=!0,pubThemeBackgroundColor:s,isAuthorContributor:c}=e,d="incoming"===n&&c,p=d&&s;return(0,l.tZ)(J.hs,{pullX:4,children:(0,l.BX)(J.hs,{gap:12,className:u()(ed.Z.quote,ed.Z[n],!a&&ed.Z.notFirst,d&&ed.Z.author),onClick:r,radius:"md",overflow:"hidden",padding:8,flex:"grow",style:{"--color-chat-author-bg-overlay":p?"".concat(s,"33"):"oklch(from var(--color-bg-accent-themed) l c h / 0.2)"},children:[(0,l.BX)(J.tu,{children:[(0,l.tZ)(J.xv.B4,{weight:"bold",children:null!=t?t:""}),(0,l.tZ)(J.xv.B3,{clamp:2,isParagraph:!0,children:i})]}),o]})})}function e7(e){var t,i,n,r,o;let{communityEntity:a,truncate:s=!0}=e,c=null,d=eD(a)?"thread":"reply";a.reported_by_user&&(c="You reported this ".concat(d)),"deleted"!==a.status&&a.body||(c="This ".concat(d," is not available"));let u=(0,R.KG)(a.user_id);c||"blocking"!==u?c||"blocked"!==u||(c="This person is blocked"):c="This person blocked you";let p=null!==(t=a.raw_body)&&void 0!==t?t:a.body;return p?eD(a)&&a.link_url&&!a.link_metadata&&(p="".concat(p,"\n\n").concat(a.link_url).trim()):eD(a)?(null===(n=a.media_assets)||void 0===n?void 0:n.length)?c="".concat(a.media_assets.length," ").concat(a.media_assets.length>1?"photos":"photo","."):a.link_url&&(a.link_metadata?c='Link: "'.concat(a.link_metadata.title,'"'):(p=a.link_url,c=null)):(null===(i=a.media_uploads)||void 0===i?void 0:i.length)&&(c="".concat(a.media_uploads.length," ").concat(a.media_uploads.length>1?"photos":"photo",".")),(0,l.tZ)(J.xv.B3,{className:ed.Z.body,isParagraph:!0,children:(p||c)&&(0,l.tZ)(eR,{text:p,rawText:null!==(r=a.raw_body)&&void 0!==r?r:"",mentionMap:Array.isArray(a.mentions)?void 0:null!==(o=a.mentions)&&void 0!==o?o:void 0,specialText:c,limit:s?void 0:9999999})})}function te(e){let{isLocked:t,count:i=0,commenters:n,hasUnread:r,onClick:o,direction:a,outline:s}=e,{iString:c,iPlural:d}=(0,M.M1)();return(0,l.tZ)(et.xj,{isLast:!0,messageDirection:a,onClick:o,cursor:o?"pointer":void 0,height:36,paddingY:4,paddingRight:12,paddingLeft:12,outline:s,children:(0,l.BX)(J.hs,{justifyContent:"space-between",alignItems:"center",gap:32,children:[(0,l.BX)(J.hs,{alignItems:"center",gap:8,children:[n&&i>0&&(0,l.tZ)(J.hs,{className:ed.Z.facepile,alignItems:"center",children:n.map(e=>(0,l.tZ)(q.qE,{className:u()(ed.Z.facepileAvatar,"outgoing"===a&&ed.Z.outgoing),user:e,size:22}))}),(0,l.tZ)(J.hs,{gap:8,alignItems:"center",children:(0,l.tZ)(J.xv.B3,{as:"span",className:r?ed.Z.hasUnread:ed.Z.noUnread,children:0===i?c("Leave a reply"):d("%1 reply","%1 replies",i)})})]}),t?(0,l.tZ)(E.Z,{size:14,color:"var(--color-chat-fg-secondary)"}):(0,l.tZ)(I.Z,{size:20,stroke:r?"var(--color-chat-reply-active)":"var(--color-chat-fg-secondary)"})]})})}function tt(e){let{audience:t,href:i,onClick:n}=e;return(0,l.tZ)(J.tu,{className:ed.Z.paywallBubble,as:i?"a":"div",onClick:n,cursor:n?"pointer":void 0,alignSelf:"stretch",alignItems:"center",justifyContent:"center",bg:"secondary",href:i,target:i?"_blank":void 0,children:(0,l.BX)(J.hs,{alignItems:"center",gap:4,children:[(0,l.tZ)(P.Z,{size:12,stroke:"var(--color-fg-secondary)"}),(0,l.tZ)(J.xv.Meta,{weight:"semibold",children:"only_founding"===t?"FOUNDING MEMBERS ONLY":"only_paid"===t?"PAID SUBSCRIBERS ONLY":"SUBSCRIBERS ONLY"})]})})}function ti(){return(0,l.tZ)(J.tu,{className:ed.Z.paywallBubble,alignSelf:"stretch",alignItems:"center",justifyContent:"center",bg:"secondary",children:(0,l.BX)(J.hs,{alignItems:"center",gap:4,children:[(0,l.tZ)(P.Z,{size:12,stroke:"var(--color-fg-secondary)"}),(0,l.tZ)(J.xv.Meta,{weight:"semibold",children:"SUBSCRIBERS ONLY"})]})})}function tn(e){let{audience:t,isFounding:i,isPaid:n,chatPaywallStatus:r}=e,o=["only_founding","only_founding_replies"].includes(t);return{canReply:i||"all_subscribers"===t||n&&["only_paid","only_paid_replies"].includes(t),shouldShowToken:r&&("free"===r&&"all_subscribers"!==t||"paid"===r&&o)}}function tr(e){let{paywallInfo:t,audience:i,onClick:n}=e,{mediaAttachments:r}=t,{body:o}=t,a=r[0];return o||a||(o=[,,,,].fill("Blah blah blah blahhhhh blah.").join(" ")),(0,l.BX)(l.HY,{children:[a&&(0,l.tZ)(J.tu,{position:"relative",children:(0,l.tZ)(L.E,{className:ed.Z.ImageGrid,assets:[{src:a.thumb_url,width:a.width,height:a.height,explicit:!1}],maxWidth:400,maxHeight:420,readOnly:!0,isContained:!0,children:(0,l.tZ)(to,{className:ed.Z.paywallFade,children:(0,l.tZ)(e3,{canReply:!1,audience:null!=i?i:"only_paid",style:"media",showLabel:!o,className:o?ed.Z.right:ed.Z.center})})})}),o&&(0,l.BX)(e2,{className:ed.Z.bubble,onClick:n,children:[(0,l.tZ)(J.xv.B3,{className:ed.Z.paywallText,isParagraph:!0,children:o}),(0,l.tZ)(to,{className:u()(ed.Z.paywallFade,ed.Z.paywallBlur),children:(0,l.tZ)(J.xu,{className:ed.Z.paywallReplyTagAbsolute,children:(0,l.tZ)(e3,{canReply:!1,audience:null!=i?i:"only_paid",style:"media"})})})]})]})}let to=(0,Q.zo)({position:"absolute",inset:0,alignItems:"center",justifyContent:"center"},Q.sg);function ta(e){let{text:t,isStatic:i}=e;return(0,l.tZ)(J.hs,{paddingX:8,paddingY:4,children:(0,l.BX)(J.xv.B5,{color:"secondary",weight:"semibold",children:[(0,l.tZ)(T.Z,{strokeWidth:2,height:12,stroke:"#808080",fill:"transparent",isStatic:i})," ",t]})})}function tl(e){let t,{user:i,size:n,pubRole:r,className:o,disabled:a,pubThemeAccentColor:s,pubThemePrintOnPopColor:c}=e;return(null==r?void 0:r.role)==="admin"||(null==r?void 0:r.role)==="contributor"?t="author":(null==r?void 0:r.is_founding)?t="founding":(null==r?void 0:r.membership_state)==="subscribed"&&(t="paid"),(0,l.tZ)(Y.zY,{tier:t,fgOverride:c,bgOverride:s,children:(0,l.tZ)(q.xV,{user:i,size:n,className:o,disabled:a,linkProps:{target:"_blank"},noBase:!0})})}},7703:function(e,t,i){i.d(t,{Z:()=>l});var n=i(16584),r=i(13639),o=i(15702),a=i(25682);let l=e=>{let{audience:t,className:i,size:l=16,isStatic:s,thin:c}=e;return"only_paid"===t?c?(0,n.tZ)(a.Z,{className:i,height:l,isStatic:s}):(0,n.tZ)(r.Z,{className:i,size:l}):"founding"===t?(0,n.tZ)(o.Z,{className:i,height:l,isStatic:s,strokeWidth:1}):null}},42694:function(e,t,i){i.d(t,{qT:()=>p});var n=i(16584);i(30396);var r=i(94184),o=i.n(r),a=i(80569),l=i.n(a);i(20253);var s=i(13304),c=i(95441);i(40647),i(68833);var d=i(62981);i(15771),i(63651),i(84864);let u=function(){let{children:e,dismissKey:t,dismissDurationInSeconds:i,beforeDismiss:r,className:a,level:l="info"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[c,u]=(0,d.Z)(t,i,r);return c?null:(0,n.BX)("div",{className:o()("banner",l,a),children:[e,(0,n.tZ)(s.Z,{width:12,height:12,className:"banner-close",onClick:e=>{e.preventDefault(),e.stopPropagation(),u()}})]})},p=e=>{let{}=e,{iString:t}=(0,c.M1)();return(0,n.BX)(u,{level:"coming-soon",dismissKey:"coming-soon-banner.dismissed",beforeDismiss:()=>{l().put("/api/v1/publication_settings").send({seen_coming_soon_explainer:!0})},children:[(0,n.tZ)("div",{className:"coming-soon-banner-header",children:t("Welcome to Substack!")}),(0,n.tZ)("br",{}),(0,n.tZ)("p",{children:t('We\'ve created this "Coming Soon" post for you. To edit it, click the three-dot icon.')}),(0,n.tZ)("br",{}),(0,n.tZ)("p",{children:t("It's just a placeholder and won't be sent out to your subscribers. To email them, click the \"New Post\" button.")})]})}},23254:function(e,t,i){i.d(t,{OZ:()=>U,ZP:()=>M,f8:()=>F});var n=i(7409),r=i(99282),o=i(16584),a=i(6400),l=i(30396),s=i(17876),c=i(3039),d=i(40423),u=i(80569),p=i.n(u),h=i(42725),m=i(61649),g=i(45405),v=i(94442),f=i(75697),b=i(12281),_=i(68833),y=i(62981),Z=i(93687),w=i(98914),k=i(71068),C=i(15771),S=i(61254),B=i(19081),x=i(6490),I=i(98248),P=i(58175),N=i(60308),T=i(93370),E=i(9799),X=i(47929),L=i(89451);let F=e=>{let[t,i]=(0,l.eJ)(null),[n,r]=(0,l.eJ)(null),[o]=(0,l.eJ)(!0),[a,s]=(0,l.eJ)(null),[c,d]=(0,l.eJ)(null),u=async()=>{let t=await p().get("/api/v1/video/upload/".concat(e));i(t.body);let{id:o,state:a}=t.body;if(["uploaded","transcoded"].includes(a)&&!n){let{body:{src:e}}=await p().get("/api/v1/video/upload/".concat(o,"/src.json?type=original"));r(e)}},h=async()=>{let{mux_asset:t,mux_preview_asset:i}=(await p().get("/api/v1/video/upload/".concat(e,"/assets"))).body;s(t),d(i)};return(0,l.d4)(()=>{u(),h()},[e]),(0,l.d4)(()=>{let o=setInterval(()=>{let a=async()=>{let t=await p().get("/api/v1/video/upload/".concat(e)),{id:a,mux_rendition_quality:l,state:s}=t.body;if(i(t.body),l&&clearInterval(o),["uploaded","transcoded"].includes(s)&&!n){let{body:{src:e}}=await p().get("/api/v1/video/upload/".concat(a,"/src.json?type=original"));r(e)}else h()};(null==t?void 0:t.state)==="error"?(console.warn("error creating clip"),clearInterval(o)):(null==t?void 0:t.mux_rendition_quality)?clearInterval(o):a()},5e3);return()=>{clearInterval(o)}},[t]),{mediaUpload:t,loading:o,downloadUrl:n,muxAsset:a,muxPreviewAsset:c}};function R(e){var t;let{pub:i,post:r,mediaUploadId:d,isOpen:u,onClose:p}=e,h=(0,a.createRef)(),{mediaUpload:m,downloadUrl:v,muxPreviewAsset:y}=F(d);(0,l.d4)(()=>{d&&(0,_.j)(_.FP.VIDEO_CLIP_SEEN,{post_id:r.id,clip_id:d})},[d]);let Z=async()=>{m&&await (0,E.I)(m)},R=()=>{(0,_.j)(_.FP.VIDEO_CLIP_WATCH_FULL_EPISODE_BUTTON_CLICKED,{name:"watch full episosde",post_id:r?r.id:null,utm_campaign:X.VX.substackClips,utm_medium:X.lP.web}),window.history.pushState({},"",(0,N.rhs)(window.location.href,{clipId:void 0,share:void 0})),p()};if(!m)return null;let M=null!==new URL(window.location.href).searchParams.get("share"),U=["uploaded","transcoded"].includes(m.state),A=(0,w.K1)(),D="creating";"error"===m.state?D="error":"transcoded"===m.state?D="transcoded":"uploaded"===m.state?D="uploaded":null!==m.mux_preview_playback_id&&(null==y?void 0:y.status)==="ready"&&(D="preview");let O={entityType:"post",entityKey:String(r.id),surface:"editor",contentType:"clip"};return(0,o.BX)(x.u_,{width:640,fullscreenMobile:!0,isOpen:u,onClose:p,children:[(0,o.tZ)(x.xB,{showClose:!0,title:M?"Share Clip":"Clip",onClose:p,description:"✂️ ".concat((0,T.UB)(null!==(t=m.duration)&&void 0!==t?t:0)," | ").concat(r.title)}),(0,o.BX)(x.fe,{children:["transcoded"===D&&(0,o.tZ)(b.Z,(0,n._)({ref:h,mediaUpload:m,pub:null!=i?i:null,autoPlay:!1,isClip:!0,videoType:"clip"},O)),"preview"===D&&(0,o.tZ)(b.Z,(0,n._)({ref:h,mediaUpload:m,pub:null!=i?i:null,autoPlay:!1,isClip:!0,usePreview:!0,videoType:"clip"},O)),"uploaded"===D&&v&&(0,o.tZ)("div",{class:"video-player-wrapper",children:(0,o.tZ)("div",{class:"video-player",children:(0,o.tZ)("video",{src:v,type:"video/mp4",controls:!0})})}),"creating"===D&&(0,o.tZ)(B.gq,{children:(0,o.tZ)(B.tu,{className:L.Z.placeholder,justifyContent:"center",alignItems:"center",children:(0,o.BX)(B.tu,{justifyContent:"center",alignItems:"center",className:L.Z.placeholderMessage,gap:8,children:[(0,o.tZ)(I.$j,{}),(0,o.tZ)(P.xv.B3,{weight:"bold",children:"Your clip is being processed"}),(0,o.BX)(P.xv.B4,{weight:"medium",color:"secondary",align:"center",children:["Clips may take up to a minute to process. Meanwhile, ",(0,o.tZ)("b",{children:"share your clip link below"})]})]})})}),"error"===D&&(0,o.tZ)(B.gq,{children:(0,o.BX)(B.tu,{className:L.Z.placeholder,children:[(0,o.tZ)(s.Z,{color:"gray"}),(0,o.tZ)(P.xv.B4,{weight:"medium",color:"secondary",children:"Oops! There was an error creating the clip"})]})}),"error"!==D&&(0,o.BX)(B.tu,{paddingTop:16,children:[(0,o.tZ)(S.iz,{}),(0,o.tZ)(k.xu,{children:(0,o.BX)(B.gq,{justifyContent:"space-between",flex:"grow",paddingTop:16,children:[!M&&(0,o.tZ)(B.gq,{children:A?(0,o.tZ)(C.hU,{priority:"primary",onClick:R,children:(0,o.tZ)(c.Z,{})}):(0,o.tZ)(C.zx,{priority:"primary",onClick:R,children:"Watch full episode"})}),(0,o.tZ)(g.S,{shareUrl:(e,t,n)=>(0,f.O1)(e,{clip:m,post:r,pub:i,medium:n,utm_campaign:t}),pub:i,clip:m,post:r,selectionId:void 0,disabled:!1,disabledInstagram:!U,disabledDownload:!U,onDownloadClick:Z,isSharing:M})]})})]})]})]})}function M(e){let{post:t,mediaUploadId:i}=e,[a,s]=(0,l.eJ)(!0),[c,d]=(0,l.eJ)(i);(0,l.d4)(()=>{let e=()=>{d(new URLSearchParams(window.location.search).get("clipId")),s(!0)};return window.addEventListener("urlchange",e),window.addEventListener("popstate",e),e(),()=>{window.removeEventListener("urlchange",e),window.removeEventListener("popstate",e)}},[]);let{mediaUpload:u,loading:p}=(0,Z.z)({mediaUploadId:c});return!p&&u&&c?(0,o.tZ)(R,(0,r._)((0,n._)({},e),{mediaUploadId:c,isOpen:a,onClose:()=>{s(!1),(0,_.j)(_.FP.VIDEO_CLIP_MODAL_CLOSED,{post_id:null==t?void 0:t.id,clip_id:c})}})):null}let U=e=>{var t;let{post:i,mediaUpload:n,disabled:r,style:a}=e,[,l]=(0,y.Z)(h.pc),{onStartClipping:s}=(0,m.Sr)(),c=(null!==(t=null==n?void 0:n.duration)&&void 0!==t?t:0)>5;return(0,o.tZ)(v.Ng,{title:c?r?"upgrade in order to watch this video and be able to clip it":"":"can't clip videos shorter than 5 seconds",isDisabled:!c||r,style:a,onClick:()=>{l(),c&&(s({source:"post-ufi",title:null}),(0,_.j)(_.FP.MEDIA_CLIP_BUTTON_CLICKED,{button:"create",source:"player ufi"}),(0,_.j)(_.FP.VIDEO_CLIP_BUTTON_CLICKED,{post_id:i.id}))},icon:(0,o.tZ)(d.Z,{className:"icon",height:(0,v.Su)(a),strokeWidth:v.PA})})}},45405:function(e,t,i){i.d(t,{S:()=>T});var n=i(7409),r=i(99282),o=i(16584),a=i(30396),l=i(94184),s=i.n(l),c=i(99869),d=i(71212),u=i(46990),p=i(27543),h=i(64515);let m=e=>(0,o.tZ)(h.l,(0,r._)((0,n._)({},e),{name:"ShareInstagramIcon",svgParams:{height:1e3,width:1e3},children:(0,o.BX)("svg",{width:"1000.0001",height:"1000.0001",viewBox:"0 0 264.58332 264.58332",version:"1.1",id:"svg15",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.BX)("defs",{id:"defs11",children:[(0,o.tZ)("radialGradient",{id:"f",cx:"158.429",cy:"578.08801",r:"52.351501",href:"#a",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(0,-4.03418,4.28018,0,-2332.2273,942.2356)",fx:"158.429",fy:"578.08801"}),(0,o.tZ)("radialGradient",{href:"#b",id:"g",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(0.67441,-1.16203,1.51283,0.87801,-814.3657,-47.8354)",cx:"172.6149",cy:"600.69238",fx:"172.6149",fy:"600.69238",r:"65"}),(0,o.tZ)("radialGradient",{href:"#c",id:"h",cx:"144.01199",cy:"51.3367",fx:"144.01199",fy:"51.3367",r:"67.081001",gradientTransform:"matrix(-2.3989,0.67549,-0.23008,-0.81732,464.9957,-26.4035)",gradientUnits:"userSpaceOnUse"}),(0,o.tZ)("radialGradient",{href:"#d",id:"e",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(-3.10797,0.87652,-0.6315,-2.23914,1345.6503,1374.1983)",cx:"199.78841",cy:"628.43793",fx:"199.78841",fy:"628.43793",r:"52.351501"}),(0,o.BX)("linearGradient",{id:"d",children:[(0,o.tZ)("stop",{offset:"0","stop-color":"#ff005f",id:"stop1"}),(0,o.tZ)("stop",{offset:"1","stop-color":"#fc01d8",id:"stop2"})]}),(0,o.BX)("linearGradient",{id:"c",children:[(0,o.tZ)("stop",{offset:"0","stop-color":"#780cff",id:"stop3"}),(0,o.tZ)("stop",{"stop-color":"#820bff",offset:"1","stop-opacity":"0",id:"stop4"})]}),(0,o.BX)("linearGradient",{id:"b",children:[(0,o.tZ)("stop",{offset:"0","stop-color":"#fc0",id:"stop5"}),(0,o.tZ)("stop",{offset:"1","stop-color":"#fc0","stop-opacity":"0",id:"stop6"})]}),(0,o.BX)("linearGradient",{id:"a",children:[(0,o.tZ)("stop",{offset:"0","stop-color":"#fc0",id:"stop7"}),(0,o.tZ)("stop",{offset:".1242","stop-color":"#fc0",id:"stop8"}),(0,o.tZ)("stop",{offset:".5672","stop-color":"#fe4a05",id:"stop9"}),(0,o.tZ)("stop",{offset:".6942","stop-color":"#ff0f3f",id:"stop10"}),(0,o.tZ)("stop",{offset:"1","stop-color":"#fe0657","stop-opacity":"0",id:"stop11"})]}),(0,o.tZ)("clipPath",{id:"clipCircle",children:(0,o.tZ)("circle",{cx:"132",cy:"132",r:"132",fill:"#ffffff",stroke:"#000000",id:"circle11"})})]}),(0,o.BX)("g",{"clip-path":"url(#clipCircle)",id:"g15",children:[(0,o.tZ)("path",{d:"m 204.1503,18.1429 c -55.2305,0 -71.3834,0.057 -74.5232,0.3175 -11.3342,0.9424 -18.387,2.7275 -26.0708,6.554 -5.9214,2.9413 -10.5915,6.3506 -15.2005,11.1298 -8.3938,8.7157 -13.481,19.4383 -15.3226,32.1842 -0.8953,6.1877 -1.1558,7.4496 -1.2087,39.0558 -0.0203,10.5354 0,24.4007 0,42.9984 0,55.2008 0.061,71.3418 0.3256,74.4764 0.9157,11.032 2.6453,17.9728 6.3081,25.565 7,14.5329 20.369,25.4428 36.119,29.5137 5.4535,1.4044 11.4767,2.1779 19.2092,2.5442 3.2762,0.1425 36.6684,0.2443 70.081,0.2443 33.4127,0 66.8253,-0.0407 70.02,-0.2035 8.9535,-0.4214 14.1526,-1.1195 19.9011,-2.6054 15.8517,-4.0912 28.9767,-14.8383 36.119,-29.5748 3.5916,-7.409 5.4128,-14.6144 6.237,-25.0704 0.179,-2.2796 0.2543,-38.6263 0.2543,-74.924 0,-36.304 -0.0814,-72.5835 -0.2605,-74.8632 -0.8343,-10.6249 -2.6555,-17.7692 -6.363,-25.3207 -3.0421,-6.1816 -6.42,-10.798 -11.324,-15.518 -8.752,-8.3616 -19.4555,-13.4502 -32.2101,-15.2902 -6.18,-0.8936 -7.411,-1.1582 -39.033,-1.2131 z",fill:"url(#e)",transform:"translate(-71.8155,-18.1429)",id:"path11",style:"fill:url(#e)"}),(0,o.tZ)("path",{d:"m 204.1503,18.1429 c -55.2305,0 -71.3834,0.057 -74.5232,0.3175 -11.3342,0.9424 -18.387,2.7275 -26.0708,6.554 -5.9214,2.9413 -10.5915,6.3506 -15.2005,11.1298 -8.3938,8.7157 -13.481,19.4383 -15.3226,32.1842 -0.8953,6.1877 -1.1558,7.4496 -1.2087,39.0558 -0.0203,10.5354 0,24.4007 0,42.9984 0,55.2008 0.061,71.3418 0.3256,74.4764 0.9157,11.032 2.6453,17.9728 6.3081,25.565 7,14.5329 20.369,25.4428 36.119,29.5137 5.4535,1.4044 11.4767,2.1779 19.2092,2.5442 3.2762,0.1425 36.6684,0.2443 70.081,0.2443 33.4127,0 66.8253,-0.0407 70.02,-0.2035 8.9535,-0.4214 14.1526,-1.1195 19.9011,-2.6054 15.8517,-4.0912 28.9767,-14.8383 36.119,-29.5748 3.5916,-7.409 5.4128,-14.6144 6.237,-25.0704 0.179,-2.2796 0.2543,-38.6263 0.2543,-74.924 0,-36.304 -0.0814,-72.5835 -0.2605,-74.8632 -0.8343,-10.6249 -2.6555,-17.7692 -6.363,-25.3207 -3.0421,-6.1816 -6.42,-10.798 -11.324,-15.518 -8.752,-8.3616 -19.4555,-13.4502 -32.2101,-15.2902 -6.18,-0.8936 -7.411,-1.1582 -39.033,-1.2131 z",fill:"url(#f)",transform:"translate(-71.8155,-18.1429)",id:"path12",style:"fill:url(#f)"}),(0,o.tZ)("path",{d:"m 204.1503,18.1429 c -55.2305,0 -71.3834,0.057 -74.5232,0.3175 -11.3342,0.9424 -18.387,2.7275 -26.0708,6.554 -5.9214,2.9413 -10.5915,6.3506 -15.2005,11.1298 -8.3938,8.7157 -13.481,19.4383 -15.3226,32.1842 -0.8953,6.1877 -1.1558,7.4496 -1.2087,39.0558 -0.0203,10.5354 0,24.4007 0,42.9984 0,55.2008 0.061,71.3418 0.3256,74.4764 0.9157,11.032 2.6453,17.9728 6.3081,25.565 7,14.5329 20.369,25.4428 36.119,29.5137 5.4535,1.4044 11.4767,2.1779 19.2092,2.5442 3.2762,0.1425 36.6684,0.2443 70.081,0.2443 33.4127,0 66.8253,-0.0407 70.02,-0.2035 8.9535,-0.4214 14.1526,-1.1195 19.9011,-2.6054 15.8517,-4.0912 28.9767,-14.8383 36.119,-29.5748 3.5916,-7.409 5.4128,-14.6144 6.237,-25.0704 0.179,-2.2796 0.2543,-38.6263 0.2543,-74.924 0,-36.304 -0.0814,-72.5835 -0.2605,-74.8632 -0.8343,-10.6249 -2.6555,-17.7692 -6.363,-25.3207 -3.0421,-6.1816 -6.42,-10.798 -11.324,-15.518 -8.752,-8.3616 -19.4555,-13.4502 -32.2101,-15.2902 -6.18,-0.8936 -7.411,-1.1582 -39.033,-1.2131 z",fill:"url(#g)",transform:"translate(-71.8155,-18.1429)",id:"path13",style:"fill:url(#g)"}),(0,o.tZ)("path",{d:"m 204.1503,18.1429 c -55.2305,0 -71.3834,0.057 -74.5232,0.3175 -11.3342,0.9424 -18.387,2.7275 -26.0708,6.554 -5.9214,2.9413 -10.5915,6.3506 -15.2005,11.1298 -8.3938,8.7157 -13.481,19.4383 -15.3226,32.1842 -0.8953,6.1877 -1.1558,7.4496 -1.2087,39.0558 -0.0203,10.5354 0,24.4007 0,42.9984 0,55.2008 0.061,71.3418 0.3256,74.4764 0.9157,11.032 2.6453,17.9728 6.3081,25.565 7,14.5329 20.369,25.4428 36.119,29.5137 5.4535,1.4044 11.4767,2.1779 19.2092,2.5442 3.2762,0.1425 36.6684,0.2443 70.081,0.2443 33.4127,0 66.8253,-0.0407 70.02,-0.2035 8.9535,-0.4214 14.1526,-1.1195 19.9011,-2.6054 15.8517,-4.0912 28.9767,-14.8383 36.119,-29.5748 3.5916,-7.409 5.4128,-14.6144 6.237,-25.0704 0.179,-2.2796 0.2543,-38.6263 0.2543,-74.924 0,-36.304 -0.0814,-72.5835 -0.2605,-74.8632 -0.8343,-10.6249 -2.6555,-17.7692 -6.363,-25.3207 -3.0421,-6.1816 -6.42,-10.798 -11.324,-15.518 -8.752,-8.3616 -19.4555,-13.4502 -32.2101,-15.2902 -6.18,-0.8936 -7.411,-1.1582 -39.033,-1.2131 z",fill:"url(#h)",transform:"translate(-71.8155,-18.1429)",id:"path14",style:"fill:url(#h)"}),(0,o.tZ)("path",{d:"m 132.3452,33.973 c -26.7167,0 -30.0696,0.1167 -40.5629,0.5939 -10.4727,0.4792 -17.6212,2.136 -23.8762,4.567 -6.4701,2.5107 -11.9586,5.8693 -17.4265,11.3352 -5.472,5.464 -8.8332,10.9483 -11.354,17.4116 -2.4389,6.2524 -4.099,13.3976 -4.5703,23.8585 -0.4693,10.4854 -0.5923,13.8379 -0.5923,40.5348 0,26.697 0.1189,30.0371 0.5943,40.5225 0.4817,10.465 2.1397,17.6082 4.5703,23.8585 2.5147,6.4654 5.8758,11.9497 11.3458,17.4136 5.466,5.468 10.9544,8.8349 17.4204,11.3456 6.259,2.4309 13.4097,4.0877 23.8803,4.567 10.4933,0.477 13.8441,0.5938 40.5588,0.5938 26.7188,0 30.0615,-0.1167 40.5547,-0.5939 10.4728,-0.4792 17.6295,-2.136 23.8885,-4.567 6.4681,-2.5106 11.9484,-5.8775 17.4143,-11.3455 5.472,-5.4639 8.8332,-10.9482 11.354,-17.4115 2.4183,-6.2524 4.0784,-13.3976 4.5703,-23.8585 0.4713,-10.4854 0.5943,-13.8277 0.5943,-40.5246 0,-26.697 -0.123,-30.0473 -0.5943,-40.5328 -0.4919,-10.465 -2.152,-17.6081 -4.5703,-23.8584 -2.5208,-6.4654 -5.882,-11.9498 -11.354,-17.4137 C 208.7183,45.0011 203.2462,41.6425 196.77,39.1338 190.4986,36.7029 183.346,35.0461 172.8733,34.5669 162.38,34.0897 159.0394,33.973 132.3145,33.973 Z m -8.825,17.7147 c 2.6193,-0.0041 5.5418,0 8.825,0 26.2659,0 29.379,0.0942 39.7513,0.5652 9.5915,0.4383 14.7971,2.0397 18.2648,3.3852 4.5908,1.7817 7.8638,3.9116 11.3048,7.3521 3.4431,3.4406 5.5745,6.7173 7.3617,11.3046 1.3465,3.461 2.9512,8.6628 3.3877,18.2472 0.4714,10.3625 0.5739,13.4754 0.5739,39.7095 0,26.234 -0.1025,29.347 -0.5739,39.7095 -0.4386,9.5843 -2.0412,14.7861 -3.3877,18.2471 -1.783,4.5874 -3.9186,7.8539 -7.3617,11.2923 -3.443,3.4406 -6.712,5.5704 -11.3048,7.3521 -3.4636,1.3517 -8.6733,2.949 -18.2648,3.3873 -10.3702,0.471 -13.4854,0.5734 -39.7513,0.5734 -26.2679,0 -29.381,-0.1024 -39.7513,-0.5734 -9.5914,-0.4423 -14.797,-2.0438 -18.2668,-3.3893 -4.5908,-1.7817 -7.87,-3.9116 -11.313,-7.3521 -3.4431,-3.4405 -5.5745,-6.709 -7.3617,-11.2985 -1.3465,-3.461 -2.9512,-8.6628 -3.3877,-18.2471 -0.4714,-10.3626 -0.5657,-13.4754 -0.5657,-39.7259 0,-26.2504 0.0943,-29.347 0.5657,-39.7095 0.4386,-9.5844 2.0412,-14.7861 3.3877,-18.2512 1.783,-4.5874 3.9186,-7.8641 7.3617,-11.3046 3.443,-3.4406 6.7222,-5.5704 11.313,-7.3562 3.4677,-1.3517 8.6754,-2.949 18.2668,-3.3894 9.075,-0.4096 12.5919,-0.5324 30.9264,-0.553 z m 61.3363,16.322 c -6.5173,0 -11.805,5.2776 -11.805,11.792 0,6.5125 5.2877,11.7962 11.805,11.7962 6.5172,0 11.8049,-5.2837 11.8049,-11.7962 0,-6.5124 -5.2877,-11.796 -11.805,-11.796 z m -52.5113,13.7826 c -27.8993,0 -50.5191,22.6031 -50.5191,50.4817 0,27.8786 22.6198,50.4714 50.5191,50.4714 27.8993,0 50.511,-22.5928 50.511,-50.4714 0,-27.8786 -22.6137,-50.4817 -50.513,-50.4817 z m 0,17.7147 c 18.109,0 32.7914,14.6694 32.7914,32.767 0,18.0956 -14.6824,32.767 -32.7914,32.767 -18.111,0 -32.7913,-14.6714 -32.7913,-32.767 0,-18.0976 14.6803,-32.767 32.7913,-32.767 z",fill:"#ffffff",id:"path15"})]})]})}));var g=i(42042),v=i(20068),f=i(68833),b=i(15771),_=i(19081),y=i(6490),Z=i(58175);let w="step-Rk40vT",k=e=>{let{isOpen:t,onClose:i,onCopyLinkClick:n,mediaCarousel:r}=e;return(0,a.d4)(()=>{t&&(0,f.j)(f.FP.VIDEO_CLIP_INSTAGRAM_SHARE_MODAL_SEEN,{source:"clip-share-modal"})},[t]),(0,o.BX)(y.u_,{isOpen:t,onClose:i,fullscreenMobile:!0,children:[(0,o.tZ)(y.xB,{showClose:!0,onClose:i,title:"Share to Instagram"}),(0,o.tZ)(y.fe,{children:(0,o.BX)(_.tu,{gap:32,children:[(0,o.BX)(_.gq,{children:[(0,o.tZ)(_.gq,{justifyContent:"center",className:w,children:(0,o.tZ)(Z.xv.H4,{children:"1"})}),(0,o.tZ)(_.gq,{children:(0,o.BX)(_.tu,{gap:16,children:[(0,o.tZ)(Z.xv.H4,{children:"Download clip"}),(0,o.tZ)(_.tu,{bg:"secondary",radius:"md",border:"detail",children:r})]})})]}),(0,o.BX)(_.gq,{children:[(0,o.tZ)(_.gq,{justifyContent:"center",className:w,children:(0,o.tZ)(Z.xv.H4,{children:"2"})}),(0,o.tZ)(_.gq,{children:(0,o.BX)(_.tu,{gap:16,children:[(0,o.BX)(_.tu,{gap:4,children:[(0,o.tZ)(Z.xv.H4,{children:"Copy a link to the post"}),(0,o.tZ)(Z.xv.B4,{children:"Add a link to your Instagram story or bio."})]}),(0,o.tZ)(_.gq,{children:(0,o.tZ)(b.zx,{priority:"secondary",onClick:()=>n("instagram","substack-clips","social"),trailing:(0,o.tZ)(c.Z,{}),children:"Copy link"})})]})})]}),(0,o.BX)(_.gq,{children:[(0,o.tZ)(_.gq,{justifyContent:"center",className:w,children:(0,o.tZ)(Z.xv.H4,{children:"3"})}),(0,o.tZ)(_.gq,{children:(0,o.tZ)(_.tu,{gap:16,children:(0,o.BX)(_.tu,{gap:4,children:[(0,o.tZ)(Z.xv.H4,{children:"Post from Instagram"}),(0,o.tZ)(Z.xv.B4,{children:"Visit the Instagram app and share the image with a link to the post. Or share from Instagram on desktop"})]})})})]}),(0,o.tZ)(_.gq,{justifyContent:"end",paddingTop:32,paddingX:16,children:(0,o.tZ)(b.zx,{priority:"primary",onClick:i,children:"Done"})})]})})]})};var C=i(75697),S=i(98914),B=i(98248),x=i(70379),I=i(87077),P=i(60308),N=i(63651);function T(e){let{shareUrl:t,pub:i,post:l,clip:h,selectionId:y,disabled:Z,disabledInstagram:w,disabledDownload:T,onDownloadClick:E,isSharing:X}=e,L=(0,x.pm)(),[F,R]=(0,a.eJ)(!1),M=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"substack-clip",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"web";U(e,t,i,e=>((0,S.vQ)(e),L.popToast(e=>(0,o.tZ)(x.FN,(0,r._)((0,n._)({},e),{text:"Copied link to clipboard"}))),!1))},U=(e,n,r,o)=>{(0,C.I)(e,o,{shareUrl:t(e,n,r),post:l,pub:i,selectionId:y,utm_campaign:n,utm_medium:r,event:f.FP.VIDEO_CLIP_SHARE_BUTTON_CLICKED})},A=async()=>{U("facebook","substack-clips","social",e=>(0,N.n1t)("https://www.facebook.com/sharer/sharer.php",{u:e}))},D=async()=>{l&&U("twitter","substack-clips","social",e=>(0,P.LaP)({url:e,text:l.title}))},O=async()=>{U("linkedin","substack-clips","social",e=>(0,N.n1t)("https://www.linkedin.com/sharing/share-offsite/",{url:e}))};return(0,o.BX)(_.gq,{justifyContent:"space-between",flex:"fill",children:[X?(0,o.tZ)(_.gq,{children:(0,o.tZ)(b.zx,{priority:"primary",rounded:!1,onClick:()=>M(),leading:(0,o.tZ)(c.Z,{size:20}),children:"Copy link"})}):(0,o.tZ)("div",{}),(0,o.BX)(_.gq,{gap:8,children:[(0,o.tZ)(I.u,{text:T?"Your clip will be ready to download shortly":"Download",children:(0,o.tZ)(b.hU,{className:s()({"disabledButton-hUWISL":T}),priority:"secondary-outline",onClick:E,disabled:T,children:T?(0,o.tZ)(B.$j,{}):(0,o.tZ)(d.Z,{size:20})})}),!X&&(0,o.tZ)(b.hU,{priority:"secondary-outline",onClick:()=>M(),disabled:Z,children:(0,o.tZ)(c.Z,{size:20})}),(0,o.tZ)(b.hU,{priority:"secondary-outline",onClick:()=>{(0,C.BZ)({shareUrl:t("notes","substack-clips","web"),pub:i,post:l,utm_campaign:"substack-clips"})},disabled:Z,children:(0,o.tZ)(g.Z,{height:24})}),(0,o.tZ)(b.hU,{priority:"secondary-outline",onClick:()=>{(0,f.j)(f.FP.VIDEO_CLIP_SHARE_BUTTON_CLICKED,{name:"instagram",post_id:l?l.id:null,utm_campaign:"substack-clips",utm_medium:"social"}),R(!0)},disabled:Z||w,children:(0,o.tZ)(m,{height:20,width:20})}),(0,o.tZ)(b.hU,{priority:"secondary-outline",onClick:D,disabled:Z,children:(0,o.tZ)(v.Z,{height:20,width:20})}),(0,o.tZ)(b.hU,{priority:"secondary-outline",onClick:A,disabled:Z,children:(0,o.tZ)(u.Z,{height:20,width:20})}),(0,o.tZ)(b.hU,{priority:"secondary-outline",onClick:O,disabled:Z,children:(0,o.tZ)(p.Z,{height:20,width:20})}),(0,o.tZ)(k,{isOpen:F,onClose:()=>{R(!1)},onCopyLinkClick:M,mediaCarousel:(0,o.BX)(_.gq,{gap:16,alignItems:"center",justifyContent:"center",padding:16,position:"relative",children:[(0,o.tZ)("img",{src:(0,P.kOB)(h),width:"300px"}),(0,o.tZ)("div",{className:"download-QWI_A5",children:(0,o.tZ)(_.gq,{padding:32,children:(0,o.tZ)(b.GI,{onClick:()=>E&&E(),children:(0,o.tZ)(d.Z,{size:"16"})})})})]})})]})]})}},29032:function(e,t,i){i.d(t,{C:()=>o});var n=i(16584),r=i(4615);let o=e=>{let{children:t,disable:i}=e;return i?(0,n.tZ)(n.HY,{children:t}):(0,n.tZ)(r.f6,{theme:"dark-theme",children:t})}},10968:function(e,t,i){i.d(t,{Li:()=>_,kw:()=>S});var n=i(7409),r=i(99282),o=i(16584),a=i(30396),l=i(94184),s=i.n(l),c=i(16864),d=i(24202),u=i(92291),p=i(71068),h=i(15771),m=i(19081),g=i(17172),v=i(45783),f=i(91400),b=i(54796);function _(e){let{className:t,assets:i,readOnly:l,isRestack:c,isPermalink:u,maxHeight:p=420,onClick:h,onSwipe:_,children:k,parent:S}=e,B=(0,d.dz)(i),x=(0,f.XA)(),I=c?12:u?0:x?64:48,P=c?12:16*!!x,N=I+P,T=(0,a.sO)(null),E=(0,d.yU)(T,N),X=Math.max(E-20-6,0),L=(0,a.sO)(!1),F=C(B,p,X),R=S&&""===S.body,[M,U]=(0,a.eJ)(null),A=(0,g.aZ)(T),D=(0,v.eK)(T,{inset:I,pageSizeAdjust:-.4*(E||0),initialState:{showLeft:!1,showRight:!0}}),{state:{showLeft:O,showRight:z},handleArrowClick:j}=x?{state:{showLeft:!1,showRight:!1},handleArrowClick:()=>()=>{}}:D;return(0,a.d4)(()=>{let e=T.current,t=()=>{!L.current&&(L.current=!0,_&&_())};return null==e||e.addEventListener("scroll",t),()=>null==e?void 0:e.removeEventListener("scroll",t)},[_]),(0,o.BX)(m.tu,{className:s()(b.Z.imageCarouselContainer,c&&b.Z.restack),position:"relative",draggable:!1,paddingTop:R?12:void 0,style:{"--carousel-inset-left":"-".concat(I,"px"),"--carousel-inset-right":"-".concat(P,"px")},children:[(0,o.BX)(m.hs,(0,r._)((0,n._)({},A.props),{ref:T,className:s()(b.Z.imageCarousel,c&&b.Z.restack,t),overflow:"auto",flex:"auto",style:{"--carousel-height":"".concat(F,"px"),"--carousel-gap":"".concat(6,"px")},children:[(0,o.tZ)(y,{width:I}),B.map((e,t)=>{let{src:i,explicit:n,width:r,height:a,id:s}=e;return(0,o.tZ)(Z,{asset:i,explicit:n,readOnly:l,width:r,height:a,carouselHeight:F,onClick:l?void 0:e=>{e.preventDefault(),h&&h({attachmentId:s,attachmentType:"image"}),U({index:t})},children:k},i)}),(0,o.tZ)(d.$9,{assets:B,imageViewer:M,setImageViewer:U,readOnly:l})]})),!x&&(0,o.BX)(o.HY,{children:[(0,o.tZ)(w,{direction:"left",visible:O,onClick:j(-1)}),(0,o.tZ)(w,{direction:"right",visible:z,onClick:j(1)})]})," "]})}function y(e){let{width:t}=e;return(0,o.tZ)(p.xu,{as:"span",className:b.Z.carouselSpacer,width:t})}function Z(e){let{asset:t,explicit:i,onClick:n,readOnly:r,width:a,height:l,carouselHeight:s,children:c}=e,u=s*(a&&l?a/l:1);return(0,o.tZ)(d.Z4,{asset:t,explicit:i,onClick:n,readOnly:r,width:u,height:s,className:b.Z.carouselImage,maxWidth:u,children:c})}function w(e){let{direction:t,visible:i,onClick:n}=e;return(0,o.tZ)(m.hs,{position:"absolute",className:s()(b.Z.arrowContainer,b.Z["".concat(t)]),alignItems:"center",justifyContent:"center",children:(0,o.tZ)(h.kG,{onClick:e=>{e.preventDefault(),e.stopPropagation(),null==n||n()},resetCss:!0,className:s()(b.Z.arrowButton,!i&&b.Z.hidden),display:"flex",alignItems:"center",justifyContent:"center",children:(0,o.tZ)(c.Z,{size:20,className:b.Z.arrowIcon})})})}function k(e){return e.filter(e=>"string"!=typeof e&&"number"==typeof e.width&&"number"==typeof e.height&&e.width>0&&e.height>0)}function C(e,t,i){let n=k(e);return 0===n.length?t:Math.min(i/Math.max(...n.map(e=>e.width/e.height)),t)}function S(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:420,n=e.map(u.kN),r=C(n,i,t);return k(n).reduce((e,t)=>e+r*(t.width&&t.height?t.width/t.height:1),0)+6*(n.length-1)}},28121:function(e,t,i){i.d(t,{Y:()=>a});var n=i(16584),r=i(347),o=i(19081);let a=()=>(0,n.tZ)(r.h,{children:(0,n.tZ)(o.gq,{height:56,borderBottom:"detail-themed"})})},67203:function(e,t,i){i.d(t,{O0:()=>Y,YY:()=>W,sp:()=>q});var n=i(7409),r=i(99282),o=i(16584),a=i(30396),l=i(94184),s=i.n(l),c=i(31131),d=i(99869),u=i(77600),p=i(40423),h=i(28596),m=i(98661),g=i(60826),v=i(61649),f=i(51455),b=i(59154),_=i(79138),y=i(37632),Z=i(4473),w=i(39535),k=i(94442),C=i(75697),S=i(57391),B=i(95441),x=i(93155),I=i(68833),P=i(59176),N=i(98914),T=i(15771),E=i(82402),X=i(19081),L=i(36500),F=i(14651),R=i(84747),M=i(58175),U=i(51776),A=i(70379),D=i(97434),O=i(37759),z=i(93370),j=i(47929),H=i(8108);let W=e=>{let{initialTime:t,onChange:i,maxTime:n}=e,{iString:r}=(0,B.M1)(),[l,s]=(0,a.eJ)(!0),[c,d]=(0,a.eJ)(!0),[u,p]=(0,a.eJ)((0,z.DL)(null!=t?t:0)),h=e=>{let t=(0,z.Jk)(e),r=(0,z.ZD)(e);t&&(!n||r<=n)?(i((0,z.ZD)(e)),d(!0)):(i(null),d(!1)),p(e)};return(0,o.BX)(X.gq,{gap:12,alignItems:"center",paddingX:8,paddingY:4,children:[(0,o.tZ)(F.Mz,{children:(0,o.tZ)(E.X,{size:"sm",checked:l,onChange:()=>s(!l)})}),(0,o.tZ)(M.xv.B4,{weight:"medium",color:"primary",children:r("Start at")}),(0,o.tZ)(U.oi,{className:H.Z.textInput,value:u,error:!c,onChange:e=>h(e.currentTarget.value),placeholder:"0:00"})]})};function q(e){var t,i,l,h,E;let F,{post:M,user:U,pub:D,trigger:O,onChange:z,position:q,showClipping:V,disableClipping:J,initialShareTimestamp:K}=e,{iString:G}=(0,B.M1)(),{onStartClipping:Q}=(0,v.Sr)(),[$,ee]=(0,a.eJ)(null!=K?K:null);(0,m.useEffect)(()=>{K&&ee(K)},[K]);let et=$?{timestamp:$.toFixed(1)}:{},{getExperimentVariant:ei,exposeExperiment:en}=(0,S.jc)(),er=(0,C.O1)(null,{post:M,pub:D,user:U,useCustomDomainOverOpen:!0,params:(0,n._)({},et,U&&{showWelcomeOnShare:"treatment"===ei("show_welcome_screen_on_post_share")})}),eo=(0,C.B8)({post:M,pub:D}),ea={title:eo,url:er},el=(0,A.pm)(),{openModal:es,closeModal:ec}=(0,x.dd)(),ed=(0,N.K1)()&&navigator.share&&navigator.canShare&&navigator.canShare(ea),[eu,ep]=(0,a.eJ)(ed),eh=async()=>{if((0,I.j)(I.FP.POST_SHARE_BUTTON_CLICKED,{position:q,post_id:M.id}),ed&&eu)try{var e;await navigator.share(ea),en("show_welcome_screen_on_post_share"),(0,I.j)(I.FP.NATIVE_SHARE_SUCCESS,{medium:"web",post_id:null!==(e=M.id)&&void 0!==e?e:null,utm_campaign:j.VX.default}),(0,P.ex)("".concat(D.subdomain," shared"),!0);return}catch(e){if(!(e instanceof Error)||"AbortError"===e.name)return;ep(!1),(0,I.j)(I.FP.NATIVE_SHARE_FAILED,{errorName:e.name,errorMessage:e.message})}};if(void 0!==O.type)F=O;else{if(void 0!==(E=O).style&&void 0!==E.labelStyle){let e;e=M.share_url_override?M.share_url_override:O.isStatic?M?g.W.SHARE_URL:g.W.SHARE_PUB_URL:"javascript:void(0)";let t="none"===O.labelStyle;F=(0,o.tZ)(k.Ng,{style:O.style,icon:t?(0,o.tZ)(c.Z,{className:"icon",height:(0,k.Su)(O.style),strokeWidth:k.PA,width:(0,k.Su)(O.style)}):null,href:e,noLabel:"none"===O.labelStyle,className:s()(!t&&"no-icon"),children:"cta"===O.labelStyle&&G("Share")})}}return(0,o.tZ)(o.HY,{children:(0,o.BX)(R.M,{trigger:F,onOpen:eh,disableMenu:eu,layerOptions:{placement:"pub-preview"===q?"bottom-start":"bottom-end",preferX:"pub-preview"===q?"right":"left"},className:H.Z.dropdownMenu,maxHeight:"fit-content",ariaLabel:G("View share options"),children:[(0,o.tZ)(R.u,{leading:(0,o.tZ)(d.Z,{}),onClick:()=>{en("show_welcome_screen_on_post_share"),(0,C.Ui)({shareUrl:er,pub:D,post:M,utm_campaign:q,skipToast:!0,trackParams:et}),el.popToast(e=>(0,o.tZ)(A.FN,(0,r._)((0,n._)({},e),{text:G("Copied link to clipboard")}))),null==z||z()},children:G("Copy link")}),U&&(0,o.tZ)(Y,{url:er,onShare:()=>{(0,I.j)(I.FP.SHARE_LINK_CLICKED,{name:"direct_message",post_id:M.id,source:q}),null==z||z()}}),(0,o.tZ)(R.u,{leading:(0,o.tZ)(u.Z,{}),onClick:()=>{es({children:(0,o.tZ)(f.I,{post:M,pub:D,onClose:ec}),width:540})},children:G("Embed")}),(0,o.BX)(L.xw,{children:[(0,o.tZ)(R.u,{leading:(0,o.tZ)(Z.Z,{}),onClick:()=>{en("show_welcome_screen_on_post_share"),(0,C.BZ)({shareUrl:er,pub:D,post:M,utm_campaign:q,trackParams:et}),null==z||z()},children:G("Share to Notes")}),(0,o.tZ)(R.u,{leading:(0,o.tZ)(_.Z,{}),onClick:()=>{en("show_welcome_screen_on_post_share"),(0,C.Po)({shareUrl:er,pub:D,post:M,utm_campaign:q,trackParams:et}),null==z||z()},children:G("Share to Facebook")}),(0,o.tZ)(R.u,{leading:(0,o.tZ)(y.Z,{}),onClick:()=>{en("show_welcome_screen_on_post_share"),(0,C.lc)({shareUrl:er,pub:D,post:M,utm_campaign:q,trackParams:et}),null==z||z()},children:G("Share to Linkedin")}),(0,o.tZ)(R.u,{leading:(0,o.tZ)(b.Z,{}),onClick:()=>{en("show_welcome_screen_on_post_share"),(0,C.bI)({shareUrl:er,shareName:eo,pub:D,post:M,utm_campaign:q,trackParams:et}),null==z||z()},children:G("Share to Bluesky")}),(0,o.tZ)(R.u,{leading:(0,o.tZ)(w.Z,{}),onClick:()=>{en("show_welcome_screen_on_post_share"),(0,C.Wn)({shareUrl:er,shareName:eo,pub:D,post:M,utm_campaign:q,trackParams:et}),null==z||z()},children:G("Share to X")})]}),M.videoUpload&&(0,o.tZ)(L.xw,{children:(0,o.tZ)(W,{initialTime:null!=K?K:0,onChange:ee,maxTime:null!==(h=null!==(l=null===(t=M.videoUpload)||void 0===t?void 0:t.duration)&&void 0!==l?l:null===(i=M.podcastUpload)||void 0===i?void 0:i.duration)&&void 0!==h?h:null})}),V&&(0,o.tZ)(L.xw,{children:(0,o.tZ)(X.tu,{paddingX:8,paddingTop:4,paddingBottom:8,children:(0,o.tZ)(T.zx,{leading:(0,o.tZ)(p.Z,{size:16}),disabled:J,priority:"primary",onClick:()=>{(0,I.j)(I.FP.MEDIA_CLIP_BUTTON_CLICKED,{button:"create",source:"post share dropdown"}),(0,I.j)(I.FP.VIDEO_CLIP_BUTTON_CLICKED,{post_id:M.id,source:q,type:M.type}),Q({source:"post-share-dropdown",title:null}),null==z||z()},children:G("Create clip")})})})]})})}function Y(e){let{url:t,onShare:i}=e,{iString:n}=(0,B.M1)(),r=(0,D.B)();return(0,o.tZ)(R.u,{leading:(0,o.tZ)(h.Z,{}),onClick:()=>{r.open({linkAttachmentUrl:t,source:"share_post"}),null==i||i()},onMouseEnter:O.R,children:n("Send as message")})}},47851:function(e,t,i){i.d(t,{Z:()=>k});var n=i(27412),r=i(7409),o=i(99282),a=i(16584),l=i(18446),s=i.n(l),c=i(20160),d=i(93666),u=i(347),p=i(75697),h=i(77228),m=i(71094),g=i(95441),v=i(68833),f=i(59176),b=i(98914),_=i(19081),y=i(58175),Z=i(47929),w=i(87857);class k extends d.p{shouldComponentUpdate(e,t){return!s()(this.props,e)||!s()(this.state,t)}async open(){let e={title:(0,p.B8)((0,r._)({},this.props)),url:this.props.shareUrl||(0,p.O1)("direct",(0,r._)({medium:this.state.medium},this.props))};if((0,b.K1)()&&navigator.share&&navigator.canShare&&navigator.canShare(e))try{var t;await navigator.share(e),(0,v.j)(v.FP.NATIVE_SHARE_SUCCESS,{medium:this.state.medium||this.props.medium||"web",post_id:this.props.post?this.props.post.id:null,utm_campaign:this.state.utm_campaign||this.props.utm_campaign||"default"}),(0,f.ex)("".concat(null===(t=this.props.pub)||void 0===t?void 0:t.subdomain," shared"),!0);return}catch(e){if("AbortError"===e.name)return;(0,v.j)(v.FP.NATIVE_SHARE_FAILED,{errorName:e.name,errorMessage:e.message})}super.open()}fromEmail(){this.setState({medium:"email"},()=>{this.open()})}getClassName(){return"share-dialog"}onBeforeOpen(){this.setState({showButtons:!0})}onOpen(){(0,v.j)(v.FP.SHARE_DIALOG_OPENED,{medium:this.state.medium||this.props.medium||"web",post_id:this.props.post?this.props.post.id:null,utm_campaign:this.state.utm_campaign||this.props.utm_campaign||Z.VX.default})}onClose(){this.setState({copied:!1,utm_campaign:null})}renderChildren(e){var t;let{post:i,pub:n,comments:l,commentId:s,shareUrl:d}=e,g=l&&s&&l.find(e=>e.id===s),v=g?"comment":n&&!i?"publication":i?"post":void 0;return(0,a.tZ)(u.h,{children:(0,a.tZ)(c.W,{children:(0,a.BX)(_.tu,{className:w.Z.container,gap:24,padding:24,bg:"primary",radius:"md",border:"detail",children:[(0,a.tZ)(C,{type:v}),(0,a.tZ)(h.A,{type:v,pub:n,post:i,comment:g,shareUrl:d}),(0,a.tZ)(_.tu,{gap:16,children:(0,a.tZ)(m.k,(0,o._)((0,r._)({utm_campaign:null!==(t=this.state.utm_campaign)&&void 0!==t?t:void 0},this.props),{shareName:(0,p.B8)((0,r._)({},this.props)),shareUrl:d||(0,p.O1)(null,(0,r._)({medium:this.state.medium},this.props))}))})]})})})}constructor(e,t){super((0,r._)({},e),t),this.noFullscreen=!0}}(0,n._)(k,"contextType",g.wj);let C=e=>{let{type:t}=e,{iString:i}=(0,g.M1)();return(0,a.tZ)(y.xv.H4,{align:"center",flex:"grow",children:i(t?"Share this ".concat(t):"Share")})}},28905:function(e,t,i){i.d(t,{z:()=>u});var n=i(7409),r=i(98848),o=i(16584),a=i(30396),l=i(48980),s=i(19081),c=i(76820);let d=e=>{var{mediaAsset:t}=e,i=(0,r._)(e,["mediaAsset"]);let[n,s]=(0,a.eJ)(null);return((0,a.d4)(()=>{let e=async e=>{s(await (0,l.rd)("/api/v1/video/upload/".concat(e)))};t.media_upload_id&&e(t.media_upload_id)},[t.media_upload_id]),n)?(0,o.tZ)(c.Jl,{mediaUpload:n,composing:!1,videoPlayerProps:i}):null},u=e=>{var{mediaAssets:t=[]}=e,i=(0,r._)(e,["mediaAssets"]);return(0,o.tZ)(s.sg,{children:t.map(e=>(0,o.tZ)(d,(0,n._)({mediaAsset:e},i),e.media_upload_id))})}},84837:function(e,t,i){i.d(t,{DU:()=>b,Jt:()=>y,NE:()=>v,Ti:()=>m,WK:()=>_,bB:()=>Z,ee:()=>g,rS:()=>p,rv:()=>h,v5:()=>f});var n=i(7409),r=i(99282),o=i(98848),a=i(16584),l=i(7523),s=i(14952),c=i(58175),d=i(6070),u=i(48159);function p(e){var{children:t,paddingBottom:i=8}=e,u=(0,o._)(e,["children","paddingBottom"]);let p=(0,s.Ij)();return(0,d.HD)({pub:p})?(0,a.tZ)(l.Z,(0,r._)((0,n._)({},u),{preset:"h4-sans-condensed",style:{paddingBottom:i},children:t})):(0,a.tZ)(c.xv.H1,(0,r._)((0,n._)({},u),{style:{paddingBottom:8},children:t}))}function h(e){var{children:t,paddingBottom:i=8}=e,u=(0,o._)(e,["children","paddingBottom"]);let p=(0,s.Ij)();return(0,d.HD)({pub:p})?(0,a.tZ)(l.Z,(0,r._)((0,n._)({},u),{preset:"h6-sans",style:{paddingBottom:i},children:t})):(0,a.tZ)(c.xv.H2,(0,r._)((0,n._)({style:{paddingBottom:i}},u),{children:t}))}function m(e){var{children:t}=e,i=(0,o._)(e,["children"]);let u=(0,s.Ij)();return(0,d.HD)({pub:u})?(0,a.tZ)(l.Z,(0,r._)((0,n._)({},i),{preset:"d1-sans-regular",children:t})):(0,a.tZ)(c.xv.B1,(0,r._)((0,n._)({},i),{children:t}))}function g(e){var{children:t}=e,i=(0,o._)(e,["children"]);let u=(0,s.Ij)();return(0,d.HD)({pub:u})?(0,a.tZ)(l.Z,(0,r._)((0,n._)({},i),{color:"tertiary",preset:"detail-small",children:t})):(0,a.tZ)(c.xv.B4,(0,r._)((0,n._)({},i),{color:"secondary",children:t}))}function v(e){var{children:t}=e,i=(0,o._)(e,["children"]);let u=(0,s.Ij)();return(0,d.HD)({pub:u})?(0,a.tZ)(l.Z,(0,r._)((0,n._)({},i),{preset:"list-item-menu",children:t})):(0,a.tZ)(c.xv.B4,(0,r._)((0,n._)({},i),{children:t}))}function f(e){var{href:t,onClick:i,children:u}=e,p=(0,o._)(e,["href","onClick","children"]);let h=(0,s.Ij)();return(0,d.HD)({pub:h})?(0,a.tZ)(l.Z,(0,r._)((0,n._)({},p),{as:"a",href:t,preset:"list-item-menu",onClick:i,children:u})):(0,a.tZ)(c.xv.B4,(0,r._)((0,n._)({},p),{as:"a",href:t,onClick:i,children:u}))}function b(e){var{children:t}=e,i=(0,o._)(e,["children"]);let u=(0,s.Ij)();return(0,d.HD)({pub:u})?(0,a.tZ)(l.Z,(0,r._)((0,n._)({},i),{color:"tertiary",preset:"detail-small",children:t})):(0,a.tZ)(c.xv.B4,(0,r._)((0,n._)({},i),{color:"secondary",children:t}))}function _(e){var{children:t}=e,i=(0,o._)(e,["children"]);let u=(0,s.Ij)();return(0,d.HD)({pub:u})?(0,a.tZ)(l.Z,(0,r._)((0,n._)({},i),{preset:"lg-preview-byline",children:t})):(0,a.tZ)(c.xv.B4,(0,r._)((0,n._)({},i),{color:"secondary",children:t}))}function y(){return(0,a.tZ)("hr",{className:u.Z.hrSmall})}function Z(){return(0,a.tZ)("hr",{className:u.Z.hrLarge})}},76205:function(e,t,i){i.d(t,{Z:()=>c});var n=i(7409),r=i(16584),o=i(6400),a=i(94184),l=i.n(a),s=i(32351);class c extends o.Component{render(e){let{html:t,children:i,metadata:o}=e;return(0,r.BX)("div",{className:l()("pageContainer-PCEs9w","container-border"),children:[(0,r.tZ)(s.Metadata,(0,n._)({},o)),(0,r.tZ)("div",{className:"container",children:(0,r.BX)("div",{className:"page typography",children:[i,(0,r.tZ)("div",{className:"body markup",dangerouslySetInnerHTML:{__html:t}})]})})]})}}},46990:function(e,t,i){i.d(t,{Z:()=>l});var n=i(7409),r=i(99282),o=i(16584),a=i(64515);let l=e=>(0,o.BX)(a.l,(0,r._)((0,n._)({},e),{name:"FacebookIconCircle",svgParams:{height:24,width:24},children:[(0,o.tZ)("circle",{cx:"12",cy:"12",r:"11.75",fill:"white",stroke:"none"}),(0,o.tZ)("path",{d:"M12 0C5.37098 0 0 5.37089 0 11.9975C0 17.9844 4.38331 22.9414 10.1117 23.8491L10.1164 15.473H7.04998V12.0021H10.1164C10.1164 12.0021 10.1023 10.0269 10.1164 9.14743C10.1305 8.26797 10.3045 7.42142 10.7607 6.65008C11.4615 5.4555 12.5526 4.87237 13.893 4.70775C14.9935 4.57135 16.08 4.72183 17.1664 4.87237C17.2416 4.88176 17.2792 4.89115 17.3545 4.90529C17.3545 4.90529 17.3592 5.03225 17.3545 5.11222C17.3498 5.94933 17.3545 7.86819 17.3545 7.86819C16.8324 7.8588 15.9671 7.80706 15.3933 7.89641C14.4433 8.04221 13.8977 8.64891 13.8789 9.6036C13.8601 10.3467 13.8695 12.0021 13.8695 12.0021H17.2134L16.6726 15.473H13.8742V23.8491C19.612 22.9508 24 17.9844 24 11.9975C23.9953 5.37089 18.6243 0 11.9977 0Z",fill:"#1877f2",stroke:"none"})]}))},27543:function(e,t,i){i.d(t,{Z:()=>l});var n=i(7409),r=i(99282),o=i(16584),a=i(64515);let l=e=>(0,o.tZ)(a.l,(0,r._)((0,n._)({},e),{name:"LinkedInShareIcon",svgParams:{height:24,width:24,stroke:"none",viewBox:"0 0 72 72"},children:(0,o.BX)("g",{fill:"none",fillRule:"evenodd",stroke:"none",children:[(0,o.tZ)("path",{d:"M36,72 L36,72 C55.882251,72 72,55.882251 72,36 L72,36 C72,16.117749 55.882251,-3.65231026e-15 36,0 L36,0 C16.117749,3.65231026e-15 -2.4348735e-15,16.117749 0,36 L0,36 C2.4348735e-15,55.882251 16.117749,72 36,72 Z",fill:"#007EBB"}),(0,o.tZ)("path",{d:"M59,57 L49.959375,57 L49.959375,41.6017895 C49.959375,37.3800228 48.3552083,35.0207581 45.0136719,35.0207581 C41.3785156,35.0207581 39.4792969,37.4759395 39.4792969,41.6017895 L39.4792969,57 L30.7666667,57 L30.7666667,27.6666667 L39.4792969,27.6666667 L39.4792969,31.6178624 C39.4792969,31.6178624 42.0989583,26.7704897 48.3236979,26.7704897 C54.5455729,26.7704897 59,30.5699366 59,38.4279486 L59,57 Z M20.372526,23.8257036 C17.4048177,23.8257036 15,21.4020172 15,18.4128518 C15,15.4236864 17.4048177,13 20.372526,13 C23.3402344,13 25.7436198,15.4236864 25.7436198,18.4128518 C25.7436198,21.4020172 23.3402344,23.8257036 20.372526,23.8257036 Z M15.8736979,57 L24.958724,57 L24.958724,27.6666667 L15.8736979,27.6666667 L15.8736979,57 Z",fill:"#FFF",stroke:"none"})]})}))},76157:function(e,t,i){i.d(t,{Z:()=>s});var n=i(7409),r=i(99282),o=i(16584),a=i(4675),l=i(64515);let s=e=>(0,o.tZ)(l.l,(0,r._)((0,n._)({},e),{name:"LucideArrowLeftRight",svgParams:{height:24,width:24,fill:"#000000",strokeWidth:0},children:(0,o.tZ)(a.Z,{height:24,stroke:e.stroke,fill:e.fill,strokeWidth:e.strokeWidth})}))},42042:function(e,t,i){i.d(t,{Z:()=>l});var n=i(7409),r=i(99282),o=i(16584),a=i(64515);let l=e=>(0,o.tZ)(a.l,(0,r._)((0,n._)({},e),{name:"ShareSubstackIcon",svgParams:{height:24,width:24,viewBox:"0 0 24 24",stroke:"none"},children:(0,o.tZ)("path",{d:"M21.6608 8.55517H2.33838V5.9555H21.6617V8.55517H21.6608ZM2.33838 10.911V23L12 17.6008L21.6617 23V10.911H2.33838ZM21.6617 1H2.33838V3.59967H21.6617V1Z",fill:"var(--color-semantic-substack-bg-primary)",stroke:"none"})}))},20068:function(e,t,i){i.d(t,{Z:()=>l});var n=i(7409),r=i(99282),o=i(16584),a=i(64515);let l=e=>(0,o.tZ)(a.l,(0,r._)((0,n._)({},e),{name:"ShareTwitterIcon",svgParams:{height:24,width:24,stroke:"none"},children:(0,o.tZ)("path",{d:"M17.7508 2.96069H20.8175L14.1175 10.619L22 21.0382H15.8283L10.995 14.7182L5.46333 21.0382H2.395L9.56167 12.8465L2 2.96153H8.32833L12.6975 8.73819L17.7508 2.96069ZM16.675 19.2032H18.3742L7.405 4.69986H5.58167L16.675 19.2032Z",fill:"var(--color-fg-primary)",stroke:"none"})}))},39535:function(e,t,i){i.d(t,{Z:()=>s});var n=i(7409),r=i(99282),o=i(98848),a=i(16584),l=i(64515);let s=e=>{var{size:t=24,fill:i="var(--color-fg-primary)"}=e,s=(0,o._)(e,["size","fill"]);return(0,a.tZ)(l.l,(0,r._)((0,n._)({},s),{name:"XIcon",svgParams:{viewBox:"0 0 20 20"},width:t,height:t,fill:i,children:(0,a.tZ)("path",{stroke:"none",fillRule:"evenodd",clipRule:"evenodd",d:"M13.2879 19.1666L8.66337 12.575L2.87405 19.1666H0.424805L7.57674 11.0258L0.424805 0.833252H6.71309L11.0717 7.04577L16.5327 0.833252H18.982L12.1619 8.59699L19.5762 19.1666H13.2879ZM16.0154 17.3083H14.3665L3.93176 2.69159H5.58092L9.7601 8.54422L10.4828 9.55981L16.0154 17.3083Z"})}))}},16808:function(e,t,i){i.d(t,{_q:()=>I,hF:()=>N,xt:()=>P});var n=i(7409),r=i(16584),o=i(30396),a=i(94184),l=i.n(a),s=i(36808),c=i(47851),d=i(40647),u=i(68833),p=i(27036),h=i(98914),m=i(15771),g=i(19081),v=i(6490),f=i(58175),b=i(98012),_=i(34590),y=i(31742),Z=i(63651),w=i(84864),k=i(47929),C=i(2180);let S=y.Ic.LIKE_UPSELL_LAST_SHOWN_AT,B=()=>{let e=s.get(S);if(e){let t=(0,b.Z)(e),i=(0,b.Z)().subtract(30,"days");if(t.isAfter(i))return!1}return!0},x=e=>{s.set(S,(0,b.Z)().format(),(0,n._)({expires:3650},!e.custom_domain&&{domain:".".concat(new URL((0,Z.SVA)()).hostname)}))},I=e=>{var t,i;let{pub:a}=e,s=(0,d.xR)(),[c,p]=(0,o.eJ)(null==a?void 0:null===(t=a.plans)||void 0===t?void 0:t[0]),v=s.getConfigFor("disable_monthly_subscriptions"),b=s.getConfigFor("disable_annual_subscriptions");return(0,r.BX)(g.tu,{gap:20,children:[(0,r.BX)(g.tu,{gap:4,children:[(0,r.BX)(f.xv.H4,{weight:"semibold",children:["Support ",a.name]}),(0,r.BX)(f.xv.B4,{color:"secondary",children:["Since you liked this post, why not support ",a.name," with a subscription?"]})]}),(0,r.tZ)("form",{className:C.Z.form,children:(0,r.tZ)(g.tu,{gap:12,children:null==a?void 0:null===(i=a.plans)||void 0===i?void 0:i.map(e=>{if(("month"!==e.interval||!v)&&("year"!==e.interval||!b))return(0,r.tZ)("label",{className:C.Z.label,children:(0,r.BX)(g.gq,{gap:12,alignItems:"center",children:[(0,r.tZ)("input",{name:"plan",type:"radio",value:e.id,onInput:()=>p(e),checked:c&&c.id===e.id,className:l()({[C.Z.selectedInput]:c&&c.id===e.id},C.Z.input)}),(0,r.BX)(g.gq,{gap:8,children:[(0,r.tZ)(f.xv.B4,{as:"span",weight:"semibold",color:c&&c.id===e.id?"primary":"secondary",children:(0,w.getPlanTitle)(e,a.language)}),(0,r.tZ)(f.xv.B4,{as:"span",color:"secondary",children:(0,_.bP)(e)})]})]})},e.id)})})}),(0,r.tZ)(m.zx,{onClick:()=>{(0,u.j)(u.FP.LIKE_UPSELL_PLAN_SELECTED),(0,h.uX)((0,Z.W1P)(a,{params:(0,n._)({utm_source:k.b3.likeButtonUpsell},c&&{selectedPlanId:c.id})}),{local_navigation:!1})},flex:"grow",priority:"primary",children:"Select"})]})},P=e=>{let{onClose:t,shareDialogRef:i}=e;return(0,r.BX)(g.tu,{gap:20,children:[(0,r.BX)(g.tu,{gap:4,children:[(0,r.tZ)(f.xv.H4,{weight:"semibold",children:"Share this post with a friend"}),(0,r.tZ)(f.xv.B4,{color:"secondary",children:"Since you liked this post, why not share it to help spread the word?"})]}),(0,r.tZ)(m.zx,{onClick:()=>{var e;(0,u.j)(u.FP.LIKE_UPSELL_SHARE_CLICKED),null===(e=i.current)||void 0===e||e.open(),null==t||t()},flex:"grow",priority:"primary",children:"Share"})]})},N=e=>{let{user:t,pub:i,post:n}=e,a=(0,o.sO)(),l=B(),[s,d]=(0,o.eJ)(l),[m,g]=(0,o.eJ)(l);(0,o.d4)(()=>{(!l||(null==t?void 0:t.is_contributor)||(null==t?void 0:t.is_admin))&&(0,h.iO)("show_reaction_upsell")},[l,t]),(0,o.d4)(()=>{m&&s&&t&&((0,u.j)(u.FP.LIKE_UPSELL_MODAL_SEEN,{source:"email",type:(0,p.P)(t,i)?"share":"paid"}),x(i))},[m,s,i,t]);let f=()=>{d(!s),g(!1),(0,h.iO)("show_reaction_upsell")};return t&&!t.is_contributor&&!t.is_admin&&m?(0,r.BX)(r.HY,{children:[(0,r.tZ)(v.u_,{isOpen:s,onClose:f,children:(0,r.tZ)(v.fe,{children:(0,p.P)(t,i)?(0,r.tZ)(P,{pub:i,onClose:f,shareDialogRef:a}):(0,r.tZ)(I,{pub:i})})}),(0,r.tZ)(c.Z,{ref:a,user:t,pub:i,post:n})]}):null}},31815:function(e,t,i){i.d(t,{l:()=>G});var n=i(7409),r=i(99282),o=i(16584),a=i(30396),l=i(94184),s=i.n(l),c=i(39693),d=i.n(c),u=i(24350),p=i.n(u),h=i(25380),m=i(5463),g=i(32224),v=i(98661),f=i(82034),b=i(34057),_=i(20888),y=i(7523),Z=i(73207),w=i(14952),k=i(49688),C=i(98422),S=i(19081),B=i(58175),x=i(6070),I=i(60308),P=i(81821);let N={containerFP:"containerFP-Ndac1V",containerFp:"containerFP-Ndac1V",name:"name-mkZ7O7",imgFP:"imgFP-nsipp_",imgFp:"imgFP-nsipp_",toggleBox:"toggleBox-FyAfgO",selected:"selected-bOtT9y",previewLink:"previewLink-nVh1jb",img:"img-tyGf_Q",container:"container-Yff188",selectableContainer:"selectableContainer-nkPfNo",selectedContainer:"selectedContainer-jizK_g",clickableContainer:"clickableContainer-BH19PC",containerMobile:"containerMobile-MaSyfh",imgMobile:"imgMobile-afxbEf",selector:"selector-x5tcGg",unselected:"unselected-B90yNk",seeLatest:"seeLatest-OQwW6G"},T=e=>{var t,i,n,r,a;let{newsletter:l,hideLink:c=!1,onToggle:d,onClick:u,isTopicAlert:p=!1}=e,h=(0,w.Ij)(),{metadata:m}=(0,Z.I)({pub:h}),{metadata:g}=(0,Z.I)({pub:h,pubSetting:"fp_primary_column_section_ids"});u&&d&&console.error("you cannot pass both onToggle and onClick");let v=!!d;if((0,x.HD)({pub:h}))return(0,o.tZ)(E,{newsletter:l,onClick:u,onToggle:d,isTopicAlert:p});if((0,P.tq)())return(0,o.tZ)(X,{newsletter:l,hideLink:c,onClick:u,onToggle:d});let f=null!==(a=null===(t=m[null!==(n=l.sectionId)&&void 0!==n?n:-1])||void 0===t?void 0:t.frequency)&&void 0!==a?a:null===(i=g[null!==(r=l.sectionId)&&void 0!==r?r:-1])||void 0===i?void 0:i.frequency;return(0,o.BX)(S.tu,{className:s()(N.container,{[N.selectedContainer]:v&&l.selected,[N.selectableContainer]:v,[N.clickableContainer]:!!u}),justifyContent:"space-between",radius:"md",padding:16,onClick:v?e=>{e.stopPropagation(),null==d||d({sectionId:l.sectionId,isSelected:!l.selected})}:null!=u?u:void 0,children:[v&&l.selected?(0,o.tZ)(b.Z,{className:s()(N.selector)}):v?(0,o.tZ)("div",{className:s()(N.unselected,N.selector)}):null,(0,o.BX)(S.tu,{gap:24,children:[l.logoUrl&&(0,o.tZ)("div",{className:N.img,children:l.logoUrl&&(0,o.tZ)("img",{className:N.img,src:(0,I.zF4)(l.logoUrl,64)})}),(0,o.BX)(S.tu,{gap:8,children:[(0,o.BX)(B.xv.H3,{paddingRight:32*!l.logoUrl,weight:"semibold",color:"pub-primary-text",clamp:2,children:[l.name,f&&(0,o.BX)(o.HY,{children:[(0,o.tZ)("br",{}),(0,o.tZ)(B.xv.B4,{color:"secondary",weight:"semibold",children:f})]})]}),(0,o.tZ)(B.xv.B4,{color:"pub-secondary-text",clamp:4,children:l.description})]})]}),!c&&(0,o.tZ)(B.xv,{size:14,weight:"semibold",font:"text",color:"pub-secondary-text",children:(0,o.tZ)("a",{onClick:e=>e.stopPropagation(),className:N.seeLatest,href:l.linkUrl,native:!0,children:"See the latest"})})]})},E=e=>{var t,i,a,l,c,d,u,p,m,v,f;let{newsletter:b,onToggle:B,isTopicAlert:x}=e,{isMobile:I}=(0,C.v9)(),P=(0,w.Ij)(),{metadata:T,ids:E}=(0,Z.I)({pub:P}),{metadata:X,ids:L}=(0,Z.I)({pub:P,pubSetting:"fp_primary_column_section_ids"}),F=E.concat(L),{markdownProps:R}=(0,k.V)(b.description);if(!B)return null;let M=F.includes(null!==(c=b.sectionId)&&void 0!==c?c:-1),U=null!==(p=null===(t=T[null!==(d=b.sectionId)&&void 0!==d?d:-1])||void 0===t?void 0:t.frequency)&&void 0!==p?p:null===(i=X[null!==(u=b.sectionId)&&void 0!==u?u:-1])||void 0===i?void 0:i.frequency,A=null!==(f=null===(a=T[null!==(m=b.sectionId)&&void 0!==m?m:-1])||void 0===a?void 0:a.tagline)&&void 0!==f?f:null===(l=X[null!==(v=b.sectionId)&&void 0!==v?v:-1])||void 0===l?void 0:l.tagline;return(0,o.BX)(S.hs,{direction:I?"row":"column",gap:8,className:s()(N.containerFP,{[N.selectedContainerFP]:b.selected}),justifyContent:"space-between",padding:16,paddingRight:I?48:void 0,children:[(0,o.tZ)(S.tu,{className:s()(N.toggleBox,{[N.selected]:b.selected}),onClick:()=>{B({sectionId:b.sectionId,isSelected:!b.selected})},children:b.selected?(0,o.tZ)(h.Z,{color:"#FFFFFF",size:20}):(0,o.tZ)(g.Z,{color:"var(--color-fg-primary-themed)",size:20})}),b.logoUrl&&!x&&(0,o.tZ)("div",{children:(0,o.tZ)(_.e,{src:b.logoUrl,className:N.imgFP,maxWidth:80,imageIsFixedWidth:!0,useRetinaSizing:!0})}),(0,o.BX)(S.tu,{justifyContent:"space-between",style:{height:"100%"},children:[(0,o.BX)(S.tu,{gap:8,children:[(0,o.BX)(y.Z,{preset:"h7-sans",className:N.name,children:[b.name,A&&": ".concat(A)]}),(0,o.tZ)(y.Z,(0,r._)((0,n._)({},R),{preset:"d4-serif",clamp:4}))]}),M&&(0,o.BX)(S.gq,{gap:8,paddingTop:16,children:[(0,o.tZ)(y.Z,{className:N.previewLink,as:"a",preset:"caption",color:"accent",onClick:e=>e.stopPropagation(),href:b.linkUrl,native:!0,children:"Preview"}),U&&(0,o.tZ)(y.Z,{as:"a",preset:"caption",color:"tertiary",onClick:e=>e.stopPropagation(),href:b.linkUrl,native:!0,children:U})]})]})]})},X=e=>{var t,i;let{newsletter:n,hideLink:r,onClick:a,onToggle:l}=e,c=(0,w.Ij)(),{metadata:d}=(0,Z.I)({pub:c}),u=!!l,p=e=>{e.stopPropagation(),null==l||l({sectionId:n.sectionId,isSelected:!n.selected})},h=null===(t=d[null!==(i=n.sectionId)&&void 0!==i?i:-1])||void 0===t?void 0:t.frequency;return(0,o.BX)(S.tu,{className:s()(N.containerMobile,{[N.selectedContainer]:u&&n.selected,[N.selectableContainer]:u,[N.clickableContainer]:!!p}),justifyContent:"space-between",radius:"md",padding:16,onClick:u?p:null!=a?a:void 0,children:[u&&n.selected?(0,o.tZ)(b.Z,{className:s()(N.selector)}):u?(0,o.tZ)("div",{className:s()(N.unselected,N.selector)}):null,(0,o.BX)(S.tu,{gap:8,children:[(0,o.BX)(S.gq,{gap:8,children:[n.logoUrl&&(0,o.tZ)("img",{className:N.imgMobile,src:(0,I.zF4)(n.logoUrl,64)}),(0,o.tZ)(B.xv.B3,{paddingRight:32,weight:"semibold",color:"primary",font:"text",clamp:2,children:n.name})]}),(0,o.tZ)(B.xv.B4,{color:"secondary",clamp:2,font:"text",children:n.description}),h&&(0,o.BX)(B.xv.B4,{color:"secondary",weight:"semibold",children:["Frequency: ",h]})]}),!r&&(0,o.tZ)(B.xv,{translated:!0,size:14,weight:"semibold",font:"text",color:"pub-secondary-text",children:(0,o.tZ)("a",{href:n.linkUrl,native:!0,children:"See the latest"})})]})};var L=i(95441),F=i(98914);let R=e=>{let{newsletters:t,hideLinks:i,onNewsletterClick:n,justifyItems:r,isTopicAlert:a=!1}=e,{iString:l}=(0,L.M1)(),{isMobile:s}=(0,C.v9)(),c=(0,w.Ij)();return(0,o.BX)(S.hs,{direction:(0,x.HD)({pub:c})&&s?"column":"row",className:"container-AE41Ma",wrap:"wrap",justifyContent:r,gap:(0,x.HD)({pub:c})&&s?16:(0,x.HD)({pub:c})?40:24,children:[0===t.length&&(0,o.tZ)("div",{children:l("No additional newsletters")}),t.map((e,t)=>(0,o.tZ)(T,{newsletter:e,hideLink:i,isTopicAlert:a,onToggle:n?e=>{let{sectionId:t,isSelected:i}=e;n({sectionId:t,isSelected:i})}:void 0,onClick:i||(0,x.HD)({pub:c})?void 0:()=>{(0,F.uX)(e.linkUrl,{local_navigation:!1})}},t))]})};var M=i(347),U=i(44846),A=i(21061),D=i(98130),O=i(94778),z=i(7882),j=i(15771),H=i(61254),W=i(70379),q=i(24791),Y=i(14773),V=i(47929);let J={container:"container-moTuSH",large:"large-pO5KJu",newsletterList:"newsletterList-TOG54r",accountLink:"accountLink-UwyLNq",containerFP:"containerFP-TSfFix",dividerFP:"dividerFP-n4b0az",selectAll:"selectAll-z_I3hx",selectAllWrapper:"selectAllWrapper-CuXhFC"},K=e=>{let{pub:t,user:i,newsletters:l,freeSignupEmail:c,newsletter_management_token:u}=e,{ids:b}=(0,O.c)({pub:t}),{ids:_}=(0,D.L)({pub:t}),{ids:w}=(0,Z.I)({pub:t}),{ids:k}=(0,Z.I)({pub:t,pubSetting:"fp_primary_column_section_ids"}),{ids:B}=(0,A.l)({pub:t}),{isMobile:x}=(0,C.v9)(),{popToast:P}=(0,W.pm)(),N=p()(t.authorPagesInfo,"primary_section_id"),T=l.filter(e=>{var t,i,n;return!b.includes(null!==(t=e.sectionId)&&void 0!==t?t:-1)&&!_.includes(null!==(i=e.sectionId)&&void 0!==i?i:-1)&&!B.includes(null!==(n=e.sectionId)&&void 0!==n?n:-1)}).map(e=>{var i;let o=e.sectionId?N[e.sectionId]:void 0;return(0,r._)((0,n._)({},e),{linkUrl:o&&null!==(i=(0,I.rfk)({userId:o.user_id,pub:t}))&&void 0!==i?i:e.linkUrl})}),E=!!i||!!c,[X,L]=(0,a.eJ)(new Set);(0,v.useEffect)(()=>{if("undefined"!=typeof window&&E){var e;let t=new URL(window.location.href),i=Number(null!==(e=t.searchParams.get("unsubscribed_from"))&&void 0!==e?e:t.searchParams.get("subscribed_to")),a=T.find(e=>e.sectionId===i);a&&P(e=>(0,o.tZ)(W.FN,(0,r._)((0,n._)({},e),{Icon:h.Z,text:t.searchParams.get("unsubscribed_from")?"You will no longer receive emails for ".concat(a.name,"."):"You will start receiving emails for ".concat(a.name,".")})))}},[]);let{result:H,isLoading:q}=(0,z.ib)({pathname:"/api/v1/subscription",auto:E,query:{token:u}});(0,v.useEffect)(()=>{!q&&(null==H?void 0:H.email_settings)&&L(new Set(Object.keys(H.email_settings).filter(e=>"individual"===H.email_settings[e]).map(e=>Number(e))))},[q]);let{refetch:Y}=(0,z.ib)({pathname:"/api/v1/subscription/sections/email",auto:!1,method:"PATCH",query:{token:u},deps:[X]});if(q&&E)return(0,o.tZ)("div",{style:{minHeight:"100vh"}});let V=e=>{E&&Y({json:T.reduce((t,i)=>(i.sectionId&&(t[i.sectionId]={setting:e.has(i.sectionId)?"individual":"disabled"}),t),{})}).then(()=>{P(e=>(0,o.tZ)(W.FN,(0,r._)((0,n._)({},e),{Icon:h.Z,text:"Subscription updated!"})))})},K=e=>{let{sectionId:t,isSelected:i}=e;if(!t)return;let n=new Set(X);i?n.add(t):n.delete(t),V(n),L(n)},G=p()(T,"sectionId"),Q=d()(w.map(e=>G[e])),$=d()(k.map(e=>G[e])),ee=Q.some(e=>X.has(e.sectionId||0)),et=$.some(e=>X.has(e.sectionId||0)),ei=T.filter(e=>!k.includes(e.sectionId||-1)&&!w.includes(e.sectionId||-1)),en=ei.some(e=>X.has(e.sectionId||0)),er=(e,t)=>{let i;let n=("from-thefp"===e?$:"columns"===e?Q:ei).map(e=>e.sectionId||0),r=Array.from(X);V(i=new Set(t?r.concat(n):r.filter(e=>!n.includes(e)))),L(i)};return(0,o.BX)(M.h,{children:[(0,o.BX)("div",{className:s()("page","typography",J.container,J.large,J.containerFP,"the-free-press-theme"),children:[(0,o.BX)(S.tu,{gap:8,position:"relative",children:[(0,o.tZ)(y.Z,{preset:"h1-sans",children:"Newsletters"}),(0,o.BX)(y.Z,{preset:"d1-sans-regular",children:["The best of ",(0,o.tZ)("em",{children:"The Free Press"}),", directly in your inbox"]}),(null==i?void 0:i.is_admin)&&(0,o.tZ)(S.gq,{position:"absolute",style:{top:0,right:0},children:(0,o.tZ)(U.r,{pub:t,sectionType:"columns",user:i})})]}),(0,o.BX)(S.tu,{paddingY:48,gap:40,children:[!!$.length&&(0,o.BX)(S.tu,{gap:x?24:40,children:[(0,o.BX)(S.tu,{gap:8,children:[(0,o.BX)(S.gq,{justifyContent:"space-between",children:[(0,o.BX)(S.gq,{gap:16,alignItems:"baseline",children:[(0,o.tZ)(y.Z,{preset:"h4-sans-condensed",children:"From The Free Press"}),!x&&(0,o.tZ)(y.Z,{preset:"d3-serif",children:"As a subscriber, every week you’ll receive:"})]}),(0,o.tZ)(j.kG,{onClick:()=>{er("from-thefp",!et)},className:J.selectAllWrapper,style:{backgroundColor:"transparent",border:"none",cursor:"pointer"},children:(0,o.BX)(S.gq,{gap:12,alignItems:"center",children:[(0,o.tZ)(y.Z,{className:J.selectAll,preset:"detail-large",children:et?"Deselect All":"Select All"}),et?(0,o.tZ)(m.Z,{size:24,color:"var(--color-fg-primary-themed)"}):(0,o.tZ)(g.Z,{size:24,color:"var(--color-fg-primary-themed)"})]})})]}),(0,o.tZ)("div",{className:J.dividerFP}),x&&(0,o.tZ)(y.Z,{preset:"d3-serif",children:"As a subscriber, every week you’ll receive:"})]}),(0,o.tZ)(R,{newsletters:$.map(e=>(0,r._)((0,n._)({},e),{selected:X.has(e.sectionId||0)})),hideLinks:!1,onNewsletterClick:K,justifyItems:"start"})]}),(0,o.BX)(S.tu,{gap:x?24:40,children:[(0,o.BX)(S.tu,{gap:8,children:[(0,o.BX)(S.gq,{justifyContent:"space-between",children:[(0,o.tZ)(S.gq,{gap:16,alignItems:"baseline",children:(0,o.tZ)(y.Z,{preset:"h4-sans-condensed",children:"Featured"})}),(0,o.tZ)(j.kG,{onClick:()=>{er("columns",!ee)},className:J.selectAllWrapper,style:{backgroundColor:"transparent",border:"none",cursor:"pointer"},children:(0,o.BX)(S.gq,{gap:12,alignItems:"center",children:[(0,o.tZ)(y.Z,{className:J.selectAll,preset:"detail-large",children:ee?"Deselect All":"Select All"}),ee?(0,o.tZ)(m.Z,{size:24,color:"var(--color-fg-primary-themed)"}):(0,o.tZ)(g.Z,{size:24,color:"var(--color-fg-primary-themed)"})]})})]}),(0,o.tZ)("div",{className:J.dividerFP})]}),(0,o.tZ)(R,{newsletters:Q.map(e=>(0,r._)((0,n._)({},e),{selected:X.has(e.sectionId||0)})),hideLinks:!1,onNewsletterClick:K,justifyItems:"start"})]}),(0,o.tZ)(S.tu,{gap:40,children:(0,o.BX)(S.tu,{gap:x?24:40,children:[(0,o.BX)(S.tu,{gap:8,children:[(0,o.BX)(S.gq,{justifyContent:"space-between",alignItems:"baseline",children:[(0,o.BX)(S.gq,{gap:16,alignItems:"baseline",wrap:"wrap",children:[(0,o.tZ)(y.Z,{preset:"h4-sans-condensed",children:"Topic Alerts"}),!x&&(0,o.BX)(y.Z,{preset:"d3-serif",children:["Click to select which ",(0,o.tZ)("em",{children:"Free Press"})," stories you’d like delivered directly to your inbox, the moment we publish them:"]})]}),(0,o.tZ)(j.kG,{className:J.selectAllWrapper,onClick:()=>{er("topics",!en)},style:{backgroundColor:"transparent",border:"none",cursor:"pointer"},children:(0,o.BX)(S.gq,{gap:12,alignItems:"center",children:[(0,o.tZ)(y.Z,{className:J.selectAll,preset:"detail-large",children:en?"Deselect All":"Select All"}),en?(0,o.tZ)(m.Z,{size:24,color:"var(--color-fg-primary-themed)"}):(0,o.tZ)(g.Z,{size:24,color:"var(--color-fg-primary-themed)"})]})})]}),(0,o.tZ)("div",{className:J.dividerFP}),x&&(0,o.BX)(y.Z,{preset:"d3-serif",children:["Click to select which ",(0,o.tZ)("em",{children:"Free Press"})," stories you’d like delivered directly to your inbox, the moment we publish them:"]})]}),(0,o.tZ)(R,{newsletters:ei.map(e=>(0,r._)((0,n._)({},e),{selected:X.has(e.sectionId||0)})).sort((e,t)=>e.namet.name)),hideLinks:!1,onNewsletterClick:K,justifyItems:"start",isTopicAlert:!0})]})})]})]}),!E&&(0,o.tZ)(f.x,{isOpen:X.size>0,selectedNewsletters:X,user:i,pub:t,onSuccess:e=>{(0,F.uX)((0,I.Zs0)(t,{just_signed_up:!0,autoSubmit:!!e.body.prompt_to_login||void 0,email:e.body.email,skip_sections:!0,next:"/newsletters"}),{replace:!0,local_navigation:!1})}})]})},G=e=>{let{pub:t,user:i,freeSignupEmail:a,newsletter_management_token:l}=e,c=(0,v.useMemo)(()=>(0,q.tk)({pub:t,includeMainPub:!(0,x.HD)({pub:t}),excludePodcasts:(0,x.VL)({pub:t})||(0,x.HD)({pub:t})}).map(e=>(0,r._)((0,n._)({},e),{linkUrl:(0,I.rhs)(e.linkUrl,{utm_source:V.b3.newsletterPage}),selected:e.defaultOn})),[t]);return 0===c.length?("undefined"!=typeof window&&(window.location.href=(0,Y.SV)(t)),(0,o.tZ)("div",{children:"loading..."})):(0,x.HD)({pub:t})?(0,o.tZ)(K,{newsletter_management_token:l,newsletters:c,pub:t,user:i,freeSignupEmail:a}):(0,o.tZ)("div",{className:s()("page","typography",J.container),children:(0,o.tZ)(M.h,{children:(0,o.BX)(S.tu,{children:[(0,o.BX)(S.gq,{justifyContent:"space-between",alignItems:"center",children:[(0,o.BX)(S.tu,{gap:8,paddingBottom:40,paddingTop:48,children:[(0,o.tZ)(B.xv.H2,{color:"pub-primary-text",children:"Newsletters"}),(0,o.BX)(B.xv.B3,{color:"pub-secondary-text",children:["Get the best of ",t.name," in your inbox.",(null==i?void 0:i.is_subscribed)?(0,o.BX)(o.HY,{children:[" ","You can manage your subscription in your"," ",(0,o.tZ)("a",{className:J.accountLink,href:(0,I.mGw)(t),native:!0,children:"account settings"}),"."]}):""]})]}),(!i||!i.is_subscribed)&&(0,o.tZ)(j.zx,{priority:"primary",href:(0,I.W1P)(t,{addBase:!0,utm_source:V.b3.newsletterPage}),localNavigation:!1,children:"Subscribe"})]}),(0,o.tZ)(H.iz,{}),(0,o.tZ)("div",{className:J.newsletterList,children:(0,o.tZ)(R,{newsletters:c,hideLinks:!1,justifyItems:"start"})})]})})})}},56219:function(e,t,i){i.d(t,{Rs:()=>eV,SO:()=>ez,_q:()=>eW,a7:()=>eK,eu:()=>eA,lO:()=>eU,mV:()=>eq,nM:()=>eH,sY:()=>eG,xw:()=>eD});var n=i(27412),r=i(7409),o=i(99282),a=i(58865),l=i(16584),s=i(6400),c=i(30396),d=i(94184),u=i.n(d);i(39693),i(85564),i(7739),i(93220);var p=i(59543),h=i(80569),m=i.n(h),g=i(60826),v=i(7464),f=i(84844),b=i(16564),_=i(9573),y=i(89074),Z=i(59708),w=i(92828),k=i(75021),C=i(18787),S=i(90311),B=i(17350),x=i(16944),I=i(94442),P=i(3862),N=i(21316),T=i(85685),E=i(11712),X=i(94594),L=i(47851),F=i(33665),R=i(90156),M=i(72392),U=i(16506),A=i(85721),D=i(89276),O=i(25956),z=i(79160),j=i(70522),H=i(58319),W=i(57391),q=i(37168),Y=i(95441),V=i(30372),J=i(56629),K=i(68833),G=i(48980),Q=i(49762),$=i(27036),ee=i(98914),et=i(29927),ei=i(15771),en=i(61254),er=i(19081),eo=i(1844),ea=i(58175),el=i(70379),es=i(87989),ec=i(23776),ed=i(57641);i(98012);var eu=i(24791),ep=i(6070),eh=i(67914),em=i(60308),eg=i(26111),ev=i(63651),ef=i(81821),eb=i(84864),e_=i(47929),ey=i(59961);function eZ(){let e=(0,a._)(["The full video is for subscribers in the "," plan"]);return eZ=function(){return e},e}function ew(){let e=(0,a._)(["The full video is for subscribers in the Founding Member plan"]);return ew=function(){return e},e}function ek(){let e=(0,a._)(["The full video is for paid subscribers"]);return ek=function(){return e},e}function eC(){let e=(0,a._)(["This email is for subscribers in the "," plan"]);return eC=function(){return e},e}function eS(){let e=(0,a._)(["This email is for subscribers in the Founding Member plan"]);return eS=function(){return e},e}function eB(){let e=(0,a._)(["This email is for paid subscribers"]);return eB=function(){return e},e}function ex(){let e=(0,a._)(["Continue reading this post for free, courtesy of ","."]);return ex=function(){return e},e}function eI(){let e=(0,a._)(["This post is for subscribers in the "," plan"]);return eI=function(){return e},e}function eP(){let e=(0,a._)(["This post is for subscribers in the Founding Member plan"]);return eP=function(){return e},e}function eN(){let e=(0,a._)(["This post is for paid subscribers"]);return eN=function(){return e},e}function eT(){let e=(0,a._)(["Subscribe to "," to continue reading"]);return eT=function(){return e},e}function eE(){let e=(0,a._)(["Visit the author’s Substack to subscribe and read more."]);return eE=function(){return e},e}function eX(){let e=(0,a._)(["Visit ",""]);return eX=function(){return e},e}function eL(){let e=(0,a._)(["Support ",""]);return eL=function(){return e},e}function eF(){let e=(0,a._)(["Subscribe to ",""]);return eF=function(){return e},e}function eR(){let e=(0,a._)(["By ",""]);return eR=function(){return e},e}function eM(){let e=(0,a._)(["Subscribe to ",""]);return eM=function(){return e},e}let eU="focus-comment-input",eA=(e,t)=>!!e&&!e.invite_only&&!!t&&t.has_publication&&!t.is_admin&&!t.is_contributor&&!t.is_public_admin&&(0,$.P)(t,e),eD=(e,t,i,n)=>"enabled"===e.payments_state?!(null==t?void 0:t.is_subscribed):(null==t?void 0:t.is_free_subscribed)&&"disabled"===e.payments_state&&!e.invite_only?!n&&i&&!(null==t?void 0:t.is_pledged):!(null==t?void 0:t.is_free_subscribed);class eO extends s.Component{async loadReactors(){let e=await m().get("/api/v1/post/".concat(this.props.post.id,"/facepile"));this.setState({reactors:e.body.reactors,restackers:e.body.restackers})}async componentDidMount(){var e;this.props.paywall&&!this.props.postPreview&&(0,K.j)(K.FP.POST_PAYWALL_SHOWN,{post_id:this.props.post.id,post_audience:this.props.post.audience,post_type:this.props.post.type,user:this.props.user}),this._triggerShare=()=>this.triggerShare(),null===(e=this.containerRef.current)||void 0===e||e.addEventListener("share-post",this._triggerShare),this.props.post&&this.loadReactors(),.001>Math.random()&&(0,K.K8)({post:this.props.post});let t=(0,eg.x)("subscribe_prompt");t&&("paid"===t?this.props.popToast(e=>(0,l.tZ)(el.FN,(0,o._)((0,r._)({},e),{text:"Subscription purchased for ".concat(this.props.pub.name)}))):this.props.popToast(e=>(0,l.tZ)(el.FN,(0,o._)((0,r._)({},e),{text:"Subscribed to ".concat(this.props.pub.name)}))));let i=null;0x9f7afc3===this.props.post.id&&alert("userAgent: ".concat(navigator.userAgent)),(0,ef.tq)({checkFirst4:!0})&&(/Instagram/i.test(navigator.userAgent)?i="instagram":/(Messenger|FBAN|FBAV|FB_IAB)/i.test(navigator.userAgent)?i="facebook":/Twitter/i.test(navigator.userAgent)?i="twitter":/LinkedIn/i.test(navigator.userAgent)&&(i="linkedin")),i?this.setWebviewModalState(i):this.setPostPromptState()}componentWillUnmount(){if(this._triggerShare){var e;null===(e=this.containerRef.current)||void 0===e||e.removeEventListener("share-post",this._triggerShare)}this.props.stopInterval&&this.props.stopInterval()}isGiftPostEligible(){var e,t;let{getSettingFor:i,post:n,pub:r,referringUser:o,user:a}=this.props;return i("paywall_unlock_tokens")&&"only_paid"===n.audience&&n.teaser_post_eligible&&(!a||!a.is_subscribed)&&(0,ef.tq)({checkFirst4:!0})&&(null==o?void 0:null===(t=o.subscriptions)||void 0===t?void 0:null===(e=t.find(e=>e.publication_id===r.id))||void 0===e?void 0:e.membership_state)==="subscribed"}async setWebviewModalState(e){if(["facebook","twitter","linkedin"].includes(e)){let t="webview_app_upsell_".concat(e);this.context.exposeExperiment(t);let i=this.context.getExperimentVariant(t);i&&"control"!==i&&this.setState({showWebViewModal:{action:i,platform:e}})}else this.setState({showWebViewModal:{action:"follow",platform:e}})}async setPostPromptState(){var e;let{post:t,disableSubscribePrompt:i,readerIsSearchCrawler:n,pub:r,user:o,readerInstalledAt:a,referringUser:l,forceFollowPrompt:s}=this.props,c="newsletter"===t.type&&!0===this.props.getSettingFor("enable_post_page_conversion")&&!i&&!(0,ee.AE)()&&!n,d=!1;if(null===(e=document)||void 0===e?void 0:e.referrer)try{let e=new URL(document.referrer);d=!!e.hostname.match(/(^|\.)substack\.com$/)||e.hostname===window.location.hostname}catch(e){}let u=!1,p=this.props.skipFollowPrompt;this.isGiftPostEligible()&&["treatment_more_gifty","treatment_popover_gifty"].includes(this.context.getExperimentVariant("gift_post_unlocks_recipient_2"))&&(u=!0,p=!0);let h=!1;if(s)h=!0;else if(!eb.PUB_IDS_TO_NOT_SHOW_FOLLOW_PROMPT_ON.includes(r.id)&&!p&&c&&l&&l.name&&l.id!==(null==o?void 0:o.id)&&r.author_id!==l.id&&r.contributors.every(e=>e.user_id!==l.id)){let e=[];if(o)try{e=await (0,G.rd)("/api/v1/feed/following")}catch(e){console.warn("Failed to fetch following state",e)}h=!e.includes(l.id)}let m=c&&!u&&!h&&!this.props.paywall&&!this.props.freeSignup&&!o,g=!u&&!["video","podcast"].includes(t.type)&&!n&&(0,ef.tq)({checkFirst4:!0})&&!a&&!d,v=!1;g&&!m&&(this.context.exposeExperiment("app_install_prompts"),"drawer"===this.context.getExperimentVariant("app_install_prompts")&&(v=!0,h=!1)),this.setState({shouldShowGiftPostPrompt:u,shouldShowFollowPrompt:h,shouldShowSubscribePrompt:m,appUpsellEligible:g,mountAppUpsellFooter:v})}triggerShare(){var e,t;let{fromEmail:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i?null===(e=this.shareDialogRef.current)||void 0===e||e.fromEmail():null===(t=this.shareDialogRef.current)||void 0===t||t.open()}onBottomReached(e){this.state.bottomReached||this.props.postPreview||(this.setState({bottomReached:!0}),(0,K.xG)({post:this.props.post,hasPaywall:e,surface:"publication",trackerUuid:this.props.getCurrentUuid()}))}shouldShowUFI(){let{fromPostPage:e,user:t,pub:i,getSettingFor:n}=this.props,{canShowSubscribeFooterAfterPost:r}=this.state;return!!e&&!!r&&eD(i,t,!!n("payment_pledges_enabled"),this.shouldShowRecommendCta)}shouldTrackPaywallPostSeen(){if("undefined"==typeof window)return!1;let e=document.createElement("div"),t=this.props.post.body_html;e.innerHTML=t;let i=this.props.pub.post_preview_limit||eb.DEFAULT_PREVIEW_LIMIT,n="",r=!1;for(let t=e.childNodes.length-1;t>=0;t--){let o=e.childNodes[t];if(o&&(n+=o.textContent).length>i){r=!0;break}}return r}render(e,t){var i,n,a,s,c,d,h,m;let g,{user:f,pub:_,post:x,freeSignup:P,freeSignupEmail:N,isServingFreePodcastUrl:T,isShowsPost:F,isTheFreePressTheme:O,reaction_token:j,invisible:W,paywall:q,onChange:Y,hideTitle:V,noTitleLink:J,showComments:G,fromPostPage:$,freeTrialCoupon:ee,showRestackModal:et,stripe_publishable_key:en,crossPostInfo:eo,iString:ea,iTemplate:es,themeVariables:ed,referringUser:eh,renderComments:em,renderContent:eg,getSettingFor:eb,startInterval:e_,forceFollowPrompt:eT}=e,{showTranscription:eE,truncated:eX,autoPlayVoiceOver:eL,reactors:eF,restackers:eR,shouldShowFollowPrompt:eM,shouldShowSubscribePrompt:eU,shouldShowGiftPostPrompt:eA,appUpsellEligible:eD,mountAppUpsellFooter:eO,showWebViewModal:ez}=t;if(x.is_geoblocked)return(0,l.tZ)(eQ,{});let eW=(0,ep.HD)({pub:_}),eV=!!this.context.getConfigFor("like_posts_enabled"),eG=(0,Z.N1)(null!==(s=eX||x.body_html)&&void 0!==s?s:"",eW?"h1, h2, h3":"h1, h2, h3, h4"),e$=!q||q&&this.shouldTrackPaywallPostSeen();e_&&e$&&e_({postId:this.props.post.id,containerElementRef:this.containerRef,elementIsStatic:!0});let e0="video"===x.type&&!q&&(null===(i=x.videoUpload)||void 0===i?void 0:i.transcription),e1=this.shouldShowUFI()&&!(0,ep.HD)({pub:_}),e4=eK(x),e2=!!eF&&eF.length>0,e8=!!(eb("paywall_unlock_tokens")&&"only_paid"===x.audience&&x.teaser_post_eligible),e3=e8&&!(null==f?void 0:f.is_subscribed)&&((null==f?void 0:f.is_free_subscribed)||P)&&!(null==f?void 0:f.has_redeemed_post_unlock_token),e6=(0,ef.tq)({checkFirst4:!0});e8&&this.isGiftPostEligible()&&(this.context.exposeExperiment("gift_post_unlocks_recipient_2"),["treatment_more_gifty","treatment_popover_gifty"].includes(this.context.getExperimentVariant("gift_post_unlocks_recipient_2"))&&(e3=!0,g=this.context.getExperimentVariant("gift_post_unlocks_recipient_2")));let e5="";e5="video"===x.type?"founding"===x.audience&&(0,eu.H$)(_)?es(eZ(),null!==(c=(0,eu.H$)(_))&&void 0!==c?c:""):es("founding"===x.audience?ew():ek()):"adhoc_email"===x.type?"founding"===x.audience&&(0,eu.H$)(_)?es(eC(),null!==(d=(0,eu.H$)(_))&&void 0!==d?d:""):es("founding"===x.audience?eS():eB()):e3?e6?ea("Continue reading this post for free in the Substack app"):es(ex(),_.author_name||_.name):"founding"===x.audience&&(0,eu.H$)(_)?es(eI(),null!==(h=(0,eu.H$)(_))&&void 0!==h?h:""):es("founding"===x.audience?eP():eN());let e9=(0,l.BX)(D.j,{disabled:!O,post:x,isShowsPost:F,children:[(0,l.tZ)("div",{className:"available-content",children:eE?(0,l.tZ)("div",{className:"container tw-py-12",children:(0,l.tZ)(ec.Z,{post:x,pub:_,user:f,playerRef:this.videoPlayer})}):(0,l.tZ)(E.Z,{html:eX||x.body_html||null,pub:_,trackSelection:!0,post:x,themeVariables:ed,canRestackImage:this.context.getConfigFor("restack_with_image"),user:f,freeSignup:P,freeSignupEmail:N,paywall:q,showing_behind_paywall:!!x.post_paywall_content_for_google})}),x.post_paywall_content_for_google&&(0,l.tZ)("div",{className:"paywall-content",children:(0,l.tZ)(E.Z,{html:x.post_paywall_content_for_google,pub:_,trackSelection:!1,post:x,user:f,freeSignup:P,freeSignupEmail:N,paywall:q})}),!W&&e$&&(0,l.tZ)(H.Z,{onVisible:()=>this.onBottomReached(!!q)})]}),e7=(0,ep.kb)({pub:_}),te=eW?(0,l.tZ)(U.Z,{post:x,user:f,pub:_,freeSignupEmail:N}):(0,l.tZ)(C.f1,(0,r._)({user:f,freeSignupEmail:N,freeSignup:P,publication:_,post:x,coupon:!0===this.props.paywall&&this.props.pub.paywall_free_trial_enabled?ee:null,showPostUnlockPrompt:!!e3,magicToken:j,giftingUser:eh,treatmentVariantForGiftPostPaywall:g,onPostUnlockError:()=>this.props.popToast(e=>(0,l.tZ)(el.FN,(0,o._)((0,r._)({},e),{text:ea("Teaser posts are not currently available for this content")})))},Object.assign({title:e5,reauthenticationTitle:ea("To read this, please re-authenticate.")},q)));return(0,l.BX)("article",{className:u()("typography ".concat(x.type,"-post post"),{"tw-p-0":"podcast"===x.type,"shows-post":F,"full-width-image-header":(null===(n=x.postTheme)||void 0===n?void 0:n.header_variant)==="full-width-image",[null!==(m=ey.Z.bottomWithTos)&&void 0!==m?m:"undefined"]:_.has_custom_tos}),ref:this.containerRef,children:[(null==f?void 0:f.is_contributor)&&(null==x?void 0:x.id)&&(null==x?void 0:x.type)==="page"&&(0,l.tZ)(ei.zx,{priority:"secondary",href:(0,ev.ANx)(_,x.id,{params:{back:document.location.href}}),localNavigation:!1,leading:(0,l.tZ)(p.Z,{size:20}),children:ea("Edit")}),(0,l.tZ)(eJ,{post:x,user:f,onChange:Y}),(0,l.tZ)(L.Z,{ref:this.shareDialogRef,user:f,pub:_,post:x,reaction_token:j,source:"email-share"}),eA&&(0,l.tZ)(k.f,{user:f,post:x,pub:_,referringUser:eh,freeSignupEmail:N,variant:this.context.getExperimentVariant("gift_post_unlocks_recipient_2")}),eM&&(0,l.tZ)(w.yi,{pub:_,post:x,referringUser:eh,freeSignupEmail:N,forceFollowPrompt:eT,surface:"post-follow-referrer-prompt"}),eU&&(0,l.tZ)(R.H,{pub:_,post:x,stripe_publishable_key:en,sharer:eh,appUpsellEligible:!!eD}),eO&&(0,l.tZ)(v.m,{pub:_,slug:x.slug}),ez&&(0,l.tZ)(v.p,{pub:_,slug:x.slug,action:ez.action,platform:ez.platform}),eg?(0,l.BX)(l.HY,{children:[!W&&(0,l.tZ)(H.Z,{onVisible:()=>{this.onTopReached(!!q)}}),eg({comments:em?em():null,crossPostInfo:eo,postContent:(0,l.BX)(l.HY,{children:[e9,!!(q&&!x.post_paywall_content_for_google&&!T)&&te]})})]}):(0,l.BX)(l.HY,{children:[(0,l.tZ)(eq,{user:null!=f?f:null,pub:_,post:x,isOnPostPage:!0,reaction_token:j,allowEdit:!0,showShare:!0,showSubtitle:!0,showPhoto:!0,showCommentRestack:!_.hide_post_restacks,hideTitle:!!V,noTitleLink:!!J,onChange:Y,hideDate:"page"===x.type,hideAudience:"page"===x.type,showReactions:eV,showComments:!!G,showLabel:!0,showUpdatedIcons:!0,fromPostPage:!!$,onClickCommentButton:this.onCommentButtonClicked,reactors:eF,showRestackModal:!!et,showTranscriptionButton:!!e0,onTranscriptionClick:this.onTranscriptionClick,autoPlayVoiceOver:eL}),!W&&e$&&(0,l.tZ)(H.Z,{onVisible:()=>this.onTopReached(!!q)}),(x.has_voiceover||!!x.voiceoverUpload)&&!O&&(0,l.tZ)(b.KH,{pub:_,post:x,mediaUploadId:x.voiceover_upload_id,duration:null===(a=x.voiceoverUpload)||void 0===a?void 0:a.duration,autoPlay:eL,href:x.canonical_url,isPaywalled:!x.voiceover_upload_id}),!x.voiceoverUpload&&eL&&e4&&(0,l.tZ)(z.r,{postId:x.id,onClose:()=>{(0,K.j)(K.FP.LISTEN_TO_THIS_POST_MODAL_DISMISSED,{post_id:x.id}),this.setState({autoPlayVoiceOver:!1})}}),eo?(0,l.tZ)(y.F,{postType:x.type,crossPostInfo:eo}):null,(0,l.BX)("div",{children:[eG&&eW&&(0,l.tZ)(A.T,{toc:eG,title:x.title,commentCount:x.comment_count,wordCount:x.wordcount}),eG&&!eW&&(0,l.tZ)(M.o,{toc:eG,position:"fixed"}),e9,q&&!x.post_paywall_content_for_google?(0,l.BX)(l.HY,{children:[te,(0,l.tZ)(B.i,{post:x})]}):eX?(0,l.tZ)("p",{children:(0,l.BX)(ei.zx,{className:"expander",onClick:()=>this.setState({truncated:null}),children:["+ ",ea("show full post")]})}):!["page"].includes(null==x?void 0:x.type)&&(0,l.BX)(l.HY,{children:[e1&&(0,l.tZ)(eH,{pub:_,post:x,user:f,freeSignup:!!P,freeSignupEmail:N}),!e1&&this.shouldShowRecommendCta&&(0,l.tZ)(X.o,{pub:_}),eo&&("only_paid"===x.audience||"founding"===x.audience)&&(0,l.tZ)(ej,{pub:_}),(0,Q.default)("like_posts_enabled")&&_.community_enabled&&e2&&!O&&(0,l.tZ)(er.X2,{borderTop:"detail-themed",paddingY:16,children:(0,l.tZ)(S.fB,{post:x,pub:_,user:f,reactors:eF,secondaryFaces:eR})}),!O&&(0,l.tZ)("div",{className:"post-footer",children:(0,l.tZ)(I.Mp,{post:x,pub:_,user:f,onChange:Y,postReactionToken:j})}),(0,l.tZ)(B.i,{post:x})]}),x.show_guest_bios&&"podcast"!==x.type&&!eW&&!e7&&(0,l.tZ)(eY,{user:f,pub:_,post:x})]})]})]})}constructor(e,t){var i,r;super(e,t),(0,n._)(this,"containerRef",void 0),(0,n._)(this,"shareDialogRef",void 0),(0,n._)(this,"podcastCommentInput",void 0),(0,n._)(this,"podcastPlayer",void 0),(0,n._)(this,"videoPlayer",void 0),(0,n._)(this,"shouldShowRecommendCta",void 0),(0,n._)(this,"_triggerShare",void 0),(0,n._)(this,"onTopReached",e=>{this.state.topReached||this.props.postPreview||(this.setState({topReached:!0}),(0,K.jJ)({post:this.props.post,hasPaywall:e,surface:"publication",markRead:!!this.props.user&&!this.props.noPageView,user:this.props.user,trackerUuid:this.props.getCurrentUuid()}))}),(0,n._)(this,"onTranscriptionClick",()=>{this.setState(e=>({showTranscription:!e.showTranscription}))}),(0,n._)(this,"onCommentButtonClicked",e=>{this.props.showComments&&!this.props.post.comment_count&&(e.stopPropagation(),e.preventDefault(),document.dispatchEvent(new CustomEvent(eU)))});let o={showTranscription:!1,autoPlay:!1,autoPlayVoiceOver:!1,commentSort:null!==(r=e.post.default_comment_sort)&&void 0!==r?r:"best_first",loadedWithHeaderLink:"undefined"!=typeof window&&(null===(i=window.location.hash)||void 0===i?void 0:i.startsWith("#".concat(encodeURIComponent("\xa7")))),reactors:null,feedUrl:null,shouldShowSubscribePrompt:!1,shouldShowFollowPrompt:!1};e.paywall||e.post.hidden||!e.post.body_html||(o.canShowSubscribeFooterAfterPost=eV(e.post.body_html),o.truncated=e.truncateAt?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e4,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;if("undefined"==typeof window)return null;let n=document.createElement("div");if(n.innerHTML=e,null===n.textContent||n.textContent.length1&&n.textContent.length>i);return n.innerHTML}(e.post.body_html,e.truncateAt,e.truncateTo):null),"undefined"!=typeof window&&window.history.replaceState&&("true"===(0,eg.x)("autoPlay")&&(window.history.replaceState({},document.title,(0,em.rhs)({autoPlay:null})),o.autoPlay=!0),"true"===(0,eg.x)("play_audio")&&(window.history.replaceState({},document.title,(0,em.rhs)({play_audio:null})),o.autoPlayVoiceOver=!0)),this.state=o,this.containerRef=(0,s.createRef)(),this.shareDialogRef=(0,s.createRef)(),this.podcastCommentInput=(0,s.createRef)(),this.podcastPlayer=(0,s.createRef)(),this.videoPlayer=(0,s.createRef)(),this.shouldShowRecommendCta=eA(e.pub,e.user)}}(0,n._)(eO,"contextType",q.WH),(0,n._)(eO,"displayName","Post");let ez=(0,el.dd)((0,W.f9)((0,J.us)((0,Y.fz)((0,V.aG)(eO))))),ej=e=>{let{pub:t}=e,{iTemplate:i}=(0,Y.M1)();return(0,l.BX)(l.HY,{children:[(0,l.tZ)(en.iz,{paddingTop:16}),(0,l.BX)(er.sg,{gap:16,paddingY:32,alignItems:"center",children:[(0,l.BX)(er.sg,{gap:8,paddingBottom:8,children:[(0,l.tZ)(ea.xv.H4,{flex:"grow",align:"center",children:i(eT(),t.name)}),(0,l.tZ)(ea.xv.B3,{flex:"grow",align:"center",color:"secondary",children:i(eE())})]}),(0,l.tZ)(ei.zx,{priority:"primary",onClick:()=>{(0,K.j)(K.FP.POST_END_CTA_CLICKED,{type:"cross-post"}),(0,ee.uX)((0,ev.W1P)(t,{params:{utm_source:e_.b3.postEndCta,addBase:!0}}),{local_navigation:!1})},children:i(eX(),t.name)})]})]})},eH=e=>{let{pub:t,post:i,user:n,freeSignup:r,freeSignupEmail:o,overridePledgesEnabled:a}=e,{iString:s,iTemplate:d}=(0,Y.M1)(),{getSettingFor:u}=(0,J.So)(),[p,h]=(0,c.eJ)(null),m=(0,eg.x)("just_subscribed"),g="disabled"===t.payments_state&&!t.invite_only&&(u("payment_pledges_enabled")||a),v="enabled"===t.payments_state&&(null==n?void 0:n.is_free_subscribed)&&!(null==n?void 0:n.is_subscribed)?"paid_upsell":g&&(null==n?void 0:n.is_free_subscribed)&&!(null==n?void 0:n.is_pledged)?"pledge_upsell":"free_upsell",f=g&&(null==n?void 0:n.is_free_subscribed)&&!(null==n?void 0:n.is_pledged);(0,c.d4)(()=>{(0,K.j)(K.FP.POST_END_CTA_RENDERED,{pub_id:t.id,post_id:i.id,type:v})},[t.id,i.id,v,f,null==n?void 0:n.is_free_subscribed]);let b=(0,eb.getByLine)(t);return(0,l.BX)(l.HY,{children:[(0,l.tZ)(en.iz,{paddingTop:16}),(0,l.tZ)(H.Z,{onVisible:()=>{(0,K.j)(K.FP.POST_END_CTA_SEEN,{pub_id:t.id,post_id:i.id,type:v})}}),(0,l.BX)(er.sg,{gap:16,paddingY:32,children:[(0,l.BX)(er.sg,{gap:8,paddingBottom:8,children:[(0,l.tZ)(ea.xv.H4,{flex:"grow",align:"center",children:d(g&&(null==n?void 0:n.is_free_subscribed)?eL():eF(),t.name)}),(0,l.BX)(ea.xv.B3,{flex:"grow",align:"center",color:"secondary",children:[b?d(eR(),b):null,b&&t.rankingDetail?" \xb7 ":null,t.rankingDetail]}),t.hero_text&&(0,l.tZ)(ea.xv.B3,{color:"primary",flex:"grow",align:"center",children:t.hero_text})]}),(0,l.tZ)(er.sg,{alignItems:"center",gap:16,children:f?(0,l.tZ)(ei.zx,{priority:"primary",onClick:()=>{(0,K.j)(K.FP.POST_END_CTA_CLICKED,{type:"pledge"}),(0,ee.uX)((0,ev.W1P)(t,{params:{utm_source:e_.b3.postEndCta}}),{local_navigation:!1})},children:s("Pledge your support")}):(0,l.BX)(l.HY,{children:[(0,l.tZ)(F.Z,{pub:t,post:i,user:n,freeSignup:r,freeSignupEmail:o,isStatic:!1,onPrepareData:()=>{h(null)},source:"post-end-cta",className:ey.Z.subscribeWidget}),p&&(0,l.tZ)(eo.y,{align:"center",children:p}),!(null==n?void 0:n.is_free_subscribed)&&!m&&(0,l.tZ)(er.sg,{maxWidth:400,children:(0,l.tZ)(ed.O,{includeCheckbox:!1,addSubscribePreamble:!0,color:"secondary",textAlign:"center"})})]})})]})]})},eW=e=>{let{pub:t}=e;return(0,l.BX)("div",{className:"post-silhouette",children:[(0,l.tZ)("div",{className:"post-silhouette-title"}),(0,l.tZ)("div",{className:"post-silhouette-meta ".concat(t&&t.bylines_enabled&&t.byline_images_enabled?"with-byline-image":"")}),(0,l.tZ)("div",{className:"post-silhouette-body"})]})},eq=e=>{var t,i,n,r;let o,{allowEdit:a,allowSendEmail:s,allowTruncate:c,base_url:d,children:p,className:h,hideAudience:m,hideDate:v,hideTitle:b,hidePinning:y,noTitleLink:Z,isStatic:w,isFreePreview:k,is_draft:C,onChange:B,post:T,pub:E,reaction_token:X,showComments:L,showDatetime:F,showEmailSent:R,showReactions:M,showShare:U,showAppUpsell:A,showSubtitle:D,showPhoto:z,showLabel:j,showRestack:H,showCommentRestack:W,hideAuthor:q,user:V,utm_source:J,showUpdatedIcons:K,fromPostPage:G,onClickCommentButton:Q,reactors:$,inThreadHead:ee,publishedPost:et,compEndsSoon:ei,compEndedRecently:en,siteConfigValues:eo={},eligibleForTTS:el,showRestackModal:es,showIcon:ec,isOnPostPage:ed,showTranscriptionButton:eu,onTranscriptionClick:em,isAppMode:eg=!1,republishingPost:ey,autoPlayVoiceOver:eZ=!1}=e,{iString:ew}=(0,Y.M1)(),ek=(0,ef.tq)({checkFirst4:!0}),eC=ey||T,eS="number"==typeof c?c:45,eB=T.title&&T.title.length>eS,ex=C?T.draft_title:T.title,eI=[(ec||"thread"===T.type)&&(0,l.tZ)(N.m,{postType:T.type,isStatic:w,height:15,className:T.type}),eB&&c?(0,eb.truncateWords)(ex,eS):ex],eP=C?T.draft_subtitle:T.subtitle;T.section_id&&E.sections&&E.sections.length&&(T.section=E.sections.find(e=>e.id===T.section_id));let eN=(0,eh.B9)({pub:E,subscriptionType:null==V?void 0:V.subscription_type}),eT=!["page"].includes(null==T?void 0:T.type),eE=eT&&w&&ei&&!eN&&(null==eo?void 0:eo.continue_support_cta_in_newsletter_emails),eX=eK(T)||el||T.voiceoverUpload,eL=(null==T?void 0:T.type)==="adhoc_email",eF=eT&&w&&!eL&&!eg,eR=(0,ep.HD)({pub:E})&&(!!T.postTheme||["video","podcast"].includes(T.type)&&ee);o=T.post_url_override?T.post_url_override:w&&eg?g.W.POST_TITLE_APP_MODE_URL:w?g.W.POST_TITLE_URL:"".concat((0,ev.uRy)(E,T)).concat(J?"?utm_source=".concat(J):"");let eM="".concat(E.base_url+(eC.section?(0,ev.Ucy)(E,{section:eC.section}):""),"/?utm_source=").concat(e_.b3.substack,"&utm_medium=").concat(e_.lP.menu);return eR?(0,l.tZ)(O.I,{post:T,postTheme:T.postTheme,title:ex,subtitle:eP,pub:E,inThreadHead:!!ee,autoPlayVoiceOver:eZ}):(0,l.BX)("div",{className:u()("post-header",h),role:"region","aria-label":ew("Post header"),children:[(0,ep.kb)({pub:E})&&(null!==(r=null===(t=T.postTags)||void 0===t?void 0:t.length)&&void 0!==r?r:0)>0&&(0,l.tZ)(er.X2,{alignItems:"center",gap:4,paddingBottom:8,children:null===(i=T.postTags)||void 0===i?void 0:i.map((e,t)=>(0,l.BX)(l.HY,{children:[0!==t&&(0,l.tZ)(ea.xv.Meta,{children:"—"}),(0,l.tZ)(ea.xv.Meta,{as:"a",size:14,href:(0,ev.Mk9)(E,e),children:e.name})]}))}),j&&T.section&&(0,l.tZ)(er.X2,{className:"post-label",children:(0,l.tZ)(ea.xv.Meta,{as:"a",size:14,href:eM,children:null===(n=eC.section)||void 0===n?void 0:n.name})}),eE&&(0,l.tZ)(_.v,{post:T,compAlreadyExpired:en}),!b&&(0,l.tZ)("h1",{className:u()("post-title",T.is_published?"published":"restack"!==T.type||ey?"adhoc_email"===T.type?"adhoc":"unpublished":"email-only-cross-post",{"post-title--the-pillar":(0,ep.kb)({pub:E})}),children:Z?eI:(0,l.tZ)("a",{href:o,children:eI})}),D&&eP&&(0,l.tZ)("h3",{className:u()("subtitle",{"subtitle--the-pillar":(0,ep.kb)({pub:E})}),children:eP}),"page"===T.type?(0,l.tZ)("div",{style:{height:32}}):ed&&!w?(0,l.BX)(er.sg,{paddingBottom:16,"aria-label":ew("Post UFI"),role:"region",children:[(0,l.tZ)(er.sg,{paddingY:16,children:(0,l.tZ)(P.E,{post:T,pub:E})}),(0,l.tZ)(f.j,{user:V,isMobile:ek,post:T}),ek?G&&(0,l.tZ)(I.mt,{post:T,pub:E,user:V,isStatic:!!w,postReactionToken:X,onChange:B,allowEdit:a,hidePinning:y,showEmailSent:R,allowSendEmail:s,hideComments:!L,onCommentsClick:Q,showRestackModal:es}):(0,l.tZ)(I.Mp,{post:T,pub:E,user:V,onChange:B,showRestackModal:es,showTranscriptionButton:eu,onTranscriptionClick:em,showClipping:"video"===T.type,postReactionToken:X})]}):(0,l.BX)(l.HY,{children:[!eT||w||et||ee?eT&&!w&&et?(0,l.tZ)(I._2,{post:T,pub:E,user:V,style:"compressed",labelStyle:"counts-or-none",postReactionToken:X,showEmailSent:R,hideShare:!U||"restack"===T.type,hideComments:"restack"===T.type,hideSavePost:"restack"===T.type,hideReactions:"restack"===T.type,showPreamble:!0,onChange:void 0,allowEdit:a,allowSendEmail:s,editButtonIsLast:!0,preambleConfig:{showAudience:!m,showDate:!v,showDatetime:F,showAuthor:!q},isStatic:w,position:"publisher-post-list"}):ee&&!w?(0,l.tZ)(I._2,{post:T,pub:E,user:V,style:"compressed",labelStyle:"counts-or-none",postReactionToken:X,hideSavePost:!0,showPreamble:!0,allowEdit:a,allowSendEmail:s,editButtonIsLast:!0,onChange:B,preambleConfig:{showAudience:!m,showDate:!v,showDatetime:F,showAuthor:!q},hideShare:!U,position:"publisher-post-list",isStatic:w}):eT?(0,l.tZ)(S.SP,{user:V,pub:E,post:T,showDate:!v,showDatetime:F,showEmailSent:R,showAudience:!m,showReactions:!eF&&M,showComments:!eF&&L,showShare:!eF&&U,showRestack:!eF&&H,reaction_token:X,onChange:B,isStatic:w,isFreePreview:k,sharedShareDialog:!0,base_url:d,allowSendEmail:s,allowEdit:a,showAuthor:!q,showPhoto:z,hidePinning:y,showUpdatedIcons:K,inThreadHead:ee,fromPostPage:G,onClickCommentButton:Q,reactors:$,isAppMode:eg}):(0,l.tZ)("div",{className:"spacer",style:{height:24}}):(0,l.tZ)(x.a,{className:"meta-subheader",pub:E,post:T,user:V,showDate:!v,showDatetime:!!F,isStatic:!!w,postReactionToken:X,onChange:B,allowEdit:a,hidePinning:y,showEmailSent:R,allowSendEmail:s,allowMobileFooter:G,onCommentsClick:Q,showRestackModal:es}),eT&&eF&&(0,l.tZ)(I.yT,{customization:{showShare:U,showComments:L,showReactions:M,showListen:!H&&!k&&!!eX,showSave:!H,showRestack:H,showCommentRestack:W,showAppUpsell:A}}),eL&&(0,l.tZ)("div",{className:"email-ufi-2-empty"})]}),p]})},eY=e=>{let{user:t,pub:i,post:n}=e,{iString:r,iTemplate:o}=(0,Y.M1)(),a=(0,eb.getBylineUsers)(n).filter(e=>e.is_guest);return 0===a.length?null:(0,l.BX)("div",{className:"post-contributor-footer",children:[(0,l.tZ)("div",{className:"container-border"}),a.map(e=>{let n=(0,eb.guessFirstName)(e.name),a=e.primaryPublicationSubscribeUrl;a&&(null==t?void 0:t.email)&&(a=(0,em.rhs)(a,{email:t.email,autoSubmit:!0,utm_source:e_.b3.substack,utm_campaign:e_.VX.guestPostBio,utm_medium:e_.lP.web}));let s=(0,em.rhs)((0,ev.NNq)(e),{utm_campaign:e_.VX.guestPostBio,utm_medium:e_.lP.web}),c=j.ZP.hasCustomProfilePhoto(e);return(0,l.tZ)("div",{className:u()("post-contributor-bio",{"post-contributor-bio-no-text":!e.bio}),"data-user-id":e.id,children:(0,l.tZ)("table",{cellpadding:"0",cellspacing:"0",className:"post-contributor-bio-table",children:(0,l.BX)("tr",{className:"post-contributor-bio-table-row",children:[c&&(0,l.tZ)("td",{className:"post-contributor-bio-userhead-cell post-contributor-bio-userhead-cell-web",children:(0,l.tZ)(T.ProfileHoverCard,{subject:e,utmSource:"byline",children:(0,l.tZ)(j.ZP,{size:52,user:t,pub:i,subject:e})})}),(0,l.tZ)("td",{className:"post-contributor-bio-body-cell post-contributor-bio-body-cell-web",children:(0,l.BX)("div",{className:"post-contributor-bio-body",children:[e.bio&&(0,l.tZ)("div",{className:"post-contributor-bio-preamble",children:r("A guest post by")}),(0,l.tZ)("table",{cellpadding:"0",cellspacing:"0",className:"post-contributor-bio-body-table",children:(0,l.BX)("tr",{className:"post-contributor-bio-body-table-row",children:[(0,l.BX)("td",{className:"post-contributor-bio-copy-cell",children:[!e.bio&&(0,l.tZ)("div",{className:"post-contributor-bio-preamble",children:r("A guest post by")}),(0,l.BX)(er.X2,{gap:4,alignItems:"center",paddingBottom:4,children:[(0,l.tZ)(T.ProfileHoverCard,{subject:e,utmSource:"byline",children:(0,l.tZ)("a",{className:"post-contributor-bio-title no-margin",href:s,native:!0,children:e.name})}),(0,l.tZ)(es.UserBadge,{size:"sm",tier:e.bestseller_tier,userId:e.id})]}),e.bio&&(0,l.tZ)("div",{className:"post-contributor-bio-text",children:e.bio})]}),(0,l.tZ)("td",{className:"post-contributor-bio-controls-cell post-contributor-bio-controls-cell-web",children:(0,l.tZ)("div",{className:"post-contributor-bio-controls",children:a&&(0,l.tZ)("a",{className:"post-contributor-bio-subscribe-button button primary",href:a,native:!0,children:(0,l.tZ)("span",{className:"post-contributor-bio-subscribe-button-label",children:o(eM(),n)})})})})]})})]})})]})})})})]})};function eV(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500;if("undefined"==typeof window)return!1;let i=document.createElement("div");i.innerHTML=e;let n="",r=!1;for(let e=i.childNodes.length-1;e>=0;e--){let o=i.childNodes[e];if(o){if((0,ee.pv)(o,"button-wrapper")||(0,ee.pv)(o,"subscription-widget-wrap")||(0,ee.pv)(o,"subscribe-widget")){r=!0;break}if((n+=o.textContent).length>t)break}}return!r}function eJ(e){let{post:t,user:i,onChange:n}=e,[a,s]=(0,c.eJ)(!1),{getExperimentVariant:d}=(0,W.jc)(),u="treatment"===d("video_email_watch_later_experiment"),{onSave:p}=(0,I.vk)({post:t,isSaved:!1});return((0,c.d4)(()=>{if("save"===new URL(location).searchParams.get("action")&&(history.replaceState({},"",(0,em.rhs)({action:null})),i)){let e=p();n({post:(0,o._)((0,r._)({},t),{is_saved:e})}),e&&u&&s(!0)}},[]),a)?(0,l.tZ)(et.X,{onClose:()=>s(!1)}):null}function eK(e){var t;return!!(null===(t=e.audio_items)||void 0===t?void 0:t.some(e=>"tts"===e.type))}function eG(e){var t;return!!(null===(t=e.audio_items)||void 0===t?void 0:t.some(e=>"tts"===e.type&&"paywalled"===e.status))}let eQ=()=>(0,l.tZ)("article",{className:u()("typography post",{"shows-post":!1}),children:(0,l.tZ)("div",{className:"container tw-p-12",children:(0,l.tZ)("p",{align:"center",children:(0,l.tZ)(ea.xv,{translated:!0,as:"span",children:"This content has been withheld in your country in response to a legal requirement."})})})})},94442:function(e,t,i){i.d(t,{Cz:()=>e8,Er:()=>e2,F6:()=>e3,Hg:()=>ej,L9:()=>e7,Mp:()=>te,Ng:()=>e1,PA:()=>eP,RY:()=>e9,RZ:()=>eA,Su:()=>eI,TJ:()=>eq,_2:()=>eT,c1:()=>eY,fh:()=>e6,mt:()=>eX,nA:()=>eW,pD:()=>eG,sV:()=>eL,vk:()=>eH,yT:()=>tt,z5:()=>e4});var n=i(7409),r=i(99282),o=i(58865),a=i(16584),l=i(98661),s=i(30396),c=i(94184),d=i.n(c),u=i(12297),p=i.n(u),h=i(23493),m=i.n(h),g=i(85200),v=i(77951),f=i(95951),b=i(73820),_=i(56687),y=i(65207),Z=i(13808),w=i(18794),k=i(8618),C=i(31131),S=i(67358),B=i(62686),x=i(80569),I=i.n(x),P=i(60826),N=i(7703),T=i(23254),E=i(86790),X=i(39900),L=i(43389),F=i(21286),R=i(25265),M=i(666),U=i(76157),A=i(95398),D=i(91355),O=i(50137),z=i(39929),j=i(16808),H=i(48917),W=i(67203),q=i(85685),Y=i(30329),V=i(2995),J=i(47851),K=i(75778),G=i(95441),Q=i(56629),$=i(40647),ee=i(45261),et=i(60807),ei=i(90099),en=i(68833),er=i(48980),eo=i(7882),ea=i(27036),el=i(98914),es=i(97505),ec=i(15771),ed=i(19081),eu=i(36500),ep=i(84747),eh=i(6490),em=i(98248),eg=i(58175),ev=i(70379);i(27744);var ef=i(39493),eb=i(91400),e_=i(98012),ey=i(31377),eZ=i(79582),ew=i(60308),ek=i(63651),eC=i(84864),eS=i(67836),eB=i(47929);function ex(){let e=(0,o._)(["Published on ",""]);return ex=function(){return e},e}function eI(e,t){if("button"===e&&"verbose"===t)return 16;if("button"===e)return 20;if("tabs"===e)return 24;if("compressed"===e)return 14;if("large-on-dark"===e)return 20;return 0}let eP=2,eN=e=>{let{isFullWidth:t,children:i}=e;return t?(0,a.tZ)(ed.gq,{className:"post-ufi-button-wrapper",gap:8,children:i}):i};function eT(e){let{post:t,pub:i,user:n,style:r,justified:o,isStatic:l,hideReactions:s,hideComments:c,hideShare:u,hideSavePost:h,useShareLabel:m,allowEdit:v,editButtonIsLast:f,onChange:b,hidePinning:_,showEmailSent:y,allowSendEmail:Z,footerHidden:w,onCommentsClick:k,labelStyle:C,showPreamble:S,preambleConfig:B={},position:x,hideByDisabling:I,showRestackButton:P,showRestackModal:N,showClipping:E,hideFeedRestackButton:X,onToggleMenu:L,postReactionToken:F,initialShareTimestamp:R}=e,M=(0,ee.Tf)(),{showPins:U,showAudience:A,showDate:D,showDatetime:O,showAuthor:z,showPublicationName:j,showCrossPostedPublicationName:H}=B;s=s||!i.community_enabled||!t.slug||t.is_draft;let q=p()(Object.values((null==t?void 0:t.reactions)||{})),Y=y?!!t.email_sent_at:null,V=(0,K.LC)(),{iString:J}=(0,G.M1)(),Q=v&&(null==n?void 0:n.is_contributor)&&!V,et=eE({post:t,pub:i,user:n,defaultOpen:P&&N&&"post-footer"!==x&&"post-footer-full-width"!==x}),{getConfigFor:ei}=(0,$.xR)(),en=n&&(0,a.tZ)(e0,{style:r,pub:i,post:t,user:n,hidePinning:_,emailSent:null!=Y?Y:void 0,allowSendEmail:Z,footerHidden:w,canBeCrossPosted:P,onToggleMenu:L}),er=!X&&i.community_enabled&&t.slug&&!t.is_draft,eo=P&&!S&&(I||s&&c&&u&&!Q),ea="counts-or-none"===C&&t.comment_count?"count":"labels"===C?"cta":"none",el=n&&t.videoUpload&&(0,eS.a)(n,t,t.videoUpload),es="post-footer-full-width"===x;return(0,a.BX)("div",{className:d()("post-ufi","style-".concat(r),{justified:o,themed:M,"single-full-width-button":eo,"vertically-stacked":"shows-episode-player"===x}),children:[(0,a.BX)(eN,{isFullWidth:es,children:[S&&B&&(0,a.tZ)(e5,{pub:i,post:t,showPins:U,showAudience:A,showDate:D,showDatetime:O,showEmailSent:y,showAuthor:z,showPublicationName:j,showCrossPostedPublicationName:H}),Q&&!f&&en,E&&t.videoUpload&&!ei("disable_clipping_for_readers")&&(0,a.tZ)(T.OZ,{post:t,mediaUpload:t.videoUpload,disabled:!el,style:r}),(I||!s)&&(0,a.tZ)(eF,{post:t,pub:i,user:n,labelStyle:I&&s?"none":"counts-or-none"===C&&q?"count":"labels"===C?"cta":"none",style:r,onChange:b,isStatic:!!l,isDisabled:I&&s||"shows-episode-player"===x&&!n,postReactionToken:F}),(I||!c)&&(0,a.tZ)(eK,{post:t,pub:i,isStatic:l,labelStyle:I&&c?"none":ea,style:r,count:t.comment_count,onClick:k,isDisabled:I&&c}),er&&(0,a.tZ)(eM,{pub:i,post:t,onChange:b,style:r,onToggleMenu:L,isStatic:l}),!u&&(0,a.tZ)(W.sp,{post:t,pub:i,user:n,trigger:{style:r,labelStyle:m?"cta":"none",isStatic:l},position:x,initialShareTimestamp:R,showClipping:E&&!!t.videoUpload,disableClipping:!el})]}),(0,a.BX)(eN,{isFullWidth:es,children:[!h&&!P&&n&&(0,a.tZ)(eV,{post:t,labelStyle:ea,position:x,style:r,onChange:b}),Q&&f&&en,P&&!Q&&"post-header"===x&&(0,a.tZ)(a.HY,{children:(0,a.BX)(ep.M,{trigger:(0,a.tZ)(ec.hU,{"aria-label":J("View repost options"),priority:"secondary-outline",children:(0,a.tZ)(g.Z,{size:20})}),children:[n&&(0,a.tZ)(e$,{onClick:et.open,post:t,pub:i,user:n}),(0,a.tZ)(eJ,{post:t,onChange:b})]})}),P&&!Q&&es&&(0,a.BX)(a.HY,{children:[!h&&(0,a.tZ)(eV,{post:t,labelStyle:"verbose",position:x,style:"button",onChange:b}),n&&(0,a.tZ)(eQ,{onClick:et.open,post:t,pub:i,user:n,style:"button"})]})]}),et.modal]})}function eE(e){let{pub:t,user:i,post:n,defaultOpen:r=!1}=e,[o,l]=(0,s.eJ)(r);return(0,s.d4)(()=>{r&&i&&(0,en.j)(en.FP.RESTACK_POST_CLICKED,{restacked_publication_id:t.id,restacked_post_id:n.id,restacking_user_id:i.id,is_from_email:!0})},[r,t,n,i]),{open:()=>l(!0),modal:(0,a.tZ)(V.J,{pub:t,user:i,post:n,open:o,setOpen:l}),isOpen:o}}function eX(e){let{post:t,pub:i,user:n,isStatic:r,onChange:o,allowEdit:l,hidePinning:c,showEmailSent:u,allowSendEmail:p,hideComments:h,onCommentsClick:g,showRestackButton:v,showRestackModal:f,setFooterShown:b,postReactionToken:_}=e,y=function(){let e="undefined"==typeof window,[t,i]=(0,s.eJ)(e?0:window.pageYOffset),[n,r]=(0,s.eJ)(!1),o=(0,s.Ye)(()=>Date.now()+1e3,[]),a=(0,s.sO)(0);return(0,s.d4)(()=>{if(e)return;let n=m()(()=>{let e=Date.now(),n=(e-a.current)/1e3,l=(t-window.pageYOffset)/n;a.current=e,!(window.pageYOffset<0)&&(e100?r(!0):l>100&&r(!1),i(window.pageYOffset))},250);return window.addEventListener("scroll",n),()=>window.removeEventListener("scroll",n)},[e,t,i,r,o,a,!1]),n}(),Z=(0,ev.pm)();return(0,s.d4)(()=>{Z.addOffset(64*(y?1:-1)),b&&b(!y)},[y,b]),(0,a.tZ)(ed.hs,{alignItems:"center",padding:8,className:d()("mobile-footer-ufi",{hidden:y}),children:(0,a.tZ)(eT,{post:t,pub:i,user:n,isStatic:r,justified:!0,style:"tabs",onChange:o,allowEdit:l,editButtonIsLast:!0,hidePinning:c,showEmailSent:u,allowSendEmail:p,footerHidden:y,labelStyle:"counts-or-none",hideComments:h,onCommentsClick:g,position:"mobile-toolbar",hideByDisabling:!0,showRestackModal:f,showRestackButton:v,postReactionToken:_})})}function eL(){let e=function(){let e=(0,ev.pm)(),{iString:t}=(0,G.M1)();return i=>{i?e.popToast(e=>(0,a.tZ)(ev.FN,(0,r._)((0,n._)({},e),{text:t("Post liked"),Icon:k.Z}))):e.popToast(e=>(0,a.tZ)(ev.FN,(0,r._)((0,n._)({},e),{text:t("Post unliked"),Icon:k.Z})))}}();return async function(t,i){let{tabId:n,restacking_user_id:r,media_clip_id:o}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};await (0,er.rd)("/api/v1/post/".concat(t,"/reaction"),i?{method:"POST",json:{reaction:"❤",surface:"reader",tabId:n,restacking_user_id:r,media_clip_id:o}}:{method:"DELETE",json:{tabId:n,media_clip_id:o}}),e(i)}}function eF(e){let{post:t,pub:i,user:n,style:r,labelStyle:o,onChange:l,isStatic:s,isDisabled:c,postReactionToken:d}=e,{iString:u}=(0,G.M1)(),h=p()(Object.values((null==t?void 0:t.reactions)||{})),m="count"===o?(0,eC.numberToString)(h||0):"cta"===o?"Like":null;return(0,a.tZ)(ej,{post:t,pub:i,user:n,onChange:l,isStatic:s,style:r,postReactionToken:d,children:e=>{let{isLiked:t,handleLike:i}=e;return(0,a.tZ)(e1,{style:r,state:t?"liked":void 0,icon:(0,a.tZ)(M.Z,{className:"icon",height:eI(r),strokeWidth:eP}),onClick:c?()=>{}:i,noLabel:"none"===o,isDisabled:c,ariaLabel:u("Like")+("count"===o?" (".concat((0,eC.numberToString)(h||0),")"):""),ariaPressed:t,children:m})}})}function eR(e){let{style:t,onClick:i}=e;return(0,a.tZ)(e1,{style:t,state:void 0,icon:(0,a.tZ)(v.Z,{className:"icon",height:eI(t),strokeWidth:eP}),"aria-label":"menu",onClick:i})}function eM(e){let{pub:t,post:i,style:o,onChange:l,onToggleMenu:c,isStatic:d}=e,[u,p]=(0,s.eJ)(!1),{iString:h}=(0,G.M1)(),{canRestack:m,isRestacked:g,restacks:v,menuItems:f,nuxModal:b,loggedOutRestackAttempt:_}=(0,ef.K)({pub:t,post:i,onRestack:e=>{null==l||l({post:(0,r._)((0,n._)({},i),{restacked:e,restacks:v+(e?1:-1)})})},renderWithoutUser:!0});if((0,s.d4)(()=>{_&&p(!0)},[_]),!m)return null;let y=!t.community_enabled,Z=(0,a.tZ)(e1,{style:o,state:g?"restacked":void 0,icon:(0,a.tZ)(O.Z,{className:"icon",height:eI(o),strokeWidth:eP}),noLabel:0===v,"aria-label":"menu",isDisabled:y,children:v.toLocaleString(void 0,{maximumSignificantDigits:4})});return(0,a.BX)(a.HY,{children:[b,y?Z:(0,a.tZ)(eu.v2,(0,r._)((0,n._)({trigger:Z},c&&{onOpen:()=>{c({active:!0})},onClose:()=>{c({active:!1})}}),{"aria-label":h("View repost options"),children:f})),(0,a.tZ)(es.Z,{displaySignInModal:u,onCloseSignInModal:()=>p(!1),isStatic:!!d,entry:"post-preview-like"})]})}function eU(e){let{postId:t,isOpen:i,onClose:n}=e,r=(0,$.xR)(),{iString:o}=(0,G.M1)(),[l,c]=(0,s.eJ)(),d=!0==r.getConfigFor("enable_post_summarization"),u=(0,s.sO)(!1),p=(0,s.I4)(()=>{u.current=!0,I().post("/api/v1/posts/".concat(t,"/summary")).then(e=>{var t;(null===(t=e.body)||void 0===t?void 0:t.summary)&&c(e.body.summary)}).finally(()=>{u.current=!1})},[t]);return((0,s.d4)(()=>{i&&d&&!l&&!u.current&&p()},[i,p,d,l]),d)?(0,a.BX)(eh.u_,{isOpen:i,onClose:n,width:750,children:[(0,a.tZ)(eh.xB,{showClose:!0,title:o("Reader guide"),onClose:n}),(0,a.tZ)(ed.tu,{padding:16,paddingBottom:32,children:l?(0,a.tZ)("div",{dangerouslySetInnerHTML:{__html:l}}):(0,a.tZ)(ed.tu,{alignItems:"center",justifyContent:"center",style:{flex:1,minHeight:300},children:(0,a.tZ)("div",{className:"embed-loader"})})})]}):null}let eA=e=>{let{isOpen:t,setIsOpen:i}=e;return(0,s.d4)(()=>{let e=setTimeout(()=>{t&&i(!1)},1e4);return()=>clearTimeout(e)},[t]),(0,a.tZ)(eh.u_,{isOpen:t,onClose:()=>i(!1),width:300,children:(0,a.BX)(ed.tu,{padding:16,gap:16,children:[(0,a.tZ)(eg.xv.H4,{translated:!0,children:"Generating PDF..."}),(0,a.tZ)(ed.tu,{alignItems:"center",children:(0,a.tZ)(em.$j,{})})]})})};function eD(e){let{post:t,pub:i,user:n,onChange:r,showRestackModal:o,canBeCrossPosted:l,onSummaryOpen:c,onToggleRestackModal:d}=e,u="button",p=(0,$.xR)(),h=!0==p.getConfigFor("enable_post_summarization"),[m,v]=(0,s.eJ)(!1),Z=eE({pub:i,user:n,post:t,defaultOpen:o&&l});return(0,s.d4)(()=>{null==d||d(Z.isOpen)},[d,Z.isOpen]),(0,a.BX)(a.HY,{children:[(0,a.tZ)(eA,{isOpen:m,setIsOpen:v}),(0,a.BX)(ep.M,{trigger:(0,a.tZ)(e1,{style:u,icon:(0,a.tZ)(g.Z,{className:"icon edit-icon",size:eI(u),strokeWidth:2}),noLabel:!0,"aria-label":"More"}),children:[n&&(0,a.tZ)(eJ,{post:t,onChange:r,showIcon:!0}),h&&(0,a.tZ)(ep.u,{leading:(0,a.tZ)(f.Z,{}),onClick:c,children:"Reader guide"}),l&&(0,a.tZ)(ep.u,{leading:(0,a.tZ)(b.Z,{}),onClick:()=>{Z.open(),(0,en.j)(en.FP.RESTACK_POST_CLICKED,{restacked_publication_id:i.id,restacked_post_id:t.id,restacking_user_id:n.id,is_from_email:!1})},children:"Cross post"}),p.getConfigFor("show_open_post_as_pdf_button")&&(0,a.tZ)(ep.u,{leading:(0,a.tZ)(_.Z,{}),onClick:()=>{v(!0),(0,el.uX)((0,ek.SUl)(i,t.id),{local_navigation:!1})},children:"Open as PDF"}),n&&(0,a.tZ)(ep.u,{leading:(0,a.tZ)(y.Z,{}),href:(0,ek.qUD)(t.id),children:"Substack Reader"})]}),Z.modal]})}function eO(e){var t;let i=p()(Object.values((null===(t=e.post)||void 0===t?void 0:t.reactions)||{}));return(0,a.tZ)(eF,(0,r._)((0,n._)({},e),{labelStyle:i>0?"count":"none"}))}let ez=e=>{let{pub:t,user:i}=e,[n,r]=(0,s.eJ)(null==i?void 0:i.email),[o,l]=(0,s.eJ)(!1),{iString:c}=(0,G.M1)();return(0,a.BX)(ed.tu,{gap:20,children:[(0,a.BX)(ed.tu,{gap:4,children:[(0,a.BX)(eg.xv.H4,{translated:!0,weight:"semibold",children:["Support ",I18N.p(t.name)]}),(0,a.tZ)(eg.xv.B4,{translated:!0,color:"secondary",children:"Since you liked this post, why not subscribe?"})]}),(0,a.BX)(ed.tu,{gap:12,children:[(0,a.tZ)("input",{disabled:!!(null==i?void 0:i.email),value:n,onChange:e=>r(e.currentTarget.value)}),(0,a.tZ)(ec.zx,{onClick:async()=>{(0,en.j)(en.FP.LIKE_UPSELL_FREE_SUBSCRIBED,{email:n}),l(!0);try{let{referral_token:e}=(await I().post("/api/v1/free").send({email:n,source:"like-button-upsell"})).body;(0,en.IU)(),(0,el.uX)((0,ek.W1P)(t,{params:{utm_source:eB.b3.likeButtonUpsell,just_signed_up:!0,referral_token:e}}),{local_navigation:!1})}catch(e){alert((0,el.zx)(e))}},flex:"grow",disabled:o,priority:"primary",role:"button","aria-label":c("Subscribe"),children:c(o?"Please wait...":"Subscribe")})]})]})};function ej(e){let{post:t,pub:i,user:n,onChange:r,isStatic:o,children:l,style:c,postReactionToken:u}=e,p=(0,s.sO)(),h=(0,s.sO)(),{isLiked:m,toggle:g}=function(e){let{post:t,user:i,surface:n,onChange:r,postReactionToken:o}=e,a=!!(null==t?void 0:t.reaction),l=(0,K.LC)(),s=(0,eo.ib)({pathname:(0,ek.n1t)(l?"/api/v1/cross-post/".concat(null==t?void 0:t.id,"/reaction"):"/api/v1/post/".concat(null==t?void 0:t.id,"/reaction"),{token:o}),method:"POST",deps:[null==t?void 0:t.id]});return{isLiked:a,toggle:async()=>{var e;if(s.isLoading)return"error";let{reaction:o,reactions:a,reactor_names:l}=(0,Y.fS)(null!=i?i:void 0,t);t.reaction=null!=o&&o,t.reactions=a,t.reactor_names=null!=l?l:[],null==r||r({post:t});let c=await s.refetch(o?{method:"POST",json:{reaction:"❤",surface:n}}:{method:"DELETE"}),d=null==c?void 0:null===(e=c.response)||void 0===e?void 0:e.status;if(d){let{reaction:e,reactions:n,reactor_names:o}=(0,Y.fS)(null!=i?i:void 0,t);t.reaction=null!=e&&e,t.reactions=n,t.reactor_names=null!=o?o:[],null==r||r({post:t})}return 401===d?"unauthorized":d?"error":o?"liked":"unliked"}}}({post:t,user:n,subscribePromptRef:p,onChange:r,postReactionToken:u}),[v,f]=(0,s.eJ)(!1),b=(0,s.I4)(async e=>{var t;null==e||null===(t=e.stopPropagation)||void 0===t||t.call(e),"unauthorized"===await g()&&f(!0)},[g]);return(0,a.BX)("div",{className:d()("like-button-container","post-ufi-button","style-".concat(c),m&&"state-liked"),children:[l({isLiked:m,handleLike:b}),(0,a.tZ)(es.Z,{isStatic:o,displaySignInModal:v,onCloseSignInModal:()=>f(!1),entry:"post-preview-restack"}),n&&!n.is_admin&&!n.is_contributor&&("button"===c||"tabs"===c)&&(0,a.tZ)(E.Fx,{ref:p,className:d()("subscribe-prompt-dropdown",!(null==n?void 0:n.is_free_subscribed)&&"free"),hideMenuTail:!0,children:(null==n?void 0:n.is_free_subscribed)?(0,ea.P)(n,i)?(0,a.tZ)(j.xt,{pub:i,onClose:()=>{var e;return null===(e=p.current)||void 0===e?void 0:e.close()},shareDialogRef:h}):(0,a.tZ)(j._q,{pub:i}):(0,a.tZ)(ez,{pub:i,user:n})}),!o&&(0,a.tZ)(J.Z,{ref:h,user:n,pub:i,post:t})]})}function eH(e){var t;let{post:i,defaultSaved:n,isSaved:r,trackSurface:o}=e;return eW({postId:i.id,defaultSaved:null!==(t=null!=n?n:i.is_saved)&&void 0!==t&&t,isSaved:r,trackSurface:o})}function eW(e){let{postId:t,defaultSaved:i,isSaved:n,trackSurface:r}=e,[o,a]=(0,s.eJ)(i),l=null!=n?n:o,{refetch:c}=(0,eo.ib)({pathname:"/api/v1/posts/saved",method:"POST",json:{post_id:t,surface:r},deps:[t]}),d=eY();return{isSaved:l,onSave:()=>(c({method:l?"DELETE":"POST"}),a(!l),d(!l),!l)}}async function eq(e,t,i){let{surface:n}=i;await (0,er.rd)("/api/v1/posts/saved",{method:t?"POST":"DELETE",json:{post_id:e}}),(0,en.j)(en.FP.POST_SAVED,{post_id:e,surface:n,is_saved:t})}function eY(){let e=(0,ev.pm)(),{iString:t}=(0,G.M1)();return i=>{i?e.popToast(e=>(0,a.tZ)(ev.FN,(0,r._)((0,n._)({},e),{text:t("Post saved"),Icon:Z.Z,cta:t("View"),href:(0,ew.qQN)()}))):e.popToast(e=>(0,a.tZ)(ev.FN,(0,r._)((0,n._)({},e),{text:t("Post unsaved"),Icon:w.Z})))}}function eV(e){let{style:t,post:i,isSaved:o,labelStyle:l,position:s,onChange:c}=e,{isSaved:d,onSave:u}=eH({defaultSaved:o,post:i,isSaved:i.is_saved,trackSurface:s}),{iString:p}=(0,G.M1)();return(0,a.tZ)(e1,{state:d?"saved":void 0,style:t,icon:(0,a.tZ)(F.Z,{className:"icon",height:eI(t,"verbose"===l?"verbose":null),strokeWidth:eP}),noLabel:"none"===l,verboseLabel:"verbose"===l,onClick:()=>{let e=u();null==c||c({post:(0,r._)((0,n._)({},i),{is_saved:e})})},ariaPressed:d,ariaLabel:p("Save"),children:"cta"===l||"verbose"===l?p("Save"):null})}function eJ(e){let{post:t,isSaved:i,onChange:o,showIcon:l}=e,{onSave:s}=eH({defaultSaved:i,post:t,isSaved:t.is_saved}),{iString:c}=(0,G.M1)(),d=t.is_saved?"var(--color-accent-fg-orange)":void 0;return(0,a.tZ)(ep.u,{leading:l?(0,a.tZ)(Z.Z,{style:{stroke:d,fill:d}}):void 0,onClick:()=>{let e=s();null==o||o({post:(0,r._)((0,n._)({},t),{is_saved:e})})},children:c(t.is_saved?"Unsave":"Save")})}function eK(e){let t,{style:i,count:n,labelStyle:r,post:o,pub:l,isStatic:s,onClick:c,isDisabled:d}=e,{iString:u}=(0,G.M1)(),p=(0,eb.XA)(),h=(0,et.aF)();return t=(null==o?void 0:o.comment_url_override)?o.comment_url_override:s?"".concat(P.W.HALF_MAGIC_COMMENTS_URL,"&utm_source=").concat(eB.b3.substack,"&utm_medium=").concat(eB.lP.email):!p||(null==h?void 0:h.is_contributor)?(0,ew.uRy)(l,o,{comments:!0}):(0,ew.K8_)(l.subdomain,o.slug,{params:{comments:!0,utm_source:eB.b3.post,utm_medium:eB.lP.web}}),(0,a.BX)(e1,{style:i,icon:(0,a.tZ)(R.Z,{className:"icon",height:eI(i),strokeWidth:eP}),href:d?void 0:t,onClick:d?()=>{}:e=>{c?c(e):(null==e||e.preventDefault(),window.location.href=t)},noLabel:"none"===r,className:"post-ufi-comment-button",isDisabled:d,ariaLabel:u("cta"===r?"Comment":"View comments"+" (".concat((0,eC.numberToString)(n||0),")")),children:["cta"===r&&u("Comment"),"count"===r&&(0,eC.numberToString)(n||0)]})}function eG(e){let t,{post:i,user:n,pub:r,style:o,labelStyle:l,isStatic:c,onChange:u,position:p}=e,h=(0,s.sO)(),m=(0,s.I4)(()=>{(0,en.j)(en.FP.POST_SHARE_BUTTON_CLICKED,{position:p,post_id:i.id}),h.current.open()},[]),{iString:g}=(0,G.M1)();t=i.share_url_override?i.share_url_override:c?i?P.W.SHARE_URL:P.W.SHARE_PUB_URL:"javascript:void(0)";let v="none"===l;return(0,a.BX)(a.HY,{children:[(0,a.tZ)(e1,{style:o,icon:v?(0,a.tZ)(C.Z,{className:"icon",height:eI(o),strokeWidth:eP}):null,onClick:m,href:t,noLabel:"none"===l,className:d()(!v&&"no-icon"),children:"cta"===l&&g("Share")}),!c&&(0,a.tZ)(J.Z,{ref:h,user:n,pub:r,post:i,onChange:u})]})}function eQ(e){let{post:t,user:i,pub:n,onClick:r,style:o}=e,{iString:l}=(0,G.M1)();return(0,a.tZ)(a.HY,{children:(0,a.tZ)(e1,{style:o,icon:(0,a.tZ)(U.Z,{className:"icon",height:eI(o,"verbose"),strokeWidth:eP}),onClick:()=>{(0,en.j)(en.FP.RESTACK_POST_CLICKED,{restacked_publication_id:n.id,restacked_post_id:t.id,restacking_user_id:i.id,is_from_email:!1}),r()},noLabel:!1,verboseLabel:!0,title:l("Cross-Post"),children:l("Cross-post")})})}function e$(e){let{post:t,user:i,pub:n,onClick:r}=e,{iString:o}=(0,G.M1)();return(0,a.tZ)(a.HY,{children:(0,a.tZ)(ep.u,{onClick:()=>{(0,en.j)(en.FP.RESTACK_POST_CLICKED,{restacked_publication_id:n.id,restacked_post_id:t.id,restacking_user_id:i.id,is_from_email:!1}),r()},children:o("Cross-post")})})}function e0(e){let{style:t,pub:i,post:n,user:r,hidePinning:o,emailSent:l,allowSendEmail:c,footerHidden:u,showRestackModal:p,canBeCrossPosted:h,onSummaryOpen:m,onToggleMenu:v,onToggleRestackModal:f}=e,b=(0,s.sO)();u&&b.current&&b.current.close();let _=eE({post:n,pub:i,user:r,defaultOpen:p&&h});return(0,s.d4)(()=>{null==f||f(_.isOpen)},[f,_.isOpen]),(0,a.BX)("div",{className:d()("edit-button-container","post-ufi-button","style-".concat(t)),children:[(0,a.tZ)(e1,{onClick:()=>b.current.open(),style:t,icon:(0,a.tZ)(g.Z,{className:"icon edit-icon",size:eI(t),strokeWidth:2}),noLabel:!0}),(0,a.tZ)(H.y,{ref:b,pub:i,post:n,user:r,className:"post-ufi-edit-menu",useDrawerOnMobile:!0,hidePinning:o,emailSent:l,allowSendEmail:c,handleCrossPost:h?()=>{_.open(),(0,en.j)(en.FP.RESTACK_POST_CLICKED,{restacked_publication_id:i.id,restacked_post_id:n.id,restacking_user_id:r.id,is_from_email:!1})}:void 0,onSummaryOpen:m,onToggleMenu:v}),_.modal]})}let e1=(0,l.forwardRef)((e,t)=>{let{icon:i,children:n,state:r,style:o,onClick:l,href:s,noLabel:c,verboseLabel:u,noBorder:p,className:h,isDisabled:m,iconPosition:g="left",title:v,ariaLabel:f,ariaPressed:b}=e;return(0,a.BX)("a",{role:"button",className:d()("post-ufi-button","style-".concat(o),h,r?"state-".concat(r):void 0,m?"state-disabled":void 0,n&&!c?"has-label":"no-label",p?"no-border":"with-border",u?"verbose-label":""),title:v,href:s,onClick:e=>{l&&(e.stopPropagation(),l(e))},ref:t,"aria-label":null!=f?f:v,"aria-pressed":b,children:["left"===g&&i,!c&&n&&(0,a.tZ)("div",{className:"label",children:n}),"right"===g&&i]})}),e4=e=>{let{pub:t,post:i,showAuthor:n}=e;return!!(n&&t.bylines_enabled&&(0,eC.getPrintedByline)(t,i))},e2=e=>{let{pub:t,post:i,showAuthor:n,showPhoto:r,isMobileWidth:o}=e;return e4({pub:t,post:i,showAuthor:n})&&!e8({pub:t,post:i,showAuthor:n})&&!e3({pub:t,post:i,showAuthor:n,showPhoto:r})&&!o},e8=e=>{let{pub:t,post:i,showAuthor:n}=e;return e4({pub:t,post:i,showAuthor:n})&&(0,eC.getBylineUsers)(i).length>1},e3=e=>{var t;let{pub:i,post:n,showAuthor:r,showPhoto:o}=e;return!!(e4({pub:i,post:n,showAuthor:r})&&o&&(null===(t=(0,eC.getBylineUsers)(n)[0])||void 0===t?void 0:t.photo_url)&&i.byline_images_enabled)};function e6(e){let{post:t,showDatetime:i,isStatic:n,fromPostPage:r,showReactions:o,language:a="en"}=e,l=t.reactions?Object.values(t.reactions).reduce((e,t)=>e+t,0):0,s=r&&!n&&o&&l>=70&&l<100;return i&&s?(0,e_.Z)(t.post_date).locale(a).standardDatetimeWithYear():i&&!s?(0,e_.Z)(t.post_date).locale(a).standardDatetime():n?(0,e_.Z)(t.post_date).locale(a).standardDate():s?(0,e_.Z)(t.post_date).locale(a).standardDate({full:s}):(0,e_.Z)(t.post_date).locale(a).standardDateOrTime()}function e5(e){let{pub:t,post:i,showPins:n,showAudience:r,showDate:o,showDatetime:l,showEmailSent:s,showAuthor:c,showPublicationName:u,showCrossPostedPublicationName:p}=e,h=(0,ee.Tf)(),m=!!(c&&t.bylines_enabled&&(0,eC.getPrintedByline)(t,i)),g=o&&i.post_date&&!i.is_draft,v=s?!!i.email_sent_at:null,{iString:f,iTemplate:b,language:_}=(0,G.M1)();return(0,a.BX)("div",{className:d()("ufi-preamble",{themed:h}),children:[p&&i.restacked_pub_name?(0,a.tZ)("div",{className:"ufi-preamble-label cross-posted-pub-name",children:b(ex(),i.restacked_pub_name)}):null,s&&v&&(0,a.tZ)("div",{className:"email-sent",title:f("This post was sent as an email"),children:(0,a.tZ)(S.Z,{className:"post-ufi-preamble-icon",size:16})}),n&&i.is_section_pinned&&(0,a.tZ)("div",{className:"pinned",children:(0,a.tZ)(z.Z,{className:"post-ufi-preamble-icon"})}),"adhoc_email"===i.type?(0,a.tZ)("div",{className:"audience-adhoc",children:(0,a.tZ)(X.Z,{className:"post-ufi-preamble-icon"})}):r&&(0,ey.isPaidAudience)(i.audience)&&(0,a.tZ)("div",{className:"audience-lock",children:(0,a.tZ)(N.Z,{audience:i.audience,className:"lock-icon post-ufi-preamble-icon",size:16})}),e2({pub:t,post:i,showAuthor:m,isMobileWidth:!1})&&(0,a.tZ)("div",{className:"ufi-preamble-label author",children:(0,eC.getBylineUsers)(i).length>0?(0,eC.oxfordComma)((0,eC.getBylineUsers)(i).map(e=>(0,a.tZ)(a.HY,{children:(0,a.tZ)(q.ProfileHoverCard,{subject:e,utmSource:"byline",children:(0,a.tZ)("a",{href:(0,ew.LwU)(e,t,{base:!0}),onClick:e=>e.stopPropagation(),children:e.name})})}))):(0,eC.getPrintedByline)(t,i)}),u&&(0,a.tZ)("div",{className:"post-publication-name",children:t.name}),g&&(0,a.tZ)("div",{className:"ufi-preamble-label post-date",title:(0,e_.Z)(i.post_date).toISOString(),children:(0,a.tZ)("time",{dateTime:(0,e_.Z)(i.post_date).toISOString(),children:e6({post:i,showDatetime:l,language:_})})})]})}let e9=e=>{let{pub:t,post:i,user:n,onChange:r,postReactionToken:o}=e;return(0,$.xR)().getConfigFor("like_posts_enabled")&&t.community_enabled?(0,a.tZ)(eO,{style:"button",post:i,pub:t,user:n,onChange:r,postReactionToken:o}):null},e7=e=>{let{pub:t,post:i,onClick:n}=e,r=(0,eC.showCommentsOnPost)({publication:t,post:i}),{comment_count:o}=i;return r?(0,a.tZ)(eK,{post:i,pub:t,labelStyle:o>0?"count":"none",style:"button",count:o,onClick:n}):null};function te(e){let{hideBottomBorder:t,post:i,pub:n,user:r,onChange:o,onCommentsClick:l,showRestackModal:c=!1,showTranscriptionButton:d,onTranscriptionClick:u,postReactionToken:p,onToggleRestackModal:h,onTranscriptClick:m}=e,{iString:g}=(0,G.M1)(),v=(0,K.LC)(),f=(null==r?void 0:r.is_contributor)&&!v,{getSettingFor:b}=(0,Q.So)(),_=!i.is_draft&&(0,eZ.x)(r,{enable_restacking:!!b("enable_restacking")},i,n,!1),[y,Z]=(0,s.eJ)(!1),w=r&&i.videoUpload&&(0,eS.a)(r,i,i.videoUpload);return(0,a.BX)(ed.hs,{className:"post-ufi",alignItems:"center",borderTop:"detail-themed",borderBottom:t?void 0:"detail-themed",justifyContent:"space-between",gap:16,flex:"grow",paddingY:16,children:[(0,a.BX)(ed.hs,{gap:8,children:[(0,a.tZ)(e9,{post:i,pub:n,user:r,onChange:o,postReactionToken:p}),(0,a.tZ)(e7,{pub:n,post:i,onClick:l}),(0,a.tZ)(eM,{pub:n,post:i,onChange:o,style:"button"}),d&&(0,a.tZ)(eR,{style:"button",onClick:u})]}),(0,a.BX)(ed.hs,{gap:8,children:[(0,a.tZ)(W.sp,{post:i,pub:n,user:r,trigger:{style:"button",labelStyle:"cta"},showClipping:!!i.videoUpload,disableClipping:!w}),m&&(0,a.tZ)(e1,{onClick:m,style:"button",icon:(0,a.tZ)(B.Z,{color:"var(--color-fg-secondary-themed)",size:16}),children:g("Transcript")}),f?(0,a.tZ)(e0,{style:"button",pub:n,post:i,user:r,showRestackModal:c,canBeCrossPosted:_,onSummaryOpen:()=>Z(!0),onToggleRestackModal:h}):(r||_)&&(0,a.tZ)(eD,{post:i,pub:n,user:r,onChange:o,showRestackModal:c,canBeCrossPosted:_,onSummaryOpen:()=>Z(!0),onToggleRestackModal:h})]}),(0,a.tZ)(eU,{postId:i.id,isOpen:y,onClose:()=>Z(!1)})]})}function tt(e){let{isFooter:t,customization:{showAppUpsell:i,showShare:o,showComments:l,showReactions:s,showListen:c,showSave:u,showRestack:p,showCommentRestack:h}}=e,m=!t&&(p||c||u),{iString:g}=(0,G.M1)();return t||o||l||s||c||u||!p?(0,a.BX)(ei.YF,{className:t?"email-ufi-2-bottom":"email-ufi-2-top",width:"100%",children:[p&&t&&(0,a.BX)(a.HY,{children:[(0,a.tZ)(ti,{}),(0,a.tZ)("tr",{children:(0,a.tZ)("td",{children:(0,a.BX)(ei.YF,{width:"100%",className:"email-ufi-2-row",children:[(0,a.tZ)("tr",{children:(0,a.tZ)("td",{width:"95%",children:o&&(0,a.BX)(ei._i,{tableClassName:"email-button-outline-wrapper-full-width",aClassName:"email-button-outline full-width",href:P.W.SHARE_URL,children:[(0,a.tZ)(A.Z,(0,n._)({},tn)),(0,a.tZ)("span",{className:"email-button-text",children:g("Share")})]})})}),(0,a.tZ)(ti,{})]})})})]}),(0,a.tZ)(ti,{}),(0,a.tZ)("tr",{children:(0,a.tZ)("td",{children:(0,a.tZ)(ei.YF,{width:"100%",children:(0,a.BX)("tr",{children:[(0,a.tZ)("td",{children:(0,a.BX)(ei.zK,{gap:8,style:m?void 0:{margin:"0 auto"},children:[s?t?(0,a.BX)(ei._i,{aClassName:"email-button-outline",href:P.W.REACTION_URL,children:[(0,a.tZ)(M.Z,(0,n._)({},tn)),(0,a.tZ)("span",{className:"email-button-text",children:g("Like")})]}):(0,a.tZ)(tr,{href:P.W.REACTION_URL,children:(0,a.tZ)(M.Z,(0,n._)({},tn))}):null,l?t?(0,a.BX)(ei._i,{aClassName:"email-button-outline",href:"".concat(P.W.HALF_MAGIC_COMMENTS_URL,"&utm_source=").concat(eB.b3.substack,"&utm_medium=").concat(eB.lP.email),children:[(0,a.tZ)(R.Z,(0,n._)({},tn)),(0,a.tZ)("span",{className:"email-button-text",children:g("Comment")})]}):(0,a.tZ)(tr,{href:"".concat(P.W.HALF_MAGIC_COMMENTS_URL,"&utm_source=").concat(eB.b3.substack,"&utm_medium=").concat(eB.lP.email),children:(0,a.tZ)(R.Z,(0,n._)({},tn))}):null,o&&i&&(t?(0,a.BX)(ei._i,{aClassName:"email-button-outline",href:P.W.SHARE_URL,children:[(0,a.tZ)(D.Z,(0,n._)({},tn)),(0,a.tZ)("span",{className:"email-button-text",children:g("Share")})]}):(0,a.tZ)(tr,{href:P.W.SHARE_URL,children:(0,a.tZ)(D.Z,(0,n._)({},tn))})),h&&(t?(0,a.BX)(ei._i,{aClassName:"email-button-outline",href:"".concat(P.W.RESTACK_COMMENT_URL,"&utm_source=").concat(eB.b3.substack,"&utm_medium=").concat(eB.lP.email),children:[(0,a.tZ)(O.Z,(0,n._)({},tn)),(0,a.tZ)("span",{className:"email-button-text",children:g("Restack")})]}):(0,a.tZ)(tr,{href:"".concat(P.W.RESTACK_COMMENT_URL,"&utm_source=").concat(eB.b3.substack,"&utm_medium=").concat(eB.lP.email),children:(0,a.tZ)(O.Z,(0,n._)({},tn))}))]})}),(0,a.tZ)("td",{align:"right",children:(0,a.BX)(ei.zK,{gap:8,children:[o&&!i&&!t&&(0,a.BX)(ei._i,{aClassName:"email-button-outline",href:P.W.SHARE_URL,children:[(0,a.tZ)("div",{className:"email-button-spacer"}),(0,a.tZ)("span",{className:"email-button-text",children:g("Share")})]}),i&&!t&&(0,a.BX)(ei._i,{aClassName:"email-button-outline",href:"".concat(P.W.POST_APP_LINK_URL,"&utm_campaign=email-read-in-app"),children:[(0,a.tZ)("div",{className:"email-button-spacer"}),(0,a.tZ)("span",{className:"email-button-text",style:{marginRight:4},children:g("READ IN APP")}),(0,a.tZ)(L.Z,(0,r._)((0,n._)({},tn),{className:d()("icon","text-icon")}))]})]})})]})})})}),(0,a.tZ)(ti,{})]}):(0,a.tZ)(ei.YF,{className:"email-ufi-2-empty",width:"100%",children:(0,a.tZ)("tr",{height:1,children:(0,a.tZ)("td",{height:1,style:{fontSize:0,lineHeight:0},children:"\xa0"})})})}function ti(){return(0,a.tZ)("tr",{height:16,children:(0,a.tZ)("td",{height:16,style:{fontSize:0,lineHeight:0},children:"\xa0"})})}let tn={className:"icon",height:18,strokeWidth:1,isStatic:!0,stroke:"#808080",fill:"none"};function tr(e){let{size:t=38,href:i,children:n}=e;return(0,a.tZ)(ei.YF,{width:t,children:(0,a.tZ)("tr",{children:(0,a.tZ)("td",{align:"center",children:(0,a.tZ)("a",{className:"email-icon-button",href:i,style:{width:t},children:n})})})})}},30329:function(e,t,i){i.d(t,{E6:()=>B,dJ:()=>E,fS:()=>x,oq:()=>X,xl:()=>N});var n=i(27412),r=i(7409),o=i(16584),a=i(6400),l=i(94184),s=i.n(l),c=i(12297),d=i.n(c),u=i(80569),p=i.n(u),h=i(60826),m=i(12620),g=i(666),v=i(93666),f=i(95441),b=i(8923),_=i(35702),y=i(68833),Z=i(98914),w=i(19081),k=i(58175),C=i(60308),S=i(84864);let B=(e,t,i)=>{let{reaction:n,reactions:r,reactor_names:o}=I(e,t,i);P(t,n,r,o)},x=(e,t)=>I(e,t,!t.reaction),I=(e,t,i)=>{let n="reaction"in t?t.reaction:void 0,{reactions:o={"❤":0},reactor_names:a=[]}=t;if(o=(0,r._)({},o),a=[...a],i&&!n){let t=o[n="❤"];o[n]=t?t+1:1,e&&e.is_public_admin&&a.push(e.name||"author")}else!i&&n&&(o["❤"]=o["❤"]?o["❤"]-1:0,e&&e.is_public_admin&&(a=a.filter(t=>t!==(e.name||"author"))),n=null);return{reaction:n,reactions:o,reactor_names:a}},P=(e,t,i,n)=>{e.reaction=t,e.reactions=i,e.reactor_names=n};function N(e,t,i,n){let r=(0,C.n1t)("/api/v1/".concat(t?"comment":"post","/").concat(e.id,"/reaction"),{token:n});return i?p().post(r).send({reaction:"❤"}):p().delete(r)}class T extends a.Component{notifyParent(e){let{reaction:t,reactions:i,reactor_names:n}=e,o=(0,r._)({},this.props.post),a=this.props.comment&&(0,r._)({},this.props.comment);P(a||o,t,i,n),this.props.onChange&&this.props.onChange({post:o,comment:a})}async reactionRejected(e){(0,y.j)(y.FP.REACTION_REJECTED,{comment_id:this.props.comment&&this.props.comment.id,post_id:this.props.post&&this.props.post.id,reason:"Not logged in",unreact:!e}),await new Promise(e=>{this.state.includeModal?this.modalRef.current.open(e):this.setState({includeModal:!0},()=>this.modalRef.current.open(e))})}render(e){let t,{className:i,user:n,pub:r,comment:a,height:l,isStatic:c,post:u,buttonStyle:p,hideReactionCount:m,countInParenthesesStyle:v,iString:f}=e,b=a||u,_=null==b?void 0:b.reaction,y=(null==b?void 0:b.reactions)||{},Z=d()(Object.values(y));return t=u&&u.reaction_url_override?u.reaction_url_override:c?h.W.REACTION_URL:"javascript:void(0)",(0,o.BX)(k.xv,{as:"span",decoration:"hover-underline",color:_?"error":"pub-secondary-text",className:i,children:[this.props.render?this.props.render({liked:_,numReactions:Z>0?(0,S.numberToString)(Z):null,onClick:e=>{this.react(e)}}):(0,o.tZ)("a",{href:t,className:s()("like-button",{button:p,"post-meta-button":p,liked:_}),onClick:e=>this.react(e),children:(0,o.BX)(w.hs,{gap:6,alignItems:"center",className:i,children:[c?(0,o.tZ)(g.Z,{ampProps:{layout:"fixed"},isStatic:!0,height:l,stroke:"var(--color-fg-secondary-themed)",fill:"transparent"}):(0,o.BX)(w.hs,{className:"reaction-container",children:[(0,o.tZ)(g.Z,{className:"animation"}),!_&&(0,o.tZ)(g.Z,{strokeWidth:2,height:l,fill:"transparent",stroke:"var(--color-fg-secondary-themed)"}),_&&(0,o.tZ)(g.Z,{height:l,strokeWidth:2})]}),v?(0,o.BX)(k.xv.Meta,{color:_?"error":"pub-secondary-text",className:"like-count",children:[f(_?"Liked":"Like"),!m&&Z>0?" (".concat((0,S.numberToString)(Z),")"):""]}):!m&&Z>0?(0,o.tZ)("span",{className:"like-count",children:(0,S.numberToString)(Z)}):p?(0,o.tZ)("span",{className:"like-count",children:f("Like")}):null]})}),!c&&this.state.includeModal&&(0,o.tZ)(X,{modalRef:this.modalRef,user:n,pub:r,comment:a,react:this.react})]})}constructor(...e){super(...e),(0,n._)(this,"state",{includeModal:!1}),(0,n._)(this,"modalRef",(0,a.createRef)()),(0,n._)(this,"react",async e=>{if(this.props.isStatic)return;e&&e.stopPropagation();let t=this.props.comment||this.props.post;if(!t){console.warn("LikeButton: no subject");return}let i=!t.reaction;if(this.props.onReactedChange&&this.props.onReactedChange(i),this.props.noSelfUpdate)return;let n=await (0,Z.Se)(this,"locked",async(e,t)=>{let n;let r=t.comment||t.post;if(!r){console.warn("LikeButton: no subject");return}let o=N(r,!!t.comment,i,t.token);t.oauthAccessToken&&o.set("Authorization","Bearer ".concat(t.oauthAccessToken));let{reaction:a,reactions:l,reactor_names:s}=x(t.user,r);this.notifyParent({reactions:l,reaction:a,reactor_names:s});try{await o}catch(e){n=e,this.notifyParent(r)}return{error:n,reaction:a}});return n&&n.error&&(n.error.response&&401===n.error.response.statusCode?await this.reactionRejected(n.reaction):alert((0,Z.zx)(n.error))),!!n&&!n.error})}}let E=(0,f.fz)((0,b.$1)(T));function X(e){let{comment:t,pub:i,user:n,modalRef:r,onClose:a,react:l}=e,{iString:s}=(0,f.M1)();return(0,o.tZ)(v.Z,{ref:r,onClose:a,children:(0,o.BX)(w.tu,{alignItems:"center",paddingTop:80,gap:24,children:[(0,o.tZ)(k.xv.H2,{children:s(t?"Subscribe to like this comment":"Subscribe to like this post")}),(0,o.tZ)(m.Z,{user:n,pub:i,showLogin:!0,showTerms:!0,source:"like_button",onSuccess:async e=>{let t=e&&e.body&&e.body.email;e&&e.body&&e.body.prompt_to_login||!await l()?window.location.href=(0,C.uXE)({for_pub:i.subdomain,email:t}):(null==r?void 0:r.current)&&((0,_.a)({freeSignup:!0,freeSignupEmail:t}),await r.current.close())}})]})})}},75697:function(e,t,i){i.d(t,{B8:()=>I,BZ:()=>B,I:()=>v,O1:()=>P,Po:()=>x,Ui:()=>w,Uo:()=>C,Vn:()=>Z,WZ:()=>S,Wn:()=>f,b6:()=>y,bI:()=>k,lc:()=>b,sn:()=>_});var n=i(7409),r=i(99282),o=i(16584),a=i(98661),l=i(95441),s=i(68833),c=i(59176),d=i(98914),u=i(70379),p=i(60308),h=i(33884),m=i(84864),g=i(47929);function v(e,t,i){let{shareUrl:o,post:a,pub:l,selectionId:d,utm_campaign:u,utm_medium:p,event:h=s.FP.SHARE_LINK_CLICKED,trackParams:m={}}=i;(0,s.j)(h,(0,n._)((0,r._)((0,n._)({name:e,post_id:a?a.id:null},d?{selection_id:d}:{}),{source:u,utm_medium:p}),m));let g=t(o);g&&"string"==typeof g&&(g.startsWith("http")?window.open(g,"_blank"):document.location.href=g),(0,c.ex)("".concat(null==l?void 0:l.subdomain," shared"),!0)}function f(e){let{pub:t,post:i,sharingSelfPub:n,shareName:r}=e,o=(null==t?void 0:t.twitter_screen_name)||t&&m.twitterScreenNames[t.subdomain],a=r;t&&n?a="I just started a Substack! You can subscribe to it here":(t&&!i&&(a="Subscribe to ".concat(a)),o&&(!i||t&&(!i.publishedBylines.length||i.publishedBylines.some(e=>e.id===t.author_id)))&&(a+=", by @".concat(o))),v("twitter",e=>(0,p.LaP)({url:e,text:a}),e)}function b(e){v("linkedin",e=>(0,p.n1t)("https://www.linkedin.com/sharing/share-offsite/",{url:e}),e)}function _(e){v("reddit",t=>(0,p.n1t)("https://www.reddit.com/submit/",{url:t,title:e.shareName}),e)}function y(e){v("hackernews",t=>(0,p.n1t)("https://news.ycombinator.com/submitlink",{url:t,title:e.shareName}),e)}function Z(e){v("pinterest",t=>(0,p.n1t)("https://www.pinterest.com/pin/create/button",{u:t,description:e.shareName}),e)}function w(e){v("copy",e=>((0,d.vQ)(e),!1),e)}function k(e){v("bluesky",t=>(0,p.xJ2)({text:"".concat(e.shareName,"\n").concat(t)}),e)}function C(){let e=(0,u.pm)(),{iString:t}=(0,l.M1)(),[i,s]=(0,a.useState)(!1);return{handleCopyLink:(0,a.useCallback)(i=>{w(i),e.popToast(e=>(0,o.tZ)(u.FN,(0,r._)((0,n._)({},e),{text:t("Copied link to clipboard")}))),s(!0),setTimeout(()=>s(!1),3e3)},[t,e]),justCopied:i}}function S(e){v("email",t=>(0,p.n1t)("mailto:",{subject:e.shareName,body:t}),e)}function B(e){v("notes",e=>(0,p.n1t)((0,h.TK)({message:e})),e)}function x(e){v("facebook",e=>(0,p.n1t)("https://www.facebook.com/sharer/sharer.php",{u:e}),e)}function I(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{post:t,pub:i,profile:n}=e;return t?t.title:i?i.name:n?"".concat(n.name," on Substack"):document.title}function P(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{pub:i,post:r,clip:o,comments:a,commentId:l,selectionId:s,profile:c,user:d,utm_campaign:u,medium:h,referral_token:v,useCustomDomainOverOpen:f,params:b}=t,_=(0,n._)({r:(null==d?void 0:d.id)?(0,m.userReferralKey)(d):v,selection:s,utm_campaign:u||(r?"post":c?"profile":i?"pub":o?"clip":"unknown"),utm_medium:h||g.lP.web,utm_source:e},{comments:null!=a&&!!a.length||void 0,commentId:l},o?{clipId:o.id}:{},b);return(null==i?void 0:i.subdomain)&&(null==r?void 0:r.slug)&&!o?(0,p.K8_)(i.subdomain,r.slug,{params:_,hostOverride:f&&i.custom_domain?(0,p.SVA)(i):null}):(0,p.n1t)("".concat(r?(0,p.uRy)(i,r,{comments:!!(null==a?void 0:a.length),commentId:l,clipId:null==o?void 0:o.id}):i?"".concat(i.base_url,"/"):"undefined"!=typeof window?window.location.href.split("?")[0]:""),_)}},50515:function(e,t,i){i.d(t,{J:()=>r}),i(27412),i(7409),i(99282),i(98848),i(16584);var n=i(6400);i(98914),i(84864);let r={"data-gramm":"false","data-gramm_editor":"false","data-enable-grammarly":"false"};n.Component},87154:function(e,t,i){i.d(t,{j:()=>I});var n=i(7409),r=i(99282),o=i(16584),a=i(30396),l=i(347),s=i(74626),c=i(81451),d=i(13561),u=i(50225),p=i(58159),h=i(7523),m=i(7882),g=i(98914),v=i(98422),f=i(19081),b=i(87185),_=i(89263),y=i(70379);let Z={eventCard:"eventCard-wjsEkw",eventCardHeader:"eventCardHeader-vzGcqj",eventActions:"eventActions-PNvHwq",actionButton:"actionButton-lbu4Px",deleteButton:"deleteButton-jXERkS",selectedSpeaker:"selectedSpeaker-cD0A0I",datetimeInput:"datetimeInput-bIkbNN",ticketButton:"ticketButton-AX1v_z",ticketButtonContainer:"ticketButtonContainer-TKaA1i",formLabel:"formLabel-q3NKHl"},w=()=>{let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t="";for(let i=0;i<10;i++)t+=e.charAt(Math.floor(Math.random()*e.length));return t},k=e=>{let{isOpen:t,onClose:i,onEventCreated:l,editingEvent:c=null,pub:u}=e,v=(0,y.pm)(),k=!!c,[C,S]=(0,a.eJ)(()=>c?(0,r._)((0,n._)({},c.value),{dateTime:new Date(c.value.dateTime)}):{title:"",description:"",placeholderImage:"",dateTime:new Date,place:"",image:"",location:"",ticketLink:"",speakerIds:[],type:"in-person"}),[B,x]=(0,a.eJ)(!1),{refetch:I}=(0,m.ib)({pathname:"/api/v1/islands/cms/config",auto:!1,method:"PUT"}),{refetch:P}=(0,m.ib)({pathname:"/api/v1/islands/cms/config",auto:!1,method:"PUT"});(0,a.d4)(()=>{c?S((0,r._)((0,n._)({},c.value),{dateTime:new Date(c.value.dateTime)})):S({title:"",description:"",placeholderImage:"",dateTime:new Date,place:"",image:"",location:"",ticketLink:"",speakerIds:[],type:"in-person"})},[c]);let N=async e=>{e.preventDefault(),x(!0);try{let e=(0,n._)({},C);if(k&&c)await P({query:{key:c.key},json:{value:e}}),v.popToast(e=>(0,o.tZ)(y.FN,(0,r._)((0,n._)({},e),{text:"Event updated successfully!"})));else{let t="event-".concat(w());await I({query:{key:t},json:{value:e}}),v.popToast(e=>(0,o.tZ)(y.FN,(0,r._)((0,n._)({},e),{text:"Event created successfully!"})))}i(),l()}catch(t){let e=k?"updating":"creating";v.popToast(i=>(0,o.tZ)(y.FN,(0,r._)((0,n._)({},i),{text:"Error ".concat(e," event: ").concat((0,g.zx)(t))})))}finally{x(!1)}},T=e=>{let t=e.toString();C.speakerIds.includes(t)||S((0,r._)((0,n._)({},C),{speakerIds:[...C.speakerIds,t]}))},E=e=>{S((0,r._)((0,n._)({},C),{speakerIds:C.speakerIds.filter(t=>t!==e)}))},X=C.speakerIds.map(e=>u.contributors.find(t=>t.user_id.toString()===e)).filter(e=>void 0!==e),L=u.contributors.filter(e=>!C.speakerIds.includes(e.user_id.toString()));return(0,o.tZ)(d.A,{isOpen:t,width:600,onClose:i,children:(0,o.BX)(f.tu,{gap:24,paddingBottom:24,children:[(0,o.tZ)(h.Z,{preset:"h4-sans-condensed",children:k?"Edit Event":"Add New Event"}),(0,o.tZ)("form",{onSubmit:N,children:(0,o.BX)(f.tu,{gap:20,children:[(0,o.tZ)(_.n,{label:"Title",value:C.title||"",onChange:e=>S((0,r._)((0,n._)({},C),{title:e}))}),(0,o.BX)("div",{children:[(0,o.tZ)("label",{className:Z.formLabel,children:"Description"}),(0,o.tZ)(p.f,{placeholder:"Event description...",value:C.description||"",onChange:e=>S((0,r._)((0,n._)({},C),{description:e.target.value}))})]}),(0,o.BX)("div",{children:[(0,o.tZ)("label",{className:Z.formLabel,children:"Date & Time"}),(0,o.tZ)("input",{className:Z.datetimeInput,type:"datetime-local",value:C.dateTime?C.dateTime.toISOString().slice(0,16):"",onChange:e=>S((0,r._)((0,n._)({},C),{dateTime:new Date(e.target.value)}))})]}),(0,o.tZ)(_.n,{label:"Place/Venue",value:C.place||"",onChange:e=>S((0,r._)((0,n._)({},C),{place:e}))}),(0,o.tZ)(_.n,{label:"Location",placeHolder:"Address or location details",value:C.location||"",onChange:e=>S((0,r._)((0,n._)({},C),{location:e}))}),(0,o.tZ)(b.m,{label:"Event Type",options:[{value:"in-person",label:"In Person"},{value:"livestream",label:"Livestream"}],value:C.type||"in-person",onChange:e=>S((0,r._)((0,n._)({},C),{type:e}))}),(0,o.tZ)(_.n,{label:"Main Image URL",placeHolder:"https://...",value:C.image||"",onChange:e=>S((0,r._)((0,n._)({},C),{image:e}))}),(0,o.tZ)(_.n,{label:"Placeholder Image URL",placeHolder:"https://...",value:C.placeholderImage||"",onChange:e=>S((0,r._)((0,n._)({},C),{placeholderImage:e}))}),(0,o.tZ)(_.n,{label:"Ticket Link",placeHolder:"https://...",value:C.ticketLink||"",onChange:e=>S((0,r._)((0,n._)({},C),{ticketLink:e}))}),(0,o.BX)("div",{children:[(0,o.tZ)("label",{className:Z.formLabel,children:"Speakers"}),(0,o.BX)(f.tu,{gap:12,children:[X.length>0&&(0,o.tZ)(f.tu,{gap:8,children:X.map(e=>(0,o.BX)(f.gq,{alignItems:"center",className:Z.selectedSpeaker,justifyContent:"space-between",children:[(0,o.tZ)(h.Z,{preset:"body",children:e.name}),(0,o.tZ)("button",{className:"".concat(Z.actionButton," ").concat(Z.deleteButton),type:"button",onClick:()=>E(e.user_id.toString()),children:"Remove"})]},e.user_id))}),L.length>0&&(0,o.tZ)(b.m,{label:"",options:[{value:"",label:"Select a speaker..."},...L.map(e=>({value:e.user_id.toString(),label:e.name}))],value:"",onChange:e=>{e&&T(parseInt(e))}}),0===L.length&&0===X.length&&(0,o.tZ)(h.Z,{color:"tertiary",preset:"detail-small",children:"No contributors available to select as speakers."})]})]}),(0,o.BX)(f.gq,{gap:16,justifyContent:"end",children:[(0,o.tZ)(s._,{disabled:B,variant:"outline",onClick:i,children:"Cancel"}),(0,o.tZ)(s._,{disabled:B,type:"submit",variant:"primary",children:B?k?"Updating...":"Creating...":k?"Update Event":"Add Event"})]})]})})]})})},C=e=>{let{eventConfig:t,onEdit:i,onDelete:n,user:r}=e,a=null==r?void 0:r.is_admin;return(0,o.BX)("div",{className:Z.eventCard,children:[(0,o.BX)("div",{className:Z.eventCardHeader,children:[(0,o.tZ)(h.Z,{preset:"h4-sans-condensed",children:t.value.title}),a&&(0,o.BX)("div",{className:Z.eventActions,children:[(0,o.tZ)("button",{className:Z.actionButton,onClick:()=>i(t),children:"Edit"}),(0,o.tZ)("button",{className:"".concat(Z.actionButton," ").concat(Z.deleteButton),onClick:()=>n(t.key),children:"Delete"})]})]}),(0,o.BX)(f.tu,{gap:8,children:[(0,o.tZ)(h.Z,{color:"tertiary",preset:"detail-small",children:t.value.dateTime&&new Date(t.value.dateTime).toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"})}),(0,o.tZ)(h.Z,{preset:"body",children:t.value.description}),(0,o.BX)(f.gq,{alignItems:"center",gap:8,children:[(0,o.BX)(h.Z,{color:"tertiary",preset:"detail-small",children:["\uD83D\uDCCD ",t.value.location||t.value.place]}),(0,o.BX)(h.Z,{color:"tertiary",preset:"detail-small",children:["• ","livestream"===t.value.type?"\uD83D\uDD34 Livestream":"\uD83D\uDC65 In Person"]})]}),t.value.ticketLink&&(0,o.tZ)("div",{className:Z.ticketButtonContainer,children:(0,o.tZ)("a",{className:Z.ticketButton,href:t.value.ticketLink,rel:"noopener noreferrer",target:"_blank",children:"Get Tickets"})})]})]})},S=e=>{let{user:t,pub:i}=e,[l,c]=(0,a.eJ)(!1),[d,u]=(0,a.eJ)(null),p=(0,y.pm)(),v=null==t?void 0:t.is_admin,{result:b,refetch:_}=(0,m.ib)({pathname:"/api/v1/islands/cms/config",query:{prefix:"event-"},auto:!0,deps:[]}),{refetch:Z}=(0,m.ib)({pathname:"/api/v1/islands/cms/config",auto:!1,method:"DELETE"}),w=(null==b?void 0:b.configs)||[],S=e=>{u(e),c(!0)},B=async e=>{if(confirm("Are you sure you want to delete this event?"))try{await Z({query:{key:e}}),p.popToast(e=>(0,o.tZ)(y.FN,(0,r._)((0,n._)({},e),{text:"Event deleted successfully!"}))),_()}catch(e){p.popToast(t=>(0,o.tZ)(y.FN,(0,r._)((0,n._)({},t),{text:"Error deleting event: ".concat((0,g.zx)(e))})))}};return(0,o.BX)(f.tu,{gap:24,children:[(0,o.BX)(f.gq,{alignItems:"center",justifyContent:"space-between",children:[(0,o.tZ)(h.Z,{preset:"h2-serif",children:"Upcoming Events"}),v&&(0,o.tZ)(s._,{variant:"primary",onClick:()=>c(!0),children:"Add Event"})]}),w.length>0?(0,o.tZ)(f.tu,{gap:16,children:w.map(e=>(0,o.tZ)(C,{eventConfig:e,user:t,onDelete:B,onEdit:S},e.key))}):(0,o.tZ)(h.Z,{preset:"body",children:"No events yet. Add your first event!"}),v&&(0,o.tZ)(k,{editingEvent:d,isOpen:l,pub:i,onClose:()=>{c(!1),u(null)},onEventCreated:()=>{_()}})]})},B=()=>(0,o.BX)(f.tu,{gap:24,children:[(0,o.tZ)(h.Z,{preset:"h2-serif",children:"Latest Posts"}),(0,o.tZ)(h.Z,{preset:"body",children:"Posts tagged America 250 will be displayed here."})]}),x=()=>(0,o.BX)(f.tu,{gap:24,children:[(0,o.tZ)(h.Z,{preset:"h2-serif",children:"About America 250"}),(0,o.tZ)(h.Z,{preset:"body",children:"Information about America 250 will be displayed here."})]}),I=e=>{let{pub:t,user:i}=e,{isMobile:n}=(0,v.v9)(),[r,s]=(0,a.eJ)("events");return(0,o.tZ)(l.h,{children:(0,o.tZ)(c.x,{paddingTop:n?40:64,children:(0,o.BX)(f.tu,{gap:40,paddingBottom:64,children:[(0,o.tZ)(h.Z,{preset:"h1-sans",children:"America 250"}),(0,o.tZ)(f.gq,{justifyContent:"center",children:(0,o.tZ)(u.w,{activeTabId:r,tabs:[{title:"Events",id:"events"},{title:"Posts",id:"posts"},{title:"About",id:"about"}],onClick:e=>{e&&s(e)}})}),(0,o.tZ)(f.tu,{gap:32,children:(()=>{switch(r){case"events":return(0,o.tZ)(S,{pub:t,user:i});case"posts":return(0,o.tZ)(B,{});case"about":return(0,o.tZ)(x,{});default:return null}})()})]})})})}},17381:function(e,t,i){i.d(t,{q:()=>Z});var n=i(16584),r=i(6400),o=i(67358),a=i(25380),l=i(68494),s=i(39535),c=i(20888),d=i(18582),u=i(74626),p=i(7523),h=i(87810),m=i(95441),g=i(33578),v=i(61264),f=i(19680),b=i(61254),_=i(19081),y=i(84864);let Z=e=>{var t,i,Z,w,k,C,S;let{author_id_or_slug:B,authorInfo:x,posts:I,pub:P,user:N,utm:T}=e,{authorInfo:E,posts:X}=(0,f.e)({author_id_or_slug:B,authorInfoPreload:x,postsPreload:I,pub:P}),{isSubscribedToAuthor:L,toggleSubscription:F,hasSection:R}=(0,h.l)(null!==(t=null==E?void 0:E.user_id)&&void 0!==t?t:0),{iString:M}=(0,m.M1)(),U=null!==(i=null==E?void 0:E.name)&&void 0!==i?i:"",A=null!==(Z=null==E?void 0:E.bio)&&void 0!==Z?Z:"",D=null!==(w=null==E?void 0:E.photo_url)&&void 0!==w?w:null,O=null!==(k=null==E?void 0:E.twitter_screen_name)&&void 0!==k?k:"",z=null!==(S=null!==(C=null==E?void 0:E.email_for_display)&&void 0!==C?C:null==E?void 0:E.email)&&void 0!==S?S:"",j=(0,y.isDefaultMarblePhoto)(D)?void 0:D;return(0,n.tZ)(d.q,{belowDescription:(0,n.BX)(_.tu,{gap:16,children:[z&&(0,n.BX)(_.gq,{alignItems:"center",gap:8,children:[(0,n.tZ)(o.Z,{size:16}),(0,n.tZ)(p.Z,{preset:"body-link",children:(0,n.tZ)("a",{href:"mailto:".concat(z),children:z})})]}),O&&(0,n.BX)(_.gq,{alignItems:"center",gap:8,children:[(0,n.tZ)(s.Z,{size:16}),(0,n.tZ)(p.Z,{preset:"body-link",children:(0,n.tZ)("a",{href:"https://x.com/".concat(O),children:O})})]}),R&&(0,n.BX)(r.Fragment,{children:[(0,n.tZ)(b.iz,{paddingY:8}),(0,n.BX)(_.tu,{alignItems:"start",gap:16,children:[(0,n.tZ)(u._,{size:"sm",variant:"outline",onClick:F,children:L?(0,n.BX)(_.gq,{alignItems:"center",gap:8,children:[M("Notified")," ",(0,n.tZ)(a.Z,{size:16})]}):(0,n.BX)(_.gq,{alignItems:"center",gap:8,children:[M("Get Notified")," ",(0,n.tZ)(l.Z,{size:16})]})}),(0,n.tZ)(p.Z,{preset:"detail-small",children:M(L?"You'll be notified by email whenever this author publishes.":"Get notified by email whenever this author publishes.")})]})]})]}),bodyWrapperVariant:"two-middle-columns",description:null!=A?A:void 0,image:j?(0,n.tZ)(c.e,{maxWidth:400,src:j,style:{maxWidth:"100%"}}):void 0,isLoading:!E,title:U,children:E&&X&&(0,n.tZ)(g.O,{authorId:E.user_id,hideCommunity:!0,isPodcast:!1,newPosts:X,pub:P,renderLoading:()=>null,user:N,utm:T,children:e=>{let{posts:t}=e;return(0,n.tZ)(_.tu,{gap:24,children:t.map((e,t)=>(0,n.BX)(n.HY,{children:[0!==t&&(0,n.tZ)(b.iz,{}),(0,n.tZ)(v.X,{post:e,variant:"archive"})]}))})}})})}},3469:function(e,t,i){i.d(t,{_:()=>g,j:()=>v});var n=i(16584),r=i(59543),o=i(11712),a=i(20888),l=i(18582),s=i(89276),c=i(98422),d=i(15771),u=i(14773),p=i(17043),h=i(60836);let m="image-sYkLIi",g={careers:{slug:"careers",title:(0,n.BX)("span",{children:["Join ",(0,n.tZ)("em",{children:"The Free Press"})]}),description:(0,n.BX)("span",{children:[(0,n.tZ)("em",{children:"The Free Press"})," is seeking exceptional people who share our values."]})},about:{slug:"about",title:(0,n.BX)("span",{children:["About",(0,n.tZ)("br",{}),(0,n.tZ)("em",{children:"The Free Press"})]}),description:"A new media company built on the ideals that were once the bedrock of American journalism."},"the-free-press-book-club":{slug:"the-free-press-book-club",title:"The Free Press Book Club",description:"Each month, one Free Press writer sits down with the author of a new, vital book. We’ve read and discussed novels, essay collections, political criticism, and more. Book club attendees get a copy of the book, an opportunity to ask questions, and to meet other Free Pressers.",image:(0,n.tZ)(a.e,{alt:"The Free Press Book Club",className:m,maxWidth:540,src:(0,p.zF)("".concat((0,u.ZJ)(),"/img/thefp/fp-book-club-cover.jpg"))})},america250:{slug:"america250",title:"The Free Press Presents: America at 250",description:"\nTwo and a half centuries later, we still hold these truths to be self-evident.\n\nJoin us for a yearlong celebration of America’s 250th birthday: where we’ve come from, where we are, and where we’re going. Expect big events, small gatherings, performances, podcasts, videos, and essays from your favorite _Free Press_ contributors, and many others. Find out about all of it here, first.",image:(0,n.tZ)(a.e,{alt:"America at 250",className:m,maxWidth:540,src:(0,p.zF)("".concat((0,u.ZJ)(),"/img/thefp/america250Final.png"))}),socialImage:(0,p.zF)("".concat((0,u.ZJ)(),"/img/thefp/america250SocialFinal.png"))},"community-guidelines":{slug:"community-guidelines",title:"Community Guidelines",description:""},"privacy-notice":{slug:"privacy-notice",title:"Privacy Notice",description:""},faq:{slug:"faq",title:"Frequently Asked Questions",description:""}},v=e=>{var t,i;let{pub:a,post:u,user:p,type:m,html:v}=e,f=g[m],{isMobile:b}=(0,c.v9)();if(!f)return null;let _=!!((null==p?void 0:p.is_contributor)&&(null==u?void 0:u.id)&&(null==u?void 0:u.type)==="page");return(0,n.tZ)(l.q,{aboveTitle:_&&(null==u?void 0:u.id)?(0,n.tZ)(d.zx,{href:(0,h.AN)(a,u.id,{params:{back:document.location.href}}),leading:(0,n.tZ)(r.Z,{size:20}),localNavigation:!1,priority:"secondary",children:"Edit"}):null,description:f.description,image:f.image,metadata:{image:null!==(t=f.socialImage)&&void 0!==t?t:void 0,twitterImage:null!==(i=f.socialImage)&&void 0!==i?i:void 0},title:f.title,children:(0,n.tZ)("div",{className:"typography post",children:(0,n.tZ)("div",{className:b?"":"container",children:(0,n.tZ)(s.j,{isCustomPage:!0,children:(0,n.tZ)(o.Z,{html:v,isAboutPage:!1,pub:a,user:p})})})})})}},22523:function(e,t,i){i.d(t,{N:()=>d});var n=i(16584),r=i(44846),o=i(18582),a=i(3469),l=i(1455),s=i(98130),c=i(63651);let d=e=>{let{pub:t,user:i}=e,{initialSections:d}=(0,s.L)({pub:t}),{title:u,description:p}=a._["the-free-press-book-club"],h={title:u,imageUrl:"".concat((0,c.ZJn)(),"/img/thefp/fp-book-club-cover.jpg"),description:p,url:"/p/the-free-press-book-club"},{title:m,description:g}=a._.america250,v={title:m,imageUrl:"".concat((0,c.ZJn)(),"/img/thefp/america250Final.png"),description:g,url:"/p/america250"},f=d.map(e=>({title:e.name,imageUrl:e.logo_url,description:e.description,url:(0,c.Ucy)(t,{section:e})}));return(0,n.tZ)(o.q,{actions:(0,n.tZ)(r.r,{pub:t,sectionType:"event",user:null!=i?i:null}),description:(0,n.BX)(n.HY,{children:["Find out about our upcoming live events or watch recordings of the ones you couldn’t make it to in person. Our past events include monthly book clubs and our ",(0,n.tZ)("em",{children:"America Debates"})," series, which tackled immigration, crime and punishment, foreign policy, and the American dream. Sign up for alerts to get tickets for Free Press events at ",(0,n.tZ)("a",{href:"https://thefp.com/newsletters",children:"thefp.com/newsletters"}),"."]}),title:"Events",children:(0,n.tZ)(l.x,{hideViewAllCta:!0,items:[v,...f,h]})})}},78180:function(e,t,i){i.d(t,{a:()=>l});var n=i(16584),r=i(18582),o=i(40281),a=i(33578);let l=e=>{let{pub:t,user:i,newPostsForArchive:l,metadata:s,utm:c}=e;return(0,n.tZ)(r.q,{bodyWrapperVariant:"two-middle-columns",metadata:s,title:"Latest",children:(0,n.tZ)(a.O,{hideCommunity:!0,hideTop:!0,newPosts:null==l?void 0:l.pub,pub:t,renderLoading:()=>null,source:"archive",user:i,utm:c,children:e=>{let{posts:t}=e;return(0,n.tZ)(o.f,{posts:t})}})})}},16699:function(e,t,i){i.d(t,{T:()=>et});var n=i(16584),r=i(30396),o=i(80569),a=i.n(o),l=i(29032),s=i(347),c=i(10120),d=i(84967),u=i(58159),p=i(7523),h=i(76317),m=i(98422),g=i(19081);let v=e=>{let{isMinimized:t,liveStream:i,onMaximizeChat:o}=e,{isMobile:a,isMobileLandscape:l}=(0,m.v9)(),s=(0,r.sO)(null),{message:c,setMessage:v,loading:f,sendMessage:b}=(0,h.w)({inputRef:s,liveStream:i}),_=async()=>{await b(),t&&o()},y=async e=>{"Enter"===e.key&&await _()},Z=i.liveStreamInformation.chatAuthInfo.canSendChat;return(0,n.BX)(g.tu,{flex:"grow",children:[t&&(0,n.BX)(g.gq,{alignItems:"center",borderBottom:"detail",borderTop:a?"detail":void 0,cursor:"pointer",justifyContent:"space-between",paddingX:24,paddingY:16,onClick:o,children:[(0,n.tZ)(p.Z,{preset:"d1-sans-medium",children:"Live Chat"}),(0,n.tZ)(d.Z,{})]}),(0,n.tZ)(g.tu,{flex:a||l?void 0:"grow",paddingX:24,paddingY:a||l?24:t?16:24,children:(0,n.tZ)(u.n,{ref:s,disabled:!Z||f,flex:"grow",liveStream:i,placeholder:Z?"Write message...":i.liveStreamInformation.chatAuthInfo.errorMessage,rows:a||l||t?1:3,style:{flexGrow:1},value:c,onChange:e=>{v(e.currentTarget.value)},onKeyDown:y,onSend:_})})]})};var f=i(49336),b=i(73674);let _=e=>{let{headerHeight:t,liveStream:i,onMinimizeChat:r}=e;return(0,n.BX)(g.tu,{flex:"grow",children:[(0,n.BX)(g.gq,{alignItems:"center",borderBottom:"detail",cursor:"pointer",justifyContent:"space-between",paddingX:24,paddingY:t?void 0:16,style:t?{height:t}:void 0,onClick:r,children:[(0,n.tZ)(p.Z,{preset:"d1-sans-medium",children:"Live Chat"}),(0,n.tZ)(f.Z,{})]}),(0,n.tZ)(g.tu,{flex:"grow",position:"relative",children:(0,n.tZ)(b.hk,{liveStream:i})})]})};var y=i(7409),Z=i(99282),w=i(67747),k=i(62372),C=i(40034),S=i(61594),B=i(87077),x=i(63651),I=i(47929);let P=e=>{let{liveStream:t,pub:i,viewerCount:o,concurrentViewerCount:a}=e,[l,s]=(0,k.XI)(),[c,d]=(0,r.eJ)(!1),{isMobile:u}=(0,m.v9)(),h=(0,n.BX)(g.tu,{gap:8,children:[(0,n.tZ)(p.Z,{clamp:1,preset:"h5-serif",children:t.liveStream.title}),t.liveStream.description&&(0,n.tZ)(p.Z,{clamp:2,preset:"d3-serif",children:t.liveStream.description})]}),v="Total: ".concat(o,"\nCurrent: ").concat(a),f=(0,n.BX)(g.gq,{alignItems:"center",gap:8,children:[(0,n.tZ)("div",{className:"liveTag-MsSGA4",children:(0,n.tZ)(p.Z,{preset:"detail-large",children:"Live"})}),(0,n.tZ)(B.u,{hoverOptions:u?void 0:{delayEnter:100},layerOptions:{onOutsideClick:()=>d(!1)},preferPlacement:"top-center",text:v,toggleOptions:u?{show:c}:void 0,children:(0,n.BX)(g.gq,{alignItems:"center",className:"viewerCount-R1kN0i",cursor:"pointer",gap:8,onClick:()=>{u&&d(!c)},children:[(0,n.tZ)(w.Z,{}),(0,n.tZ)(p.Z,{preset:"detail-small",children:o})]})})]}),b=(0,n.tZ)(S.u,{menuPlacement:"top-center",shareName:t.liveStream.title,shareUrl:(0,x.thY)({pub:i,utm_source:I.b3.liveStreamShareButton}),trackParams:{live_stream_id:t.liveStream.id},trigger:(0,n.tZ)(g.gq,(0,Z._)((0,y._)({},s),{alignItems:"center",cursor:"pointer",children:(0,n.tZ)(C.Z,{height:24,isHovered:l,width:24})})),utmCampaign:I.VX.liveStreamPermalink});return u?(0,n.BX)(g.tu,{gap:24,paddingX:28,paddingY:16,children:[(0,n.BX)(g.gq,{alignItems:"center",gap:8,justifyContent:"space-between",children:[f,b]}),h]}):(0,n.BX)(g.gq,{alignItems:"start",gap:24,justifyContent:"space-between",paddingX:24,paddingY:24,children:[h,(0,n.BX)(g.gq,{alignItems:"center",gap:24,children:[f,b]})]})};var N=i(74626);let T=e=>{let{user:t,subscribeUrl:i}=e;return(0,n.BX)(g.tu,{gap:40,children:[(0,n.BX)(g.tu,{alignItems:"center",gap:8,children:[(0,n.tZ)(p.Z,{align:"center",preset:"h4-sans-condensed",children:"Stream Ended"}),(0,n.tZ)(p.Z,{align:"center",preset:"d1-sans-regular",children:(null==t?void 0:t.is_subscribed)?"Thanks for watching!":"".concat((null==t?void 0:t.is_free_subscribed)?"Upgrade":"Subscribe"," to watch the next live stream")})]}),(0,n.BX)(g.tu,{alignItems:"stretch",alignSelf:"stretch",gap:8,children:[(null==t?void 0:t.is_subscribed)?(0,n.tZ)(N._,{href:"/videos",variant:"outline",children:"Watch More"}):(0,n.tZ)(N._,{href:i,native:!0,variant:"primary-accent",children:(null==t?void 0:t.is_free_subscribed)?"Upgrade":"Subscribe"}),(0,n.tZ)(N._,{href:"/",variant:"tertiary",children:"Back to Homepage"})]})]})};var E=i(71375),X=i(43141),L=i(15771);let F=e=>{let{closeHref:t,height:i,user:r,subscribeUrl:o}=e,{isMobile:a,isMobileLandscape:l}=(0,m.v9)();return(0,n.BX)(g.gq,{alignItems:"center",borderBottom:"detail",className:"container-j8poGw",justifyContent:"space-between",paddingLeft:24,paddingRight:16,paddingY:i?void 0:a?12:16,style:i?{height:i}:void 0,children:[(0,n.tZ)(X.h,{forceMobile:a||l,height:56}),(0,n.BX)(g.gq,{alignItems:"center",gap:16,children:[!(null==r?void 0:r.is_subscribed)&&(0,n.tZ)(N._,{href:o,native:!0,size:l?"sm":a?"md":"lg",trailingIcon:"plus",variant:"primary-accent",children:(null==r?void 0:r.is_free_subscribed)?"Upgrade":"Subscribe"}),(0,n.tZ)(L.hU,{href:t,priority:"quaternary",children:(0,n.tZ)(E.Z,{})})]})]})};var R=i(8746),M=i(64797),U=i(14773);let A=e=>{let{liveStream:t,pub:i,subscribeUrl:o,user:a}=e,{isMobile:l,isMobileLandscape:s}=(0,m.v9)(),[d,u]=(0,r.eJ)(l),p=(0,c.r)(),f=!!p.active,{viewerCount:b,concurrentViewerCount:y}=(0,h.d)({liveStream:t}),Z={chatComposer:t?(0,n.tZ)(v,{isMinimized:d,liveStream:t,onMaximizeChat:()=>{u(!1)}}):null,chatFeed:t?(0,n.tZ)(_,{headerHeight:s?58:void 0,liveStream:t,onMinimizeChat:()=>u(!0)}):null,details:t?(0,n.tZ)(P,{concurrentViewerCount:y,liveStream:t,pub:i,viewerCount:b}):null,header:(0,n.tZ)(F,{closeHref:(0,U.SV)(i),height:s?58:void 0,subscribeUrl:o,user:a}),mainContent:t?t.liveStreamInformation.desktopPlaybackUrl?(0,n.tZ)(M.P,{disableZoom:!0,handle:p,liveStream:t}):(0,n.tZ)(M.r,{liveStream:t}):(0,n.tZ)(T,{subscribeUrl:o,user:a})};return(0,n.tZ)(g.tu,{bg:"primary",color:"primary",style:{height:"100vh"},children:(0,n.tZ)(c.I,{handle:p,children:(0,n.tZ)(s?z:l?O:D,{isChatMinimized:d,isFullScreen:f,livestream:t,pageElements:Z})})})},D=e=>{var t;let{isChatMinimized:i,isFullScreen:o,livestream:a,pageElements:l}=e,s=(0,r.sO)(null),{width:c,height:d}=(0,R.y)({containerRef:s,defaultWidth:600}),u=16/9;if(null==a?void 0:null===(t=a.liveStreamInformation.aspectRatio)||void 0===t?void 0:t.includes(":")){let[e,t]=a.liveStreamInformation.aspectRatio.split(":").map(Number);e&&t&&(u=e/t)}let p=d*u>c?c:d*u;return(0,n.BX)(g.tu,{alignItems:"stretch",style:{height:"100vh"},children:[!o&&l.header,(0,n.BX)(g.gq,{alignItems:"stretch",flex:"grow",children:[(0,n.tZ)(g.tu,{flex:"grow",position:"relative",children:(0,n.tZ)(g.tu,{ref:s,alignItems:"center",bg:"black",inset:0,justifyContent:"center",position:"absolute",children:(0,n.tZ)(g.gq,{justifyContent:"center",position:"relative",style:{width:p},children:l.mainContent})})}),l.chatFeed&&(0,n.tZ)(g.tu,{borderLeft:"detail",style:{width:400,display:i||o?"none":void 0},children:l.chatFeed})]}),l.details&&(0,n.BX)(g.gq,{borderTop:"detail",style:{height:164,display:o?"none":void 0},children:[(0,n.tZ)(g.tu,{flex:"grow",children:l.details}),(0,n.tZ)(g.tu,{borderLeft:"detail",style:{width:400},children:l.chatComposer})]})]})},O=e=>{let{isChatMinimized:t,isFullScreen:i,pageElements:r}=e;return(0,n.BX)(g.tu,{alignItems:"stretch",style:{height:"100vh"},children:[!i&&r.header,(0,n.tZ)(g.tu,{bg:"black",flex:t?"grow":void 0,justifyContent:"center",children:(0,n.tZ)(g.gq,{justifyContent:"center",position:"relative",children:r.mainContent})}),r.chatFeed&&(0,n.tZ)(g.tu,{borderTop:"detail",flex:"grow",style:{display:t||i?"none":void 0},children:r.chatFeed}),r.details&&(0,n.BX)(g.tu,{borderTop:"detail",style:{display:i?"none":void 0},children:[t&&(0,n.tZ)(g.tu,{flex:"grow",children:r.details}),r.chatComposer]})]})},z=e=>{let{pageElements:t}=e;return(0,n.tZ)(g.gq,{alignItems:"stretch",style:{height:"100vh"},children:(0,n.tZ)(g.tu,{flex:"grow",children:(0,n.tZ)(g.tu,{bg:"black",flex:"grow",justifyContent:"center",children:(0,n.tZ)(g.gq,{position:"relative",children:t.mainContent})})})})};var j=i(33636),H=i(40281),W=i(14617),q=i(61254);let Y=e=>{var t;let{livestreamPageData:i,pub:r,subscribeUrl:o,user:a}=e,{scheduledLiveStreams:l,pastLiveStreamPosts:s,pastLiveStreamSectionId:c}=i,d=null!==(t=r.sections.find(e=>e.id===c))&&void 0!==t?t:null;return(0,n.BX)(g.tu,{bg:"primary",color:"primary",style:{height:"100vh"},children:[(0,n.tZ)(F,{closeHref:(0,x.SVA)(r),subscribeUrl:o,user:a}),(0,n.tZ)(g.tu,{flex:"grow",overflow:"auto",paddingX:28,paddingY:40,children:(0,n.BX)(g.tu,{className:"container-sckr5Y",gap:24,children:[(0,n.tZ)(j.L,{children:"Upcoming livestreams"}),0===l.length?(0,n.tZ)(p.Z,{preset:"h4-sans-condensed",children:"No upcoming livestreams"}):l.map((e,t)=>(0,n.BX)(n.HY,{children:[0!==t&&(0,n.tZ)(q.iz,{}),(0,n.tZ)(W.I,{liveStream:e,trackingSurface:"livestream-page"})]})),(0,n.tZ)(q.iz,{}),(0,n.tZ)(j.L,{children:"Past livestreams"}),(0,n.tZ)(H.f,{posts:s}),d&&(0,n.tZ)(N._,{href:(0,x.Ucy)(r,{section:d}),variant:"outline",children:"Watch more"})]})})]})};var V=i(12620),J=i(13561),K=i(60308);let G={wrapper:"wrapper-JFyjIy",prompt:"prompt-LfHufc",subscribeButton:"subscribeButton-Nj91ga",input:"input-PZFqCj"},Q=e=>{let{isOpen:t,pub:i,subscribeUrl:r,user:o,audience:a}=e;return(0,n.tZ)(J.A,{hideCloseButton:!0,isOpen:t,children:(0,n.BX)(g.tu,{gap:24,children:[(0,n.BX)(g.tu,{gap:16,children:[(0,n.tZ)(p.Z,{align:"center",preset:"h5-sans",children:"only_founding"===a?"Unlock Premium Livestream Access":"Unlock Livestream Access"}),(0,n.tZ)(p.Z,{align:"center",preset:"d2-serif",children:"only_founding"===a?"This livestream is exclusively for our Premium subscribers. Upgrade to Premium now to get access to the conversation in real time and to our live chat":"only_free"===a?"This livestream is a benefit for our subscribers. Sign up below to gain access.":"We’re proud to offer livestreams as an exclusive benefit for our paid subscribers. Sign up to watch live events and never miss a moment."})]}),(0,n.BX)(g.tu,{alignItems:"center",gap:16,children:["only_free"===a?(0,n.tZ)(V.Z,{className:G.wrapper,inputClassName:G.input,inputWrapperClassName:G.inputWrapper,placeholder:"ENTER YOUR EMAIL",promptClassName:G.prompt,pub:i,separateInputAndSubmitButton:!0,source:I.b3.publicationLiveStream,submitButtonText:"Sign up for free",subscribeButtonClassName:G.subscribeButton,user:o,onSuccess:()=>{location.reload()}}):(0,n.tZ)(N._,{href:r,native:!0,children:(null==o?void 0:o.is_free_subscribed)?"Upgrade Today":"Subscribe Today"}),(0,n.BX)(g.gq,{alignItems:"center",gap:16,children:[(0,n.tZ)(p.Z,{preset:"caption",children:"only_free"===a?"Already have an account?":"only_founding"===a?"Already a premium subscriber?":"Already a subscriber?"}),(0,n.tZ)(p.Z,{as:"a",color:"accent",href:(0,K.W1P)(i,{isSignInAttempt:!0}),preset:"caption",children:"only_free"===a?"Sign in":"Switch accounts"})]})]}),(0,n.tZ)(g.tu,{alignItems:"center",children:(0,n.tZ)(N._,{href:(0,K.SVA)(i),size:"sm",variant:"tertiary",children:"Back to Homepage"})})]})})};var $=i(64900),ee=i(68648);let et=e=>{var t,i;let{liveStream:o,livestreamPageData:c,pub:d,user:u}=e,{activeLiveStream:p}=(0,$.H)({preloadedLiveStream:o,pub:d}),[h,m]=(0,r.eJ)(null!=c?c:null),g=(0,K.Zs0)(d,{simple:!0,next:document.location.href,utm_source:I.b3.publicationLiveStream,utm_medium:I.lP.web,utm_content:null!==(i=null==p?void 0:null===(t=p.liveStream)||void 0===t?void 0:t.id)&&void 0!==i?i:null}),v=(null==p?void 0:p.liveStream.status)==="active"&&!(null==p?void 0:p.liveStreamInformation.desktopPlaybackUrl),f=h&&!p;return(0,r.d4)(()=>{let e=async()=>(await a().get("/livestream/data")).body;c||e().then(m)},[c]),(0,n.tZ)(ee.hV,{pub:d,user:u,children:(0,n.tZ)("div",{className:"the-free-press-theme",children:(0,n.BX)(s.h,{children:[(0,n.tZ)(Q,{audience:null==p?void 0:p.liveStream.audience,isOpen:v,pub:d,subscribeUrl:g,user:u}),(0,n.tZ)(l.C,{children:f?(0,n.tZ)(Y,{livestreamPageData:h,pub:d,subscribeUrl:g,user:u}):(0,n.tZ)(A,{liveStream:p,pub:d,subscribeUrl:g,user:u})})]})})})}},1455:function(e,t,i){i.d(t,{x:()=>f});var n=i(7409),r=i(99282),o=i(16584),a=i(94184),l=i.n(a),s=i(62372),c=i(20888),d=i(74626),u=i(7523),p=i(49688),h=i(98422),m=i(61254),g=i(19081);let v={container:"container-F6lwXo",itemImage:"itemImage-xOyOyH",itemImageHoverOverlay:"itemImageHoverOverlay-Q1cWQy",itemImageMobile:"itemImageMobile-Q0peCf",itemBodyMobile:"itemBodyMobile-pajlxB"},f=e=>{let{hasMarkdownDescriptions:t,hideViewAllCta:i,items:n,showDescriptionOnMobile:r,viewAllLabel:a="View all episodes",justifyViewAllLabel:l="center",applyHoverOnTitle:s=!0}=e,{isMobile:c}=(0,h.v9)();return(0,o.tZ)("div",{children:c?(0,o.tZ)(g.tu,{gap:24,children:n.map((e,n)=>(0,o.BX)(o.HY,{children:[0!==n&&(0,o.tZ)(m.iz,{}),(0,o.tZ)(b,{applyHoverOnTitle:s,hasMarkdownDescriptions:t,hideViewAllCta:i,item:e,justifyViewAllLabel:l,showDescriptionOnMobile:r,viewAllLabel:a})]}))}):(0,o.tZ)("div",{className:v.container,children:n.map(e=>(0,o.tZ)(b,{applyHoverOnTitle:s,hasMarkdownDescriptions:t,hideViewAllCta:i,item:e,justifyViewAllLabel:l,viewAllLabel:a}))})})},b=e=>{let{hasMarkdownDescriptions:t,hideViewAllCta:i,item:a,showDescriptionOnMobile:m,viewAllLabel:f,justifyViewAllLabel:b="center",applyHoverOnTitle:_=!0}=e,{isMobile:y}=(0,h.v9)(),[Z,w]=(0,s.XI)(),{markdownProps:k}=(0,p.V)(a.description),C=t?(0,o.tZ)(u.Z,(0,r._)((0,n._)({},k),{clamp:3,preset:"d3-serif"})):(0,o.tZ)(u.Z,{clamp:3,preset:"d3-serif",children:a.description});return(0,o.tZ)("a",{href:a.url,style:{textDecoration:"none"},children:y?(0,o.BX)(g.gq,{gap:24,children:[(0,o.tZ)(g.tu,{className:v.itemImageMobile,flex:"auto",children:a.imageUrl&&(0,o.tZ)(c.e,{className:v.itemImage,maxWidth:100,src:a.imageUrl})}),(0,o.BX)(g.tu,{className:v.itemBodyMobile,gap:8*!!m,justifyContent:m?"start":"space-between",children:[(0,o.tZ)(u.Z,{preset:"h5-serif",children:a.title}),m&&a.description&&C,!i&&(0,o.tZ)(d._,{justifyContent:b,size:"md",trailingIcon:"chevron-right",variant:"tertiary",children:f})]})]}):(0,o.BX)(g.tu,{className:v.itemContainer,cursor:"pointer",gap:16,children:[a.imageUrl&&(0,o.BX)(g.tu,(0,r._)((0,n._)({},w),{position:"relative",children:[(0,o.tZ)(c.e,{className:v.itemImage,maxWidth:350,src:a.imageUrl}),(0,o.tZ)("div",{className:l()({[v.itemImageHoverOverlay]:Z})})]})),(0,o.BX)(g.tu,{gap:8,children:[(0,o.tZ)(u.Z,(0,r._)((0,n._)({},_?w:{}),{color:Z?"accent":"primary",preset:"h5-serif",children:a.title})),C,!i&&(0,o.tZ)(d._,{justifyContent:b,size:"md",trailingIcon:"chevron-right",variant:"tertiary",width:"auto",children:f})]})]})})}},79344:function(e,t,i){i.d(t,{F:()=>f});var n=i(58865),r=i(16584),o=i(94184),a=i.n(o),l=i(25380),s=i(68494),c=i(74626),d=i(87810),u=i(95441),p=i(19081),h=i(70379);let m={notifyButton:"notifyButton-lmtipU",hoverText:"hoverText-TwVQuR",notifyButtonInternal:"notifyButtonInternal-e4KibS"};function g(){let e=(0,n._)(["You'll no longer be notified when this author publishes."]);return g=function(){return e},e}function v(){let e=(0,n._)(["You'll be notified by email whenever this author publishes."]);return v=function(){return e},e}let f=e=>{let{authorId:t,className:i}=e,{popToast:n}=(0,h.pm)(),{iTemplate:o}=(0,u.M1)(),{isSubscribedToAuthor:f,toggleSubscription:b}=(0,d.l)(t);return(0,r.tZ)(c._,{className:a()(m.notifyButton,i),"data-subscribed":f,size:"sm",variant:"outline",onClick:async e=>{e.preventDefault(),e.stopPropagation(),await b(),n(()=>(0,r.tZ)(h.FN,{text:f?o(g()):o(v())}))},onMouseOver:e=>{e.stopPropagation()},children:(0,r.tZ)(p.gq,{alignItems:"center",className:m.notifyButtonInternal,gap:0,justifyContent:"space-between",position:"relative",children:f?(0,r.BX)(r.HY,{children:[(0,r.tZ)("div",{className:a()(m.hoverText),children:"Notified"}),(0,r.tZ)(l.Z,{size:16})]}):(0,r.BX)(r.HY,{children:[(0,r.tZ)("div",{className:a()(m.hoverText),children:"Get Notified"}),(0,r.tZ)(s.Z,{size:16})]})})})}},58676:function(e,t,i){i.d(t,{L:()=>p});var n=i(16584),r=i(89734),o=i.n(r),a=i(44846),l=i(18582),s=i(1455),c=i(87725),d=i(55480),u=i(60308);let p=e=>{let{pub:t,user:i}=e,{ids:r}=(0,c.F)({pub:t}),p=(0,d.EP)(t).filter(e=>!!e.sectionId),h=o()(p,e=>{var t;return r.indexOf(null!==(t=e.sectionId)&&void 0!==t?t:-1)}).map(e=>{var i;return{title:e.podcastTitle,imageUrl:e.artUrl,description:e.description,url:(0,u.UVC)({pub:t,section:e.sectionId&&null!==(i=t.sections.find(t=>t.id===e.sectionId))&&void 0!==i?i:null,addBase:!1})}});return(0,n.tZ)(l.q,{actions:(0,n.tZ)(a.r,{pub:t,sectionType:"podcast",user:null!=i?i:null}),description:(0,n.BX)(n.HY,{children:["Stories you won’t hear anywhere else, conversations with the most fascinating people in the country, and deeper looks into the most talked-about stories of the day. At ",(0,n.tZ)("em",{children:"The Free Press"}),", nothing is off-limits. Listen to our flagship podcast ",(0,n.tZ)("em",{children:"Honestly with Bari Weiss"}),", straight talk about raising kids with Professor Emily Oster, and our series with J.K. Rowling, where we cover everything from book bans to debates on gender."]}),title:"Podcasts",children:(0,n.tZ)(s.x,{items:h})})}},40281:function(e,t,i){i.d(t,{I:()=>p,f:()=>u});var n=i(16584),r=i(58319),o=i(61264),a=i(61254),l=i(19081),s=i(98248),c=i(14773),d=i(17043);let u=e=>{let{isEvents:t,posts:i}=e;return(0,n.tZ)(l.tu,{gap:24,children:i.map((e,i)=>(0,n.BX)(n.HY,{children:[0!==i&&(t?(0,n.BX)(l.gq,{alignItems:"center",gap:24,paddingY:16,children:[(0,n.tZ)(l.gq,{flex:"grow",children:(0,n.tZ)(a.iz,{})}),(0,n.tZ)("img",{src:(0,d.zF)("".concat((0,c.ZJ)(),"/img/thefp/fp-stars.svg"),154)}),(0,n.tZ)(l.gq,{flex:"grow",children:(0,n.tZ)(a.iz,{})})]}):(0,n.tZ)(a.iz,{})),(0,n.tZ)(o.X,{post:e,variant:t?"event-page":"archive"})]}))})},p=e=>{let{isLoading:t,noMorePosts:i,posts:o,onLoadMore:a}=e;return(0,n.BX)(l.tu,{gap:24,children:[(0,n.tZ)(u,{posts:o}),t&&(0,n.tZ)(l.gq,{justifyContent:"center",children:(0,n.tZ)(s.$j,{})}),!!o.length&&!t&&!i&&(0,n.tZ)(r.Z,{threshold:0,onVisible:()=>{a()}})]})}},61612:function(e,t,i){i.d(t,{N:()=>o});var n=i(16584),r=i(18582);let o=()=>(0,n.BX)(r.q,{description:(0,n.BX)("span",{children:["The Free Press reads. A lot. We're constantly running reviews, excerpts, and columns from our favorite authors.",(0,n.tZ)("br",{}),(0,n.tZ)("br",{}),"When we mention a book on our site, we make sure to link to it so that you can get the book, and go deeper. Of course, we mention tons of books: old ones, new ones, ones we agree with, ones we can't stand. You'll find them all below. When you purchase them through our site, we may earn an affiliate commission."]}),title:"What We’re Reading",children:[(0,n.BX)("div",{children:[(0,n.tZ)("script",{"data-list-slug":"pick-of-the-month","data-type":"list",src:" https://bookshop.org/widgets.js "}),(0,n.tZ)("script",{"data-list-slug":"previous-picks-of-the-month","data-type":"list",src:"https://bookshop.org/widgets.js"}),(0,n.tZ)("script",{"data-list-slug":"reader-recommendations","data-type":"list",src:"https://bookshop.org/widgets.js"}),(0,n.tZ)("script",{"data-list-slug":"politics-the-free-press","data-type":"list",src:"https://bookshop.org/widgets.js"})]}),(0,n.tZ)("div",{class:"bookshop__slider",children:(0,n.tZ)("script",{"data-list-slug":"culture-the-free-press","data-type":"list",src:"https://bookshop.org/widgets.js"})}),(0,n.tZ)("div",{class:"bookshop__slider",children:(0,n.tZ)("script",{"data-list-slug":"history-the-free-press","data-type":"list",src:"https://bookshop.org/widgets.js"})}),(0,n.tZ)("div",{class:"bookshop__slider",children:(0,n.tZ)("script",{"data-list-slug":"science-medicine","data-type":"list",src:"https://bookshop.org/widgets.js"})}),(0,n.tZ)("div",{class:"bookshop__slider",children:(0,n.tZ)("script",{"data-list-slug":"tech-the-free-press","data-type":"list",src:"https://bookshop.org/widgets.js"})}),(0,n.tZ)("div",{class:"bookshop__slider",children:(0,n.tZ)("script",{"data-list-slug":"memoir-biography-the-free-press","data-type":"list",src:"https://bookshop.org/widgets.js"})}),(0,n.tZ)("div",{class:"bookshop__slider",children:(0,n.tZ)("script",{"data-list-slug":"parenting-the-free-press","data-type":"list",src:"https://bookshop.org/widgets.js"})}),(0,n.tZ)("div",{class:"bookshop__slider",children:(0,n.tZ)("script",{"data-list-slug":"religion-the-free-press","data-type":"list",src:"https://bookshop.org/widgets.js"})})]})},30116:function(e,t,i){i.d(t,{Z:()=>eb});var n=i(16584),r=i(30396),o=i(20042),a=i(2564),l=i(7409),s=i(99282),c=i(98848),d=i(74626),u=i(14952),p=i(15771),h=i(6070);let m=e=>{let{variant:t,children:i}=e,r=(0,c._)(e,["variant","children"]),o=(0,u.Ij)();return(0,h.HD)({pub:o})?"outline"===t?(0,n.tZ)(d._,(0,s._)((0,l._)({variant:"outline"},r),{children:i})):(0,n.tZ)(d._,(0,s._)((0,l._)({},r),{children:i})):"outline"===t?(0,n.tZ)(p.zx,(0,s._)((0,l._)({priority:"secondary"},r),{children:i})):(0,n.tZ)(p.zx,(0,s._)((0,l._)({},r),{children:i}))};var g=i(84837),v=i(98661),f=i(94184),b=i.n(f);let _={input:"input-yab_Zq",inputSm:"inputSm-LeCzcW"},y=(0,v.forwardRef)((e,t)=>{var{className:i,type:r="text",size:o="default"}=e,a=(0,c._)(e,["className","type","size"]);return(0,n.tZ)("input",(0,s._)((0,l._)({},a),{ref:t,className:b()(i,_.input,"sm"===o&&_.inputSm),type:r}))});var Z=i(19081);let w={editRowContent:"editRowContent-Q3ex6r",fullHeight:"fullHeight-fzWhjy",content:"content-LYcGXJ",contentWrapper:"contentWrapper-IH9YEj",input:"input-CUQULH"},k=e=>{let{label:t,content:i,onSave:o,gap:a=16,onEdit:l,isLoading:s=!1}=e,[c,d]=(0,r.eJ)(!1),[u,p]=(0,r.eJ)(i);return(0,n.tZ)(Z.tu,{className:w.editRowContent,gap:a,children:(0,n.BX)(Z.hs,{alignItems:"end",className:w.fullHeight,gap:8,justifyContent:"space-between",children:[(0,n.BX)(Z.hs,{className:"".concat(w.fullHeight," ").concat(w.contentWrapper),direction:"column",gap:c?8:16,justifyContent:"space-between",children:[(0,n.tZ)(g.DU,{children:t}),(0,n.tZ)(g.WK,{className:w.content,children:c?(0,n.tZ)(y,{className:w.input,size:"sm",type:"text",value:u,onChange:e=>p(e.target.value)}):i})]}),(0,n.tZ)(m,{disabled:s,size:"sm",style:{height:"40px"},variant:"outline",onClick:()=>{c?(null==o||o(u),d(!1)):l?l():d(!0)},children:c?"Save":"Edit"})]})})};var C=i(39693),S=i.n(C),B=i(24350),x=i.n(B),I=i(80569),P=i.n(I),N=i(73207),T=i(60807),E=i(7882),X=i(98914),L=i(70379),F=i(24791),R=i(60308);let M=()=>{let e=(0,T.aF)(),t=(0,u.Ij)(),i=(0,L.pm)(),[o,a]=(0,r.eJ)((null==e?void 0:e.name)||""),[c,d]=(0,r.eJ)((null==e?void 0:e.email)||""),[p,m]=(0,r.eJ)(!1),[g,v]=(0,r.eJ)(!1),[f,b]=(0,r.eJ)(null),[_,y]=(0,r.eJ)(null),[Z,w]=(0,r.eJ)(!1),[k]=(0,r.eJ)(0),[C,B]=(0,r.eJ)(new Set),{ids:I}=(0,N.I)({pub:t}),{ids:M}=(0,N.I)({pub:t,pubSetting:"fp_primary_column_section_ids"}),{result:U,isLoading:A}=(0,E.ib)({pathname:"/api/v1/subscription",auto:!0}),{refetch:D,isLoading:O}=(0,E.ib)({pathname:"/api/v1/subscription/sections/email",auto:!1,method:"PATCH"});(0,r.d4)(()=>{!A&&(null==U?void 0:U.email_settings)&&B(new Set(Object.keys(U.email_settings).filter(e=>{var t;return"individual"===(null===(t=U.email_settings)||void 0===t?void 0:t[e])}).map(e=>Number(e))))},[A,U]);let z=(0,r.I4)(async e=>{if(e&&e!==o){m(!0),b(null);try{await P().put("/api/v1/user/profile").send({name:e}),a(e)}catch(e){b((0,X.zx)(e)),console.error("Name update failed:",e)}finally{m(!1)}}},[o]),j=(0,r.I4)(async()=>{if(!(null==e?void 0:e.email))return{success:!1};w(!0);try{return await P().post("/api/v1/forgot").send({email:e.email,for_pub:null==t?void 0:t.subdomain,redirect:window.location.pathname}),i.popToast(e=>(0,n.tZ)(L.FN,(0,s._)((0,l._)({},e),{text:"Password reset email sent. Please check your inbox."}))),{success:!0}}catch(e){return console.error("Password reset failed:",e),i.popToast(t=>(0,n.tZ)(L.FN,(0,s._)((0,l._)({},t),{text:(0,X.zx)(e)}))),{success:!1}}finally{w(!1)}},[null==e?void 0:e.email,i]),H=(0,r.I4)(async(e,i)=>{if(e&&e!==c){if(e!==i){y("Email addresses do not match");return}v(!0),y(null);try{await P().put("/api/v1/user/email").send({email:e,email_doublecheck:i}),d(e),(0,X.uX)((0,R.ZPN)({redirect:"/subscribe?isSignInAttempt=true",for_pub:null==t?void 0:t.subdomain}))}catch(e){var n;(null===(n=e.response)||void 0===n?void 0:n.status)===403?y("This email is already associated with another account"):y((0,X.zx)(e)),console.error("Email update failed:",e)}finally{v(!1)}}},[c]),W=(0,r.Ye)(()=>t?(0,F.tk)({pub:t,includeMainPub:!(0,h.HD)({pub:t}),excludePodcasts:(0,h.HD)({pub:t})}):[],[t]),q=(0,r.I4)(async(e,i)=>{if(!e||!t)return;let n=new Set(C);i?n.add(e):n.delete(e);try{await D({json:W.reduce((t,n)=>(n.sectionId===e&&(t[n.sectionId]={setting:i?"individual":"disabled"}),t),{})}),B(n)}catch(e){console.error("Failed to update newsletter subscription:",e)}},[t,C,W,D]),Y=(0,r.I4)(async(e,i)=>{if(!t)return;let n="fromTheFreePress"===e?M:I.filter(e=>!M.includes(e)),r=new Set(C);n.forEach(e=>{i?r.add(e):r.delete(e)});try{let e=n.reduce((e,t)=>(e[t]={setting:i?"individual":"disabled"},e),{});await D({json:e}),B(r)}catch(e){console.error("Failed to update newsletter group:",e)}},[t,M,I,C,D]),V=x()(W,"sectionId");return{name:o,email:c,updateName:z,updateEmail:H,isUpdatingName:p,isUpdatingEmail:g,nameError:f,emailError:_,isSendingReset:Z,handlePasswordChange:j,newsletters:{isLoading:A||O,fromTheFreePress:t&&M?{name:"From The Free Press",newsletters:S()(M.map(e=>V[e])).map(e=>(0,s._)((0,l._)({},e),{selected:C.has(e.sectionId||0),onToggle:t=>q(e.sectionId||0,t)}))}:{name:"From The Free Press",newsletters:[]},featured:t&&I?{name:"Featured",newsletters:S()(I.filter(e=>!M.includes(e)).map(e=>V[e])).map(e=>(0,s._)((0,l._)({},e),{selected:C.has(e.sectionId||0),onToggle:t=>q(e.sectionId||0,t)}))}:{name:"Featured",newsletters:[]},updateNewsletter:q,updateNewsletterGroup:Y},plan:null==U?void 0:U.plan,totalAmount:null==U?void 0:U.totalAmount,currency:null==U?void 0:U.currency,isLifetime:(null==U?void 0:U.type)==="lifetime"||(null==U?void 0:U.never_ends)||!1,isComped:(null==U?void 0:U.is_comped)||!1,giftCount:k}};var U=i(13561),A=i(7523),D=i(43251);let O="clickable-QzUIvj",z="actionItem-Th40ya",j=e=>{let{href:t,text:i}=e;return(0,n.tZ)(g.v5,{className:"actionLink-ovC95f",href:t,children:i})},H=()=>(0,n.BX)(Z.tu,{gap:4,paddingTop:16,children:[(0,n.tZ)(Z.hs,{gap:4,children:(0,n.BX)(g.NE,{children:["For email delivery issues, ",(0,n.tZ)(j,{href:"/account/email-test",text:"click here"})]})}),(0,n.tZ)(Z.hs,{gap:4,children:(0,n.BX)(g.NE,{children:["For support, ",(0,n.tZ)(j,{href:(0,R.YUt)(),text:"click here"})]})})]}),W=()=>{var e;let{name:t,updateName:i,email:o,updateEmail:l,isSendingReset:s,handlePasswordChange:c}=M(),d=(0,T.aF)(),[u,p]=(0,r.eJ)(!1),[h,v]=(0,r.eJ)(null),[f,b]=(0,r.eJ)(!1),_=async e=>{v({email:e,confirm:e}),p(!0)},y=async()=>{h&&(await l(h.email,h.confirm),p(!1),v(null))},w=()=>{p(!1),v(null)},C=(null==d?void 0:d.subscription_first_payment_at)?new Date(d.subscription_first_payment_at).getFullYear():"";return(0,n.BX)(Z.tu,{style:{width:"100%",flexGrow:1},children:[(0,n.BX)("div",{children:[(0,n.tZ)(g.rS,{children:"Account Settings"}),(0,n.tZ)(g.Ti,{children:C?(0,n.BX)(n.HY,{children:["You've supported independent journalism since ",C,"."]}):(0,n.tZ)(n.HY,{children:"Manage your account settings and preferences."})})]}),(0,n.tZ)(g.bB,{}),(0,n.BX)(Z.tu,{children:[(0,n.BX)(Z.hs,{alignItems:"center",justifyContent:"space-between",paddingBottom:24,children:[(0,n.tZ)(g.rv,{children:"Profile"}),(0,n.tZ)(A.Z,{as:"a",className:"viewProfile-u5hCP0",href:(0,D.Lw)(d),preset:"detail-small",children:"VIEW PROFILE"})]}),(0,n.BX)(Z.hs,{gap:16,children:[(0,n.tZ)("img",{alt:"Profile",src:null!==(e=null==d?void 0:d.photo_url)&&void 0!==e?e:"",style:{width:48,height:48}}),(0,n.tZ)(k,{content:t,label:"Name",onSave:i})]})]}),(0,n.tZ)(g.Jt,{}),(0,n.tZ)(k,{content:o,label:"Email",onSave:_}),(0,n.tZ)(g.Jt,{}),(0,n.tZ)(k,{content:"••••••••••••••••",isLoading:s,label:"Password",onEdit:()=>{c().then(e=>{let{success:t}=e;t&&(b(!0),setTimeout(()=>b(!1),2e4))})}}),f&&(0,n.tZ)(Z.hs,{paddingTop:8,children:(0,n.tZ)(g.NE,{children:"Password reset email sent. Please check your inbox."})}),(0,n.tZ)(g.bB,{}),(0,n.BX)(Z.tu,{children:[(0,n.tZ)(g.rv,{children:"Account Actions"}),(0,n.BX)(Z.hs,{alignItems:"center",className:"".concat(O," ").concat(z),justifyContent:"space-between",paddingTop:16,onClick:()=>(0,X.uX)((0,R.ZPN)()),children:[(0,n.tZ)(A.Z,{preset:"list-item-menu",children:"Sign out"}),(0,n.tZ)(a.Z,{size:20})]}),(0,n.tZ)(g.Jt,{}),(0,n.BX)(Z.hs,{alignItems:"center",className:"".concat(O," ").concat(z),justifyContent:"space-between",onClick:()=>{c()},children:[(0,n.tZ)(A.Z,{preset:"list-item-menu",children:"Change password"}),(0,n.tZ)(a.Z,{size:20})]}),(0,n.tZ)(g.Jt,{})]}),u&&(0,n.tZ)(U.A,{isOpen:u,onClose:w,children:(0,n.BX)(Z.tu,{gap:32,paddingBottom:0,children:[(0,n.BX)("div",{children:[(0,n.tZ)(g.rS,{paddingBottom:16,children:"Change Email Address"}),(0,n.tZ)(A.Z,{preset:"d2-serif",children:"You will be signed out after changing your email address. You will need to sign in again with your new email address."})]}),(0,n.BX)(Z.hs,{gap:16,justifyContent:"space-between",children:[(0,n.tZ)(m,{variant:"outline",onClick:w,style:{flex:1},children:"CANCEL"}),(0,n.tZ)(m,{onClick:y,style:{flex:1,backgroundColor:"#f55"},children:"CONTINUE"})]})]})})]})};var q=i(49336),Y=i(12900),V=i(96302);let J={sectionHeader:"sectionHeader-Z3zoO8",chevron:"chevron-NOVYNS",expanded:"expanded-Tjjigv"},K=e=>{let{name:t,imgUrl:i,checked:r=!0,onToggle:o}=e;return(0,n.BX)(Z.hs,{alignItems:"center",justifyContent:"space-between",children:[(0,n.BX)(Z.hs,{alignItems:"center",gap:16,children:[(0,n.tZ)(Z.hs,{as:"div",bg:"tertiary",height:32,width:32,children:(0,n.tZ)("img",{alt:t,src:i})}),(0,n.tZ)(A.Z,{preset:"lg-preview-byline",children:t})]}),(0,n.tZ)(V.ZP,{checked:r,onChange:e=>null==o?void 0:o(e)})]})},G=e=>{let{title:t,newsletters:i,isExpanded:r,onToggle:o,onSelectAll:a,areAllSelected:l}=e;return(0,n.BX)(Z.tu,{gap:0,width:"100%",children:[(0,n.BX)(Z.hs,{alignItems:"center",className:J.sectionHeader,justifyContent:"space-between",paddingBottom:24,role:"button",tabIndex:0,onClick:o,children:[(0,n.tZ)(g.rv,{children:t}),(0,n.tZ)(q.Z,{className:"".concat(J.chevron," ").concat(r?J.expanded:""),size:24})]}),(0,n.tZ)(Y.H,{expanded:r,children:r&&(0,n.BX)(n.HY,{children:[(0,n.BX)(Z.hs,{alignItems:"center",justifyContent:"space-between",children:[(0,n.tZ)(g.ee,{children:"SELECT ALL"}),(0,n.tZ)(V.ZP,{checked:l,onChange:e=>a(e)})]}),(0,n.tZ)(g.Jt,{}),i.map((e,t)=>(0,n.BX)("div",{children:[(0,n.tZ)(K,{checked:e.selected,imgUrl:e.logoUrl||"",name:e.name,onToggle:t=>e.onToggle(t)}),t{let{newsletters:e}=M(),[t,i]=(0,r.eJ)({fromTheFreePress:!0,featured:!0}),o=e=>{i(t=>(0,s._)((0,l._)({},t),{[e]:!t[e]}))},a=e=>e.length>0&&e.every(e=>e.selected);return(0,n.BX)(Z.tu,{children:[(0,n.tZ)(g.rS,{children:"Your Newsletters"}),(0,n.tZ)(g.Ti,{children:"Manage the email notifications you receive from us to personalize your experience."}),(0,n.tZ)(g.bB,{}),(0,n.tZ)(G,{areAllSelected:a(e.fromTheFreePress.newsletters),isExpanded:t.fromTheFreePress,newsletters:e.fromTheFreePress.newsletters,title:e.fromTheFreePress.name,onSelectAll:t=>e.updateNewsletterGroup("fromTheFreePress",t),onToggle:()=>o("fromTheFreePress")}),(0,n.tZ)(g.bB,{}),(0,n.tZ)(G,{areAllSelected:a(e.featured.newsletters),isExpanded:t.featured,newsletters:e.featured.newsletters,title:e.featured.name,onSelectAll:t=>e.updateNewsletterGroup("featured",t),onToggle:()=>o("featured")})]})};var $=i(55480),ee=i(47929);let et=e=>{let{podcast:t}=e;return(0,n.BX)(Z.hs,{alignItems:"center",justifyContent:"space-between",paddingY:12,children:[(0,n.BX)(Z.hs,{alignItems:"center",gap:16,children:[(0,n.tZ)("div",{className:"podcastLogo-AAT5j_",style:{backgroundImage:t.logoUrl?"url(".concat(t.logoUrl,")"):void 0}}),(0,n.tZ)(A.Z,{preset:"lg-preview-byline",children:t.name})]}),(0,n.tZ)(d._,{href:t.setupUrl,native:!0,size:"sm",variant:"outline",children:"SET UP"})]})},ei=()=>{let e=(0,u.Ij)(),t=(0,T.aF)(),[i,o]=(0,r.eJ)([]),[a,l]=(0,r.eJ)(!0);return((0,r.d4)(()=>{if(!e)return;let i=[],n=(0,F.hK)(e);n&&n.length>0&&n.forEach(n=>{let r=(0,$.d_)({pub:e,section:n});r.title&&i.push({id:n.id,name:r.title,description:r.description||void 0,logoUrl:r.artUrl||void 0,setupUrl:(0,R.tS3)(e,{section:n,noSection:!1,addBase:!0,user:t,startAtSubscribeFlow:!t||!t.is_free_subscribed,params:{utm_source:ee.b3.account}})})}),o(i),l(!1)},[e,t]),a)?(0,n.tZ)(Z.tu,{width:"100%",children:(0,n.tZ)(A.Z,{preset:"h4-sans-condensed",children:"Loading podcast feeds..."})}):0===i.length?(0,n.BX)(Z.tu,{width:"100%",children:[(0,n.tZ)(g.rS,{children:"Subscriber Podcast Feeds"}),(0,n.tZ)(g.Ti,{children:"No podcast feeds are currently available."})]}):(0,n.BX)(Z.tu,{width:"100%",children:[(0,n.tZ)(g.rS,{children:"Subscriber Podcast Feeds"}),(0,n.tZ)(g.Ti,{children:"Free Press podcasts are available anywhere. Select which shows you'd like to subscribe to, in your app of choice, below."}),(0,n.tZ)(g.bB,{}),(0,n.tZ)(Z.hs,{direction:"column",children:i.map((e,t)=>(0,n.BX)("div",{children:[(0,n.tZ)(et,{podcast:e}),t!==i.length-1&&(0,n.tZ)(g.Jt,{})]},e.id))})]})};var en=i(25380),er=i(62126),eo=i(49762),ea=i(63651),el=i(84864);let es={clickable:"clickable-U5bOwj",expandable:"expandable-UB3Kke"},ec=e=>{let{children:t}=e;return(0,n.BX)(Z.hs,{alignItems:"center",gap:16,children:[(0,n.tZ)(en.Z,{size:24,style:{flexShrink:0}}),(0,n.tZ)(A.Z,{preset:"list-item-menu",children:t})]})},ed=()=>{let[e,t]=(0,r.eJ)(!0),[i,o]=(0,r.eJ)(!1),l=(0,T.aF)(),s=(0,u.Ij)(),{plan:c,totalAmount:p,currency:v,isLifetime:f,isComped:b,giftCount:_}=M(),{result:y}=(0,E.ib)({pathname:"/api/v1/subscription",auto:!!(null==l?void 0:l.is_subscribed)}),w=null==l?void 0:l.is_subscribed,{intro:k,benefits:C}=w?l.is_founding?{intro:"As a premium subscriber to The Free Press, you get:",benefits:["Full access to all articles, investigations, and columnists, including Niall Ferguson, Coleman Hughes, Matti Friedman, and Martin Gurri","Access to the thriving comments section and the Free Press community","Text to speech and PDF-to-prints on every article","Video recordings of Honestly with Bari Weiss","First chance to purchase tickets for live Free Press events and subscriber-only discounts","Four off-the-record town halls with Bari each year","Two annual gift subscriptions","One item of merch each year (this year is TGIF socks!)","Supports the mission by sponsoring subscriptions for those who can't afford one, subsidizing free stories, and keeping the lights on"]}:{intro:"As a paid subscriber to The Free Press, you get:",benefits:["Full access to all articles, investigations, and columnists, including Niall Ferguson, Coleman Hughes, Matti Friedman, and Martin Gurri","Access to the thriving comments section and the Free Press community","Text to speech and PDF-to-prints on every article","Video recordings of Honestly with Bari Weiss","First chance to purchase tickets for live Free Press events and subscriber-only discounts"]}:{intro:"As a free subscriber to The Free Press, you get:",benefits:["The Front Page","Occasional free articles"]};return(0,n.BX)(Z.tu,{width:"100%",children:[(0,n.BX)("div",{children:[(0,n.tZ)(g.rS,{children:"Your Subscription"}),(0,n.tZ)(g.Ti,{children:w?l.is_founding?"You’re a premium subscriber!":"You’re a paid subscriber!":"You’re a free subscriber!"})]}),(0,n.tZ)(g.bB,{}),(0,n.BX)(Z.tu,{gap:24,children:[(0,n.tZ)(g.rv,{children:"Subscription"}),(0,n.BX)("div",{children:[(0,n.BX)(Z.hs,{direction:"column",gap:16,children:[(0,n.tZ)(g.ee,{children:"STATUS"}),(0,n.tZ)(A.Z,{preset:"list-item-menu",children:w?f?"Lifetime membership":"Billing period renews ".concat(new Date((null==l?void 0:l.subscription_expiry)||"").toLocaleDateString()):"Free subscription"})]}),(0,n.tZ)(g.Jt,{}),(0,n.BX)(Z.hs,{alignItems:"center",justifyContent:"space-between",children:[(0,n.BX)(Z.hs,{direction:"column",gap:16,children:[(0,n.tZ)(g.ee,{children:"PLAN"}),(0,n.tZ)(A.Z,{preset:"list-item-menu",children:(()=>{if(!w)return"Free";if(f)return"Lifetime membership";if(l.is_subscribed&&(b||!l.subscription_first_payment_at))return l.is_founding?"Comped (Premium)":"Comped (Paid)";if(!c||!p||!v)return"";let e=c.interval||"year";return"".concat((0,el.centsToPriceString)(p,v)," per ").concat(e)})()})]}),!f&&(0,n.tZ)(m,{size:"sm",variant:"outline",onClick:()=>{if(w)o(!0);else{if(!s)return;let e=(0,R.W1P)(s,{user:l,addBase:!0,params:{utm_source:ee.b3.account}});(0,X.uX)(e,{local_navigation:!1})}},children:w?"Change":"Upgrade"})]})]})]}),(0,n.tZ)(g.bB,{}),(0,n.BX)(Z.tu,{gap:24,children:[(0,n.BX)(Z.hs,{alignItems:"center",className:es.expandable,justifyContent:"space-between",onClick:()=>t(!e),children:[(0,n.tZ)(g.rv,{children:"What's Included"}),e?(0,n.tZ)(q.Z,{size:20}):(0,n.tZ)(a.Z,{size:20})]}),e&&(0,n.BX)(Z.tu,{gap:16,children:[(0,n.tZ)(A.Z,{preset:"list-item-menu",children:k}),(0,n.tZ)(g.Jt,{}),C.map((e,t)=>(0,n.tZ)(ec,{children:e},t))]})]}),w&&(0,n.BX)(n.HY,{children:[(0,n.tZ)(g.bB,{}),(0,n.BX)(Z.tu,{children:[(0,n.tZ)(g.rv,{paddingBottom:24,children:"Gift Subscriptions"}),_>0?(0,n.BX)(n.HY,{children:[(0,n.tZ)(A.Z,{preset:"list-item-menu",children:"Gift Independent Journalism."}),(0,n.tZ)(g.Jt,{}),(0,n.BX)(Z.hs,{alignItems:"center",justifyContent:"space-between",children:[(0,n.BX)(Z.hs,{direction:"column",gap:16,children:[(0,n.tZ)(g.ee,{children:"YOUR BALANCE"}),(0,n.tZ)(A.Z,{preset:"lg-preview-byline",children:"".concat(_," Annual Subscription").concat(1!==_?"s":"")})]}),(0,n.tZ)(d._,{href:(0,h.HD)({pub:s})&&l&&(0,eo.default)("enable_founding_gifts")?(0,h.Iv)({user:l}):s?(0,ea.xdn)({pub:s}):"/account/gifts",localNavigation:!1,size:"sm",variant:"outline",children:"SEND GIFT"})]})]}):(0,n.tZ)(n.HY,{children:(0,n.BX)(Z.hs,{alignItems:"center",justifyContent:"space-between",children:[(0,n.BX)(A.Z,{preset:"list-item-menu",children:["Know someone who’d love ",(0,n.tZ)("span",{style:{fontStyle:"italic"},children:"The Free Press"}),"?"]}),(0,n.tZ)(d._,{href:(0,h.HD)({pub:s})&&l&&(0,eo.default)("enable_founding_gifts")?(0,h.Iv)({user:l}):"/subscribe?gift=true",localNavigation:!1,size:"sm",variant:"outline",children:"SEND GIFT"})]})})]})]}),(0,n.tZ)(g.bB,{}),w&&(0,n.BX)(n.HY,{children:[(0,n.BX)(Z.hs,{alignItems:"center",className:es.clickable,justifyContent:"space-between",paddingBottom:8,onClick:()=>{if(!s)return;let e=(0,R.BhD)(s,{addBase:!0,params:{utm_source:ee.b3.account}});(0,X.uX)(e,{local_navigation:!1})},children:[(0,n.tZ)(A.Z,{preset:"list-item-menu",children:"Cancel subscription"}),(0,n.tZ)(a.Z,{size:20})]}),(0,n.tZ)(g.Jt,{})]}),w&&s&&y&&(0,n.tZ)(er.m,{isOpen:i,sub:y,pub:s,onClose:()=>o(!1)})]})};var eu=i(98422);let ep={tabContainer:"tabContainer-ZyUff9",tab:"tab-zPdpGg",selectedTab:"selectedTab-h46kjj",tabContent:"tabContent-Q4YhmV",upgradeBanner:"upgradeBanner-qujPvE",tabMenu:"tabMenu-TPrBTB"},eh=(e,t)=>{if(!e)return;let i=(null==t?void 0:t.is_subscribed)?(0,R._0p)({utm_source:ee.b3.account}):(0,R.W1P)(e,{user:t,addBase:!0,params:{utm_source:ee.b3.account}});(0,X.uX)(i,{local_navigation:!1})},em=()=>{let e=(0,u.Ij)(),t=(0,T.aF)();return(0,n.BX)(Z.hs,{className:ep.upgradeBanner,gap:8,justifyContent:"space-between",alignItems:"center",children:[(0,n.tZ)(A.Z,{preset:"lg-preview-byline",align:"center",children:"You're a free subscriber"}),(0,n.tZ)(d._,{variant:"primary-accent",size:"md",onClick:()=>eh(e,t),children:"Upgrade to paid"})]})},eg=()=>{let[e,t]=(0,r.eJ)("account"),{isMobile:i}=(0,eu.v9)(),o=(0,T.aF)(),a=(null==o?void 0:o.is_free_subscribed)&&!(null==o?void 0:o.is_subscribed);(0,r.d4)(()=>{let e=()=>{let e=new URLSearchParams(window.location.search).get("tab");e&&["account","subscription","newsletters","podcastFeeds"].includes(e)&&t(e)};e(),window.addEventListener("popstate",e);let i=setInterval(e,100);return()=>{window.removeEventListener("popstate",e),clearInterval(i)}},[]);let l=e=>{t(e);let i=new URL(window.location.href);i.searchParams.set("tab",e),window.history.pushState({},"",i)};return(0,n.BX)(Z.hs,{className:ep.tabContainer,direction:i?"column":"row",children:[(0,n.tZ)(Z.hs,{alignItems:i?"stretch":"start",className:ep.tabMenu,direction:i?"row":"column",children:[{id:"account",label:"Account"},{id:"subscription",label:"Subscription"},{id:"newsletters",label:"Newsletters"},{id:"podcastFeeds",label:"Podcast Feeds"}].map(t=>(0,n.tZ)(d._,{className:e===t.id?"".concat(ep.tab," ").concat(ep.selectedTab):ep.tab,variant:"tertiary",onClick:()=>l(t.id),children:t.label},t.id))}),(0,n.BX)("div",{className:ep.tabContent,children:[a&&(0,n.tZ)(em,{}),"account"===e&&(0,n.tZ)(W,{}),"subscription"===e&&(0,n.tZ)(ed,{}),"newsletters"===e&&(0,n.tZ)(Q,{}),"podcastFeeds"===e&&(0,n.tZ)(ei,{}),(0,n.tZ)(H,{})]})]})};var ev=i(347),ef=i(40647);let eb=()=>{let e=(0,ef.xR)(),t=(0,T.aF)(),i=e.getConfigFor("enable_account_settings_revamp");return((0,r.d4)(()=>{if(!t){(0,o.route)("/login");return}i||(0,o.route)("/account")},[t,i]),t&&i)?(0,n.tZ)("div",{className:"the-free-press-theme",children:(0,n.tZ)(ev.h,{children:(0,n.tZ)(eg,{})})}):null}},58159:function(e,t,i){i.d(t,{n:()=>v,f:()=>g});var n=i(7409),r=i(99282),o=i(98848),a=i(16584),l=i(98661),s=i(94184),c=i.n(s),d=i(14945),u=i(7523),p=i(15771),h=i(19081),m=i(95647);let g=(0,l.forwardRef)((e,t)=>{var{className:i,value:l}=e,s=(0,o._)(e,["className","value"]);return(0,a.tZ)(u.Z,(0,r._)((0,n._)({},s),{as:"textarea",className:c()(i,"textarea-Ohqcz2"),innerRef:t,preset:"list-item-menu",value:l}))}),v=(0,l.forwardRef)((e,t)=>{var{className:i,flex:l,liveStream:s,onSend:u}=e,v=(0,o._)(e,["className","flex","liveStream","onSend"]);return(0,a.BX)(h.tu,{flex:l,position:"relative",children:[(0,a.tZ)(g,(0,r._)((0,n._)({},v),{ref:t,className:c()(i,"textareaWithIcon-kncL3t")})),(0,a.BX)(h.gq,{className:"iconContainer-aheBDP",position:"absolute",children:[(0,a.tZ)(m.d,{liveStream:s}),(0,a.tZ)(p.hU,{priority:"quaternary",onClick:()=>{u()},children:(0,a.tZ)(d.Z,{})})]})]})})},99084:function(e,t,i){i.d(t,{$:()=>H});var n=i(7409),r=i(99282),o=i(16584),a=i(30396),l=i(80569),s=i.n(l),c=i(347),d=i(44846),u=i(81451),p=i(40281),h=i(50225),m=i(29032),g=i(74626),v=i(7523),f=i(56743),b=i(2564),_=i(8746),y=i(98422),Z=i(72019),w=i(63651);let k=892/346,C=16/9,S=510/892,B=e=>{let{currentIndex:t,posts:i,pub:n,setCurrentIndex:r}=e,{isMobile:l}=(0,y.v9)(),s=(0,a.sO)(null),{width:c}=(0,_.y)({containerRef:s}),d=l?c-56:c*S,[u,p]=(0,a.eJ)({currentIndex:t,targetIndex:null,stage:null,direction:null}),h=!!u.stage,m=e=>{let{targetIndex:i,direction:n}=e;p({currentIndex:t,targetIndex:i,stage:"prepare",direction:n}),requestAnimationFrame(()=>{p({currentIndex:t,targetIndex:i,stage:"animate",direction:n}),setTimeout(()=>{r(i)},150),setTimeout(()=>{p({currentIndex:i,targetIndex:null,stage:null,direction:null})},300)})},g=()=>{!h&&m({targetIndex:(t+i.length-1)%i.length,direction:"previous"})},v=()=>{!h&&m({targetIndex:(t+1)%i.length,direction:"next"})};return(0,o.BX)("div",{ref:s,className:"outerContainer-_EB7WB",style:{height:l?(c-56)/C:c/k},children:[(0,o.tZ)("div",{className:"innerTrack-Kj4zL_",children:i.map((e,t)=>{let r=x({animationState:u,panelIndex:t,numPanels:i.length}),a=l?N({panelOffset:r,imageWidth:d}):P({panelOffset:r,containerWidth:c,imageWidth:d}),s="animate"===u.stage?"all ".concat(300,"ms ease"):"none";return(0,o.tZ)("a",{className:"panel-Y2mj7O",href:(0,w.uRy)(n,e,{noBase:!0}),style:{width:d,transform:"translateY(-50%) translateX(".concat(a.translate,"px) scale(").concat(a.scale,")"),display:a.display,transition:s,opacity:a.opacity},onClick:e=>{0!==r&&(e.preventDefault(),e.stopPropagation(),1===r?v():g())},children:(0,o.tZ)(Z.P,{className:"videoPostImage-dwXmpQ",disableVideoHover:!0,disableVideoHoverFade:!0,imageAspectRatio:16/9,imageWidth:1e3,isBelowTheFold:!1,post:e,videoPlayIconVariant:"red-circle"})},e.id)})}),(0,o.tZ)("div",{className:"previousBackground-l9aBt9",onClick:g,children:(0,o.tZ)(f.Z,{color:"white",size:l?18:32,strokeWidth:1.5})}),(0,o.tZ)("div",{className:"nextBackground-_36RTD",onClick:v,children:(0,o.tZ)(b.Z,{color:"white",size:l?18:32,strokeWidth:1.5})})]})},x=e=>{let{animationState:t,panelIndex:i,numPanels:n}=e,{currentIndex:r,targetIndex:o,stage:a,direction:l}=t,s=I({from:"animate"===a?null!=o?o:0:r,to:i,size:n});return null===a?[-1,0,1].includes(s)?s:null:[-1,0,1].includes(s)?s:"prepare"===a?"next"===l?2:-2:"next"===l?-2:2},I=e=>{let{from:t,to:i,size:n}=e,r=(i-t+n)%n;return r>n/2&&(r-=n),r},P=e=>{let{panelOffset:t,containerWidth:i,imageWidth:n}=e;return null===t?{translate:0,scale:0,display:"none",opacity:0}:{translate:.5*i-.5*n+t*(.5*n+.3*n+24),scale:0===t?1:.6,display:"block",opacity:0===t?1:.5}},N=e=>{let{panelOffset:t,imageWidth:i}=e;return null===t?{translate:0,scale:0,display:"none",opacity:0}:{translate:28+t*(i+14),scale:1,display:"block",opacity:0===t?1:.5}};var T=i(19081);let E={header:"header-MeQvZM",headerContents:"headerContents-XMY0rT"},X=e=>{var t,i;let{hasActiveLiveStream:n,posts:r,pub:l}=e,{isMobile:s,isDesktop:c}=(0,y.v9)(),[d,p]=(0,a.eJ)(0),h=69+(n&&!c?62:0),g=null==r?void 0:r[d],f=(null==g?void 0:g.section_id)&&null!==(i=null===(t=l.sections)||void 0===t?void 0:t.find(e=>e.id===g.section_id))&&void 0!==i?i:null;return(0,o.tZ)(m.C,{children:(0,o.tZ)("div",{className:E.header,style:{paddingTop:h,marginTop:-h},children:(0,o.tZ)(T.tu,{paddingY:s?40:64,children:(0,o.tZ)(u.x,{children:s?(0,o.BX)(T.tu,{children:[(0,o.tZ)(T.tu,{paddingBottom:20,children:(0,o.tZ)(v.Z,{color:"white",preset:"h1-serif",children:"Video Series"})}),(0,o.tZ)(T.tu,{paddingBottom:36,children:(0,o.tZ)(B,{currentIndex:d,posts:r?r.slice(0,4):[],pub:l,setCurrentIndex:p})}),(0,o.tZ)(T.tu,{children:g&&(0,o.tZ)(L,{post:g,pub:l,section:f})})]}):(0,o.BX)(T.tu,{gap:16,children:[(0,o.tZ)(v.Z,{color:"white",preset:"h1-serif",children:"Videos"}),(0,o.BX)("div",{className:E.headerContents,children:[(0,o.tZ)(T.tu,{children:g&&(0,o.tZ)(L,{post:g,pub:l,section:f})}),(0,o.tZ)(B,{currentIndex:d,posts:r?r.slice(0,4):[],pub:l,setCurrentIndex:p})]})]})})})})})},L=e=>{let{post:t,pub:i,section:n}=e,r=(0,w.uRy)(i,t,{noBase:!0});return(0,o.BX)(T.tu,{gap:16,children:[(0,o.BX)(T.tu,{gap:12,children:[n?(0,o.tZ)(v.Z,{as:"a",href:(0,w.Ucy)(i,{section:n}),preset:"d2-serif",children:n.name}):(0,o.tZ)(v.Z,{preset:"d2-serif",children:"\xa0"}),(0,o.BX)(T.tu,{borderBottom:"detail",borderTop:"detail",gap:12,paddingBottom:16,paddingTop:12,children:[(0,o.tZ)(v.Z,{as:"a",clamp:2,href:r,preset:"h5-serif",children:t.title}),(0,o.tZ)(v.Z,{clamp:3,preset:"d3-serif",children:t.description})]})]}),(0,o.tZ)(T.gq,{justifyContent:"start",children:(0,o.tZ)(g._,{href:r,trailingIcon:"chevron-right",variant:"tertiary",children:"Watch Now"})})]})};var F=i(20888),R=i(94778),M=i(61254),U=i(47929);let A={sectionImage:"sectionImage-OVlQ8l",sectionTitle:"sectionTitle-Aad7Bm",sectionContainer:"sectionContainer-g1nief"},D=e=>{let{pub:t,user:i}=e,{initialSections:n}=(0,R.c)({pub:t});return(0,o.tZ)(T.tu,{gap:24,children:n.map((e,n)=>(0,o.BX)(o.HY,{children:[0!==n&&(0,o.tZ)(M.iz,{}),(0,o.tZ)(O,{pub:t,section:e,user:i})]}))})},O=e=>{let{pub:t,section:i,user:n}=e,{isMobile:r}=(0,y.v9)(),a=(0,w.Ucy)(t,{section:i}),l=(0,w.W1P)(t,{addBase:!0,user:n,params:{next:document.location.href,utm_medium:U.lP.web,utm_source:U.b3.videosPage}});return(0,o.BX)(T.gq,{className:A.sectionContainer,gap:r?24:40,children:[i.logo_url&&(0,o.tZ)(T.tu,{as:"a",flex:"auto",href:a,children:(0,o.tZ)(F.e,{className:A.sectionImage,maxWidth:300,src:i.logo_url})}),(0,o.BX)(T.tu,{gap:8*!r,overflow:"hidden",children:[(0,o.tZ)(v.Z,{as:"a",clamp:1,className:A.sectionTitle,href:a,preset:"h5-serif",children:i.name}),(0,o.tZ)(T.tu,{flex:r?void 0:"grow",paddingBottom:r?16:8,children:(0,o.tZ)(v.Z,{as:"a",clamp:3,href:a,preset:"d3-serif",children:i.description})}),!(null==n?void 0:n.is_subscribed)&&(0,o.BX)(T.gq,{gap:8,children:[(0,o.tZ)(v.Z,{preset:"sm-preview-byline",children:"Free with Ads"}),(0,o.tZ)(v.Z,{as:"a",color:"accent",href:l,preset:"sm-preview-byline",children:"Listen Ad-Free"})]})]})]})};var z=i(64900),j=i(68648);let H=e=>{var t;let{activeLiveStream:i,pub:l,user:m,videoPageData:g}=e,{isMobile:v}=(0,y.v9)(),{activeLiveStream:f}=(0,z.H)({pub:l,preloadedLiveStream:i}),[b,_]=(0,a.eJ)(!1),[Z,w]=(0,a.eJ)((null!==(t=null==g?void 0:g.recentPosts.length)&&void 0!==t?t:0)<7),[k,C]=(0,a.eJ)("latest"),[S,B]=(0,a.eJ)(null!=g?g:null),x=null!=S?S:g,{recentPosts:I}=null!=x?x:{};(0,a.d4)(()=>{let e=async()=>{let e=await s().get("/videos/data");return e.body.recentPosts.length<7&&w(!0),e.body};g||e().then(B)},[g]);let P=async()=>{var e;_(!0);let{body:t}=await s().get("/videos/data").query({offset:null!==(e=null==I?void 0:I.length)&&void 0!==e?e:0,limit:7});B(e=>(0,r._)((0,n._)({},e),{recentPosts:[...e?e.recentPosts:[],...t.recentPosts]})),t.recentPosts.length<7&&w(!0),_(!1)};return(0,o.tZ)(j.hV,{pub:l,children:(0,o.tZ)(c.h,{children:(0,o.BX)(T.tu,{children:[(0,o.tZ)(X,{hasActiveLiveStream:!!f,posts:null!=I?I:null,pub:l}),(0,o.tZ)(u.x,{children:(0,o.tZ)("div",{className:"bodyContents-ivBy3X",children:(0,o.BX)(T.tu,{gap:40,paddingY:40,children:[(0,o.BX)(T.gq,{justifyContent:"center",position:"relative",children:[(0,o.tZ)(h.w,{activeTabId:k,tabs:[{title:"Latest Videos",id:"latest"},{title:"All Series",id:"series"}],onClick:C}),"series"===k&&!v&&(0,o.tZ)(T.gq,{position:"absolute",style:{right:0,top:0},children:(0,o.tZ)(d.r,{pub:l,sectionType:"video",user:null!=m?m:null})})]}),"latest"===k&&I&&(0,o.tZ)(p.I,{isLoading:b,noMorePosts:Z,posts:I,onLoadMore:P}),"series"===k&&(0,o.tZ)(D,{pub:l,user:m})]})})})]})})})}},42400:function(e,t,i){i.d(t,{S:()=>k});var n=i(16584),r=i(39693),o=i.n(r),a=i(24350),l=i.n(a),s=i(84967),c=i(98661),d=i(44846),u=i(18582),p=i(74626),h=i(1455),m=i(79344),g=i(7523),v=i(1056),f=i(12900),b=i(19081),_=i(60308),y=i(71891);let Z="letters@thefp.com",w="tips@thefp.com",k=e=>{let{pub:t,user:i}=e,{ids:r}=(0,v.d)({pub:t}),a=l()(t.authorPagesInfo,"user_id"),[k,C]=(0,c.useState)(!0),[S,B]=(0,c.useState)(!0),x=e=>{var i;let r=a[e];return r?{title:(0,n.BX)(b.gq,{alignItems:"center",justifyContent:"space-between",position:"relative",children:[(0,n.tZ)(g.Z,{preset:"h5-serif",children:r.name}),!!r.primary_section_id&&(0,n.tZ)(m.F,{authorId:r.user_id,className:y.Z.titleNotifyButton})]}),imageUrl:r.photo_url,description:r.bio,url:null!==(i=(0,_.rfk)({userId:r.user_id,pub:t}))&&void 0!==i?i:""}:null},I=o()(r.filter(e=>{var t;return!!(null===(t=a[e])||void 0===t?void 0:t.primary_section_id)}).map(x)),P=o()(r.filter(e=>{var t;return!(null===(t=a[e])||void 0===t?void 0:t.primary_section_id)}).map(x)),N=I.length>0;return(0,n.tZ)(u.q,{actions:(0,n.tZ)(d.r,{pub:t,sectionType:"who-we-are",user:null!=i?i:null}),description:(0,n.BX)(n.HY,{children:["If you have a letter to the editor, commenting on one of our stories, write to"," ",(0,n.tZ)("a",{href:"mailto:".concat(Z),rel:"noopener noreferrer",target:"_blank",children:Z}),".",(0,n.tZ)("br",{}),"To share a tip about story going on in your neighborhood or institution, write to"," ",(0,n.tZ)("a",{href:"mailto:".concat(w),rel:"noopener noreferrer",target:"_blank",children:w}),"."]}),hideDivider:N,title:"Who We Are",children:(0,n.BX)(b.tu,{gap:40,children:[N&&(0,n.BX)(n.HY,{children:[(0,n.BX)(b.tu,{gap:8,children:[(0,n.BX)(b.gq,{alignItems:"center",justifyContent:"space-between",children:[(0,n.tZ)(g.Z,{preset:"h4-sans-condensed",children:"Columnists"}),(0,n.tZ)(p._,{variant:"accordion",onClick:()=>{C(!k)},children:(0,n.tZ)(s.Z,{className:"".concat(y.Z.caret," ").concat(k?"":y.Z.collapsed),height:36,width:36})})]}),(0,n.tZ)("div",{className:y.Z.thickRule})]}),(0,n.tZ)(f.H,{expanded:k,children:(0,n.tZ)(h.x,{applyHoverOnTitle:!1,hasMarkdownDescriptions:!0,items:I,justifyViewAllLabel:"start",showDescriptionOnMobile:!0,viewAllLabel:"Read more"})}),(0,n.BX)(b.tu,{gap:8,children:[(0,n.BX)(b.gq,{alignItems:"center",justifyContent:"space-between",children:[(0,n.tZ)(g.Z,{preset:"h4-sans-condensed",children:"Staff Writers and Editors"}),(0,n.tZ)(p._,{variant:"accordion",onClick:()=>{B(!S)},children:(0,n.tZ)(s.Z,{className:"".concat(y.Z.caret," ").concat(S?"":y.Z.collapsed),height:36,width:36})})]}),(0,n.tZ)("div",{className:y.Z.thickRule})]})]}),(0,n.tZ)(f.H,{expanded:S,children:(0,n.tZ)(h.x,{applyHoverOnTitle:!1,hasMarkdownDescriptions:!0,items:P,justifyViewAllLabel:"start",showDescriptionOnMobile:!0,viewAllLabel:"Read more"})})]})})}},87810:function(e,t,i){i.d(t,{l:()=>d});var n=i(30396),r=i(14952),o=i(60807),a=i(7882),l=i(60308),s=i(47929);let c=e=>!!(null==e?void 0:e.subscription_id)||!!(null==e?void 0:e.is_free_subscribed),d=e=>{var t;let[i,d]=(0,n.eJ)(!1),[u,p]=(0,n.eJ)(!1),[h,m]=(0,n.eJ)(!0),[g,v]=(0,n.eJ)(!1),f=(0,r.Ij)(),b=(0,o.aF)(),_=null!==(t=null==f?void 0:f.authorPagesInfo)&&void 0!==t?t:[],y=null==_?void 0:_.find(t=>t.user_id===e),Z=(null==y?void 0:y.primary_section_id)===0?void 0:null==y?void 0:y.primary_section_id,w=c(b),{result:k,refetch:C}=(0,a.ib)({pathname:"/api/v1/subscription",auto:!1}),{refetch:S}=(0,a.ib)({pathname:"/api/v1/subscription/sections/email",auto:!1,method:"PATCH",cacheTtl:6e4});(0,n.d4)(()=>{(async()=>{m(!0);try{v(!!Z);let t=await C(),i=new URLSearchParams(window.location.search),n="true"===i.get("follow");if(i.has("follow")){i.delete("follow");let e=i.toString()?"".concat(window.location.pathname,"?").concat(i.toString()):window.location.pathname;window.history.replaceState({},"",e)}if(n&&Z&&w&&!(t instanceof Error)){var e;(null==t?void 0:null===(e=t.email_settings)||void 0===e?void 0:e[Z])!=="individual"&&(await S({json:{[Z]:{setting:"individual"}}}),d(!0))}}finally{m(!1)}})()},[e,f]),(0,n.d4)(()=>{p(w)},[w]),(0,n.d4)(()=>{(null==k?void 0:k.email_settings)&&Z&&(d("individual"===k.email_settings[Z]),p(w))},[k,Z,w]);let B=async()=>{if(!Z)return;if(!w&&f){var e;let t=null===(e=f.sections.find(e=>e.id===Z))||void 0===e?void 0:e.slug,i=(0,l.W1P)(f,{addBase:!0,sectionSlug:t,next:(0,l.n1t)(window.location.href,{follow:!0}),utm_source:s.b3.followAuthorCta,utm_medium:s.lP.web});window.location.href=i;return}let t=!i;await S({json:{[Z]:{setting:t?"individual":"disabled"}}}),d(t)};return{isSubscribedToAuthor:i,isSubscribedToPub:u,isLoading:h,hasSection:g,toggleSubscription:B,sectionId:Z}}},49995:function(e,t,i){i.d(t,{ZP:()=>v,g1:()=>h});var n=i(16584),r=i(6400),o=i(30396),a=i(68833),l=i(48980),s=i(62981),c=i(98012),d=i(84864);let u=function(e){let{timeout:t=5e3,className:i="",dismissable:o=!1,beforeDismiss:a=null}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=arguments.length>2?arguments[2]:void 0;l=l||document.body;let s=document.createElement("div");s.setAttribute("id","toast"),s.setAttribute("role","alert"),i&&s.classList.add(i),l.appendChild(s);let c=()=>{a&&a(),s.classList.remove("in"),setTimeout(()=>{s.remove()},500)};(0,r.render)([(0,n.tZ)("p",{children:e}),o&&(0,n.tZ)("a",{className:"dismiss",onClick:c,children:"Dismiss"})],s),setTimeout(()=>{s.classList.add("in")}),o||setTimeout(c,t)},p=e=>{let{children:t,className:i,dismissKey:n,dismissDurationInSeconds:r,beforeDismiss:o,container:a}=e,[l,c]=(0,s.Z)(n,r,o);if(!l)return u(t,{className:i,beforeDismiss:c,dismissable:!0},a)},h=e=>{let{user:t,pub:i,container:r}=e;return t&&i&&t.is_subscribed?(0,n.tZ)(g,{pub:i,container:r}):null},m=e=>{if(e&&e.cardExpiresAt){let t=(0,c.Z)(e.expiry).subtract(d.GRACE_PERIOD_DAYS,"day"),i=(0,c.Z)(e.cardExpiresAt),n=(0,c.Z)().add(12,"day");return i.isBefore(t)&&t.isBefore(n)}return!1},g=e=>{let{pub:t,container:i}=e,[r,s]=(0,o.eJ)(null);return((0,o.d4)(()=>{(0,l.rd)("/api/v1/subscription").then(e=>s(e)).catch(e=>{console.error("Failed to fetch subscription data: ",e)})},[]),m(r))?(0,n.BX)(p,{className:"urgent",dismissKey:"card-expiring-toast.dismissed",dismissDurationInSeconds:+d.WEEK_IN_SECONDS,beforeDismiss:()=>{(0,a.j)(a.FP.CARD_EXPIRED_WARNING_DISMISSED,{type:"toast"})},container:i,children:["Your credit card is expiring soon."," ",(0,n.tZ)("a",{href:"/account/billing",native:!0,onClick:()=>{(0,a.j)(a.FP.UPDATE_EXPIRED_CARD_LINK_CLICKED,{type:"toast"})},children:"Update your card"})," before you lose access to ".concat(t.name),"."]}):null},v=u},12281:function(e,t,i){i.d(t,{L:()=>B,Z:()=>S});var n=i(27412),r=i(7409),o=i(99282),a=i(16584),l=i(6400),s=i(94184),c=i.n(s),d=i(55877),u=i(1055),p=i(30372),h=i(68833),m=i(49762),g=i(59176),v=i(98914),f=i(71068),b=i(15771),_=i(18618),y=i(60308),Z=i(69332),w=i(84864),k=i(67312);let C={hls:"application/x-mpegURL",mp4:"video/mp4"};class S extends l.Component{componentDidMount(){this._initHlsjs(),null===v.sz||void 0===v.sz||v.sz.on("play",this.onGlobalPlay),"undefined"!=typeof window&&(document.addEventListener("keydown",this.onGlobalKeyDown,!1),window.addEventListener("beforeunload",this.onBeforeUnload,!1)),this.player&&(this.player.volume=1,this.player.addEventListener("loadedmetadata",this.onLoadedMetadata),this.player.addEventListener("loadeddata",this.onLoadedData),this.player.addEventListener("canplay",this.onCanPlay),this.player.addEventListener("play",this.onPlay),this.player.addEventListener("pause",this.onPause),this.player.addEventListener("ended",this.onEnded),this.player.addEventListener("timeupdate",this.onTimeUpdate),this.player.addEventListener("waiting",this.onWaiting),this.player.addEventListener("playing",this.onPlaying),this.player.addEventListener("contextmenu",this.onContextMenu),this.player.addEventListener("click",this.onUserInteraction),this.player.addEventListener("mouseover",this.onUserInteraction),this.player.addEventListener("mousedown",this.onUserInteraction),this.player.addEventListener("touchstart",this.onUserInteraction),this.player.addEventListener("seeked",this.onSeeked)),this.onTimeUpdate(),window&&window._preloads.mux_env_key&&i.e("5590").then(i.t.bind(i,54125,23)).then(e=>{let t=e.default||e;t.monitor(this.player,{Hls:this.hlsModule,hlsjs:this.hls,debug:!1,data:{env_key:window._preloads.mux_env_key,player_name:"substack",player_init_time:t.utils.now()}})})}componentWillUnmount(){this.setPlaybackRestoreLocation(),this.lastTimeUpdate=null,null===v.sz||void 0===v.sz||v.sz.off("play",this.onGlobalPlay),"undefined"!=typeof window&&(document.removeEventListener("keydown",this.onGlobalKeyDown,!1),window.removeEventListener("beforeunload",this.onBeforeUnload,!1)),this.player&&(this.player.removeEventListener("loadedmetadata",this.onLoadedMetadata),this.player.removeEventListener("loadeddata",this.onLoadedData),this.player.removeEventListener("canplay",this.onCanPlay),this.player.removeEventListener("play",this.onPlay),this.player.removeEventListener("pause",this.onPause),this.player.removeEventListener("ended",this.onEnded),this.player.removeEventListener("timeupdate",this.onTimeUpdate),this.player.removeEventListener("waiting",this.onWaiting),this.player.removeEventListener("playing",this.onPlaying),this.player.removeEventListener("contextmenu",this.onContextMenu),this.player.removeEventListener("click",this.onUserInteraction),this.player.removeEventListener("mouseover",this.onUserInteraction),this.player.removeEventListener("mousedown",this.onUserInteraction),this.player.removeEventListener("touchstart",this.onUserInteraction)),this.onVideoReachEnd({resetTime:!1,triggerCallback:!1,track:!1}),null!=this.hls&&this.hls.destroy()}componentDidUpdate(e,t){var i,n,o;if((this.props.noPreview!==e.noPreview||this.props.noControls!==e.noControls||this.props.noKeyboardShortcuts!==e.noKeyboardShortcuts||this.props.mediaUpload.id!==e.mediaUpload.id)&&(this._initHlsjs(),this.resetDurationTracking()),!this.state.playing&&"number"==typeof this.state.waiting&&"number"!=typeof t.waiting){let{useHLSJS:e,browserCanPlayHLS:t,HLSerrored:i}=this.state;this.track(h.FP.VIDEO_BUFFERING_STARTED,{use_hlsjs:e,browser_can_play_hls:t,hls_errored:i})}if(!this.state.playing||t.playing||this.state.waiting||"number"!=typeof t.waiting||this.track(h.FP.VIDEO_BUFFERING_COMPLETED,{buffering_duration:Date.now()-t.waiting}),this.state.playing&&!(null===(i=this.player)||void 0===i?void 0:i.ended)&&Math.floor(this.state.currentTime)!==Math.floor(t.currentTime)&&Math.floor(this.state.currentTime)%5==0&&(this.trackMedia(h.FP.MEDIA_PLAYBACK_CONTINUED),this.props.mediaUpload.post_id&&this.state.duration&&(!this.props.surface||"post"===this.props.surface)&&(!this.props.videoType||"post"===this.props.videoType)&&!this.props.isClip)){let e=Math.min(Math.max(0,this.state.currentTime/this.state.duration),1);(0,p.UO)(this.props.mediaUpload.post_id,"video",e)}if(!this.state.playing&&t.playing&&(null===(n=this.player)||void 0===n?void 0:n.ended)&&this.trackMedia(h.FP.MEDIA_PLAYBACK_COMPLETED),this.props.mediaUpload.id&&(0,m.default)("use_preloaded_player_sources")&&(this.props.mediaUpload.id!==e.mediaUpload.id||!(null===(o=Object.keys(this.state.sources))||void 0===o?void 0:o.length))){let e=async e=>fetch((0,y.rhs)("/api/v1/video/upload/".concat(this.props.mediaUpload.id,"/src.json"),{type:e})).then(e=>e.json()).then(t=>({[e]:t.src}));Promise.all(["hls"].map(t=>e(t))).then(e=>{let t=e.reduce((e,t)=>(0,r._)({},e,t),{});this.setState({sources:t})})}}getPlaybackLocationKey(){return"".concat("video:playback_location:").concat(this.props.mediaUpload.id)}getPlaybackRestoreLocation(){if(this.playbackEnabled()&&this.props.restorePlaybackLocation&&this.props.mediaUpload.duration&&this.props.mediaUpload.duration>240){let e=(0,g.mM)(this.getPlaybackLocationKey());if((null==e?void 0:e.currentTime)>5&&null!==this.props.duration&&void 0!==this.props.duration&&this.props.duration-e.currentTime>60){let t=3*(Date.now()-e.watchedAt>60),i=Math.max(0,e.currentTime-t);if(i)return i}}return null}setPlaybackRestoreLocation(){var e;this.playbackEnabled()&&(null===(e=this.player)||void 0===e?void 0:e.currentTime)&&(0,g.ex)(this.getPlaybackLocationKey(),{currentTime:this.player.currentTime,watchedAt:Date.now()})}onPreviewClick(e){var t,i;this.props.stopPropagation&&(e.preventDefault(),e.stopPropagation()),!(this.state.previewHidden||this.href())&&this.playbackEnabled()&&(this.state.attemptingToPlay?(this.lastTimeUpdate=null,this.setState({attemptingToPlay:!1,autoPlay:!1}),null===(t=this.player)||void 0===t||t.pause(),this.previewHiddingTimeout&&clearTimeout(this.previewHiddingTimeout)):(this.setState({attemptingToPlay:!0}),null===(i=this.player)||void 0===i||i.play(),this.previewHiddingTimeout=window.setTimeout(()=>this.setState({previewHidden:!0}),3e3)))}track(e){var t,i,n,r;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=this.props.communityPostEmbedPostId||this.props.mediaUpload.post_id,l=this.props.mediaUpload.user_id;(0,h.j)(e,Object.assign({post_id:a,video_user_id:l,community_post_id:this.props.communityPostId,media_upload_id:this.props.mediaUpload.id,live_stream_id:this.props.liveStreamId,current_time:this.state.currentTime?Math.floor(this.state.currentTime):0,duration:this.state.duration?Math.floor(this.state.duration):0,is_clip:null!==(i=this.props.isClip)&&void 0!==i&&i,surface:this.props.surface,is_preview:null!==(n=this.props.usePreview)&&void 0!==n&&n,muted:null!==(r=null===(t=this.player)||void 0===t?void 0:t.muted)&&void 0!==r&&r,video_type:this.props.videoType,display:(0,v.rm)()?"fullscreen":document.pictureInPictureElement?"pip":"inline"},o))}trackMedia(e){var t,i,n,a,l,s,c,d;let u,p,m=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{mediaUpload:g,videoType:f,communityPostId:b,surface:_,entityKey:y,entityType:Z,primaryEntityKey:w,primaryEntityType:k,contentType:C,feedItemTrackingParameters:S}=this.props,B=null!=C?C:f?null!==(n=({communityCommentReply:"communityComment","video-embed":"embed"})[f])&&void 0!==n?n:f:"unknown";y?(u=y,p=Z):b?(u=b,p="community_post"):g.post_id?(u=String(g.post_id),p="post"):(u=y,p=Z);let x=Array.from(null!==(a=null===(t=this.player)||void 0===t?void 0:t.textTracks)&&void 0!==a?a:[]),I=x.length>0,P=this.isShowingCaptionsElsewhere||x.some(e=>["subtitles","captions"].includes(e.kind)&&"showing"===e.mode);(0,h.j)(e,(0,r._)((0,o._)((0,r._)({},S),{media_type:"video",video_upload_id:g.id,src_video_upload_id:g.src_media_upload_id,content_type:B,primary_entity_key:String(null!=w?w:u),primary_entity_type:null!=k?k:p,entity_key:String(u),entity_type:p,publication_id:g.publication_id,surface:_,display:(0,v.rm)()?"fullscreen":document.pictureInPictureElement?"pip":"inline",muted:null!==(l=null===(i=this.player)||void 0===i?void 0:i.muted)&&void 0!==l&&l,captions_enabled:I?P:null,autoplay:this.state.autoPlay&&!this.state.failedAutoplay,is_preview:null!==(s=this.props.usePreview)&&void 0!==s&&s,current_time:Math.floor(null!==(c=this.state.currentTime)&&void 0!==c?c:0),duration:Math.floor(null!==(d=this.state.duration)&&void 0!==d?d:0),duration_played:Math.floor(this.state.durationPlayed),duration_played_id:this.state.durationPlayedId}),m))}render(e,t){let{height:i,width:n}=(0,w.videoPlayerDimensions)(e.mediaUpload,{isStatic:!1}),r=c()("video-player",{"video-player-clip":e.isClipping,"video-player-with-background":!e.omitBackgroundColor},e.videoPlayerClassName);return(0,a.tZ)(x,{className:c()(e.className,{"with-preview":!t.previewHidden,"full-width":n>=960,"video-player-wrapper-clip":e.isClipping,"video-player-with-background":!e.omitBackgroundColor}),linkClassName:r,href:this.href(),width:n,height:i,onClick:this.onPreviewClick,style:e.style,children:this.renderPlayer(this.props,this.state)})}renderPlayer(e,t){let{hidePlayButton:i,mediaUpload:n,noControls:r,noPreview:o,renderPlayButton:s,startMuted:c,videoClassName:d,liveStreamId:p,loop:h,thumbnailUrl:g}=e,{autoPlay:f,attemptingToPlay:Z,previewHidden:w,showControls:k,useHLSJS:S,browserCanPlayHLS:B,HLSerrored:x,failedAutoplay:N}=t,T=!o&&!w,E=!this.playbackEnabled(),X=this.getBaseVideoSrc(),L=[];L=p?["hls"]:B?["hls","mp4"]:S?[]:(0,v.Dt)()?["hls","mp4"]:x?["mp4"]:["hls","mp4"];let F=(0,v.K1)(),R=!!(0,m.default)("use_preloaded_player_sources")&&F,M=f&&!N&&this.playbackEnabled(),U=g||"".concat((0,y.ow1)(n),"?refresh=").concat(n.updated_at);return[this.playbackEnabled()&&"undefined"!=typeof window&&(0,a.tZ)("video",{ref:this.assignPlayer,controls:k&&!r&&!T,controlsList:"nodownload",autoPlay:M,poster:U,muted:c,loop:h,className:d,playsInline:F,crossOrigin:"anonymous",children:R?Object.entries(this.state.sources).map((e,t)=>{let[i,n]=e;return(0,a.tZ)("source",{src:n,type:C[i],onError:t===Object.keys(this.state.sources).length-1?this.onAllSourcesFailed:void 0},"".concat(i,"_").concat(t))}):L.map((e,t)=>(0,a.tZ)("source",{src:(0,y.rhs)(X,{type:e}),type:C[e],onError:t===L.length-1?this.onAllSourcesFailed:void 0},"".concat(e,"_").concat(t)))}),T&&!i&&(0,a.BX)(l.Fragment,{children:[E&&(0,a.tZ)(I,{mediaUpload:n,thumbnailUrl:U}),!s&&(0,a.tZ)(P,{children:this.cta()?(0,a.tZ)(b._L,{href:this.href(),loading:Z&&this.playbackEnabled(),"aria-label":"play",leading:(0,a.tZ)(u.Z,{height:16,width:16,style:{stroke:"none",fill:"white"}}),children:this.cta()}):(0,a.tZ)(_.fI,{isPlaying:!1,href:this.href(),size:72,loading:Z&&this.playbackEnabled()})}),s&&(0,a.tZ)(P,{children:s()})]})]}_initHlsjs(){let e=!!(this.player&&this.player.canPlayType("application/vnd.apple.mpegurl"));if(e&&!(0,v.Dt)()){this.setState({browserCanPlayHLS:e});return}i.e("4754").then(i.t.bind(i,67631,23)).then(e=>{this._initHlsjsWrapped(e.default)})}_initHlsjsWrapped(e){let t=this,i=e.isSupported();if(!e.isSupported()){this.setState({useHLSJS:i});return}null!=this.hls&&this.hls.destroy();let n=new e((0,r._)({enableWorker:!1},{}));null!=this.player&&n.attachMedia(this.player);let o=this.getBaseVideoSrc("hls");n.on(e.Events.MEDIA_ATTACHED,()=>{n.loadSource(o),n.on(e.Events.MANIFEST_PARSED,()=>{if(this.state.autoPlay&&this.player){var e;this.player.muted=null!==(e=this.props.startMuted)&&void 0!==e&&e,this.player.play().catch(e=>{console.error("Unable to autoplay prior to user interaction with the dom.",e),this.setState({failedAutoplay:!0,attemptingToPlay:!1}),this.player&&(this.player.muted=!0,this.player.play().then(()=>{var e,t;null===(e=(t=this.props).onAutoplayMuted)||void 0===e||e.call(t)}).catch(e=>{console.error("Unable to autoplay prior to user interaction with the dom when muted.",e),this.setState({failedAutoplay:!0,attemptingToPlay:!1})}))})}})}),n.on(e.Events.ERROR,function(i,r){if(r.fatal)switch(r.type){case e.ErrorTypes.NETWORK_ERROR:var o;t.setState({useHLSJS:!1}),null===(o=t.hls)||void 0===o||o.destroy(),n.startLoad();break;case e.ErrorTypes.MEDIA_ERROR:n.recoverMediaError();break;default:this._initHlsjs()}}),this.hls=n,this.hlsModule=e}constructor(e,t){var i,a;super(e,t),i=this,(0,n._)(this,"player",null),(0,n._)(this,"previewHiddingTimeout",null),(0,n._)(this,"lastTimeUpdate",null),(0,n._)(this,"_accumulatedDurationPlayed",0),(0,n._)(this,"containerRef",(0,l.createRef)()),(0,n._)(this,"isShowingCaptionsElsewhere",!1),(0,n._)(this,"assignPlayer",e=>{this.player=e}),(0,n._)(this,"resetDurationTracking",()=>{this.lastTimeUpdate=null,this.setState({durationPlayed:0,durationPlayedId:(0,d.v4)()})}),(0,n._)(this,"onLoadedMetadata",()=>{this.state.playbackRestoreLocation&&(this.player&&(this.player.currentTime=this.state.playbackRestoreLocation),this.previewHiddingTimeout=window.setTimeout(()=>this.setState({playbackRestoreLocation:null,previewHidden:!0}),3e3))}),(0,n._)(this,"onLoadedData",()=>{this.state.playbackRestoreLocation&&(this.previewHiddingTimeout&&clearTimeout(this.previewHiddingTimeout),this.setState({playbackRestoreLocation:null,previewHidden:!0}))}),(0,n._)(this,"onCanPlay",()=>{this.onTimeUpdate()}),(0,n._)(this,"onPlay",()=>{null===v.sz||void 0===v.sz||v.sz.emit("play",this),this.setState({playing:!0}),this.lastTimeUpdate=Date.now(),this.trackMedia(h.FP.MEDIA_PLAYBACK_STARTED)}),(0,n._)(this,"onPause",()=>{var e;this.setPlaybackRestoreLocation(),this.lastTimeUpdate=null,this.setState({playing:!1,waiting:!1,previewHidden:!this.props.showPreviewWhenPaused&&this.state.previewHidden}),(null===(e=this.player)||void 0===e?void 0:e.ended)||this.trackMedia(h.FP.MEDIA_PLAYBACK_PAUSED),this.player&&this.player.currentTime>this.player.duration-.1&&this.onVideoReachEnd()}),(0,n._)(this,"onEnded",()=>{this.lastTimeUpdate=null,this.setState({playing:!1,waiting:!1,previewHidden:!this.props.showPreviewWhenPaused&&this.state.previewHidden}),this.trackMedia(h.FP.MEDIA_PLAYBACK_PAUSED),this.onVideoReachEnd()}),(0,n._)(this,"onTimeUpdate",()=>{if(!this.player||!isFinite(this.player.duration))return;let e=this.player.currentTime,t=Date.now();if(this.state.playing&&null!==this.lastTimeUpdate){let e=(t-this.lastTimeUpdate)/1e3;e>0&&e<1&&(this._accumulatedDurationPlayed=(this._accumulatedDurationPlayed||0)+e,this._accumulatedDurationPlayed>=1&&(this.setState(e=>({durationPlayed:e.durationPlayed+this._accumulatedDurationPlayed})),this._accumulatedDurationPlayed=0))}this.lastTimeUpdate=t,(this.props.duration||this.state.duration===this.player.duration)&&this.state.currentTime===e?this.setState({waiting:!1}):this.setState({duration:this.props.duration||this.player.duration,currentTime:e,waiting:!1})}),(0,n._)(this,"onWaiting",()=>{this.lastTimeUpdate=null,this.setState({waiting:Date.now()})}),(0,n._)(this,"onPlaying",()=>{this.previewHiddingTimeout&&clearTimeout(this.previewHiddingTimeout),this.lastTimeUpdate=Date.now(),this.setState({playing:!0,waiting:!1,previewHidden:!0,attemptingToPlay:!1,autoPlay:!1,hasPlayed:!0})}),(0,n._)(this,"onSeeked",()=>{this.lastTimeUpdate=Date.now(),this.trackMedia(h.FP.MEDIA_SEEKED)}),(0,n._)(this,"onVideoReachEnd",function(){let{resetTime:e=!0,triggerCallback:t=!0,track:n=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i.lastTimeUpdate=null,i.player&&!i.player.paused&&i.player.pause(),i.state.previewHidden&&i.setState({previewHidden:!1,attemptingToPlay:!1,hasReachedEnd:!0}),e&&i.player&&!(0,v.L)()&&!i.props.doNotResetOnEnd&&(i.player.currentTime=0),(0,v.Qg)(),(0,v.Yk)(),i.props.onFinishVideo&&t&&i.props.onFinishVideo(),n&&i.trackMedia(h.FP.MEDIA_PLAYBACK_COMPLETED)}),(0,n._)(this,"onContextMenu",e=>{e.preventDefault()}),(0,n._)(this,"onUserInteraction",()=>{this.state.showControls||this.setState({showControls:!0})}),(0,n._)(this,"onAllSourcesFailed",()=>{var e,t;console.info("Failed to load all video sources, falling back to preview image"),this.setState((0,o._)((0,r._)({},this.props.liveStreamId?{}:{previewHidden:!1,attemptingToPlay:!1,autoPlay:!1}),{allSourcesFailed:!0})),null===(e=(t=this.props).onPlaybackFailed)||void 0===e||e.call(t)}),(0,n._)(this,"onBeforeUnload",()=>{this.setPlaybackRestoreLocation(),this.state.previewHidden&&this.setState({previewHidden:!1,attemptingToPlay:!1}),this.player&&!this.player.paused&&this.player.pause()}),(0,n._)(this,"onGlobalPlay",e=>{this!==e&&this.player&&!this.player.paused&&this.player.pause()}),(0,n._)(this,"onGlobalKeyDown",e=>{var t;!this.props.noKeyboardShortcuts&&!e.metaKey&&!e.altKey&&!e.ctrlKey&&document.activeElement===document.body&&this.player&&(!((null!==(t=null===v.sz||void 0===v.sz?void 0:v.sz.listenerCount("play"))&&void 0!==t?t:0)>1)||!this.player.paused)&&("f"===e.key?(0,v.rm)()?(0,v.Qg)()&&e.preventDefault():((0,v.bt)(this.player)&&e.preventDefault(),this.player.paused&&this.player.play()):" "!==e.key||(0,v.rm)()?"ArrowRight"===e.key?this.player.currentTime+5>this.player.duration?this.onVideoReachEnd():(this.player.currentTime+=5,this.state.previewHidden||this.setState({previewHidden:!0,attemptingToPlay:!1})):"ArrowLeft"===e.key&&(this.player.currentTime-=5):(e.preventDefault(),this.player.paused?this.player.play():this.player.pause()))}),(0,n._)(this,"getBaseVideoSrc",e=>{var t;let i={token:this.props.reaction_token,override_publication_id:null===(t=this.props.pub)||void 0===t?void 0:t.id,preview:this.props.usePreview};return e&&(i.type=e),(0,y.rhs)("/api/v1/video/upload/".concat(this.props.mediaUpload.id,"/src"),i)}),(0,n._)(this,"hls",null),(0,n._)(this,"hlsModule",void 0),(0,n._)(this,"cta",()=>""),(0,n._)(this,"href",()=>this.props.href),(0,n._)(this,"playbackEnabled",()=>!0);let s="undefined"!=typeof window?(0,Z.m)(window.location.href):{},c=null;s.timestamp?c=parseInt(s.timestamp):s.t&&(c=parseInt(s.t));let u=null!==c&&!isNaN(c);u||(0,v.iO)("timestamp");let p=u?c:this.getPlaybackRestoreLocation();this.state={playbackRestoreLocation:p,currentTime:0,waiting:!0,duration:null!==(a=e.mediaUpload.duration)&&void 0!==a?a:null,autoPlay:e.autoPlay,playing:!1,attemptingToPlay:e.autoPlay,previewHidden:null!==p&&p>0,showControls:!1,hasPlayed:!1,hasReachedEnd:!1,browserCanPlayHLS:!1,useHLSJS:!0,HLSerrored:!1,allSourcesFailed:!1,failedAutoplay:!1,sources:{},durationPlayed:0,durationPlayedId:(0,d.v4)()},this.onPreviewClick=this.onPreviewClick.bind(this)}}function B(e){let{className:t,mediaUpload:i,href:n}=e;return(0,a.tZ)(x,(0,o._)((0,r._)({},(0,w.videoPlayerDimensions)(i,{isStatic:!0})),{className:c()(t,"video-player-with-background","is-static"),linkClassName:"video-player-with-background",href:n,children:(0,a.tZ)(I,{mediaUpload:i,testId:"video-player-static-preview-image",isStatic:!0})}))}function x(e){let{className:t,linkClassName:i,width:n,height:r,href:o,onClick:l,children:s,style:d}=e,u={paddingBottom:"".concat(Math.min(60,100*r/n).toFixed(4),"%")};return(0,a.tZ)("div",{className:c()(t,"video-player-wrapper",n>=960&&"full-width"),onClick:l,role:"region","aria-label":"Video player",style:d,children:(0,a.tZ)(o?"a":"div",{className:c()("video-player",i),href:o,style:u,children:s})})}function I(e){let{mediaUpload:t,thumbnailUrl:i,testId:n,isStatic:r}=e;return(0,a.tZ)("img",{className:"video-player-preview",width:550,src:i||(0,y.kOB)(t,{isStatic:r}),"data-component-name":"VideoPlayer-PreviewImg","data-testid":n})}let P=(0,f.zo)({position:"absolute",className:c()(k.Z.buttonContainer,"video-player-button")})},98585:function(e,t,i){i.d(t,{Dr:()=>d,Ml:()=>p});var n=i(16584),r=i(6400),o=i(30396),a=i(42441),l=i.n(a),s=i(7882),c=i(74312);function d(){return(0,o.qp)(u)}let u=(0,r.createContext)({open:()=>void 0});function p(e){var t,r;let{children:a,load:d,useLocalNavigation:p}=e,[h,m]=(0,o.eJ)(!1),[g,v]=(0,o.eJ)(!1),f=null!==(r=null===(t=(0,s.ib)({pathname:"/api/v1/search/suggestions",auto:g,deps:[g]}).result)||void 0===t?void 0:t.suggestedSearches)&&void 0!==r?r:[];(0,o.d4)(()=>{if(!d)return;let e=e=>{e.preventDefault(),m(!0),v(!0)};return l().bind(["/","command+k"],e),()=>{l().unbind(["/",e]),l().unbind(["command+k",e])}},[d]);let b=(0,o.Ye)(()=>({open:()=>{d&&(m(!0),v(!0))}}),[d]);return d?(0,n.BX)(u.Provider,{value:b,children:[a,(0,n.tZ)(c.cr,{module:"@/frontend/substack/GlobalSearch",resolve:e=>e.GlobalSearch,onRequest:()=>Promise.all([i.e("546"),i.e("8842"),i.e("6546")]).then(i.bind(i,58857)),isOpen:h,onClose:()=>m(!1),useLocalNavigation:p,suggestedSearches:f})]}):(0,n.tZ)(n.HY,{children:a})}},15597:function(e,t,i){i.d(t,{$:()=>d,s:()=>u});var n=i(7409),r=i(16584),o=i(6400),a=i(98661),l=i(47851);let s={},c=(0,o.createContext)({open:()=>void 0});function d(e){let{children:t}=e,[i,o]=(0,a.useState)(s),d=(0,a.useRef)(null),u=(0,a.useMemo)(()=>({open:e=>{o(e),setTimeout(()=>{var e;null===(e=d.current)||void 0===e||e.open()},0)}}),[]);return(0,r.BX)(c.Provider,{value:u,children:[t,(0,r.tZ)(l.Z,(0,n._)({ref:d},i))]})}function u(){return(0,a.useContext)(c)}},19548:function(e,t,i){i.d(t,{CH:()=>b,KG:()=>v,Yq:()=>Z,fQ:()=>y,gc:()=>f});var n=i(7409),r=i(99282),o=i(16584),a=i(6400),l=i(30396),s=i(10844),c=i(88812),d=i(60807),u=i(48980);i(7882);var p=i(98914),h=i(36500),m=i(70379);let g=(0,a.createContext)({result:{mutes:[],blocks:[],blocked:[]},refetch:async()=>null,isBlockingUser:()=>!1,isMutedByUser:()=>!1,isBlockedByUser:()=>!1});function v(e){let{isBlockingUser:t,isBlockedByUser:i}=(0,l.qp)(g);return e?i(e)?"blocking":t(e)?"blocked":null:null}function f(e){let{isBlockingUser:t,isBlockedByUser:i,isMutedByUser:n}=(0,l.qp)(g);return e?n(e)?"muting":i(e)?"blocking":t(e)?"blocked":null:null}function b(e,t){let{surface:i,noteId:a,onClick:v}=t,b=(0,d.aF)(),_=!!(b&&e&&b.id!==e.id),y=(0,l.qp)(g),Z=f(null==e?void 0:e.id),w=(0,m.pm)(),k=async()=>{if(e){try{await (0,u.rd)("/api/v1/blocks/".concat(e.id),{method:"POST",json:{type:"mute",surface:i,noteId:a}})}catch(e){w.popToast(t=>(0,o.tZ)(m.FN,(0,r._)((0,n._)({},t),{text:(0,p.zx)(e)})));return}y.refetch(),w.popToast(t=>(0,o.tZ)(m.FN,(0,r._)((0,n._)({},t),{text:"".concat(e.name||"User"," muted"),Icon:s.Z}))),null==v||v("mute")}},C=async()=>{if(e){try{await (0,u.rd)("/api/v1/blocks/".concat(e.id),{method:"DELETE",query:{surface:i,noteId:a}})}catch(e){w.popToast(t=>(0,o.tZ)(m.FN,(0,r._)((0,n._)({},t),{text:(0,p.zx)(e)})));return}y.refetch(),w.popToast(t=>(0,o.tZ)(m.FN,(0,r._)((0,n._)({},t),{text:"".concat(e.name||"User"," unmuted"),Icon:s.Z}))),null==v||v("unmute")}},S=async()=>{if(e){try{await (0,u.rd)("/api/v1/blocks/".concat(e.id),{method:"POST",json:{type:"block",surface:i,noteId:a}})}catch(e){w.popToast(t=>(0,o.tZ)(m.FN,(0,r._)((0,n._)({},t),{text:(0,p.zx)(e)})));return}y.refetch(),w.popToast(t=>(0,o.tZ)(m.FN,(0,r._)((0,n._)({},t),{text:"".concat(e.name||"User"," blocked"),Icon:c.Z}))),null==v||v("block")}},B=async()=>{if(e){try{await (0,u.rd)("/api/v1/blocks/".concat(e.id),{method:"DELETE",query:{surface:i,noteId:a}})}catch(e){w.popToast(t=>(0,o.tZ)(m.FN,(0,r._)((0,n._)({},t),{text:(0,p.zx)(e)})));return}y.refetch(),w.popToast(t=>(0,o.tZ)(m.FN,(0,r._)((0,n._)({},t),{text:"".concat(e.name||"User"," unblocked"),Icon:c.Z}))),null==v||v("unblock")}},x=[];return _&&("blocking"!==Z&&x.push((0,o.tZ)(h.sN,{leading:(0,o.tZ)(s.Z,{}),priority:"destructive",onClick:"muting"===Z?C:k,children:"muting"===Z?"Unmute":"Mute"})),x.push((0,o.tZ)(h.sN,{leading:(0,o.tZ)(c.Z,{}),priority:"destructive",onClick:"blocking"===Z?B:S,children:"blocking"===Z?"Unblock":"Block"}))),x}g.displayName="UserBlockContext";let _=(0,a.createContext)(!1);function y(e){let{muteFree:t=!0,children:i}=e;return(0,o.tZ)(_.Provider,{value:t,children:i})}function Z(){return(0,l.qp)(_)}_.displayName="MuteFreeZone"},75778:function(e,t,i){i.d(t,{LC:()=>s,uL:()=>l});var n=i(16584),r=i(6400),o=i(30396);let a=(0,r.createContext)(null);function l(e){let{crossPost:t=null,children:i}=e;return(0,n.tZ)(a.Provider,{value:t,children:i})}function s(){return(0,o.qp)(a)}a.displayName="CrossPostContext"},62718:function(e,t,i){i.d(t,{J:()=>C});var n=i(7409),r=i(99282),o=i(98848),a=i(16584),l=i(98661),s=i(30396),c=i(94184),d=i.n(c);i(39693);var u=i(23279),p=i.n(u);i(44908),i(80569);var h=i(16564),m=i(86657);i(72508),i(95441);var g=i(24763);i(38242),i(57952),i(96904),i(53030);var v=i(68833);i(98914);var f=i(57649),b=i(1864),_=i(44989);(0,l.forwardRef)((e,t)=>{let{id:i,items:r,getItemHeight:o,renderItem:l,containerHeight:c,containerWidth:d,itemData:u,measurementProps:p,innerElementType:h,onScroll:m}=e,[g,v]=(0,s.eJ)(null),_=(0,s.sO)(null);(0,s.d4)(()=>{if(g||!d||o)return;let e=document.createElement("div");e.classList.add("hidden-sizing-element"),e.style.position="absolute",e.style.top="0",e.style.width="".concat(d,"px"),e.style.pointerEvents="none",e.style.visibility="hidden",v(e),document.body.appendChild(e)},[d,g,_]);let Z=(0,s.I4)(e=>g?(g.innerHTML=(0,f.Dq)(l({index:e,data:(0,n._)({},u,p)})),g.clientHeight||0):0,[g,u,p,l]);return g||o?(0,a.tZ)("div",{id:i,children:(0,a.tZ)(b.S_,{ref:t,itemCount:r.length,itemSize:null!=o?o:Z,height:c,width:d,innerRef:_,itemData:u,innerElementType:h,outerElementType:y,onScroll:m,children:l})}):(0,a.tZ)(a.HY,{})});let y=(0,l.forwardRef)((e,t)=>{var{style:i}=e,l=(0,o._)(e,["style"]);return(0,a.tZ)("div",(0,r._)((0,n._)({ref:t,style:i},l),{className:_.Z.listOuter}))});i(71068),i(15771),i(19081);var Z=i(58175);i(51776),i(70379),i(87077),i(17564);var w=i(60308);i(84864),i(93370);var k=i(22233);p()((e,t,i,n)=>{e.current.resetAfterIndex(t,!0),i(n)}),(0,l.forwardRef)((e,t)=>{var i;let{pub:o,audioUpload:l,onTimeUpdate:s,captions:c}=e;return l?(0,a.tZ)(m.Z,{ref:t,feature:h.MR.Podcast,pub:o,src:(0,w.rhs)("/api/v1/audio/upload/".concat(null==l?void 0:l.id,"/src")),duration:null==l?void 0:l.duration,onTimeUpdate:s,mediaUpload:l,trackingProps:{surface:"editor",contentType:"post",entityKey:null!==(i=null==l?void 0:l.post_id)&&void 0!==i?i:"unknown",entityType:"post"},render:e=>(0,a.tZ)(g.Z,(0,r._)((0,n._)({},e),{togglePlayback:()=>{var i,n,r;t&&"current"in t&&(null===(i=t.current)||void 0===i?void 0:i.player)&&(null===(n=t.current)||void 0===n?void 0:n.player.paused)?(0,v.j)(v.FP.TRANSCRIPTION_PLAY_BUTTON_CLICKED):t&&"current"in t&&(null===(r=t.current)||void 0===r?void 0:r.player)&&(0,v.j)(v.FP.TRANSCRIPTION_PAUSE_BUTTON_CLICKED),e.togglePlayback()}})),captions:c}):null});let C=e=>{let{searchTerm:t,rowIndex:i,isFocused:n,text:r}=e,o=RegExp("(".concat(t,")"),"gi"),l=r.split(o);return(0,a.tZ)(Z.xv.B3,{padding:2,color:"primary","data-chunk-index":i,className:k.Z.text,children:l.map(e=>{var t;return e.match(o)?(0,a.tZ)("span",{className:d()(k.Z.searchResult,{[null!==(t=k.Z.isFocused)&&void 0!==t?t:"undefined"]:n}),children:e}):e})})};(0,l.forwardRef)((e,t)=>{var i,l,{style:s}=e,c=(0,o._)(e,["style"]);return(0,a.tZ)("div",(0,n._)({ref:t,style:(0,r._)((0,n._)({},s),{height:"".concat(parseFloat(null!==(l=null===(i=s.height)||void 0===i?void 0:i.toString())&&void 0!==l?l:"0")+140,"px")})},c))})},57952:function(e,t,i){i.d(t,{Rq:()=>C,_F:()=>w,pH:()=>k});var n=i(16584),r=i(6400),o=i(30396),a=i(23279),l=i.n(a),s=i(24840),c=i(71375),d=i(84967),u=i(49336),p=i(5772),h=i(95441);i(4796);var m=i(68833),g=i(98422),v=i(15771);i(61254);var f=i(19081);i(84747),i(73857);var b=i(58175),_=i(98905);i(98012),i(61468),i(84864);var y=i(22233);let Z=(0,r.createContext)({isSearching:!1,items:[],setIsSearching:()=>void 0,setItems:()=>void 0,focusedItemStart:null,setFocusedItemStart:()=>void 0,filteredItems:[],searchTerm:null,setSearchTerm:()=>void 0,hasFiltered:!1}),w=e=>{let{children:t}=e,[i,r]=(0,o.eJ)(!1),[a,l]=(0,o.eJ)([]),[s,c]=(0,o.eJ)(null),[d,u]=(0,o.eJ)(null),{filteredItems:h,setQuery:m,hasFiltered:g}=(0,p.R)({items:a,getKeys:e=>[e.text],sortFunc:(e,t)=>e.start-t.start});return(0,o.d4)(()=>{var e,t;c(null!==(t=null===(e=h[0])||void 0===e?void 0:e.start)&&void 0!==t?t:null)},[h]),(0,n.tZ)(Z.Provider,{value:{isSearching:i,setIsSearching:r,items:a,setItems:l,focusedItemStart:s,setFocusedItemStart:c,filteredItems:h,hasFiltered:g,searchTerm:d,setSearchTerm:e=>{u(e),m(e)}},children:t})},k=()=>(0,o.qp)(Z),C=e=>{let{postId:t,closeAlwaysVisible:i=!0}=e,{iString:r}=(0,h.M1)(),{isMobile:a}=(0,g.v9)(),p=(0,o.sO)(null),{setSearchTerm:Z,setIsSearching:w,hasFiltered:C,filteredItems:S,setFocusedItemStart:B,focusedItemStart:x,searchTerm:I}=k();(0,o.d4)(()=>{!I&&p.current&&(p.current.value="")},[I]);let P=S.findIndex(e=>e.start===x),N=()=>{let e=P+1>=S.length?0:P+1;B(S[e].start)},T=()=>{Z(""),w(!1),(0,m.j)(m.FP.TRANSCRIPTION_SEARCH_CANCELLED,{post_id:t})};return(0,n.BX)(f.gq,{gap:8,justifyContent:"space-between",alignItems:"center",className:y.Z.searchForm,children:[(0,n.tZ)(_.K,{ref:p,leftIcon:(0,n.tZ)(f.gq,{children:(0,n.tZ)(s.Z,{size:16})}),rightIcon:(0,n.tZ)(f.gq,{cursor:"pointer",onClick:T,children:I||i?(0,n.tZ)(c.Z,{size:16}):null}),placeholder:r("Search"),onChange:l()(e=>{Z(e.target.value),(0,m.j)(m.FP.TRANSCRIPTION_SEARCHED,{post_id:t})},100),onKeyDown:e=>{"Enter"===e.key&&N(),"Escape"===e.key&&T()}}),C&&(0,n.tZ)(f.gq,{gap:8,paddingRight:8*!!a,children:(0,n.BX)(f.gq,{alignItems:"center",gap:8,children:[(0,n.tZ)(b.xv.B4,{paddingLeft:a?4:16,className:y.Z.resultsValue,color:"primary",weight:"semibold",children:"".concat(P+1," / ").concat(S.length)}),(0,n.BX)(f.gq,{children:[(0,n.tZ)(v.hU,{priority:"tertiary",size:"sm",onClick:()=>{let e=P-1<0?S.length-1:P-1;B(S[e].start)},children:(0,n.tZ)(d.Z,{size:20})}),(0,n.tZ)(v.hU,{priority:"tertiary",size:"sm",onClick:N,children:(0,n.tZ)(u.Z,{size:20})})]})]})})]})}},38242:function(e,t,i){i(16584),i(19081)},92291:function(e,t,i){i.d(t,{Gn:()=>R,Mk:()=>U,kN:()=>O,kW:()=>D,yd:()=>F});var n=i(7409),r=i(16584),o=i(3880),a=i(24202),l=i(20888),s=i(42375),c=i(27966),d=i(77906),u=i(72572),p=i(25827),h=i(58998),m=i(98170),g=i(60225),v=i(71576),f=i(86301),b=i(73544),_=i(68710),y=i(60735),Z=i(37663),w=i(25642),k=i(69181),C=i(93252),S=i(19081),B=i(33451),x=i(15503),I=i(18618),P=i(76820),N=i(23854),T=i(42886),E=i(60308),X=i(63651),L=i(5749);function F(e){let{parent:t,item:i,attachments:n,readOnly:o,isDm:l,isRestack:c,isPermalink:d,isComposing:u,onQuoteThemeChange:p,onAttachmentClick:h,onSavePostClick:m,utm_content:g}=e,v=(0,s.rI)();if(0===n.length)return null;let f=n.filter(e=>"image"===e.type),b=n.filter(e=>"video"===e.type),_=n.filter(e=>"image"!==e.type&&"video"!==e.type);return(0,r.BX)(r.HY,{children:[f.length>0&&(0,r.tZ)(a.sp,{parent:t,readOnly:o||(0,C.P)(),assets:f.map(e=>O(e)),onClick:h,onSwipe:()=>{i&&(0,x.a2)(i,v)},isRestack:c,isPermalink:d,isDm:l}),b.map(e=>{var n;return(0,r.tZ)(P.Jl,{mediaUpload:e.mediaUpload,composing:null!=u&&u,videoPlayerProps:{surface:(0,Z.T)(v),entityType:"comment",entityKey:null!==(n=null==t?void 0:t.id)&&void 0!==n?n:"unknown",contentType:"comment",feedItemTrackingParameters:null==i?void 0:i.trackingParameters}},e.mediaUpload.id)}),_.map(e=>(0,r.tZ)(U,{parent:t,attachment:e,readOnly:o,isDm:l,isRestack:c,isPermalink:d,isComposing:u,onAttachmentClick:h,onSavePostClick:m,onQuoteThemeChange:p,utm_content:g,compactIfPossible:f.length>0||b.length>0||_.length>1,item:null!=i?i:void 0}))]})}function R(e){let{attachments:t}=e;if(0===t.length)return null;let i=t.filter(e=>"image"===e.type),n=t.filter(e=>"video"===e.type);return(0,r.BX)(r.HY,{children:[i.length>0&&(0,r.tZ)(o.i,{assets:i.map(e=>O(e))}),n.map(e=>(0,r.tZ)(M,{mediaUpload:e.mediaUpload}))]})}function M(e){let{mediaUpload:t}=e,i=(0,E.kOB)(t);return(0,r.BX)(S.hs,{width:72,height:72,radius:"md",overflow:"hidden",sizing:"border-box",border:"detail",position:"relative",alignItems:"center",justifyContent:"center",flex:"auto",children:[(0,r.tZ)(l.e,{src:i,maxWidth:72,useRetinaSizing:!0,imageIsFixedWidth:!0,imageProps:{height:72,smartCrop:!0},className:L.Z.videoThumbnailImage}),(0,r.tZ)(I.fI,{isPlaying:!1,size:40})]})}function U(e){var t,i,o,a,l,C;let{parent:S,attachment:x,readOnly:I,isRestack:E,isDm:X,isPermalink:L,isComposing:F,onAttachmentClick:R,onSavePostClick:M,onQuoteThemeChange:U,utm_content:D,compactIfPossible:O,item:z}=e,j=(0,s.rI)();if((0,N.bP)(x))return(0,r.tZ)(h.h,{attachment:x,readOnly:I,isRestack:E,onAttachmentClick:R,utm_content:D});if("live_stream"===x.type)return(0,r.tZ)(p.W,{activeLiveStream:x.active_live_stream,onAttachmentClick:R,maxWidth:P.PJ,videoPlayerProps:{surface:(0,Z.T)(j),entityType:"comment",entityKey:null!==(t=null==S?void 0:S.id)&&void 0!==t?t:"unknown",contentType:"comment",feedItemTrackingParameters:null==z?void 0:z.trackingParameters}});if("link"===x.type){let{linkMetadata:e}=x,t=(0,B.P9)(e.url),i=(0,B.A7)(e.url);if(t)return(0,r.tZ)(y.n,{videoId:t});if(i)return(0,r.tZ)(_.D,{videoId:i});let o=(0,b.R)(e.url);if(o)return(0,r.tZ)(b.n,{embedType:o.embedType,resourceId:o.resourceId});let a=(0,c.j)(e.url);if(a)return(0,r.tZ)(c.g,{country:a.country,type:a.type,id:a.id});let l=(0,f.N)(e.url);return l?(0,r.tZ)(f.J,{url:l.url,type:l.type}):(0,r.tZ)(u.N,(0,n._)({readOnly:I,onClick:R},x.linkMetadata))}if("comment"===x.type)return(0,r.tZ)(d.UK,{parent:S,readOnly:I,publication:null!==(i=x.publication)&&void 0!==i?i:void 0,comment:x.comment,onAttachmentClick:R,utm_content:D,isDm:X,isPermalink:L});if("post"===x.type&&x.postSelection)return(0,r.tZ)(w.Kk,{readOnly:I,attachment:x,onClick:R,onSavePostClick:M,onThemeChange:U,isPermalink:L,isComposing:F,isRestack:E});if("post"===x.type&&x.postImageSelection)return(0,r.tZ)(v.w,{readOnly:I,onClick:R,onSavePostClick:M,attachment:x,utm_content:D});if("post"===x.type){let e=z&&(0,T.D2)(z,x)&&"post"===z.type?(null===(o=z.mediaClip)||void 0===o?void 0:o.clip_info)||(null===(a=x.mediaClip)||void 0===a?void 0:a.clip_info):(null===(l=x.mediaClip)||void 0===l?void 0:l.clip_info)||x.clipInfo,t=x.post.videoUpload;return e&&t?(0,r.tZ)(P.Jl,{tag:(0,r.tZ)(k.u0,{pub:x.publication,post:x.post,onViewEpisodeClick:R}),mediaUpload:t,composing:!1,videoPlayerProps:{surface:(0,Z.T)(j)}},x.id):(0,r.tZ)(m.tg,{clipInfo:e,readOnly:I,publication:x.publication,post:x.post,onClick:R,onSavePostClick:M,compact:O,item:z},x.id)}return"publication"===x.type?(0,r.tZ)(g.U,{publication:x.publication,readOnly:I,onClick:R}):"video"===x.type?(0,r.tZ)(P.Jl,{mediaUpload:x.mediaUpload,composing:!1,videoPlayerProps:{surface:(0,Z.T)(j),entityType:"comment",entityKey:null!==(C=null==S?void 0:S.id)&&void 0!==C?C:"unknown",contentType:"comment"}},x.mediaUpload.id):(0,r.tZ)(A,{attachment:x})}function A(e){let{}=e;return(0,r.tZ)(S.hs,{})}function D(e){switch(e.type){case"post":if(e.postSelection)return(0,X.uRy)(e.publication,e.post,{urlParams:{selection:e.postSelection.id}});return e.post.canonical_url;case"comment":return(0,X.Sgq)(e.comment);case"publication":return e.publication.base_url;case"link":var t;return null!==(t=e.linkMetadata.url)&&void 0!==t?t:null;default:return null}}function O(e){return{id:e.id,src:e.imageUrl,explicit:e.explicit,width:e.imageWidth,height:e.imageHeight}}},5952:function(e,t,i){i.d(t,{Bk:()=>M,WS:()=>E,bN:()=>X});var n=i(7409),r=i(99282),o=i(16584),a=i(30396),l=i(85685),s=i(95441),c=i(92291),d=i(77338),u=i(42375),p=i(93963),h=i(62903),m=i(25991),g=i(19619),v=i(85527),f=i(53678),b=i(16451),_=i(76721),y=i(68833),Z=i(80878),w=i(7882),k=i(98914),C=i(19081),S=i(58175),B=i(15503),x=i(27744),I=i(2009);i(33017);var P=i(31377),N=i(63651),T=i(5749);function E(e){var t,i,a,l,s;let{comment:d,item:f,isParent:_,showReplyingTo:S,showContext:T,utm_content:E,parentCommentUserId:L,hideable:F=!1}=e,M=(0,u.rI)(),U=(0,v.F)(),A=(0,x.de)(f),D=()=>(0,B.rw)(f,M,"profile",{tabId:U}),O=!d.ancestor_path,z=f.publication&&f.post&&(0,P.getPostAuthor)(f.publication,f.post),j=(0,w.ib)({pathname:"/api/v1/trending-topics/toggle",method:"POST"}),H=null;if(!O){let e=null===(t=d.ancestor_path)||void 0===t?void 0:t.split(".").pop(),n=e&&Number(e);H=null!==(a=null===(i=f.parentComments)||void 0===i?void 0:i.find(e=>(null==e?void 0:e.id)===n))&&void 0!==a?a:null}let W=S&&(O&&z||!O&&H),q=async()=>{var e,t,i,n,r;(0,B.rw)(f,M,"context",{tabId:U}),(0,y.j)(y.FP.SEE_MORE_NOTES_IN_CATEGORY_CLICKED,{tagId:null===(e=f.context.tag)||void 0===e?void 0:e.id,noteId:null===(t=f.comment)||void 0===t?void 0:t.id}),await j.refetch({method:"POST",json:{enable:!0,categoryID:null===(n=f.context)||void 0===n?void 0:null===(i=n.tag)||void 0===i?void 0:i.id}}),(0,k.uX)("/home/category/".concat(null===(r=f.context.tag)||void 0===r?void 0:r.id),{local_navigation:!1})},Y=(0,P.getCommentAuthor)(d),V=!_&&["comment_like","comment_restack"].includes(f.context.type);return(0,o.tZ)(b.oM,{showGutter:_,hasContext:T,onClick:e=>{if(!e.defaultPrevented&&!A){(0,B.rw)(f,M,"item",{tabId:U});let t="search"===M&&"undefined"!=typeof location?location.pathname:null,i=(0,N.Sgq)(d,{noBase:!d.hidden&&I.L,urlParams:{utmSource:t}});(0,Z.Q)(e,d.hidden&&f.publication?(0,N.W1P)(f.publication,{addBase:!0,params:{next:i}}):i,{newTab:!!d.hidden,native:d.hidden,state:{showBack:!0}})}},entityKey:f.entity_key,children:(0,o.BX)(g.n,{user:Y,item:f,comment:d,children:[T||V?(0,o.tZ)(h.L,{context:f.context,onClick:()=>(0,B.rw)(f,M,"context",{tabId:U}),utm_content:E}):null,f.context.tag?(0,o.tZ)(h.L,{context:(0,r._)((0,n._)({},f.context),{type:"topic"}),onClick:q,utm_content:E}):null,(0,o.BX)(C.gq,{gap:12,alignItems:"start",children:[(0,o.tZ)(b.Fb,{user:Y,onClick:D,utm_content:E}),(0,o.BX)(C.tu,{gap:8,flex:"grow",minWidth:0,children:[(0,o.BX)(C.tu,{gap:12,children:[(0,o.BX)(C.tu,{gap:4,children:[(0,o.tZ)(m.Ev,{author:Y,post:null!==(l=f.post)&&void 0!==l?l:void 0,comment:d,onClick:D,utm_content:E,publication:null!==(s=f.publication)&&void 0!==s?s:void 0,item:f,allowHide:F,parentCommentUserId:L}),W&&(0,o.tZ)(R,{isTopLevel:O,postAuthor:z,parentComment:H,item:f}),d.body&&(0,o.tZ)(X,{comment:d,item:f})]}),d.attachments&&(0,o.tZ)(c.yd,{parent:d,attachments:d.attachments,onAttachmentClick:function(){let{commentId:e,attachmentType:t,attachmentId:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,B.rw)(f,M,"attachment",{tabId:U,extraEventProps:{commentId:e,clicked_attachment_type:t,clicked_attachment_id:i}})},utm_content:E,item:f})]}),!d.hidden&&(0,o.tZ)(p.$w,{item:f,comment:d})]})]})]})})}function X(e){let{comment:t,item:i,large:n,paddingRight:r}=e,l=(0,u.rI)(),s=(0,v.F)(),{bodyJson:c,truncatedBodyJson:p,isTruncated:h,shouldExpandInline:m}=(0,_.Z)(t),[g,f]=(0,a.eJ)(!1),y=n||!h||g,Z=y?c:p;return(0,o.BX)(C.tu,{className:T.Z.feedCommentBody,paddingRight:r,children:[(0,o.tZ)(b.sP,{children:t.hidden&&i?(0,o.tZ)(L,{pub:null==i?void 0:i.publication}):Z&&(0,o.tZ)(d.x,{content:Z,onLinkClicked:()=>{i&&(0,B.rw)(i,l,"link",{tabId:s,extraEventProps:{commentId:t.id}})},attachedLinks:M(t)},y)}),!y&&(0,o.tZ)(F,{onClick:e=>{i&&(0,B.rw)(i,l,"see_more",{tabId:s,extraEventProps:{commentId:t.id}}),m?(e.preventDefault(),f(!0)):(0,k.uX)((0,N.Sgq)(t,{noBase:I.L,urlParams:{utmSource:"search"===l&&"undefined"!=typeof location?location.pathname:null}}),{event:e,state:{showBack:!0}})}})]})}function L(e){let{pub:t}=e;return(0,o.BX)(o.HY,{children:[(0,o.BX)("i",{children:["This comment is only visible to paid subscribers of ",null==t?void 0:t.name]}),(0,o.tZ)("br",{}),(0,o.tZ)("b",{children:"Subscribe to view →"})]})}function F(e){let{iString:t}=(0,s.M1)();return(0,o.BX)(C.hs,{className:T.Z.seeMore,children:[(0,o.tZ)(C.hs,{className:T.Z.seeMoreFade}),(0,o.tZ)(S.xv.B3,{color:"secondary",weight:"medium",className:T.Z.seeMoreText,children:(0,o.tZ)(f.hh,(0,r._)((0,n._)({},e),{children:t("See more")}))})]})}function R(e){var t;let{isTopLevel:i,postAuthor:n,parentComment:r,item:a}=e,s=i?n:r?{id:r.user_id,user_id:r.user_id,name:r.name,photo_url:r.photo_url}:n,c=i?(0,N.mx9)(a.publication,a.post,{noBase:I.L}):(0,N.Sgq)(r,{noBase:I.L}),d=(null===(t=i?n:r)||void 0===t?void 0:t.name)||"";return s?(0,o.BX)(S.xv.B5,{color:"secondary",translated:!0,children:["Replying to"," ",(0,o.tZ)(l.ProfileHoverCard,{subject:s,dontStopPropagation:!0,utmSource:"feed",children:(0,o.tZ)(f.hh,{href:c,children:I18N.p(d)})})]}):null}function M(e){return e.attachments?e.attachments.map(e=>"link"===e.type?e.linkMetadata.url:"post"===e.type?(0,N.uRy)(e.publication,e.post):"publication"===e.type?(0,N.SVA)(e.publication):"comment"===e.type?(0,N.Sgq)(e.comment):"").filter(Boolean):[]}},93963:function(e,t,i){i.d(t,{$w:()=>U,l8:()=>A});var n=i(7409),r=i(99282),o=i(98848),a=i(16584),l=i(98661),s=i(94184),c=i.n(s),d=i(21465),u=i(66289),p=i(53804),h=i(25226),m=i(95441),g=i(60807),v=i(42375),f=i(85527),b=i(68833),_=i(7882),y=i(98914),Z=i(15771),w=i(19081),k=i(36500),C=i(58175),S=i(15503),B=i(27744),x=i(21972),I=i(81043),P=i(75419),N=i(43681),T=i(39493),E=i(61412),X=i(42886),L=i(63651),F=i(84864),R=i(47929),M=i(54888);function U(e){var t,i;let{item:r,comment:o,disableRestack:l}=e,s=(0,v.rI)(),c=(0,f.F)(),d=(0,B.I0)(),u=(0,P.i3)(),p=(0,g.aF)(),{requireLogin:h}=(0,I.SJ)(),m=(0,_.ib)({pathname:"/api/v1/comment/".concat(o.id,"/reaction"),method:"POST"}),b=(0,P.oC)(r);if(!r)return null;let{publication:Z,post:w}=r,k=!!(w&&Z&&!(0,F.commentsEnabledForPost)({publication:Z,post:w})),C=l||!!(w&&Z&&!(0,F.restacksEnabledForPost)({publication:Z,post:w})),x=o.reaction_count||0,N=!!o.reaction,T=()=>{null==h||h()},E=async e=>{if(e.preventDefault(),!p){T();return}let t=!N;d({type:"comment_like",payload:{commentId:o.id,isLiked:t}});try{var i,a;await m.refetch({method:t?"POST":"DELETE",json:(0,n._)({publication_id:(null==Z?void 0:Z.id)||null,reaction:"❤",tabId:c},t&&"comment_restack"===r.context.type&&{restacking_user_id:null===(a=r.context.users)||void 0===a?void 0:null===(i=a[0])||void 0===i?void 0:i.id})})}catch(e){d({type:"comment_like",payload:{commentId:o.id,isLiked:!t}}),alert((0,y.zx)(e));return}(0,S.rw)(r,s,"like",{tabId:c})};return(0,a.BX)(D,{children:[(0,a.tZ)(O,{count:x,active:N,disabled:!1,onClick:E}),(0,a.tZ)(z,{count:null!==(t=o.children_count)&&void 0!==t?t:0,disabled:k,onClick:e=>{var t,i;if(e.preventDefault(),!p){T();return}u.open({feedItem:r,parentPubId:null!==(t=o.publication_id)&&void 0!==t?t:void 0,parentPostId:null!==(i=o.post_id)&&void 0!==i?i:void 0,parentCommentId:o.id,tabId:c,surface:s}),(0,S.rw)(r,s,"comment",{tabId:c,extraEventProps:{reply_requirement:b,reply_locked:!!b}})},replyRequirement:b}),p?(0,a.tZ)(W,{pub:null!=Z?Z:void 0,post:null!=w?w:void 0,comment:o,feedItem:r,disabled:C,onOpen:e=>(0,S.rw)(r,s,"restack",{tabId:c,extraEventProps:{isRestacked:e}}),surface:s}):(0,a.tZ)(j,{count:null!==(i=o.restacks)&&void 0!==i?i:0,disabled:C,onClick:T}),(0,a.tZ)(q,{publication:null!=Z?Z:void 0,post:null!=w?w:void 0,comment:o,item:r})]})}function A(e){var t,i,r;let{item:o,pub:l,post:s,onLike:c}=e,d=(0,v.rI)(),u=(0,f.F)(),p=(0,P.i3)(),h=(0,g.aF)(),{requireLogin:m}=(0,I.SJ)(),b=(0,x.B)(s.id,(0,n._)({tabId:u},(null==o?void 0:o.context.type)==="post_restack"&&{restacking_user_id:null===(i=o.context.users)||void 0===i?void 0:null===(t=i[0])||void 0===t?void 0:t.id})),_=(0,x.I)(s),y=!!s.reaction,Z=null!==(r=s.child_comment_count)&&void 0!==r?r:0,w=(0,P.oC)(o),k=!l.community_enabled,C=!(0,F.commentsEnabledForPost)({publication:l,post:s}),B=async e=>{if(e.preventDefault(),!h){null==m||m();return}let t=!s.reaction,i=o&&(0,X.D2)(o)&&"post"===o.type&&o.mediaClip?o.mediaClip:void 0;await b(s.id,t,null==i?void 0:i.id)&&(null==c||c(t),o&&(0,S.rw)(o,d,"like",{tabId:u}))},N=e=>{if(null==e||e.preventDefault(),!h){null==m||m();return}let t=o&&(0,X.D2)(o)&&"post"===o.type&&o.mediaClip?o.mediaClip:void 0;p.open((0,n._)({feedItem:o,parentPubId:s.publication_id,parentPostId:s.id,tabId:u,surface:d},t&&{parentMediaClipId:t.id})),o&&(0,S.rw)(o,d,"comment",{tabId:u})};return(0,E.B)({name:"post-comment",action:N}),(0,a.BX)(D,{children:[(0,a.tZ)(O,{count:_,active:y,disabled:k,onClick:B}),(0,a.tZ)(z,{count:Z,replyRequirement:w,onClick:N,disabled:C}),(0,a.tZ)(W,{disabled:k,pub:l,post:s,feedItem:o,surface:d}),(0,a.tZ)(q,{publication:l,post:s,item:o,twitterText:(0,F.resolveTwitterShareText)({pub:l,post:s})})]})}function D(e){let{children:t}=e;return(0,a.tZ)(w.hs,{flex:"grow",justifyContent:"start",gap:4,className:M.Z.ufiContainer,children:t})}function O(e){let{count:t,className:i,onClick:n,active:r,disabled:o}=e,[s,d]=(0,l.useState)(!1),{iString:u}=(0,m.M1)();return(0,a.tZ)(Y,{onClick:e=>{d(!0),null==n||n(e)},className:c()(i,M.Z.like,s&&M.Z.clickedOnce),count:t,active:r,disabled:o,"aria-label":u("like"),children:(0,a.tZ)(J,{isLiked:null!=r&&r})})}function z(e){let{count:t,className:i,onClick:n,active:r,disabled:o,replyRequirement:l}=e,{iString:s}=(0,m.M1)();return(0,a.tZ)(Y,{onClick:n,className:c()(i,M.Z.comment),count:t,active:r,disabled:o,tooltip:"paid_subscriber"===l?"Only paid subscribers can reply.":"free_subscriber"===l?"Only subscribers can reply.":void 0,"aria-label":s("Comment"),children:l?(0,a.tZ)(u.Z,{strokeWidth:1.5}):(0,a.tZ)(d.Z,{})})}let j=(0,l.forwardRef)((e,t)=>{let{count:i,className:n,onClick:r,active:o,disabled:s}=e,[d,u]=(0,l.useState)(!1),{iString:p}=(0,m.M1)();return(0,a.tZ)(Y,{onClick:e=>{u(!0),null==r||r(e)},className:c()(n,M.Z.restack,d&&M.Z.clickedOnce),"aria-label":p("Restack menu"),ref:t,count:i,active:o,disabled:s,children:(0,a.tZ)(K,{isRestacked:null!=o&&o})})}),H=(0,l.forwardRef)((e,t)=>{let{count:i,className:n,onClick:r,active:o,disabled:l}=e,{iString:s}=(0,m.M1)();return(0,a.tZ)(Y,{className:c()(n,M.Z.share),"aria-label":s("Share menu"),onClick:r,ref:t,count:i,active:o,disabled:l,children:(0,a.tZ)(h.Z,{})})});function W(e){let{pub:t,post:i,comment:n,feedItem:r,onOpen:o,disabled:l,surface:s}=e,c=(0,f.F)(),{canRestack:d,isRestacked:u,restacks:p,menuItems:h,nuxModal:m}=(0,T.K)({pub:t,post:i,comment:n,feedItem:r,tabId:c,surface:s});return d?(0,a.BX)(a.HY,{children:[m,(0,a.tZ)(k.v2,{trigger:(0,a.tZ)(j,{count:p,"aria-label":"menu",active:u,disabled:l}),onOpen:()=>null==o?void 0:o(u),children:h})]}):null}function q(e){let{publication:t,post:i,comment:n,item:r,twitterText:o}=e,l=(0,v.rI)(),s=(0,f.F)(),c=(0,g.aF)(),d=c?c.id.toString(36):void 0,u=r&&(0,X.D2)(r)&&"post"===r.type&&r.mediaClip?r.mediaClip:void 0,p=n?(0,L.Sgq)(n,{urlParams:{utm_source:R.b3.notesShareAction,r:d}}):i?(0,L.mx9)(t,i,{urlParams:{utm_source:R.b3.notesShareAction,r:d},mediaClip:u}):null,h=(0,N.wg)({variant:"menu",url:p,twitterText:o,onLinkClicked:e=>{(0,b.j)(b.FP.FEED_ITEM_SHARE_LINK_CLICKED,{type:e,shared_post_id:null==i?void 0:i.id,shared_comment_id:null==n?void 0:n.id})},comment:n});return(0,a.tZ)(k.v2,{trigger:(0,a.tZ)(H,{}),onOpen:()=>{r&&(0,S.rw)(r,l,"share",{tabId:s})},children:h})}let Y=(0,l.forwardRef)((e,t)=>{var i,s,{className:d,active:u,disabled:p,count:h,children:m}=e,g=(0,o._)(e,["className","active","disabled","count","children"]);let v=!h||0===h,f=(0,l.useRef)(null),[b,_]=(0,l.useState)(0);(0,l.useLayoutEffect)(()=>{f.current&&_(f.current.offsetWidth)},[h]);let y=h?8:7,k=4*!h,C=null!==(s=null===(i=f.current)||void 0===i?void 0:i.offsetWidth)&&void 0!==s?s:0,S=v?32:18+6*!!b+b+2*y;return(0,a.tZ)(w.hs,{className:M.Z.buttonContainer,style:{"--button-min-width":"".concat(32,"px"),"--button-icon-width":"".concat(18,"px"),"--button-gap":"".concat(6,"px"),"--button-inner-padding":"".concat(y,"px"),"--button-outer-padding":"".concat(k,"px"),"--button-label-width":"".concat(C,"px"),"--button-final-width":"".concat(S,"px")},children:(0,a.BX)(Z.kG,(0,r._)((0,n._)({className:c()(d,M.Z.button,u&&M.Z.active,v&&M.Z.zero),resetCss:!0,ref:t,disabled:p,userSelect:"none"},g),{children:[m,(0,a.tZ)(V,{count:h,hidden:v,ref:f})]}))})});function V(e){let{count:t,hidden:i,ref:n}=e;return(0,a.tZ)(C.xv.B4,{className:c()(M.Z.count,i&&M.Z.hidden),ref:n,children:t?(0,F.numberToRoughShortString)(Math.max(t,1),{plusSignifier:""}):""})}function J(e){let{isLiked:t}=e;return(0,a.BX)("div",{className:c()(M.Z.heartWrapper,M.Z.icon,t&&M.Z.isLiked),children:[(0,a.tZ)("svg",{className:M.Z.heart,viewBox:"0 0 20 20",children:(0,a.tZ)("path",{d:"M5.00002 2.54822C8.00003 2.09722 9.58337 4.93428 10 5.87387C10.4167 4.93428 12 2.09722 15 2.54822C18 2.99923 18.75 5.66154 18.75 7.05826C18.75 9.28572 18.1249 10.9821 16.2499 13.244C14.3749 15.506 10 18.3333 10 18.3333C10 18.3333 5.62498 15.506 3.74999 13.244C1.875 10.9821 1.25 9.28572 1.25 7.05826C1.25 5.66154 2 2.99923 5.00002 2.54822Z"})}),(0,a.tZ)("div",{className:M.Z.sparks,style:"--total-sparks: ".concat(8),children:Array(8).fill(0).map((e,t)=>(0,a.tZ)("div",{className:M.Z.spark,style:"--i: ".concat(t+1,";")}))})]})}function K(e){let{isRestacked:t}=e;return(0,a.tZ)(w.hs,{className:c()(M.Z.restackWrapper,M.Z.icon,t&&M.Z.isRestacked),children:(0,a.tZ)(p.Z,{className:M.Z.restackIcon})})}},81914:function(e,t,i){i.d(t,{Bm:()=>ee,O3:()=>k.O3,_Q:()=>er});var n=i(7409),r=i(99282),o=i(16584),a=i(98661),l=i(30396),s=i(94184),c=i.n(s),d=i(2647),u=i(20888),p=i(95441),h=i(40647),m=i(60807),g=i(5952),v=i(42375),f=i(98170),b=i(12337),_=i(12302),y=i(93963),Z=i(95128),w=i(31465),k=i(87447),C=i(73730),S=i(62903),B=i(25991),x=i(19619),I=i(85527),P=i(53678),N=i(16451),T=i(69181),E=i(62981),X=i(80878),L=i(98750),F=i(80026),R=i(17172),M=i(63474),U=i(45783),A=i(15503),D=i(27744),O=i(3021),z=i(2009),j=i(2017),H=i(81043),W=i(65575),q=i(91400),Y=i(76820),V=i(31377),J=i(42886),K=i(33884),G=i(63651),Q=i(47929),$=i(5749);let ee=(0,a.memo)(function(e){let{item:t,className:i,showLoginPrompt:n}=e,r=et[t.type];return r?(0,o.tZ)(r,{item:t,className:i,children:n&&(0,o.tZ)(er,{version:"login"})}):null}),et={post:function(e){let{item:t,className:i,children:n}=e,r=(0,v.rI)(),a=(0,l.qp)(I.q),{iString:s}=(0,p.M1)();return(0,o.BX)(k.rF,{item:t,className:i,ariaLabel:s("Post"),children:[n,(0,o.tZ)(eo,{item:t,context:(0,o.tZ)(S.L,{context:t.context,onClick:()=>(0,A.rw)(t,r,"context",{tabId:a}),utm_content:t.entity_key}),hideable:!0})]})},comment:function(e){var t,i;let{item:n,className:r,children:a}=e,{iString:s}=(0,p.M1)(),{publication:c,post:d,comment:u,parentComments:h}=n,m=c||d||!h||1===h.length?void 0:h[0],f=null!==(i=h&&h[h.length-1])&&void 0!==i?i:null,b=c&&d&&(0,V.getPostAuthor)(c,d),_="comment_restack"!==n.context.type&&"comment_like"!==n.context.type,y=(0,v.rI)(),Z=(0,l.qp)(I.q),w="comment_restack"===n.context.type||"comment_like"===n.context.type?"user/".concat(null===(t=n.context.users[0])||void 0===t?void 0:t.id):n.entity_key;return(0,o.tZ)(k.rF,{item:n,className:r,ariaLabel:s("Note"),children:(0,o.BX)(o.HY,{children:[a,(0,o.BX)(ea,{children:[_&&(0,o.tZ)(el,{author:b,rootFeedComment:m,parentComments:h,parentComment:f,item:n,utm_content:w,feedSurface:y,tabId:Z}),(0,o.tZ)(g.WS,{comment:u,item:n,showReplyingTo:!_,utm_content:w,hideable:!0})]})]})})},userSuggestions:function(e){let{item:t}=e,i=(0,q.XA)(),a=(0,l.sO)(null),s=(0,R.aZ)(a),{state:c,handleArrowClick:d}=(0,W.eK)(a,{scrollFullPage:!0}),u=(0,m.SE)(),p=(0,K.kM)();return(0,L.UM)(a,()=>{u.changeSetting("suggestions_feed_item_last_shown_at",new Date().toISOString())},{threshold:.2}),(0,o.tZ)(k.rF,{item:t,children:(0,o.BX)(F.tu,{paddingTop:16,children:[(0,o.BX)(F.hs,{alignItems:"center",justifyContent:"space-between",paddingLeft:{mobile:16,desktop:0},children:[(0,o.tZ)(F.xv.H4,{translated:!0,children:(0,o.tZ)(P.hh,{onClick:e=>(0,X.Q)(e,p),children:"Suggestions"})}),(0,o.tZ)(F.zx,{size:"sm",priority:"tertiary",onClick:e=>(0,X.Q)(e,p),children:"See all"})]}),(0,o.BX)(F.hs,{className:$.Z.peopleYouMayKnowContainer,alignItems:"center",flex:"grow",position:"relative",children:[(0,o.tZ)(F.hs,{flex:"grow",overflow:"hidden",children:(0,o.BX)(F.hs,(0,r._)((0,n._)({},s.props),{ref:a,className:$.Z.peopleYouMayKnow,alignItems:"center",gap:8,paddingX:{desktop:0,mobile:16},paddingBottom:16,paddingTop:12,children:[!1,t.userSuggestions.map(e=>(0,o.tZ)(O.E$,{feedUserSuggestion:e,surface:"feed"}))]}))}),!i&&(0,o.BX)(o.HY,{children:[(0,o.tZ)(U.rQ,{direction:"left",isVisible:c.showLeft,onClick:d(-1)}),(0,o.tZ)(U.rQ,{direction:"right",isVisible:c.showRight,onClick:d(1)})]})]})]})})},twitterConnect:function(e){let{item:t}=e,{getConfigFor:i}=(0,h.xR)();return i("twitter_connect_flows_enabled")?(0,o.tZ)(k.rF,{item:t,children:(0,o.tZ)(F.hs,{paddingY:20,children:(0,o.tZ)(O.rS,{})})}):null},facebookConnect:function(e){let{item:t}=e;return(0,o.tZ)(k.rF,{item:t,children:(0,o.tZ)(F.hs,{paddingY:20,children:(0,o.tZ)(O.KL,{})})})},inviteFriends:function(e){let{item:t}=e,[i]=(0,E.Z)(O.au);return i?null:(0,o.tZ)(k.rF,{item:t,children:(0,o.tZ)(F.hs,{paddingY:20,paddingX:20,children:(0,o.tZ)(O.Zx,{utmSource:"feed_item"})})})},featuredPublication:C.a,featuredCollection:w.e,chat:function(e){let{item:t}=e,{iString:i}=(0,p.M1)();return t.community_post.user&&(0,o.tZ)(k.rF,{item:t,ariaLabel:i("Chat"),children:(0,o.tZ)(b.O,{item:t,author:t.community_post.user})})},profileSearchResults:function(e){let{item:t}=e;return(0,o.tZ)(k.rF,{item:t,children:(0,o.tZ)(_.Z,{item:t})})},categoryLeaderboard:Z.w},ei=()=>{let{iString:e}=(0,p.M1)(),{requireLogin:t,onboardingModalRef:i}=(0,H.SJ)();return(0,o.BX)(o.HY,{children:[(0,o.tZ)(F.xv,{size:19,color:"primary",font:"display",fontWeight:"semibold",translated:!0,children:"Log in for more"}),(0,o.tZ)(F.xv,{color:"secondary",size:15,translated:!0,children:"Or create an account"}),(0,o.BX)(F.gq,{gap:8,paddingTop:8,children:[(0,o.tZ)(F.zx,{style:{width:"138px"},size:"sm",priority:"secondary-outline",onClick:()=>null==t?void 0:t(),children:e("Login")}),(0,o.tZ)(F.zx,{onClick:()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.open()},style:{width:"138px"},size:"sm",priority:"primary",children:e("Create account")})]})]})},en=e=>{let{onDismiss:t}=e,{iString:i}=(0,p.M1)();return(0,o.BX)(F.tu,{alignItems:"center",gap:16,paddingY:16,paddingX:24,paddingTop:32,children:[(0,o.tZ)(F.hs,{width:48,paddingY:4,radius:"md",border:"detail",alignItems:"center",justifyContent:"center",bg:"primary",children:(0,o.tZ)(u.e,{src:"https://substack.com/img/substack.png",maxWidth:40,useRetinaSizing:!0,imageIsFixedWidth:!0})}),(0,o.tZ)(F.xv.B2,{size:17,textAlign:"center",font:"display",fontWeight:"semibold",translated:!0,children:"Get every post and note from creators you love with the Substack app."}),(0,o.BX)(F.tu,{style:{width:"100%"},padding:16,gap:8,children:[(0,o.tZ)(F.zx,{size:"md",priority:"primary",onClick:t,href:(0,G.h4i)({tab:"notes",redirect:"app-store",utm_source:Q.b3.menu}),newTab:!0,children:i("Switch to the app")}),(0,o.tZ)(F.zx,{onClick:t,size:"md",priority:"secondary",children:i("Maybe later")})]})]})},er=e=>{let{onDismiss:t,version:i,asParent:n}=e,r=(0,q.XA)();return(0,o.BX)(F.tu,{borderTop:n?"detail":"transparent",gap:8,justifyContent:"center",alignItems:"center",className:c()($.Z.transparentLoginPrompt,"app"===i&&$.Z.appPrompt,n&&$.Z.asParent),minHeight:r?400:void 0,onClick:e=>{e.preventDefault(),e.stopPropagation()},children:["login"===i&&(0,o.tZ)(ei,{}),"app"===i&&(0,o.tZ)(en,{onDismiss:t})]})};function eo(e){var t,i;let{item:n,showGutter:r,context:a,hideable:s=!1}=e,{publication:c,post:d}=n,u=c&&d?(0,V.getPostAuthor)(c,d):void 0,p=(0,v.rI)(),h=(0,l.qp)(I.q),m=(0,D.de)(n),g=()=>(0,A.rw)(n,p,"profile",{tabId:h}),b="post"===n.type&&n.mediaClip?n.mediaClip.clip_info:null;return c&&d&&u?(0,o.tZ)(N.oM,{onClick:e=>{e.defaultPrevented||m||((0,A.rw)(n,p,"item",{tabId:h}),(0,X.Q)(e,(0,G.mx9)(c,d,{noBase:z.L,mediaClip:"post"===n.type&&n.mediaClip||void 0})))},showGutter:r,hasContext:!!a,entityKey:n.entity_key,children:(0,o.BX)(x.n,{user:u,item:n,children:[a,(0,o.BX)(F.hs,{gap:12,alignItems:"start",children:[(0,o.tZ)(N.Fb,{user:u,onClick:g,utm_content:n.entity_key}),(0,o.BX)(F.tu,{gap:8,flex:"grow",minWidth:0,children:[(0,o.BX)(F.tu,{gap:12,children:[(0,o.tZ)(B.Ev,{author:u,post:d,onClick:g,utm_content:n.entity_key,publication:c,item:n,allowHide:s}),d&&(null===(i=d.liveStream)||void 0===i?void 0:null===(t=i.liveStream)||void 0===t?void 0:t.status)&&["scheduled","pending","active"].includes(d.liveStream.liveStream.status)?(0,o.tZ)(j.h,{liveStream:d.liveStream,post:d}):(0,J.D2)(n)&&d.videoUpload?(0,o.tZ)(Y.Jl,{tag:(0,o.tZ)(T.u0,{item:n,pub:c,post:d}),composing:!1,mediaUpload:d.videoUpload,videoPlayerProps:(0,f.$l)({post:d,item:n,clipInfo:b})}):(0,o.tZ)(f.tg,{item:n,publication:c,post:d,onClick:()=>(0,A.rw)(n,p,"attachment",{tabId:h}),clipInfo:b})]}),(0,o.tZ)(y.l8,{item:n,pub:c,post:d})]})]})]})}):null}let ea=(0,M.zo)({gap:8},M.sg);function el(e){var t,i;let{author:n,rootFeedComment:r,parentComments:a,parentComment:l,item:s,utm_content:c,feedSurface:d,tabId:u}=e,p="note_reply"===s.context.type&&s.comment.user_id!==(null!==(i=null==n?void 0:n.id)&&void 0!==i?i:null==a?void 0:null===(t=a[0])||void 0===t?void 0:t.user_id);return(0,o.BX)(o.HY,{children:[n?(0,o.BX)(o.HY,{children:[(0,o.tZ)(eo,{item:s,showGutter:!0,context:p?(0,o.tZ)(S.L,{context:s.context,onClick:()=>(0,A.rw)(s,d,"context",{tabId:u}),utm_content:c}):void 0}),(null==a?void 0:a.length)&&(null==a?void 0:a.length)>1&&l&&(0,o.tZ)(es,{url:(0,G.Sgq)(l,{noBase:z.L}),showGutter:!0})]}):r?(0,o.BX)(o.HY,{children:[(0,o.tZ)(g.WS,{isParent:!0,comment:r,item:s,showContext:p,utm_content:c}),(null==a?void 0:a.length)&&(null==a?void 0:a.length)>2&&l&&(0,o.tZ)(es,{url:(0,G.Sgq)(l,{noBase:z.L}),showGutter:!0})]}):null,l&&(null==a?void 0:a.length)&&(0,o.tZ)(g.WS,{showReplyingTo:(null==a?void 0:a.length)>2,isParent:!0,comment:l,item:s,showContext:p&&!(n||r),utm_content:c})]})}function es(e){let{url:t,showGutter:i}=e;return(0,o.tZ)(N.oM,{onClick:e=>(0,X.Q)(e,t),showGutter:i,hasAvatar:!1,children:(0,o.BX)(F.gq,{children:[(0,o.BX)(F.tu,{alignItems:"center",justifyContent:"center",className:$.Z.seeMoreThread,children:[(0,o.tZ)(F.tu,{className:c()($.Z.seeMoreThreadSegment,$.Z.top)}),(0,o.tZ)(d.Z,{size:16,stroke:"var(--color-utility-detail)"}),(0,o.tZ)(F.tu,{className:$.Z.seeMoreThreadSegment,flex:"grow"})]}),(0,o.tZ)(F.tu,{className:$.Z.seeMoreReplies,flex:"grow",minWidth:0,children:(0,o.tZ)(F.xv.B4,{color:"highlight",children:(0,o.tZ)(P.hh,{href:t,children:"See more replies"})})})]})})}},25991:function(e,t,i){i.d(t,{Et:()=>N,Ev:()=>P,Gf:()=>O,KF:()=>D,Lg:()=>T,c9:()=>F,mn:()=>R,nH:()=>x});var n=i(7409),r=i(99282),o=i(16584);i(35543);var a=i(95441),l=i(40647),s=i(60807);i(5952);var c=i(42375),d=i(62110),u=i(13748),p=i(53678),h=i(16451),m=i(71068),g=i(15771),v=i(19081),f=i(58175),b=i(87989),_=i(15503),y=i(2009),Z=i(32189),w=i(43254),k=i(98012),C=i(42886),S=i(63651),B=i(47929);let x=["post_like","post_restack","comment_like"],I=["search","note-related","profile","publication","permalink"];function P(e){let{author:t,post:i,comment:n,onClick:r,utm_content:a,publication:s,item:p,allowHide:h=!1,timestamp:m,hideSubscribeCta:g}=e,f=(0,c.rI)(),b=m||(null==n?void 0:n.date)||(null==i?void 0:i.post_date),_=I.includes(f),y=!!(0,l.xR)().getConfigFor("feed_item_source_debug_mode"),Z=y&&p&&"trackingParameters"in p,w=p&&(0,C.D2)(p,n);return(0,o.BX)(D,{children:[(0,o.BX)(O,{children:[(0,o.tZ)(T,{user:t,onClick:r,utm_content:a}),b&&(0,o.tZ)(R,{timestamp:b,comment:n}),y&&p&&(0,o.tZ)(M,{item:p,showEntityKey:!0,showDebugDot:null!=Z&&Z})]}),!g&&t&&p&&!_&&(0,o.tZ)(E,{author:t,item:p,comment:null!=n?n:void 0,post:null!=i?i:void 0,publication:null!=s?s:void 0}),w&&"post"===p.type&&i&&s&&(0,o.tZ)(d._,{item:p,pub:s,post:i}),(0,o.tZ)(v.hs,{maxHeight:20,gap:12,alignItems:"center",children:(0,o.tZ)(u.U,{publication:s,post:i,comment:n,item:p,allowHide:h})})]})}function N(e){let{user:t}=e;return(0,o.tZ)(D,{children:(0,o.BX)(O,{children:[(0,o.tZ)(f.xv,{as:"span",weight:"medium",children:t.name}),(0,o.tZ)(b.UserBadge,{tier:t.bestseller_tier,userId:t.id,tooltipOnHover:!0,size:"xs"})]})})}function T(e){let{user:t,onClick:i,utm_content:n,disableHoverCard:r}=e;return(0,o.BX)(o.HY,{children:[(0,o.tZ)(f.xv,{as:"span",weight:"medium",children:(0,o.tZ)(p.xG,{user:t,onClick:i,utm_source:B.b3.substackFeedItem,utm_content:n,disableHoverCard:r,children:t.name})}),(0,o.tZ)(b.UserBadge,{tier:t.bestseller_tier,userId:t.id,tooltipOnHover:!0,size:"xs"})]})}function E(e){let{author:t,comment:i,post:n,item:r,permalink:a,publication:l}=e,{finalPublication:d,isSubscribed:u,showCta:p,handleClick:h,currentUser:m}=function(e,t,i,n,r){var o,a;let l=(0,s.aF)(),d=(0,c.rI)(),u=i?"comment":n?"post":void 0,p=null!==(a=null!==(o=null==i?void 0:i.id)&&void 0!==o?o:null==n?void 0:n.id)&&void 0!==a?a:0,h=u?(0,S.D2I)(p,u):void 0,m=null!=r?r:e.primary_publication,g=(0,Z.x)({surface:"substack-feed-item",zIndex:1001})(m),v=(0,w._F)({user:e,publicationId:null==m?void 0:m.id,publicationName:null==m?void 0:m.name,subscriptionSource:"substack-feed-item",sourceNoteId:h});return{finalPublication:m,isSubscribed:v.isSubscribed,showCta:v.showCta,handleClick:e=>{(0,_.rw)(t,d,"subscribe"),!l&&m?g(e):v.isSubscribed?v.unsubscribe(e):v.subscribe(e)},currentUser:l}}(t,r,i,n,l);return(!m||m.id!==t.id)&&d&&p?(0,o.tZ)(a?L:X,{isSubscribed:u,onClick:h}):null}function X(e){let{isSubscribed:t,onClick:i}=e,{iString:n}=(0,a.M1)();return(0,o.tZ)(g.zx,{priority:t?"quaternary":"tertiary-accent",size:"xs",onClick:i,children:n(t?"Subscribed":"Subscribe")})}function L(e){let{isSubscribed:t,onClick:i}=e,{iString:n}=(0,a.M1)();return(0,o.tZ)(g.zx,{priority:t?"quaternary":"primary",size:"sm",onClick:i,children:n(t?"Subscribed":"Subscribe")})}let F=new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"});function R(e){let{timestamp:t,comment:i,post:n,publication:r}=e;return(0,o.tZ)(p.hh,{href:i?(0,S.Sgq)(i,{noBase:y.L}):n?(0,S.mx9)(r,n):void 0,color:"secondary",title:F.format((0,k.Z)(t).toDate()),style:{marginLeft:4},children:(0,o.tZ)(h.Ku,{timestamp:t})})}function M(e){let{item:t,showEntityKey:i,showDebugDot:n}=e;return(0,o.BX)(v.hs,{flex:"grow",gap:4,alignItems:"center",justifyContent:"end",children:[i&&(0,o.tZ)(U,{item:t}),n&&(0,o.tZ)(A,{item:t})]})}function U(e){let{item:t}=e;return"entity_key"in t?(0,o.tZ)(f.xv.B4,{as:"span",color:"secondary",children:t.entity_key}):null}function A(e){var t;let i,n,{item:r}=e,{iString:l}=(0,a.M1)(),s=null===(t=r.trackingParameters)||void 0===t?void 0:t.item_source;return s?"model"===s?(i="accent-green",n="Model"):s.includes("db")?(i="accent-blue",n="DB"):s.includes("new-user")?(i="accent-purple",n="New user"):s.includes("topic-injection")?(i="accent-orange",n="Topic injection"):s.includes("trending")?(i="accent-red",n="Trending"):(i="tertiary",n="Other"):(i="accent-yellow",n="No source info"),(0,o.tZ)("span",{children:(0,o.tZ)(m.xu,{height:8,width:8,radius:"full",bg:i,color:"secondary",title:l(n)})})}let D=(0,m.zo)((0,r._)((0,n._)({},f.et),{display:"flex",minWidth:0,gap:8,alignItems:"center",height:20}));(0,m.zo)((0,r._)((0,n._)({},f.et),{display:"flex",minWidth:0,gap:12,alignItems:"center"}));let O=(0,m.zo)({display:"flex",flex:"grow",minWidth:0,gap:6,alignItems:"center"})},70394:function(e,t,i){i.d(t,{V:()=>l});var n=i(16584),r=i(347),o=i(19081),a=i(74312);function l(){return(0,n.tZ)(a.cr,{module:"../feed/PublicationPage",onRequest:()=>i.e("8118").then(i.bind(i,47002)),resolve:e=>e.PublicationFeedPage,whileLoading:(0,n.tZ)(s,{})})}function s(){return(0,n.tZ)(r.h,{children:(0,n.tZ)(o.hs,{bg:"primary",style:{minHeight:800}})})}},53678:function(e,t,i){i.d(t,{G6:()=>w,Zg:()=>y,hh:()=>k,xG:()=>Z});var n=i(7409),r=i(99282),o=i(98848),a=i(16584),l=i(94184),s=i.n(l);i(98661);var c=i(85685),d=i(95441),u=i(60807),p=i(93252),h=i(58175),m=i(2009),g=i(50312),v=i(33017),f=i(60308),b=i(36186),_=i(29439);function y(e){var{user:t,utm_source:i,utm_content:l,ellipsis:s,useYou:c,onClick:p}=e,h=(0,o._)(e,["user","utm_source","utm_content","ellipsis","useYou","onClick"]);let{iString:m}=(0,d.M1)(),g=(0,u.aF)(),v=(null==t?void 0:t.id)||(null==t?void 0:t.user_id)||0,f=c&&(null==g?void 0:g.id)===v?m("You"):"name"in t?t.name:m("User");return(0,a.tZ)(Z,(0,r._)((0,n._)({user:t,utm_source:i,utm_content:l,ellipsis:s,onClick:p},h),{children:f}))}function Z(e){var{user:t,utm_source:i,utm_content:l,children:s,onClick:d,ellipsis:u,disableHoverCard:h}=e,g=(0,o._)(e,["user","utm_source","utm_content","children","onClick","ellipsis","disableHoverCard"]);let v=(0,r._)((0,n._)({},t),{id:t.author_id||t.user_id||t.id,name:t.user_profile_name||t.author_name||t.name,handle:(null==t?void 0:t.handle)||(null==t?void 0:t.author_handle)});return(0,a.tZ)(c.ProfileHoverCard,{subject:v,dontStopPropagation:!0,utmSource:"feed",inline:!0,disabled:h,children:(0,a.tZ)(k,(0,r._)((0,n._)({href:(0,b.NN)(t,{noBase:m.L,utm_content:l,utm_source:i}),onClick:d,showBack:!0,ellipsis:u,className:g.className,target:(0,p.P)()?"_blank":void 0},g),{children:s}))})}function w(e){var{publication:t,utm_source:i,utm_content:l,children:s,onClick:c,ellipsis:d,disableHoverCard:u}=e,h=(0,o._)(e,["publication","utm_source","utm_content","children","onClick","ellipsis","disableHoverCard"]);return(0,a.tZ)(v.Sm,{publication_id:t.id,dontStopPropagation:!0,utmSource:"feed",inline:!0,disabled:u,children:(0,a.tZ)(k,(0,r._)((0,n._)({href:(0,f.n1t)("".concat(t.base_url,"/"),{utm_content:l,utm_source:i}),onClick:c,ellipsis:d,className:h.className,target:(0,p.P)()?"_blank":void 0},h),{children:s}))})}function k(e){var{weight:t,color:i,decoration:l="hover-underline",ellipsis:c,native:d,className:u}=e,p=(0,o._)(e,["weight","color","decoration","ellipsis","native","className"]);let m=p.href,v=null==m?void 0:m.match(/^([a-z]+:)?\/\//),f=null!=d?d:v&&!(null==m?void 0:m.startsWith(document.location.origin));return(0,a.tZ)(h.xv,{as:"span",ellipsis:c,weight:t,color:i,decoration:l,children:f?(0,a.tZ)("a",(0,r._)((0,n._)({},p),{className:s()(u,_.Z.link)})):(0,a.tZ)(g.r,(0,r._)((0,n._)({},p),{className:s()(u,_.Z.link)}))})}},30707:function(e,t,i){i.d(t,{C:()=>s});var n=i(7409),r=i(99282),o=i(16584),a=i(30396),l=i(70379);function s(){let e=(0,l.pm)();return(0,a.d4)(()=>{let t=new URL(location.toString());t.searchParams.get("founding-member-confirmation")&&(t.searchParams.delete("founding-member-confirmation"),history.replaceState({},"",t),e.popToast(e=>(0,o.tZ)(l.FN,(0,r._)((0,n._)({},e),{text:"You upgraded to a founding tier subscription. Thank you!"}))))},[]),null}},21599:function(e,t,i){i.d(t,{S2:()=>l,pW:()=>d,sK:()=>s});var n=i(48980),r=i(7882),o=i(98914),a=i(26111);function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=e||(0,a.x)("selection");let{isLoading:i,error:n,result:o}=(0,r.ib)({pathname:"/api/v1/post_selection/".concat(e),auto:!!e,deps:[e]});return{isLoading:i,error:n,postSelection:null!=o?o:null,highlightSelection:()=>{o&&c(o,t)}}}async function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=e||(0,a.x)("selection");let i=null;try{i=await (0,n.rd)("/api/v1/post_selection/".concat(e))}catch(e){console.error("could not fetch post selection",e)}i&&c(i,t)}function c(e){var t,i;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(n.ignoreSafari&&(0,o.G6)()||!e.text)return;let r=(null!==(i=null===(t=/^[^.]+\./.exec(e.text))||void 0===t?void 0:t[0])&&void 0!==i?i:e.text).replace(/\.+$/g,"");if(!r)return;let a="#:~:text=".concat(encodeURIComponent(r));history.replaceState({},document.title,a),document.location.replace(a)}async function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=e||(0,a.x)("imgSelection");let i=null;try{i=(await (0,n.rd)("/api/v1/post_selection/image/".concat(e))).selection}catch(t){console.error("Couldn't find post image selection with id ".concat(e),t)}i&&function(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(i.ignoreSafari&&(0,o.G6)())&&e.img_src){for(let i of document.getElementsByTagName("img"))if(i.src===e.img_src){t=i;return}t&&t.scrollIntoView()}}(i,t)}},9682:function(e,t,i){i.d(t,{js:()=>o,tv:()=>a});var n=i(30396),r=i(20042);function o(e,t){(0,n.d4)(()=>{let t=t=>{e(t)};return r.subscribers.push(t),()=>{r.subscribers.splice(r.subscribers.indexOf(t)>>>0,1)}},t)}function a(){let{path:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[t,i]=(0,n.eJ)({}),a=(0,n.sO)(null);o(e=>{a.current=e,i({})},[]);let l=a.current||(0,r.getCurrentUrl)(),s=l.replace(/\?.+$/,""),c=document.location.hash;return a.current=null,[{url:l,path:s,matches:e&&(0,r.exec)(s,e,{})||null,hash:c},r.route]}i(73410)},98750:function(e,t,i){i.d(t,{MW:()=>s,UM:()=>l,th:()=>c});var n=i(30396),r=i(46914),o=i(98914);function a(e,t){let{root:i,threshold:o=0,rootMargin:a,disabled:l=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=(0,r.z)(e=>{t(e.some(e=>e.isIntersecting),e)});(0,n.d4)(()=>{if("undefined"==typeof IntersectionObserver||!e.current||l)return;let t=new IntersectionObserver(s,{root:i,threshold:o,rootMargin:a});return t.observe(e.current),function(){t.disconnect()}},[i,o,a,l])}function l(e,t){let{root:i,threshold:r=0,rootMargin:o,disabled:l=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=(0,n.sO)(!1);a(e,e=>{e&&!s.current&&(s.current=!0,t())},{root:i,threshold:r,rootMargin:o,disabled:l||s.current})}function s(e,t,i){let{root:o,rootMargin:l,disabled:s=!1}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},c=(0,n.sO)({firstVisibleTime:null,lastVisibleTime:null}),d=()=>{let{current:e}=c;if(null!==e.firstVisibleTime){let t=e.lastVisibleTime?Date.now()-e.lastVisibleTime:0;null!=e.lastVisibleTime&&(i(t),e.lastVisibleTime=null)}},u=(0,r.z)(()=>{let{current:e}=c;null==e.firstVisibleTime&&(e.firstVisibleTime=Date.now(),t()),e.lastVisibleTime=Date.now()});return a(e,(0,r.z)((e,t)=>{var i;let n=null===(i=window)||void 0===i?void 0:i.innerHeight,r=t.some(e=>{let t=e.intersectionRatio>=.9&&e.isIntersecting,i=n&&e.boundingClientRect.height*e.intersectionRatio>=.5*n;return t||i}),o=t.some(e=>e.intersectionRatio<.3&&!e.isIntersecting);r?u():o&&d()}),{root:o,threshold:[.3,.5,.7,.9],rootMargin:l,disabled:s}),(0,n.d4)(()=>{let{current:e}=c;return"undefined"==typeof IntersectionObserver&&u(),()=>{null!==e.lastVisibleTime&&d()}},[]),u}function c(e){let[t,i]=(0,n.eJ)(!1);return(0,n.d4)(()=>{let t=()=>{let t=(0,o.dr)();i(t),null==e||e(t)};return(0,o.ut)(t),()=>{(0,o.kE)(t)}},[e]),t}},10656:function(e,t,i){i.d(t,{G5:()=>s,Iw:()=>u,tS:()=>d,z_:()=>c});var n=i(16584),r=i(6400),o=i(95441),a=i(31582),l=i(84864);let s=(e,t)=>{var i,n,a;let l="undefined"!=typeof window&&null!==(a=null===(n=window._preloads)||void 0===n?void 0:null===(i=n.pub)||void 0===i?void 0:i.language)&&void 0!==a?a:"en";(0,r.render)((0,r.h)(o._7,{language:l,children:e}),t)},c=e=>e.podcast_url&&e.podcast_duration>0?"podcast":e.videoUpload&&e.videoUpload.duration&&e.videoUpload.duration>0?"video":"thread"===e.type?"thread":"newsletter",d=function(e){let t,i,r,o,s,{currency:c,totalAmount:d,discount:u,quantity:p=1,trial_end_override:h,noTrial:m=!1,recurring:g=!0,isGroupSubscription:v=!1,isUnlimitedGroupSubscription:f=!1,language:b="en"}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{iString:_,iPlural:y}=I18N.i(b);if(c||(c=e.currency),void 0!==d)t=d;else{let i=(0,a.$e)(e,c);if(void 0===i){var Z;c=e.currency,i=null!==(Z=e.amount)&&void 0!==Z?Z:0}t=i*p}let w=(0,l.centsToPriceString)(t,c);if(u&&!u.loading&&!u.error&&(u.percent_off||u.amount_off)){let e;u.percent_off?e=Math.round(t*(1-(u.percent_off_precise||u.percent_off)/100)):u.amount_off&&(e=Math.max(0,t-u.amount_off)),i=(0,l.centsToPriceString)(e,c)}let k=i||w;e.is_bitcoin?("month"===e.interval&&(r=y("%2/1 month","%2/%1 months",e.interval_count,k)),"week"===e.interval&&(r=y("%2/1 week","%2/%1 weeks",e.interval_count,k)),"day"===e.interval&&(r=y("%2/1 day","%2/%1 days",e.interval_count,k)),"year"===e.interval&&(r=y("%2/1 year","%2/%1 years",e.interval_count,k))):e&&g&&!v&&!f?("month"===e.interval&&(r=y("%2 per month","%2 per %1 months",e.interval_count,k)),"week"===e.interval&&(r=y("%2 per week","%2 per %1 weeks",e.interval_count,k)),"day"===e.interval&&(r=y("%2 per day","%2 per %1 days",e.interval_count,k)),"year"===e.interval&&(r=y("%2 per year","%2 per %1 years",e.interval_count,k))):!e||g||v||f?e&&g&&v&&!f?("month"===e.interval&&(r=y("%2 for one month per person","%2 for %1 months per person",e.interval_count,k)),"week"===e.interval&&(r=y("%2 for one week per person","%2 for %1 weeks per person",e.interval_count,k)),"day"===e.interval&&(r=y("%2 for one day per person","%2 for %1 days per person",e.interval_count,k)),"year"===e.interval&&(r=y("%2 for one year per person","%2 for %1 years per person",e.interval_count,k))):e&&g&&v&&f&&("month"===e.interval&&(r=y("%2 for one month for unlimited seats","%2 for %1 months for unlimited seats",e.interval_count,k)),"week"===e.interval&&(r=y("%2 for one week for unlimited seats","%2 for %1 weeks for unlimited seats",e.interval_count,k)),"day"===e.interval&&(r=y("%2 for one day for unlimited seats","%2 for %1 days for unlimited seats",e.interval_count,k)),"year"===e.interval&&(r=y("%2 for one year for unlimited seats","%2 for %1 years for unlimited seats",e.interval_count,k))):("month"===e.interval&&(r=y("%2 for one month","%2 for %1 months",e.interval_count,k)),"week"===e.interval&&(r=y("%2 for one week","%2 for %1 weeks",e.interval_count,k)),"day"===e.interval&&(r=y("%2 for one day","%2 for %1 days",e.interval_count,k)),"year"===e.interval&&(r=y("%2 for one year","%2 for %1 years",e.interval_count,k)));let C=Math.max(0,"trial_period_days"in e&&e.trial_period_days||0,u&&u.trial_period_days||0,h?Math.ceil((h-Date.now()/1e3)/60/60/24):0);if(!m&&C>0&&(o=y("1 day free trial","%1 day free trial",C)),u&&i&&g&&"forever"!==u.duration){let t="once"===u.duration?1:u.duration_in_months/("year"===e.interval?12:1)*e.interval_count;"month"===e.interval&&(s=y("for first month","for first %1 months",t)),"week"===e.interval&&(s=y("for first week","for first %1 weeks",t)),"day"===e.interval&&(s=y("for first day","for first %1 days",t)),"year"===e.interval&&(s=y("for first year","for first %1 years",t))}return u&&u.loading?(0,n.BX)(n.HY,{children:[r," ",(0,n.BX)("span",{className:"discount-price",children:[" (",_("coupon loading"),")"]})]}):u&&u.error?(0,n.BX)(n.HY,{children:[r," ",(0,n.BX)("span",{className:"discount-price error",children:[" (",_("coupon invalid or expired"),")"]})]}):i?(0,n.BX)(n.HY,{children:[(0,n.tZ)("span",{className:"crossed-out",children:w})," ",(0,n.BX)("span",{className:"discount-price",children:[r," ",s?"(".concat(s,") "):"",o]})]}):(0,n.BX)(n.HY,{children:[r," ",o]})};async function u(e){let{timeout:t=5e3}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=document.createElement("video");i.volume=0;let n=!1,r=Promise.race([new Promise(e=>{i.onloadedmetadata=()=>{i.onloadedmetadata=null,i.duration===1/0?(i.currentTime=Number.MAX_SAFE_INTEGER,i.ontimeupdate=()=>{i.ontimeupdate=null,n=!0,e(i.duration),i.currentTime=0}):e(i.duration)},i.onerror=t=>{n=!0;let i=null;"string"==typeof t?i=t:t.target&&"error"in t.target&&(i=t.target.error),e({is_error:!0,err:i})}}),new Promise(e=>{setTimeout(()=>{n||e({is_error:!0,err:Error("Blob duration fetching timed out")})},t)})]);try{i.src="string"==typeof e||"string"==typeof e?e:window.URL.createObjectURL(e)}catch(e){return{is_error:!0,err:e}}return r}},49740:function(e,t,i){i.d(t,{K:()=>w});var n=i(16584),r=i(94184),o=i.n(r),a=i(24350),l=i.n(a),s=i(89734),c=i.n(s),d=i(347),u=i(20888),p=i(95441),h=i(55480),m=i(98422),g=i(30733),v=i(15771),f=i(61254),b=i(19081),_=i(58175),y=i(60308);let Z={image:"image-QMta6W"},w=e=>{let{pub:t}=e,{iString:i}=(0,p.M1)(),r=l()(t.sections,"id"),a=c()((0,h.EP)(t),"podcastTitle");return(0,n.tZ)("div",{className:o()("page","typography"),children:(0,n.tZ)(g.N,{children:(0,n.BX)(b.tu,{gap:24,children:[(0,n.tZ)(_.xv.H2,{children:i("Podcasts")}),(0,n.tZ)(b.tu,{gap:24,children:a.map((e,i)=>{var o,a;let l=null!==(a=r[null!==(o=e.sectionId)&&void 0!==o?o:"undefined"])&&void 0!==a?a:null;return(0,n.BX)(n.HY,{children:[0!==i&&(0,n.tZ)(f.iz,{}),(0,n.tZ)(k,{podcastForDisplay:e,pub:t,section:l})]})})})]})})})},k=e=>{let{podcastForDisplay:t,pub:i,section:r}=e,{iString:o}=(0,p.M1)(),{isMobile:a}=(0,m.v9)(),l=(0,y.UVC)({pub:i,section:r});return(0,n.tZ)(d.h,{children:(0,n.BX)(b.gq,{gap:24,children:[(0,n.tZ)(b.tu,{width:a?140:180,flex:"auto",children:t.artUrl&&(0,n.tZ)("a",{href:l,children:(0,n.tZ)(u.e,{className:Z.image,imageIsFixedWidth:!0,maxWidth:a?140:180,src:t.artUrl,useRetinaSizing:!0})})}),(0,n.BX)(b.tu,{gap:12,children:[(0,n.BX)(b.tu,{gap:8,children:[(0,n.tZ)(_.xv.H3,{as:"a",href:l,children:t.podcastTitle}),(0,n.tZ)(_.xv.B3,{children:t.description})]}),(0,n.tZ)("div",{children:(0,n.tZ)(v.zx,{href:l,priority:"secondary",size:"sm",children:o("See episodes")})})]})]})})}},65102:function(e,t,i){i.d(t,{h:()=>I});var n=i(16584),r=i(30396),o=i(94184),a=i.n(o),l=i(887),s=i(40281),c=i(95441),d=i(7882),u=i(1152),p=i(58401),h=i(98422),m=i(80026),g=i(87185),v=i(6490),f=i(6070);let b={container:"container-Q5omP8",containerForShows:"containerForShows-FydmKs",editButtonContainer:"editButtonContainer-O6BQ51"},_=e=>{let{isShowsEpisodePage:t,posts:i,title:o,user:c,postTags:d,selectedPostTagId:g,postId:v,postTheme:f}=e,{isMobile:_}=(0,h.v9)(),[Z,w]=(0,r.eJ)(!1);return(0,n.tZ)(m.hs,{className:a()({[b.container]:!t,[b.containerForShows]:t}),children:t?(0,n.BX)(m.tu,{gap:24,children:[(0,n.tZ)(p.l,{title:o,titlePreset:"st1",variant:"align-right"}),(0,n.tZ)(s.f,{posts:i})]}):(0,n.BX)(n.HY,{children:[(null==c?void 0:c.is_admin)&&!_&&(0,n.tZ)("div",{className:b.editButtonContainer,children:(0,n.tZ)(m.hU,{priority:"primary-mono",size:"sm",onClick:()=>{w(!0)},children:(0,n.tZ)(l.Z,{size:16})})}),(0,n.tZ)(u.M,{headerVariant:"align-right",posts:i,title:o,variant:"large-in-middle"}),(0,n.tZ)(y,{currentPostTagId:g,isOpen:Z,postId:v,postTags:d,postTheme:f,user:c,onClose:()=>w(!1)})]})})},y=e=>{let{user:t,isOpen:i,onClose:o,postTags:a,currentPostTagId:l,postId:s,postTheme:u}=e,{isMobile:p}=(0,h.v9)(),{iString:f}=(0,c.M1)(),[b,_]=(0,r.eJ)(l),{refetch:y,error:Z}=(0,d.ib)({pathname:"/api/v1/post/".concat(s,"/theme"),method:"PATCH"});if(p||!(null==t?void 0:t.is_admin))return null;let w=()=>{_(l),o()},k=async()=>{await y({json:{header_variant:u.header_variant,featured_post_tag_id:b}}),Z||window.location.reload()},C=null==a?void 0:a.map(e=>({value:e.id,label:e.name}));return(0,n.BX)(v.u_,{disableCloseOnBackdropClick:!0,isOpen:i,onClose:w,children:[(0,n.tZ)(v.xB,{showClose:!0,title:f("Choose a tag to feature"),onClose:o}),(0,n.tZ)(v.fe,{children:(0,n.tZ)(g.m,{options:C,value:b,onChange:e=>_(e)})}),(0,n.tZ)(v.mz,{primaryButton:(0,n.tZ)(m.zx,{disabled:l===b,onClick:k,children:f("Save")}),secondaryButton:(0,n.tZ)(m.zx,{priority:"secondary",onClick:w,children:f("Cancel")})})]})},Z=e=>{var t,i,n,r;let{post:o,pub:a,showPodcastEpisodesOnly:l}=e;if(!o||!(0,f.HD)({pub:a}))return;if(l)return{featuredSectionId:null!==(n=o.section_id)&&void 0!==n?n:void 0,title:"More Episodes"};let{postTheme:s}=o;if(null==s?void 0:s.featured_post_tag_id){let e=null==o?void 0:null===(r=o.postTags)||void 0===r?void 0:r.find(e=>{let{id:t}=e;return t===(null==s?void 0:s.featured_post_tag_id)});return e?{featuredPostTagId:null==s?void 0:s.featured_post_tag_id,title:"More in ".concat(e.name)}:void 0}if(o.section_id&&o.section_name)return{featuredSectionId:o.section_id,title:"More in ".concat(o.section_name)};let c=new Set(null===(t=o.publishedBylines)||void 0===t?void 0:t.map(e=>e.name)),d=null===(i=o.postTags)||void 0===i?void 0:i.find(e=>{let{name:t}=e;return!c.has(t)});if(d)return{featuredPostTagId:null==d?void 0:d.id,title:"More in ".concat(null==d?void 0:d.name)}};var w=i(33578),k=i(15400),C=i(19081),S=i(58175);let B=()=>{let{isMobile:e}=(0,h.v9)();return(0,n.tZ)(C.tu,{paddingX:8*!e,paddingBottom:8,children:(0,n.tZ)(C.tu,{borderBottom:"detail-themed",paddingBottom:8,children:(0,n.tZ)(S.xv,{className:"title-lJNKDo",children:"Latest"})})})};var x=i(71068);let I=e=>{var t;let{delayFirstLoad:i,filterPostsPredicate:r,isBelowTheFold:o,isShowsEpisodePageForTheFP:a,maxPosts:l,pub:s,search:d,sort:u,sortTabs:p,source:m,user:g,post:v}=e,{isMobile:b}=(0,h.v9)(),{iString:y}=(0,c.M1)(),C=(0,f.HD)({pub:s}),S=(0,f.kb)({pub:s}),I=null===(t=s.sections)||void 0===t?void 0:t.find(e=>e.id===v.section_id),P=a&&(null==I?void 0:I.is_podcast)||I&&!!v.videoUpload&&a,N=Z({post:v,pub:s,showPodcastEpisodesOnly:P});return(0,n.tZ)(x.xu,{paddingY:24,style:b?void 0:{marginLeft:-8,marginRight:-8},"aria-label":y("Top Posts Footer"),role:"region",children:(0,n.tZ)(w.O,{delayFirstLoad:i,filterPostsPredicate:r,hideCommunity:S,hideTop:S,isBelowTheFold:o,isPodcast:P,maxPosts:l,pub:s,search:d,sort:(null==N?void 0:N.featuredPostTagId)?"new":u,sortTabs:p,source:m,user:g,postTagId:null==N?void 0:N.featuredPostTagId,sectionId:null==N?void 0:N.featuredSectionId,postId:v.id,renderTabs:S?()=>(0,n.tZ)(B,{}):void 0,children:e=>{var t,i;let{posts:r,linkToComments:o,onClickPost:l}=e;return C?(0,n.tZ)(_,{isShowsEpisodePage:a,postId:v.id,postTheme:v.postTheme,selectedPostTagId:null==N?void 0:N.featuredPostTagId,posts:r,title:null!==(i=null==N?void 0:N.title)&&void 0!==i?i:"Top posts",user:g,postTags:null==v?void 0:v.postTags}):(0,n.tZ)(k.B,{hideImages:null===(t=s.theme)||void 0===t?void 0:t.hide_images_from_list,linkToComments:o,posts:r,variant:"two-column-list",onClickPost:l})}})})}},6891:function(e,t,i){i.d(t,{Z:()=>R});var n=i(7409),r=i(16584),o=i(6400),a=i(30396),l=i(94184),s=i.n(l),c=i(59543),d=i(1852),u=i(80569),p=i.n(u),h=i(32351),m=i(85685),g=i(11712),v=i(347),f=i(33665),b=i(3469),_=i(58319),y=i(68833),Z=i(80878),w=i(27036),k=i(98914),C=i(94874),S=i(15771),B=i(19081),x=i(38841),I=i(58175),P=i(6070),N=i(60308),T=i(47929);let E={heroText:"heroText-vjETGo",container:"container-QYwuRw"},X=e=>{let{pub:t,user:i,freeSignup:n,freeSignupEmail:o}=e,l="enabled"===t.payments_state&&(null==i?void 0:i.is_free_subscribed)&&!(null==i?void 0:i.is_subscribed)?"paid_upsell":"free_upsell";return(0,a.d4)(()=>{(0,y.j)(y.FP.ABOUT_PAGE_END_CTA_RENDERED,{pub_id:t.id,type:l})},[]),(0,r.BX)(r.HY,{children:[(0,r.tZ)(_.Z,{onVisible:()=>{(0,y.j)(y.FP.ABOUT_PAGE_END_CTA_SEEN,{pub_id:t.id,type:l})}}),(0,r.BX)(B.tu,{alignItems:"center",gap:16,padding:24,className:s()(E.container,"end-cta-container"),children:[t.author_photo_url?(0,r.tZ)(C.qE,{photoUrl:t.author_photo_url,size:64}):t.logo_url?(0,r.tZ)(x.wk,{logoUrl:t.logo_url,size:64,radius:"sm"}):null,(0,r.BX)(B.tu,{alignItems:"center",children:[(0,r.BX)(I.xv.H2,{lineHeight:30,align:"center",color:"pub-primary-text",children:["Subscribe to ",t.name]}),t.hero_text&&(0,r.tZ)(I.xv.Meta,{size:12,className:E.heroText,align:"center",color:"pub-secondary-text",children:t.hero_text})]}),(0,r.tZ)(f.Z,{pub:t,user:i,freeSignup:n,freeSignupEmail:o,isStatic:!1,source:"about-page-end-cta"})]})]})};function L(e){let{pub:t,user:i,freeSignup:n,freeSignupEmail:o,subscribeContent:a}=e;return"string"!=typeof a?(0,r.BX)("div",{className:"content-about-silhouette",children:[(0,r.tZ)("div",{className:"content-about-silhouette-line"}),(0,r.tZ)("div",{className:"content-about-silhouette-line"}),(0,r.tZ)("div",{className:"content-about-silhouette-line"}),(0,r.tZ)("div",{className:"content-about-silhouette-line"}),(0,r.tZ)("div",{className:"content-about-silhouette-line"})]}):(0,r.tZ)("div",{className:"content-about",children:(0,r.tZ)(g.Z,{html:a,pub:t,user:i,freeSignup:n,freeSignupEmail:o,isAboutPage:!0})})}function F(e){let{pub:t,people:i}=e,n=(0,d.useMediaQuery)({maxWidth:540}),o=n?[[]]:[[],[]];for(let e=0;e(0,r.tZ)("div",{className:"people-column",children:e.map(e=>(0,r.tZ)("div",{className:"content-person",onClick:i=>(0,Z.Q)(i,(0,N.LwU)(e,t,{utm_source:T.b3.aboutPage}),{native:!0}),children:(0,r.tZ)(m.ProfileCard,{subject:e,profile:e,utmSource:"about-page",forceRefresh:()=>({})})}))}))})}class R extends o.Component{async componentDidMount(){this.loadPeople(),this.loadAbout()}async loadAbout(){if(""!==this.state.subscribeContent)try{let{body:e}=await p().get("/api/v1/publication/subscribe_content");this.setState({subscribeContent:e})}catch(e){console.error("Failed to load about content:",e)}}async loadPeople(){if(!this.state.people)try{let e=(await p().get("/api/v1/publication/users/ranked").query({public:!0})).body;this.setState({people:e})}catch(e){console.error("Failed to load people:",e)}}render(e,t){let{pub:i,user:o,freeSignup:a,freeSignupEmail:l,metadata:s}=e,{subscribeContent:d,people:u}=t;if((0,P.HD)({pub:i})&&d)return(0,r.tZ)(b.j,{pub:i,user:o||void 0,type:"about",html:d});let p=(0,P.kb)({pub:i}),m=(!o||!(0,w.P)(o,i))&&function(e){if("undefined"==typeof window)return!0;let t=document.createElement("div");t.innerHTML=e;for(let e=t.childNodes.length-1;e>=0;e--){let i=t.childNodes[e];if((0,k.pv)(i,"button-wrapper")||(0,k.pv)(i,"subscription-widget-wrap"))return!1}return!0}(d);return(0,r.tZ)(v.h,{children:(0,r.BX)("div",{className:"page typography about-page typography post",children:[s&&(0,r.tZ)(h.Metadata,(0,n._)({},s)),(0,r.BX)("div",{className:"container",children:[(null==o?void 0:o.is_contributor)&&(0,r.tZ)(S.zx,{priority:"secondary",href:(0,N.n1t)("/publish/settings/edit",{title:"About page",bodyField:"subscribe_content",redirect:document.location.href}),localNavigation:!1,leading:(0,r.tZ)(c.Z,{size:20}),children:"Edit"}),(0,r.tZ)("div",{className:"about-content-wrap",children:(0,r.tZ)(L,{pub:i,user:o,freeSignup:a,freeSignupEmail:l,subscribeContent:d})}),m?(0,r.tZ)(X,{pub:i,user:o,freeSignup:a,freeSignupEmail:l}):null,!p&&(null!=u?u:[]).length>0&&(0,r.BX)(B.tu,{gap:24,children:[(0,r.tZ)("h3",{className:"about-page-section-title",children:"People"}),(0,r.tZ)(F,{pub:i,people:u})]})]})]})})}constructor(e,t){super(e,t),this.state={subscribeContent:e.subscribeContent,people:e.people}}}},97901:function(e,t,i){i.d(t,{Z:()=>u});var n=i(7409),r=i(16584),o=i(94184),a=i.n(o),l=i(32351),s=i(347),c=i(33578),d=i(15400);function u(e){var t;let{children:i,title:o,pub:u,user:p,sort:h,search:m,newPostsForArchive:g,topPostsForArchive:v,communityPostsForArchive:f,searchPosts:b,slug:_,isPodcast:y,metadata:Z}=e,w=!!(null==u?void 0:u.theme),k=u.sections.find(e=>e.slug===_),C=null!==(t=null==k?void 0:k.id)&&void 0!==t?t:y?"pubPodcast":"pub",S=null==g?void 0:g[C],B=null==v?void 0:v[C],x=null==f?void 0:f[C];return(0,r.BX)(s.h,{children:[Z&&(0,r.tZ)(l.Metadata,(0,n._)({},Z)),(0,r.tZ)("div",{className:a()("archive-page typography","container-b1BW1a",{"use-theme-bg":w}),children:(0,r.BX)("div",{className:"container",children:[o&&(0,r.tZ)("h2",{children:o}),(0,r.tZ)(c.O,{communityPosts:x,isPodcast:y,newPosts:S,pub:u,search:m,searchPosts:b,sectionId:null==k?void 0:k.id,showMonthDividers:!0,sort:h,source:"archive",topPosts:B,user:p,variant:"list",children:e=>{var t;let{posts:i,linkToComments:n,onClickPost:o}=e;return(0,r.tZ)(d.B,{hideImages:null===(t=u.theme)||void 0===t?void 0:t.hide_images_from_list,linkToComments:n,posts:i,variant:"two-column-list",onClickPost:o})}}),i]})})]})}},97349:function(e,t,i){i.d(t,{IO:()=>q,o_:()=>Y,rf:()=>j});var n=i(27412),r=i(7409),o=i(99282),a=i(58865),l=i(16584),s=i(6400),c=i(80569),d=i.n(c),u=i(16808),p=i(18787),h=i(347),m=i(30329),g=i(47851),v=i(6498),f=i(57626),b=i(48479),_=i(95441),y=i(40647),Z=i(6091),w=i(68833),k=i(98914),C=i(41258),S=i(41990),B=i(1980),x=i(83225),I=i(75496),P=i(21266),N=i(46638),T=i(32129),E=i(19081),X=i(58175),L=i(70379),F=i(50364),R=i(6070),M=i(31377),U=i(60308),A=i(26111),D=i(84864);function O(){let e=(0,a._)(["Comments on this "," are for "," subscribers"]);return O=function(){return e},e}class z extends s.Component{async componentDidMount(){var e;let{iString:t}=this.props;if((0,k.ut)(this.onWindowVisibilityChange),this.props.publication.community_enabled||this.props.inline?await this.loadPost():document.location.href="./",null===(e=this.props.matches)||void 0===e?void 0:e.feedCommentUrl){let e=this.props.matches.feedCommentUrl,i=new URL(location.toString());i.searchParams.delete("feedCommentUrl"),history.replaceState({},"",i),this.props.popToast(i=>(0,l.tZ)(L.FN,(0,o._)((0,r._)({},i),{text:t("Note Shared."),cta:t("View Now"),href:e})),{ttl:1e4})}}componentWillUnmount(){(0,k.kE)(this.onWindowVisibilityChange),clearInterval(this.loadTimeout)}async componentDidUpdate(e,t){if(e.slug!==this.props.slug||t.sort!==this.state.sort){let e=this.props.post&&this.props.post.slug===this.props.slug;await (0,k.IW)(this,{post:e?this.props.post:null,comments:[]}),await this.loadPost()}else if(this.state.post&&this.state.comments&&!this.commentsViewed&&!this.state.loading){let e=0;(0,F.hO)(this.state.comments,()=>{e++}),this.state.post.comment_count!==e&&(this.state.post.comment_count=e,this.setState({post:this.state.post}),this.props.onChange&&this.props.onChange({post:this.state.post}))}}queueRefresh(){if(!this.commentsViewed&&this.state.comments&&this.state.post){this.commentsViewed=!0;let{post:e}=this.state;(0,w.j)(w.FP.COMMENTS_VIEWED,{post_id:e.id,comment_count:this.state.comments.length}),this.props.publication.community_enabled&&!("thread"===e.type||(0,D.canSeeComments)(this.props.user,e))&&(0,w.j)(w.FP.COMMENT_PAYWALL_SHOWN,{post_id:e.id,post_type:e.type}),"thread"===e.type&&this.props.user&&Promise.resolve(d().post("/api/v1/posts/".concat(e.id,"/seen")))}clearTimeout(this.loadTimeout),"undefined"!=typeof window&&(this.loadTimeout=window.setTimeout(()=>this.loadPost(),3e4))}async loadPost(){let e;if(this.state.comments&&!(0,k.dr)())return;clearTimeout(this.loadTimeout),this.setState({loading:!0});let t=this.state.comments&&this.state.comments.length>0;this.state.comments&&(e=null,(0,F.hO)(this.state.comments,t=>{!t.deleted&&t.date&&(!e||t.date>e)&&(e=t.date)}));try{let t=this.props.slug,i=this.state.sort,n={token:this.props.post_reaction_token||"",all_comments:!0,sort:i,last_comment_at:e};this.state.post&&this.props.commentId&&(n.comment_id=this.props.commentId);let r=await d().get(this.state.post?"/api/v1/post/".concat(this.state.post.id,"/comments"):"/api/v1/posts/".concat(t)).query(n);if(this.setState({loading:!1}),t!==this.props.slug||i!==this.state.sort)return;let o=this.state.sort;!this.state.post&&r.body.default_comment_sort&&(o=r.body.default_comment_sort);let a=r.body.comments,l=this.state.comments;if(!this.state.post||!l||a){let e=l&&a?(0,I.v)(l,a):null!=a?a:[];await (0,k.IW)(this,{post:this.state.post||r.body,comments:e,sort:o})}}catch(e){console.error("Failed to load post:",e),400===e.statusCode&&await (0,k.IW)(this,{notAllowedToFetchComments:!0}),this.setState({loading:!1})}!t&&this.state.comments&&this.state.comments.length>0&&(0,k.pK)(),(0,k.dr)()&&this.queueRefresh(),this.triggerShareOnLoad()}onSortSelected(e){var t,i;this.setState({sort:e}),(0,w.j)(w.FP.COMMENTS_SORTED,{post_id:null===(t=this.state.post)||void 0===t?void 0:t.id,post_type:null===(i=this.state.post)||void 0===i?void 0:i.type,sort:e})}triggerShareOnLoad(){var e;(null===(e=this.shareDialogRef)||void 0===e?void 0:e.current)&&"share"===(0,A.x)("action")&&(window.history.replaceState({},document.title,(0,U.rhs)({action:null})),this.shareDialogRef.current.fromEmail())}_isPub(e){let{publication:t}=this.props;return(null==t?void 0:t.subdomain)===e}render(e,t){let{slug:i,user:n,freeSignup:r,freeSignupEmail:o,publication:a,post_reaction_token:s,inline:c,commentId:d,selectionFromQuery:p,imgSelectionFromQuery:v,freeTrialCoupon:f,show_reaction_upsell:_,bannedFromNotes:y,iString:w}=e,{sort:k,post:x,comments:I,notAllowedToFetchComments:P,reactionSigninComment:E}=t;if(!x||!a.community_enabled)return c&&x?(0,l.tZ)("div",{className:"container",children:(0,l.tZ)(q,{post:x})}):(0,l.tZ)("div",{className:"comments-page",children:(0,l.tZ)("div",{className:"container",children:(0,l.tZ)(b.U,{})})});let X=(0,R.HD)({pub:a}),L=a.community_enabled&&x&&"none"!==x.write_comment_permissions,F=P||L&&!(0,D.canSeeComments)(n,x),M=async(e,t)=>Y({user:n,reactionToken:s,comments:I,id:e,reacted:t,setComments:e=>this.setState({comments:e}),onNeedsSignin:e=>{let{comment:t}=e;return new Promise(e=>this.setState({reactionSigninComment:t},()=>{var t;return null===(t=this.modalRef.current)||void 0===t?void 0:t.open(e)}))}});return(0,l.tZ)(h.h,{children:(0,l.BX)("div",{className:"comments-page",children:[d&&(null==I?void 0:I[0])?(0,l.tZ)(Z.N,{comment:I[0],post:x,publication:a}):(0,l.tZ)(T.PostMetaTags,{post:x,publication:a,isCommentPage:!this.props.inline,selection:p,imgSelection:v}),(0,l.tZ)(g.Z,{ref:this.shareDialogRef,user:n,pub:a,post:x,reaction_token:s,comments:I,commentId:d}),!c&&!d&&(0,l.tZ)("div",{className:"container",children:(0,l.tZ)(b.H,{pub:a,post:Object.assign({},x,{comment_url_override:(0,U.uRy)(a,x,{comments:!0})}),user:n,freeSignup:r,freeSignupEmail:o,hidden:!(0,D.isUUID)(i)&&x.hidden,truncated:"thread"!==x.type,post_reaction_token:s,onChange:e=>this.setState(null!=e?e:{}),showUnsubscribeNotice:!0,gap:0,showShare:!1,children:(0,l.tZ)("div",{className:"full-container-border"})})}),F&&(0,l.tZ)(W,{freeSignup:r,freeSignupEmail:o,freeTrialCoupon:f,inline:c,post:x,publication:a,user:n}),"thread"===x.type||(0,D.canSeeComments)(n,x)?(0,l.BX)("div",{className:"container",children:[!c&&I&&(0,l.tZ)(H,{comments:I,post:x,sort:k,notAllowedToFetchComments:P,commentId:d,publication:a,handleSort:e=>this.onSortSelected(e),useFreePressTheme:X}),I&&I.length>0&&!L&&(0,l.tZ)(q,{post:x}),L&&(0,l.tZ)(S._,{user:n,freeSignup:r,freeSignupEmail:o,pub:a,post:x,token:s,autoFocus:(0,N.gB)(),onSuccess:e=>this.setState({comments:[e].concat(I)}),bannedFromNotes:y}),d&&I&&(0,l.tZ)("a",{className:"return-to-thread-link",href:(0,U.uRy)(a,x,{comments:!0,commentId:d,highlightComment:!0}),children:w("⭠ Return to thread")}),I||P?I.length>0?[(0,l.tZ)("div",{className:"comment-list-container",ref:this.scrollRef,children:(0,l.tZ)(C.AM,{user:n,freeSignup:r,freeSignupEmail:o,pub:a,post:x,comments:I,reaction_token:s,depth:0,collapseAtDepth:c?10:I.length>3&&"most_recent_first"===k?C.sA:C.lf,onChange:this.onChange,pageSize:c||this._isPub("astralcodexten")?C.eR:"thread"===x.type?C.LB:C.L8,scrollRef:this.scrollRef,retainUserCollapseState:!0,updateCommentReacted:this.updateCommentReacted,noRestack:!0},x.id)})]:null:[(0,l.tZ)(B.l,{}),(0,l.tZ)(B.l,{})]]}):null,E&&(0,l.tZ)(m.oq,{comment:E,pub:a,user:n,react:()=>M(E.id,!0),modalRef:this.modalRef}),_?(0,l.tZ)(u.hF,{user:n,pub:a,post:x}):null]})})}constructor(e,t){let i;super(e,t),(0,n._)(this,"modalRef",(0,s.createRef)()),(0,n._)(this,"scrollRef",void 0),(0,n._)(this,"shareDialogRef",void 0),(0,n._)(this,"onboardingModalRef",void 0),(0,n._)(this,"loadTimeout",void 0),(0,n._)(this,"commentsViewed",void 0),(0,n._)(this,"onWindowVisibilityChange",()=>{(0,k.dr)()?setTimeout(()=>{this.loadPost()},100):clearTimeout(this.loadTimeout)}),(0,n._)(this,"onChange",e=>{this.setState({comments:(0,P.H)(this.state.comments,e)})}),(0,n._)(this,"updateCommentReacted",(e,t)=>{let{user:i,post_reaction_token:n}=this.props,{comments:r}=this.state;Y({user:i,reactionToken:n,comments:r,id:e,reacted:t,setComments:e=>this.setState({comments:e}),onNeedsSignin:e=>{let{comment:t}=e;return new Promise(e=>this.setState({reactionSigninComment:t},()=>{var t;return null===(t=this.modalRef.current)||void 0===t?void 0:t.open(e)}))}})}),e.post&&e.post.slug===e.slug&&(i=e.post);let r=e.sort||i&&i.default_comment_sort||e.publication.default_comment_sort||"best_first",o=e.initialComments;this.scrollRef=(0,s.createRef)(),this.shareDialogRef=(0,s.createRef)(),this.onboardingModalRef=(0,s.createRef)(),this.state={post:i,sort:r,comments:o,loading:!1,reactionSigninComment:null}}}let j=(0,y.xY)((0,L.dd)((0,_.fz)(z))),H=e=>{let{comments:t,post:i,sort:n,notAllowedToFetchComments:r,commentId:o,publication:a,handleSort:s,sortMenuUseMobileBottomSheet:c,useFreePressTheme:d=!1}=e,{iString:u,iPlural:p}=(0,_.M1)();return d?(0,l.tZ)(v.R,{comments:t,post:i,publication:a,notAllowedToFetchComments:r,handleSort:s,sort:n,sortMenuUseMobileBottomSheet:c}):(0,l.BX)(E.gq,{alignItems:"center",justifyContent:"space-between",paddingY:8,children:[(0,l.tZ)(X.xv.B1,{weight:"bold",children:t.length>0?p("1 Comment","%1 Comments",i.comment_count):u("Comments")}),t.length>1&&!r&&!o&&(0,l.tZ)(x.$,{currentSort:n,isLoading:!t,handleSort:s,pub:a,useMobileBottomSheet:c})]})},W=e=>{let{freeSignup:t,freeSignupEmail:i,freeTrialCoupon:n,inline:r,post:o,publication:a,user:s}=e,{iTemplate:c,iString:d}=(0,_.M1)();return(0,R.HD)({pub:a})?(0,l.tZ)(f.C,{publication:a,post:o,user:s,freeSignupEmail:i,showHeader:!r}):(0,l.tZ)("div",{className:"container",children:(0,l.tZ)(p.f1,{user:s,freeSignupEmail:i,freeSignup:t,publication:a,post:o,title:c(O(),"podcast"===o.type?"episode":"post",(0,M.isFoundingAudience)(o.audience)?"founding":"paid"),reauthenticationTitle:d("To see the comments, please re-authenticate."),coupon:n})})},q=e=>{let{post:t}=e,{iString:i}=(0,_.M1)();return(0,l.tZ)("div",{className:"locked-comments",children:i("adhoc_email"===t.type?"Commenting has been turned off for this email":"Commenting has been turned off for this post")})};async function Y(e){let{user:t,reactionToken:i,comments:n,id:o,reacted:a,setComments:l,onNeedsSignin:s}=e,c=(0,N.S9)(o,n);if(!c)return;let d=(0,r._)({},c);(0,m.E6)(t,d,a),l((0,N.fc)(n.slice(0),d));try{await (0,m.xl)(d,!0,a,i)}catch(e){var u;if((0,m.E6)(t,d,!a),l((0,N.fc)(n.slice(0),(0,r._)({},d))),(null===(u=e.response)||void 0===u?void 0:u.statusCode)!==401){alert((0,k.zx)(e));return}await s({comment:d})}}},63145:function(e,t,i){i.d(t,{IO:()=>r.IO,Os:()=>o.Os,_D:()=>n._,fc:()=>o.fc,o_:()=>r.o_,rf:()=>r.rf});var n=i(41990);i(41258);var r=i(97349);i(1980);var o=i(46638)},46638:function(e,t,i){i.d(t,{Fs:()=>b,Jr:()=>m,Os:()=>v,S9:()=>function e(t,i){if(!t||!i||!i.length)return null;for(let n of i){if(n.id===t)return n;if(n.children&&n.children.length){let i=e(t,n.children);if(i)return i}}return null},VS:()=>y,aE:()=>d.aE,ei:()=>Z,fc:()=>function e(t,i){for(let[o,a]of t.entries()){if(a.id===i.id)return t.with(o,i);if(a.children){let l=e(a.children,i);if(l!==a.children)return t.with(o,(0,r._)((0,n._)({},a),{children:l}))}}return t},fg:()=>f,gB:()=>g,gz:()=>_});var n=i(7409),r=i(99282),o=i(16584),a=i(28175),l=i.n(a),s=i(59176),c=i(60308),d=i(60836),u=i(84864);let p="comment-collapse-state",h=function(){try{return(0,s.mM)(p,[])}catch(e){return console.error("Failed to load comment collapse state:",e),[]}}(),m=()=>{if("undefined"!=typeof window&&window.location.hash){let e=/^#comment-(\d+)/.exec(window.location.hash);if(e)return Number(e[1])}return null},g=()=>"undefined"!=typeof window&&"#input"===window.location.hash;function v(e,t,i){return(0,c.n1t)((0,c.uRy)(t,e,{comments:!(0,u.shouldUseInlineComments)(t,e)}),i)}function f(e,t,i){return(0,c.n1t)("".concat((0,c.SVA)(t),"/embed/comments/").concat(e.id),{access_token:i})}function b(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"p";return(e||"").split("\n").filter(e=>e.trim()).map(e=>(0,o.tZ)(t,{children:(0,o.tZ)(l(),{options:{validate:{url:e=>!!e&&!e.startsWith("/")},attributes:{rel:"nofollow ugc noopener"}},children:e})}))}let _=e=>{var t,i,n,r,o,a;return{id:e.user_id,slug:"user_slug"in e?e.user_slug:void 0,photo_url:e.photo_url,name:null!==(o=e.name)&&void 0!==o?o:null,bestseller_tier:e.user_bestseller_tier,primary_publication:e.user_primary_publication,is_free_subscribed:["free_signup, subscribed"].includes(null!==(a=null===(t=e.metadata)||void 0===t?void 0:t.membership_state)&&void 0!==a?a:""),is_subscribed:(null===(i=e.metadata)||void 0===i?void 0:i.membership_state)==="subscribed",is_founding:null===(n=e.metadata)||void 0===n?void 0:n.founding,is_author:null===(r=e.metadata)||void 0===r?void 0:r.is_author}};function y(e,t){let i=!1;if(t)!h.includes(e)&&(i=!0,h.push(e),h.length>250&&h.splice(0,h.length-250));else{let t=h.indexOf(e);t>=0&&(i=!0,h.splice(t,1))}if(i)try{(0,s.ex)(p,h)}catch(e){console.error("Failed to store comment collapse state:",e)}}function Z(e){return h.includes(e)}},92892:function(e,t,i){i.d(t,{H:()=>x});var n=i(27412),r=i(16584),o=i(6400),a=i(94184),l=i.n(a),s=i(39693),c=i.n(s),d=i(80569),u=i.n(d),p=i(56219),h=i(58319),m=i(75778),g=i(37168),v=i(56629),f=i(40647),b=i(68833),_=i(10047),y=i(98914),Z=i(32129),w=i(65102),k=i(19081),C=i(38501),S=i(60308),B=i(26111);class x extends o.Component{async componentDidMount(){(0,y.pK)(),this.cleanEmbedResizeListener=(0,_.J)(),this.state.post||await this.loadPost(),this.triggerShareOnLoad(),this.fillEmbeddedEmailInputs()}componentWillUnmount(){var e;null===(e=this.cleanEmbedResizeListener)||void 0===e||e.call(this)}async componentDidUpdate(){this.state.embeddedEmailInputsFilled||this.fillEmbeddedEmailInputs()}async loadPost(){if(this.setState({embeddedEmailInputsFilled:!1}),this.props.post)this.setState({post:this.props.post},()=>(0,y.pK)());else try{let e=await u().get("/api/v1/cross-posts/".concat(this.props.post_id));await (0,y.IW)(this,{post:e.body.post,introText:e.body.intro_text,crossPostedPub:e.body.crossPostedPub,crossPostingByLine:e.body.crossPostingByLine,userWithCrossPostedPubContext:e.body.userWithCrossPostedPubContext,crossPostedPublicationSettings:e.body.crossPostedPublicationSettings,crossPostedSiteConfig:e.body.crossPostedSiteConfig}),(0,y.pK)()}catch(e){console.error("Failed to load post:",e),alert((0,y.zx)(e))}}triggerShareOnLoad(){"share"===(0,B.x)("action")&&(window.history.replaceState({},document.title,(0,S.rhs)({action:null})),this.post&&this.post.triggerShare({fromEmail:!0}))}render(e,t){var i;let{freeSignup:n,freeSignupEmail:o,publication:a}=e,{post:s,user:d,introText:u,crossPostedPub:g,crossPostingByLine:b,userWithCrossPostedPubContext:_,crossPostedPublicationSettings:y,crossPostedSiteConfig:S}=t,B=(null==s?void 0:s.type)==="podcast",x=["video","podcast"].includes(null!==(i=null==s?void 0:s.type)&&void 0!==i?i:"");return g?(0,r.tZ)("div",{children:(0,r.BX)("div",{className:l()("single-post-container"),children:[(0,r.tZ)("div",{className:l()({container:!B}),children:(0,r.BX)("div",{className:"single-post",children:[(0,r.tZ)(Z.PostMetaTags,{post:s,publication:a}),s&&y&&S?(0,r.tZ)(v.Iz,{settings:y,children:(0,r.tZ)(f.vC,{siteConfigs:S,children:(0,r.tZ)(m.uL,{crossPost:{crossPostedPub:g},children:x?(0,r.tZ)(C.o,{ref:this.assignPost,user:_,post:s,pub:g,freeSignup:n,freeSignupEmail:o,paywall:!1,noTitleLink:!0,onChange:e=>this.setState(null!=e?e:{}),fromPostPage:!0,crossPostInfo:{introText:u,crossPostedPub:g,crossPostingByLine:b,userWithCrossPostedPubContext:_}}):(0,r.tZ)(p.SO,{ref:this.assignPost,user:_,post:s,pub:g,freeSignup:n,freeSignupEmail:o,paywall:!1,noTitleLink:!0,onChange:e=>this.setState(null!=e?e:{}),fromPostPage:!0,crossPostInfo:{introText:u,crossPostedPub:g,crossPostingByLine:b,userWithCrossPostedPubContext:_}})})})}):(0,r.tZ)(p._q,{pub:a})]})}),a.has_posts&&s?(0,r.tZ)(k.gq,{justifyContent:"center",borderTop:"detail",paddingTop:8,children:(0,r.tZ)("div",{className:"single-post-section",children:(0,r.BX)("div",{className:"container",children:[(0,r.tZ)(h.Z,{onVisible:()=>{this.onVisible("Top Posts Footer"),d&&this.context.exposeExperiment("related_posts_web")}}),(0,r.tZ)(w.h,{user:d,freeSignup:n,freeSignupEmail:o,pub:a,maxPosts:3,filterPostsPredicate:e=>e.id!==(null==s?void 0:s.id),stateInUrl:!0,sortTabs:e=>{if("treatment"===this.context.getExperimentVariant("related_posts_web")){let t=e.findIndex(e=>"related"===e.id);if(-1!==t)return c()([e[t]].concat(e.filter((e,i)=>i!==t)))}let t=e.findIndex(e=>"top"===e.id);return -1!==t?c()([e[t]].concat(e.filter((e,i)=>i!==t))):null},delayFirstLoad:1e3,source:"post",isBelowTheFold:!0,post:s})]})})}):null]})}):(0,r.tZ)("div",{})}constructor(e,t){super(e,t),(0,n._)(this,"cleanEmbedResizeListener",void 0),(0,n._)(this,"post",void 0),(0,n._)(this,"assignPost",e=>{this.post=e}),(0,n._)(this,"onVisible",e=>{let t="".concat(e," Seen");this.state.post&&(this.state[t]||(this.setState({[t]:!0}),(0,b.j)(t,{post_id:this.state.post.id,post_audience:this.state.post.audience,post_type:this.state.post.type})))}),(0,n._)(this,"fillEmbeddedEmailInputs",()=>{var e;let t=document.querySelectorAll('article.post input[type="email"]'),i=(null===(e=this.state.user)||void 0===e?void 0:e.email)||this.props.freeSignupEmail;i&&t.forEach(e=>e.value=i),this.setState({embeddedEmailInputsFilled:!0})});let{user:i}=e;e.post?this.state={post:e.post,user:i,introText:e.introText,crossPostedPub:e.crossPostedPub,crossPostingByLine:e.crossPostingByLine,userWithCrossPostedPubContext:e.userWithCrossPostedPubContext,crossPostedPublicationSettings:e.crossPostedPublicationSettings,crossPostedSiteConfig:e.crossPostedSiteConfig}:this.state={user:i}}}(0,n._)(x,"contextType",g.WH)},46611:function(e,t,i){i.d(t,{Z:()=>Z});var n=i(27412),r=i(16584),o=i(6400),a=i(94184),l=i.n(a),s=i(22072),c=i(20253),d=i(35047),u=i(33665),p=i(40647),h=i(65205),m=i(98914),g=i(15771),v=i(58175),f=i(60308),b=i(6911),_=i(63651),y=i(47929);class Z extends o.Component{componentDidMount(){(0,m.pt)((0,f.zF4)("/img/substack_wordmark.png",200));let e=this.props.freeSignupEmail||this.props.user&&this.props.user.email;if(e&&this.emailInput)this.emailInput.value=e;else if(!(0,m.K1)()){var t;null===(t=this.emailInput)||void 0===t||t.focus()}}onPrepareData(e){!this.props.pub.plans&&this.context.getConfigFor("no_embed_redirect")||this.subscribeWindow||(this.subscribeWindow=window.open("about:blank","_blank"))}onSignup(e){this.setState({freeSignup:!0,freeSignupEmail:e.body.email}),this.subscribeWindow&&(this.subscribeWindow.location=(0,_.W1P)(this.props.pub,{addBase:!0,params:{just_signed_up:!0,skip_redirect_check:!0,utm_medium:y.lP.web,utm_source:y.b3.embed,freeSignupEmail:e.body.email}}))}onError(e){if(this.subscribeWindow){try{this.subscribeWindow.close()}catch(e){console.error("Failed to close subscribe window:",e)}this.subscribeWindow=null}}render(e,t){let{pub:i,user:n,no_border:o}=e,{freeSignup:a,freeSignupEmail:p,loading:_,success:Z}=t,w=p||n&&n.email;return(0,r.BX)("div",{className:"embed-page ".concat(o?"no-border":""),children:[(0,r.BX)("div",{className:"embed-page-inner",children:[i.logo_url&&(0,r.tZ)("a",{href:"".concat(i.base_url,"/"),target:"_blank",children:(0,r.tZ)("img",{className:"publication-logo",src:(0,f.zF4)(i.logo_url,170,{quality:"auto:best"}),alt:"Logo"})}),(0,r.tZ)("h1",{className:"publication-name".concat(i.logo_url?"":" no-logo"),children:(0,r.tZ)("a",{href:"".concat(i.base_url,"/"),target:"_blank",children:(0,r.tZ)(s.Z,{text:i.name})})}),!!i.hero_text&&(0,r.tZ)("p",{className:"publication-tagline",children:(0,r.tZ)(s.Z,{text:i.hero_text})}),(0,r.tZ)("div",{className:"publication-meta",children:(0,r.tZ)(s.Z,{text:(0,d.sv)(i,{includePrice:!1,includeBadge:!0,rankingDetailOverrideText:i.rankingDetailFreeSubscriberCount,includeRankingDetail:!!i.rankingDetailFreeSubscriberCount})})}),i.invite_only?(0,r.BX)(c.ZP,{className:"subscription-request-form",ref:this.assignForm,noInlineErrors:!0,action:(0,f.n1t)("/api/v1/subscription/request"),noJsAction:(0,f.n1t)("/api/v1/subscription/request",{nojs:!0}),onSuccess:()=>this.setState({success:!0}),onError:e=>{this.setState({loading:!1}),alert((0,m.zx)(e,"Failed to request a subscription"))},children:[(0,r.tZ)("input",{type:"hidden",name:"first_url",value:h.xY}),(0,r.tZ)("input",{type:"hidden",name:"first_referrer",value:h.ip}),(0,r.tZ)("input",{type:"hidden",name:"current_url",value:h.UE}),(0,r.tZ)("input",{type:"hidden",name:"current_referrer",value:h.xU}),(0,r.tZ)("input",{type:"hidden",name:"first_session_url",value:h.ac}),(0,r.tZ)("input",{type:"hidden",name:"first_session_referrer",value:h.qR}),!!w&&(0,m.e5)(),(0,r.BX)("div",{className:"sideBySideWrap",children:[(0,r.tZ)("input",{className:l()(Z?"secondary":"primary"),type:"email",name:"email",ref:this.assignEmailInput,readOnly:!!(w||_),disabled:!!(_||Z||w),placeholder:"Type your email…"}),(0,r.tZ)(g.zx,{priority:Z?"secondary":"primary",type:"submit",disabled:!!(_||Z),onClick:()=>{this.setState({loading:!0})},children:Z?"Requested":"Subscribe"})]}),(0,r.tZ)("div",{id:"error-container"})]}):(0,r.tZ)(u.Z,{source:"embed",pub:i,user:n,freeSignup:a,freeSignupEmail:p,forceEmailInput:!0,onPrepareData:e=>this.onPrepareData(e),onSignup:e=>this.onSignup(e),onError:e=>this.onError(e)}),(0,r.tZ)("div",{className:"embed-tos",children:(0,r.BX)(v.xv.B4,{color:"pub-secondary-text",size:12,lineHeight:16,align:"center",children:["By subscribing you agree to"," ",(0,r.tZ)("a",{className:"tos-text",target:"_blank",rel:"noopener",href:(0,b.P8)({pub:i,utm_source:"embed_publication"}),children:"Substack's Terms of Use"}),", ",(0,r.tZ)("a",{className:"tos-text",target:"_blank",rel:"noopener",href:(0,b.RF)({pub:i,utm_source:"embed_publication"}),children:"our Privacy Policy"})," ","and"," ",(0,r.tZ)("a",{className:"tos-text",target:"_blank",rel:"noopener",href:(0,b.WF)({utm_source:"embed_publication"}),children:"our Information collection notice"})]})}),(n||a)&&(0,r.tZ)("p",{className:"sign-out-block",children:(0,r.tZ)("span",{className:"account-info-logout",children:(0,r.tZ)("a",{href:(0,f.ZPN)({redirect:document.location.href,for_pub:i.subdomain}),native:!0,children:"Sign out"})})})]}),(0,r.tZ)("a",{href:"".concat((0,f.ZJn)(),"/?utm_source=").concat(y.b3.embed,"&utm_content=").concat(i.subdomain),target:"_blank",children:(0,r.tZ)("img",{ref:this.assignImg,className:"substack-watermark",src:(0,f.zF4)("/img/substack_wordmark.black.png",200),onMouseEnter:()=>{this.img&&(this.img.src=(0,f.zF4)("/img/substack_wordmark.png",200))},onMouseLeave:()=>{this.img&&(this.img.src=(0,f.zF4)("/img/substack_wordmark.black.png",200))},alt:"Substack"})})]})}constructor(e,t){super(e,t),(0,n._)(this,"emailInput",void 0),(0,n._)(this,"subscribeWindow",void 0),(0,n._)(this,"form",void 0),(0,n._)(this,"img",void 0),(0,n._)(this,"assignEmailInput",e=>{this.emailInput=e}),(0,n._)(this,"assignForm",e=>{this.form=e}),(0,n._)(this,"assignImg",e=>{this.img=e}),this.state={freeSignup:e.freeSignup,freeSignupEmail:e.freeSignupEmail,success:!1}}}(0,n._)(Z,"contextType",p.QA)},50806:function(e,t,i){i.d(t,{Z:()=>u});var n=i(16584),r=i(30396),o=i(80569),a=i.n(o),l=i(16564),s=i(86657),c=i(98914),d=i(69332);let u=e=>{var t,i;let{pub:o,slug:u}=e,[p,h]=(0,r.eJ)(null);(0,r.d4)(()=>{!async function(){try{let e=await a().get("/api/v1/posts/".concat(u));h(e.body)}catch(e){console.error("Failed to load post:",e),404===e.status?alert("Post not found"):alert((0,c.zx)(e))}}()},[u]);let m=!1;return"undefined"!=typeof window&&(m="1"===(null!==(t=(0,d.m)(window.location.href).autoplay)&&void 0!==t?t:"0")),p?(0,n.tZ)(s.Z,{feature:l.MR.Podcast,pub:o,post:p,src:p.podcast_url,autoPlay:m,metricsPost:p,isFancy:!0,showCTAs:!0,mediaUpload:null!==(i=p.podcastUpload)&&void 0!==i?i:void 0,trackingProps:{surface:"external",contentType:"post",entityType:"post",entityKey:p.id}}):(0,n.tZ)("div",{className:"loading-container"})}},17393:function(e,t,i){i.d(t,{Z:()=>r});var n=i(16584);function r(){return(0,n.tZ)("div",{className:"embed-test-page",children:(0,n.tZ)("iframe",{style:{border:"1px solid #EEE",background:"white"},width:"480",height:"320",src:"/embed",frameBorder:"0",scrolling:"no"})})}},30792:function(e,t,i){i.d(t,{Z:()=>p});var n=i(16584),r=i(30396),o=i(80569),a=i.n(o),l=i(12281),s=i(98914),c=i(98422),d=i(18618),u=i(69332);let p=e=>{var t,i;let{pub:o,slug:p}=e,[h,m]=(0,r.eJ)(null),{isMobile:g}=(0,c.v9)();(0,r.d4)(()=>{!async function(){try{let e=await a().get("/api/v1/posts/".concat(p));m(e.body)}catch(e){console.error("Failed to load post:",e),404===e.status?alert("Post not found"):alert((0,s.zx)(e))}}()},[p]);let v=!1;return"undefined"!=typeof window&&(v="1"===(null!==(t=(0,u.m)(window.location.href).autoplay)&&void 0!==t?t:"0")),(null==h?void 0:h.videoUpload)?(0,n.tZ)("div",{className:"video-player-embed-container",children:(0,n.tZ)(l.Z,{mediaUpload:h.videoUpload,pub:o,autoPlay:v,videoType:"video-embed",renderPlayButton:()=>(0,n.tZ)(d.fI,{isPlaying:!1,size:g?40:56}),contentType:"embed",entityType:"post",entityKey:null!==(i=null==h?void 0:h.id)&&void 0!==i?i:"unknown",surface:"external"})}):(0,n.tZ)("div",{className:"loading-container"})}},80074:function(e,t,i){i.d(t,{Z:()=>h});var n=i(16584),r=i(30396),o=i(7409),a=i(99282),l=i(64515);let s=e=>(0,n.tZ)(l.l,(0,a._)((0,o._)({},e),{name:"ChevronIcon",svgParams:{height:24,width:24,stroke:"#666666",viewBox:"0 0 24 24"},children:(0,n.tZ)("path",{d:"M9.88507 18.9609L15.8851 12.9609L9.88507 6.96094",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})),c=e=>(0,n.BX)(l.l,(0,a._)((0,o._)({},e),{name:"DownloadIcon",svgParams:{height:32,width:32},children:[(0,n.tZ)("rect",{width:"32",height:"32",rx:"6",fill:e.fill||"black"}),(0,n.tZ)("path",{d:"M23.5 18.5V21.8333C23.5 22.2754 23.3244 22.6993 23.0118 23.0118C22.6993 23.3244 22.2754 23.5 21.8333 23.5H10.1667C9.72464 23.5 9.30072 23.3244 8.98816 23.0118C8.67559 22.6993 8.5 22.2754 8.5 21.8333V18.5",stroke:e.stroke||"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,n.tZ)("path",{d:"M11.8333 14.3335L16 18.5002L20.1667 14.3335",stroke:e.stroke||"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,n.tZ)("path",{d:"M16 18.5V8.5",stroke:e.stroke||"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})),d=e=>(0,n.BX)(l.l,(0,a._)((0,o._)({},e),{name:"PanelsIcon",svgParams:{height:32,width:32},children:[(0,n.tZ)("rect",{width:"32",height:"32",rx:"6",fill:"black"}),(0,n.tZ)("rect",{x:"7.19995",y:"7.2002",width:"8.49554",height:"11.8938",rx:"0.424777",fill:"white"}),(0,n.tZ)("rect",{opacity:"0.7",x:"7.19995",y:"19.603",width:"8.49554",height:"6.79643",rx:"0.424777",fill:"white"}),(0,n.tZ)("path",{opacity:"0.7",d:"M16.2048 7.62497C16.2048 7.39037 16.395 7.2002 16.6296 7.2002H20.4526C23.737 7.2002 26.3995 9.8627 26.3995 13.1471C26.3995 16.4314 23.737 19.094 20.4526 19.094H16.6296C16.395 19.094 16.2048 18.9038 16.2048 18.6692V7.62497Z",fill:"white"})]}));var u=i(60308),p=i(84864);function h(e){var t;let{file:i="undefined"!=typeof window&&"file"in window._preloads&&(null===(t=window._preloads)||void 0===t?void 0:t.file)||{},pub:o}=e,[a,l]=(0,r.eJ)(null);return(0,r.d4)(()=>{(async()=>{if(!i.fileKey){let e=await fetch("/api/v1/file/entry/".concat(window.location.pathname.split("/").pop()));e.redirected&&(window.location.href=e.url),l(await e.json())}})()},[i.fileKey]),(0,n.tZ)(m,{file:a||i,pub:o})}function m(e){var t,i,r,o;let{file:a,pub:l}=e;if(!a.id)return(0,n.tZ)("div",{className:"page",children:(0,n.BX)("div",{className:"container",children:[(0,n.tZ)("h3",{children:"Read Now"}),(0,n.tZ)("div",{className:"popup-container",children:(0,n.tZ)("div",{className:"overlay"})})]})});let h=null===(i=a.file_key)||void 0===i?void 0:null===(t=i.split(".").pop())||void 0===t?void 0:t.toUpperCase(),m=(0,p.numberToHumanFileSize)(a.num_bytes),g=(r=null!=h?h:"","".concat(null===(o=a.title)||void 0===o?void 0:o.toLowerCase().replace(/\s/g,"_"),".").concat(r.toLowerCase()));return(0,n.tZ)("div",{className:"page",children:(0,n.BX)("div",{className:"container",children:[(0,n.BX)("span",{className:"table-list-title",children:[(0,n.tZ)("h3",{children:"Read Now"}),(0,n.tZ)("a",{className:"file-sidebar-header-button",href:"".concat((0,u.SVA)(l),"/p/").concat(a.post_id),children:"Back"})]}),(0,n.BX)("div",{className:"table-list",children:[(0,n.BX)("div",{className:"table-list-row table-list-header",children:[(0,n.tZ)("img",{className:"table-list-thumbnail ".concat(a.thumbnail&&-1===a.thumbnail.indexOf("/img/attachment_icon.svg")?"":"default"),src:a.thumbnail||"".concat((0,u.SVA)(l),"/img/attachment_icon.svg")}),(0,n.BX)("div",{className:"table-list-col",children:[(0,n.tZ)("div",{className:"table-list-h1",children:a.title||"Unknown File"}),(0,n.BX)("div",{className:"table-list-h2",children:[m," ∙ ",h," File"]})]})]}),(0,n.BX)("a",{className:"table-list-row table-list-item",href:"".concat((0,u.SVA)(l),"/api/v1/file/panels/").concat(a.file_key),children:[(0,n.tZ)(d,{}),(0,n.BX)("span",{className:"table-list-grow",children:[(0,n.tZ)("div",{className:"table-list-h1",children:"Open in Panels"}),(0,n.tZ)("div",{className:"table-list-h2",children:"Comic reader for iOS"})]}),(0,n.tZ)(s,{stroke:"#666",strokeWidth:0,isStatic:!0})]}),(0,n.BX)("a",{className:"table-list-row table-list-item",download:g,href:"".concat((0,u.SVA)(l),"/api/v1/file/").concat(a.file_key),children:[(0,n.tZ)(c,{}),(0,n.BX)("span",{className:"table-list-grow",children:[(0,n.tZ)("div",{className:"table-list-h1",children:"Download file"}),(0,n.tZ)("div",{className:"table-list-h2",children:g})]}),(0,n.tZ)(s,{stroke:"#666",strokeWidth:0,isStatic:!0})]})]})]})})}},96494:function(e,t,i){i.d(t,{Z:()=>d});var n=i(27412),r=i(16584),o=i(6400),a=i(80569),l=i.n(a),s=i(42493),c=i(98914);class d extends o.Component{componentDidMount(){this.props.user||(0,c.rf)()}render(e,t){let{pub:i,post:n,user:o,freeSignup:a,freeSignupEmail:l,inviteToPost:c,primaryEligiblePublications:d,switchAccountRedirectUrl:u}=e,{error:p}=t;if(p)return(0,r.BX)("div",{className:"container invite-success",children:[(0,r.tZ)("h3",{children:"Error"}),(0,r.tZ)("p",{children:p})]});let h=c&&n&&"podcast"===n.type,m=h&&o?"Fill out your profile for your podcast appearance":h&&!o?"Set up your profile for your podcast appearance":c&&o?"Set up your profile":c&&!o?"Fill out your profile":"Your invite to ".concat(i.name),g=h?"Listeners will want to know more about you. Use your profile as a chance to express yourself.":c?"Readers will want to know more about you and even follow your writing. Use your profile as a chance to express yourself.":"Before you can accept your invite, finish setting up your profile:",v=c?"Update Profile & Accept Invite":"Accept Invite",f=o?"Already a writer?":"Already have an account?",b=o?"Switch accounts":"Login";return(0,r.BX)("div",{className:"container finish-invite",children:[(0,r.tZ)("h3",{children:m}),(0,r.tZ)("p",{children:g}),(0,r.tZ)(s._0,{pageTitle:"",user:o,freeSignup:a,freeSignupEmail:l,needsPhoto:!1,optionalPhoto:c,isPostInvite:c,primaryEligiblePublications:d,onSuccess:this.acceptInvite,text:v}),c&&u&&(0,r.BX)("div",{className:"invite-switch-account",children:[f," ",(0,r.tZ)("a",{href:u,children:b})]})]})}constructor(...e){super(...e),(0,n._)(this,"acceptInvite",async()=>{try{var e,t;let i=await l().post("/api/v1/publication_user_invite/".concat(this.props.matches.id,"/accept"));(null===(e=i.body)||void 0===e?void 0:e.postUrl)?location.href=null===(t=i.body)||void 0===t?void 0:t.postUrl:(0,c.uX)("/invite-success/".concat(this.props.matches.id))}catch(t){let e=(0,c.zx)(t);this.setState({error:e})}})}}(0,n._)(d,"defaultProps",{inviteToPost:!1,primaryEligiblePublications:[]})},49116:function(e,t,i){i.d(t,{E:()=>d});var n=i(16584),r=i(6400),o=i(20253),a=i(12620),l=i(32351),s=i(15771),c=i(84864);class d extends r.Component{renderNotAvailable(e){let{time:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,n.BX)("div",{className:"container reward-page gift-reward-page",children:[(0,n.tZ)("h2",{children:"All gone"}),e,(0,n.BX)("p",{children:["Sorry, ",t?"this gift has expired":"all of these gifts have already been claimed",". You can still subscribe if you like."]}),(0,n.tZ)("div",{className:"signup",children:(0,n.tZ)(a.Z,{source:"viral_gift_none_left",pub:this.props.pub,onSuccess:()=>{document.location.href="/subscribe"}})})]})}renderForSender(){var e;return[(0,n.BX)("h3",{className:"sender-hint",children:[(0,n.BX)("span",{children:[(e=this.props.user).name?e.name.trim().split(/\s+/g)[0]:e.email.split("@")[0],", share this page to give your gift"]}),(0,n.tZ)("a",{className:"button twitter-button",href:this.props.viral_gift_data.tweet_link,native:!0,children:"Share on Twitter"})]})]}render(e){var t;let{pub:i,t:r,user:a,freeSignupEmail:d,viral_gift_data:u}=e,{sender_name:p,count_remaining:h,sender_id:m}=u,g=(0,c.getGiftValueText)(null!==(t=i.plans)&&void 0!==t?t:[]),v=g?" (value: ".concat(g,")"):"",f="A three-month subscription to ".concat(i.name).concat(v),b=(0,n.tZ)(l.Metadata,{title:"Accept ".concat(p||"your friend","'s gift"),description:f,image:i.logo_url});if(!r||!h)return this.renderNotAvailable(b);let _=null;a&&a.id==m&&(_=this.renderForSender());let y="",Z=d||"";return a&&!_&&(y=a.name,Z=a.email),(0,n.BX)("div",{className:"container reward-page receive-page",children:[_,b,(0,n.tZ)("h2",{children:"Accept Gift Subscription"}),(0,n.BX)("p",{children:[p||"Your friend"," would like to give you a free, three-month subscription. ",v]}),(0,n.tZ)("p",{children:(0,n.tZ)("b",{children:"".concat(h," left")})}),(0,n.BX)(o.ZP,{action:"/api/v1/viral_gifts/accept_gift_from_link",onSuccess:()=>document.location.href="/account/gifts/accept",children:[(0,n.tZ)("input",{type:"text",name:"name",placeholder:"Your name",value:y}),(0,n.tZ)("input",{type:"email",name:"email",placeholder:"Your email",value:Z}),(0,n.tZ)("input",{type:"hidden",value:r,name:"token"}),(0,n.tZ)("div",{id:"error-container"}),(0,n.tZ)("div",{className:"button-container",children:(0,n.tZ)(s.zx,{priority:"primary",type:"submit",children:"Accept Gift"})})]})]})}}},41633:function(e,t,i){i.d(t,{B:()=>u});var n=i(16584),r=i(347),o=i(33578),a=i(63391),l=i(15400),s=i(6207),c=i(30733),d=i(19680);let u=e=>{var t,i,u;let{author_id_or_slug:p,authorInfo:h,posts:m,pub:g,user:v,utm:f}=e,{authorInfo:b,posts:_}=(0,d.e)({author_id_or_slug:p,authorInfoPreload:h,postsPreload:m,pub:g});return b&&_?(0,n.tZ)(c.N,{children:(0,n.BX)(r.h,{children:[(0,n.tZ)(s.M,{description:null!==(t=b.bio)&&void 0!==t?t:null,logoUrl:null!==(i=b.photo_url)&&void 0!==i?i:null,name:null!==(u=b.name)&&void 0!==u?u:"",pub:g}),(0,n.tZ)(a.f,{}),(0,n.tZ)(o.O,{authorId:b.user_id,newPosts:_,pub:g,sort:"new",source:"author-archive",user:v,utm:f,children:e=>{var t;let{posts:i,linkToComments:r,onClickPost:o}=e;return(0,n.tZ)(l.B,{hideImages:null===(t=g.theme)||void 0===t?void 0:t.hide_images_from_list,linkToComments:r,posts:i,variant:"two-column-list",onClickPost:o})}})]})}):null}},58375:function(e,t,i){i.d(t,{h:()=>m});var n=i(16584),r=i(30396),o=i(49995),a=i(95050),l=i(75801),s=i(3),c=i(76404),d=i(26190),u=i(33417),p=i(91400),h=i(40121);let m=e=>{let{blurbs:t,freeSignup:i,freeSignupEmail:m,hide_intro_popup:g,notify_user:v,pub:f,referralCode:b,showWelcome:_,user:y,launchWelcomePage:Z,skipIntroPopupRender:w,initialData:k,subpath:C}=e;(0,r.d4)(()=>{v&&"undefined"!=typeof window&&(0,o.ZP)(v)},[v]);let S=(0,p.XA)();if(!f.theme)return null;let B=["subscribers","followers","following"].includes(C),x=f.author_handle||"".concat(f.author_id,"-").concat((0,h.Of)(f.author_name));return(0,n.BX)("div",{className:"home-page home-page--modular",children:[(0,n.tZ)(a.PageMetaData,{isHomepage:!0,pub:f}),(0,n.tZ)("div",{className:"profile-theme",children:k&&(0,n.BX)(n.HY,{children:[!S&&(0,n.tZ)(s.r,{drawer:null,native:!0,requireLogin:null}),!B&&(0,n.tZ)("div",{className:"reader-nav-page",children:(0,n.tZ)(d.Gk,{id:x,initialData:k,subpath:C?"/".concat(C):"/"})}),C&&B&&(0,n.tZ)("div",{className:"profile-connections",children:(0,n.tZ)(u.S,{id:x,subpath:"/".concat(C)})}),S&&(0,n.tZ)(c.I,{})]})}),w?null:(0,n.tZ)(l.L,{blurbs:t,freeSignup:i,freeSignupEmail:m,hide_intro_popup:g,launchWelcomePage:Z,pub:f,referralCode:b,showWelcome:_,user:y})]})}},6207:function(e,t,i){i.d(t,{M:()=>p});var n=i(16584),r=i(94184),o=i.n(r),a=i(98422),l=i(19081),s=i(58175),c=i(6070),d=i(60308);let u={logo:"logo-Q8LqG3",pillarHeader:"pillarHeader-Q57NYM"},p=e=>{var t;let{description:i,logoUrl:r,name:p,pub:h}=e,{isMobile:m}=(0,a.v9)();return(0,n.BX)(l.tu,{gap:12,paddingX:8*!m,children:[r&&(0,n.tZ)("img",{alt:p,className:u.logo,src:(0,d.zF4)(r,144)}),(0,n.tZ)(s.xv.H1,{className:o()({[null!==(t=u.pillarHeader)&&void 0!==t?t:""]:(0,c.kb)({pub:h})}),color:"pub-primary-text",font:"pub-headings",children:p}),i&&(0,n.tZ)(s.xv.B3,{color:"pub-secondary-text",children:i})]})}},98422:function(e,t,i){i.d(t,{qU:()=>c,v9:()=>s});var n=i(30396),r=i(1852),o=i(80569),a=i.n(o),l=i(81821);let s=()=>{let e;let t=(0,l.tq)(),i=(0,r.useMediaQuery)({query:"only screen and (max-width: 1024px)"}),o=(0,r.useMediaQuery)({query:"only screen and (max-width: 768px)"}),a=(0,r.useMediaQuery)({query:"(orientation: landscape)"});return e="undefined"==typeof window?t?"mobile":"desktop":o?"mobile":i?"tablet":"desktop",(0,n.Ye)(()=>({breakpoint:e,isMobile:"mobile"===e,isMobileLandscape:t&&a,isTablet:"tablet"===e,isDesktop:"desktop"===e}),[e,a,t])},c=e=>{let{preloadedHomepageData:t,isPreview:i}=e,[r,o]=(0,n.eJ)(null);return(0,n.d4)(()=>{let e=async()=>{o((await a().get("/api/v1/homepage_data").query({preview:i})).body)};t||e()},[t,i]),null!=t?t:r}},60885:function(e,t,i){i.d(t,{DE:()=>l,QI:()=>s});var n=i(16584),r=i(6400),o=i(30396);let a=(0,r.createContext)({getPubPinInfo:()=>({showPin:!1}),getSectionPinInfo:()=>({showPin:!1})}),l=()=>(0,o.qp)(a),s=e=>{let{children:t,pub:i,showPubPins:r,showSectionPins:l}=e,s=(0,o.I4)(e=>{var t;let{post:n}=e;return{showPin:r&&!!(null===(t=n.pins)||void 0===t?void 0:t.includes(i.id))}},[i.id,r]),c=(0,o.I4)(e=>{let{post:t}=e;return{showPin:l&&t.is_section_pinned}},[l]);return(0,n.tZ)(a.Provider,{value:{getPubPinInfo:s,getSectionPinInfo:c},children:t})}},19680:function(e,t,i){i.d(t,{e:()=>c});var n=i(7409),r=i(99282),o=i(39693),a=i.n(o),l=i(7882),s=i(40121);let c=e=>{var t,i;let{author_id_or_slug:o,authorInfoPreload:c,postsPreload:d,pub:u}=e,p=!!(0,s.FQ)({slugOrId:o,pub:(0,r._)((0,n._)({},u),{authorPagesInfo:a()([c])})}),h=(0,l.ib)({pathname:"/w/".concat(o,"/info"),auto:!p,initialResult:p&&c&&d?{authorInfo:c,posts:d}:void 0,deps:[o]});return{authorInfo:null===(t=h.result)||void 0===t?void 0:t.authorInfo,posts:null===(i=h.result)||void 0===i?void 0:i.posts}}},18304:function(e,t,i){i.d(t,{Z:()=>h});var n=i(27412),r=i(16584),o=i(6400),a=i(80569),l=i.n(a),s=i(20253),c=i(98914),d=i(15771),u=i(98012),p=i(84864);class h extends o.Component{componentDidMount(){if(!this.hasInvites()){(0,c.gN)(this.props.pub);return}this.loadInvites()}hasInvites(){let{pub:e,user:t}=this.props;return!!e.invite_only&&(!!t&&!!t.is_contributor||!!(e.subscriber_invites>0)&&!!t&&!!t.is_subscribed)}async loadInvites(){try{let e=await l().get("/api/v1/publication/invite");this.setState({invites:e.body,loading:!1})}catch(e){console.error("Failed to fetch invites:",e),alert((0,c.zx)(e))}}render(e,t){let{pub:i,user:n}=e,{loading:o,invites:a}=t;if(!this.hasInvites())return(0,r.tZ)("p",{className:"main-loader",children:"Loading…"});let l=n&&n.is_contributor,c=Math.max(n&&n.invites,a.length),h=Math.max(c,i.subscriber_invites),m=h-c;return(0,r.tZ)("div",{className:"invite-page page",children:(0,r.BX)("div",{className:"container",children:[(0,r.tZ)("h3",{children:"Your invites"}),(0,r.BX)("p",{children:[i.name," is invite-only, but you’ve been granted"," ",l?"an infinite number of invites":(0,p.pluralize)(h,"invite")," to give out."]}),(m>0||l)&&[!l&&(0,r.BX)("h5",{children:["You have ",(0,p.pluralize)(m,"invite")," left"]}),(0,r.BX)(s.ZP,{ref:this.assignForm,action:"/api/v1/publication/invite",onSuccess:this.onSuccess,noInlineErrors:!0,children:[(0,r.BX)("div",{className:"sideBySideWrap",children:[(0,r.tZ)("input",{type:"text",name:"name",placeholder:"Name…"}),(0,r.tZ)("input",{type:"text",name:"email",placeholder:"Email…"}),(0,r.tZ)(d.zx,{priority:"primary",type:"submit",children:"Invite"})]}),(0,r.tZ)("div",{id:"error-container"})]})],o&&c>0?(0,r.BX)("p",{children:[(0,r.tZ)("br",{}),"Loading…"]}):a.length>0?[(0,r.tZ)("h5",{children:"Used invites"}),(0,r.tZ)("ul",{children:a.sort((e,t)=>new Date(t.created_at).getTime()-new Date(e.created_at).getTime()).map(e=>(0,r.BX)("li",{children:[e.inviteeUser&&e.inviteeUser.name||""," on"," ",(0,u.Z)(e.created_at).standardDate()]}))})]:null]})})}constructor(...e){super(...e),(0,n._)(this,"form",void 0),(0,n._)(this,"assignForm",e=>{this.form=e}),(0,n._)(this,"state",{loading:!0,invites:[]}),(0,n._)(this,"onSuccess",async()=>{alert("Invite sent!"),document.location.reload()})}}},74562:function(e,t,i){i.d(t,{Z:()=>s});var n=i(16584),r=i(15771),o=i(19081),a=i(58175),l=i(60308);function s(e){let{pub:t,post:i}=e;return(0,n.BX)(o.tu,{alignItems:"center",className:"container",gap:32,children:[(0,n.BX)(o.tu,{alignItems:"center",gap:4,children:[(0,n.tZ)(o.tu,{paddingTop:24,paddingBottom:16,children:(0,n.BX)(a.xv.H1,{children:["You rejected your invite to ",t.name]})}),(0,n.tZ)(a.xv.B3,{children:"If you change your mind, you can accept from your email invitation."}),i.is_published?(0,n.BX)(a.xv.B3,{children:["Your byline has been removed from this post: ",(0,n.tZ)("a",{href:(0,l.uRy)(t,i),children:i.title})]}):null]}),(0,n.tZ)(r.zx,{href:t.base_url,children:"Go to ".concat(t.name)})]})}},22622:function(e,t,i){i.d(t,{Z:()=>d});var n=i(16584),r=i(30396),o=i(94499),a=i(42493),l=i(15771),s=i(19081),c=i(58175);function d(e){let{pub:t,user:i,post:d,freeSignup:u,freeSignupEmail:p}=e,h=(0,r.sO)(null);if(!d)return(0,n.tZ)(s.tu,{paddingTop:32,children:(0,n.BX)("div",{className:"container invite-success",children:[(0,n.BX)("p",{children:["You accepted your invite to ",t.name,"."]}),(0,n.tZ)("p",{children:"If you need admin access, ask your inviter to change your status in the publication settings."}),(0,n.BX)("p",{children:["If you expect to be shown on this publication's author list, make sure your"," ",(0,n.tZ)(o.Z,{onClick:()=>h.current&&h.current.open(),children:"profile is up to date"})]}),(0,n.tZ)(a.EB,{ref:h,user:i,freeSignup:u,freeSignupEmail:p,needsPhoto:!0})]})});let m="podcast"===d.type?"We’ll let you know when the podcast episode goes live":"We’ll let you know when your guest post is live";return(0,n.BX)(s.tu,{alignItems:"center",className:"container",gap:32,children:[(0,n.BX)(s.tu,{alignItems:"center",gap:4,children:[(0,n.tZ)(s.tu,{paddingTop:24,paddingBottom:16,children:(0,n.tZ)(c.xv.H1,{children:m})}),(0,n.tZ)(c.xv.B3,{children:"Your profile is set up and good to go!"})]}),(0,n.tZ)(l.zx,{href:t.base_url,children:"Go to ".concat(t.name)})]})}},47651:function(e,t,i){i.d(t,{A:()=>V});var n=i(7409),r=i(99282),o=i(58865),a=i(16584),l=i(30396),s=i(94184),c=i.n(s),d=i(32224),u=i(25380),p=i(46621),h=i(80569),m=i.n(h),g=i(39432),v=i(41286),f=i(98435),b=i(85685),_=i(96220),y=i(95441),Z=i(19081),w=i(58175),k=i(22838);function C(){let e=(0,o._)(["You're here!"]);return C=function(){return e},e}let S=e=>{let{isSelected:t,tier:i}=e,{iString:n,iTemplate:r,iPlural:o}=(0,y.M1)(),l={[k.E4.CompOneMonth]:n("1 month comp"),[k.E4.CompThreeMonths]:n("3 month comp"),[k.E4.CompSixMonths]:n("6 month comp"),[k.E4.CompNineMonths]:n("9 month comp"),[k.E4.CompTwelveMonths]:n("12 month comp"),[k.E4.Custom]:n("Custom")};return(0,a.BX)(Z.tu,{className:"rewardBox-wSCnji",border:"detail-themed",radius:"md",justifyContent:"space-between",alignItems:"center",flex:"grow",paddingTop:{desktop:20,mobile:20},paddingBottom:{desktop:8,mobile:8},paddingX:{desktop:8,mobile:8},sizing:"border-box",style:{borderColor:t?"var(--color-accent-themed)":void 0},children:[(0,a.tZ)(Z.gq,{gap:4,alignItems:"center",children:Array(i.display_order).fill(0).map(()=>(0,a.tZ)(_.Z,{size:20,fill:"var(--color-accent-themed)",stroke:"var(--color-accent-themed)"}))}),(0,a.tZ)(w.xv.H4,{weight:"bold",font:"pub-headings",color:"pub-primary-text",textAlign:"center",textWrap:"balance",children:"custom"===i.reward_type?i.reward_description:l[i.reward_type]}),(0,a.tZ)(w.xv.Meta,{weight:"semibold",style:{color:t?"var(--color-accent-themed)":void 0},children:t?r(C()):o("1 Referral","%1 Referrals",i.num_referrals_required)})]})};var B=i(68833),x=i(65205),I=i(7882),P=i(52384),N=i(98914),T=i(94874),E=i(71068),X=i(15771),L=i(38841),F=i(51776),R=i(70379),M=i(60308),U=i(26111),A=i(63651),D=i(47929);let O={wrapper:"wrapper-tJi0TK",headerWrapper:"headerWrapper-EjRfuK",copyLinkInput:"copyLinkInput-AiXniG",copyLinkButton:"copyLinkButton-K98yGk",shareButton:"shareButton-JVF5KK",referrerRow:"referrerRow-N5KSEa",referrerRowInverted:"referrerRowInverted-CeLqXo",referrerLink:"referrerLink-nE7Cs1",responsiveHeader:"responsiveHeader-yuaZkv",shareButtons:"shareButtons-xB8IiL"};function z(){let e=(0,o._)(["You’ve qualified for the Tier "," reward."]);return z=function(){return e},e}function j(){let e=(0,o._)(["Refer friends to ",""]);return j=function(){return e},e}function H(){let e=(0,o._)(["Subscribe and invite friends to ",""]);return H=function(){return e},e}function W(){let e=(0,o._)(["No referrers yet. Be the first on ","'s leaderboard by helping them find new readers."]);return W=function(){return e},e}let q=(e,t)=>{(0,B.j)(B.FP.SHARE_LINK_CLICKED,{name:t,source:"leaderboard"}),e&&(e.startsWith("http")?window.open(e,"_blank"):document.location.href=e)},Y=e=>{let{user:t,rank:i,referrals:n,isSelf:r,isHighlighted:o}=e,{iString:l}=(0,y.M1)();return(0,a.tZ)(w.xv,{as:t?"a":"div",href:t?(0,A.GR3)(t.id,t.name):void 0,className:O.referrerLink,children:(0,a.BX)(Z.gq,{sizing:"border-box",style:{width:"100%"},alignItems:"center",border:r||o?"detail-themed":"transparent",radius:"md",paddingLeft:12,paddingY:r?16:8,paddingRight:20,justifyContent:"space-between",className:c()(O.referrerRow,{[O.referrerRowInverted]:!r}),children:[(0,a.BX)(Z.gq,{gap:8,alignItems:"center",children:[(0,a.BX)(w.xv.Digit,{weight:"semibold",paddingRight:4,color:"pub-primary-text",children:[i,"."]}),t?(0,a.tZ)(b.ProfileHoverCard,{subject:t,dontStopPropagation:!1,children:(0,a.tZ)(T.qE,{size:36,user:t})}):(0,a.tZ)(T.qE,{size:36,showProfileHovercard:!1}),(0,a.tZ)(w.xv.B4,{color:"pub-primary-text",weight:"semibold",children:(null==t?void 0:t.name)||l("Anonymous Reader")})]}),(0,a.tZ)(w.xv.B4,{color:"pub-primary-text",weight:"semibold",children:n})]})})},V=e=>{let t,i,{pub:o,user:s,freeSignupEmail:c}=e,{iString:h,iTemplate:b,iPlural:_}=(0,y.M1)(),k=(0,R.pm)(),{result:C,isLoading:T,refetch:V}=(0,I.ib)({pathname:"/api/v1/reader_referrals/leaderboard",auto:!0}),{refetch:J}=(0,P.Q)({auto:!1,pathname:"/api/v1/subscription/visibilities",method:"post"});if((0,l.d4)(()=>{T||C||(0,N.uX)((0,A.SVA)(o))},[C,T,o]),T||!C)return(0,a.tZ)("div",{className:"page typography signup-page",children:(0,a.tZ)("div",{className:"container"})});let{current_user_stats:K,tiers:G,top_referrers:Q,current_user_can_share:$,current_user_id:ee,current_user_profile_hidden:et}=C,ei=null==s?void 0:s.is_admin,en=null==s?void 0:s.is_contributor,er=(0,U.x)("referrer_token"),eo=s&&!s.is_magic&&s.email||c||null,ea=(0,A.n1t)((0,A.SVA)(o),{r:(null==ee?void 0:ee.toString(36))||er});G.find((e,n)=>{let r=(null==K?void 0:K.referrals)||0,o=G[n+1];r>=e.num_referrals_required&&(!o||r{let t;e.preventDefault();try{eo&&(t=(await m().post("/api/v1/free").send({source:"referral-leaderboard",email:eo,first_url:x.xY,first_referrer:x.ip,current_url:x.UE,current_referrer:x.xU,first_session_url:x.ac,first_session_referrer:x.qR})).body.referral_token,(0,B.IU)())}catch(e){(0,B.j)(B.FP.FREE_SIGNUP_FAILED,{reason:e.message,source:"referral-leaderboard"})}window.location.href=(0,A.W1P)(o,{addBase:!0,params:{simple:!0,next:document.location.href,utm_source:D.b3.referralLeaderboard,utm_medium:D.lP.web,skip_redirect_check:!0,just_signed_up:!0,referral_token:t}})},href:(0,A.n1t)("/subscribe",{next:(0,A.j8T)(o,void 0,{addBase:!0}),utm_source:D.b3.referralLeaderboard}),localNavigation:!1,children:(0,a.BX)(Z.gq,{alignItems:"center",gap:8,children:[(0,a.tZ)(d.Z,{size:20}),h("Subscribe")]})})})]})}),($||en||ei||er)&&(0,a.BX)(Z.tu,{alignItems:"center",gap:16,style:{width:"100%"},children:[(0,a.BX)(Z.gq,{style:{width:"100%"},children:[(0,a.tZ)(F.oi,{className:O.copyLinkInput,flex:"grow",readOnly:!0,value:ea}),(0,a.tZ)(X.zx,{className:O.copyLinkButton,priority:"primary",onClick:()=>{(0,B.j)(B.FP.SHARE_LINK_CLICKED,{name:"copy",source:"leaderboard"}),(0,N.vQ)(ea),k.popToast(e=>(0,a.tZ)(R.FN,(0,r._)((0,n._)({},e),{Icon:u.Z,text:h("Copied link to clipboard")})))},children:h("Copy link")})]}),(0,a.BX)(Z.hs,{className:O.shareButtons,gap:{desktop:16,mobile:8},style:{width:"100%"},children:[(0,a.tZ)(X.zx,{className:O.shareButton,priority:"secondary",leading:(0,a.tZ)(f.Z,{width:18,height:18,style:{paddingTop:2}}),onClick:()=>q((0,M.LaP)({url:ea,text:o.name}),"twitter"),children:"Twitter"}),(0,a.tZ)(X.zx,{className:O.shareButton,priority:"secondary",leading:(0,a.tZ)(v.Z,{height:20,width:20}),onClick:()=>q((0,A.n1t)("https://www.facebook.com/sharer/sharer.php",{u:ea}),"facebook"),children:"Facebook"}),(0,a.tZ)(X.zx,{className:O.shareButton,priority:"secondary",leading:(0,a.tZ)(g.Z,{strokeWidth:1,height:20,width:20,style:{paddingTop:2}}),onClick:()=>q((0,A.n1t)("mailto:",{subject:o.name,body:ea}),"email"),children:"Email"})]})]}),(0,a.BX)(Z.tu,{alignItems:"start",style:{width:"100%"},gap:16,children:[(0,a.tZ)(w.xv.H3,{translated:!0,font:"pub-headings",color:"pub-primary-text",children:"Rewards and Progress"}),(0,a.tZ)(Z.gq,{gap:{desktop:16,mobile:12},style:{width:"100%"},children:G.map(e=>(0,a.tZ)(S,{tier:e,isSelected:e.display_order===(null==t?void 0:t.display_order)},e.display_order))}),$&&K&&(0,a.BX)(Z.tu,{gap:8,style:{width:"100%"},alignItems:"center",children:[(0,a.tZ)(Y,{user:s,isSelf:!0,referrals:K.referrals,rank:K.rank}),!et&&(0,a.tZ)(w.xv.B4,{color:"pub-secondary-text",children:el}),et&&(0,a.BX)(Z.gq,{sizing:"border-box",style:{width:"100%"},alignItems:"center",border:"detail-themed",radius:"md",paddingX:12,paddingY:16,justifyContent:"space-between",bg:"secondary",gap:32,children:[(0,a.BX)(Z.tu,{gap:4,children:[(0,a.tZ)(w.xv.B4,{translated:!0,weight:"semibold",color:"pub-primary-text",children:"Your subscription is private"}),(0,a.BX)(w.xv.B4,{translated:!0,color:"pub-secondary-text",children:["To appear on the leaderboard, turn on visibility for ",I18N.p(o.name)]})]}),(0,a.tZ)(X.zx,{priority:"primary",onClick:async()=>{await J({body:{ids:[C.current_user_subscription_id],visibility:"public"}}),V(),k.popToast(e=>(0,a.tZ)(R.FN,(0,r._)((0,n._)({},e),{text:"".concat(o.name," is now visible on your profile!")})))},children:h("Show on profile")})]})]})]}),(0,a.BX)(Z.tu,{alignItems:"start",style:{width:"100%"},gap:16,children:[(0,a.tZ)(w.xv.H3,{translated:!0,font:"pub-headings",color:"pub-primary-text",children:"Leaderboard"}),(null==Q?void 0:Q.length)===0&&(0,a.BX)(Z.tu,{alignItems:"center",justifyContent:"center",paddingX:48,sizing:"border-box",style:{width:"100%",minHeight:350},gap:4,border:"detail-themed",radius:"md",children:[(0,a.tZ)(p.Z,{size:22,stroke:"var(--color-fg-secondary-themed)"}),(0,a.tZ)(w.xv.B4,{color:"pub-secondary-text",children:b(W(),o.name)})]}),(null==Q?void 0:Q.length)>0&&(0,a.BX)(Z.tu,{gap:8,style:{width:"100%"},children:[(0,a.BX)(Z.gq,{alignItems:"center",style:{width:"100%"},justifyContent:"space-between",paddingBottom:2,children:[(0,a.tZ)(w.xv.Meta,{translated:!0,weight:"semibold",children:"Referrer"}),(0,a.tZ)(w.xv.Meta,{translated:!0,weight:"semibold",children:"Referrals"})]}),null==Q?void 0:Q.map(e=>(0,a.tZ)(Y,{user:e.user,isHighlighted:e.isCurrentUser,rank:e.rank,referrals:e.referrals},e.rank))]})]})]})})})}},32590:function(e,t,i){i.d(t,{P:()=>d});var n=i(16584),r=i(71375),o=i(98914),a=i(15771),l=i(60308),s=i(26111),c=i(77686);let d=e=>{let{pub:t}=e;return(0,n.tZ)(a.hU,{onClick:()=>{let e=(0,s.x)("referrer"),i=null!=e?e:(0,l.TJI)(t);(0,o.uX)(i,{local_navigation:!1})},className:c.Z.closeButton,size:"sm",priority:"secondary-outline",children:(0,n.tZ)(r.Z,{size:20})})}},19139:function(e,t,i){i.d(t,{G:()=>c});var n=i(16584),r=i(49762),o=i(94874),a=i(19081),l=i(38841),s=i(77686);let c=e=>{let{pub:t,user_id:i,user_profile_photo_url:c,children:d}=e;return(0,r.getConfigFor)("meetings_embed_publication_name")?(0,n.BX)(a.tu,{gap:20,alignItems:"center",paddingTop:32,children:[(0,n.tZ)(l.wk,{className:s.Z.pubLogo,pub:t,size:112}),d]}):(0,n.BX)(a.tu,{gap:20,alignItems:"center",paddingTop:32,children:[(0,n.BX)("div",{className:s.Z.avatarWithPubLogo,children:[(0,n.tZ)(o.qE,{className:s.Z.avatar,user:{id:i,photo_url:c},size:112}),(t.logo_url||t.cover_photo_url)&&(0,n.tZ)(l.wk,{className:s.Z.pubAvatar,pub:t,size:40})]}),d]})}},97698:function(e,t,i){i.d(t,{N:()=>J});var n=i(7409),r=i(98848),o=i(16584),a=i(30396),l=i(49762),s=i(98914),c=i(19139),d=i(99282),u=i(99869),p=i(45609),h=i(15771),m=i(19081),g=i(58175),v=i(70379),f=i(98012),b=i(63651),_=i(84864);let y={meetingDetails:"meetingDetails-vrQSc_"},Z=(e,t,i)=>{var n,r,o,a,l,s,c,d,u,p,h,m,g,v,f,y,Z,w,k,C,S,B,x,I,P,N,T,E,X,L,F,R,M;return(null===(n=e.location)||void 0===n?void 0:n.location)||(null===(r=e.location)||void 0===r?void 0:r.join_url)?({zoom:{href:null===(o=e.location)||void 0===o?void 0:o.join_url,copyContent:null===(a=e.location)||void 0===a?void 0:a.join_url,label:"Join Zoom"},zoom_conference:{href:null===(l=e.location)||void 0===l?void 0:l.join_url,copyContent:null===(s=e.location)||void 0===s?void 0:s.join_url,label:"Join Zoom"},google:{href:null===(c=e.location)||void 0===c?void 0:c.join_url,copyContent:null===(d=e.location)||void 0===d?void 0:d.join_url,label:"Join Meet"},google_conference:{href:null===(u=e.location)||void 0===u?void 0:u.join_url,copyContent:null===(p=e.location)||void 0===p?void 0:p.join_url,label:"Join Meet"},inbound_call:{href:"tel:".concat(null===(h=e.location)||void 0===h?void 0:h.location),copyContent:null===(m=e.location)||void 0===m?void 0:m.location,label:null===(g=e.location)||void 0===g?void 0:g.location},outbound_call:{href:null,label:"".concat((0,_.guessFirstName)(e.user_name)," will call you at ").concat(null===(v=e.location)||void 0===v?void 0:v.location)},microsoft_teams:{href:null===(f=e.location)||void 0===f?void 0:f.join_url,copyContent:null===(y=e.location)||void 0===y?void 0:y.join_url,label:"Join Teams"},microsoft_teams_conference:{href:null===(Z=e.location)||void 0===Z?void 0:Z.join_url,copyContent:null===(w=e.location)||void 0===w?void 0:w.join_url,label:"Join Teams"},webex:{href:null===(k=e.location)||void 0===k?void 0:k.join_url,copyContent:null===(C=e.location)||void 0===C?void 0:C.join_url,label:"Join Webex"},webex_conference:{href:null===(S=e.location)||void 0===S?void 0:S.join_url,copyContent:null===(B=e.location)||void 0===B?void 0:B.join_url,label:"Join Webex"},gotomeeting:{href:null===(x=e.location)||void 0===x?void 0:x.join_url,copyContent:null===(I=e.location)||void 0===I?void 0:I.join_url,label:"Join GoToMeeting"},gotomeeting_conference:{href:null===(P=e.location)||void 0===P?void 0:P.join_url,copyContent:null===(N=e.location)||void 0===N?void 0:N.join_url,label:"Join GoToMeeting"},physical:{href:null,label:null!==(F=null===(T=e.location)||void 0===T?void 0:T.location)&&void 0!==F?F:"Unknown"},ask_invitee:{href:null,label:null!==(R=null===(E=e.location)||void 0===E?void 0:E.location)&&void 0!==R?R:"Unknown"},custom:{href:null,label:null!==(M=null===(X=e.location)||void 0===X?void 0:X.location)&&void 0!==M?M:"Unknown"}})[null===(L=e.location)||void 0===L?void 0:L.type]||{}:t&&i?{href:(0,b.h7c)(i,e.id,{addBase:!0}),label:"View here"}:{href:null,label:"Processing..."}},w=e=>{let{order:t,isStatic:i=!1,pub:r=null}=e,a=(0,v.pm)(),{href:l,label:c,copyContent:f}=Z(t,i,r),b=(0,o.tZ)(g.xv.B3,{align:"right",children:l?(0,o.tZ)("a",{href:l,children:c}):c});return i||!f?b:(0,o.BX)(m.gq,{gap:4,alignItems:"center",children:[b,(0,o.tZ)(h.hU,{size:"sm",onClick:()=>{(0,s.vQ)(f),a.popToast(e=>(0,o.tZ)(v.FN,(0,d._)((0,n._)({},e),{Icon:u.Z,text:"Copied link to clipboard"})))},children:(0,o.tZ)(p.Z,{height:20})})]})},k=e=>{var t,i;let{order:n,pub:r}=e,a=(0,f.Z)(null!==(t=n.start_time)&&void 0!==t?t:void 0),l=(0,f.Z)(null!==(i=n.end_time)&&void 0!==i?i:void 0),s="".concat(a.format("MMMM D, YYYY")," at ").concat(a.format("h:mm A z")),c=l.diff(a,"minute");return(0,o.BX)(m.tu,{gap:8,className:y.meetingDetails,children:[(0,o.BX)(m.gq,{justifyContent:"space-between",gap:8,children:[(0,o.tZ)(g.xv.B3,{weight:"bold",children:"Time"}),(0,o.tZ)(g.xv.B3,{children:s})]}),(0,o.BX)(m.gq,{justifyContent:"space-between",gap:8,children:[(0,o.tZ)(g.xv.B3,{weight:"bold",children:"Length"}),(0,o.BX)(g.xv.B3,{children:[c," minutes"]})]}),(0,o.BX)(m.gq,{justifyContent:"space-between",alignItems:"center",gap:8,children:[(0,o.tZ)(g.xv.B3,{weight:"bold",children:"Location"}),(0,o.tZ)(w,{order:n,pub:r})]}),(0,o.tZ)(g.xv.B3,{align:"center",className:y.description,paddingTop:16,children:(0,o.tZ)("i",{children:n.description})})]})};var C=i(60308),S=i(26111);let B=e=>{let{booking:t,settings:i,pub:n}=e,r=(0,l.getConfigFor)("meetings_embed_publication_name")?n.name:t.user_name;return t.cancelled_at?(0,o.BX)(o.HY,{children:[(0,o.tZ)(c.G,{pub:n,user_id:i.user_id,user_profile_photo_url:i.user_profile_photo_url,children:(0,o.BX)(g.xv.H2,{align:"center",children:["Your meeting with ",r," has been cancelled"]})}),t.cancellation_reason&&(0,o.BX)(o.HY,{children:[(0,o.tZ)(g.xv.B3,{align:"center",paddingBottom:16,children:"The author provided the following reason:"}),(0,o.tZ)(g.xv.B4,{align:"center",paddingBottom:32,children:t.cancellation_reason})]}),t.refunded_at&&(0,o.tZ)(g.xv.B3,{align:"center",children:"A refund has been issued to your original form of payment."}),i.enabled&&(0,o.tZ)(g.xv.B3,{align:"center",paddingBottom:16,children:(0,o.BX)(o.HY,{children:["You can book another meeting"," ",(0,o.tZ)("a",{href:(0,b.szv)(n,{params:{source:"cancellation-rebook"}}),children:"here"}),"."]})})]}):(0,o.BX)(o.HY,{children:[(0,o.tZ)(c.G,{pub:n,user_id:i.user_id,user_profile_photo_url:i.user_profile_photo_url,children:(0,o.BX)(g.xv.H2,{align:"center",children:["Your meeting with ",r," has been ",t.num_rebookings>0?"rebooked":"booked"]})}),(0,o.BX)(m.tu,{gap:16,alignItems:"center",children:[(0,o.tZ)(k,{order:t,pub:n}),(0,o.tZ)(g.xv.B4,{align:"center",children:"A confirmation of your booking has been emailed to you."}),t.refunded_at&&(0,o.tZ)(g.xv.B4,{align:"center",children:"A refund has been issued to your original form of payment."}),(0,o.tZ)(h.zx,{onClick:()=>{let e=(0,S.x)("referrer"),t=null!=e?e:(0,C.TJI)(n);(0,s.uX)(t,{local_navigation:!1})},children:"Done"})]})]})};var x=i(78718),I=i.n(x),P=i(71375),N=i(80569),T=i.n(N),E=i(20253),X=i(71978),L=i(68833),F=i(55014),R=i(38023),M=i(51776),U=i(87077),A=i(14944),D=i(37313);let O={button:"button-qJPITd",tos:"tos-KUjQ2h",input:"input-FRaHpS",originalPrice:"originalPrice-OtRI61",filePicker:"filePicker-sGpV6W",fileAttachment:"fileAttachment-fKUmWJ",fileName:"fileName-yGqqsU",fileRemoveIcon:"fileRemoveIcon-fRmA6k",savedCard:"savedCard-bAi8SY",cardOnFileIcon:"cardOnFileIcon-CDsU3Y",errorContainer:"errorContainer-TdnCG0",errorTooltip:"errorTooltip-k9_jmH",checkoutBox:"checkoutBox-B3gOs5"},z=e=>{let{stripe_publishable_key:t,onComplete:i,user:n,pub:r,booking:s,settings:d}=e,[u,p]=(0,a.eJ)(s.name),[v,f]=(0,a.eJ)(s.description),[b,y]=(0,a.eJ)(null),[Z,w]=(0,a.eJ)(null),[k,C]=(0,a.eJ)(null),[S,B]=(0,a.eJ)(null),[x,N]=(0,a.eJ)(!1),[z,j]=(0,a.eJ)(null);(0,a.d4)(()=>{let e=(0,E.lQ)(t,r),i=e&&(0,E.UD)(e);w(e),C(i)},[r,t,w,C]),(0,a.d4)(()=>{(0,L.j)(D.F.MEETING_ORDER_PAGE_VIEWED,{user_id:n.id,publication_id:r.id})},[]),(0,a.d4)(()=>{(async()=>{var e;let t=await T().get("/api/v1/subscription/last4");(null===(e=t.body)||void 0===e?void 0:e.last4)&&B(t.body.last4)})()},[r]);let{price:H,duration:W,subscriber_price:q,founding_price:Y,currency:V}=d.selected_event_type,J=H;n.is_subscribed&&q&&(J=q),n.is_founding&&Y&&(J=Y);let K=!!(null==n?void 0:n.has_saved_payment),G=(0,a.I4)(async()=>k?Z?await Z.createToken(k):{token:null,error:{message:""}}:(console.error("stripeCard is null, cannot createToken"),{token:null,error:{message:"Internal error"}}),[Z,k]),Q=(0,a.I4)(async()=>{let e;if(N(!0),j(null),!K){let{token:t,error:i}=await G();if(i){N(!1),j(i&&i.message),(0,L.j)(D.F.MEETING_MISSING_PAYMENT,{type:i&&"type"in i&&i.type,code:i&&"code"in i&&i.code,decline_code:i&&"decline_code"in i&&i.decline_code,reason:i&&i.message});return}e=t}let t=new FormData;t.append("name",u),t.append("description",v),e&&t.append("stripe_token",JSON.stringify(e)),b&&t.append("attachment",b);let o=Intl.DateTimeFormat().resolvedOptions().timeZone;o&&t.append("timezone",o),(0,L.j)(D.F.MEETING_SUBMIT_PRESSED,{publication_id:r.id,user_id:n.id});try{let e=await T().post("/api/v1/meetings/book").send(t);history.pushState({},"","/meetings/book/".concat(e.body.order_id)),i("schedule",I()(e.body,["order_id","calendly_scheduling_uri","name","email","description"]))}catch(e){var a,l,s,c;(null===(l=e.response)||void 0===l?void 0:null===(a=l.body)||void 0===a?void 0:a.error)?j(null===(c=e.response)||void 0===c?void 0:null===(s=c.body)||void 0===s?void 0:s.error):j("Something went wrong.")}N(!1)},[u,v,G,b,N,j]),$=!!u&&!!v;return(0,o.BX)(o.HY,{children:[(0,o.tZ)(c.G,{pub:r,user_id:d.user_id,user_profile_photo_url:d.user_profile_photo_url,children:(0,o.BX)("div",{children:[(0,o.tZ)(g.xv.H2,{align:"center",size:20,children:"Book a meeting with"}),(0,o.tZ)(g.xv.H2,{align:"center",paddingTop:4,children:(0,l.getConfigFor)("meetings_embed_publication_name")?r.name:d.user_name}),(0,o.BX)(g.xv.B3,{align:"center",paddingTop:8,children:[Jp(e.currentTarget.value),placeholder:"Name...",disabled:x,maxLength:500})}),(0,o.tZ)(A.B,{alignment:"vertical",label:"What do you want to talk about?",children:(0,o.tZ)(R.g,{name:"description",value:v,onChange:e=>f(e.target.value),rows:4,maxLength:1e3,placeholder:"E.g. I’m really interested in knowing...",disabled:x})}),b?(0,o.BX)("div",{children:[(0,o.tZ)(g.xv.B4,{weight:"semibold",paddingBottom:8,children:"Add an attachment (optional)"}),(0,o.BX)(m.gq,{className:O.fileAttachment,gap:8,alignItems:"center",flex:"auto",children:[(0,o.tZ)(P.Z,{onClick:()=>y(null),className:O.fileRemoveIcon,height:24}),(0,o.tZ)(g.xv.B3,{className:O.fileName,children:b.name})]})]}):(0,o.BX)("div",{children:[(0,o.tZ)(g.xv.B4,{weight:"semibold",paddingBottom:8,children:"Add an attachment (optional)"}),(0,o.tZ)(F.G,{className:O.filePicker,onFileSelected:e=>y(e),acceptableTypes:".doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/pdf, image/*, audio/*, video/*, .pdf, .xls, .xlsx"})]}),(0,o.BX)("div",{className:O.checkoutBox,children:[K&&(0,o.BX)(m.gq,{className:O.savedCard,padding:12,gap:12,children:[(0,o.tZ)(X.Z,{className:O.cardOnFileIcon}),(0,o.tZ)(g.xv.B4,{children:S?"**** **** **** ".concat(S):"Use card on file"})]}),!K&&k&&(0,o.tZ)(E.GP,{className:O.input,element:k}),z&&(0,o.tZ)(g.xv.B4,{paddingTop:12,className:O.errorContainer,children:z}),(0,o.tZ)(m.hs,{paddingTop:12,children:(0,o.tZ)(U.u,{text:d.enabled?"You must provide your name and a topic for the meeting before booking.":"You must enable Meetings before one can be booked.",disabled:x||$&&d.enabled,preferPlacement:"top-center",className:O.errorTooltip,children:(0,o.tZ)(h.zx,{className:O.button,flex:"grow",type:"submit",onClick:Q,disabled:x||!$||!d.enabled,children:x?"Loading...":"Book meeting"})})})]})]}),(0,o.BX)(g.xv,{className:O.tos,paddingBottom:16,size:14,align:"center",color:"secondary",children:["By booking, you will be automatically signed up for a free subscription to ",r.name,". Additionally, you agree to Substack's"," ",(0,o.tZ)("a",{href:"https://substack.com/tos",target:"__blank",children:"Terms of Service"}),", our"," ",(0,o.tZ)("a",{href:"https://substack.com/privacy",target:"__blank",children:"Privacy Policy"}),", and our"," ",(0,o.tZ)("a",{href:"https://substack.com/ccpa#personal-data-collected",target:"__blank",children:"Information Collection Notice"}),"."]})]})};var j=i(20761),H=i(1852),W=i(98248);let q=e=>{let{booking:t,onComplete:i,settings:n,pub:r}=e,[s,d]=(0,a.eJ)(!1),[u,p]=(0,a.eJ)(!1),{duration:h}=n.selected_event_type,v=(0,l.getConfigFor)("meetings_embed_publication_name")?r.name:t.user_name,f=(0,H.useMediaQuery)({maxWidth:698});return((0,j.pv)({onEventScheduled:async e=>{var n,r,o;let a=null===(o=e.data)||void 0===o?void 0:null===(r=o.payload)||void 0===r?void 0:null===(n=r.event)||void 0===n?void 0:n.uri;d(!0);try{let e=await T().put("/api/v1/meetings/order/".concat(t.order_id)).send({calendly_event_uri:a});await new Promise(e=>setTimeout(e,2e3)),i("confirmation",e.body)}catch(e){p(!0)}}}),u)?(0,o.tZ)(c.G,{pub:r,user_id:n.user_id,user_profile_photo_url:n.user_profile_photo_url,children:(0,o.tZ)(g.xv.H2,{align:"center",children:"Something went wrong with your booking. Please contact meetings@substackinc.com."})}):s?(0,o.tZ)(m.hs,{justifyContent:"center",children:(0,o.tZ)(W.$j,{})}):(0,o.BX)(o.HY,{children:[(0,o.tZ)(c.G,{pub:r,user_id:n.user_id,user_profile_photo_url:n.user_profile_photo_url,children:(0,o.BX)("div",{children:[(0,o.BX)(g.xv.H2,{align:"center",children:[t.num_rebookings>0?"Rebook":"Book"," your meeting with ",v]}),(0,o.BX)(g.xv.B3,{align:"center",paddingTop:8,children:["Schedule your ",h,"-minute meeting"]})]})}),"undefined"!=typeof window&&t.calendly_scheduling_uri&&(0,o.tZ)(j.KS,{iframeTitle:"calendly",url:"".concat(t.calendly_scheduling_uri,"?hide_gdpr_banner=1"),prefill:{name:t.name||"",email:t.email,customAnswers:{a1:t.description}},styles:{minWidth:"320px",height:"700px",marginTop:f?"0px":"-66px"}})]})};var Y=i(32590);let V=e=>{var{step:t}=e,i=(0,r._)(e,["step"]);switch(t){case"order":return(0,o.tZ)(z,(0,n._)({},i));case"schedule":return(0,o.tZ)(q,(0,n._)({},i));case"confirmation":return(0,o.tZ)(B,(0,n._)({},i))}},J=e=>{let{stripe_publishable_key:t,pub:i,user:r,order:l,order_id:s,settings:c}=e,d=s?l.calendly_scheduling_uri?"schedule":"confirmation":"order",[u,p]=(0,a.eJ)(d),[h,g]=(0,a.eJ)((0,n._)({name:r.name,email:r.email,description:""},l)),v=V({step:u,booking:h,settings:c,order:l,onComplete:(e,t)=>{g((0,n._)({},h,t)),p(e)},pub:i,stripe_publishable_key:t,user:r,orderId:s});return(0,o.BX)(o.HY,{children:[(0,o.tZ)(Y.P,{pub:i}),(0,o.tZ)(m.hs,{style:{minHeight:"100vh"},bg:"secondary",alignItems:"center",justifyContent:"center",children:(0,o.tZ)(m.tu,{paddingX:24,gap:32,style:{width:"schedule"===u?"100%":450,maxWidth:"100%",boxSizing:"border-box"},children:v})})]})}},84632:function(e,t,i){i.d(t,{T:()=>Z});var n=i(16584),r=i(30396),o=i(94184),a=i.n(o),l=i(55065),s=i(17181),c=i(68833),d=i(49762),u=i(32590),p=i(19139),h=i(15771),m=i(19081),g=i(58175),v=i(24791),f=i(60308),b=i(26111),_=i(84864),y=i(77686);let Z=e=>{var t,i,o,Z;let{pub:w,user:k,settings:C}=e,{selected_event_type:{price:S,subscriber_price:B,founding_price:x,currency:I,description_html:P,duration:N,num_availabilities:T},user_name:E}=C,X=S,L=null;null!==(i=null===(t=w.plans)||void 0===t?void 0:t.length)&&void 0!==i&&i&&((null==k?void 0:k.is_subscribed)&&B&&(X=B,L="SUBSCRIBER DISCOUNT"),(null==k?void 0:k.is_founding)&&x&&(X=x,L="".concat(null===(o=(0,v.H$)(w)||"FOUNDING")||void 0===o?void 0:o.toUpperCase()," DISCOUNT"))),(0,r.d4)(()=>{var e,t;(0,c.j)(c.FP.MEETING_PAGE_VIEWED,{publication_id:w.id,user_id:k.id,referrer:null!==(e=(0,b.x)("referrer"))&&void 0!==e?e:null,source:null!==(t=(0,b.x)("source"))&&void 0!==t?t:null})},[]);let F=null!==(Z=(0,b.x)("referrer"))&&void 0!==Z?Z:void 0,R=(0,f.rhs)("/meetings/book",{referrer:F}),M=T>0,U=P?{__html:P.replace(/
/g,"")}:{__html:""};return(0,n.BX)(n.HY,{children:[(0,n.tZ)(u.P,{pub:w}),(0,n.tZ)(m.tu,{style:{minHeight:"100vh"},bg:"secondary",alignItems:"center",justifyContent:"center",children:(0,n.BX)(m.tu,{paddingX:24,gap:32,style:{width:400,maxWidth:"100%",boxSizing:"border-box"},children:[(0,n.tZ)(p.G,{pub:w,user_id:C.user_id,user_profile_photo_url:C.user_profile_photo_url,children:(0,n.BX)("div",{children:[(0,n.tZ)(g.xv.H2,{align:"center",size:20,children:"Book a meeting with"}),(0,n.tZ)(g.xv.H2,{align:"center",paddingTop:4,children:(0,d.getConfigFor)("meetings_embed_publication_name")?w.name:E})]})}),(0,n.BX)(m.tu,{bg:"primary",className:a()(y.Z.offer,{[y.Z.unavailable]:!M}),radius:"md",shadow:"xl",padding:20,children:[L&&(0,n.tZ)("div",{className:y.Z.displayedBadge,children:L}),(0,n.BX)(m.gq,{justifyContent:"space-between",paddingBottom:16,children:[(0,n.tZ)(m.tu,{children:X&&I&&N&&(0,n.BX)(n.HY,{children:[(0,n.BX)(g.xv.H3,{color:M?"primary":"secondary",children:[N,"-minute meeting"]}),(0,n.BX)(g.xv.B4,{color:M?"primary":"secondary",paddingTop:4,children:[X50?"Many availabilities":"".concat((0,_.pluralize)(T,"slot")," available this month"):"No slots available in the next week"]})]})}),M?(0,n.tZ)(l.Z,{className:y.Z.check,size:28}):(0,n.tZ)(s.Z,{size:28,className:y.Z.disabledCheck})]}),(0,n.tZ)(g.xv.B4,{color:"secondary",children:(0,n.tZ)("div",{className:y.Z.description,dangerouslySetInnerHTML:U})})]}),(0,n.tZ)(h.zx,{className:y.Z.button,disabled:!M,flex:"grow",localNavigation:!1,href:R,children:M?"Continue to book":"No meetings available"})]})})]})}},89082:function(e,t,i){i.d(t,{A:()=>a});var n=i(16584),r=i(32351),o=i(60308);let a=e=>{let{subdomain:t}=e;return(0,n.BX)("div",{className:"page typography signup-page",path:"/not-found",children:[(0,n.tZ)(r.Metadata,{title:"Not Found"}),(0,n.BX)("div",{className:"container",children:[(0,n.tZ)("h2",{children:"Not Found"}),(0,n.tZ)("p",{children:"The page you are attempting to access is not found."}),(0,n.tZ)("p",{children:"If you want to claim this URL you can start a Substack today"}),(0,n.tZ)("p",{children:(0,n.tZ)("a",{href:(0,o._HV)(),class:"button primary",rel:"nofollow",children:"Start a Substack"})}),(0,n.tZ)("p",{children:(0,n.BX)("a",{href:(0,o.daR)({query:t,params:{searching:"publication"}}),children:['Search Substack for "',t,'"']})})]})]})}},82609:function(e,t,i){i.d(t,{s:()=>tg});var n=i(27412),r=i(7409),o=i(99282),a=i(16584),l=i(6400),s=i(30396),c=i(94184),d=i.n(c),u=i(3312),p=i.n(u),h=i(39693),m=i.n(h),g=i(14293),v=i.n(g),f=i(2564),b=i(74655),_=i(20042),y=i(80569),Z=i.n(y),w=i(12936),k=i(42694),C=i(23254),S=i(58865),B=i(71375),x=i(51214),I=i(347),P=i(57391),N=i(95441),T=i(60807),E=i(68833),X=i(48980),L=i(62981),F=i(98914),R=i(51450),M=i(15771),U=i(19081),A=i(6490),D=i(98248),O=i(38841),z=i(71068);let j=(0,z.E7)({flex:"grow"});var H=i(58175),W=i(51776),q=i(91400),Y=i(63651);let V={giftModal:"giftModal-cKDVP2",slideUp:"slideUp-LNtrKH",enterEmail:"enterEmail-HqKu0k"};function J(){let e=(0,S._)(["Here's "," to spend on ",""]);return J=function(){return e},e}function K(){let e=(0,S._)(["Special offer: "," free"]);return K=function(){return e},e}function G(){let e=(0,S._)(["Get a "," month subscription in the app, paid for by Substack."]);return G=function(){return e},e}let Q=e=>["duration_focused","value_focused"].includes(e),$=e=>{var t;let{pub:i,numMonths:n,valueString:r}=e,o=(0,q.XA)(),l=(0,T.aF)(),{freeSignup:c,freeSignupEmail:u}=(0,s.qp)(R.p),{getExperimentVariant:p,exposeExperiment:h}=(0,P.jc)(),[m,g]=(0,L.Z)("gift-from-substack-modal",null),[v,f]=(0,s.eJ)(!m),[b,_]=(0,s.eJ)("claim-gift"),[y,Z]=(0,s.eJ)(null!=u?u:""),[w,k]=(0,s.eJ)(!1),[C,S]=(0,s.eJ)(!1),[B,x]=(0,s.eJ)(null),[N,M]=(0,s.eJ)(!1),U=null!==(t=p("gift_from_substack_modal"))&&void 0!==t?t:"control";(0,s.d4)(()=>{v&&(h("gift_from_substack_modal"),g(),(0,E.j)(E.FP.GIFT_FROM_SUBSTACK_MODAL_VIEWED,{freeSignup:c,variant:U}))},[]);let D=(0,s.I4)(()=>{(0,E.j)(E.FP.GIFT_FROM_SUBSTACK_MODAL_DISMISSED,{step:b,freeSignup:c,variant:U}),f(!1)},[c,b,U]),O=(0,s.I4)(e=>{N||((0,E.j)(E.FP.GIFT_FROM_SUBSTACK_MODAL_INITIAL_TEXT_TYPED,{step:b,freeSignup:c,variant:U}),M(!0)),Z(e)},[c,N,b,U]),z=(0,s.I4)(async()=>{if((0,E.j)(E.FP.GIFT_FROM_SUBSTACK_MODAL_CTA_CLICKED,{step:b,freeSignup:c,variant:U}),null!==l)try{S(!0),x(null);let e=await (0,X.rd)("/api/v1/viral_gifts/create_for_email",{method:"POST",json:{email:l.email,fromSubstack:!0}});D(),window.location.href=(0,Y.Hs2)({giftId:e.gift.id})}catch(t){var e;x(null!==(e=(0,F.zx)(t))&&void 0!==e?e:"Something went wrong")}finally{S(!1)}else _("enter-email")},[D,l,b,U,c]),j=(0,s.I4)(async e=>{(0,E.j)(E.FP.GIFT_FROM_SUBSTACK_MODAL_CTA_CLICKED,{step:b,variant:U});try{S(!0),x(null);let t=await (0,X.rd)("/api/v1/viral_gifts/create_for_email",{method:"POST",json:{email:e,fromSubstack:!0}});k(!0),window.setTimeout(()=>{D(),window.location.href=(0,Y.Hs2)({giftId:t.gift.id})},1e3)}catch(e){var t;x(null!==(t=(0,F.zx)(e))&&void 0!==t?t:"Something went wrong")}finally{S(!1)}},[D,b,U]);return Q(U)&&o&&!(n<1)?(0,a.tZ)(A.u_,{isOpen:v,onClose:D,position:"bottom",className:d()(V.giftModal,"claim-gift"===b&&V.claimGift,"enter-email"===b&&V.enterEmail),fullscreenMobile:"enter-email"===b,children:(0,a.BX)(I.h,{children:["claim-gift"===b&&(0,a.tZ)(ee,{pub:i,numMonths:n,valueString:r,onClaim:z,onDecline:D,variant:U,loading:C,error:B}),"enter-email"===b&&(0,a.tZ)(et,{pub:i,numMonths:n,valueString:r,onClaim:j,onClose:D,email:y,onEmailChange:O,loading:C,error:B,showSubscribed:w})]})}):null},ee=e=>{let{pub:t,numMonths:i,valueString:n,onClaim:r,onDecline:o,variant:l,loading:s,error:c}=e,{iString:d,iTemplate:u}=(0,N.M1)();return(0,a.BX)(U.tu,{alignItems:"stretch",paddingX:20,paddingTop:32,paddingBottom:8,gap:20,children:[(0,a.tZ)(O.wk,{pub:t,size:80,style:{margin:"auto"}}),(0,a.BX)(U.tu,{alignItems:"stretch",gap:8,children:[(0,a.tZ)(H.xv.H3,{textAlign:"center",fontWeight:"heavy",children:"value_focused"===l?u(J(),n,t.name):1===i?d("Special offer: 1st month free"):u(K(),i)}),(0,a.tZ)(H.xv.B2,{textAlign:"center",color:"secondary",children:"value_focused"===l?u(G(),i):"Get a ".concat(i," subscription to ").concat(t.name,", paid for by Substack")})]}),(0,a.BX)(U.tu,{alignItems:"stretch",gap:8,children:[(0,a.tZ)(M.zx,{onClick:r,priority:"primary",disabled:s,style:{height:"48px"},children:s?(0,a.tZ)(D.$j,{}):d("Claim my free gift")}),c&&(0,a.tZ)(H.xv.B3,{color:"error",paddingBottom:8,children:c}),(0,a.tZ)(M.zx,{onClick:o,priority:"tertiary",style:{height:"48px"},children:d("Decline my gift")})]})]})},et=e=>{let{pub:t,numMonths:i,valueString:n,onClaim:r,onClose:o,email:l,onEmailChange:c,loading:d,error:u,showSubscribed:p}=e,{iString:h}=(0,N.M1)(),m=(0,s.I4)(()=>{r(l)},[l,r]),g=(0,s.I4)(e=>{c(e.target.value)},[c]),v=(0,s.sO)(null);return(0,s.d4)(()=>{var e;null===(e=v.current)||void 0===e||e.focus()},[]),(0,a.BX)(U.tu,{alignItems:"stretch",padding:20,paddingTop:32,gap:20,flex:"grow",children:[(0,a.BX)(U.gq,{alignItems:"center",justifyContent:"space-between",children:[(0,a.tZ)(O.wk,{pub:t,size:32}),(0,a.tZ)(M.hU,{rounded:!0,size:"sm",onClick:o,"aria-label":h("Close"),children:(0,a.tZ)(B.Z,{size:20})})]}),(0,a.BX)(U.tu,{alignItems:"stretch",gap:8,children:[(0,a.BX)(H.xv.H3,{textAlign:"left",fontWeight:"heavy",translated:!0,children:["Claim your ",I18N.p(n)," gift"]}),(0,a.BX)(H.xv.B2,{textAlign:"left",color:"secondary",translated:!0,children:["Enter your email to subscribe and claim your $",I18N.p(i)," month gift subscription in the Substack app."]})]}),(0,a.tZ)(W.oi,{ref:v,placeholder:h("Email address"),value:l,onChange:g}),(0,a.tZ)(j,{}),p?(0,a.BX)(U.gq,{gap:8,alignItems:"center",justifyContent:"center",children:[(0,a.tZ)(x.Z,{isStatic:!0,height:24,fill:"#187F22",stroke:"#187F22"}),(0,a.tZ)(H.xv.B3,{color:"secondary",align:"center",translated:!0,children:"Subscribed"})]}):(0,a.BX)(U.tu,{alignItems:"stretch",gap:8,children:[(0,a.tZ)(M.zx,{onClick:m,priority:"primary",disabled:d,style:{height:"48px"},children:d?(0,a.tZ)(D.$j,{}):h("Claim my free gift")}),u&&(0,a.tZ)(H.xv.B3,{color:"error",children:u})]})]})};var ei=i(35047),en=i(16808),er=i(56219),eo=i(10045),ea=i(30329),el=i(77081),es=i(12620),ec=i(60308),ed=i(84864),eu=i(47929);class ep extends l.Component{isSubscribed(){let{user:e}=this.props;return!!e&&e.is_subscribed}isFreeSubscribed(){let{freeSignup:e,user:t}=this.props;return!!e||!!t&&t.is_free_subscribed&&!t.is_contributor}onFreeSubscribe(e){if(this.props.publication.plans){let i=(0,ec.W1P)(this.props.publication,{just_signed_up:!0,referral_token:e.body.referral_token});if(e.body.prompt_to_login){var t;i="/account/login?redirect=".concat(encodeURIComponent(i),"&email=").concat(encodeURIComponent(null!==(t=e.body.email)&&void 0!==t?t:""))}document.location.href=i}else window.location.reload()}render(e){let{publication:t,user:i,freeSignupEmail:n,iString:r,language:o}=e;return this.isSubscribed()||this.isFreeSubscribed()&&!t.plans?null:(0,a.tZ)("div",{className:"subscribe-footer",children:(0,a.BX)("div",{className:"container",children:[(0,a.tZ)("p",{children:r("Ready for more?")}),this.isFreeSubscribed()?(0,a.tZ)("div",{children:(0,a.tZ)("a",{className:"cta paid-cta",href:(0,ec.W1P)(t,{utm_source:eu.b3.readyForMore}),native:!0,children:(0,a.tZ)(M.zx,{priority:"primary",children:(0,a.tZ)("b",{children:(0,ed.getSubscribeText)(t,{language:o,isFreeSubscribed:!0})})})})}):(0,a.tZ)(U.gq,{justifyContent:"center",children:(0,a.tZ)("div",{children:(0,a.tZ)(es.Z,{freeSignupEmail:n,onAccentBackground:!0,pub:t,source:eu.b3.subscribeFooter,submitButtonText:(0,ed.getSubscribeText)(t),user:i,onSuccess:this.onFreeSubscribe.bind(this)})})})]})})}}let eh=(0,N.fz)(ep);var em=i(6498),eg=i(57626),ev=i(3469),ef=i(79344),eb=i(7523),e_=i(87810),ey=i(40647),eZ=i(49688),ew=i(98422),ek=i(63474),eC=i(61301);let eS={authorInfo:"authorInfo-uQxGwM",authorImg:"authorImg-RBQVJm",notifyButton:"notifyButton-dcpYYD"},eB=e=>{let{bio:t,byline:i,name:n,photoUrl:l,pub:s}=e,{getConfigFor:c}=(0,ey.xR)(),{isMobile:d}=(0,ew.v9)(),{markdownProps:u}=(0,eZ.V)(t),{hasSection:p}=(0,e_.l)(i.id),h=(0,ec.NNq)(i);if(c("enable_author_pages")){var m;h=null!==(m=(0,ec.rfk)({userId:i.id,pub:s}))&&void 0!==m?m:h}return(0,a.BX)(U.hs,{className:eS.authorInfo,direction:d?"column":"row",gap:16*!!d,padding:24*!!d,position:"relative",children:[(0,a.BX)(ek.A0,{href:h,native:!0,children:[l&&!(0,eC.d7)(l)&&(0,a.tZ)(z.xu,{className:eS.authorImg,style:{background:"url(".concat((0,ec.zF4)(l,(d?200:430)*2,{height:430}),") lightgray 50% / cover no-repeat")}}),(0,a.BX)(U.tu,{gap:16,padding:40*!d,children:[(0,a.tZ)(eb.Z,{color:"white",preset:"h5-serif",children:n}),(0,a.tZ)(eb.Z,(0,o._)((0,r._)({},u),{clamp:4,color:"white",preset:"d3-serif"}))]})]}),p&&(0,a.tZ)(ef.F,{authorId:i.id,className:eS.notifyButton})]})};var ex=i(74626),eI=i(84722),eP=i(11183);let eN=e=>{var t;let{pub:i,post:n}=e,{iString:r}=(0,N.M1)(),o=null===(t=n.postTags)||void 0===t?void 0:t.filter(e=>{var t,i,r;return e.name!==(null===(i=n.publishedBylines)||void 0===i?void 0:null===(t=i[0])||void 0===t?void 0:t.name)&&e.name!==(null===(r=n.section)||void 0===r?void 0:r.name)});return o&&0!==o.length?(0,a.BX)(U.gq,{alignItems:"center",className:"tagList-aHQ9ej",gap:16,wrap:"wrap",children:[(0,a.tZ)(eb.Z,{preset:"detail-small",children:r("Tags:")}),o.map(e=>(0,a.tZ)("a",{className:"tagBox-lyb9LX",href:(0,Y.Mk9)(i,e),children:(0,a.tZ)(eb.Z,{color:"tertiary",preset:"detail-small",children:e.name})}))]}):null},eT={postFooter:"postFooter-urmQJ_",authorInfoContainer:"authorInfoContainer-XS7yHj",upgradeCtaContainer:"upgradeCtaContainer-B3vHAT",upgradeCtaSwitchAccounts:"upgradeCtaSwitchAccounts-uPAFOo",upgradeCtaInputContainer:"upgradeCtaInputContainer-I6n3O5"},eE=e=>{var t;let{post:i,user:n,pub:r,includeUFI:o=!0,freeSignupEmail:l}=e,{iString:s}=(0,N.M1)();return(0,a.tZ)(I.h,{children:(0,a.BX)(U.tu,{alignItems:"center","aria-label":s("Post footer"),className:eT.postFooter,gap:40,children:[(null===(t=i.postTheme)||void 0===t?void 0:t.header_variant)!=="title_and_image_only"&&(0,a.tZ)(eX,{freeSignupEmail:l,post:i,pub:r,user:n}),(0,a.tZ)(eN,{post:i,pub:r}),o&&(0,a.tZ)(eP.I,{post:i,pub:r,user:n})]})})},eX=e=>{let{post:t,pub:i,user:n,freeSignupEmail:r}=e,{isMobile:o}=(0,ew.v9)(),l=t.publishedBylines.map(e=>{var t,n;let r=null===(t=i.authorPagesInfo)||void 0===t?void 0:t.find(t=>t.user_id===e.id);return{name:null!==(n=null==r?void 0:r.name)&&void 0!==n?n:e.name,bio:null==r?void 0:r.bio,photo_url:null==r?void 0:r.photo_url,byline:e}}).filter(e=>e.bio&&e.name),s=!(null==n?void 0:n.is_subscribed)&&!t.hidden;if(0===l.length&&!s)return null;let c=!n&&!r,d=(0,a.BX)(U.tu,{alignItems:"center",className:eT.upgradeCtaContainer,gap:24,padding:40,paddingTop:24,children:[(0,a.BX)(U.tu,{alignItems:"center",gap:16,children:[(0,a.tZ)(eb.Z,{align:"center",preset:"h5-sans",children:"Become a Paid Subscriber"}),(0,a.tZ)(eb.Z,{align:"center",preset:"body",wrap:"balance",children:"Get access to our comments section, special columns like TGIF and Things Worth Remembering, tickets in advance to our live events, and more."})]}),(0,a.tZ)(U.gq,{className:eT.upgradeCtaInputContainer,justifyContent:"center",children:c?(0,a.tZ)(eI.Z,{post:t,pub:i,user:n,utmSource:eu.b3.freePressPostEndCta}):(0,a.tZ)(ex._,{href:(0,ec.Zs0)(i,{utm_source:eu.b3.freePressPostEndCta,next:(0,Y.uRy)(i,t)}),localNavigation:!1,children:(null==n?void 0:n.is_free_subscribed)?"Upgrade today":"Subscribe today"})}),(0,a.BX)(U.gq,{gap:16,children:[(0,a.tZ)(eb.Z,{preset:"caption",children:"Already a paid subscriber?"}),(0,a.tZ)("a",{className:eT.upgradeCtaSwitchAccounts,href:(0,ec.uXE)({for_pub:i.subdomain,change_user:!0}),native:!0,children:(0,a.tZ)(eb.Z,{color:"accent",preset:"caption",children:"Switch Accounts"})})]})]});return(0,a.BX)(U.tu,{alignItems:"center",className:eT.authorInfoContainer,gap:o?16:32,children:[s?d:null,l.map(e=>{var t,n;return(0,a.tZ)(eB,{bio:null!==(t=e.bio)&&void 0!==t?t:"",byline:e.byline,name:null!==(n=e.name)&&void 0!==n?n:"",photoUrl:null==e?void 0:e.photo_url,pub:i})})]})};var eL=i(20888),eF=i(65523);let eR=()=>{let[e,t]=(0,s.eJ)(!0),{iString:i}=(0,N.M1)(),n=()=>{t(!1)};return(0,a.BX)(A.u_,{isOpen:e,onClose:n,children:[(0,a.tZ)(eF.NO,{showClose:!1,image:(0,a.tZ)(z.xu,{radius:"md",overflow:"hidden",children:(0,a.tZ)(eL.e,{maxWidth:400,useRetinaSizing:!0,imageIsFixedWidth:!0,src:(0,Y.zF4)("/img/publish/selection.gif")})})}),(0,a.tZ)(A.xB,{showClose:!1,alignItems:"center",title:i("Select a chunk of text"),description:i("We'll convert your selection into a shareable video to help promote this post")}),(0,a.tZ)(A.ex,{}),(0,a.tZ)(A.mz,{direction:"column",primaryButton:(0,a.tZ)(M.zx,{onClick:n,priority:"primary",children:i("Okay")})})]})};var eM=i(58319),eU=i(37168),eA=i(56629),eD=i(42375),eO=i(81914),ez=i(8090),ej=i(10047),eH=i(49762),eW=i(59176),eq=i(21599),eY=i(63018),eV=i(13285),eJ=i(63145),eK=i(41258),eG=i(32129),eQ=i(65102),e$=i(31131),e0=i(59543),e1=i(47851),e4=i(33665),e2=i(27036),e8=i(98012);let e3={container:"container-zWi_VI",imageContainer:"imageContainer-nn2nS0",postContainer:"postContainer-pVTsPs",imagePreview:"imagePreview-gmfk3B",shareButton:"shareButton-TCXuA9",foundingButton:"foundingButton-jUuPk2",upsellDescription:"upsellDescription-ILV1gy",countdownContainer:"countdownContainer-gvKChz",countdownInnerContainer:"countdownInnerContainer-P186WI",refreshLink:"refreshLink-qARRi5"},e6=e=>{var t,i,n,r,o,l,c,d,u,p;let{post:h,publication:m,user:g,freeSignup:v,freeSignupEmail:f}=e,b=(0,s.sO)(),_=h.cover_image,y=h.title,Z=h.description,w=(0,ed.getPrintedByline)(m,h),k=(null===(t=h.postSchedule)||void 0===t?void 0:t.email_audience)==="founding"&&(null==g?void 0:g.is_founding)||(null===(i=h.postSchedule)||void 0===i?void 0:i.email_audience)==="only_paid"&&g&&(0,e2.P)(g,m)||(null===(n=h.postSchedule)||void 0===n?void 0:n.email_audience)==="everyone"&&(null==g?void 0:g.is_free_subscribed),[C,S]=(0,s.eJ)((0,e8.Z)(null===(r=h.postSchedule)||void 0===r?void 0:r.trigger_at).diff((0,e8.Z)(),"second")),B=Math.floor(C/60/60/24),x=Math.floor(C/60/60%24),I=Math.floor(C/60%60);return(0,s.d4)(()=>{let e=setInterval(()=>{var e;S((0,e8.Z)(null===(e=h.postSchedule)||void 0===e?void 0:e.trigger_at).diff((0,e8.Z)(),"second"))},500);return()=>{clearInterval(e)}}),(0,s.d4)(()=>{(0,E.j)(E.FP.SCHEDULED_POST_SEEN,{post_id:h.id})},[]),(0,a.BX)(a.HY,{children:[(0,a.tZ)(eG.PostMetaTags,{post:h,publication:m}),(0,a.BX)(U.tu,{className:e3.container,alignItems:"center",gap:96,paddingTop:{desktop:64,mobile:32},paddingX:12,children:[(0,a.BX)(U.tu,{className:e3.postAndImageContainer,alignItems:"center",gap:32,children:[_&&(0,a.tZ)("div",{className:e3.imageContainer,children:(0,a.tZ)("img",{src:_,className:e3.imagePreview})}),(0,a.BX)(U.tu,{className:e3.postContainer,alignItems:"center",gap:4,children:[(0,a.tZ)(H.xv.H2,{color:"pub-primary-text",align:"center",children:y}),(0,a.tZ)(H.xv.B3,{color:"pub-secondary-text",align:"center",children:(0,ed.truncateText)(Z,135)}),(0,a.BX)(H.xv.Meta,{color:"pub-secondary-text",align:"center",children:[(null===(o=h.postSchedule)||void 0===o?void 0:o.email_audience)==="founding"?(0,a.BX)(a.HY,{children:[(0,a.tZ)(H.xv.Meta,{as:"span",color:"accent",children:"Founding"}),w?"\xa0\xa0•\xa0\xa0":""]}):(null===(l=h.postSchedule)||void 0===l?void 0:l.email_audience)==="only_paid"?(0,a.BX)(a.HY,{children:[(0,a.tZ)(H.xv.Meta,{as:"span",color:"accent",children:"Paid"}),w?"\xa0\xa0•\xa0\xa0":""]}):"",w?"By ".concat(w):""]})]})]}),(0,a.BX)(U.tu,{className:e3.upsellContainer,alignItems:"center",children:[k?(0,a.BX)(U.gq,{gap:12,children:[(0,a.tZ)(M.zx,{onClick:()=>{if((null==g?void 0:g.is_admin)||(null==g?void 0:g.is_contributor))(0,F.uX)((0,Y.fQy)(m,h.id),{local_navigation:!1});else{var e;null===(e=b.current)||void 0===e||e.open()}},className:e3.shareButton,leading:(0,a.tZ)(e$.Z,{size:20}),priority:"primary",children:"Share"}),(null==g?void 0:g.is_admin)||(null==g?void 0:g.is_contributor)?(0,a.tZ)(M.zx,{onClick:()=>{(0,F.uX)((0,Y.ANx)(m,h.id),{local_navigation:!1})},className:e3.shareButton,leading:(0,a.tZ)(e0.Z,{size:20}),priority:"secondary",children:"Edit Post"}):null]}):(null===(c=h.postSchedule)||void 0===c?void 0:c.email_audience)!=="founding"||(null==g?void 0:g.is_founding)?(0,a.tZ)(e4.Z,{pub:m,post:h,user:g,freeSignup:v,freeSignupEmail:f,isStatic:!1,source:"post-scheduled-page"}):(0,a.tZ)(M.zx,{className:e3.foundingButton,onClick:()=>{var e,t;let i=null===(t=m.plans)||void 0===t?void 0:null===(e=t.find(e=>{var t;return null===(t=e.metadata)||void 0===t?void 0:t.founding}))||void 0===e?void 0:e.id;(0,F.uX)(i?(0,Y.W1P)(m,{addBase:!0,params:{next:document.location.href,utm_source:eu.b3.postScheduledPage,utm_medium:eu.lP.web,utm_content:h.id,selectedPlanId:i}}):(0,ec.Zs0)(m,{simple:!0,next:document.location.href,utm_source:eu.b3.postScheduledPage,utm_medium:eu.lP.web,utm_content:h.id,plan:"founding"}),{local_navigation:!1})},children:"Upgrade to founding"}),(0,a.BX)(H.xv.B3,{className:e3.upsellDescription,color:"pub-primary-text",align:"center",children:["Publishes on ",(0,e8.Z)(null===(d=h.postSchedule)||void 0===d?void 0:d.trigger_at).format("MMMM Do, h:mma"),"."," ",(null==g?void 0:g.is_admin)||(null==g?void 0:g.is_contributor)?"":k?"You’ll receive this post in your inbox when it’s live. Meanwhile, help spread the word!":(null===(u=h.postSchedule)||void 0===u?void 0:u.email_audience)==="founding"&&(null==g?void 0:g.is_free_subscribed)?"Upgrade to founding and receive this post in your inbox when it’s live":(null===(p=h.postSchedule)||void 0===p?void 0:p.email_audience)==="only_paid"&&(null==g?void 0:g.is_free_subscribed)?"Upgrade to paid and receive this post in your inbox when it’s live":"Subscribe now and receive the post in your inbox when it’s live"]})]})]}),(0,a.tZ)("div",{className:e3.countdownContainer,children:(0,a.tZ)(U.tu,{className:e3.countdownInnerContainer,alignItems:"center",gap:4,children:C>0?(0,a.BX)(H.xv.B3,{color:"pub-secondary-text",align:"center",children:["Available in ",B>0?"".concat((0,ed.pluralize)(B,"day"),", "):"",B>0||x>0?"".concat((0,ed.pluralize)(x,"hour"),", "):"",B>0||x>0||I>0?"".concat((0,ed.pluralize)(I,"minute")).concat(B>0||x>0?",":""," and "):"",(0,ed.pluralize)(C%60,"second")]}):(0,a.BX)(H.xv.B3,{color:"pub-secondary-text",align:"center",children:["Available now!"," ",(0,a.tZ)(H.xv.B3,{as:"a",color:"pub-secondary-text",align:"center",onClick:()=>{location.reload()},className:e3.refreshLink,decoration:"underline",children:"Refresh to see the post"}),"."]})})}),(0,a.tZ)(e1.Z,{ref:b,user:g,pub:m,post:h})]})};var e5=i(24547),e9=i(86075),e7=i(15186),te=i(78118),tt=i(27744),ti=i(81043),tn=i(75419),tr=i(41233),to=i(38501),ta=i(43905),tl=i(24791),ts=i(6070),tc=i(31377),td=i(76560),tu=i(6163),tp=i(26111),th=i(81821);let tm={singlePostContainerPillar:"singlePostContainerPillar-sdUBxf",restackEmpty:"restackEmpty-joLIAL",feedItem:"feedItem-p_SCsv",discussionContainerFP:"discussionContainerFP-YrbLts"};class tg extends l.Component{async componentDidMount(){var e;(0,F.pK)(),this.cleanEmbedResizeListener=(0,ej.J)();let t=this.props.post&&[this.props.post.slug,this.props.post.uuid].filter(e=>e).includes(this.props.slug)?this.props.post:null;if(this.shouldRedirectToComments(t)&&t?this.redirectToComments(t):(null===(e=this.props.siteConfigs)||void 0===e?void 0:e.post_metering_enabled)&&(null==t?void 0:t.meter_type)!=="none"&&!this.props.user?await this.loadPost({forceLoad:!0}):this.state.post||await this.loadPost(),this.triggerShareOnLoad(),this.fillEmbeddedEmailInputs(),this.props.justPublished){(0,F.iO)("justPublished"),this.props.post&&(0,F.pt)((0,eG.getPostMetaImage)(this.props.publication,this.props.post)[0]);let e=(0,eG.getPostMetaImageForTwitter)(this.props.publication,this.props.post);e&&(0,F.pt)(e)}(this.props.embeddedPostPublications||""===this.props.embeddedPostPublications)&&(0,F.iO)("embeddedPostPublications"),this.props.autoSharedOnTwitter&&(0,F.iO)("autoSharedOnTwitter"),this.props.showRestackModal&&(0,F.iO)("showRestackModal"),"restack-comment"===this.props.action&&(0,F.iO)("action"),this.props.showWelcome||this.props.launchWelcomePage||(0,F.ut)(this.updateSubscribeTakeover),this.props.showWelcome&&((0,F.iO)("showWelcome"),this.updateSubscribeTimers()),this.props.showWelcomeOnShare&&((0,F.iO)("showWelcomeOnShare"),(this.props.launchWelcomePage||this.props.skipIntroPopupRender)&&this.updateSubscribeTimers()),this.props.selectionFromQuery&&(0,eq.sK)(this.props.selectionFromQuery),this.props.imgSelectionFromQuery&&(0,eq.pW)(this.props.imgSelectionFromQuery),this.props.trackFrontendVisit&&((0,E.j)(E.FP.POST_PAGE_VISIT_TRACKED,{post_id:null==t?void 0:t.id}),this.context.exposeExperiment("check_for_tracking_disabled")),this.props.user||this.context.exposeExperiment("test_cached_post_page"),await this.loadWelcomePageData()}async loadWelcomePageData(){if(!this.shouldShowWelcomePage()||(0,th.tq)())return;let e=await (0,X.rd)("/api/v1/welcome_page_data");this.setState(e)}shouldShowWelcomePage(){return!!(!this.props.skipIntroPopupRender&&(this.props.launchWelcomePage||this.props.showWelcome||this.state.showSubscribeTakeover))}componentWillUnmount(){var e;null===(e=this.cleanEmbedResizeListener)||void 0===e||e.call(this),(0,F.kE)(this.updateSubscribeTakeover)}async componentDidUpdate(e){e.slug!==this.props.slug&&this.loadPost(),this.state.embeddedEmailInputsFilled||this.fillEmbeddedEmailInputs()}shouldRedirectToComments(e){if(e&&"thread"===e.type)return!0}redirectToComments(e){(0,_.route)((0,ec.uRy)(this.props.publication,e,{comments:!0,noBase:!0}),!0)}async loadPost(){let{forceLoad:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.setState({embeddedEmailInputsFilled:!1}),this.props.post&&[this.props.post.slug,this.props.post.uuid].filter(e=>e).includes(this.props.slug)&&!this.shouldRedirectToComments(this.props.post)&&!e)this.setState({post:this.props.post,comments:this.props.renderedComments},()=>(0,F.pK)());else{this.setState({post:null,comments:null});try{let e=(await Z().get("/api/v1/posts/".concat(this.props.slug)).query({postPreview:this.props.postPreview,updated:this.props.updated,sub:this.props.sub,device:this.props.device,audience:this.props.audience,free_preview:this.props.free_preview,freemail:this.props.freemail,utm_campaign:this.props.utm_campaign})).body;if(this.shouldRedirectToComments(e))this.redirectToComments(e);else{if(await (0,F.IW)(this,{post:e,comments:e.comments,stateThemeVariables:e.themeVariables}),(0,eH.default)("add_section_and_tag_metadata")&&!(0,ez.bI)()){let e={url:document.location.origin+document.location.pathname+document.location.search,urlref:document.referrer||"",js:1,data:{audience:(0,ez.Bt)(this.props.user)}};"undefined"!=typeof window&&window.PARSELY&&window.PARSELY.loaded&&window.PARSELY.beacon&&window.PARSELY.beacon.trackPageView&&window.PARSELY.beacon.trackPageView(e)}(0,F.pK)()}}catch(e){console.error("Failed to load post:",e),404===e.status?this.setState({notFound:!0}):alert((0,F.zx)(e))}}}triggerShareOnLoad(){var e,t;"share"===(0,tp.x)("action")&&(window.history.replaceState({},document.title,(0,ec.rhs)({action:null})),this.post&&(null===(e=(t=this.post).triggerShare)||void 0===e||e.call(t,{fromEmail:!0})))}render(e,t){var i,n,l,s,c,u;let p,{slug:h,freeSignup:g,freeSignupEmail:v,readerInstalledAt:f,publication:b,reaction_token:_,hide_intro_popup:y,sort:Z,search:k,children:S,showWelcome:B,launchWelcomePage:x,justPublished:P,autoSharedOnTwitter:N,readerIsSearchCrawler:T,postPreview:E,selectionFromQuery:X,embeddedPublications:L,siteConfigs:F={},freeTrialCoupon:R,showRestackModal:M,action:U,publicationSettings:A,show_reaction_upsell:D,stripe_publishable_key:O,bannedFromNotes:z,themeVariables:j,referringUser:H,clip:W,recentEpisodes:q,followPrompt:Y,imgSelectionFromQuery:V,postSelectionStyle:J}=e,{comments:K,notFound:G,post:ee,user:et,stateThemeVariables:ea,hideSubscribePrompt:es,blurbs:ec,topThreePosts:eu,topThreeSubscribers:ep}=t,{iString:em}=this.I18N,eg=this._inlineComments(),ef=null==ee||!ee.audience||(0,tc.userHasFullAccessToPost)(et,ee),eb=(null==et?void 0:et.is_subscribed)&&ef,e_=ee&&ee.slug&&"coming-soon"!==ee.slug&&"page"!==ee.type,ey=(0,ed.commentsEnabledForPost)({publication:b,post:ee}),eZ=(0,ed.showCommentsOnPost)({publication:b,post:ee}),ew=eb||(null==et?void 0:et.is_free_subscriber)||g,ek=(0,ts.HD)({pub:b}),eC=!!(ee&&["video","podcast"].includes(ee.type)),eS=ea||j,eB=!(null==ee?void 0:ee.hidden)&&((0,ed.isUUID)(h)||eb||T||ee&&ee.current_user_post_meter||ee&&!(0,tc.isPaidAudience)(ee.audience)||ee&&!ee.slug);ek&&(eB=!!eB&&(!(null===(n=this.props.utm_medium)||void 0===n?void 0:n.includes("paid-social_"))||!!eb));let ex=!!ee&&(0,tl.sv)({post:ee})&&!eb,eI=!eB||(null==et?void 0:et.is_contributor)&&ee&&(0,tc.isPaidAudience)(ee.audience)||ek,eP=P&&(null==et?void 0:et.is_contributor)&&!this.props.publication.invite_only&&ee&&!["page"].includes(ee.type),eN=!1;if("undefined"!=typeof window&&(eN="true"===new URLSearchParams(window.location.search).get("selectQuote")),ek&&ee&&"page"===ee.type&&Object.keys(ev._).includes(ee.slug))return(0,a.tZ)(ev.j,{type:ee.slug,html:ee.body_html||"",post:ee,pub:this.props.publication,user:this.props.user});if(ee&&"is_scheduled"in ee&&ee.is_scheduled)return(0,a.tZ)(e6,{freeSignup:g,freeSignupEmail:v,user:et,post:ee,publication:b});let eT=ee?(0,a.tZ)(tf,{commentsEnabled:ey,comments:K,post:ee,slug:h,user:et,freeSignup:g,freeSignupEmail:v,publication:b,reaction_token:_,onVisible:this.onVisible,onChangeComment:this.onChangeComment,inlineComments:eg,isShowsEpisodePage:eC,selectionFromQuery:X,imgSelectionFromQuery:V,onChange:e=>{let{post:t}=e;ee?this.setState({post:(0,o._)((0,r._)({},ee),{comment_count:t.comment_count})}):console.error("post not set with CommentsAndRestacks onChange")},bannedFromNotes:z}):null,eX=(0,eV.S)(b,{publicationSettings:A})&&!(null==et?void 0:et.reader_installed_at)&&!(null==et?void 0:et.is_subscribed)&&!(null==et?void 0:null===(i=et.email)||void 0===i?void 0:i.includes("+"))&&!(null==v?void 0:v.includes("+"))&&!this.shouldShowWelcomePage();eX&&(p=(0,ed.getGiftValueText)(b.plans,{interval_count:1}));let eL=eX&&Q(null!==(l=this.context.getExperimentVariant("gift_from_substack_modal"))&&void 0!==l?l:"control"),eF=["podcast","video"].includes(null!==(s=null==ee?void 0:ee.type)&&void 0!==s?s:"")&&(null==ee?void 0:ee.videoUpload)&&(0,eH.default)("enable_video_seo_data");return(0,a.BX)("div",{children:["restack-comment"===U&&(0,a.tZ)(tZ,{post:ee,pub:b,selection:X,imgSelection:null!=V?V:void 0}),(0,a.tZ)(t_,{pub:b,post:ee}),eF&&(0,a.tZ)(ty,{pub:b,post:ee,hasPaywall:!eB}),this.shouldShowWelcomePage()?(0,a.tZ)(ei.ZP,{freeSignup:g,freeSignupEmail:v,user:et,post:ee,publication:b,hidden:y,launchWelcomePage:x,showOnMount:x,blurbs:ec,topThreePosts:eu,topThreeSubscribers:ep}):null,(0,a.BX)(w._e,{children:[!eC&&(0,a.BX)(a.HY,{children:[eX&&p&&(0,a.tZ)($,{pub:b,numMonths:1,valueString:p}),!eL&&(0,a.tZ)(tv,{user:et,readerInstalledAt:f,post:ee,publication:b,readerIsSearchCrawler:T,publicationSettings:A})]}),(0,a.BX)("div",{className:d()("single-post-container",{[null!==(c=tm.singlePostContainerPillar)&&void 0!==c?c:""]:(0,ts.kb)({pub:b})}),"aria-label":em("Post"),role:"main",children:[(0,a.tZ)("div",{className:d()({container:!(eC||(null==ee?void 0:ee.postTheme)&&ek)}),children:(0,a.BX)("div",{className:"single-post",children:[(0,a.tZ)(eG.PostMetaTags,{publication:b,post:null!=ee?ee:void 0,clip:W,selection:X,siteConfigs:F,selectionStyle:J}),ee?(0,a.tZ)(I.h,{children:eC?(0,a.tZ)(to.o,{ref:this.assignPost,isServingFreePodcastUrl:ex,isShowsEpisodePage:eC,isTheFreePressTheme:ek,postPreview:E,showComments:eZ,user:null!=et?et:null,post:ee,pub:b,freeSignup:g,freeSignupEmail:v,readerInstalledAt:f,reaction_token:_,disableSubscribePrompt:es||(x||B)&&!y,paywall:!eB,noTitleLink:!0,onChange:e=>this.setState(null!=e?e:{}),fromPostPage:!0,freeTrialCoupon:R,showRestackModal:!!M,stripe_publishable_key:O,readerIsSearchCrawler:T,renderComments:()=>eT,themeVariables:eS,referringUser:H,recentEpisodes:null!=q?q:null,forceFollowPrompt:Y,skipFollowPrompt:this.shouldShowWelcomePage()}):(0,a.tZ)(er.SO,{ref:this.assignPost,isServingFreePodcastUrl:ex,isShowsEpisodePage:eC,isTheFreePressTheme:ek,postPreview:E,showComments:eZ,user:null!=et?et:null,post:ee,pub:b,freeSignup:g,freeSignupEmail:v,readerInstalledAt:f,reaction_token:_,disableSubscribePrompt:es||(x||B)&&!y,paywall:!eB,noTitleLink:!0,onChange:e=>this.setState(null!=e?e:{}),fromPostPage:!0,freeTrialCoupon:R,showRestackModal:!!M,stripe_publishable_key:O,readerIsSearchCrawler:T,renderComments:()=>eT,themeVariables:eS,referringUser:H,forceFollowPrompt:Y,skipFollowPrompt:this.shouldShowWelcomePage()})}):G?(0,a.tZ)("p",{className:"main-loader","aria-label":em("Error: Post not found"),children:em("Post not found")}):(0,a.tZ)(er._q,{pub:b}),S]})}),(0,a.tZ)(I.h,{children:e_&&(eB||ek)&&[ek&&(0,a.tZ)(eE,{post:ee,user:et,pub:b,freeSignupEmail:v,includeUFI:!!eB&&"video"!==ee.type&&"podcast"!==ee.type}),eZ&&!eC&&eT,b.has_posts&&(!eC||ek)&&(0,a.tZ)("div",{className:"single-post-section",children:(0,a.BX)("div",{className:d()({container:!(ee.postTheme&&ek)}),children:[(0,a.tZ)(eM.Z,{onVisible:()=>{this.onVisible("Top Posts Footer"),et&&this.context.exposeExperiment("related_posts_web")}}),(0,a.tZ)(eQ.h,{user:null!=et?et:null,freeSignup:g,freeSignupEmail:v,isShowsEpisodePageForTheFP:eC,pub:b,maxPosts:eI||eb||ew&&!b.plans?10:3,filterPostsPredicate:e=>e.id!==ee.id,sort:Z,search:k,stateInUrl:!0,sortTabs:e=>{if("treatment"===this.context.getExperimentVariant("related_posts_web")){let t=e.findIndex(e=>"related"===e.id);if(-1!==t)return m()([e[t]].concat(e.filter((e,i)=>i!==t)))}let t=e.findIndex(e=>"top"===e.id);return -1!==t?m()([e[t]].concat(e.filter((e,i)=>i!==t))):null},delayFirstLoad:1e3,source:"post",isBelowTheFold:!0,post:ee})]})}),!eI&&[(0,a.tZ)(eM.Z,{onVisible:()=>this.onVisible("Subscribe Footer")}),(0,a.tZ)(eh,{publication:b,user:et,freeSignupEmail:v,freeSignup:g})]]}),eP?(0,a.tZ)(eo.Z,{post:ee,autoSharedOnTwitter:"true"===N,publicationTwitterScreenName:b.twitter_screen_name,publication:b,showAfter:(null==L?void 0:L.length)?(0,a.tZ)(el.D,{pub:b,pubsToRecommend:L}):null}):null,D?(0,a.tZ)(en.hF,{user:et,pub:b,post:null!=ee?ee:void 0}):null,eN&&(0,a.tZ)(eR,{}),(0,a.tZ)(C.ZP,{post:ee,mediaUploadId:null!==(u=this.props.clipId)&&void 0!==u?u:null})]})]})]})}constructor(e,t){super(e,t),(0,n._)(this,"I18N",void 0),(0,n._)(this,"cleanEmbedResizeListener",void 0),(0,n._)(this,"post",void 0),(0,n._)(this,"assignPost",e=>{this.post=e}),(0,n._)(this,"updateSubscribeTakeover",()=>{let e=this.props.publication.id,t=(0,eW.mM)("pub-".concat(e,"-takeover-next-shown-at")),i=!t||Date.now()>=t;(0,F.dr)()?this.state.subscribeTakeOverTimer&&(i&&Date.now()-this.state.subscribeTakeOverTimer.getTime()>=12e4&&this.setState({showSubscribeTakeover:!0},()=>{this.loadWelcomePageData()}),this.setState({subscribeTakeOverTimer:null}),this.updateSubscribeTimers()):this.state.subscribeTakeOverTimer||this.setState({subscribeTakeOverTimer:new Date})}),(0,n._)(this,"updateSubscribeTimers",()=>{let e=this.props.publication.id,t="pub-".concat(e,"-subscribe-prompt-next-shown-at"),i="pub-".concat(e,"-takeover-next-shown-at");(0,eW.ex)(t,(0,e8.Z)().add(1,"hour").valueOf()),(0,eW.ex)(i,(0,e8.Z)().add(1,"hour").valueOf()),this.setState({hideSubscribePrompt:!0})}),(0,n._)(this,"onChangeComment",e=>{this.setState({comments:(0,eJ.fc)(this.state.comments,e)})}),(0,n._)(this,"onVisible",e=>{let t="".concat(e," Seen");this.state.post&&(this.state[t]||(this.setState({[t]:!0}),(0,E.j)(t,{post_id:this.state.post.id,post_audience:this.state.post.audience,post_type:this.state.post.type})))}),(0,n._)(this,"_inlineComments",()=>{let{inlineComments:e,publication:t}=this.props;return!!e||(0,ed.shouldUseInlineComments)(t,this.state.post||this.props.post)}),(0,n._)(this,"fillEmbeddedEmailInputs",()=>{var e;let t=document.querySelectorAll('article.post input[type="email"]'),i=(null===(e=this.state.user)||void 0===e?void 0:e.email)||this.props.freeSignupEmail;if(i)for(let e of t)e.value=i;this.setState({embeddedEmailInputsFilled:!0})});let{user:i}=e;this.I18N=I18N.i({pub:e.publication}),e.postPreview&&(i=(0,o._)((0,r._)({},i),{is_draft:!1,is_subscribed:"free"!==e.postPreview,is_founding:"founding"===e.postPreview,is_contributor:!1})),e.post&&[e.post.slug,e.post.uuid].filter(e=>e).includes(e.slug)&&!this.shouldRedirectToComments(e.post)?this.state={post:e.post,comments:e.renderedComments,user:i}:this.state={post:null,comments:null,user:i}}}function tv(e){let{user:t,readerInstalledAt:i,post:n,publication:r,readerIsSearchCrawler:o,publicationSettings:l}=e,s=n&&r&&!o&&!(0,ts.HD)({pub:r}),c=t&&t.is_contributor&&(null==n?void 0:n.slug)=="coming-soon"&&!(null==l?void 0:l.seen_coming_soon_explainer);return(0,a.BX)(a.HY,{children:[s&&(0,a.tZ)(w.S$,{subdomain:r.subdomain,post:n,readerInstalled:!!i,isContributor:!!(null==t?void 0:t.is_contributor)}),c&&(0,a.tZ)(k.qT,{})]})}(0,n._)(tg,"contextType",eU.WH);let tf=e=>{var t,i,n;let{commentsEnabled:l,comments:c,post:u,slug:p,user:h,freeSignup:m,freeSignupEmail:g,publication:_,reaction_token:y,onVisible:Z,onChangeComment:w,inlineComments:k,isShowsEpisodePage:C,selectionFromQuery:S,onChange:B,bannedFromNotes:x,imgSelectionFromQuery:I}=e,{iString:P,iPlural:X}=(0,N.M1)(),[L,F]=(0,s.eJ)(!!(0,tp.x)("showRestacks")),[R,M]=(0,s.eJ)(!1),A=(0,T.SE)(),{getSettingFor:O}=(0,eA.So)(),j=(0,ts.HD)({pub:_}),W=O("show_restacks_below_posts")&&_.community_enabled&&!j,[q,V]=(0,tt.d6)(),[J,K]=(0,s.eJ)(!1),G=(0,eY._I)("/api/v1/note/p-".concat(u.id,"/restacks?filterForPub=true"),{auto:J||L,deps:[u.id]});(0,s.d4)(()=>{var e,t;!G.isLoading&&(null===(t=G.data)||void 0===t?void 0:null===(e=t.items)||void 0===e?void 0:e.length)&&V({type:"comments_load",payload:{comments:G.data.items.map(e=>{let{comment:t}=e;return t})}})},[V,G.isLoading,G.data]);let Q=(0,eY._I)("/api/v1/post/".concat(u.id,"/restackers"),{auto:L,deps:[u.id]}),[$,ee]=(0,s.eJ)(""),[et,ei]=(0,s.eJ)(""),en=(0,s.sO)(),er=h?void 0:function(){let{redirectOverride:e,overrideTitle:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};M(!0),e&&ee(e),t&&ei(t)},eo="undefined"!=typeof window&&new URL(window.location.href);eo&&(eo.searchParams.set("showRestacks",!0),eo.hash="discussion");let ea=!!u.videoUpload,el=!!(!ea&&"podcast"===u.type);return(0,a.BX)(a.HY,{children:[(0,a.tZ)(eM.Z,{onVisible:()=>K(!0)}),(0,a.BX)(U.tu,{paddingY:32,gap:j?28:16,id:"discussion",children:[(0,a.BX)(U.tu,{gap:32,className:d()({container:"newsletter"===u.type&&!j,[tm.discussionContainerFP]:j&&!C}),children:[j?(0,a.tZ)(em.R,{comments:c,post:u,notAllowedToFetchComments:!(0,ed.canSeeComments)(h,u)}):(0,a.tZ)(H.xv.H4,{children:W?P("newsletter"===u.type?"Discussion about this post":ea?"Discussion about this video":el?"Discussion about this episode":"Discussion"):u.comment_count?X("1 Comment","%1 Comments",u.comment_count):P("Comments")}),W&&(0,a.tZ)(z.xu,{alignSelf:"start",children:(0,a.tZ)(e7.Z,{value:L,onChange:e=>{F(e),(0,E.j)(E.FP.POST_DISCUSSION_TOGGLE_CLICKED,{post_id:u.id,tab:e?"restacks":"comments"})},tabs:[{value:!1,label:P("Comments")},{value:!0,label:P("Restacks")}],ariaLabel:P("Select discussion type")})})]}),L?(0,a.BX)(U.tu,{className:"container",paddingTop:16,gap:16,children:[(0,a.tZ)(ti.Ly.Provider,{value:{requireLogin:er,onboardingModalRef:en,publicationUsers:[],subscriptions:[]},children:(0,a.tZ)(tn.sA,{restackUrl:(0,ec.uRy)(_,u),placeholder:P((0,th.tq)()?"Write a restack...":"Write a restack about this post to your followers..."),surface:"post-page-restacks-list"})}),(0,a.tZ)(tr.fA,{isOpen:R,onCancel:()=>{M(!1),ee(""),ei("")},onSuccess:()=>{M(!1),window.history.replaceState(null,"",null==eo?void 0:eo.toString()),location.reload()},onSignup:()=>{var e;M(!1),null===(e=en.current)||void 0===e||e.open()},redirectOverride:$,overrideTitle:et}),(0,a.tZ)(te.ReaderOnboardingModal,{ref:en,user:A.user,step:td.c.SIGNUP,redirectAfterProfile:!0,skipCategories:!0,redirect:null==eo?void 0:eo.toString()}),G.isLoading?(0,a.tZ)(D.$j,{}):(null===(t=G.data)||void 0===t?void 0:t.items.length)?(0,a.BX)(U.tu,{gap:16,children:[(0,a.tZ)(U.tu,{children:(0,a.tZ)(eD.$U,{surface:"post-page-restacks-list",dispatch:V,state:q,children:null===(i=G.data.items)||void 0===i?void 0:i.slice(0,3).map(e=>{var t,i,n,a,l,s;return(0,o._)((0,r._)({},e),{publication:e.publication?null!==(i=q.publications.get(e.publication.id))&&void 0!==i?i:e.publication:null,post:e.post?null!==(n=q.posts.get(e.post.id))&&void 0!==n?n:e.post:null,comment:e.comment?(0,o._)((0,r._)({},null!==(a=q.comments.get(e.comment.id))&&void 0!==a?a:e.comment),{attachments:(null!==(s=null===(t=null!==(l=q.comments.get(e.comment.id))&&void 0!==l?l:e.comment)||void 0===t?void 0:t.attachments)&&void 0!==s?s:[]).filter(e=>{let{type:t,postSelection:i}=e;return"post"!==t||!!i})}):null})}).map(e=>(0,a.tZ)(eO.Bm,{className:tm.feedItem,item:e},e.entity_key))})}),!v()(u.restacks)&&u.restacks-3>0&&(0,a.BX)(U.gq,{gap:8,alignItems:"center",children:[(0,a.tZ)(U.gq,{as:"a",alignItems:"center",cursor:"pointer",href:(0,Y.Oiq)(u.id,{urlParams:{utm_source:eu.b3.substack,utm_content:eu.fZ.facepileRestacks}}),children:(0,a.tZ)(e5.H,{users:(null!==(n=Q.data)&&void 0!==n?n:[]).filter(e=>{var t,i,n;let{id:r}=e;return!(null===(n=G.data)||void 0===n?void 0:null===(i=n.items)||void 0===i?void 0:null===(t=i.slice(0,3))||void 0===t?void 0:t.some(e=>{let{comment:t}=e;return t.user_id==r}))}).map(e=>(0,o._)((0,r._)({},e),{noLink:!0}))})}),(0,a.BX)(U.gq,{as:"a",gap:4,alignItems:"center",cursor:"pointer",href:(0,Y.Oiq)(u.id,{urlParams:{utm_source:eu.b3.substack,utm_content:eu.fZ.facepileRestacks}}),children:[(0,a.tZ)(H.xv.B3,{color:"pub-secondary-text",children:X("See 1 more restack","See %1 more restacks",u.restacks-3)}),(0,a.tZ)(f.Z,{color:"var(--print_secondary_on_web_bg_color, var(--color-fg-secondary))",strokeWidth:1,size:18})]})]})]}):(0,a.tZ)(U.hs,{paddingY:48,justifyContent:"center",alignItems:"center",flex:"grow",children:(0,a.tZ)(e9.u,{className:tm.restackEmpty,icon:(0,a.tZ)(b.Z,{}),title:P("There are no restacks yet, be the first one to restack the post!")})})]}):(0,a.tZ)(tb,{commentsEnabled:l,comments:c,post:u,isShowsEpisodePage:C,slug:p,user:h,freeSignup:m,freeSignupEmail:g,publication:_,reaction_token:y,onVisible:Z,onChangeComment:w,inlineComments:k,selectionFromQuery:S,imgSelectionFromQuery:I,onChange:B,bannedFromNotes:x,userContext:A})]})]})};class tb extends l.Component{componentDidMount(){document.addEventListener(er.lO,this.handleFocusInput)}componentWillUnmount(){document.removeEventListener(er.lO,this.handleFocusInput)}render(e,t){let{commentsEnabled:i,inlineComments:n,isShowsEpisodePage:r,post:o,user:l,freeSignup:s,freeSignupEmail:c,publication:d,reaction_token:u,onVisible:p,onChangeComment:h,selectionFromQuery:m,slug:g,onChange:v,bannedFromNotes:f,imgSelectionFromQuery:b}=e,{comments:_,reactionSigninComment:y}=t;if(o.is_geoblocked)return null;let Z=(0,ts.HD)({pub:d});if(n)return(0,a.tZ)("div",{id:ta.nK,children:(0,a.tZ)(eJ.rf,{slug:g,user:l,freeSignupEmail:c,freeSignup:s,post:o,publication:d,post_reaction_token:u,selectionFromQuery:m,imgSelectionFromQuery:b,initialComments:_,inline:!0,onChange:v})});let{iPlural:w}=this.I18N,k=async(e,t)=>(0,eJ.o_)({user:l,reactionToken:u,comments:_,id:e,reacted:t,setComments:e=>this.setState({comments:e}),onNeedsSignin:e=>new Promise(t=>this.setState({reactionSigninComment:e.comment},()=>{var e;return null===(e=this.modalRef.current)||void 0===e?void 0:e.open(t)}))}),C=(0,eJ.Os)(o,d);return(!(0,th.tq)()||(null==l?void 0:l.is_contributor)||(C=(0,ec.K8_)(d.subdomain,o.slug,{params:{comments:!0,utm_source:eu.b3.post,utm_medium:eu.lP.web}})),Z&&!(0,ed.canSeeComments)(l,o))?(0,a.tZ)(eg.C,{post:o,publication:d,user:l,freeSignupEmail:c,showHeader:!1}):(0,a.tZ)("div",{className:"single-post-section comments-section",children:(0,a.BX)("div",{className:Z?r?"":tm.discussionContainerFP:"container",children:[(0,a.tZ)(eM.Z,{onVisible:()=>p("Post Comments Footer")}),i&&(0,a.tZ)(eJ._D,{user:l,freeSignup:s,freeSignupEmail:c,pub:d,post:o,token:u,ref:this.inputRef,bannedFromNotes:f}),_.length>0&&!i&&(0,a.tZ)(eJ.IO,{post:o}),_&&_.length>0&&d.community_enabled&&(0,a.tZ)(eK.AM,{className:"post-page-root-comment-list",user:l,freeSignup:s,freeSignupEmail:c,pub:d,post:o,comments:_,reaction_token:u,onChange:h,updateCommentReacted:k,noRestack:!0},"post:".concat(o.id)),o.comment_count>(_||[]).length&&(0,a.tZ)("a",{className:"more-comments",href:C,children:w("1 more comment...","%1 more comments...",o.comment_count-(_||[]).length)}),y&&(0,a.tZ)(ea.oq,{comment:y,pub:d,user:l,react:()=>k(y.id,!0),modalRef:this.modalRef})]})})}constructor(e,t){super(e,t),(0,n._)(this,"I18N",void 0),(0,n._)(this,"inputRef",void 0),(0,n._)(this,"modalRef",(0,l.createRef)()),(0,n._)(this,"onboardingModalRef",(0,l.createRef)()),(0,n._)(this,"handleFocusInput",void 0),this.I18N=I18N.i({pub:e.publication}),this.inputRef=(0,l.createRef)(),this.handleFocusInput=()=>{var e;null===(e=this.inputRef.current)||void 0===e||e.focus()},this.state={comments:e.comments,reactionSigninComment:null}}}let t_=e=>{let{pub:t,post:i}=e;return i?(0,a.tZ)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:p()((0,tu.Rg)(t,i),{json:!0,isScriptContext:!0})}}):null},ty=e=>{var t;let{pub:i,post:n,hasPaywall:r}=e;if(!n.videoUpload)return null;let o=(null!==(t=n.videoUpload.preview_duration)&&void 0!==t?t:0)>0;return(0,a.tZ)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:p()((0,tu.L9)(i,n,n.videoUpload,{usePreview:r&&o}),{json:!0,isScriptContext:!0})}})};function tZ(e){let{pub:t,post:i,selection:n,imgSelection:r}=e,o=(0,tn.i3)();return(0,s.d4)(()=>{o.open({restackUrl:(0,ec.uRy)(t,i,{urlParams:{selection:n,imgSelection:r}})})},[]),null}},47220:function(e,t,i){i.d(t,{C:()=>o});var n=i(16584),r=i(32351);let o=e=>{let{sitemapHeader:t,sitemapDescription:i,sitemapLinks:o}=e;return(0,n.BX)("div",{className:"container typography sitemap-page",children:[(0,n.tZ)(r.Metadata,{title:t,description:i}),(0,n.tZ)("h1",{children:t}),(0,n.tZ)("div",{children:o.map(e=>(0,n.tZ)("p",{children:(0,n.tZ)("a",{className:"sitemap-link",href:e.href,native:!0,children:e.text})}))})]})}},79408:function(e,t,i){i.d(t,{C:()=>E,Z:()=>P});var n=i(7409),r=i(99282),o=i(58865),a=i(16584),l=i(30396),s=i(14293),c=i.n(s),d=i(32224),u=i(80569),p=i.n(u),h=i(32351),m=i(95441),g=i(68833),v=i(65205),f=i(98914),b=i(15771),_=i(38841),y=i(60308),Z=i(84864),w=i(47929);function k(){let e=(0,o._)(["Substacks recommended by ","",""]);return k=function(){return e},e}function C(){let e=(0,o._)(["Recommended by ",""]);return C=function(){return e},e}function S(){let e=(0,o._)(["By ",""]);return S=function(){return e},e}function B(){let e=(0,o._)(["View all ",""]);return B=function(){return e},e}let x=function(e,t,i,n){let{trackOnly:r=!1,freeSignupEmail:o}=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return async()=>{if((0,g.j)(g.FP.RECOMMENDATION_SUBSCRIBE_BUTTON_CLICKED,{source:"recommendations-page",recommended_publication_id:e.id,recommending_publication_id:t.id}),!r)try{let r=i&&!i.is_magic&&i.email||o;await p().post("/api/v1/free").send({email:r,source:"recommendations_page",first_url:v.xY,first_referrer:v.ip,first_session_url:v.ac,first_session_referrer:v.qR,current_url:v.UE,current_referrer:v.xU,other_publication_id:e.id,referring_pub_id:t.id}),n(e)}catch(e){alert((0,f.zx)(e)||"Something went wrong")}}},I=function(e,t,i){let{trackOnly:n=!1}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return async()=>{if((0,g.j)(g.FP.RECOMMENDATION_UNSUBSCRIBE_BUTTON_CLICKED,{source:"recommendations-page",recommended_publication_id:e.id,recommending_publication_id:t.id}),!n)try{await p().delete("/api/v1/free").send({publication_id:e.id,source:"recommendations_page"}),i(e)}catch(e){alert((0,f.zx)(e)||"Something went wrong")}}},P=e=>{let{pub:t,recommendations:i,allSubscribedPubs:n,fullySubscribedPubs:r,user:o,freeSignupEmail:s}=e,{iString:c,iTemplate:u}=(0,m.M1)(),[p,v]=(0,l.eJ)(n),B=e=>{v([...p,e])},P=e=>{v(p.filter(t=>{let{id:i}=t;return i!==e.id}))};return(0,a.BX)("div",{className:"container",children:[(0,a.tZ)(h.Metadata,{title:u(k(),(0,Z.getByLine)(t)||t.name,(0,Z.getByLine)(t)?" | ".concat(t.name):"")}),(0,a.BX)("div",{className:"recommendations-page-container",children:[(0,a.tZ)("h2",{children:u(C(),(0,Z.getByLine)(t)||t.name)}),(0,a.tZ)("div",{className:"recommended-publications-container",children:i.map(e=>{let i=e.recommendedPublication;if(!i)return;let n="".concat((0,y.SVA)(i),"/?utm_source=").concat(w.b3.recommendationsPage,"&utm_campaign=").concat(t.id),l=(0,y.W1P)(i,{addBase:!0,utm_source:w.b3.recommendationsPage,referring_pub_ids:[t.id],simple:!0}),h=(0,Z.getByLine)(i),m=r.map(e=>{let{id:t}=e;return t}).includes(i.id);return(0,a.tZ)("div",{className:"recommended-publications-text-container with-blurb",children:(0,a.tZ)("div",{className:"recommendation-body",children:(0,a.BX)("div",{className:"publication-content",children:[(0,a.BX)("div",{className:"top-row",children:[(0,a.BX)("a",{className:"left",href:n,onClick:()=>{(0,g.j)(g.FP.PUBLICATION_RECOMMENDATION_LINK_CLICKED,{source:"recommendations-page",recommended_publication_id:i.id,recommending_publication_id:t.id})},children:[(0,a.tZ)(_.wk,{pub:i,size:48}),(0,a.BX)("div",{className:"pub-meta",children:[(0,a.tZ)("div",{className:"publication-title",children:i.name}),!!h&&(0,a.tZ)("div",{className:"publication-author",children:u(S(),h)})]})]}),p.map(e=>{let{id:t}=e;return t}).includes(i.id)?(0,a.tZ)(b.zx,{priority:"secondary",onClick:I(i,t,P,{trackOnly:m}),href:m?(0,y.mGw)(i,{addBase:!0}):void 0,className:"unsubscribe",children:c("Subscribed")}):(0,a.tZ)(b.zx,{priority:"primary",onClick:o&&!o.is_magic&&o.email||s?x(i,t,o,B,{freeSignupEmail:s}):()=>{(0,g.j)(g.FP.RECOMMENDATION_SUBSCRIBE_BUTTON_CLICKED,{source:"recommendations-page",recommended_publication_id:i.id,recommending_publication_id:t.id}),(0,f.uX)(l,{local_navigation:!1})},leading:(0,a.tZ)(d.Z,{size:20}),children:c("Subscribe")})]}),(0,a.tZ)("div",{className:"publication-suggestion-text-area",children:(i.editorial_bio||i.hero_text)&&(0,a.tZ)("div",{className:"publication-description",children:i.editorial_bio||i.hero_text})}),e.description&&(0,a.tZ)(N,{content:e.description,author:(0,Z.getByLine)(t)||t.name})]})})})})})]})]})},N=e=>{let{author:t,content:i}=e;return(0,a.BX)("div",{className:"blurb",children:[(0,a.tZ)("p",{className:"blurb-content",children:i}),(0,a.BX)("p",{className:"blurb-author",children:["- ",t]})]})},T=e=>{var t,i,o;let{recommendation:l,pub:s,signedIn:c,render:d}=e,{recommendedPublication:u}=l,p=(0,y.TJI)(u,{params:{utm_source:w.b3.homepageRecommendations,utm_campaign:s.id},signedIn:c}),h=()=>{(0,g.j)(g.FP.PUBLICATION_RECOMMENDATION_LINK_CLICKED,{recommending_publication_id:s.id,recommended_publication_id:u.id,source:"homepage-recommendations"})},m={pub:u,openInNewTab:!0,belowTheFold:!0};return d?d({pubAvatarProps:m,pubName:u.name,pubAuthor:null===(i=u.author)||void 0===i?void 0:i.name,url:p,onClick:h}):(0,a.tZ)("div",{className:"home-right-col",children:(0,a.tZ)("div",{className:"recommendation-row",children:(0,a.BX)("div",{className:"left",children:[(0,a.tZ)("a",{onClick:h,children:(0,a.tZ)(_.jM,(0,r._)((0,n._)({},m),{size:32}))}),(0,a.BX)("div",{className:"pub-meta",children:[(0,a.tZ)("a",{href:p,target:"_blank",onClick:h,children:u.name}),(0,a.tZ)("div",{className:"pub-author",children:null!==(o=null===(t=u.author)||void 0===t?void 0:t.name)&&void 0!==o?o:""})]})]})})})},E=e=>{let{recommendations:t,numRecommendations:i,pub:n,user:r,render:o,renderRecommendation:s}=e,{iString:d,iTemplate:u}=(0,m.M1)(),p=t.map(e=>(0,a.tZ)(T,{recommendation:e,pub:n,signedIn:!!r,render:s}));return((0,l.d4)(()=>{(0,g.j)(g.FP.PUBLICATION_RECOMMENDATIONS_SHOWN,{source:"pub-home",recommendations:t.map(e=>{let{recommendedPublication:t}=e;return t.id})})},[t]),o)?o({recommendations:p,canManage:!!(null==r?void 0:r.is_admin),manageUrl:(0,y.Li8)(n),hasMore:!c()(i)&&i>t.length,hasMoreUrl:(0,y.kfT)(n),recommendationsCount:i}):(0,a.BX)("div",{className:"home-right-group recommendations",children:[(0,a.BX)("div",{className:"home-right-group-title",children:[(0,a.tZ)("a",{href:(0,y.kfT)(n),children:"Recommendations"}),(null==r?void 0:r.is_admin)?(0,a.tZ)("a",{href:(0,y.Li8)(n),native:!0,children:d("Manage")}):!c()(i)&&i>t.length?(0,a.tZ)("a",{href:(0,y.kfT)(n),native:!0,children:u(B(),i)}):null]}),p]})}},22130:function(e,t,i){i.d(t,{v:()=>Z});var n=i(16584),r=i(94184),o=i.n(r),a=i(95441),l=i(55480),s=i(71e3),c=i(30733),d=i(12844),u=i(58175),p=i(24791),h=i(6070),m=i(60308),g=i(47929),v=i(89043);let f=e=>{let{}=e,{iString:t}=(0,a.M1)();return(0,n.tZ)("div",{className:v.Z.noPodcasts,children:t("No podcasts.")})},b=(e,t,i)=>{let n=e[t.id];return n||(n=(0,m.tS3)(t,{section:null,noSection:!1,addBase:!0,user:null,startAtSubscribeFlow:!i||!i.is_free_subscribed,params:{utm_source:g.b3.allPodcasts}})),n},_=e=>{let{pub:t,user:i,idToMagicLink:r,openInNewTab:o}=e;return"thebulwark"!==t.subdomain?null:(0,n.BX)(u.xv.B3,{translated:!0,paddingTop:16,paddingBottom:16,children:[(0,n.tZ)("a",{href:b(null!=r?r:{},t,i),target:o?"_blank":void 0,rel:"noopener",children:"Click here"})," ","to set up your podcast app for everything in one feed."]})},y=e=>{let{pub:t,user:i,idToMagicLink:r={}}=e,o=[],{iString:s}=(0,a.M1)();(0,p.hK)(t)&&(0,p.hK)(t).forEach(e=>{var n,a;if(!(0,p.aM)({pub:t,section:e}))return;let c=(0,l.d_)({pub:t,section:e});if(!c.title)return;let d={logoUrl:null!==(n=c.artUrl)&&void 0!==n?n:void 0,mainClickUrl:(0,m.UVC)({pub:t,section:e,addBase:!0}),buttonClickUrl:r[e.id]||(0,m.tS3)(t,{section:e,noSection:!1,addBase:!0,user:null,startAtSubscribeFlow:!i||!i.is_free_subscribed,params:{utm_source:g.b3.allPodcasts}}),name:c.title,description:null!==(a=c.description)&&void 0!==a?a:"",buttonText:s("Set up podcast")};o.push(d)}),(0,p.WD)(t)&&o.push((0,d.w)(t,b(r,t,i)));let c=Object.keys(r).length>0||(null==i?void 0:i.is_free_subscribed)?s("Private podcasts"):s("Podcasts"),h=(0,n.tZ)(n.HY,{children:(0,p.Ww)(t)?(0,n.BX)(n.HY,{children:[(0,n.tZ)(d.k,{showButton:!0,items:o}),(0,n.tZ)(_,{pub:t,user:i,idToMagicLink:r})]}):(0,n.tZ)(f,{})});return(0,n.BX)(n.HY,{children:[(0,n.tZ)(u.xv.H4,{paddingTop:20,paddingBottom:8,children:c}),h]})},Z=e=>{let{pub:t,user:i,idToMagicLink:r}=e;return(0,h.VL)({pub:t,includeTheRampart:!0})?(0,n.tZ)("div",{className:o()("page","typography",v.Z.container,v.Z.containerBulwark),children:(0,n.tZ)(s.A,{idToMagicLink:r,pub:t,user:i})}):(0,n.tZ)("div",{className:o()("page","typography",v.Z.container),children:(0,n.tZ)(c.N,{children:(0,n.tZ)(y,{idToMagicLink:r,pub:t,user:i})})})}},64650:function(e,t,i){i.d(t,{G:()=>X});var n=i(7409),r=i(99282),o=i(16584),a=i(30396),l=i(94184),s=i.n(l),c=i(98661),d=i(55519),u=i(347),p=i(95441),h=i(68833),m=i(7882),g=i(98914),v=i(15771),f=i(82402),b=i(19081),_=i(38023),y=i(57640),Z=i(58175),w=i(51776),k=i(74312),C=i(60308),S=i(63651),B=i(47929);let x={questionListDisabled:"questionListDisabled-_qB8wZ",dropdown:"dropdown-pEz6Sx"},I=e=>["checkbox","checkbox_freeform","radio","radio_freeform"].includes(e||""),P=e=>["checkbox_freeform","radio_freeform"].includes(e||""),N={container:e=>(0,r._)((0,n._)({},e),{flex:1}),dropdownIndicator:e=>(0,r._)((0,n._)({},e),{color:"var(--color-fg-secondary)"}),control:e=>(0,r._)((0,n._)({},e),{fontSize:14,color:"var(--color-fg-secondary)",boxShadow:"none"}),option:(e,t)=>(0,r._)((0,n._)({},e),{fontSize:14,color:"var(--color-fg-secondary)",backgroundColor:t.isFocused?"var(--color-bg-secondary)":t.isSelected?"var(--color-bg-accent-hover)":"white"}),noOptionsMessage:e=>(0,r._)((0,n._)({},e),{fontSize:14,color:"var(--color-fg-secondary)"})},T=e=>{let{question:t,responseData:i,onChange:l,disabled:s=!1,countries:c}=e,{iString:u}=(0,p.M1)(),h=(0,a.Ye)(()=>{if("country"===t.type&&i.value&&c){let e=String(i.value).split(",")[0],t=c.find(t=>t.countryShortCode===e);return t?{value:t.countryShortCode,label:t.countryName,regions:t.regions}:null}return null},[i.value]),m=(0,a.Ye)(()=>{if("country"===t.type&&(null==h?void 0:h.regions)&&c&&i.value){let e=String(i.value).split(",")[1],t=h.regions.find(t=>t.shortCode===e);return t?{value:t.shortCode,label:t.name}:null}return null},[h,i.value]);return(0,o.BX)(b.tu,{gap:16,children:[(0,o.BX)(Z.xv.H4,{children:[t.displayLabel,t.is_required&&(0,o.tZ)(Z.xv.H4,{as:"span",color:"error",children:"*"})]}),"text"===t.type&&(0,o.tZ)(_.g,{disabled:s,placeholder:u("Type here"),value:String(i.value||""),onChange:e=>{i.value=e.target.value,l(i)}}),"number"===t.type&&(0,o.tZ)(w.oi,{disabled:s,placeholder:u("Type number value here"),value:Number.isNaN(Number(i.value))?"":i.value,onChange:e=>{let t=e.currentTarget.value.replace(/[^\d]/g,"");i.value=Number(t)||0,l(i)}}),"country"===t.type&&(0,o.BX)(b.tu,{gap:24,children:[(0,o.tZ)(d.ZP,{className:x.dropdown,options:null==c?void 0:c.map(e=>({label:e.countryName,value:e.countryShortCode})),onChange:e=>{let t=e.value;l((0,r._)((0,n._)({},i),{value:t}))},value:h,placeholder:u("Select or search for a country..."),noOptionsMessage:()=>u("No options found."),theme:(0,g._I)({primary:"var(--color-fg-secondary)",neutral0:"white"}),isSearchable:!0,styles:N}),i.value&&(null==h?void 0:h.regions)&&(0,o.tZ)(d.ZP,{className:x.dropdown,options:h.regions.map(e=>({label:e.name,value:e.shortCode})),onChange:e=>{let t=e.value;l((0,r._)((0,n._)({},i),{value:"".concat(String(i.value).split(",")[0],",").concat(t)}))},value:m,placeholder:u("Select or search for a state, province, or region..."),noOptionsMessage:()=>u("No options found."),theme:(0,g._I)({primary:"var(--color-fg-secondary)",neutral0:"white"}),isSearchable:!0,styles:N})]}),I(t.type)&&t.options&&t.options.map(e=>(0,o.BX)(b.gq,{as:"label",gap:16,children:[("checkbox"===t.type||"checkbox_freeform"===t.type)&&(0,o.tZ)(f.X,{disabled:s,name:"".concat(t.id,"check"),checked:i.options.indexOf(String(e.id))>-1,onChange:t=>{let o=i.options.filter(t=>t!==String(e.id));t&&o.push(String(e.id)),l((0,r._)((0,n._)({},i),{options:o}))}}),("radio"===t.type||"radio_freeform"===t.type)&&(0,o.tZ)(y.Y,{disabled:s,value:String(e.id),name:"".concat(t.id,"check"),checked:i.options.indexOf(String(e.id))>-1,onClick:t=>{let i=[];t.target.checked&&i.push(String(e.id)),l({value:"",options:i})}}),(0,o.tZ)(Z.xv.B3,{children:e.label})]})),P(t.type)&&(0,o.BX)(b.gq,{as:"label",gap:16,alignItems:"center",children:[("checkbox"===t.type||"checkbox_freeform"===t.type)&&(0,o.tZ)(f.X,{disabled:s,name:"".concat(t.id,"check"),checked:String(i.value).length>0,onChange:e=>{e?l((0,r._)((0,n._)({},i),{value:" "})):l((0,r._)((0,n._)({},i),{value:""}))}}),("radio"===t.type||"radio_freeform"===t.type)&&(0,o.tZ)(y.Y,{disabled:s,value:"text",name:"".concat(t.id,"check"),checked:String(i.value).length>0,onClick:()=>{l({options:[],value:" "})}}),(0,o.tZ)(w.oi,{disabled:s,placeholder:"What is your gender?"===t.label?u("Prefer to self describe"):u("Other..."),value:String(i.value||""),onChange:e=>{i.value=e.currentTarget.value,i.value.length>0&&("radio"===t.type||"radio_freeform"===t.type)&&(i.options=[]),l(i)}})]})]})},E=e=>{let{surveyId:t,user:l,pub:d,token:h=""}=e,{iString:g}=(0,p.M1)(),[f,_]=(0,a.eJ)({}),{result:y,isLoading:w,refetch:N}=(0,m.ib)({pathname:"/api/v1/survey/".concat(t),auto:!0,query:{token:h||void 0}});(0,c.useEffect)(()=>{if(!w&&y&&!E){var e;(null===(e=y.questions)||void 0===e?void 0:e.some(e=>"country"===e.type))&&X()}},[y,w]);let{result:E,fetch:X}=(0,k.Oe)({module:"country-region-data/data.json",onRequest:()=>i.e("6537").then(i.t.bind(i,52727,19)),fetchImmediately:!1}),L=(0,m.ib)({method:"post",pathname:"/api/v1/survey/".concat(t,"/responses"),auto:!1,json:{responses:Object.keys(f).map(e=>({survey_question_id:e,data:f[e]}))},query:{token:h||void 0}}),F=(0,a.I4)(async()=>{L.isLoading||(await L.refetch(),await N())},[L]);if(!y&&!w)return(0,o.tZ)(b.tu,{paddingTop:48,gap:48,children:(0,o.tZ)(Z.xv.H1,{translated:!0,children:"There was an error fetching this survey."})});if(!y)return(0,o.tZ)("div",{});if(y.hasCurrentUserResponded)return(0,o.BX)(b.tu,{paddingTop:48,gap:24,alignItems:"center",justifyContent:"center",children:[(0,o.tZ)(Z.xv.H1,{translated:!0,children:"Thank you!"}),(0,o.tZ)(Z.xv.B3,{translated:!0,children:"Your response has been recorded."})]});let{questions:R=[],title:M}=y,U=!!l,A=l&&l.is_free_subscribed,D=U&&A,O=D&&R.reduce((e,t)=>{let i=!0;if(t.is_required){let e=f[t.id];if("text"===t.type)i=String((null==e?void 0:e.value)||"").length>0;else if("number"===t.type)i=!Number.isNaN(Number(null==e?void 0:e.value));else if("country"===t.type)i=2===String((null==e?void 0:e.value)||"").split(",").length;else if(I(t.type)){let n=e&&Array.isArray(null==e?void 0:e.options)?e.options:[],r=String((null==e?void 0:e.value)||"");i=P(t.type)?n.length>0||r.length>0:n.length>0}}return e&&i},!0);return(0,o.tZ)(u.h,{children:(0,o.BX)(b.tu,{paddingTop:48,gap:48,children:[(0,o.tZ)(Z.xv.H1,{color:"pub-primary-text",children:M}),!U&&(0,o.tZ)(b.gq,{alignItems:"center",justifyContent:"center",borderBottom:"detail",paddingBottom:48,children:(0,o.BX)(b.tu,{border:"detail",padding:24,gap:24,sizing:"border-box",radius:"md",children:[(0,o.BX)(Z.xv.H4,{translated:!0,children:["Sign in to answer this survey from ",I18N.p(d.name)]}),(0,o.tZ)(v.zx,{localNavigation:!1,priority:"primary",href:(0,C.uXE)({for_pub:d.subdomain,redirect:window.location.href}),children:g("Sign in")})]})}),U&&!A&&(0,o.tZ)(b.gq,{alignItems:"center",justifyContent:"center",borderBottom:"detail",paddingBottom:48,children:(0,o.BX)(b.tu,{border:"detail",padding:24,gap:24,sizing:"border-box",radius:"md",children:[(0,o.BX)(Z.xv.H4,{translated:!0,children:["Subscribe to ",I18N.p(d.name)," to answer this survey."]}),(0,o.tZ)(v.zx,{localNavigation:!1,priority:"primary",href:(0,S.W1P)(d,{params:{next:window.location.href,email:l.email,just_signed_up:!0,autoSubmit:!0,utm_source:B.b3.substack,utm_medium:B.lP.email,utm_content:B.fZ.readerSurveySubscribePrompt}}),children:g("Subscribe")})]})}),(D||!d.invite_only)&&(0,o.BX)(b.tu,{gap:48,className:s()({[x.questionListDisabled]:!D}),paddingBottom:48,children:[R.map(e=>{let t=f[e.id]?f[e.id]:{options:[],value:""};return(0,o.tZ)(T,{question:e,responseData:t,disabled:!D,countries:null==E?void 0:E.default,onChange:t=>{_((0,r._)((0,n._)({},f),{[e.id]:t}))}},e.id)}),(0,o.tZ)(v.zx,{disabled:!O,priority:"primary",onClick:F,children:g("Submit")})]})]})})},X=e=>{let{surveyId:t,user:i,pub:n,token:r=""}=e;return(0,c.useEffect)(()=>{(0,h.j)(h.FP.READER_SURVEY_SEEN,{surveyId:t,isLoggedIn:!!i,isSubscribed:null==i?void 0:i.is_free_subscribed})},[t]),(0,o.tZ)("div",{className:"container",children:(0,o.tZ)(E,{surveyId:t,user:i,pub:n,token:r})})}},15959:function(e,t,i){i.d(t,{Z:()=>m});var n=i(16584),r=i(347),o=i(17781),a=i(7882),l=i(33578),s=i(63391),c=i(98422),d=i(15400),u=i(6207),p=i(30733),h=i(6070);function m(e){var t,i,m;let{slug:g,pub:v,user:f,tagPagePreloads:b,utm:_}=e,{isTablet:y}=(0,c.v9)(),Z=(0,a.ib)({pathname:"/api/v1/publication/post-tag/slug/".concat(g),auto:(null==b?void 0:b.slug)!==g,initialResult:(null==b?void 0:b.slug)===g?b.postTag:null,deps:[b,g]}),w=(0,h.kb)({pub:v});return(0,h.HD)({pub:v})?(0,n.tZ)(n.HY,{children:Z.isLoading?(0,n.tZ)(p.N,{children:(0,n.tZ)("p",{className:"main-loader",children:"Loading..."})}):(0,n.tZ)(o.E,{isPodcast:!1,isTagPage:!0,newPosts:(null==b?void 0:b.slug)===g?b.posts:void 0,pub:v,section:null,tag:null!==(m=Z.result)&&void 0!==m?m:void 0,user:f,utm:_})}):(0,n.tZ)(p.N,{columns:w?4:2,children:Z.isLoading?(0,n.tZ)("p",{className:"main-loader"}):(0,n.tZ)(n.HY,{children:(0,n.BX)(r.h,{children:[(0,n.tZ)(u.M,{name:(null===(t=Z.result)||void 0===t?void 0:t.name)||"Page not found",description:null,logoUrl:null,pub:v}),(0,n.tZ)(s.f,{}),(0,n.tZ)(l.O,{user:f,pub:v,renderTabs:w?()=>null:void 0,renderLoading:()=>null,sort:"new",postTagId:null===(i=Z.result)||void 0===i?void 0:i.id,newPosts:(null==b?void 0:b.slug)===g?b.posts:null,source:"tag-archive",utm:_,children:e=>{var t;let{posts:i,linkToComments:r,onClickPost:o}=e;return(0,n.tZ)(d.B,{hideImages:null===(t=v.theme)||void 0===t?void 0:t.hide_images_from_list,hideHorizontalDividers:w,linkToComments:r,posts:i,variant:w?y?"three-column-grid":"four-column-grid":"two-column-list",onClickPost:o})}})]})})})}},12900:function(e,t,i){i.d(t,{H:()=>o});var n=i(16584),r=i(98661);let o=e=>{var t;let{children:i,expanded:o,renderWhenCollapsed:a,onEnter:l,flex:s,gap:c}=e,d=(0,r.useRef)(null),[u,p]=(0,r.useState)(o?"expanded":"collapsed"),[h,m]=(0,r.useState)(null),g="collapsed"===u||"startExpanding"===u||"collapsing"===u,v="expanded"===u||"startCollapsing"===u||"expanding"===u;return(0,r.useEffect)(()=>{o&&"collapsed"===u&&p("startExpanding"),"startExpanding"===u&&d.current&&(m(d.current.offsetHeight),p("expanding"),setTimeout(()=>{p("expanded"),l&&l()},250)),!o&&"expanded"===u&&d.current&&(m(d.current.offsetHeight),p("startCollapsing")),"startCollapsing"===u&&(p("collapsing"),setTimeout(()=>{p("collapsed")},250))},[o,u]),(0,n.tZ)("div",{style:{height:null!==(t=g?0:"expanded"===u?"auto":v?h:void 0)&&void 0!==t?t:void 0,transition:"height ".concat(250,"ms var(--animation-smooth), opacity ").concat(250,"ms var(--animation-smooth)"),display:s?"flex":"block",flexDirection:"column",opacity:g?0:v?1:void 0},children:(0,n.tZ)("div",{ref:d,style:{paddingTop:.05,paddingBottom:.05,display:s?"flex":"block",gap:c?"".concat(c,"px"):void 0,flex:"0 0 auto",flexDirection:"column",transition:"transform ".concat(250,"ms var(--animation-smooth)")},children:("collapsed"!==u||a)&&i})})}},82402:function(e,t,i){i.d(t,{X:()=>f});var n=i(7409),r=i(99282),o=i(98848),a=i(16584),l=i(94184),s=i.n(l),c=i(5463),d=i(25380),u=i(98661),p=i(71068),h=i(19081),m=i(5844);let g={xs:{size:12,strokeWidth:3.5},sm:{size:14,strokeWidth:3},default:{size:18,strokeWidth:2.5}},v=e=>g[e]||g.default,f=e=>{var{name:t,size:i="md",checked:l,disabled:g=!1,theme:f="accent",onChange:b,className:_}=e,y=(0,o._)(e,["name","size","checked","disabled","theme","onChange","className"]);let Z=y["aria-label"]||t,w=v(i),k=(0,u.useRef)(null),C="indeterminate"===l,S=!0===l;return(0,u.useLayoutEffect)(()=>{k.current&&(k.current.indeterminate=C)},[C]),(0,a.tZ)(p.xu,{className:s()("pencraft",_),children:(0,a.BX)(h.hs,{outline:"detail",sizing:"border-box",radius:"xs",alignItems:"center",justifyContent:"center",position:"relative",shadow:"xs",cursor:g?"not-allowed":"pointer",animate:!0,flex:"auto",tabIndex:-1,className:s()("pencraft",m.Z.checkbox,m.Z[i],g?m.Z.disabled:m.Z.enabled,C?m.Z.indeterminate:S?m.Z.checked:m.Z.unchecked,m.Z["theme_".concat(f)]),children:[C?(0,a.tZ)(c.Z,{size:w.size,strokeWidth:w.strokeWidth,className:m.Z.icon}):(0,a.tZ)(d.Z,{size:w.size,strokeWidth:w.strokeWidth,className:m.Z.icon}),(0,a.tZ)("input",(0,r._)((0,n._)({ref:k},y),{className:"pencraft",type:"checkbox",role:"checkbox",name:t,"data-testid":y["data-testid"]||t,"data-state":S?"selected":C?"indeterminate":"unselected","aria-checked":C?"mixed":S,checked:S,disabled:g,"aria-label":Z,tabIndex:0,onChange:e=>{var t,i;g||b(!S,(0,r._)((0,n._)({},e.currentTarget),{name:null!==(i=null===(t=e.currentTarget)||void 0===t?void 0:t.name)&&void 0!==i?i:""}))}}))]})})}},96745:function(e,t,i){i.d(t,{Tz:()=>v});var n=i(7409),r=i(99282),o=i(98848),a=i(16584),l=i(94184),s=i.n(l),c=i(79774),d=i(98661),u=i(95441),p=i(19081),h=i(51776),m=i(24548),g=i(68686);function v(e){var{className:t,min:i,max:l,value:c,onChange:u,disabled:h,readOnly:v,flex:_="auto",error:y=!1}=e,Z=(0,o._)(e,["className","min","max","value","onChange","disabled","readOnly","flex","error"]);let w=(0,d.useRef)(null);return(0,a.BX)(p.hs,{position:"relative",flex:_,minWidth:0,children:[(0,a.tZ)("input",(0,r._)((0,n._)({},Z),{type:"datetime-local",ref:w,className:s()(t,m.Z.datePicker,g.Z.input,g.Z.inputText,y&&g.Z.error,h&&g.Z.disabled,v&&g.Z.readOnly),value:b(c),min:b(i),max:b(l),onChange:u,disabled:h})),(0,a.tZ)(f,{inputRef:w})]})}let f=e=>{let{inputRef:t}=e,{iString:i}=(0,u.M1)();return(0,a.tZ)(h.cv,{className:m.Z.trailing,onClick:e=>{let{current:i}=t;if(i){var n;e.preventDefault(),e.stopPropagation(),i.focus(),null===(n=i.showPicker)||void 0===n||n.call(i)}},onMouseDown:e=>{e.preventDefault()},children:(0,a.tZ)(c.Z,{size:16,"aria-label":i("Calendar icon")})})};function b(e){return e instanceof Date?"".concat(e.getFullYear(),"-").concat(_(e.getMonth()+1),"-").concat(_(e.getDate()),"T").concat(_(e.getHours()),":").concat(_(e.getMinutes())):e}function _(e){let t=String(e);return t.length<2?"0".concat(t):t}},55014:function(e,t,i){i.d(t,{G:()=>m});var n=i(16584),r=i(30396),o=i(94184),a=i.n(o),l=i(11043),s=i(95441),c=i(15771),d=i(19081),u=i(58175),p=i(81821),h=i(52478);let m=e=>{let{onFileSelected:t,dropCTA:i,pickCTA:o,pickCTAHandler:m,acceptableTypes:g,loading:v,className:f,multiple:b=!1,addMode:_=!1,onDrop:y,onPick:Z,info:w}=e,[k,C]=(0,r.eJ)(!1),S=(0,r.sO)(null),{iString:B}=(0,s.M1)();o||m||(o=(0,n.tZ)(c.zx,{size:"sm",priority:"secondary-outline",children:b?B("Choose files"):B("Choose file")})),i||(i=B("Drop file here"));let x=e=>{e.preventDefault(),C(!0)},I=async e=>{var i,n,r,o;let a,l;if(e.preventDefault(),C(!1),(null===(n=e.dataTransfer)||void 0===n?void 0:null===(i=n.items)||void 0===i?void 0:i.length)>0){let t=Array.from(e.dataTransfer.items);for(let e of t)if("file"!==e.kind){alert(B("Please only drag files!"));return}a=e.dataTransfer.items[0].getAsFile(),l=t.map(e=>e.getAsFile())}else if((null===(o=e.dataTransfer)||void 0===o?void 0:null===(r=o.files)||void 0===r?void 0:r.length)>0)a=e.dataTransfer.files[0],l=e.dataTransfer.files;else{alert(B("Something went wrong!"));return}b?await t(l):await t(a),null==y||y(b?l:a)};return(0,n.BX)(n.HY,{children:[(0,n.BX)(d.sg,{alignItems:"center",justifyContent:"center",gap:12,radius:"md",className:a()(h.Z.dragArea,f,{[h.Z.dragActive]:k,"test-drag-active":k}),onDragEnter:x,onDragOver:x,onDragLeave:e=>{e.preventDefault(),C(!1)},onDrop:I,"aria-label":B("File Picker"),onClick:()=>{if(!m){var e;null===(e=S.current)||void 0===e||e.click()}},children:[!_&&(0,n.tZ)(l.Z,{size:32,strokeWidth:1.5}),!p.tq&&(0,n.tZ)("p",{className:h.Z.text,children:v?B("Loading..."):k?B("Release to upload"):_?B("Add another image"):(0,n.BX)(n.HY,{children:[i," ",B("or")," "]})}),(0,n.BX)(d.sg,{gap:4,children:[(0,n.tZ)(u.xv.B3,{color:"primary",weight:"medium",children:_?B("Add another file"):B("Drag files here to upload")}),w?"string"==typeof w?(0,n.tZ)(u.xv.B4,{color:"secondary",children:w}):w:null]}),o||(m?m(()=>{var e;null===(e=S.current)||void 0===e||e.click()}):null)]}),(0,n.tZ)("input",{className:a()(h.Z.file,"file-picker-input"),ref:S,type:"file",name:"file",accept:g,multiple:b,onInput:async e=>{let i=e.target,n=i.files;n&&n[0]&&(b?await t(n):await t(n[0]),null==Z||Z(b?n:n[0])),i.value=""}})]})}},51799:function(e,t,i){i.d(t,{d:()=>l});var n=i(16584),r=i(19081),o=i(36500),a=i(58175);function l(e){let{children:t}=e;return(0,n.tZ)(o.xw,{children:(0,n.tZ)(r.tu,{paddingY:4,paddingX:8,children:(0,n.tZ)(a.xv.B5,{color:"secondary",children:t})})})}},65523:function(e,t,i){i.d(t,{AM:()=>y,NO:()=>g,ZN:()=>Z,hQ:()=>b,xB:()=>m});var n=i(7409),r=i(16584),o=i(12048),a=i(71375);i(98661);var l=i(29032),s=i(97742),c=i(71068),d=i(15771),u=i(19081),p=i(58175),h=i(23750);let m=e=>{let t,i,{onClose:n,showClose:o=!1,title:a,description:l,icon:s,showDivider:c=!1,alignItems:d="start"}=e;return"center"===d?(t=c?P:x,i=E):(t=c?I:B,i=T),(0,r.BX)(t,{children:[s,(0,r.BX)(i,{children:[a&&(0,r.tZ)(v,{text:a}),l&&(0,r.tZ)(f,{text:l})]}),o&&n&&(0,r.tZ)(b,{onClose:n})]})},g=e=>{let{onClose:t,showClose:i=!1,image:n}=e;return(0,r.BX)(B,{children:[n,i&&t&&(0,r.tZ)(_,{onClose:t})]})},v=e=>{let{text:t}=e;return(0,r.tZ)(o.V.Title,{as:"span",children:(0,r.tZ)(p.xv.B2,{weight:"semibold",color:"primary",children:t})})},f=e=>{let{text:t}=e;return(0,r.tZ)(o.V.Description,{as:"span",children:(0,r.tZ)(p.xv.B3,{color:"secondary",children:t})})},b=e=>{let{onClose:t}=e;return(0,r.tZ)(d.hU,{priority:"quaternary",size:"sm",title:"Close",onClick:t,"aria-label":"close",position:"absolute",className:h.Z.closeButton,children:(0,r.tZ)(a.Z,{size:20})})},_=e=>{let{onClose:t}=e;return(0,r.tZ)(l.C,{children:(0,r.tZ)(d.GI,{priority:"secondary",size:"sm",title:"Close",onClick:t,"aria-label":"close",position:"absolute",className:h.Z.imageCloseButton,children:(0,r.tZ)(a.Z,{size:20})})})},y=e=>{let{icon:t,bg:i}=e;return(0,r.tZ)(w,{bg:i,children:t})},Z=()=>(0,r.tZ)(w,{bg:"accent-orange",children:(0,r.tZ)(s.Z,{height:20})}),w=e=>{let{children:t,bg:i="secondary"}=e;return(0,r.tZ)(u.X2,{display:"flex",flex:"auto",width:48,height:48,bg:i,radius:"sm",alignItems:"center",justifyContent:"center",outline:"detail",children:t})},k={display:"flex",direction:"column",gap:16,paddingX:20,paddingTop:20,alignItems:"start"},C={paddingTop:16,paddingBottom:16,borderBottom:"detail"},S={alignItems:"center"},B=(0,c.zo)((0,n._)({},k)),x=(0,c.zo)((0,n._)({},k,S)),I=(0,c.zo)((0,n._)({},k,C)),P=(0,c.zo)((0,n._)({},k,C,S)),N={display:"flex",direction:"column",gap:4},T=(0,c.zo)((0,n._)({},N)),E=(0,c.zo)((0,n._)({},N,{alignItems:"center",textAlign:"center"}))},43570:function(e,t,i){i.d(t,{D7:()=>v,NH:()=>h,Vp:()=>g});var n=i(7409),r=i(99282),o=i(98848),a=i(16584),l=i(94184),s=i.n(l),c=i(98661),d=i(15771),u=i(19081);i(58175),i(76641);var p=i(66327);let h={size:14,strokeWidth:2.5},m={display:"flex",height:20,paddingX:6,paddingY:2,gap:4,fontSize:11,fontWeight:"medium",alignItems:"center"},g=(0,c.forwardRef)((e,t)=>{var{className:i,theme:l="default",priority:c="secondary",leading:h,trailing:g,children:v,fillIcon:f,radius:b="xs",onClick:_,href:y}=e,Z=(0,o._)(e,["className","theme","priority","leading","trailing","children","fillIcon","radius","onClick","href"]);let w=void 0!==_||void 0!==y;return(0,a.BX)(d.kG,(0,r._)((0,n._)((0,r._)((0,n._)({},Z),{className:s()(i,p.Z.tag,p.Z["theme_".concat(l)],p.Z["priority_".concat(c)],w&&p.Z.clickable),onClick:_,href:y,ref:t,radius:b,cursor:w?"pointer":"inherit",tabIndex:w?0:-1}),m),{children:[h&&(0,a.tZ)(u.hs,{className:s()(p.Z.leading,f&&p.Z.fillIcon),alignItems:"center",children:h}),v,g&&(0,a.tZ)(u.hs,{className:s()(p.Z.trailing,f&&p.Z.fillIcon),alignItems:"center",children:g})]}))}),v=(0,c.forwardRef)((e,t)=>{var{className:i,priority:l="primary",leading:c,trailing:h,children:g,fillIcon:v,radius:f="xs",onClick:b,href:_}=e,y=(0,o._)(e,["className","priority","leading","trailing","children","fillIcon","radius","onClick","href"]);let Z=void 0!==b||void 0!==_;return(0,a.BX)(d.kG,(0,r._)((0,n._)((0,r._)((0,n._)({},y),{className:s()(i,p.Z.tag,p.Z.media,p.Z["priority_".concat(l)],Z&&p.Z.clickable),onClick:b,href:_,ref:t,radius:f,cursor:Z?"pointer":"inherit",tabIndex:Z?0:-1}),m),{children:[c&&(0,a.tZ)(u.hs,{className:s()(p.Z.leading,v&&p.Z.fillIcon),alignItems:"center",children:c}),g,h&&(0,a.tZ)(u.hs,{className:s()(p.Z.trailing,v&&p.Z.fillIcon),alignItems:"center",children:h})]}))});v.displayName="MediaTag"},15186:function(e,t,i){i.d(t,{Z:()=>m});var n=i(7409),r=i(99282),o=i(16584),a=i(49550),l=i(98661),s=i(95441),c=i(15771),d=i(80026),u=i(17172),p=i(45783),h=i(20346);function m(e){let{tabs:t,value:i,onChange:c,ariaLabel:m}=e,{iString:b}=(0,s.M1)(),_=(0,l.useRef)(null),y=(0,l.useRef)(null),{props:Z,hasOverflow:w}=(0,u.aZ)(_),{state:k}=(0,p.eK)(_),C=e=>{let t=y.current,i=_.current;if(!i||!t||e<0)return;let n=i.getElementsByClassName(h.Z.segment)[e];if(!n)return;let r=n.getBoundingClientRect(),o=i.getBoundingClientRect(),a=parseInt(window.getComputedStyle(i).paddingLeft),l=r.left-o.left-a+i.scrollLeft;requestAnimationFrame(()=>{t.style.setProperty("--highlight-width","".concat(r.width,"px")),t.style.setProperty("--highlight-x","".concat(l,"px"))})},S=t.findIndex(e=>e.value===i);return(0,l.useLayoutEffect)(()=>{C(S)},[t,i,S]),(0,l.useEffect)(()=>{C(S)},[t,i,S]),(0,o.BX)(v,{children:[(0,o.tZ)(a.O.Group,{manual:!0,selectedIndex:-1===S?0:S,onChange:e=>{var i;let n=null===(i=t[e])||void 0===i?void 0:i.value;void 0!==n&&c(n)},children:(0,o.tZ)(a.O.List,(0,r._)((0,n._)({as:d.X2},Z),{ref:_,className:h.Z.container,position:"relative",cursor:w()?"grab":"default",gap:4,padding:4,radius:"sm",overflow:"auto",scrollBar:"hidden",outline:"detail","aria-label":null!=m?m:"".concat(b("Tabs")),children:()=>(0,o.BX)(o.HY,{children:[t.map((e,t)=>(0,o.tZ)(g,{tab:e,index:t,children:e.label},e.value)),(0,o.tZ)(f,{ref:y})]})}))}),(0,o.tZ)(p.R3,{direction:"left",isVisible:k.showLeft}),(0,o.tZ)(p.R3,{direction:"right",isVisible:k.showRight})]})}function g(e){let{tab:t,index:i,children:n}=e;return(0,o.tZ)(a.O,{as:l.Fragment,children:e=>{let{selected:r}=e;return(0,o.tZ)(c.zx,{className:h.Z.segment,leading:t.leadingIcon,trailing:t.trailingIcon,priority:r?"tertiary":"quaternary",size:"sm",children:n},i)}})}let v=(0,d.zo)({display:"flex",direction:"column",position:"relative",bg:"primary",radius:"sm",minWidth:0,overflow:"hidden"}),f=(0,d.zo)({position:"absolute",height:32,radius:"xs",bg:"secondary",sizing:"border-box",className:h.Z.highlight});(0,d.zo)({display:"flex",alignItems:"center",justifyContent:"center",width:24,height:24})},17564:function(e,t,i){i.d(t,{S:()=>l});var n=i(16584),r=i(94184),o=i.n(r),a=i(12517);let l=e=>{let{animated:t=!0,width:i,height:r,aspectRatio:l,className:s,multiply:c}=e,d=o()(a.Z.container,s,{[a.Z.containerAnimated]:t,[a.Z.containerMultiply]:c});return l?(0,n.tZ)("div",{style:"aspect-ratio:".concat(l),children:(0,n.tZ)("div",{className:d,style:{width:i,height:null!=r?r:"100%"}})}):(0,n.tZ)("div",{className:d,style:{width:i,height:r}})}},76641:function(e,t,i){i(14293),i(84864)},45783:function(e,t,i){i.d(t,{R3:()=>v,eK:()=>h,rQ:()=>m});var n=i(7409),r=i(99282),o=i(16584),a=i(94184),l=i.n(a),s=i(56743),c=i(2564),d=i(98661),u=i(80026),p=i(68857);let h=function(e){let{inset:t=0,pageSizeAdjust:i=0,initialState:o,scrollFullPage:a=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},[l,s]=(0,d.useState)(o||{showLeft:!1,showRight:!1});return(0,d.useEffect)(()=>{let{current:i}=e;if(i){let e=()=>{s(e=>{let o=e;!o.showLeft&&i.scrollLeft>t?o=(0,r._)((0,n._)({},e),{showLeft:!0}):o.showLeft&&i.scrollLeft<=t&&(o=(0,r._)((0,n._)({},e),{showLeft:!1}));let a=i.scrollWidth-i.offsetWidth-4-t;return!o.showRight&&i.scrollLeft=a&&(o=(0,r._)((0,n._)({},e),{showRight:!1})),o})};return i.addEventListener("scroll",e),setTimeout(()=>{e()},50),()=>{i.removeEventListener("scroll",e)}}},[]),{state:l,handleArrowClick:t=>()=>{let{current:n}=e;n&&n.scrollBy({left:t*(a?n.offsetWidth:n.offsetWidth/2-i),behavior:"smooth"})}}};function m(e){let{direction:t,isVisible:i=!0,onClick:n}=e;return(0,o.tZ)(u.hs,{alignItems:"center",justifyContent:"center",position:"absolute",className:l()(p.Z.arrowButtonContainer,p.Z.arrowButtonOffsetContainer,i&&p.Z.visible,p.Z[t]),children:(0,o.tZ)(g,{direction:t,isVisible:i,onClick:n})})}function g(e){let{direction:t,isVisible:i=!0,onClick:n,className:r}=e;return(0,o.tZ)(u.hU,{size:"sm",priority:"quaternary",disabled:!i,className:r,onClick:n,"aria-hidden":!i,"aria-label":i?"left"===t?"Previous":"Next":void 0,children:"left"===t?(0,o.tZ)(s.Z,{}):(0,o.tZ)(c.Z,{})})}function v(e){let{direction:t,isVisible:i=!0,children:n,bg:r="primary"}=e;return(0,o.BX)(u.hs,{alignItems:"center",className:l()(p.Z.arrowButtonContainer,p.Z.arrowButtonOverlaidContainer,i&&p.Z.visible,p.Z[t]),children:[(0,o.tZ)("div",{className:l()(p.Z.overlay,p.Z[r])}),n]})}},3021:function(e,t,i){i.d(t,{E$:()=>U,KL:()=>H,Zx:()=>W,_v:()=>O,au:()=>M,dg:()=>z,kJ:()=>D,rS:()=>j});var n=i(16584),r=i(30396),o=i(94184),a=i.n(o),l=i(71375),s=i(52066),c=i(20160),d=i(1548),u=i(46990),p=i(72241),h=i(50012),m=i(57391),g=i(35543),v=i(95441),f=i(60807),b=i(53678),_=i(68833),y=i(62981),Z=i(98750),w=i(98914),k=i(94874),C=i(17540),S=i(15771),B=i(95901),x=i(19081),I=i(58175),P=i(15503),N=i(40559),T=i(65575),E=i(46464),X=i(60308),L=i(33884),F=i(63651),R=i(25390);let M="inviteFriendsNuxDismissed";function U(e){let{feedUserSuggestion:t,surface:i,hoverCardPlacement:o}=e,{exposeExperiment:s,getExperimentVariant:d}=(0,m.jc)();s("social_context_in_pymk_feed_module_v2");let u=d("social_context_in_pymk_feed_module_v2"),p=(0,r.sO)(null),h=(0,g.Sv)(t.user,i),v=h.isFollowing?"Following":t.isFollowing&&(null==u?void 0:u.startsWith("treatment"))?"Follow Back":"Follow",f=h.isFollowing?"secondary":"primary",_=(0,E.Z)(t),[y,C]=(0,r.eJ)(!1),N="feed"===i?"pymk_notes_feed_item":"suggestions"===i?"pymk_notes_suggestions_page":"pymk_notes_sidebar";(0,Z.UM)(p,()=>{(0,P.MJ)(t,i,{extraEventProps:{has_social_context:!!t.mutualsContext}})});let[T,X]=(0,r.eJ)(!1),L=e=>{T||(X(!0),(0,P.CD)(t,i,e))},M=e=>{L("user-suggestion"),e.defaultPrevented||(0,w.uX)((0,F.NNq)(t.user,{utm_source:N}),{event:e})},U=e=>{e.preventDefault(),L("user-suggestion-cta"),h.toggle()},O=async e=>{e.preventDefault(),L("user-suggestion-dismiss"),C(!0),await fetch("/api/v1/reader/feed/user-suggestions/".concat(t.user.id,"/dismiss"),{method:"POST"})};return y?null:"feed"===i?(0,n.tZ)(c.W,{children:(0,n.BX)(x.tu,{ref:p,className:a()(R.Z.personYouMayKnow,R.Z.personYouMayKnowFeed,(null==u?void 0:u.startsWith("treatment"))&&R.Z.withSocialContext),alignItems:"center",bg:"primary",border:"detail",padding:12,gap:12,radius:"lg",shadow:"md",onClick:M,justifyContent:"space-between",children:[(0,n.tZ)(S.hU,{size:"sm",priority:"tertiary",className:R.Z.close,onClick:O,children:(0,n.tZ)(l.Z,{size:16})}),(0,n.tZ)(k.qE,{user:t.user,size:(null==u?void 0:u.startsWith("treatment"))?100:80}),(0,n.BX)(x.tu,{minWidth:0,flex:"grow",justifyContent:"start",alignSelf:"stretch",children:[(0,n.tZ)(I.xv.B4,{decoration:"hover-underline",weight:"semibold",textAlign:"center",ellipsis:!0,children:(0,n.tZ)(b.xG,{user:t.user,ellipsis:!0,children:t.user.name})}),(null==u?void 0:u.startsWith("treatment"))?t.mutualsContext?(0,n.tZ)(A,{mutualsContext:t.mutualsContext,showFacepile:"treatment-facepile"===u}):(0,n.tZ)(I.xv.B5,{align:"center",color:"secondary",clamp:2,style:{lineHeight:"13px",marginTop:"4px"},children:_}):(0,n.tZ)(I.xv.B4,{align:"center",color:"secondary",ellipsis:!0,children:_})]}),(0,n.tZ)(S.zx,{size:"sm",priority:f,onClick:U,alignSelf:"stretch",justifyContent:"center",children:v})]})}):(0,n.tZ)(D,{user:t.user,source:N,publication:t.publication,label:_,hoverCardPlacement:o,onClick:M,cta:(0,n.BX)(x.gq,{alignItems:"center",gap:8,children:[(0,n.tZ)(S.zx,{size:"sm",priority:f,onClick:U,children:v}),(0,n.tZ)(B.P,{size:"sm",priority:"tertiary",onClick:O})]}),boxRef:p})}function A(e){let{mutualsContext:t,showFacepile:i}=e,{iString:r}=(0,v.M1)(),o=t.users.sort(e=>e.photo_url?1:-1);return 0===o.length?null:(0,n.BX)(x.X2,{alignItems:"center",justifyContent:"center",gap:6,className:R.Z.personYouMayKnowMutuals,children:[i&&(0,n.tZ)(x.X2,{style:{paddingLeft:6},children:o.slice(0,3).map(e=>(0,n.tZ)(x.X2,{as:"a",className:R.Z.facepileLink,href:(0,F.NNq)(e),children:(0,n.tZ)(T.t5,{className:R.Z.facepileFace,src:e.photo_url||(0,X.I4e)(e.id),size:20})},e.id))}),(0,n.BX)(I.xv.B5,{color:"secondary",clamp:2,style:{lineHeight:"13px"},textAlign:i?"left":"center",children:[r("Followed by "),(0,n.tZ)(d.M,{array:o,limit:3,formatter:e=>(0,n.tZ)(b.hh,{href:(0,F.NNq)(e),children:e.name})})]})]})}function D(e){let{user:t,publication:i,label:r,hoverCardPlacement:o,onClick:a,cta:l,source:s,boxRef:c}=e,d=(0,f.aF)(),u=t&&t.id===(null==d?void 0:d.id);return(0,n.BX)(x.hs,{ref:c,className:R.Z.personYouMayKnow,alignItems:"center",justifyContent:"space-between",padding:8,gap:12,onClick:a,radius:"md",flex:"grow",children:[(0,n.BX)(x.hs,{gap:12,minWidth:0,children:[(0,n.tZ)(C.w,{pub:i||void 0,children:(0,n.tZ)(k.xV,{user:t,size:40})}),(0,n.BX)(x.tu,{minWidth:0,justifyContent:"center",children:[(0,n.tZ)(h.C,{subject:t,placement:o,utmSource:s,children:(0,n.tZ)(b.hh,{href:(0,F.NNq)(t),showBack:!0,ellipsis:!0,children:(0,n.tZ)(I.xv.B3,{as:"span",decoration:"hover-underline",weight:"semibold",clamp:1,children:t.name})})}),(0,n.tZ)(I.xv.B4,{color:"secondary",ellipsis:!0,as:i?"a":void 0,decoration:i?"hover-underline":void 0,target:"_blank",rel:"noopener","data-native":!0,onClick:e=>{e.stopPropagation()},href:i?(0,X.TJI)(i):void 0,children:r})]})]}),!u&&l]})}function O(){return(0,n.BX)(x.hs,{className:R.Z.personYouMayKnow,alignItems:"center",padding:8,gap:12,children:[(0,n.tZ)(T.Vm,{type:"circle",className:R.Z.personYouMayKnowImage}),(0,n.BX)(x.tu,{style:{width:"100%"},gap:8,children:[(0,n.tZ)(T.Vm,{type:"bar",width:"80%",height:16}),(0,n.tZ)(T.Vm,{type:"bar",width:"40%",height:16})]})]})}function z(){let[e,t]=(0,y.Z)("facebookPymkNuxDismissed",604800);return e?null:(0,n.tZ)(c.W,{children:(0,n.BX)(x.tu,{className:a()(R.Z.personYouMayKnow,R.Z.personYouMayKnowFeed),border:"detail",alignItems:"center",bg:"primary",padding:12,gap:12,style:{position:"relative"},radius:"md",children:[(0,n.tZ)(B.P,{className:R.Z.close,onClick:t}),(0,n.tZ)(u.Z,{fill:"var(--color-accent-fg-blue)",stroke:"none",height:64,width:64}),(0,n.BX)(x.tu,{alignItems:"center",minWidth:0,flex:"grow",children:[(0,n.tZ)(I.xv.B4,{align:"center",weight:"bold",ellipsis:!0,children:"Connect Facebook"}),(0,n.tZ)(I.xv.B4,{align:"center",color:"secondary",ellipsis:!0,children:"Find your friends"})]}),(0,n.tZ)(S.zx,{size:"sm",priority:"primary",href:(0,F.B6d)({type:"reader2",redirect:(0,X.E2n)()}),style:{backgroundColor:"var(--color-accent-fg-blue)"},localNavigation:!1,onClick:()=>(0,_.j)(_.FP.CONNECT_FACEBOOK_SCREEN_VIEWED,{source:"suggestions"}),children:"Connect"})]})})}function j(){return(0,n.BX)(x.tu,{alignItems:"center",gap:12,paddingX:32,paddingY:8,children:[(0,n.tZ)(s.Z,{size:32,fill:"var(--color-accent-fg-cyan)",stroke:"none"}),(0,n.BX)(x.tu,{alignItems:"center",gap:6,children:[(0,n.tZ)(I.xv.H4,{children:"Find people you know"}),(0,n.tZ)(I.xv.B4,{align:"center",color:"secondary",children:"Connect Twitter to see what the people you follow are reading."})]}),(0,n.tZ)(S.zx,{priority:"primary",href:(0,X.ISD)({type:"reader2",redirect:L.Ds}),localNavigation:!1,style:{backgroundColor:"var(--color-accent-fg-cyan)"},rounded:!0,children:"Connect Twitter"})]})}function H(){let[,e]=(0,y.Z)("sidebarFacebookNuxDismissed");return(0,n.BX)(x.tu,{position:"relative",alignItems:"center",gap:12,paddingX:32,paddingY:8,children:[(0,n.tZ)(B.P,{className:R.Z.close,onClick:()=>{e()}}),(0,n.tZ)(u.Z,{width:40,height:40}),(0,n.BX)(x.tu,{alignItems:"center",gap:6,children:[(0,n.tZ)(I.xv.H4,{children:"Find your friends"}),(0,n.tZ)(I.xv.B4,{align:"center",color:"secondary",children:"Connect Facebook to see what your friends are reading."})]}),(0,n.tZ)(S.zx,{priority:"primary",href:(0,F.B6d)({type:"reader2",redirect:(0,X.E2n)()}),localNavigation:!1,style:{backgroundColor:"var(--color-accent-fg-blue)"},rounded:!0,onClick:()=>(0,_.j)(_.FP.CONNECT_FACEBOOK_SCREEN_VIEWED,{source:"sidebar"}),children:"Connect Facebook"})]})}function W(e){let{utmSource:t}=e,[i,o]=(0,r.eJ)(!1),[a,l]=(0,r.eJ)(!1),{user:s,changeSetting:c}=(0,f.SE)(),[,d]=(0,y.Z)(M),[,u]=(0,y.Z)("sidebarInviteFriendsNuxDismissed");if(!s)return null;let h=()=>{c("invite_friends_nux_dismissed_at",new Date().toISOString()),d()};return(0,n.BX)(n.HY,{children:[(0,n.tZ)(x.tu,{children:(0,n.BX)(x.tu,{alignItems:"center",gap:12,padding:32,className:R.Z.shareProfile,children:[(0,n.tZ)(B.P,{className:R.Z.close,onClick:()=>{h(),u()}}),(0,n.BX)(x.tu,{className:R.Z.avatarContainer,children:[(0,n.tZ)(k.qE,{user:s,size:48}),(0,n.tZ)(x.hs,{className:R.Z.badge,padding:4,children:(0,n.tZ)(p.HA,{className:R.Z.badgeIcon})})]}),(0,n.BX)(x.tu,{alignItems:"center",gap:6,children:[(0,n.tZ)(I.xv.H4,{children:"Invite your friends"}),(0,n.tZ)(I.xv.B4,{align:"center",color:"secondary",children:"Share your profile to help your friends find you on Substack."})]}),(0,n.tZ)(S.zx,{priority:"primary",onClick:()=>{o(!0),(0,_.j)(_.FP.INVITE_FRIENDS_MODAL_SHOWN,{source:t})},rounded:!0,children:"Invite friends"})]})}),(0,n.tZ)(N.N,{isOpen:i,utmSource:t,onClose:()=>{o(!1),a&&h()},setShared:()=>l(!0)})]})}},75419:function(e,t,i){i.d(t,{Au:()=>j,i3:()=>H,oC:()=>W,pe:()=>A,sA:()=>U});var n=i(7409),r=i(99282),o=i(98848),a=i(16584),l=i(6400),s=i(30396),c=i(94184),d=i.n(c),u=i(13639),p=i(20160),h=i(57391),m=i(95441),g=i(60807),v=i(68733),f=i(68833),b=i(48980),_=i(7882),y=i(97505),Z=i(94874),w=i(15771),k=i(19081),C=i(6490),S=i(58175),B=i(27744),x=i(74312),I=i(81043),P=i(91400),N=i(43254),T=i(50364),E=i(63651),X=i(84864),L=i(47929),F=i(7083);let R={utm_campaign:L.VX.notesPostAppUpsell,utm_source:L.b3.substack};function M(e){var{isOpen:t}=e,l=(0,o._)(e,["isOpen"]);return(0,a.tZ)(C.u_,{className:F.Z.composerModal,isOpen:t,onClose:l.onClose,fullscreenMobile:!0,width:600,children:(0,a.tZ)(x.cr,(0,r._)((0,n._)({},l),{module:"../feed/NoteComposer",resolve:e=>e.NoteComposer,onRequest:()=>Promise.all([i.e("6054"),i.e("2601")]).then(i.bind(i,5817)),whileLoading:(0,a.tZ)("div",{style:{height:336}})}))})}function U(e){let{disabled:t,parentPubId:i,parentPostId:o,parentCommentId:l,restackUrl:s,placeholder:c,tabId:u,surface:f,initialText:b,className:_,textClassName:y,parentMediaClipId:C}=e,{iString:B}=(0,m.M1)(),x=H(),P=(0,g.aF)(),{requireLogin:N,onboardingModalRef:T}=(0,I.SJ)(),{getExperimentVariant:E}=(0,h.jc)(),X=(0,v.Fm)({onAddFiles:e=>{x.open((0,n._)({parentPubId:i,parentPostId:o,parentCommentId:l,restackUrl:s,initialFiles:e,tabId:u,surface:f,initialText:b},C&&{parentMediaClipId:C}))},acceptFile:v.N1});return(0,a.tZ)(k.tu,(0,r._)((0,n._)({},X.props),{position:"relative",children:(0,a.tZ)(w.kG,{onClick:()=>{if(!t){if(P)x.open((0,n._)({parentPubId:i,parentPostId:o,parentCommentId:l,restackUrl:s,tabId:u,surface:f,initialText:b},C&&{parentMediaClipId:C}));else if("control"===(E("homepage_welcome_card_2")||"control"))null==N||N();else{var e;null===(e=T.current)||void 0===e||e.open()}}},disabled:t,radius:"md",resetCss:!0,showFocus:!0,animate:!0,"aria-label":B("New post"),children:(0,a.tZ)(p.W,{children:(0,a.BX)(k.gq,{padding:16,gap:12,radius:"md",alignItems:"center",bg:"primary",border:"detail",shadow:"xs",cursor:"pointer",userSelect:"none",className:d()(F.Z.inlineComposer,X.isDragging&&F.Z.isDragging,_),animate:!0,children:[P?(0,a.tZ)(Z.qE,{size:36,user:P,"aria-hidden":!0}):(0,a.tZ)(k.hs,{flex:"auto",children:(0,a.tZ)(Z.qE,{size:36,"aria-hidden":!0})}),(0,a.tZ)(S.xv.B2,{align:"left",color:"secondary",flex:"grow",ellipsis:!0,className:y,children:c||"What's on your mind?"})]})})})}))}function A(e){let{disabled:t,parentPubId:i,parentPostId:o,parentCommentId:l,placeholder:s,tabId:c,surface:u,parentMediaClipId:p}=e,h=H(),m=(0,g.aF)(),f=(0,P.XA)(),{requireLogin:b}=(0,I.SJ)(),_=(0,v.Fm)({onAddFiles:e=>{h.open((0,n._)({parentPubId:i,parentPostId:o,parentCommentId:l,initialFiles:e,tabId:c,surface:u},p&&{parentMediaClipId:p}))},acceptFile:v.N1});return(0,a.tZ)(k.tu,(0,r._)((0,n._)({},_.props),{children:(0,a.tZ)(w.kG,{onClick:()=>{!t&&(m?h.open((0,n._)({parentPubId:i,parentPostId:o,parentCommentId:l,tabId:c,surface:u},p&&{parentMediaClipId:p})):null==b||b())},disabled:t,resetCss:!0,children:(0,a.BX)(k.gq,{padding:16,gap:12,alignItems:"center",bg:"primary",cursor:"pointer",className:d()(F.Z.mobileInlineComposer,{[F.Z.isDropping]:_.isDragging}),children:[m?(0,a.tZ)(Z.qE,{size:36,user:m}):(0,a.tZ)(k.hs,{flex:"auto",children:(0,a.tZ)(Z.qE,{size:36})}),(0,a.tZ)(S.xv.B3,{align:"left",color:"secondary",flex:"grow",children:s||"What's on your mind?"}),!f&&(0,a.tZ)(D,{})]})})}))}function D(){return(0,a.tZ)(k.hs,{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 O={isOpen:!1,firstComment:void 0},z=(0,l.createContext)({state:O,open:async()=>{throw Error("Not implemented")}});function j(e){var t,o,l;let{children:c}=e,d=(0,g.aF)(),u=!(null==d?void 0:d.name),p=(0,B.I0)(),[v,_]=(0,s.eJ)(O),[Z,w]=(0,s.eJ)(!1),{exposeExperiment:k,getExperimentVariant:S}=(0,h.jc)(),I=(0,g.SE)(),P=(0,s.sO)(),{iString:N}=(0,m.M1)(),{feedItem:T}=v,E=W(T),L=(null==T?void 0:T.type)==="comment"?null!==(o=null===(t=T.parentComments)||void 0===t?void 0:t[0])&&void 0!==o?o:T.comment:null;(0,s.d4)(()=>{d&&Promise.all([i.e("6054"),i.e("2601")]).then(i.bind(i,5817))},[d]),(0,s.d4)(()=>{v.isOpen&&i.e("6175").then(i.bind(i,21516))},[v.isOpen]),(0,s.d4)(()=>{v.appInstallUsers&&Promise.resolve().then(i.bind(i,83034))}),(0,s.d4)(()=>{v.isOpen&&u&&w(!0)},[P,u,v.isOpen]);let F=(0,s.Ye)(()=>({state:v,open:e=>new Promise((t,i)=>{_((0,r._)((0,n._)({},O,e),{isOpen:!0,resolve:t,reject:i}))})}),[v]),U=function(){var e,t,i;let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};null===(t=document.activeElement)||void 0===t||null===(e=t.blur)||void 0===e||e.call(t),null===(i=v.onDismiss)||void 0===i||i.call(v),_((0,n._)((0,r._)((0,n._)({},v),{isOpen:!1}),o))};return(0,a.BX)(z.Provider,{value:F,children:[c,u?(0,a.tZ)(y.Z,{displaySignInModal:Z,onCloseSignInModal:()=>{w(!1),_((0,r._)((0,n._)({},v),{isOpen:!1}))},isStatic:!1,entry:"composer-new-post"}):E?(0,a.tZ)(C.u_,{isOpen:v.isOpen,onClose:()=>U(),width:316,children:(0,a.tZ)(q,{onClose:()=>U(),requirement:E,writerId:null!==(l=null==L?void 0:L.user_id)&&void 0!==l?l:0})}):(0,a.tZ)(M,(0,r._)((0,n._)({},v),{isOpen:v.isOpen,onClose:()=>U(),onSuccess:async e=>{var t,i;let o;if(d&&!d.reader_installed_at&&(null==I?void 0:I.userSettings)&&!I.userSettings.has_seen_notes_post_app_upsell&&(I.changeSetting("has_seen_notes_post_app_upsell",!0),k("app_upsell_after_posting_notes"),"treatment"===S("app_upsell_after_posting_notes")))try{o=await (0,b.rd)("/api/v1/app_install_facepile")}catch(e){o=[]}o?((0,f.j)(f.FP.APP_INSTALL_MODAL_OPENED,R),_((0,r._)((0,n._)({},v),{appInstallUsers:o}))):e.isFirstFeedCommentByUser?_((0,r._)((0,n._)({},v),{firstComment:e})):U(),p({type:v.editComment?"edit_comment":"new_comment",payload:{comment:e}}),null===(t=v.onCompose)||void 0===t||t.call(v,e),null===(i=v.resolve)||void 0===i||i.call(v,e)},onError:v.reject})),(0,a.tZ)(C.u_,{isOpen:v.isOpen&&!!v.firstComment,children:v.firstComment&&(0,a.tZ)(x.cr,{module:"@/frontend/feed/NuxModal",resolve:e=>e.FeedNuxShareFirstNote,onRequest:()=>i.e("6175").then(i.bind(i,21516)),onClose:()=>U(),comment:v.firstComment})}),v.appInstallUsers&&(0,a.tZ)(x.cr,(0,n._)({module:"../components/app_install_modal",resolve:e=>e.AppInstallModal,onRequest:()=>Promise.resolve().then(i.bind(i,83034)),onClose:()=>{U({appInstallUsers:void 0})},isOpen:!!v.appInstallUsers,overrideTitle:v.appInstallUsers.length>0?"Join ".concat((0,X.oxfordComma)([...v.appInstallUsers.map(e=>e.name),"others"]).toString()," in the Substack app"):"Notes is better in the Substack app",overrideCTA:N("Get the app"),width:500,facepileUsers:v.appInstallUsers,showMobileClose:!0},R))]})}function H(){return(0,s.qp)(z)}function W(e){var t,i;let n=(0,g.aF)(),r=null==e?void 0:e.post,o=(null==e?void 0:e.type)=="comment"?null!==(i=null===(t=e.parentComments)||void 0===t?void 0:t[0])&&void 0!==i?i:e.comment:null,{user_id:a}=null!=o?o:{},{reply_minimum_role:l}=null!=o?o:{},s=(0,N.K1)(null!=a?a:0);if(null==l&&(null==r?void 0:r.write_comment_permissions)==="only_paid"&&(l="paid_subscriber"),!a||!l||(null==e?void 0:e.canReply)||o&&n&&(0,T._N)(o,n.id))return null;if(l){if("free_subscriber"===l&&(!s||!["free_subscription","subscribed"].includes(s)))return"free_subscriber";if("paid_subscriber"===l&&"subscribed"!==s)return"paid_subscriber"}return null}function q(e){var t;let{requirement:i,writerId:n,onClose:r}=e,o=(0,g.aF)(),{result:l}=(0,_.ib)({pathname:"/api/v1/user/".concat(n,"/primary-publication"),deps:[n],auto:!0});return(0,a.BX)(k.tu,{padding:16,children:[(0,a.tZ)(k.hs,{justifyContent:"center",paddingTop:16,paddingBottom:20,children:(0,a.tZ)(u.Z,{size:32,color:"var(--color-fg-primary)"})}),(0,a.BX)(k.tu,{gap:20,children:[(0,a.BX)(k.tu,{gap:8,alignItems:"center",children:[(0,a.tZ)(S.xv.H3,{align:"center",children:"free_subscriber"===i?"Subscribers only":"Paid subscribers only"}),l&&(0,a.BX)(S.xv.B3,{color:"secondary",align:"center",children:["To join the conversation,"," ","free_subscriber"===i?"subscribe":"become a paying subscriber"," ","to ",null!==(t=l.name)&&void 0!==t?t:"this publication","."]})]}),(0,a.BX)(k.tu,{gap:8,children:[l&&(0,a.tZ)(w.zx,{priority:"primary",rounded:!0,href:(0,E.W1P)(l,{user:o,addBase:!0,params:{utm_source:L.b3.feedCommentReplyRestriction}}),children:"Subscribe"}),(0,a.tZ)(w.zx,{priority:"secondary",rounded:!0,onClick:r,children:"Cancel"})]})]})]})}},65575:function(e,t,i){i.d(t,{ET:()=>I,EU:()=>N,SC:()=>P,T3:()=>C,Uj:()=>y,Vm:()=>_.V,eK:()=>p.eK,fG:()=>Z,gq:()=>u.gq,mE:()=>x,nv:()=>w,pe:()=>B,t5:()=>b.t,tu:()=>u.tu,zr:()=>T});var n=i(7409),r=i(99282),o=i(98848),a=i(16584),l=i(98661),s=i(94184),c=i.n(s);i(1852);var d=i(80878);i(98914);var u=i(19081);i(58175);var p=i(45783),h=i(66611),m=i(76566);i(91400);var g=i(63651),v=i(47929),f=i(28840),b=i(38202),_=i(36889);let y=(0,l.forwardRef)((e,t)=>{var{isPadded:i=!0,className:l,linkClassName:s}=e,d=(0,o._)(e,["isPadded","className","linkClassName"]);return(0,a.tZ)("div",{ref:t,className:c()(f.Z.linkRow,i&&f.Z.isPadded,l),children:(0,a.tZ)(Z,(0,r._)((0,n._)({},d),{className:s}))})});function Z(e){var{children:t,className:i,href:l,newTab:s,onClick:p,noAnchor:h,native:m,utmCampaign:b,utmSource:_,isSelected:y}=e,Z=(0,o._)(e,["children","className","href","newTab","onClick","noAnchor","native","utmCampaign","utmSource","isSelected"]);let w="undefined"!=typeof location?location.pathname:"",k=h||null==l?"div":"a",C=l&&(0,g.n1t)(l,{utm_source:_||w,utm_medium:v.lP.reader2,utm_campaign:b});return(0,a.tZ)(u.hs,(0,r._)((0,n._)({as:k,className:c()(f.Z.linkRowA,i,(C||p)&&null==y&&f.Z.isClickable,y&&f.Z.isSelected,null!=y&&f.Z.isSelectable),"data-selected":y,href:C,target:s?"_blank":void 0,onClick:e=>{p&&p(e),!e.defaultPrevented&&h&&C&&(0,d.Q)(e,C,{native:m,newTab:s})},showFocus:!0,animate:!0},Z),{children:t}))}function w(e){var{className:t,variant:i,size:r,serif:l,isConstrained:s,maxLines:d=3}=e,u=(0,o._)(e,["className","variant","size","serif","isConstrained","maxLines"]);return(0,a.tZ)("div",(0,n._)({className:c()("reader2-paragraph",i&&"reader2-".concat(i),r&&"reader2-font-".concat(r),l&&"reader2-font-serif",s&&"reader2-clamp-lines reader2-".concat(d,"-lines"),t)},u))}function k(e){let{className:t,children:i}=e;return(0,a.tZ)("div",{className:c()("reader-nav-center",t),children:(0,a.tZ)("div",{className:"reader2-page reader2-font-base",children:i})})}function C(e){let{className:t,scrollRef:i,children:n}=e;return(0,a.tZ)(S,{ref:i,children:(0,a.tZ)(k,{className:t,children:n})})}let S=(0,l.forwardRef)((e,t)=>(0,a.tZ)(m.S,{children:(0,a.tZ)("div",(0,n._)({id:"reader-nav-page-scroll",className:c()("reader-nav-page-scroll",e.className),ref:t},e))}));function B(e){var{gap:t=16}=e,i=(0,o._)(e,["gap"]);return(0,a.tZ)(u.tu,(0,r._)((0,n._)({},i),{className:c()(f.Z.pageStack,f.Z["gap_".concat(t)])}))}(0,l.forwardRef)((e,t)=>{var{className:i,hasError:l}=e,s=(0,o._)(e,["className","hasError"]);return(0,a.tZ)("input",(0,r._)((0,n._)({className:c()(f.Z.input,l&&f.Z.error,i)},s),{ref:t}))}),(0,h.L)("reader2-page-top"),(0,h.L)(f.Z.pageTopFixed),(0,h.L)("reader2-page-body");let x=(0,h.L)(f.Z.pageStack),I=(0,h.L)("reader2-page-center");(0,h.L)("reader2-modal-title-text"),(0,h.L)("reader2-column"),(0,h.L)("reader2-text-h3 reader2-section-title"),(0,h.L)("reader2-text-h4"),(0,h.L)("reader2-item-title");let P=(0,h.L)("reader2-item-meta");(0,h.L)("reader2-form-error"),(0,h.L)("reader2-subtitle"),(0,h.L)("reader2-separator","hr"),(0,h.L)("reader2-page-section withTitle"),(0,h.L)("reader2-row reader2-split-row");let N=(0,h.L)(c()(f.Z.hoverLink,"pencraft"),"a");function T(e){return(0,a.tZ)(N,(0,n._)({target:"_blank"},e))}},19801:function(e,t,i){i.d(t,{Zg:()=>el,nK:()=>j});var n=i(7409),r=i(99282),o=i(98848),a=i(16584),l=i(98661),s=i(30396),c=i(94184),d=i.n(c),u=i(8618),p=i(13808),h=i(98643),m=i(20817),g=i(99869),v=i(1548),f=i(41069),b=i(29176),_=i(31548),y=i(13774);i(4168);var Z=i(94442),w=i(60807),k=i(81914),C=i(68833),S=i(12799),B=i(98750),x=i(98914),I=i(10656),P=i(15771),N=i(19081),T=i(38841),E=i(58175),X=i(87989),L=i(65575),F=i(26960),R=i(31541),M=i(91400),U=i(64172),A=i(93903),D=i(60308),O=i(84864),z=i(81352);function j(e){var t,{post:i,pub:l,openInPostViewer:s,canonicalUrl:c}=e,d=(0,o._)(e,["post","pub","openInPostViewer","canonicalUrl"]);let u=!!(0,w.aF)(),{subscription:p}=(0,U.p6)(l.id);return(0,a.tZ)(H,(0,r._)((0,n._)({},d),{post:i,postId:i.id,title:i.title,description:(0,A.Z)(i.description),bylines:i.publishedBylines,consumptionTime:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"md",{minutes:i,action:n}=function(e){let t;let{comment_count:i,podcast_duration:n,wordcount:r,videoUpload:o}=e,a=null,l=(0,I.z_)(e);if(o&&o.duration&&o.duration>0)t=o.duration/60,a="watch";else if("podcast"===l)t=n/60,a="listen";else{if("thread"===l)return{minutes:0,action:i>0?"".concat(i.toLocaleString()," replies"):"Thread"};if(null==r||!(r>0))return{minutes:0,action:null};t=r/O.READ_WORDS_PER_MINUTE,a="read"}return{minutes:Math.max(Math.round(t),1),action:a}}(e);if(null===n)return"";let r=function(e,t){if(0===e||!e)return"";let i=Math.floor(e/60),n=e%60;switch(t){case"lg":return i>0?"".concat(i.toLocaleString()," hours ").concat(n>0?"".concat(n.toLocaleString()," minutes"):""):"".concat(n.toLocaleString()," minutes");case"sm":return i>0?"".concat(i.toLocaleString(),"h ").concat(n>0?"".concat(n.toLocaleString(),"m"):""):"".concat(n.toLocaleString(),"m");default:return i>0?"".concat(i.toLocaleString()," hr ").concat(n>0?"".concat(n.toLocaleString()," min"):""):"".concat(n.toLocaleString()," min")}}(i,t);return"".concat(r," ").concat(n)}(i),coverImage:i.cover_image,type:(0,I.z_)(i),Icon:"podcast"===(t=(0,I.z_)(i))?b.f:"video"===t?y.O:"thread"===t?_.o:null,canonicalUrl:null!=c?c:(0,D.uRy)(l,i,{signedIn:u}),noNewTab:s,timestamp:i.post_date,pub:l,audienceBadge:["only_paid","founding"].includes(i.audience)?(null==p?void 0:p.membership_state)==="free_signup"&&i.should_send_free_preview?"preview":"founding"===i.audience?"founding":"paid":void 0}))}function H(e){var{post:t,bylines:i,consumptionTime:l,Icon:s,audienceBadge:c,showBestsellerBadge:d,highlights:u,excerpt:p,noNewTab:h,showLoginPrompt:m}=e,g=(0,o._)(e,["post","bylines","consumptionTime","Icon","audienceBadge","showBestsellerBadge","highlights","excerpt","noNewTab","showLoginPrompt"]);return(0,a.BX)(W,(0,r._)((0,n._)({},g),{highlights:u,noNewTab:h,children:[m&&(0,a.tZ)(k._Q,{version:"login"}),(0,a.tZ)(G,{post:t,bylines:i,consumptionTime:l,Icon:s,audienceBadge:c,showBestsellerBadge:d,highlights:u,excerpt:p})]}))}function W(e){let{children:t,pub:i,publisherName:n,logoUrl:r,timestamp:o,isViewed:l,isArchived:c,isSelected:u,isLiked:p,isSaved:h,onLike:m,onClick:g,canonicalUrl:v,postId:f,defaultSaved:b,onSave:_,onArchive:y,onMouseEnter:Z,onVisible:k,utmSource:C,highlights:S,noNewTab:I}=e,P=(0,w.aF)(),[T,E]=(0,R.r8)(!l),X=(0,x.K1)(),L=(0,s.sO)();return(0,B.UM)(L,()=>k&&k(),{threshold:.2}),(0,a.BX)(Y,{ref:L,href:v,onClick:e=>{E(),g&&g(e)},className:"reader2-post-container",utmSource:C,isSelected:u,onMouseMove:()=>{null==Z||Z(f)},noNewTab:I,children:[(0,a.tZ)(V,{pub:i,publisherName:n,logoUrl:r,highlights:S,children:(0,a.BX)(N.X2,{gap:12,alignItems:"center",className:d()("reader2-post-info",P&&"hasUser"),children:[(0,a.tZ)(J,{className:"inbox-item-timestamp",value:o}),(0,a.tZ)(q,{isMobile:X,postId:f,defaultSaved:b,isSaved:h,isArchived:c,onSave:_,user:P,onArchive:y,isLiked:p,onLike:m,canonicalUrl:v,communityEnabled:null==i?void 0:i.community_enabled}),T]})}),t]})}function q(e){let{isMobile:t,postId:i,defaultSaved:n,isLiked:r,onLike:o,isSaved:l,onSave:s,user:c,isArchived:u,onArchive:p,canonicalUrl:h,communityEnabled:m}=e,{isSaved:g,onSave:v}=(0,Z.nA)({postId:i,defaultSaved:n}),f=()=>{null==p||p()},b=(0,S.g)();return t?null:(0,a.BX)(N.hs,{padding:4,gap:4,position:"absolute",className:d()("inbox-item-actions-menu",z.Z.actionMenu),onClick:e=>{e.stopPropagation(),e.preventDefault()},radius:"md",border:"detail",bg:"primary",children:[o&&m&&(0,a.tZ)(P.zx,{size:"sm",priority:"tertiary",onClick:()=>o(i),children:(0,a.tZ)(ei,{isActive:r})}),(0,a.tZ)(P.zx,{size:"sm",priority:"tertiary",onClick:()=>b(h),children:(0,a.tZ)(ea,{})}),c&&(0,a.tZ)(P.zx,{size:"sm",priority:"tertiary",onClick:()=>{s?s(i,!g):v()},children:(0,a.tZ)(en,{isActive:null!=l?l:g})}),p&&(u?(0,a.tZ)(P.zx,{size:"sm",priority:"tertiary",onClick:f,children:(0,a.tZ)(eo,{})}):(0,a.tZ)(P.zx,{size:"sm",priority:"tertiary",onClick:f,children:(0,a.tZ)(er,{})}))]})}let Y=(0,l.forwardRef)((e,t)=>{var{noNewTab:i}=e,r=(0,o._)(e,["noNewTab"]);return(0,a.tZ)(L.Uj,(0,n._)({ref:t,linkClassName:d()("reader2-inbox-post",null==r.isSelected&&"hover-action-menu",z.Z.inboxItem),native:!0,isPadded:!1,newTab:!i},r))});function V(e){let{pub:t,logoUrl:i,publisherName:n,children:r,highlights:o={}}=e;return(0,a.BX)("div",{className:"reader2-post-head reader2-text-meta",children:[(t||i)&&(0,a.tZ)(T.wk,{pub:t,logoUrl:i,publicationName:n,size:20,radius:"xs"}),(0,a.tZ)("div",{className:"pub-name",children:n||t&&(0,a.tZ)(L.zr,{href:t.base_url,onClick:e=>e.stopPropagation(),children:(0,F.L)(t.name,o["publication.name"])})}),r]})}function J(e){let{value:t,className:i}=e;return(0,a.tZ)(E.xv.Meta,{className:i,nowrap:!0,children:(0,x.Po)(t)})}function K(e){let{post:t,image:i,metaText:n,highlights:r={},excerpt:o}=e;return(0,a.BX)("div",{className:"reader2-post-body",onClick:()=>{var e;let i=(null===(e=window)||void 0===e?void 0:e.location)&&new URL(window.location.href);i&&(0,C.j)(C.FP.POST_SEARCH_RESULT_CLICKED,{post_id:t.id,query:decodeURIComponent(i.pathname.replace(/\/search\//g,""))})},children:[(0,a.BX)(L.tu,{minWidth:0,gap:8,children:[(0,a.tZ)("div",{className:"reader2-post-title reader2-clamp-lines",children:(0,F.L)(t.title,r.title||r["posts.title"],"heavy")}),t.description&&(0,a.tZ)(L.nv,{variant:"secondary",isConstrained:!o,children:o?(0,a.BX)(E.xv,{as:"span",fontStyle:"italic",children:["“...",(0,F.L)(o,r.body_text,"heavy"),"”"]}):(0,F.L)((0,A.Z)(t.description),r.subtitle||r["posts.subtitle"],"heavy")}),n]}),i]})}function G(e){let{bylines:t,consumptionTime:i,Icon:n,audienceBadge:r,showBestsellerBadge:o,post:l,highlights:s,excerpt:c}=e;return(0,a.tZ)(K,{post:l,metaText:(0,a.tZ)(Q,{bylines:t,consumptionTime:i,Icon:n,audienceBadge:r,showBestsellerBadge:o,highlights:s}),image:l.cover_image&&(0,a.tZ)(et,{post:l}),highlights:s,excerpt:c})}function Q(e){let{bylines:t,consumptionTime:i,Icon:n,audienceBadge:r,showBestsellerBadge:o,highlights:l={}}=e;return(0,a.BX)(L.SC,{children:[r&&(0,a.BX)(a.HY,{children:[(0,a.tZ)("span",{className:"meta-audience-badge",children:r}),(0,a.tZ)(ee,{})]}),t.length>0?(0,a.BX)(a.HY,{children:[(0,a.tZ)(v.M,{array:t,limit:3,formatter:e=>o?(0,a.tZ)($,{name:e.name||"",tier:e.bestseller_tier,userId:e.id}):(0,F.L)(e.name||"",l["publication.author_name"])}),i&&(0,a.tZ)(ee,{})]}):null,n&&(0,a.BX)(a.HY,{children:[(0,a.tZ)(n,{className:"meta-icon"})," "]}),i]})}let $=e=>{let{name:t,tier:i,userId:n}=e;return i?(0,a.BX)(L.gq,{inline:!0,gap:4,alignItems:"center",children:[t," ",(0,a.tZ)(X.UserBadge,{userId:n,tier:i,size:"sm"})]}):(0,a.tZ)(a.HY,{children:t})},ee=()=>(0,a.tZ)("span",{className:"meta-bullet",children:"∙"});function et(e){let{post:t,size:i=132,square:n,className:r}=e,o=t.cover_image,l=(0,I.z_)(t),c="podcast"===l||n?i:200,[u,p]=(0,s.eJ)(null);return u?null:(0,a.BX)("div",{className:d()("reader2-post-picture-container",r),children:[(0,a.tZ)(L.t5,{className:d()("reader2-post-picture",l),src:o,width:c,height:i,loading:"lazy",noStyle:!n,onError:e=>p(e)}),("podcast"===l||"video"===l)&&(0,a.tZ)("div",{className:"reader2-picture-overlay",children:(0,a.tZ)(f.x,{className:"picture-play"})})]})}function ei(e){let{isActive:t}=e;return(0,a.tZ)(u.Z,{className:t?z.Z.activeLike:"",size:20})}function en(e){let{isActive:t}=e;return(0,a.tZ)(p.Z,{className:t?z.Z.activeSave:"",size:20})}function er(){return(0,a.tZ)(h.Z,{size:20})}function eo(){return(0,a.tZ)(m.Z,{size:20})}function ea(){return(0,a.tZ)(g.Z,{size:20})}function el(){return(0,a.tZ)(a.HY,{children:Array(6).fill(0).map((e,t)=>(0,a.tZ)(es,{},t))})}function es(){let e=(0,M.XA)();return(0,a.tZ)(L.Uj,{isPadded:!1,children:(0,a.BX)(L.tu,{flex:"grow",gap:12,padding:e?8:12,children:[(0,a.BX)(N.X2,{gap:12,justifyContent:"space-between",alignItems:"center",children:[(0,a.BX)(N.X2,{gap:12,alignItems:"center",flex:"grow",children:[(0,a.tZ)(L.Vm,{size:24,style:{borderRadius:6}}),(0,a.tZ)(L.Vm,{type:"bar",maxWidth:120,flex:"grow"})]}),(0,a.tZ)(L.Vm,{type:"bar",maxWidth:80,flex:"grow"})]}),(0,a.BX)("div",{className:"reader2-post-body",children:[(0,a.BX)(L.tu,{minWidth:0,gap:4,children:[(0,a.tZ)(L.Vm,{type:"bar",width:"70%"}),(0,a.tZ)(L.Vm,{type:"bar",width:"80%"}),(0,a.tZ)(L.Vm,{type:"bar",width:"50%"})]}),(0,a.tZ)(L.Vm,{width:e?64:160,height:e?64:120,style:{borderRadius:6}})]})]})})}},46585:function(e,t,i){i.d(t,{KV:()=>d,WS:()=>u});var n=i(16584);i(30396);var r=i(48493),o=i(68494),a=i(95441);i(48980),i(15771),i(36500);var l=i(84747),s=i(73857);i(70379),i(8113),i(97842),i(98012);var c=i(44854);function d(e){let{onMute:t,customLabel:i}=e,{iString:o}=(0,a.M1)();return(0,n.tZ)(s.L,{leading:(0,n.tZ)(r.Z,{className:c.Z.muteIcon}),content:i||o("Mute"),children:(0,n.tZ)(p,{onMute:t})})}function u(e){let{onClick:t,customLabel:i}=e,{iString:r}=(0,a.M1)();return(0,n.tZ)(l.u,{leading:(0,n.tZ)(o.Z,{className:c.Z.muteIcon}),onClick:e=>{e.preventDefault(),t()},children:i||r("Unmute")})}function p(e){let{onMute:t}=e,{iString:i}=(0,a.M1)(),r=e=>i=>{i.preventDefault(),t(e)};return(0,n.tZ)(n.HY,{children:[["1hour",i("For 1 hour")],["8hours",i("For 8 hours")],["24hours",i("For 24 hours")],["indefinitely",i("Until I change it")]].map(e=>{let[t,i]=e;return(0,n.tZ)(l.u,{onClick:r(t),children:i},t)})})}},15503:function(e,t,i){i.d(t,{CD:()=>y,Eg:()=>d,Gv:()=>k,Kr:()=>w,MJ:()=>_,a2:()=>p,iI:()=>g,qG:()=>b,rw:()=>u,zi:()=>c});var n=i(7409),r=i(99282),o=i(41609),a=i.n(o),l=i(42375),s=i(68833);function c(e,t){let{extraEventProps:i={},tabId:n,primaryItem:r}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};f("seen",e,t,{extraEventProps:i,tabId:n,primaryItem:r})}function d(e,t,i){let{extraEventProps:o={},tabId:a,primaryItem:l}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};f("seen_for_duration",e,t,{extraEventProps:(0,r._)((0,n._)({},o),{timeVisible:i}),tabId:a,primaryItem:l})}function u(e,t,i){let{extraEventProps:o={},tabId:a,primaryItem:l}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};f("clicked",e,t,{extraEventProps:(0,r._)((0,n._)({clicked_element:i},o),{tabId:a,primaryItem:l})})}function p(e,t){let{extraEventProps:i={},tabId:o,primaryItem:a}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};f("swiped",e,t,{extraEventProps:(0,r._)((0,n._)({},i),{tabId:o,primaryItem:a})})}function h(e){var t,i,n,r,o,a,l,s,c,d;let u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,{primaryItem:p}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return{item_primary_entity_key:p&&"entity_key"in p?p.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!==(s=null===(i=e.post.publishedBylines)||void 0===i?void 0:null===(t=i[0])||void 0===t?void 0:t.id)&&void 0!==s?s:e.publication.author_id:0,item_context_type:"context"in e?e.context.type:"",item_context_type_bucket:"context"in e&&null!==(c=e.context.typeBucket)&&void 0!==c?c:"",item_context_timestamp:new Date("context"in e?e.context.timestamp:new Date).toISOString(),item_context_user_id:"context"in e?null===(n=e.context.users[0])||void 0===n?void 0:n.id:void 0,item_context_user_ids:"context"in e&&(null!==(d=null===(r=e.context.users)||void 0===r?void 0:r.length)&&void 0!==d?d:0)>0?e.context.users.map(e=>{let{id:t}=e;return t}):[],item_publication_id:"publication"in e?null===(o=e.publication)||void 0===o?void 0:o.id:void 0,item_post_id:null===(a=e.post)||void 0===a?void 0:a.id,item_comment_id:null===(l=e.comment)||void 0===l?void 0:l.id,item_can_reply:!("canReply"in e)||e.canReply,item_source:"frontend",item_model_rank:null,item_model_score:null,tab_id:null!=u?u:void 0,item_module_id:"id"in e?e.id:void 0,followed_user_count:0,subscribed_publication_count:0,is_following:!1,is_explicitly_subscribed:!1}}function m(e,t){let{primaryItem:i}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return"comment"===e.type||"post"===e.type||"featuredCollection"===e.type||"featuredPublication"===e.type?a()(e.trackingParameters)?h(e,t,{primaryItem:i}):e.trackingParameters:h(e,t,{primaryItem:i})}function g(e){let{primaryItem:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,r._)((0,n._)({},e),{trackingParameters:h(e,null,{primaryItem:t})})}let v=new Map([["featuredCollection","featured_collection"],["featuredPublication","featured_publication"]]);function f(e,t,i){let{extraEventProps:r={},tabId:o,primaryItem:a}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},l=m(t,null!=o?o:null,{primaryItem:a}),c=v.get(t.type);(0,s.j)("seen"===e?s.FP.FEED_ITEM_SEEN:"seen_for_duration"===e?s.FP.FEED_ITEM_SEEN_FOR_DURATION:"swiped"===e?s.FP.FEED_ITEM_SWIPED:s.FP.FEED_ITEM_CLICKED,(0,n._)({surface:i,tabId:o,module:c},l,r))}function b(e,t,i){let{extraEventProps:r={},tabId:o,primaryItem:a}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},l=m(t,null!=o?o:null,{primaryItem:a}),c=v.get(t.type);(0,s.j)("seen"===e?s.FP.FEED_MODULE_ITEM_SEEN:s.FP.FEED_MODULE_ITEM_CLICKED,(0,n._)({surface:i,tabId:o,module:c},l,r))}function _(e,t){let{extraEventProps:i={}}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Z("seen",e,t,{extraEventProps:i})}function y(e,t,i){let{extraEventProps:r={}}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};Z("clicked",e,t,{extraEventProps:(0,n._)({clicked_element:i},r)})}function Z(e,t,i){var r,o,a;let{extraEventProps:l={}}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};(0,s.j)("seen"===e?s.FP.FEED_USER_SUGGESTION_SEEN:s.FP.FEED_USER_SUGGESTION_CLICKED,(0,n._)({suggested_user_id:t.user.id,suggested_publication_id:null!==(o=null===(r=t.publication)||void 0===r?void 0:r.id)&&void 0!==o?o:null,suggestion_source:null!==(a=t.source)&&void 0!==a?a:null,surface:i},t.trackingParameters,l))}function w(e,t){let{tabId:i,noteId:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,s.j)(s.FP.FEED_HIDDEN_ATTACHMENT_SHOWN,{attachmentId:e,reason:t,tabId:i,noteId:n})}function k(e){let{props:t,isModuleItem:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,l.rI)(),o=i?b:f;return i=>{o("clicked",e,r,{extraEventProps:(0,n._)({clicked_element:i},t)})}}},27744:function(e,t,i){i.d(t,{I0:()=>_,K5:()=>S,K6:()=>X,RR:()=>b,_H:()=>y,d6:()=>w,de:()=>C,ev:()=>Z,kc:()=>k});var n=i(7409),r=i(99282),o=i(6400),a=i(30396),l=i(39693),s=i.n(l),c=i(18446),d=i.n(c),u=i(12765),p=i(7882),h=i(98914),m=i(15503),g=i(98012),v=i(33884),f=i(63651);let b=(0,o.createContext)({dispatch:()=>Promise.resolve()});function _(){return(0,a.qp)(b).dispatch}let y={isSigningIn:!1,signInNoExit:!1,pages:[],readingQueue:[],posts: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},Z=(0,o.createContext)(y);function w(){let{initialData:e={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,u.L)(S,e,e=>{let{feedItem:t,readingQueue:i,initialPost:n}=e,r=y;return t&&(r=I(r,t)),i&&(r=T(r,i)),n&&(r=N(r,{posts:[n.post],publications:s()([n.publication,n.referringPub]),publicationSettings:new Map([[n.publication.id,n.publicationSettings]]),recommendationsByPubId:n.referringRecommendation?new Map([[n.referringRecommendation.recommended_publication_id,n.referringRecommendation]]):void 0})),r})}function k(){return(0,a.qp)(Z)}function C(e){let t=k();return!!e&&"entity_key"in e&&t.hiddenItems.includes(e.entity_key)}function S(e,t){var i,o,a,l,s,c,u,b,_,Z,w;switch(t.type){case"sign_in":return(0,r._)((0,n._)({},e),{lastDispatchType:t.type,isSigningIn:t.payload.isSigningIn,signInNoExit:null!==(i=t.payload.signInNoExit)&&void 0!==i&&i});case"page_load":{let{result:i}=t.payload;return(0,r._)((0,n._)({},x(e,i.items)),{lastDispatchType:t.type,pages:(0,p.x8)(e.pages,t)})}case"post_load":{let{post:i,publication:n}=t.payload;return N(e,{posts:[i],publications:[n]})}case"post_like":{let{postId:i,isLiked:n}=t.payload,r=e.posts.get(i);return P(e,t.type,i,(u=r,{reaction:null!=(b=n)?b:!u.reaction,reactions:{"❤":((null===(_=u.reactions)||void 0===_?void 0:_["❤"])||0)+(b?1:-1)}}))}case"post_restack":{let{postId:i,isRestacked:n}=t.payload,r=e.posts.get(i);return r?P(e,t.type,i,(Z=r,{restacked:w=n,restacks:(Z.restacks||0)+(w?1:-1)})):e}case"post_delete":{let{publication:i,post:o}=t.payload,a=new Map(e.posts);a.delete(o.id);let l=new Map([...e.comments].filter(e=>{let[t,i]=e;return i.post_id!==o.id}));return[(0,f.rcW)(o.id,{noBase:!0}),(0,f.mx9)(i,o,{noBase:!0})].includes(window.location.pathname)&&(0,h.uX)(v.Ds,{replace:!0}),(0,r._)((0,n._)({},e),{lastDispatchType:t.type,posts:a,comments:l,pages:e.pages.map(e=>(0,r._)((0,n._)({},e),{result:e.result?(0,r._)((0,n._)({},e.result),{items:e.result.items.filter(e=>{var t;return(null===(t=e.post)||void 0===t?void 0:t.id)!==o.id})}):e.result}))})}case"post_save":{let{postId:i,isSaved:n}=t.payload,r=e.posts.get(i),o=null==n?!(null==r?void 0:r.is_saved):n;return r?P(e,t.type,i,{is_saved:o}):e}case"comment_like":{let{commentId:i,isLiked:a}=t.payload,l=e.comments.get(i);if(!l)return e;return(0,r._)((0,n._)({},e),{lastDispatchType:t.type,comments:E(e.comments,i,(0,r._)((0,n._)({},l),{reaction:a?"❤":void 0,reactions:(0,r._)((0,n._)({},l.reactions),{"❤":((null===(o=l.reactions)||void 0===o?void 0:o["❤"])||0)+(a?1:-1)}),reaction_count:(l.reaction_count||0)+(a?1:-1)}))})}case"comment_restack":{let{commentId:i,isRestacked:o}=t.payload,a=e.comments.get(i);return(0,r._)((0,n._)({},e),{lastDispatchType:t.type,comments:a?E(e.comments,i,(0,r._)((0,n._)({},a),{restacked:o,restacks:(a.restacks||0)+(o?1:-1)})):e.comments})}case"comment_delete":{let{comment:i}=t.payload,o=new Map(e.posts),a=new Map([...e.comments].filter(e=>{let[t,n]=e;return n.id!==i.id&&!new RegExp("(^|.)".concat(i.id,"(.|$)")).test(n.ancestor_path)})),l=o.get(i.post_id),s=i.ancestor_path&&a.get(Number(i.ancestor_path.split(".").pop()));return s?a.set(s.id,(0,r._)((0,n._)({},s),{children_count:(s.children_count||1)-1,children:(s.children||[]).filter(e=>e.id!==i.id)})):l&&o.set(l.id,(0,r._)((0,n._)({},l),{child_comment_count:(l.child_comment_count||1)-1})),[(0,f.Sgq)(i,{noBase:!0})].includes(window.location.pathname)&&(0,h.uX)(v.Ds,{replace:!0}),(0,r._)((0,n._)({},e),{lastDispatchType:t.type,posts:o,comments:a,pages:e.pages.map(e=>(0,r._)((0,n._)({},e),{result:e.result?(0,r._)((0,n._)({},e.result),{items:e.result.items.filter(e=>{var t;return(null===(t=e.comment)||void 0===t?void 0:t.id)!==i.id&&!(e.parentComments||[]).filter(Boolean).map(e=>e.id).includes(i.id)})}):e.result}))})}case"new_post":return(0,r._)((0,n._)({},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,v.vy)(t.payload.post.id),publication:t.payload.publication,post:t.payload.post,context:t.payload.context||{}}]}},...e.pages]});case"new_comment":{let{comment:i}=t.payload,o=new Map(e.posts),s=o.get(i.post_id);s&&o.set(s.id,(0,r._)((0,n._)({},s),{child_comment_count:(s.child_comment_count||0)+1}));let c=new Map(e.comments);c.set(i.id,i);let d=((null===(a=i.ancestor_path)||void 0===a?void 0:a.split("."))||[]).map(Number).filter(Boolean).map(e=>c.get(e)||null),u=null!==(l=d[d.length-1])&&void 0!==l?l:null;u&&c.set(u.id,(0,r._)((0,n._)({},u),{children_count:(u.children_count||0)+1,children:[i].concat(u.children||[])}));let p=[{error:null,isLoading:!1,result:{items:[(0,m.iI)({type:"comment",entity_key:(0,v.It)(i.id),comment:i,parentComments:d,publication:null,post:null,canReply:!0,context:{type:"comment",timestamp:new Date().toISOString(),users:[],fallbackReason:"",fallbackUrl:null}})]}},...e.pages];return(0,r._)((0,n._)({},e),{lastDispatchType:t.type,posts:o,comments:c,pages:p})}case"edit_comment":{let{comment:i}=t.payload,o=new Map(e.comments);return o.set(i.id,i),(0,r._)((0,n._)({},e),{lastDispatchType:t.type,comments:o})}case"comments_load":{let{comments:i}=t.payload,o=[],a=i.slice();for(;a.length>0;){let e=a.pop();o.push(e),a.push(...e.children||[])}return(0,r._)((0,n._)({},e),{lastDispatchType:t.type,comments:new Map([...e.comments].concat(o.map(e=>[e.id,e])))})}case"item_load":{let{item:i}=t.payload;return(0,r._)((0,n._)({},I(e,i)),{lastDispatchType:t.type})}case"items_load":{let{items:i}=t.payload;return(0,r._)((0,n._)({},x(e,i)),{lastDispatchType:t.type})}case"new_feed_items":{let i=[...e.pages];if(t.payload.insertLocation){let e={error:null,isLoading:!1,result:{items:t.payload.feedItems}};"prepend"===t.payload.insertLocation?i.unshift(e):"append"===t.payload.insertLocation&&i.push(e)}return(0,r._)((0,n._)({},x(B(e,10),t.payload.feedItems)),{lastDispatchType:t.type,pages:i})}case"items_cull":{let t=null===(c=e.pages.find(e=>{var t;return null===(t=e.result)||void 0===t?void 0:t.originalCursorTimestamp}))||void 0===c?void 0:null===(s=c.result)||void 0===s?void 0:s.originalCursorTimestamp;if(t&&(0,g.Z)(t).isBefore((0,g.Z)().subtract(10,"minutes")))return y;return B(e,10)}case"inbox_load":return T(e,t.payload);case"active_live_streams_load":if(d()(e.activeLiveStreams,t.payload))return e;return(0,r._)((0,n._)({},e),{activeLiveStreams:t.payload.filter(e=>(0,g.Z)(e.liveStream.started_streaming_at).isBefore((0,g.Z)().subtract(1,"minute")))});case"inbox_item_archive":{let{contentKey:i,isArchived:o}=t.payload,a=e.inboxItems.get(i);return(0,r._)((0,n._)({},e),{inboxItems:E(e.inboxItems,i,(0,r._)((0,n._)({},a),{archived_at:o?new Date().toISOString():null}))})}case"item_hide":{let{entityKey:i}=t.payload;return(0,r._)((0,n._)({},e),{lastDispatchType:t.type,hiddenItems:[...e.hiddenItems,i]})}case"item_unhide":{let{entityKey:i}=t.payload;return(0,r._)((0,n._)({},e),{lastDispatchType:t.type,hiddenItems:e.hiddenItems.filter(e=>e!==i)})}case"item_dismiss":{let{entityKey:i}=t.payload;return(0,r._)((0,n._)({},e),{lastDispatchType:t.type,pages:e.pages.map(e=>(0,r._)((0,n._)({},e),{result:e.result?(0,r._)((0,n._)({},e.result),{items:e.result.items.filter(e=>"entity_key"in e&&e.entity_key!==i)}):e.result}))})}case"update_paused_notifications":{let i=new Set([...e.mutedFeedItems,...t.payload.map(e=>e.entity_key)]);return(0,r._)((0,n._)({},e),{mutedFeedItems:i})}case"item_pause_notifications":{let{entityKey:i}=t.payload,o=new Set(e.mutedFeedItems);return o.add(i),(0,r._)((0,n._)({},e),{mutedFeedItems:o})}case"item_unpause_notifications":{let{entityKey:i}=t.payload,o=new Set(e.mutedFeedItems);return o.delete(i),(0,r._)((0,n._)({},e),{mutedFeedItems:o})}}return(0,r._)((0,n._)({},e),{lastDispatchType:t.type,pages:(0,p.x8)(e.pages,t)})}function B(e,t){let i,o=0,a=[];for(let n of e.pages){var l;let e=null===(l=n.result)||void 0===l?void 0:l.items;if(!e||n.error||n.isLoading)break;for(let t of(i=n,e))a.push(t),o++;if(o>t)break}if(!(null==i?void 0:i.result))return e;let s=(0,r._)((0,n._)({},i),{result:(0,r._)((0,n._)({},i.result),{items:a})});return(0,r._)((0,n._)({},e),{pages:[s]})}function x(e,t){let i=new Map(e.publications),o=new Map(e.posts),a=new Map(e.comments),l=new Set(e.mutedFeedItems);for(let e of t){if("publication"in e&&e.publication&&i.set(e.publication.id,e.publication),"post"in e){let{post:t}=e;t&&o.set(t.id,t),e.isMuted&&l.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)"post"===e.type&&(o.set(e.post.id,e.post),i.set(e.publication.id,e.publication));e.isMuted&&l.add(e.entity_key)}if("parentComments"in e)for(let t of e.parentComments)t&&a.set(t.id,t)}return(0,r._)((0,n._)({},e),{publications:i,posts:o,comments:a,mutedFeedItems:l})}function I(e,t){var i;return(0,r._)((0,n._)({},e),{posts:t.post?E(e.posts,t.post.id,t.post):e.posts,publications:t.publication?E(e.publications,t.publication.id,t.publication):e.publications,comments:new Map([...e.comments].concat([t.comment,...null!==(i=t.parentComments)&&void 0!==i?i:[]].filter(Boolean).map(e=>[e.id,e]))),feedItemStats:t.feedItemStats&&t.feedItemStats.entity_key?E(e.feedItemStats,t.feedItemStats.entity_key,t.feedItemStats):e.feedItemStats,mutedFeedItems:new Set(t.entity_key&&t.isMuted?[t.entity_key]:void 0)})}function P(e,t,i,o){let a=new Map(e.posts),l=a.get(i);return l&&a.set(l.id,(0,n._)({},l,o)),(0,r._)((0,n._)({},e),{lastDispatchType:t,posts:a})}function N(e,t){let{posts:i,publications:o,publicationSettings:a,recommendationsByPubId:l}=t,s=new Map(e.posts);for(let e of i)s.set(e.id,(0,n._)({},s.get(e.id),e));let c=new Map(e.publications);for(let e of o)c.set(e.id,(0,n._)({},c.get(e.id),e));let d=new Map([...e.publicationSettings.entries(),...a?a.entries():[]]),u=new Map([...e.publicationRecommendations.entries(),...l?l.entries():[]]);return(0,r._)((0,n._)({},e),{posts:s,publications:c,publicationSettings:d,publicationRecommendations:u})}function T(e,t){return(0,r._)((0,n._)({},N(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,n._)({},e.referringPubByPostId,t.referringPubByPostId)})}function E(e,t,i){let n=new Map(e);return n.set(t,i),n}function X(e,t){var i;return(i=e,[t].map(e=>{var t,o,a;return(0,r._)((0,n._)({},e),{publication:"publication"in e&&e.publication?null!==(t=i.publications.get(e.publication.id))&&void 0!==t?t:e.publication:null,post:"post"in e&&e.post?null!==(o=i.posts.get(e.post.id))&&void 0!==o?o:e.post:null,comment:"comment"in e&&e.comment?null!==(a=i.comments.get(e.comment.id))&&void 0!==a?a:e.comment:null,parentComments:"parentComments"in e&&e.parentComments&&e.parentComments.map(e=>e&&i.comments.get(e.id)||null)||[]})}))[0]}},93630:function(e,t,i){i.d(t,{l6:()=>B});var n=i(7409),r=i(99282),o=i(16584),a=i(6400),l=i(30396),s=i(25380),c=i(32224),d=i(60807),u=i(98750),p=i(94874),h=i(15771),m=i(19081),g=i(38841),v=i(58175),f=i(87989),b=i(65575),_=i(32189),y=i(64172),Z=i(22419),w=i(67914),k=i(60308),C=i(63651),S=i(47929);function B(e){let{items:t,surface:i,page_num:l=0,focusedPubId:s,onClickItem:c,onItemFirstVisible:d}=e,u=(0,y.Th)(),p=l*Z.lq,h=new Map(t.map(e=>{var t,i;let{publication:n}=e;return[n.id,null===(i=u.result)||void 0===i?void 0:null===(t=i.subscriptions)||void 0===t?void 0:t.some(e=>e.publication_id===n.id&&e.membership_state&&(0,w.hl)(e.membership_state))]}));return(0,o.tZ)(b.tu,{gap:8,children:t.map((e,t)=>{var o;return(0,a.createElement)(x,(0,r._)((0,n._)({},e),{key:e.publication.id,isSubscribed:null!==(o=h.get(e.publication.id))&&void 0!==o&&o,rank:t+p+1,surface:i,isFocused:s===e.publication.id,onClick:c,onFirstVisible:d}))})})}function x(e){let{user:t,publication:i,rank:n,isSubscribed:r,surface:a,isFocused:s,onClick:c,onFirstVisible:h,trackingParameters:_}=e,y=(0,d.aF)(),Z=(0,l.sO)(null),w=!!y&&y.id===(null==t?void 0:t.id);return(0,u.UM)(Z,()=>{null==h||h({publication:i,rank:n,trackingParameters:_})}),(0,o.tZ)(b.fG,{id:i.id.toString(),bg:w||s?"accent-orange":void 0,href:t?(0,C.NNq)(t):(0,k.SVA)(i),onClick:()=>c({publication:i,rank:n,trackingParameters:_}),children:(0,o.BX)(m.hs,{justifyContent:"space-between",flex:"grow",alignItems:"center",paddingX:12,ref:Z,children:[(0,o.BX)(m.hs,{gap:16,alignItems:"center",children:[(0,o.tZ)(v.xv.Digit,{minWidth:16,children:n}),t&&(0,o.BX)(o.HY,{children:[(0,o.tZ)(p.qE,{user:t,size:40}),(0,o.BX)(b.tu,{children:[(0,o.BX)(m.hs,{alignItems:"center",gap:4,children:[(0,o.tZ)(v.xv.B3,{weight:"semibold",children:t.name}),t.bestseller_tier?(0,o.tZ)(f.UserBadge,{tier:t.bestseller_tier,userId:t.id,size:"sm",tooltipOnHover:!0}):null]}),(0,o.tZ)(v.xv.B4,{color:"secondary",children:i.name})]})]}),!t&&(0,o.BX)(o.HY,{children:[(0,o.tZ)(g.wk,{radius:"full",pub:i,size:32}),(0,o.tZ)(b.tu,{children:(0,o.tZ)(v.xv.B3,{weight:"bold",children:i.name})})]})]}),!w&&(0,o.tZ)(I,{pub:i,user:t,surface:a,isSubscribed:r,currentUser:y})]})})}function I(e){let{pub:t,user:i,surface:n,isSubscribed:r,currentUser:a}=e,l=(0,y.Th)(),d=(0,_.x)({surface:n})(t);return r?(0,o.tZ)(m.hs,{alignItems:"center",justifyContent:"center",padding:8,children:(0,o.tZ)(s.Z,{size:16,stroke:"var(--color-fg-tertiary)"})}):(0,o.tZ)(h.hU,{priority:"secondary",size:"sm",newTab:!0,href:(0,k.W1P)(t,{addBase:!0,user:a,utm_source:S.b3.substack,utm_medium:S.lP.web,utm_campaign:S.VX.reader2}),onClick:e=>{if(e.stopPropagation(),i){let e="visibilitychange",i=()=>{"visible"===document.visibilityState&&(document.removeEventListener(e,i),l.refetchPublication(t.id))};document.addEventListener(e,i)}d(e)},children:(0,o.tZ)(c.Z,{size:20})})}},73674:function(e,t,i){i.d(t,{T7:()=>w,aG:()=>_,hk:()=>y});var n=i(16584),r=i(30396),o=i(94184),a=i.n(o),l=i(1852),s=i(20160),c=i(86374),d=i(95441),u=i(40647),p=i(60807),h=i(80026),m=i(49572),g=i(78513),v=i(49883),f=i(92039),b=i(78489);let _=e=>{let{liveStream:t,handle:i,subscriptions:r,setSubscriptions:o}=e,{iString:a}=(0,d.M1)(),s=(0,l.useMediaQuery)({maxWidth:800});return(0,n.BX)(h.sg,{display:i.active||s?"none":"flex",width:400,alignSelf:"stretch",sizing:"border-box",borderLeft:"detail",children:[(0,n.tZ)(h.xv.H4,{padding:16,borderBottom:"detail",userSelect:"none",children:a("Live Chat")}),(0,n.tZ)(y,{liveStream:t}),(0,n.tZ)(m.A,{liveStream:t,subscriptions:r,setSubscriptions:o})]})},y=e=>{let{liveStream:t}=e,[i,o]=(0,r.eJ)([]),[a,l]=(0,r.eJ)(!0),s=(0,r.sO)(null),{getConfigFor:c}=(0,u.xR)(),d=c("thefp_enable_web_livestream_kicking"),m=(0,f.rG)(),b=e=>{o(t=>t.find(t=>t.id===e.id)?t:[...t,e].slice(-1e3))};(0,r.d4)(()=>null==m?void 0:m.listen({["live-stream:".concat(t.liveStream.id)]:e=>{var t,i;let{data:n}=e;(null==n?void 0:null===(t=n.message)||void 0===t?void 0:t.type)==="live-stream:message-sent"&&b(n.message.message),(null==n?void 0:null===(i=n.message)||void 0===i?void 0:i.type)==="live-stream:viewer-count-updated"&&n.message.num_viewers_joined>0&&b(n.message),a&&setTimeout(()=>{s.current&&(s.current.scrollTop=s.current.scrollHeight)},0)}}),[m,t.liveStream.id,a]);let _=(0,p.aF)();return((0,r.d4)(()=>{s.current&&!t.liveStreamInformation.desktopPlaybackUrl&&(s.current.scrollTop=s.current.scrollHeight)},[t.liveStreamInformation.desktopPlaybackUrl]),t.liveStreamInformation.desktopPlaybackUrl)?(0,n.BX)(h.sg,{flex:"grow",position:"relative",children:[(0,n.tZ)(Z,{ref:s,onScroll:()=>{s.current&&l(32>=Math.abs(s.current.scrollTop))},children:(0,n.tZ)(w,{children:i.map(e=>"user"in e?(0,n.tZ)(g.M,{message:e,showBlockButton:!!(null==_?void 0:_.is_admin)&&!!d},e.id):e.num_viewers_joined>0?(0,n.tZ)(g.G,{message:e},e.id):null)})}),(0,n.tZ)(k,{scrollRef:s,hidden:a})]}):(0,n.tZ)(v.j,{})},Z=(0,h.zo)({display:"flex",direction:"column-reverse",flex:"grow",scrollBar:"hidden",overflow:"auto",position:"relative"}),w=(0,h.zo)({display:"flex",direction:"column",padding:16,gap:16}),k=e=>{let{scrollRef:t,hidden:i}=e;return(0,n.tZ)(s.W,{children:(0,n.tZ)(h.hs,{bg:"primary",radius:"full",className:a()(b.Z.jumpButton,i&&b.Z.hidden),children:(0,n.tZ)(h.hU,{priority:"secondary-outline",rounded:!0,onClick:()=>{setTimeout(()=>{var e;null===(e=t.current)||void 0===e||e.scrollTo({top:t.current.scrollHeight,behavior:"smooth"})},0)},children:(0,n.tZ)(c.Z,{})})})})}},95770:function(e,t,i){function n(e){return e?t=>{t.preventDefault(),e()}:null}i.d(t,{C:()=>n}),i(16584),i(98661),i(30396),i(94184),i(43174),i(89734),i(12936),i(42694),i(98585),i(36518),i(85095),i(60807),i(9682),i(98914),i(19081),i(84370),i(58175),i(78118),i(90565),i(71512),i(3573),i(82075),i(22029),i(81043),i(88603),i(7935),i(7779),i(3),i(24641),i(76404),i(57449),i(33740),i(75419),i(30322),i(41233),i(91400),i(64172),i(20521),i(60308),i(33884),i(84864),i(15080)},81043:function(e,t,i){i.d(t,{Ly:()=>o,SJ:()=>l,qr:()=>a});var n=i(6400),r=i(30396);let o=(0,n.createContext)({setChildOptions:()=>{},onboardingModalRef:{current:null},isLoading:!1,subscriptions:[],publicationUsers:[],onPageScroll:()=>void 0,setPinTitle:()=>void 0,setDrawer:()=>null,checkFocus:()=>!1,requireLogin:null});function a(e){let{shouldShowGetAppPill:t=!0,style:i,alwaysPinTitle:n,backAction:o,onRefresh:a}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=l();return(0,r.bt)(()=>{var r;null===(r=s.setChildOptions)||void 0===r||r.call(s,{title:e,style:i,alwaysPinTitle:n,backAction:o,shouldShowGetAppPill:t,onRefresh:a})},[s,e,i,o,t,a]),(0,r.bt)(()=>{var e;null===(e=s.setPinTitle)||void 0===e||e.call(s,!1)},[]),s}function l(){return(0,r.qp)(o)}},70839:function(e,t,i){i.d(t,{x:()=>E});var n=i(7409),r=i(99282),o=i(58865),a=i(16584),l=i(30396),s=i(69983),c=i.n(s),d=i(25380),u=i(66440),p=i(88812),h=i(95441),m=i(27104),g=i(68833),v=i(48980),f=i(15771),b=i(19081),_=i(6490),y=i(58175),Z=i(51776),w=i(70379),k=i(38202),C=i(63651),S=i(47929),B=i(56199);function x(){let e=(0,o._)([""," added"]);return x=function(){return e},e}function I(){let e=(0,o._)([""," removed"]);return I=function(){return e},e}function P(){let e=(0,o._)([""," updated"]);return P=function(){return e},e}function N(){let e=(0,o._)([""," created"]);return N=function(){return e},e}function T(){let e=(0,o._)(["Manage Substacks (",")"]);return T=function(){return e},e}let E=e=>{let{reads:t,open:i,close:n}=e;return(0,a.tZ)(X,{reads:t,open:i,close:n})},X=e=>{var t,i,o;let{list:s,reads:c,open:p,close:m}=e,{popToast:k}=(0,w.pm)(),{iTemplate:C,iString:S}=(0,h.M1)(),[T,E]=(0,l.eJ)(null!==(t=null==s?void 0:s.name)&&void 0!==t?t:"My list"),[X]=(0,l.eJ)(null!==(i=null==s?void 0:s.slug)&&void 0!==i?i:""),[F,M]=(0,l.eJ)(null!==(o=null==s?void 0:s.publications)&&void 0!==o?o:[]),[U,A]=(0,l.eJ)(!1),D=F?null==c?void 0:c.filter(e=>!(null==F?void 0:F.map(e=>e.id).includes(e.id))):c;(0,l.d4)(()=>{(0,g.j)(g.FP.LIST_MANAGEMENT_MODAL_SEEN,{editing:!!s})},[]);let O=()=>{var e,t;E(null!==(e=null==s?void 0:s.name)&&void 0!==e?e:"My list"),M(null!==(t=null==s?void 0:s.publications)&&void 0!==t?t:[]),A(!1)},z=e=>{M(null==F?void 0:F.filter(t=>t.id!==e.id)),A(!0),(0,g.j)(g.FP.LIST_MANAGEMENT_MODAL_PUBLICATION_REMOVED,{pub_id:e.id}),k(t=>(0,a.tZ)(w.FN,(0,r._)((0,n._)({},t),{Icon:u.Z,text:C(I(),e.name)})))},j=async()=>{let e,t;let i={name:T,slug:X.length>0?X:void 0,publications:null==F?void 0:F.map(e=>e.id)};try{var o;s?(e=C(P(),T),t=await (0,v.rd)("/api/v1/list/".concat(s.id),{method:"PUT",json:i})):(e=C(N(),T),t=await (0,v.rd)("/api/v1/list",{method:"POST",json:i})),(0,g.j)(g.FP.LIST_MANAGEMENT_MODAL_SUBMITTED,{data:i,editing:!!s}),k(t=>(0,a.tZ)(w.FN,(0,r._)((0,n._)({},t),{Icon:d.Z,text:e}))),O(),m(null!==(o=null==t?void 0:t.list)&&void 0!==o?o:{})}catch(e){k(e=>(0,a.tZ)(w.FN,(0,r._)((0,n._)({},e),{text:S("Something went wrong. Please try again")})))}},H=()=>{(0,g.j)(g.FP.LIST_MANAGEMENT_MODAL_CLOSED,{editing:!!s}),O(),m()};return(0,a.BX)(_.u_,{isOpen:p,onClose:H,className:B.Z.modalContainer,children:[(0,a.tZ)(_.xB,{onClose:H,showClose:!0,title:s?S("Edit list"):S("Create new list")}),(0,a.tZ)(_.fe,{children:(0,a.BX)(b.tu,{gap:48,alignItems:"stretch",justifyContent:"start",children:[(0,a.BX)(b.tu,{flex:"grow",gap:8,children:[(0,a.tZ)(y.xv.B3,{translated:!0,weight:"semibold",children:"List Name"}),(0,a.tZ)(Z.oi,{placeholder:S("My List"),value:T,onChange:e=>{E(e.currentTarget.value),U||A(!0)}})]}),(0,a.tZ)(L,{currentPublicationIds:null==F?void 0:F.map(e=>e.id),existingSubscriptions:null==c?void 0:c.map(e=>e.id),possibleSuggestions:D,onAdd:e=>{M([...F,e]),A(!0),(0,g.j)(g.FP.LIST_MANAGEMENT_MODAL_PUBLICATION_ADDED,{pub_id:e.id}),k(t=>(0,a.tZ)(w.FN,(0,r._)((0,n._)({},t),{Icon:d.Z,text:C(x(),e.name)})))},onRemove:z}),F.length>0&&(0,a.tZ)(R,{pubs:F,removePub:z})]})}),(0,a.tZ)(_.mz,{primaryButton:(0,a.tZ)(f.zx,{priority:"primary",disabled:!(U&&T&&F.length>=1),onClick:j,children:(0,a.tZ)(y.xv.B3,{color:"primary",children:s?S("Update"):S("Create")})}),secondaryButton:(0,a.tZ)(f.zx,{priority:"secondary",onClick:H,children:(0,a.tZ)(y.xv.B3,{translated:!0,children:"Cancel"})}),showDivider:!0})]})},L=e=>{let t,{currentPublicationIds:i,existingSubscriptions:n,possibleSuggestions:r,onAdd:o,onRemove:s}=e,{iString:d}=(0,h.M1)(),[u,v]=(0,l.eJ)(""),[f,_]=(0,l.eJ)(),{language:w}=(0,h.M1)(),{allResults:k,onSearch:C,isLoading:S}=(0,m.$)({defaultQuery:u,language:w}),x=new Set(n);(0,l.d4)(()=>{u&&(C(u),(0,g.j)(g.FP.LIST_MANAGEMENT_MODAL_PUBLICATION_SEARCHED,{query:u}))},[u]),(0,l.d4)(()=>{r&&_(c()(r).slice(0,3))},[i,r]);let I=k.results;return t=""===u?[]:I.sort((e,t)=>+!x.has(e.id)-+!x.has(t.id)||I.indexOf(e)-I.indexOf(t)),(0,a.BX)(b.tu,{justifyContent:"start",gap:20,flex:"grow",children:[(0,a.tZ)(y.xv.B3,{translated:!0,align:"left",className:B.Z.fullWidth,weight:"semibold",children:"Add Substacks"}),(0,a.BX)(b.gq,{justifyContent:"space-between",alignItems:"center",children:[(0,a.tZ)(Z.oi,{placeholder:"Search for Substacks",value:u,onChange:e=>v(e.currentTarget.value)}),!!t.length&&(0,a.tZ)("div",{onClick:()=>v(""),children:(0,a.tZ)(p.Z,{width:30,style:{cursor:"pointer"}})})]}),(0,a.tZ)(a.HY,{children:t.length?(0,a.tZ)(b.tu,{flex:"grow",gap:20,justifyContent:"start",paddingTop:4,children:t.map(e=>{let t=null==i?void 0:i.includes(e.id);return(0,a.tZ)(M,{pub:e,buttonText:t?d("Remove"):d("Add"),onClick:t?()=>s(e):()=>o(e)},e.id)})}):u&&S?(0,a.tZ)(y.xv.Meta,{translated:!0,children:"Searching..."}):u&&0===t.length?(0,a.tZ)(y.xv.Meta,{translated:!0,children:"No publications found"}):(0,a.tZ)(F,{pubs:f,onAdd:o,onRemove:s})})]})},F=e=>{let{pubs:t,currentPubs:i,onAdd:n,onRemove:r}=e,{iString:o}=(0,h.M1)();return(null==t?void 0:t.length)?(0,a.BX)(b.tu,{justifyContent:"start",gap:12,children:[(0,a.tZ)(y.xv.Meta,{translated:!0,children:"Suggestions"}),t.map(e=>{let t=null==i?void 0:i.includes(e.id);return(0,a.tZ)(M,{pub:e,buttonText:t?o("Remove"):o("Add"),onClick:()=>{t?r(e):((0,g.j)(g.FP.LIST_MANAGEMENT_MODAL_PUBLICATION_SUGGESTION_ADDED,{pub_id:e.id}),n(e))}},e.id)})]}):(0,a.tZ)(y.xv.Meta,{translated:!0,children:"Search publications to get started"})},R=e=>{let{pubs:t,removePub:i}=e,{iTemplate:n}=(0,h.M1)();return(0,a.BX)(b.tu,{justifyContent:"start",gap:20,flex:"grow",children:[(0,a.tZ)(y.xv.B3,{align:"left",weight:"semibold",children:n(T(),t.length)}),(0,a.tZ)(b.tu,{justifyContent:"start",gap:16,flex:"grow",children:t.map(e=>(0,a.tZ)(M,{pub:e,buttonText:"Remove",onClick:()=>i(e)},e.id))})]})},M=e=>{var t;let{pub:i,buttonText:n,onClick:r,disable:o}=e;return(0,a.tZ)("a",{href:(0,C.n1t)((0,C.SVA)(i),{utm_source:S.b3.listManagementModal}),target:"_blank",rel:"noopener",children:(0,a.BX)(b.gq,{alignItems:"center",justifyContent:"space-between",gap:12,flex:"grow",children:[(0,a.tZ)(k.t,{src:null!==(t=i.logo_url)&&void 0!==t?t:"",width:40,height:40,className:B.Z.previewImage}),(0,a.BX)(b.tu,{minWidth:0,flex:"grow",children:[(0,a.tZ)(y.xv.B4,{weight:"semibold",ellipsis:!0,children:i.name}),(0,a.tZ)(y.xv.B4,{color:"secondary",ellipsis:!0,children:i.author_name})]}),(0,a.tZ)(f.zx,{onClick:e=>{e.preventDefault(),r()},priority:"secondary",disabled:o,children:n})]})})}},39493:function(e,t,i){i.d(t,{K:()=>B,y:()=>x});var n=i(7409),r=i(99282),o=i(16584),a=i(30396),l=i(74655),s=i(17876),c=i(38457),d=i(95441),u=i(60807),p=i(7882),h=i(98914),m=i(15771),g=i(19081),v=i(36500),f=i(6490),b=i(58175),_=i(70379),y=i(27744),Z=i(75419),w=i(61412),k=i(33884),C=i(60836),S=i(63651);function B(e){var t,i;let{pub:m,post:g,comment:f,feedItem:b,onRestack:B,tabId:I,surface:P,renderWithoutUser:N=!1}=e,T=(0,u.aF)(),E=(0,_.pm)(),X=(!!T||N)&&!(null==m?void 0:m.hide_post_restacks)&&!(null==m?void 0:m.invite_only),L=!!(null===(t=f||g)||void 0===t?void 0:t.restacked),F=(null===(i=f||g)||void 0===i?void 0:i.restacks)||0,R=(0,y.I0)(),M=(0,Z.i3)(),[U,A]=(0,a.eJ)(!1),D=(0,p.ib)({pathname:"/api/v1/restack/feed"}),{iString:O}=(0,d.M1)(),{nuxModal:z,showRestackNux:j}=x(f&&!f.post_id?"note":f?"comment":"post"),H=async()=>{var e;if(!T){A(!0);return}let t=await D.refetch({method:"POST",json:{postId:f?null:null==g?void 0:g.id,commentId:(null==f?void 0:f.id)||null,mediaClipId:(null==b?void 0:b.type)==="post"?null===(e=b.mediaClip)||void 0===e?void 0:e.id:void 0,tabId:I,surface:P}});if(t instanceof Error){alert((0,h.zx)(t));return}E.popToast(e=>(0,o.tZ)(_.FN,(0,r._)((0,n._)({},e),{text:t.comment?O("Note restacked"):O("Post restacked"),Icon:l.Z,cta:O("View"),href:(0,k.E2)()}))),t.comment?R({type:"comment_restack",payload:{commentId:t.comment.id,isRestacked:!0}}):R({type:"post_restack",payload:{postId:t.post.id,isRestacked:!0}}),j(),null==B||B(!0)},W=async()=>{var e;let t=await D.refetch({method:"DELETE",json:{postId:f?null:null==g?void 0:g.id,commentId:(null==f?void 0:f.id)||null,mediaClipId:(null==b?void 0:b.type)==="post"?null===(e=b.mediaClip)||void 0===e?void 0:e.id:void 0,tabId:I}});if(t instanceof Error){alert((0,h.zx)(t));return}E.popToast(e=>(0,o.tZ)(_.FN,(0,r._)((0,n._)({},e),{text:O("Restack undone"),Icon:s.Z}))),f?R({type:"comment_restack",payload:{commentId:f.id,isRestacked:!1}}):g&&R({type:"post_restack",payload:{postId:g.id,isRestacked:!1}}),null==B||B(!1)},q=async()=>{if(!T){A(!0);return}try{var e;await M.open((0,n._)({feedItem:b,restackUrl:f?(0,C.aE)(g,f,m):(0,S.uRy)(m,g),tabId:I,surface:P},(null==b?void 0:b.type)==="post"&&{mediaClipId:null===(e=b.mediaClip)||void 0===e?void 0:e.id})),j()}catch(e){}};return(0,w.B)({name:"restack-comment",action:()=>{X&&q()}}),{canRestack:X,isRestacked:L,restacks:F,nuxModal:z,loggedOutRestackAttempt:U,menuItems:[L?(0,o.tZ)(v.sN,{leading:(0,o.tZ)(s.Z,{}),onClick:W,children:O("Undo restack")}):(0,o.tZ)(v.sN,{leading:(0,o.tZ)(l.Z,{}),onClick:H,children:O("Restack")}),(0,o.tZ)(v.sN,{leading:(0,o.tZ)(c.Z,{}),onClick:q,children:O("Restack with a note")})]}}function x(e){let t=function(e){let{entityType:t}=e,[i,n]=(0,a.eJ)(!1),r=()=>{n(!1)};return{open:()=>{n(!0)},element:(0,o.tZ)(f.u_,{isOpen:i,onClose:r,children:(0,o.tZ)(I,{onClose:r,entityType:t})})}}({entityType:e}),i=(0,p.ib)({pathname:"/api/v1/feed/has-restacked",auto:!1,cacheTtl:1/0}),n=async()=>{var e;let n=null!==(e=i.result)&&void 0!==e?e:await i.refetch();n instanceof Error||(null==n?void 0:n.hasRestacked)!==!1||(t.open(),i.setResult({hasRestacked:!0}))};return{nuxModal:t.element,showRestackNux:n}}function I(e){let{onClose:t,entityType:i}=e,{iString:n}=(0,d.M1)();return(0,o.BX)(g.tu,{paddingX:16,children:[(0,o.tZ)(g.hs,{justifyContent:"center",paddingTop:32,paddingBottom:24,children:(0,o.tZ)(l.Z,{size:40,stroke:"var(--color-fg-primary)"})}),(0,o.BX)(g.tu,{gap:12,children:[(0,o.BX)(b.xv.H3,{align:"center",children:["comment"===i&&n("You restacked a comment"),"note"===i&&n("You restacked a note"),"post"===i&&n("You restacked a post")]}),(0,o.BX)(b.xv.B3,{color:"secondary",align:"center",children:["comment"===i&&n("Restack comments that inspire you to share them with more people."),"note"===i&&n("Restack notes that inspire you to share them with more people."),"post"===i&&n("Restack posts that inspire you to share them with more people.")," ",n("Subscribers can see your restacks in the Notes tab and on your profile.")]})]}),(0,o.BX)(g.tu,{paddingBottom:16,paddingTop:20,gap:8,children:[(0,o.tZ)(m.zx,{priority:"primary",href:(0,k.E2)(),children:n("View now")}),(0,o.tZ)(m.zx,{priority:"secondary-outline",onClick:t,children:n("OK")})]})]})}},70125:function(e,t,i){i(63018)},64172:function(e,t,i){i.d(t,{Th:()=>v,Y0:()=>b,_V:()=>_,e:()=>g,lV:()=>h,p6:()=>f});var n=i(7409),r=i(99282),o=i(98848),a=i(6400),l=i(30396),s=i(45578),c=i.n(s),d=i(48980),u=i(17440);let p={hasLoadedOnce:!1,publications:[],subscriptions:[],publicationUsers:[],publicationMap:new Map,subscriptionMap:new Map,publicationUserMap:new Map,publicationsWithPledges:[]};function h(e){let{isLoggedIn:t,includePodcasts:i}=e,[o,a]=(0,l.eJ)((0,r._)((0,n._)({},p),{hasLoadedOnce:!t})),s=e=>{a(t=>{let i=c()([...t.publications,...e.publications],e=>e.id),r=c()([...t.subscriptions,...e.subscriptions],e=>e.publication_id),o=c()([...t.publicationUsers,...e.publicationUsers],e=>e.publication_id);return{hasLoadedOnce:!0,publications:i,subscriptions:r,publicationUsers:o,publicationMap:new Map(i.map(e=>[e.id,e])),subscriptionMap:new Map(r.map(e=>[e.publication_id,e])),publicationUserMap:new Map(o.map(e=>[e.publication_id,e])),publicationsWithPledges:[...t.publicationsWithPledges,...e.publicationsWithPledges],latestVoiceoverData:(0,n._)({},t.latestVoiceoverData,null==e?void 0:e.latestVoiceoverData),latestPodcastEpisodeData:(0,n._)({},t.latestPodcastEpisodeData,null==e?void 0:e.latestPodcastEpisodeData)}})};(0,l.d4)(()=>{if("serviceWorker"in navigator){let e=async e=>{var t;if((null===(t=e.data)||void 0===t?void 0:t.type)==="subscriptions-update"){let{payload:t}=e.data;t.ok&&s(t.json)}};return navigator.serviceWorker.addEventListener("message",e),()=>{navigator.serviceWorker.removeEventListener("message",e)}}},[]),(0,l.d4)(()=>{t&&(async()=>{try{for await(let e of y("/api/v1/subscriptions",{query:{include_podcasts:i?"1":void 0},getPageInit(e,t){let i=null==e?void 0:e.nextCursor;return i?(0,r._)((0,n._)({},t),{query:(0,r._)((0,n._)({},t.query),{cursor:i})}):null}}))s(e)}catch(e){console.warn(e)}})()},[t]);let h=(e,t)=>{let{subscription:i,publicationUser:o}=t;a(t=>(t=i?(0,r._)((0,n._)({},t),{subscriptions:t.subscriptions.map(e=>e.publication_id===i.publication_id?i:e),subscriptionMap:(0,u.Rg)(t.subscriptionMap,e,i)}):m(t,e),t=o?(0,r._)((0,n._)({},t),{publicationUsers:function(e,t,i){let n=(e=e.slice()).findIndex(t);return n>=0?e[n]=i:e.push(i),e}(t.publicationUsers,t=>t.publication_id===e,o),publicationUserMap:(0,u.Rg)(t.publicationUserMap,e,o)}):(0,r._)((0,n._)({},t),{publicationUsers:t.publicationUsers.filter(t=>t.publication_id!==e),publicationUserMap:(0,u.i4)(t.publicationUserMap,e)})))},g=async e=>{try{let t=await (0,d.rd)("/api/v1/subscription/".concat(e));h(e,t)}catch(t){t instanceof d.kp&&(404===t.response.status?a(t=>m(t,e)):console.error(t))}};return{result:o,isLoading:!1,hasLoadedOnce:o.hasLoadedOnce,refetch:async()=>o,refetchPublication:g,updatePublication:h,removeByPubId:e=>a(t=>m(t,e))}}function m(e,t){let i=e.subscriptions.filter(e=>e.publication_id!==t);return(0,r._)((0,n._)({},e),{subscriptions:i,subscriptionMap:new Map(i.map(e=>[e.publication_id,e]))})}let g=(0,a.createContext)({result:null,isLoading:!1,hasLoadedOnce:!1,refetch:()=>Promise.resolve(p),refetchPublication:()=>Promise.resolve(),updatePublication(){},removeByPubId:()=>{}});function v(){return(0,l.qp)(g)}function f(e){var t;let{subscriptionMap:i,publicationUserMap:n,publicationsWithPledges:r}=null!==(t=v().result)&&void 0!==t?t:{subscriptionMap:new Map,publicationUserMap:new Map,publicationsWithPledges:[]};return{subscription:i.get(e),publicationUser:n.get(e),is_pledged:!!(null==r?void 0:r.includes(e))}}function b(e){let{subscription:t,publicationUser:i,is_pledged:n}=f(e),r=(null==t?void 0:t.membership_state)==="free_signup",o=(null==t?void 0:t.membership_state)==="subscribed",a=!!(null==t?void 0:t.is_founding),l=!!(i&&["contributor","admin"].includes(i.role));return{subscription:t,publicationUser:i,isFreeSubscribed:r,isPaid:o,isSubscribed:r||o||l,isAuthor:l,isFounding:a,isPledged:n}}function _(e){var t,i;let{publicationUsers:n}=null!==(t=v().result)&&void 0!==t?t:{publicationUsers:[]};return null!==(i=n.find(t=>t.publication_id===e))&&void 0!==i?i:null}async function*y(e,t){var{getPageInit:i}=t,n=(0,o._)(t,["getPageInit"]);let r=await (0,d.rd)(e,n);yield r;let a=i(r,n);for(;null!=a;)r=await (0,d.rd)(e,a),yield r,a=i(r,n)}},91432:function(e,t,i){i.d(t,{Fb:()=>I,lU:()=>x});var n=i(7409),r=i(16584),o=i(30396),a=i(94184),l=i.n(a),s=i(86657),c=i(29032),d=i(95441),u=i(98422),p=i(71068),h=i(19081),m=i(4158),g=i(14283),v=i(18618),f=i(54480),b=i(28226),_=i(70958),y=i(61404),Z=i(43905),w=i(24791),k=i(6070),C=i(31377),S=i(93370),B=i(73015);let x=e=>{let{isFreeSubscribed:t,isSubscribed:i,isTesting:n,post:a,pub:l,section:s,variant:c,reaction_token:d,trackingProps:u}=e,[p,h]=(0,o.eJ)(!1),m=(0,o.sO)(null),g=!i&&(0,C.isPaidAudience)(a.audience);if(!a.podcastUpload)return null;let v=(0,k.lp)({post:a}),f=a.podcastUpload.is_free_preview,_=!v&&g&&(p||!f&&"notes-embed"!==c)&&!(0,w.sv)({post:a});return(0,r.BX)(r.HY,{children:[(0,r.tZ)(N,{audioFileUrl:a.podcast_url,audioPlayerRef:m,metricsPost:a,hidePreviewUI:v,paywallComponent:_?(0,r.tZ)(b.Y,{inlineIcon:"notes-embed"===c,isFreeSubscribed:t,post:a,pub:l,medium:"audio",variant:"overlay",onRestart:f?()=>{var e;(null===(e=m.current)||void 0===e?void 0:e.player)&&(h(!1),m.current.player.currentTime=0,m.current.player.play())}:void 0,magicToken:d}):void 0,podcastDuration:a.podcast_duration,podcastUpload:a.podcastUpload,post:a,postId:a.id,postTitle:a.title,pub:l,section:s,showPaidLabel:g&&!f,user:null,variant:c,onFinishAudio:()=>{h(!0)},useBlur:!0,trackingProps:u}),n&&(0,r.tZ)("button",{onClick:()=>{h(!0)},children:"finish audio"})]})},I=e=>{var t;let{audioPlayerRef:i,explicitHeight:n,explicitPodcastUrl:a,feedUrl:l,hasPaywall:s,isPrivateFeed:c,isServingFreePodcastUrl:d,post:u,pub:p,radius:h,section:m,ufiComponent:g,user:v,freeSignup:f,reaction_token:_}=e,[y,Z]=(0,o.eJ)(!1),w=(0,k.lp)({post:u}),C=null===(t=u.podcastUpload)||void 0===t?void 0:t.is_free_preview,S=!w&&s&&(!C||y)&&!d;return(0,r.tZ)(N,{audioFileUrl:u.podcast_url,audioPlayerRef:i,feedUrl:l,explicitHeight:n,explicitPodcastUrl:a,hidePreviewUI:w,isPrivateFeed:c,isServingFreePodcastUrl:d,metricsPost:u,paywallComponent:S?(0,r.tZ)(b.Y,{isFreeSubscribed:!!(null==v?void 0:v.is_free_subscribed)||!!f,post:u,pub:p,medium:"audio",variant:"overlay",onRestart:C?()=>{var e;(null===(e=i.current)||void 0===e?void 0:e.player)&&(Z(!1),i.current.player.currentTime=0,i.current.player.play())}:void 0,magicToken:_}):void 0,podcastDuration:u.podcast_duration,podcastUpload:u.podcastUpload,post:u,postId:u.id,postTitle:u.title,pub:p,radius:h,section:m,ufiComponent:g,user:v,variant:"episode-page",onFinishAudio:()=>{Z(!0)}})},P={"episode-page":400,editor:320,"notes-embed":128,"notes-full":250},N=e=>{var t,i,o;let{audioFileUrl:a,audioPlayerRef:b,explicitHeight:w,explicitPodcastUrl:k,feedUrl:C,hasFreePodcastUrlSet:x,hidePreviewUI:I,hideUfi:N,isPrivateFeed:T,isServingFreePodcastUrl:E,metricsPost:X,postId:L,postTitle:F,podcastDuration:R,pub:M,podcastUpload:U,radius:A,section:D,showPaidLabel:O,podcastPreviewUpload:z,post:j,ufiComponent:H,editComponent:W,paywallComponent:q,variant:Y,user:V,onFinishAudio:J,useBlur:K,trackingProps:G}=e,{isMobile:Q}=(0,u.v9)(),{iString:$}=(0,d.M1)(),ee=D?null!==(t=D.podcastPalette)&&void 0!==t?t:null:null!==(i=M.podcastPalette)&&void 0!==i?i:null,{title:et,backgroundUrl:ei,artUrl:en}=(0,Z.Mv)({pub:M,podcastUpload:U,section:D,thumbnailInfo:(null==U?void 0:U.full_podcast_info)&&L?{post_id:L,media_upload_id:U.full_podcast_info.media_upload_id,thumbnail_id:U.full_podcast_info.thumbnail_id}:null}),er=null!=w?w:P[Y],eo="notes-embed"===Y,ea=Q||eo,el=!!q,es=K||en===ei,ec=!!W,ed=(null==U?void 0:U.is_free_preview)||z;return(0,r.tZ)(s.Z,{ref:b,duration:R,metricsPost:X,preventSnappingToCurrentTime:!0,pub:M,skipPreloading:E,src:a,updateOnEveryFrame:R<300,onFinishAudio:J,mediaUpload:null!=U?U:void 0,trackingProps:(0,n._)({contentType:"post",entityType:"post",entityKey:null!==(o=null==j?void 0:j.id)&&void 0!==o?o:"unknown",surface:"editor"===Y?"editor":"post"},G),render:e=>{var t;let{currentTime:i,dragTime:n,isPlaying:o,playbackRate:s,progress:d,progressBarRef:u,progressBarOnMouseDown:b,remainingTime:Z,setPlaybackRate:w,skipBack:P,skipForward:X,togglePlayback:L}=e;return(0,r.tZ)(c.C,{children:(0,r.BX)(p.xu,{position:"relative",style:{minHeight:Q?Math.min(200,er):er},children:[(0,r.tZ)(m.z,{backgroundUrl:eo?null:ei,blurAmount:eo?40:120,isBlurred:es,palette:ee,radius:A}),(0,r.BX)(h.tu,{position:"absolute",inset:0,justifyContent:ea?"space-between":void 0,children:[(0,r.BX)(h.gq,{alignItems:"stretch",flex:ea?void 0:"grow",justifyContent:"space-between",children:[(!ea||!el)&&(0,r.tZ)(p.xu,{padding:ea||"notes-full"===Y?16:24,paddingBottom:"notes-embed"===Y?0:void 0,overflow:"hidden",flex:"grow",children:(0,r.tZ)(g.o,{isDisabled:el,explicitPodcastUrl:k,pub:M,post:j,postTitle:F,section:D,showUpgradeButton:E,showTitle:et,variant:"notes-embed"===Y?"notes-embed":Q||"notes-full"===Y?"mini":"regular"})}),!ea&&!el&&!N&&H&&(0,r.tZ)(h.gq,{alignItems:"center",paddingX:24,children:H}),null!=W?W:null]}),!el&&"notes-embed"!==Y&&(0,r.tZ)(h.tu,{paddingX:16,position:ea?void 0:"absolute",className:l()({[B.Z.controlsCentered]:!ea}),children:(0,r.tZ)(f.n,{audioFileUrl:a,feedUrl:C,isPlaying:null!=o&&o,isPrivateFeed:!!T,playbackRate:s,sectionId:D?D.id:null,user:V,onChangePlaybackRate:w,onSkipBack:P,onSkipForward:X,onTogglePlayback:L})}),(!ea||!el)&&(0,r.BX)(h.gq,{className:l()(B.Z.track),alignItems:"center",gap:16,opacity:el?20:void 0,padding:ea||"notes-full"===Y?16:24,paddingTop:"notes-embed"===Y?8:void 0,pointerEvents:el?"none":void 0,onClick:e=>{O||(e.stopPropagation(),e.preventDefault())},children:[ed&&ec&&z&&(0,r.tZ)(_.l,{children:(0,S.DL)(null!==(t=z.duration)&&void 0!==t?t:0)}),ed&&!I&&!ec&&(0,r.tZ)(_.l,{children:$("Preview")}),O&&(0,r.tZ)(_.l,{children:$("Paid")}),x&&(0,r.tZ)(_.l,{children:$("Free url set")}),(0,r.tZ)(y.w,{containerRef:u,currentTime:i,dragTime:n,hideStartingTimestamp:Q,progress:d,remainingTime:Z,onMouseDown:b}),"notes-embed"===Y&&(0,r.tZ)(v.DN,{isPlaying:null!=o&&o,size:40,onTogglePlayback:L})]})]}),q]})})}})}},18618:function(e,t,i){i.d(t,{DN:()=>m,KY:()=>v,fI:()=>g});var n=i(16584),r=i(52842),o=i(1055),a=i(29751),l=i(95441),s=i(15771),c=i(19081),d=i(98248),u=i(58175),p=i(66861);let h={32:10,40:14,56:16,72:20},m=e=>{let{bg:t="glass-thick",isPlaying:i,isStatic:r,size:a,onTogglePlayback:s}=e,d=h[a],{iString:u}=(0,l.M1)();return(0,n.tZ)(c.hs,{bg:t,className:p.Z.playButton,alignItems:"center",justifyContent:"center",onClick:s,style:{width:a,height:a},role:"button","aria-label":u(i?"Pause":"Play"),"aria-pressed":i,children:i?(0,n.BX)("div",{className:p.Z.pauseIcon,style:{width:d,height:d},children:[(0,n.tZ)("div",{className:p.Z.pauseIconBar}),(0,n.tZ)("div",{className:p.Z.pauseIconBar})]}):(0,n.tZ)(o.Z,{className:p.Z.playButtonIcon,height:d,isStatic:r,fill:r?"#000":void 0,stroke:"none"})})},g=e=>{let{isPlaying:t,size:i,onTogglePlayback:a,href:c,loading:u}=e,{iString:m}=(0,l.M1)(),g=h[i];return(0,n.tZ)(s.GI,{priority:"primary",onClick:a,rounded:!0,style:{width:i,height:i},href:c,children:u?(0,n.tZ)(d.$j,{theme:"media"}):t?(0,n.tZ)(r.Z,{className:p.Z.videoIcon,height:g,style:{stroke:"none"},"aria-label":m("Pause")}):(0,n.tZ)(o.Z,{className:p.Z.videoIcon,height:g,style:{stroke:"none"},"aria-label":m("Play")})})};function v(){let{iString:e}=(0,l.M1)();return(0,n.BX)(c.sg,{gap:12,alignItems:"center",children:[(0,n.BX)(s.GI,{priority:"primary",rounded:!0,style:{width:72,height:72,position:"relative",overflow:"hidden"},"aria-label":e("Unmute"),children:[(0,n.tZ)("div",{className:p.Z.audioWaveform}),(0,n.tZ)(a.Z,{fill:"var(--color-utility-white)",size:24})]}),(0,n.tZ)(u.xv.B3,{weight:"semibold",color:"white",children:e("Click to listen")})]})}},43905:function(e,t,i){i.d(t,{Mv:()=>_,U6:()=>k,a9:()=>B,bf:()=>w,mr:()=>T,nK:()=>P,tc:()=>S,ty:()=>I,wq:()=>N});var n=i(7409),r=i(99282),o=i(58865),a=i(39693),l=i.n(a),s=i(24350),c=i.n(s),d=i(49995),u=i(68833),p=i(55480),h=i(98914),m=i(24791),g=i(31377),v=i(60308),f=i(63651);function b(){let e=(0,o._)(['Invalid URL. URL should start with "','"']);return b=function(){return e},e}let _=e=>{let{pub:t,podcastUpload:i,section:o,thumbnailInfo:a,useSection:l}=e;if(l){let e=o?(0,f.Ucy)(t,{section:o}):(0,f.SVA)(t);return o?{artUrl:o.logo_url,backgroundUrl:o.cover_photo_url,description:o.description,paidArtUrl:null,title:o.name,url:e}:{artUrl:t.logo_url,backgroundUrl:t.cover_photo_url,description:null,paidArtUrl:null,title:t.name,url:e}}let{title:s,description:c,artUrl:d,paidEpisodeArtUrl:u}=o&&!l?(0,p.d_)({pub:t,section:o}):(0,p.jU)({pub:t}),h=o?(0,f.Ucy)(t,{section:o}):(0,f.SVA)(t),m=d;if(i&&a&&a.thumbnail_id>1){let e=(0,v.kOB)((0,r._)((0,n._)({},i),{id:a.media_upload_id,post_id:a.post_id,thumbnail_id:a.thumbnail_id}));e&&(m=e)}else if(i&&i.thumbnail_id>1){let e=(0,v.kOB)(i);e&&(m=e)}return{artUrl:d,backgroundUrl:m,description:c,paidArtUrl:null!=u?u:null,title:s,url:h}},y=[{key:"apple_podcasts",label:"Apple Podcasts",fieldName:"apple_podcasts_url"},{key:"spotify",label:"Spotify",fieldName:"spotify_url"},{key:"spotify_for_paid_users",label:"Spotify",fieldName:"spotify_for_paid_users_url"},{key:"youtube_music",label:"YouTube Music",fieldName:"youtube_music_url"},{key:"youtube",label:"YouTube",fieldName:"youtube_url"},{key:"overcast",label:"Overcast",fieldName:"overcast_url"},{key:"pocket_casts",label:"Pocket Casts",fieldName:"pocket_casts_url"}],Z=e=>{let{platform:t,feedUrl:i,isApple:n,isMobile:r}=e;return i?"apple_podcasts"===t&&n?"podcast://".concat((0,v.G1C)(i)):"overcast"===t&&r?"overcast://x-callback-url/add?url=".concat(encodeURIComponent(i)):"pocket_casts"===t&&r?"pktc://subscribe/".concat((0,v.G1C)(i)):null:null},w=e=>{let{feedUrl:t,isApple:i,isMobile:n,showLinks:r,userIsSubscribed:o}=e,a=[],l=c()(y,"key"),s=!1;for(let e of y){let c;if(["spotify","spotify_for_paid_users","spotify_open_access"].includes(e.key)){if(s)continue;let e=function(e){let{showLinks:t,userIsSubscribed:i}=e;return i&&t.spotify_for_paid_users_url?{label:"Spotify",platform:"spotify_for_paid_users",url:t.spotify_for_paid_users_url}:!i&&t.spotify_url?{label:"Spotify",platform:"spotify",url:t.spotify_url}:t.spotify_open_access_url?{label:"Spotify",platform:"spotify",url:t.spotify_open_access_url}:null}({showLinks:r,userIsSubscribed:o});if(e){a.push(e),s=!0;continue}}if(o&&"youtube"!==e.key)c=Z({platform:e.key,feedUrl:t,isApple:i,isMobile:n});else{var d;c=null!==(d=r[e.fieldName])&&void 0!==d?d:Z({platform:e.key,feedUrl:t,isApple:i,isMobile:n})}c&&a.push({label:l[e.key].label,platform:e.key,url:c}),"spotify"===e.key&&r.spotify_open_access_url&&a.push({label:"Spotify",platform:"spotify_open_access",url:r.spotify_open_access_url})}return a},k=e=>{let{feedUrl:t,isApple:i,isMobile:n,render:r,showLinks:o,user:a,analyticsSource:s="shows_episode_page"}=e,p=c()(y,"key");return l()([...w({feedUrl:t,isApple:i,isMobile:n,showLinks:o,userIsSubscribed:!!(null==a?void 0:a.is_subscribed)}).map(e=>{let i="spotify_open_access"===e.platform?"Spotify":p[e.platform].label;return r({key:e.platform,label:i,url:e.url,onClick:()=>{(0,u.j)(u.FP.PODCAST_APP_LINK_CLICK,{appName:i,feedUrl:t,url:e.url,source:s}),n||window.open(e.url,"_blank")}})}),t&&r({key:"rss",label:"RSS Feed",url:t,onClick:()=>{(0,u.j)(u.FP.PODCAST_FEED_URL_COPIED,{feedUrl:t,source:s}),(0,d.ZP)("RSS feed URL copied"),(0,h.vQ)(t)}})])},C={apple_podcasts:["https://podcasts.apple.com/","https://itunes.apple.com/"],overcast:["https://overcast.fm/"],pocket_casts:["https://pca.st/"],spotify:["https://open.spotify.com/"],spotify_for_paid_users:["https://open.spotify.com/"],youtube:["https://youtube.com/","https://www.youtube.com/"],youtube_music:["https://music.youtube.com/"]},S=e=>{let{platform:t,url:i,language:n}=e,{iString:r,iTemplate:o}=I18N.i(n),a=C[t];if(a.every(e=>!i.startsWith(e))){var l;return{isValid:!1,message:o(b(),null!==(l=a[0])&&void 0!==l?l:"undefined")}}return i.length>255?{isValid:!1,message:r("URL can't be longer than 255 characters")}:{isValid:!0,message:null}},B=e=>{let{pub:t,section:i,spotifySettings:n}=e;return x({showLinks:i?i.showLinks:t.show_links,spotifySettings:n})},x=e=>{let{showLinks:t,spotifySettings:i}=e,n={apple_podcasts_url:null,overcast_url:null,pocket_casts_url:null,spotify_url:null,spotify_for_paid_users_url:null,youtube_url:null,youtube_music_url:null,spotify_open_access_url:null};if(i&&(n.spotify_open_access_url=i.spotify_show_url),!t)return n;for(let e of t)n["".concat(e.platform,"_url")]=e.url;return n},I="https://support.substack.com/hc/en-us/articles/4519588148244-How-do-I-listen-to-episodes-on-my-podcast-app-",P="comments-for-scroll",N=e=>{var t,i,n,r;let{post:o,pub:a,user:l}=e,s=o.section_id&&null!==(i=a.sections.find(e=>e.id===o.section_id))&&void 0!==i?i:null;if((0,m.uo)({post:o,section:s,pub:a}))return null;if((null===(t=o.podcastFields)||void 0===t?void 0:t.free_podcast_url)&&!(null==l?void 0:l.is_subscribed))return{url:o.podcastFields.free_podcast_url,type:"free_podcast_url"};if(o.podcastUpload&&o.podcast_url){let e=!!o.podcastUpload.src_media_upload_id||!(0,g.isPaidAudience)(o.audience)||(null==l?void 0:l.is_subscribed)||null!==(r=null===(n=o.videoUpload)||void 0===n?void 0:n.preview_duration)&&void 0!==r&&r,t=(0,g.isPaidAudience)(o.audience)&&!(null==l?void 0:l.is_subscribed);return{url:o.podcast_url,type:t?e?"alternate_audio_preview":"extra_audio_preview":"alternate_full_audio"}}return null},T=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0,i=(null==t?void 0:t.decimals)===1,n=Math.floor(e/3600),r=Math.floor(e%3600/60),o=Math.floor(e%60),a=n?"".concat(n,":").concat(r<10?"0":"").concat(r,":").concat(o<10?"0":"").concat(o):"".concat(r,":").concat(o<10?"0":"").concat(o);if(i){let t=Math.round(e%1*10);return"".concat(a,".").concat(t)}return a}},79403:function(e,t,i){i.d(t,{JU:()=>K,wi:()=>J,MQ:()=>V});var n=i(7409),r=i(99282),o=i(98848),a=i(16584),l=i(30396),s=i(94184),c=i.n(s),d=i(93974),u=i(77747),p=i(58865),h=i(3312),m=i.n(h),g=i(92592),v=i(32351),f=i(95441),b=i(68833),_=i(94874),y=i(61254),Z=i(19081),w=i(58175),k=i(6163),C=i(60308),S=i(63651),B=i(81821),x=i(84864),I=i(47929);let P={threadsLinkContainer:"threadsLinkContainer-JACRi5",threadsLinkFallback:"threadsLinkFallback-sQtc8r",qrCode:"qrCode-JMB0bK",appBadge:"appBadge-jMueor",webChatLink:"webChatLink-DvDRdZ"};function N(){let e=(0,p._)([""," started a thread"]);return N=function(){return e},e}function T(){let e=(0,p._)(["Join "," subscriber chat "]);return T=function(){return e},e}function E(e){let{pub:t,utm_campaign:i}=e;return(0,a.BX)(Z.tu,{alignItems:"center",justifyContent:"center",gap:12,children:[(0,a.tZ)(A,{utm_campaign:i}),(0,a.BX)(w.xv.B4,{translated:!0,size:12,color:"secondary",className:P.threadsLinkFallback,children:["Already have the app? ",(0,a.tZ)("a",{href:(0,C.wrY)(t),children:"Open now"})]})]})}function X(e){let{pub:t,utm_campaign:i}=e;return(0,a.BX)(Z.tu,{alignItems:"center",justifyContent:"center",gap:12,children:[(0,a.tZ)(D,{utm_campaign:i}),(0,a.BX)(w.xv.B4,{translated:!0,size:12,color:"secondary",className:P.threadsLinkFallback,children:["Already have the app? ",(0,a.tZ)("a",{href:(0,C.wrY)(t),children:"Open now"})]})]})}function L(e){var t,i,n,r;let{pub:o,communityAction:l}=e,{iString:s,iTemplate:c}=(0,f.M1)(),d=l?c(N(),(null===(t=l.author)||void 0===t?void 0:t.name)||s("Someone")):c(T(),(0,x.possessive)(o.author_name)),u=(null==l?void 0:l.communityPost)?null===(i=l.communityPost.body)||void 0===i?void 0:i.slice(0,128):"Subscribe to ".concat(o.name," and join the conversation."),p=(null!==(r=null==l?void 0:l.communityPost.media_assets)&&void 0!==r?r:[])[0],h=(null==l?void 0:null===(n=l.communityPost)||void 0===n?void 0:n.type)==="media"&&!!p,g=h?p.url:o.logo_url,b=(0,S.ZVW)({pubKey:o.subdomain});return(0,a.BX)(a.HY,{children:[(0,a.tZ)(v.Metadata,{title:d,socialTitle:d,description:u,image:g,isLargeImage:h}),(0,a.tZ)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:m()((0,k.hd)(o,{name:d,url:b,description:u,potentialAction:null}),{json:!0,isScriptContext:!0})}})]})}function F(e){let{publication:t,communityAction:i,publicationAuthor:n,utm_campaign:r}=e,o=(0,B.tq)(),l=(0,B.Dt)();return(0,a.BX)(Z.tu,{gap:o?20:24,justifyContent:"center",alignItems:"center",children:[(0,a.tZ)(_.qE,{user:n,size:88}),(0,a.tZ)(Z.tu,{gap:8,children:(0,a.BX)(w.xv.H2,{translated:!0,size:24,align:"center",weight:"bold",color:"pub-primary-text",children:["Join ",I18N.p(n.name||"Substack user"),"'s subscriber chat"]})}),!o&&(0,a.tZ)("div",{className:P.threadsLinkContainer,children:(0,a.tZ)(M,{utm_campaign:r,subdomain:t.subdomain})}),o&&(l?(0,a.tZ)(X,{pub:t,utm_campaign:r}):(0,a.tZ)(E,{pub:t,utm_campaign:r})),(0,a.tZ)(R,{publication:t,source:"pub-nav-bar"}),(0,a.tZ)(L,{pub:t,communityAction:i})]})}function R(e){let{publication:t,source:i,postId:n,commentId:r,targetReplyId:o,showTarget:l,text:s}=e,{iString:c}=(0,f.M1)();return s||(s=c("Or open on web")),(0,a.tZ)("a",{href:(0,S.xC8)({pubId:t.id,postId:n,commentId:r,params:{utm_source:i,targetReplyId:o,showTarget:l}}),className:P.webChatLink,children:(0,a.tZ)(w.xv.B3,{weight:"semibold",align:"center",as:"p",color:"pub-secondary-text",children:s})})}function M(e){let{utm_campaign:t,postId:i,subdomain:n,commentId:r,targetReplyId:o}=e;return(0,a.BX)(Z.tu,{gap:24,children:[(0,a.tZ)(Z.hs,{justifyContent:"center",children:(0,a.tZ)(w.xv.B4,{translated:!0,as:"span",weight:"bold",children:"Scan the QR code below"})}),(0,a.tZ)(Z.hs,{flex:"auto",justifyContent:"center",alignSelf:"center",border:"detail",radius:"sm",className:P.qrCode,children:(0,a.tZ)(U,{utm_campaign:t,postId:i,subdomain:n,commentId:r,targetReplyId:o})}),(0,a.tZ)(y.ZC,{}),(0,a.BX)(Z.hs,{gap:16,justifyContent:"center",children:[(0,a.tZ)(A,{utm_campaign:t}),(0,a.tZ)(D,{utm_campaign:t})]})]})}function U(e){let{utm_campaign:t,postId:i,subdomain:n,commentId:r,targetReplyId:o}=e,s=(0,l.sO)(),c=r?(0,S.lsD)({commentId:r,targetReplyId:o,utm_campaign:t}):i?(0,S._5K)({postId:i,utm_campaign:t}):(0,S.ZVW)({pubKey:n,redirect:"app-store",utm_campaign:t});return(0,l.d4)(()=>{let{current:e}=s;e&&g.toCanvas(e,c,{width:180,margin:2})},[]),(0,a.tZ)("canvas",{ref:s})}function A(e){let{utm_campaign:t}=e;return(0,a.tZ)("a",{className:P.appBadge,href:(0,C.RMm)({utm_campaign:t,utm_source:I.b3.substack}),onClick:()=>{(0,b.j)(b.FP.APP_STORE_LINK_CLICKED,{app_store:"ios"})},children:(0,a.tZ)("img",{src:(0,C.zF4)("/img/app_page/app-store.png",400),height:40})})}function D(e){let{utm_campaign:t}=e;return(0,a.tZ)("a",{className:P.appBadge,href:(0,C.AaB)({utm_campaign:t,utm_source:I.b3.substack}),onClick:()=>{(0,b.j)(b.FP.APP_STORE_LINK_CLICKED,{app_store:"android"})},children:(0,a.tZ)("img",{src:(0,C.zF4)("/img/app_page/google-play.png",400),height:40})})}var O=i(55294),z=i(7845),j=i(15771),H=i(6490),W=i(91400);let q={pageContainer:"pageContainer-QRoB4X",layoutTop:"layoutTop-HNorD1",layoutCentered:"layoutCentered-puapcv",header:"header-LFnrx6"};function Y(e){let{children:t,pub:i,user:n,showHeader:r,layoutTop:o}=e;return(0,a.BX)("div",{className:c()(q.pageContainer,o?q.layoutTop:q.layoutCentered),children:[(0,a.tZ)("div",{className:q.header,children:r&&i&&n&&(0,a.tZ)(O.v,{pub:i,user:n,hideNavBar:!0,hideTitle:!0,selectedSectionId:null})}),t]})}function V(e){let{publication:t,communityAction:i,user:n,showHeader:r,activeChatInfo:o}=e;return(0,B.tq)()?(0,a.tZ)(Z.tu,{alignItems:"center",justifyContent:"center",paddingX:16,paddingTop:56,children:(0,a.tZ)(z.G,{pub:t,chatInformation:o,canSkip:!1,onNext:()=>{},hasAppInstalled:!!(null==n?void 0:n.reader_installed_at),redirectToChat:!0,upsellGroup:"publication-chat-page"})}):(0,a.tZ)(Y,{pub:t,user:n,showHeader:r,children:(0,a.tZ)(Z.tu,{flex:"grow",alignSelf:"stretch",justifyContent:"center",children:(0,a.tZ)(Z.hs,{flex:"grow",justifyContent:"center",paddingBottom:56,children:(0,a.tZ)(F,{publication:t,communityAction:i,publicationAuthor:t.author||{id:t.author_id||0,name:t.author_name||"",photo_url:t.author_photo_url},utm_campaign:I.VX.threadsPage})})})})}function J(e){let{publication:t,communityAction:i,user:n,layoutTop:r,appModalOpenByDefault:o}=e,s=(0,W.XA)(),[c,p]=(0,l.eJ)(!s&&o),h=I.VX.threadPage,{iString:m}=(0,f.M1)(),g=(0,a.BX)(Z.tu,{gap:8,children:[(0,a.tZ)(j.zx,{href:(0,S._5K)({postId:i.communityPost.id,utm_source:I.b3.chatPostLanding,redirect:"app-store",utm_campaign:h}),onClick:s?null:e=>{e.preventDefault(),p(!0)},children:m("Open in app")}),(0,a.tZ)(R,{publication:t,postId:i.communityPost.id,text:m("Or join the conversation on web"),source:"post-permalink"})]});return(0,a.tZ)(Y,{pub:t,user:n,layoutTop:r,children:(0,a.BX)(u.I,{children:[(0,a.BX)(Z.tu,{flex:"grow",alignSelf:"stretch",justifyContent:"center",children:[(0,a.tZ)(Z.hs,{flex:"grow",justifyContent:"center",paddingBottom:16,children:(0,a.tZ)(Z.tu,{style:{maxWidth:580},flex:"grow",justifyContent:"center",children:"open"===i.status?(0,a.tZ)(d.Jg,{communityPost:i.communityPost,author:i.author,withAttribution:!0,extras:s?null:g,flex:"auto",isReadOnly:!0}):(0,a.tZ)(Z.tu,{children:(0,a.tZ)(d.V8,{author:i.author,extras:s?null:g,commenters:i.communityPost.recent_commenters,count:i.communityPost.comment_count,audience:i.communityPost.audience})})})}),s&&(0,a.tZ)(Z.tu,{sizing:"border-box",borderTop:"detail-themed",paddingY:16,alignSelf:"stretch",children:g}),(0,a.tZ)(L,{pub:t,communityAction:i})]}),(0,a.tZ)(G,{utm_campaign:h,isOpen:c,postId:i.communityPost.id,onClose:()=>p(!1),subdomain:t.subdomain})]})})}function K(e){var t;let{publication:i,communityAction:n,user:r,layoutTop:o,appModalOpenByDefault:s}=e,{iString:c}=(0,f.M1)(),u=(0,W.XA)(),[p,h]=(0,l.eJ)(!u&&s),m=I.VX.commentPage,g=null!==(t=n.communityComment.parent_id)&&void 0!==t?t:n.communityComment.id,v=n.communityComment.parent_id?n.communityComment.id:void 0,b=n.communityComment.post_id,_=(0,a.BX)(Z.tu,{gap:8,children:[(0,a.tZ)(j.zx,{href:(0,S.lsD)({commentId:g,targetReplyId:v,utm_source:I.b3.chatPostLanding,redirect:"app-store",utm_campaign:m}),onClick:u?null:e=>{e.preventDefault(),h(!0)},children:c("Open in app")}),(0,a.tZ)(R,{publication:i,postId:b,commentId:g,targetReplyId:v,showTarget:!!v||void 0,text:c("Or join the conversation on web"),source:"post-permalink"})]});return(0,a.BX)(Y,{pub:i,user:r,layoutTop:o,children:[(0,a.BX)(Z.tu,{flex:"grow",alignSelf:"stretch",justifyContent:"center",children:[(0,a.tZ)(Z.hs,{flex:"grow",justifyContent:"center",paddingBottom:16,children:(0,a.tZ)(Z.tu,{style:{maxWidth:580},flex:"grow",justifyContent:"center",children:"VISIBLE"!==n.status&&n.status?"PAID_SUBSCRIPTION_REQUIRED"===n.status||"FOUNDING_SUBSCRIPTION_REQUIRED"===n.status?(0,a.tZ)(Z.tu,{children:(0,a.tZ)(d.V8,{author:n.author,extras:u?null:_,commenters:n.communityComment.recent_commenters,count:n.communityComment.reply_count,audience:"FOUNDING_SUBSCRIPTION_REQUIRED"===n.status?"only_founding":"only_paid"})}):(0,a.tZ)(Z.tu,{children:(0,a.tZ)(d.Q4,{author:n.author,extras:u?null:_,commenters:n.communityComment.recent_commenters,count:n.communityComment.reply_count})}):(0,a.tZ)(d.rk,{chatPublicationId:i.id,communityComment:n.communityComment,author:n.author,extras:u?null:_,isReadOnly:!0,isBanned:!1,quoteReply:n.quote,chatAuthorNameAttribution:i.author_name,flex:"auto"})})}),u&&(0,a.tZ)(Z.tu,{sizing:"border-box",borderTop:"detail-themed",paddingY:16,alignSelf:"stretch",children:_})]}),(0,a.tZ)(G,{utm_campaign:m,isOpen:p,postId:b,commentId:g,targetReplyId:v,onClose:()=>h(!1),subdomain:i.subdomain})]})}function G(e){var{postId:t,utm_campaign:i,subdomain:l,commentId:s,targetReplyId:c}=e,d=(0,o._)(e,["postId","utm_campaign","subdomain","commentId","targetReplyId"]);let{iString:u}=(0,f.M1)();return(0,a.BX)(H.u_,(0,r._)((0,n._)({},d),{children:[(0,a.tZ)(H.xB,{title:u("Open in the Substack app"),showClose:!0,onClose:d.onClose,showDivider:!0}),(0,a.tZ)(Z.tu,{paddingY:32,paddingX:40,children:(0,a.tZ)(M,{utm_campaign:i,postId:t,subdomain:l,commentId:s,targetReplyId:c})})]}))}},25479:function(e,t,i){i.d(t,{ol:()=>h,yk:()=>v,ze:()=>g});var n=i(16584),r=i(6400),o=i(30396),a=i(45578),l=i.n(a);i(60807);var s=i(59176),c=i(63651),d=i(54416);let u={surfaces:[],addSurface:()=>void 0},p=e=>{let[t,i]=(0,o.eJ)([]),n=(0,o.Ye)(()=>e?"".concat("user-recent-surfaces","-").concat(e.id):"",[e]);(0,o.d4)(()=>{if(!e)return;let t=(0,s.mM)(n);i(null!=t?t:[])},[e,n]);let r=(0,o.I4)(e=>{var t;let r=null!==(t=(0,s.mM)(n))&&void 0!==t?t:[],o="visited-publication"===e.type?{type:e.type,publication:{id:e.publication.id,name:e.publication.name,base_url:e.publication.base_url,logo_url:e.publication.logo_url,custom_domain:e.publication.custom_domain,custom_domain_optional:e.publication.custom_domain_optional,subdomain:e.publication.subdomain,theme:e.publication.theme,theme_var_background_pop:e.publication.theme_var_background_pop,author_photo_url:e.publication.author_photo_url,author:e.publication.author,cover_photo_url:e.publication.cover_photo_url}}:{type:e.type,profile:{name:e.profile.name,id:e.profile.id,photo_url:e.profile.photo_url}},a=l()([o,...r],e=>"visited-publication"===e.type?"pub-".concat(e.publication.id):"profile-".concat(e.profile.id)).slice(0,10);i(a);try{(0,s.ex)(n,a)}catch(e){console.error("Failed to update local recent surfaces:",e)}},[n]);return e?{surfaces:t,addSurface:r}:u},h=e=>{let{pub:t}=e,i=(0,o.sO)(null),[r,a]=(0,o.eJ)(!1);(0,o.d4)(()=>(window.addEventListener("message",l),()=>window.removeEventListener("message",l))),(0,o.d4)(()=>{var e;if(r&&(null===(e=i.current)||void 0===e?void 0:e.contentWindow)&&t){let e=i.current.contentWindow;null==e||e.postMessage({pub:t},"".concat((0,c.ZJn)()))}},[t,r]);let l=()=>{a(!0)};return"undefined"==typeof window?null:(0,n.tZ)("iframe",{className:d.Z.visitedSurfacesIFrame,ref:i,src:"".concat((0,c.ZJn)(),"/visited-surface-frame"),width:"0",height:"0"})},m=(0,r.createContext)(u);function g(){return(0,o.qp)(m)}function v(e){let{user:t,children:i}=e,{surfaces:r,addSurface:o}=p(t);return(0,n.tZ)(m.Provider,{value:{surfaces:r,addSurface:o},children:i})}},50364:function(e,t,i){i.d(t,{Hz:()=>a,Ng:()=>d,Sh:()=>l,Zu:()=>o,_N:()=>u,hO:()=>function e(t,i){if(Symbol.iterator in Object(t)){for(let n of t)if(!1===i(n)||!1===e(n.children||[],i))return!1}},ql:()=>s});var n=i(1835),r=i(26042);let o=9999,a=function(){let{likesEnabled:e=!0,language:t="en"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{iString:i}=I18N.i(t),n=[];return e&&n.push({key:"best_first",text:i("Top first"),description:i("Top comments first")}),n.push({key:"most_recent_first",text:i("Newest first"),description:i("Newest comments first")}),n.push({key:"oldest_first",text:i("Oldest first"),description:i("Oldest comments first")}),n},l=(e,t)=>{var i;return null===(i=a({language:t}).find(t=>t.key===e))||void 0===i?void 0:i.text},s={review_required:"review_required",edit_review_required:"edit_review_required",published:"published",flagged:"flagged",deleted:"deleted",moderator_approved:"moderator_approved",moderator_removed:"moderator_removed",new_commenter_approval_required:"new_commenter_approval_required"},c=new Set([s.review_required,s.edit_review_required,s.published,s.moderator_approved,s.new_commenter_approval_required]),d=e=>!e.deleted&&!!e.status&&c.has(e.status);function u(e,t){let{attachments:i}=e;if(i&&i.length>0){for(let e of i)if("post"===e.type){for(let i of e.post.publishedBylines)if(i.id===t)return!0;if((0,n.wN)(e.publication,t))return!0}else if("comment"===e.type){if(e.comment.user_id===t)return!0}else if("publication"===e.type&&(0,n.wN)(e.publication,t))return!0}return(function(e){let t=[];if(e.body_json)for(let a of(0,r.Z)(e.body_json)){var i,n,o;"substack_mention"!==a.type||(null===(i=a.attrs)||void 0===i?void 0:i.mentionType)!=="user"&&(null===(n=a.attrs)||void 0===n?void 0:n.mentionType)||t.push(null===(o=a.attrs)||void 0===o?void 0:o.id)}return new Set(t)})(e).has(t)}},75561:function(e,t,i){function n(e,t){for(let[i,n]of Object.entries(t))null!=n&&(e[i]=n);return e}function r(e,t){return Object.entries(e).every(e=>{let[i,n]=e;return n===t[i]})}i.d(t,{CD:()=>n,wU:()=>r})},435:function(e,t,i){i.d(t,{$G:()=>l,Ev:()=>m,YG:()=>h});var n=i(7409),r=i(99282);i(45578);var o=i(84864),a=i(61781);let l=3;a.Z.colors.primitive.gray["700"].toRgb();let s=a.Z.colors.primitive.white,c=a.Z.colors.primitive.black,d=(0,r._)((0,n._)({},s.toRgb()),{a:0}),u=a.Z.colors.light,p=a.Z.colors.dark,h={colors:{accent:{name:"Orange",primary:u.semantic.substack.bg.primary.toRgb(),primary_hover:u.semantic.substack.bg["primary-hover"].toRgb(),primary_elevated:u.semantic.substack.bg["primary-hover"].toRgb(),secondary:(0,r._)((0,n._)({},u.semantic.substack.bg.primary.toRgb()),{a:.2}),contrast:s.toRgb(),bg:(0,r._)((0,n._)({},u.semantic.substack.bg.primary.toRgb()),{a:.2}),bg_hover:(0,r._)((0,n._)({},u.semantic.substack.bg.primary.toRgb()),{a:.3}),dark:{primary:p.semantic.substack.bg.primary.toRgb(),primary_hover:p.semantic.substack.bg["primary-hover"].toRgb(),primary_elevated:p.semantic.substack.bg["primary-hover"].toRgb(),secondary:(0,r._)((0,n._)({},p.semantic.substack.bg.primary.toRgb()),{a:.2}),contrast:s.toRgb(),bg:(0,r._)((0,n._)({},p.semantic.substack.bg.primary.toRgb()),{a:.2}),bg_hover:(0,r._)((0,n._)({},p.semantic.substack.bg.primary.toRgb()),{a:.3})}},fg:{primary:(0,r._)((0,n._)({},c.toRgb()),{a:.8}),secondary:(0,r._)((0,n._)({},c.toRgb()),{a:.5}),tertiary:(0,r._)((0,n._)({},c.toRgb()),{a:.3}),accent:u.semantic.substack.fg.primary.toRgb(),dark:{primary:(0,r._)((0,n._)({},s.toRgb()),{a:.9}),secondary:(0,r._)((0,n._)({},s.toRgb()),{a:.5}),tertiary:(0,r._)((0,n._)({},s.toRgb()),{a:.3}),accent:p.semantic.substack.fg.primary.toRgb()}},bg:{name:"None",hue:s.toRgb(),tint:d,primary:s.toRgb(),primary_hover:u.bg["primary-hover"].toRgb(),primary_elevated:u.bg.primary.toRgb(),secondary:u.bg.secondary.toRgb(),secondary_elevated:u.bg.tertiary.toRgb(),tertiary:u.bg.tertiary.toRgb(),quaternary:u.bg.quaternary.toRgb(),dark:{primary:p.bg.primary.toRgb(),primary_hover:p.bg["primary-hover"].toRgb(),primary_elevated:p.bg["primary-hover"].toRgb(),secondary:p.bg.secondary.toRgb(),secondary_elevated:p.bg.tertiary.toRgb(),tertiary:p.bg.tertiary.toRgb(),quaternary:p.bg.quaternary.toRgb()}}}},m=e=>{var t,i,n,r,a,l,s,c,d;return{"--color-profile-light-accent":(0,o.rgbaToString)(null==e?void 0:e.colors.accent.primary),"--color-profile-light-accent-hover":(0,o.rgbaToString)(null==e?void 0:e.colors.accent.primary_hover),"--color-profile-light-accent-inverse":(0,o.rgbaToString)(null==e?void 0:e.colors.accent.contrast),"--color-profile-light-accent-text":(0,o.rgbaToString)(null==e?void 0:e.colors.fg.accent),"--color-profile-dark-accent":(0,o.rgbaToString)(null==e?void 0:e.colors.accent.dark.primary),"--color-profile-dark-accent-hover":(0,o.rgbaToString)(null==e?void 0:e.colors.accent.dark.primary_hover),"--color-profile-dark-accent-inverse":(0,o.rgbaToString)(null==e?void 0:e.colors.accent.dark.contrast),"--color-profile-dark-accent-text":(0,o.rgbaToString)(null==e?void 0:null===(t=e.colors.fg.dark)||void 0===t?void 0:t.accent),"--color-profile-light-bg-accent":(0,o.rgbaToString)(null==e?void 0:e.colors.accent.bg),"--color-profile-light-bg-accent-hover":(0,o.rgbaToString)(null==e?void 0:e.colors.accent.bg_hover),"--color-profile-dark-bg-accent":(0,o.rgbaToString)(null==e?void 0:e.colors.accent.dark.bg),"--color-profile-dark-bg-accent-hover":(0,o.rgbaToString)(null==e?void 0:e.colors.accent.dark.bg_hover),"--color-profile-light-fg-primary":(0,o.rgbaToString)(null==e?void 0:e.colors.fg.primary),"--color-profile-light-fg-secondary":(0,o.rgbaToString)(null==e?void 0:e.colors.fg.secondary),"--color-profile-light-fg-tertiary":(0,o.rgbaToString)(null==e?void 0:e.colors.fg.tertiary),"--color-profile-dark-fg-primary":(0,o.rgbaToString)(null==e?void 0:null===(i=e.colors.fg.dark)||void 0===i?void 0:i.primary),"--color-profile-dark-fg-secondary":(0,o.rgbaToString)(null==e?void 0:null===(n=e.colors.fg.dark)||void 0===n?void 0:n.secondary),"--color-profile-dark-fg-tertiary":(0,o.rgbaToString)(null==e?void 0:null===(r=e.colors.fg.dark)||void 0===r?void 0:r.tertiary),"--color-profile-light-bg-primary":(0,o.rgbaToString)(null==e?void 0:e.colors.bg.primary),"--color-profile-light-bg-primary-hover":(0,o.rgbaToString)(null==e?void 0:e.colors.bg.primary_hover),"--color-profile-light-bg-secondary":(0,o.rgbaToString)(null==e?void 0:e.colors.bg.secondary),"--color-profile-light-bg-tertiary":(0,o.rgbaToString)(null==e?void 0:e.colors.bg.tertiary),"--color-profile-light-bg-quaternary":(0,o.rgbaToString)(null==e?void 0:e.colors.bg.quaternary),"--color-profile-dark-bg-primary":(0,o.rgbaToString)(null==e?void 0:null===(a=e.colors.bg.dark)||void 0===a?void 0:a.primary),"--color-profile-dark-bg-primary-hover":(0,o.rgbaToString)(null==e?void 0:null===(l=e.colors.bg.dark)||void 0===l?void 0:l.primary_hover),"--color-profile-dark-bg-secondary":(0,o.rgbaToString)(null==e?void 0:null===(s=e.colors.bg.dark)||void 0===s?void 0:s.secondary),"--color-profile-dark-bg-tertiary":(0,o.rgbaToString)(null==e?void 0:null===(c=e.colors.bg.dark)||void 0===c?void 0:c.tertiary),"--color-profile-dark-bg-quaternary":(0,o.rgbaToString)(null==e?void 0:null===(d=e.colors.bg.dark)||void 0===d?void 0:d.quaternary)}}},6163:function(e,t,i){i.d(t,{L9:()=>g,Rg:()=>h,hd:()=>u,v_:()=>m});var n=i(7409),r=i(99282),o=i(49762),a=i(98012),l=i(31377),s=i(60308),c=i(84864),d=i(47929);function u(e){let{name:t,url:i,description:r,potentialAction:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return void 0===o&&(o={"@type":"SearchAction",name:"Search ".concat(e.name),target:"".concat(e.base_url).concat((0,s.nxG)(e),"?utm_source=").concat(d.b3.google,"&sort=search&search={search_term_string}"),"query-input":"required name=search_term_string"}),{"@context":"https://schema.org","@type":"WebSite",name:t||e.name,publisher:(0,n._)({"@type":"Organization",name:e.name,url:e.base_url},e.logo_url?{logo:{"@type":"ImageObject",url:e.logo_url}}:{},e.twitter_screen_name?{sameAs:["https://twitter.com/".concat(e.twitter_screen_name)]}:{}),url:i||e.base_url,mainEntityOfPage:{"@type":"WebPage",url:i||e.base_url},description:r||e.hero_text,potentialAction:o}}function p(e){var t,i,o,a;return(0,n._)((0,r._)((0,n._)({"@type":"Organization",name:e.name,url:(0,s.SVA)(e),description:e.hero_text},e.rankingDetailFreeIncludedOrderOfMagnitude&&{interactionStatistic:{"@type":"InteractionCounter",name:"Subscribers",interactionType:"https://schema.org/SubscribeAction",userInteractionCount:e.rankingDetailFreeIncludedOrderOfMagnitude}}),{identifier:"pub:".concat(e.id)}),e.logo_url&&{logo:{"@type":"ImageObject",url:e.logo_url,contentUrl:(0,s.zF4)(null!==(t=e.logo_url)&&void 0!==t?t:""),thumbnailUrl:(0,s.zF4)(null!==(i=e.logo_url)&&void 0!==i?i:"",128,{height:128})},image:{"@type":"ImageObject",url:e.logo_url,contentUrl:(0,s.zF4)(null!==(o=e.logo_url)&&void 0!==o?o:""),thumbnailUrl:(0,s.zF4)(null!==(a=e.logo_url)&&void 0!==a?a:"",128,{height:128})}},e.twitter_screen_name&&{sameAs:["https://twitter.com/".concat(e.twitter_screen_name)]})}function h(e,t){var i,d;let u=(0,c.getBylineUsers)(t),h=p(e),m=(0,o.default)("add_section_and_tag_metadata");return(0,n._)((0,r._)((0,n._)({"@context":"https://schema.org","@type":"NewsArticle",url:(0,s.uRy)(e,t),mainEntityOfPage:(0,s.uRy)(e,t),headline:t.search_engine_title||t.social_title||t.title,description:t.search_engine_description||t.description,image:t.cover_image?[{"@type":"ImageObject",url:t.cover_image}]:[],datePublished:(0,a.Z)(t.post_date).format("YYYY-MM-DDTHH:mm:ssZ"),dateModified:(0,a.Z)(t.post_date).format("YYYY-MM-DDTHH:mm:ssZ"),isAccessibleForFree:!(0,l.isPaidAudience)(t.audience)},t.post_paywall_content_for_google&&{hasPart:[{"@type":"WebPageElement",isAccessibleForFree:!0,cssSelector:".available-content"},{"@type":"WebPageElement",isAccessibleForFree:!1,cssSelector:".paywall-content"}]}),{author:u.length>0?u.map(e=>(0,n._)({"@type":"Person",name:e.name,url:(0,s.NNq)(e),description:e.bio,identifier:"user:".concat(e.id)},e.twitter_screen_name&&{sameAs:["https://twitter.com/".concat(e.twitter_screen_name)]},e.photo_url&&{image:{"@type":"ImageObject",contentUrl:(0,s.zF4)(e.photo_url),thumbnailUrl:(0,s.zF4)(e.photo_url,128,{height:128})}})):h,publisher:h}),m&&{articleSection:null===(i=t.section)||void 0===i?void 0:i.name,keywords:null===(d=t.postTags)||void 0===d?void 0:d.map(e=>e.slug)})}function m(e){return(0,n._)({"@context":"https://schema.org","@type":"Person",image:(null==e?void 0:e.photo_url)&&(0,s.zF4)(e.photo_url),name:"".concat(null==e?void 0:e.name),url:e&&(0,s.NNq)(e),jobTitle:null==e?void 0:e.bio,description:null==e?void 0:e.bio},(null==e?void 0:e.twitter_screen_name)?{sameAs:["https://twitter.com/".concat(e.twitter_screen_name)]}:{})}function g(e,t,i,r){let{usePreview:o}=r,l=(0,c.getBylineUsers)(t),d=p(e);return(0,n._)({"@context":"https://schema.org","@type":"VideoObject",name:t.search_engine_title||t.social_title||t.title,description:t.search_engine_description||t.description,thumbnailUrl:(0,s.ow1)(i),uploadDate:(0,a.Z)(t.post_date).format("YYYY-MM-DDTHH:mm:ssZ"),contentUrl:(0,s.rhs)("".concat((0,s.SVA)(e),"/api/v1/video/upload/").concat(i.id,"/src"),{preview:o,override_publication_id:e.id,type:"mp4"}),publisher:d,author:l.length>0?l.map(e=>(0,n._)({"@type":"Person",name:e.name,url:(0,s.NNq)(e),description:e.bio,identifier:"user:".concat(e.id)},e.twitter_screen_name&&{sameAs:["https://twitter.com/".concat(e.twitter_screen_name)]},e.photo_url&&{image:{"@type":"ImageObject",contentUrl:(0,s.zF4)(e.photo_url),thumbnailUrl:(0,s.zF4)(e.photo_url,128,{height:128})}})):d},i.duration&&{duration:"PT".concat(Math.floor(i.duration),"S")})}},62841:function(e,t,i){i.d(t,{Fl:()=>h,b8:()=>c,di:()=>d,eP:()=>u,ne:()=>p,zM:()=>a});var n=i(7409),r=i(99282);i(30396);var o=i(95441);let a={newspaper:{id:"newspaper",legacyEquivalent:"newspaper",postCount:{desktop:1,tablet:1,mobile:1}},magaziney:{id:"magaziney",legacyEquivalent:"magaziney",postCount:{desktop:3,tablet:3,mobile:3}},"magazine-5":{id:"magazine-5",legacyEquivalent:"magaziney",postCount:{desktop:5,tablet:3,mobile:5}},"feature-media":{id:"feature-media",legacyEquivalent:"newspaper",postCount:{desktop:1,tablet:1,mobile:1}},feature:{id:"feature",legacyEquivalent:"magaziney",postCount:{desktop:5,tablet:5,mobile:5}},podcast:{id:"podcast",legacyEquivalent:"newspaper",postCount:{desktop:0,tablet:0,mobile:0}}},l=["list","grid","grid-groups","custom"],s=()=>{let{iString:e}=(0,o.M1)();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("Custom"),description:e("Custom layout"),postCount:{desktop:0,tablet:0,mobile:0}}}},c=()=>{let e=s();return l.reduce((t,i)=>(0,r._)((0,n._)({},t),{[i]:e[i].postCount}),{})},d={posts:{min:3,default:6,max:7},rows:{min:1,default:2,max:4}},u=e=>{let{contentBlock:t,breakpoint:i="desktop",isTheFP:n}=e;if("list"===t.block_type)return t.num_posts||d.posts.default;if("grid"===t.block_type){let e=t.num_rows||d.rows.default;if("desktop"===i||"mobile"===i){let i=4;return t.primary_sidebar_modules.length>0&&(i-=1),t.secondary_sidebar_modules.length>0&&(i-=1),i*e}if("tablet"===i){let i=3;return(t.primary_sidebar_modules.length>0||t.secondary_sidebar_modules.length>0)&&(i-=1),i*e}}if("feature"===t.block_type){if(n){var r;return t.attrs.feature&&(null===(r=t.attrs.feature)||void 0===r?void 0:r.variant)!=="special-feature"?5:8}return 5}return"podcast_plus_three"===t.block_type?4:"single_post"===t.block_type?1:"half_feature"===t.block_type?"tablet"===i?3:4:0},p=e=>{let{contentBlocks:t,breakpoint:i,isTheFP:n,recentPosts:r,postsBySectionId:o,postsByTagId:a,postsForContentBlockPins:l}=e,s={},c=0;for(let e of t){var d,p,m;let t=[];if("latest"===e.post_source){let o=u({contentBlock:e,breakpoint:i,isTheFP:n});t=r.slice(c,c+o),c+=o}else"section"===e.post_source&&e.section_id?t=null!==(d=o[e.section_id])&&void 0!==d?d:[]:"tag"===e.post_source&&e.post_tag_id&&(t=null!==(p=a[e.post_tag_id])&&void 0!==p?p:[]);let{posts:g,numPostsDisplaced:v}=h({posts:t,contentBlockPins:null!==(m=e.contentBlockPins)&&void 0!==m?m:[],pinnedPosts:l});c-=v,s[e.id]={posts:g,postsWithoutPins:t}}return s},h=e=>{let{posts:t,contentBlockPins:i,pinnedPosts:n}=e,r=[...t],o=0;if(!i||0===i.length)return{posts:r,numPostsDisplaced:o};for(let e of i.sort((e,t)=>e.position-t.position)){let i=n[e.post_id];if(!i)continue;let a=r.findIndex(e=>e.id===i.id);-1===a?(r.splice(e.position,0,i),r=r.slice(0,t.length),o+=1):(r.splice(a,1),r.splice(e.position,0,i))}return{posts:r,numPostsDisplaced:o}}},68279:function(e,t,i){i.d(t,{UN:()=>n});let n="choose_handle"},9799:function(e,t,i){i.d(t,{I:()=>v,M:()=>g});var n=i(7409),r=i(99282),o=i(16584),a=i(30396),l=i(23493),s=i.n(l),c=i(80569),d=i.n(c),u=i(95441),p=i(68833),h=i(70379),m=i(47929);let g=e=>{let t=(0,h.pm)(),{iString:i}=(0,u.M1)(),[l,c]=(0,a.eJ)(0),g=s()(e=>{c(e)},100),v=(0,a.I4)(async()=>{var t;let i,n;let r="/api/v1/video/upload/".concat(e.id,"/src.json?type=original"),{body:{src:o}}=await d().get(r),a=await fetch(o),l=null===(t=a.body)||void 0===t?void 0:t.getReader(),s=a.headers.get("Content-Length");if(!l||!s)throw Error("Failed to read the response body or content length is missing.");let u=parseInt(s),h=0,v=[];do{let e=await l.read();i=e.done,(n=e.value)&&(v.push(n),g((h+=n.length)/u*100))}while(!i);let f=new Blob(v),b=window.URL.createObjectURL(f),_=document.createElement("a");_.href=b,_.download="undefined"!==e.name&&e.name?e.name:"original.webm",_.target="_blank",_.rel="noopener noreferrer",_.style.display="none",document.body.appendChild(_),_.click(),document.body.removeChild(_),(0,p.j)(p.FP.VIDEO_CLIP_DOWNLOAD_BUTTON_CLICKED,{name:"download",post_id:e.post_id,utm_campaign:m.VX.substackClips,utm_medium:m.lP.web}),setTimeout(()=>c(0),200)},[e]);return{startDownload:()=>{c(0),v(),t.popToast(e=>(0,o.tZ)(h.FN,(0,r._)((0,n._)({},e),{text:i("Download started, do not close the window until download is completed")})))},downloadPercentage:l}},v=async function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"original",n="/api/v1/video/upload/".concat(e.id,"/src.json?type=").concat(i),{body:{src:r},status:o}=await d().get(n);if(o>=400){let e="there was an error generating the pre-signed url of the original source";throw console.warn(e),Error(e)}let a=await fetch(r);if(a.status>=400){let e="there was an error downloading the original source";throw console.warn(e),Error(e)}let l=await a.blob(),s=window.URL.createObjectURL(l),c=document.createElement("a");c.href=s,c.download=t?"".concat(t,".mp4"):"".concat(e.name),c.target="_blank",c.rel="noopener noreferrer",c.style.display="none",document.body.appendChild(c),c.click(),document.body.removeChild(c),(0,p.j)(p.FP.VIDEO_CLIP_DOWNLOAD_BUTTON_CLICKED,{name:"download",post_id:e.post_id,utm_campaign:m.VX.substackClips,utm_medium:m.lP.web})}}}]);