tamagui 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
@@ -3549,6 +3549,81 @@ var require_index_native11 = __commonJS({
3549
3549
  }
3550
3550
  });
3551
3551
 
3552
+ // ../../packages/is-equal-shallow/dist/cjs/index.native.js
3553
+ var require_index_native12 = __commonJS({
3554
+ "../../packages/is-equal-shallow/dist/cjs/index.native.js"(exports2, module2) {
3555
+ "use strict";
3556
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
3557
+ for (var name in all) __defProp2(target, name, {
3558
+ get: all[name],
3559
+ enumerable: !0
3560
+ });
3561
+ }, __copyProps2 = function(to, from, except, desc) {
3562
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
3563
+ if (from && typeof from == "object" || typeof from == "function") try {
3564
+ for (var _loop = function() {
3565
+ var key = _step.value;
3566
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
3567
+ get: function() {
3568
+ return from[key];
3569
+ },
3570
+ enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
3571
+ });
3572
+ }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
3573
+ } catch (err) {
3574
+ _didIteratorError = !0, _iteratorError = err;
3575
+ } finally {
3576
+ try {
3577
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
3578
+ } finally {
3579
+ if (_didIteratorError)
3580
+ throw _iteratorError;
3581
+ }
3582
+ }
3583
+ return to;
3584
+ }, __toCommonJS2 = function(mod) {
3585
+ return __copyProps2(__defProp2({}, "__esModule", {
3586
+ value: !0
3587
+ }), mod);
3588
+ }, index_exports2 = {};
3589
+ __export2(index_exports2, {
3590
+ isEqualShallow: function() {
3591
+ return isEqualShallow;
3592
+ },
3593
+ mergeIfNotShallowEqual: function() {
3594
+ return mergeIfNotShallowEqual;
3595
+ },
3596
+ useCreateShallowSetState: function() {
3597
+ return useCreateShallowSetState;
3598
+ }
3599
+ });
3600
+ module2.exports = __toCommonJS2(index_exports2);
3601
+ var import_react3 = require("react");
3602
+ function useCreateShallowSetState(setter, debug) {
3603
+ return (0, import_react3.useCallback)(function(stateOrGetState) {
3604
+ setter(function(prev) {
3605
+ var next = typeof stateOrGetState == "function" ? stateOrGetState(prev) : stateOrGetState, update = mergeIfNotShallowEqual(prev, next);
3606
+ 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;
3607
+ return update;
3608
+ });
3609
+ }, [
3610
+ setter,
3611
+ debug
3612
+ ]);
3613
+ }
3614
+ function mergeIfNotShallowEqual(prev, next) {
3615
+ return !prev || !next || isEqualShallow(prev, next) ? prev || next : {
3616
+ ...prev,
3617
+ ...next
3618
+ };
3619
+ }
3620
+ function isEqualShallow(prev, next) {
3621
+ for (var key in next) if (prev[key] !== next[key]) return !1;
3622
+ return !0;
3623
+ }
3624
+ }
3625
+ });
3626
+
3552
3627
  // ../../core/web/dist/cjs/constants/isDevTools.native.js
3553
3628
  var require_isDevTools_native = __commonJS({
3554
3629
  "../../core/web/dist/cjs/constants/isDevTools.native.js"(exports2, module2) {
@@ -3796,13 +3871,55 @@ var require_ComponentContext_native = __commonJS({
3796
3871
  inText: !1,
3797
3872
  language: null,
3798
3873
  animationDriver: null,
3799
- setParentFocusState: null,
3800
- groups: {
3801
- emit: null,
3802
- subscribe: null,
3803
- state: {}
3874
+ setParentFocusState: null
3875
+ });
3876
+ }
3877
+ });
3878
+
3879
+ // ../../core/web/dist/cjs/contexts/GroupContext.native.js
3880
+ var require_GroupContext_native = __commonJS({
3881
+ "../../core/web/dist/cjs/contexts/GroupContext.native.js"(exports2, module2) {
3882
+ "use strict";
3883
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
3884
+ for (var name in all) __defProp2(target, name, {
3885
+ get: all[name],
3886
+ enumerable: !0
3887
+ });
3888
+ }, __copyProps2 = function(to, from, except, desc) {
3889
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
3890
+ if (from && typeof from == "object" || typeof from == "function") try {
3891
+ for (var _loop = function() {
3892
+ var key = _step.value;
3893
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
3894
+ get: function() {
3895
+ return from[key];
3896
+ },
3897
+ enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
3898
+ });
3899
+ }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
3900
+ } catch (err) {
3901
+ _didIteratorError = !0, _iteratorError = err;
3902
+ } finally {
3903
+ try {
3904
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
3905
+ } finally {
3906
+ if (_didIteratorError)
3907
+ throw _iteratorError;
3908
+ }
3909
+ }
3910
+ return to;
3911
+ }, __toCommonJS2 = function(mod) {
3912
+ return __copyProps2(__defProp2({}, "__esModule", {
3913
+ value: !0
3914
+ }), mod);
3915
+ }, GroupContext_exports = {};
3916
+ __export2(GroupContext_exports, {
3917
+ GroupContext: function() {
3918
+ return GroupContext2;
3804
3919
  }
3805
3920
  });
3921
+ module2.exports = __toCommonJS2(GroupContext_exports);
3922
+ var import_react3 = require("react"), GroupContext2 = /* @__PURE__ */ (0, import_react3.createContext)(null);
3806
3923
  }
3807
3924
  });
3808
3925
 
@@ -4711,7 +4828,7 @@ var require_normalize_color = __commonJS({
4711
4828
  });
4712
4829
 
4713
4830
  // ../../core/normalize-css-color/dist/cjs/index.native.js
4714
- var require_index_native12 = __commonJS({
4831
+ var require_index_native13 = __commonJS({
4715
4832
  "../../core/normalize-css-color/dist/cjs/index.native.js"(exports2, module2) {
4716
4833
  "use strict";
4717
4834
  var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
@@ -4834,7 +4951,7 @@ var require_normalizeColor_native = __commonJS({
4834
4951
  }
4835
4952
  });
4836
4953
  module2.exports = __toCommonJS2(normalizeColor_exports);
4837
- var import_normalize_css_color = require_index_native12(), import_normalize_css_color2 = require_index_native12(), normalizeColor = function(color, opacity) {
4954
+ var import_normalize_css_color = require_index_native13(), import_normalize_css_color2 = require_index_native13(), normalizeColor = function(color, opacity) {
4838
4955
  if (color) {
4839
4956
  if (color[0] === "$") return color;
4840
4957
  if (color.startsWith("var(")) {
@@ -6410,7 +6527,7 @@ var require_getSplitStyles_native = __commonJS({
6410
6527
  function isValidStyleKey(key, validStyles, accept) {
6411
6528
  return key in validStyles ? !0 : accept && key in accept;
6412
6529
  }
6413
- var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, componentContext, elementType, startedUnhydrated, debug) {
6530
+ var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, componentContext, groupContext, elementType, startedUnhydrated, debug) {
6414
6531
  var _loop = function(keyOg2) {
6415
6532
  var keyInit = keyOg2, valInit = props[keyInit];
6416
6533
  if (keyInit === "children") return viewProps[keyInit] = valInit, "continue";
@@ -6419,7 +6536,7 @@ var require_getSplitStyles_native = __commonJS({
6419
6536
  var accepted = accept[keyInit];
6420
6537
  if ((accepted === "style" || accepted === "textStyle") && valInit && typeof valInit == "object") return viewProps[keyInit] = getSubStyle(styleState, keyInit, valInit, styleProps.noClass), "continue";
6421
6538
  }
6422
- if (process.env.NODE_ENV, disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit === "className" || keyInit in usedKeys) return "continue";
6539
+ if (process.env.NODE_ENV, disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit === "className") return "continue";
6423
6540
  if (keyInit in import_skipProps.skipProps && !noSkip && !isHOC) {
6424
6541
  if (keyInit === "group" && !1) var identifier2, containerType, containerCSS;
6425
6542
  return "continue";
@@ -6444,7 +6561,7 @@ var require_getSplitStyles_native = __commonJS({
6444
6561
  parts.length === 2 || parts.length === 3 && import_pseudoDescriptors.pseudoPriorities[parts[parts.length - 1]]
6445
6562
  ) {
6446
6563
  var name2 = parts[1];
6447
- componentContext != null && componentContext.groups.subscribe && !(componentContext != null && componentContext.groups.state[name2]) && (keyInit = keyInit.replace("$group-", "$group-true-"));
6564
+ groupContext != null && groupContext[name2] || (keyInit = keyInit.replace("$group-", "$group-true-"));
6448
6565
  }
6449
6566
  }
6450
6567
  var isStyleProp = isValidStyleKeyInit || isMediaOrPseudo || isVariant && !noExpand;
@@ -6470,13 +6587,13 @@ var require_getSplitStyles_native = __commonJS({
6470
6587
  viewProps[key4] = val2;
6471
6588
  return;
6472
6589
  }
6473
- 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)) {
6590
+ if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(" \u{1F4A0} expanded", keyInit, "=>", key4), (0, import_log.log)(val2), console.groupEnd()), val2 != null) {
6474
6591
  if (key4 === "pointerEvents") {
6475
6592
  viewProps[key4] = val2;
6476
6593
  return;
6477
6594
  }
6478
6595
  if (!isHOC && isValidStyleKey(key4, validStyles, accept) || import_constants4.isAndroid && key4 === "elevation") {
6479
- mergeStyle(styleState, key4, val2);
6596
+ mergeStyle(styleState, key4, val2, 1);
6480
6597
  return;
6481
6598
  }
6482
6599
  if (isPseudo = key4 in import_helpers.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)) {
@@ -6512,7 +6629,7 @@ var require_getSplitStyles_native = __commonJS({
6512
6629
  try {
6513
6630
  for (var _iterator2 = pseudoStyles[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) {
6514
6631
  var psuedoStyle = _step2.value, fullKey = `${psuedoStyle[import_helpers.StyleObjectProperty]}${PROP_SPLIT}${descriptor.name}`;
6515
- fullKey in usedKeys || (addStyleToInsertRules(rulesToInsert, psuedoStyle), classNames[fullKey] = psuedoStyle[import_helpers.StyleObjectIdentifier]);
6632
+ addStyleToInsertRules(rulesToInsert, psuedoStyle), classNames[fullKey] = psuedoStyle[import_helpers.StyleObjectIdentifier];
6516
6633
  }
6517
6634
  } catch (err) {
6518
6635
  _didIteratorError2 = !0, _iteratorError2 = err;
@@ -6545,7 +6662,7 @@ var require_getSplitStyles_native = __commonJS({
6545
6662
  var _pseudos1, _key1;
6546
6663
  pseudos || (pseudos = {}), (_pseudos1 = pseudos)[_key1 = key4] || (_pseudos1[_key1] = {}), pseudos[key4][pkey] = _$val;
6547
6664
  }
6548
- mergeStyle(styleState, pkey, _$val);
6665
+ mergeStyle(styleState, pkey, _$val, importance);
6549
6666
  }
6550
6667
  process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(" subKey", pkey, shouldMerge, {
6551
6668
  importance,
@@ -6566,7 +6683,7 @@ var require_getSplitStyles_native = __commonJS({
6566
6683
  if (!val2) return;
6567
6684
  var hasSpace = val2.space, mediaKeyShort = key4.slice(isMedia == "theme" ? 7 : 1);
6568
6685
  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;
6569
- if (process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F4FA} ${key4}`, {
6686
+ process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F4FA} ${key4}`, {
6570
6687
  key: key4,
6571
6688
  val: val2,
6572
6689
  props,
@@ -6574,15 +6691,15 @@ var require_getSplitStyles_native = __commonJS({
6574
6691
  acceptsClassName,
6575
6692
  componentState,
6576
6693
  mediaState: mediaState3
6577
- }), shouldDoClasses) {
6694
+ });
6695
+ var priority = mediaStylesSeen;
6696
+ if (mediaStylesSeen += 1, shouldDoClasses) {
6578
6697
  var mediaStyle = getSubStyle(styleState, key4, val2, !1);
6579
6698
  if (hasSpace && (delete mediaStyle.space, mediaState3[mediaKeyShort])) {
6580
6699
  var importance1 = (0, import_useMedia.getMediaImportanceIfMoreImportant)(mediaKeyShort, "space", usedKeys, !0);
6581
6700
  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})`));
6582
6701
  }
6583
- var mediaStyles = (0, import_getCSSStylesAtomic.getCSSStylesAtomic)(mediaStyle), priority = mediaStylesSeen;
6584
- mediaStylesSeen += 1;
6585
- var _iteratorNormalCompletion12 = !0, _didIteratorError12 = !1, _iteratorError12 = void 0;
6702
+ var mediaStyles = (0, import_getCSSStylesAtomic.getCSSStylesAtomic)(mediaStyle), _iteratorNormalCompletion12 = !0, _didIteratorError12 = !1, _iteratorError12 = void 0;
6586
6703
  try {
6587
6704
  for (var _iterator12 = mediaStyles[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = !0) {
6588
6705
  var style3 = _step12.value, property = style3[import_helpers.StyleObjectProperty], isSubStyle = property[0] === "$";
@@ -6590,7 +6707,7 @@ var require_getSplitStyles_native = __commonJS({
6590
6707
  var out = (0, import_createMediaStyle.createMediaStyle)(style3, mediaKeyShort, import_useMedia.mediaQueryConfig, isMedia, !1, priority);
6591
6708
  process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)("\u{1F4FA} media style:", out);
6592
6709
  var subKey = isSubStyle ? style3[2] : "", fullKey1 = `${style3[import_helpers.StyleObjectProperty]}${subKey}${PROP_SPLIT}${mediaKeyShort}${style3[import_helpers.StyleObjectPseudo] || ""}`;
6593
- fullKey1 in usedKeys || (addStyleToInsertRules(rulesToInsert, out), classNames[fullKey1] = out[import_helpers.StyleObjectIdentifier]);
6710
+ addStyleToInsertRules(rulesToInsert, out), classNames[fullKey1] = out[import_helpers.StyleObjectIdentifier];
6594
6711
  }
6595
6712
  }
6596
6713
  } catch (err) {
@@ -6628,12 +6745,12 @@ var require_getSplitStyles_native = __commonJS({
6628
6745
  scheme,
6629
6746
  val: _$val1,
6630
6747
  oppositeVal
6631
- }), mergeStyle(styleState, subKey1, mediaStyle1[subKey1]);
6748
+ }), mergeStyle(styleState, subKey1, mediaStyle1[subKey1], priority);
6632
6749
  }
6633
6750
  } else if (!(themeName === mediaKeyShort || themeName.startsWith(mediaKeyShort))) return;
6634
6751
  } else if (isGroupMedia) {
6635
- var _componentState_group, groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyShort), groupName = groupInfo.name, groupContext = componentContext == null ? void 0 : componentContext.groups.state[groupName];
6636
- if (!groupContext) {
6752
+ 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;
6753
+ if (!groupState) {
6637
6754
  process.env.NODE_ENV === "development" && debug && (0, import_log.log)(`No parent with group prop, skipping styles: ${groupName}`);
6638
6755
  return;
6639
6756
  }
@@ -6641,17 +6758,30 @@ var require_getSplitStyles_native = __commonJS({
6641
6758
  if (groupMediaKey) {
6642
6759
  mediaGroups || (mediaGroups = /* @__PURE__ */ new Set()), mediaGroups.add(groupMediaKey);
6643
6760
  var mediaState1 = componentGroupState == null ? void 0 : componentGroupState.media, isActive = mediaState1 == null ? void 0 : mediaState1[groupMediaKey];
6644
- 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) {
6761
+ 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}`, {
6762
+ ...mediaState1,
6763
+ usedKeys: {
6764
+ ...styleState.usedKeys
6765
+ }
6766
+ }), !isActive) {
6645
6767
  for (var pkey1 in mediaStyle1) applyDefaultStyle(pkey1, styleState);
6646
6768
  return;
6647
6769
  }
6648
6770
  importanceBump = 2;
6649
6771
  }
6650
6772
  if (groupPseudoKey) {
6773
+ var _this;
6651
6774
  pseudoGroups || (pseudoGroups = /* @__PURE__ */ new Set()), pseudoGroups.add(groupName);
6652
- var componentGroupPseudoState = (componentGroupState || // fallback to context initially
6653
- componentContext.groups.state[groupName]).pseudo, isActive1 = componentGroupPseudoState == null ? void 0 : componentGroupPseudoState[groupPseudoKey], priority1 = import_pseudoDescriptors.pseudoPriorities[groupPseudoKey];
6654
- if (process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F3D8}\uFE0F GROUP pseudo ${groupMediaKey} active? ${isActive1}, priority ${priority1}`), !isActive1) {
6775
+ var componentGroupPseudoState = (_this = componentGroupState || // fallback to context initially
6776
+ (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];
6777
+ if (process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F3D8}\uFE0F GROUP pseudo ${groupMediaKey} active? ${isActive1}, priority ${priority1}`, {
6778
+ componentGroupPseudoState: {
6779
+ ...componentGroupPseudoState
6780
+ },
6781
+ usedKeys: {
6782
+ ...styleState.usedKeys
6783
+ }
6784
+ }), !isActive1) {
6655
6785
  for (var pkey2 in mediaStyle1) applyDefaultStyle(pkey2, styleState);
6656
6786
  return;
6657
6787
  }
@@ -6682,6 +6812,8 @@ var require_getSplitStyles_native = __commonJS({
6682
6812
  ...styleState.style
6683
6813
  }), (0, import_log.log)("viewProps", {
6684
6814
  ...viewProps
6815
+ }), (0, import_log.log)("transforms", {
6816
+ ...styleState.flatTransforms
6685
6817
  });
6686
6818
  } catch {
6687
6819
  }
@@ -6715,7 +6847,7 @@ var require_getSplitStyles_native = __commonJS({
6715
6847
  }
6716
6848
  }));
6717
6849
  }
6718
- process.env.NODE_ENV === "development" && debug === "profile" && time`style-state`, process.env.NODE_ENV === "development" && debug && debug !== "profile" && import_constants4.isClient && (console.groupCollapsed("getSplitStyles (collapsed)"), (0, import_log.log)({
6850
+ process.env.NODE_ENV === "development" && debug === "profile" && time`style-state`, process.env.NODE_ENV === "development" && debug && debug !== "profile" && import_constants4.isClient && import_isDevTools.isDevTools && (console.groupCollapsed("\u{1F539} getSplitStyles \u{1F447}"), (0, import_log.log)({
6719
6851
  props,
6720
6852
  staticConfig,
6721
6853
  shouldDoClasses,
@@ -6726,7 +6858,7 @@ var require_getSplitStyles_native = __commonJS({
6726
6858
  theme: {
6727
6859
  ...theme
6728
6860
  }
6729
- }), console.groupEnd());
6861
+ }));
6730
6862
  var { asChild } = props, { accept } = staticConfig, { noSkip, disableExpandShorthands, noExpand } = styleProps, { webContainerType } = conf.settings, parentVariants = parentStaticConfig == null ? void 0 : parentStaticConfig.variants;
6731
6863
  for (var keyOg in props) _loop(keyOg);
6732
6864
  process.env.NODE_ENV === "development" && debug === "profile" && time`split-styles-propsend`;
@@ -6808,8 +6940,8 @@ var require_getSplitStyles_native = __commonJS({
6808
6940
  }
6809
6941
  } else style2 && (viewProps.style = style2);
6810
6942
  }
6811
- if (process.env.NODE_ENV === "development" && debug === "verbose" && import_isDevTools.isDevTools) {
6812
- console.groupCollapsed("\u{1F539} getSplitStyles ===>");
6943
+ if (process.env.NODE_ENV === "development" && debug && debug !== "profile" && import_constants4.isClient && import_isDevTools.isDevTools) {
6944
+ console.groupEnd(), console.groupCollapsed("\u{1F539} getSplitStyles ===>");
6813
6945
  try {
6814
6946
  var logs = {
6815
6947
  ...result,
@@ -6835,11 +6967,11 @@ var require_getSplitStyles_native = __commonJS({
6835
6967
  mergeTransform(target, key, val, !0);
6836
6968
  });
6837
6969
  }
6838
- function mergeStyle(styleState, key, val) {
6839
- var disableNormalize = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, { viewProps, styleProps, staticConfig } = styleState;
6840
- if (key in import_helpers.stylePropsTransform) {
6841
- var _styleState;
6842
- (_styleState = styleState).flatTransforms || (_styleState.flatTransforms = {}), styleState.flatTransforms[key] = val;
6970
+ function mergeStyle(styleState, key, val, importance) {
6971
+ var disableNormalize = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !1, { viewProps, styleProps, staticConfig } = styleState, existingImportance = styleState.usedKeys[key];
6972
+ if (!(importance < existingImportance)) if (key in import_helpers.stylePropsTransform) {
6973
+ var _styleState, _styleState_usedKeys, _key;
6974
+ (_styleState = styleState).flatTransforms || (_styleState.flatTransforms = {}), (_styleState_usedKeys = styleState.usedKeys)[_key = key] || (_styleState_usedKeys[_key] = 1), styleState.flatTransforms[key] = val;
6843
6975
  } else {
6844
6976
  var shouldNormalize = import_constants4.isWeb && !disableNormalize && !styleProps.noNormalize, out = shouldNormalize ? (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(val, key) : val;
6845
6977
  if (
@@ -6847,8 +6979,8 @@ var require_getSplitStyles_native = __commonJS({
6847
6979
  staticConfig.accept && key in staticConfig.accept
6848
6980
  ) viewProps[key] = out;
6849
6981
  else {
6850
- var _styleState1;
6851
- (_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
6982
+ var _styleState1, _styleState_usedKeys1, _key1;
6983
+ (_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
6852
6984
  // if theres any flatTransforms later, causing issues (mutating props is bad, in strict mode styles get borked)
6853
6985
  key === "transform" && Array.isArray(out) ? [
6854
6986
  ...out
@@ -6879,8 +7011,8 @@ var require_getSplitStyles_native = __commonJS({
6879
7011
  }
6880
7012
  return styleProps.noNormalize || (0, import_expandStyles.fixStyles)(styleOut), styleOut;
6881
7013
  }, useInsertEffectCompat = import_constants4.isWeb ? import_react3.default.useInsertionEffect || import_constants4.useIsomorphicLayoutEffect : function() {
6882
- }, useSplitStyles = function(a, b, c, d, e, f, g, h, i, j, k) {
6883
- var res = getSplitStyles(a, b, c, d, e, f, g, h, i, j, k);
7014
+ }, useSplitStyles = function(a, b, c, d, e, f, g, h, i, j, k, l) {
7015
+ var res = getSplitStyles(a, b, c, d, e, f, g, h, i, j, k, l);
6884
7016
  return res;
6885
7017
  };
6886
7018
  function addStyleToInsertRules(rulesToInsert, styleObject) {
@@ -6925,14 +7057,14 @@ var require_getSplitStyles_native = __commonJS({
6925
7057
  delete viewProps[key], viewProps[key] = next;
6926
7058
  } else viewProps[key] = val;
6927
7059
  }
6928
- function mergeMediaByImportance(styleState, mediaKey, key, value, importancesUsed, isSizeMedia, importanceBump, debugProp) {
6929
- var importance = (0, import_useMedia.getMediaImportanceIfMoreImportant)(mediaKey, key, importancesUsed, isSizeMedia);
6930
- 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;
6931
- if (importancesUsed[key] = importance, key in import_pseudoDescriptors.pseudoDescriptors) {
7060
+ function mergeMediaByImportance(styleState, mediaKey, key, value, usedKeys, isSizeMedia, importanceBump, debugProp) {
7061
+ var importance = (0, import_useMedia.getMediaImportanceIfMoreImportant)(mediaKey, key, usedKeys, isSizeMedia);
7062
+ 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;
7063
+ if (usedKeys[key] = importance, key in import_pseudoDescriptors.pseudoDescriptors) {
6932
7064
  var descriptor = import_pseudoDescriptors.pseudoDescriptors[key], descriptorKey = descriptor.stateKey || descriptor.name, isDisabled = styleState.componentState[descriptorKey] === !1;
6933
7065
  if (isDisabled) return !1;
6934
- for (var subKey in value) mergeStyle(styleState, subKey, value[subKey]);
6935
- } else mergeStyle(styleState, key, value);
7066
+ for (var subKey in value) mergeStyle(styleState, subKey, value[subKey], importance);
7067
+ } else mergeStyle(styleState, key, value, importance);
6936
7068
  return !0;
6937
7069
  }
6938
7070
  function normalizeStyle(style) {
@@ -6945,7 +7077,7 @@ var require_getSplitStyles_native = __commonJS({
6945
7077
  }
6946
7078
  function applyDefaultStyle(pkey, styleState) {
6947
7079
  var defaultValues = animatableDefaults[pkey];
6948
- defaultValues != null && !(pkey in styleState.usedKeys) && (!styleState.style || !(pkey in styleState.style)) && mergeStyle(styleState, pkey, defaultValues);
7080
+ defaultValues != null && !(pkey in styleState.usedKeys) && (!styleState.style || !(pkey in styleState.style)) && mergeStyle(styleState, pkey, defaultValues, 1);
6949
7081
  }
6950
7082
  }
6951
7083
  });
@@ -7066,84 +7198,6 @@ var require_setElementProps_native = __commonJS({
7066
7198
  }
7067
7199
  });
7068
7200
 
7069
- // ../../packages/is-equal-shallow/dist/cjs/index.native.js
7070
- var require_index_native13 = __commonJS({
7071
- "../../packages/is-equal-shallow/dist/cjs/index.native.js"(exports2, module2) {
7072
- "use strict";
7073
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
7074
- for (var name in all) __defProp2(target, name, {
7075
- get: all[name],
7076
- enumerable: !0
7077
- });
7078
- }, __copyProps2 = function(to, from, except, desc) {
7079
- var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
7080
- if (from && typeof from == "object" || typeof from == "function") try {
7081
- for (var _loop = function() {
7082
- var key = _step.value;
7083
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
7084
- get: function() {
7085
- return from[key];
7086
- },
7087
- enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
7088
- });
7089
- }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
7090
- } catch (err) {
7091
- _didIteratorError = !0, _iteratorError = err;
7092
- } finally {
7093
- try {
7094
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
7095
- } finally {
7096
- if (_didIteratorError)
7097
- throw _iteratorError;
7098
- }
7099
- }
7100
- return to;
7101
- }, __toCommonJS2 = function(mod) {
7102
- return __copyProps2(__defProp2({}, "__esModule", {
7103
- value: !0
7104
- }), mod);
7105
- }, index_exports2 = {};
7106
- __export2(index_exports2, {
7107
- isEqualShallow: function() {
7108
- return isEqualShallow;
7109
- },
7110
- mergeIfNotShallowEqual: function() {
7111
- return mergeIfNotShallowEqual;
7112
- },
7113
- useCreateShallowSetState: function() {
7114
- return useCreateShallowSetState;
7115
- }
7116
- });
7117
- module2.exports = __toCommonJS2(index_exports2);
7118
- var import_react3 = require("react");
7119
- function useCreateShallowSetState(setter, debugIn) {
7120
- return (0, import_react3.useCallback)(function(next) {
7121
- setter(function(prev) {
7122
- return mergeIfNotShallowEqual(prev, next, debugIn);
7123
- });
7124
- }, [
7125
- setter,
7126
- debugIn
7127
- ]);
7128
- }
7129
- function mergeIfNotShallowEqual(prev, next, debug) {
7130
- if (!prev || !next || isEqualShallow(prev, next)) return prev || next;
7131
- if (process.env.NODE_ENV === "development" && debug && (console.info("setStateShallow CHANGE", {
7132
- prev,
7133
- next
7134
- }), debug === "break")) debugger;
7135
- return {
7136
- ...prev,
7137
- ...next
7138
- };
7139
- }
7140
- function isEqualShallow(prev, next) {
7141
- for (var key in next) if (prev[key] !== next[key]) return !1;
7142
- return !0;
7143
- }
7144
- }
7145
- });
7146
-
7147
7201
  // ../../core/web/dist/cjs/helpers/subscribeToContextGroup.native.js
7148
7202
  var require_subscribeToContextGroup_native = __commonJS({
7149
7203
  "../../core/web/dist/cjs/helpers/subscribeToContextGroup.native.js"(exports2, module2) {
@@ -7187,31 +7241,58 @@ var require_subscribeToContextGroup_native = __commonJS({
7187
7241
  }
7188
7242
  });
7189
7243
  module2.exports = __toCommonJS2(subscribeToContextGroup_exports);
7190
- var import_useMedia = require_useMedia_native(), import_is_equal_shallow = require_index_native13(), subscribeToContextGroup = function(param) {
7191
- var { setStateShallow, pseudoGroups, mediaGroups, componentContext, state } = param;
7244
+ var import_is_equal_shallow = require_index_native12(), import_useMedia = require_useMedia_native(), subscribeToContextGroup = function(props) {
7245
+ var { pseudoGroups, mediaGroups, groupContext } = props;
7192
7246
  if (pseudoGroups || mediaGroups) {
7193
- var _componentContext_groups_subscribe, _componentContext_groups;
7194
- 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) {
7195
- var { layout, pseudo } = param2, _state_group, current = ((_state_group = state.group) === null || _state_group === void 0 ? void 0 : _state_group[name]) || {
7247
+ process.env.NODE_ENV === "development" && !groupContext && console.debug("No context group found");
7248
+ var disposables = /* @__PURE__ */ new Set();
7249
+ if (pseudoGroups) for (var _i = 0, _iter = [
7250
+ ...pseudoGroups
7251
+ ]; _i < _iter.length; _i++) {
7252
+ var name = _iter[_i];
7253
+ disposables.add(createGroupListener(name, props));
7254
+ }
7255
+ if (mediaGroups) for (var _i1 = 0, _iter1 = [
7256
+ ...mediaGroups
7257
+ ]; _i1 < _iter1.length; _i1++) {
7258
+ var name1 = _iter1[_i1];
7259
+ disposables.add(createGroupListener(name1, props));
7260
+ }
7261
+ return function() {
7262
+ disposables.forEach(function(d) {
7263
+ return d();
7264
+ });
7265
+ };
7266
+ }
7267
+ }, createGroupListener = function(name, param) {
7268
+ var { setStateShallow, pseudoGroups, mediaGroups, groupContext } = param, parent = groupContext == null ? void 0 : groupContext[name];
7269
+ return parent ? parent.subscribe(function(param2) {
7270
+ var { layout, pseudo } = param2;
7271
+ setStateShallow(function(prev) {
7272
+ var _prev_group, didChange = !1, group = ((_prev_group = prev.group) === null || _prev_group === void 0 ? void 0 : _prev_group[name]) || {
7196
7273
  pseudo: {},
7197
7274
  media: {}
7198
7275
  };
7199
- if (pseudo && pseudoGroups != null && pseudoGroups.has(String(name))) Object.assign(current.pseudo, pseudo), persist();
7200
- else if (layout && mediaGroups) {
7201
- var mediaState3 = (0, import_useMedia.getMediaState)(mediaGroups, layout), next = (0, import_is_equal_shallow.mergeIfNotShallowEqual)(current.media || {}, mediaState3);
7202
- next !== current.media && (Object.assign(current.media, next), persist());
7203
- }
7204
- function persist() {
7205
- var group = {
7206
- ...state.group,
7207
- [name]: current
7208
- };
7209
- setStateShallow({
7210
- group
7211
- });
7276
+ if (pseudo && pseudoGroups != null && pseudoGroups.has(name)) {
7277
+ var _group;
7278
+ (_group = group).pseudo || (_group.pseudo = {});
7279
+ var next = (0, import_is_equal_shallow.mergeIfNotShallowEqual)(group.pseudo, pseudo);
7280
+ next !== group.pseudo && (Object.assign(group.pseudo, pseudo), didChange = !0);
7281
+ } else if (layout && mediaGroups) {
7282
+ var _group1;
7283
+ (_group1 = group).media || (_group1.media = {});
7284
+ var mediaState3 = (0, import_useMedia.getMediaState)(mediaGroups, layout), next1 = (0, import_is_equal_shallow.mergeIfNotShallowEqual)(group.media, mediaState3);
7285
+ next1 !== group.media && (Object.assign(group.media, next1), didChange = !0);
7212
7286
  }
7287
+ return didChange ? {
7288
+ group: {
7289
+ ...prev.group,
7290
+ [name]: group
7291
+ }
7292
+ } : prev;
7213
7293
  });
7214
- }
7294
+ }) : function() {
7295
+ };
7215
7296
  };
7216
7297
  }
7217
7298
  });
@@ -7305,7 +7386,7 @@ var require_useThemeState_native = __commonJS({
7305
7386
  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));
7306
7387
  return PendingUpdate.delete(id), (!local || rerender) && (local = {
7307
7388
  ...next
7308
- }, 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({
7389
+ }, 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({
7309
7390
  props,
7310
7391
  propsKey,
7311
7392
  isRoot,
@@ -7340,7 +7421,7 @@ var require_useThemeState_native = __commonJS({
7340
7421
  themes || (themes = (0, import_config.getConfig)().themes);
7341
7422
  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)));
7342
7423
  if (process.env.NODE_ENV === "development" && debug && debug !== "profile") {
7343
- var message = ` \xB7 useTheme(${id}) => ${name} needsUpdate ${needsUpdate} shouldRerender ${shouldRerender}`;
7424
+ var message = ` \xB7 useTheme(${id}) getNextState => ${name} needsUpdate ${needsUpdate} shouldRerender ${shouldRerender}`;
7344
7425
  console.info(message);
7345
7426
  }
7346
7427
  if (isSameAsParent) return [
@@ -8210,8 +8291,8 @@ var require_useComponentState_native = __commonJS({
8210
8291
  }
8211
8292
  });
8212
8293
  module2.exports = __toCommonJS2(useComponentState_exports);
8213
- var import_constants4 = require_index_native6(), import_is_equal_shallow = require_index_native13(), import_use_did_finish_ssr = require_index_native14(), 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) {
8214
- 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);
8294
+ var import_constants4 = require_index_native6(), import_is_equal_shallow = require_index_native12(), import_use_did_finish_ssr = require_index_native14(), 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) {
8295
+ 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);
8215
8296
  stateRef.current || (stateRef.current = {});
8216
8297
  var hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSS = animationDriver == null ? void 0 : animationDriver.supportsCSS, curStateRef = stateRef.current;
8217
8298
  !needsHydration && hasAnimationProp && (curStateRef.hasAnimated = !0);
@@ -8235,7 +8316,7 @@ var require_useComponentState_native = __commonJS({
8235
8316
  ...states[0],
8236
8317
  [props.forceStyle]: !0
8237
8318
  } : states[0], setState = states[1];
8238
- stateRef.current.nextComponentState && (Object.assign(state, stateRef.current.nextComponentState), stateRef.current.nextComponentState = void 0);
8319
+ stateRef.current.nextComponentState && Object.assign(state, stateRef.current.nextComponentState);
8239
8320
  var isAnimated = willBeAnimated;
8240
8321
  import_constants4.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(_) {
8241
8322
  return {
@@ -8259,46 +8340,6 @@ var require_useComponentState_native = __commonJS({
8259
8340
  isClassNameDisabled
8260
8341
  }));
8261
8342
  }
8262
- if (groupName && !curStateRef.group) {
8263
- var listeners = /* @__PURE__ */ new Set();
8264
- curStateRef.group = {
8265
- listeners,
8266
- emit(name, state2) {
8267
- listeners.forEach(function(l) {
8268
- return l(name, state2);
8269
- });
8270
- },
8271
- subscribe(cb) {
8272
- return listeners.add(cb), setStateShallow({
8273
- hasDynGroupChildren: !0
8274
- }), function() {
8275
- listeners.delete(cb), listeners.size === 0 && setStateShallow({
8276
- hasDynGroupChildren: !1
8277
- });
8278
- };
8279
- }
8280
- };
8281
- }
8282
- if (!curStateRef.stateEmitter && hasAnimationProp) {
8283
- var listeners1 = /* @__PURE__ */ new Set();
8284
- curStateRef.stateEmitter = {
8285
- listeners: listeners1,
8286
- emit(state2) {
8287
- listeners1.forEach(function(l) {
8288
- return l(state2);
8289
- });
8290
- },
8291
- subscribe(cb) {
8292
- return listeners1.add(cb), setStateShallow({
8293
- hasDynGroupChildren: !0
8294
- }), function() {
8295
- listeners1.delete(cb), listeners1.size === 0 && setStateShallow({
8296
- hasDynGroupChildren: !1
8297
- });
8298
- };
8299
- }
8300
- };
8301
- }
8302
8343
  return {
8303
8344
  startedUnhydrated,
8304
8345
  curStateRef,
@@ -8548,17 +8589,26 @@ var require_createComponent_native = __commonJS({
8548
8589
  }
8549
8590
  });
8550
8591
  module2.exports = __toCommonJS2(createComponent_exports);
8551
- var import_jsx_runtime6 = require("react/jsx-runtime"), import_compose_refs = require_index_native11(), import_constants4 = require_index_native6(), import_helpers = require_index_native7(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_constants22 = 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();
8592
+ var import_jsx_runtime6 = require("react/jsx-runtime"), import_compose_refs = require_index_native11(), import_constants4 = require_index_native6(), import_helpers = require_index_native7(), import_is_equal_shallow = require_index_native12(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_constants22 = 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([
8593
+ "hover",
8594
+ "press",
8595
+ "pressIn",
8596
+ "group",
8597
+ "focus",
8598
+ "focusWithin",
8599
+ "media",
8600
+ "group"
8601
+ ]);
8552
8602
  if (0) var cancelTouches;
8553
8603
  var BaseText, BaseView, hasSetupBaseViews = !1, lastInteractionWasKeyboard = {
8554
8604
  value: !1
8555
8605
  };
8556
8606
  import_constants4.isWeb && globalThis.document && (document.addEventListener("keydown", function() {
8557
- lastInteractionWasKeyboard.value = !0;
8607
+ lastInteractionWasKeyboard.value || (lastInteractionWasKeyboard.value = !0);
8558
8608
  }), document.addEventListener("mousedown", function() {
8559
- lastInteractionWasKeyboard.value = !1;
8609
+ lastInteractionWasKeyboard.value && (lastInteractionWasKeyboard.value = !1);
8560
8610
  }), document.addEventListener("mousemove", function() {
8561
- lastInteractionWasKeyboard.value = !1;
8611
+ lastInteractionWasKeyboard.value && (lastInteractionWasKeyboard.value = !1);
8562
8612
  }));
8563
8613
  function createComponent2(staticConfig) {
8564
8614
  var _staticConfig_defaultProps, { componentName } = staticConfig, config = null, defaultProps = staticConfig.defaultProps;
@@ -8589,7 +8639,7 @@ var require_createComponent_native = __commonJS({
8589
8639
  var _propsIn_datatestrenders, _current, _;
8590
8640
  (_ = (_propsIn_datatestrenders = propsIn["data-test-renders"])[_current = "current"]) !== null && _ !== void 0 || (_propsIn_datatestrenders[_current] = 0), propsIn["data-test-renders"].current += 1;
8591
8641
  }
8592
- var componentContext = import_react3.default.useContext(import_ComponentContext.ComponentContext), styledContextProps, overriddenContextProps, contextValue, { context, isReactNative } = staticConfig;
8642
+ var styledContextProps, overriddenContextProps, contextValue, { context, isReactNative } = staticConfig;
8593
8643
  if (context && (contextValue = import_react3.default.useContext(context), contextValue)) {
8594
8644
  process.env.NODE_ENV === "development" && (propsIn == null ? void 0 : propsIn.debug) === "verbose" && (0, import_log.log)(" \u{1F447} contextValue", contextValue);
8595
8645
  for (var key in context.props) {
@@ -8614,7 +8664,7 @@ var require_createComponent_native = __commonJS({
8614
8664
  var componentName2 = props.componentName || staticConfig.componentName;
8615
8665
  process.env.NODE_ENV === "development" && import_constants4.isClient && import_react3.default.useEffect(function() {
8616
8666
  var overlay = null, debugVisualizerHandler = function() {
8617
- var show = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, node = curStateRef.host;
8667
+ var show = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, node = stateRef.current.host;
8618
8668
  if (node) if (show) {
8619
8669
  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";
8620
8670
  var dataAt = node.getAttribute("data-at") || "", dataIn = node.getAttribute("data-in") || "", tooltip = document.createElement("span");
@@ -8627,8 +8677,52 @@ var require_createComponent_native = __commonJS({
8627
8677
  }, [
8628
8678
  componentName2
8629
8679
  ]);
8630
- 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;
8631
- process.env.NODE_ENV === "development" && time2 && time2`use-state`;
8680
+ 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() {
8681
+ var _stateRef_current_group;
8682
+ if (!groupName) return groupContextParent;
8683
+ (_stateRef_current_group = stateRef.current.group) === null || _stateRef_current_group === void 0 || _stateRef_current_group.listeners.clear();
8684
+ var listeners = /* @__PURE__ */ new Set();
8685
+ return stateRef.current.group = {
8686
+ listeners,
8687
+ emit(state2) {
8688
+ listeners.forEach(function(l) {
8689
+ return l(state2);
8690
+ });
8691
+ },
8692
+ subscribe(cb) {
8693
+ return listeners.add(cb), listeners.size === 1 && setStateShallow({
8694
+ hasDynGroupChildren: !0
8695
+ }), function() {
8696
+ listeners.delete(cb), listeners.size === 0 && setStateShallow({
8697
+ hasDynGroupChildren: !1
8698
+ });
8699
+ };
8700
+ }
8701
+ }, {
8702
+ ...groupContextParent,
8703
+ [groupName]: {
8704
+ state: {
8705
+ pseudo: import_defaultComponentState.defaultComponentStateMounted
8706
+ },
8707
+ subscribe: function(listener) {
8708
+ var _stateRef_current_group2, dispose = (_stateRef_current_group2 = stateRef.current.group) === null || _stateRef_current_group2 === void 0 ? void 0 : _stateRef_current_group2.subscribe(listener);
8709
+ return function() {
8710
+ dispose == null || dispose();
8711
+ };
8712
+ }
8713
+ }
8714
+ };
8715
+ }, [
8716
+ stateRef,
8717
+ groupName,
8718
+ groupContextParent
8719
+ ]), setStateShallow = componentState.setStateShallow, pendingState = stateRef.current.nextComponentState;
8720
+ pendingState && (stateRef.current.nextComponentState = void 0, componentState.setState(function(prev) {
8721
+ return {
8722
+ ...prev,
8723
+ ...pendingState
8724
+ };
8725
+ })), process.env.NODE_ENV === "development" && time2 && time2`use-state`;
8632
8726
  var hasTextAncestor = !!(import_constants4.isWeb && isText && componentContext.inText), isTaggable = !Component || typeof Component == "string", tagProp = props.tag, element = import_constants4.isWeb && isTaggable && tagProp || Component, BaseTextComponent = BaseText || element || "span", BaseViewComponent = BaseView || element || (hasTextAncestor ? "span" : "div"), elementType = isText ? BaseTextComponent : BaseViewComponent;
8633
8727
  animationDriver && isAnimated && // this should really be behind another prop as it's not really related to
8634
8728
  // "needsWebStyles" basically with motion we just animate a plain div, but
@@ -8636,14 +8730,14 @@ var require_createComponent_native = __commonJS({
8636
8730
  // things declaratively
8637
8731
  !animationDriver.needsWebStyles && (elementType = animationDriver[isText ? "Text" : "View"] || elementType);
8638
8732
  var disableThemeProp = !1, disableTheme = disableThemeProp || isHOC;
8639
- process.env.NODE_ENV === "development" && time2 && time2`theme-props`, props.themeShallow && (curStateRef.themeShallow = !0);
8733
+ process.env.NODE_ENV === "development" && time2 && time2`theme-props`, props.themeShallow && (stateRef.current.themeShallow = !0);
8640
8734
  var themeStateProps = {
8641
8735
  componentName: componentName2,
8642
8736
  disable: disableTheme,
8643
- shallow: curStateRef.themeShallow,
8737
+ shallow: stateRef.current.themeShallow,
8644
8738
  debug: debugProp
8645
8739
  };
8646
- if ("themeInverse" in props && (themeStateProps.inverse = props.themeInverse), "theme" in props && (themeStateProps.name = props.theme), typeof curStateRef.isListeningToTheme == "boolean" && (themeStateProps.needsUpdate = function() {
8740
+ if ("themeInverse" in props && (themeStateProps.inverse = props.themeInverse), "theme" in props && (themeStateProps.name = props.theme), typeof stateRef.current.isListeningToTheme == "boolean" && (themeStateProps.needsUpdate = function() {
8647
8741
  return !!stateRef.current.isListeningToTheme;
8648
8742
  }), themeStateProps.deopt = willBeAnimated, process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
8649
8743
  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()}`;
@@ -8663,7 +8757,8 @@ var require_createComponent_native = __commonJS({
8663
8757
  themeStateProps
8664
8758
  }), (0, import_log.log)({
8665
8759
  contextProps: styledContextProps,
8666
- overriddenContextProps
8760
+ overriddenContextProps,
8761
+ componentContext
8667
8762
  }), (0, import_log.log)({
8668
8763
  presence,
8669
8764
  isAnimated,
@@ -8692,33 +8787,53 @@ var require_createComponent_native = __commonJS({
8692
8787
  noMergeStyle: isAnimated && (animationDriver == null ? void 0 : animationDriver.needsWebStyles)
8693
8788
  }, themeName = (themeState == null ? void 0 : themeState.name) || "";
8694
8789
  process.env.NODE_ENV === "development" && time2 && time2`split-styles-prepare`;
8695
- var splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, themeName, state, styleProps, null, componentContext, elementType, startedUnhydrated, debugProp);
8696
- if (hasAnimationProp && animationDriver != null && animationDriver.avoidReRenders) {
8697
- var styleListener = stateRef.current.useStyleListener, ogSetStateShallow = setStateShallow;
8698
- setStateShallow = function(next) {
8699
- var avoidReRenderKeys = /* @__PURE__ */ new Set([
8700
- "hover",
8701
- "press",
8702
- "pressIn"
8703
- ]), canAvoidReRender = Object.keys(next).every(function(key3) {
8704
- return avoidReRenderKeys.has(key3);
8790
+ 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;
8791
+ if (groupContext) {
8792
+ var groupState = groupContext == null ? void 0 : groupContext.state;
8793
+ if (groupState && groupState.layout === void 0) {
8794
+ var _splitStyles_style, _splitStyles_style1;
8795
+ (!((_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 = {
8796
+ width: fromPx(splitStyles.style.width),
8797
+ height: fromPx(splitStyles.style.height)
8705
8798
  });
8706
- if (canAvoidReRender && styleListener) {
8707
- var updatedState = {
8708
- ...state,
8709
- ...next
8710
- };
8711
- stateRef.current.nextComponentState = updatedState;
8712
- var nextStyles = (0, import_getSplitStyles.getSplitStyles)(props, staticConfig, theme, themeName, updatedState, styleProps, null, componentContext, elementType, startedUnhydrated, debugProp);
8713
- styleListener(nextStyles.style);
8714
- } else ogSetStateShallow(next);
8799
+ }
8800
+ }
8801
+ if ((hasAnimationProp || groupName) && animationDriver != null && animationDriver.avoidReRenders) {
8802
+ var styleListener = stateRef.current.useStyleListener, ogSetStateShallow = setStateShallow;
8803
+ stateRef.current.setStateShallow = function(nextOrGetNext) {
8804
+ var prev = stateRef.current.nextComponentState || state, next = typeof nextOrGetNext == "function" ? nextOrGetNext(prev) : nextOrGetNext;
8805
+ if (!(next === prev || (0, import_is_equal_shallow.isEqualShallow)(prev, next))) {
8806
+ var canAvoidReRender = Object.keys(next).every(function(key3) {
8807
+ return avoidReRenderKeys.has(key3);
8808
+ });
8809
+ if (canAvoidReRender) {
8810
+ var updatedState = {
8811
+ ...prev,
8812
+ ...next
8813
+ };
8814
+ stateRef.current.nextComponentState = updatedState, process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile" && (console.groupCollapsed("[\u26A1\uFE0F] avoid setState", next, {
8815
+ updatedState,
8816
+ props
8817
+ }), console.info(stateRef.current.host), console.groupEnd());
8818
+ var { group, hasDynGroupChildren, unmounted, animation, ...childrenGroupState } = updatedState;
8819
+ if (groupContext && notifyGroupSubscribers(groupContext, stateRef.current.group || null, childrenGroupState), !hasAnimationProp || !styleListener) return;
8820
+ var nextStyles = (0, import_getSplitStyles.getSplitStyles)(props, staticConfig, theme, themeName, updatedState, styleProps, null, componentContext, allGroupContexts, elementType, startedUnhydrated, debugProp);
8821
+ styleListener(nextStyles.style);
8822
+ } else process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile" && console.info("[\u{1F40C}] re-render", {
8823
+ canAvoidReRender,
8824
+ next
8825
+ }), ogSetStateShallow(next);
8826
+ }
8827
+ }, setStateShallow = function(state2) {
8828
+ var _stateRef_current_setStateShallow, _stateRef_current;
8829
+ (_stateRef_current_setStateShallow = (_stateRef_current = stateRef.current).setStateShallow) === null || _stateRef_current_setStateShallow === void 0 || _stateRef_current_setStateShallow.call(_stateRef_current, state2);
8715
8830
  };
8716
8831
  }
8717
- if (process.env.NODE_ENV === "development" && time2 && time2`split-styles`, props.group && props.untilMeasured === "hide" && !curStateRef.hasMeasured) {
8832
+ if (process.env.NODE_ENV === "development" && time2 && time2`split-styles`, props.group && props.untilMeasured === "hide" && !stateRef.current.hasMeasured) {
8718
8833
  var _splitStyles;
8719
8834
  (_splitStyles = splitStyles).style || (_splitStyles.style = {}), splitStyles.style.opacity = 0;
8720
8835
  }
8721
- curStateRef.isListeningToTheme = splitStyles.dynamicThemeAccess;
8836
+ splitStyles.dynamicThemeAccess != null && (stateRef.current.isListeningToTheme = splitStyles.dynamicThemeAccess);
8722
8837
  var hasRuntimeMediaKeys = splitStyles.hasMedia && splitStyles.hasMedia !== !0, shouldListenForMedia = (0, import_createVariable.didGetVariableValue)() || hasRuntimeMediaKeys || noClass && splitStyles.hasMedia === !0, mediaListeningKeys = hasRuntimeMediaKeys ? splitStyles.hasMedia : null;
8723
8838
  process.env.NODE_ENV === "development" && debugProp === "verbose" && console.info("useMedia() createComponent", shouldListenForMedia, mediaListeningKeys), (0, import_useMedia.setMediaShouldUpdate)(componentContext, shouldListenForMedia, mediaListeningKeys);
8724
8839
  var { viewProps: viewPropsIn, pseudos, style: splitStylesStyle, classNames, space } = splitStyles, propsWithAnimation = props, {
@@ -8773,18 +8888,18 @@ var require_createComponent_native = __commonJS({
8773
8888
  }
8774
8889
  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.
8775
8890
 
8776
- 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_helpers.composeEventHandlers)(nonTamaguiProps.onLayout, function(e) {
8777
- var layout = e.nativeEvent.layout;
8778
- stateRef.current.group.layout = layout, stateRef.current.group.emit(groupName, {
8891
+ 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_helpers.composeEventHandlers)(nonTamaguiProps.onLayout, function(e) {
8892
+ var _stateRef_current_group, layout = e.nativeEvent.layout;
8893
+ groupContext.state.layout = layout, (_stateRef_current_group = stateRef.current.group) === null || _stateRef_current_group === void 0 || _stateRef_current_group.emit({
8779
8894
  layout
8780
8895
  }), !stateRef.current.hasMeasured && props.untilMeasured === "hide" && setState(function(prev) {
8781
8896
  return {
8782
8897
  ...prev
8783
8898
  };
8784
8899
  }), stateRef.current.hasMeasured = !0;
8785
- })), 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) {
8900
+ })), 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) {
8786
8901
  return stateRef.current.host = x;
8787
- }, forwardedRef, import_setElementProps.setElementProps, animatedRef)), viewProps.ref = curStateRef.composedRef, process.env.NODE_ENV === "development" && !isReactNative && !isText && import_constants4.isWeb && !isHOC && import_react3.default.Children.toArray(props.children).forEach(function(item) {
8902
+ }, forwardedRef, import_setElementProps.setElementProps, animatedRef)), viewProps.ref = stateRef.current.composedRef, process.env.NODE_ENV === "development" && !isReactNative && !isText && import_constants4.isWeb && !isHOC && import_react3.default.Children.toArray(props.children).forEach(function(item) {
8788
8903
  typeof item == "string" && item !== `
8789
8904
  ` && console.error(`Unexpected text node: ${item}. A text node cannot be a child of a <${staticConfig.componentName || propsIn.tag || "View"}>.`, props);
8790
8905
  }), process.env.NODE_ENV === "development" && time2 && time2`events-hooks`;
@@ -8826,18 +8941,21 @@ If you meant to do this, you can disable this warning - either change untilMeasu
8826
8941
  });
8827
8942
  return;
8828
8943
  }
8829
- var dispose = !disabled && (pseudoGroups || mediaGroups) ? (0, import_subscribeToContextGroup.subscribeToContextGroup)({
8830
- componentContext,
8831
- setStateShallow,
8832
- state,
8833
- mediaGroups,
8834
- pseudoGroups
8835
- }) : null;
8836
8944
  return function() {
8837
- dispose == null || dispose(), componentSetStates.delete(setState);
8945
+ componentSetStates.delete(setState);
8838
8946
  };
8839
8947
  }, [
8840
8948
  state.unmounted,
8949
+ disabled
8950
+ ]), (0, import_constants4.useIsomorphicLayoutEffect)(function() {
8951
+ if (!disabled && !(!pseudoGroups && !mediaGroups) && allGroupContexts) return (0, import_subscribeToContextGroup.subscribeToContextGroup)({
8952
+ groupContext: allGroupContexts,
8953
+ setStateShallow,
8954
+ mediaGroups,
8955
+ pseudoGroups
8956
+ });
8957
+ }, [
8958
+ allGroupContexts,
8841
8959
  disabled,
8842
8960
  pseudoGroups ? Object.keys([
8843
8961
  ...pseudoGroups
@@ -8845,24 +8963,15 @@ If you meant to do this, you can disable this warning - either change untilMeasu
8845
8963
  mediaGroups ? Object.keys([
8846
8964
  ...mediaGroups
8847
8965
  ]).join("") : 0
8848
- ]), (0, import_constants4.useIsomorphicLayoutEffect)(function() {
8849
- var _curStateRef_group;
8850
- if (groupName) {
8851
- curStateRef.group.emit(groupName, {
8852
- pseudo: state,
8853
- layout: (_curStateRef_group = curStateRef.group) === null || _curStateRef_group === void 0 ? void 0 : _curStateRef_group.layout
8854
- });
8855
- var groupContextState = componentContext == null ? void 0 : componentContext.groups;
8856
- if (groupContextState) {
8857
- var next = {
8858
- ...groupContextState[groupName],
8859
- ...state
8860
- };
8861
- groupContextState[groupName] = next;
8862
- }
8863
- }
8966
+ ]), hasAnimationProp && animationDriver != null && animationDriver.avoidReRenders && (0, import_react3.useEffect)(function() {
8967
+ stateRef.current.nextComponentState = void 0;
8968
+ });
8969
+ var groupEmitter = stateRef.current.group;
8970
+ (0, import_constants4.useIsomorphicLayoutEffect)(function() {
8971
+ !groupContext || !groupEmitter || notifyGroupSubscribers(groupContext, groupEmitter, state);
8864
8972
  }, [
8865
- groupName,
8973
+ groupContext,
8974
+ groupEmitter,
8866
8975
  state
8867
8976
  ]);
8868
8977
  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_constants4.isWeb && !!(hasDynamicGroupChildren || needsHoverState || onMouseEnter || onMouseLeave), shouldAttach = !disabled && !props.asChild && !!(attachFocus || attachPress || attachHover || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle), needsPressState = !!(hasDynamicGroupChildren || runtimePressStyle);
@@ -8889,7 +8998,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
8889
8998
  },
8890
8999
  onMouseLeave: function(e) {
8891
9000
  var next = {};
8892
- needsHoverState && (next.hover = !1), needsPressState && state.pressIn && (next.press = !1, next.pressIn = !1), setStateShallow(next), onHoverOut == null || onHoverOut(e), onMouseLeave == null || onMouseLeave(e);
9001
+ needsHoverState && (next.hover = !1), needsPressState && (next.press = !1, next.pressIn = !1), setStateShallow(next), onHoverOut == null || onHoverOut(e), onMouseLeave == null || onMouseLeave(e);
8893
9002
  }
8894
9003
  },
8895
9004
  onPressIn: attachPress ? function(e) {
@@ -8967,37 +9076,15 @@ If you meant to do this, you can disable this warning - either change untilMeasu
8967
9076
  var useChildrenResult;
8968
9077
  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);
8969
9078
  var ResetPresence2 = config == null || (_config_animations = config.animations) === null || _config_animations === void 0 ? void 0 : _config_animations.ResetPresence;
8970
- ResetPresence2 && willBeAnimated && (hasEnterStyle || presenceState) && content && typeof content != "string" && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ResetPresence2, {
9079
+ if (ResetPresence2 && willBeAnimated && (hasEnterStyle || presenceState) && content && typeof content != "string" && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ResetPresence2, {
8971
9080
  children: content
8972
- })), process.env.NODE_ENV === "development" && time2 && time2`create-element`;
8973
- var groupState = curStateRef.group, subGroupContext = import_react3.default.useMemo(function() {
8974
- var _splitStyles_style, _splitStyles_style1;
8975
- if (!(!groupState || !groupName)) return groupState.listeners.clear(), {
8976
- ...componentContext.groups,
8977
- // change reference so as we mutate it doesn't affect siblings etc
8978
- state: {
8979
- ...componentContext.groups.state,
8980
- [groupName]: {
8981
- pseudo: import_defaultComponentState.defaultComponentStateMounted,
8982
- // capture just initial width and height if they exist
8983
- // will have top, left, width, height (not x, y)
8984
- layout: {
8985
- width: fromPx((_splitStyles_style = splitStyles.style) === null || _splitStyles_style === void 0 ? void 0 : _splitStyles_style.width),
8986
- height: fromPx((_splitStyles_style1 = splitStyles.style) === null || _splitStyles_style1 === void 0 ? void 0 : _splitStyles_style1.height)
8987
- }
8988
- }
8989
- },
8990
- emit: groupState.emit,
8991
- subscribe: groupState.subscribe
8992
- };
8993
- }, [
8994
- groupName
8995
- ]);
8996
- if (("group" in props || propsIn.focusWithinStyle) && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ComponentContext.ComponentContext.Provider, {
9081
+ })), process.env.NODE_ENV === "development" && time2 && time2`create-element`, "focusWithinStyle" in propsIn && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ComponentContext.ComponentContext.Provider, {
8997
9082
  ...componentContext,
8998
- groups: subGroupContext,
8999
9083
  setParentFocusState: setStateShallow,
9000
9084
  children: content
9085
+ })), "group" in propsIn && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_GroupContext.GroupContext.Provider, {
9086
+ value: allGroupContexts,
9087
+ children: content
9001
9088
  })), 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) {
9002
9089
  var contextProps = staticConfig.context.props;
9003
9090
  for (var key1 in contextProps) if (viewProps.style && key1 in viewProps.style || key1 in viewProps) {
@@ -9024,6 +9111,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
9024
9111
  (0, import_log.log)("viewProps", viewProps), (0, import_log.log)("children", content), typeof window < "u" && (0, import_log.log)({
9025
9112
  propsIn,
9026
9113
  props,
9114
+ attachPress,
9027
9115
  animationStyles,
9028
9116
  classNames,
9029
9117
  content,
@@ -9062,6 +9150,15 @@ If you meant to do this, you can disable this warning - either change untilMeasu
9062
9150
  delete globalThis.willPrint, time2.print(), time2 = null;
9063
9151
  }, 50))), content;
9064
9152
  });
9153
+ function notifyGroupSubscribers(groupContext, groupEmitter, pseudo) {
9154
+ if (!(!groupContext || !groupEmitter)) {
9155
+ var nextState = {
9156
+ ...groupContext.state,
9157
+ pseudo
9158
+ };
9159
+ groupEmitter.emit(nextState), groupContext.state = nextState;
9160
+ }
9161
+ }
9065
9162
  staticConfig.componentName && (component.displayName = staticConfig.componentName);
9066
9163
  var res = component;
9067
9164
  (process.env.TAMAGUI_FORCE_MEMO || staticConfig.memo) && (res = /* @__PURE__ */ import_react3.default.memo(res)), res.staticConfig = staticConfig;
@@ -10835,13 +10932,8 @@ var require_useConfiguration_native = __commonJS({
10835
10932
  }
10836
10933
  });
10837
10934
  module2.exports = __toCommonJS2(useConfiguration_exports);
10838
- var import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_ComponentContext = require_ComponentContext_native(), useConfiguration2 = function() {
10839
- var { groups, animationDriver, ...restComponentConfig } = import_react3.default.useContext(import_ComponentContext.ComponentContext), { animations, ...restConfig } = (0, import_config.getConfig)();
10840
- return {
10841
- ...restConfig,
10842
- ...restComponentConfig,
10843
- animationDriver: animationDriver ?? (0, import_config.getConfig)().animations
10844
- };
10935
+ var import_react3 = __toESM2(require("react")), import_ComponentContext = require_ComponentContext_native(), useConfiguration2 = function() {
10936
+ return import_react3.default.useContext(import_ComponentContext.ComponentContext);
10845
10937
  };
10846
10938
  }
10847
10939
  });
@@ -11008,7 +11100,7 @@ var require_useProps_native = __commonJS({
11008
11100
  }
11009
11101
  });
11010
11102
  module2.exports = __toCommonJS2(useProps_exports);
11011
- var import_constants4 = require_index_native6(), 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();
11103
+ var import_constants4 = require_index_native6(), 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();
11012
11104
  function useProps2(props, opts) {
11013
11105
  var [propsOut, styleOut] = usePropsAndStyle2(props, {
11014
11106
  ...opts,
@@ -11032,7 +11124,7 @@ var require_useProps_native = __commonJS({
11032
11124
  needsUpdate() {
11033
11125
  return !0;
11034
11126
  }
11035
- }), 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 ? (
11127
+ }), 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 ? (
11036
11128
  // not safe to use mediaState but really marginal to hit this
11037
11129
  import_useMedia.mediaState
11038
11130
  ) : (0, import_useMedia.useMedia)(), splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, (themeState == null ? void 0 : themeState.name) || "", state, {
@@ -11043,7 +11135,7 @@ var require_useProps_native = __commonJS({
11043
11135
  noClass: !0,
11044
11136
  resolveValues: "auto",
11045
11137
  ...opts
11046
- }, null, componentContext), { mediaGroups, pseudoGroups } = splitStyles;
11138
+ }, null, componentContext, groupContext), { mediaGroups, pseudoGroups } = splitStyles;
11047
11139
  return (0, import_constants4.useIsomorphicLayoutEffect)(function() {
11048
11140
  if (!disabled) {
11049
11141
  if (state.unmounted) {
@@ -11052,16 +11144,16 @@ var require_useProps_native = __commonJS({
11052
11144
  });
11053
11145
  return;
11054
11146
  }
11055
- return (0, import_subscribeToContextGroup.subscribeToContextGroup)({
11056
- componentContext,
11147
+ if (groupContext) return (0, import_subscribeToContextGroup.subscribeToContextGroup)({
11148
+ groupContext,
11057
11149
  setStateShallow,
11058
- state,
11059
11150
  mediaGroups,
11060
11151
  pseudoGroups
11061
11152
  });
11062
11153
  }
11063
11154
  }, [
11064
11155
  disabled,
11156
+ groupContext,
11065
11157
  pseudoGroups ? Object.keys([
11066
11158
  ...pseudoGroups
11067
11159
  ]).join("") : 0,
@@ -11639,10 +11731,11 @@ var require_index_native15 = __commonJS({
11639
11731
  var import_config = require_config_native(), import_insertStyleRule = require_insertStyleRule_native();
11640
11732
  __reExport2(index_exports2, require_constants_native2(), module2.exports);
11641
11733
  __reExport2(index_exports2, require_ComponentContext_native(), module2.exports);
11734
+ __reExport2(index_exports2, require_GroupContext_native(), module2.exports);
11642
11735
  __reExport2(index_exports2, require_withStableStyle_native(), module2.exports);
11643
11736
  __reExport2(index_exports2, require_createMediaStyle_native(), module2.exports);
11644
11737
  __reExport2(index_exports2, require_getShorthandValue_native(), module2.exports);
11645
- __reExport2(index_exports2, require_index_native13(), module2.exports);
11738
+ __reExport2(index_exports2, require_index_native12(), module2.exports);
11646
11739
  var import_insertStyleRule2 = require_insertStyleRule_native();
11647
11740
  __reExport2(index_exports2, require_createStyledContext_native(), module2.exports);
11648
11741
  __reExport2(index_exports2, require_expandStyles_native(), module2.exports);
@@ -13323,7 +13416,7 @@ var require_index_native19 = __commonJS({
13323
13416
  }
13324
13417
  });
13325
13418
  module2.exports = __toCommonJS2(index_exports2);
13326
- var import_constants4 = require_index_native6(), import_is_equal_shallow = require_index_native13(), LayoutHandlers = /* @__PURE__ */ new WeakMap(), Nodes = /* @__PURE__ */ new Set(), strategy = "async";
13419
+ var import_constants4 = require_index_native6(), import_is_equal_shallow = require_index_native12(), LayoutHandlers = /* @__PURE__ */ new WeakMap(), Nodes = /* @__PURE__ */ new Set(), strategy = "async";
13327
13420
  function setOnLayoutStrategy3(state) {
13328
13421
  strategy = state;
13329
13422
  }
@@ -13365,7 +13458,9 @@ var require_index_native19 = __commonJS({
13365
13458
  } else nodeRect = node.getBoundingClientRect(), parentRect = parentNode.getBoundingClientRect();
13366
13459
  var cachedRect = NodeRectCache.get(node), cachedParentRect = NodeRectCache.get(parentNode);
13367
13460
  if (!cachedRect || // has changed one rect
13368
- !(0, import_is_equal_shallow.isEqualShallow)(cachedRect, nodeRect) && (!cachedParentRect || !(0, import_is_equal_shallow.isEqualShallow)(cachedParentRect, parentRect))) {
13461
+ // @ts-expect-error DOMRectReadOnly can go into object
13462
+ !(0, import_is_equal_shallow.isEqualShallow)(cachedRect, nodeRect) && // @ts-expect-error DOMRectReadOnly can go into object
13463
+ (!cachedParentRect || !(0, import_is_equal_shallow.isEqualShallow)(cachedParentRect, parentRect))) {
13369
13464
  NodeRectCache.set(node, nodeRect), ParentRectCache.set(parentNode, parentRect);
13370
13465
  var event = getElementLayoutEvent(nodeRect, parentRect);
13371
13466
  avoidUpdates ? queuedUpdates.set(node, function() {
@@ -18446,7 +18541,9 @@ var require_SheetImplementationCustom_native = __commonJS({
18446
18541
  var import_jsx_runtime6 = require("react/jsx-runtime"), import_adapt = require_index_native31(), import_animate_presence = require_index_native4(), import_compose_refs = require_index_native11(), import_constants4 = require_index_native6(), import_core12 = require_index_native20(), import_portal2 = require_index_native30(), import_react3 = __toESM2(require("react")), import_react_native4 = require_fake_react_native(), import_contexts = require_contexts_native(), import_helpers = require_helpers_native2(), import_SheetContext = require_SheetContext_native(), import_useSheetOpenState = require_useSheetOpenState_native(), import_useSheetProviderProps = require_useSheetProviderProps_native(), hiddenSize = 10000.1, sheetHiddenStyleSheet = null, relativeDimensionTo = import_constants4.isWeb ? "window" : "screen", SheetImplementationCustom = /* @__PURE__ */ import_react3.default.forwardRef(function(props, forwardedRef) {
18447
18542
  var parentSheet = import_react3.default.useContext(import_contexts.ParentSheetContext), { animation, animationConfig: animationConfigProp, modal = !1, zIndex = parentSheet.zIndex + 1, moveOnKeyboardChange = !1, unmountChildrenWhenHidden = !1, portalProps, containerComponent: ContainerComponent = import_react3.default.Fragment } = props, state = (0, import_useSheetOpenState.useSheetOpenState)(props), [overlayComponent, setOverlayComponent] = import_react3.default.useState(null), providerProps = (0, import_useSheetProviderProps.useSheetProviderProps)(props, state, {
18448
18543
  onOverlayComponent: setOverlayComponent
18449
- }), { frameSize, setFrameSize, snapPoints, snapPointsMode, hasFit, position, setPosition, scrollBridge, screenSize, setMaxContentSize, maxSnapPoint } = providerProps, { open, controller, isHidden } = state, sheetRef = import_react3.default.useRef(void 0), ref = (0, import_compose_refs.useComposedRefs)(forwardedRef, sheetRef, providerProps.contentRef), { animationDriver } = (0, import_core12.useConfiguration)(), animationConfig = function() {
18544
+ }), { frameSize, setFrameSize, snapPoints, snapPointsMode, hasFit, position, setPosition, scrollBridge, screenSize, setMaxContentSize, maxSnapPoint } = providerProps, { open, controller, isHidden } = state, sheetRef = import_react3.default.useRef(void 0), ref = (0, import_compose_refs.useComposedRefs)(forwardedRef, sheetRef, providerProps.contentRef), { animationDriver } = (0, import_core12.useConfiguration)();
18545
+ if (!animationDriver) throw new Error("Sheet reqiures an animation driver to be set");
18546
+ var animationConfig = function() {
18450
18547
  if (animationDriver.supportsCSS) return {};
18451
18548
  var [animationProp, animationPropConfig] = animation ? Array.isArray(animation) ? animation : [
18452
18549
  animation
@@ -30698,6 +30795,7 @@ __export(index_exports, {
30698
30795
  EnsureFlexed: () => EnsureFlexed,
30699
30796
  Fieldset: () => Fieldset,
30700
30797
  FontLanguage: () => import_core11.FontLanguage,
30798
+ GroupContext: () => import_core11.GroupContext,
30701
30799
  Input: () => Input,
30702
30800
  InputFrame: () => InputFrame,
30703
30801
  Spacer: () => import_core11.Spacer,
@@ -31128,6 +31226,7 @@ var import_core11 = __toESM(require_index_native20());
31128
31226
  EnsureFlexed,
31129
31227
  Fieldset,
31130
31228
  FontLanguage,
31229
+ GroupContext,
31131
31230
  Input,
31132
31231
  InputFrame,
31133
31232
  Spacer,