{"version":3,"sources":["utils/helpers/attributeType/index.ts","utils/components/Corporate/ContentTypeAttributes/StyledAttributeIcon.ts","utils/components/Corporate/ContentTypeAttributes/AttributeIcon.tsx","utils/components/Corporate/ContentTypeAttributes/getAttributeRenderer.tsx","utils/helpers/contentType/index.ts","utils/components/Corporate/ContentTypeAttributes/index.tsx","utils/components/Corporate/HeadingWithDescription/StyledHeadingWithDescription.ts","utils/components/Corporate/HeadingWithDescription/index.tsx","components/Corporate/RelatedContentCarousel/StyledRelatedContent.tsx","components/Corporate/RelatedContentCarousel/RelatedItem.tsx","components/Corporate/RelatedContentCarousel/index.tsx"],"names":["AttributeType","getAttributeType","value","key","getTypeFromValue","pickAttributeByType","attributes","attributeName","attrs","filter","attr","length","attrType","undefined","type","includesAttributeWithType","hasOwnProperty","includesAttributesWithTypes","types","i","NoBreakWrapper","styled","span","IconWrapper","theme","card","attributeIcon","icons","location","Marker","cost","Cost","time","Time","statusIcons","StatusType","book","Book","underReview","UnderReview","inProgress","InProgress","planned","Planned","closed","Closed","open","OpenForFeedback","completed","Completed","AttributeIcon","attribute","Icon","classNameAttribute","classNameStatus","statusIcon","className","ariaHidden","defaultOptions","showIcon","translations","Span","getAttributeRenderer","options","capacity","noun","parseInt","capacitySingular","capacityPlural","lastUpdated","date","dateConverter","visualDate","publicationLastUpdated","newsDate","whatsOnCost","getMultipleAttributeRenderer","statusName","timeSpecificity","timeUnit","timeEstimate","getTimeEstimate","costSpecificity","costEstimate","getCostEstimate","ContentType","getContentType","ContentTypeAttributes","contentType","Wrapper","useTranslation","t","attributeRenderers","project","projectRenderer","push","publication","service","timeRenderer","costRenderer","renderings","map","renderer","Boolean","rendering","index","Fragment","role","Container","div","Heading","Text","heading_xl","heading_l","heading_m","heading_s","heading_xs","spacing","pb","RichText","ContentRichText","HeadingWithDescription","headingField","descriptionField","headingLevel","tag","field","ItemsListContainer","CarouselItem","mq","ml","mt","Card","noticeEnabled","noticeLevel","noticeMessage","rest","plainCard","motion","timing","default","ease","boxShadow","borderHover","boxShadowHover","CardHeader","CardFooter","CardSection","p","ImageWrapper","borderRadius","colors","background","tertiary","px","pt","ImageContainer","dna","Category","text_xscap","mb","secondary","Title","restrictCardTitle","element","AttributesWrapper","LinkIconContainer","ArrowWrapper","svg","action","actionHover","ItemContainer","withEditModeNotice","NavLink","withEditMode","id","image","link","title","primaryCategory","valid","editMode","description","img","resizeImage","src","internal","startsWith","isContentful","resizeContentfulImage","width","convertSrcJss","imagePlaceholderSrc","data-src","alt","renderImage","cardClass","linkObject","getLink","StyledLink","ariaLabelledBy","join","Arrow","External","EmptyList","compose","Carousel","RelatedItems","relatedItems","props","flickityOptions","groupCells","cellAlign","fields","data","datasource","Section","sectionTheme","BackgroundColors","items","heading","jss","validItems","item","dataSource","Math","random"],"mappings":"6NAGYA,E,2BAAAA,K,oBAAAA,E,YAAAA,E,0BAAAA,E,oBAAAA,E,wBAAAA,E,wBAAAA,E,YAAAA,E,kCAAAA,E,oBAAAA,E,4BAAAA,E,4BAAAA,E,kCAAAA,E,0BAAAA,E,qBAAAA,M,KA0BL,IAAMC,EAAmB,SAACC,GAAiE,IAAzCC,EAAwC,uDAA1B,OACrE,OAAOC,YAAgCJ,EAAeE,EAAOC,IAOlDE,EAAsB,SACjCC,EACAC,GAEe,IADfJ,EACc,uDADA,OAEd,IAAKG,IAAeC,EAClB,OAAO,KAGT,IAAIC,EAAK,OAAGF,QAAH,IAAGA,OAAH,EAAGA,EAAYG,QAAO,SAACC,GAAD,OAAUA,EAAKP,KAASI,KAEvD,GAAIC,EAAMG,OAAQ,CAChB,IAAMD,EAAOF,EAAM,GACfI,EAA0BX,EAAiBS,EAAMP,GAErD,YAAiBU,IAAbD,EAEK,eACFF,EADL,CAEEI,KAAMF,IAID,eACFF,EADL,CAEEI,UAAMD,IAKZ,OAAO,MAGIE,EAA4B,SACvCT,EACAQ,GAEA,QAAKR,GAIEA,EAAWU,eAAeF,IAGtBG,EAA8B,SACzCX,EACAY,GAEA,IAAKZ,IA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,UAAW6E,EAAuB,EAAvBA,SAAUgC,EAAa,EAAbA,OAC5E,GAAiC,QAAvB,OAANA,QAAM,IAANA,OAAA,YAAAA,EAAQC,YAAR,eAAcC,YAChB,OAAIlC,EAEA,kBAACmC,EAAA,EAAD,CAASC,aAAcC,IAAiB,eAAgBlK,UAAU,iBAChE,kBAAC,IAAKoD,UAAN,KACE,kBAACgG,GAAD,CAAWvE,eAAe,EAAME,cAAa,iCAM9C,KAZgF,MAoBrF8E,EAAOC,KAAKC,WAJdI,EAhBuF,EAgBvFA,MACgBC,EAjBuE,EAiBvFA,QAAWC,IACUjG,EAlBkE,EAkBvFA,aAAgBiG,IACIvC,EAnBmE,EAmBvFA,YAAeuC,IAGXC,EAEJH,GAASA,EAAMhN,OACXgN,EACGtH,KAAI,SAAC0H,GAAD,sBACAA,EADA,CAEH3C,MAAsB,OAAf2C,EAAK7C,OAAgC,OAAd6C,EAAK9C,UAEpCxK,QAAO,YAAgB,IAAb2K,EAAY,EAAZA,MACT,OAAOC,GAAYD,KAEvB,GAEN,IAAKC,GAAkC,IAAtByC,EAAWnN,OAC1B,OAAO,KAGT,IAAMoK,GAAc,OAATvE,QAAS,IAATA,OAAA,EAAAA,EAAWwH,aAAc,GAAKC,KAAKC,SAE9C,OACE,kBAACV,EAAA,EAAD,CAASC,aAAcC,IAAiB,eAAgBlK,UAAU,iBAChE,kBAAC,IAAKoD,UAAN,KACGL,QAAQqH,GAAWtC,IAClB,kBAAC7D,EAAA,EAAD,CACEC,aAAckG,EACdjG,iBAAkB2D,EAClB1D,aAAcA,IAGjBkG,EAAWnN,OAAS,EACnB,kBAAC,GAAD,CAAcqM,aAAcc,EAAYzC,SAAUA,EAAUN,GAAIA,IAEhE,kBAAC6B,GAAD,CAAWvE,eAAe,EAAME,cAAa","file":"static/js/RelatedContentCarousel.72fcaf2c.chunk.js","sourcesContent":["import getTypeFromValue from '_utils/helpers/getTypeFromValue';\r\n\r\n// note! enum values match keys sent by server\r\nexport enum AttributeType {\r\n capacity = 'capacity',\r\n cost = 'cost',\r\n lastUpdated = 'lastUpdated',\r\n location = 'location',\r\n statusIcon = 'statusIcon',\r\n statusName = 'statusName',\r\n time = 'time',\r\n timeSpecificity = 'timeSpecificity',\r\n timeUnit = 'timeUnit',\r\n timeEstimate = 'timeEstimate',\r\n costEstimate = 'costEstimate',\r\n costSpecificity = 'costSpecificity',\r\n whatsOnCost = 'whatsOnCost',\r\n newsDate = 'newsDate'\r\n}\r\n\r\nexport type Attribute = {\r\n type: AttributeType;\r\n value: any;\r\n};\r\n\r\n/**\r\n * @param target either a string representation of a attribute type or an object containing a attribute type\r\n * @param key optional used to retrieve attributeType value (if passing an object)\r\n */\r\nexport const getAttributeType = (value: string | object, key: string = 'type'): AttributeType => {\r\n return getTypeFromValue(AttributeType, value, key);\r\n};\r\n\r\n/**\r\n * @param target either a string representation of a attribute type or an object containing a attribute type\r\n * @param key optional used to retrieve attributeType value (if passing an object)\r\n */\r\nexport const pickAttributeByType = (\r\n attributes,\r\n attributeName: string,\r\n key: string = 'type'\r\n): Attribute => {\r\n if (!attributes || !attributeName) {\r\n return null;\r\n }\r\n\r\n let attrs = attributes?.filter((attr) => attr[key] === attributeName);\r\n\r\n if (attrs.length) {\r\n const attr = attrs[0];\r\n let attrType: AttributeType = getAttributeType(attr, key);\r\n\r\n if (attrType !== undefined) {\r\n // found a known type\r\n return {\r\n ...attr,\r\n type: attrType\r\n };\r\n } else {\r\n // treat as generic\r\n return {\r\n ...attr,\r\n type: undefined\r\n };\r\n }\r\n }\r\n\r\n return null;\r\n};\r\n\r\nexport const includesAttributeWithType = (\r\n attributes: { [key: string]: Attribute },\r\n type: AttributeType\r\n) => {\r\n if (!attributes) {\r\n return false;\r\n }\r\n\r\n return attributes.hasOwnProperty(type);\r\n};\r\n\r\nexport const includesAttributesWithTypes = (\r\n attributes: { [key: string]: Attribute },\r\n types: AttributeType[]\r\n) => {\r\n if (!attributes || !types) {\r\n return false;\r\n }\r\n\r\n for (let i = 0; i < types.length; i++) {\r\n const type = types[i];\r\n if (!includesAttributeWithType(attributes, type)) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n};\r\n\r\n// Old loose definitions Please migrate to strict ones above\r\n// DELETED use pickAttributeByType\r\n// export const getAttributeByType = (attributes, attributeType) => {\r\n\r\n// };\r\n\r\n// DELETED use AttributeIcon in utils/components/ContentTypeAttributes\r\n// export const AttributeIcon = ({ attribute }) => {\r\n\r\n// };\r\n","import styled from 'styled-components';\r\n// import { svg } from '_utils/styles/';\r\n\r\n/* \r\ninexplicably\r\nadding ${svg(24, 24)} into style defn, causes server error when deployed \r\nObject(...) is not a function TypeError: Object(...) is not a function \r\n*/\r\n\r\nexport const NoBreakWrapper = styled.span`\r\n white-space: nowrap;\r\n`;\r\n\r\nexport const IconWrapper = styled.span`\r\n position: relative;\r\n display: inline-block;\r\n margin-right: 8px;\r\n transform: translateY(-10%);\r\n height: 20px;\r\n white-space: nowrap;\r\n\r\n svg,\r\n img {\r\n vertical-align: middle;\r\n width: 20px;\r\n height: auto;\r\n }\r\n\r\n path {\r\n fill: ${({ theme }) => theme.card.attributeIcon};\r\n }\r\n`;\r\n","import React from 'react';\r\nimport { IconWrapper, NoBreakWrapper } from './StyledAttributeIcon';\r\nimport { AttributeType } from '_utils/helpers/attributeType';\r\nimport { StatusType } from '_utils/helpers/statusType';\r\nimport {\r\n Book,\r\n Closed,\r\n Completed,\r\n Cost,\r\n InProgress,\r\n Marker,\r\n OpenForFeedback,\r\n Planned,\r\n Time,\r\n UnderReview\r\n} from '_utils/icons';\r\n\r\nconst icons = {\r\n [AttributeType.location]: Marker,\r\n [AttributeType.cost]: Cost,\r\n [AttributeType.time]: Time\r\n};\r\n\r\nconst statusIcons = {\r\n [StatusType.book]: Book,\r\n [StatusType.underReview]: UnderReview,\r\n [StatusType.inProgress]: InProgress,\r\n [StatusType.planned]: Planned,\r\n [StatusType.closed]: Closed,\r\n [StatusType.open]: OpenForFeedback,\r\n [StatusType.completed]: Completed\r\n};\r\n\r\nconst AttributeIcon = ({ attribute }) => {\r\n if (!attribute) {\r\n return null;\r\n }\r\n\r\n let Icon = null;\r\n let classNameAttribute = attribute.type;\r\n let classNameStatus = '';\r\n\r\n if (attribute.type === AttributeType.statusIcon) {\r\n Icon = statusIcons[attribute.value];\r\n classNameStatus = attribute.value;\r\n } else {\r\n Icon = icons[attribute.type];\r\n }\r\n\r\n if (!Icon) {\r\n // console.log('no icon found for ', attribute.type);\r\n return null;\r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default AttributeIcon;\r\n","import React, { ReactNode } from 'react';\r\nimport styled from 'styled-components';\r\nimport {\r\n AttributeType,\r\n Attribute,\r\n includesAttributesWithTypes\r\n} from '_utils/helpers/attributeType';\r\nimport AttributeIcon from './AttributeIcon';\r\nimport { dateConverter, getTimeEstimate, getCostEstimate } from '_utils/helpers';\r\nimport { AttributeRendererOptions } from './definitions';\r\n\r\nconst defaultOptions = {\r\n showIcon: true,\r\n translations: null\r\n};\r\n\r\nconst Span = styled.span``;\r\n\r\nexport function getAttributeRenderer(\r\n attribute: Attribute,\r\n options?: AttributeRendererOptions\r\n): () => ReactNode {\r\n options = { ...defaultOptions, ...options };\r\n\r\n const value = attribute?.value;\r\n\r\n if (value === '' || value === undefined || value === null) {\r\n return () => null;\r\n }\r\n\r\n switch (attribute?.type) {\r\n case AttributeType.location: {\r\n return () => (\r\n \r\n {options.showIcon && }\r\n {value}\r\n \r\n );\r\n }\r\n\r\n case AttributeType.capacity: {\r\n const noun =\r\n parseInt(value, 10) === 1\r\n ? options.translations.capacitySingular\r\n : options.translations.capacityPlural;\r\n return () => `${value} ${noun}`;\r\n }\r\n\r\n case AttributeType.lastUpdated: {\r\n return () => {\r\n let date = dateConverter(value)?.visualDate;\r\n return date\r\n ? `${\r\n options?.translations?.publicationLastUpdated\r\n ? options?.translations?.publicationLastUpdated + ' '\r\n : ''\r\n }${date}`\r\n : null;\r\n };\r\n }\r\n\r\n case AttributeType.newsDate: {\r\n return () => value;\r\n }\r\n\r\n case AttributeType.whatsOnCost: {\r\n return () => (\r\n \r\n {options.showIcon && }\r\n {value}\r\n \r\n );\r\n }\r\n }\r\n\r\n return () => null;\r\n}\r\n\r\nexport function getMultipleAttributeRenderer(\r\n attributes: { [key: string]: Attribute },\r\n options?: AttributeRendererOptions\r\n): () => ReactNode {\r\n options = { ...defaultOptions, ...options };\r\n\r\n if (!attributes) {\r\n return () => null;\r\n }\r\n\r\n if (\r\n includesAttributesWithTypes(attributes, [AttributeType.statusName, AttributeType.statusIcon])\r\n ) {\r\n const statusName = attributes[AttributeType.statusName];\r\n const statusIcon = attributes[AttributeType.statusIcon];\r\n\r\n if (statusName && statusName.value) {\r\n return () => (\r\n \r\n {!!(statusIcon && options.showIcon) && }\r\n {statusName.value}\r\n \r\n );\r\n }\r\n }\r\n\r\n if (\r\n includesAttributesWithTypes(attributes, [\r\n AttributeType.timeSpecificity,\r\n AttributeType.timeUnit,\r\n AttributeType.timeEstimate\r\n ])\r\n ) {\r\n const timeSpecificity = attributes[AttributeType.timeSpecificity]?.value || '';\r\n const timeUnit = attributes[AttributeType.timeUnit]?.value || '';\r\n const timeEstimate = attributes[AttributeType.timeEstimate]?.value || '';\r\n\r\n const time = getTimeEstimate(timeSpecificity, timeUnit, timeEstimate);\r\n\r\n if (time) {\r\n return () => (\r\n \r\n \r\n {time}\r\n \r\n );\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n if (\r\n includesAttributesWithTypes(attributes, [\r\n AttributeType.costSpecificity,\r\n AttributeType.costEstimate\r\n ])\r\n ) {\r\n const costEstimate = attributes[AttributeType.costEstimate]?.value || '';\r\n const costSpecificity = attributes[AttributeType.costSpecificity]?.value || '';\r\n\r\n const cost = getCostEstimate(costSpecificity, costEstimate);\r\n\r\n if (cost) {\r\n return () => (\r\n \r\n {options.showIcon && }\r\n {cost}\r\n \r\n );\r\n }\r\n }\r\n\r\n return () => null;\r\n}\r\n","import getTypeFromValue from '_utils/helpers/getTypeFromValue';\r\n\r\n// note! enum values match keys sent by server\r\nexport enum ContentType {\r\n collection = 'collection',\r\n committee = 'committee',\r\n focus = 'focus',\r\n place = 'place',\r\n profile = 'profile',\r\n program = 'program',\r\n project = 'project',\r\n publication = 'publication',\r\n service = 'service',\r\n space = 'space'\r\n}\r\n\r\n/**\r\n * @param target either a string representation of a content type or an object containing a content type\r\n * @param key optional used to retrieve contentType value (if passing an object)\r\n */\r\nexport const getContentType = (value: string | object, key: string = 'type'): ContentType => {\r\n return getTypeFromValue(ContentType, value, key);\r\n};\r\n","import React from 'react';\r\n\r\nimport { ContentType } from '_utils/helpers/contentType';\r\nimport { pickAttributeByType, AttributeType, Attribute } from '_utils/helpers/attributeType';\r\nimport { getAttributeRenderer, getMultipleAttributeRenderer } from './getAttributeRenderer';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nexport * from './getAttributeRenderer';\r\nexport * from './definitions';\r\n\r\nexport type WrapperProps = {};\r\n\r\ntype ContentTypeAttributesProps = {\r\n attributes: any[];\r\n contentType: ContentType;\r\n Wrapper: React.ComponentType;\r\n};\r\n\r\nconst ContentTypeAttributes: React.FC = ({\r\n attributes,\r\n contentType,\r\n Wrapper\r\n}) => {\r\n const [t] = useTranslation();\r\n\r\n let publicationLastUpdated = t('publication-related-content-last-updated-prefix');\r\n\r\n if (publicationLastUpdated === 'publication-related-content-last-updated-prefix') {\r\n publicationLastUpdated = '';\r\n }\r\n\r\n const translations = {\r\n publicationLastUpdated,\r\n capacitySingular: t('space-capacity-unit-singular'),\r\n capacityPlural: t('space-capacity-unit-plural')\r\n };\r\n\r\n let attributeRenderers: any[] = [];\r\n\r\n if (contentType === ContentType.project) {\r\n const statusName = pickAttributeByType(attributes, AttributeType.statusName);\r\n const statusIcon = pickAttributeByType(attributes, AttributeType.statusIcon);\r\n\r\n const projectRenderer = getMultipleAttributeRenderer({\r\n [AttributeType.statusName]: statusName,\r\n [AttributeType.statusIcon]: statusIcon\r\n });\r\n\r\n attributeRenderers.push(projectRenderer);\r\n }\r\n\r\n attributeRenderers.push(\r\n getAttributeRenderer(pickAttributeByType(attributes, AttributeType.location))\r\n );\r\n\r\n attributeRenderers.push(\r\n getAttributeRenderer(pickAttributeByType(attributes, AttributeType.capacity), {\r\n translations\r\n })\r\n );\r\n\r\n attributeRenderers.push(\r\n getAttributeRenderer(pickAttributeByType(attributes, AttributeType.whatsOnCost))\r\n );\r\n\r\n // lastUpdated can appear for other (unwanted) contentTypes - only display for publication\r\n if (contentType === ContentType.publication) {\r\n attributeRenderers.push(\r\n getAttributeRenderer(pickAttributeByType(attributes, AttributeType.lastUpdated), {\r\n translations\r\n })\r\n );\r\n }\r\n\r\n attributeRenderers.push(\r\n getAttributeRenderer(pickAttributeByType(attributes, AttributeType.newsDate))\r\n );\r\n\r\n if (contentType === ContentType.service) {\r\n const timeSpecificity: Attribute = pickAttributeByType(\r\n attributes,\r\n AttributeType.timeSpecificity\r\n );\r\n const timeUnit: Attribute = pickAttributeByType(attributes, AttributeType.timeUnit);\r\n const timeEstimate: Attribute = pickAttributeByType(attributes, AttributeType.timeEstimate);\r\n const costEstimate: Attribute = pickAttributeByType(attributes, AttributeType.costEstimate);\r\n const costSpecificity: Attribute = pickAttributeByType(\r\n attributes,\r\n AttributeType.costSpecificity\r\n );\r\n\r\n const timeRenderer = getMultipleAttributeRenderer({\r\n [AttributeType.timeSpecificity]: timeSpecificity,\r\n [AttributeType.timeUnit]: timeUnit,\r\n [AttributeType.timeEstimate]: timeEstimate\r\n });\r\n\r\n const costRenderer = getMultipleAttributeRenderer(\r\n {\r\n [AttributeType.costEstimate]: costEstimate,\r\n [AttributeType.costSpecificity]: costSpecificity\r\n },\r\n { showIcon: timeRenderer !== null }\r\n );\r\n\r\n attributeRenderers.push(timeRenderer, costRenderer);\r\n }\r\n\r\n const renderings = attributeRenderers\r\n .map((renderer) => (typeof renderer === 'function' ? renderer() : null))\r\n .filter(Boolean);\r\n\r\n if (renderings.length === 0) {\r\n return null;\r\n }\r\n\r\n return (\r\n \r\n {renderings.map((rendering, index) => (\r\n \r\n {index > 0 && ยท }\r\n {rendering}\r\n \r\n ))}\r\n \r\n );\r\n};\r\n\r\nexport default ContentTypeAttributes;\r\n","import styled from 'styled-components';\r\nimport { spacing } from '_utils/props';\r\nimport { Text } from '@sitecore-jss/sitecore-jss-react';\r\nimport { heading_xl, heading_l, heading_m, heading_s, heading_xs } from '_utils/styles/';\r\nimport ContentRichText from '_components/Corporate/ContentRichText';\r\n\r\nexport const Container = styled.div``;\r\n\r\nexport const Heading = styled(Text)`\r\n h2& {\r\n ${heading_xl}\r\n }\r\n\r\n h3& {\r\n ${heading_l}\r\n }\r\n\r\n h4& {\r\n ${heading_m}\r\n }\r\n\r\n h5& {\r\n ${heading_s}\r\n }\r\n\r\n h6& {\r\n ${heading_xs}\r\n }\r\n\r\n h2&,\r\n h3&,\r\n h4& {\r\n ${({ theme }) => spacing({ theme, pb: 3 })}\r\n }\r\n\r\n h5&,\r\n h6& {\r\n ${({ theme }) => spacing({ theme, pb: 2 })}\r\n }\r\n`;\r\n\r\nexport const RichText = styled(ContentRichText)`\r\n ${({ theme }) =>\r\n spacing({\r\n theme,\r\n pb: 3\r\n })}\r\n\r\n > :last-child {\r\n margin-bottom: 0;\r\n }\r\n`;\r\n","import React from 'react';\r\nimport { Container, Heading, RichText } from './StyledHeadingWithDescription';\r\n\r\nexport type HeadingWithDescriptionProps = {\r\n headingField: any;\r\n descriptionField: any;\r\n headingLevel: any;\r\n};\r\n\r\nconst HeadingWithDescription: React.FC = ({\r\n headingField,\r\n descriptionField,\r\n headingLevel\r\n}) => {\r\n headingLevel = headingLevel?.value || 'h2';\r\n\r\n return (\r\n \r\n {headingField && (\r\n \r\n )}\r\n {descriptionField && }\r\n \r\n );\r\n};\r\n\r\nexport default HeadingWithDescription;\r\n","import React from 'react';\r\nimport styled from 'styled-components';\r\nimport { Text } from '@sitecore-jss/sitecore-jss-react';\r\nimport { heading_l, heading_s, heading_m, text_xscap } from '_utils/styles/text';\r\nimport { spacing } from '_utils/props';\r\nimport { mq, svg, plainCard, restrictCardTitle } from '_utils/styles/';\r\nimport { Link } from 'react-router-dom';\r\n\r\nexport const Container = styled.div`\r\n width: 100%;\r\n position: relative;\r\n`;\r\n\r\nexport const ItemsListContainer = styled.div`\r\n display: flex;\r\n width: 100%;\r\n overflow-x: auto;\r\n padding-bottom: 16px;\r\n`;\r\n\r\nexport const CarouselItem = styled.div`\r\n flex: none;\r\n width: 224px;\r\n display: flex;\r\n flex-direction: column;\r\n\r\n ${mq('md')} {\r\n width: 288px;\r\n }\r\n\r\n .flickity-resize & {\r\n top: 0;\r\n bottom: 0;\r\n }\r\n\r\n & + & {\r\n ${({ theme }) => spacing({ theme, ml: 4, mt: 0 })}\r\n }\r\n`;\r\n\r\n// Need to remove extra props getting sent to the dom\r\n// https://github.com/styled-components/styled-components/issues/135\r\nexport const Card = styled(({ noticeEnabled, noticeLevel, noticeMessage, ...rest }) => (\r\n \r\n))`\r\n ${({ theme }) => plainCard({ theme })}\r\n width: 100%;\r\n display: flex;\r\n\r\n transition: ${({ theme: { motion } }) => `border ${motion.timing.default} ${motion.ease}`};\r\n flex: 1 0 auto;\r\n flex-direction: column;\r\n justify-content: center;\r\n color: inherit;\r\n text-decoration: none;\r\n\r\n position: relative;\r\n\r\n &:after {\r\n content: '';\r\n position: absolute;\r\n width: 92%;\r\n height: 90%;\r\n left: 50%;\r\n bottom: 0;\r\n transform: translateX(-50%);\r\n box-shadow: ${({ theme }) => theme.card.boxShadow};\r\n transition: ${({ theme: { motion } }) => `box-shadow ${motion.timing.default} ${motion.ease}`};\r\n\r\n z-index: -1;\r\n }\r\n\r\n &:hover {\r\n border: ${({ theme }) => theme.card.borderHover};\r\n\r\n &:after {\r\n box-shadow: ${({ theme }) => theme.card.boxShadowHover};\r\n }\r\n }\r\n`;\r\n\r\nexport const CardHeader = styled.span`\r\n display: flex;\r\n flex: none;\r\n flex-direction: column;\r\n`;\r\n\r\nexport const CardFooter = styled.span`\r\n display: flex;\r\n flex: none;\r\n flex-direction: column;\r\n`;\r\n\r\nexport const CardSection = styled.span`\r\n flex: 1 1 auto;\r\n display: flex;\r\n flex-direction: column;\r\n justify-content: center;\r\n ${({ theme }) => spacing({ theme, p: 3 })}\r\n\r\n .image & {\r\n justify-content: flex-start;\r\n }\r\n`;\r\n\r\nexport const ImageWrapper = styled.span`\r\n .image & {\r\n width: 100%;\r\n display: block;\r\n position: relative;\r\n overflow: hidden;\r\n border-top-left-radius: ${({ theme }) => theme.card.borderRadius - 2}px;\r\n border-top-right-radius: ${({ theme }) => theme.card.borderRadius - 2}px;\r\n\r\n &:before {\r\n content: '';\r\n display: block;\r\n padding-bottom: 75%;\r\n }\r\n }\r\n\r\n .publication &,\r\n .focus & {\r\n background-color: ${({ theme }) => theme.colors.background.tertiary};\r\n }\r\n\r\n .no-image & {\r\n display: flex;\r\n height: 100%;\r\n align-items: flex-end;\r\n background-color: transparent;\r\n ${({ theme }) => spacing({ theme, px: 3, pt: 3 })}\r\n &:before {\r\n content: '';\r\n display: block;\r\n height: 14px;\r\n }\r\n }\r\n`;\r\n\r\nexport const ImageContainer = styled.span`\r\n position: absolute;\r\n left: 0;\r\n top: 0;\r\n width: 100%;\r\n height: 100%;\r\n\r\n img {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n object-fit: cover;\r\n font-family: 'object-fit: cover;';\r\n }\r\n\r\n .publication & {\r\n /* width 75% to make container square (inside 4:3 parent) */\r\n width: calc(75% - 32px);\r\n height: calc(100% - 32px);\r\n left: 50%;\r\n top: 50%;\r\n transform: translate(-50%, -50%);\r\n\r\n &:before {\r\n content: '';\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n background-color: ${({ theme }) => theme.colors.dna.default};\r\n border-radius: 50%;\r\n @media print {\r\n background-color: transparent;\r\n }\r\n }\r\n\r\n img {\r\n object-fit: contain;\r\n font-family: 'object-fit: contain;';\r\n }\r\n }\r\n\r\n .no-image & {\r\n display: none;\r\n }\r\n\r\n .focus & {\r\n width: calc(100% - 64px);\r\n height: calc(100% - 48px);\r\n left: 50%;\r\n top: 50%;\r\n transform: translate(-50%, -50%);\r\n\r\n img {\r\n object-fit: contain;\r\n font-family: 'object-fit: contain;';\r\n }\r\n }\r\n`;\r\n\r\nexport const Category = styled.span`\r\n display: block;\r\n ${text_xscap}\r\n margin: 0;\r\n ${({ theme }) => spacing({ theme, mb: 1 })}\r\n color: ${({ theme }) => theme.card.secondary};\r\n`;\r\n\r\nexport const Title = styled(Text)`\r\n ${restrictCardTitle}\r\n\r\n ${Card}:hover & {\r\n color: ${({ theme }) => theme.colors.element.tertiary};\r\n text-decoration: underline;\r\n }\r\n\r\n ${heading_s}\r\n\r\n .no-image & {\r\n ${heading_l}\r\n }\r\n\r\n ${mq('md')} {\r\n ${heading_m}\r\n\r\n .no-image & {\r\n ${heading_l}\r\n }\r\n }\r\n`;\r\n\r\nexport const AttributesWrapper = styled.span`\r\n margin: 8px 0;\r\n display: block;\r\n`;\r\n\r\nexport const AttributesIcon = styled.span`\r\n align-self: flex-start;\r\n flex: none;\r\n`;\r\n\r\nexport const LinkIconContainer = styled.span`\r\n display: flex;\r\n height: 100%;\r\n align-items: flex-end;\r\n ${({ theme }) => spacing({ theme, px: 3, pb: 3 })}\r\n`;\r\n\r\nexport const ArrowWrapper = styled.span`\r\n ${svg(14, 14)}\r\n width: 14px;\r\n\r\n ${mq('md')} {\r\n width: 19px;\r\n }\r\n\r\n path {\r\n fill: ${({ theme }) => theme.card.action};\r\n\r\n ${Card}:hover & {\r\n fill: ${({ theme }) => theme.card.actionHover};\r\n }\r\n }\r\n`;\r\n","import React from 'react';\r\nimport { convertSrcJss } from '_utils/media';\r\nimport { Image } from '@sitecore-jss/sitecore-jss-react';\r\nimport Arrow from '_utils/icons/Arrow';\r\nimport External from '_utils/icons/External';\r\nimport NavLink from '../NavItem';\r\nimport { getContentType } from '_utils/helpers/contentType';\r\nimport { isContentful, resizeContentfulImage } from '_utils/helpers/image';\r\nimport { getLink } from '_utils/helpers/link';\r\nimport { imagePlaceholderSrc } from '_utils/styles';\r\nimport ContentTypeAttributes from '_utils/components/Corporate/ContentTypeAttributes';\r\nimport { withEditMode, withEditModeNotice } from '_containers/BaseComponent';\r\n\r\nimport { Item as ItemProps } from './definitions';\r\n\r\nimport {\r\n ArrowWrapper,\r\n Card,\r\n CardHeader,\r\n CardSection,\r\n CardFooter,\r\n Category,\r\n Title,\r\n AttributesWrapper,\r\n LinkIconContainer,\r\n ImageWrapper,\r\n ImageContainer\r\n} from './StyledRelatedContent';\r\n\r\nconst ItemContainer = withEditModeNotice(NavLink);\r\n\r\nconst renderImage = (field, editMode) => {\r\n if (editMode) {\r\n return ;\r\n }\r\n\r\n if (field === null || Boolean(field?.value?.src) === false) {\r\n return null;\r\n }\r\n\r\n let resizeImage;\r\n\r\n const internal = field?.value?.src?.startsWith('/');\r\n\r\n if (isContentful(field.value.src)) {\r\n resizeImage = resizeContentfulImage(field?.value?.src, { width: 640 });\r\n } else if (internal) {\r\n resizeImage = convertSrcJss(field.value.src) + '?mw=640';\r\n } else {\r\n resizeImage = field.value.src;\r\n }\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nconst RelatedItem: React.FC = ({\r\n id,\r\n image,\r\n link,\r\n type,\r\n title,\r\n primaryCategory,\r\n attributes,\r\n valid,\r\n editMode,\r\n description\r\n}) => {\r\n const contentType = getContentType(type);\r\n\r\n let img = renderImage(image, editMode);\r\n\r\n let cardClass = [];\r\n\r\n cardClass.push(contentType);\r\n\r\n cardClass.push(img ? 'image' : 'no-image');\r\n\r\n const linkObject = getLink(link);\r\n\r\n return (\r\n \r\n \r\n \r\n {img}\r\n \r\n \r\n \r\n {primaryCategory && {primaryCategory}}\r\n \r\n <ContentTypeAttributes\r\n attributes={attributes}\r\n contentType={contentType}\r\n Wrapper={AttributesWrapper}\r\n />\r\n </CardSection>\r\n <CardFooter>\r\n {linkObject !== null && (\r\n <LinkIconContainer>\r\n <ArrowWrapper>\r\n {linkObject.type !== 'external' && <Arrow ariaHidden={true} />}\r\n {linkObject.type === 'external' && <External ariaHidden={true} />}\r\n </ArrowWrapper>\r\n </LinkIconContainer>\r\n )}\r\n </CardFooter>\r\n </ItemContainer>\r\n );\r\n};\r\n\r\nexport default withEditMode(RelatedItem);\r\n","import React from 'react';\r\nimport { compose } from 'ramda';\r\n\r\nimport { withEditMode, withEditModeNotice } from '_containers/BaseComponent';\r\nimport { Grid } from '_utils/components/Corporate';\r\nimport { Carousel } from '_utils/components/Corporate';\r\nimport Section, { BackgroundColors } from '_utils/components/Corporate/Section';\r\nimport HeadingWithDescription from '_utils/components/Corporate/HeadingWithDescription';\r\n\r\nimport { RelatedContentProps } from './definitions';\r\n\r\nimport { CarouselItem, ItemsListContainer } from './StyledRelatedContent';\r\n\r\nimport RelatedItem from './RelatedItem';\r\n\r\nconst EmptyList = compose(withEditModeNotice)(Carousel);\r\nconst RelatedItems = ({ editMode, relatedItems, id }) => {\r\n if (!editMode) {\r\n return (\r\n <Carousel key={id} flickityOptions={{ groupCells: true, cellAlign: 'left' }}>\r\n {relatedItems.map((props, index) => {\r\n return (\r\n <CarouselItem key={`${id}_${index}`}>\r\n <RelatedItem {...props} editMode={editMode} />\r\n </CarouselItem>\r\n );\r\n })}\r\n </Carousel>\r\n );\r\n }\r\n\r\n return (\r\n <ItemsListContainer>\r\n {relatedItems.map((props, index) => (\r\n <CarouselItem key={`${id}_${index}`}>\r\n <RelatedItem {...props} editMode={editMode} />\r\n </CarouselItem>\r\n ))}\r\n </ItemsListContainer>\r\n );\r\n};\r\n\r\nconst RelatedContent: React.FC<RelatedContentProps> = ({ rendering, editMode, fields }) => {\r\n if (fields?.data?.datasource === null) {\r\n if (editMode) {\r\n return (\r\n <Section sectionTheme={BackgroundColors['Light beige']} className=\"hide-on-print\">\r\n <Grid.Container>\r\n <EmptyList noticeEnabled={true} noticeMessage={`Carousel has no datasource`} />\r\n </Grid.Container>\r\n </Section>\r\n );\r\n }\r\n\r\n return null;\r\n }\r\n\r\n const {\r\n items,\r\n heading: { jss: heading },\r\n headingLevel: { jss: headingLevel },\r\n description: { jss: description }\r\n } = fields.data.datasource;\r\n\r\n const validItems =\r\n // add valid key for use down the pipe\r\n items && items.length\r\n ? items\r\n .map((item) => ({\r\n ...item,\r\n valid: item.title !== null && item.link !== null\r\n }))\r\n .filter(({ valid }) => {\r\n return editMode || valid;\r\n })\r\n : [];\r\n\r\n if (!editMode && validItems.length === 0) {\r\n return null;\r\n }\r\n\r\n const id = rendering?.dataSource || '' + Math.random();\r\n\r\n return (\r\n <Section sectionTheme={BackgroundColors['Light beige']} className=\"hide-on-print\">\r\n <Grid.Container>\r\n {Boolean(heading || description) && (\r\n <HeadingWithDescription\r\n headingField={heading}\r\n descriptionField={description}\r\n headingLevel={headingLevel}\r\n />\r\n )}\r\n {validItems.length > 0 ? (\r\n <RelatedItems relatedItems={validItems} editMode={editMode} id={id} />\r\n ) : (\r\n <EmptyList noticeEnabled={true} noticeMessage={`Carousel contains no items`} />\r\n )}\r\n </Grid.Container>\r\n </Section>\r\n );\r\n};\r\n\r\nexport default compose(withEditMode)(RelatedContent);\r\n"],"sourceRoot":""}