{"version":3,"sources":["../../../../utils/asset-loader-utils.js","../../../../utils/common-utils.js","../../../../src/ui/js/chat-ui.js","../../../../src/ui/js/lpOrchestrator.js","../../../../node_modules/mustache/mustache.js"],"names":["loadCookieGatedScript","url","window","OneTrust","InsertScript","timeout","setTimeout","loadCookieGatedScriptFallback","clearInterval","interval","setInterval","clearTimeout","script","document","createElement","src","className","type","head","appendChild","loadScriptMap","scriptUrl","mapUrl","querySelector","dataset","sourceMap","loadCss","link","rel","href","loadLivePersonAssets","resource","bucketPath","Error","assetPath","endsWith","LiveChatError","constructor","message","name","Object","setPrototypeOf","prototype","cacheChatUiDOMElements","cacheElement","key","selector","parent","element","console","warn","entries","uiSelectors","forEach","b","state","elements","nestedKey","nestedSelector","chatContainer","loadTemplate","errorMessage","response","fetch","ok","text","error","handleTemplateRender","chatUiConfig","LiveChat","resources","ui","template","Mustache","render","chatUiHasClass","classList","contains","chatUiHideElement","add","chatUiShowElement","remove","updateDrawerHeaderState","hasVisibleWarnings","warnings","chatDrawerWarning","chatDrawerCookieWarning","headerIcon","toggle","getIsFunctionalCookieCategory","OptanonActiveGroups","indexOf","getIsUserAwaitingChat","lpBeautyChatOrcData","isUserAwaitingChat","lpSupportChatOrcData","closeDrawerOnClickOut","handleOutsideClick","event","oneTrustPopUp","otherSelectors","chatDrawer","target","floatingButton","showFloatingButtonLoadingState","removeOutsideClickListener","addEventListener","removeEventListener","closeDrawerOnX","closeButton","onCloseButtonClick","service","button","serviceButtons","artistButton","supportButton","toggleDrawerButton","hideFloatingButtonLoadingState","floatingButtonLoading","floatingButtonIcon","toggleDrawerTemplates","templateToShow","templates","chatDrawerSuccess","toggleDrawer","isLoading","getServiceButtonSelector","services","chatDrawerFinishedEvent","chatOrcData","intentLoopFinishedEventName","buttonSelector","buttonEnabled","disabled","chatDrawerErrorMessageEvent","errorMessageEventName","showCookieComplianceWarning","cookieButton","id","ToggleInfoDisplay","serviceButtonHandler","artist","callback","onBeautyChatButtonClick","support","onSupportChatButtonClick","handleServiceSelection","serviceHandler","callbackError","disableOtherButton","selectService","localStorage","setItem","buttonClicked","initializeLivePerson","manifest","shouldLoadLivePerson","liveperson","enabled","lpTag","site","start","getCurrentDecision","loadChatUi","chatUiTemplate","insertAdjacentHTML","userIntent","getItem","selectedService","removeItem","refreshWindow","location","reload","initializeChatUI","hasValidManifest","Array","isArray","length","assetPaths","filter","file","getElementById","initEngagement","divId","engId","lpChatOrcData","verifyEngagementIsReady","success","lpEngagementDiv","children","getAttribute","verifyLivePersonIsReady","taglets","rendererStub","verifyServiceIsReady","isLivePersonReady","isEngagementReady","performEngagementClick","click","handleIntervalFail","lpErrorMessageEvent","intentLoop","intentLoopTimeoutCounter","isLoopActive","dispatchEvent","handleServiceError","startIntentLoop","eventName","lpIntentLoopCompleteEvent","errorEventName","Event","bubbles","keys","isReady","intentLoopTimeoutDefault","e","endIntentLoop","onChatButtonClick","global","factory","exports","module","define","amd","self","this","objectToString","toString","isArrayPolyfill","object","call","isFunction","typeStr","obj","escapeRegExp","string","replace","hasProperty","propName","primitiveHasOwnProperty","primitive","hasOwnProperty","regExpTest","RegExp","test","testRegExp","re","nonSpaceRe","isWhitespace","entityMap","escapeHtml","String","fromEntityMap","s","whiteRe","spaceRe","equalsRe","curlyRe","tagRe","parseTemplate","tags","lineHasNonSpace","sections","tokens","spaces","hasTag","nonSpace","indentation","tagIndex","stripSpace","pop","openingTagRe","closingTagRe","closingCurlyRe","compileTags","tagsToCompile","split","mustache","scanner","Scanner","value","chr","token","openSection","eos","pos","scanUntil","i","valueLength","charAt","push","scan","nestTokens","squashTokens","squashedTokens","lastToken","numTokens","nestedTokens","collector","section","tail","match","index","substring","search","Context","view","parentContext","cache","lookup","context","intermediateValue","names","lookupHit","Writer","templateCache","_cache","set","get","clear","clearCache","parse","cacheKey","join","isCacheEnabled","undefined","partials","config","getConfigTags","renderTokens","originalTemplate","buffer","symbol","renderSection","renderInverted","renderPartial","unescapedValue","escapedValue","rawValue","subRender","j","slice","indentPartial","partial","filteredIndentation","partialByNl","indentedValue","escape","getConfigEscape","version","defaultWriter","TypeError"],"mappings":";;;;AAAA,mNAEA,eASsBA,qBAAqBA,CAACC,CAAG,CAAE,CAG/C,GAAIC,MAAM,CAACC,QAAQ,EAAID,MAAM,CAACC,QAAQ,CAACC,YAAY,CAEjD,YADAD,QAAQ,CAACC,YAAY,CAACH,CAAG,CAAE,MAAM,CAAE,IAAI,CAAE,IAAI,IAA0B,CAAC,CAEzE,MAEKI,CAAO,CAAGC,UAAU,CAAC,IAAM,CAC1BJ,MAAM,CAACC,QAAQ,EAClBI,6BAA6B,CAACN,CAAG,CAAC,CAEpCO,aAAa,CAACC,CAAQ,EACxB,CAAC,CAAE,GAAK,CAAC,CAEHA,CAAQ,CAAGC,WAAW,CAAC,IAAM,CAC7BR,MAAM,CAACC,QAAQ,GACjBA,QAAQ,CAACC,YAAY,CAACH,CAAG,CAAE,MAAM,CAAE,IAAI,CAAE,IAAI,CAAE,GAAG,CAAC,CACnDU,YAAY,CAACN,CAAO,CAAC,CACrBG,aAAa,CAACC,CAAQ,CAAC,EAE3B,CAAC,CAAE,GAAG,EACR,CAEA,SAASF,6BAA6BA,CAACN,CAAG,CAAE,CAC1C,MAAMW,CAAM,CAAGC,QAAQ,CAACC,aAAa,CAAC,QAAQ,CAAC,CAC/CF,CAAM,CAACG,GAAG,CAAGd,CAAG,CAChBW,CAAM,CAACI,SAAS,CAAG,oBAAoB,CACvCJ,CAAM,CAACK,IAAI,CAAG,YAAY,CAC1BJ,QAAQ,CAACK,IAAI,CAACC,WAAW,CAACP,CAAM,EAClC,CAEA,eAAsBQ,aAAaA,CAACC,CAAS,CAAEC,CAAM,CAAE,CACrD,MAAMV,CAAM,CAAGC,QAAQ,CAACU,aAAa,CAAE,eAAcF,CAAU,IAAG,CAAC,CAC/DT,CAAM,GACRA,CAAM,CAACY,OAAO,CAACC,SAAS,CAAGH,CAAM,EAErC,CAEA,eAAsBI,OAAOA,CAACzB,CAAG,CAAE,CACjC,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aAAa;;GAErC;;;EAGD,IAAImC,aAAa,GAAG,IAAIpC,MAAM,EAAE;;;;;EAKhCrC,QAAQ,CAAC2C,UAAU,GAAG,SAASA,UAAUA,GAAI;IAC3C,OAAO8B,aAAa,CAAC9B,UAAU,EAAE;GAClC;;;;;;;EAOD3C,QAAQ,CAAC4C,KAAK,GAAG,SAASA,KAAKA,CAAEzP,QAAQ,EAAE4L,IAAI,EAAE;IAC/C,OAAO0F,aAAa,CAAC7B,KAAK,CAACzP,QAAQ,EAAE4L,IAAI,CAAC;GAC3C;;;;;;EAMDiB,QAAQ,CAAC3M,MAAM,GAAG,SAASA,MAAMA,CAAEF,QAAQ,EAAE0O,IAAI,EAAEoB,QAAQ,EAAEC,MAAM,EAAE;IACnE,IAAI,OAAO/P,QAAQ,KAAK,QAAQ,EAAE;MAChC,MAAM,IAAIuR,SAAS,CAAC,kDAAkD,GAClD,OAAO,GAAGvH,OAAO,CAAChK,QAAQ,CAAC,GAAG,2BAA2B,GACzD,wDAAwD,CAAC;;IAG/E,OAAOsR,aAAa,CAACpR,MAAM,CAACF,QAAQ,EAAE0O,IAAI,EAAEoB,QAAQ,EAAEC,MAAM,CAAC;GAC9D;;;;EAIDlD,QAAQ,CAACsE,MAAM,GAAGjG,UAAU;;;EAG5B2B,QAAQ,CAACE,OAAO,GAAGA,OAAO;EAC1BF,QAAQ,CAAC4B,OAAO,GAAGA,OAAO;EAC1B5B,QAAQ,CAACqC,MAAM,GAAGA,MAAM;EAExB,OAAOrC,QAAQ;CAEf,CAAC","file":"chat-ui.min.js","sourcesContent":["/* This script is created and maintained by The Global Chat Team at The Estee Lauder Companies. It is part of a larger ecosystem, so please raise any issues, change or feature requests with our team directly. */\n\nexport async function loadScript(url, callback) {\n const script = document.createElement(\"script\");\n script.src = url;\n script.type = \"text/javascript\";\n script.dataset.sourceMap = url + '.map';\n if (callback) script.onload = callback;\n document.head.appendChild(script);\n}\n\nexport async function loadCookieGatedScript(url) {\n const functionalCookieCategory = '3';\n\n if (window.OneTrust && window.OneTrust.InsertScript) {\n OneTrust.InsertScript(url, 'head', null, null, functionalCookieCategory);\n return;\n }\n\n const timeout = setTimeout(() => {\n if (!window.OneTrust) {\n loadCookieGatedScriptFallback(url);\n }\n clearInterval(interval);\n }, 10000);\n\n const interval = setInterval(() => {\n if (window.OneTrust) {\n OneTrust.InsertScript(url, 'head', null, null, '3');\n clearTimeout(timeout);\n clearInterval(interval);\n }\n }, 100)\n}\n\nfunction loadCookieGatedScriptFallback(url) {\n const script = document.createElement('script');\n script.src = url;\n script.className = 'optanon-category-3';\n script.type = 'text/plain';\n document.head.appendChild(script);\n}\n\nexport async function loadScriptMap(scriptUrl, mapUrl) {\n const script = document.querySelector(`script[src=\"${scriptUrl}\"]`);\n if (script) {\n script.dataset.sourceMap = mapUrl;\n }\n}\n\nexport async function loadCss(url) {\n const link = document.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = url;\n link.dataset.sourceMap = url + '.map';\n document.head.appendChild(link);\n}\n\nexport async function loadBrandAssets(resources, brandAssetsManifest, bucketPath) {\n if (brandAssetsManifest === undefined) {\n throw new Error(\"LiveChat Error: Brand Asset Manifest is missing\");\n }\n\n for (const key in resources) {\n if (resources[key].enabled || resources[key] === \"core\") {\n await loadBrandAsset(key, brandAssetsManifest, bucketPath);\n }\n }\n}\n\nexport async function loadBrandAsset(resource, brandAssetsManifest, bucketPath) {\n if (resource === undefined) {\n throw new Error(\"Assets are missing from the manifest: \",);\n }\n\n const r = brandAssetsManifest[resource];\n\n if (!r) return;\n\n for (const assetPath of r) {\n const url = `${bucketPath}${assetPath}`;\n if (assetPath.endsWith(\".js\")) {\n await loadCookieGatedScript(url);\n if (assetPath.endsWith(\".map\")) {\n const mapUrl = url + \".map\";\n await loadScriptMap(mapUrl);\n }\n } else if (assetPath.endsWith(\".css\")) {\n await loadCss(url);\n }\n }\n}\n\nexport async function loadLivePersonAssets(resource, bucketPath) {\n if (resource === undefined) {\n throw new Error(\"Assets are missing from the manifest: \",);\n }\n for (const assetPath of resource) {\n const url = `${bucketPath}${assetPath}`;\n if (assetPath.endsWith(\".js\")) {\n await loadCookieGatedScript(url);\n if (assetPath.endsWith(\".map\")) {\n const mapUrl = url + \".map\";\n await loadScriptMap(mapUrl);\n }\n } else if (assetPath.endsWith(\".css\")) {\n await loadCss(url);\n }\n }\n}\n\nexport async function loadCookieGatedCoreAssets(resource, bucketPath) {\n // Ignores Asset Loader, fires health check when done\n if (resource === undefined) {\n throw new Error(\"Core Assets are missing from the manifest: \",);\n }\n const coreAssetpath = resource.filter(assetPath => !assetPath.includes('asset-loader'));\n\n for (const assetPath of coreAssetpath) {\n const url = `${bucketPath}${assetPath}`;\n if (assetPath.endsWith(\".js\")) {\n await loadScript(url);\n if (assetPath.endsWith(\".map\")) {\n const mapUrl = url + \".map\";\n await loadScriptMap(mapUrl);\n }\n }\n }\n // Ensure everything (including other potential LP scripts) have loaded before dispatching the event\n\n // Ignoring health check for now...\n\n // window.addEventListener(\"load\", () => {\n // window.LiveChat = window.LiveChat || {};\n // window.LiveChat.health = window.LiveChat.health || {};\n // window.LiveChat.health.liveperson = window.LiveChat.health.liveperson || {};\n\n // window.LiveChat.health.liveperson.assetsLoaded = true;\n // document.dispatchEvent(new Event(\"liveperson_assets_loaded\"));\n // });\n}\n\nexport async function loadChatUiAssets(resource, bucketPath) {\n if (resource === undefined) {\n throw new Error(\"Chat UI Assets are missing from the manifest: \",);\n }\n for (const assetPath of resource) {\n const url = `${bucketPath}${assetPath}`;\n if (assetPath.endsWith(\".js\")) {\n await loadScript(url);\n if (assetPath.endsWith(\".map\")) {\n const mapUrl = url + \".map\";\n await loadScriptMap(mapUrl);\n }\n } else if (assetPath.endsWith(\".css\")) {\n await loadCss(url);\n }\n }\n}\n\n// Called last in the asset loader pipeline\nexport function performLocalSetup() {\n console.log(\"LIVECHAT >> Local system initializing...\");\n setupLocalLivePerson();\n}\n\nfunction setupLocalLivePerson() {\n console.log(\"LIVECHAT >> Setting up local LivePerson environment...\");\n // Set up the minimum mock necessary for the LiveChat UI to work with a locally-mocked LivePerson Engagement\n const beautyDrawer = document.getElementById(\"livechat_lp_drawer_beauty\");\n const beautyEngagement = beautyDrawer.appendChild(document.createElement(\"div\")).appendChild(document.createElement(\"div\"));\n beautyEngagement.setAttribute('data-lp-engagement-id', '1234567890');\n\n const customerSupportDrawer = document.getElementById(\"livechat_lp_drawer_customer_support\");\n const customerSupportEngagement = customerSupportDrawer.appendChild(document.createElement(\"div\")).appendChild(document.createElement(\"div\"));\n customerSupportEngagement.setAttribute('data-lp-engagement-id', '0987654321');\n\n window.lpTag = window.lpTag || {};\n window.lpTag.taglets = window.lpTag.taglets || {};\n window.lpTag.taglets.rendererStub = window.lpTag.taglets.rendererStub || {};\n window.lpTag.taglets.rendererStub.click = function (engagementId) {\n if (!document.querySelector(`[data-lp-engagement-id=\"${engagementId}\"]`)) return false;\n\n renderMockLpWindow();\n return true;\n };\n}\n\nfunction renderMockLpWindow() {\n const mockLpWindow = document.createElement(\"div\");\n mockLpWindow.id = \"lp-window-mock\";\n mockLpWindow.style = \"position: sticky; bottom: 0; left: 0; width: 350px; height: 500px; background-color: white; z-index: 9999; padding: 10px; border: 1px solid black;\";\n const closeButton = document.createElement(\"button\");\n closeButton.textContent = \"X\";\n closeButton.style = \"font: bold; position: absolute; top: 0; right: 0; padding: 5px; font-size: 1.5rem;\";\n closeButton.onclick = () => mockLpWindow.remove();\n mockLpWindow.appendChild(closeButton);\n mockLpWindow.appendChild(document.createElement(\"h2\")).textContent = \"Mock LivePerson Window\";\n\n document.body.appendChild(mockLpWindow);\n}\n","export class LiveChatError extends Error {\n constructor(message) {\n if (message instanceof Error || message instanceof LiveChatError) {\n super(message.message); // Extract the message if an Error is passed\n } else {\n super(message);\n }\n\n this.name = \"LiveChatError\";\n Object.setPrototypeOf(this, LiveChatError.prototype);\n }\n}\n","var site = window.site || {};\nimport {\n\tloadLivePersonAssets,\n} from \"../../../utils/asset-loader-utils.js\";\nimport { LiveChatError } from \"../../../utils/common-utils.js\";\n\n(function () {\n\tconst bucketPath = '/livechat';\n\tlet removeOutsideClickListener = null;\n\tconst otherSelectors = {\n\t\toneTrustPopUp: '#onetrust-consent-sdk',\n\t};\n\n\tconst uiSelectors = {\n\t\tfloatingButton: '.js-live-chat-button',\n\t\tfloatingButtonIcon: '.live-chat-button__icon',\n\t\tfloatingButtonLoading: '.js-live-chat-button-loading',\n\t\tchatDrawer: '.js-live-chat-drawer',\n\t\tcloseButton: '.js-live-chat-drawer-close',\n\t\tserviceButtons: {\n\t\t\tartistButton: '.js-live-chat-drawer-artist-button',\n\t\t\tsupportButton: '.js-live-chat-drawer-support-button'\n\t\t},\n\t\twarnings: {\n\t\t\tchatDrawerCookieWarning: '.js-live-chat-drawer-cookie-warning',\n\t\t\tchatDrawerWarning: '.js-live-chat-drawer-warning'\n\t\t},\n\t\tchatDrawerSuccess: '.js-live-chat-drawer-success',\n\t\theaderIcon: '.js-live-chat-header-icon',\n\t\tcookieButton: '.js-live-chat-drawer-cookie-button',\n\t\trefreshWindow: '.js-live-chat-drawer-refresh-window-button'\n\t};\n\n\tconst state = {\n\t\tchatContainer: document.getElementById('live-chat-ui-container'),\n\t\telements: {}\n\t};\n\n\t// Ensure the chat container exists before proceeding\n\tif (!state.chatContainer) {\n\t\tthrow new LiveChatError('LiveChat UI container not found');\n\t}\n\n\t// Dynamically cache UI elements using uiSelectors\n\tfunction cacheChatUiDOMElements() {\n\t\tconst cacheElement = (key, selector, parent) => {\n\t\t\tconst element = parent.querySelector(selector);\n\t\t\tif (!element) console.warn(`⚠️ Warning: Missing UI element for ${key}`);\n\t\t\treturn element;\n\t\t};\n\n\t\tObject.entries(uiSelectors).forEach(([key, selector]) => {\n\t\t\tif (typeof selector === 'object') {\n\t\t\t\tstate.elements[key] = {};\n\t\t\t\tObject.entries(selector).forEach(([nestedKey, nestedSelector]) => {\n\t\t\t\t\tstate.elements[key][nestedKey] = cacheElement(nestedKey, nestedSelector, state.chatContainer);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tstate.elements[key] = cacheElement(key, selector, state.chatContainer);\n\t\t\t}\n\t\t});\n\t}\n\n\tasync function loadTemplate(url, errorMessage) {\n\t\ttry {\n\t\t\tconst response = await fetch(url);\n\t\t\tif (!response.ok) throw new Error(errorMessage);\n\t\t\treturn await response.text();\n\t\t} catch (error) {\n\t\t\tthrow new Error(`${errorMessage}: ${error.message}`);\n\t\t}\n\t}\n\n\tasync function handleTemplateRender(url) {\n\t\tconst chatUiConfig = window.LiveChat.resources.ui || null;\n\t\tconst template = await loadTemplate(url, `Failed to fetch chat UI template from ${url}`);\n\t\treturn Mustache.render(template, chatUiConfig);\n\t}\n\n\tfunction chatUiHasClass(element, className) {\n\t\tif (!element) {\n\t\t\tconsole.warn(`chatUiHasClass: Element is missing when checking class \"${className}\"`);\n\t\t\treturn false;\n\t\t}\n\t\treturn element.classList.contains(className);\n\t}\n\n\tfunction chatUiHideElement(element) {\n\t\telement.classList.add('live-chat-hidden');\n\t}\n\n\tfunction chatUiShowElement(element) {\n\t\telement.classList.remove('live-chat-hidden');\n\t}\n\n\tfunction updateDrawerHeaderState() {\n\t\tconst hasVisibleWarnings =\n\t\t\t!chatUiHasClass(state.elements.warnings.chatDrawerWarning, 'live-chat-hidden') ||\n\t\t\t!chatUiHasClass(state.elements.warnings.chatDrawerCookieWarning, 'live-chat-hidden');\n\n\t\tstate.elements.headerIcon.classList.toggle(\n\t\t\t\"live-chat-drawer__header-icon--content\",\n\t\t\t!hasVisibleWarnings\n\t\t);\n\t\tstate.elements.headerIcon.classList.toggle(\n\t\t\t\"live-chat-drawer__header-icon--warning\",\n\t\t\thasVisibleWarnings\n\t\t);\n\n\t\treturn hasVisibleWarnings;\n\t}\n\n\tfunction getIsFunctionalCookieCategory() {\n\t\treturn window.OptanonActiveGroups && window.OptanonActiveGroups.indexOf('3') !== -1;\n\t}\n\n\tfunction getIsUserAwaitingChat() {\n\t\treturn (\n\t\t\t(window.LiveChat.lpBeautyChatOrcData && window.LiveChat.lpBeautyChatOrcData.isUserAwaitingChat) ||\n\t\t\t(window.LiveChat.lpSupportChatOrcData && window.LiveChat.lpSupportChatOrcData.isUserAwaitingChat) ||\n\t\t\tfalse\n\t\t);\n\t}\n\n\tfunction closeDrawerOnClickOut() {\n\t\tconst handleOutsideClick = (event) => {\n\t\t\tconst oneTrustPopUp = document.querySelector(otherSelectors.oneTrustPopUp);\n\t\t\tif (\n\t\t\t\t!state.elements.chatDrawer.contains(event.target) &&\n\t\t\t\t!state.elements.floatingButton.contains(event.target) &&\n\t\t\t\t(!oneTrustPopUp || !oneTrustPopUp.contains(event.target))\n\t\t\t) {\n\t\t\t\tchatUiHideElement(state.elements.chatDrawer);\n\t\t\t\tif (getIsUserAwaitingChat()) showFloatingButtonLoadingState();\n\t\t\t\tremoveOutsideClickListener();\n\t\t\t}\n\t\t}\n\t\tdocument.addEventListener(\"click\", handleOutsideClick);\n\t\tremoveOutsideClickListener = () => document.removeEventListener(\"click\", handleOutsideClick);\n\t}\n\n\tfunction closeDrawerOnX() {\n\t\tstate.elements.closeButton.addEventListener(\"click\", () => {\n\t\t\tchatUiHideElement(state.elements.chatDrawer);\n\t\t\t// Terminate intent loop if exists and loading states.\n\t\t\tconst isUserAwaitingChat = getIsUserAwaitingChat();\n\t\t\tif (!isUserAwaitingChat) return;\n\t\t\twindow.LiveChat.onCloseButtonClick();\n\t\t\tconst service = window.LiveChat.lpBeautyChatOrcData.isUserAwaitingChat ? 'artist' : 'support';\n\t\t\tconst button = service === 'artist' ? state.elements.serviceButtons.artistButton : state.elements.serviceButtons.supportButton;\n\t\t\ttoggleDrawerButton(button, service, false);\n\t\t\thideFloatingButtonLoadingState();\n\t\t});\n\t}\n\n\tfunction showFloatingButtonLoadingState() {\n\t\tif (!getIsUserAwaitingChat()) return;\n\t\tif (!chatUiHasClass(state.elements.chatDrawer, 'live-chat-hidden')) return;\n\n\t\tchatUiShowElement(state.elements.floatingButtonLoading);\n\t\tchatUiHideElement(state.elements.floatingButtonIcon);\n\t}\n\n\tfunction hideFloatingButtonLoadingState() {\n\t\tchatUiHideElement(state.elements.floatingButtonLoading);\n\t\tchatUiShowElement(state.elements.floatingButtonIcon);\n\t};\n\n\tfunction toggleDrawerTemplates(templateToShow) {\n\t\tconst templates = [state.elements.chatDrawerSuccess, state.elements.warnings.chatDrawerWarning, state.elements.warnings.chatDrawerCookieWarning];\n\n\t\ttemplates.forEach(template => {\n\t\t\tif (template !== templateToShow) {\n\t\t\t\tchatUiHideElement(template);\n\t\t\t} else {\n\t\t\t\tchatUiShowElement(template);\n\t\t\t}\n\t\t});\n\n\t\tupdateDrawerHeaderState();\n\t};\n\n\tfunction toggleDrawer() {\n\t\tstate.elements.chatDrawer.classList.toggle('live-chat-hidden');\n\t\tif (\n\t\t\tchatUiHasClass(state.elements.warnings.chatDrawerCookieWarning, 'live-chat-hidden')\n\t\t\t&& chatUiHasClass(state.elements.warnings.chatDrawerWarning, 'live-chat-hidden')\n\t\t) {\n\t\t\t(getIsUserAwaitingChat() && chatUiHasClass(state.elements.chatDrawer, 'live-chat-hidden')) // If the user is awaiting chat, drawer is closed, and then clicks the floating button\n\t\t\t\t? showFloatingButtonLoadingState()\n\t\t\t\t: hideFloatingButtonLoadingState();\n\t\t\ttoggleDrawerTemplates(state.elements.chatDrawerSuccess);\n\t\t}\n\n\t\tcloseDrawerOnClickOut();\n\t}\n\n\tfunction toggleDrawerButton(button, service, isLoading) {\n\t\tbutton.querySelector(`.js-${service}-text`).classList.toggle('live-chat-hidden', isLoading);\n\t\tbutton.querySelector(`.js-${service}-loading`).classList.toggle('live-chat-hidden', !isLoading);\n\t\tbutton.querySelector(`.js-${service}-loading-text`).classList.toggle('live-chat-hidden', !isLoading);\n\t}\n\n\tfunction getServiceButtonSelector(services) {\n\t\treturn services === 'artist'\n\t\t\t? uiSelectors.serviceButtons.supportButton\n\t\t\t: uiSelectors.serviceButtons.artistButton\n\t}\n\n\tfunction chatDrawerFinishedEvent(button, chatOrcData, service) {\n\t\tif (!chatOrcData) {\n\t\t\ttoggleDrawerTemplates(state.elements.warnings.chatDrawerWarning);\n\t\t\thideFloatingButtonLoadingState();\n\t\t\ttoggleDrawerButton(button, service, false);\n\t\t\tthrow new Error(`LiveChat: chatOrcData is undefined for service: ${service}`);\n\t\t}\n\n\t\tdocument.addEventListener(chatOrcData.intentLoopFinishedEventName, function () {\n\t\t\tif (!chatOrcData.isUserAwaitingChat) return;\n\t\t\tconst buttonSelector = getServiceButtonSelector(service);\n\t\t\tconst buttonEnabled = state.chatContainer.querySelector(buttonSelector);\n\t\t\tif (buttonEnabled) {\n\t\t\t\tbuttonEnabled.disabled = false;\n\t\t\t}\n\t\t\tchatUiHideElement(state.elements.chatDrawer);\n\t\t\thideFloatingButtonLoadingState();\n\t\t\ttoggleDrawerButton(button, service, false);\n\t\t});\n\t}\n\n\tfunction chatDrawerErrorMessageEvent(chatOrcData) {\n\t\tdocument.addEventListener(chatOrcData.errorMessageEventName, function () {\n\t\t\tchatUiShowElement(state.elements.chatDrawer);\n\t\t\ttoggleDrawerTemplates(state.elements.warnings.chatDrawerWarning);\n\t\t\thideFloatingButtonLoadingState();\n\t\t});\n\t}\n\n\tfunction showCookieComplianceWarning() {\n\t\tstate.elements.cookieButton.classList.add('ot-sdk-show-settings');\n\t\tstate.elements.cookieButton.id = \"ot-sdk-btn\";\n\t\tstate.elements.cookieButton.addEventListener(\"click\", () => window.OneTrust.ToggleInfoDisplay());\n\t\ttoggleDrawerTemplates(state.elements.warnings.chatDrawerCookieWarning);\n\t};\n\n\tfunction serviceButtonHandler() {\n\t\treturn {\n\t\t\tartist: {\n\t\t\t\tbutton: state.elements.serviceButtons.artistButton,\n\t\t\t\tcallback: () => window.LiveChat.onBeautyChatButtonClick()\n\t\t\t},\n\t\t\tsupport: {\n\t\t\t\tbutton: state.elements.serviceButtons.supportButton,\n\t\t\t\tcallback: () => window.LiveChat.onSupportChatButtonClick()\n\t\t\t}\n\t\t};\n\t};\n\n\tfunction handleServiceSelection(service) {\n\t\tconst serviceHandler = serviceButtonHandler()[service];\n\n\t\tif (!serviceHandler) {\n\t\t\tthrow new Error(`❌ No service handler found for \"${service}\"`);\n\t\t}\n\n\t\tconst { button, callback } = serviceHandler;\n\t\tconst chatOrcData = service === 'artist' ? window.LiveChat.lpBeautyChatOrcData : window.LiveChat.lpSupportChatOrcData;\n\n\t\ttoggleDrawerButton(button, service, true);\n\t\tchatDrawerFinishedEvent(button, chatOrcData, service);\n\t\tchatDrawerErrorMessageEvent(chatOrcData);\n\n\t\t// Ensure UI is not stuck on success if callback() fails\n\t\ttry {\n\t\t\tif (callback) {\n\t\t\t\tcallback();\n\t\t\t}\n\t\t} catch (callbackError) {\n\t\t\tconsole.error(`❌ LiveChat callback Error: ${callbackError.message}`);\n\t\t\ttoggleDrawerTemplates(state.elements.warnings.chatDrawerWarning);\n\t\t\thideFloatingButtonLoadingState();\n\t\t}\n\t}\n\n\tfunction disableOtherButton(buttonSelector) {\n\t\tconst button = state.chatContainer.querySelector(buttonSelector);\n\t\tbutton.disabled = true;\n\t};\n\n\tfunction selectService(service) {\n\t\tlocalStorage.setItem('live_chat_selected_service', service);\n\t\tconst buttonSelector = getServiceButtonSelector(service)\n\t\tdisableOtherButton(buttonSelector);\n\t\tstate.elements.buttonClicked = service;\n\t\tif (getIsFunctionalCookieCategory()) {\n\t\t\thandleServiceSelection(service);\n\t\t} else {\n\t\t\tshowCookieComplianceWarning();\n\t\t}\n\t};\n\n\tasync function initializeLivePerson() {\n\t\tconst { manifest, resources } = window.LiveChat || {};\n\t\tconst shouldLoadLivePerson = resources.liveperson.enabled;\n\n\t\tif (shouldLoadLivePerson) {\n\t\t\tawait loadLivePersonAssets(manifest.liveperson, bucketPath);\n\t\t}\n\n\t\tsetTimeout(() => {\n\t\t\twindow.lpTag.site && window.lpTag.start();\n\t\t}, 1000);\n\t}\n\n\tasync function getCurrentDecision() {\n\t\tif (getIsFunctionalCookieCategory()) {\n\t\t\tif (window.lpTag && !window.lpTag.site) initializeLivePerson();\n\n\t\t\tconst buttonClicked = state.elements.buttonClicked;\n\t\t\tif (!buttonClicked) return;\n\n\t\t\thandleServiceSelection(buttonClicked);\n\t\t\ttoggleDrawerTemplates(state.elements.chatDrawerSuccess);\n\t\t}\n\t}\n\n\tasync function loadChatUi(url) {\n\t\tconst chatUiTemplate = await handleTemplateRender(url);\n\t\tstate.chatContainer.insertAdjacentHTML('afterbegin', chatUiTemplate);\n\t\tcacheChatUiDOMElements();\n\n\t\tconst userIntent = localStorage.getItem('live_chat_user_intent');\n\n\t\tif (userIntent) {\n\t\t\tconst selectedService = localStorage.getItem('live_chat_selected_service');\n\t\t\tif (selectedService) {\n\t\t\t\tselectService(selectedService);\n\t\t\t\tshowFloatingButtonLoadingState();\n\t\t\t}\n\t\t\tlocalStorage.removeItem('live_chat_user_intent');\n\t\t} else {\n\t\t\tlocalStorage.removeItem('live_chat_selected_service');\n\t\t}\n\n\t\twindow.addEventListener('OneTrustGroupsUpdated', () => {\n\t\t\tgetCurrentDecision();\n\t\t});\n\t\tstate.elements.floatingButton.addEventListener(\"click\", () => toggleDrawer());\n\t\tcloseDrawerOnX();\n\t\tstate.elements.serviceButtons.artistButton.addEventListener(\"click\", () => selectService('artist'));\n\t\tstate.elements.serviceButtons.supportButton.addEventListener(\"click\", () => selectService('support'));\n\t\tstate.elements.refreshWindow.addEventListener(\"click\", () => {\n\t\t\tlocalStorage.setItem('live_chat_user_intent', \"true\");\n\t\t\tlocation.reload()\n\t\t});\n\t}\n\n\tasync function initializeChatUI() {\n\t\ttry {\n\t\t\tconst { manifest, resources } = window.LiveChat || {};\n\t\t\tconst missingConfig = !manifest || !resources;\n\t\t\tconst hasValidManifest = Array.isArray(manifest.ui) && manifest.ui.length > 0;\n\n\t\t\tif (missingConfig) {\n\t\t\t\tthrow new Error('Missing required properties in window.LiveChat object');\n\t\t\t}\n\n\t\t\t// Exit if chat ui is disabled or no manifest files\n\t\t\tif (!resources.ui.enabled || !hasValidManifest) return;\n\n\t\t\t// Filter and validate template files\n\t\t\tconst assetPaths = manifest.ui.filter(file => file.endsWith('.mustache'));\n\t\t\tif (assetPaths.length === 0) return;\n\n\t\t\tconst url = `${bucketPath}${assetPaths[0]}`;\n\n\t\t\t// Load the chat UI with valid templates\n\t\t\tawait loadChatUi(url);\n\t\t} catch (error) {\n\t\t\tthrow new LiveChatError(error.message);\n\t\t}\n\t}\n\t(async function () {\n\t\tawait initializeChatUI();\n\t})();\n}());\n","/* eslint no-console: [\"error\", { allow: [\"warn\", \"error\"] }] */\nvar site = window.site || {};\n\n(function () {\n window.LiveChat.lpBeautyChatOrcData = {\n divId: 'livechat_lp_drawer_beauty',\n engId: '',\n isLoopActive: false,\n isUserAwaitingChat: false,\n intentLoopTimeoutDefault: 15,\n intentLoopTimeoutCounter: 15,\n intentLoopFinishedEventName: 'livechat_lp_drawer_beauty_intent_loop_complete',\n errorMessageEventName: 'beauty_chat_drawer_error'\n };\n window.LiveChat.lpSupportChatOrcData = {\n divId: 'livechat_lp_drawer_customer_support',\n engId: '',\n isLoopActive: false,\n isUserAwaitingChat: false,\n intentLoopTimeoutDefault: 15,\n intentLoopTimeoutCounter: 15,\n intentLoopFinishedEventName: 'livechat_lp_drawer_customer_support_intent_loop_complete',\n errorMessageEventName: 'support_chat_drawer_error'\n };\n window.LiveChat.lpChatOrcData = {\n divId: '',\n engId: '',\n isLoopActive: false,\n isUserAwaitingChat: false,\n intentLoopTimeoutDefault: 15,\n intentLoopTimeoutCounter: 15,\n intentLoopFinishedEventName: 'global_chat_intent_loop_complete',\n errorMessageEventName: 'chat_button_error'\n };\n\n function initEngagement(divId, engId) {\n switch (divId) {\n case window.LiveChat.lpBeautyChatOrcData.divId:\n window.LiveChat.lpBeautyChatOrcData.engId = engId;\n\n return true;\n case window.LiveChat.lpSupportChatOrcData.divId:\n window.LiveChat.lpSupportChatOrcData.engId = engId;\n\n return true;\n case window.LiveChat.lpChatOrcData.divId:\n window.LiveChat.lpChatOrcData.engId = engId;\n\n return true;\n default:\n throw new Error(\n `lpOrchestrator.initEngagement(): The div id used in this script is not recognized: ${divId}. The chat module for this site is misconfigured.`\n );\n }\n }\n\n function verifyEngagementIsReady(divId) {\n var engId = '';\n var success = false;\n var lpEngagementDiv = document.getElementById(divId);\n\n if (!lpEngagementDiv) return false;\n\n if (\n lpEngagementDiv.children.length === 0 ||\n lpEngagementDiv.children[0].children.length === 0\n ) {\n return false;\n }\n\n engId = lpEngagementDiv.children[0].children[0].getAttribute('data-lp-engagement-id');\n\n if (!engId) {\n return false;\n }\n\n success = initEngagement(divId, engId);\n\n return success;\n }\n\n function verifyLivePersonIsReady() {\n if (lpTag && lpTag.taglets && lpTag.taglets.rendererStub) {\n return true;\n }\n\n return false;\n }\n\n function verifyServiceIsReady(divId) {\n var isLivePersonReady = verifyLivePersonIsReady();\n var isEngagementReady = false;\n\n if (!isLivePersonReady) {\n return false;\n }\n isEngagementReady = verifyEngagementIsReady(divId);\n if (!isEngagementReady) {\n return false;\n }\n\n return true;\n }\n\n function performEngagementClick(engId) {\n var success = false;\n\n if (engId) {\n success = lpTag.taglets.rendererStub.click(engId);\n }\n\n return success;\n }\n\n function handleIntervalFail(chatOrcData, lpErrorMessageEvent, intentLoop) {\n chatOrcData.intentLoopTimeoutCounter--;\n if (chatOrcData.intentLoopTimeoutCounter === 0) {\n chatOrcData.isLoopActive = false;\n clearInterval(intentLoop);\n document.dispatchEvent(lpErrorMessageEvent);\n }\n }\n\n function handleServiceError() {\n console.warn(\n `lpOrchestrator: The attempt to initiate a LivePerson chat session was unsuccessful.`\n );\n }\n\n async function startIntentLoop(divId) {\n var chatOrcData = {};\n var eventName;\n var lpIntentLoopCompleteEvent;\n var errorEventName = 'livechat_ui_error';\n var lpErrorMessageEvent = new Event(errorEventName, { bubbles: true });\n\n try {\n switch (divId) {\n case window.LiveChat.lpBeautyChatOrcData.divId:\n chatOrcData = window.LiveChat.lpBeautyChatOrcData;\n break;\n case window.LiveChat.lpSupportChatOrcData.divId:\n chatOrcData = window.LiveChat.lpSupportChatOrcData;\n break;\n case window.LiveChat.lpChatOrcData.divId:\n chatOrcData = window.LiveChat.lpChatOrcData;\n break;\n default:\n throw new Error(\n `lpOrchestrator: The div id used in the function startIntentLoop() is not recognized: ${divId}. The chat module for this site is misconfigured.`\n );\n }\n\n if (Object.keys(chatOrcData).length === 0) {\n throw new Error(\n 'lpOrchestrator: The lp__ChatOrcData object is empty. Something is wrong.'\n );\n }\n\n if (!document.getElementById(divId)) {\n throw new Error(\n `lpOrchestrator.initEngagement(): The LivePerson HTMLEngagement div was not found: ${divId} - The LiveChat system for this site is misconfigured.`\n );\n }\n\n chatOrcData.isLoopActive = true;\n chatOrcData.isUserAwaitingChat = true;\n\n eventName = chatOrcData.intentLoopFinishedEventName;\n errorEventName = chatOrcData.errorMessageEventName;\n\n lpIntentLoopCompleteEvent = new Event(eventName, { bubbles: true });\n lpErrorMessageEvent = new Event(errorEventName, { bubbles: true });\n\n chatOrcData.intentLoop = setInterval(function () {\n let success = false;\n const isReady = verifyServiceIsReady(divId);\n\n if (!isReady) {\n handleIntervalFail(chatOrcData, lpErrorMessageEvent, chatOrcData.intentLoop);\n return;\n }\n success = performEngagementClick(chatOrcData.engId);\n if (success) {\n chatOrcData.isLoopActive = false;\n clearInterval(chatOrcData.intentLoop);\n document.dispatchEvent(lpIntentLoopCompleteEvent);\n } else {\n handleIntervalFail(chatOrcData, lpErrorMessageEvent, chatOrcData.intentLoop);\n }\n }, 1000);\n\n // Listen for the loop completion event\n document.addEventListener(eventName, function () {\n clearInterval(chatOrcData.intentLoop);\n chatOrcData.intentLoop = null;\n chatOrcData.intentLoopTimeoutCounter = chatOrcData.intentLoopTimeoutDefault;\n chatOrcData.isUserAwaitingChat = false;\n });\n\n // Listen for the error event\n document.addEventListener(errorEventName, function () {\n clearInterval(chatOrcData.intentLoop);\n chatOrcData.intentLoop = null;\n chatOrcData.intentLoopTimeoutCounter = chatOrcData.intentLoopTimeoutDefault;\n chatOrcData.isUserAwaitingChat = false;\n\n handleServiceError();\n });\n\n } catch (e) {\n document.dispatchEvent(lpErrorMessageEvent);\n console.error(e);\n }\n }\n\n async function endIntentLoop(divId) {\n try {\n let chatOrcData = {};\n\n // Determine the correct chatOrcData object based on divId\n switch (divId) {\n case window.LiveChat.lpBeautyChatOrcData.divId:\n chatOrcData = window.LiveChat.lpBeautyChatOrcData;\n break;\n case window.LiveChat.lpSupportChatOrcData.divId:\n chatOrcData = window.LiveChat.lpSupportChatOrcData;\n break;\n case window.LiveChat.lpChatOrcData.divId:\n chatOrcData = window.LiveChat.lpChatOrcData;\n break;\n default:\n throw new Error(\n `lpOrchestrator: The div id used in the function endIntentLoop() is not recognized: ${divId}. The chat module for this site is misconfigured.`\n );\n }\n\n // Ensure chatOrcData exists and is valid\n if (Object.keys(chatOrcData).length === 0) {\n throw new Error(\n 'lpOrchestrator: The lp__ChatOrcData object is empty. Something is wrong.'\n );\n }\n\n if (!chatOrcData.isLoopActive) return;\n\n // Clear the active intent loop, if any\n const eventName = chatOrcData.intentLoopFinishedEventName;\n const lpIntentLoopCompleteEvent = new Event(eventName, { bubbles: true });\n document.addEventListener(eventName, function () {\n clearInterval(chatOrcData.intentLoop);\n chatOrcData.intentLoop = null;\n chatOrcData.intentLoopTimeoutCounter = chatOrcData.intentLoopTimeoutDefault;\n chatOrcData.isLoopActive = false;\n chatOrcData.isUserAwaitingChat = false;\n });\n document.dispatchEvent(lpIntentLoopCompleteEvent);\n } catch (e) {\n console.error(`Error in endIntentLoop for divId: ${divId}`, e);\n }\n }\n\n // Fires when the user clicks the Beauty Chat button in the drawer\n window.LiveChat.onBeautyChatButtonClick = function () {\n if (window.LiveChat.lpBeautyChatOrcData.isLoopActive) {\n return;\n }\n startIntentLoop(window.LiveChat.lpBeautyChatOrcData.divId);\n };\n\n // Fires when the user clicks the Support Chat button in the drawer\n window.LiveChat.onSupportChatButtonClick = function () {\n if (window.LiveChat.lpSupportChatOrcData.isLoopActive) {\n return;\n }\n startIntentLoop(window.LiveChat.lpSupportChatOrcData.divId);\n };\n\n // Fires when the user clicks the Chat button\n window.LiveChat.onChatButtonClick = function (divId) {\n window.LiveChat.lpChatOrcData.divId = divId;\n if (window.LiveChat.lpChatOrcData.isLoopActive) {\n return;\n }\n startIntentLoop(window.LiveChat.lpChatOrcData.divId);\n };\n\n // Fires when the user clicks the close chat drawer button\n window.LiveChat.onCloseButtonClick = function (divId) {\n if (window.LiveChat.lpBeautyChatOrcData.isLoopActive) {\n endIntentLoop(window.LiveChat.lpBeautyChatOrcData.divId);\n } else if (window.LiveChat.lpSupportChatOrcData.isLoopActive) {\n endIntentLoop(window.LiveChat.lpSupportChatOrcData.divId);\n } else if (window.LiveChat.lpChatOrcData.isLoopActive) {\n window.LiveChat.lpChatOrcData.divId = divId;\n endIntentLoop(window.LiveChat.lpChatOrcData.divId);\n } else {\n return;\n }\n };\n})();\n","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = global || self, global.Mustache = factory());\n}(this, (function () { 'use strict';\n\n /*!\n * mustache.js - Logic-less {{mustache}} templates with JavaScript\n * http://github.com/janl/mustache.js\n */\n\n var objectToString = Object.prototype.toString;\n var isArray = Array.isArray || function isArrayPolyfill (object) {\n return objectToString.call(object) === '[object Array]';\n };\n\n function isFunction (object) {\n return typeof object === 'function';\n }\n\n /**\n * More correct typeof string handling array\n * which normally returns typeof 'object'\n */\n function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }\n\n function escapeRegExp (string) {\n return string.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, '\\\\$&');\n }\n\n /**\n * Null safe way of checking whether or not an object,\n * including its prototype, has a given property\n */\n function hasProperty (obj, propName) {\n return obj != null && typeof obj === 'object' && (propName in obj);\n }\n\n /**\n * Safe way of detecting whether or not the given thing is a primitive and\n * whether it has the given property\n */\n function primitiveHasOwnProperty (primitive, propName) {\n return (\n primitive != null\n && typeof primitive !== 'object'\n && primitive.hasOwnProperty\n && primitive.hasOwnProperty(propName)\n );\n }\n\n // Workaround for https://issues.apache.org/jira/browse/COUCHDB-577\n // See https://github.com/janl/mustache.js/issues/189\n var regExpTest = RegExp.prototype.test;\n function testRegExp (re, string) {\n return regExpTest.call(re, string);\n }\n\n var nonSpaceRe = /\\S/;\n function isWhitespace (string) {\n return !testRegExp(nonSpaceRe, string);\n }\n\n var entityMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '/': '/',\n '`': '`',\n '=': '='\n };\n\n function escapeHtml (string) {\n return String(string).replace(/[&<>\"'`=\\/]/g, function fromEntityMap (s) {\n return entityMap[s];\n });\n }\n\n var whiteRe = /\\s*/;\n var spaceRe = /\\s+/;\n var equalsRe = /\\s*=/;\n var curlyRe = /\\s*\\}/;\n var tagRe = /#|\\^|\\/|>|\\{|&|=|!/;\n\n /**\n * Breaks up the given `template` string into a tree of tokens. If the `tags`\n * argument is given here it must be an array with two string values: the\n * opening and closing tags used in the template (e.g. [ \"<%\", \"%>\" ]). Of\n * course, the default is to use mustaches (i.e. mustache.tags).\n *\n * A token is an array with at least 4 elements. The first element is the\n * mustache symbol that was used inside the tag, e.g. \"#\" or \"&\". If the tag\n * did not contain a symbol (i.e. {{myValue}}) this element is \"name\". For\n * all text that appears outside a symbol this element is \"text\".\n *\n * The second element of a token is its \"value\". For mustache tags this is\n * whatever else was inside the tag besides the opening symbol. For text tokens\n * this is the text itself.\n *\n * The third and fourth elements of the token are the start and end indices,\n * respectively, of the token in the original template.\n *\n * Tokens that are the root node of a subtree contain two more elements: 1) an\n * array of tokens in the subtree and 2) the index in the original template at\n * which the closing tag for that section begins.\n *\n * Tokens for partials also contain two more elements: 1) a string value of\n * indendation prior to that tag and 2) the index of that tag on that line -\n * eg a value of 2 indicates the partial is the third tag on this line.\n */\n function parseTemplate (template, tags) {\n if (!template)\n return [];\n var lineHasNonSpace = false;\n var sections = []; // Stack to hold section tokens\n var tokens = []; // Buffer to hold the tokens\n var spaces = []; // Indices of whitespace tokens on the current line\n var hasTag = false; // Is there a {{tag}} on the current line?\n var nonSpace = false; // Is there a non-space char on the current line?\n var indentation = ''; // Tracks indentation for tags that use it\n var tagIndex = 0; // Stores a count of number of tags encountered on a line\n\n // Strips all whitespace tokens array for the current line\n // if there was a {{#tag}} on it and otherwise only space.\n function stripSpace () {\n if (hasTag && !nonSpace) {\n while (spaces.length)\n delete tokens[spaces.pop()];\n } else {\n spaces = [];\n }\n\n hasTag = false;\n nonSpace = false;\n }\n\n var openingTagRe, closingTagRe, closingCurlyRe;\n function compileTags (tagsToCompile) {\n if (typeof tagsToCompile === 'string')\n tagsToCompile = tagsToCompile.split(spaceRe, 2);\n\n if (!isArray(tagsToCompile) || tagsToCompile.length !== 2)\n throw new Error('Invalid tags: ' + tagsToCompile);\n\n openingTagRe = new RegExp(escapeRegExp(tagsToCompile[0]) + '\\\\s*');\n closingTagRe = new RegExp('\\\\s*' + escapeRegExp(tagsToCompile[1]));\n closingCurlyRe = new RegExp('\\\\s*' + escapeRegExp('}' + tagsToCompile[1]));\n }\n\n compileTags(tags || mustache.tags);\n\n var scanner = new Scanner(template);\n\n var start, type, value, chr, token, openSection;\n while (!scanner.eos()) {\n start = scanner.pos;\n\n // Match any text between tags.\n value = scanner.scanUntil(openingTagRe);\n\n if (value) {\n for (var i = 0, valueLength = value.length; i < valueLength; ++i) {\n chr = value.charAt(i);\n\n if (isWhitespace(chr)) {\n spaces.push(tokens.length);\n indentation += chr;\n } else {\n nonSpace = true;\n lineHasNonSpace = true;\n indentation += ' ';\n }\n\n tokens.push([ 'text', chr, start, start + 1 ]);\n start += 1;\n\n // Check for whitespace on the current line.\n if (chr === '\\n') {\n stripSpace();\n indentation = '';\n tagIndex = 0;\n lineHasNonSpace = false;\n }\n }\n }\n\n // Match the opening tag.\n if (!scanner.scan(openingTagRe))\n break;\n\n hasTag = true;\n\n // Get the tag type.\n type = scanner.scan(tagRe) || 'name';\n scanner.scan(whiteRe);\n\n // Get the tag value.\n if (type === '=') {\n value = scanner.scanUntil(equalsRe);\n scanner.scan(equalsRe);\n scanner.scanUntil(closingTagRe);\n } else if (type === '{') {\n value = scanner.scanUntil(closingCurlyRe);\n scanner.scan(curlyRe);\n scanner.scanUntil(closingTagRe);\n type = '&';\n } else {\n value = scanner.scanUntil(closingTagRe);\n }\n\n // Match the closing tag.\n if (!scanner.scan(closingTagRe))\n throw new Error('Unclosed tag at ' + scanner.pos);\n\n if (type == '>') {\n token = [ type, value, start, scanner.pos, indentation, tagIndex, lineHasNonSpace ];\n } else {\n token = [ type, value, start, scanner.pos ];\n }\n tagIndex++;\n tokens.push(token);\n\n if (type === '#' || type === '^') {\n sections.push(token);\n } else if (type === '/') {\n // Check section nesting.\n openSection = sections.pop();\n\n if (!openSection)\n throw new Error('Unopened section \"' + value + '\" at ' + start);\n\n if (openSection[1] !== value)\n throw new Error('Unclosed section \"' + openSection[1] + '\" at ' + start);\n } else if (type === 'name' || type === '{' || type === '&') {\n nonSpace = true;\n } else if (type === '=') {\n // Set the tags for the next time around.\n compileTags(value);\n }\n }\n\n stripSpace();\n\n // Make sure there are no open sections when we're done.\n openSection = sections.pop();\n\n if (openSection)\n throw new Error('Unclosed section \"' + openSection[1] + '\" at ' + scanner.pos);\n\n return nestTokens(squashTokens(tokens));\n }\n\n /**\n * Combines the values of consecutive text tokens in the given `tokens` array\n * to a single token.\n */\n function squashTokens (tokens) {\n var squashedTokens = [];\n\n var token, lastToken;\n for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {\n token = tokens[i];\n\n if (token) {\n if (token[0] === 'text' && lastToken && lastToken[0] === 'text') {\n lastToken[1] += token[1];\n lastToken[3] = token[3];\n } else {\n squashedTokens.push(token);\n lastToken = token;\n }\n }\n }\n\n return squashedTokens;\n }\n\n /**\n * Forms the given array of `tokens` into a nested tree structure where\n * tokens that represent a section have two additional items: 1) an array of\n * all tokens that appear in that section and 2) the index in the original\n * template that represents the end of that section.\n */\n function nestTokens (tokens) {\n var nestedTokens = [];\n var collector = nestedTokens;\n var sections = [];\n\n var token, section;\n for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {\n token = tokens[i];\n\n switch (token[0]) {\n case '#':\n case '^':\n collector.push(token);\n sections.push(token);\n collector = token[4] = [];\n break;\n case '/':\n section = sections.pop();\n section[5] = token[2];\n collector = sections.length > 0 ? sections[sections.length - 1][4] : nestedTokens;\n break;\n default:\n collector.push(token);\n }\n }\n\n return nestedTokens;\n }\n\n /**\n * A simple string scanner that is used by the template parser to find\n * tokens in template strings.\n */\n function Scanner (string) {\n this.string = string;\n this.tail = string;\n this.pos = 0;\n }\n\n /**\n * Returns `true` if the tail is empty (end of string).\n */\n Scanner.prototype.eos = function eos () {\n return this.tail === '';\n };\n\n /**\n * Tries to match the given regular expression at the current position.\n * Returns the matched text if it can match, the empty string otherwise.\n */\n Scanner.prototype.scan = function scan (re) {\n var match = this.tail.match(re);\n\n if (!match || match.index !== 0)\n return '';\n\n var string = match[0];\n\n this.tail = this.tail.substring(string.length);\n this.pos += string.length;\n\n return string;\n };\n\n /**\n * Skips all text until the given regular expression can be matched. Returns\n * the skipped string, which is the entire tail if no match can be made.\n */\n Scanner.prototype.scanUntil = function scanUntil (re) {\n var index = this.tail.search(re), match;\n\n switch (index) {\n case -1:\n match = this.tail;\n this.tail = '';\n break;\n case 0:\n match = '';\n break;\n default:\n match = this.tail.substring(0, index);\n this.tail = this.tail.substring(index);\n }\n\n this.pos += match.length;\n\n return match;\n };\n\n /**\n * Represents a rendering context by wrapping a view object and\n * maintaining a reference to the parent context.\n */\n function Context (view, parentContext) {\n this.view = view;\n this.cache = { '.': this.view };\n this.parent = parentContext;\n }\n\n /**\n * Creates a new context using the given view with this context\n * as the parent.\n */\n Context.prototype.push = function push (view) {\n return new Context(view, this);\n };\n\n /**\n * Returns the value of the given name in this context, traversing\n * up the context hierarchy if the value is absent in this context's view.\n */\n Context.prototype.lookup = function lookup (name) {\n var cache = this.cache;\n\n var value;\n if (cache.hasOwnProperty(name)) {\n value = cache[name];\n } else {\n var context = this, intermediateValue, names, index, lookupHit = false;\n\n while (context) {\n if (name.indexOf('.') > 0) {\n intermediateValue = context.view;\n names = name.split('.');\n index = 0;\n\n /**\n * Using the dot notion path in `name`, we descend through the\n * nested objects.\n *\n * To be certain that the lookup has been successful, we have to\n * check if the last object in the path actually has the property\n * we are looking for. We store the result in `lookupHit`.\n *\n * This is specially necessary for when the value has been set to\n * `undefined` and we want to avoid looking up parent contexts.\n *\n * In the case where dot notation is used, we consider the lookup\n * to be successful even if the last \"object\" in the path is\n * not actually an object but a primitive (e.g., a string, or an\n * integer), because it is sometimes useful to access a property\n * of an autoboxed primitive, such as the length of a string.\n **/\n while (intermediateValue != null && index < names.length) {\n if (index === names.length - 1)\n lookupHit = (\n hasProperty(intermediateValue, names[index])\n || primitiveHasOwnProperty(intermediateValue, names[index])\n );\n\n intermediateValue = intermediateValue[names[index++]];\n }\n } else {\n intermediateValue = context.view[name];\n\n /**\n * Only checking against `hasProperty`, which always returns `false` if\n * `context.view` is not an object. Deliberately omitting the check\n * against `primitiveHasOwnProperty` if dot notation is not used.\n *\n * Consider this example:\n * ```\n * Mustache.render(\"The length of a football field is {{#length}}{{length}}{{/length}}.\", {length: \"100 yards\"})\n * ```\n *\n * If we were to check also against `primitiveHasOwnProperty`, as we do\n * in the dot notation case, then render call would return:\n *\n * \"The length of a football field is 9.\"\n *\n * rather than the expected:\n *\n * \"The length of a football field is 100 yards.\"\n **/\n lookupHit = hasProperty(context.view, name);\n }\n\n if (lookupHit) {\n value = intermediateValue;\n break;\n }\n\n context = context.parent;\n }\n\n cache[name] = value;\n }\n\n if (isFunction(value))\n value = value.call(this.view);\n\n return value;\n };\n\n /**\n * A Writer knows how to take a stream of tokens and render them to a\n * string, given a context. It also maintains a cache of templates to\n * avoid the need to parse the same template twice.\n */\n function Writer () {\n this.templateCache = {\n _cache: {},\n set: function set (key, value) {\n this._cache[key] = value;\n },\n get: function get (key) {\n return this._cache[key];\n },\n clear: function clear () {\n this._cache = {};\n }\n };\n }\n\n /**\n * Clears all cached templates in this writer.\n */\n Writer.prototype.clearCache = function clearCache () {\n if (typeof this.templateCache !== 'undefined') {\n this.templateCache.clear();\n }\n };\n\n /**\n * Parses and caches the given `template` according to the given `tags` or\n * `mustache.tags` if `tags` is omitted, and returns the array of tokens\n * that is generated from the parse.\n */\n Writer.prototype.parse = function parse (template, tags) {\n var cache = this.templateCache;\n var cacheKey = template + ':' + (tags || mustache.tags).join(':');\n var isCacheEnabled = typeof cache !== 'undefined';\n var tokens = isCacheEnabled ? cache.get(cacheKey) : undefined;\n\n if (tokens == undefined) {\n tokens = parseTemplate(template, tags);\n isCacheEnabled && cache.set(cacheKey, tokens);\n }\n return tokens;\n };\n\n /**\n * High-level method that is used to render the given `template` with\n * the given `view`.\n *\n * The optional `partials` argument may be an object that contains the\n * names and templates of partials that are used in the template. It may\n * also be a function that is used to load partial templates on the fly\n * that takes a single argument: the name of the partial.\n *\n * If the optional `config` argument is given here, then it should be an\n * object with a `tags` attribute or an `escape` attribute or both.\n * If an array is passed, then it will be interpreted the same way as\n * a `tags` attribute on a `config` object.\n *\n * The `tags` attribute of a `config` object must be an array with two\n * string values: the opening and closing tags used in the template (e.g.\n * [ \"<%\", \"%>\" ]). The default is to mustache.tags.\n *\n * The `escape` attribute of a `config` object must be a function which\n * accepts a string as input and outputs a safely escaped string.\n * If an `escape` function is not provided, then an HTML-safe string\n * escaping function is used as the default.\n */\n Writer.prototype.render = function render (template, view, partials, config) {\n var tags = this.getConfigTags(config);\n var tokens = this.parse(template, tags);\n var context = (view instanceof Context) ? view : new Context(view, undefined);\n return this.renderTokens(tokens, context, partials, template, config);\n };\n\n /**\n * Low-level method that renders the given array of `tokens` using\n * the given `context` and `partials`.\n *\n * Note: The `originalTemplate` is only ever used to extract the portion\n * of the original template that was contained in a higher-order section.\n * If the template doesn't use higher-order sections, this argument may\n * be omitted.\n */\n Writer.prototype.renderTokens = function renderTokens (tokens, context, partials, originalTemplate, config) {\n var buffer = '';\n\n var token, symbol, value;\n for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {\n value = undefined;\n token = tokens[i];\n symbol = token[0];\n\n if (symbol === '#') value = this.renderSection(token, context, partials, originalTemplate, config);\n else if (symbol === '^') value = this.renderInverted(token, context, partials, originalTemplate, config);\n else if (symbol === '>') value = this.renderPartial(token, context, partials, config);\n else if (symbol === '&') value = this.unescapedValue(token, context);\n else if (symbol === 'name') value = this.escapedValue(token, context, config);\n else if (symbol === 'text') value = this.rawValue(token);\n\n if (value !== undefined)\n buffer += value;\n }\n\n return buffer;\n };\n\n Writer.prototype.renderSection = function renderSection (token, context, partials, originalTemplate, config) {\n var self = this;\n var buffer = '';\n var value = context.lookup(token[1]);\n\n // This function is used to render an arbitrary template\n // in the current context by higher-order sections.\n function subRender (template) {\n return self.render(template, context, partials, config);\n }\n\n if (!value) return;\n\n if (isArray(value)) {\n for (var j = 0, valueLength = value.length; j < valueLength; ++j) {\n buffer += this.renderTokens(token[4], context.push(value[j]), partials, originalTemplate, config);\n }\n } else if (typeof value === 'object' || typeof value === 'string' || typeof value === 'number') {\n buffer += this.renderTokens(token[4], context.push(value), partials, originalTemplate, config);\n } else if (isFunction(value)) {\n if (typeof originalTemplate !== 'string')\n throw new Error('Cannot use higher-order sections without the original template');\n\n // Extract the portion of the original template that the section contains.\n value = value.call(context.view, originalTemplate.slice(token[3], token[5]), subRender);\n\n if (value != null)\n buffer += value;\n } else {\n buffer += this.renderTokens(token[4], context, partials, originalTemplate, config);\n }\n return buffer;\n };\n\n Writer.prototype.renderInverted = function renderInverted (token, context, partials, originalTemplate, config) {\n var value = context.lookup(token[1]);\n\n // Use JavaScript's definition of falsy. Include empty arrays.\n // See https://github.com/janl/mustache.js/issues/186\n if (!value || (isArray(value) && value.length === 0))\n return this.renderTokens(token[4], context, partials, originalTemplate, config);\n };\n\n Writer.prototype.indentPartial = function indentPartial (partial, indentation, lineHasNonSpace) {\n var filteredIndentation = indentation.replace(/[^ \\t]/g, '');\n var partialByNl = partial.split('\\n');\n for (var i = 0; i < partialByNl.length; i++) {\n if (partialByNl[i].length && (i > 0 || !lineHasNonSpace)) {\n partialByNl[i] = filteredIndentation + partialByNl[i];\n }\n }\n return partialByNl.join('\\n');\n };\n\n Writer.prototype.renderPartial = function renderPartial (token, context, partials, config) {\n if (!partials) return;\n var tags = this.getConfigTags(config);\n\n var value = isFunction(partials) ? partials(token[1]) : partials[token[1]];\n if (value != null) {\n var lineHasNonSpace = token[6];\n var tagIndex = token[5];\n var indentation = token[4];\n var indentedValue = value;\n if (tagIndex == 0 && indentation) {\n indentedValue = this.indentPartial(value, indentation, lineHasNonSpace);\n }\n var tokens = this.parse(indentedValue, tags);\n return this.renderTokens(tokens, context, partials, indentedValue, config);\n }\n };\n\n Writer.prototype.unescapedValue = function unescapedValue (token, context) {\n var value = context.lookup(token[1]);\n if (value != null)\n return value;\n };\n\n Writer.prototype.escapedValue = function escapedValue (token, context, config) {\n var escape = this.getConfigEscape(config) || mustache.escape;\n var value = context.lookup(token[1]);\n if (value != null)\n return (typeof value === 'number' && escape === mustache.escape) ? String(value) : escape(value);\n };\n\n Writer.prototype.rawValue = function rawValue (token) {\n return token[1];\n };\n\n Writer.prototype.getConfigTags = function getConfigTags (config) {\n if (isArray(config)) {\n return config;\n }\n else if (config && typeof config === 'object') {\n return config.tags;\n }\n else {\n return undefined;\n }\n };\n\n Writer.prototype.getConfigEscape = function getConfigEscape (config) {\n if (config && typeof config === 'object' && !isArray(config)) {\n return config.escape;\n }\n else {\n return undefined;\n }\n };\n\n var mustache = {\n name: 'mustache.js',\n version: '4.2.0',\n tags: [ '{{', '}}' ],\n clearCache: undefined,\n escape: undefined,\n parse: undefined,\n render: undefined,\n Scanner: undefined,\n Context: undefined,\n Writer: undefined,\n /**\n * Allows a user to override the default caching strategy, by providing an\n * object with set, get and clear methods. This can also be used to disable\n * the cache by setting it to the literal `undefined`.\n */\n set templateCache (cache) {\n defaultWriter.templateCache = cache;\n },\n /**\n * Gets the default or overridden caching object from the default writer.\n */\n get templateCache () {\n return defaultWriter.templateCache;\n }\n };\n\n // All high-level mustache.* functions use this writer.\n var defaultWriter = new Writer();\n\n /**\n * Clears all cached templates in the default writer.\n */\n mustache.clearCache = function clearCache () {\n return defaultWriter.clearCache();\n };\n\n /**\n * Parses and caches the given template in the default writer and returns the\n * array of tokens it contains. Doing this ahead of time avoids the need to\n * parse templates on the fly as they are rendered.\n */\n mustache.parse = function parse (template, tags) {\n return defaultWriter.parse(template, tags);\n };\n\n /**\n * Renders the `template` with the given `view`, `partials`, and `config`\n * using the default writer.\n */\n mustache.render = function render (template, view, partials, config) {\n if (typeof template !== 'string') {\n throw new TypeError('Invalid template! Template should be a \"string\" ' +\n 'but \"' + typeStr(template) + '\" was given as the first ' +\n 'argument for mustache#render(template, view, partials)');\n }\n\n return defaultWriter.render(template, view, partials, config);\n };\n\n // Export the escaping function so that the user may override it.\n // See https://github.com/janl/mustache.js/issues/244\n mustache.escape = escapeHtml;\n\n // Export these mainly for testing, but also for advanced usage.\n mustache.Scanner = Scanner;\n mustache.Context = Context;\n mustache.Writer = Writer;\n\n return mustache;\n\n})));\n"]}