PageSourceSearch

https://www.theglobeandmail.com/pf/dist/components/combinations/NewsletterModal.chunk.js?d=961&mxId=00000000

js theglobeandmail.com collected 2026-09-24 06:43:01 UTC 7,655 bytes, 1 lines download raw bytes

1"use strict";(this.webpackChunkFusion_components=this.webpackChunkFusion_components||[]).push([[3385],{16269:function(e,t,o){o.r(t),o.d(t,{default:function(){return H}});var r=o(86780),n=o.n(r),s=o(40809),a=o(81862),i=o.n(a),l=o(21143),c=o.n(l),m=o(78299),d=o(35838),u=o(72850),h=o(78206),g=o(30137),p=o(85349);const y=c().div.withConfig({displayName:"EmailForm__StyledErrorText",componentId:"sc-twyri9-0"})(["color:var(--color-red-500);a:link,a:visited,a:hover,a:focus,a:active{span{color:var(--color-red-500);}}"]),x=c().div.withConfig({displayName:"EmailForm__StyledContainer",componentId:"sc-twyri9-1"})(["color:var(--color-grey-800);.color-grey-500{color:var(--color-grey-500);}.color-grey-600{color:var(--color-grey-600);}.color-grey-700{color:var(--color-grey-700);}.emailLabel{display:block;}.emailTextField{min-width:",";padding:var(--space-8);width:100%;height:",";border:"," solid var(--color-grey-400);}"],(0,g.D0)(256),(0,g.D0)(44),(0,g.D0)(1)),b=c().div.withConfig({displayName:"EmailForm__StyledSubmitContainer",componentId:"sc-twyri9-2"})(["display:flex;align-items:center;gap:var(--space-8);"]),f=c()(m.Ay).withConfig({displayName:"EmailForm__StyledLinkButton",componentId:"sc-twyri9-3"})(["padding:0;text-transform:none;transition:none;.tgam-button__content{text-decoration:underline;}"]),w={errorMessage:n().node,handleFormSubmit:n().func,hasError:n().bool,isSubmitting:n().bool,newsletterName:n().string.isRequired,onLogInButtonClick:n().func};function v({errorMessage:e,handleFormSubmit:t,hasError:o,isSubmitting:r=!1,newsletterName:n,onLogInButtonClick:s}){return(0,p.jsxs)(x,{children:[(0,p.jsxs)("h3",{className:"text-gmb-3 mt-0 mb-8",children:[n," newsletter"]}),(0,p.jsxs)("form",{className:"c-form",action:"#","aria-live":"polite",autoComplete:"off",onSubmit:t,children:[(0,p.jsx)("p",{className:"text-gmr-4 color-grey-700",children:"Enter your email address to receive this newsletter."}),(0,p.jsxs)("label",{className:"emailLabel text-gmb-6 mb-8",htmlFor:"email",children:["Email ",(0,p.jsx)("span",{className:"color-grey-500",children:"(required)"})]})," ",(0,p.jsx)("input",{id:"email",className:"emailTextField text-gmr-4 color-grey-700",type:"email",max:"40",placeholder:"[email protected]"}),o?(0,p.jsx)(y,{className:"mt-8 text-gmr-4 errorText",children:e}):null,(0,p.jsxs)("p",{className:"text-gmr-4 color-grey-700",children:["Your interest in this newsletter may be used by us to communicate with you and deliver more relevant content, ads, email promotions, offers and discounts. Unsubscribe any time. By signing up, you will be subject to our"," ",(0,p.jsx)(u.Ay,{href:"/privacy-terms/terms-and-conditions/",textAs:"span",textClassName:"text-gmr-4",underlined:!0,children:"Terms and Conditions"}),". See our"," ",(0,p.jsx)(u.Ay,{href:"/privacy-terms/privacy-policy/",textAs:"span",textClassName:"text-gmr-4",underlined:!0,children:"Privacy Policy"}),"."]}),(0,p.jsxs)(b,{className:"mt-16",children:[(0,p.jsx)(m.Ay,{type:"submit",fullWidth:!0,analytics:{action:"form submit"},children:"Sign Up"}),r?(0,p.jsx)(h.A,{id:"newsletter-simple-sign-up-spinner",color:"dark"}):null]})]}),(0,p.jsxs)("p",{className:"text-gmb-6 color-grey-700 mt-16",children:["Already have an account?"," ",(0,p.jsx)(f,{type:"button",variant:"text",className:"text-gmb-6",onClick:s,children:"Log in"}),"."]})]})}v.displayName="EmailForm",v.propTypes=w;var C=v;const N=c().div.withConfig({displayName:"SuccessMessage__StyledContainer",componentId:"sc-1u6iucg-0"})(["color:var(--color-grey-800);.color-grey-600{color:var(--color-grey-600);}.color-grey-700{color:var(--color-grey-700);}.emailLabel{display:block;}.emailTextField{min-width:",";padding:var(--space-8);width:100%;height:",";border:"," solid var(--color-grey-400);}"],(0,g.D0)(256),(0,g.D0)(44),(0,g.D0)(1));function k(){return(0,p.jsxs)(N,{children:[(0,p.jsx)("h3",{className:"text-gmb-3 mt-0 mb-8",children:"You’re now signed up!"}),(0,p.jsx)("p",{className:"text-gmr-4 color-grey-700 mb-8",children:"Check your email and click the confirmation link to ensure you receive it."}),(0,p.jsxs)("p",{className:"text-gmr-6 color-grey-600",children:["You can unsubscribe from this newsletter, including Globe promotions, at any time by clicking the link at the bottom of the newsletter, by emailing us at"," ",(0,p.jsx)(u.Ay,{href:"mailto:[email protected]",textAs:"span",textClassName:"text-gmr-6",underlined:!0,children:"[email protected]"}),", or by calling us at Customer Support at"," ",(0,p.jsx)(u.Ay,{href:"tel:+18003875400",textAs:"span",textClassName:"text-gmr-6",underlined:!0,children:"1-800-387-5400"}),"."]})]})}k.displayName="SuccessMessage";var j=k,S=o(20),E=o(99289),A=o(15710),_=o(40761),F=o(12675),I=o(8174);const L=(0,F.A)("[NewsletterModal]"),D="newsletter modal",M="emailForm",O="emailExistsError",T="emailInvalidError",B="success";i().setAppElement("#fusion-app");const R=c()(i()).attrs(e=>({$maxWidth:e.$maxWidth,$maxHeight:e.$maxHeight})).withConfig({displayName:"NewsletterModal__StyledReactModal",componentId:"sc-dkw5mb-0"})(["max-width:",";max-height:",";"],e=>(0,g.D0)(e.$maxWidth),e=>(0,g.D0)(e.$maxHeight)),$=c()(m.Ay).withConfig({displayName:"NewsletterModal__StyledLinkButton",componentId:"sc-dkw5mb-1"})(["padding:0;text-transform:none;transition:none;.tgam-button__content{color:var(--color-red-500);text-decoration:underline;}"]),q={isOpen:n().bool.isRequired,maxHeight:n().number,maxWidth:n().number,newsletterCode:n().string,newsletterName:n().string,onAfterClose:n().func,onAfterOpen:n().func,onLogInButtonClick:n().func,onRequestClose:n().func.isRequired,onSubscribeError:n().func,onSubscribeSuccess:n().func};function W({isOpen:e,maxHeight:t=580,maxWidth:o=375,newsletterCode:r,newsletterName:n,onAfterClose:a=A.lQ,onAfterOpen:i=A.lQ,onLogInButtonClick:l=A.lQ,onRequestClose:c=A.lQ,onSubscribeError:u=A.lQ,onSubscribeSuccess:h=A.lQ}
1){const[g,y]=(0,s.useState)(M),[x,b]=(0,s.useState)(!1),{newsletterRecaptchaEnabled:f=!1}=(0,d.V)(),w=({token:e,userEmail:t})=>{b(!0),(0,S.ZG)({newsletterCode:r,email:t,token:e,apiVersion:4}).then(()=>{L.info("subscribe success:",r,t),y(B),(0,_.Ak)(h)}).catch(e=>{L.error("subscribe error:",e),y(O),(0,_.Ak)(u)}).finally(()=>b(!1))},v=e=>{e.preventDefault();const t=e?.target?.email?.value??"",o=(0,I.DT)(t);L.info("handleFormSubmit: ",{newsletterRecaptchaEnabled:f,isValidEmail:o}),f?o?(0,E.r)({action:"subscribeToNewsletter"}).then(e=>w({token:e,userEmail:t})).catch(()=>L.error("reCaptcha failed to load")):(L.info("invalid email"),y(T)):w({userEmail:t})},N=(0,p.jsxs)("p",{children:["Email is invalid or associated with an account. Please try again or"," ",(0,p.jsx)($,{type:"button",variant:"text",onClick:l,children:"log in"})," ","to sign up for this newsletter."]});let k=null;switch(g){case M:k=(0,p.jsx)(C,{handleFormSubmit:v,isSubmitting:x,newsletterName:n,onLogInButtonClick:l});break;case O:case T:k=(0,p.jsx)(C,{errorMessage:N,handleFormSubmit:v,hasError:!0,isSubmitting:x,newsletterName:n,onLogInButtonClick:l});break;case B:k=(0,p.jsx)(j,{})}return(0,p.jsxs)(R,{$maxWidth:o,$maxHeight:t,id:"newsletter-modal",isOpen:e,className:"newsletter-modal-content",overlayClassName:"newsletter-modal-overlay",bodyOpenClassName:"u-no-scroll",shouldCloseOnEsc:!0,shouldCloseOnOverlayClick:!0,contentLabel:"Newsletter sign-up",onRequestClose:c,onAfterClose:a,onAfterOpen:i,children:[(0,p.jsx)(m.Ay,{id:"newsletter-modal-close",className:"newsletter-modal-close-button",icon:"close","aria-label":"Close",onClick:c,analytics:{fid:D,action:"close modal"}}),(0,p.jsx)("div",{"data-sophi-feature":D,className:"newsletter-modal-body",children:k})]})}W.displayName="NewsletterModal",W.propTypes=q;var H=W}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.