var CodeNova=CodeNova||{};(function(){var a=window.setTimeout.bind(window),o=window.clearTimeout.bind(window),v=window.setInterval.bind(window),s=window.clearInterval.bind(window),i=new Set,r=new Set;window.setTimeout=function(){var n=a.apply(null,arguments);return i.add(n),n};window.clearTimeout=function(n){i.delete(n);o(n)};window.setInterval=function(){var n=v.apply(null,arguments);return r.add(n),n};window.clearInterval=function(n){r.delete(n);s(n)};var n=[],y=document.addEventListener.bind(document),p=document.removeEventListener.bind(document),w=window.addEventListener.bind(window),b=window.removeEventListener.bind(window),k={"spa:navigate":!0,"spa:before-navigate":!0};document.addEventListener=function(t,i,r){k[t]||n.push({target:document,type:t,listener:i,options:r});y(t,i,r)};document.removeEventListener=function(t,i,r){n=n.filter(function(n){return!(n.target===document&&n.type===t&&n.listener===i)});p(t,i,r)};window.addEventListener=function(t,i,r){n.push({target:window,type:t,listener:i,options:r});w(t,i,r)};window.removeEventListener=function(t,i,r){n=n.filter(function(n){return!(n.target===window&&n.type===t&&n.listener===i)});b(t,i,r)};var t=new Set;if(typeof MutationObserver!="undefined"){var h=MutationObserver;window.MutationObserver=function(n){var i=new h(n);return t.add(i),i};window.MutationObserver.prototype=h.prototype}if(typeof ResizeObserver!="undefined"){var c=ResizeObserver;window.ResizeObserver=function(n){var i=new c(n);return t.add(i),i};window.ResizeObserver.prototype=c.prototype}if(typeof IntersectionObserver!="undefined"){var l=IntersectionObserver;window.IntersectionObserver=function(n,i){var r=new l(n,i);return t.add(r),r};window.IntersectionObserver.prototype=l.prototype}var u=new Set;if(typeof requestAnimationFrame!="undefined"){var d=window.requestAnimationFrame.bind(window),f=window.cancelAnimationFrame.bind(window);window.requestAnimationFrame=function(n){var t=d(n);return u.add(t),t};window.cancelAnimationFrame=function(n){u.delete(n);f(n)}}function g(){i.forEach(function(n){o(n)});i.clear();r.forEach(function(n){s(n)});r.clear();t.forEach(function(n){try{n.disconnect()}catch(t){}});t.clear();typeof f!="undefined"&&u.forEach(function(n){f(n)});u.clear()}var e=new Set;CodeNova.SinglePageNavigation=(class{constructor(){this._enabled=!1;this._handler=null;this._preservedElements=[]}keepInterval(n){r.delete(n)}keepTimeout(n){i.delete(n)}keepObserver(n){t.delete(n)}keepListener(t,i,r){n=n.filter(function(n){return!(n.target===t&&n.type===i&&n.listener===r)})}enable(){if(!this._enabled){if(typeof navigation=="undefined"){console.warn("CodeNova.SinglePageNavigation: Navigation API not supported in this browser.");return}document.querySelectorAll("script[src]").forEach(function(n){e.add(n.src)});this._handler=n=>this._onNavigate(n);navigation.addEventListener("navigate",this._handler);this._enabled=!0;console.log("CodeNova.SinglePageNavigation: enabled")}}disable(){this._enabled&&(navigation.removeEventListener("navigate",this._handler),this._handler=null,this._enabled=!1,console.log("CodeNova.SinglePageNavigation: disabled"))}_onNavigate(n){if(this._enabled&&n.canIntercept&&n.downloadRequest===null&&!n.formData&&!n.hashChange){if(window.__SPA_IGNORE){window.__SPA_IGNORE=!1;return}(n.navigationType!=="traverse"||n.destination.url!==location.href)&&n.intercept({scroll:"after-transition",focusReset:"after-transition",handler:()=>this._handleNavigation(n)})}}async _handleNavigation(n){document.dispatchEvent(new CustomEvent("spa:before-navigate",{detail:{url:n.destination.url}}));g();this._detachPreservedElements();var t=await fetch(n.destination.url,{headers:{"X-SPA-Request":"true"},signal:n.signal});if(!t.ok){this._reattachPreservedElements();throw new Error("SPA navigation failed: "+t.status+" "+t.statusText);}var r=await t.text(),u=new DOMParser,i=u.parseFromString(r,"text/html");await this._loadNewBundles(i);this._syncHtmlAttributes(i);this._swapHead(i);this._swapBody(i);n.navigationType!=="traverse"&&window.scrollTo(0,0);this._reattachPreservedElements();this._activateScripts();document.dispatchEvent(new Event("DOMContentLoaded"));document.dispatchEvent(new CustomEvent("spa:navigate",{detail:{url:n.destination.url}}))}_detachPreservedElements(){this._preservedElements=[];for(var i=document.querySelectorAll("[data-spa-preserve]"),n=0;n=0;i--){var r=n.attributes[i];t.hasAttribute(r.name)||n.removeAttribute(r.name)}for(var i=0;i=0;t--){var u=e[t];if(u.tagName!=="TITLE"&&!u.id){var f=u.outerHTML;r.has(f)?r.delete(f):u.remove()}}r.forEach(function(n){document.head.appendChild(n.cloneNode(!0))})}_swapBody(n){document.body.innerHTML=n.body.innerHTML;this._syncAttributes(document.body,n.body)}_loadNewBundles(n){for(var t=[],u=n.querySelectorAll("script[src]"),r=0;r