PageSourceSearch

https://www.riddarhuset.se/wp-content/themes/riddarhuset-2022/dist/js/app.min.js?ver=1756986369

js riddarhuset.se collected 2026-09-24 22:39:04 UTC 11,863 bytes, 1 lines download raw bytes

1"use strict";!function(){var e,t=document.querySelector("body"),r=document.querySelector(".site-header"),i=document.querySelector(".js-go-to-top"),s=r.querySelectorAll(".js-top-dropdown"),o=r.querySelectorAll("li.js-show-submenu"),a=r.querySelector(".js-show-search"),c=r.querySelector(".site-header__search-form"),n=r.querySelector(".js-toggle-menu"),l=r.querySelector(".site-header__navbar"),u=r.querySelectorAll(".show-sub"),d=r.querySelector(".site-header__top-container__section--left"),v=r.querySelector(".site-header__top-container__section--right"),f=r.querySelectorAll(".js-restricted-show-sub"),h=r.querySelector(".site-header__mobile-icons"),m=r.querySelector(".site-header__cart"),p=document.querySelector(".js-footer-form"),L=p.querySelector(".gform_wrapper").id,g=document.querySelectorAll(".js-remove-cart-item"),S=r.querySelector(".cart-popup"),y=document.querySelectorAll(".cart-popup input.qty"),b=r.querySelector(".cart-info .count"),_=r.querySelector(".cart-popup__footer p.totals"),q=r.querySelector(".js-show-mini-cart"),w=r.querySelectorAll(".js-change-font-size"),E=r.querySelector(".site-header__topbar-links"),T=function(){window.scrollY>=100?(r.classList.add("site-header--scrolled"),i.classList.add("go-to-top--visible")):(r.classList.remove("site-header--scrolled"),i.classList.remove("go-to-top--visible"))},j=function(){if(window.innerWidth<=1200){if(!e&&(e=1,l.insertBefore(c,l.firstChild),s.forEac
1h(function(e){l.appendChild(e)}),h.insertBefore(m,h.firstChild),E)){var t=l.querySelector(".navbar-nav");l.insertBefore(E,t.nextSibling)}}else e&&(e=0,r.appendChild(c),s.forEach(function(e){d.appendChild(e)}),v.insertBefore(m,v.firstChild),E&&v.insertBefore(E,v.firstChild))},x=function(){if(null!=p){var e=p.offsetHeight;p.style.top="-"+e/2+"px",p.style.marginTop=e/2+"px",p.style.marginBottom="-"+e/2+"px"}},C=function(){var e=document.querySelectorAll("select");e&&e.forEach(function(e){if(!e.closest(".woocommerce-checkout")){var t={searchEnabled:!1,searchChoices:!1,shouldSort:!1,allowHTML:!0,itemSelectText:""};if("product-dropdown"===e.getAttribute("class")){t.placeholder=!0,t.searchEnabled=!0,t.searchChoices=!0,t.allowHTML=!0;var r=[];e.querySelectorAll("option").forEach(function(e){var t={item:e.value,subTitle:e.dataset.subTitle};r.push(t)}),t.callbackOnCreateTemplates=function(e){this.config.classNames;var t=this.config.itemSelectText;return{item:function(t,i){var s=t.classNames,o="";return r.forEach(function(e){e.item===i.value&&e.subTitle&&(o='<span class="sub-title">| '+e.subTitle+"</span>")}),e('\t\t\t\t\t\t\t<div\t\t\t\t\t\t\t\tclass="'+String(s.item)+" "+String(i.highlighted?s.highlightedState:s.itemSelectable)+'"\t\t\t\t\t\t\t\tdata-item\t\t\t\t\t\t\t\tdata-id="'+String(i.id)+'"\t\t\t\t\t\t\t\tdata-value="'+String(i.value)+'"\t\t\t\t\t\t\t\t'+String(i.active?'aria-selected="true"':"")+"\t\t\t\t\t\t\t\t"+String(i.disabled?'aria-disabled="true"':"")+"\t\t\t\t\t\t\t\t>\t\t\t\t\t\t\t\t"+String(i.label)+o+"\t\t\t\t\t\t\t</div>\t\t\t\t\t\t")},choice:function(i,s){var o=i.classNames,a="";return r.forEach(function(e){e.item===s.value&&e.subTitle&&(a='<span class="sub-title">| '+e.subTitle+"</span>")}),e('\t\t\t\t\t<div\t\t\t\t\t\tclass="'+String(o.item)+" "+String(o.itemChoice)+" "+String(s.disabled?o.itemDisabled:o.itemSelectable)+'"\t\t\t\t\t\tdata-select-text="'+String(t)+'"\t\t\t\t\t\tdata-choice \t\t\t\t\t\t'+String(s.disabled?'data-choice-disabled aria-disabled="true"':"data-choice-selectable")+'\t\t\t\t\t\tdata-id="'+String(s.id)+'"\t\t\t\t\t\tdata-value="'+String(s.value)+'"\t\t\t\t\t\t'+String(s.groupId>0?'role="treeitem"':'role="option"')+"\t\t\t\t\t\t>\t\t\t\t\t\t"+String(s.label)+a+"\t\t\t\t\t</div>\t\t\t\t\t")}}}}new Choices(e,t)}})},k=function(e){e.preventDefault();var t=e.target,r=t.dataset.cartItemKey,i=t.closest("li");i.classList.add("cart-popup__cart-item--loading");var s=new FormData;s.append("action","riddarhuset_remove_from_cart"),s.append("cart_item_key",r);var o=new URLSearchParams(s),a=riddarhuset.ajaxUrl;fetch(a,{method:"POST",body:o}).then(function(e){return e.json()}).then(function(e){e.removed_from_cart&&(b.innerHTML="("+e.cart_contents_count+")",_.innerHTML=e.totals,i.classList.remove("cart-popup__cart-item--loading"),i.slideToggle(400,function(){i.parentNode.removeChild(i)}))})},A=function(e){var t=e.target,r=t.value,i=t.closest("li"),s=i.dataset.cartItemKey,o=i.querySelector("p");i.classList.add("cart-popup__cart-item--loading");var a=new FormData;a.append("action","riddarhuset_change_product_qty"),a.append("cart_item_key",s),a.append("qty",r);var c=new URLSearchParams(a),n=riddarhuset.ajaxUrl;fetch(n,{method:"POST",body:c}).then(function(e){return e.json()}).then(function(e){i.classList.remove("cart-popup__cart-item--loading"),e.changed_item&&(b.innerHTML="("+e.cart_contents_count+")",o.innerHTML=r+" x "+e.line_total,_.innerHTML=e.totals)})},N=function(e){e.preventDefault();var r=e.target,i=r.dataset.fontSize;w.forEach(function(e){e===r?e.parentNode.classList.add("active"):e.parentNode.classList.remove("active")}),t.classList.remove("font-size-normal"),t.classList.remove("font-size-xl"),t.classList.remove("font-size-xxl"),t.classList.add("font-size-"+i);var s=new FormData;s.append("action","riddarhuset_change_font_size"),s.append("font_size",i);var o=new URLSearchParams(s),a=riddarhuset.ajaxUrl;fetch(a,{method:"POST",body:o}).then(function(e){return e.json()}).then(function(e){})};if(window.addEventListener("DOMContentLoaded",T),window.addEventListener("scroll",T,{passive:!0}),i.addEventListener("click",function(e){window.scrollTo({top:0,behavior:"smooth"})}
1),s&&s.forEach(function(e){!function(e){var t=e.querySelector(".current"),r=document.querySelectorAll(".js-top-dropdown .current"),i=e.querySelector("ul"),s=document.querySelectorAll(".js-top-dropdown ul");t.addEventListener("click",function(e){e.preventDefault(),window.innerWidth>1200?(r.forEach(function(e){e===t?e.classList.toggle("active"):e.classList.remove("active")}),s.forEach(function(e){e===i?e.classList.toggle("visible"):e.classList.remove("visible")})):i.slideToggle(400),a.classList.remove("site-header__show-search--active"),c.classList.remove("site-header__search-form--visible"),q.classList.remove("active"),S.classList.remove("cart-popup--visible"),o.forEach(function(e){e.classList.remove("active");var t=e.querySelector(".submenu-container"),r=e.querySelector(".submenu-container>ul");t.classList.remove("active"),r.classList.remove("visible")})})}(e)}),o&&o.forEach(function(e){!function(e){var t=e.querySelector(":scope > *");t.nextElementSibling,t.addEventListener("click",function(t){t.preventDefault(),o.forEach(function(t){if(t===e){t.classList.toggle("active");var r=e.querySelector(".submenu-container"),i=e.querySelector(".submenu-container>ul");i.classList.contains("visible")?(i.classList.remove("visible"),r.classList.remove("active")):(setTimeout(function(){i.classList.add("visible")},400),setTimeout(function(){r.classList.add("active")},600))}else{t.classList.remove("active");var s=t.querySelector(".submenu-container"),o=t.querySelector(".submenu-container>ul");s.classList.remove("active"),o.classList.remove("visible")}}),s&&s.forEach(function(e){var t=e.querySelector(".js-top-dropdown .current"),r=e.querySelector("ul");t.classList.remove("active"),r.classList.remove("visible")}),q.classList.remove("active"),S.classList.remove("cart-popup--visible")})}(e)}),a.addEventListener("click",function(){a.classList.toggle("site-header__show-search--active"),c.classList.toggle("site-header__search-form--visible"),c.querySelector("input.search-field").focus(),o.forEach(function(e){e.classList.remove("active");var t=e.querySelector(".submenu-container"),r=e.querySelector(".submenu-container>ul");t.classList.remove("active"),r.classList.remove("visible")}),s&&s.forEach(function(e){var t=e.querySelector(".js-top-dropdown .current"),r=e.querySelector("ul");t.classList.remove("active"),r.classList.remove("visible")}),q.classList.remove("active"),S.classList.remove("cart-popup--visible")}),u&&u.forEach(function(e){!function(e){e.addEventListener("click",function(t){if(!e.classList.contains("show-sub--loading")){e.classList.toggle("show-sub--active"),e.classList.toggle("show-sub--loading");var r=e.parentNode.querySelector(":scope > .submenu-container");null==r&&(r=e.parentNode.querySelector(":scope > ul")),r.slideToggle(400,function(){e.classList.remove("show-sub--loading"),e.classList.contains("show-sub--active")||r.style.removeProperty("display")})}})}(e)}),function(e){null!==e&&e.addEventListener("click",function(r){e.classList.toggle("site-header__show-menu--active"),l.classList.toggle("site-header__navbar--visible"),t.classList.toggle("locked-scrolling")})}(n),document.addEventListener("click",function(e){r.contains(e.target)||(o.forEach(function(e){e.classList.remove("active");var t=e.querySelector(".submenu-container"),r=e.querySelector(".submenu-container>ul");t.classList.remove("active"),r.classList.remove("visible")}),s&&s.forEach(function(e){var t=e.querySelector(".js-top-dropdown .current"),r=e.querySelector("ul");t.classList.remove("active"),r.classList.remove("visible")}),a.classList.remove("site-header__show-search--active"),c.classList.remove("site-header__search-form--visible"),q.classList.remove("active"),S.classList.remove("cart-popup--visible"))}),f&&f.forEach(function(e){!function(e){e.addEventListener("click",function(t){var r=e.parentNode.querySelector(":scope > ul.sub-menu"),i=e.parentNode.parentNode.querySelectorAll("ul.sub-menu");if(e.classList.contains("active")){var s=r.offsetHeight;r.style.height=s+"px",setTimeout(function(){r.style.height="0px"},10)}else{r.style.height="auto";var o=r.offsetHeight;r.style.height="0px",setTimeout(function(){r.style.height=o+"px"},10),setTimeout(function(){r.style.height="auto"},410)}
1i&&i.forEach(function(e){if(e!==r){var t=e.parentNode.querySelector(":scope .js-restricted-show-sub"),i=e.offsetHeight;e.style.height=i+"px",setTimeout(function(){e.style.height="0px"},10),t.classList.remove("active")}}),e.classList.toggle("active")})}(e)}),window.addEventListener("DOMContentLoaded",j),window.addEventListener("resize",j,{passive:!0}),window.addEventListener("DOMContentLoaded",x),window.addEventListener("resize",x,{passive:!0}),null!==L){var D=parseInt(L.replace("gform_wrapper_",""));jQuery(document).on("gform_post_render",function(e,t,r){var i=p.querySelector(".gform_validation_errors");t===D&&null!==i&&x()})}window.addEventListener("DOMContentLoaded",C),jQuery(document).on("gform_post_render",function(e,t,r){jQuery("div.gform_validation_errors","#gform_wrapper_"+t).length>0&&C()}),new GLightbox({touchNavigation:!0,loop:!0,autoplayVideos:!0}),g&&g.forEach(function(e){e.addEventListener("click",k)}),y&&y.forEach(function(e){e.addEventListener("input",A)}),q.addEventListener("click",function(e){e.preventDefault(),q.classList.toggle("active"),S.classList.toggle("cart-popup--visible"),a.classList.remove("site-header__show-search--active"),c.classList.remove("site-header__search-form--visible"),o.forEach(function(e){e.classList.remove("active");var t=e.querySelector(".submenu-container"),r=e.querySelector(".submenu-container>ul");t.classList.remove("active"),r.classList.remove("visible")}),s&&s.forEach(function(e){var t=e.querySelector(".js-top-dropdown .current"),r=e.querySelector("ul");t.classList.remove("active"),r.classList.remove("visible")})}),w&&w.forEach(function(e){e.addEventListener("click",N)}),window.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("li.restricted-visible-menu-item");e&&e.forEach(function(e){if(e.querySelector("ul")){var t=e.querySelectorAll("li:not(.restricted-menu-item)");if(0===t.length){console.log(t);var r=e.querySelector(".submenu-indicator"),i=e.querySelector(".show-sub");r.parentNode.removeChild(r),i.parentNode.removeChild(i)}}})})}();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.