@csszyx/runtime 0.9.10 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -94,6 +94,25 @@ function disableCSRRecovery() {
94
94
  function isCSRRecoveryAllowed() {
95
95
  return state.recoveryAllowed;
96
96
  }
97
+ const MAX_MANGLE_MAP_ENTRIES = 1e5;
98
+ function isValidMangleMap(value) {
99
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
100
+ return false;
101
+ }
102
+ const entries = Object.entries(value);
103
+ if (entries.length > MAX_MANGLE_MAP_ENTRIES) {
104
+ return false;
105
+ }
106
+ for (const [key, val] of entries) {
107
+ if (key === "__proto__" || key === "constructor" || key === "prototype") {
108
+ return false;
109
+ }
110
+ if (typeof key !== "string" || typeof val !== "string") {
111
+ return false;
112
+ }
113
+ }
114
+ return true;
115
+ }
97
116
  function loadMangleMapFromDOM() {
98
117
  if (typeof document === "undefined") {
99
118
  return null;
@@ -104,7 +123,14 @@ function loadMangleMapFromDOM() {
104
123
  }
105
124
  try {
106
125
  const content = scriptElement.textContent || "";
107
- return JSON.parse(content);
126
+ const parsed = JSON.parse(content);
127
+ if (!isValidMangleMap(parsed)) {
128
+ console.error(
129
+ "[csszyx] Mangle map failed schema validation (not a plain string\u2192string map); ignoring it."
130
+ );
131
+ return null;
132
+ }
133
+ return parsed;
108
134
  } catch (error) {
109
135
  console.error("Failed to parse mangle map:", error);
110
136
  return null;
@@ -118,6 +144,24 @@ function verifyMangleChecksum(expectedChecksum) {
118
144
  const actualChecksum = htmlElement.getAttribute("data-sz-checksum");
119
145
  return actualChecksum === expectedChecksum;
120
146
  }
147
+ async function computeMangleChecksumAsync(map) {
148
+ const canonical = Object.keys(map).sort().map((key) => `${key}:${map[key]}`).join("|");
149
+ const bytes = new TextEncoder().encode(canonical);
150
+ const digest = await crypto.subtle.digest("SHA-256", bytes);
151
+ let hex = "";
152
+ for (const b of new Uint8Array(digest)) {
153
+ hex += b.toString(16).padStart(2, "0");
154
+ }
155
+ return hex.slice(0, 16);
156
+ }
157
+ async function verifyMangleChecksumAsync(expectedChecksum, map) {
158
+ const target = map ?? loadMangleMapFromDOM();
159
+ if (!target) {
160
+ return false;
161
+ }
162
+ const actual = await computeMangleChecksumAsync(target);
163
+ return actual === expectedChecksum;
164
+ }
121
165
  function verifyMangleMapIntegrity() {
122
166
  if (typeof document === "undefined") {
123
167
  return false;
@@ -134,12 +178,23 @@ function verifyMangleMapIntegrity() {
134
178
  return false;
135
179
  }
136
180
  try {
137
- const mangleMap = JSON.parse(scriptElement.textContent || "{}");
181
+ const parsed = JSON.parse(scriptElement.textContent || "{}");
182
+ if (!isValidMangleMap(parsed)) {
183
+ console.error(
184
+ "[csszyx] Mangle map failed schema validation; treating integrity as invalid."
185
+ );
186
+ return false;
187
+ }
188
+ const mangleMap = parsed;
138
189
  if (typeof window !== "undefined" && "verify_mangle_checksum" in window) {
139
190
  const isValid = window.verify_mangle_checksum(mangleMap, checksum);
140
191
  return isValid;
141
192
  }
142
- console.warn("[csszyx] Rust core not available, using fallback verification");
193
+ if (process.env.NODE_ENV !== "production") {
194
+ console.warn(
195
+ "[csszyx] WASM core not loaded \u2014 mangle map checksum is unverified (schema-validated only). This is detection, not authentication."
196
+ );
197
+ }
143
198
  return true;
144
199
  } catch (error) {
145
200
  console.error("[csszyx] Failed to verify mangle map:", error);
@@ -277,6 +332,12 @@ function transform(szProp) {
277
332
  return res;
278
333
  }
279
334
  function _sz(...classes) {
335
+ return szJoin(classes, 0);
336
+ }
337
+ function szJoin(classes, depth) {
338
+ if (depth >= browser.MAX_SZ_DEPTH) {
339
+ throw new browser.SzDepthError();
340
+ }
280
341
  if (classes.length === 1) {
281
342
  const cls = classes[0];
282
343
  if (typeof cls === "string") {
@@ -286,7 +347,7 @@ function _sz(...classes) {
286
347
  return "";
287
348
  }
288
349
  if (Array.isArray(cls)) {
289
- return _sz(...cls);
350
+ return szJoin(cls, depth + 1);
290
351
  }
291
352
  const res = transform(cls);
292
353
  return typeof res === "string" ? res : res.className;
@@ -299,7 +360,7 @@ function _sz(...classes) {
299
360
  continue;
300
361
  }
301
362
  if (Array.isArray(cls)) {
302
- const str2 = _sz(...cls);
363
+ const str2 = szJoin(cls, depth + 1);
303
364
  if (!str2) {
304
365
  continue;
305
366
  }
@@ -323,50 +384,13 @@ function _sz(...classes) {
323
384
  }
324
385
  return result;
325
386
  }
326
- function _szIf(condition, truthyValue, falsyValue) {
327
- const value = condition ? truthyValue : falsyValue;
328
- if (!value) {
329
- return "";
330
- }
331
- if (typeof value === "string") {
332
- return value;
333
- }
334
- if (Array.isArray(value)) {
335
- return _sz(...value);
336
- }
337
- const res = transform(value);
338
- return typeof res === "string" ? res : res.className;
387
+ function _szMerge(...classes) {
388
+ return szMergeJoin(classes, 0);
339
389
  }
340
- function _szSwitch(conditions, defaultValue = "") {
341
- for (let i = 0; i < conditions.length; i++) {
342
- const [condition, value] = conditions[i];
343
- if (condition) {
344
- if (!value) {
345
- return "";
346
- }
347
- if (typeof value === "string") {
348
- return value;
349
- }
350
- if (Array.isArray(value)) {
351
- return _sz(...value);
352
- }
353
- const res2 = transform(value);
354
- return typeof res2 === "string" ? res2 : res2.className;
355
- }
356
- }
357
- if (!defaultValue) {
358
- return "";
390
+ function szMergeJoin(classes, depth) {
391
+ if (depth >= browser.MAX_SZ_DEPTH) {
392
+ throw new browser.SzDepthError();
359
393
  }
360
- if (typeof defaultValue === "string") {
361
- return defaultValue;
362
- }
363
- if (Array.isArray(defaultValue)) {
364
- return _sz(...defaultValue);
365
- }
366
- const res = transform(defaultValue);
367
- return typeof res === "string" ? res : res.className;
368
- }
369
- function _szMerge(...classes) {
370
394
  const seen = /* @__PURE__ */ new Set();
371
395
  const result = [];
372
396
  for (let i = 0; i < classes.length; i++) {
@@ -375,7 +399,7 @@ function _szMerge(...classes) {
375
399
  continue;
376
400
  }
377
401
  if (Array.isArray(cls)) {
378
- const str2 = _szMerge(...cls);
402
+ const str2 = szMergeJoin(cls, depth + 1);
379
403
  if (!str2) {
380
404
  continue;
381
405
  }
@@ -437,13 +461,891 @@ function _sz3(a, b, c) {
437
461
  return result;
438
462
  }
439
463
 
440
- function deepMerge(target, source) {
464
+ const BOX_ROLE_TOKENS = /* @__PURE__ */ new Map([
465
+ ["absolute", { role: "outer", category: "position" }],
466
+ ["antialiased", { role: "inner", category: "text" }],
467
+ ["block", { role: "inner", category: "display" }],
468
+ ["capitalize", { role: "inner", category: "text" }],
469
+ ["collapse", { role: "outer", category: "visibility" }],
470
+ ["container", { role: "outer", category: "sizing" }],
471
+ ["contents", { role: "inner", category: "display" }],
472
+ ["diagonal-fractions", { role: "inner", category: "text" }],
473
+ ["divide-x-reverse", { role: "outer", category: "divide" }],
474
+ ["divide-y-reverse", { role: "outer", category: "divide" }],
475
+ ["fixed", { role: "outer", category: "position" }],
476
+ ["flex", { role: "inner", category: "display" }],
477
+ ["flow-root", { role: "inner", category: "display" }],
478
+ ["grid", { role: "inner", category: "display" }],
479
+ ["hidden", { role: "inner", category: "display" }],
480
+ ["inline", { role: "inner", category: "display" }],
481
+ ["inline-block", { role: "inner", category: "display" }],
482
+ ["inline-flex", { role: "inner", category: "display" }],
483
+ ["inline-grid", { role: "inner", category: "display" }],
484
+ ["invisible", { role: "outer", category: "visibility" }],
485
+ ["isolate", { role: "outer", category: "position" }],
486
+ ["italic", { role: "inner", category: "text" }],
487
+ ["line-through", { role: "inner", category: "text" }],
488
+ ["lining-nums", { role: "inner", category: "text" }],
489
+ ["list-item", { role: "inner", category: "display" }],
490
+ ["lowercase", { role: "inner", category: "text" }],
491
+ ["no-underline", { role: "inner", category: "text" }],
492
+ ["normal-case", { role: "inner", category: "text" }],
493
+ ["not-italic", { role: "inner", category: "text" }],
494
+ ["not-sr-only", { role: "outer", category: "visibility" }],
495
+ ["oldstyle-nums", { role: "inner", category: "text" }],
496
+ ["ordinal", { role: "inner", category: "text" }],
497
+ ["overline", { role: "inner", category: "text" }],
498
+ ["proportional-nums", { role: "inner", category: "text" }],
499
+ ["prose", { role: "inner", category: "text" }],
500
+ ["prose-invert", { role: "inner", category: "text" }],
501
+ ["relative", { role: "outer", category: "position" }],
502
+ ["slashed-zero", { role: "inner", category: "text" }],
503
+ ["space-x-reverse", { role: "inner", category: "space" }],
504
+ ["space-y-reverse", { role: "inner", category: "space" }],
505
+ ["sr-only", { role: "outer", category: "visibility" }],
506
+ ["stacked-fractions", { role: "inner", category: "text" }],
507
+ ["static", { role: "outer", category: "position" }],
508
+ ["sticky", { role: "outer", category: "position" }],
509
+ ["subpixel-antialiased", { role: "inner", category: "text" }],
510
+ ["table", { role: "inner", category: "display" }],
511
+ ["table-cell", { role: "inner", category: "display" }],
512
+ ["table-row", { role: "inner", category: "display" }],
513
+ ["tabular-nums", { role: "inner", category: "text" }],
514
+ ["truncate", { role: "inner", category: "text" }],
515
+ ["underline", { role: "inner", category: "text" }],
516
+ ["uppercase", { role: "inner", category: "text" }],
517
+ ["visible", { role: "outer", category: "visibility" }]
518
+ ]);
519
+ const BOX_ROLE_PREFIXES = [
520
+ ["backdrop-brightness", { role: "outer", category: "backdrop" }],
521
+ ["backdrop-hue-rotate", { role: "outer", category: "backdrop" }],
522
+ ["forced-color-adjust", { role: "outer", category: "color-scheme" }],
523
+ ["backdrop-grayscale", { role: "outer", category: "backdrop" }],
524
+ ["perspective-origin", { role: "outer", category: "transform" }],
525
+ ["backdrop-contrast", { role: "outer", category: "backdrop" }],
526
+ ["backdrop-saturate", { role: "outer", category: "backdrop" }],
527
+ ["backdrop-opacity", { role: "outer", category: "backdrop" }],
528
+ ["border-spacing-x", { role: "outer", category: "border" }],
529
+ ["border-spacing-y", { role: "outer", category: "border" }],
530
+ ["scrollbar-gutter", { role: "inner", category: "scroll" }],
531
+ ["underline-offset", { role: "inner", category: "text" }],
532
+ ["animation-delay", { role: "outer", category: "transition" }],
533
+ ["backdrop-filter", { role: "outer", category: "backdrop" }],
534
+ ["backdrop-invert", { role: "outer", category: "backdrop" }],
535
+ ["scrollbar-thumb", { role: "inner", category: "scroll" }],
536
+ ["scrollbar-track", { role: "inner", category: "scroll" }],
537
+ ["backdrop-sepia", { role: "outer", category: "backdrop" }],
538
+ ["border-spacing", { role: "outer", category: "border" }],
539
+ ["box-decoration", { role: "outer", category: "fragmentation" }],
540
+ ["font-smoothing", { role: "inner", category: "text" }],
541
+ ["outline-offset", { role: "outer", category: "outline" }],
542
+ ["pointer-events", { role: "inner", category: "interaction" }],
543
+ ["backdrop-blur", { role: "outer", category: "backdrop" }],
544
+ ["font-features", { role: "inner", category: "text" }],
545
+ ["justify-items", { role: "inner", category: "alignment" }],
546
+ ["mask-position", { role: "outer", category: "mask" }],
547
+ ["place-content", { role: "inner", category: "alignment" }],
548
+ ["break-before", { role: "outer", category: "fragmentation" }],
549
+ ["break-inside", { role: "outer", category: "fragmentation" }],
550
+ ["field-sizing", { role: "inner", category: "interaction" }],
551
+ ["font-stretch", { role: "inner", category: "text" }],
552
+ ["inset-shadow", { role: "inner", category: "shadow" }],
553
+ ["justify-self", { role: "inner", category: "alignment" }],
554
+ ["overscroll-x", { role: "inner", category: "overscroll" }],
555
+ ["overscroll-y", { role: "inner", category: "overscroll" }],
556
+ ["break-after", { role: "outer", category: "fragmentation" }],
557
+ ["drop-shadow", { role: "outer", category: "filter" }],
558
+ ["mask-origin", { role: "outer", category: "mask" }],
559
+ ["mask-repeat", { role: "outer", category: "mask" }],
560
+ ["perspective", { role: "outer", category: "transform" }],
561
+ ["place-items", { role: "inner", category: "alignment" }],
562
+ ["ring-offset", { role: "outer", category: "ring" }],
563
+ ["text-shadow", { role: "inner", category: "text" }],
564
+ ["translate-x", { role: "outer", category: "transform" }],
565
+ ["translate-y", { role: "outer", category: "transform" }],
566
+ ["translate-z", { role: "outer", category: "transform" }],
567
+ ["will-change", { role: "inner", category: "interaction" }],
568
+ ["appearance", { role: "inner", category: "interaction" }],
569
+ ["brightness", { role: "outer", category: "filter" }],
570
+ ["decoration", { role: "inner", category: "text" }],
571
+ ["font-style", { role: "inner", category: "text" }],
572
+ ["hue-rotate", { role: "outer", category: "filter" }],
573
+ ["inset-ring", { role: "inner", category: "ring" }],
574
+ ["line-clamp", { role: "inner", category: "text" }],
575
+ ["list-image", { role: "inner", category: "list" }],
576
+ ["max-inline", { role: "outer", category: "sizing" }],
577
+ ["min-inline", { role: "outer", category: "sizing" }],
578
+ ["overflow-x", { role: "inner", category: "overflow" }],
579
+ ["overflow-y", { role: "inner", category: "overflow" }],
580
+ ["overscroll", { role: "inner", category: "overscroll" }],
581
+ ["place-self", { role: "inner", category: "alignment" }],
582
+ ["rounded-bl", { role: "outer", category: "rounded" }],
583
+ ["rounded-br", { role: "outer", category: "rounded" }],
584
+ ["rounded-ee", { role: "outer", category: "rounded" }],
585
+ ["rounded-es", { role: "outer", category: "rounded" }],
586
+ ["rounded-se", { role: "outer", category: "rounded" }],
587
+ ["rounded-ss", { role: "outer", category: "rounded" }],
588
+ ["rounded-tl", { role: "outer", category: "rounded" }],
589
+ ["rounded-tr", { role: "outer", category: "rounded" }],
590
+ ["scroll-mbe", { role: "inner", category: "scroll" }],
591
+ ["scroll-mbs", { role: "inner", category: "scroll" }],
592
+ ["scroll-pbe", { role: "inner", category: "scroll" }],
593
+ ["scroll-pbs", { role: "inner", category: "scroll" }],
594
+ ["transition", { role: "outer", category: "transition" }],
595
+ ["visibility", { role: "outer", category: "visibility" }],
596
+ ["whitespace", { role: "inner", category: "text" }],
597
+ ["auto-cols", { role: "inner", category: "grid" }],
598
+ ["auto-rows", { role: "inner", category: "grid" }],
599
+ ["bg-origin", { role: "outer", category: "bg" }],
600
+ ["border-be", { role: "outer", category: "border" }],
601
+ ["border-bs", { role: "outer", category: "border" }],
602
+ ["col-start", { role: "inner", category: "grid" }],
603
+ ["grayscale", { role: "outer", category: "filter" }],
604
+ ["grid-cols", { role: "inner", category: "grid" }],
605
+ ["grid-flow", { role: "inner", category: "grid" }],
606
+ ["grid-rows", { role: "inner", category: "grid" }],
607
+ ["isolation", { role: "outer", category: "position" }],
608
+ ["mask-clip", { role: "outer", category: "mask" }],
609
+ ["mask-from", { role: "outer", category: "mask" }],
610
+ ["mask-size", { role: "outer", category: "mask" }],
611
+ ["max-block", { role: "outer", category: "sizing" }],
612
+ ["min-block", { role: "outer", category: "sizing" }],
613
+ ["mix-blend", { role: "outer", category: "blend" }],
614
+ ["rounded-b", { role: "outer", category: "rounded" }],
615
+ ["rounded-e", { role: "outer", category: "rounded" }],
616
+ ["rounded-l", { role: "outer", category: "rounded" }],
617
+ ["rounded-r", { role: "outer", category: "rounded" }],
618
+ ["rounded-s", { role: "outer", category: "rounded" }],
619
+ ["rounded-t", { role: "outer", category: "rounded" }],
620
+ ["row-start", { role: "inner", category: "grid" }],
621
+ ["scroll-mb", { role: "inner", category: "scroll" }],
622
+ ["scroll-me", { role: "inner", category: "scroll" }],
623
+ ["scroll-ml", { role: "inner", category: "scroll" }],
624
+ ["scroll-mr", { role: "inner", category: "scroll" }],
625
+ ["scroll-ms", { role: "inner", category: "scroll" }],
626
+ ["scroll-mt", { role: "inner", category: "scroll" }],
627
+ ["scroll-mx", { role: "inner", category: "scroll" }],
628
+ ["scroll-my", { role: "inner", category: "scroll" }],
629
+ ["scroll-pb", { role: "inner", category: "scroll" }],
630
+ ["scroll-pe", { role: "inner", category: "scroll" }],
631
+ ["scroll-pl", { role: "inner", category: "scroll" }],
632
+ ["scroll-pr", { role: "inner", category: "scroll" }],
633
+ ["scroll-ps", { role: "inner", category: "scroll" }],
634
+ ["scroll-pt", { role: "inner", category: "scroll" }],
635
+ ["scroll-px", { role: "inner", category: "scroll" }],
636
+ ["scroll-py", { role: "inner", category: "scroll" }],
637
+ ["scrollbar", { role: "inner", category: "scroll" }],
638
+ ["transform", { role: "outer", category: "transform" }],
639
+ ["translate", { role: "outer", category: "transform" }],
640
+ ["backface", { role: "outer", category: "transform" }],
641
+ ["bg-blend", { role: "outer", category: "bg" }],
642
+ ["border-b", { role: "outer", category: "border" }],
643
+ ["border-e", { role: "outer", category: "border" }],
644
+ ["border-l", { role: "outer", category: "border" }],
645
+ ["border-r", { role: "outer", category: "border" }],
646
+ ["border-s", { role: "outer", category: "border" }],
647
+ ["border-t", { role: "outer", category: "border" }],
648
+ ["border-x", { role: "outer", category: "border" }],
649
+ ["border-y", { role: "outer", category: "border" }],
650
+ ["col-span", { role: "inner", category: "grid" }],
651
+ ["contrast", { role: "outer", category: "filter" }],
652
+ ["divide-x", { role: "outer", category: "divide" }],
653
+ ["divide-y", { role: "outer", category: "divide" }],
654
+ ["duration", { role: "outer", category: "transition" }],
655
+ ["inset-be", { role: "outer", category: "position" }],
656
+ ["inset-bs", { role: "outer", category: "position" }],
657
+ ["mask-via", { role: "outer", category: "mask" }],
658
+ ["overflow", { role: "inner", category: "overflow" }],
659
+ ["position", { role: "outer", category: "position" }],
660
+ ["rotate-x", { role: "outer", category: "transform" }],
661
+ ["rotate-y", { role: "outer", category: "transform" }],
662
+ ["rotate-z", { role: "outer", category: "transform" }],
663
+ ["row-span", { role: "inner", category: "grid" }],
664
+ ["saturate", { role: "outer", category: "filter" }],
665
+ ["scroll-m", { role: "inner", category: "scroll" }],
666
+ ["scroll-p", { role: "inner", category: "scroll" }],
667
+ ["tracking", { role: "inner", category: "text" }],
668
+ ["animate", { role: "outer", category: "transition" }],
669
+ ["bg-clip", { role: "outer", category: "bg" }],
670
+ ["caption", { role: "inner", category: "table" }],
671
+ ["col-end", { role: "inner", category: "grid" }],
672
+ ["columns", { role: "inner", category: "columns" }],
673
+ ["content", { role: "inner", category: "text" }],
674
+ ["display", { role: "inner", category: "display" }],
675
+ ["hyphens", { role: "inner", category: "text" }],
676
+ ["inset-e", { role: "outer", category: "position" }],
677
+ ["inset-s", { role: "outer", category: "position" }],
678
+ ["inset-x", { role: "outer", category: "position" }],
679
+ ["inset-y", { role: "outer", category: "position" }],
680
+ ["justify", { role: "inner", category: "alignment" }],
681
+ ["leading", { role: "inner", category: "text" }],
682
+ ["mask-to", { role: "outer", category: "mask" }],
683
+ ["opacity", { role: "outer", category: "opacity" }],
684
+ ["outline", { role: "outer", category: "outline" }],
685
+ ["rounded", { role: "outer", category: "rounded" }],
686
+ ["row-end", { role: "inner", category: "grid" }],
687
+ ["scale-x", { role: "outer", category: "transform" }],
688
+ ["scale-y", { role: "outer", category: "transform" }],
689
+ ["scale-z", { role: "outer", category: "transform" }],
690
+ ["space-x", { role: "inner", category: "space" }],
691
+ ["space-y", { role: "inner", category: "space" }],
692
+ ["accent", { role: "inner", category: "accent" }],
693
+ ["aspect", { role: "outer", category: "sizing" }],
694
+ ["border", { role: "outer", category: "border" }],
695
+ ["bottom", { role: "outer", category: "position" }],
696
+ ["cursor", { role: "inner", category: "interaction" }],
697
+ ["divide", { role: "outer", category: "divide" }],
698
+ ["filter", { role: "outer", category: "filter" }],
699
+ ["indent", { role: "inner", category: "text" }],
700
+ ["inline", { role: "outer", category: "sizing" }],
701
+ ["invert", { role: "outer", category: "filter" }],
702
+ ["object", { role: "inner", category: "object" }],
703
+ ["origin", { role: "outer", category: "transform" }],
704
+ ["resize", { role: "inner", category: "interaction" }],
705
+ ["rotate", { role: "outer", category: "transform" }],
706
+ ["scheme", { role: "outer", category: "color-scheme" }],
707
+ ["scroll", { role: "inner", category: "scroll" }],
708
+ ["select", { role: "inner", category: "interaction" }],
709
+ ["shadow", { role: "outer", category: "shadow" }],
710
+ ["shrink", { role: "inner", category: "flex" }],
711
+ ["skew-x", { role: "outer", category: "transform" }],
712
+ ["skew-y", { role: "outer", category: "transform" }],
713
+ ["stroke", { role: "inner", category: "svg" }],
714
+ ["align", { role: "inner", category: "text" }],
715
+ ["basis", { role: "inner", category: "flex" }],
716
+ ["block", { role: "outer", category: "sizing" }],
717
+ ["break", { role: "inner", category: "text" }],
718
+ ["caret", { role: "inner", category: "accent" }],
719
+ ["clear", { role: "outer", category: "position" }],
720
+ ["delay", { role: "outer", category: "transition" }],
721
+ ["float", { role: "outer", category: "position" }],
722
+ ["gap-x", { role: "inner", category: "gap" }],
723
+ ["gap-y", { role: "inner", category: "gap" }],
724
+ ["inset", { role: "outer", category: "position" }],
725
+ ["items", { role: "inner", category: "alignment" }],
726
+ ["max-h", { role: "outer", category: "sizing" }],
727
+ ["max-w", { role: "outer", category: "sizing" }],
728
+ ["min-h", { role: "outer", category: "sizing" }],
729
+ ["min-w", { role: "outer", category: "sizing" }],
730
+ ["order", { role: "inner", category: "flex" }],
731
+ ["right", { role: "outer", category: "position" }],
732
+ ["scale", { role: "outer", category: "transform" }],
733
+ ["sepia", { role: "outer", category: "filter" }],
734
+ ["table", { role: "inner", category: "table" }],
735
+ ["touch", { role: "inner", category: "touch" }],
736
+ ["blur", { role: "outer", category: "filter" }],
737
+ ["ease", { role: "outer", category: "transition" }],
738
+ ["fill", { role: "inner", category: "svg" }],
739
+ ["flex", { role: "inner", category: "flex" }],
740
+ ["font", { role: "inner", category: "text" }],
741
+ ["from", { role: "outer", category: "gradient" }],
742
+ ["grow", { role: "inner", category: "flex" }],
743
+ ["left", { role: "outer", category: "position" }],
744
+ ["list", { role: "inner", category: "list" }],
745
+ ["mask", { role: "outer", category: "mask" }],
746
+ ["ring", { role: "outer", category: "ring" }],
747
+ ["self", { role: "inner", category: "alignment" }],
748
+ ["size", { role: "outer", category: "sizing" }],
749
+ ["snap", { role: "inner", category: "snap" }],
750
+ ["text", { role: "inner", category: "text" }],
751
+ ["wrap", { role: "inner", category: "text" }],
752
+ ["zoom", { role: "outer", category: "transform" }],
753
+ ["box", { role: "outer", category: "sizing" }],
754
+ ["col", { role: "inner", category: "grid" }],
755
+ ["gap", { role: "inner", category: "gap" }],
756
+ ["mbe", { role: "outer", category: "margin" }],
757
+ ["mbs", { role: "outer", category: "margin" }],
758
+ ["pbe", { role: "inner", category: "padding" }],
759
+ ["pbs", { role: "inner", category: "padding" }],
760
+ ["row", { role: "inner", category: "grid" }],
761
+ ["tab", { role: "inner", category: "text" }],
762
+ ["top", { role: "outer", category: "position" }],
763
+ ["via", { role: "outer", category: "gradient" }],
764
+ ["bg", { role: "outer", category: "bg" }],
765
+ ["mb", { role: "outer", category: "margin" }],
766
+ ["me", { role: "outer", category: "margin" }],
767
+ ["ml", { role: "outer", category: "margin" }],
768
+ ["mr", { role: "outer", category: "margin" }],
769
+ ["ms", { role: "outer", category: "margin" }],
770
+ ["mt", { role: "outer", category: "margin" }],
771
+ ["mx", { role: "outer", category: "margin" }],
772
+ ["my", { role: "outer", category: "margin" }],
773
+ ["pb", { role: "inner", category: "padding" }],
774
+ ["pe", { role: "inner", category: "padding" }],
775
+ ["pl", { role: "inner", category: "padding" }],
776
+ ["pr", { role: "inner", category: "padding" }],
777
+ ["ps", { role: "inner", category: "padding" }],
778
+ ["pt", { role: "inner", category: "padding" }],
779
+ ["px", { role: "inner", category: "padding" }],
780
+ ["py", { role: "inner", category: "padding" }],
781
+ ["to", { role: "outer", category: "gradient" }],
782
+ ["h", { role: "outer", category: "sizing" }],
783
+ ["m", { role: "outer", category: "margin" }],
784
+ ["p", { role: "inner", category: "padding" }],
785
+ ["w", { role: "outer", category: "sizing" }],
786
+ ["z", { role: "outer", category: "position" }]
787
+ ];
788
+ const BOX_ROLE_BY_KEY = /* @__PURE__ */ new Map([
789
+ ["accent", { role: "inner", category: "accent" }],
790
+ ["align", { role: "inner", category: "text" }],
791
+ ["animate", { role: "outer", category: "transition" }],
792
+ ["animationDelay", { role: "outer", category: "transition" }],
793
+ ["appearance", { role: "inner", category: "interaction" }],
794
+ ["aspect", { role: "outer", category: "sizing" }],
795
+ ["autoCols", { role: "inner", category: "grid" }],
796
+ ["autoRows", { role: "inner", category: "grid" }],
797
+ ["backdropBlur", { role: "outer", category: "backdrop" }],
798
+ ["backdropBrightness", { role: "outer", category: "backdrop" }],
799
+ ["backdropContrast", { role: "outer", category: "backdrop" }],
800
+ ["backdropFilter", { role: "outer", category: "backdrop" }],
801
+ ["backdropGrayscale", { role: "outer", category: "backdrop" }],
802
+ ["backdropHueRotate", { role: "outer", category: "backdrop" }],
803
+ ["backdropInvert", { role: "outer", category: "backdrop" }],
804
+ ["backdropOpacity", { role: "outer", category: "backdrop" }],
805
+ ["backdropSaturate", { role: "outer", category: "backdrop" }],
806
+ ["backdropSepia", { role: "outer", category: "backdrop" }],
807
+ ["backface", { role: "outer", category: "transform" }],
808
+ ["basis", { role: "inner", category: "flex" }],
809
+ ["bg", { role: "outer", category: "bg" }],
810
+ ["bgAttach", { role: "outer", category: "bg" }],
811
+ ["bgBlend", { role: "outer", category: "bg" }],
812
+ ["bgClip", { role: "outer", category: "bg" }],
813
+ ["bgImg", { role: "outer", category: "bg" }],
814
+ ["bgOrigin", { role: "outer", category: "bg" }],
815
+ ["bgPos", { role: "outer", category: "bg" }],
816
+ ["bgRepeat", { role: "outer", category: "bg" }],
817
+ ["bgSize", { role: "outer", category: "bg" }],
818
+ ["blockSize", { role: "outer", category: "sizing" }],
819
+ ["blur", { role: "outer", category: "filter" }],
820
+ ["border", { role: "outer", category: "border" }],
821
+ ["borderB", { role: "outer", category: "border" }],
822
+ ["borderBColor", { role: "outer", category: "border" }],
823
+ ["borderBe", { role: "outer", category: "border" }],
824
+ ["borderBs", { role: "outer", category: "border" }],
825
+ ["borderCollapse", { role: "outer", category: "border" }],
826
+ ["borderColor", { role: "outer", category: "border" }],
827
+ ["borderE", { role: "outer", category: "border" }],
828
+ ["borderL", { role: "outer", category: "border" }],
829
+ ["borderLColor", { role: "outer", category: "border" }],
830
+ ["borderR", { role: "outer", category: "border" }],
831
+ ["borderRColor", { role: "outer", category: "border" }],
832
+ ["borderS", { role: "outer", category: "border" }],
833
+ ["borderSpacing", { role: "outer", category: "border" }],
834
+ ["borderSpacingX", { role: "outer", category: "border" }],
835
+ ["borderSpacingY", { role: "outer", category: "border" }],
836
+ ["borderStyle", { role: "outer", category: "border" }],
837
+ ["borderT", { role: "outer", category: "border" }],
838
+ ["borderTColor", { role: "outer", category: "border" }],
839
+ ["borderX", { role: "outer", category: "border" }],
840
+ ["borderXColor", { role: "outer", category: "border" }],
841
+ ["borderY", { role: "outer", category: "border" }],
842
+ ["borderYColor", { role: "outer", category: "border" }],
843
+ ["bottom", { role: "outer", category: "position" }],
844
+ ["box", { role: "outer", category: "sizing" }],
845
+ ["boxDecoration", { role: "outer", category: "fragmentation" }],
846
+ ["break", { role: "inner", category: "text" }],
847
+ ["breakAfter", { role: "outer", category: "fragmentation" }],
848
+ ["breakBefore", { role: "outer", category: "fragmentation" }],
849
+ ["breakInside", { role: "outer", category: "fragmentation" }],
850
+ ["brightness", { role: "outer", category: "filter" }],
851
+ ["caption", { role: "inner", category: "table" }],
852
+ ["caret", { role: "inner", category: "accent" }],
853
+ ["clear", { role: "outer", category: "position" }],
854
+ ["col", { role: "inner", category: "grid" }],
855
+ ["colEnd", { role: "inner", category: "grid" }],
856
+ ["color", { role: "inner", category: "text" }],
857
+ ["colSpan", { role: "inner", category: "grid" }],
858
+ ["colStart", { role: "inner", category: "grid" }],
859
+ ["columns", { role: "inner", category: "columns" }],
860
+ ["container", { role: "outer", category: "sizing" }],
861
+ ["content", { role: "inner", category: "text" }],
862
+ ["contrast", { role: "outer", category: "filter" }],
863
+ ["cursor", { role: "inner", category: "interaction" }],
864
+ ["decoration", { role: "inner", category: "text" }],
865
+ ["decorationColor", { role: "inner", category: "text" }],
866
+ ["decorationStyle", { role: "inner", category: "text" }],
867
+ ["decorationThickness", { role: "inner", category: "text" }],
868
+ ["delay", { role: "outer", category: "transition" }],
869
+ ["diagonalFractions", { role: "inner", category: "text" }],
870
+ ["display", { role: "inner", category: "display" }],
871
+ ["divideColor", { role: "outer", category: "divide" }],
872
+ ["divideStyle", { role: "outer", category: "divide" }],
873
+ ["divideX", { role: "outer", category: "divide" }],
874
+ ["divideXReverse", { role: "outer", category: "divide" }],
875
+ ["divideY", { role: "outer", category: "divide" }],
876
+ ["divideYReverse", { role: "outer", category: "divide" }],
877
+ ["dropShadow", { role: "outer", category: "filter" }],
878
+ ["dropShadowColor", { role: "outer", category: "filter" }],
879
+ ["duration", { role: "outer", category: "transition" }],
880
+ ["ease", { role: "outer", category: "transition" }],
881
+ ["end", { role: "outer", category: "position" }],
882
+ ["fieldSizing", { role: "inner", category: "interaction" }],
883
+ ["fill", { role: "inner", category: "svg" }],
884
+ ["filter", { role: "outer", category: "filter" }],
885
+ ["flex", { role: "inner", category: "flex" }],
886
+ ["flexDir", { role: "inner", category: "flex" }],
887
+ ["flexWrap", { role: "inner", category: "flex" }],
888
+ ["float", { role: "outer", category: "position" }],
889
+ ["fontFamily", { role: "inner", category: "text" }],
890
+ ["fontFeatures", { role: "inner", category: "text" }],
891
+ ["fontSmoothing", { role: "inner", category: "text" }],
892
+ ["fontStretch", { role: "inner", category: "text" }],
893
+ ["fontStyle", { role: "inner", category: "text" }],
894
+ ["forcedColorAdjust", { role: "outer", category: "color-scheme" }],
895
+ ["from", { role: "outer", category: "gradient" }],
896
+ ["gap", { role: "inner", category: "gap" }],
897
+ ["gapX", { role: "inner", category: "gap" }],
898
+ ["gapY", { role: "inner", category: "gap" }],
899
+ ["grayscale", { role: "outer", category: "filter" }],
900
+ ["gridCols", { role: "inner", category: "grid" }],
901
+ ["gridFlow", { role: "inner", category: "grid" }],
902
+ ["gridRows", { role: "inner", category: "grid" }],
903
+ ["grow", { role: "inner", category: "flex" }],
904
+ ["h", { role: "outer", category: "sizing" }],
905
+ ["hueRotate", { role: "outer", category: "filter" }],
906
+ ["hyphens", { role: "inner", category: "text" }],
907
+ ["indent", { role: "inner", category: "text" }],
908
+ ["inlineSize", { role: "outer", category: "sizing" }],
909
+ ["inset", { role: "outer", category: "position" }],
910
+ ["insetBe", { role: "outer", category: "position" }],
911
+ ["insetBs", { role: "outer", category: "position" }],
912
+ ["insetE", { role: "outer", category: "position" }],
913
+ ["insetRing", { role: "inner", category: "ring" }],
914
+ ["insetRingColor", { role: "inner", category: "ring" }],
915
+ ["insetS", { role: "outer", category: "position" }],
916
+ ["insetShadow", { role: "inner", category: "shadow" }],
917
+ ["insetShadowColor", { role: "inner", category: "shadow" }],
918
+ ["insetX", { role: "outer", category: "position" }],
919
+ ["insetY", { role: "outer", category: "position" }],
920
+ ["invert", { role: "outer", category: "filter" }],
921
+ ["isolation", { role: "outer", category: "position" }],
922
+ ["items", { role: "inner", category: "alignment" }],
923
+ ["justify", { role: "inner", category: "alignment" }],
924
+ ["justifyItems", { role: "inner", category: "alignment" }],
925
+ ["justifySelf", { role: "inner", category: "alignment" }],
926
+ ["leading", { role: "inner", category: "text" }],
927
+ ["left", { role: "outer", category: "position" }],
928
+ ["lineClamp", { role: "inner", category: "text" }],
929
+ ["liningNums", { role: "inner", category: "text" }],
930
+ ["list", { role: "inner", category: "list" }],
931
+ ["listImg", { role: "inner", category: "list" }],
932
+ ["listPos", { role: "inner", category: "list" }],
933
+ ["m", { role: "outer", category: "margin" }],
934
+ ["mask", { role: "outer", category: "mask" }],
935
+ ["maskClip", { role: "outer", category: "mask" }],
936
+ ["maskFrom", { role: "outer", category: "mask" }],
937
+ ["maskOrigin", { role: "outer", category: "mask" }],
938
+ ["maskPos", { role: "outer", category: "mask" }],
939
+ ["maskRepeat", { role: "outer", category: "mask" }],
940
+ ["maskShape", { role: "outer", category: "mask" }],
941
+ ["maskSize", { role: "outer", category: "mask" }],
942
+ ["maskTo", { role: "outer", category: "mask" }],
943
+ ["maskVia", { role: "outer", category: "mask" }],
944
+ ["maxBlockSize", { role: "outer", category: "sizing" }],
945
+ ["maxH", { role: "outer", category: "sizing" }],
946
+ ["maxInlineSize", { role: "outer", category: "sizing" }],
947
+ ["maxW", { role: "outer", category: "sizing" }],
948
+ ["mb", { role: "outer", category: "margin" }],
949
+ ["mbe", { role: "outer", category: "margin" }],
950
+ ["mbs", { role: "outer", category: "margin" }],
951
+ ["me", { role: "outer", category: "margin" }],
952
+ ["minBlockSize", { role: "outer", category: "sizing" }],
953
+ ["minH", { role: "outer", category: "sizing" }],
954
+ ["minInlineSize", { role: "outer", category: "sizing" }],
955
+ ["minW", { role: "outer", category: "sizing" }],
956
+ ["mixBlend", { role: "outer", category: "blend" }],
957
+ ["ml", { role: "outer", category: "margin" }],
958
+ ["mr", { role: "outer", category: "margin" }],
959
+ ["ms", { role: "outer", category: "margin" }],
960
+ ["mt", { role: "outer", category: "margin" }],
961
+ ["mx", { role: "outer", category: "margin" }],
962
+ ["my", { role: "outer", category: "margin" }],
963
+ ["notSrOnly", { role: "outer", category: "visibility" }],
964
+ ["objectFit", { role: "inner", category: "object" }],
965
+ ["objectPos", { role: "inner", category: "object" }],
966
+ ["oldstyleNums", { role: "inner", category: "text" }],
967
+ ["opacity", { role: "outer", category: "opacity" }],
968
+ ["order", { role: "inner", category: "flex" }],
969
+ ["ordinal", { role: "inner", category: "text" }],
970
+ ["origin", { role: "outer", category: "transform" }],
971
+ ["outline", { role: "outer", category: "outline" }],
972
+ ["outlineColor", { role: "outer", category: "outline" }],
973
+ ["outlineOffset", { role: "outer", category: "outline" }],
974
+ ["outlineStyle", { role: "outer", category: "outline" }],
975
+ ["overflow", { role: "inner", category: "overflow" }],
976
+ ["overflowX", { role: "inner", category: "overflow" }],
977
+ ["overflowY", { role: "inner", category: "overflow" }],
978
+ ["overscroll", { role: "inner", category: "overscroll" }],
979
+ ["overscrollX", { role: "inner", category: "overscroll" }],
980
+ ["overscrollY", { role: "inner", category: "overscroll" }],
981
+ ["p", { role: "inner", category: "padding" }],
982
+ ["pb", { role: "inner", category: "padding" }],
983
+ ["pbe", { role: "inner", category: "padding" }],
984
+ ["pbs", { role: "inner", category: "padding" }],
985
+ ["pe", { role: "inner", category: "padding" }],
986
+ ["perspective", { role: "outer", category: "transform" }],
987
+ ["perspectiveOrigin", { role: "outer", category: "transform" }],
988
+ ["pl", { role: "inner", category: "padding" }],
989
+ ["placeContent", { role: "inner", category: "alignment" }],
990
+ ["placeItems", { role: "inner", category: "alignment" }],
991
+ ["placeSelf", { role: "inner", category: "alignment" }],
992
+ ["pointerEvents", { role: "inner", category: "interaction" }],
993
+ ["position", { role: "outer", category: "position" }],
994
+ ["pr", { role: "inner", category: "padding" }],
995
+ ["proportionalNums", { role: "inner", category: "text" }],
996
+ ["prose", { role: "inner", category: "text" }],
997
+ ["proseInvert", { role: "inner", category: "text" }],
998
+ ["ps", { role: "inner", category: "padding" }],
999
+ ["pt", { role: "inner", category: "padding" }],
1000
+ ["px", { role: "inner", category: "padding" }],
1001
+ ["py", { role: "inner", category: "padding" }],
1002
+ ["resize", { role: "inner", category: "interaction" }],
1003
+ ["right", { role: "outer", category: "position" }],
1004
+ ["ring", { role: "outer", category: "ring" }],
1005
+ ["ringColor", { role: "outer", category: "ring" }],
1006
+ ["ringOffset", { role: "outer", category: "ring" }],
1007
+ ["ringOffsetColor", { role: "outer", category: "ring" }],
1008
+ ["rotate", { role: "outer", category: "transform" }],
1009
+ ["rotateX", { role: "outer", category: "transform" }],
1010
+ ["rotateY", { role: "outer", category: "transform" }],
1011
+ ["rotateZ", { role: "outer", category: "transform" }],
1012
+ ["rounded", { role: "outer", category: "rounded" }],
1013
+ ["roundedB", { role: "outer", category: "rounded" }],
1014
+ ["roundedBl", { role: "outer", category: "rounded" }],
1015
+ ["roundedBr", { role: "outer", category: "rounded" }],
1016
+ ["roundedE", { role: "outer", category: "rounded" }],
1017
+ ["roundedEe", { role: "outer", category: "rounded" }],
1018
+ ["roundedEs", { role: "outer", category: "rounded" }],
1019
+ ["roundedL", { role: "outer", category: "rounded" }],
1020
+ ["roundedR", { role: "outer", category: "rounded" }],
1021
+ ["roundedS", { role: "outer", category: "rounded" }],
1022
+ ["roundedSe", { role: "outer", category: "rounded" }],
1023
+ ["roundedSs", { role: "outer", category: "rounded" }],
1024
+ ["roundedT", { role: "outer", category: "rounded" }],
1025
+ ["roundedTl", { role: "outer", category: "rounded" }],
1026
+ ["roundedTr", { role: "outer", category: "rounded" }],
1027
+ ["row", { role: "inner", category: "grid" }],
1028
+ ["rowEnd", { role: "inner", category: "grid" }],
1029
+ ["rowSpan", { role: "inner", category: "grid" }],
1030
+ ["rowStart", { role: "inner", category: "grid" }],
1031
+ ["saturate", { role: "outer", category: "filter" }],
1032
+ ["scale", { role: "outer", category: "transform" }],
1033
+ ["scaleX", { role: "outer", category: "transform" }],
1034
+ ["scaleY", { role: "outer", category: "transform" }],
1035
+ ["scaleZ", { role: "outer", category: "transform" }],
1036
+ ["scheme", { role: "outer", category: "color-scheme" }],
1037
+ ["scroll", { role: "inner", category: "scroll" }],
1038
+ ["scrollbar", { role: "inner", category: "scroll" }],
1039
+ ["scrollbarGutter", { role: "inner", category: "scroll" }],
1040
+ ["scrollbarThumb", { role: "inner", category: "scroll" }],
1041
+ ["scrollbarTrack", { role: "inner", category: "scroll" }],
1042
+ ["scrollM", { role: "inner", category: "scroll" }],
1043
+ ["scrollMb", { role: "inner", category: "scroll" }],
1044
+ ["scrollMbe", { role: "inner", category: "scroll" }],
1045
+ ["scrollMbs", { role: "inner", category: "scroll" }],
1046
+ ["scrollMe", { role: "inner", category: "scroll" }],
1047
+ ["scrollMl", { role: "inner", category: "scroll" }],
1048
+ ["scrollMr", { role: "inner", category: "scroll" }],
1049
+ ["scrollMs", { role: "inner", category: "scroll" }],
1050
+ ["scrollMt", { role: "inner", category: "scroll" }],
1051
+ ["scrollMx", { role: "inner", category: "scroll" }],
1052
+ ["scrollMy", { role: "inner", category: "scroll" }],
1053
+ ["scrollP", { role: "inner", category: "scroll" }],
1054
+ ["scrollPb", { role: "inner", category: "scroll" }],
1055
+ ["scrollPbe", { role: "inner", category: "scroll" }],
1056
+ ["scrollPbs", { role: "inner", category: "scroll" }],
1057
+ ["scrollPe", { role: "inner", category: "scroll" }],
1058
+ ["scrollPl", { role: "inner", category: "scroll" }],
1059
+ ["scrollPr", { role: "inner", category: "scroll" }],
1060
+ ["scrollPs", { role: "inner", category: "scroll" }],
1061
+ ["scrollPt", { role: "inner", category: "scroll" }],
1062
+ ["scrollPx", { role: "inner", category: "scroll" }],
1063
+ ["scrollPy", { role: "inner", category: "scroll" }],
1064
+ ["select", { role: "inner", category: "interaction" }],
1065
+ ["self", { role: "inner", category: "alignment" }],
1066
+ ["sepia", { role: "outer", category: "filter" }],
1067
+ ["shadow", { role: "outer", category: "shadow" }],
1068
+ ["shadowColor", { role: "outer", category: "shadow" }],
1069
+ ["shrink", { role: "inner", category: "flex" }],
1070
+ ["size", { role: "outer", category: "sizing" }],
1071
+ ["skewX", { role: "outer", category: "transform" }],
1072
+ ["skewY", { role: "outer", category: "transform" }],
1073
+ ["slashedZero", { role: "inner", category: "text" }],
1074
+ ["snapAlign", { role: "inner", category: "snap" }],
1075
+ ["snapStop", { role: "inner", category: "snap" }],
1076
+ ["snapType", { role: "inner", category: "snap" }],
1077
+ ["spaceX", { role: "inner", category: "space" }],
1078
+ ["spaceXReverse", { role: "inner", category: "space" }],
1079
+ ["spaceY", { role: "inner", category: "space" }],
1080
+ ["spaceYReverse", { role: "inner", category: "space" }],
1081
+ ["srOnly", { role: "outer", category: "visibility" }],
1082
+ ["stackedFractions", { role: "inner", category: "text" }],
1083
+ ["start", { role: "outer", category: "position" }],
1084
+ ["stroke", { role: "inner", category: "svg" }],
1085
+ ["strokeWidth", { role: "inner", category: "svg" }],
1086
+ ["tableLayout", { role: "inner", category: "table" }],
1087
+ ["tabSize", { role: "inner", category: "text" }],
1088
+ ["tabularNums", { role: "inner", category: "text" }],
1089
+ ["text", { role: "inner", category: "text" }],
1090
+ ["textAlign", { role: "inner", category: "text" }],
1091
+ ["textOverflow", { role: "inner", category: "text" }],
1092
+ ["textShadow", { role: "inner", category: "text" }],
1093
+ ["textShadowColor", { role: "inner", category: "text" }],
1094
+ ["textTransform", { role: "inner", category: "text" }],
1095
+ ["textWrap", { role: "inner", category: "text" }],
1096
+ ["to", { role: "outer", category: "gradient" }],
1097
+ ["top", { role: "outer", category: "position" }],
1098
+ ["touch", { role: "inner", category: "touch" }],
1099
+ ["tracking", { role: "inner", category: "text" }],
1100
+ ["transform", { role: "outer", category: "transform" }],
1101
+ ["transformStyle", { role: "outer", category: "transform" }],
1102
+ ["transition", { role: "outer", category: "transition" }],
1103
+ ["transitionBehavior", { role: "outer", category: "transition" }],
1104
+ ["translate", { role: "outer", category: "transform" }],
1105
+ ["translateX", { role: "outer", category: "transform" }],
1106
+ ["translateY", { role: "outer", category: "transform" }],
1107
+ ["translateZ", { role: "outer", category: "transform" }],
1108
+ ["truncate", { role: "inner", category: "text" }],
1109
+ ["underlineOffset", { role: "inner", category: "text" }],
1110
+ ["via", { role: "outer", category: "gradient" }],
1111
+ ["visibility", { role: "outer", category: "visibility" }],
1112
+ ["w", { role: "outer", category: "sizing" }],
1113
+ ["weight", { role: "inner", category: "text" }],
1114
+ ["whitespace", { role: "inner", category: "text" }],
1115
+ ["willChange", { role: "inner", category: "interaction" }],
1116
+ ["wrap", { role: "inner", category: "text" }],
1117
+ ["z", { role: "outer", category: "position" }],
1118
+ ["zoom", { role: "outer", category: "transform" }]
1119
+ ]);
1120
+
1121
+ function stripVariant(token) {
1122
+ let depth = 0;
1123
+ for (let i = token.length - 1; i >= 0; i--) {
1124
+ const ch = token[i];
1125
+ if (ch === "]" || ch === ")") depth++;
1126
+ else if (ch === "[" || ch === "(") depth--;
1127
+ else if (ch === ":" && depth === 0) return token.slice(i + 1);
1128
+ }
1129
+ return token;
1130
+ }
1131
+ function normalizeBase(base) {
1132
+ let b = base;
1133
+ if (b.startsWith("!")) b = b.slice(1);
1134
+ if (b.endsWith("!")) b = b.slice(0, -1);
1135
+ if (b.startsWith("-")) b = b.slice(1);
1136
+ return b;
1137
+ }
1138
+ function inspect(token) {
1139
+ const base = normalizeBase(stripVariant(token));
1140
+ if (!base) return void 0;
1141
+ const exact = BOX_ROLE_TOKENS.get(base);
1142
+ if (exact) return { ...exact, base, value: base };
1143
+ for (const [prefix, entry] of BOX_ROLE_PREFIXES) {
1144
+ if (base === prefix) return { ...entry, base, value: "" };
1145
+ if (base.startsWith(`${prefix}-`)) {
1146
+ return { ...entry, base, value: base.slice(prefix.length + 1) };
1147
+ }
1148
+ }
1149
+ return void 0;
1150
+ }
1151
+ function classify(token) {
1152
+ const info = inspect(token);
1153
+ return info ? { role: info.role, category: info.category } : void 0;
1154
+ }
1155
+ function matches(info, selector) {
1156
+ if (!info) return false;
1157
+ if (typeof selector === "object") {
1158
+ return Object.entries(selector).every(
1159
+ ([category, value]) => info.category === category && info.value === value
1160
+ );
1161
+ }
1162
+ if (selector === "outer" || selector === "inner") {
1163
+ return info.role === selector;
1164
+ }
1165
+ if (selector === "content") return info.role === "inner";
1166
+ if (selector === info.category) return true;
1167
+ if (info.base === selector) return true;
1168
+ return info.base.startsWith(`${selector}-`);
1169
+ }
1170
+ function anyMatch(info, selectors) {
1171
+ return selectors.some((s) => matches(info, s));
1172
+ }
1173
+ function tokenize(className) {
1174
+ return className.split(/\s+/).filter(Boolean);
1175
+ }
1176
+ function splitBox(className, options = {}) {
1177
+ const forceInner = options.inner ?? [];
1178
+ const forceOuter = options.outer ?? [];
1179
+ const fallback = options.fallback ?? "outer";
1180
+ const outer = [];
1181
+ const inner = [];
1182
+ for (const token of tokenize(className)) {
1183
+ const info = inspect(token);
1184
+ let role;
1185
+ if (anyMatch(info, forceInner)) role = "inner";
1186
+ else if (anyMatch(info, forceOuter)) role = "outer";
1187
+ else role = info ? info.role : fallback;
1188
+ (role === "outer" ? outer : inner).push(token);
1189
+ }
1190
+ return { outer: outer.join(" "), inner: inner.join(" ") };
1191
+ }
1192
+ function has(classes, selector) {
1193
+ return tokenize(classes).some((t) => matches(inspect(t), selector));
1194
+ }
1195
+ function pick(classes, selector) {
1196
+ return tokenize(classes).filter((t) => matches(inspect(t), selector)).join(" ");
1197
+ }
1198
+ function omit(classes, selector) {
1199
+ return tokenize(classes).filter((t) => !matches(inspect(t), selector)).join(" ");
1200
+ }
1201
+ function classifySzKey(key) {
1202
+ return BOX_ROLE_BY_KEY.get(key);
1203
+ }
1204
+ function isPlainObject(value) {
1205
+ return typeof value === "object" && value !== null && !Array.isArray(value);
1206
+ }
1207
+ function matchesKey(key, entry, selector) {
1208
+ if (typeof selector === "object") {
1209
+ return !!entry && Object.keys(selector).every((category) => entry.category === category);
1210
+ }
1211
+ if (selector === "outer" || selector === "inner") return entry?.role === selector;
1212
+ if (selector === "content") return entry?.role === "inner";
1213
+ if (key === selector) return true;
1214
+ return !!entry && selector === entry.category;
1215
+ }
1216
+ function anyMatchKey(key, entry, selectors) {
1217
+ return selectors.some((s) => matchesKey(key, entry, s));
1218
+ }
1219
+ function mergeSzInto(target, source, depth) {
1220
+ if (depth >= browser.MAX_SZ_DEPTH) throw new browser.SzDepthError();
1221
+ for (const key of Object.keys(source)) {
1222
+ if (browser.isForbiddenSzKey(key)) continue;
1223
+ const sv = source[key];
1224
+ const tv = target[key];
1225
+ target[key] = isPlainObject(sv) && isPlainObject(tv) ? mergeSzInto({ ...tv }, sv, depth + 1) : sv;
1226
+ }
1227
+ return target;
1228
+ }
1229
+ function flattenSz(sz, depth) {
1230
+ if (depth >= browser.MAX_SZ_DEPTH) throw new browser.SzDepthError();
1231
+ if (!sz) return {};
1232
+ if (typeof sz === "string") {
1233
+ if (process.env.NODE_ENV !== "production" && sz.trim()) {
1234
+ throw new TypeError(
1235
+ `splitBoxSz partitions sz objects, not raw class strings \u2014 use splitBox() for ${JSON.stringify(sz)}.`
1236
+ );
1237
+ }
1238
+ return {};
1239
+ }
1240
+ if (Array.isArray(sz)) {
1241
+ const acc = {};
1242
+ for (const part of sz) mergeSzInto(acc, flattenSz(part, depth + 1), depth + 1);
1243
+ return acc;
1244
+ }
1245
+ return sz;
1246
+ }
1247
+ function partitionSz(obj, options, outer, inner, depth) {
1248
+ if (depth >= browser.MAX_SZ_DEPTH) throw new browser.SzDepthError();
1249
+ const forceInner = options.inner ?? [];
1250
+ const forceOuter = options.outer ?? [];
1251
+ const fallback = options.fallback ?? "outer";
1252
+ for (const key of Object.keys(obj)) {
1253
+ if (browser.isForbiddenSzKey(key)) continue;
1254
+ const value = obj[key];
1255
+ const entry = BOX_ROLE_BY_KEY.get(key);
1256
+ if (anyMatchKey(key, entry, forceInner)) {
1257
+ inner[key] = value;
1258
+ } else if (anyMatchKey(key, entry, forceOuter)) {
1259
+ outer[key] = value;
1260
+ } else if (entry) {
1261
+ (entry.role === "inner" ? inner : outer)[key] = value;
1262
+ } else if (isPlainObject(value)) {
1263
+ const subOuter = {};
1264
+ const subInner = {};
1265
+ partitionSz(value, options, subOuter, subInner, depth + 1);
1266
+ if (Object.keys(subOuter).length > 0) outer[key] = subOuter;
1267
+ if (Object.keys(subInner).length > 0) inner[key] = subInner;
1268
+ } else {
1269
+ (fallback === "inner" ? inner : outer)[key] = value;
1270
+ }
1271
+ }
1272
+ }
1273
+ function splitBoxSz(sz, options = {}) {
1274
+ const outer = {};
1275
+ const inner = {};
1276
+ partitionSz(flattenSz(sz, 0), options, outer, inner, 0);
1277
+ return { outer, inner };
1278
+ }
1279
+ function filterSz(obj, selector, keep, depth) {
1280
+ if (depth >= browser.MAX_SZ_DEPTH) throw new browser.SzDepthError();
1281
+ const result = {};
1282
+ for (const key of Object.keys(obj)) {
1283
+ if (browser.isForbiddenSzKey(key)) continue;
1284
+ const value = obj[key];
1285
+ const entry = BOX_ROLE_BY_KEY.get(key);
1286
+ if (entry || !isPlainObject(value)) {
1287
+ if (matchesKey(key, entry, selector) === keep) result[key] = value;
1288
+ } else {
1289
+ const sub = filterSz(value, selector, keep, depth + 1);
1290
+ if (Object.keys(sub).length > 0) result[key] = sub;
1291
+ }
1292
+ }
1293
+ return result;
1294
+ }
1295
+ function hasSz(sz, selector) {
1296
+ const scan = (obj, depth) => {
1297
+ if (depth >= browser.MAX_SZ_DEPTH) throw new browser.SzDepthError();
1298
+ for (const key of Object.keys(obj)) {
1299
+ if (browser.isForbiddenSzKey(key)) continue;
1300
+ const value = obj[key];
1301
+ const entry = BOX_ROLE_BY_KEY.get(key);
1302
+ if (matchesKey(key, entry, selector)) return true;
1303
+ if (!entry && isPlainObject(value) && scan(value, depth + 1)) return true;
1304
+ }
1305
+ return false;
1306
+ };
1307
+ return scan(flattenSz(sz, 0), 0);
1308
+ }
1309
+ function pickSz(sz, selector) {
1310
+ return filterSz(flattenSz(sz, 0), selector, true, 0);
1311
+ }
1312
+ function omitSz(sz, selector) {
1313
+ return filterSz(flattenSz(sz, 0), selector, false, 0);
1314
+ }
1315
+
1316
+ const warned = /* @__PURE__ */ new Set();
1317
+ const RAW_SZ_WARNING = '[csszyx] A raw `sz` object reached the runtime and was dropped before it could leak to the DOM as sz="[object Object]".\nThis means the file was not compiled \u2014 its `sz` produces no CSS. If it lives in a workspace package, add that package to `compilePackages`; otherwise check that the bundler is not skipping the file.';
1318
+ function warnRawSz() {
1319
+ if (warned.has(RAW_SZ_WARNING)) return;
1320
+ warned.add(RAW_SZ_WARNING);
1321
+ console.warn(RAW_SZ_WARNING);
1322
+ }
1323
+ function stripSzProps(props) {
1324
+ if (props == null || typeof props !== "object" || !("sz" in props)) {
1325
+ return props;
1326
+ }
1327
+ const { sz, ...rest } = props;
1328
+ if (process.env.NODE_ENV !== "production") {
1329
+ if (sz !== null && typeof sz === "object") {
1330
+ warnRawSz();
1331
+ }
1332
+ }
1333
+ return rest;
1334
+ }
1335
+
1336
+ function deepMerge(target, source, depth = 0) {
1337
+ if (depth >= browser.MAX_SZ_DEPTH) {
1338
+ throw new browser.SzDepthError();
1339
+ }
441
1340
  const result = { ...target };
442
1341
  for (const key of Object.keys(source)) {
1342
+ if (browser.isForbiddenSzKey(key)) {
1343
+ continue;
1344
+ }
443
1345
  const sv = source[key];
444
1346
  const tv = target[key];
445
1347
  if (sv !== null && sv !== void 0 && typeof sv === "object" && !Array.isArray(sv) && tv !== null && tv !== void 0 && typeof tv === "object" && !Array.isArray(tv)) {
446
- result[key] = deepMerge(tv, sv);
1348
+ result[key] = deepMerge(tv, sv, depth + 1);
447
1349
  } else {
448
1350
  result[key] = sv;
449
1351
  }
@@ -456,6 +1358,9 @@ function szv(config) {
456
1358
  const resolved = { ...config.defaultVariants };
457
1359
  if (selection) {
458
1360
  for (const key of Object.keys(selection)) {
1361
+ if (browser.isForbiddenSzKey(key)) {
1362
+ continue;
1363
+ }
459
1364
  const val = selection[key];
460
1365
  if (val !== null && val !== void 0) {
461
1366
  resolved[key] = val;
@@ -523,12 +1428,13 @@ exports.VERSION = VERSION;
523
1428
  exports._sz = _sz;
524
1429
  exports._sz2 = _sz2;
525
1430
  exports._sz3 = _sz3;
526
- exports._szIf = _szIf;
527
1431
  exports._szMerge = _szMerge;
528
- exports._szSwitch = _szSwitch;
529
1432
  exports.abortHydration = abortHydration;
530
1433
  exports.attemptCSRRecovery = attemptCSRRecovery;
1434
+ exports.classify = classify;
1435
+ exports.classifySzKey = classifySzKey;
531
1436
  exports.clearHydrationErrors = clearHydrationErrors;
1437
+ exports.computeMangleChecksumAsync = computeMangleChecksumAsync;
532
1438
  exports.disableCSRRecovery = disableCSRRecovery;
533
1439
  exports.enableCSRRecovery = enableCSRRecovery;
534
1440
  exports.endHydration = endHydration;
@@ -538,21 +1444,32 @@ exports.getRecoveryMode = getRecoveryMode;
538
1444
  exports.getRuntimeConfig = getRuntimeConfig;
539
1445
  exports.getSSRContext = getSSRContext;
540
1446
  exports.guardHydration = guardHydration;
1447
+ exports.has = has;
541
1448
  exports.hasRecoveryToken = hasRecoveryToken;
1449
+ exports.hasSz = hasSz;
542
1450
  exports.initRuntime = initRuntime;
543
1451
  exports.isCSRRecoveryAllowed = isCSRRecoveryAllowed;
544
1452
  exports.isHydrating = isHydrating;
545
1453
  exports.isHydrationAborted = isHydrationAborted;
546
1454
  exports.isRuntimeInitialized = isRuntimeInitialized;
547
1455
  exports.isSSREnvironment = isSSREnvironment;
1456
+ exports.isValidMangleMap = isValidMangleMap;
548
1457
  exports.isValidManifest = isValidManifest;
549
1458
  exports.loadMangleMapFromDOM = loadMangleMapFromDOM;
550
1459
  exports.loadManifestFromDOM = loadManifestFromDOM;
1460
+ exports.omit = omit;
1461
+ exports.omitSz = omitSz;
1462
+ exports.pick = pick;
1463
+ exports.pickSz = pickSz;
551
1464
  exports.resetRuntime = resetRuntime;
1465
+ exports.splitBox = splitBox;
1466
+ exports.splitBoxSz = splitBoxSz;
552
1467
  exports.startHydration = startHydration;
1468
+ exports.stripSzProps = stripSzProps;
553
1469
  exports.szv = szv;
554
1470
  exports.validateHydrationClass = validateHydrationClass;
555
1471
  exports.verifyAllTokens = verifyAllTokens;
556
1472
  exports.verifyMangleChecksum = verifyMangleChecksum;
1473
+ exports.verifyMangleChecksumAsync = verifyMangleChecksumAsync;
557
1474
  exports.verifyMangleMapIntegrity = verifyMangleMapIntegrity;
558
1475
  exports.verifyRecoveryToken = verifyRecoveryToken;