PageSourceSearch

https://hexe.com.pl/theme/e1c2797a4e0e3205e30e4a0a8d884605/js/plus…der.back-in-stock-reminder.plugin.94a468.js

js hexe.com.pl collected 2026-10-03 23:15:30 UTC 16,223 bytes, 10 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[14472],{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 r(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a(Array.isArray(e)?[]:{},e,t):e}function s(e,t,i){return e.concat(t).map(function(e){return r(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||s,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=r;var c,u,h=Array.isArray(i);return h!==Array.isArray(e)?r(i,l):h?l.arrayMerge(e,i,l):(u={},(c=l).isMergeableObject(e)&&n(e).forEach(function(t){u[t]=r(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])?u[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):u[t]=r(i[t],c))}),u)}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},707:(e,t,i)=>{i.d(t,{A:()=>r});class r{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=r.toUpperCamelCase(e,t);return r.lcFirst(i)}static toUpperCamelCase(e,t){return t?e.split(t).map(e=>r.ucFirst(e.toLowerCase())).join(""):r.ucFirst(e.toLowerCase())}static parsePrimitive(e){try{return/^\d+(.|,)\d+$/.test(e)&&(e=e.replace(",",".")),JSON.parse(e)}catch(t){return e.toString()}}}},737:(e,t,i)=>{i.d(t,{A:()=>a});var r=i(156),s=i.n(r),n=i(707);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],r=new CustomEvent(e,{detail:t,cancelable:i});return this.el.dispatchEvent(r),r}subscribe(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this,s=e.split("."),n=i.scope?t.bind(i.scope):t;if(i.once&&!0===i.once){let t=n;n=function(i){r.unsubscribe(e),t(i)}}return this.el.addEventListener(s[0],n),this.listeners.push({splitEventName:s,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()),s().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}}},472:(e,t,i)=>{i.r(t),i.d(t,{default:()=>w});var r=i(737),s=i(707);
1class n{static isNode(e){return"object"==typeof e&&null!==e&&(e===document||e===window||e instanceof Node)}static hasAttribute(e,t){if(!n.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===n.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],r=t.replace(/^data(|-)/,""),o=s.A.toLowerCamelCase(r,"-");if(!n.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 a=e.dataset[o];if(void 0===a){if(i)throw Error(`The required data attribute "${t}" does not exist on ${e}!`);return a}return s.A.parsePrimitive(a)}static querySelector(e,t){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!n.isNode(e))throw Error("The parent node is not a valid HTML Node!");let r=e.querySelector(t)||!1;if(i&&!1===r)throw Error(`The required element "${t}" does not exist in parent node!`);return r}static querySelectorAll(e,t){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!n.isNode(e))throw Error("The parent node is not a valid HTML Node!");let r=e.querySelectorAll(t);if(0===r.length&&(r=!1),i&&!1===r)throw Error(`At least one item of "${t}" must exist in parent node!`);return r}static getFocusableElements(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body,t=`
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 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]}}let o="loader",a={BEFORE:"before",INNER:"inner"};class l{constructor(e,t=a.BEFORE){this.parent=e instanceof Element?e:document.body.querySelector(e),this.position=t}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(e=>e.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",m={ON_CLICK:"backdrop/onclick"};class p{constructor(){return p.instance||(p.instance=this),p.instance}create(e){this._removeExistingBackdrops(),document.body.insertAdjacentHTML("beforeend",this._getTemplate());let t=document.body.lastChild;document.documentElement.classList.add(d),setTimeout(function(){t.classList.add(h),"function"==typeof e&&e()},75),this._dispatchEvents()}remove(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:350;
10this._getBackdrops().forEach(e=>e.classList.remove(h)),setTimeout(this._removeExistingBackdrops.bind(this),e),document.documentElement.classList.remove(d)}_dispatchEvents(){let e=c.isTouchDevice()?"touchstart":"click";document.addEventListener(e,function(e){e.target.classList.contains(u)&&document.dispatchEvent(new CustomEvent(m.ON_CLICK))})}_getBackdrops(){return document.querySelectorAll(`.${u}`)}_removeExistingBackdrops(){!1!==this._exists()&&this._getBackdrops().forEach(e=>e.remove())}_exists(){return document.querySelectorAll(`.${u}`).length>0}_getTemplate(){return`<div class="${u}"></div>`}}let g=Object.freeze(new p);class f{static create(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;g.create(e)}static remove(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:350;g.remove(e)}static SELECTOR_CLASS(){return u}}let b=Object.freeze(new class extends l{constructor(){super(document.body)}create(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];!this.exists()&&e&&(f.create(),document.querySelector(`.${f.SELECTOR_CLASS()}`).insertAdjacentHTML("beforeend",l.getTemplate()))}remove(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];super.remove(),e&&f.remove()}});class _{static create(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];b.create(e)}static remove(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];b.remove(e)}}class v{constructor(){this._request=null,this._errorHandlingInternal=!1}get(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",r=this._createPreparedRequest("GET",e,i);return this._sendRequest(r,null,t)}post(e,t,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";r=this._getContentType(t,r);let s=this._createPreparedRequest("POST",e,r);return this._sendRequest(s,t,i)}delete(e,t,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";r=this._getContentType(t,r);let s=this._createPreparedRequest("DELETE",e,r);return this._sendRequest(s,t,i)}patch(e,t,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";r=this._getContentType(t,r);let s=this._createPreparedRequest("PATCH",e,r);return this._sendRequest(s,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}}class E{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=E.serialize(e,t);if(!(i instanceof FormData)&&0===Object.keys(i).length||i instanceof FormData&&0===Array.from(i.entries()).length)return{};let r={};for(let[e,t]of i.entries())r[e]=t;return r}}class y{static iterate(e,t){if(e instanceof Map||Array.isArray(e))return e.forEach(t);if(e instanceof FormData){for(var i of e.entries())t(i[1],i[0]);return}if(e instanceof NodeList)return e.forEach(t);if(e instanceof HTMLCollection)return Array.from(e).forEach(t);if(e instanceof Object)return Object.keys(e).forEach(i=>{t(e[i],i)});throw Error(`The element type ${typeof e} is not iterable!`)}}class w extends r.A{static #e=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._hasCaptcha=this._detectCaptcha(),this._registerEvents()}_getForm(){this.el&&"FORM"===this.el.nodeName&&(this._form=this.el)}
10_detectCaptcha(){let e=null;for(let t of["#basic-captcha-input",'[name="shopware_basic_captcha_confirm"]','.basic-captcha input[type="text"]','input[id*="captcha"]'])if(e=this.el.querySelector(t))break;let t=window.PluginManager&&window.PluginManager.getPluginInstancesFromElement&&window.PluginManager.getPluginInstancesFromElement(this._form).has("BasicCaptcha");return!!e||t}_registerEvents(){setTimeout(()=>{let e=this._onSubmit.bind(this);this._form.removeEventListener("submit",e),this._form.addEventListener("submit",e)},10),this._hasCaptcha&&(this._originalSubmit=this._form.submit.bind(this._form),this._form.submit=this._onCaptchaValidatedSubmit.bind(this))}_onSubmit(e){let t=this._form.querySelector("#basic-captcha-input")||this._form.querySelector('[name="shopware_basic_captcha_confirm"]'),i=!!t,r=t?t.value:"",s=r&&r.length>0;(!i||!s||this._captchaValidated)&&(e.preventDefault(),!1!==this._form.checkValidity()&&this.sendAjaxFormSubmit())}sendAjaxFormSubmit(){this._removeInvalidClass(),_.create();let e=n.getAttribute(this._form,"action"),t=this._getFormData();this._client.abort(),this._client.post(e,t,this._onAfterAjaxSubmit.bind(this))}_getFormData(){return E.serialize(this._form)}_onAfterAjaxSubmit(e,t){try{let i=JSON.parse(e);if(i.html&&(this._messageHolder.innerHTML=i.html),400===t.status&&i.errors&&Object.entries(i.errors).forEach(e=>{let[t,i]=e,r=n.querySelector(this.el,'[name="'+t+'"]',!1);r&&r.classList.add(this.options.invalidClass)}),200===t.status&&i.length){let e="";i.forEach(t=>{e+=t.alert}),this._messageHolder.innerHTML=e}}catch(e){}200===t.status&&(this._form.reset(),this._form.classList.remove("was-validated")),this.options.isLoggedIn&&(this._submitButton.disabled=!0,this._submitButton.innerText=this.options.disabledSubmitText),_.remove()}_removeInvalidClass(){let e=n.querySelectorAll(this.el,"."+this.options.invalidClass,!1);e&&y.iterate(e,e=>{e.classList.remove(this.options.invalidClass)})}_onCaptchaValidatedSubmit(){this._captchaValidated=!0,this.sendAjaxFormSubmit()}}}}]);

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.