if(void 0===Shopify){var Shopify=window.Shopify||{};Shopify.shop="",Shopify.currency={active:pplr_shop_currency,rate:"1"}}function p_numberWithCommas(e,t,r){var i=".",n=",";"undefined"==typeof pplr_money_formate||t||pplr_money_formate.indexOf("amount_with_comma_separator")>-1&&(i=",",n="."),t&&r.indexOf("amount_with_comma_separator")>-1&&(i=",",n=".");for(var p=(e+="").split("."),a=p[0],o=p.length>1?i+p[1]:"",l=/(\d+)(\d{3})/;l.test(a);)a=a.replace(l,"$1"+n+"$2");return a+o}function c_decodeHtml(e){var t=document.createElement("textarea");return t.innerHTML=e,t.value}String.prototype.c_deentitize=function(){var e=this.replace(/&/g,"&");return e=(e=(e=(e=(e=e.replace(/>/g,">")).replace(/</g,"<")).replace(/"/g,'"')).replace(/'/g,"'")).replace(/&/g,"&")};var pplr_ua=navigator.userAgent||navigator.vendor||window.opera;window.addEventListener("pageshow",function(e){(e.persisted||void 0!==window.performance&&2===window.performance.navigation.type)&&(pplr_ua.indexOf("Instagram")>-1&&window.location.reload(),window.pplr_cart_item_config(!0))});var pplrReadyCustomCommon=function(e){"interactive"===document.readyState||"complete"===document.readyState?e():document.addEventListener("DOMContentLoaded",e)},pplr_cur="USD",pplr_c_t_v_i="Click to view image",pplr_check_class=".a_pplr_item_line_price,.a_pplr_item_price,.pplr_item_price,.pplr_item_line_price,.pplr_subtotal_price";if(void 0===loadScript_p_common)var loadScript_p_common=function(e,t){var r=document.createElement("script");r.type="text/javascript",r.setAttribute("defer","defer"),r.readyState?r.onreadystatechange=function(){"loaded"!=r.readyState&&"complete"!=r.readyState||(r.onreadystatechange=null,t())}:r.onload=function(){t()},r.src=e,document.getElementsByTagName("head")[0].appendChild(r)};window.pplr_draftorder=!1,window.pplr_additional=!1,void 0===window.pplr_discount_docapp&&(window.pplr_discount_docapp={}),window.no_self_running_request=!0,window.pplr_css_loaded=!1,window.pplr_mutation_elem=0,window.pplr_atc_triggered=!1;var pplr_clicksettime,pplr_draft_settime,pplr_remove_class=".pplr_item_remove",pplr_checkout_btn='[name="checkout"],a[href="/checkout"]';if("undefined"!=typeof pplr_manual_theme_selector&&null!==pplr_manual_theme_selector){for(var p_m_t_s=pplr_manual_theme_selector,p_m_t_s2=[],k=0;k0){if(r>2)return a=(s=jQuery(":contains("+t+"),:contains("+t+" "+n+"),:contains("+p_numberWithCommas(t)+"),:contains("+p_numberWithCommas(t)+" "+n+")")).filter(function(){return 0===jQuery(this).children().length});if(r>1){var a=(s=jQuery(":contains("+t+"):not(.a_pplr_item_price):not(.a_pplr_line_item_price),:contains("+t+" "+n+"):not(.a_pplr_item_price):not(.a_pplr_line_item_price),:contains("+p_numberWithCommas(t)+"):not(.a_pplr_item_price):not(.a_pplr_line_item_price),:contains("+p_numberWithCommas(t)+" "+n+"):not(.a_pplr_item_price):not(.a_pplr_line_item_price),:contains("+p_numberWithCommas(t).replace(".","")+")")).filter(function(){return 0===jQuery(this).children().length}),o=p_numberWithCommas(t),l=c_decodeHtml(pplr_money_formate).replace("amount_no_decimals_with_comma_separator",o).replace("amount_no_decimals",o).replace("amount_with_comma_separator",o).replace("amount",o).replace("{{ ","").replace("{{","").replace("}}","");a.length>1&&!a.closest("form")[0]&&void 0!==p_m_t_s&&""!==p_m_t_s[8]&&jQuery(p_m_t_s[8])[0]&&(a=jQuery(p_m_t_s[8])),0==a.length&&s.length>0&&(s.last().is(pplr_check_class)||0!=s.last().find(pplr_check_class).length||(a=s.last())),jQuery(a).each(function(e){var r=jQuery(this).text();if(r.indexOf(l)>-1&&""!==jQuery.trim(r.replace(l,""))){var i=jQuery(this).contents().filter(function(){return this.nodeType==Node.TEXT_NODE&&jQuery(this).text().toLowerCase().indexOf(t.toLowerCase().split(".")[0].split(",")[0])>-1});if(0==jQuery(this).find("[pplr_s_price]").length&&!jQuery(this).is("[pplr_s_price]")&&!jQuery(this).parent("option")[0]&&!jQuery(this).is("noscript")){var n=i.text().replace(l,""+l+"");i.after(n),i.remove()}}})}else{0==(a=(s=jQuery(e).find(":contains("+t+"):not(.a_pplr_item_price):not(.a_pplr_line_item_price),:contains("+p_numberWithCommas(t)+"):not(.a_pplr_item_price):not(.a_pplr_line_item_price)")).filter(function(){return 0===jQuery(this).children().length})).length&&s.length>0&&0==jQuery(e).find(pplr_check_class).length&&(a=s.last())}}else{var s;0==(a=(s=jQuery(e).find(":contains("+t+"):not(.a_pplr_item_price),:contains("+p_numberWithCommas(t)+"):not(.a_pplr_item_price)")).filter(function(){return 0===jQuery(this).children().length&&jQuery(this).is(":visible")&&!jQuery(this).is('[class*="subtotal"]')&&!jQuery(this).parents('[class*="subtotal"]')[0]})).length&&s.length>0&&0==jQuery(e).find(pplr_check_class).length&&(a=s.last()),0==p&&1==a.length&&(a=jQuery(".abrakadebra"))}return a}function renderDiscountInput(){window.dInit||function(){window.dInit={};var e="pplr_discount";localStorage.setItem(e,JSON.stringify(d()));var t=document.createElement("style");t.appendChild(document.createTextNode("\n .ppl_discount_wrapper{\n --btn-bg-color: black;\n --btn-color: white;\n --input-border: 1px solid black;\n --placeholder-color: gray;\n --spinner-color: white;\n --input-color: black;\n --tag-wrap-bg: #dfdfdf;\n --tag-txt-color: black;\n --tag-close-color: black;\n --text-color: black;\n --dis-tag-color: #212121;\n\n display: flex;\n flex-direction: column;\n align-items: end;\n }\n .ppl_dis_has_dark_parent{\n --btn-bg-color: rgb(150, 150, 150);\n --btn-color: black;\n --input-border: 1px solid rgb(150, 150, 150);\n --placeholder-color: rgb(150, 150, 150);\n --spinner-color: black;\n --input-color: rgb(150, 150, 150);\n --tag-wrap-bg: rgb(150, 150, 150);\n --tag-txt-color: black;\n --tag-close-color: black;\n --text-color: rgb(237, 237, 237);\n --dis-tag-color: rgb(150, 150, 150);\n }\n @keyframes ppl_spinner-border {\n to { transform: rotate(360deg); }\n }\n \n #ppl_dis_wrap .ppl_spinner-border {\n display: inline-block;\n width: 22px;\n height: 22px;\n vertical-align: text-bottom;\n border: 0.25em solid currentColor;\n border-right-color: transparent;\n border-radius: 50%;\n -webkit-animation: ppl_spinner-border .75s linear infinite;\n animation: ppl_spinner-border .75s linear infinite;\n background-color: transparent;\n background: transparent;\n }\n #ppl_dis_wrap .ppl_sr-only{\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0,0,0,0);\n white-space: nowrap;\n border: 0;\n }\n #ppl_dis_wrap .ppl_info_wrapper{\n margin-top: 3px;\n color: var(--text-color);\n }\n #ppl_dis_wrap .ppl_err_msg, #ppl_dis_wrap .ppl_success_msg{\n display: flex;\n align-items: center;\n justify-content: space-between;\n position: relative;\n padding: 1px 7px;\n margin-bottom: 0.5rem;\n border: 1px solid transparent;\n font-size: 0.8em;\n border-radius: 0.25rem;\n }\n #ppl_dis_wrap .ppl_err_msg{\n color: #721c24;\n background-color: #f8d7da;\n border-color: #f5c6cb;\n }\n #ppl_dis_wrap .ppl_err_msg svg{\n fill: #721c24;\n }\n #ppl_dis_wrap .ppl_success_msg{\n color: #155724;\n background-color: #d4edda;\n border-color: #c3e6cb;\n }\n #ppl_dis_wrap .ppl_success_msg svg{\n fill: #155724;\n }\n #ppl_dis_wrap .ppl_tag_holder .ppl_spinner-border{\n font-size: 7px;\n color: black;\n width: 10px;\n height: 10px;\n color: black;\n }\n #ppl_dis_wrap .ppl_tag_holder{\n background-color: var(--tag-wrap-bg);\n color: var(--tag-txt-color);\n display: inline-flex;\n align-items: center;\n border-radius: 4px;\n padding: 1px 5px;\n }\n #ppl_dis_wrap .ppl_tag_holder span{\n color: var(--tag-txt-color);\n display: inline-block;\n margin-left: 2px;\n margin-right: 2px;\n font-size: 0.9em;\n text-transform: uppercase;\n letter-spacing: 0.01rem;\n }\n #ppl_dis_wrap .ppl_tag_holder button[data-close].ppl_close_dis_tag\n ,#ppl_dis_wrap .ppl_tag_holder button[disabled].ppl_close_dis_tag{\n background: transparent;\n background-color: transparent;\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 18px;\n padding: 0;\n }\n #ppl_dis_wrap .ppl_tag_holder button svg{\n fill: var(--tag-close-color);\n }\n #ppl_dis_wrap .ppl_discount_wrapper{\n display: flex;\n flex-direction: column;\n align-items: end;\n margin-bottom: 10px;\n margin-top: 10px;\n }\n #ppl_dis_wrap .ppl_discount_inner_wrapper{\n max-width: 450px;\n width: 100%;\n margin-top: 10px;\n margin-bottom: 10px;\n }\n #ppl_dis_wrap .ppl_discount_input_wrapper{\n text-align: right;\n margin-bottom: 8px;\n margin-left: auto;\n width: 100%;\n display: flex;\n gap: 10px;\n align-items: center;\n }\n #ppl_dis_wrap input.ppl_dis_input, #ppl_dis_wrap input.ppl_dis_input:focus{\n display: block;\n padding: 0.475rem 0.75rem;\n width: 100%;\n outline: none;\n box-shadow: none;\n background-color: transparent;\n border: var(--input-border);\n height: 40px;\n color: var(--input-color);\n height: 40px;\n min-height: 40px;\n max-height: 40px;\n margin: 0;\n cursor: auto;\n text-align: left;\n }\n #ppl_dis_wrap input.ppl_dis_input::placeholder,\n #ppl_dis_wrap input.ppl_dis_input:focus::placeholder,\n #ppl_dis_wrap input.ppl_dis_input::-webkit-input-placeholder,\n #ppl_dis_wrap input.ppl_dis_input:focus::-webkit-input-placeholder{\n color: var(--placeholder-color);\n }\n #ppl_dis_wrap button.ppl_dis_apply{\n color: var(--btn-color);\n background-color: var(--btn-bg-color);\n text-align: center;\n border: none;\n width: 110px;\n font-size: 0.9em;\n cursor: pointer;\n max-width: 110px;\n min-width: 110px;\n height: 40px;\n min-height: 40px;\n max-height: 40px;\n padding: unset;\n margin: unset;\n }\n #ppl_dis_wrap button.ppl_dis_apply:hover{\n opacity: 0.8;\n color: var(--btn-color);\n background-color: var(--btn-bg-color);\n }\n #ppl_dis_wrap button.ppl_dis_apply::before,\n #ppl_dis_wrap button.ppl_dis_apply::after{\n color: var(--btn-color);\n background-color: var(--btn-bg-color);\n }\n #ppl_dis_wrap .ppl_dis_tags_wrapper{\n display: flex;\n align-items: start;\n flex-wrap: wrap;\n gap: 6px;\n }\n ")),document.head.appendChild(t);var r='',i='',n='\n
\n Loading...\n
\n ',p=document.createElement("template");p.innerHTML=`\n
\n ${r}\n \n \n
\n `;var a=document.createElement("template");a.innerHTML=`\n
\n
\n ${r}\n \n
\n \n
`;var o=document.createElement("template");o.innerHTML='\n
\n
\n Shipping\n
\n \n
';var l=document.createElement("template");l.innerHTML='\n
\n
\n Subtotal
\n
\n
\n
\n
\n EST. TOTAL\n
\n
\n ';var s=document.createElement("template");s.innerHTML=`\n
\n \n \n
\n `,document.createElement("template").innerHTML=`\n
\n \n \n
\n `;var _=document.createElement("textarea");function c(e){return _.innerHTML=e,_.value}function d(){try{return JSON.parse(localStorage.getItem(e))??[]}catch(e){return[]}}function u(e){const t=function(e){const t={black:"rgb(0, 0, 0)",white:"rgb(255, 255, 255)",red:"rgb(255, 0, 0)",green:"rgb(0, 128, 0)",blue:"rgb(0, 0, 255)",yellow:"rgb(255, 255, 0)",pink:"rgb(255, 192, 203)",purple:"rgb(128, 0, 128)",orange:"rgb(255, 165, 0)",cyan:"rgb(0, 255, 255)",magenta:"rgb(255, 0, 255)",gray:"rgb(128, 128, 128)"};function r(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e.startsWith("var(--")&&(e=window.getComputedStyle(document.documentElement).getPropertyValue(e)),e.startsWith("#")){const t=e.replace("#",""),r=parseInt(t,16);return`rgb(${r>>16&255}, ${r>>8&255}, ${255&r})`}if(e.startsWith("rgb("))return e;if(e.startsWith("rgba(")){const t=e.match(/[\d.]+/g);if(t&&4===t.length)return`rgb(${t[0]}, ${t[1]}, ${t[2]})`}if(e.startsWith("hsl(")){const t=e.match(/[\d.]+/g);if(t&&3===t.length){const e=parseFloat(t[0]),i=parseFloat(t[1]),n=parseFloat(t[2]);let p,a,o;if(0==i)p=a=o=n;else{let t=n<.5?n*(1+i):n+i-n*i,l=2*n-t;p=r(l,t,e+1/3),a=r(l,t,e),o=r(l,t,e-1/3)}return`rgb(${Math.round(255*p)}, ${Math.round(255*a)}, ${Math.round(255*o)})`}}return Object.keys(t).includes(e)?t[e]:null}(e);if(!t)return null;const r=/(\d+),\s*(\d+),\s*(\d+)/.exec(t);return r?(.299*parseInt(r[1],10)+.587*parseInt(r[2],10)+.114*parseInt(r[3],10))/255>.2?"light":"dark":null}function m(e,t){"string"==typeof e&&(e=e.replace(".",""));var r="",i=/\{\{\s*(\w+)\s*\}\}/,n=t||this.money_format;function p(e,t){return void 0===e?t:e}function a(e,t,r,i){if(t=p(t,2),r=p(r,","),i=p(i,"."),isNaN(e)||null==e)return 0;var n=(e=(1*e/100).toFixed(t)).split(".");return n[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+r)+(n[1]?i+n[1]:"")}switch(n.match(i)[1]){case"amount":r=a(e,2);break;case"amount_no_decimals":r=a(e,0);break;case"amount_with_comma_separator":r=a(e,2,".",",");break;case"amount_no_decimals_with_comma_separator":r=a(e,0,".",",");break;case"amount_with_apostrophe_separator":r=a(e,2,"'")}return n.replace(i,r)}function h(){document.querySelectorAll("[pplr_set_price]:not(.a_pplr_item_line_price,.a_pplr_item_price)").forEach(function(e,t){for(var r=e.parentElement,i=jQuery(`.z_discount_input_${e.getAttribute("data-dis_for")}`).parents(".ppl_discount_wrapper").find(".ppl_dis_infowrapper_main")[0];r&&!i;){var n=r.querySelector("[data-pplr-checkout-id]");n?(i=document.querySelector(`.z_discount_input_${n.getAttribute("data-pplr-checkout-id")}`),i=jQuery(i).parents(".ppl_discount_wrapper").find(".ppl_dis_infowrapper_main"),e.setAttribute("data-dis_for",n.getAttribute("data-pplr-checkout-id")),r=null):r=r.parentElement}if(i){var p=function(e){const t=window.getComputedStyle(e);return{color:e.style.color?e.style.color:t.color,fontSize:e.style.fontSize?e.style.fontSize:t.fontSize}}(e);jQuery(i).css(p)}})}async function y(t,r,i=void 0){var n=i||window.pplr_cart;try{n=JSON.parse(i)}catch(e){}var p=JSON.parse(localStorage.getItem(e))??[];if(t=Array.isArray(t)?t:[t],0!=(t=[...new Set([...p,...t])]).length){if(p.slice().sort().join(",")===t.slice().sort().join(","))return b(n),void jQuery(".ppl_dis_apply").html(c(window.dInit.options.applyBtnTxt));var a={discount:t,store:Shopify.shop,cart:n};return jQuery.ajax({url:"https://cdn-zeptoapps.com/product-personalizer/discount-check-draft.php",method:"POST",data:a,success:function(e){const t="string"==typeof e?JSON.parse(e):e;if(!Array.isArray(t))return v("Invalid response from server."),void jQuery(".ppl_dis_apply").html(c(window.dInit.options.applyBtnTxt));let r=[],i=[];t.forEach(e=>{if(e.valid){let t=function(e){let t=e.original_total_price;return e.items?.length>0&&e.items.forEach(e=>{e.properties&&e.properties._pplr_addprice&&(t+=Number(e.properties._pplr_addprice*Shopify.currency.rate))}),t}(window.pplr_cart);if("SHIPPING"===e.data.discountClass){if(!(t/100>=Number(e.data.minimumRequirement?.greaterThanOrEqualToSubtotal?.amount||0)))return void v(`Discount code "${e.discount_code}" isn’t valid for the items in your cart`);i.push({amount:0,title:e.discount_code,discount_class:"SHIPPING"})}r.push(e.discount_code)}else v(`Invalid discount code: ${e.discount_code}`),jQuery(".ppl_dis_apply").html(c(window.dInit.options.applyBtnTxt))}),i.length>0?window.dInit.summary=JSON.stringify({adiscounts:i}):delete window.dInit.summary,r.length>0&&f(r)},error:function(e){console.error("Error applying discount:",e),v("An error occurred while applying the discount."),jQuery(".ppl_dis_apply").html(c(window.dInit.options.applyBtnTxt))}})}delete window.dInit.summary}function f(t){var r=JSON.parse(localStorage.getItem(e))??[];r=Array.isArray(t)?[...r,...t]:[...r,t];var i=(r=[...new Set(r)]).join(","),n=JSON.parse(localStorage.getItem("PPLR_SHIPPING")||"{}");if(Object.keys(n).length>0){var p=n.title;r.includes(p)||(localStorage.setItem("PPLR_SHIPPING",JSON.stringify({})),window.dInit.summary=JSON.stringify(JSON.parse(window.dInit.summary||"{}").adiscounts.filter(e=>"SHIPPING"!==e.discount_class)))}const a=`/checkout?discount=${encodeURIComponent(i)}`,o=document.createElement("iframe");o.src=a,o.style.display="none",document.body.appendChild(o),setTimeout(function e(){o.contentDocument&&"loading"===o.contentDocument.readyState?(o.remove(),jQuery.ajax({url:"/cart.json",success:function(e){window.pplr_cart=e,b(e),jQuery(".ppl_dis_apply").html(c(window.dInit.options.applyBtnTxt))}})):setTimeout(e,50)},50)}async function g(){jQuery.ajax({url:"/cart.json",success:function(e){window.pplr_cart=e,y(d())}})}async function w(e,t="This discount code couldn't be applied!"){return new Promise(async function(t,r){await y([e]).catch(r)})}function v(e){var t=s.content.cloneNode(!0);t.querySelector("[data-text]").innerHTML=e,jQuery(".ppl_msg_wrapper").html(t)}function b(t){jQuery(".ppl_dis_tags_wrapper, .ppl_info_wrapper").html("");let r=0;var i=0;let n=[],s=0,_=[],d=Number(t.total_price),u=Number(t.original_total_price);if(t&&t.cart_level_discount_applications?.length>0){let e=l.content.cloneNode(!0);e.querySelector("[data-discounts]"),e.querySelector("[data-shipping]"),t.cart_level_discount_applications.forEach(e=>{let t=Number(e.total_allocated_amount);r+=t,s+=t,n.push(e.title),_.push(e.title)}),i++}t&&t.items?.length>0&&t.items.forEach(e=>{if(e.properties&&e.properties._pplr_addprice){var p=0,a=Number(e.properties._pplr_addprice*Shopify.currency.rate)*e.quantity;if(u+=a,t.cart_level_discount_applications.forEach(e=>{"fixed_amount"!==e?.value_type&&(p=a*Number(e?.value||0)/100,s+=p)}),e.line_level_discount_allocations.length>0){var o=e.line_level_discount_allocations[0]?.discount_application;r+=Number(e.line_level_discount_allocations[0]?.amount),"fixed_amount"!==o.value_type&&(p+=a*Number(o.value||0)/100),n.push(o.title)}d+=a-p,r+=p,p>0&&i++}});let y=JSON.parse(localStorage.getItem("PPLR_SHIPPING")||"{}"),f=JSON.parse(window.dInit.summary||"{}").adiscounts?.find(e=>"SHIPPING"===e.discount_class)||!(!y||!Object.keys(y).length)&&y,g=l.content.cloneNode(!0);if(f){var w=g.querySelector("[data-shipping"),v=o.content.cloneNode(!0);v.querySelector("[data-dis_tag").innerHTML=c(window.dInit.options.shippingLabel),v.querySelector("[data-discount").innerHTML="FREE",w.append(v),n.push(f.title),0==r&&jQuery(".ppl_info_wrapper").html(g)}if(r>0){let e=g.querySelector("[data-discounts]"),t=a.content.cloneNode(!0);t.querySelector("svg path").style.fill="var(--dis-tag-color)";var b=n;f&&(b=b.filter(e=>e!==f.title)),t.querySelector("[data-dis_tag]").innerText=b.join(", "),t.querySelector("[data-discount]").innerHTML="-"+m(r,window.pplr_money_formate),e.append(t),jQuery(".ppl_info_wrapper").html(g)}if(i>0||r>0||f){if(n.forEach(e=>{let t=p.content.cloneNode(!0);t.querySelector("[data-tag]").innerText=e,t.querySelector("[data-close]").setAttribute("data-close",e),t.querySelector("[data-close]").setAttribute("data-key",e),t.querySelector("[data-close]").classList.add("ppl_close_dis_tag"),t.querySelector("[data-wrapper]").classList.add("ppl_tag_wrapper"),jQuery(".ppl_dis_tags_wrapper").append(t)}),jQuery("[data-subtotal_lbl]").html(c(window.dInit.options.subtotalLabel)),jQuery("[data-total_lbl]").html(c(window.dInit.options.totalLabel)),jQuery("[data-original]").html(m(u,window.pplr_money_formate)),jQuery("[data-discounted]").html(m(d,window.pplr_money_formate)),jQuery(".ppl_dis_apply").html(c(window.dInit.options.applyBtnTxt)),s>0||f){var j=[{amount:s,title:_.join("-"),discount_class:"order"}];f&&(j.push({amount:f.amount,title:f.title,discount_class:"SHIPPING"}),localStorage.setItem("PPLR_SHIPPING",JSON.stringify(f))),window.dInit.summary=JSON.stringify({adiscounts:j})}else f||delete window.dInit.summary;localStorage.setItem(e,JSON.stringify(n||[])),Q="",void 0!==p_m_t_s&&""!==p_m_t_s[8]&&(Q=","+p_m_t_s[8]),jQuery(".pplr_subtotal_price:not(.visually-hidden,.pplr_dis_subtitle_detection),.pplr_save_price:not(.a_pplr_item_price,.a_pplr_item_line_price,.pplr_dis_subtitle_detection,.visually-hidden,.a_pplr_item_oprice)"+Q).each(function(){var e=this,t=0;e.classList.add("pplr_dis_subtitle_detection");for(var r=e.parentElement,i=null,n=!r.closest(".p_a_t_ch")&&!r.querySelector(".p_a_t_ch");r&&t<2&&n;)i=r,jQuery(r).find(':visible:not(:empty,.skeleton-view, :hidden, link, script, style, meta, input[type="hidden"], select:not(:has(option:visible)), iframe, audio:not([controls]), video:not([controls]), noscript, details, progress)').each(function(e){t++}),n=!(r=r.parentElement).closest(".p_a_t_ch")&&!r.querySelector(".p_a_t_ch"),(r.querySelector(".ppl_discount_wrapper")||r.querySelector(".pplr_cart_row")||r.querySelector('[name*="updates[]"],a[href*="/cart/change"],img[src*="/products/"],img[src*="/files/"],img[src*="/shopifycloud/"],input[type*="number"]'))&&(r=null);i?i.classList.add("ppl_dis_toggle_el"):e.classList.add("ppl_dis_toggle_el")}),jQuery(".ppl_dis_toggle_el").hide(),h()}else jQuery(".ppl_dis_toggle_el").show(),jQuery(".ppl_msg_wrapper").html(""),localStorage.setItem(e,JSON.stringify([])),delete window.dInit.summary;var Q}async function j(t){var r=function(t){var r=d()??[];if(!t)return r;var i=t.toLowerCase();return r=r.filter(e=>e.toLowerCase()!==i),localStorage.setItem(e,JSON.stringify(r)),r}(t.getAttribute("data-key"));0==r.length&&(r=["ppl_dis_code_clear"]),f(r)}function Q(e){if(!e)return[];var t=jQuery(e),r=[];return t.each(function(){var e=jQuery(this),t=e.find("[name='checkout'],[form='cart'],[href*='/checkout']:visible");if(t[0])r.push(t[0]);else if(e[0]&&e[0].id){var i=jQuery(`[form="${e[0].id}"]:not(textarea)`)[0];i&&r.push(i)}}),r}function x(){var e=document.querySelector(".ppl_discount_wrapper");e&&"none"!==e.style.display&&"none"!==window.getComputedStyle(e).display&&(h(),jQuery(".ppl_discount_wrapper").each(function(){const e=function(e){for(;e;){let t=e.style.backgroundColor||e.style.background;if(!t){const r=window.getComputedStyle(e);t=r.backgroundColor||r.background}if("rgba(0, 0, 0, 0)"!==t&&"transparent"!==t)return t;e=e.parentElement}return null}(jQuery(this).parent()[0]);if(e&&jQuery(this).attr("data-prev-color")!==e){const t=u(e);jQuery(this).attr("data-prev-color",e),"dark"===t?jQuery(this).addClass("ppl_dis_has_dark_parent"):jQuery(this).removeClass("ppl_dis_has_dark_parent")}}))}function k(e=[]){let t=0;for(let r=0;r{{ code }} is invalid",inputPlaceholderTxt:window.pplr_manual_theme_selector[13]?c(window.pplr_manual_theme_selector[13]):"Discount Code",applyBtnTxt:window.pplr_manual_theme_selector[14]?c(window.pplr_manual_theme_selector[14]):"Apply",customPosClass:window.pplr_manual_theme_selector[15]?c(window.pplr_manual_theme_selector[15]):null,subtotalLabel:window.pplr_manual_theme_selector[16]?c(window.pplr_manual_theme_selector[16]):"Subtotal",shippingLabel:window.pplr_manual_theme_selector[17]?c(window.pplr_manual_theme_selector[17]):"Shipping",totalLabel:window.pplr_manual_theme_selector[18]?c(window.pplr_manual_theme_selector[18]):"EST. Total"};var e=window.dInit.options.customPosClass,t=null;if(e&&(t=document.querySelectorAll(`${e}`)).length<=0&&(e=null),window.dInit.options.showDiscountInput){var r=!1,i=e?t:[];if(!e&&(i=[],Array.isArray(window.pplr_cart_row))){var p=Q(".pplr_cart_form_n");p.length>0&&(i=p),window.pplr_cart_row.forEach(function(e){var t=e.split(" ")[0];t&&(p=Q(t)).length>0&&(i=[...i,...p])})}i.forEach(function(t){let i=t.getAttribute("data-pplr-checkout-id");""!=i&&null!==i||(i=Date.now()+""+Math.floor(100*Math.random()),t.setAttribute("data-pplr-checkout-id",i));var p="z_discount_input_"+i;if(!document.querySelector("."+p)){var a=void 0;if(a=e?jQuery(t).closest(e)[0]:function(e){for(var t=e.parentElement,r=void 0;t&&void 0===r;){let e=t.querySelector('[name*="updates[]"],a[href*="/cart/change"],img[src*="/products/"],img[src*="/files/"],img[src*="/shopifycloud/"],input[type*="number"]');e&&(r=e),t=t.parentElement}if(r){for(var i=r.parentElement,n=void 0;i&&void 0===n;){if(jQuery(i).find(e)[0])for(var p=jQuery(i).children(),a=0;a1&&(o=d[0]),d=p;for(var u=m(o);!u&&o!=n&&!jQuery(o).find(n)[0]&&(u=m(o=jQuery(o).parent()[0]),void 0!==o););return o}function m(e){var t='a, input, button, .skeleton-view, link, script, style, meta, input[type="hidden"], select:not(:has(option:visible)), iframe, audio:not([controls]), video:not([controls]), noscript, details, progress',r=":visible:not(:hidden,"+t+")";return jQuery(e).find(r).filter(function(){return!jQuery(this).closest(t)[0]&&jQuery(this).contents().filter(function(){return 3===this.nodeType&&""!==this.textContent.trim()}).length>0}).length>0}}(t),a&&!jQuery(a).find(".z_discount_input")[0]){jQuery(a).find(".a_pplr_item_price,.a_pplr_item_line_price").addClass("pplr_subtotal_price");var o=document.createElement("div");o.classList.add("ppl_discount_wrapper"),o.setAttribute("id","ppl_dis_wrap"),o.setAttribute("data-ppl-item-id",t.getAttribute("data-ppl-item-id"));var l=document.createElement("div");l.classList.add("ppl_discount_inner_wrapper");var s=document.createElement("div");s.classList.add("ppl_discount_input_wrapper");var _=document.createElement("input");_.type="text",_.placeholder="Discount Code",_.classList.add("z_discount_input","ppl_dis_input",p),_.placeholder=window.dInit.options.inputPlaceholderTxt,_.addEventListener("keydown",async function(e){var t=e.target,r=/(\u00a9|\u00ae|(?![\u2018\u2019\u201C\u201D])[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/g;if(r.test(t.value)&&(t.value=t.value.replace(r,"")),"Enter"==e.key){if(e.preventDefault(),""===_.value||null===_.value)return;jQuery(".ppl_dis_apply").html(n),jQuery(".ppl_dis_msg").remove(),await w(_.value,window.dInit.options.discountInvalidTxt),_.value="",jQuery(".ppl_dis_apply").html(c(window.dInit.options.applyBtnTxt))}});var d=document.createElement("button");d.classList.add("ppl-dis-apply"),d.innerHTML=c(window.dInit.options.applyBtnTxt),d.type="button",d.classList.add("ppl_dis_apply"),d.addEventListener("click",async function(){""!==_.value&&null!==_.value&&(jQuery(this).html(n),jQuery(".ppl_dis_msg").remove(),await w(_.value,window.dInit.options.discountInvalidTxt),_.value="",jQuery(this).html(c(window.dInit.options.applyBtnTxt)))});var u=document.createElement("div");u.classList.add("ppl_dis_tags_wrapper");var m=document.createElement("div");m.classList.add("ppl_info_wrapper"),m.style.marginTop="3px";var h=document.createElement("div");h.classList.add("ppl_msg_wrapper"),h.style.marginTop="3px",s.appendChild(_),s.appendChild(d),l.appendChild(s),l.appendChild(u),l.appendChild(m),s.insertAdjacentElement("afterend",h),o.appendChild(l),a.prepend(o),r=!0}}}),r&&(g(),x())}};var S=new MutationObserver(x),C=new MutationObserver(x);S.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),C.observe(document.body,{attributes:!0,attributeFilter:["class"]}),jQuery(document).on("click",".ppl_close_dis_tag",function(e){e.preventDefault(),jQuery(this).prop("disabled",!0).html(n),j(this),jQuery(".ppl_msg_wrapper").html("")}),jQuery(document).on("click",".ppl_dis_close_msg",function(e){e.preventDefault(),jQuery(this).parent(".ppl_dis_msg").remove()})}(),document.querySelector(".ppl_discount_wrapper")?window.dInit.reloadDiscounts():window.dInit.renderDiscountInput()}function find_desired_row(e){if(0!==e.items.length){var t="",r="";if(pplr_money_formate.indexOf("amount")>-1){var i=pplr_money_formate.replace(/<\/?[^>]+(>|$)/g,"");r=c_decodeHtml(i.split("{{")[0]),i.split("}}").length>1&&(t=c_decodeHtml(i.split("}}")[1]))}0==/^[\u0000-\u007f]*$/.test(r)&&(r=""),0==/^[\u0000-\u007f]*$/.test(t)&&(t="");var n=2;pplr_money_formate.indexOf("amount_no_decimals")>-1&&(n=0);var p=jQuery(pplr_checkout_btn).parents("form");p[0]&&0===p.find('img[src*="/products/"],img[src*="/files/"],[name*="updates["],img[src*="/shopifycloud/"],input[type="number"]').length&&p.addClass("pplr_unwantedform");var a=0,o='[name*="updates["],a[href*="/cart/change"],a[href="/checkout"]';if(void 0!==p_m_t_s&&(o=o+","+p_m_t_s[9]),jQuery(o).each(function(e){0==jQuery(this).closest("form:not(.pplr_unwantedform)").length&&(a+=1)}),jQuery('a[href="/checkout"]').length>1&&(a=a-jQuery('a[href="/checkout"]').length+1),a>0){var l="/products/"+e.items[0]?.image?.split("/products/").pop().split("_")[0];jQuery(pplr_checkout_btn).each(function(e){if(0==jQuery(this).closest("form:not(.pplr_unwantedform)").length){var t=jQuery("_____a"),r=!1;jQuery(this).parentsUntil("body").each(function(e){jQuery(this).find("form:not(.pplr_unwantedform)").length<1&&jQuery(this).find(o).length==a&&jQuery(this).find('[src*="'+l+'"]').length>0&&1==jQuery(this).find(pplr_checkout_btn).length&&!r&&!jQuery(this).is("body")&&(t=jQuery(this),r=!0)}),t[0]&&t.addClass("pplr_cart_form_n")}})}jQuery('form[action*="/cart"]:not([action*="/cart/add"]):has(img[src*="/products/"]),form[action*="/cart"]:not([action*="/cart/add"]):has([name*="updates["]):not(:has(img[src*="/products/"])),form[action*="/cart"]:not([action*="/cart/add"]):has(input[type="number"]):not(:has(img[src*="/products/"])):not(:has([name*="updates["])),form[action*="/checkout"]:not([action*="/cart/add"]):has(img[src*="/products/"]),form[action*="/checkout"]:not([action*="/cart/add"]):has(img[src*="/files/"]),.pplr_cart_form_n').each(function(i){var p,a=!0;if(jQuery(this).find('[name*="updates["]:visible').length>0){var o=jQuery(this).find('[name*="updates["]:visible');a=!1}var l=jQuery(this).find('[name*="updates["]').length;if(l>0&&a&&l==e.items.length){o=jQuery(this).find('[name*="updates["]');a=!1}if(a&&jQuery(this).is(".pplr_cart_form_n")){o=jQuery(this).find("input");a=!1}if(a&&jQuery(this).find('img[src*="/products/"],img[src*="/shopifycloud/"],img[src*="/files/"]').length>0){o=jQuery(this).find('img[src*="/products/"],img[src*="/shopifycloud/"],img[src*="/files/"]');a=!1}if(a){o=jQuery(this).find('input[type="number"]');a=!1}var s=!1;if(o.each(function(e){s||(0===e?p=jQuery(this).parentsUntil("form,.pplr_cart_form_n"):jQuery(this).parentsUntil("form,.pplr_cart_form_n").each(function(){var e=jQuery(this);p.each(function(){jQuery(this).siblings().is(e)&&(s=!0,jQuery(this).hasClass("pplr_cart_row")||jQuery(this).addClass("pplr_cart_row"),jQuery(this).siblings(':has(img[src*="/products/"]):not(.pplr_cart_row)').addClass("pplr_cart_row"),jQuery(this).siblings(':has(img[src*="/files/"]):not(.pplr_cart_row)').addClass("pplr_cart_row"),jQuery(this).siblings(':has([name*="updates["]):not(.pplr_cart_row)').addClass("pplr_cart_row"),jQuery(this).siblings(':has(input[type="number"]):not(.pplr_cart_row)').addClass("pplr_cart_row"),jQuery(this).siblings(':has(img[src*="/shopifycloud/"]):not(.pplr_cart_row)').addClass("pplr_cart_row"),jQuery(this).parents(".pplr_cart_form_n")[0]&&jQuery(this).siblings(":has(input):not(.pplr_cart_row)").addClass("pplr_cart_row"))})}))}),1==e.items.length){var _=e.items[0].final_price,c=e.items[0].final_line_price,d=e.items[0].original_price,u=e.items[0].original_line_price,m=findElementByText(this,r+(_/100).toFixed(n)+t,0,0,"",_);m.parents(".a_pplr_item_price,.pplr_item_price,.pplr_item_line_price")[0]||m.addClass("a_pplr_item_price").attr("data-line",0);var h=findElementByText(this,r+(c/100).toFixed(n)+t,1,0);h.parents(".a_pplr_item_line_price,.pplr_item_price,.pplr_item_line_price")[0]||(h.addClass("a_pplr_item_line_price").attr("data-line",0),h.hasClass("strike-through")&&h.addClass("a_pplr_item_oline_price").removeClass("a_pplr_item_line_price"));var y=findElementByText(this,r+(d/100).toFixed(n)+t,1,0);(y.hasClass("strike-through")||y.is("s"))&&y.addClass("a_pplr_item_oprice");var f=findElementByText(this,r+(u/100).toFixed(n)+t,1,0);(f.hasClass("strike-through")||f.is("s"))&&f.addClass("a_pplr_item_oline_price"),jQuery(".a_pplr_item_line_price,.pplr_item_price,.a_pplr_item_price").each(function(){jQuery(this).parents("form").addClass("pplr_cart_form_n")})}}),jQuery(".pplr_cart_row").each(function(){0==jQuery(this).find('img[src*="/products/"],[name*="updates["],input[type="number"],img[src*="/shopifycloud/"],img[src*="/files/"]').length&&jQuery(this).removeClass("pplr_cart_row").removeAttr("data_pplr_row")}),jQuery(".pplr_cart_row").each(function(){var i=jQuery(this).parent().find(".pplr_cart_row").index(this);if(jQuery(this).attr("data_pplr_row",i+1),i-1)jQuery(":contains("+u.toString().split("/uploads/")[1]+"):not(.pplr_slide)").filter(function(){return 0===jQuery(this).children().length}).each(function(){jQuery(this).parent().is(jQuery("body"))||jQuery(this).parents("script")[0]||jQuery(this).html(''+pplr_c_t_v_i+"")})}}jQuery(".pplr_cart_row").closest("form,.pplr_cart_form_n").each(function(e){jQuery(this).addClass("pplr_cart_form_"+e);var t=".pplr_cart_form_"+e+" .pplr_cart_row",r=".pplr_cart_form_"+e+" [data_pplr_row]";-1==window.pplr_cart_row.indexOf(t)&&(window.pplr_cart_row.push(t),window.pplr_cart_row.push(r))});var m=findElementByText(0,r+(e.total_price/100).toFixed(n)+t,2,0,pplr_cur);0==m.length&&(m=findElementByText(0,r+(e.total_price/100).toFixed(n)+t+" "+Shopify.currency.active,2,0,pplr_cur)),0==m.length&&(m=findElementByText(0,r+(e.items_subtotal_price/100).toFixed(n)+t,2,0,pplr_cur)),0==m.length&&(m=findElementByText(0,r+(e.items_subtotal_price/100).toFixed(n)+t+" "+Shopify.currency.active,2,0,pplr_cur)),0==m.length&&(m=findElementByText(0,r+(e.original_total_price/100).toFixed(n)+t,2,0,pplr_cur)),0==m.length&&(m=findElementByText(0,r+(e.original_total_price/100).toFixed(n)+t+" "+Shopify.currency.active,2,0,pplr_cur)),m.each(function(){jQuery(this).hasClass("pplr_subtotal_price")||jQuery(this).parents(".pplr_cart_row,[data_pplr_row]")[0]||jQuery(this).parents(".pplr_subtotal_price")[0]||jQuery(this).is(".a_pplr_item_line_price,.a_pplr_item_price,.strike-through, s")||jQuery(this).parents(".zcart-discount-row")[0]||(jQuery(this).parents('[class*="total"]')[0]||jQuery(this).is('[class*="total"]')||jQuery(this).parents('form[action="/cart"],.pplr_cart_form_n')[0])&&jQuery(this).addClass("pplr_subtotal_price")});var h=0;for(s=0;s1)jQuery(":contains("+e.item_count+")").filter(function(){return 0===jQuery(this).children().length}).each(function(){var t=!0,r=jQuery(this).attr("href");void 0!==r&&!1!==r&&r.indexOf("/collections/")>-1&&(t=!1),jQuery(this).text()!=e.item_count||!t||jQuery(this).parents('.pplr_cart_row,.pplr_subtotal_price,form[action*="/cart/add"]')[0]||jQuery(this).is(jQuery(".pplr_subtotal_price"))||jQuery(this).is(jQuery("button"))||jQuery(this).addClass("pplr_cart_count")})}}function update_draft_cart(e){if(window.pplr_hide_item_count=0,0!==e.items.length){var t=!0;if((jQuery("[data-product-personalizer-pricing-auxiliary][data-line]")[0]||jQuery("[data-product-personalizer-pricing-ref][data-product-personalizer-pricing-qty-split]")[0])&&(t=!1,console.log("data-product-personalizer-pricing-qty-split existed")),!window.pplr_css_loaded){var r='.p_a_t_ch{position:relative;}.pplr_modal{position:fixed;z-index:999999999999;padding-top:100px;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:rgba(0,0,0,.85)}.pplr_modal-content{position:relative;margin:auto;padding:0;width:90%;max-width:1200px}.pplr_close_d{color:#fff;position:absolute;top:10px;right:25px;font-size:35px;font-weight:700}.pplr_close_d:focus,.pplr_close_d:hover{color:#999;text-decoration:none;cursor:pointer}.pplr_cursor{cursor:pointer;}.pplr_mySlides img{margin-bottom:-4px;max-height: 100%;opacity:0;max-width: 100%;}.pplr_caption-container{text-align:center;background-color:#000;padding:2px 16px;color:#fff}.pplr_mySlides img.hover-shadow{transition:.3s;}[name="checkout"],[name="chekout"], a[href^="/checkout"],.pplr_checkout_btn{pointer-events: auto !important;}#p_loading-spinner{display:block;position:absolute;left:0;right:0;top:0;bottom:0;margin:auto;animation:p_loading-spinner 1s linear infinite}@-webkit-keyframes p_loading-spinner{from{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(360deg)}}@-moz-keyframes p_loading-spinner{from{-moz-transform:rotate(0deg)}to{-moz-transform:rotate(360deg)}}@-o-keyframes p_loading-spinner{from{-o-transform:rotate(0deg)}to{-o-transform:rotate(360deg)}}@keyframes p_loading-spinner{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}',i=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",n.styleSheet?n.styleSheet.cssText=r:n.appendChild(document.createTextNode(r)),i.appendChild(n),window.pplr_css_loaded=!0}window.pplr_draftorder=!1,window.pplr_additional=!1;var p=0,a=0,o="",l=Shopify.currency.rate;if(void 0!==p_m_t_s){p_m_t_s=pplr_manual_theme_selector;for(var s=[],_=0;_e),m=d.length>1?d[1].split(",").filter(e=>e):[".a_pplr_item_oline_price"];u.push('.a_pplr_item_price[data-line="abc_xyz"]');var h=[],y=[];for(jQuery('form[action="/cart"],.pplr_cart_form_n'),_=0;_0?h.join(",")+","+x:x,w=w.length>0?w.join(",")+","+S:S,b=b.join(","),Q=Q.join(",")}var I="";performance.now();if(e.items.length>0){var T=e.items[0].key;jQuery("form,.pplr_cart_form_n").each(function(t){jQuery(this).find('[name*="updates["][id*="'+T+'"]').length&&(jQuery(this).find('[name*="updates["][id]').first().attr("id").indexOf(T)<0&&(console.log("Reversed Cart"),e.items.reverse()))})}var q=!1;jQuery(".zcart-discount-row")[0]&&(q=!0);for(var E=0;E0){e.items[E];if(Object.keys(e.items[E].line_level_discount_allocations).length>0&&"percentage"==(J=e.items[E].line_level_discount_allocations[0].discount_application.value_type)){var B=e.items[E].line_level_discount_allocations[0]?.discount_application;D=Number(B.value)/100}}if(null!==L)for(var $=[],W=0;W-1?F+' '+R.replace(/<[^>]*>?/gm,"")+' : '+pplr_c_t_v_i+"":F+' '+R.toString().replace(/<[^>]*>?/gm,"")+" : "+U.toString().replace(/\n/g,"
")+"
"),"_pplr_addprice"==R&&(window.pplr_draftorder=!0,O=!0,z+=parseFloat(U*l*e.items[E].quantity),N+="percentage"==J?parseFloat(U*l-U*l*D):parseFloat(U*l)),"_pc_pricing_ref"==R&&(o==U&&!0,o=U,H=!0,O=!0),"_pc_pricing_qty_split"==R&&""!==U){if(M=!0,U.indexOf("-")>-1){var G=U.split("-")[1].split("_");$=U.split("-")[0].split("_")}else G=JSON.parse(U);O=!0,window.pplr_additional=!0}if("_pplr_inv_variant"==R&&"PPLR_HIDDEN_PRODUCT"!==e.items[E].product_type){var Z=JSON.parse(U);for(_=0;_0){var ie=$.indexOf(String(e.items[ee].id));ie>-1&&(re=G[String(ie)])}isNaN(re*e.items[E].quantity)||(z+=e.items[ee].original_line_price,N+=parseFloat(te*re),Y+=1,e.items[ee].quantity!==re*e.items[E].quantity&&(K=!0,X.push({line:ee+1,qty:re*e.items[E].quantity})))}if(G.length>Y&&(jQuery('[name="checkout"],[name="update"]').prop("disabled",!1),window.no_self_running_request=!1,window.pplr_delete_product||window.pplr_atc_triggered||(recursive_ajaxdelete(E+1,o),window.pplr_delete_product=!0)),K&&t)return window.no_self_running_request=!1,void recursive_ajaxupdate(X)}if(H&&!M){var ne=!0;for(ee=0;ee"+F+"",le=jQuery('.pplr_cart_item_property[data-line="'+E+'"]');le.siblings("span[data-cart-item-property]")[0]||le.html(oe),jQuery(b.replace(/abc_xyz/g,E)).each(function(){if(jQuery(this).parents(p_m_t_s[1]).find(".pplr_properties").length<1){var e=jQuery(this).find(":contains(/uploads/)").length||jQuery(this).is(":contains(/uploads/)")||jQuery(this).is(":contains(_pplr_addprice)");if(null!==L)for(var t=0;t-1&&(ce=0),O||window.pplr_draftorder){var de=N,ue=e.items[E],me=ue.quantity,he=p_numberWithCommas((de/100).toFixed(ce)),ye=p_numberWithCommas((z/100).toFixed(ce)),fe=p_numberWithCommas((z/100/me).toFixed(ce)),ge=p_numberWithCommas((de*me/100).toFixed(ce)),we=c_decodeHtml(pplr_money_formate).replace("amount_no_decimals_with_comma_separator",he).replace("amount_no_decimals",he).replace("amount_with_comma_separator",he).replace("amount",he).replace("{{ ","").replace("{{","").replace("}}",""),ve=c_decodeHtml(pplr_money_formate).replace("amount_no_decimals_with_comma_separator",fe).replace("amount_no_decimals",fe).replace("amount_with_comma_separator",fe).replace("amount",fe).replace("{{ ","").replace("{{","").replace("}}",""),be=c_decodeHtml(pplr_money_formate).replace("amount_no_decimals_with_comma_separator",ye).replace("amount_no_decimals",ye).replace("amount_with_comma_separator",ye).replace("amount",ye).replace("{{ ","").replace("{{","").replace("}}",""),je=c_decodeHtml(pplr_money_formate).replace("amount_no_decimals_with_comma_separator",ge).replace("amount_no_decimals",ge).replace("amount_with_comma_separator",ge).replace("amount",ge).replace("{{ ","").replace("{{","").replace("}}","");if(t){if(ue.original_line_price!==ue.line_price&&(jQuery(k.replace(/abc_xyz/g,E)).hide(),jQuery(C.replace(/abc_xyz/g,E)).hide()),pe.html(we).attr("pplr_set_price",we),y.length>0){var Qe=jQuery(y.join(",").replace(/abc_xyz/g,E));Qe[0]&&!Qe.is(".a_pplr_item_oline_price")&&(ue.original_line_price===ue.final_line_price*me&&1!=me||Qe.html(be).attr("pplr_set_price",be).addClass("a_pplr_item_oprice"))}ae.html(je).attr("pplr_set_price",je),pe.length>0||ae.length,1==e.items.length&&window.pplr_draftorder?(jQuery(".a_pplr_item_price[data-line=0]:not(.a_pplr_item_oprice)").html(we).attr("pplr_set_price",we),jQuery(".a_pplr_item_line_price[data-line=0]").html(je).attr("pplr_set_price",je),jQuery(".a_pplr_item_oline_price").html(be).attr("pplr_set_price",be),jQuery(".a_pplr_item_oprice").html(ve).attr("pplr_set_price",ve)):(jQuery(".a_pplr_item_oline_price[data-line="+E+"]:not(.a_pplr_item_price)").html(be).attr("pplr_set_price",be),jQuery(".a_pplr_item_oprice[data-line="+E+"]:not(.a_pplr_item_line_price)").html(ve).attr("pplr_set_price",ve))}}(H&&M||!H&&!M)&&(p+=parseFloat(N*e.items[E].quantity),a+=e.items[E].quantity),window.pplr_draftorder&&(renderDiscountInput(),jQuery(".ppl_discount_wrapper")[0]&&jQuery("body").addClass("has_pplr_discount"))}window.pplr_hide_item_count=jQuery(".pplr_hide").length;var xe=jQuery(".pplr_cart_count:visible");if(void 0!==p_m_t_s)try{xe=0!==jQuery.trim(p_m_t_s[0]).indexOf(".")&&0!==jQuery.trim(p_m_t_s[0]).indexOf("#")?jQuery(".pplr_cart_count:visible,."+p_m_t_s[0]+",#"+p_m_t_s[0]):jQuery(".pplr_cart_count:visible,"+p_m_t_s[0])}catch(e){console.log(e)}if(xe.text(a).addClass("pplr_cart_count"),window.pplr_draftorder||window.pplr_additional){var ke=p_numberWithCommas((p/100).toFixed(ce)),Se=(we=c_decodeHtml(pplr_money_formate).replace("amount_no_decimals_with_comma_separator",ke).replace("amount_no_decimals",ke).replace("amount_with_comma_separator",ke).replace("amount",ke).replace("{{ ","").replace("{{","").replace("}}",""),".cart__subtotal:not(h3) .money,.pplr_subtotal_price,.totals__subtotal-value");if(void 0!==p_m_t_s)try{if(""!==p_m_t_s[8])if(jQuery(p_m_t_s[8])[0])Ce=jQuery(p_m_t_s[8]);else var Ce=jQuery(p_m_t_s[8]+","+Se);else Ce=jQuery(Se)}catch(e){console.log(e)}else Ce=jQuery(Se);if(jQuery(Ce).each(function(e){jQuery(this).find("[pplr_s_price]").length>0?jQuery(this).find("[pplr_s_price]").html(" "+we).attr("pplr_set_price",we):jQuery(this).html(we).attr("pplr_set_price",we)}),q){let t=0;if(e&&e.cart_level_discount_applications?.length>0&&e.cart_level_discount_applications.forEach(e=>{let r=Number(e.total_allocated_amount);t+=r}),e&&e.items?.length>0){e.items.forEach(r=>{if(r.properties&&r.properties._pplr_addprice){var i=0,n=Number(r.properties._pplr_addprice*Shopify.currency.rate)*r.quantity;e.cart_level_discount_applications.forEach(e=>{"fixed_amount"!==e?.value_type&&(i=n*Number(e?.value||0)/100)}),t+=i}});var Ie=p-t}var Te=p_numberWithCommas((t/100).toFixed(ce));we=c_decodeHtml(pplr_money_formate).replace("amount_no_decimals_with_comma_separator",Te).replace("amount_no_decimals",Te).replace("amount_with_comma_separator",Te).replace("amount",Te).replace("{{ ","").replace("{{","").replace("}}","");jQuery(".zcart-discount-row .slidecart-discount-amount").html("-"+we);var qe=p_numberWithCommas((Ie/100).toFixed(ce));we=c_decodeHtml(pplr_money_formate).replace("amount_no_decimals_with_comma_separator",qe).replace("amount_no_decimals",qe).replace("amount_with_comma_separator",qe).replace("amount",qe).replace("{{ ","").replace("{{","").replace("}}","");jQuery(".zcart-total-row .slidecart-total").html(we)}window.pplr_set_price_count=jQuery("[pplr_set_price]").length}}}function check_draftorder(e){for(var t=0;t0&&e.cart_level_discount_applications.forEach(e=>{let t=Number(e.total_allocated_amount);p+=t,a.push(e.title)}),e&&e.items?.length>0&&e.items.forEach(t=>{if(t.properties&&t.properties._pplr_addprice){var r=0,i=Number(t.properties._pplr_addprice*Shopify.currency.rate)*t.quantity;e.cart_level_discount_applications[0];e.cart_level_discount_applications.forEach(e=>{"fixed_amount"!==e?.value_type&&(r=i*Number(e?.value||0)/100,p+=r)})}});let o=JSON.parse(localStorage.getItem("PPLR_SHIPPING")||"{}"),l=JSON.parse(window.dInit?.summary||"{}").adiscounts?.find(e=>"SHIPPING"===e.discount_class)||!(!o||!Object.keys(o).length)&&o;if(p>0||l){var s=[{amount:p/Shopify.currency.rate,title:a.join("-"),discount_class:"order"}];l&&s.push({amount:l.amount,title:l.title,discount_class:"SHIPPING"}),window.dInit={},window.dInit.summary=JSON.stringify({adiscounts:s})}}function init_pplr_draft_order(){"undefined"!=typeof pplr_cart?(window.pplr_cart=pplr_cart,find_desired_row(pplr_cart),window.pplr_mutation_elem=jQuery(pplr_check_class).length,update_draft_cart(pplr_cart)):no_running_request_draft&&window.pplr_cart_item_config(!0)}window.pplr_cart_row=[],window.pplr_hide_item_count=0,window.pplr_delete_product=!1,window.pplr_set_price_count=0,window.pplr_httprequest=!1,window.pplr_cart_item_config=function(e){window.pplr_httprequest&&pplr_httprequest.abort(),window.pplr_httprequest=jQuery.getJSON("/cart.js",function(e){if(0===e.items.length)return window.pplr_mutation_elem=0,void jQuery("#ppl_dis_wrap").remove();window.pplr_cart=e,find_desired_row(e),window.pplr_atc_triggered&&window.pplr_mutation_elem!==jQuery(pplr_check_class).length&&(window.pplr_atc_triggered=!1),window.pplr_mutation_elem=jQuery(pplr_check_class).length,update_draft_cart(e),window.pplr_httprequest=!1})},window.pplr_draft_order=function(){jQuery.getJSON("/cart.js",function(e){if(check_draftorder(e),window.pplr_draftorder){jQuery("#p_loading-spinner")[0]||jQuery(".p_a_t_ch").append('');var t=JSON.stringify(e),r=JSON.stringify(Shopify.currency),i=window.dInit?.summary||window.pplr_discount_docapp||window.boostly_discount_pplr;jQuery.ajax({type:"POST",url:"https://cdn-zeptoapps.com/product-personalizer/draft_order.php",crossDomain:!0,data:"shop="+Shopify.shop+"&cartjson="+encodeURIComponent(t)+"&cartdiscount="+encodeURIComponent(i)+"¤cy="+encodeURIComponent(r),success:function(e){const t=Number(p_m_t_s?.[19]);!isNaN(t)&&t>0?setTimeout(()=>{window.location=e},t):window.location=e},error:function(e,t,r){}})}else window.location="/checkout"})};var pplr_element_v_list=0;function pplr_Ready_Common(){jQuery(document).ready(function(){pplr_cur=Shopify.currency.active,jQuery(pplr_checkout_btn).addClass("p_a_t_ch"),clearTimeout(pplr_draft_settime),pplr_draft_settime=setTimeout(function(){window.pplr_commpn_ready||(window.pplr_commpn_ready=!0,init_pplr_draft_order())},100)}),jQuery(window).on("load",function(){clearTimeout(pplr_draft_settime),pplr_draft_settime=setTimeout(function(){window.pplr_commpn_load||(window.pplr_commpn_load=!0,init_pplr_draft_order())},100),pplr_clicksettime=setTimeout(function(){window.pplr_click_event=!1},3e3)}),jQuery(document).ready(function(){try{setTimeout(function(){var e,t;MutationObserver=window.MutationObserver||window.WebKitMutationObserver;var r=new MutationObserver(function(t,r){clearTimeout(e),e=setTimeout(function(){(window.pplr_mutation_elem!==jQuery(pplr_check_class).length||window.pplr_hide_item_count>jQuery(".pplr_hide").length)&&(window.pplr_mutation_elem=jQuery(pplr_check_class).length,console.log("Cart Updated Detected"),window.no_self_running_request&&window.pplr_cart_item_config(!0)),jQuery("[pplr_set_price]").each(function(){jQuery(this).attr("pplr_set_price"),jQuery(this).html()}),jQuery("[pplr_set_price]").lengthjQuery(".pplr_hide").length||window.pplr_atc_triggered)&&(window.pplr_atc_triggered&&window.pplr_mutation_elem!==jQuery(pplr_check_class).length&&(window.pplr_atc_triggered=!1),window.pplr_mutation_elem=jQuery(pplr_check_class).length,(window.no_self_running_request||window.pplr_atc_triggered)&&window.pplr_cart_item_config(!0)),jQuery("[pplr_set_price]").each(function(){jQuery(this).attr("pplr_set_price"),jQuery(this).html()}),jQuery("[pplr_set_price]").length0&&window.no_self_running_request&&window.pplr_cart_item_config(!0)},200))});jQuery(jQuery("body")).each(function(){n.observe(this,{subtree:!0,childList:!0})})},100)}catch(e){console.log(e)}}),document.body&&document.body.addEventListener("docapp-discount-applied",e=>{window.pplr_discount_docapp=JSON.stringify(e)});var e='
Zepto Product Personalizer Options will be visible here when the product is configured by the app
';if(window!==window.parent&&"undefined"==typeof product_personalizer&&Shopify.designMode){var t=jQuery('[data-block-handle="product_personalizer_page"]');t[0]||(t=jQuery('form[action*="/cart/add"]:visible:has([name="add"])').first()),t[0]?jQuery(e).prependTo(t):jQuery(e).prependTo(jQuery('form[action*="/cart/add"]').first())}else jQuery('[data-shopify-editor-block*="/product_personalizer_page/"]').each(function(){0===jQuery(this).children().length&&jQuery(this).html(e)});window.pplr_click_event=!0,document.addEventListener("click",function(e){var t=jQuery(e.target);if(window.pplr_draftorder&&(jQuery(pplr_checkout_btn).addClass("p_a_t_ch"),(t.hasClass("p_a_t_ch")||t.parents(".p_a_t_ch")[0])&&(e.preventDefault(),e.stopImmediatePropagation(),window.pplr_draft_order())),t.is('[href="/cart"],'+pplr_remove_class)&&setTimeout(function(){},100),window.pplr_click_event=!0,clearTimeout(pplr_clicksettime),pplr_clicksettime=setTimeout(function(){window.pplr_click_event=!1},3e3),t.hasClass("p_a_t_c")||t.parents(".p_a_t_c")[0]||(window.pplr_atc_triggered=!1),t.hasClass("pplr_slide")){e.preventDefault(),e.stopImmediatePropagation(),jQuery("body").append('
×
');var r=new Image;r.onload=function(){var e=jQuery(".pplr_mySlides img")[0].clientHeight,t=jQuery(".pplr_mySlides img")[0].clientWidth,r=jQuery(window).height()-200;e