@tamagui/core 1.68.6 → 1.69.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
@@ -1559,9 +1559,9 @@ var require_matchMedia_native = __commonJS({
1559
1559
  }
1560
1560
  });
1561
1561
 
1562
- // ../web/dist/cjs/constants/isDevTools.native.js
1563
- var require_isDevTools_native = __commonJS({
1564
- "../web/dist/cjs/constants/isDevTools.native.js"(exports, module2) {
1562
+ // ../web/dist/cjs/helpers/pseudoDescriptors.native.js
1563
+ var require_pseudoDescriptors_native = __commonJS({
1564
+ "../web/dist/cjs/helpers/pseudoDescriptors.native.js"(exports, module2) {
1565
1565
  "use strict";
1566
1566
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
1567
1567
  for (var name in all)
@@ -1571,1088 +1571,335 @@ var require_isDevTools_native = __commonJS({
1571
1571
  for (let key of __getOwnPropNames2(from))
1572
1572
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1573
1573
  return to;
1574
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), isDevTools_exports = {};
1575
- __export2(isDevTools_exports, {
1576
- isDevTools: () => isDevTools
1574
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), pseudoDescriptors_exports = {};
1575
+ __export2(pseudoDescriptors_exports, {
1576
+ pseudoDescriptors: () => pseudoDescriptors,
1577
+ pseudoDescriptorsBase: () => pseudoDescriptorsBase,
1578
+ pseudoPriorities: () => pseudoPriorities
1577
1579
  });
1578
- module2.exports = __toCommonJS2(isDevTools_exports);
1579
- var isDevTools = (() => {
1580
- if (process.env.NODE_ENV === "development")
1581
- try {
1582
- return new Function("try {return this===window;}catch(e){ return false;}")();
1583
- } catch {
1584
- }
1585
- return !1;
1586
- })();
1580
+ module2.exports = __toCommonJS2(pseudoDescriptors_exports);
1581
+ var pseudoDescriptorsBase = {
1582
+ // order of keys here important! in priority order
1583
+ hoverStyle: {
1584
+ name: "hover",
1585
+ priority: 1
1586
+ },
1587
+ pressStyle: {
1588
+ name: "active",
1589
+ stateKey: "press",
1590
+ priority: 2
1591
+ },
1592
+ focusStyle: {
1593
+ name: "focus",
1594
+ priority: 3
1595
+ }
1596
+ }, pseudoPriorities = {
1597
+ hover: 1,
1598
+ press: 2,
1599
+ focus: 3
1600
+ }, pseudoDescriptors = {
1601
+ ...pseudoDescriptorsBase,
1602
+ enterStyle: {
1603
+ name: "enter",
1604
+ stateKey: "unmounted",
1605
+ priority: 4
1606
+ },
1607
+ exitStyle: {
1608
+ name: "exit",
1609
+ priority: 5
1610
+ }
1611
+ };
1587
1612
  }
1588
1613
  });
1589
1614
 
1590
- // ../web/dist/cjs/helpers/expandStyle.native.js
1591
- var require_expandStyle_native = __commonJS({
1592
- "../web/dist/cjs/helpers/expandStyle.native.js"(exports, module2) {
1615
+ // ../web/dist/cjs/hooks/useMedia.native.js
1616
+ var require_useMedia_native = __commonJS({
1617
+ "../web/dist/cjs/hooks/useMedia.native.js"(exports, module2) {
1593
1618
  "use strict";
1594
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all2) => {
1595
- for (var name in all2)
1596
- __defProp2(target, name, { get: all2[name], enumerable: !0 });
1619
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
1620
+ for (var name in all)
1621
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
1597
1622
  }, __copyProps2 = (to, from, except, desc) => {
1598
1623
  if (from && typeof from == "object" || typeof from == "function")
1599
1624
  for (let key of __getOwnPropNames2(from))
1600
1625
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1601
1626
  return to;
1602
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), expandStyle_exports = {};
1603
- __export2(expandStyle_exports, {
1604
- expandStyle: () => expandStyle
1627
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), useMedia_exports = {};
1628
+ __export2(useMedia_exports, {
1629
+ configureMedia: () => configureMedia2,
1630
+ getInitialMediaState: () => getInitialMediaState,
1631
+ getMedia: () => getMedia2,
1632
+ getMediaImportanceIfMoreImportant: () => getMediaImportanceIfMoreImportant,
1633
+ getMediaKeyImportance: () => getMediaKeyImportance,
1634
+ isMediaKey: () => isMediaKey,
1635
+ mediaKeyMatch: () => mediaKeyMatch,
1636
+ mediaKeyToQuery: () => mediaKeyToQuery,
1637
+ mediaKeys: () => mediaKeys,
1638
+ mediaObjectToString: () => mediaObjectToString2,
1639
+ mediaQueryConfig: () => mediaQueryConfig2,
1640
+ mediaState: () => mediaState2,
1641
+ mergeMediaByImportance: () => mergeMediaByImportance,
1642
+ setMediaShouldUpdate: () => setMediaShouldUpdate,
1643
+ setupMediaListeners: () => setupMediaListeners,
1644
+ useMedia: () => useMedia2,
1645
+ useMediaListeners: () => useMediaListeners
1605
1646
  });
1606
- module2.exports = __toCommonJS2(expandStyle_exports);
1607
- var import_constants2 = require_index_native2();
1608
- function expandStyle(key, value) {
1609
- if (!1)
1610
- switch (key) {
1611
- case "textAlignVertical":
1612
- case "writingDirection":
1647
+ module2.exports = __toCommonJS2(useMedia_exports);
1648
+ var import_constants2 = require_index_native2(), import_react = require("react"), import_config = require_config_native(), import_createProxy = require_createProxy_native(), import_matchMedia = require_matchMedia_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), mediaState2 = (
1649
+ // development only safeguard
1650
+ process.env.NODE_ENV === "development" ? (0, import_createProxy.createProxy)(
1651
+ {},
1652
+ {
1653
+ get(target, key) {
1654
+ if (typeof key == "string" && key[0] === "$" && // dont error on $$typeof
1655
+ key[1] !== "$")
1656
+ throw new Error(`Access mediaState should not use "$": ${key}`);
1657
+ return Reflect.get(target, key);
1658
+ }
1613
1659
  }
1614
- if (import_constants2.isAndroid && key === "elevationAndroid")
1615
- return [["elevation", value]];
1616
- if (key in EXPANSIONS)
1617
- return EXPANSIONS[key].map((key2) => [key2, value]);
1660
+ ) : {}
1661
+ ), mediaQueryConfig2 = {}, getMedia2 = () => mediaState2, mediaKeys = /* @__PURE__ */ new Set(), isMediaKey = (key) => mediaKeys.has(key) || key[0] === "$" && (key.startsWith("$platform-") || key.startsWith("$theme-") || key.startsWith("$group-")), initState, getInitialMediaState = () => ((0, import_config.getConfig)().disableSSR ? mediaState2 : initState) || {}, defaultMediaImportance = Object.keys(import_pseudoDescriptors.pseudoDescriptors).length, mediaKeysOrdered, getMediaKeyImportance = (key) => {
1662
+ if (process.env.NODE_ENV === "development" && key[0] === "$")
1663
+ throw new Error("use short key");
1664
+ return (0, import_config.getConfig)().settings.mediaPropOrder ? defaultMediaImportance : mediaKeysOrdered.indexOf(key) + 100;
1665
+ }, dispose = /* @__PURE__ */ new Set(), mediaVersion = 0, configureMedia2 = (config) => {
1666
+ let { media, mediaQueryDefaultActive } = config;
1667
+ if (media) {
1668
+ mediaVersion++;
1669
+ for (let key in media)
1670
+ mediaState2[key] = (mediaQueryDefaultActive == null ? void 0 : mediaQueryDefaultActive[key]) || !1, mediaKeys.add(`$${key}`);
1671
+ Object.assign(mediaQueryConfig2, media), initState = { ...mediaState2 }, mediaKeysOrdered = Object.keys(media), config.disableSSR ? setupMediaListeners() : updateCurrentState();
1672
+ }
1673
+ };
1674
+ function unlisten() {
1675
+ dispose.forEach((cb) => cb()), dispose.clear();
1618
1676
  }
1619
- var all = ["Top", "Right", "Bottom", "Left"], horiz = ["Right", "Left"], vert = ["Top", "Bottom"], xy = ["X", "Y"], EXPANSIONS = {
1620
- borderColor: ["TopColor", "RightColor", "BottomColor", "LeftColor"],
1621
- borderRadius: [
1622
- "TopLeftRadius",
1623
- "TopRightRadius",
1624
- "BottomRightRadius",
1625
- "BottomLeftRadius"
1626
- ],
1627
- borderWidth: ["TopWidth", "RightWidth", "BottomWidth", "LeftWidth"],
1628
- margin: all,
1629
- marginHorizontal: horiz,
1630
- marginVertical: vert,
1631
- overscrollBehavior: xy,
1632
- padding: all,
1633
- paddingHorizontal: horiz,
1634
- paddingVertical: vert,
1635
- ...import_constants2.isWeb && {
1636
- // react-native only supports borderStyle
1637
- borderStyle: ["TopStyle", "RightStyle", "BottomStyle", "LeftStyle"],
1638
- // react-native doesn't support X / Y
1639
- overflow: xy
1677
+ var setupVersion = -1;
1678
+ function setupMediaListeners() {
1679
+ if (setupVersion !== mediaVersion) {
1680
+ setupVersion = mediaVersion, unlisten();
1681
+ for (let key in mediaQueryConfig2) {
1682
+ let update2 = function() {
1683
+ let next = !!getMatch().matches;
1684
+ next !== mediaState2[key] && (mediaState2 = { ...mediaState2, [key]: next }, updateCurrentState());
1685
+ };
1686
+ var update = update2;
1687
+ let str = mediaObjectToString2(mediaQueryConfig2[key], key), getMatch = () => (0, import_matchMedia.matchMedia)(str), match = getMatch();
1688
+ if (!match)
1689
+ throw new Error("\u26A0\uFE0F No match");
1690
+ match.addListener(update2), dispose.add(() => {
1691
+ match.removeListener(update2);
1692
+ }), update2();
1693
+ }
1640
1694
  }
1641
- }, _a;
1642
- for (let parent in EXPANSIONS) {
1643
- let prefix = parent.slice(0, ((_a = /[A-Z]/.exec(parent)) == null ? void 0 : _a.index) ?? parent.length);
1644
- EXPANSIONS[parent] = EXPANSIONS[parent].map((k) => `${prefix}${k}`);
1695
+ }
1696
+ function useMediaListeners(config) {
1697
+ config.disableSSR || (0, import_constants2.useIsomorphicLayoutEffect)(() => {
1698
+ setupMediaListeners();
1699
+ }, []);
1700
+ }
1701
+ var listeners = /* @__PURE__ */ new Set(), flushing = !1, flushVersion = -1;
1702
+ function updateCurrentState() {
1703
+ flushing && flushVersion === mediaVersion || (flushVersion = mediaVersion, flushing = !0, Promise.resolve().then(() => {
1704
+ flushing = !1, listeners.forEach((cb) => cb(mediaState2));
1705
+ }));
1706
+ }
1707
+ var shouldUpdate = /* @__PURE__ */ new WeakMap();
1708
+ function setMediaShouldUpdate(ref, props) {
1709
+ return shouldUpdate.set(ref, props);
1710
+ }
1711
+ function subscribe(subscriber) {
1712
+ return listeners.add(subscriber), () => listeners.delete(subscriber);
1713
+ }
1714
+ function useMedia2(uid) {
1715
+ let internal = (0, import_react.useRef)(), state = (0, import_react.useSyncExternalStore)(
1716
+ subscribe,
1717
+ () => {
1718
+ if (!internal.current)
1719
+ return initState;
1720
+ let { touched, prev } = internal.current, componentState = uid ? shouldUpdate.get(uid) : void 0;
1721
+ if (componentState && componentState.enabled === !1)
1722
+ return prev;
1723
+ let testKeys = (componentState == null ? void 0 : componentState.keys) ?? ((!componentState || componentState.enabled) && touched ? [...touched] : null);
1724
+ return !testKeys || testKeys != null && testKeys.every((key) => mediaState2[key] === prev[key]) ? prev : (internal.current.prev = mediaState2, mediaState2);
1725
+ },
1726
+ () => initState
1727
+ );
1728
+ return new Proxy(state, {
1729
+ get(_, key) {
1730
+ return typeof key == "string" && (internal.current ||= { prev: initState }, internal.current.touched ||= /* @__PURE__ */ new Set(), internal.current.touched.add(key)), Reflect.get(state, key);
1731
+ }
1732
+ });
1733
+ }
1734
+ var getMediaImportanceIfMoreImportant = (mediaKey, key, importancesUsed, isSizeMedia) => {
1735
+ let conf = (0, import_config.getConfig)(), importance = isSizeMedia && !conf.settings.mediaPropOrder ? getMediaKeyImportance(mediaKey) : defaultMediaImportance;
1736
+ return !importancesUsed[key] || importance > importancesUsed[key] ? importance : null;
1737
+ };
1738
+ function mergeMediaByImportance(onto, mediaKey, key, value, importancesUsed, isSizeMedia, importanceBump) {
1739
+ let importance = getMediaImportanceIfMoreImportant(
1740
+ mediaKey,
1741
+ key,
1742
+ importancesUsed,
1743
+ isSizeMedia
1744
+ );
1745
+ return importanceBump && (importance = (importance || 0) + importanceBump), importance === null ? !1 : (importancesUsed[key] = importance, onto[key] = value, !0);
1746
+ }
1747
+ function camelToHyphen(str) {
1748
+ return str.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`).toLowerCase();
1749
+ }
1750
+ var cache = /* @__PURE__ */ new WeakMap(), cachedMediaKeyToQuery = {};
1751
+ function mediaObjectToString2(query, key) {
1752
+ if (typeof query == "string")
1753
+ return query;
1754
+ if (cache.has(query))
1755
+ return cache.get(query);
1756
+ let res = Object.entries(query).map(([feature, value]) => (feature = camelToHyphen(feature), typeof value == "string" ? `(${feature}: ${value})` : (typeof value == "number" && /[height|width]$/.test(feature) && (value = `${value}px`), `(${feature}: ${value})`))).join(" and ");
1757
+ return key && (cachedMediaKeyToQuery[key] = res), cache.set(query, res), res;
1758
+ }
1759
+ function mediaKeyToQuery(key) {
1760
+ return cachedMediaKeyToQuery[key] || mediaObjectToString2(mediaQueryConfig2[key], key);
1761
+ }
1762
+ function mediaKeyMatch(key, dimensions) {
1763
+ let mediaQueries = mediaQueryConfig2[key];
1764
+ return Object.keys(mediaQueries).every((query) => {
1765
+ let expectedVal = +mediaQueries[query], isMax = query.startsWith("max"), isWidth = query.endsWith("Width"), givenVal = dimensions[isWidth ? "width" : "height"];
1766
+ return isMax ? givenVal < expectedVal : givenVal > expectedVal;
1767
+ });
1645
1768
  }
1646
1769
  }
1647
1770
  });
1648
1771
 
1649
- // ../../node_modules/@react-native/normalize-color/index.js
1650
- var require_normalize_color = __commonJS({
1651
- "../../node_modules/@react-native/normalize-color/index.js"(exports, module2) {
1772
+ // ../web/dist/cjs/Tamagui.native.js
1773
+ var require_Tamagui_native = __commonJS({
1774
+ "../web/dist/cjs/Tamagui.native.js"(exports, module2) {
1652
1775
  "use strict";
1653
- function normalizeColor(color) {
1654
- if (typeof color == "number")
1655
- return color >>> 0 === color && color >= 0 && color <= 4294967295 ? color : null;
1656
- if (typeof color != "string")
1657
- return null;
1658
- let matchers = getMatchers(), match;
1659
- if (match = matchers.hex6.exec(color))
1660
- return parseInt(match[1] + "ff", 16) >>> 0;
1661
- let colorFromKeyword = normalizeKeyword(color);
1662
- return colorFromKeyword ?? ((match = matchers.rgb.exec(color)) ? (parse255(match[1]) << 24 | // r
1663
- parse255(match[2]) << 16 | // g
1664
- parse255(match[3]) << 8 | // b
1665
- 255) >>> // a
1666
- 0 : (match = matchers.rgba.exec(color)) ? match[6] !== void 0 ? (parse255(match[6]) << 24 | // r
1667
- parse255(match[7]) << 16 | // g
1668
- parse255(match[8]) << 8 | // b
1669
- parse1(match[9])) >>> // a
1670
- 0 : (parse255(match[2]) << 24 | // r
1671
- parse255(match[3]) << 16 | // g
1672
- parse255(match[4]) << 8 | // b
1673
- parse1(match[5])) >>> // a
1674
- 0 : (match = matchers.hex3.exec(color)) ? parseInt(
1675
- match[1] + match[1] + // r
1676
- match[2] + match[2] + // g
1677
- match[3] + match[3] + // b
1678
- "ff",
1679
- // a
1680
- 16
1681
- ) >>> 0 : (match = matchers.hex8.exec(color)) ? parseInt(match[1], 16) >>> 0 : (match = matchers.hex4.exec(color)) ? parseInt(
1682
- match[1] + match[1] + // r
1683
- match[2] + match[2] + // g
1684
- match[3] + match[3] + // b
1685
- match[4] + match[4],
1686
- // a
1687
- 16
1688
- ) >>> 0 : (match = matchers.hsl.exec(color)) ? (hslToRgb(
1689
- parse360(match[1]),
1690
- // h
1691
- parsePercentage(match[2]),
1692
- // s
1693
- parsePercentage(match[3])
1694
- // l
1695
- ) | 255) >>> // a
1696
- 0 : (match = matchers.hsla.exec(color)) ? match[6] !== void 0 ? (hslToRgb(
1697
- parse360(match[6]),
1698
- // h
1699
- parsePercentage(match[7]),
1700
- // s
1701
- parsePercentage(match[8])
1702
- // l
1703
- ) | parse1(match[9])) >>> // a
1704
- 0 : (hslToRgb(
1705
- parse360(match[2]),
1706
- // h
1707
- parsePercentage(match[3]),
1708
- // s
1709
- parsePercentage(match[4])
1710
- // l
1711
- ) | parse1(match[5])) >>> // a
1712
- 0 : (match = matchers.hwb.exec(color)) ? (hwbToRgb(
1713
- parse360(match[1]),
1714
- // h
1715
- parsePercentage(match[2]),
1716
- // w
1717
- parsePercentage(match[3])
1718
- // b
1719
- ) | 255) >>> // a
1720
- 0 : null);
1721
- }
1722
- function hue2rgb(p, q, t) {
1723
- return t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? p + (q - p) * 6 * t : t < 1 / 2 ? q : t < 2 / 3 ? p + (q - p) * (2 / 3 - t) * 6 : p;
1724
- }
1725
- function hslToRgb(h, s, l) {
1726
- let q = l < 0.5 ? l * (1 + s) : l + s - l * s, p = 2 * l - q, r = hue2rgb(p, q, h + 1 / 3), g = hue2rgb(p, q, h), b = hue2rgb(p, q, h - 1 / 3);
1727
- return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b * 255) << 8;
1728
- }
1729
- function hwbToRgb(h, w, b) {
1730
- if (w + b >= 1) {
1731
- let gray = Math.round(w * 255 / (w + b));
1732
- return gray << 24 | gray << 16 | gray << 8;
1776
+ var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
1777
+ for (var name in all)
1778
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
1779
+ }, __copyProps2 = (to, from, except, desc) => {
1780
+ if (from && typeof from == "object" || typeof from == "function")
1781
+ for (let key of __getOwnPropNames2(from))
1782
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1783
+ return to;
1784
+ }, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
1785
+ // If the importer is in node compatibility mode or this is not an ESM
1786
+ // file that has been converted to a CommonJS file using a Babel-
1787
+ // compatible transform (i.e. "__esModule" has not been set), then set
1788
+ // "default" to the CommonJS "module.exports" for node compatibility.
1789
+ isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: !0 }) : target,
1790
+ mod
1791
+ )), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), Tamagui_exports = {};
1792
+ __export2(Tamagui_exports, {
1793
+ Tamagui: () => Tamagui,
1794
+ getValueFromIdentifier: () => getValueFromIdentifier,
1795
+ setIdentifierValue: () => setIdentifierValue
1796
+ });
1797
+ module2.exports = __toCommonJS2(Tamagui_exports);
1798
+ var Helpers = __toESM2(require_index_native4()), import_config = require_config_native(), import_insertStyleRule = require_insertStyleRule_native(), import_useMedia = require_useMedia_native(), TamaguiManager = class {
1799
+ constructor() {
1800
+ this.Helpers = Helpers;
1733
1801
  }
1734
- let red = hue2rgb(0, 1, h + 1 / 3) * (1 - w - b) + w, green = hue2rgb(0, 1, h) * (1 - w - b) + w, blue = hue2rgb(0, 1, h - 1 / 3) * (1 - w - b) + w;
1735
- return Math.round(red * 255) << 24 | Math.round(green * 255) << 16 | Math.round(blue * 255) << 8;
1736
- }
1737
- var NUMBER = "[-+]?\\d*\\.?\\d+", PERCENTAGE = NUMBER + "%";
1738
- function call(...args) {
1739
- return "\\(\\s*(" + args.join(")\\s*,?\\s*(") + ")\\s*\\)";
1740
- }
1741
- function callWithSlashSeparator(...args) {
1742
- return "\\(\\s*(" + args.slice(0, args.length - 1).join(")\\s*,?\\s*(") + ")\\s*/\\s*(" + args[args.length - 1] + ")\\s*\\)";
1743
- }
1744
- function commaSeparatedCall(...args) {
1745
- return "\\(\\s*(" + args.join(")\\s*,\\s*(") + ")\\s*\\)";
1746
- }
1747
- var cachedMatchers;
1748
- function getMatchers() {
1749
- return cachedMatchers === void 0 && (cachedMatchers = {
1750
- rgb: new RegExp("rgb" + call(NUMBER, NUMBER, NUMBER)),
1751
- rgba: new RegExp(
1752
- "rgba(" + commaSeparatedCall(NUMBER, NUMBER, NUMBER, NUMBER) + "|" + callWithSlashSeparator(NUMBER, NUMBER, NUMBER, NUMBER) + ")"
1753
- ),
1754
- hsl: new RegExp("hsl" + call(NUMBER, PERCENTAGE, PERCENTAGE)),
1755
- hsla: new RegExp(
1756
- "hsla(" + commaSeparatedCall(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER) + "|" + callWithSlashSeparator(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER) + ")"
1757
- ),
1758
- hwb: new RegExp("hwb" + call(NUMBER, PERCENTAGE, PERCENTAGE)),
1759
- hex3: /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
1760
- hex4: /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
1761
- hex6: /^#([0-9a-fA-F]{6})$/,
1762
- hex8: /^#([0-9a-fA-F]{8})$/
1763
- }), cachedMatchers;
1802
+ get mediaState() {
1803
+ return { ...import_useMedia.mediaState };
1804
+ }
1805
+ get config() {
1806
+ return (0, import_config.getConfig)();
1807
+ }
1808
+ get insertedRules() {
1809
+ return (0, import_insertStyleRule.getAllRules)();
1810
+ }
1811
+ get allSelectors() {
1812
+ return (0, import_insertStyleRule.getAllSelectors)();
1813
+ }
1814
+ get allTransforms() {
1815
+ return (0, import_insertStyleRule.getAllTransforms)();
1816
+ }
1817
+ get identifierToValue() {
1818
+ return identifierToValue;
1819
+ }
1820
+ }, Tamagui = new TamaguiManager(), identifierToValue = /* @__PURE__ */ new Map(), getValueFromIdentifier = (identifier) => identifierToValue.get(identifier), setIdentifierValue = (identifier, value) => {
1821
+ identifierToValue.set(identifier, value);
1822
+ };
1823
+ }
1824
+ });
1825
+
1826
+ // ../compose-refs/dist/cjs/compose-refs.native.js
1827
+ var require_compose_refs_native = __commonJS({
1828
+ "../compose-refs/dist/cjs/compose-refs.native.js"(exports, module2) {
1829
+ "use strict";
1830
+ var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
1831
+ for (var name in all)
1832
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
1833
+ }, __copyProps2 = (to, from, except, desc) => {
1834
+ if (from && typeof from == "object" || typeof from == "function")
1835
+ for (let key of __getOwnPropNames2(from))
1836
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1837
+ return to;
1838
+ }, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
1839
+ // If the importer is in node compatibility mode or this is not an ESM
1840
+ // file that has been converted to a CommonJS file using a Babel-
1841
+ // compatible transform (i.e. "__esModule" has not been set), then set
1842
+ // "default" to the CommonJS "module.exports" for node compatibility.
1843
+ isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: !0 }) : target,
1844
+ mod
1845
+ )), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), compose_refs_exports = {};
1846
+ __export2(compose_refs_exports, {
1847
+ composeRefs: () => composeRefs,
1848
+ useComposedRefs: () => useComposedRefs
1849
+ });
1850
+ module2.exports = __toCommonJS2(compose_refs_exports);
1851
+ var React = __toESM2(require("react"));
1852
+ function setRef(ref, value) {
1853
+ typeof ref == "function" ? ref(value) : ref && (ref.current = value);
1764
1854
  }
1765
- function parse255(str) {
1766
- let int = parseInt(str, 10);
1767
- return int < 0 ? 0 : int > 255 ? 255 : int;
1855
+ function composeRefs(...refs) {
1856
+ return (node) => refs.forEach((ref) => setRef(ref, node));
1768
1857
  }
1769
- function parse360(str) {
1770
- return (parseFloat(str) % 360 + 360) % 360 / 360;
1858
+ function useComposedRefs(...refs) {
1859
+ return React.useCallback(composeRefs(...refs), refs);
1771
1860
  }
1772
- function parse1(str) {
1773
- let num = parseFloat(str);
1774
- return num < 0 ? 0 : num > 1 ? 255 : Math.round(num * 255);
1861
+ }
1862
+ });
1863
+
1864
+ // ../compose-refs/dist/cjs/index.native.js
1865
+ var require_index_native5 = __commonJS({
1866
+ "../compose-refs/dist/cjs/index.native.js"(exports, module2) {
1867
+ "use strict";
1868
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __copyProps2 = (to, from, except, desc) => {
1869
+ if (from && typeof from == "object" || typeof from == "function")
1870
+ for (let key of __getOwnPropNames2(from))
1871
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1872
+ return to;
1873
+ }, __reExport2 = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default")), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), src_exports2 = {};
1874
+ module2.exports = __toCommonJS2(src_exports2);
1875
+ __reExport2(src_exports2, require_compose_refs_native(), module2.exports);
1876
+ }
1877
+ });
1878
+
1879
+ // ../use-did-finish-ssr/dist/cjs/index.native.js
1880
+ var require_index_native6 = __commonJS({
1881
+ "../use-did-finish-ssr/dist/cjs/index.native.js"(exports, module2) {
1882
+ "use strict";
1883
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
1884
+ for (var name in all)
1885
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
1886
+ }, __copyProps2 = (to, from, except, desc) => {
1887
+ if (from && typeof from == "object" || typeof from == "function")
1888
+ for (let key of __getOwnPropNames2(from))
1889
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1890
+ return to;
1891
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), src_exports2 = {};
1892
+ __export2(src_exports2, {
1893
+ useClientValue: () => useClientValue,
1894
+ useDidFinishSSR: () => useDidFinishSSR
1895
+ });
1896
+ module2.exports = __toCommonJS2(src_exports2);
1897
+ var import_react = require("react");
1898
+ function useDidFinishSSR(value) {
1899
+ return value ?? !0;
1775
1900
  }
1776
- function parsePercentage(str) {
1777
- let int = parseFloat(str);
1778
- return int < 0 ? 0 : int > 100 ? 1 : int / 100;
1779
- }
1780
- function normalizeKeyword(name) {
1781
- switch (name) {
1782
- case "transparent":
1783
- return 0;
1784
- case "aliceblue":
1785
- return 4042850303;
1786
- case "antiquewhite":
1787
- return 4209760255;
1788
- case "aqua":
1789
- return 16777215;
1790
- case "aquamarine":
1791
- return 2147472639;
1792
- case "azure":
1793
- return 4043309055;
1794
- case "beige":
1795
- return 4126530815;
1796
- case "bisque":
1797
- return 4293182719;
1798
- case "black":
1799
- return 255;
1800
- case "blanchedalmond":
1801
- return 4293643775;
1802
- case "blue":
1803
- return 65535;
1804
- case "blueviolet":
1805
- return 2318131967;
1806
- case "brown":
1807
- return 2771004159;
1808
- case "burlywood":
1809
- return 3736635391;
1810
- case "burntsienna":
1811
- return 3934150143;
1812
- case "cadetblue":
1813
- return 1604231423;
1814
- case "chartreuse":
1815
- return 2147418367;
1816
- case "chocolate":
1817
- return 3530104575;
1818
- case "coral":
1819
- return 4286533887;
1820
- case "cornflowerblue":
1821
- return 1687547391;
1822
- case "cornsilk":
1823
- return 4294499583;
1824
- case "crimson":
1825
- return 3692313855;
1826
- case "cyan":
1827
- return 16777215;
1828
- case "darkblue":
1829
- return 35839;
1830
- case "darkcyan":
1831
- return 9145343;
1832
- case "darkgoldenrod":
1833
- return 3095792639;
1834
- case "darkgray":
1835
- return 2846468607;
1836
- case "darkgreen":
1837
- return 6553855;
1838
- case "darkgrey":
1839
- return 2846468607;
1840
- case "darkkhaki":
1841
- return 3182914559;
1842
- case "darkmagenta":
1843
- return 2332068863;
1844
- case "darkolivegreen":
1845
- return 1433087999;
1846
- case "darkorange":
1847
- return 4287365375;
1848
- case "darkorchid":
1849
- return 2570243327;
1850
- case "darkred":
1851
- return 2332033279;
1852
- case "darksalmon":
1853
- return 3918953215;
1854
- case "darkseagreen":
1855
- return 2411499519;
1856
- case "darkslateblue":
1857
- return 1211993087;
1858
- case "darkslategray":
1859
- return 793726975;
1860
- case "darkslategrey":
1861
- return 793726975;
1862
- case "darkturquoise":
1863
- return 13554175;
1864
- case "darkviolet":
1865
- return 2483082239;
1866
- case "deeppink":
1867
- return 4279538687;
1868
- case "deepskyblue":
1869
- return 12582911;
1870
- case "dimgray":
1871
- return 1768516095;
1872
- case "dimgrey":
1873
- return 1768516095;
1874
- case "dodgerblue":
1875
- return 512819199;
1876
- case "firebrick":
1877
- return 2988581631;
1878
- case "floralwhite":
1879
- return 4294635775;
1880
- case "forestgreen":
1881
- return 579543807;
1882
- case "fuchsia":
1883
- return 4278255615;
1884
- case "gainsboro":
1885
- return 3705462015;
1886
- case "ghostwhite":
1887
- return 4177068031;
1888
- case "gold":
1889
- return 4292280575;
1890
- case "goldenrod":
1891
- return 3668254975;
1892
- case "gray":
1893
- return 2155905279;
1894
- case "green":
1895
- return 8388863;
1896
- case "greenyellow":
1897
- return 2919182335;
1898
- case "grey":
1899
- return 2155905279;
1900
- case "honeydew":
1901
- return 4043305215;
1902
- case "hotpink":
1903
- return 4285117695;
1904
- case "indianred":
1905
- return 3445382399;
1906
- case "indigo":
1907
- return 1258324735;
1908
- case "ivory":
1909
- return 4294963455;
1910
- case "khaki":
1911
- return 4041641215;
1912
- case "lavender":
1913
- return 3873897215;
1914
- case "lavenderblush":
1915
- return 4293981695;
1916
- case "lawngreen":
1917
- return 2096890111;
1918
- case "lemonchiffon":
1919
- return 4294626815;
1920
- case "lightblue":
1921
- return 2916673279;
1922
- case "lightcoral":
1923
- return 4034953471;
1924
- case "lightcyan":
1925
- return 3774873599;
1926
- case "lightgoldenrodyellow":
1927
- return 4210742015;
1928
- case "lightgray":
1929
- return 3553874943;
1930
- case "lightgreen":
1931
- return 2431553791;
1932
- case "lightgrey":
1933
- return 3553874943;
1934
- case "lightpink":
1935
- return 4290167295;
1936
- case "lightsalmon":
1937
- return 4288707327;
1938
- case "lightseagreen":
1939
- return 548580095;
1940
- case "lightskyblue":
1941
- return 2278488831;
1942
- case "lightslategray":
1943
- return 2005441023;
1944
- case "lightslategrey":
1945
- return 2005441023;
1946
- case "lightsteelblue":
1947
- return 2965692159;
1948
- case "lightyellow":
1949
- return 4294959359;
1950
- case "lime":
1951
- return 16711935;
1952
- case "limegreen":
1953
- return 852308735;
1954
- case "linen":
1955
- return 4210091775;
1956
- case "magenta":
1957
- return 4278255615;
1958
- case "maroon":
1959
- return 2147483903;
1960
- case "mediumaquamarine":
1961
- return 1724754687;
1962
- case "mediumblue":
1963
- return 52735;
1964
- case "mediumorchid":
1965
- return 3126187007;
1966
- case "mediumpurple":
1967
- return 2473647103;
1968
- case "mediumseagreen":
1969
- return 1018393087;
1970
- case "mediumslateblue":
1971
- return 2070474495;
1972
- case "mediumspringgreen":
1973
- return 16423679;
1974
- case "mediumturquoise":
1975
- return 1221709055;
1976
- case "mediumvioletred":
1977
- return 3340076543;
1978
- case "midnightblue":
1979
- return 421097727;
1980
- case "mintcream":
1981
- return 4127193855;
1982
- case "mistyrose":
1983
- return 4293190143;
1984
- case "moccasin":
1985
- return 4293178879;
1986
- case "navajowhite":
1987
- return 4292783615;
1988
- case "navy":
1989
- return 33023;
1990
- case "oldlace":
1991
- return 4260751103;
1992
- case "olive":
1993
- return 2155872511;
1994
- case "olivedrab":
1995
- return 1804477439;
1996
- case "orange":
1997
- return 4289003775;
1998
- case "orangered":
1999
- return 4282712319;
2000
- case "orchid":
2001
- return 3664828159;
2002
- case "palegoldenrod":
2003
- return 4008225535;
2004
- case "palegreen":
2005
- return 2566625535;
2006
- case "paleturquoise":
2007
- return 2951671551;
2008
- case "palevioletred":
2009
- return 3681588223;
2010
- case "papayawhip":
2011
- return 4293907967;
2012
- case "peachpuff":
2013
- return 4292524543;
2014
- case "peru":
2015
- return 3448061951;
2016
- case "pink":
2017
- return 4290825215;
2018
- case "plum":
2019
- return 3718307327;
2020
- case "powderblue":
2021
- return 2967529215;
2022
- case "purple":
2023
- return 2147516671;
2024
- case "rebeccapurple":
2025
- return 1714657791;
2026
- case "red":
2027
- return 4278190335;
2028
- case "rosybrown":
2029
- return 3163525119;
2030
- case "royalblue":
2031
- return 1097458175;
2032
- case "saddlebrown":
2033
- return 2336560127;
2034
- case "salmon":
2035
- return 4202722047;
2036
- case "sandybrown":
2037
- return 4104413439;
2038
- case "seagreen":
2039
- return 780883967;
2040
- case "seashell":
2041
- return 4294307583;
2042
- case "sienna":
2043
- return 2689740287;
2044
- case "silver":
2045
- return 3233857791;
2046
- case "skyblue":
2047
- return 2278484991;
2048
- case "slateblue":
2049
- return 1784335871;
2050
- case "slategray":
2051
- return 1887473919;
2052
- case "slategrey":
2053
- return 1887473919;
2054
- case "snow":
2055
- return 4294638335;
2056
- case "springgreen":
2057
- return 16744447;
2058
- case "steelblue":
2059
- return 1182971135;
2060
- case "tan":
2061
- return 3535047935;
2062
- case "teal":
2063
- return 8421631;
2064
- case "thistle":
2065
- return 3636451583;
2066
- case "tomato":
2067
- return 4284696575;
2068
- case "turquoise":
2069
- return 1088475391;
2070
- case "violet":
2071
- return 4001558271;
2072
- case "wheat":
2073
- return 4125012991;
2074
- case "white":
2075
- return 4294967295;
2076
- case "whitesmoke":
2077
- return 4126537215;
2078
- case "yellow":
2079
- return 4294902015;
2080
- case "yellowgreen":
2081
- return 2597139199;
2082
- }
2083
- return null;
2084
- }
2085
- module2.exports = normalizeColor;
2086
- }
2087
- });
2088
-
2089
- // ../normalize-css-color/dist/cjs/index.native.js
2090
- var require_index_native5 = __commonJS({
2091
- "../normalize-css-color/dist/cjs/index.native.js"(exports, module2) {
2092
- "use strict";
2093
- var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2094
- for (var name in all)
2095
- __defProp2(target, name, { get: all[name], enumerable: !0 });
2096
- }, __copyProps2 = (to, from, except, desc) => {
2097
- if (from && typeof from == "object" || typeof from == "function")
2098
- for (let key of __getOwnPropNames2(from))
2099
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2100
- return to;
2101
- }, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
2102
- // If the importer is in node compatibility mode or this is not an ESM
2103
- // file that has been converted to a CommonJS file using a Babel-
2104
- // compatible transform (i.e. "__esModule" has not been set), then set
2105
- // "default" to the CommonJS "module.exports" for node compatibility.
2106
- isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: !0 }) : target,
2107
- mod
2108
- )), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), src_exports2 = {};
2109
- __export2(src_exports2, {
2110
- default: () => src_default,
2111
- normalizeCSSColor: () => normalizeCSSColor,
2112
- rgba: () => rgba2
2113
- });
2114
- module2.exports = __toCommonJS2(src_exports2);
2115
- var normalizeColor = __toESM2(require_normalize_color()), norm = normalizeColor.default || normalizeColor, normalizeCSSColor = norm;
2116
- function rgba2(colorInt) {
2117
- var r = Math.round((colorInt & 4278190080) >>> 24), g = Math.round((colorInt & 16711680) >>> 16), b = Math.round((colorInt & 65280) >>> 8), a = ((colorInt & 255) >>> 0) / 255;
2118
- return {
2119
- r,
2120
- g,
2121
- b,
2122
- a
2123
- };
2124
- }
2125
- var src_default = normalizeCSSColor;
2126
- }
2127
- });
2128
-
2129
- // ../web/dist/cjs/helpers/defaultOffset.native.js
2130
- var require_defaultOffset_native = __commonJS({
2131
- "../web/dist/cjs/helpers/defaultOffset.native.js"(exports, module2) {
2132
- "use strict";
2133
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2134
- for (var name in all)
2135
- __defProp2(target, name, { get: all[name], enumerable: !0 });
2136
- }, __copyProps2 = (to, from, except, desc) => {
2137
- if (from && typeof from == "object" || typeof from == "function")
2138
- for (let key of __getOwnPropNames2(from))
2139
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2140
- return to;
2141
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), defaultOffset_exports = {};
2142
- __export2(defaultOffset_exports, {
2143
- defaultOffset: () => defaultOffset
2144
- });
2145
- module2.exports = __toCommonJS2(defaultOffset_exports);
2146
- var defaultOffset = { height: 0, width: 0 };
2147
- }
2148
- });
2149
-
2150
- // ../web/dist/cjs/helpers/normalizeColor.native.js
2151
- var require_normalizeColor_native = __commonJS({
2152
- "../web/dist/cjs/helpers/normalizeColor.native.js"(exports, module2) {
2153
- "use strict";
2154
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2155
- for (var name in all)
2156
- __defProp2(target, name, { get: all[name], enumerable: !0 });
2157
- }, __copyProps2 = (to, from, except, desc) => {
2158
- if (from && typeof from == "object" || typeof from == "function")
2159
- for (let key of __getOwnPropNames2(from))
2160
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2161
- return to;
2162
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), normalizeColor_exports = {};
2163
- __export2(normalizeColor_exports, {
2164
- normalizeColor: () => normalizeColor,
2165
- rgba: () => import_normalize_css_color2.rgba
2166
- });
2167
- module2.exports = __toCommonJS2(normalizeColor_exports);
2168
- var import_constants2 = require_index_native2(), import_normalize_css_color = require_index_native5(), import_normalize_css_color2 = require_index_native5(), normalizeColor = (color, opacity) => {
2169
- if (!color)
2170
- return;
2171
- if (color[0] === "$" || color[0] === "v" && color.startsWith("var(") || import_constants2.isWeb && opacity === 1)
2172
- return color;
2173
- let colorProcessed = (0, import_normalize_css_color.normalizeCSSColor)(color);
2174
- if (colorProcessed != null) {
2175
- let { r, g, b, a } = (0, import_normalize_css_color.rgba)(colorProcessed), alpha = (opacity ?? a ?? 1).toFixed(2);
2176
- return `rgba(${r},${g},${b},${alpha})`;
2177
- }
2178
- process.env.NODE_ENV === "development" && console.warn(`Unknown color value: ${color}`);
2179
- };
2180
- }
2181
- });
2182
-
2183
- // ../web/dist/cjs/helpers/normalizeValueWithProperty.native.js
2184
- var require_normalizeValueWithProperty_native = __commonJS({
2185
- "../web/dist/cjs/helpers/normalizeValueWithProperty.native.js"(exports, module2) {
2186
- "use strict";
2187
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2188
- for (var name in all)
2189
- __defProp2(target, name, { get: all[name], enumerable: !0 });
2190
- }, __copyProps2 = (to, from, except, desc) => {
2191
- if (from && typeof from == "object" || typeof from == "function")
2192
- for (let key of __getOwnPropNames2(from))
2193
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2194
- return to;
2195
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), normalizeValueWithProperty_exports = {};
2196
- __export2(normalizeValueWithProperty_exports, {
2197
- normalizeValueWithProperty: () => normalizeValueWithProperty,
2198
- reverseMapClassNameToValue: () => reverseMapClassNameToValue
2199
- });
2200
- module2.exports = __toCommonJS2(normalizeValueWithProperty_exports);
2201
- var import_constants2 = require_index_native2(), import_helpers = require_index_native4(), import_insertStyleRule = require_insertStyleRule_native(), stylePropsAllPlusTransforms = {
2202
- ...import_helpers.stylePropsAll,
2203
- translateX: !0,
2204
- translateY: !0
2205
- };
2206
- function normalizeValueWithProperty(value, property) {
2207
- if (!import_constants2.isWeb || typeof value == "boolean" || property && property in import_helpers.stylePropsUnitless || property && !(property in stylePropsAllPlusTransforms))
2208
- return value;
2209
- let res = value;
2210
- return value && typeof value == "object" ? value : (typeof value == "number" ? res = `${value}px` : property && (res = `${res}`), res);
2211
- }
2212
- var rcache = {};
2213
- function reverseMapClassNameToValue(key, className) {
2214
- let cssRule = (0, import_insertStyleRule.getAllSelectors)()[className];
2215
- if (rcache[cssRule])
2216
- return rcache[cssRule];
2217
- if (!cssRule) {
2218
- process.env.NODE_ENV === "development" && console.warn(
2219
- `No CSS rule found for ${key} looking for selector ".${className}", you may not be injecting extracted CSS`
2220
- );
2221
- return;
2222
- }
2223
- let cssVal = cssRule.replace(/.*:/, "").replace(/;.*/, "").trim(), res;
2224
- return cssVal.startsWith("var(") ? res = cssVal : import_helpers.stylePropsUnitless[key] ? res = +cssVal : cssVal.endsWith("px") ? res = +cssVal.replace("px", "") : res = cssVal, rcache[cssRule] = res, process.env.NODE_ENV === "development" && typeof res == "number" && isNaN(res) && console.log("Tamagui invalid parsed value, NaN:", {
2225
- res,
2226
- cssVal,
2227
- cssRule,
2228
- key,
2229
- className
2230
- }), res;
2231
- }
2232
- }
2233
- });
2234
-
2235
- // ../web/dist/cjs/helpers/normalizeShadow.native.js
2236
- var require_normalizeShadow_native = __commonJS({
2237
- "../web/dist/cjs/helpers/normalizeShadow.native.js"(exports, module2) {
2238
- "use strict";
2239
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2240
- for (var name in all)
2241
- __defProp2(target, name, { get: all[name], enumerable: !0 });
2242
- }, __copyProps2 = (to, from, except, desc) => {
2243
- if (from && typeof from == "object" || typeof from == "function")
2244
- for (let key of __getOwnPropNames2(from))
2245
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2246
- return to;
2247
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), normalizeShadow_native_exports = {};
2248
- __export2(normalizeShadow_native_exports, {
2249
- normalizeShadow: () => normalizeShadow
2250
- });
2251
- module2.exports = __toCommonJS2(normalizeShadow_native_exports);
2252
- var import_normalize_css_color = require_index_native5(), import_defaultOffset = require_defaultOffset_native(), import_normalizeColor = require_normalizeColor_native(), import_normalizeValueWithProperty = require_normalizeValueWithProperty_native();
2253
- function normalizeShadow({
2254
- shadowColor,
2255
- shadowOffset,
2256
- shadowOpacity,
2257
- shadowRadius
2258
- }) {
2259
- let { height, width } = shadowOffset || import_defaultOffset.defaultOffset, colorStr = String(shadowColor || "black"), val = (0, import_normalize_css_color.normalizeCSSColor)(colorStr);
2260
- if (typeof val != "number")
2261
- throw new Error(`invalid shadow color ${colorStr}`);
2262
- let { r, g, b, a } = (0, import_normalizeColor.rgba)(val);
2263
- return {
2264
- shadowOffset: {
2265
- width: (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(width || 0),
2266
- height: (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(height || 0)
2267
- },
2268
- shadowRadius: (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(shadowRadius || 0),
2269
- shadowColor: `rgb(${r},${g},${b})`,
2270
- shadowOpacity: shadowOpacity ?? a
2271
- };
2272
- }
2273
- }
2274
- });
2275
-
2276
- // ../web/dist/cjs/helpers/pseudoDescriptors.native.js
2277
- var require_pseudoDescriptors_native = __commonJS({
2278
- "../web/dist/cjs/helpers/pseudoDescriptors.native.js"(exports, module2) {
2279
- "use strict";
2280
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2281
- for (var name in all)
2282
- __defProp2(target, name, { get: all[name], enumerable: !0 });
2283
- }, __copyProps2 = (to, from, except, desc) => {
2284
- if (from && typeof from == "object" || typeof from == "function")
2285
- for (let key of __getOwnPropNames2(from))
2286
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2287
- return to;
2288
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), pseudoDescriptors_exports = {};
2289
- __export2(pseudoDescriptors_exports, {
2290
- pseudoDescriptors: () => pseudoDescriptors,
2291
- pseudoDescriptorsBase: () => pseudoDescriptorsBase,
2292
- pseudoPriorities: () => pseudoPriorities
2293
- });
2294
- module2.exports = __toCommonJS2(pseudoDescriptors_exports);
2295
- var pseudoDescriptorsBase = {
2296
- // order of keys here important! in priority order
2297
- hoverStyle: {
2298
- name: "hover",
2299
- priority: 1
2300
- },
2301
- pressStyle: {
2302
- name: "active",
2303
- stateKey: "press",
2304
- priority: 2
2305
- },
2306
- focusStyle: {
2307
- name: "focus",
2308
- priority: 3
2309
- }
2310
- }, pseudoPriorities = {
2311
- hover: 1,
2312
- press: 2,
2313
- focus: 3
2314
- }, pseudoDescriptors = {
2315
- ...pseudoDescriptorsBase,
2316
- enterStyle: {
2317
- name: "enter",
2318
- stateKey: "unmounted",
2319
- priority: 4
2320
- },
2321
- exitStyle: {
2322
- name: "exit",
2323
- priority: 5
2324
- }
2325
- };
2326
- }
2327
- });
2328
-
2329
- // ../web/dist/cjs/helpers/expandStyles.native.js
2330
- var require_expandStyles_native = __commonJS({
2331
- "../web/dist/cjs/helpers/expandStyles.native.js"(exports, module2) {
2332
- "use strict";
2333
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2334
- for (var name in all)
2335
- __defProp2(target, name, { get: all[name], enumerable: !0 });
2336
- }, __copyProps2 = (to, from, except, desc) => {
2337
- if (from && typeof from == "object" || typeof from == "function")
2338
- for (let key of __getOwnPropNames2(from))
2339
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2340
- return to;
2341
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), expandStyles_exports = {};
2342
- __export2(expandStyles_exports, {
2343
- expandStylesAndRemoveNullishValues: () => expandStylesAndRemoveNullishValues,
2344
- fixStyles: () => fixStyles
2345
- });
2346
- module2.exports = __toCommonJS2(expandStyles_exports);
2347
- var import_constants2 = require_index_native2(), import_expandStyle = require_expandStyle_native(), import_normalizeShadow = require_normalizeShadow_native(), import_normalizeValueWithProperty = require_normalizeValueWithProperty_native(), import_pseudoDescriptors = require_pseudoDescriptors_native();
2348
- function expandStylesAndRemoveNullishValues(style) {
2349
- let res = {};
2350
- for (let key in style) {
2351
- let valIn = style[key];
2352
- if (valIn == null)
2353
- continue;
2354
- if (key in import_pseudoDescriptors.pseudoDescriptors) {
2355
- res[key] = expandStylesAndRemoveNullishValues(valIn);
2356
- continue;
2357
- }
2358
- let val = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(valIn, key), out = (0, import_expandStyle.expandStyle)(key, val);
2359
- out ? Object.assign(res, Object.fromEntries(out)) : res[key] = val;
2360
- }
2361
- return fixStyles(res), res;
2362
- }
2363
- function fixStyles(style) {
2364
- "elevationAndroid" in style && (style.elevation = style.elevationAndroid, delete style.elevationAndroid), (style.shadowRadius || style.shadowColor || style.shadowOpacity || style.shadowOffset) && Object.assign(style, (0, import_normalizeShadow.normalizeShadow)(style));
2365
- for (let key in borderDefaults)
2366
- key in style && !style[borderDefaults[key]] && (style[borderDefaults[key]] = "solid");
2367
- }
2368
- var nativeStyle = import_constants2.isWeb ? null : "borderStyle", borderDefaults = {
2369
- borderWidth: "borderStyle",
2370
- borderBottomWidth: nativeStyle || "borderBottomStyle",
2371
- borderTopWidth: nativeStyle || "borderTopStyle",
2372
- borderLeftWidth: nativeStyle || "borderLeftStyle",
2373
- borderRightWidth: nativeStyle || "borderRightStyle"
2374
- };
2375
- }
2376
- });
2377
-
2378
- // ../web/dist/cjs/helpers/getVariantExtras.native.js
2379
- var require_getVariantExtras_native = __commonJS({
2380
- "../web/dist/cjs/helpers/getVariantExtras.native.js"(exports, module2) {
2381
- "use strict";
2382
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2383
- for (var name in all)
2384
- __defProp2(target, name, { get: all[name], enumerable: !0 });
2385
- }, __copyProps2 = (to, from, except, desc) => {
2386
- if (from && typeof from == "object" || typeof from == "function")
2387
- for (let key of __getOwnPropNames2(from))
2388
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2389
- return to;
2390
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), getVariantExtras_exports = {};
2391
- __export2(getVariantExtras_exports, {
2392
- getFontsForLanguage: () => getFontsForLanguage,
2393
- getVariantExtras: () => getVariantExtras
2394
- });
2395
- module2.exports = __toCommonJS2(getVariantExtras_exports);
2396
- var import_createVariable = require_createVariable_native(), import_createProxy = require_createProxy_native();
2397
- function getVariantExtras(styleState) {
2398
- let { curProps, conf, context, theme } = styleState, fonts = conf.fontsParsed;
2399
- context != null && context.language && (fonts = getFontsForLanguage(conf.fontsParsed, context.language));
2400
- let fontFamily = (0, import_createVariable.getVariableValue)(
2401
- styleState.fontFamily || styleState.curProps.fontFamily || styleState.conf.defaultFont
2402
- );
2403
- return {
2404
- fonts,
2405
- tokens: conf.tokensParsed,
2406
- theme,
2407
- fontFamily,
2408
- font: fonts[fontFamily] || fonts[styleState.conf.defaultFont],
2409
- // TODO do this in splitstlye
2410
- // we avoid passing in default props for media queries because that would confuse things like SizableText.size:
2411
- props: (0, import_createProxy.createProxy)(curProps, {
2412
- // handles shorthands
2413
- get(target, key) {
2414
- let shorthand = conf.inverseShorthands[key];
2415
- if (shorthand && Reflect.has(target, shorthand))
2416
- return Reflect.get(target, shorthand);
2417
- if (Reflect.has(target, key))
2418
- return Reflect.get(target, key);
2419
- }
2420
- })
2421
- };
2422
- }
2423
- var fontLanguageCache = /* @__PURE__ */ new WeakMap();
2424
- function getFontsForLanguage(fonts, language) {
2425
- if (fontLanguageCache.has(language))
2426
- return fontLanguageCache.get(language);
2427
- let next = {
2428
- ...fonts,
2429
- ...Object.fromEntries(
2430
- Object.entries(language).map(([name, lang]) => {
2431
- if (lang === "default")
2432
- return [];
2433
- let langKey = `$${name}_${lang}`;
2434
- return [`$${name}`, fonts[langKey]];
2435
- })
2436
- )
2437
- };
2438
- return fontLanguageCache.set(language, next), next;
2439
- }
2440
- }
2441
- });
2442
-
2443
- // ../web/dist/cjs/helpers/isObj.native.js
2444
- var require_isObj_native = __commonJS({
2445
- "../web/dist/cjs/helpers/isObj.native.js"(exports, module2) {
2446
- "use strict";
2447
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2448
- for (var name in all)
2449
- __defProp2(target, name, { get: all[name], enumerable: !0 });
2450
- }, __copyProps2 = (to, from, except, desc) => {
2451
- if (from && typeof from == "object" || typeof from == "function")
2452
- for (let key of __getOwnPropNames2(from))
2453
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2454
- return to;
2455
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), isObj_exports = {};
2456
- __export2(isObj_exports, {
2457
- isObj: () => isObj
2458
- });
2459
- module2.exports = __toCommonJS2(isObj_exports);
2460
- var isObj = (x) => x && !Array.isArray(x) && typeof x == "object";
2461
- }
2462
- });
2463
-
2464
- // ../web/dist/cjs/helpers/propMapper.native.js
2465
- var require_propMapper_native = __commonJS({
2466
- "../web/dist/cjs/helpers/propMapper.native.js"(exports, module2) {
2467
- "use strict";
2468
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2469
- for (var name in all)
2470
- __defProp2(target, name, { get: all[name], enumerable: !0 });
2471
- }, __copyProps2 = (to, from, except, desc) => {
2472
- if (from && typeof from == "object" || typeof from == "function")
2473
- for (let key of __getOwnPropNames2(from))
2474
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2475
- return to;
2476
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), propMapper_exports = {};
2477
- __export2(propMapper_exports, {
2478
- getFontFamilyFromNameOrVariable: () => getFontFamilyFromNameOrVariable,
2479
- getPropMappedFontFamily: () => getPropMappedFontFamily,
2480
- getTokenForKey: () => getTokenForKey,
2481
- propMapper: () => propMapper
2482
- });
2483
- module2.exports = __toCommonJS2(propMapper_exports);
2484
- var import_constants2 = require_index_native2(), import_helpers = require_index_native4(), import_config = require_config_native(), import_isDevTools = require_isDevTools_native(), import_createVariable = require_createVariable_native(), import_expandStyle = require_expandStyle_native(), import_expandStyles = require_expandStyles_native(), import_getVariantExtras = require_getVariantExtras_native(), import_isObj = require_isObj_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), propMapper = (key, value, styleStateIn, subPropsIn) => {
2485
- if (!import_constants2.isAndroid && key === "elevationAndroid")
2486
- return;
2487
- let subProps = styleStateIn.styleProps.fallbackProps || subPropsIn, styleState = subProps ? new Proxy(styleStateIn, {
2488
- get(_, k) {
2489
- return k === "curProps" ? subProps : Reflect.get(_, k);
2490
- }
2491
- }) : styleStateIn, { conf, styleProps, fontFamily, staticConfig } = styleState, { variants } = staticConfig;
2492
- if (process.env.NODE_ENV === "development" && fontFamily && fontFamily[0] === "$" && !(fontFamily in conf.fontsParsed) && console.warn(
2493
- `Warning: no fontFamily "${fontFamily}" found in config: ${Object.keys(conf.fontsParsed).join(
2494
- ", "
2495
- )}`
2496
- ), variants && key in variants) {
2497
- styleState.curProps[key] = value;
2498
- let variantValue = resolveVariants(key, value, styleProps, styleState, "");
2499
- if (variantValue)
2500
- return variantValue;
2501
- }
2502
- let shouldReturn = !1;
2503
- if (key in conf.shorthands && (shouldReturn = !0, key = conf.shorthands[key]), value && (value[0] === "$" ? value = getTokenForKey(key, value, styleProps.resolveVariablesAs, styleState) : (0, import_createVariable.isVariable)(value) && (value = resolveVariableValue(value, styleProps.resolveVariablesAs))), shouldReturn || value != null)
2504
- return (0, import_expandStyle.expandStyle)(key, value) || [[key, value]];
2505
- }, resolveVariants = (key, value, styleProps, styleState, parentVariantKey) => {
2506
- let { staticConfig, conf, debug } = styleState, { variants } = staticConfig;
2507
- if (!variants)
2508
- return;
2509
- let variantValue = getVariantDefinition(variants[key], key, value, conf);
2510
- if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(`\u2666\uFE0F\u2666\uFE0F\u2666\uFE0F resolve variant ${key}`), console.log({
2511
- key,
2512
- value,
2513
- variantValue,
2514
- variants,
2515
- curProps: { ...styleState.curProps }
2516
- }), console.groupEnd()), !variantValue) {
2517
- if (process.env.TAMAGUI_WARN_ON_MISSING_VARIANT === "1" && typeof value != "boolean") {
2518
- let name = staticConfig.componentName || "[UnnamedComponent]";
2519
- console.warn(
2520
- `No variant found: ${name} has variant "${key}", but no matching value "${value}"`
2521
- );
2522
- }
2523
- return;
2524
- }
2525
- if (typeof variantValue == "function") {
2526
- let fn = variantValue, extras = (0, import_getVariantExtras.getVariantExtras)(styleState);
2527
- variantValue = fn(value, extras), process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(" expanded functional variant", key), console.log({ fn, variantValue, extras }), console.groupEnd());
2528
- }
2529
- let fontFamilyResult;
2530
- if ((0, import_isObj.isObj)(variantValue)) {
2531
- let fontFamilyUpdate = variantValue.fontFamily || variantValue[conf.inverseShorthands.fontFamily];
2532
- fontFamilyUpdate && (fontFamilyResult = getFontFamilyFromNameOrVariable(fontFamilyUpdate, conf), styleState.fontFamily = fontFamilyResult, process.env.NODE_ENV === "development" && debug === "verbose" && console.log(" updating font family", fontFamilyResult)), variantValue = resolveTokensAndVariants(
2533
- key,
2534
- variantValue,
2535
- styleProps,
2536
- styleState,
2537
- parentVariantKey
2538
- );
2539
- }
2540
- if (variantValue) {
2541
- let expanded = (0, import_expandStyles.expandStylesAndRemoveNullishValues)(variantValue), next = Object.entries(expanded);
2542
- return fontFamilyResult && fontFamilyResult[0] === "$" && fontFamilyCache.set(next, (0, import_createVariable.getVariableValue)(fontFamilyResult)), next;
2543
- }
2544
- };
2545
- function getFontFamilyFromNameOrVariable(input, conf) {
2546
- if ((0, import_createVariable.isVariable)(input)) {
2547
- let val = variableToFontNameCache.get(input);
2548
- if (val)
2549
- return val;
2550
- for (let key in conf.fontsParsed) {
2551
- let familyVariable = conf.fontsParsed[key].family;
2552
- if ((0, import_createVariable.isVariable)(familyVariable) && (variableToFontNameCache.set(familyVariable, key), familyVariable === input))
2553
- return key;
2554
- }
2555
- } else if (typeof input == "string" && input[0] === "$")
2556
- return input;
2557
- }
2558
- var variableToFontNameCache = /* @__PURE__ */ new WeakMap(), fontFamilyCache = /* @__PURE__ */ new WeakMap(), getPropMappedFontFamily = (expanded) => expanded && fontFamilyCache.get(expanded), resolveTokensAndVariants = (key, value, styleProps, styleState, parentVariantKey) => {
2559
- var _a;
2560
- let { conf, staticConfig, debug, theme } = styleState, { variants } = staticConfig, res = {};
2561
- process.env.NODE_ENV === "development" && debug === "verbose" && console.log(" - resolveTokensAndVariants", key, value);
2562
- for (let rKey in value) {
2563
- let fKey = conf.shorthands[rKey] || rKey, val = value[rKey];
2564
- if (variants && fKey in variants) {
2565
- if (styleState.curProps[fKey] = val, parentVariantKey && parentVariantKey === key)
2566
- res[fKey] = // SYNC WITH *1
2567
- val[0] === "$" ? getTokenForKey(fKey, val, styleProps.resolveVariablesAs, styleState) : val;
2568
- else {
2569
- let variantOut = resolveVariants(fKey, val, styleProps, styleState, key);
2570
- if (variantOut)
2571
- for (let [key2, val2] of variantOut)
2572
- val2 != null && (key2 in import_pseudoDescriptors.pseudoDescriptors ? (res[key2] ??= {}, Object.assign(res[key2], val2)) : res[key2] = val2);
2573
- }
2574
- continue;
2575
- }
2576
- if ((0, import_createVariable.isVariable)(val)) {
2577
- res[fKey] = resolveVariableValue(val, styleProps.resolveVariablesAs);
2578
- continue;
2579
- }
2580
- if (typeof val == "string") {
2581
- let fVal = (
2582
- // SYNC WITH *1
2583
- val[0] === "$" ? getTokenForKey(fKey, val, styleProps.resolveVariablesAs, styleState) : val
2584
- );
2585
- res[fKey] = fVal;
2586
- continue;
2587
- }
2588
- if ((0, import_isObj.isObj)(val)) {
2589
- let subObject = resolveTokensAndVariants(fKey, val, styleProps, styleState, key);
2590
- process.env.NODE_ENV === "development" && debug === "verbose" && console.log("object", fKey, subObject), res[fKey] ??= {}, Object.assign(res[fKey], subObject);
2591
- } else
2592
- res[fKey] = val;
2593
- process.env.NODE_ENV === "development" && debug && ((_a = res[fKey]) == null ? void 0 : _a[0]) === "$" && console.warn(`\u26A0\uFE0F Missing token in theme ${theme.name}:`, fKey, res[fKey], theme);
2594
- }
2595
- return res;
2596
- }, tokenCats = ["size", "color", "radius", "space", "zIndex"].map((name) => ({
2597
- name,
2598
- spreadName: `...${name}`
2599
- }));
2600
- function getVariantDefinition(variant, key, value, conf) {
2601
- if (typeof variant == "function")
2602
- return variant;
2603
- if (variant[value])
2604
- return variant[value];
2605
- let { tokensParsed } = conf;
2606
- for (let { name, spreadName } of tokenCats)
2607
- if (spreadName in variant && value in tokensParsed[name])
2608
- return variant[spreadName];
2609
- let fontSizeVariant = variant["...fontSize"];
2610
- return fontSizeVariant && conf.fontSizeTokens.has(value) ? fontSizeVariant : variant[`:${typeof value}`] || variant["..."] || variant["...size"];
2611
- }
2612
- var fontShorthand = {
2613
- fontSize: "size",
2614
- fontWeight: "weight"
2615
- }, getTokenForKey = (key, value, resolveAs = "none", styleState) => {
2616
- var _a, _b;
2617
- if (resolveAs === "none")
2618
- return value;
2619
- let { theme, conf = (0, import_config.getConfig)(), context, fontFamily } = styleState, tokensParsed = conf.tokensParsed, valOrVar, hasSet = !1;
2620
- if (theme && value in theme)
2621
- process.env.NODE_ENV === "development" && styleState.debug === "verbose" && console.log(` - getting theme value for ${key} from ${value}`), valOrVar = theme[value], hasSet = !0;
2622
- else if (value in conf.specificTokens)
2623
- hasSet = !0, valOrVar = conf.specificTokens[value];
2624
- else {
2625
- switch (key) {
2626
- case "fontFamily": {
2627
- 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;
2628
- break;
2629
- }
2630
- case "fontSize":
2631
- case "lineHeight":
2632
- case "letterSpacing":
2633
- case "fontWeight": {
2634
- let defaultFont = conf.defaultFont || "$body", fam = fontFamily || defaultFont;
2635
- if (fam) {
2636
- let fontsParsed = context != null && context.language ? (0, import_getVariantExtras.getFontsForLanguage)(conf.fontsParsed, context.language) : conf.fontsParsed, font = fontsParsed[fam] || fontsParsed[defaultFont];
2637
- valOrVar = ((_b = font == null ? void 0 : font[fontShorthand[key] || key]) == null ? void 0 : _b[value]) || value, hasSet = !0;
2638
- }
2639
- break;
2640
- }
2641
- }
2642
- for (let cat in import_helpers.tokenCategories)
2643
- if (key in import_helpers.tokenCategories[cat]) {
2644
- let res = tokensParsed[cat][value];
2645
- res != null && (valOrVar = res, hasSet = !0);
2646
- }
2647
- if (!hasSet) {
2648
- let spaceVar = tokensParsed.space[value];
2649
- spaceVar != null && (valOrVar = spaceVar, hasSet = !0);
2650
- }
2651
- }
2652
- return hasSet ? resolveVariableValue(valOrVar, resolveAs) : (process.env.NODE_ENV === "development" && import_isDevTools.isDevTools && styleState.debug === "verbose" && (console.groupCollapsed(" \uFE52 propMap (val)", key, value), console.log({ valOrVar, theme, hasSet }, theme ? theme[key] : ""), console.groupEnd()), value);
2653
- };
2654
- function resolveVariableValue(valOrVar, resolveVariablesAs) {
2655
- return resolveVariablesAs === "none" ? valOrVar : (0, import_createVariable.isVariable)(valOrVar) ? !import_constants2.isWeb || resolveVariablesAs === "value" ? valOrVar.val : valOrVar.variable : valOrVar;
1901
+ function useClientValue(value) {
1902
+ return useDidFinishSSR() ? typeof value == "function" ? value() : value : void 0;
2656
1903
  }
2657
1904
  }
2658
1905
  });
@@ -2682,9 +1929,9 @@ var require_constants_native = __commonJS({
2682
1929
  }
2683
1930
  });
2684
1931
 
2685
- // ../web/dist/cjs/helpers/ThemeManager.native.js
2686
- var require_ThemeManager_native = __commonJS({
2687
- "../web/dist/cjs/helpers/ThemeManager.native.js"(exports, module2) {
1932
+ // ../web/dist/cjs/helpers/objectIdentityKey.native.js
1933
+ var require_objectIdentityKey_native = __commonJS({
1934
+ "../web/dist/cjs/helpers/objectIdentityKey.native.js"(exports, module2) {
2688
1935
  "use strict";
2689
1936
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2690
1937
  for (var name in all)
@@ -2694,160 +1941,77 @@ var require_ThemeManager_native = __commonJS({
2694
1941
  for (let key of __getOwnPropNames2(from))
2695
1942
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2696
1943
  return to;
2697
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ThemeManager_exports = {};
2698
- __export2(ThemeManager_exports, {
2699
- ThemeManager: () => ThemeManager,
2700
- getHasThemeUpdatingProps: () => getHasThemeUpdatingProps,
2701
- getNonComponentParentManager: () => getNonComponentParentManager
1944
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), objectIdentityKey_exports = {};
1945
+ __export2(objectIdentityKey_exports, {
1946
+ objectIdentityKey: () => objectIdentityKey
2702
1947
  });
2703
- module2.exports = __toCommonJS2(ThemeManager_exports);
2704
- var import_constants2 = require_index_native2(), import_config = require_config_native(), import_constants22 = require_constants_native(), emptyState = { name: "" };
2705
- function getHasThemeUpdatingProps(props) {
2706
- return props.name || props.componentName || props.inverse || props.reset;
2707
- }
2708
- var uid = 0, ThemeManager = class {
2709
- constructor(props = {}, parentManagerIn) {
2710
- if (this.props = props, this.id = uid++, this.isComponent = !1, this.themeListeners = /* @__PURE__ */ new Set(), this.parentManager = null, this.state = emptyState, this.scheme = null, this._allKeys = null, parentManagerIn === "root") {
2711
- this.updateStateFromProps(props, !1);
2712
- return;
1948
+ module2.exports = __toCommonJS2(objectIdentityKey_exports);
1949
+ function objectIdentityKey(obj) {
1950
+ let k = "";
1951
+ for (let key in obj) {
1952
+ k += key;
1953
+ let arg = obj[key], type = typeof arg;
1954
+ if (!arg || type !== "object")
1955
+ k += type + arg;
1956
+ else if (cache.has(arg))
1957
+ k += cache.get(arg);
1958
+ else {
1959
+ let v = Math.random();
1960
+ cache.set(arg, v), k += v;
2713
1961
  }
2714
- if (!parentManagerIn)
2715
- throw process.env.NODE_ENV !== "production" ? new Error(
2716
- "No parent manager given, this is likely due to duplicated Tamagui dependencies. Check your lockfile for mis-matched versions. It could also be from an error somewhere else in your stack causing Tamagui to recieve undefined context, you can try putting some ErrorBoundary components around other areas of your app, or a Suspense boundary."
2717
- ) : "\u274C 0";
2718
- if (this.parentManager = parentManagerIn, !this.updateStateFromProps(props, !1))
2719
- return parentManagerIn || this;
2720
- }
2721
- updateStateFromProps(props = this.props || {}, shouldNotify = !0) {
2722
- if (this.props = props, props.forceTheme)
2723
- return this.state.theme = props.forceTheme, this.state.name = props.name || "", !0;
2724
- let nextState = this.getStateIfChanged(props);
2725
- if (nextState)
2726
- return this.updateState(nextState, shouldNotify), nextState;
2727
- }
2728
- updateState(nextState, shouldNotify = !0) {
2729
- this.state = nextState;
2730
- let names = this.state.name.split("_"), lastName = names[names.length - 1][0];
2731
- this.isComponent = lastName[0] === lastName[0].toUpperCase(), this._allKeys = null, this.scheme = names[0] === "light" ? "light" : names[0] === "dark" ? "dark" : null, process.env.NODE_ENV === "development" && (this._numChangeEventsSent ??= 0, this._numChangeEventsSent++), shouldNotify && queueMicrotask(() => {
2732
- this.notify();
2733
- });
2734
- }
2735
- getStateIfChanged(props = this.props, state = this.state, parentManager = this.parentManager) {
2736
- let _ = this.getState(props, parentManager);
2737
- if (state && state !== emptyState && !_)
2738
- return parentManager == null ? void 0 : parentManager.state;
2739
- if (this.getStateShouldChange(_, state))
2740
- return _;
2741
- }
2742
- getStateShouldChange(nextState, state = this.state) {
2743
- return !(!(nextState != null && nextState.theme) || nextState.theme === (state == null ? void 0 : state.theme));
2744
- }
2745
- getState(props = this.props, parentManager = this.parentManager) {
2746
- return getState(props, parentManager) || (parentManager == null ? void 0 : parentManager.state) || null;
2747
- }
2748
- get allKeys() {
2749
- var _a;
2750
- return this._allKeys ||= /* @__PURE__ */ new Set([
2751
- ...((_a = this.parentManager) == null ? void 0 : _a.allKeys) || [],
2752
- ...Object.keys(this.state.theme || {})
2753
- ]), this._allKeys;
2754
- }
2755
- notify(forced = !1) {
2756
- this.themeListeners.forEach((cb) => cb(this.state.name, this, forced));
2757
- }
2758
- onChangeTheme(cb, debugId) {
2759
- return process.env.NODE_ENV === "development" && debugId && (this._listeningIds ??= /* @__PURE__ */ new Set(), this._listeningIds.add(debugId)), this.themeListeners.add(cb), () => {
2760
- this.themeListeners.delete(cb);
2761
- };
2762
1962
  }
2763
- };
2764
- function getNextThemeClassName(name) {
2765
- return `t_sub_theme ${import_constants22.THEME_CLASSNAME_PREFIX}${name}`.replace("light_", "").replace("dark_", "");
1963
+ return k;
2766
1964
  }
2767
- function getState(props, parentManager) {
2768
- var _a, _b, _c, _d, _e, _f;
2769
- let validManagerAndAllComponentThemes = getNonComponentParentManager(parentManager);
2770
- parentManager = validManagerAndAllComponentThemes[0];
2771
- let allComponentThemes = validManagerAndAllComponentThemes[1], themes = (0, import_config.getThemes)(), isDirectParentAComponentTheme = allComponentThemes.length > 0;
2772
- if (props.name && props.reset)
2773
- throw new Error("Cannot reset + set new name");
2774
- if (!props.name && !props.inverse && !props.reset && !props.componentName)
2775
- return null;
2776
- if (props.reset && !isDirectParentAComponentTheme && !(parentManager != null && parentManager.parentManager))
2777
- return process.env.NODE_ENV === "development" && console.warn("Cannot reset no grandparent exists"), null;
2778
- 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 ? (
2779
- // here because parentManager already skipped componentTheme so we have to only go up once
2780
- ((_d = parentManager == null ? void 0 : parentManager.parentManager) == null ? void 0 : _d.state.name) || ""
2781
- ) : ((_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) || "";
2782
- props.reset && isDirectParentAComponentTheme && allComponentThemes.shift();
2783
- let base = parentName.split(import_constants22.THEME_NAME_SEPARATOR), lastSegment = base[base.length - 1], isParentComponentTheme = parentName && lastSegment[0].toUpperCase() === lastSegment[0];
2784
- isParentComponentTheme && base.pop();
2785
- let parentBaseTheme = isParentComponentTheme ? base.slice(0, base.length).join(import_constants22.THEME_NAME_SEPARATOR) : parentName, max = base.length, min = componentName && !nextName ? max : 0;
2786
- process.env.NODE_ENV === "development" && typeof props.debug == "string" && (console.groupCollapsed("ThemeManager.getState()"), console.log({
2787
- props,
2788
- parentName,
2789
- parentBaseTheme,
2790
- base,
2791
- min,
2792
- max,
2793
- isParentComponentTheme
2794
- }));
2795
- for (let i = max; i >= min; i--) {
2796
- let prefix = base.slice(0, i).join(import_constants22.THEME_NAME_SEPARATOR);
2797
- props.inverse && (prefix = inverseThemeName(prefix));
2798
- let potentials = [];
2799
- if (prefix && prefix !== parentBaseTheme && potentials.push(prefix), nextName && potentials.unshift(prefix ? `${prefix}_${nextName}` : nextName), i === 1) {
2800
- let lastSegment2 = potentials.findIndex((x) => !x.includes("_"));
2801
- lastSegment2 > 0 && potentials.splice(lastSegment2, 0, nextName);
2802
- }
2803
- if (componentName) {
2804
- let componentPotentials = [];
2805
- if (nextName) {
2806
- let beforeSeparator = prefix.slice(0, prefix.indexOf(import_constants22.THEME_NAME_SEPARATOR));
2807
- componentPotentials.push(`${beforeSeparator}_${nextName}_${componentName}`);
2808
- }
2809
- if (componentPotentials.push(`${prefix}_${componentName}`), nextName) {
2810
- let prefixLessOne = base.slice(0, i - 1).join(import_constants22.THEME_NAME_SEPARATOR);
2811
- if (prefixLessOne) {
2812
- let lessSpecific = `${prefixLessOne}_${nextName}_${componentName}`;
2813
- componentPotentials.unshift(lessSpecific);
2814
- }
2815
- let moreSpecific = `${prefix}_${nextName}_${componentName}`;
2816
- componentPotentials.unshift(moreSpecific);
2817
- }
2818
- potentials = [...componentPotentials, ...potentials, ...allComponentThemes];
2819
- }
2820
- let found = potentials.find((t) => t in themes);
2821
- if (process.env.NODE_ENV === "development" && typeof props.debug == "string" && console.log(" - ", { found, potentials, parentManager }), found) {
2822
- result = {
2823
- name: found,
2824
- theme: themes[found],
2825
- className: import_constants2.isWeb ? getNextThemeClassName(found) : "",
2826
- parentName,
2827
- componentName,
2828
- inverse: props.inverse
2829
- };
2830
- break;
1965
+ var cache = /* @__PURE__ */ new WeakMap();
1966
+ }
1967
+ });
1968
+
1969
+ // ../web/dist/cjs/helpers/createStyledContext.native.js
1970
+ var require_createStyledContext_native = __commonJS({
1971
+ "../web/dist/cjs/helpers/createStyledContext.native.js"(exports, module2) {
1972
+ "use strict";
1973
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
1974
+ for (var name in all)
1975
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
1976
+ }, __copyProps2 = (to, from, except, desc) => {
1977
+ if (from && typeof from == "object" || typeof from == "function")
1978
+ for (let key of __getOwnPropNames2(from))
1979
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1980
+ return to;
1981
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createStyledContext_exports = {};
1982
+ __export2(createStyledContext_exports, {
1983
+ createStyledContext: () => createStyledContext
1984
+ });
1985
+ module2.exports = __toCommonJS2(createStyledContext_exports);
1986
+ var import_react = require("react"), import_objectIdentityKey = require_objectIdentityKey_native(), import_jsx_runtime = require("react/jsx-runtime");
1987
+ function createStyledContext(defaultValues) {
1988
+ let OGContext = (0, import_react.createContext)(defaultValues), OGProvider = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map(), Provider = ({
1989
+ children,
1990
+ scope,
1991
+ ...values
1992
+ }) => {
1993
+ let value = (0, import_react.useMemo)(() => ({
1994
+ // this ! is a workaround for ts error
1995
+ ...defaultValues,
1996
+ ...values
1997
+ }), [(0, import_objectIdentityKey.objectIdentityKey)(values)]), Provider2 = OGProvider;
1998
+ if (scope) {
1999
+ let ScopedContext = scopedContexts.get(scope);
2000
+ ScopedContext || (ScopedContext = (0, import_react.createContext)(defaultValues), scopedContexts.set(scope, ScopedContext)), Provider2 = ScopedContext.Provider;
2831
2001
  }
2832
- }
2833
- return process.env.NODE_ENV === "development" && typeof props.debug == "string" && typeof window < "u" && (console.warn("ThemeManager.getState():", {
2834
- result
2835
- }), console.trace(), console.groupEnd()), result;
2836
- }
2837
- var inverseThemeName = (themeName) => themeName.startsWith("light") ? themeName.replace(/^light/, "dark") : themeName.replace(/^dark/, "light");
2838
- function getNonComponentParentManager(themeManager) {
2839
- var _a;
2840
- let res = themeManager, componentThemeNames = [];
2841
- for (; res && res != null && res.isComponent; )
2842
- componentThemeNames.push((_a = res == null ? void 0 : res.state) == null ? void 0 : _a.name), res = res.parentManager;
2843
- return [res || null, componentThemeNames];
2002
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Provider2, { value, children });
2003
+ }, useStyledContext = (scope) => {
2004
+ let context = scope ? scopedContexts.get(scope) : OGContext;
2005
+ return (0, import_react.useContext)(context);
2006
+ };
2007
+ return Context.Provider = Provider, Context.props = defaultValues, Context.context = OGContext, Context.useStyledContext = useStyledContext, Context;
2844
2008
  }
2845
2009
  }
2846
2010
  });
2847
2011
 
2848
- // ../web/dist/cjs/helpers/ThemeManagerContext.native.js
2849
- var require_ThemeManagerContext_native = __commonJS({
2850
- "../web/dist/cjs/helpers/ThemeManagerContext.native.js"(exports, module2) {
2012
+ // ../web/dist/cjs/contexts/ComponentContext.native.js
2013
+ var require_ComponentContext_native = __commonJS({
2014
+ "../web/dist/cjs/contexts/ComponentContext.native.js"(exports, module2) {
2851
2015
  "use strict";
2852
2016
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2853
2017
  for (var name in all)
@@ -2857,18 +2021,33 @@ var require_ThemeManagerContext_native = __commonJS({
2857
2021
  for (let key of __getOwnPropNames2(from))
2858
2022
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2859
2023
  return to;
2860
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ThemeManagerContext_exports = {};
2861
- __export2(ThemeManagerContext_exports, {
2862
- ThemeManagerContext: () => ThemeManagerContext
2024
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ComponentContext_exports = {};
2025
+ __export2(ComponentContext_exports, {
2026
+ ComponentContext: () => ComponentContext
2027
+ });
2028
+ module2.exports = __toCommonJS2(ComponentContext_exports);
2029
+ var import_createStyledContext = require_createStyledContext_native(), listeners = /* @__PURE__ */ new Set(), ComponentContext = (0, import_createStyledContext.createStyledContext)({
2030
+ inText: !1,
2031
+ language: null,
2032
+ animationDriver: null,
2033
+ groups: {
2034
+ emit: (name, state) => {
2035
+ listeners.forEach((l) => l(name, state));
2036
+ },
2037
+ subscribe(cb) {
2038
+ return listeners.add(cb), () => {
2039
+ listeners.delete(cb);
2040
+ };
2041
+ },
2042
+ state: {}
2043
+ }
2863
2044
  });
2864
- module2.exports = __toCommonJS2(ThemeManagerContext_exports);
2865
- var import_react = require("react"), ThemeManagerContext = (0, import_react.createContext)(null);
2866
2045
  }
2867
2046
  });
2868
2047
 
2869
- // ../web/dist/cjs/hooks/getThemeUnwrapped.native.js
2870
- var require_getThemeUnwrapped_native = __commonJS({
2871
- "../web/dist/cjs/hooks/getThemeUnwrapped.native.js"(exports, module2) {
2048
+ // ../web/dist/cjs/defaultComponentState.native.js
2049
+ var require_defaultComponentState_native = __commonJS({
2050
+ "../web/dist/cjs/defaultComponentState.native.js"(exports, module2) {
2872
2051
  "use strict";
2873
2052
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2874
2053
  for (var name in all)
@@ -2878,222 +2057,62 @@ var require_getThemeUnwrapped_native = __commonJS({
2878
2057
  for (let key of __getOwnPropNames2(from))
2879
2058
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2880
2059
  return to;
2881
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), getThemeUnwrapped_exports = {};
2882
- __export2(getThemeUnwrapped_exports, {
2883
- GetThemeUnwrapped: () => GetThemeUnwrapped,
2884
- getThemeUnwrapped: () => getThemeUnwrapped
2060
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), defaultComponentState_exports = {};
2061
+ __export2(defaultComponentState_exports, {
2062
+ defaultComponentState: () => defaultComponentState,
2063
+ defaultComponentStateMounted: () => defaultComponentStateMounted,
2064
+ defaultComponentStateShouldEnter: () => defaultComponentStateShouldEnter
2885
2065
  });
2886
- module2.exports = __toCommonJS2(getThemeUnwrapped_exports);
2887
- var getThemeUnwrapped = (theme) => (theme == null ? void 0 : theme[GetThemeUnwrapped]) || theme, GetThemeUnwrapped = Symbol();
2066
+ module2.exports = __toCommonJS2(defaultComponentState_exports);
2067
+ var defaultComponentState = {
2068
+ hover: !1,
2069
+ press: !1,
2070
+ pressIn: !1,
2071
+ focus: !1,
2072
+ unmounted: !0
2073
+ }, defaultComponentStateMounted = {
2074
+ ...defaultComponentState,
2075
+ unmounted: !1
2076
+ }, defaultComponentStateShouldEnter = {
2077
+ ...defaultComponentState,
2078
+ unmounted: "should-enter"
2079
+ };
2888
2080
  }
2889
2081
  });
2890
2082
 
2891
- // ../web/dist/cjs/hooks/useTheme.native.js
2892
- var require_useTheme_native = __commonJS({
2893
- "../web/dist/cjs/hooks/useTheme.native.js"(exports, module2) {
2083
+ // ../web/dist/cjs/helpers/createShallowSetState.native.js
2084
+ var require_createShallowSetState_native = __commonJS({
2085
+ "../web/dist/cjs/helpers/createShallowSetState.native.js"(exports, module2) {
2894
2086
  "use strict";
2895
2087
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2896
2088
  for (var name in all)
2897
- __defProp2(target, name, { get: all[name], enumerable: !0 });
2898
- }, __copyProps2 = (to, from, except, desc) => {
2899
- if (from && typeof from == "object" || typeof from == "function")
2900
- for (let key of __getOwnPropNames2(from))
2901
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2902
- return to;
2903
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), useTheme_exports = {};
2904
- __export2(useTheme_exports, {
2905
- activeThemeManagers: () => activeThemeManagers,
2906
- getThemeProxied: () => getThemeProxied,
2907
- useChangeThemeEffect: () => useChangeThemeEffect,
2908
- useTheme: () => useTheme,
2909
- useThemeWithState: () => useThemeWithState
2910
- });
2911
- module2.exports = __toCommonJS2(useTheme_exports);
2912
- var import_constants2 = require_index_native2(), import_react = require("react"), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_createProxy = require_createProxy_native(), import_ThemeManager = require_ThemeManager_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), import_getThemeUnwrapped = require_getThemeUnwrapped_native(), emptyProps = { name: null }, cached;
2913
- function getDefaultThemeProxied() {
2914
- if (cached)
2915
- return cached;
2916
- let config = (0, import_config.getConfig)(), defaultTheme = config.themes.light ?? config.themes[Object.keys(config.themes)[0]];
2917
- return cached = getThemeProxied(defaultTheme), cached;
2918
- }
2919
- var useTheme = (props = emptyProps) => {
2920
- let [_, theme] = useThemeWithState(props);
2921
- return theme || getDefaultThemeProxied();
2922
- }, useThemeWithState = (props) => {
2923
- let keys = (0, import_react.useRef)([]), changedThemeState = useChangeThemeEffect(
2924
- props,
2925
- !1,
2926
- keys.current,
2927
- import_constants2.isServer ? void 0 : () => {
2928
- var _a, _b;
2929
- let next = ((_a = props.shouldUpdate) == null ? void 0 : _a.call(props)) ?? (keys.current.length > 0 ? !0 : void 0);
2930
- return process.env.NODE_ENV === "development" && props.debug && props.debug !== "profile" && console.log(" \u{1F3A8} useTheme() shouldUpdate?", next, {
2931
- shouldUpdateProp: (_b = props.shouldUpdate) == null ? void 0 : _b.call(props),
2932
- keys: [...keys.current]
2933
- }), next;
2934
- }
2935
- ), { themeManager, state } = changedThemeState, { theme, name, className } = state;
2936
- if (!theme)
2937
- throw process.env.NODE_ENV === "development" ? new Error(
2938
- `No theme found given props ${JSON.stringify(
2939
- props
2940
- )}. Themes given to tamagui are: ${Object.keys((0, import_config.getConfig)().themes)}`
2941
- ) : "\u274C 1";
2942
- let themeProxied = (0, import_react.useMemo)(() => getThemeProxied(theme, themeManager, keys.current, props.debug), [theme, name, className, themeManager]);
2943
- return process.env.NODE_ENV === "development" && props.debug === "verbose" && (console.groupCollapsed(" \u{1F539} useTheme =>", name), console.log("returning state", changedThemeState, "from props", props), console.groupEnd()), [changedThemeState, themeProxied];
2944
- };
2945
- function getThemeProxied(theme, themeManager, keys, debug) {
2946
- return (0, import_createProxy.createProxy)(theme, {
2947
- has(_, key) {
2948
- if (Reflect.has(theme, key))
2949
- return !0;
2950
- if (typeof key == "string")
2951
- return key[0] === "$" && (key = key.slice(1)), themeManager == null ? void 0 : themeManager.allKeys.has(key);
2952
- },
2953
- get(_, key) {
2954
- if (key === import_getThemeUnwrapped.GetThemeUnwrapped)
2955
- return theme;
2956
- if (
2957
- // dont ask me, idk why but on hermes you can see that useTheme()[undefined] passes in STRING undefined to proxy
2958
- // if someone is crazy enough to use "undefined" as a theme key then this not working is on them
2959
- key !== "undefined" && typeof key == "string"
2960
- ) {
2961
- let keyString = key[0] === "$" ? key.slice(1) : key, val = theme[keyString];
2962
- if (val && typeof val == "object")
2963
- return new Proxy(val, {
2964
- // when they touch the actual value we only track it
2965
- // if its a variable (web), its ignored!
2966
- get(_2, subkey) {
2967
- return keys && (subkey === "val" || subkey === "get" && !import_constants2.isWeb) && !keys.includes(keyString) && (keys.push(keyString), process.env.NODE_ENV === "development" && debug && console.log(` \u{1F3A8} useTheme() tracking new key: ${keyString}`)), subkey === "get" ? () => (0, import_createVariable.getVariable)(val) : Reflect.get(val, subkey);
2968
- }
2969
- });
2970
- }
2971
- return Reflect.get(_, key);
2972
- }
2973
- });
2974
- }
2975
- var activeThemeManagers = /* @__PURE__ */ new Set(), useChangeThemeEffect = (props, root = !1, keys, shouldUpdate) => {
2976
- let {
2977
- // @ts-expect-error internal use only
2978
- disable
2979
- } = props, parentManager = (0, import_react.useContext)(import_ThemeManagerContext.ThemeManagerContext);
2980
- if (disable) {
2981
- if (!parentManager)
2982
- throw "\u274C 2";
2983
- return {
2984
- isNewTheme: !1,
2985
- state: parentManager.state,
2986
- themeManager: parentManager
2987
- };
2988
- }
2989
- let [themeState, setThemeState] = (0, import_react.useState)(createState), { state, mounted, isNewTheme, themeManager } = themeState, isInversingOnMount = !!(!themeState.mounted && props.inverse);
2990
- function getShouldUpdateTheme(manager = themeManager, nextState, prevState = state, forceShouldChange = !1) {
2991
- let forceUpdate = shouldUpdate == null ? void 0 : shouldUpdate();
2992
- if (!forceShouldChange && forceUpdate === !1)
2993
- return;
2994
- let next = nextState || manager.getState(props, parentManager);
2995
- if (forceShouldChange || next && !(forceUpdate !== !0 && !manager.getStateShouldChange(next, prevState)))
2996
- return next;
2997
- }
2998
- if (import_constants2.isServer || ((0, import_react.useLayoutEffect)(() => {
2999
- if (props.inverse && !mounted) {
3000
- setThemeState({ ...themeState, mounted: !0 });
3001
- return;
3002
- }
3003
- isNewTheme && themeManager && activeThemeManagers.add(themeManager), (isNewTheme || getShouldUpdateTheme(themeManager)) && setThemeState(createState);
3004
- let selfListenerDispose = themeManager.onChangeTheme((_a, _b, forced) => {
3005
- forced && setThemeState((prev) => createState(prev, !0));
3006
- }), disposeChangeListener = parentManager == null ? void 0 : parentManager.onChangeTheme((name, manager) => {
3007
- let force = shouldUpdate == null ? void 0 : shouldUpdate(), doUpdate = force ?? !!(keys != null && keys.length || isNewTheme);
3008
- process.env.NODE_ENV === "development" && props.debug && console.log(" \u{1F538} onChange", themeManager.id, {
3009
- force,
3010
- doUpdate,
3011
- props,
3012
- name,
3013
- manager,
3014
- keys
3015
- }), doUpdate && setThemeState(createState);
3016
- }, themeManager.id);
3017
- return () => {
3018
- selfListenerDispose(), disposeChangeListener == null || disposeChangeListener(), activeThemeManagers.delete(themeManager);
3019
- };
3020
- }, [
3021
- themeManager,
3022
- parentManager,
3023
- isNewTheme,
3024
- props.componentName,
3025
- props.inverse,
3026
- props.name,
3027
- props.reset,
3028
- mounted
3029
- ]), process.env.NODE_ENV === "development" && props.debug !== "profile" && (0, import_react.useEffect)(() => (globalThis.TamaguiThemeManagers ??= /* @__PURE__ */ new Set(), globalThis.TamaguiThemeManagers.add(themeManager), () => {
3030
- globalThis.TamaguiThemeManagers.delete(themeManager);
3031
- }), [themeManager])), isInversingOnMount) {
3032
- if (!parentManager)
3033
- throw "\u274C 3";
3034
- return {
3035
- isNewTheme: !1,
3036
- themeManager: parentManager,
3037
- state: {
3038
- ...parentManager.state,
3039
- className: ""
3040
- }
3041
- };
3042
- }
3043
- return {
3044
- state,
3045
- isNewTheme,
3046
- themeManager
3047
- };
3048
- function createState(prev, force = !1) {
3049
- if (prev && (shouldUpdate == null ? void 0 : shouldUpdate()) === !1)
3050
- return prev;
3051
- let themeManager2 = parentManager, state2;
3052
- if ((0, import_ThemeManager.getHasThemeUpdatingProps)(props)) {
3053
- let getNewThemeManager = () => new import_ThemeManager.ThemeManager(props, root ? "root" : parentManager);
3054
- if (prev != null && prev.themeManager) {
3055
- themeManager2 = prev.themeManager;
3056
- let forceChange = !!(keys != null && keys.length), next = themeManager2.getState(props, parentManager), nextState = getShouldUpdateTheme(
3057
- themeManager2,
3058
- next,
3059
- prev.state,
3060
- forceChange
3061
- );
3062
- nextState ? (state2 = nextState, !prev.isNewTheme || !import_constants2.isWeb ? themeManager2 = getNewThemeManager() : themeManager2.updateState(nextState)) : prev.isNewTheme && parentManager && !next && (themeManager2 = parentManager);
3063
- } else
3064
- themeManager2 = getNewThemeManager(), state2 = { ...themeManager2.state };
3065
- }
3066
- let isNewTheme2 = !!(themeManager2 !== parentManager || props.inverse), mounted2 = props.inverse ? root || (prev == null ? void 0 : prev.mounted) : !0;
3067
- if (state2 || (isNewTheme2 ? state2 = themeManager2.state : (state2 = parentManager.state, themeManager2 = parentManager)), !force && state2.name === (prev == null ? void 0 : prev.state.name))
3068
- return prev;
3069
- let response = {
3070
- state: state2,
3071
- themeManager: themeManager2,
3072
- isNewTheme: isNewTheme2,
3073
- mounted: mounted2
3074
- };
3075
- if (process.env.NODE_ENV === "development" && props.debug && import_constants2.isClient) {
3076
- console.groupCollapsed(` \u{1F537} ${themeManager2.id} useChangeThemeEffect createState`);
3077
- let parentState = { ...parentManager == null ? void 0 : parentManager.state }, parentId = parentManager == null ? void 0 : parentManager.id, themeManagerState = { ...themeManager2.state };
3078
- console.log({
3079
- props,
3080
- parentState,
3081
- parentId,
3082
- themeManager: themeManager2,
3083
- prev,
3084
- response,
3085
- themeManagerState
3086
- }), console.groupEnd();
3087
- }
3088
- return response;
3089
- }
3090
- };
2089
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
2090
+ }, __copyProps2 = (to, from, except, desc) => {
2091
+ if (from && typeof from == "object" || typeof from == "function")
2092
+ for (let key of __getOwnPropNames2(from))
2093
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2094
+ return to;
2095
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createShallowSetState_exports = {};
2096
+ __export2(createShallowSetState_exports, {
2097
+ createShallowSetState: () => createShallowSetState,
2098
+ mergeIfNotShallowEqual: () => mergeIfNotShallowEqual
2099
+ });
2100
+ module2.exports = __toCommonJS2(createShallowSetState_exports);
2101
+ function createShallowSetState(setter) {
2102
+ return (next) => setter((prev) => mergeIfNotShallowEqual(prev, next));
2103
+ }
2104
+ function mergeIfNotShallowEqual(prev, next) {
2105
+ for (let key in next)
2106
+ if (prev[key] !== next[key])
2107
+ return { ...prev, ...next };
2108
+ return prev;
2109
+ }
3091
2110
  }
3092
2111
  });
3093
2112
 
3094
- // ../web/dist/cjs/hooks/useMedia.native.js
3095
- var require_useMedia_native = __commonJS({
3096
- "../web/dist/cjs/hooks/useMedia.native.js"(exports, module2) {
2113
+ // ../web/dist/cjs/constants/accessibilityDirectMap.native.js
2114
+ var require_accessibilityDirectMap_native = __commonJS({
2115
+ "../web/dist/cjs/constants/accessibilityDirectMap.native.js"(exports, module2) {
3097
2116
  "use strict";
3098
2117
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
3099
2118
  for (var name in all)
@@ -3103,187 +2122,127 @@ var require_useMedia_native = __commonJS({
3103
2122
  for (let key of __getOwnPropNames2(from))
3104
2123
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
3105
2124
  return to;
3106
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), useMedia_exports = {};
3107
- __export2(useMedia_exports, {
3108
- configureMedia: () => configureMedia2,
3109
- getInitialMediaState: () => getInitialMediaState,
3110
- getMedia: () => getMedia2,
3111
- getMediaImportanceIfMoreImportant: () => getMediaImportanceIfMoreImportant,
3112
- getMediaKeyImportance: () => getMediaKeyImportance,
3113
- isMediaKey: () => isMediaKey,
3114
- mediaKeyMatch: () => mediaKeyMatch,
3115
- mediaKeyToQuery: () => mediaKeyToQuery,
3116
- mediaKeys: () => mediaKeys,
3117
- mediaObjectToString: () => mediaObjectToString2,
3118
- mediaQueryConfig: () => mediaQueryConfig2,
3119
- mediaState: () => mediaState2,
3120
- mergeMediaByImportance: () => mergeMediaByImportance,
3121
- setMediaShouldUpdate: () => setMediaShouldUpdate,
3122
- setupMediaListeners: () => setupMediaListeners,
3123
- useMedia: () => useMedia2,
3124
- useMediaListeners: () => useMediaListeners,
3125
- useMediaPropsActive: () => useMediaPropsActive2
2125
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), accessibilityDirectMap_native_exports = {};
2126
+ __export2(accessibilityDirectMap_native_exports, {
2127
+ accessibilityDirectMap: () => accessibilityDirectMap2,
2128
+ accessibilityWebRoleToNativeRole: () => accessibilityWebRoleToNativeRole,
2129
+ nativeAccessibilityState: () => nativeAccessibilityState,
2130
+ nativeAccessibilityValue: () => nativeAccessibilityValue,
2131
+ webToNativeAccessibilityDirectMap: () => webToNativeAccessibilityDirectMap
3126
2132
  });
3127
- module2.exports = __toCommonJS2(useMedia_exports);
3128
- var import_constants2 = require_index_native2(), import_react = require("react"), import_config = require_config_native(), import_createProxy = require_createProxy_native(), import_matchMedia = require_matchMedia_native(), import_propMapper = require_propMapper_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), import_useTheme = require_useTheme_native(), mediaState2 = (
3129
- // development only safeguard
3130
- process.env.NODE_ENV === "development" ? (0, import_createProxy.createProxy)(
3131
- {},
3132
- {
3133
- get(target, key) {
3134
- if (typeof key == "string" && key[0] === "$" && // dont error on $$typeof
3135
- key[1] !== "$")
3136
- throw new Error(`Access mediaState should not use "$": ${key}`);
3137
- return Reflect.get(target, key);
3138
- }
3139
- }
3140
- ) : {}
3141
- ), mediaQueryConfig2 = {}, getMedia2 = () => mediaState2, mediaKeys = /* @__PURE__ */ new Set(), isMediaKey = (key) => mediaKeys.has(key) || key[0] === "$" && (key.startsWith("$platform-") || key.startsWith("$theme-") || key.startsWith("$group-")), initState, getInitialMediaState = () => ((0, import_config.getConfig)().disableSSR ? mediaState2 : initState) || {}, defaultMediaImportance = Object.keys(import_pseudoDescriptors.pseudoDescriptors).length, mediaKeysOrdered, getMediaKeyImportance = (key) => {
3142
- if (process.env.NODE_ENV === "development" && key[0] === "$")
3143
- throw new Error("use short key");
3144
- return (0, import_config.getConfig)().settings.mediaPropOrder ? defaultMediaImportance : mediaKeysOrdered.indexOf(key) + 100;
3145
- }, dispose = /* @__PURE__ */ new Set(), mediaVersion = 0, configureMedia2 = (config) => {
3146
- let { media, mediaQueryDefaultActive } = config;
3147
- if (media) {
3148
- mediaVersion++;
3149
- for (let key in media)
3150
- mediaState2[key] = (mediaQueryDefaultActive == null ? void 0 : mediaQueryDefaultActive[key]) || !1, mediaKeys.add(`$${key}`);
3151
- Object.assign(mediaQueryConfig2, media), initState = { ...mediaState2 }, mediaKeysOrdered = Object.keys(media), config.disableSSR ? setupMediaListeners() : updateCurrentState();
3152
- }
2133
+ module2.exports = __toCommonJS2(accessibilityDirectMap_native_exports);
2134
+ var accessibilityDirectMap2 = {}, webToNativeAccessibilityDirectMap = {
2135
+ "aria-label": "accessibilityLabel",
2136
+ "aria-labelledby": "accessibilityLabelledBy",
2137
+ "aria-live": "accessibilityLiveRegion",
2138
+ "aria-modal": "accessibilityViewIsModal",
2139
+ "aria-hidden": "accessibilityElementsHidden"
2140
+ }, nativeAccessibilityValue = {
2141
+ "aria-valuemin": "min",
2142
+ "aria-valuemax": "max",
2143
+ "aria-valuenow": "now",
2144
+ "aria-valuetext": "text"
2145
+ }, nativeAccessibilityState = {
2146
+ "aria-disabled": "disabled",
2147
+ "aria-selected": "selected",
2148
+ "aria-checked": "checked",
2149
+ "aria-busy": "busy",
2150
+ "aria-expanded": "expanded"
2151
+ }, accessibilityWebRoleToNativeRole = {
2152
+ alert: "alert",
2153
+ button: "button",
2154
+ checkbox: "checkbox",
2155
+ combobox: "combobox",
2156
+ grid: "grid",
2157
+ group: "none",
2158
+ heading: "header",
2159
+ imagebutton: "imagebutton",
2160
+ img: "image",
2161
+ keyboardkey: "keyboardkey",
2162
+ link: "link",
2163
+ menu: "menu",
2164
+ menubar: "menubar",
2165
+ menuitem: "menuitem",
2166
+ none: "none",
2167
+ presentation: "none",
2168
+ progressbar: "progressbar",
2169
+ radio: "radio",
2170
+ radiogroup: "radiogroup",
2171
+ region: "summary",
2172
+ scrollbar: "scrollbar",
2173
+ searchbox: "search",
2174
+ slider: "adjustable",
2175
+ spinbutton: "spinbutton",
2176
+ summary: "summary",
2177
+ switch: "switch",
2178
+ tab: "tab",
2179
+ tablist: "tablist",
2180
+ text: "text",
2181
+ timer: "timer",
2182
+ togglebutton: "togglebutton",
2183
+ toolbar: "toolbar"
3153
2184
  };
3154
- function unlisten() {
3155
- dispose.forEach((cb) => cb()), dispose.clear();
3156
- }
3157
- var setupVersion = -1;
3158
- function setupMediaListeners() {
3159
- if (setupVersion !== mediaVersion) {
3160
- setupVersion = mediaVersion, unlisten();
3161
- for (let key in mediaQueryConfig2) {
3162
- let update2 = function() {
3163
- let next = !!getMatch().matches;
3164
- next !== mediaState2[key] && (mediaState2 = { ...mediaState2, [key]: next }, updateCurrentState());
3165
- };
3166
- var update = update2;
3167
- let str = mediaObjectToString2(mediaQueryConfig2[key], key), getMatch = () => (0, import_matchMedia.matchMedia)(str), match = getMatch();
3168
- if (!match)
3169
- throw new Error("\u26A0\uFE0F No match");
3170
- match.addListener(update2), dispose.add(() => {
3171
- match.removeListener(update2);
3172
- }), update2();
3173
- }
3174
- }
3175
- }
3176
- function useMediaListeners(config) {
3177
- config.disableSSR || (0, import_constants2.useIsomorphicLayoutEffect)(() => {
3178
- setupMediaListeners();
3179
- }, []);
3180
- }
3181
- var listeners = /* @__PURE__ */ new Set(), flushing = !1, flushVersion = -1;
3182
- function updateCurrentState() {
3183
- flushing && flushVersion === mediaVersion || (flushVersion = mediaVersion, flushing = !0, Promise.resolve().then(() => {
3184
- flushing = !1, listeners.forEach((cb) => cb(mediaState2));
3185
- }));
3186
- }
3187
- var shouldUpdate = /* @__PURE__ */ new WeakMap();
3188
- function setMediaShouldUpdate(ref, props) {
3189
- return shouldUpdate.set(ref, props);
3190
- }
3191
- function subscribe(subscriber) {
3192
- return listeners.add(subscriber), () => listeners.delete(subscriber);
3193
- }
3194
- function useMedia2(uid) {
3195
- let internal = (0, import_react.useRef)(), state = (0, import_react.useSyncExternalStore)(
3196
- subscribe,
3197
- () => {
3198
- if (!internal.current)
3199
- return initState;
3200
- let { touched, prev } = internal.current, componentState = uid ? shouldUpdate.get(uid) : void 0;
3201
- if (componentState && componentState.enabled === !1)
3202
- return prev;
3203
- let testKeys = (componentState == null ? void 0 : componentState.keys) ?? ((!componentState || componentState.enabled) && touched ? [...touched] : null);
3204
- return !testKeys || testKeys != null && testKeys.every((key) => mediaState2[key] === prev[key]) ? prev : (internal.current.prev = mediaState2, mediaState2);
3205
- },
3206
- () => initState
3207
- );
3208
- return new Proxy(state, {
3209
- get(_, key) {
3210
- return typeof key == "string" && (internal.current ||= { prev: initState }, internal.current.touched ||= /* @__PURE__ */ new Set(), internal.current.touched.add(key)), Reflect.get(state, key);
3211
- }
3212
- });
3213
- }
3214
- function useMediaPropsActive2(props, opts) {
3215
- 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;
3216
- return (0, import_react.useMemo)(() => {
3217
- let config = (0, import_config.getConfig)(), next = {}, importancesUsed = {}, propNames = Object.keys(props), len = propNames.length;
3218
- for (let i = 0; i < len; i++) {
3219
- let key = propNames[i], val = props[key];
3220
- if (key[0] === "$") {
3221
- let mediaKey = key.slice(1);
3222
- if (!media[mediaKey])
3223
- continue;
3224
- if (val && typeof val == "object") {
3225
- let subKeys = Object.keys(val);
3226
- for (let j = subKeys.length; j--; j >= 0) {
3227
- let subKey = subKeys[j], value = (0, import_propMapper.getTokenForKey)(subKey, val[subKey], resolveAs, styleState);
3228
- shouldExpandShorthands && (subKey = config.shorthands[subKey] || subKey), mergeMediaByImportance(next, mediaKey, subKey, value, importancesUsed, !0);
3229
- }
3230
- }
3231
- } else
3232
- shouldExpandShorthands && (key = config.shorthands[key] || key), mergeMediaByImportance(
3233
- next,
3234
- "",
3235
- key,
3236
- (0, import_propMapper.getTokenForKey)(key, val, resolveAs, styleState),
3237
- importancesUsed,
3238
- !0
3239
- );
2185
+ }
2186
+ });
2187
+
2188
+ // ../web/dist/cjs/constants/isDevTools.native.js
2189
+ var require_isDevTools_native = __commonJS({
2190
+ "../web/dist/cjs/constants/isDevTools.native.js"(exports, module2) {
2191
+ "use strict";
2192
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2193
+ for (var name in all)
2194
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
2195
+ }, __copyProps2 = (to, from, except, desc) => {
2196
+ if (from && typeof from == "object" || typeof from == "function")
2197
+ for (let key of __getOwnPropNames2(from))
2198
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2199
+ return to;
2200
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), isDevTools_exports = {};
2201
+ __export2(isDevTools_exports, {
2202
+ isDevTools: () => isDevTools
2203
+ });
2204
+ module2.exports = __toCommonJS2(isDevTools_exports);
2205
+ var isDevTools = (() => {
2206
+ if (process.env.NODE_ENV === "development")
2207
+ try {
2208
+ return new Function("try {return this===window;}catch(e){ return false;}")();
2209
+ } catch {
3240
2210
  }
3241
- return next;
3242
- }, [media, props, theme, resolveAs]);
3243
- }
3244
- var getMediaImportanceIfMoreImportant = (mediaKey, key, importancesUsed, isSizeMedia) => {
3245
- let conf = (0, import_config.getConfig)(), importance = isSizeMedia && !conf.settings.mediaPropOrder ? getMediaKeyImportance(mediaKey) : defaultMediaImportance;
3246
- return !importancesUsed[key] || importance > importancesUsed[key] ? importance : null;
3247
- };
3248
- function mergeMediaByImportance(onto, mediaKey, key, value, importancesUsed, isSizeMedia, importanceBump) {
3249
- let importance = getMediaImportanceIfMoreImportant(
3250
- mediaKey,
3251
- key,
3252
- importancesUsed,
3253
- isSizeMedia
3254
- );
3255
- return importanceBump && (importance = (importance || 0) + importanceBump), importance === null ? !1 : (importancesUsed[key] = importance, onto[key] = value, !0);
3256
- }
3257
- function camelToHyphen(str) {
3258
- return str.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`).toLowerCase();
3259
- }
3260
- var cache = /* @__PURE__ */ new WeakMap(), cachedMediaKeyToQuery = {};
3261
- function mediaObjectToString2(query, key) {
3262
- if (typeof query == "string")
3263
- return query;
3264
- if (cache.has(query))
3265
- return cache.get(query);
3266
- let res = Object.entries(query).map(([feature, value]) => (feature = camelToHyphen(feature), typeof value == "string" ? `(${feature}: ${value})` : (typeof value == "number" && /[height|width]$/.test(feature) && (value = `${value}px`), `(${feature}: ${value})`))).join(" and ");
3267
- return key && (cachedMediaKeyToQuery[key] = res), cache.set(query, res), res;
3268
- }
3269
- function mediaKeyToQuery(key) {
3270
- return cachedMediaKeyToQuery[key] || mediaObjectToString2(mediaQueryConfig2[key], key);
3271
- }
3272
- function mediaKeyMatch(key, dimensions) {
3273
- let mediaQueries = mediaQueryConfig2[key];
3274
- return Object.keys(mediaQueries).every((query) => {
3275
- let expectedVal = +mediaQueries[query], isMax = query.startsWith("max"), isWidth = query.endsWith("Width"), givenVal = dimensions[isWidth ? "width" : "height"];
3276
- return isMax ? givenVal < expectedVal : givenVal > expectedVal;
3277
- });
2211
+ return !1;
2212
+ })();
2213
+ }
2214
+ });
2215
+
2216
+ // ../web/dist/cjs/helpers/getGroupPropParts.native.js
2217
+ var require_getGroupPropParts_native = __commonJS({
2218
+ "../web/dist/cjs/helpers/getGroupPropParts.native.js"(exports, module2) {
2219
+ "use strict";
2220
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2221
+ for (var name in all)
2222
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
2223
+ }, __copyProps2 = (to, from, except, desc) => {
2224
+ if (from && typeof from == "object" || typeof from == "function")
2225
+ for (let key of __getOwnPropNames2(from))
2226
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2227
+ return to;
2228
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), getGroupPropParts_exports = {};
2229
+ __export2(getGroupPropParts_exports, {
2230
+ getGroupPropParts: () => getGroupPropParts
2231
+ });
2232
+ module2.exports = __toCommonJS2(getGroupPropParts_exports);
2233
+ var import_useMedia = require_useMedia_native();
2234
+ function getGroupPropParts(groupProp) {
2235
+ let mediaQueries = (0, import_useMedia.getMedia)(), [_, name, part3, part4] = groupProp.split("-"), pseudo, media = part3 in mediaQueries ? part3 : void 0;
2236
+ return media ? pseudo = part4 : pseudo = part3, { name, pseudo, media };
3278
2237
  }
3279
2238
  }
3280
2239
  });
3281
2240
 
3282
- // ../web/dist/cjs/Tamagui.native.js
3283
- var require_Tamagui_native = __commonJS({
3284
- "../web/dist/cjs/Tamagui.native.js"(exports, module2) {
2241
+ // ../web/dist/cjs/helpers/createMediaStyle.native.js
2242
+ var require_createMediaStyle_native = __commonJS({
2243
+ "../web/dist/cjs/helpers/createMediaStyle.native.js"(exports, module2) {
3285
2244
  "use strict";
3286
- var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2245
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
3287
2246
  for (var name in all)
3288
2247
  __defProp2(target, name, { get: all[name], enumerable: !0 });
3289
2248
  }, __copyProps2 = (to, from, except, desc) => {
@@ -3291,51 +2250,558 @@ var require_Tamagui_native = __commonJS({
3291
2250
  for (let key of __getOwnPropNames2(from))
3292
2251
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
3293
2252
  return to;
3294
- }, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
3295
- // If the importer is in node compatibility mode or this is not an ESM
3296
- // file that has been converted to a CommonJS file using a Babel-
3297
- // compatible transform (i.e. "__esModule" has not been set), then set
3298
- // "default" to the CommonJS "module.exports" for node compatibility.
3299
- isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: !0 }) : target,
3300
- mod
3301
- )), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), Tamagui_exports = {};
3302
- __export2(Tamagui_exports, {
3303
- Tamagui: () => Tamagui,
3304
- getValueFromIdentifier: () => getValueFromIdentifier,
3305
- setIdentifierValue: () => setIdentifierValue
2253
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createMediaStyle_exports = {};
2254
+ __export2(createMediaStyle_exports, {
2255
+ MEDIA_SEP: () => MEDIA_SEP,
2256
+ createMediaStyle: () => createMediaStyle
3306
2257
  });
3307
- module2.exports = __toCommonJS2(Tamagui_exports);
3308
- var Helpers = __toESM2(require_index_native4()), import_config = require_config_native(), import_insertStyleRule = require_insertStyleRule_native(), import_useMedia = require_useMedia_native(), TamaguiManager = class {
3309
- constructor() {
3310
- this.Helpers = Helpers;
3311
- }
3312
- get mediaState() {
3313
- return { ...import_useMedia.mediaState };
3314
- }
3315
- get config() {
3316
- return (0, import_config.getConfig)();
2258
+ module2.exports = __toCommonJS2(createMediaStyle_exports);
2259
+ var import_config = require_config_native(), import_useMedia = require_useMedia_native(), import_getGroupPropParts = require_getGroupPropParts_native(), MEDIA_SEP = "_", prefixes = null, selectors = null, groupPseudoToPseudoCSSMap = {
2260
+ press: "active"
2261
+ }, createMediaStyle = (styleObject, mediaKeyIn, mediaQueries, negate, priority) => {
2262
+ let { property, identifier, rules } = styleObject, conf = (0, import_config.getConfig)(), enableMediaPropOrder = conf.settings.mediaPropOrder, isThemeMedia = mediaKeyIn.startsWith("theme-"), isPlatformMedia = !isThemeMedia && mediaKeyIn.startsWith("platform-"), isGroup = !isThemeMedia && !isPlatformMedia && mediaKeyIn.startsWith("group-"), isNonWindowMedia = isThemeMedia || isPlatformMedia || isGroup, negKey = negate ? "0" : "", ogPrefix = identifier.slice(0, identifier.indexOf("-") + 1), id = `${ogPrefix}${MEDIA_SEP}${mediaKeyIn.replace("-", "")}${negKey}${MEDIA_SEP}`, styleRule = "", groupMediaKey, containerName, nextIdentifier = identifier.replace(ogPrefix, id), styleInner = rules.map((rule) => rule.replace(identifier, nextIdentifier)).join(";");
2263
+ if (isNonWindowMedia) {
2264
+ let precedenceImportancePrefix = new Array((priority || 0) + (isGroup ? 1 : 0)).fill(":root").join("");
2265
+ if (isThemeMedia || isGroup) {
2266
+ let groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyIn), mediaName = groupInfo == null ? void 0 : groupInfo.name;
2267
+ groupMediaKey = groupInfo == null ? void 0 : groupInfo.media, isGroup && (containerName = mediaName);
2268
+ 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(
2269
+ ":root",
2270
+ ""
2271
+ )}`;
2272
+ styleRule = styleInner.replace(selector, nextSelector);
2273
+ } else
2274
+ styleRule = `${precedenceImportancePrefix}${styleInner}`;
3317
2275
  }
3318
- get insertedRules() {
3319
- return (0, import_insertStyleRule.getAllRules)();
2276
+ if (!isNonWindowMedia || groupMediaKey) {
2277
+ if (!selectors) {
2278
+ let mediaKeys = Object.keys(mediaQueries);
2279
+ selectors = Object.fromEntries(
2280
+ mediaKeys.map((key) => [key, (0, import_useMedia.mediaObjectToString)(mediaQueries[key])])
2281
+ ), enableMediaPropOrder || (prefixes = Object.fromEntries(
2282
+ mediaKeys.map((k, index) => [k, new Array(index + 1).fill(":root").join("")])
2283
+ ));
2284
+ }
2285
+ let mediaKey = groupMediaKey || mediaKeyIn, mediaSelector = selectors[mediaKey], mediaQuery = `${negate ? "not all and" : ""} ${mediaSelector}`, precedenceImportancePrefix = groupMediaKey ? "" : enableMediaPropOrder ? (
2286
+ // this new array should be cached
2287
+ new Array(priority).fill(":root").join("")
2288
+ ) : (
2289
+ // @ts-ignore
2290
+ prefixes[mediaKey]
2291
+ ), prefix = groupMediaKey ? `@container ${containerName}` : "@media";
2292
+ groupMediaKey && (styleInner = styleRule), styleInner.includes(prefix) ? styleRule = styleInner.replace("{", ` and ${mediaQuery} {`) : styleRule = `${prefix} ${mediaQuery}{${precedenceImportancePrefix}${styleInner}}`;
3320
2293
  }
3321
- get allSelectors() {
3322
- return (0, import_insertStyleRule.getAllSelectors)();
2294
+ return {
2295
+ property,
2296
+ rules: [styleRule],
2297
+ identifier: nextIdentifier
2298
+ };
2299
+ };
2300
+ }
2301
+ });
2302
+
2303
+ // ../web/dist/cjs/helpers/expandStyle.native.js
2304
+ var require_expandStyle_native = __commonJS({
2305
+ "../web/dist/cjs/helpers/expandStyle.native.js"(exports, module2) {
2306
+ "use strict";
2307
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all2) => {
2308
+ for (var name in all2)
2309
+ __defProp2(target, name, { get: all2[name], enumerable: !0 });
2310
+ }, __copyProps2 = (to, from, except, desc) => {
2311
+ if (from && typeof from == "object" || typeof from == "function")
2312
+ for (let key of __getOwnPropNames2(from))
2313
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2314
+ return to;
2315
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), expandStyle_exports = {};
2316
+ __export2(expandStyle_exports, {
2317
+ expandStyle: () => expandStyle
2318
+ });
2319
+ module2.exports = __toCommonJS2(expandStyle_exports);
2320
+ var import_constants2 = require_index_native2();
2321
+ function expandStyle(key, value) {
2322
+ if (!1)
2323
+ switch (key) {
2324
+ case "textAlignVertical":
2325
+ case "writingDirection":
2326
+ }
2327
+ if (import_constants2.isAndroid && key === "elevationAndroid")
2328
+ return [["elevation", value]];
2329
+ if (key in EXPANSIONS)
2330
+ return EXPANSIONS[key].map((key2) => [key2, value]);
2331
+ }
2332
+ var all = ["Top", "Right", "Bottom", "Left"], horiz = ["Right", "Left"], vert = ["Top", "Bottom"], xy = ["X", "Y"], EXPANSIONS = {
2333
+ borderColor: ["TopColor", "RightColor", "BottomColor", "LeftColor"],
2334
+ borderRadius: [
2335
+ "TopLeftRadius",
2336
+ "TopRightRadius",
2337
+ "BottomRightRadius",
2338
+ "BottomLeftRadius"
2339
+ ],
2340
+ borderWidth: ["TopWidth", "RightWidth", "BottomWidth", "LeftWidth"],
2341
+ margin: all,
2342
+ marginHorizontal: horiz,
2343
+ marginVertical: vert,
2344
+ overscrollBehavior: xy,
2345
+ padding: all,
2346
+ paddingHorizontal: horiz,
2347
+ paddingVertical: vert,
2348
+ ...import_constants2.isWeb && {
2349
+ // react-native only supports borderStyle
2350
+ borderStyle: ["TopStyle", "RightStyle", "BottomStyle", "LeftStyle"],
2351
+ // react-native doesn't support X / Y
2352
+ overflow: xy
3323
2353
  }
3324
- get allTransforms() {
3325
- return (0, import_insertStyleRule.getAllTransforms)();
2354
+ }, _a;
2355
+ for (let parent in EXPANSIONS) {
2356
+ let prefix = parent.slice(0, ((_a = /[A-Z]/.exec(parent)) == null ? void 0 : _a.index) ?? parent.length);
2357
+ EXPANSIONS[parent] = EXPANSIONS[parent].map((k) => `${prefix}${k}`);
2358
+ }
2359
+ }
2360
+ });
2361
+
2362
+ // ../../node_modules/@react-native/normalize-color/index.js
2363
+ var require_normalize_color = __commonJS({
2364
+ "../../node_modules/@react-native/normalize-color/index.js"(exports, module2) {
2365
+ "use strict";
2366
+ function normalizeColor(color) {
2367
+ if (typeof color == "number")
2368
+ return color >>> 0 === color && color >= 0 && color <= 4294967295 ? color : null;
2369
+ if (typeof color != "string")
2370
+ return null;
2371
+ let matchers = getMatchers(), match;
2372
+ if (match = matchers.hex6.exec(color))
2373
+ return parseInt(match[1] + "ff", 16) >>> 0;
2374
+ let colorFromKeyword = normalizeKeyword(color);
2375
+ return colorFromKeyword ?? ((match = matchers.rgb.exec(color)) ? (parse255(match[1]) << 24 | // r
2376
+ parse255(match[2]) << 16 | // g
2377
+ parse255(match[3]) << 8 | // b
2378
+ 255) >>> // a
2379
+ 0 : (match = matchers.rgba.exec(color)) ? match[6] !== void 0 ? (parse255(match[6]) << 24 | // r
2380
+ parse255(match[7]) << 16 | // g
2381
+ parse255(match[8]) << 8 | // b
2382
+ parse1(match[9])) >>> // a
2383
+ 0 : (parse255(match[2]) << 24 | // r
2384
+ parse255(match[3]) << 16 | // g
2385
+ parse255(match[4]) << 8 | // b
2386
+ parse1(match[5])) >>> // a
2387
+ 0 : (match = matchers.hex3.exec(color)) ? parseInt(
2388
+ match[1] + match[1] + // r
2389
+ match[2] + match[2] + // g
2390
+ match[3] + match[3] + // b
2391
+ "ff",
2392
+ // a
2393
+ 16
2394
+ ) >>> 0 : (match = matchers.hex8.exec(color)) ? parseInt(match[1], 16) >>> 0 : (match = matchers.hex4.exec(color)) ? parseInt(
2395
+ match[1] + match[1] + // r
2396
+ match[2] + match[2] + // g
2397
+ match[3] + match[3] + // b
2398
+ match[4] + match[4],
2399
+ // a
2400
+ 16
2401
+ ) >>> 0 : (match = matchers.hsl.exec(color)) ? (hslToRgb(
2402
+ parse360(match[1]),
2403
+ // h
2404
+ parsePercentage(match[2]),
2405
+ // s
2406
+ parsePercentage(match[3])
2407
+ // l
2408
+ ) | 255) >>> // a
2409
+ 0 : (match = matchers.hsla.exec(color)) ? match[6] !== void 0 ? (hslToRgb(
2410
+ parse360(match[6]),
2411
+ // h
2412
+ parsePercentage(match[7]),
2413
+ // s
2414
+ parsePercentage(match[8])
2415
+ // l
2416
+ ) | parse1(match[9])) >>> // a
2417
+ 0 : (hslToRgb(
2418
+ parse360(match[2]),
2419
+ // h
2420
+ parsePercentage(match[3]),
2421
+ // s
2422
+ parsePercentage(match[4])
2423
+ // l
2424
+ ) | parse1(match[5])) >>> // a
2425
+ 0 : (match = matchers.hwb.exec(color)) ? (hwbToRgb(
2426
+ parse360(match[1]),
2427
+ // h
2428
+ parsePercentage(match[2]),
2429
+ // w
2430
+ parsePercentage(match[3])
2431
+ // b
2432
+ ) | 255) >>> // a
2433
+ 0 : null);
2434
+ }
2435
+ function hue2rgb(p, q, t) {
2436
+ return t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? p + (q - p) * 6 * t : t < 1 / 2 ? q : t < 2 / 3 ? p + (q - p) * (2 / 3 - t) * 6 : p;
2437
+ }
2438
+ function hslToRgb(h, s, l) {
2439
+ let q = l < 0.5 ? l * (1 + s) : l + s - l * s, p = 2 * l - q, r = hue2rgb(p, q, h + 1 / 3), g = hue2rgb(p, q, h), b = hue2rgb(p, q, h - 1 / 3);
2440
+ return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b * 255) << 8;
2441
+ }
2442
+ function hwbToRgb(h, w, b) {
2443
+ if (w + b >= 1) {
2444
+ let gray = Math.round(w * 255 / (w + b));
2445
+ return gray << 24 | gray << 16 | gray << 8;
3326
2446
  }
3327
- get identifierToValue() {
3328
- return identifierToValue;
2447
+ let red = hue2rgb(0, 1, h + 1 / 3) * (1 - w - b) + w, green = hue2rgb(0, 1, h) * (1 - w - b) + w, blue = hue2rgb(0, 1, h - 1 / 3) * (1 - w - b) + w;
2448
+ return Math.round(red * 255) << 24 | Math.round(green * 255) << 16 | Math.round(blue * 255) << 8;
2449
+ }
2450
+ var NUMBER = "[-+]?\\d*\\.?\\d+", PERCENTAGE = NUMBER + "%";
2451
+ function call(...args) {
2452
+ return "\\(\\s*(" + args.join(")\\s*,?\\s*(") + ")\\s*\\)";
2453
+ }
2454
+ function callWithSlashSeparator(...args) {
2455
+ return "\\(\\s*(" + args.slice(0, args.length - 1).join(")\\s*,?\\s*(") + ")\\s*/\\s*(" + args[args.length - 1] + ")\\s*\\)";
2456
+ }
2457
+ function commaSeparatedCall(...args) {
2458
+ return "\\(\\s*(" + args.join(")\\s*,\\s*(") + ")\\s*\\)";
2459
+ }
2460
+ var cachedMatchers;
2461
+ function getMatchers() {
2462
+ return cachedMatchers === void 0 && (cachedMatchers = {
2463
+ rgb: new RegExp("rgb" + call(NUMBER, NUMBER, NUMBER)),
2464
+ rgba: new RegExp(
2465
+ "rgba(" + commaSeparatedCall(NUMBER, NUMBER, NUMBER, NUMBER) + "|" + callWithSlashSeparator(NUMBER, NUMBER, NUMBER, NUMBER) + ")"
2466
+ ),
2467
+ hsl: new RegExp("hsl" + call(NUMBER, PERCENTAGE, PERCENTAGE)),
2468
+ hsla: new RegExp(
2469
+ "hsla(" + commaSeparatedCall(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER) + "|" + callWithSlashSeparator(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER) + ")"
2470
+ ),
2471
+ hwb: new RegExp("hwb" + call(NUMBER, PERCENTAGE, PERCENTAGE)),
2472
+ hex3: /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
2473
+ hex4: /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
2474
+ hex6: /^#([0-9a-fA-F]{6})$/,
2475
+ hex8: /^#([0-9a-fA-F]{8})$/
2476
+ }), cachedMatchers;
2477
+ }
2478
+ function parse255(str) {
2479
+ let int = parseInt(str, 10);
2480
+ return int < 0 ? 0 : int > 255 ? 255 : int;
2481
+ }
2482
+ function parse360(str) {
2483
+ return (parseFloat(str) % 360 + 360) % 360 / 360;
2484
+ }
2485
+ function parse1(str) {
2486
+ let num = parseFloat(str);
2487
+ return num < 0 ? 0 : num > 1 ? 255 : Math.round(num * 255);
2488
+ }
2489
+ function parsePercentage(str) {
2490
+ let int = parseFloat(str);
2491
+ return int < 0 ? 0 : int > 100 ? 1 : int / 100;
2492
+ }
2493
+ function normalizeKeyword(name) {
2494
+ switch (name) {
2495
+ case "transparent":
2496
+ return 0;
2497
+ case "aliceblue":
2498
+ return 4042850303;
2499
+ case "antiquewhite":
2500
+ return 4209760255;
2501
+ case "aqua":
2502
+ return 16777215;
2503
+ case "aquamarine":
2504
+ return 2147472639;
2505
+ case "azure":
2506
+ return 4043309055;
2507
+ case "beige":
2508
+ return 4126530815;
2509
+ case "bisque":
2510
+ return 4293182719;
2511
+ case "black":
2512
+ return 255;
2513
+ case "blanchedalmond":
2514
+ return 4293643775;
2515
+ case "blue":
2516
+ return 65535;
2517
+ case "blueviolet":
2518
+ return 2318131967;
2519
+ case "brown":
2520
+ return 2771004159;
2521
+ case "burlywood":
2522
+ return 3736635391;
2523
+ case "burntsienna":
2524
+ return 3934150143;
2525
+ case "cadetblue":
2526
+ return 1604231423;
2527
+ case "chartreuse":
2528
+ return 2147418367;
2529
+ case "chocolate":
2530
+ return 3530104575;
2531
+ case "coral":
2532
+ return 4286533887;
2533
+ case "cornflowerblue":
2534
+ return 1687547391;
2535
+ case "cornsilk":
2536
+ return 4294499583;
2537
+ case "crimson":
2538
+ return 3692313855;
2539
+ case "cyan":
2540
+ return 16777215;
2541
+ case "darkblue":
2542
+ return 35839;
2543
+ case "darkcyan":
2544
+ return 9145343;
2545
+ case "darkgoldenrod":
2546
+ return 3095792639;
2547
+ case "darkgray":
2548
+ return 2846468607;
2549
+ case "darkgreen":
2550
+ return 6553855;
2551
+ case "darkgrey":
2552
+ return 2846468607;
2553
+ case "darkkhaki":
2554
+ return 3182914559;
2555
+ case "darkmagenta":
2556
+ return 2332068863;
2557
+ case "darkolivegreen":
2558
+ return 1433087999;
2559
+ case "darkorange":
2560
+ return 4287365375;
2561
+ case "darkorchid":
2562
+ return 2570243327;
2563
+ case "darkred":
2564
+ return 2332033279;
2565
+ case "darksalmon":
2566
+ return 3918953215;
2567
+ case "darkseagreen":
2568
+ return 2411499519;
2569
+ case "darkslateblue":
2570
+ return 1211993087;
2571
+ case "darkslategray":
2572
+ return 793726975;
2573
+ case "darkslategrey":
2574
+ return 793726975;
2575
+ case "darkturquoise":
2576
+ return 13554175;
2577
+ case "darkviolet":
2578
+ return 2483082239;
2579
+ case "deeppink":
2580
+ return 4279538687;
2581
+ case "deepskyblue":
2582
+ return 12582911;
2583
+ case "dimgray":
2584
+ return 1768516095;
2585
+ case "dimgrey":
2586
+ return 1768516095;
2587
+ case "dodgerblue":
2588
+ return 512819199;
2589
+ case "firebrick":
2590
+ return 2988581631;
2591
+ case "floralwhite":
2592
+ return 4294635775;
2593
+ case "forestgreen":
2594
+ return 579543807;
2595
+ case "fuchsia":
2596
+ return 4278255615;
2597
+ case "gainsboro":
2598
+ return 3705462015;
2599
+ case "ghostwhite":
2600
+ return 4177068031;
2601
+ case "gold":
2602
+ return 4292280575;
2603
+ case "goldenrod":
2604
+ return 3668254975;
2605
+ case "gray":
2606
+ return 2155905279;
2607
+ case "green":
2608
+ return 8388863;
2609
+ case "greenyellow":
2610
+ return 2919182335;
2611
+ case "grey":
2612
+ return 2155905279;
2613
+ case "honeydew":
2614
+ return 4043305215;
2615
+ case "hotpink":
2616
+ return 4285117695;
2617
+ case "indianred":
2618
+ return 3445382399;
2619
+ case "indigo":
2620
+ return 1258324735;
2621
+ case "ivory":
2622
+ return 4294963455;
2623
+ case "khaki":
2624
+ return 4041641215;
2625
+ case "lavender":
2626
+ return 3873897215;
2627
+ case "lavenderblush":
2628
+ return 4293981695;
2629
+ case "lawngreen":
2630
+ return 2096890111;
2631
+ case "lemonchiffon":
2632
+ return 4294626815;
2633
+ case "lightblue":
2634
+ return 2916673279;
2635
+ case "lightcoral":
2636
+ return 4034953471;
2637
+ case "lightcyan":
2638
+ return 3774873599;
2639
+ case "lightgoldenrodyellow":
2640
+ return 4210742015;
2641
+ case "lightgray":
2642
+ return 3553874943;
2643
+ case "lightgreen":
2644
+ return 2431553791;
2645
+ case "lightgrey":
2646
+ return 3553874943;
2647
+ case "lightpink":
2648
+ return 4290167295;
2649
+ case "lightsalmon":
2650
+ return 4288707327;
2651
+ case "lightseagreen":
2652
+ return 548580095;
2653
+ case "lightskyblue":
2654
+ return 2278488831;
2655
+ case "lightslategray":
2656
+ return 2005441023;
2657
+ case "lightslategrey":
2658
+ return 2005441023;
2659
+ case "lightsteelblue":
2660
+ return 2965692159;
2661
+ case "lightyellow":
2662
+ return 4294959359;
2663
+ case "lime":
2664
+ return 16711935;
2665
+ case "limegreen":
2666
+ return 852308735;
2667
+ case "linen":
2668
+ return 4210091775;
2669
+ case "magenta":
2670
+ return 4278255615;
2671
+ case "maroon":
2672
+ return 2147483903;
2673
+ case "mediumaquamarine":
2674
+ return 1724754687;
2675
+ case "mediumblue":
2676
+ return 52735;
2677
+ case "mediumorchid":
2678
+ return 3126187007;
2679
+ case "mediumpurple":
2680
+ return 2473647103;
2681
+ case "mediumseagreen":
2682
+ return 1018393087;
2683
+ case "mediumslateblue":
2684
+ return 2070474495;
2685
+ case "mediumspringgreen":
2686
+ return 16423679;
2687
+ case "mediumturquoise":
2688
+ return 1221709055;
2689
+ case "mediumvioletred":
2690
+ return 3340076543;
2691
+ case "midnightblue":
2692
+ return 421097727;
2693
+ case "mintcream":
2694
+ return 4127193855;
2695
+ case "mistyrose":
2696
+ return 4293190143;
2697
+ case "moccasin":
2698
+ return 4293178879;
2699
+ case "navajowhite":
2700
+ return 4292783615;
2701
+ case "navy":
2702
+ return 33023;
2703
+ case "oldlace":
2704
+ return 4260751103;
2705
+ case "olive":
2706
+ return 2155872511;
2707
+ case "olivedrab":
2708
+ return 1804477439;
2709
+ case "orange":
2710
+ return 4289003775;
2711
+ case "orangered":
2712
+ return 4282712319;
2713
+ case "orchid":
2714
+ return 3664828159;
2715
+ case "palegoldenrod":
2716
+ return 4008225535;
2717
+ case "palegreen":
2718
+ return 2566625535;
2719
+ case "paleturquoise":
2720
+ return 2951671551;
2721
+ case "palevioletred":
2722
+ return 3681588223;
2723
+ case "papayawhip":
2724
+ return 4293907967;
2725
+ case "peachpuff":
2726
+ return 4292524543;
2727
+ case "peru":
2728
+ return 3448061951;
2729
+ case "pink":
2730
+ return 4290825215;
2731
+ case "plum":
2732
+ return 3718307327;
2733
+ case "powderblue":
2734
+ return 2967529215;
2735
+ case "purple":
2736
+ return 2147516671;
2737
+ case "rebeccapurple":
2738
+ return 1714657791;
2739
+ case "red":
2740
+ return 4278190335;
2741
+ case "rosybrown":
2742
+ return 3163525119;
2743
+ case "royalblue":
2744
+ return 1097458175;
2745
+ case "saddlebrown":
2746
+ return 2336560127;
2747
+ case "salmon":
2748
+ return 4202722047;
2749
+ case "sandybrown":
2750
+ return 4104413439;
2751
+ case "seagreen":
2752
+ return 780883967;
2753
+ case "seashell":
2754
+ return 4294307583;
2755
+ case "sienna":
2756
+ return 2689740287;
2757
+ case "silver":
2758
+ return 3233857791;
2759
+ case "skyblue":
2760
+ return 2278484991;
2761
+ case "slateblue":
2762
+ return 1784335871;
2763
+ case "slategray":
2764
+ return 1887473919;
2765
+ case "slategrey":
2766
+ return 1887473919;
2767
+ case "snow":
2768
+ return 4294638335;
2769
+ case "springgreen":
2770
+ return 16744447;
2771
+ case "steelblue":
2772
+ return 1182971135;
2773
+ case "tan":
2774
+ return 3535047935;
2775
+ case "teal":
2776
+ return 8421631;
2777
+ case "thistle":
2778
+ return 3636451583;
2779
+ case "tomato":
2780
+ return 4284696575;
2781
+ case "turquoise":
2782
+ return 1088475391;
2783
+ case "violet":
2784
+ return 4001558271;
2785
+ case "wheat":
2786
+ return 4125012991;
2787
+ case "white":
2788
+ return 4294967295;
2789
+ case "whitesmoke":
2790
+ return 4126537215;
2791
+ case "yellow":
2792
+ return 4294902015;
2793
+ case "yellowgreen":
2794
+ return 2597139199;
3329
2795
  }
3330
- }, Tamagui = new TamaguiManager(), identifierToValue = /* @__PURE__ */ new Map(), getValueFromIdentifier = (identifier) => identifierToValue.get(identifier), setIdentifierValue = (identifier, value) => {
3331
- identifierToValue.set(identifier, value);
3332
- };
2796
+ return null;
2797
+ }
2798
+ module2.exports = normalizeColor;
3333
2799
  }
3334
2800
  });
3335
2801
 
3336
- // ../compose-refs/dist/cjs/compose-refs.native.js
3337
- var require_compose_refs_native = __commonJS({
3338
- "../compose-refs/dist/cjs/compose-refs.native.js"(exports, module2) {
2802
+ // ../normalize-css-color/dist/cjs/index.native.js
2803
+ var require_index_native7 = __commonJS({
2804
+ "../normalize-css-color/dist/cjs/index.native.js"(exports, module2) {
3339
2805
  "use strict";
3340
2806
  var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
3341
2807
  for (var name in all)
@@ -3352,43 +2818,30 @@ var require_compose_refs_native = __commonJS({
3352
2818
  // "default" to the CommonJS "module.exports" for node compatibility.
3353
2819
  isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: !0 }) : target,
3354
2820
  mod
3355
- )), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), compose_refs_exports = {};
3356
- __export2(compose_refs_exports, {
3357
- composeRefs: () => composeRefs,
3358
- useComposedRefs: () => useComposedRefs
2821
+ )), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), src_exports2 = {};
2822
+ __export2(src_exports2, {
2823
+ default: () => src_default,
2824
+ normalizeCSSColor: () => normalizeCSSColor,
2825
+ rgba: () => rgba2
3359
2826
  });
3360
- module2.exports = __toCommonJS2(compose_refs_exports);
3361
- var React = __toESM2(require("react"));
3362
- function setRef(ref, value) {
3363
- typeof ref == "function" ? ref(value) : ref && (ref.current = value);
3364
- }
3365
- function composeRefs(...refs) {
3366
- return (node) => refs.forEach((ref) => setRef(ref, node));
3367
- }
3368
- function useComposedRefs(...refs) {
3369
- return React.useCallback(composeRefs(...refs), refs);
3370
- }
3371
- }
3372
- });
3373
-
3374
- // ../compose-refs/dist/cjs/index.native.js
3375
- var require_index_native6 = __commonJS({
3376
- "../compose-refs/dist/cjs/index.native.js"(exports, module2) {
3377
- "use strict";
3378
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __copyProps2 = (to, from, except, desc) => {
3379
- if (from && typeof from == "object" || typeof from == "function")
3380
- for (let key of __getOwnPropNames2(from))
3381
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
3382
- return to;
3383
- }, __reExport2 = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default")), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), src_exports2 = {};
3384
2827
  module2.exports = __toCommonJS2(src_exports2);
3385
- __reExport2(src_exports2, require_compose_refs_native(), module2.exports);
2828
+ var normalizeColor = __toESM2(require_normalize_color()), norm = normalizeColor.default || normalizeColor, normalizeCSSColor = norm;
2829
+ function rgba2(colorInt) {
2830
+ var r = Math.round((colorInt & 4278190080) >>> 24), g = Math.round((colorInt & 16711680) >>> 16), b = Math.round((colorInt & 65280) >>> 8), a = ((colorInt & 255) >>> 0) / 255;
2831
+ return {
2832
+ r,
2833
+ g,
2834
+ b,
2835
+ a
2836
+ };
2837
+ }
2838
+ var src_default = normalizeCSSColor;
3386
2839
  }
3387
2840
  });
3388
2841
 
3389
- // ../use-did-finish-ssr/dist/cjs/index.native.js
3390
- var require_index_native7 = __commonJS({
3391
- "../use-did-finish-ssr/dist/cjs/index.native.js"(exports, module2) {
2842
+ // ../web/dist/cjs/helpers/defaultOffset.native.js
2843
+ var require_defaultOffset_native = __commonJS({
2844
+ "../web/dist/cjs/helpers/defaultOffset.native.js"(exports, module2) {
3392
2845
  "use strict";
3393
2846
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
3394
2847
  for (var name in all)
@@ -3398,25 +2851,18 @@ var require_index_native7 = __commonJS({
3398
2851
  for (let key of __getOwnPropNames2(from))
3399
2852
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
3400
2853
  return to;
3401
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), src_exports2 = {};
3402
- __export2(src_exports2, {
3403
- useClientValue: () => useClientValue,
3404
- useDidFinishSSR: () => useDidFinishSSR
2854
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), defaultOffset_exports = {};
2855
+ __export2(defaultOffset_exports, {
2856
+ defaultOffset: () => defaultOffset
3405
2857
  });
3406
- module2.exports = __toCommonJS2(src_exports2);
3407
- var import_react = require("react");
3408
- function useDidFinishSSR(value) {
3409
- return value ?? !0;
3410
- }
3411
- function useClientValue(value) {
3412
- return useDidFinishSSR() ? typeof value == "function" ? value() : value : void 0;
3413
- }
2858
+ module2.exports = __toCommonJS2(defaultOffset_exports);
2859
+ var defaultOffset = { height: 0, width: 0 };
3414
2860
  }
3415
2861
  });
3416
2862
 
3417
- // ../web/dist/cjs/helpers/objectIdentityKey.native.js
3418
- var require_objectIdentityKey_native = __commonJS({
3419
- "../web/dist/cjs/helpers/objectIdentityKey.native.js"(exports, module2) {
2863
+ // ../web/dist/cjs/helpers/normalizeColor.native.js
2864
+ var require_normalizeColor_native = __commonJS({
2865
+ "../web/dist/cjs/helpers/normalizeColor.native.js"(exports, module2) {
3420
2866
  "use strict";
3421
2867
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
3422
2868
  for (var name in all)
@@ -3426,34 +2872,30 @@ var require_objectIdentityKey_native = __commonJS({
3426
2872
  for (let key of __getOwnPropNames2(from))
3427
2873
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
3428
2874
  return to;
3429
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), objectIdentityKey_exports = {};
3430
- __export2(objectIdentityKey_exports, {
3431
- objectIdentityKey: () => objectIdentityKey
2875
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), normalizeColor_exports = {};
2876
+ __export2(normalizeColor_exports, {
2877
+ normalizeColor: () => normalizeColor,
2878
+ rgba: () => import_normalize_css_color2.rgba
3432
2879
  });
3433
- module2.exports = __toCommonJS2(objectIdentityKey_exports);
3434
- function objectIdentityKey(obj) {
3435
- let k = "";
3436
- for (let key in obj) {
3437
- k += key;
3438
- let arg = obj[key], type = typeof arg;
3439
- if (!arg || type !== "object")
3440
- k += type + arg;
3441
- else if (cache.has(arg))
3442
- k += cache.get(arg);
3443
- else {
3444
- let v = Math.random();
3445
- cache.set(arg, v), k += v;
3446
- }
2880
+ module2.exports = __toCommonJS2(normalizeColor_exports);
2881
+ var import_constants2 = require_index_native2(), import_normalize_css_color = require_index_native7(), import_normalize_css_color2 = require_index_native7(), normalizeColor = (color, opacity) => {
2882
+ if (!color)
2883
+ return;
2884
+ if (color[0] === "$" || color[0] === "v" && color.startsWith("var(") || import_constants2.isWeb && opacity === 1)
2885
+ return color;
2886
+ let colorProcessed = (0, import_normalize_css_color.normalizeCSSColor)(color);
2887
+ if (colorProcessed != null) {
2888
+ let { r, g, b, a } = (0, import_normalize_css_color.rgba)(colorProcessed), alpha = (opacity ?? a ?? 1).toFixed(2);
2889
+ return `rgba(${r},${g},${b},${alpha})`;
3447
2890
  }
3448
- return k;
3449
- }
3450
- var cache = /* @__PURE__ */ new WeakMap();
2891
+ process.env.NODE_ENV === "development" && console.warn(`Unknown color value: ${color}`);
2892
+ };
3451
2893
  }
3452
2894
  });
3453
2895
 
3454
- // ../web/dist/cjs/helpers/createStyledContext.native.js
3455
- var require_createStyledContext_native = __commonJS({
3456
- "../web/dist/cjs/helpers/createStyledContext.native.js"(exports, module2) {
2896
+ // ../web/dist/cjs/helpers/normalizeValueWithProperty.native.js
2897
+ var require_normalizeValueWithProperty_native = __commonJS({
2898
+ "../web/dist/cjs/helpers/normalizeValueWithProperty.native.js"(exports, module2) {
3457
2899
  "use strict";
3458
2900
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
3459
2901
  for (var name in all)
@@ -3463,31 +2905,49 @@ var require_createStyledContext_native = __commonJS({
3463
2905
  for (let key of __getOwnPropNames2(from))
3464
2906
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
3465
2907
  return to;
3466
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createStyledContext_exports = {};
3467
- __export2(createStyledContext_exports, {
3468
- createStyledContext: () => createStyledContext
2908
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), normalizeValueWithProperty_exports = {};
2909
+ __export2(normalizeValueWithProperty_exports, {
2910
+ normalizeValueWithProperty: () => normalizeValueWithProperty,
2911
+ reverseMapClassNameToValue: () => reverseMapClassNameToValue
3469
2912
  });
3470
- module2.exports = __toCommonJS2(createStyledContext_exports);
3471
- var import_react = require("react"), import_objectIdentityKey = require_objectIdentityKey_native(), import_jsx_runtime = require("react/jsx-runtime");
3472
- function createStyledContext(props) {
3473
- let OGContext = (0, import_react.createContext)(props), OGProvider = OGContext.Provider, Context = OGContext, Provider = ({
3474
- children,
3475
- ...values
3476
- }) => {
3477
- let value = (0, import_react.useMemo)(() => ({
3478
- ...props,
3479
- ...values
3480
- }), [(0, import_objectIdentityKey.objectIdentityKey)(values)]);
3481
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(OGProvider, { value, children });
3482
- };
3483
- return Context.Provider = Provider, Context.props = props, Context.context = OGContext, Context;
2913
+ module2.exports = __toCommonJS2(normalizeValueWithProperty_exports);
2914
+ var import_constants2 = require_index_native2(), import_helpers = require_index_native4(), import_insertStyleRule = require_insertStyleRule_native(), stylePropsAllPlusTransforms = {
2915
+ ...import_helpers.stylePropsAll,
2916
+ translateX: !0,
2917
+ translateY: !0
2918
+ };
2919
+ function normalizeValueWithProperty(value, property) {
2920
+ if (!import_constants2.isWeb || typeof value == "boolean" || property && property in import_helpers.stylePropsUnitless || property && !(property in stylePropsAllPlusTransforms))
2921
+ return value;
2922
+ let res = value;
2923
+ return value && typeof value == "object" ? value : (typeof value == "number" ? res = `${value}px` : property && (res = `${res}`), res);
2924
+ }
2925
+ var rcache = {};
2926
+ function reverseMapClassNameToValue(key, className) {
2927
+ let cssRule = (0, import_insertStyleRule.getAllSelectors)()[className];
2928
+ if (rcache[cssRule])
2929
+ return rcache[cssRule];
2930
+ if (!cssRule) {
2931
+ process.env.NODE_ENV === "development" && console.warn(
2932
+ `No CSS rule found for ${key} looking for selector ".${className}", you may not be injecting extracted CSS`
2933
+ );
2934
+ return;
2935
+ }
2936
+ let cssVal = cssRule.replace(/.*:/, "").replace(/;.*/, "").trim(), res;
2937
+ return cssVal.startsWith("var(") ? res = cssVal : import_helpers.stylePropsUnitless[key] ? res = +cssVal : cssVal.endsWith("px") ? res = +cssVal.replace("px", "") : res = cssVal, rcache[cssRule] = res, process.env.NODE_ENV === "development" && typeof res == "number" && isNaN(res) && console.log("Tamagui invalid parsed value, NaN:", {
2938
+ res,
2939
+ cssVal,
2940
+ cssRule,
2941
+ key,
2942
+ className
2943
+ }), res;
3484
2944
  }
3485
2945
  }
3486
2946
  });
3487
2947
 
3488
- // ../web/dist/cjs/contexts/ComponentContext.native.js
3489
- var require_ComponentContext_native = __commonJS({
3490
- "../web/dist/cjs/contexts/ComponentContext.native.js"(exports, module2) {
2948
+ // ../web/dist/cjs/helpers/normalizeShadow.native.js
2949
+ var require_normalizeShadow_native = __commonJS({
2950
+ "../web/dist/cjs/helpers/normalizeShadow.native.js"(exports, module2) {
3491
2951
  "use strict";
3492
2952
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
3493
2953
  for (var name in all)
@@ -3497,33 +2957,38 @@ var require_ComponentContext_native = __commonJS({
3497
2957
  for (let key of __getOwnPropNames2(from))
3498
2958
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
3499
2959
  return to;
3500
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ComponentContext_exports = {};
3501
- __export2(ComponentContext_exports, {
3502
- ComponentContext: () => ComponentContext
2960
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), normalizeShadow_native_exports = {};
2961
+ __export2(normalizeShadow_native_exports, {
2962
+ normalizeShadow: () => normalizeShadow
3503
2963
  });
3504
- module2.exports = __toCommonJS2(ComponentContext_exports);
3505
- var import_createStyledContext = require_createStyledContext_native(), listeners = /* @__PURE__ */ new Set(), ComponentContext = (0, import_createStyledContext.createStyledContext)({
3506
- inText: !1,
3507
- language: null,
3508
- animationDriver: null,
3509
- groups: {
3510
- emit: (name, state) => {
3511
- listeners.forEach((l) => l(name, state));
3512
- },
3513
- subscribe(cb) {
3514
- return listeners.add(cb), () => {
3515
- listeners.delete(cb);
3516
- };
2964
+ module2.exports = __toCommonJS2(normalizeShadow_native_exports);
2965
+ var import_normalize_css_color = require_index_native7(), import_defaultOffset = require_defaultOffset_native(), import_normalizeColor = require_normalizeColor_native(), import_normalizeValueWithProperty = require_normalizeValueWithProperty_native();
2966
+ function normalizeShadow({
2967
+ shadowColor,
2968
+ shadowOffset,
2969
+ shadowOpacity,
2970
+ shadowRadius
2971
+ }) {
2972
+ let { height, width } = shadowOffset || import_defaultOffset.defaultOffset, colorStr = String(shadowColor || "black"), val = (0, import_normalize_css_color.normalizeCSSColor)(colorStr);
2973
+ if (typeof val != "number")
2974
+ throw new Error(`invalid shadow color ${colorStr}`);
2975
+ let { r, g, b, a } = (0, import_normalizeColor.rgba)(val);
2976
+ return {
2977
+ shadowOffset: {
2978
+ width: (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(width || 0),
2979
+ height: (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(height || 0)
3517
2980
  },
3518
- state: {}
3519
- }
3520
- });
2981
+ shadowRadius: (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(shadowRadius || 0),
2982
+ shadowColor: `rgb(${r},${g},${b})`,
2983
+ shadowOpacity: shadowOpacity ?? a
2984
+ };
2985
+ }
3521
2986
  }
3522
2987
  });
3523
2988
 
3524
- // ../web/dist/cjs/defaultComponentState.native.js
3525
- var require_defaultComponentState_native = __commonJS({
3526
- "../web/dist/cjs/defaultComponentState.native.js"(exports, module2) {
2989
+ // ../web/dist/cjs/helpers/expandStyles.native.js
2990
+ var require_expandStyles_native = __commonJS({
2991
+ "../web/dist/cjs/helpers/expandStyles.native.js"(exports, module2) {
3527
2992
  "use strict";
3528
2993
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
3529
2994
  for (var name in all)
@@ -3533,32 +2998,46 @@ var require_defaultComponentState_native = __commonJS({
3533
2998
  for (let key of __getOwnPropNames2(from))
3534
2999
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
3535
3000
  return to;
3536
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), defaultComponentState_exports = {};
3537
- __export2(defaultComponentState_exports, {
3538
- defaultComponentState: () => defaultComponentState,
3539
- defaultComponentStateMounted: () => defaultComponentStateMounted,
3540
- defaultComponentStateShouldEnter: () => defaultComponentStateShouldEnter
3001
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), expandStyles_exports = {};
3002
+ __export2(expandStyles_exports, {
3003
+ expandStylesAndRemoveNullishValues: () => expandStylesAndRemoveNullishValues,
3004
+ fixStyles: () => fixStyles
3541
3005
  });
3542
- module2.exports = __toCommonJS2(defaultComponentState_exports);
3543
- var defaultComponentState = {
3544
- hover: !1,
3545
- press: !1,
3546
- pressIn: !1,
3547
- focus: !1,
3548
- unmounted: !0
3549
- }, defaultComponentStateMounted = {
3550
- ...defaultComponentState,
3551
- unmounted: !1
3552
- }, defaultComponentStateShouldEnter = {
3553
- ...defaultComponentState,
3554
- unmounted: "should-enter"
3006
+ module2.exports = __toCommonJS2(expandStyles_exports);
3007
+ var import_constants2 = require_index_native2(), import_expandStyle = require_expandStyle_native(), import_normalizeShadow = require_normalizeShadow_native(), import_normalizeValueWithProperty = require_normalizeValueWithProperty_native(), import_pseudoDescriptors = require_pseudoDescriptors_native();
3008
+ function expandStylesAndRemoveNullishValues(style) {
3009
+ let res = {};
3010
+ for (let key in style) {
3011
+ let valIn = style[key];
3012
+ if (valIn == null)
3013
+ continue;
3014
+ if (key in import_pseudoDescriptors.pseudoDescriptors) {
3015
+ res[key] = expandStylesAndRemoveNullishValues(valIn);
3016
+ continue;
3017
+ }
3018
+ let val = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(valIn, key), out = (0, import_expandStyle.expandStyle)(key, val);
3019
+ out ? Object.assign(res, Object.fromEntries(out)) : res[key] = val;
3020
+ }
3021
+ return fixStyles(res), res;
3022
+ }
3023
+ function fixStyles(style) {
3024
+ "elevationAndroid" in style && (style.elevation = style.elevationAndroid, delete style.elevationAndroid), (style.shadowRadius || style.shadowColor || style.shadowOpacity || style.shadowOffset) && Object.assign(style, (0, import_normalizeShadow.normalizeShadow)(style));
3025
+ for (let key in borderDefaults)
3026
+ key in style && !style[borderDefaults[key]] && (style[borderDefaults[key]] = "solid");
3027
+ }
3028
+ var nativeStyle = import_constants2.isWeb ? null : "borderStyle", borderDefaults = {
3029
+ borderWidth: "borderStyle",
3030
+ borderBottomWidth: nativeStyle || "borderBottomStyle",
3031
+ borderTopWidth: nativeStyle || "borderTopStyle",
3032
+ borderLeftWidth: nativeStyle || "borderLeftStyle",
3033
+ borderRightWidth: nativeStyle || "borderRightStyle"
3555
3034
  };
3556
3035
  }
3557
3036
  });
3558
3037
 
3559
- // ../web/dist/cjs/helpers/createShallowSetState.native.js
3560
- var require_createShallowSetState_native = __commonJS({
3561
- "../web/dist/cjs/helpers/createShallowSetState.native.js"(exports, module2) {
3038
+ // ../web/dist/cjs/helpers/getStylesAtomic.native.js
3039
+ var require_getStylesAtomic_native = __commonJS({
3040
+ "../web/dist/cjs/helpers/getStylesAtomic.native.js"(exports, module2) {
3562
3041
  "use strict";
3563
3042
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
3564
3043
  for (var name in all)
@@ -3568,27 +3047,23 @@ var require_createShallowSetState_native = __commonJS({
3568
3047
  for (let key of __getOwnPropNames2(from))
3569
3048
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
3570
3049
  return to;
3571
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createShallowSetState_exports = {};
3572
- __export2(createShallowSetState_exports, {
3573
- createShallowSetState: () => createShallowSetState,
3574
- mergeIfNotShallowEqual: () => mergeIfNotShallowEqual
3050
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), getStylesAtomic_native_exports = {};
3051
+ __export2(getStylesAtomic_native_exports, {
3052
+ generateAtomicStyles: () => generateAtomicStyles,
3053
+ getAtomicStyle: () => getAtomicStyle,
3054
+ getStylesAtomic: () => getStylesAtomic,
3055
+ styleToCSS: () => styleToCSS
3575
3056
  });
3576
- module2.exports = __toCommonJS2(createShallowSetState_exports);
3577
- function createShallowSetState(setter) {
3578
- return (next) => setter((prev) => mergeIfNotShallowEqual(prev, next));
3579
- }
3580
- function mergeIfNotShallowEqual(prev, next) {
3581
- for (let key in next)
3582
- if (prev[key] !== next[key])
3583
- return { ...prev, ...next };
3584
- return prev;
3585
- }
3057
+ module2.exports = __toCommonJS2(getStylesAtomic_native_exports);
3058
+ var empty = () => {
3059
+ console.warn("no-op native");
3060
+ }, getStylesAtomic = empty, generateAtomicStyles = empty, getAtomicStyle = empty, styleToCSS = empty;
3586
3061
  }
3587
3062
  });
3588
3063
 
3589
- // ../web/dist/cjs/constants/accessibilityDirectMap.native.js
3590
- var require_accessibilityDirectMap_native = __commonJS({
3591
- "../web/dist/cjs/constants/accessibilityDirectMap.native.js"(exports, module2) {
3064
+ // ../web/dist/cjs/helpers/getVariantExtras.native.js
3065
+ var require_getVariantExtras_native = __commonJS({
3066
+ "../web/dist/cjs/helpers/getVariantExtras.native.js"(exports, module2) {
3592
3067
  "use strict";
3593
3068
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
3594
3069
  for (var name in all)
@@ -3598,72 +3073,62 @@ var require_accessibilityDirectMap_native = __commonJS({
3598
3073
  for (let key of __getOwnPropNames2(from))
3599
3074
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
3600
3075
  return to;
3601
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), accessibilityDirectMap_native_exports = {};
3602
- __export2(accessibilityDirectMap_native_exports, {
3603
- accessibilityDirectMap: () => accessibilityDirectMap2,
3604
- accessibilityWebRoleToNativeRole: () => accessibilityWebRoleToNativeRole,
3605
- nativeAccessibilityState: () => nativeAccessibilityState,
3606
- nativeAccessibilityValue: () => nativeAccessibilityValue,
3607
- webToNativeAccessibilityDirectMap: () => webToNativeAccessibilityDirectMap
3076
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), getVariantExtras_exports = {};
3077
+ __export2(getVariantExtras_exports, {
3078
+ getFontsForLanguage: () => getFontsForLanguage,
3079
+ getVariantExtras: () => getVariantExtras
3608
3080
  });
3609
- module2.exports = __toCommonJS2(accessibilityDirectMap_native_exports);
3610
- var accessibilityDirectMap2 = {}, webToNativeAccessibilityDirectMap = {
3611
- "aria-label": "accessibilityLabel",
3612
- "aria-labelledby": "accessibilityLabelledBy",
3613
- "aria-live": "accessibilityLiveRegion",
3614
- "aria-modal": "accessibilityViewIsModal",
3615
- "aria-hidden": "accessibilityElementsHidden"
3616
- }, nativeAccessibilityValue = {
3617
- "aria-valuemin": "min",
3618
- "aria-valuemax": "max",
3619
- "aria-valuenow": "now",
3620
- "aria-valuetext": "text"
3621
- }, nativeAccessibilityState = {
3622
- "aria-disabled": "disabled",
3623
- "aria-selected": "selected",
3624
- "aria-checked": "checked",
3625
- "aria-busy": "busy",
3626
- "aria-expanded": "expanded"
3627
- }, accessibilityWebRoleToNativeRole = {
3628
- alert: "alert",
3629
- button: "button",
3630
- checkbox: "checkbox",
3631
- combobox: "combobox",
3632
- grid: "grid",
3633
- group: "none",
3634
- heading: "header",
3635
- imagebutton: "imagebutton",
3636
- img: "image",
3637
- keyboardkey: "keyboardkey",
3638
- link: "link",
3639
- menu: "menu",
3640
- menubar: "menubar",
3641
- menuitem: "menuitem",
3642
- none: "none",
3643
- presentation: "none",
3644
- progressbar: "progressbar",
3645
- radio: "radio",
3646
- radiogroup: "radiogroup",
3647
- region: "summary",
3648
- scrollbar: "scrollbar",
3649
- searchbox: "search",
3650
- slider: "adjustable",
3651
- spinbutton: "spinbutton",
3652
- summary: "summary",
3653
- switch: "switch",
3654
- tab: "tab",
3655
- tablist: "tablist",
3656
- text: "text",
3657
- timer: "timer",
3658
- togglebutton: "togglebutton",
3659
- toolbar: "toolbar"
3660
- };
3081
+ module2.exports = __toCommonJS2(getVariantExtras_exports);
3082
+ var import_createVariable = require_createVariable_native(), import_createProxy = require_createProxy_native();
3083
+ function getVariantExtras(styleState) {
3084
+ let { curProps, conf, context, theme } = styleState, fonts = conf.fontsParsed;
3085
+ context != null && context.language && (fonts = getFontsForLanguage(conf.fontsParsed, context.language));
3086
+ let fontFamily = (0, import_createVariable.getVariableValue)(
3087
+ styleState.fontFamily || styleState.curProps.fontFamily || styleState.conf.defaultFont
3088
+ );
3089
+ return {
3090
+ fonts,
3091
+ tokens: conf.tokensParsed,
3092
+ theme,
3093
+ fontFamily,
3094
+ font: fonts[fontFamily] || fonts[styleState.conf.defaultFont],
3095
+ // TODO do this in splitstlye
3096
+ // we avoid passing in default props for media queries because that would confuse things like SizableText.size:
3097
+ props: (0, import_createProxy.createProxy)(curProps, {
3098
+ // handles shorthands
3099
+ get(target, key) {
3100
+ let shorthand = conf.inverseShorthands[key];
3101
+ if (shorthand && Reflect.has(target, shorthand))
3102
+ return Reflect.get(target, shorthand);
3103
+ if (Reflect.has(target, key))
3104
+ return Reflect.get(target, key);
3105
+ }
3106
+ })
3107
+ };
3108
+ }
3109
+ var fontLanguageCache = /* @__PURE__ */ new WeakMap();
3110
+ function getFontsForLanguage(fonts, language) {
3111
+ if (fontLanguageCache.has(language))
3112
+ return fontLanguageCache.get(language);
3113
+ let next = {
3114
+ ...fonts,
3115
+ ...Object.fromEntries(
3116
+ Object.entries(language).map(([name, lang]) => {
3117
+ if (lang === "default")
3118
+ return [];
3119
+ let langKey = `$${name}_${lang}`;
3120
+ return [`$${name}`, fonts[langKey]];
3121
+ })
3122
+ )
3123
+ };
3124
+ return fontLanguageCache.set(language, next), next;
3125
+ }
3661
3126
  }
3662
3127
  });
3663
3128
 
3664
- // ../web/dist/cjs/helpers/getGroupPropParts.native.js
3665
- var require_getGroupPropParts_native = __commonJS({
3666
- "../web/dist/cjs/helpers/getGroupPropParts.native.js"(exports, module2) {
3129
+ // ../web/dist/cjs/helpers/isObj.native.js
3130
+ var require_isObj_native = __commonJS({
3131
+ "../web/dist/cjs/helpers/isObj.native.js"(exports, module2) {
3667
3132
  "use strict";
3668
3133
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
3669
3134
  for (var name in all)
@@ -3673,22 +3138,18 @@ var require_getGroupPropParts_native = __commonJS({
3673
3138
  for (let key of __getOwnPropNames2(from))
3674
3139
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
3675
3140
  return to;
3676
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), getGroupPropParts_exports = {};
3677
- __export2(getGroupPropParts_exports, {
3678
- getGroupPropParts: () => getGroupPropParts
3141
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), isObj_exports = {};
3142
+ __export2(isObj_exports, {
3143
+ isObj: () => isObj
3679
3144
  });
3680
- module2.exports = __toCommonJS2(getGroupPropParts_exports);
3681
- var import_useMedia = require_useMedia_native();
3682
- function getGroupPropParts(groupProp) {
3683
- let mediaQueries = (0, import_useMedia.getMedia)(), [_, name, part3, part4] = groupProp.split("-"), pseudo, media = part3 in mediaQueries ? part3 : void 0;
3684
- return media ? pseudo = part4 : pseudo = part3, { name, pseudo, media };
3685
- }
3145
+ module2.exports = __toCommonJS2(isObj_exports);
3146
+ var isObj = (x) => x && !Array.isArray(x) && typeof x == "object";
3686
3147
  }
3687
3148
  });
3688
3149
 
3689
- // ../web/dist/cjs/helpers/createMediaStyle.native.js
3690
- var require_createMediaStyle_native = __commonJS({
3691
- "../web/dist/cjs/helpers/createMediaStyle.native.js"(exports, module2) {
3150
+ // ../web/dist/cjs/helpers/propMapper.native.js
3151
+ var require_propMapper_native = __commonJS({
3152
+ "../web/dist/cjs/helpers/propMapper.native.js"(exports, module2) {
3692
3153
  "use strict";
3693
3154
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
3694
3155
  for (var name in all)
@@ -3698,79 +3159,189 @@ var require_createMediaStyle_native = __commonJS({
3698
3159
  for (let key of __getOwnPropNames2(from))
3699
3160
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
3700
3161
  return to;
3701
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createMediaStyle_exports = {};
3702
- __export2(createMediaStyle_exports, {
3703
- MEDIA_SEP: () => MEDIA_SEP,
3704
- createMediaStyle: () => createMediaStyle
3162
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), propMapper_exports = {};
3163
+ __export2(propMapper_exports, {
3164
+ getFontFamilyFromNameOrVariable: () => getFontFamilyFromNameOrVariable,
3165
+ getPropMappedFontFamily: () => getPropMappedFontFamily,
3166
+ getTokenForKey: () => getTokenForKey,
3167
+ propMapper: () => propMapper
3705
3168
  });
3706
- module2.exports = __toCommonJS2(createMediaStyle_exports);
3707
- var import_config = require_config_native(), import_useMedia = require_useMedia_native(), import_getGroupPropParts = require_getGroupPropParts_native(), MEDIA_SEP = "_", prefixes = null, selectors = null, groupPseudoToPseudoCSSMap = {
3708
- press: "active"
3709
- }, createMediaStyle = (styleObject, mediaKeyIn, mediaQueries, negate, priority) => {
3710
- let { property, identifier, rules } = styleObject, conf = (0, import_config.getConfig)(), enableMediaPropOrder = conf.settings.mediaPropOrder, isThemeMedia = mediaKeyIn.startsWith("theme-"), isPlatformMedia = !isThemeMedia && mediaKeyIn.startsWith("platform-"), isGroup = !isThemeMedia && !isPlatformMedia && mediaKeyIn.startsWith("group-"), isNonWindowMedia = isThemeMedia || isPlatformMedia || isGroup, negKey = negate ? "0" : "", ogPrefix = identifier.slice(0, identifier.indexOf("-") + 1), id = `${ogPrefix}${MEDIA_SEP}${mediaKeyIn.replace("-", "")}${negKey}${MEDIA_SEP}`, styleRule = "", groupMediaKey, containerName, nextIdentifier = identifier.replace(ogPrefix, id), styleInner = rules.map((rule) => rule.replace(identifier, nextIdentifier)).join(";");
3711
- if (isNonWindowMedia) {
3712
- let precedenceImportancePrefix = new Array((priority || 0) + (isGroup ? 1 : 0)).fill(":root").join("");
3713
- if (isThemeMedia || isGroup) {
3714
- let groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyIn), mediaName = groupInfo == null ? void 0 : groupInfo.name;
3715
- groupMediaKey = groupInfo == null ? void 0 : groupInfo.media, isGroup && (containerName = mediaName);
3716
- 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(
3717
- ":root",
3718
- ""
3719
- )}`;
3720
- styleRule = styleInner.replace(selector, nextSelector);
3169
+ module2.exports = __toCommonJS2(propMapper_exports);
3170
+ var import_constants2 = require_index_native2(), import_helpers = require_index_native4(), import_config = require_config_native(), import_isDevTools = require_isDevTools_native(), import_createVariable = require_createVariable_native(), import_expandStyle = require_expandStyle_native(), import_expandStyles = require_expandStyles_native(), import_getVariantExtras = require_getVariantExtras_native(), import_isObj = require_isObj_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), propMapper = (key, value, styleStateIn, subPropsIn) => {
3171
+ if (!import_constants2.isAndroid && key === "elevationAndroid")
3172
+ return;
3173
+ let subProps = styleStateIn.styleProps.fallbackProps || subPropsIn, styleState = subProps ? new Proxy(styleStateIn, {
3174
+ get(_, k) {
3175
+ return k === "curProps" ? subProps : Reflect.get(_, k);
3176
+ }
3177
+ }) : styleStateIn, { conf, styleProps, fontFamily, staticConfig } = styleState, { variants } = staticConfig;
3178
+ if (process.env.NODE_ENV === "development" && fontFamily && fontFamily[0] === "$" && !(fontFamily in conf.fontsParsed) && console.warn(
3179
+ `Warning: no fontFamily "${fontFamily}" found in config: ${Object.keys(conf.fontsParsed).join(
3180
+ ", "
3181
+ )}`
3182
+ ), !styleProps.noExpand && variants && key in variants) {
3183
+ styleState.curProps[key] = value;
3184
+ let variantValue = resolveVariants(key, value, styleProps, styleState, "");
3185
+ if (variantValue)
3186
+ return variantValue;
3187
+ }
3188
+ let shouldReturn = !1;
3189
+ if (styleProps.disableExpandShorthands || key in conf.shorthands && (shouldReturn = !0, key = conf.shorthands[key]), value && (value[0] === "$" ? value = getTokenForKey(key, value, styleProps.resolveValues, styleState) : (0, import_createVariable.isVariable)(value) && (value = resolveVariableValue(value, styleProps.resolveValues))), shouldReturn || value != null)
3190
+ return (styleProps.noExpand ? null : (0, import_expandStyle.expandStyle)(key, value)) || [[key, value]];
3191
+ }, resolveVariants = (key, value, styleProps, styleState, parentVariantKey) => {
3192
+ let { staticConfig, conf, debug } = styleState, { variants } = staticConfig;
3193
+ if (!variants)
3194
+ return;
3195
+ let variantValue = getVariantDefinition(variants[key], key, value, conf);
3196
+ if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(`\u2666\uFE0F\u2666\uFE0F\u2666\uFE0F resolve variant ${key}`), console.log({
3197
+ key,
3198
+ value,
3199
+ variantValue,
3200
+ variants,
3201
+ curProps: { ...styleState.curProps }
3202
+ }), console.groupEnd()), !variantValue) {
3203
+ if (process.env.TAMAGUI_WARN_ON_MISSING_VARIANT === "1" && typeof value != "boolean") {
3204
+ let name = staticConfig.componentName || "[UnnamedComponent]";
3205
+ console.warn(
3206
+ `No variant found: ${name} has variant "${key}", but no matching value "${value}"`
3207
+ );
3208
+ }
3209
+ return;
3210
+ }
3211
+ if (typeof variantValue == "function") {
3212
+ let fn = variantValue, extras = (0, import_getVariantExtras.getVariantExtras)(styleState);
3213
+ variantValue = fn(value, extras), process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(" expanded functional variant", key), console.log({ fn, variantValue, extras }), console.groupEnd());
3214
+ }
3215
+ let fontFamilyResult;
3216
+ if ((0, import_isObj.isObj)(variantValue)) {
3217
+ let fontFamilyUpdate = variantValue.fontFamily || variantValue[conf.inverseShorthands.fontFamily];
3218
+ fontFamilyUpdate && (fontFamilyResult = getFontFamilyFromNameOrVariable(fontFamilyUpdate, conf), styleState.fontFamily = fontFamilyResult, process.env.NODE_ENV === "development" && debug === "verbose" && console.log(" updating font family", fontFamilyResult)), variantValue = resolveTokensAndVariants(
3219
+ key,
3220
+ variantValue,
3221
+ styleProps,
3222
+ styleState,
3223
+ parentVariantKey
3224
+ );
3225
+ }
3226
+ if (variantValue) {
3227
+ let expanded = (0, import_expandStyles.expandStylesAndRemoveNullishValues)(variantValue), next = Object.entries(expanded);
3228
+ return fontFamilyResult && fontFamilyResult[0] === "$" && fontFamilyCache.set(next, (0, import_createVariable.getVariableValue)(fontFamilyResult)), next;
3229
+ }
3230
+ };
3231
+ function getFontFamilyFromNameOrVariable(input, conf) {
3232
+ if ((0, import_createVariable.isVariable)(input)) {
3233
+ let val = variableToFontNameCache.get(input);
3234
+ if (val)
3235
+ return val;
3236
+ for (let key in conf.fontsParsed) {
3237
+ let familyVariable = conf.fontsParsed[key].family;
3238
+ if ((0, import_createVariable.isVariable)(familyVariable) && (variableToFontNameCache.set(familyVariable, key), familyVariable === input))
3239
+ return key;
3240
+ }
3241
+ } else if (typeof input == "string" && input[0] === "$")
3242
+ return input;
3243
+ }
3244
+ var variableToFontNameCache = /* @__PURE__ */ new WeakMap(), fontFamilyCache = /* @__PURE__ */ new WeakMap(), getPropMappedFontFamily = (expanded) => expanded && fontFamilyCache.get(expanded), resolveTokensAndVariants = (key, value, styleProps, styleState, parentVariantKey) => {
3245
+ var _a;
3246
+ let { conf, staticConfig, debug, theme } = styleState, { variants } = staticConfig, res = {};
3247
+ process.env.NODE_ENV === "development" && debug === "verbose" && console.log(" - resolveTokensAndVariants", key, value);
3248
+ for (let rKey in value) {
3249
+ let fKey = conf.shorthands[rKey] || rKey, val = value[rKey];
3250
+ if (styleProps.noExpand)
3251
+ res[fKey] = val;
3252
+ else if (variants && fKey in variants) {
3253
+ if (styleState.curProps[fKey] = val, parentVariantKey && parentVariantKey === key)
3254
+ res[fKey] = // SYNC WITH *1
3255
+ val[0] === "$" ? getTokenForKey(fKey, val, styleProps.resolveValues, styleState) : val;
3256
+ else {
3257
+ let variantOut = resolveVariants(fKey, val, styleProps, styleState, key);
3258
+ if (variantOut)
3259
+ for (let [key2, val2] of variantOut)
3260
+ val2 != null && (key2 in import_pseudoDescriptors.pseudoDescriptors ? (res[key2] ??= {}, Object.assign(res[key2], val2)) : res[key2] = val2);
3261
+ }
3262
+ continue;
3263
+ }
3264
+ if ((0, import_createVariable.isVariable)(val)) {
3265
+ res[fKey] = resolveVariableValue(val, styleProps.resolveValues);
3266
+ continue;
3267
+ }
3268
+ if (typeof val == "string") {
3269
+ let fVal = (
3270
+ // SYNC WITH *1
3271
+ val[0] === "$" ? getTokenForKey(fKey, val, styleProps.resolveValues, styleState) : val
3272
+ );
3273
+ res[fKey] = fVal;
3274
+ continue;
3275
+ }
3276
+ if ((0, import_isObj.isObj)(val)) {
3277
+ let subObject = resolveTokensAndVariants(fKey, val, styleProps, styleState, key);
3278
+ process.env.NODE_ENV === "development" && debug === "verbose" && console.log("object", fKey, subObject), res[fKey] ??= {}, Object.assign(res[fKey], subObject);
3721
3279
  } else
3722
- styleRule = `${precedenceImportancePrefix}${styleInner}`;
3280
+ res[fKey] = val;
3281
+ process.env.NODE_ENV === "development" && debug && ((_a = res[fKey]) == null ? void 0 : _a[0]) === "$" && console.warn(`\u26A0\uFE0F Missing token in theme ${theme.name}:`, fKey, res[fKey], theme);
3723
3282
  }
3724
- if (!isNonWindowMedia || groupMediaKey) {
3725
- if (!selectors) {
3726
- let mediaKeys = Object.keys(mediaQueries);
3727
- selectors = Object.fromEntries(
3728
- mediaKeys.map((key) => [key, (0, import_useMedia.mediaObjectToString)(mediaQueries[key])])
3729
- ), enableMediaPropOrder || (prefixes = Object.fromEntries(
3730
- mediaKeys.map((k, index) => [k, new Array(index + 1).fill(":root").join("")])
3731
- ));
3283
+ return res;
3284
+ }, tokenCats = ["size", "color", "radius", "space", "zIndex"].map((name) => ({
3285
+ name,
3286
+ spreadName: `...${name}`
3287
+ }));
3288
+ function getVariantDefinition(variant, key, value, conf) {
3289
+ if (typeof variant == "function")
3290
+ return variant;
3291
+ if (variant[value])
3292
+ return variant[value];
3293
+ let { tokensParsed } = conf;
3294
+ for (let { name, spreadName } of tokenCats)
3295
+ if (spreadName in variant && value in tokensParsed[name])
3296
+ return variant[spreadName];
3297
+ let fontSizeVariant = variant["...fontSize"];
3298
+ return fontSizeVariant && conf.fontSizeTokens.has(value) ? fontSizeVariant : variant[`:${typeof value}`] || variant["..."] || variant["...size"];
3299
+ }
3300
+ var fontShorthand = {
3301
+ fontSize: "size",
3302
+ fontWeight: "weight"
3303
+ }, getTokenForKey = (key, value, resolveAs = "none", styleState) => {
3304
+ var _a, _b;
3305
+ if (resolveAs === "none")
3306
+ return value;
3307
+ let { theme, conf = (0, import_config.getConfig)(), context, fontFamily } = styleState, tokensParsed = conf.tokensParsed, valOrVar, hasSet = !1;
3308
+ if (theme && value in theme)
3309
+ process.env.NODE_ENV === "development" && styleState.debug === "verbose" && console.log(` - getting theme value for ${key} from ${value}`), valOrVar = theme[value], hasSet = !0;
3310
+ else if (value in conf.specificTokens)
3311
+ hasSet = !0, valOrVar = conf.specificTokens[value];
3312
+ else {
3313
+ switch (key) {
3314
+ case "fontFamily": {
3315
+ 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;
3316
+ break;
3317
+ }
3318
+ case "fontSize":
3319
+ case "lineHeight":
3320
+ case "letterSpacing":
3321
+ case "fontWeight": {
3322
+ let defaultFont = conf.defaultFont || "$body", fam = fontFamily || defaultFont;
3323
+ if (fam) {
3324
+ let fontsParsed = context != null && context.language ? (0, import_getVariantExtras.getFontsForLanguage)(conf.fontsParsed, context.language) : conf.fontsParsed, font = fontsParsed[fam] || fontsParsed[defaultFont];
3325
+ valOrVar = ((_b = font == null ? void 0 : font[fontShorthand[key] || key]) == null ? void 0 : _b[value]) || value, hasSet = !0;
3326
+ }
3327
+ break;
3328
+ }
3329
+ }
3330
+ for (let cat in import_helpers.tokenCategories)
3331
+ if (key in import_helpers.tokenCategories[cat]) {
3332
+ let res = tokensParsed[cat][value];
3333
+ res != null && (valOrVar = res, hasSet = !0);
3334
+ }
3335
+ if (!hasSet) {
3336
+ let spaceVar = tokensParsed.space[value];
3337
+ spaceVar != null && (valOrVar = spaceVar, hasSet = !0);
3732
3338
  }
3733
- let mediaKey = groupMediaKey || mediaKeyIn, mediaSelector = selectors[mediaKey], mediaQuery = `${negate ? "not all and" : ""} ${mediaSelector}`, precedenceImportancePrefix = groupMediaKey ? "" : enableMediaPropOrder ? (
3734
- // this new array should be cached
3735
- new Array(priority).fill(":root").join("")
3736
- ) : (
3737
- // @ts-ignore
3738
- prefixes[mediaKey]
3739
- ), prefix = groupMediaKey ? `@container ${containerName}` : "@media";
3740
- groupMediaKey && (styleInner = styleRule), styleInner.includes(prefix) ? styleRule = styleInner.replace("{", ` and ${mediaQuery} {`) : styleRule = `${prefix} ${mediaQuery}{${precedenceImportancePrefix}${styleInner}}`;
3741
3339
  }
3742
- return {
3743
- property,
3744
- rules: [styleRule],
3745
- identifier: nextIdentifier
3746
- };
3340
+ return hasSet ? resolveVariableValue(valOrVar, resolveAs) : (process.env.NODE_ENV === "development" && import_isDevTools.isDevTools && styleState.debug === "verbose" && (console.groupCollapsed(" \uFE52 propMap (val)", key, value), console.log({ valOrVar, theme, hasSet }, theme ? theme[key] : ""), console.groupEnd()), value);
3747
3341
  };
3748
- }
3749
- });
3750
-
3751
- // ../web/dist/cjs/helpers/getStylesAtomic.native.js
3752
- var require_getStylesAtomic_native = __commonJS({
3753
- "../web/dist/cjs/helpers/getStylesAtomic.native.js"(exports, module2) {
3754
- "use strict";
3755
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
3756
- for (var name in all)
3757
- __defProp2(target, name, { get: all[name], enumerable: !0 });
3758
- }, __copyProps2 = (to, from, except, desc) => {
3759
- if (from && typeof from == "object" || typeof from == "function")
3760
- for (let key of __getOwnPropNames2(from))
3761
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
3762
- return to;
3763
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), getStylesAtomic_native_exports = {};
3764
- __export2(getStylesAtomic_native_exports, {
3765
- generateAtomicStyles: () => generateAtomicStyles,
3766
- getAtomicStyle: () => getAtomicStyle,
3767
- getStylesAtomic: () => getStylesAtomic,
3768
- styleToCSS: () => styleToCSS
3769
- });
3770
- module2.exports = __toCommonJS2(getStylesAtomic_native_exports);
3771
- var empty = () => {
3772
- console.warn("no-op native");
3773
- }, getStylesAtomic = empty, generateAtomicStyles = empty, getAtomicStyle = empty, styleToCSS = empty;
3342
+ function resolveVariableValue(valOrVar, resolveValues) {
3343
+ return resolveValues === "none" ? valOrVar : (0, import_createVariable.isVariable)(valOrVar) ? !import_constants2.isWeb || resolveValues === "value" ? valOrVar.val : valOrVar.variable : valOrVar;
3344
+ }
3774
3345
  }
3775
3346
  });
3776
3347
 
@@ -3832,7 +3403,7 @@ var require_getSplitStyles_native = __commonJS({
3832
3403
  }), console.groupEnd());
3833
3404
  for (let keyOg in props) {
3834
3405
  let keyInit = keyOg, valInit = props[keyOg];
3835
- if (keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit === "className" || keyInit in usedKeys || keyInit in skipProps && !isHOC)
3406
+ if (styleProps.disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit === "className" || keyInit in usedKeys || keyInit in skipProps && !isHOC)
3836
3407
  continue;
3837
3408
  let valInitType = typeof valInit;
3838
3409
  if (styleState.curProps[keyInit] = valInit, !import_constants2.isAndroid && keyInit === "elevationAndroid")
@@ -3884,7 +3455,7 @@ var require_getSplitStyles_native = __commonJS({
3884
3455
  default:
3885
3456
  }
3886
3457
  let isValidStyleKeyInit = keyInit in validStyleProps, isShorthand = keyInit in shorthands, isVariant = !isValidStyleKeyInit && variants && keyInit in variants, isStyleLikeKey = isShorthand || isValidStyleKeyInit || isVariant, isPseudo = keyInit in import_helpers.validPseudoKeys, isMedia = !isStyleLikeKey && !isPseudo && (0, import_useMedia.isMediaKey)(keyInit), isMediaOrPseudo = isMedia || isPseudo, isStyleProp = isMediaOrPseudo || isVariant || isValidStyleKeyInit || isShorthand;
3887
- if (isStyleProp && props.asChild === "except-style")
3458
+ if (isStyleProp && (props.asChild === "except-style" || props.asChild === "except-style-web"))
3888
3459
  continue;
3889
3460
  let shouldPassProp = !isStyleProp || // is in parent variants
3890
3461
  isHOC && (parentStaticConfig == null ? void 0 : parentStaticConfig.variants) && keyInit in parentStaticConfig.variants || (inlineProps == null ? void 0 : inlineProps.has(keyInit)), parentVariant = (_a = parentStaticConfig == null ? void 0 : parentStaticConfig.variants) == null ? void 0 : _a[keyInit], isHOCShouldPassThrough = !!(isHOC && (isShorthand || isValidStyleKeyInit || isMediaOrPseudo || parentVariant || keyInit in skipProps)), shouldPassThrough = shouldPassProp || isHOCShouldPassThrough;
@@ -4011,7 +3582,14 @@ current`, {
4011
3582
  // TODO try true like pseudo
4012
3583
  !1
4013
3584
  ), mediaKeyShort = key.slice(1);
4014
- process.env.NODE_ENV === "development" && debug === "verbose" && console.log(` \u{1F4FA} ${key}`, { key, val, mediaStyle, props, shouldDoClasses, componentState });
3585
+ process.env.NODE_ENV === "development" && debug === "verbose" && console.log(` \u{1F4FA} ${key}`, {
3586
+ key,
3587
+ val,
3588
+ mediaStyle,
3589
+ props,
3590
+ shouldDoClasses,
3591
+ componentState
3592
+ });
4015
3593
  let hasSpace = val.space;
4016
3594
  if ((hasSpace || !shouldDoClasses) && (Array.isArray(hasMedia) || (hasMedia = []), hasMedia.push(mediaKeyShort)), shouldDoClasses) {
4017
3595
  if (hasSpace && (delete mediaStyle.space, mediaState2[mediaKeyShort])) {
@@ -4112,9 +3690,9 @@ current`, {
4112
3690
  }
4113
3691
  }
4114
3692
  }
4115
- if (props.style && mergeStyleProp(styleState, props.style), (0, import_expandStyles.fixStyles)(style), import_constants2.isWeb && !staticConfig.isReactNative && (0, import_getStylesAtomic.styleToCSS)(style), styleState.transforms && Object.entries(styleState.transforms).sort(([a], [b]) => a.localeCompare(b)).forEach(([key, val]) => {
3693
+ if (props.style && mergeStyleProp(styleState, props.style), !styleProps.noNormalize && ((0, import_expandStyles.fixStyles)(style), import_constants2.isWeb && !staticConfig.isReactNative && (0, import_getStylesAtomic.styleToCSS)(style), styleState.transforms && Object.entries(styleState.transforms).sort(([a], [b]) => a.localeCompare(b)).forEach(([key, val]) => {
4116
3694
  mergeTransform(style, key, val, !0);
4117
- }), parentSplitStyles && !shouldDoClasses)
3695
+ }), parentSplitStyles && !shouldDoClasses))
4118
3696
  for (let key in parentSplitStyles.style)
4119
3697
  key in classNames || key in style || (style[key] = parentSplitStyles.style[key]);
4120
3698
  let result = {
@@ -4160,27 +3738,27 @@ current`, {
4160
3738
  return result;
4161
3739
  };
4162
3740
  function mergeStyle(styleState, key, val) {
4163
- let { classNames, viewProps, style, usedKeys } = styleState;
3741
+ let { classNames, viewProps, style, usedKeys, styleProps } = styleState;
4164
3742
  if (import_constants2.isWeb && (val == null ? void 0 : val[0]) === "_")
4165
3743
  classNames[key] = val, usedKeys[key] ||= 1;
4166
3744
  else if (key in import_helpers.stylePropsTransform)
4167
3745
  styleState.transforms ||= {}, styleState.transforms[key] = val;
4168
3746
  else {
4169
- let out = import_constants2.isWeb ? (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(val, key) : val;
3747
+ let out = import_constants2.isWeb && !styleProps.noNormalize ? (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(val, key) : val;
4170
3748
  key in import_helpers.validStylesOnBaseProps ? viewProps[key] = out : style[key] = out;
4171
3749
  }
4172
3750
  }
4173
3751
  var getSubStyle = (styleState, subKey, styleIn, avoidMergeTransform) => {
4174
- let { staticConfig, props, conf: conf2 } = styleState, styleOut = {};
3752
+ let { staticConfig, props, conf: conf2, styleProps } = styleState, styleOut = {};
4175
3753
  for (let key in styleIn) {
4176
3754
  let val = styleIn[key];
4177
3755
  key = conf2.shorthands[key] || key;
4178
3756
  let expanded = (0, import_propMapper.propMapper)(key, val, styleState, { ...props, ...props[subKey] });
4179
3757
  if (!(!expanded || !staticConfig.isHOC && key in skipProps))
4180
3758
  for (let [skey, sval] of expanded)
4181
- !avoidMergeTransform && skey in import_helpers.stylePropsTransform ? mergeTransform(styleOut, skey, sval) : styleOut[skey] = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(sval, key);
3759
+ !avoidMergeTransform && skey in import_helpers.stylePropsTransform ? mergeTransform(styleOut, skey, sval) : styleOut[skey] = styleProps.noNormalize ? sval : (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(sval, key);
4182
3760
  }
4183
- return (0, import_expandStyles.fixStyles)(styleOut), styleOut;
3761
+ return styleProps.noNormalize || (0, import_expandStyles.fixStyles)(styleOut), styleOut;
4184
3762
  };
4185
3763
  function mergeStyleProp(styleState, val) {
4186
3764
  if (!val)
@@ -4323,12 +3901,421 @@ var require_proxyThemeVariables_native = __commonJS({
4323
3901
  has(target, key) {
4324
3902
  return Reflect.has(target, removeStarting$(key));
4325
3903
  },
4326
- get(target, key) {
4327
- return Reflect.get(target, removeStarting$(key));
3904
+ get(target, key) {
3905
+ return Reflect.get(target, removeStarting$(key));
3906
+ }
3907
+ });
3908
+ }
3909
+ var removeStarting$ = (str) => typeof str == "string" && str[0] === "$" ? str.slice(1) : str;
3910
+ }
3911
+ });
3912
+
3913
+ // ../web/dist/cjs/helpers/ThemeManagerContext.native.js
3914
+ var require_ThemeManagerContext_native = __commonJS({
3915
+ "../web/dist/cjs/helpers/ThemeManagerContext.native.js"(exports, module2) {
3916
+ "use strict";
3917
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
3918
+ for (var name in all)
3919
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
3920
+ }, __copyProps2 = (to, from, except, desc) => {
3921
+ if (from && typeof from == "object" || typeof from == "function")
3922
+ for (let key of __getOwnPropNames2(from))
3923
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
3924
+ return to;
3925
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ThemeManagerContext_exports = {};
3926
+ __export2(ThemeManagerContext_exports, {
3927
+ ThemeManagerContext: () => ThemeManagerContext
3928
+ });
3929
+ module2.exports = __toCommonJS2(ThemeManagerContext_exports);
3930
+ var import_react = require("react"), ThemeManagerContext = (0, import_react.createContext)(null);
3931
+ }
3932
+ });
3933
+
3934
+ // ../web/dist/cjs/helpers/ThemeManager.native.js
3935
+ var require_ThemeManager_native = __commonJS({
3936
+ "../web/dist/cjs/helpers/ThemeManager.native.js"(exports, module2) {
3937
+ "use strict";
3938
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
3939
+ for (var name in all)
3940
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
3941
+ }, __copyProps2 = (to, from, except, desc) => {
3942
+ if (from && typeof from == "object" || typeof from == "function")
3943
+ for (let key of __getOwnPropNames2(from))
3944
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
3945
+ return to;
3946
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ThemeManager_exports = {};
3947
+ __export2(ThemeManager_exports, {
3948
+ ThemeManager: () => ThemeManager,
3949
+ getHasThemeUpdatingProps: () => getHasThemeUpdatingProps,
3950
+ getNonComponentParentManager: () => getNonComponentParentManager
3951
+ });
3952
+ module2.exports = __toCommonJS2(ThemeManager_exports);
3953
+ var import_constants2 = require_index_native2(), import_config = require_config_native(), import_constants22 = require_constants_native(), emptyState = { name: "" };
3954
+ function getHasThemeUpdatingProps(props) {
3955
+ return props.name || props.componentName || props.inverse || props.reset;
3956
+ }
3957
+ var uid = 0, ThemeManager = class {
3958
+ constructor(props = {}, parentManagerIn) {
3959
+ if (this.props = props, this.id = uid++, this.isComponent = !1, this.themeListeners = /* @__PURE__ */ new Set(), this.parentManager = null, this.state = emptyState, this.scheme = null, this._allKeys = null, parentManagerIn === "root") {
3960
+ this.updateStateFromProps(props, !1);
3961
+ return;
3962
+ }
3963
+ if (!parentManagerIn)
3964
+ throw process.env.NODE_ENV !== "production" ? new Error(
3965
+ "No parent manager given, this is likely due to duplicated Tamagui dependencies. Check your lockfile for mis-matched versions. It could also be from an error somewhere else in your stack causing Tamagui to recieve undefined context, you can try putting some ErrorBoundary components around other areas of your app, or a Suspense boundary."
3966
+ ) : "\u274C 0";
3967
+ if (this.parentManager = parentManagerIn, !this.updateStateFromProps(props, !1))
3968
+ return parentManagerIn || this;
3969
+ }
3970
+ updateStateFromProps(props = this.props || {}, shouldNotify = !0) {
3971
+ if (this.props = props, props.forceTheme)
3972
+ return this.state.theme = props.forceTheme, this.state.name = props.name || "", !0;
3973
+ let nextState = this.getStateIfChanged(props);
3974
+ if (nextState)
3975
+ return this.updateState(nextState, shouldNotify), nextState;
3976
+ }
3977
+ updateState(nextState, shouldNotify = !0) {
3978
+ this.state = nextState;
3979
+ let names = this.state.name.split("_"), lastName = names[names.length - 1][0];
3980
+ this.isComponent = lastName[0] === lastName[0].toUpperCase(), this._allKeys = null, this.scheme = names[0] === "light" ? "light" : names[0] === "dark" ? "dark" : null, process.env.NODE_ENV === "development" && (this._numChangeEventsSent ??= 0, this._numChangeEventsSent++), shouldNotify && queueMicrotask(() => {
3981
+ this.notify();
3982
+ });
3983
+ }
3984
+ getStateIfChanged(props = this.props, state = this.state, parentManager = this.parentManager) {
3985
+ let _ = this.getState(props, parentManager);
3986
+ if (state && state !== emptyState && !_)
3987
+ return parentManager == null ? void 0 : parentManager.state;
3988
+ if (this.getStateShouldChange(_, state))
3989
+ return _;
3990
+ }
3991
+ getStateShouldChange(nextState, state = this.state) {
3992
+ return !(!(nextState != null && nextState.theme) || nextState.theme === (state == null ? void 0 : state.theme));
3993
+ }
3994
+ getState(props = this.props, parentManager = this.parentManager) {
3995
+ return getState(props, parentManager) || (parentManager == null ? void 0 : parentManager.state) || null;
3996
+ }
3997
+ get allKeys() {
3998
+ var _a;
3999
+ return this._allKeys ||= /* @__PURE__ */ new Set([
4000
+ ...((_a = this.parentManager) == null ? void 0 : _a.allKeys) || [],
4001
+ ...Object.keys(this.state.theme || {})
4002
+ ]), this._allKeys;
4003
+ }
4004
+ notify(forced = !1) {
4005
+ this.themeListeners.forEach((cb) => cb(this.state.name, this, forced));
4006
+ }
4007
+ onChangeTheme(cb, debugId) {
4008
+ return process.env.NODE_ENV === "development" && debugId && (this._listeningIds ??= /* @__PURE__ */ new Set(), this._listeningIds.add(debugId)), this.themeListeners.add(cb), () => {
4009
+ this.themeListeners.delete(cb);
4010
+ };
4011
+ }
4012
+ };
4013
+ function getNextThemeClassName(name) {
4014
+ return `t_sub_theme ${import_constants22.THEME_CLASSNAME_PREFIX}${name}`.replace("light_", "").replace("dark_", "");
4015
+ }
4016
+ function getState(props, parentManager) {
4017
+ var _a, _b, _c, _d, _e, _f;
4018
+ let validManagerAndAllComponentThemes = getNonComponentParentManager(parentManager);
4019
+ parentManager = validManagerAndAllComponentThemes[0];
4020
+ let allComponentThemes = validManagerAndAllComponentThemes[1], themes = (0, import_config.getThemes)(), isDirectParentAComponentTheme = allComponentThemes.length > 0;
4021
+ if (props.name && props.reset)
4022
+ throw new Error("Cannot reset + set new name");
4023
+ if (!props.name && !props.inverse && !props.reset && !props.componentName)
4024
+ return null;
4025
+ if (props.reset && !isDirectParentAComponentTheme && !(parentManager != null && parentManager.parentManager))
4026
+ return process.env.NODE_ENV === "development" && console.warn("Cannot reset no grandparent exists"), null;
4027
+ 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 ? (
4028
+ // here because parentManager already skipped componentTheme so we have to only go up once
4029
+ ((_d = parentManager == null ? void 0 : parentManager.parentManager) == null ? void 0 : _d.state.name) || ""
4030
+ ) : ((_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) || "";
4031
+ props.reset && isDirectParentAComponentTheme && allComponentThemes.shift();
4032
+ let base = parentName.split(import_constants22.THEME_NAME_SEPARATOR), lastSegment = base[base.length - 1], isParentComponentTheme = parentName && lastSegment[0].toUpperCase() === lastSegment[0];
4033
+ isParentComponentTheme && base.pop();
4034
+ let parentBaseTheme = isParentComponentTheme ? base.slice(0, base.length).join(import_constants22.THEME_NAME_SEPARATOR) : parentName, max = base.length, min = componentName && !nextName ? max : 0;
4035
+ process.env.NODE_ENV === "development" && typeof props.debug == "string" && (console.groupCollapsed("ThemeManager.getState()"), console.log({
4036
+ props,
4037
+ parentName,
4038
+ parentBaseTheme,
4039
+ base,
4040
+ min,
4041
+ max,
4042
+ isParentComponentTheme
4043
+ }));
4044
+ for (let i = max; i >= min; i--) {
4045
+ let prefix = base.slice(0, i).join(import_constants22.THEME_NAME_SEPARATOR);
4046
+ props.inverse && (prefix = inverseThemeName(prefix));
4047
+ let potentials = [];
4048
+ if (prefix && prefix !== parentBaseTheme && potentials.push(prefix), nextName && potentials.unshift(prefix ? `${prefix}_${nextName}` : nextName), i === 1) {
4049
+ let lastSegment2 = potentials.findIndex((x) => !x.includes("_"));
4050
+ lastSegment2 > 0 && potentials.splice(lastSegment2, 0, nextName);
4051
+ }
4052
+ if (componentName) {
4053
+ let componentPotentials = [];
4054
+ if (nextName) {
4055
+ let beforeSeparator = prefix.slice(0, prefix.indexOf(import_constants22.THEME_NAME_SEPARATOR));
4056
+ componentPotentials.push(`${beforeSeparator}_${nextName}_${componentName}`);
4057
+ }
4058
+ if (componentPotentials.push(`${prefix}_${componentName}`), nextName) {
4059
+ let prefixLessOne = base.slice(0, i - 1).join(import_constants22.THEME_NAME_SEPARATOR);
4060
+ if (prefixLessOne) {
4061
+ let lessSpecific = `${prefixLessOne}_${nextName}_${componentName}`;
4062
+ componentPotentials.unshift(lessSpecific);
4063
+ }
4064
+ let moreSpecific = `${prefix}_${nextName}_${componentName}`;
4065
+ componentPotentials.unshift(moreSpecific);
4066
+ }
4067
+ potentials = [...componentPotentials, ...potentials, ...allComponentThemes];
4068
+ }
4069
+ let found = potentials.find((t) => t in themes);
4070
+ if (process.env.NODE_ENV === "development" && typeof props.debug == "string" && console.log(" - ", { found, potentials, parentManager }), found) {
4071
+ result = {
4072
+ name: found,
4073
+ theme: themes[found],
4074
+ className: import_constants2.isWeb ? getNextThemeClassName(found) : "",
4075
+ parentName,
4076
+ componentName,
4077
+ inverse: props.inverse
4078
+ };
4079
+ break;
4080
+ }
4081
+ }
4082
+ return process.env.NODE_ENV === "development" && typeof props.debug == "string" && typeof window < "u" && (console.warn("ThemeManager.getState():", {
4083
+ result
4084
+ }), console.trace(), console.groupEnd()), result;
4085
+ }
4086
+ var inverseThemeName = (themeName) => themeName.startsWith("light") ? themeName.replace(/^light/, "dark") : themeName.replace(/^dark/, "light");
4087
+ function getNonComponentParentManager(themeManager) {
4088
+ var _a;
4089
+ let res = themeManager, componentThemeNames = [];
4090
+ for (; res && res != null && res.isComponent; )
4091
+ componentThemeNames.push((_a = res == null ? void 0 : res.state) == null ? void 0 : _a.name), res = res.parentManager;
4092
+ return [res || null, componentThemeNames];
4093
+ }
4094
+ }
4095
+ });
4096
+
4097
+ // ../web/dist/cjs/hooks/getThemeUnwrapped.native.js
4098
+ var require_getThemeUnwrapped_native = __commonJS({
4099
+ "../web/dist/cjs/hooks/getThemeUnwrapped.native.js"(exports, module2) {
4100
+ "use strict";
4101
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
4102
+ for (var name in all)
4103
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
4104
+ }, __copyProps2 = (to, from, except, desc) => {
4105
+ if (from && typeof from == "object" || typeof from == "function")
4106
+ for (let key of __getOwnPropNames2(from))
4107
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
4108
+ return to;
4109
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), getThemeUnwrapped_exports = {};
4110
+ __export2(getThemeUnwrapped_exports, {
4111
+ GetThemeUnwrapped: () => GetThemeUnwrapped,
4112
+ getThemeUnwrapped: () => getThemeUnwrapped
4113
+ });
4114
+ module2.exports = __toCommonJS2(getThemeUnwrapped_exports);
4115
+ var getThemeUnwrapped = (theme) => (theme == null ? void 0 : theme[GetThemeUnwrapped]) || theme, GetThemeUnwrapped = Symbol();
4116
+ }
4117
+ });
4118
+
4119
+ // ../web/dist/cjs/hooks/useTheme.native.js
4120
+ var require_useTheme_native = __commonJS({
4121
+ "../web/dist/cjs/hooks/useTheme.native.js"(exports, module2) {
4122
+ "use strict";
4123
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
4124
+ for (var name in all)
4125
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
4126
+ }, __copyProps2 = (to, from, except, desc) => {
4127
+ if (from && typeof from == "object" || typeof from == "function")
4128
+ for (let key of __getOwnPropNames2(from))
4129
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
4130
+ return to;
4131
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), useTheme_exports = {};
4132
+ __export2(useTheme_exports, {
4133
+ activeThemeManagers: () => activeThemeManagers,
4134
+ getThemeProxied: () => getThemeProxied,
4135
+ useChangeThemeEffect: () => useChangeThemeEffect,
4136
+ useTheme: () => useTheme,
4137
+ useThemeWithState: () => useThemeWithState
4138
+ });
4139
+ module2.exports = __toCommonJS2(useTheme_exports);
4140
+ var import_constants2 = require_index_native2(), import_react = require("react"), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_createProxy = require_createProxy_native(), import_ThemeManager = require_ThemeManager_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), import_getThemeUnwrapped = require_getThemeUnwrapped_native(), emptyProps = { name: null }, cached;
4141
+ function getDefaultThemeProxied() {
4142
+ if (cached)
4143
+ return cached;
4144
+ let config = (0, import_config.getConfig)(), defaultTheme = config.themes.light ?? config.themes[Object.keys(config.themes)[0]];
4145
+ return cached = getThemeProxied(defaultTheme), cached;
4146
+ }
4147
+ var useTheme = (props = emptyProps) => {
4148
+ let [_, theme] = useThemeWithState(props);
4149
+ return theme || getDefaultThemeProxied();
4150
+ }, useThemeWithState = (props) => {
4151
+ let keys = (0, import_react.useRef)([]), changedThemeState = useChangeThemeEffect(
4152
+ props,
4153
+ !1,
4154
+ keys.current,
4155
+ import_constants2.isServer ? void 0 : () => {
4156
+ var _a, _b;
4157
+ let next = ((_a = props.shouldUpdate) == null ? void 0 : _a.call(props)) ?? (keys.current.length > 0 ? !0 : void 0);
4158
+ return process.env.NODE_ENV === "development" && props.debug && props.debug !== "profile" && console.log(" \u{1F3A8} useTheme() shouldUpdate?", next, {
4159
+ shouldUpdateProp: (_b = props.shouldUpdate) == null ? void 0 : _b.call(props),
4160
+ keys: [...keys.current]
4161
+ }), next;
4162
+ }
4163
+ ), { themeManager, state } = changedThemeState, { theme, name, className } = state;
4164
+ if (!theme)
4165
+ throw process.env.NODE_ENV === "development" ? new Error(
4166
+ `No theme found given props ${JSON.stringify(
4167
+ props
4168
+ )}. Themes given to tamagui are: ${Object.keys((0, import_config.getConfig)().themes)}`
4169
+ ) : "\u274C 1";
4170
+ let themeProxied = (0, import_react.useMemo)(() => getThemeProxied(theme, themeManager, keys.current, props.debug), [theme, name, className, themeManager]);
4171
+ return process.env.NODE_ENV === "development" && props.debug === "verbose" && (console.groupCollapsed(" \u{1F539} useTheme =>", name), console.log("returning state", changedThemeState, "from props", props), console.groupEnd()), [changedThemeState, themeProxied];
4172
+ };
4173
+ function getThemeProxied(theme, themeManager, keys, debug) {
4174
+ return (0, import_createProxy.createProxy)(theme, {
4175
+ has(_, key) {
4176
+ if (Reflect.has(theme, key))
4177
+ return !0;
4178
+ if (typeof key == "string")
4179
+ return key[0] === "$" && (key = key.slice(1)), themeManager == null ? void 0 : themeManager.allKeys.has(key);
4180
+ },
4181
+ get(_, key) {
4182
+ if (key === import_getThemeUnwrapped.GetThemeUnwrapped)
4183
+ return theme;
4184
+ if (
4185
+ // dont ask me, idk why but on hermes you can see that useTheme()[undefined] passes in STRING undefined to proxy
4186
+ // if someone is crazy enough to use "undefined" as a theme key then this not working is on them
4187
+ key !== "undefined" && typeof key == "string"
4188
+ ) {
4189
+ let keyString = key[0] === "$" ? key.slice(1) : key, val = theme[keyString];
4190
+ if (val && typeof val == "object")
4191
+ return new Proxy(val, {
4192
+ // when they touch the actual value we only track it
4193
+ // if its a variable (web), its ignored!
4194
+ get(_2, subkey) {
4195
+ return keys && (subkey === "val" || subkey === "get" && !import_constants2.isWeb) && !keys.includes(keyString) && (keys.push(keyString), process.env.NODE_ENV === "development" && debug && console.log(` \u{1F3A8} useTheme() tracking new key: ${keyString}`)), subkey === "get" ? () => (0, import_createVariable.getVariable)(val) : Reflect.get(val, subkey);
4196
+ }
4197
+ });
4198
+ }
4199
+ return Reflect.get(_, key);
4328
4200
  }
4329
4201
  });
4330
4202
  }
4331
- var removeStarting$ = (str) => typeof str == "string" && str[0] === "$" ? str.slice(1) : str;
4203
+ var activeThemeManagers = /* @__PURE__ */ new Set(), useChangeThemeEffect = (props, root = !1, keys, shouldUpdate) => {
4204
+ let {
4205
+ // @ts-expect-error internal use only
4206
+ disable
4207
+ } = props, parentManager = (0, import_react.useContext)(import_ThemeManagerContext.ThemeManagerContext);
4208
+ if (disable) {
4209
+ if (!parentManager)
4210
+ throw "\u274C 2";
4211
+ return {
4212
+ isNewTheme: !1,
4213
+ state: parentManager.state,
4214
+ themeManager: parentManager
4215
+ };
4216
+ }
4217
+ let [themeState, setThemeState] = (0, import_react.useState)(createState), { state, mounted, isNewTheme, themeManager } = themeState, isInversingOnMount = !!(!themeState.mounted && props.inverse);
4218
+ function getShouldUpdateTheme(manager = themeManager, nextState, prevState = state, forceShouldChange = !1) {
4219
+ let forceUpdate = shouldUpdate == null ? void 0 : shouldUpdate();
4220
+ if (!forceShouldChange && forceUpdate === !1)
4221
+ return;
4222
+ let next = nextState || manager.getState(props, parentManager);
4223
+ if (forceShouldChange || next && !(forceUpdate !== !0 && !manager.getStateShouldChange(next, prevState)))
4224
+ return next;
4225
+ }
4226
+ if (import_constants2.isServer || ((0, import_react.useLayoutEffect)(() => {
4227
+ if (props.inverse && !mounted) {
4228
+ setThemeState({ ...themeState, mounted: !0 });
4229
+ return;
4230
+ }
4231
+ isNewTheme && themeManager && activeThemeManagers.add(themeManager), (isNewTheme || getShouldUpdateTheme(themeManager)) && setThemeState(createState);
4232
+ let selfListenerDispose = themeManager.onChangeTheme((_a, _b, forced) => {
4233
+ forced && setThemeState((prev) => createState(prev, !0));
4234
+ }), disposeChangeListener = parentManager == null ? void 0 : parentManager.onChangeTheme((name, manager) => {
4235
+ let force = shouldUpdate == null ? void 0 : shouldUpdate(), doUpdate = force ?? !!(keys != null && keys.length || isNewTheme);
4236
+ process.env.NODE_ENV === "development" && props.debug && console.log(" \u{1F538} onChange", themeManager.id, {
4237
+ force,
4238
+ doUpdate,
4239
+ props,
4240
+ name,
4241
+ manager,
4242
+ keys
4243
+ }), doUpdate && setThemeState(createState);
4244
+ }, themeManager.id);
4245
+ return () => {
4246
+ selfListenerDispose(), disposeChangeListener == null || disposeChangeListener(), activeThemeManagers.delete(themeManager);
4247
+ };
4248
+ }, [
4249
+ themeManager,
4250
+ parentManager,
4251
+ isNewTheme,
4252
+ props.componentName,
4253
+ props.inverse,
4254
+ props.name,
4255
+ props.reset,
4256
+ mounted
4257
+ ]), process.env.NODE_ENV === "development" && props.debug !== "profile" && (0, import_react.useEffect)(() => (globalThis.TamaguiThemeManagers ??= /* @__PURE__ */ new Set(), globalThis.TamaguiThemeManagers.add(themeManager), () => {
4258
+ globalThis.TamaguiThemeManagers.delete(themeManager);
4259
+ }), [themeManager])), isInversingOnMount) {
4260
+ if (!parentManager)
4261
+ throw "\u274C 3";
4262
+ return {
4263
+ isNewTheme: !1,
4264
+ themeManager: parentManager,
4265
+ state: {
4266
+ ...parentManager.state,
4267
+ className: ""
4268
+ }
4269
+ };
4270
+ }
4271
+ return {
4272
+ state,
4273
+ isNewTheme,
4274
+ themeManager
4275
+ };
4276
+ function createState(prev, force = !1) {
4277
+ if (prev && (shouldUpdate == null ? void 0 : shouldUpdate()) === !1)
4278
+ return prev;
4279
+ let themeManager2 = parentManager, state2;
4280
+ if ((0, import_ThemeManager.getHasThemeUpdatingProps)(props)) {
4281
+ let getNewThemeManager = () => new import_ThemeManager.ThemeManager(props, root ? "root" : parentManager);
4282
+ if (prev != null && prev.themeManager) {
4283
+ themeManager2 = prev.themeManager;
4284
+ let forceChange = !!(keys != null && keys.length), next = themeManager2.getState(props, parentManager), nextState = getShouldUpdateTheme(
4285
+ themeManager2,
4286
+ next,
4287
+ prev.state,
4288
+ forceChange
4289
+ );
4290
+ nextState ? (state2 = nextState, !prev.isNewTheme || !import_constants2.isWeb ? themeManager2 = getNewThemeManager() : themeManager2.updateState(nextState)) : prev.isNewTheme && parentManager && !next && (themeManager2 = parentManager);
4291
+ } else
4292
+ themeManager2 = getNewThemeManager(), state2 = { ...themeManager2.state };
4293
+ }
4294
+ let isNewTheme2 = !!(themeManager2 !== parentManager || props.inverse), mounted2 = props.inverse ? root || (prev == null ? void 0 : prev.mounted) : !0;
4295
+ if (state2 || (isNewTheme2 ? state2 = themeManager2.state : (state2 = parentManager.state, themeManager2 = parentManager)), !force && state2.name === (prev == null ? void 0 : prev.state.name))
4296
+ return prev;
4297
+ let response = {
4298
+ state: state2,
4299
+ themeManager: themeManager2,
4300
+ isNewTheme: isNewTheme2,
4301
+ mounted: mounted2
4302
+ };
4303
+ if (process.env.NODE_ENV === "development" && props.debug && import_constants2.isClient) {
4304
+ console.groupCollapsed(` \u{1F537} ${themeManager2.id} useChangeThemeEffect createState`);
4305
+ let parentState = { ...parentManager == null ? void 0 : parentManager.state }, parentId = parentManager == null ? void 0 : parentManager.id, themeManagerState = { ...themeManager2.state };
4306
+ console.log({
4307
+ props,
4308
+ parentState,
4309
+ parentId,
4310
+ themeManager: themeManager2,
4311
+ prev,
4312
+ response,
4313
+ themeManagerState
4314
+ }), console.groupEnd();
4315
+ }
4316
+ return response;
4317
+ }
4318
+ };
4332
4319
  }
4333
4320
  });
4334
4321
 
@@ -4541,7 +4528,7 @@ var require_Slot_native = __commonJS({
4541
4528
  Slottable: () => Slottable
4542
4529
  });
4543
4530
  module2.exports = __toCommonJS2(Slot_exports);
4544
- var import_compose_refs = require_index_native6(), import_constants2 = require_index_native2(), import_helpers = require_index_native4(), import_react = require("react"), import_jsx_runtime = require("react/jsx-runtime"), Slot = (0, import_react.forwardRef)(function(props, forwardedRef) {
4531
+ var import_compose_refs = require_index_native5(), import_constants2 = require_index_native2(), import_helpers = require_index_native4(), import_react = require("react"), import_jsx_runtime = require("react/jsx-runtime"), Slot = (0, import_react.forwardRef)(function(props, forwardedRef) {
4545
4532
  let { children, ...slotProps } = props;
4546
4533
  if ((0, import_react.isValidElement)(children)) {
4547
4534
  let mergedProps = mergeSlotProps(children, slotProps);
@@ -4602,7 +4589,7 @@ var require_createComponent_native = __commonJS({
4602
4589
  spacedChildren: () => spacedChildren
4603
4590
  });
4604
4591
  module2.exports = __toCommonJS2(createComponent_exports);
4605
- var import_compose_refs = require_index_native6(), import_constants2 = require_index_native2(), import_helpers = require_index_native4(), import_use_did_finish_ssr = require_index_native7(), 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, debugKeyListeners, startVisualizer, mouseUps = /* @__PURE__ */ new Set();
4592
+ var import_compose_refs = require_index_native5(), import_constants2 = require_index_native2(), import_helpers = require_index_native4(), 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, debugKeyListeners, startVisualizer, mouseUps = /* @__PURE__ */ new Set();
4606
4593
  if (typeof document < "u") {
4607
4594
  let cancelTouches = () => {
4608
4595
  mouseUps.forEach((x) => x()), mouseUps.clear();
@@ -4781,13 +4768,13 @@ var require_createComponent_native = __commonJS({
4781
4768
  stateRef
4782
4769
  );
4783
4770
  process.env.NODE_ENV === "development" && time && time`media`, (0, import_createVariable.setDidGetVariableValue)(!1);
4784
- let resolveVariablesAs = (
4771
+ let resolveValues = (
4785
4772
  // if HOC + mounted + has animation prop, resolve as value so it passes non-variable to child
4786
4773
  isAnimated && !supportsCSSVars || isHOC && state.unmounted == !1 && hasAnimationProp ? "value" : "auto"
4787
4774
  ), keepStyleSSR = willBeAnimated && (animationsConfig == null ? void 0 : animationsConfig.keepStyleSSR), styleProps = {
4788
4775
  mediaState: mediaState2,
4789
4776
  noClassNames,
4790
- resolveVariablesAs,
4777
+ resolveValues,
4791
4778
  isExiting,
4792
4779
  isAnimated,
4793
4780
  keepStyleSSR
@@ -4845,15 +4832,15 @@ var require_createComponent_native = __commonJS({
4845
4832
  let {
4846
4833
  asChild,
4847
4834
  children,
4835
+ themeShallow,
4836
+ spaceDirection: _spaceDirection,
4837
+ disabled: disabledProp,
4848
4838
  onPress,
4849
4839
  onLongPress,
4850
4840
  onPressIn,
4851
4841
  onPressOut,
4852
4842
  onHoverIn,
4853
4843
  onHoverOut,
4854
- themeShallow,
4855
- spaceDirection: _spaceDirection,
4856
- disabled: disabledProp,
4857
4844
  onMouseUp,
4858
4845
  onMouseDown,
4859
4846
  onMouseEnter,
@@ -4941,24 +4928,24 @@ If you meant to do this, you can disable this warning - either change untilMeasu
4941
4928
  fontFamily && fontFamily[0] === "$" && (fontFamily = fontFamily.slice(1));
4942
4929
  let fontFamilyClassName = fontFamily ? `font_${fontFamily}` : "", style = avoidAnimationStyle ? splitStyles.style : animationStyles || splitStyles.style, className;
4943
4930
  viewProps.style = style;
4944
- 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);
4931
+ let runtimePressStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.pressStyle), attachPress = !!(groupName || runtimePressStyle || onPress || onPressOut || onPressIn || onLongPress || onClick), needsHoverState = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.hoverStyle) || onHoverIn || onHoverOut, isHoverable = import_constants2.isWeb && !!(groupName || needsHoverState || onMouseEnter || onMouseLeave), handlesPressEvents = !(import_constants2.isWeb || asChild), shouldAttach = !!(attachPress || isHoverable || noClassNames && "pressStyle" in props || import_constants2.isWeb && noClassNames && "hoverStyle" in props);
4945
4932
  process.env.NODE_ENV === "development" && time && time`events-setup`;
4946
- let events = shouldAttach && !isDisabled && !asChild ? {
4933
+ let events = shouldAttach && !isDisabled && !props.asChild ? {
4947
4934
  onPressOut: attachPress ? (e) => {
4948
4935
  unPress(), onPressOut == null || onPressOut(e), onMouseUp == null || onMouseUp(e);
4949
4936
  } : void 0,
4950
4937
  ...(isHoverable || attachPress) && {
4951
4938
  onMouseEnter: (e) => {
4952
4939
  let next = {};
4953
- next.hover = !0, state.pressIn && (next.press = !0), setStateShallow(next), onHoverIn == null || onHoverIn(e), onMouseEnter == null || onMouseEnter(e);
4940
+ needsHoverState && (next.hover = !0), runtimePressStyle && state.pressIn && (next.press = !0), setStateShallow(next), onHoverIn == null || onHoverIn(e), onMouseEnter == null || onMouseEnter(e);
4954
4941
  },
4955
4942
  onMouseLeave: (e) => {
4956
4943
  let next = {};
4957
- mouseUps.add(unPress), next.hover = !1, state.pressIn && (next.press = !1, next.pressIn = !1), setStateShallow(next), onHoverOut == null || onHoverOut(e), onMouseLeave == null || onMouseLeave(e);
4944
+ mouseUps.add(unPress), needsHoverState && (next.hover = !1), runtimePressStyle && state.pressIn && (next.press = !1, next.pressIn = !1), setStateShallow(next), onHoverOut == null || onHoverOut(e), onMouseLeave == null || onMouseLeave(e);
4958
4945
  }
4959
4946
  },
4960
4947
  onPressIn: attachPress ? (e) => {
4961
- setStateShallow({
4948
+ runtimePressStyle && setStateShallow({
4962
4949
  press: !0,
4963
4950
  pressIn: !0
4964
4951
  }), onPressIn == null || onPressIn(e), onMouseDown == null || onMouseDown(e), import_constants2.isWeb && mouseUps.add(unPress);
@@ -4970,7 +4957,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
4970
4957
  unPress(), onLongPress == null || onLongPress(e);
4971
4958
  } : void 0
4972
4959
  } : null;
4973
- events && Object.assign(events, {
4960
+ events && !asChild && Object.assign(events, {
4974
4961
  cancelable: !viewProps.rejectResponderTermination,
4975
4962
  disabled: isDisabled,
4976
4963
  hitSlop: viewProps.hitSlop,
@@ -4990,12 +4977,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
4990
4977
  isZStack,
4991
4978
  debug: debugProp
4992
4979
  });
4993
- asChild && (elementType = import_Slot.Slot, Object.assign(viewProps, {
4994
- onPress,
4995
- onLongPress,
4996
- onPressIn,
4997
- onPressOut
4998
- })), process.env.NODE_ENV === "development" && time && time`spaced-as-child`, // in test mode disable perf unwrapping so react-testing-library finds Text properly
4980
+ asChild && (elementType = import_Slot.Slot), process.env.NODE_ENV === "development" && time && time`spaced-as-child`, // in test mode disable perf unwrapping so react-testing-library finds Text properly
4999
4981
  process.env.NODE_ENV !== "test" && (elementType === BaseText || elementType === BaseView) ? (viewProps.children = content, content = elementType.render(viewProps, viewProps.ref)) : content = (0, import_react.createElement)(elementType, viewProps, content), process.env.NODE_ENV === "development" && time && time`create-element`;
5000
4982
  let subGroupContext = (0, import_react.useMemo)(() => {
5001
4983
  if (groupName)
@@ -6117,49 +6099,6 @@ var require_useThemeName_native = __commonJS({
6117
6099
  }
6118
6100
  });
6119
6101
 
6120
- // ../web/dist/cjs/hooks/useStyle.native.js
6121
- var require_useStyle_native = __commonJS({
6122
- "../web/dist/cjs/hooks/useStyle.native.js"(exports, module2) {
6123
- "use strict";
6124
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
6125
- for (var name in all)
6126
- __defProp2(target, name, { get: all[name], enumerable: !0 });
6127
- }, __copyProps2 = (to, from, except, desc) => {
6128
- if (from && typeof from == "object" || typeof from == "function")
6129
- for (let key of __getOwnPropNames2(from))
6130
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
6131
- return to;
6132
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), useStyle_exports = {};
6133
- __export2(useStyle_exports, {
6134
- useStyle: () => useStyle
6135
- });
6136
- module2.exports = __toCommonJS2(useStyle_exports);
6137
- 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();
6138
- function useStyle(base, style, options) {
6139
- 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)(
6140
- style,
6141
- base.staticConfig,
6142
- themeState.state.theme,
6143
- themeState.state.name,
6144
- import_defaultComponentState.defaultComponentState,
6145
- {
6146
- ...options,
6147
- mediaState: media,
6148
- resolveVariablesAs: "auto"
6149
- },
6150
- null,
6151
- componentContext,
6152
- isText ? "span" : "div",
6153
- options == null ? void 0 : options.debug
6154
- );
6155
- return {
6156
- style: Object.keys(out.style).length ? out.style : null,
6157
- classNames: out.classNames
6158
- };
6159
- }
6160
- }
6161
- });
6162
-
6163
6102
  // ../web/dist/cjs/hooks/useAnimationDriver.native.js
6164
6103
  var require_useAnimationDriver_native = __commonJS({
6165
6104
  "../web/dist/cjs/hooks/useAnimationDriver.native.js"(exports, module2) {
@@ -6198,13 +6137,13 @@ var require_useIsTouchDevice_native = __commonJS({
6198
6137
  useIsTouchDevice: () => useIsTouchDevice
6199
6138
  });
6200
6139
  module2.exports = __toCommonJS2(useIsTouchDevice_exports);
6201
- var import_constants2 = require_index_native2(), import_use_did_finish_ssr = require_index_native7(), useIsTouchDevice = () => import_constants2.isWeb ? (0, import_use_did_finish_ssr.useDidFinishSSR)() ? import_constants2.isTouchable : !1 : !0;
6140
+ var import_constants2 = require_index_native2(), import_use_did_finish_ssr = require_index_native6(), useIsTouchDevice = () => import_constants2.isWeb ? (0, import_use_did_finish_ssr.useDidFinishSSR)() ? import_constants2.isTouchable : !1 : !0;
6202
6141
  }
6203
6142
  });
6204
6143
 
6205
- // ../web/dist/cjs/hooks/useProps.native.js
6206
- var require_useProps_native = __commonJS({
6207
- "../web/dist/cjs/hooks/useProps.native.js"(exports, module2) {
6144
+ // ../web/dist/cjs/views/Stack.native.js
6145
+ var require_Stack_native = __commonJS({
6146
+ "../web/dist/cjs/views/Stack.native.js"(exports, module2) {
6208
6147
  "use strict";
6209
6148
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
6210
6149
  for (var name in all)
@@ -6214,24 +6153,22 @@ var require_useProps_native = __commonJS({
6214
6153
  for (let key of __getOwnPropNames2(from))
6215
6154
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
6216
6155
  return to;
6217
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), useProps_exports = {};
6218
- __export2(useProps_exports, {
6219
- useProps: () => useProps
6156
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), Stack_exports = {};
6157
+ __export2(Stack_exports, {
6158
+ Stack: () => Stack2
6159
+ });
6160
+ module2.exports = __toCommonJS2(Stack_exports);
6161
+ var import_helpers = require_index_native4(), import_constants2 = require_constants_native(), import_createComponent = require_createComponent_native(), Stack2 = (0, import_createComponent.createComponent)({
6162
+ acceptsClassName: !0,
6163
+ defaultProps: import_constants2.stackDefaultStyles,
6164
+ validStyles: import_helpers.validStyles
6220
6165
  });
6221
- module2.exports = __toCommonJS2(useProps_exports);
6222
- var import_useMedia = require_useMedia_native();
6223
- function useProps(props, opts) {
6224
- return (0, import_useMedia.useMediaPropsActive)(props, {
6225
- expandShorthands: !(opts != null && opts.disableExpandShorthands),
6226
- resolveValues: opts == null ? void 0 : opts.resolveValues
6227
- });
6228
- }
6229
6166
  }
6230
6167
  });
6231
6168
 
6232
- // ../web/dist/cjs/views/Stack.native.js
6233
- var require_Stack_native = __commonJS({
6234
- "../web/dist/cjs/views/Stack.native.js"(exports, module2) {
6169
+ // ../web/dist/cjs/hooks/useProps.native.js
6170
+ var require_useProps_native = __commonJS({
6171
+ "../web/dist/cjs/hooks/useProps.native.js"(exports, module2) {
6235
6172
  "use strict";
6236
6173
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
6237
6174
  for (var name in all)
@@ -6241,16 +6178,50 @@ var require_Stack_native = __commonJS({
6241
6178
  for (let key of __getOwnPropNames2(from))
6242
6179
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
6243
6180
  return to;
6244
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), Stack_exports = {};
6245
- __export2(Stack_exports, {
6246
- Stack: () => Stack2
6247
- });
6248
- module2.exports = __toCommonJS2(Stack_exports);
6249
- var import_helpers = require_index_native4(), import_constants2 = require_constants_native(), import_createComponent = require_createComponent_native(), Stack2 = (0, import_createComponent.createComponent)({
6250
- acceptsClassName: !0,
6251
- defaultProps: import_constants2.stackDefaultStyles,
6252
- validStyles: import_helpers.validStyles
6181
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), useProps_exports = {};
6182
+ __export2(useProps_exports, {
6183
+ useProps: () => useProps,
6184
+ usePropsAndStyle: () => usePropsAndStyle,
6185
+ useStyle: () => useStyle
6253
6186
  });
6187
+ module2.exports = __toCommonJS2(useProps_exports);
6188
+ var import_react = require("react"), import_ComponentContext = require_ComponentContext_native(), import_defaultComponentState = require_defaultComponentState_native(), import_getSplitStyles = require_getSplitStyles_native(), import_Stack = require_Stack_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native();
6189
+ function useProps(props, opts) {
6190
+ let [propsOut, styleOut] = usePropsAndStyle(props, {
6191
+ ...opts,
6192
+ noExpand: !0,
6193
+ noNormalize: !0,
6194
+ resolveValues: "none"
6195
+ });
6196
+ return {
6197
+ ...propsOut,
6198
+ ...styleOut
6199
+ };
6200
+ }
6201
+ function useStyle(props, opts) {
6202
+ return usePropsAndStyle(props, opts)[1];
6203
+ }
6204
+ function usePropsAndStyle(props, opts) {
6205
+ var _a;
6206
+ let staticConfig = ((_a = opts == null ? void 0 : opts.forComponent) == null ? void 0 : _a.staticConfig) ?? import_Stack.Stack.staticConfig, [themeState, theme] = (0, import_useTheme.useThemeWithState)({
6207
+ componentName: staticConfig.componentName
6208
+ }), componentContext = (0, import_react.useContext)(import_ComponentContext.ComponentContext), media = (0, import_useMedia.useMedia)(), splitStyles = (0, import_getSplitStyles.useSplitStyles)(
6209
+ props,
6210
+ staticConfig,
6211
+ theme,
6212
+ themeState.state.name,
6213
+ import_defaultComponentState.defaultComponentStateMounted,
6214
+ {
6215
+ isAnimated: !1,
6216
+ mediaState: media,
6217
+ noClassNames: !0,
6218
+ ...opts
6219
+ },
6220
+ null,
6221
+ componentContext
6222
+ );
6223
+ return [splitStyles.viewProps, splitStyles.style];
6224
+ }
6254
6225
  }
6255
6226
  });
6256
6227
 
@@ -6564,8 +6535,7 @@ var require_index_native9 = __commonJS({
6564
6535
  mediaState: () => import_useMedia.mediaState,
6565
6536
  setupDev: () => import_config.setupDev,
6566
6537
  updateConfig: () => import_config.updateConfig,
6567
- useMedia: () => import_useMedia.useMedia,
6568
- useMediaPropsActive: () => import_useMedia.useMediaPropsActive
6538
+ useMedia: () => import_useMedia.useMedia
6569
6539
  });
6570
6540
  module2.exports = __toCommonJS2(src_exports2);
6571
6541
  __reExport2(src_exports2, require_Tamagui_native(), module2.exports);
@@ -6609,7 +6579,6 @@ var require_index_native9 = __commonJS({
6609
6579
  var import_useMedia = require_useMedia_native();
6610
6580
  __reExport2(src_exports2, require_useTheme_native(), module2.exports);
6611
6581
  __reExport2(src_exports2, require_useThemeName_native(), module2.exports);
6612
- __reExport2(src_exports2, require_useStyle_native(), module2.exports);
6613
6582
  __reExport2(src_exports2, require_useAnimationDriver_native(), module2.exports);
6614
6583
  __reExport2(src_exports2, require_useIsTouchDevice_native(), module2.exports);
6615
6584
  __reExport2(src_exports2, require_useProps_native(), module2.exports);
@@ -6622,9 +6591,9 @@ var require_index_native9 = __commonJS({
6622
6591
  __reExport2(src_exports2, require_FontLanguage_native(), module2.exports);
6623
6592
  __reExport2(src_exports2, require_TamaguiProvider_native(), module2.exports);
6624
6593
  __reExport2(src_exports2, require_AnimationDriverProvider_native(), module2.exports);
6625
- __reExport2(src_exports2, require_index_native7(), module2.exports);
6626
- __reExport2(src_exports2, require_index_native8(), module2.exports);
6627
6594
  __reExport2(src_exports2, require_index_native6(), module2.exports);
6595
+ __reExport2(src_exports2, require_index_native8(), module2.exports);
6596
+ __reExport2(src_exports2, require_index_native5(), module2.exports);
6628
6597
  __reExport2(src_exports2, require_index_native4(), module2.exports);
6629
6598
  __reExport2(src_exports2, require_index_native2(), module2.exports);
6630
6599
  __reExport2(src_exports2, require_setupHooks_native(), module2.exports);