{"version":3,"file":"6758.c4da108d3a75bb7c542c.js","mappings":"62BAuDA,EArDA,SAAQ,I,mpBAAFA,EACUC,G,wHACFA,G,gBAGVC,IAAAA,oB,MAAAA,WAY2BC,SAASC,cAAc,oBACXC,iBAAiB,UACxCC,SAAQ,SAAUC,GAC1B,IAAIC,EAAOD,EAAGE,aAAa,QAC3B,GAAKD,EAAKE,SAAS,KAAnB,CAGA,IACMC,EADQH,EAAKI,MAAM,KACG,GACtBC,EAA4BV,SAASW,kBAAkBH,GACvDI,EAAoBF,EAA0BA,EAA0BG,OAAS,GAEvFT,EAAGU,iBAAiB,SAAS,SAAUC,GAvB3C,IAGUC,EAqBFD,EAAEE,iBArBAD,EAsBqBJ,EAvBKM,wBAAwBC,IACfC,OAAOC,YAF3B,IAIrBD,OAAOE,SAAS,CACZH,IAAKH,EACLO,SAAU,oB,CAuBtBC,IAAAA,S,MAAAA,W,WACI,OAAM,gBACDC,MAAG,qBACCA,MAAG,CAACC,UAAU,e,gBACVD,MAAG,CAACC,UAAU,mB,gBACVD,MAAG,CACAE,IAAKF,SAAAA,G,EACIG,QAAUH,GAEnBI,wBAAyB,CAAEC,OAAQC,KAAKjC,MAAMkC,mB,mBA7C1E,CAA6BC,EAAAA,W,gNCC7B,IAEA,EAF2BnC,SAAAA,GAAS,OAAM,gBAALD,EAAc,KAAKC","sources":["webpack://gyldendal-uddannelse/./src/Foundation/Frontend/ReactComponents/Article/article-section.js","webpack://gyldendal-uddannelse/./src/Foundation/Frontend/ReactViews/ArticleSection/article-section-view.js"],"sourcesContent":["import React, { Component } from \"react\";\r\n\r\nclass ArticleSection extends Component {\r\n constructor(props) {\r\n super(props);\r\n }\r\n\r\n componentDidMount() {\r\n function scrollToTargetAdjusted(element) {\r\n const headerOffset = 100;\r\n const elementPosition = element.getBoundingClientRect().top;\r\n const offsetPosition = elementPosition + window.pageYOffset - headerOffset;\r\n\r\n window.scrollTo({\r\n top: offsetPosition,\r\n behavior: \"smooth\"\r\n });\r\n }\r\n\r\n const articleContent = document.querySelector(\".article-content\");\r\n const anchorHrefs = articleContent.querySelectorAll(\"[href]\");\r\n anchorHrefs.forEach(function (el) {\r\n var href = el.getAttribute(\"href\");\r\n if (!href.includes(\"#\")) {\r\n return;\r\n }\r\n const parts = href.split(\"#\"); // Split the string at the '#' character\r\n const partAfterHash = parts[1];\r\n const elementsWithNameAttribute = document.getElementsByName(partAfterHash);\r\n const elementToScrollTo = elementsWithNameAttribute[elementsWithNameAttribute.length - 1];\r\n\r\n el.addEventListener(\"click\", function (e) {\r\n e.preventDefault();\r\n scrollToTargetAdjusted(elementToScrollTo);\r\n });\r\n });\r\n }\r\n\r\n render() {\r\n return (\r\n <div>\r\n <div className=\"content-row\">\r\n <div className=\"article-content\">\r\n <div\r\n ref={div => {\r\n this.content = div;\r\n }}\r\n dangerouslySetInnerHTML={{ __html: this.props.Content }}\r\n ></div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n }\r\n}\r\nexport default ArticleSection;\r\n","import * as React from \"react\";\r\nimport ArticleSection from \"@/ReactComponents/Article/article-section\";\r\n\r\nconst ArticleSectionView = props => <ArticleSection {...props} />;\r\n\r\nexport default ArticleSectionView;\r\n"],"names":["ArticleSection","props","componentDidMount","document","querySelector","querySelectorAll","forEach","el","href","getAttribute","includes","partAfterHash","split","elementsWithNameAttribute","getElementsByName","elementToScrollTo","length","addEventListener","e","offsetPosition","preventDefault","getBoundingClientRect","top","window","pageYOffset","scrollTo","behavior","render","div","className","ref","content","dangerouslySetInnerHTML","__html","this","Content","Component"],"sourceRoot":""}