{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./cartridges/app_custom_core/cartridge/client/default/js/stockinstore.js","webpack:///./cartridges/app_custom_core/cartridge/client/default/js/product/base.js","webpack:///./cartridges/int_capency_sfra_custom/cartridge/client/default/js/capency/email/capency.verify.email.js","webpack:///./dependencies/int_capency_sfra/cartridge/client/default/js/capency/email/capency.verify.email.js","webpack:///./dependencies/storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/util.js","webpack:///./dependencies/storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/product/base.js","webpack:///./cartridges/int_capency_sfra_custom/cartridge/client/default/js/capency/email/serverActions/callWebService.js","webpack:///./cartridges/app_custom_core/cartridge/client/default/js/product/wishlistHeart.js","webpack:///./cartridges/app_custom_core/cartridge/client/default/js/giftCardProduct.js","webpack:///./cartridges/app_custom_core/cartridge/client/default/js/product/giftCardProduct.js","webpack:///./dependencies/plugin_wishlists/cartridges/plugin_wishlists/cartridge/client/default/js/product/wishlist.js","webpack:///./dependencies/int_capency_sfra/cartridge/client/default/js/capency/email/capemail.js","webpack:///./cartridges/int_capency_sfra_custom/cartridge/client/default/js/capency/email/formUtils.js","webpack:///./cartridges/int_capency_sfra_custom/cartridge/client/default/js/capency/email/function.js","webpack:///./dependencies/int_capency_sfra/cartridge/client/default/js/capency/email/function.js","webpack:///./cartridges/int_capency_sfra_custom/cartridge/client/default/js/capencyHelper.js","webpack:///./dependencies/storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/focus.js","webpack:///./dependencies/storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/product/detail.js","webpack:///./cartridges/app_custom_core/cartridge/client/default/js/product/attributes.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","getStockInStore","storeId","productId","url","$stockInStoreBlock","$","urlId","length","data","encodeURIComponent","val","spinner","start","ajax","method","dataType","success","error","renderedTemplate","html","trigger","stop","base","attributesLogic","stockInStoreHelper","getQuantitySelector","$el","quantitySelected","closest","find","quantitySelectedModal","quantitySelectedPDP","undefined","getQuantitySelected","chooseBonusProducts","bonusUrl","remove","bonusChoiceRuleBased","showProductsUrlRuleBased","showProductsUrlListBased","htmlString","maxBonusItems","uuid","pliUUID","addToCartUrl","pageSize","labels","selectprods","append","response","$html","parsedHtml","body","parseHTML","footer","children","empty","text","enterDialogMessage","closeButtonText","modal","getOptions","$productContainer","options","map","$elOption","this","urlValue","selectedValueId","optionId","toArray","JSON","stringify","handleVariantResponse","isVaraint","paramID","newValue","urlObj","params","isChoiceOfBonusProducts","parents","product","variationAttributes","attrs","msgs","attrsWithSwatches","forEach","attr","indexOf","id","values","attrValue","$attrValue","selected","addClass","siblings","assistiveSelectedText","removeClass","removeAttr","selectable","processSwatchValues","$attr","$defaultOption","$selectedBisEnabledAttribute","resetUrl","available","toggleClass","$attributesArea","hasClass","processNonSwatchValues","updateAttrs","resources","productType","parent","readyToOrder","imgs","carousel","carouselId","alt","parseInt","index","title","appendTo","first","detach","createCarousel","images","large","replaceWith","price","hasStandardDiscount","standard","sales","hasClubDiscount","club","promotionsHtml","availabilityValue","availabilityMessages","availability","messages","message","info_selectforstock","updateAvailability","attributes","attributeGroup","ID","attribute","label","getAttributesHtml","refLabel","$eReservationIframe","urlIframe","newUrl","URL","URLSearchParams","search","set","toString","attributeSelect","currentTarget","selectedValueUrl","className","container","optionsHtml","updateOptions","quantities","quantity","join","updateQuantities","toggleOverlay","show","on","evt","disable_addToCart","initEvents","$body","e","$carousel","$productVideo","videoInfo","videoIndex","$videoEl","clone","each","el","is","slick","Additional","image","$anchor","$img","class","src","productName","modalURL","slidesToShow","slidesToScroll","dots","focusOnSelect","infinite","arrows","responsive","breakpoint","settings","reloadCarousel","$fpePopinLink","EAN","updateSelectableVariationAttributes","addToCart","document","pid","pidsObj","setPids","push","qty","childProducts","productGtm","form","is_error","newBonusDiscountLineItem","keys","$tabContent","setTimeout","handlePostCartAdd","reportingURL","click","resultPli","cart","items","item","UUID","smallImageUrl","small","smallImageAlt","colorText","displayName","displayValue","sizeText","selectAttribute","preventDefault","window","capency","checkEmailPropertyResult","$emailSelector","force","Promise","resolve","reject","urlCapCheckEmailProp","capData","sMail","type","result","returnCode","next","sMessage","focus","Error","mail","finalDatasource","autocomplete","minLength","autoFocus","source","request","select","event","ui","$this","showCapencyVerifyEmailResult","currentEmail","$containerModal","$msgReturn","$emailError","include","focusHelper","getPidValue","$swatchButton","parseHtml","miniCartReportingUrl","methods","editBonusProducts","focusChooseBonusProductModal","onClosingChooseBonusProductModal","trapChooseBonusProductModalFocus","focusParams","containerSelector","firstElementSelector","lastElementSelector","setTabNextFocus","colorAttribute","messageType","selectBonusProduct","$choiceOfBonusProduct","maxPids","submittedQty","totalQty","optionID","valueId","selectedBonusProductHtml","removeBonusProduct","$selected","count","enableBonusProductSelection","showMoreBonusProducts","addBonusProductsToCart","$readyToOrderBonusProducts","queryString","pidsObject","bonusProducts","qtyOption","option","errorMessage","msgSuccess","location","reload","urlCapAddressSearchEmail","SearchMailCivWS","async","email","fname","lname","capEmailData","sInput","sNom","sPrenom","err","displayMessageAndChangeIcon","icon","msg","toggleWishlist","stopPropagation","routeType","removeFromWishlistUrl","optionVal","notAddedToWishlist","removeFromWishlist","processInclude","capencyHelper","capencyVerifyEmail","fillModalElement","valideName","match","valideText","validateField","field","shouldDisplayErrors","isValid","$currentField","currentFieldType","currentFieldValue","isEmpty","isTooHigh","parseFloat","isTooLow","isNotMatching","nameIsNotValid","textIsNotValid","hide","validationMessage","validateFormular","prop","formSubmit","args","action","$form","jsonError","responseJSON","maxLimitError","$addGiftCardBtn","giftCardAmount","recipientName","$recipientEmail","recipientEmail","recipientConfirmEmail","isCapencyEnabled","then","apply","ready","initProductDetailLogic","toggleAttribute","selectAttributeValue","showProductDetailImageModal","target","displayMessage","button","status","addToWishlist","$iscapEmailEnable","initCapEmailByForms","keyTimer","capPEmailConfiguration","capencyFields","setConfigToCapEmail","formID","isEditableForm","$formSelector","config","getConfig","listItem","emailFieldsIDs","selectorEmail","$field","formChild","clearTimeout","EmailID","callProcessEmailFlow","keyTimer2","formIdListToInit","listFormWithCapAddress","getIdForms","String","includes","deleteAutoCompleteBrowser","callWebService","urlCapEmailConfig","capConfiguration","parse","currentFormConfig","configCurrentForm","$formID","idForm","$firstNameSelector","firstName","$lastNameSelector","lastName","searchResulat","dataSourceEmail","capAddressConfig","editableT","currentForms","filter","formEdit","editable","ids","obj","setFieldValid","$selector","state","setRequiredError","resetModifiedFlagOnFields","fields","checkFieldsModified","some","enabled","$iscapPhoneEnable","$iscapAddressEnable","removeFieldValidationResults","validatePhone","$phoneSelector","fillZipCodeWithAllCapData","$zipSelector","isAddressFormModified","isEmailFormModified","resetModifiedFlagOnAddressFields","resetModifiedFlagOnEmailFields","keyCode","firstFocusableEl","lastFocusableEl","nextToLastElementSelector","linkElements","shiftKey","updateAddToCartEnableDisableOtherElements","enableOrDisable","updateAttributesAndDetails","attributesHtml","shortDescription","longDescription","showSpinner","updateAttribute","eq","updateAddToCart","enable","every","allAvailable","allReady","sizeChart","$prodSizeChart","content","$sizeChart","has","copyProductLink","$temp","execCommand","$target","showAction","nextValue","attributeID","$variationAttributes","selectorToHide","$elmts","selector","reset","isCompatibleShippingMethod","$rootContainer","attrDataAttrID","attrDataAttrValue","attrDataAttrURL","attrDataColorSuffix","attributeValue","attributeColorSuffix","attributeDisplayValue","attributeURL","$container","$attributesElmnts","$toggleContainer","$selectedColor","$updateColorTab","$quickViewModal","selectedSizeHtml","valueAssociated"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EA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EvG,EAAE6D,MAAM4B,SAAS","file":"default/js/giftCardProduct.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 295);\n","'use strict';\n\n/**\n * Method to refresh stock in stock\n * @param {string} storeId the store id\n * @param {string} productId the product id\n * @param {string} url url\n */\nfunction getStockInStore(storeId, productId, url) {\n    var $stockInStoreBlock = $('.js-stock-in-stock-block');\n    var urlId = (url && url.length > 0 ? url : $stockInStoreBlock.data('service-url')) + '?storeId=' + storeId + '&productId=' + encodeURIComponent(productId);\n\n    $('#currentStoreId').val(storeId);\n    $('#currentProductId').val(productId);\n\n    $.spinner().start();\n    $.ajax({\n        url: urlId,\n        method: 'GET',\n        dataType: 'json',\n        success: function (data) {\n            if (data.error == null && data.renderedTemplate && data.renderedTemplate.length > 0) {\n                $stockInStoreBlock.html(data.renderedTemplate);\n                $('body').trigger('storedrawer:reinit');\n            }\n            $.spinner().stop();\n        },\n        error: function () {\n            $.spinner().stop();\n        }\n    });\n}\n\nmodule.exports = {\n    getStockInStore: getStockInStore\n};\n","'use strict';\n\nconst base = require('base:product/base');\nconst attributesLogic = require('./attributes');\nvar stockInStoreHelper = require('../stockinstore');\n\n/**\n * Retrieves the relevant pid value\n * @param {jquery} $el - DOM container for a given add to cart button\n * @return {string} - value to be used when adding product to cart\n */\nfunction getPidValue($el) {\n    var pid;\n\n    if ($('#quickViewModal').hasClass('show') && !$('.product-set').length) {\n        pid = $($el).closest('.modal-content').find('.product-quickview').data('pid');\n    } else if ($('.product-set-detail').length || $('.product-set').length) {\n        pid = $($el).closest('.product-detail').find('.product-id').text();\n    } else {\n        pid = $('.product-detail:not(\".bundle-item\")').data('pid');\n    }\n\n    return pid;\n}\n\n/**\n * Retrieve contextual quantity selector\n * @param {jquery} $el - DOM container for the relevant quantity\n * @return {jquery} - quantity selector DOM container\n */\nfunction getQuantitySelector($el) {\n    var quantitySelected;\n    if ($el && $('.set-items').length) {\n        quantitySelected = $($el).closest('.product-detail').find('.quantity-select');\n    } else if ($el && $('.product-bundle').length) {\n        var quantitySelectedModal = $($el).closest('.modal-footer').find('.quantity-select');\n        var quantitySelectedPDP = $($el).closest('.bundle-footer').find('.quantity-select');\n        if (quantitySelectedModal.val() === undefined) {\n            quantitySelected = quantitySelectedPDP;\n        } else {\n            quantitySelected = quantitySelectedModal;\n        }\n    } else {\n        quantitySelected = $('.quantity-select');\n    }\n    return quantitySelected;\n}\n\n/**\n * Retrieves the value associated with the Quantity pull-down menu\n * @param {jquery} $el - DOM container for the relevant quantity\n * @return {string} - value found in the quantity input\n */\nfunction getQuantitySelected($el) {\n    return getQuantitySelector($el).val();\n}\n\n/**\n * Retrieves url to use when adding a product to the cart\n *\n * @return {string} - The provided URL to use when adding a product to the cart\n */\nfunction getAddToCartUrl() {\n    return $('.add-to-cart-url').val();\n}\n\n/**\n * Parses the html for a modal window\n * @param {string} html - representing the body and footer of the modal window\n *\n * @return {Object} - Object with properties body and footer.\n */\nfunction parseHtml(html) {\n    var $html = $('<div>').append($.parseHTML(html));\n\n    var body = $html.find('.choice-of-bonus-product');\n    var footer = $html.find('.modal-footer').children();\n\n    return { body: body, footer: footer };\n}\n\n/**\n * Retrieves url to use when adding a product to the cart\n *\n * @param {Object} data - data object used to fill in dynamic portions of the html\n */\nfunction chooseBonusProducts(data) {\n    $('.modal-body').spinner().start();\n\n    if ($('#chooseBonusProductModal').length !== 0) {\n        $('#chooseBonusProductModal').remove();\n    }\n    var bonusUrl;\n    if (data.bonusChoiceRuleBased) {\n        bonusUrl = data.showProductsUrlRuleBased;\n    } else {\n        bonusUrl = data.showProductsUrlListBased;\n    }\n\n    var htmlString = '<!-- Modal -->'\n        + '<div class=\"modal fade\" id=\"chooseBonusProductModal\" tabindex=\"-1\" role=\"dialog\">'\n        + '<span class=\"enter-message sr-only\" ></span>'\n        + '<div class=\"modal-dialog choose-bonus-product-dialog\" '\n        + 'data-total-qty=\"' + data.maxBonusItems + '\"'\n        + 'data-UUID=\"' + data.uuid + '\"'\n        + 'data-pliUUID=\"' + data.pliUUID + '\"'\n        + 'data-addToCartUrl=\"' + data.addToCartUrl + '\"'\n        + 'data-pageStart=\"0\"'\n        + 'data-pageSize=\"' + data.pageSize + '\"'\n        + 'data-moreURL=\"' + data.showProductsUrlRuleBased + '\"'\n        + 'data-bonusChoiceRuleBased=\"' + data.bonusChoiceRuleBased + '\">'\n        + '<!-- Modal content-->'\n        + '<div class=\"modal-content\">'\n        + '<div class=\"modal-header\">'\n        + '    <span class=\"\">' + data.labels.selectprods + '</span>'\n        + '    <button type=\"button\" class=\"close pull-right\" data-dismiss=\"modal\">'\n        + '        <span aria-hidden=\"true\">&times;</span>'\n        + '        <span class=\"sr-only\"> </span>'\n        + '    </button>'\n        + '</div>'\n        + '<div class=\"modal-body\"></div>'\n        + '<div class=\"modal-footer\"></div>'\n        + '</div>'\n        + '</div>'\n        + '</div>';\n    $('body').append(htmlString);\n    $('.modal-body').spinner().start();\n\n    $.ajax({\n        url: bonusUrl,\n        method: 'GET',\n        dataType: 'json',\n        success: function (response) {\n            var parsedHtml = parseHtml(response.renderedTemplate);\n            $('#chooseBonusProductModal .modal-body').empty();\n            $('#chooseBonusProductModal .enter-message').text(response.enterDialogMessage);\n            $('#chooseBonusProductModal .modal-header .close .sr-only').text(response.closeButtonText);\n            $('#chooseBonusProductModal .modal-body').html(parsedHtml.body);\n            $('#chooseBonusProductModal .modal-footer').html(parsedHtml.footer);\n            $('#chooseBonusProductModal').modal('show');\n            $.spinner().stop();\n        },\n        error: function () {\n            $.spinner().stop();\n        }\n    });\n}\n\n/**\n* Handles post cart add response\n* @param {Object} response - response from post cart add\n*/\nfunction handlePostCartAdd(response) {\n    $('.minicart').trigger('count:update', response);\n    // show add to cart toast\n    if (response.newBonusDiscountLineItem\n        && Object.keys(response.newBonusDiscountLineItem).length !== 0) {\n        chooseBonusProducts(response.newBonusDiscountLineItem);\n    } else if ($('.wishlist-header').length === 0) {\n        if ($('.quick-view-add-to-cart-messages').length === 0) {\n            var $tabContent = $('.tab-content');\n            if ($tabContent.length !== 0) {\n                $tabContent.append('<div class=\"quick-view-add-to-cart-messages\"></div>');\n            } else if ($('.product-wrapper').length !== 0) {\n                $('.product-wrapper').append('<div class=\"quick-view-add-to-cart-messages\"></div>');\n            }\n        }\n        if ($('.quick-view-add-to-basket-alert').length === 0) {\n            $('.quick-view-add-to-cart-messages').append(\n                '<div class=\"quick-view-add-to-basket-alert text-center\" role=\"alert\">'\n                + response.message\n                + '</div>'\n            );\n        }\n\n        setTimeout(function () {\n            $('.quick-view-add-to-cart-messages').remove();\n        }, 3000);\n    }\n}\n\n/**\n * Retrieves the bundle product item ID's for the Controller to replace bundle master product\n * items with their selected variants\n *\n * @return {string[]} - List of selected bundle product item ID's\n */\nfunction getChildProducts() {\n    var childProducts = [];\n    $('.bundle-item').each(function () {\n        childProducts.push({\n            pid: $(this).find('.product-id').text(),\n            quantity: parseInt($(this).find('label.quantity').data('quantity'), 10)\n        });\n    });\n\n    return childProducts.length ? JSON.stringify(childProducts) : [];\n}\n\n/**\n * Retrieve product options\n *\n * @param {jQuery} $productContainer - DOM element for current product\n * @return {string} - Product options and their selected values\n */\nfunction getOptions($productContainer) {\n    var options = $productContainer\n        .find('.product-option')\n        .map(function () {\n            var $elOption = $(this).find('.options-select');\n            var urlValue = $elOption.val();\n            var selectedValueId = $elOption.find('option[value=\"' + urlValue + '\"]')\n                .data('value-id');\n            return {\n                optionId: $(this).data('option-id'),\n                selectedValueId: selectedValueId\n            };\n        }).toArray();\n\n    return JSON.stringify(options);\n}\n\n/**\n * Makes a call to the server to report the event of adding an item to the cart\n *\n * @param {string | boolean} url - a string representing the end point to hit so that the event can be recorded, or false\n */\nfunction miniCartReportingUrl(url) {\n    if (url) {\n        $.ajax({\n            url: url,\n            method: 'GET',\n            success: function () {\n                // reporting urls hit on the server\n            },\n            error: function () {\n                // no reporting urls hit on the server\n            }\n        });\n    }\n}\n\n$('body').on('product:handle-error', function (evt, data) {\n    if (data.disable_addToCart) {\n        $('button.add-to-cart').attr('disabled', 'disabled');\n        $('button.add-to-cart-global').attr('disabled', 'disabled');\n        $('.alert-incompatible-shipping-methods').removeClass('d-none').show();\n        $('.alert-incompatible-shipping-methods-holder').append('<div class=\"alert-incompatible-shipping-methods\"></div>');\n        $('.alert-incompatible-shipping-methods').html($('#incompatible-shipping-methods-message-holder').html());\n    }\n});\n\n/**\n* Initializes events for product detail page\n*/\nfunction initEvents() {\n    $(function () {\n        const $body = $('body');\n        $body.on('product:afterAttributeSelect', function (e, response) {\n            $body.find('.product-detail').attr('data-pid', response.data.product.id);\n            $body.find('#editWishlistProductModal .product-quickview').attr('data-pid', response.data.product.id);\n            reloadCarousel(response);\n\n            var $fpePopinLink = $body.find('.fpe-popin-link');\n            if ($fpePopinLink.length) {\n                $fpePopinLink.attr('data-ean', response.data.product.EAN);\n            }\n        });\n        $('body').on('product:updateSelectableAttribute', function (e, response) {\n            attributesLogic.updateSelectableVariationAttributes(response.data.product, response.container);\n        });\n    });\n}\n\n/**\n* Reloads the carousel with the product images from the response\n* @param {Object} response - the response object from the AJAX call\n*/\nfunction reloadCarousel(response) {\n    const $carousel = $('.detail-slider-nav');\n\n    // cache existing video if there is any\n    let $productVideo = $carousel.find('.product-video');\n\n    let videoInfo = {\n        videoIndex: 1\n    };\n\n    if ($productVideo.length) {\n        videoInfo.$videoEl = $productVideo.closest('span').clone();\n        videoInfo.videoIndex = $productVideo.closest('.slick-slide').data('slick-index');\n    }\n\n    // delete carousel\n    $carousel.each((i, el)=> {\n        let $el = $(el);\n        if ($el.is('.slick-initialized')) {\n            $el.slick('unslick');\n        }\n    });\n\n    // remove children\n    $carousel.empty();\n\n    // populate children\n    const product = response.data.product;\n    const images = product.images.Additional;\n    for (let i = 0; i < images.length; i++) {\n        let image = images[i];\n        let $anchor = $('<span>');\n        let $img = $('<img>');\n        $img.attr({\n            class: 'detail-image lazyload',\n            src: 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==',\n            'data-src': image.url,\n            alt: image.alt || product.productName,\n            title: image.title || product.productName\n        });\n        $anchor.attr({\n            class: 'product-detail-image-modal ajax-cbo',\n            'data-cbo': product.modalURL\n        });\n\n        if (videoInfo.$videoEl && videoInfo.videoIndex === i) {\n            $carousel.append(videoInfo.$videoEl);\n        }\n\n        $anchor.append($img);\n        $carousel.append($anchor);\n    }\n    // create carousel\n    const options = {\n        slidesToShow: 1,\n        slidesToScroll: 1,\n        dots: true,\n        focusOnSelect: true,\n        infinite: false,\n        arrows: true,\n        responsive: [\n            {\n                breakpoint: 544,\n                settings: {\n                    arrows: false\n                }\n            }\n        ]\n    };\n    $carousel.slick(options);\n}\n\n/**\n * Updates the quantity DOM elements post Ajax call\n * @param {UpdatedQuantity[]} quantities -\n * @param {jQuery} $productContainer - DOM container for a given product\n */\nfunction updateQuantities(quantities, $productContainer) {\n    if ($productContainer.parent('.bonus-product-item').length <= 0) {\n        var optionsHtml = quantities.map(function (quantity) {\n            var selected = quantity.selected ? ' selected ' : '';\n            return '<option value=\"' + quantity.value + '\"  data-url=\"' + quantity.url + '\"'\n                + selected + '>' + quantity.value + '</option>';\n        }).join('');\n        getQuantitySelector($productContainer).empty().html(optionsHtml);\n    }\n}\n\n/**\n * Process the attribute values for an attribute that has image swatches\n *\n * @param {Object} attr - Attribute\n * @param {string} attr.id - Attribute ID\n * @param {Object[]} attr.values - Array of attribute value objects\n * @param {string} attr.values.value - Attribute coded value\n * @param {string} attr.values.url - URL to de/select an attribute value of the product\n * @param {boolean} attr.values.isSelectable - Flag as to whether an attribute value can be\n *     selected.  If there is no variant that corresponds to a specific combination of attribute\n *     values, an attribute may be disabled in the Product Detail Page\n * @param {jQuery} $productContainer - DOM container for a given product\n * @param {Object} msgs - object containing resource messages\n */\nfunction processSwatchValues(attr, $productContainer, msgs) {\n    attr.values.forEach(function (attrValue) {\n        var $attrValue = $productContainer.find('[data-attr=\"' + attr.id + '\"] [data-attr-value=\"'\n            + attrValue.value + '\"]');\n\n        if (attrValue.selected) {\n            $attrValue.addClass('selected');\n            $attrValue.siblings('.selected-assistive-text').text(msgs.assistiveSelectedText);\n        } else {\n            $attrValue.removeClass('selected');\n            $attrValue.siblings('.selected-assistive-text').empty();\n        }\n\n        if (attrValue.url) {\n            $attrValue.attr('data-url', attrValue.url);\n            $attrValue.attr('value', attrValue.url);\n        } else {\n            $attrValue.removeAttr('data-url');\n            $attrValue.removeAttr('value');\n        }\n\n        // Disable if not selectable\n        $attrValue.removeClass('selectable unselectable');\n\n        $attrValue.addClass(attrValue.selectable ? 'selectable' : 'unselectable');\n    });\n}\n\n/**\n * Process attribute values associated with an attribute that does not have image swatches\n *\n * @param {Object} attr - Attribute\n * @param {string} attr.id - Attribute ID\n * @param {Object[]} attr.values - Array of attribute value objects\n * @param {string} attr.values.value - Attribute coded value\n * @param {string} attr.values.url - URL to de/select an attribute value of the product\n * @param {boolean} attr.values.isSelectable - Flag as to whether an attribute value can be\n *     selected.  If there is no variant that corresponds to a specific combination of attribute\n *     values, an attribute may be disabled in the Product Detail Page\n * @param {jQuery} $productContainer - DOM container for a given product\n */\nfunction processNonSwatchValues(attr, $productContainer) {\n    let $attr = '[data-attr=\"' + attr.id + '\"]';\n    let $defaultOption = $productContainer.find($attr + ' .select-' + attr.id + ' option:first');\n    let $selectedBisEnabledAttribute = null;\n\n    $defaultOption.attr('value', attr.resetUrl);\n\n    attr.values.forEach(function (attrValue) {\n        let $attrValue = $productContainer\n            .find($attr + ' [data-attr-value=\"' + attrValue.value + '\"]');\n        $attrValue.attr('value', attrValue.url)\n            .removeAttr('disabled');\n\n        if (!attrValue.selectable) {\n            $attrValue.attr('disabled', true);\n        }\n\n        // scope out selected attribute if back in stock icon is needed on quickview tab\n        if (attrValue.selected && !attrValue.available) {\n            $selectedBisEnabledAttribute = $attrValue;\n        }\n\n        // handle bis icon\n        $attrValue.closest('.circle-attribute').find('.attr-bis-icon').toggleClass('d-none', !(attrValue.selectable && !attrValue.available));\n    });\n\n    // handle bis icon on quickview tabs\n    let $attributesArea = $productContainer.find('.attributes-area div[data-attr=\"orc_size\"]');\n\n    if ($productContainer.hasClass('product-quickview') && $selectedBisEnabledAttribute && $selectedBisEnabledAttribute.length) {\n        $attributesArea.find('.attr-bis-icon').toggleClass('d-none', false);\n    } else {\n        $attributesArea.find('.attr-bis-icon').toggleClass('d-none', true);\n    }\n}\n\n/**\n * Routes the handling of attribute processing depending on whether the attribute has image\n *     swatches or not\n *\n * @param {Object} attrs - Attribute\n * @param {string} attr.id - Attribute ID\n * @param {jQuery} $productContainer - DOM element for a given product\n * @param {Object} msgs - object containing resource messages\n */\nfunction updateAttrs(attrs, $productContainer, msgs) {\n    // Currently, the only attribute type that has image swatches is Color.\n    var attrsWithSwatches = ['orc_color'];\n\n    attrs.forEach(function (attr) {\n        if (attrsWithSwatches.indexOf(attr.id) > -1) {\n            processSwatchValues(attr, $productContainer, msgs);\n        } else {\n            processNonSwatchValues(attr, $productContainer);\n        }\n    });\n}\n\n/**\n * Dynamically creates Bootstrap carousel from response containing images\n * @param {Object[]} imgs - Array of large product images,along with related information\n * @param {jQuery} $productContainer - DOM element for a given product\n */\nfunction createCarousel(imgs, $productContainer) {\n    var carousel = $productContainer.find('.carousel');\n    $(carousel).carousel('dispose');\n    var carouselId = $(carousel).attr('id');\n    $(carousel).empty().append('<ol class=\"carousel-indicators\"></ol><div class=\"carousel-inner\" role=\"listbox\"></div><a class=\"carousel-control-prev\" href=\"#' + carouselId + '\" role=\"button\" data-slide=\"prev\"><span class=\"fa icon-prev\" aria-hidden=\"true\"></span><span class=\"sr-only\">' + $(carousel).data('prev') + '</span></a><a class=\"carousel-control-next\" href=\"#' + carouselId + '\" role=\"button\" data-slide=\"next\"><span class=\"fa icon-next\" aria-hidden=\"true\"></span><span class=\"sr-only\">' + $(carousel).data('next') + '</span></a>');\n    for (var i = 0; i < imgs.length; i++) {\n        $('<div class=\"carousel-item\"><img src=\"' + imgs[i].url + '\" class=\"d-block img-fluid\" alt=\"' + imgs[i].alt + ' image number ' + parseInt(imgs[i].index, 10) + '\" title=\"' + imgs[i].title + '\" itemprop=\"image\" /></div>').appendTo($(carousel).find('.carousel-inner'));\n        $('<li data-target=\"#' + carouselId + '\" data-slide-to=\"' + i + '\" class=\"\"></li>').appendTo($(carousel).find('.carousel-indicators'));\n    }\n    $($(carousel).find('.carousel-item')).first().addClass('active');\n    $($(carousel).find('.carousel-indicators > li')).first().addClass('active');\n    if (imgs.length === 1) {\n        $($(carousel).find('.carousel-indicators, a[class^=\"carousel-control-\"]')).detach();\n    }\n    $(carousel).carousel();\n    $($(carousel).find('.carousel-indicators')).attr('aria-hidden', true);\n}\n\n/**\n * Updates the availability status in the Product Detail Page\n *\n * @param {Object} response - Ajax response object after an\n *                            attribute value has been [de]selected\n * @param {jQuery} $productContainer - DOM element for a given product\n */\nfunction updateAvailability(response, $productContainer) {\n    var availabilityValue = '';\n    var availabilityMessages = response.product.availability.messages;\n    if (!response.product.readyToOrder) {\n        availabilityValue = '<li><div>' + response.resources.info_selectforstock + '</div></li>';\n    } else {\n        availabilityMessages.forEach(function (message) {\n            availabilityValue += '<li><div>' + message + '</div></li>';\n        });\n    }\n\n    $($productContainer).trigger('product:updateAvailability', {\n        product: response.product,\n        $productContainer: $productContainer,\n        message: availabilityValue,\n        resources: response.resources\n    });\n}\n\n/**\n * Generates html for product attributes section\n *\n * @param {array} attributes - list of attributes\n * @return {string} - Compiled HTML\n */\nfunction getAttributesHtml(attributes) {\n    if (!attributes) {\n        return '';\n    }\n\n    var html = '';\n\n    attributes.forEach(function (attributeGroup) {\n        if (attributeGroup.ID === 'mainAttributes') {\n            attributeGroup.attributes.forEach(function (attribute) {\n                html += '<div class=\"attribute-values\">' + attribute.label + ': '\n                    + attribute.value + '</div>';\n            });\n        }\n    });\n\n    return html;\n}\n\n/**\n * Parses JSON from Ajax call made whenever an attribute value is [de]selected\n * @param {Object} response - response from Ajax call\n * @param {Object} response.product - Product object\n * @param {string} response.product.id - Product ID\n * @param {Object[]} response.product.variationAttributes - Product attributes\n * @param {Object[]} response.product.images - Product images\n * @param {boolean} response.product.hasRequiredAttrsSelected - Flag as to whether all required\n *     attributes have been selected.  Used partially to\n *     determine whether the Add to Cart button can be enabled\n * @param {jQuery} $productContainer - DOM element for a given product.\n */\nfunction handleVariantResponse(response, $productContainer) {\n    var isChoiceOfBonusProducts = $productContainer.parents('.choose-bonus-product-dialog').length > 0;\n    var isVaraint;\n    if (response.product.variationAttributes) {\n        updateAttrs(response.product.variationAttributes, $productContainer, response.resources);\n        isVaraint = response.product.productType === 'variant';\n        if (isChoiceOfBonusProducts && isVaraint) {\n            $productContainer.parent('.bonus-product-item')\n                .data('pid', response.product.id);\n\n            $productContainer.parent('.bonus-product-item')\n                .data('ready-to-order', response.product.readyToOrder);\n        }\n    }\n\n    // Update primary images\n    var primaryImageUrls = response.product.images.large;\n    createCarousel(primaryImageUrls, $productContainer);\n\n    // Update pricing\n    if (!isChoiceOfBonusProducts) {\n        var $priceSelector = $('.prices .price', $productContainer).length\n            ? $('.prices .price', $productContainer)\n            : $('.prices .price');\n        $priceSelector.replaceWith(response.product.price.html);\n        let price = response.product.price;\n        let hasStandardDiscount = price.standard && price.standard.sales && price.standard.sales.value;\n        let hasClubDiscount = price.club && price.club.sales && price.club.sales.value;\n        if (hasStandardDiscount || hasClubDiscount) {\n            $('.product-badge.discount-label').removeClass('d-none');\n        } else {\n            $('.product-badge.discount-label').addClass('d-none');\n        }\n    }\n\n    // Update promotions\n    $productContainer.find('.promotions').empty().html(response.product.promotionsHtml);\n\n    updateAvailability(response, $productContainer);\n\n    if (isChoiceOfBonusProducts) {\n        var $selectButton = $productContainer.find('.select-bonus-product');\n        $selectButton.trigger('bonusproduct:updateSelectButton', {\n            product: response.product, $productContainer: $productContainer\n        });\n    } else {\n        // Enable \"Add to Cart\" button if all required attributes have been selected\n        $('button.add-to-cart:visible, button.add-to-cart-global:visible, button.update-cart-product-global:visible, button.button-cart-mailmeback:visible').trigger('product:updateAddToCart', {\n            product: response.product, $productContainer: $productContainer\n        }).trigger('product:statusUpdate', response.product);\n    }\n\n    // Update attributes\n    $productContainer.find('.main-attributes').empty()\n        .html(getAttributesHtml(response.product.attributes));\n    // Update ref label\n    $productContainer.find('.reference').empty()\n        .html(response.product.refLabel);\n\n    // update e-reservation iframe with new product id\n    if ($('#eReservation').length) {\n        var $eReservationIframe = $('#eReservation iframe');\n        var urlIframe = $eReservationIframe.attr('src');\n        var newUrl = updateIFrameSourceUrl(urlIframe, 'productID', response.product.id);\n\n        // Set the new URL to the iframe\n        $eReservationIframe.attr('src', newUrl);\n    }\n}\n\n/**\n* Updates the value of a specified query parameter in a given URL and returns the updated URL as a string.\n*\n* @param {string} url - The original URL to be updated.\n* @param {string} paramID - The name of the query parameter to update.\n* @param {string} newValue - The new value to set for the specified query parameter.\n* @returns {string} The updated URL with the modified query parameter.\n*/\nfunction updateIFrameSourceUrl(url, paramID, newValue) {\n    var urlObj = new URL(url);\n    var params = new URLSearchParams(urlObj.search);\n\n    // Update the parameter\n    params.set(paramID, newValue);\n\n    // Construct the new URL\n    urlObj.search = params.toString();\n    return urlObj.toString();\n}\n\n/**\n * Updates DOM using post-option selection Ajax response\n *\n * @param {OptionSelectionResponse} optionsHtml - Ajax response optionsHtml from selecting a product option\n * @param {jQuery} $productContainer - DOM element for current product\n */\nfunction updateOptions(optionsHtml, $productContainer) {\n    // Update options\n    $productContainer.find('.product-options').empty().html(optionsHtml);\n}\n\n/**\n* Handles the selection of an attribute\n* @param {Object} currentTarget - the selected attribute element\n* @param {Object} $productContainer - the product container element\n*/\nfunction attributeSelect(currentTarget, $productContainer) {\n    const selectedValueUrl = currentTarget.value;\n    const className = currentTarget.className;\n\n    if (selectedValueUrl) {\n        $('body').trigger('product:beforeAttributeSelect',\n            { url: selectedValueUrl, container: $productContainer });\n\n        $.ajax({\n            url: selectedValueUrl,\n            method: 'GET',\n            success: function (data) {\n                handleVariantResponse(data, $productContainer);\n                updateOptions(data.product.optionsHtml, $productContainer);\n                updateQuantities(data.product.quantities, $productContainer);\n                $('body').trigger('product:afterAttributeSelect',\n                    { data: data, container: $productContainer });\n\n                if (className.indexOf('select-orc_color') > -1) {\n                    $('body').trigger('product:updateSelectableAttribute',\n                        { data: data, container: $('.attribute-values[data-attr=\"orc_size\"]') });\n                } if (className.indexOf('select-orc_size') > -1) {\n                    $('body').trigger('product:updateSelectableAttribute',\n                        { data: data, container: $('.attribute-values[data-attr=\"orc_color\"]') });\n                }\n\n                // Update stock in store if currentStoreId is available\n                if ($('#currentStoreId').length && typeof $('#currentStoreId').val() !== 'undefined') {\n                    stockInStoreHelper.getStockInStore($('#currentStoreId').val(), data.product.id);\n                }\n\n                $.spinner().stop();\n            },\n            error: function () {\n                $.spinner().stop();\n            }\n        });\n    }\n}\n\n/**\n * Toggles the overlay by adding or removing necessary classes from the elements.\n * @param {boolean} show - If true, it adds the classes; if false, it removes them.\n */\nfunction toggleOverlay(show) {\n    $('.added-to-cart-popup').toggleClass('show', show);\n    $('body').toggleClass('overlay-active', show);\n    $('.modal-background').toggleClass('active', show);\n}\n\n/**\n * Initializes the added to cart modal by toggling the overlay and setting up the close button click event.\n */\nfunction initAddedToCartModal() {\n    toggleOverlay(true);\n\n    $('.added-to-cart-popup__close').click(function () {\n        toggleOverlay(false);\n    });\n}\n\nmodule.exports = {\n    ...base,\n    initEvents: initEvents(),\n    addToCart: function () {\n        $(document).on('click', 'button.add-to-cart, button.add-to-cart-global', function () {\n            var addToCartUrl;\n            var pid;\n            var pidsObj;\n            var setPids;\n            $('body').trigger('product:beforeAddToCart', this);\n\n            if ($('.set-items').length && $(this).hasClass('add-to-cart-global')) {\n                setPids = [];\n                $('.product-detail').each(function () {\n                    if (!$(this).hasClass('product-set-detail')) {\n                        setPids.push({\n                            pid: $(this).find('.product-id').text(),\n                            qty: $(this).find('.quantity-select').val(),\n                            options: getOptions($(this))\n                        });\n                    }\n                });\n                pidsObj = JSON.stringify(setPids);\n            }\n\n            pid = getPidValue($(this));\n\n            var $productContainer = $(this).closest('.product-detail');\n            if (!$productContainer.length) {\n                $productContainer = $(this).closest('.quick-view-dialog').find('.product-detail');\n            }\n\n            addToCartUrl = getAddToCartUrl();\n\n            var productGtm = $('#quickViewModal').data('productGtm') || $('.product-detail').data('productGtm');\n\n            var form = {\n                pid: pid,\n                pidsObj: pidsObj,\n                childProducts: getChildProducts(),\n                quantity: getQuantitySelected($(this)) || 1,\n                productGtm: JSON.stringify(productGtm)\n            };\n\n            if (!$('.bundle-item').length) {\n                form.options = getOptions($productContainer);\n            }\n\n            $(this).trigger('updateAddToCartFormData', form);\n            if (addToCartUrl) {\n                $.ajax({\n                    url: addToCartUrl,\n                    method: 'POST',\n                    data: form,\n                    success: function (data) {\n                        if (data.is_error || data.error) {\n                            $('body').trigger('product:handle-error', data);\n                        } else {\n                            handlePostCartAdd(data);\n                            $('body').trigger('product:afterAddToCart', data);\n\n                            miniCartReportingUrl(data.reportingURL);\n                            initAddedToCartModal();\n\n                            const resultPli = data.cart.items.find(item => item.UUID === data.pliUUID);\n\n                            if (resultPli) {\n                                const { images, variationAttributes, productName } = resultPli;\n                                const smallImageUrl = images.small[0].url;\n                                const smallImageAlt = images.small[0].alt;\n\n                                $('.added-to-cart-popup__product-detail .js-product-image')\n                                    .attr({ src: smallImageUrl, alt: smallImageAlt });\n                                $('.added-to-cart-popup__product-detail .js-product-name').empty().append(productName);\n\n                                if (variationAttributes[0]) {\n                                    const colorText = `${variationAttributes[0].displayName} : ${variationAttributes[0].displayValue}`;\n                                    $('.added-to-cart-popup__product-detail .js-product-color').empty().append(colorText);\n                                }\n\n                                if (variationAttributes[1]) {\n                                    const sizeText = `${variationAttributes[1].displayName} : ${variationAttributes[1].displayValue}`;\n                                    $('.added-to-cart-popup__product-detail .js-product-size').empty().append(sizeText);\n                                }\n                            }\n                        }\n                        $.spinner().stop();\n                    },\n                    error: function () {\n                        $.spinner().stop();\n                    }\n                });\n            }\n        });\n    },\n\n    selectAttribute: function () {\n        $(document).on('change', 'select[class*=\"select-\"], .options-select', function (e) {\n            e.preventDefault();\n\n            var $productContainer = $(this).closest('.set-item');\n            if (!$productContainer.length) {\n                $productContainer = $(this).closest('.product-detail');\n            }\n            attributeSelect(e.currentTarget, $productContainer);\n        });\n    }\n};\n","'use strict';\n\nconst base = require('capencyBase/capency/email/capency.verify.email');\n\n/**\n *\n * @param {*} result\n * @param {*} callback\n */\nwindow.capency = {};\n\n/**\n * Checks the email property result by making an AJAX request and handles the response.\n * Provides autocomplete suggestions if applicable and manages validation feedback.\n *\n * @param {jQuery} $emailSelector - jQuery object representing the email input field.\n * @param force boolean telling if validation must be made even if the field has not been edited\n * @returns {Promise<boolean>} A promise that resolves to true if the email is valid or suggestions are provided,\n *                             and rejects with an error message if the email is invalid.\n * @description\n * This function sends a GET request to a specified URL to check the validity of an email address.\n * If the email is invalid, it displays an error message and focuses on the input field.\n * If suggestions are available, it initializes an autocomplete feature on the input field.\n * The function returns a promise that resolves if the email is valid or suggestions are provided,\n * and rejects if there is an error in the validation process.\n */\nfunction checkEmailPropertyResult($emailSelector, force = false) {\n    return new Promise((resolve, reject) => {\n        if (!$emailSelector.data('isModified') && !force) {\n            if ($emailSelector.data('isError')) {\n                $emailSelector.addClass('is-invalid');\n                $emailSelector.toggleClass('autocomplete-field-selected', false);\n                $emailSelector.focus();\n                reject(new Error($emailSelector.next('.invalid-feedback').html()));\n            } else {\n                resolve(true);\n            }\n            return;\n        }\n\n        var urlCapCheckEmailProp = $('#url-cap-email-check-email-prop').val();\n        var capData = {\n            sMail: $emailSelector.val()\n        };\n\n        $.ajax({\n            url: urlCapCheckEmailProp,\n            type: 'GET',\n            data: capData,\n            success: function (result) {\n                if (result.returnCode && result.returnCode > 0) {\n                    if (result.returnCode === 1) {\n                        $emailSelector.next('.invalid-feedback').empty().html(result.sMessage).show();\n                        $emailSelector.addClass('is-invalid');\n                        $emailSelector.toggleClass('autocomplete-field-selected', false);\n                        $emailSelector.focus();\n                        $emailSelector.data('isModified', false);\n                        $emailSelector.data('isError', true);\n                        reject(new Error(result.sMessage));\n                    } else if (result.mail) {\n                        if (result.returnCode === 2) {\n                            var finalDatasource = $.map(result.mail, function (item) {\n                                return {\n                                    label: item.sMail,\n                                    value: item.sMail\n                                };\n                            });\n\n                            $emailSelector.autocomplete({\n                                create: function () {\n                                    $(this).attr('autocomplete', 'off');\n                                },\n                                minLength: 0,\n                                autoFocus: true,\n                                source: function (request, response) {\n                                    response(finalDatasource);\n                                },\n                                select: function (event, ui) {\n                                    let $this = $(this);\n                                    $this.next().html(ui.item.sMail);\n                                    $this.toggleClass('autocomplete-field-selected', true);\n                                    $this.removeClass('is-invalid');\n                                    $this.data('isModified', true);\n                                    $(this).next('.invalid-feedback').empty();\n                                    resolve(true);\n                                },\n                                appendTo: '#' + $emailSelector.parents('form').attr('id')\n                            })\n\n                            $emailSelector.focus();\n                            $emailSelector.autocomplete('search', '');\n                            reject(false);\n                        }\n                    }\n                } else {\n                    $emailSelector.data('isModified', false);\n                    $emailSelector.data('isError', false);\n                    resolve(true);\n                }\n            },\n            error: function (error) {\n                reject(new Error('Error during email verification: ' + error));\n            }\n        });\n    });\n}\n\nbase.checkEmailPropertyResult = checkEmailPropertyResult;\n\nmodule.exports = base;\n","/**\n * \n * @param {*} result \n * @param {*} callback \n */\nwindow.capency = {}\n\n/**\n * @function showCapencyVerifyResult show poping verify address \n * @param {result} \n * @param {callback} \n*/\nfunction showCapencyVerifyEmailResult(result, currentEmail) {\n\n    if (result && result.returnCode === 1) {\n        if (result.sMessage) {\n            var $emailSelector = $('input[name$=\"_email\"]');\n            $emailSelector.next('.invalid-feedback').empty().html(result.sMessage).show();\n            $emailSelector.addClass(\"is-invalid\");\n            $emailSelector.attr('data-validate-email',false);\n           $.spinner().stop();\n        }\n        return false;\n    }\n\n    if (result && result.returnCode !== 0 && result.returnCode !== 1) {\n        var $containerModal = $(\".model-body-capmail\");\n        var $msgReturn = $containerModal.find(\".address-msg\");\n        var $emailError = $containerModal.find(\".address-error\");\n\n        if (result.sMessage) {\n            $msgReturn.empty().html(result.sMessage);\n            $emailError.empty().html(currentEmail);\n            $('#verifyEmail').modal('show');\n            $.spinner().stop();\n        }\n    }\n}\n\nmodule.exports = {\n    showCapencyVerifyEmailResult: showCapencyVerifyEmailResult\n}","'use strict';\n\nmodule.exports = function (include) {\n    if (typeof include === 'function') {\n        include();\n    } else if (typeof include === 'object') {\n        Object.keys(include).forEach(function (key) {\n            if (typeof include[key] === 'function') {\n                include[key]();\n            }\n        });\n    }\n};\n","'use strict';\nvar focusHelper = require('../components/focus');\n\n/**\n * Retrieves the relevant pid value\n * @param {jquery} $el - DOM container for a given add to cart button\n * @return {string} - value to be used when adding product to cart\n */\nfunction getPidValue($el) {\n    var pid;\n\n    if ($('#quickViewModal').hasClass('show') && !$('.product-set').length) {\n        pid = $($el).closest('.modal-content').find('.product-quickview').data('pid');\n    } else if ($('.product-set-detail').length || $('.product-set').length) {\n        pid = $($el).closest('.product-detail').find('.product-id').text();\n    } else {\n        pid = $('.product-detail:not(\".bundle-item\")').data('pid');\n    }\n\n    return pid;\n}\n\n/**\n * Retrieve contextual quantity selector\n * @param {jquery} $el - DOM container for the relevant quantity\n * @return {jquery} - quantity selector DOM container\n */\nfunction getQuantitySelector($el) {\n    var quantitySelected;\n    if ($el && $('.set-items').length) {\n        quantitySelected = $($el).closest('.product-detail').find('.quantity-select');\n    } else if ($el && $('.product-bundle').length) {\n        var quantitySelectedModal = $($el).closest('.modal-footer').find('.quantity-select');\n        var quantitySelectedPDP = $($el).closest('.bundle-footer').find('.quantity-select');\n        if (quantitySelectedModal.val() === undefined) {\n            quantitySelected = quantitySelectedPDP;\n        } else {\n            quantitySelected = quantitySelectedModal;\n        }\n    } else {\n        quantitySelected = $('.quantity-select');\n    }\n    return quantitySelected;\n}\n\n/**\n * Retrieves the value associated with the Quantity pull-down menu\n * @param {jquery} $el - DOM container for the relevant quantity\n * @return {string} - value found in the quantity input\n */\nfunction getQuantitySelected($el) {\n    return getQuantitySelector($el).val();\n}\n\n/**\n * Process the attribute values for an attribute that has image swatches\n *\n * @param {Object} attr - Attribute\n * @param {string} attr.id - Attribute ID\n * @param {Object[]} attr.values - Array of attribute value objects\n * @param {string} attr.values.value - Attribute coded value\n * @param {string} attr.values.url - URL to de/select an attribute value of the product\n * @param {boolean} attr.values.isSelectable - Flag as to whether an attribute value can be\n *     selected.  If there is no variant that corresponds to a specific combination of attribute\n *     values, an attribute may be disabled in the Product Detail Page\n * @param {jQuery} $productContainer - DOM container for a given product\n * @param {Object} msgs - object containing resource messages\n */\nfunction processSwatchValues(attr, $productContainer, msgs) {\n    attr.values.forEach(function (attrValue) {\n        var $attrValue = $productContainer.find('[data-attr=\"' + attr.id + '\"] [data-attr-value=\"' +\n            attrValue.value + '\"]');\n        var $swatchButton = $attrValue.parent();\n\n        if (attrValue.selected) {\n            $attrValue.addClass('selected');\n            $attrValue.siblings('.selected-assistive-text').text(msgs.assistiveSelectedText);\n        } else {\n            $attrValue.removeClass('selected');\n            $attrValue.siblings('.selected-assistive-text').empty();\n        }\n\n        if (attrValue.url) {\n            $swatchButton.attr('data-url', attrValue.url);\n        } else {\n            $swatchButton.removeAttr('data-url');\n        }\n\n        // Disable if not selectable\n        $attrValue.removeClass('selectable unselectable');\n\n        $attrValue.addClass(attrValue.selectable ? 'selectable' : 'unselectable');\n    });\n}\n\n/**\n * Process attribute values associated with an attribute that does not have image swatches\n *\n * @param {Object} attr - Attribute\n * @param {string} attr.id - Attribute ID\n * @param {Object[]} attr.values - Array of attribute value objects\n * @param {string} attr.values.value - Attribute coded value\n * @param {string} attr.values.url - URL to de/select an attribute value of the product\n * @param {boolean} attr.values.isSelectable - Flag as to whether an attribute value can be\n *     selected.  If there is no variant that corresponds to a specific combination of attribute\n *     values, an attribute may be disabled in the Product Detail Page\n * @param {jQuery} $productContainer - DOM container for a given product\n */\nfunction processNonSwatchValues(attr, $productContainer) {\n    var $attr = '[data-attr=\"' + attr.id + '\"]';\n    var $defaultOption = $productContainer.find($attr + ' .select-' + attr.id + ' option:first');\n    $defaultOption.attr('value', attr.resetUrl);\n\n    attr.values.forEach(function (attrValue) {\n        var $attrValue = $productContainer\n            .find($attr + ' [data-attr-value=\"' + attrValue.value + '\"]');\n        $attrValue.attr('value', attrValue.url)\n            .removeAttr('disabled');\n\n        if (!attrValue.selectable) {\n            $attrValue.attr('disabled', true);\n        }\n    });\n}\n\n/**\n * Routes the handling of attribute processing depending on whether the attribute has image\n *     swatches or not\n *\n * @param {Object} attrs - Attribute\n * @param {string} attr.id - Attribute ID\n * @param {jQuery} $productContainer - DOM element for a given product\n * @param {Object} msgs - object containing resource messages\n */\nfunction updateAttrs(attrs, $productContainer, msgs) {\n    // Currently, the only attribute type that has image swatches is Color.\n    var attrsWithSwatches = ['color'];\n\n    attrs.forEach(function (attr) {\n        if (attrsWithSwatches.indexOf(attr.id) > -1) {\n            processSwatchValues(attr, $productContainer, msgs);\n        } else {\n            processNonSwatchValues(attr, $productContainer);\n        }\n    });\n}\n\n/**\n * Updates the availability status in the Product Detail Page\n *\n * @param {Object} response - Ajax response object after an\n *                            attribute value has been [de]selected\n * @param {jQuery} $productContainer - DOM element for a given product\n */\nfunction updateAvailability(response, $productContainer) {\n    var availabilityValue = '';\n    var availabilityMessages = response.product.availability.messages;\n    if (!response.product.readyToOrder) {\n        availabilityValue = '<li><div>' + response.resources.info_selectforstock + '</div></li>';\n    } else {\n        availabilityMessages.forEach(function (message) {\n            availabilityValue += '<li><div>' + message + '</div></li>';\n        });\n    }\n\n    $($productContainer).trigger('product:updateAvailability', {\n        product: response.product,\n        $productContainer: $productContainer,\n        message: availabilityValue,\n        resources: response.resources\n    });\n}\n\n/**\n * Generates html for product attributes section\n *\n * @param {array} attributes - list of attributes\n * @return {string} - Compiled HTML\n */\nfunction getAttributesHtml(attributes) {\n    if (!attributes) {\n        return '';\n    }\n\n    var html = '';\n\n    attributes.forEach(function (attributeGroup) {\n        if (attributeGroup.ID === 'mainAttributes') {\n            attributeGroup.attributes.forEach(function (attribute) {\n                html += '<div class=\"attribute-values\">' + attribute.label + ': '\n                    + attribute.value + '</div>';\n            });\n        }\n    });\n\n    return html;\n}\n\n/**\n * @typedef UpdatedOptionValue\n * @type Object\n * @property {string} id - Option value ID for look up\n * @property {string} url - Updated option value selection URL\n */\n\n/**\n * @typedef OptionSelectionResponse\n * @type Object\n * @property {string} priceHtml - Updated price HTML code\n * @property {Object} options - Updated Options\n * @property {string} options.id - Option ID\n * @property {UpdatedOptionValue[]} options.values - Option values\n */\n\n/**\n * Updates DOM using post-option selection Ajax response\n *\n * @param {OptionSelectionResponse} optionsHtml - Ajax response optionsHtml from selecting a product option\n * @param {jQuery} $productContainer - DOM element for current product\n */\nfunction updateOptions(optionsHtml, $productContainer) {\n\t// Update options\n    $productContainer.find('.product-options').empty().html(optionsHtml);\n}\n\n/**\n * Dynamically creates Bootstrap carousel from response containing images\n * @param {Object[]} imgs - Array of large product images,along with related information\n * @param {jQuery} $productContainer - DOM element for a given product\n */\nfunction createCarousel(imgs, $productContainer) {\n    var carousel = $productContainer.find('.carousel');\n    $(carousel).carousel('dispose');\n    var carouselId = $(carousel).attr('id');\n    $(carousel).empty().append('<ol class=\"carousel-indicators\"></ol><div class=\"carousel-inner\" role=\"listbox\"></div><a class=\"carousel-control-prev\" href=\"#' + carouselId + '\" role=\"button\" data-slide=\"prev\"><span class=\"fa icon-prev\" aria-hidden=\"true\"></span><span class=\"sr-only\">' + $(carousel).data('prev') + '</span></a><a class=\"carousel-control-next\" href=\"#' + carouselId + '\" role=\"button\" data-slide=\"next\"><span class=\"fa icon-next\" aria-hidden=\"true\"></span><span class=\"sr-only\">' + $(carousel).data('next') + '</span></a>');\n    for (var i = 0; i < imgs.length; i++) {\n        $('<div class=\"carousel-item\"><img src=\"' + imgs[i].url + '\" class=\"d-block img-fluid\" alt=\"' + imgs[i].alt + ' image number ' + parseInt(imgs[i].index, 10) + '\" title=\"' + imgs[i].title + '\" itemprop=\"image\" /></div>').appendTo($(carousel).find('.carousel-inner'));\n        $('<li data-target=\"#' + carouselId + '\" data-slide-to=\"' + i + '\" class=\"\"></li>').appendTo($(carousel).find('.carousel-indicators'));\n    }\n    $($(carousel).find('.carousel-item')).first().addClass('active');\n    $($(carousel).find('.carousel-indicators > li')).first().addClass('active');\n    if (imgs.length === 1) {\n        $($(carousel).find('.carousel-indicators, a[class^=\"carousel-control-\"]')).detach();\n    }\n    $(carousel).carousel();\n    $($(carousel).find('.carousel-indicators')).attr('aria-hidden', true);\n}\n\n/**\n * Parses JSON from Ajax call made whenever an attribute value is [de]selected\n * @param {Object} response - response from Ajax call\n * @param {Object} response.product - Product object\n * @param {string} response.product.id - Product ID\n * @param {Object[]} response.product.variationAttributes - Product attributes\n * @param {Object[]} response.product.images - Product images\n * @param {boolean} response.product.hasRequiredAttrsSelected - Flag as to whether all required\n *     attributes have been selected.  Used partially to\n *     determine whether the Add to Cart button can be enabled\n * @param {jQuery} $productContainer - DOM element for a given product.\n */\nfunction handleVariantResponse(response, $productContainer) {\n    var isChoiceOfBonusProducts =\n        $productContainer.parents('.choose-bonus-product-dialog').length > 0;\n    var isVaraint;\n    if (response.product.variationAttributes) {\n        updateAttrs(response.product.variationAttributes, $productContainer, response.resources);\n        isVaraint = response.product.productType === 'variant';\n        if (isChoiceOfBonusProducts && isVaraint) {\n            $productContainer.parent('.bonus-product-item')\n                .data('pid', response.product.id);\n\n            $productContainer.parent('.bonus-product-item')\n                .data('ready-to-order', response.product.readyToOrder);\n        }\n    }\n\n    // Update primary images\n    var primaryImageUrls = response.product.images.large;\n    createCarousel(primaryImageUrls, $productContainer);\n\n    // Update pricing\n    if (!isChoiceOfBonusProducts) {\n        var $priceSelector = $('.prices .price', $productContainer).length\n            ? $('.prices .price', $productContainer)\n            : $('.prices .price');\n        $priceSelector.replaceWith(response.product.price.html);\n    }\n\n    // Update promotions\n    $productContainer.find('.promotions').empty().html(response.product.promotionsHtml);\n\n    updateAvailability(response, $productContainer);\n\n    if (isChoiceOfBonusProducts) {\n        var $selectButton = $productContainer.find('.select-bonus-product');\n        $selectButton.trigger('bonusproduct:updateSelectButton', {\n            product: response.product, $productContainer: $productContainer\n        });\n    } else {\n        // Enable \"Add to Cart\" button if all required attributes have been selected\n        $('button.add-to-cart, button.add-to-cart-global, button.update-cart-product-global').trigger('product:updateAddToCart', {\n            product: response.product, $productContainer: $productContainer\n        }).trigger('product:statusUpdate', response.product);\n    }\n\n    // Update attributes\n    $productContainer.find('.main-attributes').empty()\n        .html(getAttributesHtml(response.product.attributes));\n}\n\n/**\n * @typespec UpdatedQuantity\n * @type Object\n * @property {boolean} selected - Whether the quantity has been selected\n * @property {string} value - The number of products to purchase\n * @property {string} url - Compiled URL that specifies variation attributes, product ID, options,\n *     etc.\n */\n\n/**\n * Updates the quantity DOM elements post Ajax call\n * @param {UpdatedQuantity[]} quantities -\n * @param {jQuery} $productContainer - DOM container for a given product\n */\nfunction updateQuantities(quantities, $productContainer) {\n    if ($productContainer.parent('.bonus-product-item').length <= 0) {\n        var optionsHtml = quantities.map(function (quantity) {\n            var selected = quantity.selected ? ' selected ' : '';\n            return '<option value=\"' + quantity.value + '\"  data-url=\"' + quantity.url + '\"' +\n                selected + '>' + quantity.value + '</option>';\n        }).join('');\n        getQuantitySelector($productContainer).empty().html(optionsHtml);\n    }\n}\n\n/**\n * updates the product view when a product attribute is selected or deselected or when\n *         changing quantity\n * @param {string} selectedValueUrl - the Url for the selected variation value\n * @param {jQuery} $productContainer - DOM element for current product\n */\nfunction attributeSelect(selectedValueUrl, $productContainer) {\n    if (selectedValueUrl) {\n        $('body').trigger('product:beforeAttributeSelect',\n            { url: selectedValueUrl, container: $productContainer });\n\n        $.ajax({\n            url: selectedValueUrl,\n            method: 'GET',\n            success: function (data) {\n                handleVariantResponse(data, $productContainer);\n                updateOptions(data.product.optionsHtml, $productContainer);\n                updateQuantities(data.product.quantities, $productContainer);\n                $('body').trigger('product:afterAttributeSelect',\n                    { data: data, container: $productContainer });\n                $.spinner().stop();\n            },\n            error: function () {\n                $.spinner().stop();\n            }\n        });\n    }\n}\n\n/**\n * Retrieves url to use when adding a product to the cart\n *\n * @return {string} - The provided URL to use when adding a product to the cart\n */\nfunction getAddToCartUrl() {\n    return $('.add-to-cart-url').val();\n}\n\n/**\n * Parses the html for a modal window\n * @param {string} html - representing the body and footer of the modal window\n *\n * @return {Object} - Object with properties body and footer.\n */\nfunction parseHtml(html) {\n    var $html = $('<div>').append($.parseHTML(html));\n\n    var body = $html.find('.choice-of-bonus-product');\n    var footer = $html.find('.modal-footer').children();\n\n    return { body: body, footer: footer };\n}\n\n/**\n * Retrieves url to use when adding a product to the cart\n *\n * @param {Object} data - data object used to fill in dynamic portions of the html\n */\nfunction chooseBonusProducts(data) {\n    $('.modal-body').spinner().start();\n\n    if ($('#chooseBonusProductModal').length !== 0) {\n        $('#chooseBonusProductModal').remove();\n    }\n    var bonusUrl;\n    if (data.bonusChoiceRuleBased) {\n        bonusUrl = data.showProductsUrlRuleBased;\n    } else {\n        bonusUrl = data.showProductsUrlListBased;\n    }\n\n    var htmlString = '<!-- Modal -->'\n        + '<div class=\"modal fade\" id=\"chooseBonusProductModal\" tabindex=\"-1\" role=\"dialog\">'\n        + '<span class=\"enter-message sr-only\" ></span>'\n        + '<div class=\"modal-dialog choose-bonus-product-dialog\" '\n        + 'data-total-qty=\"' + data.maxBonusItems + '\"'\n        + 'data-UUID=\"' + data.uuid + '\"'\n        + 'data-pliUUID=\"' + data.pliUUID + '\"'\n        + 'data-addToCartUrl=\"' + data.addToCartUrl + '\"'\n        + 'data-pageStart=\"0\"'\n        + 'data-pageSize=\"' + data.pageSize + '\"'\n        + 'data-moreURL=\"' + data.showProductsUrlRuleBased + '\"'\n        + 'data-bonusChoiceRuleBased=\"' + data.bonusChoiceRuleBased + '\">'\n        + '<!-- Modal content-->'\n        + '<div class=\"modal-content\">'\n        + '<div class=\"modal-header\">'\n        + '    <span class=\"\">' + data.labels.selectprods + '</span>'\n        + '    <button type=\"button\" class=\"close pull-right\" data-dismiss=\"modal\">'\n        + '        <span aria-hidden=\"true\">&times;</span>'\n        + '        <span class=\"sr-only\"> </span>'\n        + '    </button>'\n        + '</div>'\n        + '<div class=\"modal-body\"></div>'\n        + '<div class=\"modal-footer\"></div>'\n        + '</div>'\n        + '</div>'\n        + '</div>';\n    $('body').append(htmlString);\n    $('.modal-body').spinner().start();\n\n    $.ajax({\n        url: bonusUrl,\n        method: 'GET',\n        dataType: 'json',\n        success: function (response) {\n            var parsedHtml = parseHtml(response.renderedTemplate);\n            $('#chooseBonusProductModal .modal-body').empty();\n            $('#chooseBonusProductModal .enter-message').text(response.enterDialogMessage);\n            $('#chooseBonusProductModal .modal-header .close .sr-only').text(response.closeButtonText);\n            $('#chooseBonusProductModal .modal-body').html(parsedHtml.body);\n            $('#chooseBonusProductModal .modal-footer').html(parsedHtml.footer);\n            $('#chooseBonusProductModal').modal('show');\n            $.spinner().stop();\n        },\n        error: function () {\n            $.spinner().stop();\n        }\n    });\n}\n\n/**\n * Updates the Mini-Cart quantity value after the customer has pressed the \"Add to Cart\" button\n * @param {string} response - ajax response from clicking the add to cart button\n */\nfunction handlePostCartAdd(response) {\n    $('.minicart').trigger('count:update', response);\n    var messageType = response.error ? 'alert-danger' : 'alert-success';\n    // show add to cart toast\n    if (response.newBonusDiscountLineItem\n        && Object.keys(response.newBonusDiscountLineItem).length !== 0) {\n        chooseBonusProducts(response.newBonusDiscountLineItem);\n    } else {\n        if ($('.add-to-cart-messages').length === 0) {\n            $('body').append(\n                '<div class=\"add-to-cart-messages\"></div>'\n            );\n        }\n\n        $('.add-to-cart-messages').append(\n            '<div class=\"alert ' + messageType + ' add-to-basket-alert text-center\" role=\"alert\">'\n            + response.message\n            + '</div>'\n        );\n\n        setTimeout(function () {\n            $('.add-to-basket-alert').remove();\n        }, 5000);\n    }\n}\n\n/**\n * Retrieves the bundle product item ID's for the Controller to replace bundle master product\n * items with their selected variants\n *\n * @return {string[]} - List of selected bundle product item ID's\n */\nfunction getChildProducts() {\n    var childProducts = [];\n    $('.bundle-item').each(function () {\n        childProducts.push({\n            pid: $(this).find('.product-id').text(),\n            quantity: parseInt($(this).find('label.quantity').data('quantity'), 10)\n        });\n    });\n\n    return childProducts.length ? JSON.stringify(childProducts) : [];\n}\n\n/**\n * Retrieve product options\n *\n * @param {jQuery} $productContainer - DOM element for current product\n * @return {string} - Product options and their selected values\n */\nfunction getOptions($productContainer) {\n    var options = $productContainer\n        .find('.product-option')\n        .map(function () {\n            var $elOption = $(this).find('.options-select');\n            var urlValue = $elOption.val();\n            var selectedValueId = $elOption.find('option[value=\"' + urlValue + '\"]')\n                .data('value-id');\n            return {\n                optionId: $(this).data('option-id'),\n                selectedValueId: selectedValueId\n            };\n        }).toArray();\n\n    return JSON.stringify(options);\n}\n\n/**\n * Makes a call to the server to report the event of adding an item to the cart\n *\n * @param {string | boolean} url - a string representing the end point to hit so that the event can be recorded, or false\n */\nfunction miniCartReportingUrl(url) {\n    if (url) {\n        $.ajax({\n            url: url,\n            method: 'GET',\n            success: function () {\n                // reporting urls hit on the server\n            },\n            error: function () {\n                // no reporting urls hit on the server\n            }\n        });\n    }\n}\n\nmodule.exports = {\n    attributeSelect: attributeSelect,\n    methods: {\n        editBonusProducts: function (data) {\n            chooseBonusProducts(data);\n        }\n    },\n\n    focusChooseBonusProductModal: function () {\n        $('body').on('shown.bs.modal', '#chooseBonusProductModal', function () {\n            $('#chooseBonusProductModal').siblings().attr('aria-hidden', 'true');\n            $('#chooseBonusProductModal .close').focus();\n        });\n    },\n\n    onClosingChooseBonusProductModal: function () {\n        $('body').on('hidden.bs.modal', '#chooseBonusProductModal', function () {\n            $('#chooseBonusProductModal').siblings().attr('aria-hidden', 'false');\n        });\n    },\n\n    trapChooseBonusProductModalFocus: function () {\n        $('body').on('keydown', '#chooseBonusProductModal', function (e) {\n            var focusParams = {\n                event: e,\n                containerSelector: '#chooseBonusProductModal',\n                firstElementSelector: '.close',\n                lastElementSelector: '.add-bonus-products'\n            };\n            focusHelper.setTabNextFocus(focusParams);\n        });\n    },\n\n    colorAttribute: function () {\n        $(document).on('click', '[data-attr=\"color\"] button', function (e) {\n            e.preventDefault();\n\n            if ($(this).attr('disabled')) {\n                return;\n            }\n            var $productContainer = $(this).closest('.set-item');\n            if (!$productContainer.length) {\n                $productContainer = $(this).closest('.product-detail');\n            }\n\n            attributeSelect($(this).attr('data-url'), $productContainer);\n        });\n    },\n\n    selectAttribute: function () {\n        $(document).on('change', 'select[class*=\"select-\"], .options-select', function (e) {\n            e.preventDefault();\n\n            var $productContainer = $(this).closest('.set-item');\n            if (!$productContainer.length) {\n                $productContainer = $(this).closest('.product-detail');\n            }\n            attributeSelect(e.currentTarget.value, $productContainer);\n        });\n    },\n\n    availability: function () {\n        $(document).on('change', '.quantity-select', function (e) {\n            e.preventDefault();\n\n            var $productContainer = $(this).closest('.product-detail');\n            if (!$productContainer.length) {\n                $productContainer = $(this).closest('.modal-content').find('.product-quickview');\n            }\n\n            if ($('.bundle-items', $productContainer).length === 0) {\n                attributeSelect($(e.currentTarget).find('option:selected').data('url'),\n                    $productContainer);\n            }\n        });\n    },\n\n    addToCart: function () {\n        $(document).on('click', 'button.add-to-cart, button.add-to-cart-global', function () {\n            var addToCartUrl;\n            var pid;\n            var pidsObj;\n            var setPids;\n\n            $('body').trigger('product:beforeAddToCart', this);\n\n            if ($('.set-items').length && $(this).hasClass('add-to-cart-global')) {\n                setPids = [];\n\n                $('.product-detail').each(function () {\n                    if (!$(this).hasClass('product-set-detail')) {\n                        setPids.push({\n                            pid: $(this).find('.product-id').text(),\n                            qty: $(this).find('.quantity-select').val(),\n                            options: getOptions($(this))\n                        });\n                    }\n                });\n                pidsObj = JSON.stringify(setPids);\n            }\n\n            pid = getPidValue($(this));\n\n            var $productContainer = $(this).closest('.product-detail');\n            if (!$productContainer.length) {\n                $productContainer = $(this).closest('.quick-view-dialog').find('.product-detail');\n            }\n\n            addToCartUrl = getAddToCartUrl();\n\n            var form = {\n                pid: pid,\n                pidsObj: pidsObj,\n                childProducts: getChildProducts(),\n                quantity: getQuantitySelected($(this))\n            };\n\n            if (!$('.bundle-item').length) {\n                form.options = getOptions($productContainer);\n            }\n\n            $(this).trigger('updateAddToCartFormData', form);\n            if (addToCartUrl) {\n                $.ajax({\n                    url: addToCartUrl,\n                    method: 'POST',\n                    data: form,\n                    success: function (data) {\n                        handlePostCartAdd(data);\n                        $('body').trigger('product:afterAddToCart', data);\n                        $.spinner().stop();\n                        miniCartReportingUrl(data.reportingURL);\n                    },\n                    error: function () {\n                        $.spinner().stop();\n                    }\n                });\n            }\n        });\n    },\n    selectBonusProduct: function () {\n        $(document).on('click', '.select-bonus-product', function () {\n            var $choiceOfBonusProduct = $(this).parents('.choice-of-bonus-product');\n            var pid = $(this).data('pid');\n            var maxPids = $('.choose-bonus-product-dialog').data('total-qty');\n            var submittedQty = parseInt($choiceOfBonusProduct.find('.bonus-quantity-select').val(), 10);\n            var totalQty = 0;\n            $.each($('#chooseBonusProductModal .selected-bonus-products .selected-pid'), function () {\n                totalQty += $(this).data('qty');\n            });\n            totalQty += submittedQty;\n            var optionID = $choiceOfBonusProduct.find('.product-option').data('option-id');\n            var valueId = $choiceOfBonusProduct.find('.options-select option:selected').data('valueId');\n            if (totalQty <= maxPids) {\n                var selectedBonusProductHtml = ''\n                + '<div class=\"selected-pid row\" '\n                + 'data-pid=\"' + pid + '\"'\n                + 'data-qty=\"' + submittedQty + '\"'\n                + 'data-optionID=\"' + (optionID || '') + '\"'\n                + 'data-option-selected-value=\"' + (valueId || '') + '\"'\n                + '>'\n                + '<div class=\"col-sm-11 col-9 bonus-product-name\" >'\n                + $choiceOfBonusProduct.find('.product-name').html()\n                + '</div>'\n                + '<div class=\"col-1\"><i class=\"fa fa-times\" aria-hidden=\"true\"></i></div>'\n                + '</div>'\n                ;\n                $('#chooseBonusProductModal .selected-bonus-products').append(selectedBonusProductHtml);\n                $('.pre-cart-products').html(totalQty);\n                $('.selected-bonus-products .bonus-summary').removeClass('alert-danger');\n            } else {\n                $('.selected-bonus-products .bonus-summary').addClass('alert-danger');\n            }\n        });\n    },\n    removeBonusProduct: function () {\n        $(document).on('click', '.selected-pid', function () {\n            $(this).remove();\n            var $selected = $('#chooseBonusProductModal .selected-bonus-products .selected-pid');\n            var count = 0;\n            if ($selected.length) {\n                $selected.each(function () {\n                    count += parseInt($(this).data('qty'), 10);\n                });\n            }\n\n            $('.pre-cart-products').html(count);\n            $('.selected-bonus-products .bonus-summary').removeClass('alert-danger');\n        });\n    },\n    enableBonusProductSelection: function () {\n        $('body').on('bonusproduct:updateSelectButton', function (e, response) {\n            $('button.select-bonus-product', response.$productContainer).attr('disabled',\n                (!response.product.readyToOrder || !response.product.available));\n            var pid = response.product.id;\n            $('button.select-bonus-product', response.$productContainer).data('pid', pid);\n        });\n    },\n    showMoreBonusProducts: function () {\n        $(document).on('click', '.show-more-bonus-products', function () {\n            var url = $(this).data('url');\n            $('.modal-content').spinner().start();\n            $.ajax({\n                url: url,\n                method: 'GET',\n                success: function (html) {\n                    var parsedHtml = parseHtml(html);\n                    $('.modal-body').append(parsedHtml.body);\n                    $('.show-more-bonus-products:first').remove();\n                    $('.modal-content').spinner().stop();\n                },\n                error: function () {\n                    $('.modal-content').spinner().stop();\n                }\n            });\n        });\n    },\n    addBonusProductsToCart: function () {\n        $(document).on('click', '.add-bonus-products', function () {\n            var $readyToOrderBonusProducts = $('.choose-bonus-product-dialog .selected-pid');\n            var queryString = '?pids=';\n            var url = $('.choose-bonus-product-dialog').data('addtocarturl');\n            var pidsObject = {\n                bonusProducts: []\n            };\n\n            $.each($readyToOrderBonusProducts, function () {\n                var qtyOption =\n                    parseInt($(this)\n                        .data('qty'), 10);\n\n                var option = null;\n                if (qtyOption > 0) {\n                    if ($(this).data('optionid') && $(this).data('option-selected-value')) {\n                        option = {};\n                        option.optionId = $(this).data('optionid');\n                        option.productId = $(this).data('pid');\n                        option.selectedValueId = $(this).data('option-selected-value');\n                    }\n                    pidsObject.bonusProducts.push({\n                        pid: $(this).data('pid'),\n                        qty: qtyOption,\n                        options: [option]\n                    });\n                    pidsObject.totalQty = parseInt($('.pre-cart-products').html(), 10);\n                }\n            });\n            queryString += JSON.stringify(pidsObject);\n            queryString = queryString + '&uuid=' + $('.choose-bonus-product-dialog').data('uuid');\n            queryString = queryString + '&pliuuid=' + $('.choose-bonus-product-dialog').data('pliuuid');\n            $.spinner().start();\n            $.ajax({\n                url: url + queryString,\n                method: 'POST',\n                success: function (data) {\n                    $.spinner().stop();\n                    if (data.error) {\n                        $('#chooseBonusProductModal').modal('hide');\n                        if ($('.add-to-cart-messages').length === 0) {\n                            $('body').append('<div class=\"add-to-cart-messages\"></div>');\n                        }\n                        $('.add-to-cart-messages').append(\n                            '<div class=\"alert alert-danger add-to-basket-alert text-center\"'\n                            + ' role=\"alert\">'\n                            + data.errorMessage + '</div>'\n                        );\n                        setTimeout(function () {\n                            $('.add-to-basket-alert').remove();\n                        }, 3000);\n                    } else {\n                        $('.configure-bonus-product-attributes').html(data);\n                        $('.bonus-products-step2').removeClass('hidden-xl-down');\n                        $('#chooseBonusProductModal').modal('hide');\n\n                        if ($('.add-to-cart-messages').length === 0) {\n                            $('body').append('<div class=\"add-to-cart-messages\"></div>');\n                        }\n                        $('.minicart-quantity').html(data.totalQty);\n                        $('.add-to-cart-messages').append(\n                            '<div class=\"alert alert-success add-to-basket-alert text-center\"'\n                            + ' role=\"alert\">'\n                            + data.msgSuccess + '</div>'\n                        );\n                        setTimeout(function () {\n                            $('.add-to-basket-alert').remove();\n                            if ($('.cart-page').length) {\n                                location.reload();\n                            }\n                        }, 1500);\n                    }\n                },\n                error: function () {\n                    $.spinner().stop();\n                }\n            });\n        });\n    },\n\n    getPidValue: getPidValue,\n    getQuantitySelected: getQuantitySelected,\n    miniCartReportingUrl: miniCartReportingUrl\n};\n","'use strict';\nvar urlCapAddressSearchEmail = $(\"#url-cap-email-search-email\").val();\n\n/**\n * @function SearchMailCivWS call AJAX for CAPAddress-SearchMailCivWS\n * @param {steep}\n * @param {zipCode}\n*/\n\nasync function SearchMailCivWS(email,fname,lname) {\n    var capEmailData = {\n        sInput: email,\n        sNom: fname,\n        sPrenom: lname\n    };\n\n    return new Promise((resolve, reject) => {\n        $.ajax({\n            url: urlCapAddressSearchEmail,\n            type: 'get',\n            data: capEmailData,\n            dataType: 'json',\n            success: function (data) {\n                resolve(data);\n            },\n            error: function (err) {\n                reject(err);\n            }\n        });\n    })\n}\n\nmodule.exports = {\n    SearchMailCivWS: SearchMailCivWS\n}","'use strict';\n\n/**\n * appends params to a url\n * @param {string} data - data returned from the server's ajax call\n * @param {Object} icon - icon that was clicked to add a product to the wishlist\n */\nfunction displayMessageAndChangeIcon(data, icon) {\n    $.spinner().stop();\n    if (data.success) {\n        if (icon.hasClass('fa-heart-icon')) {\n            icon.removeClass('fa-heart-icon').addClass('fa-heart-icon-on');\n        }\n    }\n\n    if ($('.wishlist-product-heart-messages').length === 0) {\n        $('body').append('<div class=\"wishlist-product-heart-messages\"></div>');\n    }\n\n    if ($('.wishlist-product-heart-alert').length === 0) {\n        $('.wishlist-product-heart-messages')\n            .append('<div class=\"wishlist-product-heart-alert text-center\">' + data.msg + '</div>');\n    }\n\n    setTimeout(function () {\n        $('.wishlist-product-heart-messages').remove();\n    }, 3000);\n}\n\n/**\n * Handles the removal of a product from the wishlist and changes the heart icon color back to normal.\n * @param {Object} data - The data returned from the server indicating the result of the removal operation.\n * @param {jQuery} icon - The jQuery object representing the heart icon element.\n * @returns {void}\n */\nfunction removeFromWishlist(data, icon) {\n    $.spinner().stop();\n    if (data.success) {\n        if (icon.hasClass('fa-heart-icon-on')) {\n            icon.removeClass('fa-heart-icon-on').addClass('fa-heart-icon');\n        }\n    }\n}\n\nmodule.exports = {\n    toggleWishlist: function () {\n        $('body').on('click', '.wishlistHeart', function (e) {\n            e.stopPropagation();\n            e.preventDefault();\n            var $this = $(this);\n            var routeType = 'post';\n            var icon = $this.find($('i'));\n            var url = $this.attr('href');\n            var removeFromWishlistUrl = $this.data('removewishlist');\n            var pid = $this.data('pid') || $this.closest('.product').data('pid') || $this.closest('.product-detail').data('pid');\n            var optionId = $this.closest('.product-detail').find('.product-option').attr('data-option-id');\n            var optionVal = $this.closest('.product-detail').find('.options-select option:selected').attr('data-value-id');\n            optionId = optionId || null;\n            optionVal = optionVal || null;\n\n            if (icon.hasClass('fa-heart-icon-on')) {\n                url = removeFromWishlistUrl;\n                routeType = 'get';\n            }\n\n            if (!url || !pid) {\n                return;\n            }\n\n            $.spinner().start();\n            $.ajax({\n                url: url,\n                type: routeType,\n                dataType: 'json',\n                data: {\n                    pid: pid,\n                    optionId: optionId,\n                    optionVal: optionVal\n                },\n                success: function (data) {\n                    if (data.notAddedToWishlist) {\n                        $('body').trigger('wishlist:addItem', data);\n                        displayMessageAndChangeIcon(data, icon);\n                    } else {\n                        removeFromWishlist(data, icon);\n                    }\n                },\n                error: function (err) {\n                    displayMessageAndChangeIcon(err, icon);\n                }\n            });\n        });\n    }\n};\n","'use strict';\n\nvar processInclude = require('./util');\n\n$(function () {\n    processInclude(require('./product/giftCardProduct'));\n    processInclude(require('./product/wishlistHeart'));\n    processInclude(require('./product/wishlist'));\n    processInclude(require('capencyBase/capency/email/capemail'));\n});\n","'use strict';\n\nconst base = require('base:product/detail');\nconst attributesLogic = require('attributes');\nconst capencyHelper = require('capency/capencyHelper');\nconst capencyVerifyEmail = require('capency/capency/email/capency.verify.email');\n\n/**\n* Parses HTML and returns the body element\n* @param {string} html - The HTML string to be parsed\n* @returns {Object} - An object containing the body element\n*/\nfunction parseHtml(html) {\n    var $html = $('<div>').append($.parseHTML(html));\n    var body = $html.find('.primary-images');\n    return { body: body };\n}\n\n/**\n* Fills the modal element with data from an AJAX call\n* @param {string} selectedValueUrl - URL of the AJAX call\n*/\nfunction fillModalElement(selectedValueUrl) {\n    $('.modal-body')\n        .spinner()\n        .start();\n    $.ajax({\n        url: selectedValueUrl,\n        method: 'GET',\n        dataType: 'json',\n        success: function (data) {\n            var parsedHtml = parseHtml(data.renderedTemplate);\n\n            $('.modal-body')\n                .empty()\n                .html(parsedHtml.body);\n            $('#detailImageModal').modal('show');\n            $('body').trigger('detailimage:ready');\n\n            $.spinner().stop();\n        },\n        error: function () {\n            $.spinner().stop();\n        }\n    });\n}\n\n/**\n* Initializes the product detail logic\n*/\nfunction initProductDetailLogic() {\n    $(function () {\n        $('.attributes .attribute.toggle').on('click', attributesLogic.toggleAttribute);\n        $('.attribute-values .circle-unselected').on('click', attributesLogic.selectAttributeValue);\n    });\n}\n\n/**\n* Validates a given name against a regex pattern\n* @param {string} value - the name to validate\n* @returns {boolean} - true if the name matches the regex pattern, false otherwise\n*/\nfunction valideName(value) {\n    var nameRegex = /^[a-zA-ZΑ-Ωα-ωίϊΐόάέύϋΰήώáàâäãåçéèêëíìîïñóòôöõúùûüýÿæœ'-\\s]{1,20}$/;\n    return value.match(nameRegex);\n}\n\n/**\n* Validates a text value\n* @param {string} value - the text value to validate\n* @returns {boolean} - true if the value is valid, false otherwise\n*/\nfunction valideText(value) {\n    var textRegex = /^[^<>$;]{0,2000}$/;\n    return value.match(textRegex);\n}\n\n/**\n* Validates a given field and adds an error class if it is invalid\n* @param {string} field - the field to be validated\n* @param {boolean} shouldDisplayErrors - whether to display errors on form or not\n* @returns {boolean} - whether the field is valid\n*/\nfunction validateField(field, shouldDisplayErrors) {\n    var isValid = true;\n    var $currentField = $(field);\n    var currentFieldType = $currentField.attr('type');\n    var currentFieldValue = $currentField.val();\n    // do not validate capency fields\n    if ($currentField.attr('data-validate-email') !== undefined) {\n        return true;\n    }\n\n    const isEmpty = $currentField.hasClass('required') && (currentFieldValue.length === 0 || (currentFieldType === 'checkbox' && !$currentField.is(':checked')));\n    const isTooHigh = $currentField.data('max') && parseFloat(currentFieldValue) > parseFloat($currentField.data('max'));\n    const isTooLow = $currentField.data('min') && parseFloat(currentFieldValue) < parseFloat($currentField.data('min'));\n    const isNotMatching = $currentField.data('confirm') && currentFieldValue !== $($currentField.data('confirm')).val();\n    const nameIsNotValid = currentFieldType == 'text' && ((currentFieldValue.length > 20) || (currentFieldValue.length < 1) || (!valideName(currentFieldValue)));\n    const textIsNotValid = $currentField.hasClass('textarea') && !valideText(currentFieldValue) && (currentFieldValue !== '');\n\n    if (isEmpty || isTooHigh || isTooLow || isNotMatching || nameIsNotValid || textIsNotValid) {\n        if (shouldDisplayErrors) {\n            $currentField.addClass('is-invalid');\n            if ($currentField.hasClass('textarea') && !valideText(currentFieldValue) && (currentFieldValue !== '')) {\n                $('#form-name-textarea-error').show();\n            } else {\n                $('#form-name-textarea-error').hide();\n            }\n            if (currentFieldType == 'text' && (currentFieldValue.length > 20)) {\n                $('#form-name-text-error').show();\n                $('#form-name-code-error, #form-name-required-error').hide();\n            } else if (currentFieldType == 'text' && (currentFieldValue.length < 1)) {\n                $('#form-name-required-error').show();\n                $('#form-name-code-error, #form-name-text-error').hide();\n            } else if (currentFieldType == 'text' && !valideName(currentFieldValue)) {\n                $('#form-name-code-error').show();\n                $('#form-name-text-error, #form-name-required-error').hide();\n            } else if (currentFieldType == 'number') {\n                $('#form-name-amount-error').show();\n            } else if (currentFieldType == 'email') {\n                $currentField.next('.invalid-feedback').text($currentField[0].validationMessage).show();\n            } else {\n                $('#form-name-code-error, #form-name-text-error, #form-name-required-error, .invalid-feedback').hide();\n            }\n        }\n\n        isValid = false;\n    } else {\n        $currentField.removeClass('is-invalid');\n    }\n    return isValid;\n}\n\n/**\n* Validates the formular and enables/disables the addGiftCardToCartBtn\n* @param {Object} form - the formular to be validated\n* @param {boolean} shouldDisplayErrors - the impact of the validation\n* @returns {boolean} - true if form is valid, false otherwise\n*/\nfunction validateFormular(form, shouldDisplayErrors) {\n    var isValid = true;\n    $.each($(form).find('.form-control, input[type=\"checkbox\"]'), (key, field) => {\n        if (!validateField(field, shouldDisplayErrors)) {\n            isValid = false;\n        }\n    });\n    if (isValid) {\n        $('#addGiftCardToCartBtn').prop('disabled', false);\n    } else {\n        $('#addGiftCardToCartBtn').prop('disabled', true);\n    }\n    return isValid;\n}\n\n/**\n* Clears the gift card form\n* @param {Object} form - the form to be cleared\n*/\nfunction clearGiftCardForm(form) {\n    $.each($(form).find('.form-control'), (key, field) => {\n        $(field).val('');\n    });\n    validateFormular(form);\n}\n/**\n* Hides the gift card form and clears its fields\n* @param {Object} $addProductToCard - jQuery object for the add product to card form\n*/\n$('body').on('giftcard:afterAddToCart', function () {\n    $('#giftcardform').modal('hide');\n    clearGiftCardForm($('#addProductToCard'));\n});\n\n/**\n* Event handler for add gift card form\n* @param {Event} event - the event object\n* @returns {void}\n*/\n$('body').on('submit', '#addProductToCard', function (event) {\n    event.preventDefault();\n\n    const $addGiftCardBtn = $(this);\n    validateFormular(this, true);\n    const giftCardAmount = $addGiftCardBtn.find('#giftCardAmount').val();\n    const recipientName = $addGiftCardBtn.find('#recipientName').val();\n    const $recipientEmail = $addGiftCardBtn.find('#recipientEmail');\n    const recipientEmail = $recipientEmail.val();\n    const recipientConfirmEmail = $addGiftCardBtn.find('#recipientConfirmEmail').val();\n    const message = $addGiftCardBtn.find('#message').val();\n    const pid = $addGiftCardBtn.find('#giftCardId').val();\n\n    const args = {\n        action: $addGiftCardBtn.attr('action'),\n        method: $addGiftCardBtn.attr('method'),\n        params: {\n            giftCardAmount: giftCardAmount,\n            recipientName: recipientName,\n            recipientEmail: recipientEmail,\n            recipientConfirmEmail: recipientConfirmEmail,\n            pid: pid,\n            message: message\n        }\n    };\n    if (capencyHelper.isCapencyEnabled('email')) {\n        capencyVerifyEmail.checkEmailPropertyResult($recipientEmail).then(function (result) {\n            if (result && validateFormular($('#addProductToCard'), true)) {\n                formSubmit.apply(null, [args]);\n            }\n        });\n    } else {\n        formSubmit.apply(null, [args]);\n    }\n});\n\n/**\n* Validates the formular and field\n* @param {Object} $('#addProductToCard') - the formular to be validated\n* @param {boolean} this - the field to be validated\n* @param {boolean} true - flag to indicate whether the field should be validated\n*/\n$('body').on('change', '.form-control,input[type=\"checkbox\"]', function () {\n    validateFormular($('#addProductToCard'));\n    validateField(this, true);\n});\n\n/**\n* Validates the formular for adding a product to a gift card\n* @param {Object} $('#addProductToCard') - jQuery selector for the formular\n*/\n$(document).ready(function () {\n    validateFormular($('#addProductToCard'));\n});\n\n/**\n* Submits a form using AJAX and triggers events based on the response\n* @param {Object} args - An object containing action, method, and params for the AJAX request\n* @param {string} args.action - The URL to send the AJAX request to\n* @param {string} args.method - The HTTP method for the AJAX request\n* @param {Object} args.params - The data to be sent with the AJAX request\n* @returns {void}\n*/\nfunction formSubmit(args) {\n    let { action, method, params } = args;\n    $('body').trigger('product:beforeAddToCart', this);\n    $.ajax({\n        url: action,\n        method: method,\n        dataType: 'json',\n        data: params,\n        success: function (data) {\n            let $form = $('#addProductToCard');\n            if (data.success) {\n                $('.minicart').trigger('count:update', data);\n                $('body').trigger('product:afterAddToCart', data);\n                $('body').trigger('giftcard:afterAddToCart');\n                $form.find('.invalid-feedback').hide();\n                $form.find('.is-invalid').removeClass('is-invalid');\n            } else if (data.sMessage) {\n                let $email = $('#recipientEmail', $form);\n                $email.next('.invalid-feedback').text(data.sMessage).show();\n            }\n            $.spinner().stop();\n        },\n        error: function (error) {\n            const jsonError = error.responseJSON || {};\n            if (jsonError.success === false && jsonError.maxLimitError) {\n                $('.gift-card-max-limit-reached-message').text(jsonError.maxLimitError);\n            }\n            $('#giftcardform').modal('hide');\n            $.spinner().stop();\n        }\n    });\n}\n\nmodule.exports = {\n    ...base,\n    ...{\n        initProductDetailLogic,\n        /**\n        * Handles the click event for the detail-image-modal class\n        * @param {Object} e - the event object\n        * @returns {void}\n        */\n        showProductDetailImageModal: function () {\n            $('body').on('click', '.detail-image-modal', function (e) {\n                e.preventDefault();\n                var selectedValueUrl = $(this)\n                    .closest('a.detail-image-modal')\n                    .attr('href');\n                $(e.target).trigger('detailimage:show');\n                fillModalElement(selectedValueUrl);\n            });\n        }\n    }\n};\n","'use strict';\n\n\n/**\n * appends params to a url\n * @param {string} data - data returned from the server's ajax call\n * @param {Object} button - button that was clicked to add a product to the wishlist\n */\nfunction displayMessage(data, button) {\n    $.spinner().stop();\n    var status;\n    if (data.success) {\n        status = 'alert-success';\n    } else {\n        status = 'alert-danger';\n    }\n\n    if ($('.add-to-wishlist-messages').length === 0) {\n        $('body').append(\n        '<div class=\"add-to-wishlist-messages \"></div>'\n        );\n    }\n    $('.add-to-wishlist-messages')\n        .append('<div class=\"add-to-wishlist-alert text-center ' + status + '\">' + data.msg + '</div>');\n\n    setTimeout(function () {\n        $('.add-to-wishlist-messages').remove();\n        button.removeAttr('disabled');\n    }, 5000);\n}\n\nmodule.exports = {\n    addToWishlist: function () {\n        $('.add-to-wish-list').on('click', function (e) {\n            e.preventDefault();\n            var url = $(this).data('href');\n            var button = $(this);\n            var pid = $(this).closest('.product-detail').find('.product-id').html();\n            var optionId = $(this).closest('.product-detail').find('.product-option').attr('data-option-id');\n            var optionVal = $(this).closest('.product-detail').find('.options-select option:selected').attr('data-value-id');\n            optionId = optionId || null;\n            optionVal = optionVal || null;\n            if (!url || !pid) {\n                return;\n            }\n\n            $.spinner().start();\n            $(this).attr('disabled', true);\n            $.ajax({\n                url: url,\n                type: 'post',\n                dataType: 'json',\n                data: {\n                    pid: pid,\n                    optionId: optionId,\n                    optionVal: optionVal\n                },\n                success: function (data) {\n                    displayMessage(data, button);\n                },\n                error: function (err) {\n                    displayMessage(err, button);\n                }\n            });\n        });\n    }\n};\n","'use strict';\nvar $iscapEmailEnable = $(\"#isEnableCapEmail\");\n\nif ($iscapEmailEnable.length > 0 && $iscapEmailEnable.val() === 'true' && $iscapEmailEnable.val() !== null) {\n    var formUtils = require('./formUtils');\n        formUtils.initCapEmailByForms();\n}\n","'use strict';\n\nvar capPEmailConfiguration = require('./function');\nvar keyTimer;\nvar keyTimer2;\nlet capencyFields = [];\n\n/**\n* Configures email validation and event handling for a specified form.\n*\n* This function retrieves the configuration for the specified form ID, determines if the form is editable,\n* and sets up event listeners for email fields to handle keydown and input events. It also manages the\n* validation state of the email fields and handles the behavior of update and save address buttons.\n*\n* @param {string} formID - The ID of the form to configure.\n* @returns {boolean} Always returns false.\n*/\nfunction setConfigToCapEmail(formID) {\n    // get config from de request Ajav for the currentForm\n    var isEditableForm = false;\n\n    var $formSelector = $(\"form[id='\" + formID + \"']\");\n\n    if ($formSelector.length === 0) {\n        $formSelector = $(\"form[name='\" + formID + \"']\");\n    }\n\n    if ($formSelector.is('[class*=\"edit\"]')) {\n        isEditableForm = true;\n    }\n\n    var config = capPEmailConfiguration.getConfig(formID, isEditableForm);\n    var listItem = [];\n\n    if (config) {\n        // events keyup keypress keydown for multiple NumberPhone for the form\n        if (config.hasOwnProperty('emailFieldsIDs')) {\n            listItem = config.emailFieldsIDs;\n\n            $.each(listItem, function (key, selectorEmail) {\n                let $field = config.formChild ? $formSelector.find('#' + selectorEmail) : $('#' + selectorEmail);\n                capencyFields.push($field);\n                $field.on('input', function (evt) {\n                    var value = evt.target.id;\n                    let $this = $(this);\n                    $this.next('.invalid-feedback').empty();\n                    if (value === selectorEmail) {\n                        clearTimeout(keyTimer);\n                        keyTimer = setTimeout(function () {\n                            // call ajax for get suggestions\n                            config.EmailID = selectorEmail;\n                            capPEmailConfiguration.callProcessEmailFlow(config);\n                        }, 300);\n                    }\n                }).on('input', function () {\n                    $(this).removeClass('autocomplete-field-selected');\n                });\n            });\n\n            $('#' + listItem[0]).attr('data-validate-email', false);\n\n            $('.btn-update-address').on('click', function (e) {\n                e.preventDefault();\n                $('#' + listItem[0]).attr('data-validate-email', false);\n                $('#verifyEmail').modal('hide');\n                $('#' + listItem[0]).focus();\n                $.spinner().stop();\n            });\n\n            $('.btn-save-address').on('click', function (e) {\n                e.preventDefault();\n                $('#' + listItem[0]).attr('data-validate-email', true);\n                $('#verifyEmail').modal('hide');\n                $.spinner().stop();\n            });\n        } else {\n            capencyFields.push($('#' + config.EmailID));\n            $('#' + config.EmailID).attr('data-validate-email', false);\n            // events keyup keypress keydown for EmailID\n            $('#' + config.EmailID).on('keydown', function () {\n                clearTimeout(keyTimer2);\n                let $this = $(this);\n                $this.next('.invalid-feedback').empty();\n                $(this).closest('.invalid-feedback').empty();\n                keyTimer = setTimeout(function () {\n                    // call ajax for get suggestions\n                    capPEmailConfiguration.callProcessEmailFlow(config);\n                }, 0);\n            }).on('input', function () {\n                $(this).removeClass('autocomplete-field-selected');\n            });\n\n            $('.btn-update-address').on('click', function (e) {\n                e.preventDefault();\n                $('#' + config.EmailID).attr('data-validate-email', false);\n                $('#' + config.EmailID).focus();\n                $('#verifyEmail').modal('hide');\n                $.spinner().stop();\n            });\n\n            $('.btn-save-address').on('click', function (e) {\n                e.preventDefault();\n                $('#' + config.EmailID).attr('data-validate-email', true);\n                $('input[name$=\"contactInfoFields_email\"]').attr('data-validate-email', true);\n                $('input[name$=\"coCustomer_email\"]').attr('data-validate-email', true);\n                $('#verifyEmail').modal('hide');\n                $.spinner().stop();\n            });\n        }\n        initChangeHandlerOnEmailFields();\n\n        return false;\n    }\n}\n\n/**\n* Disables browser autocomplete for all text input fields within a specified form.\n*\n* This function searches for a form by its ID or name and sets the `autocomplete` attribute \n* of all text input fields within the form to \"off\", effectively disabling the browser's \n* autocomplete feature for those fields.\n*\n* @param {string} formID - The ID or name of the form for which to disable autocomplete.\n*/\nfunction deleteAutoCompleteBrowser(formID) {\n    var $formSelector = $(\"form[id='\" + formID + \"']\");\n\n    if ($formSelector.length === 0) {\n        $formSelector = $(\"form[name='\" + formID + \"']\");\n    }\n\n    $formSelector.find('input[type=text]').each(function () {\n        $(this).attr('autocomplete', 'off');\n    });\n}\n\nfunction initChangeHandlerOnEmailFields() {\n    capencyFields.forEach(function (field) {\n        field.on('focus', function () {\n            $(this).data('oldValue', $(this).val());\n        });\n        field.on('change', function () {\n            if ($(this).val() !== $(this).data('oldValue')) {\n                $(this).data('isModified', true);\n            }\n        });\n    });\n}\n\nmodule.exports = {\n    initCapEmailByForms: (formIdListToInit = []) => {\n        var listFormWithCapAddress = capPEmailConfiguration.getIdForms();\n        $('form').each(function () {\n            var formID = (String($(this).attr('id')) === 'undefined' || typeof String($(this).attr('id')) === 'undefined') ? $(this).attr('name') : String($(this).attr('id'));\n            if (formID && listFormWithCapAddress.includes(formID) && (formIdListToInit.length === 0 || formIdListToInit.includes(formID))) {\n                setConfigToCapEmail(formID);\n                deleteAutoCompleteBrowser(formID);\n            }\n        });\n    }\n};\n","'use strict';\n\nconst callWebService = require('*/capency/email/serverActions/callWebService');\nvar capAddressConfig = [];\nvar urlCapEmailConfig = $('#url-cap-email-config').val();\nconst base = require('capencyBase/capency/email/function');\n\n/// Call Ajax for get All configuration\n$.ajax({\n    url: urlCapEmailConfig,\n    type: 'get',\n    async: false,\n    dataType: 'json',\n    success: function (data) {\n        var capConfiguration = data.result;\n        capAddressConfig = capConfiguration.length > 0 ? JSON.parse(capConfiguration) : [];\n    },\n    error: function (err) { }\n});\n\n\n/**\n* Handles the email data source for a given form configuration, including validation and autocomplete setup.\n*\n* @param {Object} configCurrentForm - Configuration object for the current form.\n* @param {string} configCurrentForm.idForm - The ID of the form element.\n* @param {boolean} configCurrentForm.formChild - Flag indicating if the email selector is a child of the form.\n* @param {string} configCurrentForm.EmailID - The ID of the email input element.\n* @param {string} configCurrentForm.firstName - The ID of the first name input element.\n* @param {string} configCurrentForm.lastName - The ID of the last name input element.\n*/\nfunction dataSourceEmail(configCurrentForm) {\n    var $formID = $('#' + configCurrentForm.idForm);\n    let $emailSelector = configCurrentForm.formChild ? $formID.find('#' + configCurrentForm.EmailID) : $('#' + configCurrentForm.EmailID);\n    var $firstNameSelector = $('#' + configCurrentForm.firstName);\n    var $lastNameSelector = $('#' + configCurrentForm.lastName);\n\n    var email = $emailSelector.val();\n    var fname = $firstNameSelector.val();\n    var lname = $lastNameSelector.val();\n\n    callWebService.SearchMailCivWS(email, fname, lname).then(function (searchResulat) {\n        if (searchResulat.returnCode && searchResulat.returnCode === 1) {\n            $emailSelector.next('.invalid-feedback').empty().html(searchResulat.sMessage).show();\n            $emailSelector.addClass('is-invalid');\n            $formID.find(':submit').prop('disabled', true);\n            if ($('.ui-autocomplete').length) {\n                $emailSelector.autocomplete('destroy');\n            }\n        } else {\n            $emailSelector.removeClass('is-invalid');\n            $formID.find(':submit').prop('disabled', false);\n            var finalDatasource = $.map(searchResulat.mail, function (item) {\n                return {\n                    label: item.sMail,\n                    value: item.sMail\n                };\n            });\n\n            if (finalDatasource.length > 0) {\n                    $emailSelector.autocomplete({\n                        create: function () {\n                            $(this).attr('autocomplete', 'off');\n                        },\n                        minLength: 0,\n                        autoFocus: true,\n                        source: function (request, response) {\n                            response(finalDatasource);\n                        },\n                        select: function (event, ui) {\n                            let $this = $(this);\n                            $this.next().html(ui.item.sMail);\n                            $this.toggleClass('autocomplete-field-selected', true);\n                            $this.next('.invalid-feedback').empty();\n                            $this.data('isModified', true);\n                        },\n                        appendTo: '#' + configCurrentForm.idForm\n                    }).focus(function () {\n                        return false;\n                    });\n                $emailSelector.autocomplete('search', '');\n            } else if ($emailSelector.autocomplete('instance')) {\n                $emailSelector.autocomplete('destroy');\n            }\n        }\n    });\n}\n\n/**\n* Initiates the email processing flow based on the provided form configuration.\n* If the form configuration contains an 'EmailID' property, it triggers the dataSourceEmail function.\n*\n* @param {Object} currentFormConfig - The current form configuration object.\n* @property {string} currentFormConfig.EmailID - The email ID to be processed.\n*/\nfunction callProcessEmailFlow(currentFormConfig) {\n    if (currentFormConfig.hasOwnProperty('EmailID')) {\n        dataSourceEmail(currentFormConfig);\n    }\n}\n\nbase.callProcessEmailFlow = callProcessEmailFlow;\nmodule.exports = base;\n","'use strict';\n\nconst callWebService = require('./serverActions/callWebService');\nvar capAddressConfig = [];\nvar urlCapEmailConfig = $(\"#url-cap-email-config\").val();\n\n/// Call Ajax for get All configuration \n\n$.ajax({\n    url: urlCapEmailConfig,\n    type: 'get',\n    async: false,\n    dataType: 'json',\n    success: function (data) {\n        var capConfiguration = data.result;\n        capAddressConfig = capConfiguration.length > 0 ? JSON.parse(capConfiguration) : [];\n    },\n    error: function (err) { }\n});\n\n/**\n * @function getConfig return all the form id\n * @param {idForm}\n*/\n\nfunction getConfig(idForm, editableT) {\n    if (capAddressConfig.length > 0) {\n        var form = {};\n        var currentForms = capAddressConfig.filter(form => form.idForm === idForm);\n        var formEdit = capAddressConfig.find(form => form.idForm === idForm);\n\n        if (currentForms.length === 2) {\n            form = currentForms.find(form => form.idForm === idForm && form.hasOwnProperty(\"editable\") && form.editable === editableT);\n            return form;\n        }\n        return formEdit;\n    }\n}\n\n/**\n * @function getIdForms return all the form id\n*/\nfunction getIdForms() {\n    var ids = [];\n    capAddressConfig.forEach(obj => {\n        ids.push(obj.idForm);\n    });\n    return ids;\n}\n\n/**\n * @function dataSourceEmail Resulat ajax for get suggestions\n * @param {configCurrentForm}\n*/\n\nfunction dataSourceEmail(configCurrentForm) {\n\n    var $emailSelector = $(\"#\" + configCurrentForm.EmailID);\n    var $formID = $(\"#\" + configCurrentForm.idForm);\n    var $firstNameSelector = $(\"#\" + configCurrentForm.firstName);\n    var $lastNameSelector = $(\"#\" + configCurrentForm.lastName);\n\n    var email = $emailSelector.val();\n    var fname = $firstNameSelector.val();\n    var lname = $lastNameSelector.val();\n\n    var searchResulat = callWebService.SearchMailCivWS(email, fname, lname);\n\n    if (searchResulat.returnCode && searchResulat.returnCode === 1) {\n        $emailSelector.next('.invalid-feedback').empty().html(searchResulat.sMessage).show();\n        $emailSelector.addClass(\"is-invalid\");\n        $formID.find(\":submit\").prop('disabled', true);\n\n    } else {\n        $emailSelector.next('.invalid-feedback').hide();\n        $emailSelector.removeClass(\"is-invalid\");\n        $formID.find(\":submit\").prop('disabled', false);\n        var finalDatasource = null;\n        var finalDatasource = $.map(searchResulat.mail, function (item) {\n            return {\n                label: item.sMail,\n                value: item.sMail,\n            }\n        });\n        $emailSelector.autocomplete({\n            create: function (event, ui) {\n                $(this).attr('autocomplete', 'nope');\n            },\n            minLength: 0,\n            autoFocus: true,\n            source: function (request, response) {\n                var items = [];\n\n                $.each(finalDatasource, function (key, val) {\n                    items.push(val);\n                });\n\n                response(items);\n\n            },\n            select: function (event, ui) {\n                $(this).next().html(ui.item.sMail);\n            }\n\n        }).focus(function (e) {\n            return false;\n        });\n\n    }\n}\n\n\n/**\n * @function callProcessAddressFlow Enable UI-autocomplete form zipID\n * @param {configCurrentForm}\n*/\n\nfunction callProcessEmailFlow(currentFormConfig, value) {\n    if (currentFormConfig.hasOwnProperty(\"EmailID\")) {\n        dataSourceEmail(currentFormConfig);\n    }\n}\n\nmodule.exports = {\n    getConfig: getConfig,\n    getIdForms: getIdForms,\n    callProcessEmailFlow: callProcessEmailFlow\n}","'use strict';\n\n/**\n* Checks if Capency is enabled for a specific type\n* @param {string} type - the type for which Capency is being checked (e.g. 'email')\n* @returns {boolean} - true if Capency is enabled, false otherwise\n*/\nfunction isCapencyEnabled(type) {\n    let enabled = false;\n    switch (type) {\n        case 'email': {\n            var $iscapEmailEnable = $('#isEnableCapEmail');\n            if ($iscapEmailEnable.length > 0 && $iscapEmailEnable.val() === 'true' && $iscapEmailEnable.val() !== null) {\n                enabled = true;\n            }\n            break;\n        }\n        case 'phone': {\n            let $iscapPhoneEnable = $('#isEnableCapPhone');\n            if ($iscapPhoneEnable.length > 0 && $iscapPhoneEnable.val() === 'true' && $iscapPhoneEnable.val() !== null) {\n                enabled = true;\n            }\n            break;\n        }\n        case 'address': {\n            let $iscapAddressEnable = $('#isEnableCapAddress');\n            if ($iscapAddressEnable.length > 0 && $iscapAddressEnable.val() === 'true' && $iscapAddressEnable.val() !== null) {\n                enabled = true;\n            }\n            break;\n        }\n        default:\n            break;\n    }\n    return enabled;\n}\n\n/**\n* Sets the validation state of a field and updates its visual representation\n* @param {jQuery} $selector - the jQuery selector for the field element\n* @param {boolean} state - the validation state (true for valid, false for invalid)\n* @returns {void}\n*/\nfunction setFieldValid($selector, state) {\n    if (state !== true) {\n        $selector.addClass('is-invalid');\n        $selector.removeClass('is-valid');\n        $selector.data('validated', false);\n    } else {\n        $selector.next('.invalid-feedback').hide();\n        $selector.removeClass('is-invalid');\n        $selector.addClass('is-valid');\n        $selector.data('validated', true);\n    }\n}\n\n/**\n* Removes field validation results\n* @param {jQuery} $selector - the jQuery selector for the field\n*/\nfunction removeFieldValidationResults($selector) {\n    $selector.next('.invalid-feedback').hide();\n    $selector.removeClass('is-invalid');\n    $selector.removeClass('is-valid');\n    $selector.data('validated', false);\n}\n\n/**\n* Sets the required error message for the given selector\n* @param {jQuery} $selector - The jQuery selector for the input field\n* @returns {void}\n*/\nfunction setRequiredError($selector) {\n    if ($selector && $selector.val().length === 0) {\n        setFieldValid($selector, false);\n        let errorMessage = $selector.data('messageRequired');\n        if (errorMessage) {\n            $selector.next('.invalid-feedback').text(errorMessage).show();\n        }\n    }\n}\n\n/**\n* Validates the phone number input field.\n* Checks if the phone number has been validated and if it is not empty.\n* If the phone number is not validated or is empty, sets an error message and focuses the input field.\n*\n* @returns {boolean} - Returns true if the phone number is validated, otherwise false.\n*/\nfunction validatePhone() {\n    let $phoneSelector = $('.registration [name=\"dwfrm_profile_customer_phone\"]');\n    if ($phoneSelector.data('validated') !== true) {\n        if ($phoneSelector.val().length === 0) {\n            setRequiredError($phoneSelector);\n        }\n        $phoneSelector.focus();\n        return false;\n    }\n    return true;\n}\n\nfunction fillZipCodeWithAllCapData($zipSelector, data) {\n    if ($zipSelector.length > 0) {\n        $zipSelector.attr('data-address', JSON.stringify(data));\n    }\n}\n\nfunction resetModifiedFlagOnAddressFields() {\n    const fields = [\n        $('input[name$=\"_address1\"]'),\n        $('input[name$=\"_address2\"]'),\n        $('input[name$=\"_city\"]'),\n        $('input[name$=\"_postal\"]'),\n    ];\n\n    resetModifiedFlagOnFields(fields);\n}\n\nfunction resetModifiedFlagOnEmailFields() {\n    const fields = [\n        $('input[name$=\"_email\"]'),\n    ];\n\n    resetModifiedFlagOnFields(fields);\n}\n\nfunction resetModifiedFlagOnFields(fields) {\n    fields.forEach(function (field) {\n        field.data('isModified', false)\n    });\n}\n\nfunction isAddressFormModified() {\n    const fields = [\n        $('input[name$=\"_address1\"]'),\n        $('input[name$=\"_address2\"]'),\n        $('input[name$=\"_city\"]'),\n        $('input[name$=\"_postal\"]'),\n    ];\n    return checkFieldsModified(fields);\n}\n\nfunction isEmailFormModified() {\n    const fields = [\n        $('input[name$=\"_email\"]'),\n    ];\n    return checkFieldsModified(fields);\n}\n\nfunction checkFieldsModified(fields) {\n    return fields.some(function (field) {\n        return field.data('isModified')\n    });\n}\n\nmodule.exports = {\n    isCapencyEnabled: isCapencyEnabled,\n    setFieldValid: setFieldValid,\n    removeFieldValidationResults: removeFieldValidationResults,\n    setRequiredError: setRequiredError,\n    validatePhone: validatePhone,\n    fillZipCodeWithAllCapData: fillZipCodeWithAllCapData,\n    isAddressFormModified: isAddressFormModified,\n    isEmailFormModified: isEmailFormModified,\n    resetModifiedFlagOnAddressFields: resetModifiedFlagOnAddressFields,\n    resetModifiedFlagOnEmailFields: resetModifiedFlagOnEmailFields\n};\n","'use strict';\n\nmodule.exports = {\n    setTabNextFocus: function (focusParams) {\n        var KEYCODE_TAB = 9;\n        var isTabPressed = (focusParams.event.key === 'Tab' || focusParams.event.keyCode === KEYCODE_TAB);\n\n        if (!isTabPressed) {\n            return;\n        }\n\n        var firstFocusableEl = $(focusParams.containerSelector + ' ' + focusParams.firstElementSelector);\n        var lastFocusableEl = $(focusParams.containerSelector + ' ' + focusParams.lastElementSelector);\n\n        if ($(focusParams.containerSelector + ' ' + focusParams.lastElementSelector).is(':disabled')) {\n            lastFocusableEl = $(focusParams.containerSelector + ' ' + focusParams.nextToLastElementSelector);\n            if ($('.product-quickview.product-set').length > 0) {\n                var linkElements = $(focusParams.containerSelector + ' a#fa-link.share-icons');\n                lastFocusableEl = linkElements[linkElements.length - 1];\n            }\n        }\n\n        if (focusParams.event.shiftKey) /* shift + tab */ {\n            if ($(':focus').is(firstFocusableEl)) {\n                lastFocusableEl.focus();\n                focusParams.event.preventDefault();\n            }\n        } else /* tab */ {\n            if ($(':focus').is(lastFocusableEl)) { // eslint-disable-line\n                firstFocusableEl.focus();\n                focusParams.event.preventDefault();\n            }\n        }\n    }\n};\n","'use strict';\nvar base = require('./base');\n\n/**\n * Enable/disable UI elements\n * @param {boolean} enableOrDisable - true or false\n */\nfunction updateAddToCartEnableDisableOtherElements(enableOrDisable) {\n    $('button.add-to-cart-global').attr('disabled', enableOrDisable);\n}\n\nmodule.exports = {\n    methods: {\n        updateAddToCartEnableDisableOtherElements: updateAddToCartEnableDisableOtherElements\n    },\n\n    availability: base.availability,\n\n    addToCart: base.addToCart,\n\n    updateAttributesAndDetails: function () {\n        $('body').on('product:statusUpdate', function (e, data) {\n            var $productContainer = $('.product-detail[data-pid=\"' + data.id + '\"]');\n\n            $productContainer.find('.description-and-detail .product-attributes')\n                .empty()\n                .html(data.attributesHtml);\n\n            if (data.shortDescription) {\n                $productContainer.find('.description-and-detail .description')\n                    .removeClass('hidden-xl-down');\n                $productContainer.find('.description-and-detail .description .content')\n                    .empty()\n                    .html(data.shortDescription);\n            } else {\n                $productContainer.find('.description-and-detail .description')\n                    .addClass('hidden-xl-down');\n            }\n\n            if (data.longDescription) {\n                $productContainer.find('.description-and-detail .details')\n                    .removeClass('hidden-xl-down');\n                $productContainer.find('.description-and-detail .details .content')\n                    .empty()\n                    .html(data.longDescription);\n            } else {\n                $productContainer.find('.description-and-detail .details')\n                    .addClass('hidden-xl-down');\n            }\n        });\n    },\n\n    showSpinner: function () {\n        $('body').on('product:beforeAddToCart product:beforeAttributeSelect', function () {\n            $.spinner().start();\n        });\n    },\n    updateAttribute: function () {\n        $('body').on('product:afterAttributeSelect', function (e, response) {\n            if ($('.product-detail>.bundle-items').length) {\n                response.container.data('pid', response.data.product.id);\n                response.container.find('.product-id').text(response.data.product.id);\n            } else if ($('.product-set-detail').eq(0)) {\n                response.container.data('pid', response.data.product.id);\n                response.container.find('.product-id').text(response.data.product.id);\n            } else {\n                $('.product-id').text(response.data.product.id);\n                $('.product-detail:not(\".bundle-item\")').data('pid', response.data.product.id);\n            }\n        });\n    },\n    updateAddToCart: function () {\n        $('body').on('product:updateAddToCart', function (e, response) {\n            // update local add to cart (for sets)\n            $('button.add-to-cart', response.$productContainer).attr('disabled',\n                (!response.product.readyToOrder || !response.product.available));\n\n            var enable = $('.product-availability').toArray().every(function (item) {\n                return $(item).data('available') && $(item).data('ready-to-order');\n            });\n            module.exports.methods.updateAddToCartEnableDisableOtherElements(!enable);\n        });\n    },\n    updateAvailability: function () {\n        $('body').on('product:updateAvailability', function (e, response) {\n            $('div.availability', response.$productContainer)\n                .data('ready-to-order', response.product.readyToOrder)\n                .data('available', response.product.available);\n\n            $('.availability-msg', response.$productContainer)\n                .empty().html(response.message);\n\n            if ($('.global-availability').length) {\n                var allAvailable = $('.product-availability').toArray()\n                    .every(function (item) { return $(item).data('available'); });\n\n                var allReady = $('.product-availability').toArray()\n                    .every(function (item) { return $(item).data('ready-to-order'); });\n\n                $('.global-availability')\n                    .data('ready-to-order', allReady)\n                    .data('available', allAvailable);\n\n                $('.global-availability .availability-msg').empty()\n                    .html(allReady ? response.message : response.resources.info_selectforstock);\n            }\n        });\n    },\n    sizeChart: function () {\n        $('.size-chart a').on('click', function (e) {\n            e.preventDefault();\n            var url = $(this).attr('href');\n            var $prodSizeChart = $(this).closest('.size-chart').find('.size-chart-collapsible');\n            if ($prodSizeChart.is(':empty')) {\n                $.ajax({\n                    url: url,\n                    type: 'get',\n                    dataType: 'json',\n                    success: function (data) {\n                        $prodSizeChart.append(data.content);\n                    }\n                });\n            }\n            $prodSizeChart.toggleClass('active');\n        });\n\n        var $sizeChart = $('.size-chart-collapsible');\n        $('body').on('click touchstart', function (e) {\n            if ($('.size-chart').has(e.target).length <= 0) {\n                $sizeChart.removeClass('active');\n            }\n        });\n    },\n    copyProductLink: function () {\n        $('body').on('click', '#fa-link', function () {\n            event.preventDefault();\n            var $temp = $('<input>');\n            $('body').append($temp);\n            $temp.val($('#shareUrl').val()).select();\n            document.execCommand('copy');\n            $temp.remove();\n            $('.copy-link-message').attr('role', 'alert');\n            $('.copy-link-message').removeClass('d-none');\n            setTimeout(function () {\n                $('.copy-link-message').addClass('d-none');\n            }, 3000);\n        });\n    },\n\n    focusChooseBonusProductModal: base.focusChooseBonusProductModal()\n};\n","'use strict';\n\n/**\n* Resets the Quick View by hiding the given selector and other sections\n* @param {string} selectorToHide - the selector to be hidden\n*/\nfunction reset(selectorToHide) {\n    $('.attribute-values-section > div').hide();\n\n    if (selectorToHide) {\n        $(selectorToHide).hide();\n    } else {\n        $('.product-pricing-section').hide();\n        $('.product-purchase-section').hide();\n    }\n\n    $('.attribute.toggle').attr('data-show', 'false');\n    $('.attribute-col.selected').removeClass('selected');\n}\n\n/**\n* Shows the pricing area of a product\n* @param {string} selector - the selector for the pricing area\n* @returns {void}\n*/\nfunction showPricing(selector) {\n    if (selector) {\n        $(selector).show();\n    } else {\n        $('.product-pricing-section').show();\n        $('.product-purchase-section').show();\n    }\n}\n\n/**\n * Click handler on attribute toggle button\n * @param {*} event Event object\n */\nfunction toggleAttribute(event) {\n    event.stopPropagation();\n\n    const $target = $(event.currentTarget);\n    const attrDataShow = 'data-show';\n    const attrDataAttrID = 'data-attr';\n    const attrDataSelectorToHide = 'data-selector-to-hide';\n\n    // Get action\n    const showAction = $target.attr(attrDataShow) === 'false';\n\n    const nextValue = showAction ? 'true' : 'false';\n\n    // Get Attribute\n    const attributeID = $target.attr(attrDataAttrID) ? $target.attr(attrDataAttrID) : 'orc_size';\n\n    // Get selector to show / hide\n    const $variationAttributes = $target.closest('.variation-attributes');\n    const selectorToHide = $variationAttributes.find('.attributes-area').attr(attrDataSelectorToHide);\n\n    let $elmts = $variationAttributes.find(`.attribute-values-section div[${attrDataAttrID}=\"${attributeID}\"]`);\n    if ($elmts.length === 0) {\n        $elmts = $(`.attribute-values-section div[${attrDataAttrID}=\"${attributeID}\"]`);\n    }\n\n    if ($elmts.length > 0) {\n        // Hide all footer blocks\n        reset(selectorToHide);\n\n        if (showAction) {\n            // Show clicked attribute\n            $elmts.show();\n            // Update parent class\n            $target.closest('.attribute-col').addClass('selected');\n        } else {\n            // Show Pricing\n            showPricing(selectorToHide);\n        }\n    }\n\n    // Update show attribute\n    // first check if this is one of the choices\n    //  that was clicked rather than the menu bar\n    if ($target.hasClass('circle-attribute')) {\n    // take out data show to avoid conversion to true and disabling of toggling and resulting arrow pointing up\n        $target.removeAttr('data-show');\n    // $('.attribute-col').children().attr('data-show', 'false');\n    } else {\n    // this is for the menu bar\n        $target.attr(attrDataShow, nextValue);\n    }\n}\n\n/**\n * Click handler on change value button\n * @param {*} event Event object\n */\nfunction selectAttributeValue(event) {\n    event.stopPropagation();\n    // Init jquery element\n    const isCompatibleShippingMethod = $('.product-detail').attr('data-is-compatible-shipping-method');\n    if (isCompatibleShippingMethod && isCompatibleShippingMethod === 'false') {\n        return;\n    }\n    const $target = $(event.currentTarget);\n    const $rootContainer = $target.closest('.variation-attributes');\n\n    if ($target.hasClass('circle-selected') === false) {\n        const attrDataAttrID = 'data-attr';\n        const attrDataAttrValue = 'data-attr-value';\n        const attrDataAttrURL = 'value';\n        const attrDataColorSuffix = 'data-color-suffix';\n\n        // Get attribute Data\n        const attributeID = $target.closest('.attribute-values').attr(attrDataAttrID);\n        const attributeValue = $target.attr(attrDataAttrValue);\n        const attributeColorSuffix = $target.attr(attrDataColorSuffix);\n        const attributeDisplayValue = $target.find('.attribute-value').text();\n        const attributeURL = $target.attr(attrDataAttrURL) === 'null' ? null : $target.attr(attrDataAttrURL);\n\n        // Update attribute values\n        const $container = $rootContainer.find(`.attribute-values[${attrDataAttrID}=\"${attributeID}\"]`);\n        const $attributesElmnts = $container.find('.circle-attribute');\n        $attributesElmnts.removeClass('circle-selected');\n        $attributesElmnts.addClass('circle-unselected');\n        $container.find(`.circle-attribute[${attrDataAttrValue}=\"${attributeValue}\"]`).removeClass('circle-unselected').addClass('circle-selected');\n\n        // Update attribute select input\n        const $toggleContainer = $rootContainer.find(`.attribute[${attrDataAttrID}=\"${attributeID}\"]`);\n        $toggleContainer.find('.circle-attribute').removeClass('circle-unselected').addClass('circle-selected').text(attributeDisplayValue);\n\n        // Update text on top of the color attribute\n        $rootContainer.find(`.attribute-values-section > div[${attrDataAttrID}=\"${attributeID}\"] .value-area > span`).removeClass('placeholder').text(attributeDisplayValue);\n\n        // Update Color\n        if (attributeColorSuffix) {\n            $toggleContainer.find('.circle-attribute').removeClass(function (index, className) {\n                return (className.match(/(^|\\s)refinement-background-\\S+/g) || []).join(' ');\n            }).addClass('refinement-background-' + attributeColorSuffix);\n            $toggleContainer.find('.value-area > span').removeClass(function (index, className) {\n                return (className.match(/(^|\\s)refinement-color-\\S+/g) || []).join(' ');\n            });\n            $toggleContainer.find('.value-area > span').html(attributeDisplayValue);\n        }\n\n        // Trigger toggleAttribute function only for mobile or quickview\n        if ($rootContainer.hasClass('mobile-only') || $rootContainer.hasClass('product-quickview-attributes')) {\n            toggleAttribute(event);\n        }\n        // Update select input\n        $target.closest('.js-attribute-container').find(`.attribute[${attrDataAttrID}=\"${attributeID}\"] select`).val(attributeURL).trigger('change');\n\n        // Quick view handling\n        var $selectedColor = $target.find('.attribute-value').html();\n        var $updateColorTab = $target.attr('data-color-suffix');\n        var $quickViewModal = $target.closest('.quick-view-dialog');\n\n        if ($quickViewModal.length === 0) {\n            return;\n        }\n\n        if ($(this).hasClass('is-color')) {\n            // update quickview color tab value\n            $quickViewModal.find('div[data-attr=\"orc_color\"] .circle-area').empty()\n                .html('<span class=\"circle-attribute circle-selected is-color\">' + $selectedColor + '</span>');\n            $quickViewModal.find('div[data-attr=\"orc_color\"] .circle-area span').addClass('refinement-background-' + $updateColorTab);\n            $quickViewModal.find('div[data-attr=\"orc_color\"] .value-area span').html($selectedColor);\n        } else {\n            // update quickview size tab value\n            var selectedSizeHtml = $target.find('.attribute-value').html();\n\n            $quickViewModal.find('div[data-attr=\"orc_size\"] .circle-area').empty()\n                .html(`<span class=\"circle-attribute circle-selected\">${selectedSizeHtml}\n                        <span class=\"attr-bis-icon d-none\">\n                            <i class=\"fa-regular fa-envelope\" aria-hidden=\"true\"></i>\n                        </span>\n                    </span>`);\n        }\n    }\n}\n\nmodule.exports = {\n    toggleAttribute,\n    selectAttributeValue,\n    updateSelectableVariationAttributes: function (product, $container) {\n        let values;\n        switch ($container.attr('data-attr')) {\n            case 'orc_size':\n                values = product.variationAttributes[1].values;\n                break;\n            case 'orc_color':\n                values = product.variationAttributes[0].values;\n                break;\n            default:\n                break;\n        }\n\n        $container.children().each(function () {\n            let valueAssociated = values.find(value => $(this).attr('data-attr-value') === value.id);\n            if (valueAssociated && valueAssociated.selectable && $(this).hasClass('circle-disabled')) {\n                $(this).removeClass('circle-disabled');\n            } if (valueAssociated && !valueAssociated.selectable && !$(this).hasClass('circle-disabled')) {\n                $(this).addClass('circle-disabled');\n            }\n        });\n    }\n};\n"],"sourceRoot":""}