1"use strict";(self.webpackChunkmagenta_at_aem=self.webpackChunkmagenta_at_aem||[]).push([[499],{746:(e,t,i)=>{i.d(t,{Z:()=>a});var o=i(294);function a({isLoading:e,loadingHeadline:t="Adresse wird geprüft...",loadingText:i="Bitte haben Sie etwas Geduld.",loadingIcon:a}){const n=a?`${window.location.origin}${a}`:"/etc.clientlibs/magenta_at/mms/clientlibs/clientlib-base/resources/vfc_loading-animation.gif";return o.createElement(o.Fragment,null,e&&o.createElement("div",{className:"website-loading-component"},o.createElement("div",{className:"loading"},o.createElement("div",{className:"loading-animation"},o.createElement("img",{src:n,alt:"Loading",height:"82",width:"82","aria-hidden":"true",role:"presentation"})),t&&o.createElement("h3",{dangerouslySetInnerHTML:{__html:t}}),i&&o.createElement("p",{className:"huge",dangerouslySetInnerHTML:{__html:i}}))))}},628:(e,t,i)=>{i.r(t),i.d(t,{default:()=>l});var o=i(294),a=i(745),n=i(746),s=i(75);const l=class{constructor(e,t){this.baseUseClass=t,this.attachLoadingOverlay=this.attachLoadingOverlay.bind(this),this.selector=".magat.cmp-toggle-filter-new",this.loadingSelector=".cmp-toggle-filter-new__loading-overlay",this.config={},this.xor=!1,this.vfc=!1,this.loadingReactRoot=void 0,this.scrollAnimationTimeout=void 0,this.loadingDebouncer=null,this.isLoadingRequestCompleted=!0,this.LOADING_OVERLAY_DURATION_SECONDS=2,this.log("Before initializing..."),this.init(e),this.log("After initializing."),this.log("Before attaching loading overlay"),this.attachLoadingOverlay(e),this.log("After attaching loading overlay")}log=(e,...t)=>{this.baseUseClass.isDebugLoggingOn()&&(t.length?console.log(`togglefilternew.lazy.js | ${e}`,t):console.log(`togglefilternew.lazy.js | ${e}`))};init=e=>{this.xor="true"===e.getAttribute("data-xor"),this.vfc="true"===e.getAttribute("data-vfc"),$(document).customOn("refresh",(e,t)=>{t||(t=document.body);const i=$(t).find(this.selector),o=this;i.length>0&&$(i).each((e,t)=>{$(t).is(":visible")&&o.process($(t))})}),this.process($(e))};process(e){this.log("Processing...");const t=$(e).find(">.cmp-toggle-filter-new__toggle-container>.cmp-toggle-filter-new__toggle-area button");this.config=$(e).closest(this.selector).find(">div").data("config");const i=this.config;if(t.length>0&&i&&Object.keys(i).length){this.log("Inside the IF"),$(t).off("click"),t.click(o=>{this.log("Toggle Button has been clicked!"),this.log("Disabling button until processing done"),$(o.currentTarget).prop("disabled",!0),$(o.currentTarget).toggleClass("active"),$(o.currentTarget).hasClass("active")?$(o.currentTarget).attr("aria-checked",!0):$(o.currentTarget).attr("aria-checked",!1);const a=$(o.currentTarget).closest(".cmp-toggle-filter-new__toggle-container").find(".cmp-toggle-filter-new__radio");a.length>0&&a.toggleClass("active"),this.xor&&t.each(function(e,t){$(t).hasClass("active")&&$(t).attr("id")!==$(o.currentTarget).attr("id")&&($(this).removeClass("active"),$(this).closest(".cmp-toggle-filter-new__toggle-container").find(".cmp-toggle-filter-new__radio").removeClass("active"))}),this.setMatchingVariation(e,i),window.history.pushState("",document.title,window.location.pathname+window.location.search),s.Z.trackToggleClick($(o.currentTarget).hasClass("active"),this.vfc,$(o.currentTarget).data("tag"),this.xor),this.log("Enabling button when the processing is over..."),$(o.currentTarget).prop("disabled",!1),$(o.currentTarget).focus()});const o=$(e).find(":radio");o.length>0&&($(o).off("click"),$(o).on("click",t=>{$(t.currentTarget).closest(".cmp-toggle-filter-new__radio").find(".cmp-form-options__field--radio").removeClass("active"),$(t.currentTarget).addClass("active"),this.setMatchingVariation(e,i);const o=$(t.currentTarget).closest(".cmp-toggle-filter-new__toggle-container").find("button").data("tag"),a=$(t.currentTarget).closest(".cmp-form-options__field-label").find(".cmp-form-options__field-description").text().trim();s.Z.trackToggleRadioClick(o,a)})),$(window).customOn("loggedInEvent",()=>{this.toggleButtonsForLoggedInUser(t)}),this.setInitialStateOfToggles(e,t),this.setMatchingVariation(e,i),$(e).closest(this.selector).find(".experiencefragment.xfpage").
1css("visibility","visible")}}setInitialStateOfToggles(e,t){const i=window.location.search;let o=new URLSearchParams(i).get("toggleFilter")||window.location.hash;if(o=o?.replace("#",""),null!=o&&o.length>0){const t=o.split(/[\s/]+/);$(t).each((t,i)=>{if(!i)return;i.startsWith("#")||(i=`#${i}`);const o=$(e).closest(this.selector).find(i);o.length>0&&void 0===$(o).attr("disabled")&&this.toggleButton($(o),!0,!1)})}else this.toggleButtonsForLoggedInUser($(t))}toggleButtonsForLoggedInUser(e){window.Login&&window.Login.authenticated()&&$(e).each((e,t)=>{!0===$(t).data("detectLoggedInUser")&&void 0===$(t).attr("disabled")&&this.toggleButton($(t),!0,!1)})}setMatchingVariation(e,t){this.log("Inside setMatchingVariation()"),this.updateLoadingState(!0,e);const i=this.getCurrentSelectedTags(e),o=JSON.stringify(i);this.log("selected tag successfully retrieved.");let a=null;$.each(t.variations,(e,t)=>{JSON.stringify(t)===o&&(a=e)}),this.log("After processing config's variations, the following fittingVariation has been found:",a),null===a&&(a=t.defaultVariation,this.log("Because no fittingVariation was found, default is being used:",a));const n=this;if(t.currentVariation!==a){this.log("Has been detected that current Variation is not equal to the fittingVariation");let i=`${a}.content.html`;$("html").hasClass("publish-instance")||(i+="?wcmmode=disabled"),this.updateLoadingState(!0,e),this.log("AJAX Request has been begun the work..."),$.ajax({url:i,async:!0}).done(i=>{const o=$(e).closest(n.selector).find(".experiencefragment.xfpage");o.html(i),t.currentVariation=a,$(document).trigger("refresh",[o]);const s=new Event("immediateJSLoadFinished",{bubbles:!0,cancelable:!0});document.dispatchEvent(s),o.css("visibility","visible"),this.log("AJAX Request has been completed."),this.updateLoadingState(!1,e)})}else this.updateLoadingState(!1,e)}toggleButton(e,t,i){t&&!$(e).hasClass("active")?($(e).addClass("active"),$(e).attr("aria-checked",!0)):t||($(e).removeClass("active"),$(e).attr("aria-checked",!1)),i&&$(e).attr("disabled",!0)}getCurrentSelectedTags(e){const t=[],i=e.find(".magat-toogle-btn");return $(i).each((e,i)=>{if($(i).hasClass("active")){t.push($(i).data("tag"));const e=$(i).closest(".cmp-toggle-filter-new__toggle-container").find(".cmp-toggle-filter-new__radio");e.length>0&&e.find(".radio2").hasClass("active")&&t.push($(e).data("tag"))}}),t.sort(),t}attachLoadingOverlay(e){if(!e)return this.log("Could not attach LoadingOverlay because rootElement is undefined!"),!1;if(this.loadingReactRoot)return this.log("LoadingOverlay root element already initiated."),!1;this.log("Before creating the React Root"),this.log("Root element:",e),this.log("loading overlay container",e.parentElement.querySelector(".cmp-toggle-filter-new__loading-overlay"));const t=(0,a.s)(e.parentElement.querySelector(".cmp-toggle-filter-new__loading-overlay"));return this.log("Before rendering LoadingOverlay"),t.render(o.createElement(n.Z,{loadingHeadline:"Tarife werden geladen",isLoading:!1})),this.loadingReactRoot=t,!0}updateLoadingState=(e,t)=>{if(this.log("updateLoadingState",e),void 0===this.loadingReactRoot&&!this.attachLoadingOverlay())return;const i=e=>{this.log("Re-rendering LoadingOverlay with status:",e),$(t).parent().find(this.loadingSelector).addClass(e?"shown":"hidden"),$(t).parent().find(this.loadingSelector).removeClass(e?"hidden":"shown"),this.loadingReactRoot?.render(o.createElement(n.Z,{loadingHeadline:"Tarife werden geladen",isLoading:e}))};e?(i(!0),this.loadingReactRoot&&clearTimeout(this.loadingDebouncer),this.loadingDebouncer=null,this.loadingDebouncer=setTimeout(()=>{this.isLoadingRequestCompleted&&i(!1)},1e3*this.LOADING_OVERLAY_DURATION_SECONDS)):this.isLoadingRequestCompleted=!0};tryScrollToTariffTable=e=>{this.log("Scroll to the middle of TarifTable if any exist");const t=$(e)?.closest(this.selector)?.find(".experiencefragment.xfpage");if(!t)return void this.log("Experience fragment not found!");const i=t[0];if(!i)return void this.log("tariffTableContentElement could not be found! The scroll-jump is impossible.");let o;this.log("Found tariffTableContentElement!"),this.scrollAnimationTimeout&&(this.log("Clearing scroll animation timeout"),this.scrollAnimationTimeout=void 0),this.baseUseClass?(o=this.baseUseClass.getHeaderHeight(),this.log(`Found headerHeight: ${o}`),null==o&&(o=80,this.log(`Applied default header height: ${o}`))):(o=80,this.log(`Applied default header height: ${o}`));const a=Math.round(i.getBoundingClientRect().top+document.documentElement.scrollTop-1.1*o);this.log(`Final scroll position for Y axis: ${a}`),window.scrollTo({top:a,left:window.scrollX,behavior:"smooth"})}}}}]); 2//# sourceMappingURL=/etc.clientlibs/magenta_at/mms/clientlibs/clientlib-lazy/resources/chunk-34.a15190d92c8767ce1f0f.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.