PageSourceSearch

https://www.weitz-porzellan.de/theme/1bf7ed9476e356c5cb0e5c62a2dd4…/weitz-wishlist.js?1790950885

js weitz-porzellan.de collected 2026-10-02 18:11:08 UTC 30,621 bytes, 22 lines download raw bytes

1(()=>{"use strict";var e={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)?a(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 o(e,t){try{return t in e}catch(e){return!1}}function a(e,i,l){(l=l||{}).arrayMerge=l.arrayMerge||r,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=s;var c,d,h=Array.isArray(i);return h!==Array.isArray(e)?s(i,l):h?l.arrayMerge(e,i,l):(d={},(c=l).isMergeableObject(e)&&n(e).forEach(function(t){d[t]=s(e[t],c)}),n(i).forEach(function(t){(!o(e,t)||Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))&&(o(e,t)&&c.isMergeableObject(i[t])?d[t]=(function(e,t){if(!t.customMerge)return a;var i=t.customMerge(e);return"function"==typeof i?i:a})(t,c)(e[t],i[t],c):d[t]=s(i[t],c))}),d)}a.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,i){return a(e,i,t)},{})},e.exports=a}},t={};function i(s){var r=t[s];if(void 0!==r)return r.exports;var n=t[s]={exports:{}};return e[s](n,n.exports,i),n.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var s in t)i.o(t,s)&&!i.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var s=i(156),r=i.n(s);class n{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=n.toUpperCamelCase(e,t);return n.lcFirst(i)}static toUpperCamelCase(e,t){return t?e.split(t).map(e=>n.ucFirst(e.toLowerCase())).join(""):n.ucFirst(e.toLowerCase())}static parsePrimitive(e){try{return/^\d+(.|,)\d+$/.test(e)&&(e=e.replace(",",".")),JSON.parse(e)}catch(t){return e.toString()}}}class o{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}}class a{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 o(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.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.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}}class l{static serialize(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if("FORM"!==e.nodeName){if(t)throw Error("The passed element is not a form!");return{}}return new FormData(e)}static serializeJson(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],i=l.serialize(e,t);if(!(i instanceof FormData)&&0===Object.keys(i).length||i instanceof FormData&&0===Array.from(i.entries()).length)return{};let s={};for(let[e,t]of i.entries())s[e]=t;return s}}class c{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)}
1abort(){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}}let d="loader",h={BEFORE:"before",INNER:"inner"};class u{constructor(e,t=h.BEFORE){this.parent=e instanceof Element?e:document.body.querySelector(e),this.position=t}create(){if(!this.exists()){if(this.position===h.INNER){this._previousHTML=this.parent.innerHTML,this.parent.innerHTML=u.getTemplate();return}this.parent.insertAdjacentHTML(this._getPosition(),u.getTemplate())}}remove(){if(this.position===h.INNER){this.parent.innerHTML=this._previousHTML;return}this.parent.querySelectorAll(`.${d}`).forEach(e=>e.remove())}exists(){return this.parent.querySelectorAll(`.${d}`).length>0}_getPosition(){return this.position===h.BEFORE?"afterbegin":"beforeend"}static getTemplate(){return`<div class="${d}" role="status">
2                    <span class="visually-hidden">Loading...</span>
3                </div>`}static SELECTOR_CLASS(){return d}}let p="element-loader-backdrop";class m extends u{static create(e){e.classList.add("has-element-loader"),m.exists(e)||(m.appendLoader(e),setTimeout(()=>{let t=e.querySelector(`.${p}`);t&&t.classList.add("element-loader-backdrop-open")},1))}static remove(e){e.classList.remove("has-element-loader");let t=e.querySelector(`.${p}`);t&&t.remove()}static exists(e){return e.querySelectorAll(`.${p}`).length>0}static getTemplate(){return`
4        <div class="${p}">
5            <div class="loader" role="status">
6                <span class="visually-hidden">Loading...</span>
7            </div>
8        </div>
9        `}static appendLoader(e){e.insertAdjacentHTML("beforeend",m.getTemplate())}}let _=Object.freeze(new class{constructor(){this._domParser=new DOMParser}replaceFromMarkup(e,t){let i=e;"string"==typeof i&&(i=this._createMarkupFromString(i)),"string"==typeof t&&(t=[t]),this._replaceSelectors(i,t)}replaceElement(e,t){return("string"==typeof e&&(e=document.querySelectorAll(e)),"string"==typeof t&&(t=document.querySelectorAll(t)),e instanceof NodeList&&t instanceof NodeList&&t.length>e.length)?(t.forEach(t=>{e.forEach(e=>{e.innerHTML&&e.className===t.className&&(t.innerHTML=e.innerHTML)})}),!0):e instanceof NodeList&&e.length?(e.forEach((e,i)=>{e.innerHTML&&(t[i].innerHTML=e.innerHTML)}),!0):t instanceof NodeList&&t.length?(t.forEach(t=>{e.innerHTML&&(t.innerHTML=e.innerHTML)}),!0):!!t&&!!e&&!!e.innerHTML&&(t.innerHTML=e.innerHTML,!0)}_replaceSelectors(e,t){t.forEach(t=>{let i=e.querySelectorAll(t),s=document.querySelectorAll(t);this.replaceElement(i,s)})}_createMarkupFromString(e){return this._domParser.parseFromString(e,"text/html")}});class g{static replaceFromMarkup(e,t){_.replaceFromMarkup(e,t)}static replaceElement(e,t){return _.replaceElement(e,t)}}class f extends a{static #e=this.options={replaceSelectors:!1,submitOnChange:!1,submitOnce:!1,redirectTo:!1,forwardTo:!1,noValidate:!1};init(){if(this.loaded=!1,this.formSubmittedByCaptcha=!1,this._getForm(),!this._form)throw Error(`No form found for the plugin: ${this.constructor.name}`);"string"==typeof this.options.replaceSelectors&&(this.options.replaceSelectors=[this.options.replaceSelectors]),this._callbacks=[],this._client=new c,this._registerEvents()}addCallback(e){if("function"!=typeof e)throw Error("The callback must be a function!");this._callbacks.push(e)}_getForm(){this.el&&"FORM"===this.el.nodeName?this._form=this.el:this._form=this.el.closest("form")}_registerEvents(){let e=this._onSubmit.bind(this);this._form.removeEventListener("submit",e),this._form.addEventListener("submit",e),this.options.submitOnChange&&Array.from(this._form.elements).forEac
9h(t=>{void 0!==t.removeEventListener&&(t.removeEventListener("change",e),t.addEventListener("change",e))})}_onSubmit(e){"submit"===e.type&&!0===e.cancelable&&e.preventDefault();let t=e.submitter||e.currentTarget;if((this.options.noValidate||t?.hasAttribute("formNoValidate")||this._form.checkValidity())&&(!this.loaded||!this.options.submitOnce)){if(this.$emitter.publish("beforeSubmit"),"change"===e.type&&Array.isArray(this.options.submitOnChange)){let t=e.currentTarget;this.options.submitOnChange.some(i=>!!t.matches(i)&&(this._fireRequest(e),!0))}else this._fireRequest(e)}}_fireRequest(e){this._createLoadingIndicators(),this.$emitter.publish("beforeSubmit"),this.formSubmittedByCaptcha||this.sendAjaxFormSubmit(e)}sendAjaxFormSubmit(e){let t=this._form.getAttribute("action"),i=this._form.getAttribute("method"),s=e?.submitter||e?.currentTarget;s?.hasAttribute("formAction")&&(t=s.getAttribute("formAction")),s?.hasAttribute("formMethod")&&(i=s.getAttribute("formMethod").toLowerCase());let r={method:"get"===i?"get":i??"post",headers:{"X-Requested-With":"XMLHttpRequest"}};"get"!==i&&(r.body=this._getFormData()),fetch(t,r).then(e=>e.text()).then(e=>this._onAfterAjaxSubmit(e)).catch(e=>{console.error("Form submission error:",e),this._removeLoadingIndicators()})}_getFormData(){let e=l.serialize(this._form);return this.options.redirectTo?e.append("redirectTo",this.options.redirectTo):this.options.forwardTo&&e.append("forwardTo",this.options.forwardTo),e}_onAfterAjaxSubmit(e){this.options.replaceSelectors&&(this._removeLoadingIndicators(),g.replaceFromMarkup(e,this.options.replaceSelectors),window.PluginManager.initializePlugins()),this._executeCallbacks(),this.loaded=!0,this.$emitter.publish("onAfterAjaxSubmit",{response:e})}_createLoadingIndicators(){this.options.replaceSelectors&&this.options.replaceSelectors.forEach(e=>{document.querySelectorAll(e).forEach(e=>{m.create(e)})}),this.$emitter.publish("createLoadingIndicators")}_removeLoadingIndicators(){this.options.replaceSelectors&&this.options.replaceSelectors.forEach(e=>{document.querySelectorAll(e).forEach(e=>{m.remove(e)})}),this.$emitter.publish("removeLoadingIndicators")}_executeCallbacks(){this._callbacks.forEach(e=>{if("function"!=typeof e)throw Error("The callback must be a function!");e.apply(this)}),this.$emitter.publish("executeCallbacks")}}class b{static isNode(e){return"object"==typeof e&&null!==e&&(e===document||e===window||e instanceof Node)}static hasAttribute(e,t){if(!b.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 i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!1===b.hasAttribute(e,t))throw Error(`The required property "${t}" does not exist!`);if("function"!=typeof e.getAttribute){if(i)throw Error("This node doesn't support the getAttribute function!");return}return e.getAttribute(t)}static getDataAttribute(e,t){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],s=t.replace(/^data(|-)/,""),r=n.toLowerCamelCase(s,"-");if(!b.isNode(e)){if(i)throw Error("The passed node is not a valid HTML Node!");return}if(void 0===e.dataset){if(i)throw Error("This node doesn't support the dataset attribute!");return}let o=e.dataset[r];if(void 0===o){if(i)throw Error(`The required data attribute "${t}" does not exist on ${e}!`);return o}return n.parsePrimitive(o)}static querySelector(e,t){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!b.isNode(e))throw Error("The parent node is not a valid HTML Node!");let s=e.querySelector(t)||!1;if(i&&!1===s)throw Error(`The required element "${t}" does not exist in parent node!`);return s}static querySelectorAll(e,t){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!b.isNode(e))throw Error("The parent node is not a valid HTML Node!");let s=e.querySelectorAll(t);if(0===s.length&&(s=!1),i&&!1===s)throw Error(`At least one item of "${t}" must exist in parent node!`);return s}static getFocusableElements(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body,t=`
10            input:not([tabindex^="-"]):not([disabled]):not([type="hidden"]),
11            select:not([tabindex^="-"]):not([disabled]),
12            textarea:not([tabindex^="-"]):not([disabled]),
13            button:not([tabindex^="-"]):not([disabled]),
14            a[href]:not([tabindex^="-"]):not([disabled]),
15            [tabindex]:not([tabindex^="-"]):not([disabled])
16        `;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]}}class v extends a{static #e=this.options={wishlistArticleSelector:".wishlist-article",updateFormSelector:".update-wishlist-article-form",removeFormSelector:".remove-wishlist-article-form",wishlistArticleAmountInputSelector:".wishlist-article-amount-input",submitEvent:"submit",changeEvent:"change"};init(){this._client=new c,this._update_forms=this.el.querySelectorAll(this.options.updateFormSelector),this._remove_forms=this.el.querySelectorAll(this.options.removeFormSelector),this._remove_forms.forEach(e=>{e.addEventListener(this.options.submitEvent,t=>{t.preventDefault();let i=b.getAttribute(e,"action");this._client.post(i,this._getFormData(e),t=>{this._onAfterRemoveForm(t,e)})})}),this._update_forms.forEach(e=>{e.addEventListener(this.options.submitEvent,e=>{e.preventDefault()}),e.querySelector(this.options.wishlistArticleAmountInputSelector).addEventListener(this.options.changeEvent,t=>{t.preventDefault();let i=b.getAttribute(e,"action");this._client.post(i,this._getFormData(e),t=>{this._onAfterUpdateForm(t,e)})})})}_onAfterUpdateForm(e,t){}_onAfterRemoveForm(e,t){JSON.parse(e).success&&t.closest(this.options.wishlistArticleSelector).remove()}_getFormData(e){return l.serialize(e)}}class S{static isTouchDevice(){return"ontouchstart"in document.documentElement}static isIOSDevice(){return S.isIPhoneDevice()||S.isIPadDevice()}static isNativeWindowsBrowser(){return S.isIEBrowser()||S.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":S.isTouchDevice(),"is-ios":S.isIOSDevice(),"is-native-windows":S.isNativeWindowsBrowser(),"is-iphone":S.isIPhoneDevice(),"is-ipad":S.isIPadDevice(),"is-ie":S.isIEBrowser(),"is-edge":S.isEdgeBrowser()}}}let y="modal-backdrop",E="modal-backdrop-open",L="no-scroll",A={ON_CLICK:"backdrop/onclick"};class C{constructor(){return C.instance||(C.instance=this),C.instance}create(e){this._removeExistingBackdrops(),document.body.insertAdjacentHTML("beforeend",this._getTemplate());let t=document.body.lastChild;document.documentElement.classList.add(L),setTimeout(function(){t.classList.add(E),"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(E)),setTimeout(this._removeExistingBackdrops.bind(this),e),document.documentElement.classList.remove(L)}_dispatchEvents(){let e=S.isTouchDevice()?"touchstart":"click";document.addEventListener(e,function(e){e.target.classList.contains(y)&&document.dispatchEvent(new CustomEvent(A.ON_CLICK))})}_getBackdrops(){return document.querySelectorAll(`.${y}`)}_removeExistingBackdrops(){!1!==this._exists()&&this._getBackdrops().forEach(e=>e.remove())}_exists(){return document.querySelectorAll(`.${y}`).length>0}_getTemplate(){return`<div class="${y}"></div>`}}Object.freeze(new C);let w="js-pseudo-modal",M="js-pseudo-modal-template-root-element";class T{constructor(e,t=!0,i=".js-pseudo-modal-template",s=".js-pseudo-modal-template-content-element",r=".js-pseudo-modal-template-title-element"){this._content=e,this._useBackdrop=t,this._templateSelector=i,this._templateContentSelector=s,this._templateTitleSelector=r}open(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:350;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(`.${w} .modal`);if(!e)return;let t=bootstrap.Modal.getInstance(e);if(!t)return;t.hide()}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("hide.bs.modal",()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur()}),this._modalInstance.show()}_create(){this._modalMarkupEl=document.querySelector(this._templateSelector),this._createModalWrapper(),this._modalWrapper.innerHTML=this._content,this._modal=this._createModalMar
16kup(),this._modalInstance=new bootstrap.Modal(this._modal,{backdrop:this._useBackdrop}),document.body.insertAdjacentElement("beforeend",this._modalWrapper)}_createModalWrapper(){this._modalWrapper=document.querySelector(`.${w}`),this._modalWrapper||(this._modalWrapper=document.createElement("div"),this._modalWrapper.classList.add(w))}_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 i=t.querySelector(`.${M}`);if(i){this._modalWrapper.querySelector(`.${M}`).replaceChildren(i);return}try{let e=t.querySelector(this._templateTitleSelector);e&&(this._setModalTitle(e.innerHTML),e.parentNode.removeChild(e))}catch(e){}}}let q="js-pseudo-modal-template-content-element";class x extends a{static #e=this.options={modalBackdrop:!0,urlAttribute:"data-url",prevUrlAttribute:"data-prev-url",modalClassAttribute:"data-modal-class",modalClass:null,centerLoadingIndicatorClass:"text-center"};init(){this._registerEvents()}_registerEvents(){this.el.removeEventListener("click",this._onClickHandleAjaxModal.bind(this)),this.el.addEventListener("click",this._onClickHandleAjaxModal.bind(this))}_onClickHandleAjaxModal(e){e.cancelable&&(e.preventDefault(),e.stopPropagation());let t=new T("",this.options.modalBackdrop);window.focusHandler.saveFocusState("ajax-modal"),this._openModal(t),t.getModal().addEventListener("hidden.bs.modal",()=>{window.focusHandler.resumeFocusState("ajax-modal")});let i=t._modal.querySelector(`.${q}`);i.classList.add(this.options.centerLoadingIndicatorClass),this._loadModalContent(t,i)}_openModal(e){let t=[this.el.getAttribute(this.options.modalClassAttribute),this.options.modalClass];e.open(this._onModalOpen.bind(this,e,t),0)}_loadModalContent(e,t){let i=new u(t);i.create();let s=this.el.getAttribute(this.options.urlAttribute);t.classList.add(this.options.centerLoadingIndicatorClass),fetch(s,{headers:{"X-Requested-With":"XMLHttpRequest"}}).then(e=>e.text()).then(s=>this._processResponse(s,i,e,t))}_processResponse(e,t,i,s){t.remove(),i.updateContent(e,this._renderBackButton.bind(this,i));let r=i.getModal();window.PluginManager.initializePluginsInParentElement(r),s.classList.remove(this.options.centerLoadingIndicatorClass)}_renderBackButton(e){let t=this.el.getAttribute(this.options.prevUrlAttribute);if(!t)return;let i=document.querySelector(".js-pseudo-modal-back-btn-template");if(!i)return;let s=i.content.cloneNode(!0);s.children.length&&(s.children[0].setAttribute("href",t),s.children[0].setAttribute("data-url",t),s.children[0].style.marginLeft="20px",e._modal.querySelector(`.${q}`).prepend(s))}_onModalOpen(e,t){let i=e.getModal();i.classList.add(...t),window.PluginManager.initializePluginsInParentElement(i),this.$emitter.publish("ajaxModalOpen",{modal:i})}constructor(...e){super(...e),this.httpClient=new c}}class F extends a{static #e=this.options={clickEvent:"click",changeEvent:"change",invalidEvent:"invalid",stepElementClass:".step-form",stepActiveClass:"is-active",btnBackClass:".btn-back",btnNextClass:".btn-next",btnSubmitClass:".btn-submit",fieldSelector:"input,select,textarea",contentType:"application/x-www-form-urlencoded",invalidClassName:"is-invalid",dynamicOptions:[{elementSelector:"[data-store-id]",inputFieldSelector:"#storeId",activeElementSelector:'[data-store-id="{0}"]'}]};init(){if("FORM"!==this.el.tagName)throw Error("You can apply step form plugin only to a form element");this._client=new c,this._steps=this.el.querySelectorAll(this.options.stepElementClass),this._setButtonState(this._getCurrentStepButton(),this._isCurrentStepValid()),this._registerEvents()}_registerEvents(){this.el.querySelectorAll(this.options.btnBackClass).forEach(e=>e.addEventListener(this.options.clickEvent,this._backButtonClick.bind(this))),this.el.querySelectorAll(this.options.btnNextClass).forEac
16h(e=>e.addEventListener(this.options.clickEvent,this._nextButtonClick.bind(this))),this.el.querySelectorAll(this.options.fieldSelector).forEach(e=>e.addEventListener(this.options.changeEvent,this._fieldChanged.bind(this))),this.el.querySelectorAll(this.options.btnSubmitClass).forEach(e=>e.addEventListener(this.options.clickEvent,this._submitButtonClick.bind(this)))}_backButtonClick(e){if(e.preventDefault(),!this._hasBackStep())return!1;this._switchSteps(this._getBackStep())}_nextButtonClick(e){return(e.preventDefault(),this._isCurrentStepValid())?!!this._hasNextStep()&&void(this._removeInvalidClassFromFields(),this._switchSteps(this._getNextStep())):(this.el.reportValidity(),!1)}_fieldChanged(e){e.preventDefault(),this._setButtonState(this._getCurrentStepButton(),this._isCurrentStepValid())}_fieldInvalid(e){return e.preventDefault(),!1}_submitButtonClick(e){if(e.preventDefault(),!this._isCurrentStepValid())return!1;this._removeInvalidClassFromFields(),this._client.post(this.el.action,new FormData(this.el),this._handleResponse.bind(this),this.options.contentType)}_handleResponse(e){let t=JSON.parse(e);if(t.success){window.location.href=t.url;return}if(this._refreshCaptcha(e),void 0!==t[0]){let e=this._getStepById("step-welcome");"invalid_captcha"===t[0].error&&(e=this._getStepById("step-customer")),this._switchSteps(e);return}let i=this._getStepById(`step-${t.step}`);this._switchSteps(i);let s=t.violations;for(let e in s){let t=s[e],i=e.replace(/^\//,"").split("/"),r=i[0];i.length>1&&(r=`${r}[${i[1]}]`);let n=this._getFieldByName(r);if(!n)continue;n.classList.add(this.options.invalidClassName);let o=this._getFeedbackContainerById(n.id);o&&(o.innerHTML=t)}}_switchSteps(e){let t=this._getCurrentStep(),i=s=>{"opacity"===s.propertyName&&(t.removeEventListener("transitionend",i),t.style.display="none",e.style.display="block",e.classList.add(this.options.stepActiveClass),this._setButtonState(this._getCurrentStepButton(),this._isCurrentStepValid()))};t.addEventListener("transitionend",i),t.classList.remove(this.options.stepActiveClass),this.options.dynamicOptions.forEach(i=>{e.querySelectorAll(i.elementSelector).forEach(e=>e.classList.add("d-none"));let s=t.querySelector(i.inputFieldSelector);if(!s)return;let r=s.value;if(!r)return;let n=e.querySelector(i.activeElementSelector.replace("{0}",r));n&&n.classList.remove("d-none")}),t.querySelectorAll(this.options.fieldSelector).forEach(t=>{let i=e.querySelector(`[data-transfer-value-name="${t.name}"]`);i&&(i.innerHTML=t.value)})}_isCurrentStepValid(){let e=!0;return this._getCurrentFields().forEach(t=>{"_grecaptcha_v3"!==t.name&&"preCheck"!==t.name&&(this._isFieldValid(t)||(e=!1))}),e}_isFieldValid(e){if(e.hasAttribute("data-validation")&&window.formValidation){let t=window.formValidation.validateField(e);if(Array.isArray(t)&&t.length>0)return!1}let t=e=>(e.preventDefault(),!1);e.addEventListener(this.options.invalidEvent,t);let i=e.checkValidity();return e.removeEventListener(this.options.invalidEvent,t),i}_setButtonState(e,t){t?e.classList.remove("disabled"):e.classList.add("disabled")}_removeInvalidClassFromFields(){this._getCurrentFields().forEach(e=>e.classList.remove(this.options.invalidClassName))}_refreshCaptcha(e){let t=this._getFieldByName("shopware_basic_captcha_confirm");t&&(t.classList.add(this.options.invalidClassName),t.value="",this.el.querySelector(".basic-captcha-content-refresh-icon").click()),this.$emitter.publish("onFormResponse",e)}_getFieldByName(e){return this.el.querySelector(`[name="${e}"]`)}_getFeedbackContainerById(e){return this.el.querySelector(`#${e}-feedback`)}_getCurrentStepButton(){return this._getCurrentStep().querySelector(`${this.options.btnSubmitClass},${this.options.btnNextClass}`)}_getCurrentFields(){return this._getCurrentStep().querySelectorAll(this.options.fieldSelector)}_getCurrentStep(){return Array.from(this._steps).filter(e=>e.classList.contains(this.options.stepActiveClass))[0]}_getCurrentStepIndex(){return Array.from(this._steps).indexOf(this._getCurrentStep())}_getStepById(e){return Array.from(this._steps).filter(t=>t.id===e)[0]}_getBackStep(){return this._steps.item(this._getCurrentStepIndex()-1)}_hasBackStep(){return null!==this._getBackStep()}_getNextStep(){return this._steps.item(this._getCurrentStepIndex()+1)}_hasNextStep(){return null!==this._getNextStep()}}class k extends a{static #e=this.options={fieldSelector:"input,select,textarea"};init(){let e=b.querySelector(document,this.el.dataset.foreignField),t=[];this.el.dataset.foreignValue&&(t=JSON.parse(this.el.dataset.foreignValue)),e.addEventListener("change",e=>{let i=!0;t.includes(e.target.value)?this.el.style.display=null:(i=!1,this.el.style.display="none"),b.querySelectorAll(this.el,this.options.fieldSelector).forEach(e
16=>{e.hasAttribute("required")&&!i?(e.removeAttribute("required"),e.dataset.required="true"):"required"in e.dataset&&i&&e.setAttribute("required","")})})}}let N=window.PluginManager;N.register("WeitzWishlist",class extends f{init(){super.init(),this._submitButton=this.el.querySelector('input[type="submit"]'),this._responseContainer=this.el.querySelector(".response-container")}_onAfterAjaxSubmit(e){super._onAfterAjaxSubmit(e),JSON.parse(e).success?(this._responseContainer.innerHTML=this._createResponse("success","Erfolgreich zur Wunschliste hinzugefügt."),this._submitButton.remove()):this._responseContainer.innerHTML=this._createResponse("danger","Fehler beim hinzugefügen zur Wunschliste.")}_createResponse(e,t){return`<div role="alert" class="alert alert-${e}">
17                    <div class="alert-content-container">
18                        <div class="alert-content">
19                            ${t}
20                        </div>
21                    </div>
22                </div>`}},"[data-weitz-wishlist]"),N.register("WishlistArticleList",v,"[data-wishlist-article-list]"),N.register("WishlistAjaxModal",class extends x{_processResponse(e,t,i,s){super._processResponse(e,t,i,s),PluginManager.initializePlugins()}},'[data-bs-toggle="wishlist-modal"][data-url]'),N.register("StepForm",F,"[data-step-form]"),N.register("ConditionField",k,"[data-condition-field]")})();

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.