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,KC7C1GvB,GAAoB,EAAE,OAAW,CAAC,IAAI,IAAI,GAAG,EAAG,IAAOA,GAAoB,IAAI,CAAE,EACjF,IAAIwB,GAAsBxB,GAAoB,EAAE,OAAW,CAAC,IAAI,IAAI,GAAG,EAAG,IAAOA,GAAoB,IAAI,CAAE,EAC3GwB,GAAsBxB,GAAoB,EAAEwB,EAAmB,C","sources":["webpack:///./src/app/shared/haunted/CustomHooks.ts","webpack:///./src/app/components/bancoe-bar/bancoe-bar.ts","webpack:///./src/app/components/directives/ref.ts","webpack:///./src/app/components/admin-modal/admin-modal.ts","webpack:///./src/app/components/admin/culture-name-settings.ts","webpack:///./src/app/components/admin/dynamic-promo-codes.ts","webpack:///./src/app/components/admin/route-settings.ts","webpack:///./src/app/components/admin/insurance-tab-settings.ts","webpack:///./src/app/component-helpers/SearchboxTealiumHelpers.ts","webpack:///./src/app/components/singleton/useSingleton.ts","webpack:///./src/app/components/searchbox/opening-pane/usePane.ts","webpack:///./src/app/components/searchbox/pax-selector/usePax.ts","webpack:///./src/app/component-helpers/PromoCodeHelper.ts","webpack:///./src/app/component-helpers/useUserInfo.ts","webpack:///./src/app/components/searchbox/pax-selector/usePaxSelector.ts","webpack:///./src/app/shared/helpers/farePriceHelper.ts","webpack:///./src/app/component-helpers/HeaderHelper.ts","webpack:///./src/app/component-mappers/ScheduleMapper.ts","webpack:///./src/app/component-helpers/useNavitaireSettings.ts","webpack:///./src/app/component-helpers/useTimeTable.ts","webpack:///./src/app/components/searchbox/date-selector/useDateSelector.ts","webpack:///./src/app/component-helpers/StationHelper.ts","webpack:///./src/app/component-helpers/Strategies/alphabeticalOrderStrategy.ts","webpack:///./src/app/shared/helpers/stringHelper.ts","webpack:///./src/app/component-helpers/Strategies/resourceXmlOrderStrategy.ts","webpack:///./src/app/component-helpers/Strategies/useStationOrderStrategyFactory.ts","webpack:///./src/app/component-helpers/useStations.ts","webpack:///./src/app/component-helpers/SearchboxEventBusHelpers.ts","webpack:///./src/app/components/searchbox/route-selector/useRouteSelector.ts","webpack:///./src/app/components/searchbox/trip-type-selector/useTripTypeSelector.ts","webpack:///./src/app/components/searchbox/promo-code-box/usePromoCodeBox.ts","webpack:///./src/app/components/searchbox/usePreviousSearch.ts","webpack:///./src/app/components/searchbox/searchbox.ts","webpack:///./src/app/components/searchbox/date-selector/dc-datepicker.ts","webpack:///./src/app/components/smart-timer/smart-timer.ts","webpack:///./src/app/component-helpers/CultureHelper.ts","webpack:///./src/app/components/main-menu/useCultureSelector.ts","webpack:///./src/app/components/main-menu/useLoginWidget.ts","webpack:///./src/app/components/main-menu/useAmericanUserData.ts","webpack:///./src/app/components/main-menu/main-menu.ts","webpack:///./src/app/components/pcra-login-info-modal/peru-compra-login-info-modal.ts","webpack:///./src/app/components/chile-compra-login-info-modal/chile-compra-login-info-modal.ts","webpack:///./src/app/components/login-handlers/cug3-login-handler.ts","webpack:///./src/app/components/login-handlers/aa-login-handler.ts","webpack:///./src/app/components/redemption-no-promo-code-modal/redemption-no-promo-code-modal.ts","webpack:///./src/app/components/american-airlines-token-modal/useCountDown.ts","webpack:///./src/app/components/american-airlines-token-modal/american-airlines-token-modal.ts","webpack:///./src/app/components/components.ts","webpack:///./src/app/bootstrap.ts","webpack:///webpack/bootstrap","webpack:///webpack/runtime/chunk loaded","webpack:///webpack/runtime/compat get default export","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/global","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/make namespace object","webpack:///webpack/runtime/node module decorator","webpack:///webpack/runtime/jsonp chunk loading","webpack:///webpack/startup"],"sourcesContent":["import { useEffect as hauntedUseEffect, useMemo as hauntedUseMemo, useState as hauntedUseState } from \"haunted\";\n\n// class ClientManagerHook extends Hook {\n// \tprivate readonly abortController = new AbortController();\n// \tprivate readonly clientManager: ClientManager;\n// \tconstructor(id: number, state: State) {\n// \t\tsuper(id, state);\n// \t\tthis.clientManager = new ClientManager(this.abortController.signal);\n// \t}\n\n// \tpublic update(): ClientManager {\n// \t\treturn this.clientManager;\n// \t}\n\n// \tpublic teardown() {\n// \t\tthis.abortController.abort();\n// \t}\n// }\n\n// class ClientHook<T> extends Hook {\n// \tprivate readonly abortController = new AbortController();\n// \tprivate readonly client: T;\n// \tconstructor(id: number, state: State, ctor: ClientConstructor<T>) {\n// \t\tsuper(id, state);\n// \t\tthis.client = new ClientManager(this.abortController.signal).createClient(ctor);\n// \t}\n\n// \tpublic update(): T {\n// \t\treturn this.client;\n// \t}\n\n// \tpublic teardown() {\n// \t\tthis.abortController.abort();\n// \t}\n// }\n\n// class QueryStateManagerHook<T extends string | number | Date> extends Hook {\n// \tprivate args!: readonly [T, (value: T) => void];\n// \tprivate readonly key: string;\n// \tconstructor(id: number, state: State, key: string, initialValue: T) {\n// \t\tsuper(id, state);\n// \t\tthis.updater = this.updater.bind(this);\n// \t\tthis.key = key;\n// \t\tconst parameter = Router.getQueryParameter(key);\n// \t\tif (parameter !== undefined) {\n// \t\t\tif (initialValue instanceof Date) {\n// \t\t\t\tthis.makeArgs(parseTimestamp(parameter).toDate() as T);\n// \t\t\t} else if (typeof initialValue === \"number\") {\n// \t\t\t\tthis.makeArgs(parseInt(parameter, 10) as T);\n// \t\t\t} else if (typeof initialValue === \"string\") {\n// \t\t\t\tthis.makeArgs(parameter as T);\n// \t\t\t} else {\n// \t\t\t\tthis.makeArgs(parameter as T);\n// \t\t\t}\n// \t\t} else {\n// \t\t\tthis.makeArgs(initialValue);\n// \t\t}\n// \t}\n\n// \tpublic update(): readonly [T, (value: T) => void] {\n// \t\treturn this.args;\n// \t}\n\n// \tprivate makeArgs(value: T): void {\n// \t\tthis.args = Object.freeze([value, this.updater.bind(this)] as const);\n// \t}\n\n// \tprivate updater(value: T): void {\n// \t\tif (value instanceof Date) {\n// \t\t\tRouter.updateParameter(this.key, formatTimestamp(value));\n// \t\t} else if (typeof value === \"number\") {\n// \t\t\tRouter.updateParameter(this.key, value.toString());\n// \t\t} else if (typeof value === \"string\") {\n// \t\t\tRouter.updateParameter(this.key, value);\n// \t\t}\n// \t\tthis.makeArgs(value);\n// \t\tthis.state.update();\n// \t}\n// }\n\nexport const useState = hauntedUseState;\nexport const useMemo = hauntedUseMemo;\n// export const useClient = hook(ClientHook);\n// export const useClientManager = hook(ClientManagerHook);\n// export const useQueryState = hook(QueryStateManagerHook);\n\nexport const useEffect = (\n\tcallback: () => Promise<(() => void) | void> | ((() => void) | void),\n\tvalues?: unknown[] | undefined\n): void => {\n\thauntedUseEffect(() => {\n\t\t// setTimeout is used, because useEffect can cascade between embedded components and can cause an update skipped (such as an \"initial render\")\n\t\t// const result = callback();\n\t\t//eslint-disable-next-line @typescript-eslint/no-misused-promises\n\t\twindow.setTimeout(() => {\n\t\t\tconst result = callback();\n\t\t\tif (result instanceof Promise) {\n\t\t\t\tresult.catch(async (reason) => {\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.log(reason);\n\t\t\t\t});\n\t\t\t}\n\t\t}, 0);\n\t}, values);\n};\n\n// export const useValidationContext = <VM, FN extends string>(validator: AbstractValidator<VM>) => {\n// \tconst [validationResult, setValidationResult] = useState<DCValidationResult<FN>>(new DCValidationResult<FN>());\n// \tconst [fieldsExplicitlyValidated, setFieldsExplicitlyValidated] = useState<{ [key in FN]?: boolean }>({});\n// \tconst [newFieldsToAddAtValidation, setNewFieldsToAddAtValidation] = useState<FN[]>([]);\n\n// \tconst addValidationFieldsAtValidation = (fieldNames: FN[]) => {\n// \t\tsetNewFieldsToAddAtValidation(fieldNames);\n// \t};\n\n// \tconst addValidationFields = () => {\n// \t\tif (newFieldsToAddAtValidation.length > 0) {\n// \t\t\tconst newValidationFields = { ...fieldsExplicitlyValidated };\n// \t\t\tnewFieldsToAddAtValidation.forEach((fieldName) => {\n// \t\t\t\tnewValidationFields[fieldName] = true;\n// \t\t\t});\n// \t\t\tsetFieldsExplicitlyValidated(newValidationFields);\n// \t\t\tsetNewFieldsToAddAtValidation([]);\n// \t\t}\n// \t};\n\n// \treturn {\n// \t\tvalidate: (viewModel: VM): DCValidationResult<FN> => {\n// \t\t\taddValidationFields();\n// \t\t\tconst validationResult2 = new DCValidationResult<FN>(validator.validate(viewModel));\n// \t\t\tsetValidationResult(validationResult2);\n// \t\t\treturn validationResult2;\n// \t\t},\n// \t\tvalidateField: (fieldName: FN) => {\n// \t\t\taddValidationFieldsAtValidation([fieldName]);\n// \t\t},\n// \t\tgetValidationMessage: (fieldName: FN) => {\n// \t\t\tconst msg = fieldsExplicitlyValidated[fieldName] ? validationResult.getValidationMessage(fieldName) : \"\";\n// \t\t\treturn msg;\n// \t\t},\n// \t\tvalidateFields: addValidationFieldsAtValidation,\n// \t\tclearFieldValidations: () => {\n// \t\t\tsetFieldsExplicitlyValidated({});\n// \t\t},\n// \t\tvalidationResult,\n// \t};\n// };\n","import { html } from \"haunted\";\nimport i18next from \"i18next\";\nimport { useState } from \"Shared/haunted/CustomHooks\";\nimport { HauntedFunc } from \"Shared/haunted/HooksHelpers\";\nimport { LINKS } from \"Services/constants\";\n\nexport const useShadowDOM = false;\nexport const name = \"ac-bancoe-bar\";\n\nexport type DcMembershipType = \"None\" | \"Standard\" | \"Group\";\n\nexport interface Props {\n\tbancoEstadoCategory: number;\n\tdcMembershipType: DcMembershipType;\n\tfreeSeats: number;\n\tisBarOpen: boolean;\n}\n\nexport const Component: HauntedFunc<Props> = (host) => {\n\tconst props: Props = {\n\t\tbancoEstadoCategory: host.bancoEstadoCategory,\n\t\tdcMembershipType: host.dcMembershipType,\n\t\tfreeSeats: host.freeSeats,\n\t\tisBarOpen: host.isBarOpen,\n\t};\n\n\tconst [isMobileNoMembershipTooltipOpen, setIsMobileNoMembershipTooltipOpen] = useState<boolean>(false);\n\tconst [isMobileStandardMembershipTooltipOpen, setIsMobileStandardMembershipTooltipOpen] = useState<boolean>(false);\n\tconst [isMobileGroupMembershipTooltipOpen, setIsMobileGroupMembershipTooltipOpen] = useState<boolean>(false);\n\n\tconst noMembershipContent = html`\n\t\t<div class=\"beb-tooltip bg-be-cyan\">\n\t\t\t<div class=\"beb-tooltip-close-btn\" @click=${() => setIsMobileNoMembershipTooltipOpen(false)}>&times;</div>\n\t\t\t<div class=\"bebtt-membership-info\">\n\t\t\t\t<div class=\"text-center\">\n\t\t\t\t\t${i18next.t(\"¿Aún no eres parte del\")}\n\t\t\t\t\t<br />\n\t\t\t\t\t<span>${i18next.t(\"Club de Descuentos\")}</span> ${i18next.t(\"de\")}\n\t\t\t\t\t<span>${i18next.t(\"JetSMART\")}</span>?\n\t\t\t\t</div>\n\t\t\t\t<div class=\"mt-4 text-left\">\n\t\t\t\t\t${i18next.t(\"Aprovecha tu precio preferente con tu\")}\n\t\t\t\t\t<br />\n\t\t\t\t\t<span>${i18next.t(\"Tarjeta SMART\")}</span> ${i18next.t(\"y obtén éstos beneficios\")}:\n\t\t\t\t</div>\n\t\t\t\t<div class=\"bebtt-list-plus mt-4 text-left\">\n\t\t\t\t\t<i class=\"js-icon-be2 js-be2-circle-plus\"></i>\n\t\t\t\t\t${i18next.t(\"Ahorra hasta\")}\n\t\t\t\t\t<span class=\"emphasis\">${i18next.t(\"$5.000\")}</span>\n\t\t\t\t\t${i18next.t(\"por tramo para tarifas sobre $15.000.\")}\n\t\t\t\t</div>\n\t\t\t\t<div class=\"bebtt-list-plus mt-2 text-left\">\n\t\t\t\t\t<i class=\"js-icon-be2 js-be2-circle-plus\"></i>\n\t\t\t\t\t${i18next.t(\"Ahorra\")}\n\t\t\t\t\t<span class=\"emphasis\">${i18next.t(\"$1.000\")}</span>\n\t\t\t\t\t${i18next.t(\"por maleta por cada tramo de tu viaje.\")}\n\t\t\t\t</div>\n\t\t\t\t<div class=\"bebtt-list-plus mt-2 text-left\">\n\t\t\t\t\t<i class=\"js-icon-be2 js-be2-circle-plus\"></i>\n\t\t\t\t\t${i18next.t(\"Descuentos aplican para ti, y uno o 5 acompañantes, según membresía.\")}\n\t\t\t\t</div>\n\t\t\t\t<div class=\"bebtt-list-plus mt-2 text-left\">\n\t\t\t\t\t<i class=\"js-icon-be2 js-be2-circle-plus\"></i>\n\t\t\t\t\t${i18next.t(\"Acceso a ofertas exclusivas del\")}\n\t\t\t\t\t<span class=\"emphasis\">${i18next.t(\"Club de Descuentos.\")}</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=\"mt-4\">\n\t\t\t\t<a class=\"be-tooltip-btn\" href=${LINKS.DC} target=\"_blank\">\n\t\t\t\t\t${i18next.t(\"¡Lo quiero!\")}\n\t\t\t\t\t<i class=\"jsh-icon jsh-circle-chevron-right\"></i>\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t</div>\n\t`;\n\n\tconst standardMembershipContent = html`\n\t\t<div class=\"beb-tooltip bg-be-cyan\">\n\t\t\t<div class=\"beb-tooltip-close-btn\" @click=${() => setIsMobileStandardMembershipTooltipOpen(false)}>\n\t\t\t\t&times;\n\t\t\t</div>\n\t\t\t<div class=\"bebtt-membership-info\">\n\t\t\t\t<div class=\"bebtt-list-plus mt-2 text-left\">\n\t\t\t\t\t<i class=\"js-icon-be2 js-be2-circle-tick\"></i>\n\t\t\t\t\t${i18next.t(\"Ahorra hasta\")}\n\t\t\t\t\t<span class=\"emphasis\">${i18next.t(\"$5.000\")}</span>\n\t\t\t\t\t${i18next.t(\"por tramo para tarifas sobre $15.000.\")}\n\t\t\t\t</div>\n\t\t\t\t<div class=\"bebtt-list-plus mt-2 text-left\">\n\t\t\t\t\t<i class=\"js-icon-be2 js-be2-circle-tick\"></i>\n\t\t\t\t\t${i18next.t(\"Ahorra\")}\n\t\t\t\t\t<span class=\"emphasis\">${i18next.t(\"$1.000\")}</span>\n\t\t\t\t\t${i18next.t(\"por maleta por cada tramo de tu viaje.\")}\n\t\t\t\t</div>\n\t\t\t\t<div class=\"bebtt-list-plus mt-2 text-left\">\n\t\t\t\t\t<i class=\"js-icon-be2 js-be2-circle-tick\"></i>\n\t\t\t\t\t${i18next.t(\"Descuentos aplican para ti, y un acompañante.\")}\n\t\t\t\t</div>\n\t\t\t\t<div class=\"bebtt-list-plus mt-2 text-left\">\n\t\t\t\t\t<i class=\"js-icon-be2 js-be2-circle-tick\"></i>\n\t\t\t\t\t${i18next.t(\"Acceso a ofertas exclusivas del\")}\n\t\t\t\t\t<span class=\"emphasis\">${i18next.t(\"Club de Descuentos.\")}</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t`;\n\n\tconst groupMembershipContent = html`\n\t\t<div class=\"beb-tooltip bg-be-cyan\">\n\t\t\t<div class=\"beb-tooltip-close-btn\" @click=${() => setIsMobileGroupMembershipTooltipOpen(false)}>\n\t\t\t\t&times;\n\t\t\t</div>\n\t\t\t<div class=\"bebtt-membership-info\">\n\t\t\t\t<div class=\"bebtt-list-plus mt-2 text-left\">\n\t\t\t\t\t<i class=\"js-icon-be2 js-be2-circle-tick\"></i>\n\t\t\t\t\t${i18next.t(\"Ahorra hasta\")}\n\t\t\t\t\t<span class=\"emphasis\">${i18next.t(\"$5.000\")}</span>\n\t\t\t\t\t${i18next.t(\"por tramo para tarifas sobre $15.000.\")}\n\t\t\t\t</div>\n\t\t\t\t<div class=\"bebtt-list-plus mt-2 text-left\">\n\t\t\t\t\t<i class=\"js-icon-be2 js-be2-circle-tick\"></i>\n\t\t\t\t\t${i18next.t(\"Ahorra\")}\n\t\t\t\t\t<span class=\"emphasis\">${i18next.t(\"$1.000\")}</span>\n\t\t\t\t\t${i18next.t(\"por maleta por cada tramo de tu viaje.\")}\n\t\t\t\t</div>\n\t\t\t\t<div class=\"bebtt-list-plus mt-2 text-left\">\n\t\t\t\t\t<i class=\"js-icon-be2 js-be2-circle-tick\"></i>\n\t\t\t\t\t${i18next.t(\"Descuentos aplican para ti, y hasta 5 acompañantes.\")}\n\t\t\t\t</div>\n\t\t\t\t<div class=\"bebtt-list-plus mt-2 text-left\">\n\t\t\t\t\t<i class=\"js-icon-be2 js-be2-circle-tick\"></i>\n\t\t\t\t\t${i18next.t(\"Acceso a ofertas exclusivas del\")}\n\t\t\t\t\t<span class=\"emphasis\">${i18next.t(\"Club de Descuentos.\")}</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t`;\n\n\tconst noMembershipSection = html`\n\t\t<div class=\"beb-section beb-section-3\">\n\t\t\t<i class=\"beb-section-icon js-icon-be2 js-be2-money\"></i>\n\t\t\t${i18next.t(\"Precio Preferente\")}\n\t\t\t<span>${i18next.t(\"Club de Descuentos\")}</span>\n\t\t\t<i\n\t\t\t\tclass=\"js-icon js-flight-help beb-tooltip-opener\"\n\t\t\t\t@click=${() => setIsMobileNoMembershipTooltipOpen(true)}\n\t\t\t\t>${noMembershipContent}</i\n\t\t\t>\n\t\t</div>\n\t`;\n\n\tconst standardMembershipSection = html`\n\t\t<div class=\"beb-section beb-section-3\">\n\t\t\t<i class=\"beb-section-icon js-icon-be2 js-be2-money\"></i>\n\t\t\t${i18next.t(\"Membresía Estándar\")}\n\t\t\t<span>${i18next.t(\"Club de Descuentos\")}</span>\n\t\t\t<img class=\"beb-section-tick\" src=\"/images/banco-estado/bar-tick-color.png\" />\n\t\t\t<i\n\t\t\t\tclass=\"js-icon js-flight-help beb-tooltip-opener\"\n\t\t\t\t@click=${() => setIsMobileStandardMembershipTooltipOpen(true)}\n\t\t\t>\n\t\t\t\t${standardMembershipContent}\n\t\t\t</i>\n\t\t</div>\n\t`;\n\n\tconst groupMembershipSection = html`\n\t\t<div class=\"beb-section beb-section-3\">\n\t\t\t<i class=\"beb-section-icon js-icon-be2 js-be2-money\"></i>\n\t\t\t${i18next.t(\"Membresía Grupal\")}\n\t\t\t<span>${i18next.t(\"Club de Descuentos\")}</span>\n\t\t\t<img class=\"beb-section-tick\" src=\"/images/banco-estado/bar-tick-color.png\" />\n\t\t\t<i\n\t\t\t\tclass=\"js-icon js-flight-help beb-tooltip-opener\"\n\t\t\t\t@click=${() => setIsMobileGroupMembershipTooltipOpen(true)}\n\t\t\t>\n\t\t\t\t${groupMembershipContent}\n\t\t\t</i>\n\t\t</div>\n\t`;\n\n\tconst seat40Section = html`\n\t\t<div class=\"beb-section beb-section-4\">\n\t\t\t<i class=\"beb-section-icon js-icon-be2 js-be2-seat\"></i>\n\t\t\t<div class=\"hidden-sm\">${i18next.t(\"Desde\")} <span>${i18next.t(\"40% descuento\")}</span></div>\n\t\t\t<div class=\"hidden-sm\"><span>${i18next.t(\"asientos\")}</span> ${i18next.t(\"Zona BancoEstado\")}</div>\n\t\t</div>\n\t`;\n\n\tconst freeSeatsSection = html`\n\t\t<div class=\"beb-section beb-section-4\">\n\t\t\t<i\n\t\t\t\tclass=\"beb-section-icon js-icon-be2 js-be2-star${props.freeSeats <= 4\n\t\t\t\t\t? `-${props.freeSeats}`\n\t\t\t\t\t: \"s-plus\"}\"\n\t\t\t></i>\n\t\t\t<div class=\"hidden-sm\">\n\t\t\t\t<span>${i18next.t(\"Tienes\")} ${props.freeSeats}</span>\n\t\t\t</div>\n\t\t\t<div class=\"hidden-sm\">\n\t\t\t\t${i18next.t(\"asiento{{plural}} gratis\", { plural: Number(props.freeSeats) > 1 ? \"s\" : \"\" })}\n\t\t\t</div>\n\t\t</div>\n\t`;\n\n\treturn props.bancoEstadoCategory === 5 || props.bancoEstadoCategory === 6\n\t\t? html`\n\t\t\t\t<div\n\t\t\t\t\tclass=\"be-bar ${props.bancoEstadoCategory === 6 ? \"bg-be-gray\" : \"bg-be-orange\"} ${props.isBarOpen\n\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t: \"closed\"}\"\n\t\t\t\t>\n\t\t\t\t\t<div class=\"be-bar-container\">\n\t\t\t\t\t\t<img src=\"/images/banco-estado/topbar-logo-2.svg\" />\n\t\t\t\t\t\t<div class=\"beb-section beb-section-1\">\n\t\t\t\t\t\t\t${i18next.t(\"Tus beneficios\")}\n\t\t\t\t\t\t\t<span>${i18next.t(\"Tarjeta\")}</span>\n\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\tsrc=\"/images/banco-estado/logo-smart-${props.bancoEstadoCategory === 6\n\t\t\t\t\t\t\t\t\t? \"plus-bg-gray\"\n\t\t\t\t\t\t\t\t\t: \"bg-orange\"}.png\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"beb-divider\"></div>\n\t\t\t\t\t\t${props.dcMembershipType === \"None\" ? noMembershipSection : \"\"}\n\t\t\t\t\t\t${props.dcMembershipType === \"Standard\" ? standardMembershipSection : \"\"}\n\t\t\t\t\t\t${props.dcMembershipType === \"Group\" ? groupMembershipSection : \"\"}\n\t\t\t\t\t\t<div class=\"beb-divider\"></div>\n\t\t\t\t\t\t${props.freeSeats === 0 || props.bancoEstadoCategory === 5 ? seat40Section : freeSeatsSection}\n\t\t\t\t\t\t<div class=\"beb-divider\"></div>\n\t\t\t\t\t\t<div class=\"beb-section beb-section-6\">\n\t\t\t\t\t\t\t<i class=\"beb-section-icon js-icon-be2 js-be2-priority\"></i>\n\t\t\t\t\t\t\t<div class=\"hidden-sm\">${i18next.t(\"Embarque\")}</div>\n\t\t\t\t\t\t\t<div class=\"hidden-sm\"><span>${i18next.t(\"Prioritario\")}</span></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"beb-divider\"></div>\n\t\t\t\t\t\t<div class=\"beb-section beb-section-5\">\n\t\t\t\t\t\t\t<i class=\"beb-section-icon js-icon-be2 js-be2-percent\"></i>\n\t\t\t\t\t\t\t<div class=\"hidden-sm\"><span>${i18next.t(\"6 o 12 cuotas\")}</span></div>\n\t\t\t\t\t\t\t<div class=\"hidden-sm\">${i18next.t(\"sin interés\")}</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"be-bar-mobile-tooltip ${isMobileNoMembershipTooltipOpen ? \"open\" : \"\"}\">\n\t\t\t\t\t<div class=\"dg-be-modal\"></div>\n\t\t\t\t\t${noMembershipContent}\n\t\t\t\t</div>\n\t\t\t\t<div class=\"be-bar-mobile-tooltip ${isMobileStandardMembershipTooltipOpen ? \"open\" : \"\"}\">\n\t\t\t\t\t<div class=\"dg-be-modal\"></div>\n\t\t\t\t\t${standardMembershipContent}\n\t\t\t\t</div>\n\t\t\t\t<div class=\"be-bar-mobile-tooltip ${isMobileGroupMembershipTooltipOpen ? \"open\" : \"\"}\">\n\t\t\t\t\t<div class=\"dg-be-modal\"></div>\n\t\t\t\t\t${groupMembershipContent}\n\t\t\t\t</div>\n\t\t  `\n\t\t: html``;\n};\n","// add a custom \"ref\" directive for use with lit-html\nimport { directive, AttributePart } from \"lit-html\";\n\nconst ref = directive((refInstance) => (part: any) => {\n\tif (!(part instanceof AttributePart)) {\n\t\tthrow new Error(\"ref directive can only be used as an attribute\");\n\t}\n\trefInstance.current = part.committer.element;\n});\n\nexport { ref };\n","import { TestIdDictionary } from \"Services/test-ids/TestIdDictionary\";\nimport { commonDebug } from \"../../bootstrap\";\nimport { html, useRef } from \"haunted\";\nimport i18next from \"i18next\";\nimport { useState, useEffect } from \"Shared/haunted/CustomHooks\";\nimport { HauntedFunc } from \"Shared/haunted/HooksHelpers\";\nimport { EMAIL_REGEX } from \"Services/constants\";\nimport CryptoJS from \"crypto-js\";\nimport { clearErrors, validate } from \"Services/form-validation\";\nimport { RetrieveBookingResponse } from \"Shared/models/RetrieveBookingResponse\";\nimport { ref } from \"Components/directives/ref\";\nimport { locale } from \"Services/Globals\";\nimport { PUB_SUBS } from \"Services/pub-sub-service/PubSub\";\nimport { unsafeHTML } from \"lit-html/directives/unsafe-html\";\nimport { sanitizeInputFieldValue } from \"Services/common\";\n\nexport const useShadowDOM = false;\nexport const name = \"ac-admin-modal\";\n\nconst loaderContainerClassName = \"dg-new-modal-loader\";\n\nexport const observedAttributes: (keyof Attributes)[] = [\"culture\"];\n\nexport interface Attributes {\n\tculture: string;\n}\n\nexport interface Props {\n\tculture: string;\n}\n\nexport type AdminModalType = \"none\" | \"admin\" | \"checkin\" | \"onlineChange\";\n\nconst captchaContainerClass = \"bb-captcha-container\";\n\nconst AesEncryptionKey = \"fxf9YIhJbd8u5jbrwt463ek4AH1mfpn5\";\nconst AesEncryptionIV = \"3!fjrHKJR37f3jYP\";\n\nexport const Component: HauntedFunc<Props> = (host) => {\n\tconst props: Props = {\n\t\tculture: host.culture,\n\t};\n\n\tconst form = useRef<HTMLFormElement>(undefined);\n\n\t// DEVNOTE We have to use these as captcha needs a callback, and so data stays current in that\n\tconst emailOrLastName = useRef<string>(undefined);\n\tconst pnr = useRef<string>(undefined);\n\n\tconst [showBookingError, setShowBookingError] = useState<boolean>(false);\n\tconst [showFareLockError, setShowFareLockError] = useState<boolean>(false);\n\tconst [showUnauthorizedError, setShowUnauthorizedError] = useState<boolean>(false);\n\tconst [showRecaptchaError, setShowRecaptchaError] = useState<boolean>(false);\n\tconst [showTooManyJourneysError, setShowTooManyJourneysError] = useState<boolean>(false);\n\tconst [showAmericanAirlinesError, setShowAmericanAirlinesError] = useState<boolean>(false);\n\tconst [captchaId, setCaptchaId] = useState<any>(undefined);\n\tconst [type, setType] = useState<AdminModalType>(\"none\");\n\n\tconst initCaptcha = () => {\n\t\tconst grecaptchaInterval = window.setInterval(() => {\n\t\t\tconst captchaContainer = document.body.querySelector(`.${captchaContainerClass} div`) as HTMLDivElement;\n\t\t\tif (captchaContainer && grecaptcha && grecaptcha.render) {\n\t\t\t\tsetCaptchaId(\n\t\t\t\t\tgrecaptcha.render(captchaContainer, {\n\t\t\t\t\t\tsitekey: window.JetSmart.Settings.GoogleReCaptchaSiteKey,\n\t\t\t\t\t\tsize: \"invisible\",\n\t\t\t\t\t\tcallback: () => onSubmit(),\n\t\t\t\t\t})\n\t\t\t\t);\n\n\t\t\t\twindow.clearInterval(grecaptchaInterval);\n\t\t\t\twindow.clearTimeout(grecaptchaTimeLimit);\n\t\t\t}\n\t\t}, 100);\n\n\t\tconst grecaptchaTimeLimit = window.setTimeout(() => {\n\t\t\twindow.clearInterval(grecaptchaInterval);\n\t\t\tsetShowRecaptchaError(true);\n\t\t}, 3000);\n\t};\n\n\tconst handleSubmit = (e: Event) => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\n\t\tsetShowBookingError(false);\n\t\tsetShowFareLockError(false);\n\t\tsetShowUnauthorizedError(false);\n\t\tsetShowTooManyJourneysError(false);\n\n\t\tif (validate(form.current)) {\n\t\t\tgrecaptcha.execute(captchaId);\n\t\t}\n\t};\n\n\tconst getPostBody = () => {\n\t\tconst elem = document.body.querySelector(\"[name=g-recaptcha-response]\") as HTMLTextAreaElement;\n\t\tconst grecaptchaResponse = elem.value;\n\n\t\tconst bookingData = new FormData();\n\n\t\tconst key = CryptoJS.enc.Utf8.parse(AesEncryptionKey);\n\t\tconst iv = CryptoJS.enc.Utf8.parse(AesEncryptionIV);\n\n\t\tconst aesPnr = CryptoJS.AES.encrypt(CryptoJS.enc.Utf8.parse(pnr.current), key, {\n\t\t\tkeySize: 128 / 8,\n\t\t\tiv,\n\t\t\tmode: CryptoJS.mode.CBC,\n\t\t\tpadding: CryptoJS.pad.Pkcs7,\n\t\t});\n\n\t\tbookingData.append(\"booking\", btoa(aesPnr.toString()));\n\n\t\tconst aesIdentifier = CryptoJS.AES.encrypt(CryptoJS.enc.Utf8.parse(emailOrLastName.current), key, {\n\t\t\tkeySize: 128 / 8,\n\t\t\tiv,\n\t\t\tmode: CryptoJS.mode.CBC,\n\t\t\tpadding: CryptoJS.pad.Pkcs7,\n\t\t});\n\n\t\tbookingData.append(\n\t\t\tEMAIL_REGEX.test(emailOrLastName.current) ? \"email\" : \"lastName\",\n\t\t\tbtoa(aesIdentifier.toString())\n\t\t);\n\n\t\tbookingData.append(\"culture\", props.culture);\n\t\tbookingData.append(\"gRecaptchaResponse\", grecaptchaResponse);\n\n\t\treturn bookingData;\n\t};\n\n\tconst onSubmit = async () => {\n\t\tconst loader = window.newRtLoader(`.${loaderContainerClassName}`);\n\t\tloader.startLoader();\n\n\t\tconst baseUrl = window.JetSmart.Settings.BookingUrl + \"/api/Booking/RetrieveBookingFromCorp\";\n\t\tconst fetchOptions: RequestInit = {\n\t\t\tmethod: \"POST\",\n\t\t\tcredentials: \"omit\",\n\t\t\tmode: \"cors\",\n\t\t\tbody: getPostBody(),\n\t\t};\n\n\t\tconst fetchParameters = {\n\t\t\toptions: fetchOptions,\n\t\t\turl: baseUrl,\n\t\t};\n\n\t\ttry {\n\t\t\tconst response = await fetch(fetchParameters.url, fetchParameters.options);\n\n\t\t\tif (response.ok) {\n\t\t\t\tawait handleServerResponse(response, loader);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tcommonDebug.error(e);\n\t\t\tloader.stopLoader();\n\t\t}\n\t};\n\n\tconst handleServerResponse = async (\n\t\tresponse: Response,\n\t\tloader: { startLoader: () => void; stopLoader: () => void; destroy: () => void }\n\t) => {\n\t\tconst result = await response.text();\n\t\tconst parsedResult = JSON.parse(atob(result)) as RetrieveBookingResponse;\n\n\t\tswitch (parsedResult.code) {\n\t\t\tcase 0: // All is good\n\t\t\t\tconst queryCulture = `culture=${props.culture}`;\n\t\t\t\tconst queryPnr = `rl=${pnr.current}`;\n\t\t\t\tconst queryUser = EMAIL_REGEX.test(emailOrLastName.current)\n\t\t\t\t\t? `em=${emailOrLastName.current}`\n\t\t\t\t\t: `ln=${emailOrLastName.current}`;\n\t\t\t\tconst queryString = `?${queryPnr}&${queryUser}&${queryCulture}`;\n\t\t\t\tlocation.href = `${window.JetSmart.Settings.BookingUrl}/Booking/Retrieve${queryString}`;\n\t\t\t\tbreak;\n\t\t\tcase 2: // Farelock expired\n\t\t\t\tsetShowFareLockError(true);\n\n\t\t\t\tloader.stopLoader();\n\t\t\t\tgrecaptcha.reset(captchaId);\n\t\t\t\tbreak;\n\t\t\tcase 3: // CUG hold expired\n\t\t\t\tsetShowFareLockError(true);\n\n\t\t\t\tloader.stopLoader();\n\t\t\t\tgrecaptcha.reset(captchaId);\n\t\t\t\tbreak;\n\t\t\tcase 4: // CUG3 opened by non CUG3\n\t\t\t\t// const [language, country] = props.culture.toLowerCase().split(\"-\");\n\t\t\t\t// window.location.href = `/${country}/${language}/ResultMessage?${CUG3_REDIRECT_URL_PARTIAL}`;\n\t\t\t\tbreak;\n\t\t\tcase 5: // Someone else's CUG booking\n\t\t\t\tsetShowUnauthorizedError(true);\n\n\t\t\t\tloader.stopLoader();\n\t\t\t\tgrecaptcha.reset(captchaId);\n\t\t\t\tbreak;\n\t\t\tcase 6: // More than 2 journeys\n\t\t\t\tsetShowTooManyJourneysError(true);\n\n\t\t\t\tloader.stopLoader();\n\t\t\t\tgrecaptcha.reset(captchaId);\n\t\t\t\tbreak;\n\t\t\tcase 7: // American Airlines booking\n\t\t\t\tsetShowAmericanAirlinesError(true);\n\n\t\t\t\tloader.stopLoader();\n\t\t\t\tgrecaptcha.reset(captchaId);\n\t\t\t\tbreak;\n\t\t\tcase 8: // Redemption booking with no journey\n\t\t\t\tsetShowFareLockError(true);\n\n\t\t\t\tloader.stopLoader();\n\t\t\t\tgrecaptcha.reset(captchaId);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// Generic Error\n\t\t\t\tsetShowBookingError(true);\n\n\t\t\t\tloader.stopLoader();\n\t\t\t\tgrecaptcha.reset(captchaId);\n\t\t\t\tbreak;\n\t\t}\n\t};\n\n\tconst handleIsOnlineChangeClick = () => {\n\t\tsetType(\"onlineChange\");\n\t};\n\n\tconst handlePnrInput = (e: KeyboardEvent) => {\n\t\tconst target = e.target as HTMLInputElement;\n\t\tconst value = target.value;\n\t\tconst sanitizedValue = value\n\t\t\t.split(\"\")\n\t\t\t.filter((char) => /[a-zA-Z0-9]/.test(char))\n\t\t\t.join(\"\")\n\t\t\t.substring(0, 6)\n\t\t\t.toUpperCase();\n\t\tpnr.current = sanitizedValue;\n\t\ttarget.value = sanitizedValue;\n\t};\n\n\tconst handleInput = (e: KeyboardEvent) => {\n\t\temailOrLastName.current = sanitizeInputFieldValue(e, \"accepted-text-chars-with-at\");\n\t};\n\n\tuseEffect(() => {\n\t\tif (type !== \"none\" && captchaId === undefined) {\n\t\t\tinitCaptcha();\n\t\t}\n\n\t\tif (type === \"none\") {\n\t\t\tsetCaptchaId(undefined);\n\t\t}\n\n\t\tsetShowBookingError(false);\n\t\tsetShowFareLockError(false);\n\t\tsetShowUnauthorizedError(false);\n\t\tsetShowTooManyJourneysError(false);\n\t\tpnr.current = \"\";\n\t\temailOrLastName.current = \"\";\n\t\tclearErrors(form.current);\n\t}, [type]);\n\n\tuseEffect(() => {\n\t\tconst sub = PUB_SUBS.AdminModalOpened.subscribe((e) => setType(e.modalType));\n\t\treturn () => sub.unsubscribe();\n\t}, []);\n\n\tconst recaptchaErrorTemplate = () =>\n\t\tshowRecaptchaError\n\t\t\t? html`<div class=\"row\">\n\t\t\t\t\t<div class=\"col-xs-1\">\n\t\t\t\t\t\t<div class=\"captcha-load-error\">${i18next.t(\"CaptchaLoadError\")}</div>\n\t\t\t\t\t</div>\n\t\t\t  </div>`\n\t\t\t: \"\";\n\n\tconst bookingErrorTemplate = () =>\n\t\tshowBookingError\n\t\t\t? html`<div class=\"row\">\n\t\t\t\t\t<div class=\"col-xs-1\">\n\t\t\t\t\t\t<div class=\"dg-booking-error\">${i18next.t(\"BookingExistenceError\")}</div>\n\t\t\t\t\t</div>\n\t\t\t  </div>`\n\t\t\t: \"\";\n\n\tconst farelockErrorTemplate = () =>\n\t\tshowFareLockError\n\t\t\t? html` <div class=\"row\">\n\t\t\t\t\t<div class=\"col-xs-1\">\n\t\t\t\t\t\t<div class=\"dg-booking-error\">${i18next.t(\"FareLockError\")}</div>\n\t\t\t\t\t</div>\n\t\t\t  </div>`\n\t\t\t: \"\";\n\n\tconst unauthorizedErrorTemplate = () =>\n\t\tshowUnauthorizedError\n\t\t\t? html`<div class=\"row\">\n\t\t\t\t\t<div class=\"col-xs-1\">\n\t\t\t\t\t\t<div class=\"dg-booking-error\">${i18next.t(\"UnauthorizedError\")}</div>\n\t\t\t\t\t</div>\n\t\t\t  </div>`\n\t\t\t: \"\";\n\n\tconst showTooManyJourneysErrorTemplate = () =>\n\t\tshowTooManyJourneysError\n\t\t\t? html`<div class=\"row\">\n\t\t\t\t\t<div class=\"col-xs-1\">\n\t\t\t\t\t\t<div class=\"dg-booking-error\">${i18next.t(\"TooManyJourneysError\")}</div>\n\t\t\t\t\t</div>\n\t\t\t  </div>`\n\t\t\t: \"\";\n\n\tconst showAmericanAirlinesErrorTemplate = () =>\n\t\tshowAmericanAirlinesError\n\t\t\t? html`<div class=\"row\">\n\t\t\t\t\t<div class=\"col-xs-1\">\n\t\t\t\t\t\t<div class=\"dg-booking-error\">\n\t\t\t\t\t\t\t${unsafeHTML(\n\t\t\t\t\t\t\t\ti18next.t(\n\t\t\t\t\t\t\t\t\t\"Tu reserva fue comprada en American Airlines, por favor visita {{-linkStart}}www.aa.com{{-linkEnd}}.\",\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlinkStart: \"<a href='http://www.aa.com'>\",\n\t\t\t\t\t\t\t\t\t\tlinkEnd: \"</a>\",\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t  </div>`\n\t\t\t: \"\";\n\n\tconst errorsContainerTemplate = () => html`${recaptchaErrorTemplate()} ${bookingErrorTemplate()}\n\t${farelockErrorTemplate()} ${unauthorizedErrorTemplate()} ${showTooManyJourneysErrorTemplate()}\n\t${showAmericanAirlinesErrorTemplate()}`;\n\n\tconst nameOrEmailTemplate = () => {\n\t\tconst id = \"email-or-name-input\";\n\n\t\treturn html`<div class=\"form-group dg-enhanced-input\">\n\t\t\t<label for=${id}>${i18next.t(\"administer-modal-right-tooltip-email-or-name\")}</label>\n\t\t\t<input\n\t\t\t\tid=${id}\n\t\t\t\tplaceholder=\"${i18next.t(\"Ejemplo\")}: Perez\"\n\t\t\t\tdata-test-id=${TestIdDictionary.AdminModal.UserName}\n\t\t\t\trequired\n\t\t\t\t.value=${emailOrLastName.current}\n\t\t\t\t@input=${handleInput}\n\t\t\t/>\n\t\t\t<div class=\"checkin-tooltip\">\n\t\t\t\t<div class=\"arrow-box\">${i18next.t(\"administer-modal-right-info-01\")}</div>\n\t\t\t</div>\n\t\t</div>`;\n\t};\n\n\tconst pnrInputTemplate = () => {\n\t\tconst id = \"pnr-input\";\n\n\t\treturn html`<div class=\"form-group dg-enhanced-input\">\n\t\t\t<label for=${id}>${i18next.t(\"administer-modal-right-tooltip-reservation-code\")}</label>\n\t\t\t<input\n\t\t\t\tid=${id}\n\t\t\t\tdata-test-id=${TestIdDictionary.AdminModal.Pnr}\n\t\t\t\tplaceholder=\"${i18next.t(\"Ejemplo\")}: SAB3HS\"\n\t\t\t\trequired\n\t\t\t\t.value=${pnr.current}\n\t\t\t\t@input=${handlePnrInput}\n\t\t\t/>\n\t\t\t<div class=\"checkin-tooltip\">\n\t\t\t\t<div class=\"arrow-box\">${i18next.t(\"administer-modal-right-info-02\")}</div>\n\t\t\t</div>\n\t\t</div>`;\n\t};\n\n\tconst submitButtonTemplate = () => html`<div class=\"row\">\n\t\t<div class=\"col-xs-1 col-sm-1-2\">\n\t\t\t<button\n\t\t\t\ttype=\"submit\"\n\t\t\t\tclass=\"dg-rounded-primary-btn\"\n\t\t\t\tdata-test-id=${TestIdDictionary.AdminModal.SubmitButton}\n\t\t\t>\n\t\t\t\t${i18next.t(\"administer-modal-right-continue\")}\n\t\t\t</button>\n\t\t</div>\n\t</div>`;\n\n\tconst captchaTemplate = () =>\n\t\thtml`\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-xs-1\">\n\t\t\t\t\t<div class=${captchaContainerClass}>\n\t\t\t\t\t\t<div></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`;\n\n\tconst formTemplate = () =>\n\t\thtml` <form ref=${ref(form)} class=\"dg-modal-form\" data-test-id=\"modal-form\" novalidate @submit=${handleSubmit}>\n\t\t\t${nameOrEmailTemplate()} ${pnrInputTemplate()} ${errorsContainerTemplate()} ${submitButtonTemplate()}\n\t\t</form>`;\n\n\tconst bannerTemplate = () =>\n\t\ttype === \"checkin\"\n\t\t\t? html`\n\t\t\t\t\t<div class=\"dg-new-modal-banner checkin\"></div>\n\t\t\t\t\t<div class=\"dg-new-modal-info-bar\">${i18next.t(\"check-in-modal-info-bar\")}</div>\n\t\t\t  `\n\t\t\t: type === \"admin\" || type === \"onlineChange\"\n\t\t\t? html`\n\t\t\t\t\t<div class=\"dg-new-modal-banner admin\"></div>\n\t\t\t\t\t<div class=\"dg-new-modal-info-bar\">\n\t\t\t\t\t\t${type === \"onlineChange\"\n\t\t\t\t\t\t\t? html`<div>${i18next.t(\"administer-modal-info-bar-itinerary\")}</div>`\n\t\t\t\t\t\t\t: html`<div>\n\t\t\t\t\t\t\t\t\t${i18next.t(\"administer-modal-info-bar-flight-change\")}\n\t\t\t\t\t\t\t\t\t<a class=\"cursor-pointer\" @click=${handleIsOnlineChangeClick}>\n\t\t\t\t\t\t\t\t\t\t${i18next.t(\"administer-modal-info-bar-link\")}</a\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t  </div>`}\n\t\t\t\t\t</div>\n\t\t\t  `\n\t\t\t: \"\";\n\n\tconst titleTemplate = () => {\n\t\treturn type === \"checkin\"\n\t\t\t? html`\n\t\t\t\t\t<div class=\"dg-caption\">\n\t\t\t\t\t\t<span>${i18next.t(\"check-in-modal-title-1\")}<br />${i18next.t(\"check-in-modal-title-2\")}</span>\n\t\t\t\t\t\t<span>${i18next.t(\"check-in-modal-title-3\")}</span>\n\t\t\t\t\t</div>\n\t\t\t  `\n\t\t\t: type === \"admin\" || type === \"onlineChange\"\n\t\t\t? html`\n\t\t\t\t\t${type === \"onlineChange\"\n\t\t\t\t\t\t? html`<span class=\"dg-new-large-modal-title ${locale.toLowerCase() === \"en-us\" ? \"wider\" : \"\"}\"\n\t\t\t\t\t\t\t\t>${i18next.t(\"administer-modal-onchange-title\")}</span\n\t\t\t\t\t\t  >`\n\t\t\t\t\t\t: html`<span class=\"dg-new-large-modal-title ${locale.toLowerCase() === \"en-us\" ? \"wider\" : \"\"}\"\n\t\t\t\t\t\t\t\t>${i18next.t(\"administer-modal-title\")}</span\n\t\t\t\t\t\t  >`}\n\t\t\t  `\n\t\t\t: \"\";\n\t};\n\n\treturn type !== \"none\"\n\t\t? html` <div class=\"dg-new-modal\">\n\t\t\t\t<div class=\"dg-new-modal-content ${loaderContainerClassName}\" data-test-id=\"modal-content\">\n\t\t\t\t\t<div class=\"dg-new-modal-close\" data-test-id=\"modal-close-button\" @click=${() => setType(\"none\")}>\n\t\t\t\t\t\t&times;\n\t\t\t\t\t</div>\n\t\t\t\t\t${bannerTemplate()}\n\t\t\t\t\t<div class=\"grid h-1/2 sm:grid-cols-12\">\n\t\t\t\t\t\t<div class=\"m-auto sm:col-span-4\">${titleTemplate()}</div>\n\t\t\t\t\t\t<div class=\"sm:col-span-8\">${formTemplate()}</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t${captchaTemplate()}\n\t\t\t\t</div>\n\t\t  </div>`\n\t\t: html``;\n};\n","import { html, useState } from \"haunted\";\nimport { HauntedFunc } from \"Shared/haunted/HooksHelpers\";\nimport { getParsedProperty } from \"Services/common\";\nimport { COUNTRY_MAP } from \"Services/constants\";\n\nexport const useShadowDOM = false;\nexport const name = \"ac-culture-name-settings\";\n\nexport const observedAttributes: (keyof Attributes)[] = [\"model\"];\n\nexport interface Attributes {\n\tmodel: string;\n}\n\ninterface CultureNameSetting {\n\tindex: number;\n\tculture: string;\n\tes: string;\n\ten: string;\n\tpt: string;\n}\n\nexport interface Props {\n\tmodel: CultureNameSetting[];\n}\n\nexport const Component: HauntedFunc<Props> = (host) => {\n\tconst parseModel = () => {\n\t\tconst hostModel =\n\t\t\ttypeof host.model === \"string\" ? getParsedProperty<DynamicCultureNameSetting[]>(host.model) : [];\n\n\t\treturn Array.from(COUNTRY_MAP.keys()).map((culture, index): CultureNameSetting => {\n\t\t\tconst setting = hostModel?.find((s) => s.Culture.toLowerCase() === culture.toLowerCase());\n\n\t\t\treturn {\n\t\t\t\tindex,\n\t\t\t\tculture,\n\t\t\t\tes: setting?.Es ?? COUNTRY_MAP.get(culture),\n\t\t\t\ten: setting?.En ?? COUNTRY_MAP.get(culture),\n\t\t\t\tpt: setting?.Pt ?? COUNTRY_MAP.get(culture),\n\t\t\t};\n\t\t});\n\t};\n\n\t// HELPER FUNCTIONS\n\n\t// EVENT HANDLERS\n\n\tconst handleInputChange = (e: KeyboardEvent, index: number, key: keyof CultureNameSetting) => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\n\t\tconst value = (e.target as HTMLInputElement).value;\n\n\t\tsetCultureNameSettings((prevSettings) =>\n\t\t\tprevSettings.map(\n\t\t\t\t(setting): CultureNameSetting => (setting.index === index ? { ...setting, [key]: value } : setting)\n\t\t\t)\n\t\t);\n\t};\n\n\tconst handleSave = (e: MouseEvent) => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\n\t\t(document.getElementById(\"actionType\") as HTMLInputElement).value = \"save_dynamic_settings\";\n\t\t(document.getElementById(\"admin_form\") as HTMLFormElement).submit();\n\t};\n\n\t// COMPONENT\n\n\tconst [cultureNameSettings, setCultureNameSettings] = useState<CultureNameSetting[]>(parseModel());\n\n\t// TEMPLATES\n\n\tconst rowTemplate = (setting: CultureNameSetting) => {\n\t\tconst getInputId = (key: keyof CultureNameSetting) =>\n\t\t\t`culture-name-settings-${setting.culture}-culture-input-${key}`;\n\n\t\treturn html`\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-xs-1 col-sm-1-4\">\n\t\t\t\t\t<label for=${getInputId(\"culture\")}><br />Culture</label>\n\t\t\t\t\t<input\n\t\t\t\t\t\tname=${`DynamicCultureNameSettings[${setting.index}].Culture`}\n\t\t\t\t\t\tid=${getInputId(\"culture\")}\n\t\t\t\t\t\tvalue=${setting.culture}\n\t\t\t\t\t\tdisable\n\t\t\t\t\t\treadonly\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"col-xs-1 col-md-1-4\">\n\t\t\t\t\t<label for=${getInputId(\"es\")}><br />ES</label>\n\t\t\t\t\t<input\n\t\t\t\t\t\tname=${`DynamicCultureNameSettings[${setting.index}].Es`}\n\t\t\t\t\t\tid=${getInputId(\"es\")}\n\t\t\t\t\t\tvalue=${setting.es}\n\t\t\t\t\t\t@input=${(e: KeyboardEvent) => handleInputChange(e, setting.index, \"es\")}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"col-xs-1 col-md-1-4\">\n\t\t\t\t\t<label for=${getInputId(\"en\")}><br />EN</label>\n\t\t\t\t\t<input\n\t\t\t\t\t\tname=${`DynamicCultureNameSettings[${setting.index}].En`}\n\t\t\t\t\t\tid=${getInputId(\"en\")}\n\t\t\t\t\t\tvalue=${setting.en}\n\t\t\t\t\t\t@input=${(e: KeyboardEvent) => handleInputChange(e, setting.index, \"en\")}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"col-xs-1 col-md-1-4\">\n\t\t\t\t\t<label for=${getInputId(\"pt\")}><br />PT</label>\n\t\t\t\t\t<input\n\t\t\t\t\t\tname=${`DynamicCultureNameSettings[${setting.index}].Pt`}\n\t\t\t\t\t\tid=${getInputId(\"pt\")}\n\t\t\t\t\t\tvalue=${setting.pt}\n\t\t\t\t\t\t@input=${(e: KeyboardEvent) => handleInputChange(e, setting.index, \"pt\")}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`;\n\t};\n\n\tconst submitButtonTemplate = () => html`\n\t\t<div class=\"row\">\n\t\t\t<div class=\"col-xs-1 col-md-4-5\">\n\t\t\t\t<div class=\"sj-save-warning\">\n\t\t\t\t\t* After saving, a page refresh (F5) may be necessary to properly reflect the saved state.\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=\"col-xs-1 col-sm-1-5 main-buttons\">\n\t\t\t\t<button type=\"submit\" value=\"Save\" class=\"btn-primary push-down\" @click=${handleSave}>Save</button>\n\t\t\t</div>\n\t\t</div>\n\t`;\n\n\treturn html`${cultureNameSettings.map(rowTemplate)}${submitButtonTemplate()}`;\n};\n","import { html } from \"haunted\";\nimport { useState, useEffect } from \"Shared/haunted/CustomHooks\";\nimport { HauntedFunc } from \"Shared/haunted/HooksHelpers\";\n\nimport { clone, getParsedProperty } from \"Services/common\";\n\nexport const useShadowDOM = false;\nexport const name = \"ac-dynamic-promo-codes\";\n\ninterface DynamicPromoCode {\n\tindex: number;\n\tprogramLevel: string;\n\tcode: string;\n\tculture: string;\n\troleCode: string;\n}\n\nconst invalidClassName = \"invalid\";\nconst cultureElemPrefix = \"dynamic-promo-code-culture-\";\nconst roleElemPrefix = \"dynamic-promo-code-role-\";\nconst levelElemPrefix = \"dynamic-promo-code-level-\";\nconst codeElemPrefix = \"dynamic-promo-code-code-\";\n\nexport const observedAttributes: (keyof Attributes)[] = [\"promo-codes\"];\n\nexport interface Attributes {\n\t\"promo-codes\": string;\n}\n\nexport interface Props {\n\tpromoCodes: DynamicPromoCode[];\n}\n\nexport const Component: HauntedFunc<Props> = (host) => {\n\tconst props: Props = {\n\t\tpromoCodes:\n\t\t\t(typeof host.promoCodes === \"string\" ? getParsedProperty<DynamicPromoCodeSetting[]>(host.promoCodes) : [])\n\t\t\t\t?.filter((setting) => setting)\n\t\t\t\t.map((setting, i) => ({\n\t\t\t\t\tindex: i,\n\t\t\t\t\tprogramLevel: setting.ProgramCodeAndLevel || \"\",\n\t\t\t\t\tcode: setting.Code || \"\",\n\t\t\t\t\tculture: setting.Culture || \"\",\n\t\t\t\t\troleCode: setting.RoleCode || \"\",\n\t\t\t\t})) || [],\n\t};\n\n\t// HELPERS\n\n\tconst addEmpty = () => {\n\t\tsetPromoCodes([\n\t\t\t...promoCodes,\n\t\t\t{\n\t\t\t\tindex: promoCodes.length,\n\t\t\t\tprogramLevel: \"\",\n\t\t\t\tcode: \"\",\n\t\t\t\tculture: \"\",\n\t\t\t\troleCode: \"\",\n\t\t\t},\n\t\t]);\n\t};\n\n\tconst validate = () => {\n\t\tlet isValid = true;\n\n\t\tfor (let i = 0; i < promoCodes.length; i++) {\n\t\t\tconst cultureElem = document.getElementById(`${cultureElemPrefix}${i}`) as HTMLInputElement;\n\t\t\tconst roleElem = document.getElementById(`${roleElemPrefix}${i}`) as HTMLInputElement;\n\t\t\tconst levelElem = document.getElementById(`${levelElemPrefix}${i}`) as HTMLInputElement;\n\t\t\tconst codeElem = document.getElementById(`${codeElemPrefix}${i}`) as HTMLInputElement;\n\n\t\t\tcodeElem.classList.remove(invalidClassName);\n\t\t\tcultureElem.classList.remove(invalidClassName);\n\t\t\troleElem.classList.remove(invalidClassName);\n\t\t\tlevelElem.classList.remove(invalidClassName);\n\n\t\t\tif ((cultureElem.value || roleElem.value || levelElem.value) && !codeElem.value) {\n\t\t\t\tcodeElem.classList.add(invalidClassName);\n\t\t\t\tisValid = false;\n\t\t\t}\n\n\t\t\tif (!cultureElem.value && !roleElem.value && !levelElem.value && codeElem.value) {\n\t\t\t\tcultureElem.classList.add(invalidClassName);\n\t\t\t\troleElem.classList.add(invalidClassName);\n\t\t\t\tlevelElem.classList.add(invalidClassName);\n\t\t\t\tisValid = false;\n\t\t\t}\n\t\t}\n\n\t\treturn isValid;\n\t};\n\n\t// EVENT HANDLERS\n\n\tconst handleSave = (e: MouseEvent) => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\n\t\tif (validate()) {\n\t\t\t(document.getElementById(\"actionType\") as HTMLInputElement).value = \"save_dynamic_settings\";\n\t\t\t(document.getElementById(\"admin_form\") as HTMLFormElement).submit();\n\t\t}\n\t};\n\n\tconst deleteRow = (index: number) => {\n\t\tconst newPromoCodes = clone(promoCodes).filter((pc) => pc.index !== index);\n\t\tnewPromoCodes.forEach((pc, i) => (pc.index = i));\n\t\tsetPromoCodes(newPromoCodes);\n\t};\n\n\tconst handleInput = (e: KeyboardEvent) => {\n\t\tconst grandParentElement = (e.target as HTMLInputElement).parentElement.parentElement;\n\t\tconst inputs = Array.from(grandParentElement.querySelectorAll(\"input\"));\n\t\tinputs.forEach((input) => input.classList.remove(invalidClassName));\n\t};\n\n\t// COMPONENT\n\n\tconst [promoCodes, setPromoCodes] = useState<DynamicPromoCode[]>(props.promoCodes);\n\n\tuseEffect(addEmpty, []);\n\n\t// TEMPLATES\n\n\tconst cultureTemplate = (promoCode: DynamicPromoCode) => {\n\t\tconst id = `${cultureElemPrefix}${promoCode.index}`;\n\t\treturn html`<div class=\"col-xs-1 col-sm-2-9\">\n\t\t\t<label for=${id}><br />Culture</label>\n\t\t\t<input\n\t\t\t\tname=${`DynamicPromoCodes[${promoCode.index}].Culture`}\n\t\t\t\tid=${id}\n\t\t\t\tvalue=${promoCode.culture || \"\"}\n\t\t\t\t@input=${handleInput}\n\t\t\t/>\n\t\t</div>`;\n\t};\n\n\tconst roleCodeTemplate = (promoCode: DynamicPromoCode) => {\n\t\tconst id = `${roleElemPrefix}${promoCode.index}`;\n\t\treturn html`<div class=\"col-xs-1 col-sm-2-9\">\n\t\t\t<label for=${id}><br />Role Code</label>\n\t\t\t<input\n\t\t\t\tname=${`DynamicPromoCodes[${promoCode.index}].RoleCode`}\n\t\t\t\tid=${id}\n\t\t\t\tvalue=${promoCode.roleCode || \"\"}\n\t\t\t\t@input=${handleInput}\n\t\t\t/>\n\t\t</div>`;\n\t};\n\n\tconst programLevelTemplate = (promoCode: DynamicPromoCode) => {\n\t\tconst id = `${levelElemPrefix}${promoCode.index}`;\n\t\treturn html`<div class=\"col-xs-1 col-sm-2-9\">\n\t\t\t<label for=${id}>Prg Code-Level (BEC-SMT)</label>\n\t\t\t<input\n\t\t\t\tname=${`DynamicPromoCodes[${promoCode.index}].ProgramCodeAndLevel`}\n\t\t\t\tid=${id}\n\t\t\t\tvalue=${promoCode.programLevel || \"\"}\n\t\t\t\t@input=${handleInput}\n\t\t\t/>\n\t\t</div>`;\n\t};\n\n\tconst codeTemplate = (promoCode: DynamicPromoCode) => {\n\t\tconst id = `${codeElemPrefix}${promoCode.index}`;\n\t\treturn html`<div class=\"col-xs-1 col-sm-2-9\">\n\t\t\t<label for=${id}><br />Promo Code</label>\n\t\t\t<input\n\t\t\t\tname=${`DynamicPromoCodes[${promoCode.index}].Code`}\n\t\t\t\tid=${id}\n\t\t\t\tvalue=${promoCode.code || \"\"}\n\t\t\t\t@input=${handleInput}\n\t\t\t/>\n\t\t</div>`;\n\t};\n\n\tconst rowTemplate = (promoCode: DynamicPromoCode) => html`<div class=\"row\">\n\t\t${cultureTemplate(promoCode)} ${roleCodeTemplate(promoCode)} ${programLevelTemplate(promoCode)}\n\t\t${codeTemplate(promoCode)} ${buttonsTemplate(promoCode)}\n\t</div>`;\n\n\tconst buttonsTemplate = (promoCode: DynamicPromoCode) => html`<div class=\"col-xs-1 col-sm-1-9\">\n\t\t<div class=\"dpc-buttons\">${deleteButtonTemplate(promoCode)} ${addButtonTemplate(promoCode)}</div>\n\t</div>`;\n\n\tconst deleteButtonTemplate = (promoCode: DynamicPromoCode) =>\n\t\tpromoCode.index < promoCodes.length - 1\n\t\t\t? html`<div @click=${() => deleteRow(promoCode.index)}>Delete</div>`\n\t\t\t: \"\";\n\n\tconst addButtonTemplate = (promoCode: DynamicPromoCode) =>\n\t\tpromoCode.index === promoCodes.length - 1 ? html`<div @click=${addEmpty}>Add</div>` : \"\";\n\n\tconst submitButtonTemplate = () => html`<div class=\"row\">\n\t\t<div class=\"col-xs-1 col-md-4-5\">\n\t\t\t<div class=\"sj-save-warning\">\n\t\t\t\t* After saving, a page refresh (F5) may be necessary to properly reflect the saved state.\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-xs-1 col-sm-1-5 main-buttons\">\n\t\t\t<button type=\"submit\" value=\"Save\" class=\"btn-primary push-down\" @click=${handleSave}>Save</button>\n\t\t</div>\n\t</div>`;\n\n\treturn html` ${promoCodes.map(rowTemplate)} ${submitButtonTemplate()} `;\n};\n","import { html } from \"haunted\";\nimport { HauntedFunc } from \"Shared/haunted/HooksHelpers\";\n\nimport { getParsedProperty } from \"Services/common\";\nimport { SPAIN_CULTURE_CODE, USA_CULTURE_CODE, BRITISH_CULTURE_CODE } from \"Services/constants\";\n\nexport const useShadowDOM = false;\nexport const name = \"ac-route-settings\";\n\ninterface CountrySetting {\n\tindex: number;\n\tculture: string;\n\tdefaultOriginCode: string;\n\tdefaultDestinationCode: string;\n}\n\nexport const observedAttributes: (keyof Attributes)[] = [\"model\"];\n\nexport interface Attributes {\n\tmodel: string;\n}\n\nexport interface Props {\n\tmodel: CountrySetting[];\n}\n\nconst countryMap = new Map<string, string>([\n\t[\"es-cl\", \"Chile\"],\n\t[\"es-ar\", \"Argentina\"],\n\t[\"pt-br\", \"Brazil\"],\n\t[\"es-co\", \"Colombia\"],\n\t[\"es-ec\", \"Ecuador\"],\n\t[\"en-us\", \"English\"],\n\t[\"es-es\", \"Otro (ES)\"],\n\t[\"en-GB\", \"Others (EN)\"],\n\t[\"es-pe\", \"Peru\"],\n\t[\"es-py\", \"Paraguay\"],\n\t[\"es-uy\", \"Uruguay\"],\n]);\n\nconst culturesWithoutPossibleCountries = [USA_CULTURE_CODE, SPAIN_CULTURE_CODE, BRITISH_CULTURE_CODE];\n\nexport const Component: HauntedFunc<Props> = (host) => {\n\tconst parseModel = () => {\n\t\tconst hostModel =\n\t\t\ttypeof host.model === \"string\" ? getParsedProperty<DefaultRouteCountrySetting[]>(host.model) : undefined;\n\n\t\treturn Array.from(countryMap.keys()).map((culture, i): CountrySetting => {\n\t\t\tconst setting = hostModel?.find((s) => s.Culture.toLowerCase() === culture.toLowerCase());\n\n\t\t\treturn {\n\t\t\t\tindex: i,\n\t\t\t\tculture,\n\t\t\t\tdefaultOriginCode: setting?.DefaultOriginCountryCode || \"\",\n\t\t\t\tdefaultDestinationCode: setting?.DefaultDestinationCountryCode || \"\",\n\t\t\t};\n\t\t});\n\t};\n\n\tconst props: Props = {\n\t\tmodel: parseModel(),\n\t};\n\n\t// HELPERS\n\n\t// EVENT HANDLERS\n\n\tconst handleSave = (e: MouseEvent) => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\n\t\t(document.getElementById(\"actionType\") as HTMLInputElement).value = \"save_dynamic_settings\";\n\t\t(document.getElementById(\"admin_form\") as HTMLFormElement).submit();\n\t};\n\n\t// COMPONENT\n\n\t// TEMPLATES\n\n\tconst optionTemplate = (cultureCode: string, countryName: string, selectedValue: string) =>\n\t\thtml`<option\n\t\t\tvalue=${cultureCode.substring(3)}\n\t\t\t?selected=${selectedValue && cultureCode.includes(selectedValue)}\n\t\t>\n\t\t\t${countryName}\n\t\t</option>`;\n\n\tconst optionsTemplate = (selectedValue: string) =>\n\t\thtml`<option value=\"\"></option>\n\t\t\t${Array.from(countryMap.entries()).map(([cultureCode, countryName]) =>\n\t\t\t\t!culturesWithoutPossibleCountries.includes(cultureCode.toLowerCase())\n\t\t\t\t\t? optionTemplate(cultureCode, countryName, selectedValue)\n\t\t\t\t\t: \"\"\n\t\t\t)}`;\n\n\tconst rowTemplate = ([cultureCode, countryName]: [string, string]) => {\n\t\tconst setting = props.model.find((s) => s.culture.toLowerCase() === cultureCode.toLowerCase());\n\n\t\treturn html`\n\t\t\t<div class=\"row mb-4\">\n\t\t\t\t<div class=\"col-xs-1 col-sm-1-3\">\n\t\t\t\t\t<div class=\"dg-admin-select text-right\">${countryName}</div>\n\t\t\t\t\t<input\n\t\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t\t\tname=${`DefaultRouteCountrySettings[${setting.index}].Culture`}\n\t\t\t\t\t\tvalue=${cultureCode}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"col-xs-1 col-sm-1-3\">\n\t\t\t\t\t<select\n\t\t\t\t\t\tclass=\"dg-admin-select\"\n\t\t\t\t\t\tname=${`DefaultRouteCountrySettings[${setting.index}].DefaultOriginCountryCode`}\n\t\t\t\t\t>\n\t\t\t\t\t\t${optionsTemplate(setting.defaultOriginCode)}\n\t\t\t\t\t</select>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"col-xs-1 col-sm-1-3\">\n\t\t\t\t\t<select\n\t\t\t\t\t\tclass=\"dg-admin-select mb-4 sm:mb-0\"\n\t\t\t\t\t\tname=${`DefaultRouteCountrySettings[${setting.index}].DefaultDestinationCountryCode`}\n\t\t\t\t\t>\n\t\t\t\t\t\t${optionsTemplate(setting.defaultDestinationCode)}\n\t\t\t\t\t</select>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`;\n\t};\n\n\tconst submitButtonTemplate = () => html`<div class=\"row\">\n\t\t<div class=\"col-xs-1 col-md-4-5\">\n\t\t\t<div class=\"sj-save-warning\">\n\t\t\t\t* After saving, a page refresh (F5) may be necessary to properly reflect the saved state.\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-xs-1 col-sm-1-5 main-buttons\">\n\t\t\t<button type=\"submit\" value=\"Save\" class=\"btn-primary push-down\" @click=${handleSave}>Save</button>\n\t\t</div>\n\t</div>`;\n\n\treturn html`\n\t\t<div class=\"row mb-4\">\n\t\t\t<div class=\"col-xs-1 col-sm-1-3\"></div>\n\t\t\t<div class=\"col-xs-1 col-sm-1-3\">Default Origin Country</div>\n\t\t\t<div class=\"col-xs-1 col-sm-1-3 mb-4 sm:mb-0\">Default Destination Country</div>\n\t\t</div>\n\t\t${Array.from(countryMap.entries()).map(rowTemplate)} ${submitButtonTemplate()}\n\t`;\n};\n","import { html, useState } from \"haunted\";\nimport { HauntedFunc } from \"Shared/haunted/HooksHelpers\";\nimport { getParsedProperty } from \"Services/common\";\nimport { COUNTRY_MAP } from \"Services/constants\";\n\nexport const useShadowDOM = false;\nexport const name = \"ac-insurance-tab-settings\";\n\nexport const observedAttributes: (keyof Attributes)[] = [\"model\"];\n\nconst CHECKBOX_ELEM_PREFIX = \"dynamic-insurance-tab-checkbox-\";\nconst INPUT_ELEM_PREFIX = \"dynamic-insurance-tab-input-\";\n\nexport interface Attributes {\n\tmodel: string;\n}\n\ninterface InsuranceTabSetting {\n\tindex: number;\n\tculture: string;\n\tcountry: string;\n\tisActive: boolean;\n\turl: string;\n}\n\nexport interface Props {\n\tmodel: InsuranceTabSetting[];\n}\n\nexport const Component: HauntedFunc<Props> = (host) => {\n\tconst parseModel = () => {\n\t\tconst hostModel =\n\t\t\ttypeof host.model === \"string\" ? getParsedProperty<DynamicInsuranceTabSetting[]>(host.model) : [];\n\n\t\treturn Array.from(COUNTRY_MAP.keys()).map((culture, index): InsuranceTabSetting => {\n\t\t\tconst setting = hostModel?.find((s) => s.Culture.toLowerCase() === culture.toLowerCase());\n\n\t\t\treturn {\n\t\t\t\tindex,\n\t\t\t\tculture: setting?.Culture ?? culture,\n\t\t\t\tcountry: COUNTRY_MAP.get(culture),\n\t\t\t\tisActive: setting?.IsActive ?? false,\n\t\t\t\turl: setting?.Url ?? \"\",\n\t\t\t};\n\t\t});\n\t};\n\n\t// HELPER FUNCTIONS\n\n\t// EVENT HANDLERS\n\n\t// COMPONENT\n\n\tconst handleCheckboxChange = (e: KeyboardEvent, index: number) => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\n\t\tconst checkbox = e.target as HTMLInputElement;\n\n\t\tsetInsuranceSettings((prevSettings) =>\n\t\t\tprevSettings.map((setting) =>\n\t\t\t\tsetting.index === index ? { ...setting, isActive: checkbox.checked } : setting\n\t\t\t)\n\t\t);\n\t};\n\n\tconst handleSave = (e: MouseEvent) => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\t(document.getElementById(\"actionType\") as HTMLInputElement).value = \"save_dynamic_settings\";\n\t\t(document.getElementById(\"admin_form\") as HTMLFormElement).submit();\n\t};\n\n\t// COMPONENT\n\n\tconst [insuranceSettings, setInsuranceSettings] = useState<InsuranceTabSetting[]>(parseModel());\n\n\t// TEMPLATES\n\n\tconst rowTemplate = (setting: InsuranceTabSetting) => {\n\t\treturn html`\n\t\t\t<input\n\t\t\t\ttype=\"hidden\"\n\t\t\t\tname=${`DynamicInsuranceTabSettings[${setting.index}].Culture`}\n\t\t\t\tvalue=${setting.culture}\n\t\t\t/>\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-xs-1 col-md-2-5\">\n\t\t\t\t\t<input\n\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\tname=${`DynamicInsuranceTabSettings[${setting.index}].IsActive`}\n\t\t\t\t\t\tid=${`${CHECKBOX_ELEM_PREFIX}${setting.culture.split(\"-\")[1]}`}\n\t\t\t\t\t\tvalue=${setting.isActive}\n\t\t\t\t\t\t?checked=${setting.isActive}\n\t\t\t\t\t\t@change=${(e: KeyboardEvent) => handleCheckboxChange(e, setting.index)}\n\t\t\t\t\t/>\n\t\t\t\t\t<label class=\"push-down\" for=${`${CHECKBOX_ELEM_PREFIX}${setting.culture.split(\"-\")[1]}`}>\n\t\t\t\t\t\tShow Insurance Tab for ${setting.country}\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"col-xs-1 col-md-3-5\">\n\t\t\t\t\t<label for=${`${INPUT_ELEM_PREFIX}${setting.culture.split(\"-\")[1]}`}> Button Url </label>\n\t\t\t\t\t<input\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tname=${`DynamicInsuranceTabSettings[${setting.index}].Url`}\n\t\t\t\t\t\tid=${`${INPUT_ELEM_PREFIX}${setting.culture.split(\"-\")[1]}`}\n\t\t\t\t\t\tvalue=${setting.url}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`;\n\t};\n\n\tconst submitButtonTemplate = () => html`\n\t\t<div class=\"row\">\n\t\t\t<div class=\"col-xs-1 col-md-4-5\">\n\t\t\t\t<div class=\"sj-save-warning\">\n\t\t\t\t\t* After saving, a page refresh (F5) may be necessary to properly reflect the saved state.\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=\"col-xs-1 col-sm-1-5 main-buttons\">\n\t\t\t\t<button type=\"submit\" value=\"Save\" class=\"btn-primary push-down\" @click=${handleSave}>Save</button>\n\t\t\t</div>\n\t\t</div>\n\t`;\n\n\treturn html` ${insuranceSettings.map(rowTemplate)} ${submitButtonTemplate()} `;\n};\n","import { PaxViewModel } from \"Components/searchbox/pax-selector/usePaxSelector\";\nimport { getTealiumDeviceType, tealiumLog } from \"Services/TealiumHelpers\";\nimport dayjs from \"dayjs\";\n\nexport const tealiumLogPaxNumbers = (vm: PaxViewModel) => {\n\ttealiumLog({\n\t\tudoParams: {\n\t\t\tpax_adult_count: vm.adults,\n\t\t\tpax_teen_count: vm.teens,\n\t\t\tpax_children_count: vm.children,\n\t\t\tpax_infant_count: vm.infants,\n\t\t},\n\t});\n};\n\nexport const tealiumLogPreloadedPromoCode = (promoCode: string) => {\n\tif (promoCode) {\n\t\ttealiumLog({\n\t\t\tudoParams: {\n\t\t\t\tpreloaded_promocode: promoCode,\n\t\t\t},\n\t\t});\n\t}\n};\n\nexport const tealiumLogSearchClick = (data: {\n\tadults: number;\n\tchildren: number;\n\tculture: string;\n\tdepartureDate: dayjs.Dayjs;\n\tdestinationCode: string;\n\tinfants: number;\n\tmarket: string;\n\tnumberOfJourneys: number;\n\toriginCode: string;\n\tpreloadedPromoCode: string;\n\tpromoCode: string;\n\treturnDate: dayjs.Dayjs;\n\tteens: number;\n}) => {\n\ttealiumLog({\n\t\teventName: \"search_clicked\",\n\t\teventParams: {\n\t\t\tculture: data.culture,\n\t\t\tdeparture_journey_date: data.departureDate ? dayjs(data.departureDate).format(\"YYYY-MM-DD\") : null,\n\t\t\tdestination_iata: data.destinationCode,\n\t\t\tdevice: getTealiumDeviceType(),\n\t\t\tmarket: data.market,\n\t\t\torigin_iata: data.originCode,\n\t\t\tpax_adult_count: data.adults,\n\t\t\tpax_children_count: data.children,\n\t\t\tpax_infant_count: data.infants,\n\t\t\tpax_teen_count: data.teens,\n\t\t\tpromocode: data.promoCode || \"n/a\",\n\t\t\treturn_journey_date: data.returnDate ? dayjs(data.returnDate).format(\"YYYY-MM-DD\") : null,\n\t\t\ttrip_type: data.numberOfJourneys === 1 ? \"O\" : \"R\",\n\t\t},\n\t});\n};\n\nexport const tealiumLogSelectReturnType = () => {\n\ttealiumLog({\n\t\teventName: \"trip_type_selected\",\n\t\teventParams: {\n\t\t\ttrip_type: \"R\",\n\t\t\tmodify: true,\n\t\t},\n\t});\n};\n\nexport const tealiumLogSelectOneWayType = () => {\n\ttealiumLog({\n\t\teventName: \"trip_type_selected\",\n\t\teventParams: {\n\t\t\ttrip_type: \"O\",\n\t\t\tmodify: true,\n\t\t},\n\t\tudoParams: {\n\t\t\tinbound_departure_iata: \"-\",\n\t\t\tinbound_arrival_iata: \"-\",\n\t\t},\n\t});\n};\n","import { useEffect, useState } from \"Shared/haunted/CustomHooks\";\n\nexport type SingletonType = \"NavitaireSettings\" | \"PaneMode\" | \"LastOpenPaneMode\";\n\nconst callbacks = new Map<{ type: SingletonType; uniqueId: number }, Function>();\nconst values = new Map<SingletonType, any>();\n\nexport interface Props {\n\ttype: SingletonType;\n}\n\n// DEVNOTE\n// This hook is used to create a global variable that can only be initialized once.\n// The reason is to have the possibility to use the global variable as a dependency\n// in multiple components without having to pass it as a prop, and make it cause\n// a re-render whenever it changes (module scope or global variables don't\n// cause re-renders).\n\nexport const useSingleton = <T>(props: Props) => {\n\tconst [value, setValue] = useState<T>(values.get(props.type));\n\n\tconst setUp = () => {\n\t\tconst key = { type: props.type, uniqueId: Date.now() };\n\t\tcallbacks.set(key, setValue);\n\t\tsetValue(values.get(props.type));\n\n\t\treturn () => {\n\t\t\tvalues.delete(props.type);\n\t\t\tcallbacks.delete(key);\n\t\t};\n\t};\n\n\tconst init = async (initFn: () => Promise<T>) => {\n\t\tif (values.has(props.type)) return;\n\n\t\tvalues.set(props.type, undefined);\n\t\tconst initResult = await initFn();\n\t\tupdate(initResult);\n\t};\n\n\tconst update = (newValue: T) => {\n\t\tvalues.set(props.type, newValue);\n\t\tArray.from(callbacks.entries())\n\t\t\t.filter(([key, _]) => key.type === props.type)\n\t\t\t.forEach(([_, callback]) => callback(newValue));\n\t};\n\n\tuseEffect(setUp, []);\n\n\treturn { value, init, update };\n};\n","import { useSingleton } from \"Components/singleton/useSingleton\";\n\nexport type PaneMode = \"none\" | \"origin\" | \"destination\" | \"departure\" | \"return\" | \"passengers\";\n\nexport const usePane = () => {\n\tconst mode = useSingleton<PaneMode>({ type: \"PaneMode\" });\n\tconst lastOpenMode = useSingleton<PaneMode>({ type: \"LastOpenPaneMode\" });\n\n\tconst closePane = () => mode.update(\"none\");\n\n\tconst set = (newMode: PaneMode) => {\n\t\tif (mode.value === newMode) return;\n\n\t\tif (newMode === \"none\") {\n\t\t\tclosePane();\n\t\t\treturn;\n\t\t}\n\n\t\t// DEVNOTE For animation, we first close\n\t\t// and then open the new mode\n\t\tclosePane();\n\t\twindow.setTimeout(() => {\n\t\t\tmode.update(newMode);\n\t\t\tlastOpenMode.update(newMode);\n\t\t}, 350);\n\t};\n\n\treturn { lastOpenMode: lastOpenMode.value, mode: mode.value, set };\n};\n","import { CLASS_NAMES } from \"Services/ClassNames\";\nimport classNames from \"classnames\";\nimport { html } from \"lit-html\";\n\nexport interface PaxSelectorProps {\n\tageNote: string;\n\tamount: number;\n\tamountTestId: string;\n\tdecreaseTestId: string;\n\tincreaseTestId: string;\n\tisIncreaseDisabled: boolean;\n\tlabel: string;\n\tonDecrease: () => void;\n\tonIncrease: () => void;\n}\n\nexport const usePax = (props: PaxSelectorProps) => {\n\tconst handleIncrease = (e: MouseEvent) => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\n\t\tprops.onIncrease();\n\t};\n\n\tconst handleDecrease = (e: MouseEvent) => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\n\t\tprops.onDecrease();\n\t};\n\n\tconst htmlTemplate = () => html`\n\t\t<div class=\"dg-quantity-container\">\n\t\t\t<div class=\"dg-pax-amount\">\n\t\t\t\t<div\n\t\t\t\t\tclass=${classNames(\"dg-quantity-btn decrease\", { [CLASS_NAMES.disabled]: props.amount === 0 })}\n\t\t\t\t\ttitle=\"Decrease Quantity\"\n\t\t\t\t\tdata-test-id=${props.decreaseTestId}\n\t\t\t\t\t@click=${handleDecrease}\n\t\t\t\t>\n\t\t\t\t\t-\n\t\t\t\t</div>\n\t\t\t\t<span class=\"dg-quantity-amount\" data-test-id=${props.amountTestId}>${props.amount}</span>\n\t\t\t\t<div\n\t\t\t\t\tclass=${classNames(\"dg-quantity-btn increase\", {\n\t\t\t\t\t\t[CLASS_NAMES.disabled]: props.isIncreaseDisabled,\n\t\t\t\t\t})}\n\t\t\t\t\ttitle=\"Increase Quantity\"\n\t\t\t\t\tdata-test-id=${props.increaseTestId}\n\t\t\t\t\t@click=${handleIncrease}\n\t\t\t\t>\n\t\t\t\t\t+\n\t\t\t\t</div>\n\t\t\t\t<div class=\"dg-quantity-label\">${props.label}</div>\n\t\t\t\t<span class=\"dg-age-label\">&nbsp;${props.ageNote}</span>\n\t\t\t</div>\n\t\t</div>\n\t`;\n\n\treturn { htmlTemplate };\n};\n","import { PROMO_CODE_URL_KEY } from \"Services/constants\";\n\nexport const decode = (input: string) => input.replace(/&#(\\d+);/g, (_, dec) => String.fromCharCode(dec));\n\nexport const getPromoCode = (\n\tprogramCodesWithLevels: string[],\n\troleCode: string,\n\tdynamicSettings: DynamicSettings,\n\tculture: string\n) => {\n\tconst promoCodeFromUrl = getPromoCodeFromUrl();\n\n\tif (promoCodeFromUrl) return promoCodeFromUrl;\n\n\tlet promoCode;\n\n\tif (dynamicSettings) {\n\t\t// DEVNOTE The sorting is because BancoEstado (BEC-...) is stronger than DC (DCB-...)\n\t\tpromoCode = dynamicSettings.DynamicPromoCodeSettings.sort((a, b) =>\n\t\t\ta.ProgramCodeAndLevel > b.ProgramCodeAndLevel ? 1 : -1\n\t\t).find(\n\t\t\t(item) =>\n\t\t\t\t(!item.Culture || item.Culture.toLowerCase() === culture.toLowerCase()) &&\n\t\t\t\t(!item.RoleCode || item.RoleCode.toLowerCase() === roleCode?.toLowerCase()) &&\n\t\t\t\t(!item.ProgramCodeAndLevel ||\n\t\t\t\t\t!programCodesWithLevels ||\n\t\t\t\t\tprogramCodesWithLevels.includes(item.ProgramCodeAndLevel))\n\t\t)?.Code;\n\n\t\tif (promoCode) return promoCode;\n\n\t\tswitch (culture) {\n\t\t\tcase \"es-CL\":\n\t\t\t\treturn dynamicSettings.DefaultPromotionCodeCl;\n\t\t\tcase \"es-PE\":\n\t\t\t\treturn dynamicSettings.DefaultPromotionCodePe;\n\t\t\tcase \"es-AR\":\n\t\t\t\treturn dynamicSettings.DefaultPromotionCodeAr;\n\t\t\tcase \"es-CO\":\n\t\t\t\treturn dynamicSettings.DefaultPromotionCodeCo;\n\t\t\tcase \"en-US\":\n\t\t\t\treturn dynamicSettings.DefaultPromotionCodeUs;\n\t\t\tcase \"pt-BR\":\n\t\t\t\treturn dynamicSettings.DefaultPromotionCodeBr;\n\t\t\tcase \"es-PY\":\n\t\t\t\treturn dynamicSettings.DefaultPromotionCodePy;\n\t\t\tcase \"es-UY\":\n\t\t\t\treturn dynamicSettings.DefaultPromotionCodeUy;\n\t\t\tcase \"es-EC\":\n\t\t\t\treturn dynamicSettings.DefaultPromotionCodeEc;\n\t\t\tcase \"es-ES\":\n\t\t\t\treturn dynamicSettings.DefaultPromotionCodeEs;\n\t\t\tcase \"en-GB\":\n\t\t\t\treturn dynamicSettings.DefaultPromotionCodeGb;\n\t\t\tdefault:\n\t\t\t\treturn \"\";\n\t\t}\n\t}\n\n\treturn \"\";\n};\n\nconst getPromoCodeFromUrl = () => {\n\tconst urlElems = window.location.href.split(\"?\");\n\n\tif (urlElems.length < 2) return undefined;\n\n\tconst queryElems = urlElems[1].split(\"&\");\n\n\tfor (const elem of queryElems) {\n\t\tconst [key, value] = elem.split(\"=\");\n\n\t\tif (key.toLowerCase() === PROMO_CODE_URL_KEY.toLowerCase()) return value;\n\t}\n\n\treturn undefined;\n};\n","import { COOKIES, WEB_ANONYMOUS_ROLE_CODE } from \"Services/constants\";\nimport { getCookie } from \"Services/cookieHandling\";\nimport { UserInfo } from \"Shared/models/UserInfo\";\nimport { decode } from \"./PromoCodeHelper\";\nimport { UserInfoCookie } from \"Shared/models/UserInfoCookie\";\nimport { toBoolean } from \"Services/common\";\nimport { useMemo } from \"Shared/haunted/CustomHooks\";\n\n// FOR TESTING ONLY! REMOVE BEFORE GOING TO PROD!\n// const FAKE_USER_INFO_FOR_TESTING: UserInfo = {\n// \tBancoEstadoCategory: 0,\n// \tBancoEstadoFreeSeats: 0,\n// \tIsBancoEstadoMember: false,\n// \tIsCug3Observer: false,\n// \tIsCug3Supervisor: true,\n// \tIsDiscountClubGroupMember: false,\n// \tIsDiscountClubStandardMember: false,\n// \tIsPeruCompraAdmin: false,\n// \tIsPeruCompraMember: false,\n// \tName: \"CUG3 Test User\",\n// \tOrganization: \"CUG3 Test Organization\",\n// \tPeruCompraAmount: \"\",\n// \tProgramCodesWithLevels: [],\n// \tProgramLevels: \"\",\n// \tRoleCode: \"ABABAB\",\n// };\n// EOF FOR TESTING ONLY\n\nexport const useUserInfo = (): UserInfo => {\n\tconst retVal = useMemo(() => {\n\t\tconst userInfo = getCookie(COOKIES.USER_INFO);\n\n\t\ttry {\n\t\t\tconst decodedUserInfo = userInfo ? (JSON.parse(decode(atob(userInfo))) as UserInfoCookie) : undefined;\n\n\t\t\tconst parsedUserInfo: UserInfo = {\n\t\t\t\tBancoEstadoCategory: !isNaN(Number(decodedUserInfo?.BancoEstadoCategory))\n\t\t\t\t\t? Number(decodedUserInfo?.BancoEstadoCategory || 0) || 0\n\t\t\t\t\t: 0,\n\t\t\t\tBancoEstadoFreeSeats: !isNaN(Number(decodedUserInfo?.BancoEstadoCategory))\n\t\t\t\t\t? Number(decodedUserInfo?.BancoEstadoFreeSeats || 0) || 0\n\t\t\t\t\t: 0,\n\t\t\t\tIsBancoEstadoMember: toBoolean(decodedUserInfo?.IsBancoEstadoMember),\n\t\t\t\tIsCug3Observer: toBoolean(decodedUserInfo?.IsCug3Observer),\n\t\t\t\tIsCug3Supervisor: toBoolean(decodedUserInfo?.IsCug3Supervisor),\n\t\t\t\tIsDiscountClubGroupMember: toBoolean(decodedUserInfo?.IsDiscountClubGroupMember),\n\t\t\t\tIsDiscountClubStandardMember: toBoolean(decodedUserInfo?.IsDiscountClubStandardMember),\n\t\t\t\tIsPeruCompraAdmin: toBoolean(decodedUserInfo?.IsPeruCompraAdmin),\n\t\t\t\tIsPeruCompraMember: toBoolean(decodedUserInfo?.IsPeruCompraMember),\n\t\t\t\tName: decodedUserInfo?.Name || \"\",\n\t\t\t\tOrganization: decodedUserInfo?.Organization || \"\",\n\t\t\t\tPeruCompraAmount: decodedUserInfo?.PeruCompraAmount || \"\",\n\t\t\t\tProgramCodesWithLevels: decodedUserInfo?.ProgramCodesWithLevels?.split(\"|\") || [],\n\t\t\t\tProgramLevels: decodedUserInfo?.ProgramLevels || \"\",\n\t\t\t\tRoleCode: decodedUserInfo?.RoleCode || WEB_ANONYMOUS_ROLE_CODE,\n\n\t\t\t\tIsAmericanMember: toBoolean(decodedUserInfo?.IsAmericanMember),\n\t\t\t\tMiles: !isNaN(Number(decodedUserInfo?.Miles)) ? Number(decodedUserInfo?.Miles || 0) || 0 : 0,\n\t\t\t\tAmericanAirlinesDisplayName: decodedUserInfo?.AmericanAirlinesDisplayName\n\t\t\t\t\t? `${decodedUserInfo?.AmericanAirlinesDisplayName.FirstName} ${decodedUserInfo?.AmericanAirlinesDisplayName.LastName}`\n\t\t\t\t\t: \"\",\n\t\t\t\tAmericanMemberTier: decodedUserInfo?.Tier || undefined,\n\t\t\t\tEligibleForAmericanAirlinesRedemption: toBoolean(\n\t\t\t\t\tdecodedUserInfo?.EligibleForAmericanAirlinesRedemption\n\t\t\t\t),\n\t\t\t\tAmericanAirlinesAdvantageNumber: decodedUserInfo?.AmericanAirlinesAdvantageNumber || \"\",\n\t\t\t};\n\n\t\t\treturn parsedUserInfo;\n\t\t} catch (e) {\n\t\t\tthrow new Error(\"Unable to parse user info cookie.\");\n\t\t}\n\t}, []);\n\n\t// FOR TESTING ONLY! REMOVE BEFORE GOING TO PROD!\n\t// return FAKE_USER_INFO_FOR_TESTING || retVal;\n\t// EOF FOR TESTING ONLY\n\treturn retVal;\n};\n","import { TestIdDictionary } from \"Services/test-ids/TestIdDictionary\";\nimport { useEffect, useState } from \"Shared/haunted/CustomHooks\";\nimport { ref } from \"Components/directives/ref\";\nimport { html, useRef } from \"haunted\";\nimport i18next from \"i18next\";\nimport {\n\tMIN_TEEN_AGE,\n\tMIN_ADULT_AGE,\n\tMIN_PAX_NUMBER_FOR_GROUP_BOOKING,\n\tCOLOMBIAN_CULTURE_CODE,\n} from \"Services/constants\";\nimport { JetSmartEvent } from \"Services/eventbus/JetSmartEvent\";\nimport { tealiumLogPaxNumbers } from \"ComponentHelpers/SearchboxTealiumHelpers\";\nimport { usePane } from \"../opening-pane/usePane\";\nimport { CLASS_NAMES } from \"Services/ClassNames\";\nimport { PUB_SUBS } from \"Services/pub-sub-service/PubSub\";\nimport { usePax } from \"./usePax\";\nimport classNames from \"classnames\";\nimport { useUserInfo } from \"ComponentHelpers/useUserInfo\";\n\nexport interface Props {\n\tculture: string;\n\tisFlightDomesticColombia: boolean;\n\tshowRedemptionMiles: boolean;\n\tisRedemptionCheckboxChecked: boolean;\n}\n\nexport interface PaxViewModel {\n\tadults: number;\n\tchildren: number;\n\tinfants: number;\n\tteens: number;\n}\n\nexport const usePaxSelector = (props: Props) => {\n\tconst pane = usePane();\n\tconst userInfo = useUserInfo();\n\n\tconst paxRoot = useRef<HTMLDivElement>(undefined);\n\tconst paxPane = useRef<HTMLDivElement>(undefined);\n\n\tconst [vm, setVm] = useState<PaxViewModel>({ adults: 1, teens: 0, children: 0, infants: 0 });\n\tconst [showTeenInfantRemoveWarning, setShowTeenInfantRemoveWarning] = useState<boolean>(false);\n\tconst [showGroupWarning, setShowGroupWarning] = useState<boolean>(false);\n\tconst [isValidated, setIsValidated] = useState<boolean>(false);\n\n\tconst maxChildrenAmount = (model: PaxViewModel) => {\n\t\tif (model.adults > 0) return Number.POSITIVE_INFINITY;\n\n\t\tconst retVal = model.teens - model.infants;\n\n\t\treturn retVal > 0 ? retVal : 0;\n\t};\n\n\tconst maxInfantAmount = (model: PaxViewModel) => {\n\t\tif (model.adults > 0) return model.adults + model.teens;\n\n\t\tconst retVal = model.teens - model.children;\n\n\t\treturn retVal > 0 ? retVal : 0;\n\t};\n\n\tconst adults = usePax({\n\t\tageNote: `(${MIN_ADULT_AGE} ${i18next.t(\"search-box-adults-min-age\")})`,\n\t\tamount: vm.adults,\n\t\tamountTestId: TestIdDictionary.Pax.AdultAmount,\n\t\tdecreaseTestId: TestIdDictionary.Pax.RemoveAdult,\n\t\tincreaseTestId: TestIdDictionary.Pax.AddAdult,\n\t\tisIncreaseDisabled: false,\n\t\tlabel: i18next.t(\"search-box-adults\"),\n\t\tonDecrease: () => decreasePax(\"adults\"),\n\t\tonIncrease: () => increasePax(\"adults\"),\n\t});\n\n\tconst teens = usePax({\n\t\tageNote: `(${MIN_TEEN_AGE} - ${MIN_ADULT_AGE - 1} ${i18next.t(\"search-box-children-age\")})`,\n\t\tamount: vm.teens,\n\t\tamountTestId: TestIdDictionary.Pax.TeenAmount,\n\t\tdecreaseTestId: TestIdDictionary.Pax.RemoveTeen,\n\t\tincreaseTestId: TestIdDictionary.Pax.AddTeen,\n\t\tisIncreaseDisabled: false,\n\t\tlabel: i18next.t(\"search-box-teens\"),\n\t\tonDecrease: () => decreasePax(\"teens\"),\n\t\tonIncrease: () => increasePax(\"teens\"),\n\t});\n\n\tconst children = usePax({\n\t\tageNote: `(2 - ${MIN_TEEN_AGE - 1} ${i18next.t(\"search-box-children-age\")})`,\n\t\tamount: vm.children,\n\t\tamountTestId: TestIdDictionary.Pax.ChildAmount,\n\t\tdecreaseTestId: TestIdDictionary.Pax.RemoveChild,\n\t\tincreaseTestId: TestIdDictionary.Pax.AddChild,\n\t\tisIncreaseDisabled: vm.children >= maxChildrenAmount(vm),\n\t\tlabel: i18next.t(\"search-box-children\"),\n\t\tonDecrease: () => decreasePax(\"children\"),\n\t\tonIncrease: () => increasePax(\"children\"),\n\t});\n\n\tconst infants = usePax({\n\t\tageNote: i18next.t(\"search-box-infants-age\"),\n\t\tamount: vm.infants,\n\t\tamountTestId: TestIdDictionary.Pax.InfantAmount,\n\t\tdecreaseTestId: TestIdDictionary.Pax.RemoveInfant,\n\t\tincreaseTestId: TestIdDictionary.Pax.AddInfant,\n\t\tisIncreaseDisabled: vm.infants >= maxInfantAmount(vm),\n\t\tlabel: i18next.t(\"search-box-infants\"),\n\t\tonDecrease: () => decreasePax(\"infants\"),\n\t\tonIncrease: () => increasePax(\"infants\"),\n\t});\n\n\t// Helpers\n\n\tconst init = () => {\n\t\twindow.setTimeout(() => tealiumLogPaxNumbers(vm), 0);\n\t};\n\n\tconst showChildrenAgeWarningDomColombia = () =>\n\t\tvm.children > 0 &&\n\t\tprops.isFlightDomesticColombia &&\n\t\tprops.culture.toLowerCase() === COLOMBIAN_CULTURE_CODE &&\n\t\t!showGroupWarning &&\n\t\t!showTeenInfantRemoveWarning;\n\n\tconst onClickOutsidePax = (e: MouseEvent) => {\n\t\tconst path = e.composedPath && e.composedPath();\n\n\t\tconst isClickInside = path.indexOf(paxRoot.current) > -1 || path.indexOf(paxPane.current) > -1;\n\n\t\tif (!isClickInside && pane.mode === \"passengers\") {\n\t\t\tpane.set(\"none\");\n\t\t\tsetShowGroupWarning(false);\n\t\t}\n\t};\n\n\tconst showMinorOrInfantAgeWarning = () => vm.children > 0 || vm.infants > 0;\n\n\tconst adjustChildrenAndInfantAmountsSafely = (model: PaxViewModel): PaxViewModel => {\n\t\tconst newVm = { ...model };\n\n\t\tif (newVm.infants > maxInfantAmount(newVm)) newVm.infants = maxInfantAmount(newVm);\n\n\t\tif (newVm.children > maxChildrenAmount(newVm)) newVm.children = maxChildrenAmount(newVm);\n\n\t\treturn newVm;\n\t};\n\n\tconst formattedAmount = (model: PaxViewModel) => {\n\t\tconst displayedValue: string[] = [];\n\n\t\tif (model.adults > 0) {\n\t\t\tdisplayedValue.push(`${model.adults} ${model.adults === 1 ? i18next.t(\"adult\") : i18next.t(\"adults\")}`);\n\t\t}\n\n\t\tif (model.teens > 0) {\n\t\t\tdisplayedValue.push(`${model.teens} ${model.teens === 1 ? i18next.t(\"teen\") : i18next.t(\"teens\")}`);\n\t\t}\n\n\t\tif (model.children > 0) {\n\t\t\tdisplayedValue.push(\n\t\t\t\t`${model.children} ${model.children === 1 ? i18next.t(\"child\") : i18next.t(\"children\")}`\n\t\t\t);\n\t\t}\n\n\t\tif (model.infants > 0) {\n\t\t\tdisplayedValue.push(`${model.infants} ${model.infants === 1 ? i18next.t(\"infant\") : i18next.t(\"infants\")}`);\n\t\t}\n\n\t\treturn displayedValue.length > 0 ? displayedValue.join(\", \") : \"\";\n\t};\n\n\tconst validate = () => {\n\t\tsetIsValidated(true);\n\n\t\treturn (\n\t\t\tvm.adults + vm.teens >= 1 &&\n\t\t\tvm.children >= 0 &&\n\t\t\tvm.infants >= 0 &&\n\t\t\tvm.adults + vm.teens + vm.children <= MIN_PAX_NUMBER_FOR_GROUP_BOOKING - 1 &&\n\t\t\tvm.infants <= vm.adults + vm.teens &&\n\t\t\t(vm.adults > 0 || vm.children + vm.infants <= vm.teens)\n\t\t);\n\t};\n\n\tconst increasePax = (key: keyof PaxViewModel) => {\n\t\tconst newVm = { ...vm };\n\n\t\tconst canAddMorePax =\n\t\t\tkey === \"infants\"\n\t\t\t\t? newVm.infants < maxInfantAmount(newVm)\n\t\t\t\t: newVm.adults + newVm.teens + newVm.children < MIN_PAX_NUMBER_FOR_GROUP_BOOKING - 1;\n\n\t\tif (canAddMorePax) {\n\t\t\tnewVm[key] = newVm[key] + 1;\n\t\t}\n\n\t\tsetShowTeenInfantRemoveWarning(false);\n\t\tsetShowGroupWarning(key !== \"infants\" && !canAddMorePax);\n\n\t\tsetVm(newVm);\n\t};\n\n\tconst decreasePax = (key: keyof PaxViewModel) => {\n\t\tlet newVm = { ...vm };\n\n\t\tnewVm[key] = newVm[key] - 1;\n\t\tnewVm = adjustChildrenAndInfantAmountsSafely(newVm);\n\n\t\tsetShowTeenInfantRemoveWarning(\n\t\t\tkey === \"teens\" &&\n\t\t\t\tnewVm.adults + newVm.teens + newVm.children + newVm.infants > 0 &&\n\t\t\t\tvm.infants > maxInfantAmount(newVm)\n\t\t);\n\n\t\tsetShowGroupWarning(false);\n\n\t\tsetVm(newVm);\n\t};\n\n\t// Event listeners\n\n\tconst handleClose = (e: MouseEvent) => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\n\t\tpane.set(\"none\");\n\t};\n\n\tconst handleClick = (e: MouseEvent) => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\n\t\t(e.target as HTMLInputElement).blur();\n\n\t\tif (e.currentTarget instanceof HTMLElement) pane.set(\"passengers\");\n\t};\n\n\tconst updateOnSearchReload = (model: PaxViewModel) => setVm({ ...model });\n\n\tuseEffect(() => {\n\t\ttealiumLogPaxNumbers(vm);\n\t\twindow.eventBus.raiseEvent({\n\t\t\tname: JetSmartEvent.PassengersChanged,\n\t\t\tparams: {\n\t\t\t\tid: \"searchbox.passengers\",\n\t\t\t\tevent: \"change\",\n\t\t\t\tdata: {\n\t\t\t\t\tadults: vm.adults,\n\t\t\t\t\tteens: vm.teens,\n\t\t\t\t\tchildren: vm.children,\n\t\t\t\t\tinfants: vm.infants,\n\t\t\t\t},\n\t\t\t},\n\t\t});\n\t}, [vm.adults, vm.teens, vm.children, vm.infants]);\n\n\tuseEffect(() => {\n\t\tif (pane.mode === \"passengers\") {\n\t\t\tconst sub = PUB_SUBS.DocumentClicked.subscribe((e) => onClickOutsidePax(e.mouseEvent));\n\t\t\treturn () => sub.unsubscribe();\n\t\t}\n\t\treturn () => {};\n\t}, [pane.mode]);\n\n\tuseEffect(init, []);\n\n\t// Templates\n\n\tconst inputFieldTemplate = () => html`\n\t\t<div ref=${ref(paxRoot)} class=\"dg-quantity-wrapper\" @click=${handleClick}>\n\t\t\t<input\n\t\t\t\tclass=${classNames({\n\t\t\t\t\t[CLASS_NAMES.error]: isValidated && formattedAmount(vm).length === 0,\n\t\t\t\t})}\n\t\t\t\tplaceholder=${i18next.t(\"search-box-passengers\")}\n\t\t\t\tautocomplete=\"disabled\"\n\t\t\t\treadonly\n\t\t\t\trequired\n\t\t\t\tvalue=${formattedAmount(vm)}\n\t\t\t\t.value=${formattedAmount(vm)}\n\t\t\t\tdata-test-id=${TestIdDictionary.Pax.Input}\n\t\t\t/>\n\t\t</div>\n\t`;\n\tconst mobilePaneCloserTemplate = () => html`\n\t\t<div class=\"hidden-sm-up dg-quantity-header\">\n\t\t\t<span @click=${handleClose}>&times;</span>\n\t\t</div>\n\t`;\n\n\tconst paneCloserTemplate = () => html`\n\t\t<div class=\"dg-btn-container\">\n\t\t\t<button class=\"dg-button dg-pax-btn\" @click=${handleClose} data-test-id=${TestIdDictionary.Pax.CloseButton}>\n\t\t\t\tOK\n\t\t\t</button>\n\t\t</div>\n\t`;\n\n\tconst groupWarningTemplate = () => {\n\t\tconst [language, country] = props.culture.toLowerCase().split(\"-\");\n\t\tconst groupUrl = `/${country}/${language}/minisitios/grupos`;\n\n\t\treturn showGroupWarning\n\t\t\t? html`\n\t\t\t\t\t<div class=\"dg-pax-quantity-message\">\n\t\t\t\t\t\t${i18next.t(\"search-box-group-warning-1\")}\n\t\t\t\t\t\t<a href=${groupUrl}>${i18next.t(\"search-box-group-warning-2\")}</a>.\n\t\t\t\t\t</div>\n\t\t\t  `\n\t\t\t: \"\";\n\t};\n\n\tconst minorOrInfantAgeWarningTemplate = () =>\n\t\tshowMinorOrInfantAgeWarning()\n\t\t\t? html`<div class=\"dg-pax-warning\">${i18next.t(\"search-box-minor-age-warning\")}</div>`\n\t\t\t: \"\";\n\n\tconst showTeenInfantRemoveWarningTemplate = () =>\n\t\tshowTeenInfantRemoveWarning\n\t\t\t? html`<div class=\"dg-pax-warning\">${i18next.t(\"search-box-infant-warning\")}</div>`\n\t\t\t: \"\";\n\n\tconst childrenAgeWarningDomColombiaTemplate = () =>\n\t\tshowChildrenAgeWarningDomColombia()\n\t\t\t? html`<div class=\"dg-pax-warning\">${i18next.t(\"searchbox-domcom-age-warning\")}</div>`\n\t\t\t: \"\";\n\n\tconst paneTemplate = () => html`\n\t\t<div\n\t\t\tref=${ref(paxPane)}\n\t\t\tdata-test-id=${TestIdDictionary.Pax.Container}\n\t\t\tclass=${classNames(\"dg-quantity-dropdown\", {\n\t\t\t\t\"open\": pane.mode === \"passengers\",\n\t\t\t\t\"with-redemption-miles-and-promo-code\":\n\t\t\t\t\tprops.showRedemptionMiles && (!props.isRedemptionCheckboxChecked || !userInfo.IsAmericanMember),\n\t\t\t})}\n\t\t>\n\t\t\t${mobilePaneCloserTemplate()} ${adults.htmlTemplate()} ${teens.htmlTemplate()} ${children.htmlTemplate()}\n\t\t\t${infants.htmlTemplate()} ${groupWarningTemplate()} ${paneCloserTemplate()}\n\t\t\t${minorOrInfantAgeWarningTemplate()} ${showTeenInfantRemoveWarningTemplate()}\n\t\t\t${childrenAgeWarningDomColombiaTemplate()}\n\t\t</div>\n\t`;\n\n\tconst htmlTemplate = () => html` ${inputFieldTemplate()} ${paneTemplate()} `;\n\n\treturn { passengers: vm, htmlTemplate, updateOnSearchReload, validate };\n};\n","export default function getShowFarePriceForCulture(showFarePrices: ShowFarePrices, culture: string) {\n\tif (!showFarePrices) {\n\t\treturn false;\n\t}\n\tswitch (culture) {\n\t\tcase \"es-CL\":\n\t\t\treturn showFarePrices.Cl;\n\t\tcase \"es-PE\":\n\t\t\treturn showFarePrices.Pe;\n\t\tcase \"es-AR\":\n\t\t\treturn showFarePrices.Ar;\n\t\tcase \"es-CO\":\n\t\t\treturn showFarePrices.Co;\n\t\tcase \"en-US\":\n\t\t\treturn showFarePrices.Us;\n\t\tcase \"pt-BR\":\n\t\t\treturn showFarePrices.Br;\n\t\tcase \"es-PY\":\n\t\t\treturn showFarePrices.Py;\n\t\tcase \"es-UY\":\n\t\t\treturn showFarePrices.Uy;\n\t\tcase \"es-EC\":\n\t\t\treturn showFarePrices.Ec;\n\t\tcase \"es-ES\":\n\t\t\treturn showFarePrices.Es;\n\t\tcase \"en-GB\":\n\t\t\treturn showFarePrices.Gb;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\treturn false;\n}\n","export const createHeaders = () => {\n\tconst headers = new Headers({\n\t\tAccept: \"application/json\",\n\t});\n\n\tif (window.JetSmart.NavitaireSettingsOptions.Mode === \"DirectFareCache\") {\n\t\theaders.append(\"x-api-key\", window.JetSmart.NavitaireSettingsOptions.ApiKey);\n\t}\n\n\treturn headers;\n};","import * as dayjs from \"dayjs\";\nimport { ApiSchedule } from \"Shared/models/ApiSchedule\";\nimport { Schedule } from \"Shared/models/Schedule\";\n\nexport const mapToSchedule = (apiSchedule: ApiSchedule): Schedule => ({\n\t...apiSchedule,\n\tdepartureDate: dayjs(apiSchedule.departureDate),\n});\n","import { tealiumLog } from \"Services/TealiumHelpers\";\nimport { FARECACHE_NAVITAIRE_SETTINGS_PATH } from \"Services/constants\";\nimport { ApiStationSettings } from \"Shared/models/ApiStationSettings\";\nimport { ApiNavitaireSettings } from \"Shared/models/ApiNavitaireSettings\";\nimport { removeTrailingSlash } from \"Services/common\";\nimport { ApiCultureSettings } from \"ComponentModels/ApiCultureSettings\";\nimport { createHeaders } from \"./HeaderHelper\";\nimport { useSingleton } from \"Components/singleton/useSingleton\";\n\nexport interface NavitaireSettings {\n\tabTestSettings: AbTestSettings;\n\tcultureSettings: ApiCultureSettings;\n\tcurrency: string;\n\tstationSettings: ApiStationSettings;\n}\n\nexport const useNavitaireSettings = () => {\n\tconst settings = useSingleton<NavitaireSettings>({ type: \"NavitaireSettings\" });\n\n\tconst init = async (data: { culture: string; loadedValues: NavitaireSettings }) => {\n\t\tawait settings.init(\n\t\t\twindow.JetSmart.NavitaireSettingsOptions.Mode === \"DirectFareCache\"\n\t\t\t\t? async () => {\n\t\t\t\t\t\tconst result = await fetchNavitaireSettings();\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tabTestSettings: result.AbTestSettings,\n\t\t\t\t\t\t\tcultureSettings: result.CultureSettings,\n\t\t\t\t\t\t\tcurrency: result.DefaultCurrencies.find((c) => c.Culture === data.culture)?.Currency,\n\t\t\t\t\t\t\tstationSettings: result.StationSettings,\n\t\t\t\t\t\t};\n\t\t\t\t  }\n\t\t\t\t: () => Promise.resolve(data.loadedValues)\n\t\t);\n\t};\n\n\tconst fetchNavitaireSettings = async () => {\n\t\tconst headers = createHeaders();\n\n\t\tconst baseUrl = removeTrailingSlash(window.JetSmart.NavitaireSettingsOptions.BaseAddress);\n\t\tconst url = `${baseUrl}${FARECACHE_NAVITAIRE_SETTINGS_PATH}`;\n\t\tconst response = await fetch(url, { headers });\n\n\t\tif (response.ok) {\n\t\t\tconst responseJson = (await response.json()) as ApiNavitaireSettings;\n\t\t\treturn responseJson;\n\t\t} else {\n\t\t\ttealiumLog({\n\t\t\t\teventName: \"server_error\",\n\t\t\t\teventParams: {\n\t\t\t\t\tpage: \"/\",\n\t\t\t\t\terror_code: response.status,\n\t\t\t\t\tmessage: response.statusText,\n\t\t\t\t\tserver_url: url,\n\t\t\t\t},\n\t\t\t\tudoParams: {\n\t\t\t\t\terror_info: response.statusText,\n\t\t\t\t\terror_code: response.status,\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tthrow new Error(\"Network response was not ok.\");\n\t\t}\n\t};\n\n\treturn { value: settings.value, init };\n};\n","import { createHeaders } from \"ComponentHelpers/HeaderHelper\";\nimport { mapToSchedule } from \"ComponentMappers/ScheduleMapper\";\nimport { usePane } from \"Components/searchbox/opening-pane/usePane\";\nimport * as dayjs from \"dayjs\";\nimport { isMobileResolution, removeTrailingSlash } from \"Services/common\";\nimport { API_TIMETABLE_URL } from \"Services/constants\";\nimport { useEffect, useState } from \"Shared/haunted/CustomHooks\";\nimport { ApiMetadata } from \"Shared/models/ApiMetadata\";\nimport { ApiTimeTableV2 } from \"Shared/models/ApiTimeTableV2\";\nimport { Schedule } from \"Shared/models/Schedule\";\nimport { useNavitaireSettings } from \"./useNavitaireSettings\";\n\nexport interface TimeTableProps {\n\tdestinationCode: string;\n\tisOneWay: boolean;\n\toriginCode: string;\n\tforcedUpdateMode: boolean;\n\tstartLoading: () => void;\n\tstopLoading: (loader: any) => void;\n}\n\nexport const useTimeTable = (props: TimeTableProps) => {\n\tconst pane = usePane();\n\tconst settings = useNavitaireSettings();\n\n\tconst [inboundMetadata, setInboundMetadata] = useState<ApiMetadata>(undefined);\n\tconst [inboundSchedules, setInboundSchedules] = useState<Schedule[]>(undefined);\n\tconst [outboundMetadata, setOutboundMetadata] = useState<ApiMetadata>(undefined);\n\tconst [outboundSchedules, setOutboundSchedules] = useState<Schedule[]>(undefined);\n\n\tconst getApiTimeTable = async (origin: string, destination: string): Promise<ApiTimeTableV2> => {\n\t\tconst headers = createHeaders();\n\n\t\tconst url = generateTimeTableUrl(origin, destination);\n\t\tconst fetchOptions: RequestInit = {\n\t\t\tmethod: \"GET\",\n\t\t\tmode: \"cors\",\n\t\t\theaders,\n\t\t};\n\n\t\ttry {\n\t\t\tconst result = await fetch(url, fetchOptions);\n\n\t\t\tif (result.ok) {\n\t\t\t\tconst resultJson = (await result.json()) as ApiTimeTableV2;\n\t\t\t\treturn resultJson;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t} catch (e) {\n\t\t\treset();\n\t\t\treturn null;\n\t\t}\n\t};\n\n\tconst generateTimeTableUrl = (origin: string, destination: string) => {\n\t\tconst startOfMonth = dayjs().startOf(\"month\").format(\"YYYY-MM-DD\");\n\t\tconst shouldSearchOneWayOnly =\n\t\t\t!props.forcedUpdateMode && (!window.JetSmart.TimetableOptions.IncludeReturnFlights || props.isOneWay);\n\n\t\tif (window.JetSmart.TimetableOptions.Mode === \"DirectFareCache\") {\n\t\t\tconst baseUrl = removeTrailingSlash(window.JetSmart.TimetableOptions.BaseAddress);\n\n\t\t\treturn [\n\t\t\t\t`${baseUrl}/timetable?departure=${origin}`,\n\t\t\t\t`destination=${destination}`,\n\t\t\t\t`currency=${settings?.value?.currency}`,\n\t\t\t\t`withPriceRange`,\n\t\t\t\t`startDate=${startOfMonth}`,\n\t\t\t\t`${shouldSearchOneWayOnly ? \"return=false\" : \"\"}`,\n\t\t\t]\n\t\t\t\t.filter((item) => item)\n\t\t\t\t.join(\"&\");\n\t\t}\n\n\t\treturn [\n\t\t\t`${API_TIMETABLE_URL}?departure=${origin}`,\n\t\t\t`destination=${destination}`,\n\t\t\t`currency=${settings?.value?.currency}`,\n\t\t\t`startDate=${startOfMonth}`,\n\t\t\t`${shouldSearchOneWayOnly ? \"return=false\" : \"\"}`,\n\t\t]\n\t\t\t.filter((item) => item)\n\t\t\t.join(\"&\");\n\t};\n\n\tconst update = async (originCode: string, destinationCode: string) => {\n\t\tconst loader = props.startLoading();\n\n\t\ttry {\n\t\t\tconst outbound = await getApiTimeTable(originCode, destinationCode);\n\t\t\tconst outboundDates = outbound?.outbound?.map(mapToSchedule) || [];\n\t\t\tif (outbound?.outbound?.length > 0) {\n\t\t\t\tsetOutboundMetadata(outbound.metadata);\n\t\t\t\tsetOutboundSchedules(outbound.outbound.map(mapToSchedule));\n\t\t\t}\n\n\t\t\tconst inbound =\n\t\t\t\t!window.JetSmart.TimetableOptions.IncludeReturnFlights && !props.isOneWay\n\t\t\t\t\t? await getApiTimeTable(destinationCode, originCode)\n\t\t\t\t\t: outbound;\n\n\t\t\tconst inboundDates = (\n\t\t\t\twindow.JetSmart.TimetableOptions.IncludeReturnFlights ? inbound?.inbound ?? [] : inbound?.outbound ?? []\n\t\t\t).map(mapToSchedule);\n\n\t\t\tif (inboundDates.length > 0) {\n\t\t\t\tsetInboundMetadata(inbound.metadata);\n\t\t\t\tsetInboundSchedules(inboundDates);\n\t\t\t}\n\t\t\treturn { newOutboundDates: outboundDates, newInboundDates: inboundDates };\n\t\t} finally {\n\t\t\tprops.stopLoading(loader);\n\t\t}\n\t};\n\n\tconst reset = () => {\n\t\tsetInboundMetadata(undefined);\n\t\tsetInboundSchedules(undefined);\n\t\tsetOutboundMetadata(undefined);\n\t\tsetOutboundSchedules(undefined);\n\t};\n\n\tconst updateOnSearchReload = async (originCode: string, destinationCode: string) => {\n\t\tif (!originCode || !destinationCode) return { newOutboundDates: [], newInboundDates: [] };\n\n\t\treset();\n\t\treturn update(originCode, destinationCode);\n\t};\n\n\tconst handleRouteChange = (originCode: string, destinationCode: string) => {\n\t\tif (props.forcedUpdateMode) return;\n\t\tif (!originCode || !destinationCode || !settings?.value?.currency) {\n\t\t\treset();\n\t\t\treturn;\n\t\t}\n\n\t\twindow.setTimeout(\n\t\t\t() => {\n\t\t\t\tconst doIt = async () => {\n\t\t\t\t\tawait update(originCode, destinationCode);\n\t\t\t\t\tpane.set(\"departure\");\n\t\t\t\t};\n\n\t\t\t\tvoid doIt();\n\t\t\t},\n\t\t\tisMobileResolution() ? 0 : 350\n\t\t);\n\t};\n\n\tuseEffect(\n\t\t() => handleRouteChange(props.originCode, props.destinationCode),\n\t\t[props.originCode, props.destinationCode, settings?.value?.currency]\n\t);\n\n\treturn {\n\t\tinboundMetadata,\n\t\tinboundSchedules,\n\t\toutboundMetadata,\n\t\toutboundSchedules,\n\t\tupdateOnSearchReload,\n\t};\n};\n","import { TestIdDictionary } from \"Services/test-ids/TestIdDictionary\";\nimport { CLASS_NAMES } from \"Services/ClassNames\";\nimport { html, useRef } from \"haunted\";\nimport i18next from \"i18next\";\nimport { useEffect, useMemo, useState } from \"Shared/haunted/CustomHooks\";\nimport { COMMON_DAYJS_FORMAT, OPEN_CLASS_NAME } from \"Services/constants\";\nimport { ChangeDateEvent, ChangeSelectedPriceEvent } from \"./dc-datepicker\";\nimport { ref } from \"Components/directives/ref\";\nimport { PUB_SUBS } from \"Services/pub-sub-service/PubSub\";\nimport getShowFarePriceForCulture from \"Shared/helpers/farePriceHelper\";\nimport { useTimeTable } from \"ComponentHelpers/useTimeTable\";\nimport { usePane } from \"../opening-pane/usePane\";\nimport { Schedule } from \"Shared/models/Schedule\";\nimport classNames from \"classnames\";\nimport * as CustomParseFormat from \"dayjs/plugin/customParseFormat\";\nimport * as isSameOrAfter from \"dayjs/plugin/isSameOrAfter\";\nimport * as isSameOrBefore from \"dayjs/plugin/isSameOrBefore\";\nimport dayjs, { Dayjs } from \"dayjs\";\nimport { useUserInfo } from \"ComponentHelpers/useUserInfo\";\ndayjs.extend(CustomParseFormat);\ndayjs.extend(isSameOrAfter);\ndayjs.extend(isSameOrBefore);\n\nexport interface Props {\n\tculture: string;\n\tisHidden: boolean;\n\tisOneWay: boolean;\n\tselectedDestination: string;\n\tselectedOrigin: string;\n\tusePrices: ShowFarePrices;\n\tshowRedemptionMiles: boolean;\n\tisRedemptionCheckboxChecked: boolean;\n\tstartLoading: () => void;\n\tstopLoading: (loader: any) => void;\n\ttimetableMaxMonthsFallback: number;\n}\n\nexport const useDateSelector = (props: Props) => {\n\tconst pane = usePane();\n\tconst userInfo = useUserInfo();\n\n\tconst datePane = useRef<HTMLDivElement>(undefined);\n\tconst fromDate = useRef<HTMLInputElement>(undefined);\n\tconst toDate = useRef<HTMLInputElement>(undefined);\n\n\tconst [currentDeparture, setCurrentDeparture] = useState<Dayjs>(undefined);\n\tconst [currentReturn, setCurrentReturn] = useState<Dayjs>(undefined);\n\tconst [isValidated, setIsValidated] = useState<boolean>(false);\n\tconst [selectedPriceInbound, setSelectedPriceInbound] = useState<string>(\"\");\n\tconst [selectedPriceOutbound, setSelectedPriceOutbound] = useState<string>(\"\");\n\tconst [forcedUpdateMode, setForcedUpdateMode] = useState<boolean>(false);\n\n\tconst timetable = useTimeTable({\n\t\tdestinationCode: props.selectedDestination,\n\t\tisOneWay: props.isOneWay,\n\t\toriginCode: props.selectedOrigin,\n\t\tforcedUpdateMode,\n\t\tstartLoading: props.startLoading,\n\t\tstopLoading: props.stopLoading,\n\t});\n\n\tconst isOpen = useMemo(() => pane.mode === \"departure\" || pane.mode === \"return\", [pane.mode]);\n\n\t// HELPERS\n\n\tconst onClickOutsideDate = (e: MouseEvent) => {\n\t\tconst path = e.composedPath && e.composedPath();\n\n\t\tconst isClickInside =\n\t\t\tpath.indexOf(fromDate.current) > -1 ||\n\t\t\tpath.indexOf(toDate.current) > -1 ||\n\t\t\tpath.indexOf(datePane.current) > -1;\n\n\t\tif (!isClickInside && isOpen) {\n\t\t\tpane.set(\"none\");\n\t\t}\n\t};\n\n\tconst validate = () => {\n\t\tsetIsValidated(true);\n\t\treturn Boolean(currentDeparture) && (Boolean(currentReturn) || props.isOneWay);\n\t};\n\n\tconst sortSchedulesForMin = (a: Schedule, b: Schedule) => (a.departureDate.isBefore(b.departureDate) ? -1 : 1);\n\tconst sortSchedulesForMax = (a: Schedule, b: Schedule) => (a.departureDate.isBefore(b.departureDate) ? 1 : -1);\n\n\tconst getMinDateOutbound = () => {\n\t\tconst firstOutbound = timetable.outboundSchedules?.sort(sortSchedulesForMin)[0]?.departureDate;\n\t\treturn firstOutbound?.isAfter(dayjs(), \"day\") ? dayjs(firstOutbound) : dayjs();\n\t};\n\n\tconst getMinDateInbound = () => {\n\t\tconst firstInbound = timetable.inboundSchedules?.sort(sortSchedulesForMin)[0]?.departureDate;\n\t\treturn currentDeparture && firstInbound?.isAfter(dayjs(currentDeparture), \"day\")\n\t\t\t? firstInbound\n\t\t\t: dayjs(currentDeparture);\n\t};\n\n\tconst getMaxDateOutbound = () => {\n\t\tconst lastOutbound = timetable.outboundSchedules?.sort(sortSchedulesForMax)[0]?.departureDate;\n\t\treturn lastOutbound ? dayjs(lastOutbound) : dayjs().add(props.timetableMaxMonthsFallback, \"months\");\n\t};\n\n\tconst getMaxDateInbound = () => {\n\t\tconst lastInbound = timetable.inboundSchedules?.sort(sortSchedulesForMax)[0]?.departureDate;\n\t\treturn lastInbound ? dayjs(lastInbound) : dayjs().add(props.timetableMaxMonthsFallback, \"months\");\n\t};\n\n\t// EVENT HANDLERS\n\n\tconst handleDateChange = (e: ChangeDateEvent) => {\n\t\tif (pane.mode === \"departure\") {\n\t\t\tsetCurrentDeparture(dayjs(e.detail.date));\n\t\t\tpane.set(props.isOneWay ? \"none\" : \"return\");\n\t\t} else {\n\t\t\tsetCurrentReturn(dayjs(e.detail.toDate));\n\t\t\tpane.set(\"none\");\n\t\t}\n\t};\n\n\tconst handlePriceChange = (e: ChangeSelectedPriceEvent) => {\n\t\tif (pane.mode === \"departure\") {\n\t\t\tsetSelectedPriceOutbound(e.detail.price);\n\t\t} else {\n\t\t\tsetSelectedPriceInbound(e.detail.price);\n\t\t}\n\t};\n\n\tconst handleDepartureClick = (e: MouseEvent) => {\n\t\te.preventDefault();\n\n\t\tpane.set(\"departure\");\n\t};\n\n\tconst handleReturnClick = (e: MouseEvent) => {\n\t\te.preventDefault();\n\n\t\tpane.set(\"return\");\n\t};\n\n\tconst updateOnSearchReload = async (\n\t\tselectedOrigin: string,\n\t\tselectedDestination: string,\n\t\tdepartureDate: string,\n\t\treturnDate?: string\n\t) => {\n\t\tif (!departureDate) return;\n\n\t\tsetForcedUpdateMode(true);\n\t\tconst { newOutboundDates, newInboundDates } = await timetable.updateOnSearchReload(\n\t\t\tselectedOrigin,\n\t\t\tselectedDestination\n\t\t);\n\n\t\tsetForcedUpdateMode(false);\n\n\t\tconst parsedDeparture = dayjs(departureDate, COMMON_DAYJS_FORMAT);\n\n\t\tif (parsedDeparture.isBefore(dayjs(), \"day\")) return;\n\n\t\tif (\n\t\t\tparsedDeparture &&\n\t\t\tnewOutboundDates?.length &&\n\t\t\t!newOutboundDates.some((s) => s.departureDate.isSame(parsedDeparture, \"day\"))\n\t\t) {\n\t\t\tsetCurrentDeparture(undefined);\n\t\t\treturn;\n\t\t}\n\n\t\tsetCurrentDeparture(parsedDeparture);\n\n\t\tconst parsedReturn = returnDate ? dayjs(returnDate, COMMON_DAYJS_FORMAT) : undefined;\n\n\t\tif (!parsedReturn) return;\n\n\t\tif (newInboundDates?.length && !newInboundDates.some((s) => s.departureDate.isSame(parsedReturn, \"day\"))) {\n\t\t\tsetCurrentReturn(undefined);\n\t\t\treturn;\n\t\t}\n\n\t\tif (parsedReturn.isSameOrAfter(parsedDeparture, \"day\")) setCurrentReturn(parsedReturn);\n\t};\n\n\tuseEffect(() => {\n\t\tif (isOpen) {\n\t\t\tconst handler = PUB_SUBS.DocumentClicked.subscribe((e) => onClickOutsideDate(e.mouseEvent));\n\t\t\treturn () => handler?.unsubscribe();\n\t\t}\n\t\treturn () => {};\n\t}, [fromDate?.current, toDate?.current, datePane?.current, isOpen]);\n\n\tuseEffect(() => {\n\t\tif (props.isOneWay || (currentReturn && currentDeparture?.isAfter(currentReturn, \"day\"))) {\n\t\t\tsetCurrentReturn(undefined);\n\t\t}\n\t}, [props.isOneWay, currentDeparture, currentReturn]);\n\n\tuseEffect(() => {\n\t\tif (forcedUpdateMode) return;\n\t\tsetCurrentDeparture(undefined);\n\t\tsetCurrentReturn(undefined);\n\t}, [props.selectedOrigin, props.selectedDestination, timetable.outboundSchedules]);\n\n\t// TEMPLATES\n\n\tconst calendarTemplate = () => {\n\t\tconst value =\n\t\t\tpane.mode === \"departure\"\n\t\t\t\t? currentDeparture || \"\"\n\t\t\t\t: [currentDeparture || \"\", currentReturn || currentDeparture || \"\"];\n\n\t\treturn isOpen\n\t\t\t? html`\n\t\t\t\t\t<dc-datepicker\n\t\t\t\t\t\t.culture=${props.culture}\n\t\t\t\t\t\t.isRange=${pane.mode === \"return\"}\n\t\t\t\t\t\t.max=${pane.mode === \"departure\" ? getMaxDateOutbound() : getMaxDateInbound()}\n\t\t\t\t\t\t.min=${pane.mode === \"departure\" ? getMinDateOutbound() : getMinDateInbound()}\n\t\t\t\t\t\t.availableDates=${pane.mode === \"departure\"\n\t\t\t\t\t\t\t? timetable.outboundSchedules\n\t\t\t\t\t\t\t: timetable.inboundSchedules}\n\t\t\t\t\t\t.metadata=${pane.mode === \"departure\" ? timetable.outboundMetadata : timetable.inboundMetadata}\n\t\t\t\t\t\t.value=${value}\n\t\t\t\t\t\t.usePrices=${getShowFarePriceForCulture(props.usePrices, props.culture)}\n\t\t\t\t\t\t.paneMode=${pane.mode}\n\t\t\t\t\t\t@changeDate=${handleDateChange}\n\t\t\t\t\t\t@changePrice=${handlePriceChange}\n\t\t\t\t\t></dc-datepicker>\n\t\t\t  `\n\t\t\t: \"\";\n\t};\n\n\tconst datepickerTemplate = () => html`\n\t\t<div\n\t\t\tref=${ref(datePane)}\n\t\t\tclass=${classNames(\"dg-calendar\", {\n\t\t\t\t[OPEN_CLASS_NAME]: isOpen,\n\t\t\t\t\"with-redemption-miles-and-promo-code\":\n\t\t\t\t\tprops.showRedemptionMiles && (!props.isRedemptionCheckboxChecked || !userInfo.IsAmericanMember),\n\t\t\t})}\n\t\t>\n\t\t\t<div class=\"hidden-sm-up dg-dp-closer\" @click=${() => pane.set(\"none\")}>&times;</div>\n\t\t\t${calendarTemplate()}\n\t\t</div>\n\t`;\n\n\tconst htmlTemplate = () => {\n\t\tconst isDepartureDisabled = !props.selectedOrigin || !props.selectedDestination;\n\t\tconst departureText = forcedUpdateMode\n\t\t\t? \"\"\n\t\t\t: !isDepartureDisabled\n\t\t\t? currentDeparture?.format(COMMON_DAYJS_FORMAT) || \"\"\n\t\t\t: \"\";\n\n\t\tconst isReturnDisabled =\n\t\t\t!props.selectedOrigin || !props.selectedDestination || !currentDeparture || props.isOneWay;\n\n\t\tconst returnText = forcedUpdateMode\n\t\t\t? \"\"\n\t\t\t: props.isOneWay\n\t\t\t? i18next.t(\"search-box-oneway\")\n\t\t\t: !isReturnDisabled\n\t\t\t? currentReturn?.format(COMMON_DAYJS_FORMAT) || \"\"\n\t\t\t: \"\";\n\n\t\treturn html`\n\t\t\t<div class=${classNames(\"dg-time-selector\", { \"hidden-xs\": props.isHidden })}>\n\t\t\t\t<input\n\t\t\t\t\tref=${ref(fromDate)}\n\t\t\t\t\tclass=${isValidated && !currentDeparture ? CLASS_NAMES.error : \"\"}\n\t\t\t\t\tautocomplete=\"disabled\"\n\t\t\t\t\treadonly\n\t\t\t\t\t?disabled=${isDepartureDisabled}\n\t\t\t\t\tvalue=${departureText}\n\t\t\t\t\t.value=${departureText}\n\t\t\t\t\tdata-test-id=${TestIdDictionary.Date.DepartureInput}\n\t\t\t\t\t@click=${handleDepartureClick}\n\t\t\t\t/>\n\t\t\t\t<input\n\t\t\t\t\tref=${ref(toDate)}\n\t\t\t\t\tclass=${isValidated && !currentReturn && !props.isOneWay ? CLASS_NAMES.error : \"\"}\n\t\t\t\t\tautocomplete=\"disabled\"\n\t\t\t\t\treadonly\n\t\t\t\t\t?disabled=${isReturnDisabled}\n\t\t\t\t\tvalue=${returnText}\n\t\t\t\t\t.value=${returnText}\n\t\t\t\t\tdata-test-id=${TestIdDictionary.Date.ReturnInput}\n\t\t\t\t\t@click=${handleReturnClick}\n\t\t\t\t/>\n\t\t\t\t<div class=\"dg-divider-arrow-time\"></div>\n\t\t\t\t<label>${i18next.t(\"search-box-from-date\")}</label>\n\t\t\t\t<label class=\"dg-return-date\">${i18next.t(\"search-box-to-date\")}</label>\n\t\t\t</div>\n\t\t\t${datepickerTemplate()}\n\t\t`;\n\t};\n\n\treturn {\n\t\tcurrentDeparture,\n\t\tcurrentReturn,\n\t\tselectedPriceInbound,\n\t\tselectedPriceOutbound,\n\t\thtmlTemplate,\n\t\tupdateOnSearchReload,\n\t\tvalidate,\n\t};\n};\n","import { ApiCountry, ApiStation } from \"Shared/models/ApiStations\";\n\nexport const getCountryAndStationByCode = (allCountries: ApiCountry[], stationCode: string) => {\n\ttry {\n\t\tconst station = getStationByCode(allCountries, stationCode) || \"\";\n\n\t\tif (!station) return { station: undefined, countryCode: \"\" };\n\n\t\tconst country = getStationCountryByStationCode(allCountries, stationCode);\n\t\tconst countryCode = country?.information.code || \"\";\n\n\t\treturn { station, countryCode };\n\t} catch {\n\t\treturn { station: undefined, countryCode: \"\" };\n\t}\n};\n\nexport const filterCountriesForPartialString = (countries: ApiCountry[], searchExpression: string): ApiCountry[] =>\n\t!searchExpression\n\t\t? countries\n\t\t: countries\n\t\t\t\t.map((country) => ({\n\t\t\t\t\t...country,\n\t\t\t\t\tregions: country.regions\n\t\t\t\t\t\t.map((region) => ({\n\t\t\t\t\t\t\t...region,\n\t\t\t\t\t\t\tstations: region.stations.filter((station) =>\n\t\t\t\t\t\t\t\tisSubstringInDisplayedName(station, searchExpression)\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t}))\n\t\t\t\t\t\t.filter((region) => region.stations.length > 0),\n\t\t\t\t}))\n\t\t\t\t.filter((country) => country.regions.length > 0);\n\nconst isSubstringInDisplayedName = (station: ApiStation, searchExpression: string) =>\n\tstation.information.displayName.toLowerCase().includes(searchExpression.toLowerCase());\n\nconst getStationByCode = (allCountries: ApiCountry[], stationCode: string): ApiStation =>\n\tallCountries.flatMap((c) => c.regions.flatMap((r) => r.stations)).find((s) => s.information.code === stationCode);\n\nconst getStationCountryByStationCode = (allCountries: ApiCountry[], stationCode: string): ApiCountry =>\n\tallCountries.find((c) => c.regions.flatMap((r) => r.stations).find((s) => s.information.code === stationCode));\n","import { sendAmplitudeExposure } from \"Services/amplitude/AmplitudeHelper\";\nimport { ApiCountry } from \"Shared/models/ApiStations\";\nimport { IStationOrderStrategy } from \"./useStationOrderStrategyFactory\";\n\nexport const alphabeticalOrderStrategy = (abTestSettings: AbTestSettings): (() => IStationOrderStrategy) => {\n\treturn () => ({\n\t\torderStations: (countries: ApiCountry[]): ApiCountry[] => {\n\t\t\treturn countries.map((country) => {\n\t\t\t\tconst stations = country.regions\n\t\t\t\t\t.flatMap((r) => r.stations)\n\t\t\t\t\t.sort((a, b) => a.information.displayName.localeCompare(b.information.displayName));\n\n\t\t\t\tcountry.regions = [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"\",\n\t\t\t\t\t\tstations,\n\t\t\t\t\t},\n\t\t\t\t];\n\n\t\t\t\treturn country;\n\t\t\t});\n\t\t},\n\n\t\tpostStep: async (): Promise<void> => {\n\t\t\tawait sendAmplitudeExposure([\n\t\t\t\t{\n\t\t\t\t\tExperimentId: abTestSettings.CorporateSetting.FlightSearchStationOrder.ExperimentId,\n\t\t\t\t\tVariant: abTestSettings.CorporateSetting.FlightSearchStationOrder.Variant,\n\t\t\t\t},\n\t\t\t]);\n\t\t},\n\t});\n};\n","export function padLeft(num: number, size = 2): string {\n\tlet text = String(Math.abs(num));\n\twhile (text.length < size) {\n\t\ttext = `0${text}`;\n\t}\n\n\treturn num < 0 ? `-${text}` : text;\n}\n\nexport function padRight(num: number, size = 2) {\n\tlet text = String(Math.abs(num));\n\twhile (text.length < size) {\n\t\ttext = `${text}0`;\n\t}\n\n\treturn num < 0 ? `-${text}` : text;\n}\n\nexport function isEmpty(text: string) {\n\treturn text === undefined || text === null || text.length === 0;\n}\n\nexport const areEqual = (first: string, second: string): boolean => {\n    return first?.toLowerCase() === second?.toLowerCase();\n};\n","import { areEqual } from \"Shared/helpers/stringHelper\";\nimport { ApiCountry, ApiRegion, ApiStation } from \"Shared/models/ApiStations\";\nimport { ApiStationSettings, LocalizedString } from \"Shared/models/ApiStationSettings\";\nimport { IStationOrderStrategy } from \"./useStationOrderStrategyFactory\";\n\nexport const resourceXmlOrderStrategy = (\n\tstationSettings: ApiStationSettings,\n\tculture: string\n): (() => IStationOrderStrategy) => {\n\tconst getRegionName = (name: LocalizedString) => {\n\t\tif (culture.startsWith(\"en\")) return name.En;\n\t\tif (culture.startsWith(\"pt\")) return name.Pt;\n\n\t\treturn name.Es;\n\t};\n\n\tconst getMarkets = (countries: ApiCountry[]): { [stationCode: string]: string[] } =>\n\t\tgetAllStations(countries)\n\t\t\t.map((station) => ({ [station.information.code]: station.markets }))\n\t\t\t.reduce((markets, market) => ({ ...markets, ...market }), {});\n\n\tconst getAllStations = (countries: ApiCountry[]): ApiStation[] =>\n\t\tcountries.flatMap((c) => c.regions.flatMap((r) => r.stations));\n\n\t// TODO Further refactor this\n\treturn () => ({\n\t\torderStations: (countries: ApiCountry[]): ApiCountry[] => {\n\t\t\tif (window.JetSmart.StationsOptions.Mode !== \"Legacy\") return countries; // DEVNOTE: Lambda already orders the stations\n\n\t\t\tconst orderedCountries = stationSettings.CountryOrdersPerCulture.find((country) =>\n\t\t\t\tareEqual(country.Culture, culture)\n\t\t\t).Countries;\n\n\t\t\tconst markets = getMarkets(countries);\n\t\t\tconst stations = getAllStations(countries);\n\n\t\t\treturn orderedCountries.map(\n\t\t\t\t(orderedCountry): ApiCountry => ({\n\t\t\t\t\tinformation: {\n\t\t\t\t\t\tcode: orderedCountry,\n\t\t\t\t\t\tname: countries.find((country) => areEqual(country.information.code, orderedCountry))\n\t\t\t\t\t\t\t.information.name,\n\t\t\t\t\t},\n\t\t\t\t\tregions: stationSettings.Countries.find((country) =>\n\t\t\t\t\t\tareEqual(country.Code, orderedCountry)\n\t\t\t\t\t).Regions.map(\n\t\t\t\t\t\t(region): ApiRegion => ({\n\t\t\t\t\t\t\tname: getRegionName(region.Name),\n\t\t\t\t\t\t\tstations: region.Stations.filter(\n\t\t\t\t\t\t\t\t(regionStation) => !regionStation.IsHidden && markets[regionStation.Code]?.length > 0\n\t\t\t\t\t\t\t).map(\n\t\t\t\t\t\t\t\t(regionStation): ApiStation => ({\n\t\t\t\t\t\t\t\t\tinformation: stations.find((station) =>\n\t\t\t\t\t\t\t\t\t\tareEqual(station.information.code, regionStation.Code)\n\t\t\t\t\t\t\t\t\t)?.information,\n\t\t\t\t\t\t\t\t\tmarkets: markets[regionStation.Code],\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t})\n\t\t\t\t\t),\n\t\t\t\t})\n\t\t\t);\n\t\t},\n\n\t\tpostStep: async (): Promise<void> => Promise.resolve(),\n\t});\n};\n","import { ApiCountry } from \"Shared/models/ApiStations\";\nimport { alphabeticalOrderStrategy } from \"./alphabeticalOrderStrategy\";\nimport { resourceXmlOrderStrategy } from \"./resourceXmlOrderStrategy\";\nimport { useNavitaireSettings } from \"ComponentHelpers/useNavitaireSettings\";\n\ntype StationOrder = \"FromResourceXml\" | \"AlphabeticalAsc\";\n\nexport interface IStationOrderStrategy {\n\torderStations: (countries: ApiCountry[]) => ApiCountry[];\n\tpostStep: () => Promise<void>;\n}\n\nexport const useStationOrderStrategyFactory = (culture: string) => {\n\tconst settings = useNavitaireSettings();\n\n\tconst orderStrategyMap = new Map<StationOrder, () => IStationOrderStrategy>([\n\t\t[\"AlphabeticalAsc\", alphabeticalOrderStrategy(settings?.value?.abTestSettings)],\n\t\t[\"FromResourceXml\", resourceXmlOrderStrategy(settings?.value?.stationSettings, culture)],\n\t]);\n\n\tconst getStationOrder = (): StationOrder => {\n\t\tconst alphabeticalAscVariant = settings?.value?.abTestSettings?.CorporateSetting.FlightSearchStationOrder;\n\t\tconst variant = window.JetSmart.Variants.find(\n\t\t\t(v) =>\n\t\t\t\tv.ExperimentId === alphabeticalAscVariant.ExperimentId &&\n\t\t\t\tv.VariantKey === alphabeticalAscVariant.Variant\n\t\t);\n\t\treturn variant ? \"AlphabeticalAsc\" : \"FromResourceXml\";\n\t};\n\n\tconst create = (): (() => IStationOrderStrategy) => {\n\t\tconst order = getStationOrder();\n\t\treturn orderStrategyMap.get(order);\n\t};\n\n\treturn { create };\n};\n","import { ApiStations, ApiCountry, ApiStation } from \"Shared/models/ApiStations\";\nimport { API_STATION_URL, CHILE_COUNTRY_CODE } from \"Services/constants\";\nimport { RouteSelectorOpts } from \"ComponentModels/RouteSelectorOpts\";\nimport { locale } from \"Services/Globals\";\nimport { useState } from \"haunted\";\nimport { useNavitaireSettings } from \"./useNavitaireSettings\";\nimport { useEffect } from \"Shared/haunted/CustomHooks\";\nimport { removeTrailingSlash } from \"Services/common\";\nimport { createHeaders } from \"./HeaderHelper\";\nimport { useStationOrderStrategyFactory } from \"./Strategies/useStationOrderStrategyFactory\";\nimport { useUserInfo } from \"./useUserInfo\";\n\ninterface StationProps {\n\topts: RouteSelectorOpts;\n\tstartLoading: () => LoaderInstance;\n\tstopLoading: (loader: LoaderInstance) => void;\n}\n\nexport const useStations = (props: StationProps): [ApiCountry[], (city: ApiStation) => ApiCountry[]] => {\n\tconst navitaireSettings = useNavitaireSettings();\n\tconst factory = useStationOrderStrategyFactory(props.opts.culture);\n\n\tconst [countryStations, setCountryStations] = useState<ApiCountry[]>([]);\n\tconst [loader, setLoader] = useState<LoaderInstance>();\n\n\tconst userInfo = useUserInfo();\n\n\tconst isCountryAvailable = (apiCountry: ApiCountry): boolean => {\n\t\tif (!navitaireSettings?.value?.stationSettings) throw new Error(\"No StationSettings\");\n\n\t\treturn navitaireSettings?.value?.stationSettings.Countries.some(\n\t\t\t(country) =>\n\t\t\t\tcountry.Code.toLowerCase() === apiCountry.information.code.toLowerCase() &&\n\t\t\t\t!country.IsHidden &&\n\t\t\t\t((!userInfo.IsPeruCompraMember && !userInfo.IsPeruCompraAdmin) || country.IsAvailableForPeruCompras) &&\n\t\t\t\t(country.Code.toLowerCase() === CHILE_COUNTRY_CODE.toLowerCase() ||\n\t\t\t\t\t(!userInfo.IsCug3Observer && !userInfo.IsCug3Supervisor))\n\t\t);\n\t};\n\n\tconst availableDestinationCountriesForStation = (city: ApiStation): ApiCountry[] =>\n\t\tcountryStations\n\t\t\t.map((country) => ({\n\t\t\t\t...country,\n\t\t\t\tregions: country.regions\n\t\t\t\t\t.map((region) => ({\n\t\t\t\t\t\t...region,\n\t\t\t\t\t\tstations: region.stations.filter((station) => city.markets.includes(station.information.code)),\n\t\t\t\t\t}))\n\t\t\t\t\t.filter((region) => region.stations.length > 0),\n\t\t\t}))\n\t\t\t.filter((country) => country.regions.length > 0);\n\n\tconst loadApiCountries = async (): Promise<ApiCountry[]> => {\n\t\tconst headers = createHeaders();\n\n\t\tconst url = createStationsUrl();\n\t\tconst response = await fetch(url, { headers });\n\n\t\tif (response.ok) {\n\t\t\tconst responseJson = (await response.json()) as ApiStations;\n\n\t\t\treturn responseJson.countries;\n\t\t} else {\n\t\t\tthrow new Error(\"Network response was not ok.\");\n\t\t}\n\t};\n\n\tconst createStationsUrl = () => {\n\t\tif (window.JetSmart.StationsOptions.Mode === \"DirectFareCache\") {\n\t\t\tconst baseUrl = removeTrailingSlash(window.JetSmart.StationsOptions.BaseAddress);\n\n\t\t\treturn `${baseUrl}/stations?culture=${locale}`;\n\t\t}\n\n\t\treturn `${API_STATION_URL}?locale=${locale}`;\n\t};\n\n\tconst loadStations = async () => {\n\t\tsetLoader(props.startLoading());\n\t\tconst countries = await loadApiCountries();\n\t\tconst strategy = factory.create();\n\t\tconst orderedCountries = strategy().orderStations(countries);\n\t\tawait strategy().postStep();\n\t\tconst filteredCountries = orderedCountries.filter(isCountryAvailable);\n\n\t\tsetCountryStations(filteredCountries);\n\t};\n\n\tuseEffect(async () => {\n\t\tif (navitaireSettings?.value?.abTestSettings && navitaireSettings?.value?.stationSettings) {\n\t\t\tawait loadStations();\n\t\t}\n\t}, [navitaireSettings?.value]);\n\n\tuseEffect(() => {\n\t\tif (countryStations?.length > 0 && loader) props.stopLoading(loader);\n\t}, [countryStations]);\n\n\treturn [countryStations, availableDestinationCountriesForStation];\n};\n","import { JetSmartEvent } from \"Services/eventbus/JetSmartEvent\";\nimport { ApiStation } from \"Shared/models/ApiStations\";\nimport { Dayjs } from \"dayjs\";\n\nexport const eventBusTriggerOriginSelected = (city: ApiStation) => {\n\twindow.eventBus.raiseEvent({\n\t\tname: JetSmartEvent.OriginStationClick,\n\t\tparams: {\n\t\t\tid: \"searchbox.origin\",\n\t\t\tevent: \"click\",\n\t\t\tdata: {\n\t\t\t\tselectedStation: city.information.code,\n\t\t\t},\n\t\t},\n\t});\n};\n\nexport const eventBusTriggerDestinationSelected = (city: ApiStation) => {\n\twindow.eventBus.raiseEvent({\n\t\tname: JetSmartEvent.DestinationStationClick,\n\t\tparams: {\n\t\t\tid: \"searchbox.destination\",\n\t\t\tevent: \"click\",\n\t\t\tdata: {\n\t\t\t\tselectedStation: city.information.code,\n\t\t\t},\n\t\t},\n\t});\n};\n\nexport const eventBusTriggerOutboundDateSelected = (fromDate: Dayjs) => {\n\twindow.eventBus.raiseEvent({\n\t\tname: JetSmartEvent.DepartureDateSelected,\n\t\tparams: {\n\t\t\tid: \"searchbox.departureDate\",\n\t\t\tevent: \"click\",\n\t\t\tdata: {\n\t\t\t\tselectedDate: fromDate.toDate().toString(),\n\t\t\t},\n\t\t},\n\t});\n};\n\nexport const eventBusTriggerInboundDateSelected = (toDate: Dayjs) => {\n\twindow.eventBus.raiseEvent({\n\t\tname: JetSmartEvent.ReturnDateSelected,\n\t\tparams: {\n\t\t\tid: \"searchbox.returnDate\",\n\t\t\tevent: \"click\",\n\t\t\tdata: {\n\t\t\t\tselectedDate: toDate.toDate().toString(),\n\t\t\t},\n\t\t},\n\t});\n};\n\n// BOTH\n\nexport const eventBusTriggerSelectReturnType = () => {\n\twindow.eventBus.raiseEvent({\n\t\tname: JetSmartEvent.RoundTripSelected,\n\t\tparams: {\n\t\t\tid: \"searchbox.roundtrip\",\n\t\t\tevent: \"click\",\n\t\t},\n\t});\n};\n\nexport const eventBusTriggerSelectOneWayType = () => {\n\twindow.eventBus.raiseEvent({\n\t\tname: JetSmartEvent.OneWayTripSelected,\n\t\tparams: {\n\t\t\tid: \"searchbox.onewaytrip\",\n\t\t\tevent: \"click\",\n\t\t},\n\t});\n};\n","import { CLASS_NAMES } from \"Services/ClassNames\";\nimport { useEffect, useState } from \"Shared/haunted/CustomHooks\";\nimport { filterCountriesForPartialString, getCountryAndStationByCode } from \"ComponentHelpers/StationHelper\";\nimport { html, useRef } from \"haunted\";\nimport i18next from \"i18next\";\nimport DomCrawlingHelper from \"Services/DomCrawlingHelper\";\nimport PerfectScrollbar from \"perfect-scrollbar\";\nimport { ref } from \"Components/directives/ref\";\nimport { usePane } from \"../opening-pane/usePane\";\nimport { isMobileResolution } from \"Services/common\";\nimport { TestIdDictionary } from \"Services/test-ids/TestIdDictionary\";\nimport { getTestId } from \"Services/test-ids/TestIdHelper\";\nimport { PUB_SUBS } from \"Services/pub-sub-service/PubSub\";\nimport { useStations } from \"ComponentHelpers/useStations\";\nimport { ApiCountry, ApiRegion, ApiStation } from \"Shared/models/ApiStations\";\nimport classNames from \"classnames\";\nimport {\n\teventBusTriggerOriginSelected,\n\teventBusTriggerDestinationSelected,\n} from \"ComponentHelpers/SearchboxEventBusHelpers\";\nimport { useUserInfo } from \"ComponentHelpers/useUserInfo\";\n\nexport interface Props {\n\tculture: string;\n\tcurrentPromoCode: string;\n\tdefaultRouteCountrySettings: DefaultRouteCountrySetting[];\n\tshowRedemptionMiles: boolean;\n\tisRedemptionCheckboxChecked: boolean;\n\tsetIsCollapsed: (newState: boolean) => void;\n\tstartLoading: () => LoaderInstance;\n\tstopLoading: (loader: any) => void;\n}\n\nconst listItemClassName = \"dg-ts-list-item\";\n\nexport const useRouteSelector = (props: Props) => {\n\tconst pane = usePane();\n\tconst userInfo = useUserInfo();\n\n\tconst getDefaultCountry = (endpoint: \"origin\" | \"destination\"): string =>\n\t\tprops.defaultRouteCountrySettings\n\t\t\t?.find((setting) => setting.Culture.toLowerCase() === props.culture.toLowerCase())\n\t\t\t?.[endpoint === \"origin\" ? \"DefaultOriginCountryCode\" : \"DefaultDestinationCountryCode\"]?.toUpperCase() ||\n\t\t\"\";\n\n\tconst citySelector = useRef<HTMLUListElement>(undefined);\n\tconst countryList = useRef<HTMLUListElement>(undefined);\n\tconst fromCity = useRef<HTMLInputElement>(undefined);\n\tconst locationSelector = useRef<HTMLDivElement>(undefined);\n\tconst mobileList = useRef<HTMLUListElement>(undefined);\n\tconst mobileSearchField = useRef<HTMLInputElement>(undefined);\n\tconst toCity = useRef<HTMLInputElement>(undefined);\n\tconst typingResults = useRef<HTMLUListElement>(undefined);\n\n\tconst [displayedData, setDisplayedData] = useState<ApiCountry[]>([]);\n\tconst [isValidated, setIsValidated] = useState<boolean>(false);\n\tconst [searchExpressionDestination, setSearchExpressionDestination] = useState<string>(\"\");\n\tconst [searchExpressionOrigin, setSearchExpressionOrigin] = useState<string>(\"\");\n\tconst [selectedDestination, setSelectedDestination] = useState<ApiStation>(undefined);\n\tconst [selectedDestinationCountryCode, setSelectedDestinationCountryCode] = useState<string>(\n\t\tgetDefaultCountry(\"destination\")\n\t);\n\tconst [selectedOrigin, setSelectedOrigin] = useState<ApiStation>(undefined);\n\tconst [selectedOriginCountryCode, setSelectedOriginCountryCode] = useState<string>(getDefaultCountry(\"origin\"));\n\n\tconst [cityScroller, setCityScroller] = useState<PerfectScrollbar>(undefined);\n\tconst [countryScroller, setCountryScroller] = useState<PerfectScrollbar>(undefined);\n\tconst [mobileListScroller, setMobileListScroller] = useState<PerfectScrollbar>(undefined);\n\tconst [typingResultScroller, setTypingResultScroller] = useState<PerfectScrollbar>(undefined);\n\n\tconst [allCountries, availableDestinationCountriesForStation] = useStations({\n\t\topts: { culture: props.culture },\n\t\tstartLoading: () => props.startLoading(),\n\t\tstopLoading: (loader) => props.stopLoading(loader),\n\t});\n\n\t// Helpers\n\n\tconst validate = () => {\n\t\tsetIsValidated(true);\n\t\treturn Boolean(selectedOrigin) && Boolean(selectedDestination);\n\t};\n\n\tconst handleOriginSelect = (city: ApiStation) => {\n\t\teventBusTriggerOriginSelected(city);\n\t\tsetSelectedOrigin(city);\n\t\tsetSelectedDestination(undefined);\n\t\tsetSelectedDestinationCountryCode(undefined);\n\t\topenDestinationSelector(undefined, city);\n\t\tpane.set(\"destination\");\n\t\tclearAllSearchFields();\n\t};\n\n\tconst handleDestinationSelect = (city: ApiStation) => {\n\t\teventBusTriggerDestinationSelected(city);\n\n\t\tsetSelectedDestination(city);\n\t\tpane.set(\"none\");\n\t\tclearAllSearchFields();\n\t};\n\n\tconst onClickOutsideRoute = (evt: MouseEvent) => {\n\t\tconst path = evt.composedPath && evt.composedPath();\n\n\t\tconst isClickInside =\n\t\t\tpath.indexOf(fromCity.current) > -1 ||\n\t\t\tpath.indexOf(toCity.current) > -1 ||\n\t\t\tpath.indexOf(locationSelector.current) > -1;\n\n\t\tif (!isClickInside && (pane.mode === \"origin\" || pane.mode === \"destination\")) {\n\t\t\tpane.set(\"none\");\n\t\t\tclearAllSearchFields();\n\t\t}\n\t};\n\n\tconst addPerfectScrollbar = () => {\n\t\t[countryScroller, cityScroller, typingResultScroller, mobileListScroller].forEach((sc) => sc?.destroy());\n\n\t\tif (countryList?.current) {\n\t\t\tsetCountryScroller(instantiatePerfectScrollbar(countryList.current));\n\t\t\tcountryList.current.scrollTop = 0;\n\t\t}\n\n\t\tif (citySelector?.current) {\n\t\t\tsetCityScroller(instantiatePerfectScrollbar(citySelector.current));\n\t\t\tif ((pane.mode === \"origin\" && !selectedOrigin) || (pane.mode === \"destination\" && !selectedDestination)) {\n\t\t\t\tcitySelector.current.scrollTop = 0;\n\t\t\t}\n\t\t}\n\n\t\tif (typingResults?.current) {\n\t\t\tsetTypingResultScroller(instantiatePerfectScrollbar(typingResults.current));\n\t\t\ttypingResults.current.scrollTop = 0;\n\t\t}\n\n\t\tif (mobileList?.current) {\n\t\t\tsetMobileListScroller(instantiatePerfectScrollbar(mobileList.current));\n\t\t\tmobileList.current.scrollTop = 0;\n\t\t}\n\t};\n\n\tconst instantiatePerfectScrollbar = (element: HTMLElement) =>\n\t\tnew PerfectScrollbar(element, {\n\t\t\twheelPropagation: false,\n\t\t\twheelSpeed: 0.2,\n\t\t\tswipeEasing: true,\n\t\t\tsuppressScrollX: true,\n\t\t});\n\n\tconst isSelectedOriginCountry = (countryCode: string) =>\n\t\tpane.mode === \"origin\" && selectedOriginCountryCode && selectedOriginCountryCode === countryCode;\n\n\tconst isSelectedDestinationCountry = (countryCode: string) =>\n\t\tpane.mode === \"destination\" && selectedDestinationCountryCode && selectedDestinationCountryCode === countryCode;\n\n\tconst isSelectedOriginCity = (cityCode: string) =>\n\t\tpane.mode === \"origin\" && selectedOrigin && selectedOrigin.information.code === cityCode;\n\n\tconst isSelectedDestinationCity = (cityCode: string) =>\n\t\tpane.mode === \"destination\" && selectedDestination && selectedDestination.information.code === cityCode;\n\n\tconst showCitySelector = () =>\n\t\tBoolean(\n\t\t\t(pane.mode === \"origin\" && selectedOriginCountryCode) ||\n\t\t\t\t(pane.mode === \"destination\" && selectedDestinationCountryCode)\n\t\t);\n\n\tconst scrollToCity = (code: string) => {\n\t\tconst elem = isMobileResolution() ? mobileList?.current : citySelector?.current;\n\t\tconst selectedCityListItem = getSelectedListElem(elem, code);\n\n\t\tif (areContainerAndItemVisible(elem, selectedCityListItem)) {\n\t\t\telem.scrollTop = 0;\n\t\t\tscrollContainerToItem(elem, selectedCityListItem);\n\t\t}\n\t};\n\n\tconst scrollToCountry = (code: string) => {\n\t\tconst elem = isMobileResolution() ? mobileList?.current : countryList?.current;\n\t\tconst selectedCountryListItem = getSelectedListElem(elem, code);\n\n\t\tif (areContainerAndItemVisible(elem, selectedCountryListItem)) {\n\t\t\tscrollContainerToItem(elem, selectedCountryListItem);\n\t\t}\n\t};\n\n\tconst getSelectedListElem = (container: HTMLElement, code: string) => {\n\t\tif (!container) return undefined;\n\n\t\t// FIXME This is not very elegant\n\t\treturn DomCrawlingHelper.getArrayOfClass(container, listItemClassName).find(\n\t\t\t(item) => item.dataset.testValue?.toLowerCase() === code.toLowerCase()\n\t\t) as HTMLLIElement;\n\t};\n\n\tconst areContainerAndItemVisible = (container: HTMLElement, item: HTMLLIElement) =>\n\t\titem && item.offsetHeight > 0 && container && container.offsetHeight > 0;\n\n\tconst scrollContainerToItem = (container: HTMLElement, item: HTMLLIElement) => {\n\t\tlet counter = 0;\n\n\t\twhile (isItemBelowContainer(container, item) && counter < 500) {\n\t\t\tcontainer.scrollTop++;\n\t\t\tcounter++;\n\t\t}\n\n\t\twhile (isItemAboveContainer(container, item) && counter < 500) {\n\t\t\tcontainer.scrollTop--;\n\t\t\tcounter++;\n\t\t}\n\t};\n\n\tconst isItemAboveContainer = (container: HTMLElement, item: HTMLLIElement) =>\n\t\titem.getBoundingClientRect().top < container.getBoundingClientRect().top;\n\n\tconst isItemBelowContainer = (container: HTMLElement, item: HTMLLIElement) =>\n\t\titem.getBoundingClientRect().bottom > container.getBoundingClientRect().bottom;\n\n\tconst regionsToDisplay = () => {\n\t\tconst code = selectedCountryCode();\n\t\treturn code ? displayedData?.find((c) => c.information.code === code)?.regions || [] : [];\n\t};\n\n\tconst isCountrySelected = (code: string) => isSelectedOriginCountry(code) || isSelectedDestinationCountry(code);\n\n\tconst isCitySelected = (code: string) => isSelectedOriginCity(code) || isSelectedDestinationCity(code);\n\n\tconst mobileLocationHeaderText = () =>\n\t\tpane.mode === \"destination\" ? i18next.t(\"search-box-destination\") : i18next.t(\"search-box-origin\");\n\n\tconst showPane = () => pane.mode === \"origin\" || pane.mode === \"destination\";\n\n\tconst selectedCountryCode = () => {\n\t\tif (pane.mode === \"destination\") return selectedDestinationCountryCode;\n\n\t\tif (pane.mode === \"origin\") return selectedOriginCountryCode;\n\n\t\tif (pane.mode === \"none\") {\n\t\t\treturn pane.lastOpenMode === \"destination\" ? selectedDestinationCountryCode : selectedOriginCountryCode;\n\t\t}\n\n\t\treturn undefined;\n\t};\n\n\tconst autoSelectTheOnlyCountry = () => {\n\t\tconst autoSelectedCountry = displayedData.length === 1 ? displayedData[0].information.code : \"\";\n\n\t\tif (!autoSelectedCountry) return;\n\n\t\tif (pane.mode === \"origin\") setSelectedOriginCountryCode(autoSelectedCountry);\n\n\t\tif (pane.mode === \"destination\") setSelectedDestinationCountryCode(autoSelectedCountry);\n\t};\n\n\tconst clearAllSearchFields = () => {\n\t\tif (mobileSearchField?.current) mobileSearchField.current.value = \"\";\n\n\t\tsetSearchExpressionOrigin(\"\");\n\t\tsetSearchExpressionDestination(\"\");\n\t};\n\n\t// Event listeners\n\n\tconst openOriginSelectorForChange = () => {\n\t\tif (mobileSearchField.current) {\n\t\t\tmobileSearchField.current.value = selectedOrigin.information.displayName;\n\t\t}\n\n\t\twindow.setTimeout(() => {\n\t\t\tscrollToCountry(selectedOriginCountryCode);\n\t\t\tscrollToCity(selectedOrigin.information.code);\n\t\t\tmobileSearchField.current?.focus();\n\t\t}, 500);\n\t};\n\n\tconst openOriginSelectorEmpty = () => {\n\t\tconst newSelectedOriginCountryCode = selectedOriginCountryCode || allCountries[0].information.code;\n\t\tsetSelectedOriginCountryCode(newSelectedOriginCountryCode);\n\n\t\twindow.setTimeout(() => {\n\t\t\tscrollToCountry(selectedOriginCountryCode);\n\t\t}, 500);\n\n\t\tif (isMobileResolution()) fromCity.current.blur();\n\t};\n\n\tconst openOriginSelector = (e?: MouseEvent) => {\n\t\te?.stopPropagation();\n\t\tprops.setIsCollapsed(false);\n\n\t\tif (searchExpressionOrigin) return;\n\n\t\tpane.set(\"origin\");\n\t\tclearAllSearchFields();\n\n\t\tif (selectedOrigin) {\n\t\t\topenOriginSelectorForChange();\n\t\t} else {\n\t\t\topenOriginSelectorEmpty();\n\t\t}\n\t};\n\n\tconst openDestinationSelectorForChange = () => {\n\t\tif (mobileSearchField.current) {\n\t\t\tmobileSearchField.current.value = selectedDestination.information.displayName;\n\t\t}\n\n\t\twindow.setTimeout(() => {\n\t\t\tmobileSearchField.current?.focus();\n\t\t\tscrollToCity(selectedDestination.information.code);\n\t\t\tscrollToCountry(selectedDestinationCountryCode);\n\t\t}, 750);\n\t};\n\n\tconst openDestinationSelectorEmpty = (city: ApiStation) => {\n\t\tconst newSelectedDestinationCountryCode =\n\t\t\tselectedDestinationCountryCode || availableDestinationCountriesForStation(city)[0]?.information?.code;\n\n\t\tsetSelectedDestinationCountryCode(newSelectedDestinationCountryCode);\n\n\t\twindow.setTimeout(() => {\n\t\t\tscrollToCountry(newSelectedDestinationCountryCode);\n\n\t\t\tif (isMobileResolution()) {\n\t\t\t\ttoCity.current.blur();\n\t\t\t}\n\t\t}, 750);\n\t};\n\n\tconst openDestinationSelector = (e: MouseEvent, city = selectedOrigin) => {\n\t\te?.stopPropagation();\n\n\t\tif (searchExpressionDestination) return;\n\n\t\tpane.set(\"destination\");\n\t\tclearAllSearchFields();\n\n\t\tif (selectedDestination) {\n\t\t\topenDestinationSelectorForChange();\n\t\t} else {\n\t\t\topenDestinationSelectorEmpty(city);\n\t\t}\n\t};\n\n\tconst handleMobileLocationSelectorClose = (e: MouseEvent) => {\n\t\te.stopPropagation();\n\t\tpane.set(\"none\");\n\t\tclearAllSearchFields();\n\t};\n\n\tconst selectCountry = (e: MouseEvent, country: ApiCountry) => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\n\t\tif (mobileList.current) mobileList.current.scrollTop = 0;\n\n\t\tif (pane.mode === \"origin\") {\n\t\t\thandleOriginCountrySelect(country);\n\t\t\treturn;\n\t\t}\n\n\t\thandleDestinationCountrySelect(country);\n\t};\n\n\tconst handleDestinationCountrySelect = (country: ApiCountry) => {\n\t\tif (isMobileResolution() && selectedDestinationCountryCode === country.information.code) {\n\t\t\tsetSelectedDestinationCountryCode(undefined);\n\t\t} else {\n\t\t\tsetSelectedDestinationCountryCode(country.information.code);\n\t\t}\n\t};\n\n\tconst handleOriginCountrySelect = (country: ApiCountry) => {\n\t\tif (isMobileResolution() && selectedOriginCountryCode === country.information.code) {\n\t\t\tsetSelectedOriginCountryCode(undefined);\n\t\t} else {\n\t\t\tsetSelectedOriginCountryCode(country.information.code);\n\t\t}\n\t};\n\n\tconst selectCity = async (e: MouseEvent, city: ApiStation) => {\n\t\te?.preventDefault();\n\t\te?.stopPropagation();\n\n\t\tclearAllSearchFields();\n\n\t\tif (pane.mode === \"origin\") handleOriginSelect(city);\n\n\t\tif (pane.mode === \"destination\") handleDestinationSelect(city);\n\t};\n\n\tconst handleTypeInOrigin = () => {\n\t\tif (pane.mode !== \"origin\") {\n\t\t\tpane.set(\"origin\");\n\t\t}\n\n\t\tsetSearchExpressionOrigin(fromCity.current.value);\n\t\tsetSelectedOrigin(undefined);\n\t\tsetSelectedDestination(undefined);\n\t\tsetSelectedDestinationCountryCode(undefined);\n\t};\n\n\tconst handleTypeInDestination = () => {\n\t\tif (pane.mode !== \"destination\") pane.set(\"destination\");\n\n\t\tsetSearchExpressionDestination(toCity.current.value);\n\t\tsetSelectedDestination(undefined);\n\t};\n\n\tconst handleTypeInMobile = () => {\n\t\tif (pane.mode === \"origin\") {\n\t\t\tsetSearchExpressionOrigin(mobileSearchField.current.value);\n\t\t\tsetSelectedOrigin(undefined);\n\t\t\tsetSelectedDestination(undefined);\n\t\t\tsetSelectedDestinationCountryCode(undefined);\n\t\t\tsetSearchExpressionDestination(\"\");\n\t\t} else {\n\t\t\tsetSearchExpressionDestination(mobileSearchField.current.value);\n\t\t\tsetSelectedDestination(undefined);\n\t\t}\n\t};\n\n\tconst updateOnSearchReload = (originCode: string, destinationCode: string) => {\n\t\tif (!originCode || !destinationCode) return;\n\n\t\tconst origin = getCountryAndStationByCode(allCountries, originCode);\n\t\tconst destination = getCountryAndStationByCode(allCountries, destinationCode);\n\n\t\tsetSelectedOrigin(origin.station);\n\t\tsetSelectedOriginCountryCode(origin.countryCode);\n\n\t\tsetSelectedDestination(destination.station);\n\t\tsetSelectedDestinationCountryCode(destination.countryCode);\n\t};\n\n\tuseEffect(() => {\n\t\tif (pane.mode === \"origin\") {\n\t\t\tconst data = searchExpressionOrigin\n\t\t\t\t? filterCountriesForPartialString(allCountries, searchExpressionOrigin)\n\t\t\t\t: allCountries;\n\t\t\tsetDisplayedData(data);\n\t\t}\n\n\t\tif (pane.mode === \"destination\" && selectedOrigin) {\n\t\t\tconst availableDestinations = availableDestinationCountriesForStation(selectedOrigin);\n\t\t\tconst data = searchExpressionDestination\n\t\t\t\t? filterCountriesForPartialString(availableDestinations, searchExpressionDestination)\n\t\t\t\t: availableDestinations;\n\t\t\tsetDisplayedData(data);\n\t\t}\n\t}, [\n\t\tpane.mode,\n\t\tallCountries,\n\t\tsearchExpressionOrigin,\n\t\tselectedOrigin,\n\t\tselectedOriginCountryCode,\n\t\tsearchExpressionDestination,\n\t]);\n\n\tuseEffect(autoSelectTheOnlyCountry, [displayedData]);\n\n\tuseEffect(() => {\n\t\twindow.setTimeout(() => addPerfectScrollbar(), 0);\n\t}, [pane.mode, displayedData]);\n\n\tuseEffect(() => {\n\t\tif (pane.mode === \"origin\" || pane.mode === \"destination\") {\n\t\t\tconst sub = PUB_SUBS.DocumentClicked.subscribe((e) => onClickOutsideRoute(e.mouseEvent));\n\t\t\treturn () => sub.unsubscribe();\n\t\t}\n\t\treturn () => {};\n\t}, [pane.mode, fromCity?.current, toCity?.current, locationSelector?.current]);\n\n\tuseEffect(() => {\n\t\tcitySelector.current.scrollTop = 0;\n\t}, [selectedOriginCountryCode, selectedDestinationCountryCode]);\n\n\t// Templates\n\n\tconst inputFieldsTemplate = () => html`\n\t\t<div class=\"dg-route-selector\">\n\t\t\t${fromTemplate()}\n\t\t\t<i class=\"jsh-icon jsh-chevron-right route-icon route-icon-departure\"></i>\n\t\t\t${toTemplate()}\n\t\t\t<i class=\"jsh-icon jsh-chevron-right route-icon route-icon-destination\"></i>\n\t\t\t<div class=\"dg-divider-arrow-route\"></div>\n\t\t</div>\n\t`;\n\n\tconst fromTemplate = () => html`\n\t\t<input\n\t\t\tref=${ref(fromCity)}\n\t\t\tclass=${classNames({\n\t\t\t\t\"in-focus\": pane.mode === \"origin\",\n\t\t\t\t[CLASS_NAMES.error]: isValidated && !selectedOrigin,\n\t\t\t})}\n\t\t\tplaceholder=${i18next.t(\"search-box-origin\")}\n\t\t\tautocomplete=\"off\"\n\t\t\t?readonly=${isMobileResolution()}\n\t\t\ttabindex=\"-1\"\n\t\t\tdata-test-id=${TestIdDictionary.Route.OriginInput}\n\t\t\tvalue=${selectedOrigin?.information?.displayName || searchExpressionOrigin}\n\t\t\t.value=${selectedOrigin?.information?.displayName || searchExpressionOrigin}\n\t\t\t@click=${openOriginSelector}\n\t\t\t@keyup=${handleTypeInOrigin}\n\t\t/>\n\t`;\n\n\tconst toTemplate = () => html`\n\t\t<input\n\t\t\tref=${ref(toCity)}\n\t\t\tclass=${classNames({\n\t\t\t\t\"in-focus\": pane.mode === \"destination\",\n\t\t\t\t[CLASS_NAMES.disabled]: !Boolean(selectedOrigin),\n\t\t\t\t[CLASS_NAMES.error]: isValidated && !selectedDestination,\n\t\t\t})}\n\t\t\tplaceholder=${i18next.t(\"search-box-destination\")}\n\t\t\tautocomplete=\"off\"\n\t\t\ttabindex=\"-1\"\n\t\t\t?readonly=${isMobileResolution()}\n\t\t\tdata-test-id=${TestIdDictionary.Route.DestinationInput}\n\t\t\tvalue=${selectedDestination?.information?.displayName || searchExpressionDestination}\n\t\t\t.value=${selectedDestination?.information?.displayName || searchExpressionDestination}\n\t\t\t@click=${(e: MouseEvent) => openDestinationSelector(e, selectedOrigin)}\n\t\t\t@keyup=${handleTypeInDestination}\n\t\t/>\n\t`;\n\n\tconst mobileHeaderTemplate = () => html`\n\t\t<div class=\"hidden-sm-up dg-mobile-header\">\n\t\t\t<span>${mobileLocationHeaderText()}</span>\n\t\t\t<span @click=${handleMobileLocationSelectorClose}>&times;</span>\n\t\t</div>\n\t\t<input\n\t\t\tref=${ref(mobileSearchField)}\n\t\t\tclass=\"hidden-md-up dg-mobile-search\"\n\t\t\tplaceholder=${i18next.t(\"search-box-search\")}\n\t\t\t@keyup=${handleTypeInMobile}\n\t\t/>\n\t\t<i class=\"hidden-md-up jsh-icon jsh-search\"></i>\n\t\t<span class=\"visible-sm close-tablet-selector\" @click=${handleMobileLocationSelectorClose}>&times;</span>\n\t`;\n\n\tconst firstPaneTemplate = () => html`\n\t\t<div class=\"dg-opening-pane-1\">\n\t\t\t${desktopCountriesTemplate()} ${mobileCountriesTemplate()} ${searchResultListTemplate()}\n\t\t</div>\n\t`;\n\n\tconst desktopCountriesTemplate = () =>\n\t\t!searchExpressionOrigin && !searchExpressionDestination\n\t\t\t? html`\n\t\t\t\t\t<div class=\"hidden-xs hidden-sm\">\n\t\t\t\t\t\t<header>\n\t\t\t\t\t\t\t<i class=\"hidden-md jsh-icon jsh-pin\"></i>\n\t\t\t\t\t\t\t<div class=\"country-title\">\n\t\t\t\t\t\t\t\t<h1>${i18next.t(\"search-box-discover-1\")}</h1>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<i class=\"jsh-icon jsh-chevron-right\"></i>\n\t\t\t\t\t\t</header>\n\t\t\t\t\t\t<label class=\"dg-country-selector-label\">${i18next.t(\"search-box-country\")}</label>\n\t\t\t\t\t\t<ul\n\t\t\t\t\t\t\tref=${ref(countryList)}\n\t\t\t\t\t\t\tclass=${classNames(\"dg-country-selector-list\", {\n\t\t\t\t\t\t\t\t\"with-redemption-miles-and-promo-code\":\n\t\t\t\t\t\t\t\t\tprops.showRedemptionMiles &&\n\t\t\t\t\t\t\t\t\t(!props.isRedemptionCheckboxChecked || !userInfo.IsAmericanMember),\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\tdata-test-id=${TestIdDictionary.Route.CountryList}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t${displayedData.map(desktopCountryTemplate)}\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t  `\n\t\t\t: \"\";\n\n\tconst desktopCountryTemplate = (country: ApiCountry) => html`\n\t\t<li\n\t\t\tdata-test-value=${country.information.code}\n\t\t\tclass=${classNames(\"dg-country-selector-list-item\", listItemClassName, {\n\t\t\t\t[CLASS_NAMES.active]: isCountrySelected(country.information.code),\n\t\t\t})}\n\t\t\t@click=${(e: MouseEvent) => selectCountry(e, country)}\n\t\t>\n\t\t\t<span\n\t\t\t\tclass=\"dg-country-name\"\n\t\t\t\tdata-test-id=${TestIdDictionary.Route.CountryListItem}\n\t\t\t\tdata-test-value=${country.information.code}\n\t\t\t>\n\t\t\t\t${country.information.name}\n\t\t\t</span>\n\t\t\t<i class=\"jsh-icon jsh-circle-chevron-right\"></i>\n\t\t</li>\n\t`;\n\n\tconst mobileCountriesTemplate = () =>\n\t\t!searchExpressionOrigin && !searchExpressionDestination\n\t\t\t? html`\n\t\t\t\t\t<ul\n\t\t\t\t\t\tref=${ref(mobileList)}\n\t\t\t\t\t\tclass=\"hidden-md-up dg-city-selector-list\"\n\t\t\t\t\t\tdata-test-id=${getTestId(TestIdDictionary.Route.CityList, { m: true })}\n\t\t\t\t\t>\n\t\t\t\t\t\t${mobileCountryItemsTemplate()}\n\t\t\t\t\t</ul>\n\t\t\t  `\n\t\t\t: \"\";\n\n\tconst mobileCountryItemsTemplate = () =>\n\t\tdisplayedData.map((country) => {\n\t\t\tconst id = `sbTypingOpener${country.information.code}`;\n\n\t\t\treturn html`\n\t\t\t\t<li class=${listItemClassName}>\n\t\t\t\t\t<input\n\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\tid=${id}\n\t\t\t\t\t\t?checked=${country.information.code === selectedCountryCode()}\n\t\t\t\t\t\t.checked=${country.information.code === selectedCountryCode()}\n\t\t\t\t\t/>\n\t\t\t\t\t<label\n\t\t\t\t\t\tfor=${id}\n\t\t\t\t\t\tclass=\"dg-typing-opener\"\n\t\t\t\t\t\t@click=${(e: MouseEvent) => selectCountry(e, country)}\n\t\t\t\t\t\tdata-test-id=${TestIdDictionary.Route.CountryListItem}\n\t\t\t\t\t\tdata-test-value=${country.information.code}\n\t\t\t\t\t>\n\t\t\t\t\t\t${country.information.name}\n\t\t\t\t\t</label>\n\t\t\t\t\t<ul class=\"dg-mobile-list\">\n\t\t\t\t\t\t${mobileRegionsTemplate(country)}\n\t\t\t\t\t</ul>\n\t\t\t\t</li>\n\t\t\t`;\n\t\t});\n\n\tconst mobileRegionsTemplate = (country: ApiCountry) =>\n\t\tcountry.regions.map(\n\t\t\t(region) => html`${regionLabelTemplate(region, false)} ${citiesTemplate(region, false, true)} `\n\t\t);\n\n\tconst citiesTemplate = (region: ApiRegion, isTypingResult: boolean, isMobile: boolean) =>\n\t\tregion.stations.map((station) => {\n\t\t\tconst tempClassMap = classNames(listItemClassName, {\n\t\t\t\t[CLASS_NAMES.active]: isCitySelected(station.information.code),\n\t\t\t\t\"dg-mobile-list-item\": isMobile,\n\t\t\t\t\"dg-typing-results-list-item\": isTypingResult && !isMobile,\n\t\t\t\t\"dg-city-selector-list-item\": !isTypingResult && !isMobile,\n\t\t\t\t\"is-new\": station.information.isNew,\n\t\t\t});\n\n\t\t\treturn html`\n\t\t\t\t<li\n\t\t\t\t\tclass=${tempClassMap}\n\t\t\t\t\tdata-test-id=${getTestId(TestIdDictionary.Route.CityListItem, { m: isMobile })}\n\t\t\t\t\tdata-test-value=${station.information.code}\n\t\t\t\t\t@click=${(e: MouseEvent) => selectCity(e, station)}\n\t\t\t\t>\n\t\t\t\t\t${station.information.name} <span class=\"dg-station-code\">(${station.information.code})</span>\n\t\t\t\t\t${newLabelTemplate(station)}\n\t\t\t\t</li>\n\t\t\t`;\n\t\t});\n\n\tconst typingResultCountryTemplate = (country: ApiCountry) => html`\n\t\t<li class=\"dg-typing-result-item\">\n\t\t\t<label for=\"sbTypingOpener1\">${country.information.name}</label>\n\t\t\t<ul class=\"dg-typing-results-list\">\n\t\t\t\t${regionsTemplate(country.regions, true)}\n\t\t\t</ul>\n\t\t</li>\n\t`;\n\n\tconst searchResultListTemplate = () =>\n\t\tsearchExpressionOrigin || searchExpressionDestination\n\t\t\t? html`\n\t\t\t\t\t<ul ref=${ref(typingResults)} class=\"dg-typing-results\">\n\t\t\t\t\t\t${displayedData.map(typingResultCountryTemplate)} ${noSearchResultErrorTemplate()}\n\t\t\t\t\t</ul>\n\t\t\t  `\n\t\t\t: \"\";\n\n\tconst noSearchResultErrorTemplate = () =>\n\t\tdisplayedData.length === 0\n\t\t\t? html`\n\t\t\t\t\t<li class=\"px-4 py-2 font-body font-bold text-dp-red sm:px-6 sm:py-0 md:p-2\">\n\t\t\t\t\t\t<label>${i18next.t(\"search-box-typing-no-result\")}</label>\n\t\t\t\t\t</li>\n\t\t\t  `\n\t\t\t: \"\";\n\n\tconst newLabelTemplate = (station: ApiStation) =>\n\t\tstation.information.isNew ? html`<span class=\"dg-station-new\">${i18next.t(\"new\")}</span>` : \"\";\n\n\tconst regionLabelTemplate = (region: ApiRegion, isTypingResult: boolean) =>\n\t\tregion.name\n\t\t\t? html`\n\t\t\t\t\t<li\n\t\t\t\t\t\tclass=${classNames({\n\t\t\t\t\t\t\t\"dg-typing-region-label\": isTypingResult,\n\t\t\t\t\t\t\t\"dg-region-label\": !isTypingResult,\n\t\t\t\t\t\t})}\n\t\t\t\t\t>\n\t\t\t\t\t\t${region.name}\n\t\t\t\t\t</li>\n\t\t\t  `\n\t\t\t: \"\";\n\n\tconst regionsTemplate = (regionArray: ApiRegion[], isTypingResult: boolean) =>\n\t\tregionArray.map(\n\t\t\t(region) =>\n\t\t\t\thtml`${regionLabelTemplate(region, isTypingResult)} ${citiesTemplate(region, isTypingResult, false)} `\n\t\t);\n\n\tconst secondPaneTemplate = () =>\n\t\t!searchExpressionOrigin && !searchExpressionDestination\n\t\t\t? html`\n\t\t\t\t\t<div class=${classNames(\"dg-opening-pane-2 hidden-xs hidden-sm\", { open: showCitySelector() })}>\n\t\t\t\t\t\t<label class=\"dg-city-selector-label\">${i18next.t(\"search-box-city\")}</label>\n\t\t\t\t\t\t<ul\n\t\t\t\t\t\t\tref=${ref(citySelector)}\n\t\t\t\t\t\t\tclass=${classNames(\"dg-city-selector-list\", {\n\t\t\t\t\t\t\t\t\"with-redemption-miles-and-promo-code\":\n\t\t\t\t\t\t\t\t\tprops.showRedemptionMiles &&\n\t\t\t\t\t\t\t\t\t(!props.isRedemptionCheckboxChecked || !userInfo.IsAmericanMember),\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\tdata-test-id=${TestIdDictionary.Route.CityList}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t${regionsTemplate(regionsToDisplay(), false)}\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t  `\n\t\t\t: \"\";\n\n\tconst paneTemplate = () => html`\n\t\t<div ref=${ref(locationSelector)} class=${classNames(\"dg-location-selector\", { open: showPane() })}>\n\t\t\t${mobileHeaderTemplate()} ${firstPaneTemplate()} ${secondPaneTemplate()}\n\t\t</div>\n\t`;\n\n\tconst htmlTemplate = () => html`${inputFieldsTemplate()} ${paneTemplate()}`;\n\n\treturn {\n\t\tselectedDestination,\n\t\tselectedDestinationCountryCode,\n\t\tselectedOriginCountryCode,\n\t\tselectedOrigin,\n\t\thtmlTemplate,\n\t\tupdateOnSearchReload,\n\t\tvalidate,\n\t};\n};\n","import { useState } from \"Shared/haunted/CustomHooks\";\nimport { html } from \"haunted\";\nimport i18next from \"i18next\";\nimport { tealiumLogSelectOneWayType, tealiumLogSelectReturnType } from \"ComponentHelpers/SearchboxTealiumHelpers\";\nimport { TestIdDictionary } from \"Services/test-ids/TestIdDictionary\";\nimport {\n\teventBusTriggerSelectOneWayType,\n\teventBusTriggerSelectReturnType,\n} from \"ComponentHelpers/SearchboxEventBusHelpers\";\nimport classNames from \"classnames\";\n\nexport interface Props {\n\tisHidden: boolean;\n}\n\nconst oneWayId = \"sbOneWayJourney\";\nconst returnId = \"sbReturnJourney\";\n\nexport const useTripTypeSelector = (props: Props) => {\n\tconst [numberOfJourneys, setNumberOfJourneys] = useState<number>(2);\n\n\tconst handleReturn = (e?: MouseEvent) => {\n\t\te?.preventDefault();\n\t\te?.stopPropagation();\n\n\t\tsetNumberOfJourneys(2);\n\t\ttealiumLogSelectReturnType();\n\t\teventBusTriggerSelectReturnType();\n\t\twindow.setTimeout(() => {\n\t\t\t// DEVNOTE Haunted bug(?)\n\t\t\t(document.getElementById(returnId) as HTMLInputElement).checked = true;\n\t\t\t(document.getElementById(oneWayId) as HTMLInputElement).checked = false;\n\t\t}, 0);\n\t};\n\n\tconst handleOneWay = (e?: MouseEvent) => {\n\t\te?.preventDefault();\n\t\te?.stopPropagation();\n\n\t\tsetNumberOfJourneys(1);\n\t\ttealiumLogSelectOneWayType();\n\t\teventBusTriggerSelectOneWayType();\n\t\twindow.setTimeout(() => {\n\t\t\t// DEVNOTE Haunted bug(?)\n\t\t\t(document.getElementById(returnId) as HTMLInputElement).checked = false;\n\t\t\t(document.getElementById(oneWayId) as HTMLInputElement).checked = true;\n\t\t}, 0);\n\t};\n\n\tconst updateOnSearchReload = (newNumberOfJourneys: number) => {\n\t\tif (newNumberOfJourneys === 1) {\n\t\t\thandleOneWay();\n\t\t} else {\n\t\t\thandleReturn();\n\t\t}\n\t};\n\n\tconst htmlTemplate = () => html` <div\n\t\tclass=${classNames(\"dg-journey-type-selector\", { \"hidden-xs\": props.isHidden })}\n\t>\n\t\t<div class=\"row\">\n\t\t\t<div class=\"col-xs-1-2 col-sm-1-2 col-md-1-2 text-center\">\n\t\t\t\t<input\n\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\tname=\"journeyType\"\n\t\t\t\t\tid=${returnId}\n\t\t\t\t\tautocomplete=\"off\"\n\t\t\t\t\tchecked\n\t\t\t\t\t@click=${handleReturn}\n\t\t\t\t/>\n\t\t\t\t<label for=${returnId}>${i18next.t(\"search-box-roundtrip\")}</label>\n\t\t\t</div>\n\t\t\t<div class=\"col-xs-1-2 col-sm-1-2 col-md-1-2 text-center\">\n\t\t\t\t<input\n\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\tname=\"journeyType\"\n\t\t\t\t\tid=${oneWayId}\n\t\t\t\t\tautocomplete=\"off\"\n\t\t\t\t\tdata-test-id=${TestIdDictionary.Date.OneWaySelector}\n\t\t\t\t\t@click=${handleOneWay}\n\t\t\t\t/>\n\t\t\t\t<label for=${oneWayId}>${i18next.t(\"search-box-oneway\")}</label>\n\t\t\t</div>\n\t\t</div>\n\t</div>`;\n\n\treturn { numberOfJourneys, htmlTemplate, updateOnSearchReload };\n};\n","import { useEffect, useState } from \"Shared/haunted/CustomHooks\";\nimport i18next from \"i18next\";\nimport { html } from \"haunted\";\nimport { VOUCHER_REGEX, PROMO_CODE_REGEX } from \"Services/constants\";\nimport { JetSmartEvent } from \"Services/eventbus/JetSmartEvent\";\nimport { tealiumLog } from \"Services/TealiumHelpers\";\nimport { getPromoCode } from \"ComponentHelpers/PromoCodeHelper\";\nimport { tealiumLogPreloadedPromoCode } from \"ComponentHelpers/SearchboxTealiumHelpers\";\nimport classNames from \"classnames\";\nimport { useUserInfo } from \"ComponentHelpers/useUserInfo\";\n\nexport interface Props {\n\tculture: string;\n\tdynamicSettings: DynamicSettings;\n\tisInFocus: boolean;\n\tisRedemptionCheckboxChecked: boolean;\n}\n\nexport const usePromoCodeBox = (props: Props) => {\n\tconst [predefinedPromoCode, setPredefinedPromoCode] = useState<string>(\"\");\n\tconst [promoCode, setPromoCode] = useState<string>(\"\");\n\tconst [showPromoCodeFormatError, setShowPromoCodeFormatError] = useState<boolean>(false);\n\tconst [showPromoCodeVoucherError, setShowPromoCodeVoucherError] = useState<boolean>(false);\n\n\tconst userInfo = useUserInfo();\n\n\t// Helpers\n\n\tconst init = () => {\n\t\ttry {\n\t\t\tconst pc = getPromoCode(\n\t\t\t\tuserInfo.ProgramCodesWithLevels,\n\t\t\t\tuserInfo.RoleCode,\n\t\t\t\tprops.dynamicSettings,\n\t\t\t\tprops.culture\n\t\t\t);\n\n\t\t\tsetPromoCode(pc);\n\t\t\tsetPredefinedPromoCode(pc);\n\t\t\ttealiumLogPreloadedPromoCode(pc);\n\t\t} catch (e) {\n\t\t\tthrow new Error(\"Unable to parse user info cookie or set WA pc.\");\n\t\t}\n\t};\n\n\tconst validate = () => {\n\t\tsetShowPromoCodeVoucherError(false);\n\t\tsetShowPromoCodeFormatError(false);\n\n\t\tif (!promoCode || promoCode === predefinedPromoCode) return true;\n\n\t\tif (VOUCHER_REGEX.test(promoCode)) {\n\t\t\tsetShowPromoCodeVoucherError(true);\n\n\t\t\ttealiumLog({\n\t\t\t\teventName: \"validation_error\",\n\t\t\t\teventParams: {\n\t\t\t\t\tpage: \"/\",\n\t\t\t\t\tmessage: \"[promo code appears to be a voucher]\",\n\t\t\t\t},\n\t\t\t});\n\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!PROMO_CODE_REGEX.test(promoCode)) {\n\t\t\tsetShowPromoCodeFormatError(true);\n\n\t\t\ttealiumLog({\n\t\t\t\teventName: \"validation_error\",\n\t\t\t\teventParams: {\n\t\t\t\t\tpage: \"/\",\n\t\t\t\t\tmessage: \"[invalid promo code format]\",\n\t\t\t\t},\n\t\t\t});\n\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t};\n\n\tconst displayedPromoCode = () => (predefinedPromoCode === promoCode ? getMaskedPromoCode() : promoCode);\n\n\tconst getMaskedPromoCode = () => {\n\t\tif (!promoCode) return \"\";\n\n\t\tconst lengthToMask =\n\t\t\tuserInfo.IsPeruCompraAdmin || userInfo.IsPeruCompraMember ? promoCode.length : promoCode.length - 2;\n\n\t\treturn `${[...Array(lengthToMask)].map(() => \"*\").join(\"\")}${promoCode.substring(lengthToMask)}`;\n\t};\n\n\t// Event listeners\n\n\tconst handleBlur = () => {\n\t\twindow.eventBus.raiseEvent({\n\t\t\tname: JetSmartEvent.PromoCodeAdded,\n\t\t\tparams: {\n\t\t\t\tid: \"searchbox.promocode\",\n\t\t\t\tevent: \"input\",\n\t\t\t\tdata: {\n\t\t\t\t\tcode: promoCode,\n\t\t\t\t},\n\t\t\t},\n\t\t});\n\t};\n\n\tconst handleInput = (e: KeyboardEvent) => {\n\t\tsetShowPromoCodeVoucherError(false);\n\t\tsetShowPromoCodeFormatError(false);\n\n\t\tconst newPromoCode = (e.target as HTMLInputElement).value;\n\n\t\tsetPromoCode(newPromoCode);\n\t};\n\n\tuseEffect(() => {\n\t\tif (props.isRedemptionCheckboxChecked && userInfo.IsAmericanMember) {\n\t\t\tsetShowPromoCodeVoucherError(false);\n\t\t\tsetShowPromoCodeFormatError(false);\n\t\t\tsetPromoCode(\"\");\n\t\t}\n\t}, [props.isRedemptionCheckboxChecked]);\n\n\tuseEffect(init, []);\n\n\t// Templates\n\n\tconst errorTemplate = () =>\n\t\tshowPromoCodeFormatError || showPromoCodeVoucherError\n\t\t\t? html`\n\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t<div class=\"col-xs-1\">\n\t\t\t\t\t\t\t<div class=\"promo-code-error-container\">\n\t\t\t\t\t\t\t\t<span class=\"field-error\">\n\t\t\t\t\t\t\t\t\t${showPromoCodeVoucherError\n\t\t\t\t\t\t\t\t\t\t? i18next.t(\"promoCodeVoucherError\")\n\t\t\t\t\t\t\t\t\t\t: i18next.t(\"promoCodeFormatError\")}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t  `\n\t\t\t: \"\";\n\n\tconst showPromoCode = () =>\n\t\t!userInfo?.IsCug3Observer &&\n\t\t!userInfo?.IsCug3Supervisor &&\n\t\t(!props.isRedemptionCheckboxChecked || !userInfo.IsAmericanMember);\n\n\tconst htmlTemplate = () =>\n\t\tshowPromoCode()\n\t\t\t? html`\n\t\t\t\t\t<div class=${classNames(\"dg-promo-code\", { \"hidden-xs\": !props.isInFocus })}>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tautocomplete=\"disabled\"\n\t\t\t\t\t\t\tplaceholder=${i18next.t(\"search-box-promo-code\")}\n\t\t\t\t\t\t\tvalue=${displayedPromoCode()}\n\t\t\t\t\t\t\t.value=${displayedPromoCode()}\n\t\t\t\t\t\t\t?disabled=${userInfo.IsPeruCompraAdmin || userInfo.IsPeruCompraMember}\n\t\t\t\t\t\t\t@input=${handleInput}\n\t\t\t\t\t\t\t@blur=${handleBlur}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t\t${errorTemplate()}\n\t\t\t  `\n\t\t\t: html``;\n\n\treturn { predefinedPromoCode, promoCode, htmlTemplate, validate };\n};\n","import { COMMON_DAYJS_FORMAT, COOKIES } from \"Services/constants\";\nimport { getCookie, setCookieWithExpiry } from \"Services/cookieHandling\";\nimport * as dayjs from \"dayjs\";\nimport * as UTC from \"dayjs/plugin/utc\";\nimport * as CustomParseFormat from \"dayjs/plugin/customParseFormat\";\ndayjs.extend(CustomParseFormat);\ndayjs.extend(UTC);\n\nexport interface StoredSearch {\n\tdepartureDate: string;\n\tdestination: string;\n\tlastVisit?: string;\n\torigin: string;\n\tpassengers: {\n\t\tadults: number;\n\t\tchildren: number;\n\t\tinfants: number;\n\t\tteens: number;\n\t};\n\treturnDate: string;\n}\n\nexport const usePreviousSearch = () => {\n\tconst save = (value: StoredSearch) => {\n\t\ttry {\n\t\t\tsetCookieWithExpiry(\n\t\t\t\tCOOKIES.PREVIOUS_SEARCH,\n\t\t\t\tbtoa(JSON.stringify({ ...value, lastVisit: dayjs().utc().format(COMMON_DAYJS_FORMAT) })),\n\t\t\t\t14\n\t\t\t);\n\t\t} catch {\n\t\t\t// Do nothing\n\t\t}\n\t};\n\n\tconst load = (): StoredSearch => {\n\t\tconst rawValue = getCookie(COOKIES.PREVIOUS_SEARCH);\n\n\t\tif (!rawValue) return undefined;\n\n\t\ttry {\n\t\t\treturn JSON.parse(atob(rawValue)) as StoredSearch;\n\t\t} catch {\n\t\t\treturn undefined;\n\t\t}\n\t};\n\n\tconst refresh = () => {\n\t\tconst oldValue = load();\n\t\tif (oldValue) save(oldValue);\n\t};\n\n\treturn { load, save, refresh };\n};\n","import { TestIdDictionary } from \"Services/test-ids/TestIdDictionary\";\nimport { CLASS_NAMES } from \"Services/ClassNames\";\nimport url from \"url\";\nimport { usePaxSelector } from \"./pax-selector/usePaxSelector\";\nimport { useDateSelector } from \"./date-selector/useDateSelector\";\nimport { useEffect, useMemo, useState } from \"Shared/haunted/CustomHooks\";\nimport {\n\tBRASILIAN_CULTURE_CODE,\n\tCOLOMBIA_COUNTRY_CODE,\n\tCOMMON_DAYJS_FORMAT,\n\tFLIGHT_SELECT_URL,\n\tUSA_CULTURE_CODE,\n\tUSA_DOLLAR_CODE,\n\tWEB_ANONYMOUS_ROLE_CODE,\n\tWIDGETS,\n} from \"Services/constants\";\nimport { html, useRef } from \"haunted\";\nimport i18next from \"i18next\";\nimport { getParsedProperty, getRequestUrl, toBoolean } from \"Services/common\";\nimport { HauntedFunc } from \"Shared/haunted/HooksHelpers\";\nimport { ApiStationSettings } from \"Shared/models/ApiStationSettings\";\nimport { JetSmartEvent } from \"Services/eventbus/JetSmartEvent\";\nimport { validate } from \"Services/form-validation\";\nimport SearchRequest from \"Shared/models/SearchRequest\";\nimport { useRouteSelector } from \"./route-selector/useRouteSelector\";\nimport { useTripTypeSelector } from \"./trip-type-selector/useTripTypeSelector\";\nimport { usePromoCodeBox } from \"./promo-code-box/usePromoCodeBox\";\nimport { ref } from \"Components/directives/ref\";\nimport { tealiumLogSearchClick } from \"ComponentHelpers/SearchboxTealiumHelpers\";\nimport { useNavitaireSettings } from \"ComponentHelpers/useNavitaireSettings\";\nimport { ApiCultureSettings } from \"ComponentModels/ApiCultureSettings\";\nimport classNames from \"classnames\";\nimport { usePreviousSearch } from \"./usePreviousSearch\";\nimport { tealiumLog, getTealiumDeviceType } from \"Services/TealiumHelpers\";\nimport { PUB_SUBS } from \"Services/pub-sub-service/PubSub\";\nimport { useUserInfo } from \"ComponentHelpers/useUserInfo\";\n\nexport const useShadowDOM = false;\nexport const name = \"bb-searchbox\";\n\nexport const observedAttributes: (keyof Attributes)[] = [\n\t\"culture-settings\",\n\t\"culture\",\n\t\"currency\",\n\t\"dynamic-settings\",\n\t\"station-settings\",\n\t\"timetable-max-months-fallback\",\n];\n\ntype TabType = \"flights\" | \"insurance\" | \"hotels\" | \"cars\" | \"transfers\";\n\nconst REDEMPTION_MILES_ID = \"redemptionMiles\";\n\ninterface Tab {\n\ticonClass: string;\n\tlabel: string;\n\ttype: TabType;\n\tonClick: () => void;\n}\n\nexport interface Attributes {\n\t\"culture-settings\": string;\n\t\"culture\": string;\n\t\"currency\": string;\n\t\"dynamic-settings\": string;\n\t\"station-settings\": string;\n\t\"timetable-max-months-fallback\": string;\n}\n\nexport interface Props {\n\tculture: string;\n\tcultureSettings: ApiCultureSettings;\n\tcurrency: string;\n\tdynamicSettings: DynamicSettings;\n\tstationSettings: ApiStationSettings;\n\ttimetableMaxMonthsFallback: number;\n}\n\nexport const Component: HauntedFunc<Props> = (host) => {\n\tconst props: Props = {\n\t\tculture: host.culture,\n\t\tcultureSettings:\n\t\t\thost.cultureSettings && typeof host.cultureSettings === \"string\"\n\t\t\t\t? getParsedProperty<ApiCultureSettings>(host.cultureSettings)\n\t\t\t\t: undefined,\n\t\tcurrency: host.currency,\n\t\tdynamicSettings:\n\t\t\thost.dynamicSettings && typeof host.dynamicSettings === \"string\"\n\t\t\t\t? getParsedProperty<DynamicSettings>(host.dynamicSettings)\n\t\t\t\t: undefined,\n\t\tstationSettings:\n\t\t\thost.stationSettings && typeof host.stationSettings === \"string\"\n\t\t\t\t? getParsedProperty<ApiStationSettings>(host.stationSettings)\n\t\t\t\t: undefined,\n\t\ttimetableMaxMonthsFallback:\n\t\t\thost.timetableMaxMonthsFallback && typeof host.timetableMaxMonthsFallback === \"string\"\n\t\t\t\t? parseInt(host.timetableMaxMonthsFallback)\n\t\t\t\t: undefined,\n\t};\n\n\tconst isCug2User = () => Boolean(userInfo?.Organization);\n\n\tconst isCug3User = () => userInfo?.IsCug3Observer || userInfo?.IsCug3Supervisor;\n\n\tconst isPecoUser = () => userInfo?.IsPeruCompraAdmin || userInfo?.IsPeruCompraMember;\n\n\tconst showRedemptionMiles = () =>\n\t\twindow.JetSmart?.DynamicSettings?.IsAmericanOn && !isCug2User() && !isCug3User() && !isPecoUser();\n\n\tconst form = useRef<HTMLFormElement>(undefined);\n\tconst navitaireSettings = useNavitaireSettings();\n\tconst userInfo = useUserInfo();\n\n\tconst [displayedTab, setDisplayedTab] = useState<TabType>(\"flights\");\n\tconst [isCollapsed, setIsCollapsed] = useState<boolean>(true);\n\tconst [isRedemptionCheckboxChecked, setIsRedemptionCheckboxChecked] = useState<boolean>(userInfo?.IsAmericanMember);\n\n\tconst promoCodeBox = usePromoCodeBox({\n\t\tculture: props.culture,\n\t\tdynamicSettings: props.dynamicSettings,\n\t\tisInFocus: !isCollapsed,\n\t\tisRedemptionCheckboxChecked,\n\t});\n\n\tconst startLoading = () => {\n\t\tconst loaderInstance = window.newRtLoader(\".dg-for-loader\");\n\t\tloaderInstance.startLoader();\n\t\treturn loaderInstance;\n\t};\n\n\tconst stopLoading = (loader: any) => {\n\t\tif (loader) {\n\t\t\tloader.stopLoader();\n\t\t\tloader.destroy();\n\t\t}\n\t};\n\n\tconst routeSelector = useRouteSelector({\n\t\tculture: props.culture,\n\t\tcurrentPromoCode: promoCodeBox.promoCode,\n\t\tdefaultRouteCountrySettings: props.dynamicSettings.DefaultRouteCountrySettings,\n\t\tshowRedemptionMiles: showRedemptionMiles(),\n\t\tisRedemptionCheckboxChecked,\n\t\tsetIsCollapsed,\n\t\tstartLoading,\n\t\tstopLoading,\n\t});\n\n\tconst tripTypeSelector = useTripTypeSelector({ isHidden: isCollapsed });\n\n\tconst datePicker = useDateSelector({\n\t\tculture: props.culture,\n\t\tisHidden: isCollapsed,\n\t\tisOneWay: tripTypeSelector.numberOfJourneys === 1,\n\t\tselectedDestination: routeSelector.selectedDestination?.information?.code,\n\t\tselectedOrigin: routeSelector.selectedOrigin?.information?.code,\n\t\tusePrices: props.dynamicSettings.ShowFarePricesCultures,\n\t\ttimetableMaxMonthsFallback: props.timetableMaxMonthsFallback,\n\t\tshowRedemptionMiles: showRedemptionMiles(),\n\t\tisRedemptionCheckboxChecked,\n\t\tstartLoading,\n\t\tstopLoading,\n\t});\n\n\tconst paxSelector = usePaxSelector({\n\t\tculture: props.culture,\n\t\tisFlightDomesticColombia:\n\t\t\trouteSelector?.selectedOriginCountryCode === COLOMBIA_COUNTRY_CODE &&\n\t\t\trouteSelector?.selectedDestinationCountryCode === COLOMBIA_COUNTRY_CODE,\n\t\tshowRedemptionMiles: showRedemptionMiles(),\n\t\tisRedemptionCheckboxChecked,\n\t});\n\n\tconst previousSearch = usePreviousSearch();\n\n\tconst showReloadLink = useMemo(\n\t\t() => Boolean(previousSearch.load()) && (!isRedemptionCheckboxChecked || !userInfo.IsAmericanMember),\n\t\t[isRedemptionCheckboxChecked, userInfo.IsAmericanMember]\n\t);\n\n\t// Helpers\n\n\tconst getUserRoleCode = () =>\n\t\tuserInfo?.RoleCode && userInfo?.RoleCode !== WEB_ANONYMOUS_ROLE_CODE ? userInfo.RoleCode : \"WebAnonymous\";\n\n\tconst logHomePageLoaded = () => {\n\t\tconst country = window.location.pathname.slice(-6, -4).toUpperCase();\n\t\tconst language = window.location.pathname.slice(-3, -1).toLowerCase();\n\n\t\tlet eventParams: any = {\n\t\t\tculture: `${language}-${country}`,\n\t\t\tdevice: getTealiumDeviceType(),\n\t\t\trole_code: getUserRoleCode(),\n\t\t};\n\n\t\tif (userInfo?.ProgramCodesWithLevels.length > 0) {\n\t\t\tconst programCode = userInfo.ProgramCodesWithLevels.reduce((acc, p, index) => {\n\t\t\t\tconst code = p.split(\"-\")[0];\n\t\t\t\treturn acc + (index > 0 ? \"|\" : \"\") + code;\n\t\t\t}, \"\");\n\n\t\t\tconst programLevel = userInfo.ProgramCodesWithLevels.reduce((acc, p, index) => {\n\t\t\t\tconst level = p.split(\"-\")[1];\n\t\t\t\treturn acc + (index > 0 ? \"|\" : \"\") + level;\n\t\t\t}, \"\");\n\n\t\t\teventParams = {\n\t\t\t\t...eventParams,\n\t\t\t\tprogram_code: programCode,\n\t\t\t\tprogram_level: programLevel,\n\t\t\t};\n\t\t}\n\n\t\t// DEVNOTE This is here because JET-9907\n\t\ttealiumLog({\n\t\t\teventName: \"homepage_dom_loaded\",\n\t\t\teventParams,\n\t\t\tupdateRealUdo: true,\n\t\t});\n\t};\n\n\tconst init = async () => {\n\t\tlogHomePageLoaded();\n\n\t\tpreviousSearch.refresh();\n\n\t\tawait navitaireSettings.init({\n\t\t\tculture: props.culture,\n\t\t\tloadedValues: {\n\t\t\t\tabTestSettings: window.JetSmart.AbTestSettings,\n\t\t\t\tcultureSettings: props.cultureSettings,\n\t\t\t\tcurrency: props.currency,\n\t\t\t\tstationSettings: props.stationSettings,\n\t\t\t},\n\t\t});\n\t};\n\n\tconst getSearchRequest = () => {\n\t\tconst cultureElements = props.culture.split(\"-\", 2);\n\t\tconst countryIndex = 1;\n\t\tconst rc = cultureElements.length === 2 ? cultureElements[countryIndex] : \"\";\n\t\tconst isRedemptionSearch = showRedemptionMiles() && isRedemptionCheckboxChecked && userInfo?.IsAmericanMember;\n\n\t\tlet req: SearchRequest = {\n\t\t\to1: routeSelector.selectedOrigin.information.code,\n\t\t\td1: routeSelector.selectedDestination.information.code,\n\t\t\tdd1: datePicker.currentDeparture.format(COMMON_DAYJS_FORMAT),\n\t\t\tADT: paxSelector.passengers.adults + paxSelector.passengers.teens,\n\t\t\tCHD: paxSelector.passengers.children,\n\t\t\tinl: paxSelector.passengers.infants,\n\t\t\tr: false,\n\t\t\ts: true,\n\t\t\tmon: true,\n\t\t\tcur: !isRedemptionSearch ? navitaireSettings.value.currency : USA_DOLLAR_CODE,\n\t\t\tculture: props.culture,\n\t\t\tpc: !isRedemptionSearch ? promoCodeBox.promoCode : \"\",\n\t\t\trc,\n\t\t\tselectedPriceOutbound: datePicker.selectedPriceOutbound,\n\t\t\tselectedPriceInbound: \"\",\n\t\t\tisRedemptionFlow: isRedemptionSearch,\n\t\t};\n\n\t\tif (tripTypeSelector.numberOfJourneys === 2) {\n\t\t\treq = {\n\t\t\t\t...req,\n\t\t\t\tdd2: datePicker.currentReturn.format(COMMON_DAYJS_FORMAT),\n\t\t\t\tselectedPriceInbound: datePicker.selectedPriceInbound,\n\t\t\t\tr: true,\n\t\t\t};\n\t\t}\n\n\t\treturn req;\n\t};\n\n\tconst redirectToQueueItUrl = (requestUrl: string) => {\n\t\tconst newLocationUrl = encodeURIComponent(\n\t\t\turl.resolve(window.JetSmart.Settings.BookingUrl, `${FLIGHT_SELECT_URL}${requestUrl}`)\n\t\t);\n\n\t\twindow.location.href = window.JetSmart.DynamicSettings.QueueItPrefix + newLocationUrl;\n\t};\n\n\tconst redirectToRegularUrl = (requestUrl: string) => {\n\t\tlocation.href = url.resolve(window.JetSmart.Settings.BookingUrl, `${FLIGHT_SELECT_URL}${requestUrl}`);\n\t};\n\n\tconst raiseEventBusEvent = (id: string) => {\n\t\twindow.eventBus.raiseEvent({\n\t\t\tname: JetSmartEvent.SearchBoxTabClick,\n\t\t\tparams: {\n\t\t\t\tid,\n\t\t\t\tevent: \"click\",\n\t\t\t\tdata: {},\n\t\t\t},\n\t\t});\n\t};\n\n\tconst savePreviousSearch = () => {\n\t\tpreviousSearch.save({\n\t\t\tdepartureDate: datePicker.currentDeparture.format(COMMON_DAYJS_FORMAT),\n\t\t\tdestination: routeSelector.selectedDestination.information.code,\n\t\t\torigin: routeSelector.selectedOrigin.information.code,\n\t\t\tpassengers: {\n\t\t\t\tadults: paxSelector.passengers.adults,\n\t\t\t\tchildren: paxSelector.passengers.children,\n\t\t\t\tinfants: paxSelector.passengers.infants,\n\t\t\t\tteens: paxSelector.passengers.teens,\n\t\t\t},\n\t\t\treturnDate: datePicker.currentReturn?.format(COMMON_DAYJS_FORMAT) || \"\",\n\t\t});\n\t};\n\n\tconst showInsuranceTab = () =>\n\t\tprops.dynamicSettings.DynamicInsuranceTabSettings.find(\n\t\t\t(s) => s.Culture.toLocaleLowerCase() === props.culture.toLocaleLowerCase()\n\t\t)?.IsActive;\n\n\tconst getInsuranceTabUrl = () =>\n\t\tprops.dynamicSettings.DynamicInsuranceTabSettings.find(\n\t\t\t(s) => s.Culture.toLocaleLowerCase() === props.culture.toLocaleLowerCase()\n\t\t)?.Url;\n\n\t// Event listeners\n\n\tconst handleReloadSearch = async (e: MouseEvent) => {\n\t\te.preventDefault();\n\n\t\tconst value = previousSearch.load();\n\n\t\tif (!value) return;\n\n\t\ttry {\n\t\t\tconst shouldUpdateRoute =\n\t\t\t\tvalue.origin !== routeSelector.selectedOrigin?.information?.code ||\n\t\t\t\tvalue.destination !== routeSelector.selectedDestination?.information?.code;\n\n\t\t\tconst shouldUpdateDates =\n\t\t\t\tvalue.departureDate !== datePicker.currentDeparture?.format(COMMON_DAYJS_FORMAT) ||\n\t\t\t\tvalue.returnDate !== datePicker.currentReturn?.format(COMMON_DAYJS_FORMAT);\n\n\t\t\tif (shouldUpdateRoute) {\n\t\t\t\trouteSelector.updateOnSearchReload(value.origin, value.destination);\n\t\t\t}\n\n\t\t\tif (shouldUpdateRoute || shouldUpdateDates) {\n\t\t\t\tawait datePicker.updateOnSearchReload(\n\t\t\t\t\tvalue.origin,\n\t\t\t\t\tvalue.destination,\n\t\t\t\t\tvalue.departureDate,\n\t\t\t\t\tvalue.returnDate\n\t\t\t\t);\n\t\t\t}\n\n\t\t\ttripTypeSelector.updateOnSearchReload(value.returnDate ? 2 : 1);\n\t\t\tpaxSelector.updateOnSearchReload(value.passengers);\n\t\t} catch {\n\t\t\t// Do nothing\n\t\t}\n\t};\n\n\tconst handleFormSubmit = (e: MouseEvent) => {\n\t\te.preventDefault();\n\n\t\ttealiumLogSearchClick({\n\t\t\tadults: paxSelector.passengers.adults,\n\t\t\tchildren: paxSelector.passengers.children,\n\t\t\tculture: props.culture,\n\t\t\tdepartureDate: datePicker.currentDeparture,\n\t\t\tdestinationCode: routeSelector.selectedDestination?.information.code,\n\t\t\tinfants: paxSelector.passengers.infants,\n\t\t\tnumberOfJourneys: tripTypeSelector.numberOfJourneys,\n\t\t\tmarket:\n\t\t\t\trouteSelector.selectedDestinationCountryCode !== routeSelector.selectedOriginCountryCode\n\t\t\t\t\t? \"INTER\"\n\t\t\t\t\t: `DOM-${routeSelector.selectedOriginCountryCode}`,\n\t\t\toriginCode: routeSelector.selectedOrigin?.information.code,\n\t\t\tpreloadedPromoCode: promoCodeBox.predefinedPromoCode,\n\t\t\tpromoCode: promoCodeBox.promoCode,\n\t\t\treturnDate: datePicker.currentReturn,\n\t\t\tteens: paxSelector.passengers.teens,\n\t\t});\n\n\t\tconst validateForm = validate(form.current);\n\t\tconst validateRoute = routeSelector.validate();\n\t\tconst validateDates = datePicker.validate();\n\t\tconst validatePaxSelector = paxSelector.validate();\n\t\tconst validatePromoCode = promoCodeBox.validate();\n\n\t\tif (validateForm && validatePaxSelector && validatePromoCode && validateRoute && validateDates) {\n\t\t\tif (promoCodeBox.promoCode && isRedemptionCheckboxChecked && !userInfo?.IsAmericanMember) {\n\t\t\t\tPUB_SUBS.RedemptionNoPromoCodeModalOpened.publish({});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (isRedemptionCheckboxChecked && !userInfo?.IsAmericanMember) {\n\t\t\t\twindow.location.href = window.JetSmart?.AmericanAirlinesSettings?.LoginAddress;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tstartLoading();\n\n\t\t\tsavePreviousSearch();\n\n\t\t\tconst request = getSearchRequest();\n\t\t\tconst requestUrl = getRequestUrl(request);\n\t\t\tconst isQueueItOn = toBoolean(window.JetSmart.DynamicSettings.IsQueueItOn);\n\n\t\t\tif (isQueueItOn) {\n\t\t\t\tredirectToQueueItUrl(requestUrl);\n\t\t\t} else {\n\t\t\t\tredirectToRegularUrl(requestUrl);\n\t\t\t}\n\t\t}\n\t};\n\n\tconst handleFlightTabSelect = () => {\n\t\tsetDisplayedTab(\"flights\");\n\t\traiseEventBusEvent(\"searchbox.flightsTab\");\n\t};\n\n\tconst handleInsuranceTabSelect = () => {\n\t\tsetDisplayedTab(\"insurance\");\n\t\traiseEventBusEvent(\"searchbox.insuranceTab\");\n\t};\n\n\tconst handleHotelTabSelect = () => {\n\t\tsetDisplayedTab(\"hotels\");\n\t\traiseEventBusEvent(\"searchbox.hotelsTab\");\n\t};\n\n\tconst handleCarTabSelect = () => {\n\t\tsetDisplayedTab(\"cars\");\n\t\traiseEventBusEvent(\"searchbox.rentalcarsTab\");\n\t};\n\n\tconst handleTransferTabSelect = () => {\n\t\tsetDisplayedTab(\"transfers\");\n\t\traiseEventBusEvent(\"searchbox.transfersTab\");\n\t};\n\n\tuseEffect(init, []);\n\n\t// Templates\n\n\tconst reloadLinkTemplate = () =>\n\t\tshowReloadLink\n\t\t\t? html`\n\t\t\t\t\t<div class=\"m-0 flex w-full items-center justify-center px-0 pb-0 pt-2 text-center\">\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tclass=\"cursor-pointer text-sm font-bold leading-none text-brand-secondary underline hover:text-brand-primary\"\n\t\t\t\t\t\t\t@click=${handleReloadSearch}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t&#8635;&nbsp;${i18next.t(\"Rearmar mi última búsqueda\")}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t  `\n\t\t\t: \"\";\n\n\tconst flightTabContentTemplate = () => html`\n\t\t<form ref=${ref(form)} @click=${() => setIsCollapsed(false)} novalidate>\n\t\t\t${routeSelector.htmlTemplate()} ${tripTypeSelector.htmlTemplate()} ${datePicker.htmlTemplate()}\n\n\t\t\t<div class=${classNames(\"dg-clear-on-mobile\", { \"hidden-xs\": isCollapsed })}>\n\t\t\t\t${paxSelector.htmlTemplate()} ${promoCodeBox.htmlTemplate()}\n\t\t\t</div>\n\n\t\t\t${reloadLinkTemplate()} ${redemptionMilesCheckboxTemplate()}\n\n\t\t\t<div class=\"dg-btn-container\">\n\t\t\t\t<button\n\t\t\t\t\tclass=\"dg-rounded-primary-btn\"\n\t\t\t\t\t@click=${handleFormSubmit}\n\t\t\t\t\tdata-test-id=${TestIdDictionary.SubmitSearchButton}\n\t\t\t\t>\n\t\t\t\t\t<i class=\"jsh-icon jsh-search\"></i>\n\t\t\t\t\t<span>${i18next.t(\"search-box-submit\")}</span>\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t</form>\n\t`;\n\n\tconst redemptionMilesCheckboxTemplate = () =>\n\t\tshowRedemptionMiles()\n\t\t\t? html`<div class=\"dg-redemption-checkbox-container\">\n\t\t\t\t\t<div class=\"dg-redemption-checkbox\">\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\tid=${REDEMPTION_MILES_ID}\n\t\t\t\t\t\t\tautocomplete=\"off\"\n\t\t\t\t\t\t\t?checked=${isRedemptionCheckboxChecked}\n\t\t\t\t\t\t\t@click=${() => setIsRedemptionCheckboxChecked(!isRedemptionCheckboxChecked)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<label for=${REDEMPTION_MILES_ID}>${i18next.t(\"Use AAdvantage® miles\")}</label>\n\t\t\t\t\t</div>\n\t\t\t  </div>`\n\t\t\t: \"\";\n\n\tconst flightTabTemplate = () => html`\n\t\t<div\n\t\t\tclass=${classNames(\"dg-tab dg-flights dg-for-loader\", {\n\t\t\t\t\"hidden\": displayedTab !== \"flights\",\n\t\t\t\t\"collapsed\": isCollapsed,\n\t\t\t\t\"with-reload\": showReloadLink,\n\t\t\t\t\"with-redemption-miles-and-promo-code\":\n\t\t\t\t\tshowRedemptionMiles() && (!isRedemptionCheckboxChecked || !userInfo.IsAmericanMember),\n\t\t\t\t\"with-redemption-miles\": showRedemptionMiles() && isRedemptionCheckboxChecked,\n\t\t\t})}\n\t\t>\n\t\t\t${flightTabContentTemplate()}\n\t\t</div>\n\t`;\n\n\tconst handleInsuranceButtonClick = () => {\n\t\twindow.open(getInsuranceTabUrl(), \"_blank\");\n\t};\n\n\tconst insuranceHeaderTemplate = () => html`\n\t\t<div class=\"dg-insurance-header \">\n\t\t\t<i class=\"jsh-icon jsh-circle-hand-shield dg-insurance-title-icon\"></i>\n\t\t\t<div class=\"dg-insurance-title\">${i18next.t(\"search-box-insurance-title\")}</div>\n\t\t</div>\n\t`;\n\n\tconst insuranceTabTextTemplate = () => html`\n\t\t<div class=\"mb-6 flex w-full flex-col gap-y-4\">\n\t\t\t<div class=\"dg-insurance-text\">${i18next.t(\"search-box-insurance-text-1\")}</div>\n\t\t\t<div class=\"dg-insurance-text\">${i18next.t(\"search-box-insurance-text-2\")}</div>\n\t\t\t<div class=\"dg-insurance-text\">${i18next.t(\"search-box-insurance-text-3\")}</div>\n\t\t\t<div class=\"dg-insurance-text\">${i18next.t(\"search-box-insurance-text-4\")}</div>\n\t\t</div>\n\t`;\n\n\tconst insuranceTabButtonTemplate = () => {\n\t\tconst image =\n\t\t\tprops.culture.toLocaleLowerCase() === USA_CULTURE_CODE\n\t\t\t\t? \"chubb-logo-en.svg\"\n\t\t\t\t: props.culture.toLocaleLowerCase() === BRASILIAN_CULTURE_CODE\n\t\t\t\t? \"chubb-logo-pt.svg\"\n\t\t\t\t: \"chubb-logo-es.svg\";\n\n\t\treturn html`\n\t\t\t<div class=\"dg-insurance-btn-container\">\n\t\t\t\t<button class=\"dg-rounded-primary-btn dg-insurance-btn\" @click=${handleInsuranceButtonClick}>\n\t\t\t\t\t${i18next.t(\"search-box-insurance-button\")}\n\t\t\t\t</button>\n\n\t\t\t\t<img class=\"dg-insurance-logo\" src=${`/images/header/${image}`} />\n\t\t\t</div>\n\t\t`;\n\t};\n\tconst insuranceTabContentTemplate = () => html`\n\t\t<div class=\"h-full w-full px-4 py-6\">\n\t\t\t${insuranceHeaderTemplate()} ${insuranceTabTextTemplate()}${insuranceTabButtonTemplate()}\n\t\t</div>\n\t`;\n\n\tconst insuranceTabTemplate = () =>\n\t\tshowInsuranceTab()\n\t\t\t? html` <div\n\t\t\t\t\tclass=${classNames(\"dg-tab dg-insurance\", {\n\t\t\t\t\t\t\"hidden\": displayedTab !== \"insurance\",\n\t\t\t\t\t\t\"with-redemption-miles-and-promo-code\":\n\t\t\t\t\t\t\tshowRedemptionMiles() && (!isRedemptionCheckboxChecked || !userInfo.IsAmericanMember),\n\t\t\t\t\t})}\n\t\t\t  >\n\t\t\t\t\t${insuranceTabContentTemplate()}\n\t\t\t  </div>`\n\t\t\t: \"\";\n\n\tconst hotelsTabTemplate = () => html`\n\t\t<div\n\t\t\tclass=${classNames(\"dg-tab dg-hotels\", {\n\t\t\t\t\"hidden\": displayedTab !== \"hotels\",\n\t\t\t\t\"with-redemption-miles-and-promo-code\":\n\t\t\t\t\tshowRedemptionMiles() && (!isRedemptionCheckboxChecked || !userInfo.IsAmericanMember),\n\t\t\t})}\n\t\t>\n\t\t\t<div id=\"hotel_container\"></div>\n\t\t</div>\n\t`;\n\n\tconst carsTabTemplate = () => {\n\t\tconst carUrl = WIDGETS.get(props.culture.toLowerCase())?.carUrl || WIDGETS.get(\"default\")?.carUrl;\n\n\t\treturn html`\n\t\t\t<div\n\t\t\t\tclass=${classNames(\"dg-tab dg-cars\", {\n\t\t\t\t\t\"hidden\": displayedTab !== \"cars\",\n\t\t\t\t\t\"with-redemption-miles-and-promo-code\":\n\t\t\t\t\t\tshowRedemptionMiles() && (!isRedemptionCheckboxChecked || !userInfo.IsAmericanMember),\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t<iframe src=${carUrl} height=\"432\" width=\"100%\" scrolling=\"no\" frameborder=\"0\"></iframe>\n\t\t\t</div>\n\t\t`;\n\t};\n\n\tconst transfersTabTemplate = () => {\n\t\tconst transferUrl =\n\t\t\tWIDGETS.get(props.culture.toLowerCase())?.transferUrl || WIDGETS.get(\"default\")?.transferUrl;\n\n\t\treturn html`\n\t\t\t<div\n\t\t\t\tclass=${classNames(\"dg-tab dg-transfers\", {\n\t\t\t\t\t\"hidden\": displayedTab !== \"transfers\",\n\t\t\t\t\t\"with-redemption-miles-and-promo-code\":\n\t\t\t\t\t\tshowRedemptionMiles() && (!isRedemptionCheckboxChecked || !userInfo.IsAmericanMember),\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t<div class=\"transfer-credit\">${i18next.t(\"search-box-transfer\")} <span>Cartrawler</span></div>\n\t\t\t\t<iframe src=${transferUrl} height=\"432\" width=\"100%\" scrolling=\"no\" frameborder=\"0\"></iframe>\n\t\t\t</div>\n\t\t`;\n\t};\n\n\tconst tabSelectorTemplate = (tab: Tab) => html`\n\t\t<li>\n\t\t\t<label class=${classNames({ [CLASS_NAMES.active]: tab.type === displayedTab })} @click=${tab.onClick}>\n\t\t\t\t<i class=${classNames(\"jsh-icon\", { [tab.iconClass]: true })}></i>\n\t\t\t\t<span>${tab.label}</span>\n\t\t\t</label>\n\t\t</li>\n\t`;\n\n\tconst tabs = (): Tab[] => {\n\t\tlet list: Tab[] = [\n\t\t\t{\n\t\t\t\ttype: \"flights\",\n\t\t\t\tlabel: i18next.t(\"search-box-tab-1\"),\n\t\t\t\ticonClass: \"jsh-plane\",\n\t\t\t\tonClick: handleFlightTabSelect,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: \"hotels\",\n\t\t\t\tlabel: i18next.t(\"search-box-tab-3\"),\n\t\t\t\ticonClass: \"jsh-bed\",\n\t\t\t\tonClick: handleHotelTabSelect,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: \"cars\",\n\t\t\t\tlabel: i18next.t(\"search-box-tab-4\"),\n\t\t\t\ticonClass: \"jsh-car\",\n\t\t\t\tonClick: handleCarTabSelect,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: \"transfers\",\n\t\t\t\tlabel: i18next.t(\"search-box-tab-5\"),\n\t\t\t\ticonClass: \"jsh-van\",\n\t\t\t\tonClick: handleTransferTabSelect,\n\t\t\t},\n\t\t];\n\n\t\tif (showInsuranceTab()) {\n\t\t\tlist = [\n\t\t\t\tlist[0],\n\t\t\t\t{\n\t\t\t\t\ttype: \"insurance\",\n\t\t\t\t\tlabel: i18next.t(\"search-box-tab-2\"),\n\t\t\t\t\ticonClass: \"jsh-plane-shield\",\n\t\t\t\t\tonClick: handleInsuranceTabSelect,\n\t\t\t\t},\n\t\t\t\t...list.slice(1),\n\t\t\t];\n\t\t}\n\n\t\tif (userInfo?.IsCug3Observer || userInfo?.IsCug3Supervisor) {\n\t\t\tlist = list.filter((tab) => tab.type === \"flights\");\n\t\t}\n\n\t\treturn list;\n\t};\n\n\t// DEVNOTE The refactor is coming...\n\treturn html`\n\t\t<div class=\"searchbox-container\" data-test-id=${TestIdDictionary.SearchboxContainer}>\n\t\t\t<div class=\"searchbox\">\n\t\t\t\t<nav\n\t\t\t\t\tclass=${classNames(\"dg-tab-selector\", {\n\t\t\t\t\t\t\"bg-[#cacaca]\": userInfo?.IsCug3Observer || userInfo?.IsCug3Supervisor || !showInsuranceTab(),\n\t\t\t\t\t\t\"with-insurance\": showInsuranceTab(),\n\t\t\t\t\t\t\"with-redemption-miles-and-promo-code\":\n\t\t\t\t\t\t\tshowRedemptionMiles() && (!isRedemptionCheckboxChecked || !userInfo.IsAmericanMember),\n\t\t\t\t\t})}\n\t\t\t\t>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t${tabs().map((tab) => tabSelectorTemplate(tab))}\n\t\t\t\t\t</ul>\n\t\t\t\t</nav>\n\t\t\t\t${flightTabTemplate()} ${insuranceTabTemplate()} ${hotelsTabTemplate()} ${carsTabTemplate()}\n\t\t\t\t${transfersTabTemplate()}\n\t\t\t</div>\n\t\t</div>\n\t`;\n};\n","import { isTabletOrMobileResolution } from \"Services/common\";\nimport { TestIdDictionary } from \"Services/test-ids/TestIdDictionary\";\nimport { COMMON_DAYJS_FORMAT, INBOUND, OUTBOUND, CULTURES_WITH_SUNDAY_AS_START_OF_WEEK } from \"Services/constants\";\nimport i18next from \"i18next\";\nimport { classMap } from \"lit-html/directives/class-map\";\nimport { useEffect, useMemo, useState } from \"haunted\";\nimport \"./dc-datepicker.scss\";\nimport { HauntedFunc } from \"Shared/haunted/HooksHelpers\";\nimport { html } from \"lit-html\";\nimport { Schedule } from \"Shared/models/Schedule\";\nimport numberFormatter from \"Services/numberFormatter\";\nimport { ApiMetadata } from \"Shared/models/ApiMetadata\";\nimport { PaneMode } from \"../opening-pane/usePane\";\nimport * as dayjs from \"dayjs\";\nimport * as Weekday from \"dayjs/plugin/weekday\";\ndayjs.extend(Weekday);\nimport * as isSameOrAfter from \"dayjs/plugin/isSameOrAfter\";\ndayjs.extend(isSameOrAfter);\nimport * as isSameOrBefore from \"dayjs/plugin/isSameOrBefore\";\ndayjs.extend(isSameOrBefore);\n\nexport const observedAttributes: (keyof Properties)[] = [];\nexport const useShadowDOM = false;\nexport const name = \"dc-datepicker\";\n\nconst DEFAULTS: Properties = {\n\tavailableDates: undefined,\n\tculture: \"es-CL\",\n\tisRange: false,\n\tmax: dayjs(\"2100-12-31\", COMMON_DAYJS_FORMAT),\n\tmetadata: undefined,\n\tmin: dayjs(\"1900-01-01\", COMMON_DAYJS_FORMAT),\n\tpaneMode: \"none\",\n\tusePrices: false,\n\tvalue: undefined,\n};\n\nexport interface Properties {\n\tavailableDates: Schedule[];\n\tculture: string;\n\tisRange?: boolean;\n\tmax?: dayjs.Dayjs;\n\tmetadata: ApiMetadata;\n\tmin?: dayjs.Dayjs;\n\tpaneMode: PaneMode;\n\tusePrices: boolean;\n\tvalue: dayjs.Dayjs | dayjs.Dayjs[];\n}\n\ninterface ChangeEventDetail {\n\tdate: dayjs.Dayjs;\n\tfromDate: dayjs.Dayjs;\n\ttoDate: dayjs.Dayjs;\n}\n\ninterface ChangeSelectedPriceDetail {\n\tprice: string;\n}\n\nexport class ChangeDateEvent extends CustomEvent<ChangeEventDetail> {\n\tconstructor(detail: ChangeEventDetail) {\n\t\tsuper(\"changeDate\", { detail });\n\t}\n}\n\nexport class ChangeSelectedPriceEvent extends CustomEvent<ChangeSelectedPriceDetail> {\n\tconstructor(detail: ChangeSelectedPriceDetail) {\n\t\tsuper(\"changePrice\", { detail });\n\t}\n}\n\nconst mapProperties = (host: Element & Properties) => {\n\tconst convertToDayJs = (value: string | dayjs.Dayjs | string[] | dayjs.Dayjs[]): dayjs.Dayjs | dayjs.Dayjs[] => {\n\t\tif (Array.isArray(value)) {\n\t\t\treturn value.map((v) => convertToDayJs(v)) as dayjs.Dayjs[];\n\t\t}\n\n\t\tif (dayjs.isDayjs(value)) {\n\t\t\treturn dayjs(value);\n\t\t}\n\n\t\tthrow new Error(`Cannot parse value: ${value}`);\n\t};\n\n\tconst props: Properties = {\n\t\tavailableDates: host.availableDates !== undefined ? host.availableDates : DEFAULTS.availableDates,\n\t\tculture: host.culture !== undefined ? host.culture : DEFAULTS.culture,\n\t\tisRange: Boolean(host.isRange),\n\t\tmax: host.max !== undefined ? host.max : DEFAULTS.max,\n\t\tmetadata: host.metadata,\n\t\tmin: host.min !== undefined ? host.min : DEFAULTS.min,\n\t\tpaneMode: host.paneMode,\n\t\tusePrices: host.usePrices,\n\t\tvalue: host.value !== undefined ? host.value : DEFAULTS.value,\n\t};\n\n\treturn props;\n};\n\nexport const Component: HauntedFunc<Properties> = (host) => {\n\tconst props = mapProperties(host);\n\n\t// HELPERS\n\n\tconst init = () => {\n\t\tconst id = `_${name}_${Math.random().toString(36).substr(2, 9)}`;\n\t\tsetComponentId(id);\n\t};\n\n\tconst collectDisplayedDates = () => {\n\t\tconst calendarMonths = isTabletOrMobileResolution()\n\t\t\t? [currentDate]\n\t\t\t: [currentDate, dayjs(currentDate).add(1, \"month\")];\n\n\t\treturn props.availableDates?.filter((date) => {\n\t\t\tconst formattedDayJsDate = dayjs.isDayjs(date.departureDate)\n\t\t\t\t? date.departureDate\n\t\t\t\t: dayjs(date.departureDate);\n\t\t\treturn calendarMonths.some(\n\t\t\t\t(month) =>\n\t\t\t\t\tformattedDayJsDate.isSameOrAfter(month.startOf(\"month\")) &&\n\t\t\t\t\tformattedDayJsDate.isSameOrBefore(month.endOf(\"month\"))\n\t\t\t);\n\t\t});\n\t};\n\n\tconst isDayDisabled = (day: dayjs.Dayjs) =>\n\t\tprops.availableDates &&\n\t\t(day.isBefore(minDate(), \"date\") ||\n\t\t\tday.isAfter(maxDate(), \"date\") ||\n\t\t\t!props.availableDates.some((schedule) => {\n\t\t\t\tconst dayJsDate = dayjs.isDayjs(schedule.departureDate)\n\t\t\t\t\t? schedule.departureDate\n\t\t\t\t\t: dayjs(schedule.departureDate);\n\t\t\t\treturn dayJsDate.isSame(day, \"date\");\n\t\t\t}));\n\n\tconst weekdays = () => {\n\t\tconst days = [\n\t\t\ti18next.t(\"mo\"),\n\t\t\ti18next.t(\"tu\"),\n\t\t\ti18next.t(\"we\"),\n\t\t\ti18next.t(\"th\"),\n\t\t\ti18next.t(\"fr\"),\n\t\t\ti18next.t(\"sa\"),\n\t\t\ti18next.t(\"su\"),\n\t\t];\n\n\t\tif (doesWeekStartOnSunday()) {\n\t\t\tdays.unshift(days.pop());\n\t\t}\n\n\t\treturn days;\n\t};\n\n\tconst move = (direction: number) => {\n\t\tsetCurrentDate(dayjs(currentDate).add(direction, \"month\"));\n\t};\n\n\tconst doesWeekStartOnSunday = () => CULTURES_WITH_SUNDAY_AS_START_OF_WEEK.includes(props.culture.toLowerCase());\n\n\tconst getNewRangeFromOneDate = (existingDay: dayjs.Dayjs, newDay: dayjs.Dayjs) => {\n\t\tif (existingDay && newDay.isSame(existingDay, \"day\")) {\n\t\t\treturn [undefined, undefined];\n\t\t}\n\n\t\tif (existingDay && newDay.isAfter(existingDay, \"day\")) {\n\t\t\treturn [existingDay, newDay];\n\t\t}\n\n\t\treturn [newDay, existingDay];\n\t};\n\n\tconst getNewRangeDates = (day: dayjs.Dayjs) => {\n\t\tconst [start, end] = selectedDate as dayjs.Dayjs[];\n\n\t\tif (!start) {\n\t\t\treturn getNewRangeFromOneDate(end, day);\n\t\t}\n\n\t\tif (!end) {\n\t\t\treturn getNewRangeFromOneDate(start, day);\n\t\t}\n\n\t\treturn [start, day];\n\t};\n\n\tconst minDate = () => (dayjs.isDayjs(props.min) ? props.min : dayjs(props.min, COMMON_DAYJS_FORMAT));\n\n\tconst maxDate = () => (dayjs.isDayjs(props.max) ? props.max : dayjs(props.max, COMMON_DAYJS_FORMAT));\n\n\tconst isSelectedDayAfterHoveredDay = (day: dayjs.Dayjs) =>\n\t\tprops.isRange &&\n\t\tArray.isArray(selectedDate) &&\n\t\tselectedDate[INBOUND] &&\n\t\tday.isSame(selectedDate[INBOUND], \"day\") &&\n\t\thoveredDay &&\n\t\thoveredDay.isBefore(day);\n\n\tconst isDaySelected = (day: dayjs.Dayjs) => {\n\t\tif (!selectedDate || isSelectedDayAfterHoveredDay(day)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (Array.isArray(selectedDate)) {\n\t\t\treturn selectedDate.some((date) => date && date.isSame(day, \"day\"));\n\t\t}\n\n\t\treturn day.isSame(selectedDate as dayjs.Dayjs, \"day\");\n\t};\n\n\tconst isDayRangeStart = (day: dayjs.Dayjs) => {\n\t\tif (!props.isRange || !selectedDate || !Array.isArray(selectedDate) || !selectedDate[OUTBOUND]) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn day.isSame(selectedDate[OUTBOUND], \"day\");\n\t};\n\n\tconst isDayRangeEnd = (day: dayjs.Dayjs) => {\n\t\tif (!props.isRange || !selectedDate || !Array.isArray(selectedDate) || !selectedDate[INBOUND]) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn day.isSame(selectedDate[INBOUND], \"day\") && !day.isSame(selectedDate[OUTBOUND], \"day\");\n\t};\n\n\tconst isDayToday = (day: dayjs.Dayjs) => day.isSame(dayjs(), \"date\");\n\n\tconst isDayInHoveredRange = (day: dayjs.Dayjs) => {\n\t\treturn (\n\t\t\tprops.isRange &&\n\t\t\tArray.isArray(selectedDate) &&\n\t\t\tselectedDate[OUTBOUND] &&\n\t\t\tday.isAfter(selectedDate[OUTBOUND], \"day\") &&\n\t\t\tday.isBefore(hoveredDay, \"day\")\n\t\t);\n\t};\n\n\tconst isDayInRange = (day: dayjs.Dayjs) =>\n\t\tArray.isArray(selectedDate) &&\n\t\tselectedDate[OUTBOUND] &&\n\t\tselectedDate[INBOUND] &&\n\t\tday.isAfter(selectedDate[OUTBOUND], \"day\") &&\n\t\tday.isBefore(selectedDate[INBOUND], \"day\");\n\n\tconst isBackOneMonthDisabled = () =>\n\t\tminDate().year() === currentDate.year() && minDate().month() >= currentDate.month();\n\n\tconst isForwardOneMonthDisabled = () => {\n\t\treturn (\n\t\t\tmaxDate().year() === currentDate.year() &&\n\t\t\tmaxDate().month() <= currentDate.month() + (isTabletOrMobileResolution() ? 0 : 1)\n\t\t);\n\t};\n\n\tconst addPlacerholderDaysInFront = (index: number) =>\n\t\tArray.from(Array(doesWeekStartOnSunday() ? (index + 7) % 7 : index));\n\n\tconst addPlacerholderDaysAfter = (index: number) =>\n\t\tArray.from(Array(6 - (doesWeekStartOnSunday() ? (index + 7) % 7 : index)));\n\n\tconst getCalendarForMonth = (offset: number): dayjs.Dayjs[][] => {\n\t\tconst offsetDate = dayjs(currentDate).add(offset, \"month\");\n\n\t\tconst firstDayIndex = dayjs(offsetDate).startOf(\"month\").weekday();\n\t\tlet days: dayjs.Dayjs[] = addPlacerholderDaysInFront(firstDayIndex);\n\n\t\tlet day = dayjs(offsetDate).startOf(\"month\");\n\t\tconst endOfMonth = dayjs(offsetDate).endOf(\"month\");\n\n\t\twhile (day.isSameOrBefore(endOfMonth)) {\n\t\t\tdays.push(dayjs(day));\n\t\t\tday = dayjs(day.add(1, \"day\"));\n\t\t}\n\n\t\tconst lastDayIndex = dayjs(offsetDate).endOf(\"month\").weekday();\n\t\tdays = days.concat(addPlacerholderDaysAfter(lastDayIndex));\n\n\t\tconst retVal = days.reduce((weeks, weekDay, i) => {\n\t\t\tconst weekIndex = Math.floor(i / 7);\n\t\t\tweeks[weekIndex] = [].concat(weeks[weekIndex] || [], weekDay);\n\t\t\treturn weeks;\n\t\t}, []);\n\n\t\treturn retVal;\n\t};\n\n\tconst getInitialSelectedDate = () => {\n\t\tif (props.isRange && props.value && !Array.isArray(props.value)) {\n\t\t\tthrow new Error(\"If the datepicker is set to Range, the value should be an array.\");\n\t\t}\n\n\t\tif (!props.isRange && props.value && Array.isArray(props.value)) {\n\t\t\tthrow new Error(\"If the datepicker is NOT set to Range, the value should NOT be an array.\");\n\t\t}\n\n\t\tif (!props.value) {\n\t\t\treturn props.isRange ? [undefined, undefined] : undefined;\n\t\t}\n\n\t\tif (Array.isArray(props.value)) {\n\t\t\treturn props.value.reduce(\n\t\t\t\t(aggr, day) =>\n\t\t\t\t\taggr.concat(day ? (dayjs.isDayjs(day) ? dayjs(day) : dayjs(day, COMMON_DAYJS_FORMAT)) : undefined),\n\t\t\t\t[]\n\t\t\t);\n\t\t}\n\n\t\treturn dayjs.isDayjs(props.value) ? dayjs(props.value) : dayjs(props.value, COMMON_DAYJS_FORMAT);\n\t};\n\n\tconst initialCurrentDate = () => {\n\t\tconst value = Array.isArray(props.value) ? props.value[OUTBOUND] : props.value;\n\n\t\treturn value\n\t\t\t? dayjs.isDayjs(value)\n\t\t\t\t? value\n\t\t\t\t: dayjs(value, COMMON_DAYJS_FORMAT)\n\t\t\t: dayjs().isSameOrAfter(minDate(), \"date\") && dayjs().isSameOrBefore(maxDate(), \"date\")\n\t\t\t? dayjs()\n\t\t\t: minDate();\n\t};\n\n\tconst updateInputField = () => {\n\t\tif (inputElem()) {\n\t\t\tinputElem().value = (props.value as dayjs.Dayjs).format(COMMON_DAYJS_FORMAT);\n\t\t}\n\t};\n\n\tconst inputElem = () => document.getElementById(componentId) as HTMLInputElement;\n\n\tconst formatSelectedPrice = (day: dayjs.Dayjs) => {\n\t\tconst price = props.availableDates?.find((schedule) => schedule.departureDate.isSame(day, \"day\")).price;\n\n\t\treturn price ? price.toString().trim() : undefined;\n\t};\n\n\t// EVENT HANDLERS\n\n\t// DEVNOTE All this checking if day is of type Dayjs is because sometimes strange change events are fired\n\t// TODO Try to eliminate unwanted change events\n\tconst dispatchChange = (value: dayjs.Dayjs | dayjs.Dayjs[], selectedPrice?: string) => {\n\t\tconst date = !Array.isArray(value) && dayjs.isDayjs(value) ? value : undefined;\n\t\tconst fromDate =\n\t\t\tArray.isArray(value) && value.every((d) => !d || dayjs.isDayjs(d)) && value.length > 0\n\t\t\t\t? value[OUTBOUND]\n\t\t\t\t: undefined;\n\t\tconst toDate =\n\t\t\tArray.isArray(value) && value.every((d) => !d || dayjs.isDayjs(d)) && value.length > 1\n\t\t\t\t? value[INBOUND]\n\t\t\t\t: undefined;\n\n\t\thost.dispatchEvent(\n\t\t\tnew ChangeDateEvent({\n\t\t\t\tdate,\n\t\t\t\tfromDate,\n\t\t\t\ttoDate,\n\t\t\t})\n\t\t);\n\t\tif (selectedPrice) {\n\t\t\thost.dispatchEvent(\n\t\t\t\tnew ChangeSelectedPriceEvent({\n\t\t\t\t\tprice: selectedPrice,\n\t\t\t\t})\n\t\t\t);\n\t\t}\n\t};\n\n\tconst handleMouseEnter = (day: dayjs.Dayjs) => {\n\t\tif (hoveredDay?.isSame(day, \"day\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetHoveredDay(day);\n\t};\n\n\tconst handleMouseLeave = (day: dayjs.Dayjs) => {\n\t\tif (!hoveredDay?.isSame(day, \"day\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetHoveredDay(undefined);\n\t};\n\n\tconst handleBack = (e: MouseEvent) => {\n\t\te.stopPropagation();\n\n\t\tif (isBackOneMonthDisabled()) {\n\t\t\treturn;\n\t\t}\n\n\t\tmove(-1);\n\t};\n\n\tconst handleForward = (e: MouseEvent) => {\n\t\te.stopPropagation();\n\n\t\tif (isForwardOneMonthDisabled()) {\n\t\t\treturn;\n\t\t}\n\n\t\tmove(1);\n\t};\n\n\tconst handleDateClick = (e: MouseEvent, day: dayjs.Dayjs) => {\n\t\te.stopPropagation();\n\n\t\tif (isDayDisabled(day)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (Array.isArray(selectedDate)) {\n\t\t\tconst [start, end] = getNewRangeDates(day);\n\t\t\tconst newValues = [start ? dayjs(start) : undefined, end ? dayjs(end) : undefined];\n\t\t\tsetSelectedDate(newValues);\n\n\t\t\tdispatchChange(newValues, formatSelectedPrice(end));\n\t\t} else {\n\t\t\tconst newValue = dayjs(day);\n\t\t\tsetSelectedDate(newValue);\n\n\t\t\tdispatchChange(newValue, formatSelectedPrice(newValue));\n\t\t}\n\n\t\tsetCurrentDate(dayjs(day));\n\n\t\tif (inputElem()) {\n\t\t\tinputElem().classList.remove(\"invalid\");\n\t\t}\n\t};\n\n\t// COMPONENT\n\n\tconst [componentId, setComponentId] = useState<string>(\"\");\n\tconst [selectedDate, setSelectedDate] = useState<dayjs.Dayjs | dayjs.Dayjs[]>(getInitialSelectedDate());\n\tconst [currentDate, setCurrentDate] = useState<dayjs.Dayjs>(initialCurrentDate());\n\tconst [hoveredDay, setHoveredDay] = useState<dayjs.Dayjs>(undefined);\n\n\tconst lowestDisplayedPriceSchedule = useMemo(() => {\n\t\tconst displayedDates = collectDisplayedDates();\n\t\tif (!displayedDates || displayedDates.length === 0) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn displayedDates.reduce((acc, curr) => {\n\t\t\tif (acc.price < curr.price) {\n\t\t\t\treturn acc;\n\t\t\t}\n\t\t\treturn curr;\n\t\t}, displayedDates[0]);\n\t}, [props.availableDates, currentDate]);\n\n\tuseEffect(() => updateInputField, [props.value]);\n\n\tuseEffect(init, []);\n\n\t// TEMPLATES\n\n\tconst navigationPlaceholderTemplate = () => {\n\t\tconst tempClassMap = classMap({\n\t\t\t\"dg-dp-square\": true,\n\t\t\t\"dg-dp-navigation\": true,\n\t\t\t\"dg-dp-disabled\": true,\n\t\t\t\"hidden-sm-down\": true,\n\t\t});\n\n\t\treturn html`<span class=${tempClassMap}></span>`;\n\t};\n\n\tconst forwardOneMonthTemplate = (hiddenOnDesktop = false) => {\n\t\tconst tempClassMap = classMap({\n\t\t\t\"dg-dp-month-forward\": true,\n\t\t\t\"dg-dp-square\": true,\n\t\t\t\"dg-dp-navigation\": true,\n\t\t\t\"dg-dp-disabled\": isForwardOneMonthDisabled(),\n\t\t\t\"hidden-md-up\": hiddenOnDesktop,\n\t\t});\n\n\t\treturn html`<span\n\t\t\tclass=${tempClassMap}\n\t\t\tdata-test-id=${TestIdDictionary.Date.MoveForward}\n\t\t\t@click=${handleForward}\n\t\t></span>`;\n\t};\n\n\tconst backOneMonthTemplate = (hiddenOnDesktop = false) => {\n\t\tconst tempClassMap = classMap({\n\t\t\t\"dg-dp-month-back\": true,\n\t\t\t\"dg-dp-square\": true,\n\t\t\t\"dg-dp-navigation\": true,\n\t\t\t\"dg-dp-disabled\": isBackOneMonthDisabled(),\n\t\t\t\"hidden-md-up\": hiddenOnDesktop,\n\t\t});\n\n\t\treturn html`<span\n\t\t\tclass=${tempClassMap}\n\t\t\t@click=${handleBack}\n\t\t\tdata-test-id=${TestIdDictionary.Date.MoveBack}\n\t\t></span>`;\n\t};\n\n\tconst firstMonthNavigationTemplate = () => html`\n\t\t<div class=\"w-full grid grid-cols-3 items-center justify-center\">\n\t\t\t${backOneMonthTemplate()}\n\t\t\t<span class=\"dg-dp-unit-nav\">\n\t\t\t\t<span\n\t\t\t\t\tclass=\"font-bold\"\n\t\t\t\t\tdata-test-id=${TestIdDictionary.Date.MonthName}\n\t\t\t\t\tdata-test-value=${currentDate.format(\"YYYY-MM\")}\n\t\t\t\t>\n\t\t\t\t\t${dayjs(currentDate).format(\"MMMM\")}&nbsp;\n\t\t\t\t</span>\n\t\t\t\t${dayjs(currentDate).format(\"YYYY\")}\n\t\t\t</span>\n\t\t\t${navigationPlaceholderTemplate()} ${forwardOneMonthTemplate(true)}\n\t\t</div>\n\t`;\n\n\tconst secondMonthNavigationTemplate = () => {\n\t\tconst dateToDisplay = dayjs(currentDate).add(1, \"month\");\n\n\t\treturn html`<div class=\"w-full grid grid-cols-3 items-center justify-center\">\n\t\t\t${backOneMonthTemplate(true)} ${navigationPlaceholderTemplate()}\n\t\t\t<span class=\"dg-dp-unit-nav\">\n\t\t\t\t<span\n\t\t\t\t\tclass=\"font-bold\"\n\t\t\t\t\tdata-test-id=${TestIdDictionary.Date.MonthName}\n\t\t\t\t\tdata-test-value=${dateToDisplay.format(\"YYYY-MM\")}\n\t\t\t\t>\n\t\t\t\t\t${dateToDisplay.format(\"MMMM\")}&nbsp;\n\t\t\t\t</span>\n\t\t\t\t${dateToDisplay.format(\"YYYY\")}\n\t\t\t</span>\n\t\t\t${forwardOneMonthTemplate()}\n\t\t</div>`;\n\t};\n\n\tconst weekdaysHeaderTemplate = () => html`<div class=\"w-full grid grid-cols-7\">\n\t\t${weekdays().map((weekday) => html`<span class=\"dg-dp-square dg-dp-col-header\">${weekday}</span>`)}\n\t</div>`;\n\n\tconst weekTemplate = (week: dayjs.Dayjs[]) =>\n\t\thtml` <div class=\"w-full grid grid-cols-7\">${week.map(dayTemplate)}</div> `;\n\n\tconst dayTemplate = (day: dayjs.Dayjs) => {\n\t\tconst currentSchedule = day\n\t\t\t? props.availableDates?.find((schedule) => schedule.departureDate.isSame(day, \"day\"))\n\t\t\t: undefined;\n\n\t\treturn day\n\t\t\t? html`<span\n\t\t\t\t\tclass=\"${classMap({\n\t\t\t\t\t\t\"dg-dp-square\": true,\n\t\t\t\t\t\t\"dg-dp-date\": true,\n\t\t\t\t\t\t\"dg-dp-selected\": isDaySelected(day),\n\t\t\t\t\t\t\"dg-dp-today\": isDayToday(day),\n\t\t\t\t\t\t\"dg-dp-disabled\": isDayDisabled(day),\n\t\t\t\t\t\t\"dg-dp-range-start\": isDayRangeStart(day),\n\t\t\t\t\t\t\"dg-dp-in-range\": (!hoveredDay && isDayInRange(day)) || isDayInHoveredRange(day),\n\t\t\t\t\t\t\"dg-dp-range-end\": !hoveredDay && isDayRangeEnd(day),\n\t\t\t\t\t\t\"dg-dp-hover-dg-dp-range-end\": props.isRange,\n\t\t\t\t\t\t\"lowest-price\":\n\t\t\t\t\t\t\tprops.usePrices && currentSchedule?.price === lowestDisplayedPriceSchedule?.price,\n\t\t\t\t\t})}\"\n\t\t\t\t\t@mouseenter=${() => handleMouseEnter(day)}\n\t\t\t\t\t@mouseleave=${() => handleMouseLeave(day)}\n\t\t\t\t\t@click=${(e: MouseEvent) => handleDateClick(e, day)}\n\t\t\t\t\tdata-test-id=${TestIdDictionary.Date.Date}\n\t\t\t\t\tdata-test-value=${day.format(COMMON_DAYJS_FORMAT)}\n\t\t\t  >\n\t\t\t\t\t${day.format(\"DD\")}\n\t\t\t\t\t${props.usePrices\n\t\t\t\t\t\t? html`<span\n\t\t\t\t\t\t\t\t>${currentSchedule && currentSchedule.price\n\t\t\t\t\t\t\t\t\t? numberFormatter({\n\t\t\t\t\t\t\t\t\t\t\tamount: currentSchedule.price,\n\t\t\t\t\t\t\t\t\t\t\tcurrency: currentSchedule.currency,\n\t\t\t\t\t\t\t\t\t\t\tculture: props.culture,\n\t\t\t\t\t\t\t\t\t\t\tleadingSign: true,\n\t\t\t\t\t\t\t\t\t\t\tforcedToRemoveDecimals: true,\n\t\t\t\t\t\t\t\t\t  }).replace(\" \", \"\")\n\t\t\t\t\t\t\t\t\t: \"\"}</span\n\t\t\t\t\t\t  >`\n\t\t\t\t\t\t: \"\"}\n\t\t\t  </span>`\n\t\t\t: html`<span class=\"dg-dp-square\">&nbsp;</span>`;\n\t};\n\n\tconst weeksTemplate = (offset = 0) => html`${getCalendarForMonth(offset).map(weekTemplate)}`;\n\n\treturn html` <div class=\"flex flex-col\">\n\t\t<div class=\"dg-dp-months-container\">\n\t\t\t<div class=\"dg-dp-month\" data-test-id=${TestIdDictionary.Date.MonthContainer}>\n\t\t\t\t${firstMonthNavigationTemplate()} ${weekdaysHeaderTemplate()} ${weeksTemplate()}\n\t\t\t\t<div class=\"separator-line\"></div>\n\t\t\t</div>\n\t\t\t<div class=\"dg-dp-month hidden-sm-down\" data-test-id=${TestIdDictionary.Date.MonthContainer}>\n\t\t\t\t${secondMonthNavigationTemplate()} ${weekdaysHeaderTemplate()} ${weeksTemplate(1)}\n\t\t\t</div>\n\t\t</div>\n\t</div>`;\n};\n","import { html } from \"haunted\";\nimport { useEffect } from \"Shared/haunted/CustomHooks\";\nimport { HauntedFunc } from \"Shared/haunted/HooksHelpers\";\n\nexport const useShadowDOM = false;\nexport const name = \"ac-smart-timer\";\n\nexport const observedAttributes: (keyof Attributes)[] = [\"seconds\", \"url\"];\n\nexport interface Attributes {\n\tseconds: string;\n\turl: string;\n}\n\nexport interface Props {\n\tseconds: number;\n\turl: string;\n}\n\nexport const Component: HauntedFunc<Props> = (host) => {\n\tconst props: Props = {\n\t\tseconds: Number(host.seconds),\n\t\turl: host.url,\n\t};\n\n\tconst init = () => {\n\t\twindow.setTimeout(() => {\n\t\t\twindow.location.href = props.url;\n\t\t}, Number(props.seconds) * 1000);\n\t};\n\n\tuseEffect(init, []);\n\n\treturn html``;\n};\n","import { ApiCultureSettings } from \"ComponentModels/ApiCultureSettings\";\nimport { CultureListItem } from \"Components/main-menu/useCultureSelector\";\n\nconst insensitiveEquals = (string1: string, string2: string) => {\n\treturn string1?.trim().toLowerCase() === string2?.trim().toLowerCase();\n};\n\nconst mainCultureSubCultureCodes = (settings: ApiCultureSettings, currentCultureCode: string): string[] =>\n\tsettings?.Cultures?.find((culture) => insensitiveEquals(culture.Main, currentCultureCode))?.SubCultures || [];\n\nconst nonMainCultureSubCultureCodes = (settings: ApiCultureSettings, currentCultureCode: string): string[] => {\n\tconst mainCultureSubCultures = mainCultureSubCultureCodes(settings, currentCultureCode);\n\n\treturn (\n\t\tsettings?.AllCultures.filter(\n\t\t\t(cultureCode) =>\n\t\t\t\t!mainCultureSubCultures.some((subCultureCode) => insensitiveEquals(subCultureCode, cultureCode))\n\t\t) || []\n\t);\n};\n\nconst convertCodesToCultureListItems = (cultureList: CultureListItem[], cultureCodes: string[]): CultureListItem[] =>\n\tcultureCodes.map((cultureCode) => mapToCultureListItem(cultureList, cultureCode)).filter((listItem) => listItem);\n\nconst getSelectableMainCultureSubCultures = (\n\tsettings: ApiCultureSettings,\n\tcultureList: CultureListItem[],\n\tcurrentCulture: string\n): CultureListItem[] =>\n\tconvertCodesToCultureListItems(cultureList, mainCultureSubCultureCodes(settings, currentCulture));\n\nconst getSelectableNonMainCultureSubCultures = (\n\tsettings: ApiCultureSettings,\n\tcultureList: CultureListItem[],\n\tcurrentCulture: string\n): CultureListItem[] =>\n\tconvertCodesToCultureListItems(cultureList, nonMainCultureSubCultureCodes(settings, currentCulture)).sort((a, b) =>\n\t\ta.name.toLowerCase() < b.name.toLowerCase() ? -1 : 1\n\t);\n\nexport const mapToCultureListItem = (cultureList: CultureListItem[], cultureCode: string) =>\n\tcultureList.find((listItem) => insensitiveEquals(listItem.culture, cultureCode));\n\nexport const isCultureEnabled = (settings: ApiCultureSettings, cultureCode: string) =>\n\t!settings?.Cultures.some((culture) => culture.IsDisabled && insensitiveEquals(culture.Main, cultureCode));\n\nexport const getSelectableCulturesInOrder = (\n\tsettings: ApiCultureSettings,\n\tcultureList: CultureListItem[],\n\tcurrentCultureCode: string\n): CultureListItem[] => {\n\tif (!settings) return cultureList;\n\n\tconst mainCultureSubCultures = getSelectableMainCultureSubCultures(settings, cultureList, currentCultureCode);\n\tconst remainingSubCultures = getSelectableNonMainCultureSubCultures(settings, cultureList, currentCultureCode);\n\n\treturn [...mainCultureSubCultures, ...remainingSubCultures];\n};\n","import { useNavitaireSettings } from \"ComponentHelpers/useNavitaireSettings\";\nimport { useMemo, useState } from \"Shared/haunted/CustomHooks\";\nimport { html } from \"lit-html\";\nimport { isCultureEnabled, getSelectableCulturesInOrder, mapToCultureListItem } from \"ComponentHelpers/CultureHelper\";\nimport { useRef } from \"haunted\";\nimport { ref } from \"Components/directives/ref\";\nimport classNames from \"classnames\";\nimport { useUserInfo } from \"ComponentHelpers/useUserInfo\";\n\nexport interface Props {\n\tculture: string;\n\tlanguageAndCountry: (culture: string) => { language: string; country: string };\n\tonOpen: () => void;\n}\n\nexport interface CultureListItem {\n\tculture: string;\n\tname: string;\n}\n\nexport const useCultureSelector = (props: Props) => {\n\tconst listElem = useRef<HTMLDivElement>(undefined);\n\tconst navitaireSettings = useNavitaireSettings();\n\n\tconst [isCountryListOpened, setIsCountryListOpened] = useState<boolean>(false);\n\n\tconst userInfo = useUserInfo();\n\n\tconst cultureList: CultureListItem[] = useMemo(() => {\n\t\tconst list = window.JetSmart.DynamicSettings.DynamicCultureNameSettings || [];\n\n\t\tconst selectedLanguage = props.languageAndCountry(props.culture).language;\n\n\t\t// Convert dynamic culture name settings to culture list items\n\t\tconst newList = list.map((item) => {\n\t\t\tconst name = selectedLanguage === \"es\" ? item?.Es : selectedLanguage === \"en\" ? item?.En : item?.Pt;\n\n\t\t\treturn {\n\t\t\t\tculture: item?.Culture,\n\t\t\t\tname: name || \"\",\n\t\t\t};\n\t\t});\n\n\t\treturn newList.filter((listItem) =>\n\t\t\tisCultureEnabled(navitaireSettings?.value?.cultureSettings, listItem.culture)\n\t\t);\n\t}, [navitaireSettings?.value?.cultureSettings]);\n\n\tconst cultures = useMemo(\n\t\t() => getSelectableCulturesInOrder(navitaireSettings?.value?.cultureSettings, cultureList, props.culture),\n\t\t[cultureList, props.culture, navitaireSettings?.value?.cultureSettings]\n\t);\n\n\t// Helpers\n\n\tconst canSwitchCulture = () =>\n\t\tnavitaireSettings?.value?.cultureSettings?.Cultures?.length &&\n\t\tuserInfo.BancoEstadoCategory === 0 &&\n\t\t!userInfo.IsCug3Observer &&\n\t\t!userInfo.IsCug3Supervisor &&\n\t\t!userInfo.IsPeruCompraAdmin &&\n\t\t!userInfo.IsPeruCompraMember;\n\n\t// Events\n\n\tconst handleCountryListOpen = () => {\n\t\tif (!canSwitchCulture()) return;\n\n\t\tsetIsCountryListOpened(!isCountryListOpened);\n\t\tprops.onOpen();\n\t};\n\n\t// Templates\n\n\tconst cultureTemplate = (culture: CultureListItem) => html`\n\t\t<img class=${classNames(\"flag\", `flag-${culture.culture.substring(3)}`)} />\n\t\t<span> ${culture.name}</span>\n\t`;\n\n\tconst openCultureTemplate = () => {\n\t\tconst selectedCulture = mapToCultureListItem(cultureList, props.culture);\n\t\treturn cultureTemplate(selectedCulture);\n\t};\n\n\tconst cultureOptionTemplate = (culture: CultureListItem) => {\n\t\tconst { language, country } = props.languageAndCountry(culture.culture);\n\t\tconst url = `/ChangeLanguage?newCountryCode=${country}&newLanguagecode=${language}`;\n\n\t\treturn html`<a href=${url}>${cultureTemplate(culture)}</a>`;\n\t};\n\n\tconst cultureDropdownTemplate = () =>\n\t\tcanSwitchCulture()\n\t\t\t? html`\n\t\t\t\t\t<div\n\t\t\t\t\t\tref=${ref(listElem)}\n\t\t\t\t\t\tclass=\"cultures\"\n\t\t\t\t\t\tstyle=\"max-height: ${isCountryListOpened ? `${listElem.current.scrollHeight}px` : \"0\"};\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t${cultures.map(cultureOptionTemplate)}\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t  `\n\t\t\t: \"\";\n\n\tconst htmlTemplate = () =>\n\t\tcultures.length > 0\n\t\t\t? html`\n\t\t\t\t\t<div class=\"dg-culture-dropdown-opener\">\n\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t@click=${handleCountryListOpen}\n\t\t\t\t\t\t\tclass=${classNames(\"menu-button with-flag\", {\n\t\t\t\t\t\t\t\t\"opened\": isCountryListOpened,\n\t\t\t\t\t\t\t\t\"no-arrow\": !canSwitchCulture(),\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t${openCultureTemplate()}\n\t\t\t\t\t\t</a>\n\t\t\t\t\t\t${cultureDropdownTemplate()}\n\t\t\t\t\t</div>\n\t\t\t  `\n\t\t\t: \"\";\n\n\treturn { closeCountryList: () => setIsCountryListOpened(false), htmlTemplate };\n};\n","import classNames from \"classnames\";\nimport i18next from \"i18next\";\nimport { html } from \"lit-html\";\nimport { CHILEAN_CULTURE_CODE, PERUVIAN_CULTURE_CODE } from \"Services/constants\";\n\nexport interface Props {\n\tbookingUrl: string;\n\tabsoluteAction: string;\n\tisOpen: boolean;\n\tculture: string;\n\tsetIsOpen: (value: boolean) => void;\n}\n\nconst loginOptionClasses =\n\t\"flex h-[90px] cursor-pointer select-none flex-col items-center justify-between rounded-lg border border-solid border-be-gray-9 p-3 text-[14px] text-brand-secondary hover:bg-gray-100 sm:h-[106px] sm:text-[16px]\";\n\nexport const useLoginWidget = (props: Props) => {\n\t// Helpers\n\tconst handlePersonLoginClick = () => {\n\t\tconst loginUrl = `${props.bookingUrl}/V2/Login?culture=${props.culture}&url=${props.absoluteAction}`;\n\t\twindow.location.href = loginUrl;\n\t};\n\n\tconst handleAmericanLoginClick = () => {\n\t\tconst encodedUrl = encodeURIComponent(`${window.location.origin}/Login/AmericanAirlines`);\n\t\tconst loginUrl = `${window.JetSmart?.AmericanAirlinesSettings?.LoginAddress}?locale=${props.culture}&target=${encodedUrl}`;\n\t\twindow.location.href = loginUrl;\n\t};\n\n\tconst handlePeruComprasLoginClick = () => {\n\t\tconst peruCompraLoginUrl = `${props.bookingUrl}/V2/Login?pcompra=1&culture=${props.culture}&url=${props.absoluteAction}`;\n\t\twindow.location.href = peruCompraLoginUrl;\n\t};\n\n\tconst handleBancoLoginClick = () => {\n\t\tconst bancoLoginUrl = `${props.bookingUrl}/V2/Login?bancoe=1&culture=${props.culture}&url=${props.absoluteAction}`;\n\t\twindow.location.href = bancoLoginUrl;\n\t};\n\n\tconst agencyLoginClick = () => {\n\t\tconst agencyLoginUrl = `${props.bookingUrl}/V2/Login?agency=1&culture=${props.culture}&url=${props.absoluteAction}`;\n\t\twindow.location.href = agencyLoginUrl;\n\t};\n\n\tconst companyLoginClick = () => {\n\t\tconst companyLoginUrl = `${props.bookingUrl}/V2/Login?company=1&culture=${props.culture}&url=${props.absoluteAction}`;\n\t\twindow.location.href = companyLoginUrl;\n\t};\n\n\tconst [language] = props.culture.toLowerCase().split(\"-\");\n\n\t// Events\n\n\t// Templates\n\n\tconst separatorTemplate = () => html`<div class=\"border-b border-solid border-be-gray-9\"></div>`;\n\n\tconst personTemplate = () => html`\n\t\t<div class=${loginOptionClasses} @click=${handlePersonLoginClick}>\n\t\t\t<i class=\"jsh-icon jsh-person mb-2 text-[44px] sm:text-5xl\"></i>\n\t\t\t${i18next.t(\"Personas\")}\n\t\t</div>\n\t`;\n\n\tconst bancoEstadoTemplate = () =>\n\t\tprops.culture === CHILEAN_CULTURE_CODE\n\t\t\t? html`\n\t\t\t\t\t<div class=${loginOptionClasses} @click=${handleBancoLoginClick}>\n\t\t\t\t\t\t<img class=\"mb-2 w-10 sm:w-12\" src=\"/images/banco-estado/be-only-logo.svg\" />\n\t\t\t\t\t\t${i18next.t(\"Banco Estado\")}\n\t\t\t\t\t</div>\n\t\t\t  `\n\t\t\t: \"\";\n\n\tconst americanAirlinesTemplate = () =>\n\t\twindow.JetSmart?.DynamicSettings?.IsAmericanOn\n\t\t\t? html`<div class=${loginOptionClasses} @click=${handleAmericanLoginClick}>\n\t\t\t\t\t<div class=\"flex h-12 items-center justify-center\">\n\t\t\t\t\t\t<img class=\"mb-2 h-4\" src=\"/images/american-airlines/aa-logo.png\" />\n\t\t\t\t\t</div>\n\t\t\t\t\t${i18next.t(\"AAdvantage® Program\")}\n\t\t\t  </div>`\n\t\t\t: \"\";\n\n\tconst peruComprasTemplate = () =>\n\t\tprops.culture === PERUVIAN_CULTURE_CODE\n\t\t\t? html`\n\t\t\t\t\t<div class=${loginOptionClasses} @click=${handlePeruComprasLoginClick}>\n\t\t\t\t\t\t<img class=\"mb-2 h-10\" src=\"/images/peru-compras/pcra-logo-black.svg\" />\n\t\t\t\t\t\t${i18next.t(\"Peru Compras\")}\n\t\t\t\t\t</div>\n\t\t\t  `\n\t\t\t: \"\";\n\n\tconst cugOptionsTemplate = () => html`\n\t\t<div class=\"text-l mb-[17px] flex w-full text-left font-extrabold text-brand-secondary sm:text-xl\">\n\t\t\t${i18next.t(\"Or you can log in as a company or an agency\")}:\n\t\t</div>\n\t\t${separatorTemplate()}\n\t\t<div class=\"flex items-center justify-between pb-1 pt-5 sm:pb-3\">\n\t\t\t<div\n\t\t\t\tclass=\"flex h-[90px] w-[141px] cursor-pointer select-none flex-col items-center justify-center rounded-lg border border-solid border-be-gray-9 p-4 hover:bg-gray-100 sm:h-fit sm:max-h-24 sm:w-64\"\n\t\t\t\t@click=${agencyLoginClick}\n\t\t\t>\n\t\t\t\t<img class=\"w-20 sm:w-24\" src=\"/images/cug2/cug-logo-agency-${language.trim().toLowerCase()}.svg\" />\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tclass=\"flex h-[90px] w-[141px] cursor-pointer select-none flex-col items-center justify-center rounded-lg border border-solid border-be-gray-9 p-4 hover:bg-gray-100 sm:h-fit sm:max-h-24 sm:w-64\"\n\t\t\t\t@click=${companyLoginClick}\n\t\t\t>\n\t\t\t\t<img class=\"w-20 sm:w-24\" src=\"/images/cug2/cug-logo-company-${language.trim().toLowerCase()}.svg\" />\n\t\t\t</div>\n\t\t</div>\n\t`;\n\n\tconst closeButtonTemplate = () =>\n\t\thtml`\n\t\t\t<div\n\t\t\t\tclass=\"absolute right-3 top-3 z-10 flex h-6 w-6 cursor-pointer items-center justify-center rounded-full bg-gray-500 font-semibold leading-none text-white hover:bg-gray-600\"\n\t\t\t\t@click=${() => props.setIsOpen(false)}\n\t\t\t>\n\t\t\t\t&times;\n\t\t\t</div>\n\t\t`;\n\n\tconst htmlTemplate = () => html`\n\t\t<div\n\t\t\tclass=${classNames(\"sm:hidden fixed left-0 top-0 h-full w-full bg-black/40\", {\n\t\t\t\tfixed: props.isOpen,\n\t\t\t\thidden: !props.isOpen,\n\t\t\t})}\n\t\t></div>\n\t\t<div\n\t\t\tclass=${classNames(\"absolute bg-white sm:w-160 w-80 sm:left-auto sm:m-0 sm:top-auto common-transition\", {\n\t\t\t\t\"rounded-lg sm:rounded-none border border-solid border-be-gray-9\": true,\n\t\t\t\t\"mx-auto left-0 right-0 top-[70px]\": props.isOpen,\n\t\t\t\t\"sm:right-0\": props.isOpen,\n\t\t\t\t\"-right-160\": !props.isOpen,\n\t\t\t})}\n\t\t>\n\t\t\t<div class=\"relative p-4 sm:px-8 sm:py-4\">\n\t\t\t\t${closeButtonTemplate()}\n\t\t\t\t<div class=\"text-l mb-[17px] flex w-full font-extrabold text-brand-secondary sm:text-xl\">\n\t\t\t\t\t${i18next.t(\"Log in with your account as\")}:\n\t\t\t\t</div>\n\t\t\t\t${separatorTemplate()}\n\t\t\t\t<div class=\"justify-center py-5 evenly-spaced-grid sm:grid sm:justify-between\">\n\t\t\t\t\t${personTemplate()} ${bancoEstadoTemplate()} ${peruComprasTemplate()} ${americanAirlinesTemplate()}\n\t\t\t\t</div>\n\t\t\t\t${cugOptionsTemplate()}\n\t\t\t</div>\n\t\t</div>\n\t`;\n\n\treturn { htmlTemplate };\n};\n","import classNames from \"classnames\";\nimport { useUserInfo } from \"ComponentHelpers/useUserInfo\";\nimport i18next from \"i18next\";\nimport { html } from \"lit-html\";\nimport { unsafeHTML } from \"lit-html/directives/unsafe-html\";\nimport { getAmericanTierDisplayNameTemplate, groupNumber } from \"Services/common\";\nimport { LINKS } from \"Services/constants\";\nimport { TestIdDictionary } from \"Services/test-ids/TestIdDictionary\";\n\nexport interface Props {\n\tculture: string;\n\tisHeaderSemiCollapsed: boolean;\n\tisAmericanDropdownOpen: boolean;\n\tsetIsAmericanDropdownOpen: (isOpen: boolean) => void;\n\tcloseCountryDropdown: () => void;\n\thandleLogout: () => void;\n\thandleCheckinModalOpen: () => void;\n\thandleAdminModalOpen: () => void;\n}\n\nexport const useAmericanUserData = (props: Props) => {\n\tconst userInfo = useUserInfo();\n\n\t// Events\n\n\tconst handleAmericanDropdownClick = () => {\n\t\tprops.setIsAmericanDropdownOpen(!props.isAmericanDropdownOpen);\n\t\tprops.closeCountryDropdown();\n\t};\n\n\tconst handleNavigateToAmericanAccount = (e: MouseEvent) => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\twindow.open(`${LINKS.AMERICAN_USER_ACCOUNT_REDIRECT}?locale=${props.culture}`, \"_blank\");\n\t};\n\n\t// Templates\n\n\tconst formattedAmericanTierNameTemplate = () => html`\n\t\t<div\n\t\t\tclass=${classNames(\n\t\t\t\t\"mb-1 mt-2 flex justify-center text-center font-semibold md:mb-0 md:text-[12px] md:group-hover:text-white\",\n\t\t\t\t{\n\t\t\t\t\t\"text-brand-secondary\": !props.isAmericanDropdownOpen,\n\t\t\t\t\t\"text-brand-secondary md:text-white\": props.isAmericanDropdownOpen,\n\t\t\t\t}\n\t\t\t)}\n\t\t>\n\t\t\t${getAmericanTierDisplayNameTemplate(userInfo.AmericanMemberTier)}\n\t\t</div>\n\t`;\n\n\tconst americanTemplate = () => html`\n\t\t<div\n\t\t\tclass=${classNames(\n\t\t\t\t\"american-member-data-container min-w-full border-b-[1px] border-solid border-be-gray-9 md:min-w-0 md:border-0 md:flex md:flex-col md:justify-center md:h-full\",\n\t\t\t\t{\n\t\t\t\t\t\"dropdown-opened\": props.isAmericanDropdownOpen,\n\t\t\t\t}\n\t\t\t)}\n\t\t\ttabindex=\"-1\"\n\t\t\t@click=${handleAmericanDropdownClick}\n\t\t>\n\t\t\t<div\n\t\t\t\tclass=${classNames(\n\t\t\t\t\t\"american-displayed-name relative mb-1 text-center font-bold text-brand-tertiary md:group-hover:text-white\",\n\t\t\t\t\t{\n\t\t\t\t\t\t\"md:text-white\": props.isAmericanDropdownOpen,\n\t\t\t\t\t\t\"dropdown-opened\": props.isAmericanDropdownOpen,\n\t\t\t\t\t}\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t${userInfo.AmericanAirlinesDisplayName}\n\t\t\t</div>\n\t\t\t<div class=\"text-center tw-hidden md:block\">${formattedAmericanTierNameTemplate()}</div>\n\t\t</div>\n\t`;\n\n\tconst americanDropdownTemplateDesktop = () => html`\n\t\t<div\n\t\t\tclass=${classNames(\n\t\t\t\t\"absolute inset-x-1/2 z-20 max-h-0 w-fit -translate-x-1/2 overflow-hidden common-transition tw-hidden md:block\",\n\t\t\t\t{\n\t\t\t\t\t\"top-[92px]\": !props.isHeaderSemiCollapsed,\n\t\t\t\t\t\"top-[62px]\": props.isHeaderSemiCollapsed,\n\t\t\t\t\t\"max-h-[400px]\": props.isAmericanDropdownOpen,\n\t\t\t\t}\n\t\t\t)}\n\t\t>\n\t\t\t<div class=\"flex w-full flex-col rounded-xl border-[1px] border-solid border-be-gray-9 bg-white p-4\">\n\t\t\t\t<div class=\"mb-2 flex flex-row items-baseline justify-between\">\n\t\t\t\t\t<span class=\"text-border-be-gray-2 whitespace-nowrap\">${i18next.t(\"Available-miles\")}:</span\n\t\t\t\t\t><span class=\"ml-1 text-[17px]/6 font-bold text-brand-tertiary\"\n\t\t\t\t\t\t>${groupNumber(userInfo.Miles, props.culture)}</span\n\t\t\t\t\t>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"mb-4 flex flex-row items-baseline justify-between border-be-gray-9\">\n\t\t\t\t\t<span class=\"flex\"\n\t\t\t\t\t\t>${unsafeHTML(\n\t\t\t\t\t\t\ti18next.t(\"AAdvantage {{-reg}}\", {\n\t\t\t\t\t\t\t\treg: '<span class=\"relative font-body top-[-1px]\">&reg;</span>',\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)}:</span\n\t\t\t\t\t><span class=\"ml-2 text-[17px]/6 font-bold\">${userInfo.AmericanAirlinesAdvantageNumber}</span>\n\t\t\t\t</div>\n\t\t\t\t${americanUserButtonsTemplateDesktop()}\n\t\t\t</div>\n\t\t</div>\n\t`;\n\n\tconst americanUserButtonsTemplateDesktop = () => html`\n\t\t<div class=\"mb-[2px] mt-0 flex flex-col items-center gap-2\">\n\t\t\t<div\n\t\t\t\tclass=\"dg-rounded-secondary-btn with-arrow longer\"\n\t\t\t\ttabindex=\"-1\"\n\t\t\t\tdata-test-id=${TestIdDictionary.Menu.OpenAmericanAccountButton}\n\t\t\t\t@click=${(e: MouseEvent) => handleNavigateToAmericanAccount(e)}\n\t\t\t>\n\t\t\t\t<span>${i18next.t(\"My account\")}</span>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tclass=\"dg-rounded-reverse-btn longer\"\n\t\t\t\ttabindex=\"-1\"\n\t\t\t\tdata-test-id=${TestIdDictionary.Menu.LogOutButton}\n\t\t\t\t@click=${props.handleLogout}\n\t\t\t>\n\t\t\t\t<span>${i18next.t(\"layout-logout\")}</span>\n\t\t\t</div>\n\t\t</div>\n\t`;\n\n\tconst americanDropdownTemplateMobile = () => html`\n\t\t<div\n\t\t\tclass=${classNames(\"z-20 block max-h-0 w-full overflow-hidden common-transition md:tw-hidden\", {\n\t\t\t\t\"max-h-[400px] border-b-[1px] border-solid border-be-gray-9\": props.isAmericanDropdownOpen,\n\t\t\t})}\n\t\t>\n\t\t\t<div class=\"flex w-full flex-col bg-white md:p-4\">\n\t\t\t\t${formattedAmericanTierNameTemplate()}\n\t\t\t\t<div class=\"flex flex-row items-baseline justify-center\">\n\t\t\t\t\t<span class=\"text-sm/3 text-be-gray-2\">${i18next.t(\"Available-miles\")}:</span\n\t\t\t\t\t><span class=\"ml-2 text-[16px]/6 font-bold text-brand-tertiary\"\n\t\t\t\t\t\t>${groupNumber(userInfo.Miles, props.culture)}</span\n\t\t\t\t\t>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"mb-2 flex flex-row items-baseline justify-center text-be-gray-2\">\n\t\t\t\t\t<span class=\"flex text-sm/3\"\n\t\t\t\t\t\t>${unsafeHTML(\n\t\t\t\t\t\t\ti18next.t(\"AAdvantage {{-reg}}\", {\n\t\t\t\t\t\t\t\treg: '<span class=\"relative font-body top-[-1px]\">&reg;</span>',\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)}:</span\n\t\t\t\t\t><span class=\"ml-2 text-[16px]/6 font-bold\">${userInfo.AmericanAirlinesAdvantageNumber}</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t`;\n\n\tconst americanListTemplateMobile = () => html`\n\t\t<div class=\"flex w-full flex-col md:tw-hidden\">\n\t\t\t<div\n\t\t\t\tclass=\"w-full border-b-[1px] border-solid border-be-gray-9 bg-white p-4 text-brand-secondary\"\n\t\t\t\ttabindex=\"-1\"\n\t\t\t\tdata-test-id=${TestIdDictionary.Menu.LogOutButton}\n\t\t\t\t@click=${props.handleLogout}\n\t\t\t>\n\t\t\t\t<span>${i18next.t(\"layout-logout\")}</span>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tclass=\"w-full border-b-[1px] border-solid border-be-gray-9 bg-white p-4 text-brand-secondary\"\n\t\t\t\ttabindex=\"-1\"\n\t\t\t\tdata-test-id=${TestIdDictionary.Menu.OpenAmericanAccountButton}\n\t\t\t\t@click=${(e: MouseEvent) => handleNavigateToAmericanAccount(e)}\n\t\t\t>\n\t\t\t\t<span>${i18next.t(\"My account\")}</span>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tclass=\"w-full border-b-[1px] border-solid border-be-gray-9 bg-white p-4 text-brand-secondary\"\n\t\t\t\ttabindex=\"-1\"\n\t\t\t\tdata-test-id=${TestIdDictionary.Menu.CheckinOpener}\n\t\t\t\t@click=${props.handleCheckinModalOpen}\n\t\t\t>\n\t\t\t\t<span>${i18next.t(\"layout-check-in\")}</span>\n\t\t\t</div>\n\t\t\t<div class=\"w-full bg-white p-4 text-brand-secondary\" tabindex=\"-1\" @click=${props.handleAdminModalOpen}>\n\t\t\t\t<span>${i18next.t(\"layout-manage-trip\")}</span>\n\t\t\t</div>\n\t\t</div>\n\t`;\n\n\tconst htmlTemplate = () =>\n\t\tuserInfo?.IsAmericanMember\n\t\t\t? html` <div\n\t\t\t\t\tclass=${classNames(\n\t\t\t\t\t\t\"group flex cursor-pointer flex-col items-center justify-center px-3 py-2 md:py-0 hover:md:bg-header-secondary-color relative\",\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"bg-transparent\": !props.isAmericanDropdownOpen,\n\t\t\t\t\t\t\t\"md:bg-header-secondary-color\": props.isAmericanDropdownOpen,\n\t\t\t\t\t\t}\n\t\t\t\t\t)}\n\t\t\t  >\n\t\t\t\t\t${americanTemplate()} ${americanDropdownTemplateDesktop()} ${americanDropdownTemplateMobile()}\n\t\t\t\t\t${americanListTemplateMobile()}\n\t\t\t  </div>`\n\t\t\t: \"\";\n\n\treturn { htmlTemplate };\n};\n","import { useEffect, useState } from \"Shared/haunted/CustomHooks\";\nimport i18next from \"i18next\";\nimport { html, useRef } from \"haunted\";\nimport { HauntedFunc } from \"Shared/haunted/HooksHelpers\";\nimport { revealDelayedElements, toBoolean } from \"Services/common\";\nimport { COOKIES } from \"Services/constants\";\nimport { ref } from \"Components/directives/ref\";\nimport { AdminModalType } from \"../admin-modal/admin-modal\";\nimport { tealiumLog } from \"Services/TealiumHelpers\";\nimport DomCrawlingHelper from \"Services/DomCrawlingHelper\";\nimport { deleteTealiumCookie, getCookie } from \"Services/cookieHandling\";\nimport { TealiumInfo } from \"Shared/models/TealiumInfo\";\nimport { TestIdDictionary } from \"Services/test-ids/TestIdDictionary\";\nimport { PUB_SUBS } from \"Services/pub-sub-service/PubSub\";\nimport numberFormatter from \"Services/numberFormatter\";\nimport { PcraLoginInfoModalType } from \"Components/pcra-login-info-modal/peru-compra-login-info-modal\";\nimport { useCultureSelector } from \"./useCultureSelector\";\nimport classNames from \"classnames\";\nimport { decode } from \"ComponentHelpers/PromoCodeHelper\";\nimport { useUserInfo } from \"ComponentHelpers/useUserInfo\";\nimport { DcMembershipType } from \"Components/bancoe-bar/bancoe-bar\";\nimport { useLoginWidget } from \"./useLoginWidget\";\nimport { useAmericanUserData } from \"./useAmericanUserData\";\n\nexport const useShadowDOM = false;\nexport const name = \"ac-main-menu\";\n\nexport const observedAttributes: (keyof Attributes)[] = [\n\t\"absolute-action\",\n\t\"booking-url\",\n\t\"culture\",\n\t\"is-banco-estado-on\",\n\t\"is-peru-compra-on\",\n\t\"show-admin-menu\",\n\t\"show-menu\",\n];\n\nexport interface Attributes {\n\t\"absolute-action\": string;\n\t\"booking-url\": string;\n\t\"culture\": string;\n\t\"is-banco-estado-on\": string;\n\t\"is-peru-compra-on\": string;\n\t\"show-admin-menu\": string;\n\t\"show-menu\": string;\n}\n\nexport interface Props {\n\tabsoluteAction: string;\n\tbookingUrl: string;\n\tculture: string;\n\tisBancoEstadoOn: boolean;\n\tisPeruCompraOn: boolean;\n\tshowAdminMenu: boolean;\n\tshowMenu: boolean;\n}\n\nlet didScroll = false;\nlet navbarHeight = 0;\nlet lastScrollTop = 0;\n\nexport const Component: HauntedFunc<Props> = (host) => {\n\tconst props: Props = {\n\t\tabsoluteAction: host.absoluteAction,\n\t\tbookingUrl: host.bookingUrl,\n\t\tculture: host.culture,\n\t\tisBancoEstadoOn: toBoolean(host.isBancoEstadoOn),\n\t\tisPeruCompraOn: toBoolean(host.isPeruCompraOn),\n\t\tshowAdminMenu: toBoolean(host.showAdminMenu),\n\t\tshowMenu: toBoolean(host.showMenu),\n\t};\n\n\tconst root = useRef<HTMLDivElement>(undefined);\n\tconst navBar = useRef<HTMLDivElement>(undefined);\n\tconst mobileMenu = useRef<HTMLInputElement>(undefined);\n\n\tconst [isBancoEstadoBarOpened, setIsBancoEstadoBarOpened] = useState<boolean>(false);\n\tconst [isLoggedIn, setIsLoggedIn] = useState<boolean>(false);\n\tconst [userName, setUserName] = useState<string>(\"\");\n\tconst [isCollapsed, setIsCollapsed] = useState<boolean>(false);\n\tconst [isSemiCollapsed, setIsSemiCollapsed] = useState<boolean>(false);\n\tconst [isBancoEstadoTabOpen, setIsBancoEstadoTabOpen] = useState<boolean>(false);\n\tconst [isLoginWidgetOpen, setIsLoginWidgetOpen] = useState(false);\n\tconst [isAmericanDropdownOpen, setIsAmericanDropdownOpen] = useState(false);\n\n\tconst loginWidget = useLoginWidget({\n\t\tbookingUrl: props.bookingUrl,\n\t\tabsoluteAction: props.absoluteAction,\n\t\tisOpen: isLoginWidgetOpen,\n\t\tculture: props.culture,\n\t\tsetIsOpen: setIsLoginWidgetOpen,\n\t});\n\n\tconst userInfo = useUserInfo();\n\n\tconst languageAndCountry = (culture = props.culture) => {\n\t\tif (!culture) return { language: \"es\", country: \"cl\" };\n\n\t\tconst [language, country] = culture.split(\"-\");\n\n\t\treturn { language: language || \"es\", country: country || \"cl\" };\n\t};\n\n\tconst cultureSelector = useCultureSelector({\n\t\tculture: props.culture,\n\t\tlanguageAndCountry,\n\t\tonOpen: () => {\n\t\t\tsetIsLoginWidgetOpen(false);\n\t\t\tsetIsAmericanDropdownOpen(false);\n\t\t\tmobileMenu.current.checked = false;\n\t\t\tsetIsBancoEstadoTabOpen(false);\n\t\t},\n\t});\n\n\t// HELPERS\n\n\tconst profileUrl = () => `${props.bookingUrl}/V2/Profile?culture=${props.culture}&url=${props.absoluteAction}`;\n\n\tconst bancoEstadoLoginUrl = () =>\n\t\t`${props.bookingUrl}/V2/Login?bancoe=1&culture=${props.culture}&url=${props.absoluteAction}`;\n\n\tconst init = () => {\n\t\tdocument.querySelectorAll('a[href^=\"#\"]').forEach((anchor) => {\n\t\t\tanchor.addEventListener(\"click\", function (e) {\n\t\t\t\te.preventDefault();\n\t\t\t\twindow.setTimeout(() => {\n\t\t\t\t\tsetIsCollapsed(true);\n\t\t\t\t}, 1000);\n\n\t\t\t\tdocument.querySelector(anchor.getAttribute(\"href\")).scrollIntoView({\n\t\t\t\t\tbehavior: \"smooth\",\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\n\t\tif (userInfo.BancoEstadoCategory > 0) {\n\t\t\tvalidateRestrictedUrl();\n\t\t\tinitBancoEstadoBar();\n\t\t}\n\n\t\tconst cookieUserName = userInfo?.AmericanAirlinesDisplayName || getNameFromUserNameCookie();\n\n\t\tif (cookieUserName) {\n\t\t\tsetIsLoggedIn(true);\n\t\t\tsetUserName(cookieUserName);\n\t\t}\n\n\t\ttealiumLogInit();\n\t\tsetAmplitudeDeviceId();\n\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.table(window.JetSmart.Variants);\n\n\t\t// FOR TESTING ONLY! REMOVE BEFORE GOING TO PROD!\n\t\t// setIsLoggedIn(true);\n\t\t// setUserName(\"Juan Carlo Pablo Esteban Montoya\");\n\t\t// EOF FOR TESTING ONLY\n\n\t\trevealDelayedElements(root.current);\n\n\t\t// https://medium.com/@mariusc23/hide-header-on-scroll-down-show-on-scroll-up-67bbaae9a78c\n\t\twindow.addEventListener(\n\t\t\t\"scroll\",\n\t\t\t() => {\n\t\t\t\tdidScroll = true;\n\t\t\t\tsetIsLoginWidgetOpen(false);\n\t\t\t\tsetIsAmericanDropdownOpen(false);\n\t\t\t},\n\t\t\tfalse\n\t\t);\n\n\t\twindow.setInterval(() => {\n\t\t\tif (didScroll) {\n\t\t\t\thandleScroll();\n\t\t\t\tdidScroll = false;\n\t\t\t}\n\t\t}, 125);\n\n\t\tnavbarHeight = navBar?.current.getBoundingClientRect().height || 0;\n\t};\n\n\tconst setAmplitudeDeviceId = () => {\n\t\ttry {\n\t\t\tlet cookieDeviceId = getCookie(COOKIES.AMPLITUDE);\n\t\t\tif (cookieDeviceId) {\n\t\t\t\tif (window.amplitude && typeof window.amplitude.setDeviceId === \"function\") {\n\t\t\t\t\twindow.amplitude.setDeviceId(cookieDeviceId);\n\t\t\t\t} else {\n\t\t\t\t\tconst amplitudeInterval = window.setInterval(() => {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\twindow.amplitude?.getInstance()?._isInitialized &&\n\t\t\t\t\t\t\ttypeof window.amplitude.setDeviceId === \"function\"\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tcookieDeviceId = getCookie(COOKIES.AMPLITUDE);\n\t\t\t\t\t\t\twindow.clearInterval(amplitudeInterval);\n\t\t\t\t\t\t\twindow.clearTimeout(amplitudeTimeLimit);\n\t\t\t\t\t\t\twindow.amplitude.setDeviceId(cookieDeviceId);\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 100);\n\n\t\t\t\t\tconst amplitudeTimeLimit = window.setTimeout(() => {\n\t\t\t\t\t\twindow.clearInterval(amplitudeInterval);\n\t\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\t\tconsole.error(\"Could not access Amplitude.\");\n\t\t\t\t\t}, 10000);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.error(\"Unknown Amplitude/Tealium cookie problem.\");\n\t\t}\n\t};\n\n\tconst getNameFromUserNameCookie = () => {\n\t\tconst cookieUserName = getCookie(COOKIES.USER_NAME);\n\t\treturn cookieUserName ? decode(atob(cookieUserName)) : \"\";\n\t};\n\n\tconst getOrgName = () => {\n\t\tconst orgName = getCookie(COOKIES.ORG_NAME);\n\t\treturn orgName ? decode(atob(orgName)) : \"\";\n\t};\n\n\tconst initBancoEstadoBar = () => {\n\t\tconst mainContent = DomCrawlingHelper.getElemByClass(document.body, \"site-content\");\n\n\t\tif (!mainContent || (userInfo.BancoEstadoCategory !== 5 && userInfo.BancoEstadoCategory !== 6)) {\n\t\t\treturn;\n\t\t}\n\n\t\tmainContent.classList.add(\"dg-bancoe-bar-open\");\n\t\tsetIsBancoEstadoBarOpened(true);\n\t};\n\n\tconst validateRestrictedUrl = () => {\n\t\tconst pathElements = window.location.href.split(\"/\");\n\n\t\tif (pathElements.length < 5) {\n\t\t\twindow.location.href = \"/cl/es\";\n\t\t\treturn;\n\t\t}\n\n\t\tconst countryKey = 3;\n\t\tconst languageKey = 4;\n\n\t\tif (pathElements[countryKey].toLowerCase() !== \"cl\" || pathElements[languageKey].toLowerCase() !== \"es\") {\n\t\t\tpathElements[countryKey] = \"cl\";\n\t\t\tpathElements[languageKey] = \"es\";\n\n\t\t\tconst newUrl = pathElements.join(\"/\");\n\n\t\t\twindow.location.href = newUrl;\n\t\t}\n\t};\n\n\tconst getDcMembershipType = (): DcMembershipType => {\n\t\tif (userInfo.IsDiscountClubGroupMember) return \"Group\";\n\t\tif (userInfo.IsDiscountClubStandardMember) return \"Standard\";\n\t\treturn \"None\";\n\t};\n\n\tconst tealiumLogInit = () => {\n\t\tconst tealiumInfoRaw = getCookie(COOKIES.TEALIUM);\n\n\t\tif (!tealiumInfoRaw) return;\n\n\t\ttry {\n\t\t\tconst decodedTealiumInfo = JSON.parse(decode(atob(tealiumInfoRaw))) as TealiumInfo;\n\n\t\t\ttealiumLog({\n\t\t\t\teventName: decodedTealiumInfo.Action.toLowerCase() === \"login\" ? \"user_login\" : \"user_register\",\n\t\t\t\teventParams: {\n\t\t\t\t\tibe_release: decodedTealiumInfo.IBE_Release,\n\t\t\t\t\torganization: decodedTealiumInfo.Organization,\n\t\t\t\t\tuser_role: decodedTealiumInfo.User_Role,\n\t\t\t\t\tuser_programs: decodedTealiumInfo.User_Programs.join(\"|\"),\n\t\t\t\t\tuser_dc_level: decodedTealiumInfo.User_DC_Level,\n\t\t\t\t\tuser_be_level: decodedTealiumInfo.User_BE_Level,\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tdeleteTealiumCookie();\n\t\t} catch (e) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.error(\"Unable to parse tealium info cookie.\");\n\t\t}\n\t};\n\n\tconst isBancoEstadoCategory = (cat: number) => Number(userInfo?.BancoEstadoCategory) === cat;\n\n\tconst isNewBancoEstadoCategory = () =>\n\t\tNumber(userInfo?.BancoEstadoCategory) === 5 || Number(userInfo?.BancoEstadoCategory) === 6;\n\n\tconst getUserTypeForLoginInfoModal = () =>\n\t\tuserInfo?.RoleCode === \"PECG\" ? \"gestor\" : userInfo?.RoleCode === \"PECD\" ? \"delegado\" : \"none\";\n\n\t// EVENT HANDLERS\n\n\tconst handleScroll = () => {\n\t\tconst st = window.scrollY;\n\n\t\tif (Math.abs(lastScrollTop - st) < 0) return;\n\n\t\tif (\n\t\t\tst > lastScrollTop &&\n\t\t\tst > navbarHeight * 2 &&\n\t\t\tst <= navbarHeight * 4 &&\n\t\t\t(!mobileMenu.current || !mobileMenu.current.checked)\n\t\t) {\n\t\t\tsetIsSemiCollapsed(true);\n\t\t} else if (\n\t\t\tst > lastScrollTop &&\n\t\t\tst > navbarHeight * 4 &&\n\t\t\t(!mobileMenu.current || !mobileMenu.current.checked)\n\t\t) {\n\t\t\tsetIsCollapsed(true);\n\t\t} else if (st < lastScrollTop && st >= navbarHeight * 4) {\n\t\t\tsetIsCollapsed(false);\n\t\t} else if ((st < lastScrollTop && st < navbarHeight * 4) || st === 0) {\n\t\t\tsetIsCollapsed(false);\n\t\t\tsetIsSemiCollapsed(false);\n\t\t}\n\n\t\tlastScrollTop = st;\n\t};\n\n\tconst handleCheckinModalOpen = () => {\n\t\tcultureSelector.closeCountryList();\n\t\tsetIsLoginWidgetOpen(false);\n\t\tsetIsAmericanDropdownOpen(false);\n\t\tmobileMenu.current.checked = false;\n\t\tconst type: AdminModalType = \"checkin\";\n\t\tPUB_SUBS.AdminModalOpened.publish({ modalType: type });\n\t};\n\n\tconst handleAdminModalOpen = () => {\n\t\tcultureSelector.closeCountryList();\n\t\tsetIsLoginWidgetOpen(false);\n\t\tsetIsAmericanDropdownOpen(false);\n\t\tmobileMenu.current.checked = false;\n\t\tconst type: AdminModalType = \"admin\";\n\t\tPUB_SUBS.AdminModalOpened.publish({ modalType: type });\n\t};\n\n\tconst handlePeruCompraLoginInfoModalOpen = () => {\n\t\tconst loginCookie = getCookie(COOKIES.PERU_COMPRA_LOGIN);\n\t\tif (loginCookie === \"true\") {\n\t\t\tmobileMenu.current.checked = false;\n\t\t\tconst type: PcraLoginInfoModalType = getUserTypeForLoginInfoModal();\n\t\t\tPUB_SUBS.PcraLoginInfoModalOpened.publish({ modalType: type });\n\t\t}\n\t};\n\n\tconst handleChileCompraLoginInfoModalOpen = () => {\n\t\tconst loginCookie = getCookie(COOKIES.ChileCompraLogin);\n\t\tif (loginCookie === \"true\") {\n\t\t\tmobileMenu.current.checked = false;\n\t\t\tPUB_SUBS.ChileCompraLoginInfoModalOpened.publish({});\n\t\t}\n\t};\n\n\tconst handleMobileMenuClick = () => {\n\t\tcultureSelector.closeCountryList();\n\t\tsetIsLoginWidgetOpen(false);\n\t\tsetIsBancoEstadoTabOpen(false);\n\t};\n\n\tconst handleBancoEstadoTabClick = () => {\n\t\tsetIsBancoEstadoTabOpen(!isBancoEstadoTabOpen);\n\t\tcultureSelector.closeCountryList();\n\t\tsetIsLoginWidgetOpen(false);\n\t};\n\n\tconst handleLoginWidgetClick = () => {\n\t\tmobileMenu.current.checked = false;\n\t\tsetIsLoginWidgetOpen(!isLoginWidgetOpen);\n\t\tsetIsBancoEstadoTabOpen(false);\n\t\tcultureSelector.closeCountryList();\n\t};\n\n\tconst handleLogout = () => {\n\t\ttealiumLog({\n\t\t\teventName: \"user_logout\",\n\t\t\teventParams: {},\n\t\t});\n\n\t\twindow.setTimeout(\n\t\t\t() => (window.location.href = `${props.bookingUrl}/Member/Logout?url=${props.absoluteAction}`),\n\t\t\t500\n\t\t);\n\t};\n\n\tconst toggleBancoEstadoBar = (e: MouseEvent) => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\tsetIsBancoEstadoBarOpened(!isBancoEstadoBarOpened);\n\n\t\tconst mainContent = DomCrawlingHelper.getElemByClass(document.body, \"site-content\");\n\n\t\tif (mainContent) mainContent.classList.toggle(\"dg-bancoe-bar-open\");\n\t};\n\n\tuseEffect(() => {\n\t\tif (userInfo?.IsPeruCompraAdmin || userInfo?.IsPeruCompraMember) {\n\t\t\twindow.setTimeout(handlePeruCompraLoginInfoModalOpen, 500);\n\t\t}\n\n\t\tif (userInfo.IsCug3Supervisor) {\n\t\t\twindow.setTimeout(handleChileCompraLoginInfoModalOpen, 500);\n\t\t}\n\t}, [userInfo]);\n\n\tuseEffect(init, []);\n\n\tconst americanUserData = useAmericanUserData({\n\t\tculture: props.culture,\n\t\tisAmericanDropdownOpen,\n\t\tisHeaderSemiCollapsed: isSemiCollapsed,\n\t\tsetIsAmericanDropdownOpen,\n\t\tcloseCountryDropdown: cultureSelector.closeCountryList,\n\t\thandleLogout,\n\t\thandleCheckinModalOpen,\n\t\thandleAdminModalOpen,\n\t});\n\n\t// TEMPLATES\n\n\tconst logoTemplate = () => {\n\t\tconst { language, country } = languageAndCountry();\n\t\tconst baseUrl = `/${country}/${language}`;\n\n\t\treturn html`\n\t\t\t<a class=\"dg-jetsmart-logo\" href=${baseUrl}>\n\t\t\t\t<img src=\"/images/header/jetsmart-logo-colored.svg\" alt=\"JetSMART\" />\n\t\t\t</a>\n\t\t`;\n\t};\n\tconst menuTemplate = () =>\n\t\tprops.showMenu\n\t\t\t? html`\n\t\t\t\t\t<div class=\"menu-container\">\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tref=${ref(mobileMenu)}\n\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\tclass=\"mobile-navigation\"\n\t\t\t\t\t\t\t@click=${handleMobileMenuClick}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<div class=\"right\">${menuItemsTemplate()}</div>\n\t\t\t\t\t\t<div class=\"mobile-navigation closed\">${i18next.t(\"layout-menu\")}</div>\n\t\t\t\t\t\t<div class=\"mobile-navigation opened\">${i18next.t(\"layout-close\")}</div>\n\t\t\t\t\t\t${cultureSelector.htmlTemplate()}\n\t\t\t\t\t</div>\n\t\t\t  `\n\t\t\t: \"\";\n\n\tconst adminMenuTemplate = () =>\n\t\tprops.showAdminMenu\n\t\t\t? html`\n\t\t\t\t\t<ul class=\"hidden-xs ml-4 flex flex-wrap gap-y-1\">\n\t\t\t\t\t\t<li><a href=\"#stations\">Stations</a></li>\n\t\t\t\t\t\t<span class=\"mx-2 block\">|</span>\n\t\t\t\t\t\t<li><a href=\"#navitaire\">Navitaire</a></li>\n\t\t\t\t\t\t<span class=\"mx-2 block\">|</span>\n\t\t\t\t\t\t<li><a href=\"#dynamic\">Dynamic Settings</a></li>\n\t\t\t\t\t\t<span class=\"mx-2 block\">|</span>\n\t\t\t\t\t\t<li><a href=\"#promocode\">Promo Codes</a></li>\n\t\t\t\t\t\t<span class=\"mx-2 block\">|</span>\n\t\t\t\t\t\t<li><a href=\"#country\">Default Country</a></li>\n\t\t\t\t\t\t<span class=\"mx-2 block\">|</span>\n\t\t\t\t\t\t<li><a href=\"#timetable\">Timetable</a></li>\n\t\t\t\t\t\t<span class=\"mx-2 block\">|</span>\n\t\t\t\t\t\t<li><a href=\"#sitemap\">Sitemap</a></li>\n\t\t\t\t\t\t<span class=\"mx-2 block\">|</span>\n\t\t\t\t\t\t<li><a href=\"#widgets\">Widgets</a></li>\n\t\t\t\t\t\t<span class=\"mx-2 block\">|</span>\n\t\t\t\t\t\t<li><a href=\"#pages\">Pages</a></li>\n\t\t\t\t\t</ul>\n\t\t\t  `\n\t\t\t: \"\";\n\n\tconst menuItemsTemplate = () => html`\n\t\t<ul\n\t\t\tclass=${classNames(\"login-container\", {\n\t\t\t\t\"american-mobile-menu\": userInfo?.IsAmericanMember,\n\t\t\t})}\n\t\t>\n\t\t\t<li>\n\t\t\t\t<a @click=${handleCheckinModalOpen} data-test-id=${TestIdDictionary.Menu.CheckinOpener}>\n\t\t\t\t\t<span>${i18next.t(\"layout-check-in\")}</span>\n\t\t\t\t</a>\n\t\t\t</li>\n\t\t\t<li>\n\t\t\t\t<a @click=${handleAdminModalOpen}>\n\t\t\t\t\t<span>${i18next.t(\"layout-manage-trip\")}</span>\n\t\t\t\t</a>\n\t\t\t</li>\n\t\t\t${menuForAnonymousUsersTemplate()} ${menuForLoggedInUsersTemplate()}\n\t\t</ul>\n\t`;\n\n\tconst bancoEstadoMenuOpenerTemplate = () => html`\n\t\t<a class=${classNames(\"dg-header-dropdown-label\", { opened: isBancoEstadoTabOpen })}>\n\t\t\t<span class=\"dg-header-dropdown-label-title\">\n\t\t\t\t${i18next.t(\"layout-login-bancoe\")} <span>BancoEstado</span>\n\t\t\t</span>\n\t\t</a>\n\t`;\n\n\tconst bancoEstadoMenuDropdownTemplate = () => html`\n\t\t<div class=${classNames(\"dg-header-dropdown-list\", { opened: isBancoEstadoTabOpen })}>\n\t\t\t<a href=${bancoEstadoLoginUrl()}> ${i18next.t(\"layout-register\")} </a>\n\t\t\t<a href=${bancoEstadoLoginUrl()}> ${i18next.t(\"layout-login\")} </a>\n\t\t</div>\n\t`;\n\n\tconst bancoEstadoMenuTemplate = () =>\n\t\tprops.isBancoEstadoOn && props.culture.toLowerCase() === \"es-cl\"\n\t\t\t? html`\n\t\t\t\t\t<li class=\"dg-header-dropdown-opener\" @click=${handleBancoEstadoTabClick}>\n\t\t\t\t\t\t${bancoEstadoMenuOpenerTemplate()} ${bancoEstadoMenuDropdownTemplate()}\n\t\t\t\t\t</li>\n\t\t\t  `\n\t\t\t: \"\";\n\n\tconst menuForAnonymousUsersTemplate = () =>\n\t\t!isLoggedIn\n\t\t\t? html`\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<a data-test-id=${TestIdDictionary.Menu.LoginOpener} @click=${handleLoginWidgetClick}>\n\t\t\t\t\t\t\t<span>${i18next.t(\"layout-login\")}</span>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</li>\n\t\t\t\t\t${bancoEstadoMenuTemplate()}\n\t\t\t  `\n\t\t\t: \"\";\n\n\tconst menuForLoggedInUsersTemplate = () =>\n\t\tisLoggedIn\n\t\t\t? html`${bancoEstadoProfileTemplate()} ${profileTemplate()} ${peruCompraUserInfoTemplate()}\n\t\t\t  ${chileCompraUserInfoTemplate()} ${logoutTemplate()} ${americanUserData.htmlTemplate()}`\n\t\t\t: \"\";\n\n\tconst bancoEstadoProfileTemplate = () => {\n\t\tconst tempClassNames = classNames(\"user-data-banco-estado\", {\n\t\t\t\"be-pointer-6\": isBancoEstadoCategory(6),\n\t\t\t\"be-pointer-5\": isBancoEstadoCategory(5),\n\t\t\t\"pointer-squash\": !isBancoEstadoBarOpened,\n\t\t});\n\n\t\tconst imgUrl = isBancoEstadoCategory(6)\n\t\t\t? \"/images/banco-estado/logo-smart-plus-bg-gray.png\"\n\t\t\t: isBancoEstadoCategory(5)\n\t\t\t? \"/images/banco-estado/logo-smart-bg-orange.png\"\n\t\t\t: \"\";\n\n\t\treturn isNewBancoEstadoCategory()\n\t\t\t? html`\n\t\t\t\t\t<li class=${tempClassNames}>\n\t\t\t\t\t\t<a href=${profileUrl()}>\n\t\t\t\t\t\t\t<span class=\"dg-username\">\n\t\t\t\t\t\t\t\t${imgUrl ? html`<img src=${imgUrl} />` : \"\"} ${userName} ${bancoEstadoArrowTemplate()}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</li>\n\t\t\t  `\n\t\t\t: \"\";\n\t};\n\n\tconst bancoEstadoArrowTemplate = () =>\n\t\thtml`\n\t\t\t<i\n\t\t\t\tclass=${classNames(\"hidden-sm-down jsh-icon jsh-chevron-right point-down\", {\n\t\t\t\t\t\"point-up\": !isBancoEstadoBarOpened,\n\t\t\t\t})}\n\t\t\t\t@click=${toggleBancoEstadoBar}\n\t\t\t></i>\n\t\t`;\n\n\tconst profileTemplate = () =>\n\t\t!isNewBancoEstadoCategory() &&\n\t\t!userInfo?.IsPeruCompraAdmin &&\n\t\t!userInfo.IsPeruCompraMember &&\n\t\t!userInfo.IsCug3Observer &&\n\t\t!userInfo.IsCug3Supervisor &&\n\t\t!userInfo.IsAmericanMember\n\t\t\t? html`\n\t\t\t\t\t<li class=\"user-data\">\n\t\t\t\t\t\t<a href=${profileUrl()}>\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclass=${classNames(\"dg-username\", {\n\t\t\t\t\t\t\t\t\t\"dg-banco-estado-name\": userInfo.BancoEstadoCategory > 0,\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t${userName}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t${employeeOrgTemplate()} ${cug2OrgNameTemplate()} ${bancoEstadoOrgNameTemplate()}\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</li>\n\t\t\t  `\n\t\t\t: \"\";\n\n\tconst peruCompraUserInfoTemplate = () => {\n\t\tconst peruCompraProfileUrl = `${props.bookingUrl}/V2Agency/Summary?culture=${props.culture}&url=${props.absoluteAction}`;\n\t\tconst availableAmount = numberFormatter({\n\t\t\tamount: Number(userInfo.PeruCompraAmount),\n\t\t\tculture: props.culture,\n\t\t\tcurrency: \"USD\",\n\t\t});\n\n\t\treturn userInfo?.IsPeruCompraAdmin || userInfo?.IsPeruCompraMember\n\t\t\t? html`\n\t\t\t\t\t<li class=\"user-data\">\n\t\t\t\t\t\t<a href=${peruCompraProfileUrl}>\n\t\t\t\t\t\t\t<span class=\"dg-username\">${userName}</span>\n\t\t\t\t\t\t\t<span class=\"orgname\">\n\t\t\t\t\t\t\t\t${userInfo.IsPeruCompraAdmin ? i18next.t(\"Gestor\") : i18next.t(\"Delegado\")} /\n\t\t\t\t\t\t\t\t${i18next.t(\"Monto {{-availableAmount}}\", {\n\t\t\t\t\t\t\t\t\tavailableAmount,\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</li>\n\t\t\t  `\n\t\t\t: \"\";\n\t};\n\n\tconst chileCompraUserInfoTemplate = () => {\n\t\tconst chileCompraProfileUrl = `${props.bookingUrl}/V2Agency/AgencyProfile?culture=${props.culture}&url=${props.absoluteAction}`;\n\n\t\treturn userInfo?.IsCug3Supervisor || userInfo?.IsCug3Observer\n\t\t\t? html`\n\t\t\t\t\t<li class=\"user-data\">\n\t\t\t\t\t\t<a href=${userInfo?.IsCug3Supervisor ? chileCompraProfileUrl : null}>\n\t\t\t\t\t\t\t<span class=\"text-base font-bold uppercase leading-none text-[#00aec7]\">${userName}</span>\n\t\t\t\t\t\t\t<span class=\"inline-block pt-1 !text-xs uppercase leading-none\">\n\t\t\t\t\t\t\t\t${userInfo.IsCug3Observer ? i18next.t(\"observador\") : i18next.t(\"supervisor\")}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</li>\n\t\t\t  `\n\t\t\t: \"\";\n\t};\n\n\tconst employeeOrgTemplate = () =>\n\t\tuserInfo?.RoleCode === \"EMPL\" ? html`<span class=\"orgname\">Team JetSMART</span>` : \"\";\n\n\tconst cug2OrgNameTemplate = () => (getOrgName() ? html`<span class=\"orgname\">${getOrgName()}</span>` : \"\");\n\n\tconst bancoEstadoOrgNameTemplate = () =>\n\t\tuserInfo.BancoEstadoCategory > 0\n\t\t\t? html`<span class=\"dg-banco-estado-org-name\">${i18next.t(\"layout-login-bancoe-orgname\")}</span>`\n\t\t\t: \"\";\n\n\tconst logoutTemplate = () =>\n\t\t!userInfo?.IsAmericanMember\n\t\t\t? html`\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<a href=\"#\" @click=${handleLogout} data-test-id=${TestIdDictionary.Menu.LogoutOpener}>\n\t\t\t\t\t\t\t<span>${i18next.t(\"layout-logout\")}</span>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</li>\n\t\t\t  `\n\t\t\t: \"\";\n\n\treturn html`\n\t\t<header\n\t\t\tref=${ref(root)}\n\t\t\tclass=${classNames(\"main-header\", { \"collapsed\": isCollapsed, \"semi-collapsed\": isSemiCollapsed })}\n\t\t>\n\t\t\t<div ref=${ref(navBar)} class=\"nav-bg delayed\">\n\t\t\t\t<section class=\"nav-container full-width\">\n\t\t\t\t\t${logoTemplate()} ${menuTemplate()} ${adminMenuTemplate()}\n\t\t\t\t</section>\n\t\t\t</div>\n\t\t\t${loginWidget.htmlTemplate()}\n\t\t\t<ac-bancoe-bar\n\t\t\t\t.bancoEstadoCategory=${Number(userInfo?.BancoEstadoCategory) || 0}\n\t\t\t\t.dcMembershipType=${getDcMembershipType()}\n\t\t\t\t.freeSeats=${Number(userInfo?.BancoEstadoFreeSeats || 0)}\n\t\t\t\t.isBarOpen=${isBancoEstadoBarOpened}\n\t\t\t></ac-bancoe-bar>\n\t\t</header>\n\t`;\n};\n","import { html } from \"haunted\";\nimport i18next from \"i18next\";\nimport { useState, useEffect } from \"Shared/haunted/CustomHooks\";\nimport { HauntedFunc } from \"Shared/haunted/HooksHelpers\";\nimport { PUB_SUBS } from \"Services/pub-sub-service/PubSub\";\nimport { unsafeHTML } from \"lit-html/directives/unsafe-html\";\nimport { deletePcraLoginCookie } from \"Services/cookieHandling\";\n\nexport const useShadowDOM = false;\nexport const name = \"ac-pcra-login-info-modal\";\n\nexport type PcraLoginInfoModalType = \"none\" | \"gestor\" | \"delegado\";\n\nexport const Component: HauntedFunc<{}> = () => {\n\tconst getUserTitle = () => (type === \"gestor\" ? \"Gestor\" : \"Delegado\");\n\n\t//COMPONENTS\n\n\tconst [type, setType] = useState<PcraLoginInfoModalType>(\"none\");\n\n\tuseEffect(() => {\n\t\tconst sub = PUB_SUBS.PcraLoginInfoModalOpened.subscribe((e) => setType(e.modalType));\n\t\treturn () => sub.unsubscribe();\n\t}, []);\n\n\t//HANDLERS:\n\n\tconst handleAcceptClick = () => {\n\t\tdeletePcraLoginCookie();\n\t\tsetType(\"none\");\n\t};\n\n\t//TEMPLATES:\n\n\tconst bannerTemplate = () => {\n\t\tconst userType = getUserTitle();\n\n\t\treturn html`\n\t\t\t<div class=\"dg-new-modal-info-bar pcra-login-modal-header\">\n\t\t\t\t${unsafeHTML(\n\t\t\t\t\ti18next.t(\"Sr. {{-userType}}\", {\n\t\t\t\t\t\tuserType,\n\t\t\t\t\t})\n\t\t\t\t)}\n\t\t\t</div>\n\t\t`;\n\t};\n\n\tconst loginInfoModalMessageTemplate = () =>\n\t\ttype === \"gestor\"\n\t\t\t? html`\n\t\t\t\t\t<p>${i18next.t(\"Login-Info-Modal-Gestor-Paragraph-1\")}</p>\n\t\t\t\t\t<p>${i18next.t(\"Login-Info-Modal-Gestor-Paragraph-2\")}</p>\n\t\t\t  `\n\t\t\t: html`\n\t\t\t\t\t<p>${i18next.t(\"Login-Info-Modal-Delegado-Paragraph-1\")}</p>\n\t\t\t\t\t<p>${i18next.t(\"Login-Info-Modal-Delegado-Paragraph-2\")}</p>\n\t\t\t  `;\n\n\tconst contentTemplate = () => html` <div class=\"pcra-login-info-content\">${loginInfoModalMessageTemplate()}</div> `;\n\n\tconst footerTemplate = () =>\n\t\thtml`\n\t\t\t<div class=\"pcra-modal-footer\">\n\t\t\t\t<button class=\"dg-rounded-primary-btn\" @click=${handleAcceptClick}>${i18next.t(\"Aceptar\")}</button>\n\t\t\t</div>\n\t\t`;\n\n\treturn type !== \"none\"\n\t\t? html` <div class=\"dg-new-modal\">\n\t\t\t\t<div class=\"dg-new-modal-content pcra-login-info-modal\" data-test-id=\"modal-content\">\n\t\t\t\t\t${bannerTemplate()} ${contentTemplate()} ${footerTemplate()}\n\t\t\t\t</div>\n\t\t  </div>`\n\t\t: html``;\n};\n","import { html } from \"haunted\";\nimport i18next from \"i18next\";\nimport { useState, useEffect } from \"Shared/haunted/CustomHooks\";\nimport { HauntedFunc } from \"Shared/haunted/HooksHelpers\";\nimport { PUB_SUBS } from \"Services/pub-sub-service/PubSub\";\nimport { deleteChileCompraLoginCookie } from \"Services/cookieHandling\";\n\nexport const name = \"ac-chile-compra-login-info-modal\";\nexport const useShadowDOM = false;\n\nexport const Component: HauntedFunc<{}> = () => {\n\tconst [isOpen, setIsOpen] = useState(false);\n\n\tconst init = () => {\n\t\tconst handler = PUB_SUBS.ChileCompraLoginInfoModalOpened.subscribe(() => setIsOpen(true));\n\n\t\treturn () => handler.unsubscribe();\n\t};\n\n\tconst handleAcceptButton = () => {\n\t\tdeleteChileCompraLoginCookie();\n\t\tsetIsOpen(false);\n\t};\n\n\tuseEffect(init, []);\n\n\treturn isOpen\n\t\t? html`\n\t\t\t\t<div class=\"dg-new-modal\">\n\t\t\t\t\t<div class=\"dg-new-modal-content !w-[550px] max-w-[95%]\" data-test-id=\"modal-content\">\n\t\t\t\t\t\t<div class=\"modal-body\">\n\t\t\t\t\t\t\t<div class=\"flex w-full justify-center py-3\">\n\t\t\t\t\t\t\t\t<i class=\"jsh-icon jsh-broken-circle-exclamation text-[100px] text-be-cyan-2\"></i>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"px-6 text-center font-body leading-snug text-be-blue-2\">\n\t\t\t\t\t\t\t\t${i18next.t(\"ChileCompraModalText\")}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"flex w-full justify-center p-6\">\n\t\t\t\t\t\t\t<button class=\"dg-rounded-primary-btn\" @click=${handleAcceptButton}>\n\t\t\t\t\t\t\t\t${i18next.t(\"Aceptar\")}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t  `\n\t\t: html``;\n};\n\n/*\n\t@apply p-0 leading-normal;\n\twidth: 413px;\n\theight: 480px;\n\tmax-width: 95%;\n\tmax-height: 95%;\n*/\n","import classNames from \"classnames\";\nimport { html, useEffect, useState } from \"haunted\";\nimport { CUG3_LOGIN_URL } from \"Services/constants\";\n\nexport const useShadowDOM = false;\nexport const name = \"cug3-login-handler\";\n\nconst loaderClassName = \"dg-for-cug3-login-loader\";\n\nexport const Component = () => {\n\tconst [error, setError] = useState<string | null>(null);\n\n\tuseEffect(() => {\n\t\tconst loader = window.newRtLoader(`.${loaderClassName}`);\n\t\tif (loader) {\n\t\t\tloader.startLoader();\n\t\t}\n\n\t\tconst params = new URLSearchParams(window.location.search);\n\t\tconst session = params.get(\"session\");\n\t\tconst iv = params.get(\"iv\");\n\n\t\tconst formData = new FormData();\n\t\tformData.append(\"session\", session);\n\t\tif (iv) {\n\t\t\tformData.append(\"iv\", iv);\n\t\t}\n\n\t\tfetch(`${window.JetSmart.Settings.BookingUrl}/${CUG3_LOGIN_URL}`, {\n\t\t\tmethod: \"POST\",\n\t\t\tredirect: \"follow\",\n\t\t\tbody: formData,\n\t\t\tcredentials: \"include\",\n\t\t})\n\t\t\t.then((res) => {\n\t\t\t\tif (!res.ok) {\n\t\t\t\t\tsetError(`Error logging in: ${res.statusText}`);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twindow.location.href = \"/changeLanguage?newCountryCode=cl&newLanguageCode=es\";\n\t\t\t})\n\t\t\t.catch((err) => {\n\t\t\t\tsetError(`Error logging in: ${err?.message}`);\n\t\t\t})\n\t\t\t.finally(() => {\n\t\t\t\tif (loader) {\n\t\t\t\t\tloader.stopLoader();\n\t\t\t\t\tloader.destroy();\n\t\t\t\t}\n\t\t\t});\n\t}, []);\n\n\tconst errorTemplate = error ? html`<div class=\"mt-4 text-red-500\">${error}</div>` : \"\";\n\n\treturn html`<div class=${classNames(\"min-h-svh\", loaderClassName)}>${errorTemplate}</div>`;\n};\n","import classNames from \"classnames\";\nimport { html, useEffect, useState } from \"haunted\";\nimport { AA_LOGIN_URL } from \"Services/constants\";\n\nexport const useShadowDOM = false;\nexport const name = \"aa-login-handler\";\n\nconst loaderClassName = \"dg-for-aa-login-loader\";\n\nexport const Component = () => {\n\tconst [error, setError] = useState<string | null>(null);\n\n\tuseEffect(() => {\n\t\tconst loader = window.newRtLoader(`.${loaderClassName}`);\n\t\tif (loader) {\n\t\t\tloader.startLoader();\n\t\t}\n\n\t\tconst params = new URLSearchParams(window.location.search);\n\t\tconst token = params.get(\"token\");\n\t\tconst errorDescription = params.get(\"error_description\");\n\n        if (!token) {\n\t\t\tsetError(`No token`);\n\t\t}\n\n        if (errorDescription){\n            setError(errorDescription);\n        }\n\n\t\tconst formData = new FormData();\n\t\tformData.append(\"token\", token);\n\n\t\tfetch(`${window.JetSmart.Settings.BookingUrl}/${AA_LOGIN_URL}`, {\n\t\t\tmethod: \"POST\",\n\t\t\tredirect: \"follow\",\n\t\t\tbody: formData,\n\t\t\tcredentials: \"include\",\n\t\t})\n\t\t\t.then((res) => {\n\t\t\t\tif (!res.ok) {\n\t\t\t\t\tsetError(`Error logging in: ${res.statusText}`);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twindow.location.href = \"/\";\n\t\t\t})\n\t\t\t.catch((err) => {\n\t\t\t\tsetError(`Error logging in: ${err?.message}`);\n\t\t\t})\n\t\t\t.finally(() => {\n\t\t\t\tif (loader) {\n\t\t\t\t\tloader.stopLoader();\n\t\t\t\t\tloader.destroy();\n\t\t\t\t}\n\t\t\t});\n\t}, []);\n\n\tconst errorTemplate = error ? html`<div class=\"mt-4 text-red-500\">${error}</div>` : \"\";\n\n\treturn html`<div class=${classNames(\"min-h-svh\", loaderClassName)}>${errorTemplate}</div>`;\n};\n","import { html } from \"haunted\";\nimport i18next from \"i18next\";\nimport { useState, useEffect } from \"Shared/haunted/CustomHooks\";\nimport { HauntedFunc } from \"Shared/haunted/HooksHelpers\";\nimport { PUB_SUBS } from \"Services/pub-sub-service/PubSub\";\nimport { unsafeHTML } from \"lit-html/directives/unsafe-html\";\n\nexport const name = \"ac-redemption-no-promo-code-modal\";\nexport const useShadowDOM = false;\n\nexport const Component: HauntedFunc<{}> = () => {\n\tconst [isOpen, setIsOpen] = useState(false);\n\n\tconst init = () => {\n\t\tconst handler = PUB_SUBS.RedemptionNoPromoCodeModalOpened.subscribe(({}) => {\n\t\t\tsetIsOpen(true);\n\t\t});\n\n\t\treturn () => handler.unsubscribe();\n\t};\n\n\tuseEffect(init, []);\n\n\tconst handleContinueButton = () => {\n\t\tsetIsOpen(false);\n\t\twindow.location.href = `${window.JetSmart?.AmericanAirlinesSettings?.LoginAddress}`;\n\t};\n\n\tconst headerTemplate = () => html`\n\t\t<div class=\"flex h-20 w-full items-center justify-start bg-brand-primary p-5 text-white\">\n\t\t\t<i class=\"jsh-icon jsh-triangle-exclamation-thick mr-5 text-[36px]\"></i>\n\t\t\t<span class=\"text-center text-[24px] font-bold\">${i18next.t(\"Important\")}!</span>\n\t\t</div>\n\t`;\n\n\treturn isOpen\n\t\t? html`\n\t\t\t\t<div class=\"dg-new-modal\">\n\t\t\t\t\t<div class=\"dg-new-modal-content !w-[550px] max-w-[95%]\" data-test-id=\"modal-content\">\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclass=\"dg-new-modal-close\"\n\t\t\t\t\t\t\tdata-test-id=\"modal-close-button\"\n\t\t\t\t\t\t\t@click=${() => setIsOpen(!isOpen)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t&times;\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t${headerTemplate()}\n\t\t\t\t\t\t<div class=\"modal-body\">\n\t\t\t\t\t\t\t<div class=\"px-6 pt-5 text-center font-body leading-snug text-be-blue-2\">\n\t\t\t\t\t\t\t\t${unsafeHTML(\n\t\t\t\t\t\t\t\t\ti18next.t(\"RedemptionNoPromoModalText {{-reg}}\", {\n\t\t\t\t\t\t\t\t\t\treg: '<span class=\"relative font-body top-[-1px]\">&reg;</span>',\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"flex w-full flex-col items-center p-6\">\n\t\t\t\t\t\t\t<button class=\"dg-rounded-primary-btn\" @click=${handleContinueButton}>\n\t\t\t\t\t\t\t\t${i18next.t(\"Continue\")}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclass=\"text-medium md:text-medium mt-3 cursor-pointer select-none text-center text-brand-secondary underline hover:no-underline sm:text-base\"\n\t\t\t\t\t\t\t\t@click=${() => setIsOpen(!isOpen)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t${i18next.t(\"Choose another flight\")}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t  `\n\t\t: html``;\n};\n","import { useEffect, useRef, useState } from \"haunted\";\n\ninterface Props {\n\tminutes: number;\n\tseconds: number;\n\tinterval: number;\n}\n\nexport function useCountdown(props: Props) {\n\tconst [count, setCount] = useState<number>(props.minutes * 60 + props.seconds);\n\tconst timerId = useRef<number>(undefined);\n\n\tuseEffect(() => {\n\t\tif (count > 0) {\n\t\t\ttimerId.current = window.setTimeout(() => {\n\t\t\t\tsetCount(count - 1);\n\t\t\t}, props.interval);\n\t\t}\n\n\t\treturn () => {\n\t\t\twindow.clearTimeout(timerId.current);\n\t\t};\n\t}, [count, props.interval]);\n\n\tconst resetCountdown = () => {\n\t\tsetCount(props.minutes * 60 + props.seconds);\n\t};\n\n\treturn {\n\t\tisCountdownFinished: count === 0,\n\t\tremainingMinutes: Math.floor(count / 60),\n\t\tremainingSeconds: count % 60,\n\t\tresetCountdown,\n\t};\n}\n","import dayjs from \"dayjs\";\nimport i18next from \"i18next\";\nimport { HauntedFunc } from \"Shared/haunted/HooksHelpers\";\nimport { getCookie } from \"Services/cookieHandling\";\nimport { html, useEffect } from \"haunted\";\nimport { useCountdown } from \"./useCountDown\";\nimport { useState } from \"Shared/haunted/CustomHooks\";\nimport { useUserInfo } from \"ComponentHelpers/useUserInfo\";\nimport { createHeaders } from \"ComponentHelpers/HeaderHelper\";\nimport {\n\tAMERICAN_AIRLINES_USER_ROLE,\n\tAPI_AMERICAN_AIRLINES_REFRESH_TOKEN_URL,\n\tCOOKIES,\n\tLOGOUT_INLINE_URL,\n} from \"Services/constants\";\n\nexport const name = \"ac-american-airlines-token-modal\";\nexport const useShadowDOM = false;\n\nconst visibleCountdownBeforeEndInMinutes = 1;\n\nexport const Component: HauntedFunc<{}> = () => {\n\tconst userInfo = useUserInfo();\n\n\tconst finalCountdown = useCountdown({ minutes: visibleCountdownBeforeEndInMinutes, seconds: 0, interval: 1000 });\n\n\tconst [timer, setTimer] = useState<any>(null);\n\tconst [mode, setMode] = useState<\"default\" | \"counting\" | \"ending\" | \"ended\" | \"error\">(\"default\");\n\n\tconst init = async () => {\n\t\tif (\n\t\t\t!userInfo?.RoleCode ||\n\t\t\t!userInfo?.AmericanAirlinesDisplayName ||\n\t\t\tuserInfo.RoleCode !== AMERICAN_AIRLINES_USER_ROLE\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst deadline = getCookie(COOKIES.AMERICAN_AIRLINES_VALID_TO);\n\n\t\tif (!deadline) {\n\t\t\tsetMode(\"ended\");\n\t\t\treturn;\n\t\t}\n\n\t\tstartCountdown(deadline);\n\t};\n\n\tconst isOpen = mode !== \"default\" && mode !== \"counting\";\n\n\tconst canRefresh = mode !== \"ended\" && mode !== \"error\";\n\n\tconst parseTime = (time: string) => dayjs.utc(time, \"DD-MM-YYYY HH:mm:ss\");\n\n\tconst getCountdownTime = (time: dayjs.Dayjs): number => {\n\t\tconst currentUtc = new Date().getTime();\n\t\tconst deadlineUtc = time.valueOf();\n\t\tconst difference = visibleCountdownBeforeEndInMinutes * 60 * 1000;\n\t\tconst retVal = deadlineUtc - currentUtc - difference;\n\n\t\treturn retVal;\n\t};\n\n\tconst startCountdown = (deadline: string) => {\n\t\twindow.clearTimeout(timer);\n\t\tconst differenceInMilliseconds = getCountdownTime(parseTime(deadline));\n\t\tconst visibleCountdownBeforeEndInMilliseconds = visibleCountdownBeforeEndInMinutes * 60 * 1000;\n\n\t\tif (differenceInMilliseconds <= visibleCountdownBeforeEndInMilliseconds) {\n\t\t\tsetMode(\"ended\");\n\t\t} else {\n\t\t\tsetMode(\"counting\");\n\t\t\tsetTimer(window.setTimeout(startVisibleCountdown, differenceInMilliseconds));\n\t\t}\n\t};\n\n\tconst startVisibleCountdown = () => {\n\t\tfinalCountdown.resetCountdown();\n\t\tsetMode(\"ending\");\n\t};\n\n\tconst refreshSession = async () => {\n\t\tconst headers = createHeaders();\n\n\t\tconst response = await fetch(\n\t\t\t`${window.JetSmart.Settings.BookingUrl}${API_AMERICAN_AIRLINES_REFRESH_TOKEN_URL}`,\n\t\t\t{\n\t\t\t\tmethod: \"GET\",\n\t\t\t\theaders,\n\t\t\t\tmode: \"cors\",\n\t\t\t\tcredentials: \"include\",\n\t\t\t}\n\t\t);\n\n\t\tif (!response.ok) {\n\t\t\tsetMode(\"error\");\n\t\t\treturn;\n\t\t}\n\n\t\tconst responseJson = await response.json();\n\t\tstartCountdown(responseJson.data);\n\t};\n\n\t// Handlers\n\n\tconst handleContinueButtonClick = async (e: MouseEvent) => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\tawait refreshSession();\n\t};\n\n\tconst handleRestartButtonClick = async (e: MouseEvent) => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\twindow.location.href = \"/\";\n\t};\n\n\tuseEffect(() => {\n\t\tconst doIt = async () => {\n\t\t\tif (finalCountdown.isCountdownFinished && isOpen && userInfo.AmericanAirlinesDisplayName) {\n\t\t\t\tsetMode(\"ended\");\n\n\t\t\t\tconst headers = createHeaders();\n\n\t\t\t\tawait fetch(`${window.JetSmart.Settings.BookingUrl}${LOGOUT_INLINE_URL}`, {\n\t\t\t\t\tmethod: \"GET\",\n\t\t\t\t\theaders,\n\t\t\t\t\tmode: \"cors\",\n\t\t\t\t\tcredentials: \"include\",\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\tvoid doIt();\n\t}, [finalCountdown.isCountdownFinished, isOpen, userInfo?.RoleCode]);\n\n\tuseEffect(init, [userInfo?.RoleCode]);\n\n\t//TEMPLATES\n\n\tconst sessionWarningMessageTemplate = () => (canRefresh ? html` <div>${i18next.t(\"Session-Warning2\")}</div> ` : \"\");\n\n\tconst sessionRefreshButtonTemplate = () =>\n\t\tcanRefresh\n\t\t\t? html`\n\t\t\t\t\t<button class=\"dg-rounded-primary-btn\" @click=${handleContinueButtonClick}>\n\t\t\t\t\t\t${i18next.t(\"Session-RefreshButton\")}\n\t\t\t\t\t</button>\n\t\t\t  `\n\t\t\t: \"\";\n\n\tconst errorWarningTemplate = () =>\n\t\tmode === \"error\" ? html` <div>${i18next.t(\"Ha ocurrido un error.\")}</div> ` : \"\";\n\n\tconst sessionExpiredMessageTemplate = () =>\n\t\tmode === \"ended\" ? html` <div>${i18next.t(\"Session-Expired\")}</div> ` : \"\";\n\n\tconst startOverButtonTemplate = () =>\n\t\t!canRefresh\n\t\t\t? html`\n\t\t\t\t\t<button class=\"dg-rounded-primary-btn\" @click=${handleRestartButtonClick}>\n\t\t\t\t\t\t${i18next.t(\"Session-StartOverButton\")}\n\t\t\t\t\t</button>\n\t\t\t  `\n\t\t\t: \"\";\n\n\tconst timerDisplayTemplate = () => {\n\t\tif (mode === \"error\") return \"\";\n\n\t\tif (mode === \"ended\") return html` <span class=\"ml-2\">(00:00)</span>`;\n\n\t\tconst remainingMinutes = finalCountdown.remainingMinutes.toString().padStart(2, \"0\");\n\t\tconst remainingSeconds = finalCountdown.remainingSeconds.toString().padStart(2, \"0\");\n\t\tconst remainingTimeString = `(${remainingMinutes}:${remainingSeconds})`;\n\t\treturn html` <span class=\"ml-2\">${remainingTimeString}</span> `;\n\t};\n\n\tconst headerTemplate = () => html`\n\t\t<div\n\t\t\tclass=\"flex items-center justify-start rounded-lg bg-[#def3f7] p-5 text-left text-[22px] font-black text-[#163a70]\"\n\t\t>\n\t\t\t<i class=\"fas fa-exclamation-circle mr-5 text-[36px] text-[#59c3d9]\"></i>\n\t\t\t${i18next.t(\"Session-Warning\")} ${timerDisplayTemplate()}\n\t\t</div>\n\t`;\n\n\treturn isOpen\n\t\t? html`\n\t\t\t\t<div class=\"dg-new-modal\">\n\t\t\t\t\t<div class=\"dg-new-modal-content !w-[500px] max-w-[95%] p-3\">\n\t\t\t\t\t\t${headerTemplate()}\n\t\t\t\t\t\t<div class=\"p-5\">\n\t\t\t\t\t\t\t${sessionWarningMessageTemplate()} ${sessionExpiredMessageTemplate()}\n\t\t\t\t\t\t\t${errorWarningTemplate()}\n\t\t\t\t\t\t\t<div class=\"mt-[30px] flex w-full items-center justify-end\">\n\t\t\t\t\t\t\t\t${sessionRefreshButtonTemplate()} ${startOverButtonTemplate()}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t  `\n\t\t: html``;\n};\n","import { component } from \"haunted\";\nimport \"@webcomponents/custom-elements\";\nimport * as BancoEstadoBar from \"Components/bancoe-bar/bancoe-bar\";\nimport * as AdminModal from \"Components/admin-modal/admin-modal\";\nimport * as CultureNameSettings from \"Components/admin/culture-name-settings\";\nimport * as DynamicPromoCodes from \"Components/admin/dynamic-promo-codes\";\nimport * as DefaultCountries from \"Components/admin/route-settings\";\nimport * as InsuranceTab from \"Components/admin/insurance-tab-settings\";\nimport * as Searchbox from \"Components/searchbox/searchbox\";\nimport * as DcDatepicker from \"Components/searchbox/date-selector/dc-datepicker\";\nimport * as SmartTimer from \"Components/smart-timer/smart-timer\";\nimport * as MainMenu from \"Components/main-menu/main-menu\";\nimport * as PcraLoginInfoModal from \"Components/pcra-login-info-modal/peru-compra-login-info-modal\";\nimport * as ChileCompraLoginInfoModal from \"Components/chile-compra-login-info-modal/chile-compra-login-info-modal\";\nimport * as Cug3LoginHandler from \"Components/login-handlers/cug3-login-handler\";\nimport * as AALoginHandler from \"Components/login-handlers/aa-login-handler\";\nimport * as RedemptionNoPromoCodeModal from \"Components/redemption-no-promo-code-modal/redemption-no-promo-code-modal\";\nimport * as AmericanAirlinesTokenModal from \"Components/american-airlines-token-modal/american-airlines-token-modal\";\n\nexport function initCustomElements() {\n\tcustomElements.define(\n\t\tBancoEstadoBar.name,\n\t\tcomponent<HTMLElement & BancoEstadoBar.Props>(BancoEstadoBar.Component, {\n\t\t\tuseShadowDOM: BancoEstadoBar.useShadowDOM,\n\t\t\tobservedAttributes: [],\n\t\t})\n\t);\n\n\tcustomElements.define(\n\t\tAdminModal.name,\n\t\tcomponent<HTMLElement & AdminModal.Attributes & AdminModal.Props>(AdminModal.Component, {\n\t\t\tuseShadowDOM: AdminModal.useShadowDOM,\n\t\t\tobservedAttributes: AdminModal.observedAttributes,\n\t\t})\n\t);\n\n\tcustomElements.define(\n\t\tSearchbox.name,\n\t\tcomponent<HTMLElement & Searchbox.Attributes & Searchbox.Props>(Searchbox.Component, {\n\t\t\tuseShadowDOM: Searchbox.useShadowDOM,\n\t\t\tobservedAttributes: Searchbox.observedAttributes,\n\t\t})\n\t);\n\n\tcustomElements.define(\n\t\tDcDatepicker.name,\n\t\tcomponent<HTMLElement & DcDatepicker.Properties>(DcDatepicker.Component, {\n\t\t\tuseShadowDOM: DcDatepicker.useShadowDOM,\n\t\t\tobservedAttributes: DcDatepicker.observedAttributes,\n\t\t})\n\t);\n\n\tcustomElements.define(\n\t\tDefaultCountries.name,\n\t\tcomponent<HTMLElement & DefaultCountries.Props & DefaultCountries.Attributes>(DefaultCountries.Component, {\n\t\t\tuseShadowDOM: DefaultCountries.useShadowDOM,\n\t\t\tobservedAttributes: DefaultCountries.observedAttributes,\n\t\t})\n\t);\n\n\tcustomElements.define(\n\t\tInsuranceTab.name,\n\t\tcomponent<HTMLElement & InsuranceTab.Props & InsuranceTab.Attributes>(InsuranceTab.Component, {\n\t\t\tuseShadowDOM: InsuranceTab.useShadowDOM,\n\t\t\tobservedAttributes: InsuranceTab.observedAttributes,\n\t\t})\n\t);\n\n\tcustomElements.define(\n\t\tDynamicPromoCodes.name,\n\t\tcomponent<HTMLElement & DynamicPromoCodes.Props & DynamicPromoCodes.Attributes>(DynamicPromoCodes.Component, {\n\t\t\tuseShadowDOM: DynamicPromoCodes.useShadowDOM,\n\t\t\tobservedAttributes: DynamicPromoCodes.observedAttributes,\n\t\t})\n\t);\n\n\tcustomElements.define(\n\t\tCultureNameSettings.name,\n\t\tcomponent<HTMLElement & CultureNameSettings.Props & CultureNameSettings.Attributes>(\n\t\t\tCultureNameSettings.Component,\n\t\t\t{\n\t\t\t\tuseShadowDOM: CultureNameSettings.useShadowDOM,\n\t\t\t\tobservedAttributes: CultureNameSettings.observedAttributes,\n\t\t\t}\n\t\t)\n\t);\n\n\tcustomElements.define(\n\t\tSmartTimer.name,\n\t\tcomponent<HTMLElement & SmartTimer.Props & SmartTimer.Attributes>(SmartTimer.Component, {\n\t\t\tuseShadowDOM: SmartTimer.useShadowDOM,\n\t\t\tobservedAttributes: SmartTimer.observedAttributes,\n\t\t})\n\t);\n\n\tcustomElements.define(\n\t\tMainMenu.name,\n\t\tcomponent<HTMLElement & MainMenu.Props & MainMenu.Attributes>(MainMenu.Component, {\n\t\t\tuseShadowDOM: MainMenu.useShadowDOM,\n\t\t\tobservedAttributes: MainMenu.observedAttributes,\n\t\t})\n\t);\n\n\tcustomElements.define(\n\t\tPcraLoginInfoModal.name,\n\t\tcomponent<HTMLElement>(PcraLoginInfoModal.Component, {\n\t\t\tuseShadowDOM: PcraLoginInfoModal.useShadowDOM,\n\t\t\tobservedAttributes: [],\n\t\t})\n\t);\n\n\tcustomElements.define(\n\t\tChileCompraLoginInfoModal.name,\n\t\tcomponent<HTMLElement>(ChileCompraLoginInfoModal.Component, {\n\t\t\tuseShadowDOM: ChileCompraLoginInfoModal.useShadowDOM,\n\t\t\tobservedAttributes: [],\n\t\t})\n\t);\n\n\tcustomElements.define(\n\t\tCug3LoginHandler.name,\n\t\tcomponent<HTMLElement>(Cug3LoginHandler.Component, {\n\t\t\tuseShadowDOM: Cug3LoginHandler.useShadowDOM,\n\t\t\tobservedAttributes: [],\n\t\t})\n\t);\n\n    customElements.define(\n\t\tAALoginHandler.name,\n\t\tcomponent<HTMLElement>(AALoginHandler.Component, {\n\t\t\tuseShadowDOM: AALoginHandler.useShadowDOM,\n\t\t\tobservedAttributes: [],\n\t\t})\n\t);\n\n\tcustomElements.define(\n\t\tRedemptionNoPromoCodeModal.name,\n\t\tcomponent<HTMLElement>(RedemptionNoPromoCodeModal.Component, {\n\t\t\tuseShadowDOM: RedemptionNoPromoCodeModal.useShadowDOM,\n\t\t\tobservedAttributes: [],\n\t\t})\n\t);\n\n\tcustomElements.define(\n\t\tAmericanAirlinesTokenModal.name,\n\t\tcomponent<HTMLElement>(AmericanAirlinesTokenModal.Component, {\n\t\t\tuseShadowDOM: AmericanAirlinesTokenModal.useShadowDOM,\n\t\t\tobservedAttributes: [],\n\t\t})\n\t);\n}\n","/* eslint-disable @typescript-eslint/no-floating-promises */\nimport \"isomorphic-fetch\";\nimport smoothscroll from \"smoothscroll-polyfill\";\n\nimport \"Services/Localization\";\n\nimport * as globals from \"Services/Globals\";\nimport { EventBus } from \"Services/eventbus/eventbus\";\n\nimport i18next from \"i18next\";\nimport esCLPo from \"../../../locale/translated/es-cl.client.json\";\nimport enUSPo from \"../../../locale/translated/en-us.client.json\";\nimport ptBRPo from \"../../../locale/translated/pt-br.client.json\";\nimport { Debug } from \"Services/Debug\";\nimport { initCustomElements } from \"./components/components\";\nimport { sendAmplitudeExposure } from \"Services/amplitude/AmplitudeHelper\";\nimport { PubSub, PUB_SUBS } from \"Services/pub-sub-service/PubSub\";\nimport dayjs from \"dayjs\";\nimport \"dayjs/locale/es\";\nimport \"dayjs/locale/en\";\nimport \"dayjs/locale/pt-br\";\n\nif (\"serviceWorker\" in navigator) {\n\tnavigator.serviceWorker.register(\"../../../SalesManagoServiceWorker.js\", { scope: \"/\" }).then(function () {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.log(\"Service Worker Registered\");\n\t});\n}\n\nexport const commonDebug = new Debug(\"js\", \"common\");\n\nif (!window.eventBus) {\n\twindow.eventBus = new EventBus();\n}\n\nif (!window.PubSubs) {\n\twindow.PubSubs = {\n\t\tVariantsReady: new PubSub<VariantsReady>(),\n\t};\n}\n\ndocument.addEventListener(\"click\", (e: MouseEvent) => PUB_SUBS.DocumentClicked.publish({ mouseEvent: e }));\n\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n\twindow.exposeToAmplitude = sendAmplitudeExposure;\n\twindow.PubSubs.VariantsReady.publish({\n\t\tvariants: window.JetSmart.Variants,\n\t});\n});\n\n// Smooth scroll\n(window as any).__forceSmoothScrollPolyfill__ = true;\nsmoothscroll.polyfill();\n\ndayjs.locale(globals.locale.indexOf(\"en\") > -1 ? \"en\" : globals.locale.indexOf(\"pt\") > -1 ? \"pt-br\" : \"es\");\n\n// i18next\n\ninterface LocalizationEmbeddedLink {\n\turl: string;\n\ttitle: string;\n}\n\nasync function initLocalization(): Promise<void> {\n\tawait i18next.init(\n\t\t{\n\t\t\tinitImmediate: true,\n\t\t\tnsSeparator: false,\n\t\t\tkeySeparator: false,\n\t\t\tlng: globals.locale.indexOf(\"en\") > -1 ? \"enus\" : globals.locale.indexOf(\"pt\") > -1 ? \"ptbr\" : \"escl\",\n\t\t\tfallbackLng: [\"escl\"],\n\t\t\treturnEmptyString: false,\n\t\t\tresources: {\n\t\t\t\t// language: { namespace: resourse }\n\t\t\t\tescl: { translation: esCLPo },\n\t\t\t\tenus: { translation: enUSPo },\n\t\t\t\tptbr: { translation: ptBRPo },\n\t\t\t},\n\t\t\tinterpolation: {\n\t\t\t\tformat: (value: any, format?: string) => {\n\t\t\t\t\tif (format === \"custom\" && (value as LocalizationEmbeddedLink)) {\n\t\t\t\t\t\tconst linkObject = value as LocalizationEmbeddedLink;\n\t\t\t\t\t\treturn `<a target=\"blank\" href=\"${linkObject.url}\">${linkObject.title}</a>`;\n\t\t\t\t\t}\n\t\t\t\t\treturn value;\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tinitCustomElements\n\t);\n}\n\n// DEVNOTE We have to init custom elements after i18next init, so that i18 strings appear\n// right from the start. So we use this as callback of i18next.init\ninitLocalization();\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t179: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunk\"] = self[\"webpackChunk\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\n__webpack_require__.O(undefined, [736,894,234], () => (__webpack_require__(4502)))\nvar __webpack_exports__ = __webpack_require__.O(undefined, [736,894,234], () => (__webpack_require__(3779)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["useState","haunted","useMemo","useEffect","callback","values","result","reason","useShadowDOM","Component","host","props","isMobileNoMembershipTooltipOpen","setIsMobileNoMembershipTooltipOpen","isMobileStandardMembershipTooltipOpen","setIsMobileStandardMembershipTooltipOpen","isMobileGroupMembershipTooltipOpen","setIsMobileGroupMembershipTooltipOpen","noMembershipContent","i18next","standardMembershipContent","groupMembershipContent","noMembershipSection","standardMembershipSection","groupMembershipSection","seat40Section","freeSeatsSection","ref","refInstance","part","loaderContainerClassName","observedAttributes","captchaContainerClass","AesEncryptionKey","AesEncryptionIV","form","emailOrLastName","pnr","showBookingError","setShowBookingError","showFareLockError","setShowFareLockError","showUnauthorizedError","setShowUnauthorizedError","showRecaptchaError","setShowRecaptchaError","showTooManyJourneysError","setShowTooManyJourneysError","showAmericanAirlinesError","setShowAmericanAirlinesError","captchaId","setCaptchaId","type","setType","initCaptcha","grecaptchaInterval","captchaContainer","onSubmit","grecaptchaTimeLimit","handleSubmit","e","getPostBody","grecaptchaResponse","bookingData","key","iv","aesPnr","aesIdentifier","loader","baseUrl","fetchParameters","response","handleServerResponse","commonDebug","queryCulture","queryPnr","queryUser","queryString","handleIsOnlineChangeClick","handlePnrInput","target","sanitizedValue","char","handleInput","sub","recaptchaErrorTemplate","bookingErrorTemplate","farelockErrorTemplate","unauthorizedErrorTemplate","showTooManyJourneysErrorTemplate","showAmericanAirlinesErrorTemplate","errorsContainerTemplate","nameOrEmailTemplate","id","TestIdDictionary","pnrInputTemplate","submitButtonTemplate","captchaTemplate","formTemplate","bannerTemplate","titleTemplate","parseModel","hostModel","culture","index","setting","s","handleInputChange","value","setCultureNameSettings","prevSettings","handleSave","cultureNameSettings","rowTemplate","getInputId","invalidClassName","cultureElemPrefix","roleElemPrefix","levelElemPrefix","codeElemPrefix","i","addEmpty","setPromoCodes","promoCodes","validate","isValid","cultureElem","roleElem","levelElem","codeElem","deleteRow","newPromoCodes","pc","grandParentElement","input","cultureTemplate","promoCode","roleCodeTemplate","programLevelTemplate","codeTemplate","buttonsTemplate","deleteButtonTemplate","addButtonTemplate","countryMap","culturesWithoutPossibleCountries","optionTemplate","cultureCode","countryName","selectedValue","optionsTemplate","CHECKBOX_ELEM_PREFIX","INPUT_ELEM_PREFIX","handleCheckboxChange","checkbox","setInsuranceSettings","insuranceSettings","tealiumLogPaxNumbers","vm","tealiumLogPreloadedPromoCode","tealiumLogSearchClick","data","tealiumLogSelectReturnType","tealiumLogSelectOneWayType","callbacks","useSingleton","setValue","setUp","init","initFn","initResult","update","newValue","_","usePane","mode","lastOpenMode","closePane","set","newMode","usePax","handleIncrease","handleDecrease","decode","dec","getPromoCode","programCodesWithLevels","roleCode","dynamicSettings","promoCodeFromUrl","getPromoCodeFromUrl","a","b","item","urlElems","queryElems","elem","useUserInfo","userInfo","decodedUserInfo","usePaxSelector","pane","paxRoot","paxPane","setVm","showTeenInfantRemoveWarning","setShowTeenInfantRemoveWarning","showGroupWarning","setShowGroupWarning","isValidated","setIsValidated","maxChildrenAmount","model","retVal","maxInfantAmount","adults","decreasePax","increasePax","teens","children","infants","showChildrenAgeWarningDomColombia","onClickOutsidePax","path","showMinorOrInfantAgeWarning","adjustChildrenAndInfantAmountsSafely","newVm","formattedAmount","displayedValue","canAddMorePax","handleClose","handleClick","updateOnSearchReload","inputFieldTemplate","mobilePaneCloserTemplate","paneCloserTemplate","groupWarningTemplate","language","country","groupUrl","minorOrInfantAgeWarningTemplate","showTeenInfantRemoveWarningTemplate","childrenAgeWarningDomColombiaTemplate","paneTemplate","getShowFarePriceForCulture","showFarePrices","createHeaders","headers","mapToSchedule","apiSchedule","useNavitaireSettings","settings","fetchNavitaireSettings","c","url","useTimeTable","inboundMetadata","setInboundMetadata","inboundSchedules","setInboundSchedules","outboundMetadata","setOutboundMetadata","outboundSchedules","setOutboundSchedules","getApiTimeTable","origin","destination","generateTimeTableUrl","fetchOptions","reset","_a","startOfMonth","shouldSearchOneWayOnly","originCode","destinationCode","outbound","outboundDates","inbound","inboundDates","handleRouteChange","isSameOrAfter","isSameOrBefore","useDateSelector","datePane","fromDate","toDate","currentDeparture","setCurrentDeparture","currentReturn","setCurrentReturn","selectedPriceInbound","setSelectedPriceInbound","selectedPriceOutbound","setSelectedPriceOutbound","forcedUpdateMode","setForcedUpdateMode","timetable","isOpen","onClickOutsideDate","sortSchedulesForMin","sortSchedulesForMax","getMinDateOutbound","firstOutbound","getMinDateInbound","firstInbound","getMaxDateOutbound","lastOutbound","getMaxDateInbound","lastInbound","handleDateChange","handlePriceChange","handleDepartureClick","handleReturnClick","selectedOrigin","selectedDestination","departureDate","returnDate","newOutboundDates","newInboundDates","parsedDeparture","parsedReturn","handler","calendarTemplate","datepickerTemplate","isDepartureDisabled","departureText","isReturnDisabled","returnText","getCountryAndStationByCode","allCountries","stationCode","station","getStationByCode","getStationCountryByStationCode","countryCode","filterCountriesForPartialString","countries","searchExpression","region","isSubstringInDisplayedName","r","alphabeticalOrderStrategy","abTestSettings","stations","padLeft","num","size","text","padRight","isEmpty","areEqual","first","second","resourceXmlOrderStrategy","stationSettings","getRegionName","name","getMarkets","getAllStations","markets","market","orderedCountries","orderedCountry","regionStation","useStationOrderStrategyFactory","orderStrategyMap","getStationOrder","_b","alphabeticalAscVariant","v","order","useStations","navitaireSettings","factory","countryStations","setCountryStations","setLoader","isCountryAvailable","apiCountry","availableDestinationCountriesForStation","city","loadApiCountries","createStationsUrl","loadStations","strategy","filteredCountries","eventBusTriggerOriginSelected","eventBusTriggerDestinationSelected","eventBusTriggerOutboundDateSelected","eventBusTriggerInboundDateSelected","eventBusTriggerSelectReturnType","eventBusTriggerSelectOneWayType","listItemClassName","useRouteSelector","getDefaultCountry","endpoint","citySelector","countryList","fromCity","locationSelector","mobileList","mobileSearchField","toCity","typingResults","displayedData","setDisplayedData","searchExpressionDestination","setSearchExpressionDestination","searchExpressionOrigin","setSearchExpressionOrigin","setSelectedDestination","selectedDestinationCountryCode","setSelectedDestinationCountryCode","setSelectedOrigin","selectedOriginCountryCode","setSelectedOriginCountryCode","cityScroller","setCityScroller","countryScroller","setCountryScroller","mobileListScroller","setMobileListScroller","typingResultScroller","setTypingResultScroller","handleOriginSelect","openDestinationSelector","clearAllSearchFields","handleDestinationSelect","onClickOutsideRoute","evt","addPerfectScrollbar","sc","instantiatePerfectScrollbar","element","isSelectedOriginCountry","isSelectedDestinationCountry","isSelectedOriginCity","cityCode","isSelectedDestinationCity","showCitySelector","scrollToCity","code","selectedCityListItem","getSelectedListElem","areContainerAndItemVisible","scrollContainerToItem","scrollToCountry","selectedCountryListItem","container","DomCrawlingHelper","counter","isItemBelowContainer","isItemAboveContainer","regionsToDisplay","selectedCountryCode","isCountrySelected","isCitySelected","mobileLocationHeaderText","showPane","autoSelectTheOnlyCountry","autoSelectedCountry","openOriginSelectorForChange","openOriginSelectorEmpty","newSelectedOriginCountryCode","openOriginSelector","openDestinationSelectorForChange","openDestinationSelectorEmpty","newSelectedDestinationCountryCode","handleMobileLocationSelectorClose","selectCountry","handleOriginCountrySelect","handleDestinationCountrySelect","selectCity","handleTypeInOrigin","handleTypeInDestination","handleTypeInMobile","availableDestinations","inputFieldsTemplate","fromTemplate","toTemplate","mobileHeaderTemplate","firstPaneTemplate","desktopCountriesTemplate","mobileCountriesTemplate","searchResultListTemplate","desktopCountryTemplate","mobileCountryItemsTemplate","mobileRegionsTemplate","regionLabelTemplate","citiesTemplate","isTypingResult","isMobile","tempClassMap","newLabelTemplate","typingResultCountryTemplate","regionsTemplate","noSearchResultErrorTemplate","regionArray","secondPaneTemplate","oneWayId","returnId","useTripTypeSelector","numberOfJourneys","setNumberOfJourneys","handleReturn","handleOneWay","newNumberOfJourneys","usePromoCodeBox","predefinedPromoCode","setPredefinedPromoCode","setPromoCode","showPromoCodeFormatError","setShowPromoCodeFormatError","showPromoCodeVoucherError","setShowPromoCodeVoucherError","displayedPromoCode","getMaskedPromoCode","lengthToMask","handleBlur","newPromoCode","errorTemplate","showPromoCode","usePreviousSearch","save","load","rawValue","oldValue","REDEMPTION_MILES_ID","isCug2User","isCug3User","isPecoUser","showRedemptionMiles","displayedTab","setDisplayedTab","isCollapsed","setIsCollapsed","isRedemptionCheckboxChecked","setIsRedemptionCheckboxChecked","promoCodeBox","startLoading","loaderInstance","stopLoading","routeSelector","tripTypeSelector","datePicker","paxSelector","previousSearch","showReloadLink","getUserRoleCode","logHomePageLoaded","eventParams","programCode","acc","p","programLevel","level","getSearchRequest","cultureElements","countryIndex","rc","isRedemptionSearch","req","redirectToQueueItUrl","requestUrl","newLocationUrl","redirectToRegularUrl","raiseEventBusEvent","savePreviousSearch","showInsuranceTab","getInsuranceTabUrl","handleReloadSearch","_c","_d","shouldUpdateRoute","shouldUpdateDates","handleFormSubmit","validateForm","validateRoute","validateDates","validatePaxSelector","validatePromoCode","request","handleFlightTabSelect","handleInsuranceTabSelect","handleHotelTabSelect","handleCarTabSelect","handleTransferTabSelect","reloadLinkTemplate","flightTabContentTemplate","redemptionMilesCheckboxTemplate","flightTabTemplate","handleInsuranceButtonClick","insuranceHeaderTemplate","insuranceTabTextTemplate","insuranceTabButtonTemplate","image","insuranceTabContentTemplate","insuranceTabTemplate","hotelsTabTemplate","carsTabTemplate","carUrl","transfersTabTemplate","transferUrl","tabSelectorTemplate","tab","tabs","list","DEFAULTS","ChangeDateEvent","detail","ChangeSelectedPriceEvent","mapProperties","convertToDayJs","setComponentId","collectDisplayedDates","calendarMonths","currentDate","date","formattedDayJsDate","month","isDayDisabled","day","minDate","maxDate","schedule","weekdays","days","doesWeekStartOnSunday","move","direction","setCurrentDate","getNewRangeFromOneDate","existingDay","newDay","getNewRangeDates","start","end","selectedDate","isSelectedDayAfterHoveredDay","hoveredDay","isDaySelected","isDayRangeStart","isDayRangeEnd","isDayToday","isDayInHoveredRange","isDayInRange","isBackOneMonthDisabled","isForwardOneMonthDisabled","addPlacerholderDaysInFront","addPlacerholderDaysAfter","getCalendarForMonth","offset","offsetDate","firstDayIndex","endOfMonth","lastDayIndex","weeks","weekDay","weekIndex","getInitialSelectedDate","aggr","initialCurrentDate","updateInputField","inputElem","componentId","formatSelectedPrice","price","dispatchChange","selectedPrice","d","handleMouseEnter","setHoveredDay","handleMouseLeave","handleBack","handleForward","handleDateClick","newValues","setSelectedDate","lowestDisplayedPriceSchedule","displayedDates","curr","navigationPlaceholderTemplate","forwardOneMonthTemplate","hiddenOnDesktop","backOneMonthTemplate","firstMonthNavigationTemplate","secondMonthNavigationTemplate","dateToDisplay","weekdaysHeaderTemplate","weekday","weekTemplate","week","dayTemplate","currentSchedule","numberFormatter","weeksTemplate","insensitiveEquals","string1","string2","mainCultureSubCultureCodes","currentCultureCode","nonMainCultureSubCultureCodes","mainCultureSubCultures","subCultureCode","convertCodesToCultureListItems","cultureList","cultureCodes","mapToCultureListItem","listItem","getSelectableMainCultureSubCultures","currentCulture","getSelectableNonMainCultureSubCultures","isCultureEnabled","getSelectableCulturesInOrder","remainingSubCultures","useCultureSelector","listElem","isCountryListOpened","setIsCountryListOpened","selectedLanguage","cultures","canSwitchCulture","handleCountryListOpen","openCultureTemplate","selectedCulture","cultureOptionTemplate","cultureDropdownTemplate","loginOptionClasses","useLoginWidget","handlePersonLoginClick","loginUrl","handleAmericanLoginClick","encodedUrl","handlePeruComprasLoginClick","peruCompraLoginUrl","handleBancoLoginClick","bancoLoginUrl","agencyLoginClick","agencyLoginUrl","companyLoginClick","companyLoginUrl","separatorTemplate","personTemplate","bancoEstadoTemplate","americanAirlinesTemplate","peruComprasTemplate","cugOptionsTemplate","closeButtonTemplate","useAmericanUserData","handleAmericanDropdownClick","handleNavigateToAmericanAccount","formattedAmericanTierNameTemplate","americanTemplate","americanDropdownTemplateDesktop","americanUserButtonsTemplateDesktop","americanDropdownTemplateMobile","americanListTemplateMobile","didScroll","navbarHeight","lastScrollTop","root","navBar","mobileMenu","isBancoEstadoBarOpened","setIsBancoEstadoBarOpened","isLoggedIn","setIsLoggedIn","userName","setUserName","isSemiCollapsed","setIsSemiCollapsed","isBancoEstadoTabOpen","setIsBancoEstadoTabOpen","isLoginWidgetOpen","setIsLoginWidgetOpen","isAmericanDropdownOpen","setIsAmericanDropdownOpen","loginWidget","languageAndCountry","cultureSelector","profileUrl","bancoEstadoLoginUrl","anchor","validateRestrictedUrl","initBancoEstadoBar","cookieUserName","getNameFromUserNameCookie","tealiumLogInit","setAmplitudeDeviceId","handleScroll","cookieDeviceId","amplitudeInterval","amplitudeTimeLimit","getOrgName","orgName","mainContent","pathElements","countryKey","languageKey","newUrl","getDcMembershipType","tealiumInfoRaw","decodedTealiumInfo","isBancoEstadoCategory","cat","isNewBancoEstadoCategory","getUserTypeForLoginInfoModal","st","handleCheckinModalOpen","handleAdminModalOpen","handlePeruCompraLoginInfoModalOpen","handleChileCompraLoginInfoModalOpen","handleMobileMenuClick","handleBancoEstadoTabClick","handleLoginWidgetClick","handleLogout","toggleBancoEstadoBar","americanUserData","logoTemplate","menuTemplate","menuItemsTemplate","adminMenuTemplate","menuForAnonymousUsersTemplate","menuForLoggedInUsersTemplate","bancoEstadoMenuOpenerTemplate","bancoEstadoMenuDropdownTemplate","bancoEstadoMenuTemplate","bancoEstadoProfileTemplate","profileTemplate","peruCompraUserInfoTemplate","chileCompraUserInfoTemplate","logoutTemplate","tempClassNames","imgUrl","bancoEstadoArrowTemplate","employeeOrgTemplate","cug2OrgNameTemplate","bancoEstadoOrgNameTemplate","peruCompraProfileUrl","availableAmount","chileCompraProfileUrl","getUserTitle","handleAcceptClick","userType","loginInfoModalMessageTemplate","contentTemplate","footerTemplate","setIsOpen","handleAcceptButton","loaderClassName","error","setError","params","session","formData","res","err","token","errorDescription","handleContinueButton","headerTemplate","useCountdown","count","setCount","timerId","resetCountdown","visibleCountdownBeforeEndInMinutes","finalCountdown","timer","setTimer","setMode","deadline","startCountdown","canRefresh","parseTime","time","getCountdownTime","currentUtc","deadlineUtc","difference","differenceInMilliseconds","visibleCountdownBeforeEndInMilliseconds","startVisibleCountdown","refreshSession","responseJson","handleContinueButtonClick","handleRestartButtonClick","sessionWarningMessageTemplate","sessionRefreshButtonTemplate","errorWarningTemplate","sessionExpiredMessageTemplate","startOverButtonTemplate","timerDisplayTemplate","remainingMinutes","remainingSeconds","remainingTimeString","initCustomElements","Debug","PubSub","initLocalization","format","linkObject","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","module","__webpack_modules__","deferred","chunkIds","fn","priority","notFulfilled","fulfilled","j","getter","exports","definition","obj","prop","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","chunkLoadingGlobal","__webpack_exports__"],"sourceRoot":""}