@hsfx/attr 2.0.14 → 2.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ import{a as e,c as t,i as n,w as r,d as o,p as s,q as a,b as i,g as l,s as c,e as u,o as d,f as p,h as f,j as m,k as h}from"./hsfxutilsC44JpCww.js";const g=t._global,v=t.default.transition,b=g.apiName;async function y(){const t=e(v,"wrapper");if(!t)return{result:"transition skipped - no wrapper found",destroy:()=>{}};const o="data-hs-transition-initialized";if(t.hasAttribute(o))return{result:"transition already initialized",destroy:()=>{}};t.setAttribute(o,"true");const s=window[b]?.settings?.isSPA||!1,a=new Map;let i=null,l=null;const c=(e,n=null,r=t)=>{const o=v.attributes.elements.trigger.primary.match(/data-[^=]+/)?.[0],s=v.attributes.elements.namespace.primary.match(/data-[^=]+/)?.[0];if(!o||!s)return null;const a=r.querySelectorAll(`[${o}="${e}"]`);if(a.length>0){if(n){const t=r.querySelector(`[${s}="${n}"]`);if(t){const n=t.querySelector(`[${o}="${e}"]`);if(n)return n}}const t=Array.from(a).find(e=>{let t=e.parentElement;for(;t&&t!==r;){if(t.hasAttribute(s))return!1;t=t.parentElement}return!0});if(t)return t}const i="exit"===e?v.attributes.elements.exitTrigger.primary.match(/data-[^=]+/)?.[0]:v.attributes.elements.enterTrigger.primary.match(/data-[^=]+/)?.[0];if(!i)return null;const l=r.querySelectorAll(`[${i}]`);if(l.length>0){if(n){const e=r.querySelector(`[${s}="${n}"]`);if(e){const t=e.querySelector(`[${i}]`);if(t)return t}}const e=Array.from(l).find(e=>{let t=e.parentElement;for(;t&&t!==r;){if(t.hasAttribute(s))return!1;t=t.parentElement}return!0});if(e)return e}return null},u=(e=null)=>new Promise(n=>{const r=c("exit",e);if(!r)return void n();const o=(()=>{const e=v.attributes.elements.exitTime.primary.match(/data-[^=]+/)?.[0];if(!e)return 0;const n=t.getAttribute(e);return n?1e3*parseFloat(n):0})();r.click(),setTimeout(()=>n(),o)}),d=(e=null)=>new Promise(n=>{const r=c("enter",e);if(!r)return void n();const o=!sessionStorage.getItem("transition-loaded"),s=(()=>{const e=v.attributes.elements.firstDelay.primary.match(/data-[^=]+/)?.[0];if(!e)return 0;const n=t.getAttribute(e);return n?1e3*parseFloat(n):0})(),a=()=>{r.click(),o&&sessionStorage.setItem("transition-loaded","true"),n()};o&&s>0?i=setTimeout(a,s):a()}),p=e=>{u(e?.detail?.namespace||null)},f=e=>{const t=e?.detail?.namespace||null;!1!==window[b]?.settings?.scrollTop&&window.scrollTo(0,0),d(t)};if(a.set(`${b}:transition-exit`,p),a.set(`${b}:transition-enter`,f),window.addEventListener(`${b}:transition-exit`,p),window.addEventListener(`${b}:transition-enter`,f),!s){const e=e=>{const t=e.target.closest("a[href]");if(t&&t.hostname===window.location.hostname&&t.getAttribute("href")&&-1===t.getAttribute("href").indexOf("#")&&"_blank"!==t.getAttribute("target")){e.preventDefault();const n=t.href;u().then(()=>{window.location.href=n})}};a.set("click",e),document.addEventListener("click",e);const t=e=>{e.persisted&&window.location.reload()};a.set("pageshow",t),window.addEventListener("pageshow",t)}const m=()=>{t&&(t.style.display="none")};if(a.set("resize",m),window.addEventListener("resize",m),!s){const e=async()=>{n()&&(l=setTimeout(()=>{t.classList.add(g.classes.loading)},2e3),await r(),l&&(clearTimeout(l),l=null),t.classList.remove(g.classes.loading),t.classList.add(g.classes.loaded)),d()};a.set(`${b}:dom-ready`,e),window.addEventListener(`${b}:dom-ready`,e,{once:!0})}return{result:"transition initialized",destroy:()=>{i&&clearTimeout(i),l&&clearTimeout(l),a.forEach((e,t)=>{if("click"===t||"pageshow"===t||"resize"===t){("click"===t?document:window).removeEventListener(t,e)}else window.removeEventListener(t,e)}),a.clear(),t.removeAttribute(o)}}}async function w(t){let n=null,r=null;function a(n){const r=n.target.closest('a[href^="#"]');if(!r)return;const a=r.getAttribute("href");if(!a||"#"===a)return;const i=a.substring(1),l=document.getElementById(i);if(l){n.preventDefault(),history.replaceState&&history.replaceState(null,null,`#${l.id}`);!function(e,t=0){if(!e)return;const n=o("smooth-scroll",!1);if(s()||!n){const n=e.getBoundingClientRect().top+window.scrollY-t;return window.scrollTo(0,n),e.setAttribute("tabindex","-1"),void e.focus({preventScroll:!0})}n.gsap.to(window,{duration:1,scrollTo:{y:e,offsetY:t},ease:"power2.out",onComplete:function(){e.setAttribute("tabindex","-1"),e.focus({preventScroll:!0})}})}(l,function(){const n=e(t,"offset-proxy");if(console.log("[smooth-scroll] Proxy element:",n),n&&n instanceof HTMLElement){const e=getComputedStyle(n).top,t=parseFloat(e)||0;return console.log("[smooth-scroll] Computed top:",e,"-> offset:",t),t}return console.log("[smooth-scroll] No proxy element found, using offset: 0"),0}())}}return"undefined"!=typeof $&&$(document).off("click.wf-scroll"),document.documentElement.style.scrollBehavior="auto",document.body.style.scrollBehavior="auto",n=a,r=e=>{"Enter"!==e.key&&" "!==e.key||a(e)},document.addEventListener("click",n),document.addEventListener("keydown",r),{result:"autoInit-smooth-scroll initialized",destroy:()=>{n&&(document.removeEventListener("click",n),n=null),r&&(document.removeEventListener("keydown",r),r=null),document.documentElement.style.scrollBehavior="",document.body.style.scrollBehavior=""}}}let E=null;function A(t){E=t;const n={observers:[],handlers:[]};return function(t,n){const r=a(E,"wrapper"),o=[];r.forEach(r=>{const s=i(l.clickable,"button"),a=r.querySelector(s),d=e(E,"list",r);if(!a||!d)return void console.warn("[dropdown] Dropdown wrapper missing required elements:",r);const p=r.getAttribute("data-hs-nav-dropdown-type")||"hover",f=r.querySelector('[data-hs-height="element"]'),m=f?f.parentElement:null,h=a.textContent?.trim()||"dropdown",g=h.toLowerCase().replace(/[^a-z0-9\s]/g,"").replace(/\s+/g,"-").replace(/^-+|-+$/g,"").substring(0,50);const v=`navbar-dropdown-${g}-toggle`,b=`navbar-dropdown-${g}-list`;a.id=v,a.setAttribute("aria-haspopup","menu"),a.setAttribute("aria-expanded","false"),a.setAttribute("aria-controls",b),d.id=b,d.setAttribute("role","menu"),d.inert=!0;const y=Array.from(d.querySelectorAll(s));y.forEach((e,t)=>{if(e.setAttribute("role","menuitem"),e.setAttribute("tabindex","-1"),0===t){const t=a.textContent?.trim()||"menu";e.getAttribute("aria-label")||e.setAttribute("aria-label",`${e.textContent?.trim()}, ${t} submenu`)}});let w=-1;function A(){return r.classList.contains(l.classes.active)}function x(){const e=A();"true"===a.getAttribute("aria-expanded")&&!e&&d.contains(document.activeElement)&&a.focus(),a.setAttribute("aria-expanded",e?"true":"false"),d.inert=!e,y.forEach(t=>{t.setAttribute("tabindex",e?"0":"-1")}),e||(w=-1),u(m,e,{duration:"hover"===p?200:300,ease:"power2.inOut"})}c(m,A()),x();const L=new MutationObserver(()=>{x()});if(L.observe(r,{attributes:!0,attributeFilter:["class"]}),t(L),"hover"===p){o.push(r);const e=()=>{r.classList.add("is-active")},t=()=>{r.classList.remove("is-active")};n(r,"mouseenter",e),n(r,"mouseleave",t);n(a,"keydown",e=>{"ArrowDown"===e.key?(e.preventDefault(),A()||(r.classList.add(l.classes.active),y.length>0&&setTimeout(()=>{w=0,y[0].focus()},100))):" "===e.key||"Enter"===e.key?(e.preventDefault(),A()?r.classList.remove(l.classes.active):(r.classList.add(l.classes.active),y.length>0&&setTimeout(()=>{w=0,y[0].focus()},100))):"ArrowUp"===e.key?(e.preventDefault(),A()||(r.classList.add(l.classes.active),y.length>0&&setTimeout(()=>{w=y.length-1,y[w].focus()},100))):"Escape"===e.key&&(e.preventDefault(),A()&&r.classList.remove(l.classes.active))});const s=e=>{A()&&r.contains(document.activeElement)&&("ArrowDown"===e.key?(e.preventDefault(),w<y.length-1&&(w++,y[w].focus())):"ArrowUp"===e.key?(e.preventDefault(),0===w?(r.classList.remove(l.classes.active),a.focus(),w=-1):w>0?(w--,y[w].focus()):(a.focus(),w=-1)):"Escape"===e.key&&(e.preventDefault(),r.classList.remove("is-active")))};n(r,"keydown",s)}else if("click"===p){n(a,"click",e=>{e.preventDefault(),r.classList.toggle(l.classes.active)});n(a,"keydown",e=>{" "===e.key||"Enter"===e.key?(e.preventDefault(),r.classList.toggle(l.classes.active)):"Escape"===e.key&&(e.preventDefault(),A()&&r.classList.remove(l.classes.active))})}});const s=e=>{o.forEach(t=>{t.classList.contains("is-active")&&!t.contains(e.target)&&t.classList.remove("is-active")})};o.length>0&&n(document.body,"focusin",s)}(e=>{n.observers.push(e)},(e,t,r,o)=>{e.addEventListener(t,r,o),n.handlers.push({element:e,event:t,handler:r,options:o})}),{result:"dropdown initialized",destroy:()=>{n.observers.forEach(e=>e.disconnect()),n.observers.length=0,n.handlers.forEach(({element:e,event:t,handler:n,options:r})=>{e.removeEventListener(t,n,r)}),n.handlers.length=0,E=null}}}function x(t,n){const r={observers:[],handlers:[],state:{focusTrapHandler:null}},o=e=>{r.observers.push(e)};return function(o,s){const f=a(t,"button"),m=e(t,"wrapper");if(!f.length||!m)return;const h=n?e(n,"wrapper"):null,g=`menu-${Date.now()}`;m.id=g,m.setAttribute("role","dialog"),m.setAttribute("aria-modal","true"),m.inert=!0;const v=m.querySelector('[data-hs-height="element"]'),b=v?v.parentElement:null;f.forEach(t=>{t.setAttribute("aria-expanded","false"),t.setAttribute("aria-controls",g),t.setAttribute("aria-label","Open navigation menu");let a=null,v=!1;function y(){return t.classList.contains(l.classes.active)}function w(){const r=y(),o="true"===t.getAttribute("aria-expanded");r&&!o?(d(),m.classList.add(l.classes.active),m.inert=!1,h&&h.classList.add("hs-menu-open"),f.forEach(e=>{e.setAttribute("aria-expanded","true"),e.setAttribute("aria-label","Close navigation menu")}),b&&u(b,!0,{duration:300,ease:"power2.inOut"}),a=function(){const t=n?e(n,"wrapper"):document.querySelector('[data-hs-nav="wrapper"]');if(!t)return;const r=e=>{if("Tab"===e.key){const n=i(l.clickable,"button"),r=Array.from(t.querySelectorAll(n)),o=t.querySelectorAll('input, select, textarea, [tabindex]:not([tabindex="-1"])'),s=[...r,...Array.from(o)],a=s[0],c=s[s.length-1];e.shiftKey?document.activeElement===a&&(e.preventDefault(),c.focus()):document.activeElement===c&&(e.preventDefault(),a.focus())}};return document.addEventListener("keydown",r),r}(),v&&(setTimeout(()=>{const e=i(l.clickable,"button"),t=Array.from(m.querySelectorAll(e));if("last"===v){const e=t[t.length-1];e&&e.focus()}else{const e=t[0];e&&e.focus()}},100),v=!1)):!r&&o&&(m.contains(document.activeElement)&&t.focus(),p(),m.classList.remove(l.classes.active),m.inert=!0,h&&h.classList.remove("hs-menu-open"),f.forEach(e=>{e.setAttribute("aria-expanded","false"),e.setAttribute("aria-label","Open navigation menu")}),b&&u(b,!1,{duration:300,ease:"power2.inOut"}),function(e){e&&document.removeEventListener("keydown",e)}(a),a=null)}b&&c(b,y()),w();const E=new MutationObserver(()=>{w()});E.observe(t,{attributes:!0,attributeFilter:["class"]}),o(E);s(t,"click",function(e){e.preventDefault(),t.classList.toggle("is-active")});s(t,"keydown",function(e){" "===e.key||"Enter"===e.key?(e.preventDefault(),v=!0,t.classList.toggle(l.classes.active)):"ArrowDown"===e.key?(e.preventDefault(),y()||(v=!0,t.classList.add(l.classes.active))):"ArrowUp"===e.key?(e.preventDefault(),y()||(v="last",t.classList.add(l.classes.active))):"Escape"===e.key&&(e.preventDefault(),y()&&t.classList.remove(l.classes.active))}),r.state.focusTrapHandler=a})}(o,(e,t,n,o)=>{e.addEventListener(t,n,o),r.handlers.push({element:e,event:t,handler:n,options:o})}),function(n){const r=e(t,"wrapper");if(!r)return;let o=null;function s(){const e=window.getComputedStyle(r).getPropertyValue(f.state).trim();if(o===l.cssVars.state.values.active&&e===l.cssVars.state.values.inactive){const e=document.querySelector('[data-hs-nav-menu="button"]');e&&"true"===e.getAttribute("aria-expanded")&&e&&e.classList.remove("is-active")}o=e}const a=new ResizeObserver(s);a.observe(r),n(a),s()}(o),{result:"menu initialized",destroy:()=>{r.state.focusTrapHandler&&(document.removeEventListener("keydown",r.state.focusTrapHandler),r.state.focusTrapHandler=null),r.observers.forEach(e=>e.disconnect()),r.observers.length=0,r.handlers.forEach(({element:e,event:t,handler:n,options:r})=>{e.removeEventListener(t,n,r)}),r.handlers.length=0,document.body.classList.remove("u-overflow-hidden")}}}function L(t,n){const r={handlers:[]},o=(e,t,n,o)=>{e.addEventListener(t,n,o),r.handlers.push({element:e,event:t,handler:n,options:o})};return o(document,"keydown",t=>{if("ArrowLeft"!==t.key&&"ArrowRight"!==t.key)return;const r=n?e(n.menu,"wrapper"):document.querySelector('[data-hs-nav-menu="wrapper"]');if(r&&r.contains(document.activeElement))return;const o=n?e(n,"wrapper"):document.querySelector('[data-hs-nav="wrapper"]');if(!o||!o.contains(document.activeElement))return;const s=o.querySelector(`.${l.classes.active}[data-hs-nav-dropdown]`);if(s&&s.contains(document.activeElement))return;t.preventDefault();const a=i(l.clickable,"button"),c=Array.from(o.querySelectorAll(a)),u=Array.from(c).filter(e=>{if("-1"===e.getAttribute("tabindex"))return!1;if(e.closest('[role="menu"]'))return!1;const t=n?n.menu.attributes.elements.wrapper.primary.split("=")[0]:"data-hs-nav-menu";if(e.closest(`[${t}="wrapper"]`))return!1;const r=n?n.attributes.elements["skip-link"].primary.split("=")[0]:"data-hs-nav";if(e.closest(`[${r}="skip-link"]`))return!1;const s=window.getComputedStyle(e),a=e;if("none"===s.display||"hidden"===s.visibility||"0"===s.opacity||0===a.offsetWidth||0===a.offsetHeight)return!1;let i=e.parentElement;for(;i&&i!==o;){const e=window.getComputedStyle(i),t=i;if("none"===e.display||"hidden"===e.visibility||0===t.offsetWidth||0===t.offsetHeight)return!1;i=i.parentElement}return!0}),d=u.indexOf(document.activeElement);-1!==d&&("ArrowRight"===t.key?d<u.length-1&&u[d+1].focus():d>0&&u[d-1].focus())}),function(t){const r=n?e(n.menu,"wrapper"):document.querySelector('[data-hs-nav-menu="wrapper"]');if(!r)return;let o=-1;t(r,"keydown",t=>{const s=function(){const e=i(l.clickable,"button"),t=Array.from(r.querySelectorAll(e));return Array.from(t).filter(e=>{let t=e;for(;t&&t!==r;){if(t.inert)return!1;t=t.parentElement}return!0})}();if(0===s.length)return;const a=document.activeElement;if(o=s.indexOf(a),"ArrowDown"===t.key)t.preventDefault(),o<s.length-1&&(o+=1,s[o].focus());else if("ArrowUp"===t.key)t.preventDefault(),o>0&&(o-=1,s[o].focus());else if("ArrowRight"===t.key){if(t.preventDefault(),a&&"BUTTON"===a.tagName&&a.hasAttribute("aria-controls")){return void("true"===a.getAttribute("aria-expanded")||a.click())}}else if("ArrowLeft"===t.key){if(t.preventDefault(),a&&"BUTTON"===a.tagName&&a.hasAttribute("aria-controls")){return void("true"===a.getAttribute("aria-expanded")&&a.click())}}else if("Home"===t.key)t.preventDefault(),o=0,s[0].focus();else if("End"===t.key)t.preventDefault(),o=s.length-1,s[s.length-1].focus();else if(" "===t.key&&a&&"A"===a.tagName)t.preventDefault();else if("Escape"===t.key){const t=n?e(n.menu,"button"):document.querySelector('[data-hs-nav-menu="button"]');t&&(t.click(),t.focus())}})}(o),{result:"arrow-navigation initialized",destroy:()=>{r.handlers.forEach(({element:e,event:t,handler:n,options:r})=>{e.removeEventListener(t,n,r)}),r.handlers.length=0}}}async function k(e){const t={destroyFunctions:[]},n=await Promise.allSettled([A(e.dropdown),x(e.menu,e),L(e["arrow-navigation"],e)]);n.forEach(e=>{"fulfilled"===e.status&&e.value?.destroy&&t.destroyFunctions.push(e.value.destroy)});const r=n.filter(e=>"fulfilled"===e.status).length,o=n.length-r;return o>0&&console.warn(`[navbar] ${r}/${n.length} functions loaded successfully. ${o} failed but won't affect other functions.`),{result:"navbar initialized",destroy:()=>{t.destroyFunctions.forEach(e=>{try{e()}catch(t){console.error("[navbar] Error during cleanup:",t)}}),t.destroyFunctions.length=0}}}function S(t){const n={observers:[],handlers:[]};return function(n,r){const o=a(t,"wrapper");if(0===o.length)return 0;let s=0;o.forEach((o,a)=>{const d=e(t,"toggle",o),p=e(t,"content",o);if(!d||!p)return;s++;const f=`[${l.attributes.height}="${l.attributes.heightValue}"]`,m=o.querySelector(f),h=m?m.parentElement:p,g=`hs-accordion-btn-${a}`,v=`hs-accordion-content-${a}`,b=o.getAttribute(t.attributes.properties.open),y=o.getAttribute(t.attributes.properties.closed),w=b&&y;let E=[];if(w){const e=i(t,"state");E=Array.from(d.querySelectorAll(e))}function A(){return o.classList.contains(l.classes.active)}function x(){const e=A();if("true"===d.getAttribute("aria-expanded")&&!e&&p.contains(document.activeElement)){d.focus()}d.setAttribute("aria-expanded",e?"true":"false");var t;p.inert=!e,w&&E.length>0&&(t=e?b:y,w&&E.forEach(e=>{e.textContent=t})),u(h,e,{duration:300,ease:"power2.inOut"})}d.setAttribute("id",g),p.setAttribute("id",v),p.setAttribute("role","region"),p.setAttribute("aria-labelledby",g),d.setAttribute("aria-controls",v);const L=o.getAttribute(t.attributes.properties.default);L&&"open"===L.toLowerCase()&&o.classList.add(l.classes.active),c(h,A()),x();r(d,"click",e=>{e.preventDefault(),o.classList.toggle(l.classes.active)});const k=new MutationObserver(()=>{x()});k.observe(o,{attributes:!0,attributeFilter:["class"]}),n(k)})}(e=>n.observers.push(e),(e,t,r,o)=>{e.addEventListener(t,r,o),n.handlers.push({element:e,event:t,handler:r,options:o})}),{result:"accordion initialized",destroy:()=>{n.observers.forEach(e=>e.disconnect()),n.observers.length=0,n.handlers.forEach(({element:e,event:t,handler:n,options:r})=>{e.removeEventListener(t,n,r)}),n.handlers.length=0}}}function C(e){const n=t._global.classes.active,r={observers:[],handlers:[],scrollTimeout:null,headings:[]},o=a(e,"content"),s=a(e,"list");return o.forEach(e=>{const t=s[0];if(!t||0===t.children.length)return;const o=t.children[0].cloneNode(!0),a=o.querySelector("a");a&&a.classList.remove(n),t.innerHTML="";const i=e.querySelectorAll("h2");i.forEach(e=>{const t=e.textContent.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"");e.id=t,r.headings.push(e)}),i.forEach((e,n)=>{const r=o.cloneNode(!0),s=r.querySelector("a"),a=e.id;s.href=`#${a}`;const i=document.createElement("strong");i.textContent=`${n+1}. `,s.innerHTML="",s.appendChild(i),s.appendChild(document.createTextNode(e.textContent)),t.appendChild(r)});const l=t.querySelectorAll("a");let c=null;const u=()=>{const e=.75*window.innerHeight;let t=null;for(let n=i.length-1;n>=0;n--){if(i[n].getBoundingClientRect().top<=e){t=i[n].id;break}}if(t!==c&&(c=t,l.forEach(e=>e.classList.remove(n)),c)){const e=Array.from(l).find(e=>e.getAttribute("href")===`#${c}`);e&&e.classList.add(n)}},d=new IntersectionObserver(()=>{u()},{rootMargin:"-75% 0px -25% 0px",threshold:0});i.forEach(e=>d.observe(e)),(e=>{r.observers.push(e)})(d);var p,f,m;p=window,f="scroll",m=()=>{r.scrollTimeout&&clearTimeout(r.scrollTimeout),r.scrollTimeout=setTimeout(u,50)},p.addEventListener(f,m),r.handlers.push({element:p,event:f,handler:m})}),{result:"toc initialized",destroy:()=>{r.headings.forEach(e=>{e.removeAttribute("id")}),r.headings.length=0,r.observers.forEach(e=>e.disconnect()),r.observers.length=0,r.handlers.forEach(({element:e,event:t,handler:n})=>{e.removeEventListener(t,n)}),r.handlers.length=0,r.scrollTimeout&&(clearTimeout(r.scrollTimeout),r.scrollTimeout=null)}}}async function T(){const n=t.default.toc,r={destroyFunctions:[]},l=i(n,"list");if(document.querySelector(l))try{const e=await C(n);e?.destroy&&r.destroyFunctions.push(e.destroy)}catch(u){console.error("[toc] Error initializing heading-links:",u)}const c=i(n["progress-bar"],"wrapper");if(document.querySelector(c))try{const t=await async function(t){const{progressConfig:n,tocConfig:r}=t;if(s())return{result:"progress-bar skipped - prefers-reduced-motion enabled"};const i=o("progress-bar");if(!i)return{result:"progress-bar skipped - GSAP not loaded"};const{gsap:l,ScrollTrigger:c}=i;if(!c)return console.warn("[progress-bar] GSAP ScrollTrigger plugin not loaded"),{result:"progress-bar skipped - ScrollTrigger not loaded"};l.registerPlugin(c);const u={scrollTriggers:[]},d=e(r,"content");if(!d)return{result:"progress-bar skipped - no content element found"};const p=a(n,"wrapper");return 0===p.length?{result:"progress-bar skipped - no wrapper elements found"}:(p.forEach(e=>{l.set(e,{display:"block"}),Array.from(e.querySelectorAll("*")).filter(e=>{const t=n.attributes.elements.element.primary,[r,o]=t.split("="),s=o?.replace(/['"]/g,"");return e.getAttribute(r)===s}).forEach(e=>{l.set(e,{width:"0%"}),l.to(e,{width:"100%",ease:"none",scrollTrigger:{trigger:d,start:"top bottom",end:"bottom 75%",scrub:!0,invalidateOnRefresh:!0,onUpdate:e=>{u.scrollTriggers.includes(e)||u.scrollTriggers.push(e)}}})})}),{result:`progress-bar initialized (${p.length} instances)`,destroy:()=>{u.scrollTriggers.forEach(e=>{e&&"object"==typeof e&&"kill"in e&&"function"==typeof e.kill&&e.kill()}),u.scrollTriggers.length=0}})}({progressConfig:n["progress-bar"],tocConfig:n});t?.destroy&&r.destroyFunctions.push(t.destroy)}catch(u){console.error("[toc] Error initializing progress-bar:",u)}return{result:`toc initialized (${r.destroyFunctions.length} modules active)`,destroy:()=>{r.destroyFunctions.forEach(e=>{try{e()}catch(u){console.error("[toc] Error during cleanup:",u)}}),r.destroyFunctions.length=0}}}function P(t){const n={observers:[],handlers:[],liveRegions:[]};try{a(t,"wrapper").forEach(r=>{try{const o=function(t,n,r){const o=e(r,"list",t);if(!o)return console.warn("[pagination] Missing required element: list"),null;const s=o.parentElement;if(!s)return null;const a={controls:e(r,"controls",t),counter:e(r,"counter",t),dotsWrap:e(r,"dots",t),nextButton:null,prevButton:null};if(!a.controls)return{initialized:!1};const c=e(r,"next",t),u=e(r,"previous",t),d=i(l.clickable,"button"),p=c?.querySelector(d)||c,m=u?.querySelector(d)||u;if(!p||!m)return console.warn("[pagination] Missing required navigation buttons"),null;a.nextButton=p,a.prevButton=m,a.nextButton.setAttribute("aria-label","Go to next page"),a.prevButton.setAttribute("aria-label","Go to previous page"),a.counter&&(a.counter.setAttribute("aria-live","polite"),a.counter.setAttribute("aria-label","Current page"));const h=parseInt(a.controls?.getAttribute(r.attributes.properties.show)||"6")||6,g=parseInt(a.controls?.getAttribute(r.attributes.properties.showMobile)||String(h))||h,v=()=>getComputedStyle(o).getPropertyValue(f.state).trim()===l.cssVars.state.values.active,b=Array.from(o.children),y=b.length;if(!y)return null;const w={totalPages:1,currentIndex:1,currentPage:1,isAnimating:!1,itemsPerPage:h,dotTemplates:{active:null,inactive:null}};let E=[];const A=document.createElement("div");A.className="sr-only",A.setAttribute("aria-live","assertive"),A.setAttribute("aria-atomic","true"),A.style.cssText="position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden;",t.appendChild(A),n.liveRegions.push(A);const x=()=>{a.counter&&(a.counter.textContent=`${w.currentPage} / ${w.totalPages}`)},L=()=>{A.textContent=`Page ${w.currentPage} of ${w.totalPages}`,setTimeout(()=>A.textContent="",1e3)},k=()=>{E.forEach((e,t)=>{const n=e;t===w.currentIndex?n.removeAttribute("inert"):n.setAttribute("inert","")})},S=()=>{const e=E[w.currentIndex];e&&void 0!==e.offsetHeight&&(s.style.height=e.offsetHeight+"px")},C=()=>{if(!a.dotsWrap)return;const e=Array.from(a.dotsWrap.children);if(!e.length)return;const t=e.find(e=>e.classList.contains("is-active")),r=e.find(e=>!e.classList.contains("is-active"));w.dotTemplates.active=t?t.cloneNode(!0):e[0].cloneNode(!0),w.dotTemplates.inactive=r?r.cloneNode(!0):e[0].cloneNode(!0),a.dotsWrap.innerHTML="",a.dotsWrap.setAttribute("role","group"),a.dotsWrap.setAttribute("aria-label","Page navigation");for(let o=1;o<=w.totalPages;o++){const e=(1===o?w.dotTemplates.active:w.dotTemplates.inactive).cloneNode(!0);e.setAttribute("role","button"),e.setAttribute("tabindex","0"),e.setAttribute("aria-label",`Go to page ${o}`),e.setAttribute("aria-current",1===o?"page":"false"),e.setAttribute("data-page",String(o)),1===o?e.classList.add("is-active"):e.classList.remove("is-active");const t=()=>M(o);e.addEventListener("click",t),n.handlers.push({element:e,event:"click",handler:t});const r=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),M(o))};e.addEventListener("keydown",r),n.handlers.push({element:e,event:"keydown",handler:r}),a.dotsWrap.appendChild(e)}},T=()=>{if(!a.dotsWrap)return;Array.from(a.dotsWrap.children).forEach((e,t)=>{t+1===w.currentPage?(e.classList.add("is-active"),e.setAttribute("aria-current","page")):(e.classList.remove("is-active"),e.setAttribute("aria-current","false"))})},P=(e=null)=>{const t=v();if(w.itemsPerPage=e||(t?g:h),w.totalPages=Math.ceil(y/w.itemsPerPage),a.dotsWrap&&(n.handlers=n.handlers.filter(({element:e})=>!a.dotsWrap.contains(e))),Array.from(s.children).forEach(e=>{e!==o&&s.removeChild(e)}),o.innerHTML="",b.forEach(e=>o.appendChild(e)),w.totalPages<=1)return a.controls&&(a.controls.contains(document.activeElement)&&document.activeElement&&document.activeElement.blur(),a.controls.style.display="none",a.controls.setAttribute("aria-hidden","true")),a.dotsWrap&&(a.dotsWrap.style.display="none",a.dotsWrap.setAttribute("aria-hidden","true")),Object.assign(w,{totalPages:1,currentIndex:1,currentPage:1,isAnimating:!1}),s.style.cssText=`transform: translateX(0%); height: ${o.offsetHeight}px;`,E=[o],1;a.controls&&(a.controls.style.display="",a.controls.removeAttribute("aria-hidden")),a.dotsWrap&&(a.dotsWrap.style.display="",a.dotsWrap.removeAttribute("aria-hidden"));const r=Array.from({length:w.totalPages},(e,t)=>{const n=o.cloneNode(!1),r=t*w.itemsPerPage,s=Math.min(r+w.itemsPerPage,y);return b.slice(r,s).forEach(e=>n.appendChild(e.cloneNode(!0))),n});return s.insertBefore(r[r.length-1].cloneNode(!0),o),r.slice(1).forEach(e=>s.appendChild(e)),s.appendChild(r[0].cloneNode(!0)),o.innerHTML="",Array.from(r[0].children).forEach(e=>o.appendChild(e)),Object.assign(w,{currentIndex:1,currentPage:1,isAnimating:!1}),E=Array.from(s.children),s.style.transition="none",s.style.transform="translateX(-100%)",s.offsetHeight,s.style.transition="",x(),S(),k(),C(),w.totalPages};let q=v();const D=new ResizeObserver(()=>{if(w.isAnimating)return;const e=v();e!==q?(q=e,P()):S()});D.observe(s),n.observers.push(D),P();const M=e=>{if(w.isAnimating||w.totalPages<=1||e===w.currentPage)return;w.isAnimating=!0,w.currentIndex=e,w.currentPage=e,x(),L(),S(),T(),v()&&a.controls&&setTimeout(()=>{const e=80,t=a.controls.getBoundingClientRect().bottom+window.pageYOffset-window.innerHeight+e;window.scrollTo({top:t,behavior:"smooth"})},50),s.style.transform=`translateX(${100*-w.currentIndex}%)`;let t=null;const n=()=>{clearTimeout(t),s.removeEventListener("transitionend",n),x(),L(),S(),k(),T(),w.isAnimating=!1};t=setTimeout(n,1e3),s.addEventListener("transitionend",n)},I=e=>{if(w.isAnimating||w.totalPages<=1)return;w.isAnimating=!0,w.currentIndex+=e,w.currentPage=w.currentIndex>w.totalPages?1:w.currentIndex<1?w.totalPages:w.currentIndex,x(),L(),S(),T(),v()&&a.controls&&setTimeout(()=>{const e=80,t=a.controls.getBoundingClientRect().bottom+window.pageYOffset-window.innerHeight+e;window.scrollTo({top:t,behavior:"smooth"})},50),s.style.transform=`translateX(${100*-w.currentIndex}%)`;let t=null;const n=()=>{clearTimeout(t),s.removeEventListener("transitionend",n),w.currentIndex>w.totalPages?(w.currentIndex=1,w.currentPage=1,s.style.transition="none",s.style.transform="translateX(-100%)",s.offsetHeight,s.style.transition=""):w.currentIndex<1&&(w.currentIndex=w.totalPages,w.currentPage=w.totalPages,s.style.transition="none",s.style.transform=`translateX(${100*-w.totalPages}%)`,s.offsetHeight,s.style.transition=""),x(),L(),S(),k(),T(),w.isAnimating=!1};t=setTimeout(n,1e3),s.addEventListener("transitionend",n)},$=()=>I(1),F=()=>I(-1);return a.nextButton.addEventListener("click",$),a.prevButton.addEventListener("click",F),n.handlers.push({element:a.nextButton,event:"click",handler:$},{element:a.prevButton,event:"click",handler:F}),{initialized:!0}}(r,n,t);o||console.warn("[pagination] Failed to initialize container",r)}catch(o){console.error("[pagination] Error initializing container:",o,r)}})}catch(r){console.error("[pagination] Critical error during initialization:",r)}return{result:"pagination initialized",destroy:()=>{try{n.liveRegions.forEach(e=>{try{e.parentNode&&e.parentNode.removeChild(e)}catch(r){console.error("[pagination] Error removing live region:",r)}}),n.liveRegions.length=0,n.observers.forEach(e=>{try{e.disconnect()}catch(r){console.error("[pagination] Error disconnecting observer:",r)}}),n.observers.length=0,n.handlers.forEach(({element:e,event:t,handler:n})=>{try{e.removeEventListener(t,n)}catch(r){console.error("[pagination] Error removing event listener:",r)}}),n.handlers.length=0}catch(r){console.error("[pagination] Critical error during cleanup:",r)}}}}async function q(t){const n=o("comparison");if(!n)return{result:"comparison skipped - GSAP not loaded"};const{gsap:r,Draggable:s}=n;m("comparison",["Draggable"],"error");const c=a(t,"wrapper"),u={draggables:[],handlers:[],observers:[]},d=i(t,"template-name"),p=i(t,"template-description"),h=i(t,"template-before-image"),g=i(t,"template-after-image");function v(e,t){e.style.setProperty(f.clip,`${t}%`)}function b(n,r){const o=n.templateItems[r];if(!o)return;const s=o.querySelector(d);n.nameElement&&s&&(n.nameElement.textContent=s.textContent);const a=o.querySelector(p);n.descElement&&a&&(n.descElement.textContent=a.textContent);const i=o.querySelector(h);n.beforeImage&&i&&(n.beforeImage.src=i.src,n.beforeImage.alt=i.alt||"");const c=o.querySelector(g);n.afterImage&&c&&(n.afterImage.src=c.src,n.afterImage.alt=c.alt||"",y(n)),n.currentIndex=r,function(n,r){const o=e(t,"pagination",n);if(!o)return;const s=l.classes.active;Array.from(o.children).forEach((e,t)=>{t===r?e.classList.add(s):e.classList.remove(s)})}(n.wrapper,r)}function y(e){const t=e.slider,n=e.wrapper;switch(e.mode){case"before":n.style.setProperty(f.clip,"100%"),t.style.display="none";break;case"after":n.style.setProperty(f.clip,"0%"),t.style.display="none";break;case"split":v(n,e.sliderPosition),t.style.display="flex"}}function w(e,t){const n=e.currentIndex+t,r=e.templateItems.length-1;let o;o=n>r?0:n<0?r:n,b(e,o)}return c.forEach(n=>{const o=e(t,"template-list",n);if(!o)return void console.warn("[comparison] No template list found in wrapper");const a=i(t,"template-item"),c=Array.from(o.querySelectorAll(a));if(0===c.length)return void console.warn("[comparison] No template items found");n.setAttribute("aria-live","polite"),n.setAttribute("aria-label","Before and after image comparison");const d=e(t,"image-wrapper",n),p=e(t,"slider",n),f=e(t,"before-image",n),m=e(t,"after-image",n),h=e(t,"name",n),g=e(t,"description",n);if(!d||!p||!m){const e=[];return d||e.push('image-wrapper (data-hs-comparison="image-wrapper")'),p||e.push('slider (data-hs-comparison="slider")'),m||e.push('after-image (data-hs-comparison-image="after")'),void console.warn(`[comparison] Missing required elements: ${e.join(", ")}`)}const E={wrapper:n,templateItems:c,currentIndex:0,mode:"split",sliderPosition:50,slider:p,beforeImage:f?.querySelector("img"),afterImage:m?.querySelector("img"),nameElement:h,descElement:g,draggable:null};if(b(E,0),v(n,50),s){const e=s.create(p,{type:"x",bounds:d,onDrag:function(){const e=d.getBoundingClientRect(),t=p.getBoundingClientRect().left-e.left,r=Math.max(0,Math.min(100,t/e.width*100));v(n,r),E.sliderPosition=r}});u.draggables.push(e),E.draggable=e[0];const t=new ResizeObserver(()=>{E.draggable&&E.draggable.update()});t.observe(d),u.observers=u.observers||[],u.observers.push(t);[E.beforeImage,E.afterImage].filter(Boolean).forEach(e=>{e instanceof HTMLImageElement&&!e.complete&&e.addEventListener("load",()=>{E.draggable&&E.draggable.update()},{once:!0})});const o=e=>{if("split"!==E.mode)return;const t=d.getBoundingClientRect(),o=e.clientX-t.left,s=Math.max(0,Math.min(100,o/t.width*100)),a=o-t.width/2;E.draggable&&(r.set(p,{x:a}),E.draggable.update()),v(n,s),E.sliderPosition=s};d.addEventListener("click",o),u.handlers.push({element:d,event:"click",handler:o})}n.querySelectorAll(`[${t.attributes.properties.modeType}]`).forEach(e=>{const n=e.getAttribute(t.attributes.properties.modeType),r=i(l.clickable,"button"),o=e.querySelector(r)||e;n===E.mode&&e.classList.add(l.classes.active);const s=e=>{e.preventDefault(),function(e,n){const r=e.wrapper.querySelectorAll(`[${t.attributes.properties.modeType}]`),o=l.classes.active;r.forEach(e=>{e.getAttribute(t.attributes.properties.modeType)===n?e.classList.add(o):e.classList.remove(o)}),e.mode=n,y(e)}(E,n)};o.addEventListener("click",s),u.handlers.push({element:o,event:"click",handler:s})}),function(e,n){const r=n.querySelector(`[${t.attributes.properties.navType}="previous"]`),o=n.querySelector(`[${t.attributes.properties.navType}="next"]`);if(r){const t=i(l.clickable,"button"),n=r.querySelector(t)||r;n.setAttribute("aria-label","Previous image");const o=t=>{t.preventDefault(),w(e,-1)};n.addEventListener("click",o),u.handlers.push({element:n,event:"click",handler:o})}if(o){const t=i(l.clickable,"button"),n=o.querySelector(t)||o;n.setAttribute("aria-label","Next image");const r=t=>{t.preventDefault(),w(e,1)};n.addEventListener("click",r),u.handlers.push({element:n,event:"click",handler:r})}}(E,n);const A=e(t,"pagination",n);A&&c.length>1&&function(e,t){const n=t.children[0];if(!n)return;const r=l.classes.active;t.innerHTML="",e.templateItems.forEach((o,s)=>{const a=n.cloneNode(!0);a.classList.remove(r),0===s&&a.classList.add(r);const i=()=>{b(e,s)};a.addEventListener("click",i),u.handlers.push({element:a,event:"click",handler:i}),t.appendChild(a)})}(E,A),function(e){const t=t=>{"ArrowLeft"===t.key||"ArrowUp"===t.key?(t.preventDefault(),w(e,-1)):"ArrowRight"!==t.key&&"ArrowDown"!==t.key||(t.preventDefault(),w(e,1))};e.wrapper.addEventListener("keydown",t),e.wrapper.setAttribute("tabindex","0"),u.handlers.push({element:e.wrapper,event:"keydown",handler:t})}(E)}),{result:`comparison initialized (${c.length} instances)`,destroy:()=>{u.draggables.forEach(e=>{e&&e[0]&&e[0].kill&&e[0].kill()}),u.handlers.forEach(({element:e,event:t,handler:n})=>{e.removeEventListener(t,n)}),u.observers.forEach(e=>e.disconnect()),u.draggables.length=0,u.handlers.length=0,u.observers.length=0}}}function D(t){const n={handlers:[],timers:[],animationFrames:[],observers:[]},r=(e,t,r,o)=>{e.addEventListener(t,r,o),n.handlers.push({element:e,event:t,handler:r,options:o})},c=e=>n.animationFrames.push(e),u=()=>`${l.cssVars.prefix}${t.cssVars?.progress||"progress"}`,d=(e,t)=>e.style.setProperty(u(),String(t));function p(a){const p=e(t,"links",a),f=e(t,"list",a);if(!p||!f)return;const m=Array.from(p.children),h=Array.from(f.children),g=i(l.clickable,"button"),v=m.map(e=>e.querySelector(g)).filter(e=>null!==e);if(0===v.length)return;const b=a.getAttribute(t.attributes.properties?.autoplay||"data-hs-tab-autoplay"),y=a.getAttribute(t.attributes.properties?.duration||"data-hs-tab-duration"),w=a.getAttribute(t.attributes.properties?.hover||"data-hs-tab-hover"),E=a.getAttribute(t.attributes.properties?.animation||"data-hs-tab-animation"),A=a.getAttribute(t.attributes.properties?.animationDuration||"data-hs-tab-animation-duration"),x="true"===b,L=y?parseFloat(y):6,k="pause"===w,S=E,C=A?parseFloat(A):.3,T=`${"hs-tab"}-${Math.random().toString(36).substring(2,9)}`;h.forEach((e,t)=>{const n=e.id||`${T}-panel-${t}`,r=`${T}-tab-${t}`;e.id=n,v[t]&&(v[t].id=r,v[t].setAttribute("aria-controls",n))});let P=0,q=null,D=null,M=null,I=!1,$=!1,F=!1;async function N(e,t=!1){if($)return;if(e<0||e>=h.length)return;if(e===P&&!t)return;$=!0;const n=P;if(P=e,v.forEach((t,n)=>{t.setAttribute("aria-selected",n===e?"true":"false"),t.setAttribute("tabindex",n===e?"0":"-1")}),m.forEach((t,n)=>{t.classList.toggle(l.classes.active,n===e)}),x)if(I){const t=m[n]?parseFloat(getComputedStyle(m[n]).getPropertyValue(u())||"0"):0;m.forEach((n,r)=>d(n,r===e?t:0))}else O();const r=h[n],a=h[e];"fade"!==S||t?"clip"!==S||t?h.forEach((t,n)=>{n===e?("fade"===S||"clip"===S?(t.style.position="",t.style.display="block","fade"===S?t.style.opacity="1":t.style.clipPath=""):t.style.display="block",t.inert=!1,t.style.pointerEvents="",t.classList.add(l.classes.active)):("fade"===S||"clip"===S?(t.style.display="none","fade"===S?t.style.opacity="0":t.style.clipPath=""):t.style.display="none",t.inert=!0,t.style.pointerEvents="none",t.classList.remove(l.classes.active))}):await async function(e,t,n){s()&&(n=0);const r=o("tabs",!1);if(!r)return e.style.display="none",e.style.position="",e.style.clipPath="",e.inert=!0,e.style.pointerEvents="none",t.style.display="block",t.style.position="",t.style.clipPath="",t.inert=!1,void(t.style.pointerEvents="");const{gsap:a}=r;return new Promise(r=>{const o=a.timeline({onComplete:()=>{e.style.display="none",e.style.position="",e.style.clipPath="",e.inert=!0,e.style.pointerEvents="none",t.style.position="",t.style.clipPath="",t.inert=!1,t.style.pointerEvents="",r()},defaults:{duration:n,ease:"power1.inOut"}});o.set(e,{position:"absolute",top:0,left:0,width:"100%",clipPath:"inset(0% 0% 0% 0%)"}),o.set(t,{display:"block",position:"relative",clipPath:"inset(0% 0% 100% 0%)"}),o.to(e,{clipPath:"inset(100% 0% 0% 0%)"}),o.to(t,{clipPath:"inset(0% 0% 0% 0%)"},"<40%")})}(r,a,C):await async function(e,t,n){s()&&(n=0);const r=o("tabs",!1);if(!r)return e.style.display="none",e.style.position="",e.inert=!0,e.style.pointerEvents="none",t.style.display="block",t.style.position="",t.inert=!1,void(t.style.pointerEvents="");const{gsap:a}=r;return new Promise(r=>{const o=a.timeline({onComplete:()=>{e.style.display="none",e.style.position="",e.style.opacity="",e.inert=!0,e.style.pointerEvents="none",t.style.position="",t.style.opacity="",t.inert=!1,t.style.pointerEvents="",r()},defaults:{duration:n,ease:"power1.out"}});o.set(e,{position:"absolute",top:0,left:0,width:"100%"}),o.set(t,{display:"block",position:"relative",opacity:0}),o.to(e,{opacity:0}),o.to(t,{opacity:1},"<50%")})}(r,a,C),$=!1}function H(e){if(x){M||(M=e);const t=Math.min((e-M)/(1e3*L),1);m.forEach((e,n)=>d(e,n===P?t:0)),t<1&&!I&&(D=requestAnimationFrame(H),D&&c(D))}else m.forEach((e,t)=>d(e,t===P?1:0))}function O(){if(z(),!x)return H(0);if(I||!F)return;const e=m[P]?parseFloat(getComputedStyle(m[P]).getPropertyValue(u())||"0"):0,t=e*L*1e3,r=Math.max(0,1e3*L-t);M=null;const o=e,s=performance.now(),a=e=>{const t=Math.min(o+(e-s)/(1e3*L),1);m.forEach((e,n)=>d(e,n===P?t:0)),t<1&&!I&&(D=requestAnimationFrame(a),D&&c(D))};var i;D=requestAnimationFrame(a),D&&c(D),q=window.setTimeout(()=>N((P+1)%h.length),r),i=q,n.timers.push(i)}function z(){null!==q&&(clearTimeout(q),q=null),null!==D&&(cancelAnimationFrame(D),D=null),M=null}const W=()=>{I=!0,z()},B=()=>{I=!1,O()};v.forEach((e,t)=>{r(e,"click",e=>{e.preventDefault(),N(t)})});const R=e=>{const t=v.indexOf(e.target);if(-1===t)return;let n=t;switch(e.key){case"ArrowLeft":case"ArrowUp":e.preventDefault(),n=0===t?v.length-1:t-1;break;case"ArrowRight":case"ArrowDown":e.preventDefault(),n=t===v.length-1?0:t+1;break;case"Home":e.preventDefault(),n=0;break;case"End":e.preventDefault(),n=v.length-1;break;default:return}$||(N(n),v[n].focus())};v.forEach(e=>r(e,"keydown",R)),k&&x&&(r(a,"mouseenter",W),r(a,"mouseleave",B));let X=!1;r(document,"keydown",()=>X=!0),r(document,"mousedown",()=>X=!1),x&&(r(a,"focusin",()=>{X&&(W(),Y())}),r(a,"focusout",()=>{X&&I&&(B(),Y())}));const V=`[${t.attributes.properties?.controls||"data-hs-tab-controls"}]`,U=a.querySelectorAll(V);let j=null,G=null;U.forEach(e=>{const n=e.getAttribute(t.attributes.properties?.controls||"data-hs-tab-controls"),o=e.querySelector(g);if(o)if("previous"===n)o.setAttribute("aria-label","Previous tab"),r(o,"click",e=>{e.preventDefault(),N(0===P?h.length-1:P-1)});else if("next"===n)o.setAttribute("aria-label","Next tab"),r(o,"click",e=>{e.preventDefault(),N((P+1)%h.length)});else if("toggle"===n){if(!x)return void(e.style.display="none");j=e,G=o,G.setAttribute("aria-label",I?"Play":"Pause"),j.classList.toggle(l.classes.active,!I),r(o,"click",e=>{e.preventDefault(),I?B():W(),Y()})}});const Y=()=>{j&&G&&(j.classList.toggle(l.classes.active,!I),G.setAttribute("aria-label",I?"Play":"Pause"))};if(N(0,!0),x){const e=new IntersectionObserver(e=>{e.forEach(e=>{F=e.isIntersecting,e.isIntersecting&&!I?O():z()})},{threshold:.1});e.observe(a),K=e,n.observers.push(K)}var K}const f=a(t,"wrapper");return f.forEach(e=>{p(e)}),{result:`tabs initialized (${f.length} systems)`,destroy:()=>{n.timers.forEach(e=>clearTimeout(e)),n.timers.length=0,n.animationFrames.forEach(e=>cancelAnimationFrame(e)),n.animationFrames.length=0,n.observers.forEach(e=>e.disconnect()),n.observers.length=0,n.handlers.forEach(({element:e,event:t,handler:n,options:r})=>{e.removeEventListener(t,n,r)}),n.handlers.length=0}}}async function M(e){const t=l.classes.active,n={handlers:[],modals:[]},r=(e,t,r,o)=>{e.addEventListener(t,r,o),n.handlers.push({element:e,event:t,handler:r,options:o})},o=a(e,"wrapper");if(0===o.length)return{result:"modal: no modals found",destroy:()=>{}};o.forEach(e=>{const t=e.getAttribute("data-hs-modal-id");if(!t)return void console.warn("[modal] Wrapper missing data-hs-modal-id:",e);e.setAttribute("role","dialog"),e.setAttribute("aria-modal","true"),e.setAttribute("aria-hidden","true");const r=e.querySelector("h1, h2, h3, h4, h5, h6");r&&(r.id||(r.id=`modal-${t}-title`),e.setAttribute("aria-labelledby",r.id));const o=Array.from(e.querySelectorAll('[data-hs-modal="close"]'));o.forEach(e=>{e.setAttribute("aria-label","Close modal")});const s={wrapper:e,modalId:t,closeButtons:o,triggerButton:null,focusableElements:[]};n.modals.push(s)});const s=(e,r)=>{const o=n.modals.find(t=>t.modalId===e);if(!o)return void console.warn(`[modal] Modal with id "${e}" not found`);const{wrapper:s}=o;r&&(o.triggerButton=r),s.classList.add(t),s.setAttribute("aria-hidden","false"),d(),o.focusableElements=(e=>{const t=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");return Array.from(e.querySelectorAll(t))})(s),o.closeButtons.length>0?o.closeButtons[0].focus():o.focusableElements.length>0&&o.focusableElements[0].focus()},i=e=>{const{wrapper:n,triggerButton:r}=e;c(n),n.classList.remove(t),n.setAttribute("aria-hidden","true"),p(),r&&(r.focus(),e.triggerButton=null),e.focusableElements=[]},c=e=>{e.querySelectorAll("video").forEach(e=>{e.pause(),e.currentTime=0});e.querySelectorAll("audio").forEach(e=>{e.pause(),e.currentTime=0});e.querySelectorAll("iframe").forEach(e=>{const t=e.src;e.src="",e.src=t})};document.querySelectorAll("[data-hs-modal-open]").forEach(e=>{const t=e.getAttribute("data-hs-modal-open");if(!t)return;e.setAttribute("aria-haspopup","dialog"),e.setAttribute("aria-controls",`modal-${t}`);r(e,"click",n=>{n.preventDefault(),s(t,e)})}),n.modals.forEach(e=>{e.closeButtons.forEach(t=>{r(t,"click",()=>{i(e)})});r(e.wrapper,"click",t=>{t.target===e.wrapper&&i(e)})});r(document,"keydown",e=>{if("Escape"===e.key){const e=n.modals.slice().reverse().find(e=>e.wrapper.classList.contains(t));e&&i(e)}});return r(document,"keydown",e=>{const r=n.modals.find(e=>e.wrapper.classList.contains(t));r&&((e,t)=>{if("Tab"!==e.key)return;const{focusableElements:n}=t;if(0===n.length)return;const r=n[0],o=n[n.length-1];e.shiftKey?document.activeElement===r&&(e.preventDefault(),o.focus()):document.activeElement===o&&(e.preventDefault(),r.focus())})(e,r)}),{result:`modal initialized (${n.modals.length} modals)`,destroy:()=>{n.handlers.forEach(({element:e,event:t,handler:n,options:r})=>{e.removeEventListener(t,n,r)}),n.handlers.length=0,n.modals.forEach(e=>{e.wrapper.classList.contains(t)&&(e.wrapper.classList.remove(t),e.wrapper.setAttribute("aria-hidden","true"),p())}),n.modals.length=0}}}function I(n){const r={handlers:[],domContentLoadedHandler:null},o=(e,t,n)=>{e.addEventListener(t,n),r.handlers.push({element:e,event:t,handler:n})};function s(){a(n,"wrapper").forEach(r=>{const s=r;s.dataset.hsFormRangeInit||(s.dataset.hsFormRangeInit="true",function(r,o){const s=r.querySelector("input[type='range']");if(!s)return void console.warn('[range] Missing <input type="range"> element in wrapper',r);const a=e(n,"output",r),i=()=>{const e=s.min?+s.min:0,o=s.max?+s.max:100,i=+s.value||e,l=(i-e)/(o-e);r.style.setProperty(`${t._global.cssVars.prefix}${n.cssVars?.progress||"progress"}`,String(l)),a&&(a.textContent=String(i))};o(s,"input",i),i()}(s,o))})}return"loading"===document.readyState?(r.domContentLoadedHandler=s,document.addEventListener("DOMContentLoaded",r.domContentLoadedHandler)):s(),{result:"range initialized",destroy:()=>{r.domContentLoadedHandler&&(document.removeEventListener("DOMContentLoaded",r.domContentLoadedHandler),r.domContentLoadedHandler=null),r.handlers.forEach(({element:e,event:t,handler:n})=>{e.removeEventListener(t,n)}),r.handlers.length=0;a(n,"wrapper").forEach(e=>{delete e.dataset.hsFormRangeInit})}}}const F=[{name:"Alabama",value:"AL"},{name:"Alaska",value:"AK"},{name:"Arizona",value:"AZ"},{name:"Arkansas",value:"AR"},{name:"California",value:"CA"},{name:"Colorado",value:"CO"},{name:"Connecticut",value:"CT"},{name:"Delaware",value:"DE"},{name:"Florida",value:"FL"},{name:"Georgia",value:"GA"},{name:"Hawaii",value:"HI"},{name:"Idaho",value:"ID"},{name:"Illinois",value:"IL"},{name:"Indiana",value:"IN"},{name:"Iowa",value:"IA"},{name:"Kansas",value:"KS"},{name:"Kentucky",value:"KY"},{name:"Louisiana",value:"LA"},{name:"Maine",value:"ME"},{name:"Maryland",value:"MD"},{name:"Massachusetts",value:"MA"},{name:"Michigan",value:"MI"},{name:"Minnesota",value:"MN"},{name:"Mississippi",value:"MS"},{name:"Missouri",value:"MO"},{name:"Montana",value:"MT"},{name:"Nebraska",value:"NE"},{name:"Nevada",value:"NV"},{name:"New Hampshire",value:"NH"},{name:"New Jersey",value:"NJ"},{name:"New Mexico",value:"NM"},{name:"New York",value:"NY"},{name:"North Carolina",value:"NC"},{name:"North Dakota",value:"ND"},{name:"Ohio",value:"OH"},{name:"Oklahoma",value:"OK"},{name:"Oregon",value:"OR"},{name:"Pennsylvania",value:"PA"},{name:"Rhode Island",value:"RI"},{name:"South Carolina",value:"SC"},{name:"South Dakota",value:"SD"},{name:"Tennessee",value:"TN"},{name:"Texas",value:"TX"},{name:"Utah",value:"UT"},{name:"Vermont",value:"VT"},{name:"Virginia",value:"VA"},{name:"Washington",value:"WA"},{name:"West Virginia",value:"WV"},{name:"Wisconsin",value:"WI"},{name:"Wyoming",value:"WY"}];function N(t){const n={observers:[],handlers:[],timeouts:[],domContentLoadedHandler:null},r=e=>n.observers.push(e),o=(e,t,r,o)=>{e.addEventListener(t,r,o),n.handlers.push({element:e,event:t,handler:r,options:o})},s=e=>n.timeouts.push(e);function i(){document.querySelectorAll("select > div").forEach(e=>{const t=e.parentElement;for(;e.firstChild;)t.appendChild(e.firstChild);e.remove()});a(t,"wrapper").forEach(a=>{!function(r,o,s,a){const i=r.querySelector("select");if(!i)return void console.warn("[select] Missing <select> element in custom select wrapper",r);i.setAttribute("aria-hidden","true"),i.setAttribute("tabindex","-1");const l=i.getAttribute("name")||"custom-select",f=e(t,"list",r),m=e(t,"button",r);if(!f||!m)return void console.warn("[select] Missing required elements (list or button) in custom select wrapper",r);function h(){i.disabled?(m.disabled=!0,m.setAttribute("aria-disabled","true")):(m.disabled=!1,m.removeAttribute("aria-disabled"))}h();const g=f.firstElementChild;if(!g)return void console.warn("[select] Missing option template in custom select list",r);const v=g.cloneNode(!0);g.remove();i.querySelectorAll("option").forEach((e,t)=>{const n=v.cloneNode(!0),r=n.querySelector("span");if(r&&(r.textContent=e.textContent),n.setAttribute("data-value",e.value),n.setAttribute("role","option"),n.setAttribute("id",`${l}-option-${t}`),n.setAttribute("tabindex","-1"),e.selected){n.setAttribute("aria-selected","true");const t=m.querySelector("span")||m;"SPAN"===t.tagName&&(t.textContent=e.textContent),e.value?m.classList.add("is-filled"):m.classList.remove("is-filled")}else n.setAttribute("aria-selected","false");f.appendChild(n)}),f.setAttribute("role","listbox"),f.setAttribute("id",`${l}-listbox`),f.setAttribute("tabindex","-1"),f.setAttribute("aria-hidden","true"),f.inert=!0,m.setAttribute("role","combobox"),m.setAttribute("aria-haspopup","listbox"),m.setAttribute("aria-controls",`${l}-listbox`),m.setAttribute("aria-expanded","false"),m.setAttribute("id",`${l}-button`);const b=r.querySelector("label")||document.querySelector(`label[for="${i.id}"]`);if(b){const e=b.id||`${l}-label`;b.id=e,i.id||(i.id=`${l}-select`),b.setAttribute("for",i.id),m.setAttribute("aria-labelledby",e)}const y=r.querySelector('[data-hs-height="element"]'),w=y||null;let E="",A=null;function x(){return r.classList.contains("is-active")}function L(){const e=x(),t="true"===m.getAttribute("aria-expanded");if(t&&!e&&f.contains(document.activeElement)&&m.focus(),m.setAttribute("aria-expanded",e?"true":"false"),f.setAttribute("aria-hidden",e?"false":"true"),f.inert=!e,e){f.querySelectorAll('[role="option"]').forEach(e=>{e.setAttribute("tabindex","0")}),t||d()}else{m.removeAttribute("aria-activedescendant");f.querySelectorAll('[role="option"]').forEach(e=>{e.setAttribute("tabindex","-1")}),t&&p()}w&&u(w,e,{duration:300,ease:"power2.inOut"})}w&&c(w,x());function k(e){const t=f.querySelectorAll('[role="option"]');e<0||e>=t.length||(t.forEach(e=>{e.classList.remove("focused"),e.setAttribute("tabindex","-1")}),t[e].classList.add("focused"),t[e].setAttribute("tabindex","0"),t[e].focus(),m.setAttribute("aria-activedescendant",t[e].id))}function S(e){if(1!==e.length)return!1;if(null!==A){clearTimeout(A);const e=n.timeouts.indexOf(A);e>-1&&n.timeouts.splice(e,1)}const t=Array.from(f.querySelectorAll('[role="option"]'));if(0===t.length)return!1;E+=e.toLowerCase();const o=t.findIndex(e=>e.classList.contains("focused"));if(1===E.length||E.split("").every(e=>e===E[0])){const e=E[0];let n=o+1;for(let o=0;o<t.length;o++){const s=(n+o)%t.length;if((t[s].querySelector("span")?.textContent||t[s].textContent).toLowerCase().startsWith(e))return k(s),x()||r.classList.add("is-active"),A=setTimeout(C,500),a(A),!0}}else{const e=t.findIndex(e=>(e.querySelector("span")?.textContent||e.textContent).toLowerCase().startsWith(E));if(-1!==e)return k(e),x()||r.classList.add("is-active"),A=setTimeout(C,500),a(A),!0}return A=setTimeout(C,500),a(A),!1}function C(){E="",A=null}function T(e){const t=e.getAttribute("data-value")||"",n=e.querySelector("span")?.textContent||e.textContent;i.value=t,i.dispatchEvent(new Event("change",{bubbles:!0}));const o=m.querySelector("span")||m;"SPAN"===o.tagName&&(o.textContent=n),t?m.classList.add("is-filled"):m.classList.remove("is-filled"),f.querySelectorAll('[role="option"]').forEach(e=>{e.setAttribute("aria-selected","false")}),e.setAttribute("aria-selected","true"),r.classList.remove("is-active")}L();const P=e=>{e.preventDefault(),r.classList.toggle("is-active")};o(m,"click",P);const q=e=>{switch(e.key){case"Enter":e.preventDefault();const t=m.closest("form");if(t){const e=t.querySelector('button[type="submit"], input[type="submit"]')||t.querySelector("button:not([type])");e&&e.click()}break;case" ":e.preventDefault(),r.classList.toggle("is-active");break;case"ArrowDown":e.preventDefault(),x()?k(0):(r.classList.add("is-active"),requestAnimationFrame(()=>{k(0)}));break;case"ArrowUp":if(e.preventDefault(),x()){k(f.querySelectorAll('[role="option"]').length-1)}else r.classList.add("is-active"),requestAnimationFrame(()=>{k(0)});break;case"Escape":x()&&(e.preventDefault(),r.classList.remove("is-active"));break;case"Home":e.preventDefault(),x()||r.classList.add("is-active"),k(0);break;case"End":e.preventDefault(),x()||r.classList.add("is-active");k(f.querySelectorAll('[role="option"]').length-1);break;default:S(e.key)&&e.preventDefault()}};o(m,"keydown",q);const D=e=>{const t=e.target.closest('[role="option"]');if(!t)return;const n=Array.from(f.querySelectorAll('[role="option"]')),o=n.indexOf(t);switch(e.key){case"ArrowDown":e.preventDefault(),o<n.length-1&&k(o+1);break;case"ArrowUp":e.preventDefault(),o>0&&k(o-1);break;case"Enter":e.preventDefault(),T(t);break;case"Escape":e.preventDefault(),r.classList.remove("is-active"),m.focus();break;case"Home":e.preventDefault(),k(0);break;case"End":e.preventDefault(),k(n.length-1);break;default:S(e.key)&&e.preventDefault()}};o(f,"keydown",D);o(f,"click",e=>{const t=e.target.closest('[role="option"]');t&&T(t)});const M=e=>{e.relatedTarget&&r.contains(e.relatedTarget)||!r.classList.contains("is-active")||r.classList.remove("is-active")};o(f,"focusout",M);const I=e=>{r.classList.contains("is-active")&&!r.contains(e.target)&&r.classList.remove("is-active")};o(document,"click",I);const $=new MutationObserver(()=>{L()});$.observe(r,{attributes:!0,attributeFilter:["class"]}),s($);const F=new MutationObserver(()=>{h()});F.observe(i,{attributes:!0,attributeFilter:["disabled"]}),s(F);const N=()=>{const e=i.options[i.selectedIndex];if(e){const t=f.querySelectorAll('[role="option"]'),n=Array.from(t).find(t=>t.getAttribute("data-value")===e.value);if(n){const r=n.querySelector("span")?.textContent||n.textContent,o=m.querySelector("span")||m;"SPAN"===o.tagName&&(o.textContent=r),e.value?m.classList.add("is-filled"):m.classList.remove("is-filled"),t.forEach(e=>{e.setAttribute("aria-selected","false")}),n.setAttribute("aria-selected","true")}}};o(i,"change",N),o(i,"input",N);const H=i.closest("form");if(H){o(H,"reset",()=>{setTimeout(()=>{N()},0)})}}(a,o,r,s)})}return"loading"===document.readyState?(n.domContentLoadedHandler=i,document.addEventListener("DOMContentLoaded",n.domContentLoadedHandler)):i(),window.initCustomSelects=i,{result:"select initialized",destroy:()=>{n.domContentLoadedHandler&&(document.removeEventListener("DOMContentLoaded",n.domContentLoadedHandler),n.domContentLoadedHandler=null),n.observers.forEach(e=>e.disconnect()),n.observers.length=0,n.timeouts.forEach(e=>clearTimeout(e)),n.timeouts.length=0,n.handlers.forEach(({element:e,event:t,handler:n,options:r})=>{e.removeEventListener(t,n,r)}),n.handlers.length=0,window.initCustomSelects&&delete window.initCustomSelects}}}async function H(e){const t={destroyFunctions:[]};try{const n=function(e){const t=a(e,"states");return t.forEach(e=>{const t=e;if("SELECT"!==t.tagName)return void console.warn('[select-states] data-hs-form-select="states" must be on a <select> element',t);const n=t.querySelectorAll("option");if(1!==n.length)return void console.warn("[select-states] Select must have exactly 1 default template option (placeholder). Found:",n.length,t);const r=n[0];if(""!==r.value)return void console.warn("[select-states] Template option must have empty value for placeholder. Found value:",r.value,t);const o=r.textContent;t.innerHTML="";const s=document.createElement("option");s.value="",s.textContent=o,t.appendChild(s),F.forEach(e=>{const n=document.createElement("option");n.value=e.value,n.textContent=e.name,t.appendChild(n)})}),{result:`states initialized on ${t.length} select${1!==t.length?"s":""}`,destroy:()=>{}}}(e.states);n?.destroy&&t.destroyFunctions.push(n.destroy);const r=N(e["custom-select"]);return r?.destroy&&t.destroyFunctions.push(r.destroy),{result:"select initialized",destroy:()=>{t.destroyFunctions.forEach(e=>{try{e()}catch(t){console.error("[select] Error during cleanup:",t)}}),t.destroyFunctions.length=0}}}catch(n){throw console.error("[select] Initialization failed:",n),t.destroyFunctions.forEach(e=>{try{e()}catch(t){console.error("[select] Error during error cleanup:",t)}}),n}}const O="hsfx-form-persist";function z(e){const t={handlers:[],debounceTimers:new Map},n=i(e,"field"),r=document.querySelectorAll(n);if(0===r.length)return{result:"persist skipped - no fields found",destroy:()=>{}};const o=()=>{try{const e=localStorage.getItem(O);if(e){return JSON.parse(e)}}catch{}return{timestamp:Date.now().toString()}},s=e=>{e.timestamp=Date.now().toString(),localStorage.setItem(O,JSON.stringify(e))},a=e=>{if(e instanceof HTMLInputElement){if("checkbox"===e.type)return e.checked?"true":"false";if("radio"===e.type){const t=e.name;if(t){const e=document.querySelector(`input[type="radio"][name="${t}"]:checked`);return e?.value||""}return e.checked?e.value:""}return e.value}return e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement?e.value:""},l=e.attributes.elements.field.primary.match(/data-[^=]+/)?.[0];return l?(r.forEach(e=>{const n=e.getAttribute(l);if(!n)return;const r=()=>((e,n)=>{const r=t.debounceTimers.get(e);r&&clearTimeout(r);const i=setTimeout(()=>{const r=o(),i=a(e);r[n]=i,s(r),t.debounceTimers.delete(e)},300);t.debounceTimers.set(e,i)})(e,n),i=e instanceof HTMLSelectElement?"change":"input";e.addEventListener(i,r),t.handlers.push({element:e,event:i,handler:r}),"change"!==i&&(e.addEventListener("change",r),t.handlers.push({element:e,event:"change",handler:r}));const c=a(e);if(c){const e=o();e[n]=c,s(e)}}),{result:`persist initialized (${r.length} fields)`,destroy:()=>{t.debounceTimers.forEach(e=>clearTimeout(e)),t.debounceTimers.clear(),t.handlers.forEach(({element:e,event:t,handler:n})=>{e.removeEventListener(t,n)}),t.handlers.length=0}}):{result:"persist skipped - invalid config",destroy:()=>{}}}async function W(){const n=t.default.form,r={destroyFunctions:[]},o=i(n.persist,"field");if(document.querySelector(o))try{const e=z(n.persist);e?.destroy&&r.destroyFunctions.push(e.destroy)}catch(d){console.error("[form] Error initializing persist:",d)}const s=i(n.honeypot,"form-handler");if(document.querySelector(s))try{const t=function(t){const n={honeypotHandler:null},r=n=>{const r=n.target;if("FORM"!==r.tagName)return;const o=e(t,"form-handler",r);if(!o)return;const s="INPUT"===o.tagName?o:o.querySelector("input");return s&&s.value?(n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),!1):void 0};return n.honeypotHandler=r,document.addEventListener("submit",r,!0),{result:"honeypot initialized",destroy:()=>{n.honeypotHandler&&(document.removeEventListener("submit",n.honeypotHandler,!0),n.honeypotHandler=null)}}}(n.honeypot);t?.destroy&&r.destroyFunctions.push(t.destroy)}catch(d){console.error("[form] Error initializing honeypot:",d)}const l=i(n.range,"wrapper");if(document.querySelector(l))try{const e=I(n.range);e?.destroy&&r.destroyFunctions.push(e.destroy)}catch(d){console.error("[form] Error initializing range:",d)}const c=i(n.test,"wrapper");if(document.querySelector(c))try{const t=function(t){const n={handlers:[]},r=(e,t,r,o)=>{e.addEventListener(t,r,o),n.handlers.push({element:e,event:t,handler:r,options:o})},o=a(t,"wrapper");return o.forEach(n=>{const o=n.querySelector("form");if(!o)return void console.warn('[form-test] No <form> element found within data-hs-form-test="wrapper"',n);const s=e(t,"info",n),a=()=>{const e=new FormData(o),t={};for(const[n,r]of e.entries())t[n]=r;if(s){const e=document.createElement("pre");e.textContent=JSON.stringify(t,null,2),s.innerHTML="",s.appendChild(document.createTextNode("Test mode active - Live form data:")),s.appendChild(e)}};s&&(s.textContent="Test mode active, preventing native submissions",a()),r(o,"input",a),r(o,"change",a);const i=o.querySelector('button[type="submit"], input[type="submit"]')||o.querySelector("button:not([type])");i&&r(i,"click",()=>{console.log("[form-test] Submit button clicked"),requestAnimationFrame(()=>{o.checkValidity()||console.log("[form-test] Browser blocked submission - validation failed")})}),r(o,"submit",e=>{e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),console.log("[form-test] Submission prevented - displaying test results");const t=new FormData(o),n={};for(const[o,s]of t.entries())n[o]=s;const r=`✅ Form would submit successfully at ${(new Date).toLocaleTimeString()}`;if(s){const e=document.createElement("pre");e.textContent=JSON.stringify(n,null,2),s.innerHTML="",s.appendChild(document.createTextNode(r)),s.appendChild(e)}else console.log(r),console.log("Form data:",n);return!1},!0)}),{result:`test initialized on ${o.length} form${1!==o.length?"s":""}`,destroy:()=>{n.handlers.forEach(({element:e,event:t,handler:n,options:r})=>{e.removeEventListener(t,n,r)}),n.handlers.length=0}}}(n.test);t?.destroy&&r.destroyFunctions.push(t.destroy)}catch(d){console.error("[form] Error initializing test:",d)}const u=i(n.select,"wrapper");if(document.querySelector(u))try{const e=await H(n.select);e?.destroy&&r.destroyFunctions.push(e.destroy)}catch(d){console.error("[form] Error initializing select:",d)}return{result:`form initialized (${r.destroyFunctions.length} modules active)`,destroy:()=>{r.destroyFunctions.forEach(e=>{try{e()}catch(d){console.error("[form] Error during cleanup:",d)}}),r.destroyFunctions.length=0}}}function B(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function R(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return B(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?B(e,t):void 0}}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function X(e,t,n,r){var o,s,a={headers:{accept:"*/*"}};return t||(a.mode="no-cors"),n&&(a.credentials="include"),a.priority=r?"high":"low",window.fetch?fetch(e,a):(o=e,s=n,new Promise(function(e,t,n){(n=new XMLHttpRequest).open("GET",o,n.withCredentials=s),n.setRequestHeader("Accept","*/*"),n.onload=function(){200===n.status?e():t()},n.send()}))}var V,U=(V=document.createElement("link")).relList&&V.relList.supports&&V.relList.supports("prefetch")?function(e,t){return new Promise(function(n,r,o){(o=document.createElement("link")).rel="prefetch",o.href=e,t&&o.setAttribute("crossorigin","anonymous"),o.onload=n,o.onerror=r,document.head.appendChild(o)})}:X,j=window.requestIdleCallback||function(e){var t=Date.now();return setTimeout(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})},1)},G=new Set,Y=new Set,K=!1;function J(e,t){return Array.isArray(t)?t.some(function(t){return J(e,t)}):(t.test||t).call(t,e.href,e)}function _(e){if(e){if(e.saveData)return new Error("Save-Data is enabled");if(/2g/.test(e.effectiveType))return new Error("network conditions are poor")}return!0}function Z(e){if(void 0===e&&(e={}),window.IntersectionObserver&&"isIntersecting"in IntersectionObserverEntry.prototype){var t=function(e){e=e||1;var t=[],n=0;function r(){n<e&&t.length>0&&(t.shift()(),n++)}return[function(e){t.push(e)>1||r()},function(){n--,r()}]}(e.throttle||1/0),n=t[0],r=t[1],o=e.limit||1/0,s=e.origins||[location.hostname],a=e.ignores||[],i=e.delay||0,l=[],c=e.timeoutFn||j,u="function"==typeof e.hrefFn&&e.hrefFn,d=e.prerender||!1;K=e.prerenderAndPrefetch||!1;var p=new IntersectionObserver(function(t){t.forEach(function(t){if(t.isIntersecting)l.push((t=t.target).href),a=function(){l.includes(t.href)&&(p.unobserve(t),(K||d)&&Y.size<o?function(e,t){void 0===t&&(t="immediate");var n=_(navigator.connection);if(n instanceof Error)return Promise.reject(new Error("Cannot prerender, "+n.message));if(!HTMLScriptElement.supports("speculationrules"))return Q(e,!0,!1,!1,"moderate"===t||"conservative"===t),Promise.reject(new Error("This browser does not support the speculation rules API. Falling back to prefetch."));for(var r,o=R([].concat(e));!(r=o()).done;)Y.add(r.value);G.size>0&&!K&&console.warn("[Warning] You are using both prefetching and prerendering on the same document");var s=function(e,t){var n=document.createElement("script");n.type="speculationrules",n.text='{"prerender":[{"source": "list",\n "urls": ["'+Array.from(e).join('","')+'"],\n "eagerness": "'+t+'"}]}';try{document.head.appendChild(n)}catch(r){return r}return!0}(Y,t);return!0===s?Promise.resolve():Promise.reject(s)}(u?u(t):t.href,e.eagerness).catch(function(t){if(!e.onError)throw t;e.onError(t)}):G.size<o&&!d&&n(function(){Q(u?u(t):t.href,e.priority,e.checkAccessControlAllowOrigin,e.checkAccessControlAllowCredentials,e.onlyOnMouseover).then(r).catch(function(t){r(),e.onError&&e.onError(t)})}))},(c=i)?setTimeout(a,c):a();else{var s=l.indexOf((t=t.target).href);s>-1&&l.splice(s)}var a,c})},{threshold:e.threshold||0});return c(function(){(e.el&&e.el.length&&e.el.length>0&&"A"===e.el[0].nodeName?e.el:(e.el||document).querySelectorAll("a")).forEach(function(e){s.length&&!s.includes(e.hostname)||J(e,a)||p.observe(e)})},{timeout:e.timeout||2e3}),function(){G.clear(),p.disconnect()}}}function Q(e,t,n,r,o){var s=_(navigator.connection);return s instanceof Error?Promise.reject(new Error("Cannot prefetch, "+s.message)):(Y.size>0&&!K&&console.warn("[Warning] You are using both prefetching and prerendering on the same document"),Promise.all([].concat(e).map(function(e){return G.has(e)?[]:(G.add(e),function(e,t,n){var r=[].slice.call(arguments,3);if(!n)return e.apply(void 0,[t].concat(r));for(var o,s=Array.from(document.querySelectorAll("a")).filter(function(e){return e.href===t}),a=new Map,i=function(){var n=o.value,s=function(o){var l=setTimeout(function(){return n.removeEventListener("mouseenter",s),n.removeEventListener("mouseleave",i),e.apply(void 0,[t].concat(r))},200);a.set(n,l)},i=function(e){var t=a.get(n);t&&(clearTimeout(t),a.delete(n))};n.addEventListener("mouseenter",s),n.addEventListener("mouseleave",i)},l=R(s);!(o=l()).done;)i()}(t?X:U,new URL(e,location.href).toString(),o,n,r,t))})))}async function ee(){const e=new Set,t=Z({el:document.body,limit:5,throttle:1e3,timeout:1e4,ignoreSlowConnection:!0,origins:[window.location.hostname],delay:0,priority:"low"}),n=new IntersectionObserver(t=>{t.forEach(t=>{if(t.isIntersecting){const n=t.target.href;if(n.includes("#")||e.has(n))return;Q([n],{priority:"low"}).then(()=>{e.add(n)}).catch(()=>{})}})},{rootMargin:"200px"});return document.querySelectorAll("a[href]").forEach(e=>{e instanceof HTMLAnchorElement&&e.hostname===window.location.hostname&&n.observe(e)}),document.body.addEventListener("mouseover",t=>{const n=t.target.closest("a[href]");if(n&&n instanceof HTMLAnchorElement){const t=n.href;n.hostname===window.location.hostname&&!e.has(t)&&Q([t],{priority:"low"}).then(()=>{e.add(t)}).catch(()=>{})}}),{result:"link-prefetch initialized",destroy:()=>{t&&"function"==typeof t&&t(),n.disconnect()}}}async function te(){const e=t._global.classes.active,n=t.default["active-link"],r={observers:[],handlers:[],scrollTimeout:null},o=i(n,"wrapper"),s=i(n,"trigger"),a=document.querySelectorAll('a[href^="#"], button[data-target^="#"]'),l=[];a.forEach(e=>{let t=e;const n=e.closest(o);if(n)t=n;else{const n=e.closest(s);n&&(t=n)}l.push({link:e,target:t})});const c=[];if(a.forEach(e=>{const t=e.getAttribute("href")||e.getAttribute("data-target");if(t&&"#"!==t){const e=document.querySelector(t);e&&c.push({element:e,hash:t})}}),0===c.length)return{result:"active-link: no sections found",destroy:()=>{}};let u=null;const d=()=>{const t=.75*window.innerHeight;let n=null;for(let e=c.length-1;e>=0;e--){if(c[e].element.getBoundingClientRect().top<=t){n=c[e].hash;break}}if(n!==u&&(u=n,l.forEach(({target:t})=>t.classList.remove(e)),u)){const t=l.find(({link:e})=>e.getAttribute("href")===u||e.getAttribute("data-target")===u);t&&t.target.classList.add(e)}},p=new IntersectionObserver(()=>{d()},{rootMargin:"-75% 0px -25% 0px",threshold:0});c.forEach(({element:e})=>p.observe(e)),r.observers.push(p);const f=()=>{r.scrollTimeout&&clearTimeout(r.scrollTimeout),r.scrollTimeout=setTimeout(d,50)};return window.addEventListener("scroll",f),r.handlers.push({element:window,event:"scroll",handler:f}),d(),{result:`active-link initialized (${c.length} sections tracked)`,destroy:()=>{r.observers.forEach(e=>e.disconnect()),r.observers.length=0,r.handlers.forEach(({element:e,event:t,handler:n})=>{e.removeEventListener(t,n)}),r.handlers.length=0,r.scrollTimeout&&(clearTimeout(r.scrollTimeout),r.scrollTimeout=null),l.forEach(({target:t})=>t.classList.remove(e))}}}const ne=l.apiName;function re(t){const n={handlers:[]},r=(e,t,r,o)=>{e.addEventListener(t,r,o),n.handlers.push({element:e,event:t,handler:r,options:o})};const c=a(t,"wrapper");return c.forEach(function(n){const a=e(t,"list",n),c=e(t,"row",n);if(!!!a||!!!c)return;const u=t.attributes.properties?.animation,d=u&&n.getAttribute(u)||"instant",p=Array.from(a.children);if(0===p.length)return;const f=t.attributes.properties?.id,m=new Map;f&&p.forEach((e,t)=>{const n=e.getAttribute(f);n&&m.set(n,t)}),p.forEach((e,t)=>{0===t?(e.style.display="block",e.classList.add(l.classes.active)):(e.style.display="none",e.classList.remove(l.classes.active))});const h=[],g=c.firstElementChild?.cloneNode(!0);if(!g)return void console.warn(`[${ne}] Lightbox row has no template child`);for(g.classList.remove(l.classes.active);c.firstChild;)c.removeChild(c.firstChild);const v=i(l.clickable,"button");p.forEach((e,t)=>{const n=g.cloneNode(!0),o=e.querySelector("img, video, [src]"),s=n.querySelector("img, video, [src]");if(o&&s){const e=o.getAttribute("src");e&&s.setAttribute("src",e)}0===t&&n.classList.add(l.classes.active);const a=n.querySelector(v)||n;r(a,"click",()=>w(t)),c.appendChild(n),h.push(n)});let b=0,y=!1;async function w(e){if(y||e===b)return;if(e<0||e>=p.length)return;y=!0;const t=p[b],n=p[e];h.forEach((t,n)=>{t.classList.toggle(l.classes.active,n===e)}),t.classList.remove(l.classes.active),n.classList.add(l.classes.active),"fade"===d?await async function(e,t,n){s()&&(n=0);const r=o("lightbox",!1);if(!r)return e.style.display="none",void(t.style.display="block");const{gsap:a}=r;return new Promise(r=>{const o=a.timeline({onComplete:()=>{e.style.display="none",e.style.position="",e.style.opacity="",t.style.position="",t.style.opacity="",r()},defaults:{duration:n,ease:"power1.out"}});o.set(e,{position:"absolute",top:0,left:0,width:"100%"}),o.set(t,{display:"block",position:"relative",opacity:0}),o.to(e,{opacity:0}),o.to(t,{opacity:1},"<50%")})}(t,n,.3):"clip"===d?await async function(e,t,n){s()&&(n=0);const r=o("lightbox",!1);if(!r)return e.style.display="none",void(t.style.display="block");const{gsap:a}=r;return new Promise(r=>{const o=a.timeline({onComplete:()=>{e.style.display="none",e.style.position="",e.style.clipPath="",t.style.position="",t.style.clipPath="",r()},defaults:{duration:n,ease:"power1.inOut"}});o.set(e,{position:"absolute",top:0,left:0,width:"100%",clipPath:"inset(0% 0% 0% 0%)"}),o.set(t,{display:"block",position:"relative",clipPath:"inset(0% 0% 100% 0%)"}),o.to(e,{clipPath:"inset(100% 0% 0% 0%)"}),o.to(t,{clipPath:"inset(0% 0% 0% 0%)"},"<40%")})}(t,n,.3):(t.style.display="none",n.style.display="block"),b=e,y=!1}const E=e(t,"previous",n),A=e(t,"next",n);if(E){const e=E.querySelector(v)||E;r(e,"click",()=>{w(0===b?p.length-1:b-1)})}if(A){const e=A.querySelector(v)||A;r(e,"click",()=>{w(b===p.length-1?0:b+1)})}const x=t.attributes.properties?.button;if(x&&m.size>0){r(document,"click",e=>{const t=e.target.closest(`[${x}]`);if(!t)return;const n=t.getAttribute(x);n&&m.has(n)&&w(m.get(n))})}}),{result:`lightbox initialized (${c.length} instances)`,destroy:()=>{n.handlers.forEach(({element:e,event:t,handler:n,options:r})=>{e.removeEventListener(t,n,r)}),n.handlers.length=0}}}const oe=t._global.apiName;function se(t){const n={handlers:[],observers:[],draggables:[]},r=(e,t,r,o)=>{e.addEventListener(t,r,o),n.handlers.push({element:e,event:t,handler:r,options:o})},c=o("slider",!1);if(!c)return{result:"slider skipped (no GSAP)",destroy:()=>{}};const{gsap:u,Draggable:d}=c;if(!h())return m("slider",["Draggable"],"error"),{result:"slider skipped (no Draggable)",destroy:()=>{}};const p=s();const f=a(t,"component");return f.forEach(function(o){const s=e(t,"element",o),c=e(t,"list",o);if(!c)return void console.warn(`[${oe}] Slider component missing list:`,o);if(!s)return void console.warn(`[${oe}] Slider component missing element:`,o);let f=Array.from(c.children);if(0===f.length)return;const m=f.length,h=`slider-${Math.random().toString(36).substring(2,9)}`;c.setAttribute("id",h),c.setAttribute("role","region"),c.setAttribute("aria-label","Slider content");const g=t.attributes?.properties||{},v="true"===s.getAttribute(g.free||"data-hs-slider-free"),b="false"!==s.getAttribute(g.follow||"data-hs-slider-follow"),y="true"===s.getAttribute(g.wheel||"data-hs-slider-wheel"),w="true"===s.getAttribute(g.toClicked||"data-hs-slider-to-clicked"),E="true"===s.getAttribute(g.infinite||"data-hs-slider-infinite"),A=p?0:parseFloat(s.getAttribute(g.speed||"data-hs-slider-speed")||"0.5"),x=a(t,"previous",o),L=a(t,"next",o),k=i(l.clickable,"button"),S=[],C=[];x.forEach(e=>{const t=e.querySelector(k);t&&S.push(t)}),L.forEach(e=>{const t=e.querySelector(k);t&&C.push(t)});const T=e(t,"dots",o);let P=null;T?.firstElementChild&&(P=T.firstElementChild.cloneNode(!0),P.classList.remove(l.classes.active));const q=e(t,"draggable-wrapper",o),D=e(t,"draggable-element",o);let M=0;if(E){q&&(q.style.display="none");const e=f[0].offsetWidth,t=s.offsetWidth,n=getComputedStyle(c),r=parseFloat(n.gap)||0,o=Math.max(1,Math.round((t+r)/(e+r)));M=o+1;for(let s=m-M;s<m;s++){const e=f[s<0?m+s:s].cloneNode(!0);e.setAttribute("data-clone","true"),c.insertBefore(e,c.firstChild)}for(let s=0;s<M;s++){const e=f[s].cloneNode(!0);e.setAttribute("data-clone","true"),c.appendChild(e)}f=Array.from(c.children)}const I={slidePositions:[],currentIndex:0,draggable:null};let $=!1;function F(){if(E)return m;const e=function(){if(0===f.length)return 1;const e=s.offsetWidth,t=f[0].offsetWidth,n=getComputedStyle(c),r=parseFloat(n.gap)||0;return t+r===0?1:Math.max(1,Math.round((e+r)/(t+r)))}();return Math.max(1,f.length-e+1)}function N(){I.slidePositions=[];const e=F(),t=getComputedStyle(c),n=parseFloat(t.gap)||0,r=H();for(let o=0;o<e;o++)if(o===e-1)I.slidePositions.push(r.minX);else{let e=0;for(let t=0;t<o;t++)e+=f[t].offsetWidth+n;I.slidePositions.push(-e)}}function H(){const e=s.offsetWidth,t=c.scrollWidth;return{minX:-Math.max(0,t-e),maxX:0}}function O(){const e=f[0]?.offsetWidth||0,t=getComputedStyle(c);return e+(parseFloat(t.gap)||0)}function z(){if(!E)return;$=!1;const e=u.getProperty(c,"x"),t=O(),n=M*t,r=m*t;let o=!1,s=e;Math.abs(e)<n-t/2?(s=e-r,u.set(c,{x:s}),o=!0):Math.abs(e)>n+r-t/2&&(s=e+r,u.set(c,{x:s}),o=!0),o&&(I.draggable&&I.draggable.update(),$=!0,W(s),X(),j(),R())}if(N(),E){const e=O(),t=-M*e;u.set(c,{x:t})}function W(e){const t=F();if(E){const n=O(),r=M*n,o=Math.abs(e)-r,s=Math.round(o/n);return void(I.currentIndex=(s%t+t)%t)}const n=H(),r=Math.abs(n.minX);if(0===r)return void(I.currentIndex=0);const o=Math.abs(e)/r;I.currentIndex=Math.min(t-1,Math.floor(o*t))}function B(e){if(v)return W(e),e;let t=I.slidePositions[0],n=Math.abs(e-t),r=0;return I.slidePositions.forEach((o,s)=>{const a=Math.abs(e-o);a<n&&(n=a,t=o,r=s)}),I.currentIndex=r,t}function R(){const e=F(),t=0===I.currentIndex,n=I.currentIndex>=e-1,r=v||E;S.forEach(e=>{e.disabled=!r&&t,e.setAttribute("aria-disabled",r?"false":String(t))}),C.forEach(e=>{e.disabled=!r&&n,e.setAttribute("aria-disabled",r?"false":String(n))})}function X(){const e=l.classes.active;f.forEach((t,n)=>{t.classList.toggle(e,n===I.currentIndex)})}let V=[],U=null;function j(){const e=l.classes.active;V.forEach((t,n)=>{t.classList.toggle(e,n===I.currentIndex),t.setAttribute("aria-current",n===I.currentIndex?"true":"false")})}function G(e,t=!0){u.killTweensOf(c);const n=F();if(E){const r=O();let o=e;e<0?o=n-1:e>=n&&(o=0);const s=-(M*r+o*r);if(e<0||e>=n){const t=u.getProperty(c,"x");if(e<0){const e=t-m*r;u.set(c,{x:e})}else{const e=t+m*r;u.set(c,{x:e})}I.draggable&&I.draggable.update()}return I.currentIndex=o,R(),X(),j(),void(t&&A>0?u.to(c,{x:s,duration:A,ease:"power2.out",onUpdate:()=>{I.draggable&&I.draggable.update(),Y()}}):(u.set(c,{x:s}),I.draggable&&I.draggable.update(),Y()))}const r=Math.max(0,Math.min(e,n-1)),o=I.slidePositions[r];void 0!==o&&(I.currentIndex=r,R(),X(),j(),t&&A>0?u.to(c,{x:o,duration:A,ease:"power2.out",onUpdate:()=>{I.draggable&&I.draggable.update(),Y()}}):(u.set(c,{x:o}),I.draggable&&I.draggable.update(),Y()))}function Y(){if(!q||!D)return;const e=H(),t=Math.abs(e.minX);if(0===t)return;const n=u.getProperty(c,"x"),r=Math.max(0,Math.min(1,Math.abs(n)/t)),o=q.offsetWidth,s=D.offsetWidth,a=Math.max(0,o-s);u.set(D,{x:r*a})}if(d){const e=H(),t=d.create(c,{type:"x",bounds:E?void 0:{minX:e.minX,maxX:e.maxX},inertia:!0,edgeResistance:E?0:.65,dragResistance:b?0:.5,cursor:"auto",activeCursor:"auto",allowContextMenu:!0,snap:v||E?void 0:{x:B},onDrag:function(){const e=u.getProperty(c,"x");Y(),B(e),X(),j(),R()},onThrowUpdate:function(){if(z(),Y(),!$){B(u.getProperty(c,"x")),X(),j(),R()}},onThrowComplete:function(){z(),v||(R(),X(),j()),Y()},onDragEnd:function(){v&&Y()}});n.draggables.push(t),I.draggable=t[0]}function K(){if(!T||!P)return;T.innerHTML="",V=[];const e=l.classes.active,t=F();for(let n=0;n<t;n++){const t=P.cloneNode(!0);t.setAttribute("role","button"),t.setAttribute("tabindex","0"),t.setAttribute("aria-label",`Go to page ${n+1}`),t.setAttribute("aria-controls",h),n===I.currentIndex&&(t.classList.add(e),t.setAttribute("aria-current","true"));r(t,"click",()=>G(n));r(t,"keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),G(n))}),T.appendChild(t),V.push(t)}}if(K(),q&&D&&d){const e=()=>({minX:0,maxX:q.offsetWidth-D.offsetWidth}),t=d.create(D,{type:"x",bounds:e(),allowContextMenu:!0,onDrag:function(){const t=e(),n=Math.max(0,Math.min(1,this.x/t.maxX)),r=H(),o=-n*Math.abs(r.minX);u.set(c,{x:o}),I.draggable&&I.draggable.update(),B(o),X(),j(),R()},onDragEnd:function(){if(!v){B(u.getProperty(c,"x")),G(I.currentIndex)}}});n.draggables.push(t),U=t[0]}if(S.forEach(e=>{e.setAttribute("aria-controls",h);r(e,"click",()=>G(I.currentIndex-1))}),C.forEach(e=>{e.setAttribute("aria-controls",h);r(e,"click",()=>G(I.currentIndex+1))}),y){let e=0,t=!1,n=null;r(s,"wheel",r=>{if(t)return;const o=r.deltaX;if(Math.abs(o)<1)return;e+=o,n&&clearTimeout(n),n=window.setTimeout(()=>{e=0},150);Math.abs(e)>=100&&(r.preventDefault(),t=!0,G(e>0?I.currentIndex+1:I.currentIndex-1),e=0,setTimeout(()=>{t=!1},1e3*A+50))},{passive:!1})}w&&f.forEach((e,t)=>{r(e,"click",()=>{t!==I.currentIndex&&G(t)})});let J=F(),_=null;const Z=new ResizeObserver(()=>{_&&clearTimeout(_),_=window.setTimeout(()=>{const e=F();e!==J&&(I.currentIndex>=e&&(I.currentIndex=e-1),K(),J=e),N();const t=H();if(I.draggable&&(I.draggable.applyBounds({minX:t.minX,maxX:t.maxX}),I.draggable.update()),v||G(I.currentIndex,!1),Y(),U&&q&&D){const e=q.offsetWidth,t=D.offsetWidth;U.applyBounds({minX:0,maxX:e-t}),U.update()}},150)});Z.observe(s.parentElement||s),n.observers.push(Z),R(),X(),Y()}),{result:`slider initialized (${f.length} instances)`,destroy:()=>{n.draggables.forEach(e=>{try{Array.isArray(e)?e.forEach(e=>e.kill&&e.kill()):e?.kill&&e.kill()}catch(t){}}),n.draggables.length=0,n.observers.forEach(e=>e.disconnect()),n.observers.length=0,n.handlers.forEach(({element:e,event:t,handler:n,options:r})=>{e.removeEventListener(t,n,r)}),n.handlers.length=0}}}async function ae(){const e={destroyFunctions:[]},n=t.default;try{const t=await y();t?.destroy&&e.destroyFunctions.push(t.destroy)}catch(i){console.error("[default] Error initializing transition:",i)}const r=[w(n["smooth-scroll"]),k(n.navbar),S(n.accordion),T(),P(n.pagination),q(n.comparison),D(n.tabs),M(n.modal),W(),ee(),te(),re(n.lightbox),se(n.slider)],o=await Promise.allSettled(r);o.forEach(t=>{"fulfilled"===t.status&&t.value?.destroy&&e.destroyFunctions.push(t.value.destroy)});const s=o.filter(e=>"fulfilled"===e.status).length,a=o.length-s;return a>0&&console.warn(`[default] ${s+1}/${o.length+1} modules loaded successfully. ${a} failed but won't affect other modules.`),{result:"default initialized",destroy:()=>{e.destroyFunctions.forEach(e=>{try{e()}catch(i){console.error("[default] Error during cleanup:",i)}}),e.destroyFunctions.length=0}}}export{ae as init};
package/dist/main.js CHANGED
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/hsfxnormalizeCQnPjh4F.js","assets/hsfxutilsC44JpCww.js","assets/hsfxdefaultDDsdqoT4.js","assets/hsfxanimationsD_Lu6H9t.js"])))=>i.map(i=>d[i]);
2
- import{c as e}from"./assets/hsfxutilsC44JpCww.js";const t={},s=function(e,s,o){let r=Promise.resolve();if(s&&s.length>0){let e=function(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:"fulfilled",value:e}),e=>({status:"rejected",reason:e}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=o?.nonce||o?.getAttribute("nonce");r=e(s.map(e=>{if((e=function(e){return"https://cdn.jsdelivr.net/npm/@hsfx/attr@2.0.13/dist/"+e}(e))in t)return;t[e]=!0;const s=e.endsWith(".css"),o=s?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${e}"]${o}`))return;const r=document.createElement("link");return r.rel=s?"stylesheet":"modulepreload",s||(r.as="script"),r.crossOrigin="",r.href=e,a&&r.setAttribute("nonce",a),document.head.appendChild(r),s?new Promise((t,s)=>{r.addEventListener("load",t),r.addEventListener("error",()=>s(new Error(`Unable to preload CSS for ${e}`)))}):void 0}))}function a(e){const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(const e of t||[])"rejected"===e.status&&a(e.reason);return e().catch(a)})},o=e._global.apiName;(async()=>{if(window[o]&&!Array.isArray(window[o])&&window[o].loaded)return;const t=Array.isArray(window[o])?window[o]:[],r={normalize:()=>s(()=>import("./assets/hsfxnormalizeCQnPjh4F.js"),__vite__mapDeps([0,1])),default:()=>s(()=>import("./assets/hsfxdefaultDDsdqoT4.js"),__vite__mapDeps([2,1])),animations:()=>s(()=>import("./assets/hsfxanimationsD_Lu6H9t.js"),__vite__mapDeps([3,1]))};let a=[...document.querySelectorAll(`script[type="module"][src="${import.meta.url}"]`)];0===a.length&&(a=[...document.querySelectorAll('script[type="module"][src*="@hsfx/attr"]')].filter(e=>{const t=e.src,s=import.meta.url,o=t.match(/@hsfx\/attr(@[\d.]+)?/)?.[0],r=s.match(/@hsfx\/attr(@[\d.]+)?/)?.[0];return o&&r&&o.split("@")[0]===r.split("@")[0]}));const n={isSPA:a.some(e=>"true"===e.getAttribute("data-hs-spa"))},l={normalize:{modules:["normalize"],parallel:!1},default:{modules:["default"],parallel:!0}},i=async e=>{const t=window[o];if(t.process.has(e))return t.modules[e]?.loading;t.process.add(e);const s=t.modules[e]||{};let a;t.modules[e]=s,s.loading=new Promise((e,t)=>{s.resolve=e,s.reject=t});try{const{init:o}=await r[e](),n=await o()||{};a=n.destroy;const l=n.result;return s.destroy=()=>{a?.(),t.process.delete(e)},s.restart=()=>{s.destroy?.(),t.load(e)},s.resolve?.(l),delete s.resolve,delete s.reject,l}catch(n){throw a?.(),s.reject?.(n),t.process.delete(e),n}},d=async e=>{const t=l[e];if(t.parallel){const e=t.modules.map(e=>i(e));await Promise.allSettled(e)}else for(const s of t.modules)await i(s)},c=async()=>{await Promise.allSettled([r.normalize(),r.default(),r.animations()]),await d("normalize");const e=d("default"),t=i("animations");await e,(()=>{const e=new CustomEvent(`${o}:dom-ready`);window.dispatchEvent(e)})();const{initScrollAnimations:a}=await s(async()=>{const{initScrollAnimations:e}=await import("./assets/hsfxutilsC44JpCww.js").then(e=>e.t);return{initScrollAnimations:e}},[]);Promise.all([t,a()]).catch(e=>{console.error(`[${o}] Phase 3 (animations + scroll trigger) failed:`,e)})},u=[];window[o]={scripts:a,settings:n,modules:{},process:new Set,load:i,loaded:!1,push(...e){for(const[t,s]of e)"function"==typeof s?this.modules[t]?.loading?.then(s):this.load(t)},destroy(){for(const e in this.modules)this.modules[e]?.destroy?.()},async reinitialize(){this.loaded=!1,this.destroy(),this.modules={},this.process=new Set,await this.scanForEmbedModules(),await c(),this.loaded=!0},async scanForEmbedModules(){document.querySelectorAll(".w-embed").forEach(e=>{e.querySelectorAll("script[data-hs-module]").forEach(e=>{const t=e.getAttribute("data-hs-module-type"),s=e.getAttribute("data-hs-module");if(t&&s){const e=`data-hs-${t}-${s}`;r[e]&&this.load(e)}})})},ready(e){"function"==typeof e&&(this.loaded?e():u.push(e))},status(e){return e?{loaded:!!this.modules[e],loading:this.process.has(e)}:{loaded:Object.keys(this.modules),loading:[...this.process],phases:l}}};(async()=>{window[o].push(...t),document.querySelectorAll("iframe").forEach(e=>{const t=e.src;t&&(e.src="",e.src=t)}),await c(),window[o].loaded=!0,document.documentElement.classList.add(e._global.classes.ready),u.forEach(e=>{try{e()}catch{}}),u.length=0})().catch(()=>{})})();export{s as _};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/hsfxnormalizeCQnPjh4F.js","assets/hsfxutilsC44JpCww.js","assets/hsfxdefaultB7KP_rzw.js","assets/hsfxanimationsD_Lu6H9t.js"])))=>i.map(i=>d[i]);
2
+ import{c as e}from"./assets/hsfxutilsC44JpCww.js";const t={},s=function(e,s,o){let r=Promise.resolve();if(s&&s.length>0){let e=function(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:"fulfilled",value:e}),e=>({status:"rejected",reason:e}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=o?.nonce||o?.getAttribute("nonce");r=e(s.map(e=>{if((e=function(e){return"https://cdn.jsdelivr.net/npm/@hsfx/attr@2.0.15/dist/"+e}(e))in t)return;t[e]=!0;const s=e.endsWith(".css"),o=s?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${e}"]${o}`))return;const r=document.createElement("link");return r.rel=s?"stylesheet":"modulepreload",s||(r.as="script"),r.crossOrigin="",r.href=e,a&&r.setAttribute("nonce",a),document.head.appendChild(r),s?new Promise((t,s)=>{r.addEventListener("load",t),r.addEventListener("error",()=>s(new Error(`Unable to preload CSS for ${e}`)))}):void 0}))}function a(e){const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(const e of t||[])"rejected"===e.status&&a(e.reason);return e().catch(a)})},o=e._global.apiName;(async()=>{if(window[o]&&!Array.isArray(window[o])&&window[o].loaded)return;const t=Array.isArray(window[o])?window[o]:[],r={normalize:()=>s(()=>import("./assets/hsfxnormalizeCQnPjh4F.js"),__vite__mapDeps([0,1])),default:()=>s(()=>import("./assets/hsfxdefaultB7KP_rzw.js"),__vite__mapDeps([2,1])),animations:()=>s(()=>import("./assets/hsfxanimationsD_Lu6H9t.js"),__vite__mapDeps([3,1]))};let a=[...document.querySelectorAll(`script[type="module"][src="${import.meta.url}"]`)];0===a.length&&(a=[...document.querySelectorAll('script[type="module"][src*="@hsfx/attr"]')].filter(e=>{const t=e.src,s=import.meta.url,o=t.match(/@hsfx\/attr(@[\d.]+)?/)?.[0],r=s.match(/@hsfx\/attr(@[\d.]+)?/)?.[0];return o&&r&&o.split("@")[0]===r.split("@")[0]}));const n={isSPA:a.some(e=>"true"===e.getAttribute("data-hs-spa")),scrollTop:!a.some(e=>"false"===e.getAttribute("data-hs-scroll-top"))};n.scrollTop&&("scrollRestoration"in history&&(history.scrollRestoration="manual"),window.scrollTo(0,0));const l={normalize:{modules:["normalize"],parallel:!1},default:{modules:["default"],parallel:!0}},i=async e=>{const t=window[o];if(t.process.has(e))return t.modules[e]?.loading;t.process.add(e);const s=t.modules[e]||{};let a;t.modules[e]=s,s.loading=new Promise((e,t)=>{s.resolve=e,s.reject=t});try{const{init:o}=await r[e](),n=await o()||{};a=n.destroy;const l=n.result;return s.destroy=()=>{a?.(),t.process.delete(e)},s.restart=()=>{s.destroy?.(),t.load(e)},s.resolve?.(l),delete s.resolve,delete s.reject,l}catch(n){throw a?.(),s.reject?.(n),t.process.delete(e),n}},d=async e=>{const t=l[e];if(t.parallel){const e=t.modules.map(e=>i(e));await Promise.allSettled(e)}else for(const s of t.modules)await i(s)},c=async()=>{await Promise.allSettled([r.normalize(),r.default(),r.animations()]),await d("normalize");const e=d("default"),t=i("animations");await e,(()=>{const e=new CustomEvent(`${o}:dom-ready`);window.dispatchEvent(e)})();const{initScrollAnimations:a}=await s(async()=>{const{initScrollAnimations:e}=await import("./assets/hsfxutilsC44JpCww.js").then(e=>e.t);return{initScrollAnimations:e}},[]);Promise.all([t,a()]).catch(e=>{console.error(`[${o}] Phase 3 (animations + scroll trigger) failed:`,e)})},u=[];window[o]={scripts:a,settings:n,modules:{},process:new Set,load:i,loaded:!1,push(...e){for(const[t,s]of e)"function"==typeof s?this.modules[t]?.loading?.then(s):this.load(t)},destroy(){for(const e in this.modules)this.modules[e]?.destroy?.()},async reinitialize(){this.loaded=!1,this.destroy(),this.modules={},this.process=new Set,await this.scanForEmbedModules(),await c(),this.loaded=!0},async scanForEmbedModules(){document.querySelectorAll(".w-embed").forEach(e=>{e.querySelectorAll("script[data-hs-module]").forEach(e=>{const t=e.getAttribute("data-hs-module-type"),s=e.getAttribute("data-hs-module");if(t&&s){const e=`data-hs-${t}-${s}`;r[e]&&this.load(e)}})})},ready(e){"function"==typeof e&&(this.loaded?e():u.push(e))},status(e){return e?{loaded:!!this.modules[e],loading:this.process.has(e)}:{loaded:Object.keys(this.modules),loading:[...this.process],phases:l}}};(async()=>{window[o].push(...t),document.querySelectorAll("iframe").forEach(e=>{const t=e.src;t&&(e.src="",e.src=t)}),await c(),window[o].loaded=!0,document.documentElement.classList.add(e._global.classes.ready),u.forEach(e=>{try{e()}catch{}}),u.length=0})().catch(()=>{})})();export{s as _};
package/dist/main.js.br CHANGED
Binary file
package/dist/main.js.gz CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hsfx/attr",
3
- "version": "2.0.14",
3
+ "version": "2.0.16",
4
4
  "type": "module",
5
5
  "main": "dist/main.js",
6
6
  "license": "UNLICENSED",
@@ -1 +0,0 @@
1
- import{a as e,c as t,i as n,w as r,d as o,p as s,q as a,b as i,g as l,s as c,e as u,o as d,f as p,h as f,j as m,k as h}from"./hsfxutilsC44JpCww.js";const g=t._global,v=t.default.transition,b=g.apiName;async function y(){const t=e(v,"wrapper");if(!t)return{result:"transition skipped - no wrapper found",destroy:()=>{}};const o="data-hs-transition-initialized";if(t.hasAttribute(o))return{result:"transition already initialized",destroy:()=>{}};t.setAttribute(o,"true");const s=window[b]?.settings?.isSPA||!1,a=new Map;let i=null,l=null;const c=(e,n=null,r=t)=>{const o=v.attributes.elements.trigger.primary.match(/data-[^=]+/)?.[0],s=v.attributes.elements.namespace.primary.match(/data-[^=]+/)?.[0];if(!o||!s)return null;const a=r.querySelectorAll(`[${o}="${e}"]`);if(a.length>0){if(n){const t=r.querySelector(`[${s}="${n}"]`);if(t){const n=t.querySelector(`[${o}="${e}"]`);if(n)return n}}const t=Array.from(a).find(e=>{let t=e.parentElement;for(;t&&t!==r;){if(t.hasAttribute(s))return!1;t=t.parentElement}return!0});if(t)return t}const i="exit"===e?v.attributes.elements.exitTrigger.primary.match(/data-[^=]+/)?.[0]:v.attributes.elements.enterTrigger.primary.match(/data-[^=]+/)?.[0];if(!i)return null;const l=r.querySelectorAll(`[${i}]`);if(l.length>0){if(n){const e=r.querySelector(`[${s}="${n}"]`);if(e){const t=e.querySelector(`[${i}]`);if(t)return t}}const e=Array.from(l).find(e=>{let t=e.parentElement;for(;t&&t!==r;){if(t.hasAttribute(s))return!1;t=t.parentElement}return!0});if(e)return e}return null},u=(e=null)=>new Promise(n=>{const r=c("exit",e);if(!r)return void n();const o=(()=>{const e=v.attributes.elements.exitTime.primary.match(/data-[^=]+/)?.[0];if(!e)return 0;const n=t.getAttribute(e);return n?1e3*parseFloat(n):0})();r.click(),setTimeout(()=>n(),o)}),d=(e=null)=>new Promise(n=>{const r=c("enter",e);if(!r)return void n();const o=!sessionStorage.getItem("transition-loaded"),s=(()=>{const e=v.attributes.elements.firstDelay.primary.match(/data-[^=]+/)?.[0];if(!e)return 0;const n=t.getAttribute(e);return n?1e3*parseFloat(n):0})(),a=()=>{r.click(),o&&sessionStorage.setItem("transition-loaded","true"),n()};o&&s>0?i=setTimeout(a,s):a()}),p=e=>{u(e?.detail?.namespace||null)},f=e=>{d(e?.detail?.namespace||null)};if(a.set(`${b}:transition-exit`,p),a.set(`${b}:transition-enter`,f),window.addEventListener(`${b}:transition-exit`,p),window.addEventListener(`${b}:transition-enter`,f),!s){const e=e=>{const t=e.target.closest("a[href]");if(t&&t.hostname===window.location.hostname&&t.getAttribute("href")&&-1===t.getAttribute("href").indexOf("#")&&"_blank"!==t.getAttribute("target")){e.preventDefault();const n=t.href;u().then(()=>{window.location.href=n})}};a.set("click",e),document.addEventListener("click",e);const t=e=>{e.persisted&&window.location.reload()};a.set("pageshow",t),window.addEventListener("pageshow",t)}const m=()=>{t&&(t.style.display="none")};if(a.set("resize",m),window.addEventListener("resize",m),!s){const e=async()=>{n()&&(l=setTimeout(()=>{t.classList.add(g.classes.loading)},2e3),await r(),l&&(clearTimeout(l),l=null),t.classList.remove(g.classes.loading),t.classList.add(g.classes.loaded)),d()};a.set(`${b}:dom-ready`,e),window.addEventListener(`${b}:dom-ready`,e,{once:!0})}return{result:"transition initialized",destroy:()=>{i&&clearTimeout(i),l&&clearTimeout(l),a.forEach((e,t)=>{if("click"===t||"pageshow"===t||"resize"===t){("click"===t?document:window).removeEventListener(t,e)}else window.removeEventListener(t,e)}),a.clear(),t.removeAttribute(o)}}}async function w(t){let n=null,r=null;function a(n){const r=n.target.closest('a[href^="#"]');if(!r)return;const a=r.getAttribute("href");if(!a||"#"===a)return;const i=a.substring(1),l=document.getElementById(i);if(l){n.preventDefault(),history.replaceState&&history.replaceState(null,null,`#${l.id}`);!function(e,t=0){if(!e)return;const n=o("smooth-scroll",!1);if(s()||!n){const n=e.getBoundingClientRect().top+window.scrollY-t;return window.scrollTo(0,n),e.setAttribute("tabindex","-1"),void e.focus({preventScroll:!0})}n.gsap.to(window,{duration:1,scrollTo:{y:e,offsetY:t},ease:"power2.out",onComplete:function(){e.setAttribute("tabindex","-1"),e.focus({preventScroll:!0})}})}(l,function(){const n=e(t,"offset-proxy");if(console.log("[smooth-scroll] Proxy element:",n),n&&n instanceof HTMLElement){const e=getComputedStyle(n).top,t=parseFloat(e)||0;return console.log("[smooth-scroll] Computed top:",e,"-> offset:",t),t}return console.log("[smooth-scroll] No proxy element found, using offset: 0"),0}())}}return"undefined"!=typeof $&&$(document).off("click.wf-scroll"),document.documentElement.style.scrollBehavior="auto",document.body.style.scrollBehavior="auto",n=a,r=e=>{"Enter"!==e.key&&" "!==e.key||a(e)},document.addEventListener("click",n),document.addEventListener("keydown",r),{result:"autoInit-smooth-scroll initialized",destroy:()=>{n&&(document.removeEventListener("click",n),n=null),r&&(document.removeEventListener("keydown",r),r=null),document.documentElement.style.scrollBehavior="",document.body.style.scrollBehavior=""}}}let E=null;function A(t){E=t;const n={observers:[],handlers:[]};return function(t,n){const r=a(E,"wrapper"),o=[];r.forEach(r=>{const s=i(l.clickable,"button"),a=r.querySelector(s),d=e(E,"list",r);if(!a||!d)return void console.warn("[dropdown] Dropdown wrapper missing required elements:",r);const p=r.getAttribute("data-hs-nav-dropdown-type")||"hover",f=r.querySelector('[data-hs-height="element"]'),m=f?f.parentElement:null,h=a.textContent?.trim()||"dropdown",g=h.toLowerCase().replace(/[^a-z0-9\s]/g,"").replace(/\s+/g,"-").replace(/^-+|-+$/g,"").substring(0,50);const v=`navbar-dropdown-${g}-toggle`,b=`navbar-dropdown-${g}-list`;a.id=v,a.setAttribute("aria-haspopup","menu"),a.setAttribute("aria-expanded","false"),a.setAttribute("aria-controls",b),d.id=b,d.setAttribute("role","menu"),d.inert=!0;const y=Array.from(d.querySelectorAll(s));y.forEach((e,t)=>{if(e.setAttribute("role","menuitem"),e.setAttribute("tabindex","-1"),0===t){const t=a.textContent?.trim()||"menu";e.getAttribute("aria-label")||e.setAttribute("aria-label",`${e.textContent?.trim()}, ${t} submenu`)}});let w=-1;function A(){return r.classList.contains(l.classes.active)}function x(){const e=A();"true"===a.getAttribute("aria-expanded")&&!e&&d.contains(document.activeElement)&&a.focus(),a.setAttribute("aria-expanded",e?"true":"false"),d.inert=!e,y.forEach(t=>{t.setAttribute("tabindex",e?"0":"-1")}),e||(w=-1),u(m,e,{duration:"hover"===p?200:300,ease:"power2.inOut"})}c(m,A()),x();const L=new MutationObserver(()=>{x()});if(L.observe(r,{attributes:!0,attributeFilter:["class"]}),t(L),"hover"===p){o.push(r);const e=()=>{r.classList.add("is-active")},t=()=>{r.classList.remove("is-active")};n(r,"mouseenter",e),n(r,"mouseleave",t);n(a,"keydown",e=>{"ArrowDown"===e.key?(e.preventDefault(),A()||(r.classList.add(l.classes.active),y.length>0&&setTimeout(()=>{w=0,y[0].focus()},100))):" "===e.key||"Enter"===e.key?(e.preventDefault(),A()?r.classList.remove(l.classes.active):(r.classList.add(l.classes.active),y.length>0&&setTimeout(()=>{w=0,y[0].focus()},100))):"ArrowUp"===e.key?(e.preventDefault(),A()||(r.classList.add(l.classes.active),y.length>0&&setTimeout(()=>{w=y.length-1,y[w].focus()},100))):"Escape"===e.key&&(e.preventDefault(),A()&&r.classList.remove(l.classes.active))});const s=e=>{A()&&r.contains(document.activeElement)&&("ArrowDown"===e.key?(e.preventDefault(),w<y.length-1&&(w++,y[w].focus())):"ArrowUp"===e.key?(e.preventDefault(),0===w?(r.classList.remove(l.classes.active),a.focus(),w=-1):w>0?(w--,y[w].focus()):(a.focus(),w=-1)):"Escape"===e.key&&(e.preventDefault(),r.classList.remove("is-active")))};n(r,"keydown",s)}else if("click"===p){n(a,"click",e=>{e.preventDefault(),r.classList.toggle(l.classes.active)});n(a,"keydown",e=>{" "===e.key||"Enter"===e.key?(e.preventDefault(),r.classList.toggle(l.classes.active)):"Escape"===e.key&&(e.preventDefault(),A()&&r.classList.remove(l.classes.active))})}});const s=e=>{o.forEach(t=>{t.classList.contains("is-active")&&!t.contains(e.target)&&t.classList.remove("is-active")})};o.length>0&&n(document.body,"focusin",s)}(e=>{n.observers.push(e)},(e,t,r,o)=>{e.addEventListener(t,r,o),n.handlers.push({element:e,event:t,handler:r,options:o})}),{result:"dropdown initialized",destroy:()=>{n.observers.forEach(e=>e.disconnect()),n.observers.length=0,n.handlers.forEach(({element:e,event:t,handler:n,options:r})=>{e.removeEventListener(t,n,r)}),n.handlers.length=0,E=null}}}function x(t,n){const r={observers:[],handlers:[],state:{focusTrapHandler:null}},o=e=>{r.observers.push(e)};return function(o,s){const f=a(t,"button"),m=e(t,"wrapper");if(!f.length||!m)return;const h=n?e(n,"wrapper"):null,g=`menu-${Date.now()}`;m.id=g,m.setAttribute("role","dialog"),m.setAttribute("aria-modal","true"),m.inert=!0;const v=m.querySelector('[data-hs-height="element"]'),b=v?v.parentElement:null;f.forEach(t=>{t.setAttribute("aria-expanded","false"),t.setAttribute("aria-controls",g),t.setAttribute("aria-label","Open navigation menu");let a=null,v=!1;function y(){return t.classList.contains(l.classes.active)}function w(){const r=y(),o="true"===t.getAttribute("aria-expanded");r&&!o?(d(),m.classList.add(l.classes.active),m.inert=!1,h&&h.classList.add("hs-menu-open"),f.forEach(e=>{e.setAttribute("aria-expanded","true"),e.setAttribute("aria-label","Close navigation menu")}),b&&u(b,!0,{duration:300,ease:"power2.inOut"}),a=function(){const t=n?e(n,"wrapper"):document.querySelector('[data-hs-nav="wrapper"]');if(!t)return;const r=e=>{if("Tab"===e.key){const n=i(l.clickable,"button"),r=Array.from(t.querySelectorAll(n)),o=t.querySelectorAll('input, select, textarea, [tabindex]:not([tabindex="-1"])'),s=[...r,...Array.from(o)],a=s[0],c=s[s.length-1];e.shiftKey?document.activeElement===a&&(e.preventDefault(),c.focus()):document.activeElement===c&&(e.preventDefault(),a.focus())}};return document.addEventListener("keydown",r),r}(),v&&(setTimeout(()=>{const e=i(l.clickable,"button"),t=Array.from(m.querySelectorAll(e));if("last"===v){const e=t[t.length-1];e&&e.focus()}else{const e=t[0];e&&e.focus()}},100),v=!1)):!r&&o&&(m.contains(document.activeElement)&&t.focus(),p(),m.classList.remove(l.classes.active),m.inert=!0,h&&h.classList.remove("hs-menu-open"),f.forEach(e=>{e.setAttribute("aria-expanded","false"),e.setAttribute("aria-label","Open navigation menu")}),b&&u(b,!1,{duration:300,ease:"power2.inOut"}),function(e){e&&document.removeEventListener("keydown",e)}(a),a=null)}b&&c(b,y()),w();const E=new MutationObserver(()=>{w()});E.observe(t,{attributes:!0,attributeFilter:["class"]}),o(E);s(t,"click",function(e){e.preventDefault(),t.classList.toggle("is-active")});s(t,"keydown",function(e){" "===e.key||"Enter"===e.key?(e.preventDefault(),v=!0,t.classList.toggle(l.classes.active)):"ArrowDown"===e.key?(e.preventDefault(),y()||(v=!0,t.classList.add(l.classes.active))):"ArrowUp"===e.key?(e.preventDefault(),y()||(v="last",t.classList.add(l.classes.active))):"Escape"===e.key&&(e.preventDefault(),y()&&t.classList.remove(l.classes.active))}),r.state.focusTrapHandler=a})}(o,(e,t,n,o)=>{e.addEventListener(t,n,o),r.handlers.push({element:e,event:t,handler:n,options:o})}),function(n){const r=e(t,"wrapper");if(!r)return;let o=null;function s(){const e=window.getComputedStyle(r).getPropertyValue(f.state).trim();if(o===l.cssVars.state.values.active&&e===l.cssVars.state.values.inactive){const e=document.querySelector('[data-hs-nav-menu="button"]');e&&"true"===e.getAttribute("aria-expanded")&&e&&e.classList.remove("is-active")}o=e}const a=new ResizeObserver(s);a.observe(r),n(a),s()}(o),{result:"menu initialized",destroy:()=>{r.state.focusTrapHandler&&(document.removeEventListener("keydown",r.state.focusTrapHandler),r.state.focusTrapHandler=null),r.observers.forEach(e=>e.disconnect()),r.observers.length=0,r.handlers.forEach(({element:e,event:t,handler:n,options:r})=>{e.removeEventListener(t,n,r)}),r.handlers.length=0,document.body.classList.remove("u-overflow-hidden")}}}function L(t,n){const r={handlers:[]},o=(e,t,n,o)=>{e.addEventListener(t,n,o),r.handlers.push({element:e,event:t,handler:n,options:o})};return o(document,"keydown",t=>{if("ArrowLeft"!==t.key&&"ArrowRight"!==t.key)return;const r=n?e(n.menu,"wrapper"):document.querySelector('[data-hs-nav-menu="wrapper"]');if(r&&r.contains(document.activeElement))return;const o=n?e(n,"wrapper"):document.querySelector('[data-hs-nav="wrapper"]');if(!o||!o.contains(document.activeElement))return;const s=o.querySelector(`.${l.classes.active}[data-hs-nav-dropdown]`);if(s&&s.contains(document.activeElement))return;t.preventDefault();const a=i(l.clickable,"button"),c=Array.from(o.querySelectorAll(a)),u=Array.from(c).filter(e=>{if("-1"===e.getAttribute("tabindex"))return!1;if(e.closest('[role="menu"]'))return!1;const t=n?n.menu.attributes.elements.wrapper.primary.split("=")[0]:"data-hs-nav-menu";if(e.closest(`[${t}="wrapper"]`))return!1;const r=n?n.attributes.elements["skip-link"].primary.split("=")[0]:"data-hs-nav";if(e.closest(`[${r}="skip-link"]`))return!1;const s=window.getComputedStyle(e),a=e;if("none"===s.display||"hidden"===s.visibility||"0"===s.opacity||0===a.offsetWidth||0===a.offsetHeight)return!1;let i=e.parentElement;for(;i&&i!==o;){const e=window.getComputedStyle(i),t=i;if("none"===e.display||"hidden"===e.visibility||0===t.offsetWidth||0===t.offsetHeight)return!1;i=i.parentElement}return!0}),d=u.indexOf(document.activeElement);-1!==d&&("ArrowRight"===t.key?d<u.length-1&&u[d+1].focus():d>0&&u[d-1].focus())}),function(t){const r=n?e(n.menu,"wrapper"):document.querySelector('[data-hs-nav-menu="wrapper"]');if(!r)return;let o=-1;t(r,"keydown",t=>{const s=function(){const e=i(l.clickable,"button"),t=Array.from(r.querySelectorAll(e));return Array.from(t).filter(e=>{let t=e;for(;t&&t!==r;){if(t.inert)return!1;t=t.parentElement}return!0})}();if(0===s.length)return;const a=document.activeElement;if(o=s.indexOf(a),"ArrowDown"===t.key)t.preventDefault(),o<s.length-1&&(o+=1,s[o].focus());else if("ArrowUp"===t.key)t.preventDefault(),o>0&&(o-=1,s[o].focus());else if("ArrowRight"===t.key){if(t.preventDefault(),a&&"BUTTON"===a.tagName&&a.hasAttribute("aria-controls")){return void("true"===a.getAttribute("aria-expanded")||a.click())}}else if("ArrowLeft"===t.key){if(t.preventDefault(),a&&"BUTTON"===a.tagName&&a.hasAttribute("aria-controls")){return void("true"===a.getAttribute("aria-expanded")&&a.click())}}else if("Home"===t.key)t.preventDefault(),o=0,s[0].focus();else if("End"===t.key)t.preventDefault(),o=s.length-1,s[s.length-1].focus();else if(" "===t.key&&a&&"A"===a.tagName)t.preventDefault();else if("Escape"===t.key){const t=n?e(n.menu,"button"):document.querySelector('[data-hs-nav-menu="button"]');t&&(t.click(),t.focus())}})}(o),{result:"arrow-navigation initialized",destroy:()=>{r.handlers.forEach(({element:e,event:t,handler:n,options:r})=>{e.removeEventListener(t,n,r)}),r.handlers.length=0}}}async function k(e){const t={destroyFunctions:[]},n=await Promise.allSettled([A(e.dropdown),x(e.menu,e),L(e["arrow-navigation"],e)]);n.forEach(e=>{"fulfilled"===e.status&&e.value?.destroy&&t.destroyFunctions.push(e.value.destroy)});const r=n.filter(e=>"fulfilled"===e.status).length,o=n.length-r;return o>0&&console.warn(`[navbar] ${r}/${n.length} functions loaded successfully. ${o} failed but won't affect other functions.`),{result:"navbar initialized",destroy:()=>{t.destroyFunctions.forEach(e=>{try{e()}catch(t){console.error("[navbar] Error during cleanup:",t)}}),t.destroyFunctions.length=0}}}function S(t){const n={observers:[],handlers:[]};return function(n,r){const o=a(t,"wrapper");if(0===o.length)return 0;let s=0;o.forEach((o,a)=>{const d=e(t,"toggle",o),p=e(t,"content",o);if(!d||!p)return;s++;const f=`[${l.attributes.height}="${l.attributes.heightValue}"]`,m=o.querySelector(f),h=m?m.parentElement:p,g=`hs-accordion-btn-${a}`,v=`hs-accordion-content-${a}`,b=o.getAttribute(t.attributes.properties.open),y=o.getAttribute(t.attributes.properties.closed),w=b&&y;let E=[];if(w){const e=i(t,"state");E=Array.from(d.querySelectorAll(e))}function A(){return o.classList.contains(l.classes.active)}function x(){const e=A();if("true"===d.getAttribute("aria-expanded")&&!e&&p.contains(document.activeElement)){d.focus()}d.setAttribute("aria-expanded",e?"true":"false");var t;p.inert=!e,w&&E.length>0&&(t=e?b:y,w&&E.forEach(e=>{e.textContent=t})),u(h,e,{duration:300,ease:"power2.inOut"})}d.setAttribute("id",g),p.setAttribute("id",v),p.setAttribute("role","region"),p.setAttribute("aria-labelledby",g),d.setAttribute("aria-controls",v);const L=o.getAttribute(t.attributes.properties.default);L&&"open"===L.toLowerCase()&&o.classList.add(l.classes.active),c(h,A()),x();r(d,"click",e=>{e.preventDefault(),o.classList.toggle(l.classes.active)});const k=new MutationObserver(()=>{x()});k.observe(o,{attributes:!0,attributeFilter:["class"]}),n(k)})}(e=>n.observers.push(e),(e,t,r,o)=>{e.addEventListener(t,r,o),n.handlers.push({element:e,event:t,handler:r,options:o})}),{result:"accordion initialized",destroy:()=>{n.observers.forEach(e=>e.disconnect()),n.observers.length=0,n.handlers.forEach(({element:e,event:t,handler:n,options:r})=>{e.removeEventListener(t,n,r)}),n.handlers.length=0}}}function C(e){const n=t._global.classes.active,r={observers:[],handlers:[],scrollTimeout:null,headings:[]},o=a(e,"content"),s=a(e,"list");return o.forEach(e=>{const t=s[0];if(!t||0===t.children.length)return;const o=t.children[0].cloneNode(!0),a=o.querySelector("a");a&&a.classList.remove(n),t.innerHTML="";const i=e.querySelectorAll("h2");i.forEach(e=>{const t=e.textContent.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"");e.id=t,r.headings.push(e)}),i.forEach((e,n)=>{const r=o.cloneNode(!0),s=r.querySelector("a"),a=e.id;s.href=`#${a}`;const i=document.createElement("strong");i.textContent=`${n+1}. `,s.innerHTML="",s.appendChild(i),s.appendChild(document.createTextNode(e.textContent)),t.appendChild(r)});const l=t.querySelectorAll("a");let c=null;const u=()=>{const e=.75*window.innerHeight;let t=null;for(let n=i.length-1;n>=0;n--){if(i[n].getBoundingClientRect().top<=e){t=i[n].id;break}}if(t!==c&&(c=t,l.forEach(e=>e.classList.remove(n)),c)){const e=Array.from(l).find(e=>e.getAttribute("href")===`#${c}`);e&&e.classList.add(n)}},d=new IntersectionObserver(()=>{u()},{rootMargin:"-75% 0px -25% 0px",threshold:0});i.forEach(e=>d.observe(e)),(e=>{r.observers.push(e)})(d);var p,f,m;p=window,f="scroll",m=()=>{r.scrollTimeout&&clearTimeout(r.scrollTimeout),r.scrollTimeout=setTimeout(u,50)},p.addEventListener(f,m),r.handlers.push({element:p,event:f,handler:m})}),{result:"toc initialized",destroy:()=>{r.headings.forEach(e=>{e.removeAttribute("id")}),r.headings.length=0,r.observers.forEach(e=>e.disconnect()),r.observers.length=0,r.handlers.forEach(({element:e,event:t,handler:n})=>{e.removeEventListener(t,n)}),r.handlers.length=0,r.scrollTimeout&&(clearTimeout(r.scrollTimeout),r.scrollTimeout=null)}}}async function T(){const n=t.default.toc,r={destroyFunctions:[]},l=i(n,"list");if(document.querySelector(l))try{const e=await C(n);e?.destroy&&r.destroyFunctions.push(e.destroy)}catch(u){console.error("[toc] Error initializing heading-links:",u)}const c=i(n["progress-bar"],"wrapper");if(document.querySelector(c))try{const t=await async function(t){const{progressConfig:n,tocConfig:r}=t;if(s())return{result:"progress-bar skipped - prefers-reduced-motion enabled"};const i=o("progress-bar");if(!i)return{result:"progress-bar skipped - GSAP not loaded"};const{gsap:l,ScrollTrigger:c}=i;if(!c)return console.warn("[progress-bar] GSAP ScrollTrigger plugin not loaded"),{result:"progress-bar skipped - ScrollTrigger not loaded"};l.registerPlugin(c);const u={scrollTriggers:[]},d=e(r,"content");if(!d)return{result:"progress-bar skipped - no content element found"};const p=a(n,"wrapper");return 0===p.length?{result:"progress-bar skipped - no wrapper elements found"}:(p.forEach(e=>{l.set(e,{display:"block"}),Array.from(e.querySelectorAll("*")).filter(e=>{const t=n.attributes.elements.element.primary,[r,o]=t.split("="),s=o?.replace(/['"]/g,"");return e.getAttribute(r)===s}).forEach(e=>{l.set(e,{width:"0%"}),l.to(e,{width:"100%",ease:"none",scrollTrigger:{trigger:d,start:"top bottom",end:"bottom 75%",scrub:!0,invalidateOnRefresh:!0,onUpdate:e=>{u.scrollTriggers.includes(e)||u.scrollTriggers.push(e)}}})})}),{result:`progress-bar initialized (${p.length} instances)`,destroy:()=>{u.scrollTriggers.forEach(e=>{e&&"object"==typeof e&&"kill"in e&&"function"==typeof e.kill&&e.kill()}),u.scrollTriggers.length=0}})}({progressConfig:n["progress-bar"],tocConfig:n});t?.destroy&&r.destroyFunctions.push(t.destroy)}catch(u){console.error("[toc] Error initializing progress-bar:",u)}return{result:`toc initialized (${r.destroyFunctions.length} modules active)`,destroy:()=>{r.destroyFunctions.forEach(e=>{try{e()}catch(u){console.error("[toc] Error during cleanup:",u)}}),r.destroyFunctions.length=0}}}function P(t){const n={observers:[],handlers:[],liveRegions:[]};try{a(t,"wrapper").forEach(r=>{try{const o=function(t,n,r){const o=e(r,"list",t);if(!o)return console.warn("[pagination] Missing required element: list"),null;const s=o.parentElement;if(!s)return null;const a={controls:e(r,"controls",t),counter:e(r,"counter",t),dotsWrap:e(r,"dots",t),nextButton:null,prevButton:null};if(!a.controls)return{initialized:!1};const c=e(r,"next",t),u=e(r,"previous",t),d=i(l.clickable,"button"),p=c?.querySelector(d)||c,m=u?.querySelector(d)||u;if(!p||!m)return console.warn("[pagination] Missing required navigation buttons"),null;a.nextButton=p,a.prevButton=m,a.nextButton.setAttribute("aria-label","Go to next page"),a.prevButton.setAttribute("aria-label","Go to previous page"),a.counter&&(a.counter.setAttribute("aria-live","polite"),a.counter.setAttribute("aria-label","Current page"));const h=parseInt(a.controls?.getAttribute(r.attributes.properties.show)||"6")||6,g=parseInt(a.controls?.getAttribute(r.attributes.properties.showMobile)||String(h))||h,v=()=>getComputedStyle(o).getPropertyValue(f.state).trim()===l.cssVars.state.values.active,b=Array.from(o.children),y=b.length;if(!y)return null;const w={totalPages:1,currentIndex:1,currentPage:1,isAnimating:!1,itemsPerPage:h,dotTemplates:{active:null,inactive:null}};let E=[];const A=document.createElement("div");A.className="sr-only",A.setAttribute("aria-live","assertive"),A.setAttribute("aria-atomic","true"),A.style.cssText="position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden;",t.appendChild(A),n.liveRegions.push(A);const x=()=>{a.counter&&(a.counter.textContent=`${w.currentPage} / ${w.totalPages}`)},L=()=>{A.textContent=`Page ${w.currentPage} of ${w.totalPages}`,setTimeout(()=>A.textContent="",1e3)},k=()=>{E.forEach((e,t)=>{const n=e;t===w.currentIndex?n.removeAttribute("inert"):n.setAttribute("inert","")})},S=()=>{const e=E[w.currentIndex];e&&void 0!==e.offsetHeight&&(s.style.height=e.offsetHeight+"px")},C=()=>{if(!a.dotsWrap)return;const e=Array.from(a.dotsWrap.children);if(!e.length)return;const t=e.find(e=>e.classList.contains("is-active")),r=e.find(e=>!e.classList.contains("is-active"));w.dotTemplates.active=t?t.cloneNode(!0):e[0].cloneNode(!0),w.dotTemplates.inactive=r?r.cloneNode(!0):e[0].cloneNode(!0),a.dotsWrap.innerHTML="",a.dotsWrap.setAttribute("role","group"),a.dotsWrap.setAttribute("aria-label","Page navigation");for(let o=1;o<=w.totalPages;o++){const e=(1===o?w.dotTemplates.active:w.dotTemplates.inactive).cloneNode(!0);e.setAttribute("role","button"),e.setAttribute("tabindex","0"),e.setAttribute("aria-label",`Go to page ${o}`),e.setAttribute("aria-current",1===o?"page":"false"),e.setAttribute("data-page",String(o)),1===o?e.classList.add("is-active"):e.classList.remove("is-active");const t=()=>M(o);e.addEventListener("click",t),n.handlers.push({element:e,event:"click",handler:t});const r=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),M(o))};e.addEventListener("keydown",r),n.handlers.push({element:e,event:"keydown",handler:r}),a.dotsWrap.appendChild(e)}},T=()=>{if(!a.dotsWrap)return;Array.from(a.dotsWrap.children).forEach((e,t)=>{t+1===w.currentPage?(e.classList.add("is-active"),e.setAttribute("aria-current","page")):(e.classList.remove("is-active"),e.setAttribute("aria-current","false"))})},P=(e=null)=>{const t=v();if(w.itemsPerPage=e||(t?g:h),w.totalPages=Math.ceil(y/w.itemsPerPage),a.dotsWrap&&(n.handlers=n.handlers.filter(({element:e})=>!a.dotsWrap.contains(e))),Array.from(s.children).forEach(e=>{e!==o&&s.removeChild(e)}),o.innerHTML="",b.forEach(e=>o.appendChild(e)),w.totalPages<=1)return a.controls&&(a.controls.contains(document.activeElement)&&document.activeElement&&document.activeElement.blur(),a.controls.style.display="none",a.controls.setAttribute("aria-hidden","true")),a.dotsWrap&&(a.dotsWrap.style.display="none",a.dotsWrap.setAttribute("aria-hidden","true")),Object.assign(w,{totalPages:1,currentIndex:1,currentPage:1,isAnimating:!1}),s.style.cssText=`transform: translateX(0%); height: ${o.offsetHeight}px;`,E=[o],1;a.controls&&(a.controls.style.display="",a.controls.removeAttribute("aria-hidden")),a.dotsWrap&&(a.dotsWrap.style.display="",a.dotsWrap.removeAttribute("aria-hidden"));const r=Array.from({length:w.totalPages},(e,t)=>{const n=o.cloneNode(!1),r=t*w.itemsPerPage,s=Math.min(r+w.itemsPerPage,y);return b.slice(r,s).forEach(e=>n.appendChild(e.cloneNode(!0))),n});return s.insertBefore(r[r.length-1].cloneNode(!0),o),r.slice(1).forEach(e=>s.appendChild(e)),s.appendChild(r[0].cloneNode(!0)),o.innerHTML="",Array.from(r[0].children).forEach(e=>o.appendChild(e)),Object.assign(w,{currentIndex:1,currentPage:1,isAnimating:!1}),E=Array.from(s.children),s.style.transition="none",s.style.transform="translateX(-100%)",s.offsetHeight,s.style.transition="",x(),S(),k(),C(),w.totalPages};let q=v();const D=new ResizeObserver(()=>{if(w.isAnimating)return;const e=v();e!==q?(q=e,P()):S()});D.observe(s),n.observers.push(D),P();const M=e=>{if(w.isAnimating||w.totalPages<=1||e===w.currentPage)return;w.isAnimating=!0,w.currentIndex=e,w.currentPage=e,x(),L(),S(),T(),v()&&a.controls&&setTimeout(()=>{const e=80,t=a.controls.getBoundingClientRect().bottom+window.pageYOffset-window.innerHeight+e;window.scrollTo({top:t,behavior:"smooth"})},50),s.style.transform=`translateX(${100*-w.currentIndex}%)`;let t=null;const n=()=>{clearTimeout(t),s.removeEventListener("transitionend",n),x(),L(),S(),k(),T(),w.isAnimating=!1};t=setTimeout(n,1e3),s.addEventListener("transitionend",n)},I=e=>{if(w.isAnimating||w.totalPages<=1)return;w.isAnimating=!0,w.currentIndex+=e,w.currentPage=w.currentIndex>w.totalPages?1:w.currentIndex<1?w.totalPages:w.currentIndex,x(),L(),S(),T(),v()&&a.controls&&setTimeout(()=>{const e=80,t=a.controls.getBoundingClientRect().bottom+window.pageYOffset-window.innerHeight+e;window.scrollTo({top:t,behavior:"smooth"})},50),s.style.transform=`translateX(${100*-w.currentIndex}%)`;let t=null;const n=()=>{clearTimeout(t),s.removeEventListener("transitionend",n),w.currentIndex>w.totalPages?(w.currentIndex=1,w.currentPage=1,s.style.transition="none",s.style.transform="translateX(-100%)",s.offsetHeight,s.style.transition=""):w.currentIndex<1&&(w.currentIndex=w.totalPages,w.currentPage=w.totalPages,s.style.transition="none",s.style.transform=`translateX(${100*-w.totalPages}%)`,s.offsetHeight,s.style.transition=""),x(),L(),S(),k(),T(),w.isAnimating=!1};t=setTimeout(n,1e3),s.addEventListener("transitionend",n)},$=()=>I(1),F=()=>I(-1);return a.nextButton.addEventListener("click",$),a.prevButton.addEventListener("click",F),n.handlers.push({element:a.nextButton,event:"click",handler:$},{element:a.prevButton,event:"click",handler:F}),{initialized:!0}}(r,n,t);o||console.warn("[pagination] Failed to initialize container",r)}catch(o){console.error("[pagination] Error initializing container:",o,r)}})}catch(r){console.error("[pagination] Critical error during initialization:",r)}return{result:"pagination initialized",destroy:()=>{try{n.liveRegions.forEach(e=>{try{e.parentNode&&e.parentNode.removeChild(e)}catch(r){console.error("[pagination] Error removing live region:",r)}}),n.liveRegions.length=0,n.observers.forEach(e=>{try{e.disconnect()}catch(r){console.error("[pagination] Error disconnecting observer:",r)}}),n.observers.length=0,n.handlers.forEach(({element:e,event:t,handler:n})=>{try{e.removeEventListener(t,n)}catch(r){console.error("[pagination] Error removing event listener:",r)}}),n.handlers.length=0}catch(r){console.error("[pagination] Critical error during cleanup:",r)}}}}async function q(t){const n=o("comparison");if(!n)return{result:"comparison skipped - GSAP not loaded"};const{gsap:r,Draggable:s}=n;m("comparison",["Draggable"],"error");const c=a(t,"wrapper"),u={draggables:[],handlers:[],observers:[]},d=i(t,"template-name"),p=i(t,"template-description"),h=i(t,"template-before-image"),g=i(t,"template-after-image");function v(e,t){e.style.setProperty(f.clip,`${t}%`)}function b(n,r){const o=n.templateItems[r];if(!o)return;const s=o.querySelector(d);n.nameElement&&s&&(n.nameElement.textContent=s.textContent);const a=o.querySelector(p);n.descElement&&a&&(n.descElement.textContent=a.textContent);const i=o.querySelector(h);n.beforeImage&&i&&(n.beforeImage.src=i.src,n.beforeImage.alt=i.alt||"");const c=o.querySelector(g);n.afterImage&&c&&(n.afterImage.src=c.src,n.afterImage.alt=c.alt||"",y(n)),n.currentIndex=r,function(n,r){const o=e(t,"pagination",n);if(!o)return;const s=l.classes.active;Array.from(o.children).forEach((e,t)=>{t===r?e.classList.add(s):e.classList.remove(s)})}(n.wrapper,r)}function y(e){const t=e.slider,n=e.wrapper;switch(e.mode){case"before":n.style.setProperty(f.clip,"100%"),t.style.display="none";break;case"after":n.style.setProperty(f.clip,"0%"),t.style.display="none";break;case"split":v(n,e.sliderPosition),t.style.display="flex"}}function w(e,t){const n=e.currentIndex+t,r=e.templateItems.length-1;let o;o=n>r?0:n<0?r:n,b(e,o)}return c.forEach(n=>{const o=e(t,"template-list",n);if(!o)return void console.warn("[comparison] No template list found in wrapper");const a=i(t,"template-item"),c=Array.from(o.querySelectorAll(a));if(0===c.length)return void console.warn("[comparison] No template items found");n.setAttribute("aria-live","polite"),n.setAttribute("aria-label","Before and after image comparison");const d=e(t,"image-wrapper",n),p=e(t,"slider",n),f=e(t,"before-image",n),m=e(t,"after-image",n),h=e(t,"name",n),g=e(t,"description",n);if(!d||!p||!m){const e=[];return d||e.push('image-wrapper (data-hs-comparison="image-wrapper")'),p||e.push('slider (data-hs-comparison="slider")'),m||e.push('after-image (data-hs-comparison-image="after")'),void console.warn(`[comparison] Missing required elements: ${e.join(", ")}`)}const E={wrapper:n,templateItems:c,currentIndex:0,mode:"split",sliderPosition:50,slider:p,beforeImage:f?.querySelector("img"),afterImage:m?.querySelector("img"),nameElement:h,descElement:g,draggable:null};if(b(E,0),v(n,50),s){const e=s.create(p,{type:"x",bounds:d,onDrag:function(){const e=d.getBoundingClientRect(),t=p.getBoundingClientRect().left-e.left,r=Math.max(0,Math.min(100,t/e.width*100));v(n,r),E.sliderPosition=r}});u.draggables.push(e),E.draggable=e[0];const t=new ResizeObserver(()=>{E.draggable&&E.draggable.update()});t.observe(d),u.observers=u.observers||[],u.observers.push(t);[E.beforeImage,E.afterImage].filter(Boolean).forEach(e=>{e instanceof HTMLImageElement&&!e.complete&&e.addEventListener("load",()=>{E.draggable&&E.draggable.update()},{once:!0})});const o=e=>{if("split"!==E.mode)return;const t=d.getBoundingClientRect(),o=e.clientX-t.left,s=Math.max(0,Math.min(100,o/t.width*100)),a=o-t.width/2;E.draggable&&(r.set(p,{x:a}),E.draggable.update()),v(n,s),E.sliderPosition=s};d.addEventListener("click",o),u.handlers.push({element:d,event:"click",handler:o})}n.querySelectorAll(`[${t.attributes.properties.modeType}]`).forEach(e=>{const n=e.getAttribute(t.attributes.properties.modeType),r=i(l.clickable,"button"),o=e.querySelector(r)||e;n===E.mode&&e.classList.add(l.classes.active);const s=e=>{e.preventDefault(),function(e,n){const r=e.wrapper.querySelectorAll(`[${t.attributes.properties.modeType}]`),o=l.classes.active;r.forEach(e=>{e.getAttribute(t.attributes.properties.modeType)===n?e.classList.add(o):e.classList.remove(o)}),e.mode=n,y(e)}(E,n)};o.addEventListener("click",s),u.handlers.push({element:o,event:"click",handler:s})}),function(e,n){const r=n.querySelector(`[${t.attributes.properties.navType}="previous"]`),o=n.querySelector(`[${t.attributes.properties.navType}="next"]`);if(r){const t=i(l.clickable,"button"),n=r.querySelector(t)||r;n.setAttribute("aria-label","Previous image");const o=t=>{t.preventDefault(),w(e,-1)};n.addEventListener("click",o),u.handlers.push({element:n,event:"click",handler:o})}if(o){const t=i(l.clickable,"button"),n=o.querySelector(t)||o;n.setAttribute("aria-label","Next image");const r=t=>{t.preventDefault(),w(e,1)};n.addEventListener("click",r),u.handlers.push({element:n,event:"click",handler:r})}}(E,n);const A=e(t,"pagination",n);A&&c.length>1&&function(e,t){const n=t.children[0];if(!n)return;const r=l.classes.active;t.innerHTML="",e.templateItems.forEach((o,s)=>{const a=n.cloneNode(!0);a.classList.remove(r),0===s&&a.classList.add(r);const i=()=>{b(e,s)};a.addEventListener("click",i),u.handlers.push({element:a,event:"click",handler:i}),t.appendChild(a)})}(E,A),function(e){const t=t=>{"ArrowLeft"===t.key||"ArrowUp"===t.key?(t.preventDefault(),w(e,-1)):"ArrowRight"!==t.key&&"ArrowDown"!==t.key||(t.preventDefault(),w(e,1))};e.wrapper.addEventListener("keydown",t),e.wrapper.setAttribute("tabindex","0"),u.handlers.push({element:e.wrapper,event:"keydown",handler:t})}(E)}),{result:`comparison initialized (${c.length} instances)`,destroy:()=>{u.draggables.forEach(e=>{e&&e[0]&&e[0].kill&&e[0].kill()}),u.handlers.forEach(({element:e,event:t,handler:n})=>{e.removeEventListener(t,n)}),u.observers.forEach(e=>e.disconnect()),u.draggables.length=0,u.handlers.length=0,u.observers.length=0}}}function D(t){const n={handlers:[],timers:[],animationFrames:[],observers:[]},r=(e,t,r,o)=>{e.addEventListener(t,r,o),n.handlers.push({element:e,event:t,handler:r,options:o})},c=e=>n.animationFrames.push(e),u=()=>`${l.cssVars.prefix}${t.cssVars?.progress||"progress"}`,d=(e,t)=>e.style.setProperty(u(),String(t));function p(a){const p=e(t,"links",a),f=e(t,"list",a);if(!p||!f)return;const m=Array.from(p.children),h=Array.from(f.children),g=i(l.clickable,"button"),v=m.map(e=>e.querySelector(g)).filter(e=>null!==e);if(0===v.length)return;const b=a.getAttribute(t.attributes.properties?.autoplay||"data-hs-tab-autoplay"),y=a.getAttribute(t.attributes.properties?.duration||"data-hs-tab-duration"),w=a.getAttribute(t.attributes.properties?.hover||"data-hs-tab-hover"),E=a.getAttribute(t.attributes.properties?.animation||"data-hs-tab-animation"),A=a.getAttribute(t.attributes.properties?.animationDuration||"data-hs-tab-animation-duration"),x="true"===b,L=y?parseFloat(y):6,k="pause"===w,S=E,C=A?parseFloat(A):.3,T=`${"hs-tab"}-${Math.random().toString(36).substring(2,9)}`;h.forEach((e,t)=>{const n=e.id||`${T}-panel-${t}`,r=`${T}-tab-${t}`;e.id=n,v[t]&&(v[t].id=r,v[t].setAttribute("aria-controls",n))});let P=0,q=null,D=null,M=null,I=!1,$=!1,F=!1;async function N(e,t=!1){if($)return;if(e<0||e>=h.length)return;if(e===P&&!t)return;$=!0;const n=P;if(P=e,v.forEach((t,n)=>{t.setAttribute("aria-selected",n===e?"true":"false"),t.setAttribute("tabindex",n===e?"0":"-1")}),m.forEach((t,n)=>{t.classList.toggle(l.classes.active,n===e)}),x)if(I){const t=m[n]?parseFloat(getComputedStyle(m[n]).getPropertyValue(u())||"0"):0;m.forEach((n,r)=>d(n,r===e?t:0))}else O();const r=h[n],a=h[e];"fade"!==S||t?"clip"!==S||t?h.forEach((t,n)=>{n===e?("fade"===S||"clip"===S?(t.style.position="",t.style.display="block","fade"===S?t.style.opacity="1":t.style.clipPath=""):t.style.display="block",t.inert=!1,t.style.pointerEvents="",t.classList.add(l.classes.active)):("fade"===S||"clip"===S?(t.style.display="none","fade"===S?t.style.opacity="0":t.style.clipPath=""):t.style.display="none",t.inert=!0,t.style.pointerEvents="none",t.classList.remove(l.classes.active))}):await async function(e,t,n){s()&&(n=0);const r=o("tabs",!1);if(!r)return e.style.display="none",e.style.position="",e.style.clipPath="",e.inert=!0,e.style.pointerEvents="none",t.style.display="block",t.style.position="",t.style.clipPath="",t.inert=!1,void(t.style.pointerEvents="");const{gsap:a}=r;return new Promise(r=>{const o=a.timeline({onComplete:()=>{e.style.display="none",e.style.position="",e.style.clipPath="",e.inert=!0,e.style.pointerEvents="none",t.style.position="",t.style.clipPath="",t.inert=!1,t.style.pointerEvents="",r()},defaults:{duration:n,ease:"power1.inOut"}});o.set(e,{position:"absolute",top:0,left:0,width:"100%",clipPath:"inset(0% 0% 0% 0%)"}),o.set(t,{display:"block",position:"relative",clipPath:"inset(0% 0% 100% 0%)"}),o.to(e,{clipPath:"inset(100% 0% 0% 0%)"}),o.to(t,{clipPath:"inset(0% 0% 0% 0%)"},"<40%")})}(r,a,C):await async function(e,t,n){s()&&(n=0);const r=o("tabs",!1);if(!r)return e.style.display="none",e.style.position="",e.inert=!0,e.style.pointerEvents="none",t.style.display="block",t.style.position="",t.inert=!1,void(t.style.pointerEvents="");const{gsap:a}=r;return new Promise(r=>{const o=a.timeline({onComplete:()=>{e.style.display="none",e.style.position="",e.style.opacity="",e.inert=!0,e.style.pointerEvents="none",t.style.position="",t.style.opacity="",t.inert=!1,t.style.pointerEvents="",r()},defaults:{duration:n,ease:"power1.out"}});o.set(e,{position:"absolute",top:0,left:0,width:"100%"}),o.set(t,{display:"block",position:"relative",opacity:0}),o.to(e,{opacity:0}),o.to(t,{opacity:1},"<50%")})}(r,a,C),$=!1}function H(e){if(x){M||(M=e);const t=Math.min((e-M)/(1e3*L),1);m.forEach((e,n)=>d(e,n===P?t:0)),t<1&&!I&&(D=requestAnimationFrame(H),D&&c(D))}else m.forEach((e,t)=>d(e,t===P?1:0))}function O(){if(z(),!x)return H(0);if(I||!F)return;const e=m[P]?parseFloat(getComputedStyle(m[P]).getPropertyValue(u())||"0"):0,t=e*L*1e3,r=Math.max(0,1e3*L-t);M=null;const o=e,s=performance.now(),a=e=>{const t=Math.min(o+(e-s)/(1e3*L),1);m.forEach((e,n)=>d(e,n===P?t:0)),t<1&&!I&&(D=requestAnimationFrame(a),D&&c(D))};var i;D=requestAnimationFrame(a),D&&c(D),q=window.setTimeout(()=>N((P+1)%h.length),r),i=q,n.timers.push(i)}function z(){null!==q&&(clearTimeout(q),q=null),null!==D&&(cancelAnimationFrame(D),D=null),M=null}const W=()=>{I=!0,z()},B=()=>{I=!1,O()};v.forEach((e,t)=>{r(e,"click",e=>{e.preventDefault(),N(t)})});const R=e=>{const t=v.indexOf(e.target);if(-1===t)return;let n=t;switch(e.key){case"ArrowLeft":case"ArrowUp":e.preventDefault(),n=0===t?v.length-1:t-1;break;case"ArrowRight":case"ArrowDown":e.preventDefault(),n=t===v.length-1?0:t+1;break;case"Home":e.preventDefault(),n=0;break;case"End":e.preventDefault(),n=v.length-1;break;default:return}$||(N(n),v[n].focus())};v.forEach(e=>r(e,"keydown",R)),k&&x&&(r(a,"mouseenter",W),r(a,"mouseleave",B));let X=!1;r(document,"keydown",()=>X=!0),r(document,"mousedown",()=>X=!1),x&&(r(a,"focusin",()=>{X&&(W(),Y())}),r(a,"focusout",()=>{X&&I&&(B(),Y())}));const V=`[${t.attributes.properties?.controls||"data-hs-tab-controls"}]`,U=a.querySelectorAll(V);let j=null,G=null;U.forEach(e=>{const n=e.getAttribute(t.attributes.properties?.controls||"data-hs-tab-controls"),o=e.querySelector(g);if(o)if("previous"===n)o.setAttribute("aria-label","Previous tab"),r(o,"click",e=>{e.preventDefault(),N(0===P?h.length-1:P-1)});else if("next"===n)o.setAttribute("aria-label","Next tab"),r(o,"click",e=>{e.preventDefault(),N((P+1)%h.length)});else if("toggle"===n){if(!x)return void(e.style.display="none");j=e,G=o,G.setAttribute("aria-label",I?"Play":"Pause"),j.classList.toggle(l.classes.active,!I),r(o,"click",e=>{e.preventDefault(),I?B():W(),Y()})}});const Y=()=>{j&&G&&(j.classList.toggle(l.classes.active,!I),G.setAttribute("aria-label",I?"Play":"Pause"))};if(N(0,!0),x){const e=new IntersectionObserver(e=>{e.forEach(e=>{F=e.isIntersecting,e.isIntersecting&&!I?O():z()})},{threshold:.1});e.observe(a),K=e,n.observers.push(K)}var K}const f=a(t,"wrapper");return f.forEach(e=>{p(e)}),{result:`tabs initialized (${f.length} systems)`,destroy:()=>{n.timers.forEach(e=>clearTimeout(e)),n.timers.length=0,n.animationFrames.forEach(e=>cancelAnimationFrame(e)),n.animationFrames.length=0,n.observers.forEach(e=>e.disconnect()),n.observers.length=0,n.handlers.forEach(({element:e,event:t,handler:n,options:r})=>{e.removeEventListener(t,n,r)}),n.handlers.length=0}}}async function M(e){const t=l.classes.active,n={handlers:[],modals:[]},r=(e,t,r,o)=>{e.addEventListener(t,r,o),n.handlers.push({element:e,event:t,handler:r,options:o})},o=a(e,"wrapper");if(0===o.length)return{result:"modal: no modals found",destroy:()=>{}};o.forEach(e=>{const t=e.getAttribute("data-hs-modal-id");if(!t)return void console.warn("[modal] Wrapper missing data-hs-modal-id:",e);e.setAttribute("role","dialog"),e.setAttribute("aria-modal","true"),e.setAttribute("aria-hidden","true");const r=e.querySelector("h1, h2, h3, h4, h5, h6");r&&(r.id||(r.id=`modal-${t}-title`),e.setAttribute("aria-labelledby",r.id));const o=Array.from(e.querySelectorAll('[data-hs-modal="close"]'));o.forEach(e=>{e.setAttribute("aria-label","Close modal")});const s={wrapper:e,modalId:t,closeButtons:o,triggerButton:null,focusableElements:[]};n.modals.push(s)});const s=(e,r)=>{const o=n.modals.find(t=>t.modalId===e);if(!o)return void console.warn(`[modal] Modal with id "${e}" not found`);const{wrapper:s}=o;r&&(o.triggerButton=r),s.classList.add(t),s.setAttribute("aria-hidden","false"),d(),o.focusableElements=(e=>{const t=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");return Array.from(e.querySelectorAll(t))})(s),o.closeButtons.length>0?o.closeButtons[0].focus():o.focusableElements.length>0&&o.focusableElements[0].focus()},i=e=>{const{wrapper:n,triggerButton:r}=e;c(n),n.classList.remove(t),n.setAttribute("aria-hidden","true"),p(),r&&(r.focus(),e.triggerButton=null),e.focusableElements=[]},c=e=>{e.querySelectorAll("video").forEach(e=>{e.pause(),e.currentTime=0});e.querySelectorAll("audio").forEach(e=>{e.pause(),e.currentTime=0});e.querySelectorAll("iframe").forEach(e=>{const t=e.src;e.src="",e.src=t})};document.querySelectorAll("[data-hs-modal-open]").forEach(e=>{const t=e.getAttribute("data-hs-modal-open");if(!t)return;e.setAttribute("aria-haspopup","dialog"),e.setAttribute("aria-controls",`modal-${t}`);r(e,"click",n=>{n.preventDefault(),s(t,e)})}),n.modals.forEach(e=>{e.closeButtons.forEach(t=>{r(t,"click",()=>{i(e)})});r(e.wrapper,"click",t=>{t.target===e.wrapper&&i(e)})});r(document,"keydown",e=>{if("Escape"===e.key){const e=n.modals.slice().reverse().find(e=>e.wrapper.classList.contains(t));e&&i(e)}});return r(document,"keydown",e=>{const r=n.modals.find(e=>e.wrapper.classList.contains(t));r&&((e,t)=>{if("Tab"!==e.key)return;const{focusableElements:n}=t;if(0===n.length)return;const r=n[0],o=n[n.length-1];e.shiftKey?document.activeElement===r&&(e.preventDefault(),o.focus()):document.activeElement===o&&(e.preventDefault(),r.focus())})(e,r)}),{result:`modal initialized (${n.modals.length} modals)`,destroy:()=>{n.handlers.forEach(({element:e,event:t,handler:n,options:r})=>{e.removeEventListener(t,n,r)}),n.handlers.length=0,n.modals.forEach(e=>{e.wrapper.classList.contains(t)&&(e.wrapper.classList.remove(t),e.wrapper.setAttribute("aria-hidden","true"),p())}),n.modals.length=0}}}function I(n){const r={handlers:[],domContentLoadedHandler:null},o=(e,t,n)=>{e.addEventListener(t,n),r.handlers.push({element:e,event:t,handler:n})};function s(){a(n,"wrapper").forEach(r=>{const s=r;s.dataset.hsFormRangeInit||(s.dataset.hsFormRangeInit="true",function(r,o){const s=r.querySelector("input[type='range']");if(!s)return void console.warn('[range] Missing <input type="range"> element in wrapper',r);const a=e(n,"output",r),i=()=>{const e=s.min?+s.min:0,o=s.max?+s.max:100,i=+s.value||e,l=(i-e)/(o-e);r.style.setProperty(`${t._global.cssVars.prefix}${n.cssVars?.progress||"progress"}`,String(l)),a&&(a.textContent=String(i))};o(s,"input",i),i()}(s,o))})}return"loading"===document.readyState?(r.domContentLoadedHandler=s,document.addEventListener("DOMContentLoaded",r.domContentLoadedHandler)):s(),{result:"range initialized",destroy:()=>{r.domContentLoadedHandler&&(document.removeEventListener("DOMContentLoaded",r.domContentLoadedHandler),r.domContentLoadedHandler=null),r.handlers.forEach(({element:e,event:t,handler:n})=>{e.removeEventListener(t,n)}),r.handlers.length=0;a(n,"wrapper").forEach(e=>{delete e.dataset.hsFormRangeInit})}}}const F=[{name:"Alabama",value:"AL"},{name:"Alaska",value:"AK"},{name:"Arizona",value:"AZ"},{name:"Arkansas",value:"AR"},{name:"California",value:"CA"},{name:"Colorado",value:"CO"},{name:"Connecticut",value:"CT"},{name:"Delaware",value:"DE"},{name:"Florida",value:"FL"},{name:"Georgia",value:"GA"},{name:"Hawaii",value:"HI"},{name:"Idaho",value:"ID"},{name:"Illinois",value:"IL"},{name:"Indiana",value:"IN"},{name:"Iowa",value:"IA"},{name:"Kansas",value:"KS"},{name:"Kentucky",value:"KY"},{name:"Louisiana",value:"LA"},{name:"Maine",value:"ME"},{name:"Maryland",value:"MD"},{name:"Massachusetts",value:"MA"},{name:"Michigan",value:"MI"},{name:"Minnesota",value:"MN"},{name:"Mississippi",value:"MS"},{name:"Missouri",value:"MO"},{name:"Montana",value:"MT"},{name:"Nebraska",value:"NE"},{name:"Nevada",value:"NV"},{name:"New Hampshire",value:"NH"},{name:"New Jersey",value:"NJ"},{name:"New Mexico",value:"NM"},{name:"New York",value:"NY"},{name:"North Carolina",value:"NC"},{name:"North Dakota",value:"ND"},{name:"Ohio",value:"OH"},{name:"Oklahoma",value:"OK"},{name:"Oregon",value:"OR"},{name:"Pennsylvania",value:"PA"},{name:"Rhode Island",value:"RI"},{name:"South Carolina",value:"SC"},{name:"South Dakota",value:"SD"},{name:"Tennessee",value:"TN"},{name:"Texas",value:"TX"},{name:"Utah",value:"UT"},{name:"Vermont",value:"VT"},{name:"Virginia",value:"VA"},{name:"Washington",value:"WA"},{name:"West Virginia",value:"WV"},{name:"Wisconsin",value:"WI"},{name:"Wyoming",value:"WY"}];function N(t){const n={observers:[],handlers:[],timeouts:[],domContentLoadedHandler:null},r=e=>n.observers.push(e),o=(e,t,r,o)=>{e.addEventListener(t,r,o),n.handlers.push({element:e,event:t,handler:r,options:o})},s=e=>n.timeouts.push(e);function i(){document.querySelectorAll("select > div").forEach(e=>{const t=e.parentElement;for(;e.firstChild;)t.appendChild(e.firstChild);e.remove()});a(t,"wrapper").forEach(a=>{!function(r,o,s,a){const i=r.querySelector("select");if(!i)return void console.warn("[select] Missing <select> element in custom select wrapper",r);i.setAttribute("aria-hidden","true"),i.setAttribute("tabindex","-1");const l=i.getAttribute("name")||"custom-select",f=e(t,"list",r),m=e(t,"button",r);if(!f||!m)return void console.warn("[select] Missing required elements (list or button) in custom select wrapper",r);function h(){i.disabled?(m.disabled=!0,m.setAttribute("aria-disabled","true")):(m.disabled=!1,m.removeAttribute("aria-disabled"))}h();const g=f.firstElementChild;if(!g)return void console.warn("[select] Missing option template in custom select list",r);const v=g.cloneNode(!0);g.remove();i.querySelectorAll("option").forEach((e,t)=>{const n=v.cloneNode(!0),r=n.querySelector("span");if(r&&(r.textContent=e.textContent),n.setAttribute("data-value",e.value),n.setAttribute("role","option"),n.setAttribute("id",`${l}-option-${t}`),n.setAttribute("tabindex","-1"),e.selected){n.setAttribute("aria-selected","true");const t=m.querySelector("span")||m;"SPAN"===t.tagName&&(t.textContent=e.textContent),e.value?m.classList.add("is-filled"):m.classList.remove("is-filled")}else n.setAttribute("aria-selected","false");f.appendChild(n)}),f.setAttribute("role","listbox"),f.setAttribute("id",`${l}-listbox`),f.setAttribute("tabindex","-1"),f.setAttribute("aria-hidden","true"),f.inert=!0,m.setAttribute("role","combobox"),m.setAttribute("aria-haspopup","listbox"),m.setAttribute("aria-controls",`${l}-listbox`),m.setAttribute("aria-expanded","false"),m.setAttribute("id",`${l}-button`);const b=r.querySelector("label")||document.querySelector(`label[for="${i.id}"]`);if(b){const e=b.id||`${l}-label`;b.id=e,i.id||(i.id=`${l}-select`),b.setAttribute("for",i.id),m.setAttribute("aria-labelledby",e)}const y=r.querySelector('[data-hs-height="element"]'),w=y||null;let E="",A=null;function x(){return r.classList.contains("is-active")}function L(){const e=x(),t="true"===m.getAttribute("aria-expanded");if(t&&!e&&f.contains(document.activeElement)&&m.focus(),m.setAttribute("aria-expanded",e?"true":"false"),f.setAttribute("aria-hidden",e?"false":"true"),f.inert=!e,e){f.querySelectorAll('[role="option"]').forEach(e=>{e.setAttribute("tabindex","0")}),t||d()}else{m.removeAttribute("aria-activedescendant");f.querySelectorAll('[role="option"]').forEach(e=>{e.setAttribute("tabindex","-1")}),t&&p()}w&&u(w,e,{duration:300,ease:"power2.inOut"})}w&&c(w,x());function k(e){const t=f.querySelectorAll('[role="option"]');e<0||e>=t.length||(t.forEach(e=>{e.classList.remove("focused"),e.setAttribute("tabindex","-1")}),t[e].classList.add("focused"),t[e].setAttribute("tabindex","0"),t[e].focus(),m.setAttribute("aria-activedescendant",t[e].id))}function S(e){if(1!==e.length)return!1;if(null!==A){clearTimeout(A);const e=n.timeouts.indexOf(A);e>-1&&n.timeouts.splice(e,1)}const t=Array.from(f.querySelectorAll('[role="option"]'));if(0===t.length)return!1;E+=e.toLowerCase();const o=t.findIndex(e=>e.classList.contains("focused"));if(1===E.length||E.split("").every(e=>e===E[0])){const e=E[0];let n=o+1;for(let o=0;o<t.length;o++){const s=(n+o)%t.length;if((t[s].querySelector("span")?.textContent||t[s].textContent).toLowerCase().startsWith(e))return k(s),x()||r.classList.add("is-active"),A=setTimeout(C,500),a(A),!0}}else{const e=t.findIndex(e=>(e.querySelector("span")?.textContent||e.textContent).toLowerCase().startsWith(E));if(-1!==e)return k(e),x()||r.classList.add("is-active"),A=setTimeout(C,500),a(A),!0}return A=setTimeout(C,500),a(A),!1}function C(){E="",A=null}function T(e){const t=e.getAttribute("data-value")||"",n=e.querySelector("span")?.textContent||e.textContent;i.value=t,i.dispatchEvent(new Event("change",{bubbles:!0}));const o=m.querySelector("span")||m;"SPAN"===o.tagName&&(o.textContent=n),t?m.classList.add("is-filled"):m.classList.remove("is-filled"),f.querySelectorAll('[role="option"]').forEach(e=>{e.setAttribute("aria-selected","false")}),e.setAttribute("aria-selected","true"),r.classList.remove("is-active")}L();const P=e=>{e.preventDefault(),r.classList.toggle("is-active")};o(m,"click",P);const q=e=>{switch(e.key){case"Enter":e.preventDefault();const t=m.closest("form");if(t){const e=t.querySelector('button[type="submit"], input[type="submit"]')||t.querySelector("button:not([type])");e&&e.click()}break;case" ":e.preventDefault(),r.classList.toggle("is-active");break;case"ArrowDown":e.preventDefault(),x()?k(0):(r.classList.add("is-active"),requestAnimationFrame(()=>{k(0)}));break;case"ArrowUp":if(e.preventDefault(),x()){k(f.querySelectorAll('[role="option"]').length-1)}else r.classList.add("is-active"),requestAnimationFrame(()=>{k(0)});break;case"Escape":x()&&(e.preventDefault(),r.classList.remove("is-active"));break;case"Home":e.preventDefault(),x()||r.classList.add("is-active"),k(0);break;case"End":e.preventDefault(),x()||r.classList.add("is-active");k(f.querySelectorAll('[role="option"]').length-1);break;default:S(e.key)&&e.preventDefault()}};o(m,"keydown",q);const D=e=>{const t=e.target.closest('[role="option"]');if(!t)return;const n=Array.from(f.querySelectorAll('[role="option"]')),o=n.indexOf(t);switch(e.key){case"ArrowDown":e.preventDefault(),o<n.length-1&&k(o+1);break;case"ArrowUp":e.preventDefault(),o>0&&k(o-1);break;case"Enter":e.preventDefault(),T(t);break;case"Escape":e.preventDefault(),r.classList.remove("is-active"),m.focus();break;case"Home":e.preventDefault(),k(0);break;case"End":e.preventDefault(),k(n.length-1);break;default:S(e.key)&&e.preventDefault()}};o(f,"keydown",D);o(f,"click",e=>{const t=e.target.closest('[role="option"]');t&&T(t)});const M=e=>{e.relatedTarget&&r.contains(e.relatedTarget)||!r.classList.contains("is-active")||r.classList.remove("is-active")};o(f,"focusout",M);const I=e=>{r.classList.contains("is-active")&&!r.contains(e.target)&&r.classList.remove("is-active")};o(document,"click",I);const $=new MutationObserver(()=>{L()});$.observe(r,{attributes:!0,attributeFilter:["class"]}),s($);const F=new MutationObserver(()=>{h()});F.observe(i,{attributes:!0,attributeFilter:["disabled"]}),s(F);const N=()=>{const e=i.options[i.selectedIndex];if(e){const t=f.querySelectorAll('[role="option"]'),n=Array.from(t).find(t=>t.getAttribute("data-value")===e.value);if(n){const r=n.querySelector("span")?.textContent||n.textContent,o=m.querySelector("span")||m;"SPAN"===o.tagName&&(o.textContent=r),e.value?m.classList.add("is-filled"):m.classList.remove("is-filled"),t.forEach(e=>{e.setAttribute("aria-selected","false")}),n.setAttribute("aria-selected","true")}}};o(i,"change",N),o(i,"input",N);const H=i.closest("form");if(H){o(H,"reset",()=>{setTimeout(()=>{N()},0)})}}(a,o,r,s)})}return"loading"===document.readyState?(n.domContentLoadedHandler=i,document.addEventListener("DOMContentLoaded",n.domContentLoadedHandler)):i(),window.initCustomSelects=i,{result:"select initialized",destroy:()=>{n.domContentLoadedHandler&&(document.removeEventListener("DOMContentLoaded",n.domContentLoadedHandler),n.domContentLoadedHandler=null),n.observers.forEach(e=>e.disconnect()),n.observers.length=0,n.timeouts.forEach(e=>clearTimeout(e)),n.timeouts.length=0,n.handlers.forEach(({element:e,event:t,handler:n,options:r})=>{e.removeEventListener(t,n,r)}),n.handlers.length=0,window.initCustomSelects&&delete window.initCustomSelects}}}async function H(e){const t={destroyFunctions:[]};try{const n=function(e){const t=a(e,"states");return t.forEach(e=>{const t=e;if("SELECT"!==t.tagName)return void console.warn('[select-states] data-hs-form-select="states" must be on a <select> element',t);const n=t.querySelectorAll("option");if(1!==n.length)return void console.warn("[select-states] Select must have exactly 1 default template option (placeholder). Found:",n.length,t);const r=n[0];if(""!==r.value)return void console.warn("[select-states] Template option must have empty value for placeholder. Found value:",r.value,t);const o=r.textContent;t.innerHTML="";const s=document.createElement("option");s.value="",s.textContent=o,t.appendChild(s),F.forEach(e=>{const n=document.createElement("option");n.value=e.value,n.textContent=e.name,t.appendChild(n)})}),{result:`states initialized on ${t.length} select${1!==t.length?"s":""}`,destroy:()=>{}}}(e.states);n?.destroy&&t.destroyFunctions.push(n.destroy);const r=N(e["custom-select"]);return r?.destroy&&t.destroyFunctions.push(r.destroy),{result:"select initialized",destroy:()=>{t.destroyFunctions.forEach(e=>{try{e()}catch(t){console.error("[select] Error during cleanup:",t)}}),t.destroyFunctions.length=0}}}catch(n){throw console.error("[select] Initialization failed:",n),t.destroyFunctions.forEach(e=>{try{e()}catch(t){console.error("[select] Error during error cleanup:",t)}}),n}}const O="hsfx-form-persist";function z(e){const t={handlers:[],debounceTimers:new Map},n=i(e,"field"),r=document.querySelectorAll(n);if(0===r.length)return{result:"persist skipped - no fields found",destroy:()=>{}};const o=()=>{try{const e=localStorage.getItem(O);if(e){return JSON.parse(e)}}catch{}return{timestamp:Date.now().toString()}},s=e=>{e.timestamp=Date.now().toString(),localStorage.setItem(O,JSON.stringify(e))},a=e=>{if(e instanceof HTMLInputElement){if("checkbox"===e.type)return e.checked?"true":"false";if("radio"===e.type){const t=e.name;if(t){const e=document.querySelector(`input[type="radio"][name="${t}"]:checked`);return e?.value||""}return e.checked?e.value:""}return e.value}return e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement?e.value:""},l=e.attributes.elements.field.primary.match(/data-[^=]+/)?.[0];return l?(r.forEach(e=>{const n=e.getAttribute(l);if(!n)return;const r=()=>((e,n)=>{const r=t.debounceTimers.get(e);r&&clearTimeout(r);const i=setTimeout(()=>{const r=o(),i=a(e);r[n]=i,s(r),t.debounceTimers.delete(e)},300);t.debounceTimers.set(e,i)})(e,n),i=e instanceof HTMLSelectElement?"change":"input";e.addEventListener(i,r),t.handlers.push({element:e,event:i,handler:r}),"change"!==i&&(e.addEventListener("change",r),t.handlers.push({element:e,event:"change",handler:r}));const c=a(e);if(c){const e=o();e[n]=c,s(e)}}),{result:`persist initialized (${r.length} fields)`,destroy:()=>{t.debounceTimers.forEach(e=>clearTimeout(e)),t.debounceTimers.clear(),t.handlers.forEach(({element:e,event:t,handler:n})=>{e.removeEventListener(t,n)}),t.handlers.length=0}}):{result:"persist skipped - invalid config",destroy:()=>{}}}async function W(){const n=t.default.form,r={destroyFunctions:[]},o=i(n.persist,"field");if(document.querySelector(o))try{const e=z(n.persist);e?.destroy&&r.destroyFunctions.push(e.destroy)}catch(d){console.error("[form] Error initializing persist:",d)}const s=i(n.honeypot,"form-handler");if(document.querySelector(s))try{const t=function(t){const n={honeypotHandler:null},r=n=>{const r=n.target;if("FORM"!==r.tagName)return;const o=e(t,"form-handler",r);if(!o)return;const s="INPUT"===o.tagName?o:o.querySelector("input");return s&&s.value?(n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),!1):void 0};return n.honeypotHandler=r,document.addEventListener("submit",r,!0),{result:"honeypot initialized",destroy:()=>{n.honeypotHandler&&(document.removeEventListener("submit",n.honeypotHandler,!0),n.honeypotHandler=null)}}}(n.honeypot);t?.destroy&&r.destroyFunctions.push(t.destroy)}catch(d){console.error("[form] Error initializing honeypot:",d)}const l=i(n.range,"wrapper");if(document.querySelector(l))try{const e=I(n.range);e?.destroy&&r.destroyFunctions.push(e.destroy)}catch(d){console.error("[form] Error initializing range:",d)}const c=i(n.test,"wrapper");if(document.querySelector(c))try{const t=function(t){const n={handlers:[]},r=(e,t,r,o)=>{e.addEventListener(t,r,o),n.handlers.push({element:e,event:t,handler:r,options:o})},o=a(t,"wrapper");return o.forEach(n=>{const o=n.querySelector("form");if(!o)return void console.warn('[form-test] No <form> element found within data-hs-form-test="wrapper"',n);const s=e(t,"info",n),a=()=>{const e=new FormData(o),t={};for(const[n,r]of e.entries())t[n]=r;if(s){const e=document.createElement("pre");e.textContent=JSON.stringify(t,null,2),s.innerHTML="",s.appendChild(document.createTextNode("Test mode active - Live form data:")),s.appendChild(e)}};s&&(s.textContent="Test mode active, preventing native submissions",a()),r(o,"input",a),r(o,"change",a);const i=o.querySelector('button[type="submit"], input[type="submit"]')||o.querySelector("button:not([type])");i&&r(i,"click",()=>{console.log("[form-test] Submit button clicked"),requestAnimationFrame(()=>{o.checkValidity()||console.log("[form-test] Browser blocked submission - validation failed")})}),r(o,"submit",e=>{e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),console.log("[form-test] Submission prevented - displaying test results");const t=new FormData(o),n={};for(const[o,s]of t.entries())n[o]=s;const r=`✅ Form would submit successfully at ${(new Date).toLocaleTimeString()}`;if(s){const e=document.createElement("pre");e.textContent=JSON.stringify(n,null,2),s.innerHTML="",s.appendChild(document.createTextNode(r)),s.appendChild(e)}else console.log(r),console.log("Form data:",n);return!1},!0)}),{result:`test initialized on ${o.length} form${1!==o.length?"s":""}`,destroy:()=>{n.handlers.forEach(({element:e,event:t,handler:n,options:r})=>{e.removeEventListener(t,n,r)}),n.handlers.length=0}}}(n.test);t?.destroy&&r.destroyFunctions.push(t.destroy)}catch(d){console.error("[form] Error initializing test:",d)}const u=i(n.select,"wrapper");if(document.querySelector(u))try{const e=await H(n.select);e?.destroy&&r.destroyFunctions.push(e.destroy)}catch(d){console.error("[form] Error initializing select:",d)}return{result:`form initialized (${r.destroyFunctions.length} modules active)`,destroy:()=>{r.destroyFunctions.forEach(e=>{try{e()}catch(d){console.error("[form] Error during cleanup:",d)}}),r.destroyFunctions.length=0}}}function B(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function R(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return B(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?B(e,t):void 0}}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function X(e,t,n,r){var o,s,a={headers:{accept:"*/*"}};return t||(a.mode="no-cors"),n&&(a.credentials="include"),a.priority=r?"high":"low",window.fetch?fetch(e,a):(o=e,s=n,new Promise(function(e,t,n){(n=new XMLHttpRequest).open("GET",o,n.withCredentials=s),n.setRequestHeader("Accept","*/*"),n.onload=function(){200===n.status?e():t()},n.send()}))}var V,U=(V=document.createElement("link")).relList&&V.relList.supports&&V.relList.supports("prefetch")?function(e,t){return new Promise(function(n,r,o){(o=document.createElement("link")).rel="prefetch",o.href=e,t&&o.setAttribute("crossorigin","anonymous"),o.onload=n,o.onerror=r,document.head.appendChild(o)})}:X,j=window.requestIdleCallback||function(e){var t=Date.now();return setTimeout(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})},1)},G=new Set,Y=new Set,K=!1;function J(e,t){return Array.isArray(t)?t.some(function(t){return J(e,t)}):(t.test||t).call(t,e.href,e)}function _(e){if(e){if(e.saveData)return new Error("Save-Data is enabled");if(/2g/.test(e.effectiveType))return new Error("network conditions are poor")}return!0}function Z(e){if(void 0===e&&(e={}),window.IntersectionObserver&&"isIntersecting"in IntersectionObserverEntry.prototype){var t=function(e){e=e||1;var t=[],n=0;function r(){n<e&&t.length>0&&(t.shift()(),n++)}return[function(e){t.push(e)>1||r()},function(){n--,r()}]}(e.throttle||1/0),n=t[0],r=t[1],o=e.limit||1/0,s=e.origins||[location.hostname],a=e.ignores||[],i=e.delay||0,l=[],c=e.timeoutFn||j,u="function"==typeof e.hrefFn&&e.hrefFn,d=e.prerender||!1;K=e.prerenderAndPrefetch||!1;var p=new IntersectionObserver(function(t){t.forEach(function(t){if(t.isIntersecting)l.push((t=t.target).href),a=function(){l.includes(t.href)&&(p.unobserve(t),(K||d)&&Y.size<o?function(e,t){void 0===t&&(t="immediate");var n=_(navigator.connection);if(n instanceof Error)return Promise.reject(new Error("Cannot prerender, "+n.message));if(!HTMLScriptElement.supports("speculationrules"))return Q(e,!0,!1,!1,"moderate"===t||"conservative"===t),Promise.reject(new Error("This browser does not support the speculation rules API. Falling back to prefetch."));for(var r,o=R([].concat(e));!(r=o()).done;)Y.add(r.value);G.size>0&&!K&&console.warn("[Warning] You are using both prefetching and prerendering on the same document");var s=function(e,t){var n=document.createElement("script");n.type="speculationrules",n.text='{"prerender":[{"source": "list",\n "urls": ["'+Array.from(e).join('","')+'"],\n "eagerness": "'+t+'"}]}';try{document.head.appendChild(n)}catch(r){return r}return!0}(Y,t);return!0===s?Promise.resolve():Promise.reject(s)}(u?u(t):t.href,e.eagerness).catch(function(t){if(!e.onError)throw t;e.onError(t)}):G.size<o&&!d&&n(function(){Q(u?u(t):t.href,e.priority,e.checkAccessControlAllowOrigin,e.checkAccessControlAllowCredentials,e.onlyOnMouseover).then(r).catch(function(t){r(),e.onError&&e.onError(t)})}))},(c=i)?setTimeout(a,c):a();else{var s=l.indexOf((t=t.target).href);s>-1&&l.splice(s)}var a,c})},{threshold:e.threshold||0});return c(function(){(e.el&&e.el.length&&e.el.length>0&&"A"===e.el[0].nodeName?e.el:(e.el||document).querySelectorAll("a")).forEach(function(e){s.length&&!s.includes(e.hostname)||J(e,a)||p.observe(e)})},{timeout:e.timeout||2e3}),function(){G.clear(),p.disconnect()}}}function Q(e,t,n,r,o){var s=_(navigator.connection);return s instanceof Error?Promise.reject(new Error("Cannot prefetch, "+s.message)):(Y.size>0&&!K&&console.warn("[Warning] You are using both prefetching and prerendering on the same document"),Promise.all([].concat(e).map(function(e){return G.has(e)?[]:(G.add(e),function(e,t,n){var r=[].slice.call(arguments,3);if(!n)return e.apply(void 0,[t].concat(r));for(var o,s=Array.from(document.querySelectorAll("a")).filter(function(e){return e.href===t}),a=new Map,i=function(){var n=o.value,s=function(o){var l=setTimeout(function(){return n.removeEventListener("mouseenter",s),n.removeEventListener("mouseleave",i),e.apply(void 0,[t].concat(r))},200);a.set(n,l)},i=function(e){var t=a.get(n);t&&(clearTimeout(t),a.delete(n))};n.addEventListener("mouseenter",s),n.addEventListener("mouseleave",i)},l=R(s);!(o=l()).done;)i()}(t?X:U,new URL(e,location.href).toString(),o,n,r,t))})))}async function ee(){const e=new Set,t=Z({el:document.body,limit:5,throttle:1e3,timeout:1e4,ignoreSlowConnection:!0,origins:[window.location.hostname],delay:0,priority:"low"}),n=new IntersectionObserver(t=>{t.forEach(t=>{if(t.isIntersecting){const n=t.target.href;if(n.includes("#")||e.has(n))return;Q([n],{priority:"low"}).then(()=>{e.add(n)}).catch(()=>{})}})},{rootMargin:"200px"});return document.querySelectorAll("a[href]").forEach(e=>{e instanceof HTMLAnchorElement&&e.hostname===window.location.hostname&&n.observe(e)}),document.body.addEventListener("mouseover",t=>{const n=t.target.closest("a[href]");if(n&&n instanceof HTMLAnchorElement){const t=n.href;n.hostname===window.location.hostname&&!e.has(t)&&Q([t],{priority:"low"}).then(()=>{e.add(t)}).catch(()=>{})}}),{result:"link-prefetch initialized",destroy:()=>{t&&"function"==typeof t&&t(),n.disconnect()}}}async function te(){const e=t._global.classes.active,n=t.default["active-link"],r={observers:[],handlers:[],scrollTimeout:null},o=i(n,"wrapper"),s=i(n,"trigger"),a=document.querySelectorAll('a[href^="#"], button[data-target^="#"]'),l=[];a.forEach(e=>{let t=e;const n=e.closest(o);if(n)t=n;else{const n=e.closest(s);n&&(t=n)}l.push({link:e,target:t})});const c=[];if(a.forEach(e=>{const t=e.getAttribute("href")||e.getAttribute("data-target");if(t&&"#"!==t){const e=document.querySelector(t);e&&c.push({element:e,hash:t})}}),0===c.length)return{result:"active-link: no sections found",destroy:()=>{}};let u=null;const d=()=>{const t=.75*window.innerHeight;let n=null;for(let e=c.length-1;e>=0;e--){if(c[e].element.getBoundingClientRect().top<=t){n=c[e].hash;break}}if(n!==u&&(u=n,l.forEach(({target:t})=>t.classList.remove(e)),u)){const t=l.find(({link:e})=>e.getAttribute("href")===u||e.getAttribute("data-target")===u);t&&t.target.classList.add(e)}},p=new IntersectionObserver(()=>{d()},{rootMargin:"-75% 0px -25% 0px",threshold:0});c.forEach(({element:e})=>p.observe(e)),r.observers.push(p);const f=()=>{r.scrollTimeout&&clearTimeout(r.scrollTimeout),r.scrollTimeout=setTimeout(d,50)};return window.addEventListener("scroll",f),r.handlers.push({element:window,event:"scroll",handler:f}),d(),{result:`active-link initialized (${c.length} sections tracked)`,destroy:()=>{r.observers.forEach(e=>e.disconnect()),r.observers.length=0,r.handlers.forEach(({element:e,event:t,handler:n})=>{e.removeEventListener(t,n)}),r.handlers.length=0,r.scrollTimeout&&(clearTimeout(r.scrollTimeout),r.scrollTimeout=null),l.forEach(({target:t})=>t.classList.remove(e))}}}const ne=l.apiName;function re(t){const n={handlers:[]},r=(e,t,r,o)=>{e.addEventListener(t,r,o),n.handlers.push({element:e,event:t,handler:r,options:o})};const c=a(t,"wrapper");return c.forEach(function(n){const a=e(t,"list",n),c=e(t,"row",n);if(!!!a||!!!c)return;const u=t.attributes.properties?.animation,d=u&&n.getAttribute(u)||"instant",p=Array.from(a.children);if(0===p.length)return;const f=t.attributes.properties?.id,m=new Map;f&&p.forEach((e,t)=>{const n=e.getAttribute(f);n&&m.set(n,t)}),p.forEach((e,t)=>{0===t?(e.style.display="block",e.classList.add(l.classes.active)):(e.style.display="none",e.classList.remove(l.classes.active))});const h=[],g=c.firstElementChild?.cloneNode(!0);if(!g)return void console.warn(`[${ne}] Lightbox row has no template child`);for(g.classList.remove(l.classes.active);c.firstChild;)c.removeChild(c.firstChild);const v=i(l.clickable,"button");p.forEach((e,t)=>{const n=g.cloneNode(!0),o=e.querySelector("img, video, [src]"),s=n.querySelector("img, video, [src]");if(o&&s){const e=o.getAttribute("src");e&&s.setAttribute("src",e)}0===t&&n.classList.add(l.classes.active);const a=n.querySelector(v)||n;r(a,"click",()=>w(t)),c.appendChild(n),h.push(n)});let b=0,y=!1;async function w(e){if(y||e===b)return;if(e<0||e>=p.length)return;y=!0;const t=p[b],n=p[e];h.forEach((t,n)=>{t.classList.toggle(l.classes.active,n===e)}),t.classList.remove(l.classes.active),n.classList.add(l.classes.active),"fade"===d?await async function(e,t,n){s()&&(n=0);const r=o("lightbox",!1);if(!r)return e.style.display="none",void(t.style.display="block");const{gsap:a}=r;return new Promise(r=>{const o=a.timeline({onComplete:()=>{e.style.display="none",e.style.position="",e.style.opacity="",t.style.position="",t.style.opacity="",r()},defaults:{duration:n,ease:"power1.out"}});o.set(e,{position:"absolute",top:0,left:0,width:"100%"}),o.set(t,{display:"block",position:"relative",opacity:0}),o.to(e,{opacity:0}),o.to(t,{opacity:1},"<50%")})}(t,n,.3):"clip"===d?await async function(e,t,n){s()&&(n=0);const r=o("lightbox",!1);if(!r)return e.style.display="none",void(t.style.display="block");const{gsap:a}=r;return new Promise(r=>{const o=a.timeline({onComplete:()=>{e.style.display="none",e.style.position="",e.style.clipPath="",t.style.position="",t.style.clipPath="",r()},defaults:{duration:n,ease:"power1.inOut"}});o.set(e,{position:"absolute",top:0,left:0,width:"100%",clipPath:"inset(0% 0% 0% 0%)"}),o.set(t,{display:"block",position:"relative",clipPath:"inset(0% 0% 100% 0%)"}),o.to(e,{clipPath:"inset(100% 0% 0% 0%)"}),o.to(t,{clipPath:"inset(0% 0% 0% 0%)"},"<40%")})}(t,n,.3):(t.style.display="none",n.style.display="block"),b=e,y=!1}const E=e(t,"previous",n),A=e(t,"next",n);if(E){const e=E.querySelector(v)||E;r(e,"click",()=>{w(0===b?p.length-1:b-1)})}if(A){const e=A.querySelector(v)||A;r(e,"click",()=>{w(b===p.length-1?0:b+1)})}const x=t.attributes.properties?.button;if(x&&m.size>0){r(document,"click",e=>{const t=e.target.closest(`[${x}]`);if(!t)return;const n=t.getAttribute(x);n&&m.has(n)&&w(m.get(n))})}}),{result:`lightbox initialized (${c.length} instances)`,destroy:()=>{n.handlers.forEach(({element:e,event:t,handler:n,options:r})=>{e.removeEventListener(t,n,r)}),n.handlers.length=0}}}const oe=t._global.apiName;function se(t){const n={handlers:[],observers:[],draggables:[]},r=(e,t,r,o)=>{e.addEventListener(t,r,o),n.handlers.push({element:e,event:t,handler:r,options:o})},c=o("slider",!1);if(!c)return{result:"slider skipped (no GSAP)",destroy:()=>{}};const{gsap:u,Draggable:d}=c;if(!h())return m("slider",["Draggable"],"error"),{result:"slider skipped (no Draggable)",destroy:()=>{}};const p=s();const f=a(t,"component");return f.forEach(function(o){const s=e(t,"element",o),c=e(t,"list",o);if(!c)return void console.warn(`[${oe}] Slider component missing list:`,o);if(!s)return void console.warn(`[${oe}] Slider component missing element:`,o);let f=Array.from(c.children);if(0===f.length)return;const m=f.length,h=`slider-${Math.random().toString(36).substring(2,9)}`;c.setAttribute("id",h),c.setAttribute("role","region"),c.setAttribute("aria-label","Slider content");const g=t.attributes?.properties||{},v="true"===s.getAttribute(g.free||"data-hs-slider-free"),b="false"!==s.getAttribute(g.follow||"data-hs-slider-follow"),y="true"===s.getAttribute(g.wheel||"data-hs-slider-wheel"),w="true"===s.getAttribute(g.toClicked||"data-hs-slider-to-clicked"),E="true"===s.getAttribute(g.infinite||"data-hs-slider-infinite"),A=p?0:parseFloat(s.getAttribute(g.speed||"data-hs-slider-speed")||"0.5"),x=a(t,"previous",o),L=a(t,"next",o),k=i(l.clickable,"button"),S=[],C=[];x.forEach(e=>{const t=e.querySelector(k);t&&S.push(t)}),L.forEach(e=>{const t=e.querySelector(k);t&&C.push(t)});const T=e(t,"dots",o);let P=null;T?.firstElementChild&&(P=T.firstElementChild.cloneNode(!0),P.classList.remove(l.classes.active));const q=e(t,"draggable-wrapper",o),D=e(t,"draggable-element",o);let M=0;if(E){q&&(q.style.display="none");const e=f[0].offsetWidth,t=s.offsetWidth,n=getComputedStyle(c),r=parseFloat(n.gap)||0,o=Math.max(1,Math.round((t+r)/(e+r)));M=o+1;for(let s=m-M;s<m;s++){const e=f[s<0?m+s:s].cloneNode(!0);e.setAttribute("data-clone","true"),c.insertBefore(e,c.firstChild)}for(let s=0;s<M;s++){const e=f[s].cloneNode(!0);e.setAttribute("data-clone","true"),c.appendChild(e)}f=Array.from(c.children)}const I={slidePositions:[],currentIndex:0,draggable:null};let $=!1;function F(){if(E)return m;const e=function(){if(0===f.length)return 1;const e=s.offsetWidth,t=f[0].offsetWidth,n=getComputedStyle(c),r=parseFloat(n.gap)||0;return t+r===0?1:Math.max(1,Math.round((e+r)/(t+r)))}();return Math.max(1,f.length-e+1)}function N(){I.slidePositions=[];const e=F(),t=getComputedStyle(c),n=parseFloat(t.gap)||0,r=H();for(let o=0;o<e;o++)if(o===e-1)I.slidePositions.push(r.minX);else{let e=0;for(let t=0;t<o;t++)e+=f[t].offsetWidth+n;I.slidePositions.push(-e)}}function H(){const e=s.offsetWidth,t=c.scrollWidth;return{minX:-Math.max(0,t-e),maxX:0}}function O(){const e=f[0]?.offsetWidth||0,t=getComputedStyle(c);return e+(parseFloat(t.gap)||0)}function z(){if(!E)return;$=!1;const e=u.getProperty(c,"x"),t=O(),n=M*t,r=m*t;let o=!1,s=e;Math.abs(e)<n-t/2?(s=e-r,u.set(c,{x:s}),o=!0):Math.abs(e)>n+r-t/2&&(s=e+r,u.set(c,{x:s}),o=!0),o&&(I.draggable&&I.draggable.update(),$=!0,W(s),X(),j(),R())}if(N(),E){const e=O(),t=-M*e;u.set(c,{x:t})}function W(e){const t=F();if(E){const n=O(),r=M*n,o=Math.abs(e)-r,s=Math.round(o/n);return void(I.currentIndex=(s%t+t)%t)}const n=H(),r=Math.abs(n.minX);if(0===r)return void(I.currentIndex=0);const o=Math.abs(e)/r;I.currentIndex=Math.min(t-1,Math.floor(o*t))}function B(e){if(v)return W(e),e;let t=I.slidePositions[0],n=Math.abs(e-t),r=0;return I.slidePositions.forEach((o,s)=>{const a=Math.abs(e-o);a<n&&(n=a,t=o,r=s)}),I.currentIndex=r,t}function R(){const e=F(),t=0===I.currentIndex,n=I.currentIndex>=e-1,r=v||E;S.forEach(e=>{e.disabled=!r&&t,e.setAttribute("aria-disabled",r?"false":String(t))}),C.forEach(e=>{e.disabled=!r&&n,e.setAttribute("aria-disabled",r?"false":String(n))})}function X(){const e=l.classes.active;f.forEach((t,n)=>{t.classList.toggle(e,n===I.currentIndex)})}let V=[],U=null;function j(){const e=l.classes.active;V.forEach((t,n)=>{t.classList.toggle(e,n===I.currentIndex),t.setAttribute("aria-current",n===I.currentIndex?"true":"false")})}function G(e,t=!0){u.killTweensOf(c);const n=F();if(E){const r=O();let o=e;e<0?o=n-1:e>=n&&(o=0);const s=-(M*r+o*r);if(e<0||e>=n){const t=u.getProperty(c,"x");if(e<0){const e=t-m*r;u.set(c,{x:e})}else{const e=t+m*r;u.set(c,{x:e})}I.draggable&&I.draggable.update()}return I.currentIndex=o,R(),X(),j(),void(t&&A>0?u.to(c,{x:s,duration:A,ease:"power2.out",onUpdate:()=>{I.draggable&&I.draggable.update(),Y()}}):(u.set(c,{x:s}),I.draggable&&I.draggable.update(),Y()))}const r=Math.max(0,Math.min(e,n-1)),o=I.slidePositions[r];void 0!==o&&(I.currentIndex=r,R(),X(),j(),t&&A>0?u.to(c,{x:o,duration:A,ease:"power2.out",onUpdate:()=>{I.draggable&&I.draggable.update(),Y()}}):(u.set(c,{x:o}),I.draggable&&I.draggable.update(),Y()))}function Y(){if(!q||!D)return;const e=H(),t=Math.abs(e.minX);if(0===t)return;const n=u.getProperty(c,"x"),r=Math.max(0,Math.min(1,Math.abs(n)/t)),o=q.offsetWidth,s=D.offsetWidth,a=Math.max(0,o-s);u.set(D,{x:r*a})}if(d){const e=H(),t=d.create(c,{type:"x",bounds:E?void 0:{minX:e.minX,maxX:e.maxX},inertia:!0,edgeResistance:E?0:.65,dragResistance:b?0:.5,cursor:"auto",activeCursor:"auto",allowContextMenu:!0,snap:v||E?void 0:{x:B},onDrag:function(){const e=u.getProperty(c,"x");Y(),B(e),X(),j(),R()},onThrowUpdate:function(){if(z(),Y(),!$){B(u.getProperty(c,"x")),X(),j(),R()}},onThrowComplete:function(){z(),v||(R(),X(),j()),Y()},onDragEnd:function(){v&&Y()}});n.draggables.push(t),I.draggable=t[0]}function K(){if(!T||!P)return;T.innerHTML="",V=[];const e=l.classes.active,t=F();for(let n=0;n<t;n++){const t=P.cloneNode(!0);t.setAttribute("role","button"),t.setAttribute("tabindex","0"),t.setAttribute("aria-label",`Go to page ${n+1}`),t.setAttribute("aria-controls",h),n===I.currentIndex&&(t.classList.add(e),t.setAttribute("aria-current","true"));r(t,"click",()=>G(n));r(t,"keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),G(n))}),T.appendChild(t),V.push(t)}}if(K(),q&&D&&d){const e=()=>({minX:0,maxX:q.offsetWidth-D.offsetWidth}),t=d.create(D,{type:"x",bounds:e(),allowContextMenu:!0,onDrag:function(){const t=e(),n=Math.max(0,Math.min(1,this.x/t.maxX)),r=H(),o=-n*Math.abs(r.minX);u.set(c,{x:o}),I.draggable&&I.draggable.update(),B(o),X(),j(),R()},onDragEnd:function(){if(!v){B(u.getProperty(c,"x")),G(I.currentIndex)}}});n.draggables.push(t),U=t[0]}if(S.forEach(e=>{e.setAttribute("aria-controls",h);r(e,"click",()=>G(I.currentIndex-1))}),C.forEach(e=>{e.setAttribute("aria-controls",h);r(e,"click",()=>G(I.currentIndex+1))}),y){let e=0,t=!1,n=null;r(s,"wheel",r=>{if(t)return;const o=r.deltaX;if(Math.abs(o)<1)return;e+=o,n&&clearTimeout(n),n=window.setTimeout(()=>{e=0},150);Math.abs(e)>=100&&(r.preventDefault(),t=!0,G(e>0?I.currentIndex+1:I.currentIndex-1),e=0,setTimeout(()=>{t=!1},1e3*A+50))},{passive:!1})}w&&f.forEach((e,t)=>{r(e,"click",()=>{t!==I.currentIndex&&G(t)})});let J=F(),_=null;const Z=new ResizeObserver(()=>{_&&clearTimeout(_),_=window.setTimeout(()=>{const e=F();e!==J&&(I.currentIndex>=e&&(I.currentIndex=e-1),K(),J=e),N();const t=H();if(I.draggable&&(I.draggable.applyBounds({minX:t.minX,maxX:t.maxX}),I.draggable.update()),v||G(I.currentIndex,!1),Y(),U&&q&&D){const e=q.offsetWidth,t=D.offsetWidth;U.applyBounds({minX:0,maxX:e-t}),U.update()}},150)});Z.observe(s.parentElement||s),n.observers.push(Z),R(),X(),Y()}),{result:`slider initialized (${f.length} instances)`,destroy:()=>{n.draggables.forEach(e=>{try{Array.isArray(e)?e.forEach(e=>e.kill&&e.kill()):e?.kill&&e.kill()}catch(t){}}),n.draggables.length=0,n.observers.forEach(e=>e.disconnect()),n.observers.length=0,n.handlers.forEach(({element:e,event:t,handler:n,options:r})=>{e.removeEventListener(t,n,r)}),n.handlers.length=0}}}async function ae(){const e={destroyFunctions:[]},n=t.default;try{const t=await y();t?.destroy&&e.destroyFunctions.push(t.destroy)}catch(i){console.error("[default] Error initializing transition:",i)}const r=[w(n["smooth-scroll"]),k(n.navbar),S(n.accordion),T(),P(n.pagination),q(n.comparison),D(n.tabs),M(n.modal),W(),ee(),te(),re(n.lightbox),se(n.slider)],o=await Promise.allSettled(r);o.forEach(t=>{"fulfilled"===t.status&&t.value?.destroy&&e.destroyFunctions.push(t.value.destroy)});const s=o.filter(e=>"fulfilled"===e.status).length,a=o.length-s;return a>0&&console.warn(`[default] ${s+1}/${o.length+1} modules loaded successfully. ${a} failed but won't affect other modules.`),{result:"default initialized",destroy:()=>{e.destroyFunctions.forEach(e=>{try{e()}catch(i){console.error("[default] Error during cleanup:",i)}}),e.destroyFunctions.length=0}}}export{ae as init};