!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"substack@538433c"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="386b1c84-2af1-4f05-ae69-15e061c54c60",e._sentryDebugIdIdentifier="sentry-dbid-386b1c84-2af1-4f05-ae69-15e061c54c60")}catch(e){}}();"use strict";(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["17507"],{42383:function(e,t,i){i.d(t,{A:()=>o});let o={customThemeHeader:"customThemeHeader-hnC_lZ",headerImageContainer:"headerImageContainer-RUy6uK",portraitImage:"portraitImage-IxD7Ka",fullWidthImageHeader:"fullWidthImageHeader-t5EqiB",fullWidthHeaderContent:"fullWidthHeaderContent-HjaASe",fullWidthHeaderSubtitle:"fullWidthHeaderSubtitle-VOunOK",titleAndImageContainer:"titleAndImageContainer-Eb9L9t",titleAndImageHeader:"titleAndImageHeader-IHm_Y5",noImage:"noImage-uj9DyC",image:"image-_uMo6d",thickRule:"thickRule-aN1kyk","portrait-image-container":"portrait-image-container-zwwsEI",portraitImageContainer:"portrait-image-container-zwwsEI","landscape-image-container":"landscape-image-container-QgDAqQ",landscapeImageContainer:"landscape-image-container-QgDAqQ",bylineWrapper:"bylineWrapper-AHoCt5",bylineContainer:"bylineContainer-TXwfpr",copy:"copy-WXqCFN",eagleStampContainer:"eagleStampContainer-UIFpMk",eagleStampImage:"eagleStampImage-EG5gS3",america250Logo:"america250Logo-Mg4J2n"}},52077:function(e,t,i){i.d(t,{Ay:()=>V,Ui:()=>j,vo:()=>q});var o=i(69277),n=i(70408),s=i(4006),r=i(32485),a=i.n(r),l=i(78659),d=i.n(l),c=i(90128),u=i.n(c),p=i(63375),h=i.n(p),m=i(16858),b=i(31050),_=i(56808),f=i(750),g=i(17402),v=i(15734),w=i.n(v),y=i(69715),S=i(23623),Y=i(58925),k=i(54014),C=i(84605),T=i(95064),I=i(39598),P=i(26289),A=i(86500),F=i(90250),E=i(89490),D=i(76977),N=i(22602),R=i(63136),x=i(59294),U=i(50874),O=i(82776),M=i(92967),L=i(7642),B=i(91086);function V(e){var t,i;let{disableSelection:r,player:a,postId:l,renderTranscriptionChunk:c,transcription:u,onUpdateActiveRowIndex:p}=e,{iString:m}=(0,C.GO)(),{onStartClipping:b}=(0,y.MC)(),_=(0,g.useRef)(null),{selection:f,clearSelection:v,selectEndRef:S,selectStartRef:Y}=(0,x.MB)({containerRef:_,disable:null!=r&&r,playerRef:a}),[E,N]=(0,g.useState)(!0),[O,M]=(0,g.useState)(),[L,V]=(0,g.useState)(["nick","mills"]),[j,q]=(0,g.useState)({}),[z,G]=(0,g.useState)(!1),[J,$]=(0,g.useState)(!1),[X,Q]=(0,g.useState)(),{currentTime:Z,isPlaying:ee}=(0,P.yr)(a),et=j?Object.values(j).filter(e=>e):[],ei=!!((null==L?void 0:L.length)&&et.length),{setItems:eo}=(0,T.IS)(),en=null==O?void 0:O.findIndex(e=>e.start<=Z&&e.end>Z);if((0,g.useEffect)(()=>{p&&void 0!==en&&-1!==en&&p(en)},[en,p]),(0,g.useEffect)(()=>{N(!0),u.cdn_url&&w().get(u.cdn_url).then(e=>{if(!e.text)return;let t=JSON.parse(e.text),i=(0,U.qD)({rows:t});M(i),eo(i);let o=h()(i.map(e=>{var t;return null!=(t=e.speaker)?t:""})).filter(e=>e).sort();o.length&&V(o)}).finally(()=>{N(!1)}),u.speaker_map&&Object.values(u.speaker_map).length&&q(u.speaker_map)},[null==O?void 0:O.length,eo,u.cdn_url,u.cdn_unaligned_url,u.speaker_map]),E)return(0,s.Y)(H,{});if(!(null==O?void 0:O.length))return(0,s.Y)("div",{className:B.A.transcriptionStatus,children:(0,s.Y)(R.EY.Meta,{children:m((null==u?void 0:u.status)==="in_progress"?"Transcription in progress...":"No transcript...")})});let es=(null==a||null==(i=a.current)||null==(t=i.player)?void 0:t.tagName)==="VIDEO",er=es?"videogram":"audiogram";return(0,s.FD)(D.I1,{ref:_,children:[f&&(0,s.Y)(W,{isVideo:es,selection:f,onSelect:es?()=>{if(!f||!O||!Y.current||!S.current)return;let e=Y.current,t=S.current;(e.rowIndex>t.rowIndex||e.rowIndex===t.rowIndex&&e.offset>t.offset)&&([e,t]=[t,e]);let i=(0,F.At)({startRow:O[e.rowIndex],endRow:O[t.rowIndex],startOffset:e.offset,endOffset:t.offset,startNodeText:e.text,endNodeText:t.text});v(),b((0,n._)((0,o._)({},i),{source:"transcription",title:null}))}:function(){if(f&&S.current&&Y.current&&O){let e=(0,o._)({},Y.current),t=(0,o._)({},S.current),[i,n]=(0,F.fE)({selectStart:e,selectEnd:t,alignedRows:O});i>n&&([i,n]=[n,i]),G(!0),w().post("/api/v1/audiogram").send({post_id:l,start_idx:i,end_idx:n,use_draft:!1}).then(e=>{var t,i;(null==(t=e.body)?void 0:t.data)&&(Q(e.body.data),v(),(null==a||null==(i=a.current)?void 0:i.player)&&a.current.player.pause())}).finally(()=>G(!1))}}}),c&&O.map((e,t)=>{var i;return c({isPlaying:ee,row:e,rowIndex:t,words:e.words,showSpeaker:(0===t||null==(i=O[t-1])?void 0:i.speaker)!==e.speaker,speakerName:ei&&e.speaker?j[e.speaker]:void 0,onPause:()=>{var e;(null==a||null==(e=a.current)?void 0:e.player)&&a.current.player.pause()},onPlay:()=>{var t;(null==a||null==(t=a.current)?void 0:t.player)&&(a.current.player.currentTime=e.start+1e-4,a.current.player.play())}})}),!c&&O.map((e,t)=>(0,s.Y)(K,{idx:t,row:e,rows:O,speakerName:ei&&e.speaker?j[e.speaker]:void 0,onReassign:()=>$(!0),currentTime:Z,isPlaying:ee,isSelected:!!(f&&S.current&&Y.current&&t===d()(t,Math.min(Y.current.rowIndex,S.current.rowIndex),Math.max(Y.current.rowIndex,S.current.rowIndex))),onClick:()=>{v()},onPause:()=>{var e;(null==a||null==(e=a.current)?void 0:e.player)&&a.current.player.pause()},onPlay:()=>{var t;(null==a||null==(t=a.current)?void 0:t.player)&&(a.current.player.currentTime=e.start+1e-4,a.current.player.play())}},t)),(0,s.Y)(I.B,{isOpen:!!(z||X),onClose:()=>Q(void 0),isGenerating:z,finishedGram:X,noun:er,postId:l,onDownload:function(e){return(0,A.u4)(A.qY.AUDIOGRAM_DOWNLOAD_CLICKED,{post_id:l,audiogram_id:null==X?void 0:X.id,media_upload_id:u.media_upload_id}),fetch(e,{method:"GET"}).then(e=>e.blob()).then(e=>{var t;let i=null==X||null==(t=X.video_url)?void 0:t.split("/").pop(),o=null==i?void 0:i.match(/^([^-]+-[^_]+)_/),n=(null==o?void 0:o[1])||"",s=URL.createObjectURL(e),r=document.createElement("a");r.href=s,r.download="substack-".concat(er,"-").concat(l,"-").concat(n,".mp4"),document.body.appendChild(r),r.click(),URL.revokeObjectURL(s),r.remove()})}}),(0,s.Y)(k.j,{isOpen:L&&!!L.length&&!!J,onClose:()=>$(!1),speakers:L,speakerMap:j,onChangeSpeakerMap:q,postId:l})]})}function W(e){var t,i;let{isVideo:o,selection:n,onSelect:r}=e,{iString:l}=(0,C.GO)(),d=null==(i=n.anchorNode)||null==(t=i.parentElement)?void 0:t.getBoundingClientRect();return d?(0,s.Y)(S.a,{children:(0,s.Y)(D.I1,{style:{top:(0,O.isTouchDevice)()?Math.max(d.y,0)+d.height+12:Math.max(d.bottom,0)+12,left:d.x+d.width/2,transform:"translateX(-50%)",pointerEvents:"auto",maxWidth:240},justifyContent:"center",outline:"detail",shadow:"md",radius:"md",className:a()(L.A.popover,L.A.mounted),padding:4,gap:4,children:o?(0,s.FD)(Y.ut,{onClick:r,children:[(0,s.Y)(m.A,{stroke:"var(--color-utility-white)",size:20}),(0,s.Y)(R.EY.B4,{color:"white",weight:"medium",children:l("Create clip")})]}):(0,s.FD)(Y.ut,{onClick:r,children:[(0,s.Y)(b.A,{stroke:"var(--color-utility-white)",size:20}),(0,s.Y)(R.EY.B4,{color:"white",weight:"medium",children:l("Make audiogram")})]})})}):null}function H(){return(0,s.FD)(D.VP,{gap:12,children:[(0,s.Y)(N.O,{width:"80%",height:24}),(0,s.Y)(N.O,{width:"34%",height:24}),(0,s.Y)(N.O,{width:"75%",height:24}),(0,s.Y)(N.O,{width:"100%",height:24}),(0,s.Y)(N.O,{width:"68%",height:24})]})}function j(e){if(!e)return"Unknown Speaker";let t=e.split("_"),i=parseInt(t[1]);return"".concat(u()(t[0])," ").concat(i+1)}function K(e){let{row:t,currentTime:i,onPlay:r,isPlaying:l,onPause:d,isSelected:c,onClick:u,idx:p,rows:h,onReassign:m,speakerName:b}=e,[v,w]=(0,g.useState)(!1),y=(0,g.useRef)(null),S=t.start<=i&&t.end>=i,Y=t.words.map(e=>e.start<=i&&e.end>=i?(0,s.FD)(s.FK,{children:[(0,s.Y)("span",{className:B.A.activeWord,children:e.word})," "]}):"".concat(e.word," "));Y.length||(Y=t.text.split(" ").map(e=>(0,s.FD)("span",{children:[e," "]})));let k=null;if(t.speaker&&b){var C;let e=0===p||null==(C=h[p-1])?void 0:C.speaker;t.speaker!==e&&(k=(0,s.Y)("div",{className:B.A.speakerText,onClick:m,children:b}))}return(0,s.FD)("div",{ref:y,onClick:u,onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),style:{display:"flex",width:"100%",alignItems:"center"},children:[l&&(!v||S)?(0,s.Y)(f.A,{onClick:d,size:24,className:B.A.playCircle,style:(0,n._)((0,o._)({},v&&{color:"var(--color-accent-themed)"}),{visibility:S||v?"visible":"hidden"})}):(0,s.Y)(_.A,{onClick:r,size:24,className:B.A.playCircle,style:(0,n._)((0,o._)({},v&&{color:"var(--color-accent-themed)"}),{visibility:S||v?"visible":"hidden"})}),(0,s.FD)("div",{className:a()(B.A.transcriptionChunk,{[B.A.activeRow]:S||c,[B.A.hoverChunk]:v}),"data-chunk-index":p,children:[(0,s.Y)("div",{className:a()(B.A.rowIndicator,{[B.A.hoverRow]:v})}),(0,s.FD)("div",{style:{display:"flex",flexDirection:"column",flex:1,padding:"5px 0"},children:[k,(0,s.Y)("div",{className:B.A.rowText,"data-chunk-index":p,children:Y})]})]})]})}let q=e=>{let{isActiveRow:t,isPlaying:i,row:o,rowIndex:n,onPause:r,onPlay:l,postId:d,children:c,className:u,activeClassName:p,editable:h}=e,m=t&&i;return(0,s.Y)(E.az,{id:"transcription-".concat(n),paddingRight:16,className:a()(u,{[null!=p?p:""]:m}),onClick:()=>{var e;null!=(e=window.getSelection())&&e.toString()||h||((0,A.u4)(A.qY.TRANSCRIPTION_TIMESTAMP_CLICKED,{post_id:d,timestamp:(0,M.kq)(o.start)}),m?r():l())},children:c})}},31793:function(e,t,i){i.d(t,{E:()=>P});var o=i(69277),n=i(70408),s=i(4006),r=i(83673),a=i.n(r),l=i(38970),d=i.n(l),c=i(17402),u=i(15734),p=i.n(u),h=i(89160),m=i(79796),b=i(27428),_=i(95691),f=i(84605),g=i(25006),v=i(46271),w=i(12501),y=i(68349),S=i(36372),Y=i(56458),k=i(4016),C=i(96301),T=i(77124),I=i(39318);let P=()=>{let e=(0,v.Jd)(),t=(0,g.df)(),i=(0,S.d)(),{iString:r}=(0,f.GO)(),[l,u]=(0,c.useState)((null==e?void 0:e.name)||""),[P,A]=(0,c.useState)((null==e?void 0:e.email)||""),[F,E]=(0,c.useState)(!1),[D,N]=(0,c.useState)(!1),[R,x]=(0,c.useState)(null),[U,O]=(0,c.useState)(null),[M,L]=(0,c.useState)(!1),[B,V]=(0,c.useState)(!1),[W]=(0,c.useState)(0),[H,j]=(0,c.useState)(new Set),{ids:K}=(0,m.i)({pub:t}),{ids:q}=(0,m.i)({pub:t,pubSetting:"fp_primary_column_section_ids"}),{ids:z}=(0,T.q)({pub:null!=t?t:void 0}),{ids:G}=(0,_.P)({pub:null!=t?t:void 0}),{ids:J}=(0,b.M)({pub:null!=t?t:void 0}),{ids:$}=(0,h.G)({pub:null!=t?t:void 0}),{result:X,isLoading:Q,refetch:Z}=(0,w.st)({pathname:"/api/v1/subscription",auto:!0}),{refetch:ee,isLoading:et}=(0,w.st)({pathname:"/api/v1/subscription/sections/email",auto:!1,method:"PATCH"}),{refetch:ei}=(0,w.st)({pathname:"/api/v1/subscription/email",auto:!1,method:"POST"});(0,c.useEffect)(()=>{!Q&&(null==X?void 0:X.email_settings)&&j(new Set(Object.keys(X.email_settings).filter(e=>{var t;return"individual"===(null==(t=X.email_settings)?void 0:t[e])}).map(e=>Number(e))))},[Q,X]);let eo=(0,c.useCallback)(async e=>{if(e&&e!==l){E(!0),x(null);try{await p().put("/api/v1/user/profile").send({name:e}),u(e)}catch(e){x((0,y.uX)(e)),console.error("Name update failed:",e)}finally{E(!1)}}},[l]),en=(0,c.useCallback)(async()=>{if(!(null==e?void 0:e.email))return{success:!1};L(!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(()=>(0,s.Y)(S.y,{text:"Password reset email sent. Please check your inbox."})),{success:!0}}catch(e){return console.error("Password reset failed:",e),i.popToast(()=>(0,s.Y)(S.y,{text:(0,y.uX)(e)})),{success:!1}}finally{L(!1)}},[null==e?void 0:e.email,i]),es=(0,c.useCallback)(async(e,i)=>{if(e&&e!==P){if(e!==i)return void O("Email addresses do not match");N(!0),O(null);try{await p().put("/api/v1/user/email").send({email:e,email_doublecheck:i}),A(e),(0,y.V2)((0,I.bgT)({redirect:"/subscribe?isSignInAttempt=true",for_pub:null==t?void 0:t.subdomain}))}catch(e){var o;(null==(o=e.response)?void 0:o.status)===403?O("This email is already associated with another account"):O((0,y.uX)(e)),console.error("Email update failed:",e)}finally{N(!1)}}},[P]),er=(0,c.useMemo)(()=>t?(0,Y.Jh)({pub:t,includeMainPub:!(0,k.lu)({pub:t})}):[],[t]),ea=(0,c.useMemo)(()=>er.filter(e=>{var t,i,o,n;return!z.includes(null!=(t=e.sectionId)?t:-1)&&!G.includes(null!=(i=e.sectionId)?i:-1)&&!J.includes(null!=(o=e.sectionId)?o:-1)&&!$.includes(null!=(n=e.sectionId)?n:-1)}),[er,z,G,J,$]),el=(0,c.useMemo)(()=>{let e=d()(er,"sectionId"),t=[...z,...G].filter(e=>!$.includes(e));return a()(t.map(t=>e[t]))},[er,z,G,$]),ed=(0,c.useCallback)(async(e,i)=>{if(!e||!t)return;let o=new Set(H);i?o.add(e):o.delete(e);try{await ee({json:ea.reduce((t,o)=>(o.sectionId===e&&(t[o.sectionId]={setting:i?"individual":"disabled"}),t),{})}),i&&(null==X?void 0:X.email_disabled)&&(await ei({json:{publication_id:t.id,email_disabled:!1,receive_podcast_emails:!0,source:"account_settings"}}),await Z()),j(o)}catch(e){console.error("Failed to update newsletter subscription:",e)}},[t,H,ea,ee,ei,X,Z]),ec=(0,c.useCallback)(async(e,i)=>{if(!t)return;let o=[];"fromTheFreePress"===e?o=q:"featured"===e?o=K.filter(e=>!q.includes(e)):"topic"===e?o=ea.filter(e=>!q.includes(e.sectionId||0)&&!K.includes(e.sectionId||0)).map(e=>e.sectionId||0):"video"===e&&(o=el.map(e=>e.sectionId).filter(e=>null!=e));let n=new Set(H);o.forEach(e=>{i?n.add(e):n.delete(e)});try{let e=o.reduce((e,t)=>(e[t]={setting:i?"individual":"disabled"},e),{});await ee({json:e}),i&&(null==X?void 0:X.email_disabled)&&(await ei({json:{publication_id:t.id,email_disabled:!1,receive_podcast_emails:!0,source:"account_settings"}}),await Z()),j(n)}catch(e){console.error("Failed to update newsletter group:",e)}},[t,q,K,H,ee,ei,X,Z]),eu=(0,c.useCallback)(async()=>{if(t&&e)try{let e=ea.filter(e=>e.sectionId).map(e=>e.sectionId);if(e.length>0){let t=e.reduce((e,t)=>(e[t]={setting:"disabled"},e),{});await ee({json:t})}await ei({json:{publication_id:t.id,email_disabled:!0,receive_podcast_emails:!1,source:"account_settings"}}),await Z(),j(new Set),i.popToast(()=>(0,s.Y)(S.y,{text:"Successfully unsubscribed from all emails."}))}catch(e){console.error("Failed to unsubscribe from all emails:",e),i.popToast(()=>(0,s.Y)(S.y,{text:(0,y.uX)(e)}))}},[t,e,ea,ee,ei,Z,i]),ep=(0,c.useCallback)(async()=>{if(confirm(r("Are you sure? Time paid will not be refunded")))try{await p().del("/api/v1/subscription").send({force_now:!0}),i.popToast(()=>(0,s.Y)(S.y,{text:"Subscription cancelled successfully."})),setTimeout(()=>{window.location.reload()},1e3)}catch(e){console.error("Failed to delete subscription:",e),i.popToast(()=>(0,s.Y)(S.y,{text:(0,y.uX)(e)}))}},[r,i]),eh=(0,c.useCallback)(async()=>{V(!0);try{await p().post("/api/v1/subscription/reactivate").send({}),i.popToast(()=>(0,s.Y)(S.y,{text:"Your subscription is set to renew."})),await Z()}catch(e){console.error("Failed to set to renew:",e),i.popToast(()=>(0,s.Y)(S.y,{text:(0,y.uX)(e)}))}finally{V(!1)}},[i,Z]),em=d()(ea,"sectionId"),eb=t&&q?{name:"From The Free Press",newsletters:a()(q.map(e=>em[e])).map(e=>(0,n._)((0,o._)({},e),{selected:H.has(e.sectionId||0),onToggle:t=>ed(e.sectionId||0,t)}))}:{name:"From The Free Press",newsletters:[]},e_=t&&q?{name:"All",newsletters:a()(ea.filter(e=>e.sectionId).map(e=>(0,n._)((0,o._)({},e),{selected:H.has(e.sectionId||0),onToggle:t=>ed(e.sectionId||0,t)})))}:{name:"All",newsletters:[]},ef=t&&K?{name:"Featured",newsletters:a()(K.filter(e=>!q.includes(e)).map(e=>em[e])).map(e=>(0,n._)((0,o._)({},e),{selected:H.has(e.sectionId||0),onToggle:t=>ed(e.sectionId||0,t)}))}:{name:"Featured",newsletters:[]},eg=t&&ea?{name:"Topic Alerts",newsletters:a()(ea.filter(e=>!!e.sectionId&&!q.includes(e.sectionId)&&!K.includes(e.sectionId)).map(e=>(0,n._)((0,o._)({},e),{selected:H.has(e.sectionId||0),onToggle:t=>ed(e.sectionId||0,t)})))}:{name:"Topic Alerts",newsletters:[]},ev=t&&ea?{name:"Podcast and Video Alerts",newsletters:a()(el.map(e=>(0,n._)((0,o._)({},e),{selected:H.has(e.sectionId||0),onToggle:t=>ed(e.sectionId||0,t)})))}:{name:"Podcast and Video Alerts",newsletters:[]},ew=(null==X?void 0:X.status)==="trialing",ey=null;return ew&&(X.current_period_end?ey=new Date(1e3*X.current_period_end):X.expiry&&(ey=new Date(X.expiry))),{name:l,email:P,updateName:eo,updateEmail:es,isUpdatingName:F,isUpdatingEmail:D,nameError:R,emailError:U,isSendingReset:M,handlePasswordChange:en,newsletters:{isLoading:Q||et,fromTheFreePress:eb,all:e_,featured:ef,topic:eg,video:ev,updateNewsletter:ed,updateNewsletterGroup:ec,unsubscribeFromAllEmails:eu,pubEmailsDisabled:!!(null==X?void 0:X.email_disabled)},plan:null==X?void 0:X.plan,totalAmount:null==X?void 0:X.totalAmount,currency:null==X?void 0:X.currency,isLifetime:(null==X?void 0:X.type)==="lifetime"||(null==X?void 0:X.never_ends)||!1,isComped:(null==X?void 0:X.is_comped)||!1,isTrial:ew,giftCount:W,trialEnd:ey,canChangeSubscription:!!X&&(0,C.GU)(X),subscription:null!=X?X:void 0,renewing:B,onSetToRenew:eh,onUnsubscribeNow:ep}}},6212:function(e,t,i){i.d(t,{$f:()=>eG,$y:()=>e2,DZ:()=>e1,HA:()=>eJ,I0:()=>e4,L4:()=>eQ,RR:()=>e0,sT:()=>e$});var o=i(99851),n=i(69277),s=i(70408),r=i(79785),a=i(4006),l=i(32485),d=i.n(l),c=i(84934),u=i(17402),p=i(15734),h=i.n(p),m=i(43262),b=i(3526),_=i(70997),f=i(76609),g=i(76219),v=i(95337),w=i(71328),y=i(80707),S=i(49639),Y=i(27437),k=i(15052),C=i(9615),T=i(34746),I=i(71857),P=i(13918),A=i(65754),F=i(90177),E=i(41935),D=i(20674),N=i(47789),R=i(3338),x=i(37494),U=i(76185),O=i(58398),M=i(81209),L=i(65207),B=i(49897),V=i(69656),W=i(77921),H=i(1842),j=i(90847),K=i(49984),q=i(81668),z=i(56778),G=i(52820),J=i(84565),$=i(84605),X=i(13505),Q=i(53989),Z=i(86500),ee=i(53928),et=i(66565),ei=i(94729),eo=i(64595),en=i(13022),es=i(1459),er=i(68349),ea=i(24078),el=i(89490),ed=i(35369),ec=i(16074),eu=i(76977),ep=i(20500),eh=i(63136),em=i(36372),eb=i(56007),e_=i(36375),ef=i(61554),eg=i(49095),ev=i(98111),ew=i(56458),ey=i(4016),eS=i(96301),eY=i(83873),ek=i(39318),eC=i(41086),eT=i(49807),eI=i(98949),eP=i(82776),eA=i(57324),eF=i(96063);function eE(){let e=(0,r._)(["The full video is for subscribers in the "," plan"]);return eE=function(){return e},e}function eD(){let e=(0,r._)(["The full video is for subscribers in the Founding Member plan"]);return eD=function(){return e},e}function eN(){let e=(0,r._)(["The full video is for paid subscribers"]);return eN=function(){return e},e}function eR(){let e=(0,r._)(["This email is for subscribers in the "," plan"]);return eR=function(){return e},e}function ex(){let e=(0,r._)(["This email is for subscribers in the Founding Member plan"]);return ex=function(){return e},e}function eU(){let e=(0,r._)(["This email is for paid subscribers"]);return eU=function(){return e},e}function eO(){let e=(0,r._)(["Continue reading this post for free, courtesy of ","."]);return eO=function(){return e},e}function eM(){let e=(0,r._)(["This post is for subscribers in the "," plan"]);return eM=function(){return e},e}function eL(){let e=(0,r._)(["This post is for subscribers in the Founding Member plan"]);return eL=function(){return e},e}function eB(){let e=(0,r._)(["This post is for paid subscribers"]);return eB=function(){return e},e}function eV(){let e=(0,r._)(["Subscribe to "," to continue reading"]);return eV=function(){return e},e}function eW(){let e=(0,r._)(["Visit the author’s Substack to subscribe and read more."]);return eW=function(){return e},e}function eH(){let e=(0,r._)(["Visit ",""]);return eH=function(){return e},e}function ej(){let e=(0,r._)(["Support ",""]);return ej=function(){return e},e}function eK(){let e=(0,r._)(["Subscribe to ",""]);return eK=function(){return e},e}function eq(){let e=(0,r._)(["By ",""]);return eq=function(){return e},e}function ez(){let e=(0,r._)(["Subscribe to ",""]);return ez=function(){return e},e}let eG="focus-comment-input",eJ=(e,t)=>!!e&&!e.invite_only&&!!t&&t.has_publication&&!t.is_admin&&!t.is_contributor&&!t.is_public_admin&&(0,es.e)(t,e),e$=(e,t,i,o)=>"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?!o&&i&&!(null==t?void 0:t.is_pledged):!(null==t?void 0:t.is_free_subscribed);class eX extends u.Component{async loadReactors(){let e=await h().get("/api/v1/post/".concat(this.props.post.id,"/facepile"));this.setState({reactors:e.body.reactors,restackers:e.body.restackers})}async componentDidMount(){var e,t,i,o;if(this.props.paywall&&!this.props.postPreview&&this.props.post.hidden)if("forced_registration"!==this.props.post.meter_type||this.props.user){if((0,Z.u4)(Z.qY.POST_PAYWALL_SHOWN,{post_id:this.props.post.id,post_audience:this.props.post.audience,post_type:this.props.post.type,user_id:null==(t=this.props.user)?void 0:t.id,paywall_variant:this.getPaywallConfiguration(this.state.bypassPostUnlockSubscriptionCheck).variant}),(0,ee.jN)(ee.ti.TRACK_PAYWALL_SHOWN),(0,ey.lu)({pub:this.props.pub})){let e=null==(o=window)||null==(i=o._analyticsConfig)?void 0:i.anonymousId;(0,et.BU)("paywall_shown",(0,n._)({post_id:this.props.post.id},this.props.user?{user_id:this.props.user.id,user_email:this.props.user.email,membership_type:this.props.user.is_subscribed?"paid":this.props.user.is_free_subscribed?"free":"none"}:e?{anonymousId:e}:{}))}}else(0,Z.u4)(Z.qY.POST_REGWALL_SHOWN,{post_id:this.props.post.id,post_audience:this.props.post.audience,post_type:this.props.post.type});this._triggerShare=()=>this.triggerShare(),null==(e=this.containerRef.current)||e.addEventListener("share-post",this._triggerShare),this.props.post&&this.loadReactors(),.001>Math.random()&&(0,Z.kE)({post:this.props.post});let s=(0,eC.y)("subscribe_prompt");s&&("paid"===s?this.props.popToast(()=>(0,a.Y)(em.y,{text:"Subscription purchased for ".concat(this.props.pub.name)})):this.props.popToast(()=>(0,a.Y)(em.y,{text:"Subscribed to ".concat(this.props.pub.name)})));let r=null;0x9f7afc3===this.props.post.id&&alert("userAgent: ".concat(navigator.userAgent)),(0,eI.Fr)({checkFirst4:!0})&&(/Instagram/i.test(navigator.userAgent)?r="instagram":/(Messenger|FBAN|FBAV|FB_IAB)/i.test(navigator.userAgent)?r="facebook":/LinkedIn/i.test(navigator.userAgent)&&(r="linkedin")),r&&!(0,ey.lu)({pub:this.props.pub})?this.setWebviewModalState(r):this.setPostPromptState()}componentWillUnmount(){if(this._triggerShare){var e;null==(e=this.containerRef.current)||e.removeEventListener("share-post",this._triggerShare)}this.props.stopInterval&&this.props.stopInterval()}getPaywallConfiguration(e){let{freeSignup:t,freeTrialCoupon:i,getSettingFor:o,post:n,pub:s,user:r}=this.props,a=!0===this.props.paywall&&s.paywall_free_trial_enabled&&i,l=!!(o("paywall_unlock_tokens")&&"only_paid"===n.audience&&n.teaser_post_eligible&&!(null==r?void 0:r.is_subscribed)&&((null==r?void 0:r.is_free_subscribed)||t||e)&&!(null==r?void 0:r.has_redeemed_post_unlock_token)&&!this.state.hasPostUnlockFailed);return{variant:a?"free_trial":l?"post_unlock":"regular",showPostUnlockPrompt:l}}async setWebviewModalState(e){this.setState({showWebViewModal:{action:"facebook"===e?"read":"follow",platform:e}})}async setPostPromptState(){let{post:e,disableSubscribePrompt:t,readerIsSearchCrawler:i,pub:o,user:n,referringUser:s,forceFollowPrompt:r}=this.props,a="newsletter"===e.type&&!0===this.props.getSettingFor("enable_post_page_conversion")&&!t&&!(0,er.ar)()&&!i,l=this.props.skipFollowPrompt,d=!1;if(r)d=!0;else if(!eP.PUB_IDS_TO_NOT_SHOW_FOLLOW_PROMPT_ON.includes(o.id)&&!l&&a&&s&&s.name&&s.id!==(null==n?void 0:n.id)&&o.author_id!==s.id&&o.contributors.every(e=>e.user_id!==s.id)){let e=[];if(n)try{e=await (0,ei.x6)("/api/v1/feed/following")}catch(e){console.warn("Failed to fetch following state",e)}d=!e.includes(s.id)}let c=a&&!d&&!this.props.paywall&&!this.props.freeSignup&&!n;this.setState({shouldShowFollowPrompt:d,shouldShowSubscribePrompt:c})}triggerShare(){let{fromEmail:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.setState({shareModalOpen:!0,shareModalMedium:e?"email":"web"})}onBottomReached(e){this.state.bottomReached||this.props.postPreview||(this.setState({bottomReached:!0}),(0,Z.sM)({post:this.props.post,hasPaywall:e,surface:"publication",trackerUuid:this.props.getCurrentUuid()}))}shouldShowUFI(){let{fromPostPage:e,user:t,pub:i,getSettingFor:o}=this.props,{canShowSubscribeFooterAfterPost:n}=this.state;return!!e&&!!n&&e$(i,t,!!o("payment_pledges_enabled"),this.shouldShowRecommendCta)}shouldTrackPaywallPostSeen(){if("undefined"==typeof window)return!1;let e=document.createElement("div");e.innerHTML=this.props.post.body_html;let t=this.props.pub.post_preview_limit||eP.DEFAULT_PREVIEW_LIMIT,i="",o=!1;for(let n=e.childNodes.length-1;n>=0;n--){let s=e.childNodes[n];if(s&&(i+=s.textContent).length>t){o=!0;break}}return o}render(){var e,t,i,o,s,r,l,u,p;let{user:h,pub:_,post:v,freeSignup:Y,freeSignupEmail:k,isServingFreePodcastUrl:C,isShowsPost:F,isTheFreePressTheme:D,reaction_token:M,invisible:K,paywall:G,onChange:J,hideTitle:$,noTitleLink:X,showComments:Q,fromPostPage:ee,freeTrialCoupon:et,showRestackModal:ei,stripe_publishable_key:es,crossPostInfo:er,iString:ea,iTemplate:el,themeVariables:ec,referringUser:ep,renderComments:eh,renderContent:eb,startInterval:ef,forceFollowPrompt:eg}=this.props,{showTranscription:ev,truncated:eS,autoPlayVoiceOver:eC,reactors:eP,restackers:eA,shouldShowFollowPrompt:eV,shouldShowSubscribePrompt:eW,showWebViewModal:eH,bypassPostUnlockSubscriptionCheck:ej}=null!=(o=this.state)?o:{};if(v.is_geoblocked)return(0,a.Y)(e5,{});let eK=(0,ey.lu)({pub:_}),eq=!!this.context.getConfigFor("like_posts_enabled"),ez=(0,y.Rv)(null!=(s=eS||v.body_html)?s:"",eK?"h1, h2, h3":"h1, h2, h3, h4"),eG=!G||G&&this.shouldTrackPaywallPostSeen();ef&&eG&&ef({postId:this.props.post.id,containerElementRef:this.containerRef,elementIsStatic:!0});let eJ="video"===v.type&&!G&&(null==(e=v.videoUpload)?void 0:e.transcription),e$=this.shouldShowUFI()&&!(0,ey.lu)({pub:_}),eX=(0,I.M)(v),eQ=!!eP&&eP.length>0,{showPostUnlockPrompt:e1}=this.getPaywallConfiguration(ej),e2=(0,eI.Fr)({checkFirst4:!0}),e9="";e9="video"===v.type?"founding"===v.audience&&(0,ew.m4)(_)?el(eE(),null!=(r=(0,ew.m4)(_))?r:""):el("founding"===v.audience?eD():eN()):"adhoc_email"===v.type?"founding"===v.audience&&(0,ew.m4)(_)?el(eR(),null!=(l=(0,ew.m4)(_))?l:""):el("founding"===v.audience?ex():eU()):e1?e2?ea("Continue reading this post for free in the Substack app"):el(eO(),_.author_name||_.name):"founding"===v.audience&&(0,ew.m4)(_)?el(eM(),null!=(u=(0,ew.m4)(_))?u:""):el("founding"===v.audience?eL():eB());let e3=(0,a.FD)(j.Z,{disabled:!D,post:v,isShowsPost:F,children:[(0,a.Y)(N.I,{post:v,user:h,onChange:J,reaction_token:M,children:e=>(0,a.FD)(a.FK,{children:[(0,a.Y)("div",{className:"available-content",children:ev?(0,a.Y)("div",{className:"container",children:(0,a.Y)(e_.A,{post:v,pub:_,user:h,playerRef:this.videoPlayer})}):(0,a.Y)(x.A,{html:eS||v.body_html||null,pub:_,trackSelection:!0,post:v,themeVariables:ec,user:h,freeSignup:Y,freeSignupEmail:k,paywall:G,showing_behind_paywall:!!v.post_paywall_content_for_google,onLike:e})}),v.post_paywall_content_for_google&&(0,a.Y)("div",{className:"paywall-content",children:(0,a.Y)(x.A,{html:v.post_paywall_content_for_google,pub:_,trackSelection:!1,post:v,user:h,freeSignup:Y,freeSignupEmail:k,paywall:G,onLike:e})})]})}),!K&&eG&&(0,a.Y)(z.A,{onVisible:()=>this.onBottomReached(!!G)})]}),e8=(0,ey.S2)({pub:_}),te=(0,eo.h8)({post:v,pub:_}),tt=eK?(0,a.Y)(W.n,{post:v,user:h,pub:_,freeSignupEmail:k,freeTrialCoupon:!0===this.props.paywall&&_.paywall_free_trial_enabled?et:null}):(0,a.Y)(T.pU,(0,n._)({user:h,freeSignupEmail:k,freeSignup:Y,publication:_,post:v,coupon:!0===this.props.paywall&&this.props.pub.paywall_free_trial_enabled?et:null,showPostUnlockPrompt:e1,magicToken:M,isUnsubscribedPostUnlockUpsell:ej,onOpenPostUnlockModal:ej?()=>this.setState({showPostUnlockModal:!0}):void 0,hasCompletedUnsubscribedUnlock:!!this.state.hasCompletedUnsubscribedUnlock,onPostUnlockError:()=>this.props.popToast(()=>(0,a.Y)(em.y,{text:ea("Teaser posts are not currently available for this content")}))},Object.assign({title:e9,reauthenticationTitle:ea("To read this, please re-authenticate.")},G)));return(0,a.FD)("article",{className:d()("typography ".concat(v.type,"-post post"),{"shows-post":F,"full-width-image-header":(null==(t=v.postTheme)?void 0:t.header_variant)==="full-width-image",[null!=(p=eF.A.bottomWithTos)?p:"undefined"]:_.has_custom_tos}),ref:this.containerRef,children:[(null==h?void 0:h.is_contributor)&&(null==v?void 0:v.id)&&(null==v?void 0:v.type)==="page"&&(0,a.Y)(ed.$n,{priority:"secondary",href:(0,eT.I_S)(_,v.id,{params:{back:document.location.href}}),localNavigation:!1,leading:(0,a.Y)(c.A,{size:20}),children:ea("Edit")}),(0,a.Y)(e7,{post:v,user:h,onChange:J}),(0,a.Y)(O.Z,{isOpen:!!this.state.shareModalOpen,onClose:()=>this.setState({shareModalOpen:!1,shareModalMedium:void 0}),user:h,pub:_,post:v,reaction_token:M,medium:this.state.shareModalMedium||"web"}),this.state.showPostUnlockModal&&(0,a.Y)(R.V,{post:v,pub:_,user:h,freeSignupEmail:k,magicToken:M,onClose:()=>this.setState({showPostUnlockModal:!1}),onSubscriptionComplete:()=>{if(this.setState({hasCompletedUnsubscribedUnlock:!0}),"undefined"!=typeof window&&window.history.replaceState){let e=(0,ek.oRR)({has_completed_unsubscribed_unlock:"true"});window.history.replaceState({},document.title,e)}},onUnlockFailed:()=>{this.setState({hasPostUnlockFailed:!0})},hasCompletedUnlock:!!this.state.hasCompletedUnsubscribedUnlock}),eV&&(0,a.Y)(S.y$,{pub:_,post:v,referringUser:ep,freeSignupEmail:k,forceFollowPrompt:eg,surface:"post-follow-referrer-prompt"}),eW&&(0,a.Y)(L.F,{pub:_,post:v,stripe_publishable_key:es,sharer:ep}),eH&&(0,a.Y)(b.D,{pub:_,slug:v.slug,action:eH.action,platform:eH.platform}),eb?(0,a.FD)(a.FK,{children:[!K&&(0,a.Y)(z.A,{onVisible:()=>{this.onTopReached(!!G)}}),eb({comments:eh?eh():null,crossPostInfo:er,postContent:(0,a.FD)(a.FK,{children:[e3,!!(G&&!v.post_paywall_content_for_google&&!C)&&tt]})})]}):(0,a.FD)(a.FK,{children:[(0,a.Y)(e4,{user:null!=h?h:null,pub:_,post:v,isOnPostPage:!0,reaction_token:M,allowEdit:!0,showShare:!0,showSubtitle:!0,showPhoto:!0,showCommentRestack:!_.hide_post_restacks,hideTitle:!!$,noTitleLink:!!X,onChange:J,hideDate:"page"===v.type,hideAudience:"page"===v.type,showReactions:eq,showComments:!!Q,showLabel:!0,fromPostPage:!!ee,onClickCommentButton:this.onCommentButtonClicked,reactors:eP,showRestackModal:!!ei,showTranscriptionButton:!!eJ,onTranscriptionClick:this.onTranscriptionClick,autoPlayVoiceOver:eC}),v.age_verification&&v.age_verification.status!==eY.Y.CompletedAdult&&(0,a.Y)(m.J,{content:v,description:v.subtitle,source:"post"}),!K&&eG&&(0,a.Y)(z.A,{onVisible:()=>this.onTopReached(!!G)}),(v.has_voiceover||!!v.voiceoverUpload)&&!D&&(0,a.Y)(f.g,{pub:_,post:v,mediaUploadId:v.voiceover_upload_id,duration:null==(i=v.voiceoverUpload)?void 0:i.duration,autoPlay:eC,href:v.canonical_url,isPaywalled:!v.voiceover_upload_id}),!v.voiceoverUpload&&eC&&eX&&(0,a.Y)(q.w,{postId:v.id,onClose:()=>{(0,Z.u4)(Z.qY.LISTEN_TO_THIS_POST_MODAL_DISMISSED,{post_id:v.id}),this.setState({autoPlayVoiceOver:!1})}}),er?(0,a.Y)(w.k,{postType:v.type,crossPostInfo:er}):null,(0,a.FD)("div",{children:[ez&&eK&&(0,a.Y)(H._,{postId:null==v?void 0:v.id,toc:ez,leftMargin:24,title:v.title,commentCount:v.comment_count,showComments:!0,wordCount:v.wordcount}),ez&&!eK&&(0,a.Y)(B.M,{toc:ez,position:"fixed"}),e3,te&&(0,a.Y)(g.u,{doiUrl:te.doiUrl,pdfUrl:te.pdfUrl}),G&&!v.post_paywall_content_for_google?(0,a.FD)(a.FK,{children:[tt,(0,a.Y)(A.e,{post:v})]}):eS?(0,a.Y)("p",{children:(0,a.FD)(ed.$n,{className:"expander",onClick:()=>this.setState({truncated:null}),children:["+ ",ea("show full post")]})}):!["page"].includes(null==v?void 0:v.type)&&(0,a.FD)(a.FK,{children:[e$&&(0,a.Y)(e0,{pub:_,post:v,user:h,freeSignup:!!Y,freeSignupEmail:k}),!e$&&this.shouldShowRecommendCta&&(0,a.Y)(U.R,{pub:_}),er&&("only_paid"===v.audience||"founding"===v.audience)&&(0,a.Y)(eZ,{pub:_}),(0,en.Ay)("like_posts_enabled")&&_.community_enabled&&eQ&&!D&&(0,a.Y)(eu.fI,{borderTop:"detail-themed",paddingY:16,children:(0,a.Y)(P.d2,{post:v,pub:_,user:h,reactors:eP,secondaryFaces:eA})}),!D&&(0,a.Y)(a.FK,{children:(0,a.Y)("div",{className:"post-footer",children:(0,a.Y)(E.bW,{post:v,pub:_,user:h,onChange:J,postReactionToken:M,position:"post-footer"})})}),(0,a.Y)(A.e,{post:v})]}),v.show_guest_bios&&"podcast"!==v.type&&!eK&&!e8&&(0,a.Y)(e6,{user:h,post:v})]})]}),eK&&G&&!(null==h?void 0:h.is_subscribed)&&"everyone"!==v.audience&&(0,a.Y)(V.Q,{pub:_})]})}constructor(e,t){var i,n,s;super(e,t),(0,o._)(this,"containerRef",void 0),(0,o._)(this,"podcastCommentInput",void 0),(0,o._)(this,"podcastPlayer",void 0),(0,o._)(this,"videoPlayer",void 0),(0,o._)(this,"shouldShowRecommendCta",void 0),(0,o._)(this,"_triggerShare",void 0),(0,o._)(this,"onTopReached",e=>{this.state.topReached||this.props.postPreview||(this.setState({topReached:!0}),(0,Z.Jw)({post:this.props.post,hasPaywall:e,surface:"publication",markRead:!!this.props.user&&!this.props.noPageView,user:this.props.user,trackerUuid:this.props.getCurrentUuid()}))}),(0,o._)(this,"onTranscriptionClick",()=>{this.setState(e=>({showTranscription:!e.showTranscription}))}),(0,o._)(this,"onCommentButtonClicked",e=>{this.props.showComments&&!this.props.post.comment_count&&(e.stopPropagation(),e.preventDefault(),document.dispatchEvent(new CustomEvent(eG)))});const r="true"===(0,eC.y)("has_completed_unsubscribed_unlock")&&(null==(i=this.props.user)?void 0:i.is_free_subscribed),a=!0===this.props.paywall&&"only_paid"===this.props.post.audience&&this.props.post.teaser_post_eligible,l=!this.props.user&&a,d=this.props.user&&a&&!this.props.user.is_subscribed&&!this.props.user.reader_installed_at&&(r||!this.props.user.is_free_subscribed&&!this.props.user.has_redeemed_post_unlock_token),c={bypassPostUnlockSubscriptionCheck:!!(l||d),showTranscription:!1,autoPlay:!1,autoPlayVoiceOver:!1,commentSort:null!=(s=e.post.default_comment_sort)?s:"best_first",loadedWithHeaderLink:"undefined"!=typeof window&&(null==(n=window.location.hash)?void 0:n.startsWith("#".concat(encodeURIComponent("\xa7")))),reactors:null,feedUrl:null,shouldShowSubscribePrompt:!1,shouldShowFollowPrompt:!1,hasCompletedUnsubscribedUnlock:r};e.paywall||e.post.hidden||!e.post.body_html||(c.canShowSubscribeFooterAfterPost=e2(e.post.body_html),c.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 o=document.createElement("div");if(o.innerHTML=e,null===o.textContent||o.textContent.length1&&o.textContent.length>i);return o.innerHTML}(e.post.body_html,e.truncateAt,e.truncateTo):null),"undefined"!=typeof window&&window.history.replaceState&&("true"===(0,eC.y)("autoPlay")&&(window.history.replaceState({},document.title,(0,ek.oRR)({autoPlay:null})),c.autoPlay=!0),"true"===(0,eC.y)("play_audio")&&(window.history.replaceState({},document.title,(0,ek.oRR)({play_audio:null})),c.autoPlayVoiceOver=!0)),this.state=c,this.containerRef=(0,u.createRef)(),this.podcastCommentInput=(0,u.createRef)(),this.podcastPlayer=(0,u.createRef)(),this.videoPlayer=(0,u.createRef)(),this.shouldShowRecommendCta=eJ(e.pub,e.user)}}(0,o._)(eX,"contextType",J.Ke),(0,o._)(eX,"displayName","Post");let eQ=(0,eb.Ho)((0,G.WR)((0,Q.S0)((0,$.wr)((0,X.BF)(eX))))),eZ=e=>{let{pub:t}=e,{iTemplate:i}=(0,$.GO)();return(0,a.FD)(a.FK,{children:[(0,a.Y)(ec.c,{paddingTop:16}),(0,a.FD)(eu.VP,{gap:16,paddingY:32,alignItems:"center",children:[(0,a.FD)(eu.VP,{gap:8,paddingBottom:8,children:[(0,a.Y)(eh.EY.H4,{flex:"grow",align:"center",children:i(eV(),t.name)}),(0,a.Y)(eh.EY.B3,{flex:"grow",align:"center",color:"secondary",children:i(eW())})]}),(0,a.Y)(ed.$n,{priority:"primary",onClick:()=>{(0,Z.u4)(Z.qY.POST_END_CTA_CLICKED,{type:"cross-post"}),(0,er.V2)((0,eT.eV6)(t,{params:{utm_source:eA.VU.postEndCta,addBase:!0}}),{local_navigation:!1})},children:i(eH(),t.name)})]})]})},e0=e=>{let{pub:t,post:i,user:o,freeSignup:n,freeSignupEmail:s,overridePledgesEnabled:r}=e,{iString:l,iTemplate:d}=(0,$.GO)(),{getSettingFor:c}=(0,Q.Pu)(),[p,h]=(0,u.useState)(null),m=(0,eC.y)("just_subscribed"),b="disabled"===t.payments_state&&!t.invite_only&&(c("payment_pledges_enabled")||r),_="enabled"===t.payments_state&&(null==o?void 0:o.is_free_subscribed)&&!(null==o?void 0:o.is_subscribed)?"paid_upsell":b&&(null==o?void 0:o.is_free_subscribed)&&!(null==o?void 0:o.is_pledged)?"pledge_upsell":"free_upsell",f=b&&(null==o?void 0:o.is_free_subscribed)&&!(null==o?void 0:o.is_pledged);(0,u.useEffect)(()=>{(0,Z.u4)(Z.qY.POST_END_CTA_RENDERED,{pub_id:t.id,post_id:i.id,type:_})},[t.id,i.id,_,f,null==o?void 0:o.is_free_subscribed]);let g=(0,eP.getByLine)(t);return(0,a.FD)(a.FK,{children:[(0,a.Y)(ec.c,{paddingTop:16}),(0,a.Y)(z.A,{onVisible:()=>{(0,Z.u4)(Z.qY.POST_END_CTA_SEEN,{pub_id:t.id,post_id:i.id,type:_})}}),(0,a.FD)(eu.VP,{gap:16,paddingY:32,children:[(0,a.FD)(eu.VP,{gap:8,paddingBottom:8,children:[(0,a.Y)(eh.EY.H4,{flex:"grow",align:"center",children:b&&(null==o?void 0:o.is_free_subscribed)?d(ej(),t.name):d(eK(),t.name)}),(0,a.FD)(eh.EY.B3,{flex:"grow",align:"center",color:"secondary",children:[g?d(eq(),g):null,g&&t.rankingDetail?" \xb7 ":null,t.rankingDetail]}),t.hero_text&&(0,a.Y)(eh.EY.B3,{color:"primary",flex:"grow",align:"center",children:t.hero_text})]}),(0,a.Y)(eu.VP,{alignItems:"center",gap:16,children:f?(0,a.Y)(ed.$n,{priority:"primary",onClick:()=>{(0,Z.u4)(Z.qY.POST_END_CTA_CLICKED,{type:"pledge"}),(0,er.V2)((0,eT.eV6)(t,{params:{utm_source:eA.VU.postEndCta}}),{local_navigation:!1})},children:l("Pledge your support")}):(0,a.FD)(a.FK,{children:[(0,a.Y)(M.A,{pub:t,post:i,user:o,freeSignup:n,freeSignupEmail:s,isStatic:!1,onPrepareData:()=>{h(null)},source:"post-end-cta",className:eF.A.subscribeWidget}),p&&(0,a.Y)(ep.yn,{align:"center",children:p}),!(null==o?void 0:o.is_free_subscribed)&&!m&&(0,a.Y)(eu.VP,{maxWidth:400,children:(0,a.Y)(ef.U,{includeCheckbox:!1,addSubscribePreamble:!0,color:"secondary",textAlign:"center"})})]})})]})]})},e1=e=>{let{pub:t}=e;return(0,a.FD)("div",{className:"post-silhouette",children:[(0,a.Y)("div",{className:"post-silhouette-title"}),(0,a.Y)("div",{className:"post-silhouette-meta ".concat(t&&t.bylines_enabled&&t.byline_images_enabled?"with-byline-image":"")}),(0,a.Y)("div",{className:"post-silhouette-body"})]})},e4=e=>{var t,i,o,n;let s,{allowEdit:r,allowSendEmail:l,allowTruncate:c,base_url:u,children:p,className:h,hideAudience:m,hideDate:b,hideTitle:f,hidePinning:g,noTitleLink:w,isStatic:y,isFreePreview:S,is_draft:Y,onChange:T,post:A,pub:N,reaction_token:R,showComments:x,showDatetime:U,showEmailSent:O,showReactions:M,showShare:L,showAppUpsell:B,showSubtitle:V,showPhoto:W,showLabel:H,showRestack:j,showCommentRestack:q,hideAuthor:z,user:G,utm_source:J,fromPostPage:X,onClickCommentButton:Q,reactors:Z,inThreadHead:ee,publishedPost:et,compEndsSoon:ei,compEndedRecently:eo,siteConfigValues:en={},eligibleForTTS:es,showRestackModal:er,showIcon:ea,isOnPostPage:el,showTranscriptionButton:ed,onTranscriptionClick:ec,isAppMode:ep=!1,republishingPost:em,autoPlayVoiceOver:eb=!1,readInAppText:e_}=e,{iString:ef}=(0,$.GO)(),eg=(0,eI.Fr)({checkFirst4:!0}),ew=em||A,eY="number"==typeof c?c:45,ek=A.title&&A.title.length>eY,eC=Y?A.draft_title:A.title,eE=[(ea||"thread"===A.type)&&(0,a.Y)(k.A,{isStatic:y,height:15,className:A.type}),ek&&c?(0,eP.truncateWords)(eC,eY):eC],eD=Y?A.draft_subtitle:A.subtitle;A.section_id&&N.sections&&N.sections.length&&(A.section=N.sections.find(e=>e.id===A.section_id));let eN=(0,eS.ZA)({pub:N,subscriptionType:null==G?void 0:G.subscription_type}),eR=!["page"].includes(null==A?void 0:A.type),ex=eR&&y&&ei&&!eN&&(null==en?void 0:en.continue_support_cta_in_newsletter_emails),eU=(0,I.M)(A)||es||A.voiceoverUpload,eO=(null==A?void 0:A.type)==="adhoc_email",eM=eR&&y&&!eO&&!ep,eL=(0,ey.lu)({pub:N})&&(!!A.postTheme||["video","podcast"].includes(A.type)&&ee);s=A.post_url_override?A.post_url_override:y&&ep?ev.T.POST_TITLE_APP_MODE_URL:y&&(null==en?void 0:en.publication_has_own_app)?ev.T.POST_URL:y?ev.T.POST_TITLE_URL:"".concat((0,eT.wu9)(N,A)).concat(J?"?utm_source=".concat(J):"");let eB="".concat(N.base_url+(ew.section?(0,eT.Dor)(N,{section:ew.section}):""),"/?utm_source=").concat(eA.VU.substack,"&utm_medium=").concat(eA.Jn.menu);return eL?(0,a.Y)(K.Xl,{post:A,postTheme:A.postTheme,title:eC,subtitle:eD,pub:N,inThreadHead:!!ee,autoPlayVoiceOver:eb}):(0,a.FD)("div",{className:d()("post-header",h),role:"region","aria-label":ef("Post header"),children:[(0,ey.S2)({pub:N})&&(null!=(n=null==(t=A.postTags)?void 0:t.length)?n:0)>0&&(0,a.Y)(eu.fI,{alignItems:"center",gap:4,paddingBottom:8,children:null==(i=A.postTags)?void 0:i.map((e,t)=>(0,a.FD)(a.FK,{children:[0!==t&&(0,a.Y)(eh.EY.Meta,{children:"—"}),(0,a.Y)(eh.EY.Meta,{as:"a",size:14,href:(0,eT.ii9)(N,e),children:e.name})]}))}),H&&A.section&&(0,a.Y)(eu.fI,{className:"post-label",children:(0,a.Y)(eh.EY.Meta,{as:"a",size:14,href:eB,children:null==(o=ew.section)?void 0:o.name})}),ex&&(0,a.Y)(v.K,{post:A,compAlreadyExpired:eo}),!f&&(0,a.Y)("h1",{className:d()("post-title",A.is_published?"published":"restack"!==A.type||em?"adhoc_email"===A.type?"adhoc":"unpublished":"email-only-cross-post",{"post-title--the-pillar":(0,ey.S2)({pub:N})},eF.A.title),dir:"auto",children:w?eE:(0,a.Y)("a",{href:s,children:eE})}),V&&eD&&(0,a.Y)("h3",{className:d()("subtitle",{"subtitle--the-pillar":(0,ey.S2)({pub:N})},eF.A.subtitle),dir:"auto",children:eD}),"page"===A.type?(0,a.Y)("div",{style:{height:32}}):el&&!y?(0,a.FD)(eu.VP,{paddingBottom:16,"aria-label":ef("Post UFI"),role:"region",children:[(0,a.FD)(eu.fI,{paddingY:16,justifyContent:"space-between",alignItems:"center",children:[(0,a.Y)(D.D,{post:A,pub:N}),(0,a.Y)(C.C,{post:A,pub:N,user:G})]}),(0,a.Y)(_.p,{user:G,isMobile:eg,post:A}),eg?X&&(0,a.Y)(E.I2,{post:A,pub:N,user:G,isStatic:!!y,postReactionToken:R,onChange:T,allowEdit:r,hidePinning:g,showEmailSent:O,allowSendEmail:l,hideComments:!x,onCommentsClick:Q,showRestackModal:er}):(0,a.Y)(E.bW,{post:A,pub:N,user:G,onChange:T,showRestackModal:er,showTranscriptionButton:ed,onTranscriptionClick:ec,showClipping:"video"===A.type,postReactionToken:R,position:"post-header"})]}):(0,a.FD)(a.FK,{children:[!eR||y||et||ee?eR&&!y&&et?(0,a.Y)(E.xx,{post:A,pub:N,user:G,variant:"compressed",labelStyle:"counts-or-none",postReactionToken:R,showEmailSent:O,hideShare:!L||"restack"===A.type,hideComments:"restack"===A.type,hideSavePost:"restack"===A.type,hideReactions:"restack"===A.type,showPreamble:!0,onChange:void 0,allowEdit:r,allowSendEmail:l,editButtonIsLast:!0,preambleConfig:{showAudience:!m,showDate:!b,showDatetime:U,showAuthor:!z},isStatic:y,position:"publisher-post-list"}):ee&&!y?(0,a.Y)(E.xx,{post:A,pub:N,user:G,variant:"compressed",labelStyle:"counts-or-none",postReactionToken:R,hideSavePost:!0,showPreamble:!0,allowEdit:r,allowSendEmail:l,editButtonIsLast:!0,onChange:T,preambleConfig:{showAudience:!m,showDate:!b,showDatetime:U,showAuthor:!z},hideShare:!L,position:"publisher-post-list",isStatic:y}):eR?(0,a.Y)(P.u3,{user:G,pub:N,post:A,showDate:!b,showDatetime:U,showEmailSent:O,showAudience:!m,showReactions:!eM&&M,showComments:!eM&&x,showShare:!eM&&L,showRestack:!eM&&j,reaction_token:R,onChange:T,isStatic:y,isFreePreview:S,sharedShareDialog:!0,base_url:u,allowSendEmail:l,allowEdit:r,showAuthor:!z,showPhoto:W,hidePinning:g,inThreadHead:ee,fromPostPage:X,onClickCommentButton:Q,reactors:Z,isAppMode:ep}):(0,a.Y)("div",{className:"spacer",style:{height:24}}):(0,a.Y)(F.s,{className:"meta-subheader",pub:N,post:A,user:G,showDate:!b,showDatetime:!!U,isStatic:!!y,postReactionToken:R,onChange:T,allowEdit:r,hidePinning:g,showEmailSent:O,allowSendEmail:l,allowMobileFooter:X,onCommentsClick:Q,showRestackModal:er}),eR&&eM&&(0,a.Y)(E.fz,{readInAppText:e_,customization:{showShare:L,showComments:x,showReactions:M,showListen:!j&&!S&&!!eU,showSave:!j,showRestack:j,showCommentRestack:q,showAppUpsell:B}}),eO&&(0,a.Y)("div",{className:"email-ufi-2-empty"})]}),p]})},e6=e=>{let{user:t,post:i}=e,{iString:o,iTemplate:n}=(0,$.GO)(),s=(0,eP.getBylineUsers)(i).filter(e=>e.is_guest);return 0===s.length?null:(0,a.FD)("div",{className:"post-contributor-footer",children:[(0,a.Y)("div",{className:"container-border"}),s.map(e=>{let i=(0,eP.guessFirstName)(e.name),s=e.primaryPublicationSubscribeUrl;s&&(null==t?void 0:t.email)&&(s=(0,ek.oRR)(s,{email:t.email,autoSubmit:!0,utm_source:eA.VU.substack,utm_campaign:eA._9.guestPostBio,utm_medium:eA.Jn.web}));let r=(0,ek.oRR)((0,eT.gYq)(e),{utm_campaign:eA._9.guestPostBio,utm_medium:eA.Jn.web}),l=!!e.photo_url;return(0,a.Y)("div",{className:d()("post-contributor-bio",{"post-contributor-bio-no-text":!e.bio}),"data-user-id":e.id,children:(0,a.Y)("table",{cellpadding:"0",cellspacing:"0",className:"post-contributor-bio-table",children:(0,a.FD)("tr",{className:"post-contributor-bio-table-row",children:[l&&(0,a.Y)("td",{className:"post-contributor-bio-userhead-cell post-contributor-bio-userhead-cell-web",children:(0,a.Y)(ea.tp,{size:52,user:e,utmSource:"byline"})}),(0,a.Y)("td",{className:"post-contributor-bio-body-cell post-contributor-bio-body-cell-web",children:(0,a.FD)("div",{className:"post-contributor-bio-body",children:[e.bio&&(0,a.Y)("div",{className:"post-contributor-bio-preamble",children:o("A guest post by")}),(0,a.Y)("table",{cellpadding:"0",cellspacing:"0",className:"post-contributor-bio-body-table",children:(0,a.FD)("tr",{className:"post-contributor-bio-body-table-row",children:[(0,a.FD)("td",{className:"post-contributor-bio-copy-cell",children:[!e.bio&&(0,a.Y)("div",{className:"post-contributor-bio-preamble",children:o("A guest post by")}),(0,a.FD)(eu.fI,{gap:4,alignItems:"center",paddingBottom:4,children:[(0,a.Y)(Y.ProfileHoverCard,{subject:e,utmSource:"byline",trigger:(0,a.Y)("a",{className:"post-contributor-bio-title no-margin",href:r,"data-native":!0,children:e.name})}),(0,a.Y)(eg.UserStatusSymbols,{size:"sm",tier:e.bestseller_tier,userId:e.id})]}),e.bio&&(0,a.Y)("div",{className:"post-contributor-bio-text",children:e.bio})]}),(0,a.Y)("td",{className:"post-contributor-bio-controls-cell post-contributor-bio-controls-cell-web",children:(0,a.Y)("div",{className:"post-contributor-bio-controls",children:s&&(0,a.Y)("a",{className:"post-contributor-bio-subscribe-button button primary",href:s,"data-native":!0,children:(0,a.Y)("span",{className:"post-contributor-bio-subscribe-button-label",children:n(ez(),i)})})})})]})})]})})]})})})})]})};function e2(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 o="",n=!1;for(let e=i.childNodes.length-1;e>=0;e--){let s=i.childNodes[e];if(s){if((0,er.nB)(s,"button-wrapper")||(0,er.nB)(s,"subscription-widget-wrap")||(0,er.nB)(s,"subscribe-widget")){n=!0;break}if((o+=s.textContent).length>t)break}}return!n}function e7(e){let{post:t,user:i,onChange:o}=e,{onSave:r}=(0,E.Jj)({post:t,isSaved:!1});return(0,u.useEffect)(()=>{if("save"===new URL(location).searchParams.get("action")&&(history.replaceState({},"",(0,ek.oRR)({action:null})),i)){let e=r();o({post:(0,s._)((0,n._)({},t),{is_saved:e})})}},[]),null}let e5=()=>(0,a.Y)("article",{className:d()("typography post",{"shows-post":!1}),children:(0,a.Y)(el.az,{className:"container",padding:12,children:(0,a.Y)("p",{align:"center",children:(0,a.Y)(eh.EY,{translated:!0,as:"span",children:"This content has been withheld in your country in response to a legal requirement."})})})})},66665:function(e,t,i){i.d(t,{A:()=>S});var o=i(69277),n=i(70408),s=i(4006),r=i(75107),a=i(49436),l=i(17402),d=i(31793),c=i(63446),u=i(15894),p=i(32600),h=i(25006),m=i(46271),b=i(17306),_=i(12501),f=i(76977),g=i(39318),v=i(57324);let w="description-RcyL9U",y="isCollapsed-VgTQX_",S=e=>{var t,i;let{post:S}=e,Y=S.publishedBylines,{sectionId:k}=(0,p.C)(null!=(i=null==(t=Y[0])?void 0:t.id)?i:-1),C=(0,h.df)(),T=(0,m.Jd)(),{newsletters:I}=(0,d.E)(),P=I.topic.newsletters.map(e=>e.sectionId).includes(S.section_id),[A,F]=(0,l.useState)(!1),E=k||(P?S.section_id:null),[D,N]=(0,l.useState)(null),[R,x]=(0,l.useState)(null),{markdownProps:U}=(0,b.$)(D),{result:O,refetch:M}=(0,_.st)({pathname:"/api/v1/subscription",auto:!1}),{refetch:L}=(0,_.st)({pathname:"/api/v1/subscription/sections/email",auto:!1,method:"PATCH"}),B=async(e,t)=>{await L({json:{[e]:{setting:t?"individual":"disabled"}}})};if((0,l.useEffect)(()=>{if(E&&C){var e;let t=C.sections.find(e=>e.id===E);N((null==t||null==(e=t.custom_config)?void 0:e.short_description)||(null==t?void 0:t.description)||null),x((null==t?void 0:t.name)||null)}},[E,C]),(0,l.useEffect)(()=>{M()},[]),!E)return null;let V=!!k,W=(null==O?void 0:O.email_settings[E])==="individual",H=!!(null==T?void 0:T.subscription_id)||!!(null==T?void 0:T.is_free_subscribed),j=async()=>{if(E){if(!H&&C){var e;let t=null==(e=C.sections.find(e=>e.id===E))?void 0:e.slug;if(!t)return;let i=(0,g.eV6)(C,{addBase:!0,sectionSlug:t,next:(0,g.yRP)(window.location.href,{follow:!0}),utm_source:v.VU.followAuthorCta,utm_medium:v.Jn.web});window.location.href=i;return}await B(E,!W)}};return(0,s.FD)("div",{className:"container-Z8NWXZ",children:[(0,s.FD)(f.Ye,{alignItems:"start",className:"header-ih4JRy",justifyContent:"space-between",children:[V?(0,s.Y)(u.T,(0,n._)((0,o._)({},U),{className:"".concat(w," ").concat(A?"":y),preset:"d4-serif"})):(0,s.Y)(u.T,{className:"topicTitle-qCRICs",preset:"d4-serif-bold",children:R||"No description available."}),(0,s.Y)(c.v,{style:{padding:"0 4px"},variant:"tertiary",onClick:()=>F(!A),children:(0,s.Y)(r.A,{className:"chevron-EHp9xB",stroke:"red",style:{transform:A?"rotate(180deg)":"rotate(0deg)"}})})]}),!V&&(0,s.Y)(u.T,(0,n._)((0,o._)({},U),{className:"".concat(w," ").concat(A?"":y),preset:"d4-serif"})),(0,s.Y)(c.v,{size:"sm",variant:"tertiary",onClick:async()=>{await j(),await M()},children:(0,s.FD)(f.Ye,{alignItems:"center",gap:8,children:[W?"FOLLOWED":"FOLLOW ".concat(V?"COLUMN":"TOPIC")," ",(0,s.Y)(a.A,{className:"bellIcon-Q6Vwqc"})]})})]})}},46360:function(e,t,i){i.d(t,{L:()=>h});var o=i(4006),n=i(32485),s=i.n(n),r=i(99927),a=i(86673),l=i(47791),d=i(85478),c=i(76977),u=i(82776),p=i(74213);let h=e=>{var t;let{post:i,pub:n,user:h,autoPlayVoiceOver:m,variant:b}=e,{getConfigFor:_}=(0,d.mJ)(),f=i.has_voiceover||!!i.voiceoverUpload,g="newsletter-post"===b&&(0,u.showCommentsOnPost)({publication:n,post:i}),v="newsletter-post"===b&&n.community_enabled,w="newsletter-post"===b,y=!!(null==h?void 0:h.is_contributor),S="newsletter-post"===b&&!!_("show_open_post_as_pdf_button");return g||v||w||y?(0,o.FD)(c.pT,{className:s()(p.A.postUFI,{[p.A.hasVoiceover||""]:f}),gap:24,justifyContent:"end",children:[f&&(0,o.Y)(l.A,{autoPlay:m,duration:null==(t=i.voiceoverUpload)?void 0:t.duration,href:i.canonical_url,isPaywalled:!(null==h?void 0:h.is_subscribed),mediaUploadId:i.voiceover_upload_id,post:i,pub:n,user:h}),(0,o.FD)(c.Ye,{alignItems:"center",gap:16,children:[g&&(0,o.Y)(a.qS,{post:i,pub:n,size:"large"}),v&&(0,o.Y)(a.ct,{post:i,pub:n,size:"large",user:h}),w&&(0,o.Y)(a.wu,{post:i,pub:n,user:h}),S&&(0,o.Y)(r.V,{post:i,pub:n,user:h}),y&&(0,o.Y)(a.xn,{className:p.A.editButtonContainer,context:"post-page",post:i,pub:n,user:h})]})]}):null}},32600:function(e,t,i){i.d(t,{C:()=>d});var o=i(17402),n=i(25006),s=i(46271),r=i(12501),a=i(39318),l=i(57324);let d=e=>{var t;let[i,d]=(0,o.useState)(!1),[c,u]=(0,o.useState)(!1),[p,h]=(0,o.useState)(!0),[m,b]=(0,o.useState)(!1),_=(0,n.df)(),f=(0,s.Jd)(),g=null!=(t=null==_?void 0:_.authorPagesInfo)?t:[],v=null==g?void 0:g.find(t=>t.user_id===e),w=(null==v?void 0:v.primary_section_id)===0||null==v?void 0:v.primary_section_id,y=!!(null==f?void 0:f.subscription_id)||!!(null==f?void 0:f.is_free_subscribed),{result:S,refetch:Y}=(0,r.st)({pathname:"/api/v1/subscription",auto:!1}),{refetch:k}=(0,r.st)({pathname:"/api/v1/subscription/sections/email",auto:!1,method:"PATCH",cacheTtl:6e4});(0,o.useEffect)(()=>{(async()=>{h(!0);try{b(!!w);let t=await Y(),i=new URLSearchParams(window.location.search),o="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(o&&w&&y&&!(t instanceof Error)){var e;(null==t||null==(e=t.email_settings)?void 0:e[w])!=="individual"&&(await k({json:{[w]:{setting:"individual"}}}),d(!0))}}finally{h(!1)}})()},[e,_]),(0,o.useEffect)(()=>{u(y)},[y]),(0,o.useEffect)(()=>{(null==S?void 0:S.email_settings)&&w&&(d("individual"===S.email_settings[w]),u(y))},[S,w,y]);let C=async()=>{if(!w)return;if(!y&&_){var e;let t=null==(e=_.sections.find(e=>e.id===w))?void 0:e.slug,i=(0,a.eV6)(_,{addBase:!0,sectionSlug:t,next:(0,a.yRP)(window.location.href,{follow:!0}),utm_source:l.VU.followAuthorCta,utm_medium:l.Jn.web});window.location.href=i;return}let t=!i;await k({json:{[w]:{setting:t?"individual":"disabled"}}}),d(t)};return{isSubscribedToAuthor:i,isSubscribedToPub:c,isLoading:p,hasSection:m,toggleSubscription:C,sectionId:w,currentUserSubscriptions:S}}},53293:function(e,t,i){i.d(t,{T:()=>a,l:()=>l});var o=i(4006),n=i(17402),s=i(4016);let r=(0,n.createContext)({theme:null,setTheme:()=>void 0}),a=()=>(0,n.useContext)(r),l=e=>{var t;let{pub:i,post:a,children:l}=e,[d,c]=(0,n.useState)(null!=(t=null==a?void 0:a.postTheme)?t:null);return(0,s.lu)({pub:i})?(0,o.Y)(r.Provider,{value:{theme:d,setTheme:c},children:l}):(0,o.Y)(o.FK,{children:l})}},39598:function(e,t,i){i.d(t,{B:()=>h});var o=i(79785),n=i(4006),s=i(48309),r=i(84605),a=i(86500),l=i(35369),d=i(28911),c=i(57820);function u(){let e=(0,o._)(["Generating ","..."]);return u=function(){return e},e}function p(){let e=(0,o._)(["Shareable ",""]);return p=function(){return e},e}function h(e){let{isOpen:t,onClose:i,isGenerating:o,finishedGram:h,noun:m,postId:b,onDownload:_}=e,{iString:f,iTemplate:g}=(0,r.GO)();return(0,n.FD)(d.aF,{isOpen:t,onClose:i,children:[(0,n.Y)(d.rQ,{title:g(o?u():p(),m),showDivider:!0,onClose:i}),(0,n.Y)(d.cw,{children:h?(0,n.Y)("video",{src:h.cdn_url,style:{borderRadius:12},controls:!0,download:!0,width:400}):(0,n.Y)(c.y$,{alignItems:"center",justifyContent:"center",minHeight:220})}),h&&(0,n.Y)(d.jl,{direction:"column",primaryButton:(0,n.Y)(l.$n,{priority:"primary",leading:(0,n.Y)(s.A,{size:20}),onClick:()=>{(0,a.u4)(a.qY.AUDIOGRAM_DOWNLOAD_CLICKED,{post_id:b,audiogram_id:null==h?void 0:h.id,media_upload_id:null==h?void 0:h.media_upload_id}),_(h.cdn_url)},children:f("Download")})})]})}},17306:function(e,t,i){i.d(t,{$:()=>n});var o=i(17402);let n=e=>{let[t,n]=(0,o.useState)();return(0,o.useEffect)(()=>{"string"==typeof e&&i.e("68868").then(i.bind(i,36815)).then(t=>{let{micromark:i}=t;n(i(e))})},[e]),{markdownProps:"string"==typeof e?{dangerouslySetInnerHTML:{__html:null!=t?t:e.replace(/\*\*(.*?)\*\*/g,"$1").replace(/__(.*?)__/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/_(.*?)_/g,"$1")},style:{opacity:+!!t}}:{children:e}}}},57568:function(e,t,i){i.d(t,{f:()=>n});var o=i(17988);let n=()=>({isPrint:(0,o.useMediaQuery)({query:"print"})})}}]);