PageSourceSearch

https://www.der-gitarrenladen.de/theme/3ed075c7e2f5b0a998d35e16fb8…horizon.zen-variant-switch.plugin.31ee4a.js

js der-gitarrenladen.de collected 2026-10-06 19:00:00 UTC 2,801 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkzenitPlatformHorizon=self.webpackChunkzenitPlatformHorizon||[]).push([[32082],{2082(e,t,s){s.r(t),s.d(t,{default:()=>i});class i extends window.PluginBaseClass{static #e=this.options={url:"",productBoxSelector:".product-box",tooltipSelector:".tooltip",loaderClass:"has-element-loader",layout:"minimal",displayMode:"cover",headlineLevel:2,focusHandlerKey:"zen-variant-switch",focusHandlerKeySuffix:""};init(){this._ensureFormElement(),this._registerEvents(),this._resumeFocusState()}_ensureFormElement(){if("form"!==this.el.nodeName.toLowerCase())throw Error("This plugin can only be applied on a form element!")}_registerEvents(){this.el.addEventListener("change",e=>this._onChange(e))}_onChange(e){let t=this.el.closest(this.options.productBoxSelector);if(!t)return;let s=this._getSwitchedOptionId(e.target);if(this.$emitter.publish("onChange"),s.includes("/")){window.location.href=s;return}this._saveFocusState(e.target),t.classList.add(this.options.loaderClass),this._setNewProductBox(t,s)}_getSwitchedOptionId(e){return!!i._isFieldSerializable(e)&&e.value}static _isFieldSerializable(e){return!e.name||e.disabled||-1===["file","reset","submit","button"].indexOf(e.type)}_setNewProductBox(e,t){if(!t){e.classList.remove(this.options.loaderClass);return}let s=new URLSearchParams({productId:t,layout:this.options.layout,displayMode:this.options.displayMode,zenVariantSwitchFocusHandlerKeySuffix:this.options.focusHandlerKeySuffix});null!=this.options.headlineLevel&&s.append("zenVariantSwitchHeadlineLevel",this.options.headlineLevel);let i=`${this.options.url}?${s.toString()}`;this.$emitter.publish("beforeVariantSwitch"),fetch(i,{headers:{"X-Requested-With":"XMLHttpRequest"}}).then(e=>{if(!e.ok)throw Error(`Request failed with status ${e.status}`);return e.text()}).then(t=>{let s=document.createElement("div");s.innerHTML=t.trim();let i=s.querySelector(this.options.productBoxSelector);if(!i){e.classList.remove(this.options.loaderClass);return}document.querySelectorAll(this.options.tooltipSelector).forEach(e=>e.remove()),e.replaceWith(i),i.classList.remove(this.options.loaderClass),window.PluginManager.initializePlugins(i),this.$emitter.publish("afterVariantSwitch")}).catch(()=>{e.classList.remove(this.options.loaderClass)})}_saveFocusState(e){let t=e.name?CSS.escape(e.name):null,s=e.value?CSS.escape(e.value):null,i=CSS.escape(String(this.options.focusHandlerKeySuffix||"")),o=`${this.options.focusHandlerKey}-${this.options.focusHandlerKeySuffix}`,a=`form[data-zen-variant-switch="true"][data-zen-variant-switch-scope="${i}"] [name="${t}"][value="${s}"]`;window.focusHandler.saveFocusStatePersistent(o,a)}_resumeFocusState(){window.focusHandler.resumeFocusStatePersistent(`${this.options.focusHandlerKey}-${this.options.focusHandlerKeySuffix}`)}}}}]);

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.