1"use strict";(self.webpackChunkacris_shop_switch_c_s=self.webpackChunkacris_shop_switch_c_s||[]).push([[19908,31330],{68(e,t,o){o.d(t,{A:()=>i});class i{constructor(){this._request=null,this._errorHandlingInternal=!1}get(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",i=this._createPreparedRequest("GET",e,o);return this._sendRequest(i,null,t)}post(e,t,o){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";i=this._getContentType(t,i);let s=this._createPreparedRequest("POST",e,i);return this._sendRequest(s,t,o)}delete(e,t,o){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";i=this._getContentType(t,i);let s=this._createPreparedRequest("DELETE",e,i);return this._sendRequest(s,t,o)}patch(e,t,o){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";i=this._getContentType(t,i);let s=this._createPreparedRequest("PATCH",e,i);return this._sendRequest(s,t,o)}abort(){if(this._request)return this._request.abort()}setErrorHandlingInternal(e){this._errorHandlingInternal=e}_registerOnLoaded(e,t){t&&(!0===this._errorHandlingInternal?(e.addEventListener("load",()=>{t(e.responseText,e)}),e.addEventListener("abort",()=>{console.warn(`the request to ${e.responseURL} was aborted`)}),e.addEventListener("error",()=>{console.warn(`the request to ${e.responseURL} failed with status ${e.status}`)}),e.addEventListener("timeout",()=>{console.warn(`the request to ${e.responseURL} timed out`)})):e.addEventListener("loadend",()=>{t(e.responseText,e)}))}_sendRequest(e,t,o){return this._registerOnLoaded(e,o),e.send(t),e}_getContentType(e,t){return e instanceof FormData&&(t=!1),t}_createPreparedRequest(e,t,o){return this._request=new XMLHttpRequest,this._request.open(e,t),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),o&&this._request.setRequestHeader("Content-type",o),this._request}}},156(e){var t=function(e){var t;return!!e&&"object"==typeof e&&"[object RegExp]"!==(t=Object.prototype.toString.call(e))&&"[object Date]"!==t&&e.$$typeof!==o},o="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a(Array.isArray(e)?[]:{},e,t):e}function s(e,t,o){return e.concat(t).map(function(e){return i(e,o)})}function n(e){return Object.keys(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[])}function r(e,t){try{return t in e}catch(e){return!1}}function a(e,o,l){(l=l||{}).arrayMerge=l.arrayMerge||s,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=i;var d,c,h=Array.isArray(o);return h!==Array.isArray(e)?i(o,l):h?l.arrayMerge(e,o,l):(c={},(d=l).isMergeableObject(e)&&n(e).forEach(function(t){c[t]=i(e[t],d)}),n(o).forEach(function(t){(!r(e,t)||Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))&&(r(e,t)&&d.isMergeableObject(o[t])?c[t]=(function(e,t){if(!t.customMerge)return a;var o=t.customMerge(e);return"function"==typeof o?o:a})(t,d)(e[t],o[t],d):c[t]=i(o[t],d))}),c)}a.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,o){return a(e,o,t)},{})},e.exports=a},330(e,t,o){o.r(t),o.d(t,{default:()=>p});var i=o(156),s=o.n(i),n=o(68),r=o(908);let a="loader",l={BEFORE:"before",INNER:"inner"};class d{constructor(e,t=l.BEFORE){this.parent=e instanceof Element?e:document.body.querySelector(e),this.position=t}create(){if(!this.exists()){if(this.position===l.INNER){this._previousHTML=this.parent.innerHTML,this.parent.innerHTML=d.getTemplate();return}this.parent.insertAdjacentHTML(this._getPosition(),d.getTemplate())}}remove(){if(this.position===l.INNER){this.parent.innerHTML=this._previousHTML;return}this.parent.querySelectorAll(`.${a}`).forEach(e=>e.remove())}exists(){return this.parent.querySelectorAll(`.${a}`).length>0}_getPosition(){return this.position===l.BEFORE?"afterbegin":"beforeend"}static getTemplate(){return`<div class="${a}" role="status">
2 <span class="visually-hidden">Loading...</span> 3 </div>`}static SELECTOR_CLASS(){return a}}var c=o(592);let h=Object.freeze(new class extends d{constructor(){super(document.body)}create(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];!this.exists()&&e&&(c.Ay.create(),document.querySelector(`.${c.Ay.SELECTOR_CLASS()}`).insertAdjacentHTML("beforeend",d.getTemplate()))}remove(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];super.remove(),e&&c.Ay.remove()}});class u{static create(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];h.create(e)}static remove(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];h.remove(e)}}class p extends r.default{static #e=this.options=s()(r.default.options,{componentPosition:"",switchCountryIdParamName:"switch-country-id",switchDoneParamName:"switch-done"});init(){this._client=new n.A(window.accessKey,window.contextToken),this.PluginManager=window.PluginManager,"ajax"===this.options.integrationType?(document.addEventListener("updateShopSwitchHeader",()=>{"top-bar"===this.options.componentPosition&&(this.removeHeaderTopBar(),this.requestHeaderTopBar())},{once:!0}),"top-bar"===this.options.componentPosition&&this.requestHeaderTopBar()):(this.initHeader(),document.addEventListener("updateShopSwitchHeader",e=>{this.updateActiveCountry(e.detail.countryName,e.detail.countryIso.toLowerCase())},{once:!0}))}requestHeaderTopBar(){let e={};this.options.componentPosition&&(e.componentPosition="top-bar"),this._client.post(this.options.url,JSON.stringify(e),this.insertHeaderTopBar.bind(this))}removeHeaderTopBar(){let e=document.getElementById("acris-shop-switch-header-ajax-top-bar");e&&(e.innerHTML="")}insertHeaderTopBar(e){let t=document.getElementById("acris-shop-switch-header-ajax-top-bar");if(t){let o=new DOMParser().parseFromString(e,"text/html");t.innerHTML=o.body.innerHTML,this.initHeader(),this.PluginManager.initializePlugins()}}requestHeaderOffcanvas(){let e={};this.options.componentPosition&&(e.componentPosition="offcanvas"),this._client.post(this.options.url,JSON.stringify(e),this.insertHeaderOffcanvas.bind(this))}removeHeaderOffCanvas(){let e=document.getElementById("acris-shop-switch-header-ajax-offcanvas");e&&(e.innerHTML="")}insertHeaderOffcanvas(e){let t=document.getElementById("acris-shop-switch-header-ajax-offcanvas");if(t){let o=new DOMParser().parseFromString(e,"text/html");t.innerHTML=o.body.innerHTML,this.initHeader(),this.PluginManager.initializePlugins()}}initHeader(){"ajax"===this.options.integrationType?this.headerContainer=document.getElementById("acris-shop-switch-header-ajax-top-bar"):this.headerContainer=document.getElementById("acris-shop-switch-header-direct-top-bar"),this.activeHeaderSpan=document.getElementById("shop-switch-header-active-country-name-top-bar"),this.activeHeaderFlag=document.getElementById("shop-switch-header-active-country-flag-top-bar"),this.activeHeaderSpansOffcanvas=document.querySelectorAll(".offcanvas-nav-text"),this.headerContainer&&"top-bar"===this.options.componentPosition?(this.options.currentDomainUrl=this.headerContainer.dataset.currentdomainurl,this.options.modalCloseType=this.headerContainer.dataset.currentmodalclosetype,this.options.externalDomains=this.collectExternalDomains(this.headerContainer.dataset.externaldomains)):(this.options.currentDomainUrl="",this.options.modalCloseType="",this.options.externalDomains=""),this.headerContainer&&"top-bar"===this.options.componentPosition&&this.headerContainer.addEventListener("click",this._onChangeCountrySelectHeader.bind(this),!0)}_getDataAttr(e,t){if(e)for(let o of[t,t.toLowerCase(),t.replace(/([A-Z])/g,"-$1").toLowerCase(),t.replace(/([A-Z])/g,e=>
3e.toLowerCase())]){let t=o.split("-").map((e,t)=>0===t?e:e.charAt(0).toUpperCase()+e.slice(1)).join("");if(e.dataset&&Object.prototype.hasOwnProperty.call(e.dataset,t))return e.dataset[t];if(e.hasAttribute("data-"+o))return e.getAttribute("data-"+o)}}_onChangeCountrySelectHeader(e){let t=e.target,o=t.closest&&t.closest(".top-bar-list-item button.dropdown-item"),i="INPUT"===t.nodeName?t:null;if(o)this.selectedElement=o;else{if(!i)return;this.selectedElement=i}this.selectedElement.dataset,this._getDataAttr(this.selectedElement,"domainCountryPosition")===this.options.componentPosition&&u.create()}getSelectedCountryId(){if(this.selectedElement)return this._getDataAttr(this.selectedElement,"countryid")}updateActiveCountry(e,t){if(this.activeHeaderSpan&&e&&(this.activeHeaderSpan.textContent=e),this.activeHeaderFlag&&t){let e=this.activeHeaderFlag.classList,o="";for(let t=0;t<e.length;t++)if(e[t].startsWith("country-")){o=e[t].split("-")[1];break}o&&o!==t?(e.replace("country-"+o,"country-"+t),e.replace("language-"+o,"language-"+t)):o||(e.contains("country-"+t)||e.add("country-"+t),e.contains("language-"+t)||e.add("language-"+t))}}collectExternalDomains(e){if(e)try{return JSON.parse(e)}catch(e){}return[]}}},592(e,t,o){o.d(t,{Kq:()=>a,Ay:()=>h});
3class i{static isTouchDevice(){return"ontouchstart"in document.documentElement}static isIOSDevice(){return i.isIPhoneDevice()||i.isIPadDevice()}static isNativeWindowsBrowser(){return i.isIEBrowser()||i.isEdgeBrowser()}static isIPhoneDevice(){return!!navigator.userAgent.match(/iPhone/i)}static isIPadDevice(){return!!navigator.userAgent.match(/iPad/i)}static isIEBrowser(){return -1!==navigator.userAgent.toLowerCase().indexOf("msie")||!!navigator.userAgent.match(/Trident.*rv:\d+\./)}static isEdgeBrowser(){return!!navigator.userAgent.match(/Edge\/\d+/i)}static getList(){return{"is-touch":i.isTouchDevice(),"is-ios":i.isIOSDevice(),"is-native-windows":i.isNativeWindowsBrowser(),"is-iphone":i.isIPhoneDevice(),"is-ipad":i.isIPadDevice(),"is-ie":i.isIEBrowser(),"is-edge":i.isEdgeBrowser()}}}let s="modal-backdrop",n="modal-backdrop-open",r="no-scroll",a=350,l={ON_CLICK:"backdrop/onclick"};class d{constructor(){return d.instance||(d.instance=this),d.instance}create(e){this._removeExistingBackdrops(),document.body.insertAdjacentHTML("beforeend",this._getTemplate());let t=document.body.lastChild;document.documentElement.classList.add(r),setTimeout(function(){t.classList.add(n),"function"==typeof e&&e()},75),this._dispatchEvents()}remove(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a;this._getBackdrops().forEach(e=>e.classList.remove(n)),setTimeout(this._removeExistingBackdrops.bind(this),e),document.documentElement.classList.remove(r)}_dispatchEvents(){let e=i.isTouchDevice()?"touchstart":"click";document.addEventListener(e,function(e){e.target.classList.contains(s)&&document.dispatchEvent(new CustomEvent(l.ON_CLICK))})}_getBackdrops(){return document.querySelectorAll(`.${s}`)}_removeExistingBackdrops(){!1!==this._exists()&&this._getBackdrops().forEach(e=>e.remove())}_exists(){return document.querySelectorAll(`.${s}`).length>0}_getTemplate(){return`<div class="${s}"></div>`}}let c=Object.freeze(new d);class h{static create(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;c.create(e)}static remove(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a;c.remove(e)}static SELECTOR_CLASS(){return s}}},707(e,t,o){o.d(t,{A:()=>i});class i{static ucFirst(e){return e.charAt(0).toUpperCase()+e.slice(1)}static lcFirst(e){return e.charAt(0).toLowerCase()+e.slice(1)}static toDashCase(e){return e.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(e,t){let o=i.toUpperCamelCase(e,t);return i.lcFirst(o)}static toUpperCamelCase(e,t){return t?e.split(t).map(e=>i.ucFirst(e.toLowerCase())).join(""):i.ucFirst(e.toLowerCase())}static parsePrimitive(e){try{return/^\d+(.|,)\d+$/.test(e)&&(e=e.replace(",",".")),JSON.parse(e)}catch(t){return e.toString()}}}},795(e,t,o){o.d(t,{A:()=>s});var i=o(707);class s{static isNode(e){return"object"==typeof e&&null!==e&&(e===document||e===window||e instanceof Node)}static hasAttribute(e,t){if(!s.isNode(e))throw Error("The element must be a valid HTML Node!");return"function"==typeof e.hasAttribute&&e.hasAttribute(t)}static getAttribute(e,t){let o=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(o&&!1===s.hasAttribute(e,t))throw Error(`The required property "${t}" does not exist!`);if("function"!=typeof e.getAttribute){if(o)throw Error("This node doesn't support the getAttribute function!");return}return e.getAttribute(t)}static getDataAttribute(e,t){let o=!(arguments.length>2)||void 0===arguments[2]||arguments[2],n=t.replace(/^data(|-)/,""),r=i.A.toLowerCamelCase(n,"-");if(!s.isNode(e)){if(o)throw Error("The passed node is not a valid HTML Node!");return}if(void 0===e.dataset){if(o)throw Error("This node doesn't support the dataset attribute!");return}let a=e.dataset[r];if(void 0===a){if(o)throw Error(`The required data attribute "${t}" does not exist on ${e}!`);return a}return i.A.parsePrimitive(a)}static querySelector(e,t){let o=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(o&&!s.isNode(e))throw Error("The parent node is not a valid HTML Node!");let i=e.querySelector(t)||!1;if(o&&!1===i)throw Error(`The required element "${t}" does not exist in parent node!`);return i}static querySelectorAll(e,t){let o=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(o&&!s.isNode(e))throw Error("The parent node is not a valid HTML Node!");let i=e.querySelectorAll(t);if(0===i.length&&(i=!1),o&&!1===i)throw Error(`At least one item of "${t}" must exist in parent node!`);return i}static getFocusableElements(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body,t=` 4 input:not([tabindex^="-"]):not([disabled]):not([type="hidden"]), 5 select:not([tabindex^="-"]):not([disabled]), 6 textarea:not([tabindex^="-"]):not([disabled]), 7 button:not([tabindex^="-"]):not([disabled]), 8 a[href]:not([tabindex^="-"]):not([disabled]),
9 [tabindex]:not([tabindex^="-"]):not([disabled]) 10 `;return e.querySelectorAll(t)}static getFirstFocusableElement(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return this.getFocusableElements(e)[0]}static getLastFocusableElement(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=this.getFocusableElements(e);return t[t.length-1]}}},908(e,t,o){o.r(t),o.d(t,{default:()=>c});var i=o(68),s=o(795);class n{static isSupported(){return"undefined"!==document.cookie}static setItem(e,t,o){if(null==e)throw Error("You must specify a key to set a cookie");let i=new Date;i.setTime(i.getTime()+864e5*o);let s="";"https:"===location.protocol&&(s="secure"),document.cookie=`${e}=${t};expires=${i.toUTCString()};path=/;sameSite=lax;${s}`}static getItem(e){if(!e)return!1;let t=e+"=",o=document.cookie.split(";");for(let e=0;e<o.length;e++){let i=o[e];for(;" "===i.charAt(0);)i=i.substring(1);if(0===i.indexOf(t))return i.substring(t.length,i.length)}return!1}static removeItem(e){document.cookie=`${e}= ; expires = Thu, 01 Jan 1970 00:00:00 GMT;path=/`}static key(){return""}static clear(){}}var r=o(592);let a="js-pseudo-modal",l="js-pseudo-modal-template-root-element";class d{constructor(e,t=!0,o=".js-pseudo-modal-template",i=".js-pseudo-modal-template-content-element",s=".js-pseudo-modal-template-title-element"){this._content=e,this._useBackdrop=t,this._templateSelector=o,this._templateContentSelector=i,this._templateTitleSelector=s}open(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.Kq;this._hideExistingModal(),this._create(),setTimeout(this._open.bind(this,e),t)}close(){let e=this.getModal();this._modalInstance=bootstrap.Modal.getInstance(e),this._modalInstance.hide()}getModal(){return this._modal||this._create(),this._modal}updatePosition(){this._modalInstance.handleUpdate()}updateContent(e,t){this._content=e,this._setModalContent(e),this.updatePosition(),"function"==typeof t&&t.bind(this)()}_hideExistingModal(){try{let e=document.querySelector(`.${a} .modal`);if(!e)return;let t=bootstrap.Modal.getInstance(e);if(!t)return;t.hide(),window.focusHandler._removeFocusTrapGuard()}catch(e){console.warn(`[PseudoModalUtil] Unable to hide existing pseudo modal before opening pseudo modal: ${e.message}`)}}_open(e){this.getModal(),this._modal.addEventListener("hidden.bs.modal",this._modalWrapper.remove),this._modal.addEventListener("shown.bs.modal",e),this._modal.addEventListener("hidden.bs.modal",()=>window.focusHandler._removeFocusTrapGuard()),this._modal.addEventListener("hide.bs.modal",()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur()}),this._modalInstance.show(),window.focusHandler._addFocusTrapGuard(this._modalWrapper)}_create(){this._modalMarkupEl=document.querySelector(this._templateSelector),this._createModalWrapper(),this._modalWrapper.innerHTML=this._content,this._modal=this._createModalMarkup(),this._modalInstance=new bootstrap.Modal(this._modal,{backdrop:this._useBackdrop}),document.body.insertAdjacentElement("beforeend",this._modalWrapper)}_createModalWrapper(){this._modalWrapper=document.querySelector(`.${a}`),this._modalWrapper||(this._modalWrapper=document.createElement("div"),this._modalWrapper.classList.add(a))}_createModalMarkup(){let e=this._modalWrapper.querySelector(".modal");if(e)return e;let t=this._modalWrapper.innerHTML;return this._modalWrapper.innerHTML=this._modalMarkupEl.innerHTML,this._setModalContent(t),this._modalWrapper.querySelector(".modal")}_setModalTitle(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";try{this._modalWrapper.querySelector(this._templateTitleSelector).innerHTML=e}catch(e){}}_setModalContent(e){let t=this._modalWrapper.querySelector(this._templateContentSelector);t.innerHTML=e;let o=t.querySelector(`.${l}`);if(o){this._modalWrapper.querySelector(`.${l}`).replaceChildren(o);return}try{let e=t.querySelector(this._templateTitleSelector);e&&(this._setModalTitle(e.innerHTML),e.parentNode.removeChild(e))}catch(e){}}}class c extends window.PluginBaseClass{static #e=this.options={cookieName:"acris_shop_switch_checked",url:"",modalClass:"acris-s
10hop-switch-modal",modalContentContainerSelector:".acris-shop-switch-modal-content",submitButtonSelector:".acris-shop-switch-submit-btn",countrySelectSelector:".acris-shop-switch-country-select",languageSelectSelector:".acris-shop-switch-language-select",modalCloseButtonSelector:".only-close",directRedirectLinkSelector:".acris-shop-switch-direct-url",backdropSelector:".modal-backdrop",saveConfigurationUrl:"",modalCloseType:"only_close",currentDomainUrl:"",switchCountryIdParamName:"switch-country-id",switchDoneParamName:"switch-done",externalDomains:[],integrationType:"direct",currentDomainId:"",reloadPage:"",routeParams:[],route:"",loadImmediately:!0,modalId:"acrisShopSwitchModal"};init(){(this._client=new i.A(window.accessKey,window.contextToken),this.PluginManager=window.PluginManager,"ajax"===this.options.integrationType)?!1===this.isCookieSet(this.options.currentDomainId,this.options.cookieName)&&this.checkShopSwitchByAjaxRequest():(this.modal=this.el,this.initModal(),!1!==this.options.loadImmediately&&this.openModal())}isCookieSet(e,t){let o=n.getItem(t);return o&&-1!==o.indexOf(e)}checkShopSwitchByAjaxRequest(){this._client.get(this.options.url+"?uri="+encodeURIComponent(window.location.pathname+window.location.search)+"&route="+encodeURI(this.options.route)+"&route-params="+encodeURI(this.options.routeParams),this._onAfterGetAjaxResponse.bind(this))}_onAfterGetAjaxResponse(e){let t=this.getValidJson(e);if(!1!==t){!0===t.success&&t.redirectTo?this.setRedirect(t.redirectTo,t.currentUrl,t.countryId):!0===t.success&&!1!==t.rememberStayOnPage&&this.saveConfiguration();return}this.removeModalLoadedWithoutAjax();let o=new DOMParser().parseFromString(e,"text/html");this.backdropSettings=this.setBackdropSettings(o);let i=new d(e,this.backdropSettings);i.open(()=>{window.PluginManager.initializePlugins().then(()=>{this.modal=s.A.querySelector(document,"."+this.options.modalClass,!1),this.initModal()})});let n=i.getModal();this.options.modalClass&&n.classList.add(this.options.modalClass),this.modal=n}saveConfiguration(){this.saveConfigurationByAjaxRequest(this.options.reloadPage)}saveConfigurationByAjaxRequest(e){let t={},o=this.getSelectedCountryId();o&&(t.selectedCountryId=o),this._client.post(this.options.saveConfigurationUrl,JSON.stringify(t),t=>{("1"===e||!0===e)&&location.reload()})}getBrowserLanguage(){return navigator.language||navigator.userLanguage}initModal(){this.modal&&(this._collectModalComponents(),this._registerModalEvents(),this.hideModalCloseButton(),this._registerBackdropCleanup())}_collectModalComponents(){this.modalContentContainer=s.A.querySelector(this.modal,this.options.modalContentContainerSelector,!1),this.modalButtonClose=s.A.querySelector(this.modal,this.options.modalCloseButtonSelector,!1),this.modalBackdrop=s.A.querySelector(document,this.options.backdropSelector,!1),this.modalContentContainer?(this.options.currentDomainUrl=this.modalContentContainer.dataset.currentdomainurl,this.options.modalCloseType=this.modalContentContainer.dataset.currentmodalclosetype,this.options.reloadPage=this.modalContentContainer.dataset.currentmodalreloadpage,this.options.externalDomains=this.collectExternalDomains(this.modalContentContainer.dataset.externaldomains)):(this.options.currentDomainUrl="",this.options.modalCloseType="",this.options.reloadPage="",this.options.externalDomains=""),this.submitButton=s.A.querySelector(this.modal,this.options.submitButtonSelector,!1),this.countrySelect=s.A.querySelector(this.modal,this.options.countrySelectSelector,!1),this.languageSelect=s.A.querySelector(this.modal,this.options.languageSelectSelector,!1),this.countrySelect&&this.languageSelect&&this.onChangeCountrySelect()}_registerModalEvents(){this.submitButton&&this.submitButton.addEventListener("click",this.onSubmitSelection.bind(this)),this.countrySelect&&this.languageSelect&&this.countrySelect.addEventListener("change",this.onChangeCountrySelect.bind(this)),"close_and_switch"===this.options.modalCloseType?(this.modalButtonClose&&this.modalButtonClose.addEventListener("click",this.onSubmitSelection.bind(this)),this.modal&&this.modal.addEventListener("click",this.onClickOutsideModal.bind(this))):"close_and_remember"===this.options.modalCloseType&&(this.modalButtonClose&&this.modalButtonClose.addEventListener("click",this.onStayCurrentDomain.bind(this)),this.modal&&this.modal.addEventListener("click",this.onClickOutsideModal.bind(this)))}hideModalCloseButton(){if("disabled"===this.options.modalCloseType){let e=s.A.querySelector(this.modal,this.options.modalCloseButtonSelector,!1);e&&e.remove()}}openModal(){void 0!==this.modal&&("disabled"===this.options.modalCloseType?new bootstrap.Modal(this.modal,{backdrop:"static",keyboard:!1}).show():new bootstrap.Modal(this.modal).show(),setTimeout(()=>{let e=s.A.querySelector(document,".acris-cookie-consent.is--modal",!1);e&&(this._backdropCountBeforeShopSwitch=document.querySelectorAll(this.options.backdropSelector).length,e.style.display="none")},500))}onChangeCountrySelect(){let e=this.getDomainUrlsOfElement(this.countrySelect),t=this.getCountryIsoOfElement(this.countrySelect),o=0,i=!1;for(var s=0;s<this.languageSelect.children.length;s+=1){let n=JSON.parse(this.languageSelect.children[s].dataset.domainurls),r
10=this.languageSelect.children[s];if(""===this.getMatchOfArrays(e,n)){if(r.disabled=!0,r.style.display="none",r.selected=!1,!0===this.isSafari()){let e=document.createElement("span");e.textContent=r.textContent,e.dataset.value=r.value,e.dataset.domainurls=r.dataset.domainurls,e.dataset.languageiso=r.dataset.languageiso,r.parentNode.replaceChild(e,r)}}else if(o||(o=s),r.disabled=!1,r.style.display="block",!1===i&&(!this.languageSelect.value||r.dataset.languageiso.includes(t))&&(i=!0,r.selected=!0),"SPAN"===r.nodeName){let e=document.createElement("option");e.textContent=r.textContent,e.dataset.value=r.value,e.dataset.domainurls=r.dataset.domainurls,e.dataset.languageiso=r.dataset.languageiso,r.parentNode.replaceChild(e,r)}}this.languageSelect.value||(this.languageSelect.children[o].selected=!0)}onSubmitSelection(){let e=this.getMatchingDomain();if(this.options.currentDomainUrl===e){this.closeModal(),this.saveConfiguration();return}this.setRedirect(e,this.options.currentDomainUrl,this.getSelectedCountryId())}onStayCurrentDomain(){this.closeModal(),this.saveConfiguration()}onClickOutsideModal(e){e.target.closest("div.modal-dialog")||("close_and_switch"===this.options.modalCloseType?this.onSubmitSelection():"close_and_remember"===this.options.modalCloseType&&this.onStayCurrentDomain())}getMatchingDomain(){let e=this.getDomainUrlsOfElement(this.countrySelect),t=this.getDomainUrlsOfElement(this.languageSelect);return e&&e.length>0&&t&&t.length>0?this.getMatchOfArrays(e,t):e&&e.length>0?e[0]:t&&t.length>0?t[0]:""}getDomainUrlsOfElement(e){if(e){let t=e.options[e.selectedIndex];if(t)return JSON.parse(t.dataset.domainurls)}return[]}getCountryIsoOfElement(e){if(e){let t=e.options[e.selectedIndex];if(t)return t.dataset.countryiso}return[]}getMatchOfArrays(e,t){for(var o=0;o<e.length;o+=1)for(var i=0;i<t.length;i+=1)if(e[o]===t[i])return e[o];return""}setRedirect(e,t,o){e&&(e!==t?(e=this.addSetCountryId(e,o),window.location.replace(e)):this.saveConfiguration())}addSetCountryId(e,t){return e&&!0!==this.urlInExternalDomains(e)&&(e=e.includes("?")?e+"&"+this.options.switchDoneParamName+"=1":e+"?"+this.options.switchDoneParamName+"=1",t&&(e=e+"&"+this.options.switchCountryIdParamName+"="+t)),e}urlInExternalDomains(e){let t=this.options.externalDomains,o=!1;return t&&t.forEach(function(t){e===t&&(o=!0)}),o}_registerBackdropCleanup(){this.modal.addEventListener("hidden.bs.modal",()=>{let e=s.A.querySelector(document,".acris-cookie-consent.is--modal",!1),t=document.querySelectorAll(this.options.backdropSelector);e&&this._backdropCountBeforeShopSwitch>=1?e.style.display="":(e&&(e.style.display=""),t.forEach(e=>e.remove()),document.body.classList.remove("modal-open"),document.body.style.removeProperty("overflow"),document.body.style.removeProperty("padding-right"))})}closeModal(){bootstrap.Modal.getInstance(this.modal).hide()}getSelectedCountryId(){if(this.countrySelect&&this.countrySelect.options[this.countrySelect.selectedIndex]&&this.countrySelect.options[this.countrySelect.selectedIndex].dataset.countryid)return this.countrySelect.options[this.countrySelect.selectedIndex].dataset.countryid}getValidJson(e){let t="";try{t=JSON.parse(e)}catch(e){return!1}return t}setBackdropSettings(e){let t=s.A.querySelector(e,this.options.modalContentContainerSelector,!1);if(!t)return;let o=t.dataset.currentmodalclosetype;return!o||"disabled"!==o||"static"}collectExternalDomains(e){if(e)try{return JSON.parse(e)}catch(e){}return[]}removeModalLoadedWithoutAjax(){let e=s.A.querySelector(document,"#"+this.options.modalId,!1);e&&e.remove(),window.PluginManager.getPluginInstances("AcrisShopSwitch").forEach(e=>{e.modal=void 0})}isSafari(){let e=navigator.userAgent.toLowerCase();return e.includes("safari")&&!e.includes("chrome")&&!e.includes("android")}}}}]);
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.