PageSourceSearch

https://www.ingredients-store.com/assets/frontend/js/PaymentMethod.d8e6e59e99027062384c.min.js

js ingredients-store.com collected 2026-10-08 22:59:53 UTC 3,082 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[423],{2321:function(e,t,i){i.r(t),i.d(t,{default:function(){return o}});var s=i(2494);const n="is-active",a={APPLE_PAY:"applepay",GOOGLE_PAY:"googlepay"},r={apiVersion:2,apiVersionMinor:0,allowedPaymentMethods:[{type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY","CRYPTOGRAM_3DS"],allowedCardNetworks:["VISA","MASTERCARD"]}}]};class o extends s.Z{constructor(e){var t,i,s;super(e),s=e=>{const t=e.target.closest(".cart-PaymentMethod-item");t&&(this.ref.items.forEach((e=>{e.classList.remove(n)})),t.classList.add(n),this.updateHighlight())},(i="handleItemClick")in(t=this)?Object.defineProperty(t,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[i]=s,this.ref={items:[],highlight:null}}prepare(){if(this.ref.items.forEach((e=>{e.addEventListener("click",this.handleItemClick)})),this.identifierField=document.getElementById("payment-identifier"),this.element.querySelectorAll('input[name="payment"]').forEach((e=>{e.addEventListener("change",(()=>this.updatePaymentIdentifier(e)))})),this.isIosDevice())this.preselectApplePay();else if(this.isAndroidDevice()){const e=document.getElementById("payment-apple-pay");e&&(e.style.display="none"),this.initGooglePay()}else this.initGooglePay(),this.isAppleDevice()&&this.preselectApplePay();this.updateLayout()}destroy(){this.ref.items.forEach((e=>{e.removeEventListener("click",this.handleItemClick)}))}isAppleDevice(){return/Macintosh|Mac OS|iPhone|iPad|iPod/.test(navigator.userAgent)}isIosDevice(){return/iPhone|iPad|iPod/.test(navigator.userAgent)}isAndroidDevice(){return/Android/i.test(navigator.userAgent)}preselectApplePay(){const e=document.getElementById("payment-apple-pay");if(!e)return;const t=e.querySelector('input[type="radio"]');t&&(this.ref.items.forEach((e=>e.classList.remove(n))),e.classList.add(n),t.checked=!0,this.updatePaymentIdentifier(t),this.updateHighlight())}updatePaymentIdentifier(e){if(!this.identifierField||!e)return;const t=e.getAttribute("data-instrument");this.identifierField.value=t&&a[t]||""}updateHighlight(){const e=this.ref.items.filter((e=>null!==e.offsetParent)),t=e.find((e=>e.classList.contains(n))),i=t?e.indexOf(t):0;this.ref.highlight&&(this.ref.highlight.style.transform="translateX(".concat(100*i,"%)"))}updateLayout(){const e=this.ref.items.filter((e=>null!==e.offsetParent)),t=e.length;if(0===t)return;const i=100/t+"%";e.forEach((e=>{e.style.width=i})),this.ref.highlight&&(this.ref.highlight.style.width=i),this.updateHighlight()}initGooglePay(){const e=document.getElementById("payment-google-pay");if(!e)return;const t=()=>{if("undefined"==typeof google||!google.payments)return;const t=this.element.dataset.gopayEnv||"TEST";new google.payments.api.PaymentsClient({environment:t}).isReadyToPay(r).then((t=>{t.result&&(e.style.display="",this.updateLayout())})).catch((()=>{}))};if("undefined"!=typeof google&&google.payments)t();else{const e=document.querySelector('script[src*="pay.google.com"]');e&&e.addEventListener("load",t)}}}}}]);
2//# sourceMappingURL=PaymentMethod.d8e6e59e99027062384c.min.js.map

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.