@tamagui/core 1.63.0 → 1.64.0

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
@@ -74,9 +74,9 @@ var require_composeEventHandlers_native = __commonJS({
74
74
  module2.exports = __toCommonJS2(composeEventHandlers_exports);
75
75
  function composeEventHandlers2(og, next, { checkDefaultPrevented = !0 } = {}) {
76
76
  return !og || !next ? next || og || void 0 : function(event) {
77
- if (og?.(event), !event || !(checkDefaultPrevented && "defaultPrevented" in event) || // @ts-ignore
77
+ if (og == null || og(event), !event || !(checkDefaultPrevented && "defaultPrevented" in event) || // @ts-ignore
78
78
  "defaultPrevented" in event && !event.defaultPrevented)
79
- return next?.(event);
79
+ return next == null ? void 0 : next(event);
80
80
  };
81
81
  }
82
82
  }
@@ -522,18 +522,25 @@ var require_config_native = __commonJS({
522
522
  throw new Error("Haven't called createTamagui yet");
523
523
  let { tokens, tokensParsed } = conf;
524
524
  return prefixed === !1 ? tokens : prefixed === !0 ? tokensParsed : tokensMerged;
525
- }, getTokenObject = (value, group) => conf.specificTokens[value] ?? (group ? tokensMerged[group]?.[value] : tokensMerged[Object.keys(tokensMerged).find((cat) => tokensMerged[cat][value]) || ""]?.[value]), getToken2 = (value, group, useVariable = import_constants2.isWeb) => {
525
+ }, getTokenObject = (value, group) => {
526
+ var _a, _b;
527
+ return conf.specificTokens[value] ?? (group ? (_a = tokensMerged[group]) == null ? void 0 : _a[value] : (_b = tokensMerged[Object.keys(tokensMerged).find((cat) => tokensMerged[cat][value]) || ""]) == null ? void 0 : _b[value]);
528
+ }, getToken2 = (value, group, useVariable = import_constants2.isWeb) => {
526
529
  let token = getTokenObject(value, group);
527
- return useVariable ? token?.variable : token?.val;
530
+ return useVariable ? token == null ? void 0 : token.variable : token == null ? void 0 : token.val;
528
531
  }, getTokenValue2 = (value, group) => getToken2(value, group, !1), useTokens = getTokens2, getThemes2 = () => conf.themes, configListeners = /* @__PURE__ */ new Set(), onConfiguredOnce = (cb) => {
529
532
  conf ? cb(conf) : configListeners.add(cb);
530
533
  }, updateConfig2 = (key, value) => {
531
534
  Object.assign(conf[key], value);
532
535
  }, getFont = (name) => {
536
+ var _a;
533
537
  let conf2 = getConfig2();
534
- return conf2.fontsParsed[name] ?? Object.entries(conf2.fontsParsed).find(
535
- ([k]) => conf2.fontsParsed[k]?.family?.val === name
536
- )?.[1];
538
+ return conf2.fontsParsed[name] ?? ((_a = Object.entries(conf2.fontsParsed).find(
539
+ ([k]) => {
540
+ var _a2, _b;
541
+ return ((_b = (_a2 = conf2.fontsParsed[k]) == null ? void 0 : _a2.family) == null ? void 0 : _b.val) === name;
542
+ }
543
+ )) == null ? void 0 : _a[1]);
537
544
  };
538
545
  }
539
546
  });
@@ -678,6 +685,7 @@ var require_insertStyleRule_native = __commonJS({
678
685
  }
679
686
  var bailAfterEnv = process.env.TAMAGUI_BAIL_AFTER_SCANNING_X_CSS_RULES, bailAfter = bailAfterEnv ? +bailAfterEnv : 250;
680
687
  function updateSheetStyles(sheet2, remove = !1, collectThemes = !1, tokens) {
688
+ var _a, _b;
681
689
  let rules;
682
690
  try {
683
691
  if (rules = sheet2.cssRules, !rules)
@@ -685,7 +693,7 @@ var require_insertStyleRule_native = __commonJS({
685
693
  } catch {
686
694
  return;
687
695
  }
688
- let firstSelector = getTamaguiSelector(rules[0], collectThemes)?.[0], lastSelector = getTamaguiSelector(rules[rules.length - 1], collectThemes)?.[0], cacheKey = `${rules.length}${firstSelector}${lastSelector}`, lastScanned = scannedCache.get(sheet2);
696
+ let firstSelector = (_a = getTamaguiSelector(rules[0], collectThemes)) == null ? void 0 : _a[0], lastSelector = (_b = getTamaguiSelector(rules[rules.length - 1], collectThemes)) == null ? void 0 : _b[0], cacheKey = `${rules.length}${firstSelector}${lastSelector}`, lastScanned = scannedCache.get(sheet2);
689
697
  if (!remove && lastScanned === cacheKey)
690
698
  return;
691
699
  let len = rules.length, fails = 0, dedupedThemes;
@@ -951,9 +959,9 @@ var require_expandStyle_native = __commonJS({
951
959
  // react-native doesn't support X / Y
952
960
  overflow: xy
953
961
  }
954
- };
962
+ }, _a;
955
963
  for (let parent in EXPANSIONS) {
956
- let prefix = parent.slice(0, /[A-Z]/.exec(parent)?.index ?? parent.length);
964
+ let prefix = parent.slice(0, ((_a = /[A-Z]/.exec(parent)) == null ? void 0 : _a.index) ?? parent.length);
957
965
  EXPANSIONS[parent] = EXPANSIONS[parent].map((k) => `${prefix}${k}`);
958
966
  }
959
967
  }
@@ -1709,7 +1717,7 @@ var require_getVariantExtras_native = __commonJS({
1709
1717
  var import_createVariable = require_createVariable_native(), import_createProxy = require_createProxy_native();
1710
1718
  function getVariantExtras(styleState) {
1711
1719
  let { curProps, conf, context, theme } = styleState, fonts = conf.fontsParsed;
1712
- context?.language && (fonts = getFontsForLanguage(conf.fontsParsed, context.language));
1720
+ context != null && context.language && (fonts = getFontsForLanguage(conf.fontsParsed, context.language));
1713
1721
  let fontFamily = (0, import_createVariable.getVariableValue)(
1714
1722
  styleState.fontFamily || styleState.curProps.fontFamily || styleState.conf.defaultFont
1715
1723
  );
@@ -1869,6 +1877,7 @@ var require_propMapper_native = __commonJS({
1869
1877
  return input;
1870
1878
  }
1871
1879
  var variableToFontNameCache = /* @__PURE__ */ new WeakMap(), fontFamilyCache = /* @__PURE__ */ new WeakMap(), getPropMappedFontFamily = (expanded) => expanded && fontFamilyCache.get(expanded), resolveTokensAndVariants = (key, value, styleProps, styleState, parentVariantKey) => {
1880
+ var _a;
1872
1881
  let { conf, staticConfig, debug, theme } = styleState, { variants } = staticConfig, res = {};
1873
1882
  debug === "verbose" && console.log(" - resolveTokensAndVariants", key, value);
1874
1883
  for (let rKey in value) {
@@ -1902,7 +1911,7 @@ var require_propMapper_native = __commonJS({
1902
1911
  debug === "verbose" && console.log("object", fKey, subObject), res[fKey] ??= {}, Object.assign(res[fKey], subObject);
1903
1912
  } else
1904
1913
  res[fKey] = val;
1905
- debug && res[fKey]?.[0] === "$" && console.warn(`\u26A0\uFE0F Missing token in theme ${theme.name}:`, fKey, res[fKey], theme);
1914
+ debug && ((_a = res[fKey]) == null ? void 0 : _a[0]) === "$" && console.warn(`\u26A0\uFE0F Missing token in theme ${theme.name}:`, fKey, res[fKey], theme);
1906
1915
  }
1907
1916
  return res;
1908
1917
  }, tokenCats = ["size", "color", "radius", "space", "zIndex"].map((name) => ({
@@ -1925,6 +1934,7 @@ var require_propMapper_native = __commonJS({
1925
1934
  fontSize: "size",
1926
1935
  fontWeight: "weight"
1927
1936
  }, getTokenForKey = (key, value, resolveAs = "none", styleState) => {
1937
+ var _a, _b;
1928
1938
  if (resolveAs === "none")
1929
1939
  return value;
1930
1940
  let { theme, conf = (0, import_config.getConfig)(), context, fontFamily } = styleState, tokensParsed = conf.tokensParsed, valOrVar, hasSet = !1;
@@ -1935,7 +1945,7 @@ var require_propMapper_native = __commonJS({
1935
1945
  else {
1936
1946
  switch (key) {
1937
1947
  case "fontFamily": {
1938
- valOrVar = (context?.language ? (0, import_getVariantExtras.getFontsForLanguage)(conf.fontsParsed, context.language) : conf.fontsParsed)[value]?.family || value, hasSet = !0;
1948
+ valOrVar = ((_a = (context != null && context.language ? (0, import_getVariantExtras.getFontsForLanguage)(conf.fontsParsed, context.language) : conf.fontsParsed)[value]) == null ? void 0 : _a.family) || value, hasSet = !0;
1939
1949
  break;
1940
1950
  }
1941
1951
  case "fontSize":
@@ -1943,7 +1953,10 @@ var require_propMapper_native = __commonJS({
1943
1953
  case "letterSpacing":
1944
1954
  case "fontWeight": {
1945
1955
  let fam = fontFamily || conf.defaultFont;
1946
- fam && (valOrVar = (context?.language ? (0, import_getVariantExtras.getFontsForLanguage)(conf.fontsParsed, context.language) : conf.fontsParsed)[fam]?.[fontShorthand[key] || key]?.[value] || value, hasSet = !0);
1956
+ if (fam) {
1957
+ let font = (context != null && context.language ? (0, import_getVariantExtras.getFontsForLanguage)(conf.fontsParsed, context.language) : conf.fontsParsed)[fam];
1958
+ valOrVar = ((_b = font == null ? void 0 : font[fontShorthand[key] || key]) == null ? void 0 : _b[value]) || value, hasSet = !0;
1959
+ }
1947
1960
  break;
1948
1961
  }
1949
1962
  }
@@ -2043,19 +2056,20 @@ var require_ThemeManager_native = __commonJS({
2043
2056
  getStateIfChanged(props = this.props, state = this.state, parentManager = this.parentManager) {
2044
2057
  let _ = this.getState(props, parentManager);
2045
2058
  if (state && state !== emptyState && !_)
2046
- return parentManager?.state;
2059
+ return parentManager == null ? void 0 : parentManager.state;
2047
2060
  if (this.getStateShouldChange(_, state))
2048
2061
  return _;
2049
2062
  }
2050
2063
  getStateShouldChange(nextState, state = this.state) {
2051
- return !(!nextState?.theme || nextState.theme === state?.theme);
2064
+ return !(!(nextState != null && nextState.theme) || nextState.theme === (state == null ? void 0 : state.theme));
2052
2065
  }
2053
2066
  getState(props = this.props, parentManager = this.parentManager) {
2054
- return getState(props, parentManager) || parentManager?.state || null;
2067
+ return getState(props, parentManager) || (parentManager == null ? void 0 : parentManager.state) || null;
2055
2068
  }
2056
2069
  get allKeys() {
2070
+ var _a;
2057
2071
  return this._allKeys ||= /* @__PURE__ */ new Set([
2058
- ...this.parentManager?.allKeys || [],
2072
+ ...((_a = this.parentManager) == null ? void 0 : _a.allKeys) || [],
2059
2073
  ...Object.keys(this.state.theme || {})
2060
2074
  ]), this._allKeys;
2061
2075
  }
@@ -2072,6 +2086,7 @@ var require_ThemeManager_native = __commonJS({
2072
2086
  return `t_sub_theme ${import_constants22.THEME_CLASSNAME_PREFIX}${name}`.replace("light_", "").replace("dark_", "");
2073
2087
  }
2074
2088
  function getState(props, parentManager) {
2089
+ var _a, _b, _c, _d, _e, _f;
2075
2090
  let validManagerAndAllComponentThemes = getNonComponentParentManager(parentManager);
2076
2091
  parentManager = validManagerAndAllComponentThemes[0];
2077
2092
  let allComponentThemes = validManagerAndAllComponentThemes[1], themes = (0, import_config.getThemes)(), isDirectParentAComponentTheme = allComponentThemes.length > 0;
@@ -2079,12 +2094,12 @@ var require_ThemeManager_native = __commonJS({
2079
2094
  throw new Error("Cannot reset + set new name");
2080
2095
  if (!props.name && !props.inverse && !props.reset && !props.componentName)
2081
2096
  return null;
2082
- if (props.reset && !isDirectParentAComponentTheme && !parentManager?.parentManager)
2097
+ if (props.reset && !isDirectParentAComponentTheme && !(parentManager != null && parentManager.parentManager))
2083
2098
  return console.warn("Cannot reset no grandparent exists"), null;
2084
- let result = null, nextName = props.reset ? isDirectParentAComponentTheme ? parentManager?.state?.name || "" : parentManager?.parentManager?.state?.name || "" : props.name || "", { componentName } = props, parentName = props.reset ? isDirectParentAComponentTheme ? (
2099
+ let result = null, nextName = props.reset ? isDirectParentAComponentTheme ? ((_a = parentManager == null ? void 0 : parentManager.state) == null ? void 0 : _a.name) || "" : ((_c = (_b = parentManager == null ? void 0 : parentManager.parentManager) == null ? void 0 : _b.state) == null ? void 0 : _c.name) || "" : props.name || "", { componentName } = props, parentName = props.reset ? isDirectParentAComponentTheme ? (
2085
2100
  // here because parentManager already skipped componentTheme so we have to only go up once
2086
- parentManager?.parentManager?.state.name || ""
2087
- ) : parentManager?.parentManager?.parentManager?.state.name || "" : isDirectParentAComponentTheme ? allComponentThemes[0] || "" : parentManager?.state.name || "";
2101
+ ((_d = parentManager == null ? void 0 : parentManager.parentManager) == null ? void 0 : _d.state.name) || ""
2102
+ ) : ((_f = (_e = parentManager == null ? void 0 : parentManager.parentManager) == null ? void 0 : _e.parentManager) == null ? void 0 : _f.state.name) || "" : isDirectParentAComponentTheme ? allComponentThemes[0] || "" : (parentManager == null ? void 0 : parentManager.state.name) || "";
2088
2103
  props.reset && isDirectParentAComponentTheme && allComponentThemes.shift();
2089
2104
  let base = parentName.split(import_constants22.THEME_NAME_SEPARATOR), lastSegment = base[base.length - 1], isParentComponentTheme = parentName && lastSegment[0].toUpperCase() === lastSegment[0];
2090
2105
  isParentComponentTheme && base.pop();
@@ -2142,9 +2157,10 @@ var require_ThemeManager_native = __commonJS({
2142
2157
  }
2143
2158
  var inverseThemeName = (themeName) => themeName.startsWith("light") ? themeName.replace(/^light/, "dark") : themeName.replace(/^dark/, "light");
2144
2159
  function getNonComponentParentManager(themeManager) {
2160
+ var _a;
2145
2161
  let res = themeManager, componentThemeNames = [];
2146
- for (; res && res?.isComponent; )
2147
- componentThemeNames.push(res?.state?.name), res = res.parentManager;
2162
+ for (; res && res != null && res.isComponent; )
2163
+ componentThemeNames.push((_a = res == null ? void 0 : res.state) == null ? void 0 : _a.name), res = res.parentManager;
2148
2164
  return [res || null, componentThemeNames];
2149
2165
  }
2150
2166
  }
@@ -2189,7 +2205,7 @@ var require_getThemeUnwrapped_native = __commonJS({
2189
2205
  getThemeUnwrapped: () => getThemeUnwrapped
2190
2206
  });
2191
2207
  module2.exports = __toCommonJS2(getThemeUnwrapped_exports);
2192
- var getThemeUnwrapped = (theme) => theme?.[GetThemeUnwrapped] || theme, GetThemeUnwrapped = Symbol();
2208
+ var getThemeUnwrapped = (theme) => (theme == null ? void 0 : theme[GetThemeUnwrapped]) || theme, GetThemeUnwrapped = Symbol();
2193
2209
  }
2194
2210
  });
2195
2211
 
@@ -2230,9 +2246,10 @@ var require_useTheme_native = __commonJS({
2230
2246
  !1,
2231
2247
  keys.current,
2232
2248
  import_constants2.isServer ? void 0 : () => {
2233
- let next = props.shouldUpdate?.() ?? (keys.current.length > 0 ? !0 : void 0);
2249
+ var _a, _b;
2250
+ let next = ((_a = props.shouldUpdate) == null ? void 0 : _a.call(props)) ?? (keys.current.length > 0 ? !0 : void 0);
2234
2251
  return props.debug && props.debug !== "profile" && console.log(" \u{1F3A8} useTheme() shouldUpdate?", next, {
2235
- shouldUpdateProp: props.shouldUpdate?.(),
2252
+ shouldUpdateProp: (_b = props.shouldUpdate) == null ? void 0 : _b.call(props),
2236
2253
  keys: [...keys.current]
2237
2254
  }), next;
2238
2255
  }
@@ -2252,7 +2269,7 @@ var require_useTheme_native = __commonJS({
2252
2269
  if (Reflect.has(theme, key))
2253
2270
  return !0;
2254
2271
  if (typeof key == "string")
2255
- return key[0] === "$" && (key = key.slice(1)), themeManager?.allKeys.has(key);
2272
+ return key[0] === "$" && (key = key.slice(1)), themeManager == null ? void 0 : themeManager.allKeys.has(key);
2256
2273
  },
2257
2274
  get(_, key) {
2258
2275
  if (key === import_getThemeUnwrapped.GetThemeUnwrapped)
@@ -2292,7 +2309,7 @@ var require_useTheme_native = __commonJS({
2292
2309
  }
2293
2310
  let [themeState, setThemeState] = (0, import_react.useState)(createState), { state, mounted, isNewTheme, themeManager } = themeState, isInversingOnMount = !!(!themeState.mounted && props.inverse);
2294
2311
  function getShouldUpdateTheme(manager = themeManager, nextState, prevState = state, forceShouldChange = !1) {
2295
- let forceUpdate = shouldUpdate?.();
2312
+ let forceUpdate = shouldUpdate == null ? void 0 : shouldUpdate();
2296
2313
  if (!forceShouldChange && forceUpdate === !1)
2297
2314
  return;
2298
2315
  let next = nextState || manager.getState(props, parentManager);
@@ -2307,8 +2324,8 @@ var require_useTheme_native = __commonJS({
2307
2324
  isNewTheme && themeManager && activeThemeManagers.add(themeManager), (isNewTheme || getShouldUpdateTheme(themeManager)) && setThemeState(createState);
2308
2325
  let selfListenerDispose = themeManager.onChangeTheme((_a, _b, forced) => {
2309
2326
  forced && setThemeState((prev) => createState(prev, !0));
2310
- }), disposeChangeListener = parentManager?.onChangeTheme((name, manager) => {
2311
- let force = shouldUpdate?.(), doUpdate = force ?? !!(keys?.length || isNewTheme);
2327
+ }), disposeChangeListener = parentManager == null ? void 0 : parentManager.onChangeTheme((name, manager) => {
2328
+ let force = shouldUpdate == null ? void 0 : shouldUpdate(), doUpdate = force ?? !!(keys != null && keys.length || isNewTheme);
2312
2329
  props.debug && console.log(" \u{1F538} onChange", themeManager.id, {
2313
2330
  force,
2314
2331
  doUpdate,
@@ -2319,7 +2336,7 @@ var require_useTheme_native = __commonJS({
2319
2336
  }), doUpdate && setThemeState(createState);
2320
2337
  }, themeManager.id);
2321
2338
  return () => {
2322
- selfListenerDispose(), disposeChangeListener?.(), activeThemeManagers.delete(themeManager);
2339
+ selfListenerDispose(), disposeChangeListener == null || disposeChangeListener(), activeThemeManagers.delete(themeManager);
2323
2340
  };
2324
2341
  }, [
2325
2342
  themeManager,
@@ -2350,14 +2367,14 @@ var require_useTheme_native = __commonJS({
2350
2367
  themeManager
2351
2368
  };
2352
2369
  function createState(prev, force = !1) {
2353
- if (prev && shouldUpdate?.() === !1)
2370
+ if (prev && (shouldUpdate == null ? void 0 : shouldUpdate()) === !1)
2354
2371
  return prev;
2355
2372
  let themeManager2 = parentManager, state2;
2356
2373
  if ((0, import_ThemeManager.getHasThemeUpdatingProps)(props)) {
2357
2374
  let getNewThemeManager = () => new import_ThemeManager.ThemeManager(props, root ? "root" : parentManager);
2358
- if (prev?.themeManager) {
2375
+ if (prev != null && prev.themeManager) {
2359
2376
  themeManager2 = prev.themeManager;
2360
- let forceChange = !!keys?.length, next = themeManager2.getState(props, parentManager), nextState = getShouldUpdateTheme(
2377
+ let forceChange = !!(keys != null && keys.length), next = themeManager2.getState(props, parentManager), nextState = getShouldUpdateTheme(
2361
2378
  themeManager2,
2362
2379
  next,
2363
2380
  prev.state,
@@ -2367,8 +2384,8 @@ var require_useTheme_native = __commonJS({
2367
2384
  } else
2368
2385
  themeManager2 = getNewThemeManager(), state2 = { ...themeManager2.state };
2369
2386
  }
2370
- let isNewTheme2 = !!(themeManager2 !== parentManager || props.inverse), mounted2 = props.inverse ? root || prev?.mounted : !0;
2371
- if (state2 || (isNewTheme2 ? state2 = themeManager2.state : (state2 = parentManager.state, themeManager2 = parentManager)), !force && state2.name === prev?.state.name)
2387
+ let isNewTheme2 = !!(themeManager2 !== parentManager || props.inverse), mounted2 = props.inverse ? root || (prev == null ? void 0 : prev.mounted) : !0;
2388
+ if (state2 || (isNewTheme2 ? state2 = themeManager2.state : (state2 = parentManager.state, themeManager2 = parentManager)), !force && state2.name === (prev == null ? void 0 : prev.state.name))
2372
2389
  return prev;
2373
2390
  let response = {
2374
2391
  state: state2,
@@ -2378,7 +2395,7 @@ var require_useTheme_native = __commonJS({
2378
2395
  };
2379
2396
  if (props.debug && import_constants2.isClient) {
2380
2397
  console.groupCollapsed(` \u{1F537} ${themeManager2.id} useChangeThemeEffect createState`);
2381
- let parentState = { ...parentManager?.state }, parentId = parentManager?.id, themeManagerState = { ...themeManager2.state };
2398
+ let parentState = { ...parentManager == null ? void 0 : parentManager.state }, parentId = parentManager == null ? void 0 : parentManager.id, themeManagerState = { ...themeManager2.state };
2382
2399
  console.log({
2383
2400
  props,
2384
2401
  parentState,
@@ -2448,7 +2465,7 @@ var require_useMedia_native = __commonJS({
2448
2465
  if (media) {
2449
2466
  mediaVersion++;
2450
2467
  for (let key in media)
2451
- mediaState2[key] = mediaQueryDefaultActive?.[key] || !1, mediaKeys.add(`$${key}`);
2468
+ mediaState2[key] = (mediaQueryDefaultActive == null ? void 0 : mediaQueryDefaultActive[key]) || !1, mediaKeys.add(`$${key}`);
2452
2469
  Object.assign(mediaQueryConfig2, media), initState = { ...mediaState2 }, mediaKeysOrdered = Object.keys(media), config.disableSSR ? setupMediaListeners() : updateCurrentState();
2453
2470
  }
2454
2471
  };
@@ -2501,8 +2518,8 @@ var require_useMedia_native = __commonJS({
2501
2518
  let { touched, prev } = internal.current, componentState = uid ? shouldUpdate.get(uid) : void 0;
2502
2519
  if (componentState && componentState.enabled === !1)
2503
2520
  return prev;
2504
- let testKeys = componentState?.keys ?? ((!componentState || componentState.enabled) && touched ? [...touched] : null);
2505
- return !testKeys || testKeys?.every((key) => mediaState2[key] === prev[key]) ? prev : (internal.current.prev = mediaState2, mediaState2);
2521
+ let testKeys = (componentState == null ? void 0 : componentState.keys) ?? ((!componentState || componentState.enabled) && touched ? [...touched] : null);
2522
+ return !testKeys || testKeys != null && testKeys.every((key) => mediaState2[key] === prev[key]) ? prev : (internal.current.prev = mediaState2, mediaState2);
2506
2523
  },
2507
2524
  () => initState
2508
2525
  );
@@ -2513,7 +2530,7 @@ var require_useMedia_native = __commonJS({
2513
2530
  });
2514
2531
  }
2515
2532
  function useMediaPropsActive2(props, opts) {
2516
- let media = useMedia2(), resolveAs = opts?.resolveValues || "none", theme = resolveAs ? (0, import_useTheme.useTheme)() : null, styleState = { theme }, shouldExpandShorthands = opts?.expandShorthands;
2533
+ let media = useMedia2(), resolveAs = (opts == null ? void 0 : opts.resolveValues) || "none", theme = resolveAs ? (0, import_useTheme.useTheme)() : null, styleState = { theme }, shouldExpandShorthands = opts == null ? void 0 : opts.expandShorthands;
2517
2534
  return (0, import_react.useMemo)(() => {
2518
2535
  let config = (0, import_config.getConfig)(), next = {}, importancesUsed = {}, propNames = Object.keys(props), len = propNames.length;
2519
2536
  for (let i = 0; i < len; i++) {
@@ -2822,6 +2839,41 @@ var require_ComponentContext_native = __commonJS({
2822
2839
  }
2823
2840
  });
2824
2841
 
2842
+ // ../web/dist/cjs/defaultComponentState.native.js
2843
+ var require_defaultComponentState_native = __commonJS({
2844
+ "../web/dist/cjs/defaultComponentState.native.js"(exports, module2) {
2845
+ "use strict";
2846
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2847
+ for (var name in all)
2848
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
2849
+ }, __copyProps2 = (to, from, except, desc) => {
2850
+ if (from && typeof from == "object" || typeof from == "function")
2851
+ for (let key of __getOwnPropNames2(from))
2852
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2853
+ return to;
2854
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), defaultComponentState_exports = {};
2855
+ __export2(defaultComponentState_exports, {
2856
+ defaultComponentState: () => defaultComponentState,
2857
+ defaultComponentStateMounted: () => defaultComponentStateMounted,
2858
+ defaultComponentStateShouldEnter: () => defaultComponentStateShouldEnter
2859
+ });
2860
+ module2.exports = __toCommonJS2(defaultComponentState_exports);
2861
+ var defaultComponentState = {
2862
+ hover: !1,
2863
+ press: !1,
2864
+ pressIn: !1,
2865
+ focus: !1,
2866
+ unmounted: !0
2867
+ }, defaultComponentStateMounted = {
2868
+ ...defaultComponentState,
2869
+ unmounted: !1
2870
+ }, defaultComponentStateShouldEnter = {
2871
+ ...defaultComponentState,
2872
+ unmounted: "should-enter"
2873
+ };
2874
+ }
2875
+ });
2876
+
2825
2877
  // ../web/dist/cjs/helpers/createShallowSetState.native.js
2826
2878
  var require_createShallowSetState_native = __commonJS({
2827
2879
  "../web/dist/cjs/helpers/createShallowSetState.native.js"(exports, module2) {
@@ -2977,8 +3029,8 @@ var require_createMediaStyle_native = __commonJS({
2977
3029
  if (isNonWindowMedia) {
2978
3030
  let precedenceImportancePrefix = new Array((priority || 0) + (isGroup ? 1 : 0)).fill(":root").join("");
2979
3031
  if (isThemeMedia || isGroup) {
2980
- let groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyIn), mediaName = groupInfo?.name;
2981
- groupMediaKey = groupInfo?.media, isGroup && (containerName = mediaName);
3032
+ let groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyIn), mediaName = groupInfo == null ? void 0 : groupInfo.name;
3033
+ groupMediaKey = groupInfo == null ? void 0 : groupInfo.media, isGroup && (containerName = mediaName);
2982
3034
  let name = (isGroup ? "group_" : "") + mediaName, selectorStart = styleInner.indexOf(":root"), selectorEnd = styleInner.lastIndexOf("{"), selector = styleInner.slice(selectorStart, selectorEnd), precedenceSpace = conf.themeClassNameOnRoot ? "" : " ", pseudoSelectorName = groupInfo.pseudo ? groupPseudoToPseudoCSSMap[groupInfo.pseudo] || groupInfo.pseudo : void 0, pseudoSelector = pseudoSelectorName ? `:${pseudoSelectorName}` : "", presedencePrefix = `:root${precedenceImportancePrefix}${precedenceSpace}`, mediaSelector = `.t_${name}${pseudoSelector}`, nextSelector = `${presedencePrefix}${mediaSelector} ${selector.replace(
2983
3035
  ":root",
2984
3036
  ""
@@ -3061,6 +3113,7 @@ var require_getSplitStyles_native = __commonJS({
3061
3113
  });
3062
3114
  module2.exports = __toCommonJS2(getSplitStyles_exports);
3063
3115
  var import_constants2 = require_index_native(), import_helpers = require_index_native3(), import_react = require("react"), import_config = require_config_native(), import_accessibilityDirectMap = require_accessibilityDirectMap_native(), import_isDevTools = require_isDevTools_native(), import_useMedia = require_useMedia_native(), import_createMediaStyle = require_createMediaStyle_native(), import_expandStyles = require_expandStyles_native(), import_getGroupPropParts = require_getGroupPropParts_native(), import_getStylesAtomic = require_getStylesAtomic_native(), import_insertStyleRule = require_insertStyleRule_native(), import_normalizeValueWithProperty = require_normalizeValueWithProperty_native(), import_propMapper = require_propMapper_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), fontFamilyKey = "fontFamily", IS_STATIC = process.env.IS_STATIC === "is_static", conf, PROP_SPLIT = "-", getSplitStyles = (props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug) => {
3116
+ var _a, _b, _c, _e, _f, _g;
3064
3117
  conf = conf || (0, import_config.getConfig)();
3065
3118
  let { shorthands } = conf, {
3066
3119
  isHOC,
@@ -3152,12 +3205,12 @@ var require_getSplitStyles_native = __commonJS({
3152
3205
  if (isStyleProp && props.asChild === "except-style")
3153
3206
  continue;
3154
3207
  let shouldPassProp = !isStyleProp || // is in parent variants
3155
- isHOC && parentStaticConfig?.variants && keyInit in parentStaticConfig.variants || inlineProps?.has(keyInit), isHOCShouldPassThrough = !!(isHOC && (isShorthand || isValidStyleKeyInit || isMediaOrPseudo || parentStaticConfig?.variants?.[keyInit] || keyInit in skipProps)), shouldPassThrough = shouldPassProp || isHOCShouldPassThrough;
3208
+ isHOC && (parentStaticConfig == null ? void 0 : parentStaticConfig.variants) && keyInit in parentStaticConfig.variants || (inlineProps == null ? void 0 : inlineProps.has(keyInit)), isHOCShouldPassThrough = !!(isHOC && (isShorthand || isValidStyleKeyInit || isMediaOrPseudo || (_a = parentStaticConfig == null ? void 0 : parentStaticConfig.variants) != null && _a[keyInit] || keyInit in skipProps)), shouldPassThrough = shouldPassProp || isHOCShouldPassThrough;
3156
3209
  if (debug === "verbose" && (console.groupCollapsed(
3157
3210
  `\u{1F539}\u{1F539}\u{1F539}\u{1F539} ${keyOg}${keyInit !== keyOg ? ` (shorthand for ${keyInit})` : ""} ${shouldPassThrough ? "(pass)" : ""} \u{1F539}\u{1F539}\u{1F539}\u{1F539}`
3158
3211
  ), console.log({ isVariant, valInit, shouldPassProp }), import_constants2.isClient && console.log({
3159
3212
  variants,
3160
- variant: variants?.[keyInit],
3213
+ variant: variants == null ? void 0 : variants[keyInit],
3161
3214
  isVariant,
3162
3215
  isHOCShouldPassThrough,
3163
3216
  curProps: { ...styleState.curProps },
@@ -3177,7 +3230,7 @@ var require_getSplitStyles_native = __commonJS({
3177
3230
  styleProps,
3178
3231
  componentState,
3179
3232
  isVariant,
3180
- variant: variants?.[keyInit],
3233
+ variant: variants == null ? void 0 : variants[keyInit],
3181
3234
  shouldPassProp,
3182
3235
  isHOCShouldPassThrough,
3183
3236
  theme,
@@ -3195,7 +3248,7 @@ current`, {
3195
3248
  if (expanded) {
3196
3249
  for (let [key, val] of expanded)
3197
3250
  if (!(val == null || key in usedKeys)) {
3198
- if (isPseudo = key in import_helpers.validPseudoKeys, isMedia = !isPseudo && !isValidStyleKeyInit && (0, import_useMedia.isMediaKey)(key), isMediaOrPseudo = isMedia || isPseudo, isVariant = variants && key in variants, (inlineProps?.has(key) || IS_STATIC && inlineWhenUnflattened?.has(key)) && (viewProps[key] = props[key] ?? val), isHOC && (isMediaOrPseudo || parentStaticConfig?.variants?.[keyInit])) {
3251
+ if (isPseudo = key in import_helpers.validPseudoKeys, isMedia = !isPseudo && !isValidStyleKeyInit && (0, import_useMedia.isMediaKey)(key), isMediaOrPseudo = isMedia || isPseudo, isVariant = variants && key in variants, (inlineProps != null && inlineProps.has(key) || IS_STATIC && inlineWhenUnflattened != null && inlineWhenUnflattened.has(key)) && (viewProps[key] = props[key] ?? val), isHOC && (isMediaOrPseudo || ((_b = parentStaticConfig == null ? void 0 : parentStaticConfig.variants) == null ? void 0 : _b[keyInit]))) {
3199
3252
  passDownProp(viewProps, key, val, isMediaOrPseudo), debug === "verbose" && (console.groupCollapsed(` - passing down prop ${key}`), console.log({ val, after: { ...viewProps[key] } }), console.groupEnd());
3200
3253
  continue;
3201
3254
  }
@@ -3212,7 +3265,11 @@ current`, {
3212
3265
  `No animation prop given to component ${staticConfig.componentName || ""} with enterStyle / exitStyle, these styles will be ignore.`
3213
3266
  ), !descriptor || isExit && !styleProps.isExiting)
3214
3267
  continue;
3215
- if ((!shouldDoClasses || IS_STATIC) && (pseudos ||= {}, pseudos[key] ||= {}, IS_STATIC && Object.assign(pseudos[key], pseudoStyleObject)), shouldDoClasses && !isEnter && !isExit) {
3268
+ if ((!shouldDoClasses || IS_STATIC) && (pseudos ||= {}, pseudos[key] ||= {}, IS_STATIC)) {
3269
+ Object.assign(pseudos[key], pseudoStyleObject);
3270
+ continue;
3271
+ }
3272
+ if (shouldDoClasses && !isEnter && !isExit) {
3216
3273
  let pseudoStyles = (0, import_getStylesAtomic.generateAtomicStyles)(pseudoStyleObject, descriptor);
3217
3274
  debug === "verbose" && (console.groupCollapsed("pseudo (classes)", key), console.log({ pseudoStyleObject, pseudoStyles }), console.groupEnd());
3218
3275
  for (let psuedoStyle of pseudoStyles)
@@ -3309,22 +3366,24 @@ current`, {
3309
3366
  if (!(themeName === mediaThemeName || themeName.startsWith(mediaThemeName)))
3310
3367
  continue;
3311
3368
  } else if (isGroupMedia) {
3312
- let groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyShort), groupName = groupInfo.name, groupContext = context?.groups.state[groupName];
3369
+ let groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyShort), groupName = groupInfo.name, groupContext = context == null ? void 0 : context.groups.state[groupName];
3313
3370
  if (!groupContext) {
3314
3371
  debug && console.warn(`No parent with group prop, skipping styles: ${groupName}`);
3315
3372
  continue;
3316
3373
  }
3317
- let groupPseudoKey = groupInfo.pseudo, groupMediaKey = groupInfo.media, componentGroupState = componentState.group?.[groupName];
3374
+ let groupPseudoKey = groupInfo.pseudo, groupMediaKey = groupInfo.media, componentGroupState = (_c = componentState.group) == null ? void 0 : _c[groupName];
3318
3375
  if (groupMediaKey) {
3319
3376
  mediaGroups ||= /* @__PURE__ */ new Set(), mediaGroups.add(groupMediaKey);
3320
- let mediaState22 = componentGroupState?.media, isActive = mediaState22?.[groupMediaKey];
3377
+ let mediaState22 = componentGroupState == null ? void 0 : componentGroupState.media, isActive = mediaState22 == null ? void 0 : mediaState22[groupMediaKey];
3321
3378
  if (!mediaState22 && groupContext.layout && (isActive = (0, import_useMedia.mediaKeyMatch)(groupMediaKey, groupContext.layout)), !isActive)
3322
3379
  continue;
3323
3380
  importanceBump = 2;
3324
3381
  }
3325
3382
  if (groupPseudoKey) {
3326
- if (pseudoGroups ||= /* @__PURE__ */ new Set(), pseudoGroups.add(groupName), !(componentGroupState || // fallback to context initially
3327
- context.groups.state[groupName]).pseudo?.[groupPseudoKey])
3383
+ pseudoGroups ||= /* @__PURE__ */ new Set(), pseudoGroups.add(groupName);
3384
+ let componentGroupPseudoState = (componentGroupState || // fallback to context initially
3385
+ context.groups.state[groupName]).pseudo;
3386
+ if (!(componentGroupPseudoState != null && componentGroupPseudoState[groupPseudoKey]))
3328
3387
  continue;
3329
3388
  importanceBump = import_pseudoDescriptors.pseudoPriorities[groupPseudoKey];
3330
3389
  }
@@ -3391,9 +3450,9 @@ current`, {
3391
3450
  mediaGroups
3392
3451
  };
3393
3452
  if (style.fontFamily) {
3394
- let faceInfo = (0, import_config.getFont)(style.fontFamily)?.face;
3453
+ let faceInfo = (_e = (0, import_config.getFont)(style.fontFamily)) == null ? void 0 : _e.face;
3395
3454
  if (faceInfo) {
3396
- let overrideFace = faceInfo[style.fontWeight]?.[style.fontStyle || "normal"]?.val;
3455
+ let overrideFace = (_g = (_f = faceInfo[style.fontWeight]) == null ? void 0 : _f[style.fontStyle || "normal"]) == null ? void 0 : _g.val;
3397
3456
  overrideFace && (style.fontFamily = overrideFace, styleState.fontFamily = overrideFace, delete style.fontWeight, delete style.fontStyle);
3398
3457
  }
3399
3458
  debug && debug !== "profile" && console.log(`Found fontFamily native: ${style.fontFamily}`, faceInfo);
@@ -3420,7 +3479,7 @@ current`, {
3420
3479
  };
3421
3480
  function mergeStyle(styleState, key, val) {
3422
3481
  let { classNames, viewProps, style, usedKeys } = styleState;
3423
- if (import_constants2.isWeb && val?.[0] === "_")
3482
+ if (import_constants2.isWeb && (val == null ? void 0 : val[0]) === "_")
3424
3483
  classNames[key] = val, usedKeys[key] ||= 1;
3425
3484
  else if (key in import_helpers.stylePropsTransform)
3426
3485
  styleState.transforms ||= {}, styleState.transforms[key] = val;
@@ -3542,7 +3601,7 @@ var require_mergeProps_native = __commonJS({
3542
3601
  return out;
3543
3602
  };
3544
3603
  function mergeProp(out, a, b, key, inverseShorthands) {
3545
- let shorthand = inverseShorthands?.[key] || null;
3604
+ let shorthand = (inverseShorthands == null ? void 0 : inverseShorthands[key]) || null;
3546
3605
  if (b && (key in b || shorthand && shorthand in b))
3547
3606
  return;
3548
3607
  let val = a[key];
@@ -3741,7 +3800,7 @@ var require_themeable_native = __commonJS({
3741
3800
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
3742
3801
  import_Theme.Theme,
3743
3802
  {
3744
- componentName: componentName || staticConfig?.componentName,
3803
+ componentName: componentName || (staticConfig == null ? void 0 : staticConfig.componentName),
3745
3804
  name: theme || null,
3746
3805
  "disable-child-theme": !0,
3747
3806
  debug: props.debug,
@@ -3751,7 +3810,7 @@ var require_themeable_native = __commonJS({
3751
3810
  }
3752
3811
  );
3753
3812
  });
3754
- return withTheme.displayName = `Themed(${component?.displayName || component?.name || "Anonymous"})`, withTheme;
3813
+ return withTheme.displayName = `Themed(${(component == null ? void 0 : component.displayName) || (component == null ? void 0 : component.name) || "Anonymous"})`, withTheme;
3755
3814
  }
3756
3815
  }
3757
3816
  });
@@ -3856,24 +3915,11 @@ var require_createComponent_native = __commonJS({
3856
3915
  Spacer: () => Spacer,
3857
3916
  Unspaced: () => Unspaced,
3858
3917
  createComponent: () => createComponent,
3859
- defaultComponentState: () => defaultComponentState,
3860
3918
  mouseUps: () => mouseUps,
3861
3919
  spacedChildren: () => spacedChildren
3862
3920
  });
3863
3921
  module2.exports = __toCommonJS2(createComponent_exports);
3864
- var import_compose_refs = require_index_native5(), import_constants2 = require_index_native(), import_helpers = require_index_native3(), import_use_did_finish_ssr = require_index_native6(), import_react = __toESM2(require("react")), import_config = require_config_native(), import_constants22 = require_constants_native(), import_ComponentContext = require_ComponentContext_native(), import_createVariable = require_createVariable_native(), import_createShallowSetState = require_createShallowSetState_native(), import_getSplitStyles = require_getSplitStyles_native(), import_mergeProps = require_mergeProps_native(), import_proxyThemeVariables = require_proxyThemeVariables_native(), import_themeable = require_themeable_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(), import_ThemeDebug = require_ThemeDebug_native(), import_jsx_runtime = require("react/jsx-runtime"), defaultComponentState = {
3865
- hover: !1,
3866
- press: !1,
3867
- pressIn: !1,
3868
- focus: !1,
3869
- unmounted: !0
3870
- }, defaultComponentStateMounted = {
3871
- ...defaultComponentState,
3872
- unmounted: !1
3873
- }, defaultComponentStateShouldEnter = {
3874
- ...defaultComponentState,
3875
- unmounted: "should-enter"
3876
- }, tamaguiConfig, AnimatedText, AnimatedView, initialTheme, time, mouseUps = /* @__PURE__ */ new Set();
3922
+ var import_compose_refs = require_index_native5(), import_constants2 = require_index_native(), import_helpers = require_index_native3(), import_use_did_finish_ssr = require_index_native6(), import_react = __toESM2(require("react")), import_config = require_config_native(), import_constants22 = require_constants_native(), import_ComponentContext = require_ComponentContext_native(), import_createVariable = require_createVariable_native(), import_defaultComponentState = require_defaultComponentState_native(), import_createShallowSetState = require_createShallowSetState_native(), import_getSplitStyles = require_getSplitStyles_native(), import_mergeProps = require_mergeProps_native(), import_proxyThemeVariables = require_proxyThemeVariables_native(), import_themeable = require_themeable_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(), import_ThemeDebug = require_ThemeDebug_native(), import_jsx_runtime = require("react/jsx-runtime"), tamaguiConfig, AnimatedText, AnimatedView, initialTheme, time, mouseUps = /* @__PURE__ */ new Set();
3877
3923
  if (typeof document < "u") {
3878
3924
  let cancelTouches = () => {
3879
3925
  mouseUps.forEach((x) => x()), mouseUps.clear();
@@ -3882,6 +3928,7 @@ var require_createComponent_native = __commonJS({
3882
3928
  }
3883
3929
  var BaseText, BaseView, hasSetupBaseViews = !1;
3884
3930
  function createComponent(staticConfig) {
3931
+ var _a;
3885
3932
  let config = null;
3886
3933
  (0, import_config.onConfiguredOnce)((conf) => {
3887
3934
  if (config = conf, !tamaguiConfig && (tamaguiConfig = conf, !initialTheme)) {
@@ -3897,15 +3944,16 @@ var require_createComponent_native = __commonJS({
3897
3944
  validStyles: validStyles2 = {},
3898
3945
  variants = {}
3899
3946
  } = staticConfig, defaultComponentClassName = `is_${staticConfig.componentName}`, defaultProps = staticConfig.defaultProps;
3900
- staticConfig.defaultProps?.debug && process.env.IS_STATIC !== "is_static" && console.log(`\u{1F41B} [${staticConfig.componentName || "Component"}]`, {
3947
+ (_a = staticConfig.defaultProps) != null && _a.debug && process.env.IS_STATIC !== "is_static" && console.log(`\u{1F41B} [${staticConfig.componentName || "Component"}]`, {
3901
3948
  staticConfig,
3902
3949
  defaultProps,
3903
3950
  defaultPropsKeyOrder: defaultProps ? Object.keys(defaultProps) : []
3904
3951
  });
3905
3952
  let component = (0, import_react.forwardRef)((propsIn, forwardedRef) => {
3953
+ var _a2, _b, _c, _d, _g, _h, _i, _j, _k;
3906
3954
  if (!hasSetupBaseViews) {
3907
3955
  hasSetupBaseViews = !0;
3908
- let baseViews = import_setupHooks.hooks.getBaseViews?.();
3956
+ let baseViews = (_b = (_a2 = import_setupHooks.hooks).getBaseViews) == null ? void 0 : _b.call(_a2);
3909
3957
  baseViews && (BaseText = baseViews.Text, BaseView = baseViews.View);
3910
3958
  }
3911
3959
  let componentContext = (0, import_react.useContext)(import_ComponentContext.ComponentContext), styledContextProps, overriddenContextProps, contextValue, { context } = staticConfig;
@@ -3915,7 +3963,7 @@ var require_createComponent_native = __commonJS({
3915
3963
  for (let key in context.props) {
3916
3964
  let propVal = (
3917
3965
  // because its after default props but before props this annoying amount of checks
3918
- propsIn[key] ?? propsIn[inverseShorthands[key]] ?? defaultProps?.[key] ?? defaultProps?.[inverseShorthands[key]]
3966
+ propsIn[key] ?? propsIn[inverseShorthands[key]] ?? (defaultProps == null ? void 0 : defaultProps[key]) ?? (defaultProps == null ? void 0 : defaultProps[inverseShorthands[key]])
3919
3967
  );
3920
3968
  propVal === void 0 ? contextValue && (key in validStyles2 || key in variants) && (styledContextProps ||= {}, styledContextProps[key] = contextValue[key]) : (overriddenContextProps ||= {}, overriddenContextProps[key] = propVal);
3921
3969
  }
@@ -3924,20 +3972,20 @@ var require_createComponent_native = __commonJS({
3924
3972
  curDefaultProps ? props = (0, import_mergeProps.mergeProps)(curDefaultProps, propsIn) : props = propsIn;
3925
3973
  let debugProp = props.debug, componentName = props.componentName || staticConfig.componentName;
3926
3974
  time && time`start (ignore)`;
3927
- let isHydrated = config?.disableSSR ? !0 : (0, import_use_did_finish_ssr.useDidFinishSSR)();
3975
+ let isHydrated = config != null && config.disableSSR ? !0 : (0, import_use_did_finish_ssr.useDidFinishSSR)();
3928
3976
  time && time`did-finish-ssr`;
3929
3977
  let stateRef = (0, import_react.useRef)(
3930
3978
  void 0
3931
3979
  );
3932
3980
  stateRef.current ||= {}, time && time`stateref`;
3933
- let hostRef = (0, import_react.useRef)(null), animationsConfig = componentContext.animationDriver, useAnimations = animationsConfig?.useAnimations, hasAnimationProp = !!(props.animation || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationsConfig?.supportsCSSVars, willBeAnimated = (() => {
3981
+ let hostRef = (0, import_react.useRef)(null), animationsConfig = componentContext.animationDriver, useAnimations = animationsConfig == null ? void 0 : animationsConfig.useAnimations, hasAnimationProp = !!(props.animation || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationsConfig == null ? void 0 : animationsConfig.supportsCSSVars, willBeAnimated = (() => {
3934
3982
  if (import_constants2.isServer && !supportsCSSVars)
3935
3983
  return !1;
3936
3984
  let curState = stateRef.current;
3937
3985
  return !!(hasAnimationProp && !isHOC && useAnimations || curState.hasAnimated);
3938
- })(), usePresence = animationsConfig?.usePresence, presence = willBeAnimated && usePresence?.() || null, hasEnterStyle = !!props.enterStyle, needsMount = !!((!import_constants2.isWeb || import_constants2.isClient) && willBeAnimated);
3986
+ })(), usePresence = animationsConfig == null ? void 0 : animationsConfig.usePresence, presence = willBeAnimated && (usePresence == null ? void 0 : usePresence()) || null, hasEnterStyle = !!props.enterStyle, needsMount = !!((!import_constants2.isWeb || import_constants2.isClient) && willBeAnimated);
3939
3987
  time && time`pre-use-state`;
3940
- let initialState = willBeAnimated ? supportsCSSVars ? defaultComponentStateShouldEnter : defaultComponentState : defaultComponentStateMounted, states = (0, import_react.useState)(initialState), state = propsIn.forceStyle ? { ...states[0], [propsIn.forceStyle]: !0 } : states[0], setState = states[1], setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState), groupName = props.group, groupClassName = groupName ? `t_group_${props.group}` : "";
3988
+ let initialState = willBeAnimated ? supportsCSSVars ? import_defaultComponentState.defaultComponentStateShouldEnter : import_defaultComponentState.defaultComponentState : import_defaultComponentState.defaultComponentStateMounted, states = (0, import_react.useState)(initialState), state = propsIn.forceStyle ? { ...states[0], [propsIn.forceStyle]: !0 } : states[0], setState = states[1], setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState), groupName = props.group, groupClassName = groupName ? `t_group_${props.group}` : "";
3941
3989
  if (groupName) {
3942
3990
  let groupContextState = componentContext.groups.state, og = setStateShallow;
3943
3991
  setStateShallow = (state2) => {
@@ -3954,7 +4002,7 @@ var require_createComponent_native = __commonJS({
3954
4002
  time && time`use-state`;
3955
4003
  let isAnimated = willBeAnimated;
3956
4004
  willBeAnimated && !supportsCSSVars && !presence && isHydrated && (import_constants2.isServer || state.unmounted === !0) && (isAnimated = !1), willBeAnimated && !stateRef.current.hasAnimated && (stateRef.current.hasAnimated = !0);
3957
- let componentClassName = props.asChild ? "" : props.componentName ? `is_${props.componentName}` : defaultComponentClassName, hasTextAncestor = !!(import_constants2.isWeb && isText && componentContext.inText), isDisabled = props.disabled ?? props.accessibilityState?.disabled;
4005
+ let componentClassName = props.asChild ? "" : props.componentName ? `is_${props.componentName}` : defaultComponentClassName, hasTextAncestor = !!(import_constants2.isWeb && isText && componentContext.inText), isDisabled = props.disabled ?? ((_c = props.accessibilityState) == null ? void 0 : _c.disabled);
3958
4006
  time && time`use-context`;
3959
4007
  let element = import_constants2.isWeb && (!Component || typeof Component == "string") && props.tag || Component, BaseTextComponent = BaseText || element || "span", BaseViewComponent = BaseView || element || (hasTextAncestor ? "span" : "div");
3960
4008
  AnimatedText = animationsConfig ? animationsConfig.Text : BaseTextComponent, AnimatedView = animationsConfig ? animationsConfig.View : BaseViewComponent;
@@ -3966,7 +4014,7 @@ var require_createComponent_native = __commonJS({
3966
4014
  isEntering && enterVariant ? (debugProp === "verbose" && console.warn(`Animating presence ENTER "${enterVariant}"`), props[enterVariant] = !0) : isExiting2 && exitVariant && (debugProp === "verbose" && console.warn(`Animating presence EXIT "${enterVariant}"`), props[exitVariant] = !enterExitVariant);
3967
4015
  }
3968
4016
  }
3969
- let isAnimatedReactNative = hasAnimationProp && animationsConfig?.isReactNative, isReactNative = !!(staticConfig.isReactNative || isAnimatedReactNative), shouldAvoidClasses = !!(!import_constants2.isWeb || isAnimated || !staticConfig.acceptsClassName || propsIn.disableClassName), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo, disableThemeProp = props["data-disable-theme"], disableTheme = disableThemeProp && !willBeAnimated || isHOC;
4017
+ let isAnimatedReactNative = hasAnimationProp && (animationsConfig == null ? void 0 : animationsConfig.isReactNative), isReactNative = !!(staticConfig.isReactNative || isAnimatedReactNative), shouldAvoidClasses = !!(!import_constants2.isWeb || isAnimated || !staticConfig.acceptsClassName || propsIn.disableClassName), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo, disableThemeProp = props["data-disable-theme"], disableTheme = disableThemeProp && !willBeAnimated || isHOC;
3970
4018
  time && time`theme-props`, props.themeShallow && (stateRef.current.themeShallow = !0);
3971
4019
  let themeStateProps = {
3972
4020
  name: props.theme,
@@ -3976,11 +4024,11 @@ var require_createComponent_native = __commonJS({
3976
4024
  shallow: stateRef.current.themeShallow,
3977
4025
  shouldUpdate: () => stateRef.current.isListeningToTheme,
3978
4026
  debug: debugProp
3979
- }, isExiting = !state.unmounted && presence?.[0] === !1;
4027
+ }, isExiting = !state.unmounted && (presence == null ? void 0 : presence[0]) === !1;
3980
4028
  {
3981
4029
  let id = (0, import_react.useId)();
3982
4030
  if (debugProp && debugProp !== "profile") {
3983
- let name = `${componentName || Component?.displayName || Component?.name || "[Unnamed Component]"}`, type = isAnimatedReactNative ? "(animated)" : isReactNative ? "(rnw)" : "", dataIs = propsIn["data-is"] || "", banner = `${name}${dataIs ? ` ${dataIs}` : ""} ${type} id ${id}`;
4031
+ let name = `${componentName || (Component == null ? void 0 : Component.displayName) || (Component == null ? void 0 : Component.name) || "[Unnamed Component]"}`, type = isAnimatedReactNative ? "(animated)" : isReactNative ? "(rnw)" : "", dataIs = propsIn["data-is"] || "", banner = `${name}${dataIs ? ` ${dataIs}` : ""} ${type} id ${id}`;
3984
4032
  console.group(
3985
4033
  `%c ${banner} (unmounted: ${state.unmounted})${presence ? ` (presence: ${presence[0]})` : ""} ${isHydrated ? "\u{1F4A6}" : "\u{1F3DC}\uFE0F"}`,
3986
4034
  "background: green; color: white;"
@@ -4018,7 +4066,7 @@ var require_createComponent_native = __commonJS({
4018
4066
  let resolveVariablesAs = (
4019
4067
  // if HOC + mounted + has animation prop, resolve as value so it passes non-variable to child
4020
4068
  isAnimated && !supportsCSSVars || isHOC && state.unmounted == !1 && hasAnimationProp ? "value" : "auto"
4021
- ), keepStyleSSR = willBeAnimated && animationsConfig?.keepStyleSSR, styleProps = {
4069
+ ), keepStyleSSR = willBeAnimated && (animationsConfig == null ? void 0 : animationsConfig.keepStyleSSR), styleProps = {
4022
4070
  mediaState: mediaState2,
4023
4071
  noClassNames,
4024
4072
  resolveVariablesAs,
@@ -4100,7 +4148,7 @@ var require_createComponent_native = __commonJS({
4100
4148
 
4101
4149
  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}`
4102
4150
  ), time && time`destructure`;
4103
- let disabled = props.accessibilityState?.disabled || // @ts-expect-error (comes from core)
4151
+ let disabled = ((_d = props.accessibilityState) == null ? void 0 : _d.disabled) || // @ts-expect-error (comes from core)
4104
4152
  props.accessibilityDisabled, viewProps = nonTamaguiProps;
4105
4153
  isHOC && _themeProp && (viewProps.theme = _themeProp), groupName && (nonTamaguiProps.onLayout = (0, import_helpers.composeEventHandlers)(
4106
4154
  nonTamaguiProps.onLayout,
@@ -4137,7 +4185,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
4137
4185
  };
4138
4186
  disposeGroupsListener = componentContext.groups.subscribe(
4139
4187
  (name, { layout, pseudo }) => {
4140
- if (pseudo && pseudoGroups?.has(name))
4188
+ if (pseudo && pseudoGroups != null && pseudoGroups.has(name))
4141
4189
  Object.assign(current.pseudo, pseudo), persist();
4142
4190
  else if (layout && mediaGroups) {
4143
4191
  let mediaState22 = getMediaState(mediaGroups, layout), next = (0, import_createShallowSetState.mergeIfNotShallowEqual)(current.media, mediaState22);
@@ -4156,7 +4204,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
4156
4204
  );
4157
4205
  }
4158
4206
  return () => {
4159
- disposeGroupsListener?.(), mouseUps.delete(unPress);
4207
+ disposeGroupsListener == null || disposeGroupsListener(), mouseUps.delete(unPress);
4160
4208
  };
4161
4209
  }, [
4162
4210
  shouldSetMounted,
@@ -4164,37 +4212,37 @@ If you meant to do this, you can disable this warning - either change untilMeasu
4164
4212
  pseudoGroups ? Object.keys([...pseudoGroups]).join("") : 0,
4165
4213
  mediaGroups ? Object.keys([...mediaGroups]).join("") : 0
4166
4214
  ]);
4167
- let avoidAnimationStyle = keepStyleSSR && state.unmounted === !0, fontFamily = isText ? splitStyles.fontFamily || staticConfig.defaultProps?.fontFamily : null;
4215
+ let avoidAnimationStyle = keepStyleSSR && state.unmounted === !0, fontFamily = isText ? splitStyles.fontFamily || ((_g = staticConfig.defaultProps) == null ? void 0 : _g.fontFamily) : null;
4168
4216
  fontFamily && fontFamily[0] === "$" && (fontFamily = fontFamily.slice(1));
4169
4217
  let fontFamilyClassName = fontFamily ? `font_${fontFamily}` : "", style = avoidAnimationStyle ? splitStyles.style : animationStyles || splitStyles.style, className;
4170
4218
  viewProps.style = style;
4171
- let runtimePressStyle = !disabled && noClassNames && pseudos?.pressStyle, attachPress = !!(groupName || runtimePressStyle || onPress || onPressOut || onPressIn || onLongPress || onClick), runtimeHoverStyle = !disabled && noClassNames && pseudos?.hoverStyle, isHoverable = import_constants2.isWeb && !!(groupName || runtimeHoverStyle || onHoverIn || onHoverOut || onMouseEnter || onMouseLeave), handlesPressEvents = !(import_constants2.isWeb || asChild), shouldAttach = !!(attachPress || isHoverable || noClassNames && "pressStyle" in props || import_constants2.isWeb && noClassNames && "hoverStyle" in props);
4219
+ let runtimePressStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.pressStyle), attachPress = !!(groupName || runtimePressStyle || onPress || onPressOut || onPressIn || onLongPress || onClick), runtimeHoverStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.hoverStyle), isHoverable = import_constants2.isWeb && !!(groupName || runtimeHoverStyle || onHoverIn || onHoverOut || onMouseEnter || onMouseLeave), handlesPressEvents = !(import_constants2.isWeb || asChild), shouldAttach = !!(attachPress || isHoverable || noClassNames && "pressStyle" in props || import_constants2.isWeb && noClassNames && "hoverStyle" in props);
4172
4220
  time && time`events-setup`;
4173
4221
  let events = shouldAttach && !isDisabled && !asChild ? {
4174
4222
  onPressOut: attachPress ? (e) => {
4175
- unPress(), onPressOut?.(e), onMouseUp?.(e);
4223
+ unPress(), onPressOut == null || onPressOut(e), onMouseUp == null || onMouseUp(e);
4176
4224
  } : void 0,
4177
4225
  ...(isHoverable || attachPress) && {
4178
4226
  onMouseEnter: (e) => {
4179
4227
  let next = {};
4180
- next.hover = !0, state.pressIn && (next.press = !0), setStateShallow(next), onHoverIn?.(e), onMouseEnter?.(e);
4228
+ next.hover = !0, state.pressIn && (next.press = !0), setStateShallow(next), onHoverIn == null || onHoverIn(e), onMouseEnter == null || onMouseEnter(e);
4181
4229
  },
4182
4230
  onMouseLeave: (e) => {
4183
4231
  let next = {};
4184
- mouseUps.add(unPress), next.hover = !1, state.pressIn && (next.press = !1, next.pressIn = !1), setStateShallow(next), onHoverOut?.(e), onMouseLeave?.(e);
4232
+ mouseUps.add(unPress), next.hover = !1, state.pressIn && (next.press = !1, next.pressIn = !1), setStateShallow(next), onHoverOut == null || onHoverOut(e), onMouseLeave == null || onMouseLeave(e);
4185
4233
  }
4186
4234
  },
4187
4235
  onPressIn: attachPress ? (e) => {
4188
4236
  setStateShallow({
4189
4237
  press: !0,
4190
4238
  pressIn: !0
4191
- }), onPressIn?.(e), onMouseDown?.(e), import_constants2.isWeb && mouseUps.add(unPress);
4239
+ }), onPressIn == null || onPressIn(e), onMouseDown == null || onMouseDown(e), import_constants2.isWeb && mouseUps.add(unPress);
4192
4240
  } : void 0,
4193
4241
  onPress: attachPress ? (e) => {
4194
- unPress(), import_constants2.isWeb && onClick?.(e), onPress?.(e);
4242
+ unPress(), import_constants2.isWeb && (onClick == null || onClick(e)), onPress == null || onPress(e);
4195
4243
  } : void 0,
4196
4244
  onLongPress: attachPress && onLongPress ? (e) => {
4197
- unPress(), onLongPress?.(e);
4245
+ unPress(), onLongPress == null || onLongPress(e);
4198
4246
  } : void 0
4199
4247
  } : null;
4200
4248
  events && Object.assign(events, {
@@ -4206,7 +4254,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
4206
4254
  delayPressOut: viewProps.delayPressOut,
4207
4255
  focusable: viewProps.focusable ?? !0,
4208
4256
  minPressDuration: 0
4209
- }), time && time`events`, debugProp === "verbose" && console.log("events", { events, isHoverable, attachPress }), import_setupHooks.hooks.useEvents?.(viewProps, events, splitStyles, setStateShallow);
4257
+ }), time && time`events`, debugProp === "verbose" && console.log("events", { events, isHoverable, attachPress }), (_i = (_h = import_setupHooks.hooks).useEvents) == null || _i.call(_h, viewProps, events, splitStyles, setStateShallow);
4210
4258
  let direction = props.spaceDirection || "both";
4211
4259
  time && time`hooks`;
4212
4260
  let content = !children || asChild ? children : spacedChildren({
@@ -4266,8 +4314,8 @@ If you meant to do this, you can disable this warning - either change untilMeasu
4266
4314
  handlesPressEvents,
4267
4315
  willBeAnimated,
4268
4316
  isStringElement,
4269
- classNamesIn: props.className?.split(" "),
4270
- classNamesOut: viewProps.className?.split(" "),
4317
+ classNamesIn: (_j = props.className) == null ? void 0 : _j.split(" "),
4318
+ classNamesOut: (_k = viewProps.className) == null ? void 0 : _k.split(" "),
4271
4319
  events,
4272
4320
  shouldAttach,
4273
4321
  pseudos,
@@ -4305,7 +4353,8 @@ If you meant to do this, you can disable this warning - either change untilMeasu
4305
4353
  return Component2.staticConfig = extendStyledConfig(extended), Component2.styleable = styleable, Component2;
4306
4354
  }
4307
4355
  function styleable(Component2, extended) {
4308
- let ComponentForwardedRef = Component2.render?.length === 2 ? Component2 : (
4356
+ var _a2;
4357
+ let ComponentForwardedRef = ((_a2 = Component2.render) == null ? void 0 : _a2.length) === 2 ? Component2 : (
4309
4358
  // memo because theme changes otherwise would always re-render
4310
4359
  (0, import_react.memo)((0, import_react.forwardRef)(Component2))
4311
4360
  ), extendedConfig = extendStyledConfig(extended), out = (0, import_themeable.themeable)(ComponentForwardedRef, extendedConfig);
@@ -4361,16 +4410,17 @@ If you meant to do this, you can disable this warning - either change untilMeasu
4361
4410
  }
4362
4411
  });
4363
4412
  function spacedChildren(props) {
4413
+ var _a, _b, _c;
4364
4414
  let { isZStack, children, space, direction, spaceFlex, separator } = props, hasSpace = !!(space || spaceFlex), hasSeparator = separator != null;
4365
4415
  if (!(hasSpace || hasSeparator || isZStack))
4366
4416
  return children;
4367
4417
  let childrenList = import_react.Children.toArray(children);
4368
- if (childrenList.length <= 1 && !isZStack && !childrenList[0]?.type?.shouldForwardSpace)
4418
+ if (childrenList.length <= 1 && !isZStack && !((_b = (_a = childrenList[0]) == null ? void 0 : _a.type) != null && _b.shouldForwardSpace))
4369
4419
  return childrenList;
4370
4420
  let final = [];
4371
4421
  for (let [index, child] of childrenList.entries()) {
4372
4422
  let isEmpty = child == null || Array.isArray(child) && child.length === 0;
4373
- if (!isEmpty && import_react.default.isValidElement(child) && child.type?.shouldForwardSpace && (child = import_react.default.cloneElement(child, {
4423
+ if (!isEmpty && import_react.default.isValidElement(child) && (_c = child.type) != null && _c.shouldForwardSpace && (child = import_react.default.cloneElement(child, {
4374
4424
  space,
4375
4425
  spaceFlex,
4376
4426
  separator,
@@ -4421,8 +4471,8 @@ If you meant to do this, you can disable this warning - either change untilMeasu
4421
4471
  );
4422
4472
  }
4423
4473
  function isUnspaced(child) {
4424
- let t = child?.type;
4425
- return t?.isVisuallyHidden || t?.isUnspaced;
4474
+ let t = child == null ? void 0 : child.type;
4475
+ return (t == null ? void 0 : t.isVisuallyHidden) || (t == null ? void 0 : t.isUnspaced);
4426
4476
  }
4427
4477
  var AbsoluteFill = createComponent({
4428
4478
  defaultProps: {
@@ -4756,6 +4806,7 @@ var require_insertFont_native = __commonJS({
4756
4806
  }
4757
4807
  var updateFont = insertFont;
4758
4808
  function parseFont(definition) {
4809
+ var _a;
4759
4810
  let parsed = {};
4760
4811
  for (let attrKey in definition) {
4761
4812
  let attr = definition[attrKey];
@@ -4765,7 +4816,7 @@ var require_insertFont_native = __commonJS({
4765
4816
  parsed[attrKey] = {};
4766
4817
  for (let key in attr) {
4767
4818
  let val = attr[key];
4768
- val.val?.[0] === "$" && (val = val.val), parsed[attrKey][`$${key}`] = val;
4819
+ ((_a = val.val) == null ? void 0 : _a[0]) === "$" && (val = val.val), parsed[attrKey][`$${key}`] = val;
4769
4820
  }
4770
4821
  }
4771
4822
  }
@@ -4809,6 +4860,7 @@ var require_createTamagui_native = __commonJS({
4809
4860
  module2.exports = __toCommonJS2(createTamagui_exports);
4810
4861
  var import_constants2 = require_index_native(), import_config = require_config_native(), import_createVariables = require_createVariables_native(), import_getThemeCSSRules = require_getThemeCSSRules_native(), import_insertStyleRule = require_insertStyleRule_native(), import_proxyThemeToParents = require_proxyThemeToParents_native(), import_registerCSSVariable = require_registerCSSVariable_native(), import_themes = require_themes_native(), import_useMedia = require_useMedia_native(), import_insertFont = require_insertFont_native(), import_Tamagui = require_Tamagui_native(), createdConfigs = /* @__PURE__ */ new WeakMap();
4811
4862
  function createTamagui(configIn) {
4863
+ var _a;
4812
4864
  if (createdConfigs.has(configIn))
4813
4865
  return configIn;
4814
4866
  if (!configIn.tokens)
@@ -4939,7 +4991,7 @@ ${runtimeStyles}`;
4939
4991
  // const tokens = [...getToken(tokens.size[0])]
4940
4992
  // .spacer-sm + ._dsp_contents._dsp-sm-hidden { margin-left: -var(--${}) }
4941
4993
  };
4942
- return (0, import_useMedia.configureMedia)(config), (0, import_config.setConfig)(config), import_config.configListeners.size && (import_config.configListeners.forEach((cb) => cb(config)), import_config.configListeners.clear()), createdConfigs.set(config, !0), process.env.DEBUG?.startsWith("tamagui") && console.log("Tamagui config:", config), globalThis.Tamagui || (globalThis.Tamagui = import_Tamagui.Tamagui), config;
4994
+ return (0, import_useMedia.configureMedia)(config), (0, import_config.setConfig)(config), import_config.configListeners.size && (import_config.configListeners.forEach((cb) => cb(config)), import_config.configListeners.clear()), createdConfigs.set(config, !0), (_a = process.env.DEBUG) != null && _a.startsWith("tamagui") && console.log("Tamagui config:", config), globalThis.Tamagui || (globalThis.Tamagui = import_Tamagui.Tamagui), config;
4943
4995
  }
4944
4996
  function getThemesDeduped(themes) {
4945
4997
  let dedupedThemes = [], existing = /* @__PURE__ */ new Map();
@@ -5007,7 +5059,7 @@ var require_mergeVariants_native = __commonJS({
5007
5059
  var mergeVariants = (parentVariants, ourVariants) => {
5008
5060
  let variants = {};
5009
5061
  for (let key in ourVariants) {
5010
- let parentVariant = parentVariants?.[key], ourVariant = ourVariants[key];
5062
+ let parentVariant = parentVariants == null ? void 0 : parentVariants[key], ourVariant = ourVariants[key];
5011
5063
  if (!parentVariant || typeof ourVariant == "function") {
5012
5064
  variants[key] = ourVariant;
5013
5065
  continue;
@@ -5018,7 +5070,7 @@ var require_mergeVariants_native = __commonJS({
5018
5070
  }
5019
5071
  variants[key] = {};
5020
5072
  for (let subKey in ourVariant) {
5021
- let val = ourVariant[subKey], parentVal = parentVariant?.[subKey];
5073
+ let val = ourVariant[subKey], parentVal = parentVariant == null ? void 0 : parentVariant[subKey];
5022
5074
  typeof val == "function" || !parentVal || typeof parentVal == "function" ? variants[key][subKey] = val : variants[key][subKey] = {
5023
5075
  // keep order
5024
5076
  ...parentVal,
@@ -5097,7 +5149,7 @@ var require_styled_native = __commonJS({
5097
5149
  function styled(ComponentIn, options, staticExtractionOptions) {
5098
5150
  if (!ComponentIn)
5099
5151
  throw new Error("No component given to styled()");
5100
- let parentStaticConfig = ComponentIn.staticConfig, isPlainStyledComponent = !!parentStaticConfig && !(parentStaticConfig.isReactNative || parentStaticConfig.isHOC), Component = parentStaticConfig?.isHOC && !parentStaticConfig?.isStyledHOC || isPlainStyledComponent ? ComponentIn : parentStaticConfig?.Component || ComponentIn, reactNativeConfig = (0, import_setupReactNative.getReactNativeConfig)(Component), isReactNative = !!(reactNativeConfig || staticExtractionOptions?.isReactNative || parentStaticConfig?.isReactNative || (0, import_setupReactNative.getReactNativeConfig)(parentStaticConfig?.Component)), staticConfigProps = (() => {
5152
+ let parentStaticConfig = ComponentIn.staticConfig, isPlainStyledComponent = !!parentStaticConfig && !(parentStaticConfig.isReactNative || parentStaticConfig.isHOC), Component = parentStaticConfig != null && parentStaticConfig.isHOC && !(parentStaticConfig != null && parentStaticConfig.isStyledHOC) || isPlainStyledComponent ? ComponentIn : (parentStaticConfig == null ? void 0 : parentStaticConfig.Component) || ComponentIn, reactNativeConfig = (0, import_setupReactNative.getReactNativeConfig)(Component), isReactNative = !!(reactNativeConfig || staticExtractionOptions != null && staticExtractionOptions.isReactNative || parentStaticConfig != null && parentStaticConfig.isReactNative || (0, import_setupReactNative.getReactNativeConfig)(parentStaticConfig == null ? void 0 : parentStaticConfig.Component)), staticConfigProps = (() => {
5101
5153
  if (options) {
5102
5154
  let {
5103
5155
  variants,
@@ -5113,8 +5165,8 @@ var require_styled_native = __commonJS({
5113
5165
  }), parentStaticConfig && (parentStaticConfig.isHOC && !parentStaticConfig.isStyledHOC || (defaultProps = {
5114
5166
  ...parentStaticConfig.defaultProps,
5115
5167
  ...defaultProps
5116
- }), parentStaticConfig.variants && (variants = (0, import_mergeVariants.mergeVariants)(parentStaticConfig.variants, variants))), parentStaticConfig?.isHOC && name && (defaultProps.componentName = name);
5117
- let isText = !!(staticExtractionOptions?.isText || parentStaticConfig?.isText), acceptsClassName = acceptsClassNameProp ?? (isPlainStyledComponent || isReactNative || parentStaticConfig?.isHOC && parentStaticConfig?.acceptsClassName), conf = {
5168
+ }), parentStaticConfig.variants && (variants = (0, import_mergeVariants.mergeVariants)(parentStaticConfig.variants, variants))), parentStaticConfig != null && parentStaticConfig.isHOC && name && (defaultProps.componentName = name);
5169
+ let isText = !!(staticExtractionOptions != null && staticExtractionOptions.isText || parentStaticConfig != null && parentStaticConfig.isText), acceptsClassName = acceptsClassNameProp ?? (isPlainStyledComponent || isReactNative || (parentStaticConfig == null ? void 0 : parentStaticConfig.isHOC) && (parentStaticConfig == null ? void 0 : parentStaticConfig.acceptsClassName)), conf = {
5118
5170
  ...parentStaticConfig,
5119
5171
  ...staticExtractionOptions,
5120
5172
  ...!isPlainStyledComponent && {
@@ -5125,13 +5177,13 @@ var require_styled_native = __commonJS({
5125
5177
  variants,
5126
5178
  defaultProps,
5127
5179
  defaultVariants,
5128
- componentName: name || parentStaticConfig?.componentName,
5180
+ componentName: name || (parentStaticConfig == null ? void 0 : parentStaticConfig.componentName),
5129
5181
  isReactNative,
5130
5182
  isText,
5131
5183
  acceptsClassName,
5132
5184
  context,
5133
5185
  ...reactNativeConfig,
5134
- isStyledHOC: !!parentStaticConfig?.isHOC,
5186
+ isStyledHOC: !!(parentStaticConfig != null && parentStaticConfig.isHOC),
5135
5187
  parentStaticConfig
5136
5188
  };
5137
5189
  return (defaultProps.children || !acceptsClassName || context) && (conf.neverFlatten = !0), conf;
@@ -5244,7 +5296,7 @@ var require_isTamaguiComponent_native = __commonJS({
5244
5296
  });
5245
5297
  module2.exports = __toCommonJS2(isTamaguiComponent_exports);
5246
5298
  function isTamaguiComponent(comp, name) {
5247
- let config = comp?.staticConfig;
5299
+ let config = comp == null ? void 0 : comp.staticConfig;
5248
5300
  return !!(config && (!name || name === config.componentName));
5249
5301
  }
5250
5302
  }
@@ -5325,14 +5377,14 @@ var require_useThemeName_native = __commonJS({
5325
5377
  module2.exports = __toCommonJS2(useThemeName_exports);
5326
5378
  var import_constants2 = require_index_native(), import_react = require("react"), import_ThemeManagerContext = require_ThemeManagerContext_native();
5327
5379
  function useThemeName(opts) {
5328
- let manager = (0, import_react.useContext)(import_ThemeManagerContext.ThemeManagerContext), [name, setName] = (0, import_react.useState)(manager?.state.name || "");
5380
+ let manager = (0, import_react.useContext)(import_ThemeManagerContext.ThemeManagerContext), [name, setName] = (0, import_react.useState)((manager == null ? void 0 : manager.state.name) || "");
5329
5381
  return (0, import_constants2.useIsomorphicLayoutEffect)(() => {
5330
5382
  if (manager)
5331
5383
  return setName(manager.state.name), manager.onChangeTheme((next, manager2) => {
5332
- let name2 = opts?.parent && manager2.state.parentName || next;
5384
+ let name2 = opts != null && opts.parent && manager2.state.parentName || next;
5333
5385
  name2 && setName(name2);
5334
5386
  });
5335
- }, [manager?.state.name]), name;
5387
+ }, [manager == null ? void 0 : manager.state.name]), name;
5336
5388
  }
5337
5389
  }
5338
5390
  });
@@ -5354,14 +5406,14 @@ var require_useStyle_native = __commonJS({
5354
5406
  useStyle: () => useStyle
5355
5407
  });
5356
5408
  module2.exports = __toCommonJS2(useStyle_exports);
5357
- var import_react = require("react"), import_ComponentContext = require_ComponentContext_native(), import_createComponent = require_createComponent_native(), import_getSplitStyles = require_getSplitStyles_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native();
5409
+ var import_react = require("react"), import_ComponentContext = require_ComponentContext_native(), import_defaultComponentState = require_defaultComponentState_native(), import_getSplitStyles = require_getSplitStyles_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native();
5358
5410
  function useStyle(base, style, options) {
5359
5411
  let isText = base.staticConfig.isText, componentContext = (0, import_react.useContext)(import_ComponentContext.ComponentContext), [themeState] = (0, import_useTheme.useThemeWithState)({}), media = (0, import_useMedia.useMedia)(), out = (0, import_getSplitStyles.useSplitStyles)(
5360
5412
  style,
5361
5413
  base.staticConfig,
5362
5414
  themeState.state.theme,
5363
5415
  themeState.state.name,
5364
- import_createComponent.defaultComponentState,
5416
+ import_defaultComponentState.defaultComponentState,
5365
5417
  {
5366
5418
  ...options,
5367
5419
  mediaState: media,
@@ -5370,7 +5422,7 @@ var require_useStyle_native = __commonJS({
5370
5422
  null,
5371
5423
  componentContext,
5372
5424
  isText ? "span" : "div",
5373
- options?.debug
5425
+ options == null ? void 0 : options.debug
5374
5426
  );
5375
5427
  return {
5376
5428
  style: Object.keys(out.style).length ? out.style : null,
@@ -5442,8 +5494,8 @@ var require_useProps_native = __commonJS({
5442
5494
  var import_useMedia = require_useMedia_native();
5443
5495
  function useProps(props, opts) {
5444
5496
  return (0, import_useMedia.useMediaPropsActive)(props, {
5445
- expandShorthands: !opts?.disableExpandShorthands,
5446
- resolveValues: opts?.resolveValues
5497
+ expandShorthands: !(opts != null && opts.disableExpandShorthands),
5498
+ resolveValues: opts == null ? void 0 : opts.resolveValues
5447
5499
  });
5448
5500
  }
5449
5501
  }
@@ -5702,7 +5754,10 @@ var require_useGet_native = __commonJS({
5702
5754
  return useIsomorphicLayoutEffect3(() => {
5703
5755
  curRef.current = currentValue;
5704
5756
  }), (0, import_react.useCallback)(
5705
- forwardToFunction ? (...args) => curRef.current?.apply(null, args) : () => curRef.current,
5757
+ forwardToFunction ? (...args) => {
5758
+ var _a;
5759
+ return (_a = curRef.current) == null ? void 0 : _a.apply(null, args);
5760
+ } : () => curRef.current,
5706
5761
  []
5707
5762
  );
5708
5763
  }
@@ -5863,6 +5918,11 @@ var require_fake_react_native = __commonJS({
5863
5918
  View: "View",
5864
5919
  Text: "Text",
5865
5920
  TextInput: "TextInput",
5921
+ ScrollView: "ScrollView",
5922
+ Dimensions: {
5923
+ addEventListener(cb) {
5924
+ }
5925
+ },
5866
5926
  addPoolingTo() {
5867
5927
  }
5868
5928
  },
@@ -5903,8 +5963,9 @@ var keyName = "__reactResponderId", canUseDOM = !!(typeof window < "u" && window
5903
5963
  return node.getBoundingClientRect();
5904
5964
  };
5905
5965
  function getEventPath(domEvent) {
5966
+ var _a;
5906
5967
  if (domEvent.type === "selectionchange") {
5907
- let target = window.getSelection()?.anchorNode;
5968
+ let target = (_a = window.getSelection()) == null ? void 0 : _a.anchorNode;
5908
5969
  return composedPathFallback(target);
5909
5970
  } else
5910
5971
  return domEvent.composedPath != null ? domEvent.composedPath() : composedPathFallback(domEvent.target);
@@ -5981,7 +6042,7 @@ function normalizeIdentifier(identifier) {
5981
6042
  return identifier > 20 ? identifier % 20 : identifier;
5982
6043
  }
5983
6044
  function createResponderEvent(domEvent, responderTouchHistoryStore2) {
5984
- let rect, propagationWasStopped = !1, changedTouches, touches, domEventChangedTouches = domEvent.changedTouches, domEventType = domEvent.type, metaKey = domEvent.metaKey === !0, shiftKey = domEvent.shiftKey === !0, force = domEventChangedTouches?.[0].force || 0, identifier = normalizeIdentifier(domEventChangedTouches?.[0].identifier || 0), clientX = domEventChangedTouches?.[0].clientX || domEvent.clientX, clientY = domEventChangedTouches?.[0].clientY || domEvent.clientY, pageX = domEventChangedTouches?.[0].pageX || domEvent.pageX, pageY = domEventChangedTouches?.[0].pageY || domEvent.pageY, preventDefault = typeof domEvent.preventDefault == "function" ? domEvent.preventDefault.bind(domEvent) : emptyFunction, timestamp = domEvent.timeStamp;
6045
+ let rect, propagationWasStopped = !1, changedTouches, touches, domEventChangedTouches = domEvent.changedTouches, domEventType = domEvent.type, metaKey = domEvent.metaKey === !0, shiftKey = domEvent.shiftKey === !0, force = (domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].force) || 0, identifier = normalizeIdentifier((domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].identifier) || 0), clientX = (domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].clientX) || domEvent.clientX, clientY = (domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].clientY) || domEvent.clientY, pageX = (domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].pageX) || domEvent.pageX, pageY = (domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].pageY) || domEvent.pageY, preventDefault = typeof domEvent.preventDefault == "function" ? domEvent.preventDefault.bind(domEvent) : emptyFunction, timestamp = domEvent.timeStamp;
5985
6046
  function normalizeTouches(touches2) {
5986
6047
  return Array.prototype.slice.call(touches2).map((touch) => ({
5987
6048
  force: touch.force,
@@ -6173,6 +6234,7 @@ var ResponderTouchHistoryStore = class {
6173
6234
  mostRecentTimeStamp: 0
6174
6235
  };
6175
6236
  recordTouchTrack(topLevelType, nativeEvent) {
6237
+ var _a, _b;
6176
6238
  let touchHistory = this._touchHistory;
6177
6239
  if (isMoveish(topLevelType))
6178
6240
  nativeEvent.changedTouches.forEach((touch) => recordTouchMove(touch, touchHistory));
@@ -6181,11 +6243,11 @@ var ResponderTouchHistoryStore = class {
6181
6243
  else if (isEndish(topLevelType) && (nativeEvent.changedTouches.forEach((touch) => recordTouchEnd(touch, touchHistory)), touchHistory.numberActiveTouches = nativeEvent.touches.length, touchHistory.numberActiveTouches === 1)) {
6182
6244
  let { touchBank } = touchHistory;
6183
6245
  for (let i = 0; i < touchBank.length; i++)
6184
- if (touchBank[i]?.touchActive) {
6246
+ if ((_a = touchBank[i]) != null && _a.touchActive) {
6185
6247
  touchHistory.indexOfSingleActiveTouch = i;
6186
6248
  break;
6187
6249
  }
6188
- touchBank[touchHistory.indexOfSingleActiveTouch]?.touchActive || console.error("Cannot find single active touch.");
6250
+ (_b = touchBank[touchHistory.indexOfSingleActiveTouch]) != null && _b.touchActive || console.error("Cannot find single active touch.");
6189
6251
  }
6190
6252
  }
6191
6253
  get touchHistory() {
@@ -6411,8 +6473,9 @@ var import_constants = __toESM(require_index_native());
6411
6473
 
6412
6474
  // src/helpers/getBoundingClientRect.tsx
6413
6475
  var getBoundingClientRect2 = (node) => {
6476
+ var _a;
6414
6477
  if (!(!node || node.nodeType !== 1))
6415
- return node.getBoundingClientRect?.();
6478
+ return (_a = node.getBoundingClientRect) == null ? void 0 : _a.call(node);
6416
6479
  };
6417
6480
 
6418
6481
  // src/helpers/getRect.tsx
@@ -6443,7 +6506,7 @@ typeof window < "u" && "ResizeObserver" in window && (resizeObserver = new Resiz
6443
6506
  }
6444
6507
  }));
6445
6508
  var measureLayout = (node, relativeTo, callback) => {
6446
- let relativeNode = relativeTo || node?.parentNode;
6509
+ let relativeNode = relativeTo || (node == null ? void 0 : node.parentNode);
6447
6510
  relativeNode instanceof HTMLElement && setTimeout(() => {
6448
6511
  let relativeRect = getBoundingClientRect2(relativeNode), { height, left, top, width } = getRect(node), x = left - relativeRect.left, y = top - relativeRect.top;
6449
6512
  callback(x, y, width, height, left, top);
@@ -6456,7 +6519,7 @@ function useElementLayout(ref, onLayout) {
6456
6519
  let node = ref.current;
6457
6520
  if (node)
6458
6521
  return LayoutHandlers.set(node, onLayout), resizeObserver.observe(node), () => {
6459
- resizeObserver?.unobserve(node);
6522
+ resizeObserver == null || resizeObserver.unobserve(node);
6460
6523
  };
6461
6524
  }, [ref, onLayout]);
6462
6525
  }
@@ -6537,7 +6600,7 @@ var Stack = import_web2.Stack, Text = import_web2.Text;
6537
6600
  },
6538
6601
  useEvents(viewProps, events, { pseudos }, setStateShallow) {
6539
6602
  {
6540
- !!pseudos?.focusStyle && (viewProps.onFocus = (0, import_web2.composeEventHandlers)(viewProps.onFocus, () => {
6603
+ !!(pseudos != null && pseudos.focusStyle) && (viewProps.onFocus = (0, import_web2.composeEventHandlers)(viewProps.onFocus, () => {
6541
6604
  setStateShallow({ focus: !0 });
6542
6605
  }), viewProps.onBlur = (0, import_web2.composeEventHandlers)(viewProps.onBlur, () => {
6543
6606
  setStateShallow({ focus: !1 });