@tamagui/core 1.85.6 → 1.85.8

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.
@@ -1448,7 +1448,7 @@ var require_insertStyleRule_native = __commonJS({
1448
1448
  if (sepI === -1)
1449
1449
  continue;
1450
1450
  let key = rule.slice(rule.indexOf("--") + 2, sepI), val = rule.slice(sepI + 2), value;
1451
- if (val[3] === "(") {
1451
+ if (val.startsWith("var(")) {
1452
1452
  let varName = val.slice(6, -1), tokenVal = colorVarToVal[varName];
1453
1453
  tokenVal ? value = tokenVal : (rootComputedStyle ||= getComputedStyle(document.body), value = rootComputedStyle.getPropertyValue("--" + varName));
1454
1454
  } else
@@ -1462,20 +1462,17 @@ var require_insertStyleRule_native = __commonJS({
1462
1462
  !0
1463
1463
  );
1464
1464
  }
1465
- return {
1466
- names: [
1467
- ...new Set(
1468
- selectors.map((selector) => {
1469
- let parts = selector.replace(/(.t_|:root)/g, "").trim().split(" "), [first] = parts, scheme = first.includes("dark") ? "dark" : first.includes("light") ? "light" : "", name = (() => {
1470
- let _ = parts[parts.length - 1];
1471
- return scheme && _.startsWith(scheme) && (_ = _.slice(scheme.length + 1)), _;
1472
- })();
1473
- return `${scheme}${scheme && name ? "_" : ""}${name}`;
1474
- })
1475
- )
1476
- ],
1465
+ let dedupedEntry = {
1466
+ names: [],
1477
1467
  theme: values
1478
1468
  };
1469
+ for (let selector of selectors) {
1470
+ let scheme = selector.includes("t_dark") ? "dark" : selector.includes("t_light") ? "light" : "", name = selector.slice(selector.lastIndexOf(".t_") + 3);
1471
+ name.startsWith(scheme) && (name = name.slice(scheme.length + 1)), scheme === name && (scheme = "");
1472
+ let themeName = `${scheme}${scheme && name ? "_" : ""}${name}`;
1473
+ dedupedEntry.names.includes(themeName) || dedupedEntry.names.push(themeName);
1474
+ }
1475
+ return dedupedEntry;
1479
1476
  }
1480
1477
  function getTamaguiSelector(rule, collectThemes = !1) {
1481
1478
  if (rule instanceof CSSStyleRule) {
@@ -1785,116 +1782,9 @@ var require_useMedia_native = __commonJS({
1785
1782
  }
1786
1783
  });
1787
1784
 
1788
- // ../web/dist/cjs/Tamagui.native.js
1789
- var require_Tamagui_native = __commonJS({
1790
- "../web/dist/cjs/Tamagui.native.js"(exports2, module2) {
1791
- "use strict";
1792
- var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
1793
- for (var name in all)
1794
- __defProp2(target, name, { get: all[name], enumerable: !0 });
1795
- }, __copyProps2 = (to, from, except, desc) => {
1796
- if (from && typeof from == "object" || typeof from == "function")
1797
- for (let key of __getOwnPropNames2(from))
1798
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1799
- return to;
1800
- }, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
1801
- // If the importer is in node compatibility mode or this is not an ESM
1802
- // file that has been converted to a CommonJS file using a Babel-
1803
- // compatible transform (i.e. "__esModule" has not been set), then set
1804
- // "default" to the CommonJS "module.exports" for node compatibility.
1805
- isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: !0 }) : target,
1806
- mod
1807
- )), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), Tamagui_exports = {};
1808
- __export2(Tamagui_exports, {
1809
- Tamagui: () => Tamagui,
1810
- getValueFromIdentifier: () => getValueFromIdentifier,
1811
- setIdentifierValue: () => setIdentifierValue
1812
- });
1813
- module2.exports = __toCommonJS2(Tamagui_exports);
1814
- var Helpers = __toESM2(require_index_native4()), import_config = require_config_native(), import_insertStyleRule = require_insertStyleRule_native(), import_useMedia = require_useMedia_native(), TamaguiManager = class {
1815
- constructor() {
1816
- this.Helpers = Helpers;
1817
- }
1818
- get mediaState() {
1819
- return { ...import_useMedia.mediaState };
1820
- }
1821
- get config() {
1822
- return (0, import_config.getConfig)();
1823
- }
1824
- get insertedRules() {
1825
- return (0, import_insertStyleRule.getAllRules)();
1826
- }
1827
- get allSelectors() {
1828
- return (0, import_insertStyleRule.getAllSelectors)();
1829
- }
1830
- get allTransforms() {
1831
- return (0, import_insertStyleRule.getAllTransforms)();
1832
- }
1833
- get identifierToValue() {
1834
- return identifierToValue;
1835
- }
1836
- }, Tamagui = new TamaguiManager(), identifierToValue = /* @__PURE__ */ new Map(), getValueFromIdentifier = (identifier) => identifierToValue.get(identifier), setIdentifierValue = (identifier, value) => {
1837
- identifierToValue.set(identifier, value);
1838
- };
1839
- }
1840
- });
1841
-
1842
- // ../compose-refs/dist/cjs/compose-refs.native.js
1843
- var require_compose_refs_native = __commonJS({
1844
- "../compose-refs/dist/cjs/compose-refs.native.js"(exports2, module2) {
1845
- "use strict";
1846
- var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
1847
- for (var name in all)
1848
- __defProp2(target, name, { get: all[name], enumerable: !0 });
1849
- }, __copyProps2 = (to, from, except, desc) => {
1850
- if (from && typeof from == "object" || typeof from == "function")
1851
- for (let key of __getOwnPropNames2(from))
1852
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1853
- return to;
1854
- }, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
1855
- // If the importer is in node compatibility mode or this is not an ESM
1856
- // file that has been converted to a CommonJS file using a Babel-
1857
- // compatible transform (i.e. "__esModule" has not been set), then set
1858
- // "default" to the CommonJS "module.exports" for node compatibility.
1859
- isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: !0 }) : target,
1860
- mod
1861
- )), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), compose_refs_exports = {};
1862
- __export2(compose_refs_exports, {
1863
- composeRefs: () => composeRefs,
1864
- useComposedRefs: () => useComposedRefs
1865
- });
1866
- module2.exports = __toCommonJS2(compose_refs_exports);
1867
- var React = __toESM2(require("react"));
1868
- function setRef(ref, value) {
1869
- typeof ref == "function" ? ref(value) : ref && (ref.current = value);
1870
- }
1871
- function composeRefs(...refs) {
1872
- return (node) => refs.forEach((ref) => setRef(ref, node));
1873
- }
1874
- function useComposedRefs(...refs) {
1875
- return React.useCallback(composeRefs(...refs), refs);
1876
- }
1877
- }
1878
- });
1879
-
1880
- // ../compose-refs/dist/cjs/index.native.js
1881
- var require_index_native5 = __commonJS({
1882
- "../compose-refs/dist/cjs/index.native.js"(exports2, module2) {
1883
- "use strict";
1884
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __copyProps2 = (to, from, except, desc) => {
1885
- if (from && typeof from == "object" || typeof from == "function")
1886
- for (let key of __getOwnPropNames2(from))
1887
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1888
- return to;
1889
- }, __reExport2 = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default")), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), src_exports2 = {};
1890
- module2.exports = __toCommonJS2(src_exports2);
1891
- __reExport2(src_exports2, require_compose_refs_native(), module2.exports);
1892
- }
1893
- });
1894
-
1895
- // ../use-did-finish-ssr/dist/cjs/index.native.js
1896
- var require_index_native6 = __commonJS({
1897
- "../use-did-finish-ssr/dist/cjs/index.native.js"(exports2, module2) {
1785
+ // ../web/dist/cjs/helpers/createShallowSetState.native.js
1786
+ var require_createShallowSetState_native = __commonJS({
1787
+ "../web/dist/cjs/helpers/createShallowSetState.native.js"(exports2, module2) {
1898
1788
  "use strict";
1899
1789
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
1900
1790
  for (var name in all)
@@ -1904,18 +1794,24 @@ var require_index_native6 = __commonJS({
1904
1794
  for (let key of __getOwnPropNames2(from))
1905
1795
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1906
1796
  return to;
1907
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), src_exports2 = {};
1908
- __export2(src_exports2, {
1909
- useClientValue: () => useClientValue,
1910
- useDidFinishSSR: () => useDidFinishSSR
1797
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createShallowSetState_exports = {};
1798
+ __export2(createShallowSetState_exports, {
1799
+ createShallowSetState: () => createShallowSetState,
1800
+ isEqualShallow: () => isEqualShallow,
1801
+ mergeIfNotShallowEqual: () => mergeIfNotShallowEqual
1911
1802
  });
1912
- module2.exports = __toCommonJS2(src_exports2);
1913
- var import_react3 = require("react");
1914
- function useDidFinishSSR(value) {
1915
- return value ?? !0;
1803
+ module2.exports = __toCommonJS2(createShallowSetState_exports);
1804
+ function createShallowSetState(setter, debug) {
1805
+ return (next) => setter((prev) => mergeIfNotShallowEqual(prev, next, debug));
1916
1806
  }
1917
- function useClientValue(value) {
1918
- return useDidFinishSSR() ? typeof value == "function" ? value() : value : void 0;
1807
+ function mergeIfNotShallowEqual(prev, next, debug) {
1808
+ return isEqualShallow(prev, next) ? prev : { ...prev, ...next };
1809
+ }
1810
+ function isEqualShallow(prev, next) {
1811
+ for (let key in next)
1812
+ if (prev[key] !== next[key])
1813
+ return !1;
1814
+ return !0;
1919
1815
  }
1920
1816
  }
1921
1817
  });
@@ -1954,9 +1850,9 @@ var require_constants_native2 = __commonJS({
1954
1850
  }
1955
1851
  });
1956
1852
 
1957
- // ../web/dist/cjs/helpers/objectIdentityKey.native.js
1958
- var require_objectIdentityKey_native = __commonJS({
1959
- "../web/dist/cjs/helpers/objectIdentityKey.native.js"(exports2, module2) {
1853
+ // ../web/dist/cjs/helpers/ThemeManager.native.js
1854
+ var require_ThemeManager_native = __commonJS({
1855
+ "../web/dist/cjs/helpers/ThemeManager.native.js"(exports2, module2) {
1960
1856
  "use strict";
1961
1857
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
1962
1858
  for (var name in all)
@@ -1966,177 +1862,149 @@ var require_objectIdentityKey_native = __commonJS({
1966
1862
  for (let key of __getOwnPropNames2(from))
1967
1863
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1968
1864
  return to;
1969
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), objectIdentityKey_exports = {};
1970
- __export2(objectIdentityKey_exports, {
1971
- objectIdentityKey: () => objectIdentityKey
1865
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ThemeManager_exports = {};
1866
+ __export2(ThemeManager_exports, {
1867
+ ThemeManager: () => ThemeManager,
1868
+ getHasThemeUpdatingProps: () => getHasThemeUpdatingProps,
1869
+ getManagers: () => getManagers
1972
1870
  });
1973
- module2.exports = __toCommonJS2(objectIdentityKey_exports);
1974
- function objectIdentityKey(obj) {
1975
- let k = "";
1976
- for (let key in obj) {
1977
- k += key;
1978
- let arg = obj[key], type = typeof arg;
1979
- if (!arg || type !== "object" && type !== "function")
1980
- k += type + arg;
1981
- else if (cache.has(arg))
1982
- k += cache.get(arg);
1983
- else {
1984
- let v = Math.random();
1985
- cache.set(arg, v), k += v;
1986
- }
1987
- }
1988
- return k;
1871
+ module2.exports = __toCommonJS2(ThemeManager_exports);
1872
+ var import_constants = require_index_native3(), import_config = require_config_native(), import_constants2 = require_constants_native2(), emptyState = { name: "" };
1873
+ function getHasThemeUpdatingProps(props) {
1874
+ return !!(props.name || props.componentName || props.inverse || props.reset);
1989
1875
  }
1990
- var cache = /* @__PURE__ */ new WeakMap();
1991
- }
1992
- });
1993
-
1994
- // ../web/dist/cjs/helpers/createStyledContext.native.js
1995
- var require_createStyledContext_native = __commonJS({
1996
- "../web/dist/cjs/helpers/createStyledContext.native.js"(exports2, module2) {
1997
- "use strict";
1998
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
1999
- for (var name in all)
2000
- __defProp2(target, name, { get: all[name], enumerable: !0 });
2001
- }, __copyProps2 = (to, from, except, desc) => {
2002
- if (from && typeof from == "object" || typeof from == "function")
2003
- for (let key of __getOwnPropNames2(from))
2004
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2005
- return to;
2006
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createStyledContext_exports = {};
2007
- __export2(createStyledContext_exports, {
2008
- createStyledContext: () => createStyledContext
2009
- });
2010
- module2.exports = __toCommonJS2(createStyledContext_exports);
2011
- var import_react3 = require("react"), import_objectIdentityKey = require_objectIdentityKey_native(), import_jsx_runtime = require("react/jsx-runtime");
2012
- function createStyledContext(defaultValues) {
2013
- let OGContext = (0, import_react3.createContext)(defaultValues), OGProvider = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map(), Provider = ({
2014
- children,
2015
- scope,
2016
- ...values
2017
- }) => {
2018
- let next = (0, import_react3.useMemo)(() => ({
2019
- // this ! is a workaround for ts error
2020
- ...defaultValues,
2021
- ...values
2022
- }), [(0, import_objectIdentityKey.objectIdentityKey)(values)]), Provider2 = OGProvider;
2023
- if (scope) {
2024
- let ScopedContext = scopedContexts.get(scope);
2025
- ScopedContext || (ScopedContext = (0, import_react3.createContext)(defaultValues), scopedContexts.set(scope, ScopedContext)), Provider2 = ScopedContext.Provider;
1876
+ var uid = 0, ThemeManager = class {
1877
+ constructor(props = {}, parentManager) {
1878
+ 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") {
1879
+ this.updateStateFromProps(props, !1);
1880
+ return;
2026
1881
  }
2027
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Provider2, { value: next, children });
2028
- }, useStyledContext = (scope) => {
2029
- let context = scope ? scopedContexts.get(scope) : OGContext;
2030
- return (0, import_react3.useContext)(context);
2031
- };
2032
- return Context.Provider = Provider, Context.props = defaultValues, Context.context = OGContext, Context.useStyledContext = useStyledContext, Context;
2033
- }
2034
- }
2035
- });
2036
-
2037
- // ../web/dist/cjs/contexts/ComponentContext.native.js
2038
- var require_ComponentContext_native = __commonJS({
2039
- "../web/dist/cjs/contexts/ComponentContext.native.js"(exports2, module2) {
2040
- "use strict";
2041
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2042
- for (var name in all)
2043
- __defProp2(target, name, { get: all[name], enumerable: !0 });
2044
- }, __copyProps2 = (to, from, except, desc) => {
2045
- if (from && typeof from == "object" || typeof from == "function")
2046
- for (let key of __getOwnPropNames2(from))
2047
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2048
- return to;
2049
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ComponentContext_exports = {};
2050
- __export2(ComponentContext_exports, {
2051
- ComponentContext: () => ComponentContext
2052
- });
2053
- module2.exports = __toCommonJS2(ComponentContext_exports);
2054
- var import_createStyledContext = require_createStyledContext_native(), ComponentContext = (0, import_createStyledContext.createStyledContext)({
2055
- disableSSR: void 0,
2056
- inText: !1,
2057
- language: null,
2058
- animationDriver: null,
2059
- groups: {
2060
- emit: null,
2061
- subscribe: null,
2062
- state: {}
1882
+ if (!parentManager)
1883
+ throw new Error(
1884
+ "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."
1885
+ );
1886
+ if (this.parentManager = parentManager, !this.updateStateFromProps(props, !1))
1887
+ return parentManager;
1888
+ }
1889
+ updateStateFromProps(props = this.props || {}, shouldNotify = !0) {
1890
+ if (this.props = props, props.forceTheme)
1891
+ return this.state.theme = props.forceTheme, this.state.name = props.name || "", this.updateState(this.state, !0), this.state;
1892
+ let nextState = this.getStateIfChanged(props);
1893
+ if (nextState)
1894
+ return this.updateState(nextState, shouldNotify), nextState;
1895
+ }
1896
+ updateState(nextState, shouldNotify = !0) {
1897
+ this.state = nextState, this._allKeys = null, this._numChangeEventsSent ??= 0, this._numChangeEventsSent++, shouldNotify && this.notify();
1898
+ }
1899
+ getStateIfChanged(props = this.props, state = this.state, parentManager = this.parentManager) {
1900
+ let _ = this.getState(props, parentManager);
1901
+ if (state && state !== emptyState && !_)
1902
+ return parentManager == null ? void 0 : parentManager.state;
1903
+ if (this.getStateShouldChange(_, state))
1904
+ return _;
1905
+ }
1906
+ getStateShouldChange(nextState, state = this.state) {
1907
+ return !(!(nextState != null && nextState.theme) || nextState.theme === (state == null ? void 0 : state.theme));
1908
+ }
1909
+ getState(props = this.props, parentManager = this.parentManager) {
1910
+ return getState(props, parentManager) || (parentManager == null ? void 0 : parentManager.state) || null;
1911
+ }
1912
+ get allKeys() {
1913
+ var _a;
1914
+ return this._allKeys ||= /* @__PURE__ */ new Set([
1915
+ ...((_a = this.parentManager) == null ? void 0 : _a.allKeys) || [],
1916
+ ...Object.keys(this.state.theme || {})
1917
+ ]), this._allKeys;
1918
+ }
1919
+ notify(forced = !1) {
1920
+ this.themeListeners.forEach((cb) => cb(this.state.name, this, forced));
1921
+ }
1922
+ onChangeTheme(cb, debugId) {
1923
+ return debugId && (this._listeningIds ??= /* @__PURE__ */ new Set(), this._listeningIds.add(debugId)), this.themeListeners.add(cb), () => {
1924
+ this.themeListeners.delete(cb);
1925
+ };
2063
1926
  }
2064
- });
2065
- }
2066
- });
2067
-
2068
- // ../web/dist/cjs/defaultComponentState.native.js
2069
- var require_defaultComponentState_native = __commonJS({
2070
- "../web/dist/cjs/defaultComponentState.native.js"(exports2, module2) {
2071
- "use strict";
2072
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2073
- for (var name in all)
2074
- __defProp2(target, name, { get: all[name], enumerable: !0 });
2075
- }, __copyProps2 = (to, from, except, desc) => {
2076
- if (from && typeof from == "object" || typeof from == "function")
2077
- for (let key of __getOwnPropNames2(from))
2078
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2079
- return to;
2080
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), defaultComponentState_exports = {};
2081
- __export2(defaultComponentState_exports, {
2082
- defaultComponentState: () => defaultComponentState,
2083
- defaultComponentStateMounted: () => defaultComponentStateMounted,
2084
- defaultComponentStateShouldEnter: () => defaultComponentStateShouldEnter
2085
- });
2086
- module2.exports = __toCommonJS2(defaultComponentState_exports);
2087
- var defaultComponentState = {
2088
- hover: !1,
2089
- press: !1,
2090
- pressIn: !1,
2091
- focus: !1,
2092
- unmounted: !0
2093
- }, defaultComponentStateMounted = {
2094
- ...defaultComponentState,
2095
- unmounted: !1
2096
- }, defaultComponentStateShouldEnter = {
2097
- ...defaultComponentState,
2098
- unmounted: "should-enter"
2099
1927
  };
2100
- }
2101
- });
2102
-
2103
- // ../web/dist/cjs/helpers/createShallowSetState.native.js
2104
- var require_createShallowSetState_native = __commonJS({
2105
- "../web/dist/cjs/helpers/createShallowSetState.native.js"(exports2, module2) {
2106
- "use strict";
2107
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2108
- for (var name in all)
2109
- __defProp2(target, name, { get: all[name], enumerable: !0 });
2110
- }, __copyProps2 = (to, from, except, desc) => {
2111
- if (from && typeof from == "object" || typeof from == "function")
2112
- for (let key of __getOwnPropNames2(from))
2113
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2114
- return to;
2115
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createShallowSetState_exports = {};
2116
- __export2(createShallowSetState_exports, {
2117
- createShallowSetState: () => createShallowSetState,
2118
- isEqualShallow: () => isEqualShallow,
2119
- mergeIfNotShallowEqual: () => mergeIfNotShallowEqual
2120
- });
2121
- module2.exports = __toCommonJS2(createShallowSetState_exports);
2122
- function createShallowSetState(setter, debug) {
2123
- return (next) => setter((prev) => mergeIfNotShallowEqual(prev, next, debug));
2124
- }
2125
- function mergeIfNotShallowEqual(prev, next, debug) {
2126
- return isEqualShallow(prev, next) ? prev : { ...prev, ...next };
1928
+ function getState(props, manager) {
1929
+ var _a;
1930
+ if (props.name && props.reset)
1931
+ throw new Error(
1932
+ "Cannot reset and set a new name at the same time."
1933
+ );
1934
+ if (!getHasThemeUpdatingProps(props))
1935
+ return null;
1936
+ 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];
1937
+ if (!baseManager && props.reset)
1938
+ return console.warn("Cannot reset, no parent theme exists"), null;
1939
+ let { componentName } = props, result = null, baseName = (baseManager == null ? void 0 : baseManager.state.name) || "";
1940
+ baseManager != null && baseManager.state.isComponent && (baseName = baseName.replace(/_[A-Z][A-Za-z]+/, ""));
1941
+ let nextName = props.reset ? baseName : props.name || "", allComponentThemes = componentManagers.map((x) => (x == null ? void 0 : x.state.name) || "");
1942
+ isDirectParentAComponentTheme && allComponentThemes.shift();
1943
+ let base = baseName.split(import_constants2.THEME_NAME_SEPARATOR), max = base.length, min = props.componentName && !nextName ? max : 0;
1944
+ for (let i = max; i >= min; i--) {
1945
+ let prefix = base.slice(0, i).join(import_constants2.THEME_NAME_SEPARATOR);
1946
+ props.inverse && (prefix = inverseThemeName(prefix));
1947
+ let potentials = [];
1948
+ if (prefix && prefix !== baseName && potentials.push(prefix), nextName && potentials.unshift(prefix ? `${prefix}_${nextName}` : nextName), i === 1) {
1949
+ let lastSegment = potentials.findIndex((x) => !x.includes("_"));
1950
+ lastSegment > 0 && potentials.splice(lastSegment, 0, nextName);
1951
+ }
1952
+ if (componentName && !props.reset) {
1953
+ let baseLen = base.length, componentPotentials = [];
1954
+ if (nextName && baseLen > 1) {
1955
+ let beforeSeparator = base[0];
1956
+ componentPotentials.push(`${beforeSeparator}_${nextName}_${componentName}`);
1957
+ }
1958
+ if (componentPotentials.push(`${prefix}_${componentName}`), nextName) {
1959
+ if (i > baseLen) {
1960
+ let prefixLessOne = base.slice(0, i - 1).join(import_constants2.THEME_NAME_SEPARATOR);
1961
+ if (prefixLessOne) {
1962
+ let lessSpecific = `${prefixLessOne}_${nextName}_${componentName}`;
1963
+ componentPotentials.unshift(lessSpecific);
1964
+ }
1965
+ }
1966
+ let moreSpecific = `${prefix}_${nextName}_${componentName}`;
1967
+ componentPotentials.unshift(moreSpecific);
1968
+ }
1969
+ potentials = [...componentPotentials, ...potentials, ...allComponentThemes];
1970
+ }
1971
+ let found = potentials.find((t) => t in themes);
1972
+ if (typeof props.debug == "string" && console.info(" getState ", {
1973
+ props,
1974
+ found,
1975
+ potentials,
1976
+ baseManager,
1977
+ nextName,
1978
+ baseName,
1979
+ prefix
1980
+ }), found) {
1981
+ 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_constants2.THEME_CLASSNAME_PREFIX, className = import_constants.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;
1982
+ result = {
1983
+ name: found,
1984
+ parentName,
1985
+ theme: themes[found],
1986
+ className,
1987
+ isComponent,
1988
+ scheme
1989
+ };
1990
+ break;
1991
+ }
1992
+ }
1993
+ return props.debug === "verbose" && typeof window < "u" && (console.groupCollapsed("ThemeManager.getState()"), console.info({ props, baseName, base, min, max }), console.warn("result", { result }), console.trace(), console.groupEnd()), result;
2127
1994
  }
2128
- function isEqualShallow(prev, next) {
2129
- for (let key in next)
2130
- if (prev[key] !== next[key])
2131
- return !1;
2132
- return !0;
1995
+ var inverseThemeName = (themeName) => themeName.startsWith("light") ? themeName.replace(/^light/, "dark") : themeName.replace(/^dark/, "light");
1996
+ function getManagers(themeManager) {
1997
+ let comp = [], all = [], cur = themeManager;
1998
+ for (; cur; )
1999
+ all.push(cur), cur.state.isComponent && comp.push(cur), cur = cur.parentManager;
2000
+ return [all, comp];
2133
2001
  }
2134
2002
  }
2135
2003
  });
2136
2004
 
2137
- // ../web/dist/cjs/constants/accessibilityDirectMap.native.js
2138
- var require_accessibilityDirectMap_native = __commonJS({
2139
- "../web/dist/cjs/constants/accessibilityDirectMap.native.js"(exports2, module2) {
2005
+ // ../web/dist/cjs/helpers/ThemeManagerContext.native.js
2006
+ var require_ThemeManagerContext_native = __commonJS({
2007
+ "../web/dist/cjs/helpers/ThemeManagerContext.native.js"(exports2, module2) {
2140
2008
  "use strict";
2141
2009
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2142
2010
  for (var name in all)
@@ -2146,72 +2014,18 @@ var require_accessibilityDirectMap_native = __commonJS({
2146
2014
  for (let key of __getOwnPropNames2(from))
2147
2015
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2148
2016
  return to;
2149
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), accessibilityDirectMap_native_exports = {};
2150
- __export2(accessibilityDirectMap_native_exports, {
2151
- accessibilityDirectMap: () => accessibilityDirectMap,
2152
- accessibilityWebRoleToNativeRole: () => accessibilityWebRoleToNativeRole,
2153
- nativeAccessibilityState: () => nativeAccessibilityState,
2154
- nativeAccessibilityValue: () => nativeAccessibilityValue,
2155
- webToNativeAccessibilityDirectMap: () => webToNativeAccessibilityDirectMap
2017
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ThemeManagerContext_exports = {};
2018
+ __export2(ThemeManagerContext_exports, {
2019
+ ThemeManagerIDContext: () => ThemeManagerIDContext
2156
2020
  });
2157
- module2.exports = __toCommonJS2(accessibilityDirectMap_native_exports);
2158
- var accessibilityDirectMap = {}, webToNativeAccessibilityDirectMap = {
2159
- "aria-label": "accessibilityLabel",
2160
- "aria-labelledby": "accessibilityLabelledBy",
2161
- "aria-live": "accessibilityLiveRegion",
2162
- "aria-modal": "accessibilityViewIsModal",
2163
- "aria-hidden": "accessibilityElementsHidden"
2164
- }, nativeAccessibilityValue = {
2165
- "aria-valuemin": "min",
2166
- "aria-valuemax": "max",
2167
- "aria-valuenow": "now",
2168
- "aria-valuetext": "text"
2169
- }, nativeAccessibilityState = {
2170
- "aria-disabled": "disabled",
2171
- "aria-selected": "selected",
2172
- "aria-checked": "checked",
2173
- "aria-busy": "busy",
2174
- "aria-expanded": "expanded"
2175
- }, accessibilityWebRoleToNativeRole = {
2176
- alert: "alert",
2177
- button: "button",
2178
- checkbox: "checkbox",
2179
- combobox: "combobox",
2180
- grid: "grid",
2181
- group: "none",
2182
- heading: "header",
2183
- imagebutton: "imagebutton",
2184
- img: "image",
2185
- keyboardkey: "keyboardkey",
2186
- link: "link",
2187
- menu: "menu",
2188
- menubar: "menubar",
2189
- menuitem: "menuitem",
2190
- none: "none",
2191
- presentation: "none",
2192
- progressbar: "progressbar",
2193
- radio: "radio",
2194
- radiogroup: "radiogroup",
2195
- region: "summary",
2196
- scrollbar: "scrollbar",
2197
- searchbox: "search",
2198
- slider: "adjustable",
2199
- spinbutton: "spinbutton",
2200
- summary: "summary",
2201
- switch: "switch",
2202
- tab: "tab",
2203
- tablist: "tablist",
2204
- text: "text",
2205
- timer: "timer",
2206
- togglebutton: "togglebutton",
2207
- toolbar: "toolbar"
2208
- };
2021
+ module2.exports = __toCommonJS2(ThemeManagerContext_exports);
2022
+ var import_react3 = require("react"), ThemeManagerIDContext = (0, import_react3.createContext)(1);
2209
2023
  }
2210
2024
  });
2211
2025
 
2212
- // ../web/dist/cjs/constants/isDevTools.native.js
2213
- var require_isDevTools_native = __commonJS({
2214
- "../web/dist/cjs/constants/isDevTools.native.js"(exports2, module2) {
2026
+ // ../web/dist/cjs/hooks/useTheme.native.js
2027
+ var require_useTheme_native = __commonJS({
2028
+ "../web/dist/cjs/hooks/useTheme.native.js"(exports2, module2) {
2215
2029
  "use strict";
2216
2030
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2217
2031
  for (var name in all)
@@ -2221,26 +2035,217 @@ var require_isDevTools_native = __commonJS({
2221
2035
  for (let key of __getOwnPropNames2(from))
2222
2036
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2223
2037
  return to;
2224
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), isDevTools_exports = {};
2225
- __export2(isDevTools_exports, {
2226
- isDevTools: () => isDevTools
2038
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), useTheme_exports = {};
2039
+ __export2(useTheme_exports, {
2040
+ activeThemeManagers: () => activeThemeManagers,
2041
+ getThemeManager: () => getThemeManager,
2042
+ getThemeProxied: () => getThemeProxied,
2043
+ useChangeThemeEffect: () => useChangeThemeEffect,
2044
+ useTheme: () => useTheme,
2045
+ useThemeWithState: () => useThemeWithState
2227
2046
  });
2228
- module2.exports = __toCommonJS2(isDevTools_exports);
2229
- var isDevTools = (() => {
2230
- if (0)
2231
- try {
2232
- } catch {
2047
+ module2.exports = __toCommonJS2(useTheme_exports);
2048
+ var import_constants = require_index_native3(), import_react3 = 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;
2049
+ function getDefaultThemeProxied() {
2050
+ if (cached)
2051
+ return cached;
2052
+ let config = (0, import_config.getConfig)(), name = config.themes.light ? "light" : Object.keys(config.themes)[0], defaultTheme = config.themes[name];
2053
+ return cached = getThemeProxied({ theme: defaultTheme, name }), cached;
2054
+ }
2055
+ var useTheme = (props = emptyProps) => {
2056
+ let [_, theme] = useThemeWithState(props);
2057
+ return theme || getDefaultThemeProxied();
2058
+ }, useThemeWithState = (props) => {
2059
+ let keys = (0, import_react3.useRef)([]), changedThemeState = useChangeThemeEffect(
2060
+ props,
2061
+ !1,
2062
+ keys.current,
2063
+ import_constants.isServer ? void 0 : () => {
2064
+ var _a, _b;
2065
+ return ((_a = props.shouldUpdate) == null ? void 0 : _a.call(props)) ?? (keys.current.length > 0 ? !0 : void 0);
2066
+ }
2067
+ ), { themeManager, state } = changedThemeState, themeProxied = (0, import_react3.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]);
2068
+ return [changedThemeState, themeProxied];
2069
+ };
2070
+ function getThemeProxied({ theme, name, scheme }, deopt = !1, themeManager, keys, debug) {
2071
+ if (!theme)
2072
+ return {};
2073
+ let config = (0, import_config.getConfig)();
2074
+ function track(key) {
2075
+ keys && !keys.includes(key) && keys.push(key);
2076
+ }
2077
+ return new Proxy(theme, {
2078
+ has(_, key) {
2079
+ if (Reflect.has(theme, key))
2080
+ return !0;
2081
+ if (typeof key == "string")
2082
+ return key[0] === "$" && (key = key.slice(1)), themeManager == null ? void 0 : themeManager.allKeys.has(key);
2083
+ },
2084
+ get(_, key) {
2085
+ if (
2086
+ // dont ask me, idk why but on hermes you can see that useTheme()[undefined] passes in STRING undefined to proxy
2087
+ // if someone is crazy enough to use "undefined" as a theme key then this not working is on them
2088
+ key !== "undefined" && typeof key == "string"
2089
+ ) {
2090
+ let keyString = key[0] === "$" ? key.slice(1) : key, val = theme[keyString];
2091
+ if (val && typeof val == "object")
2092
+ return new Proxy(val, {
2093
+ // when they touch the actual value we only track it
2094
+ // if its a variable (web), its ignored!
2095
+ get(_2, subkey) {
2096
+ if (subkey === "val")
2097
+ track(keyString);
2098
+ else if (subkey === "get")
2099
+ return (platform) => {
2100
+ let outVal = (0, import_createVariable.getVariable)(val);
2101
+ if (platform !== "web" && import_constants.isIos && !deopt && config.settings.fastSchemeChange && !someParentIsInversed(themeManager) && scheme) {
2102
+ let oppositeThemeName = name.replace(
2103
+ scheme === "dark" ? "dark" : "light",
2104
+ scheme === "dark" ? "light" : "dark"
2105
+ ), oppositeTheme = config.themes[oppositeThemeName], oppositeVal = (0, import_createVariable.getVariable)(oppositeTheme == null ? void 0 : oppositeTheme[keyString]);
2106
+ if (oppositeVal)
2107
+ return {
2108
+ dynamic: {
2109
+ dark: scheme === "dark" ? outVal : oppositeVal,
2110
+ light: scheme === "light" ? outVal : oppositeVal
2111
+ }
2112
+ };
2113
+ }
2114
+ return track(keyString), outVal;
2115
+ };
2116
+ return Reflect.get(val, subkey);
2117
+ }
2118
+ });
2119
+ }
2120
+ return Reflect.get(_, key);
2121
+ }
2122
+ });
2123
+ }
2124
+ function someParentIsInversed(manager) {
2125
+ {
2126
+ let cur = manager;
2127
+ for (; cur; ) {
2128
+ if (!cur.parentManager)
2129
+ return !1;
2130
+ if (cur.parentManager.state.scheme !== cur.state.scheme)
2131
+ return !0;
2132
+ cur = cur.parentManager;
2233
2133
  }
2134
+ }
2234
2135
  return !1;
2235
- })();
2136
+ }
2137
+ var activeThemeManagers = /* @__PURE__ */ new Set(), _uidToManager = /* @__PURE__ */ new WeakMap(), _idToUID = {}, getId = (id) => _idToUID[id], getThemeManager = (id) => _uidToManager.get(getId(id)), registerThemeManager = (t) => {
2138
+ if (!_idToUID[t.id]) {
2139
+ let id = _idToUID[t.id] = {};
2140
+ _uidToManager.set(id, t);
2141
+ }
2142
+ }, useChangeThemeEffect = (props, isRoot = !1, keys, shouldUpdate) => {
2143
+ let { disable } = props, parentManagerId = (0, import_react3.useContext)(import_ThemeManagerContext.ThemeManagerIDContext), parentManager = getThemeManager(parentManagerId);
2144
+ if (!isRoot && !parentManager || disable)
2145
+ return {
2146
+ isNewTheme: !1,
2147
+ state: parentManager == null ? void 0 : parentManager.state,
2148
+ themeManager: parentManager
2149
+ };
2150
+ let [themeState, setThemeState] = (0, import_react3.useState)(createState), { state, mounted, isNewTheme, themeManager, inversed } = themeState, isInversingOnMount = !!(!themeState.mounted && props.inverse);
2151
+ function getShouldUpdateTheme(manager = themeManager, nextState, prevState = state, forceShouldChange = !1) {
2152
+ let forceUpdate = shouldUpdate == null ? void 0 : shouldUpdate();
2153
+ if (!manager || !forceShouldChange && forceUpdate === !1)
2154
+ return;
2155
+ let next = nextState || manager.getState(props, parentManager);
2156
+ if (forceShouldChange || next && !(forceUpdate !== !0 && !manager.getStateShouldChange(next, prevState)))
2157
+ return next;
2158
+ }
2159
+ if (import_constants.isServer || (0, import_react3.useEffect)(() => {
2160
+ if (!themeManager)
2161
+ return;
2162
+ if (props.inverse && !mounted) {
2163
+ setThemeState((prev) => createState({
2164
+ ...prev,
2165
+ mounted: !0
2166
+ }));
2167
+ return;
2168
+ }
2169
+ (isNewTheme || getShouldUpdateTheme(themeManager)) && (activeThemeManagers.add(themeManager), setThemeState(createState));
2170
+ let selfListenerDispose = themeManager.onChangeTheme((_a, _b, forced) => {
2171
+ forced && setThemeState((prev) => createState(prev, !0));
2172
+ }), disposeChangeListener = parentManager == null ? void 0 : parentManager.onChangeTheme(
2173
+ (name, manager, forced) => {
2174
+ let force = forced || (shouldUpdate == null ? void 0 : shouldUpdate()) || props.deopt || props["disable-child-theme"];
2175
+ (force ?? !!(keys != null && keys.length || isNewTheme)) && setThemeState((prev) => createState(prev, force));
2176
+ },
2177
+ themeManager.id
2178
+ );
2179
+ return () => {
2180
+ selfListenerDispose(), disposeChangeListener == null || disposeChangeListener(), isNewTheme && activeThemeManagers.delete(themeManager);
2181
+ };
2182
+ }, [
2183
+ themeManager,
2184
+ parentManager,
2185
+ isNewTheme,
2186
+ props.componentName,
2187
+ props.inverse,
2188
+ props.name,
2189
+ props.reset,
2190
+ mounted
2191
+ ]), isInversingOnMount)
2192
+ return {
2193
+ isNewTheme: !1,
2194
+ inversed: !1,
2195
+ themeManager: parentManager,
2196
+ state: {
2197
+ name: "",
2198
+ ...parentManager == null ? void 0 : parentManager.state,
2199
+ className: ""
2200
+ }
2201
+ };
2202
+ return {
2203
+ state,
2204
+ isNewTheme,
2205
+ inversed,
2206
+ themeManager
2207
+ };
2208
+ function createState(prev, force = !1) {
2209
+ if (prev && (shouldUpdate == null ? void 0 : shouldUpdate()) === !1 && !force)
2210
+ return prev;
2211
+ let themeManager2 = parentManager, state2;
2212
+ if ((0, import_ThemeManager.getHasThemeUpdatingProps)(props)) {
2213
+ let getNewThemeManager = () => new import_ThemeManager.ThemeManager(props, isRoot ? "root" : parentManager);
2214
+ if (prev != null && prev.themeManager) {
2215
+ themeManager2 = prev.themeManager;
2216
+ let forceChange = force || !!(keys != null && keys.length), next = themeManager2.getState(props, parentManager), nextState = getShouldUpdateTheme(
2217
+ themeManager2,
2218
+ next,
2219
+ prev.state,
2220
+ forceChange
2221
+ );
2222
+ nextState ? (state2 = nextState, prev.isNewTheme ? themeManager2.updateState(nextState) : themeManager2 = getNewThemeManager()) : prev.isNewTheme && parentManager && !next && (themeManager2 = parentManager);
2223
+ } else
2224
+ themeManager2 = getNewThemeManager(), state2 = { ...themeManager2.state };
2225
+ }
2226
+ let isNewTheme2 = !!(themeManager2 !== parentManager || props.inverse);
2227
+ isNewTheme2 && registerThemeManager(themeManager2);
2228
+ let mounted2 = props.inverse ? isRoot || (prev == null ? void 0 : prev.mounted) : !0;
2229
+ state2 || (isNewTheme2 ? state2 = themeManager2.state : (state2 = parentManager.state, themeManager2 = parentManager));
2230
+ 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 = {
2231
+ themeManager: themeManager2,
2232
+ isNewTheme: isNewTheme2,
2233
+ mounted: mounted2,
2234
+ inversed: inversed2
2235
+ }, shouldReturnPrev = prev && !force && // isEqualShallow uses the second arg as the keys so this should compare without state first...
2236
+ (0, import_createShallowSetState.isEqualShallow)(prev, response) && // ... and then compare just the state, because we make a new state obj but is likely the same
2237
+ (0, import_createShallowSetState.isEqualShallow)(prev.state, state2);
2238
+ return prev && shouldReturnPrev ? prev : (response.state = state2, response);
2239
+ }
2240
+ };
2236
2241
  }
2237
2242
  });
2238
2243
 
2239
- // ../web/dist/cjs/helpers/getGroupPropParts.native.js
2240
- var require_getGroupPropParts_native = __commonJS({
2241
- "../web/dist/cjs/helpers/getGroupPropParts.native.js"(exports2, module2) {
2244
+ // ../web/dist/cjs/Tamagui.native.js
2245
+ var require_Tamagui_native = __commonJS({
2246
+ "../web/dist/cjs/Tamagui.native.js"(exports2, module2) {
2242
2247
  "use strict";
2243
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2248
+ var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2244
2249
  for (var name in all)
2245
2250
  __defProp2(target, name, { get: all[name], enumerable: !0 });
2246
2251
  }, __copyProps2 = (to, from, except, desc) => {
@@ -2248,24 +2253,31 @@ var require_getGroupPropParts_native = __commonJS({
2248
2253
  for (let key of __getOwnPropNames2(from))
2249
2254
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2250
2255
  return to;
2251
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), getGroupPropParts_exports = {};
2252
- __export2(getGroupPropParts_exports, {
2253
- getGroupPropParts: () => getGroupPropParts
2256
+ }, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
2257
+ // If the importer is in node compatibility mode or this is not an ESM
2258
+ // file that has been converted to a CommonJS file using a Babel-
2259
+ // compatible transform (i.e. "__esModule" has not been set), then set
2260
+ // "default" to the CommonJS "module.exports" for node compatibility.
2261
+ isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: !0 }) : target,
2262
+ mod
2263
+ )), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), Tamagui_exports = {};
2264
+ __export2(Tamagui_exports, {
2265
+ Tamagui: () => Tamagui,
2266
+ getValueFromIdentifier: () => getValueFromIdentifier,
2267
+ setIdentifierValue: () => setIdentifierValue
2254
2268
  });
2255
- module2.exports = __toCommonJS2(getGroupPropParts_exports);
2256
- var import_useMedia = require_useMedia_native();
2257
- function getGroupPropParts(groupProp) {
2258
- let mediaQueries = (0, import_useMedia.getMedia)(), [_, name, part3, part4] = groupProp.split("-"), pseudo, media = part3 in mediaQueries ? part3 : void 0;
2259
- return media ? pseudo = part4 : pseudo = part3, { name, pseudo, media };
2260
- }
2269
+ module2.exports = __toCommonJS2(Tamagui_exports);
2270
+ var Helpers = __toESM2(require_index_native4()), 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) => {
2271
+ identifierToValue.set(identifier, value);
2272
+ };
2261
2273
  }
2262
2274
  });
2263
2275
 
2264
- // ../web/dist/cjs/helpers/createMediaStyle.native.js
2265
- var require_createMediaStyle_native = __commonJS({
2266
- "../web/dist/cjs/helpers/createMediaStyle.native.js"(exports2, module2) {
2276
+ // ../compose-refs/dist/cjs/compose-refs.native.js
2277
+ var require_compose_refs_native = __commonJS({
2278
+ "../compose-refs/dist/cjs/compose-refs.native.js"(exports2, module2) {
2267
2279
  "use strict";
2268
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2280
+ var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2269
2281
  for (var name in all)
2270
2282
  __defProp2(target, name, { get: all[name], enumerable: !0 });
2271
2283
  }, __copyProps2 = (to, from, except, desc) => {
@@ -2273,18 +2285,372 @@ var require_createMediaStyle_native = __commonJS({
2273
2285
  for (let key of __getOwnPropNames2(from))
2274
2286
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2275
2287
  return to;
2276
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createMediaStyle_exports = {};
2277
- __export2(createMediaStyle_exports, {
2278
- MEDIA_SEP: () => MEDIA_SEP,
2279
- createMediaStyle: () => createMediaStyle
2288
+ }, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
2289
+ // If the importer is in node compatibility mode or this is not an ESM
2290
+ // file that has been converted to a CommonJS file using a Babel-
2291
+ // compatible transform (i.e. "__esModule" has not been set), then set
2292
+ // "default" to the CommonJS "module.exports" for node compatibility.
2293
+ isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: !0 }) : target,
2294
+ mod
2295
+ )), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), compose_refs_exports = {};
2296
+ __export2(compose_refs_exports, {
2297
+ composeRefs: () => composeRefs,
2298
+ useComposedRefs: () => useComposedRefs
2280
2299
  });
2281
- module2.exports = __toCommonJS2(createMediaStyle_exports);
2282
- var import_config = require_config_native(), import_useMedia = require_useMedia_native(), import_getGroupPropParts = require_getGroupPropParts_native(), MEDIA_SEP = "_", prefixes = null, selectors = null, groupPseudoToPseudoCSSMap = {
2283
- press: "active"
2284
- }, createMediaStyle = (styleObject, mediaKeyIn, mediaQueries, type, negate, priority) => {
2285
- 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(";");
2286
- if (isNonWindowMedia) {
2287
- let precedenceImportancePrefix = new Array((priority || 0) + (isGroup ? 1 : 0)).fill(":root").join("");
2300
+ module2.exports = __toCommonJS2(compose_refs_exports);
2301
+ var React = __toESM2(require("react"));
2302
+ function setRef(ref, value) {
2303
+ typeof ref == "function" ? ref(value) : ref && (ref.current = value);
2304
+ }
2305
+ function composeRefs(...refs) {
2306
+ return (node) => refs.forEach((ref) => setRef(ref, node));
2307
+ }
2308
+ function useComposedRefs(...refs) {
2309
+ return React.useCallback(composeRefs(...refs), refs);
2310
+ }
2311
+ }
2312
+ });
2313
+
2314
+ // ../compose-refs/dist/cjs/index.native.js
2315
+ var require_index_native5 = __commonJS({
2316
+ "../compose-refs/dist/cjs/index.native.js"(exports2, module2) {
2317
+ "use strict";
2318
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __copyProps2 = (to, from, except, desc) => {
2319
+ if (from && typeof from == "object" || typeof from == "function")
2320
+ for (let key of __getOwnPropNames2(from))
2321
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2322
+ return to;
2323
+ }, __reExport2 = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default")), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), src_exports2 = {};
2324
+ module2.exports = __toCommonJS2(src_exports2);
2325
+ __reExport2(src_exports2, require_compose_refs_native(), module2.exports);
2326
+ }
2327
+ });
2328
+
2329
+ // ../use-did-finish-ssr/dist/cjs/index.native.js
2330
+ var require_index_native6 = __commonJS({
2331
+ "../use-did-finish-ssr/dist/cjs/index.native.js"(exports2, module2) {
2332
+ "use strict";
2333
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2334
+ for (var name in all)
2335
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
2336
+ }, __copyProps2 = (to, from, except, desc) => {
2337
+ if (from && typeof from == "object" || typeof from == "function")
2338
+ for (let key of __getOwnPropNames2(from))
2339
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2340
+ return to;
2341
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), src_exports2 = {};
2342
+ __export2(src_exports2, {
2343
+ useClientValue: () => useClientValue,
2344
+ useDidFinishSSR: () => useDidFinishSSR
2345
+ });
2346
+ module2.exports = __toCommonJS2(src_exports2);
2347
+ var import_react3 = require("react");
2348
+ function useDidFinishSSR(value) {
2349
+ return value ?? !0;
2350
+ }
2351
+ function useClientValue(value) {
2352
+ return useDidFinishSSR() ? typeof value == "function" ? value() : value : void 0;
2353
+ }
2354
+ }
2355
+ });
2356
+
2357
+ // ../web/dist/cjs/helpers/objectIdentityKey.native.js
2358
+ var require_objectIdentityKey_native = __commonJS({
2359
+ "../web/dist/cjs/helpers/objectIdentityKey.native.js"(exports2, module2) {
2360
+ "use strict";
2361
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2362
+ for (var name in all)
2363
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
2364
+ }, __copyProps2 = (to, from, except, desc) => {
2365
+ if (from && typeof from == "object" || typeof from == "function")
2366
+ for (let key of __getOwnPropNames2(from))
2367
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2368
+ return to;
2369
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), objectIdentityKey_exports = {};
2370
+ __export2(objectIdentityKey_exports, {
2371
+ objectIdentityKey: () => objectIdentityKey
2372
+ });
2373
+ module2.exports = __toCommonJS2(objectIdentityKey_exports);
2374
+ function objectIdentityKey(obj) {
2375
+ let k = "";
2376
+ for (let key in obj) {
2377
+ k += key;
2378
+ let arg = obj[key], type = typeof arg;
2379
+ if (!arg || type !== "object" && type !== "function")
2380
+ k += type + arg;
2381
+ else if (cache.has(arg))
2382
+ k += cache.get(arg);
2383
+ else {
2384
+ let v = Math.random();
2385
+ cache.set(arg, v), k += v;
2386
+ }
2387
+ }
2388
+ return k;
2389
+ }
2390
+ var cache = /* @__PURE__ */ new WeakMap();
2391
+ }
2392
+ });
2393
+
2394
+ // ../web/dist/cjs/helpers/createStyledContext.native.js
2395
+ var require_createStyledContext_native = __commonJS({
2396
+ "../web/dist/cjs/helpers/createStyledContext.native.js"(exports2, module2) {
2397
+ "use strict";
2398
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2399
+ for (var name in all)
2400
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
2401
+ }, __copyProps2 = (to, from, except, desc) => {
2402
+ if (from && typeof from == "object" || typeof from == "function")
2403
+ for (let key of __getOwnPropNames2(from))
2404
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2405
+ return to;
2406
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createStyledContext_exports = {};
2407
+ __export2(createStyledContext_exports, {
2408
+ createStyledContext: () => createStyledContext
2409
+ });
2410
+ module2.exports = __toCommonJS2(createStyledContext_exports);
2411
+ var import_react3 = require("react"), import_objectIdentityKey = require_objectIdentityKey_native(), import_jsx_runtime = require("react/jsx-runtime");
2412
+ function createStyledContext(defaultValues) {
2413
+ let OGContext = (0, import_react3.createContext)(defaultValues), OGProvider = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map(), Provider = ({
2414
+ children,
2415
+ scope,
2416
+ ...values
2417
+ }) => {
2418
+ let next = (0, import_react3.useMemo)(() => ({
2419
+ // this ! is a workaround for ts error
2420
+ ...defaultValues,
2421
+ ...values
2422
+ }), [(0, import_objectIdentityKey.objectIdentityKey)(values)]), Provider2 = OGProvider;
2423
+ if (scope) {
2424
+ let ScopedContext = scopedContexts.get(scope);
2425
+ ScopedContext || (ScopedContext = (0, import_react3.createContext)(defaultValues), scopedContexts.set(scope, ScopedContext)), Provider2 = ScopedContext.Provider;
2426
+ }
2427
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Provider2, { value: next, children });
2428
+ }, useStyledContext = (scope) => {
2429
+ let context = scope ? scopedContexts.get(scope) : OGContext;
2430
+ return (0, import_react3.useContext)(context);
2431
+ };
2432
+ return Context.Provider = Provider, Context.props = defaultValues, Context.context = OGContext, Context.useStyledContext = useStyledContext, Context;
2433
+ }
2434
+ }
2435
+ });
2436
+
2437
+ // ../web/dist/cjs/contexts/ComponentContext.native.js
2438
+ var require_ComponentContext_native = __commonJS({
2439
+ "../web/dist/cjs/contexts/ComponentContext.native.js"(exports2, module2) {
2440
+ "use strict";
2441
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2442
+ for (var name in all)
2443
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
2444
+ }, __copyProps2 = (to, from, except, desc) => {
2445
+ if (from && typeof from == "object" || typeof from == "function")
2446
+ for (let key of __getOwnPropNames2(from))
2447
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2448
+ return to;
2449
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ComponentContext_exports = {};
2450
+ __export2(ComponentContext_exports, {
2451
+ ComponentContext: () => ComponentContext
2452
+ });
2453
+ module2.exports = __toCommonJS2(ComponentContext_exports);
2454
+ var import_createStyledContext = require_createStyledContext_native(), ComponentContext = (0, import_createStyledContext.createStyledContext)({
2455
+ disableSSR: void 0,
2456
+ inText: !1,
2457
+ language: null,
2458
+ animationDriver: null,
2459
+ groups: {
2460
+ emit: null,
2461
+ subscribe: null,
2462
+ state: {}
2463
+ }
2464
+ });
2465
+ }
2466
+ });
2467
+
2468
+ // ../web/dist/cjs/defaultComponentState.native.js
2469
+ var require_defaultComponentState_native = __commonJS({
2470
+ "../web/dist/cjs/defaultComponentState.native.js"(exports2, module2) {
2471
+ "use strict";
2472
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2473
+ for (var name in all)
2474
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
2475
+ }, __copyProps2 = (to, from, except, desc) => {
2476
+ if (from && typeof from == "object" || typeof from == "function")
2477
+ for (let key of __getOwnPropNames2(from))
2478
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2479
+ return to;
2480
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), defaultComponentState_exports = {};
2481
+ __export2(defaultComponentState_exports, {
2482
+ defaultComponentState: () => defaultComponentState,
2483
+ defaultComponentStateMounted: () => defaultComponentStateMounted,
2484
+ defaultComponentStateShouldEnter: () => defaultComponentStateShouldEnter
2485
+ });
2486
+ module2.exports = __toCommonJS2(defaultComponentState_exports);
2487
+ var defaultComponentState = {
2488
+ hover: !1,
2489
+ press: !1,
2490
+ pressIn: !1,
2491
+ focus: !1,
2492
+ unmounted: !0
2493
+ }, defaultComponentStateMounted = {
2494
+ ...defaultComponentState,
2495
+ unmounted: !1
2496
+ }, defaultComponentStateShouldEnter = {
2497
+ ...defaultComponentState,
2498
+ unmounted: "should-enter"
2499
+ };
2500
+ }
2501
+ });
2502
+
2503
+ // ../web/dist/cjs/constants/accessibilityDirectMap.native.js
2504
+ var require_accessibilityDirectMap_native = __commonJS({
2505
+ "../web/dist/cjs/constants/accessibilityDirectMap.native.js"(exports2, module2) {
2506
+ "use strict";
2507
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2508
+ for (var name in all)
2509
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
2510
+ }, __copyProps2 = (to, from, except, desc) => {
2511
+ if (from && typeof from == "object" || typeof from == "function")
2512
+ for (let key of __getOwnPropNames2(from))
2513
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2514
+ return to;
2515
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), accessibilityDirectMap_native_exports = {};
2516
+ __export2(accessibilityDirectMap_native_exports, {
2517
+ accessibilityDirectMap: () => accessibilityDirectMap,
2518
+ accessibilityWebRoleToNativeRole: () => accessibilityWebRoleToNativeRole,
2519
+ nativeAccessibilityState: () => nativeAccessibilityState,
2520
+ nativeAccessibilityValue: () => nativeAccessibilityValue,
2521
+ webToNativeAccessibilityDirectMap: () => webToNativeAccessibilityDirectMap
2522
+ });
2523
+ module2.exports = __toCommonJS2(accessibilityDirectMap_native_exports);
2524
+ var accessibilityDirectMap = {}, webToNativeAccessibilityDirectMap = {
2525
+ "aria-label": "accessibilityLabel",
2526
+ "aria-labelledby": "accessibilityLabelledBy",
2527
+ "aria-live": "accessibilityLiveRegion",
2528
+ "aria-modal": "accessibilityViewIsModal",
2529
+ "aria-hidden": "accessibilityElementsHidden"
2530
+ }, nativeAccessibilityValue = {
2531
+ "aria-valuemin": "min",
2532
+ "aria-valuemax": "max",
2533
+ "aria-valuenow": "now",
2534
+ "aria-valuetext": "text"
2535
+ }, nativeAccessibilityState = {
2536
+ "aria-disabled": "disabled",
2537
+ "aria-selected": "selected",
2538
+ "aria-checked": "checked",
2539
+ "aria-busy": "busy",
2540
+ "aria-expanded": "expanded"
2541
+ }, accessibilityWebRoleToNativeRole = {
2542
+ alert: "alert",
2543
+ button: "button",
2544
+ checkbox: "checkbox",
2545
+ combobox: "combobox",
2546
+ grid: "grid",
2547
+ group: "none",
2548
+ heading: "header",
2549
+ imagebutton: "imagebutton",
2550
+ img: "image",
2551
+ keyboardkey: "keyboardkey",
2552
+ link: "link",
2553
+ menu: "menu",
2554
+ menubar: "menubar",
2555
+ menuitem: "menuitem",
2556
+ none: "none",
2557
+ presentation: "none",
2558
+ progressbar: "progressbar",
2559
+ radio: "radio",
2560
+ radiogroup: "radiogroup",
2561
+ region: "summary",
2562
+ scrollbar: "scrollbar",
2563
+ searchbox: "search",
2564
+ slider: "adjustable",
2565
+ spinbutton: "spinbutton",
2566
+ summary: "summary",
2567
+ switch: "switch",
2568
+ tab: "tab",
2569
+ tablist: "tablist",
2570
+ text: "text",
2571
+ timer: "timer",
2572
+ togglebutton: "togglebutton",
2573
+ toolbar: "toolbar"
2574
+ };
2575
+ }
2576
+ });
2577
+
2578
+ // ../web/dist/cjs/constants/isDevTools.native.js
2579
+ var require_isDevTools_native = __commonJS({
2580
+ "../web/dist/cjs/constants/isDevTools.native.js"(exports2, module2) {
2581
+ "use strict";
2582
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2583
+ for (var name in all)
2584
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
2585
+ }, __copyProps2 = (to, from, except, desc) => {
2586
+ if (from && typeof from == "object" || typeof from == "function")
2587
+ for (let key of __getOwnPropNames2(from))
2588
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2589
+ return to;
2590
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), isDevTools_exports = {};
2591
+ __export2(isDevTools_exports, {
2592
+ isDevTools: () => isDevTools
2593
+ });
2594
+ module2.exports = __toCommonJS2(isDevTools_exports);
2595
+ var isDevTools = (() => {
2596
+ if (0)
2597
+ try {
2598
+ } catch {
2599
+ }
2600
+ return !1;
2601
+ })();
2602
+ }
2603
+ });
2604
+
2605
+ // ../web/dist/cjs/helpers/getGroupPropParts.native.js
2606
+ var require_getGroupPropParts_native = __commonJS({
2607
+ "../web/dist/cjs/helpers/getGroupPropParts.native.js"(exports2, module2) {
2608
+ "use strict";
2609
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2610
+ for (var name in all)
2611
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
2612
+ }, __copyProps2 = (to, from, except, desc) => {
2613
+ if (from && typeof from == "object" || typeof from == "function")
2614
+ for (let key of __getOwnPropNames2(from))
2615
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2616
+ return to;
2617
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), getGroupPropParts_exports = {};
2618
+ __export2(getGroupPropParts_exports, {
2619
+ getGroupPropParts: () => getGroupPropParts
2620
+ });
2621
+ module2.exports = __toCommonJS2(getGroupPropParts_exports);
2622
+ var import_useMedia = require_useMedia_native();
2623
+ function getGroupPropParts(groupProp) {
2624
+ let mediaQueries = (0, import_useMedia.getMedia)(), [_, name, part3, part4] = groupProp.split("-"), pseudo, media = part3 in mediaQueries ? part3 : void 0;
2625
+ return media ? pseudo = part4 : pseudo = part3, { name, pseudo, media };
2626
+ }
2627
+ }
2628
+ });
2629
+
2630
+ // ../web/dist/cjs/helpers/createMediaStyle.native.js
2631
+ var require_createMediaStyle_native = __commonJS({
2632
+ "../web/dist/cjs/helpers/createMediaStyle.native.js"(exports2, module2) {
2633
+ "use strict";
2634
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
2635
+ for (var name in all)
2636
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
2637
+ }, __copyProps2 = (to, from, except, desc) => {
2638
+ if (from && typeof from == "object" || typeof from == "function")
2639
+ for (let key of __getOwnPropNames2(from))
2640
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2641
+ return to;
2642
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createMediaStyle_exports = {};
2643
+ __export2(createMediaStyle_exports, {
2644
+ MEDIA_SEP: () => MEDIA_SEP,
2645
+ createMediaStyle: () => createMediaStyle
2646
+ });
2647
+ module2.exports = __toCommonJS2(createMediaStyle_exports);
2648
+ var import_config = require_config_native(), import_useMedia = require_useMedia_native(), import_getGroupPropParts = require_getGroupPropParts_native(), MEDIA_SEP = "_", prefixes = null, selectors = null, groupPseudoToPseudoCSSMap = {
2649
+ press: "active"
2650
+ }, createMediaStyle = (styleObject, mediaKeyIn, mediaQueries, type, negate, priority) => {
2651
+ 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(";");
2652
+ if (isNonWindowMedia) {
2653
+ let precedenceImportancePrefix = new Array((priority || 0) + (isGroup ? 1 : 0)).fill(":root").join("");
2288
2654
  if (isTheme || isGroup) {
2289
2655
  let groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyIn), mediaName = groupInfo == null ? void 0 : groupInfo.name;
2290
2656
  groupMediaKey = groupInfo == null ? void 0 : groupInfo.media, isGroup && (containerName = mediaName);
@@ -3802,256 +4168,43 @@ var require_getSplitStyles_native = __commonJS({
3802
4168
  disableClassName: 1,
3803
4169
  debug: 1,
3804
4170
  componentName: 1,
3805
- disableOptimization: 1,
3806
- tag: 1,
3807
- style: 1,
3808
- // handled after loop so pseudos set usedKeys and override it if necessary
3809
- group: 1
3810
- };
3811
- skipProps["data-test-renders"] = 1;
3812
- Object.assign(skipProps, {
3813
- whiteSpace: 1,
3814
- wordWrap: 1,
3815
- textOverflow: 1,
3816
- textDecorationDistance: 1,
3817
- cursor: 1,
3818
- contain: 1,
3819
- boxSizing: 1,
3820
- boxShadow: 1,
3821
- outlineStyle: 1,
3822
- outlineOffset: 1,
3823
- outlineWidth: 1,
3824
- outlineColor: 1
3825
- });
3826
- function passDownProp(viewProps, key, val, shouldMergeObject = !1) {
3827
- if (shouldMergeObject) {
3828
- let next = {
3829
- ...viewProps[key],
3830
- ...val
3831
- };
3832
- delete viewProps[key], viewProps[key] = next;
3833
- } else
3834
- viewProps[key] = val;
3835
- }
3836
- }
3837
- });
3838
-
3839
- // ../web/dist/cjs/helpers/mergeProps.native.js
3840
- var require_mergeProps_native = __commonJS({
3841
- "../web/dist/cjs/helpers/mergeProps.native.js"(exports2, module2) {
3842
- "use strict";
3843
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
3844
- for (var name in all)
3845
- __defProp2(target, name, { get: all[name], enumerable: !0 });
3846
- }, __copyProps2 = (to, from, except, desc) => {
3847
- if (from && typeof from == "object" || typeof from == "function")
3848
- for (let key of __getOwnPropNames2(from))
3849
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
3850
- return to;
3851
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), mergeProps_exports = {};
3852
- __export2(mergeProps_exports, {
3853
- mergeProps: () => mergeProps
3854
- });
3855
- module2.exports = __toCommonJS2(mergeProps_exports);
3856
- var import_useMedia = require_useMedia_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), mergeProps = (a, b, inverseShorthands) => {
3857
- let out = {};
3858
- for (let key in a)
3859
- mergeProp(out, a, b, key, inverseShorthands);
3860
- if (b)
3861
- for (let key in b)
3862
- mergeProp(out, b, void 0, key, inverseShorthands);
3863
- return out;
3864
- };
3865
- function mergeProp(out, a, b, key, inverseShorthands) {
3866
- let longhand = (inverseShorthands == null ? void 0 : inverseShorthands[key]) || null, val = a[key];
3867
- if (key in import_pseudoDescriptors.pseudoDescriptors || import_useMedia.mediaKeys.has(key)) {
3868
- out[key] = {
3869
- ...out[key],
3870
- ...val
3871
- };
3872
- return;
3873
- }
3874
- b && (key in b || longhand && longhand in b) || (out[longhand || key] = val);
3875
- }
3876
- }
3877
- });
3878
-
3879
- // ../web/dist/cjs/helpers/ThemeManagerContext.native.js
3880
- var require_ThemeManagerContext_native = __commonJS({
3881
- "../web/dist/cjs/helpers/ThemeManagerContext.native.js"(exports2, module2) {
3882
- "use strict";
3883
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
3884
- for (var name in all)
3885
- __defProp2(target, name, { get: all[name], enumerable: !0 });
3886
- }, __copyProps2 = (to, from, except, desc) => {
3887
- if (from && typeof from == "object" || typeof from == "function")
3888
- for (let key of __getOwnPropNames2(from))
3889
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
3890
- return to;
3891
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ThemeManagerContext_exports = {};
3892
- __export2(ThemeManagerContext_exports, {
3893
- ThemeManagerIDContext: () => ThemeManagerIDContext
3894
- });
3895
- module2.exports = __toCommonJS2(ThemeManagerContext_exports);
3896
- var import_react3 = require("react"), ThemeManagerIDContext = (0, import_react3.createContext)(1);
3897
- }
3898
- });
3899
-
3900
- // ../web/dist/cjs/helpers/ThemeManager.native.js
3901
- var require_ThemeManager_native = __commonJS({
3902
- "../web/dist/cjs/helpers/ThemeManager.native.js"(exports2, module2) {
3903
- "use strict";
3904
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
3905
- for (var name in all)
3906
- __defProp2(target, name, { get: all[name], enumerable: !0 });
3907
- }, __copyProps2 = (to, from, except, desc) => {
3908
- if (from && typeof from == "object" || typeof from == "function")
3909
- for (let key of __getOwnPropNames2(from))
3910
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
3911
- return to;
3912
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ThemeManager_exports = {};
3913
- __export2(ThemeManager_exports, {
3914
- ThemeManager: () => ThemeManager,
3915
- getHasThemeUpdatingProps: () => getHasThemeUpdatingProps,
3916
- getManagers: () => getManagers
3917
- });
3918
- module2.exports = __toCommonJS2(ThemeManager_exports);
3919
- var import_constants = require_index_native3(), import_config = require_config_native(), import_constants2 = require_constants_native2(), emptyState = { name: "" };
3920
- function getHasThemeUpdatingProps(props) {
3921
- return !!(props.name || props.componentName || props.inverse || props.reset);
3922
- }
3923
- var uid = 0, ThemeManager = class {
3924
- constructor(props = {}, parentManager) {
3925
- 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") {
3926
- this.updateStateFromProps(props, !1);
3927
- return;
3928
- }
3929
- if (!parentManager)
3930
- throw new Error(
3931
- "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."
3932
- );
3933
- if (this.parentManager = parentManager, !this.updateStateFromProps(props, !1))
3934
- return parentManager;
3935
- }
3936
- updateStateFromProps(props = this.props || {}, shouldNotify = !0) {
3937
- if (this.props = props, props.forceTheme)
3938
- return this.state.theme = props.forceTheme, this.state.name = props.name || "", this.updateState(this.state, !0), this.state;
3939
- let nextState = this.getStateIfChanged(props);
3940
- if (nextState)
3941
- return this.updateState(nextState, shouldNotify), nextState;
3942
- }
3943
- updateState(nextState, shouldNotify = !0) {
3944
- this.state = nextState, this._allKeys = null, this._numChangeEventsSent ??= 0, this._numChangeEventsSent++, shouldNotify && this.notify();
3945
- }
3946
- getStateIfChanged(props = this.props, state = this.state, parentManager = this.parentManager) {
3947
- let _ = this.getState(props, parentManager);
3948
- if (state && state !== emptyState && !_)
3949
- return parentManager == null ? void 0 : parentManager.state;
3950
- if (this.getStateShouldChange(_, state))
3951
- return _;
3952
- }
3953
- getStateShouldChange(nextState, state = this.state) {
3954
- return !(!(nextState != null && nextState.theme) || nextState.theme === (state == null ? void 0 : state.theme));
3955
- }
3956
- getState(props = this.props, parentManager = this.parentManager) {
3957
- return getState(props, parentManager) || (parentManager == null ? void 0 : parentManager.state) || null;
3958
- }
3959
- get allKeys() {
3960
- var _a;
3961
- return this._allKeys ||= /* @__PURE__ */ new Set([
3962
- ...((_a = this.parentManager) == null ? void 0 : _a.allKeys) || [],
3963
- ...Object.keys(this.state.theme || {})
3964
- ]), this._allKeys;
3965
- }
3966
- notify(forced = !1) {
3967
- this.themeListeners.forEach((cb) => cb(this.state.name, this, forced));
3968
- }
3969
- onChangeTheme(cb, debugId) {
3970
- return debugId && (this._listeningIds ??= /* @__PURE__ */ new Set(), this._listeningIds.add(debugId)), this.themeListeners.add(cb), () => {
3971
- this.themeListeners.delete(cb);
3972
- };
3973
- }
3974
- };
3975
- function getState(props, manager) {
3976
- var _a;
3977
- if (props.name && props.reset)
3978
- throw new Error(
3979
- "Cannot reset and set a new name at the same time."
3980
- );
3981
- if (!getHasThemeUpdatingProps(props))
3982
- return null;
3983
- 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];
3984
- if (!baseManager && props.reset)
3985
- return console.warn("Cannot reset, no parent theme exists"), null;
3986
- let { componentName } = props, result = null, baseName = (baseManager == null ? void 0 : baseManager.state.name) || "";
3987
- baseManager != null && baseManager.state.isComponent && (baseName = baseName.replace(/_[A-Z][A-Za-z]+/, ""));
3988
- let nextName = props.reset ? baseName : props.name || "", allComponentThemes = componentManagers.map((x) => (x == null ? void 0 : x.state.name) || "");
3989
- isDirectParentAComponentTheme && allComponentThemes.shift();
3990
- let base = baseName.split(import_constants2.THEME_NAME_SEPARATOR), max = base.length, min = props.componentName && !nextName ? max : 0;
3991
- for (let i = max; i >= min; i--) {
3992
- let prefix = base.slice(0, i).join(import_constants2.THEME_NAME_SEPARATOR);
3993
- props.inverse && (prefix = inverseThemeName(prefix));
3994
- let potentials = [];
3995
- if (prefix && prefix !== baseName && potentials.push(prefix), nextName && potentials.unshift(prefix ? `${prefix}_${nextName}` : nextName), i === 1) {
3996
- let lastSegment = potentials.findIndex((x) => !x.includes("_"));
3997
- lastSegment > 0 && potentials.splice(lastSegment, 0, nextName);
3998
- }
3999
- if (componentName && !props.reset) {
4000
- let baseLen = base.length, componentPotentials = [];
4001
- if (nextName && baseLen > 1) {
4002
- let beforeSeparator = base[0];
4003
- componentPotentials.push(`${beforeSeparator}_${nextName}_${componentName}`);
4004
- }
4005
- if (componentPotentials.push(`${prefix}_${componentName}`), nextName) {
4006
- if (i > baseLen) {
4007
- let prefixLessOne = base.slice(0, i - 1).join(import_constants2.THEME_NAME_SEPARATOR);
4008
- if (prefixLessOne) {
4009
- let lessSpecific = `${prefixLessOne}_${nextName}_${componentName}`;
4010
- componentPotentials.unshift(lessSpecific);
4011
- }
4012
- }
4013
- let moreSpecific = `${prefix}_${nextName}_${componentName}`;
4014
- componentPotentials.unshift(moreSpecific);
4015
- }
4016
- potentials = [...componentPotentials, ...potentials, ...allComponentThemes];
4017
- }
4018
- let found = potentials.find((t) => t in themes);
4019
- if (typeof props.debug == "string" && console.info(" getState ", {
4020
- props,
4021
- found,
4022
- potentials,
4023
- baseManager,
4024
- nextName,
4025
- baseName,
4026
- prefix
4027
- }), found) {
4028
- 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_constants2.THEME_CLASSNAME_PREFIX, className = import_constants.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;
4029
- result = {
4030
- name: found,
4031
- parentName,
4032
- theme: themes[found],
4033
- className,
4034
- isComponent,
4035
- scheme
4036
- };
4037
- break;
4038
- }
4039
- }
4040
- return props.debug === "verbose" && typeof window < "u" && (console.groupCollapsed("ThemeManager.getState()"), console.info({ props, baseName, base, min, max }), console.warn("result", { result }), console.trace(), console.groupEnd()), result;
4041
- }
4042
- var inverseThemeName = (themeName) => themeName.startsWith("light") ? themeName.replace(/^light/, "dark") : themeName.replace(/^dark/, "light");
4043
- function getManagers(themeManager) {
4044
- let comp = [], all = [], cur = themeManager;
4045
- for (; cur; )
4046
- all.push(cur), cur.state.isComponent && comp.push(cur), cur = cur.parentManager;
4047
- return [all, comp];
4171
+ disableOptimization: 1,
4172
+ tag: 1,
4173
+ style: 1,
4174
+ // handled after loop so pseudos set usedKeys and override it if necessary
4175
+ group: 1
4176
+ };
4177
+ skipProps["data-test-renders"] = 1;
4178
+ Object.assign(skipProps, {
4179
+ whiteSpace: 1,
4180
+ wordWrap: 1,
4181
+ textOverflow: 1,
4182
+ textDecorationDistance: 1,
4183
+ cursor: 1,
4184
+ contain: 1,
4185
+ boxSizing: 1,
4186
+ boxShadow: 1,
4187
+ outlineStyle: 1,
4188
+ outlineOffset: 1,
4189
+ outlineWidth: 1,
4190
+ outlineColor: 1
4191
+ });
4192
+ function passDownProp(viewProps, key, val, shouldMergeObject = !1) {
4193
+ if (shouldMergeObject) {
4194
+ let next = {
4195
+ ...viewProps[key],
4196
+ ...val
4197
+ };
4198
+ delete viewProps[key], viewProps[key] = next;
4199
+ } else
4200
+ viewProps[key] = val;
4048
4201
  }
4049
4202
  }
4050
4203
  });
4051
4204
 
4052
- // ../web/dist/cjs/hooks/useTheme.native.js
4053
- var require_useTheme_native = __commonJS({
4054
- "../web/dist/cjs/hooks/useTheme.native.js"(exports2, module2) {
4205
+ // ../web/dist/cjs/helpers/mergeProps.native.js
4206
+ var require_mergeProps_native = __commonJS({
4207
+ "../web/dist/cjs/helpers/mergeProps.native.js"(exports2, module2) {
4055
4208
  "use strict";
4056
4209
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
4057
4210
  for (var name in all)
@@ -4061,209 +4214,31 @@ var require_useTheme_native = __commonJS({
4061
4214
  for (let key of __getOwnPropNames2(from))
4062
4215
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
4063
4216
  return to;
4064
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), useTheme_exports = {};
4065
- __export2(useTheme_exports, {
4066
- activeThemeManagers: () => activeThemeManagers,
4067
- getThemeManager: () => getThemeManager,
4068
- getThemeProxied: () => getThemeProxied,
4069
- useChangeThemeEffect: () => useChangeThemeEffect,
4070
- useTheme: () => useTheme,
4071
- useThemeWithState: () => useThemeWithState
4217
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), mergeProps_exports = {};
4218
+ __export2(mergeProps_exports, {
4219
+ mergeProps: () => mergeProps
4072
4220
  });
4073
- module2.exports = __toCommonJS2(useTheme_exports);
4074
- var import_constants = require_index_native3(), import_react3 = 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;
4075
- function getDefaultThemeProxied() {
4076
- if (cached)
4077
- return cached;
4078
- let config = (0, import_config.getConfig)(), name = config.themes.light ? "light" : Object.keys(config.themes)[0], defaultTheme = config.themes[name];
4079
- return cached = getThemeProxied({ theme: defaultTheme, name }), cached;
4080
- }
4081
- var useTheme = (props = emptyProps) => {
4082
- let [_, theme] = useThemeWithState(props);
4083
- return theme || getDefaultThemeProxied();
4084
- }, useThemeWithState = (props) => {
4085
- let keys = (0, import_react3.useRef)([]), changedThemeState = useChangeThemeEffect(
4086
- props,
4087
- !1,
4088
- keys.current,
4089
- import_constants.isServer ? void 0 : () => {
4090
- var _a, _b;
4091
- return ((_a = props.shouldUpdate) == null ? void 0 : _a.call(props)) ?? (keys.current.length > 0 ? !0 : void 0);
4092
- }
4093
- ), { themeManager, state } = changedThemeState, themeProxied = (0, import_react3.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]);
4094
- return [changedThemeState, themeProxied];
4221
+ module2.exports = __toCommonJS2(mergeProps_exports);
4222
+ var import_useMedia = require_useMedia_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), mergeProps = (a, b, inverseShorthands) => {
4223
+ let out = {};
4224
+ for (let key in a)
4225
+ mergeProp(out, a, b, key, inverseShorthands);
4226
+ if (b)
4227
+ for (let key in b)
4228
+ mergeProp(out, b, void 0, key, inverseShorthands);
4229
+ return out;
4095
4230
  };
4096
- function getThemeProxied({ theme, name, scheme }, deopt = !1, themeManager, keys, debug) {
4097
- if (!theme)
4098
- return {};
4099
- let config = (0, import_config.getConfig)();
4100
- function track(key) {
4101
- keys && !keys.includes(key) && keys.push(key);
4102
- }
4103
- return new Proxy(theme, {
4104
- has(_, key) {
4105
- if (Reflect.has(theme, key))
4106
- return !0;
4107
- if (typeof key == "string")
4108
- return key[0] === "$" && (key = key.slice(1)), themeManager == null ? void 0 : themeManager.allKeys.has(key);
4109
- },
4110
- get(_, key) {
4111
- if (
4112
- // dont ask me, idk why but on hermes you can see that useTheme()[undefined] passes in STRING undefined to proxy
4113
- // if someone is crazy enough to use "undefined" as a theme key then this not working is on them
4114
- key !== "undefined" && typeof key == "string"
4115
- ) {
4116
- let keyString = key[0] === "$" ? key.slice(1) : key, val = theme[keyString];
4117
- if (val && typeof val == "object")
4118
- return new Proxy(val, {
4119
- // when they touch the actual value we only track it
4120
- // if its a variable (web), its ignored!
4121
- get(_2, subkey) {
4122
- if (subkey === "val")
4123
- track(keyString);
4124
- else if (subkey === "get")
4125
- return (platform) => {
4126
- let outVal = (0, import_createVariable.getVariable)(val);
4127
- if (platform !== "web" && import_constants.isIos && !deopt && config.settings.fastSchemeChange && !someParentIsInversed(themeManager) && scheme) {
4128
- let oppositeThemeName = name.replace(
4129
- scheme === "dark" ? "dark" : "light",
4130
- scheme === "dark" ? "light" : "dark"
4131
- ), oppositeTheme = config.themes[oppositeThemeName], oppositeVal = (0, import_createVariable.getVariable)(oppositeTheme == null ? void 0 : oppositeTheme[keyString]);
4132
- if (oppositeVal)
4133
- return {
4134
- dynamic: {
4135
- dark: scheme === "dark" ? outVal : oppositeVal,
4136
- light: scheme === "light" ? outVal : oppositeVal
4137
- }
4138
- };
4139
- }
4140
- return track(keyString), outVal;
4141
- };
4142
- return Reflect.get(val, subkey);
4143
- }
4144
- });
4145
- }
4146
- return Reflect.get(_, key);
4147
- }
4148
- });
4149
- }
4150
- function someParentIsInversed(manager) {
4151
- {
4152
- let cur = manager;
4153
- for (; cur; ) {
4154
- if (!cur.parentManager)
4155
- return !1;
4156
- if (cur.parentManager.state.scheme !== cur.state.scheme)
4157
- return !0;
4158
- cur = cur.parentManager;
4159
- }
4160
- }
4161
- return !1;
4162
- }
4163
- var activeThemeManagers = /* @__PURE__ */ new Set(), _uidToManager = /* @__PURE__ */ new WeakMap(), _idToUID = {}, getId = (id) => _idToUID[id], getThemeManager = (id) => _uidToManager.get(getId(id)), registerThemeManager = (t) => {
4164
- if (!_idToUID[t.id]) {
4165
- let id = _idToUID[t.id] = {};
4166
- _uidToManager.set(id, t);
4167
- }
4168
- }, useChangeThemeEffect = (props, isRoot = !1, keys, shouldUpdate) => {
4169
- let { disable } = props, parentManagerId = (0, import_react3.useContext)(import_ThemeManagerContext.ThemeManagerIDContext), parentManager = getThemeManager(parentManagerId);
4170
- if (!isRoot && !parentManager || disable)
4171
- return {
4172
- isNewTheme: !1,
4173
- state: parentManager == null ? void 0 : parentManager.state,
4174
- themeManager: parentManager
4175
- };
4176
- let [themeState, setThemeState] = (0, import_react3.useState)(createState), { state, mounted, isNewTheme, themeManager, inversed } = themeState, isInversingOnMount = !!(!themeState.mounted && props.inverse);
4177
- function getShouldUpdateTheme(manager = themeManager, nextState, prevState = state, forceShouldChange = !1) {
4178
- let forceUpdate = shouldUpdate == null ? void 0 : shouldUpdate();
4179
- if (!manager || !forceShouldChange && forceUpdate === !1)
4180
- return;
4181
- let next = nextState || manager.getState(props, parentManager);
4182
- if (forceShouldChange || next && !(forceUpdate !== !0 && !manager.getStateShouldChange(next, prevState)))
4183
- return next;
4184
- }
4185
- if (import_constants.isServer || (0, import_react3.useEffect)(() => {
4186
- if (!themeManager)
4187
- return;
4188
- if (props.inverse && !mounted) {
4189
- setThemeState((prev) => createState({
4190
- ...prev,
4191
- mounted: !0
4192
- }));
4193
- return;
4194
- }
4195
- (isNewTheme || getShouldUpdateTheme(themeManager)) && (activeThemeManagers.add(themeManager), setThemeState(createState));
4196
- let selfListenerDispose = themeManager.onChangeTheme((_a, _b, forced) => {
4197
- forced && setThemeState((prev) => createState(prev, !0));
4198
- }), disposeChangeListener = parentManager == null ? void 0 : parentManager.onChangeTheme(
4199
- (name, manager, forced) => {
4200
- let force = forced || (shouldUpdate == null ? void 0 : shouldUpdate()) || props.deopt || props["disable-child-theme"];
4201
- (force ?? !!(keys != null && keys.length || isNewTheme)) && setThemeState((prev) => createState(prev, force));
4202
- },
4203
- themeManager.id
4204
- );
4205
- return () => {
4206
- selfListenerDispose(), disposeChangeListener == null || disposeChangeListener(), isNewTheme && activeThemeManagers.delete(themeManager);
4207
- };
4208
- }, [
4209
- themeManager,
4210
- parentManager,
4211
- isNewTheme,
4212
- props.componentName,
4213
- props.inverse,
4214
- props.name,
4215
- props.reset,
4216
- mounted
4217
- ]), isInversingOnMount)
4218
- return {
4219
- isNewTheme: !1,
4220
- inversed: !1,
4221
- themeManager: parentManager,
4222
- state: {
4223
- name: "",
4224
- ...parentManager == null ? void 0 : parentManager.state,
4225
- className: ""
4226
- }
4231
+ function mergeProp(out, a, b, key, inverseShorthands) {
4232
+ let longhand = (inverseShorthands == null ? void 0 : inverseShorthands[key]) || null, val = a[key];
4233
+ if (key in import_pseudoDescriptors.pseudoDescriptors || import_useMedia.mediaKeys.has(key)) {
4234
+ out[key] = {
4235
+ ...out[key],
4236
+ ...val
4227
4237
  };
4228
- return {
4229
- state,
4230
- isNewTheme,
4231
- inversed,
4232
- themeManager
4233
- };
4234
- function createState(prev, force = !1) {
4235
- if (prev && (shouldUpdate == null ? void 0 : shouldUpdate()) === !1 && !force)
4236
- return prev;
4237
- let themeManager2 = parentManager, state2;
4238
- if ((0, import_ThemeManager.getHasThemeUpdatingProps)(props)) {
4239
- let getNewThemeManager = () => new import_ThemeManager.ThemeManager(props, isRoot ? "root" : parentManager);
4240
- if (prev != null && prev.themeManager) {
4241
- themeManager2 = prev.themeManager;
4242
- let forceChange = force || !!(keys != null && keys.length), next = themeManager2.getState(props, parentManager), nextState = getShouldUpdateTheme(
4243
- themeManager2,
4244
- next,
4245
- prev.state,
4246
- forceChange
4247
- );
4248
- nextState ? (state2 = nextState, prev.isNewTheme ? themeManager2.updateState(nextState) : themeManager2 = getNewThemeManager()) : prev.isNewTheme && parentManager && !next && (themeManager2 = parentManager);
4249
- } else
4250
- themeManager2 = getNewThemeManager(), state2 = { ...themeManager2.state };
4251
- }
4252
- let isNewTheme2 = !!(themeManager2 !== parentManager || props.inverse);
4253
- isNewTheme2 && registerThemeManager(themeManager2);
4254
- let mounted2 = props.inverse ? isRoot || (prev == null ? void 0 : prev.mounted) : !0;
4255
- state2 || (isNewTheme2 ? state2 = themeManager2.state : (state2 = parentManager.state, themeManager2 = parentManager));
4256
- 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 = {
4257
- themeManager: themeManager2,
4258
- isNewTheme: isNewTheme2,
4259
- mounted: mounted2,
4260
- inversed: inversed2
4261
- }, shouldReturnPrev = prev && !force && // isEqualShallow uses the second arg as the keys so this should compare without state first...
4262
- (0, import_createShallowSetState.isEqualShallow)(prev, response) && // ... and then compare just the state, because we make a new state obj but is likely the same
4263
- (0, import_createShallowSetState.isEqualShallow)(prev.state, state2);
4264
- return prev && shouldReturnPrev ? prev : (response.state = state2, response);
4238
+ return;
4265
4239
  }
4266
- };
4240
+ b && (key in b || longhand && longhand in b) || (out[longhand || key] = val);
4241
+ }
4267
4242
  }
4268
4243
  });
4269
4244