{"version":3,"sources":["cart.ts"],"names":["_regeneratorRuntime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","defineProperty","obj","key","desc","value","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","context","state","protoGenerator","Generator","generator","create","Context","method","arg","Error","doneResult","delegate","delegateResult","maybeInvokeDelegate","methodName","undefined","TypeError","ContinueSentinel","record","tryCatch","type","info","done","resultName","next","nextLoc","sent","_sent","dispatchException","abrupt","fn","call","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","this","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","_invoke","AsyncIterator","PromiseImpl","previousPromise","callInvokeWithMethodAndArg","resolve","reject","invoke","result","_typeof","__await","then","unwrapped","error","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","i","iteratorMethod","isNaN","length","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","val","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","catch","thrown","delegateYield","ownKeys","enumerableOnly","symbols","getOwnPropertySymbols","filter","sym","getOwnPropertyDescriptor","apply","_objectSpread","target","arguments","source","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","_toPrimitive","String","input","hint","prim","toPrimitive","Number","res","asyncGeneratorStep","gen","_next","_throw","_asyncToGenerator","args","checkoutButton","subtotalInUI","carttotalInUI","discountInUI","totalInUI","subtotalPointsInUI","cartPointsSubtotal","modalhdCartTotal","modalhdDiscount","modalhdTotal","modalhdPointsSubtotalDiscount","modalSubtotalInUI","modalSubtotalPointsInUI","defaultConfigs","cartItemsArray","defaultcheckoutButtonText","getWebConfigs","_ref","siteName","siteDomainName","previousQuickCartContent","loadingList","GA4Items","escapeRegExp","string","replace","formatPrice","price","formattedPrice","sanitizeToJson","data","JSON","parse","addLoadingBarToSubtotals","innerHTML","classList","add","updateCartUI","totalQuantity","bubbleCnt","jsonData","isBMSMActive","updateBMSMsubTotals","Table","CuryTotMerch","subtotal","toFixed","toString","subtotalPoints","User6","remove","concat","CommonUtils","formatPoints","document","querySelectorAll","productQuantity","parseInt","querySelector","hideElement","showElement","disabled","innerText","subtotalContaniner","promoTiersLenght","promoPropsObj","promoTiers","minTotal","discount","dollarOff","$","hide","show","firstElementChild","removeEmptySpaceInString","text","updateCartItemUI","basketID","qtyIndex","cartItem","modalCartItem","Table1","product","basketid","curytotord","user6","quantity","setAttribute","deleteCartItemUI","parentNode","removeChild","emptyCart","removeControls","addControls","updateProductQuantityInCart","_x","_x2","_x3","_x4","_updateProductQuantityInCart","_callee3","productID","quantityInput","undoDiv","deleteItem","parentElement","quantityValue","request","itemIndex","_context3","getAttribute","alert","dispatchEvent","Event","bubbles","isInteger","Math","round","Element","params","ajax","url","cache","index","indexOf","splice","cartItemsObj","findIndex","item","invtID","sfTrackCart","cartData","parsedCart","map","itemid","trim","qtyord","curylistprice","sale_price","curyslsprice","unique_id","alternateid","invtid","SalesforceAbandonedCartUtils","cartOrOrderData","trackCart","deleteProductInCart","_x5","_x6","_deleteProductInCart","_callee4","deletedItemGA4","_context4","dataLayer","ecommerce","event","currency","items","event_value","toLowerCase","includes","doEmptyCart","confirm","getElementById","submit","checkout","retrieveItemIDs","cartItems","itemIDs","itemID","element","some","removeElementByItemId","itemIdToRemove","indexToRemove","handleQtyButtonClickDebounce","_this","_len","Array","_key","clearTimeout","timeout","setTimeout","func","wait","content","quickCartContent","invtId","basketId","inputElement","inputElementValue","html","qty","on","operation","currentValue","_this2","delayDebounceFn","e","preventDefault","itemId","_callee2","productExtensionGroups","productSelectedExtensions","_context2","handleUndoButtonClick","ajaxObj","XMLHttpRequest","undoDivElement","indexList","extensionGroupsArray","split","Boolean","selectedExtensionsArray","paramExtensions","deletedInvtId","cartItemQty","cartItemObj","find","ajaxParams","encodeURIComponent","ajaxResults","open","setRequestHeader","send","onreadystatechange","_callee","totalBasketRows","dsBasketDeletedRow","k","currentBasketID","_i","item_variant","_context","readyState","responseText","getXMLDataTableRowCount","getXMLDataFieldValue","itemContentObj","itemContent","quickItemContent","escapedBasketId","regex","RegExp","tempElement","createElement","qtyInput","HTMLInputElement","parseFloat","item_id","item_name","affiliation","subscription","item_brand","item_category","item_list_id","item_list_name"],"mappings":"6RACAA,oBAAA,WAAA,OAAAC,CAAA,EAAA,IAAAA,EAAA,GAAAC,EAAAC,OAAAC,UAAAC,EAAAH,EAAAI,eAAAC,EAAAJ,OAAAI,gBAAA,SAAAC,EAAAC,EAAAC,GAAAF,EAAAC,GAAAC,EAAAC,KAAA,EAAAC,EAAA,YAAA,OAAAC,OAAAA,OAAA,GAAAC,EAAAF,EAAAG,UAAA,aAAAC,EAAAJ,EAAAK,eAAA,kBAAAC,EAAAN,EAAAO,aAAA,gBAAA,SAAAC,EAAAZ,EAAAC,EAAAE,GAAA,OAAAR,OAAAI,eAAAC,EAAAC,EAAA,CAAAE,MAAAA,EAAAU,WAAA,CAAA,EAAAC,aAAA,CAAA,EAAAC,SAAA,CAAA,CAAA,CAAA,EAAAf,EAAAC,EAAA,CAAA,IAAAW,EAAA,GAAA,EAAA,CAAA,CAAA,MAAAI,GAAAJ,EAAA,SAAAZ,EAAAC,EAAAE,GAAA,OAAAH,EAAAC,GAAAE,CAAA,CAAA,CAAA,SAAAc,EAAAC,EAAAC,EAAAC,EAAAC,GAAA,IAAAH,EAAAE,EAAAE,EAAAC,EAAAC,EAAAL,GAAAA,EAAAvB,qBAAA6B,EAAAN,EAAAM,EAAAC,EAAA/B,OAAAgC,OAAAH,EAAA5B,SAAA,EAAA0B,EAAA,IAAAM,EAAAP,GAAA,EAAA,EAAA,OAAAtB,EAAA2B,EAAA,UAAA,CAAAvB,OAAAe,EAAA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AA,CAAA,CAAA,EAAA+Q,CAAA,CAAA,CAKH,CAAA,CACF,EAUuBvG,EAAOiE,EAAUvF,EAAWqG,EAAwBC,CAAyB,EAAC,KAAA,EAAA,IAAA,MAAA,OAAAC,EAAAzP,KAAA,CAAA,CAAA,EAAAsP,EAAAlT,IAAA,CAAA,CACpG,CAAA,CAAA,CACF,CAAC","file":"../cart.min.js","sourcesContent":["// Declare variables for various UI elements\nlet checkoutButton\nlet subtotalInUI\nlet carttotalInUI\nlet discountInUI\nlet totalInUI\nlet subtotalPointsInUI\nlet cartPointsSubtotal\nlet modalhdCartTotal\nlet modalhdDiscount\nlet modalhdTotal\nlet modalhdPointsSubtotalDiscount\nlet modalSubtotalInUI\nlet modalSubtotalPointsInUI\nlet cartItemsArray = []\n\nlet defaultcheckoutButtonText = 'Checkout'\nlet defaultConfigs\n\nfunction getWebConfigs({ siteName, siteDomainName }: { siteName: string, siteDomainName: string }) {\n\tdefaultConfigs = { siteName, siteDomainName }\n}\n\n// Declare a list to keep track of loading operations\nlet loadingList = []\n\nlet previousQuickCartContent\n\nconst GA4Items = []\n\n$(function () {\n\tcheckoutButton = document.querySelector('#btn_cart_checkout')\n\tsubtotalInUI = document.querySelector('#subtotalInUI')\n\tcarttotalInUI = document.querySelector('#carttotalInUI')\n\tdiscountInUI = document.querySelector('#discountInUI')\n\ttotalInUI = document.querySelector('#totalInUI')\n\tsubtotalPointsInUI = document.querySelector('#cartPointsSubtotal')\n\tcartPointsSubtotal = document.querySelector('#cartPointsSubtotal')\n\tmodalhdCartTotal = document.querySelector('#hdCartTotal')\n\tmodalhdDiscount = document.querySelector('#hdDiscount')\n\tmodalhdTotal = document.querySelector('#hdTotal')\n\tmodalhdPointsSubtotalDiscount = document.querySelector('#hdPointsSubtotalDiscount')\n\tmodalSubtotalInUI = document.querySelector('#hdCashSubtotal')\n\tmodalSubtotalPointsInUI = document.querySelector('#hdPointsSubtotal')\n\n\tfunction debounce(func, wait) {\n\t\tlet timeout\n\n\t\treturn function executedFunction(...args) {\n\t\t\t\n\t\t\tconst later = () => {\n\t\t\t\ttimeout = null\n\t\t\t\tfunc.apply(this, args)\n\t\t\t}\n\n\t\t\tclearTimeout(timeout)\n\t\t\ttimeout = setTimeout(later, wait)\n\t\t}\n\t}\n\n\t// Updated handleQtyButtonClick using debounce\n\tconst handleQtyButtonClickDebounce = debounce(function () {\n\n\t\t// Get the index from the data-index attribute\n\t\tconst index = this.getAttribute('data-index')\n\n\t\t// Determine the operation (increment or decrement) and update the value accordingly\n\t\taddLoadingBarToSubtotals()\n\t\tconst parentElement = this.parentNode as Element\n\t\tparentElement.classList.add('loader-absolute-right')\n\n\t\tconst invtId = $(this).data('invtid')\n\t\tconst basketId = $(this).data('basketid')\n\t\tconst undoDiv = `undo${index}`\n\t\tconst inputElement = document.getElementById(`cartQty${index}`) as HTMLInputElement\n\t\t// Get the value of the input element\n\t\tconst inputElementValue = inputElement.value\n\n\t\tif (inputElementValue === '0') {\n\t\t\tconst content = $(`.cartitem${index}`).html()\n\t\t\t// Get the content inside the div with the class \"cartitem\" using jQuery\n\t\t\tconst quickCartContent = $(`.quickcartitem${index}`).html()\n\t\t\t// Store the content along with its index in an object\n\t\t\tconst cartItem = {\n\t\t\t\tindex: index,\n\t\t\t\tcontent: content,\n\t\t\t\tqty: inputElementValue,\n\t\t\t\tquickCartContent: quickCartContent\n\t\t\t}\n\t\t\tcartItemsArray.push(cartItem)\n\t\t}\n\n\t\tupdateProductQuantityInCart(invtId, inputElement, basketId, undoDiv)\n\t\tthis['oldvalue'] = inputElement.value\n\t}, 500)\n\n\tconst handleQtyButtonClick = function () {\n\n\t\t// Get the operation (increment or decrement) from the data-operation attribute\n\t\tconst operation = this.getAttribute('data-operation')\n\t\t// Get the index from the data-index attribute\n\t\tconst index = this.getAttribute('data-index')\n\n\t\t// Find the input element with the corresponding index\n\t\tconst quantityInput = document.getElementById(`cartQty${index}`) as HTMLInputElement\n\t\tlet currentValue = parseInt(quantityInput.value, 10) || 0\n\t\t// Determine the operation (increment or decrement) and update the value accordingly\n\t\tif (operation === 'increment' && currentValue < 99) {\n\t\t\tquantityInput.setAttribute('value', (currentValue + 1).toString())\n\t\t} else if (operation === 'decrement' && currentValue > 0) {\n\t\t\tquantityInput.setAttribute('value', (currentValue - 1).toString())\n\t\t}\n\n\t}\n\n\tconst handleQtyButtonUpdate = function () {\n\t\taddLoadingBarToSubtotals();\n\t\t// Add loader class to parent element\n\t\t(this.parentNode as Element).classList.add('loader-absolute-right')\n\n\t\t// Retrieve index and undoDiv values\n\t\tconst index: number = $(this).data('index')\n\t\tconst undoDiv: string = `undo${index}`\n\n\t\t// Create a debounce function to delay execution\n\t\tconst delayDebounceFn = setTimeout(() => {\n\t\t\t// Retrieve necessary data attributes\n\t\t\tconst invtId: string = $(this).data('invtid')\n\t\t\tconst basketId: string = $(this).data('basketid')\n\n\t\t\t// Update product quantity in cart\n\t\t\tupdateProductQuantityInCart(invtId, this as HTMLInputElement, basketId, undoDiv)\n\n\t\t\t// Store the current value as old value\n\t\t\tthis['oldvalue'] = (this as HTMLInputElement).value\n\t\t}, 2000)\n\n\t\t// Return a cleanup function to clear the timeout\n\t\treturn () => clearTimeout(delayDebounceFn)\n\n\t}\n\n\t// Attach the function to the event using event delegation\n\t$(document).on('click', '.qtyBtn', handleQtyButtonClick)\n\t$(document).on('click', '.qtyBtn', handleQtyButtonClickDebounce)\n\t$(document).on('input', '.quantity-input', handleQtyButtonUpdate)\n\n\tfunction handleDeleteButtonClick(e) {\n\t\te.preventDefault()\n\t\tconst invtId = $(this).data('invtid')\n\t\tconst basketId = $(this).data('basketid')\n\t\tconst index = $(this).data('index')\n\t\tconst itemId = $(this).data('itemid')\n\t\tconst inputElement = document.getElementById(`cartQty${index}`) as HTMLInputElement\n\t\tconst inputElementValue = inputElement.value\n\t\t// Get the content inside the div with the class \"cartitem\" using jQuery\n\t\tconst content = $(`.cartitem${index}`).html()\n\t\tconst quickCartContent = $(`.quickcartitem${index}`).html()\n\t\t// Store the content along with its index in an object\n\t\tconst cartItem = {\n\t\t\tindex: index,\n\t\t\tcontent: content,\n\t\t\tqty: inputElementValue,\n\t\t\tquickCartContent: quickCartContent\n\t\t}\n\t\tdeleteProductInCart(invtId, basketId)\n\t\tconst undoDiv = `undo${index}`\n\t\tcartItemsArray.push(cartItem)\n\t\tlet cartItems = retrieveItemIDs()\n\t\tremoveElementByItemId(cartItems, itemId)\n\t\tCommonUtils.showElement(undoDiv)\n\t}\n\n\t// Attach the function to the event using event delegation\n\t$(document).on('click', '.delete-product', handleDeleteButtonClick)\n\n\tfunction handleUndoButtonClick(index, basketId, productID, productExtensionGroups, productSelectedExtensions) {\n\t\tconst ajaxObj = new XMLHttpRequest()\n\t\tconst undoDiv = `undo${index}`\n\t\t// Get the element by its ID\n\t\tconst undoDivElement = document.getElementById(undoDiv)\n\n\t\tconst dataAttributes = {\n\t\t\t'data-affiliation': '<%=Affiliation%>',\n\t\t\t'data-itembrand': '<%=ItemBrand%>',\n\t\t\t'data-quantity': '<%=Quantity%>',\n\t\t\t'data-name': '<%=Name%>',\n\t\t\t'data-index': index,\n\t\t\t'data-categoryname': '<%=CategoryName%>',\n\t\t\t'data-categoryid': '<%=CategoryId%>',\n\t\t\t'data-price': '<%=Price%>',\n\t\t\t'data-discount': '<%=Discount%>',\n\t\t\t'data-extensiongroups': productExtensionGroups,\n\t\t\t'data-selectedextensions': productSelectedExtensions,\n\t\t\t'data-variant': '<%=System.Net.WebUtility.HtmlEncode(String.Join(\";\", Variant))%>',\n\t\t\t'data-basketid': basketId,\n\t\t\t'data-invtid': '<%=dsBasket.Tables[1].Rows[k][\"InvtID\"].ToString().Trim()%>',\n\t\t\t'data-itemid': '<%=dsBasket.Tables[1].Rows[k][\"ItemID\"].ToString().Trim()%>'\n\t\t}\n\t\taddControls()\n\t\t// Add a loading bar to the subtotals\n\t\taddLoadingBarToSubtotals()\n\t\tundoDivElement.classList.add('loader-absolute-right')\n\t\t// Add the product ID to the loading list\n\t\tloadingList.push(productID)\n\n\t\t// Disable the checkout button and the quantity span\n\t\tcheckoutButton.classList.add('disabled')\n\t\tcheckoutButton.classList.add('loader-light')\n\t\tcheckoutButton.innerText = ''\n\t\tcheckoutButton.disabled = true\n\n\t\t// Remove the product ID from the loading list\n\t\tconst indexList = loadingList.indexOf(productID)\n\t\tif (indexList !== -1) {\n\t\t\tloadingList.splice(indexList, 1)\n\t\t}\n\n\t\t// Split the values based on semicolon\n\t\tconst extensionGroupsArray = productExtensionGroups.split(';').filter(Boolean)\n\t\tconst selectedExtensionsArray = productSelectedExtensions.split(';').filter(Boolean)\n\n\t\t// Initialize paramExtensions\n\t\tlet paramExtensions = ''\n\t\tlet deletedInvtId = productID\n\n\t\t// Iterate through the arrays and create paramExtensions\n\t\tfor (let i = 0; i < extensionGroupsArray.length; i++) {\n\t\t\tparamExtensions += `&${productID}${extensionGroupsArray[i]}=${selectedExtensionsArray[i]}`\n\t\t\tdeletedInvtId += `${selectedExtensionsArray[i]}`\n\t\t}\n\n\t\tconst cartItemObj = cartItemsArray.find(item => item.index == index)\n\t\tlet cartItemQty = cartItemObj ? cartItemObj.qty.trim() : '1'\n\t\tif (cartItemQty === '0') cartItemQty = '1'\n\n\t\tconst ajaxParams = `&posting=TRUE&actionType=CARTADD&productID=${encodeURIComponent(productID)}&quantity=${encodeURIComponent(cartItemQty)}&productIDExtensionGroups=${encodeURIComponent(productExtensionGroups)}${paramExtensions}`\n\n\t\tconst ajaxURL = 'ajax/cart.aspx'\n\t\tlet ajaxResults = ''\n\n\t\tajaxObj.open('POST', ajaxURL, true)\n\t\tajaxObj.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;')\n\t\tajaxObj.send(ajaxParams)\n\n\t\tajaxObj.onreadystatechange = async function () {\n\t\t\tif (ajaxObj.readyState === 4) {\n\t\t\t\tajaxResults = ajaxObj.responseText + ''\n\t\t\t\tif (ajaxResults !== '') {\n\t\t\t\t\tlet totalBasketRows = Number(CommonUtils.getXMLDataTableRowCount('dsBasket', 1, ajaxResults))\n\t\t\t\t\tlet dsBasketDeletedRow\n\t\t\t\t\tfor (let k = 0; k < totalBasketRows; k++) {\n\t\t\t\t\t\tif (CommonUtils.getXMLDataFieldValue('dsBasket', 1, k, 'invtid', ajaxResults) === deletedInvtId || CommonUtils.getXMLDataFieldValue('dsBasket', 1, k, 'alternateid', ajaxResults) === deletedInvtId) {\n\t\t\t\t\t\t\tdsBasketDeletedRow = k\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tconst currentBasketID = CommonUtils.getXMLDataFieldValue('dsBasket', 1, dsBasketDeletedRow, 'basketID', ajaxResults)\n\t\t\t\t\tconst itemContentObj = cartItemsArray.find(item => item.index == index)\n\t\t\t\t\tlet itemContent = itemContentObj ? itemContentObj.content : null\n\t\t\t\t\tlet quickItemContent = itemContentObj ? itemContentObj.quickCartContent : null\n\n\t\t\t\t\tlet totalQuantity = 0\n\t\t\t\t\tfor (let i = 0; i < totalBasketRows; i++) {\n\t\t\t\t\t\ttotalQuantity += parseInt(CommonUtils.getXMLDataFieldValue('dsBasket', 1, i, 'qtyOrd', ajaxResults))\n\t\t\t\t\t}\n\t\t\t\t\t// Replace occurrences of basketId with currentBasketID\n\t\t\t\t\tlet escapedBasketId = escapeRegExp(basketId)\n\t\t\t\t\tlet regex = new RegExp(escapedBasketId, 'g')\n\t\t\t\t\titemContent = itemContent.replace(regex, currentBasketID)\n\t\t\t\t\titemContent = itemContent.replace(/loader-absolute-right/g, '')\n\t\t\t\t\tquickItemContent = quickItemContent.replace(regex, currentBasketID)\n\t\t\t\t\tdelete GA4Items[basketId]\n\t\t\t\t\tconst tempElement = document.createElement('div')\n\t\t\t\t\ttempElement.innerHTML = itemContent\n\n\t\t\t\t\tconst qtyInput = tempElement.querySelector(`#cartQty${index}`)\n\t\t\t\t\tif (qtyInput instanceof HTMLInputElement) {\n\t\t\t\t\t\tqtyInput.setAttribute('value', cartItemQty)\n\t\t\t\t\t}\n\n\t\t\t\t\titemContent = tempElement.innerHTML\n\t\t\t\t\tCommonUtils.hideElement(undoDiv)\n\t\t\t\t\tundoDivElement.classList.remove('loader-absolute-right')\n\t\t\t\t\tconst cartItemsContainer = document.querySelector(`.cartitem${index}`)\n\t\t\t\t\tcartItemsContainer.innerHTML = itemContent\n\t\t\t\t\tif (totalQuantity > 0) {\n\t\t\t\t\t\tconst quickCartItemContainer = document.querySelector(`.quickcartitem${index}`)\n\t\t\t\t\t\tquickCartItemContainer.innerHTML = quickItemContent\n\t\t\t\t\t\tCommonUtils.showElement('#DIVcartSumItemsList')\n\t\t\t\t\t\tCommonUtils.showElement('#DIVcartbtns')\n\t\t\t\t\t\tCommonUtils.hideElement('#DIVNoItem')\n\t\t\t\t\t} else {\n\t\t\t\t\t\tCommonUtils.hideElement('#DIVcartSumItemsList')\n\t\t\t\t\t\tCommonUtils.hideElement('#DIVcartbtns')\n\t\t\t\t\t\tCommonUtils.showElement('#DIVNoItem')\n\t\t\t\t\t}\n\n\t\t\t\t\tcartItemsArray = cartItemsArray.filter(item => item.index !== index)\n\n\t\t\t\t\t// Update the total quantity in the UI\n\t\t\t\t\tconst bubbleCnt = document.querySelector('#bubble-cnt')\n\t\t\t\t\tif (bubbleCnt) bubbleCnt.innerHTML = totalQuantity.toString()\n\n\t\t\t\t\t// Get the subtotal and subtotal points from the JSON data\n\t\t\t\t\tconst subtotal = CommonUtils.getXMLDataFieldValue('dsBasket', 0, 0, 'CuryTotMerch', ajaxResults)\n\t\t\t\t\tconst subtotalPoints = CommonUtils.getXMLDataFieldValue('dsBasket', 0, 0, 'User6', ajaxResults)\n\n\t\t\t\t\tif (isBMSMActive) {\n\t\t\t\t\t\tupdateBMSMsubTotals(Number(parseFloat(subtotal).toFixed(2)))\n\t\t\t\t\t}\n\n\t\t\t\t\t// Enable the checkout button\n\t\t\t\t\tcheckoutButton.disabled = false\n\t\t\t\t\tcheckoutButton.innerText = defaultcheckoutButtonText\n\t\t\t\t\tcheckoutButton.classList.remove('loader-light')\n\t\t\t\t\tcheckoutButton.classList.remove('disabled')\n\n\t\t\t\t\t// Update the subtotal and subtotal points in the main UI\t\t\n\t\t\t\t\tsubtotalInUI.classList.remove('loader-dark-small')\n\t\t\t\t\tsubtotalInUI.innerHTML = `$${parseFloat(subtotal).toFixed(2)}`\n\t\t\t\t\tcarttotalInUI.classList.remove('loader-dark-small')\n\t\t\t\t\tcarttotalInUI.innerHTML = `$${parseFloat(subtotal).toFixed(2)}`\n\t\t\t\t\tsubtotalPointsInUI.classList.remove('loader-dark-small')\n\t\t\t\t\tsubtotalPointsInUI.innerHTML = `${CommonUtils.formatPoints(subtotalPoints)} Points`\n\t\t\t\t\tcartPointsSubtotal.classList.remove('loader-dark-small')\n\t\t\t\t\tcartPointsSubtotal.innerHTML = `${CommonUtils.formatPoints(subtotalPoints)} Points`\n\n\t\t\t\t\t// // Update the subtotal and subtotal points in the modal UI\n\t\t\t\t\tmodalhdCartTotal.classList.remove('loader-dark-small')\n\t\t\t\t\tmodalhdCartTotal.innerHTML = `$${parseFloat(subtotal).toFixed(2)}`\n\t\t\t\t\tmodalhdPointsSubtotalDiscount.classList.remove('loader-dark-small')\n\t\t\t\t\tmodalhdPointsSubtotalDiscount.innerHTML = `${CommonUtils.formatPoints(subtotalPoints)} Points`\n\t\t\t\t\tmodalSubtotalInUI.classList.remove('loader-dark-small')\n\t\t\t\t\tmodalSubtotalInUI.innerHTML = `$${parseFloat(subtotal).toFixed(2)}`\n\t\t\t\t\tmodalSubtotalPointsInUI.classList.remove('loader-dark-small')\n\t\t\t\t\tmodalSubtotalPointsInUI.innerHTML = `${CommonUtils.formatPoints(subtotalPoints)} Points`\n\n\t\t\t\t\tlet item_variant = CommonUtils.getXMLDataFieldValue('dsBasketExtensions', 0, dsBasketDeletedRow, 'Descr', ajaxResults)\n\n\t\t\t\t\tGA4Items[currentBasketID] = {\n\t\t\t\t\t\titem_id: CommonUtils.getXMLDataFieldValue('dsBasket', 1, dsBasketDeletedRow, 'itemId', ajaxResults),\n\t\t\t\t\t\titem_name: CommonUtils.getXMLDataFieldValue('dsBasket', 1, dsBasketDeletedRow, 'descr', ajaxResults),\n\t\t\t\t\t\taffiliation: defaultConfigs.siteName,\n\t\t\t\t\t\tprice: CommonUtils.getXMLDataFieldValue('dsBasket', 1, dsBasketDeletedRow, 'curylistprice', ajaxResults),\n\t\t\t\t\t\tdiscount: CommonUtils.getXMLDataFieldValue('dsBasket', 1, dsBasketDeletedRow, 'discacct', ajaxResults) || 0,\n\t\t\t\t\t\tsubscription: CommonUtils.getXMLDataFieldValue('dsBasket', 1, dsBasketDeletedRow, 'itemId', ajaxResults).includes('-SUB') ? 'yes' : 'no',\n\t\t\t\t\t\titem_brand: defaultConfigs.siteDomainName,\n\t\t\t\t\t\titem_category: CommonUtils.getXMLDataFieldValue('dsBasket', 1, dsBasketDeletedRow, 'parentcategoryid', ajaxResults),\n\t\t\t\t\t\tquantity: CommonUtils.getXMLDataFieldValue('dsBasket', 1, dsBasketDeletedRow, 'qtyord', ajaxResults),\n\t\t\t\t\t\tindex: index,\n\t\t\t\t\t\titem_list_id: CommonUtils.getXMLDataFieldValue('dsBasket', 1, dsBasketDeletedRow, 'categoryid', ajaxResults) || 'N/A',\n\t\t\t\t\t\titem_list_name: CommonUtils.getXMLDataFieldValue('dsBasket', 1, dsBasketDeletedRow, 'categoryname', ajaxResults) || 'N/A',\n\t\t\t\t\t}\n\t\t\t\t\tif (item_variant) {\n\t\t\t\t\t\tGA4Items[currentBasketID] = { ...GA4Items[currentBasketID], item_variant: item_variant }\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}\n\n\t// Attach the function to the event using event delegation\n\t$(document).on('click', '.undo-button', async function () {\n\t\tconst index = $(this).data('index')\n\t\tconst basketId = $(this).data('basketid')\n\t\tconst productID = $(this).data('itemid')\n\t\tconst productExtensionGroups = $(this).data('extensiongroups')\n\t\tconst productSelectedExtensions = $(this).data('selectedextensions')\n\n\t\thandleUndoButtonClick(index, basketId, productID, productExtensionGroups, productSelectedExtensions)\n\t})\n})\n\n// Function to escape special characters in a string for RegExp\nfunction escapeRegExp(string) {\n\treturn string.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n}\n\nfunction formatPrice(price) {\n\t// Remove non-digit characters\n\tlet formattedPrice = price.replace(/\\D/g, '')\n\n\t// Add a decimal point before the last two digits\n\tformattedPrice = formattedPrice.replace(/(\\d)(\\d{2})$/, '$1.$2')\n\n\t// Add commas as thousand separators\n\tformattedPrice = formattedPrice.replace(/(?=(\\d{3})+(\\D))\\B/g, ',')\n\n\treturn formattedPrice\n}\n\n/**\n * Sanitize a string and parse it into a JSON object.\n * @param {string} data - The string to sanitize and parse.\n * @return {Object} The parsed JSON object.\n */\nfunction sanitizeToJson(data: string) {\n\t// Remove all newline characters from the string\n\tdata = data.replace(/\\n/g, '')\n\n\t// Remove all characters from the start of the string up to the first '{'\n\tdata = data.replace(/^[^{]*/g, '')\n\n\t// Parse the sanitized string into a JSON object\n\tconst jsonData = JSON.parse(data)\n\n\treturn jsonData\n}\n\n/**\n * Add a loading bar to the subtotal elements in the UI.\n */\nfunction addLoadingBarToSubtotals() {\n\t// Define the HTML for the loading bar\n\tconst loadingHtml = ''\n\n\t// Add the loading bar to the subtotal elements in the main UI\n\tsubtotalInUI.innerHTML = ''\n\tsubtotalInUI.classList.add('loader-dark-small')\n\tcarttotalInUI.innerHTML = ''\n\tcarttotalInUI.classList.add('loader-dark-small')\n\tdiscountInUI.innerHTML = ''\n\tdiscountInUI.classList.add('loader-dark-small')\n\ttotalInUI.innerHTML = ''\n\ttotalInUI.classList.add('loader-dark-small')\n\tsubtotalPointsInUI.innerHTML = ''\n\tsubtotalPointsInUI.classList.add('loader-dark-small')\n\tcartPointsSubtotal.innerHTML = ''\n\tcartPointsSubtotal.classList.add('loader-dark-small')\n\n\t// Add the loading bar to the subtotal elements in the modal UI\n\tmodalhdCartTotal.innerHTML = ''\n\tmodalhdCartTotal.classList.add('loader-dark-small')\n\tmodalhdPointsSubtotalDiscount.innerHTML = ''\n\tmodalhdPointsSubtotalDiscount.classList.add('loader-dark-small')\n\tmodalSubtotalInUI.innerHTML = ''\n\tmodalSubtotalInUI.classList.add('loader-dark-small')\n\tmodalSubtotalPointsInUI.innerHTML = ''\n\tmodalSubtotalPointsInUI.classList.add('loader-dark-small')\n}\n\n/**\n * Update the cart UI with the given data.\n * @param {string} data - The data to update the cart UI with.\n */\nfunction updateCartUI(data: string) {\n\t// If there are still items loading, don't update the UI\n\tif (loadingList.length > 0) return\n\n\t// Sanitize the data and parse it into a JSON object\n\tconst jsonData = sanitizeToJson(data)\n\n\t//Update BMSM subtotals\n\tif (isBMSMActive) {\n\t\tupdateBMSMsubTotals(jsonData.Table[0].CuryTotMerch)\n\t}\n\n\t// Get the subtotal and subtotal points from the JSON data\n\tconst subtotal = jsonData.Table[0].CuryTotMerch.toFixed(2).toString()\n\tconst subtotalPoints = jsonData.Table[0].User6\n\n\t// Update the subtotal and subtotal points in the main UI\n\tsubtotalInUI.classList.remove('loader-dark-small')\n\tsubtotalInUI.innerHTML = `$${formatPrice(subtotal)}`\n\tcarttotalInUI.classList.remove('loader-dark-small')\n\tcarttotalInUI.innerHTML = `$${formatPrice(subtotal)}`\n\tsubtotalPointsInUI.classList.remove('loader-dark-small')\n\tsubtotalPointsInUI.innerHTML = `${CommonUtils.formatPoints(subtotalPoints)} Points`\n\tcartPointsSubtotal.classList.remove('loader-dark-small')\n\tcartPointsSubtotal.innerHTML = `${CommonUtils.formatPoints(subtotalPoints)} Points`\n\n\t// Update the subtotal and subtotal points in the modal UI\n\tmodalhdCartTotal.classList.remove('loader-dark-small')\n\tmodalhdCartTotal.innerHTML = `$${formatPrice(subtotal)}`\n\tmodalSubtotalInUI.classList.remove('loader-dark-small')\n\tmodalSubtotalInUI.innerHTML = `$${formatPrice(subtotal)}`\n\tmodalhdPointsSubtotalDiscount.classList.remove('loader-dark-small')\n\tmodalhdPointsSubtotalDiscount.innerHTML = `${CommonUtils.formatPoints(subtotalPoints)} Points`\n\tmodalSubtotalPointsInUI.classList.remove('loader-dark-small')\n\tmodalSubtotalPointsInUI.innerHTML = `${CommonUtils.formatPoints(subtotalPoints)} Points`\n\n\t// Calculate the total quantity of items in the cart\n\tlet totalQuantity = 0\n\tconst productQuantities: NodeListOf = document.querySelectorAll('[id*=\\'cartQty\\']')\n\tproductQuantities.forEach(productQuantity => {\n\t\ttotalQuantity += parseInt(productQuantity.value) || 0\n\t})\n\n\t// Update the total quantity in the UI\n\tconst bubbleCnt = document.querySelector('#bubble-cnt')\n\tif (bubbleCnt) bubbleCnt.innerHTML = totalQuantity.toString()\n\n\tif (totalQuantity === 0) {\n\t\tCommonUtils.hideElement('#DIVcartSumItemsList')\n\t\tCommonUtils.hideElement('#DIVcartbtns')\n\t\tCommonUtils.showElement('#DIVNoItem')\n\t} else {\n\t\tCommonUtils.showElement('#DIVcartSumItemsList')\n\t\tCommonUtils.showElement('#DIVcartbtns')\n\t\tCommonUtils.hideElement('#DIVNoItem')\n\t}\n\t// Enable the checkout button\n\tcheckoutButton.disabled = false\n\tcheckoutButton.innerText = defaultcheckoutButtonText\n\tcheckoutButton.classList.remove('loader-light')\n\tcheckoutButton.classList.remove('disabled')\n}\n\nfunction updateBMSMsubTotals(subtotal: number) {\n\t//Update BMSM subtotals\n\tlet promoTiersLenght = promoPropsObj.promoTiers.length\n\tif (subtotal < promoPropsObj.promoTiers[0].minTotal) {\n\t\tpromoPropsObj.discount = 0\n\t} else if (subtotal > promoPropsObj.promoTiers[promoTiersLenght - 1].minTotal) {\n\t\tpromoPropsObj.discount = promoPropsObj.promoTiers[promoTiersLenght - 1].dollarOff\n\t} else {\n\t\tfor (let i = 0; i < promoTiersLenght - 1; i++) {\n\t\t\tif ((subtotal > promoPropsObj.promoTiers[i].minTotal) && (subtotal < promoPropsObj.promoTiers[i + 1].minTotal)) {\n\t\t\t\tpromoPropsObj.discount = promoPropsObj.promoTiers[i].dollarOff\n\t\t\t}\n\t\t}\n\t}\n\tif (promoPropsObj.discount > 0) {\n\t\t$('#cartULNoDiscount').hide()\n\t\t$('#cartULDiscount').show()\n\t\t$('#hdULNoDiscount').hide()\n\t\t$('#hdULDiscount').show()\n\t\tconst subtotalContaniner = document.querySelector('#liSubtotalInUI')\n\t\tif (subtotalContaniner) {\n\t\t\tsubtotalContaniner.firstElementChild.innerHTML = 'Cart Total: '\n\t\t}\n\t\tdiscountInUI.classList.remove('loader-dark-small')\n\t\tdiscountInUI.innerHTML = `-$${formatPrice((promoPropsObj.discount).toFixed(2).toString())}`\n\t\ttotalInUI.classList.remove('loader-dark-small')\n\t\ttotalInUI.innerHTML = `$${formatPrice((subtotal - promoPropsObj.discount).toFixed(2).toString())}`\n\t\tmodalhdDiscount.classList.remove('loader-dark-small')\n\t\tmodalhdDiscount.innerHTML = `-$${formatPrice((promoPropsObj.discount).toFixed(2).toString())}`\n\t\tmodalhdTotal.classList.remove('loader-dark-small')\n\t\tmodalhdTotal.innerHTML = `$${formatPrice((subtotal - promoPropsObj.discount).toFixed(2).toString())}`\n\t} else {\n\t\tconst subtotalContaniner = document.querySelector('#liSubtotalInUI')\n\t\tif (subtotalContaniner) {\n\t\t\tsubtotalContaniner.firstElementChild.innerHTML = 'Subtotal: '\n\t\t}\n\t\t$('#cartULDiscount').hide()\n\t\t$('#cartULNoDiscount').show()\n\t\t$('#hdULDiscount').hide()\n\t\t$('#hdULNoDiscount').show()\n\t}\n}\n\n/**\n * Remove all whitespace characters in a string.\n * @param {string} text - The string to remove whitespace from.\n * @return {string} The string with all whitespace removed.\n */\nfunction removeEmptySpaceInString(text: string) {\n\t// If the text is falsy (e.g., null, undefined, empty string), return it as is\n\tif (!text) return text\n\n\t// Use a regular expression to replace all whitespace characters with nothing\n\tconst noWhitespaceText = text.replace(/\\s/g, '')\n\n\treturn noWhitespaceText\n}\n\n/**\n * Update the UI for a specific cart item with the given data.\n * @param {string} basketID - The ID of the product to update the UI for.\n * @param {string} data - The data to update the cart item UI with.\n */\nfunction updateCartItemUI(basketID: string, data: string, qtyIndex: string) {\n\t// Select the cart item elements in the main UI and the modal UI\n\tconst cartItem = document.querySelector(`#cart-item-${basketID}`)\n\tconst modalCartItem = document.querySelector(`#modal-cart-item-${basketID}`)\n\n\t// Sanitize the data and parse it into a JSON object\n\tconst jsonData = sanitizeToJson(data)\n\n\t// Loop through each product in the JSON data\n\tjsonData.Table1.forEach((product) => {\n\t\t// If the product ID in the JSON data doesn't match the given product ID, skip this iteration\n\t\tif (removeEmptySpaceInString(product.basketid) !== basketID) return\n\t\t// Update the product quantity price in the main UI\n\t\tcartItem.querySelector(`#product-quantity-price${qtyIndex}`).innerHTML = `$${formatPrice(product.curytotord.toFixed(2).toString())}`\n\t\tcartItem.querySelector('#product-quantity-price-in-points').innerHTML = `${CommonUtils.formatPoints(product.user6)} Points`\n\n\t\t// Update the product quantity in the modal UI\n\t\tmodalCartItem.querySelector('#cart-modal-product-quantity').innerHTML = product.quantity\n\t\tdocument.querySelector(`#cart-item-${basketID} .delete-product`).setAttribute('data-quantity', product.quantity.toString())\n\n\t})\n\n}\n\n/**\n * Delete the UI elements for a specific cart item.\n * @param {string} basketID - The ID of the product to delete the UI elements for.\n */\nfunction deleteCartItemUI(basketID: string) {\n\t// Select the cart item elements in the main UI and the modal UI\n\tconst cartItem: HTMLElement = document.querySelector(`#cart-item-${basketID}`)\n\tconst modalCartItem: HTMLElement = document.querySelector(`#modal-cart-item-${basketID}`)\n\n\t// If the cart item element exists in the main UI, remove it\n\tif (cartItem) {\n\t\tcartItem.parentNode.removeChild(cartItem)\n\t}\n\n\t// If the cart item element exists in the modal UI, remove it\n\tif (modalCartItem) {\n\t\tmodalCartItem.parentNode.removeChild(modalCartItem)\n\t}\n}\n\n/**\n * Empty the cart by removing the cart items from the UI and displaying a message that the cart is empty.\n */\nfunction emptyCart() {\n\t// Select the cart item elements in the main UI\n\tconst cartItemsHeader = document.querySelector('#cart-items-header')\n\tconst cartItemsContainer = document.querySelector('#cart-items-container')\n\tconst cartItemsCheckoutContainer = document.querySelector('#cart-items-checkout-container')\n\n\t// Select the cart item elements in the modal UI\n\tconst modalCartContainer = document.querySelector('#div_drop-shopcart')\n\tconst modalCartQuantityCountSum = document.querySelector('#cartSumQty')\n\n\t// If the cart item elements exist in the main UI, remove them\n\t/* \tif (cartItemsHeader) {\n\t\t\tcartItemsHeader.parentNode.removeChild(cartItemsHeader)\n\t\t}\n\t\tif (cartItemsCheckoutContainer) {\n\t\t\tcartItemsCheckoutContainer.parentNode.removeChild(cartItemsCheckoutContainer)\n\t\t}\n\t\tif (modalCartQuantityCountSum) {\n\t\t\tmodalCartQuantityCountSum.parentNode.removeChild(modalCartQuantityCountSum)\n\t\t} */\n\t// Define the HTML for the empty cart message\n\tconst htmlString = '
'\n\n\t//Hide DIVcartSumItemsList element and show DIVNoItem\n\tCommonUtils.hideElement('#DIVcartSumItemsList')\n\tCommonUtils.hideElement('#DIVcartbtns')\n\tCommonUtils.showElement('#DIVNoItem')\n}\n\nfunction removeControls() {\n\tCommonUtils.hideElement('cart-items-checkout-container')\n}\n\nfunction addControls() {\n\tCommonUtils.showElement('cart-items-checkout-container')\n}\n\n/**\n * Update the quantity of a product in the cart.\n * @param {string} productID - The ID of the product to update.\n * @param {HTMLElement} quantityInput - The input element for the product quantity.\n * @param {string} basketID - The ID of the basket that contains the product.\n */\nasync function updateProductQuantityInCart(productID: string, quantityInput: HTMLInputElement, basketID: string, undoDiv: string) {\n\tlet deleteItem = false\n\tconst parentElement = quantityInput.parentNode\n\t// Retrieve the quantity value from the input element\n\tconst quantityValue = parseInt(quantityInput.value)\n\tconst qtyIndex = quantityInput.getAttribute('data-index')!\n\n\t// If the quantity is 0 or less, confirm with the user if they want to remove the item\n\tif (quantityValue <= 0) {\n\t\tdeleteItem = true\n\t\tCommonUtils.showElement(undoDiv)\n\t}\n\n\t// If the quantity is more than 99, alert the user and revert the quantity\n\tif (quantityValue > 99) {\n\t\talert('Value must be less than or equal to 99.')\n\t\tquantityInput.setAttribute('value', quantityInput['oldvalue'])\n\t\tquantityInput.value = quantityInput['oldvalue']\n\t\tquantityInput.dispatchEvent(new Event('input', { bubbles: true }))\n\t\treturn\n\t}\n\n\t// If the quantity is a float, alert the user and revert the quantity\n\tif (!Number.isInteger(quantityValue)) {\n\t\tquantityInput.setAttribute('value', Math.round(quantityValue).toString())\n\t\treturn\n\t}\n\n\t// Add a loading bar to the subtotals\n\taddLoadingBarToSubtotals()\n\n\t// Add the product ID to the loading list\n\tloadingList.push(productID)\n\n\t// Add a loading image next to the quantity input\n\n\tif (parentElement instanceof Element) {\n\t\tparentElement.classList.add('loader-absolute-right')\n\t}\n\n\t// Disable the checkout button and the quantity input\n\tcheckoutButton.classList.add('disabled')\n\tcheckoutButton.classList.add('loader-light')\n\tcheckoutButton.innerText = ''\n\tcheckoutButton.disabled = true\n\tquantityInput.disabled = true // Disable the input\n\n\t// Define the URL and parameters for the AJAX request\n\tconst ajaxCartUrl = '/ajax/newCart.aspx'\n\tconst params = `&actionType=CARTUPDATE&basketId=${basketID}&productID=${productID}&quantity=${quantityValue}&posting=TRUE`\n\t// Send the AJAX request\n\tconst request = await $.ajax({\n\t\turl: ajaxCartUrl,\n\t\ttype: 'POST',\n\t\tcache: false,\n\t\tdata: params,\n\t\tasync: true\n\t})\n\n\t// Remove the product ID from the loading list\n\tconst index = loadingList.indexOf(productID)\n\tif (index !== -1) {\n\t\tloadingList.splice(index, 1)\n\t}\n\n\t// If the item was deleted, update the UI accordingly\n\tlet itemIndex = cartItemsObj.findIndex((item) => item.invtID === productID)\n\tif (deleteItem) {\n\t\tdeleteCartItemUI(basketID)\n\t\tconst jsonData = sanitizeToJson(request)\n\t\tif (jsonData.Table1.length <= 0) {\n\t\t\t//emptyCart();\n\t\t\tremoveControls()\n\t\t}\n\t\tcartItemsObj.slice(itemIndex, 1)\n\t} else {\n\t\t// If the item was not deleted, update the cart item UI and enable the quantity input\n\t\tupdateCartItemUI(basketID, request, qtyIndex)\n\t\tquantityInput.disabled = false // Enable the input\n\t\tcartItemsObj[itemIndex].quantity = Number(quantityInput.value)\n\t}\n\n\t// Remove the loading image\n\tif (parentElement instanceof Element) {\n\t\tparentElement.classList.remove('loader-absolute-right')\n\t}\n\n\t// Update the cart UI\n\tupdateCartUI(request)\n\n\t// Update Sales Force tracking cart\n\tsfTrackCart(sanitizeToJson(request))\n\n}\n\nfunction sfTrackCart(cartData) {\n\tconst cart = cartData.Table1\n\tconst parsedCart = cart.map((item) => ({\n\t\titem: item.itemid.trim(),\n\t\tquantity: item.qtyord,\n\t\tprice: item.curylistprice.toFixed(2).toString(),\n\t\tsale_price: (item.curylistprice > item.curyslsprice) ? item.curyslsprice.toString() : undefined,\n\t\tunique_id: (item.alternateid.trim() || item.invtid.trim())\n\t}))\n\n\tSalesforceAbandonedCartUtils.cartOrOrderData = parsedCart\n\tSalesforceAbandonedCartUtils.trackCart()\n}\n\n/**\n * Delete a product from the cart.\n * @param {string} productID - The ID of the product to delete.\n * @param {string} basketID - The ID of the basket that contains the product.\n */\nasync function deleteProductInCart(productID, basketID) {\n\t// Add a loading bar to the subtotals\n\taddLoadingBarToSubtotals()\n\n\tconst deletedItemGA4 = GA4Items[basketID]\n\tif (!deletedItemGA4) {\n\t\treturn\n\t};\n\tconst deleteInfo = document.querySelector(`#cart-item-${basketID} .delete-product`)\n\n\t// remove the delete button with a loader\n\tconst deleteButton = document.querySelector(`#cart-item-${basketID} .Update`)\n\tdeleteButton.innerHTML = ''\n\n\t// Disable the checkout button\n\tcheckoutButton.classList.add('disabled')\n\tcheckoutButton.classList.add('loader-light')\n\tcheckoutButton.innerText = ''\n\tcheckoutButton.disabled = true\n\n\t// Define the URL and parameters for the AJAX request\n\tconst ajaxCartUrl = '/ajax/newCart.aspx'\n\tlet params = `&actionType=CARTDELETE&basketId=${basketID}&productID=${productID}&posting=TRUE`\n\n\t// Send the AJAX request\n\tconst request = await $.ajax({\n\t\turl: ajaxCartUrl,\n\t\ttype: 'POST',\n\t\tcache: false,\n\t\tdata: params,\n\t\tasync: true\n\t})\n\n\tdataLayer.push({ ecommerce: null }) // Clear the previous ecommerce object.\n\tdataLayer.push({\n\t\t'event': 'remove_from_cart',\n\t\t'ecommerce': {\n\t\t\t'currency': 'USD',\n\t\t\t'value': Number((deletedItemGA4.price * deletedItemGA4.quantity).toFixed(2)),\n\t\t\t'items': deletedItemGA4\n\t\t},\n\t\t'event_value': Number((deletedItemGA4.price * deletedItemGA4.quantity).toFixed(2))\n\t})\n\n\t// Delete the cart item UI for the product\n\tdeleteCartItemUI(basketID)\n\n\t// Update the cart UI with the response from the AJAX request\n\tupdateCartUI(request)\n\n\t// Sanitize the response and parse it into a JSON object\n\tconst jsonData = sanitizeToJson(request)\n\n\t// If the cart only has GWP product left, remove it\n\tif (jsonData.Table1.length === 1 && jsonData.Table1[0].itemid.toLowerCase().includes('gwp')) {\n\t\tdeleteProductInCart(jsonData.Table1[0].itemid, jsonData.Table1[0].basketid)\n\t}\n\n\t// If there are no more items in the cart, empty the cart\n\tif (jsonData.Table1.length <= 0) {\n\t\t//emptyCart()\n\t\tremoveControls()\n\t}\n\n\t// Update Sales Force tracking cart\n\tsfTrackCart(sanitizeToJson(request))\n}\n\n/**\n * Empty the entire cart.\n * This function will prompt the user for confirmation before emptying the cart.\n * If the user confirms, it will set the 'actionType' input's value to 'CARTEMPTY' and submit the 'OCForm1' form.\n */\nfunction doEmptyCart() {\n\t// Prompt the user for confirmation\n\tconst userConfirmed = confirm('Warning: This will empty your entire cart!\\n')\n\n\t// If the user confirmed, empty the cart\n\tif (userConfirmed) {\n\t\t// Get the 'actionType' input element\n\t\tconst actionTypeInput = document.getElementById('actionType') as HTMLInputElement\n\n\t\t// Set the 'actionType' input's value to 'CARTEMPTY'\n\t\tactionTypeInput.value = 'CARTEMPTY'\n\n\t\t// Get the 'OCForm1' form element\n\t\tconst form = document.getElementById('OCForm1') as HTMLFormElement\n\n\t\t// Submit the 'OCForm1' form\n\t\tform.submit()\n\t}\n}\n\n/**\n * Proceed to checkout.\n * This function will set the 'actionType' input's value to its current value plus ',CARTCHECKOUT' and submit the 'OCForm1' form.\n * This effectively signals that the user wants to proceed to checkout.\n */\nfunction checkout() {\n\t// Get the 'actionType' input element\n\tconst actionTypeInput = document.getElementById('actionType') as HTMLInputElement\n\n\t// Append ',CARTCHECKOUT' to the 'actionType' input's value\n\tactionTypeInput.value += ',CARTCHECKOUT'\n\n\t// Get the 'OCForm1' form element\n\tconst form = document.getElementById('OCForm1') as HTMLFormElement\n\n\t// Submit the 'OCForm1' form\n\tform.submit()\n}\n\n// Define a type for cart item\ntype CartItem = {\n\telement: HTMLElement;\n\titemID: string;\n};\n\nfunction retrieveItemIDs(): CartItem[] {\n\t// Select all elements with class name 'cart-item'\n\tconst cartItems = document.querySelectorAll('.cart-item')\n\n\t// Array to store cart items with element and itemID\n\tconst itemIDs: CartItem[] = []\n\n\t// Loop through each cart-item element\n\tcartItems.forEach((cartItem) => {\n\t\t// Retrieve the value of data-itemid attribute\n\t\tconst itemID = cartItem.getAttribute('data-itemid')\n\n\t\t// Check if itemID exists and is not empty\n\t\tif (itemID) {\n\t\t\t// Store cart item as an object containing element and itemID\n\t\t\titemIDs.push({ element: cartItem as HTMLElement, itemID })\n\t\t}\n\t})\n\n\t// Check if any itemID contains the substring '-SUB'\n\tconst hasSubItem = itemIDs.some((item) => item.itemID.includes('-SUB'))\n\n\t// Show or hide error element based on the presence of '-SUB'\n\tif (hasSubItem) {\n\t\tCommonUtils.showElement('cartPointsSubError')\n\t\tCommonUtils.showElement('quickcart-points-has-subs')\n\t} else {\n\t\tCommonUtils.hideElement('cartPointsSubError')\n\t\tCommonUtils.hideElement('quickcart-points-has-subs')\n\t}\n\n\t// Return the array of CartItem objects\n\treturn itemIDs\n}\n\nfunction removeElementByItemId(itemIDs: CartItem[], itemIdToRemove: string): void {\n\t// Find index of item to remove\n\tconst indexToRemove = itemIDs.findIndex((item) => item.itemID === itemIdToRemove)\n\n\t// If item found, remove it from the itemIDs array\n\tif (indexToRemove !== -1) {\n\t\t// Remove the element from the DOM\n\t\tconst elementToRemove = itemIDs[indexToRemove].element\n\t\t//elementToRemove.parentNode?.removeChild(elementToRemove);\n\n\t\t// Remove the item from the itemIDs array\n\t\titemIDs.splice(indexToRemove, 1)\n\n\t\t// After removal, check again for '-SUB' and update error element visibility\n\t\tconst hasSubItem = itemIDs.some((item) => item.itemID.includes('-SUB'))\n\t\tif (hasSubItem) {\n\t\t\tCommonUtils.showElement('cartPointsSubError')\n\t\t\tCommonUtils.showElement('quickcart-points-has-subs')\n\t\t} else {\n\t\t\tCommonUtils.hideElement('cartPointsSubError')\n\t\t\tCommonUtils.hideElement('quickcart-points-has-subs')\n\t\t}\n\t}\n}"]}