jQuery(document).ready(function(r){let e=window.gtmkit_settings.datalayer_name;function o(t){window.gtmkit.events.push({ecommerce:null},e),window.gtmkit.events.push({event:"add_to_cart",ecommerce:{currency:window.gtmkit_data.edd.currency,value:t.price*t.quantity,items:[t]}},e)}r(document.body).on("click.eddAddToCart",".edd-add-to-cart",function(t){t.preventDefault();t=r(this);let d=t.parents("form").last();var a=t.data("download-id"),e=t.data("variable-price");let i=[],n=JSON.parse(d.find(".gtmkit_product_data").val()),c=parseInt(d.find(".edd-item-quantity").val());if("yes"===e){if(!d.find(".edd_price_option_"+a+":checked",d).length)return!1;let e=t.data("price-mode");d.find(".edd_price_option_"+a+":checked",d).each(function(t){i[t]=r(this).val();t=r(this).data("price");t&&0<t&&(n.price=parseFloat(t)),"multi"===e&&(c=parseInt(d.find('.edd-item-quantity[name="edd_download_quantity_'+r(this).val()+'"]').val())),n.quantity=c,o(n)})}else n.quantity=c,o(n)})});