@teacss/classes 0.5.2 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +72 -56
- package/dist/index.d.ts +26 -123
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,24 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
Typed class composition and vocabulary-aware conflict resolution.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
This package owns the fixed Standard + Icons `cn` and `recipe` runtime.
|
|
6
|
+
The `teacss` development tool does not re-export these helpers. Classes do not
|
|
7
|
+
generate CSS or validate utility values; merger plugins and custom conflict
|
|
8
|
+
configuration are not supported.
|
|
8
9
|
|
|
9
10
|
## Recipes
|
|
10
11
|
|
|
11
|
-
A string `
|
|
12
|
+
A string `defaults` defines a single-element recipe. Calling it returns a
|
|
12
13
|
merged string and accepts a caller override:
|
|
13
14
|
|
|
14
15
|
```ts
|
|
15
|
-
import { recipe, type ClassProp, type VariantProps } from "teacss";
|
|
16
|
+
import { recipe, type ClassProp, type VariantProps } from "@teacss/classes";
|
|
16
17
|
|
|
17
18
|
const badge = recipe({
|
|
18
|
-
|
|
19
|
+
defaults: "d:inline-flex align-items:center p-x:2",
|
|
19
20
|
variants: {
|
|
20
21
|
tone: {
|
|
21
|
-
neutral: "bg-color:
|
|
22
|
-
accent: "bg-color:
|
|
22
|
+
neutral: "bg-color:neutral-200 text-color:neutral-950",
|
|
23
|
+
accent: "bg-color:primary-200 text-color:primary-950",
|
|
23
24
|
},
|
|
24
25
|
},
|
|
25
26
|
defaultVariants: { tone: "neutral" },
|
|
@@ -30,14 +31,18 @@ badge({ tone: "accent", className: "p-x:3" });
|
|
|
30
31
|
type BadgeProps = VariantProps<typeof badge> & ClassProp;
|
|
31
32
|
```
|
|
32
33
|
|
|
33
|
-
|
|
34
|
+
`defaults` supplies base styles, `variants` supplies additional styles when a
|
|
35
|
+
choice is selected, and `defaultVariants` selects the component's initial
|
|
36
|
+
conditions. Omitted selections use `defaultVariants`; `null` disables a selection.
|
|
37
|
+
|
|
38
|
+
An object `defaults` defines named elements. Every key is ordinary; `root`
|
|
34
39
|
is not required or special. The recipe call selects shared variants and returns
|
|
35
40
|
one resolver per key. Caller `className` belongs to a resolver, not the recipe
|
|
36
41
|
call.
|
|
37
42
|
|
|
38
43
|
```ts
|
|
39
44
|
const button = recipe({
|
|
40
|
-
|
|
45
|
+
defaults: {
|
|
41
46
|
container: "d:inline-flex align-items:center p:2",
|
|
42
47
|
icon: "inline-size:4x",
|
|
43
48
|
},
|
|
@@ -70,23 +75,17 @@ A one-sided boolean variant supports the undeclared opposite boolean as a
|
|
|
70
75
|
branchless state. The corresponding string is not an alias. Keep responsive
|
|
71
76
|
behavior in class conditions such as `p:4@md`, not variant objects.
|
|
72
77
|
|
|
73
|
-
Recipes may `extend` one parent created by the
|
|
74
|
-
inherit `
|
|
78
|
+
Recipes may `extend` one parent created by the same loaded classes module. A child may
|
|
79
|
+
inherit `defaults`, but an explicit value must preserve the parent's string or
|
|
75
80
|
object mode.
|
|
76
81
|
|
|
77
|
-
##
|
|
78
|
-
|
|
79
|
-
```ts
|
|
80
|
-
import { createMerger, createReciper } from "@teacss/classes";
|
|
82
|
+
## Shared recipe identity
|
|
81
83
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
its extendable recipes. Recreating it breaks extension identity even when the
|
|
88
|
-
merger is equivalent. `VariantProps` is type-only and has no runtime identity
|
|
89
|
-
requirement.
|
|
84
|
+
Recipe libraries should peer-depend on and externalize `@teacss/classes` so
|
|
85
|
+
parents and children use the same loaded module. Two physical classes copies
|
|
86
|
+
have separate private registries and reject cross-copy extension. Copying a
|
|
87
|
+
recipe's frozen `.config` cannot forge its identity. `VariantProps` is
|
|
88
|
+
type-only and can infer types across package copies.
|
|
90
89
|
|
|
91
90
|
## Class merging
|
|
92
91
|
|
|
@@ -95,41 +94,58 @@ bun add @teacss/classes
|
|
|
95
94
|
```
|
|
96
95
|
|
|
97
96
|
```ts
|
|
98
|
-
import {
|
|
99
|
-
|
|
100
|
-
const cn = createMerger({
|
|
101
|
-
conflicts: {
|
|
102
|
-
keywords: { hidden: "display" },
|
|
103
|
-
overlaps: {
|
|
104
|
-
p: ["padding-top", "padding-right", "padding-bottom", "padding-left"],
|
|
105
|
-
"p-x": ["padding-left", "padding-right"],
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
cn("p:4", "p-x:8!"); // "p:4 p-x:8!"
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
`createMerger` accepts nested class values, conditional dictionaries, tagged
|
|
114
|
-
templates, and falsy values. It preserves surviving-token order.
|
|
97
|
+
import { cn, type ClassValue } from "@teacss/classes";
|
|
115
98
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
| `conflicts` | Defines keyword and declaration footprints. |
|
|
119
|
-
| `overlap` | Uses precise coverage by default or symmetric intersection. |
|
|
120
|
-
| `plugins` | Adds transforms, dynamic groups, finalizers, and pair resolvers. |
|
|
121
|
-
| `cache` | Configures the shared input LRU; `false` disables it. |
|
|
122
|
-
|
|
123
|
-
Only tokens with the same ordered conditions can conflict. With different
|
|
124
|
-
importance, the important token removes the other only when it covers the full
|
|
125
|
-
footprint. Merge never validates values:
|
|
126
|
-
|
|
127
|
-
```ts
|
|
99
|
+
const caller: ClassValue = ["p-x:8!", { "d:flex": true }];
|
|
100
|
+
cn("p:4", caller); // "p:4 p-x:8! d:flex"
|
|
128
101
|
cn("p:4", "p:invalid"); // "p:invalid"
|
|
102
|
+
cn("icon:bad icon:other icon:bad"); // "icon:bad"
|
|
129
103
|
```
|
|
130
104
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
105
|
+
`cn` accepts nested class values, own enumerable truthy dictionary keys, tagged
|
|
106
|
+
templates, numbers, bigints, and falsy branches. Ordinary `0` and `0n` are
|
|
107
|
+
ignored; template interpolation preserves them. Getters run on each call and
|
|
108
|
+
user exceptions propagate unchanged. Invalid array lengths throw `TypeError`.
|
|
109
|
+
|
|
110
|
+
Only tokens with identical ordered conditions can conflict; complete language-tag
|
|
111
|
+
payloads in `lang-` / `!lang-` compare without ASCII case. For example,
|
|
112
|
+
`cn("p:1@lang-zh-CN", "p:2@lang-zh-cn")` returns `"p:2@lang-zh-cn"`.
|
|
113
|
+
Winning tokens retain their spelling, including unsupported conditions; use
|
|
114
|
+
complete BCP 47 tags for CSS generation. `zh`, `zh-CN`, and `zh-Hans` have
|
|
115
|
+
separate identities. A later token can remove a fully covered earlier token;
|
|
116
|
+
an important token wins only over effects
|
|
117
|
+
it covers. Fixed composite-property exceptions preserve filter, shadow,
|
|
118
|
+
scrollbar, transform, image, and gradient behavior. Surviving raw tokens retain
|
|
119
|
+
their order.
|
|
120
|
+
|
|
121
|
+
The `dimensions`, `min-dimensions`, `max-dimensions`, `size`, `min-size`, and
|
|
122
|
+
`max-size` declarations also accumulate coverage from their two matching axes.
|
|
123
|
+
For example, `cn("dimensions:4x", "w:8", "h:10")` returns `"w:8 h:10"`, while
|
|
124
|
+
`cn("size:4x", "inline-size:8")` retains both tokens. Important axes may win
|
|
125
|
+
before or after the combined token. Physical/logical and preferred/min/max
|
|
126
|
+
groups stay independent. Other properties keep pairwise coverage:
|
|
127
|
+
`cn("p:1", "p-x:2", "p-y:3")` retains all three.
|
|
128
|
+
|
|
129
|
+
All `icon:value` declarations merge by the `icon` prefix without validating
|
|
130
|
+
the value: the last icon wins under identical ordered conditions and importance.
|
|
131
|
+
Unknown declarations also merge by prefix; bare names, including `icon`, use a
|
|
132
|
+
separate keyword identity. Custom CSS rules and shortcuts remain available to
|
|
133
|
+
the generator; their cross-prefix conflicts are not inferred by classes.
|
|
134
|
+
|
|
135
|
+
Keep original fragments until one final merge. A survivor string loses sequence
|
|
136
|
+
information, so nested merges need not equal one flat call. Recipes retain
|
|
137
|
+
fragments through extension and merge once per resolved element; safe static
|
|
138
|
+
fragments reuse parsed tokens without pre-merging them.
|
|
139
|
+
|
|
140
|
+
Caches are bounded private implementation details. They preserve object getter
|
|
141
|
+
reads, ordered conditions, and success/error behavior; no cache options are
|
|
142
|
+
part of the public API.
|
|
143
|
+
|
|
144
|
+
The exports are `cn`, `recipe`, `omitAttributes`, and the types `ClassDict`,
|
|
145
|
+
`ClassValue`, `Merger`, `ClassProp`, `RecipeIntrospection`, `Reciper`, `VariantProps`.
|
|
146
|
+
`Merger` and `Reciper` describe callable interfaces, not configurable factories.
|
|
147
|
+
|
|
148
|
+
For applications using earlier factories or preset-only entries, see the
|
|
149
|
+
[0.5.2 to 0.6.0 migration](../../docs/guides/upgrading-to-0-6.md#2-classes-与-recipe).
|
|
134
150
|
|
|
135
151
|
Pre-1.0. Public recipe and merge APIs may change before the stable release.
|
package/dist/index.d.ts
CHANGED
|
@@ -12,127 +12,33 @@
|
|
|
12
12
|
*/
|
|
13
13
|
export declare function omitAttributes<T extends object>(attributes: T, ownedNames: readonly string[]): Partial<T>;
|
|
14
14
|
//#endregion
|
|
15
|
-
//#region src/
|
|
15
|
+
//#region src/input.d.ts
|
|
16
16
|
type ClassDict = Record<string, any>;
|
|
17
17
|
type ClassValue = string | number | bigint | null | undefined | boolean | readonly ClassValue[] | ClassDict;
|
|
18
|
-
type ConflictAtoms = string | readonly string[];
|
|
19
|
-
type ConflictTable = Readonly<Record<string, ConflictAtoms>>;
|
|
20
|
-
type IsAny$1<Value> = 0 extends 1 & Value ? true : false;
|
|
21
|
-
type NonRecordObject = readonly unknown[] | ((...args: any[]) => any) | (abstract new (...args: any[]) => any);
|
|
22
|
-
type ValidateConflictTable<Table extends object> = Table extends NonRecordObject ? never : { readonly [Key in keyof Table]: IsAny$1<Table[Key]> extends true ? Table[Key] : Table[Key] extends ConflictAtoms ? Table[Key] : never; };
|
|
23
|
-
interface ConflictMeta<Keywords extends object = ConflictTable, Overlaps extends object = ConflictTable> {
|
|
24
|
-
readonly keywords: ValidateConflictTable<Keywords>;
|
|
25
|
-
readonly overlaps: ValidateConflictTable<Overlaps>;
|
|
26
|
-
}
|
|
27
|
-
interface MergerTokenView {
|
|
28
|
-
readonly raw: string;
|
|
29
|
-
readonly prefix: string;
|
|
30
|
-
readonly body: string;
|
|
31
|
-
readonly value?: string;
|
|
32
|
-
readonly keyword: boolean;
|
|
33
|
-
readonly conditions: readonly string[];
|
|
34
|
-
readonly important: boolean;
|
|
35
|
-
}
|
|
36
|
-
interface MergerTokenOccurrence {
|
|
37
|
-
/** Zero-based ordinal in the final transformed raw list and stable run-local id. */
|
|
38
|
-
readonly id: number;
|
|
39
|
-
readonly view: MergerTokenView;
|
|
40
|
-
readonly atoms: readonly string[];
|
|
41
|
-
}
|
|
42
|
-
type ResolveVerdict = "earlier" | "later" | "none";
|
|
43
|
-
/** Dedicated, allocation-free classification result. */
|
|
44
|
-
export declare const MERGE_OPAQUE: false;
|
|
45
|
-
interface MergerPlugin<Keywords extends object = ConflictTable, Overlaps extends object = ConflictTable> {
|
|
46
|
-
readonly name: string;
|
|
47
|
-
readonly conflicts?: ConflictMeta<Keywords, Overlaps>;
|
|
48
|
-
readonly tokens?: (this: void, tokens: readonly string[], context: {
|
|
49
|
-
readonly viewToken: (raw: string) => MergerTokenView;
|
|
50
|
-
}) => readonly string[];
|
|
51
|
-
readonly group?: (this: void, token: MergerTokenView) => ConflictAtoms | typeof MERGE_OPAQUE | null;
|
|
52
|
-
readonly finalize?: (this: void, tokens: readonly MergerTokenOccurrence[]) => readonly number[] | null;
|
|
53
|
-
/**
|
|
54
|
-
* Optionally scope this plugin's resolver. The resolver is considered only
|
|
55
|
-
* when both tokens return the same non-empty family.
|
|
56
|
-
*/
|
|
57
|
-
readonly resolveFamily?: (this: void, token: MergerTokenView) => string | null;
|
|
58
|
-
readonly resolve?: (this: void, earlier: MergerTokenView, later: MergerTokenView, context: {
|
|
59
|
-
/** Whether the later footprint fully covers the earlier footprint. */
|
|
60
|
-
readonly covers: boolean;
|
|
61
|
-
/** Whether the earlier footprint fully covers the later footprint. */
|
|
62
|
-
readonly earlierCoversLater: boolean;
|
|
63
|
-
readonly defaultDrop: ResolveVerdict;
|
|
64
|
-
}) => ResolveVerdict | null;
|
|
65
|
-
}
|
|
66
|
-
type OverlapMode = "precise" | "symmetric";
|
|
67
|
-
interface MergerOptions<Keywords extends object = ConflictTable, Overlaps extends object = ConflictTable> {
|
|
68
|
-
/** Keyword + overlap tables. Absent means generic same-prefix merging only. */
|
|
69
|
-
readonly conflicts?: ConflictMeta<Keywords, Overlaps>;
|
|
70
|
-
/** Equal-importance overlap rule. Default `"precise"` (asymmetric containment). */
|
|
71
|
-
readonly overlap?: OverlapMode;
|
|
72
|
-
readonly plugins?: readonly MergerPlugin[];
|
|
73
|
-
/** Shared input-LRU bound. `max` is a finite non-negative integer; default 1500. */
|
|
74
|
-
readonly cache?: {
|
|
75
|
-
readonly max?: number;
|
|
76
|
-
} | false;
|
|
77
|
-
}
|
|
78
|
-
type ConflictMetaCarrier = {
|
|
79
|
-
readonly keywords: Readonly<Record<string, any>>;
|
|
80
|
-
readonly overlaps: Readonly<Record<string, any>>;
|
|
81
|
-
};
|
|
82
|
-
type MergerPluginCarrier = {
|
|
83
|
-
readonly name: string;
|
|
84
|
-
readonly conflicts?: ConflictMetaCarrier;
|
|
85
|
-
readonly tokens?: MergerPlugin["tokens"];
|
|
86
|
-
readonly group?: MergerPlugin["group"];
|
|
87
|
-
readonly finalize?: MergerPlugin["finalize"];
|
|
88
|
-
readonly resolveFamily?: MergerPlugin["resolveFamily"];
|
|
89
|
-
readonly resolve?: MergerPlugin["resolve"];
|
|
90
|
-
};
|
|
91
|
-
type MergerOptionsCarrier = {
|
|
92
|
-
readonly conflicts?: ConflictMetaCarrier;
|
|
93
|
-
readonly overlap?: OverlapMode;
|
|
94
|
-
readonly plugins?: readonly MergerPluginCarrier[];
|
|
95
|
-
readonly cache?: {
|
|
96
|
-
readonly max?: number;
|
|
97
|
-
} | false;
|
|
98
|
-
};
|
|
99
|
-
type InvalidConflictTable<Table> = IsAny$1<Table> extends true ? never : Table extends NonRecordObject ? "invalid conflict table" : Table extends object ? { readonly [Key in Extract<keyof Table, string | number>]-?: IsAny$1<Table[Key]> extends true ? never : Table[Key] extends ConflictAtoms ? never : Key; }[Extract<keyof Table, string | number>] : "invalid conflict table";
|
|
100
|
-
type InvalidConflictMeta<Meta> = IsAny$1<Meta> extends true ? never : Meta extends {
|
|
101
|
-
readonly keywords: infer Keywords;
|
|
102
|
-
readonly overlaps: infer Overlaps;
|
|
103
|
-
} ? Exclude<Extract<keyof Meta, string | number>, "keywords" | "overlaps"> | InvalidConflictTable<Keywords> | InvalidConflictTable<Overlaps> : "invalid conflict metadata";
|
|
104
|
-
type InvalidPlugin<Plugin> = Plugin extends unknown ? IsAny$1<Plugin> extends true ? never : Plugin extends MergerPluginCarrier ? Exclude<Extract<keyof Plugin, string | number>, Extract<keyof MergerPluginCarrier, string | number>> | ("conflicts" extends keyof Plugin ? InvalidConflictMeta<Exclude<Plugin["conflicts"], undefined>> : never) : "invalid plugin" : never;
|
|
105
|
-
type InvalidPlugins<Plugins> = Plugins extends readonly (infer Plugin)[] ? InvalidPlugin<Plugin> : "invalid plugins";
|
|
106
|
-
type InvalidMergerOptions<Options> = IsAny$1<Options> extends true ? never : Options extends MergerOptionsCarrier ? Exclude<Extract<keyof Options, string | number>, Extract<keyof MergerOptionsCarrier, string | number>> | ("conflicts" extends keyof Options ? InvalidConflictMeta<Exclude<Options["conflicts"], undefined>> : never) | ("plugins" extends keyof Options ? InvalidPlugins<Exclude<Options["plugins"], undefined>> : never) : "invalid merger options";
|
|
107
18
|
interface Merger {
|
|
108
19
|
(strings: TemplateStringsArray, ...expressions: ClassValue[]): string;
|
|
109
20
|
(...inputs: ClassValue[]): string;
|
|
110
21
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
readonly
|
|
115
|
-
readonly
|
|
116
|
-
readonly
|
|
117
|
-
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/merge.d.ts
|
|
24
|
+
interface Token {
|
|
25
|
+
readonly raw: string;
|
|
26
|
+
readonly id: number;
|
|
27
|
+
readonly important: number;
|
|
28
|
+
readonly condition: string;
|
|
29
|
+
readonly identity: string;
|
|
30
|
+
readonly family: number;
|
|
31
|
+
}
|
|
32
|
+
interface PreparedFragment {
|
|
33
|
+
readonly raw: string;
|
|
34
|
+
readonly tokens?: readonly Token[];
|
|
118
35
|
}
|
|
119
|
-
|
|
120
|
-
export declare function createMerger<const Options extends MergerOptionsCarrier = {}>(options?: MergerOptionsCarrier & Options & (InvalidMergerOptions<Options> extends never ? unknown : never)): Merger;
|
|
121
|
-
export declare function createMerger(options?: MergerOptions): Merger;
|
|
36
|
+
declare const cn: Merger, prepareFragment: (raw: string) => PreparedFragment, mergePrepared: (fragments: readonly PreparedFragment[], caller: ClassValue) => string;
|
|
122
37
|
//#endregion
|
|
123
38
|
//#region src/recipe.d.ts
|
|
124
39
|
type ClassProp = {
|
|
125
40
|
className?: ClassValue;
|
|
126
41
|
};
|
|
127
|
-
type RecipeMerger = (this: void, ...inputs: ClassValue[]) => string;
|
|
128
|
-
type ReciperOptions = {
|
|
129
|
-
readonly apply?: never;
|
|
130
|
-
readonly bind?: never;
|
|
131
|
-
readonly call?: never;
|
|
132
|
-
readonly length?: never;
|
|
133
|
-
readonly merge: RecipeMerger;
|
|
134
|
-
readonly prototype?: never;
|
|
135
|
-
};
|
|
136
42
|
type ReservedSlotName = "class" | "className" | "then" | "toJSON" | "toString" | "valueOf";
|
|
137
43
|
type ReservedVariantName = "class" | "className" | "classKeys";
|
|
138
44
|
type StaticallyUnsafeSchemaName = "__proto__";
|
|
@@ -153,7 +59,7 @@ type DefinitionVariantSelections<Variants extends VariantSchema> = VariantSelect
|
|
|
153
59
|
* Read-only introspection snapshot carried by every recipe function so
|
|
154
60
|
* tooling (dead-token guards, docs generators, Storybook controls) can
|
|
155
61
|
* enumerate the variant space without parsing source. `anatomy` lists the
|
|
156
|
-
* declared `
|
|
62
|
+
* declared `defaults` object keys (empty for single-element recipes),
|
|
157
63
|
* `variants` maps each axis to its choice names, `defaultVariants` reports
|
|
158
64
|
* declared defaults (booleans in their normalized `"true"`/`"false"`
|
|
159
65
|
* spelling), and `compoundVariantCount` counts the declared compound
|
|
@@ -242,21 +148,21 @@ type ValidateMultiElementCompoundEntry<Entry, Slots extends string, Variants ext
|
|
|
242
148
|
type ValidateSingleCompounds<Compounds, Variants extends VariantSchema> = Compounds extends readonly unknown[] ? { readonly [Index in keyof Compounds]: ValidateSingleCompoundEntry<Compounds[Index], Variants>; } : unknown;
|
|
243
149
|
type ValidateMultiElementCompounds<Compounds, Slots extends string, Variants extends VariantSchema> = Compounds extends readonly unknown[] ? { readonly [Index in keyof Compounds]: ValidateMultiElementCompoundEntry<Compounds[Index], Slots, Variants>; } : unknown;
|
|
244
150
|
type SingleRecipeDefinition<Style extends string, Parent extends SingleBrandedRecipe | undefined, Variants extends VariantsInput | undefined, Compounds extends readonly SingleCompoundDefinition<EffectiveVariants<Parent, Variants>>[] | undefined> = {
|
|
245
|
-
readonly
|
|
151
|
+
readonly defaults: Style;
|
|
246
152
|
readonly variants?: (Variants & ValidateStableSchema<Exclude<Variants, undefined>> & AllowedVariantNames<Variants> & ValidateSingleVariants<Variants>) | undefined;
|
|
247
153
|
readonly defaultVariants?: DefinitionVariantSelections<NoInfer<EffectiveVariants<Parent, Variants>>> | undefined;
|
|
248
154
|
readonly compoundVariants?: (Compounds & ValidateSingleCompounds<Compounds, EffectiveVariants<Parent, Variants>>) | undefined;
|
|
249
155
|
readonly extend?: (Parent & ValidateNonUnion<Parent>) | undefined;
|
|
250
156
|
};
|
|
251
157
|
type MultiElementRecipeDefinition<Styles extends StylesInput, Parent extends MultiElementBrandedRecipe | undefined, Variants extends VariantsInput | undefined, Compounds extends readonly MultiElementCompoundDefinition<EffectiveSlots<Parent, Styles>, EffectiveVariants<Parent, Variants>>[] | undefined> = {
|
|
252
|
-
readonly
|
|
158
|
+
readonly defaults: Styles & ValidateStyles<Styles> & ValidateStableSchema<Styles> & AllowedSlotNames<Styles>;
|
|
253
159
|
readonly variants?: (Variants & ValidateStableSchema<Exclude<Variants, undefined>> & AllowedVariantNames<Variants> & ValidateMultiElementVariants<Variants, EffectiveSlots<Parent, Styles>>) | undefined;
|
|
254
160
|
readonly defaultVariants?: DefinitionVariantSelections<NoInfer<EffectiveVariants<Parent, Variants>>> | undefined;
|
|
255
161
|
readonly compoundVariants?: (Compounds & ValidateMultiElementCompounds<Compounds, EffectiveSlots<Parent, Styles>, EffectiveVariants<Parent, Variants>>) | undefined;
|
|
256
162
|
readonly extend?: (Parent & ValidateNonUnion<Parent>) | undefined;
|
|
257
163
|
};
|
|
258
164
|
type RecipeInference<Styles, Parent, Variants, Compounds> = {
|
|
259
|
-
readonly
|
|
165
|
+
readonly defaults: Styles;
|
|
260
166
|
readonly variants?: Variants | undefined;
|
|
261
167
|
readonly compoundVariants?: Compounds | undefined;
|
|
262
168
|
readonly extend?: Parent;
|
|
@@ -264,12 +170,12 @@ type RecipeInference<Styles, Parent, Variants, Compounds> = {
|
|
|
264
170
|
type ExtendedRecipeInference<Styles, Parent, Variants, Compounds> = Omit<RecipeInference<Styles, Parent, Variants, Compounds>, "extend"> & {
|
|
265
171
|
readonly extend: Parent;
|
|
266
172
|
};
|
|
267
|
-
type InheritedRecipeInference<Parent, Variants, Compounds> = Omit<ExtendedRecipeInference<never, Parent, Variants, Compounds>, "
|
|
268
|
-
type InheritedSingleRecipeDefinition<Parent extends SingleBrandedRecipe, Variants extends VariantsInput | undefined, Compounds extends readonly SingleCompoundDefinition<EffectiveVariants<Parent, Variants>>[] | undefined> = Omit<SingleRecipeDefinition<string, Parent, Variants, Compounds>, "
|
|
269
|
-
type InheritedMultiElementRecipeDefinition<Parent extends MultiElementBrandedRecipe, Variants extends VariantsInput | undefined, Compounds extends readonly MultiElementCompoundDefinition<ParentClassKeys<Parent>, EffectiveVariants<Parent, Variants>>[] | undefined> = Omit<MultiElementRecipeDefinition<{}, Parent, Variants, Compounds>, "
|
|
270
|
-
type RecipeDefinitionField = "
|
|
173
|
+
type InheritedRecipeInference<Parent, Variants, Compounds> = Omit<ExtendedRecipeInference<never, Parent, Variants, Compounds>, "defaults">;
|
|
174
|
+
type InheritedSingleRecipeDefinition<Parent extends SingleBrandedRecipe, Variants extends VariantsInput | undefined, Compounds extends readonly SingleCompoundDefinition<EffectiveVariants<Parent, Variants>>[] | undefined> = Omit<SingleRecipeDefinition<string, Parent, Variants, Compounds>, "defaults">;
|
|
175
|
+
type InheritedMultiElementRecipeDefinition<Parent extends MultiElementBrandedRecipe, Variants extends VariantsInput | undefined, Compounds extends readonly MultiElementCompoundDefinition<ParentClassKeys<Parent>, EffectiveVariants<Parent, Variants>>[] | undefined> = Omit<MultiElementRecipeDefinition<{}, Parent, Variants, Compounds>, "defaults">;
|
|
176
|
+
type RecipeDefinitionField = "defaults" | "compoundVariants" | "defaultVariants" | "extend" | "variants";
|
|
271
177
|
type ValidateDefinitionInput<Definition> = ValidateRecordShape<Definition> & ValidateKnownKeys<Definition, RecipeDefinitionField>;
|
|
272
|
-
type ValidateInheritedDefinitionInput<Definition> = ValidateRecordShape<Definition> & ValidateKnownKeys<Definition, Exclude<RecipeDefinitionField, "
|
|
178
|
+
type ValidateInheritedDefinitionInput<Definition> = ValidateRecordShape<Definition> & ValidateKnownKeys<Definition, Exclude<RecipeDefinitionField, "defaults">>;
|
|
273
179
|
type Reciper = {
|
|
274
180
|
<const Style extends string, const Variants extends VariantsInput | undefined = undefined, const Compounds extends readonly SingleCompoundDefinition<EffectiveVariants<undefined, Variants>>[] | undefined = undefined, const Definition = unknown>(definition: RecipeInference<Style, undefined, Variants, Compounds> & Definition & NoInfer<SingleRecipeDefinition<Style, undefined, Variants, Compounds>> & NoInfer<ValidateDefinitionInput<Definition>>): TeaSingleRecipe<EffectiveVariants<undefined, Variants>>;
|
|
275
181
|
<const Parent extends SingleBrandedRecipe, const Style extends string, const Variants extends VariantsInput | undefined = undefined, const Compounds extends readonly SingleCompoundDefinition<EffectiveVariants<Parent, Variants>>[] | undefined = undefined, const Definition = unknown>(definition: ExtendedRecipeInference<Style, Parent, Variants, Compounds> & Definition & NoInfer<SingleRecipeDefinition<Style, Parent, Variants, Compounds>> & NoInfer<ValidateDefinitionInput<Definition>>): TeaSingleRecipe<EffectiveVariants<Parent, Variants>>;
|
|
@@ -279,9 +185,6 @@ type Reciper = {
|
|
|
279
185
|
<const Parent extends MultiElementBrandedRecipe, const Styles extends StylesInput, const Variants extends VariantsInput | undefined = undefined, const Compounds extends readonly MultiElementCompoundDefinition<EffectiveSlots<Parent, Styles>, EffectiveVariants<Parent, Variants>>[] | undefined = undefined, const Definition = unknown>(definition: ExtendedRecipeInference<Styles, Parent, Variants, Compounds> & Definition & NoInfer<MultiElementRecipeDefinition<Styles, Parent, Variants, Compounds>> & NoInfer<ValidateDefinitionInput<Definition>>): TeaMultiElementRecipe<EffectiveSlots<Parent, Styles>, EffectiveVariants<Parent, Variants>>;
|
|
280
186
|
};
|
|
281
187
|
type VariantProps<Recipe> = Recipe extends RecipeCarrier & ((props?: infer Props) => unknown) ? VariantSelections<SchemaFromSelections<Props>> : never;
|
|
282
|
-
export declare
|
|
283
|
-
readonly merge: RecipeMerger;
|
|
284
|
-
} & Options & NoInfer<ValidateRecordShape<Options> & ValidateKnownKeys<Options, "merge">>): Reciper;
|
|
285
|
-
export declare function createReciper(options: ReciperOptions): Reciper;
|
|
188
|
+
export declare const recipe: Reciper;
|
|
286
189
|
//#endregion
|
|
287
|
-
export type
|
|
190
|
+
export { type ClassDict, type ClassProp, type ClassValue, type Merger, type RecipeIntrospection, type Reciper, type VariantProps, cn };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e,t){let n={...e},r=new Set(t.map(e=>e.toLowerCase()));for(let e of Object.keys(n))r.has(e.toLowerCase())&&delete n[e];return n}function t(e,t){Object.defineProperty(e,e.length,{configurable:!0,enumerable:!0,value:t,writable:!0})}function n(e,t){let n=e.length;n in e?Object.defineProperty(e,n,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[n]=t}function r(e){let t=[],r=[],i=new Map,a=!1,o,s;for(let c=0;c<e.length;c++){let l=e[c];if(r.length===0){l===`\\`?(/\s/.test(e[c+1]??``)&&(o=void 0),c++):/\s/.test(l)?o=void 0:l===`"`||l===`'`?o=o===l?void 0:o??l:!o&&l===`[`&&n(r,c);continue}if((s||a)&&l===`[`&&/[:@\s]/.test(e[c-1])){n(r,c),i.set(c,s??a),a=!1,s=void 0;continue}if(a){l===`*`&&e[c+1]===`/`&&(a=!1,c++);continue}if(s){l===`\\`?c++:l===s&&(s=void 0);continue}if(l===`/`&&e[c+1]===`*`)a=!0,c++;else if(l===`"`||l===`'`)s=l;else if(l===`\\`)c++;else if(l===`[`)n(r,c);else if(l===`]`){let o=r.pop(),l=i.get(o);(/[:@]/.test(e[o-1])||e[c+1]===`:`)&&n(t,{end:c+1,start:o}),l===!0?a=!0:l&&(s=l)}}let c=[];for(let e of t.sort((e,t)=>e.start-t.start||t.end-e.end))(!c.length||e.start>=c.at(-1).end)&&n(c,e);return c}function i(e){let t=``,r,i=-1,a=-1,o=-1,s=[];for(let c=0;c<e.length;c++){let l=e[c];if(r){l===`\\`?c++:l===r&&(r=void 0);continue}if((t.length>0||a!==-1)&&l===`\\`){c++;continue}if(t.length>0&&(l===`"`||l===`'`)){r=l;continue}if((t.length>0||a!==-1)&&l===`/`&&e[c+1]===`*`){let t=e.indexOf(`*/`,c+2);if(t<0)break;c=t+1;continue}l===`(`||l===`[`?t+=l===`(`?`)`:`]`:l===t.at(-1)?t=t.slice(0,-1):t.length===0&&(l===`@`?(a===-1&&(a=c),n(s,c)):a===-1&&(l===`:`&&i===-1?i=c:l===`!`&&(o=c)))}let c=a===-1?e.length:a,l=e.slice(0,c),u=!1;c>0&&o===c-1&&(u=!0,l=l.slice(0,-1));let d=[];for(let t=0;t<s.length;t++){let r=s[t]+1,i=t+1<s.length?s[t+1]:e.length;n(d,e.slice(r,i))}return i!==-1&&i<c?{raw:e,body:l,property:e.slice(0,i),value:l.slice(i+1),keyword:!1,important:u,conditions:d}:{raw:e,body:l,keyword:!0,important:u,conditions:d}}function a(e,n,r){let i=e[n];if(r.blockComment)return i===`*`&&e[n+1]===`/`?(r.blockComment=!1,n+1):n;if(r.quote)return i===`\\`?n+1:(i===r.quote&&(r.quote=void 0),n);if(r.closers.length>0&&i===`/`&&e[n+1]===`*`)return r.blockComment=!0,n+1;if(r.closers.length>0&&(i===`"`||i===`'`))return r.quote=i,n;if(i===`\\`)return n+1;if(i===`(`||i===`[`)return t(r.closers,i===`(`?`)`:`]`),n;if(i===r.closers.at(-1))return r.closers.pop(),n}function o(e,t,n=e.length){let r={closers:[]};for(let i=t+1;i<n;i++){let t=e[i],n=a(e,i,r);if(n!==void 0){i=n;continue}if(r.closers.length===0){if(t===`}`)return{index:i,kind:`close`};if(t===`{`)return{index:i,kind:`open`}}}return{index:n,kind:`limit`}}const s=/[\s'"`;{},\])]/;function c(e,t,n=e.length){if(e[t]!==`@`)return{conds:``,end:t};let r={closers:[]},i=t;for(;i<n;i++){let t=e[i],n=a(e,i,r);if(n!==void 0){i=n;continue}if(t===`/`&&(e[i+1]===`/`||e[i+1]===`*`)&&r.closers.length===0||s.test(t)&&r.closers.length===0)break}return{conds:e.slice(t,i),end:i}}function l(e,n=!1){let r=[],i={closers:[]},o=0;for(let s=0;s<e.length;s++){let c=e[s],l=a(e,s,i);if(l!==void 0){s=l;continue}(c===`;`||n&&/\s/.test(c))&&i.closers.length===0&&(t(r,e.slice(o,s)),o=s+1)}return t(r,e.slice(o)),r.map(e=>e.trim()).filter(Boolean)}const u=/^(?:--?[\w-]+|[A-Z_$][\w$-]*|@teacss-skip-bracket-[\da-z]{6})$/i;function d(e,t){let n=t;for(;n>0&&/[\w-]/.test(e[n-1]);)n--;if(n===t||e[n-1]!==`:`)return!1;let r=n-1,i=r;for(;i>0&&/[\w$@-]/.test(e[i-1]);)i--;if(!u.test(e.slice(i,r)))return!1;let a=i-1;for(;a>=0&&/\s/.test(e[a]);)a--;return a<0||!`{,?`.includes(e[a])}function f(e){let n=[],r=[],i=[],a=!1,o;for(let s=0;s<e.length;s++){let c=e[s],l=e[s+1];if(r.length===0){c===`(`&&d(e,s)&&t(r,{attached:!0,start:s});continue}if(a)c===`*`&&l===`/`&&(a=!1,s++);else if(o)c===`\\`?s++:c===o&&(o=void 0);else if(c===`\\`)s++;else if(c===`/`&&l===`*`)a=!0,s++;else if(c===`'`||c===`"`||c==="`")o=c;else if(i.length>0)c===`[`||c===`(`?t(i,c===`[`?`]`:`)`):c===i.at(-1)&&i.pop();else if(c===`[`)t(i,`]`);else if(c===`(`)t(r,{attached:d(e,s),start:s});else if(c===`)`){let e=r.pop();e.attached&&t(n,{end:s+1,start:e.start})}}let s=[];for(let e of n.sort((e,t)=>e.start-t.start||t.end-e.end))(s.length===0||e.start>=s.at(-1).end)&&t(s,e);return s}function p(e){let t={seen:!1},n=m(e,t);for(let e=1;e<5&&t.seen;e++){t.seen=!1;let e=m(n,t);if(e===n)break;n=e}return n}function m(e,t){if(!e.includes(`{`))return e;let n=``,i=0,s=-1,u=0,d=0,p=e.includes(`[`)?r(e):[],m=e.includes(`(`)?f(e):[],h={closers:[]};for(;i<e.length;){for(;u<p.length&&p[u].end<=i;)u++;for(;d<m.length&&m[d].end<=i;)d++;let r=u<p.length?p[u]:void 0,f=d<m.length?m[d]:void 0,g=r?.start===i?r:f?.start===i?f:void 0;if(g&&h.blockComment!==!0&&h.quote===void 0){n+=e.slice(i,g.end),i=g.end;continue}h.closers.length>0&&/\s/.test(e[i])&&(h.blockComment=!1,h.closers.length=0,h.quote=void 0);let _=a(e,i,h);if(_!==void 0){n+=e.slice(i,_+1),i=_+1;continue}let v=e[i];if(h.closers.length>0||v!==`{`){n+=v,i++;continue}let y=o(e,i);if(y.kind!==`close`){y.kind===`open`&&t&&(t.seen=!0),n+=e.slice(i,y.index),i=y.index;continue}let b=y.index,x=e.slice(i+1,b),{conds:S,end:C}=c(e,b+1),w=l(x,!0);if(w.length===0){n+=v,i++;continue}s===i&&n.length>0&&!/\s/.test(n.at(-1))&&(n+=` `),n+=w.map(e=>`${e}${S}`).join(` `),s=C,i=C}return n}function h(e){let t=e.split(/\s+/);return t[0]===``&&t.shift(),t.at(-1)===``&&t.pop(),t}function g(e){if(!e.includes(`[`))return h(e);let t=r(e);if(t.length===0)return h(e);let i=[],a=0,o=-1;for(let r=0;r<e.length;r++){let s=t[a];if(s&&r===s.start){o<0&&(o=r),r=s.end-1,a++;continue}/\s/.test(e[r])?(o>=0&&n(i,e.slice(o,r)),o=-1):o<0&&(o=r)}return o>=0&&n(i,e.slice(o)),i}const _=!1;var v=class extends TypeError{name=`MergerProtocolError`;code;plugin;hook;constructor(e,t,n,r){super(`[TeaCSS merge:${e}] ${t}`),this.code=e,n!==void 0&&(this.plugin=n),r!==void 0&&(this.hook=r)}};function y(){return Object.create(null)}const b=`must have an integer length from 0 through 4294967294`,x=Symbol(`missing-own-value`);function S(e,t){return`value`in t?t.value:t.get===void 0?void 0:Reflect.apply(t.get,e,[])}function C(e,t){let n=Reflect.getOwnPropertyDescriptor(e,t);return n===void 0?x:S(e,n)}function w(e,t){let n=C(e,t);return n===x?void 0:n}function ee(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0})}function T(e,t){let n=e.length;n in e?ee(e,n,t):e[n]=t}function E(e){let t=C(e,`length`);return typeof t==`number`&&Number.isInteger(t)&&t>=0&&t<4294967295?t:null}function D(e){let t=``,n=E(e);if(n===null)throw new v(`INVALID_ARRAY_LENGTH`,`class-value array ${b}`);for(let r=0;r<n;r++){let n=C(e,r);if(n===x)continue;let i=te(n);i&&(t+=(t&&` `)+i)}return t}function te(e){if(!e)return``;if(typeof e==`string`)return e;if(typeof e==`number`||typeof e==`bigint`)return String(e);if(Array.isArray(e))return D(e);if(typeof e==`object`){let t=e,n=``;for(let e of Reflect.ownKeys(t)){if(typeof e!=`string`)continue;let r=Reflect.getOwnPropertyDescriptor(t,e);r!==void 0&&r.enumerable&&S(t,r)&&(n+=(n&&` `)+e)}return n}return``}function O(e,t){let n=e;for(let e of t){let t=n.children??(n.children=new Map),r=t.get(e);r===void 0&&(r=y(),t.set(e,r)),n=r}return n}function ne(e,t,n){let r=O(e,t);return n?r.keywords??=new Map:r.declarations??=new Map}function re(e){if(e.length===0)return``;if(e.length===1){let t=C(e,0);return t===x?``:t??``}let t=y(),n=new Uint8Array(e.length),r=new Uint8Array(e.length);for(let a=0;a<e.length;a++){let o=i(e[a]),s=ne(t,o.conditions,o.keyword),c=o.property??o.body,l=s.get(c);n[a]=+!!o.important,l===void 0?s.set(c,a):n[l]!==0&&n[a]===0?r[a]=1:(r[l]=1,s.set(c,a))}let a=[];for(let t=0;t<e.length;t++)r[t]===0&&T(a,e[t]);return a.join(` `)}function ie(e,t){if(typeof e==`string`)return e.length===0?null:[e];if(!Array.isArray(e))return null;let n=E(e);if(n===null||n===0)return null;let r=[],i=null;for(let a=0;a<n;a++){let n=C(e,a);if(n===x||typeof n!=`string`||n.length===0)return null;(i===null?r.includes(n):i.has(n))||(T(r,n),i===null?r.length===(t?64:4)&&(i=new Set(r)):i.add(n))}return t&&r.length>1&&r.sort(),r}function ae(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function k(e,t,n,r,i){for(let a of Reflect.ownKeys(t)){if(typeof a!=`string`)continue;let o=Reflect.getOwnPropertyDescriptor(t,a);if(o===void 0||!o.enumerable)continue;let s=ie(S(t,o),!0);if(s===null)throw new v(`INVALID_STATIC_CONFLICT`,`"${r}" ${n} "${a}" must contain at least one non-empty atom`,i);let c=e.get(a);if(c===void 0){e.set(a,{atoms:s,atomSet:s.length>4?new Set(s):null,source:r});continue}if(!ae(c.atoms,s))throw new v(`STATIC_CONFLICT_COLLISION`,`static ${n} "${a}" has conflicting atom sets from "${c.source}" and "${r}"`,i)}}function oe(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function A(e){if(!oe(e))return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function se(e,t,n){if(!oe(e))throw new v(`INVALID_CONFLICT_META`,`"${t}" conflicts must be an object`,n);let r=w(e,`keywords`);if(!A(r))throw new v(`INVALID_CONFLICT_META`,`"${t}" keywords must be a record`,n);let i=w(e,`overlaps`);if(!A(i))throw new v(`INVALID_CONFLICT_META`,`"${t}" overlaps must be a record`,n);return{keywords:r,overlaps:i}}function j(e,t,n,r){if(n!==void 0){if(typeof n!=`function`)throw new v(`INVALID_PLUGIN_HOOK`,`plugin "${e}" ${t} must be a function`,e,r);return n}}function ce(e){let t=[],n=[],r=[],i=[],a=[],o=new Set,s=E(e);if(s===null)throw new v(`INVALID_OPTIONS`,`options.plugins must be an array with an integer length from 0 through 4294967294`);for(let c=0;c<s;c++){let s=C(e,c),l=s===x?void 0:s;if(!oe(l))throw new v(`INVALID_PLUGIN_NAME`,`plugin at index ${c} must have a non-empty name`);let u=w(l,`name`);if(typeof u!=`string`||u.length===0)throw new v(`INVALID_PLUGIN_NAME`,`plugin at index ${c} must have a non-empty name`);if(o.has(u))throw new v(`DUPLICATE_PLUGIN_NAME`,`duplicate plugin name "${u}"`,u);o.add(u);let d=w(l,`conflicts`),f=j(u,`tokens`,w(l,`tokens`),`tokens`),p=j(u,`group`,w(l,`group`),`group`),m=j(u,`finalize`,w(l,`finalize`),`finalize`),h=j(u,`resolveFamily`,w(l,`resolveFamily`),`resolveFamily`),g=j(u,`resolve`,w(l,`resolve`),`resolve`);if(h!==void 0&&g===void 0)throw new v(`INVALID_PLUGIN_HOOK`,`plugin "${u}" resolveFamily requires resolve`,u,`resolveFamily`);T(t,{name:u,conflicts:d===void 0?void 0:se(d,u,u)}),f!==void 0&&T(n,{name:u,hook:f}),p!==void 0&&T(r,{name:u,hook:p}),m!==void 0&&T(i,{name:u,hook:m}),g!==void 0&&T(a,{name:u,hook:g,family:h})}return{metadata:t,tokens:n,groups:r,finalizers:i,resolvers:a,allResolversScoped:a.every(e=>e.family!==void 0)}}function le(e,t){let n=new Map,r=new Map;e!==void 0&&(k(n,e.keywords,`keyword`,`<options.conflicts>`),k(r,e.overlaps,`declaration`,`<options.conflicts>`));for(let e of t)e.conflicts!==void 0&&(k(n,e.conflicts.keywords,`keyword`,e.name,e.name),k(r,e.conflicts.overlaps,`declaration`,e.name,e.name));return{keywords:n,overlaps:r}}function ue(e){let t=i(e);return{raw:e,prefix:t.property??t.body,body:t.body,value:t.value,keyword:t.keyword,conditions:t.conditions,important:t.important}}function de(){let e=new Map;return t=>{let n=e.get(t);if(n!==void 0)return n;let r=ue(t);return e.set(t,r),r}}function fe(e,t,n){if(t.length===0)return e;let r=e,i={viewToken:n};for(let e of t){let t=e.hook,n=t(r,i),a=`plugin "${e.name}" tokens() must return an array of individual non-empty class tokens`;if(!Array.isArray(n))throw new v(`INVALID_TOKEN_TRANSFORM_RESULT`,a,e.name,`tokens`);let o=[],s=E(n);if(s===null)throw new v(`INVALID_TOKEN_TRANSFORM_RESULT`,a,e.name,`tokens`);for(let t=0;t<s;t++){let r=C(n,t);if(r===x||typeof r!=`string`||r.length===0)throw new v(`INVALID_TOKEN_TRANSFORM_RESULT`,a,e.name,`tokens`);let i=g(r);if(i.length!==1||i[0]!==r)throw new v(`INVALID_TOKEN_TRANSFORM_RESULT`,a,e.name,`tokens`);T(o,r)}r=o}return r}function pe(e,t){let n=null;for(let r=0;r<t.length;r++){let i=t[r];if(i.family===void 0)continue;let a=i.family,o=a(e);if(o!==null&&(typeof o!=`string`||o.length===0))throw new v(`INVALID_RESOLVE_FAMILY_RESULT`,`plugin "${i.name}" resolveFamily() must return null or a non-empty string`,i.name,`resolveFamily`);o!==null&&((n??=Array.from({length:t.length},()=>null))[r]=o)}return n}function me(e,t,n,r,i,a){let o=a(e);for(let e of n){let n=e.hook,i=n(o);if(i===null)continue;if(i===!1)return{id:t,view:o,atoms:[],atomSet:null,pluginGrouped:!0,opaque:!0,resolverFamilies:null};let a=ie(i,!1);if(a===null)throw new v(`INVALID_GROUP_RESULT`,`plugin "${e.name}" group() must return null, MERGE_OPAQUE, or at least one non-empty atom`,e.name,`group`);return{id:t,view:o,atoms:a,atomSet:a.length>4?new Set(a):null,pluginGrouped:!0,opaque:!1,resolverFamilies:pe(o,r)}}let s=o.keyword?i.keywords.get(o.prefix):i.overlaps.get(o.prefix);return{id:t,view:o,atoms:s===void 0?[o.keyword?`@teacss/classes:keyword:${o.prefix}`:`@teacss/classes:declaration:${o.prefix}`]:s.atoms,atomSet:s===void 0?null:s.atomSet,opaque:!1,resolverFamilies:pe(o,r)}}function he(e,t){let n=new Map;for(let r of e){if(!r.opaque)continue;let e=n.get(r.view.raw);e!==void 0&&(t[e]=1),n.set(r.view.raw,r.id)}}function M(e,t){return new v(`INVALID_FINALIZER_RESULT`,`plugin "${e}" finalize() returned invalid occurrence id ${typeof t==`bigint`?`${t}n`:typeof t==`number`||typeof t==`boolean`||t==null?String(t):typeof t}`,e,`finalize`)}function ge(e,t){let n=[];for(let r of e)!r.opaque&&t[r.id]===0&&T(n,r);return n}function _e(e,t,n,r){let i=!1,a=r;for(let r of t){let t=r.hook,o=t(a?ge(e,n):e.slice());if(o===null)continue;if(!Array.isArray(o))throw M(r.name,o);let s=E(o);if(s===null)throw new v(`INVALID_FINALIZER_RESULT`,`plugin "${r.name}" finalize() result ${b}`,r.name,`finalize`);if(s===0)continue;let c=new Set;for(let t=0;t<s;t++){let i=C(o,t);if(i===x)throw M(r.name,void 0);let a=i;if(!Number.isInteger(a))throw M(r.name,a);let s=a,l=e[s];if(l===void 0||l.opaque||n[s]!==0||c.has(s))throw M(r.name,a);c.add(s)}for(let e of c)n[e]=1;c.size!==0&&(i=!0,a=!0)}return i}function ve(e,t){return e.atomSet?.has(t)??e.atoms.includes(t)}function ye(e,t){return e.pluginGrouped!==!0&&t.pluginGrouped!==!0&&e.view.keyword===t.view.keyword&&e.view.prefix===t.view.prefix}function be(e,t){if(ye(e,t))return!0;if(e.atoms.length<t.atoms.length)return!1;for(let n of t.atoms)if(!ve(e,n))return!1;return!0}function xe(e,t){if(e.atomSet!==null){for(let n of t.atoms)if(e.atomSet.has(n))return!0;return!1}if(t.atomSet!==null){for(let n of e.atoms)if(t.atomSet.has(n))return!0;return!1}for(let n of t.atoms)if(e.atoms.includes(n))return!0;return!1}function Se(e,t){let n=O(e,t);return n.winners??=new Map}function Ce(e,t,n){let r=y();for(let i of e){if(i.opaque||t[i.id]!==0)continue;let a=n?ne(r,i.view.conditions,i.view.keyword):Se(r,i.view.conditions),o=n?i.view.prefix:i.atoms[0],s=a.get(o);if(s===void 0){a.set(o,i.id);continue}e[s].view.important&&!i.view.important?t[i.id]=1:(t[s]=1,a.set(o,i.id))}}function we(e,t,n,r,i){return e.view.important===t.view.important?n||i===`symmetric`?`earlier`:`none`:t.view.important?n?`earlier`:`none`:r?`later`:`none`}function Te(e,t,n,r){let i=be(t,e),a=be(e,t),o=we(e,t,i,a,n);for(let n=0;n<r.length;n++){let s=r[n];if(s.family!==void 0){let r=e.resolverFamilies?.[n]??null,i=t.resolverFamilies?.[n]??null;if(r===null||r!==i)continue}let c=s.hook,l=c(e.view,t.view,{covers:i,earlierCoversLater:a,defaultDrop:o});if(l!==null){if(l===`earlier`||l===`later`||l===`none`)return l;throw new v(`INVALID_RESOLVE_RESULT`,`plugin "${s.name}" resolve() must return null, "earlier", "later", or "none"`,s.name,`resolve`)}}return o}function N(e,t,n,r,i){let a=Te(e,t,n,r);a===`earlier`?i[e.id]=1:a===`later`&&(i[t.id]=1)}function Ee(e,t,n,r,i){let a=t[e];for(let o=e+1;o<t.length;o++){let e=t[o];ae(a.view.conditions,e.view.conditions)&&(ye(a,e)||xe(a,e))&&N(a,e,n,r,i)}}function De(e,t){let n=O(e,t);return n.postings??=new Map}function Oe(e){let t=y(),n=[],r=[],i=e.length*(e.length-1)/2,a=0;for(let o=0;o<e.length;o++){let s=e[o],c=De(t,s.view.conditions),l=[];T(n,c),T(r,l);for(let e of s.atoms){let t=c.get(e);if(t===void 0&&(t=[],c.set(e,t)),a+=t.length,a>i)return null;T(l,t.length),T(t,o)}}return{postingMaps:n,positions:r,postingPairVisits:a}}function ke(e,t,n,r){for(let i=0;i<e.length;i++)Ee(i,e,t,n,r)}function Ae(e,t,n,r,i,a){if(a!==null){Ce(e,r,a===`static-prefix`);return}let o=i?ge(e,r):e;if(o.length<16){ke(o,t,n,r);return}let s=Oe(o);if(s===null){ke(o,t,n,r);return}if(s.postingPairVisits===0)return;let c=new Uint32Array(o.length),l=[];for(let e=0;e<o.length;e++){let i=o[e],a=s.postingMaps[e],u=s.positions[e];if(i.atoms.length===1){let e=a.get(i.atoms[0]);for(let a=u[0]+1;a<e.length;a++)N(i,o[e[a]],t,n,r);continue}let d=0;for(let e=0;e<i.atoms.length;e++){let t=a.get(i.atoms[e]);d+=t.length-u[e]-1}if(d>=o.length-e-1){Ee(e,o,t,n,r);continue}l.length=0;let f=!0,p=e+1;for(let e=0;e<i.atoms.length;e++){let t=a.get(i.atoms[e]);for(let n=u[e]+1;n<t.length;n++){let e=t[n];c[e]!==p&&(c[e]=p,l.length!==0&&e<l[l.length-1]&&(f=!1),T(l,e))}}f||l.sort((e,t)=>e-t);for(let e of l)N(i,o[e],t,n,r)}}function je(e,t,n,r,i){let a=fe(e,r.tokens,i);if(a.length<2&&r.groups.length===0&&r.finalizers.length===0&&r.resolvers.length===0){if(a.length===0)return``;let e=C(a,0);return e===x?``:e??``}let o=[],s=!1,c=a.length>=16&&r.allResolversScoped,l=c,u=c,d,f,p=0;for(let e=0;e<a.length;e++){let n=me(a[e],e,r.groups,r.resolvers,t,i);if(n.opaque)s=!0;else if(p++,n.atoms.length!==1&&(l=!1),n.pluginGrouped===!0?u=!1:d===void 0?(d=n.view.prefix,f=n.view.keyword):(n.view.prefix!==d||n.view.keyword!==f)&&(u=!1),n.resolverFamilies!==null){for(let e of n.resolverFamilies)if(e!==null){l=!1,u=!1;break}}T(o,n)}let m=new Uint8Array(o.length);s&&he(o,m);let h=_e(o,r.finalizers,m,s),g=p<16?null:l?`singleton`:u?`static-prefix`:null;Ae(o,n,r.resolvers,m,s||h,g);let _=[];for(let e of o)m[e.id]===0&&T(_,e.view.raw);return _.join(` `)}function Me(e,t,n){let r=C(e,n);if(r===x)return``;if(typeof r==`string`)return r;if(Array.isArray(t)){let e=C(t,n);if(typeof e==`string`)return e}return``}function Ne(e){return typeof e==`number`||typeof e==`bigint`?String(e):te(e)}function Pe(e,t,n){let r=``,i=E(e);if(i===null)throw new v(`INVALID_ARRAY_LENGTH`,`tagged-template strings ${b}`);for(let a=0;a<i;a++)if(r+=Me(e,t,a),a+1<i&&a+1<n.length){let e=Ne(n[a+1]);r+=e}return r}function Fe(e={}){if(!A(e))throw new v(`INVALID_OPTIONS`,`options must be an object`);let t=w(e,`conflicts`),n=w(e,`overlap`),r=w(e,`plugins`),i=w(e,`cache`);if(n!==void 0&&n!==`precise`&&n!==`symmetric`)throw new v(`INVALID_OPTIONS`,`options.overlap must be "precise" or "symmetric"`);if(r!==void 0&&!Array.isArray(r))throw new v(`INVALID_OPTIONS`,`options.plugins must be an array`);let a=ce(r===void 0?[]:r),o=le(t===void 0?void 0:se(t,`<options.conflicts>`),a.metadata),s=a.tokens.length!==0||a.groups.length!==0||a.finalizers.length!==0||a.resolvers.length!==0,c=!s&&o.keywords.size===0&&o.overlaps.size===0,l=n??`precise`,u=1500;if(i===!1)u=0;else if(i!==void 0){if(!A(i))throw new v(`INVALID_CACHE_OPTIONS`,`options.cache must be false or an object`);let e=w(i,`max`);if(e!==void 0){if(typeof e!=`number`||!Number.isFinite(e)||!Number.isInteger(e)||e<0)throw new v(`INVALID_CACHE_OPTIONS`,`options.cache.max must be a finite non-negative integer`);u=e}}let d=u>0?new Map:null;function f(e){if(d!==null){let t=d.get(e);if(t!==void 0)return d.delete(e),d.set(e,t),t}let t=g(p(e).trim()),n=c?re(t):je(t,o,l,a,s?de():ue);return d!==null&&(d.set(e,n),d.size>u&&d.delete(d.keys().next().value)),n}function m(...e){let t=e[0],n=Array.isArray(t)?C(t,`raw`):x;return f(Array.isArray(n)?Pe(t,n,e):D(e))}return m}const P=Object.prototype.propertyIsEnumerable,F=`definition.className`,I=`definition.variants`,L=`definition.defaultVariants`,R=`definition.compoundVariants`,z=`createReciper options`,B=`${z}.merge`,V=`recipe props`,H=`className`,Ie=`classKeys`,Le=`null is not allowed`,Re=`required own enumerable field`,ze=new Set([`className`,`variants`,`defaultVariants`,`compoundVariants`,`extend`]),Be=new Set([`class`,`className`,`then`,`toJSON`,`toString`,`valueOf`]),Ve=new Set([`class`,`className`,`classKeys`]);function U(e){return e.length>16?new Set(e):void 0}function W(e,t,n){return t?.has(n)??e.includes(n)}function G(e,t){return TypeError(`[TeaCSS recipe] ${e}: ${t}`)}function K(e,t){if(typeof e!=`object`||!e||Array.isArray(e))throw G(t,`expected a plain record`);let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)throw G(t,`expected Object.prototype or null prototype`);return Object.keys(e)}function He(e,t){if(typeof e!=`object`||!e||Array.isArray(e))throw G(t,`expected a non-null, non-array object`);return Object.keys(e)}function q(e,t,n){let r=Reflect.getOwnPropertyDescriptor(e,t);if(r===void 0||!r.enumerable)throw G(n,`expected an own enumerable field`);return`value`in r?r.value:r.get===void 0?void 0:Reflect.apply(r.get,e,[])}function Ue(e,t){let n=Reflect.getOwnPropertyDescriptor(e,`length`),r=n!==void 0&&`value`in n?n.value:void 0;if(typeof r!=`number`||!Number.isInteger(r)||r<0||r>=4294967295)throw G(t,`expected an array with a valid own length`);return r}function We(e,t,n){if(!Array.isArray(e))throw G(t,`expected an array`);let r=Object.keys(e),i=Ue(e,t);if(!n&&i===0)throw G(t,`expected a non-empty array`);if(r.length!==i)throw G(t,`expected a dense own-indexed array`);for(let e of r){let n=Number(e);if(!Number.isInteger(n)||n<0||n>=i||String(n)!==e)throw G(t,`expected a dense own-indexed array`)}let a=X(i);for(let n=0;n<i;n++)a[n]=q(e,n,`${t}[${n}]`);return a}function Ge(e,t){if(e.trim().length===0)throw G(t,`name must contain a non-whitespace character`)}function J(e){let t=D([e]);return t.length===0?void 0:t}function Y(e,t,n){if(n===void 0)return;let r=P.call(e,t)?e[t]:void 0;e[t]=r===void 0?[n]:[...r,n]}function X(e){let t=Array(e);for(let n=0;n<e;n++)n in t?ee(t,n,void 0):t[n]=void 0;return t}function Ke(){return[void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0]}const qe=Ke().length;function Je(e,t,n){t<qe||!(t in e)?e[t]=n:ee(e,t,n)}function Z(e,t=e.length){let n=X(t),r=Math.min(e.length,t);for(let t=0;t<r;t++){if(!P.call(e,t))continue;let r=e[t];r!==void 0&&(n[t]=[...r])}return n}function Ye(e,t){return e.map(e=>{let n=Object.create(null);for(let r of Object.keys(e.choices))n[r]={fragmentsBySlot:Z(e.choices[r].fragmentsBySlot,t)};return{name:e.name,choices:n,booleanCapable:e.booleanCapable}})}function Q(e,t,n){if(e===null)return null;if(typeof e==`string`){if(!P.call(t.choices,e))throw G(n,`unknown choice ${JSON.stringify(e)}`);return e}if(typeof e==`number`){if(!Number.isFinite(e))throw G(n,`expected a finite numeric choice`);let r=String(e);if(!P.call(t.choices,r))throw G(n,`unknown choice ${JSON.stringify(r)}`);return r}if(typeof e==`boolean`){if(!t.booleanCapable)throw G(n,`boolean selection requires a true or false choice`);return String(e)}throw G(n,`expected null, a declared string or finite numeric choice, or a supported boolean state`)}function Xe(e,t,n){if(n&&(e=t.slotNames.length===0?``:{}),typeof e==`string`){if(t!==void 0&&t.slotNames.length>0)throw G(F,`must be a record when extending a multi-element recipe`);let n=t===void 0?X(1):Z(t.baseFragmentsBySlot,1);return Y(n,0,J(e)),{names:[],indexes:Object.create(null),baseFragments:n}}let r=K(e,F);if(t!==void 0&&t.slotNames.length===0)throw G(F,`must be a string when extending a single-element recipe`);if(!n&&r.length===0)throw G(F,`expected at least one named class`);for(let e of r){let t=`${F}.${e}`;if(Ge(e,t),Be.has(e))throw G(t,`reserved class name`)}let i=t===void 0?[]:[...t.slotNames],a=Object.create(null);for(let e=0;e<i.length;e++)a[i[e]]=e;let o=t===void 0?[]:Z(t.baseFragmentsBySlot),s=e;for(let e of r){let t=a[e];t===void 0&&(t=i.length,T(i,e),a[e]=t,T(o,void 0)),Y(o,t,J(q(s,e,`${F}.${e}`)))}return{names:i,indexes:a,baseFragments:o}}function Ze(e,t,n,r,i,a){if(n){if(typeof t!=`string`)throw G(i,`expected a primitive string`);Y(e,0,J(t));return}let o=K(t,i);if(a&&o.length===0)throw G(i,`expected at least one class target`);let s=t;for(let t of o){let n=r[t];if(n===void 0)throw G(`${i}.${t}`,`unknown class target`);Y(e,n,J(q(s,t,`${i}.${t}`)))}}function Qe(e,t,n,r,i){let a=t===void 0?[]:Ye(t.variants,i),o=Object.create(null);for(let e=0;e<a.length;e++)o[a[e].name]=e;if(e===void 0)return{variants:a,indexes:o};if(e===null)throw G(I,Le);let s=K(e,I),c=e;for(let e of s){let t=`${I}.${e}`;if(Ge(e,t),Ve.has(e))throw G(t,`reserved variant name`);let s=q(c,e,t),l=K(s,t);if(l.length===0)throw G(t,`expected at least one choice`);let u=s,d=o[e],f;d===void 0?(d=a.length,o[e]=d,f=Object.create(null),T(a,{name:e,choices:f,booleanCapable:!1})):f=a[d].choices;for(let e of l){let a=`${t}.${e}`,o=q(u,e,a),s=f[e],c=s===void 0?X(i):Z(s.fragmentsBySlot,i);Ze(c,o,n,r,a,!1),f[e]={fragmentsBySlot:c}}a[d]={name:e,choices:f,booleanCapable:P.call(f,`true`)||P.call(f,`false`)}}return{variants:a,indexes:o}}function $e(e,t,n,r){let i=X(n.length);if(t!==void 0){let e=Math.min(t.defaultStates.length,n.length);for(let n=0;n<e;n++)P.call(t.defaultStates,n)&&(i[n]=t.defaultStates[n])}if(e===void 0)return i;if(e===null)throw G(L,Le);let a=K(e,L),o=U(a);for(let e of a)if(r[e]===void 0)throw G(`${L}.${e}`,`unknown variant`);let s=e;for(let e=0;e<n.length;e++){let t=n[e];if(!W(a,o,t.name))continue;let r=`${L}.${t.name}`,c=q(s,t.name,r);c!==void 0&&(i[e]=Q(c,t,r))}return i}function et(e,t,n){if(!Array.isArray(e)){if(e===void 0)throw G(n,`undefined is not a condition`);return[Q(e,t,n)]}let r=We(e,n,!1),i=[];for(let e=0;e<r.length;e++){let a=r[e];if(a===void 0)throw G(`${n}[${e}]`,`undefined is not a condition`);T(i,Q(a,t,`${n}[${e}]`))}return i}function tt(e,t,n,r,i,a,o){let s=t===void 0?[]:t.compounds.map(e=>({conditions:e.conditions,fragmentsBySlot:Z(e.fragmentsBySlot,i)}));if(e===void 0)return s;if(e===null)throw G(R,Le);let c=We(e,R,!0);for(let e=0;e<c.length;e++){let t=c[e],l=`${R}[${e}]`,u=K(t,l),d=U(u),f=W(u,d,Ie);if(!W(u,d,H))throw G(`${l}.className`,n||f?`required own enumerable string`:`required own enumerable class map`);for(let e of u)if(e!==H&&e!==Ie&&o[e]===void 0)throw G(`${l}.${e}`,`unknown variant condition`);let p=t,m=[];for(let e=0;e<a.length;e++){let t=a[e];if(!W(u,d,t.name))continue;let n=`${l}.${t.name}`;T(m,{variantIndex:e,states:et(q(p,t.name,n),t,n)})}let h=`${l}.className`,g=q(p,H,h),_=X(i);if(f){let e=`${l}.classKeys`;if(n)throw G(e,`only valid for multi-element recipes`);if(typeof g!=`string`)throw G(h,`expected a primitive string when classKeys is present`);let t=We(q(p,Ie,e),e,!1),i=J(g);for(let n=0;n<t.length;n++){let a=t[n],o=`${e}[${n}]`;if(typeof a!=`string`)throw G(o,`expected a declared class name`);let s=r[a];if(s===void 0)throw G(o,`unknown class target`);if(t.indexOf(a)!==n)throw G(o,`duplicate class target ${JSON.stringify(a)}`);Y(_,s,i)}}else Ze(_,g,n,r,h,!0);T(s,{conditions:m,fragmentsBySlot:_})}return s}function nt(e,t){let n=K(e,`definition`);for(let e of n)if(!ze.has(e))throw G(`definition.${e}`,`unknown field`);let r=e,i;if(n.includes(`extend`)){let e=q(r,`extend`,`definition.extend`);if(e!==void 0&&(typeof e!=`function`||(i=t.get(e))===void 0))throw G(`definition.extend`,`expected a recipe from this exact reciper`)}let a=n.includes(H);if(!a&&i===void 0)throw G(F,Re);let o=Xe(a?q(r,H,F):void 0,i,!a),s=o.baseFragments.length,c=o.names.length===0,l=Qe(n.includes(`variants`)?q(r,`variants`,I):void 0,i,c,o.indexes,s),u=$e(n.includes(`defaultVariants`)?q(r,`defaultVariants`,L):void 0,i,l.variants,l.indexes),d=tt(n.includes(`compoundVariants`)?q(r,`compoundVariants`,R):void 0,i,c,o.indexes,s,l.variants,l.indexes),f=X(s);for(let e of d)for(let t=0;t<s;t++)e.fragmentsBySlot[t]!==void 0&&T(f[t]??=[],e);return{slotNames:o.names,baseFragmentsBySlot:o.baseFragments,variants:l.variants,defaultStates:u,compounds:d,compoundsBySlot:f}}function rt(e,t){if(e===void 0)return t.defaultStates;let n=He(e,V),r=U(n);if(W(n,r,`class`))throw G(`${V}.class`,`reserved field`);if(W(n,r,H))throw G(`${V}.className`,`caller classes belong to a style resolver`);let i=e,a;for(let e=0;e<t.variants.length;e++){let o=t.variants[e];if(!W(n,r,o.name))continue;let s=`${V}.${o.name}`,c=q(i,o.name,s);c!==void 0&&(a??=[...t.defaultStates],a[e]=Q(c,o,s))}return a??t.defaultStates}function it(e,t,n){if(t!==void 0){let e=n<qe||P.call(t,n)?t[n]:void 0;if(e!==void 0)return e}return e[n]}function at(e,t,n){for(let r of e.conditions){let e=it(t,n,r.variantIndex),i=!1;for(let t of r.states)if(e===t){i=!0;break}if(!i)return!1}return!0}function $(e,t,n){if(n===void 0)return t;for(let r of n)Je(e,t,r),t++;return t}function ot(e,t,n,r,i,a,o){let s,c;if(r!==void 0){let t=He(r,a),n=U(t);if(W(t,n,`class`))throw G(`${a}.class`,`reserved field`);let i=r;for(let r=0;r<e.variants.length;r++){let o=e.variants[r];if(!W(t,n,o.name))continue;let c=`${a}.${o.name}`,l=q(i,o.name,c);l!==void 0&&(s??=Ke(),Je(s,r,Q(l,o,c)))}W(t,n,`className`)&&(c=q(i,`className`,`${a}.className`))}let l=Ke(),u=$(l,0,e.baseFragmentsBySlot[t]);for(let r=0;r<e.variants.length;r++){let i=it(n,s,r);if(i==null)continue;let a=e.variants[r].choices[i];a!==void 0&&(u=$(l,u,a.fragmentsBySlot[t]))}let d=e.compoundsBySlot[t];if(d!==void 0)for(let e of d)at(e,n,s)&&(u=$(l,u,e.fragmentsBySlot[t]));c!==void 0&&(Je(l,u,c),u++),l.length=u;let f=Reflect.apply(i,void 0,l);if(typeof f!=`string`)throw G(o,`merger must return a primitive string`);return f}function st(e,t,n){Object.defineProperty(e,t,{value:n,configurable:!0,enumerable:!0,writable:!0})}function ct(e){let t={};for(let n of e.variants)st(t,n.name,Object.freeze(Object.keys(n.choices)));let n={};for(let t=0;t<e.variants.length;t++){let r=e.defaultStates[t];typeof r==`string`&&st(n,e.variants[t].name,r)}return Object.freeze({anatomy:Object.freeze([...e.slotNames]),variants:Object.freeze(t),defaultVariants:Object.freeze(n),compoundVariantCount:e.compounds.length})}function lt(e,t){return Object.defineProperty(e,"config",{value:ct(t),configurable:!1,enumerable:!1,writable:!1}),e}function ut(e,t){return e.slotNames.length===0?lt((n=>ot(e,0,e.defaultStates,n,t,V,`recipe result`)),e):lt((n=>{let r=rt(n,e),i=Object.create(null);for(let n=0;n<e.slotNames.length;n++){let a=e.slotNames[n];i[a]=i=>ot(e,n,r,i,t,`style props.${a}`,`style result.${a}`)}return i}),e)}function dt(e){let t=K(e,z);for(let e of t)if(e!==`merge`)throw G(z,`unknown field ${JSON.stringify(e)}`);if(!t.includes(`merge`))throw G(B,Re);let n=q(e,`merge`,B);if(typeof n!=`function`)throw G(B,`expected a callable merger`);let r=n,i=new WeakMap;return(e=>{let t=nt(e,i),n=ut(t,r);return i.set(n,t),n})}export{_ as MERGE_OPAQUE,v as MergerProtocolError,Fe as createMerger,dt as createReciper,e as omitAttributes};
|
|
1
|
+
function e(e,t){let n={...e},r=new Set(t.map(e=>e.toLowerCase()));for(let e of Object.keys(n))r.has(e.toLowerCase())&&delete n[e];return n}function t(e,t){Object.defineProperty(e,e.length,{configurable:!0,enumerable:!0,value:t,writable:!0})}function n(e,t){let n=e.length;n in e?Object.defineProperty(e,n,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[n]=t}function r(e){let t=[],r=[],i=new Map,a=!1,o,s;for(let c=0;c<e.length;c++){let l=e[c];if(r.length===0){l===`\\`?(/\s/.test(e[c+1]??``)&&(o=void 0),c++):/\s/.test(l)?o=void 0:l===`"`||l===`'`?o=o===l?void 0:o??l:!o&&l===`[`&&n(r,c);continue}if((s||a)&&l===`[`&&/[:@\s]/.test(e[c-1])){n(r,c),i.set(c,s??a),a=!1,s=void 0;continue}if(a){l===`*`&&e[c+1]===`/`&&(a=!1,c++);continue}if(s){l===`\\`?c++:l===s&&(s=void 0);continue}if(l===`/`&&e[c+1]===`*`)a=!0,c++;else if(l===`"`||l===`'`)s=l;else if(l===`\\`)c++;else if(l===`[`)n(r,c);else if(l===`]`){let o=r.pop(),l=i.get(o);(/[:@]/.test(e[o-1])||e[c+1]===`:`)&&n(t,{end:c+1,start:o}),l===!0?a=!0:l&&(s=l)}}let c=[];for(let e of t.sort((e,t)=>e.start-t.start||t.end-e.end))(!c.length||e.start>=c.at(-1).end)&&n(c,e);return c}function i(e){let t=``,r,i=-1,a=-1,o=-1,s=[];for(let c=0;c<e.length;c++){let l=e[c];if(r){l===`\\`?c++:l===r&&(r=void 0);continue}if((t.length>0||a!==-1)&&l===`\\`){c++;continue}if(t.length>0&&(l===`"`||l===`'`)){r=l;continue}if((t.length>0||a!==-1)&&l===`/`&&e[c+1]===`*`){let t=e.indexOf(`*/`,c+2);if(t<0)break;c=t+1;continue}l===`(`||l===`[`?t+=l===`(`?`)`:`]`:l===t.at(-1)?t=t.slice(0,-1):t.length===0&&(l===`@`?(a===-1&&(a=c),n(s,c)):a===-1&&(l===`:`&&i===-1?i=c:l===`!`&&(o=c)))}let c=a===-1?e.length:a,l=e.slice(0,c),u=!1;c>0&&o===c-1&&(u=!0,l=l.slice(0,-1));let d=[];for(let t=0;t<s.length;t++){let r=s[t]+1,i=t+1<s.length?s[t+1]:e.length;n(d,e.slice(r,i))}return i!==-1&&i<c?{raw:e,body:l,property:e.slice(0,i),value:l.slice(i+1),keyword:!1,important:u,conditions:d}:{raw:e,body:l,keyword:!0,important:u,conditions:d}}function a(e,n,r){let i=e[n];if(r.blockComment)return i===`*`&&e[n+1]===`/`?(r.blockComment=!1,n+1):n;if(r.quote)return i===`\\`?n+1:(i===r.quote&&(r.quote=void 0),n);if(r.closers.length>0&&i===`/`&&e[n+1]===`*`)return r.blockComment=!0,n+1;if(r.closers.length>0&&(i===`"`||i===`'`))return r.quote=i,n;if(i===`\\`)return n+1;if(i===`(`||i===`[`)return t(r.closers,i===`(`?`)`:`]`),n;if(i===r.closers.at(-1))return r.closers.pop(),n}function o(e,t,n=e.length){let r={closers:[]};for(let i=t+1;i<n;i++){let t=e[i],n=a(e,i,r);if(n!==void 0){i=n;continue}if(r.closers.length===0){if(t===`}`)return{index:i,kind:`close`};if(t===`{`)return{index:i,kind:`open`}}}return{index:n,kind:`limit`}}const s=/[\s'"`;{},\])]/;function c(e,t,n=e.length){if(e[t]!==`@`)return{conds:``,end:t};let r={closers:[]},i=t;for(;i<n;i++){let t=e[i],n=a(e,i,r);if(n!==void 0){i=n;continue}if(t===`/`&&(e[i+1]===`/`||e[i+1]===`*`)&&r.closers.length===0||s.test(t)&&r.closers.length===0)break}return{conds:e.slice(t,i),end:i}}function l(e,n=!1){let r=[],i={closers:[]},o=0;for(let s=0;s<e.length;s++){let c=e[s],l=a(e,s,i);if(l!==void 0){s=l;continue}(c===`;`||n&&/\s/.test(c))&&i.closers.length===0&&(t(r,e.slice(o,s)),o=s+1)}return t(r,e.slice(o)),r.map(e=>e.trim()).filter(Boolean)}const u=/^(?:--?[\w-]+|[A-Z_$][\w$-]*|@teacss-skip-bracket-[\da-z]{6})$/i;function d(e,t){let n=t;for(;n>0&&/[\w-]/.test(e[n-1]);)n--;if(n===t||e[n-1]!==`:`)return!1;let r=n-1,i=r;for(;i>0&&/[\w$@-]/.test(e[i-1]);)i--;if(!u.test(e.slice(i,r)))return!1;let a=i-1;for(;a>=0&&/\s/.test(e[a]);)a--;return a<0||!`{,?`.includes(e[a])}function f(e){let n=[],r=[],i=[],a=!1,o;for(let s=0;s<e.length;s++){let c=e[s],l=e[s+1];if(r.length===0){c===`(`&&d(e,s)&&t(r,{attached:!0,start:s});continue}if(a)c===`*`&&l===`/`&&(a=!1,s++);else if(o)c===`\\`?s++:c===o&&(o=void 0);else if(c===`\\`)s++;else if(c===`/`&&l===`*`)a=!0,s++;else if(c===`'`||c===`"`||c==="`")o=c;else if(i.length>0)c===`[`||c===`(`?t(i,c===`[`?`]`:`)`):c===i.at(-1)&&i.pop();else if(c===`[`)t(i,`]`);else if(c===`(`)t(r,{attached:d(e,s),start:s});else if(c===`)`){let e=r.pop();e.attached&&t(n,{end:s+1,start:e.start})}}let s=[];for(let e of n.sort((e,t)=>e.start-t.start||t.end-e.end))(s.length===0||e.start>=s.at(-1).end)&&t(s,e);return s}function p(e){let t={seen:!1},n=m(e,t);for(let e=1;e<5&&t.seen;e++){t.seen=!1;let e=m(n,t);if(e===n)break;n=e}return n}function m(e,t){if(!e.includes(`{`))return e;let n=``,i=0,s=-1,u=0,d=0,p=e.includes(`[`)?r(e):[],m=e.includes(`(`)?f(e):[],h={closers:[]};for(;i<e.length;){for(;u<p.length&&p[u].end<=i;)u++;for(;d<m.length&&m[d].end<=i;)d++;let r=u<p.length?p[u]:void 0,f=d<m.length?m[d]:void 0,g=r?.start===i?r:f?.start===i?f:void 0;if(g&&h.blockComment!==!0&&h.quote===void 0){n+=e.slice(i,g.end),i=g.end;continue}h.closers.length>0&&/\s/.test(e[i])&&(h.blockComment=!1,h.closers.length=0,h.quote=void 0);let _=a(e,i,h);if(_!==void 0){n+=e.slice(i,_+1),i=_+1;continue}let v=e[i];if(h.closers.length>0||v!==`{`){n+=v,i++;continue}let y=o(e,i);if(y.kind!==`close`){y.kind===`open`&&t&&(t.seen=!0),n+=e.slice(i,y.index),i=y.index;continue}let b=y.index,x=e.slice(i+1,b),{conds:S,end:C}=c(e,b+1),w=l(x,!0);if(w.length===0){n+=v,i++;continue}s===i&&n.length>0&&!/\s/.test(n.at(-1))&&(n+=` `),n+=w.map(e=>`${e}${S}`).join(` `),s=C,i=C}return n}function h(e){let t=e.split(/\s+/);return t[0]===``&&t.shift(),t.at(-1)===``&&t.pop(),t}function g(e){if(!e.includes(`[`))return h(e);let t=r(e);if(t.length===0)return h(e);let i=[],a=0,o=-1;for(let r=0;r<e.length;r++){let s=t[a];if(s&&r===s.start){o<0&&(o=r),r=s.end-1,a++;continue}/\s/.test(e[r])?(o>=0&&n(i,e.slice(o,r)),o=-1):o<0&&(o=r)}return o>=0&&n(i,e.slice(o)),i}const _=`must have an integer length from 0 through 4294967294`,v=Symbol(`missing-own-value`);function y(e,t){return`value`in t?t.value:t.get===void 0?void 0:Reflect.apply(t.get,e,[])}function b(e,t){let n=Reflect.getOwnPropertyDescriptor(e,t);return n===void 0?v:y(e,n)}function x(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0})}function S(e,t){let n=e.length;n in e?x(e,n,t):e[n]=t}function C(e){let t=b(e,`length`);return typeof t==`number`&&Number.isInteger(t)&&t>=0&&t<4294967295?t:null}function w(e){let t=``,n=C(e);if(n===null)throw TypeError(`[TeaCSS classes] class-value array ${_}`);for(let r=0;r<n;r++){let n=b(e,r);if(n===v)continue;let i=ee(n);i&&(t+=(t&&` `)+i)}return t}function ee(e){if(!e)return``;if(typeof e==`string`)return e;if(typeof e==`number`||typeof e==`bigint`)return String(e);if(Array.isArray(e))return w(e);if(typeof e==`object`){let t=e,n=``;for(let e of Reflect.ownKeys(t)){if(typeof e!=`string`)continue;let r=Reflect.getOwnPropertyDescriptor(t,e);r!==void 0&&r.enumerable&&y(t,r)&&(n+=(n&&` `)+e)}return n}return``}function te(e,t,n){let r=b(e,n);if(r===v)return``;if(typeof r==`string`)return r;if(Array.isArray(t)){let e=b(t,n);if(typeof e==`string`)return e}return``}function ne(e){return typeof e==`number`||typeof e==`bigint`?String(e):ee(e)}function re(e,t,n){let r=``,i=C(e);if(i===null)throw TypeError(`[TeaCSS classes] tagged-template strings ${_}`);for(let a=0;a<i;a++)if(r+=te(e,t,a),a+1<i&&a+1<n.length){let e=ne(n[a+1]);r+=e}return r}function ie(e){let t=e[0],n=Array.isArray(t)?b(t,`raw`):v;return Array.isArray(n)?re(t,n,e):w(e)}var ae=class{max;budget;weight;values=new Map;queue=[];head=0;tail=0;bytes=0;constructor(e,t,n){this.max=e,this.budget=t,this.weight=n}get(e){return this.values.get(e)}set(e,t){let n=this.weight(e,t);if(!(n>this.budget||this.max===0||this.values.has(e))){for(;this.values.size>=this.max||this.bytes+n>this.budget;){let e=this.queue[this.head];this.bytes-=this.weight(e,this.values.get(e)),this.values.delete(e),this.queue[this.head]=``,this.head=(this.head+1)%this.max}this.values.set(e,t),this.tail<this.queue.length?this.queue[this.tail]=e:x(this.queue,this.tail,e),this.tail=(this.tail+1)%this.max,this.bytes+=n}}},oe=class{root={children:new Map,result:void 0};entries=new Map;bytes=0;nodes=1;get size(){return this.entries.size}get(e){let t=this.root;for(let n=0;n<e.length;n++){let r=t.children.get(e[n]);if(!r)return;t=r}return t.result}set(e,t){let n=t.length*2;for(let t=0;t<e.length;t++)n+=e[t].length*2;if(n>65536||this.get(e)!==void 0)return;for(;this.entries.size>=64||this.bytes+n>65536;){let e=this.entries.keys().next().value,t=this.entries.get(e);e.result=void 0,this.prune(this.root,t.args,0),this.entries.delete(e),this.bytes-=t.bytes}let r=this.root;for(let t=0;t<e.length;t++){let n=r.children.get(e[t]);n||(n={children:new Map,result:void 0},r.children.set(e[t],n),this.nodes++),r=n}r.result=t,this.entries.set(r,{args:e,bytes:n}),this.bytes+=n}prune(e,t,n){if(n===t.length)return;let r=t[n],i=e.children.get(r);this.prune(i,t,n+1),i.children.size===0&&i.result===void 0&&(e.children.delete(r),this.nodes--)}};function T(e){return e?e.split(`,`).map(e=>Number.parseInt(e,36)):[]}function se(e){let t=``;return e.split(` `).map(e=>t=t.slice(0,Number.parseInt(e[0],36))+e.slice(1))}const E=se(`0align-content 6items 6self 5ment-baseline 1nimation 9-composition adelay birection buration afill aiteration aname aplay arange-end gstart atimeline ding 0backdrop-blur arightness 9contrast 9filter 9grayscale 9hue-rotate 9invert 9opacity 9saturate aepia 2seline-shift aource 1g-g 4-1 6-angle 7color 7position 52 6-angle 7color 7position 53 6-angle 7color 7position 54 6-angle 7color 7position 55 6-angle 7color 7position 56 6-angle 7color 7position 57 6-angle 7color 7position 58 6-angle 7color 7position 59 6-angle 7color 7position 5angle 5to 3image 1lock-size 7tep a-align binsert bround bsize 2ur 1order 6-b 8-color 9style 9width 8lock c-color dstyle dwidth 7color 7e 8-color 9style 9width 7g 8-1 a-angle bcolor bposition 92 a-angle bcolor bposition 93 a-angle bcolor bposition 94 a-angle bcolor bposition 95 a-angle bcolor bposition 96 a-angle bcolor bposition 97 a-angle bcolor bposition 98 a-angle bcolor bposition 99 a-angle bcolor bposition 9angle 9to 7image c-outset drepeat dslice eource dwidth 8nline d-color estyle ewidth 7l 8-color 9style 9width 7n 8-color 9style 9width 7r 8-color 9style 9width 7s 8-color 9style 9width 8pacing e-x fy 8tyle 7t 8-color 9style 9width 7u 8-color 9style 9width 7width 7x 8-color 9style 9width 7y 8-color 9style 9width 2x-shadow 1rightness 0column-count 7height 7width 8rap 6s 2ntrast 2rner 6-b 8-shape 8l 9-shape 8r 9-shape 7e 8-shape 8e 9-shape 8s 9-shape 7l 8-shape 7n 8-shape 7r 8-shape 7s 8-shape 8e 9-shape 8hape 8s 9-shape 7t 8-shape 8l 9-shape 8r 9-shape 7u 8-shape 0d 1imensions 1rop-shadow 0filter 6-opacity 1lex 4-basis 5grow 5shrink 0g-1 3-angle 4color 4position 22 3-angle 4color 4position 23 3-angle 4color 4position 24 3-angle 4color 4position 25 3-angle 4color 4position 26 3-angle 4color 4position 27 3-angle 4color 4position 28 3-angle 4color 4position 29 3-angle 4color 4position 2angle 2to 1ap 3-column 4row 1rayscale 2id-area 5column b-end cspan dtart 5row 8-end 9span atart 0h 1ue-rotate 0i 1-b 3lock 2e 2inline 2l 2n 2r 2s 2t 2u 2x 2y 1nline-size 2set-shadow c-outline-width 2vert 0justify-content 8items 8self 0line-clamp 0m 1-b 3lock 2e 2inline 2l 2n 2r 2s 2t 2u 2x 2y 1ask-b-1-color 9position 79-color 9position 5composite 5g 6-1 8-angle 9color 9position 72 8-angle 9color 9position 73 8-angle 9color 9position 74 8-angle 9color 9position 75 8-angle 9color 9position 76 8-angle 9color 9position 77 8-angle 9color 9position 78 8-angle 9color 9position 79 8-angle 9color 9position 7angle 7conic c-1 e-angle fcolor d2 e-angle fcolor d3 e-angle fcolor d4 e-angle fcolor d5 e-angle fcolor d6 e-angle fcolor d7 e-angle fcolor d8 e-angle fcolor d9 e-angle fcolor 7linear d-1 f-color gposition e2 f-color gposition e3 f-color gposition e4 f-color gposition e5 f-color gposition e6 f-color gposition e7 f-color gposition e8 f-color gposition e9 f-color gposition eangle eto 7radial d-1 f-color gposition e2 f-color gposition e3 f-color gposition e4 f-color gposition e5 f-color gposition e6 f-color gposition e7 f-color gposition e8 f-color gposition e9 f-color gposition 7to 5image 5l-1-color 9position 79-color 9position 5r-1-color 9position 79-color 9position 5t-1-color 9position 79-color 9position 5x-1-color 9position 79-color 9position 5y-1-color 9position 79-color 9position 2x-block-size 4dimensions 4h 4inline-size 4size 4w 1in-block-size 4dimensions 4h 4inline-size 4size 4w 0outline 7-color 8style 8width 1verflow 8-block 9clip-m f-b hlock ge ginline gl gn gr gs gt gu gx gy 9inline 9x 9y 4scroll-behavior j-block kinline kx ky 0p 1-b 3lock 2e 2inline 2l 2n 2r 2s 2t 2u 2x 2y 1lace-content 6items 6self 1os 3ition-anchor 0rd 2-b 4l 4r 3e 4e 4s 3l 3n 3r 3s 4e 4s 3t 4l 4r 3u 1otate-x 7y 7z 1ule 4-break 5color 8umn b-break ccolor cinset h-cap iend ijunction istart cstyle cvis cwidth 5inset a-cap bend bjunction bstart 5row 8-break 9color 9inset e-cap fend fjunction fstart 9style 9vis 9width 5style 5vis 5width 0saturate 1cale 5-x 6y 6z 2roll-m 8-b alock 9e 9inline 9l 9n 9r 9s 9t 9u 9x 9y 7p 8-b alock 9e 9inline 9l 9n 9r 9s 9t 9u 9x 9y 6bar-color athumb brack 1epia 1hadow 6-outline-width 1ize 1kew 4-x 5y 0text-align a-all blast 6utospace 5emphasis d-color estyle 5spacing c-trim 6troke b-color cwidth 5wrap 9-mode astyle 1ransform 5ition a-behavior bdelay curation bproperty btiming 5late 9-x ay az 0vertical-align 0w 1hite-space b-collapse ctrim`);function ce(e,t,n){let r=e.split(`|`).map(e=>{let t=0;return T(e).map(e=>t+=e)}),i=[[]],a=new Map([[``,0]]),o=e=>T(e).map((e,t)=>{let n=r[e].map(e=>t+e),o=n.join(`,`),s=a.get(o);return s===void 0&&(s=i.length,Object.defineProperty(i,s,{value:n,configurable:!0,enumerable:!0,writable:!0}),a.set(o,s)),s});return{rows:i,equalRows:o(t),importantRows:o(n)}}const{rows:D,equalRows:le,importantRows:ue}=ce(`|1,1,1,1,1,1,1,1,1,1,1,1|3|2|1|-3,1,1,2,1,1,1,1,1|-1|-2|-3|-4|-5|-6|13|1,1,1|-13|1,1,1,1|42|1,1,1,1,1,1,1,1,1,1,1,1,1,14,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1|1,1,1,1n,1,1,1,h,1,1,1|1q,k|-7,4,5,1d,4,4,4,4,8,4,5,4|13,4|-13,14,1,1,1,1|-17|-1d,1,1,1,1b,1,1,d,1,1,1|-1d,1t|1,1|-27,4,5,1d,4,4,4,4,8,4,5,4|-2f,4,5,1d,4,4,4,4,8,4,5,4|-t,1,1,1,5,1,1,1,j,1,1|-t,8|-2n,1,1,1,27,1,1,1,b,1,1|-2n,2a|3a,1,8r,1|18|-4,1,1,1|12|1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,8h,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1|1,1,1,1,1,99,1,1|2,2|1,9c|1,9b|1,1,1,b,1,8w,1,6|2,c|1,99|1,98|-a,1,a,e,1,8n,5,7|-a,p|-6,1,1,1,4,93,1,2|-6,2|-c,1,c,c,1,8m,6,6|-c,p|-8,1,8,4,1,8v,4,2|-8,d|1,93|-l,2,2,2,2,2,2,2,2,2,2,3,2,2,2,2|1,91|1,1,1,1,1,8w,1,1|1,8z|1,8y|-b,1,2,1,8,8s,1,4|-b,3|1n,a5|-42,2u,6,11,2,1a,b,h,7r,y|-1b|1,1,1,1,1,1,1,1|-2,1,2|-1m|4,4|-1,5|-b,8|-3a|-3b|-23|-2a,7b,1,e,1,1|4,1,12,s,u,t|3,1,12,s,u,t|2,1,12,s,u,t|1,1,12,s,u,t|-5,1,1,1,14,s,u,t,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1|2f|-17,1,1,1,1,1,3h,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1|-1z,1,1,1,1,1,3h,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1|-2t,1,1,1,1,1,3h,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1|-2f|-3m,1,1,1,2,12,s,u,u,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1|-3j,1,12,s,u,t|-3k,1,12,s,u,t|-3l,1,12,s,u,t|-3m,1,12,s,u,t|-3n,1,12,s,u,t|-3o,1,12,s,u,t|-3p,1,12,s,u,t|-3q,1,12,s,u,t|-3r,1,12,s,u,t|-3s,1,12,s,u,t|-3t,1,12,s,u,t|-3u,1,12,s,u,t|-3v,1,12,s,u,t,1,4|-3w,1,12,s,u,t,2,4|-3x,1,12,s,u,t,3,4|-3y,1,12,s,u,t,4,4|-43,4,1,12,s,u,t,9|-43,3,1,12,s,u,t,a|-43,2,1,12,s,u,t,b|-43,1,1,12,s,u,t,c|1,3|-4,3|1,e,1,1|-ed,89|1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1|1,6|-5,c|-3,1|-6,c|-4,6|-5,1|2k|2j|2i|2,1,2,6,2,6,2,6,2,1,2|3,g|2,6,2|-8,1,1,1,1,5,1,1,1,4,1,1,1,1|-8,g|-j,g|-9u|-as|-c2|-c3|-f3,68|i|h|g|-4,5|-2k,1,1,20,1,1|1,1,1,1,1|-hr,o,1|-f,g,1|17|4,3i|3,3i|2,3i|1,3i|3h|-13,3i|-1v,3i|-2p,3i|-3j,3i|-3k,3i|-3l,3i|-3m,3i|-3n,3i|-3o,3i|-3p,3i|-3q,3i|-3r,3i|-3s,3i|-3t,3i|-3u,3i|-3v,3i,1,4|-3w,3i,2,4|-3x,3i,3,4|-3y,3i,4,4|-43,4,3i,9|-43,3,3i,a|-43,2,3i,b|-43,1,3i,c`,`0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,2,3,4,5,6,7,8,9,a,b,0,0,c,d,6,7,8,d,6,7,8,d,6,7,8,d,6,7,8,d,6,7,8,d,6,7,8,d,6,7,8,d,6,7,8,d,6,7,8,4,6,e,0,f,0,0,0,0,g,h,d,0,0,0,i,j,j,j,k,d,0,0,0,l,d,6,7,8,d,6,7,8,d,6,7,8,d,6,7,8,d,6,7,8,d,6,7,8,d,6,7,8,d,6,7,8,d,6,7,8,4,6,m,0,0,0,n,0,o,p,p,p,d,0,0,0,d,0,0,0,d,0,0,0,d,0,0,0,q,6,7,r,d,0,0,0,d,0,0,0,s,t,u,u,u,v,w,w,w,x,y,0,0,0,0,z,10,11,12,13,14,0,15,0,16,17,18,0,19,0,1a,1b,1c,1d,1e,1f,1g,1h,1i,0,1j,1k,0,1l,13,1m,0,1n,0,1o,1p,0,1q,4,1r,6,d,0,0,0,d,6,7,8,d,6,7,8,d,6,7,8,d,6,7,8,d,6,7,8,d,6,7,8,d,6,7,8,d,6,7,8,d,6,7,8,4,6,q,0,0,1s,1t,d,0,1u,0,d,0,1u,0,0,1v,1,0,1w,0,1x,0,0,0,0,0,0,1d,1y,0,1z,20,21,0,0,0,22,1,0,1w,0,1x,0,0,0,0,0,0,1d,1y,23,24,25,26,0,27,d,6,7,8,d,6,7,8,d,6,7,8,d,6,7,8,d,6,7,8,d,6,7,8,d,6,7,8,d,6,7,8,d,6,7,8,28,29,q,6,7,q,6,7,q,6,7,q,6,7,q,6,7,q,6,7,q,6,7,q,6,7,q,6,7,2a,q,6,7,q,6,7,q,6,7,q,6,7,q,6,7,q,6,7,q,6,7,q,6,7,q,6,7,4,6,2b,q,6,7,q,6,7,q,6,7,q,6,7,q,6,7,q,6,7,q,6,7,q,6,7,q,6,7,2c,2d,2e,2f,2g,2h,2i,2j,2k,2l,2m,2n,2o,2p,2q,2r,2s,2t,2u,2v,2w,2x,0,2y,0,0,2z,0,0,2y,0,0,2z,0,d,0,0,0,30,0,1,0,1w,0,1x,0,0,0,0,0,0,1d,1y,0,0,0,f,0,0,0,0,1,0,1w,0,1x,0,0,0,0,0,0,1d,1y,31,31,31,4,0,32,q,0,0,33,0,0,34,35,36,37,0,0,q,0,0,38,39,3a,3b,3c,3d,3d,3e,0,0,f,0,0,0,0,0,0,0,3f,3g,3g,3g,3g,3e,0,0,f,0,0,0,0,0,0,0,3h,3h,3h,3i,d,6,7,8,1,0,1w,0,1x,0,0,0,0,0,0,1d,1y,1,0,1w,0,1x,0,0,0,0,0,0,1d,1y,q,6,7,3j,3k,3l,3m,3n,3o,3p,q,0,0,0,q,0,0,3q,0,q,0,0,q,0,0,3r,3s,0,0,0,0,0,d,6,7,8,3t,0,3u,0,0`,`0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,c,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,6,0,0,f,0,0,0,0,0,h,d,0,0,0,i,j,j,j,k,d,0,0,0,3v,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,6,3s,0,0,0,0,0,o,p,p,p,d,0,0,0,d,0,0,0,d,0,0,0,d,0,0,0,q,6,7,r,d,0,0,0,d,0,0,0,s,t,u,u,u,v,w,w,w,x,0,0,0,0,0,z,0,11,12,13,14,0,15,0,16,17,18,0,19,0,1a,1b,1c,1d,1e,1f,1g,1h,1i,0,1j,1k,0,1l,13,1m,0,1n,0,1o,1p,0,1q,0,1r,0,d,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,6,q,0,0,0,1t,d,0,1u,0,d,0,1u,0,0,0,1,0,1w,0,1x,0,0,0,0,0,0,1d,1y,0,0,0,0,0,0,0,22,1,0,1w,0,1x,0,0,0,0,0,0,1d,1y,3w,3x,3y,3z,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,41,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,6,43,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2c,0,44,45,46,47,48,49,4a,4b,4c,4d,4e,4f,4g,4h,4i,4j,4k,4l,4m,4n,0,2y,0,0,2z,0,0,2y,0,0,2z,0,d,0,0,0,30,0,1,0,1w,0,1x,0,0,0,0,0,0,1d,1y,0,0,0,f,0,0,0,0,1,0,1w,0,1x,0,0,0,0,0,0,1d,1y,31,31,31,4,0,32,q,0,0,33,0,0,34,35,36,37,0,0,q,0,0,38,0,0,0,3c,3d,3d,3e,0,0,f,0,0,0,0,0,0,0,3f,3g,3g,3g,3g,3e,0,0,f,0,0,0,0,0,0,0,3h,3h,3h,0,d,6,7,8,1,0,1w,0,1x,0,0,0,0,0,0,1d,1y,1,0,1w,0,1x,0,0,0,0,0,0,1d,1y,q,0,0,0,0,0,3m,0,0,0,q,0,0,0,q,0,0,3q,0,q,0,0,q,0,0,3r,3s,0,0,0,0,0,d,6,7,8,3t,0,3u,0,0`),de=new Uint8Array(E.length),O=T(`h,4,i,4,j,4,k,5,l,4,m,4,n,4,o,4,p,4,q,4,23,2,4w,9,4x,2,53,2,64,2,65,3,66,2,7g,2,7r,2,86,8,87,8,88,2,fz,2,gu,7,gv,6,gw,6,gx,2,gy,8,gz,8`);for(let e=0;e<O.length;e+=2)de[O[e]]=O[e+1];const k=new Map(E.map((e,t)=>[e,t])),A=[[`dimensions`,`w`,`h`],[`min-dimensions`,`min-w`,`min-h`],[`max-dimensions`,`max-w`,`max-h`],[`size`,`inline-size`,`block-size`],[`min-size`,`min-inline-size`,`min-block-size`],[`max-size`,`max-inline-size`,`max-block-size`]],j=new Map,M=new Map;for(let e=0;e<A.length;e++){let[t,n,r]=A[e],i=k.get(t),a=k.get(n),o=k.get(r);i!==void 0&&a!==void 0&&o!==void 0&&(j.set(i,[e*2,e*2+1]),j.set(a,[e*2]),j.set(o,[e*2+1]),M.set(i,e))}const fe=/[{}[\]()\\'"\x60]|\/\*/,pe=/^!?lang-[a-zA-Z]+(?:-[a-zA-Z0-9]+)*$/,me=E.length*2,he=4096;function ge(e,t){return 2*(e.length+t.raw.length+t.condition.length+t.identity.length)}function _e(e){if(!e.length)return``;if(e.length===1)return`\0`+ve(e[0]);let t=``;for(let n=0;n<e.length;n++){let r=ve(e[n]);t+=r.length+`:`+r}return t}function ve(e){return pe.test(e)?e.toLowerCase():e}function ye(e){let t=i(e),n=t.property??t.body,r=t.keyword?-1:k.get(n)??-1;return{raw:e,id:r,important:+t.important,condition:_e(t.conditions),identity:r<0?(t.keyword?`k`:`d`)+n:``,family:r>=0?de[r]:0}}function be(e=0){return{dropped:new Uint8Array(e),blocked:new Uint32Array(me),expanded:new Uint32Array(me),epoch:0}}function xe(e={}){let t=e.tupleCache===!1?void 0:new oe,n=e.resultCache===!1?void 0:new ae(1500,1048576,(e,t)=>2*(e.length+t.length)),r=e.descriptorCache===!1?void 0:new ae(4096,524288,ge),i=be(),a=e.epochLimit??4294967295,o=!1;function s(e,t){let n=t?r?.get(e):void 0;if(n!==void 0)return n;let i=t&&r?e.split(``).join(``):e,a=ye(i);return t&&r?.set(i,a),a}function c(e){return e.epoch>=a&&(e.blocked.fill(0),e.expanded.fill(0),e.epoch=0),++e.epoch}function l(e){let t=e.length;if(t===0)return``;if(t===1)return e[0].raw;let n=o||t>he?be(t):i,r=o;o=!0,n.dropped.length<t&&(n.dropped=new Uint8Array(Math.min(he,2**Math.ceil(Math.log2(t)))));let a=n.dropped;a.fill(0,0,t);try{let r=!0;for(let n=1;n<t;n++)if(e[n].condition!==e[0].condition){r=!1;break}function i(r){let i=r?.length??t;if(i<2)return;if(i===2){let t=r?r[0]:0,n=r?r[1]:1,i=e[t],o=e[n];if(i.id>=0&&o.id>=0&&!(i.family||o.family)){if(i.important===o.important)(i.id===o.id||D[le[o.id]].includes(i.id))&&(a[t]=1);else{let e=i.important?i:o,r=i.important?o:i;(e.id===r.id||D[ue[e.id]].includes(r.id))&&(a[i.important?n:t]=1)}return}}let o=new Uint8Array(5),s=new Int32Array(5).fill(-1);for(let t=i-1;t>=0;t--){let n=r?r[t]:t,i=e[n];if(!i.family||!i.important)continue;let a=i.family>>1;i.family&1?o[a]&&s[a]<0&&(s[a]=n):o[a]=1}let l;for(let t=0;t<i;t++){let n=r?r[t]:t,i=e[n],c=i.family>>1;if(c&&(n<=s[c]||i.family&1&&!i.important&&o[c]))a[n]=2;else if(i.id<0){let t=l??=new Map,r=t.get(i.identity);if(r!==void 0){if(e[r].important&&!i.important){a[n]=1;continue}a[r]=1}t.set(i.identity,n)}}let{blocked:u,expanded:d}=n,f=c(n);for(let t=0;t<i;t++){let n=r?r[t]:t,i=e[n];if(!(i.id<0||a[n]===2)){if(!i.important)u[i.id]===f&&(a[n]=1);else if(d[i.id]!==f){u[i.id]=f;let e=D[ue[i.id]];for(let t=0;t<e.length;t++)u[e[t]]=f;d[i.id]=f}}}f=c(n);for(let t=i-1;t>=0;t--){let n=r?r[t]:t,i=e[n];if(i.id<0||a[n]===2)continue;let o=i.id*2+i.important;if(u[o]===f&&(a[n]=1),d[o]===f)continue;u[o]=f;let s=D[le[i.id]];for(let e=0;e<s.length;e++)u[s[e]*2+i.important]=f;if(i.important){u[o-1]=f;let e=D[ue[i.id]];for(let t=0;t<e.length;t++)u[e[t]*2]=f}d[o]=f}let p=!1;for(let t=0;t<i;t++){let n=r?r[t]:t;if(M.has(e[n].id)){p=!0;break}}if(p){let t=new Int32Array(A.length*2).fill(-1);for(let n=0;n<i;n++){let i=r?r[n]:n,a=e[i],o=j.get(a.id);if(o!==void 0)for(let n of o){let r=t[n];(r<0||a.important>=e[r].important)&&(t[n]=i)}}for(let n=0;n<i;n++){let i=r?r[n]:n,o=M.get(e[i].id);o!==void 0&&t[o*2]!==i&&t[o*2+1]!==i&&(a[i]=1)}}}if(r)i();else{let n=new Map;for(let r=0;r<t;r++){let t=e[r].condition,i=n.get(t);i===void 0?n.set(t,r):typeof i==`number`?n.set(t,[i,r]):S(i,r)}for(let e of n.values())typeof e!=`number`&&i(e)}let o=``;for(let n=0;n<t;n++)a[n]===0&&(o+=(o?` `:``)+e[n].raw);return o}finally{o=r}}function u(e){let t=g(p(e).trim()),n=[],r=e.length*2<=524288;for(let e=0;e<t.length;e++)S(n,s(t[e],r));return n}function d(e){let t=n?.get(e);if(t!==void 0)return t;let r=l(u(e));return n?.set(e,r),r}let f=(...e)=>{if(!e.length)return``;let n=e.length<=4;if(n){for(let t=0;t<e.length;t++)if(typeof e[t]!=`string`){n=!1;break}}if(!n)return d(ie(e));let r=e,i=t?.get(r);if(i!==void 0)return i;let a=``;for(let e=0;e<r.length;e++)r[e]&&(a+=(a?` `:``)+r[e]);let o=d(a);return t?.set(r,o),o};function m(e){return{raw:e,tokens:fe.test(e)?void 0:u(e)}}function h(e,t){if(e.length===0&&Array.isArray(t))return f(t);let r=t===void 0?``:w([t]),i=``,a=!fe.test(r);for(let t=0;t<e.length;t++){let n=e[t];n.raw&&(i+=(i?` `:``)+n.raw),a&&=n.tokens!==void 0}if(r&&(i+=(i?` `:``)+r),!a)return d(i);let o=n?.get(i);if(o!==void 0)return o;let s=[];for(let t=0;t<e.length;t++){let n=e[t].tokens;for(let e=0;e<n.length;e++)S(s,n[e])}if(r){let e=u(r);for(let t=0;t<e.length;t++)S(s,e[t])}let c=l(s);return n?.set(i,c),c}return{cn:f,prepareFragment:m,mergePrepared:h,inspect:()=>({tuples:{size:t?.size??0,bytes:t?.bytes??0,nodes:t?.nodes??0},results:{size:n?.values.size??0,bytes:n?.bytes??0},descriptors:{size:r?.values.size??0,bytes:r?.bytes??0},scratch:{bytes:i.dropped.byteLength+i.blocked.byteLength+i.expanded.byteLength}})}}const{cn:Se,prepareFragment:Ce,mergePrepared:we}=xe(),N=Object.prototype.propertyIsEnumerable,P=`definition.defaults`,F=`definition.variants`,I=`definition.defaultVariants`,L=`definition.compoundVariants`,R=`recipe props`,z=`className`,Te=`defaults`,B=`classKeys`,V=`null is not allowed`,Ee=new Set([`defaults`,`variants`,`defaultVariants`,`compoundVariants`,`extend`]),De=new Set([`class`,`className`,`then`,`toJSON`,`toString`,`valueOf`]),Oe=new Set([`class`,`className`,`classKeys`]);function H(e){return e.length>16?new Set(e):void 0}function U(e,t,n){return t?.has(n)??e.includes(n)}function W(e,t){return TypeError(`[TeaCSS recipe] ${e}: ${t}`)}function G(e,t){if(typeof e!=`object`||!e||Array.isArray(e))throw W(t,`expected a plain record`);let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)throw W(t,`expected Object.prototype or null prototype`);return Object.keys(e)}function ke(e,t){if(typeof e!=`object`||!e||Array.isArray(e))throw W(t,`expected a non-null, non-array object`);return Object.keys(e)}function K(e,t,n){let r=Reflect.getOwnPropertyDescriptor(e,t);if(r===void 0||!r.enumerable)throw W(n,`expected an own enumerable field`);return`value`in r?r.value:r.get===void 0?void 0:Reflect.apply(r.get,e,[])}function Ae(e,t){let n=Reflect.getOwnPropertyDescriptor(e,`length`),r=n!==void 0&&`value`in n?n.value:void 0;if(typeof r!=`number`||!Number.isInteger(r)||r<0||r>=4294967295)throw W(t,`expected an array with a valid own length`);return r}function q(e,t,n){if(!Array.isArray(e))throw W(t,`expected an array`);let r=Object.keys(e),i=Ae(e,t);if(!n&&i===0)throw W(t,`expected a non-empty array`);if(r.length!==i)throw W(t,`expected a dense own-indexed array`);for(let e of r){let n=Number(e);if(!Number.isInteger(n)||n<0||n>=i||String(n)!==e)throw W(t,`expected a dense own-indexed array`)}let a=X(i);for(let n=0;n<i;n++)a[n]=K(e,n,`${t}[${n}]`);return a}function je(e,t){if(e.trim().length===0)throw W(t,`name must contain a non-whitespace character`)}function J(e,t){let n=w([e]);return n.length===0?void 0:t(n)}function Y(e,t,n){if(n===void 0)return;let r=N.call(e,t)?e[t]:void 0;e[t]=r===void 0?[n]:[...r,n]}function X(e){let t=Array(e);for(let n=0;n<e;n++)n in t?x(t,n,void 0):t[n]=void 0;return t}function Z(){return[void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0]}const Me=Z().length;function Ne(e,t,n){t<Me||!(t in e)?e[t]=n:x(e,t,n)}function Q(e,t=e.length){let n=X(t),r=Math.min(e.length,t);for(let t=0;t<r;t++){if(!N.call(e,t))continue;let r=e[t];r!==void 0&&(n[t]=[...r])}return n}function Pe(e,t){return e.map(e=>{let n=Object.create(null);for(let r of Object.keys(e.choices))n[r]={fragmentsBySlot:Q(e.choices[r].fragmentsBySlot,t)};return{name:e.name,choices:n,booleanCapable:e.booleanCapable}})}function $(e,t,n){if(e===null)return null;if(typeof e==`number`){if(!Number.isFinite(e))throw W(n,`expected a finite numeric choice`);e=String(e)}if(typeof e==`string`){if(!N.call(t.choices,e))throw W(n,`unknown choice ${JSON.stringify(e)}`);return e}if(typeof e==`boolean`){if(!t.booleanCapable)throw W(n,`boolean selection requires a true or false choice`);return String(e)}throw W(n,`expected null, a declared string or finite numeric choice, or a supported boolean state`)}function Fe(e,t,n,r){if(n&&(e=t.slotNames.length===0?``:{}),typeof e==`string`){if(t!==void 0&&t.slotNames.length>0)throw W(P,`must be a record when extending a multi-element recipe`);let n=t===void 0?X(1):Q(t.baseFragmentsBySlot,1);return Y(n,0,J(e,r)),{names:[],indexes:Object.create(null),baseFragments:n}}let i=G(e,P);if(t!==void 0&&t.slotNames.length===0)throw W(P,`must be a string when extending a single-element recipe`);if(!n&&i.length===0)throw W(P,`expected at least one named class`);for(let e of i){let t=`${P}.${e}`;if(je(e,t),De.has(e))throw W(t,`reserved class name`)}let a=t===void 0?[]:[...t.slotNames],o=Object.create(null);for(let e=0;e<a.length;e++)o[a[e]]=e;let s=t===void 0?[]:Q(t.baseFragmentsBySlot),c=e;for(let e of i){let t=o[e];t===void 0&&(t=a.length,S(a,e),o[e]=t,S(s,void 0)),Y(s,t,J(K(c,e,`${P}.${e}`),r))}return{names:a,indexes:o,baseFragments:s}}function Ie(e,t,n,r,i,a,o){if(n){if(typeof t!=`string`)throw W(i,`expected a primitive string`);Y(e,0,J(t,o));return}let s=G(t,i);if(a&&s.length===0)throw W(i,`expected at least one class target`);let c=t;for(let t of s){let n=r[t];if(n===void 0)throw W(`${i}.${t}`,`unknown class target`);Y(e,n,J(K(c,t,`${i}.${t}`),o))}}function Le(e,t,n,r,i,a){let o=t===void 0?[]:Pe(t.variants,i),s=Object.create(null);for(let e=0;e<o.length;e++)s[o[e].name]=e;if(e===void 0)return{variants:o,indexes:s};if(e===null)throw W(F,V);let c=G(e,F),l=e;for(let e of c){let t=`${F}.${e}`;if(je(e,t),Oe.has(e))throw W(t,`reserved variant name`);let c=K(l,e,t),u=G(c,t);if(u.length===0)throw W(t,`expected at least one choice`);let d=c,f=s[e],p;f===void 0?(f=o.length,s[e]=f,p=Object.create(null),S(o,{name:e,choices:p,booleanCapable:!1})):p=o[f].choices;for(let e of u){let o=`${t}.${e}`,s=K(d,e,o),c=p[e],l=c===void 0?X(i):Q(c.fragmentsBySlot,i);Ie(l,s,n,r,o,!1,a),p[e]={fragmentsBySlot:l}}o[f]={name:e,choices:p,booleanCapable:N.call(p,`true`)||N.call(p,`false`)}}return{variants:o,indexes:s}}function Re(e,t,n,r){let i=X(n.length);if(t!==void 0){let e=Math.min(t.defaultStates.length,n.length);for(let n=0;n<e;n++)N.call(t.defaultStates,n)&&(i[n]=t.defaultStates[n])}if(e===void 0)return i;if(e===null)throw W(I,V);let a=G(e,I),o=H(a);for(let e of a)if(r[e]===void 0)throw W(`${I}.${e}`,`unknown variant`);let s=e;for(let e=0;e<n.length;e++){let t=n[e];if(!U(a,o,t.name))continue;let r=`${I}.${t.name}`,c=K(s,t.name,r);c!==void 0&&(i[e]=$(c,t,r))}return i}function ze(e,t,n){if(!Array.isArray(e)){if(e===void 0)throw W(n,`undefined is not a condition`);return[$(e,t,n)]}let r=q(e,n,!1),i=[];for(let e=0;e<r.length;e++){let a=r[e];if(a===void 0)throw W(`${n}[${e}]`,`undefined is not a condition`);S(i,$(a,t,`${n}[${e}]`))}return i}function Be(e,t,n,r,i,a,o,s){let c=t===void 0?[]:t.compounds.map(e=>({conditions:e.conditions,fragmentsBySlot:Q(e.fragmentsBySlot,i)}));if(e===void 0)return c;if(e===null)throw W(L,V);let l=q(e,L,!0);for(let e=0;e<l.length;e++){let t=l[e],u=`${L}[${e}]`,d=G(t,u),f=H(d),p=U(d,f,B);if(!U(d,f,z))throw W(`${u}.className`,n||p?`required own enumerable string`:`required own enumerable class map`);for(let e of d)if(e!==z&&e!==B&&o[e]===void 0)throw W(`${u}.${e}`,`unknown variant condition`);let m=t,h=[];for(let e=0;e<a.length;e++){let t=a[e];if(!U(d,f,t.name))continue;let n=`${u}.${t.name}`;S(h,{variantIndex:e,states:ze(K(m,t.name,n),t,n)})}let g=`${u}.className`,_=K(m,z,g),v=X(i);if(p){let e=`${u}.classKeys`;if(n)throw W(e,`only valid for multi-element recipes`);if(typeof _!=`string`)throw W(g,`expected a primitive string when classKeys is present`);let t=q(K(m,B,e),e,!1),i=J(_,s);for(let n=0;n<t.length;n++){let a=t[n],o=`${e}[${n}]`;if(typeof a!=`string`)throw W(o,`expected a declared class name`);let s=r[a];if(s===void 0)throw W(o,`unknown class target`);if(t.indexOf(a)!==n)throw W(o,`duplicate class target ${JSON.stringify(a)}`);Y(v,s,i)}}else Ie(v,_,n,r,g,!0,s);S(c,{conditions:h,fragmentsBySlot:v})}return c}function Ve(e,t,n){let r=G(e,`definition`);for(let e of r)if(!Ee.has(e))throw W(`definition.${e}`,`unknown field`);let i=e,a;if(r.includes(`extend`)){let e=K(i,`extend`,`definition.extend`);if(e!==void 0&&(typeof e!=`function`||(a=t.get(e))===void 0))throw W(`definition.extend`,`expected a recipe from this exact reciper`)}let o=r.includes(Te);if(!o&&a===void 0)throw W(P,`required own enumerable field`);let s=Fe(o?K(i,Te,P):void 0,a,!o,n),c=s.baseFragments.length,l=s.names.length===0,u=Le(r.includes(`variants`)?K(i,`variants`,F):void 0,a,l,s.indexes,c,n),d=Re(r.includes(`defaultVariants`)?K(i,`defaultVariants`,I):void 0,a,u.variants,u.indexes),f=Be(r.includes(`compoundVariants`)?K(i,`compoundVariants`,L):void 0,a,l,s.indexes,c,u.variants,u.indexes,n),p=X(c);for(let e of f)for(let t=0;t<c;t++)e.fragmentsBySlot[t]!==void 0&&S(p[t]??=[],e);return{slotNames:s.names,baseFragmentsBySlot:s.baseFragments,variants:u.variants,defaultStates:d,compounds:f,compoundsBySlot:p}}function He(e,t){if(e===void 0)return t.defaultStates;let n=ke(e,R),r=H(n);if(U(n,r,`class`))throw W(`${R}.class`,`reserved field`);if(U(n,r,z))throw W(`${R}.className`,`caller classes belong to a style resolver`);let i=e,a;for(let e=0;e<t.variants.length;e++){let o=t.variants[e];if(!U(n,r,o.name))continue;let s=`${R}.${o.name}`,c=K(i,o.name,s);c!==void 0&&(a??=[...t.defaultStates],a[e]=$(c,o,s))}return a??t.defaultStates}function Ue(e,t,n){if(t!==void 0){let e=n<Me||N.call(t,n)?t[n]:void 0;if(e!==void 0)return e}return e[n]}function We(e,t,n){for(let r of e.conditions)if(!r.states.includes(Ue(t,n,r.variantIndex)))return!1;return!0}function Ge(e,t,n){if(n===void 0)return t;for(let r of n)Ne(e,t,r),t++;return t}function Ke(e,t,n,r,i,a){let o,s;if(r!==void 0){let t=ke(r,i),n=H(t);if(U(t,n,`class`))throw W(`${i}.class`,`reserved field`);let a=r;for(let r=0;r<e.variants.length;r++){let s=e.variants[r];if(!U(t,n,s.name))continue;let c=`${i}.${s.name}`,l=K(a,s.name,c);l!==void 0&&(o??=Z(),Ne(o,r,$(l,s,c)))}U(t,n,`className`)&&(s=K(a,`className`,`${i}.className`))}let c=Z(),l=Ge(c,0,e.baseFragmentsBySlot[t]);for(let r=0;r<e.variants.length;r++){let i=Ue(n,o,r);if(i==null)continue;let a=e.variants[r].choices[i];a!==void 0&&(l=Ge(c,l,a.fragmentsBySlot[t]))}let u=e.compoundsBySlot[t];if(u!==void 0)for(let e of u)We(e,n,o)&&(l=Ge(c,l,e.fragmentsBySlot[t]));return c.length=l,a(c,s)}function qe(e,t,n){Object.defineProperty(e,t,{value:n,configurable:!0,enumerable:!0,writable:!0})}function Je(e){let t={};for(let n of e.variants)qe(t,n.name,Object.freeze(Object.keys(n.choices)));let n={};for(let t=0;t<e.variants.length;t++){let r=e.defaultStates[t];typeof r==`string`&&qe(n,e.variants[t].name,r)}return Object.freeze({anatomy:Object.freeze([...e.slotNames]),variants:Object.freeze(t),defaultVariants:Object.freeze(n),compoundVariantCount:e.compounds.length})}function Ye(e,t){let n=e.slotNames.length===0?n=>Ke(e,0,e.defaultStates,n,R,t):n=>{let r=He(n,e),i=Object.create(null);for(let n=0;n<e.slotNames.length;n++){let a=e.slotNames[n];i[a]=i=>Ke(e,n,r,i,`style props.${a}`,t)}return i};return Object.defineProperty(n,"config",{value:Je(e),configurable:!1,enumerable:!1,writable:!1})}const Xe=new WeakMap,Ze=(e=>{let t=Ve(e,Xe,Ce),n=Ye(t,we);return Xe.set(n,t),n});export{Se as cn,e as omitAttributes,Ze as recipe};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teacss/classes",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "TeaCSS class composition — typed recipes, nested class-value joining, and semantic conflict resolution.",
|
|
5
5
|
"homepage": "https://css.teasim.com",
|
|
6
6
|
"funding": "https://github.com/sponsors/billgo",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dev": "tsdown --watch"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@teacss/core": "0.
|
|
25
|
+
"@teacss/core": "0.6.2"
|
|
26
26
|
},
|
|
27
27
|
"engines": {
|
|
28
28
|
"node": ">=22.12.0"
|