{"version":3,"sources":["cart.ts"],"names":["$","on","e","basketID","this","data","clicked_item","item_id","GA4Items","item_name","affiliation","price","discount","subscription","item_brand","item_category","quantity","index","item_list_id","item_list_name","undefined","item_variant","removeFromCart","stopCartDLPush","deletedItem","push","dataLayer","ecommerce","event","currency","value","Number","toFixed","items"],"mappings":"aAAAA,EAAE,WACEA,EAAE,iBAAiB,EAAEC,GAAG,QAAS,SAAUC,GACvC,IAAMC,EAAWH,EAAEI,IAAI,EAAEC,KAAK,UAAU,EAClCC,EAAoB,CACtBC,QAASC,SAASL,GAAUI,QAC5BE,UAAWD,SAASL,GAAUM,UAC9BC,YAAaF,SAASL,GAAUO,YAChCC,MAAOH,SAASL,GAAUQ,MAC1BC,SAAUJ,SAASL,GAAUS,SAC7BC,aAAcL,SAASL,GAAUU,aACjCC,WAAYN,SAASL,GAAUW,WAC/BC,cAAeP,SAASL,GAAUY,cAClCC,SAAUR,SAASL,GAAUa,SAC7BC,MAAOT,SAASL,GAAUc,MAC1BC,aAAcV,SAASL,GAAUe,aACjCC,eAAgBX,SAASL,GAAUgB,cACvC,EACsCC,KAAAA,IAAlCZ,SAASL,GAAUkB,eACnBf,EAA2B,aAAEE,SAASL,GAAUkB,cAEpDC,eAAehB,CAAY,CAC/B,CAAC,CACL,CAAC,EAED,IAAME,SAAW,GAEbe,eAAiB,CAAA,EAErB,SAASD,eAAehB,GACpB,IACUkB,EADLD,kBACKC,EAAc,IACRC,KAAKnB,CAAY,EAC7BoB,UAAUD,KAAK,CAAEE,UAAW,IAAK,CAAC,EAClCD,UAAUD,KAAK,CACXG,MAAO,mBACPD,UAAW,CACPE,SAAU,MACVC,MAAOC,QAAQzB,EAAaK,MAAQL,EAAaU,UAAUgB,QAAQ,CAAC,CAAC,EACrEC,MAAOT,CACX,CACJ,CAAC,GAELD,eAAe,CAAA,CACnB","file":"../cart.min.js","sourcesContent":["$(function () {\n $('.delete-product').on('click', function (e) {\n const basketID = $(this).data('basketid');\n const clicked_item: any = {\n item_id: GA4Items[basketID].item_id,\n item_name: GA4Items[basketID].item_name,\n affiliation: GA4Items[basketID].affiliation,\n price: GA4Items[basketID].price,\n discount: GA4Items[basketID].discount,\n subscription: GA4Items[basketID].subscription,\n item_brand: GA4Items[basketID].item_brand,\n item_category: GA4Items[basketID].item_category,\n quantity: GA4Items[basketID].quantity,\n index: GA4Items[basketID].index,\n item_list_id: GA4Items[basketID].item_list_id,\n item_list_name: GA4Items[basketID].item_list_name\n }\n if (GA4Items[basketID].item_variant!==undefined){\n clicked_item['item_variant']=GA4Items[basketID].item_variant;\n }\n removeFromCart(clicked_item)\n })\n})\n\nconst GA4Items = [];\n\nlet stopCartDLPush = false;\n\nfunction removeFromCart(clicked_item: { item_id: string; item_name: string; affiliation: string; price: number; discount: number; item_variant?: string; subscription: string; item_brand: string; item_category: string; quantity: number; index: number; item_list_id: string; item_list_name: string }){\n if (!stopCartDLPush){\n const deletedItem = [];\n deletedItem.push(clicked_item);\n dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object.\n dataLayer.push({\n event: \"remove_from_cart\",\n ecommerce: {\n currency: 'USD',\n value: Number((clicked_item.price * clicked_item.quantity).toFixed(2)),\n items: deletedItem\n }\n });\n }\n stopCartDLPush=true;\n}"]}