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,OAAM,gBACDC,IAAC,CACEC,KAAMH,EAAKI,IACXC,OAAQL,EAAKM,OACbV,UAAWC,GAAAA,CAAW,2BAA4B,CAC9C,gCACkB,eAAbJ,IACc,IAAVQ,GAAeA,IAAUT,EAAWe,OAAS,IACpC,eAAbd,IAAwC,IAAVQ,GAAyB,IAAVA,KAEtDO,IAAM,GAAUP,OAARD,EAAK,KAAS,OAANC,I,gBAEfQ,EAAAA,EAAe,CACZhC,KAAMuB,EAAKN,OAASM,EAAKU,QAAU,eAAiB,GACpDd,UAAU,iCACVL,IAAMS,EAAKN,OAAUM,EAAKU,QAA8B,GAApBV,EAAKW,aACzCpC,YAAa,IACbD,OAAQ0B,EAAKY,SACbpC,YAAa,CAAC,IAAK,IAAK,IAAK,KAC7BqC,MAAM,yF,gBAETC,OAAI,CACDlB,UAAWC,GAAAA,CACP,mCACC,GAAsB,OAApBG,EAAKe,eAAe,Y,gBAG1BC,IAAC,KAAEhB,EAAKN,OACRM,EAAKU,SAAO,gBACRI,OAAI,CAAClB,UAAY,uBAAuBI,EAAKU,iB,gNC5DlF,IAEA,EAF6BrC,SAAAA,GAAS,OAAM,gBAAL4C,EAAgB,KAAK5C","sources":["webpack://gyldendal-uddannelse/./src/Foundation/Frontend/ReactComponents/Shared/ResponsiveImage/responsive-image.tsx","webpack://gyldendal-uddannelse/./src/Foundation/Frontend/ReactComponents/TeaserGridSimple/teaser-grid-simple.tsx","webpack://gyldendal-uddannelse/./src/Foundation/Frontend/ReactViews/TeaserGridSimple/teaser-grid-simple-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<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement> {\r\n    srcUrl: string;\r\n    defaultSize: number;\r\n    srcSetSizes: number[];\r\n    role?: string;\r\n}\r\n\r\nconst ResponsiveImage = (props: ResponsiveImageProps) => {\r\n    const { srcUrl, defaultSize, srcSetSizes, role, ...rest } = props;\r\n    const src = `${srcUrl}${getQueryParamDelimiter(srcUrl)}w=${defaultSize}`;\r\n    const srcSet = srcSetSizes ? generateSrcSet(srcSetSizes, srcUrl) : \"\";\r\n\r\n    return <img src={src} srcSet={srcSet} loading=\"lazy\" alt={props.alt} role={role} {...rest} />;\r\n};\r\n\r\nexport default ResponsiveImage;\r\n","import ResponsiveImage from \"ReactComponents/Shared/ResponsiveImage/responsive-image\";\r\nimport classNames from \"classnames\";\r\nimport React from \"react\";\r\n\r\ntype TeaserListItem = {\r\n    ImageSrc: string;\r\n    ImageAltText: string;\r\n    Title: string;\r\n    TitleTextColor: \"color-white\" | \"color-black\";\r\n    Url: string;\r\n    Target: string;\r\n    CtaText?: string;\r\n};\r\n\r\nexport interface TeaserGridSimpleProps {\r\n    Title?: string;\r\n    TeaserList: TeaserListItem[];\r\n    Template: \"template-3\" | \"template-4\";\r\n}\r\n\r\nconst TeaserGridSimple = (props: TeaserGridSimpleProps) => {\r\n    const { TeaserList, Template = \"template-3\", Title } = props;\r\n\r\n    return (\r\n        <section\r\n            className={classNames(\r\n                \"teaser-grid-simple content-module\",\r\n                `teaser-grid-simple--template-${Template}`\r\n            )}\r\n        >\r\n            {Title && <h2 className=\"content-header\">{Title}</h2>}\r\n\r\n            <div className=\"teaser-grid-simple__tiles\">\r\n                {TeaserList.map((item, index) => {\r\n                    return (\r\n                        <a\r\n                            href={item.Url}\r\n                            target={item.Target}\r\n                            className={classNames(\"teaser-grid-simple__tile\", {\r\n                                \"teaser-grid-simple__tile--big\":\r\n                                    (Template === \"template-3\" &&\r\n                                        (index === 0 || index === TeaserList.length - 1)) ||\r\n                                    (Template === \"template-4\" && (index === 2 || index === 3))\r\n                            })}\r\n                            key={`${item}-${index}`}\r\n                        >\r\n                            <ResponsiveImage\r\n                                role={item.Title && item.CtaText ? \"presentation\" : \"\"}\r\n                                className=\"teaser-grid-simple__tile-image\"\r\n                                alt={!item.Title && !item.CtaText ? item.ImageAltText : \"\"}\r\n                                defaultSize={639}\r\n                                srcUrl={item.ImageSrc}\r\n                                srcSetSizes={[607, 835, 518, 651]}\r\n                                sizes=\"(max-width: 639px) 607px, (max-width: 867px) 835px, (max-width: 1099px) 518px, 651px\"\r\n                            />\r\n                            <span\r\n                                className={classNames(\r\n                                    \"teaser-grid-simple__tile-content\",\r\n                                    `${item.TitleTextColor}--text`\r\n                                )}\r\n                            >\r\n                                <p>{item.Title}</p>\r\n                                {item.CtaText && (\r\n                                    <span className={`button button--slim`}>{item.CtaText}</span>\r\n                                )}\r\n                            </span>\r\n                        </a>\r\n                    );\r\n                })}\r\n            </div>\r\n        </section>\r\n    );\r\n};\r\n\r\nexport default TeaserGridSimple;\r\n","import React from \"react\";\r\nimport TeaserGridSimple from \"@/ReactComponents/TeaserGridSimple/teaser-grid-simple\";\r\n\r\nconst TeaserGridSimpleView = props => <TeaserGridSimple {...props} />;\r\n\r\nexport default TeaserGridSimpleView;\r\n"],"names":["getQueryParamDelimiter","url","indexOf","hasExistingQueryParam","props","srcUrl","defaultSize","srcSetSizes","role","rest","src","srcSet","map","srcSetSize","parameterDelimiter","srcSetSizeHighDensity","Math","round","join","generateSrcSet","img","loading","alt","TeaserList","Template","Title","section","className","classNames","h2","div","item","index","a","href","Url","target","Target","length","key","ResponsiveImage","CtaText","ImageAltText","ImageSrc","sizes","span","TitleTextColor","p","TeaserGridSimple"],"sourceRoot":""}