@tamagui/static 1.89.26 → 1.89.27-1708113113238

Sign up to get free protection for your applications and to get access to all the features.
Files changed (175) hide show
  1. package/dist/cjs/constants.native.js +4 -4
  2. package/dist/cjs/constants.native.js.map +3 -3
  3. package/dist/cjs/extractor/accessSafe.native.js +1 -5
  4. package/dist/cjs/extractor/accessSafe.native.js.map +3 -3
  5. package/dist/cjs/extractor/babelParse.native.js +5 -8
  6. package/dist/cjs/extractor/babelParse.native.js.map +3 -3
  7. package/dist/cjs/extractor/buildClassName.native.js +31 -42
  8. package/dist/cjs/extractor/buildClassName.native.js.map +3 -3
  9. package/dist/cjs/extractor/bundle.js +6 -4
  10. package/dist/cjs/extractor/bundle.js.map +1 -1
  11. package/dist/cjs/extractor/bundle.native.js +321 -56
  12. package/dist/cjs/extractor/bundle.native.js.map +3 -3
  13. package/dist/cjs/extractor/bundleConfig.native.js +499 -187
  14. package/dist/cjs/extractor/bundleConfig.native.js.map +3 -3
  15. package/dist/cjs/extractor/createEvaluator.native.js +9 -11
  16. package/dist/cjs/extractor/createEvaluator.native.js.map +3 -3
  17. package/dist/cjs/extractor/createExtractor.native.js +1240 -906
  18. package/dist/cjs/extractor/createExtractor.native.js.map +3 -3
  19. package/dist/cjs/extractor/ensureImportingConcat.native.js +11 -17
  20. package/dist/cjs/extractor/ensureImportingConcat.native.js.map +3 -3
  21. package/dist/cjs/extractor/esbuildAliasPlugin.native.js +22 -11
  22. package/dist/cjs/extractor/esbuildAliasPlugin.native.js.map +3 -3
  23. package/dist/cjs/extractor/evaluateAstNode.native.js +15 -21
  24. package/dist/cjs/extractor/evaluateAstNode.native.js.map +3 -3
  25. package/dist/cjs/extractor/extractHelpers.native.js +146 -38
  26. package/dist/cjs/extractor/extractHelpers.native.js.map +3 -3
  27. package/dist/cjs/extractor/extractMediaStyle.native.js +127 -54
  28. package/dist/cjs/extractor/extractMediaStyle.native.js.map +3 -3
  29. package/dist/cjs/extractor/extractToClassNames.native.js +449 -252
  30. package/dist/cjs/extractor/extractToClassNames.native.js.map +3 -3
  31. package/dist/cjs/extractor/findTopmostFunction.native.js +4 -4
  32. package/dist/cjs/extractor/findTopmostFunction.native.js.map +3 -3
  33. package/dist/cjs/extractor/generateTamaguiStudioConfig.native.js +415 -54
  34. package/dist/cjs/extractor/generateTamaguiStudioConfig.native.js.map +3 -3
  35. package/dist/cjs/extractor/generatedUid.native.js +2 -2
  36. package/dist/cjs/extractor/generatedUid.native.js.map +3 -3
  37. package/dist/cjs/extractor/getPrefixLogs.native.js +2 -1
  38. package/dist/cjs/extractor/getPrefixLogs.native.js.map +3 -3
  39. package/dist/cjs/extractor/getPropValueFromAttributes.native.js +16 -19
  40. package/dist/cjs/extractor/getPropValueFromAttributes.native.js.map +3 -3
  41. package/dist/cjs/extractor/getSourceModule.native.js +20 -7
  42. package/dist/cjs/extractor/getSourceModule.native.js.map +3 -3
  43. package/dist/cjs/extractor/getStaticBindingsForScope.native.js +336 -94
  44. package/dist/cjs/extractor/getStaticBindingsForScope.native.js.map +3 -3
  45. package/dist/cjs/extractor/getTamaguiConfigPathFromOptionsConfig.native.js.map +3 -3
  46. package/dist/cjs/extractor/hoistClassNames.native.js +8 -10
  47. package/dist/cjs/extractor/hoistClassNames.native.js.map +3 -3
  48. package/dist/cjs/extractor/literalToAst.native.js +89 -19
  49. package/dist/cjs/extractor/literalToAst.native.js.map +3 -3
  50. package/dist/cjs/extractor/loadFile.native.js +16 -8
  51. package/dist/cjs/extractor/loadFile.native.js.map +3 -3
  52. package/dist/cjs/extractor/loadTamagui.js +3 -3
  53. package/dist/cjs/extractor/loadTamagui.js.map +1 -1
  54. package/dist/cjs/extractor/loadTamagui.native.js +667 -192
  55. package/dist/cjs/extractor/loadTamagui.native.js.map +3 -3
  56. package/dist/cjs/extractor/logLines.native.js +24 -6
  57. package/dist/cjs/extractor/logLines.native.js.map +3 -3
  58. package/dist/cjs/extractor/normalizeTernaries.native.js +71 -20
  59. package/dist/cjs/extractor/normalizeTernaries.native.js.map +3 -3
  60. package/dist/cjs/extractor/propsToFontFamilyCache.native.js +3 -3
  61. package/dist/cjs/extractor/propsToFontFamilyCache.native.js.map +3 -3
  62. package/dist/cjs/extractor/removeUnusedHooks.native.js +69 -36
  63. package/dist/cjs/extractor/removeUnusedHooks.native.js.map +3 -3
  64. package/dist/cjs/extractor/timer.native.js +10 -9
  65. package/dist/cjs/extractor/timer.native.js.map +3 -3
  66. package/dist/cjs/extractor/validHTMLAttributes.native.js +1 -1
  67. package/dist/cjs/extractor/validHTMLAttributes.native.js.map +3 -3
  68. package/dist/cjs/getPragmaOptions.native.js +4 -9
  69. package/dist/cjs/getPragmaOptions.native.js.map +3 -3
  70. package/dist/cjs/helpers/memoize.native.js +5 -3
  71. package/dist/cjs/helpers/memoize.native.js.map +3 -3
  72. package/dist/cjs/helpers/requireTamaguiCore.native.js +2 -1
  73. package/dist/cjs/helpers/requireTamaguiCore.native.js.map +3 -3
  74. package/dist/cjs/index.native.js.map +2 -2
  75. package/dist/cjs/minifyCSS.native.js.map +3 -3
  76. package/dist/cjs/registerRequire.native.js +56 -28
  77. package/dist/cjs/registerRequire.native.js.map +3 -3
  78. package/dist/cjs/server.native.js +175 -21
  79. package/dist/cjs/server.native.js.map +3 -3
  80. package/dist/cjs/setup.native.js.map +3 -3
  81. package/dist/cjs/static.native.js.map +2 -2
  82. package/dist/cjs/types.native.js.map +2 -2
  83. package/dist/cjs/webpackPlugin.native.js +26 -5
  84. package/dist/cjs/webpackPlugin.native.js.map +3 -3
  85. package/dist/esm/constants.native.js +4 -3
  86. package/dist/esm/constants.native.js.map +3 -3
  87. package/dist/esm/extractor/accessSafe.native.js +1 -5
  88. package/dist/esm/extractor/accessSafe.native.js.map +3 -3
  89. package/dist/esm/extractor/babelParse.native.js +5 -7
  90. package/dist/esm/extractor/babelParse.native.js.map +3 -3
  91. package/dist/esm/extractor/buildClassName.native.js +31 -41
  92. package/dist/esm/extractor/buildClassName.native.js.map +3 -3
  93. package/dist/esm/extractor/bundle.js +6 -4
  94. package/dist/esm/extractor/bundle.js.map +1 -1
  95. package/dist/esm/extractor/bundle.mjs +7 -5
  96. package/dist/esm/extractor/bundle.native.js +321 -56
  97. package/dist/esm/extractor/bundle.native.js.map +3 -3
  98. package/dist/esm/extractor/bundleConfig.native.js +499 -187
  99. package/dist/esm/extractor/bundleConfig.native.js.map +3 -3
  100. package/dist/esm/extractor/createEvaluator.native.js +9 -11
  101. package/dist/esm/extractor/createEvaluator.native.js.map +3 -3
  102. package/dist/esm/extractor/createExtractor.native.js +1241 -916
  103. package/dist/esm/extractor/createExtractor.native.js.map +3 -3
  104. package/dist/esm/extractor/ensureImportingConcat.native.js +11 -16
  105. package/dist/esm/extractor/ensureImportingConcat.native.js.map +3 -3
  106. package/dist/esm/extractor/esbuildAliasPlugin.native.js +22 -11
  107. package/dist/esm/extractor/esbuildAliasPlugin.native.js.map +3 -3
  108. package/dist/esm/extractor/evaluateAstNode.native.js +15 -21
  109. package/dist/esm/extractor/evaluateAstNode.native.js.map +3 -3
  110. package/dist/esm/extractor/extractHelpers.native.js +146 -38
  111. package/dist/esm/extractor/extractHelpers.native.js.map +3 -3
  112. package/dist/esm/extractor/extractMediaStyle.native.js +127 -54
  113. package/dist/esm/extractor/extractMediaStyle.native.js.map +3 -3
  114. package/dist/esm/extractor/extractToClassNames.native.js +449 -252
  115. package/dist/esm/extractor/extractToClassNames.native.js.map +3 -3
  116. package/dist/esm/extractor/findTopmostFunction.native.js +4 -4
  117. package/dist/esm/extractor/findTopmostFunction.native.js.map +3 -3
  118. package/dist/esm/extractor/generateTamaguiStudioConfig.native.js +415 -54
  119. package/dist/esm/extractor/generateTamaguiStudioConfig.native.js.map +3 -3
  120. package/dist/esm/extractor/generatedUid.native.js +2 -2
  121. package/dist/esm/extractor/generatedUid.native.js.map +3 -3
  122. package/dist/esm/extractor/getPrefixLogs.native.js +2 -1
  123. package/dist/esm/extractor/getPrefixLogs.native.js.map +3 -3
  124. package/dist/esm/extractor/getPropValueFromAttributes.native.js +16 -19
  125. package/dist/esm/extractor/getPropValueFromAttributes.native.js.map +3 -3
  126. package/dist/esm/extractor/getSourceModule.native.js +20 -7
  127. package/dist/esm/extractor/getSourceModule.native.js.map +3 -3
  128. package/dist/esm/extractor/getStaticBindingsForScope.native.js +336 -94
  129. package/dist/esm/extractor/getStaticBindingsForScope.native.js.map +3 -3
  130. package/dist/esm/extractor/getTamaguiConfigPathFromOptionsConfig.native.js.map +3 -3
  131. package/dist/esm/extractor/hoistClassNames.native.js +8 -10
  132. package/dist/esm/extractor/hoistClassNames.native.js.map +3 -3
  133. package/dist/esm/extractor/literalToAst.native.js +89 -19
  134. package/dist/esm/extractor/literalToAst.native.js.map +3 -3
  135. package/dist/esm/extractor/loadFile.native.js +16 -8
  136. package/dist/esm/extractor/loadFile.native.js.map +3 -3
  137. package/dist/esm/extractor/loadTamagui.js +1 -2
  138. package/dist/esm/extractor/loadTamagui.js.map +1 -1
  139. package/dist/esm/extractor/loadTamagui.mjs +5 -3
  140. package/dist/esm/extractor/loadTamagui.native.js +668 -203
  141. package/dist/esm/extractor/loadTamagui.native.js.map +3 -3
  142. package/dist/esm/extractor/logLines.native.js +24 -6
  143. package/dist/esm/extractor/logLines.native.js.map +3 -3
  144. package/dist/esm/extractor/normalizeTernaries.native.js +71 -20
  145. package/dist/esm/extractor/normalizeTernaries.native.js.map +3 -3
  146. package/dist/esm/extractor/propsToFontFamilyCache.native.js +3 -3
  147. package/dist/esm/extractor/propsToFontFamilyCache.native.js.map +3 -3
  148. package/dist/esm/extractor/removeUnusedHooks.native.js +69 -35
  149. package/dist/esm/extractor/removeUnusedHooks.native.js.map +3 -3
  150. package/dist/esm/extractor/timer.native.js +10 -9
  151. package/dist/esm/extractor/timer.native.js.map +3 -3
  152. package/dist/esm/extractor/validHTMLAttributes.native.js +1 -1
  153. package/dist/esm/extractor/validHTMLAttributes.native.js.map +3 -3
  154. package/dist/esm/getPragmaOptions.native.js +4 -9
  155. package/dist/esm/getPragmaOptions.native.js.map +3 -3
  156. package/dist/esm/helpers/memoize.native.js +5 -3
  157. package/dist/esm/helpers/memoize.native.js.map +3 -3
  158. package/dist/esm/helpers/requireTamaguiCore.native.js +2 -1
  159. package/dist/esm/helpers/requireTamaguiCore.native.js.map +3 -3
  160. package/dist/esm/index.native.js.map +1 -1
  161. package/dist/esm/minifyCSS.native.js.map +3 -3
  162. package/dist/esm/registerRequire.native.js +56 -28
  163. package/dist/esm/registerRequire.native.js.map +3 -3
  164. package/dist/esm/server.native.js +175 -21
  165. package/dist/esm/server.native.js.map +3 -3
  166. package/dist/esm/setup.native.js.map +3 -3
  167. package/dist/esm/static.native.js.map +3 -3
  168. package/dist/esm/webpackPlugin.native.js +26 -5
  169. package/dist/esm/webpackPlugin.native.js.map +3 -3
  170. package/package.json +14 -15
  171. package/src/extractor/bundle.ts +5 -2
  172. package/src/extractor/loadTamagui.ts +3 -2
  173. package/types/extractor/bundle.d.ts.map +1 -1
  174. package/types/extractor/loadTamagui.d.ts.map +1 -1
  175. package/tamagui.tsconfig.json +0 -5
@@ -27,273 +27,470 @@ __export(extractToClassNames_exports, {
27
27
  });
28
28
  module.exports = __toCommonJS(extractToClassNames_exports);
29
29
  var path = __toESM(require("path")), import_path = require("path"), util = __toESM(require("util")), import_generator = __toESM(require("@babel/generator")), t = __toESM(require("@babel/types")), import_helpers = require("@tamagui/helpers"), import_requireTamaguiCore = require("../helpers/requireTamaguiCore"), import_babelParse = require("./babelParse"), import_buildClassName = require("./buildClassName"), import_ensureImportingConcat = require("./ensureImportingConcat"), import_extractHelpers = require("./extractHelpers"), import_extractMediaStyle = require("./extractMediaStyle"), import_getPrefixLogs = require("./getPrefixLogs"), import_hoistClassNames = require("./hoistClassNames"), import_logLines = require("./logLines"), import_propsToFontFamilyCache = require("./propsToFontFamilyCache"), import_timer = require("./timer");
30
- const mergeStyleGroups = {
31
- shadowOpacity: !0,
32
- shadowRadius: !0,
33
- shadowColor: !0,
34
- shadowOffset: !0
35
- };
36
- async function extractToClassNames({
37
- extractor,
38
- source,
39
- sourcePath,
40
- options,
41
- shouldPrintDebug
42
- }) {
43
- const tm = (0, import_timer.timer)(), { getStylesAtomic } = (0, import_requireTamaguiCore.requireTamaguiCore)("web");
44
- if (sourcePath != null && sourcePath.includes("node_modules"))
45
- return null;
46
- if (shouldPrintDebug && console.warn(`--- ${sourcePath} ---
47
-
48
- `), typeof source != "string")
49
- throw new Error("`source` must be a string of javascript");
50
- if (sourcePath && !path.isAbsolute(sourcePath))
51
- throw new Error(
52
- "`sourcePath` must be an absolute path to a .js file, got: " + sourcePath
53
- );
54
- /.[tj]sx?$/i.test(sourcePath || "") || console.warn(`${sourcePath == null ? void 0 : sourcePath.slice(0, 100)} - bad filename.`), !options.disableExtraction && !options._disableLoadTamagui && await extractor.loadTamagui(options);
55
- const shouldLogTiming = options.logTimings ?? !0, start = Date.now(), mem = process.env.TAMAGUI_SHOW_MEMORY_USAGE && shouldLogTiming ? process.memoryUsage() : null;
56
- let ast;
30
+ function _array_like_to_array(arr, len) {
31
+ (len == null || len > arr.length) && (len = arr.length);
32
+ for (var i = 0, arr2 = new Array(len); i < len; i++)
33
+ arr2[i] = arr[i];
34
+ return arr2;
35
+ }
36
+ function _array_without_holes(arr) {
37
+ if (Array.isArray(arr))
38
+ return _array_like_to_array(arr);
39
+ }
40
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
57
41
  try {
58
- ast = (0, import_babelParse.babelParse)(source, sourcePath);
59
- } catch (err) {
60
- throw console.error("babel parse error:", sourcePath == null ? void 0 : sourcePath.slice(0, 100)), err;
42
+ var info = gen[key](arg), value = info.value;
43
+ } catch (error) {
44
+ reject(error);
45
+ return;
61
46
  }
62
- tm.mark("babel-parse", shouldPrintDebug === "verbose");
63
- const cssMap = /* @__PURE__ */ new Map(), existingHoists = {};
64
- let hasFlattened = !1;
65
- const res = await extractor.parse(ast, {
66
- shouldPrintDebug,
67
- ...options,
68
- sourcePath,
69
- extractStyledDefinitions: !0,
70
- onStyleRule(identifier, rules) {
71
- const css = rules.join(";");
72
- shouldPrintDebug && console.info(`adding styled() rule: .${identifier} ${css}`), cssMap.set(`.${identifier}`, { css, commentTexts: [] });
73
- },
74
- getFlattenedNode: ({ tag }) => (hasFlattened = !0, tag),
75
- onExtractTag: ({
76
- parserProps,
77
- attrs,
78
- node,
79
- attemptEval,
80
- jsxPath,
81
- originalNodeName,
82
- filePath,
83
- lineNumbers,
84
- programPath,
85
- isFlattened,
86
- staticConfig
87
- }) => {
88
- var _a;
89
- if (staticConfig.acceptsClassName === !1) {
90
- shouldPrintDebug && console.info("bail, acceptsClassName is false");
91
- return;
47
+ info.done ? resolve(value) : Promise.resolve(value).then(_next, _throw);
48
+ }
49
+ function _async_to_generator(fn) {
50
+ return function() {
51
+ var self = this, args = arguments;
52
+ return new Promise(function(resolve, reject) {
53
+ var gen = fn.apply(self, args);
54
+ function _next(value) {
55
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
92
56
  }
93
- const didFlattenThisTag = hasFlattened;
94
- hasFlattened = !1;
95
- let finalClassNames = [];
96
- const finalAttrs = [];
97
- let finalStyles = [], viewStyles = {};
98
- for (const attr of attrs)
99
- attr.type === "style" && (viewStyles = {
100
- ...viewStyles,
101
- ...attr.value
102
- });
103
- const ensureNeededPrevStyle = (style) => {
104
- if (!Object.keys(style).some((key) => mergeStyleGroups[key]))
105
- return style;
106
- for (const k in mergeStyleGroups)
107
- k in viewStyles && (style[k] = style[k] ?? viewStyles[k]);
108
- return style;
109
- }, addStyles = (style) => {
110
- if (!style)
111
- return [];
112
- const styleWithPrev = ensureNeededPrevStyle(style), res2 = getStylesAtomic(styleWithPrev);
113
- return res2.length && (finalStyles = [...finalStyles, ...res2]), res2;
114
- };
115
- let lastMediaImportance = 1;
116
- for (const attr of attrs)
117
- switch (attr.type) {
118
- case "style": {
119
- if (isFlattened) {
120
- const styles2 = addStyles(attr.value), newFontFamily = (0, import_propsToFontFamilyCache.getFontFamilyClassNameFromProps)(attr.value) || "", newClassNames = (0, import_helpers.concatClassName)(
121
- styles2.map((x) => x.identifier).join(" ") + newFontFamily
122
- ), existing = finalClassNames.find(
123
- (x) => x.type == "StringLiteral"
124
- );
125
- if (existing) {
126
- let previous = existing.value;
127
- newFontFamily && (shouldPrintDebug && console.info(` newFontFamily: ${newFontFamily}`), previous = previous.replace(/font_[a-z]+/i, "")), existing.value = `${previous} ${newClassNames}`;
128
- } else
129
- finalClassNames = [...finalClassNames, t.stringLiteral(newClassNames)];
130
- } else {
131
- const styles2 = getStylesAtomic(attr.value);
132
- finalStyles = [...finalStyles, ...styles2];
133
- for (const style of styles2) {
134
- const prop = style.pseudo ? `${style.property}-${style.pseudo}` : style.property;
135
- finalAttrs.push(
136
- t.jsxAttribute(t.jsxIdentifier(prop), t.stringLiteral(style.identifier))
137
- );
138
- }
139
- }
57
+ function _throw(err) {
58
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
59
+ }
60
+ _next(void 0);
61
+ });
62
+ };
63
+ }
64
+ function _define_property(obj, key, value) {
65
+ return key in obj ? Object.defineProperty(obj, key, {
66
+ value,
67
+ enumerable: !0,
68
+ configurable: !0,
69
+ writable: !0
70
+ }) : obj[key] = value, obj;
71
+ }
72
+ function _iterable_to_array(iter) {
73
+ if (typeof Symbol < "u" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
74
+ return Array.from(iter);
75
+ }
76
+ function _non_iterable_spread() {
77
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
78
+ }
79
+ function _object_spread(target) {
80
+ for (var i = 1; i < arguments.length; i++) {
81
+ var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
82
+ typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
83
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
84
+ }))), ownKeys2.forEach(function(key) {
85
+ _define_property(target, key, source[key]);
86
+ });
87
+ }
88
+ return target;
89
+ }
90
+ function ownKeys(object, enumerableOnly) {
91
+ var keys = Object.keys(object);
92
+ if (Object.getOwnPropertySymbols) {
93
+ var symbols = Object.getOwnPropertySymbols(object);
94
+ enumerableOnly && (symbols = symbols.filter(function(sym) {
95
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
96
+ })), keys.push.apply(keys, symbols);
97
+ }
98
+ return keys;
99
+ }
100
+ function _object_spread_props(target, source) {
101
+ return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
102
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
103
+ }), target;
104
+ }
105
+ function _to_consumable_array(arr) {
106
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
107
+ }
108
+ function _unsupported_iterable_to_array(o, minLen) {
109
+ if (o) {
110
+ if (typeof o == "string")
111
+ return _array_like_to_array(o, minLen);
112
+ var n = Object.prototype.toString.call(o).slice(8, -1);
113
+ if (n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set")
114
+ return Array.from(n);
115
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
116
+ return _array_like_to_array(o, minLen);
117
+ }
118
+ }
119
+ function _ts_generator(thisArg, body) {
120
+ var f, y, t2, g, _ = {
121
+ label: 0,
122
+ sent: function() {
123
+ if (t2[0] & 1)
124
+ throw t2[1];
125
+ return t2[1];
126
+ },
127
+ trys: [],
128
+ ops: []
129
+ };
130
+ return g = {
131
+ next: verb(0),
132
+ throw: verb(1),
133
+ return: verb(2)
134
+ }, typeof Symbol == "function" && (g[Symbol.iterator] = function() {
135
+ return this;
136
+ }), g;
137
+ function verb(n) {
138
+ return function(v) {
139
+ return step([
140
+ n,
141
+ v
142
+ ]);
143
+ };
144
+ }
145
+ function step(op) {
146
+ if (f)
147
+ throw new TypeError("Generator is already executing.");
148
+ for (; _; )
149
+ try {
150
+ if (f = 1, y && (t2 = op[0] & 2 ? y.return : op[0] ? y.throw || ((t2 = y.return) && t2.call(y), 0) : y.next) && !(t2 = t2.call(y, op[1])).done)
151
+ return t2;
152
+ switch (y = 0, t2 && (op = [
153
+ op[0] & 2,
154
+ t2.value
155
+ ]), op[0]) {
156
+ case 0:
157
+ case 1:
158
+ t2 = op;
140
159
  break;
141
- }
142
- case "attr": {
143
- const val = attr.value;
144
- if (t.isJSXSpreadAttribute(val))
145
- (0, import_extractHelpers.isSimpleSpread)(val) && finalClassNames.push(
146
- t.logicalExpression(
147
- "&&",
148
- val.argument,
149
- t.memberExpression(val.argument, t.identifier("className"))
150
- )
151
- );
152
- else if (val.name.name === "className") {
153
- const value = val.value;
154
- if (value)
155
- try {
156
- const evaluatedValue = attemptEval(value);
157
- finalClassNames.push(t.stringLiteral(evaluatedValue));
158
- } catch {
159
- finalClassNames.push(value.expression);
160
- }
160
+ case 4:
161
+ return _.label++, {
162
+ value: op[1],
163
+ done: !1
164
+ };
165
+ case 5:
166
+ _.label++, y = op[1], op = [
167
+ 0
168
+ ];
169
+ continue;
170
+ case 7:
171
+ op = _.ops.pop(), _.trys.pop();
172
+ continue;
173
+ default:
174
+ if (t2 = _.trys, !(t2 = t2.length > 0 && t2[t2.length - 1]) && (op[0] === 6 || op[0] === 2)) {
175
+ _ = 0;
161
176
  continue;
162
177
  }
163
- finalAttrs.push(val);
164
- break;
165
- }
166
- case "ternary": {
167
- const mediaExtraction = (0, import_extractMediaStyle.extractMediaStyle)(
168
- parserProps,
169
- attr.value,
170
- jsxPath,
171
- extractor.getTamagui(),
172
- sourcePath || "",
173
- lastMediaImportance,
174
- shouldPrintDebug
175
- );
176
- if (shouldPrintDebug && mediaExtraction && console.info(
177
- "ternary (mediaStyles)",
178
- ((_a = mediaExtraction.ternaryWithoutMedia) == null ? void 0 : _a.inlineMediaQuery) ?? "",
179
- mediaExtraction.mediaStyles.map((x) => x.identifier).join(".")
180
- ), !mediaExtraction) {
181
- addTernaryStyle(
182
- attr.value,
183
- addStyles(attr.value.consequent),
184
- addStyles(attr.value.alternate)
185
- );
186
- continue;
178
+ if (op[0] === 3 && (!t2 || op[1] > t2[0] && op[1] < t2[3])) {
179
+ _.label = op[1];
180
+ break;
187
181
  }
188
- lastMediaImportance++, mediaExtraction.mediaStyles && (finalStyles = [...finalStyles, ...mediaExtraction.mediaStyles]), mediaExtraction.ternaryWithoutMedia ? addTernaryStyle(
189
- mediaExtraction.ternaryWithoutMedia,
190
- mediaExtraction.mediaStyles,
191
- []
192
- ) : finalClassNames = [
193
- ...finalClassNames,
194
- ...mediaExtraction.mediaStyles.map((x) => t.stringLiteral(x.identifier))
195
- ];
196
- break;
197
- }
198
- }
199
- function addTernaryStyle(ternary, a, b) {
200
- const cCN = a.map((x) => x.identifier).join(" "), aCN = b.map((x) => x.identifier).join(" ");
201
- a.length && b.length ? finalClassNames.push(
202
- t.conditionalExpression(
203
- ternary.test,
204
- t.stringLiteral(cCN),
205
- t.stringLiteral(aCN)
206
- )
207
- ) : finalClassNames.push(
208
- t.conditionalExpression(
209
- ternary.test,
210
- t.stringLiteral(" " + cCN),
211
- t.stringLiteral(" " + aCN)
212
- )
213
- );
214
- }
215
- if (shouldPrintDebug && console.info(
216
- ` finalClassNames
217
- `,
218
- (0, import_logLines.logLines)(finalClassNames.map((x) => x.value).join(" "))
219
- ), node.attributes = finalAttrs, finalClassNames.length) {
220
- const extraClassNames = (() => {
221
- let value = "";
222
- return isFlattened && (process.env.TAMAGUI_DEBUG_OPTIMIZATIONS && (value += "is_tamagui_flattened"), staticConfig.componentName && (value += ` is_${staticConfig.componentName}`)), value;
223
- })(), names = (0, import_buildClassName.buildClassName)(finalClassNames, extraClassNames), nameExpr = names ? (0, import_hoistClassNames.hoistClassNames)(jsxPath, existingHoists, names) : null;
224
- let expr = nameExpr;
225
- if (nameExpr && !t.isIdentifier(nameExpr) && didFlattenThisTag) {
226
- (0, import_ensureImportingConcat.ensureImportingConcat)(programPath);
227
- const simpleSpreads = attrs.filter((x) => x.type === "attr" && t.isJSXSpreadAttribute(x.value) && (0, import_extractHelpers.isSimpleSpread)(x.value));
228
- expr = t.callExpression(t.identifier("concatClassName"), [
229
- expr,
230
- ...simpleSpreads.map((val) => val.value.argument)
231
- ]);
182
+ if (op[0] === 6 && _.label < t2[1]) {
183
+ _.label = t2[1], t2 = op;
184
+ break;
185
+ }
186
+ if (t2 && _.label < t2[2]) {
187
+ _.label = t2[2], _.ops.push(op);
188
+ break;
189
+ }
190
+ t2[2] && _.ops.pop(), _.trys.pop();
191
+ continue;
232
192
  }
233
- node.attributes.push(
234
- t.jsxAttribute(t.jsxIdentifier("className"), t.jsxExpressionContainer(expr))
235
- );
193
+ op = body.call(thisArg, _);
194
+ } catch (e) {
195
+ op = [
196
+ 6,
197
+ e
198
+ ], y = 0;
199
+ } finally {
200
+ f = t2 = 0;
236
201
  }
237
- const comment = util.format(
238
- "/* %s:%s (%s) */",
239
- filePath,
240
- lineNumbers,
241
- originalNodeName
242
- );
243
- for (const { identifier, rules } of finalStyles) {
244
- const className = `.${identifier}`;
245
- if (cssMap.has(className)) {
246
- if (comment) {
247
- const val = cssMap.get(className);
248
- val.commentTexts.push(comment), cssMap.set(className, val);
202
+ if (op[0] & 5)
203
+ throw op[1];
204
+ return {
205
+ value: op[0] ? op[1] : void 0,
206
+ done: !0
207
+ };
208
+ }
209
+ }
210
+ var mergeStyleGroups = {
211
+ shadowOpacity: !0,
212
+ shadowRadius: !0,
213
+ shadowColor: !0,
214
+ shadowOffset: !0
215
+ };
216
+ function extractToClassNames(_) {
217
+ return _extractToClassNames.apply(this, arguments);
218
+ }
219
+ function _extractToClassNames() {
220
+ return _extractToClassNames = _async_to_generator(function(param) {
221
+ var extractor, source, sourcePath, options, shouldPrintDebug, tm, getStylesAtomic, _options_logTimings, shouldLogTiming, start, mem, ast, cssMap, existingHoists, hasFlattened, res, styles, result, memUsed, _$path, numOptimized, numFound, numFlattened, memory, timing, timingStr, pre, memStr;
222
+ return _ts_generator(this, function(_state) {
223
+ switch (_state.label) {
224
+ case 0:
225
+ if (extractor = param.extractor, source = param.source, sourcePath = param.sourcePath, options = param.options, shouldPrintDebug = param.shouldPrintDebug, tm = (0, import_timer.timer)(), getStylesAtomic = (0, import_requireTamaguiCore.requireTamaguiCore)("web").getStylesAtomic, sourcePath != null && sourcePath.includes("node_modules"))
226
+ return [
227
+ 2,
228
+ null
229
+ ];
230
+ if (shouldPrintDebug && console.warn("--- ".concat(sourcePath, ` ---
231
+
232
+ `)), typeof source != "string")
233
+ throw new Error("`source` must be a string of javascript");
234
+ if (sourcePath && !path.isAbsolute(sourcePath))
235
+ throw new Error("`sourcePath` must be an absolute path to a .js file, got: " + sourcePath);
236
+ return /.[tj]sx?$/i.test(sourcePath || "") || console.warn("".concat(sourcePath == null ? void 0 : sourcePath.slice(0, 100), " - bad filename.")), !options.disableExtraction && !options._disableLoadTamagui ? [
237
+ 4,
238
+ extractor.loadTamagui(options)
239
+ ] : [
240
+ 3,
241
+ 2
242
+ ];
243
+ case 1:
244
+ _state.sent(), _state.label = 2;
245
+ case 2:
246
+ shouldLogTiming = (_options_logTimings = options.logTimings) !== null && _options_logTimings !== void 0 ? _options_logTimings : !0, start = Date.now(), mem = process.env.TAMAGUI_SHOW_MEMORY_USAGE && shouldLogTiming ? process.memoryUsage() : null;
247
+ try {
248
+ ast = (0, import_babelParse.babelParse)(source, sourcePath);
249
+ } catch (err) {
250
+ throw console.error("babel parse error:", sourcePath == null ? void 0 : sourcePath.slice(0, 100)), err;
249
251
  }
250
- } else
251
- rules.length && cssMap.set(className, {
252
- css: rules.join(`
252
+ return tm.mark("babel-parse", shouldPrintDebug === "verbose"), cssMap = /* @__PURE__ */ new Map(), existingHoists = {}, hasFlattened = !1, [
253
+ 4,
254
+ extractor.parse(ast, _object_spread_props(_object_spread({
255
+ shouldPrintDebug
256
+ }, options), {
257
+ sourcePath,
258
+ extractStyledDefinitions: !0,
259
+ onStyleRule: function(identifier, rules) {
260
+ var css = rules.join(";");
261
+ shouldPrintDebug && console.info("adding styled() rule: .".concat(identifier, " ").concat(css)), cssMap.set(".".concat(identifier), {
262
+ css,
263
+ commentTexts: []
264
+ });
265
+ },
266
+ getFlattenedNode: function(param2) {
267
+ var tag = param2.tag;
268
+ return hasFlattened = !0, tag;
269
+ },
270
+ onExtractTag: function(param2) {
271
+ var parserProps = param2.parserProps, attrs = param2.attrs, node = param2.node, attemptEval = param2.attemptEval, jsxPath = param2.jsxPath, originalNodeName = param2.originalNodeName, filePath = param2.filePath, lineNumbers = param2.lineNumbers, programPath = param2.programPath, isFlattened = param2.isFlattened, staticConfig = param2.staticConfig, addTernaryStyle = function(ternary, a, b) {
272
+ var cCN = a.map(function(x) {
273
+ return x.identifier;
274
+ }).join(" "), aCN = b.map(function(x) {
275
+ return x.identifier;
276
+ }).join(" ");
277
+ a.length && b.length ? finalClassNames.push(t.conditionalExpression(ternary.test, t.stringLiteral(cCN), t.stringLiteral(aCN))) : finalClassNames.push(t.conditionalExpression(ternary.test, t.stringLiteral(" " + cCN), t.stringLiteral(" " + aCN)));
278
+ };
279
+ if (staticConfig.acceptsClassName === !1) {
280
+ shouldPrintDebug && console.info("bail, acceptsClassName is false");
281
+ return;
282
+ }
283
+ var didFlattenThisTag = hasFlattened;
284
+ hasFlattened = !1;
285
+ var finalClassNames = [], finalAttrs = [], finalStyles = [], viewStyles = {}, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
286
+ try {
287
+ for (var _iterator = attrs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
288
+ var attr = _step.value;
289
+ attr.type === "style" && (viewStyles = _object_spread({}, viewStyles, attr.value));
290
+ }
291
+ } catch (err) {
292
+ _didIteratorError = !0, _iteratorError = err;
293
+ } finally {
294
+ try {
295
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
296
+ } finally {
297
+ if (_didIteratorError)
298
+ throw _iteratorError;
299
+ }
300
+ }
301
+ var ensureNeededPrevStyle = function(style2) {
302
+ var keys = Object.keys(style2);
303
+ if (!keys.some(function(key) {
304
+ return mergeStyleGroups[key];
305
+ }))
306
+ return style2;
307
+ for (var k in mergeStyleGroups)
308
+ if (k in viewStyles) {
309
+ var _style_k;
310
+ style2[k] = (_style_k = style2[k]) !== null && _style_k !== void 0 ? _style_k : viewStyles[k];
311
+ }
312
+ return style2;
313
+ }, addStyles = function(style2) {
314
+ if (!style2)
315
+ return [];
316
+ var styleWithPrev = ensureNeededPrevStyle(style2), res2 = getStylesAtomic(styleWithPrev);
317
+ return res2.length && (finalStyles = _to_consumable_array(finalStyles).concat(_to_consumable_array(res2))), res2;
318
+ }, lastMediaImportance = 1, _iteratorNormalCompletion1 = !0, _didIteratorError1 = !1, _iteratorError1 = void 0;
319
+ try {
320
+ for (var _iterator1 = attrs[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0) {
321
+ var attr1 = _step1.value;
322
+ switch (attr1.type) {
323
+ case "style": {
324
+ if (isFlattened) {
325
+ var styles1 = addStyles(attr1.value), newFontFamily = (0, import_propsToFontFamilyCache.getFontFamilyClassNameFromProps)(attr1.value) || "", newClassNames = (0, import_helpers.concatClassName)(styles1.map(function(x) {
326
+ return x.identifier;
327
+ }).join(" ") + newFontFamily), existing = finalClassNames.find(function(x) {
328
+ return x.type == "StringLiteral";
329
+ });
330
+ if (existing) {
331
+ var previous = existing.value;
332
+ newFontFamily && (shouldPrintDebug && console.info(" newFontFamily: ".concat(newFontFamily)), previous = previous.replace(/font_[a-z]+/i, "")), existing.value = "".concat(previous, " ").concat(newClassNames);
333
+ } else
334
+ finalClassNames = _to_consumable_array(finalClassNames).concat([
335
+ t.stringLiteral(newClassNames)
336
+ ]);
337
+ } else {
338
+ var styles2 = getStylesAtomic(attr1.value);
339
+ finalStyles = _to_consumable_array(finalStyles).concat(_to_consumable_array(styles2));
340
+ var _iteratorNormalCompletion2 = !0, _didIteratorError2 = !1, _iteratorError2 = void 0;
341
+ try {
342
+ for (var _iterator2 = styles2[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) {
343
+ var style = _step2.value, prop = style.pseudo ? "".concat(style.property, "-").concat(style.pseudo) : style.property;
344
+ finalAttrs.push(t.jsxAttribute(t.jsxIdentifier(prop), t.stringLiteral(style.identifier)));
345
+ }
346
+ } catch (err) {
347
+ _didIteratorError2 = !0, _iteratorError2 = err;
348
+ } finally {
349
+ try {
350
+ !_iteratorNormalCompletion2 && _iterator2.return != null && _iterator2.return();
351
+ } finally {
352
+ if (_didIteratorError2)
353
+ throw _iteratorError2;
354
+ }
355
+ }
356
+ }
357
+ break;
358
+ }
359
+ case "attr": {
360
+ var val = attr1.value;
361
+ if (t.isJSXSpreadAttribute(val))
362
+ (0, import_extractHelpers.isSimpleSpread)(val) && finalClassNames.push(t.logicalExpression("&&", val.argument, t.memberExpression(val.argument, t.identifier("className"))));
363
+ else if (val.name.name === "className") {
364
+ var value = val.value;
365
+ if (value)
366
+ try {
367
+ var evaluatedValue = attemptEval(value);
368
+ finalClassNames.push(t.stringLiteral(evaluatedValue));
369
+ } catch {
370
+ finalClassNames.push(value.expression);
371
+ }
372
+ continue;
373
+ }
374
+ finalAttrs.push(val);
375
+ break;
376
+ }
377
+ case "ternary": {
378
+ var mediaExtraction = (0, import_extractMediaStyle.extractMediaStyle)(parserProps, attr1.value, jsxPath, extractor.getTamagui(), sourcePath || "", lastMediaImportance, shouldPrintDebug);
379
+ if (shouldPrintDebug && mediaExtraction) {
380
+ var _mediaExtraction_ternaryWithoutMedia, _mediaExtraction_ternaryWithoutMedia_inlineMediaQuery;
381
+ console.info("ternary (mediaStyles)", (_mediaExtraction_ternaryWithoutMedia_inlineMediaQuery = (_mediaExtraction_ternaryWithoutMedia = mediaExtraction.ternaryWithoutMedia) === null || _mediaExtraction_ternaryWithoutMedia === void 0 ? void 0 : _mediaExtraction_ternaryWithoutMedia.inlineMediaQuery) !== null && _mediaExtraction_ternaryWithoutMedia_inlineMediaQuery !== void 0 ? _mediaExtraction_ternaryWithoutMedia_inlineMediaQuery : "", mediaExtraction.mediaStyles.map(function(x) {
382
+ return x.identifier;
383
+ }).join("."));
384
+ }
385
+ if (!mediaExtraction) {
386
+ addTernaryStyle(attr1.value, addStyles(attr1.value.consequent), addStyles(attr1.value.alternate));
387
+ continue;
388
+ }
389
+ lastMediaImportance++, mediaExtraction.mediaStyles && (finalStyles = _to_consumable_array(finalStyles).concat(_to_consumable_array(mediaExtraction.mediaStyles))), mediaExtraction.ternaryWithoutMedia ? addTernaryStyle(mediaExtraction.ternaryWithoutMedia, mediaExtraction.mediaStyles, []) : finalClassNames = _to_consumable_array(finalClassNames).concat(_to_consumable_array(mediaExtraction.mediaStyles.map(function(x) {
390
+ return t.stringLiteral(x.identifier);
391
+ })));
392
+ break;
393
+ }
394
+ }
395
+ }
396
+ } catch (err) {
397
+ _didIteratorError1 = !0, _iteratorError1 = err;
398
+ } finally {
399
+ try {
400
+ !_iteratorNormalCompletion1 && _iterator1.return != null && _iterator1.return();
401
+ } finally {
402
+ if (_didIteratorError1)
403
+ throw _iteratorError1;
404
+ }
405
+ }
406
+ if (shouldPrintDebug && console.info(` finalClassNames
407
+ `, (0, import_logLines.logLines)(finalClassNames.map(function(x) {
408
+ return x.value;
409
+ }).join(" "))), node.attributes = finalAttrs, finalClassNames.length) {
410
+ var extraClassNames = function() {
411
+ var value2 = "";
412
+ return isFlattened && (process.env.TAMAGUI_DEBUG_OPTIMIZATIONS && (value2 += "is_tamagui_flattened"), staticConfig.componentName && (value2 += " is_".concat(staticConfig.componentName))), value2;
413
+ }(), names = (0, import_buildClassName.buildClassName)(finalClassNames, extraClassNames), nameExpr = names ? (0, import_hoistClassNames.hoistClassNames)(jsxPath, existingHoists, names) : null, expr = nameExpr;
414
+ if (nameExpr && !t.isIdentifier(nameExpr) && didFlattenThisTag) {
415
+ (0, import_ensureImportingConcat.ensureImportingConcat)(programPath);
416
+ var simpleSpreads = attrs.filter(function(x) {
417
+ return x.type === "attr" && t.isJSXSpreadAttribute(x.value) && (0, import_extractHelpers.isSimpleSpread)(x.value);
418
+ });
419
+ expr = t.callExpression(t.identifier("concatClassName"), [
420
+ expr
421
+ ].concat(_to_consumable_array(simpleSpreads.map(function(val2) {
422
+ return val2.value.argument;
423
+ }))));
424
+ }
425
+ node.attributes.push(t.jsxAttribute(t.jsxIdentifier("className"), t.jsxExpressionContainer(expr)));
426
+ }
427
+ var comment = util.format("/* %s:%s (%s) */", filePath, lineNumbers, originalNodeName), _iteratorNormalCompletion3 = !0, _didIteratorError3 = !1, _iteratorError3 = void 0;
428
+ try {
429
+ for (var _iterator3 = finalStyles[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = !0) {
430
+ var _step_value = _step3.value, identifier = _step_value.identifier, rules = _step_value.rules, className = ".".concat(identifier);
431
+ if (cssMap.has(className)) {
432
+ if (comment) {
433
+ var val1 = cssMap.get(className);
434
+ val1.commentTexts.push(comment), cssMap.set(className, val1);
435
+ }
436
+ } else
437
+ rules.length && cssMap.set(className, {
438
+ css: rules.join(`
253
439
  `),
254
- commentTexts: [comment]
255
- });
256
- }
257
- }
258
- });
259
- if (!res || !res.modified && !res.optimized && !res.flattened && !res.styled)
260
- return shouldPrintDebug && console.info("no res or none modified", res), null;
261
- const styles = Array.from(cssMap.values()).map((x) => x.css).join(`
262
- `).trim(), result = (0, import_generator.default)(
263
- ast,
264
- {
265
- concise: !1,
266
- filename: sourcePath,
267
- // this makes the debug output terrible, and i think sourcemap works already
268
- retainLines: !1,
269
- sourceFileName: sourcePath,
270
- sourceMaps: !0
271
- },
272
- source
273
- );
274
- if (shouldPrintDebug && (console.info(
275
- `
440
+ commentTexts: [
441
+ comment
442
+ ]
443
+ });
444
+ }
445
+ } catch (err) {
446
+ _didIteratorError3 = !0, _iteratorError3 = err;
447
+ } finally {
448
+ try {
449
+ !_iteratorNormalCompletion3 && _iterator3.return != null && _iterator3.return();
450
+ } finally {
451
+ if (_didIteratorError3)
452
+ throw _iteratorError3;
453
+ }
454
+ }
455
+ }
456
+ }))
457
+ ];
458
+ case 3:
459
+ return res = _state.sent(), !res || !res.modified && !res.optimized && !res.flattened && !res.styled ? (shouldPrintDebug && console.info("no res or none modified", res), [
460
+ 2,
461
+ null
462
+ ]) : (styles = Array.from(cssMap.values()).map(function(x) {
463
+ return x.css;
464
+ }).join(`
465
+ `).trim(), result = (0, import_generator.default)(ast, {
466
+ concise: !1,
467
+ filename: sourcePath,
468
+ // this makes the debug output terrible, and i think sourcemap works already
469
+ retainLines: !1,
470
+ sourceFileName: sourcePath,
471
+ sourceMaps: !0
472
+ }, source), shouldPrintDebug && (console.info(`
276
473
  -------- output code -------
277
474
 
278
- `,
279
- result.code.split(`
280
- `).filter((x) => !x.startsWith("//")).join(`
281
- `)
282
- ), console.info(`
475
+ `, result.code.split(`
476
+ `).filter(function(x) {
477
+ return !x.startsWith("//");
478
+ }).join(`
479
+ `)), console.info(`
283
480
  -------- output style --------
284
481
 
285
- `, styles)), shouldLogTiming) {
286
- const memUsed = mem ? Math.round((process.memoryUsage().heapUsed - mem.heapUsed) / 1024 / 1204 * 10) / 10 : 0, path2 = (0, import_path.basename)(sourcePath || "").replace(/\.[jt]sx?$/, "").slice(0, 22).trim().padStart(24), numOptimized = `${res.optimized + res.styled}`.padStart(3), numFound = `${res.found + res.styled}`.padStart(3), numFlattened = `${res.flattened}`.padStart(3), memory = memUsed ? ` ${memUsed}MB` : "", timingStr = `${Date.now() - start}ms`.padStart(6), pre = (0, import_getPrefixLogs.getPrefixLogs)(options), memStr = memory ? `(${memory})` : "";
287
- console.info(
288
- `${pre} ${path2} \xB7 ${numFound} found \xB7 ${numOptimized} opt \xB7 ${numFlattened} flat ${timingStr} ${memStr}`
289
- );
290
- }
291
- return {
292
- ast,
293
- styles,
294
- js: result.code,
295
- map: result.map
296
- };
482
+ `, styles)), shouldLogTiming && (memUsed = mem ? Math.round((process.memoryUsage().heapUsed - mem.heapUsed) / 1024 / 1204 * 10) / 10 : 0, _$path = (0, import_path.basename)(sourcePath || "").replace(/\.[jt]sx?$/, "").slice(0, 22).trim().padStart(24), numOptimized = "".concat(res.optimized + res.styled).padStart(3), numFound = "".concat(res.found + res.styled).padStart(3), numFlattened = "".concat(res.flattened).padStart(3), memory = memUsed ? " ".concat(memUsed, "MB") : "", timing = Date.now() - start, timingStr = "".concat(timing, "ms").padStart(6), pre = (0, import_getPrefixLogs.getPrefixLogs)(options), memStr = memory ? "(".concat(memory, ")") : "", console.info("".concat(pre, " ").concat(_$path, " \xB7 ").concat(numFound, " found \xB7 ").concat(numOptimized, " opt \xB7 ").concat(numFlattened, " flat ").concat(timingStr, " ").concat(memStr))), [
483
+ 2,
484
+ {
485
+ ast,
486
+ styles,
487
+ js: result.code,
488
+ map: result.map
489
+ }
490
+ ]);
491
+ }
492
+ });
493
+ }), _extractToClassNames.apply(this, arguments);
297
494
  }
298
495
  // Annotate the CommonJS export names for ESM import in node:
299
496
  0 && (module.exports = {