{"version":3,"file":"static/chunks/2685.01069f6e3afc203d.js","mappings":"wvBAQA,IAMMA,EAAAA,SAAAA,I,uHACF,WACI,MAAkCC,KAAKC,MAA/BC,EAAR,EAAQA,MAAOC,EAAf,EAAeA,QAASC,EAAxB,EAAwBA,MAElBC,EAVI,SAACC,GAAD,aAAY,eACrBC,EAAAA,EAAAA,MAAeC,MADM,SAErBD,EAAAA,EAAAA,QAAiBE,KAFI,GAGxBH,GAOiBI,CADDV,KAAKW,SAGnB,IAAKT,EACD,OAAO,KAKX,GAFkBA,EAAVU,MAGJ,OAAO,KAGX,IAAMC,EAAS,CAAEC,OAAQC,EAAAA,GAAAA,OAAcb,EAAMc,OAEvCC,EACFf,EAAMgB,OAAShB,EAAMiB,OACdjB,EAAMiB,OAASjB,EAAMgB,MAAS,IAC/B,MAEV,OACI,iBAAKE,UAAWC,GAAAA,CAAWhB,EAAM,MAAWA,EAAO,UAAUH,EAAMoB,OAAnE,UACKlB,IAAS,eAAIgB,UAAWf,EAAM,aAArB,SAAwCD,KAClD,gBACIgB,UAAWf,EAAM,eACjBkB,MACmB,SAAfrB,EAAMoB,KACA,CACEE,cAAeP,EAAoB,KAErC,GAEVQ,wBAAyBZ,IAE5BV,IACG,mBAAQiB,UAAWf,EAAM,eAAzB,SAA8CF,W,EAtC5DJ,CAAc2B,EAAAA,eA0DpB3B,EAAM4B,aAAe,CACjBzB,MAAO,KACPC,QAAS,MAGbJ,EAAM6B,YAAcC,EAAAA,EAEpB,IC7EA,ED6EA,G,kBE9EAC,EAAOC,QAAU,CAAC,MAAQ,6BAA6B,cAAc,mCAAmC,eAAiB,sCAAsC,aAAe,oCAAoC,eAAiB,wC,kBCAnOD,EAAOC,QAAU,CAAC,MAAQ,2BAA2B,cAAc,iCAAiC,eAAiB,oCAAoC,aAAe,kCAAkC,eAAiB","sources":["webpack://_N_E/./components/Embed/Embed.js","webpack://_N_E/./components/Embed/index.js","webpack://_N_E/./components/Embed/Embed.folkhem.module.scss","webpack://_N_E/./components/Embed/Embed.nordr.module.scss"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Base64 } from 'js-base64';\nimport classNames from 'classnames';\nimport { ThemeContext, themes } from '../../themes/ThemeContext';\nimport stylesNordr from './Embed.nordr.module.scss';\nimport stylesFolkhem from './Embed.folkhem.module.scss';\n\nconst getStyles = (theme) => ({\n [themes.NORDR]: stylesNordr,\n [themes.FOLKHEM]: stylesFolkhem,\n }[theme]\n);\n\nclass Embed extends React.PureComponent {\n render() {\n const { embed, caption, title } = this.props;\n const theme = this.context;\n const styles = getStyles(theme);\n\n if (!embed) {\n return null;\n }\n\n const { error } = embed;\n\n if (error) {\n return null;\n }\n\n const markup = { __html: Base64.decode(embed.html) };\n\n const ratioInPercentage =\n embed.width && embed.height\n ? (embed.height / embed.width) * 100\n : 56.25;\n\n return (\n
\n {title &&

{title}

}\n \n {caption && (\n {caption}\n )}\n
\n );\n }\n}\n\nEmbed.propTypes = {\n embed: PropTypes.shape({\n resourceId: PropTypes.string,\n html: PropTypes.string,\n type: PropTypes.string,\n height: PropTypes.number,\n width: PropTypes.number,\n error: PropTypes.string,\n }),\n type: PropTypes.string,\n caption: PropTypes.string,\n};\n\nEmbed.defaultProps = {\n embed: null,\n caption: null,\n};\n\nEmbed.contextType = ThemeContext;\n\nexport default Embed;\n","import Embed from './Embed';\n\nexport default Embed;\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"Embed\":\"Embed_folkhem_Embed__3hnjE\",\"Embed--rich\":\"Embed_folkhem_Embed--rich__n5y76\",\"Embed__Content\":\"Embed_folkhem_Embed__Content__Fy_e5\",\"Embed__Title\":\"Embed_folkhem_Embed__Title__tN1iz\",\"Embed__Caption\":\"Embed_folkhem_Embed__Caption__NFi_H\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"Embed\":\"Embed_nordr_Embed__PH4My\",\"Embed--rich\":\"Embed_nordr_Embed--rich__jqW44\",\"Embed__Content\":\"Embed_nordr_Embed__Content__4kzlc\",\"Embed__Title\":\"Embed_nordr_Embed__Title__zoK2H\",\"Embed__Caption\":\"Embed_nordr_Embed__Caption__nfSWP\"};"],"names":["Embed","this","props","embed","caption","title","styles","theme","themes","stylesNordr","stylesFolkhem","getStyles","context","error","markup","__html","Base64","html","ratioInPercentage","width","height","className","classNames","type","style","paddingBottom","dangerouslySetInnerHTML","React","defaultProps","contextType","ThemeContext","module","exports"],"sourceRoot":""}