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IAIZH,GAAQ,gBACJqB,OAAI,CAACR,UAAWM,G,gBACZI,SAAM,CACHV,UAAY,GAAY,OAAVJ,EAAU,sCACxBe,KAAK,SACLC,QAhFK,WACzBC,EAAAA,GAAmB,CAAEC,KAAM3B,EAAU4B,cAAe,eAiF/B5B,IAIZM,GAAU,gBACNe,OAAI,CAACR,UAAWO,G,gBACZG,SAAM,CACHV,UAAY,GAAY,OAAVJ,EAAU,4DACxBe,KAAK,SACLC,QAxFA,WACpBC,EAAAA,GAAmB,CAAEC,KAAMrB,EAAYsB,cAAe,UAyFjCtB,MAS7B,M,SA7IuB5B,GACnB,IAAM+B,EAAY,kBAElB,OAAM,gBACDM,MAAG,CAACF,UAAU,kB,gBACVE,MAAG,CAACF,UAAWJ,G,gBACXM,MAAG,CAACF,UAAY,GAAY,OAAVJ,EAAU,aACxB/B,EAAMmD,WAAW5C,KAAI,SAAC6C,EAAWC,GAC9B,OAAM,gBAALlC,EAAiB,GACdmC,IAAKD,EACLnC,MAAOA,EAAMlB,EAAMmD,WAAWI,OAAS,IACnCH,W,gNCtChC,IAEA,EAF0BpD,SAAAA,GAAS,OAAM,gBAALwD,EAAa,KAAKxD","sources":["webpack://gyldendal-uddannelse/./src/Foundation/Frontend/ReactComponents/Shared/ResponsiveImage/responsive-image.tsx","webpack://gyldendal-uddannelse/./src/Foundation/Frontend/ReactComponents/ImageSpotList/image-spot-list.tsx","webpack://gyldendal-uddannelse/./src/Foundation/Frontend/ReactViews/ImageSpotList/image-spot-list-view.js"],"sourcesContent":["import React from \"react\";\r\n\r\nconst hasExistingQueryParam = (url: string) => url.indexOf(\"?\") > -1;\r\n\r\nconst getQueryParamDelimiter = (url: string) => (hasExistingQueryParam(url) ? \"&\" : \"?\");\r\n\r\nconst generateSrcSet = (srcSetSizes: number[], srcUrl: string) => {\r\n const generateSrcSetString = (srcSetSize: number) => {\r\n const parameterDelimiter = getQueryParamDelimiter(srcUrl);\r\n const srcSetSizeHighDensity = Math.round(srcSetSize * 1.5);\r\n\r\n return `\r\n ${srcUrl}${parameterDelimiter}w=${srcSetSize} ${srcSetSize}w,\r\n ${srcUrl}${parameterDelimiter}w=${srcSetSizeHighDensity} ${srcSetSizeHighDensity}w\r\n `;\r\n };\r\n\r\n return srcSetSizes.map(generateSrcSetString).join(\", \");\r\n};\r\n\r\ninterface ResponsiveImageProps\r\n extends React.DetailedHTMLProps, HTMLImageElement> {\r\n srcUrl: string;\r\n defaultSize: number;\r\n srcSetSizes: number[];\r\n}\r\n\r\nconst ResponsiveImage = (props: ResponsiveImageProps) => {\r\n const { srcUrl, defaultSize, srcSetSizes, ...rest } = props;\r\n const src = `${srcUrl}${getQueryParamDelimiter(srcUrl)}w=${defaultSize}`;\r\n const srcSet = srcSetSizes ? generateSrcSet(srcSetSizes, srcUrl) : \"\";\r\n\r\n return {props.alt};\r\n};\r\n\r\nexport default ResponsiveImage;\r\n","import classNames from \"classnames\";\r\nimport React, { useMemo } from \"react\";\r\nimport ResponsiveImage from \"ReactComponents/Shared/ResponsiveImage/responsive-image\";\r\nimport * as tracking from \"ReactComponents/Shared/Utils/tracking\";\r\n\r\nexport interface IImageSpotListItem {\r\n SpotText: string;\r\n ImageUrl: string;\r\n SpotTextColor: string;\r\n Url?: string;\r\n ButtonText?: string;\r\n HeaderText?: string;\r\n HeaderTextColor?: string;\r\n HeaderBackgroundColor?: string;\r\n ButtonTextColor?: string;\r\n ButtonAlignment?: string;\r\n SpotTextAlignment?: string;\r\n}\r\n\r\nexport interface IImageSpotListProps {\r\n Title: string;\r\n ImageSpots: IImageSpotListItem[];\r\n}\r\n\r\nconst sizes = [\r\n \"(min-width: 1750px) 1390px, (min-width: 1240px) calc(100vw - 350px), (min-width: 640px) calc(100vw - 50px), calc(100vw - 20px)\",\r\n \"(min-width: 1750px) 687px, (min-width: 1240px) calc((100vw - 366px) / 2), (min-width: 640px) calc((100vw - 66px) / 2), calc(100vw - 20px)\",\r\n \"(min-width: 1750px) 452px, (min-width: 1240px) calc((100vw - 372px) / 3), (min-width: 640px) calc((100vw - 72px) / 3), calc(100vw - 20px)\"\r\n] as const;\r\n\r\nfunction ImageSpotList(props: IImageSpotListProps) {\r\n const baseClass = \"image-spot-list\";\r\n\r\n return (\r\n
\r\n
\r\n
\r\n {props.ImageSpots.map((imageSpot, index) => (\r\n \r\n ))}\r\n
\r\n
\r\n
\r\n );\r\n}\r\n\r\nfunction ImageSpotListItem({\r\n Url,\r\n ImageUrl,\r\n sizes,\r\n SpotText,\r\n SpotTextColor,\r\n SpotTextAlignment,\r\n HeaderText,\r\n HeaderTextColor,\r\n HeaderBackgroundColor,\r\n ButtonText,\r\n ButtonTextColor,\r\n ButtonAlignment\r\n}: IImageSpotListItem & { sizes: string }) {\r\n const baseClass = \"image-spot-list\";\r\n\r\n const topBannerClickHandler = () => {\r\n tracking.heroClick({ text: HeaderText, componentName: \"topBanner\" });\r\n };\r\n const spotTextClickHandler = () => {\r\n tracking.heroClick({ text: SpotText, componentName: \"spotText\" });\r\n };\r\n const ctaClickHandler = () => {\r\n tracking.heroClick({ text: ButtonText, componentName: \"CTA\" });\r\n };\r\n\r\n const Wrapper = Url\r\n ? (\r\n props: JSX.IntrinsicAttributes &\r\n React.ClassAttributes &\r\n React.AnchorHTMLAttributes\r\n ) => (\r\n \r\n {props.children}\r\n \r\n )\r\n : (\r\n props: JSX.IntrinsicAttributes &\r\n React.ClassAttributes &\r\n React.HTMLAttributes\r\n ) => (\r\n
\r\n {props.children}\r\n
\r\n );\r\n\r\n const headerClasses = useMemo(() => {\r\n return classNames(`${baseClass}__image-spot-header-container`, {\r\n [`${HeaderTextColor}--text`]: HeaderTextColor,\r\n [`${HeaderBackgroundColor}--bg`]: HeaderBackgroundColor\r\n });\r\n }, [HeaderTextColor, HeaderBackgroundColor]);\r\n\r\n const spotClasses = useMemo(() => {\r\n return classNames(`${baseClass}__image-spot-text-container`, SpotTextAlignment, {\r\n [`${SpotTextColor}--text`]: SpotTextColor\r\n });\r\n }, [SpotTextAlignment, SpotTextColor]);\r\n\r\n const buttonClasses = useMemo(() => {\r\n return classNames(`${baseClass}__image-spot-button-container`, ButtonAlignment, {\r\n [`${ButtonTextColor}--text`]: ButtonTextColor\r\n });\r\n }, [ButtonAlignment, ButtonTextColor]);\r\n\r\n return (\r\n \r\n \r\n {ImageUrl && (\r\n \r\n \r\n \r\n )}\r\n {HeaderText && (\r\n \r\n \r\n {HeaderText}\r\n \r\n \r\n )}\r\n {SpotText && (\r\n \r\n \r\n {SpotText}\r\n \r\n \r\n )}\r\n {ButtonText && (\r\n \r\n \r\n {ButtonText}\r\n \r\n \r\n )}\r\n \r\n \r\n );\r\n}\r\n\r\nexport default ImageSpotList;\r\n","import * as React from \"react\";\r\nimport ImageSpotList from \"../../ReactComponents/ImageSpotList/image-spot-list\";\r\n\r\nconst ImageSpotListView = props => ;\r\n\r\nexport default ImageSpotListView;\r\n"],"names":["getQueryParamDelimiter","url","indexOf","hasExistingQueryParam","props","srcUrl","defaultSize","srcSetSizes","rest","src","srcSet","map","srcSetSize","parameterDelimiter","srcSetSizeHighDensity","Math","round","join","generateSrcSet","img","loading","alt","sizes","ImageSpotListItem","Url","ImageUrl","SpotText","SpotTextColor","SpotTextAlignment","HeaderText","HeaderTextColor","HeaderBackgroundColor","ButtonText","ButtonTextColor","ButtonAlignment","baseClass","Wrapper","a","href","className","children","div","headerClasses","useMemo","classNames","spotClasses","buttonClasses","span","ResponsiveImage","button","type","onClick","tracking","text","componentName","ImageSpots","imageSpot","index","key","length","ImageSpotList"],"sourceRoot":""}