{"version":3,"file":"article-_uHOrg9y.js","sources":["../../../../scripts/services/transformers/article.ts"],"sourcesContent":["import { DotCMSBasicArticleResponse, DotCMSCaptionedImageThreeResponse, DotCMSEditorialItineraryContent, DotCMSGraphQLBasicArticleResponse, DotCMSListicleContent } from \"interfaces/responses/dotcms-responses\";\r\nimport { FindAnAdvisorCTA } from \"interfaces/advisor\";\r\nimport { ArticleBasic, ArticleHeader } from \"interfaces/article\";\r\nimport { ArticleCard, ContentTile } from \"interfaces/card\";\r\nimport { CmsImageApiOptions, CmsSearchCriteria } from \"interfaces/cms\";\r\nimport { ArticleMediaTextPair, CaptionedImage, CaptionedMedia } from \"interfaces/image\";\r\nimport { baseUrl } from \"services/cms/cms\";\r\nimport { extractCategories } from \"services/helpers/categories\";\r\nimport { adjustYouTubeEmbeds } from \"services/helpers/html\";\r\nimport { generateCmsImageUrl } from \"services/helpers/images\";\r\nimport { cobrandLink } from \"virtuoso-shared-web-ui\";\r\n\r\n\r\n/**\r\n * Takes a dotCMS article object and returns the transformed BasicArticle.\r\n * @param article\r\n */\r\nexport function transformCmsBasicArticle(article: DotCMSBasicArticleResponse): ArticleBasic {\r\n const basicArticle: ArticleBasic = {\r\n\r\n // Advisor/Pro Tip\r\n advisorTipText: (article.advisorTipText) ? article.advisorTipText : \"\",\r\n advisorTipAttribution: (article.advisorTipAttribution) ? article.advisorTipAttribution : \"\",\r\n articleTextIntro: adjustYouTubeEmbeds(article.articleText1),\r\n articleBody: [] as ArticleMediaTextPair[],\r\n identifier: article.identifier,\r\n isSponsored: (article.isSponsoredContent === \"1\") ? true : false,\r\n subhead: article.subhead\r\n };\r\n\r\n // ConsumerArticleBasic -- loop through the offset \"image1 / text2\", \"image2 / text3\" fields\r\n for (let i = 1; i <= 5; i++) {\r\n const articleImageKey = `articleImage${i}` as keyof DotCMSBasicArticleResponse;\r\n const articleTextKey = `articleText${i + 1}` as keyof DotCMSBasicArticleResponse;\r\n const articleVideoKey = `articleVideo${i}` as keyof DotCMSBasicArticleResponse;\r\n const articleImageCaptionKey = `articleImage${i}Caption` as keyof DotCMSBasicArticleResponse;\r\n const articleImageInfoKey = `articleImage${i}Info` as keyof DotCMSBasicArticleResponse;\r\n\r\n if (article[articleImageKey] || article[articleTextKey]) {\r\n const articleImageTextPair: ArticleMediaTextPair = {\r\n articleMedia: {\r\n imageUrl: (article[articleImageKey]) ? generateCmsImageUrl(article[articleImageKey] as string) : \"\",\r\n videoUrl: (article[articleVideoKey]) ? baseUrl + (article[articleVideoKey] as string) : \"\",\r\n caption: (article[articleImageCaptionKey]) ? article[articleImageCaptionKey] : \"\",\r\n citation: (article[articleImageInfoKey]) ? JSON.parse(article[articleImageInfoKey] as string).photoCredit : \"\",\r\n orientation: \"vertical\" // Forcing this for all body images for \"dynamic\" width\r\n } as CaptionedMedia,\r\n articleText: adjustYouTubeEmbeds(article[articleTextKey] as string) || \"\"\r\n };\r\n\r\n basicArticle.articleBody.push(articleImageTextPair);\r\n }\r\n }\r\n // Add relatedListicleContent if there is any\r\n if (article.relatedListicleContent && article.relatedListicleContent.length) {\r\n article.relatedListicleContent.forEach((item: DotCMSListicleContent) => {\r\n for (let i = 1; i <= 8; i++) {\r\n const listicleImageKey = `articleImage${i}` as keyof DotCMSListicleContent;\r\n const listicleTextKey = `articleText${i}` as keyof DotCMSListicleContent;\r\n const listicleVideoKey = `articleVideo${i}` as keyof DotCMSListicleContent;\r\n const listicleImageCaptionKey = `articleImage${i}Caption` as keyof DotCMSListicleContent;\r\n const listicleImageInfoKey = `articleImage${i}Info` as keyof DotCMSListicleContent;\r\n\r\n if (item[listicleVideoKey] || item[listicleImageKey] || item[listicleTextKey]) {\r\n const articleImageTextPair: ArticleMediaTextPair = {\r\n articleMedia: {\r\n imageUrl: (item[listicleImageKey]) ? generateCmsImageUrl(item[listicleImageKey] as string) : \"\",\r\n videoUrl: (item[listicleVideoKey]) ? baseUrl + item[listicleVideoKey] : \"\",\r\n caption: (item[listicleImageCaptionKey]) ? item[listicleImageCaptionKey] : \"\",\r\n citation: (item[listicleImageInfoKey]) ? JSON.parse(item[listicleImageInfoKey] as string).photoCredit : \"\",\r\n orientation: \"vertical\" // Forcing this for all body images for \"dynamic\" width\r\n } as CaptionedMedia,\r\n articleText: adjustYouTubeEmbeds(item[listicleTextKey] as string) || \"\"\r\n };\r\n\r\n basicArticle.articleBody.push(articleImageTextPair);\r\n }\r\n }\r\n });\r\n }\r\n\r\n // Add relatedEditorialItineraryContent if there is any\r\n if (article.relatedEditorialItineraryContent?.length) {\r\n basicArticle.itineraryContent = {\r\n toc: {\r\n header: article.relatedEditorialItineraryContent[0].tocHeaderText,\r\n items: []\r\n },\r\n body: []\r\n };\r\n\r\n const itineraryJumpLinks = new Set();\r\n article.relatedEditorialItineraryContent.forEach((item: DotCMSEditorialItineraryContent) => {\r\n\r\n for (let i = 1; i <= 6; i++) {\r\n const tocLabelKey = `tocLabel${i}` as keyof DotCMSEditorialItineraryContent;\r\n const tocTextKey = `tocText${i}` as keyof DotCMSEditorialItineraryContent;\r\n\r\n const bodyImageRightKey = `bodyImageR${i}` as keyof DotCMSEditorialItineraryContent;\r\n const bodyImageRightCaptionKey = `bodyCaptionR${i}` as keyof DotCMSEditorialItineraryContent;\r\n const bodyImageLeftKey = `bodyImageL${i}` as keyof DotCMSEditorialItineraryContent;\r\n const bodyImageLeftCaptionKey = `bodyCaptionL${i}` as keyof DotCMSEditorialItineraryContent;\r\n const bodyTextKey = `bodyText${i}` as keyof DotCMSEditorialItineraryContent;\r\n const bodyHeaderKey = `headerText${i}` as keyof DotCMSEditorialItineraryContent;\r\n\r\n\r\n if (item[bodyHeaderKey] && item[bodyTextKey]) {\r\n // Generate a jumpLinkId from the header text and ensure it's unique\r\n let jumpLinkId = item[bodyHeaderKey].replace(/[^a-zA-Z0-9\\s+]/g, \"\").replace(/\\s+/g, \"-\");\r\n if (itineraryJumpLinks.has(jumpLinkId)) {\r\n let jumpLinkIdPostfix = 1;\r\n while (itineraryJumpLinks.has(jumpLinkId)) {\r\n jumpLinkId = `${jumpLinkId}-${jumpLinkIdPostfix}`;\r\n jumpLinkIdPostfix++;\r\n }\r\n }\r\n itineraryJumpLinks.add(jumpLinkId);\r\n\r\n basicArticle.itineraryContent.toc.items.push({\r\n label: item[tocLabelKey] ?? \"\",\r\n text: item[tocTextKey] ?? item[bodyHeaderKey],\r\n jumpLinkId: jumpLinkId\r\n });\r\n\r\n basicArticle.itineraryContent.body.push({\r\n header: item[bodyHeaderKey],\r\n text: item[bodyTextKey],\r\n imageLeft: {\r\n imageUrl: (item[bodyImageLeftKey]) ? generateCmsImageUrl(item[bodyImageLeftKey] as string) : \"\",\r\n caption: (item[bodyImageLeftCaptionKey]) ? item[bodyImageLeftCaptionKey] : \"\"\r\n },\r\n imageRight: {\r\n imageUrl: (item[bodyImageRightKey]) ? generateCmsImageUrl(item[bodyImageRightKey] as string) : \"\",\r\n caption: (item[bodyImageRightCaptionKey]) ? item[bodyImageRightCaptionKey] : \"\"\r\n },\r\n jumpLinkId: jumpLinkId\r\n });\r\n }\r\n }\r\n });\r\n }\r\n\r\n return basicArticle;\r\n}\r\n\r\n/**\r\n * Takes a dotCMS article object and returns the transformed ArticleHeader.\r\n * @param article\r\n */\r\nexport function transformCmsBasicArticleHeader(article: DotCMSBasicArticleResponse): ArticleHeader {\r\n const heroImages = [];\r\n\r\n if (article.heroImage1) {\r\n heroImages.push(\r\n {\r\n imageUrl: generateCmsImageUrl(article.heroImage1),\r\n altText: article.heroImage1AltText,\r\n caption: article.heroImage1Caption,\r\n citation: article.heroImage1PhotoCredit,\r\n imageCropFocus: (article.heroImage1CropFocus) ? article.heroImage1CropFocus : \"center\",\r\n orientation: \"\" // Even though they're kinda vertical when there are 3, don't apply that styling\r\n }\r\n );\r\n\r\n // Add the second and third hero images only if both are present\r\n if (article.heroImage2 && article.heroImage3 && article.heroImage2 !== \"\" && article.heroImage3 !== \"\") {\r\n heroImages.push(\r\n {\r\n imageUrl: generateCmsImageUrl(article.heroImage2),\r\n altText: article.heroImage2AltText,\r\n caption: article.heroImage2Caption,\r\n citation: article.heroImage2PhotoCredit,\r\n imageCropFocus: \"\", // Only used on the first image when there is only 1\r\n orientation: \"\"\r\n },\r\n {\r\n imageUrl: generateCmsImageUrl(article.heroImage3),\r\n altText: article.heroImage3AltText,\r\n caption: article.heroImage3Caption,\r\n citation: article.heroImage3PhotoCredit,\r\n imageCropFocus: \"\", // Only used on the first image when there is only 1\r\n orientation: \"\"\r\n }\r\n );\r\n } else {\r\n heroImages[0].orientation = \"horizontal\";\r\n }\r\n }\r\n\r\n return {\r\n author: article.author,\r\n categories: (article.categories) ? extractCategories(article.categories) : [],\r\n date: article.articleDate,\r\n headline: article.headline,\r\n heroImages: heroImages,\r\n identifier: article.identifier,\r\n isSponsored: (article.isSponsoredContent === \"1\") ? true : false,\r\n metaDescription: article.metaDescription,\r\n metaHeadline: article.metaHeadline,\r\n metaKeywords: article.metaKeywords,\r\n tags: article.tags,\r\n useWideHeroImage: (article.useWideHeroImage && heroImages.length === 1) ?? false,\r\n useWideHeroHeadlineOverlay: (article.useWideHeroHeadlineOverlay && article.useWideHeroImage && heroImages.length === 1) ?? false\r\n };\r\n}\r\n\r\n/**\r\n * Takes a dotCMS article object and returns the transformed FindAdvisorCTA object.\r\n * @param article\r\n */\r\nexport function transformCmsBasicArticleFindAnAdvisorCta(article: DotCMSBasicArticleResponse): FindAnAdvisorCTA {\r\n const hasFindAnAdvisorHeaderWithContent = (article.findAnAdvisorContentText && article.findAnAdvisorHeader);\r\n\r\n return {\r\n buttonLink: (article.findAnAdvisorButtonLink) ? cobrandLink(article.findAnAdvisorButtonLink) : \"\",\r\n buttonText: article.findAnAdvisorButtonText,\r\n contentText: (hasFindAnAdvisorHeaderWithContent) ? article.findAnAdvisorContentText : \"\",\r\n header: (hasFindAnAdvisorHeaderWithContent) ? article.findAnAdvisorHeader : \"\"\r\n };\r\n}\r\n\r\n/**\r\n * Takes a dotCMS article object and returns the transformed contentTile.\r\n * @param article\r\n */\r\nexport function transformCmsBasicArticleToContentTile(article: DotCMSBasicArticleResponse): ContentTile {\r\n return {\r\n author: article.author,\r\n identifier: article.identifier,\r\n imageCropFocus: article.previewImageCropFocus,\r\n imageUrl: generateCmsImageUrl(article.previewImage, { width: 596 }),\r\n sponsoredText: (article.isSponsoredContent === \"1\") ? \"Sponsored\" : \"\",\r\n title: article.headline,\r\n url: cobrandLink(`/travel/articles/${article.articleUrl}`),\r\n categories: (article.categories) ? extractCategories(article.categories) : []\r\n };\r\n}\r\n\r\n/**\r\n * Takes a dotCMS article object and returns the transformed articleCard.\r\n * @param article\r\n */\r\nexport function transformCmsBasicArticleToArticleCard(article: DotCMSBasicArticleResponse | DotCMSGraphQLBasicArticleResponse, imageOptions: CmsImageApiOptions = { width: 576 }): ArticleCard {\r\n const previewImageUrl = (typeof article.previewImage === \"object\") ? (article.previewImage.idPath || \"\") : (article.previewImage || \"\");\r\n const verticalPreviewImageUrl = (typeof article.verticalPreviewImage === \"object\") ? (article.verticalPreviewImage.idPath || \"\") : (article.verticalPreviewImage || \"\");\r\n\r\n const articleCard: ArticleCard = {\r\n author: article.author,\r\n categories: (article.categories) ? extractCategories(article.categories) : [],\r\n headline: article.headline,\r\n identifier: article.identifier,\r\n imageCropFocus: article.previewImageCropFocus,\r\n imageDesktopUrl: (verticalPreviewImageUrl) ? generateCmsImageUrl(verticalPreviewImageUrl) : \"\",\r\n imageUrl: generateCmsImageUrl(previewImageUrl, imageOptions),\r\n link: buildArticleUrl(article.articleUrl),\r\n sponsoredText: (article.isSponsoredContent === \"1\") ? \"Sponsored\" : \"\",\r\n subhead: article.subhead\r\n };\r\n\r\n return articleCard;\r\n}\r\n\r\n\r\n\r\n/**\r\n * Takes a dotCMS Cationed Image Three object and returns the transformed CaptionedImage array.\r\n * @param captionedImageThree\r\n */\r\nexport function transformCmsCaptionedImageThreeToCaptionedImages(captionedImageThree: DotCMSCaptionedImageThreeResponse): CaptionedImage[] {\r\n\r\n const captionedImages: CaptionedImage[] = [];\r\n\r\n function getCaptionedImageThreeMobileCarouselCmsImage(imagePath: string, captionedImageThree: DotCMSCaptionedImageThreeResponse): string {\r\n return captionedImageThree.useMobileCarousel\r\n ? generateCmsImageUrl(imagePath)\r\n : generateCmsImageUrl(imagePath, { width: 390, height: 546 });\r\n }\r\n\r\n for (let i = 1; i <= 3; i++) {\r\n const captionedAltTextKey = `image${i}AltText` as keyof DotCMSCaptionedImageThreeResponse;\r\n const captionedImageCaptionKey = `image${i}Caption` as keyof DotCMSCaptionedImageThreeResponse;\r\n const captionedImageCropFocusKey = `image${i}CropFocus` as keyof DotCMSCaptionedImageThreeResponse;\r\n const captionedImageKey = `image${i}` as keyof DotCMSCaptionedImageThreeResponse;\r\n const captionedImagePhotoCreditKey = `image${i}PhotoCredit` as keyof DotCMSCaptionedImageThreeResponse;\r\n const captionedImageLinkKey = `image${i}Link` as keyof DotCMSCaptionedImageThreeResponse;\r\n\r\n const captionedMedia: CaptionedImage = {\r\n altText: (captionedImageThree[captionedAltTextKey]) ? captionedImageThree[captionedAltTextKey] as string : \"\",\r\n caption: (captionedImageThree[captionedImageCaptionKey]) ? captionedImageThree[captionedImageCaptionKey] as string : \"\",\r\n citation: (captionedImageThree[captionedImagePhotoCreditKey]) ? captionedImageThree[captionedImagePhotoCreditKey] as string : \"\",\r\n imageCropFocus: (captionedImageThree[captionedImageCropFocusKey]) ? captionedImageThree[captionedImageCropFocusKey] as string : \"\",\r\n imageUrl: (captionedImageThree[captionedImageKey]) ? getCaptionedImageThreeMobileCarouselCmsImage(captionedImageThree[captionedImageKey] as string, captionedImageThree) : \"\",\r\n orientation: \"vertical\",\r\n url: (captionedImageThree[captionedImageLinkKey]) ? captionedImageThree[captionedImageLinkKey] as string : \"\"\r\n };\r\n\r\n // Check if this slide is valid\r\n if (captionedMedia.altText !== \"\" &&\r\n captionedMedia.caption !== \"\" &&\r\n captionedMedia.imageCropFocus !== \"\" &&\r\n captionedMedia.imageUrl !== \"\") {\r\n\r\n captionedImages.push(captionedMedia);\r\n }\r\n }\r\n return captionedImages.length === 3 ? captionedImages : [];\r\n}\r\n\r\n/**\r\n * Takes a comma delimited list of tags and an article ID and returns the a query object.\r\n * @param tags\r\n * @param relatedArticleId\r\n */\r\nexport function buildRelatedArticlesQuery(tags: string, relatedArticleId: string): CmsSearchCriteria {\r\n const tagsArr = tags.length ? tags.split(\",\") : [];\r\n\r\n return {\r\n contentTypes: [\"ConsumerArticleBasic\"],\r\n limit: 5,\r\n queryClauses: [\r\n ` +ConsumerArticleBasic.tags:(\"${tagsArr.join('\" \"')}\")`,\r\n ` -(identifier: ${relatedArticleId})`\r\n ],\r\n sort: \"score,ConsumerArticleBasic.publish desc\"\r\n };\r\n}\r\n\r\n/**\r\n * Adds the correct prefix and adds cobranding\r\n */\r\nexport function buildArticleUrl(path: string): string {\r\n return cobrandLink(`/travel/articles/${path ?? \"\"}`);\r\n}\r\n"],"names":["transformCmsBasicArticle","article","basicArticle","adjustYouTubeEmbeds","i","articleImageKey","articleTextKey","articleVideoKey","articleImageCaptionKey","articleImageInfoKey","articleImageTextPair","generateCmsImageUrl","baseUrl","item","listicleImageKey","listicleTextKey","listicleVideoKey","listicleImageCaptionKey","listicleImageInfoKey","_a","itineraryJumpLinks","tocLabelKey","tocTextKey","bodyImageRightKey","bodyImageRightCaptionKey","bodyImageLeftKey","bodyImageLeftCaptionKey","bodyTextKey","bodyHeaderKey","jumpLinkId","jumpLinkIdPostfix","transformCmsBasicArticleHeader","heroImages","extractCategories","transformCmsBasicArticleFindAnAdvisorCta","hasFindAnAdvisorHeaderWithContent","cobrandLink","transformCmsBasicArticleToContentTile","transformCmsBasicArticleToArticleCard","imageOptions","previewImageUrl","verticalPreviewImageUrl","buildArticleUrl","transformCmsCaptionedImageThreeToCaptionedImages","captionedImageThree","captionedImages","getCaptionedImageThreeMobileCarouselCmsImage","imagePath","captionedAltTextKey","captionedImageCaptionKey","captionedImageCropFocusKey","captionedImageKey","captionedImagePhotoCreditKey","captionedImageLinkKey","captioned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