mario-education 2.4.27-admin → 2.4.28-admin

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -21,6 +21,8 @@ var fa = require('react-icons/fa');
21
21
  var tinymceReact = require('@tinymce/tinymce-react');
22
22
  var Chart = _interopDefault(require('react-apexcharts'));
23
23
  var fi = require('react-icons/fi');
24
+ var jsPDF = _interopDefault(require('jspdf'));
25
+ var html2canvas = _interopDefault(require('html2canvas'));
24
26
 
25
27
  // A type of promise-like that resolves synchronously and supports only one observer
26
28
 
@@ -1149,7 +1151,7 @@ var ConferenceRubricList = function ConferenceRubricList() {
1149
1151
  }))));
1150
1152
  };
1151
1153
 
1152
- var styles = {"test":"_3ybTi","body-question-right":"_1H0W8","body-question":"_b-AXV","badge-icon":"_1fgfO","input-color-picker":"_2YR4l","question-list-session-template":"_114IY","delete-column-question-list-sesstion-template":"_qE7J0","conference-rubric-skill-column":"_2BV3o","conference-rubric-additional-row":"_1P4F2","conference-rubric-row-test":"_1SRmg","emotional-response":"_ZDINp","star-rating":"_Kzkzd","list-teacher-compare":"_Q0sF1","teacher-item":"_gu_yD","teacher-item-selected":"_33tYy","btn-filter":"_2VZin","block-filter-component":"_1d6uY","select-filter-component":"_1XSIo","hidden":"_3o8gR","box-select":"_3ru37","radio-btn":"_1tQvL","box-select-label":"_3VNX5"};
1154
+ var styles = {"test":"_3ybTi","body-question-right":"_1H0W8","body-question":"_b-AXV","badge-icon":"_1fgfO","input-color-picker":"_2YR4l","question-list-session-template":"_114IY","delete-column-question-list-sesstion-template":"_qE7J0","conference-rubric-skill-column":"_2BV3o","conference-rubric-additional-row":"_1P4F2","conference-rubric-row-test":"_1SRmg","emotional-response":"_ZDINp","star-rating":"_Kzkzd","list-teacher-compare":"_Q0sF1","teacher-item":"_gu_yD","teacher-item-selected":"_33tYy","btn-filter":"_2VZin","color-filter":"_2M0vR","block-filter-component":"_1d6uY","select-filter-component":"_1XSIo","hidden":"_3o8gR","box-select":"_3ru37","radio-btn":"_1tQvL","box-select-label":"_3VNX5"};
1153
1155
 
1154
1156
  var ToggleInput = function ToggleInput(_ref) {
1155
1157
  var value = _ref.value,
@@ -1532,6 +1534,48 @@ function _objectDestructuringEmpty(obj) {
1532
1534
  if (obj == null) throw new TypeError("Cannot destructure undefined");
1533
1535
  }
1534
1536
 
1537
+ function _unsupportedIterableToArray(o, minLen) {
1538
+ if (!o) return;
1539
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
1540
+ var n = Object.prototype.toString.call(o).slice(8, -1);
1541
+ if (n === "Object" && o.constructor) n = o.constructor.name;
1542
+ if (n === "Map" || n === "Set") return Array.from(o);
1543
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
1544
+ }
1545
+
1546
+ function _arrayLikeToArray(arr, len) {
1547
+ if (len == null || len > arr.length) len = arr.length;
1548
+
1549
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
1550
+
1551
+ return arr2;
1552
+ }
1553
+
1554
+ function _createForOfIteratorHelperLoose(o, allowArrayLike) {
1555
+ var it;
1556
+
1557
+ if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
1558
+ if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
1559
+ if (it) o = it;
1560
+ var i = 0;
1561
+ return function () {
1562
+ if (i >= o.length) return {
1563
+ done: true
1564
+ };
1565
+ return {
1566
+ done: false,
1567
+ value: o[i++]
1568
+ };
1569
+ };
1570
+ }
1571
+
1572
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1573
+ }
1574
+
1575
+ it = o[Symbol.iterator]();
1576
+ return it.next.bind(it);
1577
+ }
1578
+
1535
1579
  var RubricItemColumnOrder;
1536
1580
 
1537
1581
  (function (RubricItemColumnOrder) {
@@ -19675,7 +19719,7 @@ var TYPECHART;
19675
19719
  TYPECHART[TYPECHART["BOTH"] = 3] = "BOTH";
19676
19720
  })(TYPECHART || (TYPECHART = {}));
19677
19721
 
19678
- var styles$1 = {"dashboard-card":"_1Jgr2","quantity-table":"_3Thdy","size-icon":"_1WLBo","block-dashboard":"_10Pgm","size-arrow":"_3jPb_","color-down":"_1c43y","color-up":"_F1afY","box-filter":"_1kqUQ","title-card":"_10hbz","value-card":"_2rmw_","deviant-card":"_1tdQu","filter-card":"_2BvFN","box-skill-item":"_2TBTW","numerical-order":"_3XXJp","backoround-top-skill":"_LCuWQ","color-filter":"_3x9D7","btn-filter":"_2In63","block-collapse":"_1Vhg_","form-date-picker":"_6yLxd","bock-filter-left":"_h74SO","bock-filter-right":"_3e2pi","form-filter-right":"_ntUB6","form-filter-left":"_1DlZ4","bock-filter-wrap":"_1tYDM","title-card-box":"_3hSow","box-item":"_1yuC9","image-no-data":"_2PMoX","image-grade":"_3ZX0b","chart-data":"_2asi-","apexcharts-datalabels":"_muT01","apexcharts-pie-label":"_35BzZ","image-custom":"_3pkbc","image-special-need":"_16MpB","title-dashboard":"_CHu-i","box-chart":"_3Y-Dd","block-filter-right":"_1YJnk","shadow-lg":"_2eMbe","chart-header-wrapper":"_6ZvFg","devide-component":"_24CNV","header-chart":"_2vtSi","header-left":"_IpsVf","icon-chart":"_gzxWe","header-right":"_37IcR","header-title":"_2G6Wz","button-export":"_3xpNv","button-content":"_3H5Ly","button-icon":"_J_n-D","icon-config":"_3AALV","headẻ-chart":"_g5-bn","btn-show-chart":"_2htKu","checkbox-chart":"_1qXAT","column-chart-percent":"_3NgrB","chart-background":"_32fu3","custom-marker":"_DmMzw","mark-custom":"_1eUXn","item-legend":"_3hrrC","label-legend-custom":"_Q-iiW","mark-legend":"_cD4ey","label-chart":"_24PRg","percent":"_2HWhv","listItem":"_2Hdbu","item":"_3RJ2T","student-by-age":"_38ikt","total-student":"_1TnWs","pie-chart":"_3BTJi","options-gender":"_1Ws0m","legend":"_2HnO_","text-lengend":"_2BFJw","student-by-grade":"_2az-l","bubble-chart-custom":"_2j8fp","x-axis-custom-wrap":"_1BN5z","axis-content":"_1rYav","legend-wrap":"_3-zAs","list-percent":"_1PPhv","percent-item":"_1rjWR","chart-custom":"_f-Ti4","chart-buddle":"_TPa6x","title-grade":"_1hZ_V","title-chart":"_pFFg9"};
19722
+ var styles$1 = {"dashboard-card":"_1Jgr2","quantity-table":"_3Thdy","label-chart":"_24PRg","size-icon":"_1WLBo","block-dashboard":"_10Pgm","size-arrow":"_3jPb_","color-down":"_1c43y","color-up":"_F1afY","box-filter":"_1kqUQ","title-card":"_10hbz","value-card":"_2rmw_","deviant-card":"_1tdQu","filter-card":"_2BvFN","box-skill-item":"_2TBTW","numerical-order":"_3XXJp","backoround-top-skill":"_LCuWQ","color-filter":"_3x9D7","btn-filter":"_2In63","block-collapse":"_1Vhg_","form-date-picker":"_6yLxd","bock-filter-left":"_h74SO","bock-filter-right":"_3e2pi","form-filter-right":"_ntUB6","form-filter-left":"_1DlZ4","bock-filter-wrap":"_1tYDM","title-card-box":"_3hSow","box-item":"_1yuC9","image-no-data":"_2PMoX","image-grade":"_3ZX0b","chart-data":"_2asi-","apexcharts-datalabels":"_muT01","apexcharts-pie-label":"_35BzZ","image-custom":"_3pkbc","image-special-need":"_16MpB","title-dashboard":"_CHu-i","box-chart":"_3Y-Dd","block-filter-right":"_1YJnk","shadow-lg":"_2eMbe","chart-header-wrapper":"_6ZvFg","devide-component":"_24CNV","header-chart":"_2vtSi","header-left":"_IpsVf","icon-chart":"_gzxWe","header-right":"_37IcR","header-title":"_2G6Wz","button-export":"_3xpNv","button-content":"_3H5Ly","button-icon":"_J_n-D","icon-config":"_3AALV","headẻ-chart":"_g5-bn","btn-show-chart":"_2htKu","checkbox-chart":"_1qXAT","column-chart-percent":"_3NgrB","chart-background":"_32fu3","custom-marker":"_DmMzw","mark-custom":"_1eUXn","item-legend":"_3hrrC","label-legend-custom":"_Q-iiW","mark-legend":"_cD4ey","percent":"_2HWhv","listItem":"_2Hdbu","item":"_3RJ2T","student-by-age":"_38ikt","total-student":"_1TnWs","pie-chart":"_3BTJi","options-gender":"_1Ws0m","legend":"_2HnO_","text-lengend":"_2BFJw","student-by-grade":"_2az-l","bubble-chart-custom":"_2j8fp","x-axis-custom-wrap":"_1BN5z","axis-content":"_1rYav","legend-wrap":"_3-zAs","list-percent":"_1PPhv","percent-item":"_1rjWR","chart-custom":"_f-Ti4","chart-buddle":"_TPa6x","title-grade":"_1hZ_V","title-modal":"_3L9WC","header-desc-modal":"_1TFtP","form-checkbox":"_37aqf","checkbox-content":"_1iabV","btn-export":"_1eQAg","title-chart":"_pFFg9","image-logo":"_1eqkj","chart-to-canvas":"_2IQ8b"};
19679
19723
 
19680
19724
  var CheckboxCustom = function CheckboxCustom(_ref) {
19681
19725
  var _ref$background = _ref.background,
@@ -25709,7 +25753,17 @@ var learningStrategyChartOptions = function learningStrategyChartOptions(labelNa
25709
25753
  },
25710
25754
  colors: ["#86BD74", "#9DD889"],
25711
25755
  xaxis: {
25712
- categories: labelNames
25756
+ categories: labelNames,
25757
+ labels: {
25758
+ show: true,
25759
+ style: {
25760
+ colors: ["#808080"],
25761
+ fontSize: "14px",
25762
+ fontFamily: "Roboto",
25763
+ fontWeight: 400,
25764
+ cssClass: "apexcharts-yaxis-label"
25765
+ }
25766
+ }
25713
25767
  },
25714
25768
  tooltip: {
25715
25769
  x: {
@@ -25735,8 +25789,8 @@ var learningStrategyChartOptions = function learningStrategyChartOptions(labelNa
25735
25789
  maxWidth: 120,
25736
25790
  style: {
25737
25791
  colors: [],
25738
- fontSize: "12px",
25739
- fontFamily: "Helvetica, Arial, sans-serif",
25792
+ fontSize: "14px",
25793
+ fontFamily: "Roboto",
25740
25794
  fontWeight: 400,
25741
25795
  cssClass: "apexcharts-yaxis-label"
25742
25796
  },
@@ -25897,7 +25951,8 @@ var studentByAgeOptions = function studentByAgeOptions(series) {
25897
25951
  position: "top",
25898
25952
  horizontalAlign: "left",
25899
25953
  fontSize: "14px",
25900
- offsetY: -5
25954
+ offsetY: 0,
25955
+ fontFamily: "Roboto"
25901
25956
  }
25902
25957
  };
25903
25958
  };
@@ -25944,9 +25999,6 @@ var pieChartOptions = {
25944
25999
  }
25945
26000
  }
25946
26001
  },
25947
- chart: {
25948
- offsetY: 20
25949
- },
25950
26002
  dataLabels: {
25951
26003
  enabled: false
25952
26004
  },
@@ -26048,8 +26100,7 @@ var readinesToLearnoptions = function readinesToLearnoptions(seriesName) {
26048
26100
  height: 450,
26049
26101
  toolbar: {
26050
26102
  show: false
26051
- },
26052
- offsetY: -20
26103
+ }
26053
26104
  },
26054
26105
  dataLabels: {
26055
26106
  enabled: false
@@ -26134,7 +26185,12 @@ var optionColumnChartAndPercents = function optionColumnChartAndPercents(months,
26134
26185
  height: 350,
26135
26186
  stacked: false,
26136
26187
  toolbar: {
26137
- show: false
26188
+ show: false,
26189
+ "export": {
26190
+ png: {
26191
+ filename: "test"
26192
+ }
26193
+ }
26138
26194
  }
26139
26195
  },
26140
26196
  plotOptions: {
@@ -26293,7 +26349,7 @@ var optionLineChart = function optionLineChart(months, activeData) {
26293
26349
  }
26294
26350
  };
26295
26351
  };
26296
- var optionBarChartAndArea = function optionBarChartAndArea(months, activeData) {
26352
+ var optionBarChartAndArea = function optionBarChartAndArea(months, activeData, newseries) {
26297
26353
  return {
26298
26354
  chart: {
26299
26355
  height: 350,
@@ -26304,6 +26360,7 @@ var optionBarChartAndArea = function optionBarChartAndArea(months, activeData) {
26304
26360
  },
26305
26361
  plotOptions: {
26306
26362
  bar: {
26363
+ columnWidth: "50%",
26307
26364
  borderRadius: 5
26308
26365
  }
26309
26366
  },
@@ -26311,18 +26368,30 @@ var optionBarChartAndArea = function optionBarChartAndArea(months, activeData) {
26311
26368
  enabled: false
26312
26369
  },
26313
26370
  fill: {
26314
- opacity: 0.5
26371
+ opacity: newseries === null || newseries === void 0 ? void 0 : newseries.map(function (item) {
26372
+ if ((item === null || item === void 0 ? void 0 : item.type) == 'area') {
26373
+ return 0.2;
26374
+ }
26375
+
26376
+ return 0.6;
26377
+ })
26315
26378
  },
26316
26379
  colors: COLOR_CHART_AND_PERCENTS.filter(function (_, index) {
26317
26380
  return activeData[index];
26318
26381
  }),
26319
26382
  stroke: {
26320
26383
  curve: "smooth",
26321
- show: false,
26384
+ show: true,
26322
26385
  colors: COLOR_CHART_AND_PERCENTS.filter(function (_, index) {
26323
26386
  return activeData[index];
26324
26387
  }),
26325
- width: 3,
26388
+ width: newseries === null || newseries === void 0 ? void 0 : newseries.map(function (item) {
26389
+ if ((item === null || item === void 0 ? void 0 : item.type) == 'area') {
26390
+ return 2;
26391
+ }
26392
+
26393
+ return 0;
26394
+ }),
26326
26395
  dashArray: 0
26327
26396
  },
26328
26397
  xaxis: {
@@ -26559,9 +26628,11 @@ var BarAndAreaChart = function BarAndAreaChart(_ref) {
26559
26628
  _ref$isHasLineChart = _ref.isHasLineChart,
26560
26629
  isHasLineChart = _ref$isHasLineChart === void 0 ? false : _ref$isHasLineChart;
26561
26630
  var newseries = mergeBarChartAndArea(series, isHasLineChart);
26631
+ console.log({
26632
+ newseries: newseries
26633
+ });
26562
26634
  return React__default.createElement(Chart, {
26563
- options: optionBarChartAndArea(months, activeColumn),
26564
- type: "line",
26635
+ options: optionBarChartAndArea(months, activeColumn, newseries),
26565
26636
  series: newseries,
26566
26637
  width: "100%",
26567
26638
  height: 450
@@ -26586,61 +26657,23 @@ var ColumnChartAndPercent = function ColumnChartAndPercent(_ref) {
26586
26657
  _ref$typeChart = _ref.typeChart,
26587
26658
  typeChart = _ref$typeChart === void 0 ? TYPECHART.BAR : _ref$typeChart,
26588
26659
  _ref$isHasLineChart = _ref.isHasLineChart,
26589
- isHasLineChart = _ref$isHasLineChart === void 0 ? false : _ref$isHasLineChart;
26660
+ isHasLineChart = _ref$isHasLineChart === void 0 ? false : _ref$isHasLineChart,
26661
+ onActiveColumn = _ref.onActiveColumn,
26662
+ activeColumn = _ref.activeColumn,
26663
+ series = _ref.series,
26664
+ avg = _ref.avg,
26665
+ months = _ref.months;
26590
26666
  if (!data) return React__default.createElement("div", {
26591
26667
  className: "flex justify-content-center align-items-center",
26592
26668
  style: {
26593
26669
  height: 450
26594
26670
  }
26595
26671
  }, React__default.createElement("div", null, "No Data"));
26596
-
26597
- var _useState = React.useState([]),
26598
- activeColumn = _useState[0],
26599
- setActiveColumn = _useState[1];
26600
-
26601
- var _useState2 = React.useState([]),
26602
- series = _useState2[0],
26603
- setSeries = _useState2[1];
26604
-
26605
- var _useState3 = React.useState(INITIAL_AVG),
26606
- avg = _useState3[0],
26607
- setAvg = _useState3[1];
26608
-
26609
- var months = data.map(function (i) {
26610
- return (i === null || i === void 0 ? void 0 : i.month) || "";
26611
- });
26612
- var dataCharts = convertDataToDataChart(data);
26613
- var newSeries = convertToSeriesColumnChartAndPercent(dataCharts, data);
26614
- var newAvg = convertToAvg(dataCharts, data, months);
26615
-
26616
- var onActiveColumn = function onActiveColumn(index) {
26617
- var newActiveColumn = [].concat(activeColumn);
26618
- newActiveColumn[index] = !newActiveColumn[index];
26619
- setActiveColumn(newActiveColumn);
26620
- setSeries(newSeries.filter(function (_, idx) {
26621
- return newActiveColumn[idx];
26622
- }));
26623
- setAvg(newAvg.map(function (_, index) {
26624
- return newActiveColumn[index] ? newAvg[index] : 0;
26625
- }));
26626
- };
26627
-
26628
- React.useEffect(function () {
26629
- if (!!data && data !== null && data !== void 0 && data.length) {
26630
- setSeries(newSeries);
26631
- setActiveColumn(dataCharts.map(function (_i) {
26632
- return true;
26633
- }));
26634
- setAvg(newAvg.map(function (_, index) {
26635
- return newAvg[index];
26636
- }));
26637
- }
26638
- }, [data]);
26639
26672
  return React__default.createElement("div", {
26640
26673
  className: "w-100 h-100 " + styles$1["column-chart-percent"]
26641
26674
  }, React__default.createElement("div", {
26642
26675
  className: "w-full d-flex gap-2 flex-wrap " + styles$1["listItem"]
26643
- }, dataCharts.map(function (column, index) {
26676
+ }, data.map(function (month, index) {
26644
26677
  return React__default.createElement("div", {
26645
26678
  className: "pr-4 d-flex",
26646
26679
  key: index
@@ -26663,7 +26696,7 @@ var ColumnChartAndPercent = function ColumnChartAndPercent(_ref) {
26663
26696
  onClick: function onClick() {
26664
26697
  return onActiveColumn(index);
26665
26698
  }
26666
- }, column));
26699
+ }, month));
26667
26700
  })), React__default.createElement("div", {
26668
26701
  className: "w-100",
26669
26702
  style: {
@@ -26688,7 +26721,7 @@ var ColumnChartAndPercent = function ColumnChartAndPercent(_ref) {
26688
26721
  series: series
26689
26722
  })), React__default.createElement("div", {
26690
26723
  className: "w-100 d-flex gap-2 flex-wrap " + styles$1["listItem"]
26691
- }, dataCharts.map(function (column, index) {
26724
+ }, data.map(function (month, index) {
26692
26725
  return React__default.createElement("div", {
26693
26726
  className: "" + styles$1["item-legend"],
26694
26727
  key: index
@@ -26701,7 +26734,7 @@ var ColumnChartAndPercent = function ColumnChartAndPercent(_ref) {
26701
26734
  }
26702
26735
  }), React__default.createElement("label", {
26703
26736
  className: "" + styles$1["label-legend-custom"]
26704
- }, column)), React__default.createElement("div", {
26737
+ }, month)), React__default.createElement("div", {
26705
26738
  className: "" + styles$1["percent"]
26706
26739
  }, React__default.createElement("label", {
26707
26740
  className: "m-0"
@@ -26802,15 +26835,17 @@ var StudentByAge = function StudentByAge(_ref) {
26802
26835
 
26803
26836
  var StudentByAgeAndGender = function StudentByAgeAndGender(_ref) {
26804
26837
  var studentByAgeData = _ref.studentByAgeData,
26805
- studentByGenderData = _ref.studentByGenderData;
26838
+ studentByGenderData = _ref.studentByGenderData,
26839
+ columnFlex = _ref.columnFlex;
26806
26840
  return React__default.createElement(reactstrap.Row, {
26807
- className: "d-flex"
26841
+ className: "d-flex " + (columnFlex && "flex-column")
26808
26842
  }, React__default.createElement(reactstrap.Col, {
26809
26843
  md: 6
26810
26844
  }, React__default.createElement(StudentByAge, {
26811
26845
  data: studentByAgeData
26812
26846
  })), React__default.createElement(reactstrap.Col, {
26813
- md: 6
26847
+ md: 6,
26848
+ className: "mt-5"
26814
26849
  }, React__default.createElement(CustomPieChart, {
26815
26850
  data: studentByGenderData
26816
26851
  })));
@@ -26995,6 +27030,8 @@ var DEFAULT_START_DATE = moment().startOf("year").valueOf();
26995
27030
  var DEFAULT_END_DATE = moment().endOf("day").valueOf();
26996
27031
 
26997
27032
  var useDashboard = function useDashboard() {
27033
+ var _chartConference$over, _safety$overviewQuest;
27034
+
26998
27035
  var dispatch = reactRedux.useDispatch();
26999
27036
 
27000
27037
  var _useState = React.useState({
@@ -27095,6 +27132,215 @@ var useDashboard = function useDashboard() {
27095
27132
  setFilter(_extends({}, filter, (_extends2 = {}, _extends2[event.target.name] = event.target.value, _extends2)));
27096
27133
  };
27097
27134
 
27135
+ var _useState20 = React.useState([]),
27136
+ activeColumnOneToOne = _useState20[0],
27137
+ setActiveColumnOneToOne = _useState20[1];
27138
+
27139
+ var _useState21 = React.useState([]),
27140
+ seriesOneToOne = _useState21[0],
27141
+ setSeriesOneToOne = _useState21[1];
27142
+
27143
+ var _useState22 = React.useState(INITIAL_AVG),
27144
+ avgOneToOne = _useState22[0],
27145
+ setAvgOneToOne = _useState22[1];
27146
+
27147
+ var monthsOneToOne = chartOneToOneData === null || chartOneToOneData === void 0 ? void 0 : chartOneToOneData.overviewQuestionChoice.map(function (i) {
27148
+ return (i === null || i === void 0 ? void 0 : i.month) || "";
27149
+ });
27150
+ var dataConvertedOneToOne = convertDataToDataChart(chartOneToOneData === null || chartOneToOneData === void 0 ? void 0 : chartOneToOneData.overviewQuestionChoice);
27151
+ var newSeriesOneToOne = convertToSeriesColumnChartAndPercent(dataConvertedOneToOne, chartOneToOneData === null || chartOneToOneData === void 0 ? void 0 : chartOneToOneData.overviewQuestionChoice);
27152
+ var newAvgOneToOne = convertToAvg(dataConvertedOneToOne, chartOneToOneData === null || chartOneToOneData === void 0 ? void 0 : chartOneToOneData.overviewQuestionChoice, monthsOneToOne);
27153
+
27154
+ var handleActiveColumnOneToOne = function handleActiveColumnOneToOne(index) {
27155
+ var newActiveColumn = [].concat(activeColumnOneToOne);
27156
+ newActiveColumn[index] = !newActiveColumn[index];
27157
+ setActiveColumnOneToOne(newActiveColumn);
27158
+ setSeriesOneToOne(newSeriesOneToOne === null || newSeriesOneToOne === void 0 ? void 0 : newSeriesOneToOne.filter(function (_, idx) {
27159
+ return newActiveColumn[idx];
27160
+ }));
27161
+ setAvgOneToOne(newAvgOneToOne === null || newAvgOneToOne === void 0 ? void 0 : newAvgOneToOne.map(function (_, idx) {
27162
+ return newActiveColumn[idx] ? newAvgOneToOne[idx] : 0;
27163
+ }));
27164
+ };
27165
+
27166
+ React.useEffect(function () {
27167
+ setSeriesOneToOne(newSeriesOneToOne);
27168
+ setActiveColumnOneToOne(dataConvertedOneToOne.map(function (_i) {
27169
+ return true;
27170
+ }));
27171
+ setAvgOneToOne(newAvgOneToOne === null || newAvgOneToOne === void 0 ? void 0 : newAvgOneToOne.map(function (_, index) {
27172
+ return newAvgOneToOne[index];
27173
+ }));
27174
+ }, [chartOneToOneData.overviewQuestionChoice]);
27175
+
27176
+ var _useState23 = React.useState([]),
27177
+ activeColumnClassReflection = _useState23[0],
27178
+ setActiveColumnClassReflection = _useState23[1];
27179
+
27180
+ var _useState24 = React.useState([]),
27181
+ seriesClassRefection = _useState24[0],
27182
+ setSeriesClassReflection = _useState24[1];
27183
+
27184
+ var _useState25 = React.useState(INITIAL_AVG),
27185
+ avgClassReflection = _useState25[0],
27186
+ setAvgClassReflection = _useState25[1];
27187
+
27188
+ var monthsClassReflection = chartClassReflection === null || chartClassReflection === void 0 ? void 0 : chartClassReflection.overviewQuestionChoice.map(function (i) {
27189
+ return (i === null || i === void 0 ? void 0 : i.month) || "";
27190
+ });
27191
+ var dataConvertedClassReflection = convertDataToDataChart(chartClassReflection === null || chartClassReflection === void 0 ? void 0 : chartClassReflection.overviewQuestionChoice);
27192
+ var newSeriesClassReflection = convertToSeriesColumnChartAndPercent(dataConvertedClassReflection, chartClassReflection === null || chartClassReflection === void 0 ? void 0 : chartClassReflection.overviewQuestionChoice);
27193
+ var newAvgClassReflection = convertToAvg(dataConvertedClassReflection, chartClassReflection === null || chartClassReflection === void 0 ? void 0 : chartClassReflection.overviewQuestionChoice, monthsClassReflection);
27194
+
27195
+ var handleActiveColumnClassReflection = function handleActiveColumnClassReflection(index) {
27196
+ var newActiveColumn = [].concat(activeColumnClassReflection);
27197
+ newActiveColumn[index] = !newActiveColumn[index];
27198
+ setActiveColumnClassReflection(newActiveColumn);
27199
+ setSeriesClassReflection(newSeriesClassReflection === null || newSeriesClassReflection === void 0 ? void 0 : newSeriesClassReflection.filter(function (_, idx) {
27200
+ return newActiveColumn[idx];
27201
+ }));
27202
+ setAvgClassReflection(newAvgClassReflection === null || newAvgClassReflection === void 0 ? void 0 : newAvgClassReflection.map(function (_, idx) {
27203
+ return newActiveColumn[idx] ? newAvgOneToOne[idx] : 0;
27204
+ }));
27205
+ };
27206
+
27207
+ React.useEffect(function () {
27208
+ setSeriesClassReflection(newSeriesClassReflection);
27209
+ setActiveColumnClassReflection(dataConvertedClassReflection.map(function (_i) {
27210
+ return true;
27211
+ }));
27212
+ setAvgClassReflection(newAvgClassReflection === null || newAvgClassReflection === void 0 ? void 0 : newAvgClassReflection.map(function (_, index) {
27213
+ return newAvgClassReflection[index];
27214
+ }));
27215
+ }, [chartClassReflection.overviewQuestionChoice]);
27216
+
27217
+ var _useState26 = React.useState([]),
27218
+ activeColumnConference = _useState26[0],
27219
+ setActiveColumnConference = _useState26[1];
27220
+
27221
+ var _useState27 = React.useState([]),
27222
+ seriesConference = _useState27[0],
27223
+ setSeriesConference = _useState27[1];
27224
+
27225
+ var _useState28 = React.useState(INITIAL_AVG),
27226
+ avgConference = _useState28[0],
27227
+ setAvgConference = _useState28[1];
27228
+
27229
+ var monthsConference = chartConference === null || chartConference === void 0 ? void 0 : (_chartConference$over = chartConference.overviewQuestionChoice) === null || _chartConference$over === void 0 ? void 0 : _chartConference$over.map(function (i) {
27230
+ return (i === null || i === void 0 ? void 0 : i.month) || "";
27231
+ });
27232
+ var dataConvertedConference = convertDataToDataChart(chartConference === null || chartConference === void 0 ? void 0 : chartConference.overviewQuestionChoice);
27233
+ var newSeriesConference = convertToSeriesColumnChartAndPercent(dataConvertedConference, chartConference === null || chartConference === void 0 ? void 0 : chartConference.overviewQuestionChoice);
27234
+ var newAvgConference = convertToAvg(dataConvertedConference, chartConference === null || chartConference === void 0 ? void 0 : chartConference.overviewQuestionChoice, monthsConference);
27235
+
27236
+ var handleActiveColumnConference = function handleActiveColumnConference(index) {
27237
+ var newActiveColumn = [].concat(activeColumnConference);
27238
+ newActiveColumn[index] = !newActiveColumn[index];
27239
+ setActiveColumnConference(newActiveColumn);
27240
+ setSeriesConference(newSeriesConference === null || newSeriesConference === void 0 ? void 0 : newSeriesConference.filter(function (_, idx) {
27241
+ return newActiveColumn[idx];
27242
+ }));
27243
+ setAvgConference(newAvgConference === null || newAvgConference === void 0 ? void 0 : newAvgConference.map(function (_, idx) {
27244
+ return newActiveColumn[idx] ? newAvgConference[idx] : 0;
27245
+ }));
27246
+ };
27247
+
27248
+ React.useEffect(function () {
27249
+ setSeriesConference(newSeriesConference);
27250
+ setActiveColumnConference(dataConvertedConference === null || dataConvertedConference === void 0 ? void 0 : dataConvertedConference.map(function (_i) {
27251
+ return true;
27252
+ }));
27253
+ setAvgConference(newAvgConference === null || newAvgConference === void 0 ? void 0 : newAvgConference.map(function (_, idx) {
27254
+ return newAvgConference[idx];
27255
+ }));
27256
+ }, [chartConference === null || chartConference === void 0 ? void 0 : chartConference.overviewQuestionChoice]);
27257
+
27258
+ var _useState29 = React.useState([]),
27259
+ activeColumnSafety = _useState29[0],
27260
+ setActiveColumnSafety = _useState29[1];
27261
+
27262
+ var _useState30 = React.useState([]),
27263
+ seriesSafety = _useState30[0],
27264
+ setSeriesSafety = _useState30[1];
27265
+
27266
+ var _useState31 = React.useState(INITIAL_AVG),
27267
+ avgSafety = _useState31[0],
27268
+ setAvgSafety = _useState31[1];
27269
+
27270
+ var monthsSafety = safety === null || safety === void 0 ? void 0 : (_safety$overviewQuest = safety.overviewQuestionChoice) === null || _safety$overviewQuest === void 0 ? void 0 : _safety$overviewQuest.map(function (i) {
27271
+ return (i === null || i === void 0 ? void 0 : i.month) || "";
27272
+ });
27273
+ var dataConvertedSafety = convertDataToDataChart(safety === null || safety === void 0 ? void 0 : safety.overviewQuestionChoice);
27274
+ var newSeriesSafety = convertToSeriesColumnChartAndPercent(dataConvertedSafety, safety === null || safety === void 0 ? void 0 : safety.overviewQuestionChoice);
27275
+ var newAvgSafety = convertToAvg(dataConvertedSafety, safety === null || safety === void 0 ? void 0 : safety.overviewQuestionChoice, monthsSafety);
27276
+
27277
+ var handleActiveColumnSafety = function handleActiveColumnSafety(index) {
27278
+ var newActiveColumn = [].concat(activeColumnSafety);
27279
+ newActiveColumn[index] = !newActiveColumn[index];
27280
+ setActiveColumnSafety(newActiveColumn);
27281
+ setSeriesSafety(newSeriesSafety === null || newSeriesSafety === void 0 ? void 0 : newSeriesSafety.filter(function (_, idx) {
27282
+ return newActiveColumn[idx];
27283
+ }));
27284
+ setAvgSafety(newAvgSafety === null || newAvgSafety === void 0 ? void 0 : newAvgSafety.map(function (_, idx) {
27285
+ return newActiveColumn[idx] ? newAvgSafety[idx] : 0;
27286
+ }));
27287
+ };
27288
+
27289
+ React.useEffect(function () {
27290
+ setSeriesSafety(newSeriesSafety);
27291
+ setActiveColumnSafety(dataConvertedSafety === null || dataConvertedSafety === void 0 ? void 0 : dataConvertedSafety.map(function (_i) {
27292
+ return true;
27293
+ }));
27294
+ setAvgSafety(newAvgSafety === null || newAvgSafety === void 0 ? void 0 : newAvgSafety.map(function (_, idx) {
27295
+ return newAvgSafety[idx];
27296
+ }));
27297
+ }, [safety === null || safety === void 0 ? void 0 : safety.overviewQuestionChoice]);
27298
+
27299
+ var _useState32 = React.useState([]),
27300
+ selectedToPrint = _useState32[0],
27301
+ setSelectedToPrint = _useState32[1];
27302
+
27303
+ var handleSelectToPrint = function handleSelectToPrint(checked, data, chartType) {
27304
+ var updateSelectToPrint = [].concat(selectedToPrint);
27305
+ var foundItem = updateSelectToPrint === null || updateSelectToPrint === void 0 ? void 0 : updateSelectToPrint.find(function (e) {
27306
+ return e.identification == data.id;
27307
+ });
27308
+
27309
+ if (checked) {
27310
+ if (!!data.id && !foundItem) {
27311
+ updateSelectToPrint.push({
27312
+ id: data.id,
27313
+ identification: data.id,
27314
+ label: data.label,
27315
+ children: data.children,
27316
+ chartType: chartType
27317
+ });
27318
+ }
27319
+
27320
+ if (!!data && foundItem && foundItem.id == null) {
27321
+ var itemIndex = updateSelectToPrint.indexOf(foundItem);
27322
+ updateSelectToPrint[itemIndex].id = data.id;
27323
+ updateSelectToPrint[itemIndex].children = data.children;
27324
+ }
27325
+ } else {
27326
+ var _itemIndex = updateSelectToPrint.indexOf(foundItem);
27327
+
27328
+ updateSelectToPrint[_itemIndex].id = null;
27329
+ updateSelectToPrint[_itemIndex].children = null;
27330
+ }
27331
+
27332
+ setSelectedToPrint(updateSelectToPrint);
27333
+ };
27334
+
27335
+ var checkSelectedItem = function checkSelectedItem(id) {
27336
+ for (var _iterator = _createForOfIteratorHelperLoose(selectedToPrint), _step; !(_step = _iterator()).done;) {
27337
+ var item = _step.value;
27338
+ if (item.id === id) return true;
27339
+ }
27340
+
27341
+ return false;
27342
+ };
27343
+
27098
27344
  var callApi = React.useCallback(function (apiCaller, setData, defaultData, type) {
27099
27345
  try {
27100
27346
  var _temp2 = _catch(function () {
@@ -27247,20 +27493,45 @@ var useDashboard = function useDashboard() {
27247
27493
  setGenderOfStudent: setGenderOfStudent,
27248
27494
  handleFilterStudent: handleFilterStudent,
27249
27495
  handleFilterTeacher: handleFilterTeacher,
27250
- onChangeFilters: onChangeFilters
27496
+ handleSelectToPrint: handleSelectToPrint,
27497
+ checkSelectedItem: checkSelectedItem,
27498
+ selectedToPrint: selectedToPrint,
27499
+ setSelectedToPrint: setSelectedToPrint,
27500
+ onChangeFilters: onChangeFilters,
27501
+ handleActiveColumnOneToOne: handleActiveColumnOneToOne,
27502
+ seriesOneToOne: seriesOneToOne,
27503
+ avgOneToOne: avgOneToOne,
27504
+ dataConvertedOneToOne: dataConvertedOneToOne,
27505
+ monthsOneToOne: monthsOneToOne,
27506
+ activeColumnOneToOne: activeColumnOneToOne,
27507
+ handleActiveColumnClassReflection: handleActiveColumnClassReflection,
27508
+ seriesClassRefection: seriesClassRefection,
27509
+ avgClassReflection: avgClassReflection,
27510
+ dataConvertedClassReflection: dataConvertedClassReflection,
27511
+ monthsClassReflection: monthsClassReflection,
27512
+ activeColumnClassReflection: activeColumnClassReflection,
27513
+ handleActiveColumnConference: handleActiveColumnConference,
27514
+ seriesConference: seriesConference,
27515
+ avgConference: avgConference,
27516
+ dataConvertedConference: dataConvertedConference,
27517
+ monthsConference: monthsConference,
27518
+ activeColumnConference: activeColumnConference,
27519
+ handleActiveColumnSafety: handleActiveColumnSafety,
27520
+ seriesSafety: seriesSafety,
27521
+ avgSafety: avgSafety,
27522
+ dataConvertedSafety: dataConvertedSafety,
27523
+ monthsSafety: monthsSafety,
27524
+ activeColumnSafety: activeColumnSafety
27251
27525
  };
27252
27526
  };
27253
27527
 
27254
27528
  var useChartDatas = function useChartDatas() {
27255
27529
  var _useDashboard = useDashboard(),
27256
27530
  topLearningStrategies = _useDashboard.topLearningStrategies,
27257
- chartOneToOneData = _useDashboard.chartOneToOneData,
27258
27531
  readinessToLearning = _useDashboard.readinessToLearning,
27259
- chartClassReflection = _useDashboard.chartClassReflection,
27260
27532
  studentByAge = _useDashboard.studentByAge,
27261
27533
  studentByGender = _useDashboard.studentByGender,
27262
27534
  studentByGrade = _useDashboard.studentByGrade,
27263
- chartConference = _useDashboard.chartConference,
27264
27535
  handleChangeFilters = _useDashboard.handleChangeFilters,
27265
27536
  bandScore = _useDashboard.bandScore,
27266
27537
  user = _useDashboard.user,
@@ -27268,9 +27539,32 @@ var useChartDatas = function useChartDatas() {
27268
27539
  handleFilterStudent = _useDashboard.handleFilterStudent,
27269
27540
  handleFilterTeacher = _useDashboard.handleFilterTeacher,
27270
27541
  filter = _useDashboard.filter,
27271
- safety = _useDashboard.safety,
27272
27542
  listTotalTime = _useDashboard.listTotalTime,
27273
- onChangeFilters = _useDashboard.onChangeFilters;
27543
+ onChangeFilters = _useDashboard.onChangeFilters,
27544
+ handleActiveColumnOneToOne = _useDashboard.handleActiveColumnOneToOne,
27545
+ seriesOneToOne = _useDashboard.seriesOneToOne,
27546
+ avgOneToOne = _useDashboard.avgOneToOne,
27547
+ monthsOneToOne = _useDashboard.monthsOneToOne,
27548
+ dataConvertedOneToOne = _useDashboard.dataConvertedOneToOne,
27549
+ activeColumnOneToOne = _useDashboard.activeColumnOneToOne,
27550
+ handleActiveColumnClassReflection = _useDashboard.handleActiveColumnClassReflection,
27551
+ seriesClassRefection = _useDashboard.seriesClassRefection,
27552
+ avgClassReflection = _useDashboard.avgClassReflection,
27553
+ monthsClassReflection = _useDashboard.monthsClassReflection,
27554
+ dataConvertedClassReflection = _useDashboard.dataConvertedClassReflection,
27555
+ activeColumnClassReflection = _useDashboard.activeColumnClassReflection,
27556
+ handleActiveColumnConference = _useDashboard.handleActiveColumnConference,
27557
+ seriesConference = _useDashboard.seriesConference,
27558
+ avgConference = _useDashboard.avgConference,
27559
+ monthsConference = _useDashboard.monthsConference,
27560
+ dataConvertedConference = _useDashboard.dataConvertedConference,
27561
+ activeColumnConference = _useDashboard.activeColumnConference,
27562
+ handleActiveColumnSafety = _useDashboard.handleActiveColumnSafety,
27563
+ seriesSafety = _useDashboard.seriesSafety,
27564
+ avgSafety = _useDashboard.avgSafety,
27565
+ monthsSafety = _useDashboard.monthsSafety,
27566
+ dataConvertedSafety = _useDashboard.dataConvertedSafety,
27567
+ activeColumnSafety = _useDashboard.activeColumnSafety;
27274
27568
 
27275
27569
  var LIST_FILTERS_LEFT = [{
27276
27570
  name: FILTER_NAME.Calendar,
@@ -27321,7 +27615,7 @@ var useChartDatas = function useChartDatas() {
27321
27615
  isShowChangeChart: false,
27322
27616
  options: []
27323
27617
  }, {
27324
- id: "Readiness_to_learn",
27618
+ id: "readiness_to_learn",
27325
27619
  label: "Readiness to learn",
27326
27620
  children: function children(_) {
27327
27621
  return React__default.createElement(BubbleChartCustom$1, {
@@ -27335,9 +27629,14 @@ var useChartDatas = function useChartDatas() {
27335
27629
  label: "1 To 1",
27336
27630
  children: function children(typeChart) {
27337
27631
  return React__default.createElement(ColumnChartAndPercent$1, {
27338
- data: chartOneToOneData.overviewQuestionChoice,
27632
+ data: dataConvertedOneToOne,
27339
27633
  id: "1_to_1",
27340
- typeChart: typeChart
27634
+ typeChart: typeChart,
27635
+ onActiveColumn: handleActiveColumnOneToOne,
27636
+ activeColumn: activeColumnOneToOne,
27637
+ series: seriesOneToOne,
27638
+ avg: avgOneToOne,
27639
+ months: monthsOneToOne
27341
27640
  });
27342
27641
  },
27343
27642
  isShowChangeChart: true,
@@ -27353,10 +27652,15 @@ var useChartDatas = function useChartDatas() {
27353
27652
  label: "Class Reflection",
27354
27653
  children: function children(typeChart) {
27355
27654
  return React__default.createElement(ColumnChartAndPercent$1, {
27356
- data: chartClassReflection.overviewQuestionChoice,
27655
+ data: dataConvertedClassReflection,
27357
27656
  typeChart: typeChart,
27358
27657
  id: "class_reflection",
27359
- isHasLineChart: true
27658
+ isHasLineChart: true,
27659
+ onActiveColumn: handleActiveColumnClassReflection,
27660
+ activeColumn: activeColumnClassReflection,
27661
+ series: seriesClassRefection,
27662
+ avg: avgClassReflection,
27663
+ months: monthsClassReflection
27360
27664
  });
27361
27665
  },
27362
27666
  isShowChangeChart: true,
@@ -27372,9 +27676,14 @@ var useChartDatas = function useChartDatas() {
27372
27676
  label: "Conference",
27373
27677
  children: function children(typeChart) {
27374
27678
  return React__default.createElement(ColumnChartAndPercent$1, {
27375
- data: chartConference.overviewQuestionChoice,
27679
+ data: dataConvertedConference,
27376
27680
  typeChart: typeChart,
27377
- id: "conference"
27681
+ id: "conference",
27682
+ onActiveColumn: handleActiveColumnConference,
27683
+ activeColumn: activeColumnConference,
27684
+ series: seriesConference,
27685
+ avg: avgConference,
27686
+ months: monthsConference
27378
27687
  });
27379
27688
  },
27380
27689
  isShowChangeChart: true,
@@ -27390,10 +27699,15 @@ var useChartDatas = function useChartDatas() {
27390
27699
  label: "Safety",
27391
27700
  children: function children(typeChart) {
27392
27701
  return React__default.createElement(ColumnChartAndPercent$1, {
27393
- data: safety.overviewQuestionChoice,
27702
+ data: dataConvertedSafety,
27394
27703
  typeChart: typeChart,
27395
27704
  id: "safety",
27396
- isHasLineChart: true
27705
+ isHasLineChart: true,
27706
+ onActiveColumn: handleActiveColumnSafety,
27707
+ activeColumn: activeColumnSafety,
27708
+ series: seriesSafety,
27709
+ avg: avgSafety,
27710
+ months: monthsSafety
27397
27711
  });
27398
27712
  },
27399
27713
  isShowChangeChart: true,
@@ -27407,8 +27721,9 @@ var useChartDatas = function useChartDatas() {
27407
27721
  }, {
27408
27722
  id: "Student_by_age",
27409
27723
  label: "Student by age",
27410
- children: function children(_) {
27724
+ children: function children(_, columnFlex) {
27411
27725
  return React__default.createElement(StudentByAgeAndGender$1, {
27726
+ columnFlex: columnFlex,
27412
27727
  studentByAgeData: studentByAge,
27413
27728
  studentByGenderData: studentByGender
27414
27729
  });
@@ -27969,6 +28284,778 @@ var TotalCard = function TotalCard(_ref) {
27969
28284
  }, value)));
27970
28285
  };
27971
28286
 
28287
+ var headerLogo = "../images/logoV1-2.png";
28288
+
28289
+ var DashboardToPDF = function DashboardToPDF(props) {
28290
+ var selectedToPDF = props.selectedToPDF,
28291
+ initialData = props.initialData,
28292
+ typeChartList = props.typeChartList;
28293
+ var dispatch = reactRedux.useDispatch();
28294
+
28295
+ var _useDashboard = useDashboard(),
28296
+ chartOneToOneData = _useDashboard.chartOneToOneData,
28297
+ topLearningStrategies = _useDashboard.topLearningStrategies,
28298
+ chartClassReflection = _useDashboard.chartClassReflection,
28299
+ chartConference = _useDashboard.chartConference,
28300
+ safety = _useDashboard.safety;
28301
+
28302
+ var chartHightImpactLearningStrategie = selectedToPDF.find(function (i) {
28303
+ return i.id === "high_impact_learning_strategie";
28304
+ });
28305
+ var chartReadinessToLearn = selectedToPDF.find(function (i) {
28306
+ return i.id === "readiness_to_learn";
28307
+ });
28308
+ var chartOneToOne = selectedToPDF.find(function (i) {
28309
+ return i.id === "1_to_1";
28310
+ });
28311
+ var chartClassReflectionPDF = selectedToPDF.find(function (i) {
28312
+ return i.id === "class_reflection";
28313
+ });
28314
+ var chartConferecePDF = selectedToPDF.find(function (i) {
28315
+ return i.id === "conference";
28316
+ });
28317
+ var chartSafety = selectedToPDF.find(function (i) {
28318
+ return i.id === "safety";
28319
+ });
28320
+ var chartStudentByAge = selectedToPDF.find(function (i) {
28321
+ return i.id === "Student_by_age";
28322
+ });
28323
+ var chartStudentByGrade = selectedToPDF.find(function (i) {
28324
+ return i.id === "student_by_grade";
28325
+ });
28326
+
28327
+ var generatePDF = function generatePDF() {
28328
+ try {
28329
+ var _temp19 = function _temp19() {
28330
+ dispatch(marioCore.setLoading(false));
28331
+ };
28332
+
28333
+ dispatch(marioCore.setLoading(true));
28334
+
28335
+ var _temp20 = _catch(function () {
28336
+ function _temp16() {
28337
+ function _temp14() {
28338
+ function _temp12() {
28339
+ function _temp10() {
28340
+ function _temp8() {
28341
+ function _temp6() {
28342
+ function _temp4() {
28343
+ function _temp2() {
28344
+ doc.save("DashBoard.pdf");
28345
+ }
28346
+
28347
+ var _temp = function () {
28348
+ if (!!chartStudentByGrade) {
28349
+ var _selectedToPDF;
28350
+
28351
+ var line = 80;
28352
+ var left = 20;
28353
+ if (selectedToPDF.indexOf(chartStudentByGrade) != 0 && ((_selectedToPDF = selectedToPDF[selectedToPDF.indexOf(chartStudentByGrade) - 1]) === null || _selectedToPDF === void 0 ? void 0 : _selectedToPDF.id) != null) doc.addPage();
28354
+ return Promise.resolve(createImageHeader()).then(function () {
28355
+ doc.setFontSize(14);
28356
+ doc.setFont("Helvetica", "normal", "bold");
28357
+ doc.text(chartStudentByGrade.label, left, line);
28358
+ var chart = document.getElementById("student_by_grade");
28359
+ return Promise.resolve(html2canvas(chart)).then(function (canvas) {
28360
+ doc.addImage(canvas.toDataURL("image/png", 1.0), 15, line + 30, 420, 140);
28361
+ });
28362
+ });
28363
+ }
28364
+ }();
28365
+
28366
+ return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
28367
+ }
28368
+
28369
+ var _temp3 = function () {
28370
+ if (!!chartStudentByAge) {
28371
+ var _selectedToPDF2;
28372
+
28373
+ var line = 80;
28374
+ var left = 20;
28375
+ if (selectedToPDF.indexOf(chartStudentByAge) != 0 && ((_selectedToPDF2 = selectedToPDF[selectedToPDF.indexOf(chartStudentByAge) - 1]) === null || _selectedToPDF2 === void 0 ? void 0 : _selectedToPDF2.id) != null) doc.addPage();
28376
+ return Promise.resolve(createImageHeader()).then(function () {
28377
+ doc.setFontSize(14);
28378
+ doc.setFont("Helvetica", "normal", "bold");
28379
+ doc.text(chartStudentByAge.label, left, line);
28380
+ var chart = document.getElementById("Student_by_age");
28381
+ return Promise.resolve(html2canvas(chart)).then(function (canvas) {
28382
+ doc.addImage(canvas.toDataURL("image/png", 1.0), 20, line + 20, 800, 450);
28383
+ });
28384
+ });
28385
+ }
28386
+ }();
28387
+
28388
+ return _temp3 && _temp3.then ? _temp3.then(_temp4) : _temp4(_temp3);
28389
+ }
28390
+
28391
+ var _temp5 = function () {
28392
+ if (!!chartSafety) {
28393
+ var _selectedToPDF3;
28394
+
28395
+ var line = 80;
28396
+ var left = 20;
28397
+ if (selectedToPDF.indexOf(chartSafety) != 0 && ((_selectedToPDF3 = selectedToPDF[selectedToPDF.indexOf(chartSafety) - 1]) === null || _selectedToPDF3 === void 0 ? void 0 : _selectedToPDF3.id) != null) doc.addPage();
28398
+ return Promise.resolve(createImageHeader()).then(function () {
28399
+ doc.setFontSize(14);
28400
+ doc.setFont("Helvetica", "normal", "bold");
28401
+ doc.text(chartSafety.label, left, line);
28402
+ var chart = document.getElementById("safety");
28403
+ return Promise.resolve(html2canvas(chart)).then(function (canvas) {
28404
+ doc.setFontSize(8);
28405
+
28406
+ for (var i = 0; i < ((_safety$overviewQuest = safety.overviewQuestionChoice) === null || _safety$overviewQuest === void 0 ? void 0 : _safety$overviewQuest.length); i++) {
28407
+ var _safety$overviewQuest;
28408
+
28409
+ if (safety.overviewQuestionChoice[i].resultQuestion[0].questionId != 0) {
28410
+ var _sortedResultQuestion, _sortedResultQuestion2, _sortedResultQuestion3, _sortedResultQuestion4, _sortedResultQuestion5, _sortedResultQuestion6;
28411
+
28412
+ var sortedResultQuestions = safety.overviewQuestionChoice[i].resultQuestion.sort(function (a, b) {
28413
+ return a.avgOfStudentChoice < b.avgOfStudentChoice ? 1 : -1;
28414
+ });
28415
+ var bestResultQuestion1 = ((_sortedResultQuestion = sortedResultQuestions[0]) === null || _sortedResultQuestion === void 0 ? void 0 : _sortedResultQuestion.questionText.slice(3, (_sortedResultQuestion2 = sortedResultQuestions[0]) === null || _sortedResultQuestion2 === void 0 ? void 0 : _sortedResultQuestion2.questionText.indexOf("</p>"))) || "";
28416
+ var bestResultQuestion2 = ((_sortedResultQuestion3 = sortedResultQuestions[1]) === null || _sortedResultQuestion3 === void 0 ? void 0 : _sortedResultQuestion3.questionText.slice(3, (_sortedResultQuestion4 = sortedResultQuestions[1]) === null || _sortedResultQuestion4 === void 0 ? void 0 : _sortedResultQuestion4.questionText.indexOf("</p>"))) || "";
28417
+ var bestResultQuestion3 = ((_sortedResultQuestion5 = sortedResultQuestions[2]) === null || _sortedResultQuestion5 === void 0 ? void 0 : _sortedResultQuestion5.questionText.slice(3, (_sortedResultQuestion6 = sortedResultQuestions[2]) === null || _sortedResultQuestion6 === void 0 ? void 0 : _sortedResultQuestion6.questionText.indexOf("</p>"))) || "";
28418
+ doc.setFont("Helvetica", "normal", "bold");
28419
+ doc.text(safety.overviewQuestionChoice[i].month, left, line + 20);
28420
+
28421
+ if (bestResultQuestion1 != "") {
28422
+ var _sortedResultQuestion7;
28423
+
28424
+ doc.setFont("Helvetica", "normal", "bold");
28425
+ doc.text(bestResultQuestion1, left + 10, line + 30);
28426
+ doc.setFont("Helvetica", "normal", "normal");
28427
+ doc.text(((_sortedResultQuestion7 = sortedResultQuestions[0]) === null || _sortedResultQuestion7 === void 0 ? void 0 : _sortedResultQuestion7.avgOfStudentChoice.toFixed(1)) + "%", left + (bestResultQuestion1 === null || bestResultQuestion1 === void 0 ? void 0 : bestResultQuestion1.length) * 4 + 15, line + 30);
28428
+ doc.setDrawColor(0);
28429
+ doc.setFillColor(64, 210, 204);
28430
+ doc.roundedRect(left, line + 25, 5, 5, 1, 1, "F");
28431
+ }
28432
+
28433
+ if (bestResultQuestion2 != "") {
28434
+ var _sortedResultQuestion8;
28435
+
28436
+ doc.setFont("Helvetica", "normal", "bold");
28437
+ doc.text(bestResultQuestion2, left + 10, line + 40);
28438
+ doc.setFont("Helvetica", "normal", "normal");
28439
+ doc.text(((_sortedResultQuestion8 = sortedResultQuestions[1]) === null || _sortedResultQuestion8 === void 0 ? void 0 : _sortedResultQuestion8.avgOfStudentChoice.toFixed(1)) + "%", left + (bestResultQuestion2 === null || bestResultQuestion2 === void 0 ? void 0 : bestResultQuestion2.length) * 4 + 15, line + 40);
28440
+ doc.setDrawColor(0);
28441
+ doc.setFillColor(120, 182, 226);
28442
+ doc.roundedRect(left, line + 35, 5, 5, 1, 1, "F");
28443
+ }
28444
+
28445
+ if (bestResultQuestion3 != "") {
28446
+ var _sortedResultQuestion9;
28447
+
28448
+ doc.setFont("Helvetica", "normal", "bold");
28449
+ doc.text(bestResultQuestion3, left + 10, line + 50);
28450
+ doc.setFont("Helvetica", "normal", "normal");
28451
+ doc.text(((_sortedResultQuestion9 = sortedResultQuestions[2]) === null || _sortedResultQuestion9 === void 0 ? void 0 : _sortedResultQuestion9.avgOfStudentChoice.toFixed(1)) + "%", left + (bestResultQuestion3 === null || bestResultQuestion3 === void 0 ? void 0 : bestResultQuestion3.length) * 4 + 15, line + 50);
28452
+ doc.setDrawColor(0);
28453
+ doc.setFillColor(255, 176, 79);
28454
+ doc.roundedRect(left, line + 45, 5, 5, 1, 1, "F");
28455
+ }
28456
+
28457
+ if ((bestResultQuestion1 === null || bestResultQuestion1 === void 0 ? void 0 : bestResultQuestion1.length) * 5 + 5 + 10 > 100) {
28458
+ left = left + (bestResultQuestion1 === null || bestResultQuestion1 === void 0 ? void 0 : bestResultQuestion1.length) * 5 + 20;
28459
+ } else if ((bestResultQuestion2 === null || bestResultQuestion2 === void 0 ? void 0 : bestResultQuestion2.length) * 5 + 5 + 10 > 100) {
28460
+ left = left + (bestResultQuestion2 === null || bestResultQuestion2 === void 0 ? void 0 : bestResultQuestion2.length) * 5 + 20;
28461
+ } else if ((bestResultQuestion3 === null || bestResultQuestion3 === void 0 ? void 0 : bestResultQuestion3.length) * 5 + 5 + 10 > 100) {
28462
+ left = left + (bestResultQuestion3 === null || bestResultQuestion3 === void 0 ? void 0 : bestResultQuestion3.length) * 5 + 20;
28463
+ } else {
28464
+ left = left + 100;
28465
+ }
28466
+
28467
+ if (left + 80 > WIDTH_PAPER) {
28468
+ left = 20;
28469
+ line += 60;
28470
+ }
28471
+ }
28472
+ }
28473
+
28474
+ doc.addImage(canvas.toDataURL("image/png", 1.0), 15, line + 30, 420, 170);
28475
+ });
28476
+ });
28477
+ }
28478
+ }();
28479
+
28480
+ return _temp5 && _temp5.then ? _temp5.then(_temp6) : _temp6(_temp5);
28481
+ }
28482
+
28483
+ var _temp7 = function () {
28484
+ if (!!chartConferecePDF) {
28485
+ var _selectedToPDF4;
28486
+
28487
+ var line = 80;
28488
+ var left = 20;
28489
+ if (selectedToPDF.indexOf(chartConferecePDF) != 0 && ((_selectedToPDF4 = selectedToPDF[selectedToPDF.indexOf(chartConferecePDF) - 1]) === null || _selectedToPDF4 === void 0 ? void 0 : _selectedToPDF4.id) != null) doc.addPage();
28490
+ return Promise.resolve(createImageHeader()).then(function () {
28491
+ doc.setFontSize(14);
28492
+ doc.setFont("Helvetica", "normal", "bold");
28493
+ doc.text(chartConferecePDF.label, left, line);
28494
+ var chart = document.getElementById("conference");
28495
+ return Promise.resolve(html2canvas(chart)).then(function (canvas) {
28496
+ doc.setFontSize(8);
28497
+
28498
+ for (var i = 0; i < ((_chartConference$over = chartConference.overviewQuestionChoice) === null || _chartConference$over === void 0 ? void 0 : _chartConference$over.length); i++) {
28499
+ var _chartConference$over;
28500
+
28501
+ if (chartConference.overviewQuestionChoice[i].resultQuestion[0].questionId != 0 || chartConference.overviewQuestionChoice[i].resultQuestion[0].questionText != "") {
28502
+ var _sortedResultQuestion10, _sortedResultQuestion11, _sortedResultQuestion12, _sortedResultQuestion13, _sortedResultQuestion14, _sortedResultQuestion15;
28503
+
28504
+ var sortedResultQuestions = chartConference.overviewQuestionChoice[i].resultQuestion.sort(function (a, b) {
28505
+ return a.avgOfStudentChoice < b.avgOfStudentChoice ? 1 : -1;
28506
+ });
28507
+ var resultQuestion1 = ((_sortedResultQuestion10 = sortedResultQuestions[0]) === null || _sortedResultQuestion10 === void 0 ? void 0 : _sortedResultQuestion10.questionText) || "";
28508
+ var resultQuestion2 = ((_sortedResultQuestion11 = sortedResultQuestions[1]) === null || _sortedResultQuestion11 === void 0 ? void 0 : _sortedResultQuestion11.questionText) || "";
28509
+ var resultQuestion3 = ((_sortedResultQuestion12 = sortedResultQuestions[2]) === null || _sortedResultQuestion12 === void 0 ? void 0 : _sortedResultQuestion12.questionText) || "";
28510
+ var resultQuestion4 = ((_sortedResultQuestion13 = sortedResultQuestions[3]) === null || _sortedResultQuestion13 === void 0 ? void 0 : _sortedResultQuestion13.questionText) || "";
28511
+ var resultQuestion5 = ((_sortedResultQuestion14 = sortedResultQuestions[4]) === null || _sortedResultQuestion14 === void 0 ? void 0 : _sortedResultQuestion14.questionText) || "";
28512
+ var resultQuestion6 = ((_sortedResultQuestion15 = sortedResultQuestions[5]) === null || _sortedResultQuestion15 === void 0 ? void 0 : _sortedResultQuestion15.questionText) || "";
28513
+ doc.setFont("Helvetica", "normal", "bold");
28514
+ doc.text(chartConference.overviewQuestionChoice[i].month, left, line + 20);
28515
+
28516
+ if (resultQuestion1 != "") {
28517
+ var _sortedResultQuestion16;
28518
+
28519
+ doc.setFont("Helvetica", "normal", "bold");
28520
+ doc.text(resultQuestion1, left + 10, line + 30);
28521
+ doc.setFont("Helvetica", "normal", "normal");
28522
+ doc.text(((_sortedResultQuestion16 = sortedResultQuestions[0]) === null || _sortedResultQuestion16 === void 0 ? void 0 : _sortedResultQuestion16.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion1 === null || resultQuestion1 === void 0 ? void 0 : resultQuestion1.length) * 3 + 17, line + 30);
28523
+ doc.setDrawColor(0);
28524
+ doc.setFillColor(64, 210, 204);
28525
+ doc.roundedRect(left, line + 25, 5, 5, 1, 1, "F");
28526
+ }
28527
+
28528
+ if (resultQuestion2 != "") {
28529
+ var _sortedResultQuestion17;
28530
+
28531
+ doc.setFont("Helvetica", "normal", "bold");
28532
+ doc.text(resultQuestion2, left + 10, line + 40);
28533
+ doc.setFont("Helvetica", "normal", "normal");
28534
+ doc.text(((_sortedResultQuestion17 = sortedResultQuestions[1]) === null || _sortedResultQuestion17 === void 0 ? void 0 : _sortedResultQuestion17.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion2 === null || resultQuestion2 === void 0 ? void 0 : resultQuestion2.length) * 3 + 17, line + 40);
28535
+ doc.setDrawColor(0);
28536
+ doc.setFillColor(120, 182, 226);
28537
+ doc.roundedRect(left, line + 35, 5, 5, 1, 1, "F");
28538
+ }
28539
+
28540
+ if (resultQuestion3 != "") {
28541
+ var _sortedResultQuestion18;
28542
+
28543
+ doc.setFont("Helvetica", "normal", "bold");
28544
+ doc.text(resultQuestion3, left + 10, line + 50);
28545
+ doc.setFont("Helvetica", "normal", "normal");
28546
+ doc.text(((_sortedResultQuestion18 = sortedResultQuestions[2]) === null || _sortedResultQuestion18 === void 0 ? void 0 : _sortedResultQuestion18.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion3 === null || resultQuestion3 === void 0 ? void 0 : resultQuestion3.length) * 3 + 17, line + 50);
28547
+ doc.setDrawColor(0);
28548
+ doc.setFillColor(255, 176, 79);
28549
+ doc.roundedRect(left, line + 45, 5, 5, 1, 1, "F");
28550
+ }
28551
+
28552
+ if (resultQuestion4 != "") {
28553
+ var _sortedResultQuestion19;
28554
+
28555
+ doc.setFont("Helvetica", "normal", "bold");
28556
+ doc.text(resultQuestion4, left + 10, line + 60);
28557
+ doc.setFont("Helvetica", "normal", "normal");
28558
+ doc.text(((_sortedResultQuestion19 = sortedResultQuestions[2]) === null || _sortedResultQuestion19 === void 0 ? void 0 : _sortedResultQuestion19.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion4 === null || resultQuestion4 === void 0 ? void 0 : resultQuestion4.length) * 3 + 17, line + 60);
28559
+ doc.setDrawColor(0);
28560
+ doc.setFillColor(206, 74, 73);
28561
+ doc.roundedRect(left, line + 55, 5, 5, 1, 1, "F");
28562
+ }
28563
+
28564
+ if (resultQuestion5 != "") {
28565
+ var _sortedResultQuestion20;
28566
+
28567
+ doc.setFont("Helvetica", "normal", "bold");
28568
+ doc.text(resultQuestion5, left + 10, line + 70);
28569
+ doc.setFont("Helvetica", "normal", "normal");
28570
+ doc.text(((_sortedResultQuestion20 = sortedResultQuestions[2]) === null || _sortedResultQuestion20 === void 0 ? void 0 : _sortedResultQuestion20.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion5 === null || resultQuestion5 === void 0 ? void 0 : resultQuestion5.length) * 3 + 17, line + 70);
28571
+ doc.setDrawColor(0);
28572
+ doc.setFillColor(27, 183, 177);
28573
+ doc.roundedRect(left, line + 65, 5, 5, 1, 1, "F");
28574
+ }
28575
+
28576
+ if (resultQuestion6 != "") {
28577
+ var _sortedResultQuestion21;
28578
+
28579
+ doc.setFont("Helvetica", "normal", "bold");
28580
+ doc.text(resultQuestion6, left + 10, line + 80);
28581
+ doc.setFont("Helvetica", "normal", "normal");
28582
+ doc.text(((_sortedResultQuestion21 = sortedResultQuestions[2]) === null || _sortedResultQuestion21 === void 0 ? void 0 : _sortedResultQuestion21.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion6 === null || resultQuestion6 === void 0 ? void 0 : resultQuestion6.length) * 3 + 17, line + 80);
28583
+ doc.setDrawColor(0);
28584
+ doc.setFillColor(75, 146, 206);
28585
+ doc.roundedRect(left, line + 75, 5, 5, 1, 1, "F");
28586
+ }
28587
+
28588
+ if ((resultQuestion1 === null || resultQuestion1 === void 0 ? void 0 : resultQuestion1.length) * 5 + 5 + 10 > 100) {
28589
+ left = left + (resultQuestion1 === null || resultQuestion1 === void 0 ? void 0 : resultQuestion1.length) * 5 + 20;
28590
+ } else if ((resultQuestion2 === null || resultQuestion2 === void 0 ? void 0 : resultQuestion2.length) * 5 + 5 + 10 > 100) {
28591
+ left = left + (resultQuestion2 === null || resultQuestion2 === void 0 ? void 0 : resultQuestion2.length) * 5 + 20;
28592
+ } else if ((resultQuestion3 === null || resultQuestion3 === void 0 ? void 0 : resultQuestion3.length) * 5 + 5 + 10 > 100) {
28593
+ left = left + (resultQuestion3 === null || resultQuestion3 === void 0 ? void 0 : resultQuestion3.length) * 5 + 20;
28594
+ } else if ((resultQuestion4 === null || resultQuestion4 === void 0 ? void 0 : resultQuestion4.length) * 5 + 5 + 10 > 100) {
28595
+ left = left + (resultQuestion4 === null || resultQuestion4 === void 0 ? void 0 : resultQuestion4.length) * 5 + 20;
28596
+ } else if ((resultQuestion5 === null || resultQuestion5 === void 0 ? void 0 : resultQuestion5.length) * 5 + 5 + 10 > 100) {
28597
+ left = left + (resultQuestion5 === null || resultQuestion5 === void 0 ? void 0 : resultQuestion5.length) * 5 + 20;
28598
+ } else if ((resultQuestion6 === null || resultQuestion6 === void 0 ? void 0 : resultQuestion6.length) * 5 + 5 + 10 > 100) {
28599
+ left = left + (resultQuestion6 === null || resultQuestion6 === void 0 ? void 0 : resultQuestion6.length) * 5 + 20;
28600
+ } else {
28601
+ left = left + 100;
28602
+ }
28603
+
28604
+ if (left + 80 > WIDTH_PAPER) {
28605
+ left = 20;
28606
+ line += 90;
28607
+ }
28608
+ }
28609
+ }
28610
+
28611
+ doc.addImage(canvas.toDataURL("image/png", 1.0), 15, line + 30, 420, 170);
28612
+ });
28613
+ });
28614
+ }
28615
+ }();
28616
+
28617
+ return _temp7 && _temp7.then ? _temp7.then(_temp8) : _temp8(_temp7);
28618
+ }
28619
+
28620
+ var _temp9 = function () {
28621
+ if (!!chartClassReflectionPDF) {
28622
+ var _selectedToPDF5;
28623
+
28624
+ var line = 80;
28625
+ var left = 20;
28626
+ if (selectedToPDF.indexOf(chartClassReflectionPDF) != 0 && ((_selectedToPDF5 = selectedToPDF[selectedToPDF.indexOf(chartClassReflectionPDF) - 1]) === null || _selectedToPDF5 === void 0 ? void 0 : _selectedToPDF5.id) != null) doc.addPage();
28627
+ return Promise.resolve(createImageHeader()).then(function () {
28628
+ doc.setFontSize(14);
28629
+ doc.setFont("Helvetica", "normal", "bold");
28630
+ doc.text(chartClassReflectionPDF.label, left, line);
28631
+ var chart = document.getElementById("class_reflection");
28632
+ return Promise.resolve(html2canvas(chart)).then(function (canvas) {
28633
+ doc.setFontSize(8);
28634
+
28635
+ for (var i = 0; i < ((_chartClassReflection = chartClassReflection.overviewQuestionChoice) === null || _chartClassReflection === void 0 ? void 0 : _chartClassReflection.length); i++) {
28636
+ var _chartClassReflection;
28637
+
28638
+ if (chartClassReflection.overviewQuestionChoice[i].resultQuestion[0].questionId != 0) {
28639
+ var _sortedResultQuestion22, _sortedResultQuestion23, _sortedResultQuestion24, _sortedResultQuestion25, _sortedResultQuestion26, _sortedResultQuestion27, _sortedResultQuestion28, _sortedResultQuestion29, _sortedResultQuestion30, _sortedResultQuestion31;
28640
+
28641
+ var sortedResultQuestions = chartClassReflection.overviewQuestionChoice[i].resultQuestion.sort(function (a, b) {
28642
+ return a.avgOfStudentChoice < b.avgOfStudentChoice ? 1 : -1;
28643
+ });
28644
+ var resultQuestion1 = ((_sortedResultQuestion22 = sortedResultQuestions[0]) === null || _sortedResultQuestion22 === void 0 ? void 0 : _sortedResultQuestion22.questionText.slice(3, (_sortedResultQuestion23 = sortedResultQuestions[0]) === null || _sortedResultQuestion23 === void 0 ? void 0 : _sortedResultQuestion23.questionText.indexOf("</p>"))) || "";
28645
+ var resultQuestion2 = ((_sortedResultQuestion24 = sortedResultQuestions[1]) === null || _sortedResultQuestion24 === void 0 ? void 0 : _sortedResultQuestion24.questionText.slice(3, (_sortedResultQuestion25 = sortedResultQuestions[1]) === null || _sortedResultQuestion25 === void 0 ? void 0 : _sortedResultQuestion25.questionText.indexOf("</p>"))) || "";
28646
+ var resultQuestion3 = ((_sortedResultQuestion26 = sortedResultQuestions[2]) === null || _sortedResultQuestion26 === void 0 ? void 0 : _sortedResultQuestion26.questionText.slice(3, (_sortedResultQuestion27 = sortedResultQuestions[2]) === null || _sortedResultQuestion27 === void 0 ? void 0 : _sortedResultQuestion27.questionText.indexOf("</p>"))) || "";
28647
+ var resultQuestion4 = ((_sortedResultQuestion28 = sortedResultQuestions[3]) === null || _sortedResultQuestion28 === void 0 ? void 0 : _sortedResultQuestion28.questionText.slice(3, (_sortedResultQuestion29 = sortedResultQuestions[3]) === null || _sortedResultQuestion29 === void 0 ? void 0 : _sortedResultQuestion29.questionText.indexOf("</p>"))) || "";
28648
+ var resultQuestion5 = ((_sortedResultQuestion30 = sortedResultQuestions[4]) === null || _sortedResultQuestion30 === void 0 ? void 0 : _sortedResultQuestion30.questionText.slice(3, (_sortedResultQuestion31 = sortedResultQuestions[4]) === null || _sortedResultQuestion31 === void 0 ? void 0 : _sortedResultQuestion31.questionText.indexOf("</p>"))) || "";
28649
+ doc.setFont("Helvetica", "normal", "bold");
28650
+ doc.text(chartClassReflection.overviewQuestionChoice[i].month, left, line + 20);
28651
+
28652
+ if (resultQuestion1 != "") {
28653
+ var _sortedResultQuestion32;
28654
+
28655
+ doc.setFont("Helvetica", "normal", "bold");
28656
+ doc.text(resultQuestion1, left + 10, line + 30);
28657
+ doc.setFont("Helvetica", "normal", "normal");
28658
+ doc.text(((_sortedResultQuestion32 = sortedResultQuestions[0]) === null || _sortedResultQuestion32 === void 0 ? void 0 : _sortedResultQuestion32.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion1 === null || resultQuestion1 === void 0 ? void 0 : resultQuestion1.length) * 3 + 15, line + 30);
28659
+ doc.setDrawColor(0);
28660
+ doc.setFillColor(64, 210, 204);
28661
+ doc.roundedRect(left, line + 25, 5, 5, 1, 1, "F");
28662
+ }
28663
+
28664
+ if (resultQuestion2 != "") {
28665
+ var _sortedResultQuestion33;
28666
+
28667
+ doc.setFont("Helvetica", "normal", "bold");
28668
+ doc.text(resultQuestion2, left + 10, line + 40);
28669
+ doc.setFont("Helvetica", "normal", "normal");
28670
+ doc.text(((_sortedResultQuestion33 = sortedResultQuestions[1]) === null || _sortedResultQuestion33 === void 0 ? void 0 : _sortedResultQuestion33.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion2 === null || resultQuestion2 === void 0 ? void 0 : resultQuestion2.length) * 3 + 15, line + 40);
28671
+ doc.setDrawColor(0);
28672
+ doc.setFillColor(120, 182, 226);
28673
+ doc.roundedRect(left, line + 35, 5, 5, 1, 1, "F");
28674
+ }
28675
+
28676
+ if (resultQuestion3 != "") {
28677
+ var _sortedResultQuestion34;
28678
+
28679
+ doc.setFont("Helvetica", "normal", "bold");
28680
+ doc.text(resultQuestion3, left + 10, line + 50);
28681
+ doc.setFont("Helvetica", "normal", "normal");
28682
+ doc.text(((_sortedResultQuestion34 = sortedResultQuestions[2]) === null || _sortedResultQuestion34 === void 0 ? void 0 : _sortedResultQuestion34.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion3 === null || resultQuestion3 === void 0 ? void 0 : resultQuestion3.length) * 3 + 15, line + 50);
28683
+ doc.setDrawColor(0);
28684
+ doc.setFillColor(255, 176, 79);
28685
+ doc.roundedRect(left, line + 45, 5, 5, 1, 1, "F");
28686
+ }
28687
+
28688
+ if (resultQuestion4 != "") {
28689
+ var _sortedResultQuestion35;
28690
+
28691
+ doc.setFont("Helvetica", "normal", "bold");
28692
+ doc.text(resultQuestion4, left + 10, line + 60);
28693
+ doc.setFont("Helvetica", "normal", "normal");
28694
+ doc.text(((_sortedResultQuestion35 = sortedResultQuestions[3]) === null || _sortedResultQuestion35 === void 0 ? void 0 : _sortedResultQuestion35.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion4 === null || resultQuestion4 === void 0 ? void 0 : resultQuestion4.length) * 3 + 15, line + 60);
28695
+ doc.setDrawColor(0);
28696
+ doc.setFillColor(206, 74, 73);
28697
+ doc.roundedRect(left, line + 55, 5, 5, 1, 1, "F");
28698
+ }
28699
+
28700
+ if (resultQuestion5 != "") {
28701
+ var _sortedResultQuestion36;
28702
+
28703
+ doc.setFont("Helvetica", "normal", "bold");
28704
+ doc.text(resultQuestion5, left + 10, line + 70);
28705
+ doc.setFont("Helvetica", "normal", "normal");
28706
+ doc.text(((_sortedResultQuestion36 = sortedResultQuestions[4]) === null || _sortedResultQuestion36 === void 0 ? void 0 : _sortedResultQuestion36.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion5 === null || resultQuestion5 === void 0 ? void 0 : resultQuestion5.length) * 3 + 15, line + 70);
28707
+ doc.setDrawColor(0);
28708
+ doc.setFillColor(27, 183, 177);
28709
+ doc.roundedRect(left, line + 65, 5, 5, 1, 1, "F");
28710
+ }
28711
+
28712
+ if ((resultQuestion1 === null || resultQuestion1 === void 0 ? void 0 : resultQuestion1.length) * 5 + 5 + 10 > 80) {
28713
+ left = left + (resultQuestion1 === null || resultQuestion1 === void 0 ? void 0 : resultQuestion1.length) * 5 + 15;
28714
+ } else if ((resultQuestion2 === null || resultQuestion2 === void 0 ? void 0 : resultQuestion2.length) * 5 + 5 + 10 > 80) {
28715
+ left = left + (resultQuestion2 === null || resultQuestion2 === void 0 ? void 0 : resultQuestion2.length) * 5 + 15;
28716
+ } else if ((resultQuestion3 === null || resultQuestion3 === void 0 ? void 0 : resultQuestion3.length) * 5 + 5 + 10 > 80) {
28717
+ left = left + (resultQuestion3 === null || resultQuestion3 === void 0 ? void 0 : resultQuestion3.length) * 5 + 15;
28718
+ } else if ((resultQuestion4 === null || resultQuestion4 === void 0 ? void 0 : resultQuestion4.length) * 5 + 5 + 10 > 80) {
28719
+ left = left + (resultQuestion4 === null || resultQuestion4 === void 0 ? void 0 : resultQuestion4.length) * 5 + 15;
28720
+ } else if ((resultQuestion5 === null || resultQuestion5 === void 0 ? void 0 : resultQuestion5.length) * 5 + 5 + 10 > 80) {
28721
+ left = left + (resultQuestion5 === null || resultQuestion5 === void 0 ? void 0 : resultQuestion5.length) * 5 + 15;
28722
+ } else {
28723
+ left = left + 80;
28724
+ }
28725
+
28726
+ if (left + 80 > WIDTH_PAPER) {
28727
+ left = 20;
28728
+ line += 75;
28729
+ }
28730
+ }
28731
+ }
28732
+
28733
+ doc.addImage(canvas.toDataURL("image/png", 1.0), 15, line + 30, 420, 170);
28734
+ });
28735
+ });
28736
+ }
28737
+ }();
28738
+
28739
+ return _temp9 && _temp9.then ? _temp9.then(_temp10) : _temp10(_temp9);
28740
+ }
28741
+
28742
+ var _temp11 = function () {
28743
+ if (!!chartOneToOne) {
28744
+ var _selectedToPDF6;
28745
+
28746
+ var line = 80;
28747
+ var left = 20;
28748
+ if (selectedToPDF.indexOf(chartOneToOne) != 0 && ((_selectedToPDF6 = selectedToPDF[selectedToPDF.indexOf(chartOneToOne) - 1]) === null || _selectedToPDF6 === void 0 ? void 0 : _selectedToPDF6.id) != null) doc.addPage();
28749
+ return Promise.resolve(createImageHeader()).then(function () {
28750
+ doc.setFontSize(14);
28751
+ doc.setFont("Helvetica", "normal", "bold");
28752
+ doc.text(chartOneToOne.label, left, line);
28753
+ var chart = document.getElementById("1_to_1");
28754
+ return Promise.resolve(html2canvas(chart)).then(function (canvas) {
28755
+ doc.setFontSize(8);
28756
+
28757
+ for (var i = 0; i < ((_chartOneToOneData$ov = chartOneToOneData.overviewQuestionChoice) === null || _chartOneToOneData$ov === void 0 ? void 0 : _chartOneToOneData$ov.length); i++) {
28758
+ var _chartOneToOneData$ov;
28759
+
28760
+ if (chartOneToOneData.overviewQuestionChoice[i].resultQuestion[0].questionId != 0) {
28761
+ var _sortedResultQuestion37, _sortedResultQuestion38, _sortedResultQuestion39, _sortedResultQuestion40, _sortedResultQuestion41, _sortedResultQuestion42, _sortedResultQuestion43, _sortedResultQuestion44, _sortedResultQuestion45, _sortedResultQuestion46, _sortedResultQuestion47, _sortedResultQuestion48, _sortedResultQuestion49, _sortedResultQuestion50, _sortedResultQuestion51, _sortedResultQuestion52, _sortedResultQuestion53, _sortedResultQuestion54;
28762
+
28763
+ var sortedResultQuestions = chartOneToOneData.overviewQuestionChoice[i].resultQuestion.sort(function (a, b) {
28764
+ return a.avgOfStudentChoice < b.avgOfStudentChoice ? 1 : -1;
28765
+ });
28766
+ var resultQuestion1 = ((_sortedResultQuestion37 = sortedResultQuestions[0]) === null || _sortedResultQuestion37 === void 0 ? void 0 : _sortedResultQuestion37.questionText.slice(3, (_sortedResultQuestion38 = sortedResultQuestions[0]) === null || _sortedResultQuestion38 === void 0 ? void 0 : _sortedResultQuestion38.questionText.indexOf("</p>"))) || "";
28767
+ var resultQuestion2 = ((_sortedResultQuestion39 = sortedResultQuestions[1]) === null || _sortedResultQuestion39 === void 0 ? void 0 : _sortedResultQuestion39.questionText.slice(3, (_sortedResultQuestion40 = sortedResultQuestions[1]) === null || _sortedResultQuestion40 === void 0 ? void 0 : _sortedResultQuestion40.questionText.indexOf("</p>"))) || "";
28768
+ var resultQuestion3 = ((_sortedResultQuestion41 = sortedResultQuestions[2]) === null || _sortedResultQuestion41 === void 0 ? void 0 : _sortedResultQuestion41.questionText.slice(3, (_sortedResultQuestion42 = sortedResultQuestions[2]) === null || _sortedResultQuestion42 === void 0 ? void 0 : _sortedResultQuestion42.questionText.indexOf("</p>"))) || "";
28769
+ var resultQuestion4 = ((_sortedResultQuestion43 = sortedResultQuestions[3]) === null || _sortedResultQuestion43 === void 0 ? void 0 : _sortedResultQuestion43.questionText.slice(3, (_sortedResultQuestion44 = sortedResultQuestions[3]) === null || _sortedResultQuestion44 === void 0 ? void 0 : _sortedResultQuestion44.questionText.indexOf("</p>"))) || "";
28770
+ var resultQuestion5 = ((_sortedResultQuestion45 = sortedResultQuestions[4]) === null || _sortedResultQuestion45 === void 0 ? void 0 : _sortedResultQuestion45.questionText.slice(3, (_sortedResultQuestion46 = sortedResultQuestions[4]) === null || _sortedResultQuestion46 === void 0 ? void 0 : _sortedResultQuestion46.questionText.indexOf("</p>"))) || "";
28771
+ var resultQuestion6 = ((_sortedResultQuestion47 = sortedResultQuestions[5]) === null || _sortedResultQuestion47 === void 0 ? void 0 : _sortedResultQuestion47.questionText.slice(3, (_sortedResultQuestion48 = sortedResultQuestions[5]) === null || _sortedResultQuestion48 === void 0 ? void 0 : _sortedResultQuestion48.questionText.indexOf("</p>"))) || "";
28772
+ var resultQuestion7 = ((_sortedResultQuestion49 = sortedResultQuestions[6]) === null || _sortedResultQuestion49 === void 0 ? void 0 : _sortedResultQuestion49.questionText.slice(3, (_sortedResultQuestion50 = sortedResultQuestions[6]) === null || _sortedResultQuestion50 === void 0 ? void 0 : _sortedResultQuestion50.questionText.indexOf("</p>"))) || "";
28773
+ var resultQuestion8 = ((_sortedResultQuestion51 = sortedResultQuestions[7]) === null || _sortedResultQuestion51 === void 0 ? void 0 : _sortedResultQuestion51.questionText.slice(3, (_sortedResultQuestion52 = sortedResultQuestions[7]) === null || _sortedResultQuestion52 === void 0 ? void 0 : _sortedResultQuestion52.questionText.indexOf("</p>"))) || "";
28774
+ var resultQuestion9 = ((_sortedResultQuestion53 = sortedResultQuestions[8]) === null || _sortedResultQuestion53 === void 0 ? void 0 : _sortedResultQuestion53.questionText.slice(3, (_sortedResultQuestion54 = sortedResultQuestions[8]) === null || _sortedResultQuestion54 === void 0 ? void 0 : _sortedResultQuestion54.questionText.indexOf("</p>"))) || "";
28775
+ doc.setFont("Helvetica", "normal", "bold");
28776
+ doc.text(chartOneToOneData.overviewQuestionChoice[i].month, left, line + 20);
28777
+
28778
+ if (resultQuestion1 != "") {
28779
+ var _sortedResultQuestion55;
28780
+
28781
+ doc.setFont("Helvetica", "normal", "bold");
28782
+ doc.text(resultQuestion1, left + 10, line + 30);
28783
+ doc.setFont("Helvetica", "normal", "normal");
28784
+ doc.text(((_sortedResultQuestion55 = sortedResultQuestions[0]) === null || _sortedResultQuestion55 === void 0 ? void 0 : _sortedResultQuestion55.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion1 === null || resultQuestion1 === void 0 ? void 0 : resultQuestion1.length) * 3 + 17, line + 30);
28785
+ doc.setDrawColor(0);
28786
+ doc.setFillColor(64, 210, 204);
28787
+ doc.roundedRect(left, line + 25, 5, 5, 1, 1, "F");
28788
+ }
28789
+
28790
+ if (resultQuestion2 != "") {
28791
+ var _sortedResultQuestion56;
28792
+
28793
+ doc.setFont("Helvetica", "normal", "bold");
28794
+ doc.text(resultQuestion2, left + 10, line + 40);
28795
+ doc.setFont("Helvetica", "normal", "normal");
28796
+ doc.text(((_sortedResultQuestion56 = sortedResultQuestions[1]) === null || _sortedResultQuestion56 === void 0 ? void 0 : _sortedResultQuestion56.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion2 === null || resultQuestion2 === void 0 ? void 0 : resultQuestion2.length) * 3 + 17, line + 40);
28797
+ doc.setDrawColor(0);
28798
+ doc.setFillColor(120, 182, 226);
28799
+ doc.roundedRect(left, line + 35, 5, 5, 1, 1, "F");
28800
+ }
28801
+
28802
+ if (resultQuestion3 != "") {
28803
+ var _sortedResultQuestion57;
28804
+
28805
+ doc.setFont("Helvetica", "normal", "bold");
28806
+ doc.text(resultQuestion3, left + 10, line + 50);
28807
+ doc.setFont("Helvetica", "normal", "normal");
28808
+ doc.text(((_sortedResultQuestion57 = sortedResultQuestions[2]) === null || _sortedResultQuestion57 === void 0 ? void 0 : _sortedResultQuestion57.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion3 === null || resultQuestion3 === void 0 ? void 0 : resultQuestion3.length) * 3 + 17, line + 50);
28809
+ doc.setDrawColor(0);
28810
+ doc.setFillColor(255, 176, 79);
28811
+ doc.roundedRect(left, line + 45, 5, 5, 1, 1, "F");
28812
+ }
28813
+
28814
+ if (resultQuestion4 != "") {
28815
+ var _sortedResultQuestion58;
28816
+
28817
+ doc.setFont("Helvetica", "normal", "bold");
28818
+ doc.text(resultQuestion4, left + 10, line + 60);
28819
+ doc.setFont("Helvetica", "normal", "normal");
28820
+ doc.text(((_sortedResultQuestion58 = sortedResultQuestions[3]) === null || _sortedResultQuestion58 === void 0 ? void 0 : _sortedResultQuestion58.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion4 === null || resultQuestion4 === void 0 ? void 0 : resultQuestion4.length) * 3 + 17, line + 60);
28821
+ doc.setDrawColor(0);
28822
+ doc.setFillColor(206, 74, 73);
28823
+ doc.roundedRect(left, line + 55, 5, 5, 1, 1, "F");
28824
+ }
28825
+
28826
+ if (resultQuestion5 != "") {
28827
+ var _sortedResultQuestion59;
28828
+
28829
+ doc.setFont("Helvetica", "normal", "bold");
28830
+ doc.text(resultQuestion5, left + 10, line + 70);
28831
+ doc.setFont("Helvetica", "normal", "normal");
28832
+ doc.text(((_sortedResultQuestion59 = sortedResultQuestions[4]) === null || _sortedResultQuestion59 === void 0 ? void 0 : _sortedResultQuestion59.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion5 === null || resultQuestion5 === void 0 ? void 0 : resultQuestion5.length) * 3 + 17, line + 70);
28833
+ doc.setDrawColor(0);
28834
+ doc.setFillColor(27, 183, 177);
28835
+ doc.roundedRect(left, line + 65, 5, 5, 1, 1, "F");
28836
+ }
28837
+
28838
+ if (resultQuestion6 != "") {
28839
+ var _sortedResultQuestion60;
28840
+
28841
+ doc.setFont("Helvetica", "normal", "bold");
28842
+ doc.text(resultQuestion6, left + 10, line + 80);
28843
+ doc.setFont("Helvetica", "normal", "normal");
28844
+ doc.text(((_sortedResultQuestion60 = sortedResultQuestions[5]) === null || _sortedResultQuestion60 === void 0 ? void 0 : _sortedResultQuestion60.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion6 === null || resultQuestion6 === void 0 ? void 0 : resultQuestion6.length) * 3 + 17, line + 80);
28845
+ doc.setDrawColor(0);
28846
+ doc.setFillColor(75, 146, 206);
28847
+ doc.roundedRect(left, line + 75, 5, 5, 1, 1, "F");
28848
+ }
28849
+
28850
+ if (resultQuestion7 != "") {
28851
+ var _sortedResultQuestion61;
28852
+
28853
+ doc.setFont("Helvetica", "normal", "bold");
28854
+ doc.text(resultQuestion7, left + 10, line + 90);
28855
+ doc.setFont("Helvetica", "normal", "normal");
28856
+ doc.text(((_sortedResultQuestion61 = sortedResultQuestions[6]) === null || _sortedResultQuestion61 === void 0 ? void 0 : _sortedResultQuestion61.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion7 === null || resultQuestion7 === void 0 ? void 0 : resultQuestion7.length) * 3 + 17, line + 90);
28857
+ doc.setDrawColor(0);
28858
+ doc.setFillColor(240, 148, 34);
28859
+ doc.roundedRect(left, line + 85, 5, 5, 1, 1, "F");
28860
+ }
28861
+
28862
+ if (resultQuestion8 != "") {
28863
+ var _sortedResultQuestion62;
28864
+
28865
+ doc.setFont("Helvetica", "normal", "bold");
28866
+ doc.text(resultQuestion8, left + 10, line + 100);
28867
+ doc.setFont("Helvetica", "normal", "normal");
28868
+ doc.text(((_sortedResultQuestion62 = sortedResultQuestions[7]) === null || _sortedResultQuestion62 === void 0 ? void 0 : _sortedResultQuestion62.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion8 === null || resultQuestion8 === void 0 ? void 0 : resultQuestion8.length) * 3 + 17, line + 100);
28869
+ doc.setDrawColor(0);
28870
+ doc.setFillColor(162, 51, 51);
28871
+ doc.roundedRect(left, line + 95, 5, 5, 1, 1, "F");
28872
+ }
28873
+
28874
+ if (resultQuestion9 != "") {
28875
+ var _sortedResultQuestion63;
28876
+
28877
+ doc.setFont("Helvetica", "normal", "bold");
28878
+ doc.text(resultQuestion9, left + 10, line + 110);
28879
+ doc.setFont("Helvetica", "normal", "normal");
28880
+ doc.text(((_sortedResultQuestion63 = sortedResultQuestions[8]) === null || _sortedResultQuestion63 === void 0 ? void 0 : _sortedResultQuestion63.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion9 === null || resultQuestion9 === void 0 ? void 0 : resultQuestion9.length) * 3 + 17, line + 110);
28881
+ doc.setDrawColor(0);
28882
+ doc.setFillColor(11, 153, 148);
28883
+ doc.roundedRect(left, line + 105, 5, 5, 1, 1, "F");
28884
+ }
28885
+
28886
+ left = left + 100;
28887
+
28888
+ if (left + 80 > WIDTH_PAPER) {
28889
+ left = 20;
28890
+ line += 110;
28891
+ }
28892
+ }
28893
+ }
28894
+
28895
+ doc.addImage(canvas.toDataURL("image/png", 1.0), 15, line + 25, 420, 170);
28896
+ });
28897
+ });
28898
+ }
28899
+ }();
28900
+
28901
+ return _temp11 && _temp11.then ? _temp11.then(_temp12) : _temp12(_temp11);
28902
+ }
28903
+
28904
+ var _temp13 = function () {
28905
+ if (!!chartReadinessToLearn) {
28906
+ var _selectedToPDF7;
28907
+
28908
+ var line = 80;
28909
+ var left = 20;
28910
+ if (selectedToPDF.indexOf(chartReadinessToLearn) != 0 && ((_selectedToPDF7 = selectedToPDF[selectedToPDF.indexOf(chartReadinessToLearn) - 1]) === null || _selectedToPDF7 === void 0 ? void 0 : _selectedToPDF7.id) != null) doc.addPage();
28911
+ return Promise.resolve(createImageHeader()).then(function () {
28912
+ doc.setFontSize(14);
28913
+ doc.setFont("Helvetica", "normal", "bold");
28914
+ doc.text(chartReadinessToLearn.label, left, line);
28915
+ var chart = document.getElementById("readiness_to_learn");
28916
+ return Promise.resolve(html2canvas(chart)).then(function (canvas) {
28917
+ doc.addImage(canvas.toDataURL("image/png", 1.0), 15, line + 30, 420, 150);
28918
+ });
28919
+ });
28920
+ }
28921
+ }();
28922
+
28923
+ return _temp13 && _temp13.then ? _temp13.then(_temp14) : _temp14(_temp13);
28924
+ }
28925
+
28926
+ var doc = new jsPDF({
28927
+ orientation: "p",
28928
+ unit: "px",
28929
+ format: "a4"
28930
+ });
28931
+ var WIDTH_PAPER = doc.internal.pageSize.width;
28932
+
28933
+ var createImageHeader = function createImageHeader() {
28934
+ try {
28935
+ var imageLogo = document.getElementById("header-logo");
28936
+ return Promise.resolve(html2canvas(imageLogo)).then(function (imageLogoCanvas) {
28937
+ doc.addImage(imageLogoCanvas.toDataURL("image/png", 1.0), "png", 20, 20, 100, 30);
28938
+ });
28939
+ } catch (e) {
28940
+ return Promise.reject(e);
28941
+ }
28942
+ };
28943
+
28944
+ var line = 80;
28945
+ var left = 20;
28946
+
28947
+ var _temp15 = function () {
28948
+ if (!!chartHightImpactLearningStrategie) {
28949
+ var line = 80;
28950
+ var left = 20;
28951
+ if (selectedToPDF.indexOf(chartHightImpactLearningStrategie) != 0 && selectedToPDF[selectedToPDF.indexOf(chartHightImpactLearningStrategie) - 1].id != null) doc.addPage();
28952
+ return Promise.resolve(createImageHeader()).then(function () {
28953
+ doc.setFontSize(14);
28954
+ doc.setFont("Helvetica", "normal", "bold");
28955
+ doc.text(chartHightImpactLearningStrategie.label, left, line);
28956
+ var chart = document.getElementById("high_impact_learning_strategie");
28957
+ return Promise.resolve(html2canvas(chart)).then(function (canvas) {
28958
+ doc.setFontSize(8);
28959
+
28960
+ for (var j = 0; j < ((_topLearningStrategie = topLearningStrategies.learningStrategies) === null || _topLearningStrategie === void 0 ? void 0 : _topLearningStrategie.length); j++) {
28961
+ var _topLearningStrategie, _topLearningStrategie2, _topLearningStrategie3;
28962
+
28963
+ var sumUsagePoint = topLearningStrategies.learningStrategies[j].usagePoint.reduce(function (partialSum, a) {
28964
+ return partialSum + a;
28965
+ }, 0);
28966
+ var avgSumUsagePoint = sumUsagePoint / ((_topLearningStrategie2 = topLearningStrategies.learningStrategies[j].usagePoint) === null || _topLearningStrategie2 === void 0 ? void 0 : _topLearningStrategie2.length) || 0;
28967
+
28968
+ if (topLearningStrategies.learningStrategies[j].usageCount != 0 || ((_topLearningStrategie3 = topLearningStrategies.learningStrategies[j].usagePoint) === null || _topLearningStrategie3 === void 0 ? void 0 : _topLearningStrategie3.length) > 0) {
28969
+ var _topLearningStrategie4, _topLearningStrategie5, _topLearningStrategie6, _topLearningStrategie7;
28970
+
28971
+ doc.setFont("Helvetica", "normal", "bold");
28972
+ doc.text(topLearningStrategies.learningStrategies[j].learningStrategyName, left, line + 20);
28973
+ doc.setFont("Helvetica", "normal", "normal");
28974
+ doc.text("Usage count: " + topLearningStrategies.learningStrategies[j].usageCount || "0", left, line + 30);
28975
+ doc.text("Usage point: " + avgSumUsagePoint, left, line + 40);
28976
+ left = left + (((_topLearningStrategie4 = topLearningStrategies.learningStrategies[j].learningStrategyName) === null || _topLearningStrategie4 === void 0 ? void 0 : _topLearningStrategie4.length) * 4 > 45 ? ((_topLearningStrategie5 = topLearningStrategies.learningStrategies[j].learningStrategyName) === null || _topLearningStrategie5 === void 0 ? void 0 : _topLearningStrategie5.length) * 4 : 60) + 15;
28977
+
28978
+ if (left + ((_topLearningStrategie6 = topLearningStrategies.learningStrategies[j + 1]) === null || _topLearningStrategie6 === void 0 ? void 0 : (_topLearningStrategie7 = _topLearningStrategie6.learningStrategyName) === null || _topLearningStrategie7 === void 0 ? void 0 : _topLearningStrategie7.length) * 5 + 15 > WIDTH_PAPER) {
28979
+ line += 40;
28980
+ left = 20;
28981
+ }
28982
+ }
28983
+ }
28984
+
28985
+ doc.addImage(canvas.toDataURL("image/png", 1.0), 15, line + 40, 420, 130);
28986
+ });
28987
+ });
28988
+ }
28989
+ }();
28990
+
28991
+ return _temp15 && _temp15.then ? _temp15.then(_temp16) : _temp16(_temp15);
28992
+ }, function () {
28993
+ dispatch(marioCore.setAlert({
28994
+ type: "danger",
28995
+ message: "Can't print"
28996
+ }));
28997
+ });
28998
+
28999
+ return Promise.resolve(_temp20 && _temp20.then ? _temp20.then(_temp19) : _temp19(_temp20));
29000
+ } catch (e) {
29001
+ return Promise.reject(e);
29002
+ }
29003
+ };
29004
+
29005
+ return React__default.createElement("div", null, !!chartHightImpactLearningStrategie && React__default.createElement("div", {
29006
+ className: "" + styles$1["chart-to-canvas"]
29007
+ }, React__default.createElement("div", {
29008
+ id: chartHightImpactLearningStrategie.id
29009
+ }, chartHightImpactLearningStrategie.children())), !!chartReadinessToLearn && React__default.createElement("div", {
29010
+ className: "" + styles$1["chart-to-canvas"]
29011
+ }, React__default.createElement("div", {
29012
+ id: chartReadinessToLearn.id
29013
+ }, chartReadinessToLearn.children())), !!chartOneToOne && React__default.createElement("div", {
29014
+ className: "" + styles$1["chart-to-canvas"]
29015
+ }, React__default.createElement("div", {
29016
+ id: chartOneToOne.id
29017
+ }, chartOneToOne.children(typeChartList[initialData.map(function (i) {
29018
+ return i.id;
29019
+ }).indexOf(chartOneToOne === null || chartOneToOne === void 0 ? void 0 : chartOneToOne.id)]))), !!chartClassReflectionPDF && React__default.createElement("div", {
29020
+ className: "" + styles$1["chart-to-canvas"]
29021
+ }, React__default.createElement("div", {
29022
+ id: chartClassReflectionPDF.id
29023
+ }, chartClassReflectionPDF.children(typeChartList[initialData.map(function (i) {
29024
+ return i.id;
29025
+ }).indexOf(chartClassReflectionPDF === null || chartClassReflectionPDF === void 0 ? void 0 : chartClassReflectionPDF.id)]))), !!chartConferecePDF && React__default.createElement("div", {
29026
+ className: "" + styles$1["chart-to-canvas"]
29027
+ }, React__default.createElement("div", {
29028
+ id: chartConferecePDF.id
29029
+ }, chartConferecePDF.children(typeChartList[initialData.map(function (i) {
29030
+ return i.id;
29031
+ }).indexOf(chartConferecePDF === null || chartConferecePDF === void 0 ? void 0 : chartConferecePDF.id)]))), !!chartSafety && React__default.createElement("div", {
29032
+ className: "" + styles$1["chart-to-canvas"]
29033
+ }, React__default.createElement("div", {
29034
+ id: chartSafety.id
29035
+ }, chartSafety.children(typeChartList[initialData.map(function (i) {
29036
+ return i.id;
29037
+ }).indexOf(chartSafety === null || chartSafety === void 0 ? void 0 : chartSafety.id)]))), !!chartStudentByAge && React__default.createElement("div", {
29038
+ className: "" + styles$1["chart-to-canvas"]
29039
+ }, React__default.createElement("div", {
29040
+ id: chartStudentByAge.id
29041
+ }, chartStudentByAge.children(null, true))), !!chartStudentByGrade && React__default.createElement("div", {
29042
+ className: "" + styles$1["chart-to-canvas"]
29043
+ }, React__default.createElement("div", {
29044
+ id: chartStudentByGrade.id
29045
+ }, chartStudentByGrade.children())), React__default.createElement("div", {
29046
+ className: "" + styles$1["image-logo"],
29047
+ id: "header-logo"
29048
+ }, React__default.createElement("img", {
29049
+ src: headerLogo,
29050
+ alt: ""
29051
+ })), React__default.createElement(reactstrap.Button, {
29052
+ color: "success",
29053
+ onClick: function onClick() {
29054
+ selectedToPDF.length > 0 && generatePDF();
29055
+ }
29056
+ }, "Export"));
29057
+ };
29058
+
27972
29059
  var Dashboard = function Dashboard() {
27973
29060
  var _useChartDatas = useChartDatas(),
27974
29061
  chartDashBoards = _useChartDatas.chartDashBoards,
@@ -27988,9 +29075,58 @@ var Dashboard = function Dashboard() {
27988
29075
  teacherUserId = _useBehavior.teacherUserId,
27989
29076
  changeCurrentTeacherUserId = _useBehavior.changeCurrentTeacherUserId;
27990
29077
 
29078
+ var _useDashboard = useDashboard(),
29079
+ handleSelectToPrint = _useDashboard.handleSelectToPrint,
29080
+ checkSelectedItem = _useDashboard.checkSelectedItem,
29081
+ selectedToPrint = _useDashboard.selectedToPrint,
29082
+ setSelectedToPrint = _useDashboard.setSelectedToPrint;
29083
+
29084
+ var _useState = React.useState(false),
29085
+ modal = _useState[0],
29086
+ setModal = _useState[1];
29087
+
29088
+ var toggle = function toggle() {
29089
+ setSelectedToPrint([]);
29090
+ setModal(!modal);
29091
+ };
29092
+
27991
29093
  return React__default.createElement("div", {
27992
29094
  className: "" + styles$1["block-dashboard"]
27993
- }, React__default.createElement("div", {
29095
+ }, React__default.createElement(reactstrap.Modal, {
29096
+ isOpen: modal,
29097
+ toggle: toggle,
29098
+ style: {
29099
+ overflow: "hidden"
29100
+ },
29101
+ centered: true
29102
+ }, React__default.createElement(reactstrap.ModalHeader, null, React__default.createElement("p", {
29103
+ className: "" + styles$1["title-modal"]
29104
+ }, "Export to PDF"), React__default.createElement("p", {
29105
+ className: "" + styles$1["header-desc-modal"]
29106
+ }, "The data is taken from the home screen."), React__default.createElement("p", {
29107
+ className: "" + styles$1["header-desc-modal"]
29108
+ }, "Make sure everything is set correctly before exporting.")), React__default.createElement(reactstrap.ModalBody, null, chartDashBoards === null || chartDashBoards === void 0 ? void 0 : chartDashBoards.map(function (item, index) {
29109
+ return React__default.createElement(reactstrap.FormGroup, {
29110
+ check: true,
29111
+ className: "" + styles$1["form-checkbox"]
29112
+ }, React__default.createElement(reactstrap.Input, {
29113
+ type: "checkbox",
29114
+ checked: checkSelectedItem(item.id),
29115
+ onChange: function onChange(event) {
29116
+ return handleSelectToPrint(event.target.checked, item, typeChartList[index]);
29117
+ }
29118
+ }), React__default.createElement(reactstrap.Label, {
29119
+ check: true,
29120
+ className: "" + styles$1["checkbox-content"]
29121
+ }, item.label));
29122
+ })), React__default.createElement(reactstrap.ModalFooter, null, React__default.createElement(reactstrap.Button, {
29123
+ color: "light",
29124
+ onClick: toggle
29125
+ }, "Cancel"), React__default.createElement(DashboardToPDF, {
29126
+ selectedToPDF: selectedToPrint,
29127
+ initialData: chartDashBoards,
29128
+ typeChartList: typeChartList
29129
+ }))), React__default.createElement("div", {
27994
29130
  className: "d-flex align-items-center justify-content-between"
27995
29131
  }, React__default.createElement("div", {
27996
29132
  className: "d-flex align-items-center mx-3"
@@ -28001,7 +29137,8 @@ var Dashboard = function Dashboard() {
28001
29137
  src: "images/waving-hand.png",
28002
29138
  alt: ""
28003
29139
  })), React__default.createElement("button", {
28004
- className: styles$1["button-export"] + " d-flex align-items-center border-0 p-0"
29140
+ className: styles$1["button-export"] + " d-flex align-items-center border-0 p-0",
29141
+ onClick: toggle
28005
29142
  }, React__default.createElement("div", {
28006
29143
  className: "" + styles$1["button-icon"]
28007
29144
  }, React__default.createElement("img", {