{"version":3,"file":"advisor-landing-553mdOgG.js","sources":["../../../scripts/components/pages/advisor-landing-page.vue","../../../scripts/entry-points/advisor-landing.ts"],"sourcesContent":["<template>\r\n <div v-if=\"isReady\" id=\"advisor-landing-container\">\r\n <div class=\"extra-wide advisor-top-video context-dark\">\r\n <div class=\"-overlay\">\r\n <div class=\"-banner-text text-shadow\">\r\n <h1 class=\"text--serif heading--cozy\" v-html=\"content.headline\"></h1>\r\n <h2 class=\"text--serif mt-2\" v-html=\"content.subhead\"></h2>\r\n <a :href=\"content.headerButtonUrl\" class=\"btn btn-primary-emphasis mt-5\" v-html=\"content.headerButtonText\"></a>\r\n </div>\r\n </div>\r\n <video autoplay loop muted playsinline width=\"100%\" class=\"d-md-none img-fit--cover\">\r\n <source :src=\"content.headerVideoUrlMobile\" :type=\"deriveMimeType(content.headerVideoUrlMobile)\">\r\n </video>\r\n <video autoplay loop muted playsinline width=\"100%\" class=\"d-none d-md-block img-fit--cover\">\r\n <source :src=\"content.headerVideoUrlDesktop\" :type=\"deriveMimeType(content.headerVideoUrlDesktop)\">\r\n </video>\r\n </div>\r\n\r\n <section class=\"container\">\r\n <div class=\"advisor-search-container\">\r\n <h2 class=\"text--serif mb-1\" v-html=\"content.searchHeader\"></h2>\r\n <div class=\"mb-3\" v-html=\"content.searchSubhead\"></div>\r\n <product-search-component :catalog-type=\"advisors\" :is-landing-page=\"true\" @search-executed=\"searchExecuted\"></product-search-component>\r\n <div id=\"static-more-results\" class=\"more-advisor-results d-md-none\"></div>\r\n </div>\r\n </section>\r\n\r\n <section class=\"slab mb-0\">\r\n <div class=\"container\">\r\n <h2 class=\"text--serif mb-2\" v-html=\"content.bottomCardsTitle\"></h2>\r\n <article-cards-static-component :article-cards=\"content.bottomCards\" :lazy-load=\"true\"></article-cards-static-component>\r\n </div>\r\n </section>\r\n </div>\r\n <LogoSplash v-else />\r\n</template>\r\n\r\n\r\n<script setup lang=\"ts\">\r\n import ProductSearchComponent from \"components/products/search/product-search.vue\";\r\n import ArticleCardsStaticComponent from \"components/article/article-cards-static.vue\";\r\n import LogoSplash from \"components/shared/logo-splash.vue\";\r\n import { DotCMSAdvisorLandingPageResponse } from \"interfaces/responses/dotcms-responses\";\r\n import { AdvisorLandingPageContent } from \"interfaces/advisor\";\r\n import { ProductType } from \"interfaces/enums\";\r\n import { getCmsContent } from \"services/api/cms\";\r\n import { generateCmsImageUrl } from \"services/helpers/images\";\r\n import { toastError } from \"services/helpers/toasts\";\r\n import { deriveMimeType } from \"services/layout/metadata\";\r\n import { cobrandLink } from \"virtuoso-shared-web-ui\";\r\n import { ref } from \"vue\";\r\n\r\n const advisors: ProductType = ProductType.ADVISORS;\r\n const isInitialSearch = ref(true);\r\n const content = ref<AdvisorLandingPageContent>({} as AdvisorLandingPageContent);\r\n const isReady = ref(false);\r\n\r\n getCmsContent<DotCMSAdvisorLandingPageResponse[]>({\r\n contentTypes: [\"AdvisorLandingPage\"],\r\n depth: 1,\r\n limit: 1\r\n }).then((advisorLandingJSON) => {\r\n if (advisorLandingJSON?.length) {\r\n\r\n const pageData = advisorLandingJSON[0];\r\n\r\n content.value = {\r\n bottomCards: [],\r\n bottomCardsTitle: pageData.bottomCardsTitle,\r\n headerButtonText: pageData.headerButtonText,\r\n headerButtonUrl: cobrandLink(pageData.headerButtonUrl),\r\n headerVideoUrlDesktop: pageData.headerVideoUrlDesktop,\r\n headerVideoUrlMobile: pageData.headerVideoUrlMobile,\r\n headline: pageData.headline,\r\n searchHeader: pageData.searchHeader,\r\n searchSubhead: pageData.searchSubhead,\r\n subhead: pageData.subhead\r\n };\r\n\r\n // Bottom Cards (1-3)\r\n for (let cardCount = 1; cardCount <= 3; cardCount++) {\r\n const bottomCardTitleKey = `bottomCard${cardCount}Title` as keyof DotCMSAdvisorLandingPageResponse;\r\n const bottomCardImageKey = `bottomCard${cardCount}Image` as keyof DotCMSAdvisorLandingPageResponse;\r\n const bottomCardUrlKey = `bottomCard${cardCount}Url` as keyof DotCMSAdvisorLandingPageResponse;\r\n const bottomCardDescriptionKey = `bottomCard${cardCount}Description` as keyof DotCMSAdvisorLandingPageResponse;\r\n\r\n content.value.bottomCards.push({\r\n categories: [],\r\n headline: pageData[bottomCardTitleKey],\r\n imageUrl: generateCmsImageUrl(pageData[bottomCardImageKey]),\r\n imageCropFocus: \"center\",\r\n link: cobrandLink(pageData[bottomCardUrlKey]),\r\n subhead: pageData[bottomCardDescriptionKey]\r\n });\r\n }\r\n\r\n // ########## Render\r\n isReady.value = true;\r\n\r\n } else {\r\n toastError(\"Error retrieving data\");\r\n console.error(\"Error retriving data advisor landing page data\");\r\n }\r\n\r\n }, () => {\r\n toastError(\"Error retrieving data\");\r\n });\r\n\r\n // When a search executes, copy the \"more results\" content to below the results (only shown on mobile)\r\n const searchExecuted = (totalResults: number): void => {\r\n let moreResultsContent = \"\";\r\n\r\n if (totalResults > 5 && document.querySelector(\"li.more-advisor-results\")) {\r\n moreResultsContent = document.querySelector(\"li.more-advisor-results\").innerHTML;\r\n }\r\n\r\n document.getElementById(\"static-more-results\").innerHTML = moreResultsContent;\r\n document.querySelector(\".product-search-results\").scrollLeft = 0;\r\n\r\n if (!isInitialSearch.value) { // Don't jump down to the search results on page load\r\n document.getElementById((window.innerWidth >= 768) ? \"advisor-search-options\" : \"filter-read\").scrollIntoView({ behavior: \"smooth\" });\r\n }\r\n isInitialSearch.value = false;\r\n };\r\n</script>\r\n","import AdvisorLandingPageComponent from \"components/pages/advisor-landing-page.vue\";\r\nimport { virtuosoUser } from \"services/auth/user-info\";\r\nimport { trackEvent } from \"services/analytics\";\r\nimport { cobrandLink, getCobrandType, isCobranded, slugify } from \"virtuoso-shared-web-ui\";\r\nimport { createApp } from \"vue\";\r\nimport { mountApp } from \"vue-app\";\r\n\r\n\r\nif (isCobranded()) {\r\n const cobrandType = getCobrandType();\r\n if (cobrandType === \"advisor\" && virtuosoUser?.cobrandModel?.advisorMeid) {\r\n location.href = cobrandLink(`/travel/advisors/${virtuosoUser.cobrandModel.advisorMeid}/${slugify(virtuosoUser.cobrandModel.cobrandedDisplayName)}`);\r\n } else {\r\n if (cobrandType !== \"advisor\") {\r\n console.error(\"Invalid cobrand type: \", cobrandType);\r\n } else {\r\n console.error(\"Invalid advisor MeID: \", virtuosoUser?.cobrandModel?.advisorMeid);\r\n }\r\n }\r\n} else {\r\n const app = createApp(AdvisorLandingPageComponent);\r\n mountApp(app, \"page-app\");\r\n}\r\ntrackEvent(\"entry_view\", { item_name: \"Advisor_Home\", item_category: \"Advisor\" });\r\n"],"names":["advisors","ProductType","isInitialSearch","ref","content","isReady","getCmsContent","advisorLandingJSON","pageData","cobrandLink","cardCount","bottomCardTitleKey","bottomCardImageKey","bottomCardUrlKey","bottomCardDescriptionKey","generateCmsImageUrl","toastError","searchExecuted","totalResults","moreResultsContent","isCobranded","cobrandType","getCobrandType","_b","_a","virtuosoUser","slugify","_d","_c","app","createApp","AdvisorLandingPageComponent","mountApp","trackEvent"],"mappings":"glDAoDI,MAAMA,EAAwBC,EAAY,SACpCC,EAAkBC,EAAI,EAAI,EAC1BC,EAAUD,EAA+B,CAAA,CAA+B,EACxEE,EAAUF,EAAI,EAAK,EAEyBG,EAAA,CAC9C,aAAc,CAAC,oBAAoB,EACnC,MAAO,EACP,MAAO,CAAA,CACV,EAAE,KAAMC,GAAuB,CAC5B,GAAIA,GAAA,MAAAA,EAAoB,OAAQ,CAEtB,MAAAC,EAAWD,EAAmB,CAAC,EAErCH,EAAQ,MAAQ,CACZ,YAAa,CAAC,EACd,iBAAkBI,EAAS,iBAC3B,iBAAkBA,EAAS,iBAC3B,gBAAiBC,EAAYD,EAAS,eAAe,EACrD,sBAAuBA,EAAS,sBAChC,qBAAsBA,EAAS,qBAC/B,SAAUA,EAAS,SACnB,aAAcA,EAAS,aACvB,cAAeA,EAAS,cACxB,QAASA,EAAS,OAAA,EAItB,QAASE,EAAY,EAAGA,GAAa,EAAGA,IAAa,CAC3C,MAAAC,EAAqB,aAAaD,CAAS,QAC3CE,EAAqB,aAAaF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