PageSourceSearch

https://www.christopeit-sport.com/theme/7c87c10ac319988f4a55365ab1…notification.basic-captcha.plugin.e76a8a.js

js christopeit-sport.com collected 2026-10-04 12:43:13 UTC 12,870 bytes, 9 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[32458],{68(e,t,s){s.d(t,{A:()=>i});class i{constructor(){this._request=null,this._errorHandlingInternal=!1}get(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",i=this._createPreparedRequest("GET",e,s);return this._sendRequest(i,null,t)}post(e,t,s){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";i=this._getContentType(t,i);let r=this._createPreparedRequest("POST",e,i);return this._sendRequest(r,t,s)}delete(e,t,s){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";i=this._getContentType(t,i);let r=this._createPreparedRequest("DELETE",e,i);return this._sendRequest(r,t,s)}patch(e,t,s){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";i=this._getContentType(t,i);let r=this._createPreparedRequest("PATCH",e,i);return this._sendRequest(r,t,s)}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,s){return this._registerOnLoaded(e,s),e.send(t),e}_getContentType(e,t){return e instanceof FormData&&(t=!1),t}_createPreparedRequest(e,t,s){return this._request=new XMLHttpRequest,this._request.open(e,t),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),s&&this._request.setRequestHeader("Content-type",s),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!==s},s="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(e,t){return!1!==t.clone&&t.isMergeableObject(e)?o(Array.isArray(e)?[]:{},e,t):e}function r(e,t,s){return e.concat(t).map(function(e){return i(e,s)})}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,s,c){(c=c||{}).arrayMerge=c.arrayMerge||r,c.isMergeableObject=c.isMergeableObject||t,c.cloneUnlessOtherwiseSpecified=i;var l,h,u=Array.isArray(s);return u!==Array.isArray(e)?i(s,c):u?c.arrayMerge(e,s,c):(h={},(l=c).isMergeableObject(e)&&n(e).forEach(function(t){h[t]=i(e[t],l)}),n(s).forEach(function(t){(!a(e,t)||Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))&&(a(e,t)&&l.isMergeableObject(s[t])?h[t]=(function(e,t){if(!t.customMerge)return o;var s=t.customMerge(e);return"function"==typeof s?s:o})(t,l)(e[t],s[t],l):h[t]=i(s[t],l))}),h)}o.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,s){return o(e,s,t)},{})},e.exports=o},373(e,t,s){s.d(t,{A:()=>o});var i=s(156),r=s.n(i);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 s=n.toUpperCamelCase(e,t);return n.lcFirst(s)}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 a{constructor(e=document){this._el=e,e.$emitter=this,this._listeners=[]}publish(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=new CustomEvent(e,{detail:t,cancelable:s});return this.el.dispatchEvent(i),i}subscribe(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this,r=e.split("."),n=s.scope?t.bind(s.scope):t;if(s.once&&!0===s.once){let t=n;n=function(s){i.unsubscribe(e),t(s)}}return this.el.addEventListener(r[0],n),this.listeners.push({splitEventName:r,opts:s,cb:n}),!0}unsubscribe(e){let t=e.split(".");return this.listeners=this.listeners.reduce((e,s)=>([...s.splitEventName].sort().toString()===t.sort().toString()?this.el.removeEventListener(s.splitEventName[0],s.cb):e.push(s),e),[]),!0}
1reset(){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 o{constructor(e,t={},s=!1){if(!(e instanceof Node)){console.warn(`There is no valid element given while trying to create a plugin instance for "${s}".`);return}this.el=e,this.$emitter=new a(this.el),this._pluginName=this._getPluginName(s),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),s=this.el.getAttribute(`data-${t}-config`);return s?window.PluginConfigManager.get(this._pluginName,s):e}_getOptionsFromDataAttribute(){let e={};if("function"!=typeof this.el.getAttribute)return e;let t=n.toDashCase(this._pluginName),s=this.el.getAttribute(`data-${t}-options`);if(s)try{return JSON.parse(s)}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}}},458(e,t,s){s.r(t),s.d(t,{default:()=>f});var i=s(373),r=s(68);let n=Object.freeze(new class{constructor(){this._domParser=new DOMParser}replaceFromMarkup(e,t){let s=e;"string"==typeof s&&(s=this._createMarkupFromString(s)),"string"==typeof t&&(t=[t]),this._replaceSelectors(s,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,s)=>{e.innerHTML&&(t[s].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 s=e.querySelectorAll(t),i=document.querySelectorAll(t);this.replaceElement(s,i)})}_createMarkupFromString(e){return this._domParser.parseFromString(e,"text/html")}});class a{static replaceFromMarkup(e,t){n.replaceFromMarkup(e,t)}static replaceElement(e,t){return n.replaceElement(e,t)}}let o="loader",c={BEFORE:"before",INNER:"inner"};class l{constructor(e,t=c.BEFORE){this.parent=e instanceof Element?e:document.body.querySelector(e),this.position=t}create(){if(!this.exists()){if(this.position===c.INNER){this._previousHTML=this.parent.innerHTML,this.parent.innerHTML=l.getTemplate();return}this.parent.insertAdjacentHTML(this._getPosition(),l.getTemplate())}}remove(){if(this.position===c.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===c.BEFORE?"afterbegin":"beforeend"}static getTemplate(){return`<div class="${o}" role="status">
2                    <span class="visually-hidden">Loading...</span>
3                </div>`}static SELECTOR_CLASS(){return o}}let h="element-loader-backdrop";class u extends l{static create(e){e.classList.add("has-element-loader"),u.exists(e)||(u.appendLoader(e),setTimeout(()=>{let t=e.querySelector(`.${h}`);t&&t.classList.add("element-loader-backdrop-open")},1))}static remove(e){e.classList.remove("has-element-loader");let t=e.querySelector(`.${h}`);t&&t.remove()}static exists(e){return e.querySelectorAll(`.${h}`).length>0}static getTemplate(){return`
4        <div class="${h}">
5            <div class="loader" role="status">
6                <span class="visually-hidden">Loading...</span>
7            </div>
8        </div>
9        `}static appendLoader(e){e.insertAdjacentHTML("beforeend",u.getTemplate())}}class p extends i.A{static #e=this.options={router:"",captchaRefreshIconId:"#basic-captcha-content-refresh-icon",captchaImageId:"#basic-captcha-content-image",basicCaptchaInputId:"#basic-captcha-input",basicCaptchaFieldId:"#basic-captcha-field",invalidFeedbackMessage:"Incorrect input. Please try again.",formId:"",preCheckRoute:{}};init(){this._getForm(),this._form&&(window.formValidation.addErrorMessage("basicCaptcha",this.options.invalidFeedbackMessage),this.formPluginInstances=window.PluginManager.getPluginInstancesFromElement(this._form),this.createFakeInput(),this._httpClient=new r.A,this._onLoadBasicCaptcha(),this._registerEvents())}createFakeInput(){this.fakeInput=document.createElement("input"),this.fakeInput.type="text",this.fakeInput.id="shopware_basic_captcha_check",this.fakeInput.name="shopware_basic_captcha_check",this.fakeInput.required=!0,this.fakeInput.style.display="none",this.fakeInput.tabIndex=-1,this.fakeInput.ariaHidden="true",this.fakeInput.value=null,this.fakeInput.setAttribute("data-validate-hidden","true"),this.el.appendChild(this.fakeInput)}_registerEvents(){this.el.querySelector(this.options.captchaRefreshIconId).addEventListener("click",this._onLoadBasicCaptcha.bind(this)),this._form.addEventListener("submit",this.validateCaptcha.bind(this))}_onLoadBasicCaptcha(){let e=this.el.querySelector(this.options.captchaImageId);u.create(e),fetch(`${this.options.router}?formId=${this.options.formId}`,{headers:{"X-Requested-With":"XMLHttpRequest"}}).then(e=>e.text()).then(t=>{this.formValidating=!1;let s=new DOMParser().parseFromString(t,"text/html");a.replaceElement(s.querySelector(this.options.captchaImageId),e),u.remove(e)})}async validateCaptcha(e){e.preventDefault();let t=this.el.querySelector(this.options.basicCaptchaInputId),s=t.value,i=JSON.stringify({formId:this.options.formId,shopware_basic_captcha_confirm:s}),r=await fetch(this.options.preCheckRoute.path,{method:"POST",body:i,headers:{"Content-Type":"application/json"}}),n=!!(await r.json()).session;if(!n){window.formValidation.setFieldInvalid(t,["basicCaptcha"]),this.fakeInput.value=null,this._onLoadBasicCaptcha(),this._form.dispatchEvent(new CustomEvent("removeLoader"));return}this.fakeInput.value=s;let a=this._form.checkValidity();n&&a&&(this._isCmsForm()?this.formPluginInstances.get("FormCmsHandler")._submitForm():this._form.submit())}_isCmsForm(){return this.formPluginInstances.has("FormCmsHandler")}_getForm(){this.el&&"FORM"===this.el.nodeName?this._form=this.el:this._form=this.el.closest("form")}}var d=s(156),m=s.n(d);class f extends p{static #e=this.options=m()(p.options,{});async validateCaptcha(e){e.preventDefault();let t=this.el.querySelector(this.options.basicCaptchaInputId),s=t.value,i=JSON.stringify({formId:this.options.formId,shopware_basic_captcha_confirm:s}),r=await fetch(this.options.preCheckRoute.path,{method:"POST",body:i,headers:{"Content-Type":"application/json"}}),n=!!(await r.json()).session;if(!n){window.formValidation.setFieldInvalid(t,["basicCaptcha"]),this.fakeInput.value=null,this._onLoadBasicCaptcha(),this._form.dispatchEvent(new CustomEvent("removeLoader"));return}this.fakeInput.value=s;let a=this._form.checkValidity();n&&a&&(this._isCmsForm()?this.formPluginInstances.get("FormCmsHandler")._submitForm():this._isStockNotification()?this.formPluginInstances.get("StockNotificationForm")._submitForm():this._isStockAlert()?this.formPluginInstances.get("StockAlertForm")._submitForm():this._form.submit())}_isCmsForm(){return this.formPluginInstances.has("FormCmsHandler")}_isStockNotification(){return this.formPluginInstances.has("StockNotificationForm")}_isStockAlert(){return this.formPluginInstances.has("StockAlertForm")}}}}]);

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.