mario-education 2.4.403-multi → 2.4.404-multi

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.
@@ -27,6 +27,6 @@ declare const useHeaderSideBar: (_navigations: any) => {
27
27
  handleClose: () => void;
28
28
  renderNavigationItem: (navigation: any, isSubItem?: boolean | undefined) => JSX.Element;
29
29
  goToSettings: () => void;
30
- t: any;
30
+ t: import("i18next").TFunction;
31
31
  };
32
32
  export default useHeaderSideBar;
@@ -15,7 +15,7 @@ interface Props {
15
15
  onSubmit?: Function;
16
16
  }
17
17
  declare const useInterventionDialog: (props: Props) => {
18
- t: any;
18
+ t: import("i18next").TFunction;
19
19
  intervention: INTERVENTION | undefined;
20
20
  interventionLog: INTERVENTION_LOG;
21
21
  answerType: string | null;
package/dist/index.js CHANGED
@@ -44353,7 +44353,7 @@ module.exports = _defineProperty;
44353
44353
  module.exports["default"] = module.exports, module.exports.__esModule = true;
44354
44354
  });
44355
44355
 
44356
- unwrapExports(defineProperty);
44356
+ var _defineProperty$2 = unwrapExports(defineProperty);
44357
44357
 
44358
44358
  var compareOption = function compareOption() {
44359
44359
  var inputValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
@@ -50328,248 +50328,335 @@ var CustomTabComponent = function CustomTabComponent(_ref) {
50328
50328
 
50329
50329
  var style$2 = {"font-large":"_356Xx","table-border":"_3rVdM","Close":"_2Vs6W","Active":"_fISYg","row_name":"_2-4H1","bg-red":"_1G8nL","bg-green":"_ATqes","bg-yellow":"_U2Fov","row-status":"_2mAty","table-class-type":"_2KRfC","box-form-input":"_3bgU2","box-content":"_4h5aW","confirm_btn_title":"_3vU-q","content":"_2eddN","btn-favorite-text":"_3bpqI","description-template-left":"_3BhUP","name-template-left":"_2CA9Q","data-grid-content":"_697ao","select-right":"_1J-bu","content-confirm-model":"_2pqFa","input-title":"_1Dfbh","total-card-title":"_2-hXf","title-filter":"_36snY","form-input-title":"_1FINV","list-favorite":"_3EcML","title":"_2sFa5","title-block":"_18vbq","box-additional-title":"_NUXao","dialog-title":"_1oyCk","title-chart":"_2Yhd1","btn-send-survey":"_1xze5","btn-cancel":"_1bqU6","chip-email-default":"_2xKhD","chip-email-checked":"_ouqj6","title-content":"_2O3Tp","create-btn":"_3Cux8","general-chart-title":"_2Lxtl","action-wrapper":"_rEUU_","action-item":"_2n3hL","survey-detail":"_3vJ-g","header-survey-detail":"_Ri4lG","content-header":"_M7dFA","survey-title":"_2APad","responses-distribution":"_1I0XZ","description":"_1hw5e","list-check-question":"_1Ejsc","select-question":"_2t6cX","question":"_2cNmh","ratings-of-questions":"_3225G","show-result":"_3KDFH","chart-result-for-question":"_N5fxX","parameter":"_1NNB0","percent":"_-Fj2n","chart":"_1Qyn4","legend":"_1tBch","avr":"_2TsdE","legend-item":"_3YpJk","name":"_2W9F-","action":"_Ldh2m","header-conduct":"_1npo6","student-detail":"_1pKV2","student-name":"_1GBNs","survey-name":"_2qlBy","conduct-body":"_1dxHK","response-question":"_3IlYT","title-model":"_1UBEA","total-cards":"_38gNv","card":"_C2FoT","response-body":"_3XFlg","student":"_2fuBW","date":"_QH_aS","answer":"_3Rool","none-answer":"_l65o6","font-small":"_1mTdj","option-select":"_32CPv","icon-add-header":"_2tltH","sup-require":"_3IAjJ","span-title":"_2vOMh","checked-favorite":"_JL458","flag":"_1jRbU","filter-desktop":"_1ByZl","h-75":"_2bC49","filter-mobile":"_39EFp","d-flex":"_3ILHs","flex-between":"_1Dy7M","pointer":"_1G7Oj","ml-10":"_3pvOS","mt-20":"_3QSsx","select-type":"_1zeZ3","all-student-survey":"_2rp1M","box-input-csv":"_HGXSI","icon":"_2jqP8","model-confirm-publish":"_1DLAE","box-email-content":"_3aA8I","input-mail-content":"_3HfSn","list-chip-email":"_2mJew","box-chip-email":"_2fwdD","table-desktop":"_3_y0a","table-container":"_DFKYF","data-grid":"_3EcnW","MuiDataGrid-columnSeparator":"_3P0hc","table-mobile":"_1iMfJ","block-list-survey":"_EuZ8_","box-filter":"_3utMA","block-total":"_qlUFF","list-card-right":"_Epdgt","filter-select":"_20eFs","box-filter-left":"_MtBqD","filter-item":"_1WJAo","box-filter-right":"_2VDGv","search-input-icon":"_1FexU","inputInput":"_2JzR2","external-item":"_2iP6U","action-view":"_6y3DH","time-Date":"_17nC2","time-Hours-Minute":"_1vEXB","table-row":"_1jd05","arrow-icon":"_3Urdb","table-cell":"_qPEQy","btn-function":"_2xh2d","btn-action-text":"_2KfG4","avatar_user":"_2mUU4","innerHtml":"_2fgAa","btn-open":"_fLtnC","date-schedule":"_1amhM","pending":"_38Q73","replied":"_2mi_L","actionneeded":"_3qg29","actionneed":"_3XKeC","noscheduled":"_salNB","scheduled":"_3vFP4","completed":"_FoXPx","notstartyet":"_3bhI6","flex-item":"_36RRe","mr-10":"_2A5LB","session":"_33gcZ","schedule-now":"_2BiiZ","block-filter":"_3qVjM","block-filter-right":"_1C7WS","create-survey-container":"_2_bhv","box-create-survey":"_1h2_-","box-list-favorite":"_2Np-n","check-box-btn":"_2KGDK","stepper":"_AHiUZ","step-label":"_6O2vy","dialog-select-template":"_Vb5G5","icon-btn":"_1aD3k","icon-remove":"_rxvBN","title-btn":"_3BDjW","title-box-model":"_3V3hO","box-content-select":"_1p5SM","title-content-select":"_1wY14","description-content-select":"_3AYvl","box-function":"_1yo2i","cancel_btn":"_2q0h5","confirm_btn":"_1wniK","confirm_btn_icon":"_3rnyp","remove_btn":"_3WkIH","remove_btn_title":"_14_xL","remove_btn_icon":"_3VptO","mid_btn":"_Psdg4","box-function-flex":"_2K1MV","box-collapse":"_2-Sse","box-collapse-top":"_miLBv","box-collapse-right":"_2xNTI","collapse-chip":"_13im8","collapse-left-title":"_aft4S","box-collapse-content-item":"_26SCl","block-review-detail":"_1d4Lf","block-content-review":"_12S3I","block-template-review":"_36gKq","block-template-left":"_lw5Ox","additional-box":"_3_5ab","header-item":"_1Q3h9","header-title":"_1WGNT","space-content":"_36P3O","table-title":"_1FCFx","table-status":"_L_uPM","box-header-select":"_1k-yH","header-select-name":"_32KLh","header-select-icon":"_28PLI","header-select-detail":"_ZI06k","list-question-select":"_2EaBh","new-survey":"_SLI97","box-survey":"_dVgqi","avt-user":"_2oBnh","infor":"_3HNaN","content-text":"_SIfgw","time":"_1Sje8","card-item-mobile":"_UEtvP","card-item-left":"_1IKvD","item-name":"_2vyTL","item-detail":"_1bzAB","item-date":"_vw-CP","item-date-content":"_3tsha","table-status-mobile":"_2yS_O","button-mobile":"_1WcRD","box-detail":"_2Mctt","btn-duplicate":"_3Gz-M","box-input":"_3VFOh","item-answer":"_1zSJi","box-favorite":"_2o2b0","overview-survey":"_2sVJR","chart-view-dashboard":"_1doPS","block-chart-wrapper":"_1lkE3","block-chart-title":"_9mzcE","block-chart-top":"_QLUQO","chart-left":"_2c6UE","chart-right":"_1Pmw_","block-header-chart":"_14hBc","column-chart-percent":"_1Ml_a","chart-background":"_2AO5K","custom-marker":"_21lNI","item-legend":"_3BpNG","mark-custom":"_tnwFd","label-legend-custom":"_2juK0","mark-legend":"_13l-r","label-chart":"_3KJlm","listItem":"_1sU--","item":"_397kU","item-checkbox":"_33URL","check-box":"_X-D1i","pie-chart":"_2-TOd","box-chart-title":"_Gijux","box-chart":"_3G2tI","legend-pie-custom":"_sm5jY","color-box":"_3LqNl","generate-flag":"_24iDw","flag-item":"_V8630","count":"_39_gg","red":"_1Qdq3","yellow":"_1ukSp","green":"_Aj1d4","select-filter-top":"_3vD8W","filter-box":"_2WhAK","accordion":"_QOqG1","expanded-summary":"_oa9O2","expanded-title":"_1gxS6","expanded-detail":"_1Uklu","oveview-style":"_DU0s_","item-container":"_17V8B","note-external":"_1Mvjg","icon-back-page":"_3ckSJ","dot":"_1vzYS","table-wrapper":"_z0mjD","pagination":"_kn_xp","dot-response":"_2Nrxx","dot-not-response":"_6GUzQ","middle":"_2gw2z","table-dropdown":"_13mck","table-header":"_nxpHH","tbody-table":"_34MIA"};
50330
50330
 
50331
+ var classCallCheck = createCommonjsModule(function (module) {
50332
+ function _classCallCheck(instance, Constructor) {
50333
+ if (!(instance instanceof Constructor)) {
50334
+ throw new TypeError("Cannot call a class as a function");
50335
+ }
50336
+ }
50337
+
50338
+ module.exports = _classCallCheck;
50339
+ module.exports["default"] = module.exports, module.exports.__esModule = true;
50340
+ });
50341
+
50342
+ var _classCallCheck$1 = unwrapExports(classCallCheck);
50343
+
50344
+ var createClass = createCommonjsModule(function (module) {
50345
+ function _defineProperties(target, props) {
50346
+ for (var i = 0; i < props.length; i++) {
50347
+ var descriptor = props[i];
50348
+ descriptor.enumerable = descriptor.enumerable || false;
50349
+ descriptor.configurable = true;
50350
+ if ("value" in descriptor) descriptor.writable = true;
50351
+ Object.defineProperty(target, descriptor.key, descriptor);
50352
+ }
50353
+ }
50354
+
50355
+ function _createClass(Constructor, protoProps, staticProps) {
50356
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
50357
+ if (staticProps) _defineProperties(Constructor, staticProps);
50358
+ return Constructor;
50359
+ }
50360
+
50361
+ module.exports = _createClass;
50362
+ module.exports["default"] = module.exports, module.exports.__esModule = true;
50363
+ });
50364
+
50365
+ var _createClass$1 = unwrapExports(createClass);
50366
+
50367
+ var defaultOptions = {
50368
+ bindI18n: 'languageChanged',
50369
+ bindI18nStore: '',
50370
+ transEmptyNodeValue: '',
50371
+ transSupportBasicHtmlNodes: true,
50372
+ transKeepBasicHtmlNodesFor: ['br', 'strong', 'i', 'p'],
50373
+ useSuspense: true
50374
+ };
50375
+ var i18nInstance;
50376
+ var I18nContext = React__default.createContext();
50377
+ function getDefaults() {
50378
+ return defaultOptions;
50379
+ }
50380
+ var ReportNamespaces = function () {
50381
+ function ReportNamespaces() {
50382
+ _classCallCheck$1(this, ReportNamespaces);
50383
+
50384
+ this.usedNamespaces = {};
50385
+ }
50386
+
50387
+ _createClass$1(ReportNamespaces, [{
50388
+ key: "addUsedNamespaces",
50389
+ value: function addUsedNamespaces(namespaces) {
50390
+ var _this = this;
50391
+
50392
+ namespaces.forEach(function (ns) {
50393
+ if (!_this.usedNamespaces[ns]) _this.usedNamespaces[ns] = true;
50394
+ });
50395
+ }
50396
+ }, {
50397
+ key: "getUsedNamespaces",
50398
+ value: function getUsedNamespaces() {
50399
+ return Object.keys(this.usedNamespaces);
50400
+ }
50401
+ }]);
50402
+
50403
+ return ReportNamespaces;
50404
+ }();
50405
+ function getI18n() {
50406
+ return i18nInstance;
50407
+ }
50408
+
50331
50409
  function warn() {
50332
50410
  if (console && console.warn) {
50411
+ var _console;
50412
+
50333
50413
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
50334
50414
  args[_key] = arguments[_key];
50335
50415
  }
50336
- if (typeof args[0] === 'string') args[0] = `react-i18next:: ${args[0]}`;
50337
- console.warn(...args);
50416
+
50417
+ if (typeof args[0] === 'string') args[0] = "react-i18next:: ".concat(args[0]);
50418
+
50419
+ (_console = console).warn.apply(_console, args);
50338
50420
  }
50339
50421
  }
50340
- const alreadyWarned = {};
50422
+ var alreadyWarned = {};
50341
50423
  function warnOnce() {
50342
50424
  for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
50343
50425
  args[_key2] = arguments[_key2];
50344
50426
  }
50427
+
50345
50428
  if (typeof args[0] === 'string' && alreadyWarned[args[0]]) return;
50346
50429
  if (typeof args[0] === 'string') alreadyWarned[args[0]] = new Date();
50347
- warn(...args);
50430
+ warn.apply(void 0, args);
50348
50431
  }
50349
- const loadedClb = (i18n, cb) => () => {
50350
- if (i18n.isInitialized) {
50351
- cb();
50352
- } else {
50353
- const initialized = () => {
50354
- setTimeout(() => {
50355
- i18n.off('initialized', initialized);
50356
- }, 0);
50357
- cb();
50358
- };
50359
- i18n.on('initialized', initialized);
50360
- }
50361
- };
50362
50432
  function loadNamespaces(i18n, ns, cb) {
50363
- i18n.loadNamespaces(ns, loadedClb(i18n, cb));
50364
- }
50365
- function loadLanguages(i18n, lng, ns, cb) {
50366
- if (typeof ns === 'string') ns = [ns];
50367
- ns.forEach(n => {
50368
- if (i18n.options.ns.indexOf(n) < 0) i18n.options.ns.push(n);
50433
+ i18n.loadNamespaces(ns, function () {
50434
+ if (i18n.isInitialized) {
50435
+ cb();
50436
+ } else {
50437
+ var initialized = function initialized() {
50438
+ setTimeout(function () {
50439
+ i18n.off('initialized', initialized);
50440
+ }, 0);
50441
+ cb();
50442
+ };
50443
+
50444
+ i18n.on('initialized', initialized);
50445
+ }
50369
50446
  });
50370
- i18n.loadLanguages(lng, loadedClb(i18n, cb));
50371
50447
  }
50372
- function oldI18nextHasLoadedNamespace(ns, i18n) {
50373
- let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
50374
- const lng = i18n.languages[0];
50375
- const fallbackLng = i18n.options ? i18n.options.fallbackLng : false;
50376
- const lastLng = i18n.languages[i18n.languages.length - 1];
50448
+ function hasLoadedNamespace(ns, i18n) {
50449
+ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
50450
+
50451
+ if (!i18n.languages || !i18n.languages.length) {
50452
+ warnOnce('i18n.languages were undefined or empty', i18n.languages);
50453
+ return true;
50454
+ }
50455
+
50456
+ var lng = i18n.languages[0];
50457
+ var fallbackLng = i18n.options ? i18n.options.fallbackLng : false;
50458
+ var lastLng = i18n.languages[i18n.languages.length - 1];
50377
50459
  if (lng.toLowerCase() === 'cimode') return true;
50378
- const loadNotPending = (l, n) => {
50379
- const loadState = i18n.services.backendConnector.state[`${l}|${n}`];
50460
+
50461
+ var loadNotPending = function loadNotPending(l, n) {
50462
+ var loadState = i18n.services.backendConnector.state["".concat(l, "|").concat(n)];
50380
50463
  return loadState === -1 || loadState === 2;
50381
50464
  };
50465
+
50382
50466
  if (options.bindI18n && options.bindI18n.indexOf('languageChanging') > -1 && i18n.services.backendConnector.backend && i18n.isLanguageChangingTo && !loadNotPending(i18n.isLanguageChangingTo, ns)) return false;
50383
50467
  if (i18n.hasResourceBundle(lng, ns)) return true;
50384
- if (!i18n.services.backendConnector.backend || i18n.options.resources && !i18n.options.partialBundledLanguages) return true;
50468
+ if (!i18n.services.backendConnector.backend) return true;
50385
50469
  if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;
50386
50470
  return false;
50387
50471
  }
50388
- function hasLoadedNamespace(ns, i18n) {
50389
- let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
50390
- if (!i18n.languages || !i18n.languages.length) {
50391
- warnOnce('i18n.languages were undefined or empty', i18n.languages);
50392
- return true;
50393
- }
50394
- const isNewerI18next = i18n.options.ignoreJSONStructure !== undefined;
50395
- if (!isNewerI18next) {
50396
- return oldI18nextHasLoadedNamespace(ns, i18n, options);
50397
- }
50398
- return i18n.hasLoadedNamespace(ns, {
50399
- lng: options.lng,
50400
- precheck: (i18nInstance, loadNotPending) => {
50401
- if (options.bindI18n && options.bindI18n.indexOf('languageChanging') > -1 && i18nInstance.services.backendConnector.backend && i18nInstance.isLanguageChangingTo && !loadNotPending(i18nInstance.isLanguageChangingTo, ns)) return false;
50402
- }
50403
- });
50404
- }
50405
50472
 
50406
- const matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
50407
- const htmlEntities = {
50408
- '&amp;': '&',
50409
- '&#38;': '&',
50410
- '&lt;': '<',
50411
- '&#60;': '<',
50412
- '&gt;': '>',
50413
- '&#62;': '>',
50414
- '&apos;': "'",
50415
- '&#39;': "'",
50416
- '&quot;': '"',
50417
- '&#34;': '"',
50418
- '&nbsp;': ' ',
50419
- '&#160;': ' ',
50420
- '&copy;': '©',
50421
- '&#169;': '©',
50422
- '&reg;': '®',
50423
- '&#174;': '®',
50424
- '&hellip;': '…',
50425
- '&#8230;': '…',
50426
- '&#x2F;': '/',
50427
- '&#47;': '/'
50428
- };
50429
- const unescapeHtmlEntity = m => htmlEntities[m];
50430
- const unescape = text => text.replace(matchHtmlEntity, unescapeHtmlEntity);
50431
-
50432
- let defaultOptions = {
50433
- bindI18n: 'languageChanged',
50434
- bindI18nStore: '',
50435
- transEmptyNodeValue: '',
50436
- transSupportBasicHtmlNodes: true,
50437
- transWrapTextNodes: '',
50438
- transKeepBasicHtmlNodesFor: ['br', 'strong', 'i', 'p'],
50439
- useSuspense: true,
50440
- unescape
50441
- };
50442
- function getDefaults() {
50443
- return defaultOptions;
50473
+ var arrayWithHoles = createCommonjsModule(function (module) {
50474
+ function _arrayWithHoles(arr) {
50475
+ if (Array.isArray(arr)) return arr;
50444
50476
  }
50445
50477
 
50446
- let i18nInstance;
50447
- function getI18n() {
50448
- return i18nInstance;
50449
- }
50478
+ module.exports = _arrayWithHoles;
50479
+ module.exports["default"] = module.exports, module.exports.__esModule = true;
50480
+ });
50450
50481
 
50451
- const I18nContext = React.createContext();
50452
- class ReportNamespaces {
50453
- constructor() {
50454
- this.usedNamespaces = {};
50455
- }
50456
- addUsedNamespaces(namespaces) {
50457
- namespaces.forEach(ns => {
50458
- if (!this.usedNamespaces[ns]) this.usedNamespaces[ns] = true;
50459
- });
50482
+ unwrapExports(arrayWithHoles);
50483
+
50484
+ var iterableToArrayLimit = createCommonjsModule(function (module) {
50485
+ function _iterableToArrayLimit(arr, i) {
50486
+ if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
50487
+ var _arr = [];
50488
+ var _n = true;
50489
+ var _d = false;
50490
+ var _e = undefined;
50491
+
50492
+ try {
50493
+ for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
50494
+ _arr.push(_s.value);
50495
+
50496
+ if (i && _arr.length === i) break;
50497
+ }
50498
+ } catch (err) {
50499
+ _d = true;
50500
+ _e = err;
50501
+ } finally {
50502
+ try {
50503
+ if (!_n && _i["return"] != null) _i["return"]();
50504
+ } finally {
50505
+ if (_d) throw _e;
50506
+ }
50460
50507
  }
50461
- getUsedNamespaces() {
50462
- return Object.keys(this.usedNamespaces);
50508
+
50509
+ return _arr;
50510
+ }
50511
+
50512
+ module.exports = _iterableToArrayLimit;
50513
+ module.exports["default"] = module.exports, module.exports.__esModule = true;
50514
+ });
50515
+
50516
+ unwrapExports(iterableToArrayLimit);
50517
+
50518
+ var arrayLikeToArray = createCommonjsModule(function (module) {
50519
+ function _arrayLikeToArray(arr, len) {
50520
+ if (len == null || len > arr.length) len = arr.length;
50521
+
50522
+ for (var i = 0, arr2 = new Array(len); i < len; i++) {
50523
+ arr2[i] = arr[i];
50463
50524
  }
50525
+
50526
+ return arr2;
50464
50527
  }
50465
50528
 
50466
- const usePrevious = (value, ignore) => {
50467
- const ref = React.useRef();
50468
- React.useEffect(() => {
50469
- ref.current = ignore ? ref.current : value;
50470
- }, [value, ignore]);
50471
- return ref.current;
50472
- };
50473
- function alwaysNewT(i18n, language, namespace, keyPrefix) {
50474
- return i18n.getFixedT(language, namespace, keyPrefix);
50529
+ module.exports = _arrayLikeToArray;
50530
+ module.exports["default"] = module.exports, module.exports.__esModule = true;
50531
+ });
50532
+
50533
+ unwrapExports(arrayLikeToArray);
50534
+
50535
+ var unsupportedIterableToArray = createCommonjsModule(function (module) {
50536
+ function _unsupportedIterableToArray(o, minLen) {
50537
+ if (!o) return;
50538
+ if (typeof o === "string") return arrayLikeToArray(o, minLen);
50539
+ var n = Object.prototype.toString.call(o).slice(8, -1);
50540
+ if (n === "Object" && o.constructor) n = o.constructor.name;
50541
+ if (n === "Map" || n === "Set") return Array.from(o);
50542
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
50543
+ }
50544
+
50545
+ module.exports = _unsupportedIterableToArray;
50546
+ module.exports["default"] = module.exports, module.exports.__esModule = true;
50547
+ });
50548
+
50549
+ unwrapExports(unsupportedIterableToArray);
50550
+
50551
+ var nonIterableRest = createCommonjsModule(function (module) {
50552
+ function _nonIterableRest() {
50553
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
50475
50554
  }
50476
- function useMemoizedT(i18n, language, namespace, keyPrefix) {
50477
- return React.useCallback(alwaysNewT(i18n, language, namespace, keyPrefix), [i18n, language, namespace, keyPrefix]);
50555
+
50556
+ module.exports = _nonIterableRest;
50557
+ module.exports["default"] = module.exports, module.exports.__esModule = true;
50558
+ });
50559
+
50560
+ unwrapExports(nonIterableRest);
50561
+
50562
+ var slicedToArray = createCommonjsModule(function (module) {
50563
+ function _slicedToArray(arr, i) {
50564
+ return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
50478
50565
  }
50566
+
50567
+ module.exports = _slicedToArray;
50568
+ module.exports["default"] = module.exports, module.exports.__esModule = true;
50569
+ });
50570
+
50571
+ var _slicedToArray = unwrapExports(slicedToArray);
50572
+
50573
+ function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
50574
+
50575
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$1(Object(source), true).forEach(function (key) { _defineProperty$2(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
50479
50576
  function useTranslation(ns) {
50480
- let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
50481
- const {
50482
- i18n: i18nFromProps
50483
- } = props;
50484
- const {
50485
- i18n: i18nFromContext,
50486
- defaultNS: defaultNSFromContext
50487
- } = React.useContext(I18nContext) || {};
50488
- const i18n = i18nFromProps || i18nFromContext || getI18n();
50577
+ var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
50578
+ var i18nFromProps = props.i18n;
50579
+
50580
+ var _ref = React.useContext(I18nContext) || {},
50581
+ i18nFromContext = _ref.i18n,
50582
+ defaultNSFromContext = _ref.defaultNS;
50583
+
50584
+ var i18n = i18nFromProps || i18nFromContext || getI18n();
50489
50585
  if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces();
50586
+
50490
50587
  if (!i18n) {
50491
50588
  warnOnce('You will need to pass in an i18next instance by using initReactI18next');
50492
- const notReadyT = (k, optsOrDefaultValue) => {
50493
- if (typeof optsOrDefaultValue === 'string') return optsOrDefaultValue;
50494
- if (optsOrDefaultValue && typeof optsOrDefaultValue === 'object' && typeof optsOrDefaultValue.defaultValue === 'string') return optsOrDefaultValue.defaultValue;
50589
+
50590
+ var notReadyT = function notReadyT(k) {
50495
50591
  return Array.isArray(k) ? k[k.length - 1] : k;
50496
50592
  };
50497
- const retNotReady = [notReadyT, {}, false];
50593
+
50594
+ var retNotReady = [notReadyT, {}, false];
50498
50595
  retNotReady.t = notReadyT;
50499
50596
  retNotReady.i18n = {};
50500
50597
  retNotReady.ready = false;
50501
50598
  return retNotReady;
50502
50599
  }
50503
- if (i18n.options.react && i18n.options.react.wait !== undefined) warnOnce('It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.');
50504
- const i18nOptions = {
50505
- ...getDefaults(),
50506
- ...i18n.options.react,
50507
- ...props
50508
- };
50509
- const {
50510
- useSuspense,
50511
- keyPrefix
50512
- } = i18nOptions;
50513
- let namespaces = ns || defaultNSFromContext || i18n.options && i18n.options.defaultNS;
50600
+
50601
+ var i18nOptions = _objectSpread(_objectSpread(_objectSpread({}, getDefaults()), i18n.options.react), props);
50602
+
50603
+ var useSuspense = i18nOptions.useSuspense;
50604
+ var namespaces = ns || defaultNSFromContext || i18n.options && i18n.options.defaultNS;
50514
50605
  namespaces = typeof namespaces === 'string' ? [namespaces] : namespaces || ['translation'];
50515
50606
  if (i18n.reportNamespaces.addUsedNamespaces) i18n.reportNamespaces.addUsedNamespaces(namespaces);
50516
- const ready = (i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every(n => hasLoadedNamespace(n, i18n, i18nOptions));
50517
- const memoGetT = useMemoizedT(i18n, props.lng || null, i18nOptions.nsMode === 'fallback' ? namespaces : namespaces[0], keyPrefix);
50518
- const getT = () => memoGetT;
50519
- const getNewT = () => alwaysNewT(i18n, props.lng || null, i18nOptions.nsMode === 'fallback' ? namespaces : namespaces[0], keyPrefix);
50520
- const [t, setT] = React.useState(getT);
50521
- let joinedNS = namespaces.join();
50522
- if (props.lng) joinedNS = `${props.lng}${joinedNS}`;
50523
- const previousJoinedNS = usePrevious(joinedNS);
50524
- const isMounted = React.useRef(true);
50525
- React.useEffect(() => {
50526
- const {
50527
- bindI18n,
50528
- bindI18nStore
50529
- } = i18nOptions;
50607
+ var ready = (i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every(function (n) {
50608
+ return hasLoadedNamespace(n, i18n, i18nOptions);
50609
+ });
50610
+
50611
+ function getT() {
50612
+ return {
50613
+ t: i18n.getFixedT(null, i18nOptions.nsMode === 'fallback' ? namespaces : namespaces[0])
50614
+ };
50615
+ }
50616
+
50617
+ var _useState = React.useState(getT()),
50618
+ _useState2 = _slicedToArray(_useState, 2),
50619
+ t = _useState2[0],
50620
+ setT = _useState2[1];
50621
+
50622
+ var isMounted = React.useRef(true);
50623
+ React.useEffect(function () {
50624
+ var bindI18n = i18nOptions.bindI18n,
50625
+ bindI18nStore = i18nOptions.bindI18nStore;
50530
50626
  isMounted.current = true;
50627
+
50531
50628
  if (!ready && !useSuspense) {
50532
- if (props.lng) {
50533
- loadLanguages(i18n, props.lng, namespaces, () => {
50534
- if (isMounted.current) setT(getNewT);
50535
- });
50536
- } else {
50537
- loadNamespaces(i18n, namespaces, () => {
50538
- if (isMounted.current) setT(getNewT);
50539
- });
50540
- }
50541
- }
50542
- if (ready && previousJoinedNS && previousJoinedNS !== joinedNS && isMounted.current) {
50543
- setT(getNewT);
50629
+ loadNamespaces(i18n, namespaces, function () {
50630
+ if (isMounted.current) setT(getT());
50631
+ });
50544
50632
  }
50633
+
50545
50634
  function boundReset() {
50546
- if (isMounted.current) setT(getNewT);
50635
+ if (isMounted.current) setT(getT());
50547
50636
  }
50637
+
50548
50638
  if (bindI18n && i18n) i18n.on(bindI18n, boundReset);
50549
50639
  if (bindI18nStore && i18n) i18n.store.on(bindI18nStore, boundReset);
50550
- return () => {
50640
+ return function () {
50551
50641
  isMounted.current = false;
50552
- if (bindI18n && i18n) bindI18n.split(' ').forEach(e => i18n.off(e, boundReset));
50553
- if (bindI18nStore && i18n) bindI18nStore.split(' ').forEach(e => i18n.store.off(e, boundReset));
50642
+ if (bindI18n && i18n) bindI18n.split(' ').forEach(function (e) {
50643
+ return i18n.off(e, boundReset);
50644
+ });
50645
+ if (bindI18nStore && i18n) bindI18nStore.split(' ').forEach(function (e) {
50646
+ return i18n.store.off(e, boundReset);
50647
+ });
50554
50648
  };
50555
- }, [i18n, joinedNS]);
50556
- React.useEffect(() => {
50557
- if (isMounted.current && ready) {
50558
- setT(getT);
50559
- }
50560
- }, [i18n, keyPrefix, ready]);
50561
- const ret = [t, i18n, ready];
50562
- ret.t = t;
50649
+ }, [namespaces.join()]);
50650
+ var ret = [t.t, i18n, ready];
50651
+ ret.t = t.t;
50563
50652
  ret.i18n = i18n;
50564
50653
  ret.ready = ready;
50565
50654
  if (ready) return ret;
50566
50655
  if (!ready && !useSuspense) return ret;
50567
- throw new Promise(resolve => {
50568
- if (props.lng) {
50569
- loadLanguages(i18n, props.lng, namespaces, () => resolve());
50570
- } else {
50571
- loadNamespaces(i18n, namespaces, () => resolve());
50572
- }
50656
+ throw new Promise(function (resolve) {
50657
+ loadNamespaces(i18n, namespaces, function () {
50658
+ resolve();
50659
+ });
50573
50660
  });
50574
50661
  }
50575
50662
 
@@ -66769,23 +66856,6 @@ module.exports["default"] = module.exports, module.exports.__esModule = true;
66769
66856
 
66770
66857
  unwrapExports(_extends_1$1);
66771
66858
 
66772
- var arrayLikeToArray = createCommonjsModule(function (module) {
66773
- function _arrayLikeToArray(arr, len) {
66774
- if (len == null || len > arr.length) len = arr.length;
66775
-
66776
- for (var i = 0, arr2 = new Array(len); i < len; i++) {
66777
- arr2[i] = arr[i];
66778
- }
66779
-
66780
- return arr2;
66781
- }
66782
-
66783
- module.exports = _arrayLikeToArray;
66784
- module.exports["default"] = module.exports, module.exports.__esModule = true;
66785
- });
66786
-
66787
- unwrapExports(arrayLikeToArray);
66788
-
66789
66859
  var arrayWithoutHoles = createCommonjsModule(function (module) {
66790
66860
  function _arrayWithoutHoles(arr) {
66791
66861
  if (Array.isArray(arr)) return arrayLikeToArray(arr);
@@ -66808,22 +66878,6 @@ module.exports["default"] = module.exports, module.exports.__esModule = true;
66808
66878
 
66809
66879
  unwrapExports(iterableToArray);
66810
66880
 
66811
- var unsupportedIterableToArray = createCommonjsModule(function (module) {
66812
- function _unsupportedIterableToArray(o, minLen) {
66813
- if (!o) return;
66814
- if (typeof o === "string") return arrayLikeToArray(o, minLen);
66815
- var n = Object.prototype.toString.call(o).slice(8, -1);
66816
- if (n === "Object" && o.constructor) n = o.constructor.name;
66817
- if (n === "Map" || n === "Set") return Array.from(o);
66818
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
66819
- }
66820
-
66821
- module.exports = _unsupportedIterableToArray;
66822
- module.exports["default"] = module.exports, module.exports.__esModule = true;
66823
- });
66824
-
66825
- unwrapExports(unsupportedIterableToArray);
66826
-
66827
66881
  var nonIterableSpread = createCommonjsModule(function (module) {
66828
66882
  function _nonIterableSpread() {
66829
66883
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");