PageSourceSearch

https://www.pfundskerl-xxl.de/theme/1cc102fd91eb91e11590366b786de6…inke-plugin-variant-switch.plugin.994262.js

js pfundskerl-xxl.de collected 2026-10-08 05:15:20 UTC 12,862 bytes, 3 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[56170],{68(e,t,i){i.d(t,{A:()=>s});class s{constructor(){this._request=null,this._errorHandlingInternal=!1}get(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",s=this._createPreparedRequest("GET",e,i);return this._sendRequest(s,null,t)}post(e,t,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(t,s);let r=this._createPreparedRequest("POST",e,s);return this._sendRequest(r,t,i)}delete(e,t,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(t,s);let r=this._createPreparedRequest("DELETE",e,s);return this._sendRequest(r,t,i)}patch(e,t,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(t,s);let r=this._createPreparedRequest("PATCH",e,s);return this._sendRequest(r,t,i)}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,i){return this._registerOnLoaded(e,i),e.send(t),e}_getContentType(e,t){return e instanceof FormData&&(t=!1),t}_createPreparedRequest(e,t,i){return this._request=new XMLHttpRequest,this._request.open(e,t),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),i&&this._request.setRequestHeader("Content-type",i),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!==i},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function s(e,t){return!1!==t.clone&&t.isMergeableObject(e)?o(Array.isArray(e)?[]:{},e,t):e}function r(e,t,i){return e.concat(t).map(function(e){return s(e,i)})}function n(e){return Object.keys(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[])}function a(e,t){try{return t in e}catch(e){return!1}}function o(e,i,l){(l=l||{}).arrayMerge=l.arrayMerge||r,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=s;var c,u,d=Array.isArray(i);return d!==Array.isArray(e)?s(i,l):d?l.arrayMerge(e,i,l):(u={},(c=l).isMergeableObject(e)&&n(e).forEach(function(t){u[t]=s(e[t],c)}),n(i).forEach(function(t){(!a(e,t)||Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))&&(a(e,t)&&c.isMergeableObject(i[t])?u[t]=(function(e,t){if(!t.customMerge)return o;var i=t.customMerge(e);return"function"==typeof i?i:o})(t,c)(e[t],i[t],c):u[t]=s(i[t],c))}),u)}o.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,i){return o(e,i,t)},{})},e.exports=o},170(e,t,i){i.r(t),i.d(t,{default:()=>b});var s=i(220);let r="loader",n={BEFORE:"before",INNER:"inner"};class a{constructor(e,t=n.BEFORE){this.parent=e instanceof Element?e:document.body.querySelector(e),this.position=t}create(){if(!this.exists()){if(this.position===n.INNER){this._previousHTML=this.parent.innerHTML,this.parent.innerHTML=a.getTemplate();return}this.parent.insertAdjacentHTML(this._getPosition(),a.getTemplate())}}remove(){if(this.position===n.INNER){this.parent.innerHTML=this._previousHTML;return}this.parent.querySelectorAll(`.${r}`).forEach(e=>e.remove())}exists(){return this.parent.querySelectorAll(`.${r}`).length>0}_getPosition(){return this.position===n.BEFORE?"afterbegin":"beforeend"}static getTemplate(){return`<div class="${r}" role="status">
2                    <span class="visually-hidden">Loading...</span>
3                </div>`}static SELECTOR_CLASS(){return r}}class o{static isTouchDevice(){return"ontouchstart"in document.documentElement}static isIOSDevice(){return o.isIPhoneDevice()||o.isIPadDevice()}static isNativeWindowsBrowser(){return o.isIEBrowser()||o.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":o.isTouchDevice(),"is-ios":o.isIOSDevice(),"is-native-windows":o.isNativeWindowsBrowser(),"is-iphone":o.isIPhoneDevice(),"is-ipad":o.isIPadDevice(),"is-ie"
3:o.isIEBrowser(),"is-edge":o.isEdgeBrowser()}}}let l="modal-backdrop",c="modal-backdrop-open",u="no-scroll",d={ON_CLICK:"backdrop/onclick"};class h{constructor(){return h.instance||(h.instance=this),h.instance}create(e){this._removeExistingBackdrops(),document.body.insertAdjacentHTML("beforeend",this._getTemplate());let t=document.body.lastChild;document.documentElement.classList.add(u),setTimeout(function(){t.classList.add(c),"function"==typeof e&&e()},75),this._dispatchEvents()}remove(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:350;this._getBackdrops().forEach(e=>e.classList.remove(c)),setTimeout(this._removeExistingBackdrops.bind(this),e),document.documentElement.classList.remove(u)}_dispatchEvents(){let e=o.isTouchDevice()?"touchstart":"click";document.addEventListener(e,function(e){e.target.classList.contains(l)&&document.dispatchEvent(new CustomEvent(d.ON_CLICK))})}_getBackdrops(){return document.querySelectorAll(`.${l}`)}_removeExistingBackdrops(){!1!==this._exists()&&this._getBackdrops().forEach(e=>e.remove())}_exists(){return document.querySelectorAll(`.${l}`).length>0}_getTemplate(){return`<div class="${l}"></div>`}}let p=Object.freeze(new h);class g{static create(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;p.create(e)}static remove(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:350;p.remove(e)}static SELECTOR_CLASS(){return l}}let m=Object.freeze(new class extends a{constructor(){super(document.body)}create(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];!this.exists()&&e&&(g.create(),document.querySelector(`.${g.SELECTOR_CLASS()}`).insertAdjacentHTML("beforeend",a.getTemplate()))}remove(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];super.remove(),e&&g.remove()}});class _{static create(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];m.create(e)}static remove(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];m.remove(e)}}var v=i(68);class f extends s.A{static #e=this.options={url:"",elementId:"",pageType:"",radioFieldSelector:".product-detail-configurator-option-input",selectFieldSelector:".product-detail-configurator-select-input",focusHandlerKey:"variant-switch"};init(){this._httpClient=new v.A,this._radioFields=this.el.querySelectorAll(this.options.radioFieldSelector),this._selectFields=this.el.querySelectorAll(this.options.selectFieldSelector),this._elementId=this.options.elementId,this._pageType=this.options.pageType,this._ensureFormElement(),this._preserveCurrentValues(),this._registerEvents(),this._resumeFocusState()}_ensureFormElement(){if("form"!==this.el.nodeName.toLowerCase())throw Error("This plugin can only be applied on a form element!")}_preserveCurrentValues(){this._radioFields&&this._radioFields.forEach(e=>{f._isFieldSerializable(e)&&e.dataset&&(e.dataset.variantSwitchValue=e.value)})}_registerEvents(){this.el.addEventListener("change",e=>this._onChange(e))}_onChange(e){let t=this._getSwitchedOptionId(e.target),i=this._getFormValue();this._preserveCurrentValues(),this.$emitter.publish("onChange");let s={switched:t,options:JSON.stringify(i)};if(this._elementId&&"product_detail"!==this._pageType){let e=`${this.options.url}?${new URLSearchParams({...s,elementId:this._elementId}).toString()}`;document.$emitter.publish("updateBuyWidget",{url:e,elementId:this._elementId});return}this._saveFocusState(e.target),this._redirectToVariant(s)}_getSwitchedOptionId(e){return!!f._isFieldSerializable(e)&&e.name}_getFormValue(){let e={};return this._radioFields&&this._radioFields.forEach(t=>{f._isFieldSerializable(t)&&t.checked&&(e[t.name]=t.value)}),this._selectFields&&this._selectFields.forEach(t=>{if(f._isFieldSerializable(t)){let i=[...t.options].find(e=>e.selected);e[t.name]=i.value}}),e}static _isFieldSerializable(e){return!e.name||e.disabled||-1===["file","reset","submit","button"].indexOf(e.type)}_disableFields(){this._radioFields.forEach(e=>{e.classList&&e.classList.add("disabled","disabled")})}_redirectToVariant(e){_.create(),fetch(`${this.options.url}?${new URLSearchParams(e).toString()}`,{headers:{"X-Requested-With":"XMLHttpRequest"}}).then(e=>e.json()).then(e=>window.location.replace(e.url))}
3_saveFocusState(e){window.focusHandler.saveFocusStatePersistent(this.options.focusHandlerKey,`[id="${e.id}"]`)}_resumeFocusState(){window.focusHandler.resumeFocusStatePersistent(this.options.focusHandlerKey)}}class b extends f{init(){super.init()}_redirectToVariant(e){let t=new URLSearchParams(window.location.search);null!=t.get("navigationId")&&(e.navigationId=t.get("navigationId")),super._redirectToVariant(e)}}},220(e,t,i){i.d(t,{A:()=>o});var s=i(156),r=i.n(s),n=i(707),a=i(308);class o{constructor(e,t={},i=!1){if(!(e instanceof Node)){console.warn(`There is no valid element given while trying to create a plugin instance for "${i}".`);return}this.el=e,this.$emitter=new a.A(this.el),this._pluginName=this._getPluginName(i),this.options=this._mergeOptions(t),this._initialized=!1,this._registerInstance(),this._init()}init(){console.warn(`The "init" method for the plugin "${this._pluginName}" is not defined. The plugin will not be initialized.`)}update(){}_init(){this._initialized||(this.init(),this._initialized=!0)}_update(){this._initialized&&this.update()}_mergeOptions(e){let t=[this.constructor.options,this.options,e];return t.push(this._getConfigFromDataAttribute()),t.push(this._getOptionsFromDataAttribute()),r().all(t.filter(e=>e instanceof Object&&!(e instanceof Array)).map(e=>e||{}))}_getConfigFromDataAttribute(){let e={};if("function"!=typeof this.el.getAttribute)return e;let t=n.A.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${t}-config`);return i?window.PluginConfigManager.get(this._pluginName,i):e}_getOptionsFromDataAttribute(){let e={};if("function"!=typeof this.el.getAttribute)return e;let t=n.A.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${t}-options`);if(i)try{return JSON.parse(i)}catch(e){console.error(`The data attribute "data-${t}-options" could not be parsed to json: ${e.message}`)}return e}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(e){return e||(e=this.constructor.name),e}}},308(e,t,i){i.d(t,{A:()=>s});class s{constructor(e=document){this._el=e,e.$emitter=this,this._listeners=[]}publish(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=new CustomEvent(e,{detail:t,cancelable:i});return this.el.dispatchEvent(s),s}subscribe(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=this,r=e.split("."),n=i.scope?t.bind(i.scope):t;if(i.once&&!0===i.once){let t=n;n=function(i){s.unsubscribe(e),t(i)}}return this.el.addEventListener(r[0],n),this.listeners.push({splitEventName:r,opts:i,cb:n}),!0}unsubscribe(e){let t=e.split(".");return this.listeners=this.listeners.reduce((e,i)=>([...i.splitEventName].sort().toString()===t.sort().toString()?this.el.removeEventListener(i.splitEventName[0],i.cb):e.push(i),e),[]),!0}reset(){return this.listeners.forEach(e=>{this.el.removeEventListener(e.splitEventName[0],e.cb)}),this.listeners=[],!0}get el(){return this._el}set el(e){this._el=e}get listeners(){return this._listeners}set listeners(e){this._listeners=e}}},707(e,t,i){i.d(t,{A:()=>s});class s{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 i=s.toUpperCamelCase(e,t);return s.lcFirst(i)}static toUpperCamelCase(e,t){return t?e.split(t).map(e=>s.ucFirst(e.toLowerCase())).join(""):s.ucFirst(e.toLowerCase())}static parsePrimitive(e){try{return/^\d+(.|,)\d+$/.test(e)&&(e=e.replace(",",".")),JSON.parse(e)}catch(t){return e.toString()}}}}}]);

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.