@stacksjs/components 0.2.198 → 0.2.200

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 (2) hide show
  1. package/dist/index.js +15 -4260
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -1,4264 +1,19 @@
1
1
  // @bun
2
- // ../../../../../../../tmp/stx-components-build-9EKJph/stubs/stub-0.js
3
- var stub_0_default = { __stx: true, src: "./components/CodeBlock.stx" };
4
- // ../../../../../../../tmp/stx-components-build-9EKJph/stubs/stub-1.js
5
- var stub_1_default = { __stx: true, src: "./components/Footer.stx" };
6
- // ../../../../../../../tmp/stx-components-build-9EKJph/stubs/stub-2.js
7
- var stub_2_default = { __stx: true, src: "./components/Hero.stx" };
8
- // ../../../../../../../tmp/stx-components-build-9EKJph/stubs/stub-3.js
9
- var stub_3_default = { __stx: true, src: "./components/Installation.stx" };
10
- // src/composables/useCopyCode.ts
11
- function useCopyCode(options) {
12
- const { code, onSuccess, onError, timeout = 2000 } = options;
13
- let copied = false;
14
- let timeoutId = null;
15
- const reset = () => {
16
- copied = false;
17
- if (timeoutId) {
18
- clearTimeout(timeoutId);
19
- timeoutId = null;
20
- }
21
- };
22
- const copy = async () => {
23
- try {
24
- if (!navigator.clipboard) {
25
- throw new Error("Clipboard API not available");
26
- }
27
- await navigator.clipboard.writeText(code);
28
- copied = true;
29
- onSuccess?.();
30
- timeoutId = setTimeout(() => {
31
- copied = false;
32
- timeoutId = null;
33
- }, timeout);
34
- } catch (error) {
35
- const err = error instanceof Error ? error : new Error("Failed to copy code");
36
- onError?.(err);
37
- console.error("Failed to copy code:", err);
38
- }
39
- };
40
- return {
41
- copied,
42
- copy,
43
- reset
44
- };
45
- }
46
- async function copyToClipboard(text) {
47
- try {
48
- await navigator.clipboard.writeText(text);
49
- return true;
50
- } catch (error) {
51
- console.error("Failed to copy to clipboard:", error);
52
- return false;
53
- }
54
- }
55
-
56
- // src/composables/useDarkMode.ts
57
- function getSystemTheme() {
58
- if (typeof window === "undefined")
59
- return "light";
60
- return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
61
- }
62
- function getEffectiveTheme(theme) {
63
- return theme === "system" ? getSystemTheme() : theme;
64
- }
65
- function useDarkMode(options = {}) {
66
- const { storageKey = "theme", defaultTheme = "system" } = options;
67
- let theme = defaultTheme;
68
- if (typeof window !== "undefined" && typeof localStorage !== "undefined") {
69
- const stored = localStorage.getItem(storageKey);
70
- if (stored)
71
- theme = stored;
72
- }
73
- const isDark = getEffectiveTheme(theme) === "dark";
74
- const applyTheme = (newTheme) => {
75
- const effective = getEffectiveTheme(newTheme);
76
- if (typeof document !== "undefined") {
77
- if (effective === "dark") {
78
- document.documentElement.classList.add("dark");
79
- } else {
80
- document.documentElement.classList.remove("dark");
81
- }
82
- }
83
- if (typeof localStorage !== "undefined") {
84
- localStorage.setItem(storageKey, newTheme);
85
- }
86
- };
87
- const setTheme = (newTheme) => {
88
- theme = newTheme;
89
- applyTheme(newTheme);
90
- };
91
- const toggle = () => {
92
- const currentEffective = getEffectiveTheme(theme);
93
- const newTheme = currentEffective === "dark" ? "light" : "dark";
94
- setTheme(newTheme);
95
- };
96
- applyTheme(theme);
97
- if (typeof window !== "undefined" && theme === "system") {
98
- window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", (_e) => {
99
- if (theme === "system") {
100
- applyTheme("system");
101
- }
102
- });
103
- }
104
- return {
105
- isDark,
106
- theme,
107
- toggle,
108
- setTheme
109
- };
110
- }
111
-
112
- // src/composables/useSEO.ts
113
- function setTitle(title, template) {
114
- if (typeof document === "undefined")
115
- return;
116
- document.title = template ? template.replace("%s", title) : title;
117
- }
118
- function setMeta(name, content, isProperty = false) {
119
- if (typeof document === "undefined")
120
- return;
121
- const attribute = isProperty ? "property" : "name";
122
- let meta = document.querySelector(`meta[${attribute}="${name}"]`);
123
- if (!meta) {
124
- meta = document.createElement("meta");
125
- meta.setAttribute(attribute, name);
126
- document.head.appendChild(meta);
127
- }
128
- meta.setAttribute("content", content);
129
- }
130
- function setLink(rel, href) {
131
- if (typeof document === "undefined")
132
- return;
133
- let link = document.querySelector(`link[rel="${rel}"]`);
134
- if (!link) {
135
- link = document.createElement("link");
136
- link.setAttribute("rel", rel);
137
- document.head.appendChild(link);
138
- }
139
- link.setAttribute("href", href);
140
- }
141
- function useSEO(options) {
142
- const {
143
- title,
144
- description,
145
- author,
146
- keywords,
147
- ogImage,
148
- ogImageWidth,
149
- ogImageHeight,
150
- twitterCard = "summary_large_image",
151
- twitterSite,
152
- twitterCreator,
153
- canonical
154
- } = options;
155
- if (title) {
156
- setTitle(title);
157
- setMeta("og:title", title, true);
158
- setMeta("twitter:title", title);
159
- }
160
- if (description) {
161
- setMeta("description", description);
162
- setMeta("og:description", description, true);
163
- setMeta("twitter:description", description);
164
- }
165
- if (author) {
166
- setMeta("author", author);
167
- }
168
- if (keywords && keywords.length > 0) {
169
- setMeta("keywords", keywords.join(", "));
170
- }
171
- if (ogImage) {
172
- setMeta("og:image", ogImage, true);
173
- setMeta("twitter:image", ogImage);
174
- }
175
- if (ogImageWidth) {
176
- setMeta("og:image:width", ogImageWidth, true);
177
- }
178
- if (ogImageHeight) {
179
- setMeta("og:image:height", ogImageHeight, true);
180
- }
181
- setMeta("twitter:card", twitterCard);
182
- if (twitterSite) {
183
- setMeta("twitter:site", twitterSite);
184
- }
185
- if (twitterCreator) {
186
- setMeta("twitter:creator", twitterCreator);
187
- }
188
- if (canonical) {
189
- setLink("canonical", canonical);
190
- }
191
- setMeta("og:type", "website", true);
192
- if (typeof window !== "undefined") {
193
- setMeta("og:url", window.location.href, true);
194
- }
195
- }
196
- function generateSEOTags(options) {
197
- const tags = [];
198
- const {
199
- title,
200
- description,
201
- author,
202
- keywords,
203
- ogImage,
204
- ogImageWidth,
205
- ogImageHeight,
206
- twitterCard = "summary_large_image",
207
- twitterSite,
208
- twitterCreator,
209
- canonical
210
- } = options;
211
- if (title) {
212
- tags.push(`<title>${escapeHtml(title)}</title>`);
213
- tags.push(`<meta property="og:title" content="${escapeHtml(title)}" />`);
214
- tags.push(`<meta name="twitter:title" content="${escapeHtml(title)}" />`);
215
- }
216
- if (description) {
217
- tags.push(`<meta name="description" content="${escapeHtml(description)}" />`);
218
- tags.push(`<meta property="og:description" content="${escapeHtml(description)}" />`);
219
- tags.push(`<meta name="twitter:description" content="${escapeHtml(description)}" />`);
220
- }
221
- if (author) {
222
- tags.push(`<meta name="author" content="${escapeHtml(author)}" />`);
223
- }
224
- if (keywords && keywords.length > 0) {
225
- tags.push(`<meta name="keywords" content="${escapeHtml(keywords.join(", "))}" />`);
226
- }
227
- if (ogImage) {
228
- tags.push(`<meta property="og:image" content="${escapeHtml(ogImage)}" />`);
229
- tags.push(`<meta name="twitter:image" content="${escapeHtml(ogImage)}" />`);
230
- }
231
- if (ogImageWidth) {
232
- tags.push(`<meta property="og:image:width" content="${escapeHtml(ogImageWidth)}" />`);
233
- }
234
- if (ogImageHeight) {
235
- tags.push(`<meta property="og:image:height" content="${escapeHtml(ogImageHeight)}" />`);
236
- }
237
- tags.push(`<meta name="twitter:card" content="${escapeHtml(twitterCard)}" />`);
238
- if (twitterSite) {
239
- tags.push(`<meta name="twitter:site" content="${escapeHtml(twitterSite)}" />`);
240
- }
241
- if (twitterCreator) {
242
- tags.push(`<meta name="twitter:creator" content="${escapeHtml(twitterCreator)}" />`);
243
- }
244
- if (canonical) {
245
- tags.push(`<link rel="canonical" href="${escapeHtml(canonical)}" />`);
246
- }
247
- tags.push('<meta property="og:type" content="website" />');
248
- return tags.join(`
249
- `);
250
- }
251
- function escapeHtml(str) {
252
- return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
253
- }
254
-
255
- // src/composables/utilities/useClickOutside.ts
256
- function useClickOutside(elementRef, callback, options = {}) {
257
- const { enabled = true, ignore = [] } = options;
258
- const handleClick = (event) => {
259
- if (!enabled || !elementRef)
260
- return;
261
- const target = event.target;
262
- if (!elementRef.contains(target)) {
263
- const shouldIgnore = ignore.some((selector) => {
264
- const elements = document.querySelectorAll(selector);
265
- return Array.from(elements).some((el) => el.contains(target));
266
- });
267
- if (!shouldIgnore) {
268
- callback(event);
269
- }
270
- }
271
- };
272
- if (typeof document !== "undefined") {
273
- document.addEventListener("mousedown", handleClick);
274
- document.addEventListener("touchstart", handleClick);
275
- }
276
- return () => {
277
- if (typeof document !== "undefined") {
278
- document.removeEventListener("mousedown", handleClick);
279
- document.removeEventListener("touchstart", handleClick);
280
- }
281
- };
282
- }
283
-
284
- // src/composables/utilities/useFocusTrap.ts
285
- function useFocusTrap(containerRef, options = {}) {
286
- const {
287
- enabled = true,
288
- initialFocus = null,
289
- returnFocus = true,
290
- fallbackFocus = null
291
- } = options;
292
- let previouslyFocusedElement = null;
293
- let isActive = false;
294
- function getFocusableElements() {
295
- if (!containerRef)
296
- return [];
297
- const focusableSelectors = [
298
- "a[href]",
299
- "button:not([disabled])",
300
- "textarea:not([disabled])",
301
- "input:not([disabled])",
302
- "select:not([disabled])",
303
- '[tabindex]:not([tabindex="-1"])'
304
- ].join(",");
305
- return Array.from(containerRef.querySelectorAll(focusableSelectors));
306
- }
307
- function handleTab(event) {
308
- if (!enabled || !isActive || !containerRef)
309
- return;
310
- const focusableElements = getFocusableElements();
311
- if (focusableElements.length === 0) {
312
- event.preventDefault();
313
- return;
314
- }
315
- const firstElement = focusableElements[0];
316
- const lastElement = focusableElements[focusableElements.length - 1];
317
- if (event.shiftKey) {
318
- if (document.activeElement === firstElement || document.activeElement === containerRef) {
319
- event.preventDefault();
320
- lastElement.focus();
321
- }
322
- } else {
323
- if (document.activeElement === lastElement) {
324
- event.preventDefault();
325
- firstElement.focus();
326
- }
327
- }
328
- }
329
- function handleEscape(event) {
330
- if (event.key === "Escape" && enabled && isActive) {
331
- deactivate();
332
- }
333
- }
334
- function activate() {
335
- if (!enabled || !containerRef || isActive)
336
- return;
337
- previouslyFocusedElement = document.activeElement;
338
- if (initialFocus) {
339
- initialFocus.focus();
340
- } else {
341
- const focusableElements = getFocusableElements();
342
- if (focusableElements.length > 0) {
343
- focusableElements[0].focus();
344
- } else if (fallbackFocus) {
345
- fallbackFocus.focus();
346
- } else {
347
- containerRef.focus();
348
- }
349
- }
350
- document.addEventListener("keydown", handleTab);
351
- document.addEventListener("keydown", handleEscape);
352
- isActive = true;
353
- }
354
- function deactivate() {
355
- if (!isActive)
356
- return;
357
- document.removeEventListener("keydown", handleTab);
358
- document.removeEventListener("keydown", handleEscape);
359
- if (returnFocus && previouslyFocusedElement) {
360
- previouslyFocusedElement.focus();
361
- }
362
- isActive = false;
363
- }
364
- return { activate, deactivate };
365
- }
366
-
367
- // src/composables/utilities/useKeyboard.ts
368
- function useKeyboard(handlers, options = {}) {
369
- const {
370
- enabled = true,
371
- preventDefault = true,
372
- stopPropagation = false,
373
- target = typeof document !== "undefined" ? document : null
374
- } = options;
375
- const handlerArray = Array.isArray(handlers) ? handlers : [handlers];
376
- const handleKeydown = (event) => {
377
- if (!enabled)
378
- return;
379
- handlerArray.forEach((handler) => {
380
- const keys = Array.isArray(handler.key) ? handler.key : [handler.key];
381
- const keyMatches = keys.some((k) => k.toLowerCase() === event.key.toLowerCase());
382
- if (!keyMatches)
383
- return;
384
- if (handler.ctrl !== undefined && handler.ctrl !== event.ctrlKey)
385
- return;
386
- if (handler.shift !== undefined && handler.shift !== event.shiftKey)
387
- return;
388
- if (handler.alt !== undefined && handler.alt !== event.altKey)
389
- return;
390
- if (handler.meta !== undefined && handler.meta !== event.metaKey)
391
- return;
392
- if (preventDefault)
393
- event.preventDefault();
394
- if (stopPropagation)
395
- event.stopPropagation();
396
- handler.handler(event);
397
- });
398
- };
399
- if (target) {
400
- target.addEventListener("keydown", handleKeydown);
401
- }
402
- return () => {
403
- if (target) {
404
- target.removeEventListener("keydown", handleKeydown);
405
- }
406
- };
407
- }
408
- var KeyboardShortcuts = {
409
- ESCAPE: "Escape",
410
- ENTER: "Enter",
411
- SPACE: " ",
412
- TAB: "Tab",
413
- ARROW_UP: "ArrowUp",
414
- ARROW_DOWN: "ArrowDown",
415
- ARROW_LEFT: "ArrowLeft",
416
- ARROW_RIGHT: "ArrowRight",
417
- HOME: "Home",
418
- END: "End",
419
- PAGE_UP: "PageUp",
420
- PAGE_DOWN: "PageDown"
421
- };
422
-
423
- // src/composables/utilities/useLocalStorage.ts
424
- function useLocalStorage(key, initialValue, options = {}) {
425
- const {
426
- serializer = JSON.stringify,
427
- deserializer = JSON.parse,
428
- onError = console.error
429
- } = options;
430
- let storedValue = initialValue;
431
- try {
432
- if (typeof window !== "undefined") {
433
- const item = window.localStorage.getItem(key);
434
- if (item !== null) {
435
- storedValue = deserializer(item);
436
- }
437
- }
438
- } catch (error) {
439
- onError(error);
440
- }
441
- let value = storedValue;
442
- const listeners = new Set;
443
- function setValue(newValue) {
444
- try {
445
- const valueToStore = typeof newValue === "function" ? newValue(value) : newValue;
446
- value = valueToStore;
447
- if (typeof window !== "undefined") {
448
- window.localStorage.setItem(key, serializer(valueToStore));
449
- }
450
- listeners.forEach((listener) => listener(valueToStore));
451
- } catch (error) {
452
- onError(error);
453
- }
454
- }
455
- function removeValue() {
456
- try {
457
- value = initialValue;
458
- if (typeof window !== "undefined") {
459
- window.localStorage.removeItem(key);
460
- }
461
- listeners.forEach((listener) => listener(initialValue));
462
- } catch (error) {
463
- onError(error);
464
- }
465
- }
466
- if (typeof window !== "undefined") {
467
- const handleStorageChange = (event) => {
468
- if (event.key === key && event.newValue !== null) {
469
- try {
470
- const newValue = deserializer(event.newValue);
471
- value = newValue;
472
- listeners.forEach((listener) => listener(newValue));
473
- } catch (error) {
474
- onError(error);
475
- }
476
- } else if (event.key === key && event.newValue === null) {
477
- value = initialValue;
478
- listeners.forEach((listener) => listener(initialValue));
479
- }
480
- };
481
- window.addEventListener("storage", handleStorageChange);
482
- }
483
- return {
484
- value,
485
- setValue,
486
- removeValue
487
- };
488
- }
489
-
490
- // src/composables/utilities/useMediaQuery.ts
491
- function useMediaQuery(query, options = {}) {
492
- const { defaultValue = false } = options;
493
- let matches = defaultValue;
494
- let mediaQueryList = null;
495
- if (typeof window !== "undefined" && "matchMedia" in window) {
496
- mediaQueryList = window.matchMedia(query);
497
- matches = mediaQueryList.matches;
498
- const handleChange = (event) => {
499
- matches = event.matches;
500
- };
501
- if (mediaQueryList.addEventListener) {
502
- mediaQueryList.addEventListener("change", handleChange);
503
- } else {
504
- mediaQueryList.addListener(handleChange);
505
- }
506
- }
507
- function updateMatches() {
508
- if (mediaQueryList) {
509
- matches = mediaQueryList.matches;
510
- }
511
- }
512
- return { matches, updateMatches };
513
- }
514
- var Breakpoints = {
515
- xs: "(min-width: 320px)",
516
- sm: "(min-width: 640px)",
517
- md: "(min-width: 768px)",
518
- lg: "(min-width: 1024px)",
519
- xl: "(min-width: 1280px)",
520
- "2xl": "(min-width: 1536px)",
521
- mobile: "(max-width: 767px)",
522
- tablet: "(min-width: 768px) and (max-width: 1023px)",
523
- desktop: "(min-width: 1024px)",
524
- dark: "(prefers-color-scheme: dark)",
525
- light: "(prefers-color-scheme: light)",
526
- reducedMotion: "(prefers-reduced-motion: reduce)",
527
- portrait: "(orientation: portrait)",
528
- landscape: "(orientation: landscape)"
529
- };
530
- function useBreakpoint(breakpoint) {
531
- return useMediaQuery(Breakpoints[breakpoint]);
532
- }
533
- function useIsMobile() {
534
- return useMediaQuery(Breakpoints.mobile);
535
- }
536
- function useIsDesktop() {
537
- return useMediaQuery(Breakpoints.desktop);
538
- }
539
- function useIsDarkMode() {
540
- return useMediaQuery(Breakpoints.dark);
541
- }
542
- function usePrefersReducedMotion() {
543
- return useMediaQuery(Breakpoints.reducedMotion);
544
- }
545
- // src/theme/index.ts
546
- var THEMED_FAMILIES = ["gray", "neutral", "slate", "zinc", "red", "green", "yellow", "blue", "indigo"];
547
- var SHADE_VAR_PREFIX = "--stx-color";
548
- function cssVar(name, fallback) {
549
- return fallback === undefined ? `var(${name})` : `var(${name}, ${fallback})`;
550
- }
551
- function stxThemePreset(defaults = {}) {
552
- const palette = {};
553
- for (const family of THEMED_FAMILIES) {
554
- const shades = defaults[family];
555
- if (!shades || typeof shades === "string")
556
- continue;
557
- const themed = {};
558
- for (const [shade, value] of Object.entries(shades))
559
- themed[shade] = cssVar(`${SHADE_VAR_PREFIX}-${family}-${shade}`, value);
560
- palette[family] = themed;
561
- }
562
- return palette;
563
- }
564
- function themeVariableNames(defaults = {}) {
565
- const names = [];
566
- for (const family of THEMED_FAMILIES) {
567
- const shades = defaults[family];
568
- if (!shades || typeof shades === "string")
569
- continue;
570
- for (const shade of Object.keys(shades))
571
- names.push(`${SHADE_VAR_PREFIX}-${family}-${shade}`);
572
- }
573
- return names;
574
- }
575
- // src/ui/accordion/Accordion.stx
576
- var Accordion_default = "./Accordion-8tv78bh9.stx";
577
- // src/ui/accordion/AccordionItem.stx
578
- var AccordionItem_default = "./AccordionItem-7bd3ga36.stx";
579
- // src/ui/audio/Audio.stx
580
- var Audio_default = "./Audio-y0sgq50z.stx";
581
- // src/ui/auth/Login.stx
582
- var Login_default = "./Login-2cp65d41.stx";
583
- // src/ui/auth/Signup.stx
584
- var Signup_default = "./Signup-cbncrtvd.stx";
585
- // src/ui/auth/TwoFactorChallenge.stx
586
- var TwoFactorChallenge_default = "./TwoFactorChallenge-y7n4yrk9.stx";
587
- // src/ui/avatar/Avatar.stx
588
- var Avatar_default = "./Avatar-rjvwnskf.stx";
589
- // src/ui/badge/Badge.stx
590
- var Badge_default = "./Badge-k52qmxcm.stx";
591
- // src/ui/breadcrumb/Breadcrumb.stx
592
- var Breadcrumb_default = "./Breadcrumb-sy5taqsn.stx";
593
- // src/utils/error-handling.ts
594
- import process from "process";
595
- var DOCS_BASE_URL = "https://stacksjs.com/components";
596
-
597
- class ComponentError extends Error {
598
- component;
599
- context;
600
- constructor(component, message, context = {}) {
601
- const fullMessage = ComponentError.formatMessage(component, message, context);
602
- super(fullMessage);
603
- this.name = "ComponentError";
604
- this.component = component;
605
- this.context = { component, ...context };
606
- if (Error.captureStackTrace) {
607
- Error.captureStackTrace(this, ComponentError);
608
- }
609
- }
610
- static formatMessage(component, message, context) {
611
- let formatted = `[${component}] ${message}`;
612
- if (context.prop) {
613
- formatted += `
614
- Prop: "${context.prop}"`;
615
- }
616
- if (context.received !== undefined) {
617
- formatted += `
618
- Received: ${JSON.stringify(context.received)}`;
619
- }
620
- if (context.expected !== undefined) {
621
- const expected = Array.isArray(context.expected) ? context.expected.map((v) => JSON.stringify(v)).join(", ") : JSON.stringify(context.expected);
622
- formatted += `
623
- Expected: ${expected}`;
624
- }
625
- if (context.details) {
626
- formatted += `
627
- Details: ${context.details}`;
628
- }
629
- if (context.docsUrl) {
630
- formatted += `
631
- Documentation: ${context.docsUrl}`;
632
- } else if (component) {
633
- formatted += `
634
- Documentation: ${DOCS_BASE_URL}/${component.toLowerCase()}`;
635
- }
636
- return formatted;
637
- }
638
- toJSON() {
639
- return {
640
- name: this.name,
641
- message: this.message,
642
- component: this.component,
643
- context: this.context,
644
- stack: this.stack
645
- };
646
- }
647
- }
648
- var ErrorTypes = {
649
- invalidProp(component, prop, received, expected) {
650
- return new ComponentError(component, `Invalid prop value for "${prop}"`, {
651
- prop,
652
- received,
653
- expected,
654
- details: Array.isArray(expected) ? `The "${prop}" prop must be one of the allowed values` : `The "${prop}" prop does not match the expected type`
655
- });
656
- },
657
- requiredProp(component, prop) {
658
- return new ComponentError(component, `Required prop "${prop}" is missing`, {
659
- prop,
660
- details: `The "${prop}" prop is required for ${component} to function correctly`
661
- });
662
- },
663
- invalidType(component, prop, received, expected) {
664
- return new ComponentError(component, `Invalid type for prop "${prop}"`, {
665
- prop,
666
- received: typeof received,
667
- expected,
668
- details: `Expected "${prop}" to be of type ${expected}, but received ${typeof received}`
669
- });
670
- },
671
- componentNotFound(componentName) {
672
- return new ComponentError("ComponentLoader", `Component "${componentName}" not found`, {
673
- component: componentName,
674
- details: "Make sure the component is properly imported and registered"
675
- });
676
- },
677
- invalidChildren(component, received, expected) {
678
- return new ComponentError(component, "Invalid children", {
679
- received: typeof received,
680
- expected,
681
- details: `${component} expects ${expected} as children`
682
- });
683
- },
684
- stateUpdate(component, stateName, error) {
685
- return new ComponentError(component, `Failed to update state "${stateName}"`, {
686
- details: error.message
687
- });
688
- },
689
- eventHandler(component, eventName, error) {
690
- return new ComponentError(component, `Error in "${eventName}" event handler`, {
691
- details: error.message
692
- });
693
- },
694
- render(component, error) {
695
- return new ComponentError(component, "Failed to render component", {
696
- details: error.message
697
- });
698
- }
699
- };
700
- var errorHandler = null;
701
- function setErrorHandler(handler) {
702
- errorHandler = handler;
703
- }
704
- function clearErrorHandler() {
705
- errorHandler = null;
706
- }
707
- function handleError(error, options = {}) {
708
- const { throwError = true, logError = true } = options;
709
- if (logError && process.env.NODE_ENV !== "production") {
710
- console.error("Component Error:", error);
711
- if (error instanceof ComponentError) {
712
- console.group("Error Details");
713
- console.log("Component:", error.component);
714
- console.log("Context:", error.context);
715
- console.groupEnd();
716
- }
717
- }
718
- if (errorHandler) {
719
- try {
720
- errorHandler(error);
721
- } catch (handlerError) {
722
- console.error("Error in error handler:", handlerError);
723
- }
724
- }
725
- if (throwError) {
726
- throw error;
727
- }
728
- }
729
- function wrapErrorHandler(fn, component, eventName) {
730
- return (...args) => {
731
- try {
732
- const result = fn(...args);
733
- if (result instanceof Promise) {
734
- return result.catch((error) => {
735
- const wrappedError = ErrorTypes.eventHandler(component, eventName, error);
736
- handleError(wrappedError, { throwError: false });
737
- throw wrappedError;
738
- });
739
- }
740
- return result;
741
- } catch (error) {
742
- const wrappedError = ErrorTypes.eventHandler(component, eventName, error);
743
- handleError(wrappedError, { throwError: false });
744
- throw wrappedError;
745
- }
746
- };
747
- }
748
- function assert(condition, error) {
749
- if (!condition) {
750
- throw error;
751
- }
752
- }
753
- function warn(component, message, context = {}) {
754
- if (process.env.NODE_ENV === "production") {
755
- return;
756
- }
757
- const fullMessage = ComponentError.formatMessage(component, message, context);
758
- console.warn(`\u26A0\uFE0F ${fullMessage}`);
759
- }
760
- function devAssert(condition, error) {
761
- if (process.env.NODE_ENV === "production") {
762
- return;
763
- }
764
- assert(condition, error);
765
- }
766
- function createDebugger(component) {
767
- const isDebug = typeof process !== "undefined" && process.env.DEBUG === "true";
768
- return {
769
- log(...args) {
770
- if (isDebug) {
771
- console.log(`[${component}]`, ...args);
772
- }
773
- },
774
- warn(message, context) {
775
- warn(component, message, context);
776
- },
777
- error(message, context) {
778
- const error = new ComponentError(component, message, context);
779
- handleError(error, { throwError: false });
780
- }
781
- };
782
- }
783
- function errorBoundary(component, renderFn, fallback) {
784
- try {
785
- return renderFn();
786
- } catch (error) {
787
- const wrappedError = ErrorTypes.render(component, error);
788
- handleError(wrappedError, { throwError: false });
789
- return fallback;
790
- }
791
- }
792
-
793
- // src/utils/prop-validation.ts
794
- import process2 from "process";
795
- var isDevelopment = process2.env.NODE_ENV !== "production";
796
-
797
- class Validator {
798
- validate;
799
- message;
800
- isRequired;
801
- constructor(validate, message, isRequired = false) {
802
- this.validate = validate;
803
- this.message = message;
804
- this.isRequired = isRequired;
805
- }
806
- get required() {
807
- return new Validator(this.validate, this.message, true);
808
- }
809
- }
810
- var PropTypes = {
811
- string: new Validator((value) => typeof value === "string", (value, propName, componentName) => `Invalid prop \`${propName}\` of type \`${typeof value}\` supplied to \`${componentName}\`, expected \`string\`.`),
812
- number: new Validator((value) => typeof value === "number" && !Number.isNaN(value), (value, propName, componentName) => `Invalid prop \`${propName}\` of type \`${typeof value}\` supplied to \`${componentName}\`, expected \`number\`.`),
813
- boolean: new Validator((value) => typeof value === "boolean", (value, propName, componentName) => `Invalid prop \`${propName}\` of type \`${typeof value}\` supplied to \`${componentName}\`, expected \`boolean\`.`),
814
- func: new Validator((value) => typeof value === "function", (value, propName, componentName) => `Invalid prop \`${propName}\` of type \`${typeof value}\` supplied to \`${componentName}\`, expected \`function\`.`),
815
- object: new Validator((value) => typeof value === "object" && value !== null && !Array.isArray(value), (value, propName, componentName) => `Invalid prop \`${propName}\` of type \`${typeof value}\` supplied to \`${componentName}\`, expected \`object\`.`),
816
- array: new Validator((value) => Array.isArray(value), (value, propName, componentName) => `Invalid prop \`${propName}\` of type \`${typeof value}\` supplied to \`${componentName}\`, expected \`array\`.`),
817
- any: new Validator(() => true, () => ""),
818
- oneOf(validValues) {
819
- return new Validator((value) => validValues.includes(value), (value, propName, componentName) => `Invalid prop \`${propName}\` of value \`${value}\` supplied to \`${componentName}\`, expected one of [${validValues.map((v) => JSON.stringify(v)).join(", ")}].`);
820
- },
821
- oneOfType(validators) {
822
- return new Validator((value, propName, componentName) => validators.some((v) => v.validate(value, propName, componentName)), (_value, propName, componentName) => `Invalid prop \`${propName}\` supplied to \`${componentName}\`, expected one of the specified types.`);
823
- },
824
- arrayOf(validator) {
825
- return new Validator((value, propName, componentName) => {
826
- if (!Array.isArray(value))
827
- return false;
828
- return value.every((item, index) => validator.validate(item, `${propName}[${index}]`, componentName));
829
- }, (_value, propName, componentName) => `Invalid prop \`${propName}\` supplied to \`${componentName}\`, expected array of specified type.`);
830
- },
831
- shape(shape) {
832
- return new Validator((value, propName, componentName) => {
833
- if (typeof value !== "object" || value === null || Array.isArray(value))
834
- return false;
835
- for (const [key, validator] of Object.entries(shape)) {
836
- if (validator.isRequired && !(key in value))
837
- return false;
838
- if (key in value && !validator.validate(value[key], `${propName}.${key}`, componentName))
839
- return false;
840
- }
841
- return true;
842
- }, (_value, propName, componentName) => `Invalid prop \`${propName}\` supplied to \`${componentName}\`, expected object matching specified shape.`);
843
- },
844
- instanceOf(expectedClass) {
845
- return new Validator((value) => value instanceof expectedClass, (_value, propName, componentName) => `Invalid prop \`${propName}\` supplied to \`${componentName}\`, expected instance of \`${expectedClass.name}\`.`);
846
- },
847
- custom(validatorFn, errorMessage) {
848
- const messageGenerator = typeof errorMessage === "string" ? () => errorMessage : errorMessage;
849
- return new Validator(validatorFn, messageGenerator);
850
- },
851
- min(min) {
852
- return new Validator((value) => typeof value === "number" && value >= min, (value, propName, componentName) => `Invalid prop \`${propName}\` of value \`${value}\` supplied to \`${componentName}\`, expected value >= ${min}.`);
853
- },
854
- max(max) {
855
- return new Validator((value) => typeof value === "number" && value <= max, (value, propName, componentName) => `Invalid prop \`${propName}\` of value \`${value}\` supplied to \`${componentName}\`, expected value <= ${max}.`);
856
- },
857
- range(min, max) {
858
- return new Validator((value) => typeof value === "number" && value >= min && value <= max, (value, propName, componentName) => `Invalid prop \`${propName}\` of value \`${value}\` supplied to \`${componentName}\`, expected value between ${min} and ${max}.`);
859
- },
860
- pattern(pattern) {
861
- return new Validator((value) => typeof value === "string" && pattern.test(value), (value, propName, componentName) => `Invalid prop \`${propName}\` of value \`${value}\` supplied to \`${componentName}\`, expected value matching pattern ${pattern}.`);
862
- },
863
- email: new Validator((value) => typeof value === "string" && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value), (value, propName, componentName) => `Invalid prop \`${propName}\` of value \`${value}\` supplied to \`${componentName}\`, expected valid email address.`),
864
- url: new Validator((value) => {
865
- if (typeof value !== "string")
866
- return false;
867
- try {
868
- const _url = new URL(value);
869
- return true;
870
- } catch {
871
- return false;
872
- }
873
- }, (value, propName, componentName) => `Invalid prop \`${propName}\` of value \`${value}\` supplied to \`${componentName}\`, expected valid URL.`)
874
- };
875
- function validateProps(componentName, props, schema, options = {}) {
876
- const { throwOnError = false, logWarnings = isDevelopment } = options;
877
- const errors = [];
878
- if (!isDevelopment) {
879
- return { valid: true, errors: [] };
880
- }
881
- for (const [propName, validator] of Object.entries(schema)) {
882
- const propValue = props[propName];
883
- const isUndefined = propValue === undefined;
884
- if (validator.isRequired && isUndefined) {
885
- const error = `Required prop \`${propName}\` was not specified in \`${componentName}\`.`;
886
- errors.push(error);
887
- continue;
888
- }
889
- if (isUndefined)
890
- continue;
891
- if (!validator.validate(propValue, propName, componentName)) {
892
- const error = validator.message(propValue, propName, componentName);
893
- errors.push(error);
894
- }
895
- }
896
- if (errors.length > 0) {
897
- if (logWarnings) {
898
- console.group(`\u26A0\uFE0F Prop validation failed for \`${componentName}\``);
899
- errors.forEach((error) => console.warn(error));
900
- console.groupEnd();
901
- }
902
- if (throwOnError) {
903
- throw new Error(`Prop validation failed for \`${componentName}\`:
904
- ${errors.join(`
905
- `)}`);
906
- }
907
- }
908
- return {
909
- valid: errors.length === 0,
910
- errors
911
- };
912
- }
913
- function createPropValidator(componentName, schema, options) {
914
- return (props) => validateProps(componentName, props, schema, options);
915
- }
916
- function assertProp(value, validator, name = "value") {
917
- if (!isDevelopment)
918
- return;
919
- if (!validator.validate(value, name, "assertion")) {
920
- throw new Error(validator.message(value, name, "assertion"));
921
- }
922
- }
923
- function warnProp(value, validator, name = "value") {
924
- if (!isDevelopment)
925
- return;
926
- if (!validator.validate(value, name, "warning")) {
927
- console.warn(validator.message(value, name, "warning"));
928
- }
929
- }
930
-
931
- // src/ui/button/Button.stx
932
- var Button_default = "./Button-wrwmnfpf.stx";
933
-
934
- // src/ui/button/index.ts
935
- var buttonPropSchema = {
936
- variant: PropTypes.oneOf(["primary", "secondary", "outline", "ghost", "danger"]),
937
- size: PropTypes.oneOf(["xs", "sm", "md", "lg", "xl"]),
938
- disabled: PropTypes.boolean,
939
- loading: PropTypes.boolean,
940
- type: PropTypes.oneOf(["button", "submit", "reset"]),
941
- fullWidth: PropTypes.boolean,
942
- leftIcon: PropTypes.string,
943
- rightIcon: PropTypes.string,
944
- className: PropTypes.string,
945
- onClick: PropTypes.func
946
- };
947
- var validateButtonProps = createPropValidator("Button", buttonPropSchema);
948
- function createSafeClickHandler(handler) {
949
- return wrapErrorHandler(handler, "Button", "onClick");
950
- }
951
- function validateVariant(variant) {
952
- if (variant && !["primary", "secondary", "outline", "ghost", "danger"].includes(variant)) {
953
- throw ErrorTypes.invalidProp("Button", "variant", variant, ["primary", "secondary", "outline", "ghost", "danger"]);
954
- }
955
- }
956
- function validateSize(size) {
957
- if (size && !["xs", "sm", "md", "lg", "xl"].includes(size)) {
958
- throw ErrorTypes.invalidProp("Button", "size", size, ["xs", "sm", "md", "lg", "xl"]);
959
- }
960
- }
961
- // src/ui/calendar/Calendar.stx
962
- var Calendar_default = "./Calendar-gjjhhfnt.stx";
963
- // src/ui/card/Card.stx
964
- var Card_default = "./Card-473a02fy.stx";
965
- // src/ui/checkbox/Checkbox.stx
966
- var Checkbox_default = "./Checkbox-2s2a7n4h.stx";
967
- // src/ui/combobox/Combobox.stx
968
- var Combobox_default = "./Combobox-fdkr6cdq.stx";
969
- // src/ui/combobox/ComboboxButton.stx
970
- var ComboboxButton_default = "./ComboboxButton-g76stp1e.stx";
971
- // src/ui/combobox/ComboboxInput.stx
972
- var ComboboxInput_default = "./ComboboxInput-z1293bbh.stx";
973
- // src/ui/combobox/ComboboxOption.stx
974
- var ComboboxOption_default = "./ComboboxOption-6yh7xk7q.stx";
975
- // src/ui/combobox/ComboboxOptions.stx
976
- var ComboboxOptions_default = "./ComboboxOptions-sq5360ae.stx";
977
- // src/ui/command-palette/CommandPalette.stx
978
- var CommandPalette_default = "./CommandPalette-36mxf05w.stx";
979
- // src/ui/command-palette/CommandPaletteItem.stx
980
- var CommandPaletteItem_default = "./CommandPaletteItem-chdw0070.stx";
981
- // src/ui/dialog/Dialog.stx
982
- var Dialog_default = "./Dialog-y5rz2vrq.stx";
983
- // src/ui/dialog/DialogBackdrop.stx
984
- var DialogBackdrop_default = "./DialogBackdrop-rxax3sec.stx";
985
- // src/ui/dialog/DialogDescription.stx
986
- var DialogDescription_default = "./DialogDescription-gth4c2kx.stx";
987
- // src/ui/dialog/DialogPanel.stx
988
- var DialogPanel_default = "./DialogPanel-44d8jeqy.stx";
989
- // src/ui/dialog/DialogTitle.stx
990
- var DialogTitle_default = "./DialogTitle-x0r6k8x9.stx";
991
- // src/ui/drawer/Drawer.stx
992
- var Drawer_default = "./Drawer-jgepqr9j.stx";
993
- // src/ui/dropdown/Dropdown.stx
994
- var Dropdown_default = "./Dropdown-vvhemtc0.stx";
995
- // src/ui/dropdown/DropdownButton.stx
996
- var DropdownButton_default = "./DropdownButton-wcz67dxy.stx";
997
- // src/ui/dropdown/DropdownItem.stx
998
- var DropdownItem_default = "./DropdownItem-d8ht2bp5.stx";
999
- // src/ui/dropdown/DropdownItems.stx
1000
- var DropdownItems_default = "./DropdownItems-1sxnd5qn.stx";
1001
- // src/ui/form/Form.stx
1002
- var Form_default = "./Form-vbag14t1.stx";
1003
-
1004
- // src/ui/form/index.ts
1005
- var formPropSchema = {
1006
- action: PropTypes.string,
1007
- method: PropTypes.oneOf(["GET", "POST", "PUT", "DELETE", "PATCH"]),
1008
- validationSchema: PropTypes.object,
1009
- initialValues: PropTypes.object,
1010
- validateOnChange: PropTypes.boolean,
1011
- validateOnBlur: PropTypes.boolean,
1012
- onSubmit: PropTypes.func,
1013
- onError: PropTypes.func,
1014
- className: PropTypes.string
1015
- };
1016
- var validateFormProps = createPropValidator("Form", formPropSchema);
1017
- // src/ui/image/Image.stx
1018
- var Image_default = "./Image-yhxcvgzs.stx";
1019
- // src/ui/input/EmailInput.stx
1020
- var EmailInput_default = "./EmailInput-vak3kkmk.stx";
1021
- // src/ui/input/NumberInput.stx
1022
- var NumberInput_default = "./NumberInput-j9p5bm5y.stx";
1023
- // src/ui/input/PasswordInput.stx
1024
- var PasswordInput_default = "./PasswordInput-4qykq1dz.stx";
1025
- // src/ui/input/SearchInput.stx
1026
- var SearchInput_default = "./SearchInput-pdx7agn0.stx";
1027
- // src/ui/input/TextInput.stx
1028
- var TextInput_default = "./TextInput-cefyyprt.stx";
1029
-
1030
- // src/ui/input/index.ts
1031
- var baseInputPropSchema = {
1032
- value: PropTypes.string,
1033
- onChange: PropTypes.func,
1034
- placeholder: PropTypes.string,
1035
- disabled: PropTypes.boolean,
1036
- readonly: PropTypes.boolean,
1037
- size: PropTypes.oneOf(["sm", "md", "lg"]),
1038
- error: PropTypes.boolean,
1039
- label: PropTypes.string,
1040
- helperText: PropTypes.string,
1041
- required: PropTypes.boolean,
1042
- className: PropTypes.string,
1043
- inputClassName: PropTypes.string
1044
- };
1045
- var textInputPropSchema = {
1046
- value: PropTypes.string,
1047
- onChange: PropTypes.func,
1048
- placeholder: PropTypes.string,
1049
- disabled: PropTypes.boolean,
1050
- readonly: PropTypes.boolean,
1051
- size: PropTypes.oneOf(["sm", "md", "lg"]),
1052
- error: PropTypes.boolean,
1053
- label: PropTypes.string,
1054
- helperText: PropTypes.string,
1055
- required: PropTypes.boolean,
1056
- className: PropTypes.string,
1057
- inputClassName: PropTypes.string,
1058
- leftIcon: PropTypes.string,
1059
- rightIcon: PropTypes.string,
1060
- clearable: PropTypes.boolean,
1061
- maxLength: PropTypes.number,
1062
- showCount: PropTypes.boolean
1063
- };
1064
- var numberInputPropSchema = {
1065
- value: PropTypes.string,
1066
- onChange: PropTypes.func,
1067
- placeholder: PropTypes.string,
1068
- disabled: PropTypes.boolean,
1069
- readonly: PropTypes.boolean,
1070
- size: PropTypes.oneOf(["sm", "md", "lg"]),
1071
- error: PropTypes.boolean,
1072
- label: PropTypes.string,
1073
- helperText: PropTypes.string,
1074
- required: PropTypes.boolean,
1075
- className: PropTypes.string,
1076
- inputClassName: PropTypes.string,
1077
- min: PropTypes.number,
1078
- max: PropTypes.number,
1079
- step: PropTypes.number,
1080
- showControls: PropTypes.boolean
1081
- };
1082
- var passwordInputPropSchema = {
1083
- value: PropTypes.string,
1084
- onChange: PropTypes.func,
1085
- placeholder: PropTypes.string,
1086
- disabled: PropTypes.boolean,
1087
- readonly: PropTypes.boolean,
1088
- size: PropTypes.oneOf(["sm", "md", "lg"]),
1089
- error: PropTypes.boolean,
1090
- label: PropTypes.string,
1091
- helperText: PropTypes.string,
1092
- required: PropTypes.boolean,
1093
- className: PropTypes.string,
1094
- inputClassName: PropTypes.string,
1095
- showStrength: PropTypes.boolean
1096
- };
1097
- var searchInputPropSchema = {
1098
- value: PropTypes.string,
1099
- onChange: PropTypes.func,
1100
- placeholder: PropTypes.string,
1101
- disabled: PropTypes.boolean,
1102
- readonly: PropTypes.boolean,
1103
- size: PropTypes.oneOf(["sm", "md", "lg"]),
1104
- error: PropTypes.boolean,
1105
- label: PropTypes.string,
1106
- helperText: PropTypes.string,
1107
- required: PropTypes.boolean,
1108
- className: PropTypes.string,
1109
- inputClassName: PropTypes.string,
1110
- onSearch: PropTypes.func,
1111
- loading: PropTypes.boolean
1112
- };
1113
- var validateTextInputProps = createPropValidator("TextInput", textInputPropSchema);
1114
- var validateEmailInputProps = createPropValidator("EmailInput", baseInputPropSchema);
1115
- var validatePasswordInputProps = createPropValidator("PasswordInput", passwordInputPropSchema);
1116
- var validateNumberInputProps = createPropValidator("NumberInput", numberInputPropSchema);
1117
- var validateSearchInputProps = createPropValidator("SearchInput", searchInputPropSchema);
1118
- // src/ui/listbox/Listbox.stx
1119
- var Listbox_default = "./Listbox-q49tnr90.stx";
1120
- // src/ui/listbox/ListboxButton.stx
1121
- var ListboxButton_default = "./ListboxButton-keb8gm0q.stx";
1122
- // src/ui/listbox/ListboxLabel.stx
1123
- var ListboxLabel_default = "./ListboxLabel-7mymt1b8.stx";
1124
- // src/ui/listbox/ListboxOption.stx
1125
- var ListboxOption_default = "./ListboxOption-4j070101.stx";
1126
- // src/ui/listbox/ListboxOptions.stx
1127
- var ListboxOptions_default = "./ListboxOptions-ejkatcfg.stx";
1128
- // src/ui/navigator/Navigator.stx
1129
- var Navigator_default = "./Navigator-smpa7my4.stx";
1130
- // src/ui/notification/Notification.stx
1131
- var Notification_default = "./Notification-03vfh3k6.stx";
1132
- // src/ui/pagination/Pagination.stx
1133
- var Pagination_default = "./Pagination-jbcjrfcs.stx";
1134
- // src/ui/payment/Checkout.stx
1135
- var Checkout_default = "./Checkout-22wh3s22.stx";
1136
- // src/ui/payment/DefaultPaymentMethod.stx
1137
- var DefaultPaymentMethod_default = "./DefaultPaymentMethod-6qrem3sg.stx";
1138
- // src/ui/payment/PaymentMethods.stx
1139
- var PaymentMethods_default = "./PaymentMethods-2xy66bwk.stx";
1140
- // src/ui/payment/SubscriptionCheckout.stx
1141
- var SubscriptionCheckout_default = "./SubscriptionCheckout-7fdkwf04.stx";
1142
- // src/ui/popover/Popover.stx
1143
- var Popover_default = "./Popover-et2q44m7.stx";
1144
- // src/ui/popover/PopoverButton.stx
1145
- var PopoverButton_default = "./PopoverButton-mffzc9pr.stx";
1146
- // src/ui/popover/PopoverPanel.stx
1147
- var PopoverPanel_default = "./PopoverPanel-054yh38h.stx";
1148
- // src/ui/portal/Portal.stx
1149
- var Portal_default = "./Portal-1vf14s4x.stx";
1150
- // src/ui/progress/Progress.stx
1151
- var Progress_default = "./Progress-4h7dytq5.stx";
1152
- // src/ui/radio/Radio.stx
1153
- var Radio_default = "./Radio-ccm07b2m.stx";
1154
- // src/ui/radio-group/RadioGroup.stx
1155
- var RadioGroup_default = "./RadioGroup-eerw9gq7.stx";
1156
- // src/ui/radio-group/RadioGroupDescription.stx
1157
- var RadioGroupDescription_default = "./RadioGroupDescription-z34r9avr.stx";
1158
- // src/ui/radio-group/RadioGroupLabel.stx
1159
- var RadioGroupLabel_default = "./RadioGroupLabel-7mymt1b8.stx";
1160
- // src/ui/radio-group/RadioGroupOption.stx
1161
- var RadioGroupOption_default = "./RadioGroupOption-7pq7rw84.stx";
1162
- // src/ui/select/Select.stx
1163
- var Select_default = "./Select-zt72gg1e.stx";
1164
- // src/ui/sidebar/Sidebar.stx
1165
- var Sidebar_default = "./Sidebar-v7ecx5gs.stx";
1166
- // src/ui/sidebar/SidebarFooter.stx
1167
- var SidebarFooter_default = "./SidebarFooter-s7skj92y.stx";
1168
- // src/ui/sidebar/SidebarHeader.stx
1169
- var SidebarHeader_default = "./SidebarHeader-34bf4mm8.stx";
1170
- // src/ui/sidebar/SidebarItem.stx
1171
- var SidebarItem_default = "./SidebarItem-5v8atp7p.stx";
1172
- // src/ui/sidebar/SidebarPinned.stx
1173
- var SidebarPinned_default = "./SidebarPinned-rq05nrtd.stx";
1174
- // src/ui/sidebar/SidebarSection.stx
1175
- var SidebarSection_default = "./SidebarSection-zd9z35ch.stx";
1176
- // src/ui/sidebar/SidebarSpace.stx
1177
- var SidebarSpace_default = "./SidebarSpace-r062weq2.stx";
1178
- // src/ui/sidebar/SidebarSpaces.stx
1179
- var SidebarSpaces_default = "./SidebarSpaces-f149wvf1.stx";
1180
- // src/ui/sidebar/SidebarSpaceSwitcher.stx
1181
- var SidebarSpaceSwitcher_default = "./SidebarSpaceSwitcher-az9wqm87.stx";
1182
- // src/ui/sidebar/themes.ts
1183
- var macosColors = {
1184
- blue: "#0088ff",
1185
- red: "#ff383c",
1186
- pink: "#ff2d55",
1187
- orange: "#ff8d28",
1188
- yellow: "#ffcc00",
1189
- green: "#34c759",
1190
- teal: "#00c3d0",
1191
- cyan: "#00c0e8",
1192
- indigo: "#6155f5",
1193
- purple: "#cb30e0",
1194
- brown: "#ac7f5e",
1195
- gray: "#8e8e93"
1196
- };
1197
- var macos = {
1198
- pane: [
1199
- "bg-[#f2f2f4]/90 dark:bg-[#1c1c1e]/88",
1200
- "backdrop-blur-[50px] backdrop-saturate-[180%]",
1201
- "text-black dark:text-white",
1202
- "select-none"
1203
- ].join(" "),
1204
- selection: "accent",
1205
- layers: {
1206
- shimmerRim: true
1207
- },
1208
- scrollArea: "flex-1 overflow-y-auto overflow-x-hidden px-[10px] pb-[10px]",
1209
- sectionHeader: [
1210
- "group/section flex w-full items-center",
1211
- "pl-[8px] pr-[6px] pt-[16px] pb-[5px]",
1212
- "text-[11px] font-semibold leading-[13px]",
1213
- "text-[#3c3c43]/60 dark:text-[#ebebf5]/60"
1214
- ].join(" "),
1215
- sectionChevron: [
1216
- "i-f7-chevron-down h-[11px] w-[11px] ml-auto",
1217
- "text-[#3c3c43]/45 dark:text-[#ebebf5]/45",
1218
- "opacity-0 group-hover/section:opacity-100 transition-opacity duration-150",
1219
- "transition-transform duration-200"
1220
- ].join(" "),
1221
- sectionGroup: "flex flex-col",
1222
- item: {
1223
- base: [
1224
- "flex w-full items-center",
1225
- "h-[32px] rounded-[8px] pl-[4px] pr-[8px]",
1226
- "text-[13px] leading-[16px] font-normal",
1227
- "text-black dark:text-white",
1228
- "transition-colors duration-150 ease-out",
1229
- "cursor-default"
1230
- ].join(" "),
1231
- hover: "hover:bg-black/4 dark:hover:bg-white/6",
1232
- active: "",
1233
- pressed: "active:bg-black/10 dark:active:bg-white/18",
1234
- disabled: "opacity-40 pointer-events-none",
1235
- disclosure: "flex h-[16px] w-[18px] shrink-0 items-center justify-center",
1236
- chevron: [
1237
- "i-f7-chevron-right h-[11px] w-[11px]",
1238
- "text-[#3c3c43]/55 dark:text-[#ebebf5]/55",
1239
- "transition-transform duration-200 ease-out"
1240
- ].join(" "),
1241
- iconSlot: "flex h-[20px] w-[22px] shrink-0 items-center justify-center mr-[7px]",
1242
- icon: "h-[17px] w-[17px]",
1243
- image: "h-[20px] w-[20px] rounded-[4px] object-cover shadow-sm",
1244
- label: "flex-1 truncate text-left",
1245
- count: [
1246
- "ml-[8px] shrink-0 tabular-nums",
1247
- "text-[13px] leading-[16px]",
1248
- "text-[#3c3c43]/60 dark:text-[#ebebf5]/60"
1249
- ].join(" "),
1250
- indentPerLevel: 16
1251
- }
1252
- };
1253
- var workspace = {
1254
- selection: "classes",
1255
- pane: "bg-[#f4f4f3] dark:bg-neutral-950 text-zinc-950 dark:text-white select-none",
1256
- layers: {},
1257
- scrollArea: "flex-1 overflow-y-auto overflow-x-hidden px-5 py-5",
1258
- sectionHeader: "group/section flex w-full items-center gap-2.5 px-4 pb-2 pt-5 text-[13px] font-semibold uppercase tracking-[0.12em] text-zinc-400 dark:text-zinc-500",
1259
- sectionChevron: "i-f7-chevron-down h-3 w-3 ml-auto opacity-0 group-hover/section:opacity-100 transition-opacity duration-150 transition-transform duration-200",
1260
- sectionGroup: "flex flex-col space-y-1",
1261
- item: {
1262
- base: "flex w-full items-center gap-3 rounded-[16px] px-3.5 py-2 text-[14px] leading-tight transition-colors duration-150",
1263
- hover: "hover:bg-[#ececea] hover:text-zinc-950 dark:hover:bg-white/10",
1264
- active: "bg-[#e7e7e5] text-zinc-950 dark:bg-white/12 dark:text-white",
1265
- pressed: "active:bg-[#e2e2e0] dark:active:bg-white/15",
1266
- disabled: "opacity-50 pointer-events-none",
1267
- disclosure: "flex h-4 w-4 shrink-0 items-center justify-center",
1268
- chevron: "i-f7-chevron-right h-3 w-3 opacity-50 transition-transform duration-200",
1269
- iconSlot: "flex h-5 w-5 shrink-0 items-center justify-center",
1270
- icon: "h-[18px] w-[18px] text-zinc-500 dark:text-zinc-500",
1271
- image: "h-5 w-5 rounded object-cover",
1272
- label: "flex-1 truncate text-left text-zinc-700 dark:text-zinc-300",
1273
- count: "ml-auto grid h-5 min-w-5 place-items-center rounded-full bg-white/70 px-1.5 text-[11px] font-medium text-zinc-500 shadow-sm dark:bg-white/10 dark:text-zinc-400",
1274
- indentPerLevel: 12
1275
- }
1276
- };
1277
- var desktop = {
1278
- selection: "classes",
1279
- pane: "bg-[#f3f3f1]/48 dark:bg-neutral-950/32 backdrop-blur-3xl backdrop-saturate-150 text-zinc-950 dark:text-white select-none",
1280
- layers: {
1281
- tint: "bg-[linear-gradient(112deg,rgba(255,255,255,0.20)_0%,rgba(255,255,255,0.04)_45%,rgba(226,226,222,0.16)_100%)] dark:bg-[linear-gradient(112deg,rgba(255,255,255,0.08)_0%,rgba(255,255,255,0.02)_46%,rgba(255,255,255,0.06)_100%)]"
1282
- },
1283
- scrollArea: "flex-1 overflow-y-auto overflow-x-hidden px-5 py-2",
1284
- sectionHeader: "group/section flex w-full items-center gap-2.5 px-3 pb-1.5 pt-3 rounded-[14px] text-[12px] font-semibold uppercase tracking-[0.10em] text-zinc-500/80 dark:text-zinc-400/80",
1285
- sectionChevron: "i-f7-chevron-down h-3 w-3 ml-auto opacity-0 group-hover/section:opacity-100 transition-opacity duration-150 transition-transform duration-200",
1286
- sectionGroup: "flex flex-col space-y-1",
1287
- item: {
1288
- base: "flex w-full items-center gap-3 rounded-[14px] px-3 py-1.5 text-[13.5px] leading-tight transition-colors duration-150",
1289
- hover: "hover:bg-white/38 hover:text-zinc-950 dark:hover:bg-white/10",
1290
- active: "bg-[#e8e8e6]/90 text-zinc-950 dark:bg-white/12 dark:text-white",
1291
- pressed: "active:bg-white/50 dark:active:bg-white/15",
1292
- disabled: "opacity-50 pointer-events-none",
1293
- disclosure: "flex h-4 w-4 shrink-0 items-center justify-center",
1294
- chevron: "i-f7-chevron-right h-3 w-3 opacity-50 transition-transform duration-200",
1295
- iconSlot: "flex h-5 w-5 shrink-0 items-center justify-center",
1296
- icon: "h-[18px] w-[18px] text-zinc-600 dark:text-zinc-400",
1297
- image: "h-5 w-5 rounded object-cover",
1298
- label: "flex-1 truncate text-left text-zinc-700 dark:text-zinc-300",
1299
- count: "ml-auto grid h-5 min-w-5 place-items-center rounded-full bg-white/72 px-1.5 text-[11px] font-medium text-zinc-500 shadow-sm dark:bg-white/10 dark:text-zinc-400",
1300
- indentPerLevel: 12
1301
- }
1302
- };
1303
- var arc = {
1304
- selection: "classes",
1305
- pane: [
1306
- "bg-[#f7f5f1]/92 dark:bg-[#1a1a1c]/92",
1307
- "backdrop-blur-[40px] backdrop-saturate-[160%]",
1308
- "text-[#2c2a28] dark:text-[#ededf0]",
1309
- "select-none"
1310
- ].join(" "),
1311
- layers: {
1312
- tint: [
1313
- "bg-[linear-gradient(180deg,var(--stx-sidebar-tint,rgba(255,251,242,0.55))_0%,rgba(255,255,255,0)_38%)]",
1314
- "dark:bg-[linear-gradient(180deg,var(--stx-sidebar-tint,rgba(255,255,255,0.05))_0%,rgba(255,255,255,0)_42%)]"
1315
- ].join(" ")
1316
- },
1317
- scrollArea: "flex-1 overflow-y-auto overflow-x-hidden px-[8px] pb-[8px]",
1318
- sectionHeader: [
1319
- "group/section flex w-full items-center",
1320
- "px-[8px] pt-[14px] pb-[4px]",
1321
- "text-[11px] font-medium leading-[13px]",
1322
- "opacity-55"
1323
- ].join(" "),
1324
- sectionChevron: [
1325
- "i-f7-chevron-down h-[10px] w-[10px] ml-auto",
1326
- "opacity-0 group-hover/section:opacity-100 transition-opacity duration-150",
1327
- "transition-transform duration-200"
1328
- ].join(" "),
1329
- sectionGroup: "flex flex-col space-y-[2px]",
1330
- item: {
1331
- base: [
1332
- "flex w-full items-center",
1333
- "h-[30px] rounded-[8px] pl-[6px] pr-[8px]",
1334
- "text-[13px] leading-[16px] font-normal",
1335
- "text-current",
1336
- "transition-[background-color,box-shadow,color] duration-150 ease-out",
1337
- "cursor-default"
1338
- ].join(" "),
1339
- hover: "hover:bg-white/55 dark:hover:bg-white/8",
1340
- active: [
1341
- "bg-white dark:bg-white/14",
1342
- "font-medium",
1343
- "shadow-[0_1px_2px_rgba(0,0,0,0.08)] dark:shadow-[0_1px_2px_rgba(0,0,0,0.35)]",
1344
- "ring-1 ring-black/5 dark:ring-white/8"
1345
- ].join(" "),
1346
- pressed: "active:bg-white/80 dark:active:bg-white/18",
1347
- disabled: "opacity-40 pointer-events-none",
1348
- disclosure: "flex h-[16px] w-[16px] shrink-0 items-center justify-center",
1349
- chevron: [
1350
- "i-f7-chevron-right h-[10px] w-[10px] opacity-45",
1351
- "transition-transform duration-200 ease-out"
1352
- ].join(" "),
1353
- iconSlot: "flex h-[18px] w-[18px] shrink-0 items-center justify-center mr-[8px]",
1354
- icon: "h-[16px] w-[16px]",
1355
- image: "h-[18px] w-[18px] rounded-[5px] object-cover shadow-sm",
1356
- label: "flex-1 truncate text-left",
1357
- count: [
1358
- "ml-[8px] shrink-0 tabular-nums",
1359
- "text-[12px] leading-[16px] opacity-45"
1360
- ].join(" "),
1361
- indentPerLevel: 14
1362
- }
1363
- };
1364
- var solid = {
1365
- ...macos,
1366
- pane: "bg-stone-100 dark:bg-neutral-900 text-black dark:text-white select-none",
1367
- layers: {}
1368
- };
1369
- var transparent = {
1370
- ...macos,
1371
- pane: "bg-transparent text-black dark:text-white select-none",
1372
- layers: {}
1373
- };
1374
- var vibrancy = {
1375
- ...macos,
1376
- pane: "bg-white/50 dark:bg-black/40 backdrop-blur-3xl backdrop-saturate-200 text-black dark:text-white select-none",
1377
- layers: {}
1378
- };
1379
- var sidebarThemes = {
1380
- macos,
1381
- tahoe: macos,
1382
- "macos-tahoe": macos,
1383
- "macos-latest": macos,
1384
- arc,
1385
- workspace,
1386
- desktop,
1387
- solid,
1388
- transparent,
1389
- vibrancy
1390
- };
1391
- function resolveSidebarTheme(name) {
1392
- return sidebarThemes[name || "macos"] || sidebarThemes.macos;
1393
- }
1394
- function resolveIconColor(color) {
1395
- if (!color)
1396
- return;
1397
- return macosColors[color] || color;
1398
- }
1399
-
1400
- // src/ui/sidebar/spaces.ts
1401
- var NEUTRAL_SEED = macosColors.gray;
1402
- function mix(color, percent, into) {
1403
- return `color-mix(in oklab, ${color} ${percent}%, ${into})`;
1404
- }
1405
- function deriveSpaceTint(seed) {
1406
- return {
1407
- light: {
1408
- from: mix(seed, 16, "#ffffff"),
1409
- to: mix(seed, 34, "#ffffff"),
1410
- ink: mix(seed, 22, "#17171b"),
1411
- accent: mix(seed, 88, "#2a2a30")
1412
- },
1413
- dark: {
1414
- from: mix(seed, 26, "#101014"),
1415
- to: mix(seed, 14, "#08080b"),
1416
- ink: mix(seed, 12, "#f4f4f7"),
1417
- accent: mix(seed, 74, "#ffffff")
1418
- }
1419
- };
1420
- }
1421
- function resolveSpaceTint(tint) {
1422
- if (!tint)
1423
- return deriveSpaceTint(NEUTRAL_SEED);
1424
- if (typeof tint !== "string")
1425
- return tint;
1426
- return deriveSpaceTint(macosColors[tint] || tint);
1427
- }
1428
- function spaceTintVars(tint) {
1429
- return [
1430
- `--stx-space-light-from: ${tint.light.from}`,
1431
- `--stx-space-light-to: ${tint.light.to}`,
1432
- `--stx-space-light-ink: ${tint.light.ink}`,
1433
- `--stx-space-light-accent: ${tint.light.accent}`,
1434
- `--stx-space-dark-from: ${tint.dark.from}`,
1435
- `--stx-space-dark-to: ${tint.dark.to}`,
1436
- `--stx-space-dark-ink: ${tint.dark.ink}`,
1437
- `--stx-space-dark-accent: ${tint.dark.accent}`
1438
- ].join("; ");
1439
- }
1440
- function normalizeAction(action, spaceId, role, fallbackIcon) {
1441
- if (!action || !action.label)
1442
- return null;
1443
- return {
1444
- id: action.id || `${spaceId}-${role}`,
1445
- label: action.label,
1446
- icon: action.icon || fallbackIcon
1447
- };
1448
- }
1449
- function normalizeSpace(space) {
1450
- const tint = resolveSpaceTint(space.tint);
1451
- return {
1452
- id: space.id,
1453
- label: space.label || "",
1454
- icon: space.icon || "",
1455
- pinned: space.pinned || [],
1456
- sections: space.sections || [],
1457
- action: normalizeAction(space.action, space.id, "action", "i-f7-plus"),
1458
- clear: normalizeAction(space.clear, space.id, "clear", "i-f7-arrow-down"),
1459
- tint,
1460
- style: spaceTintVars(tint),
1461
- deferred: space.deferred === true
1462
- };
1463
- }
1464
- function normalizeSpaces(spaces) {
1465
- return (spaces || []).map(normalizeSpace);
1466
- }
1467
- function spaceIndexOf(spaces, id) {
1468
- if (!id)
1469
- return 0;
1470
- const index = spaces.findIndex((space) => space.id === id);
1471
- return index === -1 ? 0 : index;
1472
- }
1473
- function spaceTintPayload(spaces) {
1474
- return spaces.map((space) => space.tint);
1475
- }
1476
- // src/ui/skeleton/Skeleton.stx
1477
- var Skeleton_default = "./Skeleton-wtwb97xd.stx";
1478
- // src/ui/spinner/Spinner.stx
1479
- var Spinner_default = "./Spinner-ypya5tt2.stx";
1480
- // src/ui/stepper/Stepper.stx
1481
- var Stepper_default = "./Stepper-rgbk76hd.stx";
1482
- // src/ui/stepper/StepperStep.stx
1483
- var StepperStep_default = "./StepperStep-3ahq4d9m.stx";
1484
- // src/ui/storage/index.ts
1485
- class StorageManager {
1486
- storage;
1487
- namespace;
1488
- watchers = new Map;
1489
- encryptionKey = "stx-storage-key";
1490
- constructor(type = "local", namespace = "") {
1491
- this.storage = type === "local" ? globalThis.localStorage : globalThis.sessionStorage;
1492
- this.namespace = namespace;
1493
- if (typeof window !== "undefined") {
1494
- window.addEventListener("storage", this.handleStorageEvent.bind(this));
1495
- }
1496
- }
1497
- handleStorageEvent(event) {
1498
- if (!event.key)
1499
- return;
1500
- const key = this.namespace && event.key.startsWith(`${this.namespace}:`) ? event.key.slice(this.namespace.length + 1) : event.key;
1501
- const callbacks = this.watchers.get(key);
1502
- if (callbacks) {
1503
- const oldValue = event.oldValue ? JSON.parse(event.oldValue).value : null;
1504
- const newValue = event.newValue ? JSON.parse(event.newValue).value : null;
1505
- callbacks.forEach((callback) => callback(newValue, oldValue, key));
1506
- }
1507
- }
1508
- encrypt(data) {
1509
- let result = "";
1510
- for (let i = 0;i < data.length; i++) {
1511
- result += String.fromCharCode(data.charCodeAt(i) ^ this.encryptionKey.charCodeAt(i % this.encryptionKey.length));
1512
- }
1513
- return btoa(result);
1514
- }
1515
- decrypt(data) {
1516
- try {
1517
- const decoded = atob(data);
1518
- let result = "";
1519
- for (let i = 0;i < decoded.length; i++) {
1520
- result += String.fromCharCode(decoded.charCodeAt(i) ^ this.encryptionKey.charCodeAt(i % this.encryptionKey.length));
1521
- }
1522
- return result;
1523
- } catch {
1524
- return data;
1525
- }
1526
- }
1527
- compress(data) {
1528
- if (data.length < 100)
1529
- return data;
1530
- const dict = {};
1531
- let dictSize = 256;
1532
- const result = [];
1533
- let w = "";
1534
- for (let i = 0;i < data.length; i++) {
1535
- const c = data.charAt(i);
1536
- const wc = w + c;
1537
- if (dict[wc] !== undefined) {
1538
- w = wc;
1539
- } else {
1540
- result.push(w.length > 1 ? dict[w] : w.charCodeAt(0));
1541
- dict[wc] = dictSize++;
1542
- w = c;
1543
- }
1544
- }
1545
- if (w !== "") {
1546
- result.push(w.length > 1 ? dict[w] : w.charCodeAt(0));
1547
- }
1548
- return JSON.stringify(result);
1549
- }
1550
- decompress(data) {
1551
- try {
1552
- const compressed = JSON.parse(data);
1553
- if (!Array.isArray(compressed))
1554
- return data;
1555
- const dict = {};
1556
- let dictSize = 256;
1557
- let w = String.fromCharCode(compressed[0]);
1558
- let result = w;
1559
- for (let i = 1;i < compressed.length; i++) {
1560
- const k = compressed[i];
1561
- let entry;
1562
- if (dict[k] !== undefined) {
1563
- entry = dict[k];
1564
- } else if (k === dictSize) {
1565
- entry = w + w.charAt(0);
1566
- } else {
1567
- return data;
1568
- }
1569
- result += entry;
1570
- dict[dictSize++] = w + entry.charAt(0);
1571
- w = entry;
1572
- }
1573
- return result;
1574
- } catch {
1575
- return data;
1576
- }
1577
- }
1578
- getKey(key) {
1579
- return this.namespace ? `${this.namespace}:${key}` : key;
1580
- }
1581
- set(key, value, options) {
1582
- const fullKey = this.getKey(key);
1583
- const oldValue = this.get(key);
1584
- const data = {
1585
- value,
1586
- timestamp: Date.now(),
1587
- expire: options?.expire,
1588
- encrypted: options?.encrypt || false,
1589
- compressed: options?.compress || false
1590
- };
1591
- try {
1592
- let serialized = JSON.stringify(data);
1593
- if (options?.compress) {
1594
- serialized = this.compress(serialized);
1595
- }
1596
- if (options?.encrypt) {
1597
- serialized = this.encrypt(serialized);
1598
- }
1599
- this.storage.setItem(fullKey, serialized);
1600
- this.notifyWatchers(key, value, oldValue);
1601
- } catch (error) {
1602
- console.error("Storage set error:", error);
1603
- }
1604
- }
1605
- get(key) {
1606
- const fullKey = this.getKey(key);
1607
- try {
1608
- let item = this.storage.getItem(fullKey);
1609
- if (!item)
1610
- return null;
1611
- if (item.match(/^[A-Z0-9+/]+=*$/i)) {
1612
- try {
1613
- item = this.decrypt(item);
1614
- } catch {}
1615
- }
1616
- if (item.startsWith("[")) {
1617
- try {
1618
- item = this.decompress(item);
1619
- } catch {}
1620
- }
1621
- const data = JSON.parse(item);
1622
- if (data.expire && Date.now() - data.timestamp > data.expire) {
1623
- this.remove(key);
1624
- return null;
1625
- }
1626
- return data.value;
1627
- } catch (error) {
1628
- console.error("Storage get error:", error);
1629
- return null;
1630
- }
1631
- }
1632
- watch(key, callback) {
1633
- if (!this.watchers.has(key)) {
1634
- this.watchers.set(key, new Set);
1635
- }
1636
- this.watchers.get(key).add(callback);
1637
- return () => {
1638
- const callbacks = this.watchers.get(key);
1639
- if (callbacks) {
1640
- callbacks.delete(callback);
1641
- if (callbacks.size === 0) {
1642
- this.watchers.delete(key);
1643
- }
1644
- }
1645
- };
1646
- }
1647
- notifyWatchers(key, newValue, oldValue) {
1648
- const callbacks = this.watchers.get(key);
1649
- if (callbacks) {
1650
- callbacks.forEach((callback) => callback(newValue, oldValue, key));
1651
- }
1652
- }
1653
- remove(key) {
1654
- const fullKey = this.getKey(key);
1655
- const oldValue = this.get(key);
1656
- this.storage.removeItem(fullKey);
1657
- this.notifyWatchers(key, null, oldValue);
1658
- }
1659
- clear() {
1660
- if (this.namespace) {
1661
- const keys = this.keys();
1662
- keys.forEach((key) => this.remove(key));
1663
- } else {
1664
- this.storage.clear();
1665
- }
1666
- }
1667
- has(key) {
1668
- return this.get(key) !== null;
1669
- }
1670
- keys() {
1671
- const allKeys = Object.keys(this.storage);
1672
- if (this.namespace) {
1673
- const prefix = `${this.namespace}:`;
1674
- return allKeys.filter((key) => key.startsWith(prefix)).map((key) => key.slice(prefix.length));
1675
- }
1676
- return allKeys;
1677
- }
1678
- size() {
1679
- return this.keys().length;
1680
- }
1681
- getQuota() {
1682
- if ("storage" in navigator && "estimate" in navigator.storage) {
1683
- return null;
1684
- }
1685
- try {
1686
- let totalSize = 0;
1687
- for (let i = 0;i < this.storage.length; i++) {
1688
- const key = this.storage.key(i);
1689
- if (key) {
1690
- const value = this.storage.getItem(key) || "";
1691
- totalSize += key.length + value.length;
1692
- }
1693
- }
1694
- const estimatedQuota = 5 * 1024 * 1024;
1695
- return {
1696
- usage: totalSize * 2,
1697
- quota: estimatedQuota,
1698
- percentage: totalSize * 2 / estimatedQuota * 100
1699
- };
1700
- } catch {
1701
- return null;
1702
- }
1703
- }
1704
- setMany(items, options) {
1705
- Object.entries(items).forEach(([key, value]) => {
1706
- this.set(key, value, options);
1707
- });
1708
- }
1709
- getMany(keys) {
1710
- const result = {};
1711
- keys.forEach((key) => {
1712
- result[key] = this.get(key);
1713
- });
1714
- return result;
1715
- }
1716
- removeMany(keys) {
1717
- keys.forEach((key) => this.remove(key));
1718
- }
1719
- }
1720
- var storage = {
1721
- local: new StorageManager("local"),
1722
- session: new StorageManager("session")
1723
- };
1724
- function createStorage(type = "local", namespace) {
1725
- return new StorageManager(type, namespace);
1726
- }
1727
- // src/ui/switch/Switch.stx
1728
- var Switch_default = "./Switch-hdta55a8.stx";
1729
- // src/ui/table/Table.stx
1730
- var Table_default = "./Table-0mc3fdek.stx";
1731
- // src/ui/table/TableBody.stx
1732
- var TableBody_default = "./TableBody-drxyz5jh.stx";
1733
- // src/ui/table/TableCell.stx
1734
- var TableCell_default = "./TableCell-8swtcq8s.stx";
1735
- // src/ui/table/TableHead.stx
1736
- var TableHead_default = "./TableHead-e9xvjx2j.stx";
1737
- // src/ui/table/TableHeader.stx
1738
- var TableHeader_default = "./TableHeader-sxc77b4d.stx";
1739
- // src/ui/table/TableRow.stx
1740
- var TableRow_default = "./TableRow-xd542nvb.stx";
1741
- // src/ui/tabs/TabPanel.stx
1742
- var TabPanel_default = "./TabPanel-5htevsq6.stx";
1743
- // src/ui/tabs/Tabs.stx
1744
- var Tabs_default = "./Tabs-b4xsba1w.stx";
1745
- // src/ui/teleport/Teleport.stx
1746
- var Teleport_default = "./Teleport-tsx4bt4n.stx";
1747
- // src/ui/textarea/Textarea.stx
1748
- var Textarea_default = "./Textarea-xcdym703.stx";
1749
- // src/ui/tooltip/Tooltip.stx
1750
- var Tooltip_default = "./Tooltip-y61h04gp.stx";
1751
- // src/ui/transition/Transition.stx
1752
- var Transition_default = "./Transition-7smenaz8.stx";
1753
- // src/ui/video/Video.stx
1754
- var Video_default = "./Video-a0aeyexv.stx";
1755
- // src/ui/virtual-list/VirtualList.stx
1756
- var VirtualList_default = "./VirtualList-fa7v5a3h.stx";
1757
- // src/ui/virtual-table/VirtualTable.stx
1758
- var VirtualTable_default = "./VirtualTable-jvm1784g.stx";
1759
- // src/utils/accessibility.ts
1760
- var idCounter = 0;
1761
- function generateId(prefix = "a11y") {
1762
- return `${prefix}-${++idCounter}-${Date.now()}`;
1763
- }
1764
- function createAriaLabel(text, element, options = {}) {
1765
- const { visible = false, id = generateId("label") } = options;
1766
- const label = document.createElement(visible ? "label" : "span");
1767
- label.id = id;
1768
- label.textContent = text;
1769
- if (!visible) {
1770
- Object.assign(label.style, {
1771
- position: "absolute",
1772
- width: "1px",
1773
- height: "1px",
1774
- padding: "0",
1775
- margin: "-1px",
1776
- overflow: "hidden",
1777
- clip: "rect(0, 0, 0, 0)",
1778
- whiteSpace: "nowrap",
1779
- border: "0"
1780
- });
1781
- }
1782
- if (element) {
1783
- element.setAttribute("aria-labelledby", id);
1784
- if (element.parentElement) {
1785
- element.parentElement.insertBefore(label, element);
1786
- } else {
1787
- document.body.appendChild(label);
1788
- }
1789
- }
1790
- return id;
1791
- }
1792
- function createAriaDescription(text, element) {
1793
- const id = generateId("desc");
1794
- const description = document.createElement("span");
1795
- description.id = id;
1796
- description.textContent = text;
1797
- Object.assign(description.style, {
1798
- position: "absolute",
1799
- width: "1px",
1800
- height: "1px",
1801
- padding: "0",
1802
- margin: "-1px",
1803
- overflow: "hidden",
1804
- clip: "rect(0, 0, 0, 0)",
1805
- whiteSpace: "nowrap",
1806
- border: "0"
1807
- });
1808
- if (element) {
1809
- element.setAttribute("aria-describedby", id);
1810
- if (element.parentElement) {
1811
- element.parentElement.insertBefore(description, element);
1812
- } else {
1813
- document.body.appendChild(description);
1814
- }
1815
- }
1816
- return id;
1817
- }
1818
- function announceToScreenReader(message, priority = "polite") {
1819
- const announcement = document.createElement("div");
1820
- announcement.setAttribute("role", "status");
1821
- announcement.setAttribute("aria-live", priority);
1822
- announcement.setAttribute("aria-atomic", "true");
1823
- Object.assign(announcement.style, {
1824
- position: "absolute",
1825
- width: "1px",
1826
- height: "1px",
1827
- padding: "0",
1828
- margin: "-1px",
1829
- overflow: "hidden",
1830
- clip: "rect(0, 0, 0, 0)",
1831
- whiteSpace: "nowrap",
1832
- border: "0"
1833
- });
1834
- document.body.appendChild(announcement);
1835
- setTimeout(() => {
1836
- announcement.textContent = message;
1837
- }, 100);
1838
- setTimeout(() => {
1839
- announcement.parentNode?.removeChild(announcement);
1840
- }, 1000);
1841
- }
1842
- function getFocusableElements(container) {
1843
- const selector = [
1844
- "a[href]",
1845
- "area[href]",
1846
- 'input:not([disabled]):not([type="hidden"])',
1847
- "select:not([disabled])",
1848
- "textarea:not([disabled])",
1849
- "button:not([disabled])",
1850
- "iframe",
1851
- "object",
1852
- "embed",
1853
- "[contenteditable]",
1854
- '[tabindex]:not([tabindex="-1"])'
1855
- ].join(",");
1856
- return Array.from(container.querySelectorAll(selector)).filter((element) => element.offsetParent !== null);
1857
- }
1858
- function createFocusTrap(container, options = {}) {
1859
- const {
1860
- initialFocus,
1861
- returnFocus,
1862
- escapeDeactivates = true,
1863
- clickOutsideDeactivates = true,
1864
- allowOutsideClick = false,
1865
- onActivate,
1866
- onDeactivate
1867
- } = options;
1868
- let isActive = false;
1869
- let isPaused = false;
1870
- let previouslyFocused = null;
1871
- const handleKeyDown = (event) => {
1872
- if (isPaused)
1873
- return;
1874
- if (escapeDeactivates && event.key === "Escape") {
1875
- event.preventDefault();
1876
- deactivate();
1877
- return;
1878
- }
1879
- if (event.key === "Tab") {
1880
- const focusableElements = getFocusableElements(container);
1881
- if (focusableElements.length === 0) {
1882
- event.preventDefault();
1883
- return;
1884
- }
1885
- const firstElement = focusableElements[0];
1886
- const lastElement = focusableElements[focusableElements.length - 1];
1887
- if (event.shiftKey) {
1888
- if (document.activeElement === firstElement) {
1889
- event.preventDefault();
1890
- lastElement.focus();
1891
- }
1892
- } else {
1893
- if (document.activeElement === lastElement) {
1894
- event.preventDefault();
1895
- firstElement.focus();
1896
- }
1897
- }
1898
- }
1899
- };
1900
- const handleClickOutside = (event) => {
1901
- if (isPaused)
1902
- return;
1903
- if (!container.contains(event.target)) {
1904
- if (typeof allowOutsideClick === "function") {
1905
- if (!allowOutsideClick(event) && clickOutsideDeactivates) {
1906
- deactivate();
1907
- }
1908
- } else if (!allowOutsideClick && clickOutsideDeactivates) {
1909
- deactivate();
1910
- }
1911
- }
1912
- };
1913
- function activate() {
1914
- if (isActive)
1915
- return;
1916
- isActive = true;
1917
- previouslyFocused = document.activeElement;
1918
- const elementToFocus = initialFocus || getFocusableElements(container)[0];
1919
- if (elementToFocus && typeof elementToFocus.focus === "function") {
1920
- elementToFocus.focus();
1921
- }
1922
- document.addEventListener("keydown", handleKeyDown);
1923
- document.addEventListener("click", handleClickOutside);
1924
- onActivate?.();
1925
- }
1926
- function deactivate() {
1927
- if (!isActive)
1928
- return;
1929
- isActive = false;
1930
- const elementToFocus = returnFocus || previouslyFocused;
1931
- if (elementToFocus && typeof elementToFocus.focus === "function") {
1932
- elementToFocus.focus();
1933
- }
1934
- document.removeEventListener("keydown", handleKeyDown);
1935
- document.removeEventListener("click", handleClickOutside);
1936
- onDeactivate?.();
1937
- }
1938
- function pause() {
1939
- isPaused = true;
1940
- }
1941
- function unpause() {
1942
- isPaused = false;
1943
- }
1944
- return {
1945
- activate,
1946
- deactivate,
1947
- pause,
1948
- unpause
1949
- };
1950
- }
1951
- function createRovingTabindex(container, options = {}) {
1952
- const {
1953
- selector = '[role="option"], [role="menuitem"], [role="tab"], button',
1954
- initialIndex = 0,
1955
- orientation = "both",
1956
- loop = true,
1957
- onFocusChange
1958
- } = options;
1959
- let currentIndex = initialIndex;
1960
- const getItems = () => {
1961
- return Array.from(container.querySelectorAll(selector));
1962
- };
1963
- const setFocusedIndex = (index) => {
1964
- const items = getItems();
1965
- if (index < 0 || index >= items.length)
1966
- return;
1967
- items.forEach((item, i) => {
1968
- if (i === index) {
1969
- item.setAttribute("tabindex", "0");
1970
- if (typeof item.focus === "function") {
1971
- item.focus();
1972
- }
1973
- } else {
1974
- item.setAttribute("tabindex", "-1");
1975
- }
1976
- });
1977
- currentIndex = index;
1978
- onFocusChange?.(index, items[index]);
1979
- };
1980
- const handleKeyDown = (event) => {
1981
- const items = getItems();
1982
- const maxIndex = items.length - 1;
1983
- let handled = false;
1984
- let newIndex = currentIndex;
1985
- switch (event.key) {
1986
- case "ArrowRight":
1987
- if (orientation === "horizontal" || orientation === "both") {
1988
- newIndex = currentIndex + 1;
1989
- if (newIndex > maxIndex) {
1990
- newIndex = loop ? 0 : maxIndex;
1991
- }
1992
- handled = true;
1993
- }
1994
- break;
1995
- case "ArrowLeft":
1996
- if (orientation === "horizontal" || orientation === "both") {
1997
- newIndex = currentIndex - 1;
1998
- if (newIndex < 0) {
1999
- newIndex = loop ? maxIndex : 0;
2000
- }
2001
- handled = true;
2002
- }
2003
- break;
2004
- case "ArrowDown":
2005
- if (orientation === "vertical" || orientation === "both") {
2006
- newIndex = currentIndex + 1;
2007
- if (newIndex > maxIndex) {
2008
- newIndex = loop ? 0 : maxIndex;
2009
- }
2010
- handled = true;
2011
- }
2012
- break;
2013
- case "ArrowUp":
2014
- if (orientation === "vertical" || orientation === "both") {
2015
- newIndex = currentIndex - 1;
2016
- if (newIndex < 0) {
2017
- newIndex = loop ? maxIndex : 0;
2018
- }
2019
- handled = true;
2020
- }
2021
- break;
2022
- case "Home":
2023
- newIndex = 0;
2024
- handled = true;
2025
- break;
2026
- case "End":
2027
- newIndex = maxIndex;
2028
- handled = true;
2029
- break;
2030
- }
2031
- if (handled) {
2032
- event.preventDefault();
2033
- setFocusedIndex(newIndex);
2034
- }
2035
- };
2036
- setFocusedIndex(initialIndex);
2037
- container.addEventListener("keydown", handleKeyDown);
2038
- return () => {
2039
- container.removeEventListener("keydown", handleKeyDown);
2040
- };
2041
- }
2042
- var KeyboardKeys = {
2043
- Enter: "Enter",
2044
- Space: " ",
2045
- Escape: "Escape",
2046
- ArrowUp: "ArrowUp",
2047
- ArrowDown: "ArrowDown",
2048
- ArrowLeft: "ArrowLeft",
2049
- ArrowRight: "ArrowRight",
2050
- Tab: "Tab",
2051
- Home: "Home",
2052
- End: "End",
2053
- PageUp: "PageUp",
2054
- PageDown: "PageDown"
2055
- };
2056
- function hasFocus(element) {
2057
- return document.activeElement === element;
2058
- }
2059
- function moveFocus(direction, from) {
2060
- const activeElement = from || document.activeElement;
2061
- const focusableElements = getFocusableElements(document.body);
2062
- const currentIndex = focusableElements.indexOf(activeElement);
2063
- if (currentIndex === -1)
2064
- return;
2065
- const nextIndex = direction === "next" ? currentIndex + 1 : currentIndex - 1;
2066
- const nextElement = focusableElements[nextIndex];
2067
- if (nextElement) {
2068
- nextElement.focus();
2069
- }
2070
- }
2071
- function isVisibleToScreenReader(element) {
2072
- if (element.getAttribute("aria-hidden") === "true") {
2073
- return false;
2074
- }
2075
- const style = window.getComputedStyle(element);
2076
- if (style.display === "none" || style.visibility === "hidden") {
2077
- return false;
2078
- }
2079
- return true;
2080
- }
2081
- var aria = {
2082
- setExpanded(element, expanded) {
2083
- element.setAttribute("aria-expanded", String(expanded));
2084
- },
2085
- setSelected(element, selected) {
2086
- element.setAttribute("aria-selected", String(selected));
2087
- },
2088
- setChecked(element, checked) {
2089
- element.setAttribute("aria-checked", String(checked));
2090
- },
2091
- setDisabled(element, disabled) {
2092
- element.setAttribute("aria-disabled", String(disabled));
2093
- if (disabled) {
2094
- element.setAttribute("tabindex", "-1");
2095
- } else {
2096
- element.removeAttribute("tabindex");
2097
- }
2098
- },
2099
- setHidden(element, hidden) {
2100
- if (hidden) {
2101
- element.setAttribute("aria-hidden", "true");
2102
- } else {
2103
- element.removeAttribute("aria-hidden");
2104
- }
2105
- },
2106
- setPressed(element, pressed) {
2107
- element.setAttribute("aria-pressed", String(pressed));
2108
- },
2109
- setInvalid(element, invalid) {
2110
- element.setAttribute("aria-invalid", String(invalid));
2111
- },
2112
- setRequired(element, required) {
2113
- element.setAttribute("aria-required", String(required));
2114
- },
2115
- setLive(element, live) {
2116
- element.setAttribute("aria-live", live);
2117
- },
2118
- setBusy(element, busy) {
2119
- element.setAttribute("aria-busy", String(busy));
2120
- }
2121
- };
2122
- function createScreenReaderText(text) {
2123
- const span = document.createElement("span");
2124
- span.textContent = text;
2125
- span.className = "sr-only";
2126
- Object.assign(span.style, {
2127
- position: "absolute",
2128
- width: "1px",
2129
- height: "1px",
2130
- padding: "0",
2131
- margin: "-1px",
2132
- overflow: "hidden",
2133
- clip: "rect(0, 0, 0, 0)",
2134
- whiteSpace: "nowrap",
2135
- border: "0"
2136
- });
2137
- return span;
2138
- }
2139
- function prefersReducedMotion() {
2140
- if (typeof window.matchMedia === "function") {
2141
- return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
2142
- }
2143
- return false;
2144
- }
2145
- function prefersHighContrast() {
2146
- if (typeof window.matchMedia === "function") {
2147
- return window.matchMedia("(prefers-contrast: high)").matches;
2148
- }
2149
- return false;
2150
- }
2151
- function getColorSchemePreference() {
2152
- if (typeof window.matchMedia === "function") {
2153
- if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
2154
- return "dark";
2155
- }
2156
- if (window.matchMedia("(prefers-color-scheme: light)").matches) {
2157
- return "light";
2158
- }
2159
- }
2160
- return null;
2161
- }
2162
- function createSkipLink(targetId, text = "Skip to main content") {
2163
- const link = document.createElement("a");
2164
- link.href = `#${targetId}`;
2165
- link.textContent = text;
2166
- link.className = "skip-link";
2167
- Object.assign(link.style, {
2168
- position: "absolute",
2169
- top: "-40px",
2170
- left: "0",
2171
- background: "#000",
2172
- color: "#fff",
2173
- padding: "8px",
2174
- textDecoration: "none",
2175
- zIndex: "100"
2176
- });
2177
- link.addEventListener("focus", () => {
2178
- link.style.top = "0";
2179
- });
2180
- link.addEventListener("blur", () => {
2181
- link.style.top = "-40px";
2182
- });
2183
- return link;
2184
- }
2185
- function validateAriaRelationships(element) {
2186
- const errors = [];
2187
- const checkAttribute = (attr) => {
2188
- const value = element.getAttribute(attr);
2189
- if (value) {
2190
- const ids = value.split(" ");
2191
- for (const id of ids) {
2192
- if (!document.getElementById(id)) {
2193
- errors.push(`${attr} references non-existent ID: ${id}`);
2194
- }
2195
- }
2196
- }
2197
- };
2198
- checkAttribute("aria-labelledby");
2199
- checkAttribute("aria-describedby");
2200
- checkAttribute("aria-controls");
2201
- checkAttribute("aria-owns");
2202
- checkAttribute("aria-activedescendant");
2203
- return errors;
2204
- }
2205
- // src/utils/animation/easing.ts
2206
- var linear = (t, b, c, d) => {
2207
- return c * t / d + b;
2208
- };
2209
- var easeInQuad = (t, b, c, d) => {
2210
- t /= d;
2211
- return c * t * t + b;
2212
- };
2213
- var easeOutQuad = (t, b, c, d) => {
2214
- t /= d;
2215
- return -c * t * (t - 2) + b;
2216
- };
2217
- var easeInOutQuad = (t, b, c, d) => {
2218
- t /= d / 2;
2219
- if (t < 1)
2220
- return c / 2 * t * t + b;
2221
- t--;
2222
- return -c / 2 * (t * (t - 2) - 1) + b;
2223
- };
2224
- var easeInCubic = (t, b, c, d) => {
2225
- t /= d;
2226
- return c * t * t * t + b;
2227
- };
2228
- var easeOutCubic = (t, b, c, d) => {
2229
- t /= d;
2230
- t--;
2231
- return c * (t * t * t + 1) + b;
2232
- };
2233
- var easeInOutCubic = (t, b, c, d) => {
2234
- t /= d / 2;
2235
- if (t < 1)
2236
- return c / 2 * t * t * t + b;
2237
- t -= 2;
2238
- return c / 2 * (t * t * t + 2) + b;
2239
- };
2240
- var easeInQuart = (t, b, c, d) => {
2241
- t /= d;
2242
- return c * t * t * t * t + b;
2243
- };
2244
- var easeOutQuart = (t, b, c, d) => {
2245
- t /= d;
2246
- t--;
2247
- return -c * (t * t * t * t - 1) + b;
2248
- };
2249
- var easeInOutQuart = (t, b, c, d) => {
2250
- t /= d / 2;
2251
- if (t < 1)
2252
- return c / 2 * t * t * t * t + b;
2253
- t -= 2;
2254
- return -c / 2 * (t * t * t * t - 2) + b;
2255
- };
2256
- var easeInQuint = (t, b, c, d) => {
2257
- t /= d;
2258
- return c * t * t * t * t * t + b;
2259
- };
2260
- var easeOutQuint = (t, b, c, d) => {
2261
- t /= d;
2262
- t--;
2263
- return c * (t * t * t * t * t + 1) + b;
2264
- };
2265
- var easeInOutQuint = (t, b, c, d) => {
2266
- t /= d / 2;
2267
- if (t < 1)
2268
- return c / 2 * t * t * t * t * t + b;
2269
- t -= 2;
2270
- return c / 2 * (t * t * t * t * t + 2) + b;
2271
- };
2272
- var easeInSine = (t, b, c, d) => {
2273
- return -c * Math.cos(t / d * (Math.PI / 2)) + c + b;
2274
- };
2275
- var easeOutSine = (t, b, c, d) => {
2276
- return c * Math.sin(t / d * (Math.PI / 2)) + b;
2277
- };
2278
- var easeInOutSine = (t, b, c, d) => {
2279
- return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b;
2280
- };
2281
- var easeInExpo = (t, b, c, d) => {
2282
- return t === 0 ? b : c * 2 ** (10 * (t / d - 1)) + b;
2283
- };
2284
- var easeOutExpo = (t, b, c, d) => {
2285
- return t === d ? b + c : c * (-(2 ** (-10 * t / d)) + 1) + b;
2286
- };
2287
- var easeInOutExpo = (t, b, c, d) => {
2288
- if (t === 0)
2289
- return b;
2290
- if (t === d)
2291
- return b + c;
2292
- t /= d / 2;
2293
- if (t < 1)
2294
- return c / 2 * 2 ** (10 * (t - 1)) + b;
2295
- t--;
2296
- return c / 2 * (-(2 ** (-10 * t)) + 2) + b;
2297
- };
2298
- var easeInCirc = (t, b, c, d) => {
2299
- t /= d;
2300
- return -c * (Math.sqrt(1 - t * t) - 1) + b;
2301
- };
2302
- var easeOutCirc = (t, b, c, d) => {
2303
- t /= d;
2304
- t--;
2305
- return c * Math.sqrt(1 - t * t) + b;
2306
- };
2307
- var easeInOutCirc = (t, b, c, d) => {
2308
- t /= d / 2;
2309
- if (t < 1)
2310
- return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b;
2311
- t -= 2;
2312
- return c / 2 * (Math.sqrt(1 - t * t) + 1) + b;
2313
- };
2314
- var easeInElastic = (t, b, c, d) => {
2315
- let s = 1.70158;
2316
- let p = 0;
2317
- let a = c;
2318
- if (t === 0)
2319
- return b;
2320
- t /= d;
2321
- if (t === 1)
2322
- return b + c;
2323
- if (!p)
2324
- p = d * 0.3;
2325
- if (a < Math.abs(c)) {
2326
- a = c;
2327
- s = p / 4;
2328
- } else {
2329
- s = p / (2 * Math.PI) * Math.asin(c / a);
2330
- }
2331
- t -= 1;
2332
- return -(a * 2 ** (10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
2333
- };
2334
- var easeOutElastic = (t, b, c, d) => {
2335
- let s = 1.70158;
2336
- let p = 0;
2337
- let a = c;
2338
- if (t === 0)
2339
- return b;
2340
- t /= d;
2341
- if (t === 1)
2342
- return b + c;
2343
- if (!p)
2344
- p = d * 0.3;
2345
- if (a < Math.abs(c)) {
2346
- a = c;
2347
- s = p / 4;
2348
- } else {
2349
- s = p / (2 * Math.PI) * Math.asin(c / a);
2350
- }
2351
- return a * 2 ** (-10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b;
2352
- };
2353
- var easeInOutElastic = (t, b, c, d) => {
2354
- let s = 1.70158;
2355
- let p = 0;
2356
- let a = c;
2357
- if (t === 0)
2358
- return b;
2359
- t /= d / 2;
2360
- if (t === 2)
2361
- return b + c;
2362
- if (!p)
2363
- p = d * (0.3 * 1.5);
2364
- if (a < Math.abs(c)) {
2365
- a = c;
2366
- s = p / 4;
2367
- } else {
2368
- s = p / (2 * Math.PI) * Math.asin(c / a);
2369
- }
2370
- if (t < 1) {
2371
- t -= 1;
2372
- return -0.5 * (a * 2 ** (10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
2373
- }
2374
- t -= 1;
2375
- return a * 2 ** (-10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) * 0.5 + c + b;
2376
- };
2377
- var easeInBack = (t, b, c, d) => {
2378
- const s = 1.70158;
2379
- t /= d;
2380
- return c * t * t * ((s + 1) * t - s) + b;
2381
- };
2382
- var easeOutBack = (t, b, c, d) => {
2383
- const s = 1.70158;
2384
- t /= d;
2385
- t--;
2386
- return c * (t * t * ((s + 1) * t + s) + 1) + b;
2387
- };
2388
- var easeInOutBack = (t, b, c, d) => {
2389
- let s = 1.70158;
2390
- t /= d / 2;
2391
- if (t < 1) {
2392
- s *= 1.525;
2393
- return c / 2 * (t * t * ((s + 1) * t - s)) + b;
2394
- }
2395
- t -= 2;
2396
- s *= 1.525;
2397
- return c / 2 * (t * t * ((s + 1) * t + s) + 2) + b;
2398
- };
2399
- var easeOutBounce = (t, b, c, d) => {
2400
- t /= d;
2401
- if (t < 1 / 2.75) {
2402
- return c * (7.5625 * t * t) + b;
2403
- } else if (t < 2 / 2.75) {
2404
- t -= 1.5 / 2.75;
2405
- return c * (7.5625 * t * t + 0.75) + b;
2406
- } else if (t < 2.5 / 2.75) {
2407
- t -= 2.25 / 2.75;
2408
- return c * (7.5625 * t * t + 0.9375) + b;
2409
- } else {
2410
- t -= 2.625 / 2.75;
2411
- return c * (7.5625 * t * t + 0.984375) + b;
2412
- }
2413
- };
2414
- var easeInBounce = (t, b, c, d) => {
2415
- return c - easeOutBounce(d - t, 0, c, d) + b;
2416
- };
2417
- var easeInOutBounce = (t, b, c, d) => {
2418
- if (t < d / 2)
2419
- return easeInBounce(t * 2, 0, c, d) * 0.5 + b;
2420
- return easeOutBounce(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b;
2421
- };
2422
- var Easing = {
2423
- linear,
2424
- easeInQuad,
2425
- easeOutQuad,
2426
- easeInOutQuad,
2427
- easeInCubic,
2428
- easeOutCubic,
2429
- easeInOutCubic,
2430
- easeInQuart,
2431
- easeOutQuart,
2432
- easeInOutQuart,
2433
- easeInQuint,
2434
- easeOutQuint,
2435
- easeInOutQuint,
2436
- easeInSine,
2437
- easeOutSine,
2438
- easeInOutSine,
2439
- easeInExpo,
2440
- easeOutExpo,
2441
- easeInOutExpo,
2442
- easeInCirc,
2443
- easeOutCirc,
2444
- easeInOutCirc,
2445
- easeInElastic,
2446
- easeOutElastic,
2447
- easeInOutElastic,
2448
- easeInBack,
2449
- easeOutBack,
2450
- easeInOutBack,
2451
- easeInBounce,
2452
- easeOutBounce,
2453
- easeInOutBounce
2454
- };
2455
-
2456
- // src/utils/animation/helpers.ts
2457
- function cssAnimation(name, options = {}) {
2458
- const {
2459
- duration = "1s",
2460
- timing = "ease",
2461
- delay = "0s",
2462
- iteration = "1",
2463
- direction = "normal",
2464
- fill = "both",
2465
- playState = "running"
2466
- } = options;
2467
- return `${name} ${duration} ${timing} ${delay} ${iteration} ${direction} ${fill} ${playState}`;
2468
- }
2469
- function applyAnimation(element, animationName, options = {}) {
2470
- element.style.animation = cssAnimation(animationName, options);
2471
- }
2472
- function removeAnimation(element) {
2473
- element.style.animation = "";
2474
- }
2475
- function waitForAnimation(element) {
2476
- return new Promise((resolve) => {
2477
- const handleAnimationEnd = () => {
2478
- element.removeEventListener("animationend", handleAnimationEnd);
2479
- resolve();
2480
- };
2481
- element.addEventListener("animationend", handleAnimationEnd);
2482
- });
2483
- }
2484
- function staggerAnimation(elements, animationName, options = {}) {
2485
- const { stagger = 100, ...animationOptions } = options;
2486
- elements.forEach((element, index) => {
2487
- const delay = `${index * stagger}ms`;
2488
- applyAnimation(element, animationName, {
2489
- ...animationOptions,
2490
- delay
2491
- });
2492
- });
2493
- }
2494
- async function sequenceAnimations(element, animations) {
2495
- for (const animation of animations) {
2496
- applyAnimation(element, animation.name, animation.options);
2497
- await waitForAnimation(element);
2498
- }
2499
- }
2500
- var AnimationClasses = {
2501
- fadeIn: "animate-fade-in",
2502
- fadeOut: "animate-fade-out",
2503
- slideInUp: "animate-slide-in-up",
2504
- slideInDown: "animate-slide-in-down",
2505
- slideInLeft: "animate-slide-in-left",
2506
- slideInRight: "animate-slide-in-right",
2507
- zoomIn: "animate-zoom-in",
2508
- zoomOut: "animate-zoom-out",
2509
- bounce: "animate-bounce",
2510
- spin: "animate-spin",
2511
- ping: "animate-ping",
2512
- pulse: "animate-pulse"
2513
- };
2514
- function animateWithClass(element, animationClass, duration = 1000) {
2515
- return new Promise((resolve) => {
2516
- element.classList.add(animationClass);
2517
- setTimeout(() => {
2518
- element.classList.remove(animationClass);
2519
- resolve();
2520
- }, duration);
2521
- });
2522
- }
2523
- function createKeyframes(name, frames) {
2524
- const keyframesRule = `
2525
- @keyframes ${name} {
2526
- ${Object.entries(frames).map(([percentage, styles]) => {
2527
- const styleString = Object.entries(styles).map(([prop, value]) => `${prop}: ${value};`).join(" ");
2528
- return `${percentage} { ${styleString} }`;
2529
- }).join(`
2
+ var he={__stx:!0,src:"./components/CodeBlock.stx"};var ge={__stx:!0,src:"./components/Footer.stx"};var xe={__stx:!0,src:"./components/Hero.stx"};var me={__stx:!0,src:"./components/Installation.stx"};function Qa(e){let{code:t,onSuccess:s,onError:o,timeout:a=2000}=e,i=!1,r=null;return{copied:i,copy:async()=>{try{if(!navigator.clipboard)throw Error("Clipboard API not available");await navigator.clipboard.writeText(t),i=!0,s?.(),r=setTimeout(()=>{i=!1,r=null},a)}catch(d){let f=d instanceof Error?d:Error("Failed to copy code");o?.(f),console.error("Failed to copy code:",f)}},reset:()=>{if(i=!1,r)clearTimeout(r),r=null}}}async function ei(e){try{return await navigator.clipboard.writeText(e),!0}catch(t){return console.error("Failed to copy to clipboard:",t),!1}}function ve(){if(typeof window>"u")return"light";return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Q(e){return e==="system"?ve():e}function si(e={}){let{storageKey:t="theme",defaultTheme:s="system"}=e,o=s;if(typeof window<"u"&&typeof localStorage<"u"){let c=localStorage.getItem(t);if(c)o=c}let a=Q(o)==="dark",i=(c)=>{let d=Q(c);if(typeof document<"u")if(d==="dark")document.documentElement.classList.add("dark");else document.documentElement.classList.remove("dark");if(typeof localStorage<"u")localStorage.setItem(t,c)},r=(c)=>{o=c,i(c)},n=()=>{let d=Q(o)==="dark"?"light":"dark";r(d)};if(i(o),typeof window<"u"&&o==="system")window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",(c)=>{if(o==="system")i("system")});return{isDark:a,theme:o,toggle:n,setTheme:r}}function we(e,t){if(typeof document>"u")return;document.title=t?t.replace("%s",e):e}function S(e,t,s=!1){if(typeof document>"u")return;let o=s?"property":"name",a=document.querySelector(`meta[${o}="${e}"]`);if(!a)a=document.createElement("meta"),a.setAttribute(o,e),document.head.appendChild(a);a.setAttribute("content",t)}function ye(e,t){if(typeof document>"u")return;let s=document.querySelector(`link[rel="${e}"]`);if(!s)s=document.createElement("link"),s.setAttribute("rel",e),document.head.appendChild(s);s.setAttribute("href",t)}function ai(e){let{title:t,description:s,author:o,keywords:a,ogImage:i,ogImageWidth:r,ogImageHeight:n,twitterCard:c="summary_large_image",twitterSite:d,twitterCreator:f,canonical:p}=e;if(t)we(t),S("og:title",t,!0),S("twitter:title",t);if(s)S("description",s),S("og:description",s,!0),S("twitter:description",s);if(o)S("author",o);if(a&&a.length>0)S("keywords",a.join(", "));if(i)S("og:image",i,!0),S("twitter:image",i);if(r)S("og:image:width",r,!0);if(n)S("og:image:height",n,!0);if(S("twitter:card",c),d)S("twitter:site",d);if(f)S("twitter:creator",f);if(p)ye("canonical",p);if(S("og:type","website",!0),typeof window<"u")S("og:url",window.location.href,!0)}function ii(e){let t=[],{title:s,description:o,author:a,keywords:i,ogImage:r,ogImageWidth:n,ogImageHeight:c,twitterCard:d="summary_large_image",twitterSite:f,twitterCreator:p,canonical:g}=e;if(s)t.push(`<title>${I(s)}</title>`),t.push(`<meta property="og:title" content="${I(s)}" />`),t.push(`<meta name="twitter:title" content="${I(s)}" />`);if(o)t.push(`<meta name="description" content="${I(o)}" />`),t.push(`<meta property="og:description" content="${I(o)}" />`),t.push(`<meta name="twitter:description" content="${I(o)}" />`);if(a)t.push(`<meta name="author" content="${I(a)}" />`);if(i&&i.length>0)t.push(`<meta name="keywords" content="${I(i.join(", "))}" />`);if(r)t.push(`<meta property="og:image" content="${I(r)}" />`),t.push(`<meta name="twitter:image" content="${I(r)}" />`);if(n)t.push(`<meta property="og:image:width" content="${I(n)}" />`);if(c)t.push(`<meta property="og:image:height" content="${I(c)}" />`);if(t.push(`<meta name="twitter:card" content="${I(d)}" />`),f)t.push(`<meta name="twitter:site" content="${I(f)}" />`);if(p)t.push(`<meta name="twitter:creator" content="${I(p)}" />`);if(g)t.push(`<link rel="canonical" href="${I(g)}" />`);return t.push('<meta property="og:type" content="website" />'),t.join(`
3
+ `)}function I(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function ni(e,t,s={}){let{enabled:o=!0,ignore:a=[]}=s,i=(r)=>{if(!o||!e)return;let n=r.target;if(!e.contains(n)){if(!a.some((d)=>{let f=document.querySelectorAll(d);return Array.from(f).some((p)=>p.contains(n))}))t(r)}};if(typeof document<"u")document.addEventListener("mousedown",i),document.addEventListener("touchstart",i);return()=>{if(typeof document<"u")document.removeEventListener("mousedown",i),document.removeEventListener("touchstart",i)}}function ci(e,t={}){let{enabled:s=!0,initialFocus:o=null,returnFocus:a=!0,fallbackFocus:i=null}=t,r=null,n=!1;function c(){if(!e)return[];let b=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");return Array.from(e.querySelectorAll(b))}function d(b){if(!s||!n||!e)return;let w=c();if(w.length===0){b.preventDefault();return}let v=w[0],k=w[w.length-1];if(b.shiftKey){if(document.activeElement===v||document.activeElement===e)b.preventDefault(),k.focus()}else if(document.activeElement===k)b.preventDefault(),v.focus()}function f(b){if(b.key==="Escape"&&s&&n)g()}function p(){if(!s||!e||n)return;if(r=document.activeElement,o)o.focus();else{let b=c();if(b.length>0)b[0].focus();else if(i)i.focus();else e.focus()}document.addEventListener("keydown",d),document.addEventListener("keydown",f),n=!0}function g(){if(!n)return;if(document.removeEventListener("keydown",d),document.removeEventListener("keydown",f),a&&r)r.focus();n=!1}return{activate:p,deactivate:g}}function pi(e,t={}){let{enabled:s=!0,preventDefault:o=!0,stopPropagation:a=!1,target:i=typeof document<"u"?document:null}=t,r=Array.isArray(e)?e:[e],n=(c)=>{if(!s)return;r.forEach((d)=>{if(!(Array.isArray(d.key)?d.key:[d.key]).some((g)=>g.toLowerCase()===c.key.toLowerCase()))return;if(d.ctrl!==void 0&&d.ctrl!==c.ctrlKey)return;if(d.shift!==void 0&&d.shift!==c.shiftKey)return;if(d.alt!==void 0&&d.alt!==c.altKey)return;if(d.meta!==void 0&&d.meta!==c.metaKey)return;if(o)c.preventDefault();if(a)c.stopPropagation();d.handler(c)})};if(i)i.addEventListener("keydown",n);return()=>{if(i)i.removeEventListener("keydown",n)}}var ui={ESCAPE:"Escape",ENTER:"Enter",SPACE:" ",TAB:"Tab",ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",HOME:"Home",END:"End",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown"};function bi(e,t,s={}){let{serializer:o=JSON.stringify,deserializer:a=JSON.parse,onError:i=console.error}=s,r=t;try{if(typeof window<"u"){let p=window.localStorage.getItem(e);if(p!==null)r=a(p)}}catch(p){i(p)}let n=r,c=new Set;function d(p){try{let g=typeof p==="function"?p(n):p;if(n=g,typeof window<"u")window.localStorage.setItem(e,o(g));c.forEach((b)=>b(g))}catch(g){i(g)}}function f(){try{if(n=t,typeof window<"u")window.localStorage.removeItem(e);c.forEach((p)=>p(t))}catch(p){i(p)}}if(typeof window<"u"){let p=(g)=>{if(g.key===e&&g.newValue!==null)try{let b=a(g.newValue);n=b,c.forEach((w)=>w(b))}catch(b){i(b)}else if(g.key===e&&g.newValue===null)n=t,c.forEach((b)=>b(t))};window.addEventListener("storage",p)}return{value:n,setValue:d,removeValue:f}}function R(e,t={}){let{defaultValue:s=!1}=t,o=s,a=null;if(typeof window<"u"&&"matchMedia"in window){a=window.matchMedia(e),o=a.matches;let r=(n)=>{o=n.matches};if(a.addEventListener)a.addEventListener("change",r);else a.addListener(r)}function i(){if(a)o=a.matches}return{matches:o,updateMatches:i}}var q={xs:"(min-width: 320px)",sm:"(min-width: 640px)",md:"(min-width: 768px)",lg:"(min-width: 1024px)",xl:"(min-width: 1280px)","2xl":"(min-width: 1536px)",mobile:"(max-width: 767px)",tablet:"(min-width: 768px) and (max-width: 1023px)",desktop:"(min-width: 1024px)",dark:"(prefers-color-scheme: dark)",light:"(prefers-color-scheme: light)",reducedMotion:"(prefers-reduced-motion: reduce)",portrait:"(orientation: portrait)",landscape:"(orientation: landscape)"};function gi(e){return R(q[e])}function xi(){return R(q.mobile)}function mi(){return R(q.desktop)}function vi(){return R(q.dark)}function wi(){return R(q.reducedMotion)}var re=["gray","neutral","slate","zinc","red","green","yellow","blue","indigo"],Ci="--stx-color";function Ce(e,t){return t===void 0?`var(${e})`:`var(${e}, ${t})`}function $i(e={}){let t={};for(let s of re){let o=e[s];if(!o||typeof o==="string")continue;let a={};for(let[i,r]of Object.entries(o))a[i]=Ce(`--stx-color-${s}-${i}`,r);t[s]=a}return t}function ki(e={}){let t=[];for(let s of re){let o=e[s];if(!o||typeof o==="string")continue;for(let a of Object.keys(o))t.push(`--stx-color-${s}-${a}`)}return t}var ke="./Accordion-8tv78bh9.stx";var Ie="./AccordionItem-7bd3ga36.stx";var Te="./Audio-y0sgq50z.stx";var Ae="./Login-2cp65d41.stx";var ze="./Signup-cbncrtvd.stx";var Ee="./TwoFactorChallenge-y7n4yrk9.stx";var Me="./Avatar-rjvwnskf.stx";var qe="./Badge-k52qmxcm.stx";var je="./Breadcrumb-sy5taqsn.stx";import B from"process";var He="https://stacksjs.com/components";class N extends Error{component;context;constructor(e,t,s={}){let o=N.formatMessage(e,t,s);super(o);if(this.name="ComponentError",this.component=e,this.context={component:e,...s},Error.captureStackTrace)Error.captureStackTrace(this,N)}static formatMessage(e,t,s){let o=`[${e}] ${t}`;if(s.prop)o+=`
4
+ Prop: "${s.prop}"`;if(s.received!==void 0)o+=`
5
+ Received: ${JSON.stringify(s.received)}`;if(s.expected!==void 0){let a=Array.isArray(s.expected)?s.expected.map((i)=>JSON.stringify(i)).join(", "):JSON.stringify(s.expected);o+=`
6
+ Expected: ${a}`}if(s.details)o+=`
7
+ Details: ${s.details}`;if(s.docsUrl)o+=`
8
+ Documentation: ${s.docsUrl}`;else if(e)o+=`
9
+ Documentation: ${He}/${e.toLowerCase()}`;return o}toJSON(){return{name:this.name,message:this.message,component:this.component,context:this.context,stack:this.stack}}}var M={invalidProp(e,t,s,o){return new N(e,`Invalid prop value for "${t}"`,{prop:t,received:s,expected:o,details:Array.isArray(o)?`The "${t}" prop must be one of the allowed values`:`The "${t}" prop does not match the expected type`})},requiredProp(e,t){return new N(e,`Required prop "${t}" is missing`,{prop:t,details:`The "${t}" prop is required for ${e} to function correctly`})},invalidType(e,t,s,o){return new N(e,`Invalid type for prop "${t}"`,{prop:t,received:typeof s,expected:o,details:`Expected "${t}" to be of type ${o}, but received ${typeof s}`})},componentNotFound(e){return new N("ComponentLoader",`Component "${e}" not found`,{component:e,details:"Make sure the component is properly imported and registered"})},invalidChildren(e,t,s){return new N(e,"Invalid children",{received:typeof t,expected:s,details:`${e} expects ${s} as children`})},stateUpdate(e,t,s){return new N(e,`Failed to update state "${t}"`,{details:s.message})},eventHandler(e,t,s){return new N(e,`Error in "${t}" event handler`,{details:s.message})},render(e,t){return new N(e,"Failed to render component",{details:t.message})}},V=null;function Xi(e){V=e}function Zi(){V=null}function W(e,t={}){let{throwError:s=!0,logError:o=!0}=t;if(o&&B.env.NODE_ENV!=="production"){if(console.error("Component Error:",e),e instanceof N)console.group("Error Details"),console.log("Component:",e.component),console.log("Context:",e.context),console.groupEnd()}if(V)try{V(e)}catch(a){console.error("Error in error handler:",a)}if(s)throw e}function ne(e,t,s){return(...o)=>{try{let a=e(...o);if(a instanceof Promise)return a.catch((i)=>{let r=M.eventHandler(t,s,i);throw W(r,{throwError:!1}),r});return a}catch(a){let i=M.eventHandler(t,s,a);throw W(i,{throwError:!1}),i}}}function Ve(e,t){if(!e)throw t}function We(e,t,s={}){if(B.env.NODE_ENV==="production")return;let o=N.formatMessage(e,t,s);console.warn(`\u26A0\uFE0F ${o}`)}function Qi(e,t){if(B.env.NODE_ENV==="production")return;Ve(e,t)}function er(e){let t=typeof B<"u"&&B.env.DEBUG==="true";return{log(...s){if(t)console.log(`[${e}]`,...s)},warn(s,o){We(e,s,o)},error(s,o){let a=new N(e,s,o);W(a,{throwError:!1})}}}function tr(e,t,s){try{return t()}catch(o){let a=M.render(e,o);return W(a,{throwError:!1}),s}}import _e from"process";var _=_e.env.NODE_ENV!=="production";class ${validate;message;isRequired;constructor(e,t,s=!1){this.validate=e;this.message=t;this.isRequired=s}get required(){return new $(this.validate,this.message,!0)}}var l={string:new $((e)=>typeof e==="string",(e,t,s)=>`Invalid prop \`${t}\` of type \`${typeof e}\` supplied to \`${s}\`, expected \`string\`.`),number:new $((e)=>typeof e==="number"&&!Number.isNaN(e),(e,t,s)=>`Invalid prop \`${t}\` of type \`${typeof e}\` supplied to \`${s}\`, expected \`number\`.`),boolean:new $((e)=>typeof e==="boolean",(e,t,s)=>`Invalid prop \`${t}\` of type \`${typeof e}\` supplied to \`${s}\`, expected \`boolean\`.`),func:new $((e)=>typeof e==="function",(e,t,s)=>`Invalid prop \`${t}\` of type \`${typeof e}\` supplied to \`${s}\`, expected \`function\`.`),object:new $((e)=>typeof e==="object"&&e!==null&&!Array.isArray(e),(e,t,s)=>`Invalid prop \`${t}\` of type \`${typeof e}\` supplied to \`${s}\`, expected \`object\`.`),array:new $((e)=>Array.isArray(e),(e,t,s)=>`Invalid prop \`${t}\` of type \`${typeof e}\` supplied to \`${s}\`, expected \`array\`.`),any:new $(()=>!0,()=>""),oneOf(e){return new $((t)=>e.includes(t),(t,s,o)=>`Invalid prop \`${s}\` of value \`${t}\` supplied to \`${o}\`, expected one of [${e.map((a)=>JSON.stringify(a)).join(", ")}].`)},oneOfType(e){return new $((t,s,o)=>e.some((a)=>a.validate(t,s,o)),(t,s,o)=>`Invalid prop \`${s}\` supplied to \`${o}\`, expected one of the specified types.`)},arrayOf(e){return new $((t,s,o)=>{if(!Array.isArray(t))return!1;return t.every((a,i)=>e.validate(a,`${s}[${i}]`,o))},(t,s,o)=>`Invalid prop \`${s}\` supplied to \`${o}\`, expected array of specified type.`)},shape(e){return new $((t,s,o)=>{if(typeof t!=="object"||t===null||Array.isArray(t))return!1;for(let[a,i]of Object.entries(e)){if(i.isRequired&&!(a in t))return!1;if(a in t&&!i.validate(t[a],`${s}.${a}`,o))return!1}return!0},(t,s,o)=>`Invalid prop \`${s}\` supplied to \`${o}\`, expected object matching specified shape.`)},instanceOf(e){return new $((t)=>t instanceof e,(t,s,o)=>`Invalid prop \`${s}\` supplied to \`${o}\`, expected instance of \`${e.name}\`.`)},custom(e,t){return new $(e,typeof t==="string"?()=>t:t)},min(e){return new $((t)=>typeof t==="number"&&t>=e,(t,s,o)=>`Invalid prop \`${s}\` of value \`${t}\` supplied to \`${o}\`, expected value >= ${e}.`)},max(e){return new $((t)=>typeof t==="number"&&t<=e,(t,s,o)=>`Invalid prop \`${s}\` of value \`${t}\` supplied to \`${o}\`, expected value <= ${e}.`)},range(e,t){return new $((s)=>typeof s==="number"&&s>=e&&s<=t,(s,o,a)=>`Invalid prop \`${o}\` of value \`${s}\` supplied to \`${a}\`, expected value between ${e} and ${t}.`)},pattern(e){return new $((t)=>typeof t==="string"&&e.test(t),(t,s,o)=>`Invalid prop \`${s}\` of value \`${t}\` supplied to \`${o}\`, expected value matching pattern ${e}.`)},email:new $((e)=>typeof e==="string"&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),(e,t,s)=>`Invalid prop \`${t}\` of value \`${e}\` supplied to \`${s}\`, expected valid email address.`),url:new $((e)=>{if(typeof e!=="string")return!1;try{let t=new URL(e);return!0}catch{return!1}},(e,t,s)=>`Invalid prop \`${t}\` of value \`${e}\` supplied to \`${s}\`, expected valid URL.`)};function Fe(e,t,s,o={}){let{throwOnError:a=!1,logWarnings:i=_}=o,r=[];if(!_)return{valid:!0,errors:[]};for(let[n,c]of Object.entries(s)){let d=t[n],f=d===void 0;if(c.isRequired&&f){let p=`Required prop \`${n}\` was not specified in \`${e}\`.`;r.push(p);continue}if(f)continue;if(!c.validate(d,n,e)){let p=c.message(d,n,e);r.push(p)}}if(r.length>0){if(i)console.group(`\u26A0\uFE0F Prop validation failed for \`${e}\``),r.forEach((n)=>console.warn(n)),console.groupEnd();if(a)throw Error(`Prop validation failed for \`${e}\`:
10
+ ${r.join(`
11
+ `)}`)}return{valid:r.length===0,errors:r}}function A(e,t,s){return(o)=>Fe(e,o,t,s)}function ar(e,t,s="value"){if(!_)return;if(!t.validate(e,s,"assertion"))throw Error(t.message(e,s,"assertion"))}function ir(e,t,s="value"){if(!_)return;if(!t.validate(e,s,"warning"))console.warn(t.message(e,s,"warning"))}var Ge="./Button-wrwmnfpf.stx";var Ue={variant:l.oneOf(["primary","secondary","outline","ghost","danger"]),size:l.oneOf(["xs","sm","md","lg","xl"]),disabled:l.boolean,loading:l.boolean,type:l.oneOf(["button","submit","reset"]),fullWidth:l.boolean,leftIcon:l.string,rightIcon:l.string,className:l.string,onClick:l.func},dr=A("Button",Ue);function pr(e){return ne(e,"Button","onClick")}function ur(e){if(e&&!["primary","secondary","outline","ghost","danger"].includes(e))throw M.invalidProp("Button","variant",e,["primary","secondary","outline","ghost","danger"])}function fr(e){if(e&&!["xs","sm","md","lg","xl"].includes(e))throw M.invalidProp("Button","size",e,["xs","sm","md","lg","xl"])}var Je="./Calendar-gjjhhfnt.stx";var Ze="./Card-473a02fy.stx";var et="./Checkbox-2s2a7n4h.stx";var st="./Combobox-fdkr6cdq.stx";var at="./ComboboxButton-g76stp1e.stx";var rt="./ComboboxInput-z1293bbh.stx";var lt="./ComboboxOption-6yh7xk7q.stx";var dt="./ComboboxOptions-sq5360ae.stx";var ut="./CommandPalette-36mxf05w.stx";var bt="./CommandPaletteItem-chdw0070.stx";var gt="./Dialog-y5rz2vrq.stx";var mt="./DialogBackdrop-rxax3sec.stx";var wt="./DialogDescription-gth4c2kx.stx";var Ct="./DialogPanel-44d8jeqy.stx";var kt="./DialogTitle-x0r6k8x9.stx";var It="./Drawer-jgepqr9j.stx";var Tt="./Dropdown-vvhemtc0.stx";var At="./DropdownButton-wcz67dxy.stx";var zt="./DropdownItem-d8ht2bp5.stx";var Et="./DropdownItems-1sxnd5qn.stx";var Mt="./Form-vbag14t1.stx";var Rt={action:l.string,method:l.oneOf(["GET","POST","PUT","DELETE","PATCH"]),validationSchema:l.object,initialValues:l.object,validateOnChange:l.boolean,validateOnBlur:l.boolean,onSubmit:l.func,onError:l.func,className:l.string},fn=A("Form",Rt);var Bt="./Image-yhxcvgzs.stx";var Ht="./EmailInput-vak3kkmk.stx";var Wt="./NumberInput-j9p5bm5y.stx";var Ft="./PasswordInput-4qykq1dz.stx";var Gt="./SearchInput-pdx7agn0.stx";var Yt="./TextInput-cefyyprt.stx";var Jt={value:l.string,onChange:l.func,placeholder:l.string,disabled:l.boolean,readonly:l.boolean,size:l.oneOf(["sm","md","lg"]),error:l.boolean,label:l.string,helperText:l.string,required:l.boolean,className:l.string,inputClassName:l.string},Xt={value:l.string,onChange:l.func,placeholder:l.string,disabled:l.boolean,readonly:l.boolean,size:l.oneOf(["sm","md","lg"]),error:l.boolean,label:l.string,helperText:l.string,required:l.boolean,className:l.string,inputClassName:l.string,leftIcon:l.string,rightIcon:l.string,clearable:l.boolean,maxLength:l.number,showCount:l.boolean},Zt={value:l.string,onChange:l.func,placeholder:l.string,disabled:l.boolean,readonly:l.boolean,size:l.oneOf(["sm","md","lg"]),error:l.boolean,label:l.string,helperText:l.string,required:l.boolean,className:l.string,inputClassName:l.string,min:l.number,max:l.number,step:l.number,showControls:l.boolean},Qt={value:l.string,onChange:l.func,placeholder:l.string,disabled:l.boolean,readonly:l.boolean,size:l.oneOf(["sm","md","lg"]),error:l.boolean,label:l.string,helperText:l.string,required:l.boolean,className:l.string,inputClassName:l.string,showStrength:l.boolean},es={value:l.string,onChange:l.func,placeholder:l.string,disabled:l.boolean,readonly:l.boolean,size:l.oneOf(["sm","md","lg"]),error:l.boolean,label:l.string,helperText:l.string,required:l.boolean,className:l.string,inputClassName:l.string,onSearch:l.func,loading:l.boolean},Sn=A("TextInput",Xt),In=A("EmailInput",Jt),Nn=A("PasswordInput",Qt),Tn=A("NumberInput",Zt),Dn=A("SearchInput",es);var ss="./Listbox-q49tnr90.stx";var as="./ListboxButton-keb8gm0q.stx";var rs="./ListboxLabel-7mymt1b8.stx";var ls="./ListboxOption-4j070101.stx";var ds="./ListboxOptions-ejkatcfg.stx";var us="./Navigator-smpa7my4.stx";var bs="./Notification-03vfh3k6.stx";var gs="./Pagination-jbcjrfcs.stx";var ms="./Checkout-22wh3s22.stx";var ws="./DefaultPaymentMethod-6qrem3sg.stx";var Cs="./PaymentMethods-2xy66bwk.stx";var ks="./SubscriptionCheckout-7fdkwf04.stx";var Is="./Popover-et2q44m7.stx";var Ts="./PopoverButton-mffzc9pr.stx";var As="./PopoverPanel-054yh38h.stx";var zs="./Portal-1vf14s4x.stx";var Es="./Progress-4h7dytq5.stx";var Ms="./Radio-ccm07b2m.stx";var qs="./RadioGroup-eerw9gq7.stx";var js="./RadioGroupDescription-z34r9avr.stx";var Vs="./RadioGroupLabel-7mymt1b8.stx";var _s="./RadioGroupOption-7pq7rw84.stx";var Ks="./Select-zt72gg1e.stx";var Us="./Sidebar-v7ecx5gs.stx";var Js="./SidebarFooter-s7skj92y.stx";var Zs="./SidebarHeader-34bf4mm8.stx";var eo="./SidebarItem-5v8atp7p.stx";var so="./SidebarPinned-rq05nrtd.stx";var ao="./SidebarSection-zd9z35ch.stx";var ro="./SidebarSpace-r062weq2.stx";var lo="./SidebarSpaces-f149wvf1.stx";var po="./SidebarSpaceSwitcher-az9wqm87.stx";var F={blue:"#0088ff",red:"#ff383c",pink:"#ff2d55",orange:"#ff8d28",yellow:"#ffcc00",green:"#34c759",teal:"#00c3d0",cyan:"#00c0e8",indigo:"#6155f5",purple:"#cb30e0",brown:"#ac7f5e",gray:"#8e8e93"},O={pane:["bg-[#f2f2f4]/90 dark:bg-[#1c1c1e]/88","backdrop-blur-[50px] backdrop-saturate-[180%]","text-black dark:text-white","select-none"].join(" "),selection:"accent",layers:{shimmerRim:!0},scrollArea:"flex-1 overflow-y-auto overflow-x-hidden px-[10px] pb-[10px]",sectionHeader:["group/section flex w-full items-center","pl-[8px] pr-[6px] pt-[16px] pb-[5px]","text-[11px] font-semibold leading-[13px]","text-[#3c3c43]/60 dark:text-[#ebebf5]/60"].join(" "),sectionChevron:["i-f7-chevron-down h-[11px] w-[11px] ml-auto","text-[#3c3c43]/45 dark:text-[#ebebf5]/45","opacity-0 group-hover/section:opacity-100 transition-opacity duration-150","transition-transform duration-200"].join(" "),sectionGroup:"flex flex-col",item:{base:["flex w-full items-center","h-[32px] rounded-[8px] pl-[4px] pr-[8px]","text-[13px] leading-[16px] font-normal","text-black dark:text-white","transition-colors duration-150 ease-out","cursor-default"].join(" "),hover:"hover:bg-black/4 dark:hover:bg-white/6",active:"",pressed:"active:bg-black/10 dark:active:bg-white/18",disabled:"opacity-40 pointer-events-none",disclosure:"flex h-[16px] w-[18px] shrink-0 items-center justify-center",chevron:["i-f7-chevron-right h-[11px] w-[11px]","text-[#3c3c43]/55 dark:text-[#ebebf5]/55","transition-transform duration-200 ease-out"].join(" "),iconSlot:"flex h-[20px] w-[22px] shrink-0 items-center justify-center mr-[7px]",icon:"h-[17px] w-[17px]",image:"h-[20px] w-[20px] rounded-[4px] object-cover shadow-sm",label:"flex-1 truncate text-left",count:["ml-[8px] shrink-0 tabular-nums","text-[13px] leading-[16px]","text-[#3c3c43]/60 dark:text-[#ebebf5]/60"].join(" "),indentPerLevel:16}},uo={selection:"classes",pane:"bg-[#f4f4f3] dark:bg-neutral-950 text-zinc-950 dark:text-white select-none",layers:{},scrollArea:"flex-1 overflow-y-auto overflow-x-hidden px-5 py-5",sectionHeader:"group/section flex w-full items-center gap-2.5 px-4 pb-2 pt-5 text-[13px] font-semibold uppercase tracking-[0.12em] text-zinc-400 dark:text-zinc-500",sectionChevron:"i-f7-chevron-down h-3 w-3 ml-auto opacity-0 group-hover/section:opacity-100 transition-opacity duration-150 transition-transform duration-200",sectionGroup:"flex flex-col space-y-1",item:{base:"flex w-full items-center gap-3 rounded-[16px] px-3.5 py-2 text-[14px] leading-tight transition-colors duration-150",hover:"hover:bg-[#ececea] hover:text-zinc-950 dark:hover:bg-white/10",active:"bg-[#e7e7e5] text-zinc-950 dark:bg-white/12 dark:text-white",pressed:"active:bg-[#e2e2e0] dark:active:bg-white/15",disabled:"opacity-50 pointer-events-none",disclosure:"flex h-4 w-4 shrink-0 items-center justify-center",chevron:"i-f7-chevron-right h-3 w-3 opacity-50 transition-transform duration-200",iconSlot:"flex h-5 w-5 shrink-0 items-center justify-center",icon:"h-[18px] w-[18px] text-zinc-500 dark:text-zinc-500",image:"h-5 w-5 rounded object-cover",label:"flex-1 truncate text-left text-zinc-700 dark:text-zinc-300",count:"ml-auto grid h-5 min-w-5 place-items-center rounded-full bg-white/70 px-1.5 text-[11px] font-medium text-zinc-500 shadow-sm dark:bg-white/10 dark:text-zinc-400",indentPerLevel:12}},fo={selection:"classes",pane:"bg-[#f3f3f1]/48 dark:bg-neutral-950/32 backdrop-blur-3xl backdrop-saturate-150 text-zinc-950 dark:text-white select-none",layers:{tint:"bg-[linear-gradient(112deg,rgba(255,255,255,0.20)_0%,rgba(255,255,255,0.04)_45%,rgba(226,226,222,0.16)_100%)] dark:bg-[linear-gradient(112deg,rgba(255,255,255,0.08)_0%,rgba(255,255,255,0.02)_46%,rgba(255,255,255,0.06)_100%)]"},scrollArea:"flex-1 overflow-y-auto overflow-x-hidden px-5 py-2",sectionHeader:"group/section flex w-full items-center gap-2.5 px-3 pb-1.5 pt-3 rounded-[14px] text-[12px] font-semibold uppercase tracking-[0.10em] text-zinc-500/80 dark:text-zinc-400/80",sectionChevron:"i-f7-chevron-down h-3 w-3 ml-auto opacity-0 group-hover/section:opacity-100 transition-opacity duration-150 transition-transform duration-200",sectionGroup:"flex flex-col space-y-1",item:{base:"flex w-full items-center gap-3 rounded-[14px] px-3 py-1.5 text-[13.5px] leading-tight transition-colors duration-150",hover:"hover:bg-white/38 hover:text-zinc-950 dark:hover:bg-white/10",active:"bg-[#e8e8e6]/90 text-zinc-950 dark:bg-white/12 dark:text-white",pressed:"active:bg-white/50 dark:active:bg-white/15",disabled:"opacity-50 pointer-events-none",disclosure:"flex h-4 w-4 shrink-0 items-center justify-center",chevron:"i-f7-chevron-right h-3 w-3 opacity-50 transition-transform duration-200",iconSlot:"flex h-5 w-5 shrink-0 items-center justify-center",icon:"h-[18px] w-[18px] text-zinc-600 dark:text-zinc-400",image:"h-5 w-5 rounded object-cover",label:"flex-1 truncate text-left text-zinc-700 dark:text-zinc-300",count:"ml-auto grid h-5 min-w-5 place-items-center rounded-full bg-white/72 px-1.5 text-[11px] font-medium text-zinc-500 shadow-sm dark:bg-white/10 dark:text-zinc-400",indentPerLevel:12}},bo={selection:"classes",pane:["bg-[#f7f5f1]/92 dark:bg-[#1a1a1c]/92","backdrop-blur-[40px] backdrop-saturate-[160%]","text-[#2c2a28] dark:text-[#ededf0]","select-none"].join(" "),layers:{tint:["bg-[linear-gradient(180deg,var(--stx-sidebar-tint,rgba(255,251,242,0.55))_0%,rgba(255,255,255,0)_38%)]","dark:bg-[linear-gradient(180deg,var(--stx-sidebar-tint,rgba(255,255,255,0.05))_0%,rgba(255,255,255,0)_42%)]"].join(" ")},scrollArea:"flex-1 overflow-y-auto overflow-x-hidden px-[8px] pb-[8px]",sectionHeader:["group/section flex w-full items-center","px-[8px] pt-[14px] pb-[4px]","text-[11px] font-medium leading-[13px]","opacity-55"].join(" "),sectionChevron:["i-f7-chevron-down h-[10px] w-[10px] ml-auto","opacity-0 group-hover/section:opacity-100 transition-opacity duration-150","transition-transform duration-200"].join(" "),sectionGroup:"flex flex-col space-y-[2px]",item:{base:["flex w-full items-center","h-[30px] rounded-[8px] pl-[6px] pr-[8px]","text-[13px] leading-[16px] font-normal","text-current","transition-[background-color,box-shadow,color] duration-150 ease-out","cursor-default"].join(" "),hover:"hover:bg-white/55 dark:hover:bg-white/8",active:["bg-white dark:bg-white/14","font-medium","shadow-[0_1px_2px_rgba(0,0,0,0.08)] dark:shadow-[0_1px_2px_rgba(0,0,0,0.35)]","ring-1 ring-black/5 dark:ring-white/8"].join(" "),pressed:"active:bg-white/80 dark:active:bg-white/18",disabled:"opacity-40 pointer-events-none",disclosure:"flex h-[16px] w-[16px] shrink-0 items-center justify-center",chevron:["i-f7-chevron-right h-[10px] w-[10px] opacity-45","transition-transform duration-200 ease-out"].join(" "),iconSlot:"flex h-[18px] w-[18px] shrink-0 items-center justify-center mr-[8px]",icon:"h-[16px] w-[16px]",image:"h-[18px] w-[18px] rounded-[5px] object-cover shadow-sm",label:"flex-1 truncate text-left",count:["ml-[8px] shrink-0 tabular-nums","text-[12px] leading-[16px] opacity-45"].join(" "),indentPerLevel:14}},ho={...O,pane:"bg-stone-100 dark:bg-neutral-900 text-black dark:text-white select-none",layers:{}},go={...O,pane:"bg-transparent text-black dark:text-white select-none",layers:{}},xo={...O,pane:"bg-white/50 dark:bg-black/40 backdrop-blur-3xl backdrop-saturate-200 text-black dark:text-white select-none",layers:{}},le={macos:O,tahoe:O,"macos-tahoe":O,"macos-latest":O,arc:bo,workspace:uo,desktop:fo,solid:ho,transparent:go,vibrancy:xo};function Ul(e){return le[e||"macos"]||le.macos}function Yl(e){if(!e)return;return F[e]||e}var mo=F.gray;function P(e,t,s){return`color-mix(in oklab, ${e} ${t}%, ${s})`}function ce(e){return{light:{from:P(e,16,"#ffffff"),to:P(e,34,"#ffffff"),ink:P(e,22,"#17171b"),accent:P(e,88,"#2a2a30")},dark:{from:P(e,26,"#101014"),to:P(e,14,"#08080b"),ink:P(e,12,"#f4f4f7"),accent:P(e,74,"#ffffff")}}}function vo(e){if(!e)return ce(mo);if(typeof e!=="string")return e;return ce(F[e]||e)}function wo(e){return[`--stx-space-light-from: ${e.light.from}`,`--stx-space-light-to: ${e.light.to}`,`--stx-space-light-ink: ${e.light.ink}`,`--stx-space-light-accent: ${e.light.accent}`,`--stx-space-dark-from: ${e.dark.from}`,`--stx-space-dark-to: ${e.dark.to}`,`--stx-space-dark-ink: ${e.dark.ink}`,`--stx-space-dark-accent: ${e.dark.accent}`].join("; ")}function de(e,t,s,o){if(!e||!e.label)return null;return{id:e.id||`${t}-${s}`,label:e.label,icon:e.icon||o}}function yo(e){let t=vo(e.tint);return{id:e.id,label:e.label||"",icon:e.icon||"",pinned:e.pinned||[],sections:e.sections||[],action:de(e.action,e.id,"action","i-f7-plus"),clear:de(e.clear,e.id,"clear","i-f7-arrow-down"),tint:t,style:wo(t),deferred:e.deferred===!0}}function Zl(e){return(e||[]).map(yo)}function Ql(e,t){if(!t)return 0;let s=e.findIndex((o)=>o.id===t);return s===-1?0:s}function ec(e){return e.map((t)=>t.tint)}var $o="./Skeleton-wtwb97xd.stx";var So="./Spinner-ypya5tt2.stx";var No="./Stepper-rgbk76hd.stx";var Do="./StepperStep-3ahq4d9m.stx";class K{storage;namespace;watchers=new Map;encryptionKey="stx-storage-key";constructor(e="local",t=""){if(this.storage=e==="local"?globalThis.localStorage:globalThis.sessionStorage,this.namespace=t,typeof window<"u")window.addEventListener("storage",this.handleStorageEvent.bind(this))}handleStorageEvent(e){if(!e.key)return;let t=this.namespace&&e.key.startsWith(`${this.namespace}:`)?e.key.slice(this.namespace.length+1):e.key,s=this.watchers.get(t);if(s){let o=e.oldValue?JSON.parse(e.oldValue).value:null,a=e.newValue?JSON.parse(e.newValue).value:null;s.forEach((i)=>i(a,o,t))}}encrypt(e){let t="";for(let s=0;s<e.length;s++)t+=String.fromCharCode(e.charCodeAt(s)^this.encryptionKey.charCodeAt(s%this.encryptionKey.length));return btoa(t)}decrypt(e){try{let t=atob(e),s="";for(let o=0;o<t.length;o++)s+=String.fromCharCode(t.charCodeAt(o)^this.encryptionKey.charCodeAt(o%this.encryptionKey.length));return s}catch{return e}}compress(e){if(e.length<100)return e;let t={},s=256,o=[],a="";for(let i=0;i<e.length;i++){let r=e.charAt(i),n=a+r;if(t[n]!==void 0)a=n;else o.push(a.length>1?t[a]:a.charCodeAt(0)),t[n]=s++,a=r}if(a!=="")o.push(a.length>1?t[a]:a.charCodeAt(0));return JSON.stringify(o)}decompress(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return e;let s={},o=256,a=String.fromCharCode(t[0]),i=a;for(let r=1;r<t.length;r++){let n=t[r],c;if(s[n]!==void 0)c=s[n];else if(n===o)c=a+a.charAt(0);else return e;i+=c,s[o++]=a+c.charAt(0),a=c}return i}catch{return e}}getKey(e){return this.namespace?`${this.namespace}:${e}`:e}set(e,t,s){let o=this.getKey(e),a=this.get(e),i={value:t,timestamp:Date.now(),expire:s?.expire,encrypted:s?.encrypt||!1,compressed:s?.compress||!1};try{let r=JSON.stringify(i);if(s?.compress)r=this.compress(r);if(s?.encrypt)r=this.encrypt(r);this.storage.setItem(o,r),this.notifyWatchers(e,t,a)}catch(r){console.error("Storage set error:",r)}}get(e){let t=this.getKey(e);try{let s=this.storage.getItem(t);if(!s)return null;if(s.match(/^[A-Z0-9+/]+=*$/i))try{s=this.decrypt(s)}catch{}if(s.startsWith("["))try{s=this.decompress(s)}catch{}let o=JSON.parse(s);if(o.expire&&Date.now()-o.timestamp>o.expire)return this.remove(e),null;return o.value}catch(s){return console.error("Storage get error:",s),null}}watch(e,t){if(!this.watchers.has(e))this.watchers.set(e,new Set);return this.watchers.get(e).add(t),()=>{let s=this.watchers.get(e);if(s){if(s.delete(t),s.size===0)this.watchers.delete(e)}}}notifyWatchers(e,t,s){let o=this.watchers.get(e);if(o)o.forEach((a)=>a(t,s,e))}remove(e){let t=this.getKey(e),s=this.get(e);this.storage.removeItem(t),this.notifyWatchers(e,null,s)}clear(){if(this.namespace)this.keys().forEach((t)=>this.remove(t));else this.storage.clear()}has(e){return this.get(e)!==null}keys(){let e=Object.keys(this.storage);if(this.namespace){let t=`${this.namespace}:`;return e.filter((s)=>s.startsWith(t)).map((s)=>s.slice(t.length))}return e}size(){return this.keys().length}getQuota(){if("storage"in navigator&&"estimate"in navigator.storage)return null;try{let e=0;for(let s=0;s<this.storage.length;s++){let o=this.storage.key(s);if(o){let a=this.storage.getItem(o)||"";e+=o.length+a.length}}let t=5242880;return{usage:e*2,quota:t,percentage:e*2/t*100}}catch{return null}}setMany(e,t){Object.entries(e).forEach(([s,o])=>{this.set(s,o,t)})}getMany(e){let t={};return e.forEach((s)=>{t[s]=this.get(s)}),t}removeMany(e){e.forEach((t)=>this.remove(t))}}var Ic={local:new K("local"),session:new K("session")};function Nc(e="local",t){return new K(e,t)}var Lo="./Switch-hdta55a8.stx";var Po="./Table-0mc3fdek.stx";var Oo="./TableBody-drxyz5jh.stx";var Ro="./TableCell-8swtcq8s.stx";var Bo="./TableHead-e9xvjx2j.stx";var Ho="./TableHeader-sxc77b4d.stx";var Wo="./TableRow-xd542nvb.stx";var Fo="./TabPanel-5htevsq6.stx";var Go="./Tabs-b4xsba1w.stx";var Yo="./Teleport-tsx4bt4n.stx";var Xo="./Textarea-xcdym703.stx";var Qo="./Tooltip-y61h04gp.stx";var ta="./Transition-7smenaz8.stx";var oa="./Video-a0aeyexv.stx";var ia="./VirtualList-fa7v5a3h.stx";var na="./VirtualTable-jvm1784g.stx";var la=0;function pe(e="a11y"){return`${e}-${++la}-${Date.now()}`}function xd(e,t,s={}){let{visible:o=!1,id:a=pe("label")}=s,i=document.createElement(o?"label":"span");if(i.id=a,i.textContent=e,!o)Object.assign(i.style,{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"});if(t)if(t.setAttribute("aria-labelledby",a),t.parentElement)t.parentElement.insertBefore(i,t);else document.body.appendChild(i);return a}function md(e,t){let s=pe("desc"),o=document.createElement("span");if(o.id=s,o.textContent=e,Object.assign(o.style,{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}),t)if(t.setAttribute("aria-describedby",s),t.parentElement)t.parentElement.insertBefore(o,t);else document.body.appendChild(o);return s}function vd(e,t="polite"){let s=document.createElement("div");s.setAttribute("role","status"),s.setAttribute("aria-live",t),s.setAttribute("aria-atomic","true"),Object.assign(s.style,{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}),document.body.appendChild(s),setTimeout(()=>{s.textContent=e},100),setTimeout(()=>{s.parentNode?.removeChild(s)},1000)}function ee(e){let t=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","button:not([disabled])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex="-1"])'].join(",");return Array.from(e.querySelectorAll(t)).filter((s)=>s.offsetParent!==null)}function wd(e,t={}){let{initialFocus:s,returnFocus:o,escapeDeactivates:a=!0,clickOutsideDeactivates:i=!0,allowOutsideClick:r=!1,onActivate:n,onDeactivate:c}=t,d=!1,f=!1,p=null,g=(m)=>{if(f)return;if(a&&m.key==="Escape"){m.preventDefault(),v();return}if(m.key==="Tab"){let C=ee(e);if(C.length===0){m.preventDefault();return}let T=C[0],z=C[C.length-1];if(m.shiftKey){if(document.activeElement===T)m.preventDefault(),z.focus()}else if(document.activeElement===z)m.preventDefault(),T.focus()}},b=(m)=>{if(f)return;if(!e.contains(m.target)){if(typeof r==="function"){if(!r(m)&&i)v()}else if(!r&&i)v()}};function w(){if(d)return;d=!0,p=document.activeElement;let m=s||ee(e)[0];if(m&&typeof m.focus==="function")m.focus();document.addEventListener("keydown",g),document.addEventListener("click",b),n?.()}function v(){if(!d)return;d=!1;let m=o||p;if(m&&typeof m.focus==="function")m.focus();document.removeEventListener("keydown",g),document.removeEventListener("click",b),c?.()}function k(){f=!0}function x(){f=!1}return{activate:w,deactivate:v,pause:k,unpause:x}}function yd(e,t={}){let{selector:s='[role="option"], [role="menuitem"], [role="tab"], button',initialIndex:o=0,orientation:a="both",loop:i=!0,onFocusChange:r}=t,n=o,c=()=>{return Array.from(e.querySelectorAll(s))},d=(p)=>{let g=c();if(p<0||p>=g.length)return;g.forEach((b,w)=>{if(w===p){if(b.setAttribute("tabindex","0"),typeof b.focus==="function")b.focus()}else b.setAttribute("tabindex","-1")}),n=p,r?.(p,g[p])},f=(p)=>{let b=c().length-1,w=!1,v=n;switch(p.key){case"ArrowRight":if(a==="horizontal"||a==="both"){if(v=n+1,v>b)v=i?0:b;w=!0}break;case"ArrowLeft":if(a==="horizontal"||a==="both"){if(v=n-1,v<0)v=i?b:0;w=!0}break;case"ArrowDown":if(a==="vertical"||a==="both"){if(v=n+1,v>b)v=i?0:b;w=!0}break;case"ArrowUp":if(a==="vertical"||a==="both"){if(v=n-1,v<0)v=i?b:0;w=!0}break;case"Home":v=0,w=!0;break;case"End":v=b,w=!0;break}if(w)p.preventDefault(),d(v)};return d(o),e.addEventListener("keydown",f),()=>{e.removeEventListener("keydown",f)}}var Cd={Enter:"Enter",Space:" ",Escape:"Escape",ArrowUp:"ArrowUp",ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowRight:"ArrowRight",Tab:"Tab",Home:"Home",End:"End",PageUp:"PageUp",PageDown:"PageDown"};function $d(e){return document.activeElement===e}function kd(e,t){let s=t||document.activeElement,o=ee(document.body),a=o.indexOf(s);if(a===-1)return;let i=e==="next"?a+1:a-1,r=o[i];if(r)r.focus()}function Sd(e){if(e.getAttribute("aria-hidden")==="true")return!1;let t=window.getComputedStyle(e);if(t.display==="none"||t.visibility==="hidden")return!1;return!0}var Id={setExpanded(e,t){e.setAttribute("aria-expanded",String(t))},setSelected(e,t){e.setAttribute("aria-selected",String(t))},setChecked(e,t){e.setAttribute("aria-checked",String(t))},setDisabled(e,t){if(e.setAttribute("aria-disabled",String(t)),t)e.setAttribute("tabindex","-1");else e.removeAttribute("tabindex")},setHidden(e,t){if(t)e.setAttribute("aria-hidden","true");else e.removeAttribute("aria-hidden")},setPressed(e,t){e.setAttribute("aria-pressed",String(t))},setInvalid(e,t){e.setAttribute("aria-invalid",String(t))},setRequired(e,t){e.setAttribute("aria-required",String(t))},setLive(e,t){e.setAttribute("aria-live",t)},setBusy(e,t){e.setAttribute("aria-busy",String(t))}};function Nd(e){let t=document.createElement("span");return t.textContent=e,t.className="sr-only",Object.assign(t.style,{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}),t}function Td(){if(typeof window.matchMedia==="function")return window.matchMedia("(prefers-reduced-motion: reduce)").matches;return!1}function Dd(){if(typeof window.matchMedia==="function")return window.matchMedia("(prefers-contrast: high)").matches;return!1}function Ad(){if(typeof window.matchMedia==="function"){if(window.matchMedia("(prefers-color-scheme: dark)").matches)return"dark";if(window.matchMedia("(prefers-color-scheme: light)").matches)return"light"}return null}function Ld(e,t="Skip to main content"){let s=document.createElement("a");return s.href=`#${e}`,s.textContent=t,s.className="skip-link",Object.assign(s.style,{position:"absolute",top:"-40px",left:"0",background:"#000",color:"#fff",padding:"8px",textDecoration:"none",zIndex:"100"}),s.addEventListener("focus",()=>{s.style.top="0"}),s.addEventListener("blur",()=>{s.style.top="-40px"}),s}function zd(e){let t=[],s=(o)=>{let a=e.getAttribute(o);if(a){let i=a.split(" ");for(let r of i)if(!document.getElementById(r))t.push(`${o} references non-existent ID: ${r}`)}};return s("aria-labelledby"),s("aria-describedby"),s("aria-controls"),s("aria-owns"),s("aria-activedescendant"),t}var ca=(e,t,s,o)=>{return s*e/o+t},da=(e,t,s,o)=>{return e/=o,s*e*e+t},pa=(e,t,s,o)=>{return e/=o,-s*e*(e-2)+t},ua=(e,t,s,o)=>{if(e/=o/2,e<1)return s/2*e*e+t;return e--,-s/2*(e*(e-2)-1)+t},fa=(e,t,s,o)=>{return e/=o,s*e*e*e+t},ba=(e,t,s,o)=>{return e/=o,e--,s*(e*e*e+1)+t},ha=(e,t,s,o)=>{if(e/=o/2,e<1)return s/2*e*e*e+t;return e-=2,s/2*(e*e*e+2)+t},ga=(e,t,s,o)=>{return e/=o,s*e*e*e*e+t},xa=(e,t,s,o)=>{return e/=o,e--,-s*(e*e*e*e-1)+t},ma=(e,t,s,o)=>{if(e/=o/2,e<1)return s/2*e*e*e*e+t;return e-=2,-s/2*(e*e*e*e-2)+t},va=(e,t,s,o)=>{return e/=o,s*e*e*e*e*e+t},wa=(e,t,s,o)=>{return e/=o,e--,s*(e*e*e*e*e+1)+t},ya=(e,t,s,o)=>{if(e/=o/2,e<1)return s/2*e*e*e*e*e+t;return e-=2,s/2*(e*e*e*e*e+2)+t},Ca=(e,t,s,o)=>{return-s*Math.cos(e/o*(Math.PI/2))+s+t},$a=(e,t,s,o)=>{return s*Math.sin(e/o*(Math.PI/2))+t},ka=(e,t,s,o)=>{return-s/2*(Math.cos(Math.PI*e/o)-1)+t},Sa=(e,t,s,o)=>{return e===0?t:s*2**(10*(e/o-1))+t},Ia=(e,t,s,o)=>{return e===o?t+s:s*(-(2**(-10*e/o))+1)+t},Na=(e,t,s,o)=>{if(e===0)return t;if(e===o)return t+s;if(e/=o/2,e<1)return s/2*2**(10*(e-1))+t;return e--,s/2*(-(2**(-10*e))+2)+t},Ta=(e,t,s,o)=>{return e/=o,-s*(Math.sqrt(1-e*e)-1)+t},Da=(e,t,s,o)=>{return e/=o,e--,s*Math.sqrt(1-e*e)+t},Aa=(e,t,s,o)=>{if(e/=o/2,e<1)return-s/2*(Math.sqrt(1-e*e)-1)+t;return e-=2,s/2*(Math.sqrt(1-e*e)+1)+t},La=(e,t,s,o)=>{let a=1.70158,i=0,r=s;if(e===0)return t;if(e/=o,e===1)return t+s;if(!i)i=o*0.3;if(r<Math.abs(s))r=s,a=i/4;else a=i/(2*Math.PI)*Math.asin(s/r);return e-=1,-(r*2**(10*e)*Math.sin((e*o-a)*(2*Math.PI)/i))+t},za=(e,t,s,o)=>{let a=1.70158,i=0,r=s;if(e===0)return t;if(e/=o,e===1)return t+s;if(!i)i=o*0.3;if(r<Math.abs(s))r=s,a=i/4;else a=i/(2*Math.PI)*Math.asin(s/r);return r*2**(-10*e)*Math.sin((e*o-a)*(2*Math.PI)/i)+s+t},Pa=(e,t,s,o)=>{let a=1.70158,i=0,r=s;if(e===0)return t;if(e/=o/2,e===2)return t+s;if(!i)i=o*0.44999999999999996;if(r<Math.abs(s))r=s,a=i/4;else a=i/(2*Math.PI)*Math.asin(s/r);if(e<1)return e-=1,-0.5*(r*2**(10*e)*Math.sin((e*o-a)*(2*Math.PI)/i))+t;return e-=1,r*2**(-10*e)*Math.sin((e*o-a)*(2*Math.PI)/i)*0.5+s+t},Ea=(e,t,s,o)=>{return e/=o,s*e*e*(2.70158*e-1.70158)+t},Oa=(e,t,s,o)=>{return e/=o,e--,s*(e*e*(2.70158*e+1.70158)+1)+t},Ma=(e,t,s,o)=>{let a=1.70158;if(e/=o/2,e<1)return a*=1.525,s/2*(e*e*((a+1)*e-a))+t;return e-=2,a*=1.525,s/2*(e*e*((a+1)*e+a)+2)+t},te=(e,t,s,o)=>{if(e/=o,e<0.36363636363636365)return s*(7.5625*e*e)+t;else if(e<0.7272727272727273)return e-=0.5454545454545454,s*(7.5625*e*e+0.75)+t;else if(e<0.9090909090909091)return e-=0.8181818181818182,s*(7.5625*e*e+0.9375)+t;else return e-=0.9545454545454546,s*(7.5625*e*e+0.984375)+t},ue=(e,t,s,o)=>{return s-te(o-e,0,s,o)+t},Ra=(e,t,s,o)=>{if(e<o/2)return ue(e*2,0,s,o)*0.5+t;return te(e*2-o,0,s,o)*0.5+s*0.5+t},Ed={linear:ca,easeInQuad:da,easeOutQuad:pa,easeInOutQuad:ua,easeInCubic:fa,easeOutCubic:ba,easeInOutCubic:ha,easeInQuart:ga,easeOutQuart:xa,easeInOutQuart:ma,easeInQuint:va,easeOutQuint:wa,easeInOutQuint:ya,easeInSine:Ca,easeOutSine:$a,easeInOutSine:ka,easeInExpo:Sa,easeOutExpo:Ia,easeInOutExpo:Na,easeInCirc:Ta,easeOutCirc:Da,easeInOutCirc:Aa,easeInElastic:La,easeOutElastic:za,easeInOutElastic:Pa,easeInBack:Ea,easeOutBack:Oa,easeInOutBack:Ma,easeInBounce:ue,easeOutBounce:te,easeInOutBounce:Ra};function qa(e,t={}){let{duration:s="1s",timing:o="ease",delay:a="0s",iteration:i="1",direction:r="normal",fill:n="both",playState:c="running"}=t;return`${e} ${s} ${o} ${a} ${i} ${r} ${n} ${c}`}function fe(e,t,s={}){e.style.animation=qa(t,s)}function Md(e){e.style.animation=""}function Ba(e){return new Promise((t)=>{let s=()=>{e.removeEventListener("animationend",s),t()};e.addEventListener("animationend",s)})}function Rd(e,t,s={}){let{stagger:o=100,...a}=s;e.forEach((i,r)=>{let n=`${r*o}ms`;fe(i,t,{...a,delay:n})})}async function qd(e,t){for(let s of t)fe(e,s.name,s.options),await Ba(e)}var Bd={fadeIn:"animate-fade-in",fadeOut:"animate-fade-out",slideInUp:"animate-slide-in-up",slideInDown:"animate-slide-in-down",slideInLeft:"animate-slide-in-left",slideInRight:"animate-slide-in-right",zoomIn:"animate-zoom-in",zoomOut:"animate-zoom-out",bounce:"animate-bounce",spin:"animate-spin",ping:"animate-ping",pulse:"animate-pulse"};function jd(e,t,s=1000){return new Promise((o)=>{e.classList.add(t),setTimeout(()=>{e.classList.remove(t),o()},s)})}function Hd(e,t){let s=`
12
+ @keyframes ${e} {
13
+ ${Object.entries(t).map(([a,i])=>{let r=Object.entries(i).map(([n,c])=>`${n}: ${c};`).join(" ");return`${a} { ${r} }`}).join(`
2530
14
  `)}
2531
15
  }
2532
- `;
2533
- const styleSheet = document.createElement("style");
2534
- styleSheet.textContent = keyframesRule;
2535
- document.head.appendChild(styleSheet);
2536
- }
2537
-
2538
- // src/utils/animation/keyframes.ts
2539
- function createKeyframeAnimation(element, keyframes, options = {}) {
2540
- if (typeof element.animate !== "function") {
2541
- console.warn("Web Animations API not supported");
2542
- return null;
2543
- }
2544
- const {
2545
- duration = 1000,
2546
- easing = "ease",
2547
- delay = 0,
2548
- iterations = 1,
2549
- direction = "normal",
2550
- fill = "both"
2551
- } = options;
2552
- return element.animate([...keyframes], {
2553
- duration,
2554
- easing,
2555
- delay,
2556
- iterations,
2557
- direction,
2558
- fill
2559
- });
2560
- }
2561
- var KeyframeAnimations = {
2562
- fadeIn: [
2563
- { offset: 0, opacity: 0 },
2564
- { offset: 1, opacity: 1 }
2565
- ],
2566
- fadeOut: [
2567
- { offset: 0, opacity: 1 },
2568
- { offset: 1, opacity: 0 }
2569
- ],
2570
- slideInUp: [
2571
- { offset: 0, transform: "translateY(100%)", opacity: 0 },
2572
- { offset: 1, transform: "translateY(0)", opacity: 1 }
2573
- ],
2574
- slideInDown: [
2575
- { offset: 0, transform: "translateY(-100%)", opacity: 0 },
2576
- { offset: 1, transform: "translateY(0)", opacity: 1 }
2577
- ],
2578
- slideInLeft: [
2579
- { offset: 0, transform: "translateX(-100%)", opacity: 0 },
2580
- { offset: 1, transform: "translateX(0)", opacity: 1 }
2581
- ],
2582
- slideInRight: [
2583
- { offset: 0, transform: "translateX(100%)", opacity: 0 },
2584
- { offset: 1, transform: "translateX(0)", opacity: 1 }
2585
- ],
2586
- slideOutUp: [
2587
- { offset: 0, transform: "translateY(0)", opacity: 1 },
2588
- { offset: 1, transform: "translateY(-100%)", opacity: 0 }
2589
- ],
2590
- slideOutDown: [
2591
- { offset: 0, transform: "translateY(0)", opacity: 1 },
2592
- { offset: 1, transform: "translateY(100%)", opacity: 0 }
2593
- ],
2594
- slideOutLeft: [
2595
- { offset: 0, transform: "translateX(0)", opacity: 1 },
2596
- { offset: 1, transform: "translateX(-100%)", opacity: 0 }
2597
- ],
2598
- slideOutRight: [
2599
- { offset: 0, transform: "translateX(0)", opacity: 1 },
2600
- { offset: 1, transform: "translateX(100%)", opacity: 0 }
2601
- ],
2602
- zoomIn: [
2603
- { offset: 0, transform: "scale(0)", opacity: 0 },
2604
- { offset: 0.5, opacity: 1 },
2605
- { offset: 1, transform: "scale(1)" }
2606
- ],
2607
- zoomOut: [
2608
- { offset: 0, transform: "scale(1)", opacity: 1 },
2609
- { offset: 0.5, opacity: 1 },
2610
- { offset: 1, transform: "scale(0)", opacity: 0 }
2611
- ],
2612
- rotate: [
2613
- { offset: 0, transform: "rotate(0deg)" },
2614
- { offset: 1, transform: "rotate(360deg)" }
2615
- ],
2616
- bounce: [
2617
- { offset: 0, transform: "translateY(0)" },
2618
- { offset: 0.2, transform: "translateY(0)" },
2619
- { offset: 0.4, transform: "translateY(-30px)" },
2620
- { offset: 0.43, transform: "translateY(-30px)" },
2621
- { offset: 0.53, transform: "translateY(0)" },
2622
- { offset: 0.7, transform: "translateY(-15px)" },
2623
- { offset: 0.8, transform: "translateY(0)" },
2624
- { offset: 0.9, transform: "translateY(-4px)" },
2625
- { offset: 1, transform: "translateY(0)" }
2626
- ],
2627
- pulse: [
2628
- { offset: 0, transform: "scale(1)" },
2629
- { offset: 0.5, transform: "scale(1.05)" },
2630
- { offset: 1, transform: "scale(1)" }
2631
- ],
2632
- shake: [
2633
- { offset: 0, transform: "translateX(0)" },
2634
- { offset: 0.1, transform: "translateX(-10px)" },
2635
- { offset: 0.2, transform: "translateX(10px)" },
2636
- { offset: 0.3, transform: "translateX(-10px)" },
2637
- { offset: 0.4, transform: "translateX(10px)" },
2638
- { offset: 0.5, transform: "translateX(-10px)" },
2639
- { offset: 0.6, transform: "translateX(10px)" },
2640
- { offset: 0.7, transform: "translateX(-10px)" },
2641
- { offset: 0.8, transform: "translateX(10px)" },
2642
- { offset: 0.9, transform: "translateX(-10px)" },
2643
- { offset: 1, transform: "translateX(0)" }
2644
- ],
2645
- swing: [
2646
- { offset: 0, transform: "rotate(0deg)" },
2647
- { offset: 0.2, transform: "rotate(15deg)" },
2648
- { offset: 0.4, transform: "rotate(-10deg)" },
2649
- { offset: 0.6, transform: "rotate(5deg)" },
2650
- { offset: 0.8, transform: "rotate(-5deg)" },
2651
- { offset: 1, transform: "rotate(0deg)" }
2652
- ],
2653
- flip: [
2654
- { offset: 0, transform: "perspective(400px) rotateY(0)", animationTimingFunction: "ease-out" },
2655
- { offset: 0.4, transform: "perspective(400px) translateZ(150px) rotateY(170deg)", animationTimingFunction: "ease-out" },
2656
- { offset: 0.5, transform: "perspective(400px) translateZ(150px) rotateY(190deg)", animationTimingFunction: "ease-in" },
2657
- { offset: 0.8, transform: "perspective(400px) rotateY(360deg)", animationTimingFunction: "ease-in" },
2658
- { offset: 1, transform: "perspective(400px)", animationTimingFunction: "ease-in" }
2659
- ],
2660
- rubberBand: [
2661
- { offset: 0, transform: "scale(1)" },
2662
- { offset: 0.3, transform: "scaleX(1.25) scaleY(0.75)" },
2663
- { offset: 0.4, transform: "scaleX(0.75) scaleY(1.25)" },
2664
- { offset: 0.5, transform: "scaleX(1.15) scaleY(0.85)" },
2665
- { offset: 0.65, transform: "scaleX(0.95) scaleY(1.05)" },
2666
- { offset: 0.75, transform: "scaleX(1.05) scaleY(0.95)" },
2667
- { offset: 1, transform: "scale(1)" }
2668
- ],
2669
- heartbeat: [
2670
- { offset: 0, transform: "scale(1)" },
2671
- { offset: 0.14, transform: "scale(1.3)" },
2672
- { offset: 0.28, transform: "scale(1)" },
2673
- { offset: 0.42, transform: "scale(1.3)" },
2674
- { offset: 0.7, transform: "scale(1)" }
2675
- ]
2676
- };
2677
- function animate(element, animationName, options = {}) {
2678
- return createKeyframeAnimation(element, KeyframeAnimations[animationName], options);
2679
- }
2680
- // src/utils/highlighter.ts
2681
- import { createHighlighter } from "ts-syntax-highlighter";
2682
- var highlighterInstance = null;
2683
- async function getHighlighter() {
2684
- if (!highlighterInstance) {
2685
- highlighterInstance = await createHighlighter({
2686
- theme: "github-light"
2687
- });
2688
- }
2689
- return highlighterInstance;
2690
- }
2691
- async function highlight(code, options = {}) {
2692
- const {
2693
- theme = "auto",
2694
- language = "typescript",
2695
- lineNumbers: _lineNumbers = false,
2696
- wrapLines: _wrapLines = true
2697
- } = options;
2698
- const highlighter = await getHighlighter();
2699
- const effectiveTheme = theme === "auto" ? globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches ? "github-dark" : "github-light" : theme === "dark" ? "github-dark" : "github-light";
2700
- const html = await highlighter.highlight(code, language);
2701
- return {
2702
- html: typeof html === "string" ? html : String(html),
2703
- language,
2704
- theme: effectiveTheme
2705
- };
2706
- }
2707
- function detectLanguage(code) {
2708
- if (code.includes("<!DOCTYPE") || code.includes("<html"))
2709
- return "html";
2710
- if (code.includes("<?php"))
2711
- return "php";
2712
- if (code.includes("import") && code.includes("from"))
2713
- return "typescript";
2714
- if (code.includes("function") || code.includes("const"))
2715
- return "javascript";
2716
- if (code.includes("{") && code.includes("}"))
2717
- return "json";
2718
- if (code.includes("$") && code.includes("|"))
2719
- return "bash";
2720
- if (code.includes("#") && code.includes("##"))
2721
- return "markdown";
2722
- return "typescript";
2723
- }
2724
- function applyHeadwindClasses(html, additionalClasses) {
2725
- const baseClasses = "rounded-md overflow-auto text-sm leading-relaxed font-mono";
2726
- const classes = additionalClasses ? `${baseClasses} ${additionalClasses}` : baseClasses;
2727
- return `<div class="${classes}">${html}</div>`;
2728
- }
2729
- // src/utils/i18n.ts
2730
- var globalI18n = null;
2731
- var defaultPluralRule = (count) => {
2732
- return count === 1 ? 0 : 1;
2733
- };
2734
- function getNestedProperty(obj, path) {
2735
- return path.split(".").reduce((current, key) => current?.[key], obj);
2736
- }
2737
- function interpolate(template, params = {}) {
2738
- return template.replace(/\{(\w+)\}/g, (match, key) => {
2739
- return params[key] !== undefined ? String(params[key]) : match;
2740
- });
2741
- }
2742
- function createI18n(config) {
2743
- let {
2744
- locale,
2745
- fallbackLocale = "en",
2746
- messages,
2747
- pluralRules = {},
2748
- dateTimeFormats = {},
2749
- numberFormats = {},
2750
- missing,
2751
- warnMissing = true
2752
- } = config;
2753
- function t(key, params = {}) {
2754
- let translation = getNestedProperty(messages[locale], key);
2755
- if (translation === undefined && fallbackLocale) {
2756
- translation = getNestedProperty(messages[fallbackLocale], key);
2757
- }
2758
- if (translation === undefined) {
2759
- if (missing) {
2760
- const result = missing(locale, key);
2761
- if (result) {
2762
- return interpolate(result, params);
2763
- }
2764
- }
2765
- if (warnMissing && typeof console !== "undefined") {
2766
- console.warn(`[i18n] Missing translation for key "${key}" in locale "${locale}"`);
2767
- }
2768
- return key;
2769
- }
2770
- if (typeof translation === "string") {
2771
- return interpolate(translation, params);
2772
- }
2773
- return String(translation);
2774
- }
2775
- function tc(key, count, params = {}) {
2776
- const translation = t(key, { ...params, count });
2777
- if (translation.includes("|")) {
2778
- const forms = translation.split("|").map((s) => s.trim());
2779
- const pluralRule = pluralRules[locale] || defaultPluralRule;
2780
- const index = pluralRule(count, locale);
2781
- const form = forms[index] || forms[forms.length - 1];
2782
- return interpolate(form, { ...params, count });
2783
- }
2784
- return translation;
2785
- }
2786
- function d(date, format = "default") {
2787
- const dateObj = typeof date === "number" ? new Date(date) : date;
2788
- const formatOptions = dateTimeFormats[format] || dateTimeFormats.default || {};
2789
- return new Intl.DateTimeFormat(locale, formatOptions).format(dateObj);
2790
- }
2791
- function n(value, format = "default") {
2792
- const formatOptions = numberFormats[format] || numberFormats.default || {};
2793
- return new Intl.NumberFormat(locale, formatOptions).format(value);
2794
- }
2795
- function te(key) {
2796
- const translation = getNestedProperty(messages[locale], key);
2797
- if (translation !== undefined) {
2798
- return true;
2799
- }
2800
- if (fallbackLocale) {
2801
- const fallbackTranslation = getNestedProperty(messages[fallbackLocale], key);
2802
- return fallbackTranslation !== undefined;
2803
- }
2804
- return false;
2805
- }
2806
- function setLocale(newLocale) {
2807
- if (!messages[newLocale]) {
2808
- console.warn(`[i18n] Locale "${newLocale}" not found. Available locales: ${Object.keys(messages).join(", ")}`);
2809
- return;
2810
- }
2811
- locale = newLocale;
2812
- }
2813
- function addMessages(addLocale, newMessages) {
2814
- if (!messages[addLocale]) {
2815
- messages[addLocale] = {};
2816
- }
2817
- messages[addLocale] = {
2818
- ...messages[addLocale],
2819
- ...newMessages
2820
- };
2821
- }
2822
- function removeLocale(removeLocale2) {
2823
- delete messages[removeLocale2];
2824
- }
2825
- return {
2826
- get locale() {
2827
- return locale;
2828
- },
2829
- get availableLocales() {
2830
- return Object.keys(messages);
2831
- },
2832
- setLocale,
2833
- t,
2834
- tc,
2835
- d,
2836
- n,
2837
- te,
2838
- addMessages,
2839
- removeLocale
2840
- };
2841
- }
2842
- function setI18n(i18n) {
2843
- globalI18n = i18n;
2844
- }
2845
- function getI18n() {
2846
- return globalI18n;
2847
- }
2848
- function t(key, params) {
2849
- if (!globalI18n) {
2850
- console.warn("[i18n] No global i18n instance set. Call setI18n() first.");
2851
- return key;
2852
- }
2853
- return globalI18n.t(key, params);
2854
- }
2855
- function tc(key, count, params) {
2856
- if (!globalI18n) {
2857
- console.warn("[i18n] No global i18n instance set. Call setI18n() first.");
2858
- return key;
2859
- }
2860
- return globalI18n.tc(key, count, params);
2861
- }
2862
- function d(date, format) {
2863
- if (!globalI18n) {
2864
- console.warn("[i18n] No global i18n instance set. Call setI18n() first.");
2865
- return String(date);
2866
- }
2867
- return globalI18n.d(date, format);
2868
- }
2869
- function n(value, format) {
2870
- if (!globalI18n) {
2871
- console.warn("[i18n] No global i18n instance set. Call setI18n() first.");
2872
- return String(value);
2873
- }
2874
- return globalI18n.n(value, format);
2875
- }
2876
- var pluralRules = {
2877
- en: (count) => count === 1 ? 0 : 1,
2878
- de: (count) => count === 1 ? 0 : 1,
2879
- nl: (count) => count === 1 ? 0 : 1,
2880
- sv: (count) => count === 1 ? 0 : 1,
2881
- fr: (count) => count === 0 || count === 1 ? 0 : 1,
2882
- pt_BR: (count) => count === 0 || count === 1 ? 0 : 1,
2883
- ru: (count) => {
2884
- if (count % 10 === 1 && count % 100 !== 11)
2885
- return 0;
2886
- if (count % 10 >= 2 && count % 10 <= 4 && (count % 100 < 10 || count % 100 >= 20))
2887
- return 1;
2888
- return 2;
2889
- },
2890
- pl: (count) => {
2891
- if (count === 1)
2892
- return 0;
2893
- if (count % 10 >= 2 && count % 10 <= 4 && (count % 100 < 10 || count % 100 >= 20))
2894
- return 1;
2895
- return 2;
2896
- },
2897
- cs: (count) => {
2898
- if (count === 1)
2899
- return 0;
2900
- if (count >= 2 && count <= 4)
2901
- return 1;
2902
- return 2;
2903
- },
2904
- ar: (count) => {
2905
- if (count === 0)
2906
- return 0;
2907
- if (count === 1)
2908
- return 1;
2909
- if (count === 2)
2910
- return 2;
2911
- if (count % 100 >= 3 && count % 100 <= 10)
2912
- return 3;
2913
- if (count % 100 >= 11)
2914
- return 4;
2915
- return 5;
2916
- },
2917
- ja: () => 0,
2918
- ko: () => 0,
2919
- zh: () => 0,
2920
- th: () => 0,
2921
- vi: () => 0
2922
- };
2923
- var dateTimeFormats = {
2924
- short: {
2925
- year: "numeric",
2926
- month: "numeric",
2927
- day: "numeric"
2928
- },
2929
- long: {
2930
- year: "numeric",
2931
- month: "long",
2932
- day: "numeric"
2933
- },
2934
- full: {
2935
- weekday: "long",
2936
- year: "numeric",
2937
- month: "long",
2938
- day: "numeric"
2939
- },
2940
- time: {
2941
- hour: "numeric",
2942
- minute: "numeric"
2943
- },
2944
- datetime: {
2945
- year: "numeric",
2946
- month: "numeric",
2947
- day: "numeric",
2948
- hour: "numeric",
2949
- minute: "numeric"
2950
- }
2951
- };
2952
- var numberFormats = {
2953
- decimal: {
2954
- style: "decimal",
2955
- minimumFractionDigits: 2,
2956
- maximumFractionDigits: 2
2957
- },
2958
- currency: {
2959
- style: "currency",
2960
- currency: "USD"
2961
- },
2962
- percent: {
2963
- style: "percent",
2964
- minimumFractionDigits: 0,
2965
- maximumFractionDigits: 2
2966
- },
2967
- compact: {
2968
- notation: "compact"
2969
- }
2970
- };
2971
- function isRTL(locale) {
2972
- const rtlLocales = ["ar", "he", "fa", "ur", "yi"];
2973
- const lang = locale.split("-")[0].toLowerCase();
2974
- return rtlLocales.includes(lang);
2975
- }
2976
- async function loadLocaleMessages(locale, loadFn) {
2977
- try {
2978
- return await loadFn();
2979
- } catch (error) {
2980
- console.error(`[i18n] Failed to load messages for locale "${locale}":`, error);
2981
- return {};
2982
- }
2983
- }
2984
- var componentMessages = {
2985
- en: {
2986
- common: {
2987
- loading: "Loading...",
2988
- error: "Error",
2989
- retry: "Retry",
2990
- cancel: "Cancel",
2991
- confirm: "Confirm",
2992
- close: "Close",
2993
- save: "Save",
2994
- delete: "Delete",
2995
- edit: "Edit",
2996
- search: "Search",
2997
- clear: "Clear",
2998
- submit: "Submit",
2999
- reset: "Reset"
3000
- },
3001
- form: {
3002
- required: "This field is required",
3003
- invalid: "Invalid value",
3004
- tooShort: "Value is too short (minimum {min} characters)",
3005
- tooLong: "Value is too long (maximum {max} characters)",
3006
- invalidEmail: "Invalid email address",
3007
- invalidUrl: "Invalid URL"
3008
- },
3009
- pagination: {
3010
- previous: "Previous",
3011
- next: "Next",
3012
- page: "Page {page}",
3013
- of: "of {total}"
3014
- }
3015
- },
3016
- es: {
3017
- common: {
3018
- loading: "Cargando...",
3019
- error: "Error",
3020
- retry: "Reintentar",
3021
- cancel: "Cancelar",
3022
- confirm: "Confirmar",
3023
- close: "Cerrar",
3024
- save: "Guardar",
3025
- delete: "Eliminar",
3026
- edit: "Editar",
3027
- search: "Buscar",
3028
- clear: "Limpiar",
3029
- submit: "Enviar",
3030
- reset: "Restablecer"
3031
- },
3032
- form: {
3033
- required: "Este campo es obligatorio",
3034
- invalid: "Valor inv\xE1lido",
3035
- tooShort: "El valor es demasiado corto (m\xEDnimo {min} caracteres)",
3036
- tooLong: "El valor es demasiado largo (m\xE1ximo {max} caracteres)",
3037
- invalidEmail: "Direcci\xF3n de correo electr\xF3nico inv\xE1lida",
3038
- invalidUrl: "URL inv\xE1lida"
3039
- },
3040
- pagination: {
3041
- previous: "Anterior",
3042
- next: "Siguiente",
3043
- page: "P\xE1gina {page}",
3044
- of: "de {total}"
3045
- }
3046
- },
3047
- fr: {
3048
- common: {
3049
- loading: "Chargement...",
3050
- error: "Erreur",
3051
- retry: "R\xE9essayer",
3052
- cancel: "Annuler",
3053
- confirm: "Confirmer",
3054
- close: "Fermer",
3055
- save: "Enregistrer",
3056
- delete: "Supprimer",
3057
- edit: "Modifier",
3058
- search: "Rechercher",
3059
- clear: "Effacer",
3060
- submit: "Soumettre",
3061
- reset: "R\xE9initialiser"
3062
- },
3063
- form: {
3064
- required: "Ce champ est obligatoire",
3065
- invalid: "Valeur invalide",
3066
- tooShort: "La valeur est trop courte (minimum {min} caract\xE8res)",
3067
- tooLong: "La valeur est trop longue (maximum {max} caract\xE8res)",
3068
- invalidEmail: "Adresse e-mail invalide",
3069
- invalidUrl: "URL invalide"
3070
- },
3071
- pagination: {
3072
- previous: "Pr\xE9c\xE9dent",
3073
- next: "Suivant",
3074
- page: "Page {page}",
3075
- of: "sur {total}"
3076
- }
3077
- }
3078
- };
3079
- // src/utils/keep-alive.ts
3080
- function createKeepAlive(options = {}) {
3081
- const {
3082
- max = 10,
3083
- ttl = 0,
3084
- include,
3085
- exclude,
3086
- hooks: globalHooks,
3087
- debug = false
3088
- } = options;
3089
- const cache = new Map;
3090
- let hits = 0;
3091
- let misses = 0;
3092
- function log(...args) {
3093
- if (debug) {
3094
- console.log("[KeepAlive]", ...args);
3095
- }
3096
- }
3097
- function shouldCache(type) {
3098
- if (exclude) {
3099
- if (exclude instanceof RegExp && exclude.test(type)) {
3100
- return false;
3101
- }
3102
- if (Array.isArray(exclude) && exclude.includes(type)) {
3103
- return false;
3104
- }
3105
- }
3106
- if (include) {
3107
- if (include instanceof RegExp && !include.test(type)) {
3108
- return false;
3109
- }
3110
- if (Array.isArray(include) && !include.includes(type)) {
3111
- return false;
3112
- }
3113
- }
3114
- return true;
3115
- }
3116
- function isExpired(entry) {
3117
- if (!ttl || !entry.expiresAt) {
3118
- return false;
3119
- }
3120
- return Date.now() > entry.expiresAt;
3121
- }
3122
- function touch(key) {
3123
- const entry = cache.get(key);
3124
- if (entry) {
3125
- entry.lastAccessedAt = Date.now();
3126
- entry.accessCount++;
3127
- entry.instance.lastAccessedAt = entry.lastAccessedAt;
3128
- cache.delete(key);
3129
- cache.set(key, entry);
3130
- log(`Touched: ${key} (access count: ${entry.accessCount})`);
3131
- }
3132
- }
3133
- function evictLRU() {
3134
- if (cache.size === 0) {
3135
- return false;
3136
- }
3137
- const firstKey = cache.keys().next().value;
3138
- if (!firstKey) {
3139
- return false;
3140
- }
3141
- const entry = cache.get(firstKey);
3142
- if (entry) {
3143
- log(`Evicting LRU: ${firstKey}`);
3144
- const hooks = entry.instance.hooks;
3145
- if (hooks?.onDeactivate) {
3146
- hooks.onDeactivate(entry.instance);
3147
- }
3148
- if (globalHooks?.onDeactivate) {
3149
- globalHooks.onDeactivate(entry.instance);
3150
- }
3151
- cache.delete(firstKey);
3152
- return true;
3153
- }
3154
- return false;
3155
- }
3156
- function cacheComponent(key, instance, hooks) {
3157
- if (!shouldCache(instance.type)) {
3158
- log(`Type not cacheable: ${instance.type}`);
3159
- return instance;
3160
- }
3161
- if (cache.size >= max) {
3162
- evictLRU();
3163
- }
3164
- const now = Date.now();
3165
- const entry = {
3166
- instance: {
3167
- ...instance,
3168
- hooks: hooks || instance.hooks,
3169
- createdAt: instance.createdAt || now,
3170
- lastAccessedAt: now
3171
- },
3172
- accessCount: 0,
3173
- createdAt: now,
3174
- lastAccessedAt: now,
3175
- expiresAt: ttl ? now + ttl : undefined
3176
- };
3177
- cache.set(key, entry);
3178
- log(`Cached: ${key} (size: ${cache.size}/${max})`);
3179
- if (hooks?.onMount) {
3180
- hooks.onMount(entry.instance);
3181
- }
3182
- if (globalHooks?.onMount) {
3183
- globalHooks.onMount(entry.instance);
3184
- }
3185
- return entry.instance;
3186
- }
3187
- function get(key) {
3188
- const entry = cache.get(key);
3189
- if (!entry) {
3190
- misses++;
3191
- log(`Miss: ${key}`);
3192
- return null;
3193
- }
3194
- if (isExpired(entry)) {
3195
- log(`Expired: ${key}`);
3196
- cache.delete(key);
3197
- misses++;
3198
- return null;
3199
- }
3200
- hits++;
3201
- touch(key);
3202
- log(`Hit: ${key}`);
3203
- return entry.instance;
3204
- }
3205
- function has(key) {
3206
- const entry = cache.get(key);
3207
- if (!entry) {
3208
- return false;
3209
- }
3210
- if (isExpired(entry)) {
3211
- cache.delete(key);
3212
- return false;
3213
- }
3214
- return true;
3215
- }
3216
- function remove(key) {
3217
- const entry = cache.get(key);
3218
- if (!entry) {
3219
- return false;
3220
- }
3221
- log(`Removing: ${key}`);
3222
- const hooks = entry.instance.hooks;
3223
- if (hooks?.onUnmount) {
3224
- hooks.onUnmount(entry.instance);
3225
- }
3226
- if (globalHooks?.onUnmount) {
3227
- globalHooks.onUnmount(entry.instance);
3228
- }
3229
- return cache.delete(key);
3230
- }
3231
- function clear() {
3232
- log("Clearing cache");
3233
- cache.forEach((entry) => {
3234
- const hooks = entry.instance.hooks;
3235
- if (hooks?.onUnmount) {
3236
- hooks.onUnmount(entry.instance);
3237
- }
3238
- if (globalHooks?.onUnmount) {
3239
- globalHooks.onUnmount(entry.instance);
3240
- }
3241
- });
3242
- cache.clear();
3243
- hits = 0;
3244
- misses = 0;
3245
- }
3246
- function prune() {
3247
- let pruned = 0;
3248
- const _now = Date.now();
3249
- for (const [key, entry] of cache.entries()) {
3250
- if (isExpired(entry)) {
3251
- log(`Pruning expired: ${key}`);
3252
- remove(key);
3253
- pruned++;
3254
- }
3255
- }
3256
- while (cache.size > max) {
3257
- if (evictLRU()) {
3258
- pruned++;
3259
- } else {
3260
- break;
3261
- }
3262
- }
3263
- if (pruned > 0) {
3264
- log(`Pruned ${pruned} entries`);
3265
- }
3266
- return pruned;
3267
- }
3268
- function activate(key) {
3269
- const instance = get(key);
3270
- if (!instance) {
3271
- return null;
3272
- }
3273
- log(`Activating: ${key}`);
3274
- const hooks = instance.hooks;
3275
- if (hooks?.onActivate) {
3276
- hooks.onActivate(instance);
3277
- }
3278
- if (globalHooks?.onActivate) {
3279
- globalHooks.onActivate(instance);
3280
- }
3281
- if (instance.state && hooks?.onRestore) {
3282
- hooks.onRestore(instance, instance.state);
3283
- }
3284
- return instance;
3285
- }
3286
- function deactivate(key) {
3287
- const entry = cache.get(key);
3288
- if (!entry) {
3289
- return false;
3290
- }
3291
- log(`Deactivating: ${key}`);
3292
- const instance = entry.instance;
3293
- const hooks = instance.hooks;
3294
- if (hooks?.onSave) {
3295
- instance.state = hooks.onSave(instance);
3296
- }
3297
- if (hooks?.onDeactivate) {
3298
- hooks.onDeactivate(instance);
3299
- }
3300
- if (globalHooks?.onDeactivate) {
3301
- globalHooks.onDeactivate(instance);
3302
- }
3303
- return true;
3304
- }
3305
- function getStats() {
3306
- const total = hits + misses;
3307
- return {
3308
- hits,
3309
- misses,
3310
- size: cache.size,
3311
- max,
3312
- hitRate: total > 0 ? hits / total : 0,
3313
- keys: Array.from(cache.keys())
3314
- };
3315
- }
3316
- function keys() {
3317
- return Array.from(cache.keys());
3318
- }
3319
- function size() {
3320
- return cache.size;
3321
- }
3322
- return {
3323
- cache: cacheComponent,
3324
- get,
3325
- has,
3326
- remove,
3327
- clear,
3328
- prune,
3329
- activate,
3330
- deactivate,
3331
- getStats,
3332
- keys,
3333
- size
3334
- };
3335
- }
3336
- function createLRUCache(maxSize) {
3337
- const cache = new Map;
3338
- return {
3339
- set(key, value) {
3340
- if (cache.has(key)) {
3341
- cache.delete(key);
3342
- }
3343
- cache.set(key, value);
3344
- if (cache.size > maxSize) {
3345
- const firstKey = cache.keys().next().value;
3346
- if (firstKey) {
3347
- cache.delete(firstKey);
3348
- }
3349
- }
3350
- },
3351
- get(key) {
3352
- if (!cache.has(key)) {
3353
- return;
3354
- }
3355
- const value = cache.get(key);
3356
- cache.delete(key);
3357
- cache.set(key, value);
3358
- return value;
3359
- },
3360
- has(key) {
3361
- return cache.has(key);
3362
- },
3363
- delete(key) {
3364
- return cache.delete(key);
3365
- },
3366
- clear() {
3367
- cache.clear();
3368
- },
3369
- get size() {
3370
- return cache.size;
3371
- },
3372
- keys() {
3373
- return Array.from(cache.keys());
3374
- },
3375
- values() {
3376
- return Array.from(cache.values());
3377
- },
3378
- forEach(callback) {
3379
- cache.forEach(callback);
3380
- }
3381
- };
3382
- }
3383
- function createStateManager() {
3384
- const states = new Map;
3385
- return {
3386
- save(key, state) {
3387
- states.set(key, JSON.parse(JSON.stringify(state)));
3388
- },
3389
- restore(key) {
3390
- const state = states.get(key);
3391
- return state ? JSON.parse(JSON.stringify(state)) : null;
3392
- },
3393
- has(key) {
3394
- return states.has(key);
3395
- },
3396
- remove(key) {
3397
- return states.delete(key);
3398
- },
3399
- clear() {
3400
- states.clear();
3401
- },
3402
- keys() {
3403
- return Array.from(states.keys());
3404
- },
3405
- get size() {
3406
- return states.size;
3407
- }
3408
- };
3409
- }
3410
- function createComponentPool(factory, options = {}) {
3411
- const { maxSize = 100, reset } = options;
3412
- const pool = [];
3413
- return {
3414
- acquire() {
3415
- if (pool.length > 0) {
3416
- return pool.pop();
3417
- }
3418
- return factory();
3419
- },
3420
- release(instance) {
3421
- if (pool.length < maxSize) {
3422
- if (reset) {
3423
- reset(instance);
3424
- }
3425
- pool.push(instance);
3426
- }
3427
- },
3428
- clear() {
3429
- pool.length = 0;
3430
- },
3431
- get size() {
3432
- return pool.length;
3433
- },
3434
- get maxSize() {
3435
- return maxSize;
3436
- }
3437
- };
3438
- }
3439
- // src/utils/lazy-loading.ts
3440
- var moduleCache = new Map;
3441
- async function lazyLoadModule(importFn, cacheKey) {
3442
- const key = cacheKey || importFn.toString();
3443
- if (moduleCache.has(key)) {
3444
- return moduleCache.get(key);
3445
- }
3446
- const promise = importFn();
3447
- moduleCache.set(key, promise);
3448
- try {
3449
- return await promise;
3450
- } catch (error) {
3451
- moduleCache.delete(key);
3452
- throw error;
3453
- }
3454
- }
3455
- function lazyLoadComponent(importFn, options = {}) {
3456
- const {
3457
- retryAttempts = 3,
3458
- retryDelay = 1000,
3459
- onLoading,
3460
- onLoaded,
3461
- onError
3462
- } = options;
3463
- let state = "idle";
3464
- let module;
3465
- let error;
3466
- const loadWithRetry = async (attempt = 0) => {
3467
- try {
3468
- if (state === "loading" || state === "loaded") {
3469
- if (module) {
3470
- return module;
3471
- }
3472
- }
3473
- state = "loading";
3474
- onLoading?.();
3475
- const loaded = await lazyLoadModule(importFn);
3476
- module = loaded;
3477
- state = "loaded";
3478
- onLoaded?.(loaded);
3479
- return loaded;
3480
- } catch (err) {
3481
- const loadError = err;
3482
- if (attempt < retryAttempts) {
3483
- await new Promise((resolve) => setTimeout(resolve, retryDelay * (attempt + 1)));
3484
- return loadWithRetry(attempt + 1);
3485
- }
3486
- state = "error";
3487
- error = loadError;
3488
- onError?.(loadError);
3489
- throw loadError;
3490
- }
3491
- };
3492
- return {
3493
- get state() {
3494
- return state;
3495
- },
3496
- get module() {
3497
- return module;
3498
- },
3499
- get error() {
3500
- return error;
3501
- },
3502
- load: () => loadWithRetry(),
3503
- preload: () => loadWithRetry()
3504
- };
3505
- }
3506
- function lazyLoad(element, importFn, options = {}) {
3507
- if (!element) {
3508
- console.warn("lazyLoad: element is null");
3509
- return () => {};
3510
- }
3511
- const {
3512
- root = null,
3513
- rootMargin = "0px",
3514
- threshold = 0.01,
3515
- placeholder,
3516
- errorContent,
3517
- onLoading,
3518
- onLoaded,
3519
- onError
3520
- } = options;
3521
- let hasLoaded = false;
3522
- let observer = null;
3523
- if (placeholder) {
3524
- if (typeof placeholder === "string") {
3525
- element.innerHTML = placeholder;
3526
- } else {
3527
- element.innerHTML = "";
3528
- element.appendChild(placeholder);
3529
- }
3530
- }
3531
- const handleIntersection = async (entries) => {
3532
- for (const entry of entries) {
3533
- if (entry.isIntersecting && !hasLoaded) {
3534
- hasLoaded = true;
3535
- observer?.disconnect();
3536
- try {
3537
- onLoading?.();
3538
- const module = await lazyLoadModule(importFn);
3539
- onLoaded?.(module);
3540
- if (module && typeof module.default?.render === "function") {
3541
- const content = await module.default.render();
3542
- element.innerHTML = content;
3543
- }
3544
- } catch (error) {
3545
- const loadError = error;
3546
- onError?.(loadError);
3547
- if (errorContent) {
3548
- if (typeof errorContent === "string") {
3549
- element.innerHTML = errorContent;
3550
- } else {
3551
- element.innerHTML = "";
3552
- element.appendChild(errorContent);
3553
- }
3554
- } else {
3555
- element.innerHTML = `<div style="color: red;">Failed to load component: ${loadError.message}</div>`;
3556
- }
3557
- }
3558
- }
3559
- }
3560
- };
3561
- observer = new IntersectionObserver(handleIntersection, {
3562
- root,
3563
- rootMargin,
3564
- threshold
3565
- });
3566
- observer.observe(element);
3567
- return () => {
3568
- observer?.disconnect();
3569
- observer = null;
3570
- };
3571
- }
3572
- function lazyLoadAll(elements, importFn, options = {}) {
3573
- const cleanupFunctions = [];
3574
- const elementsArray = Array.from(elements);
3575
- for (const element of elementsArray) {
3576
- const importFunction = typeof importFn === "function" && importFn.length > 0 ? () => importFn(element) : importFn;
3577
- const cleanup = lazyLoad(element, importFunction, options);
3578
- cleanupFunctions.push(cleanup);
3579
- }
3580
- return () => {
3581
- cleanupFunctions.forEach((cleanup) => cleanup());
3582
- };
3583
- }
3584
- function preloadModule(importFn) {
3585
- return lazyLoadModule(importFn);
3586
- }
3587
- function preloadModules(importFns) {
3588
- return Promise.all(importFns.map((fn) => preloadModule(fn)));
3589
- }
3590
- function clearModuleCache(cacheKey) {
3591
- if (cacheKey) {
3592
- moduleCache.delete(cacheKey);
3593
- } else {
3594
- moduleCache.clear();
3595
- }
3596
- }
3597
- function getCacheStats() {
3598
- return {
3599
- size: moduleCache.size,
3600
- keys: Array.from(moduleCache.keys())
3601
- };
3602
- }
3603
- function createRouteLoader(routes) {
3604
- return {
3605
- async load(path) {
3606
- const importFn = routes[path];
3607
- if (!importFn) {
3608
- throw new Error(`No route found for path: ${path}`);
3609
- }
3610
- return lazyLoadModule(importFn, `route:${path}`);
3611
- },
3612
- async preload(path) {
3613
- return this.load(path);
3614
- },
3615
- async preloadRoutes(paths) {
3616
- return Promise.all(paths.map((path) => this.preload(path)));
3617
- }
3618
- };
3619
- }
3620
- function lazyLoadImage(img, src, options = {}) {
3621
- if (!img) {
3622
- return () => {};
3623
- }
3624
- const {
3625
- root = null,
3626
- rootMargin = "50px",
3627
- threshold = 0.01,
3628
- placeholder,
3629
- onLoading,
3630
- onLoaded,
3631
- onError
3632
- } = options;
3633
- if (placeholder && typeof placeholder === "string") {
3634
- img.src = placeholder;
3635
- }
3636
- let hasLoaded = false;
3637
- let observer = null;
3638
- const handleIntersection = (entries) => {
3639
- for (const entry of entries) {
3640
- if (entry.isIntersecting && !hasLoaded) {
3641
- hasLoaded = true;
3642
- observer?.disconnect();
3643
- onLoading?.();
3644
- img.src = src;
3645
- img.addEventListener("load", () => {
3646
- onLoaded?.(img);
3647
- img.classList.add("loaded");
3648
- }, { once: true });
3649
- img.addEventListener("error", (_event) => {
3650
- const error = new Error(`Failed to load image: ${src}`);
3651
- onError?.(error);
3652
- img.classList.add("error");
3653
- }, { once: true });
3654
- }
3655
- }
3656
- };
3657
- observer = new IntersectionObserver(handleIntersection, {
3658
- root,
3659
- rootMargin,
3660
- threshold
3661
- });
3662
- observer.observe(img);
3663
- return () => {
3664
- observer?.disconnect();
3665
- observer = null;
3666
- };
3667
- }
3668
- function lazyLoadImages(container = document, options = {}) {
3669
- const images = container.querySelectorAll("img[data-lazy-src]");
3670
- const cleanupFunctions = [];
3671
- images.forEach((img) => {
3672
- const src = img.getAttribute("data-lazy-src");
3673
- if (src) {
3674
- const cleanup = lazyLoadImage(img, src, options);
3675
- cleanupFunctions.push(cleanup);
3676
- }
3677
- });
3678
- return () => {
3679
- cleanupFunctions.forEach((cleanup) => cleanup());
3680
- };
3681
- }
3682
- // src/utils/theme.ts
3683
- var defaultTheme = {
3684
- colors: {
3685
- primary: "#3b82f6",
3686
- secondary: "#8b5cf6",
3687
- success: "#10b981",
3688
- warning: "#f59e0b",
3689
- danger: "#ef4444",
3690
- info: "#06b6d4",
3691
- gray: "#6b7280",
3692
- white: "#ffffff",
3693
- black: "#000000"
3694
- },
3695
- typography: {
3696
- fontFamily: {
3697
- sans: 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
3698
- serif: 'Georgia, Cambria, "Times New Roman", Times, serif',
3699
- mono: 'Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'
3700
- },
3701
- fontSize: {
3702
- xs: "0.75rem",
3703
- sm: "0.875rem",
3704
- base: "1rem",
3705
- lg: "1.125rem",
3706
- xl: "1.25rem",
3707
- "2xl": "1.5rem",
3708
- "3xl": "1.875rem",
3709
- "4xl": "2.25rem"
3710
- },
3711
- fontWeight: {
3712
- light: "300",
3713
- normal: "400",
3714
- medium: "500",
3715
- semibold: "600",
3716
- bold: "700"
3717
- },
3718
- lineHeight: {
3719
- tight: "1.25",
3720
- normal: "1.5",
3721
- relaxed: "1.75"
3722
- }
3723
- },
3724
- spacing: {
3725
- xs: "0.25rem",
3726
- sm: "0.5rem",
3727
- md: "1rem",
3728
- lg: "1.5rem",
3729
- xl: "2rem",
3730
- "2xl": "3rem",
3731
- "3xl": "4rem",
3732
- "4xl": "6rem"
3733
- },
3734
- borderRadius: {
3735
- none: "0",
3736
- sm: "0.125rem",
3737
- md: "0.375rem",
3738
- lg: "0.5rem",
3739
- full: "9999px"
3740
- },
3741
- shadows: {
3742
- sm: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
3743
- md: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",
3744
- lg: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",
3745
- xl: "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",
3746
- "2xl": "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
3747
- none: "none"
3748
- },
3749
- components: {
3750
- button: {
3751
- borderRadius: "0.375rem",
3752
- padding: "0.5rem 1rem",
3753
- fontSize: "0.875rem",
3754
- fontWeight: "500"
3755
- },
3756
- input: {
3757
- borderRadius: "0.375rem",
3758
- padding: "0.5rem 0.75rem",
3759
- fontSize: "0.875rem",
3760
- borderWidth: "1px"
3761
- },
3762
- card: {
3763
- borderRadius: "0.5rem",
3764
- padding: "1.5rem",
3765
- shadow: "0 1px 3px 0 rgba(0, 0, 0, 0.1)"
3766
- }
3767
- }
3768
- };
3769
- function deepMerge(target, source) {
3770
- const output = { ...target };
3771
- for (const key in source) {
3772
- if (source[key] instanceof Object && key in target) {
3773
- output[key] = deepMerge(target[key], source[key]);
3774
- } else {
3775
- output[key] = source[key];
3776
- }
3777
- }
3778
- return output;
3779
- }
3780
- function createTheme(customTheme) {
3781
- return deepMerge(defaultTheme, customTheme);
3782
- }
3783
- var currentTheme = defaultTheme;
3784
- function getTheme() {
3785
- return currentTheme;
3786
- }
3787
- function themeToCSSProperties(theme) {
3788
- const cssVars = [];
3789
- if (theme.colors) {
3790
- Object.entries(theme.colors).forEach(([key, value]) => {
3791
- if (value)
3792
- cssVars.push(`--color-${key}: ${value};`);
3793
- });
3794
- }
3795
- if (theme.typography?.fontFamily) {
3796
- Object.entries(theme.typography.fontFamily).forEach(([key, value]) => {
3797
- if (value)
3798
- cssVars.push(`--font-${key}: ${value};`);
3799
- });
3800
- }
3801
- if (theme.typography?.fontSize) {
3802
- Object.entries(theme.typography.fontSize).forEach(([key, value]) => {
3803
- if (value)
3804
- cssVars.push(`--text-${key}: ${value};`);
3805
- });
3806
- }
3807
- if (theme.typography?.fontWeight) {
3808
- Object.entries(theme.typography.fontWeight).forEach(([key, value]) => {
3809
- if (value)
3810
- cssVars.push(`--font-weight-${key}: ${value};`);
3811
- });
3812
- }
3813
- if (theme.typography?.lineHeight) {
3814
- Object.entries(theme.typography.lineHeight).forEach(([key, value]) => {
3815
- if (value)
3816
- cssVars.push(`--leading-${key}: ${value};`);
3817
- });
3818
- }
3819
- if (theme.spacing) {
3820
- Object.entries(theme.spacing).forEach(([key, value]) => {
3821
- if (value)
3822
- cssVars.push(`--spacing-${key}: ${value};`);
3823
- });
3824
- }
3825
- if (theme.borderRadius) {
3826
- Object.entries(theme.borderRadius).forEach(([key, value]) => {
3827
- if (value)
3828
- cssVars.push(`--radius-${key}: ${value};`);
3829
- });
3830
- }
3831
- if (theme.shadows) {
3832
- Object.entries(theme.shadows).forEach(([key, value]) => {
3833
- if (value)
3834
- cssVars.push(`--shadow-${key}: ${value};`);
3835
- });
3836
- }
3837
- if (theme.components?.button) {
3838
- Object.entries(theme.components.button).forEach(([key, value]) => {
3839
- if (value)
3840
- cssVars.push(`--button-${key.replace(/([A-Z])/g, "-$1").toLowerCase()}: ${value};`);
3841
- });
3842
- }
3843
- if (theme.components?.input) {
3844
- Object.entries(theme.components.input).forEach(([key, value]) => {
3845
- if (value)
3846
- cssVars.push(`--input-${key.replace(/([A-Z])/g, "-$1").toLowerCase()}: ${value};`);
3847
- });
3848
- }
3849
- if (theme.components?.card) {
3850
- Object.entries(theme.components.card).forEach(([key, value]) => {
3851
- if (value)
3852
- cssVars.push(`--card-${key.replace(/([A-Z])/g, "-$1").toLowerCase()}: ${value};`);
3853
- });
3854
- }
3855
- return `:root {
3856
- ${cssVars.join(`
16
+ `,o=document.createElement("style");o.textContent=s,document.head.appendChild(o)}function ja(e,t,s={}){if(typeof e.animate!=="function")return console.warn("Web Animations API not supported"),null;let{duration:o=1000,easing:a="ease",delay:i=0,iterations:r=1,direction:n="normal",fill:c="both"}=s;return e.animate([...t],{duration:o,easing:a,delay:i,iterations:r,direction:n,fill:c})}var Ha={fadeIn:[{offset:0,opacity:0},{offset:1,opacity:1}],fadeOut:[{offset:0,opacity:1},{offset:1,opacity:0}],slideInUp:[{offset:0,transform:"translateY(100%)",opacity:0},{offset:1,transform:"translateY(0)",opacity:1}],slideInDown:[{offset:0,transform:"translateY(-100%)",opacity:0},{offset:1,transform:"translateY(0)",opacity:1}],slideInLeft:[{offset:0,transform:"translateX(-100%)",opacity:0},{offset:1,transform:"translateX(0)",opacity:1}],slideInRight:[{offset:0,transform:"translateX(100%)",opacity:0},{offset:1,transform:"translateX(0)",opacity:1}],slideOutUp:[{offset:0,transform:"translateY(0)",opacity:1},{offset:1,transform:"translateY(-100%)",opacity:0}],slideOutDown:[{offset:0,transform:"translateY(0)",opacity:1},{offset:1,transform:"translateY(100%)",opacity:0}],slideOutLeft:[{offset:0,transform:"translateX(0)",opacity:1},{offset:1,transform:"translateX(-100%)",opacity:0}],slideOutRight:[{offset:0,transform:"translateX(0)",opacity:1},{offset:1,transform:"translateX(100%)",opacity:0}],zoomIn:[{offset:0,transform:"scale(0)",opacity:0},{offset:0.5,opacity:1},{offset:1,transform:"scale(1)"}],zoomOut:[{offset:0,transform:"scale(1)",opacity:1},{offset:0.5,opacity:1},{offset:1,transform:"scale(0)",opacity:0}],rotate:[{offset:0,transform:"rotate(0deg)"},{offset:1,transform:"rotate(360deg)"}],bounce:[{offset:0,transform:"translateY(0)"},{offset:0.2,transform:"translateY(0)"},{offset:0.4,transform:"translateY(-30px)"},{offset:0.43,transform:"translateY(-30px)"},{offset:0.53,transform:"translateY(0)"},{offset:0.7,transform:"translateY(-15px)"},{offset:0.8,transform:"translateY(0)"},{offset:0.9,transform:"translateY(-4px)"},{offset:1,transform:"translateY(0)"}],pulse:[{offset:0,transform:"scale(1)"},{offset:0.5,transform:"scale(1.05)"},{offset:1,transform:"scale(1)"}],shake:[{offset:0,transform:"translateX(0)"},{offset:0.1,transform:"translateX(-10px)"},{offset:0.2,transform:"translateX(10px)"},{offset:0.3,transform:"translateX(-10px)"},{offset:0.4,transform:"translateX(10px)"},{offset:0.5,transform:"translateX(-10px)"},{offset:0.6,transform:"translateX(10px)"},{offset:0.7,transform:"translateX(-10px)"},{offset:0.8,transform:"translateX(10px)"},{offset:0.9,transform:"translateX(-10px)"},{offset:1,transform:"translateX(0)"}],swing:[{offset:0,transform:"rotate(0deg)"},{offset:0.2,transform:"rotate(15deg)"},{offset:0.4,transform:"rotate(-10deg)"},{offset:0.6,transform:"rotate(5deg)"},{offset:0.8,transform:"rotate(-5deg)"},{offset:1,transform:"rotate(0deg)"}],flip:[{offset:0,transform:"perspective(400px) rotateY(0)",animationTimingFunction:"ease-out"},{offset:0.4,transform:"perspective(400px) translateZ(150px) rotateY(170deg)",animationTimingFunction:"ease-out"},{offset:0.5,transform:"perspective(400px) translateZ(150px) rotateY(190deg)",animationTimingFunction:"ease-in"},{offset:0.8,transform:"perspective(400px) rotateY(360deg)",animationTimingFunction:"ease-in"},{offset:1,transform:"perspective(400px)",animationTimingFunction:"ease-in"}],rubberBand:[{offset:0,transform:"scale(1)"},{offset:0.3,transform:"scaleX(1.25) scaleY(0.75)"},{offset:0.4,transform:"scaleX(0.75) scaleY(1.25)"},{offset:0.5,transform:"scaleX(1.15) scaleY(0.85)"},{offset:0.65,transform:"scaleX(0.95) scaleY(1.05)"},{offset:0.75,transform:"scaleX(1.05) scaleY(0.95)"},{offset:1,transform:"scale(1)"}],heartbeat:[{offset:0,transform:"scale(1)"},{offset:0.14,transform:"scale(1.3)"},{offset:0.28,transform:"scale(1)"},{offset:0.42,transform:"scale(1.3)"},{offset:0.7,transform:"scale(1)"}]};function Wd(e,t,s={}){return ja(e,Ha[t],s)}import{createHighlighter as Va}from"ts-syntax-highlighter";var se=null;async function Wa(){if(!se)se=await Va({theme:"github-light"});return se}async function Kd(e,t={}){let{theme:s="auto",language:o="typescript",lineNumbers:a=!1,wrapLines:i=!0}=t,r=await Wa(),n=s==="auto"?globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches?"github-dark":"github-light":s==="dark"?"github-dark":"github-light",c=await r.highlight(e,o);return{html:typeof c==="string"?c:String(c),language:o,theme:n}}function Gd(e){if(e.includes("<!DOCTYPE")||e.includes("<html"))return"html";if(e.includes("<?php"))return"php";if(e.includes("import")&&e.includes("from"))return"typescript";if(e.includes("function")||e.includes("const"))return"javascript";if(e.includes("{")&&e.includes("}"))return"json";if(e.includes("$")&&e.includes("|"))return"bash";if(e.includes("#")&&e.includes("##"))return"markdown";return"typescript"}function Ud(e,t){return`<div class="${t?`rounded-md overflow-auto text-sm leading-relaxed font-mono ${t}`:"rounded-md overflow-auto text-sm leading-relaxed font-mono"}">${e}</div>`}var L=null,_a=(e)=>{return e===1?0:1};function G(e,t){return t.split(".").reduce((s,o)=>s?.[o],e)}function oe(e,t={}){return e.replace(/\{(\w+)\}/g,(s,o)=>{return t[o]!==void 0?String(t[o]):s})}function Jd(e){let{locale:t,fallbackLocale:s="en",messages:o,pluralRules:a={},dateTimeFormats:i={},numberFormats:r={},missing:n,warnMissing:c=!0}=e;function d(x,m={}){let C=G(o[t],x);if(C===void 0&&s)C=G(o[s],x);if(C===void 0){if(n){let T=n(t,x);if(T)return oe(T,m)}if(c&&typeof console<"u")console.warn(`[i18n] Missing translation for key "${x}" in locale "${t}"`);return x}if(typeof C==="string")return oe(C,m);return String(C)}function f(x,m,C={}){let T=d(x,{...C,count:m});if(T.includes("|")){let z=T.split("|").map((Z)=>Z.trim()),J=(a[t]||_a)(m,t),X=z[J]||z[z.length-1];return oe(X,{...C,count:m})}return T}function p(x,m="default"){let C=typeof x==="number"?new Date(x):x,T=i[m]||i.default||{};return new Intl.DateTimeFormat(t,T).format(C)}function g(x,m="default"){let C=r[m]||r.default||{};return new Intl.NumberFormat(t,C).format(x)}function b(x){if(G(o[t],x)!==void 0)return!0;if(s)return G(o[s],x)!==void 0;return!1}function w(x){if(!o[x]){console.warn(`[i18n] Locale "${x}" not found. Available locales: ${Object.keys(o).join(", ")}`);return}t=x}function v(x,m){if(!o[x])o[x]={};o[x]={...o[x],...m}}function k(x){delete o[x]}return{get locale(){return t},get availableLocales(){return Object.keys(o)},setLocale:w,t:d,tc:f,d:p,n:g,te:b,addMessages:v,removeLocale:k}}function Xd(e){L=e}function Zd(){return L}function Qd(e,t){if(!L)return console.warn("[i18n] No global i18n instance set. Call setI18n() first."),e;return L.t(e,t)}function ep(e,t,s){if(!L)return console.warn("[i18n] No global i18n instance set. Call setI18n() first."),e;return L.tc(e,t,s)}function tp(e,t){if(!L)return console.warn("[i18n] No global i18n instance set. Call setI18n() first."),String(e);return L.d(e,t)}function sp(e,t){if(!L)return console.warn("[i18n] No global i18n instance set. Call setI18n() first."),String(e);return L.n(e,t)}var op={en:(e)=>e===1?0:1,de:(e)=>e===1?0:1,nl:(e)=>e===1?0:1,sv:(e)=>e===1?0:1,fr:(e)=>e===0||e===1?0:1,pt_BR:(e)=>e===0||e===1?0:1,ru:(e)=>{if(e%10===1&&e%100!==11)return 0;if(e%10>=2&&e%10<=4&&(e%100<10||e%100>=20))return 1;return 2},pl:(e)=>{if(e===1)return 0;if(e%10>=2&&e%10<=4&&(e%100<10||e%100>=20))return 1;return 2},cs:(e)=>{if(e===1)return 0;if(e>=2&&e<=4)return 1;return 2},ar:(e)=>{if(e===0)return 0;if(e===1)return 1;if(e===2)return 2;if(e%100>=3&&e%100<=10)return 3;if(e%100>=11)return 4;return 5},ja:()=>0,ko:()=>0,zh:()=>0,th:()=>0,vi:()=>0},ap={short:{year:"numeric",month:"numeric",day:"numeric"},long:{year:"numeric",month:"long",day:"numeric"},full:{weekday:"long",year:"numeric",month:"long",day:"numeric"},time:{hour:"numeric",minute:"numeric"},datetime:{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric"}},ip={decimal:{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2},currency:{style:"currency",currency:"USD"},percent:{style:"percent",minimumFractionDigits:0,maximumFractionDigits:2},compact:{notation:"compact"}};function rp(e){let t=["ar","he","fa","ur","yi"],s=e.split("-")[0].toLowerCase();return t.includes(s)}async function np(e,t){try{return await t()}catch(s){return console.error(`[i18n] Failed to load messages for locale "${e}":`,s),{}}}var lp={en:{common:{loading:"Loading...",error:"Error",retry:"Retry",cancel:"Cancel",confirm:"Confirm",close:"Close",save:"Save",delete:"Delete",edit:"Edit",search:"Search",clear:"Clear",submit:"Submit",reset:"Reset"},form:{required:"This field is required",invalid:"Invalid value",tooShort:"Value is too short (minimum {min} characters)",tooLong:"Value is too long (maximum {max} characters)",invalidEmail:"Invalid email address",invalidUrl:"Invalid URL"},pagination:{previous:"Previous",next:"Next",page:"Page {page}",of:"of {total}"}},es:{common:{loading:"Cargando...",error:"Error",retry:"Reintentar",cancel:"Cancelar",confirm:"Confirmar",close:"Cerrar",save:"Guardar",delete:"Eliminar",edit:"Editar",search:"Buscar",clear:"Limpiar",submit:"Enviar",reset:"Restablecer"},form:{required:"Este campo es obligatorio",invalid:"Valor inv\xE1lido",tooShort:"El valor es demasiado corto (m\xEDnimo {min} caracteres)",tooLong:"El valor es demasiado largo (m\xE1ximo {max} caracteres)",invalidEmail:"Direcci\xF3n de correo electr\xF3nico inv\xE1lida",invalidUrl:"URL inv\xE1lida"},pagination:{previous:"Anterior",next:"Siguiente",page:"P\xE1gina {page}",of:"de {total}"}},fr:{common:{loading:"Chargement...",error:"Erreur",retry:"R\xE9essayer",cancel:"Annuler",confirm:"Confirmer",close:"Fermer",save:"Enregistrer",delete:"Supprimer",edit:"Modifier",search:"Rechercher",clear:"Effacer",submit:"Soumettre",reset:"R\xE9initialiser"},form:{required:"Ce champ est obligatoire",invalid:"Valeur invalide",tooShort:"La valeur est trop courte (minimum {min} caract\xE8res)",tooLong:"La valeur est trop longue (maximum {max} caract\xE8res)",invalidEmail:"Adresse e-mail invalide",invalidUrl:"URL invalide"},pagination:{previous:"Pr\xE9c\xE9dent",next:"Suivant",page:"Page {page}",of:"sur {total}"}}};function dp(e={}){let{max:t=10,ttl:s=0,include:o,exclude:a,hooks:i,debug:r=!1}=e,n=new Map,c=0,d=0;function f(...u){if(r)console.log("[KeepAlive]",...u)}function p(u){if(a){if(a instanceof RegExp&&a.test(u))return!1;if(Array.isArray(a)&&a.includes(u))return!1}if(o){if(o instanceof RegExp&&!o.test(u))return!1;if(Array.isArray(o)&&!o.includes(u))return!1}return!0}function g(u){if(!s||!u.expiresAt)return!1;return Date.now()>u.expiresAt}function b(u){let h=n.get(u);if(h)h.lastAccessedAt=Date.now(),h.accessCount++,h.instance.lastAccessedAt=h.lastAccessedAt,n.delete(u),n.set(u,h),f(`Touched: ${u} (access count: ${h.accessCount})`)}function w(){if(n.size===0)return!1;let u=n.keys().next().value;if(!u)return!1;let h=n.get(u);if(h){f(`Evicting LRU: ${u}`);let y=h.instance.hooks;if(y?.onDeactivate)y.onDeactivate(h.instance);if(i?.onDeactivate)i.onDeactivate(h.instance);return n.delete(u),!0}return!1}function v(u,h,y){if(!p(h.type))return f(`Type not cacheable: ${h.type}`),h;if(n.size>=t)w();let D=Date.now(),H={instance:{...h,hooks:y||h.hooks,createdAt:h.createdAt||D,lastAccessedAt:D},accessCount:0,createdAt:D,lastAccessedAt:D,expiresAt:s?D+s:void 0};if(n.set(u,H),f(`Cached: ${u} (size: ${n.size}/${t})`),y?.onMount)y.onMount(H.instance);if(i?.onMount)i.onMount(H.instance);return H.instance}function k(u){let h=n.get(u);if(!h)return d++,f(`Miss: ${u}`),null;if(g(h))return f(`Expired: ${u}`),n.delete(u),d++,null;return c++,b(u),f(`Hit: ${u}`),h.instance}function x(u){let h=n.get(u);if(!h)return!1;if(g(h))return n.delete(u),!1;return!0}function m(u){let h=n.get(u);if(!h)return!1;f(`Removing: ${u}`);let y=h.instance.hooks;if(y?.onUnmount)y.onUnmount(h.instance);if(i?.onUnmount)i.onUnmount(h.instance);return n.delete(u)}function C(){f("Clearing cache"),n.forEach((u)=>{let h=u.instance.hooks;if(h?.onUnmount)h.onUnmount(u.instance);if(i?.onUnmount)i.onUnmount(u.instance)}),n.clear(),c=0,d=0}function T(){let u=0,h=Date.now();for(let[y,D]of n.entries())if(g(D))f(`Pruning expired: ${y}`),m(y),u++;while(n.size>t)if(w())u++;else break;if(u>0)f(`Pruned ${u} entries`);return u}function z(u){let h=k(u);if(!h)return null;f(`Activating: ${u}`);let y=h.hooks;if(y?.onActivate)y.onActivate(h);if(i?.onActivate)i.onActivate(h);if(h.state&&y?.onRestore)y.onRestore(h,h.state);return h}function ie(u){let h=n.get(u);if(!h)return!1;f(`Deactivating: ${u}`);let y=h.instance,D=y.hooks;if(D?.onSave)y.state=D.onSave(y);if(D?.onDeactivate)D.onDeactivate(y);if(i?.onDeactivate)i.onDeactivate(y);return!0}function J(){let u=c+d;return{hits:c,misses:d,size:n.size,max:t,hitRate:u>0?c/u:0,keys:Array.from(n.keys())}}function X(){return Array.from(n.keys())}function Z(){return n.size}return{cache:v,get:k,has:x,remove:m,clear:C,prune:T,activate:z,deactivate:ie,getStats:J,keys:X,size:Z}}function pp(e){let t=new Map;return{set(s,o){if(t.has(s))t.delete(s);if(t.set(s,o),t.size>e){let a=t.keys().next().value;if(a)t.delete(a)}},get(s){if(!t.has(s))return;let o=t.get(s);return t.delete(s),t.set(s,o),o},has(s){return t.has(s)},delete(s){return t.delete(s)},clear(){t.clear()},get size(){return t.size},keys(){return Array.from(t.keys())},values(){return Array.from(t.values())},forEach(s){t.forEach(s)}}}function up(){let e=new Map;return{save(t,s){e.set(t,JSON.parse(JSON.stringify(s)))},restore(t){let s=e.get(t);return s?JSON.parse(JSON.stringify(s)):null},has(t){return e.has(t)},remove(t){return e.delete(t)},clear(){e.clear()},keys(){return Array.from(e.keys())},get size(){return e.size}}}function fp(e,t={}){let{maxSize:s=100,reset:o}=t,a=[];return{acquire(){if(a.length>0)return a.pop();return e()},release(i){if(a.length<s){if(o)o(i);a.push(i)}},clear(){a.length=0},get size(){return a.length},get maxSize(){return s}}}var E=new Map;async function U(e,t){let s=t||e.toString();if(E.has(s))return E.get(s);let o=e();E.set(s,o);try{return await o}catch(a){throw E.delete(s),a}}function hp(e,t={}){let{retryAttempts:s=3,retryDelay:o=1000,onLoading:a,onLoaded:i,onError:r}=t,n="idle",c,d,f=async(p=0)=>{try{if(n==="loading"||n==="loaded"){if(c)return c}n="loading",a?.();let g=await U(e);return c=g,n="loaded",i?.(g),g}catch(g){let b=g;if(p<s)return await new Promise((w)=>setTimeout(w,o*(p+1))),f(p+1);throw n="error",d=b,r?.(b),b}};return{get state(){return n},get module(){return c},get error(){return d},load:()=>f(),preload:()=>f()}}function Fa(e,t,s={}){if(!e)return console.warn("lazyLoad: element is null"),()=>{};let{root:o=null,rootMargin:a="0px",threshold:i=0.01,placeholder:r,errorContent:n,onLoading:c,onLoaded:d,onError:f}=s,p=!1,g=null;if(r)if(typeof r==="string")e.innerHTML=r;else e.innerHTML="",e.appendChild(r);return g=new IntersectionObserver(async(w)=>{for(let v of w)if(v.isIntersecting&&!p){p=!0,g?.disconnect();try{c?.();let k=await U(t);if(d?.(k),k&&typeof k.default?.render==="function"){let x=await k.default.render();e.innerHTML=x}}catch(k){let x=k;if(f?.(x),n)if(typeof n==="string")e.innerHTML=n;else e.innerHTML="",e.appendChild(n);else e.innerHTML=`<div style="color: red;">Failed to load component: ${x.message}</div>`}}},{root:o,rootMargin:a,threshold:i}),g.observe(e),()=>{g?.disconnect(),g=null}}function gp(e,t,s={}){let o=[],a=Array.from(e);for(let i of a){let r=typeof t==="function"&&t.length>0?()=>t(i):t,n=Fa(i,r,s);o.push(n)}return()=>{o.forEach((i)=>i())}}function Ka(e){return U(e)}function xp(e){return Promise.all(e.map((t)=>Ka(t)))}function mp(e){if(e)E.delete(e);else E.clear()}function vp(){return{size:E.size,keys:Array.from(E.keys())}}function wp(e){return{async load(t){let s=e[t];if(!s)throw Error(`No route found for path: ${t}`);return U(s,`route:${t}`)},async preload(t){return this.load(t)},async preloadRoutes(t){return Promise.all(t.map((s)=>this.preload(s)))}}}function Ga(e,t,s={}){if(!e)return()=>{};let{root:o=null,rootMargin:a="50px",threshold:i=0.01,placeholder:r,onLoading:n,onLoaded:c,onError:d}=s;if(r&&typeof r==="string")e.src=r;let f=!1,p=null;return p=new IntersectionObserver((b)=>{for(let w of b)if(w.isIntersecting&&!f)f=!0,p?.disconnect(),n?.(),e.src=t,e.addEventListener("load",()=>{c?.(e),e.classList.add("loaded")},{once:!0}),e.addEventListener("error",(v)=>{let k=Error(`Failed to load image: ${t}`);d?.(k),e.classList.add("error")},{once:!0})},{root:o,rootMargin:a,threshold:i}),p.observe(e),()=>{p?.disconnect(),p=null}}function yp(e=document,t={}){let s=e.querySelectorAll("img[data-lazy-src]"),o=[];return s.forEach((a)=>{let i=a.getAttribute("data-lazy-src");if(i){let r=Ga(a,i,t);o.push(r)}}),()=>{o.forEach((a)=>a())}}var ae={colors:{primary:"#3b82f6",secondary:"#8b5cf6",success:"#10b981",warning:"#f59e0b",danger:"#ef4444",info:"#06b6d4",gray:"#6b7280",white:"#ffffff",black:"#000000"},typography:{fontFamily:{sans:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',serif:'Georgia, Cambria, "Times New Roman", Times, serif',mono:'Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},fontSize:{xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem"},fontWeight:{light:"300",normal:"400",medium:"500",semibold:"600",bold:"700"},lineHeight:{tight:"1.25",normal:"1.5",relaxed:"1.75"}},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem","2xl":"3rem","3xl":"4rem","4xl":"6rem"},borderRadius:{none:"0",sm:"0.125rem",md:"0.375rem",lg:"0.5rem",full:"9999px"},shadows:{sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",none:"none"},components:{button:{borderRadius:"0.375rem",padding:"0.5rem 1rem",fontSize:"0.875rem",fontWeight:"500"},input:{borderRadius:"0.375rem",padding:"0.5rem 0.75rem",fontSize:"0.875rem",borderWidth:"1px"},card:{borderRadius:"0.5rem",padding:"1.5rem",shadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1)"}}};function be(e,t){let s={...e};for(let o in t)if(t[o]instanceof Object&&o in e)s[o]=be(e[o],t[o]);else s[o]=t[o];return s}function j(e){return be(ae,e)}var Y=ae;function $p(){return Y}function Ua(e){let t=[];if(e.colors)Object.entries(e.colors).forEach(([s,o])=>{if(o)t.push(`--color-${s}: ${o};`)});if(e.typography?.fontFamily)Object.entries(e.typography.fontFamily).forEach(([s,o])=>{if(o)t.push(`--font-${s}: ${o};`)});if(e.typography?.fontSize)Object.entries(e.typography.fontSize).forEach(([s,o])=>{if(o)t.push(`--text-${s}: ${o};`)});if(e.typography?.fontWeight)Object.entries(e.typography.fontWeight).forEach(([s,o])=>{if(o)t.push(`--font-weight-${s}: ${o};`)});if(e.typography?.lineHeight)Object.entries(e.typography.lineHeight).forEach(([s,o])=>{if(o)t.push(`--leading-${s}: ${o};`)});if(e.spacing)Object.entries(e.spacing).forEach(([s,o])=>{if(o)t.push(`--spacing-${s}: ${o};`)});if(e.borderRadius)Object.entries(e.borderRadius).forEach(([s,o])=>{if(o)t.push(`--radius-${s}: ${o};`)});if(e.shadows)Object.entries(e.shadows).forEach(([s,o])=>{if(o)t.push(`--shadow-${s}: ${o};`)});if(e.components?.button)Object.entries(e.components.button).forEach(([s,o])=>{if(o)t.push(`--button-${s.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${o};`)});if(e.components?.input)Object.entries(e.components.input).forEach(([s,o])=>{if(o)t.push(`--input-${s.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${o};`)});if(e.components?.card)Object.entries(e.components.card).forEach(([s,o])=>{if(o)t.push(`--card-${s.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${o};`)});return`:root {
17
+ ${t.join(`
3857
18
  `)}
3858
- }`;
3859
- }
3860
- function applyTheme(theme, target) {
3861
- currentTheme = theme;
3862
- if (typeof document === "undefined")
3863
- return;
3864
- const element = target || document.documentElement;
3865
- if (theme.colors) {
3866
- Object.entries(theme.colors).forEach(([key, value]) => {
3867
- if (value)
3868
- element.style.setProperty(`--color-${key}`, value);
3869
- });
3870
- }
3871
- if (theme.typography?.fontFamily) {
3872
- Object.entries(theme.typography.fontFamily).forEach(([key, value]) => {
3873
- if (value)
3874
- element.style.setProperty(`--font-${key}`, value);
3875
- });
3876
- }
3877
- if (theme.typography?.fontSize) {
3878
- Object.entries(theme.typography.fontSize).forEach(([key, value]) => {
3879
- if (value)
3880
- element.style.setProperty(`--text-${key}`, value);
3881
- });
3882
- }
3883
- if (theme.typography?.fontWeight) {
3884
- Object.entries(theme.typography.fontWeight).forEach(([key, value]) => {
3885
- if (value)
3886
- element.style.setProperty(`--font-weight-${key}`, value);
3887
- });
3888
- }
3889
- if (theme.typography?.lineHeight) {
3890
- Object.entries(theme.typography.lineHeight).forEach(([key, value]) => {
3891
- if (value)
3892
- element.style.setProperty(`--leading-${key}`, value);
3893
- });
3894
- }
3895
- if (theme.spacing) {
3896
- Object.entries(theme.spacing).forEach(([key, value]) => {
3897
- if (value)
3898
- element.style.setProperty(`--spacing-${key}`, value);
3899
- });
3900
- }
3901
- if (theme.borderRadius) {
3902
- Object.entries(theme.borderRadius).forEach(([key, value]) => {
3903
- if (value)
3904
- element.style.setProperty(`--radius-${key}`, value);
3905
- });
3906
- }
3907
- if (theme.shadows) {
3908
- Object.entries(theme.shadows).forEach(([key, value]) => {
3909
- if (value)
3910
- element.style.setProperty(`--shadow-${key}`, value);
3911
- });
3912
- }
3913
- if (theme.components?.button) {
3914
- Object.entries(theme.components.button).forEach(([key, value]) => {
3915
- if (value)
3916
- element.style.setProperty(`--button-${key.replace(/([A-Z])/g, "-$1").toLowerCase()}`, value);
3917
- });
3918
- }
3919
- if (theme.components?.input) {
3920
- Object.entries(theme.components.input).forEach(([key, value]) => {
3921
- if (value)
3922
- element.style.setProperty(`--input-${key.replace(/([A-Z])/g, "-$1").toLowerCase()}`, value);
3923
- });
3924
- }
3925
- if (theme.components?.card) {
3926
- Object.entries(theme.components.card).forEach(([key, value]) => {
3927
- if (value)
3928
- element.style.setProperty(`--card-${key.replace(/([A-Z])/g, "-$1").toLowerCase()}`, value);
3929
- });
3930
- }
3931
- }
3932
- function useTheme() {
3933
- return currentTheme;
3934
- }
3935
- function getThemeValue(path) {
3936
- const keys = path.split(".");
3937
- let value = currentTheme;
3938
- for (const key of keys) {
3939
- if (value && typeof value === "object" && key in value) {
3940
- value = value[key];
3941
- } else {
3942
- return;
3943
- }
3944
- }
3945
- return value;
3946
- }
3947
- var themePresets = {
3948
- default: defaultTheme,
3949
- purple: createTheme({
3950
- colors: {
3951
- primary: "#8b5cf6",
3952
- secondary: "#a78bfa"
3953
- }
3954
- }),
3955
- green: createTheme({
3956
- colors: {
3957
- primary: "#10b981",
3958
- secondary: "#34d399"
3959
- }
3960
- }),
3961
- orange: createTheme({
3962
- colors: {
3963
- primary: "#f97316",
3964
- secondary: "#fb923c"
3965
- }
3966
- }),
3967
- dark: createTheme({
3968
- colors: {
3969
- primary: "#60a5fa",
3970
- secondary: "#a78bfa",
3971
- gray: "#9ca3af",
3972
- white: "#1f2937",
3973
- black: "#f9fafb"
3974
- }
3975
- }),
3976
- minimal: createTheme({
3977
- borderRadius: {
3978
- none: "0",
3979
- sm: "0",
3980
- md: "0.125rem",
3981
- lg: "0.25rem",
3982
- full: "0.25rem"
3983
- },
3984
- shadows: {
3985
- sm: "none",
3986
- md: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
3987
- lg: "0 1px 3px 0 rgba(0, 0, 0, 0.1)",
3988
- xl: "0 4px 6px -1px rgba(0, 0, 0, 0.1)",
3989
- "2xl": "0 10px 15px -3px rgba(0, 0, 0, 0.1)",
3990
- none: "none"
3991
- }
3992
- })
3993
- };
3994
- function generateThemeCSS(theme) {
3995
- return themeToCSSProperties(theme);
3996
- }
3997
- export {
3998
- wrapErrorHandler,
3999
- warnProp,
4000
- warn,
4001
- waitForAnimation,
4002
- validateVariant,
4003
- validateTextInputProps,
4004
- validateSize,
4005
- validateSearchInputProps,
4006
- validateProps,
4007
- validatePasswordInputProps,
4008
- validateNumberInputProps,
4009
- validateFormProps,
4010
- validateEmailInputProps,
4011
- validateButtonProps,
4012
- validateAriaRelationships,
4013
- useTheme,
4014
- useSEO,
4015
- usePrefersReducedMotion,
4016
- useMediaQuery,
4017
- useLocalStorage,
4018
- useKeyboard,
4019
- useIsMobile,
4020
- useIsDesktop,
4021
- useIsDarkMode,
4022
- useFocusTrap,
4023
- useDarkMode,
4024
- useCopyCode,
4025
- useClickOutside,
4026
- useBreakpoint,
4027
- themeVariableNames,
4028
- themeToCSSProperties,
4029
- themePresets,
4030
- textInputPropSchema,
4031
- tc,
4032
- t,
4033
- stxThemePreset,
4034
- storage,
4035
- staggerAnimation,
4036
- spaceTintVars,
4037
- spaceTintPayload,
4038
- spaceIndexOf,
4039
- sidebarThemes,
4040
- setTitle,
4041
- setMeta,
4042
- setLink,
4043
- setI18n,
4044
- setErrorHandler,
4045
- sequenceAnimations,
4046
- resolveSpaceTint,
4047
- resolveSidebarTheme,
4048
- resolveIconColor,
4049
- removeAnimation,
4050
- preloadModules,
4051
- preloadModule,
4052
- prefersReducedMotion,
4053
- prefersHighContrast,
4054
- pluralRules,
4055
- numberInputPropSchema,
4056
- numberFormats,
4057
- normalizeSpaces,
4058
- normalizeSpace,
4059
- n,
4060
- moveFocus,
4061
- macosColors,
4062
- loadLocaleMessages,
4063
- linear,
4064
- lazyLoadModule,
4065
- lazyLoadImages,
4066
- lazyLoadImage,
4067
- lazyLoadComponent,
4068
- lazyLoadAll,
4069
- lazyLoad,
4070
- isVisibleToScreenReader,
4071
- isRTL,
4072
- highlight,
4073
- hasFocus,
4074
- handleError,
4075
- getThemeValue,
4076
- getTheme,
4077
- getSystemTheme,
4078
- getI18n,
4079
- getHighlighter,
4080
- getFocusableElements,
4081
- getEffectiveTheme,
4082
- getColorSchemePreference,
4083
- getCacheStats,
4084
- generateThemeCSS,
4085
- generateSEOTags,
4086
- generateId,
4087
- formPropSchema,
4088
- errorBoundary,
4089
- easeOutSine,
4090
- easeOutQuint,
4091
- easeOutQuart,
4092
- easeOutQuad,
4093
- easeOutExpo,
4094
- easeOutElastic,
4095
- easeOutCubic,
4096
- easeOutCirc,
4097
- easeOutBounce,
4098
- easeOutBack,
4099
- easeInSine,
4100
- easeInQuint,
4101
- easeInQuart,
4102
- easeInQuad,
4103
- easeInOutSine,
4104
- easeInOutQuint,
4105
- easeInOutQuart,
4106
- easeInOutQuad,
4107
- easeInOutExpo,
4108
- easeInOutElastic,
4109
- easeInOutCubic,
4110
- easeInOutCirc,
4111
- easeInOutBounce,
4112
- easeInOutBack,
4113
- easeInExpo,
4114
- easeInElastic,
4115
- easeInCubic,
4116
- easeInCirc,
4117
- easeInBounce,
4118
- easeInBack,
4119
- devAssert,
4120
- detectLanguage,
4121
- deriveSpaceTint,
4122
- defaultTheme,
4123
- dateTimeFormats,
4124
- d,
4125
- cssAnimation,
4126
- createTheme,
4127
- createStorage,
4128
- createStateManager,
4129
- createSkipLink,
4130
- createScreenReaderText,
4131
- createSafeClickHandler,
4132
- createRovingTabindex,
4133
- createRouteLoader,
4134
- createPropValidator,
4135
- createLRUCache,
4136
- createKeyframes,
4137
- createKeyframeAnimation,
4138
- createKeepAlive,
4139
- createI18n,
4140
- createFocusTrap,
4141
- createDebugger,
4142
- createComponentPool,
4143
- createAriaLabel,
4144
- createAriaDescription,
4145
- copyToClipboard,
4146
- componentMessages,
4147
- clearModuleCache,
4148
- clearErrorHandler,
4149
- buttonPropSchema,
4150
- assertProp,
4151
- assert,
4152
- aria,
4153
- applyTheme,
4154
- applyHeadwindClasses,
4155
- applyAnimation,
4156
- announceToScreenReader,
4157
- animateWithClass,
4158
- animate,
4159
- VirtualTable_default as VirtualTable,
4160
- VirtualList_default as VirtualList,
4161
- Video_default as Video,
4162
- TwoFactorChallenge_default as TwoFactorChallenge,
4163
- Transition_default as Transition,
4164
- Tooltip_default as Tooltip,
4165
- Textarea_default as Textarea,
4166
- TextInput_default as TextInput,
4167
- Teleport_default as Teleport,
4168
- Tabs_default as Tabs,
4169
- TableRow_default as TableRow,
4170
- TableHeader_default as TableHeader,
4171
- TableHead_default as TableHead,
4172
- TableCell_default as TableCell,
4173
- TableBody_default as TableBody,
4174
- Table_default as Table,
4175
- TabPanel_default as TabPanel,
4176
- THEMED_FAMILIES,
4177
- Switch_default as Switch,
4178
- SubscriptionCheckout_default as SubscriptionCheckout,
4179
- StorageManager,
4180
- StepperStep_default as StepperStep,
4181
- Stepper_default as Stepper,
4182
- Spinner_default as Spinner,
4183
- Skeleton_default as Skeleton,
4184
- Signup_default as Signup,
4185
- SidebarSpaces_default as SidebarSpaces,
4186
- SidebarSpaceSwitcher_default as SidebarSpaceSwitcher,
4187
- SidebarSpace_default as SidebarSpace,
4188
- SidebarSection_default as SidebarSection,
4189
- SidebarPinned_default as SidebarPinned,
4190
- SidebarItem_default as SidebarItem,
4191
- SidebarHeader_default as SidebarHeader,
4192
- SidebarFooter_default as SidebarFooter,
4193
- Sidebar_default as Sidebar,
4194
- Select_default as Select,
4195
- SearchInput_default as SearchInput,
4196
- SHADE_VAR_PREFIX,
4197
- RadioGroupOption_default as RadioGroupOption,
4198
- RadioGroupLabel_default as RadioGroupLabel,
4199
- RadioGroupDescription_default as RadioGroupDescription,
4200
- RadioGroup_default as RadioGroup,
4201
- Radio_default as Radio,
4202
- PropTypes,
4203
- Progress_default as Progress,
4204
- Portal_default as Portal,
4205
- PopoverPanel_default as PopoverPanel,
4206
- PopoverButton_default as PopoverButton,
4207
- Popover_default as Popover,
4208
- PaymentMethods_default as PaymentMethods,
4209
- PasswordInput_default as PasswordInput,
4210
- Pagination_default as Pagination,
4211
- NumberInput_default as NumberInput,
4212
- Notification_default as Notification,
4213
- Navigator_default as Navigator,
4214
- Login_default as Login,
4215
- ListboxOptions_default as ListboxOptions,
4216
- ListboxOption_default as ListboxOption,
4217
- ListboxLabel_default as ListboxLabel,
4218
- ListboxButton_default as ListboxButton,
4219
- Listbox_default as Listbox,
4220
- KeyframeAnimations,
4221
- KeyboardShortcuts,
4222
- KeyboardKeys,
4223
- stub_3_default as Installation,
4224
- Image_default as Image,
4225
- stub_2_default as Hero,
4226
- Form_default as Form,
4227
- stub_1_default as Footer,
4228
- ErrorTypes,
4229
- EmailInput_default as EmailInput,
4230
- Easing,
4231
- DropdownItems_default as DropdownItems,
4232
- DropdownItem_default as DropdownItem,
4233
- DropdownButton_default as DropdownButton,
4234
- Dropdown_default as Dropdown,
4235
- Drawer_default as Drawer,
4236
- DialogTitle_default as DialogTitle,
4237
- DialogPanel_default as DialogPanel,
4238
- DialogDescription_default as DialogDescription,
4239
- DialogBackdrop_default as DialogBackdrop,
4240
- Dialog_default as Dialog,
4241
- DefaultPaymentMethod_default as DefaultPaymentMethod,
4242
- ComponentError,
4243
- CommandPaletteItem_default as CommandPaletteItem,
4244
- CommandPalette_default as CommandPalette,
4245
- ComboboxOptions_default as ComboboxOptions,
4246
- ComboboxOption_default as ComboboxOption,
4247
- ComboboxInput_default as ComboboxInput,
4248
- ComboboxButton_default as ComboboxButton,
4249
- Combobox_default as Combobox,
4250
- stub_0_default as CodeBlock,
4251
- Checkout_default as Checkout,
4252
- Checkbox_default as Checkbox,
4253
- Card_default as Card,
4254
- Calendar_default as Calendar,
4255
- Button_default as Button,
4256
- Breakpoints,
4257
- Breadcrumb_default as Breadcrumb,
4258
- Badge_default as Badge,
4259
- Avatar_default as Avatar,
4260
- Audio_default as Audio,
4261
- AnimationClasses,
4262
- AccordionItem_default as AccordionItem,
4263
- Accordion_default as Accordion
4264
- };
19
+ }`}function kp(e,t){if(Y=e,typeof document>"u")return;let s=t||document.documentElement;if(e.colors)Object.entries(e.colors).forEach(([o,a])=>{if(a)s.style.setProperty(`--color-${o}`,a)});if(e.typography?.fontFamily)Object.entries(e.typography.fontFamily).forEach(([o,a])=>{if(a)s.style.setProperty(`--font-${o}`,a)});if(e.typography?.fontSize)Object.entries(e.typography.fontSize).forEach(([o,a])=>{if(a)s.style.setProperty(`--text-${o}`,a)});if(e.typography?.fontWeight)Object.entries(e.typography.fontWeight).forEach(([o,a])=>{if(a)s.style.setProperty(`--font-weight-${o}`,a)});if(e.typography?.lineHeight)Object.entries(e.typography.lineHeight).forEach(([o,a])=>{if(a)s.style.setProperty(`--leading-${o}`,a)});if(e.spacing)Object.entries(e.spacing).forEach(([o,a])=>{if(a)s.style.setProperty(`--spacing-${o}`,a)});if(e.borderRadius)Object.entries(e.borderRadius).forEach(([o,a])=>{if(a)s.style.setProperty(`--radius-${o}`,a)});if(e.shadows)Object.entries(e.shadows).forEach(([o,a])=>{if(a)s.style.setProperty(`--shadow-${o}`,a)});if(e.components?.button)Object.entries(e.components.button).forEach(([o,a])=>{if(a)s.style.setProperty(`--button-${o.replace(/([A-Z])/g,"-$1").toLowerCase()}`,a)});if(e.components?.input)Object.entries(e.components.input).forEach(([o,a])=>{if(a)s.style.setProperty(`--input-${o.replace(/([A-Z])/g,"-$1").toLowerCase()}`,a)});if(e.components?.card)Object.entries(e.components.card).forEach(([o,a])=>{if(a)s.style.setProperty(`--card-${o.replace(/([A-Z])/g,"-$1").toLowerCase()}`,a)})}function Sp(){return Y}function Ip(e){let t=e.split("."),s=Y;for(let o of t)if(s&&typeof s==="object"&&o in s)s=s[o];else return;return s}var Np={default:ae,purple:j({colors:{primary:"#8b5cf6",secondary:"#a78bfa"}}),green:j({colors:{primary:"#10b981",secondary:"#34d399"}}),orange:j({colors:{primary:"#f97316",secondary:"#fb923c"}}),dark:j({colors:{primary:"#60a5fa",secondary:"#a78bfa",gray:"#9ca3af",white:"#1f2937",black:"#f9fafb"}}),minimal:j({borderRadius:{none:"0",sm:"0",md:"0.125rem",lg:"0.25rem",full:"0.25rem"},shadows:{sm:"none",md:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",lg:"0 1px 3px 0 rgba(0, 0, 0, 0.1)",xl:"0 4px 6px -1px rgba(0, 0, 0, 0.1)","2xl":"0 10px 15px -3px rgba(0, 0, 0, 0.1)",none:"none"}})};function Tp(e){return Ua(e)}export{ne as wrapErrorHandler,ir as warnProp,We as warn,Ba as waitForAnimation,ur as validateVariant,Sn as validateTextInputProps,fr as validateSize,Dn as validateSearchInputProps,Fe as validateProps,Nn as validatePasswordInputProps,Tn as validateNumberInputProps,fn as validateFormProps,In as validateEmailInputProps,dr as validateButtonProps,zd as validateAriaRelationships,Sp as useTheme,ai as useSEO,wi as usePrefersReducedMotion,R as useMediaQuery,bi as useLocalStorage,pi as useKeyboard,xi as useIsMobile,mi as useIsDesktop,vi as useIsDarkMode,ci as useFocusTrap,si as useDarkMode,Qa as useCopyCode,ni as useClickOutside,gi as useBreakpoint,ki as themeVariableNames,Ua as themeToCSSProperties,Np as themePresets,Xt as textInputPropSchema,ep as tc,Qd as t,$i as stxThemePreset,Ic as storage,Rd as staggerAnimation,wo as spaceTintVars,ec as spaceTintPayload,Ql as spaceIndexOf,le as sidebarThemes,we as setTitle,S as setMeta,ye as setLink,Xd as setI18n,Xi as setErrorHandler,qd as sequenceAnimations,vo as resolveSpaceTint,Ul as resolveSidebarTheme,Yl as resolveIconColor,Md as removeAnimation,xp as preloadModules,Ka as preloadModule,Td as prefersReducedMotion,Dd as prefersHighContrast,op as pluralRules,Zt as numberInputPropSchema,ip as numberFormats,Zl as normalizeSpaces,yo as normalizeSpace,sp as n,kd as moveFocus,F as macosColors,np as loadLocaleMessages,ca as linear,U as lazyLoadModule,yp as lazyLoadImages,Ga as lazyLoadImage,hp as lazyLoadComponent,gp as lazyLoadAll,Fa as lazyLoad,Sd as isVisibleToScreenReader,rp as isRTL,Kd as highlight,$d as hasFocus,W as handleError,Ip as getThemeValue,$p as getTheme,ve as getSystemTheme,Zd as getI18n,Wa as getHighlighter,ee as getFocusableElements,Q as getEffectiveTheme,Ad as getColorSchemePreference,vp as getCacheStats,Tp as generateThemeCSS,ii as generateSEOTags,pe as generateId,Rt as formPropSchema,tr as errorBoundary,$a as easeOutSine,wa as easeOutQuint,xa as easeOutQuart,pa as easeOutQuad,Ia as easeOutExpo,za as easeOutElastic,ba as easeOutCubic,Da as easeOutCirc,te as easeOutBounce,Oa as easeOutBack,Ca as easeInSine,va as easeInQuint,ga as easeInQuart,da as easeInQuad,ka as easeInOutSine,ya as easeInOutQuint,ma as easeInOutQuart,ua as easeInOutQuad,Na as easeInOutExpo,Pa as easeInOutElastic,ha as easeInOutCubic,Aa as easeInOutCirc,Ra as easeInOutBounce,Ma as easeInOutBack,Sa as easeInExpo,La as easeInElastic,fa as easeInCubic,Ta as easeInCirc,ue as easeInBounce,Ea as easeInBack,Qi as devAssert,Gd as detectLanguage,ce as deriveSpaceTint,ae as defaultTheme,ap as dateTimeFormats,tp as d,qa as cssAnimation,j as createTheme,Nc as createStorage,up as createStateManager,Ld as createSkipLink,Nd as createScreenReaderText,pr as createSafeClickHandler,yd as createRovingTabindex,wp as createRouteLoader,A as createPropValidator,pp as createLRUCache,Hd as createKeyframes,ja as createKeyframeAnimation,dp as createKeepAlive,Jd as createI18n,wd as createFocusTrap,er as createDebugger,fp as createComponentPool,xd as createAriaLabel,md as createAriaDescription,ei as copyToClipboard,lp as componentMessages,mp as clearModuleCache,Zi as clearErrorHandler,Ue as buttonPropSchema,ar as assertProp,Ve as assert,Id as aria,kp as applyTheme,Ud as applyHeadwindClasses,fe as applyAnimation,vd as announceToScreenReader,jd as animateWithClass,Wd as animate,na as VirtualTable,ia as VirtualList,oa as Video,Ee as TwoFactorChallenge,ta as Transition,Qo as Tooltip,Xo as Textarea,Yt as TextInput,Yo as Teleport,Go as Tabs,Wo as TableRow,Ho as TableHeader,Bo as TableHead,Ro as TableCell,Oo as TableBody,Po as Table,Fo as TabPanel,re as THEMED_FAMILIES,Lo as Switch,ks as SubscriptionCheckout,K as StorageManager,Do as StepperStep,No as Stepper,So as Spinner,$o as Skeleton,ze as Signup,lo as SidebarSpaces,po as SidebarSpaceSwitcher,ro as SidebarSpace,ao as SidebarSection,so as SidebarPinned,eo as SidebarItem,Zs as SidebarHeader,Js as SidebarFooter,Us as Sidebar,Ks as Select,Gt as SearchInput,Ci as SHADE_VAR_PREFIX,_s as RadioGroupOption,Vs as RadioGroupLabel,js as RadioGroupDescription,qs as RadioGroup,Ms as Radio,l as PropTypes,Es as Progress,zs as Portal,As as PopoverPanel,Ts as PopoverButton,Is as Popover,Cs as PaymentMethods,Ft as PasswordInput,gs as Pagination,Wt as NumberInput,bs as Notification,us as Navigator,Ae as Login,ds as ListboxOptions,ls as ListboxOption,rs as ListboxLabel,as as ListboxButton,ss as Listbox,Ha as KeyframeAnimations,ui as KeyboardShortcuts,Cd as KeyboardKeys,me as Installation,Bt as Image,xe as Hero,Mt as Form,ge as Footer,M as ErrorTypes,Ht as EmailInput,Ed as Easing,Et as DropdownItems,zt as DropdownItem,At as DropdownButton,Tt as Dropdown,It as Drawer,kt as DialogTitle,Ct as DialogPanel,wt as DialogDescription,mt as DialogBackdrop,gt as Dialog,ws as DefaultPaymentMethod,N as ComponentError,bt as CommandPaletteItem,ut as CommandPalette,dt as ComboboxOptions,lt as ComboboxOption,rt as ComboboxInput,at as ComboboxButton,st as Combobox,he as CodeBlock,ms as Checkout,et as Checkbox,Ze as Card,Je as Calendar,Ge as Button,q as Breakpoints,je as Breadcrumb,qe as Badge,Me as Avatar,Te as Audio,Bd as AnimationClasses,Ie as AccordionItem,ke as Accordion};