(()=>{"use strict";var e,t,n,a={43595(e,t,n){var a=n(34357),o=n(712),i=n(16082),r=n(72397),s=n(20256),c=n(36267),l=n(71015);function d(e){if(!e)return null;const t=parseInt(e.getAttribute("maxlength"));if(!t)return e;const n=e.parentNode;n.removeChild(e);const a=[],o=document.createElement("input");o.setAttribute("type","hidden"),o.setAttribute("name","otp_code"),n.appendChild(o);for(let e=0;e{const i=n.querySelector(`[data-index="${e-1}"]`),r=n.querySelector(`[data-index="${e+1}"]`);switch(t.key){case"Backspace":t.preventDefault(),t.target.value="",i&&i.focus(),a[e]="",o.value=a.join("");break;case"ArrowLeft":t.preventDefault(),i&&i.focus();break;case"ArrowRight":t.preventDefault(),r&&r.focus();break;default:t.key.match(/^[0-9]$/)&&(t.preventDefault(),t.target.value=t.key,t.target.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),r&&r.focus())}}),i.addEventListener("input",i=>{const r=i.target.value.trim();if(t!==r.length){if(r.match(/^[0-9]$/)){a[e]=r;const t=n.querySelector(`[data-index="${e+1}"]`);t&&t.focus()}else i.target.value="";o.value=a.join("")}else{for(let e=0;e{e.preventDefault();const i=(e.clipboardData||window.clipboardData).getData("text");if(i.length===t){for(let e=0;e{e.classList.remove("newspack-reader__logins--disabled")}),document.querySelectorAll(".newspack-ui__button--google-oauth").forEach(e=>{const t=e.closest("form");e.addEventListener("click",()=>{(0,l.cY)("log","[Google OAuth] Login button clicked"),t?.startLoginFlow&&t.startLoginFlow();const e=t?(0,r.wJ)(new FormData(t),["lists[]"]):{};e.current_page_url=window.location.href,(0,l.cY)("log","[Google OAuth] Opening auth window with metadata:",e);const n=window.open("about:blank","newspack_google_login","width=500,height=600");let a=null;const o=()=>{(0,l.cY)("log","[Google OAuth] Cleanup called"),a&&(window.removeEventListener("message",a),a=null)};a=n=>{(0,l.cY)("log","[Google OAuth] Received postMessage:",{origin:n.origin,data:n.data,expectedOrigin:window.location.origin}),n.origin===window.location.origin&&"google-oauth-success"===n.data&&((0,l.cY)("log","[Google OAuth] Valid success message received, calling checkLoginStatus"),o(),(e=>{(0,l.cY)("log","[Google OAuth] checkLoginStatus called with metadata:",e),fetch(`/wp-json/newspack/v1/login/google/register?metadata=${JSON.stringify(e)}`).then(e=>{(0,l.cY)("log","[Google OAuth] Register response status:",e.status),e.json().then(({message:n,data:a})=>{(0,l.cY)("log","[Google OAuth] Register response data:",{message:n,data:a}),t?.endLoginFlow&&t.endLoginFlow(n,e.status,a)}).catch(n=>{(0,l.cY)("error","[Google OAuth] Error parsing register response:",n),t?.endLoginFlow&&t.endLoginFlow(n?.message,e.status)})}).catch(e=>{(0,l.cY)("error","[Google OAuth] Error fetching register endpoint:",e),t?.endLoginFlow&&t.endLoginFlow(e?.message)})})(e))},window.addEventListener("message",a),fetch("/wp-json/newspack/v1/login/google?r="+Math.random()).then(e=>e.json().then(t=>Promise.resolve({data:t,status:e.status}))).then(({data:e,status:a})=>{200!==a?(n&&n.close(),o(),t?.endLoginFlow&&t.endLoginFlow(e.message,a)):n?n.location=e:t?.endLoginFlow&&(o(),t.endLoginFlow(newspack_reader_activation_labels.blocked_popup))}).catch(e=>{o(),t?.endLoginFlow&&t.endLoginFlow(e?.message,400),n&&n.close()})})})}),(0,r.Qc)(function(){document.querySelectorAll('input[name="otp_code"]').forEach(d)});const u=["signin","pwd","otp","success"];window.newspackRAS=window.newspackRAS||[],window.newspackRAS.push(function(e){(0,r.Qc)(function(){const t=[...document.querySelectorAll(".newspack-reader-auth")];t?.length&&(t.forEach(t=>{const n=t.querySelector("form");if(!n)return;const a=n.querySelector('input[name="action"]'),l=n.querySelector('input[name="npe"]'),d=n.querySelector('input[name="otp_code"]'),p=n.querySelector('input[name="password"]'),g=n.querySelectorAll('[type="submit"]'),f=t.querySelectorAll("[data-back]"),w=t.querySelector("[data-send-code]"),h=t.querySelector("[data-resend-code]"),m=t.querySelector(".response"),_=()=>new URLSearchParams(window.location.search).has("redirect"),y=e=>{e.addEventListener("click",function(e){e.preventDefault(),t.setFormAction(e.target.getAttribute("data-set-action"),!0)})};let v;n.setMessageContent=(e="",t=!1)=>{e?("string"==typeof e?m.innerHTML=e:m.appendChild(e),t?(m.classList.remove("newspack-ui__helper-text"),m.classList.add("newspack-ui__inline-error"),n.style.opacity=1):(m.classList.remove("newspack-ui__inline-error"),m.classList.add("newspack-ui__helper-text")),m.style.display="block"):(m.style.display="none",m.innerHTML="",m.classList.remove("newspack-ui__inline-error","newspack-ui__helper-text"))},t.setFormAction=(o,i=!1)=>{u.includes(o)||(o="signin"),"signin"!==o&&"success"!==o||n.setMessageContent();const r=window.newspack_grecaptcha||{};if("v2_invisible"===r?.version&&("signin"===o?(n.removeAttribute("data-skip-recaptcha"),r.render([n],e=>n.setMessageContent(e,!0))):n.setAttribute("data-skip-recaptcha","1")),"otp"===o){if(!e.getOTPHash())return;t.querySelectorAll(".email-address").forEach(t=>{t.textContent=e.getReader()?.email||""});const n=t.querySelector('.otp-field input[type="text"]');n&&n.focus()}v=o,a.value=o,t.removeAttribute("data-form-status"),t.querySelectorAll("[data-action]").forEach(e=>{"none"!==e.style.display&&(e.prevDisplay=e.style.display),e.style.display="none"}),t.querySelectorAll('[data-action~="'+o+'"]').forEach(e=>{e.style.display=e.prevDisplay}),i&&("pwd"===o&&l.value?p.focus():"otp"===o?d.focus():l.focus()),t.formActionCallback&&t.formActionCallback(o)},t.setFormAction("signin");const k=()=>{const t=e.getReader();l&&(l.value=t?.email||""),setTimeout(function(){t?.authenticated&&"success"!==v&&n.endLoginFlow(null,200)},1e3)};e.on("reader",k),k(),f.forEach(a=>{a.addEventListener("click",function(a){if(a.preventDefault(),t.config?.backButtonClosesModal||e.getReader()?.authenticated){const e=t.closest(".newspack-ui__modal-container");if(e)return void e.setAttribute("data-state","closed")}n.setMessageContent(),t.setFormAction("signin",!0)})});const b=()=>{if(!h)return;h.originalButtonText=h.textContent.replace(/\s\(\d{1,}:\d{2}\)/,"");const t=()=>{const t=e.getOTPTimeRemaining();t?h.textContent=`${h.originalButtonText} (${(0,r.fU)(t)})`:(h.textContent=h.originalButtonText,clearInterval(h.otpTimerInterval)),h.disabled=!!t};e.getOTPTimeRemaining()&&(h.otpTimerInterval&&clearInterval(h.otpTimerInterval),h.otpTimerInterval=setInterval(t,1e3),t())};(w||h)&&[w,h].forEach(a=>{a.addEventListener("click",function(a){a.preventDefault(),n.setMessageContent(),n.startLoginFlow();const o=new FormData;o.set("reader-activation-auth-form",1),o.set("npe",l.value),o.set("action","link");const i=(0,s.m)();if(i||_()){const e=new URL(window.location.href);i&&e.searchParams.set("checkout",1),o.set("redirect_url",e.toString())}fetch(n.getAttribute("action")||window.location.pathname,{method:"POST",headers:{Accept:"application/json"},body:o}).then(a=>{if(200!==a.status)return a.json().then(({message:e})=>{n.endLoginFlow(e,a.status)});n.setMessageContent("pwd"===v?newspack_reader_activation_labels.code_sent:newspack_reader_activation_labels.code_resent),t.setFormAction("otp"),e.getOTPTimeRemaining()||e.setOTPTimer()}).finally(()=>{b(),n.style.opacity=1,g.forEach(e=>{e.disabled=!1,e.classList.remove("newspack-ui__button--loading")})})})}),t.querySelectorAll("[data-set-action]").forEach(y),n.startLoginFlow=()=>{t.removeAttribute("data-form-status"),g.forEach(e=>{e.disabled=!0}),n.setMessageContent(),n.style.opacity=.5},n.isVerifying=!1,n.endLoginFlow=(a=null,i=500,r=null)=>{if(t.setAttribute("data-form-status",i),t.config?.closeOnSuccess&&(n.style.opacity=1),a&&(document.createElement("p").innerHTML=a,200!==i&&(n.isVerifying=!1,n.setMessageContent(a,!0),m.querySelectorAll("[data-set-action]").forEach(y),g.forEach(e=>{e.disabled=!1,e.classList.remove("newspack-ui__button--loading")}))),200===i){if(r?.email){e.setReaderEmail(r.email),e.setAuthenticated(!!r.authenticated);const t={email:r.email},a=new FormData(n);(r.metadata?.gate_post_id||a.has("gate_post_id"))&&(t.gate_post_id=r.metadata.gate_post_id||a.get("gate_post_id")),(r.metadata?.newspack_popup_id||a.has("newspack_popup_id"))&&(t.newspack_popup_id=r.metadata.newspack_popup_id||a.get("newspack_popup_id")),r?.sso&&(t.sso=!0),r?.existing_user?e.dispatchActivity("reader_logged_in",{...t,login_method:r?.metadata?.login_method||"auth-form"}):e.dispatchActivity("reader_registered",{...t,registration_method:r?.metadata?.registration_method||"auth-form"})}const i=r?.registered&&newspack_ras_config?.verify_new_reader_accounts&&!0!==r?.verified&&r?.verification_nonce;let s;if(!t.config?.skipNewslettersSignup&&r?.registered&&t.authCallback){let e=!1;s=(n,a)=>{e||(e=!0,(0,c.au)({onSuccess:()=>{t.authCallback(n,a),window.location.reload()},closeOnSuccess:!0,signupMethod:"reader-registration",onDismiss:()=>window.location.reload()}))},t.config.onClose=s}else s=t.authCallback;if(i){n.isVerifying=!0;const i=t.closest(".newspack-reader-auth-modal");i&&(i.style.display="none"),g.forEach(e=>{e.disabled=!1,e.classList.remove("newspack-ui__button--loading")}),n.style.opacity=1;const c=()=>{i&&(i.style.display="")};return void(0,o.F)({email:r.email,verificationNonce:r.verification_nonce,setOTPTimer:e.setOTPTimer,onSendCode:()=>{c(),t.setFormAction("otp",!0)},onDismiss:()=>{c(),s?.(a,r),n.isVerifying=!1}})}if(t.config?.skipSuccess)s&&s(a,r);else{let e=newspack_reader_activation_labels.signin;r?.registered&&(e=newspack_reader_activation_labels.register),t.setFormAction("success"),t.querySelector(".success-title").innerHTML=e.success_title||"",t.querySelector(".success-description").innerHTML=e.success_description||"";const n=t.querySelector(".auth-callback");n&&s&&n.addEventListener("click",e=>{e.preventDefault(),s(a,r)});const o=t.querySelector(".set-password");if(o){const e=o.style.display;if(r?.password_url)o.style.display=e,o.setAttribute("href",r.password_url);else{o.style.display="none",o.setAttribute("href","#");const e=t.querySelector(".auth-callback");e&&e.classList.add("newspack-ui__last-child")}}const i=t.querySelector(".auth-callback");if(r?.redirect_to&&i&&i.setAttribute("href",r.redirect_to),new URLSearchParams(window.location.search).has("redirect")&&i?.href&&i.href!==window.location.href&&"#"!==i.href)try{const e=new URL(i.href);e.origin===window.location.origin&&(i.style.opacity=.5,i.style.pointerEvents="none",window.location.href=e.href)}catch(e){}}}},n.addEventListener("submit",a=>{a.preventDefault(),n.startLoginFlow();const o=n.action?.value;if(!n.npe?.value)return n.endLoginFlow(newspack_reader_activation_labels.invalid_email,400);if("pwd"===o&&!n.password?.value)return n.endLoginFlow(newspack_reader_activation_labels.invalid_password,400);const r=new FormData(a.target);if(!r.has("npe")||!r.get("npe"))return n.endLoginFlow(newspack_reader_activation_labels.invalid_email,400);const c=(0,s.m)();if(c||_()){const e=new URL(window.location.href);c&&e.searchParams.set("checkout",1),r.set("redirect_url",e.toString())}if("otp"===o)e.authenticateOTP(r.get("otp_code")).then(e=>{n.isVerifying&&(e.registered=!0,n.isVerifying=!1),n.endLoginFlow(e.message,200,e)}).catch(e=>{e.expired&&t.setFormAction("signin"),n.endLoginFlow(e.message,400)});else{const a=()=>fetch(n.getAttribute("action")||window.location.pathname,{method:"POST",headers:{Accept:"application/json"},body:r}).then(a=>{t.setAttribute("data-form-status",a.status),a.json().then(({message:o,data:i})=>{const s=a.status;200===s&&e.setReaderEmail(r.get("npe")),i.action?(t.setFormAction(i.action,!0),"otp"===i.action&&(e.setOTPTimer(),b()),"otp"!==i.action&&"pwd"!==i.action||(n.style.opacity=1),g.forEach(e=>{e.disabled=!1})):n.endLoginFlow(o,s,i)}).catch(()=>{n.endLoginFlow()}).finally(()=>{const e=a.status;t.config?.closeOnSuccess?n.style.opacity=1:200===e||t.config?.closeOnSuccess||(n.style.opacity=1)})}).catch(()=>{n.endLoginFlow()});"signin"===o?(0,i.E)({email:r.get("npe"),onProceed:a,onCancel:()=>{g.forEach(e=>{e.disabled=!1,e.classList.remove("newspack-ui__button--loading")}),n.style.opacity=1}}):a()}})}),document._newspackReaderAuthFormReady=!0,document.dispatchEvent(new CustomEvent("newspack-reader-auth-form-ready",{detail:{containers:t}})))})}),window.newspackRAS=window.newspackRAS||[],window.newspackRAS.push(e=>{(0,r.Qc)(function(){function t(e){const t=(0,a.P6)();if(!t)return;const n=window.location.hash.replace("#","");a.FO.includes(n)&&(e&&e.preventDefault(),t.setFormAction("signin"),(0,a.eK)({closeOnSuccess:!0}))}function n(e){e.preventDefault();const t=e.target;let n,o;if(o=e.target.getAttribute("data-redirect")?e.target.getAttribute("data-redirect"):e.target.getAttribute("href"),!o){const t=e.target.closest("a");t&&(o=t.getAttribute("data-redirect")?t.getAttribute("data-redirect"):t.getAttribute("href"))}o&&"#"!==o&&(n=()=>{window.location.href=o}),(0,a.eK)({onSuccess:n,onError:n,trigger:t,closeOnSuccess:!0})}function r(){document.querySelectorAll(`[data-newspack-reader-account-link],[href="${newspack_ras_config.account_url}"]:not(.wp-block-newspack-my-account-button)`).forEach(e=>{e.addEventListener("click",n)})}function s(){const e=window.newspackReaderActivation.getReader(),t=document.querySelectorAll(".newspack-reader__account-link");t?.length&&t.forEach(t=>{const n=JSON.parse(t.getAttribute("data-labels")),a=t.querySelector(".newspack-reader__account-link__label");if(a){if("1"===t.getAttribute("data-newspack-logged-in"))return void(a.textContent=n.signedin);a.textContent=e?.authenticated?n.signedin:n.signedout,e?.authenticated&&t.setAttribute("href",newspack_ras_config.account_url)}})}e._openAuthModal=a.eK,e.openVerificationModal=t=>(0,o.F)({setOTPTimer:e.setOTPTimer,...t}),e.maybeConfirmRegistration=i.E,window.addEventListener("hashchange",t),t(),r(),setTimeout(r,1e3),window.newspackReaderActivation.on("reader",s),s()});const t=window.location.search,n=new URLSearchParams(t),s=e.getReader();if(n.get(newspack_ras_config?.auth_action_result)&&s?.email&&s?.authenticated){n.delete(newspack_ras_config?.auth_action_result);const t=n.toString()?"?"+n.toString():"";window.history.replaceState({},"",window.location.pathname+t),e.dispatchActivity("reader_logged_in",{email:s.email,login_method:"auth-token"})}})},88998(e,t,n){n.d(t,{M_:()=>w,OO:()=>k});var a=n(951),o=n(20256),i=n(82613),r=n(71015),s=n(20901),c=n(73122),l=n(61886),d=n(27452),u=n(43511),p=n(63424),g=n(34357),f=n(75362);window.newspack_ras_config=window.newspack_ras_config||{};const[w,h]=(0,a.A)();function m(e,t,n=0){const a={action:e,data:t,timestamp:n||Date.now()};return w.add("activity",a),(0,i.Ic)(i.qY.activity,a),a}function _(e){const t=w.get("activity")||[];return e?t.filter(t=>t.action===e):t}function y(e){if(!e)return;const t=k();t.email=e,w.set("reader",t,!1),(0,i.Ic)(i.qY.reader,t)}function v(e=!0){const t=w.get("reader")||{};if(!t.email)throw new Error("Reader email not set");t.authenticated=Boolean(e),w.set("reader",t,!1),(0,i.Ic)(i.qY.reader,t)}function k(){return w.get("reader")||{}}const b=["pwd","link"];function A(){return(0,r.Ri)("np_otp_hash")}const S="newspack_otp_timer";function E(){localStorage.removeItem(S)}const L={store:w,overlays:s.A,segments:c.A,on:i.on,off:i.AU,dispatchActivity:m,getActivities:_,getUniqueActivitiesBy:function(e,t){const n=_(e),a=[],o={};for(const e of n){const n="function"==typeof t?t(e):e.data[t];o[n]||(a.push(e),o[n]=!0)}return a},setReaderEmail:y,setAuthenticated:v,refreshAuthentication:function(){const e=(0,r.Ri)("np_auth_reader");e?(y(e),v(!0)):y((0,r.Ri)("np_auth_intention"))},getReader:k,openNewslettersSignupModal:function(e={}){e={onSuccess:null,onDismiss:null,onError:null,initialState:null,skipSuccess:!1,labels:{},content:null,closeOnSuccess:!0,...e},L?._openNewslettersSignupModal?L._openNewslettersSignupModal(e):(console.warn("Newsletters signup modal not available"),e?.onError&&"function"==typeof e.onError&&e.onError())},hasAuthLink:function(){const e=k(),t=(0,r.Ri)("np_otp_hash");return!(!e?.email||!t)},getOTPHash:A,setOTPTimer:function(){localStorage.setItem(S,Math.floor(Date.now()/1e3))},clearOTPTimer:E,getOTPTimeRemaining:function(){const e=localStorage.getItem(S);if(!e)return 0;const t=newspack_ras_config.otp_rate_interval-(Math.floor(Date.now()/1e3)-e);return t||E(),t>0?t:0},authenticateOTP:function(e){return new Promise((t,n)=>{const a=A(),o=k()?.email;return a?o?e?void fetch("",{method:"POST",headers:{Accept:"application/json"},body:new URLSearchParams({action:newspack_ras_config.otp_auth_action,email:o,hash:a,code:e})}).then(e=>e.json()).then(({success:e,message:a,data:i})=>{const r={...i,email:o,authenticated:!!e,message:a};v(!!e),e?t(r):n(r)}):n({message:"Invalid code"}):n({message:"You must provide an email"}):n({message:"Code has expired",expired:!0})})},setAuthStrategy:function(e){if(!b.includes(e))throw new Error("Invalid authentication strategy");return(0,r.TV)("np_auth_strategy",e),e},getAuthStrategy:function(){return A()?"otp":(0,r.Ri)("np_auth_strategy")},setPendingCheckout:o._,getPendingCheckout:o.m,debugLog:r.cY,register:function(e,t,n={}){const a=(newspack_ras_config?.frontend_registration_integrations||{})[t];if(!a)return Promise.reject(new Error("Unknown integration: "+t));if(!e||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e))return Promise.reject(new Error("Invalid email address."));if(!newspack_ras_config?.frontend_registration_url)return Promise.reject(new Error("Registration is not available."));const o={npe:e,integration_id:t,integration_key:a.key,first_name:n.first_name||"",last_name:n.last_name||"",metadata:n.metadata||{}},r=newspack_ras_config?.captcha_site_key,s=newspack_ras_config?.captcha_version;let c;if(r){if(!window.grecaptcha)return Promise.reject(new Error("reCAPTCHA is configured but not loaded."));c="v3"===s?new Promise(function(e,t){window.grecaptcha.ready(function(){window.grecaptcha.execute(r,{action:"integration_registration"}).then(e).catch(t)})}):s&&"v2"===s.substring(0,2)?new Promise(function(e,t){window.grecaptcha.ready(function(){var n;(n=r,new Promise(function(e,t){const a=document.createElement("div");a.style.display="none",document.body.appendChild(a);let o=!1;const i=setTimeout(function(){o||(o=!0,a.remove(),t(new Error("reCAPTCHA timed out.")))},3e4);function r(e,t){o||(o=!0,clearTimeout(i),a.remove(),e(t))}try{const o=window.grecaptcha.render(a,{sitekey:n,size:"invisible",isolated:!0,callback(t){r(e,t)},"error-callback"(){r(t,new Error("reCAPTCHA challenge failed."))},"expired-callback"(){r(t,new Error("reCAPTCHA token expired."))}});window.grecaptcha.execute(o)}catch(e){r(t,e)}})).then(e).catch(t)})}):Promise.resolve("")}else c=Promise.resolve("");return c.then(function(e){e&&(o["g-recaptcha-response"]=e);const t={"Content-Type":"application/json"},n=(0,f.C)();return n&&(t["X-WP-Nonce"]=n),fetch(newspack_ras_config.frontend_registration_url,{method:"POST",headers:t,credentials:"same-origin",body:JSON.stringify(o)})}).then(function(e){return e.json().then(function(t){if(!e.ok){const e=new Error(t.message||"Registration failed.");throw e.code=t.code,e}return t})}).then(function(n){const a=n.email||e,o={...w.get("reader")||{},email:a,authenticated:!0};return w.set("reader",o,!1),(0,i.Ic)(i.qY.reader,o),m("reader_registered",{email:a,integration_id:t,status:n.status||"created"}),n}).catch(function(n){throw m("reader_registration_failed",{email:e,integration_id:t,error:n.code||"network_error"}),n})},...newspack_ras_config.is_ras_enabled&&{openAuthModal:function(e={}){e={onSuccess:null,onDismiss:null,onError:null,initialState:null,skipSuccess:!1,skipNewslettersSignup:!1,labels:{signin:{title:window.newspack_reader_activation_labels.signin.title},register:{title:window.newspack_reader_activation_labels.register.title}},content:null,trigger:null,closeOnSuccess:!0,...e},newspack_ras_config.is_logged_in?e.onSuccess&&"function"==typeof e.onSuccess&&e.onSuccess():(0,g.eK)(e)}}};function O(...e){e.forEach(e=>{Array.isArray(e)&&"string"==typeof e[0]?m(...e):"function"==typeof e?e(L):console.warn("Invalid newspackRAS.push argument",e)})}window.newspackRASInitialized||function(){const e=newspack_ras_config,t=e?.authenticated_email||(0,r.Ri)("np_auth_intention"),n=!!e?.authenticated_email;let a=k();if(function({authenticatedEmail:e,initialEmail:t,storedReader:n,hasAuthReaderCookie:a}){const o=e=>(e||"").trim().toLowerCase(),i=o(e),r=o(n?.email);if(!0===n?.authenticated&&i&&r&&i!==r)return!0;if(i||a)return!1;const s=!0===n?.authenticated,c=!!r&&r!==o(t);return s||c}({authenticatedEmail:e?.authenticated_email,initialEmail:t,storedReader:a,hasAuthReaderCookie:!!(0,r.Ri)("np_auth_reader")})){const e=newspack_reader_data?.items;h(),a=k(),n&&e&&(newspack_reader_data.items=e)}const o={email:t||a?.email,authenticated:n};a?.email===o?.email&&a?.authenticated===o?.authenticated||w.set("reader",o,!1),(0,i.Ic)(i.qY.reader,o),(0,l.Ay)(L),(0,p.A)(L),function(){const e=newspack_ras_config.cid_cookie;(0,r.Ri)(e)||(0,r.TV)(e,(0,r.ni)(12))}(),(0,d.A)(L),(0,u.A)(L),function(){if((0,r.Ri)("np_auth_reader"))return;const e=setInterval(()=>{const t=k(),n=(0,r.Ri)("np_auth_intention");if(n&&t.email!==n)y(n);else{const t=(0,r.Ri)("np_auth_reader");t&&(y(t),v(!0),(0,f.E)(),clearInterval(e))}},1e3)}(),function(){const e=(e,t="submit")=>{const n="FORM"===e.tagName?e:e.querySelector("form");n&&n.addEventListener(t,()=>{w.set("is_newsletter_subscriber",!0)})},t=[];document.querySelectorAll([".mc4wp-form",".newspack-subscribe-form"].join(",")).forEach(n=>{n.id.startsWith("gform_")&&n.hasAttribute("data-formid")?t.push(parseInt(n.getAttribute("data-formid"))):e(n)}),document.querySelectorAll([".newspack-newsletters-subscribe"].join(",")).forEach(t=>e(t,"newspack-newsletters-subscribe-success")),document.addEventListener("gform/post_render",e=>{window.gform?.utils?.addAsyncFilter&&t.includes(e.detail?.formId)&&gform.utils.addAsyncFilter("gform/submission/pre_submission",async e=>(w.set("is_newsletter_subscriber",!0),e))})}(),(newspack_reader_data?.reader_activity||[]).forEach(({action:e,data:t})=>m(e,t)),function(){const e=e=>e.trim().toLowerCase().replace(/^www\./,""),t=document.referrer?e(new URL(document.referrer).hostname):"";t&&t!==e(window.location.hostname)?w.set("referrer",t):w.set("referrer","")}(),window.newspackReaderActivation=L,window.newspackRAS=window.newspackRAS||[],window.newspackRAS.forEach(e=>O(e)),window.newspackRAS.push=O,w.rehydrate(),window.newspackRASInitialized=!0}()}},o={};function i(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={id:e,loaded:!1,exports:{}};return a[e](n,n.exports,i),n.loaded=!0,n.exports}i.m=a,e=[],i.O=(t,n,a,o)=>{if(!n){var r=1/0;for(d=0;d=o)&&Object.keys(i.O).every(e=>i.O[e](n[c]))?n.splice(c--,1):(s=!1,o0&&e[d-1][2]>o;d--)e[d]=e[d-1];e[d]=[n,a,o]},i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},n=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(e,a){if(1&a&&(e=this(e)),8&a)return e;if("object"==typeof e&&e){if(4&a&&e.__esModule)return e;if(16&a&&"function"==typeof e.then)return e}var o=Object.create(null);i.r(o);var r={};t=t||[null,n({}),n([]),n(n)];for(var s=2&a&&e;("object"==typeof s||"function"==typeof s)&&!~t.indexOf(s);s=n(s))Object.getOwnPropertyNames(s).forEach(t=>r[t]=()=>e[t]);return r.default=()=>e,i.d(o,r),o},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),i.j=193,(()=>{var e;globalThis.importScripts&&(e=globalThis.location+"");var t=globalThis.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var a=n.length-1;a>-1&&(!e||!/^http(s?):/.test(e));)e=n[a--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e})(),(()=>{var e={193:0,3619:0};i.O.j=t=>0===e[t];var t=(t,n)=>{var a,o,[r,s,c]=n,l=0;if(r.some(t=>0!==e[t])){for(a in s)i.o(s,a)&&(i.m[a]=s[a]);if(c)var d=c(i)}for(t&&t(n);li(43595));r=i.O(r)})();