PageSourceSearch

https://eden-boites.com/cdn/shop/t/10/assets/eden-alma-widget.js?v=1398857381389219251784992967

js eden-boites.com collected 2026-10-07 16:47:33 UTC 8,757 bytes, 2 lines download raw bytes

1var EDEN_ALMA_MERCHANT_ID="merchant_11iHYqSQEe64wEin2AUmg2eiyg686WJml1";(function(){"use strict";var API="https://api.getalma.eu/v2/payments/eligibility",PLANS=[4,10],state={plans:[],current:0,price:0},badge=null,overlay=null,euro=new Intl.NumberFormat("fr-FR",{style:"currency",currency:"EUR"}),jour=new Intl.DateTimeFormat("fr-FR",{day:"numeric",month:"long",year:"numeric"});function money(cents){return euro.format((cents||0)/100)}function el(tag,cls,html){var n=document.createElement(tag);return cls&&(n.className=cls),html!=null&&(n.innerHTML=html),n}function merchantId(){if(EDEN_ALMA_MERCHANT_ID&&EDEN_ALMA_MERCHANT_ID!=="REMPLACE_MOI")return EDEN_ALMA_MERCHANT_ID;var m=document.documentElement.innerHTML.match(/merchant_[A-Za-z0-9]+/);return m?m[0]:null}function currentPrice(){return fetch(window.location.pathname.split("?")[0]+".js").then(function(r){return r.json()}).then(function(product){var input=document.querySelector('form[action*="/cart/add"] [name="id"]'),id=input?parseInt(input.value,10):null,v=product.variants.filter(function(x){return x.id===id})[0];return(v||product.variants[0]).price})}function eligibility(amount){var id=merchantId();return id?fetch(API,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Alma-Merchant-Auth "+id,"X-Alma-Agent":"Eden Boites/1.0"},body:JSON.stringify({purchase_amount:amount,queries:PLANS.map(function(n){return{installments_count:n,deferred_days:0,deferred_months:0}})})}).then(function(r){if(!r.ok)throw new Error("API Alma "+r.status);return r.json()}):Promise.reject(new Error("identifiant marchand introuvable"))}var LOGO='<svg viewBox="0 0 352 120" class="ea-logo" aria-label="Alma"><path fill="currentColor" d="M333.24 28.35v10.1c-5.74-7.35-14.06-11.93-23.95-11.93-19.08 0-33.87 17.03-33.87 38.06s14.79 38.06 33.87 38.06c10.58 0 19.38-5.25 25.13-13.51v11.69h19.25V28.35h-20.43Zm-19.21 56.14c-10.61 0-19.2-8.91-19.2-19.91s8.59-19.91 19.2-19.91 19.2 8.91 19.2 19.91-8.59 19.91-19.2 19.91ZM109.5 8.23h19.42v92.58H109.5V8.23Zm41.75 51.51c0-19.93 12.25-33.21 29.22-33.21 10.54 0 18.86 4.67 23.88 12.64 5.03-7.97 13.34-12.64 23.88-12.64 16.97 0 29.22 13.29 29.22 33.21v41.08h-19.42V57.64c0-7.78-5.16-12.85-11.99-12.85s-11.99 5.08-11.99 12.85v43.18h-19.42V57.64c0-7.78-5.16-12.85-11.99-12.85s-11.99 5.08-11.99 12.85v43.18h-19.42V59.74ZM74.34 29.1C69.74 11.91 60.02 6.41 50.77 6.41S31.8 11.91 27.2 29.1L7.25 100.83h19.67c3.2-11.98 13.08-18.66 23.85-18.66s20.65 6.69 23.86 18.66h19.68L74.34 29.1ZM50.77 65.46c-6.26 0-11.94 2.37-16.13 6.22l11.28-41.74c1.08-3.99 2.68-5.26 4.86-5.26s3.78 1.27 4.86 5.26l11.27 41.74c-4.19-3.85-9.88-6.22-16.14-6.22Z"/></svg>';function renderBadge(){if(badge){var p=state.plans[state.current];if(!p){badge.style.display="none";return}badge.style.display="";var first=p.payment_plan[0],others=p.payment_plan[1]||first,free=p.customer_total_cost_amount===0,egales=first.total_amount===others.total_amount,montant=egales?p.installments_count+" &times; <strong>"+money(others.total_amount)+"</strong>":"<strong>"+money(first.total_amount)+'</strong><span class="ea-then">puis '+(p.installments_count-1)+" &times; "+money(others.total_amount)+"</span>",total=p.purchase_amount+p.customer_total_cost_amount,detail=free?"Total "+money(total):"Total "+money(total)+" &middot; dont "+money(p.customer_total_cost_amount)+" de frais",opts=state.plans.map(function(plan,i){return'<button type="button" class="ea-opt'+(i===state.current?" is-on":"")+'" data-i="'+i+'">'+plan.installments_count+"x</button>"}).join("");badge.innerHTML='<div class="ea-badge__head"><span class="ea-badge__eyebrow">Paiement fractionn&eacute;</span>'+LOGO+'</div><div class="ea-badge__opts">'+opts+'</div><p class="ea-badge__line">'+montant+(free?'<span class="ea-free">sans frais</span>':"")+'</p><p class="ea-sub">'+detail+'</p><button type="button" class="ea-more">Voir l\'&eacute;ch&eacute;ancier &rarr;</button>',badge.querySelectorAll(".ea-opt").forEach(function(b){b.addEventListener("click",function(){state.current=parseInt(b.dataset.i,10),renderBadge()})}),badge.querySelector(".ea-more").addEventListener("click",openModal)}}function renderModal(){var p=state.plans[state.current];
1if(p){var taeg=(p.annual_interest_rate||0)/1e4,lignes=p.payment_plan.map(function(inst,i){var d=new Date(inst.due_date*1e3);return'<li class="ea-inst'+(i===0?" is-first":"")+'"><span class="ea-dot"></span><span class="ea-when">'+(i===0?"Aujourd'hui":jour.format(d))+'</span><span class="ea-amt">'+money(inst.total_amount)+"</span></li>"}).join(""),opts=state.plans.map(function(plan,i){return'<button type="button" class="ea-opt'+(i===state.current?" is-on":"")+'" data-i="'+i+'">'+plan.installments_count+"x</button>"}).join(""),cout=p.customer_total_cost_amount>0?'<p class="ea-cost"><span>Dont co&ucirc;t du cr&eacute;dit</span><span>'+money(p.customer_total_cost_amount)+(taeg?" (TAEG "+taeg.toFixed(2).replace(".",",")+" %)":"")+"</span></p><p class=\"ea-legal\"><strong>Un cr&eacute;dit vous engage et doit &ecirc;tre rembours&eacute;.</strong> V&eacute;rifiez vos capacit&eacute;s de remboursement avant de vous engager. Sous r&eacute;serve d'&eacute;tude et d'acceptation par Alma. D&eacute;lai l&eacute;gal de r&eacute;tractation de 14 jours. Simulation pr&eacute;sent&eacute;e par Alma, RCS Nanterre 839 100 575, &eacute;tablissement de paiement et soci&eacute;t&eacute; de financement agr&eacute;&eacute;e par l'ACPR sous le n&deg; 17408.</p>":"<p class=\"ea-legal\">Sous r&eacute;serve d'&eacute;tude et d'acceptation par Alma.</p>";overlay.querySelector(".ea-modal").innerHTML='<button type="button" class="ea-close" aria-label="Fermer">&times;</button><div class="ea-left"><h2 class="ea-title">Payez en plusieurs fois par carte bancaire</h2><ol class="ea-steps"><li><span>1</span><p>Choisissez <strong>Alma</strong> au moment du paiement.</p></li><li><span>2</span><p>Laissez-vous guider et validez en <strong>2 minutes</strong>.</p></li><li><span>3</span><p><strong>Gardez le contr&ocirc;le</strong> en avan&ccedil;ant ou reculant vos &eacute;ch&eacute;ances.</p></li></ol>'+LOGO+'</div><div class="ea-right"><div class="ea-badge__opts">'+opts+'</div><ul class="ea-schedule">'+lignes+'</ul><div class="ea-summary"><p class="ea-total"><span>Total</span><span>'+money(p.purchase_amount+p.customer_total_cost_amount)+"</span></p>"+cout+"</div></div>",overlay.querySelectorAll(".ea-right .ea-opt").forEach(function(b){b.addEventListener("click",function(){state.current=parseInt(b.dataset.i,10),renderModal(),renderBadge()})}),overlay.querySelector(".ea-close").addEventListener("click",closeModal)}}var TOUCHES={ArrowUp:1,ArrowDown:1,PageUp:1,PageDown:1,Home:1,End:1," ":1};function bloque(e){(!overlay||!overlay.contains(e.target))&&e.preventDefault()}function bloqueTouche(e){TOUCHES[e.key]&&(!overlay||!overlay.contains(document.activeElement))&&e.preventDefault()}function lock(){document.addEventListener("wheel",bloque,{passive:!1}),document.addEventListener("touchmove",bloque,{passive:!1}),document.addEventListener("keydown",bloqueTouche,{passive:!1})}function unlock(){document.removeEventListener("wheel",bloque,{passive:!1}),document.removeEventListener("touchmove",bloque,{passive:!1}),document.removeEventListener("keydown",bloqueTouche,{passive:!1})}function openModal(){overlay||(overlay=el("div","ea-overlay"),overlay.setAttribute("role","dialog"),overlay.setAttribute("aria-modal","true"),overlay.appendChild(el("div","ea-modal")),overlay.addEventListener("click",function(e){e.target===overlay&&closeModal()}),document.addEventListener("keydown",function(e){e.key==="Escape"&&closeModal()}),document.body.appendChild(overlay)),renderModal(),lock(),overlay.classList.add("is-open")}function closeModal(){overlay&&(overlay.classList.remove("is-open"),unlock())}
1function anchor(){return document.querySelector("#alma-widget")||document.querySelector(".alma_widget_block")||document.querySelector(".alma-payment-plans-container")||document.querySelector('form[action*="/cart/add"]')}function load(retries){currentPrice().then(function(price){return state.price=price,eligibility(price)}).then(function(plans){state.plans=plans.filter(function(p){return p.eligible}),state.current=0,renderBadge()}).catch(function(err){if(retries>0){setTimeout(function(){load(retries-1)},700);return}console.warn("[eden-alma]",err.message),badge&&badge.remove()})}function start(){var host=anchor();host&&(badge=el("div","ea-badge"),badge.style.display="none",host.parentNode.insertBefore(badge,host.nextSibling),document.documentElement.classList.add("eden-alma-ready"),load(2))}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",start):start()})();
2//# sourceMappingURL=/cdn/shop/t/10/assets/eden-alma-widget.js.map?v=1398857381389219251784992967

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.