(self.webpackChunklite=self.webpackChunklite||[]).push([[9616],{37336:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(67294);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t{"use strict";n.d(t,{w:()=>m});var r=n(67294),i=n(47230),l=n(77355),o=n(14646);function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t path":{fill:"SUBTLE"===e?t.colorTokens.foreground.neutral.primary.base:t.colorTokens.background.neutral.primary.base}}}},m=function(e){var t=e.buttonSize,n=void 0===t?"REGULAR":t,a=e.buttonStyle,c=void 0===a?"STRONG":a,m=e.showMailIcon,h=void 0===m||m,f=e.onClick,v=e.width,E=e.buttonText,b=void 0===E?"Get this newsletter":E,x=e.redirectUrl,p=e.displayOnly,w=void 0!==p&&p,g=e.loading,y=(0,o.I)();return r.createElement(i.zx,{buttonStyle:c,onClick:f,size:n,width:v,href:x,displayOnly:w,loading:g},r.createElement(l.x,{display:"flex",justifyContent:"center",alignItems:"center"},h&&r.createElement("span",{className:y(u),"aria-hidden":"true"},r.createElement(s,{className:y(d(c))})),b))}},19616:(e,t,n)=>{"use strict";n.d(t,{x:()=>A});var r=n(22122),i=n(34699),l=n(67294),o=n(92210),a=n(61279),c=n(6443),s=n(26350),u=n(77355),d=n(1383),m=n(93310),h=n(16793),f=n(98096),v=n(47230),E=n(60600),b=n(90406),x=n(87691),p=n(18627),w=n(66411),g=n(14646),y=n(75221),T=n(78285),S=n(77280),R=n(43487),C=n(37336),O=n(68894),L=n(50458),k=n(3207),N=n(43405),V=function(e){return{marginRight:"8px",fill:e.colorTokens.foreground.neutral.primary.base}},I=function(e){var t=e.children;return l.createElement(u.x,{margin:{lg:void 0,xl:void 0,md:void 0,sm:void 0,xs:"10px 0 0 0"},flexShrink:"0"},t)},B=function(e){var t=e.children,n=e.helperTextColor,r=e.scale;return l.createElement(u.x,{maxWidth:"425px",margin:"10px 0 0 0"},l.createElement(x.F,{scale:r||"XS",color:n},t))},U=function(){return l.createElement(u.x,{height:"52px",width:"312px",borderRadius:"99em",backgroundColor:"BASE_NORMAL"})};function _(e){var t=e.withHelperText,n=e.helperTextChildren,r=e.button,i=e.isVertical,o=e.isLoading;return t&&o?l.createElement(u.x,{display:"flex",flexDirection:i?"column":{lg:"row",xl:"row",md:"row",sm:"column",xs:"column"},alignItems:i?"flex-start":{lg:"center",xl:"center",md:"center",sm:"flex-start",xs:"flex-start"},justifyContent:"center",width:"100%"},l.createElement(E.f,{itemPlaceholder:U,numPlaceholders:1})):i?l.createElement(u.x,{display:"flex",flexDirection:"column",width:"100%"},t&&l.createElement(u.x,{paddingBottom:"16px"},n),r):l.createElement(u.x,{display:"flex",flexDirection:{lg:"row",xl:"row",md:"row",sm:"column",xs:"column"},alignItems:{lg:"center",xl:"center",md:"center",sm:"flex-start",xs:"flex-start"},justifyContent:t?"space-between":"center",width:"100%"},t&&l.createElement(u.x,{paddingRight:{lg:"8px",xl:"8px",md:"8px",sm:"0",xs:"0"},paddingBottom:{lg:"0",xl:"0",md:"0",sm:"16px",xs:"16px"}},n),r)}var z=function(e){var t=e.newsletterV3,n=e.showMailIcon,a=void 0===n||n,c=e.buttonSize,u=void 0===c?"REGULAR":c,m=e.buttonStyle,h=void 0===m?"STRONG":m,f=e.redirectUrl,v=e.buttonText,E=e.width,b=e.viewer,x=e.subscribeButtonText,g=e.setSubscribe,y=e.user,T=e.collection,S=e.susiEntry,C=e.newsletterOrProfileName,k=e.loading,N=t.id,V=(0,L.Zu)(N),B=(0,w.Lk)(),U=(0,p.A)(),_=(0,R.v9)((function(e){return e.config.productName})),z=(0,O.O)(!1),A=(0,i.Z)(z,3),P=A[0],G=A[1],M=A[2],j={buttonSize:u,buttonStyle:h,onClick:function(){var e;b?b&&b.allowEmailAddressSharingEditorWriter?g(!0,!1):G():null!=y&&null!==(e=y.newsletterV3)&&void 0!==e&&e.id?U.event("newsletterV3.subscribeClicked",{newsletterV3Id:y.newsletterV3.id,source:B}):null!=y&&y.id&&U.event("user.LOSubscribeClicked",{targetUserId:y.id,source:B})},showMailIcon:a,buttonText:v||x,redirectUrl:f,width:E,loading:k};return l.createElement(I,null,b?l.createElement(l.Fragment,null,l.createElement(o.w,j),l.createElement(d.Q,{onConfirm:function(){return g(!0,!0)},isVisible:P,hide:M,titleText:"Confirm your subscription to ".concat(C),confirmText:"Confirm now",buttonStyle:"STRONG",buttonSize:"LARGE",showCancelButton:!1,withCloseButton:!1,isDestructiveAction:!1},"By confirming, you agree to share your email address with the editors of newsletters and writers you've subscribed to so they can stay in contact with you outside of ".concat(_,". You can opt out of sharing your email address by unsubscribing in your Settings."))):l.createElement(s.R,{operation:"register",newsletterV3:t,user:y||void 0,collection:T||void 0,actionUrl:V,susiEntry:S,redirectTo:f},l.createElement(o.w,(0,r.Z)({},j,{redirectUrl:void 0}))))},A=function(e){var t,n,r,i,o=e.newsletterV3,d=e.helperTextColor,E=void 0===d?"LIGHTER":d,x=e.showHelperText,p=void 0===x||x,R=e.showMailIcon,O=void 0===R||R,L=e.buttonSize,U=void 0===L?"REGULAR":L,A=e.buttonStyle,P=void 0===A?"STRONG":A,G=e.redirectUrl,M=e.buttonText,j=e.width,H=e.isVertical,F=e.hideLinkInConfirmationToast,Z=e.isBaseTheme,W=(0,g.I)(),Y=(0,c.H)().value,D=o.collection?o.collection:void 0,X=o.user?o.user:void 0,K=(0,T.w)(),Q=(0,S.PM)();switch(o.type){case y.Rr.NEWSLETTER_TYPE_COLLECTION:t=o.name,n="Get this newsletter",r="You’re signed up for ".concat(t,"."),i="newsletter_v3_promo";break;case y.Rr.NEWSLETTER_TYPE_AUTHOR:t=null==X?void 0:X.name,n="Subscribe",r="You’re subscribed to ".concat(t),i="subscribe_user"}var q=(0,a.o)({newsletterV3:o,newsletterName:t,hideLinkInConfirmationToast:F}),J=q.isSubscribed,$=q.hasError,ee=q.setSubscribe,te=q.loading;l.useEffect((function(){if(Q){var e=(0,w.P7)(Q||"").susiEntry;["collection_newsletter_v3_landing","newsletter_v3_promo"].includes(void 0===e?"":e)&&J&&K({duration:"NEXTPAGE",toastStyle:"NEWSLETTER_SUBSCRIBE",extraParams:{newsletterName:t,newsletterType:o.type,unsubscribeFn:function(){return ee(!1)}}})}}),[Q,J]);var ne=l.useMemo((function(){return Y?l.createElement(l.Fragment,null,"Emails will be sent to ",Y.emailObfuscated,". ",l.createElement(s.R,{operation:"login",newsletterV3:o,collection:D,susiEntry:i,inline:!0},l.createElement(m.r,{linkStyle:"OBVIOUS",inline:!0,target:"_blank"},"Not you?"))):l.createElement(N.b,null)}),[Y,o,D,i]);return l.createElement(l.Fragment,null,l.createElement(h.Z,null,(function(e){return l.createElement(f.f,{theme:Z?e:(0,k.jN)(D,e)},J?l.createElement(_,{withHelperText:p,helperTextChildren:l.createElement(B,{helperTextColor:"DARKER",scale:"S"},r),button:l.createElement(I,null,l.createElement(v.zx,{buttonStyle:"SUBTLE",onClick:function(){return ee(!1)},size:U,loading:!!te},l.createElement(u.x,{display:"flex",justifyContent:"center",alignItems:"center",tag:"span"},O&&l.createElement(C.Z,{width:"24px",height:"24px",className:W(V)}),"Unsubscribe"))),isVertical:H,isLoading:!!te}):l.createElement(w.cW,{source:{newsletterV3Id:o.id},extendSource:!0},l.createElement(_,{button:l.createElement(z,{redirectUrl:G,buttonText:M,width:j,showMailIcon:O,buttonSize:U,subscribeButtonText:n,setSubscribe:ee,user:X,collection:D,susiEntry:i,newsletterOrProfileName:t,viewer:Y,newsletterV3:o,buttonStyle:P,loading:!!te}),withHelperText:p,helperTextChildren:l.createElement(B,{helperTextColor:E},ne),isVertical:H,isLoading:!!te})))})),$&&l.createElement(b.F,{toastStyle:"RETRYABLE_ERROR",isVisible:$,hide:function(){}}))}},43405:(e,t,n)=>{"use strict";n.d(t,{b:()=>a});var r=n(67294),i=n(93310),l=n(43487),o=n(50458),a=function(){var e=(0,l.v9)((function(e){return e.config.productName}));return r.createElement(r.Fragment,null,"By signing up, you will create a ",e," account if you don’t already have one. Review our"," ",r.createElement(i.r,{href:o.wo,linkStyle:"OBVIOUS",inline:!0,target:"_blank"},"Privacy Policy")," ","for more information about our privacy practices.")}},16793:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=n(3863).N.Consumer}}]); //# sourceMappingURL=https://stats.medium.build/lite/sourcemaps/9616.e39a8957.chunk.js.map