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AQb,KAAKF,MAAMD,cAAcsB,oBAKhDnB,KAAKF,MAAMD,cAAcuB,YAAU,gBAC/BI,KAAE,CAACjC,UAAU,+B,gBACTkC,OAAI,CAAClC,UAAU,uC,gBACfkC,OAAI,CACDlC,UAAU,6BACVqB,wBAAyB,CAAEC,OAAQb,KAAKF,MAAM8B,kB,gBAEjDH,OAAI,CACDlC,UAAU,+BACVqB,wBAAyB,CACrBC,OAAQb,KAAKF,MAAMD,cAAcuB,uB,mBAxF7E,CAA4BS,EAAAA,W,gNCA5B,IAEA,EAF0B/B,SAAAA,GAAS,OAAM,gBAALD,EAAa,KAAKC","sources":["webpack://gyldendal-uddannelse/./src/Foundation/Frontend/ReactComponents/Shared/AnimationComponents/view-more-section.tsx","webpack://gyldendal-uddannelse/./src/Foundation/Frontend/hooks/useIsOverflow.ts","webpack://gyldendal-uddannelse/./src/Foundation/Frontend/ReactComponents/System/system-details.js","webpack://gyldendal-uddannelse/./src/Foundation/Frontend/ReactViews/SystemDetails/system-details-view.js"],"sourcesContent":["import React, { ReactNode, useState } from \"react\";\r\nimport classNames from \"classnames\";\r\nimport { useIsOverflow } from \"hooks/useIsOverflow\";\r\n\r\ninterface IViewMoreSectionProps {\r\n    children: ReactNode;\r\n}\r\nconst ViewMoreSection = ({ children }: IViewMoreSectionProps) => {\r\n    const { ref, isOverflow } = useIsOverflow();\r\n\r\n    const [isOpen, setIsOpen] = useState(false);\r\n    const toggle = () => setIsOpen(!isOpen);\r\n\r\n    const rootClasses = classNames({\r\n        \"view-more-section\": true,\r\n        \"no-shadow\": !isOverflow || isOpen,\r\n        open: isOpen\r\n    });\r\n    const arrowClasses = classNames({\r\n        \"arrow-icon\": isOverflow || isOpen,\r\n        \"arrow-icon-down\": !isOpen,\r\n        \"arrow-icon-up\": isOpen\r\n    });\r\n\r\n    return (\r\n        <>\r\n            <div className={rootClasses} ref={ref}>\r\n                {children}\r\n            </div>\r\n            <button\r\n                type=\"button\"\r\n                className=\"view-more-btn\"\r\n                onClick={toggle}\r\n                aria-label={`${isOpen ? \"Vis mindre\" : \"Vis mere\"}`}\r\n                aria-expanded={isOpen}\r\n            >\r\n                <div className={arrowClasses}></div>\r\n            </button>\r\n        </>\r\n    );\r\n};\r\n\r\nexport default ViewMoreSection;\r\n","import { useLayoutEffect, useRef, useState } from \"react\";\r\n\r\nexport const useIsOverflow = (callback?: (hasOverflow: boolean) => void) => {\r\n    const [isOverflow, setIsOverflow] = useState(false);\r\n    const ref = useRef<HTMLDivElement>(null);\r\n\r\n    useLayoutEffect(() => {\r\n        const { current } = ref;\r\n\r\n        const trigger = () => {\r\n            const hasOverflow =\r\n                (current as HTMLDivElement).scrollHeight > (current as HTMLDivElement).clientHeight;\r\n\r\n            setIsOverflow(hasOverflow);\r\n\r\n            if (callback) callback(hasOverflow);\r\n        };\r\n        if (current != null) {\r\n            trigger();\r\n        }\r\n    }, [callback, ref]);\r\n\r\n    return { ref, isOverflow };\r\n};\r\n","import React, { Component } from \"react\";\r\nimport ViewMoreSection from \"ReactComponents/Shared/AnimationComponents/view-more-section\";\r\n\r\nclass SystemDetails extends Component {\r\n    constructor(props) {\r\n        super(props);\r\n    }\r\n\r\n    render() {\r\n        return (\r\n            <div className=\"system-details-container\">\r\n                <div className=\"system-details__img\">\r\n                    <div className=\"system-details__img__inner\">\r\n                        {this.props.SystemDetails.ImageUrls &&\r\n                            this.props.SystemDetails.ImageUrls.map((image, index) => {\r\n                                return (\r\n                                    <img\r\n                                        loading=\"lazy\"\r\n                                        key={index}\r\n                                        src={image}\r\n                                        alt={`Udvalgte forsider i ${this.props.SystemDetails.Title}-serien`}\r\n                                    />\r\n                                );\r\n                            })}\r\n                    </div>\r\n                </div>\r\n                <div className=\"system-details__meta\">\r\n                    <h1\r\n                        className=\"system-details__meta__title\"\r\n                        dangerouslySetInnerHTML={{ __html: this.props.SystemDetails.Title }}\r\n                    />\r\n                    <p\r\n                        className=\"system-details__meta__subtitle\"\r\n                        dangerouslySetInnerHTML={{ __html: this.props.SystemDetails.SubTitle }}\r\n                    />\r\n                    <ViewMoreSection>\r\n                        <div\r\n                            className=\"content-rich-text\"\r\n                            dangerouslySetInnerHTML={{ __html: this.props.SystemDetails.Description }}\r\n                        />\r\n                    </ViewMoreSection>\r\n                </div>\r\n                {(this.props.SystemDetails.MaterialsCount > 0 ||\r\n                    this.props.SystemDetails.SubSystemsCount > 0 ||\r\n                    this.props.SystemDetails.GradesText) && (\r\n                    <div className=\"system-details__facts-container\">\r\n                        <h3\r\n                            className=\"system-details__facts__title\"\r\n                            dangerouslySetInnerHTML={{ __html: this.props.RightSectionTitle }}\r\n                        />\r\n                        <ul className=\"system-details__facts__list\">\r\n                            {this.props.SystemDetails.MaterialsCount > 0 && (\r\n                                <li className=\"system-details__facts__item\">\r\n                                    <span className=\"system-details__facts__icon material\" />\r\n                                    <span\r\n                                        className=\"system-details__facts__key\"\r\n                                        dangerouslySetInnerHTML={{ __html: this.props.MaterialsLablelText }}\r\n                                    />\r\n                                    <span\r\n                                        className=\"system-details__facts__value\"\r\n                                        dangerouslySetInnerHTML={{\r\n                                            __html: this.props.SystemDetails.MaterialsCount\r\n                                        }}\r\n                                    />\r\n                                </li>\r\n                            )}\r\n                            {this.props.SystemDetails.SubSystemsCount > 0 && (\r\n                                <li className=\"system-details__facts__item\">\r\n                                    <span className=\"system-details__facts__icon subsystems\" />\r\n                                    <span\r\n                                        className=\"system-details__facts__key\"\r\n                                        dangerouslySetInnerHTML={{ __html: this.props.SubSystemsLabelText }}\r\n                                    />\r\n                                    <span\r\n                                        className=\"system-details__facts__value\"\r\n                                        dangerouslySetInnerHTML={{\r\n                                            __html: this.props.SystemDetails.SubSystemsCount\r\n                                        }}\r\n                                    />\r\n                                </li>\r\n                            )}\r\n                            {this.props.SystemDetails.GradesText && (\r\n                                <li className=\"system-details__facts__item\">\r\n                                    <span className=\"system-details__facts__icon levels\" />\r\n                                    <span\r\n                                        className=\"system-details__facts__key\"\r\n                                        dangerouslySetInnerHTML={{ __html: this.props.GradeLabelText }}\r\n                                    />\r\n                                    <span\r\n                                        className=\"system-details__facts__value\"\r\n                                        dangerouslySetInnerHTML={{\r\n                                            __html: this.props.SystemDetails.GradesText\r\n                                        }}\r\n                                    />\r\n                                </li>\r\n                            )}\r\n                        </ul>\r\n                    </div>\r\n                )}\r\n            </div>\r\n        );\r\n    }\r\n}\r\nexport default SystemDetails;\r\n","import * as React from \"react\";\r\nimport SystemDetails from \"@/ReactComponents/System/system-details\";\r\n\r\nconst SystemDetailsView = props => <SystemDetails {...props} />;\r\n\r\nexport default SystemDetailsView;\r\n"],"names":["children","useIsOverflow","callback","useState","isOverflow","setIsOverflow","ref","useRef","useLayoutEffect","hasOverflow","current","scrollHeight","clientHeight","isOpen","setIsOpen","rootClasses","classNames","open","arrowClasses","div","className","button","type","onClick","aria-label","aria-expanded","SystemDetails","props","render","this","ImageUrls","map","image","index","img","loading","key","src","alt","Title","h1","dangerouslySetInnerHTML","__html","p","SubTitle","ViewMoreSection","Description","MaterialsCount","SubSystemsCount","GradesText","h3","RightSectionTitle","ul","li","span","MaterialsLablelText","SubSystemsLabelText","GradeLabelText","Component"],"sourceRoot":""}