(()=>{"use strict";var e,t={4931:(e,t,n)=>{const o=e=>{"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",e):e())};o(function(){[...document.querySelectorAll(".newspack-ui__segmented-control")].forEach(e=>function(e){const t=e.querySelector(".newspack-ui__segmented-control__content");let n=[];t&&(n=[...t.children]);const o=e.querySelector(".newspack-ui__segmented-control__tabs"),r=e.querySelector(".newspack-ui__segmented-control > select");if(!o&&!r&&n.length)return void n[0].classList.add("selected");const c=o?[...o.children]:[r],a=o=>{if(0===n.length)return;t._removedContents&&(t._removedContents.forEach(({content:e,nextSibling:n})=>{n?t.insertBefore(e,n):t.appendChild(e)}),delete t._removedContents);const r=n[o],c=[];n.forEach((e,t)=>{t!==o&&(c.push({content:e,nextSibling:e.nextSibling}),e.remove())}),c.length>0&&(t._removedContents=c),r.classList.add("selected");const a=r.querySelectorAll('input[type="radio"]'),s=[...a].find(e=>e.checked);a.length&&!s&&a[0].click(),e.dispatchEvent(new CustomEvent("content-selected",{detail:r}))};c.forEach((e,t)=>{if(0!==n.length){if("SELECT"===e.tagName)return e.classList.add("selected"),a(parseInt(e.value)),void e.addEventListener("change",function(e){a(parseInt(e.target.value))});e.classList.contains("selected")&&a(t),e.addEventListener("click",function(){c.forEach(e=>e.classList.remove("selected")),this.classList.add("selected"),a(t)})}})}(e))});var r=n(1622);function c(e,t){window.newspackRAS.push(n=>{"open"===t?(e._overlayId&&n.overlays.remove(e._overlayId),e._overlayId=n.overlays.add()):"closed"===t&&e._overlayId&&(n.overlays.remove(e._overlayId),e._overlayId=null)})}function a(e,t=!0){e.classList.add("active"),"false"!==e.dataset.autohide&&setTimeout(()=>{s(e,t)},8e3)}function s(e,t=!0){e.classList.remove("active"),t&&setTimeout(()=>{e.remove()},250),wp.ajax.send("newspack_ui_notice_dismissed",{data:{id:e.dataset.noticeId,nonce:e.dataset.nonce}})}window.newspackRAS=window.newspackRAS||[],(0,r.Qc)(function(){[...document.querySelectorAll(".newspack-ui__modal-container")].forEach(e=>{const t=e.querySelector(".newspack-ui__modal__content"),n=[...e.querySelectorAll(".newspack-ui__modal__close")];!function(e){"open"===e.dataset.state&&c(e,"open"),new MutationObserver(t=>{t.forEach(t=>{if("attributes"===t.type&&"data-state"===t.attributeName){const t=e.dataset.state;c(e,t),"closed"===t&&e.dispatchEvent(new CustomEvent("closeModal"))}})}).observe(e,{attributes:!0,attributeFilter:["data-state"]})}(e),n.forEach(t=>{t.addEventListener("click",t=>{t.preventDefault(),e.setAttribute("data-state","closed")})}),[...e.querySelectorAll("[data-fetch]")].forEach(n=>{n.addEventListener("click",o=>{const r=JSON.parse(n.getAttribute("data-fetch"));if(r.url&&r.nonce){const n=t.querySelector(".newspack-ui__notice--error");n&&n.parentElement.removeChild(n),o.preventDefault(),o.target.setAttribute("disabled",!0),fetch(r.url,{method:r.method,body:JSON.stringify(r.body||{}),headers:{"X-WP-Nonce":r.nonce}}).then(e=>{const t=e.json();if(!e.ok||t.error)throw new Error(t.message||t.error||"An error occurred. Please try again.");return t}).then(()=>{if(r.next){const t=document.getElementById(`newspack-my-account__${r.next}`);t&&(e.setAttribute("data-state","closed"),t.setAttribute("data-state","open"))}}).catch(e=>{const n=document.createElement("div");n.textContent=e||"An error occurred.",n.classList.add("newspack-ui__notice","newspack-ui__notice--error"),t.insertBefore(n,t.firstChild)}).finally(()=>{o.target.removeAttribute("disabled"),o.target.classList.remove("newspack-ui--loading"),o.target.closest("form, div").classList.remove("newspack-ui--loading")})}})})})}),o(function(){[...document.querySelectorAll(".newspack-ui__snackbar__item")].forEach(e=>{"true"===e.dataset.activeOnLoad&&a(e),[...e.querySelectorAll("a, button")].forEach(t=>{t.addEventListener("click",()=>{s(e)})})})});const i={openNotice:a,closeNotice:s};(0,r.Qc)(function(){[...document.querySelectorAll(".newspack-ui__dropdown")].forEach(e=>{const t=e.querySelector(".newspack-ui__dropdown__toggle"),n=e.querySelector(".newspack-ui__dropdown__content");t&&n&&t.addEventListener("click",t=>{e.classList.toggle("active");const o=n.getBoundingClientRect();o.right+o.width>window.innerWidth?(n.style.left="auto",n.style.right="0"):(n.style.removeProperty("left"),n.style.removeProperty("right"),0===n.style.length&&n.removeAttribute("style")),o.bottom+o.height>window.innerHeight?(n.style.top="auto",n.style.bottom=`${t.currentTarget.clientHeight+8}px`):(n.style.removeProperty("top"),n.style.removeProperty("bottom"),0===n.style.length&&n.removeAttribute("style"))}),document.addEventListener("keydown",t=>{"Escape"===t.key&&e.classList.remove("active")}),document.addEventListener("click",t=>{!e.contains(t.target)&&e.classList.contains("active")&&e.classList.remove("active")})})}),(0,r.Qc)(function(){[...document.querySelectorAll(".newspack-ui__accordion")].forEach(e=>{const t=[...e.querySelectorAll('li > input[type="radio"]')],n=()=>{t.forEach(e=>{const t=e.closest("li");e.checked?t.classList.add("active"):t.classList.remove("active")})};t.forEach(e=>{e.addEventListener("change",n)}),e.classList.contains("newspack-ui__accordion--open")&&t[0].click()})}),window.newspackUI=window.newspackUI||{},window.newspackUI.notices=i}},n={};function o(e){var r=n[e];if(void 0!==r)return r.exports;var c=n[e]={id:e,loaded:!1,exports:{}};return t[e](c,c.exports,o),c.loaded=!0,c.exports}o.m=t,e=[],o.O=(t,n,r,c)=>{if(!n){var a=1/0;for(d=0;d=c)&&Object.keys(o.O).every(e=>o.O[e](n[i]))?n.splice(i--,1):(s=!1,c0&&e[d-1][2]>c;d--)e[d]=e[d-1];e[d]=[n,r,c]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),o.j=5376,(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.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 r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})(),(()=>{var e={5376:0};o.O.j=t=>0===e[t];var t=(t,n)=>{var r,c,[a,s,i]=n,l=0;if(a.some(t=>0!==e[t])){for(r in s)o.o(s,r)&&(o.m[r]=s[r]);if(i)var d=i(o)}for(t&&t(n);lo(4931));r=o.O(r)})();