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AAAA,EAAAA,SAAA,KACKoE,EAAKC,cAAgB,GAAJ1B,OAAOyB,EAAKE,QAAO,MACrCtE,EAAAA,cAACuE,EAAAA,KAAa,CAAC7D,KAAM0D,EAAKI,IAAK7D,MAAOyD,EAAKtB,MAAO2B,QAASC,EAAAA,EAAYC,aAAe,KAHtEP,KAc0C,IAC5DQ,EAAkBxB,GAAQ,GAAJT,OAAOc,EAAOL,GAAK,KACzCyB,EAAoBxB,GAAU,GAAJV,OAAOU,GACjCyB,EAAmBxB,GAAS,IAAJX,OAAQW,EAAK,KACrCyB,EAAiB,GAAHpC,OAAMkC,GAAiBlC,OAAGmC,EAAgB,KAE9D,OACI9E,EAAAA,cAAAA,EAAAA,SAAA,QAAA2C,OACQC,EAAO,KACVmB,EACAD,EACAG,EACAD,EACAH,EACAe,EACAG,EACAnB,EACAM,EACF,C,uEC7DJ,MAAMc,EAAeA,KACxB,MAAOC,EAAWC,IAAgBC,EAAAA,EAAAA,WAAS,GAM3C,OAJAC,EAAAA,EAAAA,YAAU,KACNF,GAAa,EAAK,GACnB,IAEID,CAAS,C","sources":["webpack://Kristiania.Web/./Features/Pages/EmployeePage/EmployeeDetails.tsx","webpack://Kristiania.Web/./Features/Pages/EmployeePage/EmployeeDetails.module.css?b6f9","webpack://Kristiania.Web/./Features/Partials/ResearchPublication/ResearchPublication.tsx","webpack://Kristiania.Web/./Features/Utils/Hooks/useIsMounted.ts"],"sourcesContent":["import * as React from 'react';\nimport type { AreaViewModel } from '~/Partials/Accordion/AreaViewModel.csharp';\nimport { AccordionItem } from '~/Partials/AccordionComponent/AccordionItem';\nimport { Link } from '~/Partials/Link/Link';\nimport { List } from '~/Partials/List/List';\nimport { ResearchPublication } from '~/Partials/ResearchPublication/ResearchPublication';\nimport styles from './EmployeeDetails.module.css';\nimport type { EmployeeDetailsViewModel } from './ViewModel/EmployeeDetailsViewModel.csharp';\nimport type { BaseEntryViewModel } from './ViewModel/Entry/BaseEntryViewModel.csharp';\nimport type { EmployeeResearchViewModel } from './ViewModel/Entry/EmployeeResearchViewModel.csharp';\nimport type { IEntryViewModel } from './ViewModel/Entry/IEntryViewModel.csharp';\n\nexport class EmployeeDetails extends React.Component {\n isBaseEntry(entry: IEntryViewModel) {\n return (entry as BaseEntryViewModel).lines !== undefined;\n }\n\n renderBaseEntry(entry: BaseEntryViewModel) {\n const heading = entry.headingUrl ? (\n \n ) : (\n entry.heading\n );\n\n return (\n <>\n
{heading}
\n {entry.lines && entry.lines.map((line, lineIdx) =>
{line}
)}\n \n );\n }\n\n renderEntry(entry: IEntryViewModel) {\n if (this.isBaseEntry(entry)) {\n return this.renderBaseEntry(entry as BaseEntryViewModel);\n }\n\n return ;\n }\n\n renderArea(area: AreaViewModel, id: string) {\n const hasCategories =\n area.categories && area.categories.length > 0 && area.categories.some(x => x.entries.length > 0);\n const hasEntries = area.entries && area.entries.length > 0;\n const hasContent = hasCategories || hasEntries;\n\n return (\n hasContent && (\n
  • \n {area.displayName}}\n contentSpacing=\"fullWidth\"\n >\n {hasCategories &&\n area.categories.map(\n category => category && this.renderEntries(category.entries, category.displayName)\n )}\n\n {hasEntries && this.renderEntries(area.entries, '')}\n \n
  • \n )\n );\n }\n\n renderEntries(entries: IEntryViewModel[], heading: string) {\n return (\n entries &&\n entries.length > 0 && (\n
    \n {heading &&

    {heading}

    }\n
      \n {entries.map((entry, idx) => (\n
    • {this.renderEntry(entry)}
    • \n ))}\n
    \n
    \n )\n );\n }\n\n render() {\n const { areas } = this.props;\n\n return (\n this.renderArea(area, `area-${idx}`)}\n className={styles.EmployeeDetails}\n />\n );\n }\n}\n","// extracted by mini-css-extract-plugin\nexport default {\"EmployeeDetails\":\"dpbqmQWYFsgsp6c9FbO2\",\"AccordionWrapper\":\"bNksHOxypPG62YOmbjMu\",\"AccordionTitle\":\"qEN8Zw0Q4gIuzUXSuTMR\",\"Entries\":\"zmgORIIGuzRbPolKFHvv\",\"Heading\":\"ZLWEFOoM4zLeD20wLoUE\",\"List\":\"heUsY0tDbWKqID2KXMGS\",\"LinkEntry\":\"cJYku3R5vL3Ftytozxog\"};","import * as React from 'react';\nimport { Link as LinkComponent } from '../Link/Link';\nimport { LinkVariant } from '../Link/LinkVariant.csharp';\nimport type { Link } from './Link.csharp';\nimport type { ResearchPublicationViewModel } from './ResearchPublicationViewModel.csharp';\n\nexport const ResearchPublication: React.FC> = props => {\n const {\n authors,\n yearPublished,\n title,\n referenceTitle,\n referenceEditors,\n publisherName,\n isArticle,\n forceNonItalicTitle,\n isbn,\n volume,\n issue,\n pages,\n links,\n } = props;\n\n const addDot = (text: string) => {\n if (text && ['.', '?', '!'].lastIndexOf(text[text.length - 1]) > -1) {\n return text;\n }\n\n return `${text}.`;\n };\n\n const getLinkDetails = (link: Link) => (\n <>\n {link.isTypeToShow && `${link.urlType}: `}\n {' '}\n \n );\n\n const publicationPages = pages && `${pages}. `;\n const publisher = publisherName && (isArticle ? {addDot(publisherName)} : `${addDot(publisherName)} `);\n const publicationTitle =\n referenceTitle || isArticle || forceNonItalicTitle ? `${addDot(title)} ` : {addDot(title)} ;\n const publicationYearPublished = yearPublished && `(${yearPublished}). `;\n const publicationReferenceTitle = referenceTitle && {`${addDot(referenceTitle)} `};\n const publicationReferenceEditors = referenceEditors && `I ${referenceEditors} `;\n const publicationLinks = links && links.map(x => getLinkDetails(x));\n const publicationIsbn = isbn && `${addDot(isbn)} `;\n const publicationVolume = volume && `${volume}`;\n const publicationIssue = issue && `(${issue})`;\n const volumeAndIssue = `${publicationVolume}${publicationIssue} `;\n\n return (\n <>\n {`${authors} `}\n {publicationYearPublished}\n {publicationTitle}\n {publicationReferenceEditors}\n {publicationReferenceTitle}\n {publisher}\n {publicationIsbn}\n {volumeAndIssue}\n {publicationPages}\n {publicationLinks}\n \n );\n};\n","import { useEffect, useState } from 'react';\n\nexport const useIsMounted = () => {\n const [isMounted, setIsMounted] = useState(false);\n\n useEffect(() => {\n setIsMounted(true);\n }, []);\n\n return isMounted;\n};\n"],"names":["EmployeeDetails","React","isBaseEntry","entry","undefined","lines","renderBaseEntry","heading","headingUrl","Link","className","href","label","map","line","lineIdx","key","renderEntry","this","ResearchPublication","researchPublicationViewModel","renderArea","area","id","hasCategories","categories","length","some","x","entries","hasEntries","AccordionItem","headerContent","displayName","contentSpacing","category","renderEntries","idx","render","areas","props","List","items","renderItem","concat","authors","yearPublished","title","referenceTitle","referenceEditors","publisherName","isArticle","forceNonItalicTitle","isbn","volume","issue","pages","links","addDot","text","lastIndexOf","publicationPages","publisher","publicationTitle","publicationYearPublished","publicationReferenceTitle","publicationReferenceEditors","publicationLinks","getLinkDetails","link","isTypeToShow","urlType","LinkComponent","url","variant","LinkVariant","LightBlack","publicationIsbn","publicationVolume","publicationIssue","volumeAndIssue","useIsMounted","isMounted","setIsMounted","useState","useEffect"],"sourceRoot":""}