PageSourceSearch

https://www.herbathek.com/theme/b1390251ec0a28cca5303e836ed70a01/j…der.back-in-stock-reminder.plugin.3b8441.js

js herbathek.com collected 2026-10-07 17:43:13 UTC 15,988 bytes, 1 lines download raw bytes

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

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.