!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@aef81dd"};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8de1a2b7-e04d-44da-ab75-07d9963c9901",e._sentryDebugIdIdentifier="sentry-dbid-8de1a2b7-e04d-44da-ab75-07d9963c9901")}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),v=t(76977),C=t(20500),_=t(91609),b=t(16993),S=t(63136),E=t(11510),I=t(39318),w=t(50963),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)(v.VP,{padding:c,children:(0,l.Y)(P,{utm_campaign:n,utm_source:t,darkMode:h.darkMode})}):(0,l.FD)(v.VP,{gap:20,padding:c,children:[(0,l.Y)(v.ov,{children:(0,l.Y)(v.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)(v.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:C,showMobileClose:_,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.$k)(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||_?r:void 0,showDivider:!0}),x?(0,l.Y)(R,{sentEmail:x,closeModal:N}):(0,l.FD)(v.I1,{alignItems:"stretch",paddingTop:32*!!P,children:[L?(0,l.Y)(v.pT,{justifyContent:"center",alignItems:"center",paddingTop:{desktop:20,mobile:0},children:(0,l.Y)(d.N,(0,o._)((0,i._)({},S),{pub:k}))}):(null==C?void 0:C.length)?(0,l.Y)(v.pT,{justifyContent:"center",alignItems:"center",padding:{mobile:8},children:(0,l.Y)(y.Z,{users:C,max:3,size:48})}):P?(0,l.Y)(v.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)(v.I1,{gap:8,children:[(0,l.Y)(_.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)(C.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)(v.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)(v.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:()=>er,s:()=>ei});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(33167),f=t(54718),Y=t(47796),v=t(57157),C=t(17402),_=t(41935),b=t(94090),S=t(82936),E=t(58050),I=t(84605),w=t(40691),k=t(85478),T=t(46271),D=t(27749),O=t(75051),A=t(75840),P=t(86500),x=t(94729),F=t(12501),B=t(68349),R=t(35369),N=t(76977),L=t(45859),U=t(19832),G=t(51177),M=t(36372),j=t(52145),W=t(504),q=t(5180),K=t(83629),z=t(46453),V=t(2481),J=t(16291),H=t(56262),X=t(39318),$=t(70189),Q=t(49807),Z=t(82776),ee=t(57324),en=t(44307);let et=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 ei(e){var n,t,i,o,r,Y,v,_;let{publication:z,post:ei,comment:er,item:el,parentItem:ea,allowHide:ed=!1,size:ec="sm"}=e,es=(0,M.d)(),{getConfigFor:eu}=(0,k.mJ)(),ep=(0,D.PK)(),eh=(0,A.T)(),em=(0,q.wA)(),eg=(0,q.Ro)(),{iString:ey}=(0,I.GO)(),[ef,eY]=(0,C.useState)(!1),[ev,eC]=(0,C.useState)(!1),e_=(0,T.Jd)(),{openModal:eb}=(0,w.hS)(),eS=null!=(v=null==er||null==(n=er.ancestor_path)?void 0:n.split(".").filter(Boolean).map(Number).map(e=>eg.comments.get(e)))?v:[],eE=(null==el?void 0:el.type)==="post"?null==(t=el.context.users[0])?void 0:t.id:void 0,eI=er?(0,H.getCommentAuthor)(er):z&&ei?(0,H.getPostAuthor)(z,ei,{preferredUserId:eE}):{id:0,name:"void"},ew=el&&"entity_key"in el?el.entity_key:void 0,ek=(0,S.bd)(eI,{surface:ep,noteId:ew,onClick(e){el&&(0,W.Qb)(el,ep,e,{tabId:eh})}}),eT=(0,b.a2)({comment:er,publication:z,post:ei,item:el}),eD=(0,E.A)(eI,ep,ew),eO=(0,F.st)({pathname:"/api/v1/comment/".concat(null!=(_=null==er?void 0:er.id)?_:0),method:"DELETE",json:{publication_id:null==z?void 0:z.id}}),eA=async()=>{if(!er||(eY(!1),eO.isLoading))return;let e=await eO.refetch();e instanceof Error?alert((0,B.uX)(e)):(es.popToast(()=>(0,l.Y)(M.y,{text:ey("Note deleted"),Icon:a.A})),em({type:"comment_delete",payload:{publication:null!=z?z:void 0,post:null!=ei?ei:void 0,comment:er}}))},eP=(0,V.NP)(),ex=async()=>{er&&eP.open({editComment:er,tabId:eh,surface:ep,editingUserId:null==e_?void 0:e_.id})},eF=el&&"post"===el.type&&el.mediaClip?el.mediaClip:void 0,eB=async(e,n)=>{await (0,x.x6)("/api/v1/comment/".concat(e.id,"/juice"),{method:"POST",json:{times_to_show:n}}),es.popToast(()=>(0,l.Y)(M.y,{text:ey("Juiced"),Icon:c.A})),eC(!1)},eR=async(e,n)=>{let t,i=et({item:e,parentItem:ea});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,J.A)().add(t,"hour").toISOString()}:{},{id:r,type:a}=i;await (0,x.x6)("/api/v1/notification_settings/".concat(a,"/").concat(r,"/mute"),{method:"POST",json:o}),em({type:"item_pause_notifications",payload:{entityKey:e.entity_key}}),es.popToast(()=>(0,l.Y)(M.y,{text:ey("Paused"),Icon:s.A}))},eN=async e=>{let n=et({item:e,parentItem:ea});if(!n)return;let{id:t,type:i}=n;await (0,x.x6)("/api/v1/notification_settings/".concat(i,"/").concat(t,"/mute"),{method:"DELETE"}),em({type:"item_unpause_notifications",payload:{entityKey:e.entity_key}}),es.popToast(()=>(0,l.Y)(M.y,{text:ey("Unpaused"),Icon:s.A}))},eL=async()=>{try{if(!er)return void es.popToast(()=>(0,l.Y)(M.y,{text:ey("Error starting workflow: comment not found")}));let{workflowId:e}=await (0,x.x6)("/api/v1/comment/".concat(er.id,"/workflow"),{method:"POST",json:{}});es.popToast(()=>(0,l.Y)(M.y,{text:"Workflow started with id ".concat(e)}))}catch(e){es.popToast(()=>(0,l.Y)(M.y,{text:"Error starting workflow: ".concat(e)}))}},eU=(0,F.st)({pathname:"/api/v1/video/assets/clips/".concat(null==eF?void 0:eF.id),method:"DELETE"}),eG=async()=>{if(!eF||eU.isLoading)return;let e=await eU.refetch();e instanceof Error?alert((0,B.uX)(e)):(es.popToast(()=>(0,l.Y)(M.y,{text:ey("Clip deleted"),Icon:a.A})),em({type:"clip_delete",payload:{mediaClip:eF,author:eI}}))},eM=ed&&el&&"entity_key"in el&&e_&&e_.id!==eI.id,ej=e_&&e_.id===eI.id,eW=e_&&!!(null==el||null==(i=el.post)?void 0:i.publishedBylines.find(e=>e.id===e_.id)),eq=e_&&(null==ea?void 0:ea.type)==="note_reply"&&(null==el||null==(o=el.parentComments[0])?void 0:o.user_id)===e_.id,eK=(ej||eW||eq)&&(null==el?void 0:el.type)&&["comment","post"].includes(el.type),ez=[(0,l.Y)(L.Dr,{leading:(0,l.Y)(d.A,{}),onClick:()=>{let e={r:(0,Z.userReferralKey)(e_),utm_source:ee.VU.notesShareAction,utm_medium:ee.Jn.web},n=er?(0,Q.Zgx)(er,{urlParams:e}):ei?(0,Q.q$n)(z,ei,{mediaClip:eF,urlParams:e}):null;(0,B.lW)(n),es.popToast(()=>(0,l.Y)(M.y,{text:ey("Copied link to clipboard"),Icon:d.A})),(0,P.u4)(P.qY.FEED_ITEM_SHARE_LINK_CLICKED,{type:"copy",shared_post_id:null==ei?void 0:ei.id,shared_comment_id:null==er?void 0:er.id})},children:ey("Copy link")}),!er&&ei&&(0,l.Y)(eo,{post:ei,item:el,feedSurface:ep,tabId:eh}),...eD,er?(0,l.Y)(L.Dr,{leading:(0,l.Y)(u.A,{}),onClick:()=>{eb({children:(0,l.Y)(O.Y,{comment:er}),width:540})},children:ey("Save as image")}):null].filter(Boolean),eV=[(0,Z.canEditComment)(e_,er)&&(0,l.Y)(L.Dr,{leading:(0,l.Y)(p.A,{}),onClick:ex,children:ey("Edit")}),er&&((null==e_?void 0:e_.is_global_admin)||(null==e_?void 0:e_.id)===er.user_id||eu("show_note_stats_for_all_notes")||(0,Z.canManageCommentAsPrimaryUser)(e_,er))?(0,l.Y)(L.Dr,{leading:(0,l.Y)(h.A,{}),href:(0,$.Kg)(er,{noBase:K.Z}),"data-native":!0,children:ey("View stats")}):null].filter(Boolean),eJ=(null==el?void 0:el.type)&&["comment","post"].includes(el.type)&&eg.mutedFeedItems.has(el.entity_key),eH=[eM&&(0,l.Y)(L.Dr,{leading:(0,l.Y)(m.A,{}),onClick:async()=>{try{em({type:"item_hide",payload:{entityKey:el.entity_key}}),await (0,x.x6)("/api/v1/note/".concat(el.entity_key,"/hide"),{method:"POST",json:{tabId:eh,surface:ep}})}catch(e){es.popToast(()=>(0,l.Y)(M.y,{text:(0,B.uX)(e)}))}},children:(e_.is_admin||e_.is_contributor)&&"post-page-restacks-list"===ep?ey("Hide note from post"):ey("Hide note")}),eK&&(eJ?(0,l.Y)(j.MI,{onClick:()=>eN(el),customLabel:ey("Unpause notifications")}):(0,l.Y)(j.DE,{onMute:e=>eR(el,e),customLabel:ey("Pause notifications")})),(null==e_?void 0:e_.is_global_admin)&&er&&(null==(Y=er.attachments)||null==(r=Y[0])?void 0:r.type)==="video"?(0,l.Y)(L.Dr,{leading:(0,l.Y)(g.A,{}),priority:"secondary",onClick:eL,children:ey("Run workflow")}):null,(null==e_?void 0:e_.is_global_admin)&&er?(0,l.Y)(L.Dr,{leading:(0,l.Y)(y.A,{}),priority:"secondary",href:"".concat((0,X.$_T)({subdomain:"admin"}),"/comments/").concat(er.id),target:"_blank",children:ey("Open in Underground")}):null,(null==e_?void 0:e_.is_global_admin)&&ei&&!er?(0,l.Y)(L.Dr,{leading:(0,l.Y)(y.A,{}),priority:"secondary",href:"".concat((0,X.$_T)({subdomain:"admin"}),"/posts/").concat(ei.id),target:"_blank",children:ey("Open in Underground")}):null].filter(Boolean),eX=[...ek,eT,(0,Z.canDeleteComment)(e_,er,{pub:null!=z?z:void 0,parentComments:eS})&&(0,l.Y)(L.Dr,{leading:(0,l.Y)(a.A,{}),priority:"destructive",onClick:()=>eY(!0),children:ey("Delete")}),eF&&ej&&(0,l.Y)(L.Dr,{leading:(0,l.Y)(a.A,{}),priority:"destructive",onClick:eG,children:ey("Delete this clip")}),(null==e_?void 0:e_.is_global_admin)&&er?(0,l.Y)(L.Dr,{leading:(0,l.Y)(c.A,{}),priority:"destructive",onClick:async()=>{eC(!0)},children:ey("Juice")}):null].filter(Boolean),e$=[0!==ez.length&&ez,0!==eV.length&&(0,l.Y)(L.H9,{children:eV}),0!==eH.length&&(0,l.Y)(L.H9,{children:eH}),0!==eX.length&&(0,l.Y)(L.H9,{children:eX})];return 0===e$.length?null:(0,l.FD)(l.FK,{children:[(0,l.Y)(N.ov,{className:en.A.moreButtonContainer,children:(0,l.Y)(L.W1,{trigger:(0,l.Y)(R.K0,{priority:"quaternary",size:ec,className:en.A.moreButton,"aria-label":ey("More options"),children:(0,l.Y)(f.A,{size:16})}),onOpen:()=>{el&&(0,W.Qb)(el,ep,"menu",{tabId:eh})},children:e$})}),(0,l.Y)(U.m,{isOpen:ef,title:ey("Delete note"),description:ey("Are you sure you want to permanently delete this note? This action cannot be undone."),primaryButton:(0,l.Y)(R.$n,{priority:"destructive",onClick:eA,children:ey("Delete")}),secondaryButton:(0,l.Y)(R.$n,{priority:"secondary",onClick:()=>eY(!1),children:ey("Cancel")}),onClose:()=>eY(!1)}),(null==e_?void 0:e_.is_global_admin)&&(0,l.Y)(U.m,{isOpen:ev,title:ey("Juice note"),description:ey("How many additional impressions would you like this note to receive? 100 impressions equals roughly 1-3 likes."),primaryButton:(0,l.FD)(G.t7,{priority:"secondary-outline",size:"md",children:[(0,l.Y)(G.gm,{onClick:async()=>{await eB(er,100)},children:"100"}),(0,l.Y)(G.gm,{onClick:async()=>{await eB(er,500)},children:"500"}),(0,l.Y)(G.gm,{onClick:async()=>{await eB(er,1e3)},children:"1000"})]}),secondaryButton:(0,l.Y)(N.pT,{flex:"grow",children:(0,l.Y)(R.$n,{priority:"secondary",onClick:()=>eC(!1),children:ey("Cancel")})}),onClose:()=>eC(!1)})]})}function eo(e){var{post:n,item:t,feedSurface:a,tabId:d}=e,c=(0,r._)(e,["post","item","feedSurface","tabId"]);let s=(0,T.Jd)(),{requireLogin:u}=(0,z.eE)(),p=er(n),{iContext:h}=(0,I.GO)();return(0,l.Y)(L.Dr,(0,o._)((0,i._)({leading:n.is_saved?(0,l.Y)(Y.A,{}):(0,l.Y)(v.A,{}),onClick:()=>{s?((null==t?void 0:t.type)==="post"&&(0,W.Qb)(t,a,n.is_saved?"unsave":"save",{tabId:d}),p()):null==u||u({redirectOverride:(0,Q.wu9)(null,n,{urlParams:{triggerSave:!0}})})}},c),{children:n.is_saved?h("Unbookmark a post previously saved for later reading","Unsave"):h("Bookmark a post to read later","Save")}))}function er(e){let n=(0,q.wA)(),t=(0,_.ib)();return()=>{let i=e.id,o=!e.is_saved;(0,_.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(16993);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,C]=(0,r.useState)(!1),_=(0,a.a)()?r.Fragment:a.B;return f?(0,i.Y)(i.FK,{children:n}):(0,i.Y)(_,{children:(0,i.FD)(o.bL,{delayDuration:Y,open:v,onOpenChange:C,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)(v,{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)(C,{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 v(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 C=(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:()=>v,M9:()=>f,dt:()=>C});var i=t(69277),o=t(70408),r=t(4006),l=t(84605),a=t(76110),d=t(17028),c=t(16993),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 v=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"})},C=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:()=>s});var i=t(69277),o=t(32641),r=t(4006),l=t(16993),a=t(57820),d=t(48239),c=t(97522);function s(e){var{isOpen:n,pub:t=null,profile:s=null,skipRedirectOnExit:u=!1}=e,p=(0,o._)(e,["isOpen","pub","profile","skipRedirectOnExit"]);let{stepConfig:h,contextValue:m,handleOpen:g,handleClose:y,isLoadingSkipStatus:f}=(0,c.F)((0,i._)({isPage:!1,isOpen:n,pub:t,profile:s,skipRedirectOnExit:u},p));return(0,r.Y)(l.aF,{fullscreenMobile:!0,isOpen:n,onOpen:g,onClose:y,width:500,disableCloseOnBackdropClick:!0,children:(0,r.Y)(d.Xf,{value:m,children:f?(0,r.Y)(a.y$,{flex:"grow",minHeight:320}):h.render()})})}},97307:function(e,n,t){t.d(n,{n:()=>c});var i=t(69277),o=t(17402),r=t(46271),l=t(68349),a=t(78979),d=t(92636);function c(){let{user:e}=(0,r.ur)(),[n,t]=(0,o.useState)(!1),[c,s]=(0,o.useState)({}),u=!e&&(0,d.Sg)()&&"undefined"!=typeof window&&"/onboarding"!==window.location.pathname,p=(0,o.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u?(0,l.V2)("/onboarding"):(s(e),t(!0))},[u]),h=(0,o.useCallback)((n,i)=>{s({pub:n,profile:i,initialStep:e?a.dn.CATEGORIES:a.dn.PUB_SIGNUP}),t(!0)},[e]),m=(0,o.useCallback)(e=>{s({pub:e,profile:null,initialStep:a.dn.PUB_SIGNUP}),t(!0)},[]),g=(0,o.useCallback)(()=>{t(!1),s({})},[]);return{modalProps:(0,o.useMemo)(()=>(0,i._)({isOpen:n,onClose:g},c),[n,g,c]),open:p,openForPub:h,openToPubSignup:m,close:g}}},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){let{pub:n,selected:t,setSelected:i,onRecommendationFirstVisible:d,index:c}=e,{iTemplate:f}=(0,l.GO)(),Y=(0,r.useRef)(null);(0,a.S8)(Y,()=>{null==d||d(n,c)},{threshold:.5});let v="".concat((0,m.$_T)(n),"/?utm_source=").concat(g.VU.homepageReaderOnboarding),C=n.hero_text;return(0,o.FD)(h.V,{ref:Y,selected:t,onChange:()=>i(!t),checkboxName:n.name,children:[(0,o.Y)(u.Nq,{pub:n,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:n.name})}),(0,o.Y)(p.EY.B4,{color:"secondary",children:f(y(),n.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),v=t(23168),C=t(57820),_=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,v.l)({accept:".csv,.xlsx,.ods,text/csv,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.oasis.opendocument.spreadsheet",maxSize:0x3200000}),[Y,C]=(0,s.useState)(!1),[_,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:_,onChange:b}),(0,l.Y)(h.$n,{loading:Y,disabled:!_,onClick:()=>{if(I){if(!_)return void alert(r("Please confirm that everyone on this list has opted in to receiving emails."));C(!0),S.current&&S.current.uploadFile(I)}},children:r("Import list")})]}),(0,l.Y)(k,{pub:t,importerRef:S,onSuccess:()=>{C(!1),null==i||i()},setLoading:C,onError:o})]})}function E(e){var n,t,o;let{files:r,isDragging:s,errors:u,openFileDialog:m,getInputProps:g,getDragProps:C,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:C(),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)(_.EY.B4,{weight:"medium",children:E}),(0,l.Y)(_.EY.B5,{color:"secondary",children:(0,v.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)(_.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)(C.hZ,{percent:null!=n?n:0,height:4,padding:0}),(0,l.Y)(_.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)}}]);