@tamagui/core 1.123.17 → 1.124.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/native.js CHANGED
@@ -2211,80 +2211,11 @@ var require_useMedia_native = __commonJS({
2211
2211
  }
2212
2212
  });
2213
2213
 
2214
- // ../web/dist/cjs/constants/constants.native.js
2215
- var require_constants_native2 = __commonJS({
2216
- "../web/dist/cjs/constants/constants.native.js"(exports2, module2) {
2217
- "use strict";
2218
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
2219
- for (var name in all) __defProp2(target, name, {
2220
- get: all[name],
2221
- enumerable: !0
2222
- });
2223
- }, __copyProps2 = function(to, from, except, desc) {
2224
- var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
2225
- if (from && typeof from == "object" || typeof from == "function") try {
2226
- for (var _loop = function() {
2227
- var key = _step.value;
2228
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
2229
- get: function() {
2230
- return from[key];
2231
- },
2232
- enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
2233
- });
2234
- }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
2235
- } catch (err) {
2236
- _didIteratorError = !0, _iteratorError = err;
2237
- } finally {
2238
- try {
2239
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
2240
- } finally {
2241
- if (_didIteratorError)
2242
- throw _iteratorError;
2243
- }
2244
- }
2245
- return to;
2246
- }, __toCommonJS2 = function(mod) {
2247
- return __copyProps2(__defProp2({}, "__esModule", {
2248
- value: !0
2249
- }), mod);
2250
- }, constants_exports = {};
2251
- __export2(constants_exports, {
2252
- FONT_DATA_ATTRIBUTE_NAME: function() {
2253
- return FONT_DATA_ATTRIBUTE_NAME;
2254
- },
2255
- THEME_CLASSNAME_PREFIX: function() {
2256
- return THEME_CLASSNAME_PREFIX;
2257
- },
2258
- THEME_NAME_SEPARATOR: function() {
2259
- return THEME_NAME_SEPARATOR;
2260
- },
2261
- stackDefaultStyles: function() {
2262
- return stackDefaultStyles;
2263
- },
2264
- webViewFlexCompatStyles: function() {
2265
- return webViewFlexCompatStyles;
2266
- }
2267
- });
2268
- module2.exports = __toCommonJS2(constants_exports);
2269
- var THEME_NAME_SEPARATOR = "_", THEME_CLASSNAME_PREFIX = "t_", FONT_DATA_ATTRIBUTE_NAME = "data-tamagui-font", stackDefaultStyles = {}, webViewFlexCompatStyles = {
2270
- display: "flex",
2271
- alignItems: "stretch",
2272
- flexDirection: "column",
2273
- flexBasis: "auto",
2274
- boxSizing: "border-box",
2275
- position: "relative",
2276
- minHeight: 0,
2277
- minWidth: 0,
2278
- flexShrink: 0
2279
- };
2280
- }
2281
- });
2282
-
2283
- // ../web/dist/cjs/helpers/ThemeManager.native.js
2284
- var require_ThemeManager_native = __commonJS({
2285
- "../web/dist/cjs/helpers/ThemeManager.native.js"(exports2, module2) {
2214
+ // ../web/dist/cjs/Tamagui.native.js
2215
+ var require_Tamagui_native = __commonJS({
2216
+ "../web/dist/cjs/Tamagui.native.js"(exports2, module2) {
2286
2217
  "use strict";
2287
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
2218
+ var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
2288
2219
  for (var name in all) __defProp2(target, name, {
2289
2220
  get: all[name],
2290
2221
  enumerable: !0
@@ -2312,24 +2243,36 @@ var require_ThemeManager_native = __commonJS({
2312
2243
  }
2313
2244
  }
2314
2245
  return to;
2246
+ }, __toESM2 = function(mod, isNodeMode, target) {
2247
+ return target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
2248
+ // If the importer is in node compatibility mode or this is not an ESM
2249
+ // file that has been converted to a CommonJS file using a Babel-
2250
+ // compatible transform (i.e. "__esModule" has not been set), then set
2251
+ // "default" to the CommonJS "module.exports" for node compatibility.
2252
+ isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", {
2253
+ value: mod,
2254
+ enumerable: !0
2255
+ }) : target,
2256
+ mod
2257
+ );
2315
2258
  }, __toCommonJS2 = function(mod) {
2316
2259
  return __copyProps2(__defProp2({}, "__esModule", {
2317
2260
  value: !0
2318
2261
  }), mod);
2319
- }, ThemeManager_exports = {};
2320
- __export2(ThemeManager_exports, {
2321
- ThemeManager: function() {
2322
- return ThemeManager;
2262
+ }, Tamagui_exports = {};
2263
+ __export2(Tamagui_exports, {
2264
+ Tamagui: function() {
2265
+ return Tamagui;
2323
2266
  },
2324
- getHasThemeUpdatingProps: function() {
2325
- return getHasThemeUpdatingProps;
2267
+ getValueFromIdentifier: function() {
2268
+ return getValueFromIdentifier;
2326
2269
  },
2327
- getManagers: function() {
2328
- return getManagers;
2270
+ setIdentifierValue: function() {
2271
+ return setIdentifierValue;
2329
2272
  }
2330
2273
  });
2331
- module2.exports = __toCommonJS2(ThemeManager_exports);
2332
- var import_constants2 = require_index_native2(), import_config = require_config_native(), import_constants22 = require_constants_native2();
2274
+ module2.exports = __toCommonJS2(Tamagui_exports);
2275
+ var Helpers = __toESM2(require_index_native3()), import_config = require_config_native(), import_insertStyleRule = require_insertStyleRule_native(), import_useMedia = require_useMedia_native();
2333
2276
  function _class_call_check(instance, Constructor) {
2334
2277
  if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
2335
2278
  }
@@ -2350,232 +2293,67 @@ var require_ThemeManager_native = __commonJS({
2350
2293
  writable: !0
2351
2294
  }) : obj[key] = value, obj;
2352
2295
  }
2353
- var emptyState = {
2354
- name: ""
2355
- };
2356
- function getHasThemeUpdatingProps(props) {
2357
- return !!(props.name || props.componentName || props.inverse || props.reset);
2358
- }
2359
- var uid = 0, ThemeManager = /* @__PURE__ */ function() {
2360
- "use strict";
2361
- function ThemeManager2() {
2362
- var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, parentManager = arguments.length > 1 ? arguments[1] : void 0;
2363
- if (_class_call_check(this, ThemeManager2), _define_property(this, "props", void 0), _define_property(this, "id", void 0), _define_property(this, "themeListeners", void 0), _define_property(this, "parentManager", void 0), _define_property(this, "state", void 0), _define_property(this, "_allKeys", void 0), _define_property(this, "_selfListener", void 0), 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") {
2364
- this.updateStateFromProps(props, !1);
2365
- return;
2366
- }
2367
- if (!parentManager) throw process.env.NODE_ENV !== "production" ? new Error("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.") : "\u274C 000";
2368
- if (this.parentManager = parentManager, !this.updateStateFromProps(props, !1)) return parentManager;
2369
- }
2370
- return _create_class(ThemeManager2, [
2371
- {
2372
- key: "updateStateFromProps",
2373
- value: function() {
2374
- var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.props || {}, shouldNotify = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
2375
- if (this.props = props, props.forceTheme) return this.state.theme = props.forceTheme, this.state.name = props.name || "", this.updateState(this.state, !0), this.state;
2376
- var nextState = this.getStateIfChanged(props);
2377
- if (nextState) return this.updateState(nextState, shouldNotify), nextState;
2378
- }
2379
- },
2380
- {
2381
- key: "getParents",
2382
- value: function() {
2383
- for (var parents = [], current = this; current; ) parents.push(current), current = current.parentManager;
2384
- return parents;
2385
- }
2386
- },
2387
- {
2388
- key: "updateState",
2389
- value: function(nextState) {
2390
- var shouldNotify = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
2391
- this.state = nextState, this._allKeys = null;
2392
- }
2393
- },
2394
- {
2395
- // if (shouldNotify) {
2396
- // if (process.env.TAMAGUI_TARGET === 'native') {
2397
- // // native is way slower with queueMicrotask
2398
- // this.notify()
2399
- // } else {
2400
- // // web is way faster this way
2401
- // queueMicrotask(() => {
2402
- // this.notify()
2403
- // })
2404
- // }
2405
- // }
2406
- key: "getStateIfChanged",
2407
- value: function() {
2408
- var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.props, state = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.state, parentManager = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.parentManager, _ = this.getState(props, parentManager);
2409
- if (state && state !== emptyState && !_) return parentManager == null ? void 0 : parentManager.state;
2410
- if (this.getStateShouldChange(_, state)) return _;
2411
- }
2412
- },
2413
- {
2414
- key: "getStateShouldChange",
2415
- value: function(nextState) {
2416
- var state = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.state;
2417
- return !(!(nextState != null && nextState.theme) || nextState.theme === (state == null ? void 0 : state.theme));
2418
- }
2419
- },
2420
- {
2421
- key: "getState",
2422
- value: function() {
2423
- var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.props, parentManager = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.parentManager, next = getState(props, parentManager) || (parentManager == null ? void 0 : parentManager.state) || null;
2424
- return next;
2425
- }
2426
- },
2427
- {
2428
- key: "allKeys",
2429
- get: function() {
2430
- var _this_parentManager;
2431
- return this._allKeys || (this._allKeys = /* @__PURE__ */ new Set([
2432
- ...((_this_parentManager = this.parentManager) === null || _this_parentManager === void 0 ? void 0 : _this_parentManager.allKeys) || [],
2433
- ...Object.keys(this.state.theme || {})
2434
- ])), this._allKeys;
2435
- }
2436
- },
2437
- {
2438
- key: "notify",
2439
- value: function() {
2440
- var _this = this, forced = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
2441
- if (this.themeListeners.forEach(function(cb) {
2442
- return cb(_this.state.name, _this, forced);
2443
- }), process.env.NODE_ENV !== "production") {
2444
- var _numChangeEventsSent, _this_;
2445
- (_this_ = this[_numChangeEventsSent = "_numChangeEventsSent"]) !== null && _this_ !== void 0 || (this[_numChangeEventsSent] = 0), this._numChangeEventsSent++;
2446
- }
2447
- }
2448
- },
2449
- {
2450
- key: "selfUpdate",
2451
- value: function() {
2452
- var _this__selfListener, _this;
2453
- (_this__selfListener = (_this = this)._selfListener) === null || _this__selfListener === void 0 || _this__selfListener.call(_this, this.state.name, this, "self");
2454
- }
2455
- },
2456
- {
2457
- key: "onChangeTheme",
2458
- value: function(cb, debugId) {
2459
- var _this = this;
2460
- if (process.env.NODE_ENV !== "production" && debugId) {
2461
- var _this__listeningIds;
2462
- (_this__listeningIds = this._listeningIds) !== null && _this__listeningIds !== void 0 || (this._listeningIds = /* @__PURE__ */ new Set()), this._listeningIds.add(debugId);
2463
- }
2464
- return debugId === !0 && (this._selfListener = cb), this.themeListeners.add(cb), function() {
2465
- _this.themeListeners.delete(cb);
2466
- };
2467
- }
2468
- }
2469
- ]), ThemeManager2;
2470
- }(), cache2 = {};
2471
- function getState(props, manager) {
2472
- if (!getHasThemeUpdatingProps(props)) return null;
2473
- var [allManagers] = getManagers(manager), cacheKey = `${props.name || ""}${props.componentName || ""}${props.inverse || ""}${props.reset || ""}${allManagers.map(function(x) {
2474
- return (x == null ? void 0 : x.state.name) || ".";
2475
- }).join("")}`, cached = cache2[cacheKey];
2476
- if (!cached) {
2477
- var res = getStateUncached(props, manager);
2478
- return cache2[cacheKey] = res, res;
2479
- }
2480
- return cached;
2481
- }
2482
- function getStateUncached(props, manager) {
2483
- if (props.name && props.reset) throw new Error(process.env.NODE_ENV === "production" ? "\u274C004" : "Cannot reset and set a new name at the same time.");
2484
- var 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];
2485
- if (!baseManager && props.reset) return process.env.NODE_ENV !== "production" && console.warn("Cannot reset, no parent theme exists"), null;
2486
- var { componentName } = props, result = null, baseName = (baseManager == null ? void 0 : baseManager.state.name) || "";
2487
- baseManager != null && baseManager.state.isComponent && (baseName = baseName.replace(/_[A-Z][A-Za-z]+/, ""));
2488
- var nextName = props.reset ? baseName : props.name || "", allComponentThemes = componentManagers.map(function(x) {
2489
- return (x == null ? void 0 : x.state.name) || "";
2490
- });
2491
- isDirectParentAComponentTheme && allComponentThemes.shift();
2492
- for (var base = baseName.split(import_constants22.THEME_NAME_SEPARATOR), max = base.length, min = props.componentName && !nextName ? max : (
2493
- // component name only don't search upwards
2494
- 0
2495
- ), i = max; i >= min; i--) {
2496
- var prefix = base.slice(0, i).join(import_constants22.THEME_NAME_SEPARATOR);
2497
- props.inverse && (prefix = inverseThemeName(prefix));
2498
- var potentials = [];
2499
- if (prefix && prefix !== baseName && prefix.includes(nextName) && potentials.push(prefix), nextName && potentials.unshift(prefix ? `${prefix}_${nextName}` : nextName), i === 1) {
2500
- var lastSegment = potentials.findIndex(function(x) {
2501
- return !x.includes("_");
2502
- });
2503
- lastSegment > 0 && potentials.splice(lastSegment, 0, nextName);
2504
- }
2505
- if (componentName && !props.reset) {
2506
- var baseLen = base.length, componentPotentials = [];
2507
- if (nextName && baseLen > 1) {
2508
- var beforeSeparator = base[0];
2509
- componentPotentials.push(`${beforeSeparator}_${nextName}_${componentName}`);
2296
+ var Tamagui = function() {
2297
+ if (process.env.NODE_ENV === "development") {
2298
+ var TamaguiManager = /* @__PURE__ */ function() {
2299
+ "use strict";
2300
+ function TamaguiManager2() {
2301
+ _class_call_check(this, TamaguiManager2), _define_property(this, "Helpers", Helpers);
2510
2302
  }
2511
- if (componentPotentials.push(`${prefix}_${componentName}`), nextName) {
2512
- if (i > baseLen) {
2513
- var prefixLessOne = base.slice(0, i - 1).join(import_constants22.THEME_NAME_SEPARATOR);
2514
- if (prefixLessOne) {
2515
- var lessSpecific = `${prefixLessOne}_${nextName}_${componentName}`;
2516
- componentPotentials.unshift(lessSpecific);
2303
+ return _create_class(TamaguiManager2, [
2304
+ {
2305
+ key: "mediaState",
2306
+ get: function() {
2307
+ return {
2308
+ ...import_useMedia.mediaState
2309
+ };
2310
+ }
2311
+ },
2312
+ {
2313
+ key: "config",
2314
+ get: function() {
2315
+ return (0, import_config.getConfig)();
2316
+ }
2317
+ },
2318
+ {
2319
+ key: "insertedRules",
2320
+ get: function() {
2321
+ return (0, import_insertStyleRule.getAllRules)();
2322
+ }
2323
+ },
2324
+ {
2325
+ key: "allSelectors",
2326
+ get: function() {
2327
+ return (0, import_insertStyleRule.getAllSelectors)();
2328
+ }
2329
+ },
2330
+ {
2331
+ key: "allTransforms",
2332
+ get: function() {
2333
+ return (0, import_insertStyleRule.getAllTransforms)();
2334
+ }
2335
+ },
2336
+ {
2337
+ key: "identifierToValue",
2338
+ get: function() {
2339
+ return identifierToValue;
2517
2340
  }
2518
2341
  }
2519
- var moreSpecific = `${prefix}_${nextName}_${componentName}`;
2520
- componentPotentials.unshift(moreSpecific);
2521
- }
2522
- potentials = [
2523
- ...componentPotentials,
2524
- ...potentials,
2525
- ...allComponentThemes
2526
- ];
2527
- }
2528
- var found = potentials.find(function(t) {
2529
- return t in themes;
2530
- });
2531
- if (process.env.NODE_ENV !== "production" && typeof props.debug == "string" && import_constants2.isClient && console.info(` \u{1F537} [${manager == null ? void 0 : manager.id}] getState`, {
2532
- props,
2533
- found,
2534
- potentials,
2535
- baseManager,
2536
- nextName,
2537
- baseName,
2538
- prefix
2539
- }), found) {
2540
- var _this, names = found.split("_"), [firstName, ...restNames] = names, lastName = names[names.length - 1], isComponent = lastName[0] === lastName[0].toUpperCase(), scheme = firstName === "light" ? "light" : firstName === "dark" ? "dark" : void 0, pre = import_constants22.THEME_CLASSNAME_PREFIX, className = import_constants2.isWeb ? `${pre}sub_theme ${pre}${!scheme || !restNames.length ? firstName : restNames.join("_")}` : "", parentState = (_this = baseManager || parentManager) === null || _this === void 0 ? void 0 : _this.state, parentName = parentState == null ? void 0 : parentState.name;
2541
- result = {
2542
- name: found,
2543
- parentName,
2544
- theme: themes[found],
2545
- className,
2546
- isComponent,
2547
- isSchemeFixed: props.name === "light" || props.name === "dark",
2548
- scheme
2549
- };
2550
- break;
2551
- }
2342
+ ]), TamaguiManager2;
2343
+ }();
2344
+ return new TamaguiManager();
2552
2345
  }
2553
- return process.env.NODE_ENV !== "production" && props.debug === "verbose" && import_constants2.isClient && (console.groupCollapsed("ThemeManager.getState()"), console.info({
2554
- props,
2555
- baseName,
2556
- base,
2557
- min,
2558
- max
2559
- }), console.warn("result", {
2560
- result
2561
- }), console.trace(), console.groupEnd()), result;
2562
- }
2563
- var inverseThemeName = function(themeName) {
2564
- return themeName.startsWith("light") ? themeName.replace(/^light/, "dark") : themeName.replace(/^dark/, "light");
2346
+ }(), identifierToValue = /* @__PURE__ */ new Map(), getValueFromIdentifier = function(identifier) {
2347
+ return identifierToValue.get(identifier);
2348
+ }, setIdentifierValue = function(identifier, value) {
2349
+ identifierToValue.set(identifier, value);
2565
2350
  };
2566
- function getManagers(themeManager) {
2567
- for (var comp = [], all = [], cur = themeManager; cur; ) all.push(cur), cur.state.isComponent && comp.push(cur), cur = cur.parentManager;
2568
- return [
2569
- all,
2570
- comp
2571
- ];
2572
- }
2573
2351
  }
2574
2352
  });
2575
2353
 
2576
- // ../web/dist/cjs/helpers/ThemeManagerContext.native.js
2577
- var require_ThemeManagerContext_native = __commonJS({
2578
- "../web/dist/cjs/helpers/ThemeManagerContext.native.js"(exports2, module2) {
2354
+ // ../compose-refs/dist/cjs/compose-refs.native.js
2355
+ var require_compose_refs_native = __commonJS({
2356
+ "../compose-refs/dist/cjs/compose-refs.native.js"(exports2, module2) {
2579
2357
  "use strict";
2580
2358
  var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
2581
2359
  for (var name in all) __defProp2(target, name, {
@@ -2621,27 +2399,43 @@ var require_ThemeManagerContext_native = __commonJS({
2621
2399
  return __copyProps2(__defProp2({}, "__esModule", {
2622
2400
  value: !0
2623
2401
  }), mod);
2624
- }, ThemeManagerContext_exports = {};
2625
- __export2(ThemeManagerContext_exports, {
2626
- ThemeManagerContext: function() {
2627
- return ThemeManagerContext;
2402
+ }, compose_refs_exports = {};
2403
+ __export2(compose_refs_exports, {
2404
+ composeRefs: function() {
2405
+ return composeRefs;
2406
+ },
2407
+ setRef: function() {
2408
+ return setRef;
2409
+ },
2410
+ useComposedRefs: function() {
2411
+ return useComposedRefs;
2628
2412
  }
2629
2413
  });
2630
- module2.exports = __toCommonJS2(ThemeManagerContext_exports);
2631
- var import_react3 = __toESM2(require("react")), ThemeManagerContext = /* @__PURE__ */ import_react3.default.createContext(null);
2414
+ module2.exports = __toCommonJS2(compose_refs_exports);
2415
+ var React3 = __toESM2(require("react"));
2416
+ function setRef(ref, value) {
2417
+ typeof ref == "function" ? ref(value) : ref && (ref.current = value);
2418
+ }
2419
+ function composeRefs() {
2420
+ for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) refs[_key] = arguments[_key];
2421
+ return function(node) {
2422
+ return refs.forEach(function(ref) {
2423
+ return setRef(ref, node);
2424
+ });
2425
+ };
2426
+ }
2427
+ function useComposedRefs() {
2428
+ for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) refs[_key] = arguments[_key];
2429
+ return React3.useCallback(composeRefs(...refs), refs);
2430
+ }
2632
2431
  }
2633
2432
  });
2634
2433
 
2635
- // ../web/dist/cjs/helpers/createShallowSetState.native.js
2636
- var require_createShallowSetState_native = __commonJS({
2637
- "../web/dist/cjs/helpers/createShallowSetState.native.js"(exports2, module2) {
2434
+ // ../compose-refs/dist/cjs/index.native.js
2435
+ var require_index_native5 = __commonJS({
2436
+ "../compose-refs/dist/cjs/index.native.js"(exports2, module2) {
2638
2437
  "use strict";
2639
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
2640
- for (var name in all) __defProp2(target, name, {
2641
- get: all[name],
2642
- enumerable: !0
2643
- });
2644
- }, __copyProps2 = function(to, from, except, desc) {
2438
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __copyProps2 = function(to, from, except, desc) {
2645
2439
  var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
2646
2440
  if (from && typeof from == "object" || typeof from == "function") try {
2647
2441
  for (var _loop = function() {
@@ -2664,57 +2458,21 @@ var require_createShallowSetState_native = __commonJS({
2664
2458
  }
2665
2459
  }
2666
2460
  return to;
2461
+ }, __reExport2 = function(target, mod, secondTarget) {
2462
+ return __copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default");
2667
2463
  }, __toCommonJS2 = function(mod) {
2668
2464
  return __copyProps2(__defProp2({}, "__esModule", {
2669
2465
  value: !0
2670
2466
  }), mod);
2671
- }, createShallowSetState_exports = {};
2672
- __export2(createShallowSetState_exports, {
2673
- createShallowSetState: function() {
2674
- return createShallowSetState;
2675
- },
2676
- isEqualShallow: function() {
2677
- return isEqualShallow;
2678
- },
2679
- mergeIfNotShallowEqual: function() {
2680
- return mergeIfNotShallowEqual;
2681
- }
2682
- });
2683
- module2.exports = __toCommonJS2(createShallowSetState_exports);
2684
- var import_react3 = require("react"), callImmediate = function(cb) {
2685
- return cb();
2686
- };
2687
- function createShallowSetState(setter, isDisabled, transition, debug) {
2688
- return function(next) {
2689
- var wrap = transition ? import_react3.startTransition : callImmediate;
2690
- wrap(function() {
2691
- setter(function(prev) {
2692
- return mergeIfNotShallowEqual(prev, next, isDisabled, debug);
2693
- });
2694
- });
2695
- };
2696
- }
2697
- function mergeIfNotShallowEqual(prev, next, isDisabled, debug) {
2698
- if (isDisabled || !prev || !next || isEqualShallow(prev, next)) return prev || next;
2699
- if (process.env.NODE_ENV === "development" && debug && (console.info("setStateShallow CHANGE", {
2700
- prev,
2701
- next
2702
- }), debug === "break")) debugger;
2703
- return {
2704
- ...prev,
2705
- ...next
2706
- };
2707
- }
2708
- function isEqualShallow(prev, next) {
2709
- for (var key in next) if (prev[key] !== next[key]) return !1;
2710
- return !0;
2711
- }
2467
+ }, index_exports2 = {};
2468
+ module2.exports = __toCommonJS2(index_exports2);
2469
+ __reExport2(index_exports2, require_compose_refs_native(), module2.exports);
2712
2470
  }
2713
2471
  });
2714
2472
 
2715
- // ../web/dist/cjs/hooks/shouldDeoptDueToParentScheme.native.js
2716
- var require_shouldDeoptDueToParentScheme_native = __commonJS({
2717
- "../web/dist/cjs/hooks/shouldDeoptDueToParentScheme.native.js"(exports2, module2) {
2473
+ // ../web/dist/cjs/constants/constants.native.js
2474
+ var require_constants_native2 = __commonJS({
2475
+ "../web/dist/cjs/constants/constants.native.js"(exports2, module2) {
2718
2476
  "use strict";
2719
2477
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
2720
2478
  for (var name in all) __defProp2(target, name, {
@@ -2748,41 +2506,95 @@ var require_shouldDeoptDueToParentScheme_native = __commonJS({
2748
2506
  return __copyProps2(__defProp2({}, "__esModule", {
2749
2507
  value: !0
2750
2508
  }), mod);
2751
- }, shouldDeoptDueToParentScheme_native_exports = {};
2752
- __export2(shouldDeoptDueToParentScheme_native_exports, {
2753
- shouldDeoptDueToParentScheme: function() {
2754
- return shouldDeoptDueToParentScheme;
2509
+ }, constants_exports = {};
2510
+ __export2(constants_exports, {
2511
+ FONT_DATA_ATTRIBUTE_NAME: function() {
2512
+ return FONT_DATA_ATTRIBUTE_NAME;
2513
+ },
2514
+ THEME_CLASSNAME_PREFIX: function() {
2515
+ return THEME_CLASSNAME_PREFIX;
2516
+ },
2517
+ THEME_NAME_SEPARATOR: function() {
2518
+ return THEME_NAME_SEPARATOR;
2519
+ },
2520
+ stackDefaultStyles: function() {
2521
+ return stackDefaultStyles;
2522
+ },
2523
+ webViewFlexCompatStyles: function() {
2524
+ return webViewFlexCompatStyles;
2755
2525
  }
2756
2526
  });
2757
- module2.exports = __toCommonJS2(shouldDeoptDueToParentScheme_native_exports);
2758
- var import_react_native = require("react-native");
2759
- function shouldDeoptDueToParentScheme(manager) {
2760
- var _parents_, parents = ((manager == null ? void 0 : manager.getParents()) || []).reverse(), rootScheme = (_parents_ = parents[0]) === null || _parents_ === void 0 ? void 0 : _parents_.state.scheme;
2761
- if (!rootScheme || import_react_native.Appearance.getColorScheme() !== rootScheme) return !0;
2762
- var lastParentScheme = rootScheme, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
2763
- try {
2764
- for (var _iterator = parents[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
2765
- var parent = _step.value;
2766
- if (parent.state.scheme !== lastParentScheme) return !0;
2767
- lastParentScheme = parent.state.scheme;
2768
- }
2527
+ module2.exports = __toCommonJS2(constants_exports);
2528
+ var THEME_NAME_SEPARATOR = "_", THEME_CLASSNAME_PREFIX = "t_", FONT_DATA_ATTRIBUTE_NAME = "data-tamagui-font", stackDefaultStyles = {}, webViewFlexCompatStyles = {
2529
+ display: "flex",
2530
+ alignItems: "stretch",
2531
+ flexDirection: "column",
2532
+ flexBasis: "auto",
2533
+ boxSizing: "border-box",
2534
+ position: "relative",
2535
+ minHeight: 0,
2536
+ minWidth: 0,
2537
+ flexShrink: 0
2538
+ };
2539
+ }
2540
+ });
2541
+
2542
+ // ../web/dist/cjs/constants/isDevTools.native.js
2543
+ var require_isDevTools_native = __commonJS({
2544
+ "../web/dist/cjs/constants/isDevTools.native.js"(exports2, module2) {
2545
+ "use strict";
2546
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
2547
+ for (var name in all) __defProp2(target, name, {
2548
+ get: all[name],
2549
+ enumerable: !0
2550
+ });
2551
+ }, __copyProps2 = function(to, from, except, desc) {
2552
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
2553
+ if (from && typeof from == "object" || typeof from == "function") try {
2554
+ for (var _loop = function() {
2555
+ var key = _step.value;
2556
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
2557
+ get: function() {
2558
+ return from[key];
2559
+ },
2560
+ enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
2561
+ });
2562
+ }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
2769
2563
  } catch (err) {
2770
2564
  _didIteratorError = !0, _iteratorError = err;
2771
2565
  } finally {
2772
2566
  try {
2773
2567
  !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
2774
2568
  } finally {
2775
- if (_didIteratorError) throw _iteratorError;
2569
+ if (_didIteratorError)
2570
+ throw _iteratorError;
2776
2571
  }
2777
2572
  }
2573
+ return to;
2574
+ }, __toCommonJS2 = function(mod) {
2575
+ return __copyProps2(__defProp2({}, "__esModule", {
2576
+ value: !0
2577
+ }), mod);
2578
+ }, isDevTools_exports = {};
2579
+ __export2(isDevTools_exports, {
2580
+ isDevTools: function() {
2581
+ return isDevTools;
2582
+ }
2583
+ });
2584
+ module2.exports = __toCommonJS2(isDevTools_exports);
2585
+ var isDevTools = function() {
2586
+ if (process.env.NODE_ENV === "development") try {
2587
+ return new Function("try {return this===window;}catch(e){ return false;}")();
2588
+ } catch {
2589
+ }
2778
2590
  return !1;
2779
- }
2591
+ }();
2780
2592
  }
2781
2593
  });
2782
2594
 
2783
- // ../web/dist/cjs/hooks/useTheme.native.js
2784
- var require_useTheme_native = __commonJS({
2785
- "../web/dist/cjs/hooks/useTheme.native.js"(exports2, module2) {
2595
+ // ../web/dist/cjs/helpers/objectIdentityKey.native.js
2596
+ var require_objectIdentityKey_native = __commonJS({
2597
+ "../web/dist/cjs/helpers/objectIdentityKey.native.js"(exports2, module2) {
2786
2598
  "use strict";
2787
2599
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
2788
2600
  for (var name in all) __defProp2(target, name, {
@@ -2816,271 +2628,34 @@ var require_useTheme_native = __commonJS({
2816
2628
  return __copyProps2(__defProp2({}, "__esModule", {
2817
2629
  value: !0
2818
2630
  }), mod);
2819
- }, useTheme_exports = {};
2820
- __export2(useTheme_exports, {
2821
- activeThemeManagers: function() {
2822
- return activeThemeManagers;
2823
- },
2824
- getThemeManager: function() {
2825
- return getThemeManager;
2826
- },
2827
- useChangeThemeEffect: function() {
2828
- return useChangeThemeEffect;
2829
- },
2830
- useTheme: function() {
2831
- return useTheme;
2832
- },
2833
- useThemeWithState: function() {
2834
- return useThemeWithState;
2631
+ }, objectIdentityKey_exports = {};
2632
+ __export2(objectIdentityKey_exports, {
2633
+ objectIdentityKey: function() {
2634
+ return objectIdentityKey;
2835
2635
  }
2836
2636
  });
2837
- module2.exports = __toCommonJS2(useTheme_exports);
2838
- var import_constants2 = require_index_native2(), import_react3 = require("react"), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_ThemeManager = require_ThemeManager_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), import_createShallowSetState = require_createShallowSetState_native(), import_shouldDeoptDueToParentScheme = require_shouldDeoptDueToParentScheme_native(), emptyProps = {
2839
- name: null
2840
- }, useTheme = function() {
2841
- var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : emptyProps, [_, theme] = useThemeWithState(props), res = theme;
2842
- return res;
2843
- }, useThemeWithState = function(props) {
2844
- var keys = (0, import_react3.useRef)(null), changedThemeState = useChangeThemeEffect(props, !1, keys);
2845
- process.env.NODE_ENV === "development" && globalThis.time && time`theme-change-effect`;
2846
- var { themeManager, state } = changedThemeState;
2847
- process.env.NODE_ENV === "development" && (state != null && state.theme || process.env.TAMAGUI_DISABLE_NO_THEME_WARNING !== "1" && console.error(`[tamagui] No theme found, this could be due to an invalid theme name (given theme props ${JSON.stringify(props)}).
2848
-
2849
- If this is intended and you are using Tamagui without any themes, you can disable this warning by setting the environment variable TAMAGUI_DISABLE_NO_THEME_WARNING=1`));
2850
- var themeProxied = getThemeProxied(props, state, keys, themeManager);
2851
- return process.env.NODE_ENV === "development" && props.debug === "verbose" && (console.groupCollapsed(` \u{1F539} [${themeManager == null ? void 0 : themeManager.id}] useTheme =>`, state == null ? void 0 : state.name), console.info("returning state", changedThemeState.state, changedThemeState.isNewTheme, "from props", props), console.groupEnd()), [
2852
- changedThemeState,
2853
- themeProxied
2854
- ];
2855
- }, emptyObject = {}, ProxiedThemes = /* @__PURE__ */ new Map(), curKeys, curProps, curThemeManger;
2856
- function getThemeProxied(_props, state, _keys, _themeManager) {
2857
- var theme = state == null ? void 0 : state.theme;
2858
- if (!theme || !_themeManager) return emptyObject;
2859
- if (curKeys = _keys, curProps = _props, curThemeManger = _themeManager, ProxiedThemes.has(theme)) {
2860
- var proxied = ProxiedThemes.get(theme);
2861
- return proxied;
2862
- }
2863
- var { name, scheme } = state, config = (0, import_config.getConfig)();
2864
- function track(key) {
2865
- curKeys && (curKeys.current || (curKeys.current = []), curKeys.current.push(key), process.env.NODE_ENV === "development" && curProps.debug && console.info(` \u{1F3A8} useTheme() tracking new key: ${key}`));
2866
- }
2867
- var proxied1 = Object.fromEntries(Object.entries(theme).flatMap(function(param) {
2868
- var [key, value] = param, proxied2 = {
2869
- ...value,
2870
- get val() {
2871
- return globalThis.tamaguiAvoidTracking || track(key), value.val;
2872
- },
2873
- get(platform) {
2874
- var outVal = (0, import_createVariable.getVariable)(value);
2875
- if (platform !== "web" && import_constants2.isIos && !curProps.deopt && (0, import_config.getSetting)("fastSchemeChange") && !(0, import_shouldDeoptDueToParentScheme.shouldDeoptDueToParentScheme)(curThemeManger) && scheme) {
2876
- var _config_themes_name, _config_themes_oppositeName, oppositeScheme = scheme === "dark" ? "light" : "dark", oppositeName = name.replace(scheme, oppositeScheme), color = (0, import_createVariable.getVariable)((_config_themes_name = config.themes[name]) === null || _config_themes_name === void 0 ? void 0 : _config_themes_name[key]), oppositeColor = (0, import_createVariable.getVariable)((_config_themes_oppositeName = config.themes[oppositeName]) === null || _config_themes_oppositeName === void 0 ? void 0 : _config_themes_oppositeName[key]), dynamicVal = {
2877
- dynamic: {
2878
- [scheme]: color,
2879
- [oppositeScheme]: oppositeColor
2880
- }
2881
- };
2882
- return dynamicVal;
2883
- }
2884
- return process.env.NODE_ENV === "development" && curProps.debug && console.info(` \u{1F3A8} useTheme() tracking new key because of:
2885
- not web: ${platform !== "web"}
2886
- isIOS: ${import_constants2.isIos}
2887
- deopt: ${curProps.deopt}
2888
- fastScheme: ${(0, import_config.getSetting)("fastSchemeChange")}
2889
- inversed: ${getIsInversed(curThemeManger)}
2890
- `), track(key), outVal;
2891
- }
2892
- };
2893
- return [
2894
- [
2895
- key,
2896
- proxied2
2897
- ],
2898
- [
2899
- `$${key}`,
2900
- proxied2
2901
- ]
2902
- ];
2903
- }));
2904
- return ProxiedThemes.set(theme, proxied1), proxied1;
2905
- }
2906
- function getIsInversed(manager) {
2907
- for (var isInversed = !1, cur = manager; cur; ) {
2908
- if (!cur.parentManager) return isInversed;
2909
- cur.parentManager.state.scheme !== cur.state.scheme && (isInversed = !isInversed), cur = cur.parentManager;
2910
- }
2911
- return !1;
2912
- }
2913
- var activeThemeManagers = /* @__PURE__ */ new Set(), _uidToManager = /* @__PURE__ */ new WeakMap(), _idToUID = {}, getId = function(id) {
2914
- return _idToUID[id];
2915
- }, getThemeManager = function(id) {
2916
- return _uidToManager.get(getId(id));
2917
- }, registerThemeManager = function(t) {
2918
- if (!_idToUID[t.id]) {
2919
- var id = _idToUID[t.id] = {};
2920
- _uidToManager.set(id, t);
2921
- }
2922
- }, ogLog = console.error, preventWarnSetState = process.env.NODE_ENV === "production" ? ogLog : (
2923
- // temporary fix for logs, they are harmless in that i've tried to rewrite this
2924
- // a few times using the "right" ways, but they are always slower. maybe skill issue
2925
- function(a) {
2926
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) args[_key - 1] = arguments[_key];
2927
- if (!(typeof a == "string" && a.includes("Cannot update a component"))) return ogLog(a, ...args);
2928
- }
2929
- );
2930
- function getShouldUpdateTheme(props, parentManager, keys, themeState, nextState) {
2931
- var forceShouldChange = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : !1, _themeState_themeManager, _themeState_state;
2932
- if (!import_constants2.isServer && !(!forceShouldChange && !(keys != null && keys.current) && (!themeState || !themeState.isNewTheme) && !(0, import_ThemeManager.getHasThemeUpdatingProps)(props))) {
2933
- var next = nextState || (themeState == null || (_themeState_themeManager = themeState.themeManager) === null || _themeState_themeManager === void 0 ? void 0 : _themeState_themeManager.getState(props, parentManager));
2934
- if (forceShouldChange || !(!next || next.theme === (themeState == null || (_themeState_state = themeState.state) === null || _themeState_state === void 0 ? void 0 : _themeState_state.theme))) return next;
2935
- }
2936
- }
2937
- var useChangeThemeEffect = function(props) {
2938
- var isRoot = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, keys = arguments.length > 2 ? arguments[2] : void 0, _props_needsUpdate, { disable } = props, parentManager = (0, import_react3.useContext)(import_ThemeManagerContext.ThemeManagerContext), shouldAlwaysUpdate = ((_props_needsUpdate = props.needsUpdate) === null || _props_needsUpdate === void 0 ? void 0 : _props_needsUpdate.call(props)) === !0 ? !0 : void 0;
2939
- if (!isRoot && !parentManager || disable) return {
2940
- isNewTheme: !1,
2941
- state: parentManager == null ? void 0 : parentManager.state,
2942
- themeManager: parentManager
2943
- };
2944
- var [themeState, setThemeState] = (0, import_react3.useState)(createState), { state, mounted, isNewTheme, themeManager, prevState } = themeState, isInversingOnMount = !!(!themeState.mounted && props.inverse);
2945
- if (themeManager) {
2946
- var nextState = getShouldUpdateTheme(props, parentManager, keys, themeState, void 0, shouldAlwaysUpdate);
2947
- if (nextState) {
2948
- var _next_state, _themeState_state, next = createState(themeState, void 0, nextState);
2949
- ((_next_state = next.state) === null || _next_state === void 0 ? void 0 : _next_state.name) !== ((_themeState_state = themeState.state) === null || _themeState_state === void 0 ? void 0 : _themeState_state.name) && (setThemeState(next), console.error = preventWarnSetState, themeManager.notify(), console.error = ogLog);
2950
- }
2951
- }
2952
- if (import_constants2.isServer || ((0, import_react3.useEffect)(function() {
2953
- if (themeManager) {
2954
- if (props.inverse && !mounted) {
2955
- setThemeState(function(prev) {
2956
- return createState({
2957
- ...prev,
2958
- mounted: !0
2959
- });
2960
- });
2961
- return;
2962
- }
2963
- if ((isNewTheme || isRoot) && (activeThemeManagers.add(themeManager), process.env.NODE_ENV === "development" && isRoot)) {
2964
- var _globalThis, _TamaguiRootThemeManager;
2965
- (_globalThis = globalThis)[_TamaguiRootThemeManager = "TamaguiRootThemeManager"] || (_globalThis[_TamaguiRootThemeManager] = themeManager);
2966
- }
2967
- var updated = getShouldUpdateTheme(props, parentManager, keys, themeState, void 0, shouldAlwaysUpdate);
2968
- updated && setThemeState(function(prev) {
2969
- return createState(prev, void 0, updated);
2970
- });
2971
- var selfListenerDispose = themeManager.onChangeTheme(function(_a, _b, forced) {
2972
- forced && setThemeState(function(prev) {
2973
- var next2 = createState(prev, forced !== "self");
2974
- return next2;
2975
- });
2976
- }, !0), disposeChangeListener = parentManager == null ? void 0 : parentManager.onChangeTheme(function(name, manager, forced) {
2977
- var force = forced || (import_constants2.isServer ? void 0 : keys != null && keys.current ? !0 : void 0) || props.deopt || props["disable-child-theme"], shouldTryUpdate = force ?? !!(keys != null && keys.current || isNewTheme);
2978
- process.env.NODE_ENV === "development" && props.debug === "verbose" && console.info(" \u{1F538} onChange", {
2979
- id: themeManager.id,
2980
- force,
2981
- shouldTryUpdate,
2982
- props,
2983
- name,
2984
- keys
2985
- }), shouldTryUpdate && setThemeState(function(prev) {
2986
- return createState(prev, !0);
2987
- });
2988
- }, themeManager.id);
2989
- return function() {
2990
- selfListenerDispose(), disposeChangeListener == null || disposeChangeListener(), isNewTheme && activeThemeManagers.delete(themeManager);
2991
- };
2992
- }
2993
- }, [
2994
- themeManager,
2995
- parentManager,
2996
- isNewTheme,
2997
- props.componentName,
2998
- props.inverse,
2999
- props.name,
3000
- props.reset,
3001
- mounted
3002
- ]), process.env.NODE_ENV === "development" && props.debug !== "profile" && (0, import_react3.useEffect)(function() {
3003
- var _globalThis, _TamaguiThemeManagers, _;
3004
- return (_ = (_globalThis = globalThis)[_TamaguiThemeManagers = "TamaguiThemeManagers"]) !== null && _ !== void 0 || (_globalThis[_TamaguiThemeManagers] = /* @__PURE__ */ new Set()), globalThis.TamaguiThemeManagers.add(themeManager), function() {
3005
- globalThis.TamaguiThemeManagers.delete(themeManager);
3006
- };
3007
- }, [
3008
- themeManager
3009
- ])), import_constants2.isWeb && isInversingOnMount) return {
3010
- isNewTheme: !1,
3011
- inversed: !1,
3012
- themeManager: parentManager,
3013
- state: {
3014
- name: "",
3015
- ...parentManager == null ? void 0 : parentManager.state,
3016
- className: ""
3017
- }
3018
- };
3019
- return {
3020
- state,
3021
- isNewTheme,
3022
- inversed: !!props.inverse,
3023
- themeManager
3024
- };
3025
- function createState(prev) {
3026
- var force = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, foundNextState = arguments.length > 2 ? arguments[2] : void 0;
3027
- if (prev && !foundNextState && !(keys != null && keys.current) && !force) return prev;
3028
- var themeManager2 = parentManager, state2, hasThemeUpdatingProps = (0, import_ThemeManager.getHasThemeUpdatingProps)(props);
3029
- if (hasThemeUpdatingProps) {
3030
- var parentManagerProp = isRoot ? "root" : parentManager;
3031
- if (prev != null && prev.themeManager) {
3032
- themeManager2 = prev.themeManager;
3033
- var forceChange = force || shouldAlwaysUpdate || (keys != null && keys.current ? !0 : void 0), nextState2 = null;
3034
- if (foundNextState) nextState2 = foundNextState;
3035
- else {
3036
- var next2 = themeManager2.getState(props, parentManager);
3037
- nextState2 = getShouldUpdateTheme(props, parentManager, keys, prev, next2, forceChange);
3038
- }
3039
- nextState2 ? (state2 = nextState2, !prev.isNewTheme && !isRoot ? themeManager2 = new import_ThemeManager.ThemeManager(props, parentManagerProp) : themeManager2.updateState(nextState2)) : prev.isNewTheme && parentManager && !nextState2 && (themeManager2 = parentManager);
3040
- } else themeManager2 = new import_ThemeManager.ThemeManager(props, parentManagerProp), state2 = {
3041
- ...themeManager2.state
3042
- };
2637
+ module2.exports = __toCommonJS2(objectIdentityKey_exports);
2638
+ function objectIdentityKey(obj) {
2639
+ var k = "";
2640
+ for (var key in obj) {
2641
+ k += key;
2642
+ var arg = obj[key], type = typeof arg;
2643
+ if (!arg || type !== "object" && type !== "function") k += type + arg;
2644
+ else if (cache2.has(arg)) k += cache2.get(arg);
2645
+ else {
2646
+ var v = Math.random();
2647
+ cache2.set(arg, v), k += v;
3043
2648
  }
3044
- var isNewTheme2 = !!(themeManager2 !== parentManager || props.inverse);
3045
- isNewTheme2 && registerThemeManager(themeManager2);
3046
- var isWebSSR = import_constants2.isWeb ? !(0, import_config.getSetting)("disableSSR") : !1, mounted2 = isWebSSR ? isRoot || (prev == null ? void 0 : prev.mounted) : !0;
3047
- state2 || (isNewTheme2 ? state2 = themeManager2.state : (state2 = parentManager.state, themeManager2 = parentManager));
3048
- var response = {
3049
- themeManager: themeManager2,
3050
- isNewTheme: isNewTheme2,
3051
- mounted: mounted2
3052
- };
3053
- props.inverse && (response.inversed = !0);
3054
- var shouldReturnPrev = prev && !force && // isEqualShallow uses the second arg as the keys so this should compare without state first...
3055
- (0, import_createShallowSetState.isEqualShallow)(prev, response) && // ... and then compare just the state, because we make a new state obj but is likely the same
3056
- (0, import_createShallowSetState.isEqualShallow)(prev.state, state2);
3057
- if (prev && shouldReturnPrev) return prev;
3058
- if (response.state = state2, response.prevState = prev == null ? void 0 : prev.state, process.env.NODE_ENV === "development" && props.debug && import_constants2.isClient) {
3059
- console.groupCollapsed(`\u{1F537} [${themeManager2.id}] useChangeThemeEffect createState`);
3060
- var parentState = {
3061
- ...parentManager == null ? void 0 : parentManager.state
3062
- }, parentId = parentManager == null ? void 0 : parentManager.id, themeManagerState = {
3063
- ...themeManager2.state
3064
- };
3065
- console.info({
3066
- props,
3067
- parentState,
3068
- parentId,
3069
- themeManager: themeManager2,
3070
- prev,
3071
- response,
3072
- themeManagerState
3073
- }), console.groupEnd();
3074
- }
3075
- return response;
3076
2649
  }
3077
- };
2650
+ return k;
2651
+ }
2652
+ var cache2 = /* @__PURE__ */ new WeakMap();
3078
2653
  }
3079
2654
  });
3080
2655
 
3081
- // ../web/dist/cjs/Tamagui.native.js
3082
- var require_Tamagui_native = __commonJS({
3083
- "../web/dist/cjs/Tamagui.native.js"(exports2, module2) {
2656
+ // ../web/dist/cjs/helpers/createStyledContext.native.js
2657
+ var require_createStyledContext_native = __commonJS({
2658
+ "../web/dist/cjs/helpers/createStyledContext.native.js"(exports2, module2) {
3084
2659
  "use strict";
3085
2660
  var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
3086
2661
  for (var name in all) __defProp2(target, name, {
@@ -3126,109 +2701,48 @@ var require_Tamagui_native = __commonJS({
3126
2701
  return __copyProps2(__defProp2({}, "__esModule", {
3127
2702
  value: !0
3128
2703
  }), mod);
3129
- }, Tamagui_exports = {};
3130
- __export2(Tamagui_exports, {
3131
- Tamagui: function() {
3132
- return Tamagui;
3133
- },
3134
- getValueFromIdentifier: function() {
3135
- return getValueFromIdentifier;
3136
- },
3137
- setIdentifierValue: function() {
3138
- return setIdentifierValue;
2704
+ }, createStyledContext_exports = {};
2705
+ __export2(createStyledContext_exports, {
2706
+ createStyledContext: function() {
2707
+ return createStyledContext;
3139
2708
  }
3140
2709
  });
3141
- module2.exports = __toCommonJS2(Tamagui_exports);
3142
- var Helpers = __toESM2(require_index_native3()), import_config = require_config_native(), import_insertStyleRule = require_insertStyleRule_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native();
3143
- function _class_call_check(instance, Constructor) {
3144
- if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
3145
- }
3146
- function _defineProperties(target, props) {
3147
- for (var i = 0; i < props.length; i++) {
3148
- var descriptor = props[i];
3149
- descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);
3150
- }
3151
- }
3152
- function _create_class(Constructor, protoProps, staticProps) {
3153
- return protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Constructor;
3154
- }
3155
- function _define_property(obj, key, value) {
3156
- return key in obj ? Object.defineProperty(obj, key, {
3157
- value,
3158
- enumerable: !0,
3159
- configurable: !0,
3160
- writable: !0
3161
- }) : obj[key] = value, obj;
3162
- }
3163
- var Tamagui = function() {
3164
- if (process.env.NODE_ENV === "development") {
3165
- var TamaguiManager = /* @__PURE__ */ function() {
3166
- "use strict";
3167
- function TamaguiManager2() {
3168
- _class_call_check(this, TamaguiManager2), _define_property(this, "Helpers", Helpers), _define_property(this, "getThemeManager", import_useTheme.getThemeManager);
3169
- }
3170
- return _create_class(TamaguiManager2, [
3171
- {
3172
- key: "activeThemeManagers",
3173
- get: function() {
3174
- return import_useTheme.activeThemeManagers;
3175
- }
3176
- },
3177
- {
3178
- key: "mediaState",
3179
- get: function() {
3180
- return {
3181
- ...import_useMedia.mediaState
3182
- };
3183
- }
3184
- },
3185
- {
3186
- key: "config",
3187
- get: function() {
3188
- return (0, import_config.getConfig)();
3189
- }
3190
- },
3191
- {
3192
- key: "insertedRules",
3193
- get: function() {
3194
- return (0, import_insertStyleRule.getAllRules)();
3195
- }
3196
- },
3197
- {
3198
- key: "allSelectors",
3199
- get: function() {
3200
- return (0, import_insertStyleRule.getAllSelectors)();
3201
- }
3202
- },
3203
- {
3204
- key: "allTransforms",
3205
- get: function() {
3206
- return (0, import_insertStyleRule.getAllTransforms)();
3207
- }
3208
- },
3209
- {
3210
- key: "identifierToValue",
3211
- get: function() {
3212
- return identifierToValue;
3213
- }
3214
- }
3215
- ]), TamaguiManager2;
3216
- }();
3217
- return new TamaguiManager();
2710
+ module2.exports = __toCommonJS2(createStyledContext_exports);
2711
+ var import_jsx_runtime = require("react/jsx-runtime"), import_react3 = __toESM2(require("react")), import_objectIdentityKey = require_objectIdentityKey_native(), createReactContext = import_react3.default[Math.random(), "createContext"];
2712
+ function createStyledContext(defaultValues) {
2713
+ var OGContext = createReactContext(defaultValues), OGProvider = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map();
2714
+ function getOrCreateScopedContext(scope) {
2715
+ var ScopedContext = scopedContexts.get(scope);
2716
+ return ScopedContext || (ScopedContext = createReactContext(defaultValues), scopedContexts.set(scope, ScopedContext)), ScopedContext;
3218
2717
  }
3219
- }(), identifierToValue = /* @__PURE__ */ new Map(), getValueFromIdentifier = function(identifier) {
3220
- return identifierToValue.get(identifier);
3221
- }, setIdentifierValue = function(identifier, value) {
3222
- identifierToValue.set(identifier, value);
3223
- };
2718
+ var Provider = function(param) {
2719
+ var { children, scope, ...values } = param, next = import_react3.default.useMemo(function() {
2720
+ return {
2721
+ // this ! is a workaround for ts error
2722
+ ...defaultValues,
2723
+ ...values
2724
+ };
2725
+ }, [
2726
+ (0, import_objectIdentityKey.objectIdentityKey)(values)
2727
+ ]), Provider22 = OGProvider;
2728
+ return scope && (Provider22 = getOrCreateScopedContext(scope).Provider), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Provider22, {
2729
+ value: next,
2730
+ children
2731
+ });
2732
+ }, useStyledContext = function(scope) {
2733
+ var context = scope ? getOrCreateScopedContext(scope) : OGContext;
2734
+ return import_react3.default.useContext(context);
2735
+ };
2736
+ return Context.Provider = Provider, Context.props = defaultValues, Context.context = OGContext, Context.useStyledContext = useStyledContext, Context;
2737
+ }
3224
2738
  }
3225
2739
  });
3226
2740
 
3227
- // ../compose-refs/dist/cjs/compose-refs.native.js
3228
- var require_compose_refs_native = __commonJS({
3229
- "../compose-refs/dist/cjs/compose-refs.native.js"(exports2, module2) {
2741
+ // ../web/dist/cjs/contexts/ComponentContext.native.js
2742
+ var require_ComponentContext_native = __commonJS({
2743
+ "../web/dist/cjs/contexts/ComponentContext.native.js"(exports2, module2) {
3230
2744
  "use strict";
3231
- var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
2745
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
3232
2746
  for (var name in all) __defProp2(target, name, {
3233
2747
  get: all[name],
3234
2748
  enumerable: !0
@@ -3256,59 +2770,42 @@ var require_compose_refs_native = __commonJS({
3256
2770
  }
3257
2771
  }
3258
2772
  return to;
3259
- }, __toESM2 = function(mod, isNodeMode, target) {
3260
- return target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
3261
- // If the importer is in node compatibility mode or this is not an ESM
3262
- // file that has been converted to a CommonJS file using a Babel-
3263
- // compatible transform (i.e. "__esModule" has not been set), then set
3264
- // "default" to the CommonJS "module.exports" for node compatibility.
3265
- isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", {
3266
- value: mod,
3267
- enumerable: !0
3268
- }) : target,
3269
- mod
3270
- );
3271
2773
  }, __toCommonJS2 = function(mod) {
3272
2774
  return __copyProps2(__defProp2({}, "__esModule", {
3273
2775
  value: !0
3274
2776
  }), mod);
3275
- }, compose_refs_exports = {};
3276
- __export2(compose_refs_exports, {
3277
- composeRefs: function() {
3278
- return composeRefs;
3279
- },
3280
- setRef: function() {
3281
- return setRef;
3282
- },
3283
- useComposedRefs: function() {
3284
- return useComposedRefs;
2777
+ }, ComponentContext_exports = {};
2778
+ __export2(ComponentContext_exports, {
2779
+ ComponentContext: function() {
2780
+ return ComponentContext;
2781
+ }
2782
+ });
2783
+ module2.exports = __toCommonJS2(ComponentContext_exports);
2784
+ var import_createStyledContext = require_createStyledContext_native(), ComponentContext = (0, import_createStyledContext.createStyledContext)({
2785
+ disableSSR: void 0,
2786
+ inText: !1,
2787
+ language: null,
2788
+ animationDriver: null,
2789
+ setParentFocusState: null,
2790
+ groups: {
2791
+ emit: null,
2792
+ subscribe: null,
2793
+ state: {}
3285
2794
  }
3286
2795
  });
3287
- module2.exports = __toCommonJS2(compose_refs_exports);
3288
- var React3 = __toESM2(require("react"));
3289
- function setRef(ref, value) {
3290
- typeof ref == "function" ? ref(value) : ref && (ref.current = value);
3291
- }
3292
- function composeRefs() {
3293
- for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) refs[_key] = arguments[_key];
3294
- return function(node) {
3295
- return refs.forEach(function(ref) {
3296
- return setRef(ref, node);
3297
- });
3298
- };
3299
- }
3300
- function useComposedRefs() {
3301
- for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) refs[_key] = arguments[_key];
3302
- return React3.useCallback(composeRefs(...refs), refs);
3303
- }
3304
2796
  }
3305
2797
  });
3306
2798
 
3307
- // ../compose-refs/dist/cjs/index.native.js
3308
- var require_index_native5 = __commonJS({
3309
- "../compose-refs/dist/cjs/index.native.js"(exports2, module2) {
2799
+ // ../web/dist/cjs/defaultComponentState.native.js
2800
+ var require_defaultComponentState_native = __commonJS({
2801
+ "../web/dist/cjs/defaultComponentState.native.js"(exports2, module2) {
3310
2802
  "use strict";
3311
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __copyProps2 = function(to, from, except, desc) {
2803
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
2804
+ for (var name in all) __defProp2(target, name, {
2805
+ get: all[name],
2806
+ enumerable: !0
2807
+ });
2808
+ }, __copyProps2 = function(to, from, except, desc) {
3312
2809
  var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
3313
2810
  if (from && typeof from == "object" || typeof from == "function") try {
3314
2811
  for (var _loop = function() {
@@ -3331,21 +2828,45 @@ var require_index_native5 = __commonJS({
3331
2828
  }
3332
2829
  }
3333
2830
  return to;
3334
- }, __reExport2 = function(target, mod, secondTarget) {
3335
- return __copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default");
3336
2831
  }, __toCommonJS2 = function(mod) {
3337
2832
  return __copyProps2(__defProp2({}, "__esModule", {
3338
2833
  value: !0
3339
2834
  }), mod);
3340
- }, index_exports2 = {};
3341
- module2.exports = __toCommonJS2(index_exports2);
3342
- __reExport2(index_exports2, require_compose_refs_native(), module2.exports);
2835
+ }, defaultComponentState_exports = {};
2836
+ __export2(defaultComponentState_exports, {
2837
+ defaultComponentState: function() {
2838
+ return defaultComponentState;
2839
+ },
2840
+ defaultComponentStateMounted: function() {
2841
+ return defaultComponentStateMounted;
2842
+ },
2843
+ defaultComponentStateShouldEnter: function() {
2844
+ return defaultComponentStateShouldEnter;
2845
+ }
2846
+ });
2847
+ module2.exports = __toCommonJS2(defaultComponentState_exports);
2848
+ var defaultComponentState = {
2849
+ hover: !1,
2850
+ press: !1,
2851
+ pressIn: !1,
2852
+ focus: !1,
2853
+ focusVisible: !1,
2854
+ focusWithin: !1,
2855
+ unmounted: !0,
2856
+ disabled: !1
2857
+ }, defaultComponentStateMounted = {
2858
+ ...defaultComponentState,
2859
+ unmounted: !1
2860
+ }, defaultComponentStateShouldEnter = {
2861
+ ...defaultComponentState,
2862
+ unmounted: "should-enter"
2863
+ };
3343
2864
  }
3344
2865
  });
3345
2866
 
3346
- // ../web/dist/cjs/constants/isDevTools.native.js
3347
- var require_isDevTools_native = __commonJS({
3348
- "../web/dist/cjs/constants/isDevTools.native.js"(exports2, module2) {
2867
+ // ../web/dist/cjs/helpers/getShorthandValue.native.js
2868
+ var require_getShorthandValue_native = __commonJS({
2869
+ "../web/dist/cjs/helpers/getShorthandValue.native.js"(exports2, module2) {
3349
2870
  "use strict";
3350
2871
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
3351
2872
  for (var name in all) __defProp2(target, name, {
@@ -3379,26 +2900,24 @@ var require_isDevTools_native = __commonJS({
3379
2900
  return __copyProps2(__defProp2({}, "__esModule", {
3380
2901
  value: !0
3381
2902
  }), mod);
3382
- }, isDevTools_exports = {};
3383
- __export2(isDevTools_exports, {
3384
- isDevTools: function() {
3385
- return isDevTools;
2903
+ }, getShorthandValue_exports = {};
2904
+ __export2(getShorthandValue_exports, {
2905
+ getShorthandValue: function() {
2906
+ return getShorthandValue;
3386
2907
  }
3387
2908
  });
3388
- module2.exports = __toCommonJS2(isDevTools_exports);
3389
- var isDevTools = function() {
3390
- if (process.env.NODE_ENV === "development") try {
3391
- return new Function("try {return this===window;}catch(e){ return false;}")();
3392
- } catch {
3393
- }
3394
- return !1;
3395
- }();
2909
+ module2.exports = __toCommonJS2(getShorthandValue_exports);
2910
+ var import_config = require_config_native(), inverseShorthands = null, getShorthandValue = function(props, key) {
2911
+ inverseShorthands || (inverseShorthands = (0, import_config.getConfig)().inverseShorthands);
2912
+ var _props_key;
2913
+ return (_props_key = props[key]) !== null && _props_key !== void 0 ? _props_key : inverseShorthands ? props[inverseShorthands[key]] : void 0;
2914
+ };
3396
2915
  }
3397
2916
  });
3398
2917
 
3399
- // ../web/dist/cjs/helpers/objectIdentityKey.native.js
3400
- var require_objectIdentityKey_native = __commonJS({
3401
- "../web/dist/cjs/helpers/objectIdentityKey.native.js"(exports2, module2) {
2918
+ // ../web/dist/cjs/constants/accessibilityDirectMap.native.js
2919
+ var require_accessibilityDirectMap_native = __commonJS({
2920
+ "../web/dist/cjs/constants/accessibilityDirectMap.native.js"(exports2, module2) {
3402
2921
  "use strict";
3403
2922
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
3404
2923
  for (var name in all) __defProp2(target, name, {
@@ -3432,36 +2951,34 @@ var require_objectIdentityKey_native = __commonJS({
3432
2951
  return __copyProps2(__defProp2({}, "__esModule", {
3433
2952
  value: !0
3434
2953
  }), mod);
3435
- }, objectIdentityKey_exports = {};
3436
- __export2(objectIdentityKey_exports, {
3437
- objectIdentityKey: function() {
3438
- return objectIdentityKey;
3439
- }
3440
- });
3441
- module2.exports = __toCommonJS2(objectIdentityKey_exports);
3442
- function objectIdentityKey(obj) {
3443
- var k = "";
3444
- for (var key in obj) {
3445
- k += key;
3446
- var arg = obj[key], type = typeof arg;
3447
- if (!arg || type !== "object" && type !== "function") k += type + arg;
3448
- else if (cache2.has(arg)) k += cache2.get(arg);
3449
- else {
3450
- var v = Math.random();
3451
- cache2.set(arg, v), k += v;
3452
- }
3453
- }
3454
- return k;
3455
- }
3456
- var cache2 = /* @__PURE__ */ new WeakMap();
2954
+ }, accessibilityDirectMap_native_exports = {};
2955
+ __export2(accessibilityDirectMap_native_exports, {
2956
+ accessibilityDirectMap: function() {
2957
+ return accessibilityDirectMap;
2958
+ },
2959
+ accessibilityWebRoleToNativeRole: function() {
2960
+ return accessibilityWebRoleToNativeRole;
2961
+ },
2962
+ nativeAccessibilityState: function() {
2963
+ return nativeAccessibilityState;
2964
+ },
2965
+ nativeAccessibilityValue: function() {
2966
+ return nativeAccessibilityValue;
2967
+ },
2968
+ webToNativeAccessibilityDirectMap: function() {
2969
+ return webToNativeAccessibilityDirectMap;
2970
+ }
2971
+ });
2972
+ module2.exports = __toCommonJS2(accessibilityDirectMap_native_exports);
2973
+ var accessibilityDirectMap = {}, webToNativeAccessibilityDirectMap = {}, nativeAccessibilityValue = {}, nativeAccessibilityState = {}, accessibilityWebRoleToNativeRole = {};
3457
2974
  }
3458
2975
  });
3459
2976
 
3460
- // ../web/dist/cjs/helpers/createStyledContext.native.js
3461
- var require_createStyledContext_native = __commonJS({
3462
- "../web/dist/cjs/helpers/createStyledContext.native.js"(exports2, module2) {
2977
+ // ../web/dist/cjs/helpers/getGroupPropParts.native.js
2978
+ var require_getGroupPropParts_native = __commonJS({
2979
+ "../web/dist/cjs/helpers/getGroupPropParts.native.js"(exports2, module2) {
3463
2980
  "use strict";
3464
- var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
2981
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
3465
2982
  for (var name in all) __defProp2(target, name, {
3466
2983
  get: all[name],
3467
2984
  enumerable: !0
@@ -3489,62 +3006,32 @@ var require_createStyledContext_native = __commonJS({
3489
3006
  }
3490
3007
  }
3491
3008
  return to;
3492
- }, __toESM2 = function(mod, isNodeMode, target) {
3493
- return target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
3494
- // If the importer is in node compatibility mode or this is not an ESM
3495
- // file that has been converted to a CommonJS file using a Babel-
3496
- // compatible transform (i.e. "__esModule" has not been set), then set
3497
- // "default" to the CommonJS "module.exports" for node compatibility.
3498
- isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", {
3499
- value: mod,
3500
- enumerable: !0
3501
- }) : target,
3502
- mod
3503
- );
3504
3009
  }, __toCommonJS2 = function(mod) {
3505
3010
  return __copyProps2(__defProp2({}, "__esModule", {
3506
3011
  value: !0
3507
3012
  }), mod);
3508
- }, createStyledContext_exports = {};
3509
- __export2(createStyledContext_exports, {
3510
- createStyledContext: function() {
3511
- return createStyledContext;
3013
+ }, getGroupPropParts_exports = {};
3014
+ __export2(getGroupPropParts_exports, {
3015
+ getGroupPropParts: function() {
3016
+ return getGroupPropParts;
3512
3017
  }
3513
3018
  });
3514
- module2.exports = __toCommonJS2(createStyledContext_exports);
3515
- var import_jsx_runtime = require("react/jsx-runtime"), import_react3 = __toESM2(require("react")), import_objectIdentityKey = require_objectIdentityKey_native(), createReactContext = import_react3.default[Math.random(), "createContext"];
3516
- function createStyledContext(defaultValues) {
3517
- var OGContext = createReactContext(defaultValues), OGProvider = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map();
3518
- function getOrCreateScopedContext(scope) {
3519
- var ScopedContext = scopedContexts.get(scope);
3520
- return ScopedContext || (ScopedContext = createReactContext(defaultValues), scopedContexts.set(scope, ScopedContext)), ScopedContext;
3521
- }
3522
- var Provider = function(param) {
3523
- var { children, scope, ...values } = param, next = import_react3.default.useMemo(function() {
3524
- return {
3525
- // this ! is a workaround for ts error
3526
- ...defaultValues,
3527
- ...values
3528
- };
3529
- }, [
3530
- (0, import_objectIdentityKey.objectIdentityKey)(values)
3531
- ]), Provider22 = OGProvider;
3532
- return scope && (Provider22 = getOrCreateScopedContext(scope).Provider), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Provider22, {
3533
- value: next,
3534
- children
3535
- });
3536
- }, useStyledContext = function(scope) {
3537
- var context = scope ? getOrCreateScopedContext(scope) : OGContext;
3538
- return import_react3.default.useContext(context);
3019
+ module2.exports = __toCommonJS2(getGroupPropParts_exports);
3020
+ var import_useMedia = require_useMedia_native();
3021
+ function getGroupPropParts(groupProp) {
3022
+ var mediaQueries = (0, import_useMedia.getMedia)(), [_, name, part3, part4] = groupProp.split("-"), pseudo, media = part3 in mediaQueries ? part3 : void 0;
3023
+ return media ? pseudo = part4 : pseudo = part3, {
3024
+ name,
3025
+ pseudo,
3026
+ media
3539
3027
  };
3540
- return Context.Provider = Provider, Context.props = defaultValues, Context.context = OGContext, Context.useStyledContext = useStyledContext, Context;
3541
3028
  }
3542
3029
  }
3543
3030
  });
3544
3031
 
3545
- // ../web/dist/cjs/contexts/ComponentContext.native.js
3546
- var require_ComponentContext_native = __commonJS({
3547
- "../web/dist/cjs/contexts/ComponentContext.native.js"(exports2, module2) {
3032
+ // ../web/dist/cjs/helpers/createMediaStyle.native.js
3033
+ var require_createMediaStyle_native = __commonJS({
3034
+ "../web/dist/cjs/helpers/createMediaStyle.native.js"(exports2, module2) {
3548
3035
  "use strict";
3549
3036
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
3550
3037
  for (var name in all) __defProp2(target, name, {
@@ -3578,31 +3065,83 @@ var require_ComponentContext_native = __commonJS({
3578
3065
  return __copyProps2(__defProp2({}, "__esModule", {
3579
3066
  value: !0
3580
3067
  }), mod);
3581
- }, ComponentContext_exports = {};
3582
- __export2(ComponentContext_exports, {
3583
- ComponentContext: function() {
3584
- return ComponentContext;
3068
+ }, createMediaStyle_exports = {};
3069
+ __export2(createMediaStyle_exports, {
3070
+ MEDIA_SEP: function() {
3071
+ return MEDIA_SEP;
3072
+ },
3073
+ createMediaStyle: function() {
3074
+ return createMediaStyle;
3585
3075
  }
3586
3076
  });
3587
- module2.exports = __toCommonJS2(ComponentContext_exports);
3588
- var import_createStyledContext = require_createStyledContext_native(), ComponentContext = (0, import_createStyledContext.createStyledContext)({
3589
- disableSSR: void 0,
3590
- inText: !1,
3591
- language: null,
3592
- animationDriver: null,
3593
- setParentFocusState: null,
3594
- groups: {
3595
- emit: null,
3596
- subscribe: null,
3597
- state: {}
3598
- }
3077
+ module2.exports = __toCommonJS2(createMediaStyle_exports);
3078
+ var import_config = require_config_native(), import_useMedia = require_useMedia_native(), import_getGroupPropParts = require_getGroupPropParts_native(), MEDIA_SEP = "_", prefixes = null, selectors = null, groupPseudoToPseudoCSSMap = {
3079
+ press: "active",
3080
+ focusVisible: "focus-visible",
3081
+ focusWithin: "focus-within"
3082
+ }, specificities = new Array(5).fill(0).map(function(_, i) {
3083
+ return new Array(i).fill(":root").join("");
3599
3084
  });
3085
+ function getThemeOrGroupSelector(name, styleInner, isGroup, groupParts) {
3086
+ var isTheme = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !1, precedenceImportancePrefix = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : "", selectorStart = styleInner.lastIndexOf(":root") + 5, selectorEnd = styleInner.lastIndexOf("{"), selector = styleInner.slice(selectorStart, selectorEnd), precedenceSpace = (0, import_config.getSetting)("themeClassNameOnRoot") && isTheme ? "" : " ", pseudoSelectorName = groupParts.pseudo ? groupPseudoToPseudoCSSMap[groupParts.pseudo] || groupParts.pseudo : void 0, pseudoSelector = pseudoSelectorName ? `:${pseudoSelectorName}` : "", presedencePrefix = `:root${precedenceImportancePrefix}${precedenceSpace}`, mediaSelector = `.t_${isGroup ? "group_" : ""}${name}${pseudoSelector}`;
3087
+ return [
3088
+ selector,
3089
+ `${presedencePrefix}${mediaSelector} ${selector.replaceAll(":root", "")}`
3090
+ ];
3091
+ }
3092
+ var createMediaStyle = function(styleObject, mediaKeyIn, mediaQueries, type, negate, priority) {
3093
+ var [propertyIn, , identifier, pseudoIn, rules] = styleObject, property = propertyIn, enableMediaPropOrder = (0, import_config.getSetting)("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 = "", groupPriority = "", groupMediaKey, containerName, nextIdentifier = identifier.replace(ogPrefix, id), styleInner = rules.map(function(rule) {
3094
+ return rule.replace(identifier, nextIdentifier);
3095
+ }).join(";"), isHover = !1;
3096
+ if (isNonWindowMedia) {
3097
+ var specificity = (priority || 0) + (isGroup || isPlatform ? 1 : 0);
3098
+ if (isTheme || isGroup) {
3099
+ var groupParts = (0, import_getGroupPropParts.getGroupPropParts)(isTheme ? "theme-" + mediaKeyIn : mediaKeyIn), { name, media, pseudo } = groupParts;
3100
+ groupMediaKey = media, isGroup && (containerName = name), (pseudo === "press" || pseudoIn === "active") && (specificity += 2), pseudo === "hover" && (isHover = !0);
3101
+ var [selector, nextSelector] = getThemeOrGroupSelector(name, styleInner, isGroup, groupParts, isTheme, specificities[specificity]);
3102
+ styleRule = styleInner.replace(selector, nextSelector);
3103
+ } else styleRule = `${specificities[specificity]}${styleInner}`;
3104
+ }
3105
+ if (!isNonWindowMedia || groupMediaKey) {
3106
+ if (!selectors) {
3107
+ var mediaKeys = Object.keys(mediaQueries);
3108
+ selectors = Object.fromEntries(mediaKeys.map(function(key) {
3109
+ return [
3110
+ key,
3111
+ (0, import_useMedia.mediaObjectToString)(mediaQueries[key])
3112
+ ];
3113
+ })), enableMediaPropOrder || (prefixes = Object.fromEntries(mediaKeys.map(function(k, index) {
3114
+ return [
3115
+ k,
3116
+ new Array(index + 1).fill(":root").join("")
3117
+ ];
3118
+ })));
3119
+ }
3120
+ var mediaKey = groupMediaKey || mediaKeyIn, mediaSelector = selectors[mediaKey], screenStr = negate ? "not all and " : "", mediaQuery = `${screenStr}${mediaSelector}`, precedenceImportancePrefix = groupMediaKey ? groupPriority : enableMediaPropOrder && priority ? (
3121
+ // this new array should be cached
3122
+ specificities[priority]
3123
+ ) : (
3124
+ // @ts-ignore
3125
+ prefixes[mediaKey]
3126
+ ), prefix = groupMediaKey ? `@container ${containerName}` : "@media";
3127
+ groupMediaKey && (styleInner = styleRule), styleInner.includes(prefix) ? styleRule = styleInner.replace("{", ` and ${mediaQuery} {`).replace("and screen and", "and") : styleRule = `${prefix} ${mediaQuery}{${precedenceImportancePrefix}${styleInner}}`, groupMediaKey && (styleRule = `@supports (contain: ${(0, import_config.getSetting)("webContainerType") || "inline-size"}) {${styleRule}}`);
3128
+ }
3129
+ return isHover && (styleRule = `@media (hover:hover){${styleRule}}`), [
3130
+ property,
3131
+ void 0,
3132
+ nextIdentifier,
3133
+ void 0,
3134
+ [
3135
+ styleRule
3136
+ ]
3137
+ ];
3138
+ };
3600
3139
  }
3601
3140
  });
3602
3141
 
3603
- // ../web/dist/cjs/defaultComponentState.native.js
3604
- var require_defaultComponentState_native = __commonJS({
3605
- "../web/dist/cjs/defaultComponentState.native.js"(exports2, module2) {
3142
+ // ../web/dist/cjs/helpers/defaultOffset.native.js
3143
+ var require_defaultOffset_native = __commonJS({
3144
+ "../web/dist/cjs/helpers/defaultOffset.native.js"(exports2, module2) {
3606
3145
  "use strict";
3607
3146
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
3608
3147
  for (var name in all) __defProp2(target, name, {
@@ -3636,366 +3175,23 @@ var require_defaultComponentState_native = __commonJS({
3636
3175
  return __copyProps2(__defProp2({}, "__esModule", {
3637
3176
  value: !0
3638
3177
  }), mod);
3639
- }, defaultComponentState_exports = {};
3640
- __export2(defaultComponentState_exports, {
3641
- defaultComponentState: function() {
3642
- return defaultComponentState;
3643
- },
3644
- defaultComponentStateMounted: function() {
3645
- return defaultComponentStateMounted;
3646
- },
3647
- defaultComponentStateShouldEnter: function() {
3648
- return defaultComponentStateShouldEnter;
3178
+ }, defaultOffset_exports = {};
3179
+ __export2(defaultOffset_exports, {
3180
+ defaultOffset: function() {
3181
+ return defaultOffset;
3649
3182
  }
3650
3183
  });
3651
- module2.exports = __toCommonJS2(defaultComponentState_exports);
3652
- var defaultComponentState = {
3653
- hover: !1,
3654
- press: !1,
3655
- pressIn: !1,
3656
- focus: !1,
3657
- focusVisible: !1,
3658
- focusWithin: !1,
3659
- unmounted: !0,
3660
- disabled: !1
3661
- }, defaultComponentStateMounted = {
3662
- ...defaultComponentState,
3663
- unmounted: !1
3664
- }, defaultComponentStateShouldEnter = {
3665
- ...defaultComponentState,
3666
- unmounted: "should-enter"
3184
+ module2.exports = __toCommonJS2(defaultOffset_exports);
3185
+ var defaultOffset = {
3186
+ height: 0,
3187
+ width: 0
3667
3188
  };
3668
3189
  }
3669
3190
  });
3670
3191
 
3671
- // ../web/dist/cjs/helpers/getShorthandValue.native.js
3672
- var require_getShorthandValue_native = __commonJS({
3673
- "../web/dist/cjs/helpers/getShorthandValue.native.js"(exports2, module2) {
3674
- "use strict";
3675
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
3676
- for (var name in all) __defProp2(target, name, {
3677
- get: all[name],
3678
- enumerable: !0
3679
- });
3680
- }, __copyProps2 = function(to, from, except, desc) {
3681
- var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
3682
- if (from && typeof from == "object" || typeof from == "function") try {
3683
- for (var _loop = function() {
3684
- var key = _step.value;
3685
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
3686
- get: function() {
3687
- return from[key];
3688
- },
3689
- enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
3690
- });
3691
- }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
3692
- } catch (err) {
3693
- _didIteratorError = !0, _iteratorError = err;
3694
- } finally {
3695
- try {
3696
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
3697
- } finally {
3698
- if (_didIteratorError)
3699
- throw _iteratorError;
3700
- }
3701
- }
3702
- return to;
3703
- }, __toCommonJS2 = function(mod) {
3704
- return __copyProps2(__defProp2({}, "__esModule", {
3705
- value: !0
3706
- }), mod);
3707
- }, getShorthandValue_exports = {};
3708
- __export2(getShorthandValue_exports, {
3709
- getShorthandValue: function() {
3710
- return getShorthandValue;
3711
- }
3712
- });
3713
- module2.exports = __toCommonJS2(getShorthandValue_exports);
3714
- var import_config = require_config_native(), inverseShorthands = null, getShorthandValue = function(props, key) {
3715
- inverseShorthands || (inverseShorthands = (0, import_config.getConfig)().inverseShorthands);
3716
- var _props_key;
3717
- return (_props_key = props[key]) !== null && _props_key !== void 0 ? _props_key : inverseShorthands ? props[inverseShorthands[key]] : void 0;
3718
- };
3719
- }
3720
- });
3721
-
3722
- // ../web/dist/cjs/constants/accessibilityDirectMap.native.js
3723
- var require_accessibilityDirectMap_native = __commonJS({
3724
- "../web/dist/cjs/constants/accessibilityDirectMap.native.js"(exports2, module2) {
3725
- "use strict";
3726
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
3727
- for (var name in all) __defProp2(target, name, {
3728
- get: all[name],
3729
- enumerable: !0
3730
- });
3731
- }, __copyProps2 = function(to, from, except, desc) {
3732
- var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
3733
- if (from && typeof from == "object" || typeof from == "function") try {
3734
- for (var _loop = function() {
3735
- var key = _step.value;
3736
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
3737
- get: function() {
3738
- return from[key];
3739
- },
3740
- enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
3741
- });
3742
- }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
3743
- } catch (err) {
3744
- _didIteratorError = !0, _iteratorError = err;
3745
- } finally {
3746
- try {
3747
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
3748
- } finally {
3749
- if (_didIteratorError)
3750
- throw _iteratorError;
3751
- }
3752
- }
3753
- return to;
3754
- }, __toCommonJS2 = function(mod) {
3755
- return __copyProps2(__defProp2({}, "__esModule", {
3756
- value: !0
3757
- }), mod);
3758
- }, accessibilityDirectMap_native_exports = {};
3759
- __export2(accessibilityDirectMap_native_exports, {
3760
- accessibilityDirectMap: function() {
3761
- return accessibilityDirectMap;
3762
- },
3763
- accessibilityWebRoleToNativeRole: function() {
3764
- return accessibilityWebRoleToNativeRole;
3765
- },
3766
- nativeAccessibilityState: function() {
3767
- return nativeAccessibilityState;
3768
- },
3769
- nativeAccessibilityValue: function() {
3770
- return nativeAccessibilityValue;
3771
- },
3772
- webToNativeAccessibilityDirectMap: function() {
3773
- return webToNativeAccessibilityDirectMap;
3774
- }
3775
- });
3776
- module2.exports = __toCommonJS2(accessibilityDirectMap_native_exports);
3777
- var accessibilityDirectMap = {}, webToNativeAccessibilityDirectMap = {}, nativeAccessibilityValue = {}, nativeAccessibilityState = {}, accessibilityWebRoleToNativeRole = {};
3778
- }
3779
- });
3780
-
3781
- // ../web/dist/cjs/helpers/getGroupPropParts.native.js
3782
- var require_getGroupPropParts_native = __commonJS({
3783
- "../web/dist/cjs/helpers/getGroupPropParts.native.js"(exports2, module2) {
3784
- "use strict";
3785
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
3786
- for (var name in all) __defProp2(target, name, {
3787
- get: all[name],
3788
- enumerable: !0
3789
- });
3790
- }, __copyProps2 = function(to, from, except, desc) {
3791
- var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
3792
- if (from && typeof from == "object" || typeof from == "function") try {
3793
- for (var _loop = function() {
3794
- var key = _step.value;
3795
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
3796
- get: function() {
3797
- return from[key];
3798
- },
3799
- enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
3800
- });
3801
- }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
3802
- } catch (err) {
3803
- _didIteratorError = !0, _iteratorError = err;
3804
- } finally {
3805
- try {
3806
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
3807
- } finally {
3808
- if (_didIteratorError)
3809
- throw _iteratorError;
3810
- }
3811
- }
3812
- return to;
3813
- }, __toCommonJS2 = function(mod) {
3814
- return __copyProps2(__defProp2({}, "__esModule", {
3815
- value: !0
3816
- }), mod);
3817
- }, getGroupPropParts_exports = {};
3818
- __export2(getGroupPropParts_exports, {
3819
- getGroupPropParts: function() {
3820
- return getGroupPropParts;
3821
- }
3822
- });
3823
- module2.exports = __toCommonJS2(getGroupPropParts_exports);
3824
- var import_useMedia = require_useMedia_native();
3825
- function getGroupPropParts(groupProp) {
3826
- var mediaQueries = (0, import_useMedia.getMedia)(), [_, name, part3, part4] = groupProp.split("-"), pseudo, media = part3 in mediaQueries ? part3 : void 0;
3827
- return media ? pseudo = part4 : pseudo = part3, {
3828
- name,
3829
- pseudo,
3830
- media
3831
- };
3832
- }
3833
- }
3834
- });
3835
-
3836
- // ../web/dist/cjs/helpers/createMediaStyle.native.js
3837
- var require_createMediaStyle_native = __commonJS({
3838
- "../web/dist/cjs/helpers/createMediaStyle.native.js"(exports2, module2) {
3839
- "use strict";
3840
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
3841
- for (var name in all) __defProp2(target, name, {
3842
- get: all[name],
3843
- enumerable: !0
3844
- });
3845
- }, __copyProps2 = function(to, from, except, desc) {
3846
- var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
3847
- if (from && typeof from == "object" || typeof from == "function") try {
3848
- for (var _loop = function() {
3849
- var key = _step.value;
3850
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
3851
- get: function() {
3852
- return from[key];
3853
- },
3854
- enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
3855
- });
3856
- }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
3857
- } catch (err) {
3858
- _didIteratorError = !0, _iteratorError = err;
3859
- } finally {
3860
- try {
3861
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
3862
- } finally {
3863
- if (_didIteratorError)
3864
- throw _iteratorError;
3865
- }
3866
- }
3867
- return to;
3868
- }, __toCommonJS2 = function(mod) {
3869
- return __copyProps2(__defProp2({}, "__esModule", {
3870
- value: !0
3871
- }), mod);
3872
- }, createMediaStyle_exports = {};
3873
- __export2(createMediaStyle_exports, {
3874
- MEDIA_SEP: function() {
3875
- return MEDIA_SEP;
3876
- },
3877
- createMediaStyle: function() {
3878
- return createMediaStyle;
3879
- }
3880
- });
3881
- module2.exports = __toCommonJS2(createMediaStyle_exports);
3882
- var import_config = require_config_native(), import_useMedia = require_useMedia_native(), import_getGroupPropParts = require_getGroupPropParts_native(), MEDIA_SEP = "_", prefixes = null, selectors = null, groupPseudoToPseudoCSSMap = {
3883
- press: "active",
3884
- focusVisible: "focus-visible",
3885
- focusWithin: "focus-within"
3886
- }, specificities = new Array(5).fill(0).map(function(_, i) {
3887
- return new Array(i).fill(":root").join("");
3888
- });
3889
- function getThemeOrGroupSelector(name, styleInner, isGroup, groupParts) {
3890
- var isTheme = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !1, precedenceImportancePrefix = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : "", selectorStart = styleInner.lastIndexOf(":root") + 5, selectorEnd = styleInner.lastIndexOf("{"), selector = styleInner.slice(selectorStart, selectorEnd), precedenceSpace = (0, import_config.getSetting)("themeClassNameOnRoot") && isTheme ? "" : " ", pseudoSelectorName = groupParts.pseudo ? groupPseudoToPseudoCSSMap[groupParts.pseudo] || groupParts.pseudo : void 0, pseudoSelector = pseudoSelectorName ? `:${pseudoSelectorName}` : "", presedencePrefix = `:root${precedenceImportancePrefix}${precedenceSpace}`, mediaSelector = `.t_${isGroup ? "group_" : ""}${name}${pseudoSelector}`;
3891
- return [
3892
- selector,
3893
- `${presedencePrefix}${mediaSelector} ${selector.replaceAll(":root", "")}`
3894
- ];
3895
- }
3896
- var createMediaStyle = function(styleObject, mediaKeyIn, mediaQueries, type, negate, priority) {
3897
- var [propertyIn, , identifier, pseudoIn, rules] = styleObject, property = propertyIn, enableMediaPropOrder = (0, import_config.getSetting)("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 = "", groupPriority = "", groupMediaKey, containerName, nextIdentifier = identifier.replace(ogPrefix, id), styleInner = rules.map(function(rule) {
3898
- return rule.replace(identifier, nextIdentifier);
3899
- }).join(";"), isHover = !1;
3900
- if (isNonWindowMedia) {
3901
- var specificity = (priority || 0) + (isGroup || isPlatform ? 1 : 0);
3902
- if (isTheme || isGroup) {
3903
- var groupParts = (0, import_getGroupPropParts.getGroupPropParts)(isTheme ? "theme-" + mediaKeyIn : mediaKeyIn), { name, media, pseudo } = groupParts;
3904
- groupMediaKey = media, isGroup && (containerName = name), (pseudo === "press" || pseudoIn === "active") && (specificity += 2), pseudo === "hover" && (isHover = !0);
3905
- var [selector, nextSelector] = getThemeOrGroupSelector(name, styleInner, isGroup, groupParts, isTheme, specificities[specificity]);
3906
- styleRule = styleInner.replace(selector, nextSelector);
3907
- } else styleRule = `${specificities[specificity]}${styleInner}`;
3908
- }
3909
- if (!isNonWindowMedia || groupMediaKey) {
3910
- if (!selectors) {
3911
- var mediaKeys = Object.keys(mediaQueries);
3912
- selectors = Object.fromEntries(mediaKeys.map(function(key) {
3913
- return [
3914
- key,
3915
- (0, import_useMedia.mediaObjectToString)(mediaQueries[key])
3916
- ];
3917
- })), enableMediaPropOrder || (prefixes = Object.fromEntries(mediaKeys.map(function(k, index) {
3918
- return [
3919
- k,
3920
- new Array(index + 1).fill(":root").join("")
3921
- ];
3922
- })));
3923
- }
3924
- var mediaKey = groupMediaKey || mediaKeyIn, mediaSelector = selectors[mediaKey], screenStr = negate ? "not all and " : "", mediaQuery = `${screenStr}${mediaSelector}`, precedenceImportancePrefix = groupMediaKey ? groupPriority : enableMediaPropOrder && priority ? (
3925
- // this new array should be cached
3926
- specificities[priority]
3927
- ) : (
3928
- // @ts-ignore
3929
- prefixes[mediaKey]
3930
- ), prefix = groupMediaKey ? `@container ${containerName}` : "@media";
3931
- groupMediaKey && (styleInner = styleRule), styleInner.includes(prefix) ? styleRule = styleInner.replace("{", ` and ${mediaQuery} {`).replace("and screen and", "and") : styleRule = `${prefix} ${mediaQuery}{${precedenceImportancePrefix}${styleInner}}`, groupMediaKey && (styleRule = `@supports (contain: ${(0, import_config.getSetting)("webContainerType") || "inline-size"}) {${styleRule}}`);
3932
- }
3933
- return isHover && (styleRule = `@media (hover:hover){${styleRule}}`), [
3934
- property,
3935
- void 0,
3936
- nextIdentifier,
3937
- void 0,
3938
- [
3939
- styleRule
3940
- ]
3941
- ];
3942
- };
3943
- }
3944
- });
3945
-
3946
- // ../web/dist/cjs/helpers/defaultOffset.native.js
3947
- var require_defaultOffset_native = __commonJS({
3948
- "../web/dist/cjs/helpers/defaultOffset.native.js"(exports2, module2) {
3949
- "use strict";
3950
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
3951
- for (var name in all) __defProp2(target, name, {
3952
- get: all[name],
3953
- enumerable: !0
3954
- });
3955
- }, __copyProps2 = function(to, from, except, desc) {
3956
- var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
3957
- if (from && typeof from == "object" || typeof from == "function") try {
3958
- for (var _loop = function() {
3959
- var key = _step.value;
3960
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
3961
- get: function() {
3962
- return from[key];
3963
- },
3964
- enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
3965
- });
3966
- }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
3967
- } catch (err) {
3968
- _didIteratorError = !0, _iteratorError = err;
3969
- } finally {
3970
- try {
3971
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
3972
- } finally {
3973
- if (_didIteratorError)
3974
- throw _iteratorError;
3975
- }
3976
- }
3977
- return to;
3978
- }, __toCommonJS2 = function(mod) {
3979
- return __copyProps2(__defProp2({}, "__esModule", {
3980
- value: !0
3981
- }), mod);
3982
- }, defaultOffset_exports = {};
3983
- __export2(defaultOffset_exports, {
3984
- defaultOffset: function() {
3985
- return defaultOffset;
3986
- }
3987
- });
3988
- module2.exports = __toCommonJS2(defaultOffset_exports);
3989
- var defaultOffset = {
3990
- height: 0,
3991
- width: 0
3992
- };
3993
- }
3994
- });
3995
-
3996
- // ../../../node_modules/@react-native/normalize-color/index.js
3997
- var require_normalize_color = __commonJS({
3998
- "../../../node_modules/@react-native/normalize-color/index.js"(exports2, module2) {
3192
+ // ../../../node_modules/@react-native/normalize-color/index.js
3193
+ var require_normalize_color = __commonJS({
3194
+ "../../../node_modules/@react-native/normalize-color/index.js"(exports2, module2) {
3999
3195
  "use strict";
4000
3196
  function normalizeColor(color) {
4001
3197
  if (typeof color == "number")
@@ -6433,266 +5629,763 @@ var require_getSplitStyles_native = __commonJS({
6433
5629
  }
6434
5630
  console.groupEnd();
6435
5631
  }
6436
- };
6437
- conf = conf || (0, import_config.getConfig)(), import_constants2.isWeb && styleProps.isAnimated && conf.animations.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
6438
- var { shorthands } = conf, { isHOC, isText, isInput, variants, isReactNative, inlineProps, inlineWhenUnflattened, parentStaticConfig, acceptsClassName } = staticConfig, viewProps = {}, mediaState2 = styleProps.mediaState || import_useMedia.mediaState, usedKeys = {}, shouldDoClasses = acceptsClassName && import_constants2.isWeb && !styleProps.noClass, rulesToInsert = void 0, classNames = {}, transforms = {}, pseudos = null, space = props.space, hasMedia = !1, dynamicThemeAccess, pseudoGroups, mediaGroups, className = props.className || "", mediaStylesSeen = 0, validStyles2 = staticConfig.validStyles || (staticConfig.isText || staticConfig.isInput ? import_helpers2.stylePropsText : import_helpers2.validStyles);
6439
- process.env.NODE_ENV === "development" && debug === "profile" && time`split-styles-setup`;
6440
- var styleState = {
6441
- classNames,
6442
- conf,
6443
- props,
6444
- styleProps,
6445
- componentState,
6446
- staticConfig,
6447
- style: null,
6448
- theme,
6449
- usedKeys,
6450
- viewProps,
6451
- context,
6452
- debug
6453
- };
6454
- if (process.env.IS_STATIC === "is_static") {
6455
- var { fallbackProps } = styleProps;
6456
- fallbackProps && (styleState.props = new Proxy(props, {
6457
- get(_, key4, val2) {
6458
- return Reflect.has(props, key4) ? Reflect.get(props, key4) : Reflect.get(fallbackProps, key4);
6459
- }
6460
- }));
5632
+ };
5633
+ conf = conf || (0, import_config.getConfig)(), import_constants2.isWeb && styleProps.isAnimated && conf.animations.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
5634
+ var { shorthands } = conf, { isHOC, isText, isInput, variants, isReactNative, inlineProps, inlineWhenUnflattened, parentStaticConfig, acceptsClassName } = staticConfig, viewProps = {}, mediaState2 = styleProps.mediaState || import_useMedia.mediaState, usedKeys = {}, shouldDoClasses = acceptsClassName && import_constants2.isWeb && !styleProps.noClass, rulesToInsert = void 0, classNames = {}, transforms = {}, pseudos = null, space = props.space, hasMedia = !1, dynamicThemeAccess, pseudoGroups, mediaGroups, className = props.className || "", mediaStylesSeen = 0, validStyles2 = staticConfig.validStyles || (staticConfig.isText || staticConfig.isInput ? import_helpers2.stylePropsText : import_helpers2.validStyles);
5635
+ process.env.NODE_ENV === "development" && debug === "profile" && time`split-styles-setup`;
5636
+ var styleState = {
5637
+ classNames,
5638
+ conf,
5639
+ props,
5640
+ styleProps,
5641
+ componentState,
5642
+ staticConfig,
5643
+ style: null,
5644
+ theme,
5645
+ usedKeys,
5646
+ viewProps,
5647
+ context,
5648
+ debug
5649
+ };
5650
+ if (process.env.IS_STATIC === "is_static") {
5651
+ var { fallbackProps } = styleProps;
5652
+ fallbackProps && (styleState.props = new Proxy(props, {
5653
+ get(_, key4, val2) {
5654
+ return Reflect.has(props, key4) ? Reflect.get(props, key4) : Reflect.get(fallbackProps, key4);
5655
+ }
5656
+ }));
5657
+ }
5658
+ process.env.NODE_ENV === "development" && debug === "profile" && time`style-state`, process.env.NODE_ENV === "development" && debug && debug !== "profile" && import_constants2.isClient && (consoleGroupCollapsed("getSplitStyles (collapsed)"), (0, import_log.log)({
5659
+ props,
5660
+ staticConfig,
5661
+ shouldDoClasses,
5662
+ styleProps,
5663
+ rulesToInsert,
5664
+ componentState,
5665
+ styleState,
5666
+ theme: {
5667
+ ...theme
5668
+ }
5669
+ }), console.groupEnd());
5670
+ var { asChild } = props, { accept } = staticConfig, { noSkip, disableExpandShorthands, noExpand } = styleProps, { webContainerType } = conf.settings, parentVariants = parentStaticConfig == null ? void 0 : parentStaticConfig.variants;
5671
+ for (var keyOg in props) _loop(keyOg);
5672
+ process.env.NODE_ENV === "development" && debug === "profile" && time`split-styles-propsend`;
5673
+ var avoidNormalize = styleProps.noNormalize === !1;
5674
+ if (!avoidNormalize) {
5675
+ if (styleState.style && ((0, import_expandStyles.fixStyles)(styleState.style), !styleProps.noExpand && !styleProps.noMergeStyle && import_constants2.isWeb && !isReactNative && (0, import_getCSSStylesAtomic.styleToCSS)(styleState.style)), styleState.flatTransforms) {
5676
+ var _styleState;
5677
+ (_styleState = styleState).style || (_styleState.style = {}), Object.entries(styleState.flatTransforms).sort(function(param, param1) {
5678
+ var [a] = param, [b] = param1;
5679
+ return (0, import_sortString.sortString)(a, b);
5680
+ }).forEach(function(param) {
5681
+ var [key4, val2] = param;
5682
+ mergeTransform(styleState.style, key4, val2, !0);
5683
+ });
5684
+ }
5685
+ if (parentSplitStyles) {
5686
+ if (0) for (var key in parentSplitStyles.classNames) var val;
5687
+ if (!shouldDoClasses) for (var key1 in parentSplitStyles.style) {
5688
+ var _styleState1;
5689
+ key1 in classNames || styleState.style && key1 in styleState.style || ((_styleState1 = styleState).style || (_styleState1.style = {}), styleState.style[key1] = parentSplitStyles.style[key1]);
5690
+ }
5691
+ }
5692
+ }
5693
+ if (0) var _styleState_style, shouldStringifyTransforms;
5694
+ if (0) {
5695
+ if (!styleProps.noMergeStyle && styleState.style && shouldDoClasses) {
5696
+ var retainedStyles, shouldRetain;
5697
+ if (!styleState.style.$$css) {
5698
+ var atomic, _iteratorNormalCompletion, _didIteratorError, _iteratorError;
5699
+ try {
5700
+ for (var _iterator, _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) var atomicStyle, _props_animateOnly, _props_animateOnly1, key2, value, identifier, isAnimatedAndAnimateOnly, nonAnimatedAnimateOnly;
5701
+ } catch (err) {
5702
+ } finally {
5703
+ }
5704
+ }
5705
+ if (transforms) for (var namespace in transforms) {
5706
+ var hash, val1, identifier1;
5707
+ if (import_constants2.isClient && !insertedTransforms[identifier1]) var rule;
5708
+ }
5709
+ }
5710
+ if (isReactNative) {
5711
+ if (viewProps.tabIndex === 0) var _viewProps, _accessible;
5712
+ } else if (viewProps.tabIndex == null) var _viewProps_focusable, isFocusable, role;
5713
+ }
5714
+ var styleProp = props.style;
5715
+ if (!styleProps.noMergeStyle && styleProp) if (isHOC) viewProps.style = normalizeStyle(styleProp);
5716
+ else for (var isArray = Array.isArray(styleProp), len = isArray ? styleProp.length : 1, i = 0; i < len; i++) {
5717
+ var style = isArray ? styleProp[i] : styleProp;
5718
+ if (style) if (style.$$css) Object.assign(styleState.classNames, style);
5719
+ else {
5720
+ var _styleState2;
5721
+ (_styleState2 = styleState).style || (_styleState2.style = {}), Object.assign(styleState.style, normalizeStyle(style));
5722
+ }
5723
+ }
5724
+ var style1 = styleState.style;
5725
+ if (style1 != null && style1.fontFamily) {
5726
+ var _getFont, faceInfo = (_getFont = (0, import_config.getFont)(style1.fontFamily)) === null || _getFont === void 0 ? void 0 : _getFont.face;
5727
+ if (faceInfo) {
5728
+ var _faceInfo_style_fontWeight_, _faceInfo_style_fontWeight, overrideFace = (_faceInfo_style_fontWeight = faceInfo[style1.fontWeight]) === null || _faceInfo_style_fontWeight === void 0 || (_faceInfo_style_fontWeight_ = _faceInfo_style_fontWeight[style1.fontStyle || "normal"]) === null || _faceInfo_style_fontWeight_ === void 0 ? void 0 : _faceInfo_style_fontWeight_.val;
5729
+ overrideFace && (style1.fontFamily = overrideFace, styleState.fontFamily = overrideFace, delete style1.fontWeight, delete style1.fontStyle);
5730
+ }
5731
+ process.env.NODE_ENV === "development" && debug && debug !== "profile" && (0, import_log.log)(`Found fontFamily native: ${style1.fontFamily}`, faceInfo);
5732
+ }
5733
+ process.env.NODE_ENV === "development" && debug === "profile" && time`split-styles-pre-result`;
5734
+ var result = {
5735
+ space,
5736
+ hasMedia,
5737
+ fontFamily: styleState.fontFamily,
5738
+ viewProps,
5739
+ style: styleState.style,
5740
+ pseudos,
5741
+ classNames,
5742
+ rulesToInsert,
5743
+ dynamicThemeAccess,
5744
+ pseudoGroups,
5745
+ mediaGroups
5746
+ }, asChildExceptStyleLike = asChild === "except-style" || asChild === "except-style-web";
5747
+ if (!styleProps.noMergeStyle && !asChildExceptStyleLike) {
5748
+ var style2 = styleState.style;
5749
+ if (0) {
5750
+ var _staticConfig_defaultProps, fontFamily, fontFamilyClassName, groupClassName, componentNameFinal, componentClassName, classList, finalClassName;
5751
+ if (!(styleProps.isAnimated && !conf.animations.supportsCSSVars && isReactNative) && isReactNative) {
5752
+ var cnStyles, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1;
5753
+ try {
5754
+ for (var _iterator1, _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0) var name;
5755
+ } catch (err) {
5756
+ } finally {
5757
+ }
5758
+ }
5759
+ } else style2 && (viewProps.style = style2);
5760
+ }
5761
+ if (process.env.NODE_ENV === "development" && debug === "verbose" && import_isDevTools.isDevTools) {
5762
+ consoleGroupCollapsed("\u{1F539} getSplitStyles ===>");
5763
+ try {
5764
+ var logs = {
5765
+ ...result,
5766
+ className,
5767
+ componentState,
5768
+ transforms,
5769
+ viewProps,
5770
+ rulesToInsert,
5771
+ parentSplitStyles
5772
+ };
5773
+ for (var key3 in logs) (0, import_log.log)(key3, logs[key3]);
5774
+ } catch {
5775
+ }
5776
+ console.groupEnd();
5777
+ }
5778
+ return process.env.NODE_ENV === "development" && debug === "profile" && time`split-styles-done`, result;
5779
+ };
5780
+ function mergeClassName(transforms, classNames, key, val) {
5781
+ var isMediaOrPseudo = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !1, isInsertingNow = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : !1;
5782
+ if (0) var _transforms, _ns, ns, transform;
5783
+ }
5784
+ function mergeStyle(styleState, key, val) {
5785
+ var disableNormalize = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, { classNames, viewProps, usedKeys, styleProps, staticConfig } = styleState;
5786
+ if (import_constants2.isWeb && (val == null ? void 0 : val[0]) === "_") {
5787
+ var _usedKeys, _key;
5788
+ classNames[key] = val, (_usedKeys = usedKeys)[_key = key] || (_usedKeys[_key] = 1);
5789
+ } else if (key in import_helpers2.stylePropsTransform) {
5790
+ var _styleState;
5791
+ (_styleState = styleState).flatTransforms || (_styleState.flatTransforms = {}), styleState.flatTransforms[key] = val;
5792
+ } else {
5793
+ var shouldNormalize = import_constants2.isWeb && !disableNormalize && !styleProps.noNormalize, out = shouldNormalize ? (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(val, key) : val;
5794
+ if (
5795
+ // accept is for props not styles
5796
+ staticConfig.accept && key in staticConfig.accept
5797
+ ) viewProps[key] = out;
5798
+ else {
5799
+ var _styleState1;
5800
+ (_styleState1 = styleState).style || (_styleState1.style = {}), styleState.style[key] = out;
5801
+ }
5802
+ }
5803
+ }
5804
+ var getSubStyle = function(styleState, subKey, styleIn, avoidMergeTransform) {
5805
+ var _loop = function(key1) {
5806
+ var val = styleIn[key1];
5807
+ key1 = conf2.shorthands[key1] || key1;
5808
+ var shouldSkip = !staticConfig.isHOC && key1 in import_skipProps.skipProps && !styleProps.noSkip;
5809
+ if (shouldSkip) return key = key1, "continue";
5810
+ (0, import_propMapper.propMapper)(key1, val, styleState, !1, function(skey, sval) {
5811
+ skey in import_helpers2.validPseudoKeys && (sval = getSubStyle(styleState, skey, sval, avoidMergeTransform)), !avoidMergeTransform && skey in import_helpers2.stylePropsTransform ? mergeTransform(styleOut, skey, sval) : styleOut[skey] = styleProps.noNormalize ? sval : (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(sval, key1);
5812
+ }), key = key1;
5813
+ }, { staticConfig, conf: conf2, styleProps } = styleState, styleOut = {};
5814
+ for (var key in styleIn) _loop(key);
5815
+ return styleProps.noNormalize || (0, import_expandStyles.fixStyles)(styleOut), styleOut;
5816
+ }, useInsertEffectCompat = import_constants2.isWeb ? import_react3.default.useInsertionEffect || import_constants2.useIsomorphicLayoutEffect : function() {
5817
+ }, useSplitStyles = function(a, b, c, d, e, f, g, h, i, j) {
5818
+ conf = conf || (0, import_config.getConfig)();
5819
+ var res = getSplitStyles(a, b, c, d, e, f, g, h, i, j);
5820
+ return res;
5821
+ };
5822
+ function addStyleToInsertRules(rulesToInsert, styleObject) {
5823
+ if (0) var identifier;
5824
+ }
5825
+ var defaultColor = process.env.TAMAGUI_DEFAULT_COLOR || "rgba(0,0,0,0)", animatableDefaults = {
5826
+ ...Object.fromEntries(Object.entries(import_helpers2.tokenCategories.color).map(function(param) {
5827
+ var [k, v] = param;
5828
+ return [
5829
+ k,
5830
+ defaultColor
5831
+ ];
5832
+ })),
5833
+ opacity: 1,
5834
+ scale: 1,
5835
+ rotate: "0deg",
5836
+ rotateY: "0deg",
5837
+ rotateX: "0deg",
5838
+ x: 0,
5839
+ y: 0,
5840
+ borderRadius: 0
5841
+ }, lowercaseHyphenate = function(match) {
5842
+ return `-${match.toLowerCase()}`;
5843
+ }, hyphenate = function(str) {
5844
+ return str.replace(/[A-Z]/g, lowercaseHyphenate);
5845
+ }, mergeTransform = function(obj, key, val) {
5846
+ var backwards = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, _obj;
5847
+ typeof obj.transform != "string" && ((_obj = obj).transform || (_obj.transform = []), obj.transform[backwards ? "unshift" : "push"]({
5848
+ [mapTransformKeys[key] || key]: val
5849
+ }));
5850
+ }, mapTransformKeys = {
5851
+ x: "translateX",
5852
+ y: "translateY"
5853
+ };
5854
+ function passDownProp(viewProps, key, val) {
5855
+ var shouldMergeObject = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1;
5856
+ if (shouldMergeObject) {
5857
+ var next = {
5858
+ ...viewProps[key],
5859
+ ...val
5860
+ };
5861
+ delete viewProps[key], viewProps[key] = next;
5862
+ } else viewProps[key] = val;
5863
+ }
5864
+ function mergeMediaByImportance(styleState, mediaKey, key, value, importancesUsed, isSizeMedia, importanceBump, debugProp) {
5865
+ var importance = (0, import_useMedia.getMediaImportanceIfMoreImportant)(mediaKey, key, importancesUsed, isSizeMedia);
5866
+ if (importanceBump && (importance = (importance || 0) + importanceBump), process.env.NODE_ENV === "development" && debugProp === "verbose" && (0, import_log.log)(`mergeMediaByImportance ${key} importance existing ${importancesUsed[key]} next ${importance}`), importance === null) return !1;
5867
+ if (importancesUsed[key] = importance, key in import_pseudoDescriptors.pseudoDescriptors) {
5868
+ var descriptor = import_pseudoDescriptors.pseudoDescriptors[key], descriptorKey = descriptor.stateKey || descriptor.name, isDisabled = styleState.componentState[descriptorKey] === !1;
5869
+ if (isDisabled) return !1;
5870
+ for (var subKey in value) mergeStyle(styleState, subKey, value[subKey]);
5871
+ } else mergeStyle(styleState, key, value);
5872
+ return !0;
5873
+ }
5874
+ function normalizeStyle(style) {
5875
+ var out = {};
5876
+ for (var key in style) {
5877
+ var val = style[key];
5878
+ key in import_helpers2.stylePropsTransform ? mergeTransform(out, key, val) : out[key] = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(val, key);
5879
+ }
5880
+ return import_constants2.isWeb && Array.isArray(out.transform) && (out.transform = (0, import_transformsToString.transformsToString)(out.transform)), (0, import_expandStyles.fixStyles)(out), out;
5881
+ }
5882
+ function applyDefaultStyle(pkey, styleState) {
5883
+ var defaultValues = animatableDefaults[pkey];
5884
+ defaultValues != null && !(pkey in styleState.usedKeys) && (!styleState.style || !(pkey in styleState.style)) && mergeStyle(styleState, pkey, defaultValues);
5885
+ }
5886
+ }
5887
+ });
5888
+
5889
+ // ../web/dist/cjs/helpers/mergeProps.native.js
5890
+ var require_mergeProps_native = __commonJS({
5891
+ "../web/dist/cjs/helpers/mergeProps.native.js"(exports2, module2) {
5892
+ "use strict";
5893
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
5894
+ for (var name in all) __defProp2(target, name, {
5895
+ get: all[name],
5896
+ enumerable: !0
5897
+ });
5898
+ }, __copyProps2 = function(to, from, except, desc) {
5899
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
5900
+ if (from && typeof from == "object" || typeof from == "function") try {
5901
+ for (var _loop = function() {
5902
+ var key = _step.value;
5903
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
5904
+ get: function() {
5905
+ return from[key];
5906
+ },
5907
+ enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
5908
+ });
5909
+ }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
5910
+ } catch (err) {
5911
+ _didIteratorError = !0, _iteratorError = err;
5912
+ } finally {
5913
+ try {
5914
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
5915
+ } finally {
5916
+ if (_didIteratorError)
5917
+ throw _iteratorError;
5918
+ }
6461
5919
  }
6462
- process.env.NODE_ENV === "development" && debug === "profile" && time`style-state`, process.env.NODE_ENV === "development" && debug && debug !== "profile" && import_constants2.isClient && (consoleGroupCollapsed("getSplitStyles (collapsed)"), (0, import_log.log)({
6463
- props,
6464
- staticConfig,
6465
- shouldDoClasses,
6466
- styleProps,
6467
- rulesToInsert,
6468
- componentState,
6469
- styleState,
6470
- theme: {
6471
- ...theme
5920
+ return to;
5921
+ }, __toCommonJS2 = function(mod) {
5922
+ return __copyProps2(__defProp2({}, "__esModule", {
5923
+ value: !0
5924
+ }), mod);
5925
+ }, mergeProps_exports = {};
5926
+ __export2(mergeProps_exports, {
5927
+ mergeProps: function() {
5928
+ return mergeProps;
5929
+ }
5930
+ });
5931
+ module2.exports = __toCommonJS2(mergeProps_exports);
5932
+ var import_useMedia = require_useMedia_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), mergeProps = function(a, b, inverseShorthands) {
5933
+ var out = {};
5934
+ for (var key in a) mergeProp(out, a, b, key, inverseShorthands);
5935
+ if (b) for (var key1 in b) mergeProp(out, b, void 0, key1, inverseShorthands);
5936
+ return out;
5937
+ };
5938
+ function mergeProp(out, a, b, key, inverseShorthands) {
5939
+ var longhand = (inverseShorthands == null ? void 0 : inverseShorthands[key]) || null, val = a[key];
5940
+ if (key in import_pseudoDescriptors.pseudoDescriptors || import_useMedia.mediaKeys.has(key)) {
5941
+ out[key] = {
5942
+ ...out[key],
5943
+ ...val
5944
+ };
5945
+ return;
5946
+ }
5947
+ b && (key in b || longhand && longhand in b) || (out[longhand || key] = val);
5948
+ }
5949
+ }
5950
+ });
5951
+
5952
+ // ../web/dist/cjs/helpers/setElementProps.native.js
5953
+ var require_setElementProps_native = __commonJS({
5954
+ "../web/dist/cjs/helpers/setElementProps.native.js"(exports2, module2) {
5955
+ "use strict";
5956
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
5957
+ for (var name in all) __defProp2(target, name, {
5958
+ get: all[name],
5959
+ enumerable: !0
5960
+ });
5961
+ }, __copyProps2 = function(to, from, except, desc) {
5962
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
5963
+ if (from && typeof from == "object" || typeof from == "function") try {
5964
+ for (var _loop = function() {
5965
+ var key = _step.value;
5966
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
5967
+ get: function() {
5968
+ return from[key];
5969
+ },
5970
+ enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
5971
+ });
5972
+ }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
5973
+ } catch (err) {
5974
+ _didIteratorError = !0, _iteratorError = err;
5975
+ } finally {
5976
+ try {
5977
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
5978
+ } finally {
5979
+ if (_didIteratorError)
5980
+ throw _iteratorError;
6472
5981
  }
6473
- }), console.groupEnd());
6474
- var { asChild } = props, { accept } = staticConfig, { noSkip, disableExpandShorthands, noExpand } = styleProps, { webContainerType } = conf.settings, parentVariants = parentStaticConfig == null ? void 0 : parentStaticConfig.variants;
6475
- for (var keyOg in props) _loop(keyOg);
6476
- process.env.NODE_ENV === "development" && debug === "profile" && time`split-styles-propsend`;
6477
- var avoidNormalize = styleProps.noNormalize === !1;
6478
- if (!avoidNormalize) {
6479
- if (styleState.style && ((0, import_expandStyles.fixStyles)(styleState.style), !styleProps.noExpand && !styleProps.noMergeStyle && import_constants2.isWeb && !isReactNative && (0, import_getCSSStylesAtomic.styleToCSS)(styleState.style)), styleState.flatTransforms) {
6480
- var _styleState;
6481
- (_styleState = styleState).style || (_styleState.style = {}), Object.entries(styleState.flatTransforms).sort(function(param, param1) {
6482
- var [a] = param, [b] = param1;
6483
- return (0, import_sortString.sortString)(a, b);
6484
- }).forEach(function(param) {
6485
- var [key4, val2] = param;
6486
- mergeTransform(styleState.style, key4, val2, !0);
5982
+ }
5983
+ return to;
5984
+ }, __toCommonJS2 = function(mod) {
5985
+ return __copyProps2(__defProp2({}, "__esModule", {
5986
+ value: !0
5987
+ }), mod);
5988
+ }, setElementProps_native_exports = {};
5989
+ __export2(setElementProps_native_exports, {
5990
+ setElementProps: function() {
5991
+ return setElementProps;
5992
+ }
5993
+ });
5994
+ module2.exports = __toCommonJS2(setElementProps_native_exports);
5995
+ function setElementProps(element) {
5996
+ element && !element.getBoundingClientRect && (element.getBoundingClientRect = function() {
5997
+ if (element.unstable_getBoundingClientRect != null) return element.unstable_getBoundingClientRect();
5998
+ });
5999
+ }
6000
+ }
6001
+ });
6002
+
6003
+ // ../web/dist/cjs/helpers/createShallowSetState.native.js
6004
+ var require_createShallowSetState_native = __commonJS({
6005
+ "../web/dist/cjs/helpers/createShallowSetState.native.js"(exports2, module2) {
6006
+ "use strict";
6007
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
6008
+ for (var name in all) __defProp2(target, name, {
6009
+ get: all[name],
6010
+ enumerable: !0
6011
+ });
6012
+ }, __copyProps2 = function(to, from, except, desc) {
6013
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
6014
+ if (from && typeof from == "object" || typeof from == "function") try {
6015
+ for (var _loop = function() {
6016
+ var key = _step.value;
6017
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
6018
+ get: function() {
6019
+ return from[key];
6020
+ },
6021
+ enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
6022
+ });
6023
+ }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
6024
+ } catch (err) {
6025
+ _didIteratorError = !0, _iteratorError = err;
6026
+ } finally {
6027
+ try {
6028
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
6029
+ } finally {
6030
+ if (_didIteratorError)
6031
+ throw _iteratorError;
6032
+ }
6033
+ }
6034
+ return to;
6035
+ }, __toCommonJS2 = function(mod) {
6036
+ return __copyProps2(__defProp2({}, "__esModule", {
6037
+ value: !0
6038
+ }), mod);
6039
+ }, createShallowSetState_exports = {};
6040
+ __export2(createShallowSetState_exports, {
6041
+ createShallowSetState: function() {
6042
+ return createShallowSetState;
6043
+ },
6044
+ isEqualShallow: function() {
6045
+ return isEqualShallow;
6046
+ },
6047
+ mergeIfNotShallowEqual: function() {
6048
+ return mergeIfNotShallowEqual;
6049
+ }
6050
+ });
6051
+ module2.exports = __toCommonJS2(createShallowSetState_exports);
6052
+ var import_react3 = require("react"), callImmediate = function(cb) {
6053
+ return cb();
6054
+ };
6055
+ function createShallowSetState(setter, isDisabled, transition, debug, callback) {
6056
+ return (0, import_react3.useCallback)(function(next) {
6057
+ var wrap = transition ? import_react3.startTransition : callImmediate;
6058
+ wrap(function() {
6059
+ setter(function(prev) {
6060
+ var out = mergeIfNotShallowEqual(prev, next, isDisabled, debug);
6061
+ return callback == null || callback(out), out;
6062
+ });
6063
+ });
6064
+ }, [
6065
+ setter,
6066
+ isDisabled,
6067
+ transition,
6068
+ debug
6069
+ ]);
6070
+ }
6071
+ function mergeIfNotShallowEqual(prev, next, isDisabled, debug) {
6072
+ if (isDisabled || !prev || !next || isEqualShallow(prev, next)) return prev || next;
6073
+ if (process.env.NODE_ENV === "development" && debug && (console.info("setStateShallow CHANGE", {
6074
+ prev,
6075
+ next
6076
+ }), debug === "break")) debugger;
6077
+ return {
6078
+ ...prev,
6079
+ ...next
6080
+ };
6081
+ }
6082
+ function isEqualShallow(prev, next) {
6083
+ for (var key in next) if (prev[key] !== next[key]) return !1;
6084
+ return !0;
6085
+ }
6086
+ }
6087
+ });
6088
+
6089
+ // ../web/dist/cjs/helpers/subscribeToContextGroup.native.js
6090
+ var require_subscribeToContextGroup_native = __commonJS({
6091
+ "../web/dist/cjs/helpers/subscribeToContextGroup.native.js"(exports2, module2) {
6092
+ "use strict";
6093
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
6094
+ for (var name in all) __defProp2(target, name, {
6095
+ get: all[name],
6096
+ enumerable: !0
6097
+ });
6098
+ }, __copyProps2 = function(to, from, except, desc) {
6099
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
6100
+ if (from && typeof from == "object" || typeof from == "function") try {
6101
+ for (var _loop = function() {
6102
+ var key = _step.value;
6103
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
6104
+ get: function() {
6105
+ return from[key];
6106
+ },
6107
+ enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
6487
6108
  });
6488
- }
6489
- if (parentSplitStyles) {
6490
- if (0) for (var key in parentSplitStyles.classNames) var val;
6491
- if (!shouldDoClasses) for (var key1 in parentSplitStyles.style) {
6492
- var _styleState1;
6493
- key1 in classNames || styleState.style && key1 in styleState.style || ((_styleState1 = styleState).style || (_styleState1.style = {}), styleState.style[key1] = parentSplitStyles.style[key1]);
6494
- }
6109
+ }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
6110
+ } catch (err) {
6111
+ _didIteratorError = !0, _iteratorError = err;
6112
+ } finally {
6113
+ try {
6114
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
6115
+ } finally {
6116
+ if (_didIteratorError)
6117
+ throw _iteratorError;
6495
6118
  }
6496
6119
  }
6497
- if (0) var _styleState_style, shouldStringifyTransforms;
6498
- if (0) {
6499
- if (!styleProps.noMergeStyle && styleState.style && shouldDoClasses) {
6500
- var retainedStyles, shouldRetain;
6501
- if (!styleState.style.$$css) {
6502
- var atomic, _iteratorNormalCompletion, _didIteratorError, _iteratorError;
6503
- try {
6504
- for (var _iterator, _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) var atomicStyle, _props_animateOnly, _props_animateOnly1, key2, value, identifier, isAnimatedAndAnimateOnly, nonAnimatedAnimateOnly;
6505
- } catch (err) {
6506
- } finally {
6507
- }
6120
+ return to;
6121
+ }, __toCommonJS2 = function(mod) {
6122
+ return __copyProps2(__defProp2({}, "__esModule", {
6123
+ value: !0
6124
+ }), mod);
6125
+ }, subscribeToContextGroup_exports = {};
6126
+ __export2(subscribeToContextGroup_exports, {
6127
+ subscribeToContextGroup: function() {
6128
+ return subscribeToContextGroup;
6129
+ }
6130
+ });
6131
+ module2.exports = __toCommonJS2(subscribeToContextGroup_exports);
6132
+ var import_createShallowSetState = require_createShallowSetState_native(), import_useMedia = require_useMedia_native(), subscribeToContextGroup = function(param) {
6133
+ var { disabled = !1, setStateShallow, pseudoGroups, mediaGroups, componentContext, state } = param;
6134
+ if (pseudoGroups || mediaGroups) {
6135
+ var _componentContext_groups_subscribe, _componentContext_groups, current = {
6136
+ pseudo: {},
6137
+ media: {}
6138
+ };
6139
+ return process.env.NODE_ENV === "development" && !componentContext.groups && console.debug("No context group found"), (_componentContext_groups = componentContext.groups) === null || _componentContext_groups === void 0 || (_componentContext_groups_subscribe = _componentContext_groups.subscribe) === null || _componentContext_groups_subscribe === void 0 ? void 0 : _componentContext_groups_subscribe.call(_componentContext_groups, function(name, param2) {
6140
+ var { layout, pseudo } = param2;
6141
+ if (pseudo && pseudoGroups != null && pseudoGroups.has(String(name))) Object.assign(current.pseudo, pseudo), persist();
6142
+ else if (layout && mediaGroups) {
6143
+ var mediaState2 = (0, import_useMedia.getMediaState)(mediaGroups, layout), next = (0, import_createShallowSetState.mergeIfNotShallowEqual)(current.media, mediaState2);
6144
+ next !== current.media && (Object.assign(current.media, next), persist());
6508
6145
  }
6509
- if (transforms) for (var namespace in transforms) {
6510
- var hash, val1, identifier1;
6511
- if (import_constants2.isClient && !insertedTransforms[identifier1]) var rule;
6146
+ function persist() {
6147
+ var group = {
6148
+ ...state.group,
6149
+ [name]: current
6150
+ };
6151
+ setStateShallow({
6152
+ group
6153
+ });
6512
6154
  }
6513
- }
6514
- if (isReactNative) {
6515
- if (viewProps.tabIndex === 0) var _viewProps, _accessible;
6516
- } else if (viewProps.tabIndex == null) var _viewProps_focusable, isFocusable, role;
6155
+ });
6517
6156
  }
6518
- var styleProp = props.style;
6519
- if (!styleProps.noMergeStyle && styleProp) if (isHOC) viewProps.style = normalizeStyle(styleProp);
6520
- else for (var isArray = Array.isArray(styleProp), len = isArray ? styleProp.length : 1, i = 0; i < len; i++) {
6521
- var style = isArray ? styleProp[i] : styleProp;
6522
- if (style) if (style.$$css) Object.assign(styleState.classNames, style);
6523
- else {
6524
- var _styleState2;
6525
- (_styleState2 = styleState).style || (_styleState2.style = {}), Object.assign(styleState.style, normalizeStyle(style));
6157
+ };
6158
+ }
6159
+ });
6160
+
6161
+ // ../web/dist/cjs/hooks/useThemeState.native.js
6162
+ var require_useThemeState_native = __commonJS({
6163
+ "../web/dist/cjs/hooks/useThemeState.native.js"(exports2, module2) {
6164
+ "use strict";
6165
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
6166
+ for (var name in all) __defProp2(target, name, {
6167
+ get: all[name],
6168
+ enumerable: !0
6169
+ });
6170
+ }, __copyProps2 = function(to, from, except, desc) {
6171
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
6172
+ if (from && typeof from == "object" || typeof from == "function") try {
6173
+ for (var _loop = function() {
6174
+ var key = _step.value;
6175
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
6176
+ get: function() {
6177
+ return from[key];
6178
+ },
6179
+ enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
6180
+ });
6181
+ }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
6182
+ } catch (err) {
6183
+ _didIteratorError = !0, _iteratorError = err;
6184
+ } finally {
6185
+ try {
6186
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
6187
+ } finally {
6188
+ if (_didIteratorError)
6189
+ throw _iteratorError;
6526
6190
  }
6527
6191
  }
6528
- var style1 = styleState.style;
6529
- if (style1 != null && style1.fontFamily) {
6530
- var _getFont, faceInfo = (_getFont = (0, import_config.getFont)(style1.fontFamily)) === null || _getFont === void 0 ? void 0 : _getFont.face;
6531
- if (faceInfo) {
6532
- var _faceInfo_style_fontWeight_, _faceInfo_style_fontWeight, overrideFace = (_faceInfo_style_fontWeight = faceInfo[style1.fontWeight]) === null || _faceInfo_style_fontWeight === void 0 || (_faceInfo_style_fontWeight_ = _faceInfo_style_fontWeight[style1.fontStyle || "normal"]) === null || _faceInfo_style_fontWeight_ === void 0 ? void 0 : _faceInfo_style_fontWeight_.val;
6533
- overrideFace && (style1.fontFamily = overrideFace, styleState.fontFamily = overrideFace, delete style1.fontWeight, delete style1.fontStyle);
6534
- }
6535
- process.env.NODE_ENV === "development" && debug && debug !== "profile" && (0, import_log.log)(`Found fontFamily native: ${style1.fontFamily}`, faceInfo);
6192
+ return to;
6193
+ }, __toCommonJS2 = function(mod) {
6194
+ return __copyProps2(__defProp2({}, "__esModule", {
6195
+ value: !0
6196
+ }), mod);
6197
+ }, useThemeState_exports = {};
6198
+ __export2(useThemeState_exports, {
6199
+ ThemeStateContext: function() {
6200
+ return ThemeStateContext;
6201
+ },
6202
+ forceUpdateThemes: function() {
6203
+ return forceUpdateThemes2;
6204
+ },
6205
+ getRootThemeState: function() {
6206
+ return getRootThemeState;
6207
+ },
6208
+ getThemeState: function() {
6209
+ return getThemeState;
6210
+ },
6211
+ hasThemeUpdatingProps: function() {
6212
+ return hasThemeUpdatingProps;
6213
+ },
6214
+ useThemeState: function() {
6215
+ return useThemeState;
6536
6216
  }
6537
- process.env.NODE_ENV === "development" && debug === "profile" && time`split-styles-pre-result`;
6538
- var result = {
6539
- space,
6540
- hasMedia,
6541
- fontFamily: styleState.fontFamily,
6542
- viewProps,
6543
- style: styleState.style,
6544
- pseudos,
6545
- classNames,
6546
- rulesToInsert,
6547
- dynamicThemeAccess,
6548
- pseudoGroups,
6549
- mediaGroups
6550
- }, asChildExceptStyleLike = asChild === "except-style" || asChild === "except-style-web";
6551
- if (!styleProps.noMergeStyle && !asChildExceptStyleLike) {
6552
- var style2 = styleState.style;
6553
- if (0) {
6554
- var _staticConfig_defaultProps, fontFamily, fontFamilyClassName, groupClassName, componentNameFinal, componentClassName, classList, finalClassName;
6555
- if (!(styleProps.isAnimated && !conf.animations.supportsCSSVars && isReactNative) && isReactNative) {
6556
- var cnStyles, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1;
6557
- try {
6558
- for (var _iterator1, _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0) var name;
6559
- } catch (err) {
6560
- } finally {
6561
- }
6217
+ });
6218
+ module2.exports = __toCommonJS2(useThemeState_exports);
6219
+ var import_react3 = require("react"), import_config = require_config_native(), ThemeStateContext = (0, import_react3.createContext)(""), allListeners = /* @__PURE__ */ new Map(), listenersByParent = {}, states = /* @__PURE__ */ new Map(), forceUpdateThemes2 = function() {
6220
+ allListeners.forEach(function(cb) {
6221
+ return cb();
6222
+ });
6223
+ }, getThemeState = function(id) {
6224
+ return states.get(id);
6225
+ }, rootThemeState = null, getRootThemeState = function() {
6226
+ return rootThemeState;
6227
+ }, HasRenderedOnce = /* @__PURE__ */ new WeakMap(), useThemeState = function(props) {
6228
+ var isRoot = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, keys = arguments.length > 2 ? arguments[2] : void 0, { disable } = props, parentId = (0, import_react3.useContext)(ThemeStateContext);
6229
+ if (disable) return states.get(parentId) || {
6230
+ id: "",
6231
+ name: "light",
6232
+ theme: (0, import_config.getConfig)().themes.light,
6233
+ inverses: 0
6234
+ };
6235
+ var id = (0, import_react3.useId)(), subscribe = (0, import_react3.useCallback)(function(cb) {
6236
+ var _listenersByParent, _parentId;
6237
+ return (_listenersByParent = listenersByParent)[_parentId = parentId] || (_listenersByParent[_parentId] = /* @__PURE__ */ new Set()), listenersByParent[parentId].add(id), allListeners.set(id, cb), function() {
6238
+ allListeners.delete(id), listenersByParent[parentId].delete(id);
6239
+ };
6240
+ }, [
6241
+ id,
6242
+ parentId,
6243
+ keys
6244
+ ]), propsKey = getPropsKey(props), getSnapshot = function() {
6245
+ return getSnapshotFrom(props, propsKey, isRoot, id, parentId, keys);
6246
+ };
6247
+ process.env.NODE_ENV === "development" && globalThis.time && globalThis.time`theme-prep-uses`;
6248
+ var state = (0, import_react3.useSyncExternalStore)(subscribe, getSnapshot, getSnapshot);
6249
+ return (0, import_react3.useLayoutEffect)(function() {
6250
+ if (propsKey) {
6251
+ if (!HasRenderedOnce.has(keys)) {
6252
+ HasRenderedOnce.set(keys, !0);
6253
+ return;
6562
6254
  }
6563
- } else style2 && (viewProps.style = style2);
6564
- }
6565
- if (process.env.NODE_ENV === "development" && debug === "verbose" && import_isDevTools.isDevTools) {
6566
- consoleGroupCollapsed("\u{1F539} getSplitStyles ===>");
6567
- try {
6568
- var logs = {
6569
- ...result,
6570
- className,
6571
- componentState,
6572
- transforms,
6573
- viewProps,
6574
- rulesToInsert,
6575
- parentSplitStyles
6576
- };
6577
- for (var key3 in logs) (0, import_log.log)(key3, logs[key3]);
6578
- } catch {
6579
- }
6580
- console.groupEnd();
6581
- }
6582
- return process.env.NODE_ENV === "development" && debug === "profile" && time`split-styles-done`, result;
6583
- };
6584
- function mergeClassName(transforms, classNames, key, val) {
6585
- var isMediaOrPseudo = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !1, isInsertingNow = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : !1;
6586
- if (0) var _transforms, _ns, ns, transform;
6587
- }
6588
- function mergeStyle(styleState, key, val) {
6589
- var disableNormalize = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, { classNames, viewProps, usedKeys, styleProps, staticConfig } = styleState;
6590
- if (import_constants2.isWeb && (val == null ? void 0 : val[0]) === "_") {
6591
- var _usedKeys, _key;
6592
- classNames[key] = val, (_usedKeys = usedKeys)[_key = key] || (_usedKeys[_key] = 1);
6593
- } else if (key in import_helpers2.stylePropsTransform) {
6594
- var _styleState;
6595
- (_styleState = styleState).flatTransforms || (_styleState.flatTransforms = {}), styleState.flatTransforms[key] = val;
6596
- } else {
6597
- var shouldNormalize = import_constants2.isWeb && !disableNormalize && !styleProps.noNormalize, out = shouldNormalize ? (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(val, key) : val;
6598
- if (
6599
- // accept is for props not styles
6600
- staticConfig.accept && key in staticConfig.accept
6601
- ) viewProps[key] = out;
6602
- else {
6603
- var _styleState1;
6604
- (_styleState1 = styleState).style || (_styleState1.style = {}), styleState.style[key] = out;
6255
+ if (process.env.NODE_ENV === "development" && props.debug && props.debug !== "profile") {
6256
+ var _states_get;
6257
+ console.warn(` \xB7 useTheme(${id}) scheduleUpdate`, propsKey, (_states_get = states.get(id)) === null || _states_get === void 0 ? void 0 : _states_get.name);
6258
+ }
6259
+ scheduleUpdate(id);
6605
6260
  }
6606
- }
6607
- }
6608
- var getSubStyle = function(styleState, subKey, styleIn, avoidMergeTransform) {
6609
- var _loop = function(key1) {
6610
- var val = styleIn[key1];
6611
- key1 = conf2.shorthands[key1] || key1;
6612
- var shouldSkip = !staticConfig.isHOC && key1 in import_skipProps.skipProps && !styleProps.noSkip;
6613
- if (shouldSkip) return key = key1, "continue";
6614
- (0, import_propMapper.propMapper)(key1, val, styleState, !1, function(skey, sval) {
6615
- skey in import_helpers2.validPseudoKeys && (sval = getSubStyle(styleState, skey, sval, avoidMergeTransform)), !avoidMergeTransform && skey in import_helpers2.stylePropsTransform ? mergeTransform(styleOut, skey, sval) : styleOut[skey] = styleProps.noNormalize ? sval : (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(sval, key1);
6616
- }), key = key1;
6617
- }, { staticConfig, conf: conf2, styleProps } = styleState, styleOut = {};
6618
- for (var key in styleIn) _loop(key);
6619
- return styleProps.noNormalize || (0, import_expandStyles.fixStyles)(styleOut), styleOut;
6620
- }, useInsertEffectCompat = import_constants2.isWeb ? import_react3.default.useInsertionEffect || import_constants2.useIsomorphicLayoutEffect : function() {
6621
- }, useSplitStyles = function(a, b, c, d, e, f, g, h, i, j) {
6622
- conf = conf || (0, import_config.getConfig)();
6623
- var res = getSplitStyles(a, b, c, d, e, f, g, h, i, j);
6624
- return res;
6625
- };
6626
- function addStyleToInsertRules(rulesToInsert, styleObject) {
6627
- if (0) var identifier;
6628
- }
6629
- var defaultColor = process.env.TAMAGUI_DEFAULT_COLOR || "rgba(0,0,0,0)", animatableDefaults = {
6630
- ...Object.fromEntries(Object.entries(import_helpers2.tokenCategories.color).map(function(param) {
6631
- var [k, v] = param;
6632
- return [
6633
- k,
6634
- defaultColor
6635
- ];
6636
- })),
6637
- opacity: 1,
6638
- scale: 1,
6639
- rotate: "0deg",
6640
- rotateY: "0deg",
6641
- rotateX: "0deg",
6642
- x: 0,
6643
- y: 0,
6644
- borderRadius: 0
6645
- }, lowercaseHyphenate = function(match) {
6646
- return `-${match.toLowerCase()}`;
6647
- }, hyphenate = function(str) {
6648
- return str.replace(/[A-Z]/g, lowercaseHyphenate);
6649
- }, mergeTransform = function(obj, key, val) {
6650
- var backwards = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, _obj;
6651
- typeof obj.transform != "string" && ((_obj = obj).transform || (_obj.transform = []), obj.transform[backwards ? "unshift" : "push"]({
6652
- [mapTransformKeys[key] || key]: val
6653
- }));
6654
- }, mapTransformKeys = {
6655
- x: "translateX",
6656
- y: "translateY"
6261
+ }, [
6262
+ keys,
6263
+ propsKey
6264
+ ]), process.env.NODE_ENV === "development" && props.debug && (console.groupCollapsed(` \xB7 useTheme(${id}) =>`, state.name, id === state.id ? "\u{1F389}" : "\u23ED\uFE0F"), console.info({
6265
+ state,
6266
+ parentId,
6267
+ props,
6268
+ propsKey,
6269
+ id,
6270
+ parentState: states.get(parentId)
6271
+ }), console.groupEnd()), state.id === id ? {
6272
+ ...state,
6273
+ isNew: !0
6274
+ } : state;
6275
+ }, themes = null, getSnapshotFrom = function(props, propsKey) {
6276
+ var isRoot = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, id = arguments.length > 3 ? arguments[3] : void 0, parentId = arguments.length > 4 ? arguments[4] : void 0, keys = arguments.length > 5 ? arguments[5] : void 0, _keys_current, _props_needsUpdate, needsUpdate = (keys == null || (_keys_current = keys.current) === null || _keys_current === void 0 ? void 0 : _keys_current.size) || ((_props_needsUpdate = props.needsUpdate) === null || _props_needsUpdate === void 0 ? void 0 : _props_needsUpdate.call(props)), parentState = states.get(parentId);
6277
+ themes || (themes = (0, import_config.getConfig)().themes);
6278
+ var lastState = states.get(id), name = propsKey ? getNewThemeName(parentState == null ? void 0 : parentState.name, props, !!needsUpdate) : null;
6279
+ if (process.env.NODE_ENV === "development" && props.debug && props.debug !== "profile") {
6280
+ var message = ` \xB7 useTheme(${id}) snapshot ${name}, parent ${parentState == null ? void 0 : parentState.id} needsUpdate ${needsUpdate}`;
6281
+ console.info(message);
6282
+ }
6283
+ var isSameAsParent = !name && propsKey;
6284
+ if (parentState && isSameAsParent) return parentState;
6285
+ if (!name) return lastState && !needsUpdate ? lastState : (states.set(id, parentState), parentState);
6286
+ if (lastState && lastState.name === name) return lastState;
6287
+ var scheme = getScheme(name), _parentState_inverses, parentInverses = (_parentState_inverses = parentState == null ? void 0 : parentState.inverses) !== null && _parentState_inverses !== void 0 ? _parentState_inverses : 0, isInverse = parentState && scheme !== parentState.scheme, inverses = parentInverses + (isInverse ? 1 : 0), nextState = {
6288
+ id,
6289
+ name,
6290
+ theme: themes[name],
6291
+ scheme,
6292
+ parentId,
6293
+ parentName: parentState == null ? void 0 : parentState.name,
6294
+ inverses,
6295
+ isInverse
6296
+ };
6297
+ return process.env.NODE_ENV === "development" && props.debug && props.debug !== "profile" && (console.groupCollapsed(` \xB7 useTheme(${id}) \u23ED\uFE0F ${name}`), console.info("state", nextState), console.groupEnd()), states.set(id, nextState), isRoot && (rootThemeState = nextState), nextState;
6657
6298
  };
6658
- function passDownProp(viewProps, key, val) {
6659
- var shouldMergeObject = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1;
6660
- if (shouldMergeObject) {
6661
- var next = {
6662
- ...viewProps[key],
6663
- ...val
6664
- };
6665
- delete viewProps[key], viewProps[key] = next;
6666
- } else viewProps[key] = val;
6667
- }
6668
- function mergeMediaByImportance(styleState, mediaKey, key, value, importancesUsed, isSizeMedia, importanceBump, debugProp) {
6669
- var importance = (0, import_useMedia.getMediaImportanceIfMoreImportant)(mediaKey, key, importancesUsed, isSizeMedia);
6670
- if (importanceBump && (importance = (importance || 0) + importanceBump), process.env.NODE_ENV === "development" && debugProp === "verbose" && (0, import_log.log)(`mergeMediaByImportance ${key} importance existing ${importancesUsed[key]} next ${importance}`), importance === null) return !1;
6671
- if (importancesUsed[key] = importance, key in import_pseudoDescriptors.pseudoDescriptors) {
6672
- var descriptor = import_pseudoDescriptors.pseudoDescriptors[key], descriptorKey = descriptor.stateKey || descriptor.name, isDisabled = styleState.componentState[descriptorKey] === !1;
6673
- if (isDisabled) return !1;
6674
- for (var subKey in value) mergeStyle(styleState, subKey, value[subKey]);
6675
- } else mergeStyle(styleState, key, value);
6676
- return !0;
6677
- }
6678
- function normalizeStyle(style) {
6679
- var out = {};
6680
- for (var key in style) {
6681
- var val = style[key];
6682
- key in import_helpers2.stylePropsTransform ? mergeTransform(out, key, val) : out[key] = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(val, key);
6299
+ function scheduleUpdate(id) {
6300
+ for (var queue = [
6301
+ id
6302
+ ], visited = /* @__PURE__ */ new Set(); queue.length; ) {
6303
+ var parent = queue.shift(), children = listenersByParent[parent];
6304
+ if (children) {
6305
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
6306
+ try {
6307
+ for (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
6308
+ var childId = _step.value;
6309
+ visited.has(childId) || (visited.add(childId), queue.push(childId));
6310
+ }
6311
+ } catch (err) {
6312
+ _didIteratorError = !0, _iteratorError = err;
6313
+ } finally {
6314
+ try {
6315
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
6316
+ } finally {
6317
+ if (_didIteratorError) throw _iteratorError;
6318
+ }
6319
+ }
6320
+ }
6683
6321
  }
6684
- return import_constants2.isWeb && Array.isArray(out.transform) && (out.transform = (0, import_transformsToString.transformsToString)(out.transform)), (0, import_expandStyles.fixStyles)(out), out;
6322
+ visited.forEach(function(childId2) {
6323
+ var cb = allListeners.get(childId2);
6324
+ cb == null || cb();
6325
+ });
6685
6326
  }
6686
- function applyDefaultStyle(pkey, styleState) {
6687
- var defaultValues = animatableDefaults[pkey];
6688
- defaultValues != null && !(pkey in styleState.usedKeys) && (!styleState.style || !(pkey in styleState.style)) && mergeStyle(styleState, pkey, defaultValues);
6327
+ var validSchemes = {
6328
+ light: "light",
6329
+ dark: "dark"
6330
+ };
6331
+ function getScheme(name) {
6332
+ return validSchemes[name.split("_")[0]];
6333
+ }
6334
+ function getNewThemeName() {
6335
+ var parentName = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", { name, reset, componentName, inverse } = arguments.length > 1 ? arguments[1] : void 0, forceUpdate = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
6336
+ if (name && reset) throw new Error(process.env.NODE_ENV === "production" ? "\u274C004" : "Cannot reset and set a new name at the same time.");
6337
+ if (reset) {
6338
+ if (!parentName) throw new Error("\u203C\uFE0F");
6339
+ var lastPartIndex = parentName.lastIndexOf("_");
6340
+ return lastPartIndex <= 0 ? parentName : parentName.slice(lastPartIndex);
6341
+ }
6342
+ var { themes: themes2 } = (0, import_config.getConfig)(), parentParts = parentName.split("_"), lastName = parentParts[parentParts.length - 1];
6343
+ lastName && lastName[0].toLowerCase() !== lastName[0] && parentParts.pop();
6344
+ for (var subNames = [
6345
+ name && componentName ? `${name}_${componentName}` : void 0,
6346
+ name,
6347
+ componentName
6348
+ ].filter(Boolean), found = null, max = parentParts.length, i = 0; i <= max; i++) {
6349
+ var base = (i === 0 ? parentParts : parentParts.slice(0, -i)).join("_"), _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
6350
+ try {
6351
+ for (var _iterator = subNames[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
6352
+ var subName = _step.value, potential = base ? `${base}_${subName}` : subName;
6353
+ if (potential in themes2) {
6354
+ found = potential;
6355
+ break;
6356
+ }
6357
+ }
6358
+ } catch (err) {
6359
+ _didIteratorError = !0, _iteratorError = err;
6360
+ } finally {
6361
+ try {
6362
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
6363
+ } finally {
6364
+ if (_didIteratorError) throw _iteratorError;
6365
+ }
6366
+ }
6367
+ if (found) break;
6368
+ }
6369
+ if (found && inverse) {
6370
+ var scheme = found.split("_")[0];
6371
+ found = found.replace(new RegExp(`^${scheme}`), scheme === "light" ? "dark" : "light");
6372
+ }
6373
+ return !forceUpdate && found === parentName && // if its a scheme only sub-theme, we always consider it "new" because it likely inverses
6374
+ // and we want to avoid reparenting
6375
+ !validSchemes[found] ? null : found;
6689
6376
  }
6377
+ var getPropsKey = function(param) {
6378
+ var { name, reset, inverse, forceClassName, componentName } = param;
6379
+ return `${name || ""}${inverse || ""}${reset || ""}${forceClassName || ""}${componentName || ""}`;
6380
+ }, hasThemeUpdatingProps = function(props) {
6381
+ return "inverse" in props || "name" in props || "reset" in props || "forceClassName" in props;
6382
+ };
6690
6383
  }
6691
6384
  });
6692
6385
 
6693
- // ../web/dist/cjs/helpers/mergeProps.native.js
6694
- var require_mergeProps_native = __commonJS({
6695
- "../web/dist/cjs/helpers/mergeProps.native.js"(exports2, module2) {
6386
+ // ../web/dist/cjs/hooks/doesRootSchemeMatchSystem.native.js
6387
+ var require_doesRootSchemeMatchSystem_native = __commonJS({
6388
+ "../web/dist/cjs/hooks/doesRootSchemeMatchSystem.native.js"(exports2, module2) {
6696
6389
  "use strict";
6697
6390
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
6698
6391
  for (var name in all) __defProp2(target, name, {
@@ -6726,36 +6419,24 @@ var require_mergeProps_native = __commonJS({
6726
6419
  return __copyProps2(__defProp2({}, "__esModule", {
6727
6420
  value: !0
6728
6421
  }), mod);
6729
- }, mergeProps_exports = {};
6730
- __export2(mergeProps_exports, {
6731
- mergeProps: function() {
6732
- return mergeProps;
6422
+ }, doesRootSchemeMatchSystem_native_exports = {};
6423
+ __export2(doesRootSchemeMatchSystem_native_exports, {
6424
+ doesRootSchemeMatchSystem: function() {
6425
+ return doesRootSchemeMatchSystem;
6733
6426
  }
6734
6427
  });
6735
- module2.exports = __toCommonJS2(mergeProps_exports);
6736
- var import_useMedia = require_useMedia_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), mergeProps = function(a, b, inverseShorthands) {
6737
- var out = {};
6738
- for (var key in a) mergeProp(out, a, b, key, inverseShorthands);
6739
- if (b) for (var key1 in b) mergeProp(out, b, void 0, key1, inverseShorthands);
6740
- return out;
6741
- };
6742
- function mergeProp(out, a, b, key, inverseShorthands) {
6743
- var longhand = (inverseShorthands == null ? void 0 : inverseShorthands[key]) || null, val = a[key];
6744
- if (key in import_pseudoDescriptors.pseudoDescriptors || import_useMedia.mediaKeys.has(key)) {
6745
- out[key] = {
6746
- ...out[key],
6747
- ...val
6748
- };
6749
- return;
6750
- }
6751
- b && (key in b || longhand && longhand in b) || (out[longhand || key] = val);
6428
+ module2.exports = __toCommonJS2(doesRootSchemeMatchSystem_native_exports);
6429
+ var import_react_native = require("react-native"), import_useThemeState = require_useThemeState_native();
6430
+ function doesRootSchemeMatchSystem() {
6431
+ var _getRootThemeState;
6432
+ return ((_getRootThemeState = (0, import_useThemeState.getRootThemeState)()) === null || _getRootThemeState === void 0 ? void 0 : _getRootThemeState.scheme) === import_react_native.Appearance.getColorScheme();
6752
6433
  }
6753
6434
  }
6754
6435
  });
6755
6436
 
6756
- // ../web/dist/cjs/helpers/setElementProps.native.js
6757
- var require_setElementProps_native = __commonJS({
6758
- "../web/dist/cjs/helpers/setElementProps.native.js"(exports2, module2) {
6437
+ // ../web/dist/cjs/hooks/getThemeProxied.native.js
6438
+ var require_getThemeProxied_native = __commonJS({
6439
+ "../web/dist/cjs/hooks/getThemeProxied.native.js"(exports2, module2) {
6759
6440
  "use strict";
6760
6441
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
6761
6442
  for (var name in all) __defProp2(target, name, {
@@ -6789,24 +6470,69 @@ var require_setElementProps_native = __commonJS({
6789
6470
  return __copyProps2(__defProp2({}, "__esModule", {
6790
6471
  value: !0
6791
6472
  }), mod);
6792
- }, setElementProps_native_exports = {};
6793
- __export2(setElementProps_native_exports, {
6794
- setElementProps: function() {
6795
- return setElementProps;
6473
+ }, getThemeProxied_exports = {};
6474
+ __export2(getThemeProxied_exports, {
6475
+ getThemeProxied: function() {
6476
+ return getThemeProxied;
6796
6477
  }
6797
6478
  });
6798
- module2.exports = __toCommonJS2(setElementProps_native_exports);
6799
- function setElementProps(element) {
6800
- element && !element.getBoundingClientRect && (element.getBoundingClientRect = function() {
6801
- if (element.unstable_getBoundingClientRect != null) return element.unstable_getBoundingClientRect();
6802
- });
6479
+ module2.exports = __toCommonJS2(getThemeProxied_exports);
6480
+ var import_constants2 = require_index_native2(), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_doesRootSchemeMatchSystem = require_doesRootSchemeMatchSystem_native(), cache2 = /* @__PURE__ */ new Map(), curKeys, curProps, emptyObject = {};
6481
+ function getThemeProxied(_props, state, _keys) {
6482
+ var theme = state == null ? void 0 : state.theme;
6483
+ if (!theme) return emptyObject;
6484
+ if (curKeys = _keys, curProps = _props, cache2.has(theme)) {
6485
+ var proxied = cache2.get(theme);
6486
+ return proxied;
6487
+ }
6488
+ var { name, scheme } = state, config = (0, import_config.getConfig)();
6489
+ function track(key) {
6490
+ curKeys && (curKeys.current || (curKeys.current = /* @__PURE__ */ new Set()), curKeys.current.add(key), process.env.NODE_ENV === "development" && curProps.debug && console.info(` \u{1F3A8} useTheme() tracking new key: ${key}`));
6491
+ }
6492
+ var proxied1 = Object.fromEntries(Object.entries(theme).flatMap(function(param) {
6493
+ var [key, value] = param, proxied2 = {
6494
+ ...value,
6495
+ get val() {
6496
+ return globalThis.tamaguiAvoidTracking || track(key), value.val;
6497
+ },
6498
+ get(platform) {
6499
+ var outVal = (0, import_createVariable.getVariable)(value), shouldOptimize = scheme && platform !== "web" && import_constants2.isIos && !curProps.deopt && (0, import_config.getSetting)("fastSchemeChange") && state.inverses === 0 && (0, import_doesRootSchemeMatchSystem.doesRootSchemeMatchSystem)();
6500
+ if (shouldOptimize) {
6501
+ var _config_themes_name, _config_themes_oppositeName, oppositeScheme = scheme === "dark" ? "light" : "dark", oppositeName = name.replace(scheme, oppositeScheme), color = (0, import_createVariable.getVariable)((_config_themes_name = config.themes[name]) === null || _config_themes_name === void 0 ? void 0 : _config_themes_name[key]), oppositeColor = (0, import_createVariable.getVariable)((_config_themes_oppositeName = config.themes[oppositeName]) === null || _config_themes_oppositeName === void 0 ? void 0 : _config_themes_oppositeName[key]), dynamicVal = {
6502
+ dynamic: {
6503
+ [scheme]: color,
6504
+ [oppositeScheme]: oppositeColor
6505
+ }
6506
+ };
6507
+ return dynamicVal;
6508
+ }
6509
+ return process.env.NODE_ENV === "development" && curProps.debug && console.info(` \u{1F3A8} useTheme() tracking new key because of:
6510
+ not web: ${platform !== "web"}
6511
+ isIOS: ${import_constants2.isIos}
6512
+ deopt: ${curProps.deopt}
6513
+ fastScheme: ${(0, import_config.getSetting)("fastSchemeChange")}
6514
+ `), track(key), outVal;
6515
+ }
6516
+ };
6517
+ return [
6518
+ [
6519
+ key,
6520
+ proxied2
6521
+ ],
6522
+ [
6523
+ `$${key}`,
6524
+ proxied2
6525
+ ]
6526
+ ];
6527
+ }));
6528
+ return cache2.set(theme, proxied1), proxied1;
6803
6529
  }
6804
6530
  }
6805
6531
  });
6806
6532
 
6807
- // ../web/dist/cjs/helpers/subscribeToContextGroup.native.js
6808
- var require_subscribeToContextGroup_native = __commonJS({
6809
- "../web/dist/cjs/helpers/subscribeToContextGroup.native.js"(exports2, module2) {
6533
+ // ../web/dist/cjs/hooks/useTheme.native.js
6534
+ var require_useTheme_native = __commonJS({
6535
+ "../web/dist/cjs/hooks/useTheme.native.js"(exports2, module2) {
6810
6536
  "use strict";
6811
6537
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
6812
6538
  for (var name in all) __defProp2(target, name, {
@@ -6840,38 +6566,29 @@ var require_subscribeToContextGroup_native = __commonJS({
6840
6566
  return __copyProps2(__defProp2({}, "__esModule", {
6841
6567
  value: !0
6842
6568
  }), mod);
6843
- }, subscribeToContextGroup_exports = {};
6844
- __export2(subscribeToContextGroup_exports, {
6845
- subscribeToContextGroup: function() {
6846
- return subscribeToContextGroup;
6569
+ }, useTheme_exports = {};
6570
+ __export2(useTheme_exports, {
6571
+ useTheme: function() {
6572
+ return useTheme;
6573
+ },
6574
+ useThemeWithState: function() {
6575
+ return useThemeWithState;
6847
6576
  }
6848
6577
  });
6849
- module2.exports = __toCommonJS2(subscribeToContextGroup_exports);
6850
- var import_createShallowSetState = require_createShallowSetState_native(), import_useMedia = require_useMedia_native(), subscribeToContextGroup = function(param) {
6851
- var { disabled = !1, setStateShallow, pseudoGroups, mediaGroups, componentContext, state } = param;
6852
- if (pseudoGroups || mediaGroups) {
6853
- var _componentContext_groups_subscribe, _componentContext_groups, current = {
6854
- pseudo: {},
6855
- media: {}
6856
- };
6857
- return process.env.NODE_ENV === "development" && !componentContext.groups && console.debug("No context group found"), (_componentContext_groups = componentContext.groups) === null || _componentContext_groups === void 0 || (_componentContext_groups_subscribe = _componentContext_groups.subscribe) === null || _componentContext_groups_subscribe === void 0 ? void 0 : _componentContext_groups_subscribe.call(_componentContext_groups, function(name, param2) {
6858
- var { layout, pseudo } = param2;
6859
- if (pseudo && pseudoGroups != null && pseudoGroups.has(String(name))) Object.assign(current.pseudo, pseudo), persist();
6860
- else if (layout && mediaGroups) {
6861
- var mediaState2 = (0, import_useMedia.getMediaState)(mediaGroups, layout), next = (0, import_createShallowSetState.mergeIfNotShallowEqual)(current.media, mediaState2);
6862
- next !== current.media && (Object.assign(current.media, next), persist());
6863
- }
6864
- function persist() {
6865
- var group = {
6866
- ...state.group,
6867
- [name]: current
6868
- };
6869
- setStateShallow({
6870
- group
6871
- });
6872
- }
6873
- });
6874
- }
6578
+ module2.exports = __toCommonJS2(useTheme_exports);
6579
+ var import_react3 = require("react"), import_getThemeProxied = require_getThemeProxied_native(), import_useThemeState = require_useThemeState_native(), useTheme = function() {
6580
+ var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, [theme] = useThemeWithState(props), res = theme;
6581
+ return res;
6582
+ }, useThemeWithState = function(props) {
6583
+ var isRoot = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, keys = (0, import_react3.useRef)(null), themeState = (0, import_useThemeState.useThemeState)(props, isRoot, keys);
6584
+ process.env.NODE_ENV === "development" && (themeState != null && themeState.theme || process.env.TAMAGUI_DISABLE_NO_THEME_WARNING !== "1" && console.error(`[tamagui] No theme found, this could be due to an invalid theme name (given theme props ${JSON.stringify(props)}).
6585
+
6586
+ If this is intended and you are using Tamagui without any themes, you can disable this warning by setting the environment variable TAMAGUI_DISABLE_NO_THEME_WARNING=1`));
6587
+ var themeProxied = (0, import_getThemeProxied.getThemeProxied)(props, themeState, keys);
6588
+ return [
6589
+ themeProxied,
6590
+ themeState
6591
+ ];
6875
6592
  };
6876
6593
  }
6877
6594
  });
@@ -6985,25 +6702,22 @@ var require_Theme_native = __commonJS({
6985
6702
  }
6986
6703
  });
6987
6704
  module2.exports = __toCommonJS2(Theme_exports);
6988
- var import_jsx_runtime = require("react/jsx-runtime"), import_constants2 = require_index_native2(), import_react3 = __toESM2(require("react")), import_createVariable = require_createVariable_native(), import_log = require_log_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), import_useTheme = require_useTheme_native(), import_ThemeDebug = require_ThemeDebug_native(), Theme = /* @__PURE__ */ (0, import_react3.forwardRef)(function(param, ref) {
6989
- var { children, ...props } = param;
6990
- if (props.disable) return children;
6991
- var isRoot = !!props._isRoot, themeState = (0, import_useTheme.useChangeThemeEffect)(props, isRoot), disableDirectChildTheme = props["disable-child-theme"], finalChildren = disableDirectChildTheme ? import_react3.Children.map(children, function(child) {
6705
+ var import_jsx_runtime = require("react/jsx-runtime"), import_constants2 = require_index_native2(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_useTheme = require_useTheme_native(), import_useThemeState = require_useThemeState_native(), import_ThemeDebug = require_ThemeDebug_native(), empty = {
6706
+ className: "",
6707
+ style: {}
6708
+ }, Theme = /* @__PURE__ */ (0, import_react3.forwardRef)(function(props, ref) {
6709
+ if (props.disable) return props.children;
6710
+ var isRoot = !!props._isRoot, [_, themeState] = (0, import_useTheme.useThemeWithState)(props, isRoot), disableDirectChildTheme = props["disable-child-theme"], finalChildren = disableDirectChildTheme ? import_react3.Children.map(props.children, function(child) {
6992
6711
  return /* @__PURE__ */ (0, import_react3.cloneElement)(child, {
6993
6712
  "data-disable-theme": !0
6994
6713
  });
6995
- }) : children;
6714
+ }) : props.children;
6996
6715
  if (ref) try {
6997
6716
  import_react3.default.Children.only(finalChildren), finalChildren = /* @__PURE__ */ (0, import_react3.cloneElement)(finalChildren, {
6998
6717
  ref
6999
6718
  });
7000
6719
  } catch {
7001
6720
  }
7002
- process.env.NODE_ENV === "development" && props.debug === "visualize" && (finalChildren = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, {
7003
- themeState,
7004
- themeProps: props,
7005
- children: finalChildren
7006
- }));
7007
6721
  var stateRef = (0, import_react3.useRef)({
7008
6722
  hasEverThemed: !1
7009
6723
  });
@@ -7011,61 +6725,65 @@ var require_Theme_native = __commonJS({
7011
6725
  });
7012
6726
  Theme.avoidForwardRef = !0;
7013
6727
  function getThemedChildren(themeState, children, props) {
7014
- var isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, stateRef = arguments.length > 4 ? arguments[4] : void 0, { themeManager, isNewTheme } = themeState;
7015
- if (!themeManager) return children;
7016
- var { shallow, forceClassName } = props, shouldRenderChildrenWithTheme = isNewTheme || isRoot || "inverse" in props || "name" in props || "reset" in props || "forceClassName" in props || stateRef.current.hasEverThemed;
7017
- if (shouldRenderChildrenWithTheme && (stateRef.current.hasEverThemed = !0), !shouldRenderChildrenWithTheme) return children;
7018
- process.env.NODE_ENV === "development" && shouldRenderChildrenWithTheme && props.debug === "verbose" && (0, import_log.log)(`adding theme: isRoot ${isRoot}, inverse ${"inverse" in props}, isNewTheme ${isNewTheme}, hasEver ${stateRef.current.hasEverThemed}`, props);
7019
- var next = children;
7020
- shallow && (next = import_react3.Children.toArray(children).map(function(child) {
7021
- return /* @__PURE__ */ (0, import_react3.isValidElement)(child) ? /* @__PURE__ */ (0, import_react3.cloneElement)(child, void 0, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Theme, {
7022
- name: themeManager.state.parentName,
7023
- children: child.props.children
7024
- })) : child;
7025
- }));
7026
- var elementsWithContext = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeManagerContext.ThemeManagerContext.Provider, {
7027
- value: themeManager,
7028
- children: next
7029
- });
7030
- return forceClassName === !1 ? elementsWithContext : import_constants2.isWeb ? wrapThemeElements({
7031
- children: elementsWithContext,
7032
- themeState,
7033
- forceClassName,
7034
- isRoot
7035
- }) : elementsWithContext;
7036
- }
7037
- function wrapThemeElements(param) {
7038
- var { children, themeState, forceClassName, isRoot } = param;
7039
- if (isRoot && forceClassName === !1) return children;
7040
- var inverse = themeState.inversed, requiresExtraWrapper = typeof inverse == "boolean" || forceClassName, { className, style } = getThemeClassNameAndStyle(themeState, isRoot), themedChildren = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
7041
- className: `${className} _dsp_contents is_Theme`,
7042
- style,
6728
+ var isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, stateRef = arguments.length > 4 ? arguments[4] : void 0, { shallow, forceClassName } = props, state = stateRef.current, hasEverThemed = state.hasEverThemed, shouldRenderChildrenWithTheme = hasEverThemed || themeState.isNew || isRoot || (0, import_useThemeState.hasThemeUpdatingProps)(props);
6729
+ if (!shouldRenderChildrenWithTheme) return children;
6730
+ children = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_useThemeState.ThemeStateContext.Provider, {
6731
+ value: themeState.id,
7043
6732
  children
7044
6733
  });
7045
- if (requiresExtraWrapper) {
7046
- var _themeState_state, name = ((_themeState_state = themeState.state) === null || _themeState_state === void 0 ? void 0 : _themeState_state.name) || "", inverseClassName = name.startsWith("light") ? "t_light is_inversed" : name.startsWith("dark") ? "t_dark is_inversed" : "";
7047
- themedChildren = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
7048
- className: `${inverse ? inverseClassName : ""} _dsp_contents`,
7049
- children: themedChildren
6734
+ var { isInverse, name } = themeState, requiresExtraWrapper = isInverse || forceClassName;
6735
+ if (state.hasEverThemed || (state.hasEverThemed = !0), (requiresExtraWrapper || // if the theme is exactly dark or light, its likely to change between dark/light
6736
+ // and that would require wrapping which would re-parent, so to avoid re-parenting do this
6737
+ themeState.name === "dark" || themeState.name === "light") && (state.hasEverThemed = "wrapped"), shallow && themeState.parentId) {
6738
+ var parentState = (0, import_useThemeState.getThemeState)(themeState.isNew ? themeState.id : themeState.parentId);
6739
+ if (!parentState) throw new Error("\u203C\uFE0F010");
6740
+ children = import_react3.Children.toArray(children).map(function(child) {
6741
+ return /* @__PURE__ */ (0, import_react3.isValidElement)(child) ? /* @__PURE__ */ (0, import_react3.cloneElement)(child, void 0, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Theme, {
6742
+ name: parentState.name,
6743
+ children: child.props.children
6744
+ })) : child;
7050
6745
  });
7051
6746
  }
7052
- return themedChildren;
6747
+ if (process.env.NODE_ENV === "development" && props.debug && (console.warn(" getThemedChildren", {
6748
+ requiresExtraWrapper,
6749
+ forceClassName,
6750
+ themeState,
6751
+ state,
6752
+ ...getThemeClassNameAndStyle(themeState, props, isRoot)
6753
+ }), children = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, {
6754
+ themeState,
6755
+ themeProps: props,
6756
+ children
6757
+ })), forceClassName === !1) return children;
6758
+ if (import_constants2.isWeb) {
6759
+ var { className, style } = getThemeClassNameAndStyle(themeState, props, isRoot);
6760
+ if (children = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
6761
+ className: `${className} _dsp_contents is_Theme`,
6762
+ style,
6763
+ children
6764
+ }), state.hasEverThemed === "wrapped") {
6765
+ var className1 = requiresExtraWrapper ? `${isInverse ? name.startsWith("light") ? "t_light is_inversed" : name.startsWith("dark") ? "t_dark is_inversed" : "" : ""} _dsp_contents` : "_dsp_contents";
6766
+ children = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
6767
+ className: className1,
6768
+ children
6769
+ });
6770
+ }
6771
+ return children;
6772
+ }
6773
+ return children;
7053
6774
  }
7054
- var emptyObj = {};
7055
- function getThemeClassNameAndStyle(themeState) {
7056
- var isRoot = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, _themeState_state, _themeState_state1;
7057
- if (!themeState.isNewTheme) return {
7058
- className: "",
7059
- style: emptyObj
7060
- };
7061
- var themeColor = !((_themeState_state = themeState.state) === null || _themeState_state === void 0) && _themeState_state.theme && themeState.isNewTheme ? (0, import_createVariable.variableToString)(themeState.state.theme.color) : "", style = themeColor ? {
6775
+ function getThemeClassNameAndStyle(themeState, props) {
6776
+ var isRoot = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
6777
+ if (!themeState.isNew && !props.forceClassName) return empty;
6778
+ var themeColor = themeState != null && themeState.theme && themeState.isNew ? (0, import_createVariable.variableToString)(themeState.theme.color) : "", style = themeColor ? {
7062
6779
  color: themeColor
7063
- } : void 0, className = ((_themeState_state1 = themeState.state) === null || _themeState_state1 === void 0 ? void 0 : _themeState_state1.className) || "";
7064
- return isRoot && (className = className.replace("t_sub_theme", "")), {
6780
+ } : void 0, maxInverses = (0, import_config.getSetting)("maxDarkLightNesting") || 3, themeClassName = themeState.inverses >= maxInverses ? themeState.name : themeState.name.replace(schemePrefix, ""), className = `${isRoot ? "" : "t_sub_theme"} t_${themeClassName}`;
6781
+ return {
7065
6782
  style,
7066
6783
  className
7067
6784
  };
7068
6785
  }
6786
+ var schemePrefix = /^(dark|light)_/;
7069
6787
  }
7070
6788
  });
7071
6789
 
@@ -7280,7 +6998,21 @@ var require_useComponentState_native = __commonJS({
7280
6998
  import_constants2.isWeb && hasAnimationThatNeedsHydrate && !staticConfig.isHOC && !isHydrated && (isAnimated = !1, curStateRef.willHydrate = !0), disabled !== state.disabled && (state.disabled = disabled, disabled && Object.assign(state, import_defaultComponentState.defaultComponentStateMounted), setState({
7281
6999
  ...state
7282
7000
  }));
7283
- var setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled, !1, props.debug);
7001
+ var groupName = props.group, setStateWrapper;
7002
+ if (groupName) {
7003
+ var groupContextState = groups.state;
7004
+ setStateWrapper = function(state2) {
7005
+ curStateRef.group.emit(groupName, {
7006
+ pseudo: state2
7007
+ });
7008
+ var next = {
7009
+ ...groupContextState[groupName],
7010
+ ...state2
7011
+ };
7012
+ groupContextState[groupName] = next;
7013
+ };
7014
+ }
7015
+ var setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled, !1, props.debug, setStateWrapper);
7284
7016
  if (presenceState && isAnimated && isHydrated && staticConfig.variants) {
7285
7017
  process.env.NODE_ENV === "development" && props.debug === "verbose" && console.warn(`has presenceState ${JSON.stringify(presenceState)}`);
7286
7018
  var { enterVariant, exitVariant, enterExitVariant, custom } = presenceState;
@@ -7297,7 +7029,6 @@ var require_useComponentState_native = __commonJS({
7297
7029
  isClassNameDisabled
7298
7030
  }));
7299
7031
  }
7300
- var groupName = props.group;
7301
7032
  if (groupName && !curStateRef.group) {
7302
7033
  var listeners = /* @__PURE__ */ new Set();
7303
7034
  curStateRef.group = {
@@ -7314,19 +7045,6 @@ var require_useComponentState_native = __commonJS({
7314
7045
  }
7315
7046
  };
7316
7047
  }
7317
- if (groupName) {
7318
- var groupContextState = groups.state, og = setStateShallow;
7319
- setStateShallow = function(state2) {
7320
- og(state2), curStateRef.group.emit(groupName, {
7321
- pseudo: state2
7322
- });
7323
- var next = {
7324
- ...groupContextState[groupName],
7325
- ...state2
7326
- };
7327
- groupContextState[groupName] = next;
7328
- };
7329
- }
7330
7048
  return {
7331
7049
  curStateRef,
7332
7050
  disabled,
@@ -7575,7 +7293,7 @@ var require_createComponent_native = __commonJS({
7575
7293
  }
7576
7294
  });
7577
7295
  module2.exports = __toCommonJS2(createComponent_exports);
7578
- var import_jsx_runtime = require("react/jsx-runtime"), import_compose_refs = require_index_native5(), import_constants2 = require_index_native2(), import_helpers2 = require_index_native3(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_constants22 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_ComponentContext = require_ComponentContext_native(), import_createVariable = require_createVariable_native(), import_defaultComponentState = require_defaultComponentState_native(), import_getShorthandValue = require_getShorthandValue_native(), import_getSplitStyles = require_getSplitStyles_native(), import_log = require_log_native(), import_mergeProps = require_mergeProps_native(), import_setElementProps = require_setElementProps_native(), import_subscribeToContextGroup = require_subscribeToContextGroup_native(), import_themeable = require_themeable_native(), import_wrapStyleTags = require_wrapStyleTags_native(), import_useComponentState = require_useComponentState_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native(), import_setupHooks = require_setupHooks_native(), import_Slot = require_Slot_native(), import_Theme = require_Theme_native(), import_ThemeDebug = require_ThemeDebug_native(), time2, debugKeyListeners, startVisualizer, componentSetStates = /* @__PURE__ */ new Set();
7296
+ var import_jsx_runtime = require("react/jsx-runtime"), import_compose_refs = require_index_native5(), import_constants2 = require_index_native2(), import_helpers2 = require_index_native3(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_constants22 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_ComponentContext = require_ComponentContext_native(), import_createVariable = require_createVariable_native(), import_defaultComponentState = require_defaultComponentState_native(), import_getShorthandValue = require_getShorthandValue_native(), import_getSplitStyles = require_getSplitStyles_native(), import_log = require_log_native(), import_mergeProps = require_mergeProps_native(), import_setElementProps = require_setElementProps_native(), import_subscribeToContextGroup = require_subscribeToContextGroup_native(), import_themeable = require_themeable_native(), import_wrapStyleTags = require_wrapStyleTags_native(), import_useComponentState = require_useComponentState_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native(), import_setupHooks = require_setupHooks_native(), import_Slot = require_Slot_native(), import_Theme = require_Theme_native(), time2, debugKeyListeners, startVisualizer, componentSetStates = /* @__PURE__ */ new Set();
7579
7297
  typeof document < "u" && (cancelTouches = function() {
7580
7298
  componentSetStates.forEach(function(setState) {
7581
7299
  return setState(function(prev) {
@@ -7640,7 +7358,7 @@ var require_createComponent_native = __commonJS({
7640
7358
  defaultPropsKeyOrder: defaultProps ? Object.keys(defaultProps) : []
7641
7359
  });
7642
7360
  var component = /* @__PURE__ */ import_react3.default.forwardRef(function(propsIn, forwardedRef) {
7643
- var _themeState_state, _hooks_usePropsTransform, _hooks_useEvents, _config_animations, internalID = process.env.NODE_ENV === "development" ? import_react3.default.useId() : "";
7361
+ var _hooks_usePropsTransform, _hooks_useEvents, _config_animations, internalID = process.env.NODE_ENV === "development" ? import_react3.default.useId() : "";
7644
7362
  if (process.env.NODE_ENV === "development" && startVisualizer && (startVisualizer(), startVisualizer = void 0), !hasSetupBaseViews) {
7645
7363
  var _hooks_getBaseViews;
7646
7364
  hasSetupBaseViews = !0;
@@ -7664,13 +7382,17 @@ var require_createComponent_native = __commonJS({
7664
7382
  finalVal !== void 0 && (overriddenContextProps || (overriddenContextProps = {}), overriddenContextProps[key] = finalVal);
7665
7383
  }
7666
7384
  }
7385
+ var debugProp = propsIn.debug;
7386
+ if (0)
7387
+ var timer;
7388
+ process.env.NODE_ENV === "development" && time2 && time2`non-tamagui time (ignore)`;
7667
7389
  var curDefaultProps = styledContextProps ? {
7668
7390
  ...defaultProps,
7669
7391
  ...styledContextProps
7670
7392
  } : defaultProps, props = propsIn;
7671
7393
  curDefaultProps && (props = (0, import_mergeProps.mergeProps)(curDefaultProps, propsIn));
7672
- var debugProp = props.debug, componentName2 = props.componentName || staticConfig.componentName;
7673
- if (process.env.NODE_ENV === "development" && import_constants2.isClient && import_react3.default.useEffect(function() {
7394
+ var componentName2 = props.componentName || staticConfig.componentName;
7395
+ process.env.NODE_ENV === "development" && import_constants2.isClient && import_react3.default.useEffect(function() {
7674
7396
  var overlay = null, debugVisualizerHandler = function() {
7675
7397
  var show = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, node = curStateRef.host;
7676
7398
  if (node) if (show) {
@@ -7684,9 +7406,7 @@ var require_createComponent_native = __commonJS({
7684
7406
  };
7685
7407
  }, [
7686
7408
  componentName2
7687
- ]), !1)
7688
- var timer;
7689
- process.env.NODE_ENV === "development" && time2 && time2`start (ignore)`;
7409
+ ]);
7690
7410
  var animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, { curStateRef, disabled, groupName, hasAnimationProp, hasEnterStyle, isAnimated, isExiting, isHydrated, presence, presenceState, setState, setStateShallow, noClass, state, stateRef, supportsCSSVars, willBeAnimated, willBeAnimatedClient } = (0, import_useComponentState.useComponentState)(props, componentContext, staticConfig, config);
7691
7411
  process.env.NODE_ENV === "development" && time2 && time2`use-state`;
7692
7412
  var hasTextAncestor = !!(import_constants2.isWeb && isText && componentContext.inText), isTaggable = !Component || typeof Component == "string", tagProp = props.tag, element = import_constants2.isWeb && isTaggable && tagProp || Component, BaseTextComponent = BaseText || element || "span", BaseViewComponent = BaseView || element || (hasTextAncestor ? "span" : "div"), elementType = isText ? BaseTextComponent : BaseViewComponent;
@@ -7730,7 +7450,7 @@ var require_createComponent_native = __commonJS({
7730
7450
  }
7731
7451
  }
7732
7452
  process.env.NODE_ENV === "development" && time2 && time2`pre-theme-media`;
7733
- var [themeState, theme] = (0, import_useTheme.useThemeWithState)(themeStateProps);
7453
+ var [theme, themeState] = (0, import_useTheme.useThemeWithState)(themeStateProps);
7734
7454
  process.env.NODE_ENV === "development" && time2 && time2`theme`, elementType = Component || elementType;
7735
7455
  var isStringElement = typeof elementType == "string", mediaState2 = (0, import_useMedia.useMedia)(componentContext, debugProp);
7736
7456
  (0, import_createVariable.setDidGetVariableValue)(!1), process.env.NODE_ENV === "development" && time2 && time2`media`;
@@ -7745,7 +7465,7 @@ var require_createComponent_native = __commonJS({
7745
7465
  isAnimated,
7746
7466
  willBeAnimated,
7747
7467
  styledContextProps
7748
- }, themeName = (themeState == null || (_themeState_state = themeState.state) === null || _themeState_state === void 0 ? void 0 : _themeState_state.name) || "";
7468
+ }, themeName = (themeState == null ? void 0 : themeState.name) || "";
7749
7469
  process.env.NODE_ENV === "development" && time2 && time2`split-styles-prepare`;
7750
7470
  var splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, themeName, state, styleProps, null, componentContext, elementType, debugProp);
7751
7471
  if (process.env.NODE_ENV === "development" && time2 && time2`split-styles`, props.group && props.untilMeasured === "hide" && !curStateRef.hasMeasured) {
@@ -7786,14 +7506,14 @@ var require_createComponent_native = __commonJS({
7786
7506
  (supportsCSSVars ? willBeAnimatedClient : willBeAnimated) && useAnimations && !isHOC
7787
7507
  );
7788
7508
  if (shouldUseAnimation) {
7789
- var _themeState_state1, animations = useAnimations({
7509
+ var animations = useAnimations({
7790
7510
  props: propsWithAnimation,
7791
7511
  // if hydrating, send empty style
7792
7512
  style: splitStylesStyle || {},
7793
7513
  presence,
7794
7514
  componentState: state,
7795
7515
  styleProps,
7796
- theme: (_themeState_state1 = themeState.state) === null || _themeState_state1 === void 0 ? void 0 : _themeState_state1.theme,
7516
+ theme,
7797
7517
  pseudos: pseudos || null,
7798
7518
  staticConfig,
7799
7519
  stateRef
@@ -7999,16 +7719,12 @@ If you meant to do this, you can disable this warning - either change untilMeasu
7999
7719
  }, [
8000
7720
  groupName
8001
7721
  ]);
8002
- if ((groupName && subGroupContext || propsIn.focusWithinStyle) && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ComponentContext.ComponentContext.Provider, {
7722
+ if ((groupName || propsIn.focusWithinStyle) && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ComponentContext.ComponentContext.Provider, {
8003
7723
  ...componentContext,
8004
7724
  groups: subGroupContext,
8005
7725
  setParentFocusState: setStateShallow,
8006
7726
  children: content
8007
- })), process.env.NODE_ENV === "development" && time2 && time2`group-context`, content = disableTheme ? content : (0, import_Theme.getThemedChildren)(themeState, content, themeStateProps, !1, stateRef), process.env.NODE_ENV === "development" && time2 && time2`themed-children`, process.env.NODE_ENV === "development" && props.debug === "visualize" && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, {
8008
- themeState,
8009
- themeProps: props,
8010
- children: content
8011
- })), staticConfig.context) {
7727
+ })), process.env.NODE_ENV === "development" && time2 && time2`group-context`, content = disableTheme ? content : (0, import_Theme.getThemedChildren)(themeState, content, themeStateProps, !1, stateRef), process.env.NODE_ENV === "development" && time2 && time2`themed-children`, staticConfig.context) {
8012
7728
  var contextProps = staticConfig.context.props;
8013
7729
  for (var key1 in contextProps) if (viewProps.style && key1 in viewProps.style || key1 in viewProps) {
8014
7730
  var _viewProps_style;
@@ -9703,7 +9419,7 @@ var require_proxyThemeVariables_native = __commonJS({
9703
9419
  var require_useThemeName_native = __commonJS({
9704
9420
  "../web/dist/cjs/hooks/useThemeName.native.js"(exports2, module2) {
9705
9421
  "use strict";
9706
- var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
9422
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
9707
9423
  for (var name in all) __defProp2(target, name, {
9708
9424
  get: all[name],
9709
9425
  enumerable: !0
@@ -9731,18 +9447,6 @@ var require_useThemeName_native = __commonJS({
9731
9447
  }
9732
9448
  }
9733
9449
  return to;
9734
- }, __toESM2 = function(mod, isNodeMode, target) {
9735
- return target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
9736
- // If the importer is in node compatibility mode or this is not an ESM
9737
- // file that has been converted to a CommonJS file using a Babel-
9738
- // compatible transform (i.e. "__esModule" has not been set), then set
9739
- // "default" to the CommonJS "module.exports" for node compatibility.
9740
- isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", {
9741
- value: mod,
9742
- enumerable: !0
9743
- }) : target,
9744
- mod
9745
- );
9746
9450
  }, __toCommonJS2 = function(mod) {
9747
9451
  return __copyProps2(__defProp2({}, "__esModule", {
9748
9452
  value: !0
@@ -9754,17 +9458,20 @@ var require_useThemeName_native = __commonJS({
9754
9458
  }
9755
9459
  });
9756
9460
  module2.exports = __toCommonJS2(useThemeName_exports);
9757
- var import_constants2 = require_index_native2(), import_react3 = __toESM2(require("react")), import_ThemeManagerContext = require_ThemeManagerContext_native();
9758
- function useThemeName(opts) {
9759
- var manager = import_react3.default.useContext(import_ThemeManagerContext.ThemeManagerContext), [name, setName] = import_react3.default.useState((manager == null ? void 0 : manager.state.name) || "");
9760
- return (0, import_constants2.useIsomorphicLayoutEffect)(function() {
9761
- if (manager) return setName(manager.state.name), manager.onChangeTheme(function(next, manager2) {
9762
- var name2 = opts != null && opts.parent && manager2.state.parentName || next;
9763
- name2 && setName(name2);
9764
- });
9765
- }, [
9766
- manager == null ? void 0 : manager.state.name
9767
- ]), name;
9461
+ var import_useThemeState = require_useThemeState_native(), forceUpdateState = {
9462
+ forceClassName: !0,
9463
+ deopt: !0,
9464
+ needsUpdate: function() {
9465
+ return !0;
9466
+ }
9467
+ }, forceKeys = {
9468
+ current: /* @__PURE__ */ new Set([
9469
+ ""
9470
+ ])
9471
+ };
9472
+ function useThemeName() {
9473
+ var _useThemeState;
9474
+ return ((_useThemeState = (0, import_useThemeState.useThemeState)(forceUpdateState, !1, forceKeys)) === null || _useThemeState === void 0 ? void 0 : _useThemeState.name) || "";
9768
9475
  }
9769
9476
  }
9770
9477
  });
@@ -10014,14 +9721,14 @@ var require_useProps_native = __commonJS({
10014
9721
  return usePropsAndStyle(props, opts)[1] || {};
10015
9722
  }
10016
9723
  function usePropsAndStyle(props, opts) {
10017
- var _opts_forComponent, _themeState_state, _opts_forComponent_staticConfig, staticConfig = (_opts_forComponent_staticConfig = opts == null || (_opts_forComponent = opts.forComponent) === null || _opts_forComponent === void 0 ? void 0 : _opts_forComponent.staticConfig) !== null && _opts_forComponent_staticConfig !== void 0 ? _opts_forComponent_staticConfig : import_Stack.Stack.staticConfig, [themeState, theme] = (0, import_useTheme.useThemeWithState)({
9724
+ var _opts_forComponent, _opts_forComponent_staticConfig, staticConfig = (_opts_forComponent_staticConfig = opts == null || (_opts_forComponent = opts.forComponent) === null || _opts_forComponent === void 0 ? void 0 : _opts_forComponent.staticConfig) !== null && _opts_forComponent_staticConfig !== void 0 ? _opts_forComponent_staticConfig : import_Stack.Stack.staticConfig, [theme, themeState] = (0, import_useTheme.useThemeWithState)({
10018
9725
  componentName: staticConfig.componentName,
10019
9726
  name: "theme" in props ? props.theme : void 0,
10020
9727
  inverse: "themeInverse" in props ? props.themeInverse : void 0
10021
9728
  }), componentContext = import_react3.default.useContext(import_ComponentContext.ComponentContext), { state, disabled, setStateShallow } = (0, import_useComponentState.useComponentState)(props, componentContext, staticConfig, (0, import_config.getConfig)()), mediaStateNow = opts != null && opts.noMedia ? (
10022
9729
  // not safe to use mediaState but really marginal to hit this
10023
9730
  import_useMedia.mediaState
10024
- ) : (0, import_useMedia.useMedia)(), splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, ((_themeState_state = themeState.state) === null || _themeState_state === void 0 ? void 0 : _themeState_state.name) || "", state, {
9731
+ ) : (0, import_useMedia.useMedia)(), splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, (themeState == null ? void 0 : themeState.name) || "", state, {
10025
9732
  isAnimated: !1,
10026
9733
  mediaState: mediaStateNow,
10027
9734
  noSkip: !0,
@@ -10266,7 +9973,7 @@ var require_ThemeProvider_native = __commonJS({
10266
9973
  // if root class disabled, force class here
10267
9974
  forceClassName: !disableRootThemeClass && !themeClassNameOnRoot,
10268
9975
  // @ts-expect-error
10269
- _isRoot: !0,
9976
+ _isRoot: import_react3.useId,
10270
9977
  children: props.children
10271
9978
  });
10272
9979
  };
@@ -10722,6 +10429,9 @@ var require_index_native8 = __commonJS({
10722
10429
  configureMedia: function() {
10723
10430
  return import_useMedia.configureMedia;
10724
10431
  },
10432
+ forceUpdateThemes: function() {
10433
+ return import_useThemeState.forceUpdateThemes;
10434
+ },
10725
10435
  getConfig: function() {
10726
10436
  return import_config.getConfig;
10727
10437
  },
@@ -10817,6 +10527,7 @@ var require_index_native8 = __commonJS({
10817
10527
  __reExport2(index_exports2, require_wrapStyleTags_native(), module2.exports);
10818
10528
  var import_useMedia = require_useMedia_native();
10819
10529
  __reExport2(index_exports2, require_useTheme_native(), module2.exports);
10530
+ var import_useThemeState = require_useThemeState_native();
10820
10531
  __reExport2(index_exports2, require_useThemeName_native(), module2.exports);
10821
10532
  __reExport2(index_exports2, require_useConfiguration_native(), module2.exports);
10822
10533
  __reExport2(index_exports2, require_useIsTouchDevice_native(), module2.exports);