@tenphi/tasty 3.3.1 → 3.4.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.
Files changed (35) hide show
  1. package/dist/{collector-BKqNBmzA.js → collector-DTahQUiV.js} +3 -3
  2. package/dist/{collector-BKqNBmzA.js.map → collector-DTahQUiV.js.map} +1 -1
  3. package/dist/{config-BCdCTIED.js → config-B5kHzuNz.js} +40 -57
  4. package/dist/config-B5kHzuNz.js.map +1 -0
  5. package/dist/core/index.d.ts +1 -1
  6. package/dist/core/index.js +5 -5
  7. package/dist/{core-wxP3GHQu.js → core-Dr4u1NVD.js} +15 -14
  8. package/dist/core-Dr4u1NVD.js.map +1 -0
  9. package/dist/{css-writer-D64NY9AX.js → css-writer-B-J87ncv.js} +3 -3
  10. package/dist/{css-writer-D64NY9AX.js.map → css-writer-B-J87ncv.js.map} +1 -1
  11. package/dist/{format-rules-Bo_e2u7r.js → format-rules-DKOA-6qu.js} +2 -2
  12. package/dist/{format-rules-Bo_e2u7r.js.map → format-rules-DKOA-6qu.js.map} +1 -1
  13. package/dist/{hydrate-CMKOuKAx.js → hydrate-OeMX99We.js} +2 -2
  14. package/dist/{hydrate-CMKOuKAx.js.map → hydrate-OeMX99We.js.map} +1 -1
  15. package/dist/{index-DhhUI0yi.d.ts → index-PqN-DIpn.d.ts} +8 -1
  16. package/dist/index.d.ts +1 -1
  17. package/dist/index.js +8 -7
  18. package/dist/index.js.map +1 -1
  19. package/dist/{keyframes-D737PShJ.js → keyframes-CV8azJf3.js} +89 -20
  20. package/dist/keyframes-CV8azJf3.js.map +1 -0
  21. package/dist/{merge-styles-CUIQcs5v.js → merge-styles-oklji0KB.js} +2 -2
  22. package/dist/{merge-styles-CUIQcs5v.js.map → merge-styles-oklji0KB.js.map} +1 -1
  23. package/dist/{resolve-recipes-Df1Ta-Q0.js → resolve-recipes-DTG81rzl.js} +3 -3
  24. package/dist/{resolve-recipes-Df1Ta-Q0.js.map → resolve-recipes-DTG81rzl.js.map} +1 -1
  25. package/dist/ssr/astro-client.js +1 -1
  26. package/dist/ssr/astro.js +3 -3
  27. package/dist/ssr/index.js +3 -3
  28. package/dist/ssr/next.js +4 -4
  29. package/dist/static/index.js +1 -1
  30. package/dist/zero/babel.js +4 -4
  31. package/dist/zero/index.js +1 -1
  32. package/package.json +1 -1
  33. package/dist/config-BCdCTIED.js.map +0 -1
  34. package/dist/core-wxP3GHQu.js.map +0 -1
  35. package/dist/keyframes-D737PShJ.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { C as ParseFunction, D as PropHandlerDefinition, E as PropHandler, O as PropHandlerProps, S as FunctionsConfig, T as SheetManager, _ as TastyPluginFactory, a as getGlobalFontFaces, b as generateTypographyTokens, c as getGlobalRecipes, d as hasGlobalRecipes, f as hasStylesGenerated, g as TastyPlugin, h as resetConfig, i as getGlobalCounterStyles, l as getNamePrefix, m as isTestEnvironment, n as configure, o as getGlobalFunctions, p as isConfigLocked, r as getConfig, s as getGlobalKeyframes, t as TastyConfig, u as hasGlobalKeyframes, v as TypographyPreset, w as StyleInjector, x as ColorSpace, y as TypographyTokenValue } from "../config-YsxGv4tq.js";
2
2
  import { $ as StyleParser, A as ParsedColor, At as StyleUsage, B as StyleValueStateMap, C as SuffixForSelector, Ct as PropertyOptions, D as CSSMap, Dt as SheetInfo, E as AnyStyleHandler, Et as RuleInfo, F as StyleHandlerProps, G as parseColor, H as getGlobalParser, I as StyleHandlerResult, J as getNamedColorHex, K as parseStyle, L as StyleMap, M as ResolvedStyleValue, Mt as flushStyles, N as StyleHandler, Nt as hasPendingStyleWrites, O as CUSTOM_UNITS, Ot as StyleInjectorConfig, P as StyleHandlerDefinition, Pt as resetStyleBatch, Q as strToRgb, R as StylePropValue, S as StylesWithoutSelectors, St as PropertyDefinition, T as TastyPresetNames, Tt as RootRegistry, U as getGlobalPredefinedTokens, V as filterMods, W as normalizeColorTokenValue, X as hexToRgb, Y as getRgbValuesFromRgbaString, Z as hslToRgbValues, _ as NotSelector, _t as InjectionMode, a as ParseStateKeyOptions, at as CSSProperties, b as Styles, bt as KeyframesResult, c as ParsedAdvancedState, ct as DisposeFunction, d as getGlobalPredefinedStates, dt as FunctionDefinition, et as ParserOptions, f as setGlobalPredefinedStates, ft as FunctionParameter, g as NoType, gt as InjectResult, h as ConfigTokens, i as renderStyles, it as UnitHandler, j as RawStyleHandler, jt as QueuedWrite, k as DIRECTIONS, kt as StyleRule, l as StateParserContext, lt as FontFaceDescriptors, m as ConfigTokenValue, mt as GCOptions, n as StyleResult, nt as StyleDetails, o as parseStateKey, ot as CacheMetrics, p as ConditionNode, pt as GCConfig, q as stringifyStyles, r as isSelector, rt as StyleDetailsPart, s as AtRuleContext, st as CounterStyleDescriptors, t as RenderResult, tt as ProcessedStyle, u as createStateParserContext, ut as FontFaceInput, v as RecipeStyles, vt as KeyframesCacheEntry, w as TastyNamedColors, wt as RawCSSResult, x as StylesInterface, xt as KeyframesSteps, y as Selector, yt as KeyframesInfo, z as StyleValue } from "../index-Cd45t5NM.js";
3
- import { $ as okhstFunction, $t as PositionStyleProps, A as keyframes, B as ChunkInfo, Bt as BaseStyleProps, C as getCSSTextForNode, D as injectRawCSS, E as injectGlobal, F as ComputeStylesOptions, G as DIMENSION_CHUNK_STYLES, Gt as ContainerStyleProps, H as APPEARANCE_CHUNK_STYLES, Ht as BlockOuterStyleProps, I as ComputeStylesResult, J as LAYOUT_CHUNK_STYLES, Jt as FlowStyleProps, K as DISPLAY_CHUNK_STYLES, Kt as DimensionStyleProps, L as computeStyles, M as touch, N as ChunkSheetRegistry, O as injector, P as chunkSheetRegistry, Q as createColorFunc, Qt as OuterStyleProps, R as defineHandler, S as getCSSText, Sn as DEFAULT_ZERO_NAME_PREFIX, T as inject, U as CHUNK_NAMES, Ut as BlockStyleProps, V as categorizeStyleKeys, Vt as BlockInnerStyleProps, W as ChunkName, Wt as ColorStyleProps, X as STYLE_TO_CHUNK, Xt as ModValue, Y as POSITION_CHUNK_STYLES, Yt as InnerStyleProps, Z as resolveFunctionColor, Zt as Mods, _ as createInjector, _n as INNER_STYLES, a as DebugOptions, an as TastyThemeNames, b as func, bn as TEXT_STYLES, c as tastyDebug, cn as Tokens, d as dotize, dn as BLOCK_OUTER_STYLES, en as ShortGridStyles, et as okhstPlugin, f as _modAttrs, fn as BLOCK_STYLES, g as counterStyle, gn as FLOW_STYLES, h as cleanup, hn as DIMENSION_STYLES, i as DebugChunkInfo, in as TastyExtensionConfig, j as property, k as isPropertyDefined, l as processTokens, ln as BASE_STYLES, m as filterBaseProps, mn as CONTAINER_STYLES, n as CacheStatus, nn as TastyBaseStylePropNames, nt as okhslPlugin, o as InspectResult, on as TextStyleProps, p as color, pn as COLOR_STYLES, q as FONT_CHUNK_STYLES, qt as ExtraBaseStyleProps, r as ChunkBreakdown, rn as TastyCustomProps, s as Summary, sn as TokenValue, t as CSSOptions, tn as TagName, tt as okhslFunction, u as resolveRecipes, un as BLOCK_INNER_STYLES, v as destroy, vn as OUTER_STYLES, w as getRawCSSText, x as gc, xn as DEFAULT_NAME_PREFIX, y as fontFace, yn as POSITION_STYLES, z as styleHandlers } from "../index-DhhUI0yi.js";
3
+ import { $ as okhstFunction, $t as PositionStyleProps, A as keyframes, B as ChunkInfo, Bt as BaseStyleProps, C as getCSSTextForNode, D as injectRawCSS, E as injectGlobal, F as ComputeStylesOptions, G as DIMENSION_CHUNK_STYLES, Gt as ContainerStyleProps, H as APPEARANCE_CHUNK_STYLES, Ht as BlockOuterStyleProps, I as ComputeStylesResult, J as LAYOUT_CHUNK_STYLES, Jt as FlowStyleProps, K as DISPLAY_CHUNK_STYLES, Kt as DimensionStyleProps, L as computeStyles, M as touch, N as ChunkSheetRegistry, O as injector, P as chunkSheetRegistry, Q as createColorFunc, Qt as OuterStyleProps, R as defineHandler, S as getCSSText, Sn as DEFAULT_ZERO_NAME_PREFIX, T as inject, U as CHUNK_NAMES, Ut as BlockStyleProps, V as categorizeStyleKeys, Vt as BlockInnerStyleProps, W as ChunkName, Wt as ColorStyleProps, X as STYLE_TO_CHUNK, Xt as ModValue, Y as POSITION_CHUNK_STYLES, Yt as InnerStyleProps, Z as resolveFunctionColor, Zt as Mods, _ as createInjector, _n as INNER_STYLES, a as DebugOptions, an as TastyThemeNames, b as func, bn as TEXT_STYLES, c as tastyDebug, cn as Tokens, d as dotize, dn as BLOCK_OUTER_STYLES, en as ShortGridStyles, et as okhstPlugin, f as _modAttrs, fn as BLOCK_STYLES, g as counterStyle, gn as FLOW_STYLES, h as cleanup, hn as DIMENSION_STYLES, i as DebugChunkInfo, in as TastyExtensionConfig, j as property, k as isPropertyDefined, l as processTokens, ln as BASE_STYLES, m as filterBaseProps, mn as CONTAINER_STYLES, n as CacheStatus, nn as TastyBaseStylePropNames, nt as okhslPlugin, o as InspectResult, on as TextStyleProps, p as color, pn as COLOR_STYLES, q as FONT_CHUNK_STYLES, qt as ExtraBaseStyleProps, r as ChunkBreakdown, rn as TastyCustomProps, s as Summary, sn as TokenValue, t as CSSOptions, tn as TagName, tt as okhslFunction, u as resolveRecipes, un as BLOCK_INNER_STYLES, v as destroy, vn as OUTER_STYLES, w as getRawCSSText, x as gc, xn as DEFAULT_NAME_PREFIX, y as fontFace, yn as POSITION_STYLES, z as styleHandlers } from "../index-PqN-DIpn.js";
4
4
  import { t as mergeStyles } from "../merge-styles-CU7JbEwg.js";
5
5
  export { APPEARANCE_CHUNK_STYLES, type AnyStyleHandler, type AtRuleContext, BASE_STYLES, BLOCK_INNER_STYLES, BLOCK_OUTER_STYLES, BLOCK_STYLES, type BaseStyleProps, type BlockInnerStyleProps, type BlockOuterStyleProps, type BlockStyleProps, CHUNK_NAMES, COLOR_STYLES, CONTAINER_STYLES, type CSSMap, CSSOptions, type CSSProperties, CUSTOM_UNITS, type CacheMetrics, CacheStatus, ChunkBreakdown, type ChunkInfo, type ChunkName, ChunkSheetRegistry, type ColorSpace, type ColorStyleProps, type ComputeStylesOptions, type ComputeStylesResult, type ConditionNode, type ConfigTokenValue, type ConfigTokens, type ContainerStyleProps, type CounterStyleDescriptors, DEFAULT_NAME_PREFIX, DEFAULT_ZERO_NAME_PREFIX, DIMENSION_CHUNK_STYLES, DIMENSION_STYLES, DIRECTIONS, DISPLAY_CHUNK_STYLES, DebugChunkInfo, DebugOptions, type DimensionStyleProps, type DisposeFunction, type ExtraBaseStyleProps, FLOW_STYLES, FONT_CHUNK_STYLES, type FlowStyleProps, type FontFaceDescriptors, type FontFaceInput, type FunctionDefinition, type FunctionParameter, type FunctionsConfig, type GCConfig, type GCOptions, INNER_STYLES, type InjectResult, type InjectionMode, type InnerStyleProps, InspectResult, type KeyframesCacheEntry, type KeyframesInfo, type KeyframesResult, type KeyframesSteps, LAYOUT_CHUNK_STYLES, type ModValue, type Mods, type NoType, type NotSelector, OUTER_STYLES, type OuterStyleProps, POSITION_CHUNK_STYLES, POSITION_STYLES, type ParseFunction, type ParseStateKeyOptions, type ParsedAdvancedState, type ParsedColor, type ParserOptions, type PositionStyleProps, type ProcessedStyle, type PropHandler, type PropHandlerDefinition, type PropHandlerProps, type PropertyDefinition, type PropertyOptions, type QueuedWrite, type RawCSSResult, type RawStyleHandler, type RecipeStyles, type RenderResult, type ResolvedStyleValue, type RootRegistry, type RuleInfo, STYLE_TO_CHUNK, type Selector, type SheetInfo, SheetManager, type ShortGridStyles, type StateParserContext, type StyleDetails, type StyleDetailsPart, type StyleHandler, type StyleHandlerDefinition, type StyleHandlerProps, type StyleHandlerResult, StyleInjector, type StyleInjectorConfig, type StyleMap, StyleParser, type StylePropValue, type StyleResult, type StyleRule, type StyleUsage, type StyleValue, type StyleValueStateMap, type Styles, type StylesInterface, type StylesWithoutSelectors, type SuffixForSelector, Summary, TEXT_STYLES, type TagName, type TastyBaseStylePropNames, type TastyConfig, type TastyCustomProps, type TastyExtensionConfig, type TastyNamedColors, type TastyPlugin, type TastyPluginFactory, type TastyPresetNames, type TastyThemeNames, type TextStyleProps, type TokenValue, type Tokens, TypographyPreset, TypographyTokenValue, type UnitHandler, categorizeStyleKeys, chunkSheetRegistry, cleanup, color, computeStyles, configure, counterStyle, createColorFunc, createInjector, createStateParserContext, defineHandler, destroy, dotize, filterBaseProps, filterMods, flushStyles, fontFace, func, gc, generateTypographyTokens, getCSSText, getCSSTextForNode, getConfig, getGlobalCounterStyles, getGlobalFontFaces, getGlobalFunctions, getGlobalKeyframes, getGlobalParser, getGlobalPredefinedStates, getGlobalPredefinedTokens, getGlobalRecipes, getNamePrefix, getNamedColorHex, getRawCSSText, getRgbValuesFromRgbaString, hasGlobalKeyframes, hasGlobalRecipes, hasPendingStyleWrites, hasStylesGenerated, hexToRgb, hslToRgbValues, inject, injectGlobal, injectRawCSS, injector, isConfigLocked, isPropertyDefined, isSelector, isTestEnvironment, keyframes, mergeStyles, _modAttrs as modAttrs, normalizeColorTokenValue, okhslFunction, okhslPlugin, okhstFunction, okhstPlugin, parseColor, parseStateKey, parseStyle, processTokens, property, renderStyles, resetConfig, resetStyleBatch, resolveFunctionColor, resolveRecipes, setGlobalPredefinedStates, strToRgb, stringifyStyles, styleHandlers, tastyDebug, touch };
@@ -1,6 +1,6 @@
1
- import { $ as SheetManager, $t as StyleParser, A as FLOW_STYLES, At as STYLE_TO_CHUNK, B as createStateParserContext, C as BASE_STYLES, Ct as APPEARANCE_CHUNK_STYLES, D as COLOR_STYLES, Dt as FONT_CHUNK_STYLES, E as BLOCK_STYLES, Et as DISPLAY_CHUNK_STYLES, G as StyleInjector, Gt as parseStyle, Ht as getGlobalPredefinedTokens, I as isSelector, Jt as okhstPlugin, Kt as stringifyStyles, L as renderStyles, Lt as CUSTOM_UNITS, M as OUTER_STYLES, N as POSITION_STYLES, O as CONTAINER_STYLES, Ot as LAYOUT_CHUNK_STYLES, P as TEXT_STYLES, R as parseStateKey, Rt as DIRECTIONS, T as BLOCK_OUTER_STYLES, Tt as DIMENSION_CHUNK_STYLES, U as getGlobalPredefinedStates, Ut as normalizeColorTokenValue, Vt as getGlobalParser, W as setGlobalPredefinedStates, Wt as parseColor, Xt as okhslPlugin, Yt as okhslFunction, Zt as createColorFunc, a as getGlobalCounterStyles, an as hslToRgbValues, b as resetConfig, dt as DEFAULT_ZERO_NAME_PREFIX, f as getNamePrefix, g as isConfigLocked, h as hasStylesGenerated, in as hexToRgb, j as INNER_STYLES, k as DIMENSION_STYLES, kt as POSITION_CHUNK_STYLES, l as getGlobalKeyframes, lt as resetStyleBatch, m as hasGlobalRecipes, n as getConfig, nn as getNamedColorHex, nt as styleHandlers, o as getGlobalFontFaces, on as strToRgb, ot as flushStyles, p as hasGlobalKeyframes, qt as okhstFunction, rn as getRgbValuesFromRgbaString, s as getGlobalFunctions, st as hasPendingStyleWrites, t as configure, tt as defineHandler, u as getGlobalRecipes, ut as DEFAULT_NAME_PREFIX, v as isTestEnvironment, w as BLOCK_INNER_STYLES, wt as CHUNK_NAMES, x as generateTypographyTokens, zt as filterMods } from "../config-BCdCTIED.js";
2
- import { A as property, C as getRawCSSText, D as injector, E as injectRawCSS, M as ChunkSheetRegistry, N as chunkSheetRegistry, O as isPropertyDefined, P as resolveFunctionColor, S as getCSSTextForNode, T as injectGlobal, _ as destroy, a as color, b as gc, g as createInjector, h as counterStyle, i as _modAttrs, j as touch, k as keyframes, m as cleanup, n as processTokens, o as filterBaseProps, r as dotize, s as computeStyles, t as tastyDebug, v as fontFace, w as inject, x as getCSSText, y as func } from "../core-wxP3GHQu.js";
3
- import { l as categorizeStyleKeys } from "../keyframes-D737PShJ.js";
4
- import { t as mergeStyles } from "../merge-styles-CUIQcs5v.js";
5
- import { t as resolveRecipes } from "../resolve-recipes-Df1Ta-Q0.js";
1
+ import { $ as SheetManager, $t as StyleParser, A as FLOW_STYLES, At as STYLE_TO_CHUNK, B as createStateParserContext, C as BASE_STYLES, Ct as APPEARANCE_CHUNK_STYLES, D as COLOR_STYLES, Dt as FONT_CHUNK_STYLES, E as BLOCK_STYLES, Et as DISPLAY_CHUNK_STYLES, G as StyleInjector, Gt as parseStyle, Ht as getGlobalPredefinedTokens, I as isSelector, Jt as okhstPlugin, Kt as stringifyStyles, L as renderStyles, Lt as CUSTOM_UNITS, M as OUTER_STYLES, N as POSITION_STYLES, O as CONTAINER_STYLES, Ot as LAYOUT_CHUNK_STYLES, P as TEXT_STYLES, R as parseStateKey, Rt as DIRECTIONS, T as BLOCK_OUTER_STYLES, Tt as DIMENSION_CHUNK_STYLES, U as getGlobalPredefinedStates, Ut as normalizeColorTokenValue, Vt as getGlobalParser, W as setGlobalPredefinedStates, Wt as parseColor, Xt as okhslPlugin, Yt as okhslFunction, Zt as createColorFunc, a as getGlobalCounterStyles, an as hslToRgbValues, b as resetConfig, dt as DEFAULT_ZERO_NAME_PREFIX, f as getNamePrefix, g as isConfigLocked, h as hasStylesGenerated, in as hexToRgb, j as INNER_STYLES, k as DIMENSION_STYLES, kt as POSITION_CHUNK_STYLES, l as getGlobalKeyframes, lt as resetStyleBatch, m as hasGlobalRecipes, n as getConfig, nn as getNamedColorHex, nt as styleHandlers, o as getGlobalFontFaces, on as strToRgb, ot as flushStyles, p as hasGlobalKeyframes, qt as okhstFunction, rn as getRgbValuesFromRgbaString, s as getGlobalFunctions, st as hasPendingStyleWrites, t as configure, tt as defineHandler, u as getGlobalRecipes, ut as DEFAULT_NAME_PREFIX, v as isTestEnvironment, w as BLOCK_INNER_STYLES, wt as CHUNK_NAMES, x as generateTypographyTokens, zt as filterMods } from "../config-B5kHzuNz.js";
2
+ import { A as property, C as getRawCSSText, D as injector, E as injectRawCSS, M as ChunkSheetRegistry, N as chunkSheetRegistry, O as isPropertyDefined, P as resolveFunctionColor, S as getCSSTextForNode, T as injectGlobal, _ as destroy, a as color, b as gc, g as createInjector, h as counterStyle, i as _modAttrs, j as touch, k as keyframes, m as cleanup, n as processTokens, o as filterBaseProps, r as dotize, s as computeStyles, t as tastyDebug, v as fontFace, w as inject, x as getCSSText, y as func } from "../core-Dr4u1NVD.js";
3
+ import { l as categorizeStyleKeys } from "../keyframes-CV8azJf3.js";
4
+ import { t as mergeStyles } from "../merge-styles-oklji0KB.js";
5
+ import { t as resolveRecipes } from "../resolve-recipes-DTG81rzl.js";
6
6
  export { APPEARANCE_CHUNK_STYLES, BASE_STYLES, BLOCK_INNER_STYLES, BLOCK_OUTER_STYLES, BLOCK_STYLES, CHUNK_NAMES, COLOR_STYLES, CONTAINER_STYLES, CUSTOM_UNITS, ChunkSheetRegistry, DEFAULT_NAME_PREFIX, DEFAULT_ZERO_NAME_PREFIX, DIMENSION_CHUNK_STYLES, DIMENSION_STYLES, DIRECTIONS, DISPLAY_CHUNK_STYLES, FLOW_STYLES, FONT_CHUNK_STYLES, INNER_STYLES, LAYOUT_CHUNK_STYLES, OUTER_STYLES, POSITION_CHUNK_STYLES, POSITION_STYLES, STYLE_TO_CHUNK, SheetManager, StyleInjector, StyleParser, TEXT_STYLES, categorizeStyleKeys, chunkSheetRegistry, cleanup, color, computeStyles, configure, counterStyle, createColorFunc, createInjector, createStateParserContext, defineHandler, destroy, dotize, filterBaseProps, filterMods, flushStyles, fontFace, func, gc, generateTypographyTokens, getCSSText, getCSSTextForNode, getConfig, getGlobalCounterStyles, getGlobalFontFaces, getGlobalFunctions, getGlobalKeyframes, getGlobalParser, getGlobalPredefinedStates, getGlobalPredefinedTokens, getGlobalRecipes, getNamePrefix, getNamedColorHex, getRawCSSText, getRgbValuesFromRgbaString, hasGlobalKeyframes, hasGlobalRecipes, hasPendingStyleWrites, hasStylesGenerated, hexToRgb, hslToRgbValues, inject, injectGlobal, injectRawCSS, injector, isConfigLocked, isPropertyDefined, isSelector, isTestEnvironment, keyframes, mergeStyles, _modAttrs as modAttrs, normalizeColorTokenValue, okhslFunction, okhslPlugin, okhstFunction, okhstPlugin, parseColor, parseStateKey, parseStyle, processTokens, property, renderStyles, resetConfig, resetStyleBatch, resolveFunctionColor, resolveRecipes, setGlobalPredefinedStates, strToRgb, stringifyStyles, styleHandlers, tastyDebug, touch };
@@ -1,7 +1,7 @@
1
- import { Bt as getGlobalParseFunctions, G as StyleInjector, Gt as parseStyle, It as registerLocalFunctionPolyfills, J as hasLocalCounterStyle, K as extractLocalCounterStyle, Mt as formatFunctionRule, Nt as hasLocalFunctions, Pt as parseFunctionName, Q as hasLocalFontFace, Qt as isDevEnv, Ut as normalizeColorTokenValue, Vt as getGlobalParser, X as fontFaceContentHash, Y as extractLocalFontFace, Z as formatFontFaceRule, _ as isFunctionsPolyfillEnabled, _t as hashString, bt as hasLocalProperties, c as getGlobalInjector, en as Lru, et as STYLE_HANDLER_MAP, f as getNamePrefix, ft as makeClassName, ht as tastyClassRegex, it as PropertyTypeResolver, jt as extractLocalFunctions, l as getGlobalKeyframes, n as getConfig, p as hasGlobalKeyframes, q as formatCounterStyleRule, rt as createStyle, sn as normalizeDslName, tn as overrideColorAlpha, v as isTestEnvironment, vt as extractLocalProperties, wt as CHUNK_NAMES, xt as parsePropertyToken, y as markStylesGenerated, z as camelToKebab } from "./config-BCdCTIED.js";
2
- import { a as mergeKeyframes, c as generateChunkCacheKey, i as hasLocalKeyframes, l as categorizeStyleKeys, n as extractLocalKeyframes, o as replaceAnimationNames, r as filterUsedKeyframes, s as renderStylesForChunk, t as extractAnimationNamesFromStyles } from "./keyframes-D737PShJ.js";
3
- import { n as formatPropertyCSS, r as getRegisteredSSRCollector, t as formatRules } from "./format-rules-Bo_e2u7r.js";
4
- import { t as resolveRecipes } from "./resolve-recipes-Df1Ta-Q0.js";
1
+ import { Bt as getGlobalParseFunctions, G as StyleInjector, Gt as parseStyle, It as registerLocalFunctionPolyfills, J as hasLocalCounterStyle, K as extractLocalCounterStyle, Mt as formatFunctionRule, Nt as hasLocalFunctions, Pt as parseFunctionName, Q as hasLocalFontFace, Qt as isDevEnv, Ut as normalizeColorTokenValue, Vt as getGlobalParser, X as fontFaceContentHash, Y as extractLocalFontFace, Z as formatFontFaceRule, _ as isFunctionsPolyfillEnabled, _t as hashString, bt as hasLocalProperties, c as getGlobalInjector, en as Lru, et as STYLE_HANDLER_MAP, f as getNamePrefix, ft as makeClassName, ht as tastyClassRegex, it as PropertyTypeResolver, jt as extractLocalFunctions, l as getGlobalKeyframes, n as getConfig, p as hasGlobalKeyframes, q as formatCounterStyleRule, rt as createStyle, sn as normalizeDslName, tn as overrideColorAlpha, v as isTestEnvironment, vt as extractLocalProperties, wt as CHUNK_NAMES, xt as parsePropertyToken, y as markStylesGenerated, z as camelToKebab } from "./config-B5kHzuNz.js";
2
+ import { a as mergeKeyframes, c as generateChunkCacheKey, i as hasLocalKeyframes, l as categorizeStyleKeys, n as extractLocalKeyframes, o as replaceAnimationNames, r as filterUsedKeyframes, s as renderStylesForChunk, t as extractAnimationNamesFromStyles } from "./keyframes-CV8azJf3.js";
3
+ import { n as formatPropertyCSS, r as getRegisteredSSRCollector, t as formatRules } from "./format-rules-DKOA-6qu.js";
4
+ import { t as resolveRecipes } from "./resolve-recipes-DTG81rzl.js";
5
5
  import { cache } from "react";
6
6
  //#region src/utils/function-color.ts
7
7
  const RE_FUNC_NAME = /^([a-z][a-z0-9-]*)\s*\(/i;
@@ -600,7 +600,7 @@ function collectAncillaryRSC(rscCache, styles) {
600
600
  * Process all chunks in RSC mode: render CSS to strings, allocate classNames,
601
601
  * and return combined { className, css }.
602
602
  */
603
- function computeStylesRSC(styles, chunkMap) {
603
+ function computeStylesRSC(styles, chunkMap, stableStyles) {
604
604
  const rscCache = getRSCCache();
605
605
  const cssParts = [];
606
606
  const classNames = [];
@@ -610,7 +610,7 @@ function computeStylesRSC(styles, chunkMap) {
610
610
  if (internalsCSS) cssParts.push(internalsCSS);
611
611
  for (const [chunkName, chunkStyleKeys] of chunkMap) {
612
612
  if (chunkStyleKeys.length === 0) continue;
613
- const { className, isNew } = rscAllocateClassName(rscCache, generateChunkCacheKey(styles, chunkName, chunkStyleKeys));
613
+ const { className, isNew } = rscAllocateClassName(rscCache, generateChunkCacheKey(styles, chunkName, chunkStyleKeys, stableStyles));
614
614
  classNames.push(className);
615
615
  if (isNew) {
616
616
  const renderResult = renderStylesForChunk(styles, chunkName, chunkStyleKeys);
@@ -644,9 +644,9 @@ function getUsedKeyframes(styles) {
644
644
  /**
645
645
  * Process a chunk on the SSR path: allocate via collector, render, collect CSS.
646
646
  */
647
- function processChunkSSR(collector, styles, chunkName, styleKeys) {
647
+ function processChunkSSR(collector, styles, chunkName, styleKeys, stableStyles) {
648
648
  if (styleKeys.length === 0) return null;
649
- const cacheKey = generateChunkCacheKey(styles, chunkName, styleKeys);
649
+ const cacheKey = generateChunkCacheKey(styles, chunkName, styleKeys, stableStyles);
650
650
  const { className, isNewAllocation } = collector.allocateClassName(cacheKey);
651
651
  if (isNewAllocation) {
652
652
  const renderResult = renderStylesForChunk(styles, chunkName, styleKeys);
@@ -674,9 +674,9 @@ function processChunkSSR(collector, styles, chunkName, styleKeys) {
674
674
  * Process a chunk on the client: render, allocate className, and inject
675
675
  * CSS synchronously. The injector's cache makes this idempotent.
676
676
  */
677
- function processChunkSync(styles, chunkName, styleKeys, root) {
677
+ function processChunkSync(styles, chunkName, styleKeys, stableStyles, root) {
678
678
  if (styleKeys.length === 0) return null;
679
- const cacheKey = generateChunkCacheKey(styles, chunkName, styleKeys);
679
+ const cacheKey = generateChunkCacheKey(styles, chunkName, styleKeys, stableStyles);
680
680
  const renderResult = renderStylesForChunk(styles, chunkName, styleKeys, cacheKey);
681
681
  if (renderResult.rules.length === 0) return null;
682
682
  const { className } = inject(renderResult.rules, {
@@ -812,6 +812,7 @@ function collectAncillarySSR(collector, styles, chunks) {
812
812
  function computeStyles(styles, options) {
813
813
  if (!styles || !hasKeys(styles)) return EMPTY_RESULT;
814
814
  const resolved = resolveRecipes(styles);
815
+ const stableStyles = options?.stableStyles === true && resolved === styles;
815
816
  if (isFunctionsPolyfillEnabled() && hasLocalFunctions(resolved)) registerLocalFunctionPolyfills(resolved);
816
817
  const chunkMap = categorizeStyleKeys(resolved);
817
818
  const collector = options?.ssrCollector !== void 0 ? options.ssrCollector : getRegisteredSSRCollector();
@@ -819,18 +820,18 @@ function computeStyles(styles, options) {
819
820
  if (collector) {
820
821
  collector.collectInternals();
821
822
  for (const [chunkName, chunkStyleKeys] of chunkMap) {
822
- const chunk = processChunkSSR(collector, resolved, chunkName, chunkStyleKeys);
823
+ const chunk = processChunkSSR(collector, resolved, chunkName, chunkStyleKeys, stableStyles);
823
824
  if (chunk) chunks.push(chunk);
824
825
  }
825
826
  collectAncillarySSR(collector, resolved, chunks);
826
- } else if (typeof document === "undefined") return computeStylesRSC(resolved, chunkMap);
827
+ } else if (typeof document === "undefined") return computeStylesRSC(resolved, chunkMap, stableStyles);
827
828
  else {
828
829
  const root = options?.root;
829
830
  injectAncillarySync(resolved, root);
830
831
  const usedKf = getUsedKeyframes(resolved);
831
832
  const nameMap = usedKf ? injectKeyframesSync(usedKf, root) : null;
832
833
  for (const [chunkName, chunkStyleKeys] of chunkMap) {
833
- const chunk = processChunkSync(resolved, chunkName, chunkStyleKeys, root);
834
+ const chunk = processChunkSync(resolved, chunkName, chunkStyleKeys, stableStyles, root);
834
835
  if (chunk) chunks.push(chunk);
835
836
  }
836
837
  if (nameMap) injectChunkRulesSync(chunks, nameMap, root);
@@ -1562,4 +1563,4 @@ if (typeof window !== "undefined" && isDevEnv()) tastyDebug.install();
1562
1563
  //#endregion
1563
1564
  export { property as A, getRawCSSText as C, injector as D, injectRawCSS as E, ChunkSheetRegistry as M, chunkSheetRegistry as N, isPropertyDefined as O, resolveFunctionColor as P, getCSSTextForNode as S, injectGlobal as T, destroy as _, color as a, gc as b, hasKeys as c, collectAutoInferredPropertiesRSC as d, getStyleTarget as f, createInjector as g, counterStyle as h, _modAttrs as i, touch as j, keyframes as k, formatKeyframesCSS as l, cleanup as m, processTokens as n, filterBaseProps as o, pushRSCCSS as p, dotize as r, computeStyles as s, tastyDebug as t, collectAutoInferredProperties as u, fontFace as v, inject as w, getCSSText as x, func as y };
1564
1565
 
1565
- //# sourceMappingURL=core-wxP3GHQu.js.map
1566
+ //# sourceMappingURL=core-Dr4u1NVD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core-Dr4u1NVD.js","names":[],"sources":["../src/utils/function-color.ts","../src/injector/chunk-sheet-registry.ts","../src/injector/index.ts","../src/rsc-cache.ts","../src/ssr/collect-auto-properties.ts","../src/ssr/format-keyframes.ts","../src/utils/has-keys.ts","../src/compute-styles.ts","../src/utils/filter-base-props.ts","../src/utils/colors.ts","../src/utils/cache-wrapper.ts","../src/utils/mod-attrs.ts","../src/utils/dotize.ts","../src/utils/process-tokens.ts","../src/debug.ts"],"sourcesContent":["import { getGlobalParseFunctions, getGlobalParser } from './styles';\n\nconst RE_FUNC_NAME = /^([a-z][a-z0-9-]*)\\s*\\(/i;\nconst RE_COLOR_OUT =\n /^(?:rgb|hsl|hwb|lab|lch|oklab|oklch|color)\\(|^#|^var\\(--/i;\n\n/**\n * Resolve a `name(...)` value produced by a registered custom parse function\n * into its concrete color output.\n *\n * A color function is just a `functions` entry whose output is an already\n * supported color (`rgb`, `hsl`, `#…`, `oklch`, …). This helper delegates the\n * value to the global parser (which already runs the registered parse function)\n * and returns the result only when it looks like a color. Returns `null` when\n * `str` is not a registered custom function or its output is not a color.\n *\n * This is the generic replacement for the previously hardcoded okhsl/okhst\n * conversion branches scattered across `strToRgb`, `resolveToRgbaValues`, and\n * the `#token.alpha` injection path.\n */\nexport function resolveFunctionColor(str: string): string | null {\n const m = RE_FUNC_NAME.exec(str);\n if (!m) return null;\n\n const name = m[1].toLowerCase();\n // Ensure the global parser (and therefore the default color functions) is\n // initialized before consulting the function registry.\n getGlobalParser();\n const functions = getGlobalParseFunctions();\n if (!(name in functions)) return null;\n\n const out = getGlobalParser().process(str).output;\n if (!out || !RE_COLOR_OUT.test(out)) return null;\n\n return out;\n}\n","import { hashString } from '../utils/hash';\n\ninterface ChunkSheet {\n sheet: CSSStyleSheet;\n cssText: string;\n refCount: number;\n}\n\n/**\n * Global registry mapping CSS content hashes to shared constructable\n * CSSStyleSheet objects with reference counting.\n *\n * Multiple shadow roots adopting the same chunk share a single underlying\n * stylesheet object — parse once, adopt everywhere.\n */\nexport class ChunkSheetRegistry {\n private sheets = new Map<string, ChunkSheet>();\n private sheetToHash = new WeakMap<CSSStyleSheet, string>();\n\n /**\n * Get or create a CSSStyleSheet for the given CSS text.\n * Increments refCount. Uses content hash as the dedup key.\n */\n acquire(cssText: string): CSSStyleSheet {\n const hash = hashString(cssText);\n const existing = this.sheets.get(hash);\n\n if (existing) {\n existing.refCount++;\n return existing.sheet;\n }\n\n const sheet = new CSSStyleSheet();\n sheet.replaceSync(cssText);\n\n const entry: ChunkSheet = { sheet, cssText, refCount: 1 };\n this.sheets.set(hash, entry);\n this.sheetToHash.set(sheet, hash);\n\n return sheet;\n }\n\n /**\n * Decrement refCount for a sheet. When refCount reaches 0,\n * the sheet is removed from the registry.\n */\n release(sheet: CSSStyleSheet): void {\n const hash = this.sheetToHash.get(sheet);\n if (!hash) return;\n\n const entry = this.sheets.get(hash);\n if (!entry) return;\n\n entry.refCount--;\n\n if (entry.refCount <= 0) {\n this.sheets.delete(hash);\n this.sheetToHash.delete(sheet);\n }\n }\n\n /**\n * Bulk acquire — returns an array of CSSStyleSheet in the same order.\n */\n acquireAll(cssTexts: string[]): CSSStyleSheet[] {\n return cssTexts.map((text) => this.acquire(text));\n }\n\n /**\n * Bulk release — decrements refCount for each sheet.\n */\n releaseAll(sheets: CSSStyleSheet[]): void {\n for (const sheet of sheets) {\n this.release(sheet);\n }\n }\n\n /** Number of unique sheets currently held. */\n get size(): number {\n return this.sheets.size;\n }\n}\n\n/** Module-level singleton shared across the entire application. */\nexport const chunkSheetRegistry = new ChunkSheetRegistry();\n","import {\n getConfig,\n getGlobalInjector,\n getNamePrefix,\n isTestEnvironment,\n markStylesGenerated,\n} from '../config';\nimport type { StyleResult } from '../pipeline';\nimport { tastyClassRegex } from '../utils/name-prefix';\n\nimport { StyleInjector } from './injector';\nimport type {\n CounterStyleDescriptors,\n FontFaceDescriptors,\n FunctionDefinition,\n GCOptions,\n GlobalInjectResult,\n InjectResult,\n KeyframesResult,\n KeyframesSteps,\n PropertyOptions,\n StyleInjectorConfig,\n} from './types';\n\n/**\n * Inject styles and return className with dispose function\n */\nexport function inject(\n rules: StyleResult[],\n options?: { root?: Document | ShadowRoot; cacheKey?: string },\n): InjectResult {\n const injector = getGlobalInjector();\n\n markStylesGenerated();\n\n return injector.inject(rules, options);\n}\n\n/**\n * Inject global rules that should not reserve tasty class names\n */\nexport function injectGlobal(\n rules: StyleResult[],\n options?: { root?: Document | ShadowRoot },\n): GlobalInjectResult {\n return getGlobalInjector().injectGlobal(rules, options);\n}\n\n/**\n * Inject raw CSS text directly without parsing\n * This is a low-overhead method for injecting raw CSS that doesn't need tasty processing.\n * The CSS is inserted into a separate style element to avoid conflicts with tasty's chunking.\n *\n * @example\n * ```tsx\n * // Inject raw CSS\n * const { dispose } = injectRawCSS(`\n * body { margin: 0; padding: 0; }\n * .my-class { color: red; }\n * `);\n *\n * // Later, remove the injected CSS\n * dispose();\n * ```\n */\nexport function injectRawCSS(\n css: string,\n options?: { root?: Document | ShadowRoot },\n): { dispose: () => void } {\n return getGlobalInjector().injectRawCSS(css, options);\n}\n\n/**\n * Get raw CSS text for SSR\n */\nexport function getRawCSSText(options?: {\n root?: Document | ShadowRoot;\n}): string {\n return getGlobalInjector().getRawCSSText(options);\n}\n\n/**\n * Inject keyframes and return object with toString() and dispose()\n */\nexport function keyframes(\n steps: KeyframesSteps,\n nameOrOptions?: string | { root?: Document | ShadowRoot; name?: string },\n): KeyframesResult {\n return getGlobalInjector().keyframes(steps, nameOrOptions);\n}\n\n/**\n * Define a CSS @property custom property.\n * This enables advanced features like animating custom properties.\n *\n * Note: @property rules are global and persistent once defined.\n * Re-registering the same property name is a no-op.\n *\n * @param name - The custom property name (must start with --)\n * @param options - Property configuration\n *\n * @example\n * ```ts\n * // Define a color property that can be animated\n * property('--my-color', {\n * syntax: '<color>',\n * initialValue: 'red',\n * });\n *\n * // Define an angle property\n * property('--rotation', {\n * syntax: '<angle>',\n * inherits: false,\n * initialValue: '0deg',\n * });\n * ```\n */\nexport function property(name: string, options?: PropertyOptions): void {\n return getGlobalInjector().property(name, options);\n}\n\n/**\n * Check if a CSS @property has already been defined\n *\n * @param name - The custom property name to check\n * @param options - Options including root\n */\nexport function isPropertyDefined(\n name: string,\n options?: { root?: Document | ShadowRoot },\n): boolean {\n return getGlobalInjector().isPropertyDefined(name, options);\n}\n\n/**\n * Inject a CSS @font-face rule.\n *\n * Permanent and global — no dispose or ref-counting.\n * Deduplicates by content hash (family + descriptors).\n */\nexport function fontFace(\n family: string,\n descriptors: FontFaceDescriptors,\n options?: { root?: Document | ShadowRoot },\n): void {\n return getGlobalInjector().fontFace(family, descriptors, options);\n}\n\n/**\n * Inject a CSS @counter-style rule.\n *\n * Permanent and global — no dispose or ref-counting. Deduplicates by name and\n * overrides an existing rule by default. Pass `weak: true` for global\n * `configure()` definitions, which never clobber an existing rule.\n */\nexport function counterStyle(\n name: string,\n descriptors: CounterStyleDescriptors,\n options?: { root?: Document | ShadowRoot; weak?: boolean },\n): void {\n return getGlobalInjector().counterStyle(name, descriptors, options);\n}\n\n/**\n * Inject a CSS @function rule (custom function).\n *\n * Permanent and global — no dispose or ref-counting. Deduplicates by function\n * name and overrides an existing rule by default. Pass `weak: true` for global\n * `configure()` definitions, which never clobber an existing rule.\n *\n * @param name - The function name (`$$name`, `$name`, or `--name`)\n * @param definition - Function definition (args, returns, result, local vars)\n *\n * @example\n * ```ts\n * func('$$negative', { args: ['$value'], result: '(-1 * $value)' });\n * ```\n */\nexport function func(\n name: string,\n definition: FunctionDefinition,\n options?: { root?: Document | ShadowRoot; weak?: boolean },\n): void {\n return getGlobalInjector().func(name, definition, options);\n}\n\n/**\n * Get CSS text from all sheets (for SSR)\n */\nexport function getCSSText(options?: { root?: Document | ShadowRoot }): string {\n return getGlobalInjector().getCSSText(options);\n}\n\n/**\n * Collect only CSS used by a rendered subtree (like jest-styled-components).\n * Pass the container returned by render(...).\n */\nexport function getCSSTextForNode(\n node: ParentNode | Element | DocumentFragment,\n options?: { root?: Document | ShadowRoot },\n): string {\n // Collect tasty-generated class names from the subtree using the\n // configured namePrefix (default `'t'`).\n const classRegex = tastyClassRegex(getNamePrefix());\n const classSet = new Set<string>();\n\n const readClasses = (el: Element) => {\n const cls = el.getAttribute('class');\n if (!cls) return;\n for (const token of cls.split(/\\s+/)) {\n if (classRegex.test(token)) classSet.add(token);\n }\n };\n\n // Include node itself if it's an Element\n if ((node as Element).getAttribute) {\n readClasses(node as Element);\n }\n // Walk descendants\n const elements = (node as ParentNode).querySelectorAll\n ? (node as ParentNode).querySelectorAll('[class]')\n : ([] as unknown as NodeListOf<Element>);\n if (elements) elements.forEach(readClasses);\n\n return getGlobalInjector().getCSSTextForClasses(classSet, options);\n}\n\n/**\n * Force cleanup of unused rules\n */\nexport function cleanup(root?: Document | ShadowRoot): void {\n return getGlobalInjector().cleanup(root);\n}\n\n/**\n * Record a render-time usage hit for one or more classNames.\n * Used internally by computeStyles and tasty() to track usage for GC.\n * When the global touch counter reaches `touchInterval`, schedules GC.\n */\nexport function touch(\n className: string,\n options?: { root?: Document | ShadowRoot },\n): void {\n if (!getConfig().gc) return;\n getGlobalInjector().touch(className, options);\n}\n\n/**\n * Synchronous garbage collection of unused styles.\n * Evicts the oldest unused styles when usageMap exceeds capacity.\n * With `{ force: true }`, removes ALL unused styles regardless of capacity.\n *\n * @returns Number of styles evicted.\n */\nexport function gc(options?: GCOptions): number {\n return getGlobalInjector().gc(options);\n}\n\n/**\n * Get the global injector instance for debugging\n */\nexport const injector = {\n get instance() {\n return getGlobalInjector();\n },\n};\n\n/**\n * Destroy all resources and clean up\n */\nexport function destroy(root?: Document | ShadowRoot): void {\n return getGlobalInjector().destroy(root);\n}\n\n/**\n * Create a new isolated injector instance\n */\nexport function createInjector(\n config: Partial<StyleInjectorConfig> = {},\n): StyleInjector {\n const defaultConfig = getConfig();\n\n const fullConfig: StyleInjectorConfig = {\n ...defaultConfig,\n // Auto-enable forceTextInjection in test environments\n forceTextInjection: config.forceTextInjection ?? isTestEnvironment(),\n ...config,\n };\n\n return new StyleInjector(fullConfig);\n}\n\n// Re-export types\nexport type {\n StyleInjectorConfig,\n InjectionMode,\n InjectResult,\n DisposeFunction,\n RuleInfo,\n SheetInfo,\n RootRegistry,\n StyleRule,\n KeyframesInfo,\n KeyframesResult,\n KeyframesSteps,\n KeyframesCacheEntry,\n CacheMetrics,\n RawCSSResult,\n PropertyDefinition,\n PropertyOptions,\n FontFaceDescriptors,\n FontFaceInput,\n CounterStyleDescriptors,\n FunctionDefinition,\n FunctionParameter,\n StyleUsage,\n GCConfig,\n GCOptions,\n} from './types';\n\nexport { flushStyles, hasPendingStyleWrites, resetStyleBatch } from './batch';\nexport type { QueuedWrite } from './batch';\nexport { StyleInjector } from './injector';\nexport { SheetManager } from './sheet-manager';\nexport { ChunkSheetRegistry, chunkSheetRegistry } from './chunk-sheet-registry';\n","/**\n * Shared RSC (React Server Components) inline style cache.\n *\n * Uses React.cache for per-request memoization in Server Components.\n * Both computeStyles() and standalone style functions (useGlobalStyles,\n * useRawCSS, useKeyframes, useProperty, useFontFace, useCounterStyle)\n * share this cache so that CSS accumulated by standalone functions is\n * flushed into inline <style> tags by the next tasty() component.\n */\n\nimport { cache } from 'react';\n\nimport { getNamePrefix } from './config';\nimport type { ServerStyleCollector } from './ssr/collector';\nimport { getRegisteredSSRCollector } from './ssr/ssr-collector-ref';\nimport { hashString } from './utils/hash';\nimport { makeClassName } from './utils/name-prefix';\n\nexport interface RSCStyleCache {\n cacheKeyToClassName: Map<string, string>;\n emittedKeys: Set<string>;\n internalsEmitted: boolean;\n pendingCSS: string[];\n /** Maps dedup key -> its slot in `pendingCSS`, so slot-keyed CSS can be replaced. */\n keyToIndex: Map<string, number>;\n /** Maps dedup key -> generated name for keyframes and counter-styles in RSC mode. */\n generatedNames: Map<string, string>;\n}\n\n/**\n * Per-request RSC style cache using React.cache.\n * React.cache provides per-request memoization in Server Components,\n * so each request gets its own isolated cache.\n */\nexport const getRSCCache = cache(\n (): RSCStyleCache => ({\n cacheKeyToClassName: new Map(),\n emittedKeys: new Set(),\n internalsEmitted: false,\n pendingCSS: [],\n keyToIndex: new Map(),\n generatedNames: new Map(),\n }),\n);\n\nexport function rscAllocateClassName(\n rscCache: RSCStyleCache,\n cacheKey: string,\n): { className: string; isNew: boolean } {\n const existing = rscCache.cacheKeyToClassName.get(cacheKey);\n if (existing) return { className: existing, isNew: false };\n\n // Content-hash ensures stable names across all environments (RSC, SSR, client),\n // enabling cross-environment dedup and preventing class collisions.\n const className = makeClassName(getNamePrefix(), hashString(cacheKey));\n rscCache.cacheKeyToClassName.set(cacheKey, className);\n return { className, isNew: true };\n}\n\n/**\n * Flush any pending CSS accumulated by standalone functions.\n * Returns the CSS string and clears the buffer.\n */\nexport function flushPendingCSS(rscCache: RSCStyleCache): string {\n if (rscCache.pendingCSS.length === 0) return '';\n const css = rscCache.pendingCSS.join('\\n');\n rscCache.pendingCSS.length = 0;\n // The slots are gone with the buffer; a later replace has to append instead.\n rscCache.keyToIndex.clear();\n return css;\n}\n\n/**\n * Push CSS into the RSC pending buffer with dedup via emittedKeys.\n * Returns true if the CSS was added, false if it was already emitted.\n *\n * Pass `replace` for slot-keyed entries (an explicit `id`), where the last write\n * must win to match the client's update-tracking behavior. If the slot has\n * already been flushed into a `<style>` tag the new CSS is appended instead,\n * which still wins by cascade order.\n */\nexport function pushRSCCSS(\n rscCache: RSCStyleCache,\n key: string,\n css: string,\n replace?: boolean,\n): boolean {\n if (replace) {\n const pendingIndex = rscCache.keyToIndex.get(key);\n\n if (pendingIndex !== undefined) {\n rscCache.pendingCSS[pendingIndex] = css;\n return true;\n }\n } else if (rscCache.emittedKeys.has(key)) {\n return false;\n }\n\n rscCache.emittedKeys.add(key);\n rscCache.keyToIndex.set(key, rscCache.pendingCSS.length);\n rscCache.pendingCSS.push(css);\n return true;\n}\n\ntype StyleTarget =\n | { mode: 'ssr'; collector: ServerStyleCollector }\n | { mode: 'rsc'; cache: RSCStyleCache }\n | { mode: 'client' };\n\n/**\n * Determine the current style injection target.\n * Centralizes the three-way detection (SSR collector / RSC cache / client DOM)\n * used by all style functions.\n */\nexport function getStyleTarget(): StyleTarget {\n const collector = getRegisteredSSRCollector();\n if (collector) return { mode: 'ssr', collector };\n if (typeof document === 'undefined')\n return { mode: 'rsc', cache: getRSCCache() };\n return { mode: 'client' };\n}\n","/**\n * SSR / RSC auto-property inference.\n *\n * Scans rendered CSS declarations for custom properties whose types\n * can be inferred from their values (e.g. `--angle: 30deg` → `<angle>`).\n * Mirrors the client-side auto-inference in StyleInjector.inject().\n */\n\nimport type { StyleResult } from '../pipeline';\nimport { parsePropertyToken } from '../properties';\nimport { PropertyTypeResolver } from '../properties/property-type-resolver';\nimport type { RSCStyleCache } from '../rsc-cache';\nimport { pushRSCCSS } from '../rsc-cache';\nimport type { Styles } from '../styles/types';\n\nimport type { ServerStyleCollector } from './collector';\nimport { formatPropertyCSS } from './format-property';\n\n/**\n * Scan rendered rules for auto-inferable custom properties and emit\n * @property CSS via the provided callback.\n */\nfunction scanAndEmitAutoProperties(\n rules: StyleResult[],\n styles: Styles | undefined,\n emit: (name: string, css: string) => void,\n): void {\n const registered = new Set<string>();\n\n if (styles) {\n const localProps = styles['@property'];\n if (localProps && typeof localProps === 'object') {\n for (const token of Object.keys(localProps as Record<string, unknown>)) {\n const parsed = parsePropertyToken(token);\n if (parsed.isValid) {\n registered.add(parsed.cssName);\n }\n }\n }\n }\n\n const resolver = new PropertyTypeResolver();\n\n for (const rule of rules) {\n if (!rule.declarations) continue;\n resolver.scanDeclarations(\n rule.declarations,\n (name) => registered.has(name),\n (name, syntax, initialValue) => {\n registered.add(name);\n const css = formatPropertyCSS(name, {\n syntax,\n inherits: true,\n initialValue,\n });\n if (css) {\n emit(name, css);\n }\n },\n );\n }\n}\n\n/**\n * Scan rendered rules for custom property declarations and collect\n * auto-inferred @property rules via the SSR collector.\n *\n * @param rules - Rendered style rules containing CSS declarations\n * @param collector - SSR collector to emit @property CSS into\n * @param styles - Original styles object (used to skip explicit @property)\n */\nexport function collectAutoInferredProperties(\n rules: StyleResult[],\n collector: ServerStyleCollector,\n styles?: Styles,\n): void {\n scanAndEmitAutoProperties(rules, styles, (name, css) => {\n collector.collectProperty(`__auto:${name}`, css);\n });\n}\n\n/**\n * RSC variant: scan rendered rules and push auto-inferred @property CSS\n * into the RSC pending buffer.\n */\nexport function collectAutoInferredPropertiesRSC(\n rules: StyleResult[],\n rscCache: RSCStyleCache,\n styles?: Styles,\n): void {\n scanAndEmitAutoProperties(rules, styles, (name, css) => {\n pushRSCCSS(rscCache, `__auto:${name}`, css);\n });\n}\n","/**\n * Format @keyframes CSS rules for SSR output.\n *\n * Replicates the stepsToCSS logic from SheetManager but as a\n * standalone function that doesn't need DOM access.\n */\n\nimport type { KeyframesSteps } from '../injector/types';\nimport { createStyle, STYLE_HANDLER_MAP } from '../styles';\nimport type { CSSMap, StyleHandler, StyleValueStateMap } from '../utils/styles';\n\n/**\n * Convert keyframes steps to a CSS string.\n * Replicates SheetManager.stepsToCSS() without the class instance.\n */\nfunction stepsToCSS(steps: KeyframesSteps): string {\n const rules: string[] = [];\n\n for (const [key, value] of Object.entries(steps)) {\n if (typeof value === 'string') {\n rules.push(`${key} { ${value.trim()} }`);\n continue;\n }\n\n const styleMap = (value || {}) as StyleValueStateMap;\n const styleNames = Object.keys(styleMap).sort();\n const handlerQueue: StyleHandler[] = [];\n const seenHandlers = new Set<StyleHandler>();\n\n styleNames.forEach((styleName) => {\n let handlers = STYLE_HANDLER_MAP[styleName];\n if (!handlers) {\n handlers = STYLE_HANDLER_MAP[styleName] = [createStyle(styleName)];\n }\n\n handlers.forEach((handler) => {\n if (!seenHandlers.has(handler)) {\n seenHandlers.add(handler);\n handlerQueue.push(handler);\n }\n });\n });\n\n const declarationPairs: { prop: string; value: string }[] = [];\n\n handlerQueue.forEach((handler) => {\n const lookup = handler.__lookupStyles;\n const filteredMap = lookup.reduce<StyleValueStateMap>((acc, name) => {\n const v = styleMap[name];\n if (v !== undefined) acc[name] = v;\n return acc;\n }, {});\n\n const result = handler(filteredMap);\n if (!result) return;\n\n const results = Array.isArray(result) ? result : [result];\n results.forEach((cssMap) => {\n if (!cssMap || typeof cssMap !== 'object') return;\n const { $: _$, ...props } = cssMap as CSSMap;\n\n Object.entries(props).forEach(([prop, val]) => {\n if (val == null || val === '') return;\n\n if (Array.isArray(val)) {\n val.forEach((v) => {\n if (v != null && v !== '') {\n declarationPairs.push({ prop, value: String(v) });\n }\n });\n } else {\n declarationPairs.push({ prop, value: String(val) });\n }\n });\n });\n });\n\n const declarations = declarationPairs\n .map((d) => `${d.prop}: ${d.value}`)\n .join('; ');\n\n rules.push(`${key} { ${declarations.trim()} }`);\n }\n\n return rules.join(' ');\n}\n\n/**\n * Format a @keyframes rule as a CSS string.\n */\nexport function formatKeyframesCSS(\n name: string,\n steps: KeyframesSteps,\n): string {\n const cssSteps = stepsToCSS(steps);\n return `@keyframes ${name} { ${cssSteps} }`;\n}\n","/**\n * Check if an object has any own enumerable keys.\n * Avoids the array allocation of Object.keys(obj).length > 0.\n */\nexport function hasKeys(obj: object): boolean {\n for (const _ in obj) return true;\n return false;\n}\n","/**\n * Hook-free, synchronous style computation.\n *\n * Extracts the core logic from useStyles() into a plain function that can\n * be called during React render without any hooks. Three code paths:\n *\n * 1. SSR collector — styles collected via ServerStyleCollector\n * 2. Client inject — styles injected synchronously into the DOM\n * 3. RSC inline — styles returned as CSS strings for inline <style> emission\n *\n * This enables tasty() components to work as React Server Components.\n */\n\nimport {\n categorizeStyleKeys,\n generateChunkCacheKey,\n renderStylesForChunk,\n} from './chunks';\nimport {\n getConfig,\n getGlobalKeyframes,\n hasGlobalKeyframes,\n isFunctionsPolyfillEnabled,\n} from './config';\nimport {\n counterStyle,\n fontFace,\n func,\n inject,\n keyframes,\n property,\n touch,\n} from './injector';\nimport type { FontFaceDescriptors, KeyframesSteps } from './injector/types';\nimport {\n extractLocalCounterStyle,\n formatCounterStyleRule,\n hasLocalCounterStyle,\n} from './counter-style';\nimport {\n extractLocalFunctions,\n formatFunctionRule,\n hasLocalFunctions,\n parseFunctionName,\n registerLocalFunctionPolyfills,\n} from './functions';\nimport {\n extractLocalFontFace,\n fontFaceContentHash,\n formatFontFaceRule,\n hasLocalFontFace,\n} from './font-face';\nimport {\n extractAnimationNamesFromStyles,\n extractLocalKeyframes,\n filterUsedKeyframes,\n hasLocalKeyframes,\n mergeKeyframes,\n replaceAnimationNames,\n} from './keyframes';\nimport type { RenderResult, StyleResult } from './pipeline';\nimport {\n flushPendingCSS,\n getRSCCache,\n rscAllocateClassName,\n} from './rsc-cache';\nimport type { RSCStyleCache } from './rsc-cache';\nimport { extractLocalProperties, hasLocalProperties } from './properties';\nimport { collectAutoInferredProperties } from './ssr/collect-auto-properties';\nimport type { ServerStyleCollector } from './ssr/collector';\nimport { formatKeyframesCSS } from './ssr/format-keyframes';\nimport { formatPropertyCSS } from './ssr/format-property';\nimport { formatRules } from './ssr/format-rules';\nimport { getRegisteredSSRCollector } from './ssr/ssr-collector-ref';\nimport type { Styles } from './styles/types';\nimport { hasKeys } from './utils/has-keys';\nimport { resolveRecipes } from './utils/resolve-recipes';\n\nexport interface ComputeStylesResult {\n className: string;\n /** CSS text to emit as an inline <style> tag (RSC mode only). */\n css?: string;\n}\n\nexport interface ComputeStylesOptions {\n ssrCollector?: ServerStyleCollector | null;\n /** Target root for style injection (client only). Defaults to `document`. */\n root?: Document | ShadowRoot;\n /**\n * Set when `styles` outlives this call and will be passed in again — a\n * `tasty()` factory's own styles object rather than a per-render merge.\n * It lets chunk cache keys be memoized on the object, which is worth the\n * bookkeeping only when there is a next render to spend it on.\n */\n stableStyles?: boolean;\n}\n\ninterface ProcessedChunk {\n name: string;\n styleKeys: string[];\n cacheKey: string;\n renderResult: RenderResult;\n className: string;\n}\n\nconst EMPTY_RESULT: ComputeStylesResult = { className: '' };\n\n// ---------------------------------------------------------------------------\n// RSC (React Server Components) inline style support\n// ---------------------------------------------------------------------------\n\n/**\n * Mark internals as emitted for this RSC request.\n *\n * Internals (tokens, @property, @font-face, @counter-style) are emitted\n * exclusively by the SSR collector via ServerStyleCollector.collectInternals().\n * The SSR path is reliable because TastyRegistry is always present as a\n * client component in the root layout, guaranteeing SSR runs for every page.\n *\n * Previously this function also emitted internals and coordinated with SSR\n * via a globalThis flag, but that flag leaked across requests in the same\n * Node.js process, causing pages without RSC-rendered tasty components\n * (e.g. the playground route) to lose all token CSS.\n */\nfunction collectInternalsRSC(rscCache: RSCStyleCache): string {\n if (rscCache.internalsEmitted) return '';\n rscCache.internalsEmitted = true;\n\n return '';\n}\n\n/**\n * Collect per-component ancillary CSS (keyframes, @property, font-face,\n * counter-style) for RSC mode.\n */\nfunction collectAncillaryRSC(rscCache: RSCStyleCache, styles: Styles): string {\n const parts: string[] = [];\n\n const usedKf = getUsedKeyframes(styles);\n if (usedKf) {\n for (const [name, steps] of Object.entries(usedKf)) {\n const key = `__kf:${name}:${JSON.stringify(steps)}`;\n if (!rscCache.emittedKeys.has(key)) {\n rscCache.emittedKeys.add(key);\n parts.push(formatKeyframesCSS(name, steps));\n }\n }\n }\n\n if (hasLocalProperties(styles)) {\n const localProperties = extractLocalProperties(styles);\n if (localProperties) {\n for (const [token, definition] of Object.entries(localProperties)) {\n const key = `__prop:${token}`;\n if (!rscCache.emittedKeys.has(key)) {\n rscCache.emittedKeys.add(key);\n const css = formatPropertyCSS(token, definition);\n if (css) parts.push(css);\n }\n }\n }\n }\n\n if (hasLocalFontFace(styles)) {\n const localFontFace = extractLocalFontFace(styles);\n if (localFontFace) {\n for (const [family, input] of Object.entries(localFontFace)) {\n const descriptors: FontFaceDescriptors[] = Array.isArray(input)\n ? input\n : [input];\n for (const desc of descriptors) {\n const hash = fontFaceContentHash(family, desc);\n const key = `__ff:${hash}`;\n if (!rscCache.emittedKeys.has(key)) {\n rscCache.emittedKeys.add(key);\n parts.push(formatFontFaceRule(family, desc));\n }\n }\n }\n }\n }\n\n if (hasLocalCounterStyle(styles)) {\n const localCounterStyle = extractLocalCounterStyle(styles);\n if (localCounterStyle) {\n for (const [name, descriptors] of Object.entries(localCounterStyle)) {\n const key = `__cs:${name}:${JSON.stringify(descriptors)}`;\n if (!rscCache.emittedKeys.has(key)) {\n rscCache.emittedKeys.add(key);\n parts.push(formatCounterStyleRule(name, descriptors));\n }\n }\n }\n }\n\n if (!isFunctionsPolyfillEnabled() && hasLocalFunctions(styles)) {\n const localFunctions = extractLocalFunctions(styles);\n if (localFunctions) {\n for (const [name, definition] of Object.entries(localFunctions)) {\n const key = `__func:${parseFunctionName(name)}`;\n if (!rscCache.emittedKeys.has(key)) {\n rscCache.emittedKeys.add(key);\n parts.push(formatFunctionRule(name, definition));\n }\n }\n }\n }\n\n return parts.join('\\n');\n}\n\n/**\n * Process all chunks in RSC mode: render CSS to strings, allocate classNames,\n * and return combined { className, css }.\n */\nfunction computeStylesRSC(\n styles: Styles,\n chunkMap: Map<string, string[]>,\n stableStyles: boolean,\n): ComputeStylesResult {\n const rscCache = getRSCCache();\n const cssParts: string[] = [];\n const classNames: string[] = [];\n\n // Flush CSS accumulated by standalone style functions\n const pendingCSS = flushPendingCSS(rscCache);\n if (pendingCSS) cssParts.push(pendingCSS);\n\n const internalsCSS = collectInternalsRSC(rscCache);\n if (internalsCSS) cssParts.push(internalsCSS);\n\n for (const [chunkName, chunkStyleKeys] of chunkMap) {\n if (chunkStyleKeys.length === 0) continue;\n\n const cacheKey = generateChunkCacheKey(\n styles,\n chunkName,\n chunkStyleKeys,\n stableStyles,\n );\n const { className, isNew } = rscAllocateClassName(rscCache, cacheKey);\n classNames.push(className);\n\n if (isNew) {\n const renderResult = renderStylesForChunk(\n styles,\n chunkName,\n chunkStyleKeys,\n );\n if (renderResult.rules.length > 0) {\n const css = formatRules(renderResult.rules, className);\n if (css) cssParts.push(css);\n }\n }\n }\n\n const ancillaryCSS = collectAncillaryRSC(rscCache, styles);\n if (ancillaryCSS) cssParts.push(ancillaryCSS);\n\n if (classNames.length === 0) return EMPTY_RESULT;\n\n const css = cssParts.join('\\n');\n\n return {\n className: classNames.join(' '),\n css: css || undefined,\n };\n}\n\n/**\n * Get keyframes that are actually used in styles.\n * Returns null if no keyframes are used (fast path for zero overhead).\n */\nfunction getUsedKeyframes(\n styles: Styles,\n): Record<string, KeyframesSteps> | null {\n const hasLocal = hasLocalKeyframes(styles);\n const hasGlobal = hasGlobalKeyframes();\n if (!hasLocal && !hasGlobal) return null;\n\n const usedNames = extractAnimationNamesFromStyles(styles);\n if (usedNames.size === 0) return null;\n\n const local = hasLocal ? extractLocalKeyframes(styles) : null;\n const global = hasGlobal ? getGlobalKeyframes() : null;\n const allKeyframes = mergeKeyframes(local, global);\n\n return filterUsedKeyframes(allKeyframes, usedNames);\n}\n\n/**\n * Process a chunk on the SSR path: allocate via collector, render, collect CSS.\n */\nfunction processChunkSSR(\n collector: ServerStyleCollector,\n styles: Styles,\n chunkName: string,\n styleKeys: string[],\n stableStyles: boolean,\n): ProcessedChunk | null {\n if (styleKeys.length === 0) return null;\n\n const cacheKey = generateChunkCacheKey(\n styles,\n chunkName,\n styleKeys,\n stableStyles,\n );\n const { className, isNewAllocation } = collector.allocateClassName(cacheKey);\n\n if (isNewAllocation) {\n const renderResult = renderStylesForChunk(styles, chunkName, styleKeys);\n if (renderResult.rules.length > 0) {\n collector.collectChunk(cacheKey, className, renderResult.rules);\n return { name: chunkName, styleKeys, cacheKey, renderResult, className };\n }\n return null;\n }\n\n return {\n name: chunkName,\n styleKeys,\n cacheKey,\n renderResult: { rules: [] },\n className,\n };\n}\n\n/**\n * Process a chunk on the client: render, allocate className, and inject\n * CSS synchronously. The injector's cache makes this idempotent.\n */\nfunction processChunkSync(\n styles: Styles,\n chunkName: string,\n styleKeys: string[],\n stableStyles: boolean,\n root?: Document | ShadowRoot,\n): ProcessedChunk | null {\n if (styleKeys.length === 0) return null;\n\n const cacheKey = generateChunkCacheKey(\n styles,\n chunkName,\n styleKeys,\n stableStyles,\n );\n const renderResult = renderStylesForChunk(\n styles,\n chunkName,\n styleKeys,\n cacheKey,\n );\n if (renderResult.rules.length === 0) return null;\n\n const { className } = inject(renderResult.rules, { cacheKey, root });\n\n return { name: chunkName, styleKeys, cacheKey, renderResult, className };\n}\n\n/**\n * Inject keyframes synchronously and return a name replacement map.\n * On the client, keyframes are injected into the DOM.\n */\nfunction injectKeyframesSync(\n usedKeyframes: Record<string, KeyframesSteps>,\n root?: Document | ShadowRoot,\n): Map<string, string> | null {\n let nameMap: Map<string, string> | null = null;\n\n for (const [name, steps] of Object.entries(usedKeyframes)) {\n const result = keyframes(steps, { name, root });\n const injectedName = result.toString();\n if (injectedName !== name) {\n if (!nameMap) nameMap = new Map();\n nameMap.set(name, injectedName);\n }\n }\n\n return nameMap;\n}\n\n/**\n * Inject chunk rules synchronously, replacing animation names if needed.\n */\nfunction injectChunkRulesSync(\n chunks: ProcessedChunk[],\n nameMap: Map<string, string> | null,\n root?: Document | ShadowRoot,\n): void {\n for (const chunk of chunks) {\n if (chunk.renderResult.rules.length > 0) {\n const rulesToInject: StyleResult[] = nameMap\n ? chunk.renderResult.rules.map((rule) => ({\n ...rule,\n declarations: replaceAnimationNames(rule.declarations, nameMap!),\n }))\n : chunk.renderResult.rules;\n\n inject(rulesToInject, { cacheKey: chunk.cacheKey, root });\n }\n }\n}\n\n/**\n * Inject all ancillary rules (properties, font-faces, counter-styles) synchronously.\n */\nfunction injectAncillarySync(\n styles: Styles,\n root?: Document | ShadowRoot,\n): void {\n if (hasLocalProperties(styles)) {\n const localProperties = extractLocalProperties(styles);\n if (localProperties) {\n for (const [token, definition] of Object.entries(localProperties)) {\n property(token, { ...definition, root });\n }\n }\n }\n\n if (hasLocalFontFace(styles)) {\n const localFontFace = extractLocalFontFace(styles);\n if (localFontFace) {\n for (const [family, input] of Object.entries(localFontFace)) {\n const descriptors: FontFaceDescriptors[] = Array.isArray(input)\n ? input\n : [input];\n for (const desc of descriptors) {\n fontFace(family, desc, { root });\n }\n }\n }\n }\n\n if (hasLocalCounterStyle(styles)) {\n const localCounterStyle = extractLocalCounterStyle(styles);\n if (localCounterStyle) {\n for (const [name, descriptors] of Object.entries(localCounterStyle)) {\n counterStyle(name, descriptors, { root });\n }\n }\n }\n\n if (!isFunctionsPolyfillEnabled() && hasLocalFunctions(styles)) {\n const localFunctions = extractLocalFunctions(styles);\n if (localFunctions) {\n for (const [name, definition] of Object.entries(localFunctions)) {\n func(name, definition, { root });\n }\n }\n }\n}\n\n/**\n * Collect all ancillary rules into the SSR collector.\n */\nfunction collectAncillarySSR(\n collector: ServerStyleCollector,\n styles: Styles,\n chunks: ProcessedChunk[],\n): void {\n const usedKf = getUsedKeyframes(styles);\n if (usedKf) {\n for (const [name, steps] of Object.entries(usedKf)) {\n const css = formatKeyframesCSS(name, steps);\n collector.collectKeyframes(name, css);\n }\n }\n\n if (hasLocalProperties(styles)) {\n const localProperties = extractLocalProperties(styles);\n if (localProperties) {\n for (const [token, definition] of Object.entries(localProperties)) {\n const css = formatPropertyCSS(token, definition);\n if (css) {\n collector.collectProperty(token, css);\n }\n }\n }\n }\n\n if (hasLocalFontFace(styles)) {\n const localFontFace = extractLocalFontFace(styles);\n if (localFontFace) {\n for (const [family, input] of Object.entries(localFontFace)) {\n const descriptors: FontFaceDescriptors[] = Array.isArray(input)\n ? input\n : [input];\n for (const desc of descriptors) {\n const hash = fontFaceContentHash(family, desc);\n const css = formatFontFaceRule(family, desc);\n collector.collectFontFace(hash, css);\n }\n }\n }\n }\n\n if (hasLocalCounterStyle(styles)) {\n const localCounterStyle = extractLocalCounterStyle(styles);\n if (localCounterStyle) {\n for (const [name, descriptors] of Object.entries(localCounterStyle)) {\n const css = formatCounterStyleRule(name, descriptors);\n collector.collectCounterStyle(name, css);\n }\n }\n }\n\n if (!isFunctionsPolyfillEnabled() && hasLocalFunctions(styles)) {\n const localFunctions = extractLocalFunctions(styles);\n if (localFunctions) {\n for (const [name, definition] of Object.entries(localFunctions)) {\n const css = formatFunctionRule(name, definition);\n collector.collectFunction(parseFunctionName(name), css);\n }\n }\n }\n\n if (getConfig().autoPropertyTypes !== false) {\n const allRules = chunks.flatMap((c) => c.renderResult.rules);\n if (allRules.length > 0) {\n collectAutoInferredProperties(allRules, collector, styles);\n }\n }\n}\n\n/**\n * Synchronous, hook-free style computation.\n *\n * Resolves recipes, categorizes style keys into chunks, renders CSS rules,\n * allocates class names, and injects / collects / returns the CSS.\n *\n * Three code paths:\n * 1. SSR collector — discovered via ALS or passed explicitly; CSS collected\n * 2. RSC inline — no collector and no `document`; CSS returned as `result.css`\n * for the caller to emit as an inline `<style>` tag\n * 3. Client inject — CSS injected synchronously into the DOM (idempotent)\n *\n * @param styles - Tasty styles object (or undefined for no styles)\n * @param options - Optional SSR collector override\n */\nexport function computeStyles(\n styles: Styles | undefined,\n options?: ComputeStylesOptions,\n): ComputeStylesResult {\n if (!styles || !hasKeys(styles as Record<string, unknown>)) {\n return EMPTY_RESULT;\n }\n\n const resolved = resolveRecipes(styles);\n\n // Only the caller's own object can be declared reusable. When recipe\n // resolution rewrites it, `resolved` is a fresh per-render object and\n // memoizing on it would be pure overhead.\n const stableStyles = options?.stableStyles === true && resolved === styles;\n\n // @function polyfill: register local definitions as inline closures BEFORE\n // any chunk is rendered, so call sites in this component expand to plain CSS.\n if (isFunctionsPolyfillEnabled() && hasLocalFunctions(resolved)) {\n registerLocalFunctionPolyfills(resolved);\n }\n\n const chunkMap = categorizeStyleKeys(resolved as Record<string, unknown>);\n\n const collector =\n options?.ssrCollector !== undefined\n ? options.ssrCollector\n : getRegisteredSSRCollector();\n\n const chunks: ProcessedChunk[] = [];\n\n if (collector) {\n collector.collectInternals();\n\n for (const [chunkName, chunkStyleKeys] of chunkMap) {\n const chunk = processChunkSSR(\n collector,\n resolved,\n chunkName,\n chunkStyleKeys,\n stableStyles,\n );\n if (chunk) chunks.push(chunk);\n }\n\n collectAncillarySSR(collector, resolved, chunks);\n } else if (typeof document === 'undefined') {\n // RSC path: render CSS to strings for inline <style> emission\n return computeStylesRSC(resolved, chunkMap, stableStyles);\n } else {\n const root = options?.root;\n\n injectAncillarySync(resolved, root);\n\n const usedKf = getUsedKeyframes(resolved);\n const nameMap = usedKf ? injectKeyframesSync(usedKf, root) : null;\n\n for (const [chunkName, chunkStyleKeys] of chunkMap) {\n const chunk = processChunkSync(\n resolved,\n chunkName,\n chunkStyleKeys,\n stableStyles,\n root,\n );\n if (chunk) chunks.push(chunk);\n }\n\n if (nameMap) {\n injectChunkRulesSync(chunks, nameMap, root);\n }\n\n for (const chunk of chunks) {\n touch(chunk.className, { root });\n }\n }\n\n if (chunks.length === 0) return EMPTY_RESULT;\n if (chunks.length === 1) return { className: chunks[0].className };\n\n return { className: chunks.map((c) => c.className).join(' ') };\n}\n","const DOMPropNames = new Set(['id']);\n\nconst BasePropNames = new Set([\n 'role',\n 'as',\n 'element',\n 'css',\n 'qa',\n 'mods',\n 'qaVal',\n 'hidden',\n 'isHidden',\n 'disabled',\n 'isDisabled',\n 'children',\n 'style',\n 'className',\n 'href',\n 'target',\n 'tabIndex',\n]);\n\nconst ignoreEventPropsNames = new Set([\n 'onPress',\n 'onHoverStart',\n 'onHoverEnd',\n 'onPressStart',\n 'onPressEnd',\n]);\n\nconst propRe = /^((data-).*)$/;\nconst eventRe = /^on[A-Z].+$/;\n\ninterface PropsFilterOptions {\n // @deprecated\n labelable?: boolean;\n propNames?: Set<string>;\n eventProps?: boolean;\n}\n\n/**\n * Filters out all props that aren't valid DOM props or defined via override prop obj.\n * @param props - The component props to be filtered.\n * @param opts - Props to override.\n */\nexport function filterBaseProps<T extends object>(\n props: T,\n opts: PropsFilterOptions = {},\n): Partial<T> {\n const { propNames, eventProps } = opts;\n const filteredProps: Partial<T> = {};\n\n for (const prop in props) {\n if (\n Object.prototype.hasOwnProperty.call(props, prop) &&\n (DOMPropNames.has(prop) ||\n BasePropNames.has(prop) ||\n // Always preserve any ARIA attributes to maintain accessibility support.\n prop.startsWith('aria-') ||\n (eventProps &&\n eventRe.test(prop) &&\n !ignoreEventPropsNames.has(prop)) ||\n propNames?.has(prop) ||\n propRe.test(prop))\n ) {\n filteredProps[prop] = props[prop];\n }\n }\n\n return filteredProps;\n}\n","import { overrideColorAlpha } from './color-space';\n\nexport function color(name: string, opacity = 1) {\n if (opacity !== 1) {\n // The alpha slot takes a `<number>`, so the value goes in as authored —\n // no percentage conversion to introduce a float artifact.\n return overrideColorAlpha(`var(--${name}-color)`, String(opacity));\n }\n\n return `var(--${name}-color)`;\n}\n","import { Lru } from '../parser/lru';\n\n/**\n * Create a function that caches the result with LRU eviction.\n */\nexport function cacheWrapper<A, B, R>(\n handler: (firstArg: A, secondArg?: B) => R,\n limit = 1000,\n): (firstArg: A, secondArg?: B) => R {\n const cache = new Lru<string, R>(limit);\n\n return (firstArg: A, secondArg?: B) => {\n const key =\n typeof firstArg === 'string' && secondArg == null\n ? firstArg\n : JSON.stringify([firstArg, secondArg]);\n\n let result = cache.get(key);\n if (result === undefined) {\n result =\n secondArg == null ? handler(firstArg) : handler(firstArg, secondArg);\n cache.set(key, result);\n }\n return result;\n };\n}\n","/**\n * Generate data DOM attributes from modifier map.\n */\nimport type { AllBaseProps } from '../types';\n\nimport { cacheWrapper } from './cache-wrapper';\nimport { camelToKebab } from './case-converter';\n\nfunction modAttrs(map: AllBaseProps['mods']): Record<string, string> | null {\n return map\n ? Object.keys(map).reduce(\n (attrs, key) => {\n const value = map[key];\n\n // Skip null, undefined, false\n if (value == null || value === false) {\n return attrs;\n }\n\n const attrName = `data-${camelToKebab(key)}`;\n\n if (value === true) {\n // Boolean true: data-{name}=\"\"\n attrs[attrName] = '';\n } else if (typeof value === 'string') {\n // String value: data-{name}=\"value\"\n attrs[attrName] = value;\n } else if (typeof value === 'number') {\n // Number: convert to string\n attrs[attrName] = String(value);\n } else {\n // Reject other types (objects, arrays, functions)\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n `[Tasty] Invalid mod value for \"${key}\". Expected boolean, string, or number, got ${typeof value}`,\n );\n }\n }\n\n return attrs;\n },\n {} as Record<string, string>,\n )\n : null;\n}\n\nconst _modAttrs = cacheWrapper(modAttrs);\n\nexport { _modAttrs as modAttrs };\n","// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\n// Convert complex js object to dot notation js object\n// url: https://github.com/vardars/dotize\n// author: vardars\n\nexport const dotize = {\n valTypes: {\n none: 'NONE',\n primitive: 'PRIM',\n object: 'OBJECT',\n array: 'ARRAY',\n },\n\n getValType: function (val) {\n if (!val || typeof val != 'object' || Array.isArray(val))\n return dotize.valTypes.primitive;\n if (typeof val == 'object') return dotize.valTypes.object;\n },\n\n getPathType: function (arrPath) {\n const arrPathTypes = [];\n for (const path in arrPath) {\n const pathVal = arrPath[path];\n if (!pathVal) arrPathTypes.push(dotize.valTypes.none);\n else if (dotize.isNumber(pathVal))\n arrPathTypes.push(dotize.valTypes.array);\n else arrPathTypes.push(dotize.valTypes.object);\n }\n return arrPathTypes;\n },\n\n isUndefined: function (obj) {\n return typeof obj == 'undefined';\n },\n\n isNumber: function (f) {\n return !isNaN(parseInt(f));\n },\n\n isEmptyObj: function (obj) {\n for (const prop in obj) {\n if (Object.hasOwnProperty.call(obj, prop)) return false;\n }\n\n return JSON.stringify(obj) === JSON.stringify({});\n },\n\n isPlainObject: function (obj) {\n if (typeof obj !== 'object' || obj === null) return false;\n\n return Object.getPrototypeOf(obj) === Object.prototype;\n },\n\n isNotObject: function (obj) {\n return !obj || !this.isPlainObject(obj);\n },\n\n isEmptyArray: function (arr) {\n return Array.isArray(arr) && arr.length == 0;\n },\n\n isNotArray: function (arr) {\n return Array.isArray(arr) == false;\n },\n\n removeEmptyArrayItem: function (arr) {\n return arr.filter(function (el) {\n return el != null && el != '';\n });\n },\n\n getFieldName: function (field, prefix, isRoot, isArrayItem, isArray) {\n if (isArray)\n return (\n (prefix ? prefix : '') +\n (dotize.isNumber(field)\n ? '[' + field + ']'\n : (isRoot && !prefix ? '' : '.') + field)\n );\n else if (isArrayItem) return (prefix ? prefix : '') + '[' + field + ']';\n else return (prefix ? prefix + '.' : '') + field;\n },\n\n startsWith: function (val, valToSearch) {\n return val.indexOf(valToSearch) == 0;\n },\n\n convert: function (obj, prefix = '') {\n let newObj = {};\n\n // primitives\n if (dotize.isNotObject(obj)) {\n if (prefix) {\n newObj[prefix] = obj;\n return newObj;\n } else {\n return obj;\n }\n }\n\n return (function recurse(o, p, isRoot) {\n const isArrayItem = Array.isArray(o);\n for (const f in o) {\n const currentProp = o[f];\n if (\n currentProp &&\n typeof currentProp === 'object' &&\n !Array.isArray(currentProp) &&\n dotize.isPlainObject(currentProp)\n ) {\n if (isArrayItem && dotize.isEmptyObj(currentProp) == false) {\n newObj = recurse(\n currentProp,\n dotize.getFieldName(f, p, isRoot, true),\n ); // array item object\n } else if (dotize.isEmptyObj(currentProp) == false) {\n newObj = recurse(currentProp, dotize.getFieldName(f, p, isRoot)); // object\n } else if (dotize.isEmptyObj(currentProp)) {\n newObj[dotize.getFieldName(f, p, isRoot, isArrayItem)] =\n currentProp;\n }\n } else {\n if (isArrayItem || dotize.isNumber(f)) {\n newObj[dotize.getFieldName(f, p, isRoot, true)] = currentProp; // array item primitive\n } else {\n newObj[dotize.getFieldName(f, p, isRoot)] = currentProp; // primitive\n }\n }\n }\n\n return newObj;\n })(obj, prefix, true);\n },\n\n backward: function (obj, prefix) {\n let newObj = {};\n const arStartRegex = /\\[(\\d+)\\]/g;\n\n // primitives\n if (dotize.isNotObject(obj) && dotize.isNotArray(obj)) {\n if (prefix) {\n return obj[prefix];\n } else {\n return obj;\n }\n }\n\n for (let tProp in obj) {\n const tPropVal = obj[tProp];\n\n if (prefix) {\n const prefixRegex = new RegExp('^' + prefix);\n tProp = tProp.replace(prefixRegex, '');\n }\n\n tProp = tProp.replace(arStartRegex, '.$1');\n\n if (dotize.startsWith(tProp, '.')) tProp = tProp.replace(/^\\./, '');\n\n const arrPath = tProp.split('.');\n const arrPathTypes = dotize.getPathType(arrPath);\n\n // has array on root\n if (\n !dotize.isUndefined(arrPathTypes) &&\n arrPathTypes[0] == dotize.valTypes.array &&\n Array.isArray(newObj) == false\n ) {\n newObj = [];\n }\n\n (function recurse(rPropVal, rObj, rPropValPrev, rObjPrev) {\n let currentPath = arrPath.shift();\n const currentPathType = arrPathTypes.shift();\n\n if (typeof currentPath == 'undefined' || currentPath == '') {\n newObj = rPropVal;\n return;\n }\n\n const isArray = currentPathType == dotize.valTypes.array;\n\n if (dotize.isNumber(currentPath)) currentPath = parseInt(currentPath);\n\n // has multiple levels\n if (arrPath.length > 0) {\n // is not assigned before\n if (typeof rObj[currentPath] == 'undefined') {\n if (isArray) {\n rObj[currentPath] = [];\n } else {\n rObj[currentPath] = {};\n }\n }\n\n recurse(rPropVal, rObj[currentPath], currentPath, rObj);\n return;\n }\n\n if (\n currentPathType == dotize.valTypes.array &&\n rPropValPrev &&\n rObjPrev\n ) {\n if (Array.isArray(rObjPrev[rPropValPrev]) == false)\n rObjPrev[rPropValPrev] = [];\n rObjPrev[rPropValPrev].push(rPropVal);\n } else {\n rObj[currentPath] = rPropVal;\n }\n })(tPropVal, newObj);\n }\n\n return newObj;\n },\n};\n","import type { Tokens, TokenValue } from '../types';\n\nimport type { CSSProperties } from './css-types';\n\nimport { normalizeDslName } from './string';\nimport { normalizeColorTokenValue, parseStyle } from './styles';\n\nexport { hslToRgbValues } from './color-math';\n\nconst devMode = process.env.NODE_ENV !== 'production';\n\n/**\n * Check if a value is a valid token value (string, number, or boolean - not object).\n * Returns false for `false` values (they mean \"skip this token\").\n */\nfunction isValidTokenValue(\n value: unknown,\n): value is Exclude<TokenValue, undefined | null | false> {\n if (value === undefined || value === null || value === false) {\n return false;\n }\n\n if (typeof value === 'object') {\n if (devMode) {\n console.warn(\n '[Tasty] Object values are not allowed in tokens prop. ' +\n 'Tokens do not support state-based styling. Use a primitive value instead.',\n );\n }\n return false;\n }\n\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean'\n );\n}\n\n/**\n * Process a single token value through the tasty parser.\n * Numbers are converted to strings; 0 stays as \"0\".\n */\nfunction processTokenValue(value: string | number): string {\n if (typeof value === 'number') {\n // 0 should remain as \"0\", not converted to any unit\n if (value === 0) {\n return '0';\n }\n return parseStyle(String(value)).output;\n }\n return parseStyle(value).output;\n}\n\n/**\n * Resolve one `$name` / `#name` entry to the custom property it declares and\n * the value to declare, or `null` when the entry declares nothing.\n *\n * The two sigils differ only in the property name they build and in how `true`\n * is read: for a custom property it is the empty value, for a color it is\n * `transparent`.\n */\nfunction resolveTokenEntry(\n key: string,\n value: Exclude<TokenValue, undefined | null | false>,\n): [name: string, value: string] | null {\n const name = `--${normalizeDslName(key.slice(1))}`;\n\n if (key[0] === '$') {\n // Boolean true for custom properties converts to empty string (valid CSS value)\n return [name, processTokenValue(value === true ? '' : value)];\n }\n\n const colorValue = normalizeColorTokenValue(value);\n // Skip if normalized to null (shouldn't happen since false is filtered by isValidTokenValue)\n if (colorValue === null) return null;\n\n return [`${name}-color`, processTokenValue(colorValue)];\n}\n\n/**\n * Process tokens object into inline style properties.\n * - `$name` -> `--name` with the parsed value\n * - `#name` -> `--name-color` with the parsed value\n *\n * @param tokens - The tokens object to process\n * @returns CSSProperties object or undefined if no tokens to process\n */\nexport function processTokens(\n tokens: Tokens | undefined,\n): CSSProperties | undefined {\n if (!tokens) {\n return undefined;\n }\n\n const keys = Object.keys(tokens);\n if (keys.length === 0) {\n return undefined;\n }\n\n let result: Record<string, string> | undefined;\n\n for (const key of keys) {\n const value = tokens[key as keyof Tokens];\n\n // Skip undefined/null values\n if (!isValidTokenValue(value)) {\n continue;\n }\n\n if (key[0] !== '$' && key[0] !== '#') continue;\n\n const entry = resolveTokenEntry(key, value);\n if (!entry) continue;\n\n if (!result) result = {};\n result[entry[0]] = entry[1];\n }\n\n return result as CSSProperties | undefined;\n}\n","/* eslint-disable no-console */\nimport { CHUNK_NAMES } from './chunks/definitions';\nimport { getNamePrefix } from './config';\nimport { getCSSTextForNode, injector } from './injector';\nimport type { CacheMetrics, RootRegistry } from './injector/types';\nimport { isDevEnv } from './utils/is-dev-env';\nimport { tastyClassRegex } from './utils/name-prefix';\n\ndeclare global {\n interface Window {\n tastyDebug?: typeof tastyDebug;\n }\n}\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\ntype CSSTarget =\n | 'all'\n | 'global'\n | 'active'\n | 'unused'\n | 'page'\n | string\n | string[]\n | Element;\n\nexport interface DebugOptions {\n root?: Document | ShadowRoot;\n /** Suppress console logging and return data only (default: false) */\n raw?: boolean;\n}\n\nexport interface CSSOptions extends DebugOptions {\n prettify?: boolean;\n /** Read from stored source CSS (dev-mode only) instead of live CSSOM */\n source?: boolean;\n}\n\nexport interface DebugChunkInfo {\n className: string;\n chunkName: string | null;\n}\n\nexport interface InspectResult {\n element?: Element | null;\n classes: string[];\n chunks: DebugChunkInfo[];\n css: string;\n size: number;\n rules: number;\n}\n\nexport interface CacheStatus {\n classes: {\n active: string[];\n unused: string[];\n all: string[];\n };\n metrics: CacheMetrics | null;\n}\n\nexport interface ChunkBreakdown {\n byChunk: Record<\n string,\n { classes: string[]; cssSize: number; ruleCount: number }\n >;\n totalChunkTypes: number;\n totalClasses: number;\n}\n\nexport interface Summary {\n activeClasses: string[];\n unusedClasses: string[];\n totalStyledClasses: string[];\n\n activeCSSSize: number;\n unusedCSSSize: number;\n globalCSSSize: number;\n rawCSSSize: number;\n keyframesCSSSize: number;\n propertyCSSSize: number;\n totalCSSSize: number;\n\n activeRuleCount: number;\n unusedRuleCount: number;\n globalRuleCount: number;\n rawRuleCount: number;\n keyframesRuleCount: number;\n propertyRuleCount: number;\n totalRuleCount: number;\n\n metrics: CacheMetrics | null;\n definedProperties: string[];\n definedKeyframes: { name: string; refCount: number }[];\n chunkBreakdown: ChunkBreakdown;\n}\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nfunction fmtSize(bytes: number): string {\n return bytes > 1024 ? `${(bytes / 1024).toFixed(1)}KB` : `${bytes}B`;\n}\n\nfunction countRules(css: string): number {\n return (css.match(/\\{[^}]*\\}/g) || []).length;\n}\n\nfunction sortTastyClasses(classes: Iterable<string>): string[] {\n // Class names use a base36 hash format (e.g. `t3a5f`), so sort lexicographically.\n return Array.from(classes).sort((a, b) => a.localeCompare(b));\n}\n\nfunction getRegistry(\n root: Document | ShadowRoot = document,\n): RootRegistry | undefined {\n return injector.instance._sheetManager?.getRegistry(root);\n}\n\nfunction getUnusedClasses(root: Document | ShadowRoot = document): string[] {\n const registry = getRegistry(root);\n if (!registry) return [];\n const result: string[] = [];\n for (const [cls, rc] of registry.refCounts as Map<string, number>) {\n if (rc === 0) result.push(cls);\n }\n return sortTastyClasses(result);\n}\n\nfunction findDomTastyClasses(root: Document | ShadowRoot = document): string[] {\n const classes = new Set<string>();\n const elements = (root as Document).querySelectorAll?.('[class]') || [];\n const classRegex = tastyClassRegex(getNamePrefix());\n elements.forEach((el) => {\n const attr = el.getAttribute('class');\n if (attr) {\n for (const cls of attr.split(/\\s+/)) {\n if (classRegex.test(cls)) classes.add(cls);\n }\n }\n });\n return sortTastyClasses(classes);\n}\n\n// ---------------------------------------------------------------------------\n// prettifyCSS — readable output for nested at-rules & comma selectors\n// ---------------------------------------------------------------------------\n\nfunction prettifyCSS(css: string): string {\n if (!css || !css.trim()) return '';\n\n const out: string[] = [];\n let depth = 0;\n const indent = () => ' '.repeat(depth);\n\n let normalized = css.replace(/\\s+/g, ' ').trim();\n // Ensure braces are surrounded by spaces for splitting\n normalized = normalized.replace(/\\s*\\{\\s*/g, ' { ');\n normalized = normalized.replace(/\\s*\\}\\s*/g, ' } ');\n normalized = normalized.replace(/;\\s*/g, '; ');\n\n const tokens = normalized.split(/\\s+/);\n let buf = '';\n\n for (const t of tokens) {\n if (t === '{') {\n // buf contains the selector / at-rule header\n const header = buf.trim();\n if (header) {\n // Split comma-separated selectors onto their own lines\n // but only if the comma is outside parentheses\n const parts = splitOutsideParens(header, ',');\n if (parts.length > 1) {\n out.push(\n parts\n .map((p, idx) =>\n idx === 0\n ? `${indent()}${p.trim()},`\n : `${indent()}${p.trim()}${idx < parts.length - 1 ? ',' : ''}`,\n )\n .join('\\n') + ' {',\n );\n } else {\n out.push(`${indent()}${header} {`);\n }\n } else {\n out.push(`${indent()}{`);\n }\n depth++;\n buf = '';\n } else if (t === '}') {\n // Flush any trailing declarations\n if (buf.trim()) {\n for (const decl of buf.split(';').filter((s) => s.trim())) {\n out.push(`${indent()}${decl.trim()};`);\n }\n buf = '';\n }\n depth = Math.max(0, depth - 1);\n out.push(`${indent()}}`);\n } else if (t.endsWith(';')) {\n buf += ` ${t}`;\n const full = buf.trim();\n if (full) out.push(`${indent()}${full}`);\n buf = '';\n } else {\n buf += ` ${t}`;\n }\n }\n if (buf.trim()) out.push(buf.trim());\n\n return out\n .filter((l) => l.trim())\n .join('\\n')\n .replace(/\\n{3,}/g, '\\n\\n')\n .trim();\n}\n\n/** Split `str` by `sep` only when not inside parentheses */\nfunction splitOutsideParens(str: string, sep: string): string[] {\n const parts: string[] = [];\n let depth = 0;\n let start = 0;\n for (let i = 0; i < str.length; i++) {\n const ch = str[i];\n if (ch === '(') depth++;\n else if (ch === ')') depth--;\n else if (depth === 0 && str.startsWith(sep, i)) {\n parts.push(str.slice(start, i));\n start = i + sep.length;\n }\n }\n parts.push(str.slice(start));\n return parts;\n}\n\n// ---------------------------------------------------------------------------\n// Chunk helpers\n// ---------------------------------------------------------------------------\n\nfunction extractChunkName(cacheKey: string): string | null {\n for (const part of cacheKey.split('\\0')) {\n if (part.startsWith('[states:')) continue;\n if (!part.includes(':') && part.length > 0) return part;\n }\n return null;\n}\n\nfunction getChunkForClass(\n className: string,\n root: Document | ShadowRoot = document,\n): string | null {\n const registry = getRegistry(root);\n if (!registry) return null;\n for (const [key, cn] of registry.cacheKeyToClassName) {\n if (cn === className) return extractChunkName(key);\n }\n return null;\n}\n\nfunction buildChunkBreakdown(\n root: Document | ShadowRoot = document,\n): ChunkBreakdown {\n const registry = getRegistry(root);\n if (!registry) return { byChunk: {}, totalChunkTypes: 0, totalClasses: 0 };\n\n const byChunk: ChunkBreakdown['byChunk'] = {};\n for (const [cacheKey, className] of registry.cacheKeyToClassName) {\n const chunk = extractChunkName(cacheKey) || 'unknown';\n if (!byChunk[chunk])\n byChunk[chunk] = { classes: [], cssSize: 0, ruleCount: 0 };\n byChunk[chunk].classes.push(className);\n const css = injector.instance.getCSSTextForClasses([className], { root });\n byChunk[chunk].cssSize += css.length;\n byChunk[chunk].ruleCount += countRules(css);\n }\n\n for (const entry of Object.values(byChunk)) {\n entry.classes = sortTastyClasses(entry.classes);\n }\n\n const totalClasses = Object.values(byChunk).reduce(\n (s, e) => s + e.classes.length,\n 0,\n );\n return {\n byChunk,\n totalChunkTypes: Object.keys(byChunk).length,\n totalClasses,\n };\n}\n\n// ---------------------------------------------------------------------------\n// Global-type CSS helper (internal only)\n// ---------------------------------------------------------------------------\n\nfunction getGlobalTypeCSS(\n type: 'global' | 'raw' | 'keyframes' | 'property',\n root: Document | ShadowRoot = document,\n): { css: string; ruleCount: number; size: number } {\n const registry = getRegistry(root);\n if (!registry) return { css: '', ruleCount: 0, size: 0 };\n\n const chunks: string[] = [];\n let rc = 0;\n\n if (type === 'keyframes') {\n for (const [, entry] of registry.keyframesCache) {\n const info = entry.info;\n const sheetInfo = registry.sheets[info.sheetIndex];\n const sm = injector.instance._sheetManager;\n const ss = sheetInfo && sm ? sm.getCSSSheet(sheetInfo) : null;\n if (ss && info.ruleIndex < ss.cssRules.length) {\n const rule = ss.cssRules[info.ruleIndex];\n if (rule) {\n chunks.push(rule.cssText);\n rc++;\n }\n } else if (info.cssText) {\n chunks.push(info.cssText);\n rc++;\n }\n }\n } else {\n const prefix =\n type === 'global' ? 'global:' : type === 'raw' ? 'raw:' : 'property:';\n for (const [key, ri] of registry.globalRules) {\n if (!key.startsWith(prefix)) continue;\n const sheetInfo = registry.sheets[ri.sheetIndex];\n const sm = injector.instance._sheetManager;\n const ss = sheetInfo && sm ? sm.getCSSSheet(sheetInfo) : null;\n if (ss) {\n const start = Math.max(0, ri.ruleIndex);\n const end = Math.min(\n ss.cssRules.length - 1,\n (ri.endRuleIndex as number) ?? ri.ruleIndex,\n );\n if (start >= 0 && end >= start && start < ss.cssRules.length) {\n for (let i = start; i <= end; i++) {\n const rule = ss.cssRules[i];\n if (rule) {\n chunks.push(rule.cssText);\n rc++;\n }\n }\n }\n } else if (ri.cssText?.length) {\n chunks.push(...ri.cssText);\n rc += ri.cssText.length;\n }\n }\n }\n\n const raw = chunks.join('\\n');\n return { css: prettifyCSS(raw), ruleCount: rc, size: raw.length };\n}\n\n// ---------------------------------------------------------------------------\n// Source CSS (dev-mode RuleInfo.cssText)\n// ---------------------------------------------------------------------------\n\nfunction getSourceCssForClasses(\n classNames: string[],\n root: Document | ShadowRoot = document,\n): string | null {\n const registry = getRegistry(root);\n if (!registry) return null;\n\n const chunks: string[] = [];\n let found = false;\n for (const cls of classNames) {\n const info = registry.rules.get(cls);\n if (info?.cssText?.length) {\n chunks.push(...info.cssText);\n found = true;\n }\n }\n return found ? chunks.join('\\n') : null;\n}\n\n// ---------------------------------------------------------------------------\n// Definitions helper (internal)\n// ---------------------------------------------------------------------------\n\nfunction getDefs(root: Document | ShadowRoot = document) {\n const registry = getRegistry(root);\n let properties: string[] = [];\n if (registry?.injectedProperties) {\n properties = Array.from(\n (registry.injectedProperties as Map<string, string>).keys(),\n ).sort();\n }\n\n const keyframes: { name: string; refCount: number }[] = [];\n if (registry) {\n for (const entry of registry.keyframesCache.values()) {\n keyframes.push({ name: entry.name, refCount: entry.refCount });\n }\n keyframes.sort((a, b) => a.name.localeCompare(b.name));\n }\n\n return { properties, keyframes };\n}\n\n// ---------------------------------------------------------------------------\n// Chunk display order\n// ---------------------------------------------------------------------------\n\nconst CHUNK_ORDER = [\n CHUNK_NAMES.COMBINED,\n CHUNK_NAMES.APPEARANCE,\n CHUNK_NAMES.FONT,\n CHUNK_NAMES.DIMENSION,\n CHUNK_NAMES.DISPLAY,\n CHUNK_NAMES.LAYOUT,\n CHUNK_NAMES.POSITION,\n CHUNK_NAMES.MISC,\n CHUNK_NAMES.SUBCOMPONENTS,\n];\n\n// ---------------------------------------------------------------------------\n// tastyDebug API\n// ---------------------------------------------------------------------------\n\nexport const tastyDebug = {\n css(target: CSSTarget, opts?: CSSOptions): string {\n const {\n root = document,\n prettify = true,\n raw = false,\n source = false,\n } = opts || {};\n let css = '';\n\n const classRegex = tastyClassRegex(getNamePrefix());\n if (source && typeof target === 'string' && classRegex.test(target)) {\n const src = getSourceCssForClasses([target], root);\n if (src) {\n css = src;\n } else {\n if (!raw) {\n console.warn(\n '[Tasty] source CSS not available (requires dev mode or TASTY_DEBUG=true). Falling back to live CSSOM.',\n );\n }\n css = injector.instance.getCSSTextForClasses([target], { root });\n }\n } else if (source && Array.isArray(target)) {\n const src = getSourceCssForClasses(target, root);\n if (src) {\n css = src;\n } else {\n if (!raw) {\n console.warn(\n '[Tasty] source CSS not available. Falling back to live CSSOM.',\n );\n }\n css = injector.instance.getCSSTextForClasses(target, { root });\n }\n } else if (typeof target === 'string') {\n if (target === 'all') {\n css = injector.instance.getCSSText({ root });\n } else if (target === 'global') {\n css = getGlobalTypeCSS('global', root).css;\n return css; // already prettified\n } else if (target === 'active') {\n const active = findDomTastyClasses(root);\n css = injector.instance.getCSSTextForClasses(active, { root });\n } else if (target === 'unused') {\n const unused = getUnusedClasses(root);\n css = injector.instance.getCSSTextForClasses(unused, { root });\n } else if (target === 'page') {\n css = getPageCSS(root);\n } else if (classRegex.test(target)) {\n css = injector.instance.getCSSTextForClasses([target], { root });\n } else {\n const el = (root as Document).querySelector?.(target);\n if (el) css = getCSSTextForNode(el, { root });\n }\n } else if (Array.isArray(target)) {\n css = injector.instance.getCSSTextForClasses(target, { root });\n } else if (target instanceof Element) {\n css = getCSSTextForNode(target, { root });\n }\n\n const result = prettify ? prettifyCSS(css) : css;\n\n if (!raw) {\n const label = Array.isArray(target) ? `[${target.join(', ')}]` : target;\n const rc = countRules(css);\n console.group(`CSS for ${label} (${rc} rules, ${fmtSize(css.length)})`);\n console.log(result || '(empty)');\n console.groupEnd();\n }\n\n return result;\n },\n\n inspect(target: string | Element, opts?: DebugOptions): InspectResult {\n const { root = document, raw = false } = opts || {};\n const element =\n typeof target === 'string'\n ? (root as Document).querySelector?.(target)\n : target;\n\n if (!element) {\n const empty: InspectResult = {\n element: null,\n classes: [],\n chunks: [],\n css: '',\n size: 0,\n rules: 0,\n };\n if (!raw) console.warn('[Tasty] debug.inspect: element not found');\n return empty;\n }\n\n const classList = element.getAttribute('class') || '';\n const classRegex = tastyClassRegex(getNamePrefix());\n const tastyClasses = classList\n .split(/\\s+/)\n .filter((cls) => classRegex.test(cls));\n\n const chunks: DebugChunkInfo[] = tastyClasses.map((className) => ({\n className,\n chunkName: getChunkForClass(className, root),\n }));\n\n const css = getCSSTextForNode(element, { root });\n const rules = countRules(css);\n\n const result: InspectResult = {\n element,\n classes: tastyClasses,\n chunks,\n css: prettifyCSS(css),\n size: css.length,\n rules,\n };\n\n if (!raw) {\n const tag = element.tagName.toLowerCase();\n const id = element.id ? `#${element.id}` : '';\n console.group(\n `inspect ${tag}${id} — ${tastyClasses.length} classes, ${rules} rules, ${fmtSize(css.length)}`,\n );\n if (chunks.length) {\n console.log(\n 'Chunks:',\n chunks.map((c) => `${c.className}→${c.chunkName || '?'}`).join(', '),\n );\n }\n console.groupCollapsed('CSS');\n console.log(result.css || '(empty)');\n console.groupEnd();\n console.groupEnd();\n }\n\n return result;\n },\n\n summary(opts?: DebugOptions): Summary {\n const { root = document, raw = false } = opts || {};\n\n const activeClasses = findDomTastyClasses(root);\n const unusedClasses = getUnusedClasses(root);\n const totalStyledClasses = [...activeClasses, ...unusedClasses];\n\n const activeCSS = injector.instance.getCSSTextForClasses(activeClasses, {\n root,\n });\n const unusedCSS = injector.instance.getCSSTextForClasses(unusedClasses, {\n root,\n });\n const allCSS = injector.instance.getCSSText({ root });\n\n const activeRuleCount = countRules(activeCSS);\n const unusedRuleCount = countRules(unusedCSS);\n\n const globalData = getGlobalTypeCSS('global', root);\n const rawData = getGlobalTypeCSS('raw', root);\n const kfData = getGlobalTypeCSS('keyframes', root);\n const propData = getGlobalTypeCSS('property', root);\n\n const totalRuleCount =\n activeRuleCount +\n unusedRuleCount +\n globalData.ruleCount +\n rawData.ruleCount +\n kfData.ruleCount +\n propData.ruleCount;\n\n const metrics = injector.instance.getMetrics({ root });\n const defs = getDefs(root);\n const chunkBreakdown = buildChunkBreakdown(root);\n\n const summary: Summary = {\n activeClasses,\n unusedClasses,\n totalStyledClasses,\n activeCSSSize: activeCSS.length,\n unusedCSSSize: unusedCSS.length,\n globalCSSSize: globalData.size,\n rawCSSSize: rawData.size,\n keyframesCSSSize: kfData.size,\n propertyCSSSize: propData.size,\n totalCSSSize: allCSS.length,\n activeRuleCount,\n unusedRuleCount,\n globalRuleCount: globalData.ruleCount,\n rawRuleCount: rawData.ruleCount,\n keyframesRuleCount: kfData.ruleCount,\n propertyRuleCount: propData.ruleCount,\n totalRuleCount,\n metrics,\n definedProperties: defs.properties,\n definedKeyframes: defs.keyframes,\n chunkBreakdown,\n };\n\n if (!raw) {\n console.group('Tasty Summary');\n console.log(\n `Active: ${activeClasses.length} classes, ${activeRuleCount} rules, ${fmtSize(activeCSS.length)}`,\n );\n console.log(\n `Unused: ${unusedClasses.length} classes, ${unusedRuleCount} rules, ${fmtSize(unusedCSS.length)}`,\n );\n console.log(\n `Global: ${globalData.ruleCount} rules, ${fmtSize(globalData.size)}`,\n );\n if (rawData.ruleCount)\n console.log(\n `Raw: ${rawData.ruleCount} rules, ${fmtSize(rawData.size)}`,\n );\n if (kfData.ruleCount)\n console.log(\n `Keyframes: ${kfData.ruleCount} rules, ${fmtSize(kfData.size)}`,\n );\n if (propData.ruleCount)\n console.log(\n `@property: ${propData.ruleCount} rules, ${fmtSize(propData.size)}`,\n );\n console.log(\n `Total: ${totalStyledClasses.length} classes, ${totalRuleCount} rules, ${fmtSize(allCSS.length)}`,\n );\n\n if (metrics) {\n const total = metrics.hits + metrics.misses;\n const rate = total > 0 ? ((metrics.hits / total) * 100).toFixed(1) : 0;\n console.log(`Cache: ${rate}% hit rate (${total} lookups)`);\n }\n\n if (chunkBreakdown.totalChunkTypes > 0) {\n console.groupCollapsed(\n `Chunks (${chunkBreakdown.totalChunkTypes} types, ${chunkBreakdown.totalClasses} classes)`,\n );\n for (const name of CHUNK_ORDER) {\n const d = chunkBreakdown.byChunk[name];\n if (d)\n console.log(\n ` ${name}: ${d.classes.length} cls, ${d.ruleCount} rules, ${fmtSize(d.cssSize)}`,\n );\n }\n for (const [name, d] of Object.entries(chunkBreakdown.byChunk)) {\n if (!CHUNK_ORDER.includes(name as (typeof CHUNK_ORDER)[number]))\n console.log(\n ` ${name}: ${d.classes.length} cls, ${d.ruleCount} rules, ${fmtSize(d.cssSize)}`,\n );\n }\n console.groupEnd();\n }\n\n if (defs.properties.length || defs.keyframes.length) {\n console.log(\n `Defs: ${defs.properties.length} @property, ${defs.keyframes.length} @keyframes`,\n );\n }\n\n console.groupEnd();\n }\n\n return summary;\n },\n\n chunks(opts?: DebugOptions): ChunkBreakdown {\n const { root = document, raw = false } = opts || {};\n const breakdown = buildChunkBreakdown(root);\n\n if (!raw) {\n console.group(\n `Chunks (${breakdown.totalChunkTypes} types, ${breakdown.totalClasses} classes)`,\n );\n for (const name of CHUNK_ORDER) {\n const d = breakdown.byChunk[name];\n if (d)\n console.log(\n ` ${name}: ${d.classes.length} cls, ${d.ruleCount} rules, ${fmtSize(d.cssSize)}`,\n );\n }\n for (const [name, d] of Object.entries(breakdown.byChunk)) {\n if (!CHUNK_ORDER.includes(name as (typeof CHUNK_ORDER)[number]))\n console.log(\n ` ${name}: ${d.classes.length} cls, ${d.ruleCount} rules, ${fmtSize(d.cssSize)}`,\n );\n }\n console.groupEnd();\n }\n\n return breakdown;\n },\n\n cache(opts?: DebugOptions): CacheStatus {\n const { root = document, raw = false } = opts || {};\n const active = findDomTastyClasses(root);\n const unused = getUnusedClasses(root);\n const metrics = injector.instance.getMetrics({ root });\n\n const status: CacheStatus = {\n classes: { active, unused, all: [...active, ...unused] },\n metrics,\n };\n\n if (!raw) {\n console.group('Cache');\n console.log(`Active: ${active.length}, Unused: ${unused.length}`);\n if (metrics) {\n const total = metrics.hits + metrics.misses;\n const rate = total > 0 ? ((metrics.hits / total) * 100).toFixed(1) : 0;\n console.log(\n `Hits: ${metrics.hits}, Misses: ${metrics.misses}, Rate: ${rate}%`,\n );\n }\n console.groupEnd();\n }\n\n return status;\n },\n\n cleanup(opts?: { root?: Document | ShadowRoot }): void {\n injector.instance.cleanup(opts?.root);\n },\n\n help(): void {\n console.log(`tastyDebug API:\n .summary() — overview (classes, rules, sizes)\n .css(\"active\") — CSS for classes in DOM\n .css(\"t42\") — CSS for a specific class\n .css(\"t42\",{source:1})— original CSS before browser parsing (dev only)\n .css(\".selector\") — CSS for a DOM element\n .inspect(\".selector\") — element details (classes, chunks, rules)\n .chunks() — style chunk breakdown\n .cache() — cache status and metrics\n .cleanup() — force unused style cleanup\nOptions: { raw: true } suppresses logging, { root: shadowRoot } targets Shadow DOM`);\n },\n\n install(): void {\n if (typeof window !== 'undefined' && window.tastyDebug !== tastyDebug) {\n window.tastyDebug = tastyDebug;\n console.log('tastyDebug installed. Run tastyDebug.help() for commands.');\n }\n },\n};\n\n// ---------------------------------------------------------------------------\n// Page CSS (minimal, kept internal)\n// ---------------------------------------------------------------------------\n\nfunction getPageCSS(root: Document | ShadowRoot = document): string {\n const chunks: string[] = [];\n try {\n if ('styleSheets' in root) {\n for (const sheet of Array.from((root as Document).styleSheets)) {\n try {\n if (sheet.cssRules)\n chunks.push(\n Array.from(sheet.cssRules)\n .map((r) => r.cssText)\n .join('\\n'),\n );\n } catch {\n /* cross-origin */\n }\n }\n }\n } catch {\n /* ignore */\n }\n return chunks.join('\\n');\n}\n\n// ---------------------------------------------------------------------------\n// Auto-install in development\n// ---------------------------------------------------------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,OAAO;GACrB,QAAQ,IAAI,WAAW,OAAO,OAAO,YAAY,OAAO,QAAQ;GAChE,IAAI,SAAS;IACX,MAAM,QAAQ,QAAQ,OAAO,QAAQ;IACrC,MAAM,OAAO,QAAQ,KAAM,QAAQ,OAAO,QAAS,IAAA,CAAK,QAAQ,CAAC,IAAI;IACrE,QAAQ,IACN,SAAS,QAAQ,KAAK,YAAY,QAAQ,OAAO,UAAU,KAAK,EAClE;GACF;GACA,QAAQ,SAAS;EACnB;EAEA,OAAO;CACT;CAEA,QAAQ,MAA+C;EACrD,SAAS,SAAS,QAAQ,MAAM,IAAI;CACtC;CAEA,OAAa;EACX,QAAQ,IAAI;;;;;;;;;;mFAUmE;CACjF;CAEA,UAAgB;EACd,IAAI,OAAO,WAAW,eAAe,OAAO,eAAe,YAAY;GACrE,OAAO,aAAa;GACpB,QAAQ,IAAI,2DAA2D;EACzE;CACF;AACF;AAMA,SAAS,WAAW,OAA8B,UAAkB;CAClE,MAAM,SAAmB,CAAC;CAC1B,IAAI;EACF,IAAI,iBAAiB,MACnB,KAAK,MAAM,SAAS,MAAM,KAAM,KAAkB,WAAW,GAC3D,IAAI;GACF,IAAI,MAAM,UACR,OAAO,KACL,MAAM,KAAK,MAAM,QAAQ,CAAC,CACvB,KAAK,MAAM,EAAE,OAAO,CAAC,CACrB,KAAK,IAAI,CACd;EACJ,QAAQ,CAER;CAGN,QAAQ,CAER;CACA,OAAO,OAAO,KAAK,IAAI;AACzB;AAMA,IAAI,OAAO,WAAW,eAAe,SAAS,GAC5C,WAAW,QAAQ"}
@@ -1,5 +1,5 @@
1
- import { Ft as registerFunctionPolyfill, It as registerLocalFunctionPolyfills, J as hasLocalCounterStyle, K as extractLocalCounterStyle, L as renderStyles, Mt as formatFunctionRule, Nt as hasLocalFunctions, Pt as parseFunctionName, Q as hasLocalFontFace, Y as extractLocalFontFace, Z as formatFontFaceRule, _ as isFunctionsPolyfillEnabled, bt as hasLocalProperties, ft as makeClassName, gt as validateNamePrefix, it as PropertyTypeResolver, jt as extractLocalFunctions, mt as makeKeyframeName, q as formatCounterStyleRule, vt as extractLocalProperties } from "./config-BCdCTIED.js";
2
- import { a as mergeKeyframes, c as generateChunkCacheKey, i as hasLocalKeyframes, l as categorizeStyleKeys, n as extractLocalKeyframes, r as filterUsedKeyframes, s as renderStylesForChunk, t as extractAnimationNamesFromStyles } from "./keyframes-D737PShJ.js";
1
+ import { Ft as registerFunctionPolyfill, It as registerLocalFunctionPolyfills, J as hasLocalCounterStyle, K as extractLocalCounterStyle, L as renderStyles, Mt as formatFunctionRule, Nt as hasLocalFunctions, Pt as parseFunctionName, Q as hasLocalFontFace, Y as extractLocalFontFace, Z as formatFontFaceRule, _ as isFunctionsPolyfillEnabled, bt as hasLocalProperties, ft as makeClassName, gt as validateNamePrefix, it as PropertyTypeResolver, jt as extractLocalFunctions, mt as makeKeyframeName, q as formatCounterStyleRule, vt as extractLocalProperties } from "./config-B5kHzuNz.js";
2
+ import { a as mergeKeyframes, c as generateChunkCacheKey, i as hasLocalKeyframes, l as categorizeStyleKeys, n as extractLocalKeyframes, r as filterUsedKeyframes, s as renderStylesForChunk, t as extractAnimationNamesFromStyles } from "./keyframes-CV8azJf3.js";
3
3
  import { createHash } from "crypto";
4
4
  import * as fs from "fs";
5
5
  import * as path from "path";
@@ -387,4 +387,4 @@ function createCSSWriter(outputPath, options) {
387
387
  //#endregion
388
388
  export { extractFunctionsFromStyles as a, extractStylesForSelector as c, extractFontFaceFromStyles as i, extractStylesWithChunks as l, createCSSWriter as n, extractKeyframesFromStyles as o, extractCounterStyleFromStyles as r, extractPropertiesFromStyles as s, CSSWriter as t, setExtractorNamePrefix as u };
389
389
 
390
- //# sourceMappingURL=css-writer-D64NY9AX.js.map
390
+ //# sourceMappingURL=css-writer-B-J87ncv.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"css-writer-D64NY9AX.js","names":[],"sources":["../src/zero/extractor.ts","../src/zero/css-writer.ts"],"sourcesContent":["import { createHash } from 'crypto';\n\nimport {\n categorizeStyleKeys,\n generateChunkCacheKey,\n renderStylesForChunk,\n} from '../chunks';\nimport type {\n CounterStyleDescriptors,\n FontFaceDescriptors,\n FontFaceInput,\n FunctionDefinition,\n KeyframesSteps,\n} from '../injector/types';\nimport {\n extractLocalCounterStyle,\n formatCounterStyleRule,\n hasLocalCounterStyle,\n} from '../counter-style';\nimport {\n extractLocalFontFace,\n formatFontFaceRule,\n hasLocalFontFace,\n} from '../font-face';\nimport { isFunctionsPolyfillEnabled } from '../config';\nimport {\n extractLocalFunctions,\n formatFunctionRule,\n hasLocalFunctions,\n parseFunctionName,\n registerFunctionPolyfill,\n registerLocalFunctionPolyfills,\n} from '../functions';\nimport {\n extractAnimationNamesFromStyles,\n extractLocalKeyframes,\n filterUsedKeyframes,\n hasLocalKeyframes,\n mergeKeyframes,\n} from '../keyframes';\nimport type { StyleResult } from '../pipeline';\nimport { renderStyles } from '../pipeline';\nimport { extractLocalProperties, hasLocalProperties } from '../properties';\nimport { PropertyTypeResolver } from '../properties/property-type-resolver';\nimport type { Styles } from '../styles/types';\nimport {\n DEFAULT_ZERO_NAME_PREFIX,\n makeClassName,\n makeKeyframeName,\n validateNamePrefix,\n} from '../utils/name-prefix';\n\nexport interface ExtractedChunk {\n className: string;\n css: string;\n}\n\nexport interface ExtractedSelector {\n selector: string;\n css: string;\n}\n\nexport interface ExtractedKeyframes {\n name: string;\n css: string;\n}\n\ninterface KeyframesExtractionResult {\n /** Keyframes to inject (deduplicated by content) */\n keyframes: ExtractedKeyframes[];\n /** Map from original animation name to canonical name (for replacement) */\n nameMap: Map<string, string>;\n}\n\n/**\n * Module-level prefix used by the zero-runtime extractor.\n * Defaults to `'ts'` so static classes never collide with the runtime\n * `'t'` classes when both are loaded on the same page. Override via\n * `setExtractorNamePrefix()` from the Babel plugin so user config flows\n * into the extractor.\n */\nlet currentNamePrefix: string = DEFAULT_ZERO_NAME_PREFIX;\n\n/**\n * Set the prefix used by the zero-runtime extractor.\n * Called by the Babel plugin after resolving user config so that\n * generated class and keyframe names match the user's configuration.\n */\nexport function setExtractorNamePrefix(prefix: string): void {\n validateNamePrefix(prefix);\n currentNamePrefix = prefix;\n}\n\n/**\n * Get the prefix currently used by the zero-runtime extractor.\n * Exposed primarily for tests.\n */\nexport function getExtractorNamePrefix(): string {\n return currentNamePrefix;\n}\n\n/**\n * Generate a deterministic className from a cache key using content hash.\n * This ensures the same styles always produce the same className,\n * regardless of build order or incremental compilation.\n */\nfunction generateClassName(cacheKey: string): string {\n const hash = createHash('md5').update(cacheKey).digest('hex').slice(0, 6);\n return makeClassName(currentNamePrefix, hash);\n}\n\n/**\n * Extract styles using chunking (for className mode).\n * Returns multiple classes, one per chunk.\n */\nexport function extractStylesWithChunks(styles: Styles): ExtractedChunk[] {\n const chunks: ExtractedChunk[] = [];\n\n // Categorize style keys into chunks\n const chunkMap = categorizeStyleKeys(styles as Record<string, unknown>);\n\n for (const [chunkName, chunkStyleKeys] of chunkMap) {\n if (chunkStyleKeys.length === 0) continue;\n\n // Generate cache key for this chunk (used for className hash)\n const cacheKey = generateChunkCacheKey(styles, chunkName, chunkStyleKeys);\n\n // Render styles for this chunk\n const renderResult = renderStylesForChunk(\n styles,\n chunkName,\n chunkStyleKeys,\n );\n\n if (renderResult.rules.length === 0) continue;\n\n // Generate deterministic className from content hash\n const className = generateClassName(cacheKey);\n const selector = `.${className}.${className}`;\n\n // Format CSS\n const css = formatRulesToCSS(renderResult.rules, selector);\n\n chunks.push({ className, css });\n }\n\n return chunks;\n}\n\n/**\n * Extract styles for a specific selector (for global/selector mode).\n * Returns a single CSS block.\n */\nexport function extractStylesForSelector(\n selector: string,\n styles: Styles,\n): ExtractedSelector {\n // renderStyles with selector returns StyleResult[] with selectors already applied\n const rules = renderStyles(styles, selector);\n // Format without re-prefixing - rules already have the full selector\n const css = formatRulesDirectly(rules);\n\n return { selector, css };\n}\n\n/**\n * Format StyleResult[] to CSS string.\n * Prefixes each rule's selector with the base selector.\n * Used for chunked styles where rules have relative selectors.\n */\nfunction formatRulesToCSS(rules: StyleResult[], baseSelector: string): string {\n return rules\n .map((rule) => {\n // Handle selector as array (OR conditions) or string\n // Note: renderStyles without className joins array selectors with '|||' placeholder\n const selectorParts = Array.isArray(rule.selector)\n ? rule.selector\n : rule.selector\n ? rule.selector.split('|||')\n : [''];\n\n // Prefix each selector part with the base selector\n const fullSelector = selectorParts\n .map((part) => {\n // Build selector: [rootPrefix] baseSelector[part]\n let selector: string;\n\n // If part is empty, just use base selector\n if (!part) {\n selector = baseSelector;\n } else if (part.startsWith(':') || part.startsWith('[')) {\n // If part starts with a pseudo-class or pseudo-element, append to base\n selector = `${baseSelector}${part}`;\n } else if (\n part.startsWith('>') ||\n part.startsWith('+') ||\n part.startsWith('~')\n ) {\n // If part starts with >, +, ~ combinator, append with space\n selector = `${baseSelector}${part}`;\n } else {\n // Otherwise, combine base with part\n selector = `${baseSelector}${part}`;\n }\n\n // Prepend rootPrefix if present (for @root() states)\n if (rule.rootPrefix) {\n selector = `${rule.rootPrefix} ${selector}`;\n }\n\n return selector;\n })\n .join(', ');\n\n let css = `${fullSelector} { ${rule.declarations} }`;\n\n // Wrap in at-rules (in reverse order for proper nesting)\n if (rule.atRules && rule.atRules.length > 0) {\n for (const atRule of [...rule.atRules].reverse()) {\n css = `${atRule} {\\n ${css}\\n}`;\n }\n }\n\n return css;\n })\n .join('\\n\\n');\n}\n\n/**\n * Format StyleResult[] to CSS string directly without prefixing.\n * Used for global styles where rules already have the full selector.\n */\nfunction formatRulesDirectly(rules: StyleResult[]): string {\n return rules\n .map((rule) => {\n // Prepend rootPrefix if present (for @root() states)\n const selector = rule.rootPrefix\n ? `${rule.rootPrefix} ${rule.selector}`\n : rule.selector;\n\n let css = `${selector} { ${rule.declarations} }`;\n\n // Wrap in at-rules (in reverse order for proper nesting)\n if (rule.atRules && rule.atRules.length > 0) {\n for (const atRule of [...rule.atRules].reverse()) {\n css = `${atRule} {\\n ${css}\\n}`;\n }\n }\n\n return css;\n })\n .join('\\n\\n');\n}\n\n// Note: With hash-based className generation, counter management functions\n// are no longer needed. ClassNames are deterministic based on content.\n\n/**\n * Generate a deterministic keyframes name from content hash.\n * This ensures the same keyframes content always produces the same name,\n * enabling automatic deduplication across elements and files.\n *\n * Uses the configured prefix with a `k` discriminator so keyframe names\n * stay visually distinct from class names sharing the same prefix.\n */\nfunction generateKeyframesName(steps: KeyframesSteps): string {\n const content = JSON.stringify(steps);\n const hash = createHash('md5').update(content).digest('hex').slice(0, 6);\n return makeKeyframeName(currentNamePrefix, hash);\n}\n\n/**\n * Extract keyframes that are used in styles.\n * Merges local @keyframes with global keyframes, filters to only used ones.\n * Generates hash-based names from content for automatic deduplication.\n *\n * @param styles - The styles object (may contain @keyframes and animation properties)\n * @param globalKeyframes - Optional global keyframes from config\n * @returns Keyframes to inject and name mapping for replacement\n */\nexport function extractKeyframesFromStyles(\n styles: Styles,\n globalKeyframes?: Record<string, KeyframesSteps> | null,\n): KeyframesExtractionResult {\n const emptyResult: KeyframesExtractionResult = {\n keyframes: [],\n nameMap: new Map(),\n };\n\n // Extract animation names from styles\n const usedNames = extractAnimationNamesFromStyles(styles);\n if (usedNames.size === 0) return emptyResult;\n\n // Merge local and global keyframes\n const local = hasLocalKeyframes(styles)\n ? extractLocalKeyframes(styles)\n : null;\n const allKeyframes = mergeKeyframes(local, globalKeyframes ?? null);\n\n // Filter to only used keyframes\n const usedKeyframes = filterUsedKeyframes(allKeyframes, usedNames);\n if (!usedKeyframes) return emptyResult;\n\n // Generate hash-based names and collect unique keyframes\n const seenHashes = new Set<string>();\n const nameMap = new Map<string, string>();\n const keyframesToEmit: ExtractedKeyframes[] = [];\n\n for (const [originalName, steps] of Object.entries(usedKeyframes)) {\n const hashedName = generateKeyframesName(steps);\n\n // Always map original name to hashed name (for CSS replacement)\n nameMap.set(originalName, hashedName);\n\n // Only emit each unique keyframe once\n if (!seenHashes.has(hashedName)) {\n seenHashes.add(hashedName);\n const css = keyframesToCSS(hashedName, steps);\n keyframesToEmit.push({ name: hashedName, css });\n }\n }\n\n return { keyframes: keyframesToEmit, nameMap };\n}\n\n/**\n * Convert keyframes steps to CSS string.\n */\nfunction keyframesToCSS(name: string, steps: KeyframesSteps): string {\n const stepRules: string[] = [];\n\n for (const [key, value] of Object.entries(steps)) {\n if (typeof value === 'string') {\n // Raw CSS string\n stepRules.push(`${key} { ${value.trim()} }`);\n } else if (value && typeof value === 'object') {\n // Style map - convert to CSS declarations\n const declarations = Object.entries(value)\n .map(([prop, val]) => {\n const cssProperty = camelToKebab(prop);\n return `${cssProperty}: ${val}`;\n })\n .join('; ');\n stepRules.push(`${key} { ${declarations} }`);\n }\n }\n\n return `@keyframes ${name} { ${stepRules.join(' ')} }`;\n}\n\n/**\n * Convert camelCase to kebab-case.\n */\nfunction camelToKebab(str: string): string {\n return str.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);\n}\n\n// ============================================================================\n// Property Extraction (auto-infer @property types for zero-runtime)\n// ============================================================================\n\nexport interface ExtractedProperty {\n name: string;\n css: string;\n}\n\n/**\n * Extract auto-inferred @property declarations from styles.\n * Scans rendered style declarations and keyframe declarations for custom properties\n * whose types can be inferred from their values.\n *\n * @param styles - The styles object\n * @param options - Options including autoPropertyTypes flag\n * @returns Array of @property CSS rules to inject\n */\nexport function extractPropertiesFromStyles(\n styles: Styles,\n options?: { autoPropertyTypes?: boolean },\n): ExtractedProperty[] {\n if (options?.autoPropertyTypes === false) return [];\n\n const registered = new Set<string>();\n const results: ExtractedProperty[] = [];\n\n // Collect explicitly declared properties (they take precedence)\n if (hasLocalProperties(styles)) {\n const localProps = extractLocalProperties(styles);\n if (localProps) {\n for (const token of Object.keys(localProps)) {\n // Normalize token to CSS name\n let cssName: string;\n if (token.startsWith('#')) {\n cssName = `--${token.slice(1)}-color`;\n } else if (token.startsWith('$')) {\n cssName = `--${token.slice(1)}`;\n } else if (token.startsWith('--')) {\n cssName = token;\n } else {\n cssName = `--${token}`;\n }\n registered.add(cssName);\n }\n }\n }\n\n const resolver = new PropertyTypeResolver();\n\n const registerProperty = (\n name: string,\n syntax: string,\n initialValue: string,\n ) => {\n if (registered.has(name)) return;\n registered.add(name);\n\n const parts: string[] = [];\n parts.push(`syntax: \"${syntax}\";`);\n parts.push(`inherits: true;`);\n parts.push(`initial-value: ${initialValue};`);\n\n const css = `@property ${name} { ${parts.join(' ')} }`;\n results.push({ name, css });\n };\n\n const isPropertyDefined = (name: string) => registered.has(name);\n\n // Scan rendered style declarations\n const chunkMap = categorizeStyleKeys(styles as Record<string, unknown>);\n for (const [chunkName, chunkStyleKeys] of chunkMap) {\n if (chunkStyleKeys.length === 0) continue;\n const renderResult = renderStylesForChunk(\n styles,\n chunkName,\n chunkStyleKeys,\n );\n for (const rule of renderResult.rules) {\n if (!rule.declarations) continue;\n resolver.scanDeclarations(\n rule.declarations,\n isPropertyDefined,\n registerProperty,\n );\n }\n }\n\n // Scan keyframe declarations\n if (hasLocalKeyframes(styles)) {\n const localKf = extractLocalKeyframes(styles);\n if (localKf) {\n for (const steps of Object.values(localKf)) {\n scanKeyframeSteps(steps, resolver, isPropertyDefined, registerProperty);\n }\n }\n }\n\n return results;\n}\n\nfunction scanKeyframeSteps(\n steps: KeyframesSteps,\n resolver: PropertyTypeResolver,\n isPropertyDefined: (name: string) => boolean,\n registerProperty: (\n name: string,\n syntax: string,\n initialValue: string,\n ) => void,\n): void {\n for (const value of Object.values(steps)) {\n if (typeof value === 'string') {\n resolver.scanDeclarations(value, isPropertyDefined, registerProperty);\n } else if (value && typeof value === 'object') {\n const declarations = Object.entries(value)\n .map(([prop, val]) => {\n const cssProperty = camelToKebab(prop);\n return `${cssProperty}: ${val}`;\n })\n .join('; ');\n resolver.scanDeclarations(\n declarations,\n isPropertyDefined,\n registerProperty,\n );\n }\n }\n}\n\n// ============================================================================\n// Font Face Extraction (zero-runtime)\n// ============================================================================\n\nexport interface ExtractedFontFace {\n css: string;\n}\n\n/**\n * Extract @font-face rules from styles, merging with global config.\n * Deduplicates by content hash.\n */\nexport function extractFontFaceFromStyles(\n styles: Styles,\n globalFontFace?: Record<string, FontFaceInput> | null,\n): ExtractedFontFace[] {\n const results: ExtractedFontFace[] = [];\n const seenHashes = new Set<string>();\n\n function addFontFace(family: string, input: FontFaceInput) {\n const descriptors: FontFaceDescriptors[] = Array.isArray(input)\n ? input\n : [input];\n for (const desc of descriptors) {\n const hash = createHash('md5')\n .update(JSON.stringify({ family, ...desc }))\n .digest('hex')\n .slice(0, 8);\n if (!seenHashes.has(hash)) {\n seenHashes.add(hash);\n results.push({ css: formatFontFaceRule(family, desc) });\n }\n }\n }\n\n // Global font faces first\n if (globalFontFace) {\n for (const [family, input] of Object.entries(globalFontFace)) {\n addFontFace(family, input);\n }\n }\n\n // Local font faces. @font-face is keyed by content hash, not family name, so\n // distinct definitions all emit and byte-identical ones collapse — there is\n // no \"winner\" to pick between a global and a local definition.\n if (hasLocalFontFace(styles)) {\n const local = extractLocalFontFace(styles);\n if (local) {\n for (const [family, input] of Object.entries(local)) {\n addFontFace(family, input);\n }\n }\n }\n\n return results;\n}\n\n// ============================================================================\n// Counter Style Extraction (zero-runtime)\n// ============================================================================\n\nexport interface ExtractedCounterStyle {\n name: string;\n css: string;\n}\n\n/**\n * Extract @counter-style rules from styles, merging with global config.\n * Deduplicates by name; component-local definitions override global ones with\n * the same name (local wins).\n */\nexport function extractCounterStyleFromStyles(\n styles: Styles,\n globalCounterStyle?: Record<string, CounterStyleDescriptors> | null,\n): ExtractedCounterStyle[] {\n const byName = new Map<string, ExtractedCounterStyle>();\n\n function addCounterStyle(name: string, descriptors: CounterStyleDescriptors) {\n byName.set(name, { name, css: formatCounterStyleRule(name, descriptors) });\n }\n\n // Global counter styles first, then local — local replaces global on conflict.\n if (globalCounterStyle) {\n for (const [name, descriptors] of Object.entries(globalCounterStyle)) {\n addCounterStyle(name, descriptors);\n }\n }\n\n if (hasLocalCounterStyle(styles)) {\n const local = extractLocalCounterStyle(styles);\n if (local) {\n for (const [name, descriptors] of Object.entries(local)) {\n addCounterStyle(name, descriptors);\n }\n }\n }\n\n return [...byName.values()];\n}\n\n// ============================================================================\n// Function Extraction (zero-runtime)\n// ============================================================================\n\nexport interface ExtractedFunction {\n name: string;\n css: string;\n}\n\n/**\n * Extract @function rules from styles, merging with global config.\n * Deduplicates by CSS function name; component-local definitions override\n * global ones with the same name (local wins).\n */\nexport function extractFunctionsFromStyles(\n styles: Styles,\n globalFunction?: Record<string, FunctionDefinition> | null,\n): ExtractedFunction[] {\n // @function polyfill: register definitions as inline closures so call sites\n // are expanded to plain CSS during chunk rendering. No native @function rules\n // are emitted. Global definitions are also registered here as a safety net in\n // case configure() ran in a separate module scope.\n if (isFunctionsPolyfillEnabled()) {\n if (globalFunction) {\n for (const [name, definition] of Object.entries(globalFunction)) {\n registerFunctionPolyfill(name, definition);\n }\n }\n registerLocalFunctionPolyfills(styles);\n return [];\n }\n\n const byName = new Map<string, ExtractedFunction>();\n\n function addFunction(name: string, definition: FunctionDefinition) {\n const cssName = parseFunctionName(name);\n byName.set(cssName, {\n name: cssName,\n css: formatFunctionRule(name, definition),\n });\n }\n\n // Global functions first, then local — local replaces global on conflict.\n if (globalFunction) {\n for (const [name, definition] of Object.entries(globalFunction)) {\n addFunction(name, definition);\n }\n }\n\n if (hasLocalFunctions(styles)) {\n const local = extractLocalFunctions(styles);\n if (local) {\n for (const [name, definition] of Object.entries(local)) {\n addFunction(name, definition);\n }\n }\n }\n\n return [...byName.values()];\n}\n","import * as fs from 'fs';\nimport * as path from 'path';\n\nexport interface CSSWriterOptions {\n /** Enable source comments in output (e.g., \"from: Button.tsx\") */\n devMode?: boolean;\n}\n\ninterface CSSBlock {\n css: string;\n source?: string;\n}\n\nexport class CSSWriter {\n private cssBlocks = new Map<string, CSSBlock>();\n private outputPath: string;\n private devMode: boolean;\n\n constructor(outputPath: string, options: CSSWriterOptions = {}) {\n this.outputPath = outputPath;\n this.devMode = options.devMode ?? false;\n }\n\n /**\n * Add CSS block with deduplication key\n * @param key - Unique key for deduplication\n * @param css - CSS content\n * @param source - Optional source file path (used in devMode)\n */\n add(key: string, css: string, source?: string): void {\n this.cssBlocks.set(key, { css, source });\n }\n\n /**\n * Check if a key already exists\n */\n has(key: string): boolean {\n return this.cssBlocks.has(key);\n }\n\n /**\n * Get the number of CSS blocks\n */\n get size(): number {\n return this.cssBlocks.size;\n }\n\n /**\n * Write all collected CSS to the output file\n */\n write(): void {\n const outputDir = path.dirname(this.outputPath);\n\n // Ensure directory exists\n if (!fs.existsSync(outputDir)) {\n fs.mkdirSync(outputDir, { recursive: true });\n }\n\n // Combine all CSS blocks with optional source comments\n const cssBlocks: string[] = [];\n for (const block of this.cssBlocks.values()) {\n if (this.devMode && block.source) {\n cssBlocks.push(`/* from: ${block.source} */\\n${block.css}`);\n } else {\n cssBlocks.push(block.css);\n }\n }\n const css = cssBlocks.join('\\n\\n');\n\n // Add header comment\n const header = `/* Generated by @tenphi/tasty/zero - DO NOT EDIT */\\n\\n`;\n\n fs.writeFileSync(this.outputPath, header + css);\n }\n\n /**\n * Get all CSS as string (for testing or in-memory use)\n */\n getCSS(): string {\n const cssBlocks: string[] = [];\n for (const block of this.cssBlocks.values()) {\n if (this.devMode && block.source) {\n cssBlocks.push(`/* from: ${block.source} */\\n${block.css}`);\n } else {\n cssBlocks.push(block.css);\n }\n }\n return cssBlocks.join('\\n\\n');\n }\n\n /**\n * Clear all collected CSS\n */\n clear(): void {\n this.cssBlocks.clear();\n }\n\n /**\n * Get the output path\n */\n getOutputPath(): string {\n return this.outputPath;\n }\n}\n\n/**\n * Factory for creating a {@link CSSWriter} instance.\n *\n * Canonical functional entry point; the `CSSWriter` class remains exported\n * for advanced/internal use.\n *\n * @example\n * ```ts\n * import { createCSSWriter } from '@tenphi/tasty/zero';\n *\n * const writer = createCSSWriter('output.css', { devMode: true });\n * ```\n */\nexport function createCSSWriter(\n outputPath: string,\n options?: CSSWriterOptions,\n): CSSWriter {\n return new CSSWriter(outputPath, options);\n}\n"],"m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AAC1C"}
1
+ {"version":3,"file":"css-writer-B-J87ncv.js","names":[],"sources":["../src/zero/extractor.ts","../src/zero/css-writer.ts"],"sourcesContent":["import { createHash } from 'crypto';\n\nimport {\n categorizeStyleKeys,\n generateChunkCacheKey,\n renderStylesForChunk,\n} from '../chunks';\nimport type {\n CounterStyleDescriptors,\n FontFaceDescriptors,\n FontFaceInput,\n FunctionDefinition,\n KeyframesSteps,\n} from '../injector/types';\nimport {\n extractLocalCounterStyle,\n formatCounterStyleRule,\n hasLocalCounterStyle,\n} from '../counter-style';\nimport {\n extractLocalFontFace,\n formatFontFaceRule,\n hasLocalFontFace,\n} from '../font-face';\nimport { isFunctionsPolyfillEnabled } from '../config';\nimport {\n extractLocalFunctions,\n formatFunctionRule,\n hasLocalFunctions,\n parseFunctionName,\n registerFunctionPolyfill,\n registerLocalFunctionPolyfills,\n} from '../functions';\nimport {\n extractAnimationNamesFromStyles,\n extractLocalKeyframes,\n filterUsedKeyframes,\n hasLocalKeyframes,\n mergeKeyframes,\n} from '../keyframes';\nimport type { StyleResult } from '../pipeline';\nimport { renderStyles } from '../pipeline';\nimport { extractLocalProperties, hasLocalProperties } from '../properties';\nimport { PropertyTypeResolver } from '../properties/property-type-resolver';\nimport type { Styles } from '../styles/types';\nimport {\n DEFAULT_ZERO_NAME_PREFIX,\n makeClassName,\n makeKeyframeName,\n validateNamePrefix,\n} from '../utils/name-prefix';\n\nexport interface ExtractedChunk {\n className: string;\n css: string;\n}\n\nexport interface ExtractedSelector {\n selector: string;\n css: string;\n}\n\nexport interface ExtractedKeyframes {\n name: string;\n css: string;\n}\n\ninterface KeyframesExtractionResult {\n /** Keyframes to inject (deduplicated by content) */\n keyframes: ExtractedKeyframes[];\n /** Map from original animation name to canonical name (for replacement) */\n nameMap: Map<string, string>;\n}\n\n/**\n * Module-level prefix used by the zero-runtime extractor.\n * Defaults to `'ts'` so static classes never collide with the runtime\n * `'t'` classes when both are loaded on the same page. Override via\n * `setExtractorNamePrefix()` from the Babel plugin so user config flows\n * into the extractor.\n */\nlet currentNamePrefix: string = DEFAULT_ZERO_NAME_PREFIX;\n\n/**\n * Set the prefix used by the zero-runtime extractor.\n * Called by the Babel plugin after resolving user config so that\n * generated class and keyframe names match the user's configuration.\n */\nexport function setExtractorNamePrefix(prefix: string): void {\n validateNamePrefix(prefix);\n currentNamePrefix = prefix;\n}\n\n/**\n * Get the prefix currently used by the zero-runtime extractor.\n * Exposed primarily for tests.\n */\nexport function getExtractorNamePrefix(): string {\n return currentNamePrefix;\n}\n\n/**\n * Generate a deterministic className from a cache key using content hash.\n * This ensures the same styles always produce the same className,\n * regardless of build order or incremental compilation.\n */\nfunction generateClassName(cacheKey: string): string {\n const hash = createHash('md5').update(cacheKey).digest('hex').slice(0, 6);\n return makeClassName(currentNamePrefix, hash);\n}\n\n/**\n * Extract styles using chunking (for className mode).\n * Returns multiple classes, one per chunk.\n */\nexport function extractStylesWithChunks(styles: Styles): ExtractedChunk[] {\n const chunks: ExtractedChunk[] = [];\n\n // Categorize style keys into chunks\n const chunkMap = categorizeStyleKeys(styles as Record<string, unknown>);\n\n for (const [chunkName, chunkStyleKeys] of chunkMap) {\n if (chunkStyleKeys.length === 0) continue;\n\n // Generate cache key for this chunk (used for className hash)\n const cacheKey = generateChunkCacheKey(styles, chunkName, chunkStyleKeys);\n\n // Render styles for this chunk\n const renderResult = renderStylesForChunk(\n styles,\n chunkName,\n chunkStyleKeys,\n );\n\n if (renderResult.rules.length === 0) continue;\n\n // Generate deterministic className from content hash\n const className = generateClassName(cacheKey);\n const selector = `.${className}.${className}`;\n\n // Format CSS\n const css = formatRulesToCSS(renderResult.rules, selector);\n\n chunks.push({ className, css });\n }\n\n return chunks;\n}\n\n/**\n * Extract styles for a specific selector (for global/selector mode).\n * Returns a single CSS block.\n */\nexport function extractStylesForSelector(\n selector: string,\n styles: Styles,\n): ExtractedSelector {\n // renderStyles with selector returns StyleResult[] with selectors already applied\n const rules = renderStyles(styles, selector);\n // Format without re-prefixing - rules already have the full selector\n const css = formatRulesDirectly(rules);\n\n return { selector, css };\n}\n\n/**\n * Format StyleResult[] to CSS string.\n * Prefixes each rule's selector with the base selector.\n * Used for chunked styles where rules have relative selectors.\n */\nfunction formatRulesToCSS(rules: StyleResult[], baseSelector: string): string {\n return rules\n .map((rule) => {\n // Handle selector as array (OR conditions) or string\n // Note: renderStyles without className joins array selectors with '|||' placeholder\n const selectorParts = Array.isArray(rule.selector)\n ? rule.selector\n : rule.selector\n ? rule.selector.split('|||')\n : [''];\n\n // Prefix each selector part with the base selector\n const fullSelector = selectorParts\n .map((part) => {\n // Build selector: [rootPrefix] baseSelector[part]\n let selector: string;\n\n // If part is empty, just use base selector\n if (!part) {\n selector = baseSelector;\n } else if (part.startsWith(':') || part.startsWith('[')) {\n // If part starts with a pseudo-class or pseudo-element, append to base\n selector = `${baseSelector}${part}`;\n } else if (\n part.startsWith('>') ||\n part.startsWith('+') ||\n part.startsWith('~')\n ) {\n // If part starts with >, +, ~ combinator, append with space\n selector = `${baseSelector}${part}`;\n } else {\n // Otherwise, combine base with part\n selector = `${baseSelector}${part}`;\n }\n\n // Prepend rootPrefix if present (for @root() states)\n if (rule.rootPrefix) {\n selector = `${rule.rootPrefix} ${selector}`;\n }\n\n return selector;\n })\n .join(', ');\n\n let css = `${fullSelector} { ${rule.declarations} }`;\n\n // Wrap in at-rules (in reverse order for proper nesting)\n if (rule.atRules && rule.atRules.length > 0) {\n for (const atRule of [...rule.atRules].reverse()) {\n css = `${atRule} {\\n ${css}\\n}`;\n }\n }\n\n return css;\n })\n .join('\\n\\n');\n}\n\n/**\n * Format StyleResult[] to CSS string directly without prefixing.\n * Used for global styles where rules already have the full selector.\n */\nfunction formatRulesDirectly(rules: StyleResult[]): string {\n return rules\n .map((rule) => {\n // Prepend rootPrefix if present (for @root() states)\n const selector = rule.rootPrefix\n ? `${rule.rootPrefix} ${rule.selector}`\n : rule.selector;\n\n let css = `${selector} { ${rule.declarations} }`;\n\n // Wrap in at-rules (in reverse order for proper nesting)\n if (rule.atRules && rule.atRules.length > 0) {\n for (const atRule of [...rule.atRules].reverse()) {\n css = `${atRule} {\\n ${css}\\n}`;\n }\n }\n\n return css;\n })\n .join('\\n\\n');\n}\n\n// Note: With hash-based className generation, counter management functions\n// are no longer needed. ClassNames are deterministic based on content.\n\n/**\n * Generate a deterministic keyframes name from content hash.\n * This ensures the same keyframes content always produces the same name,\n * enabling automatic deduplication across elements and files.\n *\n * Uses the configured prefix with a `k` discriminator so keyframe names\n * stay visually distinct from class names sharing the same prefix.\n */\nfunction generateKeyframesName(steps: KeyframesSteps): string {\n const content = JSON.stringify(steps);\n const hash = createHash('md5').update(content).digest('hex').slice(0, 6);\n return makeKeyframeName(currentNamePrefix, hash);\n}\n\n/**\n * Extract keyframes that are used in styles.\n * Merges local @keyframes with global keyframes, filters to only used ones.\n * Generates hash-based names from content for automatic deduplication.\n *\n * @param styles - The styles object (may contain @keyframes and animation properties)\n * @param globalKeyframes - Optional global keyframes from config\n * @returns Keyframes to inject and name mapping for replacement\n */\nexport function extractKeyframesFromStyles(\n styles: Styles,\n globalKeyframes?: Record<string, KeyframesSteps> | null,\n): KeyframesExtractionResult {\n const emptyResult: KeyframesExtractionResult = {\n keyframes: [],\n nameMap: new Map(),\n };\n\n // Extract animation names from styles\n const usedNames = extractAnimationNamesFromStyles(styles);\n if (usedNames.size === 0) return emptyResult;\n\n // Merge local and global keyframes\n const local = hasLocalKeyframes(styles)\n ? extractLocalKeyframes(styles)\n : null;\n const allKeyframes = mergeKeyframes(local, globalKeyframes ?? null);\n\n // Filter to only used keyframes\n const usedKeyframes = filterUsedKeyframes(allKeyframes, usedNames);\n if (!usedKeyframes) return emptyResult;\n\n // Generate hash-based names and collect unique keyframes\n const seenHashes = new Set<string>();\n const nameMap = new Map<string, string>();\n const keyframesToEmit: ExtractedKeyframes[] = [];\n\n for (const [originalName, steps] of Object.entries(usedKeyframes)) {\n const hashedName = generateKeyframesName(steps);\n\n // Always map original name to hashed name (for CSS replacement)\n nameMap.set(originalName, hashedName);\n\n // Only emit each unique keyframe once\n if (!seenHashes.has(hashedName)) {\n seenHashes.add(hashedName);\n const css = keyframesToCSS(hashedName, steps);\n keyframesToEmit.push({ name: hashedName, css });\n }\n }\n\n return { keyframes: keyframesToEmit, nameMap };\n}\n\n/**\n * Convert keyframes steps to CSS string.\n */\nfunction keyframesToCSS(name: string, steps: KeyframesSteps): string {\n const stepRules: string[] = [];\n\n for (const [key, value] of Object.entries(steps)) {\n if (typeof value === 'string') {\n // Raw CSS string\n stepRules.push(`${key} { ${value.trim()} }`);\n } else if (value && typeof value === 'object') {\n // Style map - convert to CSS declarations\n const declarations = Object.entries(value)\n .map(([prop, val]) => {\n const cssProperty = camelToKebab(prop);\n return `${cssProperty}: ${val}`;\n })\n .join('; ');\n stepRules.push(`${key} { ${declarations} }`);\n }\n }\n\n return `@keyframes ${name} { ${stepRules.join(' ')} }`;\n}\n\n/**\n * Convert camelCase to kebab-case.\n */\nfunction camelToKebab(str: string): string {\n return str.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);\n}\n\n// ============================================================================\n// Property Extraction (auto-infer @property types for zero-runtime)\n// ============================================================================\n\nexport interface ExtractedProperty {\n name: string;\n css: string;\n}\n\n/**\n * Extract auto-inferred @property declarations from styles.\n * Scans rendered style declarations and keyframe declarations for custom properties\n * whose types can be inferred from their values.\n *\n * @param styles - The styles object\n * @param options - Options including autoPropertyTypes flag\n * @returns Array of @property CSS rules to inject\n */\nexport function extractPropertiesFromStyles(\n styles: Styles,\n options?: { autoPropertyTypes?: boolean },\n): ExtractedProperty[] {\n if (options?.autoPropertyTypes === false) return [];\n\n const registered = new Set<string>();\n const results: ExtractedProperty[] = [];\n\n // Collect explicitly declared properties (they take precedence)\n if (hasLocalProperties(styles)) {\n const localProps = extractLocalProperties(styles);\n if (localProps) {\n for (const token of Object.keys(localProps)) {\n // Normalize token to CSS name\n let cssName: string;\n if (token.startsWith('#')) {\n cssName = `--${token.slice(1)}-color`;\n } else if (token.startsWith('$')) {\n cssName = `--${token.slice(1)}`;\n } else if (token.startsWith('--')) {\n cssName = token;\n } else {\n cssName = `--${token}`;\n }\n registered.add(cssName);\n }\n }\n }\n\n const resolver = new PropertyTypeResolver();\n\n const registerProperty = (\n name: string,\n syntax: string,\n initialValue: string,\n ) => {\n if (registered.has(name)) return;\n registered.add(name);\n\n const parts: string[] = [];\n parts.push(`syntax: \"${syntax}\";`);\n parts.push(`inherits: true;`);\n parts.push(`initial-value: ${initialValue};`);\n\n const css = `@property ${name} { ${parts.join(' ')} }`;\n results.push({ name, css });\n };\n\n const isPropertyDefined = (name: string) => registered.has(name);\n\n // Scan rendered style declarations\n const chunkMap = categorizeStyleKeys(styles as Record<string, unknown>);\n for (const [chunkName, chunkStyleKeys] of chunkMap) {\n if (chunkStyleKeys.length === 0) continue;\n const renderResult = renderStylesForChunk(\n styles,\n chunkName,\n chunkStyleKeys,\n );\n for (const rule of renderResult.rules) {\n if (!rule.declarations) continue;\n resolver.scanDeclarations(\n rule.declarations,\n isPropertyDefined,\n registerProperty,\n );\n }\n }\n\n // Scan keyframe declarations\n if (hasLocalKeyframes(styles)) {\n const localKf = extractLocalKeyframes(styles);\n if (localKf) {\n for (const steps of Object.values(localKf)) {\n scanKeyframeSteps(steps, resolver, isPropertyDefined, registerProperty);\n }\n }\n }\n\n return results;\n}\n\nfunction scanKeyframeSteps(\n steps: KeyframesSteps,\n resolver: PropertyTypeResolver,\n isPropertyDefined: (name: string) => boolean,\n registerProperty: (\n name: string,\n syntax: string,\n initialValue: string,\n ) => void,\n): void {\n for (const value of Object.values(steps)) {\n if (typeof value === 'string') {\n resolver.scanDeclarations(value, isPropertyDefined, registerProperty);\n } else if (value && typeof value === 'object') {\n const declarations = Object.entries(value)\n .map(([prop, val]) => {\n const cssProperty = camelToKebab(prop);\n return `${cssProperty}: ${val}`;\n })\n .join('; ');\n resolver.scanDeclarations(\n declarations,\n isPropertyDefined,\n registerProperty,\n );\n }\n }\n}\n\n// ============================================================================\n// Font Face Extraction (zero-runtime)\n// ============================================================================\n\nexport interface ExtractedFontFace {\n css: string;\n}\n\n/**\n * Extract @font-face rules from styles, merging with global config.\n * Deduplicates by content hash.\n */\nexport function extractFontFaceFromStyles(\n styles: Styles,\n globalFontFace?: Record<string, FontFaceInput> | null,\n): ExtractedFontFace[] {\n const results: ExtractedFontFace[] = [];\n const seenHashes = new Set<string>();\n\n function addFontFace(family: string, input: FontFaceInput) {\n const descriptors: FontFaceDescriptors[] = Array.isArray(input)\n ? input\n : [input];\n for (const desc of descriptors) {\n const hash = createHash('md5')\n .update(JSON.stringify({ family, ...desc }))\n .digest('hex')\n .slice(0, 8);\n if (!seenHashes.has(hash)) {\n seenHashes.add(hash);\n results.push({ css: formatFontFaceRule(family, desc) });\n }\n }\n }\n\n // Global font faces first\n if (globalFontFace) {\n for (const [family, input] of Object.entries(globalFontFace)) {\n addFontFace(family, input);\n }\n }\n\n // Local font faces. @font-face is keyed by content hash, not family name, so\n // distinct definitions all emit and byte-identical ones collapse — there is\n // no \"winner\" to pick between a global and a local definition.\n if (hasLocalFontFace(styles)) {\n const local = extractLocalFontFace(styles);\n if (local) {\n for (const [family, input] of Object.entries(local)) {\n addFontFace(family, input);\n }\n }\n }\n\n return results;\n}\n\n// ============================================================================\n// Counter Style Extraction (zero-runtime)\n// ============================================================================\n\nexport interface ExtractedCounterStyle {\n name: string;\n css: string;\n}\n\n/**\n * Extract @counter-style rules from styles, merging with global config.\n * Deduplicates by name; component-local definitions override global ones with\n * the same name (local wins).\n */\nexport function extractCounterStyleFromStyles(\n styles: Styles,\n globalCounterStyle?: Record<string, CounterStyleDescriptors> | null,\n): ExtractedCounterStyle[] {\n const byName = new Map<string, ExtractedCounterStyle>();\n\n function addCounterStyle(name: string, descriptors: CounterStyleDescriptors) {\n byName.set(name, { name, css: formatCounterStyleRule(name, descriptors) });\n }\n\n // Global counter styles first, then local — local replaces global on conflict.\n if (globalCounterStyle) {\n for (const [name, descriptors] of Object.entries(globalCounterStyle)) {\n addCounterStyle(name, descriptors);\n }\n }\n\n if (hasLocalCounterStyle(styles)) {\n const local = extractLocalCounterStyle(styles);\n if (local) {\n for (const [name, descriptors] of Object.entries(local)) {\n addCounterStyle(name, descriptors);\n }\n }\n }\n\n return [...byName.values()];\n}\n\n// ============================================================================\n// Function Extraction (zero-runtime)\n// ============================================================================\n\nexport interface ExtractedFunction {\n name: string;\n css: string;\n}\n\n/**\n * Extract @function rules from styles, merging with global config.\n * Deduplicates by CSS function name; component-local definitions override\n * global ones with the same name (local wins).\n */\nexport function extractFunctionsFromStyles(\n styles: Styles,\n globalFunction?: Record<string, FunctionDefinition> | null,\n): ExtractedFunction[] {\n // @function polyfill: register definitions as inline closures so call sites\n // are expanded to plain CSS during chunk rendering. No native @function rules\n // are emitted. Global definitions are also registered here as a safety net in\n // case configure() ran in a separate module scope.\n if (isFunctionsPolyfillEnabled()) {\n if (globalFunction) {\n for (const [name, definition] of Object.entries(globalFunction)) {\n registerFunctionPolyfill(name, definition);\n }\n }\n registerLocalFunctionPolyfills(styles);\n return [];\n }\n\n const byName = new Map<string, ExtractedFunction>();\n\n function addFunction(name: string, definition: FunctionDefinition) {\n const cssName = parseFunctionName(name);\n byName.set(cssName, {\n name: cssName,\n css: formatFunctionRule(name, definition),\n });\n }\n\n // Global functions first, then local — local replaces global on conflict.\n if (globalFunction) {\n for (const [name, definition] of Object.entries(globalFunction)) {\n addFunction(name, definition);\n }\n }\n\n if (hasLocalFunctions(styles)) {\n const local = extractLocalFunctions(styles);\n if (local) {\n for (const [name, definition] of Object.entries(local)) {\n addFunction(name, definition);\n }\n }\n }\n\n return [...byName.values()];\n}\n","import * as fs from 'fs';\nimport * as path from 'path';\n\nexport interface CSSWriterOptions {\n /** Enable source comments in output (e.g., \"from: Button.tsx\") */\n devMode?: boolean;\n}\n\ninterface CSSBlock {\n css: string;\n source?: string;\n}\n\nexport class CSSWriter {\n private cssBlocks = new Map<string, CSSBlock>();\n private outputPath: string;\n private devMode: boolean;\n\n constructor(outputPath: string, options: CSSWriterOptions = {}) {\n this.outputPath = outputPath;\n this.devMode = options.devMode ?? false;\n }\n\n /**\n * Add CSS block with deduplication key\n * @param key - Unique key for deduplication\n * @param css - CSS content\n * @param source - Optional source file path (used in devMode)\n */\n add(key: string, css: string, source?: string): void {\n this.cssBlocks.set(key, { css, source });\n }\n\n /**\n * Check if a key already exists\n */\n has(key: string): boolean {\n return this.cssBlocks.has(key);\n }\n\n /**\n * Get the number of CSS blocks\n */\n get size(): number {\n return this.cssBlocks.size;\n }\n\n /**\n * Write all collected CSS to the output file\n */\n write(): void {\n const outputDir = path.dirname(this.outputPath);\n\n // Ensure directory exists\n if (!fs.existsSync(outputDir)) {\n fs.mkdirSync(outputDir, { recursive: true });\n }\n\n // Combine all CSS blocks with optional source comments\n const cssBlocks: string[] = [];\n for (const block of this.cssBlocks.values()) {\n if (this.devMode && block.source) {\n cssBlocks.push(`/* from: ${block.source} */\\n${block.css}`);\n } else {\n cssBlocks.push(block.css);\n }\n }\n const css = cssBlocks.join('\\n\\n');\n\n // Add header comment\n const header = `/* Generated by @tenphi/tasty/zero - DO NOT EDIT */\\n\\n`;\n\n fs.writeFileSync(this.outputPath, header + css);\n }\n\n /**\n * Get all CSS as string (for testing or in-memory use)\n */\n getCSS(): string {\n const cssBlocks: string[] = [];\n for (const block of this.cssBlocks.values()) {\n if (this.devMode && block.source) {\n cssBlocks.push(`/* from: ${block.source} */\\n${block.css}`);\n } else {\n cssBlocks.push(block.css);\n }\n }\n return cssBlocks.join('\\n\\n');\n }\n\n /**\n * Clear all collected CSS\n */\n clear(): void {\n this.cssBlocks.clear();\n }\n\n /**\n * Get the output path\n */\n getOutputPath(): string {\n return this.outputPath;\n }\n}\n\n/**\n * Factory for creating a {@link CSSWriter} instance.\n *\n * Canonical functional entry point; the `CSSWriter` class remains exported\n * for advanced/internal use.\n *\n * @example\n * ```ts\n * import { createCSSWriter } from '@tenphi/tasty/zero';\n *\n * const writer = createCSSWriter('output.css', { devMode: true });\n * ```\n */\nexport function createCSSWriter(\n outputPath: string,\n options?: CSSWriterOptions,\n): CSSWriter {\n return new CSSWriter(outputPath, options);\n}\n"],"mappings":";;;;;;;;;;;;;AAiFA,IAAI,oBAAA;;;;;;AAOJ,SAAgB,uBAAuB,QAAsB;CAC3D,mBAAmB,MAAM;CACzB,oBAAoB;AACtB;;;;;;AAeA,SAAS,kBAAkB,UAA0B;CACnD,MAAM,OAAO,WAAW,KAAK,CAAC,CAAC,OAAO,QAAQ,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC;CACxE,OAAO,cAAc,mBAAmB,IAAI;AAC9C;;;;;AAMA,SAAgB,wBAAwB,QAAkC;CACxE,MAAM,SAA2B,CAAC;CAGlC,MAAM,WAAW,oBAAoB,MAAiC;CAEtE,KAAK,MAAM,CAAC,WAAW,mBAAmB,UAAU;EAClD,IAAI,eAAe,WAAW,GAAG;EAGjC,MAAM,WAAW,sBAAsB,QAAQ,WAAW,cAAc;EAGxE,MAAM,eAAe,qBACnB,QACA,WACA,cACF;EAEA,IAAI,aAAa,MAAM,WAAW,GAAG;EAGrC,MAAM,YAAY,kBAAkB,QAAQ;EAC5C,MAAM,WAAW,IAAI,UAAU,GAAG;EAGlC,MAAM,MAAM,iBAAiB,aAAa,OAAO,QAAQ;EAEzD,OAAO,KAAK;GAAE;GAAW;EAAI,CAAC;CAChC;CAEA,OAAO;AACT;;;;;AAMA,SAAgB,yBACd,UACA,QACmB;CAMnB,OAAO;EAAE;EAAU,KAFP,oBAFE,aAAa,QAAQ,QAEC,CAEf;CAAE;AACzB;;;;;;AAOA,SAAS,iBAAiB,OAAsB,cAA8B;CAC5E,OAAO,MACJ,KAAK,SAAS;EA0Cb,IAAI,MAAM,IAvCY,MAAM,QAAQ,KAAK,QAAQ,IAC7C,KAAK,WACL,KAAK,WACH,KAAK,SAAS,MAAM,KAAK,IACzB,CAAC,EAAE,EAAA,CAIN,KAAK,SAAS;GAEb,I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