{"version":3,"sources":["webpack:///./node_modules/js-cookie/src/js.cookie.js","webpack:///./assets/javascripts/modules/utils/ChatUtils.js"],"names":["__WEBPACK_AMD_DEFINE_FACTORY__","__WEBPACK_AMD_DEFINE_RESULT__","factory","undefined","call","exports","__webpack_require__","module","OldCookies","window","Cookies","api","noConflict","extend","i","result","arguments","length","attributes","key","init","converter","value","document","path","defaults","expires","Date","setMilliseconds","getMilliseconds","toUTCString","JSON","stringify","test","e","write","encodeURIComponent","String","replace","decodeURIComponent","escape","stringifiedAttributes","attributeName","cookie","cookies","split","rdecode","parts","slice","join","this","json","charAt","name","read","parse","set","get","getJSON","apply","remove","withConverter","ChatUtils","_classCallCheck","TrackingComponent","options","defaultSelectors","SELECTORS","selectors","allSelectors","Object","assign","hasOwnProperty","setValue","cookieKey","hideCookieKey","labelName","noValue","selector","querySelector","toRet","tagName","toLowerCase","property","ctx","gslbBaseURL","embedded_svc","settings","displayHelpButton","language","liveChatLanguage","directToButtonRouting","prechatFormData","fallbackRouting","personalStylistSnapConfig","buttonIdSnapIn","country","dataset","website","toUpperCase","prechatFields","Primary_Language__c","Country__c","website_iso_country_code__c","LiveChat_Brand__c","chatBrand","LiveChat_Path1__c","location","href","readCookie","COOKIE_CONSTANTS","PATH_1","LiveChat_Path2__c","PATH_2","LiveChat_Path3__c","PATH_3","LiveChat_Path4__c","PATH_4","LiveChat_Path5__c","PATH_5","customerLoggedIn","FirstName","customerFirstName","LastName","customerLastName","Email","customerEmail","prepopulatedPrechatFields","defaultAssistiveText","defaultMinimizedText","chatLabelOnline","disabledMinimizedText","chatLabelOffline","enabledFeatures","entryFeature","addEventHandler","data","eventName","isAgentAvailable","evt","createEvent","initEvent","dispatchEvent","actions","deleteChat","personalStylistBanner","classList","contains","initializeChat","urlEnvironmentSF","urlEnvironmentSnapIn","chatOrgId","buttonNameSnapIn","baseLiveAgentContentURL","deploymentId","deploymentIdSnapIn","buttonId","baseLiveAgentURL","eswLiveAgentDevName","isOfflineSupportEnabled","initESW","pathName","pathname","shiftPathCookies","writeCookie","observer","MutationObserver","records","forEach","record","list","addedNodes","_typeof","nodeType","getAttribute","classes","includes","add","startButton","bindPSChat","prechatObserver","exitChatBtn","applyArrowDownStyles","chatEnding","sizeNode","observe","childList","subtree","div","manipulatePrechat","errorPrechat","chatDock","chatButton","startBtns","querySelectorAll","startChatLink","startBtn","fieldList","chatLabelStart","chatLabelStartDiv","createElement","innerHTML","insertBefore","firstChild","overrideLabels","hidePrechatFields","firstName","lastName","setAttribute","createSubjectSelect","createPrivacyCheckbox","createStartButton","applyPreChatStyle","chatLabelName","closest","chatLabelLastname","chatLabelEmail","chatLabelSubject","preselSubject","chatPreselectedSubject","hidingFields","#LiveChat_Path1__c","#LiveChat_Path2__c","#LiveChat_Path3__c","#LiveChat_Path4__c","#LiveChat_Path5__c","#LiveChat_Brand__c","#website_iso_country_code__c","#Country__c","#Primary_Language__c","#Type","#Subject","#LiveChat_Subject__c","element","subjectDiv","selectDiv","selectDivLabel","append","subjectSelect","subjectClassesDefault","subjectClasses","classArr","Array","isArray","cls","subjects","Option","targetSelect","addEventListener","checkboxDiv","checkbox","label","chatLabelPrivacy","fakeSubmit","ctaClassesDefault","ctaClasses","chatLabelCTA","buttonWrapper","bindStartChat","click","btn","setIntervalBtn","setInterval","style","width","clearInterval","startAlternativeButton","self","personalStylistPopUpReappearanceTime","myInterval","console","log","_this","fakeBtn","privacyInput","checked","checkForm","startChat","color","target","preventDefault","stopPropagation","removeEventListener","el","previousElementSibling","pass","fields","#FirstName","type","#LastName","fieldName","input","push","cleanFieldError","setFieldError","emailInput","subjectInput","inputBox","chatLabelLengthError","errorUl","errorLi","appendChild","errorBox","applyElStyle","element2","shadowRoot","styleID","styleSourceDiv","innerText","styleDiv","trim","shadowDomEl","constructor","endChatContainer","endChatMessage","endChatText","endChatContent","cloneNode","downloadBtn","saveBtn","display","deleteChatBtn","_this2","closeBtn","personalStylistCloseBtn","isFaqPage","$","setupPersonalStylistDelayedPopup","personalStylistPopUpTriggerTime","setExpires","checkReappearancePersonalStylistPopUp","exp","now","expireTime","getTime","Number","setTime","triggerIn","_this3","personalStylistStartChat","chatLabelSubjectOptionPS","setTimeout","personalStylistStartWhatsApp","obj","index","temp","prop","chatLabelSubjectOptionOD","chatLabelSubjectOptionPay","chatLabelSubjectOptionFi","chatLabelSubjectOptionCS","chatLabelSubjectOptionPAv","chatLabelSubjectOptionSt","chatLabelSubjectOptionRR","chatLabelSubjectOptionTA","SIZE","PATH","cookieName","start","indexOf","end","unescape","substring","cookieValue","__webpack_exports__"],"mappings":"kFAAA,IAAAA,EAAAC,GAOC,SAAAC,GAUD,QAPgBC,KAAAF,EAAA,mBAAdD,EAAA,GAAcA,EAAAI,KAAAC,EAAAC,EAAAD,EAAAE,GAAAP,KAAAO,EAAAF,QAAAJ,IAChB,EAGAM,EAAAF,QAAAH,MACA,EAEA,CACA,IAAAM,EAAAC,OAAAC,QACAC,EAAAF,OAAAC,QAAAR,IACAS,EAAAC,WAAA,WAEA,OADAH,OAAAC,QAAAF,EACAG,IAfC,CAkBA,WACD,SAAAE,IAGA,IAFA,IAAAC,EAAA,EACAC,KACQD,EAAAE,UAAAC,OAAsBH,IAAA,CAC9B,IAAAI,EAAAF,UAAAF,GACA,QAAAK,KAAAD,EACAH,EAAAI,GAAAD,EAAAC,GAGA,OAAAJ,EAgIA,OA7HA,SAAAK,EAAAC,GACA,SAAAV,EAAAQ,EAAAG,EAAAJ,GACA,IAAAH,EACA,uBAAAQ,SAAA,CAMA,GAAAP,UAAAC,OAAA,GAKA,oBAJAC,EAAAL,GACAW,KAAA,KACKb,EAAAc,SAAAP,IAELQ,QAAA,CACA,IAAAA,EAAA,IAAAC,KACAD,EAAAE,gBAAAF,EAAAG,kBAAA,MAAAX,EAAAQ,SACAR,EAAAQ,UAIAR,EAAAQ,QAAAR,EAAAQ,QAAAR,EAAAQ,QAAAI,cAAA,GAEA,IACAf,EAAAgB,KAAAC,UAAAV,GACA,UAAcW,KAAAlB,KACdO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GAC7BpV,SAASoB,OAAS0T,EAAa,IAAM7T,OAAOmU,GAAe,6DA/B3D,OACER,KAAM,EACNC,KAAM,OACNrP,OAAQ,QACRE,OAAQ,QACRE,OAAQ,QACRE,OAAQ,QACRE,OAAQ,kBA+1BCqP,EAAA,MAAI9S","file":"components-ChatComponent~components-LiveChatTriggerComponent.chunks.js","sourcesContent":["/*!\n * JavaScript Cookie v2.2.0\n * https://github.com/js-cookie/js-cookie\n *\n * Copyright 2006, 2015 Klaus Hartl & Fagner Brack\n * Released under the MIT license\n */\n;(function (factory) {\n\tvar registeredInModuleLoader = false;\n\tif (typeof define === 'function' && define.amd) {\n\t\tdefine(factory);\n\t\tregisteredInModuleLoader = true;\n\t}\n\tif (typeof exports === 'object') {\n\t\tmodule.exports = factory();\n\t\tregisteredInModuleLoader = true;\n\t}\n\tif (!registeredInModuleLoader) {\n\t\tvar OldCookies = window.Cookies;\n\t\tvar api = window.Cookies = factory();\n\t\tapi.noConflict = function () {\n\t\t\twindow.Cookies = OldCookies;\n\t\t\treturn api;\n\t\t};\n\t}\n}(function () {\n\tfunction extend () {\n\t\tvar i = 0;\n\t\tvar result = {};\n\t\tfor (; i < arguments.length; i++) {\n\t\t\tvar attributes = arguments[ i ];\n\t\t\tfor (var key in attributes) {\n\t\t\t\tresult[key] = attributes[key];\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tfunction init (converter) {\n\t\tfunction api (key, value, attributes) {\n\t\t\tvar result;\n\t\t\tif (typeof document === 'undefined') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Write\n\n\t\t\tif (arguments.length > 1) {\n\t\t\t\tattributes = extend({\n\t\t\t\t\tpath: '/'\n\t\t\t\t}, api.defaults, attributes);\n\n\t\t\t\tif (typeof attributes.expires === 'number') {\n\t\t\t\t\tvar expires = new Date();\n\t\t\t\t\texpires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5);\n\t\t\t\t\tattributes.expires = expires;\n\t\t\t\t}\n\n\t\t\t\t// We're using \"expires\" because \"max-age\" is not supported by IE\n\t\t\t\tattributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';\n\n\t\t\t\ttry {\n\t\t\t\t\tresult = JSON.stringify(value);\n\t\t\t\t\tif (/^[\\{\\[]/.test(result)) {\n\t\t\t\t\t\tvalue = result;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {}\n\n\t\t\t\tif (!converter.write) {\n\t\t\t\t\tvalue = encodeURIComponent(String(value))\n\t\t\t\t\t\t.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);\n\t\t\t\t} else {\n\t\t\t\t\tvalue = converter.write(value, key);\n\t\t\t\t}\n\n\t\t\t\tkey = encodeURIComponent(String(key));\n\t\t\t\tkey = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent);\n\t\t\t\tkey = key.replace(/[\\(\\)]/g, escape);\n\n\t\t\t\tvar stringifiedAttributes = '';\n\n\t\t\t\tfor (var attributeName in attributes) {\n\t\t\t\t\tif (!attributes[attributeName]) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tstringifiedAttributes += '; ' + attributeName;\n\t\t\t\t\tif (attributes[attributeName] === true) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tstringifiedAttributes += '=' + attributes[attributeName];\n\t\t\t\t}\n\t\t\t\treturn (document.cookie = key + '=' + value + stringifiedAttributes);\n\t\t\t}\n\n\t\t\t// Read\n\n\t\t\tif (!key) {\n\t\t\t\tresult = {};\n\t\t\t}\n\n\t\t\t// To prevent the for loop in the first place assign an empty array\n\t\t\t// in case there are no cookies at all. Also prevents odd result when\n\t\t\t// calling \"get()\"\n\t\t\tvar cookies = document.cookie ? document.cookie.split('; ') : [];\n\t\t\tvar rdecode = /(%[0-9A-Z]{2})+/g;\n\t\t\tvar i = 0;\n\n\t\t\tfor (; i < cookies.length; i++) {\n\t\t\t\tvar parts = cookies[i].split('=');\n\t\t\t\tvar cookie = parts.slice(1).join('=');\n\n\t\t\t\tif (!this.json && cookie.charAt(0) === '\"') {\n\t\t\t\t\tcookie = cookie.slice(1, -1);\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tvar name = parts[0].replace(rdecode, decodeURIComponent);\n\t\t\t\t\tcookie = converter.read ?\n\t\t\t\t\t\tconverter.read(cookie, name) : converter(cookie, name) ||\n\t\t\t\t\t\tcookie.replace(rdecode, decodeURIComponent);\n\n\t\t\t\t\tif (this.json) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcookie = JSON.parse(cookie);\n\t\t\t\t\t\t} catch (e) {}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (key === name) {\n\t\t\t\t\t\tresult = cookie;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!key) {\n\t\t\t\t\t\tresult[name] = cookie;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {}\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\tapi.set = api;\n\t\tapi.get = function (key) {\n\t\t\treturn api.call(api, key);\n\t\t};\n\t\tapi.getJSON = function () {\n\t\t\treturn api.apply({\n\t\t\t\tjson: true\n\t\t\t}, [].slice.call(arguments));\n\t\t};\n\t\tapi.defaults = {};\n\n\t\tapi.remove = function (key, attributes) {\n\t\t\tapi(key, '', extend(attributes, {\n\t\t\t\texpires: -1\n\t\t\t}));\n\t\t};\n\n\t\tapi.withConverter = init;\n\n\t\treturn api;\n\t}\n\n\treturn init(function () {});\n}));\n","/**\n * This utility class helps to manage the live chat\n */\nimport Cookies from 'js-cookie';\nimport TrackingComponent from '../components/TrackingComponent';\n\nclass ChatUtils {\n\n  constructor() {\n    this.TrackingComponent = new TrackingComponent();\n  }\n  // common selectors, overridable\n  get SELECTORS() {\n    return {\n      // configs\n      liveChatLanguage: '#liveChatLanguage', // live chat language\n      urlEnvironmentSF: '#urlEnvironmentSF', // main url\n      urlEnvironmentSnapIn: '#urlEnvironmentSnapIn', // snap in url\n      chatOrgId: '#chatOrgId', // salesforce id of MM\n      buttonNameSnapIn: '#buttonNameSnapIn', // button name\n      buttonIdSnapIn: '#buttonIdSnapIn', // button name\n      baseLiveAgentContentURL: '#baseLiveAgentContentURL', // live agent url\n      deploymentIdSnapIn: '#deploymentIdSnapIn', // deployment id\n      baseLiveAgentURL: '#baseLiveAgentURL', // base live agent url\n      eswLiveAgentDevName: '#eswLiveAgentDevName', // base live agent url\n      chatBrand: '#chatBrand', // brand\n      // labels\n      chatLabelOnline: '#chatLabelOnline', // chat label when online\n      chatLabelOffline: '#chatLabelOffline', // chat label when offline\n      chatLabelStart: '#chatLabelStart', // chat label start\n      chatLabelName: '#chatLabelName', // chat label name\n      chatLabelLastname: '#chatLabelLastname', // chat label name\n      chatLabelEmail: '#chatLabelEmail', // chat label name\n      chatLabelSubject: '#chatLabelSubject', // chat label subject\n      chatLabelPrivacy: '#chatLabelPrivacy', // chat label subject\n      chatLabelSubjectOptionPS: '#chatLabelSubjectOptionPS', // chat label subject\n      chatLabelSubjectOptionOD: '#chatLabelSubjectOptionOD', // chat label subject\n      chatLabelSubjectOptionPay: '#chatLabelSubjectOptionPay', // chat label subject\n      chatLabelSubjectOptionFi: '#chatLabelSubjectOptionFi', // chat label subject\n      chatLabelSubjectOptionCS: '#chatLabelSubjectOptionCS', // chat label subject\n      chatLabelSubjectOptionPAv: '#chatLabelSubjectOptionPAv', // chat label subject\n      chatLabelSubjectOptionSt: '#chatLabelSubjectOptionSt', // chat label subject\n      chatLabelSubjectOptionRR: '#chatLabelSubjectOptionRR', // chat label subject\n      chatLabelSubjectOptionTA: '#chatLabelSubjectOptionTA', // chat label subject\n      chatPreselectedSubject: '#chatPreselectedSubject', // chat preselected subject\n      chatLabelCTA: '#chatLabelCTA', // chat label subject\n      chatLabelLengthError: '#chatLabelLengthError', // chat label subject\n      // elements\n      chatDock: '.modalContainer.embeddedServiceSidebar.layout-docked.sidebarMaximized .dockableContainer',\n      chatButton: '.livechat-button .uiButton',\n      endChatMessage: '.embeddedServiceLiveAgentStateChat .messageArea',\n      endChatContainer: '.embeddedServiceLiveAgentStateChat .endChatContainer',\n      endChatContent: '#thank-you-feedback',\n      // PS ?\n      personalStylistSnapConfig: '#buttonSnapConfig_personal_stylist',\n      personalStylistPopUpTriggerTime: '#personalStylistPopUpTriggerTime',\n      personalStylistPopUpReappearanceTime: '#personalStylistPopUpReappearanceTime',\n      personalStylistBanner: '.live-chat-personal-stylist-cta',\n      personalStylistStartChat: '.live-chat-personal-stylist-cta .start-chat',\n      personalStylistStartWhatsApp: '.live-chat-personal-stylist-cta .start-whatsapp',\n      personalStylistCloseBtn: '.live-chat-personal-stylist-cta .vex-close',\n      customerLoggedIn: '#customerLoggedIn',\n      customerFirstName: '#customerFirstName',\n      customerLastName: '#customerLastName',\n      customerEmail: '#customerEmail',\n      // extra link chat\n      startChatLink: 'a[data-name=live-chat]',\n    }\n  }\n\n  setEnvironment(options = false) {\n    // all default selectors\n    var defaultSelectors = this.SELECTORS;\n    // merge def selectors with override\n    if (typeof options.selectors !== 'undefined') {\n      // var allSelectors = Object.assign(options.selectors,defaultSelectors);\n      var allSelectors = Object.assign(defaultSelectors,options.selectors);\n    } else {\n      // or default assign\n      var allSelectors = defaultSelectors;\n    }\n    // loop the selectors to make them available\n    for (const key in allSelectors) {\n      if (allSelectors.hasOwnProperty(key)) {\n        // console.log(`${key}: ${allSelectors[key]}`);\n        // set value\n        this[key] = this.setValue(key,allSelectors);\n      }\n    }\n    // set the options available\n    if (typeof options !== 'undefined') {\n      this.options = options;\n    }\n    // cookie key\n    if (typeof options.cookieKey === 'undefined') {\n      this.hideCookieKey = 'ps_button_hide';\n      this.options.cookieKey = 'ps_button_hide';\n    } else {\n      this.hideCookieKey = this.options.cookieKey;\n    }\n  }\n\n  /////////////////////////\n  /*  GENERAL FUNCTIONS  */\n  /////////////////////////\n\n  // set value from selectors key\n  setValue(labelName,allSelectors,noValue = null) {\n    var selector = allSelectors[labelName];\n    if (document.querySelector(selector) != null) {\n      var toRet = document.querySelector(selector).value;\n      // but if is not an input i want to return the selector\n      if (typeof toRet == 'undefined' && document.querySelector(selector).tagName.toLowerCase() != 'input') {\n        toRet = document.querySelector(selector);\n      }\n    } else {\n      toRet = noValue;\n    }\n    //\n    return toRet;\n  }\n\n  // return a value of selectors\n  getValue(property) {\n    return this.setValue(property,this.SELECTORS);\n  }\n\n  /////////////////////////\n  /*       CHAT PART     */\n  /////////////////////////\n\n  // initiate the chat\n  initializeChat(ps = false) {\n    // this\n    var ctx = this;\n    // big config chunk for salesforce\n    var initESW = function(gslbBaseURL) {\n      // body for data\n      var body = document.querySelector('body');\n      // help btn\n      embedded_svc.settings.displayHelpButton = true;\n      // language conf fallback to en\n      var language = (ctx.liveChatLanguage != '') ? ctx.liveChatLanguage : 'en';\n      embedded_svc.settings.language = language;\n      // directbutton routing on select subject\n      embedded_svc.settings.directToButtonRouting = function(prechatFormData) {\n        // subject is the fourth field on prechat list form\n        if (prechatFormData[3].value == \"Personal Stylist\") {\n          embedded_svc.settings.fallbackRouting = [ctx.personalStylistSnapConfig,ctx.buttonIdSnapIn];\n          return ctx.personalStylistSnapConfig;\n        } else {\n          return ctx.buttonIdSnapIn;\n        }\n      }\n      // country\n      var country = document.querySelector('body').dataset.website != null ? document.querySelector('body').dataset.website.toUpperCase() : \"\";\n      // prechat fields\n      var prechatFields = {\n        Primary_Language__c: language.toUpperCase(),\n        Country__c: country,\n        website_iso_country_code__c: country,\n        LiveChat_Brand__c: ctx.chatBrand,\n        LiveChat_Path1__c: window.location.href.slice(0, -1)+ChatUtils.readCookie(ChatUtils.COOKIE_CONSTANTS.PATH_1),\n        LiveChat_Path2__c: window.location.href.slice(0, -1)+ChatUtils.readCookie(ChatUtils.COOKIE_CONSTANTS.PATH_2),\n        LiveChat_Path3__c: window.location.href.slice(0, -1)+ChatUtils.readCookie(ChatUtils.COOKIE_CONSTANTS.PATH_3),\n        LiveChat_Path4__c: window.location.href.slice(0, -1)+ChatUtils.readCookie(ChatUtils.COOKIE_CONSTANTS.PATH_4),\n        LiveChat_Path5__c: window.location.href.slice(0, -1)+ChatUtils.readCookie(ChatUtils.COOKIE_CONSTANTS.PATH_5),\n      };\n      // if is registered user i should update the routing\n      if(ctx.customerLoggedIn === 'true') {\n        // adding prechat fields\n    \tprechatFields.FirstName = ctx.customerFirstName;\n        prechatFields.LastName = ctx.customerLastName;\n        prechatFields.Email = ctx.customerEmail;\n      }\n      // fill prechat fields\n      embedded_svc.settings.prepopulatedPrechatFields = prechatFields;\n      // labels\n      embedded_svc.settings.defaultAssistiveText = '';\n      embedded_svc.settings.defaultMinimizedText = ctx.chatLabelOnline; // (Defaults to Chat with an Expert)\n      embedded_svc.settings.disabledMinimizedText = ctx.chatLabelOffline; // (Defaults to Agent Offline)\n      //\n      embedded_svc.settings.enabledFeatures = ['LiveAgent'];\n      embedded_svc.settings.entryFeature = 'LiveAgent';\n      // on off button\n      embedded_svc.addEventHandler('onAvailability', function(data) {\n        var eventName = (data.isAgentAvailable) ? 'chatButtonEnabled' : 'chatButtonDisabled';\n        var evt = document.createEvent(\"Events\");\n        evt.initEvent(eventName, true, true);\n        document.dispatchEvent(evt);\n      });\n      embedded_svc.addEventHandler(\"onSettingsCallCompleted\", function(data) {\n        var eventName = data.isAgentAvailable ? 'chatButtonEnabled' : 'chatButtonDisabled';\n        var evt = document.createEvent(\"Events\");\n        evt.initEvent(eventName, true, true);\n        document.dispatchEvent(evt);\n      });\n\n      // on chat ended by user\n      embedded_svc.addEventHandler(\"onChatEndedByChasitor\", function() {\n        ctx.TrackingComponent.actions.deleteChat();\n      });\n\n      // after chat is closedddd\n      embedded_svc.addEventHandler('afterDestroy', function() {\n        // if i used the PS chat\n        if (ctx.personalStylistBanner != null && ctx.personalStylistBanner.classList.contains('disappeared')) {\n          // i reinit at the destroy\n          ctx.initializeChat();\n        }\n      });\n      //\n      // console.log(embedded_svc.settings);\n      //\n      embedded_svc.init(\n        ctx.urlEnvironmentSF,\n        ctx.urlEnvironmentSnapIn,\n        gslbBaseURL,\n        ctx.chatOrgId,\n        ctx.buttonNameSnapIn,\n        {\n          baseLiveAgentContentURL: ctx.baseLiveAgentContentURL,\n          deploymentId: ctx.deploymentIdSnapIn,\n          buttonId: ctx.buttonIdSnapIn,\n          baseLiveAgentURL: ctx.baseLiveAgentURL,\n          eswLiveAgentDevName: ctx.eswLiveAgentDevName,\n          isOfflineSupportEnabled: false\n        }\n      );\n    };\n    // launch chat\n    initESW('https://service.force.com');\n  }\n\n  /////////////////////////\n  /*     COOKIES PART    */ /* legacy part */\n  /////////////////////////\n  // static\n  static get COOKIE_CONSTANTS(){\n    return {\n      SIZE: 5,\n      PATH: 'Path',\n      PATH_1: 'Path1',\n      PATH_2: 'Path2',\n      PATH_3: 'Path3',\n      PATH_4: 'Path4',\n      PATH_5: 'Path5',\n    }\n  }\n  static shiftPathCookies() {\n    for(var i = 0; i < ChatUtils.COOKIE_CONSTANTS.SIZE - 1; i++) {\n      ChatUtils.writeCookie(ChatUtils.COOKIE_CONSTANTS.PATH + (ChatUtils.COOKIE_CONSTANTS.SIZE - i), ChatUtils.readCookie(ChatUtils.COOKIE_CONSTANTS.PATH + (ChatUtils.COOKIE_CONSTANTS.SIZE - i - 1 )));\n    }\n  }\n  static readCookie(cookieName) {\n    if (document.cookie.length > 0) {\n      var start = document.cookie.indexOf(cookieName + \"=\");\n      if (start != -1) {\n        start = start + cookieName.length + 1;\n        var end = document.cookie.indexOf(\";\", start);\n        if (end == -1) end = document.cookie.length;\n        return unescape(document.cookie.substring(start, end));\n      }\n      else {\n        return \"\";\n      }\n    }\n    return \"\";\n  }\n  static writeCookie(cookieName, cookieValue) {\n    document.cookie = cookieName + '=' + escape(cookieValue) + '; path=/; secure;';\n  }\n  // non static\n  updatePath(){\n    var pathName = window.location.pathname;\n    if(pathName !== ChatUtils.readCookie(ChatUtils.COOKIE_CONSTANTS.PATH_1)) {\n      ChatUtils.shiftPathCookies();\n      ChatUtils.writeCookie(ChatUtils.COOKIE_CONSTANTS.PATH_1, pathName);\n    }\n  }\n\n  /////////////////////////\n  /*  CHAT MANIPULATION  */\n  /////////////////////////\n\n  //////////////////////////////////////////////////////////////////////////////////////////////////////\n  // OBSERVATION PART\n  // main button observer\n  runsNewChat(){\n    var ctx = this;\n    // Dynamic init of components to be loaded\n    var $this = this;\n    // observer listener\n    function listener(records) {\n      var nodes = [];\n      records.forEach(function (record) {\n        var list = record.addedNodes;\n        var i = list.length - 1;\n        for ( ; i > -1; i-- ) {\n          // if i find a new component\n          if ( typeof list[i] == 'object' && list[i].nodeType == '1') {\n            // if i find the chat button\n            if (list[i].getAttribute('class') !== null  ) {\n              var classes = list[i].getAttribute('class').split(' ');\n              if (list[i].getAttribute('class') == 'embeddedServiceHelpButton'  || classes.includes('embeddedServiceHelpButton') ) {\n                // chat button appears + add class\n                list[i].classList.add('livechat-button');\n                // bind button start prechat\n                ctx.startButton();\n                // Personal Stylist button\n                ctx.bindPSChat();\n              }\n              // if the prechat opens i launch another observer\n              if (classes.includes('modalContainer') && classes.includes('embeddedServiceSidebar') ) {\n                // when chat window is opened\n                ctx.prechatObserver(list[i]);\n              }\n              //add traking to delete chat\n              if (classes.includes('embeddedServiceSidebarFeature')) {\n                const exitChatBtn = list[i].querySelector('.embeddedServiceSidebarButton.dialog-button-0')\n                if ( typeof exitChatBtn != 'undefined' && exitChatBtn != null ) {\n                  ctx.deleteChat(exitChatBtn);\n                }\n              }\n              if (classes.includes('unseenMessageNotificationWrapper')) {\n                // shadow dom arrow check\n                ctx.applyArrowDownStyles();\n              }\n            }\n            if (list[i].getAttribute('class') == 'endChatContainer' ) {\n              // chat ending\n              ctx.chatEnding();\n            }\n          }\n        }\n      });\n    }\n    // define observer\n    var observer = new MutationObserver(listener);\n    // nodes to observe\n    var sizeNode = document.querySelector('body');\n    if ( typeof sizeNode != 'undefined' && sizeNode != null ) {\n      // loop to observe each node\n      observer.observe(sizeNode, { childList: true, subtree: true });\n    }\n  }\n\n  // prechat observer\n  prechatObserver(div) {\n    // Dynamic init of components to be loaded\n    var ctx = this;\n    // observer listener\n    function listener(records) {\n      var nodes = [];\n      records.forEach(function (record) {\n        var list = record.addedNodes;\n        var i = list.length - 1;\n        for ( ; i > -1; i-- ) {\n          // if i find a new component\n          if ( typeof list[i] == 'object' && list[i].nodeType == '1') {\n            // let's get the div\n            if (list[i].getAttribute('class') !== null  ) {\n              // if there is a certain class\n              var classes = list[i].getAttribute('class').split(' ');\n              if (classes.includes('prechatUI')) {\n                ctx.manipulatePrechat(div);\n              }\n              // error on sending chat\n              if (classes.includes('has-error')) {\n                ctx.errorPrechat(div,list[i]);\n                // add class on dockablecontainer\n                var container = document.querySelector(ctx.SELECTORS.chatDock);\n                container.classList.add('prechat');\n              }\n              // remove the class at the loader\n              if (classes.includes('loadingBallContainer')) {\n                // remove class on dockablecontainer\n                var container = document.querySelector(ctx.SELECTORS.chatDock);\n                container.classList.remove('prechat');\n              }\n            }\n          }\n        }\n      });\n    }\n    // define observer\n    var observer = new MutationObserver(listener);\n    // nodes to observe\n    var sizeNode = document.querySelector('.embeddedServiceSidebar');\n    if ( typeof sizeNode != 'undefined' && sizeNode != null ) {\n      // loop to observe each node\n      observer.observe(sizeNode, { childList: true, subtree: true });\n    }\n  }\n\n  //////////////////////////////////////////////////////////////////////////////////////////////////////\n  //  MANIPULATION PART\n\n  // maniupulate the prechat html\n  manipulatePrechat(div) {\n    // remove loading class on button\n    var btn = document.querySelector(this.SELECTORS.chatButton);\n    btn.classList.remove('loading');\n    // remove loading class on simualted buttons\n    let startBtns = document.querySelectorAll(this.SELECTORS.startChatLink);\n    if ( startBtns != null) {\n      startBtns.forEach(startBtn => {\n        startBtn.classList.remove('loading');\n      });\n    }\n\n    // add class on dockablecontainer\n    var container = document.querySelector(this.SELECTORS.chatDock);\n    container.classList.add('prechat');\n\n    // fieldlist inside prechat\n    var fieldList = div.querySelector('.fieldList');\n\n    // chat label pre-fields\n    if (this.chatLabelStart != '') {\n      var chatLabelStartDiv = document.createElement('div');\n      chatLabelStartDiv.classList.add('fieldsTitle');\n      chatLabelStartDiv.innerHTML = this.chatLabelStart;\n      // insert as first child\n      fieldList.insertBefore(chatLabelStartDiv, fieldList.firstChild);\n    }\n\n    // label override\n    this.overrideLabels(div);\n\n    // hide fields\n    this.hidePrechatFields(div);\n\n    // min-lenght fields\n    var firstName = div.querySelector('#FirstName');\n    var lastName = div.querySelector('#LastName');\n    firstName.setAttribute('minlength',3);\n    lastName.setAttribute('minlength',3);\n\n    // subject select\n    this.createSubjectSelect(div);\n\n    // privacy checbox\n    this.createPrivacyCheckbox(div);\n\n    // start button\n    this.createStartButton(div);\n\n    // callbacks called with events\n    var evt = document.createEvent(\"Events\");\n    evt.initEvent(\"prechatOpened\", true, true);\n    document.dispatchEvent(evt);\n\n    // apply style\n    this.applyPreChatStyle();\n\n  }\n\n  overrideLabels(div) {\n    // label override!!!\n    // chatLabelName\n    if (this.chatLabelName != '') {\n      if (div.querySelector('#FirstName') != null) {\n        div.querySelector('#FirstName').closest('div.uiInput').querySelector('label').innerHTML  = this.chatLabelName;\n      }\n    }\n    // chatLabelLastname\n    if (this.chatLabelLastname != '') {\n      if (div.querySelector('#LastName') != null) {\n        div.querySelector('#LastName').closest('div.uiInput').querySelector('label').innerHTML  = this.chatLabelLastname;\n      }\n    }\n    // chatLabelEmail\n    if (this.chatLabelEmail != '') {\n      if (div.querySelector('#Email') != null) {\n        div.querySelector('#Email').closest('div.uiInput').querySelector('label').innerHTML  = this.chatLabelEmail;\n      }\n    }\n    // chatLabelSubject\n    if(this.chatLabelSubject != '') {\n      if (div.querySelector('#LiveChat_Subject__c') != null) {\n        div.querySelector('#LiveChat_Subject__c').closest('div.uiInput').querySelector('label').innerHTML  = this.chatLabelSubject;\n      }\n    }\n  }\n\n  // hide fields in prechat\n  hidePrechatFields(div) {\n    // check preselected subject\n    var preselSubject = document.querySelector(this.SELECTORS.chatPreselectedSubject).value;\n    // hiding fields = main selector : closest selector\n    var hidingFields =  {\n     '#LiveChat_Path1__c': 'div.inputText',\n     '#LiveChat_Path2__c': 'div.inputText',\n     '#LiveChat_Path3__c': 'div.inputText',\n     '#LiveChat_Path4__c': 'div.inputText',\n     '#LiveChat_Path5__c': 'div.inputText',\n     '#LiveChat_Brand__c': 'div.inputSelect',\n     '#website_iso_country_code__c': 'div.inputText',\n     '#Country__c': 'div.inputSelect',\n     '#Primary_Language__c': 'div.inputSelect',\n     '#Type': 'div.inputSelect',\n     '#Subject': 'div.inputText',\n     '#LiveChat_Subject__c': 'div.inputText'\n    };\n    if(this.customerLoggedIn === 'true') {\n      // I group the fields to hide in the case of a registered user\n      hidingFields['#FirstName'] = 'div.inputSplitName';\n      hidingFields['#LastName'] = 'div.inputSplitName';\n      hidingFields['#Email'] = 'div.inputEmail';\n      // if the field is filled in it means that we are in the Push Notification PS flow\n      if(preselSubject != '') {\n        // I remove the property from the group of fields to hide\n        delete hidingFields['#LiveChat_Subject__c'];\n      }\n    }\n    // loop the fields\n    for(var key in hidingFields) {\n      // check and hide\n      if (div.querySelector(key) != null) {\n        div.querySelector(key).closest(hidingFields[key]).classList.add('hidden');\n      }\n    }\n  }\n\n  // create subject select\n  createSubjectSelect(div) {\n    // check preselected subject\n    var preselSubject = document.querySelector(this.SELECTORS.chatPreselectedSubject).value;\n    if (preselSubject != '') {\n      var evt = document.createEvent(\"Events\");\n      var element = div.querySelector('#LiveChat_Subject__c');\n      element.value = preselSubject;\n      evt.initEvent(\"change\", true, true);\n      // triggers event\n      element.dispatchEvent(evt);\n      // I add attributes to my element\n      element.classList.add('disabled');\n      element.setAttribute('disabled', 'disabled');\n      return;\n    }\n    // fields\n    var fieldList = div.querySelector('.fieldList');\n    // subject select\n    var subjectDiv = document.createElement('div');\n    subjectDiv.classList.add('inputSelect','embeddedServiceSidebarFormField','subjectSelect','form-group');\n    // div select\n    var selectDiv = document.createElement('div');\n    selectDiv.classList.add('uiInput','uiInput--default','uiInputSelect','uiInput--select');\n    // label\n    var selectDivLabel = document.createElement('label');\n    selectDivLabel.classList.add('uiLabel','uiLabel-left','form-element__label');\n    selectDivLabel.innerHTML = this.chatLabelSubject;\n    // append to select div\n    selectDiv.append(selectDivLabel);\n    // create select and options\n    var subjectSelect = document.createElement('select');\n    subjectSelect.setAttribute('name','subjectSelect') ;\n    subjectSelect.setAttribute('id','subjectSelect') ;\n    subjectSelect.setAttribute('placeholder',this.chatLabelSubject) ;\n    // stock classes\n    if (typeof this.options.subjectClassesDefault === 'undefined' || this.options.subjectClassesDefault !== 'false') {\n      subjectSelect.classList.add('slds-style-select','select','js-subject','mc-custom');\n    }\n    // options classes\n    if (typeof this.options.subjectClasses !== 'undefined') {\n      // check if is array and add classes\n      var classArr = this.options.subjectClasses;\n      if (Array.isArray(classArr)) {\n        // loop the classes to add them\n        classArr.forEach((cls, i) => {\n          subjectSelect.classList.add(cls);\n        });\n      }\n    }\n    // check list on options\n    if (typeof this.options.subjects !== 'undefined') {\n      for (const key in this.options.subjects) {\n        if (this.options.subjects.hasOwnProperty(key)) {\n          // set value\n          subjectSelect.options[subjectSelect.options.length] = new Option(this[key], this.options.subjects[key]);\n        }\n      }\n    }\n    // append to select div\n    selectDiv.append(subjectSelect);\n    // append to subject div\n    subjectDiv.append(selectDiv);\n    // append to fields\n    fieldList.append(subjectDiv);\n    // type or subject\n    var targetSelect = null;\n    if (div.querySelector('#LiveChat_Subject__c') != null) {\n      targetSelect = div.querySelector('#LiveChat_Subject__c');\n    } else if (div.querySelector('#Type') != null) {\n      targetSelect = div.querySelector('#Type');\n    } else {\n      if (div.querySelector('#Subject') != null) {\n        targetSelect = div.querySelector('#Subject');\n      }\n    }\n    // first val setting\n    if (subjectSelect.value !== '' && targetSelect != null) {\n      targetSelect.value = subjectSelect.value;\n      var evt = document.createEvent(\"Events\");\n      evt.initEvent(\"change\", true, true);\n      targetSelect.dispatchEvent(evt);\n    }\n    // event!\n    subjectSelect.addEventListener('change',e => {\n      // this works\n      if (targetSelect != null) {\n        targetSelect.value = subjectSelect.value;\n        var evt = document.createEvent(\"Events\");\n        evt.initEvent(\"change\", true, true);\n        targetSelect.dispatchEvent(evt);\n      }\n    });\n  }\n\n  createPrivacyCheckbox(div) {\n    // fields\n    var fieldList = div.querySelector('.fieldList');\n    // checkbox\n    var checkboxDiv = document.createElement('div');\n    checkboxDiv.classList.add('inputText','embeddedServiceSidebarFormField','privacyInput','custom-checkbox');\n    var checkbox = document.createElement('input');\n    checkbox.setAttribute('type','checkbox') ;\n    checkbox.setAttribute('id','privacyInput') ;\n    var label = document.createElement('label');\n    label.innerHTML = this.chatLabelPrivacy;\n    // append to checkbox div\n    checkboxDiv.append(checkbox);\n    checkboxDiv.append(label);\n    // append to fields\n    fieldList.append(checkboxDiv);\n  }\n\n  //\n  createStartButton(div) {\n    // fake button\n    var fakeSubmit = document.createElement('a');\n    fakeSubmit.setAttribute('href','javascript:void(0)');\n    fakeSubmit.classList.add('fakeSubmit','disabled');\n    // stock class\n    if (typeof this.options.ctaClassesDefault === 'undefined' || this.options.ctaClassesDefault !== 'false') {\n      fakeSubmit.classList.add('embeddedServiceSidebarButton','uiButton--default','uiButton');\n    }\n    // options class\n    if (typeof this.options.ctaClasses !== 'undefined') {\n      // check if is array and add classes\n      var classArr = this.options.ctaClasses;\n      if (Array.isArray(classArr)) {\n        // loop the classes to add them\n        classArr.forEach((cls, i) => {\n          fakeSubmit.classList.add(cls);\n        });\n      }\n    }\n    // button inner html\n    fakeSubmit.innerHTML = this.chatLabelCTA;\n    // append button\n    var buttonWrapper = div.querySelector('.buttonWrapper');\n    buttonWrapper.querySelector('button').classList.add('hidden');\n    buttonWrapper.append(fakeSubmit);\n    // bind action\n    this.bindStartChat(div);\n    // go PS chat if banner is not null, if is disappeared but is not launched or not launch by click\n    if (this.personalStylistBanner != null &&\n        this.personalStylistBanner.classList.contains('disappeared') &&\n        !this.personalStylistBanner.classList.contains('launched') &&\n        !this.personalStylistBanner.classList.contains('launch_on_click')\n      ) {\n      // control class\n      this.personalStylistBanner.classList.add('launched');\n      // launch chat\n      document.querySelector('.startButton').click();\n    }\n  }\n\n  //////////////////////////////////////////////////////////////////////////////////////////////////////\n  // FUNCTIONALITY PART\n\n  // start chat button\n  startButton() {\n    var btn = document.querySelector(this.SELECTORS.chatButton);\n    btn.addEventListener('click',e => {\n      btn.classList.add('loading');\n      // reset width small trick\n      var setIntervalBtn = setInterval(function(){\n        if (btn.closest('.helpButton').style.width != '') {\n          btn.closest('.helpButton').style.width = 'auto';\n          clearInterval(setIntervalBtn);\n        }\n      }, 10);\n    });\n    // extra chat link on menus\n    this.startAlternativeButton(btn);\n\n  }\n\n  // check and launch banner PS\n  checkReappearancePersonalStylistPopUp() {\n    let self = this;\n    if(this.personalStylistPopUpReappearanceTime && Cookies.get(this.hideCookieKey)) {\n      // check every second\n      var myInterval = setInterval(function() {\n        const hideCookieKey = Cookies.get(self.hideCookieKey);\n        if(hideCookieKey == 'undefined' || !hideCookieKey) {\n          // show banner\n          console.log(\"Reappearance of the pop-up on date: \" + new Date());\n          self.personalStylistBanner.classList.remove('disappeared', 'hidden');\n          clearInterval(myInterval);\n        }\n      }, 1000);\n    }\n  }\n\n  // bind the fake button to the start chat button\n  bindStartChat(div) {\n    // bind click btn\n    var fakeBtn = div.querySelector('.fakeSubmit');\n    var btn = div.querySelector('.buttonWrapper button');\n    var privacyInput = div.querySelector('#privacyInput');\n    fakeBtn.addEventListener('click', e => {\n      // check\n      if (privacyInput.checked && this.checkForm(div)) {\n        btn.click();\n        this.TrackingComponent.actions.startChat();\n      } else {\n        // fallback\n        if (!privacyInput.checked) {\n          privacyInput.closest('.privacyInput').style.color = 'red';\n        }\n      }\n    });\n    // bind enable btn\n    privacyInput.addEventListener('change', e => {\n      if (e.target.checked) {\n        fakeBtn.classList.remove('disabled');\n      } else {\n        fakeBtn.classList.add('disabled');\n      }\n    });\n  }\n\n  startAlternativeButton(btn) {\n    let startBtns = document.querySelectorAll(this.SELECTORS.startChatLink);\n    if ( startBtns != null) {\n      startBtns.forEach(startBtn => {\n        startBtn.addEventListener('click', e => {\n          if (btn != null) {\n            btn.click();\n            startBtn.classList.add('loading');\n          }\n        });\n      });\n    }\n    // button online\n    document.addEventListener('chatButtonEnabled', (e) => {\n      if ( startBtns != null) {\n        startBtns.forEach(startBtn => {\n          startBtn.classList.remove('not-available');\n          startBtn.classList.add('available');\n          startBtn.addEventListener('click', e => {\n            e.preventDefault();\n            e.stopPropagation();\n            if (btn != null) {\n              btn.click();\n            }\n          });\n        });\n      }\n    });\n    // button offline\n    document.addEventListener('chatButtonDisabled', (e) => {\n      if (startBtns != null) {\n        startBtns.forEach(startBtn => {\n          startBtn.classList.add('not-available');\n          startBtn.classList.remove('available');\n          startBtn.removeEventListener('click',function(){});\n        });\n      }\n    });\n  }\n\n  //////////////////////////////////////////////////////////////////////////////////////////////////////\n  // CHECKS PART\n  // error prechat\n  errorPrechat(div,el){\n    // i only care about fake fields\n    // SUBJECT\n    var subjectSelect = el.previousElementSibling.querySelector('input#LiveChat_Subject__c');\n    if (subjectSelect == null) {\n      subjectSelect = el.previousElementSibling.querySelector('#Type');\n    }\n    if (subjectSelect == null) {\n      subjectSelect = el.previousElementSibling.querySelector('#Subject');\n    }\n    if (subjectSelect != null) {\n      var subjectDiv = div.querySelector('.subjectSelect');\n      if (subjectDiv != null) {\n        subjectDiv.append(el);\n        subjectDiv.querySelector('.uiInputSelect').classList.add('has-error');\n      }\n    }\n  }\n\n  // checks form\n  checkForm(div){\n    // init\n    var pass = [];\n    // fields\n    var fields = {\n      '#FirstName': {\n        'type' : 'length',\n        'value' : 3\n      },\n      '#LastName': {\n        'type' : 'length',\n        'value' : 3\n      }\n    }\n    for (const fieldName in fields){\n      if(fields.hasOwnProperty(fieldName)){\n        // get input\n        var input = div.querySelector(fieldName);\n        // types\n        // length\n        if (fields[fieldName].type == 'length') {\n          if (input.value.length == 0 || input.value.length >= fields[fieldName].value ) {\n            // pass\n            pass.push('true');\n            // clean error if not empty\n            if (input.value.length != 0) {\n              this.cleanFieldError(input);\n            }\n          } else {\n            // no pass\n            pass.push('false');\n            // set\n            this.setFieldError(input,'length');\n          }\n        }\n      }\n    }\n    // salesforce standard fields\n    var emailInput = div.querySelector('input#Email');\n    if (emailInput == null) {\n      emailInput = div.querySelector('input#SuppliedEmail');\n    }\n    // subjectInput\n    var subjectInput = div.querySelector('#LiveChat_Subject__c');\n    if (subjectInput == null) {\n      subjectInput = div.querySelector('#Type');\n    }\n    if (subjectInput == null) {\n      subjectInput = div.querySelector('#Subject');\n    }\n    // reset errorrr if subject is not empty !!!! (because the subject field is fake)\n    if (subjectInput.value != '' && div.querySelector('.subjectSelect .uiInputSelect') != null ) {\n      div.querySelector('.subjectSelect .uiInputSelect').classList.remove('has-error');\n    }\n    // if one of the 2 field is empty i want to trigger the salesforce validation\n    if (emailInput.value == '' || subjectInput.value == '') {\n      return true;\n    }\n    // return true if i dont find fals in pass array\n    return !pass.includes('false');\n  }\n\n  // set the error field\n  setFieldError(div,type) {\n    if (div != null) {\n      // set error classes\n      div.classList.add('has-error');\n      div.closest('.uiInput').classList.add('has-error');\n      var label = '';\n      // adding error ul\n      var inputBox = div.closest('.embeddedServiceSidebarFormField');\n      // check\n      if (inputBox.querySelector('ul.uiInputDefaultError')) return;\n      // label\n      if (type == 'length') {\n        label = this.chatLabelLengthError;\n      }\n      // create ul\n      var errorUl = document.createElement('ul');\n      errorUl.classList.add('uiInput','uiInputDefaultError','has-error','uiInput--default','uiInput--input');\n      var errorLi = document.createElement('li');\n      errorLi.setAttribute('class','form-element__help');\n      errorLi.innerHTML = label;\n      errorUl.appendChild(errorLi);\n      // append error\n      inputBox.append(errorUl);\n    }\n  }\n\n  // clean the error from field\n  cleanFieldError(div) {\n    // remove class\n    div.classList.remove('has-error');\n    // box\n    var inputBox = div.closest('.embeddedServiceSidebarFormField');\n    // find error box\n    var errorBox = inputBox.querySelector('ul.uiInputDefaultError');\n    if (errorBox != null) {\n      errorBox.remove();\n    }\n  }\n\n  //////////////////////////////////////////////////////////////////////////////////////////////////////\n  // SHADOW DOM HACKS\n\n  applyArrowDownStyles() {\n    console.log('applyArrowDownStyles');\n    // embeddedservice-chat-unseen-message-notification\n    let element = document.querySelector('.modalContainer.embeddedServiceSidebar .embeddedServiceLiveAgentStateChatInputFooter.chasitorInputWrapper embeddedservice-chat-unseen-message-notification')\n    this.applyElStyle('#arrowDownStyle',element);\n    // other shadow dom elems\n    let element2 = document.querySelector('.modalContainer.embeddedServiceSidebar .embeddedServiceLiveAgentStateChatInputFooter.chasitorInputWrapper embeddedservice-chat-unseen-message-notification').shadowRoot.querySelector(' lightning-button-icon');\n    this.applyElStyle('#arrowDownStyle2',element2);\n  }\n\n  applyPreChatStyle() {\n    console.log('applyPreChatStyle');\n    // headerChatStyle\n    let element = document.querySelector('.modalContainer.embeddedServiceSidebar.layout-docked.sidebarMaximized .dockableContainer embeddedservice-chat-header')\n    this.applyElStyle('#headerChatStyle',element);\n  }\n\n  applyElStyle(styleID,element) {\n    let styleSourceDiv = document.querySelector(styleID);\n    if (styleSourceDiv === null) return false;\n    let style = styleSourceDiv.innerText;\n    let styleDiv = document.createElement( 'style' );\n    console.log('chatstyle',styleID,style.trim());\n    styleDiv.innerHTML = style.trim();\n    let shadowDomEl = element.shadowRoot;\n    console.log('shadowDomEl' , shadowDomEl);\n    console.log('shadowDomEl' , shadowDomEl.constructor);\n    if (shadowDomEl !== null && shadowDomEl.constructor.name === 'ShadowRoot') {\n      console.log('shadowDomEl.constructor.name',shadowDomEl.constructor.name);\n      shadowDomEl.appendChild( styleDiv )\n    } else {\n      console.log(' no shadow dom ')\n    }\n  }\n\n  //////////////////////////////////////////////////////////////////////////////////////////////////////\n  // ENDING PART\n  // chat ending\n  chatEnding() {\n    // vars\n    var endChatContainer = document.querySelector(this.SELECTORS.endChatContainer);\n    var endChatMessage = document.querySelector(this.SELECTORS.endChatMessage);\n    // if i find the wrapper i append the endchat\n    if (endChatContainer != null) {\n      var endChatContent = document.querySelector(this.SELECTORS.endChatContent);\n      var endChatText = endChatContent.cloneNode(true);\n      endChatText.classList.remove('d-none');\n      // insert as first child\n      endChatContainer.insertBefore(endChatText, endChatContainer.firstChild);\n      // add class\n      endChatMessage.classList.add('chatEnded');\n    }\n    // save transcription\n    var downloadBtn = document.querySelector(this.SELECTORS.endChatContainer+' .container-feedback .btn-download');\n    var saveBtn = document.querySelector(this.SELECTORS.endChatContainer+' .saveTranscriptButton');\n    if (downloadBtn != null && saveBtn != null ) {\n      downloadBtn.addEventListener('click', () => {\n        saveBtn.click();\n      });\n    } else {\n      downloadBtn.style.display = 'none';\n    }\n  }\n\n  //////////////////////////////////////////////////////////////////////////////////////////////////////\n  // DELETE CHAT BEFORE START\n\n  deleteChat(deleteChatBtn) {\n    deleteChatBtn.addEventListener('click', e => {\n      this.TrackingComponent.actions.deleteChat();\n    });\n  }\n\n  /////////////////////////\n  /*  PERSONAL STYLIST   */\n  /////////////////////////\n  // bind PS chat\n  bindPSChat() {\n    // PS part\n    var ctx = this;\n    if (this.personalStylistSnapConfig != null) {\n      // PS Chat binded\n      const hideCookieKey = Cookies.get(this.hideCookieKey);\n      const closeBtn = this.personalStylistCloseBtn;\n      const isFaqPage = $('html').data('controller') === \"FaqController\";\n      // check cookie and launch banner PS\n      if((hideCookieKey == 'undefined' || !hideCookieKey) && !isFaqPage) {\n        // launch ps chat bind\n        this.setupPersonalStylistDelayedPopup(this.personalStylistPopUpTriggerTime);\n      }\n      if ( closeBtn != null ) {\n        closeBtn.addEventListener('click', () => {\n          const expires = ctx.personalStylistPopUpReappearanceTime ? ctx.setExpires(ctx.personalStylistPopUpReappearanceTime) : \"\";\n          // set the cookie value to 'true' to avoid showing the banner\n          Cookies.set(ctx.hideCookieKey, 'true', { expires: expires, path: '/' });\n          // hide banner\n          ctx.personalStylistBanner.classList.add('disappeared','hidden');\n          //\n          ctx.checkReappearancePersonalStylistPopUp();\n        });\n      }\n    }\n  }\n\n  setExpires(exp){\n    let now = new Date();\n    console.log(\"Current date: \" + now);\n    let time = now.getTime();\n    let expireTime = time + Number(exp);\n    now.setTime(expireTime);\n    console.log(\"Expiry date: \" + now);\n    return now;\n  }\n\n  // display PS button\n  setupPersonalStylistDelayedPopup(triggerIn){\n    var ctx = this;\n    // click start chat button\n    var chatButton = document.querySelector(this.SELECTORS.chatButton);\n    // if there is the start chat button , i bind the start chat\n    if (this.personalStylistStartChat != null) {\n      this.personalStylistStartChat.addEventListener('click',e => {\n        e.stopPropagation();\n        // init chat\n        // if not i set the preselected subject\n        document.querySelector(this.SELECTORS.chatPreselectedSubject).value = this.options.subjects.chatLabelSubjectOptionPS;\n        // hide button\n        ctx.personalStylistBanner.classList.add('launch_on_click');\n        // click start chat button\n        chatButton.click();\n        // remove PS banner\n        // hide button\n        ctx.personalStylistBanner.classList.add('disappeared','hidden');\n        // put cookie\n        Cookies.set(ctx.hideCookieKey, 'true', {\n          path: '/'\n        });\n      });\n    }\n    // if there is the banner i want to show it\n    if (this.personalStylistBanner != null) {\n      // button appears if there are buttons to start chat or whatsapp\n      setTimeout(()=> {\n        if((ctx.personalStylistStartWhatsApp != null || ctx.personalStylistStartChat != null ) && chatButton.classList.contains('helpButtonEnabled') ) {\n          ctx.personalStylistBanner.classList.remove('d-none');\n        }\n      }, triggerIn);\n      // hide push on disable button\n      document.addEventListener('chatButtonDisabled', () => {\n        ctx.personalStylistBanner.classList.add('d-none');\n      });\n      // show push on enable button\n      document.addEventListener('chatButtonEnabled', () => {\n        setTimeout(()=> {\n          if((ctx.personalStylistStartWhatsApp != null || ctx.personalStylistStartChat != null ) && chatButton.classList.contains('helpButtonEnabled') ) {\n            ctx.personalStylistBanner.classList.remove('d-none');\n          }\n        }, triggerIn);\n      });\n      // prechatOpened\n      document.addEventListener('prechatOpened', () => {\n        // if the preselected subject is filled, i reset it so the next time is not preselected\n        if (document.querySelector(ctx.SELECTORS.chatPreselectedSubject).value != '') {\n          document.querySelector(ctx.SELECTORS.chatPreselectedSubject).value = '';\n        }\n      });\n    }\n  }\n\n  addToObject(obj, key, value, index) {\n  \t// Create a temp object and index variable\n  \tvar temp = {};\n  \tvar i = 0;\n  \t// Loop through the original object\n  \tfor (var prop in obj) {\n  \t\tif (obj.hasOwnProperty(prop)) {\n  \t\t\t// If the indexes match, add the new item\n  \t\t\tif (i === index && key && value) {\n  \t\t\t\ttemp[key] = value;\n  \t\t\t}\n  \t\t\t// Add the current item in the loop to the temp obj\n  \t\t\ttemp[prop] = obj[prop];\n  \t\t\t// Increase the count\n  \t\t\ti++;\n  \t\t}\n  \t}\n  \t// If no index, add to the end\n  \tif (!index && key && value) {\n  \t\ttemp[key] = value;\n  \t}\n  \treturn temp;\n  }\n\n}\n\nexport default new ChatUtils();\n"],"sourceRoot":""}