tamagui 1.85.5 → 1.85.7

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.
@@ -1304,7 +1304,7 @@ var require_insertStyleRule_native = __commonJS({
1304
1304
  }
1305
1305
  return scannedCache.set(sheet2, cacheKey), dedupedThemes;
1306
1306
  }
1307
- var colorVarToVal, rootComputedStyle = null;
1307
+ var colorVarToVal, rootComputedStyle = null, schemes = { dark: !0, light: !0 };
1308
1308
  function addThemesFromCSS(cssStyleRule, tokens) {
1309
1309
  let selectors = cssStyleRule.selectorText.split(",");
1310
1310
  if (!selectors.length)
@@ -1336,17 +1336,20 @@ var require_insertStyleRule_native = __commonJS({
1336
1336
  !0
1337
1337
  );
1338
1338
  }
1339
- let dedupedEntry = {
1340
- names: [],
1339
+ return {
1340
+ names: [
1341
+ ...new Set(
1342
+ selectors.map((selector) => {
1343
+ let parts = selector.replace(/(.t_|:root)/g, "").trim().split(" "), secondToLast = parts[parts.length - 2] || "", scheme = secondToLast.includes("dark") ? "dark" : secondToLast.includes("light") ? "light" : "", name = (() => {
1344
+ let _ = parts[parts.length - 1];
1345
+ return scheme && _.startsWith(scheme) && (_ = _.slice(scheme.length + 1)), _;
1346
+ })();
1347
+ return scheme === name || schemes[name] ? scheme : `${scheme}${scheme && name ? "_" : ""}${name}`;
1348
+ })
1349
+ )
1350
+ ],
1341
1351
  theme: values
1342
1352
  };
1343
- for (let selector of selectors) {
1344
- let di = selector.indexOf("t_dark"), li = selector.indexOf("t_light"), scheme = di && li ? di < li ? "dark" : "light" : "", name = selector.slice(selector.lastIndexOf(".t_") + 3);
1345
- name.startsWith(scheme) && (name = name.slice(scheme.length + 1)), scheme === name && (scheme = "");
1346
- let themeName = `${scheme}${scheme && name ? "_" : ""}${name}`;
1347
- dedupedEntry.names.includes(themeName) || dedupedEntry.names.push(themeName);
1348
- }
1349
- return dedupedEntry;
1350
1353
  }
1351
1354
  function getTamaguiSelector(rule, collectThemes = !1) {
1352
1355
  if (rule instanceof CSSStyleRule) {
@@ -1656,65 +1659,11 @@ var require_useMedia_native = __commonJS({
1656
1659
  }
1657
1660
  });
1658
1661
 
1659
- // ../web/dist/cjs/Tamagui.native.js
1660
- var require_Tamagui_native = __commonJS({
1661
- "../web/dist/cjs/Tamagui.native.js"(exports2, module2) {
1662
- "use strict";
1663
- var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
1664
- for (var name in all)
1665
- __defProp2(target, name, { get: all[name], enumerable: !0 });
1666
- }, __copyProps2 = (to, from, except, desc) => {
1667
- if (from && typeof from == "object" || typeof from == "function")
1668
- for (let key of __getOwnPropNames2(from))
1669
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1670
- return to;
1671
- }, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
1672
- // If the importer is in node compatibility mode or this is not an ESM
1673
- // file that has been converted to a CommonJS file using a Babel-
1674
- // compatible transform (i.e. "__esModule" has not been set), then set
1675
- // "default" to the CommonJS "module.exports" for node compatibility.
1676
- isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: !0 }) : target,
1677
- mod
1678
- )), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), Tamagui_exports = {};
1679
- __export2(Tamagui_exports, {
1680
- Tamagui: () => Tamagui,
1681
- getValueFromIdentifier: () => getValueFromIdentifier,
1682
- setIdentifierValue: () => setIdentifierValue
1683
- });
1684
- module2.exports = __toCommonJS2(Tamagui_exports);
1685
- var Helpers = __toESM2(require_index_native7()), import_config = require_config_native(), import_insertStyleRule = require_insertStyleRule_native(), import_useMedia = require_useMedia_native(), TamaguiManager = class {
1686
- constructor() {
1687
- this.Helpers = Helpers;
1688
- }
1689
- get mediaState() {
1690
- return { ...import_useMedia.mediaState };
1691
- }
1692
- get config() {
1693
- return (0, import_config.getConfig)();
1694
- }
1695
- get insertedRules() {
1696
- return (0, import_insertStyleRule.getAllRules)();
1697
- }
1698
- get allSelectors() {
1699
- return (0, import_insertStyleRule.getAllSelectors)();
1700
- }
1701
- get allTransforms() {
1702
- return (0, import_insertStyleRule.getAllTransforms)();
1703
- }
1704
- get identifierToValue() {
1705
- return identifierToValue;
1706
- }
1707
- }, Tamagui = new TamaguiManager(), identifierToValue = /* @__PURE__ */ new Map(), getValueFromIdentifier = (identifier) => identifierToValue.get(identifier), setIdentifierValue = (identifier, value) => {
1708
- identifierToValue.set(identifier, value);
1709
- };
1710
- }
1711
- });
1712
-
1713
- // ../compose-refs/dist/cjs/compose-refs.native.js
1714
- var require_compose_refs_native = __commonJS({
1715
- "../compose-refs/dist/cjs/compose-refs.native.js"(exports2, module2) {
1662
+ // ../web/dist/cjs/helpers/createShallowSetState.native.js
1663
+ var require_createShallowSetState_native = __commonJS({
1664
+ "../web/dist/cjs/helpers/createShallowSetState.native.js"(exports2, module2) {
1716
1665
  "use strict";
1717
- var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
1666
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
1718
1667
  for (var name in all)
1719
1668
  __defProp2(target, name, { get: all[name], enumerable: !0 });
1720
1669
  }, __copyProps2 = (to, from, except, desc) => {
@@ -1722,47 +1671,28 @@ var require_compose_refs_native = __commonJS({
1722
1671
  for (let key of __getOwnPropNames2(from))
1723
1672
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1724
1673
  return to;
1725
- }, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
1726
- // If the importer is in node compatibility mode or this is not an ESM
1727
- // file that has been converted to a CommonJS file using a Babel-
1728
- // compatible transform (i.e. "__esModule" has not been set), then set
1729
- // "default" to the CommonJS "module.exports" for node compatibility.
1730
- isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: !0 }) : target,
1731
- mod
1732
- )), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), compose_refs_exports = {};
1733
- __export2(compose_refs_exports, {
1734
- composeRefs: () => composeRefs,
1735
- useComposedRefs: () => useComposedRefs
1674
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createShallowSetState_exports = {};
1675
+ __export2(createShallowSetState_exports, {
1676
+ createShallowSetState: () => createShallowSetState,
1677
+ isEqualShallow: () => isEqualShallow,
1678
+ mergeIfNotShallowEqual: () => mergeIfNotShallowEqual
1736
1679
  });
1737
- module2.exports = __toCommonJS2(compose_refs_exports);
1738
- var React2 = __toESM2(require("react"));
1739
- function setRef(ref, value) {
1740
- typeof ref == "function" ? ref(value) : ref && (ref.current = value);
1680
+ module2.exports = __toCommonJS2(createShallowSetState_exports);
1681
+ function createShallowSetState(setter, debug) {
1682
+ return (next) => setter((prev) => mergeIfNotShallowEqual(prev, next, debug));
1741
1683
  }
1742
- function composeRefs(...refs) {
1743
- return (node) => refs.forEach((ref) => setRef(ref, node));
1684
+ function mergeIfNotShallowEqual(prev, next, debug) {
1685
+ return isEqualShallow(prev, next) ? prev : { ...prev, ...next };
1744
1686
  }
1745
- function useComposedRefs(...refs) {
1746
- return React2.useCallback(composeRefs(...refs), refs);
1687
+ function isEqualShallow(prev, next) {
1688
+ for (let key in next)
1689
+ if (prev[key] !== next[key])
1690
+ return !1;
1691
+ return !0;
1747
1692
  }
1748
1693
  }
1749
1694
  });
1750
1695
 
1751
- // ../compose-refs/dist/cjs/index.native.js
1752
- var require_index_native10 = __commonJS({
1753
- "../compose-refs/dist/cjs/index.native.js"(exports2, module2) {
1754
- "use strict";
1755
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __copyProps2 = (to, from, except, desc) => {
1756
- if (from && typeof from == "object" || typeof from == "function")
1757
- for (let key of __getOwnPropNames2(from))
1758
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1759
- return to;
1760
- }, __reExport2 = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default")), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), src_exports2 = {};
1761
- module2.exports = __toCommonJS2(src_exports2);
1762
- __reExport2(src_exports2, require_compose_refs_native(), module2.exports);
1763
- }
1764
- });
1765
-
1766
1696
  // ../web/dist/cjs/constants/constants.native.js
1767
1697
  var require_constants_native2 = __commonJS({
1768
1698
  "../web/dist/cjs/constants/constants.native.js"(exports2, module2) {
@@ -1797,9 +1727,9 @@ var require_constants_native2 = __commonJS({
1797
1727
  }
1798
1728
  });
1799
1729
 
1800
- // ../web/dist/cjs/helpers/objectIdentityKey.native.js
1801
- var require_objectIdentityKey_native = __commonJS({
1802
- "../web/dist/cjs/helpers/objectIdentityKey.native.js"(exports2, module2) {
1730
+ // ../web/dist/cjs/helpers/ThemeManager.native.js
1731
+ var require_ThemeManager_native = __commonJS({
1732
+ "../web/dist/cjs/helpers/ThemeManager.native.js"(exports2, module2) {
1803
1733
  "use strict";
1804
1734
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
1805
1735
  for (var name in all)
@@ -1809,177 +1739,149 @@ var require_objectIdentityKey_native = __commonJS({
1809
1739
  for (let key of __getOwnPropNames2(from))
1810
1740
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1811
1741
  return to;
1812
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), objectIdentityKey_exports = {};
1813
- __export2(objectIdentityKey_exports, {
1814
- objectIdentityKey: () => objectIdentityKey
1742
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ThemeManager_exports = {};
1743
+ __export2(ThemeManager_exports, {
1744
+ ThemeManager: () => ThemeManager,
1745
+ getHasThemeUpdatingProps: () => getHasThemeUpdatingProps,
1746
+ getManagers: () => getManagers
1815
1747
  });
1816
- module2.exports = __toCommonJS2(objectIdentityKey_exports);
1817
- function objectIdentityKey(obj) {
1818
- let k = "";
1819
- for (let key in obj) {
1820
- k += key;
1821
- let arg = obj[key], type = typeof arg;
1822
- if (!arg || type !== "object" && type !== "function")
1823
- k += type + arg;
1824
- else if (cache.has(arg))
1825
- k += cache.get(arg);
1826
- else {
1827
- let v = Math.random();
1828
- cache.set(arg, v), k += v;
1829
- }
1830
- }
1831
- return k;
1748
+ module2.exports = __toCommonJS2(ThemeManager_exports);
1749
+ var import_constants4 = require_index_native(), import_config = require_config_native(), import_constants22 = require_constants_native2(), emptyState = { name: "" };
1750
+ function getHasThemeUpdatingProps(props) {
1751
+ return !!(props.name || props.componentName || props.inverse || props.reset);
1832
1752
  }
1833
- var cache = /* @__PURE__ */ new WeakMap();
1834
- }
1835
- });
1836
-
1837
- // ../web/dist/cjs/helpers/createStyledContext.native.js
1838
- var require_createStyledContext_native = __commonJS({
1839
- "../web/dist/cjs/helpers/createStyledContext.native.js"(exports2, module2) {
1840
- "use strict";
1841
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
1842
- for (var name in all)
1843
- __defProp2(target, name, { get: all[name], enumerable: !0 });
1844
- }, __copyProps2 = (to, from, except, desc) => {
1845
- if (from && typeof from == "object" || typeof from == "function")
1846
- for (let key of __getOwnPropNames2(from))
1847
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1848
- return to;
1849
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createStyledContext_exports = {};
1850
- __export2(createStyledContext_exports, {
1851
- createStyledContext: () => createStyledContext2
1852
- });
1853
- module2.exports = __toCommonJS2(createStyledContext_exports);
1854
- var import_react2 = require("react"), import_objectIdentityKey = require_objectIdentityKey_native(), import_jsx_runtime6 = require("react/jsx-runtime");
1855
- function createStyledContext2(defaultValues) {
1856
- let OGContext = (0, import_react2.createContext)(defaultValues), OGProvider2 = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map(), Provider = ({
1857
- children,
1858
- scope,
1859
- ...values
1860
- }) => {
1861
- let next = (0, import_react2.useMemo)(() => ({
1862
- // this ! is a workaround for ts error
1863
- ...defaultValues,
1864
- ...values
1865
- }), [(0, import_objectIdentityKey.objectIdentityKey)(values)]), Provider2 = OGProvider2;
1866
- if (scope) {
1867
- let ScopedContext = scopedContexts.get(scope);
1868
- ScopedContext || (ScopedContext = (0, import_react2.createContext)(defaultValues), scopedContexts.set(scope, ScopedContext)), Provider2 = ScopedContext.Provider;
1753
+ var uid = 0, ThemeManager = class {
1754
+ constructor(props = {}, parentManager) {
1755
+ if (this.props = props, this.id = 0, this.themeListeners = /* @__PURE__ */ new Set(), this.parentManager = null, this.state = emptyState, this._allKeys = null, uid = (uid + 1) % Number.MAX_VALUE, this.id = uid, parentManager === "root") {
1756
+ this.updateStateFromProps(props, !1);
1757
+ return;
1869
1758
  }
1870
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Provider2, { value: next, children });
1871
- }, useStyledContext = (scope) => {
1872
- let context = scope ? scopedContexts.get(scope) : OGContext;
1873
- return (0, import_react2.useContext)(context);
1874
- };
1875
- return Context.Provider = Provider, Context.props = defaultValues, Context.context = OGContext, Context.useStyledContext = useStyledContext, Context;
1876
- }
1877
- }
1878
- });
1879
-
1880
- // ../web/dist/cjs/contexts/ComponentContext.native.js
1881
- var require_ComponentContext_native = __commonJS({
1882
- "../web/dist/cjs/contexts/ComponentContext.native.js"(exports2, module2) {
1883
- "use strict";
1884
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
1885
- for (var name in all)
1886
- __defProp2(target, name, { get: all[name], enumerable: !0 });
1887
- }, __copyProps2 = (to, from, except, desc) => {
1888
- if (from && typeof from == "object" || typeof from == "function")
1889
- for (let key of __getOwnPropNames2(from))
1890
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1891
- return to;
1892
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ComponentContext_exports = {};
1893
- __export2(ComponentContext_exports, {
1894
- ComponentContext: () => ComponentContext2
1895
- });
1896
- module2.exports = __toCommonJS2(ComponentContext_exports);
1897
- var import_createStyledContext = require_createStyledContext_native(), ComponentContext2 = (0, import_createStyledContext.createStyledContext)({
1898
- disableSSR: void 0,
1899
- inText: !1,
1900
- language: null,
1901
- animationDriver: null,
1902
- groups: {
1903
- emit: null,
1904
- subscribe: null,
1905
- state: {}
1759
+ if (!parentManager)
1760
+ throw new Error(
1761
+ "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."
1762
+ );
1763
+ if (this.parentManager = parentManager, !this.updateStateFromProps(props, !1))
1764
+ return parentManager;
1906
1765
  }
1907
- });
1908
- }
1909
- });
1910
-
1911
- // ../web/dist/cjs/defaultComponentState.native.js
1912
- var require_defaultComponentState_native = __commonJS({
1913
- "../web/dist/cjs/defaultComponentState.native.js"(exports2, module2) {
1914
- "use strict";
1915
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
1916
- for (var name in all)
1917
- __defProp2(target, name, { get: all[name], enumerable: !0 });
1918
- }, __copyProps2 = (to, from, except, desc) => {
1919
- if (from && typeof from == "object" || typeof from == "function")
1920
- for (let key of __getOwnPropNames2(from))
1921
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1922
- return to;
1923
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), defaultComponentState_exports = {};
1924
- __export2(defaultComponentState_exports, {
1925
- defaultComponentState: () => defaultComponentState,
1926
- defaultComponentStateMounted: () => defaultComponentStateMounted,
1927
- defaultComponentStateShouldEnter: () => defaultComponentStateShouldEnter
1928
- });
1929
- module2.exports = __toCommonJS2(defaultComponentState_exports);
1930
- var defaultComponentState = {
1931
- hover: !1,
1932
- press: !1,
1933
- pressIn: !1,
1934
- focus: !1,
1935
- unmounted: !0
1936
- }, defaultComponentStateMounted = {
1937
- ...defaultComponentState,
1938
- unmounted: !1
1939
- }, defaultComponentStateShouldEnter = {
1940
- ...defaultComponentState,
1941
- unmounted: "should-enter"
1942
- };
1943
- }
1944
- });
1945
-
1946
- // ../web/dist/cjs/helpers/createShallowSetState.native.js
1947
- var require_createShallowSetState_native = __commonJS({
1948
- "../web/dist/cjs/helpers/createShallowSetState.native.js"(exports2, module2) {
1949
- "use strict";
1950
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
1951
- for (var name in all)
1952
- __defProp2(target, name, { get: all[name], enumerable: !0 });
1953
- }, __copyProps2 = (to, from, except, desc) => {
1954
- if (from && typeof from == "object" || typeof from == "function")
1955
- for (let key of __getOwnPropNames2(from))
1956
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1957
- return to;
1958
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createShallowSetState_exports = {};
1959
- __export2(createShallowSetState_exports, {
1960
- createShallowSetState: () => createShallowSetState,
1961
- isEqualShallow: () => isEqualShallow,
1962
- mergeIfNotShallowEqual: () => mergeIfNotShallowEqual
1963
- });
1964
- module2.exports = __toCommonJS2(createShallowSetState_exports);
1965
- function createShallowSetState(setter, debug) {
1966
- return (next) => setter((prev) => mergeIfNotShallowEqual(prev, next, debug));
1967
- }
1968
- function mergeIfNotShallowEqual(prev, next, debug) {
1969
- return isEqualShallow(prev, next) ? prev : { ...prev, ...next };
1766
+ updateStateFromProps(props = this.props || {}, shouldNotify = !0) {
1767
+ if (this.props = props, props.forceTheme)
1768
+ return this.state.theme = props.forceTheme, this.state.name = props.name || "", this.updateState(this.state, !0), this.state;
1769
+ let nextState = this.getStateIfChanged(props);
1770
+ if (nextState)
1771
+ return this.updateState(nextState, shouldNotify), nextState;
1772
+ }
1773
+ updateState(nextState, shouldNotify = !0) {
1774
+ this.state = nextState, this._allKeys = null, this._numChangeEventsSent ??= 0, this._numChangeEventsSent++, shouldNotify && this.notify();
1775
+ }
1776
+ getStateIfChanged(props = this.props, state = this.state, parentManager = this.parentManager) {
1777
+ let _ = this.getState(props, parentManager);
1778
+ if (state && state !== emptyState && !_)
1779
+ return parentManager == null ? void 0 : parentManager.state;
1780
+ if (this.getStateShouldChange(_, state))
1781
+ return _;
1782
+ }
1783
+ getStateShouldChange(nextState, state = this.state) {
1784
+ return !(!(nextState != null && nextState.theme) || nextState.theme === (state == null ? void 0 : state.theme));
1785
+ }
1786
+ getState(props = this.props, parentManager = this.parentManager) {
1787
+ return getState(props, parentManager) || (parentManager == null ? void 0 : parentManager.state) || null;
1788
+ }
1789
+ get allKeys() {
1790
+ var _a;
1791
+ return this._allKeys ||= /* @__PURE__ */ new Set([
1792
+ ...((_a = this.parentManager) == null ? void 0 : _a.allKeys) || [],
1793
+ ...Object.keys(this.state.theme || {})
1794
+ ]), this._allKeys;
1795
+ }
1796
+ notify(forced = !1) {
1797
+ this.themeListeners.forEach((cb) => cb(this.state.name, this, forced));
1798
+ }
1799
+ onChangeTheme(cb, debugId) {
1800
+ return debugId && (this._listeningIds ??= /* @__PURE__ */ new Set(), this._listeningIds.add(debugId)), this.themeListeners.add(cb), () => {
1801
+ this.themeListeners.delete(cb);
1802
+ };
1803
+ }
1804
+ };
1805
+ function getState(props, manager) {
1806
+ var _a;
1807
+ if (props.name && props.reset)
1808
+ throw new Error(
1809
+ "Cannot reset and set a new name at the same time."
1810
+ );
1811
+ if (!getHasThemeUpdatingProps(props))
1812
+ return null;
1813
+ let themes = (0, import_config.getThemes)(), [allManagers, componentManagers] = getManagers(manager), isDirectParentAComponentTheme = !!(manager != null && manager.state.isComponent), startIndex = props.reset && !isDirectParentAComponentTheme ? 1 : 0, baseManager = allManagers[startIndex], parentManager = allManagers[startIndex + 1];
1814
+ if (!baseManager && props.reset)
1815
+ return console.warn("Cannot reset, no parent theme exists"), null;
1816
+ let { componentName } = props, result = null, baseName = (baseManager == null ? void 0 : baseManager.state.name) || "";
1817
+ baseManager != null && baseManager.state.isComponent && (baseName = baseName.replace(/_[A-Z][A-Za-z]+/, ""));
1818
+ let nextName = props.reset ? baseName : props.name || "", allComponentThemes = componentManagers.map((x) => (x == null ? void 0 : x.state.name) || "");
1819
+ isDirectParentAComponentTheme && allComponentThemes.shift();
1820
+ let base = baseName.split(import_constants22.THEME_NAME_SEPARATOR), max2 = base.length, min2 = props.componentName && !nextName ? max2 : 0;
1821
+ for (let i = max2; i >= min2; i--) {
1822
+ let prefix = base.slice(0, i).join(import_constants22.THEME_NAME_SEPARATOR);
1823
+ props.inverse && (prefix = inverseThemeName(prefix));
1824
+ let potentials = [];
1825
+ if (prefix && prefix !== baseName && potentials.push(prefix), nextName && potentials.unshift(prefix ? `${prefix}_${nextName}` : nextName), i === 1) {
1826
+ let lastSegment = potentials.findIndex((x) => !x.includes("_"));
1827
+ lastSegment > 0 && potentials.splice(lastSegment, 0, nextName);
1828
+ }
1829
+ if (componentName && !props.reset) {
1830
+ let baseLen = base.length, componentPotentials = [];
1831
+ if (nextName && baseLen > 1) {
1832
+ let beforeSeparator = base[0];
1833
+ componentPotentials.push(`${beforeSeparator}_${nextName}_${componentName}`);
1834
+ }
1835
+ if (componentPotentials.push(`${prefix}_${componentName}`), nextName) {
1836
+ if (i > baseLen) {
1837
+ let prefixLessOne = base.slice(0, i - 1).join(import_constants22.THEME_NAME_SEPARATOR);
1838
+ if (prefixLessOne) {
1839
+ let lessSpecific = `${prefixLessOne}_${nextName}_${componentName}`;
1840
+ componentPotentials.unshift(lessSpecific);
1841
+ }
1842
+ }
1843
+ let moreSpecific = `${prefix}_${nextName}_${componentName}`;
1844
+ componentPotentials.unshift(moreSpecific);
1845
+ }
1846
+ potentials = [...componentPotentials, ...potentials, ...allComponentThemes];
1847
+ }
1848
+ let found = potentials.find((t) => t in themes);
1849
+ if (typeof props.debug == "string" && console.info(" getState ", {
1850
+ props,
1851
+ found,
1852
+ potentials,
1853
+ baseManager,
1854
+ nextName,
1855
+ baseName,
1856
+ prefix
1857
+ }), found) {
1858
+ let names = found.split("_"), [firstName, ...restNames] = names, lastName = names[names.length - 1], isComponent = lastName[0] === lastName[0].toUpperCase(), scheme = firstName === "light" ? "light" : firstName === "dark" ? "dark" : void 0, pre = import_constants22.THEME_CLASSNAME_PREFIX, className = import_constants4.isWeb ? `${pre}sub_theme ${pre}${!scheme || !restNames.length ? firstName : restNames.join("_")}` : "", parentState = (_a = baseManager || parentManager) == null ? void 0 : _a.state, parentName = parentState == null ? void 0 : parentState.name;
1859
+ result = {
1860
+ name: found,
1861
+ parentName,
1862
+ theme: themes[found],
1863
+ className,
1864
+ isComponent,
1865
+ scheme
1866
+ };
1867
+ break;
1868
+ }
1869
+ }
1870
+ return props.debug === "verbose" && typeof window < "u" && (console.groupCollapsed("ThemeManager.getState()"), console.info({ props, baseName, base, min: min2, max: max2 }), console.warn("result", { result }), console.trace(), console.groupEnd()), result;
1970
1871
  }
1971
- function isEqualShallow(prev, next) {
1972
- for (let key in next)
1973
- if (prev[key] !== next[key])
1974
- return !1;
1975
- return !0;
1872
+ var inverseThemeName = (themeName) => themeName.startsWith("light") ? themeName.replace(/^light/, "dark") : themeName.replace(/^dark/, "light");
1873
+ function getManagers(themeManager) {
1874
+ let comp = [], all = [], cur = themeManager;
1875
+ for (; cur; )
1876
+ all.push(cur), cur.state.isComponent && comp.push(cur), cur = cur.parentManager;
1877
+ return [all, comp];
1976
1878
  }
1977
1879
  }
1978
1880
  });
1979
1881
 
1980
- // ../web/dist/cjs/constants/accessibilityDirectMap.native.js
1981
- var require_accessibilityDirectMap_native = __commonJS({
1982
- "../web/dist/cjs/constants/accessibilityDirectMap.native.js"(exports2, module2) {
1882
+ // ../web/dist/cjs/helpers/ThemeManagerContext.native.js
1883
+ var require_ThemeManagerContext_native = __commonJS({
1884
+ "../web/dist/cjs/helpers/ThemeManagerContext.native.js"(exports2, module2) {
1983
1885
  "use strict";
1984
1886
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
1985
1887
  for (var name in all)
@@ -1989,72 +1891,18 @@ var require_accessibilityDirectMap_native = __commonJS({
1989
1891
  for (let key of __getOwnPropNames2(from))
1990
1892
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1991
1893
  return to;
1992
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), accessibilityDirectMap_native_exports = {};
1993
- __export2(accessibilityDirectMap_native_exports, {
1994
- accessibilityDirectMap: () => accessibilityDirectMap,
1995
- accessibilityWebRoleToNativeRole: () => accessibilityWebRoleToNativeRole,
1996
- nativeAccessibilityState: () => nativeAccessibilityState,
1997
- nativeAccessibilityValue: () => nativeAccessibilityValue,
1998
- webToNativeAccessibilityDirectMap: () => webToNativeAccessibilityDirectMap
1894
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ThemeManagerContext_exports = {};
1895
+ __export2(ThemeManagerContext_exports, {
1896
+ ThemeManagerIDContext: () => ThemeManagerIDContext
1999
1897
  });
2000
- module2.exports = __toCommonJS2(accessibilityDirectMap_native_exports);
2001
- var accessibilityDirectMap = {}, webToNativeAccessibilityDirectMap = {
2002
- "aria-label": "accessibilityLabel",
2003
- "aria-labelledby": "accessibilityLabelledBy",
2004
- "aria-live": "accessibilityLiveRegion",
2005
- "aria-modal": "accessibilityViewIsModal",
2006
- "aria-hidden": "accessibilityElementsHidden"
2007
- }, nativeAccessibilityValue = {
2008
- "aria-valuemin": "min",
2009
- "aria-valuemax": "max",
2010
- "aria-valuenow": "now",
2011
- "aria-valuetext": "text"
2012
- }, nativeAccessibilityState = {
2013
- "aria-disabled": "disabled",
2014
- "aria-selected": "selected",
2015
- "aria-checked": "checked",
2016
- "aria-busy": "busy",
2017
- "aria-expanded": "expanded"
2018
- }, accessibilityWebRoleToNativeRole = {
2019
- alert: "alert",
2020
- button: "button",
2021
- checkbox: "checkbox",
2022
- combobox: "combobox",
2023
- grid: "grid",
2024
- group: "none",
2025
- heading: "header",
2026
- imagebutton: "imagebutton",
2027
- img: "image",
2028
- keyboardkey: "keyboardkey",
2029
- link: "link",
2030
- menu: "menu",
2031
- menubar: "menubar",
2032
- menuitem: "menuitem",
2033
- none: "none",
2034
- presentation: "none",
2035
- progressbar: "progressbar",
2036
- radio: "radio",
2037
- radiogroup: "radiogroup",
2038
- region: "summary",
2039
- scrollbar: "scrollbar",
2040
- searchbox: "search",
2041
- slider: "adjustable",
2042
- spinbutton: "spinbutton",
2043
- summary: "summary",
2044
- switch: "switch",
2045
- tab: "tab",
2046
- tablist: "tablist",
2047
- text: "text",
2048
- timer: "timer",
2049
- togglebutton: "togglebutton",
2050
- toolbar: "toolbar"
2051
- };
1898
+ module2.exports = __toCommonJS2(ThemeManagerContext_exports);
1899
+ var import_react2 = require("react"), ThemeManagerIDContext = (0, import_react2.createContext)(1);
2052
1900
  }
2053
1901
  });
2054
1902
 
2055
- // ../web/dist/cjs/constants/isDevTools.native.js
2056
- var require_isDevTools_native = __commonJS({
2057
- "../web/dist/cjs/constants/isDevTools.native.js"(exports2, module2) {
1903
+ // ../web/dist/cjs/hooks/useTheme.native.js
1904
+ var require_useTheme_native = __commonJS({
1905
+ "../web/dist/cjs/hooks/useTheme.native.js"(exports2, module2) {
2058
1906
  "use strict";
2059
1907
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2060
1908
  for (var name in all)
@@ -2064,26 +1912,217 @@ var require_isDevTools_native = __commonJS({
2064
1912
  for (let key of __getOwnPropNames2(from))
2065
1913
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2066
1914
  return to;
2067
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), isDevTools_exports = {};
2068
- __export2(isDevTools_exports, {
2069
- isDevTools: () => isDevTools
1915
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), useTheme_exports = {};
1916
+ __export2(useTheme_exports, {
1917
+ activeThemeManagers: () => activeThemeManagers,
1918
+ getThemeManager: () => getThemeManager,
1919
+ getThemeProxied: () => getThemeProxied,
1920
+ useChangeThemeEffect: () => useChangeThemeEffect,
1921
+ useTheme: () => useTheme4,
1922
+ useThemeWithState: () => useThemeWithState
2070
1923
  });
2071
- module2.exports = __toCommonJS2(isDevTools_exports);
2072
- var isDevTools = (() => {
2073
- if (0)
2074
- try {
2075
- } catch {
1924
+ module2.exports = __toCommonJS2(useTheme_exports);
1925
+ var import_constants4 = require_index_native(), import_react2 = require("react"), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_createShallowSetState = require_createShallowSetState_native(), import_ThemeManager = require_ThemeManager_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), emptyProps = { name: null }, cached;
1926
+ function getDefaultThemeProxied() {
1927
+ if (cached)
1928
+ return cached;
1929
+ let config = (0, import_config.getConfig)(), name = config.themes.light ? "light" : Object.keys(config.themes)[0], defaultTheme = config.themes[name];
1930
+ return cached = getThemeProxied({ theme: defaultTheme, name }), cached;
1931
+ }
1932
+ var useTheme4 = (props = emptyProps) => {
1933
+ let [_, theme] = useThemeWithState(props);
1934
+ return theme || getDefaultThemeProxied();
1935
+ }, useThemeWithState = (props) => {
1936
+ let keys = (0, import_react2.useRef)([]), changedThemeState = useChangeThemeEffect(
1937
+ props,
1938
+ !1,
1939
+ keys.current,
1940
+ import_constants4.isServer ? void 0 : () => {
1941
+ var _a, _b;
1942
+ return ((_a = props.shouldUpdate) == null ? void 0 : _a.call(props)) ?? (keys.current.length > 0 ? !0 : void 0);
2076
1943
  }
2077
- return !1;
2078
- })();
2079
- }
2080
- });
2081
-
2082
- // ../web/dist/cjs/helpers/getGroupPropParts.native.js
2083
- var require_getGroupPropParts_native = __commonJS({
2084
- "../web/dist/cjs/helpers/getGroupPropParts.native.js"(exports2, module2) {
1944
+ ), { themeManager, state } = changedThemeState, themeProxied = (0, import_react2.useMemo)(() => !themeManager || !(state != null && state.theme) ? {} : getThemeProxied(state, props.deopt, themeManager, keys.current, props.debug), [state == null ? void 0 : state.theme, themeManager, props.deopt, props.debug]);
1945
+ return [changedThemeState, themeProxied];
1946
+ };
1947
+ function getThemeProxied({ theme, name, scheme }, deopt = !1, themeManager, keys, debug) {
1948
+ if (!theme)
1949
+ return {};
1950
+ let config = (0, import_config.getConfig)();
1951
+ function track(key) {
1952
+ keys && !keys.includes(key) && keys.push(key);
1953
+ }
1954
+ return new Proxy(theme, {
1955
+ has(_, key) {
1956
+ if (Reflect.has(theme, key))
1957
+ return !0;
1958
+ if (typeof key == "string")
1959
+ return key[0] === "$" && (key = key.slice(1)), themeManager == null ? void 0 : themeManager.allKeys.has(key);
1960
+ },
1961
+ get(_, key) {
1962
+ if (
1963
+ // dont ask me, idk why but on hermes you can see that useTheme()[undefined] passes in STRING undefined to proxy
1964
+ // if someone is crazy enough to use "undefined" as a theme key then this not working is on them
1965
+ key !== "undefined" && typeof key == "string"
1966
+ ) {
1967
+ let keyString = key[0] === "$" ? key.slice(1) : key, val = theme[keyString];
1968
+ if (val && typeof val == "object")
1969
+ return new Proxy(val, {
1970
+ // when they touch the actual value we only track it
1971
+ // if its a variable (web), its ignored!
1972
+ get(_2, subkey) {
1973
+ if (subkey === "val")
1974
+ track(keyString);
1975
+ else if (subkey === "get")
1976
+ return (platform) => {
1977
+ let outVal = (0, import_createVariable.getVariable)(val);
1978
+ if (platform !== "web" && import_constants4.isIos && !deopt && config.settings.fastSchemeChange && !someParentIsInversed(themeManager) && scheme) {
1979
+ let oppositeThemeName = name.replace(
1980
+ scheme === "dark" ? "dark" : "light",
1981
+ scheme === "dark" ? "light" : "dark"
1982
+ ), oppositeTheme = config.themes[oppositeThemeName], oppositeVal = (0, import_createVariable.getVariable)(oppositeTheme == null ? void 0 : oppositeTheme[keyString]);
1983
+ if (oppositeVal)
1984
+ return {
1985
+ dynamic: {
1986
+ dark: scheme === "dark" ? outVal : oppositeVal,
1987
+ light: scheme === "light" ? outVal : oppositeVal
1988
+ }
1989
+ };
1990
+ }
1991
+ return track(keyString), outVal;
1992
+ };
1993
+ return Reflect.get(val, subkey);
1994
+ }
1995
+ });
1996
+ }
1997
+ return Reflect.get(_, key);
1998
+ }
1999
+ });
2000
+ }
2001
+ function someParentIsInversed(manager) {
2002
+ {
2003
+ let cur = manager;
2004
+ for (; cur; ) {
2005
+ if (!cur.parentManager)
2006
+ return !1;
2007
+ if (cur.parentManager.state.scheme !== cur.state.scheme)
2008
+ return !0;
2009
+ cur = cur.parentManager;
2010
+ }
2011
+ }
2012
+ return !1;
2013
+ }
2014
+ var activeThemeManagers = /* @__PURE__ */ new Set(), _uidToManager = /* @__PURE__ */ new WeakMap(), _idToUID = {}, getId = (id) => _idToUID[id], getThemeManager = (id) => _uidToManager.get(getId(id)), registerThemeManager = (t) => {
2015
+ if (!_idToUID[t.id]) {
2016
+ let id = _idToUID[t.id] = {};
2017
+ _uidToManager.set(id, t);
2018
+ }
2019
+ }, useChangeThemeEffect = (props, isRoot = !1, keys, shouldUpdate) => {
2020
+ let { disable } = props, parentManagerId = (0, import_react2.useContext)(import_ThemeManagerContext.ThemeManagerIDContext), parentManager = getThemeManager(parentManagerId);
2021
+ if (!isRoot && !parentManager || disable)
2022
+ return {
2023
+ isNewTheme: !1,
2024
+ state: parentManager == null ? void 0 : parentManager.state,
2025
+ themeManager: parentManager
2026
+ };
2027
+ let [themeState, setThemeState] = (0, import_react2.useState)(createState), { state, mounted, isNewTheme, themeManager, inversed } = themeState, isInversingOnMount = !!(!themeState.mounted && props.inverse);
2028
+ function getShouldUpdateTheme(manager = themeManager, nextState, prevState = state, forceShouldChange = !1) {
2029
+ let forceUpdate = shouldUpdate == null ? void 0 : shouldUpdate();
2030
+ if (!manager || !forceShouldChange && forceUpdate === !1)
2031
+ return;
2032
+ let next = nextState || manager.getState(props, parentManager);
2033
+ if (forceShouldChange || next && !(forceUpdate !== !0 && !manager.getStateShouldChange(next, prevState)))
2034
+ return next;
2035
+ }
2036
+ if (import_constants4.isServer || (0, import_react2.useEffect)(() => {
2037
+ if (!themeManager)
2038
+ return;
2039
+ if (props.inverse && !mounted) {
2040
+ setThemeState((prev) => createState({
2041
+ ...prev,
2042
+ mounted: !0
2043
+ }));
2044
+ return;
2045
+ }
2046
+ (isNewTheme || getShouldUpdateTheme(themeManager)) && (activeThemeManagers.add(themeManager), setThemeState(createState));
2047
+ let selfListenerDispose = themeManager.onChangeTheme((_a, _b, forced) => {
2048
+ forced && setThemeState((prev) => createState(prev, !0));
2049
+ }), disposeChangeListener = parentManager == null ? void 0 : parentManager.onChangeTheme(
2050
+ (name, manager, forced) => {
2051
+ let force = forced || (shouldUpdate == null ? void 0 : shouldUpdate()) || props.deopt || props["disable-child-theme"];
2052
+ (force ?? !!(keys != null && keys.length || isNewTheme)) && setThemeState((prev) => createState(prev, force));
2053
+ },
2054
+ themeManager.id
2055
+ );
2056
+ return () => {
2057
+ selfListenerDispose(), disposeChangeListener == null || disposeChangeListener(), isNewTheme && activeThemeManagers.delete(themeManager);
2058
+ };
2059
+ }, [
2060
+ themeManager,
2061
+ parentManager,
2062
+ isNewTheme,
2063
+ props.componentName,
2064
+ props.inverse,
2065
+ props.name,
2066
+ props.reset,
2067
+ mounted
2068
+ ]), isInversingOnMount)
2069
+ return {
2070
+ isNewTheme: !1,
2071
+ inversed: !1,
2072
+ themeManager: parentManager,
2073
+ state: {
2074
+ name: "",
2075
+ ...parentManager == null ? void 0 : parentManager.state,
2076
+ className: ""
2077
+ }
2078
+ };
2079
+ return {
2080
+ state,
2081
+ isNewTheme,
2082
+ inversed,
2083
+ themeManager
2084
+ };
2085
+ function createState(prev, force = !1) {
2086
+ if (prev && (shouldUpdate == null ? void 0 : shouldUpdate()) === !1 && !force)
2087
+ return prev;
2088
+ let themeManager2 = parentManager, state2;
2089
+ if ((0, import_ThemeManager.getHasThemeUpdatingProps)(props)) {
2090
+ let getNewThemeManager = () => new import_ThemeManager.ThemeManager(props, isRoot ? "root" : parentManager);
2091
+ if (prev != null && prev.themeManager) {
2092
+ themeManager2 = prev.themeManager;
2093
+ let forceChange = force || !!(keys != null && keys.length), next = themeManager2.getState(props, parentManager), nextState = getShouldUpdateTheme(
2094
+ themeManager2,
2095
+ next,
2096
+ prev.state,
2097
+ forceChange
2098
+ );
2099
+ nextState ? (state2 = nextState, prev.isNewTheme ? themeManager2.updateState(nextState) : themeManager2 = getNewThemeManager()) : prev.isNewTheme && parentManager && !next && (themeManager2 = parentManager);
2100
+ } else
2101
+ themeManager2 = getNewThemeManager(), state2 = { ...themeManager2.state };
2102
+ }
2103
+ let isNewTheme2 = !!(themeManager2 !== parentManager || props.inverse);
2104
+ isNewTheme2 && registerThemeManager(themeManager2);
2105
+ let mounted2 = props.inverse ? isRoot || (prev == null ? void 0 : prev.mounted) : !0;
2106
+ state2 || (isNewTheme2 ? state2 = themeManager2.state : (state2 = parentManager.state, themeManager2 = parentManager));
2107
+ let wasInversed = prev == null ? void 0 : prev.inversed, inversed2 = isNewTheme2 && state2.scheme !== (parentManager == null ? void 0 : parentManager.state.scheme) ? !0 : wasInversed != null ? !1 : null, response = {
2108
+ themeManager: themeManager2,
2109
+ isNewTheme: isNewTheme2,
2110
+ mounted: mounted2,
2111
+ inversed: inversed2
2112
+ }, shouldReturnPrev = prev && !force && // isEqualShallow uses the second arg as the keys so this should compare without state first...
2113
+ (0, import_createShallowSetState.isEqualShallow)(prev, response) && // ... and then compare just the state, because we make a new state obj but is likely the same
2114
+ (0, import_createShallowSetState.isEqualShallow)(prev.state, state2);
2115
+ return prev && shouldReturnPrev ? prev : (response.state = state2, response);
2116
+ }
2117
+ };
2118
+ }
2119
+ });
2120
+
2121
+ // ../web/dist/cjs/Tamagui.native.js
2122
+ var require_Tamagui_native = __commonJS({
2123
+ "../web/dist/cjs/Tamagui.native.js"(exports2, module2) {
2085
2124
  "use strict";
2086
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2125
+ var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2087
2126
  for (var name in all)
2088
2127
  __defProp2(target, name, { get: all[name], enumerable: !0 });
2089
2128
  }, __copyProps2 = (to, from, except, desc) => {
@@ -2091,24 +2130,31 @@ var require_getGroupPropParts_native = __commonJS({
2091
2130
  for (let key of __getOwnPropNames2(from))
2092
2131
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2093
2132
  return to;
2094
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), getGroupPropParts_exports = {};
2095
- __export2(getGroupPropParts_exports, {
2096
- getGroupPropParts: () => getGroupPropParts
2133
+ }, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
2134
+ // If the importer is in node compatibility mode or this is not an ESM
2135
+ // file that has been converted to a CommonJS file using a Babel-
2136
+ // compatible transform (i.e. "__esModule" has not been set), then set
2137
+ // "default" to the CommonJS "module.exports" for node compatibility.
2138
+ isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: !0 }) : target,
2139
+ mod
2140
+ )), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), Tamagui_exports = {};
2141
+ __export2(Tamagui_exports, {
2142
+ Tamagui: () => Tamagui,
2143
+ getValueFromIdentifier: () => getValueFromIdentifier,
2144
+ setIdentifierValue: () => setIdentifierValue
2097
2145
  });
2098
- module2.exports = __toCommonJS2(getGroupPropParts_exports);
2099
- var import_useMedia = require_useMedia_native();
2100
- function getGroupPropParts(groupProp) {
2101
- let mediaQueries = (0, import_useMedia.getMedia)(), [_, name, part3, part4] = groupProp.split("-"), pseudo, media = part3 in mediaQueries ? part3 : void 0;
2102
- return media ? pseudo = part4 : pseudo = part3, { name, pseudo, media };
2103
- }
2146
+ module2.exports = __toCommonJS2(Tamagui_exports);
2147
+ var Helpers = __toESM2(require_index_native7()), import_config = require_config_native(), import_insertStyleRule = require_insertStyleRule_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native(), Tamagui = void 0, identifierToValue = /* @__PURE__ */ new Map(), getValueFromIdentifier = (identifier) => identifierToValue.get(identifier), setIdentifierValue = (identifier, value) => {
2148
+ identifierToValue.set(identifier, value);
2149
+ };
2104
2150
  }
2105
2151
  });
2106
2152
 
2107
- // ../web/dist/cjs/helpers/createMediaStyle.native.js
2108
- var require_createMediaStyle_native = __commonJS({
2109
- "../web/dist/cjs/helpers/createMediaStyle.native.js"(exports2, module2) {
2153
+ // ../compose-refs/dist/cjs/compose-refs.native.js
2154
+ var require_compose_refs_native = __commonJS({
2155
+ "../compose-refs/dist/cjs/compose-refs.native.js"(exports2, module2) {
2110
2156
  "use strict";
2111
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2157
+ var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2112
2158
  for (var name in all)
2113
2159
  __defProp2(target, name, { get: all[name], enumerable: !0 });
2114
2160
  }, __copyProps2 = (to, from, except, desc) => {
@@ -2116,35 +2162,361 @@ var require_createMediaStyle_native = __commonJS({
2116
2162
  for (let key of __getOwnPropNames2(from))
2117
2163
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2118
2164
  return to;
2119
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createMediaStyle_exports = {};
2120
- __export2(createMediaStyle_exports, {
2121
- MEDIA_SEP: () => MEDIA_SEP,
2122
- createMediaStyle: () => createMediaStyle
2165
+ }, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
2166
+ // If the importer is in node compatibility mode or this is not an ESM
2167
+ // file that has been converted to a CommonJS file using a Babel-
2168
+ // compatible transform (i.e. "__esModule" has not been set), then set
2169
+ // "default" to the CommonJS "module.exports" for node compatibility.
2170
+ isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: !0 }) : target,
2171
+ mod
2172
+ )), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), compose_refs_exports = {};
2173
+ __export2(compose_refs_exports, {
2174
+ composeRefs: () => composeRefs,
2175
+ useComposedRefs: () => useComposedRefs
2123
2176
  });
2124
- module2.exports = __toCommonJS2(createMediaStyle_exports);
2125
- var import_config = require_config_native(), import_useMedia = require_useMedia_native(), import_getGroupPropParts = require_getGroupPropParts_native(), MEDIA_SEP = "_", prefixes = null, selectors = null, groupPseudoToPseudoCSSMap = {
2126
- press: "active"
2127
- }, createMediaStyle = (styleObject, mediaKeyIn, mediaQueries, type, negate, priority) => {
2128
- let { property, identifier, rules } = styleObject, conf = (0, import_config.getConfig)(), enableMediaPropOrder = conf.settings.mediaPropOrder, isTheme = type === "theme", isPlatform = type === "platform", isGroup = type === "group", isNonWindowMedia = isTheme || isPlatform || 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(";");
2129
- if (isNonWindowMedia) {
2130
- let precedenceImportancePrefix = new Array((priority || 0) + (isGroup ? 1 : 0)).fill(":root").join("");
2131
- if (isTheme || isGroup) {
2132
- let groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyIn), mediaName = groupInfo == null ? void 0 : groupInfo.name;
2133
- groupMediaKey = groupInfo == null ? void 0 : groupInfo.media, isGroup && (containerName = mediaName);
2134
- let name = (isGroup ? "group_" : "") + mediaName, selectorStart = styleInner.indexOf(":root"), selectorEnd = styleInner.lastIndexOf("{"), selector = styleInner.slice(selectorStart, selectorEnd), precedenceSpace = conf.themeClassNameOnRoot && isTheme ? "" : " ", 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(
2135
- ":root",
2136
- ""
2137
- )}`;
2138
- styleRule = styleInner.replace(selector, nextSelector);
2139
- } else
2140
- styleRule = `${precedenceImportancePrefix}${styleInner}`;
2141
- }
2142
- if (!isNonWindowMedia || groupMediaKey) {
2143
- if (!selectors) {
2144
- let mediaKeys = Object.keys(mediaQueries);
2145
- selectors = Object.fromEntries(
2146
- mediaKeys.map((key) => [key, (0, import_useMedia.mediaObjectToString)(mediaQueries[key])])
2147
- ), enableMediaPropOrder || (prefixes = Object.fromEntries(
2177
+ module2.exports = __toCommonJS2(compose_refs_exports);
2178
+ var React2 = __toESM2(require("react"));
2179
+ function setRef(ref, value) {
2180
+ typeof ref == "function" ? ref(value) : ref && (ref.current = value);
2181
+ }
2182
+ function composeRefs(...refs) {
2183
+ return (node) => refs.forEach((ref) => setRef(ref, node));
2184
+ }
2185
+ function useComposedRefs(...refs) {
2186
+ return React2.useCallback(composeRefs(...refs), refs);
2187
+ }
2188
+ }
2189
+ });
2190
+
2191
+ // ../compose-refs/dist/cjs/index.native.js
2192
+ var require_index_native10 = __commonJS({
2193
+ "../compose-refs/dist/cjs/index.native.js"(exports2, module2) {
2194
+ "use strict";
2195
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __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
+ }, __reExport2 = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default")), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), src_exports2 = {};
2201
+ module2.exports = __toCommonJS2(src_exports2);
2202
+ __reExport2(src_exports2, require_compose_refs_native(), module2.exports);
2203
+ }
2204
+ });
2205
+
2206
+ // ../web/dist/cjs/helpers/objectIdentityKey.native.js
2207
+ var require_objectIdentityKey_native = __commonJS({
2208
+ "../web/dist/cjs/helpers/objectIdentityKey.native.js"(exports2, module2) {
2209
+ "use strict";
2210
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2211
+ for (var name in all)
2212
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
2213
+ }, __copyProps2 = (to, from, except, desc) => {
2214
+ if (from && typeof from == "object" || typeof from == "function")
2215
+ for (let key of __getOwnPropNames2(from))
2216
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2217
+ return to;
2218
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), objectIdentityKey_exports = {};
2219
+ __export2(objectIdentityKey_exports, {
2220
+ objectIdentityKey: () => objectIdentityKey
2221
+ });
2222
+ module2.exports = __toCommonJS2(objectIdentityKey_exports);
2223
+ function objectIdentityKey(obj) {
2224
+ let k = "";
2225
+ for (let key in obj) {
2226
+ k += key;
2227
+ let arg = obj[key], type = typeof arg;
2228
+ if (!arg || type !== "object" && type !== "function")
2229
+ k += type + arg;
2230
+ else if (cache.has(arg))
2231
+ k += cache.get(arg);
2232
+ else {
2233
+ let v = Math.random();
2234
+ cache.set(arg, v), k += v;
2235
+ }
2236
+ }
2237
+ return k;
2238
+ }
2239
+ var cache = /* @__PURE__ */ new WeakMap();
2240
+ }
2241
+ });
2242
+
2243
+ // ../web/dist/cjs/helpers/createStyledContext.native.js
2244
+ var require_createStyledContext_native = __commonJS({
2245
+ "../web/dist/cjs/helpers/createStyledContext.native.js"(exports2, module2) {
2246
+ "use strict";
2247
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2248
+ for (var name in all)
2249
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
2250
+ }, __copyProps2 = (to, from, except, desc) => {
2251
+ if (from && typeof from == "object" || typeof from == "function")
2252
+ for (let key of __getOwnPropNames2(from))
2253
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2254
+ return to;
2255
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createStyledContext_exports = {};
2256
+ __export2(createStyledContext_exports, {
2257
+ createStyledContext: () => createStyledContext2
2258
+ });
2259
+ module2.exports = __toCommonJS2(createStyledContext_exports);
2260
+ var import_react2 = require("react"), import_objectIdentityKey = require_objectIdentityKey_native(), import_jsx_runtime6 = require("react/jsx-runtime");
2261
+ function createStyledContext2(defaultValues) {
2262
+ let OGContext = (0, import_react2.createContext)(defaultValues), OGProvider2 = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map(), Provider = ({
2263
+ children,
2264
+ scope,
2265
+ ...values
2266
+ }) => {
2267
+ let next = (0, import_react2.useMemo)(() => ({
2268
+ // this ! is a workaround for ts error
2269
+ ...defaultValues,
2270
+ ...values
2271
+ }), [(0, import_objectIdentityKey.objectIdentityKey)(values)]), Provider2 = OGProvider2;
2272
+ if (scope) {
2273
+ let ScopedContext = scopedContexts.get(scope);
2274
+ ScopedContext || (ScopedContext = (0, import_react2.createContext)(defaultValues), scopedContexts.set(scope, ScopedContext)), Provider2 = ScopedContext.Provider;
2275
+ }
2276
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Provider2, { value: next, children });
2277
+ }, useStyledContext = (scope) => {
2278
+ let context = scope ? scopedContexts.get(scope) : OGContext;
2279
+ return (0, import_react2.useContext)(context);
2280
+ };
2281
+ return Context.Provider = Provider, Context.props = defaultValues, Context.context = OGContext, Context.useStyledContext = useStyledContext, Context;
2282
+ }
2283
+ }
2284
+ });
2285
+
2286
+ // ../web/dist/cjs/contexts/ComponentContext.native.js
2287
+ var require_ComponentContext_native = __commonJS({
2288
+ "../web/dist/cjs/contexts/ComponentContext.native.js"(exports2, module2) {
2289
+ "use strict";
2290
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2291
+ for (var name in all)
2292
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
2293
+ }, __copyProps2 = (to, from, except, desc) => {
2294
+ if (from && typeof from == "object" || typeof from == "function")
2295
+ for (let key of __getOwnPropNames2(from))
2296
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2297
+ return to;
2298
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ComponentContext_exports = {};
2299
+ __export2(ComponentContext_exports, {
2300
+ ComponentContext: () => ComponentContext2
2301
+ });
2302
+ module2.exports = __toCommonJS2(ComponentContext_exports);
2303
+ var import_createStyledContext = require_createStyledContext_native(), ComponentContext2 = (0, import_createStyledContext.createStyledContext)({
2304
+ disableSSR: void 0,
2305
+ inText: !1,
2306
+ language: null,
2307
+ animationDriver: null,
2308
+ groups: {
2309
+ emit: null,
2310
+ subscribe: null,
2311
+ state: {}
2312
+ }
2313
+ });
2314
+ }
2315
+ });
2316
+
2317
+ // ../web/dist/cjs/defaultComponentState.native.js
2318
+ var require_defaultComponentState_native = __commonJS({
2319
+ "../web/dist/cjs/defaultComponentState.native.js"(exports2, module2) {
2320
+ "use strict";
2321
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2322
+ for (var name in all)
2323
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
2324
+ }, __copyProps2 = (to, from, except, desc) => {
2325
+ if (from && typeof from == "object" || typeof from == "function")
2326
+ for (let key of __getOwnPropNames2(from))
2327
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2328
+ return to;
2329
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), defaultComponentState_exports = {};
2330
+ __export2(defaultComponentState_exports, {
2331
+ defaultComponentState: () => defaultComponentState,
2332
+ defaultComponentStateMounted: () => defaultComponentStateMounted,
2333
+ defaultComponentStateShouldEnter: () => defaultComponentStateShouldEnter
2334
+ });
2335
+ module2.exports = __toCommonJS2(defaultComponentState_exports);
2336
+ var defaultComponentState = {
2337
+ hover: !1,
2338
+ press: !1,
2339
+ pressIn: !1,
2340
+ focus: !1,
2341
+ unmounted: !0
2342
+ }, defaultComponentStateMounted = {
2343
+ ...defaultComponentState,
2344
+ unmounted: !1
2345
+ }, defaultComponentStateShouldEnter = {
2346
+ ...defaultComponentState,
2347
+ unmounted: "should-enter"
2348
+ };
2349
+ }
2350
+ });
2351
+
2352
+ // ../web/dist/cjs/constants/accessibilityDirectMap.native.js
2353
+ var require_accessibilityDirectMap_native = __commonJS({
2354
+ "../web/dist/cjs/constants/accessibilityDirectMap.native.js"(exports2, module2) {
2355
+ "use strict";
2356
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2357
+ for (var name in all)
2358
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
2359
+ }, __copyProps2 = (to, from, except, desc) => {
2360
+ if (from && typeof from == "object" || typeof from == "function")
2361
+ for (let key of __getOwnPropNames2(from))
2362
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2363
+ return to;
2364
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), accessibilityDirectMap_native_exports = {};
2365
+ __export2(accessibilityDirectMap_native_exports, {
2366
+ accessibilityDirectMap: () => accessibilityDirectMap,
2367
+ accessibilityWebRoleToNativeRole: () => accessibilityWebRoleToNativeRole,
2368
+ nativeAccessibilityState: () => nativeAccessibilityState,
2369
+ nativeAccessibilityValue: () => nativeAccessibilityValue,
2370
+ webToNativeAccessibilityDirectMap: () => webToNativeAccessibilityDirectMap
2371
+ });
2372
+ module2.exports = __toCommonJS2(accessibilityDirectMap_native_exports);
2373
+ var accessibilityDirectMap = {}, webToNativeAccessibilityDirectMap = {
2374
+ "aria-label": "accessibilityLabel",
2375
+ "aria-labelledby": "accessibilityLabelledBy",
2376
+ "aria-live": "accessibilityLiveRegion",
2377
+ "aria-modal": "accessibilityViewIsModal",
2378
+ "aria-hidden": "accessibilityElementsHidden"
2379
+ }, nativeAccessibilityValue = {
2380
+ "aria-valuemin": "min",
2381
+ "aria-valuemax": "max",
2382
+ "aria-valuenow": "now",
2383
+ "aria-valuetext": "text"
2384
+ }, nativeAccessibilityState = {
2385
+ "aria-disabled": "disabled",
2386
+ "aria-selected": "selected",
2387
+ "aria-checked": "checked",
2388
+ "aria-busy": "busy",
2389
+ "aria-expanded": "expanded"
2390
+ }, accessibilityWebRoleToNativeRole = {
2391
+ alert: "alert",
2392
+ button: "button",
2393
+ checkbox: "checkbox",
2394
+ combobox: "combobox",
2395
+ grid: "grid",
2396
+ group: "none",
2397
+ heading: "header",
2398
+ imagebutton: "imagebutton",
2399
+ img: "image",
2400
+ keyboardkey: "keyboardkey",
2401
+ link: "link",
2402
+ menu: "menu",
2403
+ menubar: "menubar",
2404
+ menuitem: "menuitem",
2405
+ none: "none",
2406
+ presentation: "none",
2407
+ progressbar: "progressbar",
2408
+ radio: "radio",
2409
+ radiogroup: "radiogroup",
2410
+ region: "summary",
2411
+ scrollbar: "scrollbar",
2412
+ searchbox: "search",
2413
+ slider: "adjustable",
2414
+ spinbutton: "spinbutton",
2415
+ summary: "summary",
2416
+ switch: "switch",
2417
+ tab: "tab",
2418
+ tablist: "tablist",
2419
+ text: "text",
2420
+ timer: "timer",
2421
+ togglebutton: "togglebutton",
2422
+ toolbar: "toolbar"
2423
+ };
2424
+ }
2425
+ });
2426
+
2427
+ // ../web/dist/cjs/constants/isDevTools.native.js
2428
+ var require_isDevTools_native = __commonJS({
2429
+ "../web/dist/cjs/constants/isDevTools.native.js"(exports2, module2) {
2430
+ "use strict";
2431
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2432
+ for (var name in all)
2433
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
2434
+ }, __copyProps2 = (to, from, except, desc) => {
2435
+ if (from && typeof from == "object" || typeof from == "function")
2436
+ for (let key of __getOwnPropNames2(from))
2437
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2438
+ return to;
2439
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), isDevTools_exports = {};
2440
+ __export2(isDevTools_exports, {
2441
+ isDevTools: () => isDevTools
2442
+ });
2443
+ module2.exports = __toCommonJS2(isDevTools_exports);
2444
+ var isDevTools = (() => {
2445
+ if (0)
2446
+ try {
2447
+ } catch {
2448
+ }
2449
+ return !1;
2450
+ })();
2451
+ }
2452
+ });
2453
+
2454
+ // ../web/dist/cjs/helpers/getGroupPropParts.native.js
2455
+ var require_getGroupPropParts_native = __commonJS({
2456
+ "../web/dist/cjs/helpers/getGroupPropParts.native.js"(exports2, module2) {
2457
+ "use strict";
2458
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2459
+ for (var name in all)
2460
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
2461
+ }, __copyProps2 = (to, from, except, desc) => {
2462
+ if (from && typeof from == "object" || typeof from == "function")
2463
+ for (let key of __getOwnPropNames2(from))
2464
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2465
+ return to;
2466
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), getGroupPropParts_exports = {};
2467
+ __export2(getGroupPropParts_exports, {
2468
+ getGroupPropParts: () => getGroupPropParts
2469
+ });
2470
+ module2.exports = __toCommonJS2(getGroupPropParts_exports);
2471
+ var import_useMedia = require_useMedia_native();
2472
+ function getGroupPropParts(groupProp) {
2473
+ let mediaQueries = (0, import_useMedia.getMedia)(), [_, name, part3, part4] = groupProp.split("-"), pseudo, media = part3 in mediaQueries ? part3 : void 0;
2474
+ return media ? pseudo = part4 : pseudo = part3, { name, pseudo, media };
2475
+ }
2476
+ }
2477
+ });
2478
+
2479
+ // ../web/dist/cjs/helpers/createMediaStyle.native.js
2480
+ var require_createMediaStyle_native = __commonJS({
2481
+ "../web/dist/cjs/helpers/createMediaStyle.native.js"(exports2, module2) {
2482
+ "use strict";
2483
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2484
+ for (var name in all)
2485
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
2486
+ }, __copyProps2 = (to, from, except, desc) => {
2487
+ if (from && typeof from == "object" || typeof from == "function")
2488
+ for (let key of __getOwnPropNames2(from))
2489
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2490
+ return to;
2491
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createMediaStyle_exports = {};
2492
+ __export2(createMediaStyle_exports, {
2493
+ MEDIA_SEP: () => MEDIA_SEP,
2494
+ createMediaStyle: () => createMediaStyle
2495
+ });
2496
+ module2.exports = __toCommonJS2(createMediaStyle_exports);
2497
+ var import_config = require_config_native(), import_useMedia = require_useMedia_native(), import_getGroupPropParts = require_getGroupPropParts_native(), MEDIA_SEP = "_", prefixes = null, selectors = null, groupPseudoToPseudoCSSMap = {
2498
+ press: "active"
2499
+ }, createMediaStyle = (styleObject, mediaKeyIn, mediaQueries, type, negate, priority) => {
2500
+ let { property, identifier, rules } = styleObject, conf = (0, import_config.getConfig)(), enableMediaPropOrder = conf.settings.mediaPropOrder, isTheme = type === "theme", isPlatform = type === "platform", isGroup = type === "group", isNonWindowMedia = isTheme || isPlatform || 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(";");
2501
+ if (isNonWindowMedia) {
2502
+ let precedenceImportancePrefix = new Array((priority || 0) + (isGroup ? 1 : 0)).fill(":root").join("");
2503
+ if (isTheme || isGroup) {
2504
+ let groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyIn), mediaName = groupInfo == null ? void 0 : groupInfo.name;
2505
+ groupMediaKey = groupInfo == null ? void 0 : groupInfo.media, isGroup && (containerName = mediaName);
2506
+ let name = (isGroup ? "group_" : "") + mediaName, selectorStart = styleInner.indexOf(":root"), selectorEnd = styleInner.lastIndexOf("{"), selector = styleInner.slice(selectorStart, selectorEnd), precedenceSpace = conf.themeClassNameOnRoot && isTheme ? "" : " ", 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(
2507
+ ":root",
2508
+ ""
2509
+ )}`;
2510
+ styleRule = styleInner.replace(selector, nextSelector);
2511
+ } else
2512
+ styleRule = `${precedenceImportancePrefix}${styleInner}`;
2513
+ }
2514
+ if (!isNonWindowMedia || groupMediaKey) {
2515
+ if (!selectors) {
2516
+ let mediaKeys = Object.keys(mediaQueries);
2517
+ selectors = Object.fromEntries(
2518
+ mediaKeys.map((key) => [key, (0, import_useMedia.mediaObjectToString)(mediaQueries[key])])
2519
+ ), enableMediaPropOrder || (prefixes = Object.fromEntries(
2148
2520
  mediaKeys.map((k, index) => [k, new Array(index + 1).fill(":root").join("")])
2149
2521
  ));
2150
2522
  }
@@ -3645,256 +4017,43 @@ var require_getSplitStyles_native = __commonJS({
3645
4017
  disableClassName: 1,
3646
4018
  debug: 1,
3647
4019
  componentName: 1,
3648
- disableOptimization: 1,
3649
- tag: 1,
3650
- style: 1,
3651
- // handled after loop so pseudos set usedKeys and override it if necessary
3652
- group: 1
3653
- };
3654
- skipProps["data-test-renders"] = 1;
3655
- Object.assign(skipProps, {
3656
- whiteSpace: 1,
3657
- wordWrap: 1,
3658
- textOverflow: 1,
3659
- textDecorationDistance: 1,
3660
- cursor: 1,
3661
- contain: 1,
3662
- boxSizing: 1,
3663
- boxShadow: 1,
3664
- outlineStyle: 1,
3665
- outlineOffset: 1,
3666
- outlineWidth: 1,
3667
- outlineColor: 1
3668
- });
3669
- function passDownProp(viewProps, key, val, shouldMergeObject = !1) {
3670
- if (shouldMergeObject) {
3671
- let next = {
3672
- ...viewProps[key],
3673
- ...val
3674
- };
3675
- delete viewProps[key], viewProps[key] = next;
3676
- } else
3677
- viewProps[key] = val;
3678
- }
3679
- }
3680
- });
3681
-
3682
- // ../web/dist/cjs/helpers/mergeProps.native.js
3683
- var require_mergeProps_native = __commonJS({
3684
- "../web/dist/cjs/helpers/mergeProps.native.js"(exports2, module2) {
3685
- "use strict";
3686
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
3687
- for (var name in all)
3688
- __defProp2(target, name, { get: all[name], enumerable: !0 });
3689
- }, __copyProps2 = (to, from, except, desc) => {
3690
- if (from && typeof from == "object" || typeof from == "function")
3691
- for (let key of __getOwnPropNames2(from))
3692
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
3693
- return to;
3694
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), mergeProps_exports = {};
3695
- __export2(mergeProps_exports, {
3696
- mergeProps: () => mergeProps
3697
- });
3698
- module2.exports = __toCommonJS2(mergeProps_exports);
3699
- var import_useMedia = require_useMedia_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), mergeProps = (a, b, inverseShorthands) => {
3700
- let out = {};
3701
- for (let key in a)
3702
- mergeProp(out, a, b, key, inverseShorthands);
3703
- if (b)
3704
- for (let key in b)
3705
- mergeProp(out, b, void 0, key, inverseShorthands);
3706
- return out;
3707
- };
3708
- function mergeProp(out, a, b, key, inverseShorthands) {
3709
- let longhand = (inverseShorthands == null ? void 0 : inverseShorthands[key]) || null, val = a[key];
3710
- if (key in import_pseudoDescriptors.pseudoDescriptors || import_useMedia.mediaKeys.has(key)) {
3711
- out[key] = {
3712
- ...out[key],
3713
- ...val
3714
- };
3715
- return;
3716
- }
3717
- b && (key in b || longhand && longhand in b) || (out[longhand || key] = val);
3718
- }
3719
- }
3720
- });
3721
-
3722
- // ../web/dist/cjs/helpers/ThemeManagerContext.native.js
3723
- var require_ThemeManagerContext_native = __commonJS({
3724
- "../web/dist/cjs/helpers/ThemeManagerContext.native.js"(exports2, module2) {
3725
- "use strict";
3726
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
3727
- for (var name in all)
3728
- __defProp2(target, name, { get: all[name], enumerable: !0 });
3729
- }, __copyProps2 = (to, from, except, desc) => {
3730
- if (from && typeof from == "object" || typeof from == "function")
3731
- for (let key of __getOwnPropNames2(from))
3732
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
3733
- return to;
3734
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ThemeManagerContext_exports = {};
3735
- __export2(ThemeManagerContext_exports, {
3736
- ThemeManagerIDContext: () => ThemeManagerIDContext
3737
- });
3738
- module2.exports = __toCommonJS2(ThemeManagerContext_exports);
3739
- var import_react2 = require("react"), ThemeManagerIDContext = (0, import_react2.createContext)(1);
3740
- }
3741
- });
3742
-
3743
- // ../web/dist/cjs/helpers/ThemeManager.native.js
3744
- var require_ThemeManager_native = __commonJS({
3745
- "../web/dist/cjs/helpers/ThemeManager.native.js"(exports2, module2) {
3746
- "use strict";
3747
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
3748
- for (var name in all)
3749
- __defProp2(target, name, { get: all[name], enumerable: !0 });
3750
- }, __copyProps2 = (to, from, except, desc) => {
3751
- if (from && typeof from == "object" || typeof from == "function")
3752
- for (let key of __getOwnPropNames2(from))
3753
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
3754
- return to;
3755
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ThemeManager_exports = {};
3756
- __export2(ThemeManager_exports, {
3757
- ThemeManager: () => ThemeManager,
3758
- getHasThemeUpdatingProps: () => getHasThemeUpdatingProps,
3759
- getManagers: () => getManagers
3760
- });
3761
- module2.exports = __toCommonJS2(ThemeManager_exports);
3762
- var import_constants4 = require_index_native(), import_config = require_config_native(), import_constants22 = require_constants_native2(), emptyState = { name: "" };
3763
- function getHasThemeUpdatingProps(props) {
3764
- return !!(props.name || props.componentName || props.inverse || props.reset);
3765
- }
3766
- var uid = 0, ThemeManager = class {
3767
- constructor(props = {}, parentManager) {
3768
- if (this.props = props, this.id = 0, this.themeListeners = /* @__PURE__ */ new Set(), this.parentManager = null, this.state = emptyState, this._allKeys = null, uid = (uid + 1) % Number.MAX_VALUE, this.id = uid, parentManager === "root") {
3769
- this.updateStateFromProps(props, !1);
3770
- return;
3771
- }
3772
- if (!parentManager)
3773
- throw new Error(
3774
- "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."
3775
- );
3776
- if (this.parentManager = parentManager, !this.updateStateFromProps(props, !1))
3777
- return parentManager;
3778
- }
3779
- updateStateFromProps(props = this.props || {}, shouldNotify = !0) {
3780
- if (this.props = props, props.forceTheme)
3781
- return this.state.theme = props.forceTheme, this.state.name = props.name || "", this.updateState(this.state, !0), this.state;
3782
- let nextState = this.getStateIfChanged(props);
3783
- if (nextState)
3784
- return this.updateState(nextState, shouldNotify), nextState;
3785
- }
3786
- updateState(nextState, shouldNotify = !0) {
3787
- this.state = nextState, this._allKeys = null, this._numChangeEventsSent ??= 0, this._numChangeEventsSent++, shouldNotify && this.notify();
3788
- }
3789
- getStateIfChanged(props = this.props, state = this.state, parentManager = this.parentManager) {
3790
- let _ = this.getState(props, parentManager);
3791
- if (state && state !== emptyState && !_)
3792
- return parentManager == null ? void 0 : parentManager.state;
3793
- if (this.getStateShouldChange(_, state))
3794
- return _;
3795
- }
3796
- getStateShouldChange(nextState, state = this.state) {
3797
- return !(!(nextState != null && nextState.theme) || nextState.theme === (state == null ? void 0 : state.theme));
3798
- }
3799
- getState(props = this.props, parentManager = this.parentManager) {
3800
- return getState(props, parentManager) || (parentManager == null ? void 0 : parentManager.state) || null;
3801
- }
3802
- get allKeys() {
3803
- var _a;
3804
- return this._allKeys ||= /* @__PURE__ */ new Set([
3805
- ...((_a = this.parentManager) == null ? void 0 : _a.allKeys) || [],
3806
- ...Object.keys(this.state.theme || {})
3807
- ]), this._allKeys;
3808
- }
3809
- notify(forced = !1) {
3810
- this.themeListeners.forEach((cb) => cb(this.state.name, this, forced));
3811
- }
3812
- onChangeTheme(cb, debugId) {
3813
- return debugId && (this._listeningIds ??= /* @__PURE__ */ new Set(), this._listeningIds.add(debugId)), this.themeListeners.add(cb), () => {
3814
- this.themeListeners.delete(cb);
3815
- };
3816
- }
3817
- };
3818
- function getState(props, manager) {
3819
- var _a;
3820
- if (props.name && props.reset)
3821
- throw new Error(
3822
- "Cannot reset and set a new name at the same time."
3823
- );
3824
- if (!getHasThemeUpdatingProps(props))
3825
- return null;
3826
- let themes = (0, import_config.getThemes)(), [allManagers, componentManagers] = getManagers(manager), isDirectParentAComponentTheme = !!(manager != null && manager.state.isComponent), startIndex = props.reset && !isDirectParentAComponentTheme ? 1 : 0, baseManager = allManagers[startIndex], parentManager = allManagers[startIndex + 1];
3827
- if (!baseManager && props.reset)
3828
- return console.warn("Cannot reset, no parent theme exists"), null;
3829
- let { componentName } = props, result = null, baseName = (baseManager == null ? void 0 : baseManager.state.name) || "";
3830
- baseManager != null && baseManager.state.isComponent && (baseName = baseName.replace(/_[A-Z][A-Za-z]+/, ""));
3831
- let nextName = props.reset ? baseName : props.name || "", allComponentThemes = componentManagers.map((x) => (x == null ? void 0 : x.state.name) || "");
3832
- isDirectParentAComponentTheme && allComponentThemes.shift();
3833
- let base = baseName.split(import_constants22.THEME_NAME_SEPARATOR), max2 = base.length, min2 = props.componentName && !nextName ? max2 : 0;
3834
- for (let i = max2; i >= min2; i--) {
3835
- let prefix = base.slice(0, i).join(import_constants22.THEME_NAME_SEPARATOR);
3836
- props.inverse && (prefix = inverseThemeName(prefix));
3837
- let potentials = [];
3838
- if (prefix && prefix !== baseName && potentials.push(prefix), nextName && potentials.unshift(prefix ? `${prefix}_${nextName}` : nextName), i === 1) {
3839
- let lastSegment = potentials.findIndex((x) => !x.includes("_"));
3840
- lastSegment > 0 && potentials.splice(lastSegment, 0, nextName);
3841
- }
3842
- if (componentName && !props.reset) {
3843
- let baseLen = base.length, componentPotentials = [];
3844
- if (nextName && baseLen > 1) {
3845
- let beforeSeparator = base[0];
3846
- componentPotentials.push(`${beforeSeparator}_${nextName}_${componentName}`);
3847
- }
3848
- if (componentPotentials.push(`${prefix}_${componentName}`), nextName) {
3849
- if (i > baseLen) {
3850
- let prefixLessOne = base.slice(0, i - 1).join(import_constants22.THEME_NAME_SEPARATOR);
3851
- if (prefixLessOne) {
3852
- let lessSpecific = `${prefixLessOne}_${nextName}_${componentName}`;
3853
- componentPotentials.unshift(lessSpecific);
3854
- }
3855
- }
3856
- let moreSpecific = `${prefix}_${nextName}_${componentName}`;
3857
- componentPotentials.unshift(moreSpecific);
3858
- }
3859
- potentials = [...componentPotentials, ...potentials, ...allComponentThemes];
3860
- }
3861
- let found = potentials.find((t) => t in themes);
3862
- if (typeof props.debug == "string" && console.info(" getState ", {
3863
- props,
3864
- found,
3865
- potentials,
3866
- baseManager,
3867
- nextName,
3868
- baseName,
3869
- prefix
3870
- }), found) {
3871
- let names = found.split("_"), [firstName, ...restNames] = names, lastName = names[names.length - 1], isComponent = lastName[0] === lastName[0].toUpperCase(), scheme = firstName === "light" ? "light" : firstName === "dark" ? "dark" : void 0, pre = import_constants22.THEME_CLASSNAME_PREFIX, className = import_constants4.isWeb ? `${pre}sub_theme ${pre}${!scheme || !restNames.length ? firstName : restNames.join("_")}` : "", parentState = (_a = baseManager || parentManager) == null ? void 0 : _a.state, parentName = parentState == null ? void 0 : parentState.name;
3872
- result = {
3873
- name: found,
3874
- parentName,
3875
- theme: themes[found],
3876
- className,
3877
- isComponent,
3878
- scheme
3879
- };
3880
- break;
3881
- }
3882
- }
3883
- return props.debug === "verbose" && typeof window < "u" && (console.groupCollapsed("ThemeManager.getState()"), console.info({ props, baseName, base, min: min2, max: max2 }), console.warn("result", { result }), console.trace(), console.groupEnd()), result;
3884
- }
3885
- var inverseThemeName = (themeName) => themeName.startsWith("light") ? themeName.replace(/^light/, "dark") : themeName.replace(/^dark/, "light");
3886
- function getManagers(themeManager) {
3887
- let comp = [], all = [], cur = themeManager;
3888
- for (; cur; )
3889
- all.push(cur), cur.state.isComponent && comp.push(cur), cur = cur.parentManager;
3890
- return [all, comp];
4020
+ disableOptimization: 1,
4021
+ tag: 1,
4022
+ style: 1,
4023
+ // handled after loop so pseudos set usedKeys and override it if necessary
4024
+ group: 1
4025
+ };
4026
+ skipProps["data-test-renders"] = 1;
4027
+ Object.assign(skipProps, {
4028
+ whiteSpace: 1,
4029
+ wordWrap: 1,
4030
+ textOverflow: 1,
4031
+ textDecorationDistance: 1,
4032
+ cursor: 1,
4033
+ contain: 1,
4034
+ boxSizing: 1,
4035
+ boxShadow: 1,
4036
+ outlineStyle: 1,
4037
+ outlineOffset: 1,
4038
+ outlineWidth: 1,
4039
+ outlineColor: 1
4040
+ });
4041
+ function passDownProp(viewProps, key, val, shouldMergeObject = !1) {
4042
+ if (shouldMergeObject) {
4043
+ let next = {
4044
+ ...viewProps[key],
4045
+ ...val
4046
+ };
4047
+ delete viewProps[key], viewProps[key] = next;
4048
+ } else
4049
+ viewProps[key] = val;
3891
4050
  }
3892
4051
  }
3893
4052
  });
3894
4053
 
3895
- // ../web/dist/cjs/hooks/useTheme.native.js
3896
- var require_useTheme_native = __commonJS({
3897
- "../web/dist/cjs/hooks/useTheme.native.js"(exports2, module2) {
4054
+ // ../web/dist/cjs/helpers/mergeProps.native.js
4055
+ var require_mergeProps_native = __commonJS({
4056
+ "../web/dist/cjs/helpers/mergeProps.native.js"(exports2, module2) {
3898
4057
  "use strict";
3899
4058
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
3900
4059
  for (var name in all)
@@ -3904,209 +4063,31 @@ var require_useTheme_native = __commonJS({
3904
4063
  for (let key of __getOwnPropNames2(from))
3905
4064
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
3906
4065
  return to;
3907
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), useTheme_exports = {};
3908
- __export2(useTheme_exports, {
3909
- activeThemeManagers: () => activeThemeManagers,
3910
- getThemeManager: () => getThemeManager,
3911
- getThemeProxied: () => getThemeProxied,
3912
- useChangeThemeEffect: () => useChangeThemeEffect,
3913
- useTheme: () => useTheme4,
3914
- useThemeWithState: () => useThemeWithState
4066
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), mergeProps_exports = {};
4067
+ __export2(mergeProps_exports, {
4068
+ mergeProps: () => mergeProps
3915
4069
  });
3916
- module2.exports = __toCommonJS2(useTheme_exports);
3917
- var import_constants4 = require_index_native(), import_react2 = require("react"), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_createShallowSetState = require_createShallowSetState_native(), import_ThemeManager = require_ThemeManager_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), emptyProps = { name: null }, cached;
3918
- function getDefaultThemeProxied() {
3919
- if (cached)
3920
- return cached;
3921
- let config = (0, import_config.getConfig)(), name = config.themes.light ? "light" : Object.keys(config.themes)[0], defaultTheme = config.themes[name];
3922
- return cached = getThemeProxied({ theme: defaultTheme, name }), cached;
3923
- }
3924
- var useTheme4 = (props = emptyProps) => {
3925
- let [_, theme] = useThemeWithState(props);
3926
- return theme || getDefaultThemeProxied();
3927
- }, useThemeWithState = (props) => {
3928
- let keys = (0, import_react2.useRef)([]), changedThemeState = useChangeThemeEffect(
3929
- props,
3930
- !1,
3931
- keys.current,
3932
- import_constants4.isServer ? void 0 : () => {
3933
- var _a, _b;
3934
- return ((_a = props.shouldUpdate) == null ? void 0 : _a.call(props)) ?? (keys.current.length > 0 ? !0 : void 0);
3935
- }
3936
- ), { themeManager, state } = changedThemeState, themeProxied = (0, import_react2.useMemo)(() => !themeManager || !(state != null && state.theme) ? {} : getThemeProxied(state, props.deopt, themeManager, keys.current, props.debug), [state == null ? void 0 : state.theme, themeManager, props.deopt, props.debug]);
3937
- return [changedThemeState, themeProxied];
4070
+ module2.exports = __toCommonJS2(mergeProps_exports);
4071
+ var import_useMedia = require_useMedia_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), mergeProps = (a, b, inverseShorthands) => {
4072
+ let out = {};
4073
+ for (let key in a)
4074
+ mergeProp(out, a, b, key, inverseShorthands);
4075
+ if (b)
4076
+ for (let key in b)
4077
+ mergeProp(out, b, void 0, key, inverseShorthands);
4078
+ return out;
3938
4079
  };
3939
- function getThemeProxied({ theme, name, scheme }, deopt = !1, themeManager, keys, debug) {
3940
- if (!theme)
3941
- return {};
3942
- let config = (0, import_config.getConfig)();
3943
- function track(key) {
3944
- keys && !keys.includes(key) && keys.push(key);
3945
- }
3946
- return new Proxy(theme, {
3947
- has(_, key) {
3948
- if (Reflect.has(theme, key))
3949
- return !0;
3950
- if (typeof key == "string")
3951
- return key[0] === "$" && (key = key.slice(1)), themeManager == null ? void 0 : themeManager.allKeys.has(key);
3952
- },
3953
- get(_, key) {
3954
- if (
3955
- // dont ask me, idk why but on hermes you can see that useTheme()[undefined] passes in STRING undefined to proxy
3956
- // if someone is crazy enough to use "undefined" as a theme key then this not working is on them
3957
- key !== "undefined" && typeof key == "string"
3958
- ) {
3959
- let keyString = key[0] === "$" ? key.slice(1) : key, val = theme[keyString];
3960
- if (val && typeof val == "object")
3961
- return new Proxy(val, {
3962
- // when they touch the actual value we only track it
3963
- // if its a variable (web), its ignored!
3964
- get(_2, subkey) {
3965
- if (subkey === "val")
3966
- track(keyString);
3967
- else if (subkey === "get")
3968
- return (platform) => {
3969
- let outVal = (0, import_createVariable.getVariable)(val);
3970
- if (platform !== "web" && import_constants4.isIos && !deopt && config.settings.fastSchemeChange && !someParentIsInversed(themeManager) && scheme) {
3971
- let oppositeThemeName = name.replace(
3972
- scheme === "dark" ? "dark" : "light",
3973
- scheme === "dark" ? "light" : "dark"
3974
- ), oppositeTheme = config.themes[oppositeThemeName], oppositeVal = (0, import_createVariable.getVariable)(oppositeTheme == null ? void 0 : oppositeTheme[keyString]);
3975
- if (oppositeVal)
3976
- return {
3977
- dynamic: {
3978
- dark: scheme === "dark" ? outVal : oppositeVal,
3979
- light: scheme === "light" ? outVal : oppositeVal
3980
- }
3981
- };
3982
- }
3983
- return track(keyString), outVal;
3984
- };
3985
- return Reflect.get(val, subkey);
3986
- }
3987
- });
3988
- }
3989
- return Reflect.get(_, key);
3990
- }
3991
- });
3992
- }
3993
- function someParentIsInversed(manager) {
3994
- {
3995
- let cur = manager;
3996
- for (; cur; ) {
3997
- if (!cur.parentManager)
3998
- return !1;
3999
- if (cur.parentManager.state.scheme !== cur.state.scheme)
4000
- return !0;
4001
- cur = cur.parentManager;
4002
- }
4003
- }
4004
- return !1;
4005
- }
4006
- var activeThemeManagers = /* @__PURE__ */ new Set(), _uidToManager = /* @__PURE__ */ new WeakMap(), _idToUID = {}, getId = (id) => _idToUID[id], getThemeManager = (id) => _uidToManager.get(getId(id)), registerThemeManager = (t) => {
4007
- if (!_idToUID[t.id]) {
4008
- let id = _idToUID[t.id] = {};
4009
- _uidToManager.set(id, t);
4010
- }
4011
- }, useChangeThemeEffect = (props, isRoot = !1, keys, shouldUpdate) => {
4012
- let { disable } = props, parentManagerId = (0, import_react2.useContext)(import_ThemeManagerContext.ThemeManagerIDContext), parentManager = getThemeManager(parentManagerId);
4013
- if (!isRoot && !parentManager || disable)
4014
- return {
4015
- isNewTheme: !1,
4016
- state: parentManager == null ? void 0 : parentManager.state,
4017
- themeManager: parentManager
4018
- };
4019
- let [themeState, setThemeState] = (0, import_react2.useState)(createState), { state, mounted, isNewTheme, themeManager, inversed } = themeState, isInversingOnMount = !!(!themeState.mounted && props.inverse);
4020
- function getShouldUpdateTheme(manager = themeManager, nextState, prevState = state, forceShouldChange = !1) {
4021
- let forceUpdate = shouldUpdate == null ? void 0 : shouldUpdate();
4022
- if (!manager || !forceShouldChange && forceUpdate === !1)
4023
- return;
4024
- let next = nextState || manager.getState(props, parentManager);
4025
- if (forceShouldChange || next && !(forceUpdate !== !0 && !manager.getStateShouldChange(next, prevState)))
4026
- return next;
4027
- }
4028
- if (import_constants4.isServer || (0, import_react2.useEffect)(() => {
4029
- if (!themeManager)
4030
- return;
4031
- if (props.inverse && !mounted) {
4032
- setThemeState((prev) => createState({
4033
- ...prev,
4034
- mounted: !0
4035
- }));
4036
- return;
4037
- }
4038
- (isNewTheme || getShouldUpdateTheme(themeManager)) && (activeThemeManagers.add(themeManager), setThemeState(createState));
4039
- let selfListenerDispose = themeManager.onChangeTheme((_a, _b, forced) => {
4040
- forced && setThemeState((prev) => createState(prev, !0));
4041
- }), disposeChangeListener = parentManager == null ? void 0 : parentManager.onChangeTheme(
4042
- (name, manager, forced) => {
4043
- let force = forced || (shouldUpdate == null ? void 0 : shouldUpdate()) || props.deopt || props["disable-child-theme"];
4044
- (force ?? !!(keys != null && keys.length || isNewTheme)) && setThemeState((prev) => createState(prev, force));
4045
- },
4046
- themeManager.id
4047
- );
4048
- return () => {
4049
- selfListenerDispose(), disposeChangeListener == null || disposeChangeListener(), isNewTheme && activeThemeManagers.delete(themeManager);
4050
- };
4051
- }, [
4052
- themeManager,
4053
- parentManager,
4054
- isNewTheme,
4055
- props.componentName,
4056
- props.inverse,
4057
- props.name,
4058
- props.reset,
4059
- mounted
4060
- ]), isInversingOnMount)
4061
- return {
4062
- isNewTheme: !1,
4063
- inversed: !1,
4064
- themeManager: parentManager,
4065
- state: {
4066
- name: "",
4067
- ...parentManager == null ? void 0 : parentManager.state,
4068
- className: ""
4069
- }
4080
+ function mergeProp(out, a, b, key, inverseShorthands) {
4081
+ let longhand = (inverseShorthands == null ? void 0 : inverseShorthands[key]) || null, val = a[key];
4082
+ if (key in import_pseudoDescriptors.pseudoDescriptors || import_useMedia.mediaKeys.has(key)) {
4083
+ out[key] = {
4084
+ ...out[key],
4085
+ ...val
4070
4086
  };
4071
- return {
4072
- state,
4073
- isNewTheme,
4074
- inversed,
4075
- themeManager
4076
- };
4077
- function createState(prev, force = !1) {
4078
- if (prev && (shouldUpdate == null ? void 0 : shouldUpdate()) === !1 && !force)
4079
- return prev;
4080
- let themeManager2 = parentManager, state2;
4081
- if ((0, import_ThemeManager.getHasThemeUpdatingProps)(props)) {
4082
- let getNewThemeManager = () => new import_ThemeManager.ThemeManager(props, isRoot ? "root" : parentManager);
4083
- if (prev != null && prev.themeManager) {
4084
- themeManager2 = prev.themeManager;
4085
- let forceChange = force || !!(keys != null && keys.length), next = themeManager2.getState(props, parentManager), nextState = getShouldUpdateTheme(
4086
- themeManager2,
4087
- next,
4088
- prev.state,
4089
- forceChange
4090
- );
4091
- nextState ? (state2 = nextState, prev.isNewTheme ? themeManager2.updateState(nextState) : themeManager2 = getNewThemeManager()) : prev.isNewTheme && parentManager && !next && (themeManager2 = parentManager);
4092
- } else
4093
- themeManager2 = getNewThemeManager(), state2 = { ...themeManager2.state };
4094
- }
4095
- let isNewTheme2 = !!(themeManager2 !== parentManager || props.inverse);
4096
- isNewTheme2 && registerThemeManager(themeManager2);
4097
- let mounted2 = props.inverse ? isRoot || (prev == null ? void 0 : prev.mounted) : !0;
4098
- state2 || (isNewTheme2 ? state2 = themeManager2.state : (state2 = parentManager.state, themeManager2 = parentManager));
4099
- let wasInversed = prev == null ? void 0 : prev.inversed, inversed2 = isNewTheme2 && state2.scheme !== (parentManager == null ? void 0 : parentManager.state.scheme) ? !0 : wasInversed != null ? !1 : null, response = {
4100
- themeManager: themeManager2,
4101
- isNewTheme: isNewTheme2,
4102
- mounted: mounted2,
4103
- inversed: inversed2
4104
- }, shouldReturnPrev = prev && !force && // isEqualShallow uses the second arg as the keys so this should compare without state first...
4105
- (0, import_createShallowSetState.isEqualShallow)(prev, response) && // ... and then compare just the state, because we make a new state obj but is likely the same
4106
- (0, import_createShallowSetState.isEqualShallow)(prev.state, state2);
4107
- return prev && shouldReturnPrev ? prev : (response.state = state2, response);
4087
+ return;
4108
4088
  }
4109
- };
4089
+ b && (key in b || longhand && longhand in b) || (out[longhand || key] = val);
4090
+ }
4110
4091
  }
4111
4092
  });
4112
4093