mario-education 2.2.2 → 2.2.7

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.
@@ -1,4 +1,4 @@
1
- import { api, BASE_URL, setAlert, CustomSelector, LinkEditButton, DeleteButtonIcon, EmptyDataAlert, CommonModal, RequiredLabel, ErrorHandler, useFilters, setLoading, setClassList, setModal, QuitPrompt, AddButton, CustomPagination, setConferenceRubricList, SearchBoxContainer, getTextFromHTML, generateRandomString, QuestionCategorySelector, DetailActionButtons, SuggestionCategorySelector, CreatableSelector, setSuggestionList, setStrategyList, UploadFileButton, systemStudentBadge, setBadgeList, getFileUrl, setGoalExampleList, setSubjectList, setLearningSupportCategoryList, apiUpload, utcToLocalTime, DATE_FORMAT, setSemesterList, setBandScoreList, EditButtonIcon, setSchoolBlankDayList, SearchBox, CustomTab, SkillList, QUESTION_TYPES, EMOTIONS, QUESTION_TYPES_OPTIONS, setQuestionList, setQuestionByCategory, setSelectQuestion, setResetQuestionList, setMoveItemQuestion, setEditItemQuesion, DEFAULT_FILTER, setReflectionList, setReflectionResultList, DATE_RESULT, StarRatingSelector, editorConfig, TINY_MCE_API_KEY, QuestionTypeSelector, setAssessmentList, FULL_DATE_RESULT, setFeedbackList, setTutorialScreenList, setQuestionCateList, setAssignmentList, setSessionTemplateList, setSessionTemplateGeneralClassList, setCustomAlertList, systemCertificateUpload, setCertificateList, Loading as Loading$1, LICENSE_AGGRID } from 'mario-core';
1
+ import { api, BASE_URL, setAlert, CustomSelector, LinkEditButton, DeleteButtonIcon, EmptyDataAlert, CommonModal, RequiredLabel, ErrorHandler, useFilters, setLoading, setClassList, setModal, QuitPrompt, AddButton, CustomPagination, setConferenceRubricList, SearchBoxContainer, getTextFromHTML, generateRandomString, QuestionCategorySelector, DetailActionButtons, SuggestionCategorySelector, CreatableSelector, setSuggestionList, setStrategyList, UploadFileButton, systemStudentBadge, setBadgeList, getFileUrl, setGoalExampleList, setSubjectList, setLearningSupportCategoryList, apiUpload, utcToLocalTime, DATE_FORMAT, setSemesterList, setBandScoreList, EditButtonIcon, setSchoolBlankDayList, SearchBox, CustomTab, SkillList, QUESTION_TYPES, EMOTIONS, QUESTION_TYPES_OPTIONS, setQuestionList, setQuestionByCategory, setSelectQuestion, setResetQuestionList, setMoveItemQuestion, setEditItemQuesion, DEFAULT_FILTER, setReflectionList, setReflectionResultList, DATE_RESULT, StarRatingSelector, editorConfig, TINY_MCE_API_KEY, QuestionTypeSelector, setAssessmentList, FULL_DATE_RESULT, setFeedbackList, setTutorialScreenList, setQuestionCateList, setAssignmentList, setSessionTemplateList, setSessionTemplateGeneralClassList, setCustomAlertList, systemCertificateUpload, setCertificateList, LICENSE_AGGRID } from 'mario-core';
2
2
  import { LicenseManager } from '@ag-grid-enterprise/core';
3
3
  import React, { useState, useRef, useCallback, useEffect, forwardRef, useMemo, Fragment, memo } from 'react';
4
4
  import { useDispatch, useSelector } from 'react-redux';
@@ -5225,10 +5225,6 @@ var CSVType;
5225
5225
  })(CSVType || (CSVType = {}));
5226
5226
 
5227
5227
  var buttons = [{
5228
- text: "Import students",
5229
- backgroundColor: "#0abde3",
5230
- type: CSVType.Students
5231
- }, {
5232
5228
  text: "Import subjects",
5233
5229
  backgroundColor: "#1dd1a1",
5234
5230
  type: CSVType.Subjects
@@ -9931,12 +9927,13 @@ var useQuestionDetail = function useQuestionDetail(id) {
9931
9927
  }, [questionDetail]);
9932
9928
  var confirmData = useCallback(function (data) {
9933
9929
  try {
9930
+ var _exit2 = false;
9931
+
9934
9932
  var _temp7 = function _temp7(_result) {
9935
9933
  if (_exit2) return _result;
9936
9934
  dispatch(setLoading(false));
9937
9935
  };
9938
9936
 
9939
- var _exit2 = false;
9940
9937
  dispatch(setLoading(true));
9941
9938
 
9942
9939
  var _temp8 = _catch(function () {
@@ -17167,18 +17164,12 @@ var getQuantityReport = function getQuantityReport() {
17167
17164
  var getLoginCountingReport = function getLoginCountingReport() {
17168
17165
  return api.get(REPORT_URL + "/logincouting");
17169
17166
  };
17170
- var getSkillReport = function getSkillReport() {
17171
- return api.get(REPORT_URL + "/skill");
17172
- };
17173
17167
  var getGoalProgressReport = function getGoalProgressReport() {
17174
17168
  return api.get(REPORT_URL + "/goalprogress");
17175
17169
  };
17176
17170
  var getHighImpactLearningStrategyReport = function getHighImpactLearningStrategyReport() {
17177
17171
  return api.get(REPORT_URL + "/highimpactlearningstrategy");
17178
17172
  };
17179
- var getTimeInSessionReport = function getTimeInSessionReport() {
17180
- return api.get(REPORT_URL + "/timeinsession");
17181
- };
17182
17173
  var getPerceivedImpactReport = function getPerceivedImpactReport() {
17183
17174
  return api.get(REPORT_URL + "/perceivedimpact");
17184
17175
  };
@@ -17200,28 +17191,20 @@ var useDashboard = function useDashboard() {
17200
17191
  setQuantity = _useState2[1];
17201
17192
 
17202
17193
  var _useState3 = useState(null),
17203
- skill = _useState3[0],
17204
- setSkill = _useState3[1];
17194
+ goalProgress = _useState3[0],
17195
+ setGoalProgress = _useState3[1];
17205
17196
 
17206
17197
  var _useState4 = useState(null),
17207
- goalProgress = _useState4[0],
17208
- setGoalProgress = _useState4[1];
17198
+ highImpact = _useState4[0],
17199
+ setHighImpact = _useState4[1];
17209
17200
 
17210
17201
  var _useState5 = useState(null),
17211
- highImpact = _useState5[0],
17212
- setHighImpact = _useState5[1];
17202
+ perceivedImpact = _useState5[0],
17203
+ setPerceivedImpact = _useState5[1];
17213
17204
 
17214
17205
  var _useState6 = useState(null),
17215
- perceivedImpact = _useState6[0],
17216
- setPerceivedImpact = _useState6[1];
17217
-
17218
- var _useState7 = useState(null),
17219
- timeInSession = _useState7[0],
17220
- setTimeInSession = _useState7[1];
17221
-
17222
- var _useState8 = useState(null),
17223
- grade = _useState8[0],
17224
- setGrade = _useState8[1];
17206
+ grade = _useState6[0],
17207
+ setGrade = _useState6[1];
17225
17208
 
17226
17209
  var callApi = useCallback(function (apiCaller, setData, defaultData) {
17227
17210
  try {
@@ -17248,7 +17231,7 @@ var useDashboard = function useDashboard() {
17248
17231
  try {
17249
17232
  document.title = TITLE$p;
17250
17233
  dispatch(setLoading(true));
17251
- return Promise.resolve(Promise.any([callApi(getLoginCountingReport, setLoginCounting, []), callApi(getQuantityReport, setQuantity, {}), callApi(getSkillReport, setSkill, []), callApi(getGoalProgressReport, setGoalProgress, []), callApi(getHighImpactLearningStrategyReport, setHighImpact, {}), callApi(getPerceivedImpactReport, setPerceivedImpact, []), callApi(getTimeInSessionReport, setTimeInSession, []), callApi(getGradeReport, setGrade, {})])).then(function () {
17234
+ return Promise.resolve(Promise.any([callApi(getLoginCountingReport, setLoginCounting, []), callApi(getQuantityReport, setQuantity, {}), callApi(getGoalProgressReport, setGoalProgress, []), callApi(getHighImpactLearningStrategyReport, setHighImpact, {}), callApi(getPerceivedImpactReport, setPerceivedImpact, []), callApi(getGradeReport, setGrade, {})])).then(function () {
17252
17235
  dispatch(setLoading(false));
17253
17236
  });
17254
17237
  } catch (e) {
@@ -17261,11 +17244,9 @@ var useDashboard = function useDashboard() {
17261
17244
  return {
17262
17245
  loginCounting: loginCounting,
17263
17246
  quantity: quantity,
17264
- skill: skill,
17265
17247
  goalProgress: goalProgress,
17266
17248
  highImpact: highImpact,
17267
17249
  perceivedImpact: perceivedImpact,
17268
- timeInSession: timeInSession,
17269
17250
  grade: grade
17270
17251
  };
17271
17252
  };
@@ -17284,107 +17265,6 @@ var DashboardCard = function DashboardCard(_ref) {
17284
17265
  }, children));
17285
17266
  };
17286
17267
 
17287
- var colors = ["#1C77AC", "#00979B", "#8B0000", "#87E0E0", "#2EB82E"];
17288
- var levels = [{
17289
- name: "No progress",
17290
- field: "noProgress"
17291
- }, {
17292
- name: "Slight",
17293
- field: "slight"
17294
- }, {
17295
- name: "Moderate",
17296
- field: "moderate"
17297
- }, {
17298
- name: "Significant",
17299
- field: "significant"
17300
- }, {
17301
- name: "Achieved",
17302
- field: "achieved"
17303
- }];
17304
-
17305
- var GoalProgressReport = function GoalProgressReport(_ref) {
17306
- var data = _ref.data;
17307
- var series = useMemo(function () {
17308
- if (!data) return [];
17309
-
17310
- try {
17311
- return levels.map(function (level) {
17312
- return {
17313
- name: level.name,
17314
- data: data.map(function (item) {
17315
- return item[level.field];
17316
- })
17317
- };
17318
- });
17319
- } catch (_unused) {
17320
- return [];
17321
- }
17322
- }, [data]);
17323
- var categories = useMemo(function () {
17324
- if (!data) return [];
17325
-
17326
- try {
17327
- return data.map(function (item) {
17328
- return item.createdAt;
17329
- });
17330
- } catch (_unused2) {
17331
- return [];
17332
- }
17333
- }, [data]);
17334
- if (!data) return React.createElement(Loading$1, null);
17335
- var options = {
17336
- chart: {
17337
- type: "bar",
17338
- height: 350,
17339
- stacked: true,
17340
- stackType: "100%",
17341
- toolbar: {
17342
- show: false
17343
- }
17344
- },
17345
- plotOptions: {
17346
- bar: {
17347
- horizontal: false,
17348
- columnWidth: "80%"
17349
- }
17350
- },
17351
- colors: colors,
17352
- responsive: [{
17353
- breakpoint: 480,
17354
- options: {
17355
- legend: {
17356
- position: "bottom",
17357
- offsetX: -10,
17358
- offsetY: 0
17359
- }
17360
- }
17361
- }],
17362
- xaxis: {
17363
- categories: categories
17364
- },
17365
- fill: {
17366
- opacity: 1
17367
- },
17368
- legend: {
17369
- position: "right",
17370
- offsetX: 0,
17371
- offsetY: 50,
17372
- onItemClick: {
17373
- toggleDataSeries: false
17374
- },
17375
- onItemHover: {
17376
- highlightDataSeries: false
17377
- }
17378
- }
17379
- };
17380
- return React.createElement("div", null, React.createElement(ReactApexChart, {
17381
- options: options,
17382
- series: series,
17383
- type: "bar",
17384
- height: 350
17385
- }));
17386
- };
17387
-
17388
17268
  var Loading = function Loading() {
17389
17269
  return React.createElement("div", {
17390
17270
  className: "d-flex align-items-center justify-content-center"
@@ -17406,14 +17286,14 @@ var Loading = function Loading() {
17406
17286
  }, "Loading...")));
17407
17287
  };
17408
17288
 
17409
- var colors$1 = ["rgba(129, 236, 236, 0.8)", "rgba(116, 185, 255, 0.8)", "rgba(250, 177, 160, 0.8)", "rgba(255, 234, 167, 0.8)", "rgba(178, 190, 195, 0.8)", "rgba(85, 239, 196, 0.8)", "rgba(120, 111, 166, 0.8)", "rgba(243, 166, 131, 0.8)"];
17289
+ var colors = ["rgba(129, 236, 236, 0.8)", "rgba(116, 185, 255, 0.8)", "rgba(250, 177, 160, 0.8)", "rgba(255, 234, 167, 0.8)", "rgba(178, 190, 195, 0.8)", "rgba(85, 239, 196, 0.8)", "rgba(120, 111, 166, 0.8)", "rgba(243, 166, 131, 0.8)"];
17410
17290
 
17411
17291
  var getColors = function getColors(length) {
17412
- if (colors$1.length >= length) return colors$1;
17413
- var newColors = [].concat(colors$1);
17292
+ if (colors.length >= length) return colors;
17293
+ var newColors = [].concat(colors);
17414
17294
 
17415
17295
  while (newColors.length < length) {
17416
- newColors = [].concat(newColors, colors$1);
17296
+ newColors = [].concat(newColors, colors);
17417
17297
  }
17418
17298
 
17419
17299
  return newColors;
@@ -17504,7 +17384,7 @@ var HighImpact = function HighImpact(_ref) {
17504
17384
  })));
17505
17385
  };
17506
17386
 
17507
- var colors$2 = ["#1abc9c", "#c0392b"];
17387
+ var colors$1 = ["#1abc9c", "#c0392b"];
17508
17388
 
17509
17389
  var LoginCouting = function LoginCouting(_ref) {
17510
17390
  var data = _ref.data;
@@ -17521,11 +17401,11 @@ var LoginCouting = function LoginCouting(_ref) {
17521
17401
  var series = [{
17522
17402
  name: "Teacher",
17523
17403
  data: teacherCount,
17524
- color: colors$2[0]
17404
+ color: colors$1[0]
17525
17405
  }, {
17526
17406
  name: "Student",
17527
17407
  data: studentCount,
17528
- color: colors$2[1]
17408
+ color: colors$1[1]
17529
17409
  }];
17530
17410
  var options = {
17531
17411
  chart: {
@@ -17542,7 +17422,7 @@ var LoginCouting = function LoginCouting(_ref) {
17542
17422
  markers: {
17543
17423
  size: 4,
17544
17424
  colors: ["#fff"],
17545
- strokeColors: colors$2,
17425
+ strokeColors: colors$1,
17546
17426
  strokeWidth: 2,
17547
17427
  strokeOpacity: 0.9,
17548
17428
  strokeDashArray: 0,
@@ -17574,7 +17454,7 @@ var LoginCouting = function LoginCouting(_ref) {
17574
17454
  }));
17575
17455
  };
17576
17456
 
17577
- var colors$3 = ["#00cec9", "#00b894"];
17457
+ var colors$2 = ["#00cec9", "#00b894"];
17578
17458
 
17579
17459
  var PerceivedImpact = function PerceivedImpact(_ref) {
17580
17460
  var data = _ref.data;
@@ -17601,7 +17481,7 @@ var PerceivedImpact = function PerceivedImpact(_ref) {
17601
17481
  show: false
17602
17482
  }
17603
17483
  },
17604
- colors: colors$3,
17484
+ colors: colors$2,
17605
17485
  plotOptions: {
17606
17486
  bar: {
17607
17487
  horizontal: false,
@@ -17639,7 +17519,7 @@ var PerceivedImpact = function PerceivedImpact(_ref) {
17639
17519
  }));
17640
17520
  };
17641
17521
 
17642
- var colors$4 = ["#00b894", "#00cec9", "#0984e3"];
17522
+ var colors$3 = ["#00b894", "#00cec9", "#0984e3"];
17643
17523
 
17644
17524
  var Quantity = function Quantity(_ref) {
17645
17525
  var data = _ref.data;
@@ -17656,7 +17536,7 @@ var Quantity = function Quantity(_ref) {
17656
17536
  type: "pie"
17657
17537
  },
17658
17538
  labels: ["Teachers", "Students", "Assistants"],
17659
- colors: colors$4,
17539
+ colors: colors$3,
17660
17540
  legend: {
17661
17541
  show: false
17662
17542
  },
@@ -17671,15 +17551,15 @@ var Quantity = function Quantity(_ref) {
17671
17551
  };
17672
17552
  var details = [{
17673
17553
  label: "Teachers",
17674
- color: colors$4[0],
17554
+ color: colors$3[0],
17675
17555
  value: teacherPercentage
17676
17556
  }, {
17677
17557
  label: "Students",
17678
- color: colors$4[1],
17558
+ color: colors$3[1],
17679
17559
  value: studentPercentage
17680
17560
  }, {
17681
17561
  label: "Assistants",
17682
- color: colors$4[2],
17562
+ color: colors$3[2],
17683
17563
  value: assistantPercentage
17684
17564
  }];
17685
17565
  return React.createElement("div", {
@@ -17716,3858 +17596,24 @@ var Quantity = function Quantity(_ref) {
17716
17596
  })));
17717
17597
  };
17718
17598
 
17719
- /**
17720
- * Appends the elements of `values` to `array`.
17721
- *
17722
- * @private
17723
- * @param {Array} array The array to modify.
17724
- * @param {Array} values The values to append.
17725
- * @returns {Array} Returns `array`.
17726
- */
17727
- function arrayPush(array, values) {
17728
- var index = -1,
17729
- length = values.length,
17730
- offset = array.length;
17731
-
17732
- while (++index < length) {
17733
- array[offset + index] = values[index];
17734
- }
17735
- return array;
17736
- }
17737
-
17738
- var _arrayPush = arrayPush;
17739
-
17740
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
17741
-
17742
- function createCommonjsModule(fn, module) {
17743
- return module = { exports: {} }, fn(module, module.exports), module.exports;
17744
- }
17745
-
17746
- /** Detect free variable `global` from Node.js. */
17747
- var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
17748
-
17749
- var _freeGlobal = freeGlobal;
17750
-
17751
- /** Detect free variable `self`. */
17752
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
17753
-
17754
- /** Used as a reference to the global object. */
17755
- var root = _freeGlobal || freeSelf || Function('return this')();
17756
-
17757
- var _root = root;
17758
-
17759
- /** Built-in value references. */
17760
- var Symbol$1 = _root.Symbol;
17761
-
17762
- var _Symbol = Symbol$1;
17763
-
17764
- /** Used for built-in method references. */
17765
- var objectProto = Object.prototype;
17766
-
17767
- /** Used to check objects for own properties. */
17768
- var hasOwnProperty = objectProto.hasOwnProperty;
17769
-
17770
- /**
17771
- * Used to resolve the
17772
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
17773
- * of values.
17774
- */
17775
- var nativeObjectToString = objectProto.toString;
17776
-
17777
- /** Built-in value references. */
17778
- var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
17779
-
17780
- /**
17781
- * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
17782
- *
17783
- * @private
17784
- * @param {*} value The value to query.
17785
- * @returns {string} Returns the raw `toStringTag`.
17786
- */
17787
- function getRawTag(value) {
17788
- var isOwn = hasOwnProperty.call(value, symToStringTag),
17789
- tag = value[symToStringTag];
17790
-
17791
- try {
17792
- value[symToStringTag] = undefined;
17793
- var unmasked = true;
17794
- } catch (e) {}
17795
-
17796
- var result = nativeObjectToString.call(value);
17797
- if (unmasked) {
17798
- if (isOwn) {
17799
- value[symToStringTag] = tag;
17800
- } else {
17801
- delete value[symToStringTag];
17802
- }
17803
- }
17804
- return result;
17805
- }
17806
-
17807
- var _getRawTag = getRawTag;
17808
-
17809
- /** Used for built-in method references. */
17810
- var objectProto$1 = Object.prototype;
17811
-
17812
- /**
17813
- * Used to resolve the
17814
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
17815
- * of values.
17816
- */
17817
- var nativeObjectToString$1 = objectProto$1.toString;
17818
-
17819
- /**
17820
- * Converts `value` to a string using `Object.prototype.toString`.
17821
- *
17822
- * @private
17823
- * @param {*} value The value to convert.
17824
- * @returns {string} Returns the converted string.
17825
- */
17826
- function objectToString(value) {
17827
- return nativeObjectToString$1.call(value);
17828
- }
17829
-
17830
- var _objectToString = objectToString;
17831
-
17832
- /** `Object#toString` result references. */
17833
- var nullTag = '[object Null]',
17834
- undefinedTag = '[object Undefined]';
17835
-
17836
- /** Built-in value references. */
17837
- var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
17838
-
17839
- /**
17840
- * The base implementation of `getTag` without fallbacks for buggy environments.
17841
- *
17842
- * @private
17843
- * @param {*} value The value to query.
17844
- * @returns {string} Returns the `toStringTag`.
17845
- */
17846
- function baseGetTag(value) {
17847
- if (value == null) {
17848
- return value === undefined ? undefinedTag : nullTag;
17849
- }
17850
- return (symToStringTag$1 && symToStringTag$1 in Object(value))
17851
- ? _getRawTag(value)
17852
- : _objectToString(value);
17853
- }
17854
-
17855
- var _baseGetTag = baseGetTag;
17856
-
17857
- /**
17858
- * Checks if `value` is object-like. A value is object-like if it's not `null`
17859
- * and has a `typeof` result of "object".
17860
- *
17861
- * @static
17862
- * @memberOf _
17863
- * @since 4.0.0
17864
- * @category Lang
17865
- * @param {*} value The value to check.
17866
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
17867
- * @example
17868
- *
17869
- * _.isObjectLike({});
17870
- * // => true
17871
- *
17872
- * _.isObjectLike([1, 2, 3]);
17873
- * // => true
17874
- *
17875
- * _.isObjectLike(_.noop);
17876
- * // => false
17877
- *
17878
- * _.isObjectLike(null);
17879
- * // => false
17880
- */
17881
- function isObjectLike(value) {
17882
- return value != null && typeof value == 'object';
17883
- }
17884
-
17885
- var isObjectLike_1 = isObjectLike;
17886
-
17887
- /** `Object#toString` result references. */
17888
- var argsTag = '[object Arguments]';
17889
-
17890
- /**
17891
- * The base implementation of `_.isArguments`.
17892
- *
17893
- * @private
17894
- * @param {*} value The value to check.
17895
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
17896
- */
17897
- function baseIsArguments(value) {
17898
- return isObjectLike_1(value) && _baseGetTag(value) == argsTag;
17899
- }
17900
-
17901
- var _baseIsArguments = baseIsArguments;
17902
-
17903
- /** Used for built-in method references. */
17904
- var objectProto$2 = Object.prototype;
17905
-
17906
- /** Used to check objects for own properties. */
17907
- var hasOwnProperty$1 = objectProto$2.hasOwnProperty;
17908
-
17909
- /** Built-in value references. */
17910
- var propertyIsEnumerable = objectProto$2.propertyIsEnumerable;
17911
-
17912
- /**
17913
- * Checks if `value` is likely an `arguments` object.
17914
- *
17915
- * @static
17916
- * @memberOf _
17917
- * @since 0.1.0
17918
- * @category Lang
17919
- * @param {*} value The value to check.
17920
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
17921
- * else `false`.
17922
- * @example
17923
- *
17924
- * _.isArguments(function() { return arguments; }());
17925
- * // => true
17926
- *
17927
- * _.isArguments([1, 2, 3]);
17928
- * // => false
17929
- */
17930
- var isArguments = _baseIsArguments(function() { return arguments; }()) ? _baseIsArguments : function(value) {
17931
- return isObjectLike_1(value) && hasOwnProperty$1.call(value, 'callee') &&
17932
- !propertyIsEnumerable.call(value, 'callee');
17933
- };
17934
-
17935
- var isArguments_1 = isArguments;
17936
-
17937
- /**
17938
- * Checks if `value` is classified as an `Array` object.
17939
- *
17940
- * @static
17941
- * @memberOf _
17942
- * @since 0.1.0
17943
- * @category Lang
17944
- * @param {*} value The value to check.
17945
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
17946
- * @example
17947
- *
17948
- * _.isArray([1, 2, 3]);
17949
- * // => true
17950
- *
17951
- * _.isArray(document.body.children);
17952
- * // => false
17953
- *
17954
- * _.isArray('abc');
17955
- * // => false
17956
- *
17957
- * _.isArray(_.noop);
17958
- * // => false
17959
- */
17960
- var isArray = Array.isArray;
17961
-
17962
- var isArray_1 = isArray;
17963
-
17964
- /** Built-in value references. */
17965
- var spreadableSymbol = _Symbol ? _Symbol.isConcatSpreadable : undefined;
17966
-
17967
- /**
17968
- * Checks if `value` is a flattenable `arguments` object or array.
17969
- *
17970
- * @private
17971
- * @param {*} value The value to check.
17972
- * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
17973
- */
17974
- function isFlattenable(value) {
17975
- return isArray_1(value) || isArguments_1(value) ||
17976
- !!(spreadableSymbol && value && value[spreadableSymbol]);
17977
- }
17978
-
17979
- var _isFlattenable = isFlattenable;
17980
-
17981
- /**
17982
- * The base implementation of `_.flatten` with support for restricting flattening.
17983
- *
17984
- * @private
17985
- * @param {Array} array The array to flatten.
17986
- * @param {number} depth The maximum recursion depth.
17987
- * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
17988
- * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
17989
- * @param {Array} [result=[]] The initial result value.
17990
- * @returns {Array} Returns the new flattened array.
17991
- */
17992
- function baseFlatten(array, depth, predicate, isStrict, result) {
17993
- var index = -1,
17994
- length = array.length;
17995
-
17996
- predicate || (predicate = _isFlattenable);
17997
- result || (result = []);
17998
-
17999
- while (++index < length) {
18000
- var value = array[index];
18001
- if (depth > 0 && predicate(value)) {
18002
- if (depth > 1) {
18003
- // Recursively flatten arrays (susceptible to call stack limits).
18004
- baseFlatten(value, depth - 1, predicate, isStrict, result);
18005
- } else {
18006
- _arrayPush(result, value);
18007
- }
18008
- } else if (!isStrict) {
18009
- result[result.length] = value;
18010
- }
18011
- }
18012
- return result;
18013
- }
18014
-
18015
- var _baseFlatten = baseFlatten;
18016
-
18017
- /**
18018
- * A specialized version of `_.map` for arrays without support for iteratee
18019
- * shorthands.
18020
- *
18021
- * @private
18022
- * @param {Array} [array] The array to iterate over.
18023
- * @param {Function} iteratee The function invoked per iteration.
18024
- * @returns {Array} Returns the new mapped array.
18025
- */
18026
- function arrayMap(array, iteratee) {
18027
- var index = -1,
18028
- length = array == null ? 0 : array.length,
18029
- result = Array(length);
18030
-
18031
- while (++index < length) {
18032
- result[index] = iteratee(array[index], index, array);
18033
- }
18034
- return result;
18035
- }
18036
-
18037
- var _arrayMap = arrayMap;
18038
-
18039
- /** `Object#toString` result references. */
18040
- var symbolTag = '[object Symbol]';
18041
-
18042
- /**
18043
- * Checks if `value` is classified as a `Symbol` primitive or object.
18044
- *
18045
- * @static
18046
- * @memberOf _
18047
- * @since 4.0.0
18048
- * @category Lang
18049
- * @param {*} value The value to check.
18050
- * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
18051
- * @example
18052
- *
18053
- * _.isSymbol(Symbol.iterator);
18054
- * // => true
18055
- *
18056
- * _.isSymbol('abc');
18057
- * // => false
18058
- */
18059
- function isSymbol(value) {
18060
- return typeof value == 'symbol' ||
18061
- (isObjectLike_1(value) && _baseGetTag(value) == symbolTag);
18062
- }
18063
-
18064
- var isSymbol_1 = isSymbol;
18065
-
18066
- /** Used to match property names within property paths. */
18067
- var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
18068
- reIsPlainProp = /^\w*$/;
18069
-
18070
- /**
18071
- * Checks if `value` is a property name and not a property path.
18072
- *
18073
- * @private
18074
- * @param {*} value The value to check.
18075
- * @param {Object} [object] The object to query keys on.
18076
- * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
18077
- */
18078
- function isKey(value, object) {
18079
- if (isArray_1(value)) {
18080
- return false;
18081
- }
18082
- var type = typeof value;
18083
- if (type == 'number' || type == 'symbol' || type == 'boolean' ||
18084
- value == null || isSymbol_1(value)) {
18085
- return true;
18086
- }
18087
- return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
18088
- (object != null && value in Object(object));
18089
- }
18090
-
18091
- var _isKey = isKey;
18092
-
18093
- /**
18094
- * Checks if `value` is the
18095
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
18096
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
18097
- *
18098
- * @static
18099
- * @memberOf _
18100
- * @since 0.1.0
18101
- * @category Lang
18102
- * @param {*} value The value to check.
18103
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
18104
- * @example
18105
- *
18106
- * _.isObject({});
18107
- * // => true
18108
- *
18109
- * _.isObject([1, 2, 3]);
18110
- * // => true
18111
- *
18112
- * _.isObject(_.noop);
18113
- * // => true
18114
- *
18115
- * _.isObject(null);
18116
- * // => false
18117
- */
18118
- function isObject(value) {
18119
- var type = typeof value;
18120
- return value != null && (type == 'object' || type == 'function');
18121
- }
18122
-
18123
- var isObject_1 = isObject;
18124
-
18125
- /** `Object#toString` result references. */
18126
- var asyncTag = '[object AsyncFunction]',
18127
- funcTag = '[object Function]',
18128
- genTag = '[object GeneratorFunction]',
18129
- proxyTag = '[object Proxy]';
18130
-
18131
- /**
18132
- * Checks if `value` is classified as a `Function` object.
18133
- *
18134
- * @static
18135
- * @memberOf _
18136
- * @since 0.1.0
18137
- * @category Lang
18138
- * @param {*} value The value to check.
18139
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
18140
- * @example
18141
- *
18142
- * _.isFunction(_);
18143
- * // => true
18144
- *
18145
- * _.isFunction(/abc/);
18146
- * // => false
18147
- */
18148
- function isFunction(value) {
18149
- if (!isObject_1(value)) {
18150
- return false;
18151
- }
18152
- // The use of `Object#toString` avoids issues with the `typeof` operator
18153
- // in Safari 9 which returns 'object' for typed arrays and other constructors.
18154
- var tag = _baseGetTag(value);
18155
- return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
18156
- }
18157
-
18158
- var isFunction_1 = isFunction;
18159
-
18160
- /** Used to detect overreaching core-js shims. */
18161
- var coreJsData = _root['__core-js_shared__'];
18162
-
18163
- var _coreJsData = coreJsData;
18164
-
18165
- /** Used to detect methods masquerading as native. */
18166
- var maskSrcKey = (function() {
18167
- var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || '');
18168
- return uid ? ('Symbol(src)_1.' + uid) : '';
18169
- }());
18170
-
18171
- /**
18172
- * Checks if `func` has its source masked.
18173
- *
18174
- * @private
18175
- * @param {Function} func The function to check.
18176
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
18177
- */
18178
- function isMasked(func) {
18179
- return !!maskSrcKey && (maskSrcKey in func);
18180
- }
18181
-
18182
- var _isMasked = isMasked;
18183
-
18184
- /** Used for built-in method references. */
18185
- var funcProto = Function.prototype;
18186
-
18187
- /** Used to resolve the decompiled source of functions. */
18188
- var funcToString = funcProto.toString;
18189
-
18190
- /**
18191
- * Converts `func` to its source code.
18192
- *
18193
- * @private
18194
- * @param {Function} func The function to convert.
18195
- * @returns {string} Returns the source code.
18196
- */
18197
- function toSource(func) {
18198
- if (func != null) {
18199
- try {
18200
- return funcToString.call(func);
18201
- } catch (e) {}
18202
- try {
18203
- return (func + '');
18204
- } catch (e) {}
18205
- }
18206
- return '';
18207
- }
18208
-
18209
- var _toSource = toSource;
18210
-
18211
- /**
18212
- * Used to match `RegExp`
18213
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
18214
- */
18215
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
18216
-
18217
- /** Used to detect host constructors (Safari). */
18218
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
18219
-
18220
- /** Used for built-in method references. */
18221
- var funcProto$1 = Function.prototype,
18222
- objectProto$3 = Object.prototype;
18223
-
18224
- /** Used to resolve the decompiled source of functions. */
18225
- var funcToString$1 = funcProto$1.toString;
18226
-
18227
- /** Used to check objects for own properties. */
18228
- var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
18229
-
18230
- /** Used to detect if a method is native. */
18231
- var reIsNative = RegExp('^' +
18232
- funcToString$1.call(hasOwnProperty$2).replace(reRegExpChar, '\\$&')
18233
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
18234
- );
18235
-
18236
- /**
18237
- * The base implementation of `_.isNative` without bad shim checks.
18238
- *
18239
- * @private
18240
- * @param {*} value The value to check.
18241
- * @returns {boolean} Returns `true` if `value` is a native function,
18242
- * else `false`.
18243
- */
18244
- function baseIsNative(value) {
18245
- if (!isObject_1(value) || _isMasked(value)) {
18246
- return false;
18247
- }
18248
- var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor;
18249
- return pattern.test(_toSource(value));
18250
- }
18251
-
18252
- var _baseIsNative = baseIsNative;
18253
-
18254
- /**
18255
- * Gets the value at `key` of `object`.
18256
- *
18257
- * @private
18258
- * @param {Object} [object] The object to query.
18259
- * @param {string} key The key of the property to get.
18260
- * @returns {*} Returns the property value.
18261
- */
18262
- function getValue(object, key) {
18263
- return object == null ? undefined : object[key];
18264
- }
18265
-
18266
- var _getValue = getValue;
18267
-
18268
- /**
18269
- * Gets the native function at `key` of `object`.
18270
- *
18271
- * @private
18272
- * @param {Object} object The object to query.
18273
- * @param {string} key The key of the method to get.
18274
- * @returns {*} Returns the function if it's native, else `undefined`.
18275
- */
18276
- function getNative(object, key) {
18277
- var value = _getValue(object, key);
18278
- return _baseIsNative(value) ? value : undefined;
18279
- }
18280
-
18281
- var _getNative = getNative;
18282
-
18283
- /* Built-in method references that are verified to be native. */
18284
- var nativeCreate = _getNative(Object, 'create');
18285
-
18286
- var _nativeCreate = nativeCreate;
18287
-
18288
- /**
18289
- * Removes all key-value entries from the hash.
18290
- *
18291
- * @private
18292
- * @name clear
18293
- * @memberOf Hash
18294
- */
18295
- function hashClear() {
18296
- this.__data__ = _nativeCreate ? _nativeCreate(null) : {};
18297
- this.size = 0;
18298
- }
18299
-
18300
- var _hashClear = hashClear;
18301
-
18302
- /**
18303
- * Removes `key` and its value from the hash.
18304
- *
18305
- * @private
18306
- * @name delete
18307
- * @memberOf Hash
18308
- * @param {Object} hash The hash to modify.
18309
- * @param {string} key The key of the value to remove.
18310
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
18311
- */
18312
- function hashDelete(key) {
18313
- var result = this.has(key) && delete this.__data__[key];
18314
- this.size -= result ? 1 : 0;
18315
- return result;
18316
- }
18317
-
18318
- var _hashDelete = hashDelete;
18319
-
18320
- /** Used to stand-in for `undefined` hash values. */
18321
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
18322
-
18323
- /** Used for built-in method references. */
18324
- var objectProto$4 = Object.prototype;
18325
-
18326
- /** Used to check objects for own properties. */
18327
- var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
18328
-
18329
- /**
18330
- * Gets the hash value for `key`.
18331
- *
18332
- * @private
18333
- * @name get
18334
- * @memberOf Hash
18335
- * @param {string} key The key of the value to get.
18336
- * @returns {*} Returns the entry value.
18337
- */
18338
- function hashGet(key) {
18339
- var data = this.__data__;
18340
- if (_nativeCreate) {
18341
- var result = data[key];
18342
- return result === HASH_UNDEFINED ? undefined : result;
18343
- }
18344
- return hasOwnProperty$3.call(data, key) ? data[key] : undefined;
18345
- }
18346
-
18347
- var _hashGet = hashGet;
18348
-
18349
- /** Used for built-in method references. */
18350
- var objectProto$5 = Object.prototype;
18351
-
18352
- /** Used to check objects for own properties. */
18353
- var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
18354
-
18355
- /**
18356
- * Checks if a hash value for `key` exists.
18357
- *
18358
- * @private
18359
- * @name has
18360
- * @memberOf Hash
18361
- * @param {string} key The key of the entry to check.
18362
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
18363
- */
18364
- function hashHas(key) {
18365
- var data = this.__data__;
18366
- return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty$4.call(data, key);
18367
- }
18368
-
18369
- var _hashHas = hashHas;
18370
-
18371
- /** Used to stand-in for `undefined` hash values. */
18372
- var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
18373
-
18374
- /**
18375
- * Sets the hash `key` to `value`.
18376
- *
18377
- * @private
18378
- * @name set
18379
- * @memberOf Hash
18380
- * @param {string} key The key of the value to set.
18381
- * @param {*} value The value to set.
18382
- * @returns {Object} Returns the hash instance.
18383
- */
18384
- function hashSet(key, value) {
18385
- var data = this.__data__;
18386
- this.size += this.has(key) ? 0 : 1;
18387
- data[key] = (_nativeCreate && value === undefined) ? HASH_UNDEFINED$1 : value;
18388
- return this;
18389
- }
18390
-
18391
- var _hashSet = hashSet;
18392
-
18393
- /**
18394
- * Creates a hash object.
18395
- *
18396
- * @private
18397
- * @constructor
18398
- * @param {Array} [entries] The key-value pairs to cache.
18399
- */
18400
- function Hash(entries) {
18401
- var index = -1,
18402
- length = entries == null ? 0 : entries.length;
18403
-
18404
- this.clear();
18405
- while (++index < length) {
18406
- var entry = entries[index];
18407
- this.set(entry[0], entry[1]);
18408
- }
18409
- }
18410
-
18411
- // Add methods to `Hash`.
18412
- Hash.prototype.clear = _hashClear;
18413
- Hash.prototype['delete'] = _hashDelete;
18414
- Hash.prototype.get = _hashGet;
18415
- Hash.prototype.has = _hashHas;
18416
- Hash.prototype.set = _hashSet;
18417
-
18418
- var _Hash = Hash;
18419
-
18420
- /**
18421
- * Removes all key-value entries from the list cache.
18422
- *
18423
- * @private
18424
- * @name clear
18425
- * @memberOf ListCache
18426
- */
18427
- function listCacheClear() {
18428
- this.__data__ = [];
18429
- this.size = 0;
18430
- }
18431
-
18432
- var _listCacheClear = listCacheClear;
18433
-
18434
- /**
18435
- * Performs a
18436
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
18437
- * comparison between two values to determine if they are equivalent.
18438
- *
18439
- * @static
18440
- * @memberOf _
18441
- * @since 4.0.0
18442
- * @category Lang
18443
- * @param {*} value The value to compare.
18444
- * @param {*} other The other value to compare.
18445
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
18446
- * @example
18447
- *
18448
- * var object = { 'a': 1 };
18449
- * var other = { 'a': 1 };
18450
- *
18451
- * _.eq(object, object);
18452
- * // => true
18453
- *
18454
- * _.eq(object, other);
18455
- * // => false
18456
- *
18457
- * _.eq('a', 'a');
18458
- * // => true
18459
- *
18460
- * _.eq('a', Object('a'));
18461
- * // => false
18462
- *
18463
- * _.eq(NaN, NaN);
18464
- * // => true
18465
- */
18466
- function eq(value, other) {
18467
- return value === other || (value !== value && other !== other);
18468
- }
18469
-
18470
- var eq_1 = eq;
18471
-
18472
- /**
18473
- * Gets the index at which the `key` is found in `array` of key-value pairs.
18474
- *
18475
- * @private
18476
- * @param {Array} array The array to inspect.
18477
- * @param {*} key The key to search for.
18478
- * @returns {number} Returns the index of the matched value, else `-1`.
18479
- */
18480
- function assocIndexOf(array, key) {
18481
- var length = array.length;
18482
- while (length--) {
18483
- if (eq_1(array[length][0], key)) {
18484
- return length;
18485
- }
18486
- }
18487
- return -1;
18488
- }
18489
-
18490
- var _assocIndexOf = assocIndexOf;
18491
-
18492
- /** Used for built-in method references. */
18493
- var arrayProto = Array.prototype;
18494
-
18495
- /** Built-in value references. */
18496
- var splice = arrayProto.splice;
18497
-
18498
- /**
18499
- * Removes `key` and its value from the list cache.
18500
- *
18501
- * @private
18502
- * @name delete
18503
- * @memberOf ListCache
18504
- * @param {string} key The key of the value to remove.
18505
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
18506
- */
18507
- function listCacheDelete(key) {
18508
- var data = this.__data__,
18509
- index = _assocIndexOf(data, key);
18510
-
18511
- if (index < 0) {
18512
- return false;
18513
- }
18514
- var lastIndex = data.length - 1;
18515
- if (index == lastIndex) {
18516
- data.pop();
18517
- } else {
18518
- splice.call(data, index, 1);
18519
- }
18520
- --this.size;
18521
- return true;
18522
- }
18523
-
18524
- var _listCacheDelete = listCacheDelete;
18525
-
18526
- /**
18527
- * Gets the list cache value for `key`.
18528
- *
18529
- * @private
18530
- * @name get
18531
- * @memberOf ListCache
18532
- * @param {string} key The key of the value to get.
18533
- * @returns {*} Returns the entry value.
18534
- */
18535
- function listCacheGet(key) {
18536
- var data = this.__data__,
18537
- index = _assocIndexOf(data, key);
18538
-
18539
- return index < 0 ? undefined : data[index][1];
18540
- }
18541
-
18542
- var _listCacheGet = listCacheGet;
18543
-
18544
- /**
18545
- * Checks if a list cache value for `key` exists.
18546
- *
18547
- * @private
18548
- * @name has
18549
- * @memberOf ListCache
18550
- * @param {string} key The key of the entry to check.
18551
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
18552
- */
18553
- function listCacheHas(key) {
18554
- return _assocIndexOf(this.__data__, key) > -1;
18555
- }
18556
-
18557
- var _listCacheHas = listCacheHas;
18558
-
18559
- /**
18560
- * Sets the list cache `key` to `value`.
18561
- *
18562
- * @private
18563
- * @name set
18564
- * @memberOf ListCache
18565
- * @param {string} key The key of the value to set.
18566
- * @param {*} value The value to set.
18567
- * @returns {Object} Returns the list cache instance.
18568
- */
18569
- function listCacheSet(key, value) {
18570
- var data = this.__data__,
18571
- index = _assocIndexOf(data, key);
18572
-
18573
- if (index < 0) {
18574
- ++this.size;
18575
- data.push([key, value]);
18576
- } else {
18577
- data[index][1] = value;
18578
- }
18579
- return this;
18580
- }
18581
-
18582
- var _listCacheSet = listCacheSet;
18583
-
18584
- /**
18585
- * Creates an list cache object.
18586
- *
18587
- * @private
18588
- * @constructor
18589
- * @param {Array} [entries] The key-value pairs to cache.
18590
- */
18591
- function ListCache(entries) {
18592
- var index = -1,
18593
- length = entries == null ? 0 : entries.length;
18594
-
18595
- this.clear();
18596
- while (++index < length) {
18597
- var entry = entries[index];
18598
- this.set(entry[0], entry[1]);
18599
- }
18600
- }
18601
-
18602
- // Add methods to `ListCache`.
18603
- ListCache.prototype.clear = _listCacheClear;
18604
- ListCache.prototype['delete'] = _listCacheDelete;
18605
- ListCache.prototype.get = _listCacheGet;
18606
- ListCache.prototype.has = _listCacheHas;
18607
- ListCache.prototype.set = _listCacheSet;
18608
-
18609
- var _ListCache = ListCache;
18610
-
18611
- /* Built-in method references that are verified to be native. */
18612
- var Map = _getNative(_root, 'Map');
18613
-
18614
- var _Map = Map;
18615
-
18616
- /**
18617
- * Removes all key-value entries from the map.
18618
- *
18619
- * @private
18620
- * @name clear
18621
- * @memberOf MapCache
18622
- */
18623
- function mapCacheClear() {
18624
- this.size = 0;
18625
- this.__data__ = {
18626
- 'hash': new _Hash,
18627
- 'map': new (_Map || _ListCache),
18628
- 'string': new _Hash
18629
- };
18630
- }
18631
-
18632
- var _mapCacheClear = mapCacheClear;
18633
-
18634
- /**
18635
- * Checks if `value` is suitable for use as unique object key.
18636
- *
18637
- * @private
18638
- * @param {*} value The value to check.
18639
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
18640
- */
18641
- function isKeyable(value) {
18642
- var type = typeof value;
18643
- return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
18644
- ? (value !== '__proto__')
18645
- : (value === null);
18646
- }
18647
-
18648
- var _isKeyable = isKeyable;
18649
-
18650
- /**
18651
- * Gets the data for `map`.
18652
- *
18653
- * @private
18654
- * @param {Object} map The map to query.
18655
- * @param {string} key The reference key.
18656
- * @returns {*} Returns the map data.
18657
- */
18658
- function getMapData(map, key) {
18659
- var data = map.__data__;
18660
- return _isKeyable(key)
18661
- ? data[typeof key == 'string' ? 'string' : 'hash']
18662
- : data.map;
18663
- }
18664
-
18665
- var _getMapData = getMapData;
18666
-
18667
- /**
18668
- * Removes `key` and its value from the map.
18669
- *
18670
- * @private
18671
- * @name delete
18672
- * @memberOf MapCache
18673
- * @param {string} key The key of the value to remove.
18674
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
18675
- */
18676
- function mapCacheDelete(key) {
18677
- var result = _getMapData(this, key)['delete'](key);
18678
- this.size -= result ? 1 : 0;
18679
- return result;
18680
- }
18681
-
18682
- var _mapCacheDelete = mapCacheDelete;
18683
-
18684
- /**
18685
- * Gets the map value for `key`.
18686
- *
18687
- * @private
18688
- * @name get
18689
- * @memberOf MapCache
18690
- * @param {string} key The key of the value to get.
18691
- * @returns {*} Returns the entry value.
18692
- */
18693
- function mapCacheGet(key) {
18694
- return _getMapData(this, key).get(key);
18695
- }
18696
-
18697
- var _mapCacheGet = mapCacheGet;
18698
-
18699
- /**
18700
- * Checks if a map value for `key` exists.
18701
- *
18702
- * @private
18703
- * @name has
18704
- * @memberOf MapCache
18705
- * @param {string} key The key of the entry to check.
18706
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
18707
- */
18708
- function mapCacheHas(key) {
18709
- return _getMapData(this, key).has(key);
18710
- }
18711
-
18712
- var _mapCacheHas = mapCacheHas;
18713
-
18714
- /**
18715
- * Sets the map `key` to `value`.
18716
- *
18717
- * @private
18718
- * @name set
18719
- * @memberOf MapCache
18720
- * @param {string} key The key of the value to set.
18721
- * @param {*} value The value to set.
18722
- * @returns {Object} Returns the map cache instance.
18723
- */
18724
- function mapCacheSet(key, value) {
18725
- var data = _getMapData(this, key),
18726
- size = data.size;
18727
-
18728
- data.set(key, value);
18729
- this.size += data.size == size ? 0 : 1;
18730
- return this;
18731
- }
18732
-
18733
- var _mapCacheSet = mapCacheSet;
18734
-
18735
- /**
18736
- * Creates a map cache object to store key-value pairs.
18737
- *
18738
- * @private
18739
- * @constructor
18740
- * @param {Array} [entries] The key-value pairs to cache.
18741
- */
18742
- function MapCache(entries) {
18743
- var index = -1,
18744
- length = entries == null ? 0 : entries.length;
18745
-
18746
- this.clear();
18747
- while (++index < length) {
18748
- var entry = entries[index];
18749
- this.set(entry[0], entry[1]);
18750
- }
18751
- }
18752
-
18753
- // Add methods to `MapCache`.
18754
- MapCache.prototype.clear = _mapCacheClear;
18755
- MapCache.prototype['delete'] = _mapCacheDelete;
18756
- MapCache.prototype.get = _mapCacheGet;
18757
- MapCache.prototype.has = _mapCacheHas;
18758
- MapCache.prototype.set = _mapCacheSet;
18759
-
18760
- var _MapCache = MapCache;
18761
-
18762
- /** Error message constants. */
18763
- var FUNC_ERROR_TEXT = 'Expected a function';
18764
-
18765
- /**
18766
- * Creates a function that memoizes the result of `func`. If `resolver` is
18767
- * provided, it determines the cache key for storing the result based on the
18768
- * arguments provided to the memoized function. By default, the first argument
18769
- * provided to the memoized function is used as the map cache key. The `func`
18770
- * is invoked with the `this` binding of the memoized function.
18771
- *
18772
- * **Note:** The cache is exposed as the `cache` property on the memoized
18773
- * function. Its creation may be customized by replacing the `_.memoize.Cache`
18774
- * constructor with one whose instances implement the
18775
- * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
18776
- * method interface of `clear`, `delete`, `get`, `has`, and `set`.
18777
- *
18778
- * @static
18779
- * @memberOf _
18780
- * @since 0.1.0
18781
- * @category Function
18782
- * @param {Function} func The function to have its output memoized.
18783
- * @param {Function} [resolver] The function to resolve the cache key.
18784
- * @returns {Function} Returns the new memoized function.
18785
- * @example
18786
- *
18787
- * var object = { 'a': 1, 'b': 2 };
18788
- * var other = { 'c': 3, 'd': 4 };
18789
- *
18790
- * var values = _.memoize(_.values);
18791
- * values(object);
18792
- * // => [1, 2]
18793
- *
18794
- * values(other);
18795
- * // => [3, 4]
18796
- *
18797
- * object.a = 2;
18798
- * values(object);
18799
- * // => [1, 2]
18800
- *
18801
- * // Modify the result cache.
18802
- * values.cache.set(object, ['a', 'b']);
18803
- * values(object);
18804
- * // => ['a', 'b']
18805
- *
18806
- * // Replace `_.memoize.Cache`.
18807
- * _.memoize.Cache = WeakMap;
18808
- */
18809
- function memoize(func, resolver) {
18810
- if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
18811
- throw new TypeError(FUNC_ERROR_TEXT);
18812
- }
18813
- var memoized = function() {
18814
- var args = arguments,
18815
- key = resolver ? resolver.apply(this, args) : args[0],
18816
- cache = memoized.cache;
18817
-
18818
- if (cache.has(key)) {
18819
- return cache.get(key);
18820
- }
18821
- var result = func.apply(this, args);
18822
- memoized.cache = cache.set(key, result) || cache;
18823
- return result;
18824
- };
18825
- memoized.cache = new (memoize.Cache || _MapCache);
18826
- return memoized;
18827
- }
18828
-
18829
- // Expose `MapCache`.
18830
- memoize.Cache = _MapCache;
18831
-
18832
- var memoize_1 = memoize;
18833
-
18834
- /** Used as the maximum memoize cache size. */
18835
- var MAX_MEMOIZE_SIZE = 500;
18836
-
18837
- /**
18838
- * A specialized version of `_.memoize` which clears the memoized function's
18839
- * cache when it exceeds `MAX_MEMOIZE_SIZE`.
18840
- *
18841
- * @private
18842
- * @param {Function} func The function to have its output memoized.
18843
- * @returns {Function} Returns the new memoized function.
18844
- */
18845
- function memoizeCapped(func) {
18846
- var result = memoize_1(func, function(key) {
18847
- if (cache.size === MAX_MEMOIZE_SIZE) {
18848
- cache.clear();
18849
- }
18850
- return key;
18851
- });
18852
-
18853
- var cache = result.cache;
18854
- return result;
18855
- }
18856
-
18857
- var _memoizeCapped = memoizeCapped;
18858
-
18859
- /** Used to match property names within property paths. */
18860
- var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
18861
-
18862
- /** Used to match backslashes in property paths. */
18863
- var reEscapeChar = /\\(\\)?/g;
18864
-
18865
- /**
18866
- * Converts `string` to a property path array.
18867
- *
18868
- * @private
18869
- * @param {string} string The string to convert.
18870
- * @returns {Array} Returns the property path array.
18871
- */
18872
- var stringToPath = _memoizeCapped(function(string) {
18873
- var result = [];
18874
- if (string.charCodeAt(0) === 46 /* . */) {
18875
- result.push('');
18876
- }
18877
- string.replace(rePropName, function(match, number, quote, subString) {
18878
- result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
18879
- });
18880
- return result;
18881
- });
18882
-
18883
- var _stringToPath = stringToPath;
18884
-
18885
- /** Used as references for various `Number` constants. */
18886
- var INFINITY = 1 / 0;
18887
-
18888
- /** Used to convert symbols to primitives and strings. */
18889
- var symbolProto = _Symbol ? _Symbol.prototype : undefined,
18890
- symbolToString = symbolProto ? symbolProto.toString : undefined;
18891
-
18892
- /**
18893
- * The base implementation of `_.toString` which doesn't convert nullish
18894
- * values to empty strings.
18895
- *
18896
- * @private
18897
- * @param {*} value The value to process.
18898
- * @returns {string} Returns the string.
18899
- */
18900
- function baseToString(value) {
18901
- // Exit early for strings to avoid a performance hit in some environments.
18902
- if (typeof value == 'string') {
18903
- return value;
18904
- }
18905
- if (isArray_1(value)) {
18906
- // Recursively convert values (susceptible to call stack limits).
18907
- return _arrayMap(value, baseToString) + '';
18908
- }
18909
- if (isSymbol_1(value)) {
18910
- return symbolToString ? symbolToString.call(value) : '';
18911
- }
18912
- var result = (value + '');
18913
- return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
18914
- }
18915
-
18916
- var _baseToString = baseToString;
18917
-
18918
- /**
18919
- * Converts `value` to a string. An empty string is returned for `null`
18920
- * and `undefined` values. The sign of `-0` is preserved.
18921
- *
18922
- * @static
18923
- * @memberOf _
18924
- * @since 4.0.0
18925
- * @category Lang
18926
- * @param {*} value The value to convert.
18927
- * @returns {string} Returns the converted string.
18928
- * @example
18929
- *
18930
- * _.toString(null);
18931
- * // => ''
18932
- *
18933
- * _.toString(-0);
18934
- * // => '-0'
18935
- *
18936
- * _.toString([1, 2, 3]);
18937
- * // => '1,2,3'
18938
- */
18939
- function toString(value) {
18940
- return value == null ? '' : _baseToString(value);
18941
- }
18942
-
18943
- var toString_1 = toString;
18944
-
18945
- /**
18946
- * Casts `value` to a path array if it's not one.
18947
- *
18948
- * @private
18949
- * @param {*} value The value to inspect.
18950
- * @param {Object} [object] The object to query keys on.
18951
- * @returns {Array} Returns the cast property path array.
18952
- */
18953
- function castPath(value, object) {
18954
- if (isArray_1(value)) {
18955
- return value;
18956
- }
18957
- return _isKey(value, object) ? [value] : _stringToPath(toString_1(value));
18958
- }
18959
-
18960
- var _castPath = castPath;
18961
-
18962
- /** Used as references for various `Number` constants. */
18963
- var INFINITY$1 = 1 / 0;
18964
-
18965
- /**
18966
- * Converts `value` to a string key if it's not a string or symbol.
18967
- *
18968
- * @private
18969
- * @param {*} value The value to inspect.
18970
- * @returns {string|symbol} Returns the key.
18971
- */
18972
- function toKey(value) {
18973
- if (typeof value == 'string' || isSymbol_1(value)) {
18974
- return value;
18975
- }
18976
- var result = (value + '');
18977
- return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result;
18978
- }
18979
-
18980
- var _toKey = toKey;
18981
-
18982
- /**
18983
- * The base implementation of `_.get` without support for default values.
18984
- *
18985
- * @private
18986
- * @param {Object} object The object to query.
18987
- * @param {Array|string} path The path of the property to get.
18988
- * @returns {*} Returns the resolved value.
18989
- */
18990
- function baseGet(object, path) {
18991
- path = _castPath(path, object);
18992
-
18993
- var index = 0,
18994
- length = path.length;
18995
-
18996
- while (object != null && index < length) {
18997
- object = object[_toKey(path[index++])];
18998
- }
18999
- return (index && index == length) ? object : undefined;
19000
- }
17599
+ var Dashboard = function Dashboard() {
17600
+ var _useDashboard = useDashboard(),
17601
+ loginCounting = _useDashboard.loginCounting,
17602
+ quantity = _useDashboard.quantity,
17603
+ highImpact = _useDashboard.highImpact,
17604
+ perceivedImpact = _useDashboard.perceivedImpact;
19001
17605
 
19002
- var _baseGet = baseGet;
19003
-
19004
- /**
19005
- * Removes all key-value entries from the stack.
19006
- *
19007
- * @private
19008
- * @name clear
19009
- * @memberOf Stack
19010
- */
19011
- function stackClear() {
19012
- this.__data__ = new _ListCache;
19013
- this.size = 0;
19014
- }
19015
-
19016
- var _stackClear = stackClear;
19017
-
19018
- /**
19019
- * Removes `key` and its value from the stack.
19020
- *
19021
- * @private
19022
- * @name delete
19023
- * @memberOf Stack
19024
- * @param {string} key The key of the value to remove.
19025
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
19026
- */
19027
- function stackDelete(key) {
19028
- var data = this.__data__,
19029
- result = data['delete'](key);
19030
-
19031
- this.size = data.size;
19032
- return result;
19033
- }
19034
-
19035
- var _stackDelete = stackDelete;
19036
-
19037
- /**
19038
- * Gets the stack value for `key`.
19039
- *
19040
- * @private
19041
- * @name get
19042
- * @memberOf Stack
19043
- * @param {string} key The key of the value to get.
19044
- * @returns {*} Returns the entry value.
19045
- */
19046
- function stackGet(key) {
19047
- return this.__data__.get(key);
19048
- }
19049
-
19050
- var _stackGet = stackGet;
19051
-
19052
- /**
19053
- * Checks if a stack value for `key` exists.
19054
- *
19055
- * @private
19056
- * @name has
19057
- * @memberOf Stack
19058
- * @param {string} key The key of the entry to check.
19059
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
19060
- */
19061
- function stackHas(key) {
19062
- return this.__data__.has(key);
19063
- }
19064
-
19065
- var _stackHas = stackHas;
19066
-
19067
- /** Used as the size to enable large array optimizations. */
19068
- var LARGE_ARRAY_SIZE = 200;
19069
-
19070
- /**
19071
- * Sets the stack `key` to `value`.
19072
- *
19073
- * @private
19074
- * @name set
19075
- * @memberOf Stack
19076
- * @param {string} key The key of the value to set.
19077
- * @param {*} value The value to set.
19078
- * @returns {Object} Returns the stack cache instance.
19079
- */
19080
- function stackSet(key, value) {
19081
- var data = this.__data__;
19082
- if (data instanceof _ListCache) {
19083
- var pairs = data.__data__;
19084
- if (!_Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
19085
- pairs.push([key, value]);
19086
- this.size = ++data.size;
19087
- return this;
19088
- }
19089
- data = this.__data__ = new _MapCache(pairs);
19090
- }
19091
- data.set(key, value);
19092
- this.size = data.size;
19093
- return this;
19094
- }
19095
-
19096
- var _stackSet = stackSet;
19097
-
19098
- /**
19099
- * Creates a stack cache object to store key-value pairs.
19100
- *
19101
- * @private
19102
- * @constructor
19103
- * @param {Array} [entries] The key-value pairs to cache.
19104
- */
19105
- function Stack(entries) {
19106
- var data = this.__data__ = new _ListCache(entries);
19107
- this.size = data.size;
19108
- }
19109
-
19110
- // Add methods to `Stack`.
19111
- Stack.prototype.clear = _stackClear;
19112
- Stack.prototype['delete'] = _stackDelete;
19113
- Stack.prototype.get = _stackGet;
19114
- Stack.prototype.has = _stackHas;
19115
- Stack.prototype.set = _stackSet;
19116
-
19117
- var _Stack = Stack;
19118
-
19119
- /** Used to stand-in for `undefined` hash values. */
19120
- var HASH_UNDEFINED$2 = '__lodash_hash_undefined__';
19121
-
19122
- /**
19123
- * Adds `value` to the array cache.
19124
- *
19125
- * @private
19126
- * @name add
19127
- * @memberOf SetCache
19128
- * @alias push
19129
- * @param {*} value The value to cache.
19130
- * @returns {Object} Returns the cache instance.
19131
- */
19132
- function setCacheAdd(value) {
19133
- this.__data__.set(value, HASH_UNDEFINED$2);
19134
- return this;
19135
- }
19136
-
19137
- var _setCacheAdd = setCacheAdd;
19138
-
19139
- /**
19140
- * Checks if `value` is in the array cache.
19141
- *
19142
- * @private
19143
- * @name has
19144
- * @memberOf SetCache
19145
- * @param {*} value The value to search for.
19146
- * @returns {number} Returns `true` if `value` is found, else `false`.
19147
- */
19148
- function setCacheHas(value) {
19149
- return this.__data__.has(value);
19150
- }
19151
-
19152
- var _setCacheHas = setCacheHas;
19153
-
19154
- /**
19155
- *
19156
- * Creates an array cache object to store unique values.
19157
- *
19158
- * @private
19159
- * @constructor
19160
- * @param {Array} [values] The values to cache.
19161
- */
19162
- function SetCache(values) {
19163
- var index = -1,
19164
- length = values == null ? 0 : values.length;
19165
-
19166
- this.__data__ = new _MapCache;
19167
- while (++index < length) {
19168
- this.add(values[index]);
19169
- }
19170
- }
19171
-
19172
- // Add methods to `SetCache`.
19173
- SetCache.prototype.add = SetCache.prototype.push = _setCacheAdd;
19174
- SetCache.prototype.has = _setCacheHas;
19175
-
19176
- var _SetCache = SetCache;
19177
-
19178
- /**
19179
- * A specialized version of `_.some` for arrays without support for iteratee
19180
- * shorthands.
19181
- *
19182
- * @private
19183
- * @param {Array} [array] The array to iterate over.
19184
- * @param {Function} predicate The function invoked per iteration.
19185
- * @returns {boolean} Returns `true` if any element passes the predicate check,
19186
- * else `false`.
19187
- */
19188
- function arraySome(array, predicate) {
19189
- var index = -1,
19190
- length = array == null ? 0 : array.length;
19191
-
19192
- while (++index < length) {
19193
- if (predicate(array[index], index, array)) {
19194
- return true;
19195
- }
19196
- }
19197
- return false;
19198
- }
19199
-
19200
- var _arraySome = arraySome;
19201
-
19202
- /**
19203
- * Checks if a `cache` value for `key` exists.
19204
- *
19205
- * @private
19206
- * @param {Object} cache The cache to query.
19207
- * @param {string} key The key of the entry to check.
19208
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
19209
- */
19210
- function cacheHas(cache, key) {
19211
- return cache.has(key);
19212
- }
19213
-
19214
- var _cacheHas = cacheHas;
19215
-
19216
- /** Used to compose bitmasks for value comparisons. */
19217
- var COMPARE_PARTIAL_FLAG = 1,
19218
- COMPARE_UNORDERED_FLAG = 2;
19219
-
19220
- /**
19221
- * A specialized version of `baseIsEqualDeep` for arrays with support for
19222
- * partial deep comparisons.
19223
- *
19224
- * @private
19225
- * @param {Array} array The array to compare.
19226
- * @param {Array} other The other array to compare.
19227
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
19228
- * @param {Function} customizer The function to customize comparisons.
19229
- * @param {Function} equalFunc The function to determine equivalents of values.
19230
- * @param {Object} stack Tracks traversed `array` and `other` objects.
19231
- * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
19232
- */
19233
- function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
19234
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
19235
- arrLength = array.length,
19236
- othLength = other.length;
19237
-
19238
- if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
19239
- return false;
19240
- }
19241
- // Check that cyclic values are equal.
19242
- var arrStacked = stack.get(array);
19243
- var othStacked = stack.get(other);
19244
- if (arrStacked && othStacked) {
19245
- return arrStacked == other && othStacked == array;
19246
- }
19247
- var index = -1,
19248
- result = true,
19249
- seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new _SetCache : undefined;
19250
-
19251
- stack.set(array, other);
19252
- stack.set(other, array);
19253
-
19254
- // Ignore non-index properties.
19255
- while (++index < arrLength) {
19256
- var arrValue = array[index],
19257
- othValue = other[index];
19258
-
19259
- if (customizer) {
19260
- var compared = isPartial
19261
- ? customizer(othValue, arrValue, index, other, array, stack)
19262
- : customizer(arrValue, othValue, index, array, other, stack);
19263
- }
19264
- if (compared !== undefined) {
19265
- if (compared) {
19266
- continue;
19267
- }
19268
- result = false;
19269
- break;
19270
- }
19271
- // Recursively compare arrays (susceptible to call stack limits).
19272
- if (seen) {
19273
- if (!_arraySome(other, function(othValue, othIndex) {
19274
- if (!_cacheHas(seen, othIndex) &&
19275
- (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
19276
- return seen.push(othIndex);
19277
- }
19278
- })) {
19279
- result = false;
19280
- break;
19281
- }
19282
- } else if (!(
19283
- arrValue === othValue ||
19284
- equalFunc(arrValue, othValue, bitmask, customizer, stack)
19285
- )) {
19286
- result = false;
19287
- break;
19288
- }
19289
- }
19290
- stack['delete'](array);
19291
- stack['delete'](other);
19292
- return result;
19293
- }
19294
-
19295
- var _equalArrays = equalArrays;
19296
-
19297
- /** Built-in value references. */
19298
- var Uint8Array = _root.Uint8Array;
19299
-
19300
- var _Uint8Array = Uint8Array;
19301
-
19302
- /**
19303
- * Converts `map` to its key-value pairs.
19304
- *
19305
- * @private
19306
- * @param {Object} map The map to convert.
19307
- * @returns {Array} Returns the key-value pairs.
19308
- */
19309
- function mapToArray(map) {
19310
- var index = -1,
19311
- result = Array(map.size);
19312
-
19313
- map.forEach(function(value, key) {
19314
- result[++index] = [key, value];
19315
- });
19316
- return result;
19317
- }
19318
-
19319
- var _mapToArray = mapToArray;
19320
-
19321
- /**
19322
- * Converts `set` to an array of its values.
19323
- *
19324
- * @private
19325
- * @param {Object} set The set to convert.
19326
- * @returns {Array} Returns the values.
19327
- */
19328
- function setToArray(set) {
19329
- var index = -1,
19330
- result = Array(set.size);
19331
-
19332
- set.forEach(function(value) {
19333
- result[++index] = value;
19334
- });
19335
- return result;
19336
- }
19337
-
19338
- var _setToArray = setToArray;
19339
-
19340
- /** Used to compose bitmasks for value comparisons. */
19341
- var COMPARE_PARTIAL_FLAG$1 = 1,
19342
- COMPARE_UNORDERED_FLAG$1 = 2;
19343
-
19344
- /** `Object#toString` result references. */
19345
- var boolTag = '[object Boolean]',
19346
- dateTag = '[object Date]',
19347
- errorTag = '[object Error]',
19348
- mapTag = '[object Map]',
19349
- numberTag = '[object Number]',
19350
- regexpTag = '[object RegExp]',
19351
- setTag = '[object Set]',
19352
- stringTag = '[object String]',
19353
- symbolTag$1 = '[object Symbol]';
19354
-
19355
- var arrayBufferTag = '[object ArrayBuffer]',
19356
- dataViewTag = '[object DataView]';
19357
-
19358
- /** Used to convert symbols to primitives and strings. */
19359
- var symbolProto$1 = _Symbol ? _Symbol.prototype : undefined,
19360
- symbolValueOf = symbolProto$1 ? symbolProto$1.valueOf : undefined;
19361
-
19362
- /**
19363
- * A specialized version of `baseIsEqualDeep` for comparing objects of
19364
- * the same `toStringTag`.
19365
- *
19366
- * **Note:** This function only supports comparing values with tags of
19367
- * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
19368
- *
19369
- * @private
19370
- * @param {Object} object The object to compare.
19371
- * @param {Object} other The other object to compare.
19372
- * @param {string} tag The `toStringTag` of the objects to compare.
19373
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
19374
- * @param {Function} customizer The function to customize comparisons.
19375
- * @param {Function} equalFunc The function to determine equivalents of values.
19376
- * @param {Object} stack Tracks traversed `object` and `other` objects.
19377
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
19378
- */
19379
- function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
19380
- switch (tag) {
19381
- case dataViewTag:
19382
- if ((object.byteLength != other.byteLength) ||
19383
- (object.byteOffset != other.byteOffset)) {
19384
- return false;
19385
- }
19386
- object = object.buffer;
19387
- other = other.buffer;
19388
-
19389
- case arrayBufferTag:
19390
- if ((object.byteLength != other.byteLength) ||
19391
- !equalFunc(new _Uint8Array(object), new _Uint8Array(other))) {
19392
- return false;
19393
- }
19394
- return true;
19395
-
19396
- case boolTag:
19397
- case dateTag:
19398
- case numberTag:
19399
- // Coerce booleans to `1` or `0` and dates to milliseconds.
19400
- // Invalid dates are coerced to `NaN`.
19401
- return eq_1(+object, +other);
19402
-
19403
- case errorTag:
19404
- return object.name == other.name && object.message == other.message;
19405
-
19406
- case regexpTag:
19407
- case stringTag:
19408
- // Coerce regexes to strings and treat strings, primitives and objects,
19409
- // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
19410
- // for more details.
19411
- return object == (other + '');
19412
-
19413
- case mapTag:
19414
- var convert = _mapToArray;
19415
-
19416
- case setTag:
19417
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$1;
19418
- convert || (convert = _setToArray);
19419
-
19420
- if (object.size != other.size && !isPartial) {
19421
- return false;
19422
- }
19423
- // Assume cyclic values are equal.
19424
- var stacked = stack.get(object);
19425
- if (stacked) {
19426
- return stacked == other;
19427
- }
19428
- bitmask |= COMPARE_UNORDERED_FLAG$1;
19429
-
19430
- // Recursively compare objects (susceptible to call stack limits).
19431
- stack.set(object, other);
19432
- var result = _equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
19433
- stack['delete'](object);
19434
- return result;
19435
-
19436
- case symbolTag$1:
19437
- if (symbolValueOf) {
19438
- return symbolValueOf.call(object) == symbolValueOf.call(other);
19439
- }
19440
- }
19441
- return false;
19442
- }
19443
-
19444
- var _equalByTag = equalByTag;
19445
-
19446
- /**
19447
- * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
19448
- * `keysFunc` and `symbolsFunc` to get the enumerable property names and
19449
- * symbols of `object`.
19450
- *
19451
- * @private
19452
- * @param {Object} object The object to query.
19453
- * @param {Function} keysFunc The function to get the keys of `object`.
19454
- * @param {Function} symbolsFunc The function to get the symbols of `object`.
19455
- * @returns {Array} Returns the array of property names and symbols.
19456
- */
19457
- function baseGetAllKeys(object, keysFunc, symbolsFunc) {
19458
- var result = keysFunc(object);
19459
- return isArray_1(object) ? result : _arrayPush(result, symbolsFunc(object));
19460
- }
19461
-
19462
- var _baseGetAllKeys = baseGetAllKeys;
19463
-
19464
- /**
19465
- * A specialized version of `_.filter` for arrays without support for
19466
- * iteratee shorthands.
19467
- *
19468
- * @private
19469
- * @param {Array} [array] The array to iterate over.
19470
- * @param {Function} predicate The function invoked per iteration.
19471
- * @returns {Array} Returns the new filtered array.
19472
- */
19473
- function arrayFilter(array, predicate) {
19474
- var index = -1,
19475
- length = array == null ? 0 : array.length,
19476
- resIndex = 0,
19477
- result = [];
19478
-
19479
- while (++index < length) {
19480
- var value = array[index];
19481
- if (predicate(value, index, array)) {
19482
- result[resIndex++] = value;
19483
- }
19484
- }
19485
- return result;
19486
- }
19487
-
19488
- var _arrayFilter = arrayFilter;
19489
-
19490
- /**
19491
- * This method returns a new empty array.
19492
- *
19493
- * @static
19494
- * @memberOf _
19495
- * @since 4.13.0
19496
- * @category Util
19497
- * @returns {Array} Returns the new empty array.
19498
- * @example
19499
- *
19500
- * var arrays = _.times(2, _.stubArray);
19501
- *
19502
- * console.log(arrays);
19503
- * // => [[], []]
19504
- *
19505
- * console.log(arrays[0] === arrays[1]);
19506
- * // => false
19507
- */
19508
- function stubArray() {
19509
- return [];
19510
- }
19511
-
19512
- var stubArray_1 = stubArray;
19513
-
19514
- /** Used for built-in method references. */
19515
- var objectProto$6 = Object.prototype;
19516
-
19517
- /** Built-in value references. */
19518
- var propertyIsEnumerable$1 = objectProto$6.propertyIsEnumerable;
19519
-
19520
- /* Built-in method references for those with the same name as other `lodash` methods. */
19521
- var nativeGetSymbols = Object.getOwnPropertySymbols;
19522
-
19523
- /**
19524
- * Creates an array of the own enumerable symbols of `object`.
19525
- *
19526
- * @private
19527
- * @param {Object} object The object to query.
19528
- * @returns {Array} Returns the array of symbols.
19529
- */
19530
- var getSymbols = !nativeGetSymbols ? stubArray_1 : function(object) {
19531
- if (object == null) {
19532
- return [];
19533
- }
19534
- object = Object(object);
19535
- return _arrayFilter(nativeGetSymbols(object), function(symbol) {
19536
- return propertyIsEnumerable$1.call(object, symbol);
19537
- });
19538
- };
19539
-
19540
- var _getSymbols = getSymbols;
19541
-
19542
- /**
19543
- * The base implementation of `_.times` without support for iteratee shorthands
19544
- * or max array length checks.
19545
- *
19546
- * @private
19547
- * @param {number} n The number of times to invoke `iteratee`.
19548
- * @param {Function} iteratee The function invoked per iteration.
19549
- * @returns {Array} Returns the array of results.
19550
- */
19551
- function baseTimes(n, iteratee) {
19552
- var index = -1,
19553
- result = Array(n);
19554
-
19555
- while (++index < n) {
19556
- result[index] = iteratee(index);
19557
- }
19558
- return result;
19559
- }
19560
-
19561
- var _baseTimes = baseTimes;
19562
-
19563
- /**
19564
- * This method returns `false`.
19565
- *
19566
- * @static
19567
- * @memberOf _
19568
- * @since 4.13.0
19569
- * @category Util
19570
- * @returns {boolean} Returns `false`.
19571
- * @example
19572
- *
19573
- * _.times(2, _.stubFalse);
19574
- * // => [false, false]
19575
- */
19576
- function stubFalse() {
19577
- return false;
19578
- }
19579
-
19580
- var stubFalse_1 = stubFalse;
19581
-
19582
- var isBuffer_1 = createCommonjsModule(function (module, exports) {
19583
- /** Detect free variable `exports`. */
19584
- var freeExports = exports && !exports.nodeType && exports;
19585
-
19586
- /** Detect free variable `module`. */
19587
- var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
19588
-
19589
- /** Detect the popular CommonJS extension `module.exports`. */
19590
- var moduleExports = freeModule && freeModule.exports === freeExports;
19591
-
19592
- /** Built-in value references. */
19593
- var Buffer = moduleExports ? _root.Buffer : undefined;
19594
-
19595
- /* Built-in method references for those with the same name as other `lodash` methods. */
19596
- var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
19597
-
19598
- /**
19599
- * Checks if `value` is a buffer.
19600
- *
19601
- * @static
19602
- * @memberOf _
19603
- * @since 4.3.0
19604
- * @category Lang
19605
- * @param {*} value The value to check.
19606
- * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
19607
- * @example
19608
- *
19609
- * _.isBuffer(new Buffer(2));
19610
- * // => true
19611
- *
19612
- * _.isBuffer(new Uint8Array(2));
19613
- * // => false
19614
- */
19615
- var isBuffer = nativeIsBuffer || stubFalse_1;
19616
-
19617
- module.exports = isBuffer;
19618
- });
19619
-
19620
- /** Used as references for various `Number` constants. */
19621
- var MAX_SAFE_INTEGER = 9007199254740991;
19622
-
19623
- /** Used to detect unsigned integer values. */
19624
- var reIsUint = /^(?:0|[1-9]\d*)$/;
19625
-
19626
- /**
19627
- * Checks if `value` is a valid array-like index.
19628
- *
19629
- * @private
19630
- * @param {*} value The value to check.
19631
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
19632
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
19633
- */
19634
- function isIndex(value, length) {
19635
- var type = typeof value;
19636
- length = length == null ? MAX_SAFE_INTEGER : length;
19637
-
19638
- return !!length &&
19639
- (type == 'number' ||
19640
- (type != 'symbol' && reIsUint.test(value))) &&
19641
- (value > -1 && value % 1 == 0 && value < length);
19642
- }
19643
-
19644
- var _isIndex = isIndex;
19645
-
19646
- /** Used as references for various `Number` constants. */
19647
- var MAX_SAFE_INTEGER$1 = 9007199254740991;
19648
-
19649
- /**
19650
- * Checks if `value` is a valid array-like length.
19651
- *
19652
- * **Note:** This method is loosely based on
19653
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
19654
- *
19655
- * @static
19656
- * @memberOf _
19657
- * @since 4.0.0
19658
- * @category Lang
19659
- * @param {*} value The value to check.
19660
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
19661
- * @example
19662
- *
19663
- * _.isLength(3);
19664
- * // => true
19665
- *
19666
- * _.isLength(Number.MIN_VALUE);
19667
- * // => false
19668
- *
19669
- * _.isLength(Infinity);
19670
- * // => false
19671
- *
19672
- * _.isLength('3');
19673
- * // => false
19674
- */
19675
- function isLength(value) {
19676
- return typeof value == 'number' &&
19677
- value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$1;
19678
- }
19679
-
19680
- var isLength_1 = isLength;
19681
-
19682
- /** `Object#toString` result references. */
19683
- var argsTag$1 = '[object Arguments]',
19684
- arrayTag = '[object Array]',
19685
- boolTag$1 = '[object Boolean]',
19686
- dateTag$1 = '[object Date]',
19687
- errorTag$1 = '[object Error]',
19688
- funcTag$1 = '[object Function]',
19689
- mapTag$1 = '[object Map]',
19690
- numberTag$1 = '[object Number]',
19691
- objectTag = '[object Object]',
19692
- regexpTag$1 = '[object RegExp]',
19693
- setTag$1 = '[object Set]',
19694
- stringTag$1 = '[object String]',
19695
- weakMapTag = '[object WeakMap]';
19696
-
19697
- var arrayBufferTag$1 = '[object ArrayBuffer]',
19698
- dataViewTag$1 = '[object DataView]',
19699
- float32Tag = '[object Float32Array]',
19700
- float64Tag = '[object Float64Array]',
19701
- int8Tag = '[object Int8Array]',
19702
- int16Tag = '[object Int16Array]',
19703
- int32Tag = '[object Int32Array]',
19704
- uint8Tag = '[object Uint8Array]',
19705
- uint8ClampedTag = '[object Uint8ClampedArray]',
19706
- uint16Tag = '[object Uint16Array]',
19707
- uint32Tag = '[object Uint32Array]';
19708
-
19709
- /** Used to identify `toStringTag` values of typed arrays. */
19710
- var typedArrayTags = {};
19711
- typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
19712
- typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
19713
- typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
19714
- typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
19715
- typedArrayTags[uint32Tag] = true;
19716
- typedArrayTags[argsTag$1] = typedArrayTags[arrayTag] =
19717
- typedArrayTags[arrayBufferTag$1] = typedArrayTags[boolTag$1] =
19718
- typedArrayTags[dataViewTag$1] = typedArrayTags[dateTag$1] =
19719
- typedArrayTags[errorTag$1] = typedArrayTags[funcTag$1] =
19720
- typedArrayTags[mapTag$1] = typedArrayTags[numberTag$1] =
19721
- typedArrayTags[objectTag] = typedArrayTags[regexpTag$1] =
19722
- typedArrayTags[setTag$1] = typedArrayTags[stringTag$1] =
19723
- typedArrayTags[weakMapTag] = false;
19724
-
19725
- /**
19726
- * The base implementation of `_.isTypedArray` without Node.js optimizations.
19727
- *
19728
- * @private
19729
- * @param {*} value The value to check.
19730
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
19731
- */
19732
- function baseIsTypedArray(value) {
19733
- return isObjectLike_1(value) &&
19734
- isLength_1(value.length) && !!typedArrayTags[_baseGetTag(value)];
19735
- }
19736
-
19737
- var _baseIsTypedArray = baseIsTypedArray;
19738
-
19739
- /**
19740
- * The base implementation of `_.unary` without support for storing metadata.
19741
- *
19742
- * @private
19743
- * @param {Function} func The function to cap arguments for.
19744
- * @returns {Function} Returns the new capped function.
19745
- */
19746
- function baseUnary(func) {
19747
- return function(value) {
19748
- return func(value);
19749
- };
19750
- }
19751
-
19752
- var _baseUnary = baseUnary;
19753
-
19754
- var _nodeUtil = createCommonjsModule(function (module, exports) {
19755
- /** Detect free variable `exports`. */
19756
- var freeExports = exports && !exports.nodeType && exports;
19757
-
19758
- /** Detect free variable `module`. */
19759
- var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
19760
-
19761
- /** Detect the popular CommonJS extension `module.exports`. */
19762
- var moduleExports = freeModule && freeModule.exports === freeExports;
19763
-
19764
- /** Detect free variable `process` from Node.js. */
19765
- var freeProcess = moduleExports && _freeGlobal.process;
19766
-
19767
- /** Used to access faster Node.js helpers. */
19768
- var nodeUtil = (function() {
19769
- try {
19770
- // Use `util.types` for Node.js 10+.
19771
- var types = freeModule && freeModule.require && freeModule.require('util').types;
19772
-
19773
- if (types) {
19774
- return types;
19775
- }
19776
-
19777
- // Legacy `process.binding('util')` for Node.js < 10.
19778
- return freeProcess && freeProcess.binding && freeProcess.binding('util');
19779
- } catch (e) {}
19780
- }());
19781
-
19782
- module.exports = nodeUtil;
19783
- });
19784
-
19785
- /* Node.js helper references. */
19786
- var nodeIsTypedArray = _nodeUtil && _nodeUtil.isTypedArray;
19787
-
19788
- /**
19789
- * Checks if `value` is classified as a typed array.
19790
- *
19791
- * @static
19792
- * @memberOf _
19793
- * @since 3.0.0
19794
- * @category Lang
19795
- * @param {*} value The value to check.
19796
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
19797
- * @example
19798
- *
19799
- * _.isTypedArray(new Uint8Array);
19800
- * // => true
19801
- *
19802
- * _.isTypedArray([]);
19803
- * // => false
19804
- */
19805
- var isTypedArray = nodeIsTypedArray ? _baseUnary(nodeIsTypedArray) : _baseIsTypedArray;
19806
-
19807
- var isTypedArray_1 = isTypedArray;
19808
-
19809
- /** Used for built-in method references. */
19810
- var objectProto$7 = Object.prototype;
19811
-
19812
- /** Used to check objects for own properties. */
19813
- var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
19814
-
19815
- /**
19816
- * Creates an array of the enumerable property names of the array-like `value`.
19817
- *
19818
- * @private
19819
- * @param {*} value The value to query.
19820
- * @param {boolean} inherited Specify returning inherited property names.
19821
- * @returns {Array} Returns the array of property names.
19822
- */
19823
- function arrayLikeKeys(value, inherited) {
19824
- var isArr = isArray_1(value),
19825
- isArg = !isArr && isArguments_1(value),
19826
- isBuff = !isArr && !isArg && isBuffer_1(value),
19827
- isType = !isArr && !isArg && !isBuff && isTypedArray_1(value),
19828
- skipIndexes = isArr || isArg || isBuff || isType,
19829
- result = skipIndexes ? _baseTimes(value.length, String) : [],
19830
- length = result.length;
19831
-
19832
- for (var key in value) {
19833
- if ((inherited || hasOwnProperty$5.call(value, key)) &&
19834
- !(skipIndexes && (
19835
- // Safari 9 has enumerable `arguments.length` in strict mode.
19836
- key == 'length' ||
19837
- // Node.js 0.10 has enumerable non-index properties on buffers.
19838
- (isBuff && (key == 'offset' || key == 'parent')) ||
19839
- // PhantomJS 2 has enumerable non-index properties on typed arrays.
19840
- (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
19841
- // Skip index properties.
19842
- _isIndex(key, length)
19843
- ))) {
19844
- result.push(key);
19845
- }
19846
- }
19847
- return result;
19848
- }
19849
-
19850
- var _arrayLikeKeys = arrayLikeKeys;
19851
-
19852
- /** Used for built-in method references. */
19853
- var objectProto$8 = Object.prototype;
19854
-
19855
- /**
19856
- * Checks if `value` is likely a prototype object.
19857
- *
19858
- * @private
19859
- * @param {*} value The value to check.
19860
- * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
19861
- */
19862
- function isPrototype(value) {
19863
- var Ctor = value && value.constructor,
19864
- proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$8;
19865
-
19866
- return value === proto;
19867
- }
19868
-
19869
- var _isPrototype = isPrototype;
19870
-
19871
- /**
19872
- * Creates a unary function that invokes `func` with its argument transformed.
19873
- *
19874
- * @private
19875
- * @param {Function} func The function to wrap.
19876
- * @param {Function} transform The argument transform.
19877
- * @returns {Function} Returns the new function.
19878
- */
19879
- function overArg(func, transform) {
19880
- return function(arg) {
19881
- return func(transform(arg));
19882
- };
19883
- }
19884
-
19885
- var _overArg = overArg;
19886
-
19887
- /* Built-in method references for those with the same name as other `lodash` methods. */
19888
- var nativeKeys = _overArg(Object.keys, Object);
19889
-
19890
- var _nativeKeys = nativeKeys;
19891
-
19892
- /** Used for built-in method references. */
19893
- var objectProto$9 = Object.prototype;
19894
-
19895
- /** Used to check objects for own properties. */
19896
- var hasOwnProperty$6 = objectProto$9.hasOwnProperty;
19897
-
19898
- /**
19899
- * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
19900
- *
19901
- * @private
19902
- * @param {Object} object The object to query.
19903
- * @returns {Array} Returns the array of property names.
19904
- */
19905
- function baseKeys(object) {
19906
- if (!_isPrototype(object)) {
19907
- return _nativeKeys(object);
19908
- }
19909
- var result = [];
19910
- for (var key in Object(object)) {
19911
- if (hasOwnProperty$6.call(object, key) && key != 'constructor') {
19912
- result.push(key);
19913
- }
19914
- }
19915
- return result;
19916
- }
19917
-
19918
- var _baseKeys = baseKeys;
19919
-
19920
- /**
19921
- * Checks if `value` is array-like. A value is considered array-like if it's
19922
- * not a function and has a `value.length` that's an integer greater than or
19923
- * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
19924
- *
19925
- * @static
19926
- * @memberOf _
19927
- * @since 4.0.0
19928
- * @category Lang
19929
- * @param {*} value The value to check.
19930
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
19931
- * @example
19932
- *
19933
- * _.isArrayLike([1, 2, 3]);
19934
- * // => true
19935
- *
19936
- * _.isArrayLike(document.body.children);
19937
- * // => true
19938
- *
19939
- * _.isArrayLike('abc');
19940
- * // => true
19941
- *
19942
- * _.isArrayLike(_.noop);
19943
- * // => false
19944
- */
19945
- function isArrayLike(value) {
19946
- return value != null && isLength_1(value.length) && !isFunction_1(value);
19947
- }
19948
-
19949
- var isArrayLike_1 = isArrayLike;
19950
-
19951
- /**
19952
- * Creates an array of the own enumerable property names of `object`.
19953
- *
19954
- * **Note:** Non-object values are coerced to objects. See the
19955
- * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
19956
- * for more details.
19957
- *
19958
- * @static
19959
- * @since 0.1.0
19960
- * @memberOf _
19961
- * @category Object
19962
- * @param {Object} object The object to query.
19963
- * @returns {Array} Returns the array of property names.
19964
- * @example
19965
- *
19966
- * function Foo() {
19967
- * this.a = 1;
19968
- * this.b = 2;
19969
- * }
19970
- *
19971
- * Foo.prototype.c = 3;
19972
- *
19973
- * _.keys(new Foo);
19974
- * // => ['a', 'b'] (iteration order is not guaranteed)
19975
- *
19976
- * _.keys('hi');
19977
- * // => ['0', '1']
19978
- */
19979
- function keys(object) {
19980
- return isArrayLike_1(object) ? _arrayLikeKeys(object) : _baseKeys(object);
19981
- }
19982
-
19983
- var keys_1 = keys;
19984
-
19985
- /**
19986
- * Creates an array of own enumerable property names and symbols of `object`.
19987
- *
19988
- * @private
19989
- * @param {Object} object The object to query.
19990
- * @returns {Array} Returns the array of property names and symbols.
19991
- */
19992
- function getAllKeys(object) {
19993
- return _baseGetAllKeys(object, keys_1, _getSymbols);
19994
- }
19995
-
19996
- var _getAllKeys = getAllKeys;
19997
-
19998
- /** Used to compose bitmasks for value comparisons. */
19999
- var COMPARE_PARTIAL_FLAG$2 = 1;
20000
-
20001
- /** Used for built-in method references. */
20002
- var objectProto$a = Object.prototype;
20003
-
20004
- /** Used to check objects for own properties. */
20005
- var hasOwnProperty$7 = objectProto$a.hasOwnProperty;
20006
-
20007
- /**
20008
- * A specialized version of `baseIsEqualDeep` for objects with support for
20009
- * partial deep comparisons.
20010
- *
20011
- * @private
20012
- * @param {Object} object The object to compare.
20013
- * @param {Object} other The other object to compare.
20014
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
20015
- * @param {Function} customizer The function to customize comparisons.
20016
- * @param {Function} equalFunc The function to determine equivalents of values.
20017
- * @param {Object} stack Tracks traversed `object` and `other` objects.
20018
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
20019
- */
20020
- function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
20021
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$2,
20022
- objProps = _getAllKeys(object),
20023
- objLength = objProps.length,
20024
- othProps = _getAllKeys(other),
20025
- othLength = othProps.length;
20026
-
20027
- if (objLength != othLength && !isPartial) {
20028
- return false;
20029
- }
20030
- var index = objLength;
20031
- while (index--) {
20032
- var key = objProps[index];
20033
- if (!(isPartial ? key in other : hasOwnProperty$7.call(other, key))) {
20034
- return false;
20035
- }
20036
- }
20037
- // Check that cyclic values are equal.
20038
- var objStacked = stack.get(object);
20039
- var othStacked = stack.get(other);
20040
- if (objStacked && othStacked) {
20041
- return objStacked == other && othStacked == object;
20042
- }
20043
- var result = true;
20044
- stack.set(object, other);
20045
- stack.set(other, object);
20046
-
20047
- var skipCtor = isPartial;
20048
- while (++index < objLength) {
20049
- key = objProps[index];
20050
- var objValue = object[key],
20051
- othValue = other[key];
20052
-
20053
- if (customizer) {
20054
- var compared = isPartial
20055
- ? customizer(othValue, objValue, key, other, object, stack)
20056
- : customizer(objValue, othValue, key, object, other, stack);
20057
- }
20058
- // Recursively compare objects (susceptible to call stack limits).
20059
- if (!(compared === undefined
20060
- ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
20061
- : compared
20062
- )) {
20063
- result = false;
20064
- break;
20065
- }
20066
- skipCtor || (skipCtor = key == 'constructor');
20067
- }
20068
- if (result && !skipCtor) {
20069
- var objCtor = object.constructor,
20070
- othCtor = other.constructor;
20071
-
20072
- // Non `Object` object instances with different constructors are not equal.
20073
- if (objCtor != othCtor &&
20074
- ('constructor' in object && 'constructor' in other) &&
20075
- !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
20076
- typeof othCtor == 'function' && othCtor instanceof othCtor)) {
20077
- result = false;
20078
- }
20079
- }
20080
- stack['delete'](object);
20081
- stack['delete'](other);
20082
- return result;
20083
- }
20084
-
20085
- var _equalObjects = equalObjects;
20086
-
20087
- /* Built-in method references that are verified to be native. */
20088
- var DataView = _getNative(_root, 'DataView');
20089
-
20090
- var _DataView = DataView;
20091
-
20092
- /* Built-in method references that are verified to be native. */
20093
- var Promise$1 = _getNative(_root, 'Promise');
20094
-
20095
- var _Promise = Promise$1;
20096
-
20097
- /* Built-in method references that are verified to be native. */
20098
- var Set$1 = _getNative(_root, 'Set');
20099
-
20100
- var _Set = Set$1;
20101
-
20102
- /* Built-in method references that are verified to be native. */
20103
- var WeakMap = _getNative(_root, 'WeakMap');
20104
-
20105
- var _WeakMap = WeakMap;
20106
-
20107
- /** `Object#toString` result references. */
20108
- var mapTag$2 = '[object Map]',
20109
- objectTag$1 = '[object Object]',
20110
- promiseTag = '[object Promise]',
20111
- setTag$2 = '[object Set]',
20112
- weakMapTag$1 = '[object WeakMap]';
20113
-
20114
- var dataViewTag$2 = '[object DataView]';
20115
-
20116
- /** Used to detect maps, sets, and weakmaps. */
20117
- var dataViewCtorString = _toSource(_DataView),
20118
- mapCtorString = _toSource(_Map),
20119
- promiseCtorString = _toSource(_Promise),
20120
- setCtorString = _toSource(_Set),
20121
- weakMapCtorString = _toSource(_WeakMap);
20122
-
20123
- /**
20124
- * Gets the `toStringTag` of `value`.
20125
- *
20126
- * @private
20127
- * @param {*} value The value to query.
20128
- * @returns {string} Returns the `toStringTag`.
20129
- */
20130
- var getTag = _baseGetTag;
20131
-
20132
- // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
20133
- if ((_DataView && getTag(new _DataView(new ArrayBuffer(1))) != dataViewTag$2) ||
20134
- (_Map && getTag(new _Map) != mapTag$2) ||
20135
- (_Promise && getTag(_Promise.resolve()) != promiseTag) ||
20136
- (_Set && getTag(new _Set) != setTag$2) ||
20137
- (_WeakMap && getTag(new _WeakMap) != weakMapTag$1)) {
20138
- getTag = function(value) {
20139
- var result = _baseGetTag(value),
20140
- Ctor = result == objectTag$1 ? value.constructor : undefined,
20141
- ctorString = Ctor ? _toSource(Ctor) : '';
20142
-
20143
- if (ctorString) {
20144
- switch (ctorString) {
20145
- case dataViewCtorString: return dataViewTag$2;
20146
- case mapCtorString: return mapTag$2;
20147
- case promiseCtorString: return promiseTag;
20148
- case setCtorString: return setTag$2;
20149
- case weakMapCtorString: return weakMapTag$1;
20150
- }
20151
- }
20152
- return result;
20153
- };
20154
- }
20155
-
20156
- var _getTag = getTag;
20157
-
20158
- /** Used to compose bitmasks for value comparisons. */
20159
- var COMPARE_PARTIAL_FLAG$3 = 1;
20160
-
20161
- /** `Object#toString` result references. */
20162
- var argsTag$2 = '[object Arguments]',
20163
- arrayTag$1 = '[object Array]',
20164
- objectTag$2 = '[object Object]';
20165
-
20166
- /** Used for built-in method references. */
20167
- var objectProto$b = Object.prototype;
20168
-
20169
- /** Used to check objects for own properties. */
20170
- var hasOwnProperty$8 = objectProto$b.hasOwnProperty;
20171
-
20172
- /**
20173
- * A specialized version of `baseIsEqual` for arrays and objects which performs
20174
- * deep comparisons and tracks traversed objects enabling objects with circular
20175
- * references to be compared.
20176
- *
20177
- * @private
20178
- * @param {Object} object The object to compare.
20179
- * @param {Object} other The other object to compare.
20180
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
20181
- * @param {Function} customizer The function to customize comparisons.
20182
- * @param {Function} equalFunc The function to determine equivalents of values.
20183
- * @param {Object} [stack] Tracks traversed `object` and `other` objects.
20184
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
20185
- */
20186
- function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
20187
- var objIsArr = isArray_1(object),
20188
- othIsArr = isArray_1(other),
20189
- objTag = objIsArr ? arrayTag$1 : _getTag(object),
20190
- othTag = othIsArr ? arrayTag$1 : _getTag(other);
20191
-
20192
- objTag = objTag == argsTag$2 ? objectTag$2 : objTag;
20193
- othTag = othTag == argsTag$2 ? objectTag$2 : othTag;
20194
-
20195
- var objIsObj = objTag == objectTag$2,
20196
- othIsObj = othTag == objectTag$2,
20197
- isSameTag = objTag == othTag;
20198
-
20199
- if (isSameTag && isBuffer_1(object)) {
20200
- if (!isBuffer_1(other)) {
20201
- return false;
20202
- }
20203
- objIsArr = true;
20204
- objIsObj = false;
20205
- }
20206
- if (isSameTag && !objIsObj) {
20207
- stack || (stack = new _Stack);
20208
- return (objIsArr || isTypedArray_1(object))
20209
- ? _equalArrays(object, other, bitmask, customizer, equalFunc, stack)
20210
- : _equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
20211
- }
20212
- if (!(bitmask & COMPARE_PARTIAL_FLAG$3)) {
20213
- var objIsWrapped = objIsObj && hasOwnProperty$8.call(object, '__wrapped__'),
20214
- othIsWrapped = othIsObj && hasOwnProperty$8.call(other, '__wrapped__');
20215
-
20216
- if (objIsWrapped || othIsWrapped) {
20217
- var objUnwrapped = objIsWrapped ? object.value() : object,
20218
- othUnwrapped = othIsWrapped ? other.value() : other;
20219
-
20220
- stack || (stack = new _Stack);
20221
- return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
20222
- }
20223
- }
20224
- if (!isSameTag) {
20225
- return false;
20226
- }
20227
- stack || (stack = new _Stack);
20228
- return _equalObjects(object, other, bitmask, customizer, equalFunc, stack);
20229
- }
20230
-
20231
- var _baseIsEqualDeep = baseIsEqualDeep;
20232
-
20233
- /**
20234
- * The base implementation of `_.isEqual` which supports partial comparisons
20235
- * and tracks traversed objects.
20236
- *
20237
- * @private
20238
- * @param {*} value The value to compare.
20239
- * @param {*} other The other value to compare.
20240
- * @param {boolean} bitmask The bitmask flags.
20241
- * 1 - Unordered comparison
20242
- * 2 - Partial comparison
20243
- * @param {Function} [customizer] The function to customize comparisons.
20244
- * @param {Object} [stack] Tracks traversed `value` and `other` objects.
20245
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
20246
- */
20247
- function baseIsEqual(value, other, bitmask, customizer, stack) {
20248
- if (value === other) {
20249
- return true;
20250
- }
20251
- if (value == null || other == null || (!isObjectLike_1(value) && !isObjectLike_1(other))) {
20252
- return value !== value && other !== other;
20253
- }
20254
- return _baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
20255
- }
20256
-
20257
- var _baseIsEqual = baseIsEqual;
20258
-
20259
- /** Used to compose bitmasks for value comparisons. */
20260
- var COMPARE_PARTIAL_FLAG$4 = 1,
20261
- COMPARE_UNORDERED_FLAG$2 = 2;
20262
-
20263
- /**
20264
- * The base implementation of `_.isMatch` without support for iteratee shorthands.
20265
- *
20266
- * @private
20267
- * @param {Object} object The object to inspect.
20268
- * @param {Object} source The object of property values to match.
20269
- * @param {Array} matchData The property names, values, and compare flags to match.
20270
- * @param {Function} [customizer] The function to customize comparisons.
20271
- * @returns {boolean} Returns `true` if `object` is a match, else `false`.
20272
- */
20273
- function baseIsMatch(object, source, matchData, customizer) {
20274
- var index = matchData.length,
20275
- length = index,
20276
- noCustomizer = !customizer;
20277
-
20278
- if (object == null) {
20279
- return !length;
20280
- }
20281
- object = Object(object);
20282
- while (index--) {
20283
- var data = matchData[index];
20284
- if ((noCustomizer && data[2])
20285
- ? data[1] !== object[data[0]]
20286
- : !(data[0] in object)
20287
- ) {
20288
- return false;
20289
- }
20290
- }
20291
- while (++index < length) {
20292
- data = matchData[index];
20293
- var key = data[0],
20294
- objValue = object[key],
20295
- srcValue = data[1];
20296
-
20297
- if (noCustomizer && data[2]) {
20298
- if (objValue === undefined && !(key in object)) {
20299
- return false;
20300
- }
20301
- } else {
20302
- var stack = new _Stack;
20303
- if (customizer) {
20304
- var result = customizer(objValue, srcValue, key, object, source, stack);
20305
- }
20306
- if (!(result === undefined
20307
- ? _baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG$4 | COMPARE_UNORDERED_FLAG$2, customizer, stack)
20308
- : result
20309
- )) {
20310
- return false;
20311
- }
20312
- }
20313
- }
20314
- return true;
20315
- }
20316
-
20317
- var _baseIsMatch = baseIsMatch;
20318
-
20319
- /**
20320
- * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
20321
- *
20322
- * @private
20323
- * @param {*} value The value to check.
20324
- * @returns {boolean} Returns `true` if `value` if suitable for strict
20325
- * equality comparisons, else `false`.
20326
- */
20327
- function isStrictComparable(value) {
20328
- return value === value && !isObject_1(value);
20329
- }
20330
-
20331
- var _isStrictComparable = isStrictComparable;
20332
-
20333
- /**
20334
- * Gets the property names, values, and compare flags of `object`.
20335
- *
20336
- * @private
20337
- * @param {Object} object The object to query.
20338
- * @returns {Array} Returns the match data of `object`.
20339
- */
20340
- function getMatchData(object) {
20341
- var result = keys_1(object),
20342
- length = result.length;
20343
-
20344
- while (length--) {
20345
- var key = result[length],
20346
- value = object[key];
20347
-
20348
- result[length] = [key, value, _isStrictComparable(value)];
20349
- }
20350
- return result;
20351
- }
20352
-
20353
- var _getMatchData = getMatchData;
20354
-
20355
- /**
20356
- * A specialized version of `matchesProperty` for source values suitable
20357
- * for strict equality comparisons, i.e. `===`.
20358
- *
20359
- * @private
20360
- * @param {string} key The key of the property to get.
20361
- * @param {*} srcValue The value to match.
20362
- * @returns {Function} Returns the new spec function.
20363
- */
20364
- function matchesStrictComparable(key, srcValue) {
20365
- return function(object) {
20366
- if (object == null) {
20367
- return false;
20368
- }
20369
- return object[key] === srcValue &&
20370
- (srcValue !== undefined || (key in Object(object)));
20371
- };
20372
- }
20373
-
20374
- var _matchesStrictComparable = matchesStrictComparable;
20375
-
20376
- /**
20377
- * The base implementation of `_.matches` which doesn't clone `source`.
20378
- *
20379
- * @private
20380
- * @param {Object} source The object of property values to match.
20381
- * @returns {Function} Returns the new spec function.
20382
- */
20383
- function baseMatches(source) {
20384
- var matchData = _getMatchData(source);
20385
- if (matchData.length == 1 && matchData[0][2]) {
20386
- return _matchesStrictComparable(matchData[0][0], matchData[0][1]);
20387
- }
20388
- return function(object) {
20389
- return object === source || _baseIsMatch(object, source, matchData);
20390
- };
20391
- }
20392
-
20393
- var _baseMatches = baseMatches;
20394
-
20395
- /**
20396
- * Gets the value at `path` of `object`. If the resolved value is
20397
- * `undefined`, the `defaultValue` is returned in its place.
20398
- *
20399
- * @static
20400
- * @memberOf _
20401
- * @since 3.7.0
20402
- * @category Object
20403
- * @param {Object} object The object to query.
20404
- * @param {Array|string} path The path of the property to get.
20405
- * @param {*} [defaultValue] The value returned for `undefined` resolved values.
20406
- * @returns {*} Returns the resolved value.
20407
- * @example
20408
- *
20409
- * var object = { 'a': [{ 'b': { 'c': 3 } }] };
20410
- *
20411
- * _.get(object, 'a[0].b.c');
20412
- * // => 3
20413
- *
20414
- * _.get(object, ['a', '0', 'b', 'c']);
20415
- * // => 3
20416
- *
20417
- * _.get(object, 'a.b.c', 'default');
20418
- * // => 'default'
20419
- */
20420
- function get$r(object, path, defaultValue) {
20421
- var result = object == null ? undefined : _baseGet(object, path);
20422
- return result === undefined ? defaultValue : result;
20423
- }
20424
-
20425
- var get_1 = get$r;
20426
-
20427
- /**
20428
- * The base implementation of `_.hasIn` without support for deep paths.
20429
- *
20430
- * @private
20431
- * @param {Object} [object] The object to query.
20432
- * @param {Array|string} key The key to check.
20433
- * @returns {boolean} Returns `true` if `key` exists, else `false`.
20434
- */
20435
- function baseHasIn(object, key) {
20436
- return object != null && key in Object(object);
20437
- }
20438
-
20439
- var _baseHasIn = baseHasIn;
20440
-
20441
- /**
20442
- * Checks if `path` exists on `object`.
20443
- *
20444
- * @private
20445
- * @param {Object} object The object to query.
20446
- * @param {Array|string} path The path to check.
20447
- * @param {Function} hasFunc The function to check properties.
20448
- * @returns {boolean} Returns `true` if `path` exists, else `false`.
20449
- */
20450
- function hasPath(object, path, hasFunc) {
20451
- path = _castPath(path, object);
20452
-
20453
- var index = -1,
20454
- length = path.length,
20455
- result = false;
20456
-
20457
- while (++index < length) {
20458
- var key = _toKey(path[index]);
20459
- if (!(result = object != null && hasFunc(object, key))) {
20460
- break;
20461
- }
20462
- object = object[key];
20463
- }
20464
- if (result || ++index != length) {
20465
- return result;
20466
- }
20467
- length = object == null ? 0 : object.length;
20468
- return !!length && isLength_1(length) && _isIndex(key, length) &&
20469
- (isArray_1(object) || isArguments_1(object));
20470
- }
20471
-
20472
- var _hasPath = hasPath;
20473
-
20474
- /**
20475
- * Checks if `path` is a direct or inherited property of `object`.
20476
- *
20477
- * @static
20478
- * @memberOf _
20479
- * @since 4.0.0
20480
- * @category Object
20481
- * @param {Object} object The object to query.
20482
- * @param {Array|string} path The path to check.
20483
- * @returns {boolean} Returns `true` if `path` exists, else `false`.
20484
- * @example
20485
- *
20486
- * var object = _.create({ 'a': _.create({ 'b': 2 }) });
20487
- *
20488
- * _.hasIn(object, 'a');
20489
- * // => true
20490
- *
20491
- * _.hasIn(object, 'a.b');
20492
- * // => true
20493
- *
20494
- * _.hasIn(object, ['a', 'b']);
20495
- * // => true
20496
- *
20497
- * _.hasIn(object, 'b');
20498
- * // => false
20499
- */
20500
- function hasIn(object, path) {
20501
- return object != null && _hasPath(object, path, _baseHasIn);
20502
- }
20503
-
20504
- var hasIn_1 = hasIn;
20505
-
20506
- /** Used to compose bitmasks for value comparisons. */
20507
- var COMPARE_PARTIAL_FLAG$5 = 1,
20508
- COMPARE_UNORDERED_FLAG$3 = 2;
20509
-
20510
- /**
20511
- * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
20512
- *
20513
- * @private
20514
- * @param {string} path The path of the property to get.
20515
- * @param {*} srcValue The value to match.
20516
- * @returns {Function} Returns the new spec function.
20517
- */
20518
- function baseMatchesProperty(path, srcValue) {
20519
- if (_isKey(path) && _isStrictComparable(srcValue)) {
20520
- return _matchesStrictComparable(_toKey(path), srcValue);
20521
- }
20522
- return function(object) {
20523
- var objValue = get_1(object, path);
20524
- return (objValue === undefined && objValue === srcValue)
20525
- ? hasIn_1(object, path)
20526
- : _baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG$5 | COMPARE_UNORDERED_FLAG$3);
20527
- };
20528
- }
20529
-
20530
- var _baseMatchesProperty = baseMatchesProperty;
20531
-
20532
- /**
20533
- * This method returns the first argument it receives.
20534
- *
20535
- * @static
20536
- * @since 0.1.0
20537
- * @memberOf _
20538
- * @category Util
20539
- * @param {*} value Any value.
20540
- * @returns {*} Returns `value`.
20541
- * @example
20542
- *
20543
- * var object = { 'a': 1 };
20544
- *
20545
- * console.log(_.identity(object) === object);
20546
- * // => true
20547
- */
20548
- function identity(value) {
20549
- return value;
20550
- }
20551
-
20552
- var identity_1 = identity;
20553
-
20554
- /**
20555
- * The base implementation of `_.property` without support for deep paths.
20556
- *
20557
- * @private
20558
- * @param {string} key The key of the property to get.
20559
- * @returns {Function} Returns the new accessor function.
20560
- */
20561
- function baseProperty(key) {
20562
- return function(object) {
20563
- return object == null ? undefined : object[key];
20564
- };
20565
- }
20566
-
20567
- var _baseProperty = baseProperty;
20568
-
20569
- /**
20570
- * A specialized version of `baseProperty` which supports deep paths.
20571
- *
20572
- * @private
20573
- * @param {Array|string} path The path of the property to get.
20574
- * @returns {Function} Returns the new accessor function.
20575
- */
20576
- function basePropertyDeep(path) {
20577
- return function(object) {
20578
- return _baseGet(object, path);
20579
- };
20580
- }
20581
-
20582
- var _basePropertyDeep = basePropertyDeep;
20583
-
20584
- /**
20585
- * Creates a function that returns the value at `path` of a given object.
20586
- *
20587
- * @static
20588
- * @memberOf _
20589
- * @since 2.4.0
20590
- * @category Util
20591
- * @param {Array|string} path The path of the property to get.
20592
- * @returns {Function} Returns the new accessor function.
20593
- * @example
20594
- *
20595
- * var objects = [
20596
- * { 'a': { 'b': 2 } },
20597
- * { 'a': { 'b': 1 } }
20598
- * ];
20599
- *
20600
- * _.map(objects, _.property('a.b'));
20601
- * // => [2, 1]
20602
- *
20603
- * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
20604
- * // => [1, 2]
20605
- */
20606
- function property(path) {
20607
- return _isKey(path) ? _baseProperty(_toKey(path)) : _basePropertyDeep(path);
20608
- }
20609
-
20610
- var property_1 = property;
20611
-
20612
- /**
20613
- * The base implementation of `_.iteratee`.
20614
- *
20615
- * @private
20616
- * @param {*} [value=_.identity] The value to convert to an iteratee.
20617
- * @returns {Function} Returns the iteratee.
20618
- */
20619
- function baseIteratee(value) {
20620
- // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
20621
- // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
20622
- if (typeof value == 'function') {
20623
- return value;
20624
- }
20625
- if (value == null) {
20626
- return identity_1;
20627
- }
20628
- if (typeof value == 'object') {
20629
- return isArray_1(value)
20630
- ? _baseMatchesProperty(value[0], value[1])
20631
- : _baseMatches(value);
20632
- }
20633
- return property_1(value);
20634
- }
20635
-
20636
- var _baseIteratee = baseIteratee;
20637
-
20638
- /**
20639
- * Creates a base function for methods like `_.forIn` and `_.forOwn`.
20640
- *
20641
- * @private
20642
- * @param {boolean} [fromRight] Specify iterating from right to left.
20643
- * @returns {Function} Returns the new base function.
20644
- */
20645
- function createBaseFor(fromRight) {
20646
- return function(object, iteratee, keysFunc) {
20647
- var index = -1,
20648
- iterable = Object(object),
20649
- props = keysFunc(object),
20650
- length = props.length;
20651
-
20652
- while (length--) {
20653
- var key = props[fromRight ? length : ++index];
20654
- if (iteratee(iterable[key], key, iterable) === false) {
20655
- break;
20656
- }
20657
- }
20658
- return object;
20659
- };
20660
- }
20661
-
20662
- var _createBaseFor = createBaseFor;
20663
-
20664
- /**
20665
- * The base implementation of `baseForOwn` which iterates over `object`
20666
- * properties returned by `keysFunc` and invokes `iteratee` for each property.
20667
- * Iteratee functions may exit iteration early by explicitly returning `false`.
20668
- *
20669
- * @private
20670
- * @param {Object} object The object to iterate over.
20671
- * @param {Function} iteratee The function invoked per iteration.
20672
- * @param {Function} keysFunc The function to get the keys of `object`.
20673
- * @returns {Object} Returns `object`.
20674
- */
20675
- var baseFor = _createBaseFor();
20676
-
20677
- var _baseFor = baseFor;
20678
-
20679
- /**
20680
- * The base implementation of `_.forOwn` without support for iteratee shorthands.
20681
- *
20682
- * @private
20683
- * @param {Object} object The object to iterate over.
20684
- * @param {Function} iteratee The function invoked per iteration.
20685
- * @returns {Object} Returns `object`.
20686
- */
20687
- function baseForOwn(object, iteratee) {
20688
- return object && _baseFor(object, iteratee, keys_1);
20689
- }
20690
-
20691
- var _baseForOwn = baseForOwn;
20692
-
20693
- /**
20694
- * Creates a `baseEach` or `baseEachRight` function.
20695
- *
20696
- * @private
20697
- * @param {Function} eachFunc The function to iterate over a collection.
20698
- * @param {boolean} [fromRight] Specify iterating from right to left.
20699
- * @returns {Function} Returns the new base function.
20700
- */
20701
- function createBaseEach(eachFunc, fromRight) {
20702
- return function(collection, iteratee) {
20703
- if (collection == null) {
20704
- return collection;
20705
- }
20706
- if (!isArrayLike_1(collection)) {
20707
- return eachFunc(collection, iteratee);
20708
- }
20709
- var length = collection.length,
20710
- index = fromRight ? length : -1,
20711
- iterable = Object(collection);
20712
-
20713
- while ((fromRight ? index-- : ++index < length)) {
20714
- if (iteratee(iterable[index], index, iterable) === false) {
20715
- break;
20716
- }
20717
- }
20718
- return collection;
20719
- };
20720
- }
20721
-
20722
- var _createBaseEach = createBaseEach;
20723
-
20724
- /**
20725
- * The base implementation of `_.forEach` without support for iteratee shorthands.
20726
- *
20727
- * @private
20728
- * @param {Array|Object} collection The collection to iterate over.
20729
- * @param {Function} iteratee The function invoked per iteration.
20730
- * @returns {Array|Object} Returns `collection`.
20731
- */
20732
- var baseEach = _createBaseEach(_baseForOwn);
20733
-
20734
- var _baseEach = baseEach;
20735
-
20736
- /**
20737
- * The base implementation of `_.map` without support for iteratee shorthands.
20738
- *
20739
- * @private
20740
- * @param {Array|Object} collection The collection to iterate over.
20741
- * @param {Function} iteratee The function invoked per iteration.
20742
- * @returns {Array} Returns the new mapped array.
20743
- */
20744
- function baseMap(collection, iteratee) {
20745
- var index = -1,
20746
- result = isArrayLike_1(collection) ? Array(collection.length) : [];
20747
-
20748
- _baseEach(collection, function(value, key, collection) {
20749
- result[++index] = iteratee(value, key, collection);
20750
- });
20751
- return result;
20752
- }
20753
-
20754
- var _baseMap = baseMap;
20755
-
20756
- /**
20757
- * The base implementation of `_.sortBy` which uses `comparer` to define the
20758
- * sort order of `array` and replaces criteria objects with their corresponding
20759
- * values.
20760
- *
20761
- * @private
20762
- * @param {Array} array The array to sort.
20763
- * @param {Function} comparer The function to define sort order.
20764
- * @returns {Array} Returns `array`.
20765
- */
20766
- function baseSortBy(array, comparer) {
20767
- var length = array.length;
20768
-
20769
- array.sort(comparer);
20770
- while (length--) {
20771
- array[length] = array[length].value;
20772
- }
20773
- return array;
20774
- }
20775
-
20776
- var _baseSortBy = baseSortBy;
20777
-
20778
- /**
20779
- * Compares values to sort them in ascending order.
20780
- *
20781
- * @private
20782
- * @param {*} value The value to compare.
20783
- * @param {*} other The other value to compare.
20784
- * @returns {number} Returns the sort order indicator for `value`.
20785
- */
20786
- function compareAscending(value, other) {
20787
- if (value !== other) {
20788
- var valIsDefined = value !== undefined,
20789
- valIsNull = value === null,
20790
- valIsReflexive = value === value,
20791
- valIsSymbol = isSymbol_1(value);
20792
-
20793
- var othIsDefined = other !== undefined,
20794
- othIsNull = other === null,
20795
- othIsReflexive = other === other,
20796
- othIsSymbol = isSymbol_1(other);
20797
-
20798
- if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
20799
- (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
20800
- (valIsNull && othIsDefined && othIsReflexive) ||
20801
- (!valIsDefined && othIsReflexive) ||
20802
- !valIsReflexive) {
20803
- return 1;
20804
- }
20805
- if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
20806
- (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
20807
- (othIsNull && valIsDefined && valIsReflexive) ||
20808
- (!othIsDefined && valIsReflexive) ||
20809
- !othIsReflexive) {
20810
- return -1;
20811
- }
20812
- }
20813
- return 0;
20814
- }
20815
-
20816
- var _compareAscending = compareAscending;
20817
-
20818
- /**
20819
- * Used by `_.orderBy` to compare multiple properties of a value to another
20820
- * and stable sort them.
20821
- *
20822
- * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
20823
- * specify an order of "desc" for descending or "asc" for ascending sort order
20824
- * of corresponding values.
20825
- *
20826
- * @private
20827
- * @param {Object} object The object to compare.
20828
- * @param {Object} other The other object to compare.
20829
- * @param {boolean[]|string[]} orders The order to sort by for each property.
20830
- * @returns {number} Returns the sort order indicator for `object`.
20831
- */
20832
- function compareMultiple(object, other, orders) {
20833
- var index = -1,
20834
- objCriteria = object.criteria,
20835
- othCriteria = other.criteria,
20836
- length = objCriteria.length,
20837
- ordersLength = orders.length;
20838
-
20839
- while (++index < length) {
20840
- var result = _compareAscending(objCriteria[index], othCriteria[index]);
20841
- if (result) {
20842
- if (index >= ordersLength) {
20843
- return result;
20844
- }
20845
- var order = orders[index];
20846
- return result * (order == 'desc' ? -1 : 1);
20847
- }
20848
- }
20849
- // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
20850
- // that causes it, under certain circumstances, to provide the same value for
20851
- // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
20852
- // for more details.
20853
- //
20854
- // This also ensures a stable sort in V8 and other engines.
20855
- // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
20856
- return object.index - other.index;
20857
- }
20858
-
20859
- var _compareMultiple = compareMultiple;
20860
-
20861
- /**
20862
- * The base implementation of `_.orderBy` without param guards.
20863
- *
20864
- * @private
20865
- * @param {Array|Object} collection The collection to iterate over.
20866
- * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
20867
- * @param {string[]} orders The sort orders of `iteratees`.
20868
- * @returns {Array} Returns the new sorted array.
20869
- */
20870
- function baseOrderBy(collection, iteratees, orders) {
20871
- if (iteratees.length) {
20872
- iteratees = _arrayMap(iteratees, function(iteratee) {
20873
- if (isArray_1(iteratee)) {
20874
- return function(value) {
20875
- return _baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
20876
- }
20877
- }
20878
- return iteratee;
20879
- });
20880
- } else {
20881
- iteratees = [identity_1];
20882
- }
20883
-
20884
- var index = -1;
20885
- iteratees = _arrayMap(iteratees, _baseUnary(_baseIteratee));
20886
-
20887
- var result = _baseMap(collection, function(value, key, collection) {
20888
- var criteria = _arrayMap(iteratees, function(iteratee) {
20889
- return iteratee(value);
20890
- });
20891
- return { 'criteria': criteria, 'index': ++index, 'value': value };
20892
- });
20893
-
20894
- return _baseSortBy(result, function(object, other) {
20895
- return _compareMultiple(object, other, orders);
20896
- });
20897
- }
20898
-
20899
- var _baseOrderBy = baseOrderBy;
20900
-
20901
- /**
20902
- * A faster alternative to `Function#apply`, this function invokes `func`
20903
- * with the `this` binding of `thisArg` and the arguments of `args`.
20904
- *
20905
- * @private
20906
- * @param {Function} func The function to invoke.
20907
- * @param {*} thisArg The `this` binding of `func`.
20908
- * @param {Array} args The arguments to invoke `func` with.
20909
- * @returns {*} Returns the result of `func`.
20910
- */
20911
- function apply(func, thisArg, args) {
20912
- switch (args.length) {
20913
- case 0: return func.call(thisArg);
20914
- case 1: return func.call(thisArg, args[0]);
20915
- case 2: return func.call(thisArg, args[0], args[1]);
20916
- case 3: return func.call(thisArg, args[0], args[1], args[2]);
20917
- }
20918
- return func.apply(thisArg, args);
20919
- }
20920
-
20921
- var _apply = apply;
20922
-
20923
- /* Built-in method references for those with the same name as other `lodash` methods. */
20924
- var nativeMax = Math.max;
20925
-
20926
- /**
20927
- * A specialized version of `baseRest` which transforms the rest array.
20928
- *
20929
- * @private
20930
- * @param {Function} func The function to apply a rest parameter to.
20931
- * @param {number} [start=func.length-1] The start position of the rest parameter.
20932
- * @param {Function} transform The rest array transform.
20933
- * @returns {Function} Returns the new function.
20934
- */
20935
- function overRest(func, start, transform) {
20936
- start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
20937
- return function() {
20938
- var args = arguments,
20939
- index = -1,
20940
- length = nativeMax(args.length - start, 0),
20941
- array = Array(length);
20942
-
20943
- while (++index < length) {
20944
- array[index] = args[start + index];
20945
- }
20946
- index = -1;
20947
- var otherArgs = Array(start + 1);
20948
- while (++index < start) {
20949
- otherArgs[index] = args[index];
20950
- }
20951
- otherArgs[start] = transform(array);
20952
- return _apply(func, this, otherArgs);
20953
- };
20954
- }
20955
-
20956
- var _overRest = overRest;
20957
-
20958
- /**
20959
- * Creates a function that returns `value`.
20960
- *
20961
- * @static
20962
- * @memberOf _
20963
- * @since 2.4.0
20964
- * @category Util
20965
- * @param {*} value The value to return from the new function.
20966
- * @returns {Function} Returns the new constant function.
20967
- * @example
20968
- *
20969
- * var objects = _.times(2, _.constant({ 'a': 1 }));
20970
- *
20971
- * console.log(objects);
20972
- * // => [{ 'a': 1 }, { 'a': 1 }]
20973
- *
20974
- * console.log(objects[0] === objects[1]);
20975
- * // => true
20976
- */
20977
- function constant(value) {
20978
- return function() {
20979
- return value;
20980
- };
20981
- }
20982
-
20983
- var constant_1 = constant;
20984
-
20985
- var defineProperty = (function() {
20986
- try {
20987
- var func = _getNative(Object, 'defineProperty');
20988
- func({}, '', {});
20989
- return func;
20990
- } catch (e) {}
20991
- }());
20992
-
20993
- var _defineProperty = defineProperty;
20994
-
20995
- /**
20996
- * The base implementation of `setToString` without support for hot loop shorting.
20997
- *
20998
- * @private
20999
- * @param {Function} func The function to modify.
21000
- * @param {Function} string The `toString` result.
21001
- * @returns {Function} Returns `func`.
21002
- */
21003
- var baseSetToString = !_defineProperty ? identity_1 : function(func, string) {
21004
- return _defineProperty(func, 'toString', {
21005
- 'configurable': true,
21006
- 'enumerable': false,
21007
- 'value': constant_1(string),
21008
- 'writable': true
21009
- });
21010
- };
21011
-
21012
- var _baseSetToString = baseSetToString;
21013
-
21014
- /** Used to detect hot functions by number of calls within a span of milliseconds. */
21015
- var HOT_COUNT = 800,
21016
- HOT_SPAN = 16;
21017
-
21018
- /* Built-in method references for those with the same name as other `lodash` methods. */
21019
- var nativeNow = Date.now;
21020
-
21021
- /**
21022
- * Creates a function that'll short out and invoke `identity` instead
21023
- * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
21024
- * milliseconds.
21025
- *
21026
- * @private
21027
- * @param {Function} func The function to restrict.
21028
- * @returns {Function} Returns the new shortable function.
21029
- */
21030
- function shortOut(func) {
21031
- var count = 0,
21032
- lastCalled = 0;
21033
-
21034
- return function() {
21035
- var stamp = nativeNow(),
21036
- remaining = HOT_SPAN - (stamp - lastCalled);
21037
-
21038
- lastCalled = stamp;
21039
- if (remaining > 0) {
21040
- if (++count >= HOT_COUNT) {
21041
- return arguments[0];
21042
- }
21043
- } else {
21044
- count = 0;
21045
- }
21046
- return func.apply(undefined, arguments);
21047
- };
21048
- }
21049
-
21050
- var _shortOut = shortOut;
21051
-
21052
- /**
21053
- * Sets the `toString` method of `func` to return `string`.
21054
- *
21055
- * @private
21056
- * @param {Function} func The function to modify.
21057
- * @param {Function} string The `toString` result.
21058
- * @returns {Function} Returns `func`.
21059
- */
21060
- var setToString = _shortOut(_baseSetToString);
21061
-
21062
- var _setToString = setToString;
21063
-
21064
- /**
21065
- * The base implementation of `_.rest` which doesn't validate or coerce arguments.
21066
- *
21067
- * @private
21068
- * @param {Function} func The function to apply a rest parameter to.
21069
- * @param {number} [start=func.length-1] The start position of the rest parameter.
21070
- * @returns {Function} Returns the new function.
21071
- */
21072
- function baseRest(func, start) {
21073
- return _setToString(_overRest(func, start, identity_1), func + '');
21074
- }
21075
-
21076
- var _baseRest = baseRest;
21077
-
21078
- /**
21079
- * Checks if the given arguments are from an iteratee call.
21080
- *
21081
- * @private
21082
- * @param {*} value The potential iteratee value argument.
21083
- * @param {*} index The potential iteratee index or key argument.
21084
- * @param {*} object The potential iteratee object argument.
21085
- * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
21086
- * else `false`.
21087
- */
21088
- function isIterateeCall(value, index, object) {
21089
- if (!isObject_1(object)) {
21090
- return false;
21091
- }
21092
- var type = typeof index;
21093
- if (type == 'number'
21094
- ? (isArrayLike_1(object) && _isIndex(index, object.length))
21095
- : (type == 'string' && index in object)
21096
- ) {
21097
- return eq_1(object[index], value);
21098
- }
21099
- return false;
21100
- }
21101
-
21102
- var _isIterateeCall = isIterateeCall;
21103
-
21104
- /**
21105
- * Creates an array of elements, sorted in ascending order by the results of
21106
- * running each element in a collection thru each iteratee. This method
21107
- * performs a stable sort, that is, it preserves the original sort order of
21108
- * equal elements. The iteratees are invoked with one argument: (value).
21109
- *
21110
- * @static
21111
- * @memberOf _
21112
- * @since 0.1.0
21113
- * @category Collection
21114
- * @param {Array|Object} collection The collection to iterate over.
21115
- * @param {...(Function|Function[])} [iteratees=[_.identity]]
21116
- * The iteratees to sort by.
21117
- * @returns {Array} Returns the new sorted array.
21118
- * @example
21119
- *
21120
- * var users = [
21121
- * { 'user': 'fred', 'age': 48 },
21122
- * { 'user': 'barney', 'age': 36 },
21123
- * { 'user': 'fred', 'age': 30 },
21124
- * { 'user': 'barney', 'age': 34 }
21125
- * ];
21126
- *
21127
- * _.sortBy(users, [function(o) { return o.user; }]);
21128
- * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
21129
- *
21130
- * _.sortBy(users, ['user', 'age']);
21131
- * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
21132
- */
21133
- var sortBy = _baseRest(function(collection, iteratees) {
21134
- if (collection == null) {
21135
- return [];
21136
- }
21137
- var length = iteratees.length;
21138
- if (length > 1 && _isIterateeCall(collection, iteratees[0], iteratees[1])) {
21139
- iteratees = [];
21140
- } else if (length > 2 && _isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
21141
- iteratees = [iteratees[0]];
21142
- }
21143
- return _baseOrderBy(collection, _baseFlatten(iteratees, 1), []);
21144
- });
21145
-
21146
- var sortBy_1 = sortBy;
21147
-
21148
- var MAX_SKILL_RATING = 7;
21149
-
21150
- var getPercentageRating = function getPercentageRating(rating) {
21151
- return Number((100 * rating / MAX_SKILL_RATING).toFixed(2));
21152
- };
21153
-
21154
- var getTimes = function getTimes(data) {
21155
- try {
21156
- var times = data.map(function (item) {
21157
- return item.ratings.map(function (rating) {
21158
- return rating.time;
21159
- });
21160
- }).flat();
21161
- return times.filter(function (item, index) {
21162
- return times.indexOf(item) === index;
21163
- }).map(function (time) {
21164
- return format$1(new Date(time), DATE_FORMAT);
21165
- }).sort();
21166
- } catch (_unused) {
21167
- return [];
21168
- }
21169
- };
21170
-
21171
- var getRatings = function getRatings(ratings, times) {
21172
- try {
21173
- var formatRatings = sortBy_1(ratings.map(function (item) {
21174
- return _extends({}, item, {
21175
- time: format$1(new Date(item.time), DATE_FORMAT),
21176
- rating: getPercentageRating(item.rating)
21177
- });
21178
- }), "time");
21179
- var results = [];
21180
-
21181
- var _loop = function _loop(i) {
21182
- var time = times[i];
21183
- var rating = formatRatings.find(function (item) {
21184
- return item.time === time;
21185
- });
21186
-
21187
- if (!rating) {
21188
- results[i] = {
21189
- value: i > 0 ? results[i - 1].value : 0,
21190
- isDiscrete: true
21191
- };
21192
- return "continue";
21193
- }
21194
-
21195
- results[i] = {
21196
- value: rating.rating,
21197
- isDiscrete: false
21198
- };
21199
- };
21200
-
21201
- for (var i = 0; i < times.length; i++) {
21202
- var _ret = _loop(i);
21203
-
21204
- if (_ret === "continue") continue;
21205
- }
21206
-
21207
- return results;
21208
- } catch (_unused2) {
21209
- return [];
21210
- }
21211
- };
21212
-
21213
- var useSkillFormat = function useSkillFormat(data) {
21214
- var _useState = useState([]),
21215
- activeSkillNames = _useState[0],
21216
- setActiveSkillNames = _useState[1];
21217
-
21218
- var toggleSkillName = useCallback(function (name) {
21219
- if (activeSkillNames.includes(name)) {
21220
- setActiveSkillNames(activeSkillNames.filter(function (item) {
21221
- return item !== name;
21222
- }));
21223
- return;
21224
- }
21225
-
21226
- setActiveSkillNames([].concat(activeSkillNames, [name]));
21227
- }, [activeSkillNames]);
21228
- var colors = useMemo(function () {
21229
- if (!data) return [];
21230
-
21231
- try {
21232
- return getColors(data.length);
21233
- } catch (_unused3) {
21234
- return [];
21235
- }
21236
- }, [data]);
21237
- var times = useMemo(function () {
21238
- return getTimes(data);
21239
- }, [data]);
21240
- var series = useMemo(function () {
21241
- if (!data) return [];
21242
-
21243
- try {
21244
- return data.map(function (item, index) {
21245
- return {
21246
- name: item.skillName,
21247
- color: colors[index],
21248
- data: getRatings(item.ratings, times).map(function (rating) {
21249
- return rating.value;
21250
- })
21251
- };
21252
- });
21253
- } catch (_unused4) {
21254
- return [];
21255
- }
21256
- }, [data, times]);
21257
- var discrete = useMemo(function () {
21258
- if (!data) return [];
21259
- var results = [];
21260
-
21261
- try {
21262
- data.map(function (item, index) {
21263
- var ratings = getRatings(item.ratings, times);
21264
- ratings.map(function (rating, ratingIndex) {
21265
- if (rating.isDiscrete) {
21266
- results.push({
21267
- seriesIndex: index,
21268
- dataPointIndex: ratingIndex,
21269
- size: 0
21270
- });
21271
- }
21272
- });
21273
- });
21274
- return results;
21275
- } catch (_unused5) {
21276
- return [];
21277
- }
21278
- }, [data, times]);
21279
- useEffect(function () {
21280
- if (data) {
21281
- try {
21282
- setActiveSkillNames(data.map(function (item) {
21283
- return item.skillName;
21284
- }));
21285
- } catch (_unused6) {}
21286
- }
21287
- }, [data]);
21288
- return {
21289
- colors: colors,
21290
- activeSkillNames: activeSkillNames,
21291
- times: times,
21292
- series: series,
21293
- discrete: discrete,
21294
- toggleSkillName: toggleSkillName
21295
- };
21296
- };
21297
-
21298
- var ICON_SIZE = 8;
21299
- var ICON_COLOR = "#fff";
21300
-
21301
- var CustomCheckbox = function CustomCheckbox(_ref) {
21302
- var label = _ref.label,
21303
- color = _ref.color,
21304
- checked = _ref.checked,
21305
- _onClick = _ref.onClick;
21306
- return React.createElement("div", {
21307
- className: "d-flex align-items-center"
21308
- }, React.createElement("span", {
21309
- className: "custom-checkbox-square d-flex align-items-center justify-content-center cursor-pointer",
21310
- style: checked ? {
21311
- backgroundColor: color
21312
- } : {},
21313
- onClick: function onClick(_e) {
21314
- return _onClick();
21315
- }
21316
- }, checked && React.createElement(FaCheck, {
21317
- size: ICON_SIZE,
21318
- color: ICON_COLOR
21319
- })), React.createElement("span", {
21320
- className: "ml-2"
21321
- }, label));
21322
- };
21323
-
21324
- var Skill = function Skill(_ref) {
21325
- var data = _ref.data;
21326
-
21327
- var _useSkillFormat = useSkillFormat(data),
21328
- colors = _useSkillFormat.colors,
21329
- activeSkillNames = _useSkillFormat.activeSkillNames,
21330
- series = _useSkillFormat.series,
21331
- times = _useSkillFormat.times,
21332
- discrete = _useSkillFormat.discrete,
21333
- toggleSkillName = _useSkillFormat.toggleSkillName;
21334
-
21335
- var options = {
21336
- chart: {
21337
- height: 350,
21338
- type: "area",
21339
- toolbar: {
21340
- show: false
21341
- }
21342
- },
21343
- dataLabels: {
21344
- enabled: false
21345
- },
21346
- stroke: {
21347
- width: 2,
21348
- curve: "straight"
21349
- },
21350
- markers: {
21351
- size: 4,
21352
- colors: ["#fff"],
21353
- strokeColors: colors,
21354
- strokeWidth: 2,
21355
- strokeOpacity: 0.9,
21356
- strokeDashArray: 0,
21357
- fillOpacity: 1,
21358
- shape: "circle",
21359
- radius: 2,
21360
- offsetX: 0,
21361
- offsetY: 0,
21362
- onClick: undefined,
21363
- onDblClick: undefined,
21364
- showNullDataPoints: true,
21365
- hover: {
21366
- size: undefined,
21367
- sizeOffset: 3
21368
- },
21369
- discrete: discrete
21370
- },
21371
- legend: {
21372
- show: false
21373
- },
21374
- xaxis: {
21375
- categories: times
21376
- },
21377
- yaxis: {
21378
- min: 0,
21379
- max: 100,
21380
- labels: {
21381
- formatter: function formatter(val) {
21382
- return val + "%";
21383
- }
21384
- }
21385
- },
21386
- tooltip: {}
21387
- };
21388
- if (!data) return React.createElement(Loading, null);
21389
- return React.createElement("div", null, series && React.createElement(Fragment, null, React.createElement("div", {
21390
- className: "d-flex align-items-center flex-wrap"
21391
- }, series.map(function (item, index) {
21392
- return React.createElement("div", {
21393
- key: item.name,
21394
- className: "d-flex align-items-center mr-3"
21395
- }, React.createElement(CustomCheckbox, {
21396
- label: item.name,
21397
- color: colors[index],
21398
- checked: activeSkillNames.includes(item.name),
21399
- onClick: function onClick() {
21400
- return toggleSkillName && toggleSkillName(item.name);
21401
- }
21402
- }));
21403
- })), React.createElement(ReactApexChart, {
21404
- options: options,
21405
- series: series.filter(function (item) {
21406
- return activeSkillNames.includes(item.name);
21407
- }),
21408
- type: "area",
21409
- height: 350
21410
- })));
21411
- };
21412
-
21413
- var colors$5 = ["#c0392b", "#3498db"];
21414
-
21415
- var TimeInSession = function TimeInSession(_ref) {
21416
- var data = _ref.data;
21417
- if (!data) return React.createElement(Loading, null);
21418
- var series = [{
21419
- name: "Teacher",
21420
- data: data.map(function (item) {
21421
- return item.teacherPerceivedImpact;
17606
+ var cards = [{
17607
+ label: "High-impact learning strategies of current school year",
17608
+ children: React.createElement(HighImpact, {
17609
+ data: highImpact
21422
17610
  })
21423
17611
  }, {
21424
- name: "Student",
21425
- data: data.map(function (item) {
21426
- return item.studentPerceivedImpact;
17612
+ label: "Learning strategies perceived impact",
17613
+ children: React.createElement(PerceivedImpact, {
17614
+ data: perceivedImpact
21427
17615
  })
21428
- }];
21429
- var categories = data.map(function (item) {
21430
- return item.sessionCategory;
21431
- });
21432
- var options = {
21433
- chart: {
21434
- type: "bar",
21435
- height: 350,
21436
- toolbar: {
21437
- show: false
21438
- }
21439
- },
21440
- colors: colors$5,
21441
- plotOptions: {
21442
- bar: {
21443
- horizontal: false,
21444
- columnWidth: "55%"
21445
- }
21446
- },
21447
- dataLabels: {
21448
- enabled: false
21449
- },
21450
- stroke: {
21451
- show: true,
21452
- width: 2,
21453
- colors: ["transparent"]
21454
- },
21455
- xaxis: {
21456
- categories: categories
21457
- },
21458
- fill: {
21459
- opacity: 1
21460
- },
21461
- legend: {
21462
- onItemClick: {
21463
- toggleDataSeries: false
21464
- },
21465
- onItemHover: {
21466
- highlightDataSeries: false
21467
- }
21468
- }
21469
- };
21470
- return React.createElement("div", null, React.createElement(ReactApexChart, {
21471
- options: options,
21472
- series: series,
21473
- type: "bar",
21474
- height: 350
21475
- }));
21476
- };
21477
-
21478
- var colors$6 = ["#f0932b", "#22a6b3", "#6ab04c"];
21479
- var categories = ["Before intervention", "During intervention", "After intervention"];
21480
-
21481
- var findGradeLabel = function findGradeLabel(value, bandScores) {
21482
- var sortedBandScores = bandScores === null || bandScores === void 0 ? void 0 : bandScores.sort(function (item1, item2) {
21483
- return item1.value - item2.value;
21484
- });
21485
-
21486
- if ((sortedBandScores === null || sortedBandScores === void 0 ? void 0 : sortedBandScores.length) > 0) {
21487
- for (var i = 0; i < sortedBandScores.length; i++) {
21488
- var _sortedBandScores$i, _sortedBandScores;
21489
-
21490
- if (((_sortedBandScores$i = sortedBandScores[i]) === null || _sortedBandScores$i === void 0 ? void 0 : _sortedBandScores$i.value) <= value && value <= ((_sortedBandScores = sortedBandScores[i + 1]) === null || _sortedBandScores === void 0 ? void 0 : _sortedBandScores.value)) {
21491
- var _sortedBandScores$i2, _sortedBandScores2, _sortedBandScores3;
21492
-
21493
- if (value - ((_sortedBandScores$i2 = sortedBandScores[i]) === null || _sortedBandScores$i2 === void 0 ? void 0 : _sortedBandScores$i2.value) <= ((_sortedBandScores2 = sortedBandScores[i + 1]) === null || _sortedBandScores2 === void 0 ? void 0 : _sortedBandScores2.value) - value) {
21494
- var _sortedBandScores$i3;
21495
-
21496
- return (_sortedBandScores$i3 = sortedBandScores[i]) === null || _sortedBandScores$i3 === void 0 ? void 0 : _sortedBandScores$i3.label;
21497
- }
21498
-
21499
- return (_sortedBandScores3 = sortedBandScores[i + 1]) === null || _sortedBandScores3 === void 0 ? void 0 : _sortedBandScores3.label;
21500
- }
21501
- }
21502
- }
21503
-
21504
- return "";
21505
- };
21506
-
21507
- var Grade = function Grade(_ref) {
21508
- var data = _ref.data;
21509
- if (!data) return React.createElement(Loading, null);
21510
- var series = [{
21511
- data: [data.beforeIntervention, data.duringIntervention, data.afterIntervention]
21512
- }];
21513
- var options = {
21514
- chart: {
21515
- height: 350,
21516
- type: "bar",
21517
- toolbar: {
21518
- show: false
21519
- }
21520
- },
21521
- colors: colors$6,
21522
- plotOptions: {
21523
- bar: {
21524
- columnWidth: "45%",
21525
- distributed: true
21526
- }
21527
- },
21528
- dataLabels: {
21529
- enabled: false
21530
- },
21531
- legend: {
21532
- show: false
21533
- },
21534
- xaxis: {
21535
- categories: categories
21536
- },
21537
- yaxis: {
21538
- max: Math.max.apply(Math, data.bandScores.map(function (item) {
21539
- return item.value;
21540
- })),
21541
- min: Math.min.apply(Math, data.bandScores.map(function (item) {
21542
- return item.value;
21543
- })),
21544
- labels: {
21545
- formatter: function formatter(val) {
21546
- return findGradeLabel(val, data.bandScores);
21547
- }
21548
- }
21549
- }
21550
- };
21551
- return React.createElement("div", null, React.createElement(ReactApexChart, {
21552
- options: options,
21553
- series: series,
21554
- type: "bar",
21555
- height: 350
21556
- }));
21557
- };
21558
-
21559
- var Dashboard = function Dashboard() {
21560
- var _useDashboard = useDashboard(),
21561
- loginCounting = _useDashboard.loginCounting,
21562
- quantity = _useDashboard.quantity,
21563
- skill = _useDashboard.skill,
21564
- goalProgress = _useDashboard.goalProgress,
21565
- highImpact = _useDashboard.highImpact,
21566
- perceivedImpact = _useDashboard.perceivedImpact,
21567
- timeInSession = _useDashboard.timeInSession,
21568
- grade = _useDashboard.grade;
21569
-
21570
- var cards = [{
17616
+ }, {
21571
17617
  label: "Students & teachers login per day",
21572
17618
  children: React.createElement(LoginCouting, {
21573
17619
  data: loginCounting
@@ -21577,36 +17623,6 @@ var Dashboard = function Dashboard() {
21577
17623
  children: React.createElement(Quantity, {
21578
17624
  data: quantity
21579
17625
  })
21580
- }, {
21581
- label: "MARIO skill",
21582
- children: React.createElement(Skill, {
21583
- data: skill
21584
- })
21585
- }, {
21586
- label: "Goal progress",
21587
- children: React.createElement(GoalProgressReport, {
21588
- data: goalProgress
21589
- })
21590
- }, {
21591
- label: "1-1 sessions perceived impact",
21592
- children: React.createElement(TimeInSession, {
21593
- data: timeInSession
21594
- })
21595
- }, {
21596
- label: "Grades",
21597
- children: React.createElement(Grade, {
21598
- data: grade
21599
- })
21600
- }, {
21601
- label: "High-impact learning strategies of current school year",
21602
- children: React.createElement(HighImpact, {
21603
- data: highImpact
21604
- })
21605
- }, {
21606
- label: "Learning strategies perceived impact",
21607
- children: React.createElement(PerceivedImpact, {
21608
- data: perceivedImpact
21609
- })
21610
17626
  }];
21611
17627
  return React.createElement("div", null, React.createElement("h4", {
21612
17628
  className: "mb-5"