!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 n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="acec1ecb-cba7-40cd-9248-c5287c608b50",e._sentryDebugIdIdentifier="sentry-dbid-acec1ecb-cba7-40cd-9248-c5287c608b50")}catch(e){}}();"use strict";(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["8222"],{35407:function(e,n,t){t.d(n,{A:()=>i});let i={root:"root-MjHNqP",isOnInbox:"isOnInbox-pP0vQF",inboxColumn:"inboxColumn-SxsPqY",paywallStack:"paywallStack-RdkSad",pubChatColumn:"pubChatColumn-Zck7MX",pubChatFull:"pubChatFull-tEPJ4X",chatPublicationContainer:"chatPublicationContainer-y1FRFU",invitesRow:"invitesRow-QZEeej",show:"show-vL_rsU",unfurl:"unfurl-n5q4dW",sticky:"sticky-ykmBOy",unreadDot:"unreadDot-fNgNDl",unreadTabDot:"unreadTabDot-aqz7wG",selected:"selected-oDAfJA",currentVisibilityBox:"currentVisibilityBox-VAGH9Q",headerPubLink:"headerPubLink-uygNA1",sidebarRowTitle:"sidebarRowTitle-wepYF4",headerPubAvatar:"headerPubAvatar-jFmd9c",inputBox:"inputBox-UuLYvf",textInputInset:"textInputInset-jnSii9",invisible:"invisible-AW4ANv",textInput:"textInput-zlmYim",dropzone:"dropzone-W750JH",newThreadButton:"newThreadButton-POT_Ph",roundedFooterPlaceholder:"roundedFooterPlaceholder-k7TSWJ",chatContainer:"chatContainer-fnFgIy",fade:"fade-HKCqnN",composerLinkPreview:"composerLinkPreview-cBU00h",imageBox:"imageBox-NAFgde",image:"image-PfNhry",deleteFile:"deleteFile-gv_fWj",messageSquareIcon:"messageSquareIcon-_NUoeX",paywall:"paywall-hfm67h",modalChatEditor:"modalChatEditor-bbcasD",newText:"newText-IkD33N",newBorder:"newBorder-fycRk_",jumpButton:"jumpButton-yc047J",jumpBadge:"jumpBadge-IO2hJP"}},47963:function(e,n,t){t.d(n,{El:()=>O,gF:()=>A,hj:()=>F});var i=t(69277),o=t(70408),r=t(79785),l=t(4006),a=t(17402),d=t(80682),c=t(33764),s=t(84605),u=t(46271),p=t(86500),h=t(94729),m=t(31392),g=t(12501),y=t(22057),f=t(35369),Y=t(16074),_=t(76977),v=t(20500),C=t(91609),b=t(28911),S=t(63136),E=t(11510),I=t(39318),w=t(82776),k=t(34372);function T(){let e=(0,r._)(["Accept ","'s gift in the Substack app"]);return T=function(){return e},e}function D(){let e=(0,r._)(["We sent a link to download the Substack app to ","."]);return D=function(){return e},e}function O(){let{utm_campaign:e,utm_source:n,utm_content:t,abTestingId:i,overrideCTA:o,overrideTitle:r,subTitle:d,openUrl:c,giftCard:s,pub:u,facepileUsers:h}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[m,g]=(0,a.useState)(!1),y=(0,a.useCallback)(()=>{g(!0),(0,p.u4)(p.qY.APP_INSTALL_MODAL_OPENED,{utm_campaign:e,utm_source:n,utm_content:t})},[e,n,t]),f=(0,a.useCallback)(()=>{g(!1)},[]);return{open:y,modal:(0,l.Y)(x,{isOpen:m,onClose:f,utm_campaign:e,utm_source:n,utm_content:t,abTestingId:i,overrideCTA:o,overrideTitle:r,subTitle:d,openUrl:c,width:s?450:void 0,giftCard:s,pub:u,facepileUsers:h})}}function A(e){let{utm_campaign:n,utm_source:t,utm_content:i,hideEmailPrompt:o=!1,abTestingId:r,suggestedEmail:a,size:d,padding:c=32,openUrl:s,onSend:u}=e,p=(0,E.Iu)(),h=(0,m.D2)();return p?(0,l.Y)(_.VP,{padding:c,children:(0,l.Y)(P,{utm_campaign:n,utm_source:t,darkMode:h.darkMode})}):(0,l.FD)(_.VP,{gap:20,padding:c,children:[(0,l.Y)(_.ov,{children:(0,l.Y)(_.pT,{className:k.A.qrCode,padding:8,overflow:"hidden",radius:"lg",bg:"white",outline:"detail",shadow:"lg",animate:!0,cursor:"pointer",children:(0,l.Y)(F,{size:d,utm_campaign:n,utm_source:t,utm_content:i,abTestingId:r,openUrl:s})})}),!o&&(0,l.Y)(Y.v,{}),!o&&(0,l.Y)(B,{suggestedEmail:a,onSend:u})]})}function P(e){let{utm_campaign:n,utm_source:t,darkMode:i=!1}=e;return(0,l.FD)(_.pT,{gap:16,justifyContent:"center",children:[(0,l.Y)("a",{className:k.A.appBadge,href:(0,I.cxW)({utm_campaign:n,utm_source:t}),onClick:()=>{(0,p.u4)(p.qY.APP_STORE_LINK_CLICKED,{source:"app_install_upsell",app_store:"ios",utm_campaign:n,utm_source:t})},children:(0,l.Y)("img",{src:(0,I.dJ9)(i?"/img/app_page/app-store-white.png":"/img/app_page/app-store.png",320),height:48})}),(0,l.Y)("a",{className:k.A.appBadge,href:(0,I.zw3)({utm_campaign:n,utm_source:t}),onClick:()=>{(0,p.u4)(p.qY.APP_STORE_LINK_CLICKED,{source:"app_install_upsell",app_store:"android",utm_campaign:n,utm_source:t})},children:(0,l.Y)("img",{src:(0,I.dJ9)(i?"/img/app_page/google-play-white.png":"/img/app_page/google-play.png",320),height:48})})]})}function x(e){var n;let{isOpen:t,onClose:r,utm_campaign:c,utm_content:u,utm_source:p,abTestingId:h,overrideTitle:m,subTitle:g,openUrl:f,width:Y,facepileUsers:v,showMobileClose:C,giftCard:S,pub:k}=e,{iString:D,iTemplate:O}=(0,s.GO)(),P=(0,E.Iu)(),[x,F]=(0,a.useState)(""),B=(0,a.useCallback)(e=>{F(e)},[]),N=(0,a.useCallback)(()=>{F(""),r()},[r]),L=!!S&&!!k,U=(null==S||null==(n=S.gifter)?void 0:n.name)?"Split Zone Duo"===S.gifter.name?"SZD":(0,w.guessFirstName)(S.gifter.name):"",G=m||(L?U?O(T(),U):D("Accept this gift in the Substack app"):D("Download the Substack app"));return(0,l.FD)(b.aF,{isOpen:t,onClose:r,width:Y||360,children:[(0,l.Y)(b.rQ,{title:G,description:g,onClose:!P||C?r:void 0,showDivider:!0}),x?(0,l.Y)(R,{sentEmail:x,closeModal:N}):(0,l.FD)(_.I1,{alignItems:"stretch",paddingTop:32*!!P,children:[L?(0,l.Y)(_.pT,{justifyContent:"center",alignItems:"center",paddingTop:{desktop:20,mobile:0},children:(0,l.Y)(d.N,(0,o._)((0,i._)({},S),{pub:k}))}):(null==v?void 0:v.length)?(0,l.Y)(_.pT,{justifyContent:"center",alignItems:"center",padding:{mobile:8},children:(0,l.Y)(y.Z,{users:v,max:3,size:48})}):P?(0,l.Y)(_.pT,{justifyContent:"center",alignItems:"center",children:(0,l.Y)("img",{src:(0,I.dJ9)("/img/substack-app-icon.png"),height:64,width:64})}):null,(0,l.Y)(A,{utm_campaign:c,utm_source:p,utm_content:u,abTestingId:h,openUrl:f,size:142,onSend:B})]})]})}function F(e){let{utm_campaign:n,utm_source:i,utm_content:o,abTestingId:r,size:d=240,width:c,height:s,openUrl:u}=e,p=(0,a.useRef)(null),h=(0,I.wHz)({utm_campaign:n,utm_source:i,utm_content:o,abti:r}),m=function(e,n){let{result:i}=(0,g.qK)(()=>t.e("34592").then(t.t.bind(t,97283,23)),[],{auto:!0}),o=null==i?void 0:i.default;return(0,a.useMemo)(()=>o&&"undefined"!=typeof window?new o(e(window)):null,[o,...n])}(e=>{let n=e.devicePixelRatio,t=getComputedStyle(document.body),i="rgb(".concat(t.getPropertyValue("--color-primitive-black-rgb"),")");return{width:(null!=c?c:d)*n,height:(null!=s?s:d)*n,type:"canvas",data:u||h,dotsOptions:{color:i,type:"dots"},backgroundOptions:{color:"rgb(".concat(t.getPropertyValue("--color-primitive-white-rgb"),")")},cornersSquareOptions:{color:i,type:"extra-rounded"},cornersDotOptions:{color:i,type:"dot"},qrOptions:{errorCorrectionLevel:"L"}}},[c,s,u]);return(0,a.useEffect)(()=>{let{current:e}=p;if(!e||!m||!m._canvas)return;let n=m._canvas;return n.style.width="".concat(null!=c?c:d,"px"),n.style.height="".concat(null!=s?s:d,"px"),e.style.width="".concat(null!=c?c:d,"px"),e.style.height="".concat(null!=s?s:d,"px"),e.appendChild(n),()=>{e.removeChild(n)}},[m,c,s]),(0,l.Y)("div",{ref:p})}function B(e){let{suggestedEmail:n,onSend:t}=e,{iString:i}=(0,s.GO)(),o=(0,u.Jd)(),[r,d]=(0,a.useState)((null==o?void 0:o.email)||n||""),[c,p]=(0,a.useState)(!1),[m,g]=(0,a.useState)(null);return(0,l.Y)(l.FK,{children:(0,l.FD)(_.I1,{gap:8,children:[(0,l.Y)(C.x,{type:"email",placeholder:i("Your email"),placement:"end",priority:"primary",value:r,onChange:e=>d(e.currentTarget.value),button:(0,l.Y)(f.$n,{loading:c,onClick:async()=>{p(!0);try{await (0,h.x6)("/api/v1/send_app_download_link",{method:"POST",json:{email:r}}),g(null),p(!1),t&&t(r)}catch(e){g("Something went wrong")}},children:i("Send link")})}),m&&(0,l.Y)(v.yn,{align:"center",children:m})]})})}let R=e=>{let{sentEmail:n,closeModal:t}=e,{iString:i,iTemplate:o}=(0,s.GO)();return(0,l.FD)(l.FK,{children:[(0,l.Y)(b.cw,{children:(0,l.FD)(_.I1,{gap:20,justifyContent:"center",alignItems:"center",children:[(0,l.Y)(c.o,{src:"/img/cohorts/local_news/plane.png",maxWidth:64}),(0,l.FD)(_.I1,{gap:4,justifyContent:"center",alignItems:"center",children:[(0,l.Y)(S.EY.B2,{weight:"semibold",textAlign:"center",children:i("Check your email")}),(0,l.Y)(S.EY.B3,{color:"secondary",align:"center",children:o(D(),n||"your email")})]})]})}),(0,l.Y)(b.jl,{alignButtons:"stretch",primaryButton:(0,l.Y)(f.$n,{priority:"secondary",onClick:t,children:i("Done")})})]})}},12895:function(e,n,t){t(4006),t(33727),t(76977),t(63136)},72945:function(e,n,t){t.d(n,{J:()=>ei,s:()=>en});var i=t(69277),o=t(70408),r=t(32641),l=t(4006),a=t(32708),d=t(82853),c=t(42691),s=t(49436),u=t(48309),p=t(84934),h=t(70010),m=t(93540),g=t(80964),y=t(54718),f=t(47796),Y=t(57157),_=t(17402),v=t(41935),C=t(94090),b=t(82936),S=t(58050),E=t(84605),I=t(40691),w=t(85478),k=t(46271),T=t(27749),D=t(75051),O=t(75840),A=t(86500),P=t(94729),x=t(12501),F=t(68349),B=t(35369),R=t(76977),N=t(45859),L=t(19832),U=t(51177),G=t(36372),M=t(52145),j=t(504),W=t(5180),K=t(83629),q=t(46453),z=t(2481),V=t(16291),J=t(56262),H=t(70189),X=t(49807),Q=t(82776),Z=t(57324),$=t(44307);let ee=e=>{let{item:n,parentItem:t}=e;if(!n.comment&&!n.post)return null;let i=null;if("post"in n&&("post"===n.type||(null==t?void 0:t.type)==="post_reply"))i=n.post.id;else if((null==t?void 0:t.type)==="note_reply"){var o;let e=null==(o=n.parentComments[0])?void 0:o.id;e&&(i=e)}else i=n.comment.id;return i?{id:i,type:"post"in n&&("post"===n.type||(null==t?void 0:t.type)==="post_reply")?"post":"comment"}:null};function en(e){var n,t,i,o,r,f,Y;let{publication:v,post:q,comment:en,item:ei,parentItem:eo,allowHide:er=!1,size:el="sm"}=e,ea=(0,G.d)(),{getConfigFor:ed}=(0,w.mJ)(),ec=(0,T.PK)(),es=(0,O.T)(),eu=(0,W.wA)(),ep=(0,W.Ro)(),{iString:eh}=(0,E.GO)(),[em,eg]=(0,_.useState)(!1),[ey,ef]=(0,_.useState)(!1),eY=(0,k.Jd)(),{openModal:e_}=(0,I.hS)(),ev=null!=(f=null==en||null==(n=en.ancestor_path)?void 0:n.split(".").filter(Boolean).map(Number).map(e=>ep.comments.get(e)))?f:[],eC=en?(0,J.getCommentAuthor)(en):v&&q?(0,J.getPostAuthor)(v,q):{id:0,name:"void"},eb=ei&&"entity_key"in ei?ei.entity_key:void 0,eS=(0,b.bd)(eC,{surface:ec,noteId:eb,onClick(e){ei&&(0,j.Qb)(ei,ec,e,{tabId:es})}}),eE=(0,C.a2)({comment:en,publication:v,post:q,item:ei}),eI=(0,S.A)(eC,ec,eb),ew=(0,x.st)({pathname:"/api/v1/comment/".concat(null!=(Y=null==en?void 0:en.id)?Y:0),method:"DELETE",json:{publication_id:null==v?void 0:v.id}}),ek=async()=>{if(!en||(eg(!1),ew.isLoading))return;let e=await ew.refetch();e instanceof Error?alert((0,F.uX)(e)):(ea.popToast(()=>(0,l.Y)(G.y,{text:eh("Note deleted"),Icon:a.A})),eu({type:"comment_delete",payload:{publication:null!=v?v:void 0,post:null!=q?q:void 0,comment:en}}))},eT=(0,z.NP)(),eD=async()=>{en&&eT.open({editComment:en,tabId:es,surface:ec,editingUserId:null==eY?void 0:eY.id})},eO=ei&&"post"===ei.type&&ei.mediaClip?ei.mediaClip:void 0,eA=async(e,n)=>{await (0,P.x6)("/api/v1/comment/".concat(e.id,"/juice"),{method:"POST",json:{times_to_show:n}}),ea.popToast(()=>(0,l.Y)(G.y,{text:eh("Juiced"),Icon:c.A})),ef(!1)},eP=async(e,n)=>{let t,i=ee({item:e,parentItem:eo});if(!i)return;switch(n){case"1hour":t=1;break;case"8hours":t=8;break;case"24hours":t=24}let o=t?{expires_at:(0,V.A)().add(t,"hour").toISOString()}:{},{id:r,type:a}=i;await (0,P.x6)("/api/v1/notification_settings/".concat(a,"/").concat(r,"/mute"),{method:"POST",json:o}),eu({type:"item_pause_notifications",payload:{entityKey:e.entity_key}}),ea.popToast(()=>(0,l.Y)(G.y,{text:eh("Paused"),Icon:s.A}))},ex=async e=>{let n=ee({item:e,parentItem:eo});if(!n)return;let{id:t,type:i}=n;await (0,P.x6)("/api/v1/notification_settings/".concat(i,"/").concat(t,"/mute"),{method:"DELETE"}),eu({type:"item_unpause_notifications",payload:{entityKey:e.entity_key}}),ea.popToast(()=>(0,l.Y)(G.y,{text:eh("Unpaused"),Icon:s.A}))},eF=async()=>{try{if(!en)return void ea.popToast(()=>(0,l.Y)(G.y,{text:eh("Error starting workflow: comment not found")}));let{workflowId:e}=await (0,P.x6)("/api/v1/comment/".concat(en.id,"/workflow"),{method:"POST",json:{}});ea.popToast(()=>(0,l.Y)(G.y,{text:"Workflow started with id ".concat(e)}))}catch(e){ea.popToast(()=>(0,l.Y)(G.y,{text:"Error starting workflow: ".concat(e)}))}},eB=(0,x.st)({pathname:"/api/v1/video/assets/clips/".concat(null==eO?void 0:eO.id),method:"DELETE"}),eR=async()=>{if(!eO||eB.isLoading)return;let e=await eB.refetch();e instanceof Error?alert((0,F.uX)(e)):(ea.popToast(()=>(0,l.Y)(G.y,{text:eh("Clip deleted"),Icon:a.A})),eu({type:"clip_delete",payload:{mediaClip:eO,author:eC}}))},eN=er&&ei&&"entity_key"in ei&&eY&&eY.id!==eC.id,eL=eY&&eY.id===eC.id,eU=eY&&!!(null==ei||null==(t=ei.post)?void 0:t.publishedBylines.find(e=>e.id===eY.id)),eG=eY&&(null==eo?void 0:eo.type)==="note_reply"&&(null==ei||null==(i=ei.parentComments[0])?void 0:i.user_id)===eY.id,eM=(eL||eU||eG)&&(null==ei?void 0:ei.type)&&["comment","post"].includes(ei.type),ej=[(0,l.Y)(N.Dr,{leading:(0,l.Y)(d.A,{}),onClick:()=>{let e={r:(0,Q.userReferralKey)(eY),utm_source:Z.VU.notesShareAction,utm_medium:Z.Jn.web},n=en?(0,X.Zgx)(en,{urlParams:e}):q?(0,X.q$n)(v,q,{mediaClip:eO,urlParams:e}):null;(0,F.lW)(n),ea.popToast(()=>(0,l.Y)(G.y,{text:eh("Copied link to clipboard"),Icon:d.A})),(0,A.u4)(A.qY.FEED_ITEM_SHARE_LINK_CLICKED,{type:"copy",shared_post_id:null==q?void 0:q.id,shared_comment_id:null==en?void 0:en.id})},children:eh("Copy link")}),!en&&q&&(0,l.Y)(et,{post:q}),...eI,en?(0,l.Y)(N.Dr,{leading:(0,l.Y)(u.A,{}),onClick:()=>{e_({children:(0,l.Y)(D.Y,{comment:en}),width:540})},children:eh("Save as image")}):null].filter(Boolean),eW=[(0,Q.canEditComment)(eY,en)&&(0,l.Y)(N.Dr,{leading:(0,l.Y)(p.A,{}),onClick:eD,children:eh("Edit")}),en&&((null==eY?void 0:eY.is_global_admin)||(null==eY?void 0:eY.id)===en.user_id||ed("show_note_stats_for_all_notes")||(0,Q.canManageCommentAsPrimaryUser)(eY,en))?(0,l.Y)(N.Dr,{leading:(0,l.Y)(h.A,{}),href:(0,H.Kg)(en,{noBase:K.Z}),"data-native":!0,children:eh("View stats")}):null].filter(Boolean),eK=(null==ei?void 0:ei.type)&&["comment","post"].includes(ei.type)&&ep.mutedFeedItems.has(ei.entity_key),eq=[eN&&(0,l.Y)(N.Dr,{leading:(0,l.Y)(m.A,{}),onClick:async()=>{try{eu({type:"item_hide",payload:{entityKey:ei.entity_key}}),await (0,P.x6)("/api/v1/note/".concat(ei.entity_key,"/hide"),{method:"POST",json:{tabId:es,surface:ec}})}catch(e){ea.popToast(()=>(0,l.Y)(G.y,{text:(0,F.uX)(e)}))}},children:(eY.is_admin||eY.is_contributor)&&"post-page-restacks-list"===ec?eh("Hide note from post"):eh("Hide note")}),eM&&(eK?(0,l.Y)(M.MI,{onClick:()=>ex(ei),customLabel:eh("Unpause notifications")}):(0,l.Y)(M.DE,{onMute:e=>eP(ei,e),customLabel:eh("Pause notifications")})),(null==eY?void 0:eY.is_global_admin)&&en&&(null==(r=en.attachments)||null==(o=r[0])?void 0:o.type)==="video"?(0,l.Y)(N.Dr,{leading:(0,l.Y)(g.A,{}),priority:"secondary",onClick:eF,children:eh("Run workflow")}):null].filter(Boolean),ez=[...eS,eE,(0,Q.canDeleteComment)(eY,en,{pub:null!=v?v:void 0,parentComments:ev})&&(0,l.Y)(N.Dr,{leading:(0,l.Y)(a.A,{}),priority:"destructive",onClick:()=>eg(!0),children:eh("Delete")}),eO&&eL&&(0,l.Y)(N.Dr,{leading:(0,l.Y)(a.A,{}),priority:"destructive",onClick:eR,children:eh("Delete this clip")}),(null==eY?void 0:eY.is_global_admin)&&en?(0,l.Y)(N.Dr,{leading:(0,l.Y)(c.A,{}),priority:"destructive",onClick:async()=>{ef(!0)},children:eh("Juice")}):null].filter(Boolean),eV=[0!==ej.length&&ej,0!==eW.length&&(0,l.Y)(N.H9,{children:eW}),0!==eq.length&&(0,l.Y)(N.H9,{children:eq}),0!==ez.length&&(0,l.Y)(N.H9,{children:ez})];return 0===eV.length?null:(0,l.FD)(l.FK,{children:[(0,l.Y)(R.ov,{className:$.A.moreButtonContainer,children:(0,l.Y)(N.W1,{trigger:(0,l.Y)(B.K0,{priority:"quaternary",size:el,className:$.A.moreButton,"aria-label":eh("More options"),children:(0,l.Y)(y.A,{size:16})}),onOpen:()=>{ei&&(0,j.Qb)(ei,ec,"menu",{tabId:es})},children:eV})}),(0,l.Y)(L.m,{isOpen:em,title:eh("Delete note"),description:eh("Are you sure you want to permanently delete this note? This action cannot be undone."),primaryButton:(0,l.Y)(B.$n,{priority:"destructive",onClick:ek,children:eh("Delete")}),secondaryButton:(0,l.Y)(B.$n,{priority:"secondary",onClick:()=>eg(!1),children:eh("Cancel")}),onClose:()=>eg(!1)}),(null==eY?void 0:eY.is_global_admin)&&(0,l.Y)(L.m,{isOpen:ey,title:eh("Juice note"),description:eh("How many additional impressions would you like this note to receive? 100 impressions equals roughly 1-3 likes."),primaryButton:(0,l.FD)(U.t7,{priority:"secondary-outline",size:"md",children:[(0,l.Y)(U.gm,{onClick:async()=>{await eA(en,100)},children:"100"}),(0,l.Y)(U.gm,{onClick:async()=>{await eA(en,500)},children:"500"}),(0,l.Y)(U.gm,{onClick:async()=>{await eA(en,1e3)},children:"1000"})]}),secondaryButton:(0,l.Y)(R.pT,{flex:"grow",children:(0,l.Y)(B.$n,{priority:"secondary",onClick:()=>ef(!1),children:eh("Cancel")})}),onClose:()=>ef(!1)})]})}function et(e){var{post:n}=e,t=(0,r._)(e,["post"]);let a=(0,k.Jd)(),{requireLogin:d}=(0,q.eE)(),c=ei(n),{iContext:s}=(0,E.GO)();return(0,l.Y)(N.Dr,(0,o._)((0,i._)({leading:n.is_saved?(0,l.Y)(f.A,{}):(0,l.Y)(Y.A,{}),onClick:()=>a?c():null==d?void 0:d({redirectOverride:(0,X.wu9)(null,n,{urlParams:{triggerSave:!0}})})},t),{children:n.is_saved?s("Unbookmark a post previously saved for later reading","Unsave"):s("Bookmark a post to read later","Save")}))}function ei(e){let n=(0,W.wA)(),t=(0,v.ib)();return()=>{let i=e.id,o=!e.is_saved;(0,v.E0)(i,o,{surface:"reader"}),t(o),n({type:"post_save",payload:{postId:i,isSaved:o}})}}},92905:function(e,n,t){t.d(n,{a:()=>r});var i=t(17402),o=t(86500);function r(e){let n=(0,i.useRef)(Date.now()),t=(0,i.useRef)(new Set),r=(0,i.useCallback)(i=>{if(!e)return;let r=i.currentTarget,l=r.name;!r.value||t.current.has(l)||Date.now()-n.current<1e3||(t.current.add(l),(0,o.u4)("".concat(e," Input Filled"),{name:l}))},[e]);return{trackInputFilled:r,trackSubmitPressed:(0,i.useCallback)(()=>{e&&(0,o.u4)("".concat(e," Submit Pressed"))},[e]),trackError:(0,i.useCallback)(n=>{if(!e)return;let t="Something went wrong";if(n instanceof Error){var i,r;t=(null==(i=n.body)?void 0:i.errors)?JSON.stringify(n.body.errors):(null==(r=n.body)?void 0:r.error)?n.body.error:n.message}(0,o.u4)("".concat(e," Error"),{error:t})},[e])}}},19832:function(e,n,t){t.d(n,{m:()=>r});var i=t(4006),o=t(28911);let r=e=>{let{isOpen:n=!1,title:t,description:r,icon:l,onClose:a,primaryButton:d,secondaryButton:c}=e;return(0,i.FD)(o.aF,{isOpen:n,onClose:a,children:[t&&(0,i.Y)(o.rQ,{title:t,description:r,icon:l}),(0,i.Y)(o.q1,{}),(0,i.Y)(o.jl,{primaryButton:d,secondaryButton:c})]})}},66511:function(e,n,t){t.d(n,{k6:()=>s,fN:()=>c,m_:()=>p,Sr:()=>u});var i=t(4006),o=t(38146),r=t(17402),l=t(49978),a=t(3011),d=t(53168);let c=500,s=8,u=320;function p(e){let{children:n,text:t,title:p,imageUrl:h,leading:m,trailing:g,side:y,disabled:f,delayEnter:Y=c}=e,[_,v]=(0,r.useState)(!1),C=(0,a.a)()?r.Fragment:a.B;return f?(0,i.Y)(i.FK,{children:n}):(0,i.Y)(C,{children:(0,i.FD)(o.bL,{delayDuration:Y,open:_,onOpenChange:v,children:[(0,i.Y)(o.l9,{asChild:!0,children:(0,i.Y)("span",{children:n})}),(0,i.Y)(o.ZL,{children:(0,i.Y)(o.UC,{side:y,sideOffset:s,collisionPadding:s,className:"content-t9D9VH",style:{maxWidth:u,zIndex:d.QW,"--offset":"".concat(s,"px")},children:(0,i.Y)(l.c,{text:t,title:p,imageUrl:h,leading:m,trailing:g})})})]})})}},49978:function(e,n,t){t.d(n,{c:()=>m});var i=t(4006),o=t(17402),r=t(23623),l=t(78649),a=t(33764),d=t(89490),c=t(76977),s=t(63136),u=t(66511),p=t(53168);let h={title:"title-V6r8cy",imageContainer:"imageContainer-UzIosZ",endcapContainer:"endcapContainer-E0pGpX"};function m(e){let{leading:n,trailing:t,text:d,title:c,imageUrl:u,children:p}=e,m=d&&!c&&!u;return(0,i.Y)(r.a,{children:(0,i.Y)(l.Q,{children:(0,i.Y)(_,{children:(0,i.FD)(g,{textOnly:!!m,children:[u&&(0,i.Y)(Y,{children:(0,i.Y)(a.o,{src:u,maxWidth:296,useRetinaSizing:!0,imageIsFixedWidth:!0})}),(0,i.FD)(f,{hasTitle:!!c,children:[n&&(0,i.Y)(y,{children:n}),(0,i.FD)(v,{children:[c&&(0,i.Y)(s.EY.B4,{weight:"medium",color:"primary",className:h.title,children:c}),(0,i.Y)(s.EY.B4,{color:"primary",opacity:80,lineHeight:16,children:"string"==typeof d?d.split("\n").map((e,n)=>(0,i.FD)(o.Fragment,{children:[n>0&&(0,i.Y)("br",{}),e]},n)):d}),p]}),t&&(0,i.Y)(y,{children:t})]})]})})})})}function g(e){let{textOnly:n,children:t}=e;return(0,i.Y)(c.VP,{alignItems:"center",paddingY:n?6:12,paddingX:n?8:12,gap:8,children:t})}function y(e){let{children:n}=e;return(0,i.Y)(c.fI,{alignItems:"center",justifyContent:"center",className:h.endcapContainer,flex:"auto",gap:8,children:n})}function f(e){let{hasTitle:n,children:t}=e;return(0,i.Y)(c.fI,{alignItems:n?"start":"center",gap:8,children:t})}function Y(e){let{children:n}=e;return(0,i.Y)(c.VP,{border:"detail",radius:"sm",className:h.imageContainer,overflow:"hidden",children:n})}function _(e){let{children:n}=e;return(0,i.Y)(d.az,{className:h.content,style:{maxWidth:u.Sr,zIndex:p.QW,"--offset":"".concat(u.k6,"px")},radius:"sm",shadow:"md",border:"detail",bg:"primary",children:n})}let v=(0,d.I4)({display:"flex",direction:"column",gap:2})},3011:function(e,n,t){t.d(n,{B:()=>c,a:()=>d});var i=t(4006),o=t(38146),r=t(17402),l=t(66511);let a=(0,r.createContext)(!1);function d(){return(0,r.useContext)(a)}function c(e){let{children:n}=e;return(0,i.Y)(o.Kq,{delayDuration:l.fN,skipDelayDuration:300,children:(0,i.Y)(a.Provider,{value:!0,children:n})})}},89955:function(e,n,t){t.d(n,{O:()=>l});var i=t(4006),o=t(68349),r=t(20500);function l(e){let{error:n}=e,t=(0,o.zs)(n);return(null==t?void 0:t.html)?(0,i.Y)(r.yn,{dangerouslySetInnerHTML:{__html:t.html}}):(0,i.Y)(r.yn,{children:(null==t?void 0:t.msg)||"Something went wrong"})}},62088:function(e,n,t){t.d(n,{$P:()=>_,M9:()=>f,dt:()=>v});var i=t(69277),o=t(70408),r=t(4006),l=t(84605),a=t(76110),d=t(17028),c=t(28911),s=t(84843),u=t(50630),p=t(83842),h=t(23358),m=t(82804),g=t(60689),y=t(11510);function f(e){let{onCancel:n,onSuccess:t,onSignup:i,onUserCreated:o,noCloseButton:l,noExit:d,isOpen:s,redirectOverride:p,overrideTitle:h}=e,m=(0,y.Iu)();return(0,r.Y)(c.aF,{onClose:n,isOpen:s,children:(0,r.FD)(u.W,{children:[(0,r.Y)(Y,{onCancel:n,onSuccess:t,onSignup:i,onUserCreated:o,noCloseButton:l,noExit:d,redirectOverride:p,overrideTitle:h}),m&&(0,r.Y)(a.a7,{})]})})}function Y(e){let{onCancel:n,onSuccess:t,onSignup:l,onUserCreated:a,noCloseButton:d,noExit:c,redirectOverride:s,overrideTitle:y}=e,{mode:f}=(0,u.r)(),Y={overrideTitle:y,noCloseButton:d||c,onCancel:n,onSignup:l};return(0,r.FD)(r.FK,{children:["magic-link"===f&&(0,r.Y)(p.j,(0,o._)((0,i._)({},Y),{onSuccess:t})),"email"===f&&(0,r.Y)(h._,(0,o._)((0,i._)({},Y),{onUserCreated:a,redirectOverride:s})),"password"===f&&(0,r.Y)(g.d,(0,o._)((0,i._)({},Y),{onSuccess:t})),"mfa"===f&&(0,r.Y)(m.Q,{onSuccess:t})]})}let _=e=>{let{overrideTitle:n,noCloseButton:t,onCancel:i,onSignup:o}=e,{iString:a}=(0,l.GO)();return(0,r.Y)(s.rQ,{title:n||a("Sign in to Substack"),description:o?(0,r.FD)(r.FK,{children:[a("First time here? "),(0,r.Y)(d.Yq,{color:"substack",decoration:"hover-underline",onClick:o,cursor:"pointer",children:a("Create account")})]}):void 0,onClose:t?void 0:i,icon:(0,r.Y)(s.Ud,{}),alignItems:"center"})},v=e=>{let{children:n}=e;return(0,r.Y)(d.VP,{padding:16,borderTop:"detail",children:(0,r.Y)(d.EY.B4,{as:"span",color:"secondary",align:"center",children:n})})}},46647:function(e,n,t){t.d(n,{D:()=>u});var i=t(4006),o=t(84605),r=t(17028),l=t(16291);let a=new Intl.DateTimeFormat(void 0,{timeStyle:"short"}),d=new Intl.DateTimeFormat(void 0,{weekday:"long"}),c=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}),s=new Intl.DateTimeFormat(void 0,{dateStyle:"long"});function u(e){let{timestamp:n,conjunction:t=!1}=e,{iString:u,language:p}=(0,o.GO)(),h=new Date(n),m=(0,l.A)(),g=p.startsWith("en"),y=m.isSame(h,"day")?u("Today"):m.subtract(1,"day").isSame(h,"day")?u("Yesterday"):m.isSame(h,"week")?d.format(h):m.isSame(h,"year")?c.format(h):s.format(h);return(0,i.Y)(r.fI,{alignItems:"center",justifyContent:"center",children:(0,i.FD)(r.EY.B4,{color:"secondary",children:[y,t&&g?" at ":" ",a.format(h)]})})}},41842:function(e,n,t){t.d(n,{K:()=>c});var i=t(69277),o=t(32641),r=t(4006),l=t(28911),a=t(48239),d=t(97522);function c(e){var{isOpen:n,pub:t=null,profile:c=null,skipRedirectOnExit:s=!1}=e,u=(0,o._)(e,["isOpen","pub","profile","skipRedirectOnExit"]);let{stepConfig:p,contextValue:h,handleOpen:m,handleClose:g}=(0,d.F)((0,i._)({isPage:!1,isOpen:n,pub:t,profile:c,skipRedirectOnExit:s},u));return(0,r.Y)(l.aF,{fullscreenMobile:!0,isOpen:n,onOpen:m,onClose:g,width:500,disableCloseOnBackdropClick:!0,children:(0,r.Y)(a.Xf,{value:h,children:(0,r.Y)(r.FK,{children:p.render()})})})}},97307:function(e,n,t){t.d(n,{n:()=>s});var i=t(69277),o=t(17402),r=t(52820),l=t(46271),a=t(68349),d=t(78979),c=t(92636);function s(){let{user:e}=(0,l.ur)(),{getExperimentVariant:n,exposeExperiment:t}=(0,r.Wk)(),[s,u]=(0,o.useState)(!1),[p,h]=(0,o.useState)({}),m=!e&&(0,c.Sg)()&&"undefined"!=typeof window&&"/onboarding"!==window.location.pathname,g=n("reader_onboarding_modal_v2_vs_page"),y=(0,o.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m&&(t("reader_onboarding_modal_v2_vs_page"),"treatment"===g)?(0,a.V2)("/onboarding"):(h(e),u(!0))},[m,t,g]),f=(0,o.useCallback)((n,t)=>{h({pub:n,profile:t,initialStep:e?d.dn.CATEGORIES:d.dn.PUB_SIGNUP}),u(!0)},[e]),Y=(0,o.useCallback)(e=>{h({pub:e,profile:null,initialStep:d.dn.PUB_SIGNUP}),u(!0)},[]),_=(0,o.useCallback)(()=>{u(!1),h({})},[]);return{modalProps:(0,o.useMemo)(()=>(0,i._)({isOpen:s,onClose:_},p),[s,_,p]),open:y,openForPub:f,openToPubSignup:Y,close:_}}},38921:function(e,n,t){t.d(n,{A:()=>Y});var i=t(79785),o=t(4006),r=t(17402),l=t(84605),a=t(82772),d=t(35369),c=t(16074),s=t(76977),u=t(45974),p=t(63136),h=t(19718),m=t(39318),g=t(57324);function y(){let e=(0,i._)(["By ",""]);return y=function(){return e},e}function f(e){var n;let{pub:t,selected:i,setSelected:d,onRecommendationFirstVisible:c,index:f}=e,{iTemplate:Y}=(0,l.GO)(),_=(0,r.useRef)(null);(0,a.S8)(_,()=>{null==c||c(t,f)},{threshold:.5});let v="".concat((0,m.$_T)(t),"/?utm_source=").concat(g.VU.homepageReaderOnboarding),C=null!=(n=t.editorial_bio)?n:t.hero_text;return(0,o.FD)(h.V,{ref:_,selected:i,onChange:()=>d(!i),checkboxName:t.name,children:[(0,o.Y)(u.Nq,{pub:t,size:48}),(0,o.Y)(s.VP,{justifyContent:"start",alignItems:"start",gap:2,flex:"grow",minWidth:0,children:(0,o.FD)(s.VP,{flex:"grow",minWidth:0,children:[(0,o.Y)(p.Yq,{href:v,"data-native":!0,target:"_blank",decoration:"hover-underline",onClick:e=>e.stopPropagation(),children:(0,o.Y)(p.EY.B3,{weight:"medium",children:t.name})}),(0,o.Y)(p.EY.B4,{color:"secondary",children:Y(y(),t.author_name)}),C&&(0,o.Y)(p.EY.B4,{color:"secondary",textAlign:"left",children:C})]})})]})}function Y(e){let{publications:n,selected:t,setSelected:i,onRecommendationFirstVisible:a,onToggle:u}=e,{iString:p}=(0,l.GO)(),h=t.lengthi(h?n.map(e=>{let{id:n}=e;return n}):[]),children:p(h?"Select all":"Deselect all")})}),n.map((e,n)=>(0,o.FD)(r.Fragment,{children:[n>0&&(0,o.Y)(c.c,{}),(0,o.Y)(f,{pub:e,selected:t.includes(e.id),setSelected:n=>{n?i([...t.filter(n=>n!==e.id),e.id]):i(t.filter(n=>n!==e.id)),null==u||u(e.id,n)},index:n,onRecommendationFirstVisible:a},e.id)]},e.id))]})}},87833:function(e,n,t){t.d(n,{G:()=>S});var i=t(69277),o=t(70408),r=t(79785),l=t(4006),a=t(85500),d=t(48697),c=t(71464),s=t(17402),u=t(17515);t(12895);var p=t(84605),h=t(35369),m=t(33727),g=t(60322),y=t(97515),f=t(76977),Y=t(20500),_=t(23168),v=t(57820),C=t(63136);function b(){let e=(0,r._)(["","% Complete"]);return b=function(){return e},e}function S(e){var n;let{pub:t,onSuccess:i,onError:o}=e,{iString:r}=(0,p.GO)(),[{files:a,isDragging:d,errors:c},{openFileDialog:u,getInputProps:m,getDragProps:g,removeFile:y}]=(0,_.l)({accept:".csv,.xlsx,.ods,text/csv,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.oasis.opendocument.spreadsheet",maxSize:0x3200000}),[Y,v]=(0,s.useState)(!1),[C,b]=(0,s.useState)(!1),S=(0,s.useRef)(null),I=(null==(n=a[0])?void 0:n.file)instanceof File?a[0].file:null;return(0,l.FD)(f.VP,{gap:12,children:[(0,l.Y)(E,{files:a,isDragging:d,errors:c,openFileDialog:u,getInputProps:m,getDragProps:g,removeFile:y}),I&&(0,l.FD)(l.FK,{children:[(0,l.Y)(w,{checked:C,onChange:b}),(0,l.Y)(h.$n,{loading:Y,disabled:!C,onClick:()=>{if(I){if(!C)return void alert(r("Please confirm that everyone on this list has opted in to receiving emails."));v(!0),S.current&&S.current.uploadFile(I)}},children:r("Import list")})]}),(0,l.Y)(k,{pub:t,importerRef:S,onSuccess:()=>{v(!1),null==i||i()},setLoading:v,onError:o})]})}function E(e){var n,t,o;let{files:r,isDragging:s,errors:u,openFileDialog:m,getInputProps:g,getDragProps:v,removeFile:b}=e,{iString:S}=(0,p.GO)(),E=null==(n=r[0])?void 0:n.file.name,w=null!=(o=null==(t=r[0])?void 0:t.file.size)?o:0,k=!!E;return(0,l.FD)(l.FK,{children:[(0,l.Y)(I,{isDragging:s,isFilled:k,dragProps:v(),children:k?(0,l.FD)(f.fI,{alignItems:"center",gap:12,padding:12,children:[(0,l.Y)(a.A,{}),(0,l.FD)(f.VP,{flex:"grow",children:[(0,l.Y)(C.EY.B4,{weight:"medium",children:E}),(0,l.Y)(C.EY.B5,{color:"secondary",children:(0,_.z)(w)})]}),(0,l.Y)(h.K0,{onClick:()=>{var e;return b(null==(e=r[0])?void 0:e.id)},priority:"quaternary",children:(0,l.Y)(d.A,{size:20})})]}):(0,l.Y)(y.p,{icon:s?(0,l.Y)(c.A,{}):(0,l.Y)(a.A,{}),title:S("Drop your subscriber list here"),description:S("CSV, XLSX, or ODS • Max 50MB"),button:(0,l.Y)(h.$n,{onClick:m,priority:"primary-mono",children:S("Select file")})})}),(0,l.Y)("input",(0,i._)({},g())),u.length>0&&(0,l.Y)(Y.yn,{role:"alert",align:"center",children:u[0]})]})}function I(e){let{isDragging:n,isFilled:t,dragProps:r,children:a}=e;return(0,l.Y)(m.Z,(0,o._)((0,i._)({display:"flex",radius:"sm",overflow:"hidden",position:"relative",border:t?"unset":"detail",outline:t?"detail":"unset",borderStyle:t?"none":"dashed",bg:n?"secondary":"primary",elevated:!1,padding:32*!t},r),{children:a}))}function w(e){let{checked:n,onChange:t}=e,{iString:i}=(0,p.GO)();return(0,l.FD)(f.ov,{as:"label",gap:12,padding:8,children:[(0,l.Y)(g.S,{checked:n,onChange:t,size:"sm",autoFocus:!0}),(0,l.Y)(C.EY.B3,{weight:"medium",children:i("These people have opted in to receiving emails")})]})}function k(e){let{pub:n,importerRef:t,onSuccess:i,setLoading:o,onError:r}=e,a=()=>{o(!1),null==r||r()};return(0,l.Y)(T,{ref:t,urls:["/api/v1/import.json?publication_id=".concat(n.id)],onError:a,onAbort:a,onUpload:i})}class T extends u.A{render(){let{uploading:e,percentComplete:n}=this.state;return e?(0,l.Y)(D,{percentComplete:null!=n?n:0}):null}}let D=e=>{let{percentComplete:n}=e,{iTemplate:t}=(0,p.GO)(),i=Math.round(n?100*n:0);return(0,l.FD)(f.VP,{gap:12,padding:8,children:[(0,l.Y)(v.hZ,{percent:null!=n?n:0,height:4,padding:0}),(0,l.Y)(C.EY.B4,{textAlign:"center",color:"secondary",children:t(b(),i)})]})}},78979:function(e,n,t){t.d(n,{dn:()=>i,pq:()=>r});let i={SIGNUP:"SIGNUP",PUB_SIGNUP:"PUB_SIGNUP",CATEGORIES:"CATEGORIES",CATEGORIES_SUGGESTIONS:"CATEGORIES_SUGGESTIONS",PROFILE:"PROFILE",IMPORT_LIST:"IMPORT_LIST",EMAILS_BOX:"EMAILS_BOX",RECOMMENDATIONS:"RECOMMENDATIONS",START_WRITING:"START_WRITING",CREATOR_CHOICE:"CREATOR_CHOICE",CREATOR_WELCOME:"CREATOR_WELCOME",CREATE_PUBLICATION:"CREATE_PUBLICATION",CREATE_PUBLICATION_SUCCESS:"CREATE_PUBLICATION_SUCCESS",WELCOME:"WELCOME",ERROR:"ERROR",EXIT:"EXIT",APP_UPSELL:"APP_UPSELL"},o=["CREATE_PUBLICATION_SUCCESS","CREATOR_WELCOME","EXIT","WELCOME"],r=e=>o.includes(e)}}]);