{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/blocks/frontend.js"],"names":["displayAllCharts","allchartsdata","forEach","chart","chartctx","document","querySelector","chartID","labels","data","chartdata","bgColors","chartBgColor","title","currentChartType","chartType","indexAxis","chartTypeArray","split","length","currentChartTypeArray","slice","join","myChart","Chart","type","datasets","backgroundColor","hoverOffset","options","responsive","plugins","display","text","legend"],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;AClFA,SAASA,gBAAT,GAA4B;AAC3BC,eAAa,CAACC,OAAd,CAAuBC,KAAD,IAAW;AAChC,QAAIC,QAAQ,GAAGC,QAAQ,CAACC,aAAT,CAAwB,IAAGH,KAAK,CAACI,OAAQ,EAAzC,CAAf;AAEA,QAAIC,MAAM,GAAGL,KAAK,CAACK,MAAN,GAAeL,KAAK,CAACK,MAArB,GAA8B,CAAC,SAAD,EAAY,SAAZ,EAAuB,QAAvB,CAA3C;AACA,QAAIC,IAAI,GAAGN,KAAK,CAACO,SAAN,GAAkBP,KAAK,CAACO,SAAxB,GAAoC,CAAC,GAAD,EAAM,EAAN,EAAU,GAAV,CAA/C;AACA,QAAIC,QAAQ,GAAGR,KAAK,CAACS,YAAN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,CAA3B,EAA8B;AAC7BnB,kBAAgB;AAChB,C","file":"frontendscript.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/blocks/frontend.js\");\n","function displayAllCharts() {\n\tallchartsdata.forEach((chart) => {\n\t\tlet chartctx = document.querySelector(`#${chart.chartID}`);\n\n\t\tlet labels = chart.labels ? chart.labels : ['English', 'Spanish', 'French'];\n\t\tlet data = chart.chartdata ? chart.chartdata : [300, 50, 100];\n\t\tlet bgColors = chart.chartBgColor\n\t\t\t? chart.chartBgColor\n\t\t\t: ['#ff6385', '#36a3eb', '#ffcc56', '#812ffe', '#00e893'];\n\t\tlet title = chart.title\n\t\t\t? chart.title\n\t\t\t: 'Mostly spoken languages across the world';\n\n\t\tlet currentChartType = chart.chartType;\n\t\tlet indexAxis = null;\n\n\t\tlet chartTypeArray = chart.chartType.split('');\n\t\tif (chartTypeArray.length > 9) {\n\t\t\tlet currentChartTypeArray = chartTypeArray.slice(11);\n\t\t\tcurrentChartType = currentChartTypeArray.join('');\n\t\t\tindexAxis = 'y';\n\t\t}\n\n\t\tif (chartctx) {\n\t\t\tvar myChart = new Chart(chartctx, {\n\t\t\t\ttype: currentChartType,\n\t\t\t\tdata: {\n\t\t\t\t\tlabels: labels,\n\t\t\t\t\tdatasets: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdata: data,\n\t\t\t\t\t\t\tbackgroundColor: bgColors,\n\t\t\t\t\t\t\thoverOffset: 2,\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t\toptions: {\n\t\t\t\t\tindexAxis: indexAxis,\n\t\t\t\t\tresponsive: true,\n\t\t\t\t\tplugins: {\n\t\t\t\t\t\ttitle: {\n\t\t\t\t\t\t\tdisplay: true,\n\t\t\t\t\t\t\ttext: title,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tlegend: {\n\t\t\t\t\t\t\tdisplay:\n\t\t\t\t\t\t\t\tcurrentChartType === 'bar' || currentChartType === 'line'\n\t\t\t\t\t\t\t\t\t? false\n\t\t\t\t\t\t\t\t\t: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t});\n}\nif (allchartsdata.length > 0) {\n\tdisplayAllCharts();\n}\n"],"sourceRoot":""}