@trackunit/react-core-contexts-test 1.21.2-alpha-34e3e456eda.0 → 1.21.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index2.esm.js CHANGED
@@ -338,6 +338,16 @@ const mockUserSubscriptionContext = {
338
338
  packageType: "EXPAND_FLEET_OWNER",
339
339
  };
340
340
 
341
+ function _objectWithoutPropertiesLoose(r, e) {
342
+ if (null == r) return {};
343
+ var t = {};
344
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
345
+ if (-1 !== e.indexOf(n)) continue;
346
+ t[n] = r[n];
347
+ }
348
+ return t;
349
+ }
350
+
341
351
  function getDefaultExportFromCjs (x) {
342
352
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
343
353
  }
@@ -10390,16 +10400,12 @@ const COMMENT_NODE$1 = 8;
10390
10400
  const FRAGMENT_NODE = 11;
10391
10401
  const ELEMENT_REGEXP = /^((HTML|SVG)\w*)?Element$/;
10392
10402
  const isCustomElement = val => {
10393
- const {
10394
- tagName
10395
- } = val;
10403
+ const tagName = val.tagName;
10396
10404
  return Boolean(typeof tagName === 'string' && tagName.includes('-') || typeof val.hasAttribute === 'function' && val.hasAttribute('is'));
10397
10405
  };
10398
10406
  const testNode = val => {
10399
10407
  const constructorName = val.constructor.name;
10400
- const {
10401
- nodeType
10402
- } = val;
10408
+ const nodeType = val.nodeType;
10403
10409
  return nodeType === ELEMENT_NODE$1 && (ELEMENT_REGEXP.test(constructorName) || isCustomElement(val)) || nodeType === TEXT_NODE$1 && constructorName === 'Text' || nodeType === COMMENT_NODE$1 && constructorName === 'Comment' || nodeType === FRAGMENT_NODE && constructorName === 'DocumentFragment';
10404
10410
  };
10405
10411
  function nodeIsText(node) {
@@ -10437,14 +10443,14 @@ function createDOMElementFilter(filterNode) {
10437
10443
  }
10438
10444
 
10439
10445
  // We try to load node dependencies
10440
- let chalk = null;
10446
+ let picocolors = null;
10441
10447
  let readFileSync = null;
10442
10448
  let codeFrameColumns = null;
10443
10449
  try {
10444
10450
  const nodeRequire = module && module.require;
10445
10451
  readFileSync = nodeRequire.call(module, 'fs').readFileSync;
10446
10452
  codeFrameColumns = nodeRequire.call(module, '@babel/code-frame').codeFrameColumns;
10447
- chalk = nodeRequire.call(module, 'chalk');
10453
+ picocolors = nodeRequire.call(module, 'picocolors');
10448
10454
  } catch {
10449
10455
  // We're in a browser environment
10450
10456
  }
@@ -10455,7 +10461,10 @@ function getCodeFrame(frame) {
10455
10461
  const locationEnd = frame.indexOf(')');
10456
10462
  const frameLocation = frame.slice(locationStart, locationEnd);
10457
10463
  const frameLocationElements = frameLocation.split(':');
10458
- const [filename, line, column] = [frameLocationElements[0], parseInt(frameLocationElements[1], 10), parseInt(frameLocationElements[2], 10)];
10464
+ const _ref = [frameLocationElements[0], parseInt(frameLocationElements[1], 10), parseInt(frameLocationElements[2], 10)],
10465
+ filename = _ref[0],
10466
+ line = _ref[1],
10467
+ column = _ref[2];
10459
10468
  let rawFileContents = '';
10460
10469
  try {
10461
10470
  rawFileContents = readFileSync(filename, 'utf-8');
@@ -10471,7 +10480,7 @@ function getCodeFrame(frame) {
10471
10480
  highlightCode: true,
10472
10481
  linesBelow: 0
10473
10482
  });
10474
- return chalk.dim(frameLocation) + "\n" + codeFrame + "\n";
10483
+ return picocolors.dim(frameLocation) + "\n" + codeFrame + "\n";
10475
10484
  }
10476
10485
  function getUserCodeFrame() {
10477
10486
  // If we couldn't load dependencies, we can't generate the user trace
@@ -10546,6 +10555,7 @@ function checkContainerType(container) {
10546
10555
  }
10547
10556
  }
10548
10557
 
10558
+ const _excluded$1 = ["filterNode"];
10549
10559
  const shouldHighlight = () => {
10550
10560
  if (typeof process === 'undefined') {
10551
10561
  // Don't colorize in non-node environments (e.g. Browsers)
@@ -10571,9 +10581,7 @@ const shouldHighlight = () => {
10571
10581
  return process.versions !== undefined && process.versions.node !== undefined;
10572
10582
  }
10573
10583
  };
10574
- const {
10575
- DOMCollection
10576
- } = plugins_1;
10584
+ const DOMCollection = plugins_1.DOMCollection;
10577
10585
 
10578
10586
  // https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType#node_type_constants
10579
10587
  const ELEMENT_NODE = 1;
@@ -10609,10 +10617,10 @@ function prettyDOM(dom, maxLength, options) {
10609
10617
  if (!('outerHTML' in dom)) {
10610
10618
  throw new TypeError("Expected an element or document but got " + domTypeName);
10611
10619
  }
10612
- const {
10613
- filterNode = filterCommentsAndDefaultIgnoreTagsTags,
10614
- ...prettyFormatOptions
10615
- } = options;
10620
+ const _options = options,
10621
+ _options$filterNode = _options.filterNode,
10622
+ filterNode = _options$filterNode === void 0 ? filterCommentsAndDefaultIgnoreTagsTags : _options$filterNode,
10623
+ prettyFormatOptions = _objectWithoutPropertiesLoose(_options, _excluded$1);
10616
10624
  const debugContent = format_1(dom, {
10617
10625
  plugins: [createDOMElementFilter(filterNode), DOMCollection],
10618
10626
  printFunctionName: false,
@@ -10722,9 +10730,9 @@ function isLabelable(element) {
10722
10730
  return /BUTTON|METER|OUTPUT|PROGRESS|SELECT|TEXTAREA/.test(element.tagName) || element.tagName === 'INPUT' && element.getAttribute('type') !== 'hidden';
10723
10731
  }
10724
10732
  function getLabels(container, element, _temp) {
10725
- let {
10726
- selector = '*'
10727
- } = _temp === void 0 ? {} : _temp;
10733
+ let _ref = _temp === void 0 ? {} : _temp,
10734
+ _ref$selector = _ref.selector,
10735
+ selector = _ref$selector === void 0 ? '*' : _ref$selector;
10728
10736
  const ariaLabelledBy = element.getAttribute('aria-labelledby');
10729
10737
  const labelsId = ariaLabelledBy ? ariaLabelledBy.split(' ') : [];
10730
10738
  return labelsId.length ? labelsId.map(labelId => {
@@ -10749,7 +10757,7 @@ function getLabels(container, element, _temp) {
10749
10757
 
10750
10758
  function assertNotNullOrUndefined(matcher) {
10751
10759
  if (matcher === null || matcher === undefined) {
10752
- throw new Error( // eslint-disable-next-line @typescript-eslint/restrict-template-expressions -- implicitly converting `T` to `string`
10760
+ throw new Error(// eslint-disable-next-line @typescript-eslint/restrict-template-expressions -- implicitly converting `T` to `string`
10753
10761
  "It looks like " + matcher + " was passed instead of a matcher. Did you do something like getByText(" + matcher + ")?");
10754
10762
  }
10755
10763
  }
@@ -10782,10 +10790,11 @@ function matches(textToMatch, node, matcher, normalizer) {
10782
10790
  }
10783
10791
  }
10784
10792
  function getDefaultNormalizer(_temp) {
10785
- let {
10786
- trim = true,
10787
- collapseWhitespace = true
10788
- } = _temp === void 0 ? {} : _temp;
10793
+ let _ref = _temp === void 0 ? {} : _temp,
10794
+ _ref$trim = _ref.trim,
10795
+ trim = _ref$trim === void 0 ? true : _ref$trim,
10796
+ _ref$collapseWhitespa = _ref.collapseWhitespace,
10797
+ collapseWhitespace = _ref$collapseWhitespa === void 0 ? true : _ref$collapseWhitespa;
10789
10798
  return text => {
10790
10799
  let normalizedText = text;
10791
10800
  normalizedText = trim ? normalizedText.trim() : normalizedText;
@@ -10804,12 +10813,10 @@ function getDefaultNormalizer(_temp) {
10804
10813
  * @returns {Function} A normalizer
10805
10814
  */
10806
10815
 
10807
- function makeNormalizer(_ref) {
10808
- let {
10809
- trim,
10810
- collapseWhitespace,
10811
- normalizer
10812
- } = _ref;
10816
+ function makeNormalizer(_ref2) {
10817
+ let trim = _ref2.trim,
10818
+ collapseWhitespace = _ref2.collapseWhitespace,
10819
+ normalizer = _ref2.normalizer;
10813
10820
  if (!normalizer) {
10814
10821
  // No custom normalizer specified. Just use default.
10815
10822
  return getDefaultNormalizer({
@@ -10877,9 +10884,9 @@ function isInaccessible(element, options) {
10877
10884
  if (options === void 0) {
10878
10885
  options = {};
10879
10886
  }
10880
- const {
10881
- isSubtreeInaccessible: isSubtreeInaccessibleImpl = isSubtreeInaccessible
10882
- } = options;
10887
+ const _options = options,
10888
+ _options$isSubtreeIna = _options.isSubtreeInaccessible,
10889
+ isSubtreeInaccessibleImpl = _options$isSubtreeIna === void 0 ? isSubtreeInaccessible : _options$isSubtreeIna;
10883
10890
  const window = element.ownerDocument.defaultView;
10884
10891
  // since visibility is inherited we can exit early
10885
10892
  if (window.getComputedStyle(element).visibility === 'hidden') {
@@ -10897,10 +10904,9 @@ function isInaccessible(element, options) {
10897
10904
  function getImplicitAriaRoles(currentNode) {
10898
10905
  // eslint bug here:
10899
10906
  // eslint-disable-next-line no-unused-vars
10900
- for (const {
10901
- match,
10902
- roles
10903
- } of elementRoleList) {
10907
+ for (const _ref of elementRoleList) {
10908
+ const match = _ref.match;
10909
+ const roles = _ref.roles;
10904
10910
  if (match(currentNode)) {
10905
10911
  return [...roles];
10906
10912
  }
@@ -10908,17 +10914,14 @@ function getImplicitAriaRoles(currentNode) {
10908
10914
  return [];
10909
10915
  }
10910
10916
  function buildElementRoleList(elementRolesMap) {
10911
- function makeElementSelector(_ref) {
10912
- let {
10913
- name,
10914
- attributes
10915
- } = _ref;
10916
- return "" + name + attributes.map(_ref2 => {
10917
- let {
10918
- name: attributeName,
10919
- value,
10920
- constraints = []
10921
- } = _ref2;
10917
+ function makeElementSelector(_ref2) {
10918
+ let name = _ref2.name,
10919
+ attributes = _ref2.attributes;
10920
+ return "" + name + attributes.map(_ref3 => {
10921
+ let attributeName = _ref3.name,
10922
+ value = _ref3.value,
10923
+ _ref3$constraints = _ref3.constraints,
10924
+ constraints = _ref3$constraints === void 0 ? [] : _ref3$constraints;
10922
10925
  const shouldNotExist = constraints.indexOf('undefined') !== -1;
10923
10926
  const shouldBeNonEmpty = constraints.indexOf('set') !== -1;
10924
10927
  const hasExplicitValue = typeof value !== 'undefined';
@@ -10932,25 +10935,19 @@ function buildElementRoleList(elementRolesMap) {
10932
10935
  return "[" + attributeName + "]";
10933
10936
  }).join('');
10934
10937
  }
10935
- function getSelectorSpecificity(_ref3) {
10936
- let {
10937
- attributes = []
10938
- } = _ref3;
10938
+ function getSelectorSpecificity(_ref4) {
10939
+ let _ref4$attributes = _ref4.attributes,
10940
+ attributes = _ref4$attributes === void 0 ? [] : _ref4$attributes;
10939
10941
  return attributes.length;
10940
10942
  }
10941
- function bySelectorSpecificity(_ref4, _ref5) {
10942
- let {
10943
- specificity: leftSpecificity
10944
- } = _ref4;
10945
- let {
10946
- specificity: rightSpecificity
10947
- } = _ref5;
10943
+ function bySelectorSpecificity(_ref5, _ref6) {
10944
+ let leftSpecificity = _ref5.specificity;
10945
+ let rightSpecificity = _ref6.specificity;
10948
10946
  return rightSpecificity - leftSpecificity;
10949
10947
  }
10950
10948
  function match(element) {
10951
- let {
10952
- attributes = []
10953
- } = element;
10949
+ let _element$attributes = element.attributes,
10950
+ attributes = _element$attributes === void 0 ? [] : _element$attributes;
10954
10951
 
10955
10952
  // https://github.com/testing-library/dom-testing-library/issues/814
10956
10953
  const typeTextIndex = attributes.findIndex(attribute => attribute.value && attribute.name === 'type' && attribute.value === 'text');
@@ -10973,7 +10970,9 @@ function buildElementRoleList(elementRolesMap) {
10973
10970
 
10974
10971
  // eslint bug here:
10975
10972
  // eslint-disable-next-line no-unused-vars
10976
- for (const [element, roles] of elementRolesMap.entries()) {
10973
+ for (const _ref7 of elementRolesMap.entries()) {
10974
+ const element = _ref7[0];
10975
+ const roles = _ref7[1];
10977
10976
  result = [...result, {
10978
10977
  match: match(element),
10979
10978
  roles: Array.from(roles),
@@ -10983,9 +10982,9 @@ function buildElementRoleList(elementRolesMap) {
10983
10982
  return result.sort(bySelectorSpecificity);
10984
10983
  }
10985
10984
  function getRoles(container, _temp) {
10986
- let {
10987
- hidden = false
10988
- } = _temp === void 0 ? {} : _temp;
10985
+ let _ref8 = _temp === void 0 ? {} : _temp,
10986
+ _ref8$hidden = _ref8.hidden,
10987
+ hidden = _ref8$hidden === void 0 ? false : _ref8$hidden;
10989
10988
  function flattenDOM(node) {
10990
10989
  return [node, ...Array.from(node.children).reduce((acc, child) => [...acc, ...flattenDOM(child)], [])];
10991
10990
  }
@@ -11008,20 +11007,19 @@ function getRoles(container, _temp) {
11008
11007
  }, acc);
11009
11008
  }, {});
11010
11009
  }
11011
- function prettyRoles(dom, _ref6) {
11012
- let {
11013
- hidden,
11014
- includeDescription
11015
- } = _ref6;
11010
+ function prettyRoles(dom, _ref9) {
11011
+ let hidden = _ref9.hidden,
11012
+ includeDescription = _ref9.includeDescription;
11016
11013
  const roles = getRoles(dom, {
11017
11014
  hidden
11018
11015
  });
11019
11016
  // We prefer to skip generic role, we don't recommend it
11020
- return Object.entries(roles).filter(_ref7 => {
11021
- let [role] = _ref7;
11017
+ return Object.entries(roles).filter(_ref0 => {
11018
+ let role = _ref0[0];
11022
11019
  return role !== 'generic';
11023
- }).map(_ref8 => {
11024
- let [role, elements] = _ref8;
11020
+ }).map(_ref1 => {
11021
+ let role = _ref1[0],
11022
+ elements = _ref1[1];
11025
11023
  const delimiterBar = '-'.repeat(50);
11026
11024
  const elementsString = elements.map(el => {
11027
11025
  const nameString = "Name \"" + computeAccessibleName(el, {
@@ -11097,9 +11095,9 @@ function computeAriaPressed(element) {
11097
11095
  * @returns {boolean | string | null} -
11098
11096
  */
11099
11097
  function computeAriaCurrent(element) {
11100
- var _ref9, _checkBooleanAttribut;
11098
+ var _ref11, _checkBooleanAttribut;
11101
11099
  // https://www.w3.org/TR/wai-aria-1.1/#aria-current
11102
- return (_ref9 = (_checkBooleanAttribut = checkBooleanAttribute(element, 'aria-current')) != null ? _checkBooleanAttribut : element.getAttribute('aria-current')) != null ? _ref9 : false;
11100
+ return (_ref11 = (_checkBooleanAttribut = checkBooleanAttribute(element, 'aria-current')) != null ? _checkBooleanAttribut : element.getAttribute('aria-current')) != null ? _ref11 : false;
11103
11101
  }
11104
11102
 
11105
11103
  /**
@@ -11186,10 +11184,8 @@ function getRegExpMatcher(string) {
11186
11184
  return new RegExp(escapeRegExp(string.toLowerCase()), 'i');
11187
11185
  }
11188
11186
  function makeSuggestion(queryName, element, content, _ref) {
11189
- let {
11190
- variant,
11191
- name
11192
- } = _ref;
11187
+ let variant = _ref.variant,
11188
+ name = _ref.name;
11193
11189
  let warning = '';
11194
11190
  const queryOptions = {};
11195
11191
  const queryArgs = [['Role', 'TestId'].includes(queryName) ? content : getRegExpMatcher(content)];
@@ -11214,10 +11210,12 @@ function makeSuggestion(queryName, element, content, _ref) {
11214
11210
  if (warning) {
11215
11211
  console.warn(warning);
11216
11212
  }
11217
- let [text, options] = queryArgs;
11213
+ let text = queryArgs[0],
11214
+ options = queryArgs[1];
11218
11215
  text = typeof text === 'string' ? "'" + text + "'" : text;
11219
11216
  options = options ? ", { " + Object.entries(options).map(_ref2 => {
11220
- let [k, v] = _ref2;
11217
+ let k = _ref2[0],
11218
+ v = _ref2[1];
11221
11219
  return k + ": " + v;
11222
11220
  }).join(', ') + " }" : '';
11223
11221
  return queryMethod + "(" + text + options + ")";
@@ -11297,25 +11295,29 @@ function copyStackTrace(target, source) {
11297
11295
  target.stack = source.stack.replace(source.message, target.message);
11298
11296
  }
11299
11297
  function waitFor(callback, _ref) {
11300
- let {
11301
- container = getDocument(),
11302
- timeout = getConfig$1().asyncUtilTimeout,
11303
- showOriginalStackTrace = getConfig$1().showOriginalStackTrace,
11304
- stackTraceError,
11305
- interval = 50,
11306
- onTimeout = error => {
11298
+ let _ref$container = _ref.container,
11299
+ container = _ref$container === void 0 ? getDocument() : _ref$container,
11300
+ _ref$timeout = _ref.timeout,
11301
+ timeout = _ref$timeout === void 0 ? getConfig$1().asyncUtilTimeout : _ref$timeout,
11302
+ _ref$showOriginalStac = _ref.showOriginalStackTrace,
11303
+ showOriginalStackTrace = _ref$showOriginalStac === void 0 ? getConfig$1().showOriginalStackTrace : _ref$showOriginalStac,
11304
+ stackTraceError = _ref.stackTraceError,
11305
+ _ref$interval = _ref.interval,
11306
+ interval = _ref$interval === void 0 ? 50 : _ref$interval,
11307
+ _ref$onTimeout = _ref.onTimeout,
11308
+ onTimeout = _ref$onTimeout === void 0 ? error => {
11307
11309
  Object.defineProperty(error, 'message', {
11308
11310
  value: getConfig$1().getElementError(error.message, container).message
11309
11311
  });
11310
11312
  return error;
11311
- },
11312
- mutationObserverOptions = {
11313
+ } : _ref$onTimeout,
11314
+ _ref$mutationObserver = _ref.mutationObserverOptions,
11315
+ mutationObserverOptions = _ref$mutationObserver === void 0 ? {
11313
11316
  subtree: true,
11314
11317
  childList: true,
11315
11318
  attributes: true,
11316
11319
  characterData: true
11317
- }
11318
- } = _ref;
11320
+ } : _ref$mutationObserver;
11319
11321
  if (typeof callback !== 'function') {
11320
11322
  throw new TypeError('Received `callback` arg must be a function');
11321
11323
  }
@@ -11326,9 +11328,8 @@ function waitFor(callback, _ref) {
11326
11328
  const overallTimeoutTimer = setTimeout(handleTimeout, timeout);
11327
11329
  const usingJestFakeTimers = jestFakeTimersAreEnabled$1();
11328
11330
  if (usingJestFakeTimers) {
11329
- const {
11330
- unstable_advanceTimersWrapper: advanceTimersWrapper
11331
- } = getConfig$1();
11331
+ const _getConfig = getConfig$1(),
11332
+ advanceTimersWrapper = _getConfig.unstable_advanceTimersWrapper;
11332
11333
  checkCallback();
11333
11334
  // this is a dangerous rule to disable because it could lead to an
11334
11335
  // infinite loop. However, eslint isn't smart enough to know that we're
@@ -11375,9 +11376,8 @@ function waitFor(callback, _ref) {
11375
11376
  return;
11376
11377
  }
11377
11378
  intervalId = setInterval(checkRealTimersCallback, interval);
11378
- const {
11379
- MutationObserver
11380
- } = getWindowFromNode(container);
11379
+ const _getWindowFromNode = getWindowFromNode(container),
11380
+ MutationObserver = _getWindowFromNode.MutationObserver;
11381
11381
  observer = new MutationObserver(checkRealTimersCallback);
11382
11382
  observer.observe(container, mutationObserverOptions);
11383
11383
  checkCallback();
@@ -11465,12 +11465,12 @@ function getMultipleElementsFoundError(message, container) {
11465
11465
  return getElementError(message + "\n\n(If this is intentional, then use the `*AllBy*` variant of the query (like `queryAllByText`, `getAllByText`, or `findAllByText`)).", container);
11466
11466
  }
11467
11467
  function queryAllByAttribute(attribute, container, text, _temp) {
11468
- let {
11469
- exact = true,
11470
- collapseWhitespace,
11471
- trim,
11472
- normalizer
11473
- } = _temp === void 0 ? {} : _temp;
11468
+ let _ref = _temp === void 0 ? {} : _temp,
11469
+ _ref$exact = _ref.exact,
11470
+ exact = _ref$exact === void 0 ? true : _ref$exact,
11471
+ collapseWhitespace = _ref.collapseWhitespace,
11472
+ trim = _ref.trim,
11473
+ normalizer = _ref.normalizer;
11474
11474
  const matcher = exact ? matches : fuzzyMatches;
11475
11475
  const matchNormalizer = makeNormalizer({
11476
11476
  collapseWhitespace,
@@ -11532,9 +11532,11 @@ const wrapSingleQueryWithSuggestion = (query, queryAllByName, variant) => functi
11532
11532
  args[_key3 - 1] = arguments[_key3];
11533
11533
  }
11534
11534
  const element = query(container, ...args);
11535
- const [{
11536
- suggest = getConfig$1().throwSuggestions
11537
- } = {}] = args.slice(-1);
11535
+ const _ref2 = args.slice(-1),
11536
+ _ref2$ = _ref2[0],
11537
+ _ref2$2 = _ref2$ === void 0 ? {} : _ref2$,
11538
+ _ref2$2$suggest = _ref2$2.suggest,
11539
+ suggest = _ref2$2$suggest === void 0 ? getConfig$1().throwSuggestions : _ref2$2$suggest;
11538
11540
  if (element && suggest) {
11539
11541
  const suggestion = getSuggestedQuery(element, variant);
11540
11542
  if (suggestion && !queryAllByName.endsWith(suggestion.queryName)) {
@@ -11548,9 +11550,11 @@ const wrapAllByQueryWithSuggestion = (query, queryAllByName, variant) => functio
11548
11550
  args[_key4 - 1] = arguments[_key4];
11549
11551
  }
11550
11552
  const els = query(container, ...args);
11551
- const [{
11552
- suggest = getConfig$1().throwSuggestions
11553
- } = {}] = args.slice(-1);
11553
+ const _ref3 = args.slice(-1),
11554
+ _ref3$ = _ref3[0],
11555
+ _ref3$2 = _ref3$ === void 0 ? {} : _ref3$,
11556
+ _ref3$2$suggest = _ref3$2.suggest,
11557
+ suggest = _ref3$2$suggest === void 0 ? getConfig$1().throwSuggestions : _ref3$2$suggest;
11554
11558
  if (els.length && suggest) {
11555
11559
  // get a unique list of all suggestion messages. We are only going to make a suggestion if
11556
11560
  // all the suggestions are the same
@@ -11590,19 +11594,17 @@ function queryAllLabels(container) {
11590
11594
  textToMatch: getLabelContent(node)
11591
11595
  };
11592
11596
  }).filter(_ref => {
11593
- let {
11594
- textToMatch
11595
- } = _ref;
11597
+ let textToMatch = _ref.textToMatch;
11596
11598
  return textToMatch !== null;
11597
11599
  });
11598
11600
  }
11599
11601
  const queryAllLabelsByText = function (container, text, _temp) {
11600
- let {
11601
- exact = true,
11602
- trim,
11603
- collapseWhitespace,
11604
- normalizer
11605
- } = _temp === void 0 ? {} : _temp;
11602
+ let _ref2 = _temp === void 0 ? {} : _temp,
11603
+ _ref2$exact = _ref2.exact,
11604
+ exact = _ref2$exact === void 0 ? true : _ref2$exact,
11605
+ trim = _ref2.trim,
11606
+ collapseWhitespace = _ref2.collapseWhitespace,
11607
+ normalizer = _ref2.normalizer;
11606
11608
  const matcher = exact ? matches : fuzzyMatches;
11607
11609
  const matchNormalizer = makeNormalizer({
11608
11610
  collapseWhitespace,
@@ -11610,27 +11612,24 @@ const queryAllLabelsByText = function (container, text, _temp) {
11610
11612
  normalizer
11611
11613
  });
11612
11614
  const textToMatchByLabels = queryAllLabels(container);
11613
- return textToMatchByLabels.filter(_ref2 => {
11614
- let {
11615
- node,
11616
- textToMatch
11617
- } = _ref2;
11615
+ return textToMatchByLabels.filter(_ref3 => {
11616
+ let node = _ref3.node,
11617
+ textToMatch = _ref3.textToMatch;
11618
11618
  return matcher(textToMatch, node, text, matchNormalizer);
11619
- }).map(_ref3 => {
11620
- let {
11621
- node
11622
- } = _ref3;
11619
+ }).map(_ref4 => {
11620
+ let node = _ref4.node;
11623
11621
  return node;
11624
11622
  });
11625
11623
  };
11626
11624
  const queryAllByLabelText = function (container, text, _temp2) {
11627
- let {
11628
- selector = '*',
11629
- exact = true,
11630
- collapseWhitespace,
11631
- trim,
11632
- normalizer
11633
- } = _temp2 === void 0 ? {} : _temp2;
11625
+ let _ref5 = _temp2 === void 0 ? {} : _temp2,
11626
+ _ref5$selector = _ref5.selector,
11627
+ selector = _ref5$selector === void 0 ? '*' : _ref5$selector,
11628
+ _ref5$exact = _ref5.exact,
11629
+ exact = _ref5$exact === void 0 ? true : _ref5$exact,
11630
+ collapseWhitespace = _ref5.collapseWhitespace,
11631
+ trim = _ref5.trim,
11632
+ normalizer = _ref5.normalizer;
11634
11633
  checkContainerType(container);
11635
11634
  const matcher = exact ? matches : fuzzyMatches;
11636
11635
  const matchNormalizer = makeNormalizer({
@@ -11731,17 +11730,24 @@ const queryAllByPlaceholderText = function () {
11731
11730
  const getMultipleError$6 = (c, text) => "Found multiple elements with the placeholder text of: " + text;
11732
11731
  const getMissingError$6 = (c, text) => "Unable to find an element with the placeholder text of: " + text;
11733
11732
  const queryAllByPlaceholderTextWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByPlaceholderText, queryAllByPlaceholderText.name, 'queryAll');
11734
- const [queryByPlaceholderText, getAllByPlaceholderText, getByPlaceholderText, findAllByPlaceholderText, findByPlaceholderText] = buildQueries(queryAllByPlaceholderText, getMultipleError$6, getMissingError$6);
11733
+ const _buildQueries$6 = buildQueries(queryAllByPlaceholderText, getMultipleError$6, getMissingError$6),
11734
+ queryByPlaceholderText = _buildQueries$6[0],
11735
+ getAllByPlaceholderText = _buildQueries$6[1],
11736
+ getByPlaceholderText = _buildQueries$6[2],
11737
+ findAllByPlaceholderText = _buildQueries$6[3],
11738
+ findByPlaceholderText = _buildQueries$6[4];
11735
11739
 
11736
11740
  const queryAllByText = function (container, text, _temp) {
11737
- let {
11738
- selector = '*',
11739
- exact = true,
11740
- collapseWhitespace,
11741
- trim,
11742
- ignore = getConfig$1().defaultIgnore,
11743
- normalizer
11744
- } = _temp === void 0 ? {} : _temp;
11741
+ let _ref = _temp === void 0 ? {} : _temp,
11742
+ _ref$selector = _ref.selector,
11743
+ selector = _ref$selector === void 0 ? '*' : _ref$selector,
11744
+ _ref$exact = _ref.exact,
11745
+ exact = _ref$exact === void 0 ? true : _ref$exact,
11746
+ collapseWhitespace = _ref.collapseWhitespace,
11747
+ trim = _ref.trim,
11748
+ _ref$ignore = _ref.ignore,
11749
+ ignore = _ref$ignore === void 0 ? getConfig$1().defaultIgnore : _ref$ignore,
11750
+ normalizer = _ref.normalizer;
11745
11751
  checkContainerType(container);
11746
11752
  const matcher = exact ? matches : fuzzyMatches;
11747
11753
  const matchNormalizer = makeNormalizer({
@@ -11762,12 +11768,11 @@ const getMissingError$5 = function (c, text, options) {
11762
11768
  if (options === void 0) {
11763
11769
  options = {};
11764
11770
  }
11765
- const {
11766
- collapseWhitespace,
11767
- trim,
11768
- normalizer,
11769
- selector
11770
- } = options;
11771
+ const _options = options,
11772
+ collapseWhitespace = _options.collapseWhitespace,
11773
+ trim = _options.trim,
11774
+ normalizer = _options.normalizer,
11775
+ selector = _options.selector;
11771
11776
  const matchNormalizer = makeNormalizer({
11772
11777
  collapseWhitespace,
11773
11778
  trim,
@@ -11779,15 +11784,20 @@ const getMissingError$5 = function (c, text, options) {
11779
11784
  return "Unable to find an element with the text: " + (isNormalizedDifferent ? normalizedText + " (normalized from '" + text + "')" : text) + (isCustomSelector ? ", which matches selector '" + selector + "'" : '') + ". This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.";
11780
11785
  };
11781
11786
  const queryAllByTextWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByText, queryAllByText.name, 'queryAll');
11782
- const [queryByText, getAllByText, getByText, findAllByText, findByText] = buildQueries(queryAllByText, getMultipleError$5, getMissingError$5);
11787
+ const _buildQueries$5 = buildQueries(queryAllByText, getMultipleError$5, getMissingError$5),
11788
+ queryByText = _buildQueries$5[0],
11789
+ getAllByText = _buildQueries$5[1],
11790
+ getByText = _buildQueries$5[2],
11791
+ findAllByText = _buildQueries$5[3],
11792
+ findByText = _buildQueries$5[4];
11783
11793
 
11784
11794
  const queryAllByDisplayValue = function (container, value, _temp) {
11785
- let {
11786
- exact = true,
11787
- collapseWhitespace,
11788
- trim,
11789
- normalizer
11790
- } = _temp === void 0 ? {} : _temp;
11795
+ let _ref = _temp === void 0 ? {} : _temp,
11796
+ _ref$exact = _ref.exact,
11797
+ exact = _ref$exact === void 0 ? true : _ref$exact,
11798
+ collapseWhitespace = _ref.collapseWhitespace,
11799
+ trim = _ref.trim,
11800
+ normalizer = _ref.normalizer;
11791
11801
  checkContainerType(container);
11792
11802
  const matcher = exact ? matches : fuzzyMatches;
11793
11803
  const matchNormalizer = makeNormalizer({
@@ -11807,7 +11817,12 @@ const queryAllByDisplayValue = function (container, value, _temp) {
11807
11817
  const getMultipleError$4 = (c, value) => "Found multiple elements with the display value: " + value + ".";
11808
11818
  const getMissingError$4 = (c, value) => "Unable to find an element with the display value: " + value + ".";
11809
11819
  const queryAllByDisplayValueWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByDisplayValue, queryAllByDisplayValue.name, 'queryAll');
11810
- const [queryByDisplayValue, getAllByDisplayValue, getByDisplayValue, findAllByDisplayValue, findByDisplayValue] = buildQueries(queryAllByDisplayValue, getMultipleError$4, getMissingError$4);
11820
+ const _buildQueries$4 = buildQueries(queryAllByDisplayValue, getMultipleError$4, getMissingError$4),
11821
+ queryByDisplayValue = _buildQueries$4[0],
11822
+ getAllByDisplayValue = _buildQueries$4[1],
11823
+ getByDisplayValue = _buildQueries$4[2],
11824
+ findAllByDisplayValue = _buildQueries$4[3],
11825
+ findByDisplayValue = _buildQueries$4[4];
11811
11826
 
11812
11827
  // Valid tags are img, input, area and custom elements
11813
11828
  const VALID_TAG_REGEXP = /^(img|input|area|.+-.+)$/i;
@@ -11821,19 +11836,24 @@ const queryAllByAltText = function (container, alt, options) {
11821
11836
  const getMultipleError$3 = (c, alt) => "Found multiple elements with the alt text: " + alt;
11822
11837
  const getMissingError$3 = (c, alt) => "Unable to find an element with the alt text: " + alt;
11823
11838
  const queryAllByAltTextWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByAltText, queryAllByAltText.name, 'queryAll');
11824
- const [queryByAltText, getAllByAltText, getByAltText, findAllByAltText, findByAltText] = buildQueries(queryAllByAltText, getMultipleError$3, getMissingError$3);
11839
+ const _buildQueries$3 = buildQueries(queryAllByAltText, getMultipleError$3, getMissingError$3),
11840
+ queryByAltText = _buildQueries$3[0],
11841
+ getAllByAltText = _buildQueries$3[1],
11842
+ getByAltText = _buildQueries$3[2],
11843
+ findAllByAltText = _buildQueries$3[3],
11844
+ findByAltText = _buildQueries$3[4];
11825
11845
 
11826
11846
  const isSvgTitle = node => {
11827
11847
  var _node$parentElement;
11828
11848
  return node.tagName.toLowerCase() === 'title' && ((_node$parentElement = node.parentElement) == null ? void 0 : _node$parentElement.tagName.toLowerCase()) === 'svg';
11829
11849
  };
11830
11850
  const queryAllByTitle = function (container, text, _temp) {
11831
- let {
11832
- exact = true,
11833
- collapseWhitespace,
11834
- trim,
11835
- normalizer
11836
- } = _temp === void 0 ? {} : _temp;
11851
+ let _ref = _temp === void 0 ? {} : _temp,
11852
+ _ref$exact = _ref.exact,
11853
+ exact = _ref$exact === void 0 ? true : _ref$exact,
11854
+ collapseWhitespace = _ref.collapseWhitespace,
11855
+ trim = _ref.trim,
11856
+ normalizer = _ref.normalizer;
11837
11857
  checkContainerType(container);
11838
11858
  const matcher = exact ? matches : fuzzyMatches;
11839
11859
  const matchNormalizer = makeNormalizer({
@@ -11846,29 +11866,35 @@ const queryAllByTitle = function (container, text, _temp) {
11846
11866
  const getMultipleError$2 = (c, title) => "Found multiple elements with the title: " + title + ".";
11847
11867
  const getMissingError$2 = (c, title) => "Unable to find an element with the title: " + title + ".";
11848
11868
  const queryAllByTitleWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByTitle, queryAllByTitle.name, 'queryAll');
11849
- const [queryByTitle, getAllByTitle, getByTitle, findAllByTitle, findByTitle] = buildQueries(queryAllByTitle, getMultipleError$2, getMissingError$2);
11869
+ const _buildQueries$2 = buildQueries(queryAllByTitle, getMultipleError$2, getMissingError$2),
11870
+ queryByTitle = _buildQueries$2[0],
11871
+ getAllByTitle = _buildQueries$2[1],
11872
+ getByTitle = _buildQueries$2[2],
11873
+ findAllByTitle = _buildQueries$2[3],
11874
+ findByTitle = _buildQueries$2[4];
11850
11875
 
11851
11876
  /* eslint-disable complexity */
11852
11877
  const queryAllByRole = function (container, role, _temp) {
11853
- let {
11854
- hidden = getConfig$1().defaultHidden,
11855
- name,
11856
- description,
11857
- queryFallbacks = false,
11858
- selected,
11859
- busy,
11860
- checked,
11861
- pressed,
11862
- current,
11863
- level,
11864
- expanded,
11865
- value: {
11866
- now: valueNow,
11867
- min: valueMin,
11868
- max: valueMax,
11869
- text: valueText
11870
- } = {}
11871
- } = _temp === void 0 ? {} : _temp;
11878
+ let _ref = _temp === void 0 ? {} : _temp,
11879
+ _ref$hidden = _ref.hidden,
11880
+ hidden = _ref$hidden === void 0 ? getConfig$1().defaultHidden : _ref$hidden,
11881
+ name = _ref.name,
11882
+ description = _ref.description,
11883
+ _ref$queryFallbacks = _ref.queryFallbacks,
11884
+ queryFallbacks = _ref$queryFallbacks === void 0 ? false : _ref$queryFallbacks,
11885
+ selected = _ref.selected,
11886
+ busy = _ref.busy,
11887
+ checked = _ref.checked,
11888
+ pressed = _ref.pressed,
11889
+ current = _ref.current,
11890
+ level = _ref.level,
11891
+ expanded = _ref.expanded,
11892
+ _ref$value = _ref.value,
11893
+ _ref$value2 = _ref$value === void 0 ? {} : _ref$value,
11894
+ valueNow = _ref$value2.now,
11895
+ valueMin = _ref$value2.min,
11896
+ valueMax = _ref$value2.max,
11897
+ valueText = _ref$value2.text;
11872
11898
  checkContainerType(container);
11873
11899
  if (selected !== undefined) {
11874
11900
  var _allRoles$get;
@@ -11943,9 +11969,9 @@ const queryAllByRole = function (container, role, _temp) {
11943
11969
  }
11944
11970
  }
11945
11971
  if (expanded !== undefined) {
11946
- var _allRoles$get10;
11972
+ var _allRoles$get0;
11947
11973
  // guard against unknown roles
11948
- if (((_allRoles$get10 = roles_1.get(role)) == null ? void 0 : _allRoles$get10.props['aria-expanded']) === undefined) {
11974
+ if (((_allRoles$get0 = roles_1.get(role)) == null ? void 0 : _allRoles$get0.props['aria-expanded']) === undefined) {
11949
11975
  throw new Error("\"aria-expanded\" is not supported on role \"" + role + "\".");
11950
11976
  }
11951
11977
  }
@@ -11966,7 +11992,8 @@ const queryAllByRole = function (container, role, _temp) {
11966
11992
  return roleValue.split(' ').filter(Boolean).some(roleAttributeToken => roleAttributeToken === role);
11967
11993
  }
11968
11994
  // other wise only send the first token to match
11969
- const [firstRoleAttributeToken] = roleValue.split(' ');
11995
+ const _roleValue$split = roleValue.split(' '),
11996
+ firstRoleAttributeToken = _roleValue$split[0];
11970
11997
  return firstRoleAttributeToken === role;
11971
11998
  }
11972
11999
  const implicitRoles = getImplicitAriaRoles(node);
@@ -12040,10 +12067,8 @@ function makeRoleSelector(role) {
12040
12067
  var _roleElements$get;
12041
12068
  const explicitRoleSelector = "*[role~=\"" + role + "\"]";
12042
12069
  const roleRelations = (_roleElements$get = roleElements_1.get(role)) != null ? _roleElements$get : new Set();
12043
- const implicitRoleSelectors = new Set(Array.from(roleRelations).map(_ref => {
12044
- let {
12045
- name
12046
- } = _ref;
12070
+ const implicitRoleSelectors = new Set(Array.from(roleRelations).map(_ref2 => {
12071
+ let name = _ref2.name;
12047
12072
  return name;
12048
12073
  }));
12049
12074
 
@@ -12064,17 +12089,16 @@ const getNameHint = name => {
12064
12089
  return nameHint;
12065
12090
  };
12066
12091
  const getMultipleError$1 = function (c, role, _temp2) {
12067
- let {
12068
- name
12069
- } = _temp2 === void 0 ? {} : _temp2;
12092
+ let _ref3 = _temp2 === void 0 ? {} : _temp2,
12093
+ name = _ref3.name;
12070
12094
  return "Found multiple elements with the role \"" + role + "\"" + getNameHint(name);
12071
12095
  };
12072
12096
  const getMissingError$1 = function (container, role, _temp3) {
12073
- let {
12074
- hidden = getConfig$1().defaultHidden,
12075
- name,
12076
- description
12077
- } = _temp3 === void 0 ? {} : _temp3;
12097
+ let _ref4 = _temp3 === void 0 ? {} : _temp3,
12098
+ _ref4$hidden = _ref4.hidden,
12099
+ hidden = _ref4$hidden === void 0 ? getConfig$1().defaultHidden : _ref4$hidden,
12100
+ name = _ref4.name,
12101
+ description = _ref4.description;
12078
12102
  if (getConfig$1()._disableExpensiveErrorDiagnostics) {
12079
12103
  return "Unable to find role=\"" + role + "\"" + getNameHint(name);
12080
12104
  }
@@ -12114,7 +12138,12 @@ const getMissingError$1 = function (container, role, _temp3) {
12114
12138
  return ("\nUnable to find an " + (hidden === false ? 'accessible ' : '') + "element with the role \"" + role + "\"" + nameHint + descriptionHint + "\n\n" + roleMessage).trim();
12115
12139
  };
12116
12140
  const queryAllByRoleWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByRole, queryAllByRole.name, 'queryAll');
12117
- const [queryByRole, getAllByRole, getByRole, findAllByRole, findByRole] = buildQueries(queryAllByRole, getMultipleError$1, getMissingError$1);
12141
+ const _buildQueries$1 = buildQueries(queryAllByRole, getMultipleError$1, getMissingError$1),
12142
+ queryByRole = _buildQueries$1[0],
12143
+ getAllByRole = _buildQueries$1[1],
12144
+ getByRole = _buildQueries$1[2],
12145
+ findAllByRole = _buildQueries$1[3],
12146
+ findByRole = _buildQueries$1[4];
12118
12147
 
12119
12148
  const getTestIdAttribute = () => getConfig$1().testIdAttribute;
12120
12149
  const queryAllByTestId = function () {
@@ -12127,7 +12156,12 @@ const queryAllByTestId = function () {
12127
12156
  const getMultipleError = (c, id) => "Found multiple elements by: [" + getTestIdAttribute() + "=\"" + id + "\"]";
12128
12157
  const getMissingError = (c, id) => "Unable to find an element by: [" + getTestIdAttribute() + "=\"" + id + "\"]";
12129
12158
  const queryAllByTestIdWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByTestId, queryAllByTestId.name, 'queryAll');
12130
- const [queryByTestId, getAllByTestId, getByTestId, findAllByTestId, findByTestId] = buildQueries(queryAllByTestId, getMultipleError, getMissingError);
12159
+ const _buildQueries = buildQueries(queryAllByTestId, getMultipleError, getMissingError),
12160
+ queryByTestId = _buildQueries[0],
12161
+ getAllByTestId = _buildQueries[1],
12162
+ getByTestId = _buildQueries[2],
12163
+ findAllByTestId = _buildQueries[3],
12164
+ findByTestId = _buildQueries[4];
12131
12165
 
12132
12166
  var queries = /*#__PURE__*/Object.freeze({
12133
12167
  __proto__: null,
@@ -12916,6 +12950,8 @@ const eventAliasMap = {
12916
12950
  doubleClick: 'dblClick'
12917
12951
  };
12918
12952
 
12953
+ const _excluded = ["value", "files"],
12954
+ _excluded2 = ["bubbles", "cancelable", "detail"];
12919
12955
  function fireEvent(element, event) {
12920
12956
  return getConfig$1().eventWrapper(() => {
12921
12957
  if (!event) {
@@ -12928,10 +12964,11 @@ function fireEvent(element, event) {
12928
12964
  });
12929
12965
  }
12930
12966
  function createEvent(eventName, node, init, _temp) {
12931
- let {
12932
- EventType = 'Event',
12933
- defaultInit = {}
12934
- } = _temp === void 0 ? {} : _temp;
12967
+ let _ref = _temp === void 0 ? {} : _temp,
12968
+ _ref$EventType = _ref.EventType,
12969
+ EventType = _ref$EventType === void 0 ? 'Event' : _ref$EventType,
12970
+ _ref$defaultInit = _ref.defaultInit,
12971
+ defaultInit = _ref$defaultInit === void 0 ? {} : _ref$defaultInit;
12935
12972
  if (!node) {
12936
12973
  throw new Error("Unable to fire a \"" + eventName + "\" event - please provide a DOM element.");
12937
12974
  }
@@ -12939,13 +12976,11 @@ function createEvent(eventName, node, init, _temp) {
12939
12976
  ...defaultInit,
12940
12977
  ...init
12941
12978
  };
12942
- const {
12943
- target: {
12944
- value,
12945
- files,
12946
- ...targetProperties
12947
- } = {}
12948
- } = eventInit;
12979
+ const _eventInit$target = eventInit.target,
12980
+ _eventInit$target2 = _eventInit$target === void 0 ? {} : _eventInit$target,
12981
+ value = _eventInit$target2.value,
12982
+ files = _eventInit$target2.files,
12983
+ targetProperties = _objectWithoutPropertiesLoose(_eventInit$target2, _excluded);
12949
12984
  if (value !== undefined) {
12950
12985
  setNativeValue(node, value);
12951
12986
  }
@@ -12970,12 +13005,10 @@ function createEvent(eventName, node, init, _temp) {
12970
13005
  } else {
12971
13006
  // IE11 polyfill from https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent#Polyfill
12972
13007
  event = window.document.createEvent(EventType);
12973
- const {
12974
- bubbles,
12975
- cancelable,
12976
- detail,
12977
- ...otherInit
12978
- } = eventInit;
13008
+ const bubbles = eventInit.bubbles,
13009
+ cancelable = eventInit.cancelable,
13010
+ detail = eventInit.detail,
13011
+ otherInit = _objectWithoutPropertiesLoose(eventInit, _excluded2);
12979
13012
  event.initEvent(eventName, bubbles, cancelable, detail);
12980
13013
  Object.keys(otherInit).forEach(eventKey => {
12981
13014
  event[eventKey] = otherInit[eventKey];
@@ -13007,10 +13040,9 @@ function createEvent(eventName, node, init, _temp) {
13007
13040
  return event;
13008
13041
  }
13009
13042
  Object.keys(eventMap).forEach(key => {
13010
- const {
13011
- EventType,
13012
- defaultInit
13013
- } = eventMap[key];
13043
+ const _eventMap$key = eventMap[key],
13044
+ EventType = _eventMap$key.EventType,
13045
+ defaultInit = _eventMap$key.defaultInit;
13014
13046
  const eventName = key.toLowerCase();
13015
13047
  createEvent[key] = (node, init) => createEvent(eventName, node, init, {
13016
13048
  EventType,
@@ -13022,13 +13054,11 @@ Object.keys(eventMap).forEach(key => {
13022
13054
  // function written after some investigation here:
13023
13055
  // https://github.com/facebook/react/issues/10135#issuecomment-401496776
13024
13056
  function setNativeValue(element, value) {
13025
- const {
13026
- set: valueSetter
13027
- } = Object.getOwnPropertyDescriptor(element, 'value') || {};
13057
+ const _ref2 = Object.getOwnPropertyDescriptor(element, 'value') || {},
13058
+ valueSetter = _ref2.set;
13028
13059
  const prototype = Object.getPrototypeOf(element);
13029
- const {
13030
- set: prototypeValueSetter
13031
- } = Object.getOwnPropertyDescriptor(prototype, 'value') || {};
13060
+ const _ref3 = Object.getOwnPropertyDescriptor(prototype, 'value') || {},
13061
+ prototypeValueSetter = _ref3.set;
13032
13062
  if (prototypeValueSetter && valueSetter !== prototypeValueSetter) {
13033
13063
  prototypeValueSetter.call(element, value);
13034
13064
  } else {
@@ -13190,6 +13220,7 @@ function jestFakeTimersAreEnabled() {
13190
13220
 
13191
13221
  return false;
13192
13222
  }
13223
+ let inEventWrapper = false;
13193
13224
  configure({
13194
13225
  unstable_advanceTimersWrapper: cb => {
13195
13226
  return act(cb);
@@ -13219,11 +13250,19 @@ configure({
13219
13250
  }
13220
13251
  },
13221
13252
  eventWrapper: cb => {
13222
- let result;
13223
- act(() => {
13224
- result = cb();
13225
- });
13226
- return result;
13253
+ if (inEventWrapper) {
13254
+ return cb();
13255
+ }
13256
+ inEventWrapper = true;
13257
+ try {
13258
+ let result;
13259
+ act(() => {
13260
+ result = cb();
13261
+ });
13262
+ return result;
13263
+ } finally {
13264
+ inEventWrapper = false;
13265
+ }
13227
13266
  }
13228
13267
  });
13229
13268
 
@@ -13237,24 +13276,24 @@ const mountedContainers = new Set();
13237
13276
  * @type Array<{container: import('react-dom').Container, root: ReturnType<typeof createConcurrentRoot>}>
13238
13277
  */
13239
13278
  const mountedRootEntries = [];
13240
- function strictModeIfNeeded(innerElement) {
13241
- return getConfig().reactStrictMode ? /*#__PURE__*/React.createElement(React.StrictMode, null, innerElement) : innerElement;
13279
+ function strictModeIfNeeded(innerElement, reactStrictMode) {
13280
+ return reactStrictMode ?? getConfig().reactStrictMode ? /*#__PURE__*/React.createElement(React.StrictMode, null, innerElement) : innerElement;
13242
13281
  }
13243
13282
  function wrapUiIfNeeded(innerElement, wrapperComponent) {
13244
13283
  return wrapperComponent ? /*#__PURE__*/React.createElement(wrapperComponent, null, innerElement) : innerElement;
13245
13284
  }
13246
- function createConcurrentRoot(container, _ref) {
13247
- let {
13248
- hydrate,
13249
- onCaughtError,
13250
- onRecoverableError,
13251
- ui,
13252
- wrapper: WrapperComponent
13253
- } = _ref;
13285
+ function createConcurrentRoot(container, {
13286
+ hydrate,
13287
+ onCaughtError,
13288
+ onRecoverableError,
13289
+ ui,
13290
+ wrapper: WrapperComponent,
13291
+ reactStrictMode
13292
+ }) {
13254
13293
  let root;
13255
13294
  if (hydrate) {
13256
13295
  act(() => {
13257
- root = ReactDOMClient.hydrateRoot(container, strictModeIfNeeded(wrapUiIfNeeded(ui, WrapperComponent)), {
13296
+ root = ReactDOMClient.hydrateRoot(container, strictModeIfNeeded(wrapUiIfNeeded(ui, WrapperComponent), reactStrictMode), {
13258
13297
  onCaughtError,
13259
13298
  onRecoverableError
13260
13299
  });
@@ -13294,35 +13333,30 @@ function createLegacyRoot(container) {
13294
13333
  }
13295
13334
  };
13296
13335
  }
13297
- function renderRoot(ui, _ref2) {
13298
- let {
13299
- baseElement,
13300
- container,
13301
- hydrate,
13302
- queries,
13303
- root,
13304
- wrapper: WrapperComponent
13305
- } = _ref2;
13336
+ function renderRoot(ui, {
13337
+ baseElement,
13338
+ container,
13339
+ hydrate,
13340
+ queries,
13341
+ root,
13342
+ wrapper: WrapperComponent,
13343
+ reactStrictMode
13344
+ }) {
13306
13345
  act(() => {
13307
13346
  if (hydrate) {
13308
- root.hydrate(strictModeIfNeeded(wrapUiIfNeeded(ui, WrapperComponent)), container);
13347
+ root.hydrate(strictModeIfNeeded(wrapUiIfNeeded(ui, WrapperComponent), reactStrictMode), container);
13309
13348
  } else {
13310
- root.render(strictModeIfNeeded(wrapUiIfNeeded(ui, WrapperComponent)), container);
13349
+ root.render(strictModeIfNeeded(wrapUiIfNeeded(ui, WrapperComponent), reactStrictMode), container);
13311
13350
  }
13312
13351
  });
13313
13352
  return {
13314
13353
  container,
13315
13354
  baseElement,
13316
- debug: function (el, maxLength, options) {
13317
- if (el === void 0) {
13318
- el = baseElement;
13319
- }
13320
- return Array.isArray(el) ?
13321
- // eslint-disable-next-line no-console
13322
- el.forEach(e => console.log(prettyDOM(e, maxLength, options))) :
13323
- // eslint-disable-next-line no-console,
13324
- console.log(prettyDOM(el, maxLength, options));
13325
- },
13355
+ debug: (el = baseElement, maxLength, options) => Array.isArray(el) ?
13356
+ // eslint-disable-next-line no-console
13357
+ el.forEach(e => console.log(prettyDOM(e, maxLength, options))) :
13358
+ // eslint-disable-next-line no-console,
13359
+ console.log(prettyDOM(el, maxLength, options)),
13326
13360
  unmount: () => {
13327
13361
  act(() => {
13328
13362
  root.unmount();
@@ -13333,7 +13367,8 @@ function renderRoot(ui, _ref2) {
13333
13367
  container,
13334
13368
  baseElement,
13335
13369
  root,
13336
- wrapper: WrapperComponent
13370
+ wrapper: WrapperComponent,
13371
+ reactStrictMode
13337
13372
  });
13338
13373
  // Intentionally do not return anything to avoid unnecessarily complicating the API.
13339
13374
  // folks can use all the same utilities we return in the first place that are bound to the container
@@ -13351,18 +13386,18 @@ function renderRoot(ui, _ref2) {
13351
13386
  ...getQueriesForElement(baseElement, queries)
13352
13387
  };
13353
13388
  }
13354
- function render(ui, _temp) {
13355
- let {
13356
- container,
13357
- baseElement = container,
13358
- legacyRoot = false,
13359
- onCaughtError,
13360
- onUncaughtError,
13361
- onRecoverableError,
13362
- queries,
13363
- hydrate = false,
13364
- wrapper
13365
- } = _temp === void 0 ? {} : _temp;
13389
+ function render(ui, {
13390
+ container,
13391
+ baseElement = container,
13392
+ legacyRoot = false,
13393
+ onCaughtError,
13394
+ onUncaughtError,
13395
+ onRecoverableError,
13396
+ queries,
13397
+ hydrate = false,
13398
+ wrapper,
13399
+ reactStrictMode
13400
+ } = {}) {
13366
13401
  if (onUncaughtError !== undefined) {
13367
13402
  throw new Error('onUncaughtError is not supported. The `render` call will already throw on uncaught errors.');
13368
13403
  }
@@ -13380,7 +13415,7 @@ function render(ui, _temp) {
13380
13415
  container = baseElement.appendChild(document.createElement('div'));
13381
13416
  }
13382
13417
  let root;
13383
- // eslint-disable-next-line no-negated-condition -- we want to map the evolution of this over time. The root is created first. Only later is it re-used so we don't want to read the case that happens later first.
13418
+ // eslint-disable-next-line no-negated-condition -- we want to map the evolution of this over time. The root is created first. Only later is it reused so we don't want to read the case that happens later first.
13384
13419
  if (!mountedContainers.has(container)) {
13385
13420
  const createRootImpl = legacyRoot ? createLegacyRoot : createConcurrentRoot;
13386
13421
  root = createRootImpl(container, {
@@ -13388,7 +13423,8 @@ function render(ui, _temp) {
13388
13423
  onCaughtError,
13389
13424
  onRecoverableError,
13390
13425
  ui,
13391
- wrapper
13426
+ wrapper,
13427
+ reactStrictMode
13392
13428
  });
13393
13429
  mountedRootEntries.push({
13394
13430
  container,
@@ -13414,15 +13450,15 @@ function render(ui, _temp) {
13414
13450
  queries,
13415
13451
  hydrate,
13416
13452
  wrapper,
13417
- root
13453
+ root,
13454
+ reactStrictMode
13418
13455
  });
13419
13456
  }
13420
13457
  function cleanup() {
13421
- mountedRootEntries.forEach(_ref3 => {
13422
- let {
13423
- root,
13424
- container
13425
- } = _ref3;
13458
+ mountedRootEntries.forEach(({
13459
+ root,
13460
+ container
13461
+ }) => {
13426
13462
  act(() => {
13427
13463
  root.unmount();
13428
13464
  });
@@ -13433,10 +13469,7 @@ function cleanup() {
13433
13469
  mountedRootEntries.length = 0;
13434
13470
  mountedContainers.clear();
13435
13471
  }
13436
- function renderHook(renderCallback, options) {
13437
- if (options === void 0) {
13438
- options = {};
13439
- }
13472
+ function renderHook(renderCallback, options = {}) {
13440
13473
  const {
13441
13474
  initialProps,
13442
13475
  ...renderOptions
@@ -13447,10 +13480,9 @@ function renderHook(renderCallback, options) {
13447
13480
  throw error;
13448
13481
  }
13449
13482
  const result = /*#__PURE__*/React.createRef();
13450
- function TestComponent(_ref4) {
13451
- let {
13452
- renderCallbackProps
13453
- } = _ref4;
13483
+ function TestComponent({
13484
+ renderCallbackProps
13485
+ }) {
13454
13486
  const pendingResult = renderCallback(renderCallbackProps);
13455
13487
  React.useEffect(() => {
13456
13488
  result.current = pendingResult;