@yenio-pld/blocks 1.2.0-rc.2 → 1.2.0-rc.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var react = require('react');
4
+ var React = require('react');
5
5
  var skeleton_js = require('./ui/skeleton.js');
6
6
  var jsxRuntime = require('react/jsx-runtime');
7
7
  var lucideReact = require('lucide-react');
@@ -11,7 +11,6 @@ var avatar_js = require('./ui/avatar.js');
11
11
  var button_js = require('./ui/button.js');
12
12
  var dropdownMenu_js = require('./ui/dropdown-menu.js');
13
13
  var empty_js = require('./ui/empty.js');
14
- var nextThemes = require('next-themes');
15
14
  var separator_js = require('./ui/separator.js');
16
15
  var sidebar_js = require('./ui/sidebar.js');
17
16
  var table_js = require('./ui/table.js');
@@ -19,15 +18,37 @@ var tooltip_js = require('./ui/tooltip.js');
19
18
  var card_js = require('./ui/card.js');
20
19
  var classVarianceAuthority = require('class-variance-authority');
21
20
  var alertDialog_js = require('./ui/alert-dialog.js');
21
+ var nextThemes = require('next-themes');
22
+ var combobox_js = require('./ui/combobox.js');
22
23
  var slider_js = require('./ui/slider.js');
23
24
  var toggle_js = require('./ui/toggle.js');
24
25
  var dialog_js = require('./ui/dialog.js');
25
26
  var drawer_js = require('./ui/drawer.js');
26
27
  var framerMotion = require('framer-motion');
27
28
 
28
- var LanguageContext = react.createContext(null);
29
+ function _interopNamespace(e) {
30
+ if (e && e.__esModule) return e;
31
+ var n = Object.create(null);
32
+ if (e) {
33
+ Object.keys(e).forEach(function (k) {
34
+ if (k !== 'default') {
35
+ var d = Object.getOwnPropertyDescriptor(e, k);
36
+ Object.defineProperty(n, k, d.get ? d : {
37
+ enumerable: true,
38
+ get: function () { return e[k]; }
39
+ });
40
+ }
41
+ });
42
+ }
43
+ n.default = e;
44
+ return Object.freeze(n);
45
+ }
46
+
47
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
48
+
49
+ var LanguageContext = React.createContext(null);
29
50
  function useLanguageContext() {
30
- return react.useContext(LanguageContext);
51
+ return React.useContext(LanguageContext);
31
52
  }
32
53
  function PageTitle({
33
54
  title,
@@ -246,206 +267,6 @@ function EmptyState({
246
267
  }
247
268
  );
248
269
  }
249
- var defaultLanguages = [
250
- { key: "es-MX", label: "ES", nativeName: "Espa\xF1ol (M\xE9xico)" },
251
- { key: "en", label: "EN", nativeName: "English" }
252
- ];
253
- var sizeClasses = {
254
- sm: { button: "size-8", icon: "size-4" },
255
- md: { button: "size-8", icon: "size-4" },
256
- lg: { button: "size-9", icon: "size-4" }
257
- };
258
- var shapeClasses = {
259
- rounded: "rounded-md",
260
- squared: "rounded-sm",
261
- pill: "rounded-full"
262
- };
263
- var iconTriggerClassName = "border border-border bg-transparent text-muted-foreground shadow-none hover:bg-accent hover:text-foreground dark:border-border dark:bg-transparent dark:text-muted-foreground dark:hover:bg-accent/50";
264
- function LanguageSwitcher({
265
- languages: propLanguages,
266
- currentLanguage: propCurrentLanguage,
267
- onLanguageChange: propOnLanguageChange,
268
- labels = {},
269
- className,
270
- size = "sm",
271
- shape = "rounded",
272
- align = "end",
273
- side = "bottom"
274
- }) {
275
- const context = useLanguageContext();
276
- const contextLanguages = context?.languages?.map((lang) => ({
277
- key: lang.code,
278
- label: lang.code.toUpperCase(),
279
- nativeName: lang.name
280
- }));
281
- const languages = propLanguages ?? contextLanguages ?? defaultLanguages;
282
- const currentLanguage = propCurrentLanguage ?? context?.language ?? "en";
283
- const onLanguageChange = propOnLanguageChange ?? context?.setLanguage;
284
- const sizes = sizeClasses[size];
285
- const shapeClass = shapeClasses[shape];
286
- const accessibleName = labels.language ?? "Language";
287
- return /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu_js.DropdownMenu, { children: [
288
- /* @__PURE__ */ jsxRuntime.jsx(
289
- dropdownMenu_js.DropdownMenuTrigger,
290
- {
291
- render: /* @__PURE__ */ jsxRuntime.jsx(
292
- button_js.Button,
293
- {
294
- variant: "outline",
295
- size: "icon",
296
- "aria-label": accessibleName,
297
- className: cn(
298
- sizes.button,
299
- shapeClass,
300
- iconTriggerClassName,
301
- className
302
- )
303
- }
304
- ),
305
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Languages, { className: sizes.icon })
306
- }
307
- ),
308
- /* @__PURE__ */ jsxRuntime.jsx(
309
- dropdownMenu_js.DropdownMenuContent,
310
- {
311
- side,
312
- align,
313
- sideOffset: dropdownMenu_js.miniMenuContentDefaults.sideOffset,
314
- collisionPadding: dropdownMenu_js.miniMenuContentDefaults.collisionPadding,
315
- className: cn(dropdownMenu_js.miniMenuContentClassName, "min-w-0 w-auto"),
316
- children: languages.map(({ key, nativeName }) => /* @__PURE__ */ jsxRuntime.jsx(
317
- dropdownMenu_js.DropdownMenuItem,
318
- {
319
- onClick: () => onLanguageChange?.(key),
320
- className: cn(
321
- "justify-center text-xs font-semibold cursor-pointer px-3",
322
- currentLanguage === key && "bg-accent text-accent-foreground"
323
- ),
324
- children: nativeName
325
- },
326
- key
327
- ))
328
- }
329
- )
330
- ] });
331
- }
332
- var defaultLabels = {
333
- theme: "Theme",
334
- system: "System",
335
- light: "Light",
336
- dark: "Dark"
337
- };
338
- var sizeClasses2 = {
339
- sm: { button: "size-8", icon: "size-4" },
340
- md: { button: "size-8", icon: "size-4" },
341
- lg: { button: "size-9", icon: "size-4" }
342
- };
343
- var shapeClasses2 = {
344
- rounded: "rounded-md",
345
- pill: "rounded-full"
346
- };
347
- var iconTriggerClassName2 = "border border-border bg-transparent text-muted-foreground shadow-none hover:bg-accent hover:text-foreground dark:border-border dark:bg-transparent dark:text-muted-foreground dark:hover:bg-accent/50";
348
- var themeIcons = {
349
- system: lucideReact.Monitor,
350
- light: lucideReact.Sun,
351
- dark: lucideReact.Moon
352
- };
353
- var themes = [
354
- { key: "system", icon: themeIcons.system },
355
- { key: "light", icon: themeIcons.light },
356
- { key: "dark", icon: themeIcons.dark }
357
- ];
358
- function storedTheme(value) {
359
- if (value === "system" || value === "light" || value === "dark") return value;
360
- return void 0;
361
- }
362
- function ThemeSwitcher({
363
- className,
364
- size = "sm",
365
- shape = "rounded",
366
- align = "end",
367
- side = "bottom",
368
- labels: userLabels
369
- }) {
370
- const { theme, setTheme } = nextThemes.useTheme();
371
- const [mounted, setMounted] = react.useState(false);
372
- const sizes = sizeClasses2[size];
373
- const shapeClass = shapeClasses2[shape];
374
- const labels = { ...defaultLabels, ...userLabels };
375
- const handleThemeClick = react.useCallback(
376
- (themeKey) => {
377
- setTheme(themeKey);
378
- },
379
- [setTheme]
380
- );
381
- react.useEffect(() => {
382
- setMounted(true);
383
- }, []);
384
- if (!mounted) {
385
- return /* @__PURE__ */ jsxRuntime.jsx(
386
- "div",
387
- {
388
- "aria-hidden": true,
389
- className: cn(
390
- sizes.button,
391
- shapeClass,
392
- iconTriggerClassName2,
393
- className
394
- )
395
- }
396
- );
397
- }
398
- const currentTheme = storedTheme(theme);
399
- const TriggerIcon = currentTheme ? themeIcons[currentTheme] : lucideReact.Monitor;
400
- return /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu_js.DropdownMenu, { children: [
401
- /* @__PURE__ */ jsxRuntime.jsx(
402
- dropdownMenu_js.DropdownMenuTrigger,
403
- {
404
- render: /* @__PURE__ */ jsxRuntime.jsx(
405
- button_js.Button,
406
- {
407
- "data-testid": "theme-switcher",
408
- variant: "outline",
409
- size: "icon",
410
- "aria-label": labels.theme,
411
- className: cn(
412
- sizes.button,
413
- shapeClass,
414
- iconTriggerClassName2,
415
- className
416
- )
417
- }
418
- ),
419
- children: /* @__PURE__ */ jsxRuntime.jsx(TriggerIcon, { className: sizes.icon })
420
- }
421
- ),
422
- /* @__PURE__ */ jsxRuntime.jsx(
423
- dropdownMenu_js.DropdownMenuContent,
424
- {
425
- side,
426
- align,
427
- sideOffset: dropdownMenu_js.miniMenuContentDefaults.sideOffset,
428
- collisionPadding: dropdownMenu_js.miniMenuContentDefaults.collisionPadding,
429
- className: dropdownMenu_js.miniMenuContentClassName,
430
- children: themes.map(({ key, icon: Icon }) => /* @__PURE__ */ jsxRuntime.jsxs(
431
- dropdownMenu_js.DropdownMenuItem,
432
- {
433
- onClick: () => handleThemeClick(key),
434
- className: cn(
435
- "gap-2 cursor-pointer",
436
- currentTheme === key && "bg-accent text-accent-foreground [&_svg]:text-accent-foreground"
437
- ),
438
- children: [
439
- /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "size-4" }),
440
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: labels[key] })
441
- ]
442
- },
443
- key
444
- ))
445
- }
446
- )
447
- ] });
448
- }
449
270
  var DATA_TABLE_ROW_CLASS = "h-14";
450
271
  function renderShellLink({
451
272
  href,
@@ -457,8 +278,8 @@ function renderShellLink({
457
278
  }
458
279
  function DismissMobileSidebar({ pathname }) {
459
280
  const { setOpenMobile } = sidebar_js.useSidebar();
460
- const previous = react.useRef(pathname);
461
- react.useEffect(() => {
281
+ const previous = React.useRef(pathname);
282
+ React.useEffect(() => {
462
283
  if (previous.current === pathname) return;
463
284
  previous.current = pathname;
464
285
  setOpenMobile(false);
@@ -576,42 +397,47 @@ function NavTabs({
576
397
  "aria-current": active ? "page" : void 0,
577
398
  children: tab.label
578
399
  });
579
- return react.cloneElement(link, { key: tab.href });
400
+ return React.cloneElement(link, { key: tab.href });
580
401
  })
581
402
  }
582
403
  );
583
404
  }
584
405
  var accountMenuDefaults = {
585
406
  menu: "Account menu",
586
- signOut: "Sign out",
587
- theme: "Theme",
588
- language: "Language",
589
- system: "System",
590
- light: "Light",
591
- dark: "Dark"
407
+ account: "Account",
408
+ signOut: "Sign out"
592
409
  };
410
+ function AccountAvatar({
411
+ name,
412
+ imageSrc,
413
+ imageAlt
414
+ }) {
415
+ return /* @__PURE__ */ jsxRuntime.jsxs(avatar_js.Avatar, { className: "size-8", children: [
416
+ imageSrc ? /* @__PURE__ */ jsxRuntime.jsx(
417
+ avatar_js.AvatarImage,
418
+ {
419
+ src: imageSrc,
420
+ alt: imageAlt,
421
+ width: 32,
422
+ height: 32,
423
+ keepMounted: true
424
+ }
425
+ ) : null,
426
+ /* @__PURE__ */ jsxRuntime.jsx(avatar_js.AvatarFallback, { style: avatarFallbackStyle(name), children: getInitials(name) })
427
+ ] });
428
+ }
593
429
  function AccountMenu({
594
430
  name,
595
431
  email,
596
- organization,
597
432
  imageSrc,
598
433
  imageAlt = "",
599
434
  labels: userLabels,
600
- languages,
601
- currentLanguage,
602
- onLanguageChange,
435
+ onAccount,
603
436
  onSignOut
604
437
  }) {
605
438
  const labels = { ...accountMenuDefaults, ...userLabels };
606
439
  const { isMobile } = sidebar_js.useSidebar();
607
440
  const side = isMobile ? "bottom" : "right";
608
- const themeLabels = {
609
- theme: labels.theme,
610
- system: labels.system,
611
- light: labels.light,
612
- dark: labels.dark
613
- };
614
- const languageLabels = { language: labels.language };
615
441
  return /* @__PURE__ */ jsxRuntime.jsx(sidebar_js.SidebarMenu, { children: /* @__PURE__ */ jsxRuntime.jsx(sidebar_js.SidebarMenuItem, { children: /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu_js.DropdownMenu, { children: [
616
442
  /* @__PURE__ */ jsxRuntime.jsxs(
617
443
  dropdownMenu_js.DropdownMenuTrigger,
@@ -625,23 +451,17 @@ function AccountMenu({
625
451
  }
626
452
  ),
627
453
  children: [
628
- /* @__PURE__ */ jsxRuntime.jsxs(avatar_js.Avatar, { className: "size-8", children: [
629
- imageSrc ? /* @__PURE__ */ jsxRuntime.jsx(
630
- avatar_js.AvatarImage,
631
- {
632
- src: imageSrc,
633
- alt: imageAlt,
634
- width: 32,
635
- height: 32,
636
- keepMounted: true
637
- }
638
- ) : null,
639
- /* @__PURE__ */ jsxRuntime.jsx(avatar_js.AvatarFallback, { style: avatarFallbackStyle(name), children: getInitials(name) })
640
- ] }),
454
+ /* @__PURE__ */ jsxRuntime.jsx(
455
+ AccountAvatar,
456
+ {
457
+ name,
458
+ imageSrc,
459
+ imageAlt
460
+ }
461
+ ),
641
462
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "grid min-w-0 flex-1 text-left text-sm leading-tight group-data-[collapsible=icon]:hidden", children: [
642
463
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate font-medium", children: name }),
643
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-xs text-muted-foreground", children: email }),
644
- organization ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-xs text-muted-foreground", children: organization }) : null
464
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-xs text-muted-foreground", children: email })
645
465
  ] }),
646
466
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsUpDown, { className: "ml-auto size-4 group-data-[collapsible=icon]:hidden" })
647
467
  ]
@@ -654,27 +474,25 @@ function AccountMenu({
654
474
  align: "end",
655
475
  className: "w-56 min-w-56",
656
476
  children: [
657
- /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu_js.DropdownMenuLabel, { className: "font-normal", children: [
658
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate font-medium", children: name }),
659
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate text-xs text-muted-foreground", children: email }),
660
- organization ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate text-xs text-muted-foreground", children: organization }) : null
661
- ] }),
662
- /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu_js.DropdownMenuSeparator, {}),
663
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-end gap-1 px-1.5 py-1", children: [
664
- /* @__PURE__ */ jsxRuntime.jsx(ThemeSwitcher, { labels: themeLabels, side, align: "end" }),
477
+ /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu_js.DropdownMenuLabel, { className: "p-0 font-normal", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 px-1 py-1.5 text-left text-sm", children: [
665
478
  /* @__PURE__ */ jsxRuntime.jsx(
666
- LanguageSwitcher,
479
+ AccountAvatar,
667
480
  {
668
- labels: languageLabels,
669
- languages,
670
- currentLanguage,
671
- onLanguageChange,
672
- side,
673
- align: "end"
481
+ name,
482
+ imageSrc,
483
+ imageAlt
674
484
  }
675
- )
676
- ] }),
485
+ ),
486
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "grid min-w-0 flex-1 text-sm leading-tight", children: [
487
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate font-medium", children: name }),
488
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-xs text-muted-foreground", children: email })
489
+ ] })
490
+ ] }) }),
677
491
  /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu_js.DropdownMenuSeparator, {}),
492
+ onAccount ? /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu_js.DropdownMenuItem, { onClick: onAccount, children: [
493
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserRound, {}),
494
+ labels.account
495
+ ] }) : null,
678
496
  /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu_js.DropdownMenuItem, { onClick: onSignOut, children: [
679
497
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LogOut, {}),
680
498
  labels.signOut
@@ -885,15 +703,15 @@ function NavigationProgress({
885
703
  ariaLabel = "Loading",
886
704
  forceVisible = false
887
705
  }) {
888
- const [visible, setVisible] = react.useState(forceVisible);
889
- const [runId, setRunId] = react.useState(0);
890
- const startedAt = react.useRef(0);
891
- const startedRoute = react.useRef(null);
892
- const committedRoute = react.useRef(null);
893
- react.useEffect(() => {
706
+ const [visible, setVisible] = React.useState(forceVisible);
707
+ const [runId, setRunId] = React.useState(0);
708
+ const startedAt = React.useRef(0);
709
+ const startedRoute = React.useRef(null);
710
+ const committedRoute = React.useRef(null);
711
+ React.useEffect(() => {
894
712
  committedRoute.current = routeKey(pathname, search);
895
713
  }, [pathname, search]);
896
- react.useEffect(() => {
714
+ React.useEffect(() => {
897
715
  if (forceVisible) return;
898
716
  function begin(route) {
899
717
  if (navigationSuppressed) return;
@@ -930,12 +748,12 @@ function NavigationProgress({
930
748
  window.removeEventListener("popstate", onPopState);
931
749
  };
932
750
  }, [forceVisible, pathname, search]);
933
- react.useEffect(() => {
751
+ React.useEffect(() => {
934
752
  if (forceVisible || !visible) return;
935
753
  const safety = window.setTimeout(() => setVisible(false), SAFETY_MS);
936
754
  return () => window.clearTimeout(safety);
937
755
  }, [forceVisible, runId, visible]);
938
- react.useEffect(() => {
756
+ React.useEffect(() => {
939
757
  if (forceVisible || !visible) return;
940
758
  const started = startedRoute.current;
941
759
  if (!started) return;
@@ -1355,20 +1173,20 @@ function useEditableSection({
1355
1173
  ...DEFAULT_EDITABLE_SECTION_LABELS,
1356
1174
  ...labels
1357
1175
  };
1358
- const [mode, setMode] = react.useState("reading");
1359
- const [status, setStatus] = react.useState(null);
1360
- const [confirmOpen, setConfirmOpen] = react.useState(false);
1361
- const [minHeightPx, setMinHeightPx] = react.useState(void 0);
1362
- const contentRef = react.useRef(null);
1363
- const editButtonRef = react.useRef(null);
1364
- const measuredHeightRef = react.useRef(0);
1365
- const shouldFocusEditRef = react.useRef(false);
1366
- const shouldFocusFirstFieldRef = react.useRef(false);
1367
- const editButtonId = react.useId();
1368
- const contentFormId = react.useId();
1176
+ const [mode, setMode] = React.useState("reading");
1177
+ const [status, setStatus] = React.useState(null);
1178
+ const [confirmOpen, setConfirmOpen] = React.useState(false);
1179
+ const [minHeightPx, setMinHeightPx] = React.useState(void 0);
1180
+ const contentRef = React.useRef(null);
1181
+ const editButtonRef = React.useRef(null);
1182
+ const measuredHeightRef = React.useRef(0);
1183
+ const shouldFocusEditRef = React.useRef(false);
1184
+ const shouldFocusFirstFieldRef = React.useRef(false);
1185
+ const editButtonId = React.useId();
1186
+ const contentFormId = React.useId();
1369
1187
  const isEditing = mode === "editing" || mode === "saving";
1370
1188
  const isSaving = mode === "saving";
1371
- react.useEffect(() => {
1189
+ React.useEffect(() => {
1372
1190
  if (mode === "reading" && shouldFocusEditRef.current) {
1373
1191
  shouldFocusEditRef.current = false;
1374
1192
  editButtonRef.current?.focus();
@@ -1386,18 +1204,18 @@ function useEditableSection({
1386
1204
  focusFirstField(contentRef.current);
1387
1205
  }
1388
1206
  }, [mode]);
1389
- const exitToReading = react.useCallback(() => {
1207
+ const exitToReading = React.useCallback(() => {
1390
1208
  setConfirmOpen(false);
1391
1209
  shouldFocusEditRef.current = true;
1392
1210
  setMode("reading");
1393
1211
  onDiscard?.();
1394
1212
  }, [onDiscard]);
1395
- const startEdit = react.useCallback(() => {
1213
+ const startEdit = React.useCallback(() => {
1396
1214
  setStatus(null);
1397
1215
  shouldFocusFirstFieldRef.current = true;
1398
1216
  setMode("editing");
1399
1217
  }, []);
1400
- const requestCancel = react.useCallback(() => {
1218
+ const requestCancel = React.useCallback(() => {
1401
1219
  if (isSaving) return;
1402
1220
  if (isDirty) {
1403
1221
  setConfirmOpen(true);
@@ -1405,7 +1223,7 @@ function useEditableSection({
1405
1223
  }
1406
1224
  exitToReading();
1407
1225
  }, [exitToReading, isDirty, isSaving]);
1408
- const handleSubmit = react.useCallback(
1226
+ const handleSubmit = React.useCallback(
1409
1227
  (event) => {
1410
1228
  event.preventDefault();
1411
1229
  if (isSaving) return;
@@ -1425,7 +1243,7 @@ function useEditableSection({
1425
1243
  },
1426
1244
  [isSaving, onSave, resolvedLabels.saved]
1427
1245
  );
1428
- const handleFormKeyDown = react.useCallback(
1246
+ const handleFormKeyDown = React.useCallback(
1429
1247
  (event) => {
1430
1248
  if (event.key !== "Escape") return;
1431
1249
  event.preventDefault();
@@ -1433,7 +1251,7 @@ function useEditableSection({
1433
1251
  },
1434
1252
  [requestCancel]
1435
1253
  );
1436
- react.useEffect(() => {
1254
+ React.useEffect(() => {
1437
1255
  if (!stableHeight || !isEditing) return;
1438
1256
  const el = contentRef.current;
1439
1257
  if (!el) return;
@@ -1672,13 +1490,13 @@ function SafeImage({
1672
1490
  onError,
1673
1491
  ...imgProps
1674
1492
  }) {
1675
- const [failed, setFailed] = react.useState(false);
1676
- const imgRef = react.useRef(null);
1493
+ const [failed, setFailed] = React.useState(false);
1494
+ const imgRef = React.useRef(null);
1677
1495
  const resolvedSrc = typeof src === "string" && src.length > 0 ? src : null;
1678
- react.useLayoutEffect(() => {
1496
+ React.useLayoutEffect(() => {
1679
1497
  setFailed(false);
1680
1498
  }, [resolvedSrc]);
1681
- react.useLayoutEffect(() => {
1499
+ React.useLayoutEffect(() => {
1682
1500
  const img = imgRef.current;
1683
1501
  if (img && isBrokenImage(img)) {
1684
1502
  setFailed(true);
@@ -1701,6 +1519,1397 @@ function SafeImage({
1701
1519
  }
1702
1520
  );
1703
1521
  }
1522
+ var defaultLabels = {
1523
+ theme: "Theme",
1524
+ system: "System",
1525
+ light: "Light",
1526
+ dark: "Dark"
1527
+ };
1528
+ var sizeClasses = {
1529
+ sm: { button: "size-8", icon: "size-4" },
1530
+ md: { button: "size-8", icon: "size-4" },
1531
+ lg: { button: "size-9", icon: "size-4" }
1532
+ };
1533
+ var shapeClasses = {
1534
+ rounded: "rounded-md",
1535
+ pill: "rounded-full"
1536
+ };
1537
+ var iconTriggerClassName = "border border-border bg-transparent text-muted-foreground shadow-none hover:bg-accent hover:text-foreground dark:border-border dark:bg-transparent dark:text-muted-foreground dark:hover:bg-accent/50";
1538
+ var themeIcons = {
1539
+ system: lucideReact.Monitor,
1540
+ light: lucideReact.Sun,
1541
+ dark: lucideReact.Moon
1542
+ };
1543
+ var themes = [
1544
+ { key: "system", icon: themeIcons.system },
1545
+ { key: "light", icon: themeIcons.light },
1546
+ { key: "dark", icon: themeIcons.dark }
1547
+ ];
1548
+ function storedTheme(value) {
1549
+ if (value === "system" || value === "light" || value === "dark") return value;
1550
+ return void 0;
1551
+ }
1552
+ function ThemeSwitcher({
1553
+ className,
1554
+ size = "sm",
1555
+ shape = "rounded",
1556
+ align = "end",
1557
+ side = "bottom",
1558
+ labels: userLabels
1559
+ }) {
1560
+ const { theme, setTheme } = nextThemes.useTheme();
1561
+ const [mounted, setMounted] = React.useState(false);
1562
+ const sizes = sizeClasses[size];
1563
+ const shapeClass = shapeClasses[shape];
1564
+ const labels = { ...defaultLabels, ...userLabels };
1565
+ const handleThemeClick = React.useCallback(
1566
+ (themeKey) => {
1567
+ setTheme(themeKey);
1568
+ },
1569
+ [setTheme]
1570
+ );
1571
+ React.useEffect(() => {
1572
+ setMounted(true);
1573
+ }, []);
1574
+ if (!mounted) {
1575
+ return /* @__PURE__ */ jsxRuntime.jsx(
1576
+ "div",
1577
+ {
1578
+ "aria-hidden": true,
1579
+ className: cn(
1580
+ sizes.button,
1581
+ shapeClass,
1582
+ iconTriggerClassName,
1583
+ className
1584
+ )
1585
+ }
1586
+ );
1587
+ }
1588
+ const currentTheme = storedTheme(theme);
1589
+ const TriggerIcon = currentTheme ? themeIcons[currentTheme] : lucideReact.Monitor;
1590
+ return /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu_js.DropdownMenu, { children: [
1591
+ /* @__PURE__ */ jsxRuntime.jsx(
1592
+ dropdownMenu_js.DropdownMenuTrigger,
1593
+ {
1594
+ render: /* @__PURE__ */ jsxRuntime.jsx(
1595
+ button_js.Button,
1596
+ {
1597
+ "data-testid": "theme-switcher",
1598
+ variant: "outline",
1599
+ size: "icon",
1600
+ "aria-label": labels.theme,
1601
+ className: cn(
1602
+ sizes.button,
1603
+ shapeClass,
1604
+ iconTriggerClassName,
1605
+ className
1606
+ )
1607
+ }
1608
+ ),
1609
+ children: /* @__PURE__ */ jsxRuntime.jsx(TriggerIcon, { className: sizes.icon })
1610
+ }
1611
+ ),
1612
+ /* @__PURE__ */ jsxRuntime.jsx(
1613
+ dropdownMenu_js.DropdownMenuContent,
1614
+ {
1615
+ side,
1616
+ align,
1617
+ sideOffset: dropdownMenu_js.miniMenuContentDefaults.sideOffset,
1618
+ collisionPadding: dropdownMenu_js.miniMenuContentDefaults.collisionPadding,
1619
+ className: dropdownMenu_js.miniMenuContentClassName,
1620
+ children: themes.map(({ key, icon: Icon }) => /* @__PURE__ */ jsxRuntime.jsxs(
1621
+ dropdownMenu_js.DropdownMenuItem,
1622
+ {
1623
+ onClick: () => handleThemeClick(key),
1624
+ className: cn(
1625
+ "gap-2 cursor-pointer",
1626
+ currentTheme === key && "bg-accent text-accent-foreground [&_svg]:text-accent-foreground"
1627
+ ),
1628
+ children: [
1629
+ /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "size-4" }),
1630
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: labels[key] })
1631
+ ]
1632
+ },
1633
+ key
1634
+ ))
1635
+ }
1636
+ )
1637
+ ] });
1638
+ }
1639
+ var defaultLanguages = [
1640
+ { key: "es-MX", label: "ES", nativeName: "Espa\xF1ol (M\xE9xico)" },
1641
+ { key: "en", label: "EN", nativeName: "English" }
1642
+ ];
1643
+ var sizeClasses2 = {
1644
+ sm: { button: "size-8", icon: "size-4" },
1645
+ md: { button: "size-8", icon: "size-4" },
1646
+ lg: { button: "size-9", icon: "size-4" }
1647
+ };
1648
+ var shapeClasses2 = {
1649
+ rounded: "rounded-md",
1650
+ squared: "rounded-sm",
1651
+ pill: "rounded-full"
1652
+ };
1653
+ var iconTriggerClassName2 = "border border-border bg-transparent text-muted-foreground shadow-none hover:bg-accent hover:text-foreground dark:border-border dark:bg-transparent dark:text-muted-foreground dark:hover:bg-accent/50";
1654
+ function LanguageSwitcher({
1655
+ languages: propLanguages,
1656
+ currentLanguage: propCurrentLanguage,
1657
+ onLanguageChange: propOnLanguageChange,
1658
+ labels = {},
1659
+ className,
1660
+ size = "sm",
1661
+ shape = "rounded",
1662
+ align = "end",
1663
+ side = "bottom"
1664
+ }) {
1665
+ const context = useLanguageContext();
1666
+ const contextLanguages = context?.languages?.map((lang) => ({
1667
+ key: lang.code,
1668
+ label: lang.code.toUpperCase(),
1669
+ nativeName: lang.name
1670
+ }));
1671
+ const languages = propLanguages ?? contextLanguages ?? defaultLanguages;
1672
+ const currentLanguage = propCurrentLanguage ?? context?.language ?? "en";
1673
+ const onLanguageChange = propOnLanguageChange ?? context?.setLanguage;
1674
+ const sizes = sizeClasses2[size];
1675
+ const shapeClass = shapeClasses2[shape];
1676
+ const accessibleName = labels.language ?? "Language";
1677
+ return /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu_js.DropdownMenu, { children: [
1678
+ /* @__PURE__ */ jsxRuntime.jsx(
1679
+ dropdownMenu_js.DropdownMenuTrigger,
1680
+ {
1681
+ render: /* @__PURE__ */ jsxRuntime.jsx(
1682
+ button_js.Button,
1683
+ {
1684
+ variant: "outline",
1685
+ size: "icon",
1686
+ "aria-label": accessibleName,
1687
+ className: cn(
1688
+ sizes.button,
1689
+ shapeClass,
1690
+ iconTriggerClassName2,
1691
+ className
1692
+ )
1693
+ }
1694
+ ),
1695
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Languages, { className: sizes.icon })
1696
+ }
1697
+ ),
1698
+ /* @__PURE__ */ jsxRuntime.jsx(
1699
+ dropdownMenu_js.DropdownMenuContent,
1700
+ {
1701
+ side,
1702
+ align,
1703
+ sideOffset: dropdownMenu_js.miniMenuContentDefaults.sideOffset,
1704
+ collisionPadding: dropdownMenu_js.miniMenuContentDefaults.collisionPadding,
1705
+ className: cn(dropdownMenu_js.miniMenuContentClassName, "min-w-0 w-auto"),
1706
+ children: languages.map(({ key, nativeName }) => /* @__PURE__ */ jsxRuntime.jsx(
1707
+ dropdownMenu_js.DropdownMenuItem,
1708
+ {
1709
+ onClick: () => onLanguageChange?.(key),
1710
+ className: cn(
1711
+ "justify-center text-xs font-semibold cursor-pointer px-3",
1712
+ currentLanguage === key && "bg-accent text-accent-foreground"
1713
+ ),
1714
+ children: nativeName
1715
+ },
1716
+ key
1717
+ ))
1718
+ }
1719
+ )
1720
+ ] });
1721
+ }
1722
+
1723
+ // src/data/countries.json
1724
+ var countries_default = [
1725
+ {
1726
+ code: "AF",
1727
+ labelEs: "AFGANISTAN"
1728
+ },
1729
+ {
1730
+ code: "AL",
1731
+ labelEs: "ALBANIA"
1732
+ },
1733
+ {
1734
+ code: "DE",
1735
+ labelEs: "ALEMANIA"
1736
+ },
1737
+ {
1738
+ code: "AD",
1739
+ labelEs: "ANDORRA"
1740
+ },
1741
+ {
1742
+ code: "AO",
1743
+ labelEs: "ANGOLA"
1744
+ },
1745
+ {
1746
+ code: "AI",
1747
+ labelEs: "ANGUILA"
1748
+ },
1749
+ {
1750
+ code: "AQ",
1751
+ labelEs: "ANTARTIDA"
1752
+ },
1753
+ {
1754
+ code: "AG",
1755
+ labelEs: "ANTIGUA Y BARBUDA"
1756
+ },
1757
+ {
1758
+ code: "AN",
1759
+ labelEs: "ANTILLAS NEERLANDESAS"
1760
+ },
1761
+ {
1762
+ code: "SA",
1763
+ labelEs: "ARABIA SAUDI"
1764
+ },
1765
+ {
1766
+ code: "DZ",
1767
+ labelEs: "ARGELIA"
1768
+ },
1769
+ {
1770
+ code: "AR",
1771
+ labelEs: "ARGENTINA"
1772
+ },
1773
+ {
1774
+ code: "AM",
1775
+ labelEs: "ARMENIA"
1776
+ },
1777
+ {
1778
+ code: "AW",
1779
+ labelEs: "ARUBA"
1780
+ },
1781
+ {
1782
+ code: "AU",
1783
+ labelEs: "AUSTRALIA"
1784
+ },
1785
+ {
1786
+ code: "AT",
1787
+ labelEs: "AUSTRIA"
1788
+ },
1789
+ {
1790
+ code: "AZ",
1791
+ labelEs: "AZERBAIYAN"
1792
+ },
1793
+ {
1794
+ code: "BS",
1795
+ labelEs: "BAHAMAS"
1796
+ },
1797
+ {
1798
+ code: "BH",
1799
+ labelEs: "BAHREIN"
1800
+ },
1801
+ {
1802
+ code: "BD",
1803
+ labelEs: "BANGLADESH"
1804
+ },
1805
+ {
1806
+ code: "BB",
1807
+ labelEs: "BARBADOS"
1808
+ },
1809
+ {
1810
+ code: "BY",
1811
+ labelEs: "BELARUS"
1812
+ },
1813
+ {
1814
+ code: "BE",
1815
+ labelEs: "BELGICA"
1816
+ },
1817
+ {
1818
+ code: "BZ",
1819
+ labelEs: "BELICE"
1820
+ },
1821
+ {
1822
+ code: "BJ",
1823
+ labelEs: "BENIN"
1824
+ },
1825
+ {
1826
+ code: "BM",
1827
+ labelEs: "BERMUDAS"
1828
+ },
1829
+ {
1830
+ code: "BT",
1831
+ labelEs: "BHUTAN"
1832
+ },
1833
+ {
1834
+ code: "BO",
1835
+ labelEs: "BOLIVIA"
1836
+ },
1837
+ {
1838
+ code: "BA",
1839
+ labelEs: "BOSNIA Y HERZEGOVINA"
1840
+ },
1841
+ {
1842
+ code: "BW",
1843
+ labelEs: "BOTSUANA"
1844
+ },
1845
+ {
1846
+ code: "BR",
1847
+ labelEs: "BRASIL"
1848
+ },
1849
+ {
1850
+ code: "BN",
1851
+ labelEs: "BRUNEI"
1852
+ },
1853
+ {
1854
+ code: "BG",
1855
+ labelEs: "BULGARIA"
1856
+ },
1857
+ {
1858
+ code: "BF",
1859
+ labelEs: "BURKINA FASO"
1860
+ },
1861
+ {
1862
+ code: "BI",
1863
+ labelEs: "BURUNDI"
1864
+ },
1865
+ {
1866
+ code: "CV",
1867
+ labelEs: "CABO VERDE"
1868
+ },
1869
+ {
1870
+ code: "KH",
1871
+ labelEs: "CAMBOYA"
1872
+ },
1873
+ {
1874
+ code: "CM",
1875
+ labelEs: "CAMERUN"
1876
+ },
1877
+ {
1878
+ code: "CA",
1879
+ labelEs: "CANADA"
1880
+ },
1881
+ {
1882
+ code: "TD",
1883
+ labelEs: "CHAD"
1884
+ },
1885
+ {
1886
+ code: "CZ",
1887
+ labelEs: "CHEQUIA"
1888
+ },
1889
+ {
1890
+ code: "CL",
1891
+ labelEs: "CHILE"
1892
+ },
1893
+ {
1894
+ code: "CN",
1895
+ labelEs: "CHINA"
1896
+ },
1897
+ {
1898
+ code: "CY",
1899
+ labelEs: "CHIPRE"
1900
+ },
1901
+ {
1902
+ code: "CP",
1903
+ labelEs: "CLIPPERTON"
1904
+ },
1905
+ {
1906
+ code: "CO",
1907
+ labelEs: "COLOMBIA"
1908
+ },
1909
+ {
1910
+ code: "KM",
1911
+ labelEs: "COMORAS"
1912
+ },
1913
+ {
1914
+ code: "CG",
1915
+ labelEs: "CONGO"
1916
+ },
1917
+ {
1918
+ code: "KP",
1919
+ labelEs: "COREA DEL NORTE"
1920
+ },
1921
+ {
1922
+ code: "KR",
1923
+ labelEs: "COREA DEL SUR"
1924
+ },
1925
+ {
1926
+ code: "CI",
1927
+ labelEs: "COSTA DE MARFIL"
1928
+ },
1929
+ {
1930
+ code: "CR",
1931
+ labelEs: "COSTA RICA"
1932
+ },
1933
+ {
1934
+ code: "HR",
1935
+ labelEs: "CROACIA"
1936
+ },
1937
+ {
1938
+ code: "CU",
1939
+ labelEs: "CUBA"
1940
+ },
1941
+ {
1942
+ code: "CW",
1943
+ labelEs: "CURAZAO"
1944
+ },
1945
+ {
1946
+ code: "DK",
1947
+ labelEs: "DINAMARCA"
1948
+ },
1949
+ {
1950
+ code: "DM",
1951
+ labelEs: "DOMINICA"
1952
+ },
1953
+ {
1954
+ code: "EC",
1955
+ labelEs: "ECUADOR"
1956
+ },
1957
+ {
1958
+ code: "EG",
1959
+ labelEs: "EGIPTO"
1960
+ },
1961
+ {
1962
+ code: "SV",
1963
+ labelEs: "EL SALVADOR"
1964
+ },
1965
+ {
1966
+ code: "AE",
1967
+ labelEs: "EMIRATOS ARABES UNIDOS"
1968
+ },
1969
+ {
1970
+ code: "ER",
1971
+ labelEs: "ERITREA"
1972
+ },
1973
+ {
1974
+ code: "SK",
1975
+ labelEs: "ESLOVAQUIA"
1976
+ },
1977
+ {
1978
+ code: "SI",
1979
+ labelEs: "ESLOVENIA"
1980
+ },
1981
+ {
1982
+ code: "ES",
1983
+ labelEs: "ESPA\xD1A"
1984
+ },
1985
+ {
1986
+ code: "US",
1987
+ labelEs: "ESTADOS UNIDOS"
1988
+ },
1989
+ {
1990
+ code: "EE",
1991
+ labelEs: "ESTONIA"
1992
+ },
1993
+ {
1994
+ code: "ET",
1995
+ labelEs: "ETIOPIA"
1996
+ },
1997
+ {
1998
+ code: "PH",
1999
+ labelEs: "FILIPINAS"
2000
+ },
2001
+ {
2002
+ code: "FI",
2003
+ labelEs: "FINLANDIA"
2004
+ },
2005
+ {
2006
+ code: "FJ",
2007
+ labelEs: "FIYI"
2008
+ },
2009
+ {
2010
+ code: "FR",
2011
+ labelEs: "FRANCIA"
2012
+ },
2013
+ {
2014
+ code: "GA",
2015
+ labelEs: "GABON"
2016
+ },
2017
+ {
2018
+ code: "GM",
2019
+ labelEs: "GAMBIA"
2020
+ },
2021
+ {
2022
+ code: "GE",
2023
+ labelEs: "GEORGIA"
2024
+ },
2025
+ {
2026
+ code: "GS",
2027
+ labelEs: "GEORGIA DEL SUR E ISLAS SANDWICH DEL SUR"
2028
+ },
2029
+ {
2030
+ code: "GH",
2031
+ labelEs: "GHANA"
2032
+ },
2033
+ {
2034
+ code: "GI",
2035
+ labelEs: "GIBRALTAR"
2036
+ },
2037
+ {
2038
+ code: "GD",
2039
+ labelEs: "GRANADA"
2040
+ },
2041
+ {
2042
+ code: "EL",
2043
+ labelEs: "GRECIA"
2044
+ },
2045
+ {
2046
+ code: "GL",
2047
+ labelEs: "GROENLANDIA"
2048
+ },
2049
+ {
2050
+ code: "GP",
2051
+ labelEs: "GUADALUPE"
2052
+ },
2053
+ {
2054
+ code: "GU",
2055
+ labelEs: "GUAM"
2056
+ },
2057
+ {
2058
+ code: "GT",
2059
+ labelEs: "GUATEMALA"
2060
+ },
2061
+ {
2062
+ code: "GF",
2063
+ labelEs: "GUAYANA FRANCESA"
2064
+ },
2065
+ {
2066
+ code: "GG",
2067
+ labelEs: "GUERNESEY"
2068
+ },
2069
+ {
2070
+ code: "GN",
2071
+ labelEs: "GUINEA"
2072
+ },
2073
+ {
2074
+ code: "GQ",
2075
+ labelEs: "GUINEA ECUATORIAL"
2076
+ },
2077
+ {
2078
+ code: "GW",
2079
+ labelEs: "GUINEA-BISSAU"
2080
+ },
2081
+ {
2082
+ code: "GY",
2083
+ labelEs: "GUYANA"
2084
+ },
2085
+ {
2086
+ code: "HT",
2087
+ labelEs: "HAITI"
2088
+ },
2089
+ {
2090
+ code: "HN",
2091
+ labelEs: "HONDURAS"
2092
+ },
2093
+ {
2094
+ code: "HK",
2095
+ labelEs: "HONG KONG"
2096
+ },
2097
+ {
2098
+ code: "HU",
2099
+ labelEs: "HUNGRIA"
2100
+ },
2101
+ {
2102
+ code: "IN",
2103
+ labelEs: "INDIA"
2104
+ },
2105
+ {
2106
+ code: "ID",
2107
+ labelEs: "INDONESIA"
2108
+ },
2109
+ {
2110
+ code: "IR",
2111
+ labelEs: "IRAN"
2112
+ },
2113
+ {
2114
+ code: "IQ",
2115
+ labelEs: "IRAQ"
2116
+ },
2117
+ {
2118
+ code: "IE",
2119
+ labelEs: "IRLANDA"
2120
+ },
2121
+ {
2122
+ code: "BV",
2123
+ labelEs: "ISLA BOUVET"
2124
+ },
2125
+ {
2126
+ code: "CX",
2127
+ labelEs: "ISLA CHRISTMAS"
2128
+ },
2129
+ {
2130
+ code: "IM",
2131
+ labelEs: "ISLA DE MAN"
2132
+ },
2133
+ {
2134
+ code: "NF",
2135
+ labelEs: "ISLA NORFOLK"
2136
+ },
2137
+ {
2138
+ code: "IS",
2139
+ labelEs: "ISLANDIA"
2140
+ },
2141
+ {
2142
+ code: "AX",
2143
+ labelEs: "ISLAS \xC5LAND"
2144
+ },
2145
+ {
2146
+ code: "KY",
2147
+ labelEs: "ISLAS CAIMAN"
2148
+ },
2149
+ {
2150
+ code: "CC",
2151
+ labelEs: "ISLAS COCOS"
2152
+ },
2153
+ {
2154
+ code: "CK",
2155
+ labelEs: "ISLAS COOK"
2156
+ },
2157
+ {
2158
+ code: "FO",
2159
+ labelEs: "ISLAS FEROE"
2160
+ },
2161
+ {
2162
+ code: "HM",
2163
+ labelEs: "ISLAS HEARD Y MCDONALD"
2164
+ },
2165
+ {
2166
+ code: "FK",
2167
+ labelEs: "ISLAS MALVINAS"
2168
+ },
2169
+ {
2170
+ code: "MP",
2171
+ labelEs: "ISLAS MARIANAS DEL NORTE"
2172
+ },
2173
+ {
2174
+ code: "MH",
2175
+ labelEs: "ISLAS MARSHALL"
2176
+ },
2177
+ {
2178
+ code: "UM",
2179
+ labelEs: "ISLAS MENORES ALEJADAS DE LOS ESTADOS UNIDOS"
2180
+ },
2181
+ {
2182
+ code: "PN",
2183
+ labelEs: "ISLAS PITCAIRN"
2184
+ },
2185
+ {
2186
+ code: "SB",
2187
+ labelEs: "ISLAS SALOMON"
2188
+ },
2189
+ {
2190
+ code: "TC",
2191
+ labelEs: "ISLAS TURCAS Y CAICOS"
2192
+ },
2193
+ {
2194
+ code: "VG",
2195
+ labelEs: "ISLAS VIRGENES BRITANICAS"
2196
+ },
2197
+ {
2198
+ code: "VI",
2199
+ labelEs: "ISLAS VIRGENES DE LOS ESTADOS UNIDOS"
2200
+ },
2201
+ {
2202
+ code: "IL",
2203
+ labelEs: "ISRAEL"
2204
+ },
2205
+ {
2206
+ code: "IT",
2207
+ labelEs: "ITALIA"
2208
+ },
2209
+ {
2210
+ code: "JM",
2211
+ labelEs: "JAMAICA"
2212
+ },
2213
+ {
2214
+ code: "JP",
2215
+ labelEs: "JAPON"
2216
+ },
2217
+ {
2218
+ code: "JE",
2219
+ labelEs: "JERSEY"
2220
+ },
2221
+ {
2222
+ code: "JO",
2223
+ labelEs: "JORDANIA"
2224
+ },
2225
+ {
2226
+ code: "KZ",
2227
+ labelEs: "KAZAJSTAN"
2228
+ },
2229
+ {
2230
+ code: "KE",
2231
+ labelEs: "KENIA"
2232
+ },
2233
+ {
2234
+ code: "KG",
2235
+ labelEs: "KIRGUISTAN"
2236
+ },
2237
+ {
2238
+ code: "KI",
2239
+ labelEs: "KIRIBATI"
2240
+ },
2241
+ {
2242
+ code: "XK",
2243
+ labelEs: "KOSOVO"
2244
+ },
2245
+ {
2246
+ code: "KW",
2247
+ labelEs: "KUWAIT"
2248
+ },
2249
+ {
2250
+ code: "LA",
2251
+ labelEs: "LAOS"
2252
+ },
2253
+ {
2254
+ code: "LS",
2255
+ labelEs: "LESOTHO"
2256
+ },
2257
+ {
2258
+ code: "LV",
2259
+ labelEs: "LETONIA"
2260
+ },
2261
+ {
2262
+ code: "LB",
2263
+ labelEs: "LIBANO"
2264
+ },
2265
+ {
2266
+ code: "LR",
2267
+ labelEs: "LIBERIA"
2268
+ },
2269
+ {
2270
+ code: "LY",
2271
+ labelEs: "LIBIA"
2272
+ },
2273
+ {
2274
+ code: "LI",
2275
+ labelEs: "LIECHTENSTEIN"
2276
+ },
2277
+ {
2278
+ code: "LT",
2279
+ labelEs: "LITUANIA"
2280
+ },
2281
+ {
2282
+ code: "LU",
2283
+ labelEs: "LUXEMBURGO"
2284
+ },
2285
+ {
2286
+ code: "MO",
2287
+ labelEs: "MACAO"
2288
+ },
2289
+ {
2290
+ code: "MK",
2291
+ labelEs: "MACEDONIA"
2292
+ },
2293
+ {
2294
+ code: "MG",
2295
+ labelEs: "MADAGASCAR"
2296
+ },
2297
+ {
2298
+ code: "MY",
2299
+ labelEs: "MALASIA"
2300
+ },
2301
+ {
2302
+ code: "MW",
2303
+ labelEs: "MALAWI"
2304
+ },
2305
+ {
2306
+ code: "MV",
2307
+ labelEs: "MALDIVAS"
2308
+ },
2309
+ {
2310
+ code: "ML",
2311
+ labelEs: "MALI"
2312
+ },
2313
+ {
2314
+ code: "MT",
2315
+ labelEs: "MALTA"
2316
+ },
2317
+ {
2318
+ code: "MA",
2319
+ labelEs: "MARRUECOS"
2320
+ },
2321
+ {
2322
+ code: "MQ",
2323
+ labelEs: "MARTINICA"
2324
+ },
2325
+ {
2326
+ code: "MU",
2327
+ labelEs: "MAURICIO"
2328
+ },
2329
+ {
2330
+ code: "MR",
2331
+ labelEs: "MAURITANIA"
2332
+ },
2333
+ {
2334
+ code: "YT",
2335
+ labelEs: "MAYOTTE"
2336
+ },
2337
+ {
2338
+ code: "MX",
2339
+ labelEs: "MEXICO"
2340
+ },
2341
+ {
2342
+ code: "FM",
2343
+ labelEs: "MICRONESIA"
2344
+ },
2345
+ {
2346
+ code: "MD",
2347
+ labelEs: "MOLDOVA"
2348
+ },
2349
+ {
2350
+ code: "MC",
2351
+ labelEs: "MONACO"
2352
+ },
2353
+ {
2354
+ code: "MN",
2355
+ labelEs: "MONGOLIA"
2356
+ },
2357
+ {
2358
+ code: "ME",
2359
+ labelEs: "MONTENEGRO"
2360
+ },
2361
+ {
2362
+ code: "MS",
2363
+ labelEs: "MONTSERRAT"
2364
+ },
2365
+ {
2366
+ code: "MZ",
2367
+ labelEs: "MOZAMBIQUE"
2368
+ },
2369
+ {
2370
+ code: "MM",
2371
+ labelEs: "MYANMAR"
2372
+ },
2373
+ {
2374
+ code: "NA",
2375
+ labelEs: "NAMIBIA"
2376
+ },
2377
+ {
2378
+ code: "NR",
2379
+ labelEs: "NAURU"
2380
+ },
2381
+ {
2382
+ code: "NP",
2383
+ labelEs: "NEPAL"
2384
+ },
2385
+ {
2386
+ code: "NI",
2387
+ labelEs: "NICARAGUA"
2388
+ },
2389
+ {
2390
+ code: "NE",
2391
+ labelEs: "NIGER"
2392
+ },
2393
+ {
2394
+ code: "NG",
2395
+ labelEs: "NIGERIA"
2396
+ },
2397
+ {
2398
+ code: "NU",
2399
+ labelEs: "NIUE"
2400
+ },
2401
+ {
2402
+ code: "NO",
2403
+ labelEs: "NORUEGA"
2404
+ },
2405
+ {
2406
+ code: "NC",
2407
+ labelEs: "NUEVA CALEDONIA"
2408
+ },
2409
+ {
2410
+ code: "NZ",
2411
+ labelEs: "NUEVA ZELANDA"
2412
+ },
2413
+ {
2414
+ code: "OM",
2415
+ labelEs: "OMAN"
2416
+ },
2417
+ {
2418
+ code: "NL",
2419
+ labelEs: "PAISES BAJOS"
2420
+ },
2421
+ {
2422
+ code: "PK",
2423
+ labelEs: "PAKISTAN"
2424
+ },
2425
+ {
2426
+ code: "PW",
2427
+ labelEs: "PALAOS"
2428
+ },
2429
+ {
2430
+ code: "PA",
2431
+ labelEs: "PANAMA"
2432
+ },
2433
+ {
2434
+ code: "PG",
2435
+ labelEs: "PAPUA NUEVA GUINEA"
2436
+ },
2437
+ {
2438
+ code: "PY",
2439
+ labelEs: "PARAGUAY"
2440
+ },
2441
+ {
2442
+ code: "PE",
2443
+ labelEs: "PERU"
2444
+ },
2445
+ {
2446
+ code: "PF",
2447
+ labelEs: "POLINESIA FRANCESA"
2448
+ },
2449
+ {
2450
+ code: "PL",
2451
+ labelEs: "POLONIA"
2452
+ },
2453
+ {
2454
+ code: "PT",
2455
+ labelEs: "PORTUGAL"
2456
+ },
2457
+ {
2458
+ code: "PR",
2459
+ labelEs: "PUERTO RICO"
2460
+ },
2461
+ {
2462
+ code: "QA",
2463
+ labelEs: "QATAR"
2464
+ },
2465
+ {
2466
+ code: "UK",
2467
+ labelEs: "REINO UNIDO"
2468
+ },
2469
+ {
2470
+ code: "CF",
2471
+ labelEs: "REPUBLICA CENTROAFRICANA"
2472
+ },
2473
+ {
2474
+ code: "CD",
2475
+ labelEs: "REPUBLICA DEMOCRATICA DEL CONGO"
2476
+ },
2477
+ {
2478
+ code: "DO",
2479
+ labelEs: "REPUBLICA DOMINICANA"
2480
+ },
2481
+ {
2482
+ code: "RE",
2483
+ labelEs: "REUNION"
2484
+ },
2485
+ {
2486
+ code: "RW",
2487
+ labelEs: "RUANDA"
2488
+ },
2489
+ {
2490
+ code: "RO",
2491
+ labelEs: "RUMANIA"
2492
+ },
2493
+ {
2494
+ code: "RU",
2495
+ labelEs: "RUSIA"
2496
+ },
2497
+ {
2498
+ code: "EH",
2499
+ labelEs: "SAHARA OCCIDENTAL"
2500
+ },
2501
+ {
2502
+ code: "WS",
2503
+ labelEs: "SAMOA"
2504
+ },
2505
+ {
2506
+ code: "AS",
2507
+ labelEs: "SAMOA AMERICANA"
2508
+ },
2509
+ {
2510
+ code: "BL",
2511
+ labelEs: "SAN BARTOLOME"
2512
+ },
2513
+ {
2514
+ code: "KN",
2515
+ labelEs: "SAN CRISTOBAL Y NIEVES"
2516
+ },
2517
+ {
2518
+ code: "SM",
2519
+ labelEs: "SAN MARINO"
2520
+ },
2521
+ {
2522
+ code: "MF",
2523
+ labelEs: "SAN MARTIN"
2524
+ },
2525
+ {
2526
+ code: "PM",
2527
+ labelEs: "SAN PEDRO Y MIQUELON"
2528
+ },
2529
+ {
2530
+ code: "VC",
2531
+ labelEs: "SAN VICENTE Y LAS GRANADINAS"
2532
+ },
2533
+ {
2534
+ code: "SH",
2535
+ labelEs: "SANTA ELENA"
2536
+ },
2537
+ {
2538
+ code: "LC",
2539
+ labelEs: "SANTA LUCIA"
2540
+ },
2541
+ {
2542
+ code: "VA",
2543
+ labelEs: "SANTA SEDE / ESTADO DE LA CIUDAD DEL VATICANO"
2544
+ },
2545
+ {
2546
+ code: "ST",
2547
+ labelEs: "SANTO TOME Y PRINCIPE"
2548
+ },
2549
+ {
2550
+ code: "SN",
2551
+ labelEs: "SENEGAL"
2552
+ },
2553
+ {
2554
+ code: "RS",
2555
+ labelEs: "SERBIA"
2556
+ },
2557
+ {
2558
+ code: "SC",
2559
+ labelEs: "SEYCHELLES"
2560
+ },
2561
+ {
2562
+ code: "SL",
2563
+ labelEs: "SIERRA LEONA"
2564
+ },
2565
+ {
2566
+ code: "SG",
2567
+ labelEs: "SINGAPUR"
2568
+ },
2569
+ {
2570
+ code: "SY",
2571
+ labelEs: "SIRIA"
2572
+ },
2573
+ {
2574
+ code: "SO",
2575
+ labelEs: "SOMALIA"
2576
+ },
2577
+ {
2578
+ code: "LK",
2579
+ labelEs: "SRI LANKA"
2580
+ },
2581
+ {
2582
+ code: "SZ",
2583
+ labelEs: "SUAZILANDIA"
2584
+ },
2585
+ {
2586
+ code: "ZA",
2587
+ labelEs: "SUDAFRICA"
2588
+ },
2589
+ {
2590
+ code: "SD",
2591
+ labelEs: "SUDAN"
2592
+ },
2593
+ {
2594
+ code: "SE",
2595
+ labelEs: "SUECIA"
2596
+ },
2597
+ {
2598
+ code: "CH",
2599
+ labelEs: "SUIZA"
2600
+ },
2601
+ {
2602
+ code: "SR",
2603
+ labelEs: "SURINAM"
2604
+ },
2605
+ {
2606
+ code: "SJ",
2607
+ labelEs: "SVALBARD Y JAN MAYEN"
2608
+ },
2609
+ {
2610
+ code: "TH",
2611
+ labelEs: "TAILANDIA"
2612
+ },
2613
+ {
2614
+ code: "TW",
2615
+ labelEs: "TAIWAN"
2616
+ },
2617
+ {
2618
+ code: "TZ",
2619
+ labelEs: "TANZANIA"
2620
+ },
2621
+ {
2622
+ code: "TJ",
2623
+ labelEs: "TAYIKISTAN"
2624
+ },
2625
+ {
2626
+ code: "IO",
2627
+ labelEs: "TERRITORIO BRITANICO DEL OCEANO INDICO"
2628
+ },
2629
+ {
2630
+ code: "TF",
2631
+ labelEs: "TERRITORIOS AUSTRALES FRANCESES"
2632
+ },
2633
+ {
2634
+ code: "PS",
2635
+ labelEs: "TERRITORIOS PALESTINOS"
2636
+ },
2637
+ {
2638
+ code: "TL",
2639
+ labelEs: "TIMOR ORIENTAL"
2640
+ },
2641
+ {
2642
+ code: "TG",
2643
+ labelEs: "TOGO"
2644
+ },
2645
+ {
2646
+ code: "TK",
2647
+ labelEs: "TOKELAU"
2648
+ },
2649
+ {
2650
+ code: "TO",
2651
+ labelEs: "TONGA"
2652
+ },
2653
+ {
2654
+ code: "TT",
2655
+ labelEs: "TRINIDAD Y TOBAGO"
2656
+ },
2657
+ {
2658
+ code: "TN",
2659
+ labelEs: "TUNEZ"
2660
+ },
2661
+ {
2662
+ code: "TM",
2663
+ labelEs: "TURKMENISTAN"
2664
+ },
2665
+ {
2666
+ code: "TR",
2667
+ labelEs: "TURQUIA"
2668
+ },
2669
+ {
2670
+ code: "TV",
2671
+ labelEs: "TUVALU"
2672
+ },
2673
+ {
2674
+ code: "UA",
2675
+ labelEs: "UCRANIA"
2676
+ },
2677
+ {
2678
+ code: "UG",
2679
+ labelEs: "UGANDA"
2680
+ },
2681
+ {
2682
+ code: "UY",
2683
+ labelEs: "URUGUAY"
2684
+ },
2685
+ {
2686
+ code: "UZ",
2687
+ labelEs: "UZBEKISTAN"
2688
+ },
2689
+ {
2690
+ code: "VU",
2691
+ labelEs: "VANUATU"
2692
+ },
2693
+ {
2694
+ code: "VE",
2695
+ labelEs: "VENEZUELA"
2696
+ },
2697
+ {
2698
+ code: "VN",
2699
+ labelEs: "VIETNAM"
2700
+ },
2701
+ {
2702
+ code: "WF",
2703
+ labelEs: "WALLIS Y FUTUNA"
2704
+ },
2705
+ {
2706
+ code: "YE",
2707
+ labelEs: "YEMEN"
2708
+ },
2709
+ {
2710
+ code: "DJ",
2711
+ labelEs: "YIBUTI"
2712
+ },
2713
+ {
2714
+ code: "ZM",
2715
+ labelEs: "ZAMBIA"
2716
+ },
2717
+ {
2718
+ code: "ZW",
2719
+ labelEs: "ZIMBABUE"
2720
+ }
2721
+ ];
2722
+
2723
+ // src/lib/countries.ts
2724
+ var ITEMS = countries_default;
2725
+ var COUNTRY_OPTIONS = Object.freeze(
2726
+ [...ITEMS].sort(
2727
+ (left, right) => left.labelEs.localeCompare(right.labelEs, "es")
2728
+ )
2729
+ );
2730
+ var CODE_SET = new Set(ITEMS.map((item) => item.code));
2731
+ var BY_CODE = new Map(ITEMS.map((item) => [item.code, item]));
2732
+ var englishDisplayNames;
2733
+ function englishRegionName(code) {
2734
+ try {
2735
+ englishDisplayNames ??= new Intl.DisplayNames(["en"], { type: "region" });
2736
+ return englishDisplayNames.of(code);
2737
+ } catch {
2738
+ return void 0;
2739
+ }
2740
+ }
2741
+ function titleCaseEs(labelEs) {
2742
+ return labelEs.toLocaleLowerCase("es-MX").split(/\s+/).filter(Boolean).map((word) => word.charAt(0).toLocaleUpperCase("es-MX") + word.slice(1)).join(" ");
2743
+ }
2744
+ function isKnownCountryCode(code) {
2745
+ return CODE_SET.has(code.trim().toUpperCase());
2746
+ }
2747
+ function countryLabel(code, locale) {
2748
+ const normalized = code.trim().toUpperCase();
2749
+ const record = BY_CODE.get(normalized);
2750
+ if (!record) return normalized;
2751
+ if (locale === "es-MX") {
2752
+ return titleCaseEs(record.labelEs);
2753
+ }
2754
+ return englishRegionName(normalized) ?? titleCaseEs(record.labelEs);
2755
+ }
2756
+ function formatCountryOptionLabel(code, locale) {
2757
+ const normalized = code.trim().toUpperCase();
2758
+ return `${normalized} \u2014 ${countryLabel(normalized, locale)}`;
2759
+ }
2760
+ function countryPickerItems(locale) {
2761
+ return COUNTRY_OPTIONS.map((item) => ({
2762
+ value: item.code,
2763
+ label: formatCountryOptionLabel(item.code, locale)
2764
+ }));
2765
+ }
2766
+ function foldForSearch(text) {
2767
+ return text.normalize("NFD").replace(/\p{M}/gu, "").toLowerCase();
2768
+ }
2769
+ function filterCountries(query, locale) {
2770
+ const items = countryPickerItems(locale);
2771
+ const trimmed = query.trim();
2772
+ if (!trimmed) return items;
2773
+ const needle = foldForSearch(trimmed);
2774
+ return items.filter((item) => {
2775
+ const code = foldForSearch(item.value);
2776
+ const label = foldForSearch(item.label);
2777
+ return code.includes(needle) || label.includes(needle);
2778
+ });
2779
+ }
2780
+ var INPUT_CLASS = "h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40";
2781
+ function defaultLabels2(purpose, locale) {
2782
+ const es = locale === "es-MX";
2783
+ if (purpose === "nationality") {
2784
+ return {
2785
+ placeholder: es ? "Buscar pa\xEDs\u2026" : "Search country\u2026",
2786
+ search: es ? "Buscar pa\xEDs" : "Search country",
2787
+ noResults: es ? "Sin resultados" : "No results",
2788
+ clear: es ? "Limpiar" : "Clear",
2789
+ open: es ? "Abrir lista" : "Open list"
2790
+ };
2791
+ }
2792
+ return {
2793
+ placeholder: es ? "Buscar pa\xEDs\u2026" : "Search country\u2026",
2794
+ search: es ? "Buscar pa\xEDs" : "Search country",
2795
+ noResults: es ? "Sin resultados" : "No results",
2796
+ clear: es ? "Limpiar" : "Clear",
2797
+ open: es ? "Abrir lista" : "Open list"
2798
+ };
2799
+ }
2800
+ function findItem(items, code) {
2801
+ const normalized = code.trim().toUpperCase();
2802
+ if (!normalized) return null;
2803
+ return items.find((item) => item.value === normalized) ?? null;
2804
+ }
2805
+ function CountryPicker({
2806
+ value,
2807
+ onValueChange,
2808
+ purpose,
2809
+ locale = "es-MX",
2810
+ id,
2811
+ name,
2812
+ disabled,
2813
+ required,
2814
+ allowEmpty = true,
2815
+ className,
2816
+ labels: labelsProp,
2817
+ "aria-invalid": ariaInvalid
2818
+ }) {
2819
+ const labels = { ...defaultLabels2(purpose, locale), ...labelsProp };
2820
+ const items = React__namespace.useMemo(() => countryPickerItems(locale), [locale]);
2821
+ const selected = React__namespace.useMemo(() => findItem(items, value), [items, value]);
2822
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2823
+ name ? /* @__PURE__ */ jsxRuntime.jsx("input", { type: "hidden", name, value: value.trim().toUpperCase() }) : null,
2824
+ /* @__PURE__ */ jsxRuntime.jsxs(
2825
+ combobox_js.Combobox.Root,
2826
+ {
2827
+ items,
2828
+ value: selected,
2829
+ onValueChange: (item) => {
2830
+ onValueChange(item?.value ?? "");
2831
+ },
2832
+ disabled,
2833
+ itemToStringLabel: (item) => item.label,
2834
+ itemToStringValue: (item) => item.value,
2835
+ isItemEqualToValue: (item, current) => item.value === current.value,
2836
+ children: [
2837
+ /* @__PURE__ */ jsxRuntime.jsxs(
2838
+ combobox_js.Combobox.InputGroup,
2839
+ {
2840
+ className: cn("relative flex w-full items-center", className),
2841
+ children: [
2842
+ /* @__PURE__ */ jsxRuntime.jsx(
2843
+ combobox_js.Combobox.Input,
2844
+ {
2845
+ id,
2846
+ required,
2847
+ "aria-invalid": ariaInvalid,
2848
+ ...labels.ariaLabel ? { "aria-label": labels.ariaLabel } : {},
2849
+ placeholder: labels.placeholder,
2850
+ className: cn(INPUT_CLASS, "pr-16")
2851
+ }
2852
+ ),
2853
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-y-0 right-0 flex items-center gap-0.5 pr-1.5", children: [
2854
+ allowEmpty ? /* @__PURE__ */ jsxRuntime.jsx(
2855
+ combobox_js.Combobox.Clear,
2856
+ {
2857
+ className: "inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground",
2858
+ "aria-label": labels.clear,
2859
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { className: "size-4", "aria-hidden": true })
2860
+ }
2861
+ ) : null,
2862
+ /* @__PURE__ */ jsxRuntime.jsx(
2863
+ combobox_js.Combobox.Trigger,
2864
+ {
2865
+ className: "inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground",
2866
+ "aria-label": labels.open,
2867
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDownIcon, { className: "size-4", "aria-hidden": true })
2868
+ }
2869
+ )
2870
+ ] })
2871
+ ]
2872
+ }
2873
+ ),
2874
+ /* @__PURE__ */ jsxRuntime.jsx(combobox_js.Combobox.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
2875
+ combobox_js.Combobox.Positioner,
2876
+ {
2877
+ className: "isolate z-50 outline-none",
2878
+ sideOffset: 4,
2879
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
2880
+ combobox_js.Combobox.Popup,
2881
+ {
2882
+ className: cn(
2883
+ "z-50 max-h-60 w-(--anchor-width) min-w-[16rem] overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10",
2884
+ "data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95"
2885
+ ),
2886
+ children: [
2887
+ /* @__PURE__ */ jsxRuntime.jsx(combobox_js.Combobox.Empty, { className: "px-3 py-2 text-sm text-muted-foreground", children: labels.noResults }),
2888
+ /* @__PURE__ */ jsxRuntime.jsx(combobox_js.Combobox.List, { className: "max-h-60 overflow-y-auto p-1 outline-none", children: (item) => /* @__PURE__ */ jsxRuntime.jsxs(
2889
+ combobox_js.Combobox.Item,
2890
+ {
2891
+ value: item,
2892
+ className: cn(
2893
+ "relative flex cursor-default items-center gap-2 rounded-md py-1.5 pr-2 pl-8 text-sm outline-none select-none",
2894
+ "data-highlighted:bg-accent data-highlighted:text-accent-foreground"
2895
+ ),
2896
+ children: [
2897
+ /* @__PURE__ */ jsxRuntime.jsx(combobox_js.Combobox.ItemIndicator, { className: "absolute left-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckIcon, { className: "size-4", "aria-hidden": true }) }),
2898
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: item.label })
2899
+ ]
2900
+ },
2901
+ item.value
2902
+ ) })
2903
+ ]
2904
+ }
2905
+ )
2906
+ }
2907
+ ) })
2908
+ ]
2909
+ }
2910
+ )
2911
+ ] });
2912
+ }
1704
2913
  var DEFAULT_LABELS = {
1705
2914
  uploadAria: "Upload image",
1706
2915
  uploadHint: "Click to upload",
@@ -1729,18 +2938,18 @@ function AvatarEditor({
1729
2938
  labels
1730
2939
  }) {
1731
2940
  const t = { ...DEFAULT_LABELS, ...labels };
1732
- const canvasRef = react.useRef(null);
1733
- const fileInputRef = react.useRef(null);
1734
- const containerRef = react.useRef(null);
1735
- const [image, setImage] = react.useState(null);
1736
- const [imageLoaded, setImageLoaded] = react.useState(false);
1737
- const [zoom, setZoom] = react.useState(1);
1738
- const [rotation, setRotation] = react.useState(0);
1739
- const [position, setPosition] = react.useState({ x: 0, y: 0 });
1740
- const [isDragging, setIsDragging] = react.useState(false);
1741
- const [dragStart, setDragStart] = react.useState({ x: 0, y: 0 });
1742
- const [showGrid, setShowGrid] = react.useState(initialShowGrid);
1743
- const generateOutput = react.useCallback(() => {
2941
+ const canvasRef = React.useRef(null);
2942
+ const fileInputRef = React.useRef(null);
2943
+ const containerRef = React.useRef(null);
2944
+ const [image, setImage] = React.useState(null);
2945
+ const [imageLoaded, setImageLoaded] = React.useState(false);
2946
+ const [zoom, setZoom] = React.useState(1);
2947
+ const [rotation, setRotation] = React.useState(0);
2948
+ const [position, setPosition] = React.useState({ x: 0, y: 0 });
2949
+ const [isDragging, setIsDragging] = React.useState(false);
2950
+ const [dragStart, setDragStart] = React.useState({ x: 0, y: 0 });
2951
+ const [showGrid, setShowGrid] = React.useState(initialShowGrid);
2952
+ const generateOutput = React.useCallback(() => {
1744
2953
  if (!canvasRef.current || !image) return null;
1745
2954
  const outputCanvas = document.createElement("canvas");
1746
2955
  outputCanvas.width = outputSize;
@@ -1751,7 +2960,7 @@ function AvatarEditor({
1751
2960
  const mimeType = `image/${outputFormat}`;
1752
2961
  return outputCanvas.toDataURL(mimeType, outputQuality);
1753
2962
  }, [image, outputSize, outputFormat, outputQuality]);
1754
- react.useEffect(() => {
2963
+ React.useEffect(() => {
1755
2964
  if (!canvasRef.current || !image || !imageLoaded) return;
1756
2965
  const canvas = canvasRef.current;
1757
2966
  const ctx = canvas.getContext("2d");
@@ -1795,12 +3004,12 @@ function AvatarEditor({
1795
3004
  generateOutput,
1796
3005
  onChange
1797
3006
  ]);
1798
- const resetTransforms = react.useCallback(() => {
3007
+ const resetTransforms = React.useCallback(() => {
1799
3008
  setZoom(1);
1800
3009
  setRotation(0);
1801
3010
  setPosition({ x: 0, y: 0 });
1802
3011
  }, []);
1803
- const handleFileSelect = react.useCallback(
3012
+ const handleFileSelect = React.useCallback(
1804
3013
  (e) => {
1805
3014
  const file = e.target.files?.[0];
1806
3015
  if (!file) return;
@@ -1819,7 +3028,7 @@ function AvatarEditor({
1819
3028
  },
1820
3029
  [resetTransforms]
1821
3030
  );
1822
- const handleMouseDown = react.useCallback(
3031
+ const handleMouseDown = React.useCallback(
1823
3032
  (e) => {
1824
3033
  if (!imageLoaded) return;
1825
3034
  setIsDragging(true);
@@ -1827,7 +3036,7 @@ function AvatarEditor({
1827
3036
  },
1828
3037
  [imageLoaded, position]
1829
3038
  );
1830
- const handleMouseMove = react.useCallback(
3039
+ const handleMouseMove = React.useCallback(
1831
3040
  (e) => {
1832
3041
  if (!isDragging) return;
1833
3042
  setPosition({
@@ -1837,10 +3046,10 @@ function AvatarEditor({
1837
3046
  },
1838
3047
  [isDragging, dragStart]
1839
3048
  );
1840
- const handleMouseUp = react.useCallback(() => {
3049
+ const handleMouseUp = React.useCallback(() => {
1841
3050
  setIsDragging(false);
1842
3051
  }, []);
1843
- const handleTouchStart = react.useCallback(
3052
+ const handleTouchStart = React.useCallback(
1844
3053
  (e) => {
1845
3054
  if (!imageLoaded) return;
1846
3055
  const touch = e.touches[0];
@@ -1852,7 +3061,7 @@ function AvatarEditor({
1852
3061
  },
1853
3062
  [imageLoaded, position]
1854
3063
  );
1855
- const handleTouchMove = react.useCallback(
3064
+ const handleTouchMove = React.useCallback(
1856
3065
  (e) => {
1857
3066
  if (!isDragging) return;
1858
3067
  const touch = e.touches[0];
@@ -1863,7 +3072,7 @@ function AvatarEditor({
1863
3072
  },
1864
3073
  [isDragging, dragStart]
1865
3074
  );
1866
- const handleDiscard = react.useCallback(() => {
3075
+ const handleDiscard = React.useCallback(() => {
1867
3076
  setImage(null);
1868
3077
  setImageLoaded(false);
1869
3078
  resetTransforms();
@@ -2234,8 +3443,8 @@ function AvatarEditor({
2234
3443
  );
2235
3444
  }
2236
3445
  function useMediaQuery(query) {
2237
- const [matches, setMatches] = react.useState(false);
2238
- react.useEffect(() => {
3446
+ const [matches, setMatches] = React.useState(false);
3447
+ React.useEffect(() => {
2239
3448
  const media = window.matchMedia(query);
2240
3449
  if (media.matches !== matches) {
2241
3450
  setMatches(media.matches);
@@ -2265,17 +3474,17 @@ function AvatarEditorDialog({
2265
3474
  className,
2266
3475
  editorLabels
2267
3476
  }) {
2268
- const [isOpen, setIsOpen] = react.useState(false);
2269
- const [editedValue, setEditedValue] = react.useState(value ?? null);
2270
- const [displaySrc, setDisplaySrc] = react.useState(value ?? null);
2271
- const [isSaving, setIsSaving] = react.useState(false);
2272
- const [feedback, setFeedback] = react.useState(null);
2273
- react.useEffect(() => {
3477
+ const [isOpen, setIsOpen] = React.useState(false);
3478
+ const [editedValue, setEditedValue] = React.useState(value ?? null);
3479
+ const [displaySrc, setDisplaySrc] = React.useState(value ?? null);
3480
+ const [isSaving, setIsSaving] = React.useState(false);
3481
+ const [feedback, setFeedback] = React.useState(null);
3482
+ React.useEffect(() => {
2274
3483
  setDisplaySrc(value ?? null);
2275
3484
  }, [value]);
2276
3485
  const isMobile = useMediaQuery("(max-width: 640px)");
2277
3486
  const caption = (placeholder ?? "").trim();
2278
- const handleOpenChange = react.useCallback(
3487
+ const handleOpenChange = React.useCallback(
2279
3488
  (open) => {
2280
3489
  if (open) {
2281
3490
  setEditedValue(value ?? null);
@@ -2285,7 +3494,7 @@ function AvatarEditorDialog({
2285
3494
  },
2286
3495
  [value]
2287
3496
  );
2288
- const handleAccept = react.useCallback(async () => {
3497
+ const handleAccept = React.useCallback(async () => {
2289
3498
  if (!editedValue) return;
2290
3499
  setIsSaving(true);
2291
3500
  setFeedback(null);
@@ -2551,10 +3760,10 @@ function FileDropzone({
2551
3760
  className
2552
3761
  }) {
2553
3762
  const labels = { ...DEFAULT_FILE_DROPZONE_LABELS, ...labelOverrides };
2554
- const inputId = react.useId();
2555
- const inputRef = react.useRef(null);
2556
- const [dragging, setDragging] = react.useState(false);
2557
- const [message, setMessage] = react.useState(null);
3763
+ const inputId = React.useId();
3764
+ const inputRef = React.useRef(null);
3765
+ const [dragging, setDragging] = React.useState(false);
3766
+ const [message, setMessage] = React.useState(null);
2558
3767
  function takeFile(file) {
2559
3768
  if (!file || disabled) return;
2560
3769
  if (!fileMatchesAccept(file, accept)) {
@@ -2802,7 +4011,7 @@ function FileUploadMenu({
2802
4011
  }) {
2803
4012
  const labels = { ...DEFAULT_FILE_UPLOAD_TRAY_LABELS, ...labelOverrides };
2804
4013
  const visible = jobs.filter((job) => job.status !== "cancelled");
2805
- const [uncontrolledOpen, setUncontrolledOpen] = react.useState(false);
4014
+ const [uncontrolledOpen, setUncontrolledOpen] = React.useState(false);
2806
4015
  const isControlled = open !== void 0;
2807
4016
  const resolvedOpen = isControlled ? open : uncontrolledOpen;
2808
4017
  function setResolvedOpen(next) {
@@ -3059,8 +4268,8 @@ function createMultipartUploadController(options) {
3059
4268
  };
3060
4269
  }
3061
4270
  function useMediaQuery2(query) {
3062
- const [matches, setMatches] = react.useState(false);
3063
- react.useEffect(() => {
4271
+ const [matches, setMatches] = React.useState(false);
4272
+ React.useEffect(() => {
3064
4273
  if (typeof window === "undefined" || !window.matchMedia) return;
3065
4274
  const mql = window.matchMedia(query);
3066
4275
  const onChange = () => setMatches(mql.matches);
@@ -3425,10 +4634,10 @@ function CookieConsentBanner({
3425
4634
  className
3426
4635
  }) {
3427
4636
  const copy = { ...DEFAULT_COOKIE_CONSENT_BANNER_LABELS, ...labels };
3428
- const [consent, setConsent] = react.useState(
4637
+ const [consent, setConsent] = React.useState(
3429
4638
  "pending"
3430
4639
  );
3431
- react.useEffect(() => {
4640
+ React.useEffect(() => {
3432
4641
  if (variant === "embed" || isEmbeddedWindow()) {
3433
4642
  setConsent("necessary");
3434
4643
  return;
@@ -4006,8 +5215,8 @@ function MatchReview({
4006
5215
  className
4007
5216
  }) {
4008
5217
  const copy = { ...DEFAULT_MATCH_REVIEW_LABELS, ...labels };
4009
- const reasonId = react.useId();
4010
- const [reason, setReason] = react.useState("");
5218
+ const reasonId = React.useId();
5219
+ const [reason, setReason] = React.useState("");
4011
5220
  const trimmed = reason.trim();
4012
5221
  if (!hit) {
4013
5222
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -4118,9 +5327,11 @@ exports.AvatarEditorDialog = AvatarEditorDialog;
4118
5327
  exports.COOKIE_CONSENT_MAX_AGE = COOKIE_CONSENT_MAX_AGE;
4119
5328
  exports.COOKIE_CONSENT_NAME = COOKIE_CONSENT_NAME;
4120
5329
  exports.COOKIE_CONSENT_VALUES = COOKIE_CONSENT_VALUES;
5330
+ exports.COUNTRY_OPTIONS = COUNTRY_OPTIONS;
4121
5331
  exports.ConfirmDestructiveDialog = ConfirmDestructiveDialog;
4122
5332
  exports.CookieConsentBanner = CookieConsentBanner;
4123
5333
  exports.CostBreakdownCard = CostBreakdownCard;
5334
+ exports.CountryPicker = CountryPicker;
4124
5335
  exports.DATA_TABLE_ROW_CLASS = DATA_TABLE_ROW_CLASS;
4125
5336
  exports.DEFAULT_AUDIT_TIMELINE_LABELS = DEFAULT_AUDIT_TIMELINE_LABELS;
4126
5337
  exports.DEFAULT_COOKIE_CONSENT_BANNER_LABELS = DEFAULT_COOKIE_CONSENT_BANNER_LABELS;
@@ -4190,13 +5401,18 @@ exports.avatarFallbackStyle = avatarFallbackStyle;
4190
5401
  exports.cn = cn;
4191
5402
  exports.cookieConsentAllowsReplay = cookieConsentAllowsReplay;
4192
5403
  exports.cookieDomainFromHostname = cookieDomainFromHostname;
5404
+ exports.countryLabel = countryLabel;
5405
+ exports.countryPickerItems = countryPickerItems;
4193
5406
  exports.createMultipartUploadController = createMultipartUploadController;
4194
5407
  exports.defaultLanguages = defaultLanguages;
4195
5408
  exports.fileMatchesAccept = fileMatchesAccept;
5409
+ exports.filterCountries = filterCountries;
5410
+ exports.formatCountryOptionLabel = formatCountryOptionLabel;
4196
5411
  exports.getAvatarColors = getAvatarColors;
4197
5412
  exports.getInitials = getInitials;
4198
5413
  exports.isCookieConsentValue = isCookieConsentValue;
4199
5414
  exports.isEmbeddedWindow = isEmbeddedWindow;
5415
+ exports.isKnownCountryCode = isKnownCountryCode;
4200
5416
  exports.matchClaimIsUnverified = matchClaimIsUnverified;
4201
5417
  exports.parseCookieConsent = parseCookieConsent;
4202
5418
  exports.partRanges = partRanges;