!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"substack@c7747fb"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="08e2debc-3e6d-4a68-aee3-18e8e3a57e9d",e._sentryDebugIdIdentifier="sentry-dbid-08e2debc-3e6d-4a68-aee3-18e8e3a57e9d")}catch(e){}}();"use strict";(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["35281"],{36092:function(e,t,n){n.d(t,{A:()=>i});let i={webContainer:"webContainer-IIk356",container:"container-hh54mh",emailWrapper:"emailWrapper-NhzydE",text:"text-Fj8WVT",title:"title-RBoKZn",button:"button-hAEuwt"}},91348:function(e,t,n){n.d(t,{A:()=>i});let i={container:"container-sfnj9V",emailWrapper:"emailWrapper-qwz6NP"}},36008:function(e,t,n){n.d(t,{A:()=>i});let i={gallery:"gallery-Phxj1j",static:"static-he6Urp",edit:"edit-aqFSXY",imageCaption:"imageCaption-iHC8xR",image:"image-IE_pDY",zoom:"zoom-YdDT6p",imageRow:"imageRow-_Y6x8T","length-2":"length-2-inHdHY",length2:"length-2-inHdHY",inbox:"inbox-uLXwi5",imageGalleryWrap:"imageGalleryWrap-ICPFaM",imageWrap:"imageWrap-egM10V",small:"small-AA4Dt8",medium:"medium-ZeIdEU"}},96473:function(e,t,n){n.d(t,{A:()=>i});let i={fpRecircBlock:"fpRecircBlock-HKJKYS",alignLeft:"alignLeft-WOT5JO",alignRight:"alignRight-bj2Dhz",header:"header-ie27mg",editor:"editor-V2JXka",sectionTitle:"sectionTitle-Xp9aWg",editable:"editable-oVCSpQ",titleInput:"titleInput-yIjmBm",postWrapper:"postWrapper-gPIVFt",postCard:"postCard-QEnqbK",hoverButton:"hoverButton-N0n6PV",emptySlot:"emptySlot-P_So_W",postImage:"postImage-tnGOF4",imageWrapper:"imageWrapper-mC7xPu",imagePlaceholder:"imagePlaceholder-uxRFZW",postContent:"postContent-kE5vyY",postTitle:"postTitle-WVs0I0",postAuthor:"postAuthor-Wuf0b1",tooltipContainer:"tooltipContainer-_Xo3J2",settingsButton:"settingsButton-LeI8A4",loading:"loading-HVK0LW",emptySlotContainer:"emptySlotContainer-Hjnza1",emptySlotItem:"emptySlotItem-OuTb9G",emptySlotTrigger:"emptySlotTrigger-vqGF5w",modalContainer:"modalContainer-iZuIQf",searchModal:"searchModal-ZuQoVH",searchModalTitle:"searchModalTitle-ii8cvR",searchModalInput:"searchModalInput-hXDbwI",searchModalResults:"searchModalResults-OojB5D",selected:"selected-wxI5Rb",noResults:"noResults-7fr0n7",editButtonContainer:"editButtonContainer-WIMQ0a",fpRecircBlockEmail:"fpRecircBlockEmail-bQo7e4",sectionTitleEmail:"sectionTitleEmail-OAZP1e",postTitleEmail:"postTitleEmail-HJC8Ka",postAuthorEmail:"postAuthorEmail-MsYeIm",emailLink:"emailLink-AegMn8",imageWrapperEmail:"imageWrapperEmail-yADEGT",postImageEmail:"postImageEmail-T8eGUY",imagePlaceholderEmail:"imagePlaceholderEmail-vtKzp8"}},8242:function(e,t,n){n.d(t,{A:()=>i});let i={editorBorder:"editorBorder-I0g0rz",editorWrapper:"editorWrapper-HyGil8",editorHelperText:"editorHelperText-PWUmEI"}},16389:function(e,t,n){n.d(t,{A:()=>i});let i={container:"container-s8tYit","preset-h1-sans":"preset-h1-sans-Qop2bo",presetH1Sans:"preset-h1-sans-Qop2bo","preset-h1-serif":"preset-h1-serif-QyYae8",presetH1Serif:"preset-h1-serif-QyYae8","preset-h1-text":"preset-h1-text-Xj6FhR",presetH1Text:"preset-h1-text-Xj6FhR","preset-h2-serif":"preset-h2-serif-IuXvG0",presetH2Serif:"preset-h2-serif-IuXvG0","preset-h3-compressed":"preset-h3-compressed-dB9FAX",presetH3Compressed:"preset-h3-compressed-dB9FAX","preset-h3-condensed":"preset-h3-condensed-kGahdt",presetH3Condensed:"preset-h3-condensed-kGahdt","preset-h4-sans-condensed":"preset-h4-sans-condensed-Reqd8Y",presetH4SansCondensed:"preset-h4-sans-condensed-Reqd8Y","preset-h4-sans-regular":"preset-h4-sans-regular-S6R6pb",presetH4SansRegular:"preset-h4-sans-regular-S6R6pb","preset-h4-sans-regular-menu":"preset-h4-sans-regular-menu-RuwXXd",presetH4SansRegularMenu:"preset-h4-sans-regular-menu-RuwXXd","preset-h4-serif":"preset-h4-serif-sMtXaD",presetH4Serif:"preset-h4-serif-sMtXaD","preset-h5-sans":"preset-h5-sans-oGxgjp",presetH5Sans:"preset-h5-sans-oGxgjp","preset-h5-sans-compressed":"preset-h5-sans-compressed-QXnWLT",presetH5SansCompressed:"preset-h5-sans-compressed-QXnWLT","preset-h5-serif":"preset-h5-serif-mY7BSm",presetH5Serif:"preset-h5-serif-mY7BSm","preset-h6-sans":"preset-h6-sans-Gi2FdE",presetH6Sans:"preset-h6-sans-Gi2FdE","preset-h6-serif":"preset-h6-serif-NHX2Ix",presetH6Serif:"preset-h6-serif-NHX2Ix","preset-h7-serif":"preset-h7-serif-qxcjrB",presetH7Serif:"preset-h7-serif-qxcjrB","preset-h7-sans":"preset-h7-sans-bXgWg2",presetH7Sans:"preset-h7-sans-bXgWg2","preset-d1-sans-regular":"preset-d1-sans-regular-HmsiTa",presetD1SansRegular:"preset-d1-sans-regular-HmsiTa","preset-d1-sans-medium":"preset-d1-sans-medium-qccA4g",presetD1SansMedium:"preset-d1-sans-medium-qccA4g","preset-d1-serif":"preset-d1-serif-eNQpMA",presetD1Serif:"preset-d1-serif-eNQpMA","preset-d2-serif":"preset-d2-serif-Zt3T9I",presetD2Serif:"preset-d2-serif-Zt3T9I","preset-d2-serif-bold":"preset-d2-serif-bold-b6ZIUk",presetD2SerifBold:"preset-d2-serif-bold-b6ZIUk","preset-d3-serif":"preset-d3-serif-RnjX7h",presetD3Serif:"preset-d3-serif-RnjX7h","preset-d3-serif-bold":"preset-d3-serif-bold-IdUurP",presetD3SerifBold:"preset-d3-serif-bold-IdUurP","preset-d4-serif":"preset-d4-serif-SEAETp",presetD4Serif:"preset-d4-serif-SEAETp","preset-d4-serif-bold":"preset-d4-serif-bold-HsJN25",presetD4SerifBold:"preset-d4-serif-bold-HsJN25","preset-st1":"preset-st1-O4T2tk",presetSt1:"preset-st1-O4T2tk","preset-st2":"preset-st2-XavWyr",presetSt2:"preset-st2-XavWyr","preset-st3":"preset-st3-mae929",presetSt3:"preset-st3-mae929","preset-st4":"preset-st4-nrV6E9",presetSt4:"preset-st4-nrV6E9","preset-body":"preset-body-JzLL5Q",presetBody:"preset-body-JzLL5Q","preset-body-link":"preset-body-link-V8UQqw",presetBodyLink:"preset-body-link-V8UQqw","preset-detail-large":"preset-detail-large-s2MDYG",presetDetailLarge:"preset-detail-large-s2MDYG","preset-detail-large-bold":"preset-detail-large-bold-cYVhri",presetDetailLargeBold:"preset-detail-large-bold-cYVhri","preset-detail-small":"preset-detail-small-mk1EbE",presetDetailSmall:"preset-detail-small-mk1EbE","preset-detail-small-bold":"preset-detail-small-bold-DhgQVM",presetDetailSmallBold:"preset-detail-small-bold-DhgQVM","preset-pullquote":"preset-pullquote-jlelFS",presetPullquote:"preset-pullquote-jlelFS","preset-article-byline":"preset-article-byline-YLd430",presetArticleByline:"preset-article-byline-YLd430","preset-timestamp":"preset-timestamp-JIzgHn",presetTimestamp:"preset-timestamp-JIzgHn","preset-caption":"preset-caption-U1Uztw",presetCaption:"preset-caption-U1Uztw","preset-misc-sans":"preset-misc-sans-y4snTd",presetMiscSans:"preset-misc-sans-y4snTd","preset-sm-preview-byline":"preset-sm-preview-byline-W4hKcb",presetSmPreviewByline:"preset-sm-preview-byline-W4hKcb","preset-lg-preview-byline":"preset-lg-preview-byline-dy8tib",presetLgPreviewByline:"preset-lg-preview-byline-dy8tib","preset-list-item-menu":"preset-list-item-menu-EiM1Es",presetListItemMenu:"preset-list-item-menu-EiM1Es","align-left":"align-left-kbuSQE",alignLeft:"align-left-kbuSQE","align-center":"align-center-UWtlhT",alignCenter:"align-center-UWtlhT","align-right":"align-right-onO3hJ",alignRight:"align-right-onO3hJ","wrap-pretty":"wrap-pretty-ejTmFK",wrapPretty:"wrap-pretty-ejTmFK","wrap-balance":"wrap-balance-jmGdbe",wrapBalance:"wrap-balance-jmGdbe",clamp:"clamp-Vi5QjU","clamp-1":"clamp-1-OfiQ1V",clamp1:"clamp-1-OfiQ1V","clamp-2":"clamp-2-_Mb9Jj",clamp2:"clamp-2-_Mb9Jj","clamp-3":"clamp-3-jYPWgo",clamp3:"clamp-3-jYPWgo","clamp-4":"clamp-4-qoVcAB",clamp4:"clamp-4-qoVcAB","clamp-5":"clamp-5-rto_2V",clamp5:"clamp-5-rto_2V","clamp-6":"clamp-6-tHjoiW",clamp6:"clamp-6-tHjoiW","color-accent":"color-accent-ACVlDT",colorAccent:"color-accent-ACVlDT","color-primary":"color-primary-NaQ4Ae",colorPrimary:"color-primary-NaQ4Ae","color-white":"color-white-MlYGuP",colorWhite:"color-white-MlYGuP","color-blue":"color-blue-MQGY4t",colorBlue:"color-blue-MQGY4t","color-tertiary":"color-tertiary-mHRDyo",colorTertiary:"color-tertiary-mHRDyo","color-disabled":"color-disabled-gVbtOK",colorDisabled:"color-disabled-gVbtOK","white-space-nowrap":"white-space-nowrap-oTjHiF",whiteSpaceNowrap:"white-space-nowrap-oTjHiF","white-space-normal":"white-space-normal-HrU_HE",whiteSpaceNormal:"white-space-normal-HrU_HE"}},55390:function(e,t,n){n.d(t,{A:()=>i});let i={editVideoEmbedWrap:"editVideoEmbedWrap-UANbdz",imageGallery:"imageGallery-W5xlEs",editVideoEmbed:"editVideoEmbed-nRUXQD",videoPlaceholder:"videoPlaceholder-F7Lub5",videoScrollTarget:"videoScrollTarget-SzB20Y",video:"video-P2qgwZ",videoPlayer:"videoPlayer-vlcedM",videoEmbed:"videoEmbed-_FycLU",videoPlaceholderSilhouette:"videoPlaceholderSilhouette-XopYyA"}},6296:function(e,t,n){n.d(t,{A:()=>i});let i={container:"container-g1JaM7",note:"note-Biuyq7"}},2890:function(e,t,n){n.d(t,{A:()=>i});let i={avatar:"avatar-LanjdX",badge:"badge-Uvjr_O",container:"container-t1XakO",header:"header-MPtCPc",emailButton:"emailButton-TJW1DY",cta:"cta-htyRl8"}},35407:function(e,t,n){n.d(t,{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"}},21734:function(e,t,n){n.d(t,{A:()=>i});let i={tweet:"tweet-fWkQfo"}},47963:function(e,t,n){n.d(t,{El:()=>D,gF:()=>O,hj:()=>R});var i=n(69277),l=n(70408),r=n(79785),a=n(4006),o=n(17402),s=n(80682),d=n(33764),c=n(84605),u=n(46271),p=n(86500),h=n(94729),m=n(31392),g=n(12501),f=n(22057),y=n(35369),v=n(16074),_=n(76977),Y=n(20500),b=n(91609),C=n(16993),w=n(63136),E=n(11510),T=n(39318),S=n(50963),I=n(34372);function k(){let e=(0,r._)(["Accept ","'s gift in the Substack app"]);return k=function(){return e},e}function A(){let e=(0,r._)(["We sent a link to download the Substack app to ","."]);return A=function(){return e},e}function D(){let{utm_campaign:e,utm_source:t,utm_content:n,abTestingId:i,overrideCTA:l,overrideTitle:r,subTitle:s,openUrl:d,giftCard:c,pub:u,facepileUsers:h}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[m,g]=(0,o.useState)(!1),f=(0,o.useCallback)(()=>{g(!0),(0,p.u4)(p.qY.APP_INSTALL_MODAL_OPENED,{utm_campaign:e,utm_source:t,utm_content:n})},[e,t,n]),y=(0,o.useCallback)(()=>{g(!1)},[]);return{open:f,modal:(0,a.Y)(P,{isOpen:m,onClose:y,utm_campaign:e,utm_source:t,utm_content:n,abTestingId:i,overrideCTA:l,overrideTitle:r,subTitle:s,openUrl:d,width:c?450:void 0,giftCard:c,pub:u,facepileUsers:h})}}function O(e){let{utm_campaign:t,utm_source:n,utm_content:i,hideEmailPrompt:l=!1,abTestingId:r,suggestedEmail:o,size:s,padding:d=32,openUrl:c,onSend:u}=e,p=(0,E.Iu)(),h=(0,m.D2)();return p?(0,a.Y)(_.VP,{padding:d,children:(0,a.Y)(x,{utm_campaign:t,utm_source:n,darkMode:h.darkMode})}):(0,a.FD)(_.VP,{gap:20,padding:d,children:[(0,a.Y)(_.ov,{children:(0,a.Y)(_.pT,{className:I.A.qrCode,padding:8,overflow:"hidden",radius:"lg",bg:"white",outline:"detail",shadow:"lg",animate:!0,cursor:"pointer",children:(0,a.Y)(R,{size:s,utm_campaign:t,utm_source:n,utm_content:i,abTestingId:r,openUrl:c})})}),!l&&(0,a.Y)(v.v,{}),!l&&(0,a.Y)(L,{suggestedEmail:o,onSend:u})]})}function x(e){let{utm_campaign:t,utm_source:n,darkMode:i=!1}=e;return(0,a.FD)(_.pT,{gap:16,justifyContent:"center",children:[(0,a.Y)("a",{className:I.A.appBadge,href:(0,T.cxW)({utm_campaign:t,utm_source:n}),onClick:()=>{(0,p.u4)(p.qY.APP_STORE_LINK_CLICKED,{source:"app_install_upsell",app_store:"ios",utm_campaign:t,utm_source:n})},children:(0,a.Y)("img",{src:(0,T.dJ9)(i?"/img/app_page/app-store-white.png":"/img/app_page/app-store.png",320),height:48})}),(0,a.Y)("a",{className:I.A.appBadge,href:(0,T.zw3)({utm_campaign:t,utm_source:n}),onClick:()=>{(0,p.u4)(p.qY.APP_STORE_LINK_CLICKED,{source:"app_install_upsell",app_store:"android",utm_campaign:t,utm_source:n})},children:(0,a.Y)("img",{src:(0,T.dJ9)(i?"/img/app_page/google-play-white.png":"/img/app_page/google-play.png",320),height:48})})]})}function P(e){var t;let{isOpen:n,onClose:r,utm_campaign:d,utm_content:u,utm_source:p,abTestingId:h,overrideTitle:m,subTitle:g,openUrl:y,width:v,facepileUsers:Y,showMobileClose:b,giftCard:w,pub:I}=e,{iString:A,iTemplate:D}=(0,c.GO)(),x=(0,E.Iu)(),[P,R]=(0,o.useState)(""),L=(0,o.useCallback)(e=>{R(e)},[]),N=(0,o.useCallback)(()=>{R(""),r()},[r]),B=!!w&&!!I,U=(null==w||null==(t=w.gifter)?void 0:t.name)?"Split Zone Duo"===w.gifter.name?"SZD":(0,S.$k)(w.gifter.name):"",M=m||(B?U?D(k(),U):A("Accept this gift in the Substack app"):A("Download the Substack app"));return(0,a.FD)(C.aF,{isOpen:n,onClose:r,width:v||360,children:[(0,a.Y)(C.rQ,{title:M,description:g,onClose:!x||b?r:void 0,showDivider:!0}),P?(0,a.Y)(F,{sentEmail:P,closeModal:N}):(0,a.FD)(_.I1,{alignItems:"stretch",paddingTop:32*!!x,children:[B?(0,a.Y)(_.pT,{justifyContent:"center",alignItems:"center",paddingTop:{desktop:20,mobile:0},children:(0,a.Y)(s.N,(0,l._)((0,i._)({},w),{pub:I}))}):(null==Y?void 0:Y.length)?(0,a.Y)(_.pT,{justifyContent:"center",alignItems:"center",padding:{mobile:8},children:(0,a.Y)(f.Z,{users:Y,max:3,size:48})}):x?(0,a.Y)(_.pT,{justifyContent:"center",alignItems:"center",children:(0,a.Y)("img",{src:(0,T.dJ9)("/img/substack-app-icon.png"),height:64,width:64})}):null,(0,a.Y)(O,{utm_campaign:d,utm_source:p,utm_content:u,abTestingId:h,openUrl:y,size:142,onSend:L})]})]})}function R(e){let{utm_campaign:t,utm_source:i,utm_content:l,abTestingId:r,size:s=240,width:d,height:c,openUrl:u}=e,p=(0,o.useRef)(null),h=(0,T.wHz)({utm_campaign:t,utm_source:i,utm_content:l,abti:r}),m=function(e,t){let{result:i}=(0,g.qK)(()=>n.e("34592").then(n.t.bind(n,97283,23)),[],{auto:!0}),l=null==i?void 0:i.default;return(0,o.useMemo)(()=>l&&"undefined"!=typeof window?new l(e(window)):null,[l,...t])}(e=>{let t=e.devicePixelRatio,n=getComputedStyle(document.body),i="rgb(".concat(n.getPropertyValue("--color-primitive-black-rgb"),")");return{width:(null!=d?d:s)*t,height:(null!=c?c:s)*t,type:"canvas",data:u||h,dotsOptions:{color:i,type:"dots"},backgroundOptions:{color:"rgb(".concat(n.getPropertyValue("--color-primitive-white-rgb"),")")},cornersSquareOptions:{color:i,type:"extra-rounded"},cornersDotOptions:{color:i,type:"dot"},qrOptions:{errorCorrectionLevel:"L"}}},[d,c,u]);return(0,o.useEffect)(()=>{let{current:e}=p;if(!e||!m||!m._canvas)return;let t=m._canvas;return t.style.width="".concat(null!=d?d:s,"px"),t.style.height="".concat(null!=c?c:s,"px"),e.style.width="".concat(null!=d?d:s,"px"),e.style.height="".concat(null!=c?c:s,"px"),e.appendChild(t),()=>{e.removeChild(t)}},[m,d,c]),(0,a.Y)("div",{ref:p})}function L(e){let{suggestedEmail:t,onSend:n}=e,{iString:i}=(0,c.GO)(),l=(0,u.Jd)(),[r,s]=(0,o.useState)((null==l?void 0:l.email)||t||""),[d,p]=(0,o.useState)(!1),[m,g]=(0,o.useState)(null);return(0,a.Y)(a.FK,{children:(0,a.FD)(_.I1,{gap:8,children:[(0,a.Y)(b.x,{type:"email",placeholder:i("Your email"),placement:"end",priority:"primary",value:r,onChange:e=>s(e.currentTarget.value),button:(0,a.Y)(y.$n,{loading:d,onClick:async()=>{p(!0);try{await (0,h.x6)("/api/v1/send_app_download_link",{method:"POST",json:{email:r}}),g(null),p(!1),n&&n(r)}catch(e){g("Something went wrong")}},children:i("Send link")})}),m&&(0,a.Y)(Y.yn,{align:"center",children:m})]})})}let F=e=>{let{sentEmail:t,closeModal:n}=e,{iString:i,iTemplate:l}=(0,c.GO)();return(0,a.FD)(a.FK,{children:[(0,a.Y)(C.cw,{children:(0,a.FD)(_.I1,{gap:20,justifyContent:"center",alignItems:"center",children:[(0,a.Y)(d.o,{src:"/img/cohorts/local_news/plane.png",maxWidth:64}),(0,a.FD)(_.I1,{gap:4,justifyContent:"center",alignItems:"center",children:[(0,a.Y)(w.EY.B2,{weight:"semibold",textAlign:"center",children:i("Check your email")}),(0,a.Y)(w.EY.B3,{color:"secondary",align:"center",children:l(A(),t||"your email")})]})]})}),(0,a.Y)(C.jl,{alignButtons:"stretch",primaryButton:(0,a.Y)(y.$n,{priority:"secondary",onClick:n,children:i("Done")})})]})}},13295:function(e,t,n){n.d(t,{Y:()=>g});var i=n(4006),l=n(48309),r=n(84605),a=n(69277),o=n(70408),s=n(32641),d=n(32485),c=n.n(d),u=n(17402),p=n(35369),h=n(78340);let m=(0,u.forwardRef)(function(e,t){var{className:n,children:l,priority:r="primary",size:d="md",rounded:u,leading:m,trailing:g,loading:f,native:y}=e,v=(0,s._)(e,["className","children","priority","size","rounded","leading","trailing","loading","native"]);return(0,i.FD)("a",(0,o._)((0,a._)({"data-native":y?"":void 0},v),{className:c()("pencraft",h.A.buttonBase,(0,p.C3)({className:n,priority:r,size:d,rounded:u,leading:m,trailing:g,loading:f})),ref:t,"aria-busy":f?"true":void 0,children:[f&&(0,i.Y)(p.az,{priority:r}),m,l,g]}))});function g(e){let{src:t}=e,{iString:n}=(0,r.GO)();return(0,i.Y)(m,{href:t,download:!0,"aria-label":n("Download"),priority:"quaternary",size:"md",className:"downloadButton-dUfp2b","data-native":!0,children:(0,i.Y)(l.A,{size:20})})}},14506:function(e,t,n){n.d(t,{e:()=>s});var i=n(4006),l=n(63558),r=n(43510),a=n(84605),o=n(48625);function s(e){let{isPlaying:t,disabled:n,onClick:s,size:d="md"}=e,{iString:c}=(0,a.GO)(),u=n?"var(--color-fg-tertiary)":"var(--color-fg-primary)",p=c(t?"Pause":"Play");return(0,i.Y)(o.f,{priority:"secondary","aria-label":p,pressed:t,onPressedChange:s,size:d,disabled:n,className:"button-yhxrk8",children:e=>{let{pressed:t}=e;return t?(0,i.Y)(l.A,{size:20,fill:u}):(0,i.Y)(r.A,{size:20,fill:u})}})}},48617:function(e,t,n){n.d(t,{x:()=>c});var i=n(4006),l=n(44202),r=n(45773),a=n(84605),o=n(35369),s=n(45859);let d=[{value:1,display:"1"},{value:1.25,display:"1.25"},{value:1.5,display:"1.5"},{value:1.75,display:"1.75"},{value:2,display:"2"}];function c(e){let{onSetPlaybackRate:t,playbackRate:n}=e,{iString:c}=(0,a.GO)();return(0,i.FD)(s.W1,{side:"top",trigger:(0,i.Y)(o.K0,{priority:"quaternary",size:"md",children:(0,i.Y)(l.A,{size:20})}),children:[(0,i.Y)(s.j,{children:c("Playback speed")}),d.map(e=>(0,i.FD)(s.Dr,{onClick:()=>t(e.value),trailing:e.value===n?(0,i.Y)(r.A,{}):null,children:[e.display,"\xd7"]},e.value))]})}},12018:function(e,t,n){n.d(t,{y:()=>g});var i=n(69277),l=n(70408),r=n(4006),a=n(17402),o=n(74728),s=n.n(o),d=n(90616),c=n(13950),u=n(35369),p=n(76977),h=n(11587),m=n(20004);let g=e=>{let{initialCaption:t,onSave:n,onCancel:o}=e,g=t.replace(//gi,"\n"),[f,y]=(0,a.useState)(g);return(0,r.Y)(c.DH,{children:(0,r.FD)(p.I1,{flex:"grow",gap:8,children:[(0,r.Y)(h.T,(0,l._)((0,i._)({},d.P),{className:m.A.captionEditor,maxLength:5e3,name:"description",placeholder:"Enter a caption...",rows:6,value:f,onChange:e=>{y(e.target.value)}})),(0,r.FD)(p.pT,{gap:8,justifyContent:"end",paddingY:8,children:[(0,r.Y)(u.$n,{priority:"secondary",onClick:o,children:"Cancel"}),(0,r.Y)(u.$n,{priority:"primary",onClick:()=>{let e=f.replace(/\n/g,"
");n(s()(e,(0,l._)((0,i._)({},s().defaults),{allowedTags:["br"]})))},children:"Save"})]})]})})}},24582:function(e,t,n){n.d(t,{C:()=>u});var i=n(4006),l=n(89230),r=n(84605),a=n(35369),o=n(16074),s=n(76977),d=n(45859),c=n(20004);let u=e=>{let{enableExtraSmallOption:t,size:n,onOpen:u,onClose:p,onEditCaption:h,onSetLayout:m,onSetShowBylines:g,showBylines:f,onConvertToLink:y,onConvertToEmbeddedPost:v,onDelete:_,showBylinesOption:Y}=e,{iString:b}=(0,r.GO)();return(0,i.Y)(s.pT,{className:c.A.menu,justifyContent:"end",children:(0,i.FD)(d.W1,{trigger:(0,i.Y)(a.K0,{priority:"secondary-outline",children:(0,i.Y)(l.A,{size:20})}),onClose:p,onOpen:u,children:[t&&(0,i.Y)(d.Dr,{disabled:"xs"===n,onClick:()=>m("xs"),children:b("Extra small display")}),(0,i.Y)(d.Dr,{disabled:"sm"===n,onClick:()=>m("sm"),children:b("Small display")}),(0,i.Y)(d.Dr,{disabled:"md"===n,onClick:()=>m("md"),children:b("Medium display")}),(0,i.Y)(d.Dr,{disabled:"lg"===n,onClick:()=>m("lg"),children:b("Large display")}),(0,i.Y)(o.c,{}),Y&&(0,i.Y)(d.Dr,{onClick:()=>g(!f),children:b(f?"Hide bylines":"Show bylines")}),("lg"===n||"md"===n)&&(0,i.Y)(d.Dr,{onClick:h,children:b("Edit caption")}),(0,i.Y)(d.Dr,{onClick:()=>v(),children:b("Convert to default")}),(0,i.Y)(d.Dr,{onClick:y,children:b("Convert to link")}),(0,i.Y)(d.Dr,{priority:"destructive",onClick:_,children:b("Remove")})]})})}},23942:function(e,t,n){n.d(t,{w:()=>p});var i=n(69277),l=n(70408),r=n(4006),a=n(17402),o=n(90616),s=n(84605),d=n(35369),c=n(76977),u=n(65842);let p=e=>{let{initialValue:t,placeholder:n,onSave:p,onCancel:h}=e,{iString:m}=(0,s.GO)(),[g,f]=(0,a.useState)(t),y=(0,a.useRef)(null);return(0,a.useEffect)(()=>{y.current&&(y.current.focus(),y.current.select())},[]),(0,r.FD)(c.I1,{gap:16,children:[(0,r.Y)(u.ks,(0,l._)((0,i._)({},o.P),{ref:y,placeholder:n,value:g,onInput:e=>{f(e.target.value)}})),(0,r.FD)(c.pT,{gap:8,justifyContent:"end",children:[(0,r.Y)(d.$n,{priority:"tertiary",onClick:e=>{e.preventDefault(),e.stopPropagation(),null==h||h()},children:m("Cancel")}),(0,r.Y)(d.$n,{priority:"primary",onClick:e=>{e.preventDefault(),e.stopPropagation(),null==p||p(g.trim())},children:m("Save")})]})]})}},81704:function(e,t,n){n.d(t,{E:()=>a});var i=n(17402),l=n(15734),r=n.n(l);let a=e=>{let{pubId:t,onSelectPost:n}=e,[l,a]=(0,i.useState)(""),[o,s]=(0,i.useState)([]),[d,c]=(0,i.useState)(!1),[u,p]=(0,i.useState)([]),h=(0,i.useRef)(null),m=(0,i.useCallback)(e=>{(a(e),h.current&&clearTimeout(h.current),e.trim())?(c(!0),h.current=window.setTimeout(async()=>{try{let n=await r().get("/api/v1/post/search").query({query:e,focusedPublicationId:t,numberFocused:10}),i=(n.body.focused||n.body.results||[]).map(e=>{var t,n,i;return{id:e.id,title:e.title,author_name:(null==(n=e.publishedBylines)||null==(t=n[0])?void 0:t.name)||e.author_name,author_names:null==(i=e.publishedBylines)?void 0:i.map(e=>e.name),cover_image:e.cover_image,canonical_url:e.canonical_url,post_date:e.post_date}});s(i)}catch(e){console.error("Error searching posts:",e),s([])}finally{c(!1)}},300)):s([])},[t]),g=(0,i.useCallback)(()=>{h.current&&clearTimeout(h.current),a(""),s([]),c(!1)},[]);return{searchQuery:l,searchResults:o,isSearching:d,handleSearch:m,clearSearch:g,onSelectPost:n,getLatestPostsByTag:(0,i.useCallback)(async e=>{try{c(!0);let t=((await r().get("/api/v1/archive").query({sort:"new",limit:10,post_tag_id:e})).body||[]).map(e=>{var t,n,i;return{id:e.id,title:e.title,author_name:(null==(n=e.publishedBylines)||null==(t=n[0])?void 0:t.name)||e.author_name,author_names:null==(i=e.publishedBylines)?void 0:i.map(e=>e.name),cover_image:e.cover_image,canonical_url:e.canonical_url,post_date:e.post_date}});return s(t),t}catch(e){return console.error("Error fetching posts by tag:",e),s([]),[]}finally{c(!1)}},[]),fetchAvailableTags:(0,i.useCallback)(async()=>{try{let e=(await r().get("/api/v1/publication/post-tag")).body||[];return p(e.filter(e=>!e.hidden)),e}catch(e){return console.error("Error fetching tags:",e),p([]),[]}},[]),availableTags:u}}},18203:function(e,t,n){n.d(t,{z:()=>S});var i=n(69277),l=n(79785),r=n(4006),a=n(32708),o=n(17402),s=n(64998),d=n(84605),c=n(25006),u=n(85478),p=n(35369),h=n(60322),m=n(76977),g=n(20500),f=n(88762),y=n(16993),v=n(94996),_=n(63136),Y=n(65842),b=n(66511);function C(){let e=(0,l._)(["Each option must be between 1 and "," characters long."]);return C=function(){return e},e}function w(){let e=(0,l._)(["The description must be less than "," characters long."]);return w=function(){return e},e}let E=(e,t)=>{let{question:n,description:i,expiry:l,audience:r,options:a}=e,{iString:o,iTemplate:s}=I18N.i(t),d=a.filter(Boolean);if(n.length<1||n.length>255)return o("The question must be between 1 and 255 characters long.");if(d.length<2||d.length>5)return o("Your poll must have 2 to 5 options.");if(d.some(e=>e.length<1||e.length>35))return s(C(),35);if(!["all_subscribers","only_paid"].includes(r))return o("Your poll audience is invalid.");if(![1,24,72,168,999999].includes(l))return o("The length of your poll is invalid.");else if(i.length>250)return s(w(),250);return null},T=e=>{let{index:t,text:n,onChange:i,onDelete:l,showDeleteButton:o,disabled:c}=e,{language:u}=(0,d.GO)();return(0,r.FD)(m.fI,{flex:"grow",gap:8,children:[(0,r.Y)(Y.ks,{disabled:c,flex:"grow",maxLength:35,placeholder:(0,s.Uf)(t,u),value:n,onChange:e=>{i(t,e.currentTarget.value)}}),o&&(0,r.Y)(p.K0,{disabled:c,priority:"tertiary",tabIndex:o?void 0:-1,onClick:()=>l(t),children:(0,r.Y)(a.A,{size:20})})]})},S=e=>{let{poll:t,isOpen:n,onClose:l,onSave:a,isPublished:s,shouldShowAudiencePicker:C}=e,w=t.options.map(e=>e.label);w.length>1?w.length<5&&w.push(""):w=["",""];let{iString:S,language:I,iPlural:k}=(0,d.GO)(),{getConfigFor:A}=(0,u.mJ)(),{payments_state:D}=(0,c.df)()||{},O=!!A("enable_description_on_polls"),x=C&&"enabled"===D?"only_paid":"all_subscribers",[P,R]=(0,o.useState)(t.question||""),[L,F]=(0,o.useState)(t.description||""),[N,B]=(0,o.useState)(w),[U,M]=(0,o.useState)(t.expiry||24),[H,W]=(0,o.useState)(t.audience||x),[G,z]=(0,o.useState)(!1),[V,j]=(0,o.useState)(t.votes_hidden||!1),[q,X]=(0,o.useState)(null),K=E({question:P,description:L,options:N,expiry:U,audience:H},I),Q=(0,o.useCallback)(()=>{var e;R(t.question||""),F(t.description||""),B((null==(e=t.options)?void 0:e.map(e=>e.label))||["",""]),M(t.expiry||24),W(t.audience||x),j(t.votes_hidden||!1),X(null),l()},[t.question,t.description,t.options,t.expiry,t.audience,t.votes_hidden,x,l]),J=(0,o.useCallback)(e=>{let{value:t}=e;["only_paid","all_subscribers"].includes(t)&&W(t)},[]),Z=(0,o.useCallback)(e=>{let{value:t}=e,n=Number(t);[1,24,72,168,999999].includes(n)&&M(n)},[]),$=(0,o.useCallback)((e,t)=>{let n=[...N];n.splice(e,1,t),e===n.length-1&&n.length<5&&n.push(""),B(n)},[N]),ee=(0,o.useCallback)(e=>{var t;if(N.length<=2||e>=N.length)return;let n=[...N];n.splice(e,1),(null==(t=n[n.length-1])?void 0:t.length)&&n.push(""),B(n)},[N]),et=Array(Math.max(2,N.length||0)).fill("").map((e,t)=>N.length>t?N[t]:e),en=q||s&&t.total_votes>0&&k("This poll is part of a post that has already been published. If you modify it, 1 existing vote will be removed.","This poll is part of a post that has already been published. If you modify it, %1 existing votes will be removed.",t.total_votes);return(0,r.FD)(y.aF,{className:"poll-editor-modal",isOpen:n,onClose:l,children:[(0,r.Y)(y.rQ,{showDivider:!0,title:S("Edit poll"),onClose:l}),(0,r.Y)(y.cw,{children:(0,r.FD)(m.VP,{gap:20,children:[(0,r.FD)(Y.A0,{children:[(0,r.Y)(f.JU,{children:S("Poll question")}),(0,r.Y)(Y.ks,{disabled:G,maxLength:255,placeholder:S("Enter your question..."),value:P,onChange:e=>R(e.currentTarget.value)})]}),O&&(0,r.FD)(Y.A0,{children:[(0,r.Y)(f.JU,{children:S("Poll description")}),(0,r.Y)(Y.ks,{disabled:G,maxLength:250,placeholder:S("Enter your description..."),value:L,onChange:e=>F(e.currentTarget.value)})]}),(0,r.FD)(Y.A0,{children:[(0,r.Y)(f.JU,{children:S("Poll options")}),et.map((e,t)=>(0,r.Y)(T,{disabled:G,index:t,showDeleteButton:et.length>2&&(t0),text:e,onChange:$,onDelete:ee},t))]}),(0,r.FD)(Y.A0,{children:[(0,r.Y)(f.JU,{children:S("Poll duration")}),(0,r.FD)(v.I,{disabled:G,value:String(U),onChange:e=>Z({value:e.target.value}),children:[(0,r.Y)("option",{value:"1",children:S("1 hour")}),(0,r.Y)("option",{value:"24",children:S("1 day")}),(0,r.Y)("option",{value:"72",children:S("3 days")}),(0,r.Y)("option",{value:"168",children:S("1 week")}),(0,r.Y)("option",{value:"999999",children:S("Forever")})]})]}),C&&"enabled"===D&&(0,r.FD)(Y.A0,{children:[(0,r.Y)(f.JU,{children:S("Who can vote?")}),(0,r.FD)(v.I,{disabled:G,value:H,onChange:e=>J({value:e.target.value}),children:[(0,r.Y)("option",{value:"only_paid",children:S("Only paid subscribers")}),(0,r.Y)("option",{value:"all_subscribers",children:S("All subscribers who can see this post")})]})]}),(0,r.Y)("label",{children:(0,r.FD)(m.fI,{alignItems:"center",gap:12,children:[(0,r.Y)(h.S,{checked:V,name:"votes-hidden",onChange:()=>j(!V)}),(0,r.Y)(_.EY.B3,{children:S("Hide the total vote count from readers?")})]})}),en&&(0,r.Y)(Y.A0,{children:(0,r.Y)(g.yn,{children:en})})]})}),(0,r.Y)(y.jl,{primaryButton:(0,r.Y)(b.m_,{disabled:null===K,text:null!=K?K:"",children:(0,r.Y)(p.$n,{disabled:null!==K||G,priority:"primary",onClick:async()=>{let e=E({question:P,description:L,options:N,expiry:U,audience:H},I);if(e)return void X(e);z(!0),X(null);try{await a((0,i._)({audience:H,question:P,options:N.filter(Boolean),expiry:U,votes_hidden:V},O?{description:L}:{}))}catch(e){X(S("An error occurred while saving this poll."))}finally{z(!1)}},children:S("Save")})}),secondaryButton:(0,r.Y)(p.$n,{disabled:G,priority:"secondary",onClick:Q,children:S("Cancel")}),showDivider:!0})]})}},48329:function(e,t,n){n.d(t,{f:()=>s});var i=n(4006),l=n(67078),r=n(84605),a=n(76977),o=n(63136);let s=e=>{let{poll:t}=e,{iString:n}=(0,r.GO)(),s=null==t?void 0:t.audience,d=null==t?void 0:t.question,c=null==t?void 0:t.description;return(0,i.FD)(a.I1,{gap:4,children:[(0,i.Y)(a.Ye,{alignItems:"baseline",className:"poll-title",gap:4,children:"only_paid"===s?(0,i.FD)(i.FK,{children:[(0,i.Y)(l.A,{size:16}),(0,i.Y)(o.EY.Meta,{className:"subscriber-only-poll",translated:!0,children:"SUBSCRIBER-ONLY POLL"})]}):(0,i.Y)(o.EY.Meta,{translated:!0,children:"POLL"})}),(0,i.Y)(o.EY.H3,{className:"poll-question",color:"pub-primary-text",children:d||n("New Poll")}),c&&(0,i.Y)(o.EY.B3,{color:"pub-secondary-text",children:c})]})}},39232:function(e,t,n){n.d(t,{u:()=>b});var i=n(69277),l=n(70408),r=n(79785),a=n(4006),o=n(45773),s=n(17402),d=n(34206),c=n(84605),u=n(86500),p=n(35369),h=n(85329),m=n(16993),g=n(84843),f=n(45974),y=n(63136),v=n(39318),_=n(57324);function Y(){let e=(0,r._)(["Only "," to "," can vote on this poll."]);return Y=function(){return e},e}function b(e){var t;let{audience:n,isOpen:r,pollId:b,post:C,pub:w,user:E,onClose:T}=e,{iString:S,iTemplate:I}=(0,c.GO)(),[k,A]=(0,s.useState)(null!=(t=null==E?void 0:E.email)?t:"");(0,s.useEffect)(()=>{r&&(0,u.u4)(u.qY.POLL_SIGNUP_DIALOG_PRESENTED,{poll_id:b,post_id:null==C?void 0:C.id})},[r,b,null==C?void 0:C.id]);let D=()=>{(0,u.u4)(u.qY.POLL_SIGNUP_DIALOG_CLOSED,{poll_id:b,post_id:null==C?void 0:C.id}),T()},O=S("only_paid"===n?"paid subscribers":"subscribers");return(0,a.FD)(m.aF,{isOpen:r,onClose:D,children:[(0,a.Y)(m.rQ,{alignItems:"center",description:I(Y(),O,w.name),icon:w.logo_url?(0,a.Y)(f.Nq,{outline:"detail",pub:w,radius:"sm",size:48}):(0,a.Y)(g.Ud,{}),title:S("Subscribe to vote"),onClose:D}),(0,a.Y)(m.cw,{children:(0,a.FD)(d.Ay,{action:(0,v.yRP)("/api/v1/free"),autoLock:!0,className:"form-G9Bs_n",id:"poll-login-form",loading:!1,method:"post",onSuccess:e=>{var t,n,r,a;(0,u.$5)(null==e||null==(t=e.body)?void 0:t.requires_confirmation),(0,u.u4)(u.qY.POLL_SIGNUP_DIALOG_SUBMITTED,{poll_id:b,post_id:null==C?void 0:C.id}),w.plans||w.has_recommendations?document.location.href=(0,v.eV6)(w,(0,l._)((0,i._)({utm_medium:_.Jn.web,utm_source:_.VU.pollSubscribeModal,utm_content:C&&C.id,just_signed_up:!0,requires_confirmation:(null==(n=e.body)?void 0:n.requires_confirmation)?"true":""},(null==(r=e.body)?void 0:r.subscription_id)&&{subscription_id:e.body.subscription_id},(null==(a=e.body)?void 0:a.referral_token)&&{referral_token:e.body.referral_token}),{next:(0,v.wu9)(w,C)})):document.location.reload()},children:[(0,a.Y)(h.j,{"aria-label":S("Email"),disabled:!!E.email,name:"email",placeholder:S("Type your email..."),trailing:!!E.email&&(0,a.Y)(o.A,{size:20,stroke:"var(--color-fg-tertiary)"}),value:k,onChange:e=>A(e.currentTarget.value)}),(0,a.Y)("input",{name:"source",type:"hidden",value:"poll-subscribe-modal"}),(0,a.Y)("div",{id:"error-container"})]})}),(0,a.Y)(m.jl,{direction:"column",primaryButton:(0,a.Y)(p.$n,{form:"poll-login-form",priority:"primary",type:"submit",children:S("Subscribe")}),secondaryButton:E.email?void 0:(0,a.FD)(y.EY.B4,{align:"center",as:"span",color:"secondary",children:[S("Already a subscriber?")," ",(0,a.Y)(y.Yq,{color:"accent",href:(0,v.a7q)({for_pub:w.subdomain,redirect:(0,v.wu9)(w,C)}),children:S("Sign in")})]})})]})}},15469:function(e,t,n){n.d(t,{r:()=>u});var i=n(69277),l=n(79785),r=n(4006),a=n(84605),o=n(63136);function s(){let e=(0,l._)([""," DAYS REMAINING"]);return s=function(){return e},e}function d(){let e=(0,l._)(["1 DAY REMAINING"]);return d=function(){return e},e}function c(){let e=(0,l._)([""," HOURS REMAINING"]);return c=function(){return e},e}let u=e=>{let{hasVoted:t,isExpired:n,poll:l,remainingHours:u,showResults:p,user:h,onToggleShowResults:m}=e,{iString:g,iPlural:f,language:y}=(0,a.GO)(),v=(0,i._)({is_contributor:!1,is_author:!1,is_admin:!1},h),_=v.is_contributor||v.is_admin||v.is_author,Y=f("%1 VOTE","%1 VOTES",l.total_votes),b=(e=>{let{isExpired:t,remainingHours:n,language:i}=e,{iString:l,iTemplate:r}=I18N.i(i);if(t)return l("POLL CLOSED");if(n>=168)return"";if(n>=48){let e=Math.floor(n/24);return r(s(),e)}return n>=24?r(d()):n>=2?r(c(),n):l(1==n?"1 HOUR REMAINING":"LESS THAN 1 HOUR REMAINING")})({isExpired:n,remainingHours:u,language:y});return(0,r.FD)(o.EY.Meta,{className:"poll-status",children:[(_||!l.votes_hidden)&&"".concat(Y," \xb7 "),b,_&&!t&&!n&&(0,r.FD)(r.FK,{children:[" \xb7 ",(0,r.Y)("span",{className:"poll-author-visibility-toggle",title:g("Only the author, contributors, and admins may view results before voting."),onClick:()=>{m()},children:g(p?"SHOW OPTIONS":"SHOW RESULTS")})]})]})}},39469:function(e,t,n){n.d(t,{h:()=>s});var i=n(4006),l=n(32485),r=n.n(l),a=n(44471),o=n(17402);let s=e=>{let{id:t,text:n,onVote:l,showVotes:s,currentVotes:d,totalVotes:c,myVote:u,canVote:p}=e,h=(0,o.useCallback)(async()=>{t&&p&&await l(t)},[t,l,p]),m=Math.round(100*(0===c?0:d/c));return(0,i.FD)("div",{className:r()("poll-option",{"show-votes":s,"hide-votes":!s,"can-vote":p,"my-vote":u}),onClick:h,children:[s&&(0,i.Y)("div",{className:"poll-vote-background",style:{width:"".concat(m,"%")}}),(0,i.Y)("div",{className:"poll-option-background",children:(0,i.FD)("div",{className:"poll-option-text",children:[n,s&&u&&(0,i.Y)(a.A,{className:"vote-icon"})]})}),s&&(0,i.FD)("div",{className:"poll-percentage-text",children:[m,"%"]})]})}},31245:function(e,t,n){n.d(t,{j:()=>c});var i=n(17402),l=n(15734),r=n.n(l),a=n(84605),o=n(39318),s=n(9036),d=n(82776);let c=e=>{let{isEditor:t,isVersionView:n,pollId:l,post:c,onFinishSaving:u}=e,{iString:p}=(0,a.GO)(),[h,m]=(0,i.useState)(null!=n&&n),[g,f]=(0,i.useState)(!0),[y,v]=(0,i.useState)(null),[_,Y]=(0,i.useState)(null),b=(0,i.useMemo)(()=>{let e={token:void 0,uuid:void 0};if("undefined"!=typeof window&&!t){var n;let t=(0,s.m)(window.location.href);if(t&&t.token&&(e.token=t.token),!e.token&&(null==(n=window._preloads)?void 0:n.original_url)){let t=(0,s.m)(window._preloads.original_url);t&&t.token&&(e.token=t.token)}}if("undefined"!=typeof window&&!t&&(null==c?void 0:c.is_draft)){let t=(0,o.Gn4)(window.location.href);t&&(0,d.isUUID)(t)&&(e.uuid=t)}return e},[t,null==c?void 0:c.is_draft]),C=(0,i.useCallback)(async function(){let{shouldNotSetLoading:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldNotSetLoading:!1};e||f(!0);try{let e=await r()("/api/v1/poll/".concat(l)).query(b);v(e.body),Y(null)}catch(e){Y(p("We were unable to load this poll. Please refresh the page."))}f(!1)},[l,b,p]),w=(0,i.useCallback)(async e=>{await r().put("/api/v1/poll/".concat(l)).send(e),f(!0),await C(),u()},[C,u,l]),E=(0,i.useCallback)(async e=>{if(!h){m(!0);try{await r().post("/api/v1/poll/".concat(l,"/vote")).send({poll_option_id:e}).query(b),Y(null)}catch(e){Y(p("We were unable to record your vote. Please refresh the page and try again.")),m(!1);return}await C({shouldNotSetLoading:!0}),m(!1)}},[h,C,l,b,p]);return(0,i.useEffect)(()=>{C()},[C]),{error:_,loading:g,poll:y,fetchPoll:C,savePoll:w,voteForOption:E}}},18468:function(e,t,n){n.d(t,{A:()=>o});var i=n(69277),l=n(70408),r=n(4006),a=n(97731);let o=e=>(0,r.Y)(a.A,(0,l._)((0,i._)({strokeLinecap:"round",strokeLinejoin:"round"},e),{name:"LucideStarIcon",svgParams:{height:24,width:24},children:(0,r.Y)("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"})}))},85477:function(e,t,n){n.d(t,{k:()=>h});var i=n(69277),l=n(70408),r=n(4006),a=n(13589),o=n(85612),s=n(57753),d=n(84605),c=n(68349),u=n(76977),p=n(36372);let h=e=>{let{showLinks:t,feedUrl:n,disableLinks:h}=e,{iString:m}=(0,d.GO)(),[g,f]=(0,a.Mk)(),[y,v]=(0,a.Mk)(),[_,Y]=(0,a.Mk)(),b=(0,p.d)(),C={as:"a",cursor:"pointer",rel:"noreferrer noopener",target:"_blank"},w=e=>{h&&e.preventDefault()};return(0,r.FD)(u.Ye,{alignItems:"center",gap:12,children:[t.spotify_url&&(0,r.Y)(u.Ye,(0,l._)((0,i._)({},f,C),{href:t.spotify_url,onClick:w,children:(0,r.Y)(o.MO,{fill:g?"#1DB954":s.Q3.mediumRed.hex,size:20})})),t.apple_podcasts_url&&(0,r.Y)(u.Ye,(0,l._)((0,i._)({},v,C),{href:t.apple_podcasts_url,onClick:w,children:(0,r.Y)(o.uv,{fill:y?"#B53CD9":s.Q3.mediumRed.hex,size:20})})),(0,r.Y)(u.Ye,(0,l._)((0,i._)({},Y),{cursor:"pointer",onClick:e=>{h?e.preventDefault():(b.popToast(()=>(0,r.Y)(p.y,{text:m("RSS feed URL copied")})),(0,c.lW)(n))},children:(0,r.Y)(o.It,{fill:_?"#F88800":s.Q3.mediumRed.hex,size:20})}))]})}},85612:function(e,t,n){n.d(t,{$5:()=>s,It:()=>o,MO:()=>r,uv:()=>a});var i=n(4006),l=n(57753);let r=e=>{let{fill:t=l.Q3.mediumRed.hex,size:n=24,className:r}=e;return(0,i.FD)("svg",{className:r,fill:"none",height:n,viewBox:"0 0 48 48",width:n,xmlns:"http://www.w3.org/2000/svg",children:[(0,i.Y)("g",{clipPath:"url(#fp-spotify-clip)",children:(0,i.Y)("path",{d:"M24.0004 0C10.7456 0 0 10.7454 0 24.0001C0 37.2555 10.7456 48 24.0004 48C37.2567 48 48.0011 37.2555 48.0011 24.0001C48.0011 10.7462 37.2567 0.00114638 24.0001 0.00114638L24.0004 0ZM35.0069 34.6151C34.577 35.3201 33.6541 35.5437 32.9491 35.1109C27.3141 31.6689 20.2202 30.8893 11.8659 32.7981C11.0609 32.9815 10.2584 32.4771 10.075 31.6718C9.89072 30.8664 10.3931 30.0639 11.2002 29.8805C20.3426 27.7918 28.1847 28.6911 34.5111 32.5573C35.2161 32.9901 35.4396 33.9101 35.0069 34.6151ZM37.9445 28.0801C37.4028 28.9605 36.2507 29.2385 35.3708 28.6969C28.9196 24.7315 19.0856 23.5831 11.455 25.8994C10.4653 26.1983 9.42013 25.6406 9.11978 24.6527C8.82172 23.6631 9.37972 22.6199 10.3676 22.319C19.0839 19.6743 29.9198 20.9553 37.3283 25.5079C38.2081 26.0496 38.4861 27.2014 37.9445 28.0801ZM38.1967 21.2752C30.4615 16.6808 17.6993 16.2583 10.314 18.4998C9.12809 18.8595 7.87394 18.19 7.51455 17.004C7.15516 15.8175 7.82408 14.5642 9.01087 14.2037C17.4887 11.6301 31.582 12.1273 40.4877 17.4142C41.5567 18.0473 41.9064 19.4249 41.273 20.4902C40.6425 21.5569 39.2611 21.9086 38.1978 21.2752H38.1967Z",fill:t})}),(0,i.Y)("defs",{children:(0,i.Y)("clipPath",{id:"fp-spotify-clip",children:(0,i.Y)("rect",{fill:"white",height:"48",width:"48"})})})]})},a=e=>{let{fill:t=l.Q3.mediumRed.hex,size:n=24,className:r}=e;return(0,i.Y)("svg",{className:r,fill:"none",height:n,viewBox:"0 0 48 48",width:n,xmlns:"http://www.w3.org/2000/svg",children:(0,i.Y)("path",{d:"M31.521 34.967L30.3181 44.591C30.0745 46.5385 28.4189 48 26.4563 48H22.9493C20.9865 48 19.3309 46.5385 19.0875 44.5908L17.8845 34.9668C17.3717 30.8657 20.5695 27.2432 24.7027 27.2432C21.4837 27.2432 18.8649 24.6244 18.8649 21.4054C18.8649 18.1864 21.4837 15.5676 24.7027 15.5676C27.9217 15.5676 30.5405 18.1864 30.5405 21.4054C30.5405 24.6244 27.9217 27.2432 24.7027 27.2432C28.8359 27.2432 32.0337 30.8657 31.521 34.967ZM24.7027 11.6757C18.6224 11.6757 13.6757 16.6224 13.6757 22.7027C13.6757 24.8942 14.321 26.9367 15.4277 28.6551C14.6322 30.0069 14.1423 31.5165 13.9908 33.0752C11.3883 30.3885 9.78378 26.7298 9.78378 22.7027C9.78378 14.4764 16.4764 7.78378 24.7027 7.78378C32.929 7.78378 39.6216 14.4764 39.6216 22.7027C39.6216 26.7298 38.0171 30.3885 35.4147 33.0754C35.2632 31.5165 34.7732 30.007 33.9779 28.6552C35.0845 26.9367 35.7297 24.8942 35.7297 22.7027C35.7297 16.6224 30.783 11.6757 24.7027 11.6757ZM34.4114 43.2218L35.0104 38.4298C40.1277 35.0645 43.5135 29.2721 43.5135 22.7027C43.5135 12.3304 35.075 3.89189 24.7027 3.89189C14.3304 3.89189 5.89189 12.3304 5.89189 22.7027C5.89189 29.2721 9.27771 35.0645 14.395 38.4298L14.994 43.2218C7.31944 39.5757 2 31.7493 2 22.7027C2 10.1844 12.1844 0 24.7027 0C37.221 0 47.4054 10.1844 47.4054 22.7027C47.4054 31.7493 42.086 39.5757 34.4114 43.2218Z",fill:t})})},o=e=>{let{fill:t=l.Q3.mediumRed.hex,size:n=24,className:r}=e;return(0,i.FD)("svg",{className:r,fill:"none",height:n,viewBox:"0 0 48 48",width:n,xmlns:"http://www.w3.org/2000/svg",children:[(0,i.Y)("path",{d:"M32.3208 15.6622C24.7895 8.1309 14.7688 3.98315 4.10449 3.98315V11.8297C12.6729 11.8297 20.7233 15.1611 26.7726 21.2105C32.8219 27.2599 36.1535 35.3103 36.1535 43.8787H44C43.9999 33.2144 39.8521 23.1935 32.3208 15.6622Z",fill:t}),(0,i.Y)("path",{d:"M4.02344 17.2612V25.1077C14.3737 25.1077 22.7944 33.5283 22.7944 43.8788H30.6409C30.6409 29.2018 18.7005 17.2612 4.02344 17.2612Z",fill:t}),(0,i.Y)("path",{d:"M9.59452 44.0969C12.6983 44.0969 15.2144 41.5808 15.2144 38.477C15.2144 35.3732 12.6983 32.8571 9.59452 32.8571C6.49073 32.8571 3.97461 35.3732 3.97461 38.477C3.97461 41.5808 6.49073 44.0969 9.59452 44.0969Z",fill:t})]})},s=e=>{let{fill:t=l.Q3.mediumRed.hex,size:n=24,className:r}=e;return(0,i.Y)("svg",{className:r,fill:"none",height:n,viewBox:"0 0 48 48",width:n,xmlns:"http://www.w3.org/2000/svg",children:(0,i.Y)("path",{clipRule:"evenodd",d:"M39.231 6.36788C47.031 6.89888 47.94 11.6299 48 23.9989C47.94 36.3889 47.022 41.0989 39.228 41.6299C32.019 42.1219 15.966 42.1189 8.769 41.6299C0.969 41.0989 0.06 36.3679 0 23.9989C0.06 11.6089 0.977999 6.89888 8.772 6.36788C15.969 5.87888 32.022 5.87588 39.231 6.36788ZM33.999 23.9839L18 15.9979V31.9999L33.999 23.9839Z",fill:t,fillRule:"evenodd"})})}},60294:function(e,t,n){n.d(t,{D:()=>o});var i=n(4006),l=n(78836),r=n(15894),a=n(76977);let o=e=>{let{poll:t}=e;return(0,i.Y)(l.m,{children:(0,i.FD)(a.I1,{gap:16,children:[(0,i.Y)(r.T,{preset:"h5-sans",children:(null==t?void 0:t.question)||"New Poll"}),(null==t?void 0:t.description)&&(0,i.Y)(r.T,{preset:"d2-serif",children:t.description})]})})}},49386:function(e,t,n){n.d(t,{h:()=>o});var i=n(4006),l=n(78836),r=n(15894),a=n(84605);let o=e=>{let{hasVoted:t,poll:n,user:o}=e,{iPlural:s}=(0,a.GO)();return(!n.votes_hidden||o.is_contributor)&&(t||o.is_contributor)?(0,i.Y)(l.m,{children:(0,i.Y)(r.T,{color:"tertiary",preset:"detail-large",children:s("%1 VOTE","%1 VOTES",n.total_votes)})}):null}},66710:function(e,t,n){n.d(t,{H:()=>h});var i=n(4006),l=n(32485),r=n.n(l),a=n(45773),o=n(17402),s=n(78836),d=n(15894),c=n(76977);let u="text-QBNtOV",p=["#7491e3","#f69227","#f74701","#f3c82e","#2db750","#0366f3","#bebdb8"],h=e=>{let{currentVotes:t,hasVoted:n,id:l,index:h,myVote:m,showVotes:g,text:f,totalVotes:y,onVote:v}=e,_=Math.round(100*(0===y?0:t/y)),Y=p[h%p.length],b=(0,o.useCallback)(async()=>{!n&&l&&await v(l)},[n,l,v]);return(0,i.Y)(s.m,{children:(0,i.FD)(c.Ye,{className:r()("container-ZEro8t",{"containerCanVote-zhAHHo":!n}),cursor:n?void 0:"pointer",justifyContent:n?"space-between":"center",padding:16,position:"relative",onClick:b,children:[g&&(0,i.Y)("div",{className:"percentageBackground-AahPjX",style:{width:"".concat(_,"%"),backgroundColor:Y}}),(0,i.Y)(d.T,{className:u,preset:"detail-large",children:f}),g&&(0,i.FD)(c.Ye,{alignItems:"center",gap:8,children:[m&&(0,i.Y)(c.Ye,{alignItems:"center",className:u,children:(0,i.Y)(a.A,{size:16})}),(0,i.FD)(d.T,{className:u,preset:"detail-large",children:[_,"%"]})]})]})})}},80573:function(e,t,n){n.d(t,{T:()=>p});var i=n(4006),l=n(23942),r=n(85477),a=n(78836),o=n(15894),s=n(83027),d=n(84297),c=n(84605),u=n(76977);let p=e=>{let{disableLinks:t,feedUrl:n,isEditingTitle:p,onCancelTitle:h,onEditTitle:m,onSaveTitle:g,post:f,showLinks:y,youtubeUrl:v}=e,{iString:_}=(0,c.GO)(),{title:Y,canonical_url:b}=f,C=(0,d.a)(f),w="podcast"===f.type,E=!!f.video_upload_id,T=w&&(y||n),S=E&&v,I=null;return T?I=_("Listen on"):S&&(I=_("Watch on youtube")),(0,i.Y)(a.m,{children:(0,i.FD)(u.I1,{gap:8,children:[(0,i.Y)(o.T,{color:"accent",preset:"detail-large",children:C}),p?(0,i.Y)(u.I1,{padding:8,children:(0,i.Y)(l.w,{initialValue:Y,placeholder:_("Edit title..."),onCancel:h,onSave:g})}):(0,i.Y)("a",{href:b,rel:"noopener",target:"_blank",onClick:e=>{t&&e.preventDefault()},children:(0,i.Y)(o.T,{className:"link-LXCHWO",preset:"h7-serif",style:{cursor:"pointer"},onClick:null!=m?m:void 0,children:Y})}),(T||S)&&I&&(0,i.Y)("div",{className:"mediaLinks-a_pTok",children:(0,i.FD)(u.Ye,{alignItems:"center",gap:8,children:[(0,i.Y)(o.T,{color:"accent",preset:"detail-large",children:I}),w&&y&&n&&(0,i.Y)(r.k,{disableLinks:t,feedUrl:n,showLinks:y}),E&&!T&&v&&(0,i.Y)(s.K,{disableLinks:t,youtubeUrl:v})]})})]})})}},40818:function(e,t,n){n.d(t,{Z:()=>u});var i=n(4006),l=n(23942),r=n(63446),a=n(85477),o=n(83027),s=n(84605),d=n(76977);let c={button:"button-PdemLh",ctaWrapper:"ctaWrapper-tPnWzu",mediaLinks:"mediaLinks-z5OJrN"},u=e=>{let{buttonSize:t,cta:n,disableLinks:u,feedUrl:p,handleCancelCta:h,handleEditCta:m,handleSaveCta:g,href:f,isEditingCta:y,post:v,showLinks:_,youtubeUrl:Y}=e,{iString:b}=(0,s.GO)(),C="podcast"===v.type,w=!!v.video_upload_id,E=C&&(_||p),T=w&&Y,S=n;return E?S=b("Listen on"):T&&(S=b("Watch on youtube")),(0,i.Y)(d.Ye,{alignItems:"center",className:c.footerRow,justifyContent:"space-between",children:(0,i.FD)("div",{className:c.ctaWrapper,onClick:y?void 0:null!=m?m:void 0,children:[y?(0,i.Y)(l.w,{initialValue:n,placeholder:b("Edit CTA..."),onCancel:h,onSave:g}):(0,i.Y)(r.v,{className:c.button,href:f,justifyContent:"start",renderAsLink:!0,size:t,trailingIcon:"chevron-right",variant:"tertiary",onClick:u?e=>{e.preventDefault()}:void 0,children:S}),(E||T)&&(0,i.FD)("div",{className:c.mediaLinks,children:[C&&_&&p&&(0,i.Y)(a.k,{disableLinks:u,feedUrl:p,showLinks:_}),w&&!E&&Y&&(0,i.Y)(o.K,{disableLinks:u,youtubeUrl:Y})]})]})})}},4591:function(e,t,n){n.d(t,{j:()=>h});var i=n(4006),l=n(12018),r=n(23942),a=n(33764),o=n(40818),s=n(51246),d=n(78836),c=n(15894),u=n(84605),p=n(76977);let h=e=>{let{caption:t,cta:n,disableLinks:h,feedUrl:m,isEditingCaption:g,isEditingCta:f,isEditingTitle:y,onCancelCaption:v,onCancelCta:_,onCancelTitle:Y,onEditCaption:b,onEditCta:C,onEditTitle:w,onSaveCaption:E,onSaveCta:T,onSaveTitle:S,post:I,showBylines:k,showLinks:A,youtubeUrl:D}=e,{iString:O}=(0,u.GO)(),{publishedBylines:x,title:P,canonical_url:R,cover_image:L,cover_image_alt:F}=I;return(0,i.Y)(d.m,{children:(0,i.FD)(p.I1,{children:[(0,i.Y)(p.I1,{paddingBottom:12,children:y?(0,i.Y)(p.I1,{padding:8,children:(0,i.Y)(r.w,{initialValue:P,placeholder:O("Edit title..."),onCancel:Y,onSave:S})}):(0,i.Y)("a",{href:R,rel:"noopener",target:"_blank",onClick:e=>{h&&e.preventDefault()},children:(0,i.Y)(c.T,{preset:"h5-sans",onClick:null!=w?w:void 0,children:P})})}),(0,i.Y)(p.I1,{paddingBottom:12,children:k&&(0,i.Y)(s.Z,{bylines:x})}),L&&(0,i.Y)(p.I1,{paddingBottom:16,children:(0,i.Y)("a",{href:R,rel:"noopener",target:"_blank",onClick:e=>{h&&e.preventDefault()},children:(0,i.Y)(a.o,{alt:null!=F?F:P,imageProps:{height:Math.round(650),smartCrop:!0},maxWidth:1300,src:L})})}),(0,i.Y)(p.pT,{flex:"grow",paddingBottom:8,children:(0,i.Y)("div",{className:"captionContainer-e38vU2",children:g&&v&&E?(0,i.Y)(p.I1,{paddingX:8,children:(0,i.Y)(l.y,{initialCaption:t,onCancel:v,onSave:E})}):(0,i.Y)("p",{dangerouslySetInnerHTML:{__html:t},onClick:null!=b?b:void 0})})}),(0,i.Y)(o.Z,{cta:n,disableLinks:h,feedUrl:m,handleCancelCta:_,handleEditCta:C,handleSaveCta:T,href:R,isEditingCta:f,post:I,showLinks:A,youtubeUrl:D})]})})}},40927:function(e,t,n){n.d(t,{D:()=>f});var i=n(4006),l=n(32485),r=n.n(l),a=n(23942),o=n(33764),s=n(40818),d=n(51246),c=n(78836),u=n(15894),p=n(84605),h=n(68410),m=n(76977),g=n(69706);let f=e=>{let{cta:t,disableLinks:n,feedUrl:l,isEditingCta:f,isEditingTitle:y,onCancelCta:v,onCancelTitle:_,onEditCta:Y,onEditTitle:b,onSaveCta:C,onSaveTitle:w,post:E,showBylines:T,showLinks:S,youtubeUrl:I}=e,{iString:k}=(0,p.GO)(),{isMobile:A}=(0,h.sM)(),{publishedBylines:D,title:O,canonical_url:x,cover_image:P,cover_image_alt:R}=E;return(0,i.Y)(c.m,{children:(0,i.FD)(m.Ye,{alignItems:"stretch",gap:16,children:[P&&(0,i.Y)("a",{className:"imageLink-AC6EYn",href:x,rel:"noopener",target:"_blank",onClick:e=>{n&&e.preventDefault()},children:(0,i.Y)(o.o,{alt:null!=R?R:O,className:r()("image-DiWGMJ",{"imageMobile-PivMk8":A}),imageProps:{height:A?180:300,smartCrop:!0,aspect:g.Zi},maxWidth:A?180:300,src:P})}),(0,i.FD)(m.I1,{flex:"grow",gap:8,children:[y?(0,i.Y)(m.I1,{paddingRight:8,paddingY:8,children:(0,i.Y)(a.w,{initialValue:O,placeholder:k("Edit title..."),onCancel:_,onSave:w})}):(0,i.Y)("a",{href:x,rel:"noopener",target:"_blank",onClick:e=>{n&&e.preventDefault()},children:(0,i.Y)(u.T,{preset:"h5-sans",style:n?{}:{cursor:"pointer"},onClick:null!=b?b:void 0,children:O})}),T&&(0,i.Y)(d.Z,{bylines:D}),(0,i.Y)(s.Z,{cta:t,disableLinks:n,feedUrl:l,handleCancelCta:v,handleEditCta:Y,handleSaveCta:C,href:x,isEditingCta:f,post:E,showLinks:S,youtubeUrl:I})]})]})})}},51246:function(e,t,n){n.d(t,{Z:()=>a});var i=n(4006),l=n(38305),r=n(15894);let a=e=>{let{bylines:t}=e;return(null==t?void 0:t.length)?(0,i.Y)(r.T,{color:"tertiary",preset:"detail-large",children:(0,i.Y)(l.K,{array:t||[],formatter:e=>{let{name:t}=e;return t},limit:3})}):null}},47692:function(e,t,n){n.d(t,{n:()=>u});var i=n(4006),l=n(23942),r=n(40818),a=n(51246),o=n(78836),s=n(15894),d=n(84605),c=n(76977);let u=e=>{let{cta:t,disableLinks:n,feedUrl:u,isEditingCta:p,isEditingTitle:h,onCancelCta:m,onCancelTitle:g,onEditCta:f,onEditTitle:y,onSaveCta:v,onSaveTitle:_,post:Y,showBylines:b,showLinks:C,youtubeUrl:w}=e,{iString:E}=(0,d.GO)(),{publishedBylines:T,title:S,canonical_url:I}=Y;return(0,i.Y)(o.m,{children:(0,i.FD)(c.I1,{gap:4,children:[(0,i.FD)(c.I1,{gap:8,children:[h?(0,i.Y)(c.I1,{padding:8,children:(0,i.Y)(l.w,{initialValue:S,placeholder:E("Edit title..."),onCancel:g,onSave:_})}):(0,i.Y)("a",{href:I,rel:"noopener",target:"_blank",onClick:e=>{n&&e.preventDefault()},children:(0,i.Y)(s.T,{preset:"h5-sans",onClick:null!=y?y:void 0,children:S})}),b&&(0,i.Y)(a.Z,{bylines:T})]}),(0,i.Y)(r.Z,{buttonSize:"sm",cta:t,disableLinks:n,feedUrl:u,handleCancelCta:m,handleEditCta:f,handleSaveCta:v,href:I,isEditingCta:p,post:Y,showLinks:C,youtubeUrl:w})]})})}},83027:function(e,t,n){n.d(t,{K:()=>o});var i=n(4006),l=n(85612),r=n(57753),a=n(76977);let o=e=>{let{youtubeUrl:t,disableLinks:n}=e;return t?(0,i.Y)(a.Ye,{alignItems:"center",as:"a",gap:8,href:t,rel:"noopener noreferrer",target:"_blank",onClick:e=>{n&&e.preventDefault()},children:(0,i.Y)(l.$5,{fill:r.Q3.mediumRed.hex,size:24})}):null}},12895:function(e,t,n){n(4006),n(33727),n(76977),n(63136)},17744:function(e,t,n){n.d(t,{m:()=>s});var i,l,r=n(17402);let a="undefined"!=typeof window&&null!=(l=null==(i=window._preloads)?void 0:i.freeSignup)&&l,o=(0,r.createContext)(a);function s(){return(0,r.useContext)(o)}o.displayName="FreeSignupContext"},42503:function(e,t,n){n.d(t,{A:()=>d});var i=n(4006),l=n(15734),r=n.n(l),a=n(26364),o=n(84605),s=n(36372);let d=e=>{var t;let{videoPlayerRef:n,videoUpload:l,active:d,onCancel:c,onUpdate:u}=e,p=(0,s.d)(),{iString:h}=(0,o.GO)(),m=async e=>{n&&setTimeout(()=>n.pause(),100);try{let t={thumbnail_time:e.time},n=await r().put("/api/v1/video/upload/".concat(l.id,"/thumbnail_time")).send(t);return u(n.body),p.popToast(()=>(0,i.Y)(s.y,{text:h("Thumbnail successfully updated")})),e}catch(e){console.error(e),p.popToast(()=>(0,i.Y)(s.y,{text:h("Error setting thumbnail")}))}},g=(null!=(t=l.thumbnail_id)?t:0)/100;return d?(0,i.Y)(a.E,{videoPlayerRef:n,onCancel:c,onSubmit:m,onSubmitLabel:h("Set thumbnail"),initialTime:g}):null}},60005:function(e,t,n){n.d(t,{A:()=>et});var i=n(69277),l=n(70408),r=n(4006),a=n(32485),o=n.n(a),s=n(16858),d=n(56195),c=n(81143),u=n(59612),p=n(54718),h=n(48309),m=n(98188),g=n(32708),f=n(46110),y=n(17402),v=n(15734),_=n.n(v),Y=n(23623),b=n(78865),C=n(33764),w=n(41873),E=n(84605),T=n(85478),S=n(73484),I=n(84810),k=n(79994),A=n(90827),D=n(26289),O=n(86500),x=n(94729),P=n(74049),R=n(13022),L=n(12501),F=n(68349),N=n(47885),B=n(89490),U=n(35369),M=n(16074),H=n(76977),W=n(44552),G=n(45859),z=n(37598),V=n(57820),j=n(63136),q=n(36372),X=n(95187),K=n(13348),Q=n(39318),J=n(69706),Z=n(44366);let $=(0,B.I4)({position:"relative",alignItems:"center"}),ee=(0,B.I4)({display:"flex",overflowX:"auto",scrollBar:"hidden",cursor:"grab",gap:8}),et=e=>{var t,n,a,v,et;let{videoPlayer:en,pub:ei,postId:el,mediaUpload:er,audioExtractMediaUpload:ea,onOpenThumbnail:eo,onThumbnailUpdated:es,onOpenFreePreview:ed,onRemoveFreePreview:ec,onOpenSettings:eu,onRemoveMedia:ep,active:eh,onSelected:em,onDownloadStarted:eg,onDownloadFinished:ef,onOpenVideoSettings:ey}=e,[ev,e_]=(0,y.useState)(),[eY,eb]=(0,y.useState)(!1),eC=(0,y.useRef)(null),{iString:ew}=(0,E.GO)(),{setIsPodcastDrawerOpen:eE,isPodcastDrawerOpen:eT,setInitialTab:eS}=(0,I.L)(),{setIsDrawerOpen:eI}=(0,S.gJ)(),{getConfigFor:ek}=(0,T.mJ)(),eA=(0,F.rr)(),eD=(0,q.d)(),eO=(0,P.k7)(er),ex=(0,D.sY)(en),{postMediaComposition:eP}=(0,k.X)(),[eR,eL]=(0,y.useState)(!1),[eF,eN]=(0,y.useState)(!1),[eB,eU]=(0,y.useState)(null),eM=(0,y.useRef)(null),eH=(0,W.h9)(eM),{state:eW,handleArrowClick:eG}=(0,X.jA)(eM),ez=!!er.live_stream_id,{result:eV,isLoading:ej}=(0,L.st)({pathname:"/api/v1/video/upload/".concat(er.id,"/thumbnail_selection_options"),auto:ez,deps:[er.id]}),eq=null!=(n=null==eV?void 0:eV.options)?n:[],eX=eq.length>0;(0,y.useEffect)(()=>{eX&&"thumbnail"===ev&&(0,O.u4)(O.qY.LIVE_STREAM_AUTO_THUMBNAIL_OPTIONS_VIEWED,{media_upload_id:er.id,live_stream_id:er.live_stream_id,post_id:er.post_id,option_count:eq.length})},[eX,ev,er.id,er.live_stream_id,er.post_id,eq.length]),(0,y.useEffect)(()=>{null==em||em(ev)},[em,ev]);let eK=()=>{if(null==en?void 0:en.player){let e=en.player;e.pause(),e.currentTime=0;let t=e.src;e.src="",e.load(),e.src=t}},eQ=async()=>{var e,t;if((0,O.u4)(O.qY.EDITOR_MEDIA_SET_THUMBNAIL_UPLOAD_IMAGE_CLICKED,{media_upload_id:er.id,post_id:er.post_id}),!(null==eC||null==(t=eC.current)||null==(e=t.files)?void 0:e.length)||!eC.current.files[0])return;let n=eC.current.files[0];eb(!0),await eJ(n),eb(!1)},eJ=async e=>{let t=Math.round(new Date().getTime()/1e3);try{await _().put("/api/v1/video/upload/".concat(er.id,"/thumbnail_id")).send({thumbnail_id:t,custom_thumbnail:!0});let n=await _().post("/api/v1/video/upload/".concat(er.id,"/thumbnail_upload_url")).query({fileType:e.type,fileSize:e.size,thumbnail_id:t}),r=n.body.thumbnail_upload_url;await _().put(r).set("content-type",e.type).send(e),(0,F.NN)((0,Q.H10)(n.body.mediaUpload)),es((0,l._)((0,i._)({},n.body.mediaUpload),{updated_at:new Date})),eK()}catch(e){console.error(e);return}},eZ=async e=>{eN(!0);try{let t=await (0,x.x6)("/api/v1/video/upload/".concat(er.id,"/thumbnail_selection"),{method:"PATCH",json:{thumbnail_selection_s3_key:e}});es((0,l._)((0,i._)({},er),{thumbnail_id:t.thumbnail_id,updated_at:new Date})),eK(),eD.popToast(()=>(0,r.Y)(q.y,{text:ew("Thumbnail updated")})),(0,O.u4)(O.qY.LIVE_STREAM_AUTO_THUMBNAIL_APPLIED,{media_upload_id:er.id,live_stream_id:er.live_stream_id,post_id:er.post_id,thumbnail_id:t.thumbnail_id,thumbnail_s3_key:e})}catch(e){console.error(e),eD.popToast(()=>(0,r.Y)(q.y,{text:ew("Failed to update thumbnail")}))}finally{eN(!1),null==em||em(void 0),eU(null)}},e$=(0,Q.dJ9)(null!=(a=(0,Q.H10)(er))?a:"",720,{aspect:J.fo,crop:"fill",gravity:"auto"}),e0=async()=>{if(ea){null==eg||eg(),eL(!0);try{let{body:e}=await _().get("/api/v1/audio/upload/".concat(ea.id,"/download-url.json"));if(!e.available)return void eD.popToast(()=>(0,r.Y)(q.y,{text:ew("Download not available yet. Please try again later.")}));(0,P.TB)(e.url)}catch(e){alert((0,F.uX)(e))}finally{eL(!1),null==ef||ef()}}},e1=!!(null==(t=er.liveStream)?void 0:t.is_rtmp);return eh?(0,r.FD)(Y.a,{children:[(0,r.FD)(H.I1,{gap:8,alignItems:"end",position:"absolute",wrap:"wrap",className:Z.A.verticalMenu,children:[eu&&(0,r.Y)(A.P,{label:ew("Clips"),children:(0,r.Y)(A.X,{onClick:()=>{eE({isOpen:!eT}),eT||(eS("clips"),null==eu||eu({tab:"clips"}))},children:(0,r.FD)(r.FK,{children:[(0,r.Y)(C.o,{src:(0,Q.Pzx)(er),maxWidth:40,radius:"full",imageProps:{height:40,smartCrop:!0},style:{border:"2px solid white"},className:Z.A.clipIcon}),(0,r.Y)(H.pT,{position:"absolute",children:(0,r.Y)(s.A,{size:16,stroke:"white"})})]})})},"".concat(er.id,"_clips")),eu&&(0,r.Y)(A.P,{label:ew("Open Settings"),children:(0,r.Y)(A.X,{onClick:()=>{ek("video_editor_full_screen")?eI({drawerId:"videoEditor",isOpen:!0}):(eE({isOpen:!eT}),eT||eu())},children:(0,r.Y)(d.A,{size:16})})},"".concat(er.id,"_settings")),ed&&ec&&(0,r.Y)(A.P,{label:ew("Free preview"),children:er.preview_duration?(0,r.Y)(G.W1,{onClose:()=>e_(void 0),onOpen:()=>e_("preview"),trigger:(0,r.Y)(A.X,{children:(0,r.Y)(c.A,{size:16})}),children:(0,r.FD)(H.I1,{gap:8,padding:8,justifyContent:"center",children:[(0,r.Y)(H.Ye,{className:Z.A.videoPlaceholder,justifyContent:"center",alignItems:"center",children:(0,r.FD)("div",{className:o()("video-editor-menu",Z.A.videoEditorMenu),children:[(0,r.Y)(w.A,{mediaUpload:er,pub:ei,autoPlay:!1,usePreview:!0,surface:"editor",contentType:"post",videoType:"post",entityKey:String(null!=el?el:null==er?void 0:er.post_id),entityType:"post",renderPlayButton:()=>(0,r.Y)(K.ro,{isPlaying:!1,size:eA?40:56})}),(0,r.Y)(N.Y,{duration:er.preview_duration})]})}),(0,r.FD)(y.Fragment,{children:[(0,r.Y)(U.$n,{priority:"secondary",onClick:()=>{ed(),e_(void 0)},children:ew("Edit preview")}),(0,r.Y)(U.$n,{priority:"destructive",disabled:!er.preview_duration,onClick:()=>{ec(),e_(void 0)},children:ew("Remove preview")})]})]})}):(0,r.Y)(A.X,{onClick:ed,children:(0,r.Y)(c.A,{size:16})})},"".concat(er.id,"_preview")),(0,r.Y)(A.P,{label:ew("Edit thumbnail"),children:(0,r.Y)(z.A,{align:"end",onClose:()=>{e_(void 0),eU(null)},onOpen:()=>e_("thumbnail"),trigger:(0,r.Y)(A.X,{children:(0,r.Y)(u.A,{size:16})}),children:e=>{let{close:t}=e;return(0,r.FD)(H.I1,{gap:8,padding:8,justifyContent:"center",children:[(0,r.FD)(H.I1,{gap:8,children:[(0,r.Y)(B.az,{position:"relative",className:Z.A.thumbnailPreviewContainer,children:eY||eF?(0,r.Y)(H.Ye,{className:Z.A.loadingPlaceholder,justifyContent:"center",alignItems:"center",children:(0,r.Y)(V.y$,{})}):(0,r.Y)("img",{className:Z.A.thumbnailPicture,src:eB?eB.imginary_url:e$})}),eX&&(0,r.Y)(U.$n,{priority:"primary",size:"md",disabled:!eB||eF,loading:eF,onClick:async()=>{eB&&(await eZ(eB.s3_key),t())},className:Z.A.fullWidthButton,children:ew("Apply")})]}),eX&&(0,r.FD)(H.I1,{gap:4,children:[(0,r.Y)(j.EY.B5,{color:"secondary",weight:"medium",children:ew("Auto-generated options")}),ej?(0,r.Y)(H.Ye,{justifyContent:"center",padding:8,children:(0,r.Y)(V.y$,{})}):(0,r.FD)($,{children:[(0,r.Y)(ee,(0,l._)((0,i._)({ref:eM},eH.props),{className:Z.A.thumbnailOptionsCarousel,children:eq.map(e=>{let t=(null==eB?void 0:eB.s3_key)===e.s3_key;return(0,r.Y)(B.az,{as:"button",type:"button",radius:"sm",overflow:"hidden",border:t?"accent":"detail",cursor:"pointer",onClick:()=>{eU(e),(0,O.u4)(O.qY.LIVE_STREAM_AUTO_THUMBNAIL_PREVIEWED,{media_upload_id:er.id,live_stream_id:er.live_stream_id,post_id:er.post_id,thumbnail_s3_key:e.s3_key})},className:o()(Z.A.thumbnailOptionItem,t&&Z.A.thumbnailOptionItemSelected),children:(0,r.Y)("img",{src:e.imginary_url,alt:"",className:Z.A.thumbnailOptionImage})},e.s3_key)})})),(0,r.Y)(b.mA,{direction:"left",visible:eW.showLeft,onClick:eG(-1)}),(0,r.Y)(b.mA,{direction:"right",visible:eW.showRight,onClick:eG(1)})]})]}),(0,r.FD)(H.I1,{gap:8,children:[(0,r.FD)(U.$n,{priority:"secondary",disabled:eY||eF,children:[ew("Upload image"),(0,r.Y)("input",{type:"file",accept:"image/*",className:Z.A.customThumbnailInput,onChange:()=>eQ(),ref:eC})]}),(0,r.Y)(U.$n,{priority:"secondary",disabled:eY||eF,onClick:()=>{(0,O.u4)(O.qY.EDITOR_MEDIA_SET_THUMBNAIL_FROM_TIMELINE_CLICKED,{media_upload_id:er.id,post_id:er.post_id}),eo(),t()},children:ew("Select from timeline")})]})]})}})},"".concat(er.id,"_thumbnail")),(0,r.Y)(A.P,{label:ew("More"),children:(0,r.FD)(G.W1,{align:"end",onOpen:()=>e_("more"),onClose:()=>e_(void 0),trigger:(0,r.Y)(A.X,{disabled:eR,children:eR?(0,r.Y)(V.y$,{size:32}):(0,r.Y)(p.A,{size:16})}),children:[(0,r.Y)(G.Dr,{leading:(0,r.Y)(h.A,{}),onClick:async()=>{null==eg||eg(),await eO.startDownload(),null==ef||ef()},children:ew("Download video")}),ea&&(0,r.Y)(G.Dr,{leading:(0,r.Y)(h.A,{}),onClick:e0,children:ew("Download audio")}),(0,r.Y)(R.XA,{configKey:"use_livestream_post_media_composition",value:!0,children:eP&&ey&&!e1&&(0,r.Y)(G.Dr,{leading:(0,r.Y)(m.A,{size:16}),onClick:()=>{null==ey||ey()},children:ew("Edit video")})}),eP&&ey&&(0,r.Y)(M.c,{paddingY:4}),ep&&(0,r.Y)(G.Dr,{leading:(0,r.Y)(g.A,{}),priority:"destructive",onClick:()=>{(0,O.u4)(O.qY.EDITOR_MEDIA_REMOVE_CLICKED,{media_upload_id:er.id,post_id:er.post_id}),ep()},children:ew("Delete video")})]})},"".concat(er.id,"_more"))]}),!ex&&(0,r.Y)(N.Y,{duration:null!=(v=er.duration)?v:0,icon:er.preview_duration?(0,r.Y)(c.A,{stroke:"white",size:12}):null,previewDuration:null!=(et=er.preview_duration)?et:null},"".concat(er.id,"_duration")),(0,r.Y)(R.XA,{configKey:"use_livestream_post_media_composition",value:!0,children:eP&&ey&&!e1&&(0,r.Y)(H.pT,{position:"absolute",style:{left:16,top:16},children:(0,r.Y)(U.$n,{size:"sm",priority:"secondary",leading:(0,r.Y)(f.A,{size:16}),onClick:()=>{null==ey||ey()},children:ew("Edit video effects")})})})]},"".concat(er.id,"_container")):null}},72945:function(e,t,n){n.d(t,{J:()=>er,s:()=>ei});var i=n(69277),l=n(70408),r=n(32641),a=n(4006),o=n(32708),s=n(82853),d=n(42691),c=n(49436),u=n(48309),p=n(84934),h=n(70010),m=n(93540),g=n(80964),f=n(33167),y=n(54718),v=n(47796),_=n(57157),Y=n(17402),b=n(41935),C=n(94090),w=n(82936),E=n(58050),T=n(84605),S=n(40691),I=n(85478),k=n(46271),A=n(27749),D=n(75051),O=n(75840),x=n(86500),P=n(94729),R=n(12501),L=n(68349),F=n(35369),N=n(76977),B=n(45859),U=n(19832),M=n(51177),H=n(36372),W=n(52145),G=n(504),z=n(5180),V=n(83629),j=n(46453),q=n(2481),X=n(16291),K=n(56262),Q=n(39318),J=n(70189),Z=n(49807),$=n(82776),ee=n(57324),et=n(44307);let en=e=>{let{item:t,parentItem:n}=e;if(!t.comment&&!t.post)return null;let i=null;if("post"in t&&("post"===t.type||(null==n?void 0:n.type)==="post_reply"))i=t.post.id;else if((null==n?void 0:n.type)==="note_reply"){var l;let e=null==(l=t.parentComments[0])?void 0:l.id;e&&(i=e)}else i=t.comment.id;return i?{id:i,type:"post"in t&&("post"===t.type||(null==n?void 0:n.type)==="post_reply")?"post":"comment"}:null};function ei(e){var t,n,i,l,r,v,_,b;let{publication:j,post:ei,comment:er,item:ea,parentItem:eo,allowHide:es=!1,size:ed="sm"}=e,ec=(0,H.d)(),{getConfigFor:eu}=(0,I.mJ)(),ep=(0,A.PK)(),eh=(0,O.T)(),em=(0,z.wA)(),eg=(0,z.Ro)(),{iString:ef}=(0,T.GO)(),[ey,ev]=(0,Y.useState)(!1),[e_,eY]=(0,Y.useState)(!1),eb=(0,k.Jd)(),{openModal:eC}=(0,S.hS)(),ew=null!=(_=null==er||null==(t=er.ancestor_path)?void 0:t.split(".").filter(Boolean).map(Number).map(e=>eg.comments.get(e)))?_:[],eE=(null==ea?void 0:ea.type)==="post"?null==(n=ea.context.users[0])?void 0:n.id:void 0,eT=er?(0,K.getCommentAuthor)(er):j&&ei?(0,K.getPostAuthor)(j,ei,{preferredUserId:eE}):{id:0,name:"void"},eS=ea&&"entity_key"in ea?ea.entity_key:void 0,eI=(0,w.bd)(eT,{surface:ep,noteId:eS,onClick(e){ea&&(0,G.Qb)(ea,ep,e,{tabId:eh})}}),ek=(0,C.a2)({comment:er,publication:j,post:ei,item:ea}),eA=(0,E.A)(eT,ep,eS),eD=(0,R.st)({pathname:"/api/v1/comment/".concat(null!=(b=null==er?void 0:er.id)?b:0),method:"DELETE",json:{publication_id:null==j?void 0:j.id}}),eO=async()=>{if(!er||(ev(!1),eD.isLoading))return;let e=await eD.refetch();e instanceof Error?alert((0,L.uX)(e)):(ec.popToast(()=>(0,a.Y)(H.y,{text:ef("Note deleted"),Icon:o.A})),em({type:"comment_delete",payload:{publication:null!=j?j:void 0,post:null!=ei?ei:void 0,comment:er}}))},ex=(0,q.NP)(),eP=async()=>{er&&ex.open({editComment:er,tabId:eh,surface:ep,editingUserId:null==eb?void 0:eb.id})},eR=ea&&"post"===ea.type&&ea.mediaClip?ea.mediaClip:void 0,eL=async(e,t)=>{await (0,P.x6)("/api/v1/comment/".concat(e.id,"/juice"),{method:"POST",json:{times_to_show:t}}),ec.popToast(()=>(0,a.Y)(H.y,{text:ef("Juiced"),Icon:d.A})),eY(!1)},eF=async(e,t)=>{let n,i=en({item:e,parentItem:eo});if(!i)return;switch(t){case"1hour":n=1;break;case"8hours":n=8;break;case"24hours":n=24}let l=n?{expires_at:(0,X.A)().add(n,"hour").toISOString()}:{},{id:r,type:o}=i;await (0,P.x6)("/api/v1/notification_settings/".concat(o,"/").concat(r,"/mute"),{method:"POST",json:l}),em({type:"item_pause_notifications",payload:{entityKey:e.entity_key}}),ec.popToast(()=>(0,a.Y)(H.y,{text:ef("Paused"),Icon:c.A}))},eN=async e=>{let t=en({item:e,parentItem:eo});if(!t)return;let{id:n,type:i}=t;await (0,P.x6)("/api/v1/notification_settings/".concat(i,"/").concat(n,"/mute"),{method:"DELETE"}),em({type:"item_unpause_notifications",payload:{entityKey:e.entity_key}}),ec.popToast(()=>(0,a.Y)(H.y,{text:ef("Unpaused"),Icon:c.A}))},eB=async()=>{try{if(!er)return void ec.popToast(()=>(0,a.Y)(H.y,{text:ef("Error starting workflow: comment not found")}));let{workflowId:e}=await (0,P.x6)("/api/v1/comment/".concat(er.id,"/workflow"),{method:"POST",json:{}});ec.popToast(()=>(0,a.Y)(H.y,{text:"Workflow started with id ".concat(e)}))}catch(e){ec.popToast(()=>(0,a.Y)(H.y,{text:"Error starting workflow: ".concat(e)}))}},eU=(0,R.st)({pathname:"/api/v1/video/assets/clips/".concat(null==eR?void 0:eR.id),method:"DELETE"}),eM=async()=>{if(!eR||eU.isLoading)return;let e=await eU.refetch();e instanceof Error?alert((0,L.uX)(e)):(ec.popToast(()=>(0,a.Y)(H.y,{text:ef("Clip deleted"),Icon:o.A})),em({type:"clip_delete",payload:{mediaClip:eR,author:eT}}))},eH=es&&ea&&"entity_key"in ea&&eb&&eb.id!==eT.id,eW=eb&&eb.id===eT.id,eG=eb&&!!(null==ea||null==(i=ea.post)?void 0:i.publishedBylines.find(e=>e.id===eb.id)),ez=eb&&(null==eo?void 0:eo.type)==="note_reply"&&(null==ea||null==(l=ea.parentComments[0])?void 0:l.user_id)===eb.id,eV=(eW||eG||ez)&&(null==ea?void 0:ea.type)&&["comment","post"].includes(ea.type),ej=[(0,a.Y)(B.Dr,{leading:(0,a.Y)(s.A,{}),onClick:()=>{let e={r:(0,$.userReferralKey)(eb),utm_source:ee.VU.notesShareAction,utm_medium:ee.Jn.web},t=er?(0,Z.Zgx)(er,{urlParams:e}):ei?(0,Z.q$n)(j,ei,{mediaClip:eR,urlParams:e}):null;(0,L.lW)(t),ec.popToast(()=>(0,a.Y)(H.y,{text:ef("Copied link to clipboard"),Icon:s.A})),(0,x.u4)(x.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:ef("Copy link")}),!er&&ei&&(0,a.Y)(el,{post:ei,item:ea,feedSurface:ep,tabId:eh}),...eA,er?(0,a.Y)(B.Dr,{leading:(0,a.Y)(u.A,{}),onClick:()=>{eC({children:(0,a.Y)(D.Y,{comment:er}),width:540})},children:ef("Save as image")}):null].filter(Boolean),eq=[(0,$.canEditComment)(eb,er)&&(0,a.Y)(B.Dr,{leading:(0,a.Y)(p.A,{}),onClick:eP,children:ef("Edit")}),er&&((null==eb?void 0:eb.is_global_admin)||(null==eb?void 0:eb.id)===er.user_id||eu("show_note_stats_for_all_notes")||(0,$.canManageCommentAsPrimaryUser)(eb,er))?(0,a.Y)(B.Dr,{leading:(0,a.Y)(h.A,{}),href:(0,J.Kg)(er,{noBase:V.Z}),"data-native":!0,children:ef("View stats")}):null].filter(Boolean),eX=(null==ea?void 0:ea.type)&&["comment","post"].includes(ea.type)&&eg.mutedFeedItems.has(ea.entity_key),eK=[eH&&(0,a.Y)(B.Dr,{leading:(0,a.Y)(m.A,{}),onClick:async()=>{try{em({type:"item_hide",payload:{entityKey:ea.entity_key}}),await (0,P.x6)("/api/v1/note/".concat(ea.entity_key,"/hide"),{method:"POST",json:{tabId:eh,surface:ep}})}catch(e){ec.popToast(()=>(0,a.Y)(H.y,{text:(0,L.uX)(e)}))}},children:(eb.is_admin||eb.is_contributor)&&"post-page-restacks-list"===ep?ef("Hide note from post"):ef("Hide note")}),eV&&(eX?(0,a.Y)(W.MI,{onClick:()=>eN(ea),customLabel:ef("Unpause notifications")}):(0,a.Y)(W.DE,{onMute:e=>eF(ea,e),customLabel:ef("Pause notifications")})),(null==eb?void 0:eb.is_global_admin)&&er&&(null==(v=er.attachments)||null==(r=v[0])?void 0:r.type)==="video"?(0,a.Y)(B.Dr,{leading:(0,a.Y)(g.A,{}),priority:"secondary",onClick:eB,children:ef("Run workflow")}):null,(null==eb?void 0:eb.is_global_admin)&&er?(0,a.Y)(B.Dr,{leading:(0,a.Y)(f.A,{}),priority:"secondary",href:"".concat((0,Q.$_T)({subdomain:"admin"}),"/comments/").concat(er.id),target:"_blank",children:ef("Open in Underground")}):null,(null==eb?void 0:eb.is_global_admin)&&ei&&!er?(0,a.Y)(B.Dr,{leading:(0,a.Y)(f.A,{}),priority:"secondary",href:"".concat((0,Q.$_T)({subdomain:"admin"}),"/posts/").concat(ei.id),target:"_blank",children:ef("Open in Underground")}):null].filter(Boolean),eQ=[...eI,ek,(0,$.canDeleteComment)(eb,er,{pub:null!=j?j:void 0,parentComments:ew})&&(0,a.Y)(B.Dr,{leading:(0,a.Y)(o.A,{}),priority:"destructive",onClick:()=>ev(!0),children:ef("Delete")}),eR&&eW&&(0,a.Y)(B.Dr,{leading:(0,a.Y)(o.A,{}),priority:"destructive",onClick:eM,children:ef("Delete this clip")}),(null==eb?void 0:eb.is_global_admin)&&er?(0,a.Y)(B.Dr,{leading:(0,a.Y)(d.A,{}),priority:"destructive",onClick:async()=>{eY(!0)},children:ef("Juice")}):null].filter(Boolean),eJ=[0!==ej.length&&ej,0!==eq.length&&(0,a.Y)(B.H9,{children:eq}),0!==eK.length&&(0,a.Y)(B.H9,{children:eK}),0!==eQ.length&&(0,a.Y)(B.H9,{children:eQ})];return 0===eJ.length?null:(0,a.FD)(a.FK,{children:[(0,a.Y)(N.ov,{className:et.A.moreButtonContainer,children:(0,a.Y)(B.W1,{trigger:(0,a.Y)(F.K0,{priority:"quaternary",size:ed,className:et.A.moreButton,"aria-label":ef("More options"),children:(0,a.Y)(y.A,{size:16})}),onOpen:()=>{ea&&(0,G.Qb)(ea,ep,"menu",{tabId:eh})},children:eJ})}),(0,a.Y)(U.m,{isOpen:ey,title:ef("Delete note"),description:ef("Are you sure you want to permanently delete this note? This action cannot be undone."),primaryButton:(0,a.Y)(F.$n,{priority:"destructive",onClick:eO,children:ef("Delete")}),secondaryButton:(0,a.Y)(F.$n,{priority:"secondary",onClick:()=>ev(!1),children:ef("Cancel")}),onClose:()=>ev(!1)}),(null==eb?void 0:eb.is_global_admin)&&(0,a.Y)(U.m,{isOpen:e_,title:ef("Juice note"),description:ef("How many additional impressions would you like this note to receive? 100 impressions equals roughly 1-3 likes."),primaryButton:(0,a.FD)(M.t7,{priority:"secondary-outline",size:"md",children:[(0,a.Y)(M.gm,{onClick:async()=>{await eL(er,100)},children:"100"}),(0,a.Y)(M.gm,{onClick:async()=>{await eL(er,500)},children:"500"}),(0,a.Y)(M.gm,{onClick:async()=>{await eL(er,1e3)},children:"1000"})]}),secondaryButton:(0,a.Y)(N.pT,{flex:"grow",children:(0,a.Y)(F.$n,{priority:"secondary",onClick:()=>eY(!1),children:ef("Cancel")})}),onClose:()=>eY(!1)})]})}function el(e){var{post:t,item:n,feedSurface:o,tabId:s}=e,d=(0,r._)(e,["post","item","feedSurface","tabId"]);let c=(0,k.Jd)(),{requireLogin:u}=(0,j.eE)(),p=er(t),{iContext:h}=(0,T.GO)();return(0,a.Y)(B.Dr,(0,l._)((0,i._)({leading:t.is_saved?(0,a.Y)(v.A,{}):(0,a.Y)(_.A,{}),onClick:()=>{c?((null==n?void 0:n.type)==="post"&&(0,G.Qb)(n,o,t.is_saved?"unsave":"save",{tabId:s}),p()):null==u||u({redirectOverride:(0,Z.wu9)(null,t,{urlParams:{triggerSave:!0}})})}},d),{children:t.is_saved?h("Unbookmark a post previously saved for later reading","Unsave"):h("Bookmark a post to read later","Save")}))}function er(e){let t=(0,z.wA)(),n=(0,b.ib)();return()=>{let i=e.id,l=!e.is_saved;(0,b.E0)(i,l,{surface:"reader"}),n(l),t({type:"post_save",payload:{postId:i,isSaved:l}})}}},92905:function(e,t,n){n.d(t,{a:()=>r});var i=n(17402),l=n(86500);function r(e){let t=(0,i.useRef)(Date.now()),n=(0,i.useRef)(new Set),r=(0,i.useCallback)(i=>{if(!e)return;let r=i.currentTarget,a=r.name;!r.value||n.current.has(a)||Date.now()-t.current<1e3||(n.current.add(a),(0,l.u4)("".concat(e," Input Filled"),{name:a}))},[e]);return{trackInputFilled:r,trackSubmitPressed:(0,i.useCallback)(()=>{e&&(0,l.u4)("".concat(e," Submit Pressed"))},[e]),trackError:(0,i.useCallback)(t=>{if(!e)return;let n="Something went wrong";if(t instanceof Error){var i,r;n=(null==(i=t.body)?void 0:i.errors)?JSON.stringify(t.body.errors):(null==(r=t.body)?void 0:r.error)?t.body.error:t.message}(0,l.u4)("".concat(e," Error"),{error:n})},[e])}}},19832:function(e,t,n){n.d(t,{m:()=>r});var i=n(4006),l=n(16993);let r=e=>{let{isOpen:t=!1,title:n,description:r,icon:a,onClose:o,primaryButton:s,secondaryButton:d}=e;return(0,i.FD)(l.aF,{isOpen:t,onClose:o,children:[n&&(0,i.Y)(l.rQ,{title:n,description:r,icon:a}),(0,i.Y)(l.q1,{}),(0,i.Y)(l.jl,{primaryButton:s,secondaryButton:d})]})}},66511:function(e,t,n){n.d(t,{k6:()=>c,fN:()=>d,m_:()=>p,Sr:()=>u});var i=n(4006),l=n(38146),r=n(17402),a=n(49978),o=n(3011),s=n(53168);let d=500,c=8,u=320;function p(e){let{children:t,text:n,title:p,imageUrl:h,leading:m,trailing:g,side:f,disabled:y,delayEnter:v=d}=e,[_,Y]=(0,r.useState)(!1),b=(0,o.a)()?r.Fragment:o.B;return y?(0,i.Y)(i.FK,{children:t}):(0,i.Y)(b,{children:(0,i.FD)(l.bL,{delayDuration:v,open:_,onOpenChange:Y,children:[(0,i.Y)(l.l9,{asChild:!0,children:(0,i.Y)("span",{children:t})}),(0,i.Y)(l.ZL,{children:(0,i.Y)(l.UC,{side:f,sideOffset:c,collisionPadding:c,className:"content-t9D9VH",style:{maxWidth:u,zIndex:s.QW,"--offset":"".concat(c,"px")},children:(0,i.Y)(a.c,{text:n,title:p,imageUrl:h,leading:m,trailing:g})})})]})})}},49978:function(e,t,n){n.d(t,{c:()=>m});var i=n(4006),l=n(17402),r=n(23623),a=n(78649),o=n(33764),s=n(89490),d=n(76977),c=n(63136),u=n(66511),p=n(53168);let h={title:"title-V6r8cy",imageContainer:"imageContainer-UzIosZ",endcapContainer:"endcapContainer-E0pGpX"};function m(e){let{leading:t,trailing:n,text:s,title:d,imageUrl:u,children:p}=e,m=s&&!d&&!u;return(0,i.Y)(r.a,{children:(0,i.Y)(a.Q,{children:(0,i.Y)(_,{children:(0,i.FD)(g,{textOnly:!!m,children:[u&&(0,i.Y)(v,{children:(0,i.Y)(o.o,{src:u,maxWidth:296,useRetinaSizing:!0,imageIsFixedWidth:!0})}),(0,i.FD)(y,{hasTitle:!!d,children:[t&&(0,i.Y)(f,{children:t}),(0,i.FD)(Y,{children:[d&&(0,i.Y)(c.EY.B4,{weight:"medium",color:"primary",className:h.title,children:d}),(0,i.Y)(c.EY.B4,{color:"primary",opacity:80,lineHeight:16,children:"string"==typeof s?s.split("\n").map((e,t)=>(0,i.FD)(l.Fragment,{children:[t>0&&(0,i.Y)("br",{}),e]},t)):s}),p]}),n&&(0,i.Y)(f,{children:n})]})]})})})})}function g(e){let{textOnly:t,children:n}=e;return(0,i.Y)(d.VP,{alignItems:"center",paddingY:t?6:12,paddingX:t?8:12,gap:8,children:n})}function f(e){let{children:t}=e;return(0,i.Y)(d.fI,{alignItems:"center",justifyContent:"center",className:h.endcapContainer,flex:"auto",gap:8,children:t})}function y(e){let{hasTitle:t,children:n}=e;return(0,i.Y)(d.fI,{alignItems:t?"start":"center",gap:8,children:n})}function v(e){let{children:t}=e;return(0,i.Y)(d.VP,{border:"detail",radius:"sm",className:h.imageContainer,overflow:"hidden",children:t})}function _(e){let{children:t}=e;return(0,i.Y)(s.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:t})}let Y=(0,s.I4)({display:"flex",direction:"column",gap:2})},3011:function(e,t,n){n.d(t,{B:()=>d,a:()=>s});var i=n(4006),l=n(38146),r=n(17402),a=n(66511);let o=(0,r.createContext)(!1);function s(){return(0,r.useContext)(o)}function d(e){let{children:t}=e;return(0,i.Y)(l.Kq,{delayDuration:a.fN,skipDelayDuration:300,children:(0,i.Y)(o.Provider,{value:!0,children:t})})}},89955:function(e,t,n){n.d(t,{O:()=>a});var i=n(4006),l=n(68349),r=n(20500);function a(e){let{error:t}=e,n=(0,l.zs)(t);return(null==n?void 0:n.html)?(0,i.Y)(r.yn,{dangerouslySetInnerHTML:{__html:n.html}}):(0,i.Y)(r.yn,{children:(null==n?void 0:n.msg)||"Something went wrong"})}},62088:function(e,t,n){n.d(t,{$P:()=>_,M9:()=>y,dt:()=>Y});var i=n(69277),l=n(70408),r=n(4006),a=n(84605),o=n(76110),s=n(17028),d=n(16993),c=n(84843),u=n(50630),p=n(83842),h=n(23358),m=n(82804),g=n(60689),f=n(11510);function y(e){let{onCancel:t,onSuccess:n,onSignup:i,onUserCreated:l,noCloseButton:a,noExit:s,isOpen:c,redirectOverride:p,overrideTitle:h}=e,m=(0,f.Iu)();return(0,r.Y)(d.aF,{onClose:t,isOpen:c,children:(0,r.FD)(u.W,{children:[(0,r.Y)(v,{onCancel:t,onSuccess:n,onSignup:i,onUserCreated:l,noCloseButton:a,noExit:s,redirectOverride:p,overrideTitle:h}),m&&(0,r.Y)(o.a7,{})]})})}function v(e){let{onCancel:t,onSuccess:n,onSignup:a,onUserCreated:o,noCloseButton:s,noExit:d,redirectOverride:c,overrideTitle:f}=e,{mode:y}=(0,u.r)(),v={overrideTitle:f,noCloseButton:s||d,onCancel:t,onSignup:a};return(0,r.FD)(r.FK,{children:["magic-link"===y&&(0,r.Y)(p.j,(0,l._)((0,i._)({},v),{onSuccess:n})),"email"===y&&(0,r.Y)(h._,(0,l._)((0,i._)({},v),{onUserCreated:o,redirectOverride:c})),"password"===y&&(0,r.Y)(g.d,(0,l._)((0,i._)({},v),{onSuccess:n})),"mfa"===y&&(0,r.Y)(m.Q,{onSuccess:n})]})}let _=e=>{let{overrideTitle:t,noCloseButton:n,onCancel:i,onSignup:l}=e,{iString:o}=(0,a.GO)();return(0,r.Y)(c.rQ,{title:t||o("Sign in to Substack"),description:l?(0,r.FD)(r.FK,{children:[o("First time here? "),(0,r.Y)(s.Yq,{color:"substack",decoration:"hover-underline",onClick:l,cursor:"pointer",children:o("Create account")})]}):void 0,onClose:n?void 0:i,icon:(0,r.Y)(c.Ud,{}),alignItems:"center"})},Y=e=>{let{children:t}=e;return(0,r.Y)(s.VP,{padding:16,borderTop:"detail",children:(0,r.Y)(s.EY.B4,{as:"span",color:"secondary",align:"center",children:t})})}},46647:function(e,t,n){n.d(t,{D:()=>u});var i=n(4006),l=n(84605),r=n(17028),a=n(16291);let o=new Intl.DateTimeFormat(void 0,{timeStyle:"short"}),s=new Intl.DateTimeFormat(void 0,{weekday:"long"}),d=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}),c=new Intl.DateTimeFormat(void 0,{dateStyle:"long"});function u(e){let{timestamp:t,conjunction:n=!1}=e,{iString:u,language:p}=(0,l.GO)(),h=new Date(t),m=(0,a.A)(),g=p.startsWith("en"),f=m.isSame(h,"day")?u("Today"):m.subtract(1,"day").isSame(h,"day")?u("Yesterday"):m.isSame(h,"week")?s.format(h):m.isSame(h,"year")?d.format(h):c.format(h);return(0,i.Y)(r.fI,{alignItems:"center",justifyContent:"center",children:(0,i.FD)(r.EY.B4,{color:"secondary",children:[f,n&&g?" at ":" ",o.format(h)]})})}},41842:function(e,t,n){n.d(t,{K:()=>c});var i=n(69277),l=n(32641),r=n(4006),a=n(16993),o=n(57820),s=n(48239),d=n(97522);function c(e){var{isOpen:t,pub:n=null,profile:c=null,skipRedirectOnExit:u=!1}=e,p=(0,l._)(e,["isOpen","pub","profile","skipRedirectOnExit"]);let{stepConfig:h,contextValue:m,handleOpen:g,handleClose:f,isLoadingSkipStatus:y}=(0,d.F)((0,i._)({isPage:!1,isOpen:t,pub:n,profile:c,skipRedirectOnExit:u},p));return(0,r.Y)(a.aF,{fullscreenMobile:!0,isOpen:t,onOpen:g,onClose:f,width:500,disableCloseOnBackdropClick:!0,children:(0,r.Y)(s.Xf,{value:m,children:y?(0,r.Y)(o.y$,{flex:"grow",minHeight:320}):h.render()})})}},97307:function(e,t,n){n.d(t,{n:()=>d});var i=n(69277),l=n(17402),r=n(46271),a=n(68349),o=n(78979),s=n(92636);function d(){let{user:e}=(0,r.ur)(),[t,n]=(0,l.useState)(!1),[d,c]=(0,l.useState)({}),u=!e&&(0,s.Sg)()&&"undefined"!=typeof window&&"/onboarding"!==window.location.pathname,p=(0,l.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u?(0,a.V2)("/onboarding"):(c(e),n(!0))},[u]),h=(0,l.useCallback)((t,i)=>{c({pub:t,profile:i,initialStep:e?o.dn.CATEGORIES:o.dn.PUB_SIGNUP}),n(!0)},[e]),m=(0,l.useCallback)(e=>{c({pub:e,profile:null,initialStep:o.dn.PUB_SIGNUP}),n(!0)},[]),g=(0,l.useCallback)(()=>{n(!1),c({})},[]);return{modalProps:(0,l.useMemo)(()=>(0,i._)({isOpen:t,onClose:g},d),[t,g,d]),open:p,openForPub:h,openToPubSignup:m,close:g}}},38921:function(e,t,n){n.d(t,{A:()=>v});var i=n(79785),l=n(4006),r=n(17402),a=n(84605),o=n(82772),s=n(35369),d=n(16074),c=n(76977),u=n(45974),p=n(63136),h=n(19718),m=n(39318),g=n(57324);function f(){let e=(0,i._)(["By ",""]);return f=function(){return e},e}function y(e){let{pub:t,selected:n,setSelected:i,onRecommendationFirstVisible:s,index:d}=e,{iTemplate:y}=(0,a.GO)(),v=(0,r.useRef)(null);(0,o.S8)(v,()=>{null==s||s(t,d)},{threshold:.5});let _="".concat((0,m.$_T)(t),"/?utm_source=").concat(g.VU.homepageReaderOnboarding),Y=t.hero_text;return(0,l.FD)(h.V,{ref:v,selected:n,onChange:()=>i(!n),checkboxName:t.name,children:[(0,l.Y)(u.Nq,{pub:t,size:48}),(0,l.Y)(c.VP,{justifyContent:"start",alignItems:"start",gap:2,flex:"grow",minWidth:0,children:(0,l.FD)(c.VP,{flex:"grow",minWidth:0,children:[(0,l.Y)(p.Yq,{href:_,"data-native":!0,target:"_blank",decoration:"hover-underline",onClick:e=>e.stopPropagation(),children:(0,l.Y)(p.EY.B3,{weight:"medium",children:t.name})}),(0,l.Y)(p.EY.B4,{color:"secondary",children:y(f(),t.author_name)}),Y&&(0,l.Y)(p.EY.B4,{color:"secondary",textAlign:"left",children:Y})]})})]})}function v(e){let{publications:t,selected:n,setSelected:i,onRecommendationFirstVisible:o,onToggle:u}=e,{iString:p}=(0,a.GO)(),h=n.lengthi(h?t.map(e=>{let{id:t}=e;return t}):[]),children:p(h?"Select all":"Deselect all")})}),t.map((e,t)=>(0,l.FD)(r.Fragment,{children:[t>0&&(0,l.Y)(d.c,{}),(0,l.Y)(y,{pub:e,selected:n.includes(e.id),setSelected:t=>{t?i([...n.filter(t=>t!==e.id),e.id]):i(n.filter(t=>t!==e.id)),null==u||u(e.id,t)},index:t,onRecommendationFirstVisible:o},e.id)]},e.id))]})}},87833:function(e,t,n){n.d(t,{G:()=>w});var i=n(69277),l=n(70408),r=n(79785),a=n(4006),o=n(85500),s=n(48697),d=n(71464),c=n(17402),u=n(17515);n(12895);var p=n(84605),h=n(35369),m=n(33727),g=n(60322),f=n(97515),y=n(76977),v=n(20500),_=n(23168),Y=n(57820),b=n(63136);function C(){let e=(0,r._)(["","% Complete"]);return C=function(){return e},e}function w(e){var t;let{pub:n,onSuccess:i,onError:l}=e,{iString:r}=(0,p.GO)(),[{files:o,isDragging:s,errors:d},{openFileDialog:u,getInputProps:m,getDragProps:g,removeFile:f}]=(0,_.l)({accept:".csv,.xlsx,.ods,text/csv,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.oasis.opendocument.spreadsheet",maxSize:0x3200000}),[v,Y]=(0,c.useState)(!1),[b,C]=(0,c.useState)(!1),w=(0,c.useRef)(null),T=(null==(t=o[0])?void 0:t.file)instanceof File?o[0].file:null;return(0,a.FD)(y.VP,{gap:12,children:[(0,a.Y)(E,{files:o,isDragging:s,errors:d,openFileDialog:u,getInputProps:m,getDragProps:g,removeFile:f}),T&&(0,a.FD)(a.FK,{children:[(0,a.Y)(S,{checked:b,onChange:C}),(0,a.Y)(h.$n,{loading:v,disabled:!b,onClick:()=>{if(T){if(!b)return void alert(r("Please confirm that everyone on this list has opted in to receiving emails."));Y(!0),w.current&&w.current.uploadFile(T)}},children:r("Import list")})]}),(0,a.Y)(I,{pub:n,importerRef:w,onSuccess:()=>{Y(!1),null==i||i()},setLoading:Y,onError:l})]})}function E(e){var t,n,l;let{files:r,isDragging:c,errors:u,openFileDialog:m,getInputProps:g,getDragProps:Y,removeFile:C}=e,{iString:w}=(0,p.GO)(),E=null==(t=r[0])?void 0:t.file.name,S=null!=(l=null==(n=r[0])?void 0:n.file.size)?l:0,I=!!E;return(0,a.FD)(a.FK,{children:[(0,a.Y)(T,{isDragging:c,isFilled:I,dragProps:Y(),children:I?(0,a.FD)(y.fI,{alignItems:"center",gap:12,padding:12,children:[(0,a.Y)(o.A,{}),(0,a.FD)(y.VP,{flex:"grow",children:[(0,a.Y)(b.EY.B4,{weight:"medium",children:E}),(0,a.Y)(b.EY.B5,{color:"secondary",children:(0,_.z)(S)})]}),(0,a.Y)(h.K0,{onClick:()=>{var e;return C(null==(e=r[0])?void 0:e.id)},priority:"quaternary",children:(0,a.Y)(s.A,{size:20})})]}):(0,a.Y)(f.p,{icon:c?(0,a.Y)(d.A,{}):(0,a.Y)(o.A,{}),title:w("Drop your subscriber list here"),description:w("CSV, XLSX, or ODS • Max 50MB"),button:(0,a.Y)(h.$n,{onClick:m,priority:"primary-mono",children:w("Select file")})})}),(0,a.Y)("input",(0,i._)({},g())),u.length>0&&(0,a.Y)(v.yn,{role:"alert",align:"center",children:u[0]})]})}function T(e){let{isDragging:t,isFilled:n,dragProps:r,children:o}=e;return(0,a.Y)(m.Z,(0,l._)((0,i._)({display:"flex",radius:"sm",overflow:"hidden",position:"relative",border:n?"unset":"detail",outline:n?"detail":"unset",borderStyle:n?"none":"dashed",bg:t?"secondary":"primary",elevated:!1,padding:32*!n},r),{children:o}))}function S(e){let{checked:t,onChange:n}=e,{iString:i}=(0,p.GO)();return(0,a.FD)(y.ov,{as:"label",gap:12,padding:8,children:[(0,a.Y)(g.S,{checked:t,onChange:n,size:"sm",autoFocus:!0}),(0,a.Y)(b.EY.B3,{weight:"medium",children:i("These people have opted in to receiving emails")})]})}function I(e){let{pub:t,importerRef:n,onSuccess:i,setLoading:l,onError:r}=e,o=()=>{l(!1),null==r||r()};return(0,a.Y)(k,{ref:n,urls:["/api/v1/import.json?publication_id=".concat(t.id)],onError:o,onAbort:o,onUpload:i})}class k extends u.A{render(){let{uploading:e,percentComplete:t}=this.state;return e?(0,a.Y)(A,{percentComplete:null!=t?t:0}):null}}let A=e=>{let{percentComplete:t}=e,{iTemplate:n}=(0,p.GO)(),i=Math.round(t?100*t:0);return(0,a.FD)(y.VP,{gap:12,padding:8,children:[(0,a.Y)(Y.hZ,{percent:null!=t?t:0,height:4,padding:0}),(0,a.Y)(b.EY.B4,{textAlign:"center",color:"secondary",children:n(C(),i)})]})}},38837:function(e,t,n){n.d(t,{Q:()=>r});var i=n(4006),l=n(63136);function r(e){let{name:t}=e;return t?(0,i.Y)(l.EY,{as:"span",weight:"semibold",children:t}):null}},75928:function(e,t,n){n.d(t,{X:()=>r});var i=n(4006),l=n(63136);function r(e){let{username:t}=e;return t?(0,i.FD)(l.EY,{as:"span",color:"secondary",children:["@",t]}):null}},36334:function(e,t,n){n.d(t,{V:()=>c});var i=n(4006),l=n(38685),r=n(24078),a=n(89490),o=n(38837),s=n(75928),d=n(5955);function c(e){var t;let{username:n,name:a,profile_image_url:c,belowTheFold:h}=e;return(0,i.FD)(u,{children:[(0,i.Y)(r.eu,{photoUrl:null!=(t=null==c?void 0:c.replace("_normal",""))?t:"",alt:(0,d.sK)(n),size:40,loading:h?"lazy":void 0}),(0,i.FD)(p,{children:[(0,i.Y)(o.Q,{name:a}),(0,i.Y)(s.X,{username:n})]}),(0,i.Y)(l.A,{size:20})]})}let u=(0,a.I4)({display:"flex",direction:"row",gap:12,alignItems:"center"}),p=(0,a.I4)({display:"flex",direction:"column",flex:"grow"})},3362:function(e,t,n){n.d(t,{J:()=>d});var i=n(4006),l=n(82853),r=n(8853),a=n(33727),o=n(76977),s=n(63136);function d(e){let{expandedUrl:t}=e,{title:n,domain:l,image:r}=t,d="string"==typeof r?r:null==r?void 0:r.url;return(0,i.FD)(a.Z,{direction:"row",shadow:"none",radius:"sm",padding:12,gap:12,children:[(0,i.FD)(o.VP,{gap:2,flex:"grow",minWidth:0,children:[l&&(0,i.Y)(s.EY.B4,{color:"secondary",ellipsis:!0,children:l}),n&&(0,i.Y)(s.EY.B3,{clamp:2,weight:"medium",children:n})]}),d?(0,i.Y)(c,{imageUrl:d}):(0,i.Y)(u,{})]})}function c(e){let{imageUrl:t}=e;return(0,i.Y)(o.ov,{radius:"md",outline:"detail",overflow:"hidden",children:(0,i.Y)(r.c,{src:t,width:64,height:64,options:{smartCrop:!0}})})}function u(){return(0,i.Y)(o.ov,{width:64,height:64,bg:"secondary",radius:"md",outline:"detail",children:(0,i.Y)(l.A,{size:24,stroke:"var(--color-fg-secondary)"})})}},77934:function(e,t,n){n.d(t,{b:()=>o});var i=n(4006),l=n(66443),r=n(89490),a=n(27167);function o(e){let{photos:t,belowTheFold:n}=e;if(!t||0===t.length)return null;let r=t.map(e=>({src:e.img_url,explicit:!1,alt_text:e.alt_text}));return 1===r.length&&r[0]?(0,i.Y)(s,{children:(0,i.Y)("img",{src:r[0].src,alt:r[0].alt_text,className:a.A.image,loading:n?"lazy":void 0})}):(0,i.Y)(l.K,{assets:r,readOnly:!0,maxHeight:320})}let s=(0,r.I4)({overflow:"hidden",radius:"sm",outline:"detail",bg:"black",className:a.A.container})},56127:function(e,t,n){n.d(t,{k:()=>v});var i=n(4006),l=n(33727),r=n(24078),a=n(89490),o=n(63136),s=n(38837),d=n(75928),c=n(5955);function u(e){var t;let{quotedTweet:n}=e;return(0,i.FD)(p,{children:[n.username&&(0,i.Y)(r.eu,{size:20,photoUrl:null==(t=n.profile_image_url)?void 0:t.replace("_normal",""),alt:(0,c.sK)(n.username)}),(0,i.FD)(o.EY.B4,{children:[(0,i.Y)(s.Q,{name:n.name})," ",(0,i.Y)(d.X,{username:n.username})]})]})}let p=(0,a.I4)({display:"flex",direction:"row",gap:8,alignItems:"center"});var h=n(74728),m=n.n(h),g=n(41080),f=n(98505);function y(e){let{text:t}=e,n=m()(t,g.f);return(0,i.Y)(o.EY.B3,{className:f.A.text,dangerouslySetInnerHTML:{__html:n}})}function v(e){let{quotedTweet:t}=e;return(null==t?void 0:t.full_text)?(0,i.FD)(l.Z,{shadow:"none",radius:"sm",gap:8,padding:12,children:[(0,i.Y)(u,{quotedTweet:t}),(0,i.Y)(y,{text:t.full_text})]}):null}},41080:function(e,t,n){n.d(t,{f:()=>c,z:()=>u});var i=n(69277),l=n(70408),r=n(4006),a=n(74728),o=n.n(a),s=n(63136),d=n(98505);let c={allowedTags:o().defaults.allowedTags.concat(["img"]),allowedAttributes:(0,l._)((0,i._)({},o().defaults.allowedAttributes),{"*":["href","style","id","data-*","itemprop","class","align","alt","center","bgcolor"]})};function u(e){let{text:t}=e,n=o()(t,c);return(0,r.Y)(s.EY.B3,{className:d.A.text,dangerouslySetInnerHTML:{__html:n}})}},38904:function(e,t,n){n.d(t,{X:()=>a});var i=n(4006),l=n(89490),r=n(79459);function a(e){let{src:t}=e;return(0,i.Y)(o,{children:(0,i.Y)("video",{className:r.A.video,controls:!0,src:t,preload:"auto"})})}let o=(0,l.I4)({display:"flex",direction:"column",overflow:"hidden",radius:"sm",outline:"detail",bg:"black",className:r.A.container})},78979:function(e,t,n){n.d(t,{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"},l=["CREATE_PUBLICATION_SUCCESS","CREATOR_WELCOME","EXIT","WELCOME"],r=e=>l.includes(e)},82455:function(e,t,n){n.d(t,{W:()=>c});var i=n(98111),l=n(17460),r=n(39318),a=n(49807),o=n(50963),s=n(82776),d=n(57324);function c(e,t){var n,c;let{pub:u,post:p,user:h,sendMedium:m}=t,g=e;return p&&h&&(g=g.replace(RegExp(i.T.COMMENTS_URL,"g"),(0,r.Erh)(u,p)).replace(RegExp(i.T.HALF_MAGIC_COMMENTS_URL,"g"),(0,r.Erh)(u,p))),g.replace(RegExp(i.T.POST_ID,"g"),(null==p?void 0:p.id.toString())||"").replace(RegExp(i.T.SEND_MEDIUM,"g"),m||"").replace(RegExp(i.T.CHECKOUT_URL,"g"),(0,s.escapeNewlines)((0,r.my9)(u))).replace(RegExp(i.T.FOUNDING_CHECKOUT_URL,"g"),(0,s.escapeNewlines)((0,r.WY0)(u))).replace(RegExp(i.T.ACCOUNT_URL,"g"),(0,s.escapeNewlines)((0,a.FCy)(u,{addBase:!0}))).replace(RegExp(i.T.ARCHIVE_URL,"g"),(0,s.escapeNewlines)((0,r.Xt9)(u,{addBase:!0,params:null}))).replace(RegExp(i.T.PUBLICATION_NAME,"g"),(0,s.escapeNewlines)((0,l.A)(u.name||""))).replace(RegExp(i.T.PUBLICATION_HERO_TEXT,"g"),(0,s.escapeNewlines)((0,l.A)(u.hero_text||""))).replace(RegExp(i.T.AUTHOR_NAME,"g"),(0,s.escapeNewlines)((0,l.A)(u.author_name||""))).replace(RegExp(i.T.AUTHOR_FIRST_NAME,"g"),(0,s.escapeNewlines)((0,l.A)((0,o.$k)(u.author_name)||""))).replace(RegExp(i.T.AUTHOR_BIO,"g"),(0,s.escapeNewlines)((0,l.A)(u.author_bio||""))).replace(RegExp(i.T.SHARE_URL,"g"),"").replace(RegExp(i.T.SHARE_PUB_URL,"g"),(0,r.aJp)(u)).replace(RegExp(i.T.PODCAST_SETUP_URL,"g"),(0,r.wpu)(u,{addBase:!0,noSection:!0,params:null,section:null,user:null,startAtSubscribeFlow:!1})).replace(RegExp(i.T.PERSONAL_PODCAST_SETUP_URL,"g"),(0,r.wpu)(u,{addBase:!0,noSection:!0,params:null,section:null,user:null,startAtSubscribeFlow:!1})).replace(RegExp(i.T.ALL_PODCASTS_SETUP_URL,"g"),(0,r.t77)(u,{startAtSubscribeFlow:!0,utm_source:d.VU.allPodcastsSetupButton})).replace(RegExp(i.T.HOME_LINK,"g"),(0,a.$_T)(u)).replace(RegExp(i.T.THREAD_URL,"g"),(0,a.xWO)({pubKey:u.subdomain})).replace(RegExp(i.T.CHAT_URL,"g"),(0,a.xWO)({pubKey:u.subdomain})).replace(RegExp(i.T.PREACT_COMPAT_HTML_COMMENT_OPEN,"g"),"\x3c!--").replace(RegExp(i.T.PREACT_COMPAT_HTML_COMMENT_CLOSE,"g"),"--\x3e").replace(RegExp(i.T.DASHBOARD_URL,"g"),(0,a.Z96)(u,{addBase:!0})).replace(RegExp(i.T.AUTHOR_PHOTO_URL,"g"),u.author_photo_url||"").replace(RegExp(i.T.MEETINGS_URL,"g"),(0,a.SJN)(u,{addBase:!0})||"").replace(RegExp(i.T.PUBLICATION_URL,"g"),(0,a.$_T)(u)).replace(RegExp(i.T.LEADERBOARD_URL,"g"),(0,a.tLs)(u,void 0,{addBase:!0})).replace(RegExp(i.T.ACTIVITY_PAGE_URL,"g"),"".concat((0,a.Ewe)(),"/activity")).replace(RegExp(i.T.FOLLOW_PROFILE_URL,"g"),h?(0,a.gYq)(h,{utm_source:d.VU.email,extraParams:{r:null!=(n=(0,s.userReferralKey)(h))?n:"",followPrompt:!0}}):(0,a.yRP)((0,a.Ewe)(),{utm_source:d.VU.email,followPrompt:!0})).replace(RegExp(i.T.FOLLOW_POST_URL,"g"),h?(0,a.wu9)(u,p,{urlParams:{utm_source:d.VU.email,r:null!=(c=(0,s.userReferralKey)(h))?c:"",followPrompt:!0}}):(0,a.yRP)((0,a.Ewe)(),{utm_source:d.VU.email,followPrompt:!0}))}}}]);