1(()=>{"use strict";var e={744:e=>{var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===n}(e)}(e)},n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function o(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function i(e,t,n){return e.concat(t).map((function(e){return o(e,n)}))}function r(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function s(e,t){try{return t in e}catch(e){return!1}}function a(e,n,l){(l=l||{}).arrayMerge=l.arrayMerge||i,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=o;var c=Array.isArray(n);return c===Array.isArray(e)?c?l.arrayMerge(e,n,l):function(e,t,n){var i={};return n.isMergeableObject(e)&&r(e).forEach((function(t){i[t]=o(e[t],n)})),r(t).forEach((function(r){(function(e,t){return s(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,r)||(s(e,r)&&n.isMergeableObject(t[r])?i[r]=function(e,t){if(!t.customMerge)return a;var n=t.customMerge(e);return"function"==typeof n?n:a}(r,n)(e[r],t[r],n):i[r]=o(t[r],n))})),i}(e,n,l):o(n,l)}a.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return a(e,n,t)}),{})};var l=a;e.exports=l},988:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this._el=e,e.$emitter=this,this._listeners=[]}return e.prototype.publish=function(e,t,n){void 0===t&&(t={}),void 0===n&&(n=!1);var o=new CustomEvent(e,{detail:t,cancelable:n});return this.el.dispatchEvent(o),o},e.prototype.subscribe=function(e,t,n){void 0===n&&(n={});var o=this,i=e.split("."),r=n.scope?t.bind(n.scope):t;if(n.once&&!0===n.once){var s=r;r=function(t){o.unsubscribe(e),s(t)}}return this.el.addEventListener(i[0],r),this.listeners.push({splitEventName:i,opts:n,cb:r}),!0},e.prototype.unsubscribe=function(e){var t=this,n=e.split(".");return this.listeners=this.listeners.reduce((function(e,o){return o.splitEventName.sort().toString()===n.sort().toString()?(t.el.removeEventListener(o.splitEventName[0],o.cb),e):(e.push(o),e)}),[]),!0},e.prototype.reset=function(){var e=this;return this.listeners.forEach((function(t){e.el.removeEventListener(t.splitEventName[0],t.cb)})),this.listeners=[],!0},Object.defineProperty(e.prototype,"el",{get:function(){return this._el},set:function(e){this._el=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"listeners",{get:function(){return this._listeners},set:function(e){this._listeners=e},enumerable:!1,configurable:!0}),e}();t.default=n},512:function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=o(n(988)),r=o(n(744)),s=function(){function e(e,t,n){void 0===t&&(t={}),void 0===n&&(n=!1),this.el=e,this.$emitter=new i.default(this.el),this._pluginName=this._getPluginName(n),this.options=this._mergeOptions(t),this._initialized=!1,this._registerInstance(),this._init()}return e.prototype._init=function(){this._initialized||(this.init(),this._initialized=!0)},e.prototype._update=function(){this._initialized&&this.update()},e.prototype.update=function(){},e.prototype._registerInstance=function(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)},e.prototype._getPluginName=function(e){return!1===e?this.constructor.name:e},e.prototype._mergeOptions=function(e){var t=this._pluginName.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase(),n=this.parseJsonOrFail(t);let o="";"function"==typeof this.el.getAttribute&&(o=this.el.getAttribute("data-".concat(t,"-options"))||"");var i=[this.constructor.options,this.options,e];n&&i.push(window.PluginConfigManager.get(this._pluginName,n));try{o&&i.push(JSON.parse(o))}catch(e){throw new Error('The data attribute "data-'.concat(t,'-options" could not be parsed to json: ').concat(e.message||""))}return r.default.all(i.filter((function(e){return e instanceof Object&&!(e instanceof Array)})).map((function(e){return e||{}})))},e.prototype.parseJsonOrFail=function(e){if("function"!=typeof this.el.getAttribute)return"";const t=this.el.getAttribute("data-".concat(e,"-config"))||"";try{return JSON.parse(t)}catch(e){return t}},e}();t.default=s}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var r=t[o]={exports:{}};
1return e[o].call(r.exports,r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e=n(744),t=n.n(e);const o="application/json";class i{get(e,t=null,n=null,i=o){this.send("GET",e,null,t,n,i)}post(e,t=null,n=null,i=null,r=o){this.send("POST",e,t,n,i,r)}send(e,t,n=null,i=null,r=null,s=o){const a=new XMLHttpRequest;a.open(e,t),a.setRequestHeader("Content-Type",s),a.onload=function(){if(!i||"function"!=typeof i)return;const e=a.getResponseHeader("content-type"),t="response"in a?a.response:a.responseText;e.indexOf("application/json")>-1?i(JSON.parse(t)):i(t)},a.onerror=function(){r&&"function"==typeof i&&r()},a.send(n)}}var r=n(512),s=n.n(r);class a extends(s()){}class l extends a{static options={newCardMandateOption:null,mollieCreditCardFormClass:".mollie-components-credit-card",mollieCreditCardMandateInput:'input[name="mollieCreditCardMandate"]',mollieShouldSaveCardDetailInput:'input[name="mollieShouldSaveCardDetail"]'};init(){this.client=new i,this._fixShopUrl()}registerMandateEvents(){const{newCardMandateOption:e}=this.options;e&&(this.mollieCreditCarfFormEl=document.querySelector(".mollie-components-credit-card"),this.mollieCreditCardMandateEls=document.querySelectorAll('input[name="mollieCreditCardMandate"]'),this.mollieCreditCarfFormEl&&this.mollieCreditCardMandateEls&&this._registerRadioButtonsEvent())}_fixShopUrl(){null!=this.options.shopUrl&&"/"===this.options.shopUrl.substr(-1)&&(this.options.shopUrl=this.options.shopUrl.substr(0,this.options.shopUrl.length-1))}_registerRadioButtonsEvent(){this.onMandateInputChange(this.getMandateCheckedValue()),this.mollieCreditCardMandateEls.forEach((e=>{e.addEventListener("change",(()=>{this.onMandateInputChange(this.getMandateCheckedValue())}))}))}getMandateCheckedValue(){const{mollieCreditCardMandateInput:e}=this.options,t=document.querySelector(`${e}:checked`);return t&&t.value?t.value:null}isValidSelectedMandate(e){return e&&e!==this.options.newCardMandateOption}shouldSaveCardDetail(){const e=document.querySelector('input[name="mollieShouldSaveCardDetail"]');return!!e&&e.checked}onMandateInputChange(e){const{newCardMandateOption:t}=this.options;e!==t?null!==e&&this.mollieCreditCarfFormEl.classList.add("d-none"):this.mollieCreditCarfFormEl.classList.remove("d-none")}}class c extends l{static options=t()(l.options,{customerId:null,locale:null,profileId:null,shopUrl:null,testMode:!0});init(){super.init();const e=this;let t=null;const n=document.querySelector(this.getSelectors().mollieController);n&&n.remove();const o=document.querySelector(this.getSelectors().cardHolder),i=document.querySelector(this.getSelectors().componentsContainer),r=document.querySelector(this.getSelectors().paymentForm),s=document.querySelectorAll(this.getSelectors().radioInputs),a=document.querySelector(this.getSelectors().submitButton);i&&o&&(t=Mollie(this.options.profileId,{locale:this.options.locale,testmode:this.options.testMode})),this.createComponentsInputs(t,[this.getInputFields().cardHolder,this.getInputFields().cardNumber,this.getInputFields().expiryDate,this.getInputFields().verificationCode]),s.forEach((t=>{t.addEventListener("change",(()=>{e.showComponents()}))})),a.addEventListener("click",(n=>{n.preventDefault(),e.submitForm(n,t,r)})),this.registerMandateEvents()}getSelectors(){return{cardHolder:"#cardHolder",componentsContainer:"div.mollie-components-credit-card",creditCardRadioInput:'#confirmPaymentForm input[type="radio"].creditcard',mollieController:"div.mollie-components-controller",paymentForm:"#confirmPaymentForm",radioInputs:'#confirmPaymentForm input[type="radio"]',submitButton:'#confirmPaymentForm button[type="submit"]'}}getDefaultProperties(){return{styles:{base:{backgroundColor:"#fff",fontSize:"14px",padding:"10px 10px","::placeholder":{color:"rgba(68, 68, 68, 0.2)"}},valid:{color:"#090"},invalid:{backgroundColor:"#fff1f3"}}}}getInputFields(){return{cardHolder:{name:"cardHolder",id:"#cardHolder",errors:"cardHolderError"},cardNumber:{name:"cardNumber",id:"#cardNumber",errors:"cardNumberError"},expiryDate:{name:"expiryDate",id:"#expiryDate",errors:"expiryDateError"},verificationCode:{name:"verificationCode",id:"#verificationCode",errors:"verificationCodeError"}}}
1showComponents(){const e=document.querySelector(this.getSelectors().creditCardRadioInput),t=document.querySelector(this.getSelectors().componentsContainer);t&&(void 0===e||!1===e.checked?t.classList.add("d-none"):t.classList.remove("d-none"))}createComponentsInputs(e,t){const n=this;t.forEach(((t,o,i)=>{const r=e.createComponent(t.name,n.getDefaultProperties());r.mount(t.id),i[o][t.name]=r,r.addEventListener("change",(e=>{const n=document.getElementById(`${t.name}`),o=document.getElementById(`${t.errors}`);e.error&&e.touched?(n.classList.add("error"),o.textContent=e.error):(n.classList.remove("error"),o.textContent="")})),r.addEventListener("focus",(()=>{n.setFocus(`${t.id}`,!0)})),r.addEventListener("blur",(()=>{n.setFocus(`${t.id}`,!1)}))}))}setFocus(e,t){document.querySelector(e).classList.toggle("is-focused",t)}disableForm(){const e=document.querySelector(this.getSelectors().submitButton);e&&(e.disabled=!0)}enableForm(){const e=document.querySelector(this.getSelectors().submitButton);e&&(e.disabled=!1)}async submitForm(e,t,n){e.preventDefault();const o=this;this.disableForm();const i=document.querySelector(this.getSelectors().creditCardRadioInput);if(null!=i&&!1!==i.checked||!n||n.submit(),i&&!0===i.checked){const e=this.getMandateCheckedValue();if(this.isValidSelectedMandate(e))return void this.client.get(o.options.shopUrl+"/mollie/components/store-mandate-id/"+o.options.customerId+"/"+e,(()=>{n.submit()}),(()=>{n.submit()}),"application/json; charset=utf-8");const i=document.getElementById(`${this.getInputFields().verificationCode.errors}`);i.textContent="";const{token:r,error:s}=await t.createToken();if(s)return this.enableForm(),void(i.textContent=s.message);if(!s){let e=new URLSearchParams({shouldSaveCardDetail:this.shouldSaveCardDetail()}).toString();e&&(e=`?${e}`),this.client.get(o.options.shopUrl+"/mollie/components/store-card-token/"+o.options.customerId+"/"+r+e,(()=>{document.getElementById("cardToken").setAttribute("value",r),n.submit()}),(()=>{n.submit()}),"application/json; charset=utf-8")}}}}class d{static isTouchDevice(){return"ontouchstart"in document.documentElement}static isIOSDevice(){return d.isIPhoneDevice()||d.isIPadDevice()}static isNativeWindowsBrowser(){return d.isIEBrowser()||d.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":d.isTouchDevice(),"is-ios":d.isIOSDevice(),"is-native-windows":d.isNativeWindowsBrowser(),"is-iphone":d.isIPhoneDevice(),"is-ipad":d.isIPadDevice(),"is-ie":d.isIEBrowser(),"is-edge":d.isEdgeBrowser()}}}class u{constructor(e){this.csrf=e}isActive(){return void 0!==this.csrf&&!1!==this.csrf.enabled&&"ajax"===this.csrf.mode}}class p{constructor(e){this._document=e}getPaymentForm(){return this._document.querySelector("#changePaymentForm")}getConfirmForm(){return this._document.querySelector("#confirmOrderForm")}getSubmitButton(){let e=this._document.querySelector("#confirmFormSubmit");return null===e&&(e=this._document.querySelector('#confirmOrderForm > button[type="submit"]')),e}}class m extends l{static options=t()(l.options,{paymentId:null,customerId:null,locale:null,profileId:null,shopUrl:null,testMode:!0});init(){super.init();try{const e=new p(document);this._paymentForm=e.getPaymentForm(),this._confirmForm=e.getConfirmForm(),this._confirmFormButton=e.getSubmitButton()}catch(e){return void console.error("Mollie Credit Card components: Required HTML elements not found on this page!")}this._initializeComponentInstance(),this._registerEvents(),this.registerMandateEvents()}_initializeComponentInstance(){const e=document.querySelector(this.getSelectors().cardHolder);document.querySelector(this.getSelectors().componentsContainer)&&e&&!window.mollieComponentsObject&&(window.mollieComponentsObject=Mollie(this.options.profileId,{locale:this.options.locale,testmode:this.options.testMode}),window.mollieComponents={}),this.createComponentsInputs()}_registerEvents(){null!==this._confirmForm&&this._confirmForm.addEventListener("submit",this.submitForm.bind(this))}_reactivateFormSubmit(){this._confirmFormButton.disabled=!1;const e=this._confirmFormButton.querySelector(".loader");e&&e.remove()}getSelectors(){return{cardHolder:"#cardHolder",componentsContainer:"div.mollie-components-credit-card",credit
1CardRadioInput:'#changePaymentForm input[type="radio"]',mollieController:"div.mollie-components-controller",paymentForm:"#changePaymentForm",confirmForm:"#confirmOrderForm",confirmFormButton:'#confirmOrderForm > button[type="submit"]'}}getDefaultProperties(){return{styles:{base:{backgroundColor:"#fff",fontSize:"14px",padding:"10px 10px","::placeholder":{color:"rgba(68, 68, 68, 0.2)"}},valid:{color:"#090"},invalid:{backgroundColor:"#fff1f3"}}}}getInputFields(){return{cardHolder:{name:"cardHolder",id:"#cardHolder",errors:"cardHolderError"},cardNumber:{name:"cardNumber",id:"#cardNumber",errors:"cardNumberError"},expiryDate:{name:"expiryDate",id:"#expiryDate",errors:"expiryDateError"},verificationCode:{name:"verificationCode",id:"#verificationCode",errors:"verificationCodeError"}}}createComponentsInputs(){const e=this,t=[this.getInputFields().cardHolder,this.getInputFields().cardNumber,this.getInputFields().expiryDate,this.getInputFields().verificationCode];window.mollieComponentsObject&&t.forEach(((t,n,o)=>{const i=this._mountMollieComponent(t.id,t.name);o[n][t.name]=i,i.addEventListener("change",(e=>{const n=document.getElementById(`${t.name}`),o=document.getElementById(`${t.errors}`);e.error&&e.touched?(n.classList.add("error"),o.textContent=e.error):(n.classList.remove("error"),o.textContent="")})),i.addEventListener("focus",(()=>{e.setFocus(`${t.id}`,!0)})),i.addEventListener("blur",(()=>{e.setFocus(`${t.id}`,!1)}))}))}_mountMollieComponent(e,t){return window.mollieComponents[t]?window.mollieComponents[t].unmount():window.mollieComponents[t]=window.mollieComponentsObject.createComponent(t,this.getDefaultProperties()),window.mollieComponents[t].mount(e),window.mollieComponents[t]}setFocus(e,t){document.querySelector(e).classList.toggle("is-focused",t)}async submitForm(e){const t=this,n=this._confirmForm,o=document.querySelector(`${this.get
1Selectors().creditCardRadioInput}[value="${this.options.paymentId}"]`);if((null==o||!1===o.checked)&&this._confirmForm)return;if(o&&!1===o.checked)return;e.preventDefault();const i=this.getMandateCheckedValue();if(this.isValidSelectedMandate(i))return void this.client.get(t.options.shopUrl+"/mollie/components/store-mandate-id/"+t.options.customerId+"/"+i,(()=>{t.continueShopwareCheckout(n)}),(()=>{t.continueShopwareCheckout(n)}),"application/json; charset=utf-8");const r=document.getElementById(`${this.getInputFields().verificationCode.errors}`);r.textContent="";const{token:s,error:a}=await window.mollieComponentsObject.createToken();if(a)return r.textContent=a.message,this._reactivateFormSubmit(),void r.scrollIntoView();let l=new URLSearchParams({shouldSaveCardDetail:this.shouldSaveCardDetail()}).toString();l&&(l=`?${l}`),this.client.get(t.options.shopUrl+"/mollie/components/store-card-token/"+t.options.customerId+"/"+s+l,(function(){t.continueShopwareCheckout(n)}),(function(){t.continueShopwareCheckout(n)}),"application/json; charset=utf-8")}continueShopwareCheckout(e){if(d.isIEBrowser()){const t=function(e,t){const n=document.createElement("input");return n.type="checkbox",n.name=e,n.checked=t,n.style.display="none",n},n=document.getElementById("tos");null!=n&&e.insertAdjacentElement("beforeend",t("tos",n.checked))}new u(window.csrf).isActive()||e.submit()}}class h{APPLE_PAY_VERSION=3;constructor(){this.client=new i}create(e,t,n,o,i,r){const s=this;var a=["name","email","postalAddress"];1===o&&a.push("phone");let l=!1;null!==r&&(l=r.value);var c={countryCode:t,currencyCode:n,requiredShippingContactFields:a,supportedNetworks:["amex","maestro","masterCard","visa","vPay"],merchantCapabilities:["supports3DS"],total:{label:"",amount:0}};const d=new ApplePaySession(this.APPLE_PAY_VERSION,c);return d.onvalidatemerchant=function(e){s.client.post(i+"/mollie/apple-pay/validate",JSON.stringify({validationUrl:e.validationURL}),(t=>{if(!1===t.success)throw new Error("Validation failed for URL: "+e.validationURL);const n=JSON.parse(t.session);d.completeMerchantValidation(n)}),(()=>{d.abort()}))},d.onshippingcontactselected=function(e){var t="";void 0!==e.shippingContact.countryCode&&(t=e.shippingContact.countryCode),s.client.post(i+"/mollie/apple-pay/shipping-methods",JSON.stringify({countryCode:t}),(e=>{e.success?d.completeShippingContactSelection(ApplePaySession.STATUS_SUCCESS,e.shippingmethods,e.cart.total,e.cart.items):d.completeShippingContactSelection(ApplePaySession.STATUS_FAILURE,[],{label:"",amount:0,pending:!0},[])}),(()=>{d.abort()}))},d.onshippingmethodselected=function(e){s.client.post(i+"/mollie/apple-pay/set-shipping",JSON.stringify({identifier:e.shippingMethod.identifier}),(e=>{e.success?d.completeShippingMethodSelection(ApplePaySession.STATUS_SUCCESS,e.cart.total,e.cart.items):d.completeShippingMethodSelection(ApplePaySession.STATUS_FAILURE,{label:"",amount:0,pending:!0},[])}),(()=>{d.abort()}))},d.onpaymentauthorized=function(e){var t=e.payment.token;t=JSON.stringify(t),d.completePayment(ApplePaySession.STATUS_SUCCESS),s.finishPayment(i+"/mollie/apple-pay/start-payment",t,e.payment,l)},d.oncancel=function(){e&&s.client.post(i+"/mollie/apple-pay/restore-cart")},d}finishPayment(e,t,n,o){const i=function(e,t){const n=document.createElement("input");return n.type="hidden",n.name=e,n.value=t,n},r=document.createElement("form");r.action=e,r.method="POST";let s=n.shippingContact.addressLines[0];n.shippingContact.addressLines.length>1&&(s+=" "+n.shippingContact.addressLines[1]),r.insertAdjacentElement("beforeend",i("email",n.shippingContact.emailAddress)),r.insertAdjacentElement("beforeend",i("lastname",n.shippingContact.familyName)),r.insertAdjacentElement("beforeend",i("firstname",n.shippingContact.givenName)),r.insertAdjacentElement("beforeend",i("street",s)),r.insertAdjacentElement("beforeend",i("postalCode",n.shippingContact.postalCode)),r.insertAdjacentElement("beforeend",i("city",n.shippingContact.locality)),r.insertAdjacentElement("beforeend",i("acceptedDataProtection",o)),void 0!==n.shippingContact.phoneNumber&&n.shippingContact.phoneNumber.length>0&&r.insertAdjacentElement("beforeend",i("phone",n.shippingContact.phoneNumber)),r.insertAdjacentElement("beforeend",i("countryCode",n.shippingContact.countryCode)),r.insertAdjacentElement("beforeend",i("paymentToken",t)),document.body.insertAdjacentElement("beforeend",r),r.submit()}}class f extends a{APPLE_PAY_VERSION=3;init(){const e=this;e.client=new i;const t=window.PluginManager.getPluginList().OffCanvasCart.get("instances");t.length>0&&t[0].$emitter.subscribe("offCanvasOpened",e.initCurrentPage.bind(e));const n=document.querySelector("#productDetailPageBuyProductForm");null!==n&&(this.checkSubmitButton(n),n.addEventListener("change",(e=>{this.checkSubmitButton(e.target.closest("form#productDetailPageBuyProductForm")),this.initCurrentPage()}))),this.initCurrentPage()}initCurrentPage(){const e=this,t=document.querySelectorAll(".js-apple-pay-container"),n=document.querySelectorAll(".js-apple-pay");if(!window.ApplePaySession||!window.ApplePaySession.canMakePayments())return void(t&&t.forEach((function(e){e.style.display="none",e.classList.add("d-none")})));if(n.length<=0)return;const o=e.getShopUrl(n[0]);e.client.get(o+"/mollie/apple-pay/available",(o=>{void 0!==o.available&&!1!==o.available&&(t.forEach((function(e){e.classList.remove("d-none")}
1)),n.forEach((function(t){if(t.hasAttribute("disabled"))return t.classList.add("d-none"),void t.removeEventListener("click",e.onButtonClick);t.classList.remove("d-none"),t.removeEventListener("click",e.onButtonClick),t.addEventListener("click",e.onButtonClick)})))}))}checkSubmitButton(e){const t=e.querySelector(".btn-buy");if(null===t)return;const n=e.querySelector(".js-apple-pay");null!==n&&(n.hasAttribute("disabled")&&n.removeAttribute("disabled"),t.hasAttribute("disabled")&&n.setAttribute("disabled","disabled"))}onButtonClick(e){e.preventDefault();const t=e.target,n=t.parentNode;let o=t.getAttribute("data-shop-url");"/"===o.substr(-1)&&(o=o.substr(0,o.length-1));const i=n.querySelector('input[name="countryCode"]').value,r=n.querySelector('input[name="currency"]').value,s=n.querySelector('input[name="mode"]').value,a=parseInt(n.querySelector('input[name="withPhone"]').value),l=n.querySelector('input[name="acceptedDataProtection"]');if(n.classList.remove("was-validated"),null!==l){const e=l.checked?1:0;if(n.classList.add("was-validated"),l.classList.remove("is-invalid"),0===e)return void l.classList.add("is-invalid")}const c="productMode"===s;if(c){let e=document.querySelector("#productDetailPageBuyProductForm");null===e&&(e=t.closest(".product-box").querySelector("form"));const n=new FormData(e);n.delete("redirectTo"),n.append("isExpressCheckout","1"),fetch(e.action,{method:e.method,body:n})}(new h).create(c,i,r,a,o,l).begin()}getShopUrl(e){let t=e.getAttribute("data-shop-url");return"/"===t.substr(-1)&&(t=t.substr(0,t.length-1)),t}}class g extends a{init(){const e=this,t=this.options.hideAlways,n=this.getShopUrl();!t&&window.ApplePaySession&&window.ApplePaySession.canMakePayments()||(this.hideApplePay(".payment-method-input.applepay"),(new i).get(n+"/mollie/apple-pay/applepay-id",(t=>{e.hideApplePay("#paymentMethod"+t.id)})))}hideApplePay(e){const t=document.querySelector(e),n=this.getClosest(t,".payment-method");n&&n.classList&&n.remove()}getShopUrl(){let e=this.options.shopUrl;if(void 0===e)return"";for(;"/"===e.substr(-1);)e=e.substr(0,e.length-1);return e}getClosest(e,t){for(Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(e){const t=(this.document||this.ownerDocument).querySelectorAll(e);let n=t.length;for(;--n>=0&&t.item(n)!==this;);return n>-1});e&&e!==document;e=e.parentNode)if(e.matches(t))return e;return null}}class y extends a{static options={shopUrl:null,customerId:null,mollieMandateContainerClass:".mollie-credit-card-mandate",mollieMandateDataId:"data-mollie-credit-card-mandate-id",mollieMandateRemoveButtonClass:".mollie-credit-card-mandate-remove",mollieMandateRemoveModalButtonClass:".mollie-credit-card-mandate-remove-modal-button",mollieMandateDeleteAlertSuccessId:"#mollieCreditCardMandateDeleteSuccess",mollieMandateDeleteAlertErrorId:"#mollieCreditCardMandateDeleteError"};init(){const{shopUrl:e,customerId:t}=this.options;if(!e)throw new Error(`The "shopUrl" option for the plugin "${this._pluginName}" is not defined.`);if(!t)throw new Error(`The "customerId" option for the plugin "${this._pluginName}" is not defined.`);this.mollieMandateDeleteAlertEl=document.querySelector("#mollieCreditCardMandateDeleteSuccess"),this.mollieMandateDeleteAlertEl&&(this.mollieMandateDeleteAlertErrorEl=document.querySelector("#mollieCreditCardMandateDeleteError"),this.mollieMandateDeleteAlertErrorEl&&(this.client=new i,this.registerEvents()))}registerEvents(){const e=document.querySelectorAll(".mollie-credit-card-mandate-remove");if(!e||0===e.length)return;const t=document.querySelectorAll(".mollie-credit-card-mandate-remove-modal-button");t&&0!==t.length&&(e.forEach((e=>{e.addEventListener("click",(t=>{t.preventDefault(),this.onRemoveButtonClick(e)}))})),t.forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault(),this.onConfirmRemoveButtonClick()}))})))}onRemoveButtonClick(e){const{mollieMandateContainerClass:t,mollieMandateDataId:n}=this.options;this.currentContainerEl=e.closest(t),this.currentContainerEl&&(this.currentMandateId=this.currentContainerEl.getAttribute(n))}onConfirmRemoveButtonClick(){const{currentContainerEl:e,currentMandateId:t}=this;e&&t&&this.deleteMandate(t).then((({success:t})=>{t?(this.mollieMandateDeleteAlertErrorEl.classList.add("d-none"),this.mollieMandateDeleteAlertEl.classList.remove("d-none"),e.remove()):(this.mollieMandateDeleteAlertEl.classList.add("d-none"),this.mollieMandateDeleteAlertErrorEl.classList.remove("d-none"))}))}deleteMandate(e){const{shopUrl:t,customerId:n}=this.options;return new Promise((o=>{this.client.get(t+"/mollie/components/revoke-mandate/"+n+"/"+e,(e=>{o({success:e&&e.success})}),(()=>{o({success:!1})}),"application/json; charset=utf-8")}))}}class v extends a{_shopUrl="";_customerId="";_dropdownTerminals=null;_isModalForm=!1;_container=null;_paymentForm=null;_radioInputs=null;_posRadioInput=null;init(){this._container=document.querySelector("div.mollie-pos-terminals"),void 0!==this._container&&null!==this._container&&(this.initControls(),null!==this._paymentForm&&null!==this._dropdownTerminals&&(this.registerEvents(),this.updateDropdownVisibility(this._posRadioInput,this._container,this._dropdownTerminals),this.updateTerminal(this._shopUrl,this._customerId,this._posRadioInput,this._dropdownTerminals,(function(){}))))}initControls(){this._shopUrl=this._container.getAttribute("data-shop-url"),"/"===this._shopUrl.substr(-1)&&(this._shopUrl=this._shopUrl.substr(0,this._shopUrl.length-1)),this._customerId=this._container.getAttribute("data-customer-id"),this._dropdownTerminals=document.querySelector("#posTerminals"),this._paymentForm=d
1ocument.querySelector("#changePaymentForm"),void 0!==this._paymentForm&&null!==this._paymentForm&&(this._radioInputs=this._paymentForm.querySelectorAll('input[type="radio"]'),this._posRadioInput=this._paymentForm.querySelector('input[type="radio"].pointofsale'))}registerEvents(){if(null===this._paymentForm)return;const e=this._shopUrl,t=this._customerId,n=this._container,o=this._radioInputs,i=this._posRadioInput,r=this._dropdownTerminals;o.forEach((e=>{e.addEventListener("change",(()=>{this.updateDropdownVisibility(i,n,r)}))})),r.addEventListener("change",(async()=>{this.updateTerminal(e,t,i,r,(function(){}))}))}updateDropdownVisibility(e,t,n){let o=!1;void 0===e||!1===e.checked?t.classList.add("d-none"):(t.classList.remove("d-none"),o=!0),void 0!==n&&(n.required=o)}updateTerminal(e,t,n,o,r){void 0!==n?null!==n?!1!==n.checked?void 0!==o?null!==o?""!==o.value?(new i).get(e+"/mollie/pos/store-terminal/"+t+"/"+o.value,(function(){r("terminal updated successfully")}),(function(){r("error when updating terminal")}),"application/json; charset=utf-8"):r("no POS terminal selected"):r("POS terminals not found"):r("POS terminals not defined"):r("POS payment not active"):r("POS Radio Input not found"):r("POS Radio Input not defined")}}class C extends a{init(){const e=document.getElementById("mollieBancomatPayPhone");if(null===e)return;const t=document.querySelector(".mollie-bancomat-pay"),n=document.querySelector('.mollie-bancomat-pay [data-form-validation-invalid-phone="true"]');e.addEventListener("focus",(e=>{t.classList.add("was-validated"),e.target.removeAttribute("invalid"),n.classList.add("d-none")})),e.addEventListener("blur",(e=>{const t=e.target.form;return!1===t.reportValidity()&&(e.target.setAttribute("invalid",!0),n.classList.remove("d-none")),t.reportValidity()}))}}class b{register(){const e=window.PluginManager;e.register("MollieApplePayDirect",f),e.register("MollieApplePayPaymentMethod",g,"[data-mollie-template-applepay-account]"),e.register("MollieApplePayPaymentMethod",g,"[data-mollie-template-applepay-checkout]"),e.register("MollieCreditCardComponents",c,"[data-mollie-template-creditcard-components]"),e.register("MollieCreditCardComponentsSw64",m,"[data-mollie-template-creditcard-components-sw64]"),e.register("MollieCreditCardMandateManage",y,"[data-mollie-credit-card-mandate-manage]"),e.register("MolliePosTerminal",v,"[data-mollie-template-pos-terminal]"),e.register("MollieBancomatPlugin",C)}}window.addEventListener("load",(function(){void 0!==window.mollie_javascript_use_shopware&&"1"!==window.mollie_javascript_use_shopware&&((new b).register(),window.dispatchEvent(new Event("mollieLoaded")),window.PluginManager.initializePlugins())}))})()})();
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.