{"version":3,"sources":["components/year-review/components/table/YRTable.jsx","components/year-review/components/toggle/YRToggle.jsx","components/year-review/assets/json lazy /^/.//.*/.json$/ groupOptions: {} namespace object","components/year-review/assets/json lazy /^/.//.*//data/.json$/ groupOptions: {} namespace object","components/year-review/assets/json lazy /^/.//.*//config/.json$/ groupOptions: {} namespace object","components/year-review/services/JsonService.js","components/year-review/components/table/YRTableMap.jsx","components/year-review/components/YRGraph.jsx","components/year-review/components/legend/index.js","components/year-review/services/SvgSprite.js","components/year-review/YearReview.js","components/year-review/index.js","components/year-review/services/FormatGraphDataService.js"],"names":["YRTable","name","data","unit","style","className","map","item","itemName","itemValue","values","Object","nestedItem","nestedName","nestedValue","FormatGraphDataService","addCommas","defaultProps","YRToggle","showGraph","onClick","showAs","graph","table","lang","document","documentElement","role","type","tabIndex","webpackAsyncContext","req","__webpack_require__","o","Promise","resolve","then","e","Error","code","ids","id","t","keys","module","exports","JsonService","fetchDataJson","url","a","fetch","method","credentials","response","jsonResponse","json","refactorPropertiesToValues","newData","element","objectWithValues","forEach","key","objectElement","Array","isArray","mergeJsons","config","clone","value","options","deepmerge","emptyTarget","arrayMerge","target","source","destination","slice","i","shouldClone","isMergeableObject","indexOf","push","YRTableMap","country","useState","mapData","setMapData","useEffect","yearReviewContainer","querySelector","year","dataset","fetchMapData","index","valuePercentage","FallBack","YRGraph","Graph","chartContainerRef","useRef","graphReady","setGraphReady","setShowGraph","hasTableToggle","io","window","IntersectionObserver","entries","entry","isIntersecting","disconnect","observe","current","lazy","ref","hidden","fallback","isReady","showGraphValue","focus","yrSections","querySelectorAll","yrLegends","yrLegend","addEventListener","event","preventDefault","sectionSlug","currentTarget","sectionDiv","scrollIntoView","behavior","highlightLegend","pageYOffset","offsetHeight","offset","scrollTop","innerHeight","yrSection","sectionTop","getBoundingClientRect","top","allYRLegends","lastYRLegend","length","classList","remove","add","clearTimeout","setTimeout","history","replaceState","yrLegendBySlug","svgSpriteResponse","text","svgSpriteBody","container","createElement","display","innerHTML","body","insertBefore","childNodes","YearReview","init","dataWithValues","graphData","graphDiv","ReactDOM","render","sortByValue","sort","b","sortByName","first","x","y","toLocaleString","twoDecimalPlaces","number","Number","parseFloat","toFixed","replace","formatMultipleValues","stackedItem","itemValues"],"mappings":"+FAAA,wBAMMA,EAAU,SAAC,GAEV,IADHC,EACE,EADFA,KAAMC,EACJ,EADIA,KAGFC,EAFF,EADUC,MAGRD,KAGJ,OACI,qBAAKE,UAAU,qCAAf,SACI,wBAAOA,UAAU,WAAjB,UACI,gCACI,+BACI,uBACA,6BAAKJ,SAGb,gCACKC,EAAKI,KAAI,SAACC,GACP,IAAMC,EAAWD,EAAKN,KAClBQ,EAAYF,EAAKG,OAErB,GAAyB,qBAAdH,EAAKN,MAA+C,qBAAhBM,EAAKG,OAIpD,MAAyB,kBAAdD,EACAE,OAAOD,OAAOD,GAAWH,KAAI,SAACM,GACjC,IAAMC,EAAaD,EAAWX,KACxBa,EAAcF,EAAWF,OAE/B,MAA2B,kBAAhBI,GAKP,+BACI,+BAAKD,EAAL,IAAiB,4BAAIL,OACrB,+BACKM,EACAX,OAJT,UAAYU,EAAZ,YAA0BC,OAYlC,+BACI,6BAAKN,IACJC,GACG,+BACKM,IAAuBC,UAAUP,GACjCN,OALb,UAAYK,EAAZ,YAAwBC,eAiBpDT,EAAQiB,aAAe,CACnBb,MAAO,IAUIJ,O,iCCjFf,gBA4DekB,IAzDE,SAAC,GAA4B,IAA1BC,EAAyB,EAAzBA,UAAWC,EAAc,EAAdA,QACvBC,EAAS,UACTC,EAAQ,QACRC,EAAQ,QAEJC,EAASC,SAASC,gBAAlBF,KAYR,OAVIA,GAAiB,OAATA,GACRH,EAAS,gBACTC,EAAQ,YACRC,EAAQ,WACDC,GAAiB,OAATA,IACfH,EAAS,gBACTC,EAAQ,UACRC,EAAQ,SAIR,sBACIlB,UAAU,YACVsB,KAAK,UAFT,UAII,sBAAMtB,UAAU,kBAAhB,SAAmCgB,IAEnC,sBAAKhB,UAAU,qBA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Aa,SAAC3K,EAAM4K,GAAP,OAEhB5K,EAAKyK,MAAK,SAACI,EAAGC,GAAJ,OAAWD,EAAE9K,OAAS6K,GAAS,EAAIE,EAAE/K,OAAS6K,EAAQ,EAAI,MALtE/J,EAOKC,UAAY,SAAA+J,GAAC,OAOhBA,EAAEE,eAAe,OAdnBlK,EAiBKmK,iBAAmB,SAACH,GACvB,IAAII,EAASC,OAAOC,WAAWN,GAAGO,QAAQ,GAG1C,OAFAH,EAASA,EAAOI,QAAQ,IAAK,MAnB/BxK,EAwBKyK,qBAAuB,SAAAtL,GAAI,OAAIA,EAAKI,KAAI,SAACC,GAC5C,IAAMkL,EAAc,GAQpB,OANAA,EAAYxL,KAAOM,EAAKN,KAExBM,EAAKG,OAAOkD,SAAQ,SAAC8H,EAAY7F,GAC7B4F,EAAY,SAAD,OAAU5F,IAAW6F,EAAWhL,UAGxC+K,MAIA1K,Q","file":"js/year-review.95214d3d.chunk.js","sourcesContent":["/*eslint-disable array-callback-return */\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\nimport FormatGraphDataService from 'components/year-review/services/FormatGraphDataService';\n\nconst YRTable = ({\n name, data, style,\n}) => {\n const {\n unit,\n } = style;\n\n return (\n
\n
\n \n \n | \n {name} | \n
\n \n \n {data.map((item) => {\n const itemName = item.name;\n let itemValue = item.values;\n\n if (typeof item.name === 'undefined' || typeof item.values === 'undefined') {\n return;\n }\n\n if (typeof itemValue === 'object') {\n return Object.values(itemValue).map((nestedItem) => {\n const nestedName = nestedItem.name;\n const nestedValue = nestedItem.values;\n\n if (typeof nestedValue === 'object') {\n return false;\n }\n\n return (\n \n {nestedName} {itemName} | \n \n {nestedValue}\n {unit}\n | \n
\n );\n });\n }\n\n return (\n \n {itemName} | \n {itemValue && (\n \n {FormatGraphDataService.addCommas(itemValue)}\n {unit}\n | \n )}\n
\n );\n })}\n \n
\n
\n );\n};\n\nYRTable.defaultProps = {\n style: {},\n};\n\nYRTable.propTypes = {\n name: PropTypes.string.isRequired,\n type: PropTypes.string.isRequired,\n data: PropTypes.arrayOf(PropTypes.any).isRequired,\n style: PropTypes.objectOf(PropTypes.any),\n};\n\nexport default YRTable;\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst YRToggle = ({ showGraph, onClick }) => {\n let showAs = 'Show as';\n let graph = 'Graph';\n let table = 'Table';\n\n const { lang } = document.documentElement;\n\n if (lang && lang === 'fr') {\n showAs = 'Montrer comme';\n graph = 'Graphique';\n table = 'Tableau';\n } else if (lang && lang === 'nl') {\n showAs = 'Geef weer als';\n graph = 'Grafiek';\n table = 'Tabel';\n }\n\n return (\n \n
{showAs}\n\n
\n \n \n
\n
\n );\n};\n\nYRToggle.propTypes = {\n showGraph: PropTypes.bool.isRequired,\n onClick: PropTypes.func.isRequired,\n};\n\nexport default YRToggle;\n","var map = {\n\t\"./2018/config.json\": [\n\t\t319,\n\t\t4\n\t],\n\t\"./2018/data-map-belgium.json\": [\n\t\t593,\n\t\t40\n\t],\n\t\"./2018/data-map-world.json\": [\n\t\t594,\n\t\t41\n\t],\n\t\"./2018/data.json\": [\n\t\t320,\n\t\t5\n\t],\n\t\"./2019/config.json\": [\n\t\t321,\n\t\t6\n\t],\n\t\"./2019/data-map-belgium.json\": [\n\t\t595,\n\t\t42\n\t],\n\t\"./2019/data-map-world.json\": [\n\t\t596,\n\t\t43\n\t],\n\t\"./2019/data.json\": [\n\t\t322,\n\t\t7\n\t],\n\t\"./2020/config.json\": [\n\t\t323,\n\t\t8\n\t],\n\t\"./2020/data-map-belgium.json\": [\n\t\t597,\n\t\t44\n\t],\n\t\"./2020/data-map-world.json\": [\n\t\t598,\n\t\t45\n\t],\n\t\"./2020/data.json\": [\n\t\t324,\n\t\t9\n\t],\n\t\"./2021/config.json\": [\n\t\t325,\n\t\t10\n\t],\n\t\"./2021/data-map-belgium.json\": [\n\t\t599,\n\t\t46\n\t],\n\t\"./2021/data-map-world.json\": [\n\t\t600,\n\t\t47\n\t],\n\t\"./2021/data.json\": [\n\t\t326,\n\t\t11\n\t],\n\t\"./2022/config.json\": [\n\t\t327,\n\t\t12\n\t],\n\t\"./2022/data-map-belgium.json\": [\n\t\t601,\n\t\t48\n\t],\n\t\"./2022/data-map-world.json\": [\n\t\t602,\n\t\t49\n\t],\n\t\"./2022/data.json\": [\n\t\t328,\n\t\t13\n\t],\n\t\"./2022/raw.json\": [\n\t\t603,\n\t\t50\n\t],\n\t\"./2023/config.json\": [\n\t\t329,\n\t\t14\n\t],\n\t\"./2023/data-map-belgium.json\": [\n\t\t604,\n\t\t51\n\t],\n\t\"./2023/data-map-world.json\": [\n\t\t605,\n\t\t52\n\t],\n\t\"./2023/data.json\": [\n\t\t330,\n\t\t15\n\t]\n};\nfunction webpackAsyncContext(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\treturn Promise.resolve().then(function() {\n\t\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\t\te.code = 'MODULE_NOT_FOUND';\n\t\t\tthrow e;\n\t\t});\n\t}\n\n\tvar ids = map[req], id = ids[0];\n\treturn __webpack_require__.e(ids[1]).then(function() {\n\t\treturn __webpack_require__.t(id, 3);\n\t});\n}\nwebpackAsyncContext.keys = function webpackAsyncContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackAsyncContext.id = 318;\nmodule.exports = webpackAsyncContext;","var map = {\n\t\"./2018/data.json\": [\n\t\t320,\n\t\t5\n\t],\n\t\"./2019/data.json\": [\n\t\t322,\n\t\t7\n\t],\n\t\"./2020/data.json\": [\n\t\t324,\n\t\t9\n\t],\n\t\"./2021/data.json\": [\n\t\t326,\n\t\t11\n\t],\n\t\"./2022/data.json\": [\n\t\t328,\n\t\t13\n\t],\n\t\"./2023/data.json\": [\n\t\t330,\n\t\t15\n\t]\n};\nfunction webpackAsyncContext(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\treturn Promise.resolve().then(function() {\n\t\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\t\te.code = 'MODULE_NOT_FOUND';\n\t\t\tthrow e;\n\t\t});\n\t}\n\n\tvar ids = map[req], id = ids[0];\n\treturn __webpack_require__.e(ids[1]).then(function() {\n\t\treturn __webpack_require__.t(id, 3);\n\t});\n}\nwebpackAsyncContext.keys = function webpackAsyncContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackAsyncContext.id = 579;\nmodule.exports = webpackAsyncContext;","var map = {\n\t\"./2018/config.json\": [\n\t\t319,\n\t\t4\n\t],\n\t\"./2019/config.json\": [\n\t\t321,\n\t\t6\n\t],\n\t\"./2020/config.json\": [\n\t\t323,\n\t\t8\n\t],\n\t\"./2021/config.json\": [\n\t\t325,\n\t\t10\n\t],\n\t\"./2022/config.json\": [\n\t\t327,\n\t\t12\n\t],\n\t\"./2023/config.json\": [\n\t\t329,\n\t\t14\n\t]\n};\nfunction webpackAsyncContext(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\treturn Promise.resolve().then(function() {\n\t\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\t\te.code = 'MODULE_NOT_FOUND';\n\t\t\tthrow e;\n\t\t});\n\t}\n\n\tvar ids = map[req], id = ids[0];\n\treturn __webpack_require__.e(ids[1]).then(function() {\n\t\treturn __webpack_require__.t(id, 3);\n\t});\n}\nwebpackAsyncContext.keys = function webpackAsyncContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackAsyncContext.id = 580;\nmodule.exports = webpackAsyncContext;","/* eslint no-param-reassign: [\"error\", { \"props\": false }] */\n\nimport deepmerge from 'deepmerge';\n\nclass JsonService {\n static fetchDataJson = async url => {\n const response = await fetch(url, {\n method: 'GET',\n credentials: 'same-origin',\n });\n\n const jsonResponse = response.json();\n\n return jsonResponse;\n };\n\n static refactorPropertiesToValues = data => {\n const newData = data;\n\n newData.map(element => {\n const objectWithValues = element;\n\n Object.keys(element).forEach(key => {\n const objectElement = element[key];\n\n if (key !== \"id\") {\n if (Array.isArray(objectElement)) {\n element[key] = JsonService.refactorPropertiesToValues(\n objectElement\n );\n }\n\n objectWithValues.values = element[key];\n delete objectWithValues[key];\n }\n\n return false;\n });\n\n return objectWithValues;\n });\n\n return newData;\n };\n\n static mergeJsons = (config, data) => {\n const emptyTarget = value => (Array.isArray(value) ? [] : {});\n const clone = (value, options) => deepmerge(emptyTarget(value), value, options);\n\n const combineMerge = (target, source, options) => {\n const destination = target.slice();\n\n source.forEach((e, i) => {\n if (typeof destination[i] === 'undefined') {\n const cloneRequested = options.clone !== false;\n const shouldClone = cloneRequested && options.isMergeableObject(e);\n\n destination[i] = shouldClone ? clone(e, options) : e;\n } else if (options.isMergeableObject(e)) {\n destination[i] = deepmerge(target[i], e, options);\n } else if (target.indexOf(e) === -1) {\n destination.push(e);\n }\n });\n\n return destination;\n };\n\n return deepmerge(\n config,\n data,\n { arrayMerge: combineMerge },\n );\n };\n}\n\nexport default JsonService;\n","/* eslint-disable array-callback-return */\nimport React, { useState, useEffect } from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport FormatGraphDataService from \"components/year-review/services/FormatGraphDataService\";\n\nconst YRTableMap = ({ name, data, style }) => {\n const { unit, country } = style;\n\n const [mapData, setMapData] = useState(null);\n\n useEffect(() => {\n const fetchMapData = async () => {\n const yearReviewContainer = document.querySelector(\"[data-year-review]\");\n const { year } = yearReviewContainer.dataset;\n const { data } = await import(\n `components/year-review/assets/json/${year}/data-map-${country}.json`\n );\n\n setMapData(data);\n };\n\n fetchMapData();\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n \n
\n \n \n | \n {name} | \n
\n \n \n {data.map((item, index) => {\n const itemName = item.name;\n let itemValue = \"\";\n\n if (mapData) {\n if (\n country === \"world\" &&\n typeof mapData[item.code] !== \"undefined\"\n ) {\n itemValue = mapData[item.code].valuePercentage;\n } else {\n itemValue = mapData[item.code];\n }\n }\n\n if (!itemValue) return;\n\n return (\n \n {itemName} | \n {itemValue && (\n \n {FormatGraphDataService.addCommas(itemValue)}\n {unit}\n | \n )}\n
\n );\n })}\n \n
\n
\n );\n};\n\nYRTableMap.defaultProps = {\n style: {},\n};\n\nYRTableMap.propTypes = {\n name: PropTypes.string.isRequired,\n type: PropTypes.string.isRequired,\n data: PropTypes.arrayOf(PropTypes.any).isRequired,\n style: PropTypes.objectOf(PropTypes.any),\n};\n\nexport default YRTableMap;\n","import React, { useState, useEffect, useRef, Suspense, lazy } from 'react';\nimport PropTypes from 'prop-types';\n\nimport YRTable from 'components/year-review/components/table/YRTable';\nimport YRTableMap from 'components/year-review/components/table/YRTableMap';\nimport YRToggle from 'components/year-review/components/toggle/YRToggle';\n\nconst FallBack = () => (\n \n);\n\nconst YRGraph = ({ data }) => {\n const chartContainerRef = useRef(null);\n\n const [graphReady, setGraphReady] = useState(false);\n const [showGraph, setShowGraph] = useState(true);\n\n const { type, style, name } = data;\n const hasTableToggle = type !== 'LIST' && type !== 'STATS' && type !== 'TABLE' && type !== 'MULTIPIE';\n let Graph;\n\n useEffect(() => {\n let io = null;\n\n if (!!window.IntersectionObserver) {\n io = new IntersectionObserver((entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n setGraphReady(true);\n io.disconnect();\n }\n });\n });\n\n io.observe(chartContainerRef.current);\n } else {\n setGraphReady(true);\n }\n\n return () => {\n io.disconnect();\n };\n }, [chartContainerRef]);\n\n switch (type) {\n case 'BARCHART':\n Graph = lazy(() => import('./barchart/YRBarChart'));\n break;\n case 'STACKED-BARCHART':\n Graph = lazy(() => import('./barchart/YRStackedBarChart'));\n break;\n case 'LINECHART':\n Graph = lazy(() => import('./linechart/YRLineChart'));\n break;\n case 'PIECHART':\n Graph = lazy(() => import('./piechart/YRPieChart'));\n break;\n case 'LIST':\n Graph = lazy(() => import('./list/YRList'));\n break;\n case 'STATS':\n Graph = lazy(() => import('./stats/YRStats'));\n break;\n case 'TABLE':\n Graph = lazy(() => import('./table/YRBigTable'));\n break;\n case 'MULTIPIE':\n Graph = lazy(() => import('./piechart/YRMultiPie'));\n break;\n case 'MAP':\n Graph = lazy(() => import('./map/YRMap'));\n break;\n default:\n }\n\n return (\n \n
\n
\n }>\n \n \n
\n
\n {(type && type === 'MAP') ? (\n \n ) : (\n \n )}\n
\n\n {hasTableToggle && (\n
{\n setShowGraph(showGraphValue);\n chartContainerRef.current.focus();\n }}\n />\n )}\n \n
\n );\n};\n\nYRGraph.propTypes = {\n data: PropTypes.objectOf(PropTypes.any).isRequired,\n};\n\n\nexport default YRGraph;\n","/*eslint-disable no-restricted-globals*/\nconst yrSections = document.querySelectorAll('[data-yr-section]');\nconst yrLegends = document.querySelectorAll('[data-yr-legend]');\n\nconst scrollOffset = 50;\n\nlet t = null;\n\n[...yrLegends].forEach((yrLegend) => {\n yrLegend.addEventListener('click', (event) => {\n event.preventDefault();\n\n const sectionSlug = event.currentTarget.dataset.yrLegend;\n const sectionDiv = document.querySelector(`[data-yr-section=\"${sectionSlug}\"]`);\n\n if (sectionDiv) {\n sectionDiv.scrollIntoView({ behavior: 'smooth' });\n }\n });\n});\n\nconst highlightLegend = () => {\n const { pageYOffset } = window;\n const { documentElement } = document;\n const { offsetHeight } = documentElement;\n const offset = documentElement.scrollTop + window.innerHeight;\n\n [...yrSections].forEach((yrSection) => {\n const sectionTop = yrSection.getBoundingClientRect().top;\n const sectionSlug = yrSection.dataset.yrSection;\n\n if (offset >= offsetHeight) {\n const allYRLegends = document.querySelectorAll('[data-yr-legend]');\n const lastYRLegend = allYRLegends[allYRLegends.length - 1];\n\n [...yrLegends].forEach((yrLegend) => {\n yrLegend.classList.remove('is-active');\n });\n\n lastYRLegend.classList.add('is-active');\n\n clearTimeout(t);\n\n t = setTimeout(() => {\n history.replaceState(null, null, `#${lastYRLegend.dataset.yrLegend}`);\n }, 200);\n } else if (((sectionTop + pageYOffset) - scrollOffset) <= pageYOffset) {\n const yrLegendBySlug = document.querySelector(`[data-yr-legend=\"${sectionSlug}\"]`);\n\n [...yrLegends].forEach((yrLegend) => {\n yrLegend.classList.remove('is-active');\n });\n\n yrLegendBySlug.classList.add('is-active');\n\n clearTimeout(t);\n\n t = setTimeout(() => {\n history.replaceState(null, null, `#${yrLegendBySlug.dataset.yrLegend}`);\n }, 200);\n }\n });\n};\n\nwindow.addEventListener('scroll', highlightLegend);\nhighlightLegend();\n","(async () => {\n const svgSpriteResponse = await fetch('/themes/custom/drupack/resources/components/year-review/assets/svg-sprite.svg', {\n credentials: 'include',\n });\n const svgSpriteBody = await svgSpriteResponse.text();\n\n const container = document.createElement('div');\n container.classList.add('yr-svg-sprite');\n container.style.display = 'none';\n container.innerHTML = svgSpriteBody;\n document.body.insertBefore(container, document.body.childNodes[0]);\n})();\n","import React from 'react';\nimport ReactDOM from 'react-dom';\n\nimport JsonService from 'components/year-review/services/JsonService';\nimport YRGraph from 'components/year-review/components/YRGraph';\n\nimport 'components/year-review/components/legend/index';\nimport 'components/year-review/services/SvgSprite';\n\nclass YearReview {\n init = async (lang, year) => {\n const { data } = await import(`components/year-review/assets/json/${year}/data.json`);\n const { config } = await import(`components/year-review/assets/json/${year}/config.json`);\n\n if (config && data) {\n const dataWithValues = JsonService.refactorPropertiesToValues(data);\n const graphsData = JsonService.mergeJsons(config[lang].config, dataWithValues);\n\n graphsData.forEach(graphData => {\n const graphDiv = document.querySelector(`[data-graph-id=\"${graphData.id}\"]`);\n\n if (graphDiv) {\n ReactDOM.render(\n ,\n graphDiv,\n );\n }\n });\n }\n };\n}\n\nexport default YearReview;\n","import YearReview from './YearReview';\n\nconst yearReviewContainer = document.querySelector('[data-year-review]');\n\nif (yearReviewContainer) {\n const { lang, year } = yearReviewContainer.dataset;\n\n const yearReview = new YearReview();\n yearReview.init(lang, year);\n}\n","class FormatGraphDataService {\n static sortByValue = data => [...data].sort((a, b) => ((a.values < b.values) ? 1 : -1));\n\n static sortByName = (data, first) =>\n // eslint-disable-next-line no-nested-ternary\n data.sort((x, y) => (x.name === first ? -1 : y.name === first ? 1 : 0));\n\n static addCommas = x =>\n /* const { lang } = document.documentElement;\n\n if (lang) {\n return x.toLocaleString(lang);\n } */\n\n x.toLocaleString('nl')\n ;\n\n static twoDecimalPlaces = (x) => {\n let number = Number.parseFloat(x).toFixed(2);\n number = number.replace('.', ',');\n\n return number;\n }\n\n static formatMultipleValues = data => data.map((item) => {\n const stackedItem = {};\n\n stackedItem.name = item.name;\n\n item.values.forEach((itemValues, index) => {\n stackedItem[`values${index}`] = itemValues.values;\n });\n\n return stackedItem;\n });\n}\n\nexport default FormatGraphDataService;\n"],"sourceRoot":""}