!function(e,t){for(var n in t)e[n]=t[n]}(exports,function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e,t){e.exports=require("react")},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;tt in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,b=(e,t)=>{for(var n in t||(t={}))d.call(t,n)&&p(e,n,t[n]);if(s)for(var n of s(t))f.call(t,n)&&p(e,n,t[n]);return e},m=(e,t)=>a(e,l(t)),g=e=>o(e,"__esModule",{value:!0}),y=(e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let a of c(t))!d.call(e,a)&&(n||"default"!==a)&&o(e,a,{get:()=>t[a],enumerable:!(r=i(t,a))||r.enumerable});return e},h=(e,t)=>y(g(o(null!=e?r(u(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),O=(e=>(t,n)=>e&&e.get(t)||(n=y(g({}),t,1),e&&e.set(t,n),n))("undefined"!=typeof WeakMap?new WeakMap:0),v={};((e,t)=>{for(var n in t)o(e,n,{get:t[n],enumerable:!0})})(v,{TermsOfService:()=>X,useTermsOfServiceData:()=>$});var w=h(n(0)),E=(n(2),e=>{if(typeof window>"u")return;let t=document.cookie.match(`(^|;) ?${e}=([^;]*)(;|$)`);return t?t[2]:null}),S=e=>new Promise(t=>e.json().then(n=>t({status:e.status,ok:e.ok,json:n}))),_=e=>{if(!e.ok)throw e.json||e;return e.json},C={Accept:"application/json","Content-Type":"application/json"},j=(e,t={method:"GET"})=>{let n=t;return n.headers=b(b({},t.headers),C),fetch(e,n).then(S).then(_)},P="wapo_identity",A={consentCountry:"",tos:""},L=()=>{let e=typeof window>"u"?"":window.location&&window.location.hostname||"",t="prod";return/(pb-impact\.|subs-stage\.|sandbox\.|.preview.now.washingtonpost.com|localhost.washingtonpost.com)/.test(e)?t="sandbox":/dev\.washpost|localhost|digitalink\.com/.test(e)&&(t="dev"),t},T=()=>{let e=typeof window>"u"?"":window.location&&window.location.hostname||"";return/(subscribe\.|subscription\.|subs-stage\.|local.digitalink\.)/.test(e)},I={configUrl:{dev:"https://subscribe.digitalink.com",sandbox:"https://subs-stage.washingtonpost.com",prod:"https://www.washingtonpost.com/subscribe"},subsUrl:{dev:"https://subscribe.digitalink.com",sandbox:"https://subs-stage.washingtonpost.com",prod:"https://subscribe.washingtonpost.com"}},x=()=>{try{let e=(new Date).toString();window.localStorage.setItem(e,e);let t=window.localStorage.getItem(e)===e;return window.localStorage.removeItem(e),t}catch{return!1}},R=e=>I[e][L()]||I[e].prod,N=()=>{let e=E("wapo_actmgmt");return!(!e||"undefined"===e)},D=e=>{let t;if(x()&&(t=JSON.parse(localStorage.getItem(P))),t){let n={privacySetting:b(b({},t.privacySetting),e)},r=b(b({},t),n);localStorage.setItem(P,JSON.stringify(r))}},k=(e,t={})=>{let n=R("subsUrl"),r={appName:"SC",locationId:"SC:TermsOfService",message:"no message",state:{}};r=b(b({},r),t);let o=E("wapo_login_id")||"";return o&&(r.state.wapo_login_id=o),j(`${n}/logging/${e}`,{method:"POST",credentials:"include",body:JSON.stringify(r)})},M=(e,t)=>{let n=R("subsUrl"),r=null;return j(`${n}/user/auth-status?_v=${(new Date).getTime()}`,{method:"GET",credentials:"include"}).then(e=>{e&&"SUCCESS"===e.status&&!T()&&(e=>{if(x()){let t=localStorage.getItem("wapo_identity");t=t&&JSON.parse(t)||{};let n=Object.assign(t,e),r=Date.now()+864e5;n.e=r,localStorage.setItem("wapo_identity",JSON.stringify(n))}})(e.userState),r=e}).catch(e=>console.error(e)).finally(()=>(T()||D(e),t&&t(),r))},U=()=>{let e=(()=>{let e;return x()&&(e=N()?JSON.parse(localStorage.getItem(P)):{}),e?e.privacySetting||A:{}})();return 0===Object.keys(e).length&&N()&&T()?M().then(e=>{var t;return(null==e||null===(t=e.userState)||void 0===t?void 0:t.privacySetting)||A}):Promise.resolve(e)},F=e=>Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{}),B=(e,t)=>{let n=new RegExp(Object.keys(t).join("|"),"gi");return null==e?void 0:e.replace(n,e=>t[e])},z=h(n(0)),H=(n(2),({onChange:e,isChecked:t,checkboxLabelClass:n,checkboxLabelStyle:r,id:o,children:a,labelSizeSm:i,disabled:l})=>{let c=`db gray-dark relative flex pt-xxs pb-xxs items-start ${n}`,s=i?"16px":"18px",u=l?"not-allowed":"";return z.default.createElement("label",{htmlFor:o,className:c},z.default.createElement("span",{className:"relative mr-xs",style:m(b({},r),{height:s,width:s})},z.default.createElement("input",{id:o,className:`tos-checkbox b bc-gray-light bg-white brad-2 relative outline-none appearance-none ma-0 ${u}`,type:"checkbox",checked:t,onChange:e,"data-testid":o,style:{height:s,width:s},disabled:l}),z.default.createElement("svg",{className:`absolute top-50 left-0 -translate-y-50 ${t?"dib":"dn"}`,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",style:{height:s,width:s}},z.default.createElement("title",null,"Check"),z.default.createElement("path",{d:"M10.052 16.245L3.265 9.46l-1.767 1.768 7.778 7.778a1.25 1.25 0 0 0 1.863-.107L23.415 3.413 21.456 1.86 10.052 16.245z",fill:"#fff",fillRule:"nonzero"}))),a)}),W=h(n(0)),q=(n(2),({htmlText:e,checkboxLabelClass:t,checkboxLabelStyle:n,isRequired:r,id:o,asteriskColor:a="red"})=>W.default.createElement("span",{style:m(b({},n),{paddingTop:"1px"}),className:`db ${t||""}`},W.default.createElement("span",{"data-testid":`${o}Text`,dangerouslySetInnerHTML:{__html:e}}),r&&W.default.createElement("span",{className:`font-xxs ${a}`,style:{lineHeight:"0"}},"*"))),G=n(0),V={tosConfig:{_:{tos:{_:{text:"I agree to The Washington Post's {{TERMS_OF_SERVICE}} and {{PRIVACY_POLICY}}.",required:!0,implicit:!1,prechecked:!1},checkout:{text:"By creating your account, you agree to The Washington Post's {{TERMS_OF_SERVICE}} and {{PRIVACY_POLICY}}.",required:!1,implicit:!0},freeTrial:{text:"By signing up for this free trial, you agree to the {{TERMS_OF_SERVICE}} and {{PRIVACY_POLICY}}.",implicit:!1}},marketingConsent:{_:{text:null,implicit:!0,prechecked:!1}}},us:{tos:{},marketingConsent:{}},ca:{tos:{},marketingConsent:{_:{text:"The Washington Post may use my email address to provide me occasional special offers via email and through other platforms. I can opt out at any time.",implicit:!1},checkout:{required:!1}}},"gb|at|be|bg|hr|cy|cz|dk|ee|fi|fr|de|gr|hu|ie|it|lv|lt|lu|mt|nl|pl|pt|ro|sk|si|es|se|is|no|ch|li":{tos:{freeTrial:{text:"By signing up for this free trial of our , you agree to our {{TERMS_OF_SERVICE}} and understand we process data as set forth in our {{PRIVACY_POLICY}}.",implicit:!1}},marketingConsent:{_:{text:"The Washington Post may use my email address to provide me occasional special offers via email and through other platforms. I can opt out at any time.",implicit:!1},checkout:{required:!1}}}},tosMapObj:{"{{TERMS_OF_SERVICE}}":"Terms of Service","{{PRIVACY_POLICY}}":"Privacy Policy","{{THIRD_PARTY_PARTNERS}}":"third-party partners"}},Y=({propTosConfig:e,propMcConfig:t,isToSNeeded:n,type:r,isConfigNeeded:o,overrideTosHidden:a,userConfigReady:i})=>{let[l,c]=(0,G.useState)(!1),[s,u]=(0,G.useState)({isChecked:!1}),[d,f]=(0,G.useState)({isChecked:!1}),[p,g]=(0,G.useState)(null),y=(()=>{let e=L(),t=E("wp_geo")||"";return t&&t.split("|")[0]?t.split("|")[0].toLowerCase():t||"prod"===e?null:"us"})(),h=o=>{let i=null==o?void 0:o.tosConfig,l=null==o?void 0:o.tosMapObj;i||(i=V.tosConfig,l=V.tosMapObj);let{tos:s,mc:d}=(({s3Config:e,country:t,propTosConfig:n={},propMcConfig:r={},isToSNeeded:o,type:a,overrideTosHidden:i,s3MapObj:l})=>{let c=e._||{},s=b(b({},null==c?void 0:c.tos._),null==c?void 0:c.tos[a]),u=b(b({},null==c?void 0:c.marketingConsent._),null==c?void 0:c.marketingConsent[a]),d={},f={},p=Object.keys(e).find(e=>e.toLowerCase().indexOf(t)>-1);if(p){var g,y,h,O;let t=F(n),o=b(b({},t._),t[p]),i=F(r),l=b(b({},i._),i[p]);d=b(b(b({},null===(g=e[p])||void 0===g?void 0:g.tos._),null===(y=e[p])||void 0===y?void 0:y.tos[a]),o),f=b(b(b({},null===(h=e[p])||void 0===h?void 0:h.marketingConsent._),null===(O=e[p])||void 0===O?void 0:O.marketingConsent[a]),l)}let v=!i&&(!o||d.prechecked);return d=m(b(b({},s),d),{isChecked:!!v}),f=m(b(b({},u),f),{isChecked:!!f.prechecked}),l&&(d.text=B(d.text,l),f.text=B(f.text,l)),{tos:d,mc:f}})({s3Config:i,country:y,propTosConfig:e,propMcConfig:t,isToSNeeded:n,type:r,overrideTosHidden:a,s3MapObj:l});u(s),f(d),c(!0)};return(0,G.useEffect)(()=>{i&&(o||e||t?p?h(p):(()=>{let e=T()?"subsUrl":"configUrl",t=R(e);return Promise.race([fetch(`${t}/static/config/tos/tos.json`,{method:"GET"}),new Promise((e,t)=>setTimeout(()=>t(new Error("timeout")),8e3))])})().then(e=>e.json()).then(e=>{g(e),h(e)}).catch(e=>{console.error(e),h(V)}):c(!0))},[i,o,n]),{tosConfig:s,mcConfig:d,ready:l,country:y,updateConfigValue:(e,t)=>{"tos"===e?u(t):"mc"===e&&f(t)}}},$=e=>{let{type:t="account",tosConfig:n,mcConfig:r,overrideTosHidden:o=!1,refreshKey:a=0}=e||{},[i,l]=(0,w.useState)({}),[c,s]=(0,w.useState)({isHidden:!1,isRequired:!1});(0,w.useEffect)(()=>{let e={},t=()=>{(e=>{let t=!1,n=!1,r=!1;return U().then(o=>{let{marketingConsent:a={},tos:i={}}=o;return n="Y"!==i.consent,(void 0===a.consent||0!=a.consent)&&(r=!0),{tos:i,marketingConsent:a,isConfigNeeded:t=e||n||r,isToSNeeded:n,isMcNeeded:r,userConfigReady:!0}})})(o).then(t=>{e=t,l(t)})},n=e=>{e&&t()},r=N();window.registerPwapiConsumer&&r?window.registerAuthConsumer?window.registerAuthConsumer(n):window.registerAuthConsumer||(window.authConsumers=window.authConsumers||[],window.authConsumers.push(n)):t(),setTimeout(()=>{r&&!e.userConfigReady&&t()},3e3)},[o,a]);let{isConfigNeeded:u,isToSNeeded:d,isMcNeeded:f,userConfigReady:p}=i,{tosConfig:b,mcConfig:m,ready:g,country:y,updateConfigValue:h}=Y({propTosConfig:n,propMcConfig:r,isToSNeeded:d,type:t,isConfigNeeded:u,overrideTosHidden:o,userConfigReady:p});return(0,w.useEffect)(()=>{if(g){let e=(!d||b.implicit)&&!o&&(!f||m.implicit);s({isHidden:e,isRequired:!(!d||!b.required)||!(!f||!m.required)})}},[g,i]),{ready:g,isHidden:c.isHidden,isRequired:c.isRequired,storedUserConfig:i,tosConfig:b,mcConfig:m,country:y,updateConfigValue:h}},X=e=>{let{isSubmitted:t=!1,email:n,className:r="",checkboxLabelClass:o="",checkboxLabelStyle:a={},onChange:i=(()=>{console.error("onChange function missing"),k("logFailure",{message:"onChange function missing"})}),tosConfigReady:l=(()=>{}),overrideTosHidden:c=!1,labelSizeSm:s=!0,disabled:u=!1,asteriskColor:d="red",pageLocation:f=""}=e,{storedUserConfig:p,tosConfig:g,mcConfig:y,ready:h,country:O,updateConfigValue:v}=$(e),{tos:E={},marketingConsent:S={},isConfigNeeded:_,isToSNeeded:C,isMcNeeded:A}=p,L=(!C||g.implicit)&&!c&&(!A||y.implicit);(0,w.useEffect)(()=>{h&&((!g.required&&!y.required||!_)&&i(!0),l({isHidden:L,tosConfig:g,mcConfig:y}))},[h]),(0,w.useEffect)(()=>{g.required&&y.required?i(g.isChecked&&y.isChecked):g.required?i(g.isChecked):y.required&&i(y.isChecked)},[g.isChecked,y.isChecked]);let I=()=>{if(!O)return console.error("SIP failed - wp_geo missing"),k("logFailure",{message:"wp_geo missing"}),void l({isHidden:L,isProcessed:!0,isSIPFailed:!0});let{consent:e,consentCountry:t}=E,{consent:r,consentCountry:o}=S,a=y.isChecked?0:1,i=y.implicit?-1:a,s=O,u=g.isChecked||!C||g.implicit?"Y":"N";10==r?(i=i<0?1:i,s=O):(void 0!==r&&!A||r>-1&&i<0||r==i)&&(i=r,s=o),((e,t,n)=>{t&&(e.email=t);let r=R("subsUrl"),o=JSON.stringify(e);j(`${r}/user/save-identity-preferences`,{method:"POST",credentials:"include",body:o}).then(t=>{if("SUCCESS"===t.status&&N()){let t=JSON.parse(localStorage.getItem(P));t&&t.signedIn?(T()||D(e.privacySetting),n()):M(e.privacySetting,n)}}).catch(e=>{console.error(e),k("logFailure",{message:"SIP failed",locationId:"SC:TermsOfService:api:/user/save-identity-preferences",state:{status:"failure",request:o}}),n("failed")})})({privacySetting:{tos:{consent:`${u}`,consentCountry:"Y"!==e||C||c?O:t},marketingConsent:{consent:`${i}`,consentCountry:s}}},n,e=>{l("failed"===e?{isHidden:L,isProcessed:!0,isSIPFailed:!0}:{isHidden:L,isProcessed:!0})})};(0,w.useEffect)(()=>{t&&I()},[t]);let x=s?"font-xxxxs":"font-xxxs",U=w.default.createElement(q,{htmlText:g.text,isRequired:g.required,id:f?`${f}TosCheckbox`:"tosCheckbox",asteriskColor:d,checkboxLabelClass:g.implicit?`${x} ${o} pt-xxs pb-xxs gray-dark`:x,checkboxLabelStyle:a}),F=w.default.createElement(q,{htmlText:y.text,isRequired:y.required,id:f?`${f}McCheckbox`:"mcCheckbox",asteriskColor:d,checkboxLabelClass:y.implicit?`gray-dark ${x} ${o}`:x,checkboxLabelStyle:a}),B=C||c;return w.default.createElement("div",{className:`db mt-xs mb-xs ${r}`},B&&g.text&&!g.implicit&&w.default.createElement(H,{htmlText:g.text,onChange:()=>v("tos",m(b({},g),{isChecked:!g.isChecked})),isChecked:g.isChecked,checkboxLabelClass:o,checkboxLabelStyle:a,isRequired:g.required,id:f?`${f}TosCheckbox`:"tosCheckbox",labelSizeSm:s,disabled:u},U),B&&g.text&&g.implicit&&U,A&&y.text&&!y.implicit&&w.default.createElement(H,{htmlText:y.text,onChange:()=>v("mc",m(b({},y),{isChecked:!y.isChecked})),isChecked:y.isChecked,checkboxLabelClass:o,checkboxLabelStyle:a,isRequired:y.required,id:f?`${f}McCheckbox`:"mcCheckbox",labelSizeSm:s,disabled:u},F),A&&y.text&&y.implicit&&F)};e.exports=O(v)},function(e,t,n){"use strict";var r=n(6);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,a,i){if(i!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";n.r(t),n.d(t,"SoftwallNL",function(){return gn});var r=n(0),o=n.n(r),a=o.a.createContext({}),i=n(1),l=n.n(i);function c(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:[];return e.includes("100")||e.includes("110")||e.includes("120")?"wall_retargeting":"wall_standard"}function V(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(",").map(function(e){return e.replace(/\/|^wp - /g,"").replace(/,/g,";").trim()}).join(";").toLocaleLowerCase()}function Y(e,t){var n,r,o,a,i,l;return{label:"o1",browserUserAgentHit:navigator.userAgent,promoCode:"o1",acqEntranceType:G(null==e?void 0:null===(n=e.data)||void 0===n?void 0:n.actionCodes),geoMarket:(a=k().DMA===D,i=k().country_code,l=M(),a&&"US"===i?"L":i&&"US"!==i&&"CA"!==i&&!l?"I":l?"E":"CA"===i?"C":"N"),acqTemplate:"",acqEntrancePage:B(),arcId:t||"",contentTags:V(null===(r=window)||void 0===r?void 0:null===(o=r.wpMetaData)||void 0===o?void 0:o.ct_tags),actionCode:"".concat(null==e?void 0:e.action)}}var $=function(e,t){var n=e.pwapiResponse,r=e.arcId,o=function(){var e;return(null===(e=window.wpMetaData)||void 0===e?void 0:e.content_type)||""},a=function(e){window.dataLayer=window.dataLayer||[],window.dataLayer.push(e)};return{GAData:W(W({},Y(n,r)),t),addEvent:a,addEventWithArticleData:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a(W(W(W({userAgentHit:window.navigator.userAgent,userAgentSession:window.navigator.userAgent},Y(n,r)),t),e))},addMarketingEvent:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"paywall";a({event:"acq_marketing_".concat(e),category:"acquisition",action:"acq_marketing"})},addGAParamsToURL:function(e,a){var i=W(W(W({},Y(n,r)),t),a),l=encodeURIComponent(z()),c=o(),s={promo:i.promoCode,arcId:i.arcId,acqEntType:i.acqEntranceType,destination:l,next_url:l,p:i.subscription_pricing,s_l:i.subscription_location,e:i.subscription_experience,s_ct:c,itid:i.itid,ga_label:i.ga_label},u=new URL(e);return Object.keys(s).forEach(function(e){s[e]&&u.searchParams.append(e,s[e])}),u.toString()},getContentType:o}},X="wp_nl";function J(e){return{softwall:"sw","softwall-nl":"sw","softwall-subscribe":"sw",regwall:"rw","paywall-purchase":"pw","paywall-default":"pw"}[e]}function K(){return"undefined"!=typeof window?JSON.parse(localStorage.getItem(X)||"{}"):{}}function Z(e){localStorage.setItem(X,JSON.stringify(e))}function Q(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:48,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:720,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"softwall",a=K(),i=J(o);if(t){var l=Date.now()+60*n*60*1e3;a[i]=l,Z(a)}else if(e){var c=Date.now()+60*r*60*1e3;a[e]=c,Z(a)}}function ee(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=K(),n=(t[e]||0)+1;t[e]=n,Z(t)}var te=function(){return"1"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")},ne=function(){return"2"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")};function re(){var e=N("wp_devicetype");return ne(e)?"tablet":te(e)?"mobile":"desktop"}var oe=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(",").map(function(e){return e.trim()}).includes(re())};function ae(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=oe(e.EXCLUDING_PLATFORMS),r=!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"softwall",n=K(),r=J(t);if(!n[r]&&!n[e])return!0;var o=Date.now(),a=!n[r]||n[r]0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=K()[e]||0;return n>=t&&0!==n||-1===n}(e.PAYWALL_TEMPLATE_ID,e.MAX_SNOOZE);return{isExcluded:n,shouldCloseWall:!/\/wall-builder\//.test(location.href)&&(t||n||!(null!=e&&e.SHOW_ALWAYS)&&r)&&!window.pendingIframeResize}}var ie=function(){var e=Object(r.useContext)(a).setSizes,t=function(){requestAnimationFrame(function(){e&&e({isSmall:h(),isMedium:O(),isLarge:v(),isExtraLarge:w()})})};return Object(r.useEffect)(function(){return"undefined"!=typeof window&&(e&&e({isExtraLarge:w()}),window.addEventListener("resize",t,!1)),function(){"undefined"!=typeof window&&window.removeEventListener("resize",t,!1)}},[]),null},le={NODE_ENV:"production",SERVICE_URL:"https://subscribe.washingtonpost.com",WALL_CONFIG:{nl_start_location:"URL",ACQ_BASE_URL:"https://subscribe.washingtonpost.com",HAS_PROMO_LABEL:"both",CTA_BUTTON_HEX_COLOR_OVERRIDE:"",AUTO_COLLAPSED_SECOND:0,SCREEN_STATE:"Default",SUPPORTING_TEXT:"You'll receive a succinct overview of the latest developments from Ukraine, updates from our many journalists on the ground, plus smart, big-picture analysis and top reads.",SHOW_CLOSE_ON_EXPAND:!0,EXPANDED_HEADER:"Sign up for our Today’s WorldView newsletter",PAYWALL_TEMPLATE_ID:"softwall-nl-849b3ab0905",NEWSLETTER_ID:"0FDBE7585524F003E050007F01000F39",TEMPLATE_ID:"softwall-nl",nl_start_method:"REGWALL_SOFT",MIN_ON_LOAD:!0,PROMO_LABEL_PRIMARY:"NEWSLETTER",ASSET_BASE_URL:"https://www.washingtonpost.com/subscribe",PROMO_LABEL_HAS_LOGO:!0,NOTE:"",GTM_LOADER:"gtm",CTA_BUTTON_TEXT:"Sign Up",PROMO_LABEL_PRIMARY_COLOR:"Offblack",INCLUDE_LOGGING:!0,CTA_BUTTON_COLOR:"Blue",EXPAND_ON_SCROLL:!1,PROMO_LABEL_SECONDARY:"WEEKDAYS",PROMO_LABEL_SECONDARY_COLOR:"Offblack",REGISTRATION_SUCCESS_HEADER:"You're all set!",MAX_SNOOZE:1,CLOSE_BUTTON_EXPIRATION_HOUR:48,DEPLOYMENT_TOKEN:1650648118088,COLLAPSED_HEADER:"Get updates and analysis on the war in Ukraine with our newsletter",SUBMIT_EXPIRATION_HOUR:720,SHOW_CLOSE_ON_MIN:!1,CTA_BUTTON_STYLE:"Arrow",DEFAULT_FONT_COLOR:"offblack",BACKGROUND_COLOR:"White",WALL_CONFIG_ID:"b3ab0905-3b41-4c16-b2f5-23dbe508fd30",NEWSLETTER_NAME:"Today's WorldView",PAGE_RELOAD_AFTER_SIGN_UP:!1,EXCLUDING_PLATFORMS:"mobile",SHOW_ALWAYS:!1,PRIMARY_IMAGE_URL:"",COLLAPSE_ON_SCROLL:!1,MOBILE_IMAGE_URL:"http://placehold.jp/100x200.png",DEFAULT_LINK_COLOR:"gray-dark",LISTEN_FOR_ADS:!1,AUTO_COLLAPSED:!1},VERSION:"3.4.1"};function ce(e){var t=N("wp_geo").split("|"),n=t[0],r=t[t.length-1];return e.includes(n)||(n=r),n}function se(e){var t,n,r,i=e.wallState,l=e.children,c="default";!parent.location.href.includes("wall-builder")&&(null==i?void 0:null===(t=i.wallConfig)||void 0===t?void 0:null===(n=t.REGION_LIST)||void 0===n?void 0:n.length)>0&&(c=ce(null==i?void 0:null===(r=i.wallConfig)||void 0===r?void 0:r.REGION_LIST).toLowerCase());return o.a.createElement(a.Provider,{value:i},l,o.a.createElement(ie,null),o.a.createElement("span",{id:"wall-templates-version","data-qa":"region-".concat(c),style:{display:"none"}},le.VERSION))}function ue(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function de(e){for(var t=1;t$/,"").trim())))))}}},Se=["children","color","href","className","style","onClick","rounded","sendMessages","contentId","buttonStyle","innerHTML","isLoading"];function _e(){return(_e=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var Le=function(e){var t=e.children,n=e.color,i=void 0===n?"WaPo blue":n,c=e.href,s=e.className,u=e.style,d=e.onClick,f=e.rounded,p=e.sendMessages,b=void 0!==p&&p,m=e.contentId,g=void 0===m?"":m,y=e.buttonStyle,h=void 0===y?"Button":y,O=e.innerHTML,v=void 0===O?"Subscribe":O,w=e.isLoading,E=void 0!==w&&w,S=Ae(e,Se),_=Ee(g),C=_.onChange,P=_.isContentEditable,A=Object(r.useContext)(a).wallConfig,L=null==A?void 0:A.DEFAULT_FONT_COLOR,T="",I="Link"===h||"Arrow"===h||"Text"===h,x="Text"===h;T=I||"White"!==i&&"Black"!==i&&"WaPo blue"!==i?I?l()({"subs-theme":"White"!==i&&"WaPo blue"!==i&&"Black"!==i},"".concat([j[i]]," bold")):"btn subs-theme bg-".concat(j[i]):"btn btn-".concat(j[i]),v=E?" ".concat(v):v;var R=t||o.a.createElement("span",{dangerouslySetInnerHTML:{__html:v},id:g,contentEditable:!!g&&P}),N=je({role:"button",href:c,style:je(je({whiteSpace:I?"normal":"nowrap",boxSizing:"border-box",borderRadius:f?"31px":0},u),{},{borderColor:"White"!==i?"unset":void 0,padding:I?"":null==u?void 0:u.padding,border:"white"===L?"unset":"initial"}),onBlur:C,onClick:function(e){g&&!P||!g?d&&d(e):P&&e.preventDefault()},className:l()(s,"ma-0",{pointer:!x},{dib:!I},T),children:o.a.createElement(o.a.Fragment,null,R,"Arrow"===h?o.a.createElement(he,{angle:0,size:16,color:(null==u?void 0:u.color)||i,style:{marginLeft:"5px",verticalAlign:"middle"}}):null)},S),D="".concat(g,"_CTA_WRAPPER");if(c||P&&g||I&&!x){var k="_self";return c&&b&&!parent.location.href.includes("wall-builder")&&(k="_top"),o.a.createElement("a",_e({id:D},N,{target:k}))}return x?o.a.createElement("div",_e({id:D},N)):o.a.createElement("button",_e({id:D},N))};function Te(){return(Te=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)){Ke.push(e);var t=document.createElement("script");t.src=e,t.async=!0;var n=function(){a({loaded:!0,error:!1})},r=function(){var n=Ke.indexOf(e);n>=0&&Ke.splice(n,1),t.remove(),a({loaded:!0,error:!0})};return t.addEventListener("load",n),t.addEventListener("error",r),document.body.appendChild(t),function(){t.removeEventListener("load",n),t.removeEventListener("error",r)}}a({loaded:!0,error:!1})},[e]),n.loaded,n.error),o.a.createElement("div",{id:"recaptcha_wall",className:"grecaptcha"})});function Qe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,a=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw o}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return et(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return et(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function et(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function wt(e){var t=e.id,n=e.label,i=e.style,c=e.value,s=e.onChange,u=e.className,d=e.validators,f=e.inputStyle,p=e.fieldButton,b=e.errorMessage,m=vt(e,pt),g=Object(r.useContext)(a),y=g.isSmall,h=g.wallConfig,O=ht(Object(r.useState)(!1),2),v=O[0],w=O[1],E=ht(Object(r.useState)([]),2),S=E[0],_=E[1],C=Object(r.useRef)(null),j=function(){return(!!S.length||b)&&o.a.createElement("span",{className:"red absolute",style:{top:"-20px"}},S[0]||b)||null};return o.a.createElement("div",{className:"relative flex",style:gt({},i)},o.a.createElement(j,null),o.a.createElement("input",bt({style:gt({transition:"padding 200ms linear 200ms",borderTopRightRadius:0,borderBottomRightRadius:0,border:b||null!=S&&S.length?"solid 1px #d8070e":""},f),className:l()(u,"pl-sm","pr-sm","font--subhead","font-xxs","h-md","light","brad-2","b","form-input-valid","bg-white","gray-darkest",{"flex-grow-1":y||"regwall"===(null==h?void 0:h.TEMPLATE_ID)},"w-50-ns","ma-0","border-box",{"pt-sm":v||c}),value:c,onChange:function(e){var t;s&&s(e),null==C||null===(t=C.current)||void 0===t||t.setCustomValidity("")},onFocus:function(){return w(!0)},onBlur:function(){w(!1),Array.isArray(d)&&_(d.map(function(e){var t,n=e(c);return null==C||null===(t=C.current)||void 0===t||t.setCustomValidity(n||""),n}).filter(function(e){return e}))},id:t,ref:C},m)),o.a.createElement("label",{htmlFor:t,className:"absolute",style:{transition:"all 200ms ease-in-out 0s",transform:c||v?"scale(0.7) translate3D(25px, -130%, 0)":"translate3D(16px, -50%, 0)",transformOrigin:"top left",top:"50%",color:"#5a5a5a"}},n),p)}var Et=function(e){if(!(null!=e&&e.trim()&&/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)||!e))return"Invalid email address"};function St(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _t(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=qt(Object(r.useState)(!1),2),i=a[0],l=a[1];var c=!1;function s(r,o){console.info("Opt - NAME/VALUE: ".concat(o,"/").concat(r," - ended? ").concat(c));var a=window.dataLayer&&window.dataLayer.filter(function(e){return e["optimize.".concat(t,".").concat(o,".").concat(r,".complete")]})[0]||!1;if(!c&&e.includes(o)&&(a||"timeout"===r)){if(n(window["".concat(o).concat(r,"_").concat(t,"Cfg")]||{}),l(!0),"timeout"!==r){var i={optExpActive:"".concat(t,"|").concat(o,".").concat(r)};window&&window.dataLayer&&window.dataLayer.push(i)}c=!0,console.info("Opt - NAME/VALUE: ".concat(o,"/").concat(r," complete"))}}var u=Object(r.useCallback)(function(){window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"optimize.wall"})},[t]);return Object(r.useEffect)(function(){if(e.length>0){!function(){window.dataLayer&&window.dataLayer.push(arguments)}("event","optimize.callback",{callback:s});var t=2e3,n=o&&parent&&!parent.location.href.includes("wall-builder");e.forEach(function(e){var r,o=void 0!==(null===(r=window.google_optimize)||void 0===r?void 0:r.get(e));t=o||n?t:0}),u(),setTimeout(function(){e.forEach(function(e){s("timeout",e)})},t)}else l(!0)},[e]),{isOptimize:e.length>0,isExperimentComplete:i}};function Yt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,a=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw o}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return $t(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $t(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1&&(c(!1),u())};return Object(r.useEffect)(function(){var e;return t&&s?(a.postMessage("CloseRegwall","*"),c(!1)):s&&!n?(c(!0),window.addEventListener("message",d,!1),!(e=a.document.getElementById("slug_fixedBottom"))||e&&e.offsetHeight<=0?(c(!1),u()):e&&e.offsetHeight>0&&setTimeout(function(){e=a.document.getElementById("slug_fixedBottom");var t=a.googletag||{};Array.isArray(t.cmd)&&0===t.cmd.length&&(!e||e.childElementCount<=0)&&(c(!1),u())},2e3)):c(!1),function(){u()}},[t]),l};function Jt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,a=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw o}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Kt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Kt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]&&arguments[2],o=Jt(Object(r.useState)(!1),2),a=o[0],i=o[1],l=Jt(Object(r.useState)(!1),2),c=l[0],s=l[1],u=Jt(Object(r.useState)([]),2),d=u[0],f=u[1],p=Jt(Object(r.useState)(null),2),b=p[0],m=p[1],g=n&&parent&&!parent.location.href.includes("wall-builder"),y=g?parent:window,h=function e(t){var n;if(t.lineItemId)m(t.lineItemId),n=t.lineItemId;else{var r=t.slot;if(r&&r.getResponseInformation){var o=(r.getResponseInformation()||{}).sourceAgnosticLineItemId;m(o),n=o}}n&&(y.googletag.pubads().removeEventListener("slotRenderEnded",e),y.googletag.pubads().removeEventListener("impressionViewable",e))};return Object(r.useEffect)(function(){var n=re(),r=(t||"").indexOf(n)>-1;if(!/wall-builder/.test(y.location.href)&&r&&e&&"undefined"!=typeof window){var o=y.wpMetaData||{},a=y.googletag||{};Array.isArray(a.cmd)&&0===a.cmd.length?s(!0):(o.adTrackerId||(y.googletag=y.googletag||{cmd:[]},y.googletag.cmd.push(function(){y.googletag.pubads().addEventListener("slotRenderEnded",h)}),y.googletag.cmd.push(function(){y.googletag.pubads().addEventListener("impressionViewable",h)})),fetch("https://sponsorship-lines.zeustechnology.com/washingtonpost/washingtonpost/lineItems.json").then(function(e){return e.json()}).then(function(e){if(!e||!Array.isArray(e)||e&&0===e.length)s(!0);else if(y=g?parent:window,(o=y.wpMetaData||{}).adTrackerId||b){var t=o.adTrackerId||b,n=Zt.indexOf(t)<0&&e.indexOf(t)>-1;i(n),s(!0)}else f(e)}).catch(function(e){console.error(e,"Failed to retrieve ids from the sponsorship tracker."),s(!0)}))}else s(!0)},[]),Object(r.useEffect)(function(){if(!c&&b&&d.length>0){var e=Zt.indexOf(b||0)<0&&d.indexOf(b)>-1;i(e),s(!0)}},[b,d,c]),{hideWallDueToAds:a,isSponsorAdChecked:c}};function en(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,a=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw o}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return tn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tn(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"both",o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:70,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],l=arguments.length>4&&void 0!==arguments[4]&&arguments[4],c=en(Object(r.useState)({scrollUp:!1,scrollDown:!1}),2),s=c[0],u=c[1],d=l&&parent&&!parent.location.href.includes("wall-builder")?parent:window,f=function(){t&&d.cancelAnimationFrame(t),t=d.requestAnimationFrame(function(){var t=d.pageYOffset||d.document.documentElement.scrollTop,r=t>e+a;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0){var o,a=ce(null===(o=e)||void 0===o?void 0:o.REGION_LIST);e=cn(cn({},e),e[a])}return e}(u,n.currentRegion),parent.location.href.includes("wall-builder")||(n.wallConfig=u),Object.keys(c).length&&(n.wallConfig=fn(fn({},u),c),u=n.wallConfig);var d=Vt(null===(t=u)||void 0===t?void 0:t.EXPERIMENT_ID,"softwall",s,i),f=d.isOptimize,p=d.isExperimentComplete,b=u,m=b.MIN_ON_LOAD,g=b.NEWSLETTER_NAME,y=b.nl_start_method,h=b.nl_start_location,O=b.nl_start_initiative,v=b.PAYWALL_TEMPLATE_ID,w=b.BACKGROUND_COLOR,E=b.SCREEN_STATE,S=b.LISTEN_FOR_ADS,_=b.LISTEN_FOR_ADS_PLATFORMS,C=Qt(S,_,i),j=C.hideWallDueToAds,P=C.isSponsorAdChecked,A=Object(r.useMemo)(function(){return ae(u,j)},[P]),L=A.isExcluded,T=A.shouldCloseWall,I=Xt({shouldCloseWall:T,isExcluded:L,sendMessages:i}),x=bn(Object(r.useState)(!1),2),N=x[0],D=x[1],k=bn(Object(r.useState)("Success"===E),2),M=k[0],U=k[1],F=bn(Object(r.useState)("Success"===E?"test@wapo.com":null),2),z=F[0],H=F[1],W=bn(Object(r.useState)(!m&&"Collapsed"!==E||"Expanded"===E),2),q=W[0],G=W[1],V=bn(Object(r.useState)(0),2),Y=V[0],X=V[1],J={label:(null==g?void 0:g.replace(/ /g,"_").replace(/'/g,"'").toLowerCase())||"softwall",promoCode:"softwall",emailEnrollMethod:y||"REGWALL_SOFT",emailEnrollLocation:h||"URL",emailEnrollInitiative:O||B(),arcId:null==a?void 0:a._id},K=$(n,J),Z=K.addEventWithArticleData,Q=K.addMarketingEvent;Object(r.useEffect)(function(){P&&!T&&Q("softwall")},[P]),Object(r.useEffect)(function(){i&&parent&&!parent.location.href.includes("wall-builder")&&parent.postMessage(JSON.stringify({background:"transparent",bottom:"0px",scrollAllowed:!0,wallAction:"open",wallType:"softwall"}),"*")},[]),Object(r.useEffect)(function(){i&&parent&&!parent.location.href.includes("wall-builder")&&(T||j)&&parent.postMessage(JSON.stringify({wall:!0,wallType:"softwall",wallAction:"close"}),"*")},[T]),Object(r.useEffect)(function(){P&&!T&&Z({event:"acquisition-softwall",category:"acquisition",action:"acquisition-softwall"})},[w,P]),Object(r.useLayoutEffect)(function(){if(i&&parent){var e="Default";M&&z?e="Success":m&&q?e="Expanded":m||q||(e="Collapsed"),parent.location.href.includes("wall-builder")&&parent.postMessage({newScreenState:e},"*")}},[q]),Object(r.useEffect)(function(){G(!m&&"Collapsed"!==E||"Expanded"===E),X(Y+1),"Success"===E?(z||H("test@wapo.com"),U(!0)):(H(null),U(!1))},[m,E]);var ee=an(u,!0,I,i),te=ee.collapseOnScroll,ne=ee.expandOnScroll,re=ee.activateAutoCollapse;Object(r.useEffect)(function(){P&&(!q&&ne&&!T||q&&te&&!T)&&oe()},[ne,te,P]);var oe=function(){G(!q),D(!0),X(Y+1);var e=re?"auto-minimize":"minimize";re?e="collapse-auto":te&&(e="collapse-scroll");var t=ne?"expand-scroll":"expand";Z({event:"acquisition-softwall-".concat(q?e:t),category:"acquisition",action:"acquisition-softwall-".concat(q?e:t)})},ie={wallConfig:u,GAEventData:J,handleExpand:oe,handleViewChange:function(){X(Y+1)},isExpanded:q,registrationSuccess:M,sendMessages:i};return!P||!/\/wall-builder\//.test(location.href)&&(T||!n.isShowing&&"test"!==le.NODE_ENV||I)?null:o.a.createElement(se,e,o.a.createElement(R,{id:v,backgroundColor:w||"White",triggerResize:Y,sendMessages:i,style:f&&!p?{height:0}:{},templateId:u.TEMPLATE_ID},o.a.createElement(Wt,un({},ie,{registeredEmail:z})),o.a.createElement(Ft,un({},ie,{setRegistrationSuccess:U,setRegisteredEmail:H,setResizeCounter:X,sendMessages:i})),o.a.createElement($e,un({},ie,{hasExpanded:N}))))});gn.displayName="SoftwallNL";t.default=gn}])); //# sourceURL=browsertools://www.washingtonpost.com/subscribe/remote-component1650648135238.js