PageSourceSearch

https://www.maxmara.ae/cdn/shop/t/12/assets/product-main-info-c79fb3fa.js

js maxmara.ae collected 2026-10-07 08:09:09 UTC 9,220 bytes, 2 lines download raw bytes

1window.Currency=window.Currency||{};const A=function(){let t;function a(e,o){typeof e=="string"&&(e=e.replace(".",""));var s="",n=/\{\{\s*(\w+)\s*\}\}/;window.lang||(window.lang="en"),window.shopMarket=="sa"?window.lang==="en"?t=o||"{{amount}} SR":(console.log("working else"),t=o||" ريال{{amount}}"):window.lang==="en"?t=o||"AED {{amount}}":(console.log("working else"),t=o||"د.إ {{amount}}");function r(l,d,u,i){if(u=u||",",i=i||".",isNaN(l)||l===null)return 0;l=(l/100).toFixed(d);var p=l.split("."),f=p[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+u),m=p[1]?i+p[1]:"";return f+m}switch(t.match(n)[1]){case"amount":s=r(e,2);break;case"amount_no_decimals":s=r(e,0);break;case"amount_with_comma_separator":s=r(e,2,".",",");break;case"amount_no_decimals_with_comma_separator":s=r(e,0,".",",");break;case"amount_no_decimals_with_space_separator":s=r(e,0," ");break;case"amount_with_apostrophe_separator":s=r(e,2,"'");break}const c=s?s.substring(0,s.length-3):null;return t.replace(n,String(c)+".00")}return{formatMoney:a}}();window.Currency=A;let E=document.querySelectorAll(".pdp-addtocart"),V=document.querySelectorAll(".pdp-notify"),P=document.querySelectorAll(".pdp-error-message"),z=document.querySelectorAll(".pdp-sizeSelector-btn");var T,C;if(!((T=window.productData)!=null&&T.hasOnlyDefaultVariant)){let o=function(r,c){let l=document.querySelectorAll(".pdp-price"),d=document.querySelectorAll(".pdp-compare-price");r?l.forEach(i=>{i.innerHTML=A.formatMoney(r),i.classList.remove("hidden")}):r<=0?l.forEach(i=>{i.innerHTML="Free Product",i.classList.remove("hidden")}):l.forEach(i=>{i.innerHTML="",i.classList.add("hidden")});let u=!0;c&&c<=r&&(u=!1),c?d.forEach(i=>{i.innerHTML=A.formatMoney(c),u?i.classList.remove("hidden"):i.classList.add("hidden")}):d.forEach(i=>{i.innerHTML="",i.classList.add("hidden")})},s=function(){let r=document.querySelector(".close-size-popup"),c=document.querySelector(".pdp-sizePupup-overlay");
1[r,c].forEach(l=>l.addEventListener("click",()=>n(!1)))},n=function(r){let c=document.querySelector("#pdp_size_popup");r?c.classList.add("active"):c.classList.remove("active")};var Y=o,G=s,K=n;let t=document.querySelectorAll(".pdp-swatch"),a=document.querySelectorAll(".pdp-addtocart");t.forEach(r=>{r.addEventListener("click",c=>{var b;let l=c.target.closest(".pdp-swatch"),d=c.target.closest(".pdp-swatch").dataset.value,i=((b=window.productData)==null?void 0:b.product.variants).find(h=>h.option1==d);window.productData.selectedVaraint=i;let p=new CustomEvent("variant-change");window.dispatchEvent(p),t.forEach(h=>h.classList.remove("active")),l.classList.add("active");let f=document.querySelector("product-info wishlist-btn");f.dataset.variantId=i.id;let m=i.price,L=i.compare_at_price;o(m,L),a.forEach(h=>{h.dataset.variantid=i.id}),y(!0),q(!1),w(!1),i.price<=0?(y(!1),_(!1)):i.available?(y(!0),_(!1)):(y(!1),_(!0)),l.classList.contains("popup-size-swatch")&&(i.available?e(i):document.querySelector("#notify_me_alert").classList.add("active"))})}),((C=window.productData)==null?void 0:C.product.variants.length)==1&&t[0].click();async function e(r){var f;let c=r.id||null,l=document.getElementById("pdp_quantity").value,d=(f=document.getElementById("pdp_colorVar"))==null?void 0:f.value,u=await x(c,l);n(!1),window.matchMedia("(min-width: 768px)").matches&&document.querySelector(".desktop-size-swatch").classList.remove("active"),w(!0);let i=document.querySelector("#pdp_alert_cont");if(c)if(u>0){let m=await D(c,u,d);POPUPS.Cart.updateMiniCart(!0),m.status==200?setTimeout(()=>{window.matchMedia("(max-width: 767px)").matches&&i.classList.add("active"),w(!1),R(c),p()},1e3):(v("Item not added to cart.",!1),p())}else{let L=`${window.productData.productAtcLimit} item already exist in cart`;v(L,!1),p(),w(!1)}else v("Select a size",!1),p();function p(){window.matchMedia("(min-width: 768px)").matches,y(!1),q(!0)}}s(),z.forEach(r=>r.addEventListener("click",c=>{if(window.matchMedia("(min-width: 768px)").matches){let l=document.querySelector(".desktop-size-swatch");c.target.classList.contains("sticky-bar")&&l.classList.add("active")}else document.querySelector("#pdp_size_popup").classList.add("active")}))}E.forEach(t=>{t.addEventListener("click",async a=>{var c;g(!0);let e=t.dataset.variantid||null,o=document.getElementById("pdp_quantity").value,s=(c=document.getElementById("pdp_colorVar"))==null?void 0:c.value,n=await x(e,o),r=document.querySelector("#pdp_alert_cont");if(e)if(n>0)(await D(e,n,s)).status==200?(g(!1),w(!0),setTimeout(()=>{R(e),window.matchMedia("(max-width: 767px)")&&r.classList.add("active"),w(!1),POPUPS.Cart.updateMiniCart(!0)},1500)):(v("Item not added to cart.",!1),g(!1));else{let d=`${window.productData.productAtcLimit} item already exist in cart`;v(d,!1),setTimeout(()=>{g(!1)},800)}else v("Select a size",!1)})});async function D(t,a,e){let o={items:[{id:t,quantity:a,properties:{}}]};return e&&(o.items[0].properties.color=e),await fetch(window.Shopify.routes.root+"cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)}).then(n=>n).catch(n=>{console.error("Error:",n)})}async function x(t,a){return await fetch("/cart.js").then(e=>e.json()).then(e=>{const s=e.items.filter(n);function n(u){return u.variant_id==t}const r=window.productData.productAtcLimit;let c=0;s.length!=0&&(c=s[0].quantity);const l=r-c;let d=0;return a>=l?d=l:d=a,d}).catch(e=>{})}function y(t){E.forEach(a=>{t?a.classList.remove("hidden"):a.classList.add("hidden")})}function q(t){z.forEach(a=>{t?a.classList.remove("hidden"):a.classList.add("hidden")})}function _(t){V.forEach(a=>{t?a.classList.remove("hidden"):a.classList.add("hidden")})}function v(t,a){P.forEach(e=>{e.classList.remove("success"),e.classList.remove("error"),e.innerHTML=t,a?e.classList.add("success"):e.classList.add("error")}),I(!0),setTimeout(()=>{I(!1)},5e3)}function I(t){P.forEach(a=>{t?a.classList.remove("hidden"):a.classList.add("hidden")})}function g(t){t?E.forEach(a=>a.classList.add("clicked")):E.forEach(a=>a.classList.remove("clicked"))}function w(t){document.querySelectorAll(".atc-loader"),document.querySelectorAll(".pdp-icon-cart"),t?E.forEac
1h(a=>a.classList.add("loading")):E.forEach(a=>a.classList.remove("loading"))}if(window.matchMedia("(min-width: 768px)").matches){let t=document.querySelector(".pdp-sticky-bar");var M=0;document.addEventListener("scroll",function(a){var e=window.pageYOffset||document.documentElement.scrollTop;e>M?S("desktop"):e<M&&t.classList.remove("active"),M=e<=0?0:e}),S("desktop")}else document.addEventListener("scroll",()=>{S("mobile")}),S("mobile");function S(t){let a=document.querySelector(".pdp-sticky-bar"),e=document.querySelector("product-template"),o=document.querySelector(".pdp-atc-btn-wrapper");t=="mobile"?B(e)?a.classList.remove("active"):a.classList.add("active"):t=="desktop"&&(B(e)||H(o)?a.classList.remove("active"):a.classList.add("active"))}function B(t){return t.getBoundingClientRect().bottom<=window.innerHeight}function H(t){const a=t.getBoundingClientRect();return a.top>=0&&a.left>=0&&a.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&a.right<=(window.innerWidth||document.documentElement.clientWidth)}function N(t,a){var e,o,s;for(o=document.getElementsByClassName("pdp-tabcontent"),e=0;e<o.length;e++)o[e].style.display="none",o[e].style.opacity="0";for(s=document.getElementsByClassName("pdp-tablinks"),e=0;e<s.length;e++)s[e].className=s[e].className.replace(" active","");document.getElementById(a).style.display="block",setTimeout(()=>{document.getElementById(a).style.opacity="1"},0),t.currentTarget.className+=" active"}let k=document.querySelectorAll(".pdp-tablinks");k.forEach(t=>{t.addEventListener("click",a=>{let e=a.target.dataset.action;N(a,e)})});k.length>1?document.getElementById("pdp_Desc_Open").click():k.length==1&&k[0].click();function R(t){var n,r;let e=((n=window.productData)==null?void 0:n.product.variants).find(c=>c.id==t),o=document.querySelector("#alertSize"),s=document.querySelector("#alertPrice");s.innerHTML=A.formatMoney(e.price),(r=window.productData)!=null&&r.hasOnlyDefaultVariant||(o.innerHTML=e.title,O(e.title,o))}function O(t,a){let e=a.parentElement;t=t==null?void 0:t.toLowerCase(),t=="uni"||t=="-"?e.classList.add("hide"):e.classList.remove("hide")}function W(){let t=document.querySelector("#notify_me_alert");window.matchMedia("(max-width:767px)").matches&&V.forEach(a=>{a.addEventListener("click",()=>{t.classList.add("active")})})}W();function Q(){const t=document.querySelectorAll(".pdp-accordion-mob details");t.forEach(a=>{a.addEventListener("click",()=>{t.forEach(e=>{e!==a&&e.removeAttribute("open")})})})}Q();let X=Array.from(document.querySelectorAll(".pdp-sticky-bar .pdp-swatch")),j=Array.from(document.querySelectorAll(".desktop-sticky-bar .pdp-notify")),$=Array.from(document.querySelectorAll(".pdp-sticky-bar .pdp-notify")),F=[...X,...j,...$];F.forEach((t,a)=>{t.addEventListener("click",()=>{let e=document.querySelector(`product-info .pdp-swatch[data-value='${t.dataset.value}']`);e==null||e.classList.add("active"),U()})});function U(){document.querySelector(".prod-info notify-form").scrollIntoView({behavior:"smooth",block:"end"})}
2//# sourceMappingURL=product-main-info-c79fb3fa.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.