1customElements.get("financing-price")||customElements.define("financing-price",class extends HTMLElement{connectedCallback(){this.settled=!1;const timeoutMs=Number(this.dataset.timeoutMs)||5e3;this.fallbackTimer=window.setTimeout(()=>this.showFallback(),timeoutMs),document.addEventListener("DOMContentLoaded",()=>this.init())}init(){const cashPrice=Number(this.dataset.price)/100,depositPercent=Number(this.dataset.depositPercent||0);if(!cashPrice||typeof window.V12>"u"||typeof V12.getFinanceProducts!="function")return;let lowestPayment=null;try{(V12.getFinanceProducts()||[]).forEach(productSummary=>{if(!(productSummary.name&&productSummary.name.indexOf("Classic Credit")>=0))try{const financeProduct=V12.getFinanceProduct(productSummary.productId),deposit=parseFloat((Math.ceil(cashPrice*depositPercent)/100).toFixed(2)),payments=V12.calculate(financeProduct,cashPrice,deposit),monthlyPayment=parseFloat(payments&&payments.initialPayments);!isNaN(monthlyPayment)&&(lowestPayment===null||monthlyPayment<lowestPayment)&&(lowestPayment=monthlyPayment)}catch{return}})}catch{return}lowestPayment!==null&&this.reveal(this.formatMoney(lowestPayment))}showFallback(){const fallbackPence=Number(this.dataset.fallbackPence);fallbackPence>0&&this.reveal(this.formatMoney(fallbackPence/100))}reveal(text){if(this.settled)return;this.settled=!0,window.clearTimeout(this.fallbackTimer);const valueEl=this.querySelector("[data-financing-price-value]");valueEl&&(valueEl.textContent=text);const loaderEl=this.querySelector(".financing-price__loader");loaderEl&&loaderEl.remove()}formatMoney(amount){return new Intl.NumberFormat("en-GB",{style:"currency",currency:window.Shopify&&window.Shopify.currency&&window.Shopify.currency.active||"GBP",minimumFractionDigits:2,maximumFractionDigits:2}).format(amount)}}); 2//# sourceMappingURL=/cdn/shop/t/13/assets/financing-price.js.map?v=149940094915992797371789999009
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.