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CAAC7I,IAAI,CAAC,CAAE8J,UAAW,IAAK,EAE5C,CAEO,SAASQ,EACd/B,CAAyC,EAEzC,IAAMwB,EAAWxB,MAAAA,EAAAA,KAAAA,EAAAA,EAAgBwB,QAAQ,CACnCrC,EAAQa,EAAeb,KAAK,CAC9Ba,EAAeb,KAAK,CAAC1B,MAAM,CAC3B+D,EAAS/D,MAAM,CACb0E,EAAU,SAASC,IAAI,CAACpC,MAAAA,EAAAA,KAAAA,EAAAA,EAAgB/G,EAAE,EAC1CoJ,EAAerC,MAAAA,EAAAA,KAAAA,EAAAA,EAAgB/F,KAAK,CACpChB,EAAKkJ,EAAUA,CAAO,CAAC,EAAE,CAAG,GAClC,MAAO,CACLnD,QAAS/F,EACTgG,UAAWoD,EACXnD,aAAcc,MAAAA,EAAAA,KAAAA,EAAAA,EAAgBsC,YAAY,CAC1C1J,SAAU,EACVuG,MAAAA,CACF,CACF,4HCvBO,IAAMoD,EAAe,CAC1BC,SANmC,CAAEvJ,GAAI,EAAGiD,KAAM,UAAW,EAO7DuG,OANiC,CAAExJ,GAAI,EAAGiD,KAAM,QAAS,EAOzDwG,gBANyC,CAAEzJ,GAAI,EAAGiD,KAAM,gBAAiB,EAOzEyG,MANoC,CAAE1J,GAAI,EAAGiD,KAAM,OAAQ,CAO7D","sources":["webpack://_N_E/?9d25","webpack://_N_E/./components/page/head/index.tsx","webpack://_N_E/./hooks/useLink.tsx","webpack://_N_E/./pages/docfleck/rezept/[slug]/print.tsx","webpack://_N_E/./utils/helperFunctions/index.tsx","webpack://_N_E/./utils/localstorage/navigationTracking.ts","webpack://_N_E/./utils/trackingEvents/begin-checkout.ts","webpack://_N_E/./utils/trackingEvents/common.ts","webpack://_N_E/./utils/trackingEvents/select-item.ts","webpack://_N_E/"],"sourcesContent":["\n (window.__NEXT_P = window.__NEXT_P || []).push([\n \"/docfleck/rezept/[slug]/print\",\n function () {\n return require(\"private-next-pages/docfleck/rezept/[slug]/print.tsx\");\n }\n ]);\n if(module.hot) {\n module.hot.dispose(function () {\n window.__NEXT_P.push([\"/docfleck/rezept/[slug]/print\"])\n });\n }\n ","import Head from \"next/head\";\n\n/**\n * This component injects elements to `` of the page.\n * Contains elments shared by all pages wrapped into `` component.\n *\n * @returns JSX.Element\n */\nconst SharedHead = () => (\n \n \n \n);\n\nexport default SharedHead;\n","import { Asset } from \"contentful\";\n\nimport {\n ICoursePageFields,\n ILinkFields,\n IPageFields,\n} from \"../@types/generated/contentful\";\nimport { getHrefByPageTypeAndSlug } from \"../utils/helperFunctions\";\nimport {\n IProductFieldsModified,\n createCheckoutApiURL,\n getVariantIdsToCheckout,\n} from \"../utils/shopify/createCart\";\n\ninterface LinkProps {\n href: string;\n linkTarget: string;\n label: string;\n logo: Asset | undefined;\n shopifyProductFields: IProductFieldsModified | null;\n}\n\n/**\n * provides getLinkProps() to Components\n *\n * @returns { Function }\n */\nconst useLink = () => {\n /**\n * Prepares the fields of Link Contenttypes for the LinkComponent\n *\n * @param {ILinkFields } link\n * @returns linkProps\n */\n const getLinkProps = (link: ILinkFields): LinkProps => {\n const {\n externalLink,\n internalLink,\n target,\n label,\n logo,\n anchorLink,\n discount,\n } = link;\n const isInternal = !externalLink;\n let href = \"/\";\n let shopifyProductFields = null;\n\n if (isInternal) {\n const pageType = internalLink?.sys.contentType?.sys.id || \"homepage\";\n if (anchorLink) {\n href = \"#\" + anchorLink.fields.internal.replace(/\\s/g, \"\");\n } else if (pageType === \"product\" || pageType === \"productVariant\") {\n shopifyProductFields = internalLink?.fields as IProductFieldsModified;\n if (shopifyProductFields) {\n href = createCheckoutApiURL(\n getVariantIdsToCheckout(shopifyProductFields),\n discount\n );\n }\n } else if (internalLink?.fields !== undefined) {\n const slug = (internalLink?.fields as ICoursePageFields).slug || \"\";\n const isRecipe =\n internalLink?.sys.contentType?.sys.id == \"page\" &&\n (internalLink.fields as IPageFields).isRecipe;\n href = getHrefByPageTypeAndSlug(pageType, slug, isRecipe);\n }\n } else {\n href = externalLink;\n }\n\n const linkTarget = target ? \"_blank\" : \"_self\";\n\n return { href, linkTarget, label, logo, shopifyProductFields };\n };\n\n return { getLinkProps };\n};\n\nexport default useLink;\n","\"use client\";\n\nimport Container from \"@mui/material/Container\";\nimport safeStringify from \"fast-safe-stringify\";\n\nimport { GetStaticPaths, GetStaticProps, NextPage } from \"next\";\nimport Head from \"next/head\";\nimport Image from \"next/image\";\n\nimport { useEffect } from \"react\";\n\nimport { ContentfulNavigation } from \"../../../../@types/contentfulNavigation\";\nimport {\n IMetadataFields,\n IPageFields,\n IRecipeSection,\n} from \"../../../../@types/generated/contentful\";\nimport ContentSectionWrapper from \"../../../../components/content-section-wrapper\";\nimport SharedHead from \"../../../../components/page/head\";\nimport Navigation from \"../../../../components/page/navigation\";\nimport { getAllContentfulRecipePages } from \"../../../../utils/contentful/getAllContentfulRecipePages\";\nimport getContentfulPage from \"../../../../utils/contentful/getContentfulPage\";\nimport { withHttps } from \"../../../../utils/helperFunctions\";\nimport generateTitle from \"../../../../utils/page/generateTitle\";\nimport getJointPageProperties, {\n JointPageProperties,\n} from \"../../../../utils/page/getJointPageProperties\";\nimport { DOC_FLECK_TENANT_NAME } from \"../../../../utils/tenant-names\";\nimport { isDocFleckTenantPage } from \"../../../../utils/tenants\";\n\ninterface PageProps {\n isPreview?: boolean;\n page: IPageFields;\n previewData?: any;\n navigation: ContentfulNavigation;\n jointPageProperties: JointPageProperties;\n}\n\n/**\n * Top level page\n * @param {PageProps} props\n * @param {IPageFields} props.page\n * @returns JSX.Element\n */\nconst RecipePage: NextPage = ({ page }: PageProps) => {\n const { contentSections, seoMetadata, tenant } = page;\n const {\n fields: { title },\n } = seoMetadata;\n\n const prepareMetadata = (metadata: IMetadataFields) => {\n const og = metadata.ogMetadata?.fields;\n const twitter = metadata.twitterMetadata?.fields;\n\n const setRobots = () => {\n if (metadata.noIndex && metadata.noFollow) {\n return \"noindex, nofollow\";\n }\n\n if (metadata.noIndex) {\n return \"noindex\";\n }\n\n if (metadata.noFollow) {\n return \"nofollow\";\n }\n\n return \"\";\n };\n\n const robots = setRobots();\n\n const metatag = {\n title: metadata.title,\n description: metadata.description,\n keywords: metadata.keywords?.join(\", \"),\n robots,\n ogTitle: og?.title ?? metadata.title,\n ogDescription: og?.description ?? metadata.description,\n ogType: og?.type ?? \"\",\n ogImage: og?.image ?? twitter?.image ?? \"\",\n twitterCard: twitter?.card ?? \"\",\n twitterTitle: twitter?.title ?? metadata.title,\n twitterDescription: twitter?.description ?? metadata.description,\n twitterImage: twitter?.image ?? og?.image ?? \"\",\n };\n\n return metatag;\n };\n\n const metatags = prepareMetadata(seoMetadata.fields);\n const recipeSection = contentSections?.find(\n (section) => section.sys.contentType.sys.id === \"recipeSection\"\n ) as IRecipeSection;\n const recipeTitle = generateTitle(\n recipeSection.fields.title,\n \"Ein Doc Fleck Rezept\"\n );\n\n // parent.postMessage({ action: \"print-recipe-loaded\" });\n return (\n <>\n \n {recipeTitle}\n \n \n {metatags.keywords && (\n \n )}\n \n \n \n {metatags.ogType && (\n \n )}\n {metatags.ogImage && (\n \n )}\n {metatags.twitterCard && (\n \n )}\n \n \n {metatags.twitterImage && (\n \n )}\n \n \n\n \n
\n {contentSections\n ?.filter(\n (section) => section.sys.contentType.sys.id === \"recipeSection\"\n )\n .map((section, i) => (\n \n ))}\n
\n \n \n );\n};\n\nexport default RecipePage;\n\n/**\n * This function gets called at build time to pre-fetch the routes of the course pages\n * @returns {Promise<{paths: {params: {slug: string}}[], fallback: boolean}>}\n */\nexport const getStaticPaths: GetStaticPaths = async () => {\n // Call contentful API endpoint to get course pages\n const pages = await getAllContentfulRecipePages();\n\n // Filter out tenant pages\n const tenantPages = pages.filter((page) => isDocFleckTenantPage(page));\n const recipePages = tenantPages.filter((page) => page.isRecipe);\n // Get the paths we want to pre-render based on the pages\n const paths = recipePages.map((page) => ({\n params: {\n slug: page.slug,\n },\n }));\n\n // We'll pre-render only these paths at build time.\n // { fallback: false } means other routes should 404.\n return { paths, fallback: false };\n};\n\n/**\n * This function gets called at build time on server-side to statically pre-fetch the data for the page\n * @param {GetStaticPropsContext} context\n * @returns page data\n */\nexport const getStaticProps: GetStaticProps = async (context) => {\n const [page, jointPageProperties] = await Promise.all([\n getContentfulPage({\n // get page slug from context\n slug: context.params?.slug?.toString() || \"\",\n isPreview: context.preview || false,\n previewData: context.previewData,\n }),\n getJointPageProperties(context, DOC_FLECK_TENANT_NAME),\n ]);\n\n // if no page was found, return 404\n if (!page) {\n return { notFound: true };\n }\n\n const propsData = safeStringify({\n page: page.fields,\n theme: DOC_FLECK_TENANT_NAME,\n });\n\n const props = JSON.parse(propsData);\n\n // pass page data to the page via props\n return {\n props,\n };\n};\n","import { IProductFieldsModified } from \"../shopify/createCart\";\nimport { DataLayerItem } from \"../trackingEvents/common\";\n\n/**\n * Format a number and a currency code into a properly internationalized price.\n *\n * @param {number} amount\n * @param {string} currencyCode\n * @returns {string}\n */\nexport function formatPrice(amount: number, currencyCode: string = \"EUR\") {\n return Intl.NumberFormat(\"de-DE\", {\n style: \"currency\",\n currency: currencyCode,\n }).format(amount);\n}\n\n/**\n * Format the contents of a contentful date field to a date string in the form DD-MM-JJJJ\n * @param date string from contentful date field\n */\nexport function formatContentfulDate(date: string) {\n const dateObj = new Date(date);\n return `${dateObj.getDate()}. ${getMonthName(\n dateObj.getMonth()\n )} ${dateObj.getFullYear()}`;\n}\nfunction getMonthName(month: number) {\n return (\n [\n \"Januar\",\n \"Februar\",\n \"März\",\n \"April\",\n \"Mai\",\n \"Juni\",\n \"Juli\",\n \"August\",\n \"September\",\n \"Oktober\",\n \"November\",\n \"Dezember\",\n ][month] || \"\"\n );\n}\n\n/**\n * Prepends url with http if it's absent\n * @param {string} url\n * @returns {string}\n */\nexport function withHttps(url: string) {\n const prefixed = !/^https?:\\/\\//i.test(url) ? `https://${url}` : url;\n return prefixed.replace(\"////\", \"//\");\n}\n\n/**\n * Returns a contentful-specific href depending on given pageType\n *\n * @param {string} pageType - contentful content type\n * @param {string} slug - the slug of the page\n * @returns {string}\n */\nexport function getHrefByPageTypeAndSlug(\n pageType: string,\n slug: string,\n isRecipe = false\n) {\n let href = \"/\";\n // pageType can be e.g. CoursePage or coursePage --> lowercase the first letter\n const lowerCaseType = pageType[0].toLowerCase().concat(pageType.slice(1));\n\n switch (lowerCaseType) {\n case \"coursePage\":\n href = `/programme/${slug}`;\n break;\n case \"productDetailPage\":\n href = `/produkt/${slug}`;\n break;\n case \"page\":\n href = `${isRecipe ? \"/rezept\" : \"\"}/${slug}`;\n break;\n default:\n href = \"/\";\n break;\n }\n return href;\n}\n\n/**\n *\n * Temporary solution to write begin_checkout even if a checkoutlink in the form\n * // https://shop.hellohealth.de/cart/:\n * is used.\n */\nexport function getShopifyProductsFromHref(href: string) {\n const productInfos = {\n \"44765250421001\": {\n discount: 0,\n item_id: \"8361699868937\",\n item_name: \"Doc Fleck Ernährungstagebuch\",\n item_variant: \"Default Title\",\n price: { amount: \"30.00\" },\n },\n \"44497855578377\": {\n discount: 0,\n item_id: \"8267619696905\",\n item_name: \"17 Schlankbooster-Rezepte zum Abnehmen von Doc Fleck\",\n item_variant: \"Default Title\",\n price: { amount: \"16.99\" },\n },\n \"44337835639049\": {\n discount: 0,\n item_id: \"8207144517897\",\n item_name: \"Fett weg - die Länger-Leben-Formel von Doc Fleck\",\n item_variant: \"Default Title\",\n price: { amount: \"229.0\" },\n },\n \"44497963614473\": {\n discount: 0,\n item_id: \"8267654136073\",\n item_name: \"Doc Fleck Workbook\",\n item_variant: \"Default Title\",\n price: { amount: \"30.00\" },\n },\n } as any;\n const checkoutProducts = [] as DataLayerItem[];\n\n if (href && href.trim().startsWith(\"https://shop.hellohealth.de/cart/\")) {\n let productString = href\n .split(\"https://shop.hellohealth.de/cart/\")[1]\n .split(\"?\")[0];\n\n let productStrings = productString.split(\",\");\n\n productStrings.forEach((splitString) => {\n let [itemId, amount] = splitString.split(\":\");\n if (itemId && productInfos.hasOwnProperty(itemId)) {\n for (let i = 0; i < parseInt(amount); i++) {\n checkoutProducts.push({ ...productInfos[itemId] });\n }\n }\n });\n }\n return checkoutProducts;\n}\n\nexport function getShopifyProductsWithExtras(product: IProductFieldsModified) {\n const checkoutProducts = [product.shopifyProduct];\n if (product.extraShopifyProduct) {\n checkoutProducts.push(product.extraShopifyProduct);\n }\n if (product.extraShopifyProduct2) {\n checkoutProducts.push(product.extraShopifyProduct2);\n }\n return checkoutProducts;\n}\nexport const getIdFromString = (internalName: string) => {\n return (internalName || \"\").replace(/\\s/g, \"\");\n};\n\nexport const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms));\n","import { CourseListType } from \"../trackingEvents/select-item\";\n\n/**\n * Helper functions to read/write localstorage item used to determine how a coursepage was accessed (through header / homepage / coursepage overview)\n *\n */\n\ninterface PageSourceItem {\n timestamp: number;\n listType: CourseListType;\n}\n\nconst LOCAL_STORAGE_PATH = \"coursePageSource\";\n\nexport const saveCoursepageSource = (courseList: CourseListType): void => {\n if (typeof window !== \"undefined\" && window.dataLayer) {\n const item = {\n timestamp: Date.now(),\n listType: courseList,\n };\n window.localStorage.setItem(LOCAL_STORAGE_PATH, JSON.stringify(item));\n }\n};\nexport const getCoursePageSource = (): CourseListType | undefined => {\n if (typeof window !== \"undefined\" && window.dataLayer) {\n const now = Date.now();\n const lsString = window.localStorage.getItem(LOCAL_STORAGE_PATH);\n let lsItem = null;\n if (lsString != null) {\n lsItem = JSON.parse(lsString) as PageSourceItem;\n }\n // If we find a source list-item in localstorage less than 10 seconds old we assume that's where the user is coming from.\n if (lsItem && now - lsItem.timestamp < 10 * 1000) {\n return lsItem.listType;\n }\n }\n return undefined;\n};\n","import { ShopifyProductWithVariant } from \"../../@types/shopifyProductWithVariant\";\nimport { getShopifyProductsFromHref } from \"../helperFunctions\";\nimport { DataLayerItem, clearDataLayer, getDataLayerItem } from \"./common\";\n\ninterface BeginCheckoutEvent {\n event: string;\n ecommerce: {\n currency: string;\n totalValue: number;\n items: DataLayerItem[];\n };\n}\n\nconst EVENT_NAME = \"begin_checkout\";\n\nexport const pushDataLayerBeginCheckout = (\n shopifyProducts: ShopifyProductWithVariant[]\n) => {\n if (typeof window !== \"undefined\" && window.dataLayer) {\n clearDataLayer();\n window.dataLayer.push(getDataLayerEvent(shopifyProducts));\n }\n};\n\nfunction getDataLayerEvent(\n shopifyProducts: ShopifyProductWithVariant[]\n): BeginCheckoutEvent {\n const obj = {\n event: EVENT_NAME,\n ecommerce: {\n currency: shopifyProducts[0]?.minPrice.currencyCode,\n totalValue: shopifyProducts.reduce(\n (prev, curr) =>\n prev +\n (curr.hasOwnProperty(\"price\") && curr.price !== undefined\n ? parseFloat(curr.price.amount)\n : parseFloat(curr.minPrice.amount)),\n 0\n ),\n items: shopifyProducts.map((shopifyProduct) =>\n getDataLayerItem(shopifyProduct)\n ),\n },\n };\n return obj;\n}\n\n/**\n * Temporary solution to write checkout events for direct checkout links\n *\n * @param href link in the form of https://shop.hellohealth.de/cart/44765250421001:1,44497963614473:1,44497855578377:1,44337835639049:1?discount=DCFLCK30\n */\nexport const pushDataLayerBeginCheckoutFromString = (href: string) => {\n if (typeof window !== \"undefined\" && window.dataLayer) {\n clearDataLayer();\n\n const items = getShopifyProductsFromHref(href);\n const dataLayerEvent = {\n event: EVENT_NAME,\n ecommerce: {\n currency: \"EUR\",\n totalValue: items.reduce(\n (prev, curr) => prev + parseFloat(curr.price.amount),\n 0\n ),\n items,\n },\n };\n window.dataLayer.push(dataLayerEvent);\n }\n};\n\nexport const pushDataLayerBeginCheckoutFromProductId = (\n items: DataLayerItem[],\n totalValue: number\n) => {\n if (typeof window !== \"undefined\" && window.dataLayer) {\n clearDataLayer();\n\n const dataLayerEvent = {\n event: EVENT_NAME,\n ecommerce: {\n currency: \"EUR\",\n totalValue,\n items,\n },\n };\n window.dataLayer.push(dataLayerEvent);\n }\n};\n","import {\n ShopifyProductWithVariant,\n ShopifyProductWithVariantPrice,\n} from \"../../@types/shopifyProductWithVariant\";\n\nexport interface DataLayerItem {\n item_id: string;\n item_name: string;\n item_variant: string;\n discount: number;\n price: ShopifyProductWithVariantPrice;\n}\n\nexport function clearDataLayer() {\n if (typeof window !== \"undefined\" && window.dataLayer) {\n window.dataLayer.push({ ecommerce: null });\n }\n}\n\nexport function getDataLayerItem(\n shopifyProduct: ShopifyProductWithVariant\n): DataLayerItem {\n const minPrice = shopifyProduct?.minPrice;\n const price = shopifyProduct.price\n ? shopifyProduct.price.amount\n : minPrice.amount;\n const matched = /[^/]*$/.exec(shopifyProduct?.id);\n const productTitle = shopifyProduct?.title;\n const id = matched ? matched[0] : \"\";\n return {\n item_id: id,\n item_name: productTitle,\n item_variant: shopifyProduct?.variantTitle,\n discount: 0,\n price,\n };\n}\n","import { ShopifyProductWithVariant } from \"../../@types/shopifyProductWithVariant\";\nimport { DataLayerItem, clearDataLayer, getDataLayerItem } from \"./common\";\n\nexport interface CourseListType {\n id: number;\n name: string;\n}\n\nconst homepageList: CourseListType = { id: 0, name: \"Homepage\" };\nconst headerList: CourseListType = { id: 1, name: \"Header\" };\nconst courseOverviewList: CourseListType = { id: 2, name: \"CourseOverview\" };\nconst otherPageList: CourseListType = { id: 3, name: \"Other\" };\n\nexport const COURSE_LISTS = {\n HOMEPAGE: homepageList,\n HEADER: headerList,\n COURSE_OVERVIEW: courseOverviewList,\n OTHER: otherPageList,\n};\n\nexport interface SelectItemEvent {\n event: string;\n ecommerce: {\n item_list_id: number;\n item_list_name: string;\n currency: string;\n totalValue: number;\n items: DataLayerItem[];\n };\n}\n\nconst EVENT_NAME = \"select_item\";\n\nconst pushDataLayerSelectItem = (\n sourceItemList: CourseListType,\n shopifyProduct: ShopifyProductWithVariant\n) => {\n if (typeof window !== \"undefined\" && window.dataLayer) {\n clearDataLayer();\n window.dataLayer.push(getDataLayerEvent(sourceItemList, shopifyProduct));\n }\n};\n\nfunction getDataLayerEvent(\n sourceItemList: CourseListType,\n shopifyProduct: ShopifyProductWithVariant\n): SelectItemEvent {\n return {\n event: EVENT_NAME,\n ecommerce: {\n item_list_id: sourceItemList.id,\n item_list_name: sourceItemList.name,\n currency: shopifyProduct?.minPrice.currencyCode,\n totalValue: shopifyProduct?.price.amount,\n items: [getDataLayerItem(shopifyProduct)],\n },\n };\n}\n\nexport default pushDataLayerSelectItem;\n"],"names":["window","__NEXT_P","push","__webpack_require__","__webpack_exports__","Z","react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__","jsx","Head","link","rel","href","type","sizes","getLinkProps","externalLink","internalLink","target","label","logo","anchorLink","discount","shopifyProductFields","pageType","sys","contentType","id","fields","internal","replace","createCheckoutApiURL","getVariantIdsToCheckout","undefined","slug","isRecipe","getHrefByPageTypeAndSlug","linkTarget","page","param","contentSections","seoMetadata","tenant","title","metatags","prepareMetadata","metadata","og","twitter","ogMetadata","twitterMetadata","robots","noIndex","noFollow","metatag","description","keywords","join","ogTitle","ogDescription","ogType","ogImage","image","twitterCard","card","twitterTitle","twitterDescription","twitterImage","recipeSection","find","section","recipeTitle","generateTitle","jsxs","Fragment","meta","name","content","property","SharedHead","Container","className","maxWidth","style","minHeight","display","flexWrap","flexDirection","justifyContent","main","flex","overflow","filter","map","i","ContentSectionWrapper","isPrintView","concat","formatPrice","amount","currencyCode","Intl","NumberFormat","currency","format","formatContentfulDate","date","dateObj","Date","getMonthName","getDate","getMonth","getFullYear","withHttps","url","prefixed","test","lowerCaseType","toLowerCase","slice","getShopifyProductsFromHref","productInfos","item_id","item_name","item_variant","price","checkoutProducts","trim","startsWith","productStrings","split","forEach","itemId","splitString","hasOwnProperty","parseInt","getShopifyProductsWithExtras","product","shopifyProduct","extraShopifyProduct","extraShopifyProduct2","getIdFromString","internalName","saveCoursepageSource","dataLayer","item","timestamp","now","listType","courseList","localStorage","setItem","JSON","stringify","EVENT_NAME","pushDataLayerBeginCheckout","clearDataLayer","getDataLayerEvent","shopifyProducts","obj","event","ecommerce","minPrice","totalValue","reduce","prev","curr","parseFloat","items","getDataLayerItem","pushDataLayerBeginCheckoutFromString","dataLayerEvent","pushDataLayerBeginCheckoutFromProductId","matched","exec","productTitle","variantTitle","COURSE_LISTS","HOMEPAGE","HEADER","COURSE_OVERVIEW","OTHER"],"sourceRoot":""}