PageSourceSearch

https://www.metzgerei-graenitz.de/theme/901323ea31a4188dcb76d82932…/mollie-payments.js?1789709787

js metzgerei-graenitz.de collected 2026-09-26 07:29:02 UTC 26,253 bytes, 1 lines download raw bytes

1(()=>{var j="application/json",f=class{get(e,t=null,n=null,o=j){this.send("GET",e,null,t,n,o)}post(e,t=null,n=null,o=null,i=j){this.send("POST",e,t,n,o,i)}send(e,t,n=null,o=null,i=null,s=j){let a=new XMLHttpRequest;a.open(e,t),a.setRequestHeader("Content-Type",s),a.onload=function(){if(!o||typeof o!="function")return;let l=a.getResponseHeader("content-type"),d="response"in a?a.response:a.responseText;l.indexOf("application/json")>-1?o(JSON.parse(d)):o(d)},a.onerror=function(){!i||typeof o!="function"||i()},a.send(n)}};var c=class{static options={};constructor(e,t={},n="Plugin"){this.el=e,this._pluginName=n,this.options=this._mergeOptions(t),this.init()}_mergeOptions(e){let t=this._pluginName.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase(),n={};if(this.el&&typeof this.el.getAttribute=="function"){let o=this.el.getAttribute(`data-${t}-options`);if(o)try{n=JSON.parse(o)}catch(i){console.error(`[MolliePlugin] Could not parse data-${t}-options`,i)}}return Object.assign({},this.constructor.options,e,n)}init(){}};var $="d-none",P=class extends c{static options={newCardMandateOption:null,mollieCreditCardFormClass:".mollie-components-credit-card",mollieCreditCardMandateInput:'input[name="mandateId"]',mollieShouldSaveCardDetailInput:'input[name="mollieShouldSaveCardDetail"]'};init(){this.client=new f,this._fixShopUrl()}registerMandateEvents(){let{newCardMandateOption:e}=this.options;e&&(this.mollieCreditCarfFormEl=document.querySelector(this.options.mollieCreditCardFormClass),this.mollieCreditCardMandateEls=document.querySelectorAll(this.options.mollieCreditCardMandateInput),!(!this.mollieCreditCarfFormEl||!this.mollieCreditCardMandateEls)&&this._registerRadioButtonsEvent())}_fixShopUrl(){this.options.shopUrl!=null&&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(){let e=document.querySelector(`${this.options.mollieCreditCardMandateInput}:checked`);return!e||!e.value?null:e.value}isValidSelectedMandate(e){return e&&e!==this.options.newCardMandateOption}shouldSaveCardDetail(){let e=document.querySelector(this.options.mollieShouldSaveCardDetailInput);return e?e.checked:!1}onMandateInputChange(e){if(e===this.options.newCardMandateOption){this.mollieCreditCarfFormEl.classList.remove($);return}e!==null&&this.mollieCreditCarfFormEl.classList.add($)}};var I=class r{static isTouchDevice(){return"ontouchstart"in document.documentElement}static isIOSDevice(){return r.isIPhoneDevice()||r.isIPadDevice()}static isNativeWindowsBrowser(){return r.isIEBrowser()||r.isEdgeBrowser()}static isIPhoneDevice(){return!!navigator.userAgent.match(/iPhone/i)}static isIPadDevice(){return!!navigator.userAgent.match(/iPad/i)}static isIEBrowser(){return navigator.userAgent.toLowerCase().indexOf("msie")!==-1||!!navigator.userAgent.match(/Trident.*rv:\d+\./)}static isEdgeBrowser(){return!!navigator.userAgent.match(/Edge\/\d+/i)}static getList(){return{"is-touch":r.isTouchDevice(),"is-ios":r.isIOSDevice(),"is-native-windows":r.isNativeWindowsBrowser(),"is-iphone":r.isIPhoneDevice(),"is-ipad":r.isIPadDevice(),"is-ie":r.isIEBrowser(),"is-edge":r.isEdgeBrowser()}}};var L=class{constructor(e){this.csrf=e}isActive(){return!(this.csrf===void 0||this.csrf.enabled===!1||this.csrf.mode!=="ajax")}};var M=class{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 e===null&&(e=this._document.querySelector('#confirmOrderForm button[type="submit"]')),e}};var Z="#cardHolder",K="div.mollie-components-credit-card",Q='#changePaymentForm input[type="radio"]',Y="error",ee="is-focused",x=class extends P{static options={...P.options,paymentId:null,customerId:null,locale:null,profileId:null,shopUrl:null,testMode:!0};init(){super.init();try{let e=new M(document);
1this._paymentForm=e.getPaymentForm(),this._confirmForm=e.getConfirmForm(),this._confirmFormButton=e.getSubmitButton()}catch{console.error("Mollie Credit Card components: Required HTML elements not found on this page!");return}this._initializeComponentInstance(),this._registerEvents(),this.registerMandateEvents()}_initializeComponentInstance(){let e=document.querySelector(Z);document.querySelector(K)&&e&&!window.mollieComponentsObject&&(window.mollieComponentsObject=Mollie(this.options.profileId,{locale:this.options.locale,testmode:this.options.testMode}),window.mollieComponents={}),this.createComponentsInputs()}_registerEvents(){this._confirmForm!==null&&this._confirmForm.addEventListener("submit",this.submitForm.bind(this))}_reactivateFormSubmit(){this._confirmForm.dispatchEvent(new CustomEvent("removeLoader"))}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(){let e=this,t=[this.getInputFields().cardHolder,this.getInputFields().cardNumber,this.getInputFields().expiryDate,this.getInputFields().verificationCode];window.mollieComponentsObject&&t.forEach((n,o,i)=>{let s=this._mountMollieComponent(n.id,n.name);i[o][n.name]=s,s.addEventListener("change",a=>{let l=document.getElementById(`${n.name}`),d=document.getElementById(`${n.errors}`);a.error&&a.touched?(l.classList.add(Y),d.textContent=a.error):(l.classList.remove(Y),d.textContent="")}),s.addEventListener("focus",()=>{e.setFocus(`${n.id}`,!0)}),s.addEventListener("blur",()=>{e.setFocus(`${n.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(ee,t)}async submitForm(e){if(e.defaultPrevented)return;let t=this,n=this._confirmForm,o=document.querySelector(`${Q}[value="${this.options.paymentId}"]`);if((o==null||o.checked===!1)&&this._confirmForm||o&&o.checked===!1)return;e.preventDefault();let i=this.getMandateCheckedValue();if(this.isValidSelectedMandate(i)){this.client.post(t.options.shopUrl+"/mollie/components/store-mandate-id/"+t.options.customerId+"/"+i,null,()=>{t.continueShopwareCheckout(n)},()=>{t.continueShopwareCheckout(n)},"application/json; charset=utf-8");return}let s=document.getElementById(`${this.getInputFields().verificationCode.errors}`);s.textContent="";let{token:a,error:l}=await window.mollieComponentsObject.createToken();if(l){s.textContent=l.message,this._reactivateFormSubmit(),s.scrollIntoView();return}document.getElementById("cardToken").setAttribute("value",a),t.continueShopwareCheckout(n)}continueShopwareCheckout(e){if(I.isIEBrowser()){let n=function(i,s){let a=document.createElement("input");return a.type="checkbox",a.name=i,a.checked=s,a.style.display="none",a},o=document.getElementById("tos");o!=null&&e.insertAdjacentElement("beforeend",n("tos",o.checked))}new L(window.csrf).isActive()||e.submit()}};var h=class{constructor(e){this._document=e}findClosestShopwareBuyButton(e){let t=this.findClosestBuyBox(e);return t===null?null:t.querySelector(".btn-buy")}findClosestApplePayContainer(e){return e.closest(".mollie-apple-pay-direct")}findClosestBuyBox(e){let t=e.closest(".product-action");return t===null&&(t=e.closest(".product-detail-form-container")),t===null&&(t=e.closest(".offcanvas-cart-actions")),t===null&&(t=e.closest(".checkout-aside-container")),t===null&&(t=e.closest(".checkout-main")),t}findAllExpressButtons(e,t=null){let n=".mollie-express-button";return t!==null&&(n+=t),e.querySelectorAll(n)}findApplePayButtons(){return this._document.querySelectorAll(".mollie-express-button.js-apple-pay")}findApplePayContainers(){return this._document.querySelectorAll(".js-apple-pay-container")}findPayPalExpressButtons(){return this._document.querySelectorAll(".mollie-paypal-button")}findClosestPrivacyBox(e){let t=this.findClosestBuyBox(e);return t===null?null:t.querySelector(".mollie-privacy-note")}getPrivacyBoxCheckbox(e){return e.querySelector('input[name="acceptedDataProtection"]')}};var A="d-none",W="is-invalid",C=class{constructor(e){this._repoBuyBox=new h,this._document=e}initCheckbox(){let e=this._document.querySelectorAll(".mollie-privacy-note:not(.observed)");for(let t=0;t<e.length;t++){let n=e[t];n.classList.remove(A),n.classList.add("observed");let o=this._repoBuyBox.findClosestBuyBox(n);if(o===null){n.classList.add(A);continue}let i=this._repoBuyBox.findAllExpressButtons(o,null);if(i.length===0){n.classList.add(A);continue}for(let s=0;s<i.length;s++){let a=i[s];new MutationObserver(d=>{let u=i.length;n.classList.remove(A),d.forEach(V=>{V.target.classList.contains(A)&&u--}),u<=0&&n.classList.add(A)}).observe(a,{attributes:!0,attributeFilter:["class"]})}}}validateForExpressButton(e){let t=this._repoBuyBox.findClosestPrivacyBox(e);if(!(t instanceof HTMLDivElement))return!0;let n=this._repoBuyBox.getPrivacyBoxCheckbox(t),o=n.checked?1:0;return n.classList.remove(W),o===0?(n.classList.add(W),!1):!0}};var _=class{addEventListenerOnce(e,t,n="click"){let o="__handler_"+n;e[o]||(e.addEventListener(n,t),e[o]=!0)}};var E=class{register(e,t){let n=window.PluginManager.getPluginList().OffCanvasCart;if(!n)return;let o=n.get("instances");if(o)for(let i=0;i<o.length;i++){let s=o[i];s["_"+t+"_subscribed"]||(s.$emitter.subscribe("registerEvents",e),s["_"+t+"_subscribed"]=!0)}}};var H="loading",g=class{constructor(){this._repoBuyBox=new h}addItemToCart(e){let t=this._repoBuyBox.findClosestShopwareBuyButton(e);if(!(t instanceof HTMLButtonElement))return;let n=t.closest("form");if(!(n instanceof HTMLFormElement)||e.classList.contains(H))return;let o=n.elements,i=[];e.classList.add(H);for(let d=0;d<o.length;d++){let u=o[d];u.type==="radio"&&!u.checked||u.name&&u.name!=="redirectTo"&&i.push(encodeURIComponent(u.name)+"="+encodeURIComponent(u.value))}i.push("isExpressCheckout=1");let s=n.action,a=n.method,l=new XMLHttpRequest;l.open(a,s,!1),l.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),l.onreadystatechange=()=>{if(l.readyState!==XMLHttpRequest.DONE)return;if(e.classList.remove(H),l.status>=400)throw new Error(`Request failed with status ${l.status}`)},l.send(i.join("&"))}};var T=class{APPLE_PAY_VERSION=3;constructor(){this.client=new f}create(e,t,n,o,i,s,a){let l=this;var d=["name","email","postalAddress"];o===1&&d.push("phone");let u=!1;s!==null&&(u=s.value);var V={countryCode:t,currencyCode:n,requiredShippingContactFields:d,supportedNetworks:["amex","maestro","masterCard","visa","vPay"],merchantCapabilities:["supports3DS"],total:{label:"",amount:0}};let p=new ApplePaySession(this.APPLE_PAY_VERSION,V);return p.onvalidatemerchant=function(y){l.client.post(i+"/mollie/apple-pay/validate",JSON.stringify({validationUrl:y.validationURL}),m=>{if(m.success===!1)throw new Error("Validation failed for URL: "+y.validationURL);let v=JSON.parse(m.session);p.completeMerchantValidation(v)},()=>{p.abort()})},p.onshippingcontactselected=function(y){var m="";y.shippingContact.countryCode!==void 0&&(m=y.shippingContact.countryCode),l.client.post(i+"/mollie/apple-pay/shipping-methods",JSON.stringify({countryCode:m}),v=>{v.success?p.completeShippingContactSelection(ApplePaySession.STATUS_SUCCESS,v.shippingmethods,v.cart.total,v.cart.items):p.completeShippingContactSelection(ApplePaySession.STATUS_FAILURE,[],{label:"",amount:0,pending:!0},[])},()=>{p.abort()})},p.onshippingmethodselected=function(y){l.client.post(i+"/mollie/apple-pay/set-shipping",JSON.stringify({identifier:y.shippingMethod.identifier}),m=>{m.success?p.completeShippingMethodSelection(ApplePaySession.STATUS_SUCCESS,m.cart.total,m.cart.items):p.completeShippingMethodSelection(ApplePaySession.STATUS_FAILURE,{label:"",amount:0,pending:!0},[])},()=>{p.abort()})},p.onpaymentauthorized=function(y){var m=y.payment.token;m=JSON.stringify(m),p.completePayment(ApplePaySession.STATUS_SUCCESS),l.finishPayment(i+"/mollie/apple-pay/start-payment",m,y.payment,u),a.classList.remove("processed")},p.oncancel=function(){e&&l.client.post(i+"/mollie/apple-pay/restore-cart"),a.classList.remove("processed")},p}finishPayment(e,t,n,o){let i=function(l,d){let u=document.createElement("input");return u.type="hidden",u.name=l,u.value=d,u},s=document.createElement("form");s.action=e,s.method="POST";let a=n.shippingContact.addressLines[0];n.shippingContact.addressLines.length>1&&(a+=" "+n.shippingContact.addressLines[1]),s.insertAdjacentElement("beforeend",i("email",n.shippingContact.emailAddress)),s.insertAdjacentElement("beforeend",i("lastname",n.shippingContact.familyName)),s.insertAdjacentElement("beforeend",i("firstname",n.shippingContact.givenName)),s.insertAdjacentElement("beforeend",i("street",a)),s.insertAdjacentElement("beforeend",i("postalCode",n.shippingContact.postalCode)),s.insertAdjacentElement("beforeend",i("city",n.shippingContact.locality)),s.insertAdjacentElement("beforeend",i("acceptedDataProtection",o)),n.shippingContact.phoneNumber!==void 0&&n.shippingContact.phoneNumber.length>0&&s.insertAdjacentElement("beforeend",i("phone",n.shippingContact.phoneNumber)),s.insertAdjacentElement("beforeend",i("countryCode",n.shippingContact.countryCode)),s.insertAdjacentElement("beforeend",i("paymentToken",t)),document.body.insertAdjacentElement("beforeend",s),s.submit()}};var te="disabled",S=class{constructor(){this._repoBuyBox=new h}isCheckoutPossible(e){let t=this._repoBuyBox.findClosestShopwareBuyButton(e);return t instanceof HTMLButtonElement?!t.hasAttribute(te):!0}};var O=class{constructor(e,t){this._countryCode=e.querySelector('input[name="countryCode"]').value,this._currency=e.querySelector('input[name="currency"]').value,this._mode=e.querySelector('input[name="mode"]').value,this._withPhone=parseInt(e.querySelector('input[name="withPhone"]').value),this._dataProtection=e.querySelector('input[name="acceptedDataProtection"]'),this._isProductMode=this._mode==="productMode";let n=t.getAttribute("data-shop-url");n.slice(-1)==="/"&&(n=n.slice(0,-1)),this._shopSlug=n}isProductMode(){return this._isProductMode}getCountryCode(){return this._countryCode}getCurrency(){return this._currency}getMode(){return this._mode}getWithPhone(){return this._withPhone}getDataProtection(){return this._dataProtection}getShopSlug(){return this._shopSlug}};
1var b="d-none",D=class extends c{init(){this._privacySection=new C(document),this._eventUtils=new _,this._cartService=new g,this._productBoxValidator=new S,this._repoBuyBox=new h(document),new E().register(this.initCurrentPage.bind(this),"mollie-apple-pay-direct"),this.initCurrentPage()}initCurrentPage(){if(this._applePayButtons=this._repoBuyBox.findApplePayButtons(),this._applePayContainers=this._repoBuyBox.findApplePayContainers(),!window.ApplePaySession||!window.ApplePaySession.canMakePayments()||this._applePayButtons.length<=0){this.hideApplePayFeature();return}if(this._privacySection.initCheckbox(),this.showApplePayFeature(),this._applePayButtons)for(let e=0;e<this._applePayButtons.length;e++){let t=this._applePayButtons[e];this._eventUtils.addEventListenerOnce(t,this.onApplePayButtonClicked.bind(this),"click"),this.updateButtonVisibility(t);let n=this._repoBuyBox.findClosestBuyBox(t);n!==null&&n.addEventListener("change",()=>{this.updateButtonVisibility(t)})}}updateButtonVisibility(e){this._productBoxValidator.isCheckoutPossible(e)?(e.hidden=!1,e.classList.remove(b)):(e.hidden=!0,e.classList.add(b))}showApplePayFeature(){if(this._applePayContainers)for(let e=0;e<this._applePayContainers.length;e++)this._applePayContainers[e].classList.remove(b);if(this._applePayButtons)for(let e=0;e<this._applePayButtons.length;e++)this._applePayButtons[e].classList.remove(b)}hideApplePayFeature(){if(this._applePayContainers)for(let e=0;e<this._applePayContainers.length;e++)this._applePayContainers[e].classList.add(b);if(this._applePayButtons)for(let e=0;e<this._applePayButtons.length;e++)this._applePayButtons[e].classList.add(b)}onApplePayButtonClicked(e){let t=e.currentTarget;if(!this._productBoxValidator.isCheckoutPossible(t)||!this._privacySection.validateForExpressButton(t))return;let n=this._repoBuyBox.findClosestApplePayContainer(t),o=new O(n,t);o.isProductMode()&&this._cartService.addItemToCart(t),new T().create(o.isProductMode(),o.getCountryCode(),o.getCurrency(),o.getWithPhone(),o.getShopSlug(),o.getDataProtection(),t).begin()}};var ne="#paymentMethod",oe=".payment-method",w=class extends c{static options={shopUrl:null,hideAlways:!1,applePayId:null,hideApplePayOption:!1};init(){!this.options.hideAlways&&window.ApplePaySession&&window.ApplePaySession.canMakePayments()||(this.hideApplePay(ne+this.options.applePayId),this.options.hideApplePayOption&&this.hideApplePaySelect(this.options.applePayId))}hideApplePay(e){let t=document.querySelector(e),n=this.getClosest(t,oe);n&&n.classList&&n.remove()}hideApplePaySelect(e){let t=document.querySelector('option[value="'+e+'"]');t!==null&&t.remove()}getShopUrl(){let e=this.options.shopUrl;if(e===void 0)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(n){let o=(this.document||this.ownerDocument).querySelectorAll(n),i=o.length;for(;--i>=0&&o.item(i)!==this;);return i>-1});e&&e!==document;e=e.parentNode)if(e.matches(t))return e;return null}};var q="d-none",R=class extends c{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(){if(!this.options.shopUrl)throw new Error(`The "shopUrl" option for the plugin "${this._pluginName}" is not defined.`);if(!this.options.customerId)throw new Error(`The "customerId" option for the plugin "${this._pluginName}" is not defined.`);this.mollieMandateDeleteAlertEl=document.querySelector(this.options.mollieMandateDeleteAlertSuccessId),this.mollieMandateDeleteAlertEl&&(this.mollieMandateDeleteAlertErrorEl=document.querySelector(this.options.mollieMandateDeleteAlertErrorId),this.mollieMandateDeleteAlertErrorEl&&(this.client=new f,this.registerEvents()))}registerEvents(){let e=document.querySelectorAll(this.options.mollieMandateRemoveButtonClass);if(!e||e.length===0)return;let t=document.querySelectorAll(this.options.mollieMandateRemoveModalButtonClass);!t||t.length===0||(e.forEach(n=>
1{n._mollieManageInit||(n._mollieManageInit=!0,n.addEventListener("click",o=>{o.preventDefault(),this.onRemoveButtonClick(n)}))}),t.forEach(n=>{n._mollieManageInit||(n._mollieManageInit=!0,n.addEventListener("click",o=>{o.preventDefault(),this.onConfirmRemoveButtonClick()}))}))}onRemoveButtonClick(e){this.currentContainerEl=e.closest(this.options.mollieMandateContainerClass),this.currentContainerEl&&(this.currentMandateId=this.currentContainerEl.getAttribute(this.options.mollieMandateDataId))}onConfirmRemoveButtonClick(){let e=this.currentContainerEl,t=this.currentMandateId;!e||!t||(this.currentMandateId=null,this.currentContainerEl=null,this.deleteMandate(t).then(({success:n})=>{n?(this.mollieMandateDeleteAlertErrorEl.classList.add(q),this.mollieMandateDeleteAlertEl.classList.remove(q),e.remove()):(this.mollieMandateDeleteAlertEl.classList.add(q),this.mollieMandateDeleteAlertErrorEl.classList.remove(q))}))}deleteMandate(e){return new Promise(t=>{this.client.post(this.options.shopUrl+"/mollie/components/revoke-mandate/"+this.options.customerId+"/"+e,"",n=>{t({success:n&&n.success})},()=>{t({success:!1})},"application/json; charset=utf-8")})}};var ie="div.mollie-pos-terminals",se="#posTerminals",re="#changePaymentForm",ae='input[type="radio"]',le="data-shop-url",ce="data-customer-id",de="data-pos-payment-id",J="d-none",F=class extends c{_shopUrl="";_customerId="";_dropdownTerminals=null;_container=null;_paymentForm=null;_radioInputs=null;_posRadioInput=null;init(){this._container=document.querySelector(ie),!(this._container===void 0||this._container===null)&&(this.initControls(),this._paymentForm!==null&&this._dropdownTerminals!==null&&(this.registerEvents(),this.updateDropdownVisibility(this._posRadioInput,this._container,this._dropdownTerminals),this.updateTerminal(this._shopUrl,this._customerId,this._posRadioInput,this._dropdownTerminals,function(){})))}initControls(){if(this._shopUrl=this._container.getAttribute(le),this._shopUrl.substr(-1)==="/"&&(this._shopUrl=this._shopUrl.substr(0,this._shopUrl.length-1)),this._customerId=this._container.getAttribute(ce),this._dropdownTerminals=document.querySelector(se),this._paymentForm=document.querySelector(re),this._paymentForm===void 0||this._paymentForm===null)return;this._radioInputs=this._paymentForm.querySelectorAll(ae);let e=this._container.getAttribute(de);this._posRadioInput=e?this._paymentForm.querySelector("#paymentMethod"+e):null}registerEvents(){if(this._paymentForm===null)return;let e=this._shopUrl,t=this._customerId,n=this._container,o=this._radioInputs,i=this._posRadioInput,s=this._dropdownTerminals;o.forEach(a=>{a.addEventListener("change",()=>{this.updateDropdownVisibility(i,n,s)})}),s.addEventListener("change",async()=>{this.updateTerminal(e,t,i,s,function(){})})}updateDropdownVisibility(e,t,n){let o=!1;e===void 0||e.checked===!1?t.classList.add(J):(t.classList.remove(J),o=!0),n!==void 0&&(n.required=o)}updateTerminal(e,t,n,o,i){if(n===void 0){i("POS Radio Input not defined");return}if(n===null){i("POS Radio Input not found");return}if(n.checked===!1){i("POS payment not active");return}if(o===void 0){i("POS terminals not defined");return}if(o===null){i("POS terminals not found");return}if(o.value===""){i("no POS terminal selected");return}new f().post(e+"/mollie/pos/store-terminal/"+t+"/"+o.value,"",function(){i("terminal updated successfully")},function(){i("error when updating terminal")},"application/json; charset=utf-8")}};var z="d-none",N=class extends c{init(){this._privacySection=new C(document),this._eventUtils=new _,this._cartService=new g,this._productBoxValidator=new S,this._repoBuyBox=new h(document),new E().register(this.bindEvents.bind(this),"mollie-paypal-express"),this.bindEvents()}bindEvents(){let e=this._repoBuyBox.findPayPalExpressButtons();if(e.length!==0){this._privacySection.initCheckbox();for(let t=0;t<e.length;t++){let n=e[t];this._eventUtils.addEventListenerOnce(n,this.onExpressCheckout.bind(this),"click"),this.updateButtonVisibility(n);let o=this._repoBuyBox.findClosestBuyBox(n);o!==null&&o.addEventListener("change",()=>{this.updateButtonVisibility(n)})}}}updateButtonVisibility(e){this._productBoxValidator.isCheckoutPossible(e)?(e.hidden=!1,e.classList.remove(z)):(e.hidden=!0,e.classList.add(z))}onExpressCheckout(e){let t=e.currentTarget;if(!this._productBoxValidator.isCheckoutPossible(t)||!this._privacySection.validateForExpressButton(t))return;this._cartService.addItemToCart(t);let n=t.getAttribute("data-form-action"),o=document.createElement("form");o.setAttribute("action",n),o.setAttribute("method","POST"),document.body.insertAdjacentElement("beforeend",o),o.submit()}};var ue="molliePayPhone",pe=".mollie-phone-field",me='.mollie-phone-field [data-form-validation-invalid-phone="true"]',G="d-none",he="was-validated",X="invalid",k=class extends c{init(
1){let e=document.getElementById(ue);if(e===null)return;let t=document.querySelector(pe),n=document.querySelector(me);e.addEventListener("focus",o=>{t.classList.add(he),o.target.removeAttribute(X),n.classList.add(G)}),e.addEventListener("blur",o=>{let i=o.target.form;return i.reportValidity()===!1&&(o.target.setAttribute(X,!0),n.classList.remove(G)),i.reportValidity()})}};var B=class r extends c{static options={productId:""};init(){this._form=this.el.closest("form"),this._form!==null&&(this._onSubmit=this._onSubmit.bind(this),this._form.addEventListener("submit",this._onSubmit,!0))}_onSubmit(e){let t=this._form.querySelector(`input[name="${r.FIELD_NAME}"]`);if(e.submitter!==this.el){t!==null&&t.remove();return}t===null&&(t=document.createElement("input"),t.type="hidden",t.name=r.FIELD_NAME,this._form.appendChild(t)),t.value=this.options.productId}};B.FIELD_NAME="mollieSubscribe";var U=class{register(){let e=window.PluginManager,t=[["MollieApplePayDirect",D,"body"],["PayPalExpressPlugin",N,"body"],["MollieApplePayPaymentMethod",w,"[data-mollie-template-applepay-account]"],["MollieApplePayPaymentMethod",w,"[data-mollie-template-applepay-checkout]"],["MollieCreditCardComponents",x,"[data-mollie-template-creditcard-components]"],["MollieCreditCardMandateManage",R,"[data-mollie-credit-card-mandate-manage]"],["MolliePosTerminal",F,"[data-mollie-template-pos-terminal]"],["MolliePhonePlugin",k,"[data-mollie-phone-validation]"],["MollieSubscribeButton",B,"[data-mollie-subscribe-button]"]];t.forEach(function(n){e.register(n[0],n[1],n[2])}),t.forEach(function(n){e.initializePlugin(n[0],n[2])})}};window.addEventListener("pageshow",function(r){r.persisted&&window.location.pathname.includes("/account/order/edit/")&&window.location.reload()});window.__mollieStorefrontRegistered||(window.__mollieStorefrontRegistered=!0,new U().register());})();

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.