{"version":3,"sources":["webpack:///./cartridges/app_accelerator_core/cartridge/client/default/js/product/productPersonalisation.js"],"names":["personalisationInit","productData","productContainer","vasType","isPersonalisationEnabled","isEngrav","isEmbossed","isBraceletAdjustable","forEach","call","querySelectorAll","currentEl","$","removeClass","personalisationModal","initEngravBtn","initEmbossBtn","initBraceletAdjustmentBtn","off","addClass","updateAddEngrav","updateAddEmboss","updateBraceletAdjustment","setupConfirmEngravAddToCart","subscribe","data","handleCartAdd","formEl","formData","setupConfirmEmbossAddToCart","setupConfirmBraceletAdjustmentAddToCart","updateEngvPreview","document","addEventListener","e","previewWrapper","previewElem","target","name","value","classList","add","remove","engravePreview","querySelector","engravePreview1","embossDotRadio","isWithoutDot","hasAttribute","textContent","checked","embossValue","length","embossDot","split","join","embossInp","type","engravEmbossClass","engravEmbossCheckbox","removeAttribute","setAttribute","isVariationSelected","sizeAttr","flag","Object","values","option","selected","getAttribute","removePDPHidden","each","hasClass","loadPreview","embossFontType","checkedFontType","currentItem","backToPDPEle","strapChooseColorSaveBtn","strapAddStrapSaveBtn","saveBtnSelector","triggerBackToPdp","trigger","sendMessageTo3DWidget","widget3DParams","iFrame","content","contentWindow","message","postMessage","JSON","stringify","_unused","showModal","_currentEleClass","bodyEle","allPersonalisationElement","currentPersonalisationElement","allTriggerElement","window","scroll","top","behavior","animate","scrollTop","offset","currentEle","allCloseButtons","modalObj","currentBtn","event","preventDefault","hideModal","changeSavedStatus","on","saveStrapColor","getProductContainer","find","dataset","triggerVas","screenWidth","innerWidth","slick","updateStrapStatus","isStrapUnvailable","isStrapFor","addEngravingBtn","addEmbossinBtn","showBraceletAdjustmentBtn","disabled","countOn","parseInt","strapStatusMessageEle","strapStatusMessageCurrent","html","dialog","options","modalID","modalName","modalClass","overlayOthers","keepAlive","initSaveDataBtn","saveButton","form","parents","serializedData","serialize","validateForm","getQueryStringParams","updateVASData","initPersonaliseStrapBtn","pdpMain","el","personaliseStrap","currentEleClass","saveDataToUrl","pageUrl","location","href","vasData","formDataArray","urlParamsObj","search","po","selectedFitName","paramAndvalue","fieldName","fieldValue","fieldNameArray","key","pop","decodeURIComponent","indexOf","push","hasBraceletAdjustment","braceletAdjustmentFit","pid","labels","innerText","assign","vasUrl","appendParamsToURL","pathname","updateHistoryState","modifyVASBtnsDesc","initShareLink","initVasFieldChange","inputEle","button","showSuccessMsg","dataButtonText","dataButtonSavedText","strapName","selectedStrapEle","strapUrl","attr","strapUrlArray","chooseColorBackToPdp","params","bindOpenTrigger","initStrapColorBtn","allButtons","initAddStrapBtn","allAddStrapRadioBtn","selectedAddStrapCount","text","radioGroup","radio","prop","parse","parent","intHowToChangeStrap","click","stopPropagation","url","open","embossObj","callBack","triggerEmbossDotsInput","initEngravAddLine","initSwitchModal","modalContainer","addline","engravLine2Container","engravLine2","val","is","next","triggerEle","matches","addRefillButton","refillContainer","firstElementChild","check3d","ajax","success","response","loadTemplate","templateData","removeAttr","containerEleClass","widget3DConfiguration","selectAttr","element","setupAJAXForm","fetchUrlParamsToForm","backToPDP","modules","tracking","init","currentElem","getAttr","empty","urlParams","queryStringParams","containerEle","skipFields","i","field","removePersonalisedData","stopImmediatePropagation","container","removeParamNameArray","paramObj","splice","textNone","initRemoveBtn","removeBtn","changeEmbossPdpBtnDesc","VASDescContainerEmboss","embossingMsg_1","embossingFont","embossingColor","view","hasEmbossing","pdpEmbossBtn","pdpEmbossDescEle","embossLine1","embossingHasDots","embossDesc","unSelectStrapColor","changeStrapColorBtnDesc","descContainerStrapColor","strapId","strapOption","pdpDescStrapColorEle","strapColorName","changeEngravePdpBtnDesc","VASDescContainerEngrav","engravingMsg_1","engravingMsg_2","hasEngrav","pdpEngravBtn","pdpEngravDescEle","engravLine1","engraveDesc","changeBraceletAdjPdpBtnDesc","VASDescContainerBraceletAdj","pdpbraceletAdjBtn","pdpBraceletAdjDescEle","braceletAdjustmentWristSize","adjDesc","adjFitDisplay","initChooseColorBackToPdp","backToProductBtn","initRefillPersonalization","VASBtnEmboss","VASBtnEngrav","css","disablePersonalisation","refillId","hideButton","isRefillSelected","variationAttr","personalisationModalInit"],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAa;;AAE+B;AACF;AAC0D;AACnD;AACS;AACjB;AAC+C;AACzC;AACiB;AAGhE,SAASA,mBAAmBA,CAACC,WAAW,EAAEC,gBAAgB,EAAEC,OAAO,EAAE;EACjE,IAAIC,wBAAwB,GAAG,KAAK;EACpC,IAAIH,WAAW,CAACG,wBAAwB,EAAE;IACtC,IAAID,OAAO,IAAI,QAAQ,EAAE;MACrBC,wBAAwB,GAAGH,WAAW,CAACI,QAAQ;IACnD,CAAC,MAAM,IAAIF,OAAO,IAAI,QAAQ,EAAE;MAC5BC,wBAAwB,GAAGH,WAAW,CAACK,UAAU;IACrD,CAAC,MAAM,IAAIH,OAAO,IAAI,qBAAqB,EAAE;MACzCC,wBAAwB,GAAGH,WAAW,CAACM,oBAAoB;IAC/D;EACJ;EAEA,EAAE,CAACC,OAAO,CAACC,IAAI,CAACP,gBAAgB,CAACQ,gBAAgB,CAAC,gCAAgC,GAAGP,OAAO,GAAG,SAAS,CAAC,EAAE,UAASQ,SAAS,EAAE;IAC3H,IAAIP,wBAAwB,EAAE;MAC1BQ,CAAC,CAACD,SAAS,CAAC,CAACE,WAAW,CAAC,0BAA0B,CAAC;MACpD,IAAIV,OAAO,IAAI,QAAQ,EAAE;QACrBW,oBAAoB,CAACC,aAAa,CAAC,CAAC;MACxC,CAAC,MAAM,IAAIZ,OAAO,IAAI,QAAQ,EAAE;QAC5BW,oBAAoB,CAACE,aAAa,CAAC,CAAC;MACxC,CAAC,MAAM,IAAIb,OAAO,IAAI,qBAAqB,EAAE;QACzCW,oBAAoB,CAACG,yBAAyB,CAAC,CAAC;MACpD;IACJ,CAAC,MAAM;MACHL,CAAC,CAACD,SAAS,CAAC,CAAC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AC,CAAC;MACN;MACA,IAAIF,YAAY,EAAE;QACdA,YAAY,CAAClR,gBAAgB,CAAC,YAAY,EAAE,YAAW;UACnD,IAAIqR,sBAAsB,GAAGtR,QAAQ,CAACY,aAAa,CAAC,2BAA2B,CAAC;UAChF,IAAI0Q,sBAAsB,EAAE;YACxB1S,CAAC,CAAC,gBAAgB,CAAC,CAACyS,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC;UAC9C,CAAC,MAAM;YACHzS,CAAC,CAAC,gBAAgB,CAAC,CAACyS,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC;UAC/C;QACJ,CAAC,CAAC;QACFF,YAAY,CAAClR,gBAAgB,CAAC,YAAY,EAAE,YAAW;UACnDrB,CAAC,CAAC,gBAAgB,CAAC,CAACyS,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC;QAC/C,CAAC,CAAC;MACN;IACJ;EACJ,CAAC;EAED3D,IAAI,EAAE,SAANA,IAAIA,CAAA,EAAa;IACb,IAAI,CAACwD,yBAAyB,CAAC,CAAC;IAChC,IAAI,CAAC5J,aAAa,CAAC,CAAC;IACpB,IAAI,CAACvI,aAAa,CAAC,CAAC;IACpB,IAAI,CAACC,aAAa,CAAC,CAAC;IACpB,IAAI,CAACC,yBAAyB,CAAC,CAAC;IAChC,IAAI,CAACwL,iBAAiB,CAAC,CAAC;IACxB,IAAI,CAACE,eAAe,CAAC,CAAC;IACtB,IAAI,CAACqG,wBAAwB,CAAC,CAAC;IAC/B,IAAI,CAAC5F,mBAAmB,CAAC,CAAC;EAC9B;AACJ,CAAC;AAEM,IAAIuG,wBAAwB,GAAG7S,oBAAoB,CAAC4O,IAAI,CAAC,CAAC,C","file":"module-product-tile~module-quick-add~module-quick-view~module-saveforlater-trigger~module.personalis~2a76bba0.js","sourcesContent":["'use strict';\n\nimport {subscribe} from '../helpers/pubSub';\nimport {handleCartAdd} from './addToCart';\nimport {updateHistoryState, appendParamsToURL, getQueryStringParams} from '../helpers/urlUtilities';\nimport {widget3DConfiguration} from './widget3D';\nimport {setupAJAXForm} from '../modules/module.ajax-form';\nimport modules from '../helpers/modules';\nimport {initShareLink, getProductContainer, chooseColorBackToPdp} from './productUtils';\nimport * as dialog from '../components/dialog';\nimport {validateForm} from '../components/clientSideValidation';\n\n\nfunction personalisationInit(productData, productContainer, vasType) {\n let isPersonalisationEnabled = false;\n if (productData.isPersonalisationEnabled) {\n if (vasType == 'engrav') {\n isPersonalisationEnabled = productData.isEngrav;\n } else if (vasType == 'emboss') {\n isPersonalisationEnabled = productData.isEmbossed;\n } else if (vasType == 'bracelet-adjustment') {\n isPersonalisationEnabled = productData.isBraceletAdjustable;\n }\n }\n\n [].forEach.call(productContainer.querySelectorAll('[data-product-component=\"show-' + vasType + '-form\"]'), function(currentEl) {\n if (isPersonalisationEnabled) {\n $(currentEl).removeClass('disable--personalisation');\n if (vasType == 'engrav') {\n personalisationModal.initEngravBtn();\n } else if (vasType == 'emboss') {\n personalisationModal.initEmbossBtn();\n } else if (vasType == 'bracelet-adjustment') {\n personalisationModal.initBraceletAdjustmentBtn();\n }\n } else {\n $(currentEl).off().addClass('disable--personalisation');\n }\n });\n}\n\nexport function updateAddEngrav(productData, productContainer) {\n personalisationInit(productData, productContainer, 'engrav');\n}\n\nexport function updateAddEmboss(productData, productContainer) {\n personalisationInit(productData, productContainer, 'emboss');\n}\n\nexport function updateBraceletAdjustment(productData, productContainer) {\n personalisationInit(productData, productContainer, 'bracelet-adjustment');\n}\n\nexport function setupConfirmEngravAddToCart() {\n subscribe('addPersonalisationEngraving:success', data => handleCartAdd(data.formEl, data.formData));\n}\n\nexport function setupConfirmEmbossAddToCart() {\n subscribe('addPersonalisationEmbossing:success', data => handleCartAdd(data.formEl, data.formData));\n}\n\nexport function setupConfirmBraceletAdjustmentAddToCart() {\n subscribe('addPersonalisationBraceletAdjustment:success', data => handleCartAdd(data.formEl, data.formData));\n}\n\nexport function updateEngvPreview() {\n document.addEventListener('change', function(e) {\n let previewWrapper = document.querySelectorAll('.engrave--preview .preview-line');\n previewWrapper.forEach(previewElem => {\n if (previewElem && (e.target && e.target.name == 'dwfrm_productpersonalisation_emboss_embossingMessageFont')) {\n if (e.target.value == 'Cursive' || e.target.value == 'CELESTE') {\n previewElem.classList.add('font-family--cursive');\n previewElem.classList.remove('text-transform--uppercase');\n } else if (e.target.value == 'Italic') {\n previewElem.classList.remove('text-transform--uppercase');\n previewElem.classList.add('font-style--italic');\n } else {\n previewElem.classList.add('text-transform--uppercase');\n previewElem.classList.remove('font-family--cursive');\n previewElem.classList.remove('font-style--italic');\n }\n }\n if (previewElem && (e.target && e.target.name == 'dwfrm_productpersonalisation_engrav_engravMessageFont')) {\n if (e.target.value == 'Cursive' || e.target.value == 'CELESTE') {\n previewElem.classList.add('font-family--cursive');\n } else if (e.target.value == 'Italic') {\n previewElem.classList.add('font-style--italic');\n } else {\n previewElem.classList.remove('font-family--cursive');\n previewElem.classList.remove('font-style--italic');\n }\n }\n });\n });\n document.addEventListener('input', function(e) {\n var engravePreview = document.querySelector('[data-personalization-preview-line1]');\n var engravePreview1 = document.querySelector('[data-personalization-preview-line2]');\n let embossDotRadio = document.querySelectorAll('[data-emboss-dot]'),\n isWithoutDot;\n\n if (engravePreview != null) {\n if (engravePreview && e.target && e.target.hasAttribute('data-engrave-msg')) {\n engravePreview.textContent = e.target.value;\n }\n }\n\n if (engravePreview1 != null) {\n if (engravePreview1 && e.target && e.target.hasAttribute('data-engrave-msg1')) {\n engravePreview1.textContent = e.target.value;\n }\n }\n\n if (embossDotRadio != null) {\n if (embossDotRadio[0] && embossDotRadio[0].checked) {\n isWithoutDot = false;\n } else {\n isWithoutDot = true;\n }\n }\n if (engravePreview != null && isWithoutDot != null) {\n if (engravePreview && e.target && e.target.hasAttribute('data-emboss-msg')) {\n let embossValue = e.target.value;\n if (embossValue.length > 1 && !isWithoutDot) {\n let embossDot = embossValue.split('').join('.');\n engravePreview.textContent = embossDot;\n } else if (embossValue.length == 0 && !isWithoutDot) {\n engravePreview.textContent = '';\n } else if (embossValue.length == 1 || isWithoutDot) {\n engravePreview.textContent = embossValue;\n }\n }\n }\n });\n\n document.addEventListener('change', function(e) {\n let embossDot = document.querySelector('[data-emboss-dots]');\n if (embossDot != null) {\n if (embossDot) {\n embossDot.value = e.target.checked ? 'true' : 'false';\n }\n }\n var embossInp = document.querySelector('[data-emboss-msg]');\n let previewWrapper = document.querySelector('.engrave--preview .preview-line');\n if (embossInp != null && previewWrapper && previewWrapper != null && e.target) {\n if (e.target.type == 'checkbox' && e.target.checked && e.target.hasAttribute('data-emboss-dots') && embossDot && embossDot.value == 'true') {\n previewWrapper.textContent = embossInp.value.split('').join('.');\n } else if (e.target.hasAttribute('data-emboss-dots') && embossDot && embossDot.value == 'false') {\n previewWrapper.textContent = embossInp.value;\n }\n }\n });\n\n document.addEventListener('change', function(e) {\n let engravEmbossClass = document.querySelector('.personalisation__cta-save');\n let engravEmbossCheckbox = document.querySelector('[data-engrav-emboss-checkbox]');\n if (engravEmbossCheckbox != null) {\n engravEmbossCheckbox.value = e.target.checked ? 'true' : 'false';\n }\n if (engravEmbossCheckbox != null && engravEmbossClass != null && e.target) {\n if (e.target.type == 'checkbox' && e.target.checked && e.target.hasAttribute('data-engrav-emboss-checkbox') && engravEmbossCheckbox.value == 'true') {\n engravEmbossClass.removeAttribute('disabled');\n } else if (e.target.hasAttribute('data-engrav-emboss-checkbox') && engravEmbossCheckbox.value == 'false') {\n engravEmbossClass.setAttribute('disabled', 'disabled');\n }\n }\n });\n\n}\nfunction isVariationSelected(sizeAttr) {\n let flag = false;\n Object.values(sizeAttr).forEach(function(option) {\n if (option && option.selected && (option.getAttribute('data-attr-value') !== null && option.getAttribute('data-attr-value') !== '')) {\n flag = true;\n }\n });\n return flag;\n}\nfunction removePDPHidden() {\n $('.item-info__container').each(function() {\n if ($(this).hasClass('hidden')) {\n $(this).removeClass('hidden');\n }\n });\n}\nexport function loadPreview() {\n let embossDot = document.querySelector('[data-emboss-dots]');\n var embossInp = document.querySelector('[data-emboss-msg]');\n let previewWrapper = document.querySelector('.engrave--preview .preview-line');\n var embossFontType = document.querySelectorAll('[data-emboss-font-type]');\n if (embossInp != null && previewWrapper && previewWrapper != null) {\n if (embossDot && embossDot.checked == true) {\n previewWrapper.textContent = embossInp.value.split('').join('.');\n } else if (embossDot && embossDot.checked == false) {\n previewWrapper.textContent = embossInp.value;\n }\n }\n if (previewWrapper && (embossFontType[0].name == 'dwfrm_productpersonalisation_emboss_embossingMessageFont' || embossFontType[0].name == 'dwfrm_productpersonalisation_engrav_engravMessageFont')) {\n let checkedFontType;\n [].forEach.call(embossFontType, currentItem => {\n if (currentItem.checked) {\n checkedFontType = currentItem.value;\n }\n });\n if (checkedFontType == 'Cursive' || checkedFontType == 'CELESTE') {\n previewWrapper.classList.add('font-family--cursive');\n previewWrapper.classList.remove('text-transform--uppercase');\n } else if (checkedFontType == 'Italic') {\n previewWrapper.classList.remove('text-transform--uppercase');\n previewWrapper.classList.add('font-style--italic');\n } else {\n previewWrapper.classList.add('text-transform--uppercase');\n previewWrapper.classList.remove('font-family--cursive');\n previewWrapper.classList.remove('font-style--italic');\n }\n }\n}\n\nexport var personalisationModal = {\n backToPDPEle: '[data-back-to-product=\"back-to-product\"]',\n strapChooseColorSaveBtn: document.querySelector('[data-product-choose-color-save]'),\n strapAddStrapSaveBtn: document.querySelector('[data-product-strap-add-save]'),\n saveBtnSelector: '[data-product-personalisation=\"save\"]',\n\n\n triggerBackToPdp: function() {\n $(this.backToPDPEle).trigger('click');\n },\n\n sendMessageTo3DWidget: function(widget3DParams) {\n let iFrame = document.querySelector('[data-id=\"3DWidget\"]');\n\n if (iFrame && widget3DParams) {\n try {\n let content = iFrame.contentWindow;\n widget3DParams.forEach(function(message) {\n content.postMessage(JSON.stringify(message), '*');\n });\n } catch {\n return false;\n }\n }\n },\n\n showModal: function(_currentEleClass) {\n let bodyEle = document.querySelector('body'),\n allPersonalisationElement = document.querySelectorAll('.item-info__personalization-container'),\n currentPersonalisationElement = document.querySelector('.' + _currentEleClass),\n allTriggerElement = document.querySelectorAll('[data-trigger-vas]');\n\n window.scroll({top: 0, behavior: 'smooth'});\n $('html, body').animate({\n scrollTop: $('.pdp-main').offset().top\n }, 500);\n\n [].forEach.call(allPersonalisationElement, function(currentEle) {\n currentEle.classList.add('hidden');\n });\n\n bodyEle.classList.add('personalization-mode-on');\n currentPersonalisationElement.classList.remove('hidden');\n\n let allCloseButtons = document.querySelectorAll('.personalisation__cta-close'),\n strapAddStrapSaveBtn = document.querySelector('[data-product-strap-add-save]'),\n modalObj = this;\n\n [].forEach.call(allCloseButtons, function(currentBtn) {\n currentBtn.addEventListener('click', function(event) {\n event.preventDefault();\n modalObj.hideModal();\n })\n });\n\n if (modalObj.strapChooseColorSaveBtn != null) {\n modalObj.changeSavedStatus(modalObj.strapChooseColorSaveBtn);\n $(modalObj.strapChooseColorSaveBtn).off().on('click', function(e) {\n e.preventDefault();\n modalObj.saveStrapColor(this);\n });\n }\n\n let productContainer = getProductContainer($('[data-product-personalisation=\"descContainerStrapColor\"]'));\n $(productContainer).find('a[data-static-option-id]').off().on('click', function() {\n modalObj.changeSavedStatus(modalObj.strapChooseColorSaveBtn);\n });\n\n $('[data-add-strap-color]').off().on('click', function() {\n modalObj.changeSavedStatus(modalObj.strapChooseColorSaveBtn);\n });\n\n if (strapAddStrapSaveBtn != null) {\n strapAddStrapSaveBtn.addEventListener('click', function(event) {\n event.preventDefault();\n modalObj.changeSavedStatus(this, true);\n });\n }\n\n [].forEach.call(allTriggerElement, function(currentEl) {\n $(currentEl).off().on('click', function(e) {\n e.preventDefault();\n modalObj.hideModal();\n $('[data-product-component=\"' + currentEl.dataset.triggerVas + '\"]').trigger('click');\n })\n });\n\n if (_currentEleClass === 'product-strap-choose-color') {\n let screenWidth = window.innerWidth;\n\n if (screenWidth > 1024) {\n $('#productStrapChooseColorSlider, .product-strap-add__product-tilelist').slick('unslick');\n }\n }\n\n if ($('.slick-slider')) {\n $('.slick-slider').slick('setDimensions');\n }\n },\n\n hideModal: function() {\n let bodyEle = document.querySelector('body');\n bodyEle.classList.remove('personalization-mode-on');\n\n if ($('.slick-slider')) {\n $('.slick-slider').slick('setDimensions');\n }\n\n window.scroll({top: 0, behavior: 'smooth'});\n },\n\n updateStrapStatus: function(isStrapUnvailable, isStrapFor) {\n let addEngravingBtn = document.querySelector('.trigger-add_engraving');\n let addEmbossinBtn = document.querySelector('.trigger-add_embossing');\n let showBraceletAdjustmentBtn = document.querySelector('.trigger-show_bracelet_adjustment');\n let strapChooseColorSaveBtn = this.strapChooseColorSaveBtn,\n strapAddStrapSaveBtn = this.strapAddStrapSaveBtn;\n\n if (isStrapUnvailable) {\n if (addEngravingBtn) {\n addEngravingBtn.disabled = true;\n }\n if (addEmbossinBtn) {\n addEmbossinBtn.disabled = true;\n }\n if (showBraceletAdjustmentBtn) {\n showBraceletAdjustmentBtn.disabled = true;\n }\n\n if (isStrapFor === 'forChooseColor' && strapChooseColorSaveBtn) {\n strapChooseColorSaveBtn.disabled = true;\n }\n\n if (isStrapFor === 'forAddStrap' && strapAddStrapSaveBtn && (strapAddStrapSaveBtn.dataset.countOn && parseInt(strapAddStrapSaveBtn.dataset.countOn) == 0)) {\n strapAddStrapSaveBtn.disabled = true;\n }\n\n let strapStatusMessageEle = document.querySelector('[data-status-message=\"product-strap-status-message\"]'),\n strapStatusMessageCurrent = $(strapStatusMessageEle).find('.status-message--unavailable').html();\n\n dialog.open({\n html: strapStatusMessageCurrent,\n type: 'html',\n options: {\n modalID: 'productStrapStatus',\n modalName: 'productStrapStatus',\n modalClass: 'modal--product-strap-status',\n overlayOthers: true,\n keepAlive: true\n }\n });\n } else if (strapChooseColorSaveBtn) {\n if (addEngravingBtn) {\n addEngravingBtn.disabled = false;\n }\n if (addEmbossinBtn) {\n addEmbossinBtn.disabled = false;\n }\n if (showBraceletAdjustmentBtn) {\n showBraceletAdjustmentBtn.disabled = false;\n }\n if (isStrapFor === 'forChooseColor' && strapAddStrapSaveBtn) {\n strapChooseColorSaveBtn.disabled = false;\n }\n if (isStrapFor === 'forAddStrap' && strapAddStrapSaveBtn) {\n strapAddStrapSaveBtn.disabled = false;\n }\n if (isStrapFor === 'forAddStrap' && strapAddStrapSaveBtn && strapAddStrapSaveBtn.dataset.countOn == 0) {\n strapAddStrapSaveBtn.disabled = true;\n }\n }\n },\n\n initSaveDataBtn: function() {\n let saveButton = document.querySelector(this.saveBtnSelector),\n modalObj = this;\n\n modalObj.changeSavedStatus(saveButton);\n\n $(saveButton).off().on('click', function(e) {\n e.preventDefault();\n\n var form = $(this).parents('form'),\n serializedData = form.serialize();\n\n if (!validateForm(form[0])) {\n return false;\n }\n\n if ($(this).data('product-add-to-bag') == true) {\n handleCartAdd(this, getQueryStringParams(serializedData), null);\n } else {\n modalObj.changeSavedStatus(this, true);\n }\n\n modalObj.updateVASData(serializedData);\n\n if ($(this).data('close-modal') == true) {\n modalObj.triggerBackToPdp();\n }\n });\n },\n\n initPersonaliseStrapBtn: function(pdpMain, el) {\n let personaliseStrap = document.querySelector('[data-trigger-vas=\"product-strap-choose-color\"]'),\n modalObj = this;\n\n if (personaliseStrap) {\n personaliseStrap.addEventListener('click', function() {\n let currentEleClass = this.getAttribute('data-trigger-vas');\n pdpMain.classList.remove('opacity');\n el.classList.remove('opacity');\n el.classList.remove('engrave-content__animation');\n removePDPHidden();\n modalObj.showModal(currentEleClass);\n })\n }\n },\n\n saveDataToUrl: function(serializedData) {\n\n if (!serializedData) {\n return false;\n }\n\n let pageUrl = window.location.href.split('?')[0],\n vasData = {},\n formDataArray = serializedData ? serializedData.split('&') : [],\n urlParamsObj = getQueryStringParams(window.location.search, null),\n po = urlParamsObj.po ? urlParamsObj.po.split(',') : [],\n selectedFitName;\n\n formDataArray.forEach(function(data) {\n let paramAndvalue = data.split('='),\n fieldName = paramAndvalue && paramAndvalue[0] ? paramAndvalue[0] : '',\n fieldValue = paramAndvalue && paramAndvalue[1] ? paramAndvalue[1] : '';\n\n if (fieldName) {\n if (urlParamsObj[fieldName]) {\n delete urlParamsObj[fieldName];\n }\n\n let fieldNameArray = fieldName.split('_'),\n key = fieldNameArray ? fieldNameArray.pop() : '';\n\n if (key) {\n vasData[key] = decodeURIComponent(fieldValue);\n }\n }\n });\n\n if (vasData.po && po.indexOf(vasData.po) < 0) {\n po.push(vasData.po);\n }\n\n vasData.po = po.join(',');\n\n if (vasData.hasBraceletAdjustment === 'true' && vasData.braceletAdjustmentFit && vasData.pid) {\n selectedFitName = $('#dwfrm_productpersonalisation_braceletAdjustment_braceletAdjustmentFit-' + vasData.braceletAdjustmentFit + '-' + vasData.pid);\n selectedFitName = selectedFitName.length > 0 && selectedFitName[0].labels && selectedFitName[0].labels.length > 0 ? selectedFitName[0].labels[0].innerText : '';\n vasData.selectedFitName = selectedFitName ? selectedFitName : '';\n }\n urlParamsObj = Object.assign(urlParamsObj, vasData);\n\n let vasUrl = appendParamsToURL(window.location.pathname, urlParamsObj);\n updateHistoryState(pageUrl, vasUrl);\n },\n\n updateVASData: function(serializedData) {\n this.saveDataToUrl(serializedData);\n\n this.modifyVASBtnsDesc();\n initShareLink();\n },\n\n initVasFieldChange: function(el) {\n let inputEle = $(el).find('input'),\n saveButton = $(el).find(this.saveBtnSelector),\n modalObj = this;\n\n $(inputEle).off().on('change keyup paste', function() {\n modalObj.changeSavedStatus(saveButton);\n });\n },\n\n changeSavedStatus: function(button, showSuccessMsg) {\n let dataButtonText = $(button).find('[data-button-text]'),\n dataButtonSavedText = $(button).find('[data-button-saved-text]');\n\n if (showSuccessMsg && showSuccessMsg === true) {\n $(dataButtonText).addClass('hidden');\n $(dataButtonSavedText).removeClass('hidden');\n } else {\n $(dataButtonText).removeClass('hidden');\n $(dataButtonSavedText).addClass('hidden');\n }\n },\n\n saveStrapColor: function(button) {\n let strapName = $('[data-strap-chooser]').find('.pdp-straps__item');\n if (strapName && strapName != null) {\n $(strapName).each(function() {\n if ($(this).hasClass('selectedStrapOption')) {\n $(this).removeClass('selectedStrapOption');\n }\n if ($(this).hasClass('plpSlectedStrap')) {\n $(this).removeClass('plpSlectedStrap');\n }\n })\n }\n\n let selectedStrapEle = $('[data-strap-chooser]').find('.pdp-straps__item.toggle--active');\n\n if (!selectedStrapEle) {\n return false;\n }\n\n let strapUrl = $(selectedStrapEle).attr('href'),\n strapUrlArray = strapUrl ? strapUrl.split('?') : [],\n serializedData = strapUrlArray && strapUrlArray[1] ? strapUrlArray[1] : '';\n\n this.updateVASData(serializedData);\n $(selectedStrapEle).addClass('selectedStrapOption');\n chooseColorBackToPdp();\n this.changeSavedStatus(button, true);\n\n if ($(button).data('close-modal') == true) {\n this.hideModal();\n }\n },\n\n initBraceletAdjustmentBtn: function() {\n var params = {\n 'triggerEle': document.querySelector('[data-product-component=\"show-bracelet-adjustment-form\"]'),\n 'containerEleClass': 'braceletAdjust-template--load',\n 'element': 'data-braceletadjustment',\n 'pdpMain': 'data-main-component'\n };\n\n this.bindOpenTrigger(params);\n },\n\n initStrapColorBtn: function() {\n let allButtons = document.querySelectorAll('[data-personalization-element=\"product-strap-choose-color\"]'),\n modalObj = this;\n\n [].forEach.call(allButtons, function(currentBtn) {\n currentBtn.addEventListener('click', function() {\n let currentEleClass = this.getAttribute('data-personalization-element');\n modalObj.showModal(currentEleClass);\n })\n });\n },\n\n initAddStrapBtn: function() {\n let allButtons = document.querySelectorAll('[data-personalization-element=\"product-strap-add\"]'),\n allAddStrapRadioBtn = document.querySelectorAll('[data-strap-element=\"product-strap-add-radio-btn\"]'),\n modalObj = this;\n\n [].forEach.call(allButtons, function(currentBtn) {\n currentBtn.addEventListener('click', function() {\n let currentEleClass = this.getAttribute('data-personalization-element'),\n selectedAddStrapCount = parseInt($('[data-product-personalisation=\"VASDescAddStrap\"]').text()),\n radioGroup = $( 'input[name^=\"additionalStrapCheckbox-\"]' );\n\n if (selectedAddStrapCount <= 0) {\n radioGroup.forEach(function(radio) {\n $(radio).prop('checked', false);\n $(radio).attr('data-product-checked', 'false');\n });\n }\n modalObj.showModal(currentEleClass);\n })\n });\n [].forEach.call(allAddStrapRadioBtn, function(currentBtn) {\n currentBtn.addEventListener('click', function() {\n var isStrapUnvailable = JSON.parse( $(this).parent().attr('data-strap-instock') );\n personalisationModal.updateStrapStatus(!isStrapUnvailable, 'forAddStrap');\n })\n });\n },\n\n intHowToChangeStrap: function() {\n if ($('.strap-how-to-change-link').length > 0) {\n $('.strap-how-to-change-link').click(function(e) {\n e.stopPropagation();\n e.preventDefault();\n var url = $(this).attr('data-url').split('?');\n window.open(url, '_blank');\n });\n }\n },\n\n initEmbossBtn: function() {\n let embossObj = this;\n var params = {\n 'triggerEle': document.querySelector('[data-product-component=\"show-emboss-form\"]'),\n 'containerEleClass': 'emboss-template--load',\n 'element': 'data-emboss',\n 'callBack': function() {\n embossObj.triggerEmbossDotsInput();\n }\n };\n this.triggerEmbossDotsInput();\n this.bindOpenTrigger(params);\n },\n\n initEngravBtn: function() {\n var params = {\n 'triggerEle': document.querySelector('[data-product-component=\"show-engrav-form\"]'),\n 'containerEleClass': 'engrave-template--load',\n 'element': 'data-engrave',\n 'callBack': this.initEngravAddLine\n };\n\n this.bindOpenTrigger(params);\n },\n\n initSwitchModal: function(modalContainer) {\n [].forEach.call(modalContainer.querySelectorAll('[data-switch-modal]'), function(currentEl) {\n $(currentEl).off().on('click', function() {\n $('[data-product-component=\"' + $(this).data('switch-modal') + '\"]').trigger('click');\n });\n });\n },\n\n initEngravAddLine: function(el) {\n var addline = $(el.querySelector('[data-add-engrav-line2]')),\n engravLine2Container = $(el.querySelector('[data-engrav-line2]')),\n engravLine2 = $(el.querySelector('[data-engrave-msg=\"line-two\"]'));\n\n if (engravLine2 && engravLine2.val()) {\n addline.addClass('hidden');\n engravLine2Container.removeClass('hidden');\n } else if (addline) {\n addline.off().on('click', function() {\n engravLine2Container.removeClass('hidden');\n $(this).addClass('hidden');\n });\n }\n },\n\n triggerEmbossDotsInput: function() {\n $('.checkEmboss__Dots').on('change', function() {\n if ($(this).is(':checked')) {\n $(this).next('input').val('true');\n } else {\n $(this).next('input').val('false');\n }\n });\n },\n\n bindOpenTrigger: function(params) {\n if (!params.triggerEle || params.triggerEle == null || $(params.triggerEle).hasClass('disable--personalisation')) {\n return false;\n }\n let modalObj = this;\n $(params.triggerEle).off().on('click', function(e) {\n if (e.target.matches('.removeButton')) {\n return false;\n } else {\n let addRefillButton = document.querySelector('.product-addrefill__button');\n if (addRefillButton && addRefillButton.getAttribute('data-pid') != '') {\n var refillContainer = document.querySelector('[data-product-component=\"selected-refills\"]');\n if (refillContainer && (refillContainer.firstElementChild == null || (refillContainer.firstElementChild && refillContainer.firstElementChild.getAttribute('data-sel-refillid') == ''))) {\n return false;\n }\n }\n params.check3d = this.getAttribute('data-disableconfig');\n e.preventDefault();\n $.ajax({\n url: this.getAttribute('data-url'),\n type: 'get',\n success: function(response) {\n modalObj.loadTemplate(response, params);\n }\n });\n }\n });\n },\n\n loadTemplate: function(templateData, params) {\n if (!templateData) {\n return false;\n }\n $('[data-personalisation-template-loader]').removeAttr('class').addClass(params.containerEleClass).html(templateData);\n\n if (!params.check3d) {\n widget3DConfiguration();\n }\n\n window.scroll({top: 0, behavior: 'smooth'});\n $('html, body').animate({\n scrollTop: $('.pdp-main').offset().top\n }, 500);\n\n if (!params.pdpMain) {\n params.pdpMain = 'data-strap-color';\n }\n\n if (!params.selectAttr) {\n params.selectAttr = '.pdp-main .item-info__personalization-container';\n }\n\n let el = document.querySelector('[' + params.element + ']'),\n pdpMain = document.querySelector('[' + params.pdpMain + ']'),\n allTriggerElement = document.querySelectorAll('[data-trigger-vas]'),\n selectAttr = $(params.selectAttr);\n\n pdpMain.classList.add('opacity');\n el.classList.add('opacity');\n el.classList.add('engrave-content__animation');\n\n if ($(selectAttr).hasClass('opacity')) {\n $('.product-gallery--pdp').addClass('opacity');\n $('.pdp').addClass('opacity');\n $('.pdp-main__breadcrumbs').addClass('opacity');\n $('.pdp-main__media').addClass('galleryAnimation');\n } else {\n $('.product-gallery--pdp').removeClass('opacity');\n $('.pdp').removeClass('opacity');\n $('.pdp-main__breadcrumbs').removeClass('opacity');\n $('.pdp-main__media').removeClass('galleryAnimation');\n }\n\n if (document.querySelector('[data-product-personalisation=\"form\"]')) {\n setupAJAXForm(document.querySelector('[data-product-personalisation=\"form\"]'));\n }\n\n this.initSaveDataBtn();\n this.fetchUrlParamsToForm(params.containerEleClass);\n this.initPersonaliseStrapBtn(pdpMain, el);\n this.initVasFieldChange(el);\n this.backToPDP(el);\n modules.tracking.init();\n this.initSwitchModal(el);\n\n if (typeof params.callBack == 'function') {\n params.callBack(el);\n }\n\n [].forEach.call(allTriggerElement, function(currentElem) {\n $(currentElem).off().on('click', function() {\n $('[data-product-component=\"' + currentElem.dataset.triggerVas + '\"]').trigger('click');\n })\n });\n\n loadPreview();\n },\n\n backToPDP: function(getAttr) {\n let backToPDPEle = document.querySelector(this.backToPDPEle);\n\n if (!backToPDPEle || backToPDPEle == null) {\n return false;\n }\n\n backToPDPEle.addEventListener('click', function() {\n $('html, body').animate({\n scrollTop: $('.pdp-main').offset().top\n }, 1000);\n\n let el = getAttr,\n pdpMain = document.querySelector('[data-main-component]'),\n selectAttr = $('.pdp-main .item-info__personalization-container');\n\n pdpMain.classList.remove('opacity');\n el.classList.remove('opacity');\n el.classList.remove('braceletadjustment-content__animation');\n el.classList.remove('emboss-content__animation');\n el.classList.remove('engrave-content__animation');\n\n if ($(selectAttr).hasClass('opacity')) {\n $('.product-gallery--pdp').addClass('opacity');\n $('.pdp').addClass('opacity');\n $('.pdp-main__breadcrumbs').addClass('opacity');\n $('.pdp-main__media').addClass('galleryAnimation');\n } else {\n $('.product-gallery--pdp').removeClass('opacity');\n $('.pdp').removeClass('opacity');\n $('.pdp-main__breadcrumbs').removeClass('opacity');\n $('.pdp-main__media').removeClass('galleryAnimation');\n $('.braceletAdjust-template--load').empty();\n }\n removePDPHidden();\n });\n },\n\n // code for fetching parameters from url\n fetchUrlParamsToForm: function(containerEleClass) {\n var urlParams = window.location.search,\n queryStringParams = getQueryStringParams(urlParams, null),\n containerEle = $('.' + containerEleClass),\n skipFields = [ 'po' ];\n\n for (let i in queryStringParams) {\n let field = containerEle.find('[name$=\"' + i + '\"]');\n\n if (field && field.length > 0) {\n let value = queryStringParams[i];\n if (field.attr('type') == 'radio') {\n if (value) {\n field = containerEle.find('[value=\"' + value + '\"]');\n field.prop('checked', true);\n }\n } else if (field.attr('type') == 'checkbox') {\n if (value && value != 'false') {\n field.prop('checked', true);\n } else {\n field.prop('checked', false);\n }\n } else if (skipFields.indexOf(i) == -1) {\n field.val(value);\n }\n }\n }\n },\n\n removePersonalisedData: function(e) {\n if (e.data) {\n e.preventDefault();\n e.stopImmediatePropagation();\n let strapName = $('[data-strap-chooser]').find('.pdp-straps__item');\n if (strapName && strapName != null) {\n $(strapName).each(function() {\n if ($(this).hasClass('selectedStrapOption')) {\n $(this).removeClass('selectedStrapOption');\n }\n if ($(this).hasClass('plpSlectedStrap')) {\n $(this).removeClass('plpSlectedStrap');\n }\n })\n }\n chooseColorBackToPdp();\n }\n\n let container = e.container || e.data.container,\n removeParamNameArray = e.removeParamNameArray || e.data.removeParamNameArray || [],\n pageUrl = window.location.pathname,\n paramObj = e.paramObj || e.data.paramObj,\n po = paramObj.po ? paramObj.po.split(',') : [],\n widget3DParams = e.data ? e.data.widget3DParams : null,\n modalObj = e.data ? e.data.modalObj : this,\n callBack = e.data ? e.data.callBack : null;\n\n if (paramObj.po && po.indexOf(removeParamNameArray[0]) > -1) {\n po.splice(po.indexOf(removeParamNameArray[0]), 1);\n paramObj.po = po.join(',');\n\n if (po.length <= 0) {\n removeParamNameArray.push('po');\n }\n }\n\n for (let i in removeParamNameArray) {\n delete paramObj[removeParamNameArray[i]];\n }\n\n if (widget3DParams) {\n modalObj.sendMessageTo3DWidget(widget3DParams);\n }\n\n pageUrl = appendParamsToURL(pageUrl, paramObj);\n updateHistoryState(false, pageUrl);\n let textNone = container.find('[data-product-personalisation^=\"VASDesc\"]').attr('data-message-none');\n container.parents('[data-product-personalisation^=\"VASBtn\"]').removeClass('vasTextButton');\n container.find('[data-product-personalisation^=\"VASDesc\"]').removeClass('uppercase').text(textNone);\n container.find('[data-product-personalisation^=\"remove\"]').off('click').addClass('hidden');\n\n if (typeof callBack == 'function') {\n callBack(e);\n }\n },\n\n initRemoveBtn: function(container, paramObj, removeParamNameArray, widget3DParams, callBack) {\n let removeBtn = container.find('[data-product-personalisation=\"remove\"]'),\n modalObj = this;\n\n if (removeBtn != null) {\n removeBtn.removeClass('hidden').off('click');\n $(removeBtn).off().on('click', {container: container, paramObj: paramObj, removeParamNameArray: removeParamNameArray, widget3DParams: widget3DParams, modalObj: modalObj, callBack: callBack}, this.removePersonalisedData);\n }\n },\n\n changeEmbossPdpBtnDesc: function(paramObj) {\n let VASDescContainerEmboss = $('[data-product-personalisation=\"VASDescContainerEmboss\"]'),\n removeParamNameArray = [ 'emboss', 'hasEmbossing', 'font-type-hidden', 'embossingMessageFont', 'embossingHasFoil', 'embossLine1', 'embossingHasDots', 'noReturnPolicyAcknowledged' ],\n widget3DParams = [ {embossingMsg_1: ''}, {embossingFont: ''}, {embossingColor: ''}, {view: 'DEFAULT'} ];\n\n if (!VASDescContainerEmboss.length || !paramObj || !paramObj.hasEmbossing || paramObj.hasEmbossing == 'false') {\n this.removePersonalisedData({container: VASDescContainerEmboss, paramObj: paramObj, removeParamNameArray: removeParamNameArray});\n return false;\n }\n\n let pdpEmbossBtn = $('[data-product-personalisation=\"VASBtnEmboss\"]'),\n pdpEmbossDescEle = $('[data-product-personalisation=\"VASDescEmboss\"]'),\n embossLine1 = paramObj && paramObj.embossLine1 ? paramObj.embossLine1 : '',\n embossingHasDots = paramObj && paramObj.embossingHasDots ? paramObj.embossingHasDots : '';\n\n if (embossLine1) {\n pdpEmbossBtn.addClass('vasTextButton');\n\n if (embossingHasDots == 'true') {\n embossLine1 = embossLine1.split('').join('.');\n }\n\n let embossDesc = embossLine1;\n\n pdpEmbossDescEle.text(embossDesc).addClass('uppercase');\n\n this.initRemoveBtn(VASDescContainerEmboss, paramObj, removeParamNameArray, widget3DParams);\n } else {\n this.removePersonalisedData({container: VASDescContainerEmboss, paramObj: paramObj, removeParamNameArray: removeParamNameArray});\n }\n },\n\n unSelectStrapColor: function(params) {\n let container = params && params.data ? params.data.container : params.container;\n\n if (container) {\n let productContainer = getProductContainer(container);\n $(productContainer).find('a[data-static-option-id].toggle--active').removeClass('toggle--active');\n }\n },\n\n changeStrapColorBtnDesc: function(paramObj) {\n let descContainerStrapColor = $('[data-product-personalisation=\"descContainerStrapColor\"]'),\n removeParamNameArray = [ 'strapOption', 'strapColorName' ],\n removeBtn = $(descContainerStrapColor).find('[data-product-personalisation=\"remove\"]'),\n strapId = removeBtn && removeBtn[0] ? removeBtn.data('default-strap-id') : '',\n widget3DParams = [ {strapId: strapId} ];\n\n if (!descContainerStrapColor.length || !paramObj || !paramObj.strapOption) {\n this.removePersonalisedData({container: descContainerStrapColor, paramObj: paramObj, removeParamNameArray: removeParamNameArray});\n return false;\n }\n\n let pdpDescStrapColorEle = $('[data-product-personalisation=\"VASDescStrapColor\"]'),\n strapColorName = paramObj && paramObj.strapColorName ? paramObj.strapColorName : '';\n\n if (strapColorName) {\n pdpDescStrapColorEle.text(strapColorName);\n this.initRemoveBtn(descContainerStrapColor, paramObj, removeParamNameArray, widget3DParams, this.unSelectStrapColor);\n } else {\n this.removePersonalisedData({container: descContainerStrapColor, paramObj: paramObj, removeParamNameArray: removeParamNameArray});\n }\n },\n\n changeEngravePdpBtnDesc: function(paramObj) {\n let VASDescContainerEngrav = $('[data-product-personalisation=\"VASDescContainerEngrav\"]'),\n removeParamNameArray = [ 'engrav', 'hasEngrav', 'engravLine1', 'engravLine2', 'engravMessageFont', 'noReturnPolicyAcknowledged' ],\n widget3DParams = [ {engravingMsg_1: ''}, {engravingMsg_2: ''}, {view: 'DEFAULT'} ];\n\n if (!VASDescContainerEngrav.length || !paramObj || !paramObj.hasEngrav || paramObj.hasEngrav == 'false') {\n this.removePersonalisedData({container: VASDescContainerEngrav, paramObj: paramObj, removeParamNameArray: removeParamNameArray});\n return false;\n }\n\n let pdpEngravBtn = $('[data-product-personalisation=\"VASBtnEngrav\"]'),\n pdpEngravDescEle = $('[data-product-personalisation=\"VASDescEngrav\"]'),\n engravLine1 = paramObj && paramObj.engravLine1 ? paramObj.engravLine1 : '',\n engravLine2 = paramObj && paramObj.engravLine2 ? paramObj.engravLine2 : '';\n\n if (engravLine1) {\n let engraveDesc = engravLine1;\n engraveDesc += engravLine2 ? ' | ' + engravLine2 : '';\n pdpEngravBtn.addClass('vasTextButton');\n pdpEngravDescEle.text(engraveDesc);\n this.initRemoveBtn(VASDescContainerEngrav, paramObj, removeParamNameArray, widget3DParams);\n } else {\n this.removePersonalisedData({container: VASDescContainerEngrav, paramObj: paramObj, removeParamNameArray: removeParamNameArray});\n }\n },\n\n changeBraceletAdjPdpBtnDesc: function(paramObj) {\n let VASDescContainerBraceletAdj = $('[data-product-personalisation=\"VASDescContainerBraceletAdj\"]'),\n removeParamNameArray = [ 'braceletAdjustment', 'hasBraceletAdjustment', 'braceletAdjustmentWristSize', 'braceletAdjustmentFit' ];\n\n if (!VASDescContainerBraceletAdj.length || !paramObj || !paramObj.hasBraceletAdjustment || paramObj.hasBraceletAdjustment == 'false') {\n this.removePersonalisedData({container: VASDescContainerBraceletAdj, paramObj: paramObj, removeParamNameArray: removeParamNameArray});\n return false;\n }\n\n let pdpbraceletAdjBtn = $('[data-product-personalisation=\"VASBtnBraceletAdj\"]'),\n pdpBraceletAdjDescEle = $('[data-product-personalisation=\"VASDescBraceletAdj\"]'),\n braceletAdjustmentWristSize = paramObj && paramObj.braceletAdjustmentWristSize ? paramObj.braceletAdjustmentWristSize : '',\n braceletAdjustmentFit = paramObj && paramObj.braceletAdjustmentFit ? paramObj.braceletAdjustmentFit : '',\n adjDesc = braceletAdjustmentWristSize + ' ' + braceletAdjustmentFit,\n adjFitDisplay = paramObj.selectedFitName ? paramObj.selectedFitName : braceletAdjustmentFit;\n\n if (adjDesc) {\n pdpbraceletAdjBtn.addClass('vasTextButton');\n pdpBraceletAdjDescEle.text(adjFitDisplay).addClass('text-transform--capitalize');\n this.initRemoveBtn(VASDescContainerBraceletAdj, paramObj, removeParamNameArray);\n } else {\n this.removePersonalisedData({container: VASDescContainerBraceletAdj, paramObj: paramObj, removeParamNameArray: removeParamNameArray});\n }\n },\n\n modifyVASBtnsDesc: function() {\n let paramObj = getQueryStringParams(window.location.search, null);\n\n this.changeEngravePdpBtnDesc(paramObj);\n this.changeEmbossPdpBtnDesc(paramObj);\n this.changeBraceletAdjPdpBtnDesc(paramObj);\n this.changeStrapColorBtnDesc(paramObj);\n },\n\n initChooseColorBackToPdp: function() {\n let backToProductBtn = document.querySelector('[data-choose-color-back-to-product=\"back-to-product\"]');\n\n if (backToProductBtn && backToProductBtn != null) {\n backToProductBtn.addEventListener('click', function() {\n chooseColorBackToPdp();\n });\n }\n },\n initRefillPersonalization: function() {\n let addRefillButton = document.querySelector('.product-addrefill__button');\n var VASBtnEmboss = document.querySelector('[data-product-personalisation=\"VASBtnEmboss\"]');\n var VASBtnEngrav = document.querySelector('[data-product-personalisation=\"VASBtnEngrav\"]');\n if (addRefillButton && addRefillButton.getAttribute('data-pid') != '') {\n $('.product-addrefill__button').css('opacity', '0.5');\n $('.product-attribute--engrav').css('opacity', '0.5');\n document.querySelector('.product-addrefill__button').addEventListener('mouseenter', function() {\n $('.product-addrefill__button').css('opacity', 1);\n });\n document.querySelector('.product-addrefill__button').addEventListener('mouseleave', function() {\n $('.product-addrefill__button').css('opacity', 0.5);\n });\n if (VASBtnEmboss) {\n VASBtnEmboss.addEventListener('mouseenter', function() {\n $('.product-attribute--emboss').css('opacity', '1');\n let disablePersonalisation = document.querySelector('.disable--personalisation');\n let refillContainer = document.querySelector('[data-product-component=\"selected-refills\"]');\n let refillId = refillContainer && refillContainer.firstElementChild ? refillContainer.firstElementChild.getAttribute('data-sel-refillid') : '';\n if (disablePersonalisation == null) {\n if (!refillId) {\n $('.value__emboss').css('display', 'none'); // Hide the engrave text\n $('.value__emboss__select-refill').removeClass('hidden'); // Show the refill text\n $('.personalisation__container').css('cursor', 'default');\n $('.personalisation__arrow').css('cursor', 'default');\n } else {\n $('.value__emboss').css('display', 'block');\n $('.value__emboss__select-refill').addClass('hidden');\n $('.personalisation__container').css('cursor', 'pointer');\n }\n } else if (disablePersonalisation) {\n let hideButton = document.querySelector('.hide-select-size');\n let sizeAttr = document.querySelector('.product-attribute__size');\n let isRefillSelected = false;\n if (hideButton && sizeAttr) {\n if (sizeAttr.getAttribute('data-selected-size') === null || sizeAttr.getAttribute('data-selected-size') === '') {\n if (isVariationSelected(sizeAttr)) {\n isRefillSelected = true;\n }\n } else if ((sizeAttr.getAttribute('data-selected-size') !== null && sizeAttr.getAttribute('data-selected-size') !== '')) {\n isRefillSelected = true;\n }\n } else if (hideButton == null && sizeAttr) {\n if (isVariationSelected(sizeAttr)) {\n isRefillSelected = true;\n }\n } else if (sizeAttr == null) {\n isRefillSelected = true;\n }\n $('.value__emboss').css('display', 'block');\n $('.value__emboss__select-refill').addClass('hidden');\n $('.personalisation__container').css('cursor', 'pointer');\n\n if (isRefillSelected && !refillId) {\n $('.value__emboss').css('display', 'none');\n $('.value__emboss__select-refill').removeClass('hidden');\n }\n }\n });\n VASBtnEmboss.addEventListener('mouseleave', function() {\n if (addRefillButton) {\n $('.product-attribute--emboss').css('opacity', '0.5');\n let refillContainer = document.querySelector('[data-product-component=\"selected-refills\"]');\n let refillId = refillContainer && refillContainer.firstElementChild ? refillContainer.firstElementChild.getAttribute('data-sel-refillid') : '';\n let variationAttr = document.querySelector('.product-attribute__size');\n if (!refillId || (refillId && variationAttr && (variationAttr.getAttribute('data-selected-size') === null || variationAttr.getAttribute('data-selected-size') === ''))) {\n $('.value__emboss').css('display', 'block'); // Show the engrave text\n $('.value__emboss__select-refill').addClass('hidden'); // Hide the refill text\n $('.personalisation__container').css('cursor', 'pointer');\n if (!refillId) {\n $('.product-addrefill__button').css('opacity', '0.5');\n }\n }\n }\n });\n }\n if (VASBtnEngrav) {\n VASBtnEngrav.addEventListener('mouseenter', function() {\n $('.product-attribute--engrav').css('opacity', '1');\n let disablePersonalisation = document.querySelector('.disable--personalisation');\n var refillContainer = document.querySelector('[data-product-component=\"selected-refills\"]');\n let refillId = refillContainer && refillContainer.firstElementChild ? refillContainer.firstElementChild.getAttribute('data-sel-refillid') : '';\n if (disablePersonalisation == null) {\n $('.personalisation__container').css('cursor', 'default');\n if (!refillId) {\n $('.value__engrave').css('display', 'none'); // Hide the engrave text\n $('.value__select-refill').css('display', 'block'); // Show the refill text\n $('.personalisation__arrow').css('cursor', 'default');\n } else {\n $('.value__engrave').css('display', 'block');\n $('.value__select-refill').css('display', 'none');\n }\n } else if (disablePersonalisation) {\n let hideButton = document.querySelector('.hide-select-size');\n let sizeAttr = document.querySelector('.product-attribute__size');\n let isRefillSelected = false;\n if (hideButton && sizeAttr) {\n if (sizeAttr.getAttribute('data-selected-size') === null || sizeAttr.getAttribute('data-selected-size') === '') {\n if (isVariationSelected(sizeAttr)) {\n isRefillSelected = true;\n }\n } else if ((sizeAttr.getAttribute('data-selected-size') !== null && sizeAttr.getAttribute('data-selected-size') !== '')) {\n isRefillSelected = true;\n }\n } else if (hideButton == null && sizeAttr) {\n if (isVariationSelected(sizeAttr)) {\n isRefillSelected = true;\n }\n } else if (sizeAttr == null) {\n isRefillSelected = true;\n }\n $('.value__engrave').css('display', 'none');\n $('.value__select-refill').css('display', 'none');\n $('.personalisation__container').css('cursor', 'pointer');\n if (isRefillSelected && !refillId) {\n $('.value__select-refill').css('display', 'block');\n } else if (isRefillSelected && refillId) {\n $('.value__engrave').css('display', 'block');\n }\n }\n });\n VASBtnEngrav.addEventListener('mouseleave', function() {\n if (addRefillButton) {\n $('.product-attribute--engrav').css('opacity', '0.5');\n let refillContainer = document.querySelector('[data-product-component=\"selected-refills\"]');\n let refillId = refillContainer && refillContainer.firstElementChild ? refillContainer.firstElementChild.getAttribute('data-sel-refillid') : '';\n let variationAttr = document.querySelector('.product-attribute__size');\n if (!refillId || (refillId && variationAttr && (variationAttr.getAttribute('data-selected-size') === null || variationAttr.getAttribute('data-selected-size') === ''))) {\n $('.value__engrave').css('display', 'block'); // Show the engrave text\n $('.value__select-refill').css('display', 'none'); // Hide the refill text\n $('.personalisation__container').css('cursor', 'pointer');\n if (!refillId) {\n $('.product-addrefill__button').css('opacity', '0.5');\n }\n }\n }\n });\n }\n } else {\n if (VASBtnEngrav) {\n VASBtnEngrav.addEventListener('mouseenter', function() {\n let disablePersonalisation = document.querySelector('.disable--personalisation');\n if (disablePersonalisation) {\n $('.value__engrave').css('display', 'none');\n } else {\n $('.value__engrave').css('display', 'block');\n }\n });\n VASBtnEngrav.addEventListener('mouseleave', function() {\n $('.value__engrave').css('display', 'block');\n });\n }\n if (VASBtnEmboss) {\n VASBtnEmboss.addEventListener('mouseenter', function() {\n let disablePersonalisation = document.querySelector('.disable--personalisation');\n if (disablePersonalisation) {\n $('.value__emboss').css('display', 'none');\n } else {\n $('.value__emboss').css('display', 'block');\n }\n });\n VASBtnEmboss.addEventListener('mouseleave', function() {\n $('.value__emboss').css('display', 'block');\n });\n }\n }\n },\n\n init: function() {\n this.initRefillPersonalization();\n this.updateVASData();\n this.initEngravBtn();\n this.initEmbossBtn();\n this.initBraceletAdjustmentBtn();\n this.initStrapColorBtn();\n this.initAddStrapBtn();\n this.initChooseColorBackToPdp();\n this.intHowToChangeStrap();\n }\n}\n\nexport var personalisationModalInit = personalisationModal.init();\n"],"sourceRoot":""}