@tamagui/core 1.129.12 → 1.129.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/native.js CHANGED
@@ -2450,6 +2450,81 @@ var require_index_native4 = __commonJS({
2450
2450
  }
2451
2451
  });
2452
2452
 
2453
+ // ../../packages/is-equal-shallow/dist/cjs/index.native.js
2454
+ var require_index_native5 = __commonJS({
2455
+ "../../packages/is-equal-shallow/dist/cjs/index.native.js"(exports2, module2) {
2456
+ "use strict";
2457
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
2458
+ for (var name in all) __defProp2(target, name, {
2459
+ get: all[name],
2460
+ enumerable: !0
2461
+ });
2462
+ }, __copyProps2 = function(to, from, except, desc) {
2463
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
2464
+ if (from && typeof from == "object" || typeof from == "function") try {
2465
+ for (var _loop = function() {
2466
+ var key = _step.value;
2467
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
2468
+ get: function() {
2469
+ return from[key];
2470
+ },
2471
+ enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
2472
+ });
2473
+ }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
2474
+ } catch (err) {
2475
+ _didIteratorError = !0, _iteratorError = err;
2476
+ } finally {
2477
+ try {
2478
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
2479
+ } finally {
2480
+ if (_didIteratorError)
2481
+ throw _iteratorError;
2482
+ }
2483
+ }
2484
+ return to;
2485
+ }, __toCommonJS2 = function(mod) {
2486
+ return __copyProps2(__defProp2({}, "__esModule", {
2487
+ value: !0
2488
+ }), mod);
2489
+ }, index_exports2 = {};
2490
+ __export2(index_exports2, {
2491
+ isEqualShallow: function() {
2492
+ return isEqualShallow;
2493
+ },
2494
+ mergeIfNotShallowEqual: function() {
2495
+ return mergeIfNotShallowEqual;
2496
+ },
2497
+ useCreateShallowSetState: function() {
2498
+ return useCreateShallowSetState;
2499
+ }
2500
+ });
2501
+ module2.exports = __toCommonJS2(index_exports2);
2502
+ var import_react3 = require("react");
2503
+ function useCreateShallowSetState(setter, debug) {
2504
+ return (0, import_react3.useCallback)(function(stateOrGetState) {
2505
+ setter(function(prev) {
2506
+ var next = typeof stateOrGetState == "function" ? stateOrGetState(prev) : stateOrGetState, update = mergeIfNotShallowEqual(prev, next);
2507
+ if (process.env.NODE_ENV === "development" && debug && update !== prev && (console.groupCollapsed("setStateShallow CHANGE", "=>", update), console.info("previously", prev), console.trace(), console.groupEnd(), debug === "break")) debugger;
2508
+ return update;
2509
+ });
2510
+ }, [
2511
+ setter,
2512
+ debug
2513
+ ]);
2514
+ }
2515
+ function mergeIfNotShallowEqual(prev, next) {
2516
+ return !prev || !next || isEqualShallow(prev, next) ? prev || next : {
2517
+ ...prev,
2518
+ ...next
2519
+ };
2520
+ }
2521
+ function isEqualShallow(prev, next) {
2522
+ for (var key in next) if (prev[key] !== next[key]) return !1;
2523
+ return !0;
2524
+ }
2525
+ }
2526
+ });
2527
+
2453
2528
  // ../web/dist/cjs/constants/isDevTools.native.js
2454
2529
  var require_isDevTools_native = __commonJS({
2455
2530
  "../web/dist/cjs/constants/isDevTools.native.js"(exports2, module2) {
@@ -2697,13 +2772,55 @@ var require_ComponentContext_native = __commonJS({
2697
2772
  inText: !1,
2698
2773
  language: null,
2699
2774
  animationDriver: null,
2700
- setParentFocusState: null,
2701
- groups: {
2702
- emit: null,
2703
- subscribe: null,
2704
- state: {}
2775
+ setParentFocusState: null
2776
+ });
2777
+ }
2778
+ });
2779
+
2780
+ // ../web/dist/cjs/contexts/GroupContext.native.js
2781
+ var require_GroupContext_native = __commonJS({
2782
+ "../web/dist/cjs/contexts/GroupContext.native.js"(exports2, module2) {
2783
+ "use strict";
2784
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
2785
+ for (var name in all) __defProp2(target, name, {
2786
+ get: all[name],
2787
+ enumerable: !0
2788
+ });
2789
+ }, __copyProps2 = function(to, from, except, desc) {
2790
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
2791
+ if (from && typeof from == "object" || typeof from == "function") try {
2792
+ for (var _loop = function() {
2793
+ var key = _step.value;
2794
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
2795
+ get: function() {
2796
+ return from[key];
2797
+ },
2798
+ enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
2799
+ });
2800
+ }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
2801
+ } catch (err) {
2802
+ _didIteratorError = !0, _iteratorError = err;
2803
+ } finally {
2804
+ try {
2805
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
2806
+ } finally {
2807
+ if (_didIteratorError)
2808
+ throw _iteratorError;
2809
+ }
2810
+ }
2811
+ return to;
2812
+ }, __toCommonJS2 = function(mod) {
2813
+ return __copyProps2(__defProp2({}, "__esModule", {
2814
+ value: !0
2815
+ }), mod);
2816
+ }, GroupContext_exports = {};
2817
+ __export2(GroupContext_exports, {
2818
+ GroupContext: function() {
2819
+ return GroupContext;
2705
2820
  }
2706
2821
  });
2822
+ module2.exports = __toCommonJS2(GroupContext_exports);
2823
+ var import_react3 = require("react"), GroupContext = /* @__PURE__ */ (0, import_react3.createContext)(null);
2707
2824
  }
2708
2825
  });
2709
2826
 
@@ -3612,7 +3729,7 @@ var require_normalize_color = __commonJS({
3612
3729
  });
3613
3730
 
3614
3731
  // ../normalize-css-color/dist/cjs/index.native.js
3615
- var require_index_native5 = __commonJS({
3732
+ var require_index_native6 = __commonJS({
3616
3733
  "../normalize-css-color/dist/cjs/index.native.js"(exports2, module2) {
3617
3734
  "use strict";
3618
3735
  var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
@@ -3735,7 +3852,7 @@ var require_normalizeColor_native = __commonJS({
3735
3852
  }
3736
3853
  });
3737
3854
  module2.exports = __toCommonJS2(normalizeColor_exports);
3738
- var import_normalize_css_color = require_index_native5(), import_normalize_css_color2 = require_index_native5(), normalizeColor = function(color, opacity) {
3855
+ var import_normalize_css_color = require_index_native6(), import_normalize_css_color2 = require_index_native6(), normalizeColor = function(color, opacity) {
3739
3856
  if (color) {
3740
3857
  if (color[0] === "$") return color;
3741
3858
  if (color.startsWith("var(")) {
@@ -5311,7 +5428,7 @@ var require_getSplitStyles_native = __commonJS({
5311
5428
  function isValidStyleKey(key, validStyles2, accept) {
5312
5429
  return key in validStyles2 ? !0 : accept && key in accept;
5313
5430
  }
5314
- var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, componentContext, elementType, startedUnhydrated, debug) {
5431
+ var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, componentContext, groupContext, elementType, startedUnhydrated, debug) {
5315
5432
  var _loop = function(keyOg2) {
5316
5433
  var keyInit = keyOg2, valInit = props[keyInit];
5317
5434
  if (keyInit === "children") return viewProps[keyInit] = valInit, "continue";
@@ -5320,7 +5437,7 @@ var require_getSplitStyles_native = __commonJS({
5320
5437
  var accepted = accept[keyInit];
5321
5438
  if ((accepted === "style" || accepted === "textStyle") && valInit && typeof valInit == "object") return viewProps[keyInit] = getSubStyle(styleState, keyInit, valInit, styleProps.noClass), "continue";
5322
5439
  }
5323
- if (process.env.NODE_ENV, disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit === "className" || keyInit in usedKeys) return "continue";
5440
+ if (process.env.NODE_ENV, disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit === "className") return "continue";
5324
5441
  if (keyInit in import_skipProps.skipProps && !noSkip && !isHOC) {
5325
5442
  if (keyInit === "group" && !1) var identifier2, containerType, containerCSS;
5326
5443
  return "continue";
@@ -5345,7 +5462,7 @@ var require_getSplitStyles_native = __commonJS({
5345
5462
  parts.length === 2 || parts.length === 3 && import_pseudoDescriptors.pseudoPriorities[parts[parts.length - 1]]
5346
5463
  ) {
5347
5464
  var name2 = parts[1];
5348
- componentContext != null && componentContext.groups.subscribe && !(componentContext != null && componentContext.groups.state[name2]) && (keyInit = keyInit.replace("$group-", "$group-true-"));
5465
+ groupContext != null && groupContext[name2] || (keyInit = keyInit.replace("$group-", "$group-true-"));
5349
5466
  }
5350
5467
  }
5351
5468
  var isStyleProp = isValidStyleKeyInit || isMediaOrPseudo || isVariant && !noExpand;
@@ -5371,13 +5488,13 @@ var require_getSplitStyles_native = __commonJS({
5371
5488
  viewProps[key4] = val2;
5372
5489
  return;
5373
5490
  }
5374
- if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(" \u{1F4A0} expanded", keyInit, "=>", key4), (0, import_log.log)(val2), console.groupEnd()), val2 != null && !(key4 in usedKeys)) {
5491
+ if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(" \u{1F4A0} expanded", keyInit, "=>", key4), (0, import_log.log)(val2), console.groupEnd()), val2 != null) {
5375
5492
  if (key4 === "pointerEvents") {
5376
5493
  viewProps[key4] = val2;
5377
5494
  return;
5378
5495
  }
5379
5496
  if (!isHOC && isValidStyleKey(key4, validStyles2, accept) || import_constants.isAndroid && key4 === "elevation") {
5380
- mergeStyle(styleState, key4, val2);
5497
+ mergeStyle(styleState, key4, val2, 1);
5381
5498
  return;
5382
5499
  }
5383
5500
  if (isPseudo = key4 in import_helpers2.validPseudoKeys, isMedia = !isPseudo && (0, import_useMedia.isMediaKey)(key4), isMediaOrPseudo = !!(isMedia || isPseudo), isVariant = variants && key4 in variants, inlineProps != null && inlineProps.has(key4) || process.env.IS_STATIC === "is_static" && inlineWhenUnflattened != null && inlineWhenUnflattened.has(key4)) {
@@ -5413,7 +5530,7 @@ var require_getSplitStyles_native = __commonJS({
5413
5530
  try {
5414
5531
  for (var _iterator2 = pseudoStyles[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) {
5415
5532
  var psuedoStyle = _step2.value, fullKey = `${psuedoStyle[import_helpers2.StyleObjectProperty]}${PROP_SPLIT}${descriptor.name}`;
5416
- fullKey in usedKeys || (addStyleToInsertRules(rulesToInsert, psuedoStyle), classNames[fullKey] = psuedoStyle[import_helpers2.StyleObjectIdentifier]);
5533
+ addStyleToInsertRules(rulesToInsert, psuedoStyle), classNames[fullKey] = psuedoStyle[import_helpers2.StyleObjectIdentifier];
5417
5534
  }
5418
5535
  } catch (err) {
5419
5536
  _didIteratorError2 = !0, _iteratorError2 = err;
@@ -5446,7 +5563,7 @@ var require_getSplitStyles_native = __commonJS({
5446
5563
  var _pseudos1, _key1;
5447
5564
  pseudos || (pseudos = {}), (_pseudos1 = pseudos)[_key1 = key4] || (_pseudos1[_key1] = {}), pseudos[key4][pkey] = _$val;
5448
5565
  }
5449
- mergeStyle(styleState, pkey, _$val);
5566
+ mergeStyle(styleState, pkey, _$val, importance);
5450
5567
  }
5451
5568
  process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(" subKey", pkey, shouldMerge, {
5452
5569
  importance,
@@ -5467,7 +5584,7 @@ var require_getSplitStyles_native = __commonJS({
5467
5584
  if (!val2) return;
5468
5585
  var hasSpace = val2.space, mediaKeyShort = key4.slice(isMedia == "theme" ? 7 : 1);
5469
5586
  if (hasMedia || (hasMedia = !0), (hasSpace || !shouldDoClasses || styleProps.willBeAnimated) && ((!hasMedia || typeof hasMedia == "boolean") && (hasMedia = /* @__PURE__ */ new Set()), hasMedia.add(mediaKeyShort)), isMedia === "platform" && !(0, import_isActivePlatform.isActivePlatform)(key4)) return;
5470
- if (process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F4FA} ${key4}`, {
5587
+ process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F4FA} ${key4}`, {
5471
5588
  key: key4,
5472
5589
  val: val2,
5473
5590
  props,
@@ -5475,15 +5592,15 @@ var require_getSplitStyles_native = __commonJS({
5475
5592
  acceptsClassName,
5476
5593
  componentState,
5477
5594
  mediaState: mediaState2
5478
- }), shouldDoClasses) {
5595
+ });
5596
+ var priority = mediaStylesSeen;
5597
+ if (mediaStylesSeen += 1, shouldDoClasses) {
5479
5598
  var mediaStyle = getSubStyle(styleState, key4, val2, !1);
5480
5599
  if (hasSpace && (delete mediaStyle.space, mediaState2[mediaKeyShort])) {
5481
5600
  var importance1 = (0, import_useMedia.getMediaImportanceIfMoreImportant)(mediaKeyShort, "space", usedKeys, !0);
5482
5601
  importance1 && (space = val2.space, usedKeys.space = importance1, process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(`Found more important space for current media ${mediaKeyShort}: ${val2} (importance: ${importance1})`));
5483
5602
  }
5484
- var mediaStyles = (0, import_getCSSStylesAtomic.getCSSStylesAtomic)(mediaStyle), priority = mediaStylesSeen;
5485
- mediaStylesSeen += 1;
5486
- var _iteratorNormalCompletion12 = !0, _didIteratorError12 = !1, _iteratorError12 = void 0;
5603
+ var mediaStyles = (0, import_getCSSStylesAtomic.getCSSStylesAtomic)(mediaStyle), _iteratorNormalCompletion12 = !0, _didIteratorError12 = !1, _iteratorError12 = void 0;
5487
5604
  try {
5488
5605
  for (var _iterator12 = mediaStyles[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = !0) {
5489
5606
  var style3 = _step12.value, property = style3[import_helpers2.StyleObjectProperty], isSubStyle = property[0] === "$";
@@ -5491,7 +5608,7 @@ var require_getSplitStyles_native = __commonJS({
5491
5608
  var out = (0, import_createMediaStyle.createMediaStyle)(style3, mediaKeyShort, import_useMedia.mediaQueryConfig, isMedia, !1, priority);
5492
5609
  process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)("\u{1F4FA} media style:", out);
5493
5610
  var subKey = isSubStyle ? style3[2] : "", fullKey1 = `${style3[import_helpers2.StyleObjectProperty]}${subKey}${PROP_SPLIT}${mediaKeyShort}${style3[import_helpers2.StyleObjectPseudo] || ""}`;
5494
- fullKey1 in usedKeys || (addStyleToInsertRules(rulesToInsert, out), classNames[fullKey1] = out[import_helpers2.StyleObjectIdentifier]);
5611
+ addStyleToInsertRules(rulesToInsert, out), classNames[fullKey1] = out[import_helpers2.StyleObjectIdentifier];
5495
5612
  }
5496
5613
  }
5497
5614
  } catch (err) {
@@ -5529,12 +5646,12 @@ var require_getSplitStyles_native = __commonJS({
5529
5646
  scheme,
5530
5647
  val: _$val1,
5531
5648
  oppositeVal
5532
- }), mergeStyle(styleState, subKey1, mediaStyle1[subKey1]);
5649
+ }), mergeStyle(styleState, subKey1, mediaStyle1[subKey1], priority);
5533
5650
  }
5534
5651
  } else if (!(themeName === mediaKeyShort || themeName.startsWith(mediaKeyShort))) return;
5535
5652
  } else if (isGroupMedia) {
5536
- var _componentState_group, groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyShort), groupName = groupInfo.name, groupContext = componentContext == null ? void 0 : componentContext.groups.state[groupName];
5537
- if (!groupContext) {
5653
+ var _groupContext_groupName, _componentState_group, groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyShort), groupName = groupInfo.name, groupState = groupContext == null || (_groupContext_groupName = groupContext[groupName]) === null || _groupContext_groupName === void 0 ? void 0 : _groupContext_groupName.state;
5654
+ if (!groupState) {
5538
5655
  process.env.NODE_ENV === "development" && debug && (0, import_log.log)(`No parent with group prop, skipping styles: ${groupName}`);
5539
5656
  return;
5540
5657
  }
@@ -5542,17 +5659,30 @@ var require_getSplitStyles_native = __commonJS({
5542
5659
  if (groupMediaKey) {
5543
5660
  mediaGroups || (mediaGroups = /* @__PURE__ */ new Set()), mediaGroups.add(groupMediaKey);
5544
5661
  var mediaState1 = componentGroupState == null ? void 0 : componentGroupState.media, isActive = mediaState1 == null ? void 0 : mediaState1[groupMediaKey];
5545
- if (!mediaState1 && groupContext.layout && (isActive = (0, import_useMedia.mediaKeyMatch)(groupMediaKey, groupContext.layout)), process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F3D8}\uFE0F GROUP media ${groupMediaKey} active? ${isActive}`), !isActive) {
5662
+ if (!mediaState1 && groupState.layout && (isActive = (0, import_useMedia.mediaKeyMatch)(groupMediaKey, groupState.layout)), process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F3D8}\uFE0F GROUP media ${groupMediaKey} active? ${isActive}`, {
5663
+ ...mediaState1,
5664
+ usedKeys: {
5665
+ ...styleState.usedKeys
5666
+ }
5667
+ }), !isActive) {
5546
5668
  for (var pkey1 in mediaStyle1) applyDefaultStyle(pkey1, styleState);
5547
5669
  return;
5548
5670
  }
5549
5671
  importanceBump = 2;
5550
5672
  }
5551
5673
  if (groupPseudoKey) {
5674
+ var _this;
5552
5675
  pseudoGroups || (pseudoGroups = /* @__PURE__ */ new Set()), pseudoGroups.add(groupName);
5553
- var componentGroupPseudoState = (componentGroupState || // fallback to context initially
5554
- componentContext.groups.state[groupName]).pseudo, isActive1 = componentGroupPseudoState == null ? void 0 : componentGroupPseudoState[groupPseudoKey], priority1 = import_pseudoDescriptors.pseudoPriorities[groupPseudoKey];
5555
- if (process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F3D8}\uFE0F GROUP pseudo ${groupMediaKey} active? ${isActive1}, priority ${priority1}`), !isActive1) {
5676
+ var componentGroupPseudoState = (_this = componentGroupState || // fallback to context initially
5677
+ (groupContext == null ? void 0 : groupContext[groupName].state)) === null || _this === void 0 ? void 0 : _this.pseudo, isActive1 = componentGroupPseudoState == null ? void 0 : componentGroupPseudoState[groupPseudoKey], priority1 = import_pseudoDescriptors.pseudoPriorities[groupPseudoKey];
5678
+ if (process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F3D8}\uFE0F GROUP pseudo ${groupMediaKey} active? ${isActive1}, priority ${priority1}`, {
5679
+ componentGroupPseudoState: {
5680
+ ...componentGroupPseudoState
5681
+ },
5682
+ usedKeys: {
5683
+ ...styleState.usedKeys
5684
+ }
5685
+ }), !isActive1) {
5556
5686
  for (var pkey2 in mediaStyle1) applyDefaultStyle(pkey2, styleState);
5557
5687
  return;
5558
5688
  }
@@ -5583,6 +5713,8 @@ var require_getSplitStyles_native = __commonJS({
5583
5713
  ...styleState.style
5584
5714
  }), (0, import_log.log)("viewProps", {
5585
5715
  ...viewProps
5716
+ }), (0, import_log.log)("transforms", {
5717
+ ...styleState.flatTransforms
5586
5718
  });
5587
5719
  } catch {
5588
5720
  }
@@ -5616,7 +5748,7 @@ var require_getSplitStyles_native = __commonJS({
5616
5748
  }
5617
5749
  }));
5618
5750
  }
5619
- process.env.NODE_ENV === "development" && debug === "profile" && time`style-state`, process.env.NODE_ENV === "development" && debug && debug !== "profile" && import_constants.isClient && (console.groupCollapsed("getSplitStyles (collapsed)"), (0, import_log.log)({
5751
+ process.env.NODE_ENV === "development" && debug === "profile" && time`style-state`, process.env.NODE_ENV === "development" && debug && debug !== "profile" && import_constants.isClient && import_isDevTools.isDevTools && (console.groupCollapsed("\u{1F539} getSplitStyles \u{1F447}"), (0, import_log.log)({
5620
5752
  props,
5621
5753
  staticConfig,
5622
5754
  shouldDoClasses,
@@ -5627,7 +5759,7 @@ var require_getSplitStyles_native = __commonJS({
5627
5759
  theme: {
5628
5760
  ...theme
5629
5761
  }
5630
- }), console.groupEnd());
5762
+ }));
5631
5763
  var { asChild } = props, { accept } = staticConfig, { noSkip, disableExpandShorthands, noExpand } = styleProps, { webContainerType } = conf.settings, parentVariants = parentStaticConfig == null ? void 0 : parentStaticConfig.variants;
5632
5764
  for (var keyOg in props) _loop(keyOg);
5633
5765
  process.env.NODE_ENV === "development" && debug === "profile" && time`split-styles-propsend`;
@@ -5709,8 +5841,8 @@ var require_getSplitStyles_native = __commonJS({
5709
5841
  }
5710
5842
  } else style2 && (viewProps.style = style2);
5711
5843
  }
5712
- if (process.env.NODE_ENV === "development" && debug === "verbose" && import_isDevTools.isDevTools) {
5713
- console.groupCollapsed("\u{1F539} getSplitStyles ===>");
5844
+ if (process.env.NODE_ENV === "development" && debug && debug !== "profile" && import_constants.isClient && import_isDevTools.isDevTools) {
5845
+ console.groupEnd(), console.groupCollapsed("\u{1F539} getSplitStyles ===>");
5714
5846
  try {
5715
5847
  var logs = {
5716
5848
  ...result,
@@ -5736,11 +5868,11 @@ var require_getSplitStyles_native = __commonJS({
5736
5868
  mergeTransform(target, key, val, !0);
5737
5869
  });
5738
5870
  }
5739
- function mergeStyle(styleState, key, val) {
5740
- var disableNormalize = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, { viewProps, styleProps, staticConfig } = styleState;
5741
- if (key in import_helpers2.stylePropsTransform) {
5742
- var _styleState;
5743
- (_styleState = styleState).flatTransforms || (_styleState.flatTransforms = {}), styleState.flatTransforms[key] = val;
5871
+ function mergeStyle(styleState, key, val, importance) {
5872
+ var disableNormalize = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !1, { viewProps, styleProps, staticConfig } = styleState, existingImportance = styleState.usedKeys[key];
5873
+ if (!(importance < existingImportance)) if (key in import_helpers2.stylePropsTransform) {
5874
+ var _styleState, _styleState_usedKeys, _key;
5875
+ (_styleState = styleState).flatTransforms || (_styleState.flatTransforms = {}), (_styleState_usedKeys = styleState.usedKeys)[_key = key] || (_styleState_usedKeys[_key] = 1), styleState.flatTransforms[key] = val;
5744
5876
  } else {
5745
5877
  var shouldNormalize = import_constants.isWeb && !disableNormalize && !styleProps.noNormalize, out = shouldNormalize ? (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(val, key) : val;
5746
5878
  if (
@@ -5748,8 +5880,8 @@ var require_getSplitStyles_native = __commonJS({
5748
5880
  staticConfig.accept && key in staticConfig.accept
5749
5881
  ) viewProps[key] = out;
5750
5882
  else {
5751
- var _styleState1;
5752
- (_styleState1 = styleState).style || (_styleState1.style = {}), styleState.style[key] = // if you dont do this you'll be passing props.transform arrays directly here and then mutating them
5883
+ var _styleState1, _styleState_usedKeys1, _key1;
5884
+ (_styleState1 = styleState).style || (_styleState1.style = {}), (_styleState_usedKeys1 = styleState.usedKeys)[_key1 = key] || (_styleState_usedKeys1[_key1] = 1), styleState.style[key] = // if you dont do this you'll be passing props.transform arrays directly here and then mutating them
5753
5885
  // if theres any flatTransforms later, causing issues (mutating props is bad, in strict mode styles get borked)
5754
5886
  key === "transform" && Array.isArray(out) ? [
5755
5887
  ...out
@@ -5780,8 +5912,8 @@ var require_getSplitStyles_native = __commonJS({
5780
5912
  }
5781
5913
  return styleProps.noNormalize || (0, import_expandStyles.fixStyles)(styleOut), styleOut;
5782
5914
  }, useInsertEffectCompat = import_constants.isWeb ? import_react3.default.useInsertionEffect || import_constants.useIsomorphicLayoutEffect : function() {
5783
- }, useSplitStyles = function(a, b, c, d, e, f, g, h, i, j, k) {
5784
- var res = getSplitStyles(a, b, c, d, e, f, g, h, i, j, k);
5915
+ }, useSplitStyles = function(a, b, c, d, e, f, g, h, i, j, k, l) {
5916
+ var res = getSplitStyles(a, b, c, d, e, f, g, h, i, j, k, l);
5785
5917
  return res;
5786
5918
  };
5787
5919
  function addStyleToInsertRules(rulesToInsert, styleObject) {
@@ -5826,14 +5958,14 @@ var require_getSplitStyles_native = __commonJS({
5826
5958
  delete viewProps[key], viewProps[key] = next;
5827
5959
  } else viewProps[key] = val;
5828
5960
  }
5829
- function mergeMediaByImportance(styleState, mediaKey, key, value, importancesUsed, isSizeMedia, importanceBump, debugProp) {
5830
- var importance = (0, import_useMedia.getMediaImportanceIfMoreImportant)(mediaKey, key, importancesUsed, isSizeMedia);
5831
- if (importanceBump && (importance = (importance || 0) + importanceBump), process.env.NODE_ENV === "development" && debugProp === "verbose" && (0, import_log.log)(`mergeMediaByImportance ${key} importance existing ${importancesUsed[key]} next ${importance}`), importance === null) return !1;
5832
- if (importancesUsed[key] = importance, key in import_pseudoDescriptors.pseudoDescriptors) {
5961
+ function mergeMediaByImportance(styleState, mediaKey, key, value, usedKeys, isSizeMedia, importanceBump, debugProp) {
5962
+ var importance = (0, import_useMedia.getMediaImportanceIfMoreImportant)(mediaKey, key, usedKeys, isSizeMedia);
5963
+ if (importanceBump && (importance = (importance || 0) + importanceBump), process.env.NODE_ENV === "development" && debugProp === "verbose" && (0, import_log.log)(`mergeMediaByImportance ${key} importance usedKey ${usedKeys[key]} next ${importance}`), importance === null) return !1;
5964
+ if (usedKeys[key] = importance, key in import_pseudoDescriptors.pseudoDescriptors) {
5833
5965
  var descriptor = import_pseudoDescriptors.pseudoDescriptors[key], descriptorKey = descriptor.stateKey || descriptor.name, isDisabled = styleState.componentState[descriptorKey] === !1;
5834
5966
  if (isDisabled) return !1;
5835
- for (var subKey in value) mergeStyle(styleState, subKey, value[subKey]);
5836
- } else mergeStyle(styleState, key, value);
5967
+ for (var subKey in value) mergeStyle(styleState, subKey, value[subKey], importance);
5968
+ } else mergeStyle(styleState, key, value, importance);
5837
5969
  return !0;
5838
5970
  }
5839
5971
  function normalizeStyle(style) {
@@ -5846,7 +5978,7 @@ var require_getSplitStyles_native = __commonJS({
5846
5978
  }
5847
5979
  function applyDefaultStyle(pkey, styleState) {
5848
5980
  var defaultValues = animatableDefaults[pkey];
5849
- defaultValues != null && !(pkey in styleState.usedKeys) && (!styleState.style || !(pkey in styleState.style)) && mergeStyle(styleState, pkey, defaultValues);
5981
+ defaultValues != null && !(pkey in styleState.usedKeys) && (!styleState.style || !(pkey in styleState.style)) && mergeStyle(styleState, pkey, defaultValues, 1);
5850
5982
  }
5851
5983
  }
5852
5984
  });
@@ -5967,84 +6099,6 @@ var require_setElementProps_native = __commonJS({
5967
6099
  }
5968
6100
  });
5969
6101
 
5970
- // ../../packages/is-equal-shallow/dist/cjs/index.native.js
5971
- var require_index_native6 = __commonJS({
5972
- "../../packages/is-equal-shallow/dist/cjs/index.native.js"(exports2, module2) {
5973
- "use strict";
5974
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
5975
- for (var name in all) __defProp2(target, name, {
5976
- get: all[name],
5977
- enumerable: !0
5978
- });
5979
- }, __copyProps2 = function(to, from, except, desc) {
5980
- var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
5981
- if (from && typeof from == "object" || typeof from == "function") try {
5982
- for (var _loop = function() {
5983
- var key = _step.value;
5984
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
5985
- get: function() {
5986
- return from[key];
5987
- },
5988
- enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
5989
- });
5990
- }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
5991
- } catch (err) {
5992
- _didIteratorError = !0, _iteratorError = err;
5993
- } finally {
5994
- try {
5995
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
5996
- } finally {
5997
- if (_didIteratorError)
5998
- throw _iteratorError;
5999
- }
6000
- }
6001
- return to;
6002
- }, __toCommonJS2 = function(mod) {
6003
- return __copyProps2(__defProp2({}, "__esModule", {
6004
- value: !0
6005
- }), mod);
6006
- }, index_exports2 = {};
6007
- __export2(index_exports2, {
6008
- isEqualShallow: function() {
6009
- return isEqualShallow;
6010
- },
6011
- mergeIfNotShallowEqual: function() {
6012
- return mergeIfNotShallowEqual;
6013
- },
6014
- useCreateShallowSetState: function() {
6015
- return useCreateShallowSetState;
6016
- }
6017
- });
6018
- module2.exports = __toCommonJS2(index_exports2);
6019
- var import_react3 = require("react");
6020
- function useCreateShallowSetState(setter, debugIn) {
6021
- return (0, import_react3.useCallback)(function(next) {
6022
- setter(function(prev) {
6023
- return mergeIfNotShallowEqual(prev, next, debugIn);
6024
- });
6025
- }, [
6026
- setter,
6027
- debugIn
6028
- ]);
6029
- }
6030
- function mergeIfNotShallowEqual(prev, next, debug) {
6031
- if (!prev || !next || isEqualShallow(prev, next)) return prev || next;
6032
- if (process.env.NODE_ENV === "development" && debug && (console.info("setStateShallow CHANGE", {
6033
- prev,
6034
- next
6035
- }), debug === "break")) debugger;
6036
- return {
6037
- ...prev,
6038
- ...next
6039
- };
6040
- }
6041
- function isEqualShallow(prev, next) {
6042
- for (var key in next) if (prev[key] !== next[key]) return !1;
6043
- return !0;
6044
- }
6045
- }
6046
- });
6047
-
6048
6102
  // ../web/dist/cjs/helpers/subscribeToContextGroup.native.js
6049
6103
  var require_subscribeToContextGroup_native = __commonJS({
6050
6104
  "../web/dist/cjs/helpers/subscribeToContextGroup.native.js"(exports2, module2) {
@@ -6088,31 +6142,58 @@ var require_subscribeToContextGroup_native = __commonJS({
6088
6142
  }
6089
6143
  });
6090
6144
  module2.exports = __toCommonJS2(subscribeToContextGroup_exports);
6091
- var import_useMedia = require_useMedia_native(), import_is_equal_shallow = require_index_native6(), subscribeToContextGroup = function(param) {
6092
- var { setStateShallow, pseudoGroups, mediaGroups, componentContext, state } = param;
6145
+ var import_is_equal_shallow = require_index_native5(), import_useMedia = require_useMedia_native(), subscribeToContextGroup = function(props) {
6146
+ var { pseudoGroups, mediaGroups, groupContext } = props;
6093
6147
  if (pseudoGroups || mediaGroups) {
6094
- var _componentContext_groups_subscribe, _componentContext_groups;
6095
- return process.env.NODE_ENV === "development" && !componentContext.groups && console.debug("No context group found"), (_componentContext_groups = componentContext.groups) === null || _componentContext_groups === void 0 || (_componentContext_groups_subscribe = _componentContext_groups.subscribe) === null || _componentContext_groups_subscribe === void 0 ? void 0 : _componentContext_groups_subscribe.call(_componentContext_groups, function(name, param2) {
6096
- var { layout, pseudo } = param2, _state_group, current = ((_state_group = state.group) === null || _state_group === void 0 ? void 0 : _state_group[name]) || {
6148
+ process.env.NODE_ENV === "development" && !groupContext && console.debug("No context group found");
6149
+ var disposables = /* @__PURE__ */ new Set();
6150
+ if (pseudoGroups) for (var _i = 0, _iter = [
6151
+ ...pseudoGroups
6152
+ ]; _i < _iter.length; _i++) {
6153
+ var name = _iter[_i];
6154
+ disposables.add(createGroupListener(name, props));
6155
+ }
6156
+ if (mediaGroups) for (var _i1 = 0, _iter1 = [
6157
+ ...mediaGroups
6158
+ ]; _i1 < _iter1.length; _i1++) {
6159
+ var name1 = _iter1[_i1];
6160
+ disposables.add(createGroupListener(name1, props));
6161
+ }
6162
+ return function() {
6163
+ disposables.forEach(function(d) {
6164
+ return d();
6165
+ });
6166
+ };
6167
+ }
6168
+ }, createGroupListener = function(name, param) {
6169
+ var { setStateShallow, pseudoGroups, mediaGroups, groupContext } = param, parent = groupContext == null ? void 0 : groupContext[name];
6170
+ return parent ? parent.subscribe(function(param2) {
6171
+ var { layout, pseudo } = param2;
6172
+ setStateShallow(function(prev) {
6173
+ var _prev_group, didChange = !1, group = ((_prev_group = prev.group) === null || _prev_group === void 0 ? void 0 : _prev_group[name]) || {
6097
6174
  pseudo: {},
6098
6175
  media: {}
6099
6176
  };
6100
- if (pseudo && pseudoGroups != null && pseudoGroups.has(String(name))) Object.assign(current.pseudo, pseudo), persist();
6101
- else if (layout && mediaGroups) {
6102
- var mediaState2 = (0, import_useMedia.getMediaState)(mediaGroups, layout), next = (0, import_is_equal_shallow.mergeIfNotShallowEqual)(current.media || {}, mediaState2);
6103
- next !== current.media && (Object.assign(current.media, next), persist());
6104
- }
6105
- function persist() {
6106
- var group = {
6107
- ...state.group,
6108
- [name]: current
6109
- };
6110
- setStateShallow({
6111
- group
6112
- });
6177
+ if (pseudo && pseudoGroups != null && pseudoGroups.has(name)) {
6178
+ var _group;
6179
+ (_group = group).pseudo || (_group.pseudo = {});
6180
+ var next = (0, import_is_equal_shallow.mergeIfNotShallowEqual)(group.pseudo, pseudo);
6181
+ next !== group.pseudo && (Object.assign(group.pseudo, pseudo), didChange = !0);
6182
+ } else if (layout && mediaGroups) {
6183
+ var _group1;
6184
+ (_group1 = group).media || (_group1.media = {});
6185
+ var mediaState2 = (0, import_useMedia.getMediaState)(mediaGroups, layout), next1 = (0, import_is_equal_shallow.mergeIfNotShallowEqual)(group.media, mediaState2);
6186
+ next1 !== group.media && (Object.assign(group.media, next1), didChange = !0);
6113
6187
  }
6188
+ return didChange ? {
6189
+ group: {
6190
+ ...prev.group,
6191
+ [name]: group
6192
+ }
6193
+ } : prev;
6114
6194
  });
6115
- }
6195
+ }) : function() {
6196
+ };
6116
6197
  };
6117
6198
  }
6118
6199
  });
@@ -6206,7 +6287,7 @@ var require_useThemeState_native = __commonJS({
6206
6287
  var _keys_current, _props_needsUpdate, local = localStates.get(id), needsUpdate = isRoot || props.name === "light" || props.name === "dark" || props.name === null ? !0 : HasRenderedOnce.get(keys) ? !(keys == null || (_keys_current = keys.current) === null || _keys_current === void 0) && _keys_current.size ? !0 : (_props_needsUpdate = props.needsUpdate) === null || _props_needsUpdate === void 0 ? void 0 : _props_needsUpdate.call(props) : !0, [rerender, next] = getNextState(local, props, propsKey, isRoot, id, parentId, needsUpdate, PendingUpdate.get(id));
6207
6288
  return PendingUpdate.delete(id), (!local || rerender) && (local = {
6208
6289
  ...next
6209
- }, localStates.set(id, local)), process.env.NODE_ENV === "development" && props.debug && props.debug !== "profile" && (console.groupCollapsed(` ${id} \u{1FA84} ${rerender}`, local.name, ">", next.name), console.info({
6290
+ }, localStates.set(id, local)), process.env.NODE_ENV === "development" && props.debug && props.debug !== "profile" && (console.groupCollapsed(` ${id} getSnapshot ${rerender}`, local.name, ">", next.name), console.info({
6210
6291
  props,
6211
6292
  propsKey,
6212
6293
  isRoot,
@@ -6241,7 +6322,7 @@ var require_useThemeState_native = __commonJS({
6241
6322
  themes || (themes = (0, import_config.getConfig)().themes);
6242
6323
  var name = !propsKey && (!lastState || !(lastState != null && lastState.isNew)) ? null : getNewThemeName(parentState == null ? void 0 : parentState.name, props, pendingUpdate === "force" ? !0 : !!needsUpdate), isSameAsParent = parentState && (!name || name === parentState.name), shouldRerender = !!(needsUpdate && (pendingUpdate || (lastState == null ? void 0 : lastState.name) !== (parentState == null ? void 0 : parentState.name)));
6243
6324
  if (process.env.NODE_ENV === "development" && debug && debug !== "profile") {
6244
- var message = ` \xB7 useTheme(${id}) => ${name} needsUpdate ${needsUpdate} shouldRerender ${shouldRerender}`;
6325
+ var message = ` \xB7 useTheme(${id}) getNextState => ${name} needsUpdate ${needsUpdate} shouldRerender ${shouldRerender}`;
6245
6326
  console.info(message);
6246
6327
  }
6247
6328
  if (isSameAsParent) return [
@@ -7111,8 +7192,8 @@ var require_useComponentState_native = __commonJS({
7111
7192
  }
7112
7193
  });
7113
7194
  module2.exports = __toCommonJS2(useComponentState_exports);
7114
- var import_constants = require_index_native2(), import_is_equal_shallow = require_index_native6(), import_use_did_finish_ssr = require_index_native7(), import_react3 = require("react"), import_defaultComponentState = require_defaultComponentState_native(), import_isObj = require_isObj_native(), import_log = require_log_native(), useComponentState = function(props, param, staticConfig, config) {
7115
- var { animationDriver } = param, _animationDriver_usePresence, isHydrated = (0, import_use_did_finish_ssr.useDidFinishSSR)(), needsHydration = !(0, import_use_did_finish_ssr.useIsClientOnly)(), [startedUnhydrated] = (0, import_react3.useState)(needsHydration && !isHydrated), useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, stateRef = (0, import_react3.useRef)(void 0);
7195
+ var import_constants = require_index_native2(), import_is_equal_shallow = require_index_native5(), import_use_did_finish_ssr = require_index_native7(), import_react3 = require("react"), import_defaultComponentState = require_defaultComponentState_native(), import_isObj = require_isObj_native(), import_log = require_log_native(), useComponentState = function(props, animationDriver, staticConfig, config) {
7196
+ var _animationDriver_usePresence, isHydrated = (0, import_use_did_finish_ssr.useDidFinishSSR)(), needsHydration = !(0, import_use_did_finish_ssr.useIsClientOnly)(), [startedUnhydrated] = (0, import_react3.useState)(needsHydration && !isHydrated), useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, stateRef = (0, import_react3.useRef)(void 0);
7116
7197
  stateRef.current || (stateRef.current = {});
7117
7198
  var hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSS = animationDriver == null ? void 0 : animationDriver.supportsCSS, curStateRef = stateRef.current;
7118
7199
  !needsHydration && hasAnimationProp && (curStateRef.hasAnimated = !0);
@@ -7136,7 +7217,7 @@ var require_useComponentState_native = __commonJS({
7136
7217
  ...states[0],
7137
7218
  [props.forceStyle]: !0
7138
7219
  } : states[0], setState = states[1];
7139
- stateRef.current.nextComponentState && (Object.assign(state, stateRef.current.nextComponentState), stateRef.current.nextComponentState = void 0);
7220
+ stateRef.current.nextComponentState && Object.assign(state, stateRef.current.nextComponentState);
7140
7221
  var isAnimated = willBeAnimated;
7141
7222
  import_constants.isWeb && hasAnimationThatNeedsHydrate && !staticConfig.isHOC && !isHydrated && (isAnimated = !1, curStateRef.willHydrate = !0), disabled !== state.disabled && (disabled && Object.assign(state, import_defaultComponentState.defaultComponentStateMounted), state.disabled = disabled, setState(function(_) {
7142
7223
  return {
@@ -7160,46 +7241,6 @@ var require_useComponentState_native = __commonJS({
7160
7241
  isClassNameDisabled
7161
7242
  }));
7162
7243
  }
7163
- if (groupName && !curStateRef.group) {
7164
- var listeners = /* @__PURE__ */ new Set();
7165
- curStateRef.group = {
7166
- listeners,
7167
- emit(name, state2) {
7168
- listeners.forEach(function(l) {
7169
- return l(name, state2);
7170
- });
7171
- },
7172
- subscribe(cb) {
7173
- return listeners.add(cb), setStateShallow({
7174
- hasDynGroupChildren: !0
7175
- }), function() {
7176
- listeners.delete(cb), listeners.size === 0 && setStateShallow({
7177
- hasDynGroupChildren: !1
7178
- });
7179
- };
7180
- }
7181
- };
7182
- }
7183
- if (!curStateRef.stateEmitter && hasAnimationProp) {
7184
- var listeners1 = /* @__PURE__ */ new Set();
7185
- curStateRef.stateEmitter = {
7186
- listeners: listeners1,
7187
- emit(state2) {
7188
- listeners1.forEach(function(l) {
7189
- return l(state2);
7190
- });
7191
- },
7192
- subscribe(cb) {
7193
- return listeners1.add(cb), setStateShallow({
7194
- hasDynGroupChildren: !0
7195
- }), function() {
7196
- listeners1.delete(cb), listeners1.size === 0 && setStateShallow({
7197
- hasDynGroupChildren: !1
7198
- });
7199
- };
7200
- }
7201
- };
7202
- }
7203
7244
  return {
7204
7245
  startedUnhydrated,
7205
7246
  curStateRef,
@@ -7449,17 +7490,26 @@ var require_createComponent_native = __commonJS({
7449
7490
  }
7450
7491
  });
7451
7492
  module2.exports = __toCommonJS2(createComponent_exports);
7452
- var import_jsx_runtime2 = require("react/jsx-runtime"), import_compose_refs = require_index_native4(), import_constants = require_index_native2(), import_helpers2 = require_index_native3(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_constants2 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_ComponentContext = require_ComponentContext_native(), import_createVariable = require_createVariable_native(), import_defaultComponentState = require_defaultComponentState_native(), import_getShorthandValue = require_getShorthandValue_native(), import_getSplitStyles = require_getSplitStyles_native(), import_log = require_log_native(), import_mergeProps = require_mergeProps_native(), import_setElementProps = require_setElementProps_native(), import_subscribeToContextGroup = require_subscribeToContextGroup_native(), import_themeable = require_themeable_native(), import_wrapStyleTags = require_wrapStyleTags_native(), import_useComponentState = require_useComponentState_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native(), import_setupHooks = require_setupHooks_native(), import_Slot = require_Slot_native(), import_Theme = require_Theme_native(), time2, debugKeyListeners, startVisualizer, componentSetStates = /* @__PURE__ */ new Set();
7493
+ var import_jsx_runtime2 = require("react/jsx-runtime"), import_compose_refs = require_index_native4(), import_constants = require_index_native2(), import_helpers2 = require_index_native3(), import_is_equal_shallow = require_index_native5(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_constants2 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_ComponentContext = require_ComponentContext_native(), import_GroupContext = require_GroupContext_native(), import_createVariable = require_createVariable_native(), import_defaultComponentState = require_defaultComponentState_native(), import_getShorthandValue = require_getShorthandValue_native(), import_getSplitStyles = require_getSplitStyles_native(), import_log = require_log_native(), import_mergeProps = require_mergeProps_native(), import_setElementProps = require_setElementProps_native(), import_subscribeToContextGroup = require_subscribeToContextGroup_native(), import_themeable = require_themeable_native(), import_wrapStyleTags = require_wrapStyleTags_native(), import_useComponentState = require_useComponentState_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native(), import_setupHooks = require_setupHooks_native(), import_Slot = require_Slot_native(), import_Theme = require_Theme_native(), time2, debugKeyListeners, startVisualizer, componentSetStates = /* @__PURE__ */ new Set(), avoidReRenderKeys = /* @__PURE__ */ new Set([
7494
+ "hover",
7495
+ "press",
7496
+ "pressIn",
7497
+ "group",
7498
+ "focus",
7499
+ "focusWithin",
7500
+ "media",
7501
+ "group"
7502
+ ]);
7453
7503
  if (0) var cancelTouches;
7454
7504
  var BaseText, BaseView, hasSetupBaseViews = !1, lastInteractionWasKeyboard = {
7455
7505
  value: !1
7456
7506
  };
7457
7507
  import_constants.isWeb && globalThis.document && (document.addEventListener("keydown", function() {
7458
- lastInteractionWasKeyboard.value = !0;
7508
+ lastInteractionWasKeyboard.value || (lastInteractionWasKeyboard.value = !0);
7459
7509
  }), document.addEventListener("mousedown", function() {
7460
- lastInteractionWasKeyboard.value = !1;
7510
+ lastInteractionWasKeyboard.value && (lastInteractionWasKeyboard.value = !1);
7461
7511
  }), document.addEventListener("mousemove", function() {
7462
- lastInteractionWasKeyboard.value = !1;
7512
+ lastInteractionWasKeyboard.value && (lastInteractionWasKeyboard.value = !1);
7463
7513
  }));
7464
7514
  function createComponent(staticConfig) {
7465
7515
  var _staticConfig_defaultProps, { componentName } = staticConfig, config = null, defaultProps = staticConfig.defaultProps;
@@ -7490,7 +7540,7 @@ var require_createComponent_native = __commonJS({
7490
7540
  var _propsIn_datatestrenders, _current, _;
7491
7541
  (_ = (_propsIn_datatestrenders = propsIn["data-test-renders"])[_current = "current"]) !== null && _ !== void 0 || (_propsIn_datatestrenders[_current] = 0), propsIn["data-test-renders"].current += 1;
7492
7542
  }
7493
- var componentContext = import_react3.default.useContext(import_ComponentContext.ComponentContext), styledContextProps, overriddenContextProps, contextValue, { context, isReactNative } = staticConfig;
7543
+ var styledContextProps, overriddenContextProps, contextValue, { context, isReactNative } = staticConfig;
7494
7544
  if (context && (contextValue = import_react3.default.useContext(context), contextValue)) {
7495
7545
  process.env.NODE_ENV === "development" && (propsIn == null ? void 0 : propsIn.debug) === "verbose" && (0, import_log.log)(" \u{1F447} contextValue", contextValue);
7496
7546
  for (var key in context.props) {
@@ -7515,7 +7565,7 @@ var require_createComponent_native = __commonJS({
7515
7565
  var componentName2 = props.componentName || staticConfig.componentName;
7516
7566
  process.env.NODE_ENV === "development" && import_constants.isClient && import_react3.default.useEffect(function() {
7517
7567
  var overlay = null, debugVisualizerHandler = function() {
7518
- var show = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, node = curStateRef.host;
7568
+ var show = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, node = stateRef.current.host;
7519
7569
  if (node) if (show) {
7520
7570
  overlay = document.createElement("span"), overlay.style.inset = "0px", overlay.style.zIndex = "1000000", overlay.style.position = "absolute", overlay.style.borderColor = "red", overlay.style.borderWidth = "1px", overlay.style.borderStyle = "dotted";
7521
7571
  var dataAt = node.getAttribute("data-at") || "", dataIn = node.getAttribute("data-in") || "", tooltip = document.createElement("span");
@@ -7528,8 +7578,52 @@ var require_createComponent_native = __commonJS({
7528
7578
  }, [
7529
7579
  componentName2
7530
7580
  ]);
7531
- var animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, componentState = (0, import_useComponentState.useComponentState)(props, componentContext, staticConfig, config), { curStateRef, disabled, groupName, hasAnimationProp, hasEnterStyle, isAnimated, isExiting, isHydrated, presence, presenceState, setState, noClass, state, stateRef, supportsCSS, willBeAnimated, willBeAnimatedClient, startedUnhydrated } = componentState, setStateShallow = componentState.setStateShallow;
7532
- process.env.NODE_ENV === "development" && time2 && time2`use-state`;
7581
+ var componentContext = import_react3.default.useContext(import_ComponentContext.ComponentContext), groupContextParent = import_react3.default.useContext(import_GroupContext.GroupContext), animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, componentState = (0, import_useComponentState.useComponentState)(props, animationDriver, staticConfig, config), { disabled, groupName, hasAnimationProp, hasEnterStyle, isAnimated, isExiting, isHydrated, presence, presenceState, setState, noClass, state, stateRef, supportsCSS, willBeAnimated, willBeAnimatedClient, startedUnhydrated } = componentState, allGroupContexts = (0, import_react3.useMemo)(function() {
7582
+ var _stateRef_current_group;
7583
+ if (!groupName) return groupContextParent;
7584
+ (_stateRef_current_group = stateRef.current.group) === null || _stateRef_current_group === void 0 || _stateRef_current_group.listeners.clear();
7585
+ var listeners = /* @__PURE__ */ new Set();
7586
+ return stateRef.current.group = {
7587
+ listeners,
7588
+ emit(state2) {
7589
+ listeners.forEach(function(l) {
7590
+ return l(state2);
7591
+ });
7592
+ },
7593
+ subscribe(cb) {
7594
+ return listeners.add(cb), listeners.size === 1 && setStateShallow({
7595
+ hasDynGroupChildren: !0
7596
+ }), function() {
7597
+ listeners.delete(cb), listeners.size === 0 && setStateShallow({
7598
+ hasDynGroupChildren: !1
7599
+ });
7600
+ };
7601
+ }
7602
+ }, {
7603
+ ...groupContextParent,
7604
+ [groupName]: {
7605
+ state: {
7606
+ pseudo: import_defaultComponentState.defaultComponentStateMounted
7607
+ },
7608
+ subscribe: function(listener) {
7609
+ var _stateRef_current_group2, dispose = (_stateRef_current_group2 = stateRef.current.group) === null || _stateRef_current_group2 === void 0 ? void 0 : _stateRef_current_group2.subscribe(listener);
7610
+ return function() {
7611
+ dispose == null || dispose();
7612
+ };
7613
+ }
7614
+ }
7615
+ };
7616
+ }, [
7617
+ stateRef,
7618
+ groupName,
7619
+ groupContextParent
7620
+ ]), setStateShallow = componentState.setStateShallow, pendingState = stateRef.current.nextComponentState;
7621
+ pendingState && (stateRef.current.nextComponentState = void 0, componentState.setState(function(prev) {
7622
+ return {
7623
+ ...prev,
7624
+ ...pendingState
7625
+ };
7626
+ })), process.env.NODE_ENV === "development" && time2 && time2`use-state`;
7533
7627
  var hasTextAncestor = !!(import_constants.isWeb && isText && componentContext.inText), isTaggable = !Component || typeof Component == "string", tagProp = props.tag, element = import_constants.isWeb && isTaggable && tagProp || Component, BaseTextComponent = BaseText || element || "span", BaseViewComponent = BaseView || element || (hasTextAncestor ? "span" : "div"), elementType = isText ? BaseTextComponent : BaseViewComponent;
7534
7628
  animationDriver && isAnimated && // this should really be behind another prop as it's not really related to
7535
7629
  // "needsWebStyles" basically with motion we just animate a plain div, but
@@ -7537,14 +7631,14 @@ var require_createComponent_native = __commonJS({
7537
7631
  // things declaratively
7538
7632
  !animationDriver.needsWebStyles && (elementType = animationDriver[isText ? "Text" : "View"] || elementType);
7539
7633
  var disableThemeProp = !1, disableTheme = disableThemeProp || isHOC;
7540
- process.env.NODE_ENV === "development" && time2 && time2`theme-props`, props.themeShallow && (curStateRef.themeShallow = !0);
7634
+ process.env.NODE_ENV === "development" && time2 && time2`theme-props`, props.themeShallow && (stateRef.current.themeShallow = !0);
7541
7635
  var themeStateProps = {
7542
7636
  componentName: componentName2,
7543
7637
  disable: disableTheme,
7544
- shallow: curStateRef.themeShallow,
7638
+ shallow: stateRef.current.themeShallow,
7545
7639
  debug: debugProp
7546
7640
  };
7547
- if ("themeInverse" in props && (themeStateProps.inverse = props.themeInverse), "theme" in props && (themeStateProps.name = props.theme), typeof curStateRef.isListeningToTheme == "boolean" && (themeStateProps.needsUpdate = function() {
7641
+ if ("themeInverse" in props && (themeStateProps.inverse = props.themeInverse), "theme" in props && (themeStateProps.name = props.theme), typeof stateRef.current.isListeningToTheme == "boolean" && (themeStateProps.needsUpdate = function() {
7548
7642
  return !!stateRef.current.isListeningToTheme;
7549
7643
  }), themeStateProps.deopt = willBeAnimated, process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
7550
7644
  var name = `${componentName2 || (Component == null ? void 0 : Component.displayName) || (Component == null ? void 0 : Component.name) || "[Unnamed Component]"}`, type = (hasEnterStyle ? "(hasEnter)" : " ") + (isAnimated ? "(animated)" : " ") + (isReactNative ? "(rnw)" : " ") + (noClass ? "(noClass)" : " ") + (state.press || state.pressIn ? "(PRESSED)" : " ") + (state.hover ? "(HOVERED)" : " ") + (state.focus ? "(FOCUSED)" : " ") + (state.focusWithin ? "(WITHIN FOCUSED)" : " ") + ((presenceState == null ? void 0 : presenceState.isPresent) === !1 ? "(EXIT)" : ""), dataIs = propsIn["data-is"] || "", banner = `<${name} /> ${internalID} ${dataIs ? ` ${dataIs}` : ""} ${type.trim()}`;
@@ -7564,7 +7658,8 @@ var require_createComponent_native = __commonJS({
7564
7658
  themeStateProps
7565
7659
  }), (0, import_log.log)({
7566
7660
  contextProps: styledContextProps,
7567
- overriddenContextProps
7661
+ overriddenContextProps,
7662
+ componentContext
7568
7663
  }), (0, import_log.log)({
7569
7664
  presence,
7570
7665
  isAnimated,
@@ -7593,33 +7688,53 @@ var require_createComponent_native = __commonJS({
7593
7688
  noMergeStyle: isAnimated && (animationDriver == null ? void 0 : animationDriver.needsWebStyles)
7594
7689
  }, themeName = (themeState == null ? void 0 : themeState.name) || "";
7595
7690
  process.env.NODE_ENV === "development" && time2 && time2`split-styles-prepare`;
7596
- var splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, themeName, state, styleProps, null, componentContext, elementType, startedUnhydrated, debugProp);
7597
- if (hasAnimationProp && animationDriver != null && animationDriver.avoidReRenders) {
7598
- var styleListener = stateRef.current.useStyleListener, ogSetStateShallow = setStateShallow;
7599
- setStateShallow = function(next) {
7600
- var avoidReRenderKeys = /* @__PURE__ */ new Set([
7601
- "hover",
7602
- "press",
7603
- "pressIn"
7604
- ]), canAvoidReRender = Object.keys(next).every(function(key3) {
7605
- return avoidReRenderKeys.has(key3);
7691
+ var splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, themeName, state, styleProps, null, componentContext, allGroupContexts, elementType, startedUnhydrated, debugProp), groupContext = groupName && (allGroupContexts == null ? void 0 : allGroupContexts[groupName]) || null;
7692
+ if (groupContext) {
7693
+ var groupState = groupContext == null ? void 0 : groupContext.state;
7694
+ if (groupState && groupState.layout === void 0) {
7695
+ var _splitStyles_style, _splitStyles_style1;
7696
+ (!((_splitStyles_style = splitStyles.style) === null || _splitStyles_style === void 0) && _splitStyles_style.width || !((_splitStyles_style1 = splitStyles.style) === null || _splitStyles_style1 === void 0) && _splitStyles_style1.height) && (groupState.layout = {
7697
+ width: fromPx(splitStyles.style.width),
7698
+ height: fromPx(splitStyles.style.height)
7606
7699
  });
7607
- if (canAvoidReRender && styleListener) {
7608
- var updatedState = {
7609
- ...state,
7610
- ...next
7611
- };
7612
- stateRef.current.nextComponentState = updatedState;
7613
- var nextStyles = (0, import_getSplitStyles.getSplitStyles)(props, staticConfig, theme, themeName, updatedState, styleProps, null, componentContext, elementType, startedUnhydrated, debugProp);
7614
- styleListener(nextStyles.style);
7615
- } else ogSetStateShallow(next);
7700
+ }
7701
+ }
7702
+ if ((hasAnimationProp || groupName) && animationDriver != null && animationDriver.avoidReRenders) {
7703
+ var styleListener = stateRef.current.useStyleListener, ogSetStateShallow = setStateShallow;
7704
+ stateRef.current.setStateShallow = function(nextOrGetNext) {
7705
+ var prev = stateRef.current.nextComponentState || state, next = typeof nextOrGetNext == "function" ? nextOrGetNext(prev) : nextOrGetNext;
7706
+ if (!(next === prev || (0, import_is_equal_shallow.isEqualShallow)(prev, next))) {
7707
+ var canAvoidReRender = Object.keys(next).every(function(key3) {
7708
+ return avoidReRenderKeys.has(key3);
7709
+ });
7710
+ if (canAvoidReRender) {
7711
+ var updatedState = {
7712
+ ...prev,
7713
+ ...next
7714
+ };
7715
+ stateRef.current.nextComponentState = updatedState, process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile" && (console.groupCollapsed("[\u26A1\uFE0F] avoid setState", next, {
7716
+ updatedState,
7717
+ props
7718
+ }), console.info(stateRef.current.host), console.groupEnd());
7719
+ var { group, hasDynGroupChildren, unmounted, animation, ...childrenGroupState } = updatedState;
7720
+ if (groupContext && notifyGroupSubscribers(groupContext, stateRef.current.group || null, childrenGroupState), !hasAnimationProp || !styleListener) return;
7721
+ var nextStyles = (0, import_getSplitStyles.getSplitStyles)(props, staticConfig, theme, themeName, updatedState, styleProps, null, componentContext, allGroupContexts, elementType, startedUnhydrated, debugProp);
7722
+ styleListener(nextStyles.style);
7723
+ } else process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile" && console.info("[\u{1F40C}] re-render", {
7724
+ canAvoidReRender,
7725
+ next
7726
+ }), ogSetStateShallow(next);
7727
+ }
7728
+ }, setStateShallow = function(state2) {
7729
+ var _stateRef_current_setStateShallow, _stateRef_current;
7730
+ (_stateRef_current_setStateShallow = (_stateRef_current = stateRef.current).setStateShallow) === null || _stateRef_current_setStateShallow === void 0 || _stateRef_current_setStateShallow.call(_stateRef_current, state2);
7616
7731
  };
7617
7732
  }
7618
- if (process.env.NODE_ENV === "development" && time2 && time2`split-styles`, props.group && props.untilMeasured === "hide" && !curStateRef.hasMeasured) {
7733
+ if (process.env.NODE_ENV === "development" && time2 && time2`split-styles`, props.group && props.untilMeasured === "hide" && !stateRef.current.hasMeasured) {
7619
7734
  var _splitStyles;
7620
7735
  (_splitStyles = splitStyles).style || (_splitStyles.style = {}), splitStyles.style.opacity = 0;
7621
7736
  }
7622
- curStateRef.isListeningToTheme = splitStyles.dynamicThemeAccess;
7737
+ splitStyles.dynamicThemeAccess != null && (stateRef.current.isListeningToTheme = splitStyles.dynamicThemeAccess);
7623
7738
  var hasRuntimeMediaKeys = splitStyles.hasMedia && splitStyles.hasMedia !== !0, shouldListenForMedia = (0, import_createVariable.didGetVariableValue)() || hasRuntimeMediaKeys || noClass && splitStyles.hasMedia === !0, mediaListeningKeys = hasRuntimeMediaKeys ? splitStyles.hasMedia : null;
7624
7739
  process.env.NODE_ENV === "development" && debugProp === "verbose" && console.info("useMedia() createComponent", shouldListenForMedia, mediaListeningKeys), (0, import_useMedia.setMediaShouldUpdate)(componentContext, shouldListenForMedia, mediaListeningKeys);
7625
7740
  var { viewProps: viewPropsIn, pseudos, style: splitStylesStyle, classNames, space } = splitStyles, propsWithAnimation = props, {
@@ -7674,18 +7789,18 @@ var require_createComponent_native = __commonJS({
7674
7789
  }
7675
7790
  process.env.NODE_ENV === "development" && props.untilMeasured && !props.group && console.warn(`You set the untilMeasured prop without setting group. This doesn't work, be sure to set untilMeasured on the parent that sets group, not the children that use the $group- prop.
7676
7791
 
7677
- If you meant to do this, you can disable this warning - either change untilMeasured and group at the same time, or do group={conditional ? 'name' : undefined}`), process.env.NODE_ENV === "development" && time2 && time2`destructure`, groupName && (nonTamaguiProps.onLayout = (0, import_helpers2.composeEventHandlers)(nonTamaguiProps.onLayout, function(e) {
7678
- var layout = e.nativeEvent.layout;
7679
- stateRef.current.group.layout = layout, stateRef.current.group.emit(groupName, {
7792
+ If you meant to do this, you can disable this warning - either change untilMeasured and group at the same time, or do group={conditional ? 'name' : undefined}`), process.env.NODE_ENV === "development" && time2 && time2`destructure`, groupContext && (nonTamaguiProps.onLayout = (0, import_helpers2.composeEventHandlers)(nonTamaguiProps.onLayout, function(e) {
7793
+ var _stateRef_current_group, layout = e.nativeEvent.layout;
7794
+ groupContext.state.layout = layout, (_stateRef_current_group = stateRef.current.group) === null || _stateRef_current_group === void 0 || _stateRef_current_group.emit({
7680
7795
  layout
7681
7796
  }), !stateRef.current.hasMeasured && props.untilMeasured === "hide" && setState(function(prev) {
7682
7797
  return {
7683
7798
  ...prev
7684
7799
  };
7685
7800
  }), stateRef.current.hasMeasured = !0;
7686
- })), viewProps = ((_hooks_usePropsTransform = import_setupHooks.hooks.usePropsTransform) === null || _hooks_usePropsTransform === void 0 ? void 0 : _hooks_usePropsTransform.call(import_setupHooks.hooks, elementType, nonTamaguiProps, stateRef, curStateRef.willHydrate)) || nonTamaguiProps, curStateRef.composedRef || (curStateRef.composedRef = (0, import_compose_refs.composeRefs)(function(x) {
7801
+ })), viewProps = ((_hooks_usePropsTransform = import_setupHooks.hooks.usePropsTransform) === null || _hooks_usePropsTransform === void 0 ? void 0 : _hooks_usePropsTransform.call(import_setupHooks.hooks, elementType, nonTamaguiProps, stateRef, stateRef.current.willHydrate)) || nonTamaguiProps, stateRef.current.composedRef || (stateRef.current.composedRef = (0, import_compose_refs.composeRefs)(function(x) {
7687
7802
  return stateRef.current.host = x;
7688
- }, forwardedRef, import_setElementProps.setElementProps, animatedRef)), viewProps.ref = curStateRef.composedRef, process.env.NODE_ENV === "development" && !isReactNative && !isText && import_constants.isWeb && !isHOC && import_react3.default.Children.toArray(props.children).forEach(function(item) {
7803
+ }, forwardedRef, import_setElementProps.setElementProps, animatedRef)), viewProps.ref = stateRef.current.composedRef, process.env.NODE_ENV === "development" && !isReactNative && !isText && import_constants.isWeb && !isHOC && import_react3.default.Children.toArray(props.children).forEach(function(item) {
7689
7804
  typeof item == "string" && item !== `
7690
7805
  ` && console.error(`Unexpected text node: ${item}. A text node cannot be a child of a <${staticConfig.componentName || propsIn.tag || "View"}>.`, props);
7691
7806
  }), process.env.NODE_ENV === "development" && time2 && time2`events-hooks`;
@@ -7727,18 +7842,21 @@ If you meant to do this, you can disable this warning - either change untilMeasu
7727
7842
  });
7728
7843
  return;
7729
7844
  }
7730
- var dispose = !disabled && (pseudoGroups || mediaGroups) ? (0, import_subscribeToContextGroup.subscribeToContextGroup)({
7731
- componentContext,
7732
- setStateShallow,
7733
- state,
7734
- mediaGroups,
7735
- pseudoGroups
7736
- }) : null;
7737
7845
  return function() {
7738
- dispose == null || dispose(), componentSetStates.delete(setState);
7846
+ componentSetStates.delete(setState);
7739
7847
  };
7740
7848
  }, [
7741
7849
  state.unmounted,
7850
+ disabled
7851
+ ]), (0, import_constants.useIsomorphicLayoutEffect)(function() {
7852
+ if (!disabled && !(!pseudoGroups && !mediaGroups) && allGroupContexts) return (0, import_subscribeToContextGroup.subscribeToContextGroup)({
7853
+ groupContext: allGroupContexts,
7854
+ setStateShallow,
7855
+ mediaGroups,
7856
+ pseudoGroups
7857
+ });
7858
+ }, [
7859
+ allGroupContexts,
7742
7860
  disabled,
7743
7861
  pseudoGroups ? Object.keys([
7744
7862
  ...pseudoGroups
@@ -7746,24 +7864,15 @@ If you meant to do this, you can disable this warning - either change untilMeasu
7746
7864
  mediaGroups ? Object.keys([
7747
7865
  ...mediaGroups
7748
7866
  ]).join("") : 0
7749
- ]), (0, import_constants.useIsomorphicLayoutEffect)(function() {
7750
- var _curStateRef_group;
7751
- if (groupName) {
7752
- curStateRef.group.emit(groupName, {
7753
- pseudo: state,
7754
- layout: (_curStateRef_group = curStateRef.group) === null || _curStateRef_group === void 0 ? void 0 : _curStateRef_group.layout
7755
- });
7756
- var groupContextState = componentContext == null ? void 0 : componentContext.groups;
7757
- if (groupContextState) {
7758
- var next = {
7759
- ...groupContextState[groupName],
7760
- ...state
7761
- };
7762
- groupContextState[groupName] = next;
7763
- }
7764
- }
7867
+ ]), hasAnimationProp && animationDriver != null && animationDriver.avoidReRenders && (0, import_react3.useEffect)(function() {
7868
+ stateRef.current.nextComponentState = void 0;
7869
+ });
7870
+ var groupEmitter = stateRef.current.group;
7871
+ (0, import_constants.useIsomorphicLayoutEffect)(function() {
7872
+ !groupContext || !groupEmitter || notifyGroupSubscribers(groupContext, groupEmitter, state);
7765
7873
  }, [
7766
- groupName,
7874
+ groupContext,
7875
+ groupEmitter,
7767
7876
  state
7768
7877
  ]);
7769
7878
  var runtimePressStyle = !disabled && noClass && (pseudos == null ? void 0 : pseudos.pressStyle), runtimeFocusStyle = !disabled && noClass && (pseudos == null ? void 0 : pseudos.focusStyle), runtimeFocusVisibleStyle = !disabled && noClass && (pseudos == null ? void 0 : pseudos.focusVisibleStyle), attachFocus = !!(runtimePressStyle || runtimeFocusStyle || runtimeFocusVisibleStyle || onFocus || onBlur || componentContext.setParentFocusState), hasDynamicGroupChildren = !!(groupName && state.hasDynGroupChildren), attachPress = !!(hasDynamicGroupChildren || runtimePressStyle || onPress || onPressOut || onPressIn || onMouseDown || onMouseUp || onLongPress || onClick || pseudos != null && pseudos.focusVisibleStyle), runtimeHoverStyle = !disabled && noClass && (pseudos == null ? void 0 : pseudos.hoverStyle), needsHoverState = !!(hasDynamicGroupChildren || runtimeHoverStyle), attachHover = import_constants.isWeb && !!(hasDynamicGroupChildren || needsHoverState || onMouseEnter || onMouseLeave), shouldAttach = !disabled && !props.asChild && !!(attachFocus || attachPress || attachHover || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle), needsPressState = !!(hasDynamicGroupChildren || runtimePressStyle);
@@ -7790,7 +7899,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
7790
7899
  },
7791
7900
  onMouseLeave: function(e) {
7792
7901
  var next = {};
7793
- needsHoverState && (next.hover = !1), needsPressState && state.pressIn && (next.press = !1, next.pressIn = !1), setStateShallow(next), onHoverOut == null || onHoverOut(e), onMouseLeave == null || onMouseLeave(e);
7902
+ needsHoverState && (next.hover = !1), needsPressState && (next.press = !1, next.pressIn = !1), setStateShallow(next), onHoverOut == null || onHoverOut(e), onMouseLeave == null || onMouseLeave(e);
7794
7903
  }
7795
7904
  },
7796
7905
  onPressIn: attachPress ? function(e) {
@@ -7868,37 +7977,15 @@ If you meant to do this, you can disable this warning - either change untilMeasu
7868
7977
  var useChildrenResult;
7869
7978
  import_setupHooks.hooks.useChildren && (useChildrenResult = import_setupHooks.hooks.useChildren(elementType, content, viewProps)), process.env.NODE_ENV === "development" && time2 && time2`use-children`, useChildrenResult ? content = useChildrenResult : content = /* @__PURE__ */ import_react3.default.createElement(elementType, viewProps, content);
7870
7979
  var ResetPresence = config == null || (_config_animations = config.animations) === null || _config_animations === void 0 ? void 0 : _config_animations.ResetPresence;
7871
- ResetPresence && willBeAnimated && (hasEnterStyle || presenceState) && content && typeof content != "string" && (content = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ResetPresence, {
7980
+ if (ResetPresence && willBeAnimated && (hasEnterStyle || presenceState) && content && typeof content != "string" && (content = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ResetPresence, {
7872
7981
  children: content
7873
- })), process.env.NODE_ENV === "development" && time2 && time2`create-element`;
7874
- var groupState = curStateRef.group, subGroupContext = import_react3.default.useMemo(function() {
7875
- var _splitStyles_style, _splitStyles_style1;
7876
- if (!(!groupState || !groupName)) return groupState.listeners.clear(), {
7877
- ...componentContext.groups,
7878
- // change reference so as we mutate it doesn't affect siblings etc
7879
- state: {
7880
- ...componentContext.groups.state,
7881
- [groupName]: {
7882
- pseudo: import_defaultComponentState.defaultComponentStateMounted,
7883
- // capture just initial width and height if they exist
7884
- // will have top, left, width, height (not x, y)
7885
- layout: {
7886
- width: fromPx((_splitStyles_style = splitStyles.style) === null || _splitStyles_style === void 0 ? void 0 : _splitStyles_style.width),
7887
- height: fromPx((_splitStyles_style1 = splitStyles.style) === null || _splitStyles_style1 === void 0 ? void 0 : _splitStyles_style1.height)
7888
- }
7889
- }
7890
- },
7891
- emit: groupState.emit,
7892
- subscribe: groupState.subscribe
7893
- };
7894
- }, [
7895
- groupName
7896
- ]);
7897
- if (("group" in props || propsIn.focusWithinStyle) && (content = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_ComponentContext.ComponentContext.Provider, {
7982
+ })), process.env.NODE_ENV === "development" && time2 && time2`create-element`, "focusWithinStyle" in propsIn && (content = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_ComponentContext.ComponentContext.Provider, {
7898
7983
  ...componentContext,
7899
- groups: subGroupContext,
7900
7984
  setParentFocusState: setStateShallow,
7901
7985
  children: content
7986
+ })), "group" in propsIn && (content = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_GroupContext.GroupContext.Provider, {
7987
+ value: allGroupContexts,
7988
+ children: content
7902
7989
  })), process.env.NODE_ENV === "development" && time2 && time2`group-context`, content = disableTheme ? content : (0, import_Theme.getThemedChildren)(themeState, content, themeStateProps, !1, stateRef), process.env.NODE_ENV === "development" && time2 && time2`themed-children`, staticConfig.context) {
7903
7990
  var contextProps = staticConfig.context.props;
7904
7991
  for (var key1 in contextProps) if (viewProps.style && key1 in viewProps.style || key1 in viewProps) {
@@ -7925,6 +8012,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
7925
8012
  (0, import_log.log)("viewProps", viewProps), (0, import_log.log)("children", content), typeof window < "u" && (0, import_log.log)({
7926
8013
  propsIn,
7927
8014
  props,
8015
+ attachPress,
7928
8016
  animationStyles,
7929
8017
  classNames,
7930
8018
  content,
@@ -7963,6 +8051,15 @@ If you meant to do this, you can disable this warning - either change untilMeasu
7963
8051
  delete globalThis.willPrint, time2.print(), time2 = null;
7964
8052
  }, 50))), content;
7965
8053
  });
8054
+ function notifyGroupSubscribers(groupContext, groupEmitter, pseudo) {
8055
+ if (!(!groupContext || !groupEmitter)) {
8056
+ var nextState = {
8057
+ ...groupContext.state,
8058
+ pseudo
8059
+ };
8060
+ groupEmitter.emit(nextState), groupContext.state = nextState;
8061
+ }
8062
+ }
7966
8063
  staticConfig.componentName && (component.displayName = staticConfig.componentName);
7967
8064
  var res = component;
7968
8065
  (process.env.TAMAGUI_FORCE_MEMO || staticConfig.memo) && (res = /* @__PURE__ */ import_react3.default.memo(res)), res.staticConfig = staticConfig;
@@ -9736,13 +9833,8 @@ var require_useConfiguration_native = __commonJS({
9736
9833
  }
9737
9834
  });
9738
9835
  module2.exports = __toCommonJS2(useConfiguration_exports);
9739
- var import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_ComponentContext = require_ComponentContext_native(), useConfiguration = function() {
9740
- var { groups, animationDriver, ...restComponentConfig } = import_react3.default.useContext(import_ComponentContext.ComponentContext), { animations, ...restConfig } = (0, import_config.getConfig)();
9741
- return {
9742
- ...restConfig,
9743
- ...restComponentConfig,
9744
- animationDriver: animationDriver ?? (0, import_config.getConfig)().animations
9745
- };
9836
+ var import_react3 = __toESM2(require("react")), import_ComponentContext = require_ComponentContext_native(), useConfiguration = function() {
9837
+ return import_react3.default.useContext(import_ComponentContext.ComponentContext);
9746
9838
  };
9747
9839
  }
9748
9840
  });
@@ -9909,7 +10001,7 @@ var require_useProps_native = __commonJS({
9909
10001
  }
9910
10002
  });
9911
10003
  module2.exports = __toCommonJS2(useProps_exports);
9912
- var import_constants = require_index_native2(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_ComponentContext = require_ComponentContext_native(), import_getSplitStyles = require_getSplitStyles_native(), import_subscribeToContextGroup = require_subscribeToContextGroup_native(), import_Stack = require_Stack_native(), import_useComponentState = require_useComponentState_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native();
10004
+ var import_constants = require_index_native2(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_ComponentContext = require_ComponentContext_native(), import_GroupContext = require_GroupContext_native(), import_getSplitStyles = require_getSplitStyles_native(), import_subscribeToContextGroup = require_subscribeToContextGroup_native(), import_Stack = require_Stack_native(), import_useComponentState = require_useComponentState_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native();
9913
10005
  function useProps(props, opts) {
9914
10006
  var [propsOut, styleOut] = usePropsAndStyle(props, {
9915
10007
  ...opts,
@@ -9933,7 +10025,7 @@ var require_useProps_native = __commonJS({
9933
10025
  needsUpdate() {
9934
10026
  return !0;
9935
10027
  }
9936
- }), componentContext = import_react3.default.useContext(import_ComponentContext.ComponentContext), { state, disabled, setStateShallow } = (0, import_useComponentState.useComponentState)(props, componentContext, staticConfig, (0, import_config.getConfig)()), mediaStateNow = opts != null && opts.noMedia ? (
10028
+ }), componentContext = import_react3.default.useContext(import_ComponentContext.ComponentContext), groupContext = import_react3.default.useContext(import_GroupContext.GroupContext), { state, disabled, setStateShallow } = (0, import_useComponentState.useComponentState)(props, componentContext.animationDriver, staticConfig, (0, import_config.getConfig)()), mediaStateNow = opts != null && opts.noMedia ? (
9937
10029
  // not safe to use mediaState but really marginal to hit this
9938
10030
  import_useMedia.mediaState
9939
10031
  ) : (0, import_useMedia.useMedia)(), splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, (themeState == null ? void 0 : themeState.name) || "", state, {
@@ -9944,7 +10036,7 @@ var require_useProps_native = __commonJS({
9944
10036
  noClass: !0,
9945
10037
  resolveValues: "auto",
9946
10038
  ...opts
9947
- }, null, componentContext), { mediaGroups, pseudoGroups } = splitStyles;
10039
+ }, null, componentContext, groupContext), { mediaGroups, pseudoGroups } = splitStyles;
9948
10040
  return (0, import_constants.useIsomorphicLayoutEffect)(function() {
9949
10041
  if (!disabled) {
9950
10042
  if (state.unmounted) {
@@ -9953,16 +10045,16 @@ var require_useProps_native = __commonJS({
9953
10045
  });
9954
10046
  return;
9955
10047
  }
9956
- return (0, import_subscribeToContextGroup.subscribeToContextGroup)({
9957
- componentContext,
10048
+ if (groupContext) return (0, import_subscribeToContextGroup.subscribeToContextGroup)({
10049
+ groupContext,
9958
10050
  setStateShallow,
9959
- state,
9960
10051
  mediaGroups,
9961
10052
  pseudoGroups
9962
10053
  });
9963
10054
  }
9964
10055
  }, [
9965
10056
  disabled,
10057
+ groupContext,
9966
10058
  pseudoGroups ? Object.keys([
9967
10059
  ...pseudoGroups
9968
10060
  ]).join("") : 0,
@@ -10704,10 +10796,11 @@ var require_index_native9 = __commonJS({
10704
10796
  var import_config = require_config_native(), import_insertStyleRule = require_insertStyleRule_native();
10705
10797
  __reExport2(index_exports2, require_constants_native2(), module2.exports);
10706
10798
  __reExport2(index_exports2, require_ComponentContext_native(), module2.exports);
10799
+ __reExport2(index_exports2, require_GroupContext_native(), module2.exports);
10707
10800
  __reExport2(index_exports2, require_withStableStyle_native(), module2.exports);
10708
10801
  __reExport2(index_exports2, require_createMediaStyle_native(), module2.exports);
10709
10802
  __reExport2(index_exports2, require_getShorthandValue_native(), module2.exports);
10710
- __reExport2(index_exports2, require_index_native6(), module2.exports);
10803
+ __reExport2(index_exports2, require_index_native5(), module2.exports);
10711
10804
  var import_insertStyleRule2 = require_insertStyleRule_native();
10712
10805
  __reExport2(index_exports2, require_createStyledContext_native(), module2.exports);
10713
10806
  __reExport2(index_exports2, require_expandStyles_native(), module2.exports);
@@ -12203,7 +12296,7 @@ var require_index_native12 = __commonJS({
12203
12296
  }
12204
12297
  });
12205
12298
  module2.exports = __toCommonJS2(index_exports2);
12206
- var import_constants = require_index_native2(), import_is_equal_shallow = require_index_native6(), LayoutHandlers = /* @__PURE__ */ new WeakMap(), Nodes = /* @__PURE__ */ new Set(), strategy = "async";
12299
+ var import_constants = require_index_native2(), import_is_equal_shallow = require_index_native5(), LayoutHandlers = /* @__PURE__ */ new WeakMap(), Nodes = /* @__PURE__ */ new Set(), strategy = "async";
12207
12300
  function setOnLayoutStrategy2(state) {
12208
12301
  strategy = state;
12209
12302
  }
@@ -12245,7 +12338,9 @@ var require_index_native12 = __commonJS({
12245
12338
  } else nodeRect = node.getBoundingClientRect(), parentRect = parentNode.getBoundingClientRect();
12246
12339
  var cachedRect = NodeRectCache.get(node), cachedParentRect = NodeRectCache.get(parentNode);
12247
12340
  if (!cachedRect || // has changed one rect
12248
- !(0, import_is_equal_shallow.isEqualShallow)(cachedRect, nodeRect) && (!cachedParentRect || !(0, import_is_equal_shallow.isEqualShallow)(cachedParentRect, parentRect))) {
12341
+ // @ts-expect-error DOMRectReadOnly can go into object
12342
+ !(0, import_is_equal_shallow.isEqualShallow)(cachedRect, nodeRect) && // @ts-expect-error DOMRectReadOnly can go into object
12343
+ (!cachedParentRect || !(0, import_is_equal_shallow.isEqualShallow)(cachedParentRect, parentRect))) {
12249
12344
  NodeRectCache.set(node, nodeRect), ParentRectCache.set(parentNode, parentRect);
12250
12345
  var event = getElementLayoutEvent(nodeRect, parentRect);
12251
12346
  avoidUpdates ? queuedUpdates.set(node, function() {