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AG3Bqe,EAAKrD,QAAQrZ,YAAc,GAAGge,IAAaC,KAAeE,KAAiBC,IAEvER,EAAO,GAAKC,EAAQ,GAAKC,EAAU,GAAKC,EAAU,IAEjDhkB,KAAKkiB,eAAiB,GAGzBqB,GAAc,GAEVM,EAAO,GAAKC,EAAQ,GAAKC,EAAU,GAAKC,EAAU,KAErDR,GAA8B,IAM/Bc,cAActkB,KAAKkjB,iBAErB,IAGGK,IAGHe,cAActkB,KAAKkjB,iBAKlBljB,KAAKkiB,eAHFsB,EAAe,EAGIxjB,KAAKkiB,eAAiB,EAKtB,EAGvBnhB,OAAOwjB,YAAW,MAGM,IAAI,KACZzE,UACbtgB,MAAK,UAEyB,IAAnB,UAAqE,IAA5B,IAAe0J,UAGlElJ,KAAK+I,yBACL,IAEDtC,OAAM,KAENE,QAAQC,IAAI,gDAAgD,GAC3D,GACD,KACJ,EAGM,KAAAmC,wBAA0B,UAEO,IAA5B,IAAeG,WAEzBlJ,KAAKwkB,QAAU,IAAetb,SAASub,mBACvCzkB,KAAKqiB,UAAYpjB,SAASH,cAAc,2BAEnB0P,IAAjBxO,KAAKwkB,SAA0C,OAAjBxkB,KAAKwkB,SAAoBxkB,KAAKwkB,QAAQlf,OAAS,EAEhFtF,KAAKmJ,aAEsB,OAAnBnJ,KAAKqiB,WAGbriB,KAAKqiB,UAAU3c,SAEjB,CAxLD,CAEO,UAAAyD,GAEiB,OAAnBnJ,KAAKqiB,YAERriB,KAAKwkB,QAAQtd,SAAQqI,IAEhBA,EAAO+P,QAAQne,QAAQ,0BAA4B,IAEtDnB,KAAKqiB,UAAU9e,UAAYvD,KAAKsjB,aAAa/T,EAAOiQ,MACrD,IAGDxf,KAAKmiB,kBAEP,E","sources":["webpack:///./src/Base/Templates/BootstrapModal.hbs","webpack:///./src/Base/Templates/CouponModal.hbs","webpack:///./src/Base/Engagement/SubscriptionBase.ts","webpack:///./src/Base/Site/DropOption.ts","webpack:///./src/Base/Site/FooterBase.ts","webpack:///./src/Base/Site/SearchBase.ts","webpack:///./src/Base/Site/HeaderBase.ts","webpack:///./src/Base/Engagement/Recommendations.ts","webpack:///./src/Base/Site/_Window.ts","webpack:///./src/Base/Site/SiteBase.ts","webpack:///./src/Base/Site/SiteListBase.ts","webpack:///./src/Base/Site/TransitBannerBase.ts"],"sourcesContent":["var Handlebars = require(\"../../../node_modules/handlebars/runtime.js\");\nfunction __default(obj) { return obj && (obj.__esModule ? obj[\"default\"] : obj); }\nmodule.exports = (Handlebars[\"default\"] || Handlebars).template({\"1\":function(container,depth0,helpers,partials,data) {\n var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n };\n\n return \" aria-labelledby=\\\"\"\n + container.escapeExpression(((helper = (helper = lookupProperty(helpers,\"modalId\") || (depth0 != null ? lookupProperty(depth0,\"modalId\") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === \"function\" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{\"name\":\"modalId\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":1,\"column\":106},\"end\":{\"line\":1,\"column\":117}}}) : helper)))\n + \"Label\\\" \";\n},\"3\":function(container,depth0,helpers,partials,data) {\n return \"border-bottom-0\";\n},\"5\":function(container,depth0,helpers,partials,data) {\n var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=\"function\", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n };\n\n return \"\t\t\t\t
\"\n + alias4(((helper = (helper = lookupProperty(helpers,\"modalTitle\") || (depth0 != null ? lookupProperty(depth0,\"modalTitle\") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"modalTitle\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":6,\"column\":50},\"end\":{\"line\":6,\"column\":64}}}) : helper)))\n + \"
\\r\\n\";\n},\"7\":function(container,depth0,helpers,partials,data) {\n var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n };\n\n return \"\t\t\t
\\r\\n\"\n + ((stack1 = lookupProperty(helpers,\"if\").call(alias1,(depth0 != null ? lookupProperty(depth0,\"cancelButton\") : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(8, data, 0),\"inverse\":container.noop,\"data\":data,\"loc\":{\"start\":{\"line\":15,\"column\":4},\"end\":{\"line\":17,\"column\":11}}})) != null ? stack1 : \"\")\n + ((stack1 = lookupProperty(helpers,\"if\").call(alias1,(depth0 != null ? lookupProperty(depth0,\"confirmButton\") : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(10, data, 0),\"inverse\":container.noop,\"data\":data,\"loc\":{\"start\":{\"line\":18,\"column\":4},\"end\":{\"line\":20,\"column\":11}}})) != null ? stack1 : \"\")\n + \"\t\t\t
\\r\\n\";\n},\"8\":function(container,depth0,helpers,partials,data) {\n var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n };\n\n return \"\t\t\t\t\\r\\n\";\n},\"10\":function(container,depth0,helpers,partials,data) {\n var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n };\n\n return \"\t\t\t\t\\r\\n\";\n},\"compiler\":[8,\">= 4.3.0\"],\"main\":function(container,depth0,helpers,partials,data) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=\"function\", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n };\n\n return \"
\\r\\n\t
\\r\\n\t\t
\\r\\n\t\t\t
\\r\\n\"\n + ((stack1 = lookupProperty(helpers,\"if\").call(alias1,(depth0 != null ? lookupProperty(depth0,\"modalTitle\") : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(5, data, 0),\"inverse\":container.noop,\"data\":data,\"loc\":{\"start\":{\"line\":5,\"column\":4},\"end\":{\"line\":7,\"column\":11}}})) != null ? stack1 : \"\")\n + \"\t\t\t\t\\r\\n\t\t\t
\\r\\n\t\t\t
\\r\\n\t\t\t\t\"\n + ((stack1 = ((helper = (helper = lookupProperty(helpers,\"modalContent\") || (depth0 != null ? lookupProperty(depth0,\"modalContent\") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"modalContent\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":11,\"column\":4},\"end\":{\"line\":11,\"column\":22}}}) : helper))) != null ? stack1 : \"\")\n + \"\\r\\n\t\t\t
\\r\\n\"\n + ((stack1 = lookupProperty(helpers,\"if\").call(alias1,(depth0 != null ? lookupProperty(depth0,\"displayButtons\") : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(7, data, 0),\"inverse\":container.noop,\"data\":data,\"loc\":{\"start\":{\"line\":13,\"column\":3},\"end\":{\"line\":22,\"column\":10}}})) != null ? stack1 : \"\")\n + \"\t\t
\\r\\n\t
\\r\\n
\";\n},\"useData\":true});","var Handlebars = require(\"../../../node_modules/handlebars/runtime.js\");\nfunction __default(obj) { return obj && (obj.__esModule ? obj[\"default\"] : obj); }\nmodule.exports = (Handlebars[\"default\"] || Handlebars).template({\"1\":function(container,depth0,helpers,partials,data) {\n var stack1, helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n };\n\n return \"\t\t\t\t\t
\\r\\n\t\t\t\t\t\t\"\n + ((stack1 = ((helper = (helper = lookupProperty(helpers,\"couponText\") || (depth0 != null ? lookupProperty(depth0,\"couponText\") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === \"function\" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{\"name\":\"couponText\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":14,\"column\":6},\"end\":{\"line\":14,\"column\":22}}}) : helper))) != null ? stack1 : \"\")\n + \"\\r\\n\t\t\t\t\t
\\r\\n\";\n},\"compiler\":[8,\">= 4.3.0\"],\"main\":function(container,depth0,helpers,partials,data) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=\"function\", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n };\n\n return \"
\\r\\n\t
\\r\\n\t\t
\\r\\n\t\t\t
\\r\\n\t\t\t\t\\r\\n\t\t\t\t\\\"\"\n\\r\\n\t\t\t
\\r\\n\t\t\t
\\r\\n\t\t\t\t
\\r\\n\t\t\t\t\t
\"\n + alias4(((helper = (helper = lookupProperty(helpers,\"statusHeadline\") || (depth0 != null ? lookupProperty(depth0,\"statusHeadline\") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"statusHeadline\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":10,\"column\":43},\"end\":{\"line\":10,\"column\":61}}}) : helper)))\n + \"
\\r\\n\t\t\t\t\t\"\n + alias4(((helper = (helper = lookupProperty(helpers,\"statusSubtitle\") || (depth0 != null ? lookupProperty(depth0,\"statusSubtitle\") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"statusSubtitle\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":11,\"column\":5},\"end\":{\"line\":11,\"column\":23}}}) : helper)))\n + \"\\r\\n\"\n + ((stack1 = lookupProperty(helpers,\"if\").call(alias1,(depth0 != null ? lookupProperty(depth0,\"validCoupon\") : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(1, data, 0),\"inverse\":container.noop,\"data\":data,\"loc\":{\"start\":{\"line\":12,\"column\":5},\"end\":{\"line\":16,\"column\":12}}})) != null ? stack1 : \"\")\n + \"\t\t\t\t
\\r\\n\t\t\t
\\r\\n\t\t\t\\r\\n\t\t
\\r\\n\t
\\r\\n
\";\n},\"useData\":true});","import { AxiosResponse } from 'axios';\r\nimport { CookieManager } from \"@Utilities/CookieManager\";\r\nimport { TextResource } from \"@Utilities/TextResource\";\r\nimport { Validation } from \"@Validation/Validation\";\r\nimport { EngagementProvider } from \"./Engagement\";\r\nimport { Tenant } from \"@Utilities/Tenant\";\r\nimport queryString from \"query-string\";\r\nimport { DataPrivacyPolicy } from \"@Utilities/DataPrivacyPolicy\";\r\nimport Modal from \"bootstrap/js/dist/modal\";\r\nimport { ModalTools } from \"@Utilities/ModalTools\";\r\nimport { SubscriptionService } from '@Api/SubscriptionService';\r\n\r\nexport interface IEmailAcquisitionModal\r\n{\r\n\tsubscriptionId: string,\r\n\tprc: string,\r\n\ttxtName: string,\r\n\thasOffer: boolean,\r\n\tlogo: {\r\n\t\talt: string,\r\n\t\tsrc: string,\r\n\t\twidth: number,\r\n\t\theight: number;\r\n\t};\r\n}\r\n\r\nexport class SubscriptionBase\r\n{\r\n\tprivate readonly dataPrivacyPolicy: DataPrivacyPolicy;\r\n\tprivate readonly engagementProvider: EngagementProvider;\r\n\r\n\tconstructor()\r\n\t{\r\n\t\tthis.dataPrivacyPolicy = new DataPrivacyPolicy();\r\n\t\tthis.engagementProvider = new EngagementProvider();\r\n\t}\r\n\r\n\tprivate MaskPhoneInput = (form: HTMLFormElement): void =>\r\n\t{\r\n\t\tif (form.getAttribute(\"data-show-phone\") !== null && form.getAttribute(\"data-show-phone\") === \"true\")\r\n\t\t{\r\n\t\t\tconst phoneCheck: HTMLInputElement = form.querySelector(\"#chkPhone\");\r\n\t\t\tconst phoneCollapse: HTMLElement = form.querySelector(\"#collapsePhone\");\r\n\t\t\tconst phoneInput = document.getElementById(\"txtPhone\");\r\n\t\t\tlet maskFormat = \"000-000-0000\";\r\n\r\n\t\t\tif (Tenant.DomainProjectID == Tenant.ID.HalloweenCostumesAU)\r\n\t\t\t{\r\n\t\t\t\tmaskFormat = \"0000 000 000\";\r\n\t\t\t}\r\n\r\n\t\t\tif (phoneInput !== null)\r\n\t\t\t{\r\n\t\t\t\tphoneInput.addEventListener(\"focusin\", () =>\r\n\t\t\t\t{\r\n\t\t\t\t\timport(\"imask\")\r\n\t\t\t\t\t\t.then((IMask) =>\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tconst phoneMask = new IMask.InputMask(phoneInput, {\r\n\t\t\t\t\t\t\t\tmask: maskFormat\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t});\r\n\t\t\t\t}, { once: true });\r\n\r\n\t\t\t\tif (phoneCheck !== null && phoneCollapse !== null)\r\n\t\t\t\t{\r\n\t\t\t\t\tphoneCheck.addEventListener(\"change\", () =>\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (phoneCollapse.style.display === \"none\")\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tphoneCollapse.style.display = \"block\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tphoneCollapse.style.display = \"none\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tpublic get GenericText(): string\r\n\t{\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\tpublic get GenericThanks(): string\r\n\t{\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\tpublic GetEmailAcquisitionModalHtml(config: IEmailAcquisitionModal): string\r\n\t{\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\tpublic ConfigureForm = (form: HTMLFormElement): void =>\r\n\t{\r\n\t\tif (form !== null)\r\n\t\t{\r\n\t\t\tthis.MaskPhoneInput(form);\r\n\t\t\tthis.CheckExclusions(form);\r\n\r\n\t\t\tif (!Tenant.ThirdPartyModalEnabled)\r\n\t\t\t{\r\n\t\t\t\tthis.EvaluateEmailAcquisitionModal(form);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tpublic CheckExclusions = (form: HTMLFormElement): void =>\r\n\t{\r\n\t\tconst returnVisitorCookie = CookieManager.Cookies.ReturnVisitor;\r\n\t\tconst hasOrdered = (CookieManager.GetCookie(returnVisitorCookie.Key, returnVisitorCookie.Ordered) === \"true\");\r\n\t\tconst genericSubscriptionId = form.getAttribute(\"data-sub-generic\");\r\n\r\n\t\tif (hasOrdered === true && typeof genericSubscriptionId !== \"undefined\" && genericSubscriptionId !== \"\")\r\n\t\t{\r\n\t\t\tthis.MakeFormGeneric(form, genericSubscriptionId);\r\n\t\t}\r\n\t};\r\n\r\n\tpublic EvaluateEmailAcquisitionModal = (frmSubscribe: HTMLFormElement): void =>\r\n\t{\r\n\t\tconst url = window.location.href.split('?')[0];\r\n\t\tconst index = url.indexOf(\"/account/reviews/\");\r\n\t\tlet forceModal = false;\r\n\r\n\t\tif (location.search !== \"\")\r\n\t\t{\r\n\t\t\tconst parsed = queryString.parse(location.search, { parseBooleans: true });\r\n\t\t\tforceModal = parsed.EmailModal as boolean;\r\n\t\t}\r\n\r\n\t\tif (index > -1)\r\n\t\t{\r\n\t\t\t// Prevent modal on review pages because they usually come from an email and don't want to interfere with that. Per Joe B. 10/2018\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif ((forceModal === true || CookieManager.GetCookie(CookieManager.Cookies.SeenModal.Key) !== \"true\") && this.dataPrivacyPolicy.DisplayModal === false)\r\n\t\t{\r\n\t\t\tconst delayModal = CookieManager.GetCookie(CookieManager.Cookies.DelayModal.Key);\r\n\r\n\t\t\t//Check for modal delay cookie\r\n\t\t\tif (delayModal !== \"\")\r\n\t\t\t{\r\n\t\t\t\tconst pages = parseInt(delayModal);\r\n\r\n\t\t\t\tif (!isNaN(pages) && pages > 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tCookieManager.SetCookie(\"delayModal\", (pages - 1).toString());\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tCookieManager.SetCookie(\"delayModal\", \"\");\r\n\t\t\t\t\tthis.RenderEmailAcquisitionModal(\"true\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tthis.RenderEmailAcquisitionModal(\"true\");\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// update this html for attentive\r\n\t/**\r\n\t * SHows our self hosted email acquisiton modal.\r\n\t * @param force\r\n\t * @param subscriptionId\r\n\t * @param prc\r\n\t * @param txtName\r\n\t */\r\n\tpublic RenderEmailAcquisitionModal = (force?: string, subscriptionId?: string, prc?: string, txtName?: string): void =>\r\n\t{\r\n\t\tconst frmSubscribe = document.querySelector(\"#frmSubscribe\");\r\n\t\tconst parsed = queryString.parse(location.search);\r\n\t\tconst forceQueryString = parsed.EmailModal as string;\r\n\r\n\t\tif (frmSubscribe !== null)\r\n\t\t{\r\n\t\t\t//@ts-expect-error noModal MIGHT exist\r\n\t\t\tif (force || forceQueryString || (typeof noModal === \"undefined\" && CookieManager.GetCookie(CookieManager.Cookies.SeenModal) !== \"true\" && frmSubscribe.classList.contains(\"emailAcq\")))\r\n\t\t\t{\r\n\t\t\t\tconst returnVisitorCookie = CookieManager.Cookies.ReturnVisitor;\r\n\t\t\t\tconst hasOrdered = CookieManager.GetCookie(returnVisitorCookie.Key, returnVisitorCookie.Ordered) == \"true\";\r\n\t\t\t\tlet hasOffer = true;\r\n\r\n\t\t\t\tif (typeof subscriptionId === \"undefined\")\r\n\t\t\t\t{\r\n\t\t\t\t\t// no subscriptionId...fetch it from the footer, first the generic one\r\n\t\t\t\t\tlet frmSubscribeAttribute;\r\n\r\n\t\t\t\t\tif (hasOrdered)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfrmSubscribeAttribute = frmSubscribe.getAttribute(\"data-sub-generic\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// if the user hasn't ordered or if the generic offer above isn't defined use the data-sub attribute\r\n\t\t\t\t\tif (!hasOrdered || typeof frmSubscribeAttribute === \"undefined\")\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfrmSubscribeAttribute = frmSubscribe.getAttribute(\"data-sub\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// swap footer with popup\r\n\t\t\t\t\tsubscriptionId = frmSubscribeAttribute.replace(\"Footer\", \"Popup\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (typeof prc === \"undefined\")\r\n\t\t\t\t{\r\n\t\t\t\t\tprc = frmSubscribe.getAttribute(\"data-prc\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (isNaN(parseInt(prc)) || parseInt(prc) === 0 || hasOrdered)\r\n\t\t\t\t{\r\n\t\t\t\t\thasOffer = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (typeof txtName === \"undefined\")\r\n\t\t\t\t{\r\n\t\t\t\t\ttxtName = document.querySelector(\"#txtSubscribe\").getAttribute(\"name\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst logoEl = document.querySelector(\".navbar-brand img\") as HTMLImageElement;\r\n\r\n\t\t\t\tconst logo = {\r\n\t\t\t\t\talt: logoEl.alt,\r\n\t\t\t\t\tsrc: logoEl.src,\r\n\t\t\t\t\twidth: logoEl.width,\r\n\t\t\t\t\theight: logoEl.height\r\n\t\t\t\t};\r\n\r\n\t\t\t\tconst modalWrap = document.createElement(\"div\");\r\n\t\t\t\tmodalWrap.innerHTML = this.GetEmailAcquisitionModalHtml({ subscriptionId: subscriptionId, prc: prc, txtName: txtName, hasOffer: hasOffer, logo: logo });\r\n\t\t\t\tconst modalNode = modalWrap.firstElementChild;\r\n\t\t\t\tdocument.body.appendChild(modalNode);\r\n\t\t\t\tconst emailAcqModal = new Modal(modalNode);\r\n\t\t\t\temailAcqModal.show();\r\n\r\n\t\t\t\tmodalNode.addEventListener(\"hidden.bs.modal\", (event) =>\r\n\t\t\t\t{\r\n\t\t\t\t\tModalTools.ModalDisposer(event.currentTarget);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tCookieManager.SetCookie(CookieManager.Cookies.SeenModal.Key, \"true\", 5);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tpublic MakeFormGeneric = (frmSubscribe: HTMLFormElement, genericSubscriptionId: string): void =>\r\n\t{\r\n\t\tconst subscribeOffer = frmSubscribe.querySelector(\".subscribe__offer\");\r\n\t\tconst subscribeText = frmSubscribe.querySelector(\".subscribe__text\");\r\n\t\tconst subscribeThanks = frmSubscribe.querySelector(\".subscribe__thx\");\r\n\t\tconst subscribeSent = frmSubscribe.querySelector(\".subscribe__sent\");\r\n\r\n\t\tfrmSubscribe.setAttribute(\"data-sub\", genericSubscriptionId);\r\n\t\tsubscribeOffer.classList.add(\"subscribe__offer--generic\");\r\n\t\tsubscribeThanks.classList.add(\"subscribe__thx--generic\");\r\n\t\tsubscribeText.innerHTML = this.GenericText;\r\n\t\tsubscribeSent.innerHTML = this.GenericThanks;\r\n\t};\r\n\r\n\tpublic Submit = (form: HTMLFormElement, showBanner = true, event?: Event): boolean =>\r\n\t{\r\n\t\tif (typeof event !== \"undefined\")\r\n\t\t{\r\n\t\t\tevent.preventDefault();\r\n\t\t}\r\n\r\n\t\t// Reset phone input to empty string if the signup checkbox isn't selected\r\n\t\tconst phoneCheck: HTMLInputElement = form.querySelector(\"#chkPhone\");\r\n\t\tconst phoneInput: HTMLInputElement = form.querySelector(\"input[type=tel]\");\r\n\r\n\t\tif (phoneCheck !== null && phoneInput !== null && !phoneCheck.checked)\r\n\t\t{\r\n\t\t\tphoneInput.value = \"\";\r\n\t\t}\r\n\r\n\t\tconst emailInput: HTMLInputElement = form.querySelector(\"input[type=email]\");\r\n\t\tconst email = emailInput !== null ? emailInput.value : \"\";\r\n\t\tconst isEmailValid = Validation.Email(email);\r\n\t\tconst phone = phoneInput !== null ? phoneInput.value : \"\";\r\n\t\tconst subscriptionId = form.getAttribute(\"data-sub\");\r\n\t\tlet errors = \"\";\r\n\r\n\t\tif (isEmailValid === false)\r\n\t\t{\r\n\t\t\terrors += TextResource.GetTextByCulture(\"Feature_Shipping_ValidEmail\");\r\n\t\t}\r\n\r\n\t\tconst alert = form.querySelector(\".alert\");\r\n\r\n\t\tif (errors.length > 0)\r\n\t\t{\r\n\t\t\tif (alert === null)\r\n\t\t\t{\r\n\t\t\t\tconst alertNode = document.createElement(\"div\");\r\n\t\t\t\talertNode.innerHTML = `
${errors}
`;\r\n\r\n\t\t\t\tform.prepend(alertNode.firstChild);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\talert.innerHTML = errors;\r\n\t\t\t}\r\n\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif (alert !== null)\r\n\t\t\t{\r\n\t\t\t\talert.remove();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.engagementProvider.AddSubscription(phone, email, subscriptionId);\r\n\t\tthis.engagementProvider.CreateGuestAccount(email, phone, isEmailValid, phone !== \"\");\r\n\r\n\t\tconst offer: HTMLElement = form.querySelector(\".subscribe__offer\");\r\n\t\tconst thanks: HTMLElement = form.querySelector(\".subscribe__thx\");\r\n\t\tconst address: HTMLElement = form.querySelector(\".subscribe__address\");\r\n\r\n\t\toffer.style.display = \"none\";\r\n\t\tthanks.style.display = \"block\";\r\n\t\taddress.textContent = email;\r\n\r\n\t\tCookieManager.SetCookie(\"modalSignedUp\", \"true\");\r\n\r\n\t\treturn false;\r\n\t};\r\n\r\n\tpublic UpdateFooter = (): void =>\r\n\t{\r\n\t\tconst subscriptionService = new SubscriptionService();\r\n\t\tsubscriptionService.GetFooter()\r\n\t\t\t.then((response: AxiosResponse) =>\r\n\t\t\t{\r\n\t\t\t\tconst footerHtml = response.data;\r\n\r\n\t\t\t\tif (footerHtml !== \"\")\r\n\t\t\t\t{\r\n\t\t\t\t\tconst footer = document.querySelector(\"#footer-subscribe\");\r\n\r\n\t\t\t\t\tif (footer !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfooter.outerHTML = footerHtml;\r\n\t\t\t\t\t\tconst frmSubscribe = document.querySelector(\"#frmSubscribe\") as HTMLFormElement;\r\n\r\n\t\t\t\t\t\tif (frmSubscribe !== null)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tconst showPhone = frmSubscribe.getAttribute(\"data-show-phone\");\r\n\r\n\t\t\t\t\t\t\tif (showPhone !== null && showPhone === \"true\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tthis.MaskPhoneInput(frmSubscribe);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\t.catch((error) =>\r\n\t\t\t{\r\n\t\t\t\tconsole.log(error);\r\n\t\t\t});\r\n\t};\r\n}","import \"./DropOption.scss\";\r\n\r\nexport class DropOption\r\n{\r\n\tconstructor()\r\n\t{\r\n\t\tthis.ConfigureDropOption();\r\n\t}\r\n\r\n\tstatic GetSelectedValue = (element: HTMLElement): string =>\r\n\t{\r\n\t\tconst selected = element.querySelector(\":checked\") as HTMLInputElement;\r\n\t\treturn selected.value;\r\n\t};\r\n\r\n\tpublic ConfigureDropOption = (selector = \".dropdown.dropoption\"): void =>\r\n\t{\r\n\t\tconst dropOptionContainers: NodeListOf = document.querySelectorAll(selector);\r\n\r\n\t\tdropOptionContainers.forEach(dropOptionContainer =>\r\n\t\t{\r\n\t\t\tdropOptionContainer.setAttribute(\"data-value\", \"\");\r\n\t\t\tthis.DropOptionItemBind(dropOptionContainer);\r\n\t\t});\r\n\t};\r\n\r\n\tprivate DropOptionItemBind = (dropOptionContainer: HTMLElement): void =>\r\n\t{\r\n\t\tconst dropOptionSelections: NodeListOf = dropOptionContainer.querySelectorAll(\".dropdown-item\");\r\n\t\tlet preSelectedIndex: number;\r\n\t\tlet preSelectedValue: string;\r\n\r\n\t\tdropOptionSelections.forEach((selection, index) =>\r\n\t\t{\r\n\t\t\tconst preSelectedInput: HTMLInputElement = selection.querySelector(\":checked\");\r\n\r\n\t\t\t[\"click\", \"keydown\"].forEach(evt =>\r\n\t\t\t{\r\n\t\t\t\tselection.addEventListener(evt, this.DropOptionSelectionHandler);\r\n\t\t\t});\r\n\r\n\t\t\tif (selection.querySelector(\":checked\") !== null)\r\n\t\t\t{\r\n\t\t\t\tpreSelectedIndex = index;\r\n\t\t\t\tpreSelectedValue = preSelectedInput.value;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\tif (preSelectedIndex !== undefined && preSelectedIndex !== null && preSelectedValue !== \"\" && preSelectedValue !== undefined && preSelectedValue !== null)\r\n\t\t{\r\n\t\t\tdropOptionContainer.setAttribute(\"data-value\", preSelectedValue);\r\n\t\t\tdropOptionSelections[preSelectedIndex].click();\r\n\t\t}\r\n\r\n\t\telse if (dropOptionSelections.length === 1)\r\n\t\t{\r\n\t\t\tdropOptionSelections[0].click();\r\n\t\t}\r\n\t};\r\n\r\n\tprivate DropOptionSelectionHandler = (e: Event): void =>\r\n\t{\r\n\t\tif (e.type === \"keydown\")\r\n\t\t{\r\n\t\t\tconst keyboardEvent = e as KeyboardEvent;\r\n\r\n\t\t\tif (keyboardEvent.key == \"Enter\" || keyboardEvent.key === \"Space\")\r\n\t\t\t{\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tconst clickedSelection = e.currentTarget as HTMLElement;\r\n\t\tconst clickedRadio = clickedSelection.querySelector(\"input[type=radio]\") as HTMLInputElement;\r\n\t\tconst changeEvent = new Event(\"change\");\r\n\t\tconst ddl = clickedSelection.closest(\".dropoption\");\r\n\t\tconst form = clickedSelection.closest(\"form\");\r\n\t\tconst activeOption = ddl.querySelector(\".dropdown-item.active\");\r\n\r\n\t\tif (activeOption !== null)\r\n\t\t{\r\n\t\t\tactiveOption.classList.remove(\"active\");\r\n\t\t}\r\n\r\n\t\tif (ddl !== null)\r\n\t\t{\r\n\t\t\tddl.querySelector(\".dropdown-toggle > span\").innerHTML = clickedSelection.querySelector(\"span\").innerHTML;\r\n\t\t\tddl.dispatchEvent(changeEvent);\r\n\r\n\t\t\tif (clickedRadio !== null)\r\n\t\t\t{\r\n\t\t\t\tclickedRadio.checked = true;\r\n\t\t\t\tclickedRadio.dispatchEvent(changeEvent);\r\n\t\t\t\tclickedSelection.classList.add(\"active\");\r\n\t\t\t\tddl.setAttribute(\"data-value\", clickedRadio.value);\r\n\t\t\t}\r\n\r\n\t\t\tif (form !== null)\r\n\t\t\t{\r\n\t\t\t\tform.dispatchEvent(changeEvent);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n}","import { ContentService } from \"@Api/ContentService\";\r\nimport { SubscriptionBase } from \"@Base/Engagement/SubscriptionBase\";\r\n\r\nexport class FooterBase\r\n{\r\n\tprivate readonly contentService: ContentService;\r\n\tpublic FooterForm: HTMLFormElement;\r\n\tpublic Subscription: SubscriptionBase;\r\n\r\n\tconstructor()\r\n\t{\r\n\t}\r\n\r\n\tpublic Initialize(): void\r\n\t{\r\n\t}\r\n\r\n\tpublic ConfigureSubscription(): void\r\n\t{\r\n\t};\r\n\r\n\tprivate DisplaySellDataOptOutLink = (): void =>\r\n\t{\r\n\t\tconst sellLink = document.querySelector(\"#jsSellInfo\");\r\n\r\n\t\tif (sellLink !== null)\r\n\t\t{\r\n\t\t\tsellLink.classList.remove(\"d-none\");\r\n\t\t\tsellLink.classList.add(\"d-block\");\r\n\t\t}\r\n\t};\r\n\r\n\tpublic TriggerContentCallbacks = (): void =>\r\n\t{\r\n\t\tthis.FooterForm = document.getElementById(\"frmSubscribe\") as HTMLFormElement;\r\n\r\n\t\tif (this.FooterForm !== null)\r\n\t\t{\r\n\t\t\tthis.ConfigureSubscription();\r\n\t\t}\r\n\r\n\t\tif (typeof ContentService.Response !== \"undefined\")\r\n\t\t{\r\n\t\t\tif (ContentService.Response.DisplaySellDataOptOutLink)\r\n\t\t\t{\r\n\t\t\t\tthis.DisplaySellDataOptOutLink();\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n}","import autoComplete from \"@tarekraafat/autocomplete.js\";\r\nimport { TagManager } from \"@ThirdParty/TagManager\";\r\nimport { Validation } from \"@Validation/Validation\";\r\n\r\nexport class SearchBase\r\n{\r\n\tprivate AutoCompleteForm: autoComplete;\r\n\tprivate BtnClearSearch: HTMLButtonElement;\r\n\tprivate FrmSearch: HTMLFormElement;\r\n\tprivate TxtSearch: HTMLInputElement;\r\n\r\n\tconstructor()\r\n\t{\r\n\t\tthis.Initialize();\r\n\t}\r\n\r\n\tprivate Initialize = (): void =>\r\n\t{\r\n\t\tthis.ConfigureSearch();\r\n\t\tthis.ConfigureAutoComplete();\r\n\t};\r\n\r\n\tprivate ClearSearchHandler = (): void =>\r\n\t{\r\n\t\tthis.TxtSearch.value = \"\";\r\n\t\tthis.ClearSearchToggle();\r\n\t};\r\n\r\n\tprivate ClearSearchToggle = (): void =>\r\n\t{\r\n\t\tconst btnClearSearch = this.BtnClearSearch;\r\n\t\tconst txtSearch = this.TxtSearch;\r\n\t\tlet display = \"none\";\r\n\r\n\t\tif (txtSearch.value.length > 0)\r\n\t\t{\r\n\t\t\tdisplay = \"\";\r\n\t\t}\r\n\r\n\t\tbtnClearSearch.style.display = display;\r\n\t};\r\n\r\n\tprivate ConfigureAutoComplete = (): void =>\r\n\t{\r\n\t\tthis.AutoCompleteForm = new autoComplete({\r\n\t\t\tselector: \"#txtSearch\",\r\n\t\t\twrapper: false,\r\n\t\t\tplaceHolder: this.TxtSearch.getAttribute(\"placeholder\"),\r\n\t\t\tdata: {\r\n\t\t\t\tsrc: async (): Promise =>\r\n\t\t\t\t{\r\n\t\t\t\t\ttry\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Trim leading and trailing spaces\r\n\t\t\t\t\t\tconst query = this.TxtSearch.value.trim();\r\n\r\n\t\t\t\t\t\tif (query !== \"\")\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Fetch Data from external Source\r\n\t\t\t\t\t\t\tconst source = await fetch(`/api/searchterm/getresults?term=${query}`);\r\n\r\n\t\t\t\t\t\t\t// Data is array of `Objects` | `Strings`\r\n\t\t\t\t\t\t\tconst data = await source.json();\r\n\r\n\t\t\t\t\t\t\treturn data;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\treturn [];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcatch (error)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\treturn error;\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\r\n\t\t\t\t// Data 'Object' key to be searched\r\n\t\t\t\tkeys: [\"label\"]\r\n\t\t\t},\r\n\t\t\tresultItem: {\r\n\t\t\t\telement: (element, data): void =>\r\n\t\t\t\t{\r\n\t\t\t\t\telement.innerHTML = `${data.match}`;\r\n\t\t\t\t},\r\n\t\t\t\thighlight: true\r\n\t\t\t},\r\n\t\t\tresultsList: {\r\n\t\t\t\tid: \"autoCompleteResults\",\r\n\t\t\t\tclass: \"dropdown-menu w-100 top-100\",\r\n\t\t\t\tmaxResult: 10,\r\n\t\t\t\ttabSelect: true,\r\n\t\t\t\tnoResults: false\r\n\t\t\t},\r\n\t\t\tsubmit: true\r\n\t\t});\r\n\r\n\t\tthis.AutoCompleteForm.input.addEventListener(\"selection\", this.SelectAutoCompleteEntry);\r\n\t};\r\n\r\n\tprivate ConfigureSearch = (): void =>\r\n\t{\r\n\t\tthis.BtnClearSearch = document.getElementById(\"btnClearSearch\") as HTMLButtonElement;\r\n\t\tthis.FrmSearch = document.getElementById(\"frmSearch\") as HTMLFormElement;\r\n\t\tthis.TxtSearch = document.getElementById(\"txtSearch\") as HTMLInputElement;\r\n\r\n\t\tif (this.BtnClearSearch !== null)\r\n\t\t{\r\n\t\t\tthis.BtnClearSearch.addEventListener(\"click\", this.ClearSearchHandler, false);\r\n\t\t}\r\n\r\n\t\tif (this.FrmSearch !== null)\r\n\t\t{\r\n\t\t\tthis.FrmSearch.addEventListener(\"submit\", this.SearchHandler, false);\r\n\t\t}\r\n\r\n\t\tif (this.TxtSearch !== null)\r\n\t\t{\r\n\t\t\tthis.TxtSearch.addEventListener(\"keyup\", this.ClearSearchToggle, false);\r\n\t\t}\r\n\t};\r\n\r\n\tprivate SearchHandler = (e: Event): boolean =>\r\n\t{\r\n\t\tif (Validation.SiteSearch(this.TxtSearch.value))\r\n\t\t{\r\n\t\t\tTagManager.Search(this.TxtSearch.value);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\te.preventDefault();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t};\r\n\r\n\tprivate SelectAutoCompleteEntry = (e): void =>\r\n\t{\r\n\t\tthis.AutoCompleteForm.input.blur();\r\n\t\tTagManager.Search(e.detail.selection.value.label);\r\n\t\twindow.location.href = e.detail.selection.value.url;\r\n\t};\r\n}","import { ContentService } from \"@Api/ContentService\";\r\nimport { Media } from \"@Utilities/Media\";\r\nimport { SearchBase } from \"@Base/Site/SearchBase\";\r\nimport { TextResource } from \"@Utilities/TextResource\";\r\n\r\nimport enquire from \"enquire.js\";\r\nimport Headroom from \"headroom.js\";\r\nimport MetisMenu from \"metismenujs\";\r\nimport Collapse from \"bootstrap/js/dist/collapse\";\r\nimport Offcanvas from \"bootstrap/js/dist/offcanvas\";\r\nimport { CookieManager } from \"@Utilities/CookieManager\";\r\n\r\nexport class HeaderBase\r\n{\r\n\tprivate readonly contentService: ContentService;\r\n\tpublic DesktopMenu: HTMLElement;\r\n\tpublic OffCanvasMenuInstance: Offcanvas;\r\n\tpublic OffCanvasMenuEl: HTMLElement;\r\n\tpublic Menu: HTMLElement;\r\n\tpublic MobileMenu: HTMLElement;\r\n\tpublic MobileMenuInstance: MetisMenu;\r\n\tpublic Search: SearchBase;\r\n\tpublic StickyHeader: Headroom;\r\n\tpublic TopMenu: HTMLElement;\r\n\r\n\tconstructor()\r\n\t{\r\n\t\tthis.contentService = new ContentService();\r\n\t}\r\n\r\n\tpublic Initialize(): void\r\n\t{\r\n\t\tthis.Search = new SearchBase();\r\n\t\tthis.ConfigureMobile();\r\n\t};\r\n\r\n\tstatic AddToBannerSection = (banner: string): void =>\r\n\t{\r\n\t\tconst bannerSection = document.querySelector(\"#skin-customer-message\");\r\n\t\tconst bannerSectionHome = document.querySelector(\"#skin-customer-message-home\");\r\n\t\tconst frag = document.createRange().createContextualFragment(banner);\r\n\t\tconst bannerNode = frag.firstChild;\r\n\r\n\t\tif (bannerSection !== null)\r\n\t\t{\r\n\t\t\tbannerSection.append(bannerNode);\r\n\t\t}\r\n\r\n\t\tif (bannerSectionHome !== null)\r\n\t\t{\r\n\t\t\tbannerSectionHome.append(bannerNode);\r\n\t\t}\r\n\t};\r\n\r\n\tpublic ConfigureMobile = (): void =>\r\n\t{\r\n\t\tenquire.register(Media.MediaMobile, {\r\n\t\t\tdeferSetup: true,\r\n\t\t\tmatch: (): void =>\r\n\t\t\t{\r\n\t\t\t\tthis.MenuMobileSetup();\r\n\t\t\t\tthis.StickyHeaderSetup();\r\n\t\t\t},\r\n\t\t\tunmatch: (): void =>\r\n\t\t\t{\r\n\t\t\t\tthis.MenuMobileDestroy();\r\n\t\t\t\tthis.StickyHeaderDestroy();\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n\r\n\tpublic MenuMobileDestroy(): void\r\n\t{\r\n\t\tthis.DesktopMenu = document.querySelector(\"#desktopMenu\");\r\n\t\tthis.Menu = document.querySelector(\"#menu\");\r\n\t\tthis.TopMenu = document.querySelector(\"#topMenu\");\r\n\r\n\t\tif (this.OffCanvasMenuEl !== null && typeof this.OffCanvasMenuEl !== \"undefined\")\r\n\t\t{\r\n\t\t\tif (this.OffCanvasMenuEl.classList.contains(\"show\"))\r\n\t\t\t{\r\n\t\t\t\tthis.OffCanvasMenuInstance.hide();\r\n\t\t\t\tthis.OffCanvasMenuEl.removeEventListener(\"show.bs.offcanvas\", this.MenuMobileOpen);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this.Menu !== null)\r\n\t\t{\r\n\t\t\tif (this.Menu.classList.contains(\"metismenu\"))\r\n\t\t\t{\r\n\t\t\t\tif (typeof this.MobileMenuInstance !== \"undefined\")\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.MobileMenuInstance.dispose();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.Menu.classList.remove(\"metismenu\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this.DesktopMenu !== null)\r\n\t\t{\r\n\t\t\tthis.DesktopMenu.appendChild(this.TopMenu);\r\n\t\t}\r\n\r\n\t\tdocument.querySelectorAll(\".nav-unwrap__clone\").forEach(element =>\r\n\t\t{\r\n\t\t\tif (element.parentNode !== null)\r\n\t\t\t{\r\n\t\t\t\telement.parentNode.removeChild(element);\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n\r\n\tpublic MenuMobileOpen = (): void =>\r\n\t{\r\n\t\t// setting variables. more happens in each implementation\r\n\t\tthis.MobileMenu = document.querySelector(\"#mobileMenu\");\r\n\t\tthis.TopMenu = document.querySelector(\"#topMenu\");\r\n\t};\r\n\r\n\tpublic MenuMobileSetup = (): void =>\r\n\t{\r\n\t\tthis.OffCanvasMenuEl = document.querySelector(\"#offCanvasMenu\");\r\n\t\tthis.OffCanvasMenuInstance = Offcanvas.getOrCreateInstance(\"#offCanvasMenu\");\r\n\t\tthis.OffCanvasMenuEl.addEventListener(\"show.bs.offcanvas\", this.MenuMobileOpen, { once: true });\r\n\t};\r\n\r\n\tpublic StickyHeaderDestroy = (): void =>\r\n\t{\r\n\t\tif (typeof this.StickyHeader !== \"undefined\")\r\n\t\t{\r\n\t\t\tthis.StickyHeader.destroy();\r\n\t\t}\r\n\t};\r\n\r\n\tpublic StickyHeaderSetup = (): void =>\r\n\t{\r\n\t\tconst header = document.querySelector(\"header\");\r\n\t\tconst container = document.querySelector(\".header-top\");\r\n\r\n\t\tthis.StickyHeader = new Headroom(container, {\r\n\t\t\toffset: header.offsetHeight,\r\n\t\t\tonPin: (): void =>\r\n\t\t\t{\r\n\t\t\t\theader.classList.add(\"pinned\");\r\n\t\t\t\theader.classList.remove(\"unpinned\");\r\n\t\t\t},\r\n\t\t\tonUnpin: (): void =>\r\n\t\t\t{\r\n\t\t\t\theader.classList.add(\"unpinned\");\r\n\t\t\t\theader.classList.remove(\"pinned\");\r\n\t\t\t\tCollapse.getOrCreateInstance(\"#searchBar\").hide();\r\n\t\t\t}\r\n\t\t});\r\n\t\tthis.StickyHeader.init();\r\n\t};\r\n\r\n\tpublic UpdateAccountName = (): void =>\r\n\t{\r\n\t\tif (typeof ContentService.Response !== \"undefined\")\r\n\t\t{\r\n\t\t\tif (ContentService.Response.AccountName !== \"\" && ContentService.Response.AccountName !== null)\r\n\t\t\t{\r\n\t\t\t\tconst accountName = ContentService.Response.AccountName;\r\n\t\t\t\tconst myAccountText = document.querySelectorAll(\".menu-account .sgn\");\r\n\t\t\t\tconst myAccountContainers = document.querySelectorAll(\".my-account\");\r\n\r\n\t\t\t\tmyAccountText.forEach(element =>\r\n\t\t\t\t{\r\n\t\t\t\t\tlet name = \"\";\r\n\r\n\t\t\t\t\tif (accountName.length > 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tname = `${TextResource.GetTextByCulture(\"Word_Greeting\")}, ${accountName}`;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tname = TextResource.GetTextByCulture(\"Feature_Header_AccountButton\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\telement.textContent = name;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tmyAccountContainers.forEach(container =>\r\n\t\t\t\t{\r\n\t\t\t\t\tif (accountName.length > 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcontainer.querySelectorAll(\".my-account--on\").forEach(element =>\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\telement.classList.remove(\"d-none\");\r\n\t\t\t\t\t\t\telement.classList.add(\"d-block\");\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\tcontainer.querySelectorAll(\".my-account--off\").forEach(element =>\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\telement.classList.remove(\"d-block\");\r\n\t\t\t\t\t\t\telement.classList.add(\"d-none\");\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcontainer.querySelectorAll(\".my-account--on\").forEach(element =>\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\telement.classList.remove(\"d-block\");\r\n\t\t\t\t\t\t\telement.classList.add(\"d-none\");\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\tcontainer.querySelectorAll(\".my-account--off\").forEach(element =>\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\telement.classList.remove(\"d-none\");\r\n\t\t\t\t\t\t\telement.classList.add(\"d-block\");\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tpublic UpdateCartIcon = (itemOrderQuantity?: number): void =>\r\n\t{\r\n\t\tconst cartButton = document.querySelector(\"#mcrt\") as HTMLLinkElement;\r\n\t\tconst cartPreorder = cartButton.querySelector(\".pre\");\r\n\r\n\t\tif (!cartButton === null)\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet cartCount = 0;\r\n\r\n\t\tif (typeof ContentService.Response !== \"undefined\")\r\n\t\t{\r\n\t\t\tif (itemOrderQuantity == null)\r\n\t\t\t{\r\n\t\t\t\titemOrderQuantity = ContentService.Response.TotalItemQuantity;\r\n\t\t\t}\r\n\r\n\t\t\tthis.UpdateOrderItemIcon(itemOrderQuantity);\r\n\r\n\t\t\tconst itemPreorderQuantity = ContentService.Response.PreOrderItemQuantity;\r\n\r\n\t\t\t// Buy Icon\r\n\t\t\tif (itemPreorderQuantity > 0)\r\n\t\t\t{\r\n\t\t\t\tconst tooltip = TextResource.ConstructSentence(\"Feature_Client_ItemQty\", \"0\") + itemPreorderQuantity +\r\n\t\t\t\t\tTextResource.ConstructSentence(\"Feature_Client_ItemQty\", \"1\") + (itemPreorderQuantity > 1 ? \"s\" : \"\") +\r\n\t\t\t\t\tTextResource.ConstructSentence(\"Feature_Client_ItemQty\", \"2\");\r\n\r\n\t\t\t\tcartPreorder.textContent = itemPreorderQuantity.toString();\r\n\t\t\t\tcartPreorder.setAttribute(\"title\", tooltip);\r\n\t\t\t\tcartPreorder.classList.remove(\"d-none\");\r\n\t\t\t\tdocument.querySelector(\".my-cart .dropdown-item.preo\").classList.remove(\"d-none\");\r\n\r\n\t\t\t\tcartCount++;\r\n\t\t\t}\r\n\r\n\t\t\tif (cartCount > 0)\r\n\t\t\t{\r\n\t\t\t\tcartButton.setAttribute(\"data-bs-toggle\", \"dropdown\");\r\n\t\t\t\tcartButton.classList.add(\"dropdown-toggle\");\r\n\t\t\t\tdocument.querySelector(\"#qcrt\").classList.remove(\"d-none\");\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tprivate ProcessInternationalBanners = (): void =>\r\n\t{\r\n\t\tif (typeof ContentService.Response !== \"undefined\")\r\n\t\t{\r\n\t\t\tif (CookieManager.GetCookie(\"noIntl\") !== \"true\" && ContentService.Response.WebsiteSuggestionBanner !== undefined && ContentService.Response.WebsiteSuggestionBanner !== null && ContentService.Response.WebsiteSuggestionBanner !== \"\")\r\n\t\t\t{\r\n\t\t\t\tconst websiteSuggestionBanner = `
${ContentService.Response.WebsiteSuggestionBanner}
`;\r\n\r\n\t\t\t\tHeaderBase.AddToBannerSection(websiteSuggestionBanner);\r\n\t\t\t}\r\n\t\t\telse if (ContentService.Response.InternationalBanner !== undefined && ContentService.Response.InternationalBanner !== null && ContentService.Response.InternationalBanner !== \"\")\r\n\t\t\t{\r\n\t\t\t\tconst intlBanner = `
${ContentService.Response.InternationalBanner}
`;\r\n\t\t\t\tHeaderBase.AddToBannerSection(intlBanner);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tpublic TriggerContentCallbacks = (): void =>\r\n\t{\r\n\t\tthis.UpdateCartIcon();\r\n\t\tthis.ProcessInternationalBanners();\r\n\t\tthis.UpdateAccountName();\r\n\t};\r\n\r\n\tprivate UpdateOrderItemIcon = (itemOrderQuantity: number): void =>\r\n\t{\r\n\t\tconst cartButton = document.querySelector(\"#mcrt\") as HTMLLinkElement;\r\n\t\tconst cartBuy = cartButton.querySelector(\".buy\");\r\n\r\n\t\t// Buy Icon\r\n\t\tif (itemOrderQuantity > 0)\r\n\t\t{\r\n\t\t\tconst tooltip = TextResource.ConstructSentence(\"Feature_Client_ItemQty\", \"0\") + itemOrderQuantity +\r\n\t\t\t\tTextResource.ConstructSentence(\"Feature_Client_ItemQty\", \"1\") + (itemOrderQuantity > 1 ? \"s\" : \"\") +\r\n\t\t\t\tTextResource.ConstructSentence(\"Feature_Client_ItemQty\", \"2\");\r\n\r\n\t\t\tcartBuy.textContent = itemOrderQuantity.toString();\r\n\t\t\tcartBuy.setAttribute(\"title\", tooltip);\r\n\t\t\tcartBuy.classList.remove(\"d-none\");\r\n\t\t\tdocument.querySelector(\".my-cart .dropdown-item.crt\").classList.remove(\"d-none\");\r\n\t\t}\r\n\t};\r\n}","import { CookieManager } from './../../Utilities/CookieManager';\r\nimport \"./Recommendations.scss\";\r\n\r\nimport { Cart } from \"@Utilities/Cart\";\r\nimport { Tenant } from \"@Utilities/Tenant\";\r\nimport { TextResource } from \"@Utilities/TextResource\";\r\nimport { TrackingService } from \"@Api/TrackingService\";\r\n\r\nimport HcProductCard from \"@Tenants/Hc/Templates/ProductCard.hbs\";\r\nimport HcHoverRecs from \"@Tenants/Hc/Templates/HoverRecs.hbs\";\r\nimport FunProductCard from \"@Tenants/Fun/Templates/ProductCard.hbs\";\r\nimport RecentlyViewedSide from \"@Templates/RecentlyViewedSide.hbs\";\r\nimport axios from \"axios\";\r\nimport { Media } from \"@Utilities/Media\";\r\nimport enquire from \"enquire.js\";\r\nimport { Fancyapps } from \"@Libraries/Fancyapps\";\r\n\r\nclass Product\r\n{\r\n\tpublic CurrencySymbol;\r\n\tpublic Exclusive;\r\n\tpublic HasPriceRange;\r\n\tpublic HasSavings;\r\n\tpublic ImageLink;\r\n\tpublic ImageLinkLarge;\r\n\tpublic ImageLinkMedium;\r\n\tpublic ImageLinkXLarge;\r\n\tpublic IsOnClearance;\r\n\tpublic IsOnSale;\r\n\tpublic IsPreOrder;\r\n\tpublic IsSingleSize;\r\n\tpublic IsSingleSizeNotStandard;\r\n\tpublic Link;\r\n\tpublic MadeByUs;\r\n\tpublic MaxOriginalPrice;\r\n\tpublic MaxPrice;\r\n\tpublic MinOriginalPrice;\r\n\tpublic MinPrice;\r\n\tpublic ProductID;\r\n\tpublic Rating;\r\n\tpublic RatingDescription;\r\n\tpublic Ratings;\r\n\tpublic RefreshExclusiveMadeByUsTag;\r\n\tpublic RefreshShowExclusive;\r\n\tpublic RRLink;\r\n\tpublic Savings;\r\n\tpublic Sizes;\r\n\tpublic Title;\r\n\r\n\tconstructor(productID, sizes, title, link, imageLink, price, isOnClearance, isOnSale, isPreOrder, rating, currencySymbol, exclusive, madeByUs, rrLink)\r\n\t{\r\n\t\tlet savings = 0;\r\n\t\tlet sizeCount = 0;\r\n\t\tlet sizeStandard = false;\r\n\t\tconst youSaveThreshold = 0.05;\r\n\t\tlet maxPrice = 0;\r\n\t\tlet minPrice = 0;\r\n\t\tlet maxRegularPrice = 0;\r\n\t\tlet minRegularPrice = 0;\r\n\t\tprice = (price * 1);\r\n\r\n\t\tif (sizes.length > 0)\r\n\t\t{\r\n\t\t\tfor (let k = 0; k < sizes.length; k++)\r\n\t\t\t{\r\n\t\t\t\tif (sizes[k].DisplayPrice > maxPrice || maxPrice === 0) maxPrice = sizes[k].DisplayPrice.toFixed(2);\r\n\t\t\t\tif (sizes[k].DisplayPrice < minPrice || minPrice === 0) minPrice = sizes[k].DisplayPrice.toFixed(2);\r\n\t\t\t\tif (sizes[k].RegularPrice > maxRegularPrice || maxRegularPrice === 0) maxRegularPrice = sizes[k].RegularPrice.toFixed(2);\r\n\t\t\t\tif (sizes[k].RegularPrice < minRegularPrice || minRegularPrice === 0) minRegularPrice = sizes[k].RegularPrice.toFixed(2);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tmaxPrice = price.toFixed(2);\r\n\t\t\tminPrice = price.toFixed(2);\r\n\t\t\tmaxRegularPrice = price.toFixed(2);\r\n\t\t\tminRegularPrice = price.toFixed(2);\r\n\t\t}\r\n\r\n\t\tthis.CurrencySymbol = currencySymbol;\r\n\t\tthis.Exclusive = exclusive;\r\n\t\tthis.ImageLink = imageLink;\r\n\t\tthis.ImageLinkMedium = imageLink.replace(\"/1-5/\", \"/1-4/\");\r\n\t\tthis.ImageLinkLarge = imageLink.replace(\"/1-5/\", \"/1-21/\");\r\n\t\tthis.ImageLinkXLarge = imageLink.replace(\"/1-5/\", \"/1-2/\");\r\n\t\tthis.IsOnSale = isOnSale;\r\n\t\tthis.IsPreOrder = isPreOrder;\r\n\t\tthis.Link = link;\r\n\t\tthis.MadeByUs = madeByUs;\r\n\t\tthis.MaxOriginalPrice = maxRegularPrice;\r\n\t\tthis.MaxPrice = maxPrice;\r\n\t\tthis.MinOriginalPrice = minRegularPrice;\r\n\t\tthis.MinPrice = minPrice;\r\n\t\tthis.ProductID = productID;\r\n\t\tthis.Rating = rating;\r\n\t\tthis.RefreshExclusiveMadeByUsTag = (madeByUs || exclusive);\r\n\t\tthis.RefreshShowExclusive = (exclusive && !(madeByUs && (isPreOrder || isOnClearance || isOnSale)));\r\n\t\tthis.RRLink = rrLink;\r\n\t\tthis.Sizes = sizes;\r\n\t\tthis.Title = title.replace(/\"/g, '\\\\\"');\r\n\r\n\t\t// Calculations\r\n\t\tthis.HasPriceRange = this.MinPrice > 0 && this.MinPrice !== this.MaxPrice;\r\n\r\n\t\t// Ratings\r\n\t\tif (this.Rating > 0)\r\n\t\t{\r\n\t\t\tlet description = TextResource.GetTextByCulture('Word_Stars');\r\n\t\t\tconst ratingMod = this.Rating % 1;\r\n\t\t\tconst ratings = [];\r\n\t\t\tlet currentRating = \"\";\r\n\r\n\t\t\tif (this.Rating === 1)\r\n\t\t\t{\r\n\t\t\t\tdescription = TextResource.GetTextByCulture('Word_Star');\r\n\t\t\t}\r\n\r\n\t\t\tfor (let j = 1; j <= 5; j++)\r\n\t\t\t{\r\n\t\t\t\tif (j <= this.Rating)\r\n\t\t\t\t{\r\n\t\t\t\t\tcurrentRating = \"rating-star-filled\";\r\n\t\t\t\t}\r\n\t\t\t\telse if (j > this.Rating && this.Rating > j - 1)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (ratingMod === 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcurrentRating = \"rating-star-empty\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (ratingMod <= 0.5)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcurrentRating = \"rating-star-50\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (ratingMod > 0.5)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcurrentRating = \"rating-star-filled\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tcurrentRating = \"rating-star-empty\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\tratings.push(currentRating);\r\n\t\t\t}\r\n\r\n\t\t\tthis.RatingDescription = this.Rating + \" \" + description;\r\n\t\t\tthis.Ratings = ratings;\r\n\t\t}\r\n\r\n\t\tif (this.Sizes.length)\r\n\t\t{\r\n\t\t\tsizeCount = this.Sizes.length;\r\n\r\n\t\t\tfor (let i = 0; i < this.Sizes.length; i++)\r\n\t\t\t{\r\n\t\t\t\tif (i === 0 && this.Sizes.length === 1)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (this.Sizes[i].Size === \"ST\" || this.Sizes[i].Size === \"one-size\")\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tsizeStandard = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.IsSingleSize = sizeCount <= 1;\r\n\t\tthis.IsSingleSizeNotStandard = !sizeStandard;\r\n\r\n\t\tsavings = 1.0 - this.MinPrice / this.MaxOriginalPrice;\r\n\r\n\t\tif (savings > youSaveThreshold)\r\n\t\t{\r\n\t\t\tthis.HasSavings = true;\r\n\t\t\tthis.IsOnClearance = isOnClearance;\r\n\t\t\tthis.Savings = Math.round(savings * 100);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthis.HasSavings = false;\r\n\t\t\tthis.IsOnClearance = false;\r\n\t\t\tthis.Savings = 0;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nclass ProductCarousel\r\n{\r\n\tpublic CarouselID;\r\n\tpublic CarouselTitle;\r\n\tpublic Products;\r\n\r\n\tconstructor(carouselID, carouselTitle, products)\r\n\t{\r\n\t\tthis.CarouselID = carouselID;\r\n\t\tthis.CarouselTitle = carouselTitle;\r\n\t\tthis.Products = products;\r\n\t}\r\n}\r\n\r\n///A product size object.\r\nclass ProductSize\r\n{\r\n\tpublic DisplayOrder;\r\n\tpublic DisplayPrice;\r\n\tpublic RegularPrice;\r\n\tpublic Size;\r\n\tpublic SizeID;\r\n\r\n\tconstructor(sizeID, size, displayPrice, regularPrice, displayOrder)\r\n\t{\r\n\t\tthis.Size = size;\r\n\r\n\t\tthis.SizeID = parseInt(sizeID, 10);\r\n\t\tthis.SizeID = isNaN(this.SizeID) ? 0 : this.SizeID;\r\n\r\n\t\tthis.DisplayPrice = parseFloat(displayPrice);\r\n\t\tthis.DisplayPrice = isNaN(this.DisplayPrice) ? 0 : this.DisplayPrice;\r\n\r\n\t\tthis.RegularPrice = parseFloat(regularPrice);\r\n\t\tthis.RegularPrice = isNaN(this.RegularPrice) ? 0 : this.RegularPrice;\r\n\r\n\t\tthis.DisplayOrder = parseInt(displayOrder, 10);\r\n\t\tthis.DisplayOrder = isNaN(this.DisplayOrder) ? 0 : this.DisplayOrder;\r\n\t}\r\n}\r\n\r\nexport class Recommendations\r\n{\r\n\tpublic ReferrerCategoryID = 0;\r\n\tpublic ReferringCategoryAsyncAPI = false;\r\n\tpublic GetReferringCategoryCallback = null;\r\n\r\n\tprivate readonly cart: Cart;\r\n\tprivate readonly trackingService: TrackingService;\r\n\r\n\tconstructor()\r\n\t{\r\n\t\tthis.cart = new Cart();\r\n\t\tthis.trackingService = new TrackingService();\r\n\t}\r\n\r\n\t// PUBLIC FUNCTIONS\r\n\t///Adds a product to the cart.\r\n\tpublic FunAddToCart = (rawData): void =>\r\n\t{\r\n\t\tconst recommendationList = this.HydrateRecommendations(rawData);\r\n\t\tlet html = \"\";\r\n\t\tlet carousel = void 0;\r\n\r\n\t\tconst mysteryJson = document.getElementById(\"MysteryBoxesJson\") as HTMLInputElement;\r\n\t\tconst recOne = document.getElementById(\"rec-one\") as HTMLElement;\r\n\t\tconst recTwo = document.getElementById(\"rec-two\") as HTMLElement;\r\n\t\tconst recThree = document.getElementById(\"rec-three\") as HTMLElement;\r\n\t\tconst recFour = document.getElementById(\"rec-four\") as HTMLElement;\r\n\t\tconst recAtcOne = document.getElementById(\"rec-atc-one\") as HTMLElement;\r\n\r\n\t\tif (mysteryJson !== null)\r\n\t\t{\r\n\t\t\tthis.FunMysteryBoxLocal(mysteryJson.value);\r\n\t\t}\r\n\r\n\t\tfor (const key in recommendationList)\r\n\t\t{\r\n\t\t\tswitch (key)\r\n\t\t\t{\r\n\t\t\t\tcase \"add_to_cart_page.rr1\":\r\n\t\t\t\t\tif (recFour !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-four\", TextResource.GetTextByCulture('Feature_Recommendations_RecentlyViewed'), recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\thtml = FunProductCard(carousel);\r\n\t\t\t\t\t\trecFour.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-four\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\telse if (recAtcOne !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// carousel = new ProductCarousel(\"rec-atc-one\", TextResource.GetTextByCulture('Feature_Recommendations_Products'), recommendationList[key]);\r\n\t\t\t\t\t\t// html = GetContainer(carousel, \"addToCartBottom\");\r\n\t\t\t\t\t\t// $(\"#rec-atc-one\").replaceWith(html);\r\n\t\t\t\t\t\t// Fun.Cart.Quick.Initialize();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"add_to_cart_page.rr2\":\r\n\t\t\t\t\tif (recTwo !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-two\", TextResource.GetTextByCulture('Feature_Recommendations_AlsoBought'), recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\thtml = FunProductCard(carousel);\r\n\t\t\t\t\t\trecTwo.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-two\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"add_to_cart_page.rr3\":\r\n\t\t\t\t\tif (recThree !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-three\", TextResource.GetTextByCulture('Feature_Recommendations_RelatedCart'), recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\thtml = FunProductCard(carousel);\r\n\t\t\t\t\t\trecThree.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-three\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"add_to_cart_page.rr4\":\r\n\t\t\t\t\tif (recOne !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-one\", TextResource.GetTextByCulture('Feature_Recommendations_Products'), recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\thtml = FunProductCard(carousel);\r\n\t\t\t\t\t\trecOne.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-one\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t///Displays recommendations on categories for HC.com.\r\n\tpublic FunCategory = (rawData): void =>\r\n\t{\r\n\t\tconst recommendationList = this.HydrateRecommendations(rawData);\r\n\t\tlet html = \"\";\r\n\t\tlet carousel = void 0;\r\n\t\tconst recRecent = document.querySelector(\"#rec-recent\");\r\n\r\n\t\tfor (const key in recommendationList)\r\n\t\t{\r\n\t\t\tswitch (key)\r\n\t\t\t{\r\n\t\t\t\tcase \"category_page.rr1\":\r\n\t\t\t\tcase \"category_page.m-rr1\":\r\n\t\t\t\t\tif (recRecent !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-recent\", rawData[0].strategy_message, recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\thtml = FunProductCard(carousel);\r\n\t\t\t\t\t\trecRecent.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-recent\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// ///Displays recommendations on the add to cart confirmation dialog for Fun.com.\r\n\t// public FunConfirmation = function (rawData)\r\n\t// {\r\n\t// \tconst recommendationList = this.HydrateRecommendations(rawData);\r\n\t// \tlet html = \"\";\r\n\t// \tlet carousel = void 0;\r\n\r\n\t// \tfor (const key in recommendationList)\r\n\t// \t{\r\n\t// \t\tif (key === \"purchase_complete_page.rr1\" || key === \"purchase_complete_page.m-rr1\")\r\n\t// \t\t{\r\n\t// \t\t\tcarousel = new ProductCarousel(\"rec-recent\", TextResource.GetTextByCulture('Feature_Recommendations_ComingSoon'), recommendationList[key]);\r\n\t// \t\t\tcarousel.AddToCart = true;\r\n\t// \t\t\thtml = this.GetContainer(carousel, \"funProductCard\");\r\n\t// \t\t\t$(\"#rec-recent\").replaceWith(html);\r\n\t// \t\t\tthis.ConfigureThemeAddItems(\"#rec-recent\");\r\n\t// \t\t}\r\n\t// \t}\r\n\t// };\r\n\r\n\t///Displays recommendations on the home page for Fun.com.\r\n\tpublic FunHome = (rawData): void =>\r\n\t{\r\n\t\tconst recommendationList = this.HydrateRecommendations(rawData);\r\n\t\tlet html = \"\";\r\n\t\tlet carousel = void 0;\r\n\t\tconst recRecent = document.querySelector(\"#rec-recent\");\r\n\r\n\t\tfor (const key in recommendationList)\r\n\t\t{\r\n\t\t\tswitch (key)\r\n\t\t\t{\r\n\t\t\t\tcase \"home_page.rr1\":\r\n\t\t\t\tcase \"home_page.m-rr1\":\r\n\t\t\t\t\tif (recRecent !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-recent\", rawData[0].strategy_message, recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\thtml = FunProductCard(carousel);\r\n\t\t\t\t\t\trecRecent.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-recent\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t// At one point, direction was given from marketing, that the container that's above the fold should not contain prices.\r\n\t\t\t\t// If this is added onto the site and that's still the case, the handlebars template will need to be updates to allow this.\r\n\t\t\t\t//case \"home_page.rr2\":\r\n\t\t\t\t//\tif ($(\"#rec-trend\").length)\r\n\t\t\t\t//\t{\r\n\t\t\t\t//\t\tcarousel = new ProductCarousel(\"rec-trend\", rawData[1].strategy_message, recommendationList[key]);\r\n\t\t\t\t//\t\thtml = this.GetContainer(carousel, \"hcFourUp\");\r\n\t\t\t\t//\t\t$(\"#rec-trend\").replaceWith(html);\r\n\r\n\t\t\t\t//\t\tthis.ConfigureFourUpItems(\"#rec-trend\", recommendationList[key].length);\r\n\t\t\t\t//\t\tthis.ConfigureThemeAddItems(\"#rec-trend\");\r\n\t\t\t\t//\t}\r\n\r\n\t\t\t\t//\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// public FunEmptyCart = function (rawData)\r\n\t// {\r\n\t// \tconst recommendationList = this.HydrateRecommendations(rawData);\r\n\t// \tlet html = \"\";\r\n\t// \tlet carousel = void 0;\r\n\r\n\t// \tfor (const key in recommendationList)\r\n\t// \t{\r\n\t// \t\tswitch (key)\r\n\t// \t\t{\r\n\t// \t\t\tcase \"cart_page.emptycartrr1\":\r\n\t// \t\t\t\tif ($(\"#rec-one\").length)\r\n\t// \t\t\t\t{\r\n\t// \t\t\t\t\tcarousel = new ProductCarousel(\"rec-one\", TextResource.GetTextByCulture('Feature_Recommendations_PopularProducts'), recommendationList[key]);\r\n\t// \t\t\t\t\tcarousel.AddToCart = true;\r\n\t// \t\t\t\t\thtml = this.GetContainer(carousel, \"funProductCard\");\r\n\t// \t\t\t\t\t$(\"#rec-one\").replaceWith(html);\r\n\t// \t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-one\");\r\n\t// \t\t\t\t}\r\n\t// \t\t\t\tbreak;\r\n\t// \t\t\tcase \"cart_page.emptycartrr2\":\r\n\t// \t\t\t\tif ($(\"#rec-recent\").length)\r\n\t// \t\t\t\t{\r\n\t// \t\t\t\t\tcarousel = new ProductCarousel(\"rec-recent\", rawData[1].strategy_message, recommendationList[key]);\r\n\t// \t\t\t\t\tcarousel.AddToCart = true;\r\n\t// \t\t\t\t\thtml = this.GetContainer(carousel, \"funProductCard\");\r\n\t// \t\t\t\t\t$(\"#rec-recent\").replaceWith(html);\r\n\t// \t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-recent\");\r\n\t// \t\t\t\t}\r\n\t// \t\t\t\tbreak;\r\n\t// \t\t}\r\n\t// \t}\r\n\t// };\r\n\r\n\tpublic FunMysteryBoxLocal = (rawData): void =>\r\n\t{\r\n\t\tconst recommendationList = this.HydrateLocalPlacement(\"mystery-box\", rawData);\r\n\t\tlet html = \"\";\r\n\t\tlet carousel = void 0;\r\n\r\n\t\tconst rec = document.getElementById(\"rec-mystery\") as HTMLElement;\r\n\r\n\t\tfor (const key in recommendationList)\r\n\t\t{\r\n\t\t\tswitch (key)\r\n\t\t\t{\r\n\t\t\t\tcase \"mystery-box\":\r\n\t\t\t\t\tif (rec !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-mystery\", TextResource.GetTextByCulture('Feature_Recommendations_MysteryBoxes'), recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\tcarousel.EnableSlider = true;\r\n\t\t\t\t\t\thtml = FunProductCard(carousel);\r\n\t\t\t\t\t\trec.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureFourUpCarousel(\"#rec-mystery\");\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-mystery\");\r\n\r\n\t\t\t\t\t\t//output product ids to block from RR repeating in other containers.\r\n\t\t\t\t\t\tfor (let i = 0; i < recommendationList[\"mystery-box\"].length; i++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tconst container = document.getElementById(\"rec-mystery\") as HTMLElement;\r\n\t\t\t\t\t\t\tconst exclusionContainer = document.createElement(\"div\");\r\n\t\t\t\t\t\t\texclusionContainer.classList.add(\"exclude-product\");\r\n\t\t\t\t\t\t\texclusionContainer.style.display = \"none\";\r\n\t\t\t\t\t\t\texclusionContainer.innerHTML = recommendationList[\"mystery-box\"][i].ProductID;\r\n\t\t\t\t\t\t\tcontainer.appendChild(exclusionContainer);\r\n\r\n\t\t\t\t\t\t\t//only exclude the first 8 items\r\n\t\t\t\t\t\t\tif (i == 7)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// ///Displays recommendations on the product details page for Fun.com.\r\n\tpublic FunProduct = (rawData): void =>\r\n\t{\r\n\t\tconst recommendationList = this.HydrateRecommendations(rawData);\r\n\t\tlet html = \"\";\r\n\t\tlet carousel = void 0;\r\n\r\n\t\tconst mysteryJson = document.getElementById(\"MysteryBoxesJson\") as HTMLInputElement;\r\n\t\tconst recRecent = document.getElementById(\"rec-recent\") as HTMLElement;\r\n\t\tconst recRecentSide = document.getElementById(\"rec-recent-side\") as HTMLElement;\r\n\t\tconst rec2 = document.getElementById(\"rec-two\") as HTMLElement;\r\n\t\tconst rec3 = document.getElementById(\"rec-three\") as HTMLElement;\r\n\r\n\t\tif (mysteryJson !== null)\r\n\t\t{\r\n\t\t\tthis.FunMysteryBoxLocal(mysteryJson.value);\r\n\t\t}\r\n\r\n\t\tfor (const key in recommendationList)\r\n\t\t{\r\n\t\t\tswitch (key)\r\n\t\t\t{\r\n\t\t\t\tcase \"item_page.rr1\":\r\n\t\t\t\t\tif (recRecentSide !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tthis.ConfigureRightItems(recommendationList[key], recRecentSide);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"item_page.m-rr1\":\r\n\t\t\t\t\tif (recRecent !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-recent\", rawData[0].strategy_message, recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\thtml = FunProductCard(carousel);\r\n\t\t\t\t\t\trecRecent.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-recent\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"item_page.rr2\":\r\n\t\t\t\tcase \"item_page.m-rr2\":\r\n\t\t\t\t\tif (rec2 !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-two\", TextResource.GetTextByCulture('Feature_Recommendations_AlsoViewed'), recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\thtml = FunProductCard(carousel);\r\n\t\t\t\t\t\trec2.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-two\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"item_page.rr3\":\r\n\t\t\t\tcase \"item_page.m-rr3\":\r\n\t\t\t\t\tif (rec3 !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-three\", TextResource.GetTextByCulture('Feature_Recommendations_Products'), recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\thtml = FunProductCard(carousel);\r\n\t\t\t\t\t\trec3.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-three\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t///Displays recommendations on the search results page for Fun.com.\r\n\tpublic FunSearch = (rawData): void =>\r\n\t{\r\n\t\tconst recommendationList = this.HydrateRecommendations(rawData);\r\n\t\tlet html = \"\";\r\n\t\tlet carousel = void 0;\r\n\t\tconst recRecent = document.querySelector(\"#rec-recent\");\r\n\t\tconst recNoSearch = document.querySelector(\"#rec-nosearch\");\r\n\r\n\t\tfor (const key in recommendationList)\r\n\t\t{\r\n\t\t\tswitch (key)\r\n\t\t\t{\r\n\t\t\t\tcase \"search_page.rr1\":\r\n\t\t\t\tcase \"search_page.m-rr1\":\r\n\t\t\t\t\tif (recRecent !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-recent\", rawData[0].strategy_message, recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\thtml = FunProductCard(carousel);\r\n\t\t\t\t\t\trecRecent.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-recent\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"search_page.rr2\":\r\n\t\t\t\t\tif (recNoSearch !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-nosearch\", TextResource.GetTextByCulture('Feature_Recommendations_Searched'), recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\thtml = FunProductCard(carousel);\r\n\t\t\t\t\t\trecNoSearch.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-nosearch\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tpublic HalloweenAddToCart = (rawData): void =>\r\n\t{\r\n\t\tconst recommendationList = this.HydrateRecommendations(rawData);\r\n\t\tlet html = \"\";\r\n\t\tlet carousel = void 0;\r\n\r\n\t\tconst accJson = document.getElementById(\"RelatedAccessoriesJson\") as HTMLInputElement;\r\n\t\tconst recTwo = document.getElementById(\"rec-two\") as HTMLElement;\r\n\t\tconst recThree = document.getElementById(\"rec-three\") as HTMLElement;\r\n\t\tconst recFour = document.getElementById(\"rec-four\") as HTMLElement;\r\n\r\n\t\tif (accJson !== null)\r\n\t\t{\r\n\t\t\tthis.HalloweenAddToCartLocal(accJson.value);\r\n\t\t}\r\n\r\n\t\tfor (const key in recommendationList)\r\n\t\t{\r\n\t\t\tswitch (key)\r\n\t\t\t{\r\n\t\t\t\tcase \"add_to_cart_page.rr-1\":\r\n\t\t\t\t\tif (recTwo !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-two\", TextResource.GetTextByCulture('Feature_Recommendations_AlsoBought'), recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\thtml = HcProductCard(carousel);\r\n\t\t\t\t\t\trecTwo.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-two\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"add_to_cart_page.rr-2\":\r\n\t\t\t\t\tif (recThree !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-three\", TextResource.GetTextByCulture('Feature_Recommendations_RelatedCart'), recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\thtml = HcProductCard(carousel);\r\n\t\t\t\t\t\trecThree.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-three\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"add_to_cart_page.rr-3\":\r\n\t\t\t\t\tif (recFour !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tlet title = \"\";\r\n\t\t\t\t\t\tif (rawData[0].strategy_message == TextResource.GetTextByCulture('Feature_Recommendations_RecentlyViewed'))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\ttitle = TextResource.GetTextByCulture('Feature_Recommendations_RecentlyViewed');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\ttitle = TextResource.GetTextByCulture('Feature_Recommendations_TrendingProducts');\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-four\", title, recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\thtml = HcProductCard(carousel);\r\n\t\t\t\t\t\trecFour.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-four\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tpublic HalloweenAddToCartLocal = (rawData): void =>\r\n\t{\r\n\t\tconst recommendationList = this.HydrateLocalPlacement(\"add-to-cart\", rawData);\r\n\t\tlet html = \"\";\r\n\t\tlet carousel = void 0;\r\n\r\n\t\tconst recOne = document.getElementById(\"rec-one\") as HTMLElement;\r\n\r\n\t\tfor (const key in recommendationList)\r\n\t\t{\r\n\t\t\tswitch (key)\r\n\t\t\t{\r\n\t\t\t\tcase \"add-to-cart\":\r\n\t\t\t\t\tif (recOne !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-one\", TextResource.GetTextByCulture('Feature_Recommendations_Accessories'), recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\tcarousel.EnableSlider = true;\r\n\t\t\t\t\t\thtml = HcProductCard(carousel);\r\n\t\t\t\t\t\trecOne.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureFourUpCarousel(\"#rec-one\");\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-one\");\r\n\r\n\t\t\t\t\t\t//output product ids to block from RR repeating in other containers.\r\n\t\t\t\t\t\tfor (let i = 0; i < recommendationList[\"add-to-cart\"].length; i++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tconst container = document.getElementById(\"rec-one\") as HTMLElement;\r\n\t\t\t\t\t\t\tconst exclusionContainer = document.createElement(\"div\");\r\n\t\t\t\t\t\t\texclusionContainer.classList.add(\"exclude-product\");\r\n\t\t\t\t\t\t\texclusionContainer.style.display = \"none\";\r\n\t\t\t\t\t\t\texclusionContainer.innerHTML = recommendationList[\"add-to-cart\"][i].ProductID;\r\n\t\t\t\t\t\t\tcontainer.appendChild(exclusionContainer);\r\n\r\n\t\t\t\t\t\t\t//only exclude the first 8 items\r\n\t\t\t\t\t\t\tif (i == 7)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tpublic HalloweenCategory = (rawData): void =>\r\n\t{\r\n\t\tconst recommendationList = this.HydrateRecommendations(rawData);\r\n\t\tlet html = \"\";\r\n\t\tlet carousel = void 0;\r\n\t\tconst recRecent = document.querySelector(\"#rec-recent\");\r\n\r\n\t\tfor (const key in recommendationList)\r\n\t\t{\r\n\t\t\tswitch (key)\r\n\t\t\t{\r\n\t\t\t\tcase \"category_page.rr-1\":\r\n\t\t\t\t\tif (recRecent !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-recent\", rawData[0].strategy_message, recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\thtml = HcProductCard(carousel);\r\n\t\t\t\t\t\trecRecent.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-recent\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tpublic HalloweenHome = (rawData): void =>\r\n\t{\r\n\t\tconst recommendationList = this.HydrateRecommendations(rawData);\r\n\t\tlet html = \"\";\r\n\t\tlet carousel = void 0;\r\n\t\tconst recRecent = document.querySelector(\"#rec-recent\");\r\n\r\n\t\tfor (const key in recommendationList)\r\n\t\t{\r\n\t\t\tswitch (key)\r\n\t\t\t{\r\n\t\t\t\tcase \"home_page.rr-1\":\r\n\t\t\t\t\tif (recRecent !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-recent\", rawData[0].strategy_message, recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\thtml = HcProductCard(carousel);\r\n\t\t\t\t\t\trecRecent.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-recent\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tpublic HalloweenProduct = (rawData): void =>\r\n\t{\r\n\t\tconst recommendationList = this.HydrateRecommendations(rawData);\r\n\t\tlet html = \"\";\r\n\t\tlet carousel = void 0;\r\n\r\n\t\tconst recRecent = document.getElementById(\"rec-recent\") as HTMLElement;\r\n\t\tconst rec2 = document.getElementById(\"rec-two\") as HTMLElement;\r\n\t\tconst rec3 = document.getElementById(\"rec-three\") as HTMLElement;\r\n\r\n\t\tfor (const key in recommendationList)\r\n\t\t{\r\n\t\t\tswitch (key)\r\n\t\t\t{\r\n\t\t\t\tcase \"item_page.rr-1\":\r\n\t\t\t\t\tif (rec2 !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tconst productTypeID = document.getElementById(\"ProductTypeID\").getAttribute(\"value\");\r\n\t\t\t\t\t\tlet carouselTitle = \"\";\r\n\r\n\t\t\t\t\t\tif (productTypeID === \"11\")\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcarouselTitle = TextResource.GetTextByCulture(\"Feature_Recommendations_Decorations\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcarouselTitle = TextResource.GetTextByCulture('Feature_Recommendations_Costumes');\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-two\", carouselTitle, recommendationList[key]);\r\n\t\t\t\t\t\thtml = HcHoverRecs(carousel);\r\n\t\t\t\t\t\trec2.outerHTML = html;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"item_page.rr-2\":\r\n\t\t\t\t\tif (rec3 !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-three\", TextResource.GetTextByCulture('Feature_Recommendations_For_You'), recommendationList[key]);\r\n\t\t\t\t\t\thtml = HcHoverRecs(carousel);\r\n\t\t\t\t\t\trec3.outerHTML = html;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"item_page.rr-3\":\r\n\t\t\t\t\tif (recRecent !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-recent\", TextResource.GetTextByCulture('Feature_Recommendations_RecentlyViewed'), recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\thtml = HcProductCard(carousel);\r\n\t\t\t\t\t\trecRecent.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-recent\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tpublic HalloweenSearch = (rawData): void =>\r\n\t{\r\n\t\tconst recommendationList = this.HydrateRecommendations(rawData);\r\n\t\tlet html = \"\";\r\n\t\tlet carousel = void 0;\r\n\t\tconst recRecent = document.querySelector(\"#rec-recent\");\r\n\t\tconst recNoSearch = document.querySelector(\"#rec-nosearch\");\r\n\r\n\t\tfor (const key in recommendationList)\r\n\t\t{\r\n\t\t\tswitch (key)\r\n\t\t\t{\r\n\t\t\t\tcase \"search_page.rr-1\":\r\n\t\t\t\t\tif (recNoSearch !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-nosearch\", TextResource.GetTextByCulture('Feature_Recommendations_Searched'), recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\tcarousel.EnableSlider = true;\r\n\t\t\t\t\t\thtml = HcProductCard(carousel);\r\n\t\t\t\t\t\trecNoSearch.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureFourUpCarousel(\"#rec-nosearch\");\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-nosearch\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"search_page.rr-2\":\r\n\t\t\t\t\tif (recRecent !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-recent\", rawData[0].strategy_message, recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\thtml = HcProductCard(carousel);\r\n\t\t\t\t\t\trecRecent.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-recent\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tpublic HCAddToCart = (rawData): void =>\r\n\t{\r\n\t\tconst recommendationList = this.HydrateRecommendations(rawData);\r\n\t\tlet html = \"\";\r\n\t\tlet carousel = void 0;\r\n\r\n\t\tconst accJson = document.getElementById(\"RelatedAccessoriesJson\") as HTMLInputElement;\r\n\t\tconst recTwo = document.getElementById(\"rec-two\") as HTMLElement;\r\n\t\tconst recThree = document.getElementById(\"rec-three\") as HTMLElement;\r\n\t\tconst recFour = document.getElementById(\"rec-four\") as HTMLElement;\r\n\r\n\t\tif (accJson !== null)\r\n\t\t{\r\n\t\t\tthis.HCAddToCartLocal(accJson.value);\r\n\t\t}\r\n\r\n\t\tfor (const key in recommendationList)\r\n\t\t{\r\n\t\t\tswitch (key)\r\n\t\t\t{\r\n\t\t\t\tcase \"add_to_cart_page.rr1\":\r\n\t\t\t\t\tif (recFour !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tlet title = \"\";\r\n\t\t\t\t\t\tif (rawData[0].strategy_message == TextResource.GetTextByCulture('Feature_Recommendations_RecentlyViewed'))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\ttitle = TextResource.GetTextByCulture('Feature_Recommendations_RecentlyViewed');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\ttitle = TextResource.GetTextByCulture('Feature_Recommendations_TrendingProducts');\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-four\", title, recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\thtml = HcProductCard(carousel);\r\n\t\t\t\t\t\trecFour.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-four\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"add_to_cart_page.rr2\":\r\n\t\t\t\t\tif (recTwo !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-two\", TextResource.GetTextByCulture('Feature_Recommendations_AlsoBought'), recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\thtml = HcProductCard(carousel);\r\n\t\t\t\t\t\trecTwo.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-two\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"add_to_cart_page.rr3\":\r\n\t\t\t\t\tif (recThree !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-three\", TextResource.GetTextByCulture('Feature_Recommendations_RelatedCart'), recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\thtml = HcProductCard(carousel);\r\n\t\t\t\t\t\trecThree.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-three\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tpublic HCAddToCartLocal = (rawData): void =>\r\n\t{\r\n\t\tconst recommendationList = this.HydrateLocalPlacement(\"add-to-cart\", rawData);\r\n\t\tlet html = \"\";\r\n\t\tlet carousel = void 0;\r\n\r\n\t\tconst recOne = document.getElementById(\"rec-one\") as HTMLElement;\r\n\r\n\t\tfor (const key in recommendationList)\r\n\t\t{\r\n\t\t\tswitch (key)\r\n\t\t\t{\r\n\t\t\t\tcase \"add-to-cart\":\r\n\t\t\t\t\tif (recOne !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-one\", TextResource.GetTextByCulture('Feature_Recommendations_Accessories'), recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\tcarousel.EnableSlider = true;\r\n\t\t\t\t\t\thtml = HcProductCard(carousel);\r\n\t\t\t\t\t\trecOne.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureFourUpCarousel(\"#rec-one\");\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-one\");\r\n\r\n\t\t\t\t\t\t//output product ids to block from RR repeating in other containers.\r\n\t\t\t\t\t\tfor (let i = 0; i < recommendationList[\"add-to-cart\"].length; i++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tconst container = document.getElementById(\"rec-one\") as HTMLElement;\r\n\t\t\t\t\t\t\tconst exclusionContainer = document.createElement(\"div\");\r\n\t\t\t\t\t\t\texclusionContainer.classList.add(\"exclude-product\");\r\n\t\t\t\t\t\t\texclusionContainer.style.display = \"none\";\r\n\t\t\t\t\t\t\texclusionContainer.innerHTML = recommendationList[\"add-to-cart\"][i].ProductID;\r\n\t\t\t\t\t\t\tcontainer.appendChild(exclusionContainer);\r\n\r\n\t\t\t\t\t\t\t//only exclude the first 8 items\r\n\t\t\t\t\t\t\tif (i == 7)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t///Displays recommendations on categories for HC.com.\r\n\tpublic HCCategory = (rawData): void =>\r\n\t{\r\n\t\tconst recommendationList = this.HydrateRecommendations(rawData);\r\n\t\tlet html = \"\";\r\n\t\tlet carousel = void 0;\r\n\t\tconst recRecent = document.querySelector(\"#rec-recent\");\r\n\t\tconst recForYou = document.querySelector(\"#rec-foryou\");\r\n\t\tconst isRefresh = document.querySelector(\".catRefresh\") !== null;\r\n\r\n\t\tfor (const key in recommendationList)\r\n\t\t{\r\n\t\t\tswitch (key)\r\n\t\t\t{\r\n\t\t\t\tcase \"category_page.rr1\":\r\n\t\t\t\tcase \"category_page.m-rr1\":\r\n\t\t\t\t\tif (recRecent !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-recent\", rawData[0].strategy_message, recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\thtml = HcProductCard(carousel);\r\n\t\t\t\t\t\trecRecent.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-recent\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"category_page.rr2\":\r\n\t\t\t\t\tif (recForYou !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-foryou\", rawData[0].strategy_message, recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\thtml = HcProductCard(carousel);\r\n\t\t\t\t\t\trecForYou.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-foryou\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// ///Displays recommendations on the add to cart confirmation dialog for HC.com.\r\n\t// public HCConfirmation = function (rawData)\r\n\t// {\r\n\t// \tconst recommendationList = this.HydrateRecommendations(rawData);\r\n\t// \tlet html = \"\";\r\n\t// \tlet carousel = void 0;\r\n\t// \tconst title = \"\";\r\n\r\n\t// \tfor (const key in recommendationList)\r\n\t// \t{\r\n\t// \t\tswitch (key)\r\n\t// \t\t{\r\n\t// \t\t\tcase \"purchase_complete_page.rr1\":\r\n\t// \t\t\tcase \"purchase_complete_page.m-rr1\":\r\n\t// \t\t\t\tif ($(\"#rec-recent\").length)\r\n\t// \t\t\t\t{\r\n\t// \t\t\t\t\tcarousel = new ProductCarousel(\"rec-recent\", rawData[0].strategy_message, recommendationList[key]);\r\n\t// \t\t\t\t\tcarousel.AddToCart = false;\r\n\t// \t\t\t\t\thtml = this.GetContainer(carousel, \"hcFourUp\");\r\n\t// \t\t\t\t\t$(\"#rec-recent\").replaceWith(html);\r\n\r\n\t// \t\t\t\t\tthis.ConfigureFourUpItems(\"#rec-recent\", recommendationList[key].length, true);\r\n\t// \t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-recent\");\r\n\t// \t\t\t\t}\r\n\t// \t\t\t\tbreak;\r\n\r\n\t// \t\t\tcase \"purchase_complete_page.hc_orderconfirmation\":\r\n\t// \t\t\t\tif ($(\"#rec-fun\").length)\r\n\t// \t\t\t\t{\r\n\t// \t\t\t\t\tfor (let i = 0; i < recommendationList[key].length; i++)\r\n\t// \t\t\t\t\t{\r\n\t// \t\t\t\t\t\trecommendationList[key][i].Link = \"https://www.fun.com\" + recommendationList[key][i].Link;\r\n\t// \t\t\t\t\t}\r\n\r\n\t// \t\t\t\t\tcarousel = new ProductCarousel(\"rec-fun\", TextResource.GetTextByCulture('Feature_Recommendations_TrendingOnFun'), recommendationList[key]);\r\n\t// \t\t\t\t\tcarousel.AddToCart = false;\r\n\t// \t\t\t\t\thtml = this.GetContainer(carousel, \"hcFourUp\");\r\n\t// \t\t\t\t\t$(\"#rec-fun\").replaceWith(html);\r\n\r\n\t// \t\t\t\t\tthis.ConfigureFourUpItems(\"#rec-fun\", recommendationList[key].length);\r\n\t// \t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-fun\");\r\n\t// \t\t\t\t}\r\n\t// \t\t}\r\n\t// \t}\r\n\t// };\r\n\r\n\t///Displays recommendations on the home page for HC.com.\r\n\tpublic HCGroupBuilderReview = (rawData): void =>\r\n\t{\r\n\t\tconst recommendationList = this.HydrateRecommendations(rawData);\r\n\t\tlet html = \"\";\r\n\t\tlet carousel = void 0;\r\n\t\tconst accJson = document.getElementById(\"RelatedAccessoriesJson\") as HTMLInputElement;\r\n\t\tconst recForYou = document.querySelector(\"#rec-foryou\");\r\n\r\n\t\tif (accJson !== null)\r\n\t\t{\r\n\t\t\tthis.HCAddToCartLocal(accJson.value);\r\n\t\t}\r\n\r\n\t\tfor (const key in recommendationList)\r\n\t\t{\r\n\t\t\tswitch (key)\r\n\t\t\t{\r\n\t\t\t\tcase \"add_to_cart_page.groupbuilderreview\":\r\n\t\t\t\t\tif (recForYou !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-foryou\", rawData[0].strategy_message, recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\thtml = HcProductCard(carousel);\r\n\t\t\t\t\t\trecForYou.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-foryou\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t///Displays recommendations on the home page for HC.com.\r\n\tpublic HCHome = (rawData): void =>\r\n\t{\r\n\t\tconst recommendationList = this.HydrateRecommendations(rawData);\r\n\t\tlet html = \"\";\r\n\t\tlet carousel = void 0;\r\n\t\tconst recRecent = document.querySelector(\"#rec-recent\");\r\n\r\n\t\tfor (const key in recommendationList)\r\n\t\t{\r\n\t\t\tswitch (key)\r\n\t\t\t{\r\n\t\t\t\tcase \"home_page.rr1\":\r\n\t\t\t\tcase \"home_page.m-rr1\":\r\n\t\t\t\t\tif (recRecent !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-recent\", rawData[0].strategy_message, recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\thtml = HcProductCard(carousel);\r\n\t\t\t\t\t\trecRecent.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-recent\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t// At one point, direction was given from marketing, that the container that's above the fold should not contain prices.\r\n\t\t\t\t// If this is added onto the site and that's still the case, the handlebars template will need to be updates to allow this.\r\n\t\t\t\t//case \"home_page.rr2\":\r\n\t\t\t\t//\tif ($(\"#rec-trend\").length)\r\n\t\t\t\t//\t{\r\n\t\t\t\t//\t\tcarousel = new ProductCarousel(\"rec-trend\", rawData[1].strategy_message, recommendationList[key]);\r\n\t\t\t\t//\t\thtml = this.GetContainer(carousel, \"hcFourUp\");\r\n\t\t\t\t//\t\t$(\"#rec-trend\").replaceWith(html);\r\n\r\n\t\t\t\t//\t\tthis.ConfigureFourUpItems(\"#rec-trend\", recommendationList[key].length);\r\n\t\t\t\t//\t\tthis.ConfigureThemeAddItems(\"#rec-trend\");\r\n\t\t\t\t//\t}\r\n\r\n\t\t\t\t//\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// public HCEmptyCart = function (rawData)\r\n\t// {\r\n\t// \tconst recommendationList = this.HydrateRecommendations(rawData);\r\n\t// \tlet html = \"\";\r\n\t// \tlet carousel = void 0;\r\n\r\n\t// \tfor (const key in recommendationList)\r\n\t// \t{\r\n\t// \t\tswitch (key)\r\n\t// \t\t{\r\n\t// \t\t\tcase \"cart_page.emptycartrr1\":\r\n\r\n\t// \t\t\t\tif ($(\"#rec-recent\").length)\r\n\t// \t\t\t\t{\r\n\t// \t\t\t\t\tcarousel = new ProductCarousel(\"rec-recent\", rawData[0].strategy_message, recommendationList[key]);\r\n\t// \t\t\t\t\tcarousel.AddToCart = true;\r\n\t// \t\t\t\t\thtml = this.GetContainer(carousel, \"hcFourUp\");\r\n\t// \t\t\t\t\t$(\"#rec-recent\").replaceWith(html);\r\n\t// \t\t\t\t}\r\n\r\n\t// \t\t\t\tthis.ConfigureFourUpItems(\"#rec-recent\", recommendationList[key].length, true);\r\n\t// \t\t\t\tthis.ConfigureThemeAddItems(\"#rec-recent\");\r\n\r\n\t// \t\t\t\tbreak;\r\n\r\n\t// \t\t\tcase \"cart_page.emptycartrr2\":\r\n\t// \t\t\t\tif ($(\"#rec-one\").length)\r\n\t// \t\t\t\t{\r\n\t// \t\t\t\t\tcarousel = new ProductCarousel(\"rec-one\", rawData[1].strategy_message, recommendationList[key]);\r\n\t// \t\t\t\t\tcarousel.AddToCart = true;\r\n\t// \t\t\t\t\thtml = this.GetContainer(carousel, \"hcFourUp\");\r\n\t// \t\t\t\t\t$(\"#rec-one\").replaceWith(html);\r\n\t// \t\t\t\t}\r\n\r\n\t// \t\t\t\tthis.ConfigureFourUpItems(\"#rec-one\", recommendationList[key].length, true);\r\n\t// \t\t\t\tthis.ConfigureThemeAddItems(\"#rec-one\");\r\n\r\n\t// \t\t\t\tbreak;\r\n\t// \t\t}\r\n\t// \t}\r\n\t// };\r\n\r\n\t// ///Displays recommendations on the product details page for HC.com.\r\n\tpublic HCProduct = (rawData): void =>\r\n\t{\r\n\t\tconst recommendationList = this.HydrateRecommendations(rawData);\r\n\t\tlet html = \"\";\r\n\t\tlet carousel = void 0;\r\n\r\n\t\tconst recRecent = document.getElementById(\"rec-recent\") as HTMLElement;\r\n\t\tconst recRecent2 = document.getElementById(\"rec-recent2\") as HTMLElement;\r\n\t\tconst recRecentSide = document.getElementById(\"rec-recent-side\") as HTMLElement;\r\n\t\tconst rec2 = document.getElementById(\"rec-two\") as HTMLElement;\r\n\t\tconst rec3 = document.getElementById(\"rec-three\") as HTMLElement;\r\n\r\n\t\tfor (const key in recommendationList)\r\n\t\t{\r\n\t\t\tswitch (key)\r\n\t\t\t{\r\n\t\t\t\tcase \"item_page.m-rr1\":\r\n\t\t\t\t\tif (recRecent !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-recent\", rawData[0].strategy_message, recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\thtml = HcProductCard(carousel);\r\n\t\t\t\t\t\trecRecent.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-recent\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"item_page.m-rr1variant\":\r\n\t\t\t\t\tif (recRecent2 !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-recent2\", rawData[0].strategy_message, recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\thtml = HcProductCard(carousel);\r\n\t\t\t\t\t\trecRecent2.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-recent2\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"item_page.rr1\":\r\n\t\t\t\t\tif (recRecent !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-recent\", rawData[0].strategy_message, recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\thtml = HcProductCard(carousel);\r\n\t\t\t\t\t\trecRecent.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-recent\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"item_page.rr2\":\r\n\t\t\t\tcase \"item_page.m-rr2\":\r\n\t\t\t\t\tif (rec2 !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tconst productTypeID = document.getElementById(\"ProductTypeID\").getAttribute(\"value\");\r\n\t\t\t\t\t\tlet carouselTitle = \"\";\r\n\r\n\t\t\t\t\t\tif (productTypeID === \"11\")\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcarouselTitle = TextResource.GetTextByCulture(\"Feature_Recommendations_Decorations\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcarouselTitle = TextResource.GetTextByCulture('Feature_Recommendations_Costumes');\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-two\", carouselTitle, recommendationList[key]);\r\n\t\t\t\t\t\thtml = HcHoverRecs(carousel);\r\n\t\t\t\t\t\trec2.outerHTML = html;\r\n\r\n\t\t\t\t\t\t// this.ConfigureHoverRecsCarousel(\"#rec-two\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"item_page.rr3\":\r\n\t\t\t\t\tif (rec3 !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-three\", TextResource.GetTextByCulture('Feature_Recommendations_For_You'), recommendationList[key]);\r\n\t\t\t\t\t\thtml = HcHoverRecs(carousel);\r\n\t\t\t\t\t\trec3.outerHTML = html;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// const recommendationList = this.HydrateRecommendations(rawData);\r\n\t\t// let html = \"\";\r\n\t\t// let carousel = void 0;\r\n\t\t// const recRecent = document.getElementById(\"rec-recent\");\r\n\t\t// const recRecent2 = document.getElementById(\"rec-recent2\");\r\n\t\t// const recRecentSide = document.getElementById(\"rec-recent-side\");\r\n\t\t// const recTwo = document.getElementById(\"rec-two\");\r\n\t\t// const recThree = document.getElementById(\"rec-three\");\r\n\r\n\t\t// for (const key in recommendationList)\r\n\t\t// {\r\n\t\t// \tswitch (key)\r\n\t\t// \t{\r\n\t\t// \t\tcase \"item_page.m-rr1\":\r\n\r\n\t\t// \t\t\tif (recRecent !== null)\r\n\t\t// \t\t\t{\r\n\t\t// \t\t\t\t// carousel = new ProductCarousel(\"rec-recent\", rawData[0].strategy_message, recommendationList[key]);\r\n\t\t// \t\t\t\t// carousel.AddToCart = true;\r\n\t\t// \t\t\t\t// html = this.GetContainer(carousel, \"hcFourUp\");\r\n\t\t// \t\t\t\t// $(\"#rec-recent\").replaceWith(html);\r\n\r\n\t\t// \t\t\t\tcarousel = new ProductCarousel(\"rec-recent\", rawData[0].strategy_message, recommendationList[key]);\r\n\t\t// \t\t\t\tcarousel.AddToCart = true;\r\n\t\t// \t\t\t\thtml = HcProductCard(carousel);\r\n\t\t// \t\t\t\trecRecent.outerHTML = html;\r\n\t\t// \t\t\t\tthis.ConfigureThemeAddItems(\"#rec-recent\");\r\n\t\t// \t\t\t}\r\n\r\n\t\t// \t\t\tbreak;\r\n\r\n\t\t// \t\tcase \"item_page.m-rr1variant\":\r\n\r\n\t\t// \t\t\tif (recRecent2 !== null)\r\n\t\t// \t\t\t{\r\n\t\t// \t\t\t\tcarousel = new ProductCarousel(\"rec-recent2\", rawData[0].strategy_message, recommendationList[key]);\r\n\t\t// \t\t\t\tcarousel.AddToCart = true;\r\n\t\t// \t\t\t\thtml = this.GetContainer(carousel, \"hcFourUp\");\r\n\t\t// \t\t\t\t$(\"#rec-recent2\").replaceWith(html);\r\n\t\t// \t\t\t}\r\n\r\n\t\t// \t\t\tthis.ConfigureFourUpItems(\"#rec-recent2\", recommendationList[key].length, true);\r\n\t\t// \t\t\tthis.ConfigureThemeAddItems(\"#rec-recent2\");\r\n\r\n\t\t// \t\t\tbreak;\r\n\r\n\t\t// \t\tcase \"item_page.rr1\":\r\n\t\t// \t\t\tif (recRecentSide !== null)\r\n\t\t// \t\t\t{\r\n\t\t// \t\t\t\tthis.ConfigureRightItems(recommendationList[key]);\r\n\t\t// \t\t\t}\r\n\r\n\t\t// \t\t\tbreak;\r\n\r\n\t\t// \t\tcase \"item_page.rr2\":\r\n\t\t// \t\tcase \"item_page.m-rr2\":\r\n\t\t// \t\t\tif (recTwo !== null)\r\n\t\t// \t\t\t{\r\n\t\t// \t\t\t\tconst productTypeID = $(\"#ProductTypeID\").val();\r\n\t\t// \t\t\t\tlet carouselTitle = \"\";\r\n\r\n\t\t// \t\t\t\tif (productTypeID === \"11\")\r\n\t\t// \t\t\t\t{\r\n\t\t// \t\t\t\t\tcarouselTitle = TextResource.GetTextByCulture(\"Feature_Recommendations_Accessories\");\r\n\t\t// \t\t\t\t}\r\n\t\t// \t\t\t\telse\r\n\t\t// \t\t\t\t{\r\n\t\t// \t\t\t\t\tcarouselTitle = TextResource.GetTextByCulture('Feature_Recommendations_Costumes');\r\n\t\t// \t\t\t\t}\r\n\r\n\t\t// \t\t\t\tcarousel = new ProductCarousel(\"rec-two\", carouselTitle, recommendationList[key]);\r\n\t\t// \t\t\t\thtml = this.GetContainer(carousel, \"productRelatedRowHover\");\r\n\t\t// \t\t\t\t$(\"#rec-two\").replaceWith(html);\r\n\r\n\t\t// \t\t\t\tthis.ConfigureBottomItems(\"#rec-two\", recommendationList[key].length);\r\n\t\t// \t\t\t}\r\n\t\t// \t\t\tbreak;\r\n\r\n\t\t// \t\tcase \"item_page.rr3\":\r\n\t\t// \t\t\tif (recThree !== null)\r\n\t\t// \t\t\t{\r\n\t\t// \t\t\t\tcarousel = new ProductCarousel(\"rec-three\", TextResource.GetTextByCulture('Feature_Recommendations_For_You'), recommendationList[key]);\r\n\t\t// \t\t\t\thtml = this.GetContainer(carousel, \"productRelatedRowHover\");\r\n\t\t// \t\t\t\t$(\"#rec-three\").replaceWith(html);\r\n\r\n\t\t// \t\t\t\tthis.ConfigureBottomItems(\"#rec-three\", recommendationList[key].length);\r\n\t\t// \t\t\t}\r\n\t\t// \t\t\tbreak;\r\n\t\t// \t}\r\n\t\t//}\r\n\r\n\t\t// if ($(\".rel-thm\").length)\r\n\t\t// {\r\n\t\t// \tthis.ConfigureThemeItems(\".rel-thm .nameprc .name a\");\r\n\t\t// }\r\n\t};\r\n\r\n\t///Displays recommendations on the search results page for HC.com.\r\n\tpublic HCSearch = (rawData): void =>\r\n\t{\r\n\t\tconst recommendationList = this.HydrateRecommendations(rawData);\r\n\t\tlet html = \"\";\r\n\t\tlet carousel = void 0;\r\n\t\tconst recRecent = document.querySelector(\"#rec-recent\");\r\n\t\tconst recNoSearch = document.querySelector(\"#rec-nosearch\");\r\n\r\n\t\tfor (const key in recommendationList)\r\n\t\t{\r\n\t\t\tswitch (key)\r\n\t\t\t{\r\n\t\t\t\tcase \"search_page.rr1\":\r\n\t\t\t\tcase \"search_page.m-rr1\":\r\n\t\t\t\t\tif (recRecent !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-recent\", rawData[0].strategy_message, recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\thtml = HcProductCard(carousel);\r\n\t\t\t\t\t\trecRecent.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-recent\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"search_page.rr2\":\r\n\t\t\t\t\tif (recNoSearch !== null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcarousel = new ProductCarousel(\"rec-nosearch\", TextResource.GetTextByCulture('Feature_Recommendations_Searched'), recommendationList[key]);\r\n\t\t\t\t\t\tcarousel.AddToCart = true;\r\n\t\t\t\t\t\tcarousel.EnableSlider = true;\r\n\t\t\t\t\t\thtml = HcProductCard(carousel);\r\n\t\t\t\t\t\trecNoSearch.outerHTML = html;\r\n\t\t\t\t\t\tthis.ConfigureFourUpCarousel(\"#rec-nosearch\");\r\n\t\t\t\t\t\tthis.ConfigureThemeAddItems(\"#rec-nosearch\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t///Records click through to Rich Relevance.\r\n\tpublic HandleRecommendationClick = (): void =>\r\n\t{\r\n\t\tconst rrLinks = document.querySelectorAll(\"a[data-rr-url]:not([data-rr-url=''])\");\r\n\r\n\t\tif (rrLinks.length > 0)\r\n\t\t{\r\n\t\t\trrLinks.forEach((rrLink) =>\r\n\t\t\t{\r\n\t\t\t\trrLink.addEventListener(\"click\", (e) =>\r\n\t\t\t\t{\r\n\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\tconst target = e.currentTarget as HTMLLinkElement;\r\n\t\t\t\t\tconst updateLocation = !target.classList.contains(\"add-rec\");\r\n\t\t\t\t\tconst rrUrl = target.getAttribute(\"data-rr-url\");\r\n\t\t\t\t\tconst targetUrl = target.href;\r\n\r\n\t\t\t\t\tif (rrUrl)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\taxios.get(rrUrl)\r\n\t\t\t\t\t\t\t.then(() =>\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif (updateLocation)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\twindow.top.location.href = targetUrl;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\twindow.top.location.href = targetUrl;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n\r\n\t///Gets referring category from referring page url.\r\n\tpublic GetReferringCategory = async (callbackFunction): Promise =>\r\n\t{\r\n\t\tthis.ReferringCategoryAsyncAPI = typeof callbackFunction !== 'undefined';\r\n\t\tthis.GetReferringCategoryCallback = callbackFunction;\r\n\r\n\t\tif (document.referrer)\r\n\t\t{\r\n\t\t\tconst categoryID = await this.trackingService.GetReferringCategory();\r\n\r\n\t\t\tif (categoryID !== \"0\")\r\n\t\t\t{\r\n\t\t\t\tthis.ReferrerCategoryID = parseInt(categoryID);\r\n\t\t\t}\r\n\r\n\t\t\tif (this.ReferringCategoryAsyncAPI)\r\n\t\t\t{\r\n\t\t\t\tthis.GetReferringCategoryCallback();\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (this.ReferringCategoryAsyncAPI)\r\n\t\t{\r\n\t\t\t// Call the callback function since we don't need to call the API\r\n\t\t\tthis.ReferrerCategoryID = 0;\r\n\t\t\tthis.GetReferringCategoryCallback();\r\n\t\t}\r\n\t};\r\n\r\n\t// PRIVATE FUNCTIONS\r\n\t///Configures the carousel for the related products (with hover) on the bottom of product detail page.\r\n\t// private ConfigureBottomItems(carouselID, length)\r\n\t// {\r\n\t// \tlet element;\r\n\t// \tlet carousel;\r\n\t// \tlet desktopBreakpoint = me.DesktopBreakpoint;\r\n\r\n\t// \tif ($(\"html\").hasClass(\"bs\"))\r\n\t// \t{\r\n\t// \t\tdesktopBreakpoint = 992;\r\n\t// \t}\r\n\r\n\t// \telement = $(carouselID);\r\n\t// \tcarousel = $(carouselID + \" .carousel\");\r\n\r\n\t// \t$(carouselID + \" .carousel .psr-item\").each(function (index, value)\r\n\t// \t{\r\n\t// \t\tif (index > 7)\r\n\t// \t\t{\r\n\t// \t\t\t$(this).addClass(\"tr\");\r\n\t// \t\t}\r\n\t// \t\telse\r\n\t// \t\t{\r\n\t// \t\t\t$(this).addClass(\"tl\");\r\n\t// \t\t}\r\n\t// \t});\r\n\r\n\t// \tif (Fun.Theme.Media === \"desktop\")\r\n\t// \t{\r\n\t// \t\tlet html = \"\";\r\n\r\n\t// \t\tvar blanks = 0;\r\n\t// \t\tif (length < 10)\r\n\t// \t\t{\r\n\t// \t\t\tblanks = 10 - length;\r\n\t// \t\t}\r\n\r\n\t// \t\tfor (let i = 0; i < blanks; i++)\r\n\t// \t\t{\r\n\t// \t\t\thtml += \"
\";\r\n\t// \t\t}\r\n\r\n\t// \t\tcarousel.append(html);\r\n\t// \t}\r\n\r\n\t// \tcarousel.slick({\r\n\t// \t\taccessibility: true,\r\n\t// \t\tslidesToShow: 10,\r\n\t// \t\tslidesToScroll: 10,\r\n\t// \t\tdots: false,\r\n\t// \t\tarrows: true,\r\n\t// \t\tresponsive: [\r\n\t// \t\t\t{\r\n\t// \t\t\t\tbreakpoint: desktopBreakpoint,\r\n\t// \t\t\t\tsettings: {\r\n\t// \t\t\t\t\tdots: true,\r\n\t// \t\t\t\t\tarrows: false,\r\n\t// \t\t\t\t\tslidesToShow: 4,\r\n\t// \t\t\t\t\tslidesToScroll: 4\r\n\t// \t\t\t\t}\r\n\t// \t\t\t},\r\n\t// \t\t\t{\r\n\t// \t\t\t\tbreakpoint: 540,\r\n\t// \t\t\t\tsettings: {\r\n\t// \t\t\t\t\tdots: true,\r\n\t// \t\t\t\t\tarrows: false,\r\n\t// \t\t\t\t\tslidesToShow: 3,\r\n\t// \t\t\t\t\tslidesToScroll: 3\r\n\t// \t\t\t\t}\r\n\t// \t\t\t},\r\n\t// \t\t\t{\r\n\t// \t\t\t\tbreakpoint: 440,\r\n\t// \t\t\t\tsettings: {\r\n\t// \t\t\t\t\tdots: true,\r\n\t// \t\t\t\t\tarrows: false,\r\n\t// \t\t\t\t\tslidesToShow: 2,\r\n\t// \t\t\t\t\tslidesToScroll: 2\r\n\t// \t\t\t\t}\r\n\t// \t\t\t}\r\n\t// \t\t]\r\n\t// \t});\r\n\r\n\t// \tif (Fun.Theme.Media === \"desktop\")\r\n\t// \t{\r\n\t// \t\tblanks = $(element).find(\".psr-item[data-blank]\");\r\n\r\n\t// \t\tfor (let j = 0; j < blanks.length; j++)\r\n\t// \t\t{\r\n\t// \t\t\t$(blanks[j]).closest(\".slick-slide\").attr(\"data-blank\", \"\");\r\n\t// \t\t}\r\n\t// \t}\r\n\t// }\r\n\r\n\t// ///Configures the recently viewed container behavior.\r\n\t// private ConfigureRightItems(recommendations)\r\n\t// {\r\n\t// \tconst html = GetContainer(recommendations, \"RecentlyViewed\");\r\n\t// \t$(\"#rcnts\").replaceWith(html);\r\n\r\n\t// \tif (Fun.Theme.Media === \"mobile\")\r\n\t// \t{\r\n\t// \t\t$(\"#rcnts .rcnt-title\").shave(35);\r\n\t// \t}\r\n\t// \telse\r\n\t// \t{\r\n\t// \t\t$(\"#rcnts .rcnt-title\").shave(45);\r\n\t// \t}\r\n\r\n\t// \t// If recently viewed product hasn't been initialized yet\r\n\t// \tif (typeof Fun.Client.RecentProduct !== \"undefined\" && $(\"html\").hasClass(\"no-rcnt\"))\r\n\t// \t{\r\n\t// \t\tFun.Client.RecentProduct.ConfigureRecentlyViewed();\r\n\t// \t}\r\n\r\n\t// \t// Match Page Height to sidebar height on fun.com desktop mode\r\n\t// \tif (Fun.Theme.Media === \"desktop\")\r\n\t// \t{\r\n\t// \t\tif ($(\"#rec-recent-side\").length)\r\n\t// \t\t{\r\n\t// \t\t\t$(\"#rec-recent-side\").css(\"display\", \"\");\r\n\t// \t\t}\r\n\t// \t}\r\n\t// }\r\n\r\n\t// ///Configures line clamp behavior for larger recommendations.\r\n\t// private ConfigureThemeItems(el)\r\n\t// {\r\n\t// \tlet timer = null;\r\n\r\n\t// \t$(el).shave(35);\r\n\r\n\t// \t$(window).on(\"resize\", function ()\r\n\t// \t{\r\n\t// \t\tclearTimeout(timer);\r\n\r\n\t// \t\ttimer = setTimeout(function ()\r\n\t// \t\t{\r\n\t// \t\t\t$(el).shave(35);\r\n\t// \t\t}, 1000);\r\n\t// \t});\r\n\t// }\r\n\r\n\t// private ConfigureHoverRecsCarousel = async (carouselSelector: string): Promise =>\r\n\t// {\r\n\t// \tconst carouselContainer = document.querySelector(carouselSelector) as HTMLElement;\r\n\r\n\t// \tif (carouselContainer !== null)\r\n\t// \t{\r\n\t// \t\tconst carousel = carouselContainer.querySelector(\".carousel\") as HTMLElement;\r\n\r\n\t// \t\tif (carousel !== null)\r\n\t// \t\t{\r\n\t// \t\t\tconst mobileSetup = enquire.register(Media.MediaMobile, {\r\n\t// \t\t\t\tsetup: async () =>\r\n\t// \t\t\t\t{\r\n\t// \t\t\t\t\tconsole.log(\"setup\");\r\n\r\n\t// \t\t\t\t\tconst fancyapps = await Fancyapps.Import();\r\n\t// \t\t\t\t\tconst carouselInstance = new fancyapps.Carousel(carousel, {\r\n\t// \t\t\t\t\t\tslidesPerPage: 2,\r\n\t// \t\t\t\t\t\tcenter: false,\r\n\t// \t\t\t\t\t\tNavigation\r\n\t// \t\t\t\t\t});\r\n\t// \t\t\t\t},\r\n\t// \t\t\t\tdeferSetup: true\r\n\t// \t\t\t});\r\n\t// \t\t}\r\n\t// \t}\r\n\t// };\r\n\r\n\t///Configures the recently viewed container behavior.\r\n\tprivate ConfigureRightItems = (recommendations, recRecentSide: HTMLElement): void =>\r\n\t{\r\n\t\tconst html = RecentlyViewedSide(recommendations);\r\n\t\tconst rcnts: HTMLElement = document.getElementById(\"rcnts\");\r\n\r\n\t\tif (rcnts !== null)\r\n\t\t{\r\n\t\t\trcnts.innerHTML = html;\r\n\r\n\t\t\t// const rightInstance = Collapse.getInstance(\"#rcnts\");\r\n\t\t\t// //const rightToggle = document.querySelector(\"#rec-recent-side [data-bs-toggle='collapse']\");\r\n\r\n\t\t\t// enquire.register(`(min-width: ${Media.Breakpoints.Lg.Min}px) and (max-width: ${Media.Breakpoints.Xl.Max}px)`, {\r\n\t\t\t// \tmatch: (): void =>\r\n\t\t\t// \t{\r\n\t\t\t// \t\trightInstance.hide();\r\n\t\t\t// \t},\r\n\t\t\t// \tunmatch: (): void =>\r\n\t\t\t// \t{\r\n\t\t\t// \t\trightInstance.show();\r\n\t\t\t// \t}\r\n\t\t\t//\t});\r\n\r\n\t\t\trecRecentSide.classList.remove(\"d-xxl-none\");\r\n\t\t\trecRecentSide.classList.add(\"d-xxl-block\");\r\n\t\t}\r\n\t};\r\n\r\n\t// If recently viewed product hasn't been initialized yet\r\n\t// if (typeof Fun.Client.RecentProduct !== \"undefined\" && $(\"html\").hasClass(\"no-rcnt\"))\r\n\t// {\r\n\t// \tFun.Client.RecentProduct.ConfigureRecentlyViewed();\r\n\t// }\r\n\r\n\t// Match Page Height to sidebar height on fun.com desktop mode\r\n\t// if (Fun.Theme.Media === \"desktop\")\r\n\t// {\r\n\t// \tif ($(\"#rec-recent-side\").length)\r\n\t// \t{\r\n\t// \t\t$(\"#rec-recent-side\").css(\"display\", \"\");\r\n\t// \t}\r\n\t// z\r\n\r\n\tprivate ConfigureFourUpCarousel = async (carouselSelector: string): Promise =>\r\n\t{\r\n\t\tconst mobileCount = 2;\r\n\t\tconst desktopCount = 4;\r\n\t\tlet displayCount = 0;\r\n\t\tconst container = document.querySelector(carouselSelector) as HTMLElement;\r\n\r\n\t\tif (Media.IsMobile)\r\n\t\t{\r\n\t\t\tdisplayCount = mobileCount;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tdisplayCount = desktopCount;\r\n\t\t}\r\n\r\n\t\tif (container !== null)\r\n\t\t{\r\n\t\t\tconst carousel = container.querySelector(\".fourup-carousel\") as HTMLElement;\r\n\t\t\tconst fancyapps = await Fancyapps.Import();\r\n\r\n\t\t\tconst carouselInstance = new fancyapps.Carousel(carousel, {\r\n\t\t\t\tslidesPerPage: displayCount,\r\n\t\t\t\tcenter: false,\r\n\t\t\t\tNavigation: false\r\n\t\t\t});\r\n\r\n\t\t\tenquire.register(Media.MediaMobile, {\r\n\t\t\t\tmatch: () =>\r\n\t\t\t\t{\r\n\t\t\t\t\tcarouselInstance.options.slidesPerPage = mobileCount;\r\n\t\t\t\t\tcarouselInstance.updatePage();\r\n\t\t\t\t},\r\n\t\t\t\tunmatch: () =>\r\n\t\t\t\t{\r\n\t\t\t\t\tcarouselInstance.options.slidesPerPage = desktopCount;\r\n\t\t\t\t\tcarouselInstance.updatePage();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n\r\n\t///Configures the carousel for the theme (with to cart) on the middle of the product detail page.\r\n\tprivate ConfigureThemeAddItems = (el = \".rel-acc\"): void =>\r\n\t{\r\n\t\tconst container = document.querySelector(el) as HTMLElement;\r\n\r\n\t\tif (container !== null)\r\n\t\t{\r\n\t\t\tconst sizeSelectors = container.querySelectorAll(\"select\");\r\n\t\t\tconst addRec = container.querySelectorAll(\".add-rec\");\r\n\r\n\t\t\tif (sizeSelectors.length > 0)\r\n\t\t\t{\r\n\t\t\t\tsizeSelectors.forEach((select) =>\r\n\t\t\t\t{\r\n\t\t\t\t\tselect.addEventListener(\"change\", (e) =>\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tconst el = e.currentTarget as HTMLSelectElement;\r\n\t\t\t\t\t\tconst price = el.options[el.selectedIndex].getAttribute(\"data-price\");\r\n\t\t\t\t\t\tconst item = el.closest(\".ps-item\");\r\n\t\t\t\t\t\tconst priceEl = item.querySelector(\".price\");\r\n\t\t\t\t\t\tpriceEl.textContent = Tenant.CurrencySymbol + price;\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\t//Unbinding needs to be done so that there are not 2 addToCart click events on the buttons.\r\n\t\t\t//This happens when Initialize is call twice because both our own recommendations and 3rd party\r\n\t\t\t//recommendations are being used on the page.\r\n\t\t\t//The namespacing on the click event is necessary so that other click events are not removed.\r\n\t\t\t//In this case, a click event is used to record click-throughs to the 3rd party.\r\n\t\t\tif (addRec.length > 0)\r\n\t\t\t{\r\n\t\t\t\taddRec.forEach((addRec) =>\r\n\t\t\t\t{\r\n\t\t\t\t\taddRec.removeEventListener(\"click\", this.AddRecHandler);\r\n\t\t\t\t\taddRec.addEventListener(\"click\", this.AddRecHandler);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tprivate AddRecHandler = (e: Event): void =>\r\n\t{\r\n\t\te.preventDefault();\r\n\t\tconst target = e.currentTarget as HTMLElement;\r\n\r\n\t\tconst form = target.closest(\".ps-item, .item\");\r\n\t\tconst select = form.querySelector(\"select\") as HTMLSelectElement;\r\n\r\n\t\tconst productID = target.getAttribute(\"data-productid\");\r\n\t\tconst productSizeID = select.value;\r\n\t\tconst cartItemOriginID = target.getAttribute(\"data-origin-id\");\r\n\t\tconst quantity = 1;\r\n\r\n\t\tconst product = {\r\n\t\t\tProductID: productID,\r\n\t\t\tProductSizeID: productSizeID,\r\n\t\t\tQuantity: quantity,\r\n\t\t\tCartItemOriginID: cartItemOriginID\r\n\t\t};\r\n\r\n\t\tthis.cart.AddProduct(product);\r\n\t};\r\n\r\n\t// ///Renders recommendation container.\r\n\t// private GetContainer(recommendations, templateName, templateOptions)\r\n\t// {\r\n\t// \tconst template = Handlebars.templates[templateName];\r\n\t// \tconst html = template(recommendations);\r\n\r\n\t// \treturn html;\r\n\t// }\r\n\r\n\tprivate HydrateLocalPlacement = (placementName, rawData): object =>\r\n\t{\r\n\t\tconst recommendationList = {};\r\n\t\tconst recommendations = [];\r\n\t\tlet item = void 0;\r\n\t\tlet sizeData = void 0;\r\n\t\tlet sizes = void 0;\r\n\t\tlet size = void 0;\r\n\t\tconst currencyCookie = CookieManager.Cookies.Currency;\r\n\r\n\t\tconst currencySymbol = CookieManager.GetCookie(currencyCookie.Key, currencyCookie.CurrencySymbol);\r\n\t\tconst items = JSON.parse(rawData);\r\n\r\n\t\tfor (let j = 0; j < items.length; j++)\r\n\t\t{\r\n\t\t\tsizeData = items[j].Sizes;\r\n\t\t\tsizes = [];\r\n\r\n\t\t\tfor (let k = 0; k < sizeData.length; k++)\r\n\t\t\t{\r\n\t\t\t\tconst currencyId = CookieManager.GetCookie(currencyCookie.Key, currencyCookie.CurrencyID);\r\n\t\t\t\tsize = new ProductSize(sizeData[k].ProductSizeID, sizeData[k].Size, sizeData[k].Price, sizeData[k].RegularPrice, sizeData[k].DisplayOrder);\r\n\t\t\t\tsizes.push(size);\r\n\t\t\t}\r\n\r\n\t\t\tsizes = sizes.sort(\r\n\t\t\t\tfunction (a, b)\r\n\t\t\t\t{\r\n\t\t\t\t\treturn a.DisplayOrder - b.DisplayOrder;\r\n\t\t\t\t});\r\n\r\n\t\t\titem = new Product(items[j].ProductID,\r\n\t\t\t\tsizes,\r\n\t\t\t\titems[j].LinkTitle,\r\n\t\t\t\titems[j].Url,\r\n\t\t\t\titems[j].ThumbnailUrl,\r\n\t\t\t\titems[j].Price,\r\n\t\t\t\titems[j].IsOnClearance,\r\n\t\t\t\titems[j].IsOnSale,\r\n\t\t\t\titems[j].IsPreOrder,\r\n\t\t\t\titems[j].Rating,\r\n\t\t\t\tcurrencySymbol,\r\n\t\t\t\titems[j].IsExclusive,\r\n\t\t\t\titems[j].MadeByUs,\r\n\t\t\t\tnull);\r\n\r\n\t\t\trecommendations.push(item);\r\n\t\t}\r\n\r\n\t\tif (recommendations.length > 0)\r\n\t\t{\r\n\t\t\trecommendationList[placementName] = recommendations;\r\n\t\t}\r\n\r\n\t\treturn recommendationList;\r\n\t};\r\n\r\n\tprivate HydratePlacement = (placementName, items, recommendationList, currencySymbol, isApi): void =>\r\n\t{\r\n\t\tlet recommendations = [];\r\n\t\tlet item = void 0;\r\n\t\tlet sizeData = void 0;\r\n\t\tlet sizes = void 0;\r\n\t\tlet size = void 0;\r\n\r\n\t\trecommendations = [];\r\n\r\n\t\tfor (let j = 0; j < items.length; j++)\r\n\t\t{\r\n\t\t\tlet currencyFound = false;\r\n\t\t\tsizes = [];\r\n\t\t\tif (isApi)\r\n\t\t\t{\r\n\t\t\t\tsizeData = JSON.parse(items[j].attributes.size_info);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tsizeData = JSON.parse(items[j].size_info);\r\n\t\t\t}\r\n\r\n\t\t\tfor (let k = 0; k < sizeData.length; k++)\r\n\t\t\t{\r\n\t\t\t\tconst currencyId = Tenant.CurrencyID;\r\n\t\t\t\tlet price = void 0;\r\n\t\t\t\tlet regularPrice = void 0;\r\n\r\n\t\t\t\tfor (let m = 0; m < sizeData[k].Prices.length; m++)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (sizeData[k].Prices[m].CurrencyID.toString() === currencyId)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcurrencyFound = true;\r\n\t\t\t\t\t\tprice = sizeData[k].Prices[m].Price;\r\n\t\t\t\t\t\tregularPrice = sizeData[k].Prices[m].RegularPrice;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (currencyFound)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (sizeData[k].Quantity > 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tsize = new ProductSize(sizeData[k].ProductSizeID, sizeData[k].Size, price, regularPrice, sizeData[k].DisplayOrder);\r\n\t\t\t\t\t\tsizes.push(size);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (currencyFound)\r\n\t\t\t{\r\n\t\t\t\tsizes = sizes.sort(\r\n\t\t\t\t\tfunction (a, b)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\treturn a.DisplayOrder - b.DisplayOrder;\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\tif (isApi)\r\n\t\t\t\t{\r\n\t\t\t\t\titem = new Product(items[j].id,\r\n\t\t\t\t\t\tsizes,\r\n\t\t\t\t\t\titems[j].name,\r\n\t\t\t\t\t\titems[j].attributes.relative_url,\r\n\t\t\t\t\t\titems[j].imageURL,\r\n\t\t\t\t\t\titems[j].priceCents / 100,\r\n\t\t\t\t\t\titems[j].attributes.is_on_clearance === \"True\",\r\n\t\t\t\t\t\titems[j].attributes.is_on_sale === \"True\",\r\n\t\t\t\t\t\titems[j].attributes.is_preorder === \"True\",\r\n\t\t\t\t\t\titems[j].rating,\r\n\t\t\t\t\t\tcurrencySymbol,\r\n\t\t\t\t\t\titems[j].attributes.exclusive_item === \"True\",\r\n\t\t\t\t\t\titems[j].attributes.made_by_us === \"True\",\r\n\t\t\t\t\t\titems[j].clickTrackingURL);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\titem = new Product(items[j].id,\r\n\t\t\t\t\t\tsizes,\r\n\t\t\t\t\t\titems[j].name,\r\n\t\t\t\t\t\titems[j].relative_url,\r\n\t\t\t\t\t\titems[j].image_url,\r\n\t\t\t\t\t\titems[j].price,\r\n\t\t\t\t\t\titems[j].is_on_clearance === \"True\",\r\n\t\t\t\t\t\titems[j].is_on_sale === \"True\",\r\n\t\t\t\t\t\titems[j].is_preorder === \"True\",\r\n\t\t\t\t\t\titems[j].rating,\r\n\t\t\t\t\t\tcurrencySymbol,\r\n\t\t\t\t\t\titems[j].exclusive === \"True\",\r\n\t\t\t\t\t\titems[j].made_by_us === \"True\",\r\n\t\t\t\t\t\titems[j].link_url);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trecommendations.push(item);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (recommendations.length > 0)\r\n\t\t{\r\n\t\t\trecommendationList[placementName] = recommendations;\r\n\t\t}\r\n\r\n\t\treturn recommendationList;\r\n\t};\r\n\r\n\t// ///Tranforms raw data from api call.\r\n\t// private HydrateApiRecommendations(rawData)\r\n\t// {\r\n\t// \tconst recommendationList = {};\r\n\r\n\t// \ttry\r\n\t// \t{\r\n\t// \t\tif (rawData)\r\n\t// \t\t{\r\n\t// \t\t\tconst currencySymbol = Tenant.CurrencySymbol;\r\n\r\n\t// \t\t\tfor (let i = 0; i < rawData.placements.length; i++)\r\n\t// \t\t\t{\r\n\t// \t\t\t\tthis.HydratePlacement(rawData.placements[i].placement, rawData.placements[i].recommendedProducts, recommendationList, currencySymbol, true);\r\n\t// \t\t\t}\r\n\t// \t\t}\r\n\r\n\t// \t\treturn recommendationList;\r\n\t// \t}\r\n\t// \tcatch (ex)\r\n\t// \t{\r\n\t// \t\t//continue\r\n\t// \t}\r\n\t// }\r\n\r\n\t///Tranforms raw data from javascript call.\r\n\tprivate HydrateRecommendations = (rawData): object =>\r\n\t{\r\n\t\tconst recommendationList = {};\r\n\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif (rawData)\r\n\t\t\t{\r\n\t\t\t\tconst currencySymbol = Tenant.CurrencySymbol;\r\n\r\n\t\t\t\tfor (let i = 0; i < rawData.length; i++)\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.HydratePlacement(rawData[i].placement_name, rawData[i].items, recommendationList, currencySymbol, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn recommendationList;\r\n\t\t}\r\n\t\tcatch (ex)\r\n\t\t{\r\n\t\t\t//continue\r\n\t\t}\r\n\t};\r\n\r\n\t// ///Get header recommendations from cache.\r\n\t// private GetCache()\r\n\t// {\r\n\t// \tlet result;\r\n\t// \tconst storageKey = \"HEADER_RECS\";\r\n\r\n\t// \ttry\r\n\t// \t{\r\n\t// \t\tresult = sessionStorage.getItem(storageKey);\r\n\t// \t}\r\n\t// \tcatch (e)\r\n\t// \t{\r\n\t// \t\tresult = null;\r\n\t// \t}\r\n\r\n\t// \tif (result)\r\n\t// \t{\r\n\t// \t\tresult = JSON.parse(result);\r\n\t// \t}\r\n\r\n\t// \treturn result;\r\n\t// }\r\n\r\n\t// ///Get header item recommendation from cache.\r\n\t// private GetCacheItem(key)\r\n\t// {\r\n\t// \tlet currentRecommendations;\r\n\t// \tconst timestamp = Date.now(); // current date time in milliseconds\r\n\t// \tconst cacheDuration = 3600000; // 1 hour in milliseconds\r\n\r\n\t// \tlet currentValues = this.GetCache();\r\n\t// \tif (!currentValues)\r\n\t// \t{\r\n\t// \t\tcurrentValues = [];\r\n\t// \t}\r\n\r\n\t// \tfor (let i = 0; i < currentValues.length; i++)\r\n\t// \t{\r\n\t// \t\tif (currentValues[i][0] === key)\r\n\t// \t\t{\r\n\t// \t\t\tif (currentValues[i][1] >= timestamp - cacheDuration)\r\n\t// \t\t\t{\r\n\t// \t\t\t\tcurrentRecommendations = currentValues[i][2];\r\n\t// \t\t\t}\r\n\t// \t\t\tbreak;\r\n\t// \t\t}\r\n\t// \t}\r\n\r\n\t// \tif (currentRecommendations)\r\n\t// \t{\r\n\t// \t\tcurrentRecommendations = JSON.parse(currentRecommendations);\r\n\t// \t}\r\n\r\n\t// \treturn currentRecommendations;\r\n\t// }\r\n\r\n\t// ///Saves header recommendations to cache.\r\n\t// private SetCacheItem(key, value)\r\n\t// {\r\n\t// \tif (value)\r\n\t// \t{\r\n\t// \t\tconst storageKey = \"HEADER_RECS\";\r\n\t// \t\tlet found = false;\r\n\t// \t\tconst jsonValue = JSON.stringify(value);\r\n\t// \t\tconst timestamp = Date.now(); // current date time in milliseconds\r\n\r\n\t// \t\tconst newRecommendations = [];\r\n\t// \t\tnewRecommendations.push(key);\r\n\t// \t\tnewRecommendations.push(timestamp);\r\n\t// \t\tnewRecommendations.push(jsonValue);\r\n\r\n\t// \t\tlet currentValues = this.GetCache();\r\n\t// \t\tif (!currentValues)\r\n\t// \t\t{\r\n\t// \t\t\tcurrentValues = [];\r\n\t// \t\t}\r\n\r\n\t// \t\tfor (let i = 0; i < currentValues.length; i++)\r\n\t// \t\t{\r\n\t// \t\t\tif (currentValues[i][0] === key)\r\n\t// \t\t\t{\r\n\t// \t\t\t\tcurrentValues[i] = newRecommendations;\r\n\t// \t\t\t\tfound = true;\r\n\t// \t\t\t\tbreak;\r\n\t// \t\t\t}\r\n\t// \t\t}\r\n\r\n\t// \t\tif (!found)\r\n\t// \t\t{\r\n\t// \t\t\tcurrentValues.push(newRecommendations);\r\n\t// \t\t}\r\n\r\n\t// \t\ttry\r\n\t// \t\t{\r\n\t// \t\t\tsessionStorage.setItem(storageKey, JSON.stringify(currentValues));\r\n\t// \t\t}\r\n\t// \t\tcatch (e)\r\n\t// \t\t{\r\n\t// \t\t\t//don't save\r\n\t// \t\t}\r\n\t// \t}\r\n\t// }\r\n}","import { DataLayerObject } from \"@gtm-support/core\";\r\nimport { EngagementProvider } from \"@Base/Engagement/Engagement\";\r\nimport { SubscriptionBase } from \"@Base/Engagement/SubscriptionBase\";\r\nimport { CookieManager } from \"@Utilities/CookieManager\";\r\nimport { CouponManager } from \"@Utilities/CouponManager\";\r\nimport { DataPrivacyPolicy } from \"@Utilities/DataPrivacyPolicy\";\r\nimport { ExperimentManager } from \"@Utilities/ExperimentManager\";\r\nimport { Media } from \"@Utilities/Media\";\r\nimport { TagManager } from '@ThirdParty/TagManager';\r\nimport { Tracking } from \"@Utilities/Tracking\";\r\nimport { TextResource, TextResourceClass } from \"@Utilities/TextResource\";\r\nimport { Recommendations } from \"@Base/Engagement/Recommendations\";\r\nimport { Sezzle } from \"@ThirdParty/Sezzle\";\r\n\r\ndeclare global\r\n{\r\n\tinterface Window\r\n\t{\r\n\t\tattentive?: any;\r\n\t\tCarousel?: any;\r\n\t\tdataLayer?: DataLayerObject[];\r\n\t\tFancybox?: any;\r\n\t\tPanzoom?: any;\r\n\t\tFun: {\r\n\t\t\tAnalytics: {\r\n\t\t\t\tAddTest?(thirdPartyTestID: string, variantSequence: number, callback?: Function);\r\n\t\t\t};\r\n\t\t\tCookieManager: CookieManager;\r\n\t\t\tClient: {\r\n\t\t\t\tApplyCoupon?(couponCode: string);\r\n\t\t\t\tDisplayCouponDetails?(banner: HTMLElement);\r\n\t\t\t\tRemoveCoupon?();\r\n\t\t\t};\r\n\t\t\tDataPrivacyPolicy: DataPrivacyPolicy;\r\n\t\t\tExperimentManager: ExperimentManager;\r\n\t\t\tGlobal:\r\n\t\t\t{\r\n\t\t\t\tAttentiveComplete?(data: any);\r\n\t\t\t\tAttentiveFixOverlay?();\r\n\t\t\t\tCreateGuestAccount?(email: string, phone: string, attentiveeEmail: boolean, attentiveSms: boolean);\r\n\t\t\t\tAddSubscription?(phone: string, email: string, subscriptionId: string);\r\n\t\t\t\tSubmitSubscriberForm?(form: any, showBanner: boolean, event?: Event);\r\n\t\t\t\tUpdateFooter?();\r\n\t\t\t};\r\n\t\t\tMedia: Media;\r\n\t\t\tTagManager: TagManager;\r\n\t\t\tTheme: {\r\n\t\t\t\tMedia?: string;\r\n\t\t\t};\r\n\t\t\tThirdParty: {\r\n\t\t\t\tSezzle?: Sezzle;\r\n\t\t\t};\r\n\t\t\tTracking: Tracking;\r\n\t\t\tRecommendations: Recommendations;\r\n\t\t};\r\n\t\tContentRendered: boolean;\r\n\t\tEngagementProvider: EngagementProvider;\r\n\t\tTrackJSSettings: {\r\n\t\t\ttoken: string;\r\n\t\t\tapplication: string;\r\n\t\t};\r\n\t\ttextResource: TextResourceClass;\r\n\t\ttrackJs: any;\r\n\t}\r\n}\r\n\r\nexport class Window\r\n{\r\n\tprivate readonly couponManager: CouponManager;\r\n\tprivate readonly engagementProvider: EngagementProvider;\r\n\tprivate readonly experimentManager: ExperimentManager;\r\n\tprivate readonly subscription: SubscriptionBase;\r\n\tprivate readonly tagManager: TagManager;\r\n\r\n\t/**\r\n\t * Constructs the window object for exposing global functions\r\n\t */\r\n\tconstructor()\r\n\t{\r\n\t\twindow.Carousel;\r\n\t\twindow.Fancybox;\r\n\t\twindow.Panzoom;\r\n\r\n\t\tthis.couponManager = new CouponManager();\r\n\t\tthis.engagementProvider = new EngagementProvider();\r\n\t\tthis.experimentManager = new ExperimentManager();\r\n\t\tthis.subscription = new SubscriptionBase();\r\n\r\n\t\twindow.Fun.Analytics =\r\n\t\t{\r\n\t\t\tAddTest: this.experimentManager.AddTest\r\n\t\t};\r\n\r\n\t\twindow.Fun.CookieManager = CookieManager;\r\n\r\n\t\twindow.Fun.Client =\r\n\t\t{\r\n\t\t\tApplyCoupon: this.couponManager.ApplyCoupon,\r\n\t\t\tDisplayCouponDetails: this.couponManager.DisplayCouponDetails,\r\n\t\t\tRemoveCoupon: this.couponManager.RemoveCoupon\r\n\t\t};\r\n\r\n\t\twindow.Fun.DataPrivacyPolicy = new DataPrivacyPolicy();\r\n\t\twindow.Fun.ExperimentManager = this.experimentManager;\r\n\r\n\t\twindow.Fun.Global =\r\n\t\t{\r\n\t\t\tAttentiveComplete: this.engagementProvider.SmsCallback,\r\n\t\t\tAttentiveFixOverlay: this.engagementProvider.FixOverlay,\r\n\t\t\tCreateGuestAccount: this.engagementProvider.CreateGuestAccount,\r\n\t\t\tAddSubscription: this.engagementProvider.AddSubscription,\r\n\t\t\tSubmitSubscriberForm: this.subscription.Submit,\r\n\t\t\tUpdateFooter: this.subscription.UpdateFooter\r\n\t\t};\r\n\r\n\t\twindow.Fun.Media = Media;\r\n\r\n\t\twindow.Fun.Recommendations = new Recommendations();\r\n\r\n\t\twindow.Fun.Theme = {\r\n\t\t\tMedia: Media.DeviceType\r\n\t\t};\r\n\r\n\t\twindow.Fun.ThirdParty = {\r\n\t\t\tSezzle: new Sezzle()\r\n\t\t};\r\n\r\n\t\twindow.Fun.Tracking = new Tracking();\r\n\r\n\t\twindow.ContentRendered = false;\r\n\t\twindow.EngagementProvider = this.engagementProvider;\r\n\t\twindow.textResource = TextResource;\r\n\t}\r\n}","import \"./SiteBase.scss\";\r\n\r\n// Import core bootstrap components using this method to ensure they are ALWAAAAAYS there and ready for use\r\nimport { DropOption } from \"./DropOption\";\r\nimport queryString from 'query-string';\r\nimport { TrackJS } from \"trackjs\";\r\n\r\nimport \"bootstrap/js/dist/alert\";\r\nimport \"bootstrap/js/dist/button\";\r\nimport \"bootstrap/js/dist/collapse\";\r\nimport \"bootstrap/js/dist/dropdown\";\r\nimport \"bootstrap/js/dist/offcanvas\";\r\nimport \"bootstrap/js/dist/tab\";\r\n\r\nimport \"lazysizes/plugins/print/ls.print\";\r\nimport \"lazysizes/plugins/respimg/ls.respimg\";\r\nimport \"lazysizes\";\r\n\r\nimport { ChatBase } from \"@Base/Engagement/Chat/ChatBase\";\r\nimport { CouponManager } from \"@Utilities/CouponManager\";\r\nimport { DataPrivacyPolicy } from \"@Utilities/DataPrivacyPolicy\";\r\nimport { FooterBase } from \"./FooterBase\";\r\nimport { HeaderBase } from \"./HeaderBase\";\r\nimport { EngagementProvider } from \"@Base/Engagement/Engagement\";\r\nimport { IContentCallback, ISpecialContent, ContentService } from \"@Api/ContentService\";\r\nimport { SiteListBase } from \"./SiteListBase\";\r\nimport { Tenant } from \"@Utilities/Tenant\";\r\nimport { Tracking } from \"@Utilities/Tracking\";\r\nimport { TransitBannerBase } from \"./TransitBannerBase\";\r\nimport { Window } from \"./_Window\";\r\n\r\nexport class SiteBase\r\n{\r\n\tpublic Chat: ChatBase;\r\n\tpublic readonly couponManager: CouponManager;\r\n\tpublic SiteList: SiteListBase;\r\n\tpublic Header: HeaderBase;\r\n\tpublic Footer: FooterBase;\r\n\tpublic TransitBanner: TransitBannerBase;\r\n\tprivate readonly contentService: ContentService;\r\n\tprivate readonly dataPrivacyPolicy: DataPrivacyPolicy;\r\n\tprivate readonly engagementProvider: EngagementProvider;\r\n\tprivate CartLinksConfigured = false;\r\n\tprivate ContentResponseCallbacks: Array = [];\r\n\tprivate readonly tracking: Tracking;\r\n\r\n\tconstructor()\r\n\t{\r\n\t\tnew Window();\r\n\t\tthis.contentService = new ContentService();\r\n\t\tthis.couponManager = new CouponManager();\r\n\t\tthis.dataPrivacyPolicy = new DataPrivacyPolicy();\r\n\t\tthis.engagementProvider = new EngagementProvider();\r\n\t\tthis.tracking = new Tracking();\r\n\t}\r\n\r\n\tpublic async Initialize(): Promise\r\n\t{\r\n\t\tthis.InitializeScriptErrorLogging();\r\n\t\tthis.tracking.VisitCountCheck();\r\n\t\tawait this.GetContent();\r\n\t\tnew DropOption();\r\n\t\tthis.ProcessQueryStrings();\r\n\t};\r\n\r\n\tprivate AddSpecialContent = (specialContent: Array): void =>\r\n\t{\r\n\t\tspecialContent.forEach(content =>\r\n\t\t{\r\n\t\t\tconst element = document.querySelector(`#${content.Element}`);\r\n\t\t\tconst frag = document.createRange().createContextualFragment(content.Html);\r\n\t\t\tconst contentNode = frag.firstChild;\r\n\r\n\t\t\tif (element !== null)\r\n\t\t\t{\r\n\t\t\t\tif (content.ReplaceExisting)\r\n\t\t\t\t{\r\n\t\t\t\t\telement.innerHTML = content.Html;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\telement.prepend(contentNode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (content.Element === \"skin-customer-message-home\" || content.Element === \"skin-customer-message\")\r\n\t\t\t{\r\n\t\t\t\tdocument.querySelector(`#${content.Element}`).classList.add(\"special-content\");\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n\r\n\tprivate TriggerContentCallbacks = (): void =>\r\n\t{\r\n\t\tthis.ContentResponseCallbacks.forEach((event) =>\r\n\t\t{\r\n\t\t\tevent();\r\n\t\t});\r\n\t};\r\n\r\n\t/// Must be done before SiteBase.Initialize is called\r\n\tpublic RegisterContentCallback = (callback: IContentCallback): void =>\r\n\t{\r\n\t\tthis.ContentResponseCallbacks.push(callback);\r\n\t};\r\n\r\n\tpublic GetContent = async (secondAttempt = false): Promise =>\r\n\t{\r\n\t\tthis.contentService.ApiCall()\r\n\t\t\t.then(() =>\r\n\t\t\t{\r\n\t\t\t\tif (typeof ContentService !== \"undefined\")\r\n\t\t\t\t{\r\n\t\t\t\t\tif (typeof ContentService.Response !== \"undefined\")\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tTenant.SecureDomainUrl = ContentService.Response.SecureDomainUrl;\r\n\t\t\t\t\t\tTenant.WebsiteName = ContentService.Response.WebsiteName;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Fallback in case Response fails for some reason\r\n\t\t\t\t\t\tTenant.SecureDomainUrl = `https://${document.location}/`;\r\n\r\n\t\t\t\t\t\tif (Tenant.SecureDomainUrl.includes(\"halloweencostumes\"))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tTenant.WebsiteName = \"HalloweenCostumes.com\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (Tenant.SecureDomainUrl.includes(\"halloween\"))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tTenant.WebsiteName = \"Halloween.com\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tTenant.WebsiteName = \"FUN.com\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (typeof this.Header !== \"undefined\")\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.Header.TriggerContentCallbacks();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.couponManager.TriggerContentCallbacks();\r\n\t\t\t\tthis.dataPrivacyPolicy.TriggerContentCallbacks();\r\n\t\t\t\tthis.engagementProvider.TriggerContentCallbacks();\r\n\r\n\t\t\t\tthis.ProcessExperiment();\r\n\t\t\t\tthis.ProcessSpecialContent();\r\n\t\t\t\tthis.ProcessCartLinks();\r\n\r\n\t\t\t\tif (typeof this.Footer !== \"undefined\")\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.Footer.TriggerContentCallbacks();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (typeof this.TransitBanner !== \"undefined\")\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.TransitBanner.TriggerContentCallbacks();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.TriggerContentCallbacks();\r\n\t\t\t\twindow.ContentRendered = true;\r\n\t\t\t\treturn Promise.resolve();\r\n\t\t\t})\r\n\t\t\t.catch((e: Error) =>\r\n\t\t\t{\r\n\t\t\t\t// Reattempt GetContent\r\n\t\t\t\tif (!secondAttempt)\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.GetContent(true);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tconst error = `GetContent Error: ${e}`;\r\n\t\t\t\t\tconsole.error(error);\r\n\t\t\t\t\treturn Promise.reject(`GetContent Error: ${e}`);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t};\r\n\r\n\tprivate InitializeScriptErrorLogging = (): void =>\r\n\t{\r\n\t\tconst trackJsSettings = window.TrackJSSettings;\r\n\r\n\t\tif (typeof trackJsSettings !== \"undefined\")\r\n\t\t{\r\n\t\t\tTrackJS.install(trackJsSettings);\r\n\t\t\twindow.trackJs = TrackJS;\r\n\t\t}\r\n\t};\r\n\r\n\t/// Configures the cart links.\r\n\tprivate ProcessCartLinks = (): void =>\r\n\t{\r\n\t\tif (typeof ContentService.Response !== \"undefined\")\r\n\t\t{\r\n\t\t\tif (ContentService.Response.IsDirectToCheckout !== undefined && ContentService.Response.IsDirectToCheckout !== null && ContentService.Response.IsDirectToCheckout)\r\n\t\t\t{\r\n\t\t\t\tif (!this.CartLinksConfigured)\r\n\t\t\t\t{\r\n\t\t\t\t\tconst url = Tenant.SecureDomainUrl + \"cart/check-out.aspx\";\r\n\t\t\t\t\tconst links = document.querySelectorAll('a[href$=\"/cart/\"]');\r\n\r\n\t\t\t\t\tlinks.forEach((link: HTMLLinkElement) =>\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tlink.href = url;\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tthis.CartLinksConfigured = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tprivate ProcessQueryStrings = (): void =>\r\n\t{\r\n\t\tconst parsed = queryString.parse(location.search);\r\n\t\tconst unique = parsed.unique as string;\r\n\t\tconst ogid = parsed.ogid as string;\r\n\r\n\t\tif (unique)\r\n\t\t{\r\n\t\t\tthis.engagementProvider.AddRecommendationClick(unique);\r\n\t\t}\r\n\r\n\t\tif (ogid)\r\n\t\t{\r\n\t\t\tthis.tracking.RestoreCart(ogid);\r\n\t\t}\r\n\t};\r\n\r\n\tprivate ProcessExperiment = (): void =>\r\n\t{\r\n\t\tif (typeof ContentService.Response !== \"undefined\")\r\n\t\t{\r\n\t\t\tconst experimentID = ContentService.Response.ExperimentID;\r\n\r\n\t\t\tif (typeof experimentID !== \"undefined\" && experimentID !== null && experimentID !== \"\")\r\n\t\t\t{\r\n\t\t\t\tthis.tracking.AddExperimentToGa(experimentID);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tprivate ProcessSpecialContent = (): void =>\r\n\t{\r\n\t\tif (typeof ContentService.Response !== \"undefined\")\r\n\t\t{\r\n\t\t\tconst scheduledContent = ContentService.Response.ScheduledContent;\r\n\t\t\tconst abContent = ContentService.Response.ABContent;\r\n\r\n\t\t\tif (scheduledContent !== undefined && scheduledContent !== null)\r\n\t\t\t{\r\n\t\t\t\tthis.AddSpecialContent(scheduledContent);\r\n\t\t\t}\r\n\r\n\t\t\tif (abContent !== undefined && abContent !== null)\r\n\t\t\t{\r\n\t\t\t\tthis.AddSpecialContent(abContent);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n}","export class SiteListBase\r\n{\r\n\tconstructor()\r\n\t{\r\n\t}\r\n}","import { CookieManager } from \"@Utilities/CookieManager\";\r\nimport { ContentService } from \"@Api/ContentService\";\r\nimport { ISpecialContent } from \"@Api/ContentService\";\r\nimport { intervalToDuration } from \"date-fns\";\r\nimport { Media } from '@Utilities/Media';\r\nimport { TextResource } from \"@Utilities/TextResource\";\r\n\r\ninterface ICell\r\n{\r\n\tElement: HTMLElement\r\n\tUtcString: string;\r\n\tUtcDate: Date;\r\n}\r\n\r\nexport class TransitBannerBase\r\n{\r\n\tprivate Banner: HTMLElement;\r\n\tprivate Cells: ICell[];\r\n\tprivate Container: HTMLElement;\r\n\tprivate Content: ISpecialContent[];\r\n\tprivate InvalidFetches = 0;\r\n\tpublic TransitInterval: ReturnType;\r\n\r\n\tconstructor()\r\n\t{\r\n\t}\r\n\r\n\tpublic Initialize(): void\r\n\t{\r\n\t\tif (this.Container !== null)\r\n\t\t{\r\n\t\t\tthis.Content.forEach(banner =>\r\n\t\t\t{\r\n\t\t\t\tif (banner.Element.indexOf(\"skin-customer-message\") > -1)\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.Container.innerHTML = this.RefactorHtml(banner.Html);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.ConfigureBanner();\r\n\t\t}\r\n\t}\r\n\r\n\tprivate ConfigureBanner = (): void =>\r\n\t{\r\n\t\tthis.Banner = this.Container.querySelector(\".ttb\");\r\n\t\tthis.Cells = [];\r\n\t\tconst bannerHeader = this.Container.querySelector(\".ttb__header\");\r\n\t\tconst bannerHeadline = this.Container.querySelector(\".ttb__headline\");\r\n\t\tconst bannerContent = this.Container.querySelector(\".ttb__content\");\r\n\t\tconst cells: NodeListOf = this.Container.querySelectorAll(\"[data-cutoff-time]\");\r\n\r\n\t\tif (Media.IsMobile)\r\n\t\t{\r\n\t\t\tbannerHeader.classList.add(\"collapsed\");\r\n\t\t\tbannerContent.classList.remove(\"show\");\r\n\t\t}\r\n\t\tcells.forEach(cell =>\r\n\t\t{\r\n\t\t\tconst utcString = cell.getAttribute(\"data-cutoff-time\");\r\n\t\t\tconst utcDate = new Date(utcString);\r\n\r\n\t\t\tthis.Cells.push({\r\n\t\t\t\tElement: cell,\r\n\t\t\t\tUtcDate: utcDate,\r\n\t\t\t\tUtcString: utcString\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\tthis.UpdateCountdown();\r\n\t\tthis.TransitInterval = setInterval(this.UpdateCountdown, 1000);\r\n\r\n\t\tif (this.Banner.classList.contains(\"ttb--6-20\"))\r\n\t\t{\r\n\t\t\tbannerHeadline.innerHTML = `${TextResource.GetTextByCulture(\"Feature_TransitBanner_Headline_FathersDay\")} `;\r\n\t\t}\r\n\r\n\t\tif (this.Banner.classList.contains(\"ttb--10-31\"))\r\n\t\t{\r\n\t\t\tbannerHeadline.innerHTML = `${TextResource.GetTextByCulture(\"Feature_TransitBanner_Headline_Halloween\")} `;\r\n\t\t}\r\n\r\n\t\tif (this.Banner.classList.contains(\"ttb--12-25\"))\r\n\t\t{\r\n\t\t\tbannerHeadline.innerHTML = `${TextResource.GetTextByCulture(\"Feature_TransitBanner_Headline_Christmas\")} `;\r\n\t\t}\r\n\r\n\t\tthis.Container.classList.remove(\"transitLoad\");\r\n\r\n\t\tif (CookieManager.GetCookie(CookieManager.Cookies.ReturnVisitor.Key, \"Ordered\") === \"true\")\r\n\t\t{\r\n\t\t\tconst orderWrap = document.createElement(\"div\");\r\n\t\t\torderWrap.innerHTML = ``;\r\n\t\t\tthis.Banner.after(orderWrap);\r\n\t\t}\r\n\t};\r\n\r\n\tprivate RefactorHtml = (html: string): string =>\r\n\t{\r\n\t\thtml = html.replace(\"data-target\", \"data-bs-target\");\r\n\t\thtml = html.replace(\"data-toggle\", \"data-bs-toggle\");\r\n\t\thtml = html.replace(\"ttb__header btn btn-link btn-block\", \"ttb__header btn btn-link d-block w-100\");\r\n\t\thtml = html.replace(``, ``);\r\n\t\treturn html;\r\n\t};\r\n\r\n\tprivate UpdateCountdown = (): void =>\r\n\t{\r\n\t\tlet fetchBanner = false;\r\n\t\tlet invalidCells = 0;\r\n\r\n\t\tconst currentDate = new Date();\r\n\r\n\t\tthis.Cells.forEach((cell: ICell) => \r\n\t\t{\r\n\t\t\tconst duration = intervalToDuration({\r\n\t\t\t\tstart: currentDate,\r\n\t\t\t\tend: cell.UtcDate\r\n\t\t\t});\r\n\t\t\tconst days = duration.days || 0;\r\n\t\t\tconst hours = duration.hours || 0;\r\n\t\t\tconst minutes = duration.minutes || 0;\r\n\t\t\tconst seconds = duration.seconds || 0;\r\n\t\t\tconst daysString = days > 0 ? `${days.toString()} day${days > 1 ? \"s\" : \"\"} `: \"\";\r\n\t\t\tconst hoursString = hours < 1 ? \"00\" : hours.toString().padStart(2, \"0\");\r\n\t\t\tconst minutesString = minutes < 1 ? \"00\": minutes.toString().padStart(2, \"0\");\r\n\t\t\tconst secondsString = seconds < 1 ? \"00\": seconds.toString().padStart(2, \"0\");\r\n\r\n\t\t\t// Add a class and change the countdown format if the next cutoff time is more than a day away\r\n\t\t\tif (days > 0 && !this.Banner.classList.contains(\"ttb--days\"))\r\n\t\t\t{\r\n\t\t\t\tthis.Banner.classList.add(\"ttb--days\");\r\n\t\t\t}\r\n\r\n\t\t\tcell.Element.textContent = `${daysString}${hoursString}:${minutesString}:${secondsString}`;\r\n\r\n\t\t\tif (days < 1 && hours < 1 && minutes < 1 && seconds < 1)\r\n\t\t\t{\r\n\t\t\t\tif (this.InvalidFetches < 2)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Fetch the banner if we have less than 3 invalid attempts (including the initial attempt)\r\n\t\t\t\t\tfetchBanner = true;\r\n\r\n\t\t\t\t\tif (days < 0 || hours < 0 || minutes < 0 || seconds < 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tinvalidCells = invalidCells + 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t// Stop attempting to fetch if we have more than 4 invalid fetches to avoid an infinite loop and pounding the servers\r\n\t\t\t\t\tclearInterval(this.TransitInterval);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif (fetchBanner)\r\n\t\t{\r\n\t\t\t// Stop the banner from updating when the timer hits zero\r\n\t\t\tclearInterval(this.TransitInterval);\r\n\r\n\t\t\tif (invalidCells > 0)\r\n\t\t\t{\r\n\t\t\t\t// Add to invalid fetch counter if there's any invalid cells\r\n\t\t\t\tthis.InvalidFetches = this.InvalidFetches + 1;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// Reset fetch counter if all cells are valid\r\n\t\t\t\tthis.InvalidFetches = 0;\r\n\t\t\t}\r\n\r\n\t\t\twindow.setTimeout(() =>\r\n\t\t\t{\r\n\t\t\t\t// Wait three seconds and do another getcontent request to update the transit banner\r\n\t\t\t\tconst contentService = new ContentService();\r\n\t\t\t\tcontentService.ApiCall()\r\n\t\t\t\t\t.then(() =>\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (typeof ContentService !== \"undefined\" && typeof ContentService.Response !== \"undefined\")\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Reinitialize the transit banner with the new shipping information\r\n\t\t\t\t\t\t\tthis.TriggerContentCallbacks();\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t})\r\n\t\t\t\t\t.catch(() =>\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tconsole.log(\"GetContent error when updating transit banner\");\r\n\t\t\t\t\t});\r\n\t\t\t}, 3000);\r\n\t\t}\r\n\t};\r\n\r\n\tpublic TriggerContentCallbacks = (): void =>\r\n\t{\r\n\t\tif (typeof ContentService.Response !== \"undefined\")\r\n\t\t{\r\n\t\t\tthis.Content = ContentService.Response.TransitTimeContent;\r\n\t\t\tthis.Container = document.querySelector(\"#transitTimeBanner\");\r\n\r\n\t\t\tif (this.Content !== undefined && this.Content !== null && this.Content.length > 0)\r\n\t\t\t{\r\n\t\t\t\tthis.Initialize();\r\n\t\t\t}\r\n\t\t\telse if (this.Container !== null)\r\n\t\t\t{\r\n\t\t\t\t// If we have no more transit times left in this profile, delete the container from the dom\r\n\t\t\t\tthis.Container.remove();\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n}"],"names":["Handlebars","module","exports","template","container","depth0","helpers","partials","data","helper","lookupProperty","parent","propertyName","Object","prototype","hasOwnProperty","call","escapeExpression","hooks","helperMissing","nullContext","alias1","alias2","alias3","alias4","stack1","program","noop","SubscriptionBase","constructor","MaskPhoneInput","form","getAttribute","phoneCheck","querySelector","phoneCollapse","phoneInput","document","getElementById","maskFormat","DomainProjectID","ID","HalloweenCostumesAU","addEventListener","then","IMask","InputMask","mask","once","style","display","ConfigureForm","this","CheckExclusions","ThirdPartyModalEnabled","EvaluateEmailAcquisitionModal","returnVisitorCookie","Cookies","ReturnVisitor","hasOrdered","GetCookie","Key","Ordered","genericSubscriptionId","MakeFormGeneric","frmSubscribe","index","window","location","href","split","indexOf","forceModal","search","parse","parseBooleans","EmailModal","SeenModal","dataPrivacyPolicy","DisplayModal","delayModal","DelayModal","pages","parseInt","isNaN","SetCookie","toString","RenderEmailAcquisitionModal","force","subscriptionId","prc","txtName","forceQueryString","noModal","classList","contains","hasOffer","frmSubscribeAttribute","replace","logoEl","logo","alt","src","width","height","modalWrap","createElement","innerHTML","GetEmailAcquisitionModalHtml","modalNode","firstElementChild","body","appendChild","show","event","ModalDisposer","currentTarget","subscribeOffer","subscribeText","subscribeThanks","subscribeSent","setAttribute","add","GenericText","GenericThanks","Submit","showBanner","preventDefault","checked","value","emailInput","email","isEmailValid","Email","phone","errors","GetTextByCulture","alert","length","alertNode","prepend","firstChild","remove","engagementProvider","AddSubscription","CreateGuestAccount","offer","thanks","address","textContent","UpdateFooter","GetFooter","response","footerHtml","footer","outerHTML","showPhone","catch","error","console","log","config","DropOption","ConfigureDropOption","selector","querySelectorAll","forEach","dropOptionContainer","DropOptionItemBind","dropOptionSelections","preSelectedIndex","preSelectedValue","selection","preSelectedInput","evt","DropOptionSelectionHandler","click","e","type","keyboardEvent","key","stopPropagation","clickedSelection","clickedRadio","changeEvent","Event","ddl","closest","activeOption","dispatchEvent","GetSelectedValue","element","FooterBase","DisplaySellDataOptOutLink","sellLink","TriggerContentCallbacks","FooterForm","ConfigureSubscription","Response","Initialize","SearchBase","ConfigureSearch","ConfigureAutoComplete","ClearSearchHandler","TxtSearch","ClearSearchToggle","btnClearSearch","BtnClearSearch","AutoCompleteForm","wrapper","placeHolder","query","trim","source","fetch","json","keys","resultItem","url","match","highlight","resultsList","id","class","maxResult","tabSelect","noResults","submit","input","SelectAutoCompleteEntry","FrmSearch","SearchHandler","Validation","SiteSearch","TagManager","Search","blur","detail","label","HeaderBase","ConfigureMobile","Media","MediaMobile","deferSetup","MenuMobileSetup","StickyHeaderSetup","unmatch","MenuMobileDestroy","StickyHeaderDestroy","MenuMobileOpen","MobileMenu","TopMenu","OffCanvasMenuEl","OffCanvasMenuInstance","StickyHeader","destroy","header","offset","offsetHeight","onPin","onUnpin","hide","init","UpdateAccountName","ContentService","AccountName","accountName","myAccountText","myAccountContainers","name","TextResource","UpdateCartIcon","itemOrderQuantity","cartButton","cartPreorder","cartCount","TotalItemQuantity","UpdateOrderItemIcon","itemPreorderQuantity","PreOrderItemQuantity","tooltip","ConstructSentence","ProcessInternationalBanners","CookieManager","undefined","WebsiteSuggestionBanner","websiteSuggestionBanner","AddToBannerSection","InternationalBanner","intlBanner","cartBuy","contentService","DesktopMenu","Menu","removeEventListener","MobileMenuInstance","dispose","parentNode","removeChild","banner","bannerSection","bannerSectionHome","bannerNode","createRange","createContextualFragment","append","Product","productID","sizes","title","link","imageLink","price","isOnClearance","isOnSale","isPreOrder","rating","currencySymbol","exclusive","madeByUs","rrLink","savings","sizeCount","sizeStandard","maxPrice","minPrice","maxRegularPrice","minRegularPrice","k","DisplayPrice","toFixed","RegularPrice","CurrencySymbol","Exclusive","ImageLink","ImageLinkMedium","ImageLinkLarge","ImageLinkXLarge","IsOnSale","IsPreOrder","Link","MadeByUs","MaxOriginalPrice","MaxPrice","MinOriginalPrice","MinPrice","ProductID","Rating","RefreshExclusiveMadeByUsTag","RefreshShowExclusive","RRLink","Sizes","Title","HasPriceRange","description","ratingMod","ratings","currentRating","j","push","RatingDescription","Ratings","i","Size","IsSingleSize","IsSingleSizeNotStandard","HasSavings","IsOnClearance","Savings","Math","round","ProductCarousel","carouselID","carouselTitle","products","CarouselID","CarouselTitle","Products","ProductSize","sizeID","size","displayPrice","regularPrice","displayOrder","SizeID","parseFloat","DisplayOrder","Recommendations","ReferrerCategoryID","ReferringCategoryAsyncAPI","GetReferringCategoryCallback","FunAddToCart","rawData","recommendationList","HydrateRecommendations","carousel","html","mysteryJson","recOne","recTwo","recThree","recFour","FunMysteryBoxLocal","AddToCart","ConfigureThemeAddItems","FunCategory","recRecent","strategy_message","FunHome","HydrateLocalPlacement","rec","EnableSlider","ConfigureFourUpCarousel","exclusionContainer","FunProduct","recRecentSide","rec2","rec3","ConfigureRightItems","FunSearch","recNoSearch","HalloweenAddToCart","accJson","HalloweenAddToCartLocal","HalloweenCategory","HalloweenHome","HalloweenProduct","HalloweenSearch","HCAddToCart","HCAddToCartLocal","HCCategory","recForYou","HCGroupBuilderReview","HCHome","HCProduct","recRecent2","HCSearch","HandleRecommendationClick","rrLinks","target","updateLocation","rrUrl","targetUrl","axios","get","top","GetReferringCategory","callbackFunction","referrer","categoryID","trackingService","recommendations","rcnts","carouselSelector","displayCount","IsMobile","carouselInstance","Fancyapps","Import","Carousel","slidesPerPage","center","Navigation","options","updatePage","el","sizeSelectors","addRec","select","selectedIndex","Tenant","AddRecHandler","product","ProductSizeID","Quantity","CartItemOriginID","cart","AddProduct","placementName","item","sizeData","currencyCookie","Currency","items","JSON","CurrencyID","Price","sort","a","b","LinkTitle","Url","ThumbnailUrl","IsExclusive","HydratePlacement","isApi","currencyFound","attributes","size_info","currencyId","m","Prices","relative_url","imageURL","priceCents","is_on_clearance","is_on_sale","is_preorder","exclusive_item","made_by_us","clickTrackingURL","image_url","link_url","placement_name","ex","Cart","TrackingService","Window","Fancybox","Panzoom","couponManager","CouponManager","Engagement","experimentManager","ExperimentManager","subscription","Fun","Analytics","AddTest","Client","ApplyCoupon","DisplayCouponDetails","RemoveCoupon","DataPrivacyPolicy","Global","AttentiveComplete","SmsCallback","AttentiveFixOverlay","FixOverlay","SubmitSubscriberForm","Theme","DeviceType","ThirdParty","Sezzle","Tracking","ContentRendered","EngagementProvider","textResource","SiteBase","CartLinksConfigured","ContentResponseCallbacks","AddSpecialContent","specialContent","content","Element","contentNode","Html","ReplaceExisting","RegisterContentCallback","callback","GetContent","secondAttempt","ApiCall","SecureDomainUrl","WebsiteName","includes","Header","ProcessExperiment","ProcessSpecialContent","ProcessCartLinks","Footer","TransitBanner","Promise","resolve","reject","InitializeScriptErrorLogging","trackJsSettings","TrackJSSettings","install","trackJs","IsDirectToCheckout","ProcessQueryStrings","parsed","unique","ogid","AddRecommendationClick","tracking","RestoreCart","experimentID","ExperimentID","AddExperimentToGa","scheduledContent","ScheduledContent","abContent","ABContent","VisitCountCheck","SiteListBase","TransitBannerBase","InvalidFetches","ConfigureBanner","Banner","Container","Cells","bannerHeader","bannerHeadline","bannerContent","cells","cell","utcString","utcDate","Date","UtcDate","UtcString","UpdateCountdown","TransitInterval","setInterval","orderWrap","after","RefactorHtml","fetchBanner","invalidCells","currentDate","duration","start","end","days","hours","minutes","seconds","daysString","hoursString","padStart","minutesString","secondsString","clearInterval","setTimeout","Content","TransitTimeContent"],"sourceRoot":""}