1import{C as u,d as h}from"./app-Du3w-E26.js";try{let o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="3d19cc3a-6bc8-499d-9be7-62bbdab5318e",o._sentryDebugIdIdentifier="sentry-dbid-3d19cc3a-6bc8-499d-9be7-62bbdab5318e")}catch{}const r=class r extends u{constructor(){super(...arguments),this.form=null,this.closeButton=null,this.toggleButtons=[]}init(){var t,a;this.form=this.$("form"),this.closeButton=this.$("close-button"),this.toggleButtons=Array.from(document.querySelectorAll('[data-el="subs-toggle"], [href="#subscribe"]')),["barba_leave","cancel","cartToggle","menuToggle"].forEach(e=>{h.on(e,()=>{this.close()})}),h.on("click",e=>{const s=e.composedPath().includes(this),c=this.toggleButtons.some(n=>e.composedPath().includes(n));!s&&!c&&this.close()}),this.toggleButtons.forEach(e=>{e.addEventListener("click",s=>{s.preventDefault(),this.hasAttribute("open")?this.close():this.open()})}),(t=this.closeButton)==null||t.addEventListener("click",()=>{this.close()}),(a=this.form)==null||a.addEventListener("submit",e=>{e.preventDefault(),this.setAttribute("busy",""),fetch("/actions/_toolkit/content/csrf").then(s=>s.json()).then(({value:s,name:c})=>{const n=new URLSearchParams;n.append(c,s);for(const i of new FormData(this.form))["CRAFT_CSRF_TOKEN","action","name","email","tags"].includes(i[0])&&n.append(i[0],i[1]);fetch(window.location.href,{method:"POST",headers:{"Cache-Control":"no-cache",Accept:"application/json","X-Requested-With":"XMLHttpRequest",HTTP_X_REQUESTED_WITH:"XMLHttpRequest"},body:n}).then(i=>i.json()).then(()=>{this.removeAttribute("busy"),this.setAttribute("success",""),setTimeout(()=>{this.removeAttribute("success"),this.close(),setTimeout(()=>{this.form.reset()},1e3)},3e3)}).catch(()=>{})}).catch(()=>{})})}open(){if(this.setAttribute("open",""),this.form){const t=this.form.querySelector('input[name="name"]');t&&setTimeout(()=>{t.focus()},1e3)}}close(){this.removeAttribute("open")}};r.component="b-subscribe";let l=r;export{l as default}; 2//# sourceMappingURL=Subscribe-D9T2tFtK.js.map
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.