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aC,IAAIE,wBAAwBJ,IAG1D,IAAUC,aAAaC,IAAIE,oBAAoB,EAG7CC,EAAoB,CAC7BC,EACAC,KAGID,aAAW,EAAXA,EACMlH,KAAK2F,IAAK,MAAC,OAAa,QAAb,EAAAA,EAAEC,mBAAW,eAAEC,QAAQ,IACnClG,OAAOyH,SACPzH,OAAOwH,KAAc,GAYrBE,EAAoB,CAC7BC,EACAC,KAEQD,aAAQ,EAARA,EAAU3H,QAAQC,GAASA,EAAK2H,YAAYxF,SAASwF,OAAyB,GAM7EC,EAAgB,IAC0C,SAAnE,IAAI5F,gBAAgBT,OAAOC,SAASL,QAAQ0G,IAAI,eAIvCC,EAAsB3I,IAC/B,MAAMkC,EAAelC,EAAKkC,eAAgB,QAAoBlC,EAAKkC,cAEnE,MAAO,CACHV,MAAOxB,EAAK6D,UACZlE,KAAM,CACFG,UAAWoC,GAEfrC,KAAM,CACF+I,YAAa5I,EAAK6I,gBAClB,SAAU3G,EACV,iBAAkBlC,EAAK6I,iBAE9B,EAGQC,EAAyB9I,GAC3B,oBAAsBA,C","sources":["webpack:///./src/microApps/common/components/atoms/PageHead/PageHead.tsx","webpack:///./src/microApps/common/components/molecules/PageProperties/PageProperties.utils.ts","webpack:///./src/microApps/common/components/molecules/PageProperties/PageProperties.hooks.ts","webpack:///./src/microApps/common/components/molecules/PageProperties/PageProperties.tsx","webpack:///./src/microApps/common/hooks/useDocumentHeadIsPreparedForReactHelmet.ts","webpack:///./src/microApps/common/hooks/useSavedInRef.ts","webpack:///./src/microApps/common/utils/metaUtils.ts","webpack:///./src/microApps/episerver/components/base/EpiContentArea.tsx","webpack:///./src/microApps/ecommerce/components/pages/ecommercePage/EcommercePage.tsx","webpack:///./src/microApps/episerver/components/pages/EpiEcommercePage/EpiEcommercePage.tsx","webpack:///./src/microApps/episerver/epiUtils.ts"],"sourcesContent":["import type { FC } from 'react';\nimport Helmet from 'react-helmet';\n\nimport { isProductionEnvironment } from '../../../../../utility/environments';\nimport useDocumentHeadIsPreparedForReactHelmet from '../../../hooks/useDocumentHeadIsPreparedForReactHelmet';\nimport { getCanonical, getNextPage, getPrevPage } from '../../../utils/metaUtils';\nimport type { PageHeadData, PageHeadPagination } from './PageHead.types';\n\ninterface PageHeadProps {\n    data: PageHeadData;\n    pagination?: PageHeadPagination;\n}\n\nconst PageHead: FC<React.PropsWithChildren<PageHeadProps>> = (props) => {\n    const link = { ...props.data.link };\n    const meta = { ...props.data.meta };\n\n    if (link && link.canonical) {\n        link.canonical = getCanonical({\n            path: link.canonical,\n            page: props.pagination?.currentPage,\n        });\n    }\n\n    let hasPrevPage = false;\n    let hasNextPage = false;\n\n    if (props.pagination) {\n        hasPrevPage = props.pagination.currentPage !== 1;\n        if (props.pagination.totalItems) {\n            hasNextPage =\n                props.pagination.pageSize * props.pagination.currentPage <=\n                props.pagination.totalItems;\n        }\n    }\n\n    if (hasPrevPage && link && props.pagination) {\n        link.prevPage = getPrevPage(props.pagination.currentPage);\n    }\n\n    if (hasNextPage && link && props.pagination) {\n        link.nextPage = getNextPage(props.pagination.currentPage);\n    }\n\n    const linkData =\n        link &&\n        Object.entries(link).filter(\n            (item) => item[1] !== '' && item[1] !== undefined && item[1] !== null,\n        );\n\n    const metaData =\n        meta &&\n        Object.entries(meta).filter(\n            (item) => item[1] !== '' && item[1] !== undefined && item[1] !== null,\n        );\n\n    let options: Parameters<typeof useDocumentHeadIsPreparedForReactHelmet>[0] = {\n        link: linkData?.map(([key]) => ({ property: 'rel', value: key })),\n    };\n\n    if (metaData) {\n        options = {\n            ...options,\n            meta: metaData.map(([key]) => ({ property: 'name', value: key })),\n        };\n    }\n\n    const isDocumentHeadReadyForReactHelmet = useDocumentHeadIsPreparedForReactHelmet(options);\n\n    return (\n        // eslint-disable-next-line react/jsx-no-useless-fragment\n        <>\n            {isDocumentHeadReadyForReactHelmet && (\n                <Helmet>\n                    {props.data.title && (\n                        <title>\n                            {props.data.title +\n                                (!isProductionEnvironment ? ' - NOT FOR COMMERCIAL USE' : '')}\n                        </title>\n                    )}\n                    {metaData?.map(([property, value]) => (\n                        <meta key={property} name={property} content={value} />\n                    ))}\n\n                    {linkData?.map(([property, value]) => (\n                        <link key={property} rel={property} href={value} />\n                    ))}\n\n                    {props.children}\n                </Helmet>\n            )}\n        </>\n    );\n};\n\nexport default PageHead;\n","const defaultQueryKeys = ['page'];\n\n/**\n * Filter current query string to only contain certain keys that are relevant for GA's virtual page view\n * @param queryString The complete query string of a location\n * @param keys List of allowed query string keys\n */\nexport const getFilteredQueryStringForVirtualPageView = (\n    queryString: string,\n    keys: string[] = [],\n) => {\n    const triggerKeys = [...defaultQueryKeys, ...keys];\n\n    const searchParams = new URLSearchParams(queryString);\n\n    const filteredSearchParams = Array.from(searchParams.entries())\n        .filter(([key]) => triggerKeys.includes(key))\n        .reduce((acc, [key, value]) => {\n            acc.set(key, value.toString());\n            return acc;\n        }, new URLSearchParams());\n\n    return filteredSearchParams.toString();\n};\n","import { useEffect } from 'react';\nimport { useLocation } from 'react-router-dom';\n\nimport { useSavedInRef } from '../../../hooks/useSavedInRef';\nimport { useAppDispatch } from '../../../hooks/useThunkDispatch';\nimport { currentPageActions } from '../../../store/slices/currentPage/currentPageSlice';\nimport { getFilteredQueryStringForVirtualPageView } from './PageProperties.utils';\n\ninterface GaVirtualPageParams {\n    pageTitle: string;\n    canonicalUrl?: string;\n    pageTypeName?: string;\n    /**\n     * Used to specify what key must have been changed in URL's query string to trigger Virtual Page View\n     * By defualt, pagination's \"page\" is always a trigger, rest of the triggers are set on page-to-page basis\n     */\n    queryStringTriggers?: string[];\n}\n\nexport const useGaVirtualPageView = (options?: GaVirtualPageParams) => {\n    const { search } = useLocation();\n    const dispatch = useAppDispatch();\n\n    const canonicalUrl =\n        options &&\n        options.canonicalUrl &&\n        new URL(options.canonicalUrl, window.location.origin).toString();\n\n    // used only in dependency array to trigger effect\n    const triggerString = getFilteredQueryStringForVirtualPageView(\n        search,\n        (options && options.queryStringTriggers) || [],\n    );\n\n    const enable = !!options;\n\n    const sendEvent = useSavedInRef(() => {\n        if (canonicalUrl) {\n            dispatch(\n                currentPageActions.setPageGaData({\n                    canonicalUrl,\n                    gaPageTypeName: options && options.pageTypeName,\n                    title: options && options.pageTitle,\n                    queryString: window.location.search,\n                }),\n            );\n        }\n    });\n\n    useEffect(() => {\n        if (enable && canonicalUrl) {\n            sendEvent.current();\n        }\n    }, [dispatch, enable, canonicalUrl, triggerString, sendEvent]);\n\n    return {\n        sendEvent,\n    };\n};\n","import { type FC, useEffect } from 'react';\n\nimport { useAppDispatch } from '../../../hooks/useThunkDispatch';\nimport { currentPageActions } from '../../../store/slices/currentPage/currentPageSlice';\nimport type { PageHeadData, PageHeadPagination } from '../../atoms/PageHead';\nimport PageHead from '../../atoms/PageHead';\nimport { useGaVirtualPageView } from './PageProperties.hooks';\n\ninterface PagePropertiesProps {\n    headData: PageHeadData;\n    headPagination?: PageHeadPagination;\n    pageTypeNameForAnalytics?: string;\n\n    /** @see useGaVirtualPageView comments */\n    virtualPageViewQueryStringTriggers?: string[];\n}\n\nconst PageProperties: FC<React.PropsWithChildren<PagePropertiesProps>> = (props) => {\n    useGaVirtualPageView({\n        canonicalUrl: props.headData.link?.canonical,\n        pageTitle: props.headData.title,\n        pageTypeName: props.pageTypeNameForAnalytics,\n        queryStringTriggers: props.virtualPageViewQueryStringTriggers,\n    });\n\n    const dispatch = useAppDispatch();\n    useEffect(() => {\n        dispatch(currentPageActions.setTitle(props.headData.title));\n    }, [dispatch, props.headData.title]);\n\n    return <PageHead data={props.headData} pagination={props.headPagination} />;\n};\n\nexport default PageProperties;\n","import { useEffect, useState } from 'react';\n\ninterface ElementsToUpdate {\n    [tag: string]: { property: string; value: string }[];\n}\n\n/**\n * React helmet only handles elements inside the head tag that contain data-react-helmet=\"true\"\n */\nconst useDocumentHeadIsPreparedForReactHelmet = (elementsToUpdateByTag: ElementsToUpdate) => {\n    const [readyForReactHelmet, setReadyForReactHelmet] = useState(false);\n\n    const stringifiedElements = JSON.stringify(elementsToUpdateByTag);\n\n    useEffect(() => {\n        const parsedElementsToUpdateByTag = JSON.parse(stringifiedElements) as ElementsToUpdate;\n        if (parsedElementsToUpdateByTag) {\n            const childrenOfHead = Array.from(document.getElementsByTagName('head')[0].children);\n\n            childrenOfHead.forEach((child) => {\n                const tagName = child?.tagName?.toLowerCase();\n\n                parsedElementsToUpdateByTag[tagName]?.forEach((tagEl) => {\n                    if (child.getAttribute(tagEl.property) === tagEl.value) {\n                        child.setAttribute('data-react-helmet', 'true');\n                    }\n                });\n            });\n\n            setReadyForReactHelmet(true);\n        }\n    }, [stringifiedElements]);\n\n    return readyForReactHelmet;\n};\n\nexport default useDocumentHeadIsPreparedForReactHelmet;\n","import { useLayoutEffect, useRef } from 'react';\n\nexport const useSavedInRef = <T>(value: T) => {\n    const ref = useRef<T>(value);\n\n    useLayoutEffect(() => {\n        ref.current = value;\n    });\n\n    return ref;\n};\n","import { addQueryParamsToUrl } from './urlUtils';\n\nexport const getRobotsContent = (noIndex?: boolean, noFollow?: boolean) => {\n    if (noIndex && noFollow) {\n        return 'NOINDEX,NOFOLLOW';\n    }\n\n    if (noIndex) {\n        return 'NOINDEX';\n    }\n\n    if (noFollow) {\n        return 'NOFOLLOW';\n    }\n\n    return undefined;\n};\n\nexport const getCanonical = ({ path, page }: { path: string; page?: number }) => {\n    const url = new URL(path, window.location.origin).toString();\n\n    return Number.isInteger(page) && page !== 1\n        ? addQueryParamsToUrl(url, { page: String(page) })\n        : url;\n};\n\nexport const getNextPage = (currentPage: number) => {\n    const searchParams = new URLSearchParams();\n    searchParams.set('page', (currentPage + 1).toString());\n\n    const newUrl = `${\n        window.location.origin + window.location.pathname\n    }?${searchParams.toString()}`;\n\n    return newUrl;\n};\n\nexport const getPrevPage = (currentPage: number) => {\n    const searchParams = new URLSearchParams();\n    const prevPage = currentPage - 1;\n    if (prevPage > 1) {\n        searchParams.set('page', prevPage.toString());\n    } else {\n        searchParams.delete('page');\n    }\n    const stringifiedParams = searchParams.toString();\n\n    const newUrl =\n        window.location.origin +\n        window.location.pathname +\n        (stringifiedParams ? `?${searchParams.toString()}` : '');\n\n    return newUrl;\n};\n","/* eslint-disable react/no-array-index-key */\n/* eslint-disable react/jsx-props-no-spreading */\n/* eslint-disable react/jsx-no-useless-fragment */\nimport classNames from 'classnames';\n\nimport { getCssClassForDisplayOptionWithDefaultTag } from '../../epiUtils';\nimport EpiComponentLoader from './EpiComponentLoader';\n\ninterface EpiContentAreaProps {\n    items: ContentAreaItem[];\n    epiTag?: DisplayOption;\n    itemCssClass?: string;\n    /** If you pass renderItem function, you are responsible for generating item itself as well as it's Grid cell.\n     * Use contentAreaItem, contentAreaItemClasses parameters to get access to default values for items.\n     */\n    renderItem?: (\n        componentProps: IContent,\n        contentAreaItem: ContentAreaItem,\n        contentAreaItemClasses: string,\n    ) => React.ReactNode;\n}\n\nconst EpiContentArea = ({ items, epiTag, itemCssClass, renderItem }: EpiContentAreaProps) => {\n    const areaItems = items?.filter((x) => !!x && !!x.contentLink.expanded) || [];\n\n    return (\n        <>\n            {areaItems.map((contentAreaItem, index) => (\n                <EpiComponentLoader\n                    expandedValue={contentAreaItem.contentLink.expanded!}\n                    options={{\n                        isContentAreaItem: true,\n                    }}\n                    key={`{${contentAreaItem.contentLink.guidValue}_${index}}`}\n                >\n                    {(LazyComponent, epiComponentProps) => {\n                        const contentAreaItemClasses = classNames(\n                            getCssClassForDisplayOptionWithDefaultTag(\n                                contentAreaItem.displayOption || epiTag,\n                            ),\n                            itemCssClass,\n                        );\n\n                        return (\n                            <>\n                                {(renderItem &&\n                                    renderItem(\n                                        epiComponentProps,\n                                        contentAreaItem,\n                                        contentAreaItemClasses,\n                                    )) || (\n                                    <div className={contentAreaItemClasses}>\n                                        <LazyComponent {...epiComponentProps} />\n                                    </div>\n                                )}\n                            </>\n                        );\n                    }}\n                </EpiComponentLoader>\n            ))}\n        </>\n    );\n};\n\nexport default EpiContentArea;\n","import type { FC } from 'react';\n\nimport PageProperties from '../../../../common/components/molecules/PageProperties';\nimport type { PageBaseProps } from '../../../../common/models/props/PageBaseProps';\nimport EpiContentArea from '../../../../episerver/components/base/EpiContentArea';\n\ninterface EcommercePageProps extends PageBaseProps {\n    blocks: ContentAreaItem[];\n}\n\nconst EcommercePage: FC<React.PropsWithChildren<EcommercePageProps>> = (props) => {\n    return (\n        <>\n            <PageProperties\n                headData={props.headData}\n                pageTypeNameForAnalytics={props.pageTypeNameForAnalytics}\n            />\n            <div className=\"Grid Grid--gutterV Grid--gutterH2xsm\">\n                <EpiContentArea items={props.blocks} />\n            </div>\n        </>\n    );\n};\n\nexport default EcommercePage;\n","import type { FC } from 'react';\n\nimport EcommercePage from '../../../../ecommerce/components/pages/ecommercePage/EcommercePage';\nimport { mapEpiPageHeadData } from '../../../epiUtils';\nimport type { EpiEcommercePageType } from './epiEcommercePageType';\n\nconst EpiEcommercePage: FC<React.PropsWithChildren<EpiEcommercePageType>> = (props) => {\n    return (\n        <EcommercePage\n            blocks={props.blocks}\n            headData={mapEpiPageHeadData(props)}\n            pageTypeNameForAnalytics={props.pageTypeNameForAnalytics}\n        />\n    );\n};\n\nexport default EpiEcommercePage;\n","import { appConfig } from '../../appConfig';\nimport type { PageHeadData } from '../common/components/atoms/PageHead';\nimport { ensureTrailingSlash } from '../common/utils/urlUtils';\nimport type { EpiPageTypes } from './components/pages/epiPageTypes';\nimport type { EpiSitePageType } from './components/pages/epiSitePageType';\n\nexport const getCssClassForDisplayOptionWithDefaultTag = (name: DisplayOption) => {\n    const potentialCssClass = appConfig.coopSettings.epi.blockDisplayOptionToCssClass[name];\n\n    if (potentialCssClass) {\n        return `${appConfig.coopSettings.epi.baseChildrenCssClass} ${potentialCssClass}`;\n    }\n\n    return appConfig.coopSettings.epi.baseChildrenCssClass;\n};\n\nexport const filterContentArea = <T extends IContent>(\n    contentArea: ContentAreaItem[],\n    predicate: (content: IContent) => content is T,\n): T[] => {\n    const contents =\n        contentArea\n            ?.map((x) => x.contentLink?.expanded)\n            .filter(Boolean)\n            .filter(predicate) || [];\n    return contents;\n};\n\nexport const filterContent = <T extends IContent>(\n    contentItems: IContent[],\n    predicate: (content: IContent) => content is T,\n): T[] => {\n    const filteredContents = contentItems?.filter(predicate) || [];\n    return filteredContents;\n};\n\nexport const filterContentType = <T extends EpiPageTypes[keyof EpiPageTypes]>(\n    contents: IContent[],\n    contentType: keyof EpiPageTypes,\n): T[] => {\n    return (contents?.filter((item) => item.contentType.includes(contentType)) as T[]) || [];\n};\n\n/**\n * Use with caution, EPI adds ?epieditmode=True in edit mode, but so can users\n */\nexport const isEpiEditMode = () =>\n    new URLSearchParams(window.location.search).get('epieditmode') === 'True';\n\nexport const editTableProp = (name: string) => (window.epi?.inEditMode ? name : undefined);\n\nexport const mapEpiPageHeadData = (page: EpiSitePageType): PageHeadData => {\n    const canonicalUrl = page.canonicalUrl && ensureTrailingSlash(page.canonicalUrl);\n\n    return {\n        title: page.pageTitle,\n        link: {\n            canonical: canonicalUrl,\n        },\n        meta: {\n            description: page.metaDescription,\n            'og:url': canonicalUrl,\n            'og:description': page.metaDescription,\n        },\n    };\n};\n\nexport const isEpiPageViewSettings = (page: IContent): page is PageViewSettingsIContent => {\n    return 'contentPageSize' in (page as PageViewSettingsIContent);\n};\n\nexport const isContentReference = (input: unknown): input is ContentReference => {\n    return 'url' in (input as ContentReference);\n};\n"],"names":["props","link","data","meta","canonical","path","page","pagination","currentPage","hasPrevPage","hasNextPage","totalItems","pageSize","prevPage","nextPage","linkData","Object","entries","filter","item","undefined","metaData","options","map","key","property","value","isDocumentHeadReadyForReactHelmet","useDocumentHeadIsPreparedForReactHelmet","Helmet","title","name","content","rel","href","children","defaultQueryKeys","useGaVirtualPageView","search","dispatch","canonicalUrl","URL","window","location","origin","toString","triggerString","queryString","keys","triggerKeys","searchParams","URLSearchParams","Array","from","includes","reduce","acc","set","getFilteredQueryStringForVirtualPageView","queryStringTriggers","enable","sendEvent","useSavedInRef","c","setPageGaData","gaPageTypeName","pageTypeName","pageTitle","useEffect","current","headData","pageTypeNameForAnalytics","virtualPageViewQueryStringTriggers","setTitle","headPagination","elementsToUpdateByTag","readyForReactHelmet","setReadyForReactHelmet","useState","stringifiedElements","JSON","stringify","parsedElementsToUpdateByTag","parse","document","getElementsByTagName","forEach","child","tagName","toLowerCase","tagEl","getAttribute","setAttribute","ref","useRef","useLayoutEffect","getRobotsContent","noIndex","noFollow","getCanonical","url","Number","isInteger","String","getNextPage","pathname","getPrevPage","delete","stringifiedParams","items","epiTag","itemCssClass","renderItem","areaItems","x","contentLink","expanded","contentAreaItem","index","expandedValue","isContentAreaItem","LazyComponent","epiComponentProps","contentAreaItemClasses","displayOption","className","guidValue","PageProperties","EpiContentArea","blocks","getCssClassForDisplayOptionWithDefaultTag","potentialCssClass","coopSettings","epi","blockDisplayOptionToCssClass","baseChildrenCssClass","filterContentArea","contentArea","predicate","Boolean","filterContentType","contents","contentType","isEpiEditMode","get","mapEpiPageHeadData","description","metaDescription","isEpiPageViewSettings"],"sourceRoot":""}