PageSourceSearch

https://rumpf.net/theme/6895cf1ec02414e07d33cf4213ef1de3/js/pluszw…der.back-in-stock-reminder.plugin.2bb6ca.js

js rumpf.net collected 2026-10-04 18:07:01 UTC 17,208 bytes, 10 lines download raw bytes

1"use strict";(self.webpackChunkpluszwei_back_in_stock_reminder=self.webpackChunkpluszwei_back_in_stock_reminder||[]).push([[14472],{156(t){var e=function(t){var e;return!!t&&"object"==typeof t&&"[object RegExp]"!==(e=Object.prototype.toString.call(t))&&"[object Date]"!==e&&t.$$typeof!==i},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function r(t,e){return!1!==e.clone&&e.isMergeableObject(t)?a(Array.isArray(t)?[]:{},t,e):t}function s(t,e,i){return t.concat(e).map(function(t){return r(t,i)})}function n(t){return Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[])}function o(t,e){try{return e in t}catch(t){return!1}}function a(t,i,l){(l=l||{}).arrayMerge=l.arrayMerge||s,l.isMergeableObject=l.isMergeableObject||e,l.cloneUnlessOtherwiseSpecified=r;var c,u,h=Array.isArray(i);return h!==Array.isArray(t)?r(i,l):h?l.arrayMerge(t,i,l):(u={},(c=l).isMergeableObject(t)&&n(t).forEach(function(e){u[e]=r(t[e],c)}),n(i).forEach(function(e){(!o(t,e)||Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))&&(o(t,e)&&c.isMergeableObject(i[e])?u[e]=(function(t,e){if(!e.customMerge)return a;var i=e.customMerge(t);return"function"==typeof i?i:a})(e,c)(t[e],i[e],c):u[e]=r(i[e],c))}),u)}a.all=function(t,e){if(!Array.isArray(t))throw Error("first argument should be an array");return t.reduce(function(t,i){return a(t,i,e)},{})},t.exports=a},472(t,e,i){i.r(e),i.d(e,{default:()=>w});var r=i(737),s=i(707);class n{static isNode(t){return"object"==typeof t&&null!==t&&(t===document||t===window||t instanceof Node)}static hasAttribute(t,e){if(!n.isNode(t))throw Error("The element must be a valid HTML Node!");return"function"==typeof t.hasAttribute&&t.hasAttribute(e)}static getAttribute(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!1===n.hasAttribute(t,e))throw Error(`The required property "${e}" does not exist!`);if("function"!=typeof t.getAttribute){if(i)throw Error("This node doesn't support the getAttribute function!");return}return t.getAttribute(e)}static getDataAttribute(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],r=e.replace(/^data(|-)/,""),o=s.A.toLowerCamelCase(r,"-");if(!n.isNode(t)){if(i)throw Error("The passed node is not a valid HTML Node!");return}if(void 0===t.dataset){if(i)throw Error("This node doesn't support the dataset attribute!");return}let a=t.dataset[o];if(void 0===a){if(i)throw Error(`The required data attribute "${e}" does not exist on ${t}!`);return a}return s.A.parsePrimitive(a)}static querySelector(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!n.isNode(t))throw Error("The parent node is not a valid HTML Node!");let r=t.querySelector(e)||!1;if(i&&!1===r)throw Error(`The required element "${e}" does not exist in parent node!`);return r}static querySelectorAll(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!n.isNode(t))throw Error("The parent node is not a valid HTML Node!");let r=t.querySelectorAll(e);if(0===r.length&&(r=!1),i&&!1===r)throw Error(`At least one item of "${e}" must exist in parent node!`);return r}static getFocusableElements(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body,e=`
2            input:not([tabindex^="-"]):not([disabled]):not([type="hidden"]),
3            select:not([tabindex^="-"]):not([disabled]),
4            textarea:not([tabindex^="-"]):not([disabled]),
5            button:not([tabindex^="-"]):not([disabled]),
6            a[href]:not([tabindex^="-"]):not([disabled]),
7            [tabindex]:not([tabindex^="-"]):not([disabled])
8        `;return t.querySelectorAll(e)}static getFirstFocusableElement(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return this.getFocusableElements(t)[0]}static getLastFocusableElement(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,e=this.getFocusableElements(t);return e[e.length-1]}}let o="loader",a={BEFORE:"before",INNER:"inner"};class l{constructor(t,e=a.BEFORE){this.parent=t instanceof Element?t:document.body.querySelector(t),this.position=e}create(){if(!this.exists()){if(this.position===a.INNER){this._previousHTML=this.parent.innerHTML,this.parent.innerHTML=l.getTemplate();return}this.parent.insertAdjacentHTML(this._getPosition(),l.getTemplate())}}remove(){if(this.position===a.INNER){this.parent.innerHTML=this._previousHTML;return}this.parent.querySelectorAll(`.${o}`).forEach(t=>t.remove())}exists(){return this.parent.querySelectorAll(`.${o}`).length>0}_getPosition(){return this.position===a.BEFORE?"afterbegin":"beforeend"}static getTemplate(){return`<div class="${o}" role="status">
9                    <span class="visually-hidden">Loading...</span>
10                </div>`}static SELECTOR_CLASS(){return o}}class c{static isTouchDevice(){return"ontouchstart"in document.documentElement}static isIOSDevice(){return c.isIPhoneDevice()||c.isIPadDevice()}static isNativeWindowsBrowser(){return c.isIEBrowser()||c.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":c.isTouchDevice(),"is-ios":c.isIOSDevice(),"is-native-windows":c.isNativeWindowsBrowser(),"is-iphone":c.isIPhoneDevice(),"is-ipad":c.isIPadDevice(),"is-ie":c.isIEBrowser(),"is-edge":c.isEdgeBrowser()}}}let u="modal-backdrop",h="modal-backdrop-open",d="no-scroll",p={ON_CLICK:"backdrop/onclick"};class m{constructor(){return m.instance||(m.instance=this),m.instance}create(t){this._removeExistingBackdrops(),document.body.insertAdjacentHTML("beforeend",this._getTemplate());let e=document.body.lastChild;document.documentElement.classList.add(d),setTimeout(function(){e.classList.add(h),"function"==typeof t&&t()},75),this._dispatchEvents()}remove(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:350;this._getBackdrops().forEach(t=>t.classList.remove(h)),setTimeout(this._removeExistingBackdrops.bind(this),t),document.documentElement.classList.remove(d)}_dispatchEvents(){let t=c.isTouchDevice()?"touchstart":"click";document.addEventListener(t,function(t){t.target.classList.contains(u)&&document.dispatchEvent(new CustomEvent(p.ON_CLICK))})}_getBackdrops(){return document.querySelectorAll(`.${u}`)}_removeExistingBackdrops(){!1!==this._exists()&&this._getBackdrops().forEach(t=>t.remove())}_exists(){return document.querySelectorAll(`.${u}`).length>0}_getTemplate(){return`<div class="${u}"></div>`}}let g=Object.freeze(new m);class f{static create(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;g.create(t)}static remove(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:350;g.remove(t)}static SELECTOR_CLASS(){return u}}let b=Object.freeze(new class extends l{constructor(){super(document.body)}create(){let t=!(arguments.length>0)||void 0===arguments[0]||arguments[0];!this.exists()&&t&&(f.create(),document.querySelector(`.${f.SELECTOR_CLASS()}`).insertAdjacentHTML("beforeend",l.getTemplate()))}remove(){let t=!(arguments.length>0)||void 0===arguments[0]||arguments[0];super.remove(),t&&f.remove()}});class _{static create(){let t=!(arguments.length>0)||void 0===arguments[0]||arguments[0];b.create(t)}static remove(){let t=!(arguments.length>0)||void 0===arguments[0]||arguments[0];b.remove(t)}}class v{constructor(){this._request=null,this._errorHandlingInternal=!1}get(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",r=this._createPreparedRequest("GET",t,i);return this._sendRequest(r,null,e)}post(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";r=this._getContentType(e,r);let s=this._createPreparedRequest("POST",t,r);return this._sendRequest(s,e,i)}delete(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";r=this._getContentType(e,r);let s=this._createPreparedRequest("DELETE",t,r);return this._sendRequest(s,e,i)}patch(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";r=this._getContentType(e,r);let s=this._createPreparedRequest("PATCH",t,r);return this._sendRequest(s,e,i)}abort(){if(this._request)return this._request.abort()}setErrorHandlingInternal(t){this._errorHandlingInternal=t}_registerOnLoaded(t,e){e&&(!0===this._errorHandlingInternal?(t.addEventListener("load",()=>{e(t.responseText,t)}),t.addEventListener("abort",()=>{console.warn(`the request to ${t.responseURL} was aborted`)}),t.addEventListener("error",()=>{console.warn(`the request to ${t.responseURL} failed with status ${t.status}`)}),t.addEventListener("timeout",()=>{console.warn(`the request to ${t.responseURL} timed out`)})):t.addEventListener("loadend",()=>{e(t.responseText,t)}))}_sendRequest(t,e,i){return this._registerOnLoaded(t,i),t.send(e),t}_getContentType(t,e){return t instanceof FormData&&(e=!1),e}_createPreparedRequest(t,e,i){return this._request=new XMLHttpRequest,this._request.open(t,e),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),i&&this._request.setRequestHeader("Content-type",i),this._request}}class E{static serialize(t){let e=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if("FORM"!==t.nodeName){if(e)throw Error("The passed element is not a form!");return{}}return new FormData(t)}static serializeJson(t){let e=!(arguments.length>1)||void 0===arguments[1]||arguments[1],i=E.serialize(t,e);if(!(i instanceof FormData)&&0===Object.keys(i).length||i instanceof FormData&&0===Array.from(i.entries()).length)return{};let r={};for(let[t,e]of i.entries())r[t]=e;return r}}class y{static iterate(t,e){if(t instanceof Map||Array.isArray(t))return t.forEach(e);if(t instanceof FormData){for(var i of t.entries())e(i[1],i[0]);return}if(t instanceof NodeList)return t.forEach(e);if(t instanceof HTMLCollection)return Array.from(t).forEach(e);if(t instanceof Object)return Object.keys(t).forEach(i=>
10{e(t[i],i)});throw Error(`The element type ${typeof t} is not iterable!`)}}class w extends r.A{static #t=this.options={messageHolder:".pluszwei-back-in-stock-reminder-message-holder",submitButtonSelector:".btn-subscribe",invalidClass:"is-invalid",isLoggedIn:!1,disabledSubmitText:null};init(){if(this._getForm(),!this._form)throw Error(`No form found for the plugin: ${this.constructor.name}`);this._messageHolder=n.querySelector(this.el,this.options.messageHolder,!1),this._submitButton=n.querySelector(this.el,this.options.submitButtonSelector,!1),this._client=new v,this._captchaValidated=!1,this._isSubmitting=!1,this._hasCaptcha=this._detectCaptcha(),this._registerEvents()}_getForm(){this.el&&"FORM"===this.el.nodeName&&(this._form=this.el)}_detectCaptcha(){for(let t of["#basic-captcha-input",'[name="shopware_basic_captcha_confirm"]',".basic-captcha","[data-google-re-captcha-v2]","[data-google-re-captcha-v3]",".google-re-captcha-v2",".google-re-captcha-v3",".g-recaptcha",'input[id*="captcha"]'])if(this.el.querySelector(t))return!0;if(window.PluginManager&&window.PluginManager.getPluginInstancesFromElement){let t=t=>{let e=window.PluginManager.getPluginInstancesFromElement(t);return!!e&&(e.has("BasicCaptcha")||e.has("GoogleReCaptchaV2")||e.has("GoogleReCaptchaV3")||e.has("GoogleReCaptchaBase"))};if(t(this._form))return!0;for(let e of this._form.querySelectorAll("*"))if(t(e))return!0}return!1}_registerEvents(){this._originalSubmit||(this._originalSubmit=this._form.submit.bind(this._form),this._form.submit=this._onCaptchaValidatedSubmit.bind(this)),setTimeout(()=>{let t=this._onSubmit.bind(this);this._form.removeEventListener("submit",t),this._form.addEventListener("submit",t),this._hasCaptcha=this._detectCaptcha()},10)}_onSubmit(t){if(t.preventDefault(),this._isSubmitting)return;this._hasCaptcha=this._detectCaptcha();let e=this._form.querySelector("#basic-captcha-input")||this._form.querySelector('[name="shopware_basic_captcha_confirm"]'),i=!!e,r=e?e.value:"",s=r&&r.length>0;i&&s&&!this._captchaValidated||this._hasCaptcha&&!this._captchaValidated||!1===this._form.checkValidity()||this.sendAjaxFormSubmit()}sendAjaxFormSubmit(){if(this._isSubmitting)return;this._isSubmitting=!0,this._removeInvalidClass(),_.create();let t=n.getAttribute(this._form,"action"),e=this._getFormData();this._client.abort(),this._client.post(t,e,this._onAfterAjaxSubmit.bind(this))}_getFormData(){return E.serialize(this._form)}_onAfterAjaxSubmit(t,e){try{let i=JSON.parse(t);if(i.html&&(this._messageHolder.innerHTML=i.html),400===e.status&&i.errors&&Object.entries(i.errors).forEach(t=>{let[e,i]=t,r=n.querySelector(this.el,'[name="'+e+'"]',!1);r&&r.classList.add(this.options.invalidClass)}),200===e.status&&i.length){let t="";i.forEach(e=>{t+=e.alert}),this._messageHolder.innerHTML=t}}catch(t){}200===e.status&&(this._form.reset(),this._form.classList.remove("was-validated")),this.options.isLoggedIn&&(this._submitButton.disabled=!0,this._submitButton.innerText=this.options.disabledSubmitText),this._isSubmitting=!1,_.remove()}_removeInvalidClass(){let t=n.querySelectorAll(this.el,"."+this.options.invalidClass,!1);t&&y.iterate(t,t=>{t.classList.remove(this.options.invalidClass)})}_onCaptchaValidatedSubmit(){this._captchaValidated=!0,this.sendAjaxFormSubmit()}}},707(t,e,i){i.d(e,{A:()=>r});class r{static ucFirst(t){return t.charAt(0).toUpperCase()+t.slice(1)}static lcFirst(t){return t.charAt(0).toLowerCase()+t.slice(1)}static toDashCase(t){return t.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(t,e){let i=r.toUpperCamelCase(t,e);return r.lcFirst(i)}static toUpperCamelCase(t,e){return e?t.split(e).map(t=>r.ucFirst(t.toLowerCase())).join(""):r.ucFirst(t.toLowerCase())}static parsePrimitive(t){try{return/^\d+(.|,)\d+$/.test(t)&&(t=t.replace(",",".")),JSON.parse(t)}catch(e){return t.toString()}}}},737(t,e,i){i.d(e,{A:()=>a});var r=i(156),s=i.n(r),n=i(707);class o{constructor(t=document){this._el=t,t.$emitter=this,this._listeners=[]}publish(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=new CustomEvent(t,{detail:e,cancelable:i});return this.el.dispatchEvent(r),r}subscribe(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this,s=t.split("."),n=i.scope?e.bind(i.scope):e;if(i.once&&!0===i.once){let e=n;n=function(i){r.unsubscribe(t),e(i)}}return this.el.addEventListener(s[0],n),this.listeners.push({splitEventName:s,opts:i,cb:n}),!0}unsubscribe(t){arguments.length>1&&"function"==typeof arguments[1]&&console.warn(`[NativeEventEmitter] Unsubscribing by passing the subscriber function as a second argument is not supported. By default, all listeners for the event will be removed. Use a suffix (separated by a dot) on the event name when subscribing/unsubscribing to identify/target your specific listener only, e.g. "${t}.MyCustomPlugin"`);let e=t.split(".");return this.listeners=this.listeners.reduce((t,i)=>([...i.splitEventName].sort().toString()===e.sort().toString()?this.el.removeEventListener(i.splitEventName[0],i.cb):t.push(i),t),[]),!0}
10reset(){return this.listeners.forEach(t=>{this.el.removeEventListener(t.splitEventName[0],t.cb)}),this.listeners=[],!0}get el(){return this._el}set el(t){this._el=t}get listeners(){return this._listeners}set listeners(t){this._listeners=t}}class a{constructor(t,e={},i=!1){if(!(t instanceof Node)){console.warn(`There is no valid element given while trying to create a plugin instance for "${i}".`);return}this.el=t,this.$emitter=new o(this.el),this._pluginName=this._getPluginName(i),this.options=this._mergeOptions(e),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(){}destroy(){}_init(){this._initialized||(this.init(),this._initialized=!0)}_update(){this._initialized&&this.update()}_mergeOptions(t){let e=[this.constructor.options,this.options,t];return e.push(this._getConfigFromDataAttribute()),e.push(this._getOptionsFromDataAttribute()),s().all(e.filter(t=>t instanceof Object&&!(t instanceof Array)).map(t=>t||{}))}_getConfigFromDataAttribute(){let t={};if("function"!=typeof this.el.getAttribute)return t;let e=n.A.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${e}-config`);return i?window.PluginConfigManager.get(this._pluginName,i):t}_getOptionsFromDataAttribute(){let t={};if("function"!=typeof this.el.getAttribute)return t;let e=n.A.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${e}-options`);if(i)try{return JSON.parse(i)}catch(t){console.error(`The data attribute "data-${e}-options" could not be parsed to json: ${t.message}`)}return t}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(t){return t||(t=this.constructor.name),t}}}}]);

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.