File: /var/www/html/wppartneramazingsecret/wp-content/themes/themify-ultra/js/modules/wc.min.js
'use strict';(function(e,c,t,n){if(c.body[0].classList.contains("slide-cart")){var q=document.querySelectorAll('a[href="#slide-cart"]');0<q.length&&c.sideMenu(q,{close:"#cart-icon-close",beforeShow:function(){c.LoadCss(t.theme_url+"/styles/wc/modules/basket.css",t.theme_v)}})}let r=!1;const p=c.body[0].querySelectorAll("#headerwrap .icon-shopping-cart");c.body.on("added_to_cart removed_from_cart",function(a){const b=e(".cart-icon");b.hasClass("empty-cart")&&("added_to_cart"===a.type?b.removeClass("empty-cart"):
0>=parseInt(e(".cart-icon-link span").text())&&b.addClass("empty-cart"));if("added_to_cart"===a.type){for(a=p.length-1;-1<a;--a)p[a].classList.remove("tf_loader");if(!1===r&&n.ajaxCartSeconds){r=!0;let l=parseInt(n.ajaxCartSeconds);const d=document.querySelector(c.isTouch?"#mobile-menu .cart-icon-link":".header-icons .cart-icon-link");if(null!==d){const f=d.getAttribute("href"),g=document.getElementById(f.replace("#",""));null!==g&&(c.on("sidemenushow.themify",function(h,m,k){f===h&&setTimeout(function(){e(g).is(":hover")?
g.addEventListener("mouseleave",function(){k.hidePanel();c.body[0].classList.remove("tf_auto_cart_open")},{once:!0,passive:!0}):(k.hidePanel(),c.body[0].classList.remove("tf_auto_cart_open"));r=!1},l)},!0),c.body[0].classList.add("tf_auto_cart_open"),setTimeout(function(){d.click()},100))}}}}).on("click",".remove-item-js",function(a){a.preventDefault();const b=e(this);a={action:"theme_delete_cart",remove_item:b.attr("data-product-key")};const l=e(".ajax_add_to_cart"),d=b.parent().find(".product-title a").attr("href");
b.removeClass("tf_close").addClass("tf_loader");e.post(woocommerce_params.ajax_url,a,function(f){const g=f.fragments;f=f.cart_hash;0===b.parent().find(".added_to_cart").length&&b.addClass("added");g&&(e.each(g,function(h,m){e(h).addClass("updating").replaceWith(m)}),e(g["#shopdock-ultra"]).find(".cart-total").length||e("#cart-icon-close").trigger("click"));l.length&&l.each(function(){e(this).hasClass("added")&&e(this).closest(".post-content").find('[href="'+d+'"]').length&&e(this).removeClass("added").siblings(".added_to_cart").remove()});
c.body.triggerHandler("removed_from_cart",[g,f]);b.removeClass("tf_loader").addClass("tf_close")})}).on("adding_to_cart",function(){for(let a=p.length-1;-1<a;--a)p[a].className+=" tf_loader"});if("undefined"!==typeof wc_add_to_cart_params)c.body.on("click",".remove_from_cart_button",function(a){a.preventDefault();this.classList.remove("tf_close");this.classList.add("tf_loader")});n.ajaxSingleCart&&(q=document.querySelector("form.cart"))&&q.addEventListener("submit",function(a){if(null===this.closest(".product-type-external")){if(-1<
window.location.search.indexOf("switch-subscription"))return this;a.preventDefault();a=new FormData(this);var b=this.getElementsByClassName("single_add_to_cart_button")[0],l=this.querySelector('[name="add-to-cart"]');"INPUT"!==l.tagName&&a.append("add-to-cart",l.value);b&&(b.classList.remove("added"),b.classList.add("loading"));c.body.triggerHandler("adding_to_cart",[this.querySelector('[type="submit"]'),a]);fetch(woocommerce_params.wc_ajax_url.toString().replace("%%endpoint%%","theme_add_to_cart"),
{method:"POST",headers:new Headers({Accept:"application/json","X-Requested-With":"XMLHttpRequest"}),body:a}).then(d=>d.redirected||d.json()).then(d=>{if(d)if(n.redirect)window.location.href=n.redirect;else{var f=d.fragments;d=d.cart_hash;if(f){const g=Object.keys(f);let h;for(let m=g.length-1;-1<m;m--){h=document.querySelectorAll(g[m]);for(let k=h.length-1;-1<k;k--)h[k].className+=" updating",h[k].outerHTML=f[g[m]]}}b&&(b.classList.remove("loading"),b.classList.add("added"));c.body.triggerHandler("added_to_cart",
[f,d])}})}})})(jQuery,Themify,themify_vars,themifyScript);