{"version":3,"file":"/scripts/ajax-add-to-cart.js","mappings":"6EACAA,OAAOC,UAAUC,OAAM,SAAUC,GAC/BA,EAAE,8BAA8BC,GAAG,SAAS,SAAUC,GACpDA,EAAEC,iBACFC,YAAcJ,EAAEK,MACdC,MAAQF,YAAYG,QAAQ,aAC5BC,GAAKJ,YAAYK,MACjBC,YAAcJ,MAAMK,KAAK,wBAAwBF,OAAS,EAC1DG,WAAaN,MAAMK,KAAK,0BAA0BF,OAASD,GAC3DK,aAAeP,MAAMK,KAAK,4BAA4BF,OAAS,EACjE,IAAIK,EAAO,CACTC,OAAQ,kCACRH,WACAI,YAAa,GACbC,SAAUP,YACVG,cAEFb,EAAEkB,KAAK,CACLC,KAAM,OACNC,IAAKC,sBAAsBC,SAC3BR,KAAMA,EACNS,WAAY,SAAUC,GACpBpB,YAAYqB,YAAY,SAASC,SAAS,UAC5C,EACAC,SAAU,SAAUH,GAClBpB,YAAYsB,SAAS,SAASD,YAAY,UAC5C,EACAG,QAAS,SAAUJ,GACbA,EAASK,MAAQL,EAASM,YAC5BC,OAAOC,SAAWR,EAASM,aAG3B9B,EAAEF,SAASmC,MAAMC,QAAQ,gBAAiB,CAACV,EAASW,UAAWX,EAASY,UAAWhC,cACnFiC,YAAW,WACTxC,OAAO,iCAAiC6B,SAAS,SACnD,GAAG,KAEP,GAEJ,GAEF,G","sources":["webpack:///./resources/scripts/ajax-add-to-cart.js"],"sourcesContent":["/* eslint-disable */\njQuery(document).ready(function ($) {\n $('.single_add_to_cart_button').on('click', function (e) {\n e.preventDefault();\n $thisbutton = $(this),\n $form = $thisbutton.closest('form.cart'),\n id = $thisbutton.val(),\n product_qty = $form.find('input[name=quantity]').val() || 1,\n product_id = $form.find('input[name=product_id]').val() || id,\n variation_id = $form.find('input[name=variation_id]').val() || 0;\n var data = {\n action: 'ql_woocommerce_ajax_add_to_cart',\n product_id: product_id,\n product_sku: '',\n quantity: product_qty,\n variation_id: variation_id,\n };\n $.ajax({\n type: 'post',\n url: wc_add_to_cart_params.ajax_url,\n data: data,\n beforeSend: function (response) {\n $thisbutton.removeClass('added').addClass('loading');\n },\n complete: function (response) {\n $thisbutton.addClass('added').removeClass('loading');\n },\n success: function (response) {\n if (response.error & response.product_url) {\n window.location = response.product_url;\n return;\n } else {\n $(document.body).trigger('added_to_cart', [response.fragments, response.cart_hash, $thisbutton]);\n setTimeout(function() {\n jQuery('.widget_shopping_cart_content').addClass('active');\n }, 100)\n }\n },\n });\n });\n \n});\n/* eslint-enable */\n"],"names":["jQuery","document","ready","$","on","e","preventDefault","$thisbutton","this","$form","closest","id","val","product_qty","find","product_id","variation_id","data","action","product_sku","quantity","ajax","type","url","wc_add_to_cart_params","ajax_url","beforeSend","response","removeClass","addClass","complete","success","error","product_url","window","location","body","trigger","fragments","cart_hash","setTimeout"],"sourceRoot":""}