@bug-on/m3-expressive 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/CHANGELOG.md +110 -0
  2. package/README.md +110 -0
  3. package/dist/assets/fonts/GoogleSansFlex-VariableFont.woff2 +0 -0
  4. package/dist/assets/fonts/MaterialSymbolsOutlined-VariableFont_FILL,GRAD,opsz,wght.ttf +0 -0
  5. package/dist/assets/fonts/MaterialSymbolsRounded-VariableFont_FILL,GRAD,opsz,wght.ttf +0 -0
  6. package/dist/assets/fonts/MaterialSymbolsSharp-VariableFont_FILL,GRAD,opsz,wght.ttf +0 -0
  7. package/dist/assets/loading-indicator.svg +19 -0
  8. package/dist/assets/material-symbols-cdn.css +65 -0
  9. package/dist/assets/material-symbols-self-hosted.css +94 -0
  10. package/dist/buttons.d.mts +180 -0
  11. package/dist/buttons.d.ts +180 -0
  12. package/dist/buttons.js +4282 -0
  13. package/dist/buttons.js.map +1 -0
  14. package/dist/buttons.mjs +4227 -0
  15. package/dist/buttons.mjs.map +1 -0
  16. package/dist/core.d.mts +422 -0
  17. package/dist/core.d.ts +422 -0
  18. package/dist/core.js +2581 -0
  19. package/dist/core.js.map +1 -0
  20. package/dist/core.mjs +2547 -0
  21. package/dist/core.mjs.map +1 -0
  22. package/dist/feedback.d.mts +600 -0
  23. package/dist/feedback.d.ts +600 -0
  24. package/dist/feedback.js +2357 -0
  25. package/dist/feedback.js.map +1 -0
  26. package/dist/feedback.mjs +2321 -0
  27. package/dist/feedback.mjs.map +1 -0
  28. package/dist/forms.d.mts +40 -0
  29. package/dist/forms.d.ts +40 -0
  30. package/dist/forms.js +4263 -0
  31. package/dist/forms.js.map +1 -0
  32. package/dist/forms.mjs +4228 -0
  33. package/dist/forms.mjs.map +1 -0
  34. package/dist/icon-button-D-gs0gfj.d.mts +136 -0
  35. package/dist/icon-button-D-gs0gfj.d.ts +136 -0
  36. package/dist/index.css +309 -0
  37. package/dist/index.css.d.ts +2 -0
  38. package/dist/index.d.mts +24 -0
  39. package/dist/index.d.ts +24 -0
  40. package/dist/index.js +23972 -0
  41. package/dist/index.js.map +1 -0
  42. package/dist/index.mjs +23668 -0
  43. package/dist/index.mjs.map +1 -0
  44. package/dist/layout.d.mts +610 -0
  45. package/dist/layout.d.ts +610 -0
  46. package/dist/layout.js +5091 -0
  47. package/dist/layout.js.map +1 -0
  48. package/dist/layout.mjs +5042 -0
  49. package/dist/layout.mjs.map +1 -0
  50. package/dist/material-symbols-cdn.css +65 -0
  51. package/dist/material-symbols-cdn.css.d.ts +2 -0
  52. package/dist/material-symbols-self-hosted.css +94 -0
  53. package/dist/material-symbols-self-hosted.css.d.ts +2 -0
  54. package/dist/md3-DFhj-NZj.d.mts +17 -0
  55. package/dist/md3-DFhj-NZj.d.ts +17 -0
  56. package/dist/navigation.d.mts +2766 -0
  57. package/dist/navigation.d.ts +2766 -0
  58. package/dist/navigation.js +6684 -0
  59. package/dist/navigation.js.map +1 -0
  60. package/dist/navigation.mjs +6573 -0
  61. package/dist/navigation.mjs.map +1 -0
  62. package/dist/overlays.d.mts +161 -0
  63. package/dist/overlays.d.ts +161 -0
  64. package/dist/overlays.js +3298 -0
  65. package/dist/overlays.js.map +1 -0
  66. package/dist/overlays.mjs +3244 -0
  67. package/dist/overlays.mjs.map +1 -0
  68. package/dist/pickers.d.mts +1074 -0
  69. package/dist/pickers.d.ts +1074 -0
  70. package/dist/pickers.js +4240 -0
  71. package/dist/pickers.js.map +1 -0
  72. package/dist/pickers.mjs +4200 -0
  73. package/dist/pickers.mjs.map +1 -0
  74. package/dist/plugin.d.mts +1 -0
  75. package/dist/plugin.d.ts +1 -0
  76. package/dist/plugin.js +13 -0
  77. package/dist/plugin.js.map +1 -0
  78. package/dist/plugin.mjs +3 -0
  79. package/dist/plugin.mjs.map +1 -0
  80. package/dist/scroll-area-CVS6HyLl.d.mts +33 -0
  81. package/dist/scroll-area-CVS6HyLl.d.ts +33 -0
  82. package/dist/shapes.d.mts +1119 -0
  83. package/dist/shapes.d.ts +1119 -0
  84. package/dist/shapes.js +2941 -0
  85. package/dist/shapes.js.map +1 -0
  86. package/dist/shapes.mjs +2889 -0
  87. package/dist/shapes.mjs.map +1 -0
  88. package/dist/side-sheet-modal-BY6VCC8p.d.mts +553 -0
  89. package/dist/side-sheet-modal-CglP6KYA.d.ts +553 -0
  90. package/dist/split-button-trailing-uncheckable-C5CLCIKP.d.ts +731 -0
  91. package/dist/split-button-trailing-uncheckable-MXj_kyNt.d.mts +731 -0
  92. package/dist/text-field-eAIpz9z1.d.mts +1038 -0
  93. package/dist/text-field-eAIpz9z1.d.ts +1038 -0
  94. package/dist/typography-339RV6v7.d.mts +486 -0
  95. package/dist/typography-339RV6v7.d.ts +486 -0
  96. package/dist/typography.css +22 -0
  97. package/dist/typography.css.d.ts +2 -0
  98. package/package.json +207 -0
package/dist/core.mjs ADDED
@@ -0,0 +1,2547 @@
1
+ "use client";
2
+ import * as React11 from 'react';
3
+ import { createContext, useState, useEffect, useRef, useCallback, useMemo, useContext } from 'react';
4
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
+ import { argbFromHex, themeFromSourceColor, hexFromArgb } from '@material/material-color-utilities';
6
+ import { clsx } from 'clsx';
7
+ import { twMerge } from 'tailwind-merge';
8
+ import { LazyMotion, domMax, m, useMotionValue, animate, useAnimationFrame, AnimatePresence, useReducedMotion } from 'motion/react';
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __defProps = Object.defineProperties;
12
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
13
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
14
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
15
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
16
+ var __typeError = (msg) => {
17
+ throw TypeError(msg);
18
+ };
19
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
20
+ var __spreadValues = (a, b) => {
21
+ for (var prop in b || (b = {}))
22
+ if (__hasOwnProp.call(b, prop))
23
+ __defNormalProp(a, prop, b[prop]);
24
+ if (__getOwnPropSymbols)
25
+ for (var prop of __getOwnPropSymbols(b)) {
26
+ if (__propIsEnum.call(b, prop))
27
+ __defNormalProp(a, prop, b[prop]);
28
+ }
29
+ return a;
30
+ };
31
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
32
+ var __objRest = (source, exclude) => {
33
+ var target = {};
34
+ for (var prop in source)
35
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
36
+ target[prop] = source[prop];
37
+ if (source != null && __getOwnPropSymbols)
38
+ for (var prop of __getOwnPropSymbols(source)) {
39
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
40
+ target[prop] = source[prop];
41
+ }
42
+ return target;
43
+ };
44
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
45
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
46
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
47
+ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
48
+ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
49
+ function useMediaQuery(query) {
50
+ const [matches, setMatches] = useState(false);
51
+ useEffect(() => {
52
+ const mql = window.matchMedia(query);
53
+ const handler = (e) => setMatches(e.matches);
54
+ setMatches(mql.matches);
55
+ mql.addEventListener("change", handler);
56
+ return () => mql.removeEventListener("change", handler);
57
+ }, [query]);
58
+ return matches;
59
+ }
60
+ function useRipple(options = {}) {
61
+ const {
62
+ duration = 600,
63
+ color = "currentColor",
64
+ opacity = 0.12,
65
+ disabled = false
66
+ } = options;
67
+ const ref = useRef(null);
68
+ const onPointerDown = useCallback(
69
+ (event) => {
70
+ if (disabled || !ref.current) return;
71
+ const el = ref.current;
72
+ const rect = el.getBoundingClientRect();
73
+ const size = Math.max(rect.width, rect.height) * 2;
74
+ const x = event.clientX - rect.left - size / 2;
75
+ const y = event.clientY - rect.top - size / 2;
76
+ const ripple = document.createElement("span");
77
+ ripple.setAttribute("aria-hidden", "true");
78
+ Object.assign(ripple.style, {
79
+ position: "absolute",
80
+ borderRadius: "50%",
81
+ pointerEvents: "none",
82
+ width: `${size}px`,
83
+ height: `${size}px`,
84
+ left: `${x}px`,
85
+ top: `${y}px`,
86
+ background: color,
87
+ opacity: String(opacity),
88
+ transform: "scale(0)",
89
+ transition: `transform ${duration}ms cubic-bezier(0.2, 0, 0, 1), opacity ${duration * 0.6}ms ease-out`
90
+ });
91
+ el.appendChild(ripple);
92
+ requestAnimationFrame(() => {
93
+ ripple.style.transform = "scale(1)";
94
+ });
95
+ const cleanup = () => {
96
+ ripple.style.opacity = "0";
97
+ setTimeout(() => {
98
+ if (el.contains(ripple)) el.removeChild(ripple);
99
+ }, duration * 0.6);
100
+ el.removeEventListener("pointerup", cleanup);
101
+ el.removeEventListener("pointerleave", cleanup);
102
+ };
103
+ el.addEventListener("pointerup", cleanup, { once: true });
104
+ el.addEventListener("pointerleave", cleanup, { once: true });
105
+ },
106
+ [disabled, duration, color, opacity]
107
+ );
108
+ return { rippleRef: ref, onPointerDown };
109
+ }
110
+ function MaterialSymbolsPreconnect({
111
+ variants = ["outlined"]
112
+ }) {
113
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
114
+ /* @__PURE__ */ jsx("link", { rel: "preconnect", href: "https://fonts.googleapis.com" }),
115
+ /* @__PURE__ */ jsx(
116
+ "link",
117
+ {
118
+ rel: "preconnect",
119
+ href: "https://fonts.gstatic.com",
120
+ crossOrigin: "anonymous"
121
+ }
122
+ ),
123
+ variants.includes("outlined") && /* @__PURE__ */ jsx(
124
+ "link",
125
+ {
126
+ href: "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap",
127
+ rel: "stylesheet",
128
+ precedence: "default"
129
+ }
130
+ ),
131
+ variants.includes("rounded") && /* @__PURE__ */ jsx(
132
+ "link",
133
+ {
134
+ href: "https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap",
135
+ rel: "stylesheet",
136
+ precedence: "default"
137
+ }
138
+ ),
139
+ variants.includes("sharp") && /* @__PURE__ */ jsx(
140
+ "link",
141
+ {
142
+ href: "https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap",
143
+ rel: "stylesheet",
144
+ precedence: "default"
145
+ }
146
+ )
147
+ ] });
148
+ }
149
+ function resolveMode(mode) {
150
+ if (mode !== "system") return mode;
151
+ if (typeof window === "undefined") return "light";
152
+ return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
153
+ }
154
+ function generateM3Theme(sourceColorHex, mode = "light") {
155
+ const sourceColor = argbFromHex(sourceColorHex);
156
+ const theme = themeFromSourceColor(sourceColor);
157
+ const scheme = mode === "light" ? theme.schemes.light : theme.schemes.dark;
158
+ const palettes = theme.palettes;
159
+ const tone = (palette, t) => hexFromArgb(palette.tone(t));
160
+ return {
161
+ primary: hexFromArgb(scheme.primary),
162
+ onPrimary: hexFromArgb(scheme.onPrimary),
163
+ primaryContainer: hexFromArgb(scheme.primaryContainer),
164
+ onPrimaryContainer: hexFromArgb(scheme.onPrimaryContainer),
165
+ inversePrimary: hexFromArgb(scheme.inversePrimary),
166
+ primaryFixed: tone(palettes.primary, 90),
167
+ primaryFixedDim: tone(palettes.primary, 80),
168
+ onPrimaryFixed: tone(palettes.primary, 10),
169
+ onPrimaryFixedVariant: tone(palettes.primary, 30),
170
+ secondary: hexFromArgb(scheme.secondary),
171
+ onSecondary: hexFromArgb(scheme.onSecondary),
172
+ secondaryContainer: hexFromArgb(scheme.secondaryContainer),
173
+ onSecondaryContainer: hexFromArgb(scheme.onSecondaryContainer),
174
+ secondaryFixed: tone(palettes.secondary, 90),
175
+ secondaryFixedDim: tone(palettes.secondary, 80),
176
+ onSecondaryFixed: tone(palettes.secondary, 10),
177
+ onSecondaryFixedVariant: tone(palettes.secondary, 30),
178
+ tertiary: hexFromArgb(scheme.tertiary),
179
+ onTertiary: hexFromArgb(scheme.onTertiary),
180
+ tertiaryContainer: hexFromArgb(scheme.tertiaryContainer),
181
+ onTertiaryContainer: hexFromArgb(scheme.onTertiaryContainer),
182
+ tertiaryFixed: tone(palettes.tertiary, 90),
183
+ tertiaryFixedDim: tone(palettes.tertiary, 80),
184
+ onTertiaryFixed: tone(palettes.tertiary, 10),
185
+ onTertiaryFixedVariant: tone(palettes.tertiary, 30),
186
+ error: hexFromArgb(scheme.error),
187
+ onError: hexFromArgb(scheme.onError),
188
+ errorContainer: hexFromArgb(scheme.errorContainer),
189
+ onErrorContainer: hexFromArgb(scheme.onErrorContainer),
190
+ surface: hexFromArgb(scheme.surface),
191
+ onSurface: hexFromArgb(scheme.onSurface),
192
+ surfaceVariant: hexFromArgb(scheme.surfaceVariant),
193
+ onSurfaceVariant: hexFromArgb(scheme.onSurfaceVariant),
194
+ surfaceTint: hexFromArgb(scheme.primary),
195
+ // Surface container roles from neutral palette tones
196
+ surfaceContainerLowest: mode === "light" ? tone(palettes.neutral, 100) : tone(palettes.neutral, 4),
197
+ surfaceContainerLow: mode === "light" ? tone(palettes.neutral, 96) : tone(palettes.neutral, 10),
198
+ surfaceContainer: mode === "light" ? tone(palettes.neutral, 94) : tone(palettes.neutral, 12),
199
+ surfaceContainerHigh: mode === "light" ? tone(palettes.neutral, 92) : tone(palettes.neutral, 17),
200
+ surfaceContainerHighest: mode === "light" ? tone(palettes.neutral, 90) : tone(palettes.neutral, 22),
201
+ inverseSurface: hexFromArgb(scheme.inverseSurface),
202
+ inverseOnSurface: hexFromArgb(scheme.inverseOnSurface),
203
+ background: hexFromArgb(scheme.background),
204
+ onBackground: hexFromArgb(scheme.onBackground),
205
+ outline: hexFromArgb(scheme.outline),
206
+ outlineVariant: hexFromArgb(scheme.outlineVariant),
207
+ shadow: hexFromArgb(scheme.shadow),
208
+ scrim: hexFromArgb(scheme.scrim)
209
+ };
210
+ }
211
+ function applyTheme(sourceColorHex, mode = "light", root = document.documentElement) {
212
+ const resolved = resolveMode(mode);
213
+ const colors = generateM3Theme(sourceColorHex, resolved);
214
+ for (const [key, value] of Object.entries(colors)) {
215
+ const kebabKey = key.replace(/[A-Z]/g, (m7) => `-${m7.toLowerCase()}`);
216
+ root.style.setProperty(`--md-sys-color-${kebabKey}`, value);
217
+ root.style.setProperty(`--color-m3-${kebabKey}`, value);
218
+ }
219
+ root.setAttribute("data-theme", resolved);
220
+ }
221
+ function cn(...inputs) {
222
+ return twMerge(clsx(inputs));
223
+ }
224
+
225
+ // src/ui/shared/motion-tokens.ts
226
+ var DEFAULT_SPATIAL_SPRING = {
227
+ type: "spring",
228
+ stiffness: 380,
229
+ damping: 31.19
230
+ };
231
+ var FAST_EFFECTS_SPRING = {
232
+ type: "spring",
233
+ stiffness: 3800,
234
+ damping: 123.29
235
+ };
236
+ var DEFAULT_EFFECTS_SPRING = {
237
+ type: "spring",
238
+ stiffness: 1600,
239
+ damping: 80
240
+ };
241
+
242
+ // src/ui/shared/constants.ts
243
+ var SPRING_TRANSITION_FAST = FAST_EFFECTS_SPRING;
244
+ var SPRING_TRANSITION = DEFAULT_EFFECTS_SPRING;
245
+ var ICON_SPAN_VARIANTS = {
246
+ initial: { scale: 0.01 },
247
+ animate: { scale: 1 },
248
+ exit: { scale: 0.01 }
249
+ };
250
+ var VARIANT_FONT = {
251
+ outlined: "'Material Symbols Outlined'",
252
+ rounded: "'Material Symbols Rounded'",
253
+ sharp: "'Material Symbols Sharp'"
254
+ };
255
+ var IconComponent = React11.forwardRef(
256
+ (_a, ref) => {
257
+ var _b = _a, {
258
+ name,
259
+ variant = "outlined",
260
+ fill = 0,
261
+ weight = 400,
262
+ grade = 0,
263
+ opticalSize = 24,
264
+ size,
265
+ animateFill = false,
266
+ className,
267
+ style
268
+ } = _b, restProps = __objRest(_b, [
269
+ "name",
270
+ "variant",
271
+ "fill",
272
+ "weight",
273
+ "grade",
274
+ "opticalSize",
275
+ "size",
276
+ "animateFill",
277
+ "className",
278
+ "style"
279
+ ]);
280
+ const fontVariationSettings = `'FILL' ${fill}, 'wght' ${weight}, 'GRAD' ${grade}, 'opsz' ${opticalSize}`;
281
+ const computedStyle = __spreadValues({
282
+ fontFamily: VARIANT_FONT[variant],
283
+ fontSize: size === "inherit" ? "inherit" : size != null ? `${size}px` : `${opticalSize}px`,
284
+ fontVariationSettings
285
+ }, style);
286
+ if (animateFill) {
287
+ return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(
288
+ m.span,
289
+ __spreadProps(__spreadValues({
290
+ ref,
291
+ className: cn(
292
+ "md-icon inline-flex items-center justify-center shrink-0 select-none",
293
+ className
294
+ ),
295
+ "aria-hidden": "true",
296
+ animate: { fontVariationSettings },
297
+ transition: SPRING_TRANSITION_FAST,
298
+ style: computedStyle
299
+ }, restProps), {
300
+ children: name
301
+ })
302
+ ) });
303
+ }
304
+ return /* @__PURE__ */ jsx(
305
+ "span",
306
+ __spreadProps(__spreadValues({
307
+ ref,
308
+ className: cn(
309
+ "md-icon inline-flex items-center justify-center shrink-0 select-none",
310
+ className
311
+ ),
312
+ "aria-hidden": "true",
313
+ style: computedStyle
314
+ }, restProps), {
315
+ children: name
316
+ })
317
+ );
318
+ }
319
+ );
320
+ IconComponent.displayName = "Icon";
321
+ var Icon = React11.memo(IconComponent);
322
+ var RippleItem = React11.memo(function RippleItem2({
323
+ ripple,
324
+ onDone
325
+ }) {
326
+ return /* @__PURE__ */ jsx(
327
+ m.span,
328
+ {
329
+ "aria-hidden": "true",
330
+ style: {
331
+ position: "absolute",
332
+ left: ripple.x - ripple.size / 2,
333
+ top: ripple.y - ripple.size / 2,
334
+ width: ripple.size,
335
+ height: ripple.size,
336
+ borderRadius: "50%",
337
+ backgroundColor: "currentColor",
338
+ pointerEvents: "none",
339
+ transformOrigin: "center"
340
+ },
341
+ initial: { scale: 0, opacity: 0.12 },
342
+ animate: { scale: 1, opacity: 0 },
343
+ exit: { opacity: 0 },
344
+ transition: {
345
+ scale: { duration: 0.5, ease: [0.2, 0, 0, 1] },
346
+ opacity: { duration: 0.4, ease: "easeOut", delay: 0.1 }
347
+ },
348
+ onAnimationComplete: () => onDone(ripple.id)
349
+ },
350
+ ripple.id
351
+ );
352
+ });
353
+ function Ripple({
354
+ ripples,
355
+ onRippleDone,
356
+ disabled = false,
357
+ respectSystemMotion = true
358
+ }) {
359
+ const prefersReduced = useReducedMotion();
360
+ if (disabled) return null;
361
+ if (respectSystemMotion && prefersReduced) return null;
362
+ return /* @__PURE__ */ jsx(AnimatePresence, { children: ripples.map((r) => /* @__PURE__ */ jsx(RippleItem, { ripple: r, onDone: onRippleDone }, r.id)) });
363
+ }
364
+ function useRippleState(options = {}) {
365
+ const { disabled = false } = options;
366
+ const [ripples, setRipples] = React11.useState([]);
367
+ const onPointerDown = React11.useCallback(
368
+ (e) => {
369
+ if (disabled) return;
370
+ const rect = e.currentTarget.getBoundingClientRect();
371
+ const x = e.clientX - rect.left;
372
+ const y = e.clientY - rect.top;
373
+ const rippleSize = Math.hypot(rect.width, rect.height) * 2;
374
+ setRipples((prev) => [
375
+ ...prev,
376
+ { id: Date.now(), x, y, size: rippleSize }
377
+ ]);
378
+ },
379
+ [disabled]
380
+ );
381
+ const removeRipple = React11.useCallback((id) => {
382
+ setRipples((prev) => prev.filter((r) => r.id !== id));
383
+ }, []);
384
+ return { ripples, onPointerDown, removeRipple };
385
+ }
386
+ var useRipple2 = useRippleState;
387
+ var SHAPE_KEY_TIMES = "0; 0.14; 0.14; 0.29; 0.29; 0.43; 0.43; 0.57; 0.57; 0.71; 0.71; 0.86; 0.86; 1";
388
+ var SHAPE_KEY_SPLINES = [
389
+ "0.5 0.2 0 0.8",
390
+ "0.5 0.2 0 0.8",
391
+ "0.5 0.2 0 0.8",
392
+ "0.5 0.2 0 0.8",
393
+ "0.5 0.2 0 0.8",
394
+ "0.5 0.2 0 0.8",
395
+ "0.5 0.2 0 0.8",
396
+ "0.5 0.2 0 0.8",
397
+ "0.5 0.2 0 0.8",
398
+ "0.5 0.2 0 0.8",
399
+ "0.5 0.2 0 0.8",
400
+ "0.5 0.2 0 0.8",
401
+ "0.5 0.2 0 0.8"
402
+ ].join("; ");
403
+ var SHAPE_VALUES = [
404
+ "M20.9 10.4 21.4 9.5 21.9 8.7 22.5 7.8 23.2 7.2 24.2 7 25.1 7.4 25.7 8.1 26.2 9 26.8 9.8 27.3 10.6 28.1 11.2 29 11.3 30 11 30.9 10.6 31.8 10.3 32.8 9.9 33.7 10 34.5 10.6 34.9 11.5 34.8 12.5 34.8 13.5 34.7 14.5 34.7 15.5 35.2 16.3 36 16.8 37 17.1 37.9 17.3 38.9 17.5 39.8 17.9 40.4 18.7 40.5 19.7 40 20.5 39.4 21.3 38.7 22 38.1 22.8 37.6 23.7 37.7 24.6 38.3 25.5 38.9 26.2 39.6 27 40.2 27.7 40.5 28.7 40.3 29.6 39.5 30.3 38.6 30.6 37.6 30.8 36.7 31 35.7 31.3 35 31.9 34.6 32.8 34.7 33.8 34.8 34.8 34.9 35.8 34.8 36.8 34.3 37.6 33.4 38.1 32.4 38 31.5 37.6 30.6 37.2 29.7 36.9 28.7 36.6 27.8 36.9 27.1 37.6 26.6 38.5 26.1 39.3 25.5 40.2 24.8 40.8 23.8 41 22.9 40.6 22.3 39.9 21.8 39 21.2 38.2 20.7 37.4 19.9 36.8 19 36.7 18 37 17.1 37.4 16.2 37.7 15.2 38.1 14.3 38 13.5 37.4 13.1 36.5 13.2 35.5 13.2 34.5 13.3 33.5 13.3 32.5 12.8 31.7 12 31.2 11 31 10.1 30.7 9.1 30.5 8.2 30.1 7.6 29.3 7.5 28.3 8 27.5 8.7 26.7 9.3 26 9.9 25.2 10.4 24.3 10.3 23.4 9.7 22.5 9.1 21.8 8.4 21 7.8 20.3 7.5 19.3 7.7 18.4 8.5 17.7 9.4 17.4 10.4 17.2 11.3 17 12.3 16.7 13 16.1 13.4 15.2 13.3 14.2 13.2 13.2 13.1 12.2 13.2 11.2 13.7 10.4 14.6 9.9 15.6 10 16.5 10.4 17.4 10.8 18.3 11.1 19.3 11.4 20.2 11.1Z",
405
+ "M20.3 8.6 21.1 8 22 7.6 23 7.3 23 7.3 24 7.2 25 7.3 25.9 7.5 26.8 8 27.6 8.6 28.4 9.1 28.4 9.1 29.3 9.6 30.3 9.8 31.3 9.9 32.3 10 33.3 10.2 34.2 10.6 34.2 10.6 35 11.2 35.7 11.9 36.3 12.7 36.7 13.6 36.9 14.6 37.2 15.5 37.2 15.5 37.6 16.5 38.2 17.3 38.9 18 39.6 18.7 40.2 19.5 40.6 20.4 40.6 20.4 40.9 21.3 41 22.3 40.9 23.3 40.6 24.3 40.2 25.2 39.8 26.1 39.8 26.1 39.5 27 39.4 28 39.5 29 39.6 30 39.5 31 39.3 32 39.3 32 38.9 32.9 38.3 33.7 37.6 34.4 36.8 35 35.9 35.4 35 35.8 35 35.8 34.1 36.3 33.4 37 32.9 37.9 32.3 38.7 31.6 39.4 30.8 40 30.8 40 29.9 40.4 28.9 40.7 27.9 40.8 27 40.7 26 40.4 25 40.1 25 40.1 24 40 23 40.1 22.1 40.4 21.1 40.7 20.1 40.8 19.1 40.7 19.1 40.7 18.2 40.5 17.3 40 16.4 39.5 15.7 38.8 15.2 37.9 14.6 37.1 14.6 37.1 13.9 36.4 13.1 35.8 12.2 35.4 11.3 35 10.5 34.4 9.7 33.8 9.7 33.8 9.1 32.9 8.7 32 8.5 31.1 8.4 30.1 8.5 29.1 8.6 28.1 8.6 28.1 8.5 27.1 8.3 26.1 7.8 25.2 7.4 24.3 7.1 23.4 7 22.4 7 22.4 7.1 21.4 7.3 20.4 7.8 19.5 8.3 18.7 9.1 18 9.8 17.3 9.8 17.3 10.4 16.5 10.8 15.6 11 14.6 11.3 13.7 11.7 12.8 12.2 11.9 12.2 11.9 12.9 11.2 13.8 10.7 14.7 10.2 15.6 10 16.6 9.9 17.6 9.8 17.6 9.8 18.6 9.6 19.5 9.2Z",
406
+ "M18.6 9.6 19.5 9.2 20.3 8.6 21.1 8 22 7.6 23 7.3 24 7.2 25 7.3 25.9 7.5 26.8 8 27.6 8.6 28.4 9.1 29.3 9.6 30.3 9.8 31.3 9.9 32.3 10 33.3 10.2 34.2 10.6 35 11.2 35.7 11.9 36.3 12.7 36.7 13.6 36.9 14.6 37.2 15.5 37.6 16.4 38.2 17.3 38.9 18 39.6 18.7 40.2 19.5 40.6 20.4 40.9 21.3 41 22.3 40.9 23.3 40.6 24.3 40.2 25.2 39.8 26.1 39.5 27 39.4 28 39.5 29 39.6 30 39.5 31 39.3 32 38.9 32.9 38.3 33.7 37.6 34.4 36.8 35 35.9 35.4 35 35.8 34.1 36.3 33.4 37 32.9 37.9 32.3 38.7 31.6 39.4 30.8 40 29.9 40.4 28.9 40.7 27.9 40.8 27 40.7 26 40.4 25 40.1 24 40 23 40.1 22.1 40.4 21.1 40.7 20.1 40.8 19.1 40.7 18.2 40.5 17.3 40 16.4 39.5 15.7 38.8 15.2 37.9 14.6 37.1 13.9 36.4 13.1 35.8 12.2 35.4 11.3 35 10.5 34.4 9.7 33.8 9.1 32.9 8.7 32 8.5 31.1 8.4 30.1 8.5 29.1 8.6 28.1 8.5 27.1 8.3 26.1 7.8 25.2 7.4 24.3 7.1 23.4 7 22.4 7.1 21.4 7.3 20.4 7.8 19.5 8.3 18.7 9.1 18 9.8 17.3 10.4 16.5 10.8 15.6 11 14.6 11.3 13.7 11.7 12.8 12.2 11.9 12.9 11.2 13.8 10.7 14.7 10.2 15.6 10 16.6 9.9 17.6 9.8Z",
407
+ "M18.6 9.9 19.5 9.4 20.3 8.8 21.1 8.2 22 7.8 23 7.6 23.9 7.5 24.9 7.6 25.9 7.8 26.8 8.2 27.6 8.7 28.5 9.3 29.3 9.9 30.1 10.5 30.9 11 31.7 11.6 32.5 12.2 33.3 12.8 33.7 13.1 34.1 13.3 34.9 13.9 35.7 14.5 36.6 15 37.4 15.6 38.2 16.2 39 16.8 39.7 17.5 40.2 18.3 40.7 19.2 40.9 20.1 41 21.1 40.9 22.1 40.7 23.1 40.3 24 40 24.9 39.7 25.9 39.4 26.8 39 27.8 38.7 28.7 38.4 29.6 38.1 30.6 37.8 31.5 37.5 32.5 37.2 33.4 36.9 34.4 36.6 35.3 36.2 36.2 35.7 37.1 35 37.8 34.3 38.4 33.4 38.9 32.5 39.3 31.5 39.5 30.5 39.5 30 39.5 29.5 39.5 28.5 39.5 27.5 39.5 26.5 39.5 25.5 39.4 24.5 39.4 23.6 39.4 22.6 39.4 21.6 39.5 20.6 39.5 19.6 39.5 18.6 39.5 17.6 39.5 16.6 39.5 15.6 39.3 14.7 39 13.8 38.5 13.1 37.9 12.4 37.2 11.9 36.3 11.5 35.4 11.2 34.5 10.9 33.5 10.6 32.6 10.3 31.6 10 30.7 9.7 29.7 9.3 28.8 9 27.9 8.7 26.9 8.4 26 8 25 7.7 24.1 7.4 23.2 7.1 22.2 7.1 21.7 7 21.2 7.1 20.2 7.3 19.3 7.7 18.4 8.3 17.5 8.9 16.8 9.7 16.2 10.5 15.6 11.4 15.1 12.2 14.5 13 14 13.8 13.4 14.6 12.8 15.4 12.3 16.2 11.7 17 11.1 17.8 10.5Z",
408
+ "M15.4 12.3 16.2 11.7 17 11.1 17.8 10.5 18.6 9.9 19.5 9.4 20.3 8.8 21.1 8.3 22 7.8 23 7.6 23.9 7.5 24.9 7.6 25.9 7.8 26.8 8.2 27.6 8.7 28.5 9.3 29.3 9.9 30.1 10.5 30.9 11 31.7 11.6 32.5 12.2 33.3 12.8 34.1 13.3 34.9 13.9 35.7 14.5 36.6 15 37.4 15.6 38.2 16.2 39 16.8 39.7 17.5 40.2 18.3 40.7 19.2 40.9 20.1 41 21.1 40.9 22.1 40.7 23.1 40.3 24 40 24.9 39.7 25.9 39.4 26.8 39 27.8 38.7 28.7 38.4 29.6 38.1 30.6 37.8 31.5 37.5 32.5 37.2 33.4 36.9 34.4 36.6 35.3 36.2 36.2 35.7 37.1 35 37.8 34.3 38.4 33.4 38.9 32.5 39.3 31.5 39.4 30.5 39.5 29.5 39.5 28.5 39.5 27.5 39.5 26.5 39.5 25.5 39.4 24.5 39.4 23.6 39.4 22.6 39.4 21.6 39.5 20.6 39.5 19.6 39.5 18.6 39.5 17.6 39.5 16.6 39.5 15.6 39.3 14.7 39 13.8 38.5 13.1 37.9 12.4 37.2 11.9 36.3 11.5 35.4 11.2 34.5 10.9 33.5 10.6 32.6 10.3 31.6 10 30.7 9.7 29.7 9.3 28.8 9 27.9 8.7 26.9 8.4 26 8 25 7.7 24.1 7.4 23.2 7.1 22.2 7 21.2 7.1 20.2 7.3 19.3 7.7 18.4 8.3 17.5 8.9 16.8 9.7 16.2 10.5 15.6 11.4 15.1 12.2 14.5 13 14 13.8 13.4 14.6 12.8Z",
409
+ "M17 12.8 17.7 12.1 18.5 11.5 19.3 10.9 20.1 10.5 20.2 10.4 21.1 10 22 9.7 23 9.4 24 9.2 25 9 26 9 27 9 27.6 9.1 28 9.1 28.9 9.3 29.9 9.6 30.9 9.9 31.8 10.3 32.6 10.8 33.5 11.3 34.3 11.9 34.6 12.2 35 12.6 35.7 13.3 36.4 14.1 36.9 14.9 37.4 15.8 37.9 16.6 38.3 17.6 38.6 18.5 38.6 18.7 38.8 19.5 38.9 20.5 39 21.5 39 22.5 38.9 23.5 38.7 24.5 38.5 25.4 38.2 26.3 38.2 26.4 37.8 27.3 37.4 28.2 36.8 29.1 36.2 29.9 35.6 30.6 34.9 31.3 34.2 32 33.8 32.5 33.5 32.8 32.8 33.5 32.1 34.2 31.4 34.9 30.7 35.6 29.9 36.2 29.1 36.8 28.2 37.3 27.9 37.5 27.4 37.8 26.4 38.2 25.5 38.5 24.5 38.7 23.5 38.9 22.5 39 21.5 39 20.5 38.9 20.4 38.9 19.5 38.8 18.6 38.6 17.6 38.3 16.7 37.9 15.8 37.5 14.9 37 14.1 36.4 13.4 35.8 13.3 35.8 12.6 35.1 12 34.3 11.3 33.5 10.8 32.7 10.3 31.8 9.9 30.9 9.6 30 9.4 29.3 9.3 29 9.1 28 9 27 9 26 9 25 9.2 24 9.4 23 9.6 22.1 9.8 21.7 10 21.1 10.4 20.2 10.9 19.4 11.4 18.5 12.1 17.8 12.7 17 13.4 16.3 14.2 15.6 14.2 15.5 14.9 14.9 15.6 14.2 16.3 13.5Z",
410
+ "M33.5 11.3 34.3 11.9 35 12.6 35.3 12.8 35.7 13.3 36.4 14.1 36.9 14.9 37.4 15.8 37.9 16.6 38.3 17.6 38.3 17.7 38.6 18.5 38.8 19.5 38.9 20.5 39 21.5 39 22.5 38.9 23.5 38.9 23.5 38.7 24.5 38.5 25.4 38.2 26.4 37.8 27.3 37.4 28.2 36.9 28.9 36.8 29.1 36.2 29.9 35.6 30.6 34.9 31.3 34.2 32 33.5 32.8 33.1 33.2 32.8 33.5 32.1 34.2 31.4 34.9 30.7 35.6 29.9 36.2 29.1 36.8 28.7 37 28.2 37.3 27.4 37.8 26.4 38.2 25.5 38.5 24.5 38.7 23.5 38.9 23.3 38.9 22.5 39 21.5 39 20.5 38.9 19.5 38.8 18.6 38.6 17.6 38.3 17.6 38.3 16.7 37.9 15.8 37.5 14.9 37 14.1 36.4 13.3 35.8 12.7 35.2 12.6 35.1 12 34.3 11.3 33.5 10.8 32.7 10.3 31.8 9.9 30.9 9.7 30.3 9.6 29.9 9.3 29 9.1 28 9 27 9 26 9 25 9.1 24.5 9.2 24 9.4 23 9.6 22.1 10 21.1 10.4 20.2 10.9 19.4 11.1 19.1 11.5 18.5 12.1 17.7 12.7 17 13.5 16.3 14.2 15.6 14.9 14.9 14.9 14.8 15.6 14.2 16.3 13.5 17 12.8 17.7 12.1 18.5 11.5 19.3 11 19.3 10.9 20.2 10.4 21.1 10 22 9.7 23 9.4 24 9.2 24.7 9.1 25 9 26 9 27 9 28 9.1 28.9 9.3 29.9 9.6 30.4 9.7 30.9 9.9 31.8 10.3 32.6 10.8Z",
411
+ "M33.2 11.1 34.2 11.2 35.1 11.4 36 11.9 36.6 12.7 36.8 13.7 36.9 14.7 36.9 15.7 37 16.7 37.1 17.7 37.3 18.6 37.9 19.4 38.5 20.2 39.2 20.9 39.8 21.7 40.5 22.4 40.9 23.3 41 24.3 40.7 25.2 40.1 26 39.4 26.8 38.8 27.5 38.1 28.3 37.5 29.1 37.1 30 37 31 37 31.9 36.9 32.9 36.8 33.9 36.7 34.9 36.2 35.8 35.5 36.4 34.5 36.8 33.6 36.8 32.6 36.9 31.6 37 30.6 37.1 29.6 37.2 28.8 37.7 28 38.4 27.3 39 26.5 39.7 25.8 40.3 24.9 40.8 23.9 41 23 40.8 22.1 40.2 21.4 39.6 20.6 38.9 19.9 38.3 19.1 37.6 18.3 37.2 17.3 37 16.3 37 15.3 36.9 14.3 36.8 13.3 36.7 12.4 36.4 11.7 35.7 11.3 34.8 11.2 33.8 11.1 32.8 11 31.8 11 30.8 10.9 29.9 10.4 29 9.8 28.2 9.1 27.5 8.5 26.7 7.8 26 7.3 25.1 7 24.2 7.1 23.2 7.6 22.3 8.2 21.6 8.9 20.8 9.5 20.1 10.2 19.3 10.7 18.5 10.9 17.5 11 16.6 11.1 15.6 11.1 14.6 11.2 13.6 11.5 12.6 12.1 11.9 13 11.4 13.9 11.2 14.9 11.1 15.9 11 16.9 11 17.9 10.9 18.8 10.6 19.6 10 20.4 9.3 21.1 8.6 21.9 8 22.6 7.4 23.6 7 24.6 7.1 25.5 7.5 26.2 8.1 27 8.7 27.7 9.4 28.5 10 29.3 10.6 30.2 10.9 31.2 11 32.2 11.1Z",
412
+ "M27.7 9.4 28.5 10 29.3 10.6 30.2 10.9 31.2 11 32.2 11.1 33.2 11.1 34.2 11.2 35.1 11.4 36 11.9 36.6 12.7 36.8 13.7 36.9 14.7 36.9 15.7 37 16.7 37.1 17.7 37.3 18.6 37.9 19.4 38.5 20.2 39.2 20.9 39.8 21.7 40.5 22.4 40.9 23.3 41 24.3 40.7 25.2 40.1 26 39.4 26.8 38.8 27.5 38.1 28.3 37.5 29.1 37.1 30 37 31 37 31.9 36.9 32.9 36.8 33.9 36.7 34.9 36.2 35.8 35.5 36.4 34.5 36.8 33.6 36.9 32.6 36.9 31.6 37 30.6 37.1 29.6 37.2 28.8 37.7 28 38.4 27.3 39 26.5 39.7 25.8 40.3 24.9 40.8 23.9 41 23 40.8 22.1 40.2 21.4 39.6 20.6 38.9 19.9 38.3 19.1 37.6 18.3 37.2 17.3 37 16.3 37 15.3 36.9 14.3 36.8 13.3 36.7 12.4 36.4 11.7 35.7 11.3 34.8 11.2 33.8 11.1 32.8 11 31.8 11 30.8 10.9 29.9 10.4 29 9.8 28.2 9.1 27.5 8.5 26.7 7.8 26 7.3 25.1 7 24.2 7.1 23.2 7.6 22.3 8.2 21.6 8.9 20.8 9.5 20.1 10.2 19.3 10.7 18.5 10.9 17.5 11 16.5 11.1 15.6 11.1 14.6 11.2 13.6 11.5 12.6 12.1 11.9 13 11.4 13.9 11.2 14.9 11.1 15.9 11 16.9 11 17.9 10.9 18.8 10.6 19.6 10 20.4 9.3 21.1 8.6 21.9 8 22.6 7.4 23.6 7 24.6 7.1 25.5 7.5 26.2 8.1 27 8.7Z",
413
+ "M27.9 10.6 28.8 10.3 29.8 10.1 30.8 10 31.8 10.1 32.7 10.3 33.7 10.6 34.6 11.1 34.8 11.3 35.4 11.7 36.1 12.4 36.7 13.1 37.2 14 37.6 14.9 37.9 15.9 38 16.9 38 17.9 37.8 18.8 37.5 19.8 37.1 20.7 36.8 21.6 36.5 22.6 36.4 23.6 36.4 24.4 36.4 24.6 36.5 25.5 36.8 26.5 37.2 27.4 37.6 28.3 37.8 29.3 38 30.3 38 31.3 37.8 32.3 37.6 33.2 37.2 34.1 36.6 35 36 35.7 35.3 36.4 34.4 37 34.1 37.2 33.6 37.4 32.6 37.8 31.6 37.9 30.6 38 29.7 37.9 28.7 37.7 27.8 37.3 26.8 36.9 25.9 36.6 24.9 36.4 23.9 36.4 22.9 36.4 22 36.6 21 37 20.1 37.4 20.1 37.4 19.2 37.7 18.2 37.9 17.2 38 16.2 37.9 15.3 37.7 14.3 37.4 13.4 36.9 12.6 36.3 11.9 35.6 11.3 34.9 10.8 34 10.4 33.1 10.1 32.1 10 31.1 10 30.6 10 30.1 10.2 29.2 10.5 28.2 10.9 27.3 11.2 26.4 11.5 25.4 11.6 24.4 11.6 23.4 11.5 22.5 11.2 21.5 10.8 20.6 10.4 19.7 10.2 18.7 10 17.7 10 16.7 10 16.6 10.2 15.7 10.4 14.8 10.8 13.9 11.4 13 12 12.3 12.7 11.6 13.6 11 14.4 10.6 15.4 10.2 16.4 10.1 17.4 10 18.3 10.1 19.3 10.3 20.2 10.7 20.9 11 21.2 11.1 22.1 11.4 23.1 11.6 24.1 11.6 25.1 11.6 26 11.4 27 11Z",
414
+ "M36 35.7 35.3 36.4 34.4 37 33.6 37.4 32.6 37.8 31.6 37.9 30.6 38 29.7 37.9 28.7 37.7 27.8 37.3 26.8 36.9 25.9 36.6 24.9 36.4 23.9 36.4 22.9 36.4 22 36.6 21 37 20.1 37.4 19.2 37.7 18.2 37.9 17.2 38 16.2 37.9 15.3 37.7 14.3 37.4 13.4 36.9 12.6 36.3 11.9 35.6 11.3 34.9 10.8 34 10.4 33.1 10.1 32.1 10 31.1 10 30.2 10.2 29.2 10.5 28.2 10.9 27.3 11.2 26.4 11.5 25.4 11.6 24.4 11.6 23.4 11.5 22.5 11.2 21.5 10.8 20.6 10.4 19.7 10.2 18.7 10 17.7 10 16.7 10.2 15.7 10.4 14.8 10.8 13.9 11.4 13 12 12.3 12.7 11.6 13.6 11 14.4 10.6 15.4 10.2 16.4 10.1 17.4 10 18.3 10.1 19.3 10.3 20.2 10.7 21.2 11.1 22.1 11.4 23.1 11.6 24.1 11.6 25.1 11.6 26 11.4 27 11 27.9 10.6 28.8 10.3 29.8 10.1 30.8 10 31.8 10.1 32.7 10.3 33.7 10.6 34.6 11.1 35.4 11.7 36.1 12.4 36.7 13.1 37.2 14 37.6 14.9 37.9 15.9 38 16.9 38 17.8 37.8 18.8 37.5 19.8 37.1 20.7 36.8 21.6 36.5 22.6 36.4 23.6 36.4 24.6 36.5 25.5 36.8 26.5 37.2 27.4 37.6 28.3 37.8 29.3 38 30.3 38 31.3 37.8 32.3 37.6 33.2 37.2 34.1 36.6 35Z",
415
+ "M32.1 32.1 31.4 32.8 30.7 33.5 29.9 34.1 29.1 34.7 28.3 35.3 27.6 35.8 27.5 35.8 26.6 36.4 25.8 36.8 24.9 37.3 24 37.7 23.1 38 22.1 38.3 21.2 38.6 20.2 38.8 19.2 38.9 18.2 39 17.2 39 16.6 38.9 16.3 38.9 15.3 38.7 14.3 38.4 13.4 38 12.5 37.5 11.7 36.9 11.1 36.3 10.5 35.5 10 34.6 9.6 33.7 9.3 32.7 9.1 31.7 9.1 31.4 9 30.8 9 29.8 9.1 28.8 9.2 27.8 9.4 26.8 9.7 25.9 10 24.9 10.3 24 10.7 23.1 11.2 22.2 11.6 21.4 12.2 20.5 12.2 20.4 12.7 19.7 13.3 18.9 13.9 18.1 14.5 17.3 15.2 16.6 15.9 15.9 16.6 15.2 17.3 14.5 18.1 13.9 18.9 13.3 19.7 12.7 20.4 12.2 20.5 12.2 21.4 11.6 22.2 11.2 23.1 10.7 24 10.3 24.9 10 25.9 9.7 26.8 9.4 27.8 9.2 28.8 9.1 29.8 9 30.8 9 31.4 9.1 31.7 9.1 32.7 9.3 33.7 9.6 34.6 10 35.5 10.5 36.3 11.1 36.9 11.7 37.5 12.5 38 13.4 38.4 14.3 38.7 15.3 38.9 16.3 38.9 16.6 39 17.2 39 18.2 38.9 19.2 38.8 20.2 38.6 21.2 38.3 22.1 38 23.1 37.7 24 37.3 24.9 36.8 25.8 36.4 26.6 35.8 27.5 35.8 27.6 35.3 28.3 34.7 29.1 34.1 29.9 33.5 30.7 32.8 31.4Z",
416
+ "M24.3 10.2 24.9 10 25.9 9.7 26.8 9.4 27.1 9.4 27.8 9.2 28.8 9.1 29.8 9 29.9 9 30.8 9 31.7 9.1 32.7 9.3 32.8 9.3 33.7 9.6 34.6 10 35.5 10.5 35.5 10.5 36.3 11.1 36.9 11.7 37.5 12.5 37.5 12.5 38 13.4 38.4 14.3 38.7 15.2 38.7 15.3 38.9 16.3 39 17.2 39 18.1 39 18.2 38.9 19.2 38.8 20.2 38.6 20.9 38.6 21.2 38.3 22.1 38 23.1 37.8 23.7 37.7 24 37.3 24.9 36.8 25.8 36.5 26.4 36.4 26.6 35.8 27.5 35.3 28.3 35 28.8 34.7 29.1 34.1 29.9 33.5 30.7 33.1 31.1 32.8 31.4 32.1 32.1 31.4 32.8 31.1 33.1 30.7 33.5 29.9 34.1 29.1 34.7 28.8 35 28.3 35.3 27.5 35.8 26.6 36.4 26.4 36.5 25.8 36.8 24.9 37.3 24 37.7 23.7 37.8 23.1 38 22.1 38.3 21.2 38.6 20.9 38.6 20.2 38.8 19.2 38.9 18.2 39 18.1 39 17.2 39 16.3 38.9 15.3 38.7 15.2 38.7 14.3 38.4 13.4 38 12.5 37.5 12.5 37.5 11.7 36.9 11.1 36.3 10.5 35.5 10.5 35.5 10 34.6 9.6 33.7 9.3 32.8 9.3 32.7 9.1 31.7 9 30.8 9 29.9 9 29.8 9.1 28.8 9.2 27.8 9.4 27.1 9.4 26.8 9.7 25.9 10 24.9 10.2 24.3 10.3 24 10.7 23.1 11.2 22.2 11.5 21.6 11.6 21.4 12.2 20.5 12.7 19.7 13 19.2 13.3 18.9 13.9 18.1 14.5 17.3 14.9 16.9 15.2 16.6 15.9 15.9 16.6 15.2 16.9 14.9 17.3 14.5 18.1 13.9 18.9 13.3 19.2 13 19.7 12.7 20.5 12.2 21.4 11.6 21.6 11.5 22.2 11.2 23.1 10.7 24 10.3Z",
417
+ "M22.5 7.8 23.2 7.2 24.2 7 25.1 7.4 25.7 8.1 26.2 9 26.8 9.8 27.3 10.6 28.1 11.2 29 11.3 30 11 30.9 10.6 31.8 10.3 32.8 9.9 33.7 10 34.5 10.6 34.9 11.5 34.8 12.5 34.8 13.5 34.7 14.5 34.7 15.5 35.2 16.3 36 16.8 37 17 37.9 17.3 38.9 17.5 39.8 17.9 40.4 18.7 40.5 19.7 40 20.5 39.3 21.3 38.7 22 38.1 22.8 37.6 23.7 37.7 24.6 38.3 25.4 38.9 26.2 39.6 27 40.2 27.7 40.5 28.6 40.3 29.6 39.5 30.3 38.6 30.6 37.6 30.8 36.7 31 35.7 31.3 35 31.9 34.6 32.8 34.7 33.8 34.8 34.8 34.8 35.8 34.8 36.8 34.3 37.6 33.4 38.1 32.4 38 31.5 37.6 30.6 37.2 29.7 36.9 28.7 36.6 27.8 36.9 27.1 37.6 26.6 38.5 26.1 39.3 25.5 40.2 24.8 40.8 23.8 41 22.9 40.6 22.3 39.9 21.8 39 21.2 38.2 20.7 37.4 19.9 36.8 19 36.7 18 37 17.1 37.4 16.2 37.7 15.2 38.1 14.3 38 13.5 37.4 13.1 36.5 13.2 35.5 13.2 34.5 13.3 33.5 13.3 32.5 12.8 31.7 12 31.2 11 31 10.1 30.7 9.1 30.5 8.2 30.1 7.6 29.3 7.5 28.3 8 27.5 8.7 26.7 9.3 26 9.9 25.2 10.4 24.3 10.3 23.4 9.7 22.6 9.1 21.8 8.4 21 7.8 20.3 7.5 19.4 7.7 18.4 8.5 17.7 9.4 17.4 10.4 17.2 11.3 17 12.3 16.7 13 16.1 13.4 15.2 13.3 14.2 13.2 13.2 13.2 12.2 13.2 11.2 13.7 10.4 14.6 9.9 15.6 10 16.5 10.4 17.4 10.8 18.3 11.1 19.3 11.4 20.2 11.1 20.9 10.4 21.4 9.5 21.9 8.7Z"
418
+ ].join(";");
419
+ var ROTATE_KEY_TIMES = "0; 0.14; 0.29; 0.43; 0.57; 0.71; 0.86; 1";
420
+ var ROTATE_KEY_SPLINES = [
421
+ "0.5 0.2 0 0.8",
422
+ "0.5 0.2 0 0.8",
423
+ "0.5 0.2 0 0.8",
424
+ "0.5 0.2 0 0.8",
425
+ "0.5 0.2 0 0.8",
426
+ "0.5 0.2 0 0.8",
427
+ "0.5 0.2 0 0.8"
428
+ ].join("; ");
429
+ var ROTATE_VALUES = "0 24 24; 154 24 24; 309 24 24; 463 24 24; 617 24 24; 771 24 24; 926 24 24; 1080 24 24";
430
+ var DETERMINATE_CIRCLE = "M24 7 C34.49 7 41 13.51 41 24 C41 34.49 34.49 41 24 41 C13.51 41 7 34.49 7 24 C7 13.51 13.51 7 24 7 Z";
431
+ var DETERMINATE_SOFT_BURST = "M20.9 10.4 21.4 9.5 21.9 8.7 22.5 7.8 23.2 7.2 24.2 7 25.1 7.4 25.7 8.1 26.2 9 26.8 9.8 27.3 10.6 28.1 11.2 29 11.3 30 11 30.9 10.6 31.8 10.3 32.8 9.9 33.7 10 34.5 10.6 34.9 11.5 34.8 12.5 34.8 13.5 34.7 14.5 34.7 15.5 35.2 16.3 36 16.8 37 17.1 37.9 17.3 38.9 17.5 39.8 17.9 40.4 18.7 40.5 19.7 40 20.5 39.4 21.3 38.7 22 38.1 22.8 37.6 23.7 37.7 24.6 38.3 25.5 38.9 26.2 39.6 27 40.2 27.7 40.5 28.7 40.3 29.6 39.5 30.3 38.6 30.6 37.6 30.8 36.7 31 35.7 31.3 35 31.9 34.6 32.8 34.7 33.8 34.8 34.8 34.9 35.8 34.8 36.8 34.3 37.6 33.4 38.1 32.4 38 31.5 37.6 30.6 37.2 29.7 36.9 28.7 36.6 27.8 36.9 27.1 37.6 26.6 38.5 26.1 39.3 25.5 40.2 24.8 40.8 23.8 41 22.9 40.6 22.3 39.9 21.8 39 21.2 38.2 20.7 37.4 19.9 36.8 19 36.7 18 37 17.1 37.4 16.2 37.7 15.2 38.1 14.3 38 13.5 37.4 13.1 36.5 13.2 35.5 13.2 34.5 13.3 33.5 13.3 32.5 12.8 31.7 12 31.2 11 31 10.1 30.7 9.1 30.5 8.2 30.1 7.6 29.3 7.5 28.3 8 27.5 8.7 26.7 9.3 26 9.9 25.2 10.4 24.3 10.3 23.4 9.7 22.5 9.1 21.8 8.4 21 7.8 20.3 7.5 19.3 7.7 18.4 8.5 17.7 9.4 17.4 10.4 17.2 11.3 17 12.3 16.7 13 16.1 13.4 15.2 13.3 14.2 13.2 13.2 13.1 12.2 13.2 11.2 13.7 10.4 14.6 9.9 15.6 10 16.5 10.4 17.4 10.8 18.3 11.1 19.3 11.4 20.2 11.1Z";
432
+ var IndeterminateSvg = React11.memo(function IndeterminateSvg2({
433
+ size
434
+ }) {
435
+ const [ready, setReady] = React11.useState(false);
436
+ React11.useEffect(() => {
437
+ const raf = requestAnimationFrame(() => setReady(true));
438
+ return () => cancelAnimationFrame(raf);
439
+ }, []);
440
+ return /* @__PURE__ */ jsx(
441
+ "svg",
442
+ {
443
+ viewBox: "4 4 40 40",
444
+ width: size,
445
+ height: size,
446
+ fill: "currentColor",
447
+ xmlns: "http://www.w3.org/2000/svg",
448
+ "aria-hidden": "true",
449
+ focusable: "false",
450
+ children: /* @__PURE__ */ jsx("path", { d: SHAPE_VALUES.split(";")[0], children: ready && /* @__PURE__ */ jsxs(Fragment, { children: [
451
+ /* @__PURE__ */ jsx(
452
+ "animate",
453
+ {
454
+ attributeName: "d",
455
+ dur: "5s",
456
+ repeatCount: "indefinite",
457
+ calcMode: "spline",
458
+ keySplines: SHAPE_KEY_SPLINES,
459
+ keyTimes: SHAPE_KEY_TIMES,
460
+ values: SHAPE_VALUES
461
+ }
462
+ ),
463
+ /* @__PURE__ */ jsx(
464
+ "animateTransform",
465
+ {
466
+ attributeName: "transform",
467
+ attributeType: "XML",
468
+ type: "rotate",
469
+ dur: "5s",
470
+ repeatCount: "indefinite",
471
+ calcMode: "spline",
472
+ keySplines: ROTATE_KEY_SPLINES,
473
+ keyTimes: ROTATE_KEY_TIMES,
474
+ values: ROTATE_VALUES
475
+ }
476
+ )
477
+ ] }) })
478
+ }
479
+ );
480
+ });
481
+ var DeterminateSvg = React11.memo(function DeterminateSvg2({
482
+ size,
483
+ progress
484
+ }) {
485
+ const p = Math.min(1, Math.max(0, progress));
486
+ const rotation = -180 * p;
487
+ const pathD = p < 0.5 ? DETERMINATE_CIRCLE : DETERMINATE_SOFT_BURST;
488
+ return /* @__PURE__ */ jsx(
489
+ "svg",
490
+ {
491
+ viewBox: "4 4 40 40",
492
+ width: size,
493
+ height: size,
494
+ fill: "currentColor",
495
+ xmlns: "http://www.w3.org/2000/svg",
496
+ "aria-hidden": "true",
497
+ focusable: "false",
498
+ style: {
499
+ transform: `rotate(${rotation}deg)`,
500
+ transition: "transform 0.3s ease"
501
+ },
502
+ children: /* @__PURE__ */ jsx("path", { d: pathD, style: { transition: "d 0.3s ease" } })
503
+ }
504
+ );
505
+ });
506
+ var LoadingIndicator = React11.forwardRef(
507
+ (_a, ref) => {
508
+ var _b = _a, {
509
+ variant = "uncontained",
510
+ size = 48,
511
+ progress,
512
+ color,
513
+ className,
514
+ "aria-label": ariaLabel,
515
+ style
516
+ } = _b, restProps = __objRest(_b, [
517
+ "variant",
518
+ "size",
519
+ "progress",
520
+ "color",
521
+ "className",
522
+ "aria-label",
523
+ "style"
524
+ ]);
525
+ const isContained = variant === "contained";
526
+ const isDeterminate = progress !== void 0;
527
+ const clampedSize = Math.min(240, Math.max(24, size));
528
+ const scaleFactor = clampedSize / 48;
529
+ const containerSize = isContained ? 38 * scaleFactor : void 0;
530
+ const indicatorSize = isContained ? 24 * scaleFactor : clampedSize;
531
+ const activeColor = isContained ? color != null ? color : "var(--md-sys-color-indicator-contained-active)" : color != null ? color : "var(--md-sys-color-indicator-active)";
532
+ const ariaNow = isDeterminate ? Math.round(Math.min(1, Math.max(0, progress)) * 100) : void 0;
533
+ return /* @__PURE__ */ jsx(
534
+ "div",
535
+ __spreadProps(__spreadValues({
536
+ ref,
537
+ role: "progressbar",
538
+ "aria-label": ariaLabel,
539
+ "aria-valuemin": 0,
540
+ "aria-valuemax": 100,
541
+ "aria-valuenow": ariaNow,
542
+ className: cn(
543
+ "inline-flex items-center justify-center shrink-0",
544
+ className
545
+ ),
546
+ style: __spreadValues({
547
+ width: clampedSize,
548
+ height: clampedSize,
549
+ color: activeColor
550
+ }, style)
551
+ }, restProps), {
552
+ children: isContained ? /* @__PURE__ */ jsx(
553
+ "div",
554
+ {
555
+ className: "flex items-center justify-center rounded-full",
556
+ style: {
557
+ width: containerSize,
558
+ height: containerSize,
559
+ backgroundColor: "var(--md-sys-color-indicator-contained-container)"
560
+ },
561
+ children: isDeterminate ? /* @__PURE__ */ jsx(DeterminateSvg, { size: indicatorSize, progress }) : /* @__PURE__ */ jsx(IndeterminateSvg, { size: indicatorSize })
562
+ }
563
+ ) : isDeterminate ? /* @__PURE__ */ jsx(DeterminateSvg, { size: indicatorSize, progress }) : /* @__PURE__ */ jsx(IndeterminateSvg, { size: indicatorSize })
564
+ })
565
+ );
566
+ }
567
+ );
568
+ LoadingIndicator.displayName = "LoadingIndicator";
569
+
570
+ // src/ui/progress-indicator/utils.ts
571
+ function easeInOutCubic(x) {
572
+ return x < 0.5 ? 4 * x * x * x : 1 - (-2 * x + 2) ** 3 / 2;
573
+ }
574
+ function generateWavyCircularPath(center, radius, amplitude, wavelength) {
575
+ const circumference = 2 * Math.PI * radius;
576
+ const numWaves = Math.max(
577
+ 3,
578
+ Math.round(circumference / Math.max(1, wavelength))
579
+ );
580
+ const steps = numWaves * 4;
581
+ const dt = 2 * Math.PI / steps;
582
+ const rAt = (t) => radius + amplitude * Math.sin(numWaves * t);
583
+ const drAt = (t) => amplitude * numWaves * Math.cos(numWaves * t);
584
+ const xAt = (t) => center + rAt(t) * Math.cos(t);
585
+ const yAt = (t) => center + rAt(t) * Math.sin(t);
586
+ const dxAt = (t) => drAt(t) * Math.cos(t) - rAt(t) * Math.sin(t);
587
+ const dyAt = (t) => drAt(t) * Math.sin(t) + rAt(t) * Math.cos(t);
588
+ let d = "";
589
+ const tStart = 0;
590
+ for (let i = 0; i < steps; i++) {
591
+ const t0 = tStart + i * dt;
592
+ const t1 = tStart + (i + 1) * dt;
593
+ const scale = dt / 3;
594
+ const cp1x = xAt(t0) + scale * dxAt(t0);
595
+ const cp1y = yAt(t0) + scale * dyAt(t0);
596
+ const cp2x = xAt(t1) - scale * dxAt(t1);
597
+ const cp2y = yAt(t1) - scale * dyAt(t1);
598
+ if (i === 0) d += `M ${xAt(t0).toFixed(2)} ${yAt(t0).toFixed(2)}`;
599
+ d += ` C ${cp1x.toFixed(2)} ${cp1y.toFixed(2)}, ${cp2x.toFixed(2)} ${cp2y.toFixed(2)}, ${xAt(t1).toFixed(2)} ${yAt(t1).toFixed(2)}`;
600
+ }
601
+ d += " Z";
602
+ return d;
603
+ }
604
+ function getSinePath(startX, endX, phase, wl, amp) {
605
+ if (startX >= endX) return "";
606
+ let d = "";
607
+ const step = amp === 0 ? Math.max(10, endX - startX) : 1;
608
+ const yStart = Math.sin((startX + phase) / wl * 2 * Math.PI) * amp;
609
+ d += `M ${startX.toFixed(2)} ${yStart.toFixed(2)}`;
610
+ let nextX = Math.ceil(startX / step) * step;
611
+ if (nextX === startX) nextX += step;
612
+ while (nextX < endX) {
613
+ const y = Math.sin((nextX + phase) / wl * 2 * Math.PI) * amp;
614
+ d += ` L ${nextX.toFixed(2)} ${y.toFixed(2)}`;
615
+ nextX += step;
616
+ }
617
+ const yEnd = Math.sin((endX + phase) / wl * 2 * Math.PI) * amp;
618
+ d += ` L ${endX.toFixed(2)} ${yEnd.toFixed(2)}`;
619
+ return d;
620
+ }
621
+ var CircularProgress = React11.forwardRef(
622
+ (_a, ref) => {
623
+ var _b = _a, {
624
+ value,
625
+ size = 48,
626
+ trackHeight = 4,
627
+ shape = "flat",
628
+ amplitude,
629
+ wavelength,
630
+ gapSize = 4,
631
+ crawlerSpeed = 1,
632
+ color,
633
+ trackColor,
634
+ className,
635
+ "aria-label": ariaLabel
636
+ } = _b, restProps = __objRest(_b, [
637
+ "value",
638
+ "size",
639
+ "trackHeight",
640
+ "shape",
641
+ "amplitude",
642
+ "wavelength",
643
+ "gapSize",
644
+ "crawlerSpeed",
645
+ "color",
646
+ "trackColor",
647
+ "className",
648
+ "aria-label"
649
+ ]);
650
+ const isDeterminate = value !== void 0;
651
+ const clampedValue = isDeterminate ? Math.min(100, Math.max(0, value)) : 0;
652
+ const radius = (size - trackHeight) / 2;
653
+ const center = size / 2;
654
+ const activeColor = color || "var(--md-sys-color-indicator-active)";
655
+ const bgTrackColor = trackColor || "var(--md-sys-color-indicator-track)";
656
+ const isWavy = shape === "wavy";
657
+ const BASELINE_SIZE = 48;
658
+ const scaleFactor = size / BASELINE_SIZE;
659
+ const effectiveAmplitude = React11.useMemo(
660
+ () => amplitude != null ? amplitude : 1.6 * scaleFactor,
661
+ [amplitude, scaleFactor]
662
+ );
663
+ const effectiveWavelength = React11.useMemo(
664
+ () => wavelength != null ? wavelength : 15 * scaleFactor,
665
+ [wavelength, scaleFactor]
666
+ );
667
+ const wavyActivePath = React11.useMemo(
668
+ () => isWavy ? generateWavyCircularPath(
669
+ center,
670
+ radius,
671
+ effectiveAmplitude,
672
+ effectiveWavelength
673
+ ) : null,
674
+ [isWavy, center, radius, effectiveAmplitude, effectiveWavelength]
675
+ );
676
+ const circumference = React11.useMemo(() => 2 * Math.PI * radius, [radius]);
677
+ const gapForTrack = React11.useMemo(
678
+ () => (gapSize + trackHeight) / circumference,
679
+ [gapSize, trackHeight, circumference]
680
+ );
681
+ const activeAngularFraction = isDeterminate ? clampedValue / 100 : 0;
682
+ const trackOffset = isDeterminate ? activeAngularFraction + gapForTrack : 0;
683
+ const trackLength = isDeterminate ? Math.max(1e-3, 1 - activeAngularFraction - 2 * gapForTrack) : 1;
684
+ const ActiveCircleElem = m.circle;
685
+ const ActivePathElem = m.path;
686
+ return /* @__PURE__ */ jsx(
687
+ "div",
688
+ __spreadProps(__spreadValues({
689
+ ref,
690
+ role: "progressbar",
691
+ "aria-label": ariaLabel,
692
+ "aria-valuenow": isDeterminate ? clampedValue : void 0,
693
+ "aria-valuemin": 0,
694
+ "aria-valuemax": 100,
695
+ className: cn(
696
+ "relative inline-flex items-center justify-center shrink-0",
697
+ className
698
+ ),
699
+ style: { width: size, height: size }
700
+ }, restProps), {
701
+ children: /* @__PURE__ */ jsxs(LazyMotion, { features: domMax, strict: true, children: [
702
+ /* @__PURE__ */ jsxs(
703
+ "svg",
704
+ {
705
+ width: size,
706
+ height: size,
707
+ viewBox: `0 0 ${size} ${size}`,
708
+ "aria-hidden": "true",
709
+ style: { transform: "rotate(-90deg)", overflow: "visible" },
710
+ children: [
711
+ isDeterminate ? /* @__PURE__ */ jsx(
712
+ m.circle,
713
+ {
714
+ cx: center,
715
+ cy: center,
716
+ r: radius,
717
+ fill: "none",
718
+ stroke: bgTrackColor,
719
+ strokeWidth: trackHeight,
720
+ initial: { pathLength: trackLength, pathOffset: trackOffset },
721
+ animate: { pathLength: trackLength, pathOffset: trackOffset },
722
+ transition: { duration: 0.4, ease: [0.2, 0, 0, 1] },
723
+ strokeLinecap: "round"
724
+ }
725
+ ) : null,
726
+ isDeterminate && (isWavy ? /* @__PURE__ */ jsx(
727
+ ActivePathElem,
728
+ {
729
+ d: wavyActivePath != null ? wavyActivePath : "",
730
+ fill: "none",
731
+ stroke: activeColor,
732
+ strokeWidth: trackHeight,
733
+ strokeLinecap: "round",
734
+ initial: { pathLength: 0 },
735
+ animate: { pathLength: clampedValue / 100 },
736
+ transition: {
737
+ duration: 0.4,
738
+ ease: [0.2, 0, 0, 1]
739
+ }
740
+ }
741
+ ) : /* @__PURE__ */ jsx(
742
+ ActiveCircleElem,
743
+ {
744
+ cx: center,
745
+ cy: center,
746
+ r: radius,
747
+ fill: "none",
748
+ stroke: activeColor,
749
+ strokeWidth: trackHeight,
750
+ strokeLinecap: "round",
751
+ initial: { pathLength: 0 },
752
+ animate: { pathLength: clampedValue / 100 },
753
+ transition: {
754
+ duration: 0.4,
755
+ ease: [0.2, 0, 0, 1]
756
+ }
757
+ }
758
+ ))
759
+ ]
760
+ }
761
+ ),
762
+ !isDeterminate && /* @__PURE__ */ jsxs(
763
+ m.svg,
764
+ {
765
+ width: size,
766
+ height: size,
767
+ viewBox: `0 0 ${size} ${size}`,
768
+ "aria-hidden": "true",
769
+ style: {
770
+ position: "absolute",
771
+ inset: 0,
772
+ overflow: "visible",
773
+ rotate: "-90deg",
774
+ transformOrigin: "center"
775
+ },
776
+ animate: { rotate: ["-90deg", "270deg"] },
777
+ transition: {
778
+ rotate: {
779
+ duration: 2 / Math.max(0.1, crawlerSpeed),
780
+ repeat: Number.POSITIVE_INFINITY,
781
+ ease: "linear"
782
+ }
783
+ },
784
+ children: [
785
+ /* @__PURE__ */ jsx(
786
+ m.circle,
787
+ {
788
+ cx: center,
789
+ cy: center,
790
+ r: radius,
791
+ fill: "none",
792
+ stroke: bgTrackColor,
793
+ strokeWidth: trackHeight,
794
+ strokeLinecap: "round",
795
+ style: { originX: "50%", originY: "50%" },
796
+ animate: {
797
+ pathLength: [
798
+ Math.max(1e-3, 1 - 0.1 - 2 * gapForTrack),
799
+ Math.max(1e-3, 1 - 0.75 - 2 * gapForTrack),
800
+ Math.max(1e-3, 1 - 0.1 - 2 * gapForTrack)
801
+ ],
802
+ rotate: [
803
+ `${(0.1 + gapForTrack) * 360}deg`,
804
+ `${(1 + gapForTrack) * 360}deg`,
805
+ `${(1.1 + gapForTrack) * 360}deg`
806
+ ]
807
+ },
808
+ transition: {
809
+ duration: 2 / Math.max(0.1, crawlerSpeed),
810
+ repeat: Number.POSITIVE_INFINITY,
811
+ ease: [0.4, 0, 0.2, 1]
812
+ }
813
+ }
814
+ ),
815
+ isWavy ? /* @__PURE__ */ jsx(
816
+ ActivePathElem,
817
+ {
818
+ d: wavyActivePath != null ? wavyActivePath : "",
819
+ fill: "none",
820
+ stroke: activeColor,
821
+ strokeWidth: trackHeight,
822
+ strokeLinecap: "round",
823
+ style: { originX: "50%", originY: "50%" },
824
+ animate: {
825
+ pathLength: [0.1, 0.75, 0.1],
826
+ rotate: ["0deg", "90deg", "360deg"]
827
+ },
828
+ transition: {
829
+ duration: 2 / Math.max(0.1, crawlerSpeed),
830
+ repeat: Number.POSITIVE_INFINITY,
831
+ ease: [0.4, 0, 0.2, 1]
832
+ }
833
+ }
834
+ ) : /* @__PURE__ */ jsx(
835
+ ActiveCircleElem,
836
+ {
837
+ cx: center,
838
+ cy: center,
839
+ r: radius,
840
+ fill: "none",
841
+ stroke: activeColor,
842
+ strokeWidth: trackHeight,
843
+ strokeLinecap: "round",
844
+ style: { originX: "50%", originY: "50%" },
845
+ animate: {
846
+ pathLength: [0.1, 0.75, 0.1],
847
+ rotate: ["0deg", "90deg", "360deg"]
848
+ },
849
+ transition: {
850
+ duration: 2 / Math.max(0.1, crawlerSpeed),
851
+ repeat: Number.POSITIVE_INFINITY,
852
+ ease: [0.4, 0, 0.2, 1]
853
+ }
854
+ }
855
+ )
856
+ ]
857
+ }
858
+ )
859
+ ] })
860
+ })
861
+ );
862
+ }
863
+ );
864
+ CircularProgress.displayName = "CircularProgress";
865
+ function useContainerWidth() {
866
+ const [width, setWidth] = React11.useState(0);
867
+ const observerRef = React11.useRef(null);
868
+ const ref = React11.useCallback((node) => {
869
+ if (observerRef.current) {
870
+ observerRef.current.disconnect();
871
+ observerRef.current = null;
872
+ }
873
+ if (node) {
874
+ const obs = new ResizeObserver((entries) => {
875
+ const contentRect = entries[0].contentRect;
876
+ setWidth(contentRect.width);
877
+ });
878
+ obs.observe(node);
879
+ observerRef.current = obs;
880
+ }
881
+ }, []);
882
+ React11.useEffect(() => {
883
+ return () => {
884
+ if (observerRef.current) {
885
+ observerRef.current.disconnect();
886
+ }
887
+ };
888
+ }, []);
889
+ return [ref, width];
890
+ }
891
+ function useMergedRef(...refs) {
892
+ return React11.useCallback(
893
+ (node) => {
894
+ for (const ref of refs) {
895
+ if (typeof ref === "function") {
896
+ ref(node);
897
+ } else if (ref && typeof ref === "object") {
898
+ ref.current = node;
899
+ }
900
+ }
901
+ },
902
+ // eslint-disable-next-line react-hooks/exhaustive-deps
903
+ [refs]
904
+ );
905
+ }
906
+ var FlatLinearTrack = React11.memo(function FlatLinearTrack2({
907
+ trackHeight,
908
+ activeColor,
909
+ trackColor,
910
+ value,
911
+ isRtl,
912
+ gapSize,
913
+ crawlerSpeed
914
+ }) {
915
+ const isDeterminate = value !== void 0;
916
+ const radius = trackHeight / 2;
917
+ const minActiveWidth = trackHeight;
918
+ return /* @__PURE__ */ jsx(
919
+ "div",
920
+ {
921
+ className: "relative w-full overflow-hidden",
922
+ style: { height: trackHeight, borderRadius: radius },
923
+ children: isDeterminate ? /* @__PURE__ */ jsxs(Fragment, { children: [
924
+ /* @__PURE__ */ jsx(
925
+ m.div,
926
+ {
927
+ className: "absolute inset-y-0",
928
+ style: {
929
+ backgroundColor: trackColor,
930
+ borderRadius: radius,
931
+ width: "100%"
932
+ },
933
+ initial: {
934
+ [isRtl ? "right" : "left"]: `calc(max(${minActiveWidth}px, 0%) + ${gapSize}px)`
935
+ },
936
+ animate: {
937
+ [isRtl ? "right" : "left"]: `calc(max(${minActiveWidth}px, ${value}%) + ${gapSize}px)`
938
+ },
939
+ transition: { duration: 0.4, ease: [0.2, 0, 0, 1] }
940
+ }
941
+ ),
942
+ /* @__PURE__ */ jsx(
943
+ m.div,
944
+ {
945
+ className: "absolute inset-y-0",
946
+ style: __spreadValues({
947
+ backgroundColor: activeColor,
948
+ borderRadius: radius,
949
+ minWidth: minActiveWidth
950
+ }, isRtl ? { right: 0 } : { left: 0 }),
951
+ initial: { width: `${minActiveWidth}px` },
952
+ animate: { width: `${value}%` },
953
+ transition: { duration: 0.4, ease: [0.2, 0, 0, 1] }
954
+ }
955
+ )
956
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
957
+ /* @__PURE__ */ jsx(
958
+ "div",
959
+ {
960
+ className: "absolute inset-0",
961
+ style: { backgroundColor: trackColor, borderRadius: radius }
962
+ }
963
+ ),
964
+ /* @__PURE__ */ jsx(
965
+ m.div,
966
+ {
967
+ className: "absolute inset-y-0",
968
+ style: { backgroundColor: activeColor, borderRadius: radius },
969
+ initial: { left: "-40%", width: "40%" },
970
+ animate: { left: ["-40%", "100%"], width: ["40%", "20%", "40%"] },
971
+ transition: {
972
+ duration: 2 / Math.max(0.1, crawlerSpeed),
973
+ repeat: Number.POSITIVE_INFINITY,
974
+ ease: "easeInOut"
975
+ }
976
+ }
977
+ )
978
+ ] })
979
+ }
980
+ );
981
+ });
982
+ var WavyLinearTrack = React11.memo(function WavyLinearTrack2({
983
+ trackHeight,
984
+ svgHeight,
985
+ amplitude,
986
+ wavelength,
987
+ indeterminateWavelength,
988
+ activeColor,
989
+ trackColor,
990
+ value,
991
+ isRtl,
992
+ gapSize,
993
+ waveSpeed,
994
+ crawlerSpeed,
995
+ determinateAnimation,
996
+ indeterminateAnimation,
997
+ trackShape
998
+ }) {
999
+ const isDeterminate = typeof value === "number";
1000
+ const clampedValue = isDeterminate ? Math.max(0, Math.min(100, value)) : 100;
1001
+ const titleId = React11.useId();
1002
+ const [containerRef, width] = useContainerWidth();
1003
+ const activePathRef = React11.useRef(null);
1004
+ const trackPathRef = React11.useRef(null);
1005
+ const amplitudeMV = useMotionValue(amplitude);
1006
+ const fractionMV = useMotionValue(isDeterminate ? clampedValue / 100 : 1);
1007
+ React11.useEffect(() => {
1008
+ if (isDeterminate) {
1009
+ const fraction = clampedValue / 100;
1010
+ let targetAmp = amplitude;
1011
+ if (determinateAnimation === "md3") {
1012
+ targetAmp = fraction <= 0.1 || fraction >= 0.95 ? 0 : amplitude;
1013
+ }
1014
+ animate(amplitudeMV, targetAmp, {
1015
+ type: "spring",
1016
+ bounce: 0,
1017
+ duration: 0.5
1018
+ });
1019
+ animate(fractionMV, fraction, { duration: 0.4, ease: [0.2, 0, 0, 1] });
1020
+ }
1021
+ }, [
1022
+ clampedValue,
1023
+ isDeterminate,
1024
+ amplitude,
1025
+ amplitudeMV,
1026
+ fractionMV,
1027
+ determinateAnimation
1028
+ ]);
1029
+ const activeWavelength = Math.max(
1030
+ 1,
1031
+ isDeterminate ? wavelength : indeterminateWavelength
1032
+ );
1033
+ const trackAmp = trackShape === "wavy" ? amplitude : 0;
1034
+ useAnimationFrame((time) => {
1035
+ if (width === 0) return;
1036
+ const currentAmp = amplitudeMV.get();
1037
+ const phase = time / 1e3 * waveSpeed * activeWavelength;
1038
+ const capWidth = trackHeight / 2;
1039
+ let activePathD = "";
1040
+ let trackD = "";
1041
+ const totalGap = gapSize + trackHeight;
1042
+ if (isDeterminate) {
1043
+ const fraction = fractionMV.get();
1044
+ const barHead = fraction * width;
1045
+ const adjHead = Math.max(capWidth, Math.min(width - capWidth, barHead));
1046
+ const adjTail = capWidth;
1047
+ if (fraction > 0 && adjHead - adjTail > 0.1) {
1048
+ activePathD = getSinePath(
1049
+ adjTail,
1050
+ adjHead,
1051
+ phase,
1052
+ activeWavelength,
1053
+ currentAmp
1054
+ );
1055
+ } else if (fraction === 0) {
1056
+ activePathD = `M ${capWidth} 0 L ${capWidth + 0.01} 0`;
1057
+ }
1058
+ const trackStart = adjHead + totalGap;
1059
+ if (trackStart < width - capWidth) {
1060
+ trackD = getSinePath(
1061
+ trackStart,
1062
+ width - capWidth,
1063
+ phase,
1064
+ activeWavelength,
1065
+ trackAmp
1066
+ );
1067
+ }
1068
+ } else {
1069
+ const safeCrawlerSpeed = Math.max(0.1, crawlerSpeed);
1070
+ const activeLines = [];
1071
+ if (indeterminateAnimation === "continuous") {
1072
+ const cycle = 2e3 / safeCrawlerSpeed;
1073
+ const fraction = time % cycle / cycle;
1074
+ activeLines.push({
1075
+ tail: easeInOutCubic(Math.max(0, fraction * 1.5 - 0.5)),
1076
+ head: easeInOutCubic(Math.min(1, fraction * 1.5))
1077
+ });
1078
+ } else {
1079
+ const cycle = 1750 / safeCrawlerSpeed;
1080
+ const t = time % cycle * safeCrawlerSpeed;
1081
+ const l1H = easeInOutCubic(Math.max(0, Math.min(1, t / 1e3)));
1082
+ const l1T = easeInOutCubic(Math.max(0, Math.min(1, (t - 250) / 1e3)));
1083
+ const l2H = easeInOutCubic(Math.max(0, Math.min(1, (t - 650) / 850)));
1084
+ const l2T = easeInOutCubic(Math.max(0, Math.min(1, (t - 900) / 850)));
1085
+ activeLines.push({ tail: l1T, head: l1H });
1086
+ activeLines.push({ tail: l2T, head: l2H });
1087
+ }
1088
+ const segments = activeLines.map((line) => {
1089
+ const barTail = line.tail * width;
1090
+ const barHead = line.head * width;
1091
+ const adjTail = Math.max(
1092
+ capWidth,
1093
+ Math.min(width - capWidth, barTail)
1094
+ );
1095
+ const adjHead = Math.max(
1096
+ capWidth,
1097
+ Math.min(width - capWidth, barHead)
1098
+ );
1099
+ return { adjTail, adjHead };
1100
+ }).filter((seg) => seg.adjHead - seg.adjTail > 0.1);
1101
+ activePathD = segments.map(
1102
+ (seg) => getSinePath(
1103
+ seg.adjTail,
1104
+ seg.adjHead,
1105
+ phase,
1106
+ activeWavelength,
1107
+ currentAmp
1108
+ )
1109
+ ).join(" ");
1110
+ let currentTrackX = capWidth;
1111
+ for (const seg of segments) {
1112
+ const trackEnd = seg.adjTail - totalGap;
1113
+ if (trackEnd > currentTrackX) {
1114
+ trackD += `${getSinePath(currentTrackX, trackEnd, phase, activeWavelength, trackAmp)} `;
1115
+ }
1116
+ currentTrackX = Math.max(currentTrackX, seg.adjHead + totalGap);
1117
+ }
1118
+ if (currentTrackX < width - capWidth) {
1119
+ trackD += getSinePath(
1120
+ currentTrackX,
1121
+ width - capWidth,
1122
+ phase,
1123
+ activeWavelength,
1124
+ trackAmp
1125
+ );
1126
+ }
1127
+ }
1128
+ if (activePathRef.current)
1129
+ activePathRef.current.setAttribute("d", activePathD);
1130
+ if (trackPathRef.current)
1131
+ trackPathRef.current.setAttribute("d", trackD.trim());
1132
+ });
1133
+ return /* @__PURE__ */ jsx(
1134
+ "div",
1135
+ {
1136
+ ref: containerRef,
1137
+ className: "relative w-full overflow-hidden",
1138
+ style: { height: svgHeight },
1139
+ children: width > 0 && /* @__PURE__ */ jsxs(
1140
+ "svg",
1141
+ {
1142
+ className: "absolute inset-0 w-full h-full",
1143
+ style: {
1144
+ overflow: "visible",
1145
+ transform: isRtl ? "scaleX(-1)" : void 0
1146
+ },
1147
+ "aria-labelledby": titleId,
1148
+ children: [
1149
+ /* @__PURE__ */ jsx("title", { id: titleId, children: isDeterminate ? `Progress: ${clampedValue}%` : "Indeterminate loading progress" }),
1150
+ /* @__PURE__ */ jsxs("g", { transform: `translate(0, ${svgHeight / 2})`, children: [
1151
+ /* @__PURE__ */ jsx(
1152
+ "path",
1153
+ {
1154
+ ref: trackPathRef,
1155
+ fill: "none",
1156
+ stroke: trackColor,
1157
+ strokeWidth: trackHeight,
1158
+ strokeLinecap: "round"
1159
+ }
1160
+ ),
1161
+ /* @__PURE__ */ jsx(
1162
+ "path",
1163
+ {
1164
+ ref: activePathRef,
1165
+ fill: "none",
1166
+ stroke: activeColor,
1167
+ strokeWidth: trackHeight,
1168
+ strokeLinecap: "round"
1169
+ }
1170
+ )
1171
+ ] })
1172
+ ]
1173
+ }
1174
+ )
1175
+ }
1176
+ );
1177
+ });
1178
+ var LinearProgress = React11.forwardRef(
1179
+ (_a, ref) => {
1180
+ var _b = _a, {
1181
+ value,
1182
+ shape = "flat",
1183
+ trackShape,
1184
+ trackHeight = 4,
1185
+ amplitude,
1186
+ wavelength = 40,
1187
+ indeterminateWavelength = 20,
1188
+ waveSpeed = 1,
1189
+ crawlerSpeed = 1,
1190
+ determinateAnimation = "md3",
1191
+ indeterminateAnimation = "continuous",
1192
+ gapSize = 4,
1193
+ showStopIndicator = "auto",
1194
+ color,
1195
+ trackColor,
1196
+ className,
1197
+ "aria-label": ariaLabel
1198
+ } = _b, restProps = __objRest(_b, [
1199
+ "value",
1200
+ "shape",
1201
+ "trackShape",
1202
+ "trackHeight",
1203
+ "amplitude",
1204
+ "wavelength",
1205
+ "indeterminateWavelength",
1206
+ "waveSpeed",
1207
+ "crawlerSpeed",
1208
+ "determinateAnimation",
1209
+ "indeterminateAnimation",
1210
+ "gapSize",
1211
+ "showStopIndicator",
1212
+ "color",
1213
+ "trackColor",
1214
+ "className",
1215
+ "aria-label"
1216
+ ]);
1217
+ const isDeterminate = value !== void 0;
1218
+ const clampedValue = isDeterminate ? Math.min(100, Math.max(0, value)) : 0;
1219
+ const containerRef = React11.useRef(null);
1220
+ const mergedRef = useMergedRef(ref, containerRef);
1221
+ const [isRtl, setIsRtl] = React11.useState(false);
1222
+ React11.useEffect(() => {
1223
+ if (containerRef.current) {
1224
+ const dir = getComputedStyle(containerRef.current).direction;
1225
+ setIsRtl(dir === "rtl");
1226
+ }
1227
+ }, []);
1228
+ const isWavy = shape === "wavy";
1229
+ const resolvedTrackShape = trackShape != null ? trackShape : shape;
1230
+ const effectiveAmplitude = React11.useMemo(() => amplitude != null ? amplitude : 3, [amplitude]);
1231
+ const svgHeight = React11.useMemo(
1232
+ () => isWavy ? trackHeight + effectiveAmplitude * 2 : trackHeight,
1233
+ [isWavy, trackHeight, effectiveAmplitude]
1234
+ );
1235
+ const shouldShowStop = React11.useMemo(
1236
+ () => isDeterminate && resolvedTrackShape === "flat" && (showStopIndicator === true || showStopIndicator === "auto" && isDeterminate),
1237
+ [isDeterminate, resolvedTrackShape, showStopIndicator]
1238
+ );
1239
+ const stopSize = React11.useMemo(
1240
+ () => Math.max(2, trackHeight > 4 ? 4 : trackHeight / 2),
1241
+ [trackHeight]
1242
+ );
1243
+ const stopOffset = (trackHeight - stopSize) / 2;
1244
+ const activeColor = color || "var(--md-sys-color-indicator-active)";
1245
+ const bgTrackColor = trackColor || "var(--md-sys-color-indicator-track)";
1246
+ return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsxs(
1247
+ "div",
1248
+ __spreadProps(__spreadValues({
1249
+ ref: mergedRef,
1250
+ role: "progressbar",
1251
+ "aria-label": ariaLabel,
1252
+ "aria-valuenow": isDeterminate ? clampedValue : void 0,
1253
+ "aria-valuemin": 0,
1254
+ "aria-valuemax": 100,
1255
+ className: cn(
1256
+ "relative flex w-full flex-col justify-center",
1257
+ className
1258
+ ),
1259
+ style: { height: svgHeight }
1260
+ }, restProps), {
1261
+ children: [
1262
+ isWavy ? /* @__PURE__ */ jsx(
1263
+ WavyLinearTrack,
1264
+ {
1265
+ trackHeight,
1266
+ svgHeight,
1267
+ amplitude: effectiveAmplitude,
1268
+ wavelength,
1269
+ indeterminateWavelength,
1270
+ activeColor,
1271
+ trackColor: bgTrackColor,
1272
+ value: isDeterminate ? clampedValue : void 0,
1273
+ isRtl,
1274
+ gapSize,
1275
+ waveSpeed,
1276
+ crawlerSpeed,
1277
+ determinateAnimation,
1278
+ indeterminateAnimation,
1279
+ trackShape: resolvedTrackShape
1280
+ }
1281
+ ) : /* @__PURE__ */ jsx(
1282
+ FlatLinearTrack,
1283
+ {
1284
+ trackHeight,
1285
+ activeColor,
1286
+ trackColor: bgTrackColor,
1287
+ value: isDeterminate ? clampedValue : void 0,
1288
+ isRtl,
1289
+ gapSize,
1290
+ crawlerSpeed
1291
+ }
1292
+ ),
1293
+ shouldShowStop && /* @__PURE__ */ jsx(
1294
+ "div",
1295
+ {
1296
+ "aria-hidden": "true",
1297
+ className: "absolute rounded-full",
1298
+ style: __spreadValues({
1299
+ width: stopSize,
1300
+ height: stopSize,
1301
+ backgroundColor: "var(--md-sys-color-indicator-stop)",
1302
+ top: svgHeight / 2 - stopSize / 2
1303
+ }, isRtl ? { left: stopOffset } : { right: stopOffset })
1304
+ }
1305
+ )
1306
+ ]
1307
+ })
1308
+ ) });
1309
+ }
1310
+ );
1311
+ LinearProgress.displayName = "LinearProgress";
1312
+ var ProgressIndicator = React11.forwardRef((props, ref) => {
1313
+ if (props.variant === "circular") {
1314
+ return /* @__PURE__ */ jsx(CircularProgress, __spreadValues({ ref }, props));
1315
+ }
1316
+ return /* @__PURE__ */ jsx(LinearProgress, __spreadValues({ ref }, props));
1317
+ });
1318
+ ProgressIndicator.displayName = "ProgressIndicator";
1319
+ function TouchTarget() {
1320
+ return /* @__PURE__ */ jsx(
1321
+ "span",
1322
+ {
1323
+ "aria-hidden": "true",
1324
+ className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 min-w-12 min-h-12 cursor-pointer pointer-events-none"
1325
+ }
1326
+ );
1327
+ }
1328
+ var SIZE_STYLES = {
1329
+ xs: "h-8 w-8",
1330
+ sm: "h-10 w-10",
1331
+ md: "h-14 w-14",
1332
+ lg: "h-24 w-24",
1333
+ xl: "h-[8.5rem] w-[8.5rem]"
1334
+ };
1335
+ var SIZE_ICON = {
1336
+ xs: { cls: "size-5", px: 20 },
1337
+ sm: { cls: "size-6", px: 24 },
1338
+ md: { cls: "size-6", px: 24 },
1339
+ lg: { cls: "size-8", px: 32 },
1340
+ xl: { cls: "size-10", px: 40 }
1341
+ };
1342
+ var RADIUS_MAP = {
1343
+ xs: {
1344
+ round: 16,
1345
+ square: 12,
1346
+ pressed: 8,
1347
+ selectedRound: 12,
1348
+ selectedSquare: 16
1349
+ },
1350
+ sm: {
1351
+ round: 20,
1352
+ square: 12,
1353
+ pressed: 8,
1354
+ selectedRound: 12,
1355
+ selectedSquare: 20
1356
+ },
1357
+ md: {
1358
+ round: 28,
1359
+ square: 16,
1360
+ pressed: 12,
1361
+ selectedRound: 16,
1362
+ selectedSquare: 28
1363
+ },
1364
+ lg: {
1365
+ round: 48,
1366
+ square: 28,
1367
+ pressed: 16,
1368
+ selectedRound: 28,
1369
+ selectedSquare: 48
1370
+ },
1371
+ xl: {
1372
+ round: 68,
1373
+ square: 28,
1374
+ pressed: 16,
1375
+ selectedRound: 28,
1376
+ selectedSquare: 68
1377
+ }
1378
+ };
1379
+ var SIZE_OUTLINE_WIDTH = {
1380
+ xs: "border",
1381
+ sm: "border",
1382
+ md: "border",
1383
+ lg: "border-2",
1384
+ xl: "border-[3px]"
1385
+ };
1386
+ var colorStyles = {
1387
+ standard: {
1388
+ default: "text-m3-on-surface-variant hover:bg-m3-on-surface-variant/8 active:bg-m3-on-surface-variant/12",
1389
+ selected: "text-m3-primary hover:bg-m3-primary/8 active:bg-m3-primary/12"
1390
+ },
1391
+ filled: {
1392
+ default: "bg-m3-surface-container text-m3-on-surface-variant hover:bg-m3-on-surface-variant/8 active:bg-m3-on-surface-variant/12",
1393
+ selected: "bg-m3-primary text-m3-on-primary hover:brightness-95 active:brightness-90"
1394
+ },
1395
+ tonal: {
1396
+ default: "bg-m3-secondary-container text-m3-on-secondary-container hover:bg-m3-on-secondary-container/8 active:bg-m3-on-secondary-container/12",
1397
+ selected: "bg-m3-secondary text-m3-on-secondary hover:brightness-95 active:brightness-90"
1398
+ },
1399
+ outlined: {
1400
+ default: "border-m3-outline-variant text-m3-on-surface-variant hover:bg-m3-on-surface-variant/8 active:bg-m3-on-surface-variant/12",
1401
+ selected: "bg-m3-inverse-surface text-m3-inverse-on-surface border-transparent hover:brightness-95 active:brightness-90"
1402
+ }
1403
+ };
1404
+ var baseIconButtonClasses = [
1405
+ "relative shrink-0 inline-flex items-center justify-center",
1406
+ "select-none cursor-pointer",
1407
+ "transition-[background-color,color,border-color,box-shadow,opacity,filter] duration-200",
1408
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-m3-primary focus-visible:ring-offset-2",
1409
+ "disabled:pointer-events-none disabled:opacity-[0.38]"
1410
+ ];
1411
+ function resolveAnimateRadius(radiusConfig, shape, isToggle, isSelected) {
1412
+ if (isToggle && isSelected) {
1413
+ return shape === "round" ? radiusConfig.selectedRound : radiusConfig.selectedSquare;
1414
+ }
1415
+ return shape === "round" ? radiusConfig.round : radiusConfig.square;
1416
+ }
1417
+ function resolveDisabledBgClass(colorStyle) {
1418
+ if (colorStyle === "filled" || colorStyle === "tonal") {
1419
+ return "disabled:bg-m3-on-surface/12 disabled:text-m3-on-surface/[0.38]";
1420
+ }
1421
+ if (colorStyle === "outlined") {
1422
+ return "disabled:text-m3-on-surface/[0.38] disabled:border-m3-on-surface/[0.12]";
1423
+ }
1424
+ return "disabled:text-m3-on-surface/[0.38]";
1425
+ }
1426
+ var IconButtonComponent = React11.forwardRef(
1427
+ (_a, ref) => {
1428
+ var _b = _a, {
1429
+ className,
1430
+ style,
1431
+ variant = "default",
1432
+ colorStyle = "standard",
1433
+ size = "sm",
1434
+ shape = "round",
1435
+ selected,
1436
+ loading = false,
1437
+ loadingVariant = "loading-indicator",
1438
+ iconSize,
1439
+ children,
1440
+ onClick,
1441
+ onKeyDown,
1442
+ "aria-label": ariaLabel
1443
+ } = _b, restProps = __objRest(_b, [
1444
+ "className",
1445
+ "style",
1446
+ "variant",
1447
+ "colorStyle",
1448
+ "size",
1449
+ "shape",
1450
+ "selected",
1451
+ "loading",
1452
+ "loadingVariant",
1453
+ "iconSize",
1454
+ "children",
1455
+ "onClick",
1456
+ "onKeyDown",
1457
+ "aria-label"
1458
+ ]);
1459
+ var _a2, _b2;
1460
+ const isToggle = variant === "toggle";
1461
+ const isSelected = isToggle && !!selected;
1462
+ const resolvedColorClass = React11.useMemo(
1463
+ () => isSelected ? colorStyles[colorStyle].selected : colorStyles[colorStyle].default,
1464
+ [isSelected, colorStyle]
1465
+ );
1466
+ const outlineWidthClass = React11.useMemo(
1467
+ () => {
1468
+ var _a3;
1469
+ return colorStyle === "outlined" && !isSelected ? (_a3 = SIZE_OUTLINE_WIDTH[size]) != null ? _a3 : "border" : "";
1470
+ },
1471
+ [colorStyle, isSelected, size]
1472
+ );
1473
+ const disabledBgClass = React11.useMemo(
1474
+ () => resolveDisabledBgClass(colorStyle),
1475
+ [colorStyle]
1476
+ );
1477
+ const radiusConfig = (_a2 = RADIUS_MAP[size]) != null ? _a2 : RADIUS_MAP.sm;
1478
+ const animateRadius = resolveAnimateRadius(
1479
+ radiusConfig,
1480
+ shape,
1481
+ isToggle,
1482
+ isSelected
1483
+ );
1484
+ const pressedRadius = radiusConfig.pressed;
1485
+ const sizeIcon = (_b2 = SIZE_ICON[size]) != null ? _b2 : SIZE_ICON.sm;
1486
+ const iconClass = sizeIcon.cls;
1487
+ const defaultIconPx = sizeIcon.px;
1488
+ const iconPx = iconSize != null ? iconSize : defaultIconPx;
1489
+ const isCustomSize = iconSize != null && iconSize !== "inherit";
1490
+ const needsTouchTarget = size === "xs" || size === "sm";
1491
+ const { ripples, onPointerDown, removeRipple } = useRippleState({
1492
+ disabled: loading
1493
+ });
1494
+ const handleClick = React11.useCallback(
1495
+ (e) => {
1496
+ if (loading) {
1497
+ e.preventDefault();
1498
+ return;
1499
+ }
1500
+ onClick == null ? void 0 : onClick(e);
1501
+ },
1502
+ [loading, onClick]
1503
+ );
1504
+ const handleKeyDown = React11.useCallback(
1505
+ (e) => {
1506
+ if (loading) return;
1507
+ if ((e.key === "Enter" || e.key === " ") && onClick) {
1508
+ e.preventDefault();
1509
+ e.currentTarget.click();
1510
+ }
1511
+ onKeyDown == null ? void 0 : onKeyDown(e);
1512
+ },
1513
+ [loading, onClick, onKeyDown]
1514
+ );
1515
+ return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsxs(
1516
+ m.button,
1517
+ __spreadProps(__spreadValues({
1518
+ ref,
1519
+ type: "button",
1520
+ "aria-pressed": isToggle ? isSelected : void 0,
1521
+ "aria-label": ariaLabel,
1522
+ "aria-busy": loading || void 0,
1523
+ "aria-disabled": loading || restProps.disabled,
1524
+ onClick: handleClick,
1525
+ onPointerDown,
1526
+ onKeyDown: handleKeyDown,
1527
+ style,
1528
+ animate: { borderRadius: animateRadius },
1529
+ whileTap: { borderRadius: pressedRadius },
1530
+ transition: { borderRadius: SPRING_TRANSITION_FAST },
1531
+ className: cn(
1532
+ baseIconButtonClasses,
1533
+ resolvedColorClass,
1534
+ outlineWidthClass,
1535
+ disabledBgClass,
1536
+ "overflow-hidden",
1537
+ SIZE_STYLES[size],
1538
+ loading && "pointer-events-none opacity-75 cursor-not-allowed",
1539
+ className
1540
+ )
1541
+ }, restProps), {
1542
+ children: [
1543
+ needsTouchTarget && /* @__PURE__ */ jsx(TouchTarget, {}),
1544
+ /* @__PURE__ */ jsx(Ripple, { ripples, onRippleDone: removeRipple }),
1545
+ /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsx(
1546
+ m.span,
1547
+ __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
1548
+ transition: SPRING_TRANSITION,
1549
+ className: cn(
1550
+ "flex items-center justify-center shrink-0",
1551
+ iconSize != null ? void 0 : iconClass
1552
+ ),
1553
+ style: isCustomSize ? { width: `${iconSize}px`, height: `${iconSize}px` } : void 0,
1554
+ children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsx(
1555
+ LoadingIndicator,
1556
+ {
1557
+ size: typeof iconPx === "number" ? iconPx : defaultIconPx,
1558
+ color: "currentColor",
1559
+ "aria-label": "Loading"
1560
+ }
1561
+ ) : /* @__PURE__ */ jsx(
1562
+ ProgressIndicator,
1563
+ {
1564
+ variant: "circular",
1565
+ size: typeof iconPx === "number" ? iconPx : defaultIconPx,
1566
+ color: "currentColor",
1567
+ trackColor: "transparent",
1568
+ "aria-label": "Loading"
1569
+ }
1570
+ )
1571
+ }),
1572
+ "loading"
1573
+ ) : /* @__PURE__ */ jsx(
1574
+ m.span,
1575
+ __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
1576
+ transition: SPRING_TRANSITION,
1577
+ "aria-hidden": "true",
1578
+ className: cn(
1579
+ "flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]!",
1580
+ iconSize != null ? void 0 : iconClass
1581
+ ),
1582
+ style: {
1583
+ fontSize: typeof iconPx === "number" ? `${iconPx}px` : iconPx,
1584
+ width: isCustomSize ? `${iconSize}px` : void 0,
1585
+ height: isCustomSize ? `${iconSize}px` : void 0
1586
+ },
1587
+ children
1588
+ }),
1589
+ "content"
1590
+ ) })
1591
+ ]
1592
+ })
1593
+ ) });
1594
+ }
1595
+ );
1596
+ IconButtonComponent.displayName = "IconButton";
1597
+ var IconButton = React11.memo(IconButtonComponent);
1598
+ var DURATION_MAP = {
1599
+ short: 4e3,
1600
+ long: 7e3
1601
+ };
1602
+ var RESULT = {
1603
+ ACTION: "action-performed",
1604
+ DISMISSED: "dismissed"
1605
+ };
1606
+ var SNACKBAR_SPRING = DEFAULT_SPATIAL_SPRING;
1607
+ var SNACKBAR_ANIM = {
1608
+ initial: { opacity: 0, y: 56, scale: 0.9 },
1609
+ animate: {
1610
+ opacity: 1,
1611
+ y: 0,
1612
+ scale: 1,
1613
+ transition: SNACKBAR_SPRING
1614
+ },
1615
+ exit: {
1616
+ opacity: 0,
1617
+ y: 24,
1618
+ scale: 0.95,
1619
+ transition: { duration: 0.2, ease: "easeIn" }
1620
+ }
1621
+ };
1622
+ var REDUCED_MOTION_ANIM = {
1623
+ initial: { opacity: 0 },
1624
+ animate: { opacity: 1 },
1625
+ exit: { opacity: 0 }
1626
+ };
1627
+ function resolveDuration(duration) {
1628
+ if (duration === void 0) return DURATION_MAP.short;
1629
+ if (typeof duration === "number") return duration;
1630
+ return DURATION_MAP[duration];
1631
+ }
1632
+ function generateId() {
1633
+ return typeof crypto !== "undefined" && crypto.randomUUID ? crypto.randomUUID() : Math.random().toString(36).slice(2);
1634
+ }
1635
+ function toSnackbarData(item) {
1636
+ return { id: generateId(), visuals: item.visuals, resolve: item.resolve };
1637
+ }
1638
+ function useSnackbarState() {
1639
+ const [current, setCurrent] = React11.useState(null);
1640
+ const queueRef = React11.useRef([]);
1641
+ const showSnackbar = React11.useCallback(
1642
+ (visuals) => {
1643
+ return new Promise((resolve) => {
1644
+ const item = { visuals, resolve };
1645
+ setCurrent((prev) => {
1646
+ if (prev === null) return toSnackbarData(item);
1647
+ queueRef.current.push(item);
1648
+ return prev;
1649
+ });
1650
+ });
1651
+ },
1652
+ []
1653
+ );
1654
+ const _dismiss = React11.useCallback((result) => {
1655
+ setCurrent((prev) => {
1656
+ if (prev) prev.resolve(result);
1657
+ const next = queueRef.current.shift();
1658
+ return next ? toSnackbarData(next) : null;
1659
+ });
1660
+ }, []);
1661
+ React11.useEffect(() => {
1662
+ return () => {
1663
+ for (const item of queueRef.current) {
1664
+ item.resolve(RESULT.DISMISSED);
1665
+ }
1666
+ queueRef.current = [];
1667
+ };
1668
+ }, []);
1669
+ return { current, showSnackbar, _dismiss };
1670
+ }
1671
+ var Snackbar = React11.memo(function Snackbar2({
1672
+ data,
1673
+ className
1674
+ }) {
1675
+ const { visuals, resolve } = data;
1676
+ const {
1677
+ message,
1678
+ actionLabel,
1679
+ withDismissAction = false,
1680
+ actionOnNewLine = false,
1681
+ duration
1682
+ } = visuals;
1683
+ const reducedMotion = useReducedMotion();
1684
+ const durationMs = resolveDuration(duration);
1685
+ React11.useEffect(() => {
1686
+ const timer = setTimeout(() => resolve(RESULT.DISMISSED), durationMs);
1687
+ return () => clearTimeout(timer);
1688
+ }, [resolve, durationMs]);
1689
+ const handleAction = React11.useCallback(
1690
+ () => resolve(RESULT.ACTION),
1691
+ [resolve]
1692
+ );
1693
+ const handleDismiss = React11.useCallback(
1694
+ () => resolve(RESULT.DISMISSED),
1695
+ [resolve]
1696
+ );
1697
+ const hasActions = actionLabel || withDismissAction;
1698
+ const anim = reducedMotion ? REDUCED_MOTION_ANIM : SNACKBAR_ANIM;
1699
+ return /* @__PURE__ */ jsxs(
1700
+ m.div,
1701
+ __spreadProps(__spreadValues({
1702
+ role: "status",
1703
+ "aria-live": "polite",
1704
+ "aria-atomic": "true"
1705
+ }, anim), {
1706
+ className: cn(
1707
+ "flex items-center gap-2",
1708
+ "min-w-72 max-w-142 w-max",
1709
+ "rounded-sm px-4 py-3 shadow-md",
1710
+ "text-m3-inverse-on-surface bg-m3-inverse-surface",
1711
+ actionOnNewLine ? "flex-col items-start" : "flex-row",
1712
+ className,
1713
+ visuals.className
1714
+ ),
1715
+ children: [
1716
+ /* @__PURE__ */ jsx("span", { className: "flex-1 text-sm leading-5 font-normal", children: message }),
1717
+ hasActions && /* @__PURE__ */ jsxs(
1718
+ "div",
1719
+ {
1720
+ className: cn(
1721
+ "flex shrink-0 items-center gap-1",
1722
+ actionOnNewLine && "self-end"
1723
+ ),
1724
+ children: [
1725
+ actionLabel && /* @__PURE__ */ jsx(
1726
+ "button",
1727
+ {
1728
+ type: "button",
1729
+ onClick: handleAction,
1730
+ className: cn(
1731
+ "text-sm font-medium",
1732
+ "px-2 py-1 rounded-sm",
1733
+ "focus-visible:outline-none focus-visible:ring-2",
1734
+ "transition-colors whitespace-nowrap",
1735
+ "text-m3-inverse-primary"
1736
+ ),
1737
+ children: actionLabel
1738
+ }
1739
+ ),
1740
+ withDismissAction && /* @__PURE__ */ jsx(
1741
+ IconButton,
1742
+ {
1743
+ size: "sm",
1744
+ colorStyle: "filled",
1745
+ "aria-label": "Dismiss notification",
1746
+ onClick: handleDismiss,
1747
+ className: "text-m3-inverse-on-surface bg-m3-inverse-surface",
1748
+ children: /* @__PURE__ */ jsx(Icon, { name: "close", "aria-hidden": "true" })
1749
+ }
1750
+ )
1751
+ ]
1752
+ }
1753
+ )
1754
+ ]
1755
+ })
1756
+ );
1757
+ });
1758
+ Snackbar.displayName = "Snackbar";
1759
+ function SnackbarHost({ state, className }) {
1760
+ const { current, _dismiss } = state;
1761
+ const wrappedData = React11.useMemo(() => {
1762
+ if (!current) return null;
1763
+ return __spreadProps(__spreadValues({}, current), { resolve: _dismiss });
1764
+ }, [current, _dismiss]);
1765
+ return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(
1766
+ "section",
1767
+ {
1768
+ "aria-label": "Snackbar notifications",
1769
+ className: cn(
1770
+ "fixed bottom-4 left-1/2 -translate-x-1/2 z-50",
1771
+ "flex flex-col items-center pointer-events-none",
1772
+ className
1773
+ ),
1774
+ children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: wrappedData && /* @__PURE__ */ jsx("div", { className: "pointer-events-auto", children: /* @__PURE__ */ jsx(Snackbar, { data: wrappedData }) }, wrappedData.id) })
1775
+ }
1776
+ ) });
1777
+ }
1778
+ SnackbarHost.displayName = "SnackbarHost";
1779
+ var SnackbarContext = React11.createContext(
1780
+ null
1781
+ );
1782
+
1783
+ // src/ui/typography/type-scale-tokens.ts
1784
+ var font = "'Google Sans Flex', system-ui, sans-serif";
1785
+ var TypeScaleTokens = {
1786
+ // ─── DISPLAY ────────────────────────────────────────────────────────────────
1787
+ DisplayLargeFont: font,
1788
+ DisplayLargeWeight: 400,
1789
+ DisplayLargeSize: "3.571rem",
1790
+ // 57sp → ~57px / 14 = 4.071, MD3 uses 57px on 16px base → 3.5625rem
1791
+ DisplayLargeLineHeight: "4rem",
1792
+ // 64px
1793
+ DisplayLargeTracking: "-0.25px",
1794
+ DisplayMediumFont: font,
1795
+ DisplayMediumWeight: 400,
1796
+ DisplayMediumSize: "2.857rem",
1797
+ // 45px
1798
+ DisplayMediumLineHeight: "3.286rem",
1799
+ // 52px
1800
+ DisplayMediumTracking: "0px",
1801
+ DisplaySmallFont: font,
1802
+ DisplaySmallWeight: 400,
1803
+ DisplaySmallSize: "2.571rem",
1804
+ // 36px
1805
+ DisplaySmallLineHeight: "3.143rem",
1806
+ // 44px
1807
+ DisplaySmallTracking: "0px",
1808
+ // ─── HEADLINE ───────────────────────────────────────────────────────────────
1809
+ HeadlineLargeFont: font,
1810
+ HeadlineLargeWeight: 400,
1811
+ HeadlineLargeSize: "2.286rem",
1812
+ // 32px
1813
+ HeadlineLargeLineHeight: "2.857rem",
1814
+ // 40px
1815
+ HeadlineLargeTracking: "0px",
1816
+ HeadlineMediumFont: font,
1817
+ HeadlineMediumWeight: 400,
1818
+ HeadlineMediumSize: "2rem",
1819
+ // 28px
1820
+ HeadlineMediumLineHeight: "2.571rem",
1821
+ // 36px
1822
+ HeadlineMediumTracking: "0px",
1823
+ HeadlineSmallFont: font,
1824
+ HeadlineSmallWeight: 400,
1825
+ HeadlineSmallSize: "1.714rem",
1826
+ // 24px
1827
+ HeadlineSmallLineHeight: "2.286rem",
1828
+ // 32px
1829
+ HeadlineSmallTracking: "0px",
1830
+ // ─── TITLE ──────────────────────────────────────────────────────────────────
1831
+ TitleLargeFont: font,
1832
+ TitleLargeWeight: 400,
1833
+ TitleLargeSize: "1.571rem",
1834
+ // 22px
1835
+ TitleLargeLineHeight: "2rem",
1836
+ // 28px
1837
+ TitleLargeTracking: "0px",
1838
+ TitleMediumFont: font,
1839
+ TitleMediumWeight: 500,
1840
+ TitleMediumSize: "1.143rem",
1841
+ // 16px
1842
+ TitleMediumLineHeight: "1.714rem",
1843
+ // 24px
1844
+ TitleMediumTracking: "0.15px",
1845
+ TitleSmallFont: font,
1846
+ TitleSmallWeight: 500,
1847
+ TitleSmallSize: "1rem",
1848
+ // 14px
1849
+ TitleSmallLineHeight: "1.429rem",
1850
+ // 20px
1851
+ TitleSmallTracking: "0.1px",
1852
+ // ─── BODY ───────────────────────────────────────────────────────────────────
1853
+ BodyLargeFont: font,
1854
+ BodyLargeWeight: 400,
1855
+ BodyLargeSize: "1.143rem",
1856
+ // 16px
1857
+ BodyLargeLineHeight: "1.714rem",
1858
+ // 24px
1859
+ BodyLargeTracking: "0.5px",
1860
+ BodyMediumFont: font,
1861
+ BodyMediumWeight: 400,
1862
+ BodyMediumSize: "1rem",
1863
+ // 14px
1864
+ BodyMediumLineHeight: "1.429rem",
1865
+ // 20px
1866
+ BodyMediumTracking: "0.25px",
1867
+ BodySmallFont: font,
1868
+ BodySmallWeight: 400,
1869
+ BodySmallSize: "0.857rem",
1870
+ // 12px
1871
+ BodySmallLineHeight: "1.143rem",
1872
+ // 16px
1873
+ BodySmallTracking: "0.4px",
1874
+ // ─── LABEL ──────────────────────────────────────────────────────────────────
1875
+ LabelLargeFont: font,
1876
+ LabelLargeWeight: 500,
1877
+ LabelLargeSize: "1rem",
1878
+ // 14px
1879
+ LabelLargeLineHeight: "1.429rem",
1880
+ // 20px
1881
+ LabelLargeTracking: "0.1px",
1882
+ LabelMediumFont: font,
1883
+ LabelMediumWeight: 500,
1884
+ LabelMediumSize: "0.857rem",
1885
+ // 12px
1886
+ LabelMediumLineHeight: "1.143rem",
1887
+ // 16px
1888
+ LabelMediumTracking: "0.5px",
1889
+ LabelSmallFont: font,
1890
+ LabelSmallWeight: 500,
1891
+ LabelSmallSize: "0.786rem",
1892
+ // 11px
1893
+ LabelSmallLineHeight: "1.143rem",
1894
+ // 16px
1895
+ LabelSmallTracking: "0.5px",
1896
+ // ─── EMPHASIZED (MD3 Expressive) ────────────────────────────────────────────
1897
+ // Emphasized styles share Font/Size/LineHeight/Tracking with baseline.
1898
+ // Only fontWeight is elevated to create visual emphasis.
1899
+ // Source: TypographyTokens.kt (Emphasized entries reference same scale)
1900
+ DisplayLargeEmphasizedFont: font,
1901
+ DisplayLargeEmphasizedWeight: 800,
1902
+ DisplayLargeEmphasizedSize: "3.571rem",
1903
+ DisplayLargeEmphasizedLineHeight: "4rem",
1904
+ DisplayLargeEmphasizedTracking: "-0.25px",
1905
+ DisplayMediumEmphasizedFont: font,
1906
+ DisplayMediumEmphasizedWeight: 800,
1907
+ DisplayMediumEmphasizedSize: "2.857rem",
1908
+ DisplayMediumEmphasizedLineHeight: "3.286rem",
1909
+ DisplayMediumEmphasizedTracking: "0px",
1910
+ DisplaySmallEmphasizedFont: font,
1911
+ DisplaySmallEmphasizedWeight: 800,
1912
+ DisplaySmallEmphasizedSize: "2.571rem",
1913
+ DisplaySmallEmphasizedLineHeight: "3.143rem",
1914
+ DisplaySmallEmphasizedTracking: "0px",
1915
+ HeadlineLargeEmphasizedFont: font,
1916
+ HeadlineLargeEmphasizedWeight: 800,
1917
+ HeadlineLargeEmphasizedSize: "2.286rem",
1918
+ HeadlineLargeEmphasizedLineHeight: "2.857rem",
1919
+ HeadlineLargeEmphasizedTracking: "0px",
1920
+ HeadlineMediumEmphasizedFont: font,
1921
+ HeadlineMediumEmphasizedWeight: 800,
1922
+ HeadlineMediumEmphasizedSize: "2rem",
1923
+ HeadlineMediumEmphasizedLineHeight: "2.571rem",
1924
+ HeadlineMediumEmphasizedTracking: "0px",
1925
+ HeadlineSmallEmphasizedFont: font,
1926
+ HeadlineSmallEmphasizedWeight: 800,
1927
+ HeadlineSmallEmphasizedSize: "1.714rem",
1928
+ HeadlineSmallEmphasizedLineHeight: "2.286rem",
1929
+ HeadlineSmallEmphasizedTracking: "0px",
1930
+ TitleLargeEmphasizedFont: font,
1931
+ TitleLargeEmphasizedWeight: 700,
1932
+ TitleLargeEmphasizedSize: "1.571rem",
1933
+ TitleLargeEmphasizedLineHeight: "2rem",
1934
+ TitleLargeEmphasizedTracking: "0px",
1935
+ TitleMediumEmphasizedFont: font,
1936
+ TitleMediumEmphasizedWeight: 700,
1937
+ TitleMediumEmphasizedSize: "1.143rem",
1938
+ TitleMediumEmphasizedLineHeight: "1.714rem",
1939
+ TitleMediumEmphasizedTracking: "0.15px",
1940
+ TitleSmallEmphasizedFont: font,
1941
+ TitleSmallEmphasizedWeight: 700,
1942
+ TitleSmallEmphasizedSize: "1rem",
1943
+ TitleSmallEmphasizedLineHeight: "1.429rem",
1944
+ TitleSmallEmphasizedTracking: "0.1px",
1945
+ BodyLargeEmphasizedFont: font,
1946
+ BodyLargeEmphasizedWeight: 700,
1947
+ BodyLargeEmphasizedSize: "1.143rem",
1948
+ BodyLargeEmphasizedLineHeight: "1.714rem",
1949
+ BodyLargeEmphasizedTracking: "0.5px",
1950
+ BodyMediumEmphasizedFont: font,
1951
+ BodyMediumEmphasizedWeight: 700,
1952
+ BodyMediumEmphasizedSize: "1rem",
1953
+ BodyMediumEmphasizedLineHeight: "1.429rem",
1954
+ BodyMediumEmphasizedTracking: "0.25px",
1955
+ BodySmallEmphasizedFont: font,
1956
+ BodySmallEmphasizedWeight: 700,
1957
+ BodySmallEmphasizedSize: "0.857rem",
1958
+ BodySmallEmphasizedLineHeight: "1.143rem",
1959
+ BodySmallEmphasizedTracking: "0.4px",
1960
+ LabelLargeEmphasizedFont: font,
1961
+ LabelLargeEmphasizedWeight: 800,
1962
+ LabelLargeEmphasizedSize: "1rem",
1963
+ LabelLargeEmphasizedLineHeight: "1.429rem",
1964
+ LabelLargeEmphasizedTracking: "0.1px",
1965
+ LabelMediumEmphasizedFont: font,
1966
+ LabelMediumEmphasizedWeight: 800,
1967
+ LabelMediumEmphasizedSize: "0.857rem",
1968
+ LabelMediumEmphasizedLineHeight: "1.143rem",
1969
+ LabelMediumEmphasizedTracking: "0.5px",
1970
+ LabelSmallEmphasizedFont: font,
1971
+ LabelSmallEmphasizedWeight: 800,
1972
+ LabelSmallEmphasizedSize: "0.786rem",
1973
+ LabelSmallEmphasizedLineHeight: "1.143rem",
1974
+ LabelSmallEmphasizedTracking: "0.5px"
1975
+ };
1976
+
1977
+ // src/ui/typography/typography-tokens.ts
1978
+ var DEFAULT_FONT_VARIATION_AXES = Object.freeze({ ROND: 100 });
1979
+ function serializeFontVariationAxes(axes) {
1980
+ return Object.entries(axes).filter(([, v]) => v !== void 0).map(([k, v]) => `"${k}" ${v}`).join(", ");
1981
+ }
1982
+ var MD3_EXPRESSIVE_FONT_VARIATION = serializeFontVariationAxes(
1983
+ DEFAULT_FONT_VARIATION_AXES
1984
+ );
1985
+ function buildStyle(prefix, fontFamily, fontVariationSettings) {
1986
+ const t = TypeScaleTokens;
1987
+ return Object.freeze({
1988
+ fontFamily: fontFamily != null ? fontFamily : t[`${prefix}Font`],
1989
+ fontWeight: t[`${prefix}Weight`],
1990
+ fontSize: t[`${prefix}Size`],
1991
+ lineHeight: t[`${prefix}LineHeight`],
1992
+ letterSpacing: t[`${prefix}Tracking`],
1993
+ fontVariationSettings
1994
+ });
1995
+ }
1996
+ var _fontFamily, _fontVariationSettings, _cache, _TypographyTokens_instances, get_fn;
1997
+ var TypographyTokens = class {
1998
+ constructor(options = {}) {
1999
+ __privateAdd(this, _TypographyTokens_instances);
2000
+ __privateAdd(this, _fontFamily);
2001
+ __privateAdd(this, _fontVariationSettings);
2002
+ // Helper to lazily build + cache a style on first access
2003
+ __privateAdd(this, _cache, /* @__PURE__ */ new Map());
2004
+ if (typeof options === "string") {
2005
+ __privateSet(this, _fontFamily, options);
2006
+ __privateSet(this, _fontVariationSettings, MD3_EXPRESSIVE_FONT_VARIATION);
2007
+ } else {
2008
+ __privateSet(this, _fontFamily, options.fontFamily);
2009
+ const axes = options.fontVariationAxes ? __spreadValues(__spreadValues({}, DEFAULT_FONT_VARIATION_AXES), options.fontVariationAxes) : DEFAULT_FONT_VARIATION_AXES;
2010
+ __privateSet(this, _fontVariationSettings, serializeFontVariationAxes(axes));
2011
+ }
2012
+ }
2013
+ // ─── Baseline Styles (15) ──────────────────────────────────────────────────
2014
+ /** Display Large – `57px`, weight 400 */
2015
+ get DisplayLarge() {
2016
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "DisplayLarge");
2017
+ }
2018
+ /** Display Medium – `45px`, weight 400 */
2019
+ get DisplayMedium() {
2020
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "DisplayMedium");
2021
+ }
2022
+ /** Display Small – `36px`, weight 400 */
2023
+ get DisplaySmall() {
2024
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "DisplaySmall");
2025
+ }
2026
+ /** Headline Large – `32px`, weight 400 */
2027
+ get HeadlineLarge() {
2028
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "HeadlineLarge");
2029
+ }
2030
+ /** Headline Medium – `28px`, weight 400 */
2031
+ get HeadlineMedium() {
2032
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "HeadlineMedium");
2033
+ }
2034
+ /** Headline Small – `24px`, weight 400 */
2035
+ get HeadlineSmall() {
2036
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "HeadlineSmall");
2037
+ }
2038
+ /** Title Large – `22px`, weight 400 */
2039
+ get TitleLarge() {
2040
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "TitleLarge");
2041
+ }
2042
+ /** Title Medium – `16px`, weight 500 */
2043
+ get TitleMedium() {
2044
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "TitleMedium");
2045
+ }
2046
+ /** Title Small – `14px`, weight 500 */
2047
+ get TitleSmall() {
2048
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "TitleSmall");
2049
+ }
2050
+ /** Body Large – `16px`, weight 400 */
2051
+ get BodyLarge() {
2052
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "BodyLarge");
2053
+ }
2054
+ /** Body Medium – `14px`, weight 400 */
2055
+ get BodyMedium() {
2056
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "BodyMedium");
2057
+ }
2058
+ /** Body Small – `12px`, weight 400 */
2059
+ get BodySmall() {
2060
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "BodySmall");
2061
+ }
2062
+ /** Label Large – `14px`, weight 500 */
2063
+ get LabelLarge() {
2064
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "LabelLarge");
2065
+ }
2066
+ /** Label Medium – `12px`, weight 500 */
2067
+ get LabelMedium() {
2068
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "LabelMedium");
2069
+ }
2070
+ /** Label Small – `11px`, weight 500 */
2071
+ get LabelSmall() {
2072
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "LabelSmall");
2073
+ }
2074
+ // ─── Emphasized Styles (15) – MD3 Expressive ──────────────────────────────
2075
+ /** Display Large Emphasized – `57px`, weight 800 */
2076
+ get DisplayLargeEmphasized() {
2077
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "DisplayLargeEmphasized");
2078
+ }
2079
+ /** Display Medium Emphasized – `45px`, weight 800 */
2080
+ get DisplayMediumEmphasized() {
2081
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "DisplayMediumEmphasized");
2082
+ }
2083
+ /** Display Small Emphasized – `36px`, weight 800 */
2084
+ get DisplaySmallEmphasized() {
2085
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "DisplaySmallEmphasized");
2086
+ }
2087
+ /** Headline Large Emphasized – `32px`, weight 800 */
2088
+ get HeadlineLargeEmphasized() {
2089
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "HeadlineLargeEmphasized");
2090
+ }
2091
+ /** Headline Medium Emphasized – `28px`, weight 800 */
2092
+ get HeadlineMediumEmphasized() {
2093
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "HeadlineMediumEmphasized");
2094
+ }
2095
+ /** Headline Small Emphasized – `24px`, weight 800 */
2096
+ get HeadlineSmallEmphasized() {
2097
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "HeadlineSmallEmphasized");
2098
+ }
2099
+ /** Title Large Emphasized – `22px`, weight 700 */
2100
+ get TitleLargeEmphasized() {
2101
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "TitleLargeEmphasized");
2102
+ }
2103
+ /** Title Medium Emphasized – `16px`, weight 700 */
2104
+ get TitleMediumEmphasized() {
2105
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "TitleMediumEmphasized");
2106
+ }
2107
+ /** Title Small Emphasized – `14px`, weight 700 */
2108
+ get TitleSmallEmphasized() {
2109
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "TitleSmallEmphasized");
2110
+ }
2111
+ /** Body Large Emphasized – `16px`, weight 700 */
2112
+ get BodyLargeEmphasized() {
2113
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "BodyLargeEmphasized");
2114
+ }
2115
+ /** Body Medium Emphasized – `14px`, weight 700 */
2116
+ get BodyMediumEmphasized() {
2117
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "BodyMediumEmphasized");
2118
+ }
2119
+ /** Body Small Emphasized – `12px`, weight 700 */
2120
+ get BodySmallEmphasized() {
2121
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "BodySmallEmphasized");
2122
+ }
2123
+ /** Label Large Emphasized – `14px`, weight 800 */
2124
+ get LabelLargeEmphasized() {
2125
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "LabelLargeEmphasized");
2126
+ }
2127
+ /** Label Medium Emphasized – `12px`, weight 800 */
2128
+ get LabelMediumEmphasized() {
2129
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "LabelMediumEmphasized");
2130
+ }
2131
+ /** Label Small Emphasized – `11px`, weight 800 */
2132
+ get LabelSmallEmphasized() {
2133
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "LabelSmallEmphasized");
2134
+ }
2135
+ };
2136
+ _fontFamily = new WeakMap();
2137
+ _fontVariationSettings = new WeakMap();
2138
+ _cache = new WeakMap();
2139
+ _TypographyTokens_instances = new WeakSet();
2140
+ get_fn = function(prefix) {
2141
+ let style = __privateGet(this, _cache).get(prefix);
2142
+ if (!style) {
2143
+ style = buildStyle(prefix, __privateGet(this, _fontFamily), __privateGet(this, _fontVariationSettings));
2144
+ __privateGet(this, _cache).set(prefix, style);
2145
+ }
2146
+ return style;
2147
+ };
2148
+ var _tokens;
2149
+ var Typography = class {
2150
+ constructor(tokens = defaultTokens) {
2151
+ __privateAdd(this, _tokens);
2152
+ __privateSet(this, _tokens, tokens);
2153
+ }
2154
+ // ─── Baseline Styles ────────────────────────────────────────────────────────
2155
+ /** Display Large text style (`57px`, weight `400`). */
2156
+ get displayLarge() {
2157
+ return __privateGet(this, _tokens).DisplayLarge;
2158
+ }
2159
+ /** Display Medium text style (`45px`, weight `400`). */
2160
+ get displayMedium() {
2161
+ return __privateGet(this, _tokens).DisplayMedium;
2162
+ }
2163
+ /** Display Small text style (`36px`, weight `400`). */
2164
+ get displaySmall() {
2165
+ return __privateGet(this, _tokens).DisplaySmall;
2166
+ }
2167
+ /** Headline Large text style (`32px`, weight `400`). */
2168
+ get headlineLarge() {
2169
+ return __privateGet(this, _tokens).HeadlineLarge;
2170
+ }
2171
+ /** Headline Medium text style (`28px`, weight `400`). */
2172
+ get headlineMedium() {
2173
+ return __privateGet(this, _tokens).HeadlineMedium;
2174
+ }
2175
+ /** Headline Small text style (`24px`, weight `400`). */
2176
+ get headlineSmall() {
2177
+ return __privateGet(this, _tokens).HeadlineSmall;
2178
+ }
2179
+ /** Title Large text style (`22px`, weight `400`). */
2180
+ get titleLarge() {
2181
+ return __privateGet(this, _tokens).TitleLarge;
2182
+ }
2183
+ /** Title Medium text style (`16px`, weight `500`). */
2184
+ get titleMedium() {
2185
+ return __privateGet(this, _tokens).TitleMedium;
2186
+ }
2187
+ /** Title Small text style (`14px`, weight `500`). */
2188
+ get titleSmall() {
2189
+ return __privateGet(this, _tokens).TitleSmall;
2190
+ }
2191
+ /** Body Large text style (`16px`, weight `400`). */
2192
+ get bodyLarge() {
2193
+ return __privateGet(this, _tokens).BodyLarge;
2194
+ }
2195
+ /** Body Medium text style (`14px`, weight `400`). */
2196
+ get bodyMedium() {
2197
+ return __privateGet(this, _tokens).BodyMedium;
2198
+ }
2199
+ /** Body Small text style (`12px`, weight `400`). */
2200
+ get bodySmall() {
2201
+ return __privateGet(this, _tokens).BodySmall;
2202
+ }
2203
+ /** Label Large text style (`14px`, weight `500`). */
2204
+ get labelLarge() {
2205
+ return __privateGet(this, _tokens).LabelLarge;
2206
+ }
2207
+ /** Label Medium text style (`12px`, weight `500`). */
2208
+ get labelMedium() {
2209
+ return __privateGet(this, _tokens).LabelMedium;
2210
+ }
2211
+ /** Label Small text style (`11px`, weight `500`). */
2212
+ get labelSmall() {
2213
+ return __privateGet(this, _tokens).LabelSmall;
2214
+ }
2215
+ // ─── Emphasized Styles (MD3 Expressive) ─────────────────────────────────────
2216
+ /** Display Large Emphasized text style (`57px`, weight `800`). */
2217
+ get displayLargeEmphasized() {
2218
+ return __privateGet(this, _tokens).DisplayLargeEmphasized;
2219
+ }
2220
+ /** Display Medium Emphasized text style (`45px`, weight `800`). */
2221
+ get displayMediumEmphasized() {
2222
+ return __privateGet(this, _tokens).DisplayMediumEmphasized;
2223
+ }
2224
+ /** Display Small Emphasized text style (`36px`, weight `800`). */
2225
+ get displaySmallEmphasized() {
2226
+ return __privateGet(this, _tokens).DisplaySmallEmphasized;
2227
+ }
2228
+ /** Headline Large Emphasized text style (`32px`, weight `800`). */
2229
+ get headlineLargeEmphasized() {
2230
+ return __privateGet(this, _tokens).HeadlineLargeEmphasized;
2231
+ }
2232
+ /** Headline Medium Emphasized text style (`28px`, weight `800`). */
2233
+ get headlineMediumEmphasized() {
2234
+ return __privateGet(this, _tokens).HeadlineMediumEmphasized;
2235
+ }
2236
+ /** Headline Small Emphasized text style (`24px`, weight `800`). */
2237
+ get headlineSmallEmphasized() {
2238
+ return __privateGet(this, _tokens).HeadlineSmallEmphasized;
2239
+ }
2240
+ /** Title Large Emphasized text style (`22px`, weight `700`). */
2241
+ get titleLargeEmphasized() {
2242
+ return __privateGet(this, _tokens).TitleLargeEmphasized;
2243
+ }
2244
+ /** Title Medium Emphasized text style (`16px`, weight `700`). */
2245
+ get titleMediumEmphasized() {
2246
+ return __privateGet(this, _tokens).TitleMediumEmphasized;
2247
+ }
2248
+ /** Title Small Emphasized text style (`14px`, weight `700`). */
2249
+ get titleSmallEmphasized() {
2250
+ return __privateGet(this, _tokens).TitleSmallEmphasized;
2251
+ }
2252
+ /** Body Large Emphasized text style (`16px`, weight `700`). */
2253
+ get bodyLargeEmphasized() {
2254
+ return __privateGet(this, _tokens).BodyLargeEmphasized;
2255
+ }
2256
+ /** Body Medium Emphasized text style (`14px`, weight `700`). */
2257
+ get bodyMediumEmphasized() {
2258
+ return __privateGet(this, _tokens).BodyMediumEmphasized;
2259
+ }
2260
+ /** Body Small Emphasized text style (`12px`, weight `700`). */
2261
+ get bodySmallEmphasized() {
2262
+ return __privateGet(this, _tokens).BodySmallEmphasized;
2263
+ }
2264
+ /** Label Large Emphasized text style (`14px`, weight `800`). */
2265
+ get labelLargeEmphasized() {
2266
+ return __privateGet(this, _tokens).LabelLargeEmphasized;
2267
+ }
2268
+ /** Label Medium Emphasized text style (`12px`, weight `800`). */
2269
+ get labelMediumEmphasized() {
2270
+ return __privateGet(this, _tokens).LabelMediumEmphasized;
2271
+ }
2272
+ /** Label Small Emphasized text style (`11px`, weight `800`). */
2273
+ get labelSmallEmphasized() {
2274
+ return __privateGet(this, _tokens).LabelSmallEmphasized;
2275
+ }
2276
+ // ─── Methods ─────────────────────────────────────────────────────────────────
2277
+ /**
2278
+ * Returns the `TextStyle` corresponding to the given {@link TypographyKeyTokens}.
2279
+ *
2280
+ * Port of `internal fun Typography.fromToken(value: TypographyKeyTokens): TextStyle`.
2281
+ *
2282
+ * @example
2283
+ * ```ts
2284
+ * const style = typography.fromToken(TypographyKeyTokens.BodyLarge);
2285
+ * ```
2286
+ */
2287
+ fromToken(value) {
2288
+ return this[TOKEN_TO_PROP[value]];
2289
+ }
2290
+ /**
2291
+ * Creates a new `Typography` instance with the specified property overrides
2292
+ * merged on top of the current instance's styles.
2293
+ *
2294
+ * Port of Compose's `fun Typography.copy(...)`.
2295
+ *
2296
+ * Unlike a shallow `Object.assign`, this method preserves the lazy-getter
2297
+ * architecture — overridden styles are stored separately and looked up first
2298
+ * on each property access, while non-overridden styles continue to be
2299
+ * resolved from the underlying {@link TypographyTokens}.
2300
+ *
2301
+ * @param overrides - Map of camelCase property names to partial `TextStyle` overrides.
2302
+ * @returns A new `Typography` instance. The original is never mutated.
2303
+ *
2304
+ * @example
2305
+ * ```ts
2306
+ * const custom = typography.copy({ bodyLarge: { fontSize: "2rem" } });
2307
+ * custom.bodyLarge.fontSize; // "2rem"
2308
+ * custom.bodySmall.fontSize; // original token value — untouched
2309
+ * ```
2310
+ */
2311
+ copy(overrides) {
2312
+ return new OverriddenTypography(__privateGet(this, _tokens), this, overrides);
2313
+ }
2314
+ };
2315
+ _tokens = new WeakMap();
2316
+ var _base, _overrides, _OverriddenTypography_instances, resolve_fn;
2317
+ var OverriddenTypography = class extends Typography {
2318
+ constructor(tokens, base, overrides) {
2319
+ super(tokens);
2320
+ __privateAdd(this, _OverriddenTypography_instances);
2321
+ __privateAdd(this, _base);
2322
+ __privateAdd(this, _overrides);
2323
+ __privateSet(this, _base, base);
2324
+ __privateSet(this, _overrides, overrides);
2325
+ }
2326
+ // ─── Baseline
2327
+ get displayLarge() {
2328
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "displayLarge");
2329
+ }
2330
+ get displayMedium() {
2331
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "displayMedium");
2332
+ }
2333
+ get displaySmall() {
2334
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "displaySmall");
2335
+ }
2336
+ get headlineLarge() {
2337
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "headlineLarge");
2338
+ }
2339
+ get headlineMedium() {
2340
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "headlineMedium");
2341
+ }
2342
+ get headlineSmall() {
2343
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "headlineSmall");
2344
+ }
2345
+ get titleLarge() {
2346
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "titleLarge");
2347
+ }
2348
+ get titleMedium() {
2349
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "titleMedium");
2350
+ }
2351
+ get titleSmall() {
2352
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "titleSmall");
2353
+ }
2354
+ get bodyLarge() {
2355
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "bodyLarge");
2356
+ }
2357
+ get bodyMedium() {
2358
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "bodyMedium");
2359
+ }
2360
+ get bodySmall() {
2361
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "bodySmall");
2362
+ }
2363
+ get labelLarge() {
2364
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "labelLarge");
2365
+ }
2366
+ get labelMedium() {
2367
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "labelMedium");
2368
+ }
2369
+ get labelSmall() {
2370
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "labelSmall");
2371
+ }
2372
+ // ─── Emphasized
2373
+ get displayLargeEmphasized() {
2374
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "displayLargeEmphasized");
2375
+ }
2376
+ get displayMediumEmphasized() {
2377
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "displayMediumEmphasized");
2378
+ }
2379
+ get displaySmallEmphasized() {
2380
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "displaySmallEmphasized");
2381
+ }
2382
+ get headlineLargeEmphasized() {
2383
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "headlineLargeEmphasized");
2384
+ }
2385
+ get headlineMediumEmphasized() {
2386
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "headlineMediumEmphasized");
2387
+ }
2388
+ get headlineSmallEmphasized() {
2389
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "headlineSmallEmphasized");
2390
+ }
2391
+ get titleLargeEmphasized() {
2392
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "titleLargeEmphasized");
2393
+ }
2394
+ get titleMediumEmphasized() {
2395
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "titleMediumEmphasized");
2396
+ }
2397
+ get titleSmallEmphasized() {
2398
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "titleSmallEmphasized");
2399
+ }
2400
+ get bodyLargeEmphasized() {
2401
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "bodyLargeEmphasized");
2402
+ }
2403
+ get bodyMediumEmphasized() {
2404
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "bodyMediumEmphasized");
2405
+ }
2406
+ get bodySmallEmphasized() {
2407
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "bodySmallEmphasized");
2408
+ }
2409
+ get labelLargeEmphasized() {
2410
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "labelLargeEmphasized");
2411
+ }
2412
+ get labelMediumEmphasized() {
2413
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "labelMediumEmphasized");
2414
+ }
2415
+ get labelSmallEmphasized() {
2416
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "labelSmallEmphasized");
2417
+ }
2418
+ };
2419
+ _base = new WeakMap();
2420
+ _overrides = new WeakMap();
2421
+ _OverriddenTypography_instances = new WeakSet();
2422
+ resolve_fn = function(key) {
2423
+ const override = __privateGet(this, _overrides)[key];
2424
+ const base = __privateGet(this, _base)[key];
2425
+ return override ? __spreadValues(__spreadValues({}, base), override) : base;
2426
+ };
2427
+ var TOKEN_TO_PROP = {
2428
+ ["DisplayLarge" /* DisplayLarge */]: "displayLarge",
2429
+ ["DisplayMedium" /* DisplayMedium */]: "displayMedium",
2430
+ ["DisplaySmall" /* DisplaySmall */]: "displaySmall",
2431
+ ["HeadlineLarge" /* HeadlineLarge */]: "headlineLarge",
2432
+ ["HeadlineMedium" /* HeadlineMedium */]: "headlineMedium",
2433
+ ["HeadlineSmall" /* HeadlineSmall */]: "headlineSmall",
2434
+ ["TitleLarge" /* TitleLarge */]: "titleLarge",
2435
+ ["TitleMedium" /* TitleMedium */]: "titleMedium",
2436
+ ["TitleSmall" /* TitleSmall */]: "titleSmall",
2437
+ ["BodyLarge" /* BodyLarge */]: "bodyLarge",
2438
+ ["BodyMedium" /* BodyMedium */]: "bodyMedium",
2439
+ ["BodySmall" /* BodySmall */]: "bodySmall",
2440
+ ["LabelLarge" /* LabelLarge */]: "labelLarge",
2441
+ ["LabelMedium" /* LabelMedium */]: "labelMedium",
2442
+ ["LabelSmall" /* LabelSmall */]: "labelSmall",
2443
+ ["DisplayLargeEmphasized" /* DisplayLargeEmphasized */]: "displayLargeEmphasized",
2444
+ ["DisplayMediumEmphasized" /* DisplayMediumEmphasized */]: "displayMediumEmphasized",
2445
+ ["DisplaySmallEmphasized" /* DisplaySmallEmphasized */]: "displaySmallEmphasized",
2446
+ ["HeadlineLargeEmphasized" /* HeadlineLargeEmphasized */]: "headlineLargeEmphasized",
2447
+ ["HeadlineMediumEmphasized" /* HeadlineMediumEmphasized */]: "headlineMediumEmphasized",
2448
+ ["HeadlineSmallEmphasized" /* HeadlineSmallEmphasized */]: "headlineSmallEmphasized",
2449
+ ["TitleLargeEmphasized" /* TitleLargeEmphasized */]: "titleLargeEmphasized",
2450
+ ["TitleMediumEmphasized" /* TitleMediumEmphasized */]: "titleMediumEmphasized",
2451
+ ["TitleSmallEmphasized" /* TitleSmallEmphasized */]: "titleSmallEmphasized",
2452
+ ["BodyLargeEmphasized" /* BodyLargeEmphasized */]: "bodyLargeEmphasized",
2453
+ ["BodyMediumEmphasized" /* BodyMediumEmphasized */]: "bodyMediumEmphasized",
2454
+ ["BodySmallEmphasized" /* BodySmallEmphasized */]: "bodySmallEmphasized",
2455
+ ["LabelLargeEmphasized" /* LabelLargeEmphasized */]: "labelLargeEmphasized",
2456
+ ["LabelMediumEmphasized" /* LabelMediumEmphasized */]: "labelMediumEmphasized",
2457
+ ["LabelSmallEmphasized" /* LabelSmallEmphasized */]: "labelSmallEmphasized"
2458
+ };
2459
+ var defaultTokens = new TypographyTokens();
2460
+ var defaultTypography = new Typography();
2461
+ var TypographyContext = createContext(defaultTypography);
2462
+ var ThemeContext = createContext(void 0);
2463
+ var STORAGE_KEY_COLOR = "md3-source-color";
2464
+ var STORAGE_KEY_MODE = "md3-theme-mode";
2465
+ var defaultTokens2 = new TypographyTokens();
2466
+ var defaultTypography2 = new Typography(defaultTokens2);
2467
+ function MD3ThemeProvider({
2468
+ children,
2469
+ sourceColor: initialSourceColor = "#6750A4",
2470
+ defaultMode = "light",
2471
+ persistToLocalStorage = false,
2472
+ typography: typographyProp,
2473
+ fontFamily,
2474
+ fontVariationAxes,
2475
+ enableSnackbar = false
2476
+ }) {
2477
+ const [sourceColor, setSourceColor] = useState(initialSourceColor);
2478
+ const [mode, setMode] = useState(defaultMode);
2479
+ const [isHydrated, setIsHydrated] = useState(!persistToLocalStorage);
2480
+ useEffect(() => {
2481
+ if (!persistToLocalStorage) return;
2482
+ const savedColor = localStorage.getItem(STORAGE_KEY_COLOR);
2483
+ const savedMode = localStorage.getItem(
2484
+ STORAGE_KEY_MODE
2485
+ );
2486
+ if (savedColor) setSourceColor(savedColor);
2487
+ if (savedMode === "light" || savedMode === "dark" || savedMode === "system")
2488
+ setMode(savedMode);
2489
+ setIsHydrated(true);
2490
+ }, [persistToLocalStorage]);
2491
+ useEffect(() => {
2492
+ if (!isHydrated) return;
2493
+ applyTheme(sourceColor, mode);
2494
+ if (persistToLocalStorage) {
2495
+ localStorage.setItem(STORAGE_KEY_COLOR, sourceColor);
2496
+ localStorage.setItem(STORAGE_KEY_MODE, mode);
2497
+ }
2498
+ }, [sourceColor, mode, persistToLocalStorage, isHydrated]);
2499
+ useEffect(() => {
2500
+ if (mode !== "system" || typeof window === "undefined") return;
2501
+ const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
2502
+ const handleChange = () => applyTheme(sourceColor, "system");
2503
+ mediaQuery.addEventListener("change", handleChange);
2504
+ return () => mediaQuery.removeEventListener("change", handleChange);
2505
+ }, [mode, sourceColor]);
2506
+ const effectiveMode = resolveMode(mode);
2507
+ const themeValue = useMemo(
2508
+ () => ({ sourceColor, setSourceColor, mode, setMode, effectiveMode }),
2509
+ [sourceColor, mode, effectiveMode]
2510
+ );
2511
+ const typographyValue = useMemo(() => {
2512
+ if (typographyProp) return typographyProp;
2513
+ if (fontFamily != null ? fontFamily : fontVariationAxes) {
2514
+ return new Typography(
2515
+ new TypographyTokens({ fontFamily, fontVariationAxes })
2516
+ );
2517
+ }
2518
+ return defaultTypography2;
2519
+ }, [typographyProp, fontFamily, fontVariationAxes]);
2520
+ return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, children: /* @__PURE__ */ jsx(ThemeContext.Provider, { value: themeValue, children: /* @__PURE__ */ jsx(TypographyContext.Provider, { value: typographyValue, children: enableSnackbar ? /* @__PURE__ */ jsx(SnackbarMountedProvider, { children }) : children }) }) });
2521
+ }
2522
+ function SnackbarMountedProvider({ children }) {
2523
+ const state = useSnackbarState();
2524
+ const contextValue = useMemo(
2525
+ () => ({ showSnackbar: state.showSnackbar }),
2526
+ [state.showSnackbar]
2527
+ );
2528
+ return /* @__PURE__ */ jsxs(SnackbarContext.Provider, { value: contextValue, children: [
2529
+ children,
2530
+ /* @__PURE__ */ jsx(SnackbarHost, { state })
2531
+ ] });
2532
+ }
2533
+ function useTheme() {
2534
+ const context = useContext(ThemeContext);
2535
+ if (!context) {
2536
+ throw new Error("useTheme must be used within <MD3ThemeProvider>.");
2537
+ }
2538
+ return context;
2539
+ }
2540
+ function useThemeMode() {
2541
+ const { mode, setMode, effectiveMode } = useTheme();
2542
+ return { mode, setMode, effectiveMode };
2543
+ }
2544
+
2545
+ export { Icon, MD3ThemeProvider, MaterialSymbolsPreconnect, Ripple, applyTheme, cn, generateM3Theme, resolveMode, useRipple as useDOMRipple, useMediaQuery, useRipple2 as useRipple, useRippleState, useTheme, useThemeMode };
2546
+ //# sourceMappingURL=core.mjs.map
2547
+ //# sourceMappingURL=core.mjs.map