@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 +1545 -329
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +111 -70
- package/dist/index.d.ts +111 -70
- package/dist/index.js +1444 -254
- package/dist/index.js.map +1 -1
- package/dist/ui/combobox.d.ts +1 -0
- package/dist/ui/combobox.js +4 -0
- package/dist/ui/combobox.js.map +1 -0
- package/package.json +5 -1
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { createContext, useContext, cloneElement, useState, useRef, useEffect, useId, useCallback, useLayoutEffect } from 'react';
|
|
3
4
|
import { Skeleton } from './ui/skeleton.js';
|
|
4
5
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
5
|
-
import { Loader2, AlertTriangle, Inbox,
|
|
6
|
+
import { Loader2, AlertTriangle, Inbox, ChevronsUpDown, UserRound, LogOut, Bell, Moon, Sun, Monitor, Languages, XIcon, ChevronDownIcon, CheckIcon, Upload, Move, ZoomOut, ZoomIn, RotateCcw, RotateCw, Grid3X3, RefreshCw, X, User, Pencil, Check, Pause, Play, BarChart3 } from 'lucide-react';
|
|
6
7
|
import { clsx } from 'clsx';
|
|
7
8
|
import { twMerge } from 'tailwind-merge';
|
|
8
9
|
import { Avatar, AvatarImage, AvatarFallback } from './ui/avatar.js';
|
|
9
10
|
import { Button } from './ui/button.js';
|
|
10
|
-
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent,
|
|
11
|
+
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuItem, miniMenuContentClassName, miniMenuContentDefaults } from './ui/dropdown-menu.js';
|
|
11
12
|
import { Empty, EmptyHeader, EmptyMedia, EmptyTitle, EmptyDescription, EmptyContent } from './ui/empty.js';
|
|
12
|
-
import { useTheme } from 'next-themes';
|
|
13
13
|
import { Separator } from './ui/separator.js';
|
|
14
14
|
import { SidebarProvider, Sidebar, SidebarHeader, SidebarContent, SidebarFooter, SidebarRail, SidebarInset, SidebarTrigger, useSidebar, SidebarMenu, SidebarMenuItem, SidebarMenuButton, SidebarGroup, SidebarGroupLabel, SidebarGroupContent } from './ui/sidebar.js';
|
|
15
15
|
import { Table, TableHeader, TableRow, TableHead, TableBody, TableCell } from './ui/table.js';
|
|
@@ -17,6 +17,8 @@ import { TooltipProvider } from './ui/tooltip.js';
|
|
|
17
17
|
import { Card, CardHeader, CardContent } from './ui/card.js';
|
|
18
18
|
import { cva } from 'class-variance-authority';
|
|
19
19
|
import { AlertDialog, AlertDialogContent, AlertDialogHeader, AlertDialogTitle, AlertDialogDescription, AlertDialogFooter, AlertDialogCancel, AlertDialogAction } from './ui/alert-dialog.js';
|
|
20
|
+
import { useTheme } from 'next-themes';
|
|
21
|
+
import { Combobox } from './ui/combobox.js';
|
|
20
22
|
import { Slider } from './ui/slider.js';
|
|
21
23
|
import { Toggle } from './ui/toggle.js';
|
|
22
24
|
import { DialogClose, Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from './ui/dialog.js';
|
|
@@ -244,206 +246,6 @@ function EmptyState({
|
|
|
244
246
|
}
|
|
245
247
|
);
|
|
246
248
|
}
|
|
247
|
-
var defaultLanguages = [
|
|
248
|
-
{ key: "es-MX", label: "ES", nativeName: "Espa\xF1ol (M\xE9xico)" },
|
|
249
|
-
{ key: "en", label: "EN", nativeName: "English" }
|
|
250
|
-
];
|
|
251
|
-
var sizeClasses = {
|
|
252
|
-
sm: { button: "size-8", icon: "size-4" },
|
|
253
|
-
md: { button: "size-8", icon: "size-4" },
|
|
254
|
-
lg: { button: "size-9", icon: "size-4" }
|
|
255
|
-
};
|
|
256
|
-
var shapeClasses = {
|
|
257
|
-
rounded: "rounded-md",
|
|
258
|
-
squared: "rounded-sm",
|
|
259
|
-
pill: "rounded-full"
|
|
260
|
-
};
|
|
261
|
-
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";
|
|
262
|
-
function LanguageSwitcher({
|
|
263
|
-
languages: propLanguages,
|
|
264
|
-
currentLanguage: propCurrentLanguage,
|
|
265
|
-
onLanguageChange: propOnLanguageChange,
|
|
266
|
-
labels = {},
|
|
267
|
-
className,
|
|
268
|
-
size = "sm",
|
|
269
|
-
shape = "rounded",
|
|
270
|
-
align = "end",
|
|
271
|
-
side = "bottom"
|
|
272
|
-
}) {
|
|
273
|
-
const context = useLanguageContext();
|
|
274
|
-
const contextLanguages = context?.languages?.map((lang) => ({
|
|
275
|
-
key: lang.code,
|
|
276
|
-
label: lang.code.toUpperCase(),
|
|
277
|
-
nativeName: lang.name
|
|
278
|
-
}));
|
|
279
|
-
const languages = propLanguages ?? contextLanguages ?? defaultLanguages;
|
|
280
|
-
const currentLanguage = propCurrentLanguage ?? context?.language ?? "en";
|
|
281
|
-
const onLanguageChange = propOnLanguageChange ?? context?.setLanguage;
|
|
282
|
-
const sizes = sizeClasses[size];
|
|
283
|
-
const shapeClass = shapeClasses[shape];
|
|
284
|
-
const accessibleName = labels.language ?? "Language";
|
|
285
|
-
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
286
|
-
/* @__PURE__ */ jsx(
|
|
287
|
-
DropdownMenuTrigger,
|
|
288
|
-
{
|
|
289
|
-
render: /* @__PURE__ */ jsx(
|
|
290
|
-
Button,
|
|
291
|
-
{
|
|
292
|
-
variant: "outline",
|
|
293
|
-
size: "icon",
|
|
294
|
-
"aria-label": accessibleName,
|
|
295
|
-
className: cn(
|
|
296
|
-
sizes.button,
|
|
297
|
-
shapeClass,
|
|
298
|
-
iconTriggerClassName,
|
|
299
|
-
className
|
|
300
|
-
)
|
|
301
|
-
}
|
|
302
|
-
),
|
|
303
|
-
children: /* @__PURE__ */ jsx(Languages, { className: sizes.icon })
|
|
304
|
-
}
|
|
305
|
-
),
|
|
306
|
-
/* @__PURE__ */ jsx(
|
|
307
|
-
DropdownMenuContent,
|
|
308
|
-
{
|
|
309
|
-
side,
|
|
310
|
-
align,
|
|
311
|
-
sideOffset: miniMenuContentDefaults.sideOffset,
|
|
312
|
-
collisionPadding: miniMenuContentDefaults.collisionPadding,
|
|
313
|
-
className: cn(miniMenuContentClassName, "min-w-0 w-auto"),
|
|
314
|
-
children: languages.map(({ key, nativeName }) => /* @__PURE__ */ jsx(
|
|
315
|
-
DropdownMenuItem,
|
|
316
|
-
{
|
|
317
|
-
onClick: () => onLanguageChange?.(key),
|
|
318
|
-
className: cn(
|
|
319
|
-
"justify-center text-xs font-semibold cursor-pointer px-3",
|
|
320
|
-
currentLanguage === key && "bg-accent text-accent-foreground"
|
|
321
|
-
),
|
|
322
|
-
children: nativeName
|
|
323
|
-
},
|
|
324
|
-
key
|
|
325
|
-
))
|
|
326
|
-
}
|
|
327
|
-
)
|
|
328
|
-
] });
|
|
329
|
-
}
|
|
330
|
-
var defaultLabels = {
|
|
331
|
-
theme: "Theme",
|
|
332
|
-
system: "System",
|
|
333
|
-
light: "Light",
|
|
334
|
-
dark: "Dark"
|
|
335
|
-
};
|
|
336
|
-
var sizeClasses2 = {
|
|
337
|
-
sm: { button: "size-8", icon: "size-4" },
|
|
338
|
-
md: { button: "size-8", icon: "size-4" },
|
|
339
|
-
lg: { button: "size-9", icon: "size-4" }
|
|
340
|
-
};
|
|
341
|
-
var shapeClasses2 = {
|
|
342
|
-
rounded: "rounded-md",
|
|
343
|
-
pill: "rounded-full"
|
|
344
|
-
};
|
|
345
|
-
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";
|
|
346
|
-
var themeIcons = {
|
|
347
|
-
system: Monitor,
|
|
348
|
-
light: Sun,
|
|
349
|
-
dark: Moon
|
|
350
|
-
};
|
|
351
|
-
var themes = [
|
|
352
|
-
{ key: "system", icon: themeIcons.system },
|
|
353
|
-
{ key: "light", icon: themeIcons.light },
|
|
354
|
-
{ key: "dark", icon: themeIcons.dark }
|
|
355
|
-
];
|
|
356
|
-
function storedTheme(value) {
|
|
357
|
-
if (value === "system" || value === "light" || value === "dark") return value;
|
|
358
|
-
return void 0;
|
|
359
|
-
}
|
|
360
|
-
function ThemeSwitcher({
|
|
361
|
-
className,
|
|
362
|
-
size = "sm",
|
|
363
|
-
shape = "rounded",
|
|
364
|
-
align = "end",
|
|
365
|
-
side = "bottom",
|
|
366
|
-
labels: userLabels
|
|
367
|
-
}) {
|
|
368
|
-
const { theme, setTheme } = useTheme();
|
|
369
|
-
const [mounted, setMounted] = useState(false);
|
|
370
|
-
const sizes = sizeClasses2[size];
|
|
371
|
-
const shapeClass = shapeClasses2[shape];
|
|
372
|
-
const labels = { ...defaultLabels, ...userLabels };
|
|
373
|
-
const handleThemeClick = useCallback(
|
|
374
|
-
(themeKey) => {
|
|
375
|
-
setTheme(themeKey);
|
|
376
|
-
},
|
|
377
|
-
[setTheme]
|
|
378
|
-
);
|
|
379
|
-
useEffect(() => {
|
|
380
|
-
setMounted(true);
|
|
381
|
-
}, []);
|
|
382
|
-
if (!mounted) {
|
|
383
|
-
return /* @__PURE__ */ jsx(
|
|
384
|
-
"div",
|
|
385
|
-
{
|
|
386
|
-
"aria-hidden": true,
|
|
387
|
-
className: cn(
|
|
388
|
-
sizes.button,
|
|
389
|
-
shapeClass,
|
|
390
|
-
iconTriggerClassName2,
|
|
391
|
-
className
|
|
392
|
-
)
|
|
393
|
-
}
|
|
394
|
-
);
|
|
395
|
-
}
|
|
396
|
-
const currentTheme = storedTheme(theme);
|
|
397
|
-
const TriggerIcon = currentTheme ? themeIcons[currentTheme] : Monitor;
|
|
398
|
-
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
399
|
-
/* @__PURE__ */ jsx(
|
|
400
|
-
DropdownMenuTrigger,
|
|
401
|
-
{
|
|
402
|
-
render: /* @__PURE__ */ jsx(
|
|
403
|
-
Button,
|
|
404
|
-
{
|
|
405
|
-
"data-testid": "theme-switcher",
|
|
406
|
-
variant: "outline",
|
|
407
|
-
size: "icon",
|
|
408
|
-
"aria-label": labels.theme,
|
|
409
|
-
className: cn(
|
|
410
|
-
sizes.button,
|
|
411
|
-
shapeClass,
|
|
412
|
-
iconTriggerClassName2,
|
|
413
|
-
className
|
|
414
|
-
)
|
|
415
|
-
}
|
|
416
|
-
),
|
|
417
|
-
children: /* @__PURE__ */ jsx(TriggerIcon, { className: sizes.icon })
|
|
418
|
-
}
|
|
419
|
-
),
|
|
420
|
-
/* @__PURE__ */ jsx(
|
|
421
|
-
DropdownMenuContent,
|
|
422
|
-
{
|
|
423
|
-
side,
|
|
424
|
-
align,
|
|
425
|
-
sideOffset: miniMenuContentDefaults.sideOffset,
|
|
426
|
-
collisionPadding: miniMenuContentDefaults.collisionPadding,
|
|
427
|
-
className: miniMenuContentClassName,
|
|
428
|
-
children: themes.map(({ key, icon: Icon }) => /* @__PURE__ */ jsxs(
|
|
429
|
-
DropdownMenuItem,
|
|
430
|
-
{
|
|
431
|
-
onClick: () => handleThemeClick(key),
|
|
432
|
-
className: cn(
|
|
433
|
-
"gap-2 cursor-pointer",
|
|
434
|
-
currentTheme === key && "bg-accent text-accent-foreground [&_svg]:text-accent-foreground"
|
|
435
|
-
),
|
|
436
|
-
children: [
|
|
437
|
-
/* @__PURE__ */ jsx(Icon, { className: "size-4" }),
|
|
438
|
-
/* @__PURE__ */ jsx("span", { children: labels[key] })
|
|
439
|
-
]
|
|
440
|
-
},
|
|
441
|
-
key
|
|
442
|
-
))
|
|
443
|
-
}
|
|
444
|
-
)
|
|
445
|
-
] });
|
|
446
|
-
}
|
|
447
249
|
var DATA_TABLE_ROW_CLASS = "h-14";
|
|
448
250
|
function renderShellLink({
|
|
449
251
|
href,
|
|
@@ -581,35 +383,40 @@ function NavTabs({
|
|
|
581
383
|
}
|
|
582
384
|
var accountMenuDefaults = {
|
|
583
385
|
menu: "Account menu",
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
language: "Language",
|
|
587
|
-
system: "System",
|
|
588
|
-
light: "Light",
|
|
589
|
-
dark: "Dark"
|
|
386
|
+
account: "Account",
|
|
387
|
+
signOut: "Sign out"
|
|
590
388
|
};
|
|
389
|
+
function AccountAvatar({
|
|
390
|
+
name,
|
|
391
|
+
imageSrc,
|
|
392
|
+
imageAlt
|
|
393
|
+
}) {
|
|
394
|
+
return /* @__PURE__ */ jsxs(Avatar, { className: "size-8", children: [
|
|
395
|
+
imageSrc ? /* @__PURE__ */ jsx(
|
|
396
|
+
AvatarImage,
|
|
397
|
+
{
|
|
398
|
+
src: imageSrc,
|
|
399
|
+
alt: imageAlt,
|
|
400
|
+
width: 32,
|
|
401
|
+
height: 32,
|
|
402
|
+
keepMounted: true
|
|
403
|
+
}
|
|
404
|
+
) : null,
|
|
405
|
+
/* @__PURE__ */ jsx(AvatarFallback, { style: avatarFallbackStyle(name), children: getInitials(name) })
|
|
406
|
+
] });
|
|
407
|
+
}
|
|
591
408
|
function AccountMenu({
|
|
592
409
|
name,
|
|
593
410
|
email,
|
|
594
|
-
organization,
|
|
595
411
|
imageSrc,
|
|
596
412
|
imageAlt = "",
|
|
597
413
|
labels: userLabels,
|
|
598
|
-
|
|
599
|
-
currentLanguage,
|
|
600
|
-
onLanguageChange,
|
|
414
|
+
onAccount,
|
|
601
415
|
onSignOut
|
|
602
416
|
}) {
|
|
603
417
|
const labels = { ...accountMenuDefaults, ...userLabels };
|
|
604
418
|
const { isMobile } = useSidebar();
|
|
605
419
|
const side = isMobile ? "bottom" : "right";
|
|
606
|
-
const themeLabels = {
|
|
607
|
-
theme: labels.theme,
|
|
608
|
-
system: labels.system,
|
|
609
|
-
light: labels.light,
|
|
610
|
-
dark: labels.dark
|
|
611
|
-
};
|
|
612
|
-
const languageLabels = { language: labels.language };
|
|
613
420
|
return /* @__PURE__ */ jsx(SidebarMenu, { children: /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
614
421
|
/* @__PURE__ */ jsxs(
|
|
615
422
|
DropdownMenuTrigger,
|
|
@@ -623,23 +430,17 @@ function AccountMenu({
|
|
|
623
430
|
}
|
|
624
431
|
),
|
|
625
432
|
children: [
|
|
626
|
-
/* @__PURE__ */
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
keepMounted: true
|
|
635
|
-
}
|
|
636
|
-
) : null,
|
|
637
|
-
/* @__PURE__ */ jsx(AvatarFallback, { style: avatarFallbackStyle(name), children: getInitials(name) })
|
|
638
|
-
] }),
|
|
433
|
+
/* @__PURE__ */ jsx(
|
|
434
|
+
AccountAvatar,
|
|
435
|
+
{
|
|
436
|
+
name,
|
|
437
|
+
imageSrc,
|
|
438
|
+
imageAlt
|
|
439
|
+
}
|
|
440
|
+
),
|
|
639
441
|
/* @__PURE__ */ jsxs("span", { className: "grid min-w-0 flex-1 text-left text-sm leading-tight group-data-[collapsible=icon]:hidden", children: [
|
|
640
442
|
/* @__PURE__ */ jsx("span", { className: "truncate font-medium", children: name }),
|
|
641
|
-
/* @__PURE__ */ jsx("span", { className: "truncate text-xs text-muted-foreground", children: email })
|
|
642
|
-
organization ? /* @__PURE__ */ jsx("span", { className: "truncate text-xs text-muted-foreground", children: organization }) : null
|
|
443
|
+
/* @__PURE__ */ jsx("span", { className: "truncate text-xs text-muted-foreground", children: email })
|
|
643
444
|
] }),
|
|
644
445
|
/* @__PURE__ */ jsx(ChevronsUpDown, { className: "ml-auto size-4 group-data-[collapsible=icon]:hidden" })
|
|
645
446
|
]
|
|
@@ -652,27 +453,25 @@ function AccountMenu({
|
|
|
652
453
|
align: "end",
|
|
653
454
|
className: "w-56 min-w-56",
|
|
654
455
|
children: [
|
|
655
|
-
/* @__PURE__ */
|
|
656
|
-
/* @__PURE__ */ jsx("span", { className: "block truncate font-medium", children: name }),
|
|
657
|
-
/* @__PURE__ */ jsx("span", { className: "block truncate text-xs text-muted-foreground", children: email }),
|
|
658
|
-
organization ? /* @__PURE__ */ jsx("span", { className: "block truncate text-xs text-muted-foreground", children: organization }) : null
|
|
659
|
-
] }),
|
|
660
|
-
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
661
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-1 px-1.5 py-1", children: [
|
|
662
|
-
/* @__PURE__ */ jsx(ThemeSwitcher, { labels: themeLabels, side, align: "end" }),
|
|
456
|
+
/* @__PURE__ */ jsx(DropdownMenuLabel, { className: "p-0 font-normal", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 px-1 py-1.5 text-left text-sm", children: [
|
|
663
457
|
/* @__PURE__ */ jsx(
|
|
664
|
-
|
|
458
|
+
AccountAvatar,
|
|
665
459
|
{
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
onLanguageChange,
|
|
670
|
-
side,
|
|
671
|
-
align: "end"
|
|
460
|
+
name,
|
|
461
|
+
imageSrc,
|
|
462
|
+
imageAlt
|
|
672
463
|
}
|
|
673
|
-
)
|
|
674
|
-
|
|
464
|
+
),
|
|
465
|
+
/* @__PURE__ */ jsxs("span", { className: "grid min-w-0 flex-1 text-sm leading-tight", children: [
|
|
466
|
+
/* @__PURE__ */ jsx("span", { className: "truncate font-medium", children: name }),
|
|
467
|
+
/* @__PURE__ */ jsx("span", { className: "truncate text-xs text-muted-foreground", children: email })
|
|
468
|
+
] })
|
|
469
|
+
] }) }),
|
|
675
470
|
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
471
|
+
onAccount ? /* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: onAccount, children: [
|
|
472
|
+
/* @__PURE__ */ jsx(UserRound, {}),
|
|
473
|
+
labels.account
|
|
474
|
+
] }) : null,
|
|
676
475
|
/* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: onSignOut, children: [
|
|
677
476
|
/* @__PURE__ */ jsx(LogOut, {}),
|
|
678
477
|
labels.signOut
|
|
@@ -1699,6 +1498,1397 @@ function SafeImage({
|
|
|
1699
1498
|
}
|
|
1700
1499
|
);
|
|
1701
1500
|
}
|
|
1501
|
+
var defaultLabels = {
|
|
1502
|
+
theme: "Theme",
|
|
1503
|
+
system: "System",
|
|
1504
|
+
light: "Light",
|
|
1505
|
+
dark: "Dark"
|
|
1506
|
+
};
|
|
1507
|
+
var sizeClasses = {
|
|
1508
|
+
sm: { button: "size-8", icon: "size-4" },
|
|
1509
|
+
md: { button: "size-8", icon: "size-4" },
|
|
1510
|
+
lg: { button: "size-9", icon: "size-4" }
|
|
1511
|
+
};
|
|
1512
|
+
var shapeClasses = {
|
|
1513
|
+
rounded: "rounded-md",
|
|
1514
|
+
pill: "rounded-full"
|
|
1515
|
+
};
|
|
1516
|
+
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";
|
|
1517
|
+
var themeIcons = {
|
|
1518
|
+
system: Monitor,
|
|
1519
|
+
light: Sun,
|
|
1520
|
+
dark: Moon
|
|
1521
|
+
};
|
|
1522
|
+
var themes = [
|
|
1523
|
+
{ key: "system", icon: themeIcons.system },
|
|
1524
|
+
{ key: "light", icon: themeIcons.light },
|
|
1525
|
+
{ key: "dark", icon: themeIcons.dark }
|
|
1526
|
+
];
|
|
1527
|
+
function storedTheme(value) {
|
|
1528
|
+
if (value === "system" || value === "light" || value === "dark") return value;
|
|
1529
|
+
return void 0;
|
|
1530
|
+
}
|
|
1531
|
+
function ThemeSwitcher({
|
|
1532
|
+
className,
|
|
1533
|
+
size = "sm",
|
|
1534
|
+
shape = "rounded",
|
|
1535
|
+
align = "end",
|
|
1536
|
+
side = "bottom",
|
|
1537
|
+
labels: userLabels
|
|
1538
|
+
}) {
|
|
1539
|
+
const { theme, setTheme } = useTheme();
|
|
1540
|
+
const [mounted, setMounted] = useState(false);
|
|
1541
|
+
const sizes = sizeClasses[size];
|
|
1542
|
+
const shapeClass = shapeClasses[shape];
|
|
1543
|
+
const labels = { ...defaultLabels, ...userLabels };
|
|
1544
|
+
const handleThemeClick = useCallback(
|
|
1545
|
+
(themeKey) => {
|
|
1546
|
+
setTheme(themeKey);
|
|
1547
|
+
},
|
|
1548
|
+
[setTheme]
|
|
1549
|
+
);
|
|
1550
|
+
useEffect(() => {
|
|
1551
|
+
setMounted(true);
|
|
1552
|
+
}, []);
|
|
1553
|
+
if (!mounted) {
|
|
1554
|
+
return /* @__PURE__ */ jsx(
|
|
1555
|
+
"div",
|
|
1556
|
+
{
|
|
1557
|
+
"aria-hidden": true,
|
|
1558
|
+
className: cn(
|
|
1559
|
+
sizes.button,
|
|
1560
|
+
shapeClass,
|
|
1561
|
+
iconTriggerClassName,
|
|
1562
|
+
className
|
|
1563
|
+
)
|
|
1564
|
+
}
|
|
1565
|
+
);
|
|
1566
|
+
}
|
|
1567
|
+
const currentTheme = storedTheme(theme);
|
|
1568
|
+
const TriggerIcon = currentTheme ? themeIcons[currentTheme] : Monitor;
|
|
1569
|
+
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
1570
|
+
/* @__PURE__ */ jsx(
|
|
1571
|
+
DropdownMenuTrigger,
|
|
1572
|
+
{
|
|
1573
|
+
render: /* @__PURE__ */ jsx(
|
|
1574
|
+
Button,
|
|
1575
|
+
{
|
|
1576
|
+
"data-testid": "theme-switcher",
|
|
1577
|
+
variant: "outline",
|
|
1578
|
+
size: "icon",
|
|
1579
|
+
"aria-label": labels.theme,
|
|
1580
|
+
className: cn(
|
|
1581
|
+
sizes.button,
|
|
1582
|
+
shapeClass,
|
|
1583
|
+
iconTriggerClassName,
|
|
1584
|
+
className
|
|
1585
|
+
)
|
|
1586
|
+
}
|
|
1587
|
+
),
|
|
1588
|
+
children: /* @__PURE__ */ jsx(TriggerIcon, { className: sizes.icon })
|
|
1589
|
+
}
|
|
1590
|
+
),
|
|
1591
|
+
/* @__PURE__ */ jsx(
|
|
1592
|
+
DropdownMenuContent,
|
|
1593
|
+
{
|
|
1594
|
+
side,
|
|
1595
|
+
align,
|
|
1596
|
+
sideOffset: miniMenuContentDefaults.sideOffset,
|
|
1597
|
+
collisionPadding: miniMenuContentDefaults.collisionPadding,
|
|
1598
|
+
className: miniMenuContentClassName,
|
|
1599
|
+
children: themes.map(({ key, icon: Icon }) => /* @__PURE__ */ jsxs(
|
|
1600
|
+
DropdownMenuItem,
|
|
1601
|
+
{
|
|
1602
|
+
onClick: () => handleThemeClick(key),
|
|
1603
|
+
className: cn(
|
|
1604
|
+
"gap-2 cursor-pointer",
|
|
1605
|
+
currentTheme === key && "bg-accent text-accent-foreground [&_svg]:text-accent-foreground"
|
|
1606
|
+
),
|
|
1607
|
+
children: [
|
|
1608
|
+
/* @__PURE__ */ jsx(Icon, { className: "size-4" }),
|
|
1609
|
+
/* @__PURE__ */ jsx("span", { children: labels[key] })
|
|
1610
|
+
]
|
|
1611
|
+
},
|
|
1612
|
+
key
|
|
1613
|
+
))
|
|
1614
|
+
}
|
|
1615
|
+
)
|
|
1616
|
+
] });
|
|
1617
|
+
}
|
|
1618
|
+
var defaultLanguages = [
|
|
1619
|
+
{ key: "es-MX", label: "ES", nativeName: "Espa\xF1ol (M\xE9xico)" },
|
|
1620
|
+
{ key: "en", label: "EN", nativeName: "English" }
|
|
1621
|
+
];
|
|
1622
|
+
var sizeClasses2 = {
|
|
1623
|
+
sm: { button: "size-8", icon: "size-4" },
|
|
1624
|
+
md: { button: "size-8", icon: "size-4" },
|
|
1625
|
+
lg: { button: "size-9", icon: "size-4" }
|
|
1626
|
+
};
|
|
1627
|
+
var shapeClasses2 = {
|
|
1628
|
+
rounded: "rounded-md",
|
|
1629
|
+
squared: "rounded-sm",
|
|
1630
|
+
pill: "rounded-full"
|
|
1631
|
+
};
|
|
1632
|
+
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";
|
|
1633
|
+
function LanguageSwitcher({
|
|
1634
|
+
languages: propLanguages,
|
|
1635
|
+
currentLanguage: propCurrentLanguage,
|
|
1636
|
+
onLanguageChange: propOnLanguageChange,
|
|
1637
|
+
labels = {},
|
|
1638
|
+
className,
|
|
1639
|
+
size = "sm",
|
|
1640
|
+
shape = "rounded",
|
|
1641
|
+
align = "end",
|
|
1642
|
+
side = "bottom"
|
|
1643
|
+
}) {
|
|
1644
|
+
const context = useLanguageContext();
|
|
1645
|
+
const contextLanguages = context?.languages?.map((lang) => ({
|
|
1646
|
+
key: lang.code,
|
|
1647
|
+
label: lang.code.toUpperCase(),
|
|
1648
|
+
nativeName: lang.name
|
|
1649
|
+
}));
|
|
1650
|
+
const languages = propLanguages ?? contextLanguages ?? defaultLanguages;
|
|
1651
|
+
const currentLanguage = propCurrentLanguage ?? context?.language ?? "en";
|
|
1652
|
+
const onLanguageChange = propOnLanguageChange ?? context?.setLanguage;
|
|
1653
|
+
const sizes = sizeClasses2[size];
|
|
1654
|
+
const shapeClass = shapeClasses2[shape];
|
|
1655
|
+
const accessibleName = labels.language ?? "Language";
|
|
1656
|
+
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
1657
|
+
/* @__PURE__ */ jsx(
|
|
1658
|
+
DropdownMenuTrigger,
|
|
1659
|
+
{
|
|
1660
|
+
render: /* @__PURE__ */ jsx(
|
|
1661
|
+
Button,
|
|
1662
|
+
{
|
|
1663
|
+
variant: "outline",
|
|
1664
|
+
size: "icon",
|
|
1665
|
+
"aria-label": accessibleName,
|
|
1666
|
+
className: cn(
|
|
1667
|
+
sizes.button,
|
|
1668
|
+
shapeClass,
|
|
1669
|
+
iconTriggerClassName2,
|
|
1670
|
+
className
|
|
1671
|
+
)
|
|
1672
|
+
}
|
|
1673
|
+
),
|
|
1674
|
+
children: /* @__PURE__ */ jsx(Languages, { className: sizes.icon })
|
|
1675
|
+
}
|
|
1676
|
+
),
|
|
1677
|
+
/* @__PURE__ */ jsx(
|
|
1678
|
+
DropdownMenuContent,
|
|
1679
|
+
{
|
|
1680
|
+
side,
|
|
1681
|
+
align,
|
|
1682
|
+
sideOffset: miniMenuContentDefaults.sideOffset,
|
|
1683
|
+
collisionPadding: miniMenuContentDefaults.collisionPadding,
|
|
1684
|
+
className: cn(miniMenuContentClassName, "min-w-0 w-auto"),
|
|
1685
|
+
children: languages.map(({ key, nativeName }) => /* @__PURE__ */ jsx(
|
|
1686
|
+
DropdownMenuItem,
|
|
1687
|
+
{
|
|
1688
|
+
onClick: () => onLanguageChange?.(key),
|
|
1689
|
+
className: cn(
|
|
1690
|
+
"justify-center text-xs font-semibold cursor-pointer px-3",
|
|
1691
|
+
currentLanguage === key && "bg-accent text-accent-foreground"
|
|
1692
|
+
),
|
|
1693
|
+
children: nativeName
|
|
1694
|
+
},
|
|
1695
|
+
key
|
|
1696
|
+
))
|
|
1697
|
+
}
|
|
1698
|
+
)
|
|
1699
|
+
] });
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1702
|
+
// src/data/countries.json
|
|
1703
|
+
var countries_default = [
|
|
1704
|
+
{
|
|
1705
|
+
code: "AF",
|
|
1706
|
+
labelEs: "AFGANISTAN"
|
|
1707
|
+
},
|
|
1708
|
+
{
|
|
1709
|
+
code: "AL",
|
|
1710
|
+
labelEs: "ALBANIA"
|
|
1711
|
+
},
|
|
1712
|
+
{
|
|
1713
|
+
code: "DE",
|
|
1714
|
+
labelEs: "ALEMANIA"
|
|
1715
|
+
},
|
|
1716
|
+
{
|
|
1717
|
+
code: "AD",
|
|
1718
|
+
labelEs: "ANDORRA"
|
|
1719
|
+
},
|
|
1720
|
+
{
|
|
1721
|
+
code: "AO",
|
|
1722
|
+
labelEs: "ANGOLA"
|
|
1723
|
+
},
|
|
1724
|
+
{
|
|
1725
|
+
code: "AI",
|
|
1726
|
+
labelEs: "ANGUILA"
|
|
1727
|
+
},
|
|
1728
|
+
{
|
|
1729
|
+
code: "AQ",
|
|
1730
|
+
labelEs: "ANTARTIDA"
|
|
1731
|
+
},
|
|
1732
|
+
{
|
|
1733
|
+
code: "AG",
|
|
1734
|
+
labelEs: "ANTIGUA Y BARBUDA"
|
|
1735
|
+
},
|
|
1736
|
+
{
|
|
1737
|
+
code: "AN",
|
|
1738
|
+
labelEs: "ANTILLAS NEERLANDESAS"
|
|
1739
|
+
},
|
|
1740
|
+
{
|
|
1741
|
+
code: "SA",
|
|
1742
|
+
labelEs: "ARABIA SAUDI"
|
|
1743
|
+
},
|
|
1744
|
+
{
|
|
1745
|
+
code: "DZ",
|
|
1746
|
+
labelEs: "ARGELIA"
|
|
1747
|
+
},
|
|
1748
|
+
{
|
|
1749
|
+
code: "AR",
|
|
1750
|
+
labelEs: "ARGENTINA"
|
|
1751
|
+
},
|
|
1752
|
+
{
|
|
1753
|
+
code: "AM",
|
|
1754
|
+
labelEs: "ARMENIA"
|
|
1755
|
+
},
|
|
1756
|
+
{
|
|
1757
|
+
code: "AW",
|
|
1758
|
+
labelEs: "ARUBA"
|
|
1759
|
+
},
|
|
1760
|
+
{
|
|
1761
|
+
code: "AU",
|
|
1762
|
+
labelEs: "AUSTRALIA"
|
|
1763
|
+
},
|
|
1764
|
+
{
|
|
1765
|
+
code: "AT",
|
|
1766
|
+
labelEs: "AUSTRIA"
|
|
1767
|
+
},
|
|
1768
|
+
{
|
|
1769
|
+
code: "AZ",
|
|
1770
|
+
labelEs: "AZERBAIYAN"
|
|
1771
|
+
},
|
|
1772
|
+
{
|
|
1773
|
+
code: "BS",
|
|
1774
|
+
labelEs: "BAHAMAS"
|
|
1775
|
+
},
|
|
1776
|
+
{
|
|
1777
|
+
code: "BH",
|
|
1778
|
+
labelEs: "BAHREIN"
|
|
1779
|
+
},
|
|
1780
|
+
{
|
|
1781
|
+
code: "BD",
|
|
1782
|
+
labelEs: "BANGLADESH"
|
|
1783
|
+
},
|
|
1784
|
+
{
|
|
1785
|
+
code: "BB",
|
|
1786
|
+
labelEs: "BARBADOS"
|
|
1787
|
+
},
|
|
1788
|
+
{
|
|
1789
|
+
code: "BY",
|
|
1790
|
+
labelEs: "BELARUS"
|
|
1791
|
+
},
|
|
1792
|
+
{
|
|
1793
|
+
code: "BE",
|
|
1794
|
+
labelEs: "BELGICA"
|
|
1795
|
+
},
|
|
1796
|
+
{
|
|
1797
|
+
code: "BZ",
|
|
1798
|
+
labelEs: "BELICE"
|
|
1799
|
+
},
|
|
1800
|
+
{
|
|
1801
|
+
code: "BJ",
|
|
1802
|
+
labelEs: "BENIN"
|
|
1803
|
+
},
|
|
1804
|
+
{
|
|
1805
|
+
code: "BM",
|
|
1806
|
+
labelEs: "BERMUDAS"
|
|
1807
|
+
},
|
|
1808
|
+
{
|
|
1809
|
+
code: "BT",
|
|
1810
|
+
labelEs: "BHUTAN"
|
|
1811
|
+
},
|
|
1812
|
+
{
|
|
1813
|
+
code: "BO",
|
|
1814
|
+
labelEs: "BOLIVIA"
|
|
1815
|
+
},
|
|
1816
|
+
{
|
|
1817
|
+
code: "BA",
|
|
1818
|
+
labelEs: "BOSNIA Y HERZEGOVINA"
|
|
1819
|
+
},
|
|
1820
|
+
{
|
|
1821
|
+
code: "BW",
|
|
1822
|
+
labelEs: "BOTSUANA"
|
|
1823
|
+
},
|
|
1824
|
+
{
|
|
1825
|
+
code: "BR",
|
|
1826
|
+
labelEs: "BRASIL"
|
|
1827
|
+
},
|
|
1828
|
+
{
|
|
1829
|
+
code: "BN",
|
|
1830
|
+
labelEs: "BRUNEI"
|
|
1831
|
+
},
|
|
1832
|
+
{
|
|
1833
|
+
code: "BG",
|
|
1834
|
+
labelEs: "BULGARIA"
|
|
1835
|
+
},
|
|
1836
|
+
{
|
|
1837
|
+
code: "BF",
|
|
1838
|
+
labelEs: "BURKINA FASO"
|
|
1839
|
+
},
|
|
1840
|
+
{
|
|
1841
|
+
code: "BI",
|
|
1842
|
+
labelEs: "BURUNDI"
|
|
1843
|
+
},
|
|
1844
|
+
{
|
|
1845
|
+
code: "CV",
|
|
1846
|
+
labelEs: "CABO VERDE"
|
|
1847
|
+
},
|
|
1848
|
+
{
|
|
1849
|
+
code: "KH",
|
|
1850
|
+
labelEs: "CAMBOYA"
|
|
1851
|
+
},
|
|
1852
|
+
{
|
|
1853
|
+
code: "CM",
|
|
1854
|
+
labelEs: "CAMERUN"
|
|
1855
|
+
},
|
|
1856
|
+
{
|
|
1857
|
+
code: "CA",
|
|
1858
|
+
labelEs: "CANADA"
|
|
1859
|
+
},
|
|
1860
|
+
{
|
|
1861
|
+
code: "TD",
|
|
1862
|
+
labelEs: "CHAD"
|
|
1863
|
+
},
|
|
1864
|
+
{
|
|
1865
|
+
code: "CZ",
|
|
1866
|
+
labelEs: "CHEQUIA"
|
|
1867
|
+
},
|
|
1868
|
+
{
|
|
1869
|
+
code: "CL",
|
|
1870
|
+
labelEs: "CHILE"
|
|
1871
|
+
},
|
|
1872
|
+
{
|
|
1873
|
+
code: "CN",
|
|
1874
|
+
labelEs: "CHINA"
|
|
1875
|
+
},
|
|
1876
|
+
{
|
|
1877
|
+
code: "CY",
|
|
1878
|
+
labelEs: "CHIPRE"
|
|
1879
|
+
},
|
|
1880
|
+
{
|
|
1881
|
+
code: "CP",
|
|
1882
|
+
labelEs: "CLIPPERTON"
|
|
1883
|
+
},
|
|
1884
|
+
{
|
|
1885
|
+
code: "CO",
|
|
1886
|
+
labelEs: "COLOMBIA"
|
|
1887
|
+
},
|
|
1888
|
+
{
|
|
1889
|
+
code: "KM",
|
|
1890
|
+
labelEs: "COMORAS"
|
|
1891
|
+
},
|
|
1892
|
+
{
|
|
1893
|
+
code: "CG",
|
|
1894
|
+
labelEs: "CONGO"
|
|
1895
|
+
},
|
|
1896
|
+
{
|
|
1897
|
+
code: "KP",
|
|
1898
|
+
labelEs: "COREA DEL NORTE"
|
|
1899
|
+
},
|
|
1900
|
+
{
|
|
1901
|
+
code: "KR",
|
|
1902
|
+
labelEs: "COREA DEL SUR"
|
|
1903
|
+
},
|
|
1904
|
+
{
|
|
1905
|
+
code: "CI",
|
|
1906
|
+
labelEs: "COSTA DE MARFIL"
|
|
1907
|
+
},
|
|
1908
|
+
{
|
|
1909
|
+
code: "CR",
|
|
1910
|
+
labelEs: "COSTA RICA"
|
|
1911
|
+
},
|
|
1912
|
+
{
|
|
1913
|
+
code: "HR",
|
|
1914
|
+
labelEs: "CROACIA"
|
|
1915
|
+
},
|
|
1916
|
+
{
|
|
1917
|
+
code: "CU",
|
|
1918
|
+
labelEs: "CUBA"
|
|
1919
|
+
},
|
|
1920
|
+
{
|
|
1921
|
+
code: "CW",
|
|
1922
|
+
labelEs: "CURAZAO"
|
|
1923
|
+
},
|
|
1924
|
+
{
|
|
1925
|
+
code: "DK",
|
|
1926
|
+
labelEs: "DINAMARCA"
|
|
1927
|
+
},
|
|
1928
|
+
{
|
|
1929
|
+
code: "DM",
|
|
1930
|
+
labelEs: "DOMINICA"
|
|
1931
|
+
},
|
|
1932
|
+
{
|
|
1933
|
+
code: "EC",
|
|
1934
|
+
labelEs: "ECUADOR"
|
|
1935
|
+
},
|
|
1936
|
+
{
|
|
1937
|
+
code: "EG",
|
|
1938
|
+
labelEs: "EGIPTO"
|
|
1939
|
+
},
|
|
1940
|
+
{
|
|
1941
|
+
code: "SV",
|
|
1942
|
+
labelEs: "EL SALVADOR"
|
|
1943
|
+
},
|
|
1944
|
+
{
|
|
1945
|
+
code: "AE",
|
|
1946
|
+
labelEs: "EMIRATOS ARABES UNIDOS"
|
|
1947
|
+
},
|
|
1948
|
+
{
|
|
1949
|
+
code: "ER",
|
|
1950
|
+
labelEs: "ERITREA"
|
|
1951
|
+
},
|
|
1952
|
+
{
|
|
1953
|
+
code: "SK",
|
|
1954
|
+
labelEs: "ESLOVAQUIA"
|
|
1955
|
+
},
|
|
1956
|
+
{
|
|
1957
|
+
code: "SI",
|
|
1958
|
+
labelEs: "ESLOVENIA"
|
|
1959
|
+
},
|
|
1960
|
+
{
|
|
1961
|
+
code: "ES",
|
|
1962
|
+
labelEs: "ESPA\xD1A"
|
|
1963
|
+
},
|
|
1964
|
+
{
|
|
1965
|
+
code: "US",
|
|
1966
|
+
labelEs: "ESTADOS UNIDOS"
|
|
1967
|
+
},
|
|
1968
|
+
{
|
|
1969
|
+
code: "EE",
|
|
1970
|
+
labelEs: "ESTONIA"
|
|
1971
|
+
},
|
|
1972
|
+
{
|
|
1973
|
+
code: "ET",
|
|
1974
|
+
labelEs: "ETIOPIA"
|
|
1975
|
+
},
|
|
1976
|
+
{
|
|
1977
|
+
code: "PH",
|
|
1978
|
+
labelEs: "FILIPINAS"
|
|
1979
|
+
},
|
|
1980
|
+
{
|
|
1981
|
+
code: "FI",
|
|
1982
|
+
labelEs: "FINLANDIA"
|
|
1983
|
+
},
|
|
1984
|
+
{
|
|
1985
|
+
code: "FJ",
|
|
1986
|
+
labelEs: "FIYI"
|
|
1987
|
+
},
|
|
1988
|
+
{
|
|
1989
|
+
code: "FR",
|
|
1990
|
+
labelEs: "FRANCIA"
|
|
1991
|
+
},
|
|
1992
|
+
{
|
|
1993
|
+
code: "GA",
|
|
1994
|
+
labelEs: "GABON"
|
|
1995
|
+
},
|
|
1996
|
+
{
|
|
1997
|
+
code: "GM",
|
|
1998
|
+
labelEs: "GAMBIA"
|
|
1999
|
+
},
|
|
2000
|
+
{
|
|
2001
|
+
code: "GE",
|
|
2002
|
+
labelEs: "GEORGIA"
|
|
2003
|
+
},
|
|
2004
|
+
{
|
|
2005
|
+
code: "GS",
|
|
2006
|
+
labelEs: "GEORGIA DEL SUR E ISLAS SANDWICH DEL SUR"
|
|
2007
|
+
},
|
|
2008
|
+
{
|
|
2009
|
+
code: "GH",
|
|
2010
|
+
labelEs: "GHANA"
|
|
2011
|
+
},
|
|
2012
|
+
{
|
|
2013
|
+
code: "GI",
|
|
2014
|
+
labelEs: "GIBRALTAR"
|
|
2015
|
+
},
|
|
2016
|
+
{
|
|
2017
|
+
code: "GD",
|
|
2018
|
+
labelEs: "GRANADA"
|
|
2019
|
+
},
|
|
2020
|
+
{
|
|
2021
|
+
code: "EL",
|
|
2022
|
+
labelEs: "GRECIA"
|
|
2023
|
+
},
|
|
2024
|
+
{
|
|
2025
|
+
code: "GL",
|
|
2026
|
+
labelEs: "GROENLANDIA"
|
|
2027
|
+
},
|
|
2028
|
+
{
|
|
2029
|
+
code: "GP",
|
|
2030
|
+
labelEs: "GUADALUPE"
|
|
2031
|
+
},
|
|
2032
|
+
{
|
|
2033
|
+
code: "GU",
|
|
2034
|
+
labelEs: "GUAM"
|
|
2035
|
+
},
|
|
2036
|
+
{
|
|
2037
|
+
code: "GT",
|
|
2038
|
+
labelEs: "GUATEMALA"
|
|
2039
|
+
},
|
|
2040
|
+
{
|
|
2041
|
+
code: "GF",
|
|
2042
|
+
labelEs: "GUAYANA FRANCESA"
|
|
2043
|
+
},
|
|
2044
|
+
{
|
|
2045
|
+
code: "GG",
|
|
2046
|
+
labelEs: "GUERNESEY"
|
|
2047
|
+
},
|
|
2048
|
+
{
|
|
2049
|
+
code: "GN",
|
|
2050
|
+
labelEs: "GUINEA"
|
|
2051
|
+
},
|
|
2052
|
+
{
|
|
2053
|
+
code: "GQ",
|
|
2054
|
+
labelEs: "GUINEA ECUATORIAL"
|
|
2055
|
+
},
|
|
2056
|
+
{
|
|
2057
|
+
code: "GW",
|
|
2058
|
+
labelEs: "GUINEA-BISSAU"
|
|
2059
|
+
},
|
|
2060
|
+
{
|
|
2061
|
+
code: "GY",
|
|
2062
|
+
labelEs: "GUYANA"
|
|
2063
|
+
},
|
|
2064
|
+
{
|
|
2065
|
+
code: "HT",
|
|
2066
|
+
labelEs: "HAITI"
|
|
2067
|
+
},
|
|
2068
|
+
{
|
|
2069
|
+
code: "HN",
|
|
2070
|
+
labelEs: "HONDURAS"
|
|
2071
|
+
},
|
|
2072
|
+
{
|
|
2073
|
+
code: "HK",
|
|
2074
|
+
labelEs: "HONG KONG"
|
|
2075
|
+
},
|
|
2076
|
+
{
|
|
2077
|
+
code: "HU",
|
|
2078
|
+
labelEs: "HUNGRIA"
|
|
2079
|
+
},
|
|
2080
|
+
{
|
|
2081
|
+
code: "IN",
|
|
2082
|
+
labelEs: "INDIA"
|
|
2083
|
+
},
|
|
2084
|
+
{
|
|
2085
|
+
code: "ID",
|
|
2086
|
+
labelEs: "INDONESIA"
|
|
2087
|
+
},
|
|
2088
|
+
{
|
|
2089
|
+
code: "IR",
|
|
2090
|
+
labelEs: "IRAN"
|
|
2091
|
+
},
|
|
2092
|
+
{
|
|
2093
|
+
code: "IQ",
|
|
2094
|
+
labelEs: "IRAQ"
|
|
2095
|
+
},
|
|
2096
|
+
{
|
|
2097
|
+
code: "IE",
|
|
2098
|
+
labelEs: "IRLANDA"
|
|
2099
|
+
},
|
|
2100
|
+
{
|
|
2101
|
+
code: "BV",
|
|
2102
|
+
labelEs: "ISLA BOUVET"
|
|
2103
|
+
},
|
|
2104
|
+
{
|
|
2105
|
+
code: "CX",
|
|
2106
|
+
labelEs: "ISLA CHRISTMAS"
|
|
2107
|
+
},
|
|
2108
|
+
{
|
|
2109
|
+
code: "IM",
|
|
2110
|
+
labelEs: "ISLA DE MAN"
|
|
2111
|
+
},
|
|
2112
|
+
{
|
|
2113
|
+
code: "NF",
|
|
2114
|
+
labelEs: "ISLA NORFOLK"
|
|
2115
|
+
},
|
|
2116
|
+
{
|
|
2117
|
+
code: "IS",
|
|
2118
|
+
labelEs: "ISLANDIA"
|
|
2119
|
+
},
|
|
2120
|
+
{
|
|
2121
|
+
code: "AX",
|
|
2122
|
+
labelEs: "ISLAS \xC5LAND"
|
|
2123
|
+
},
|
|
2124
|
+
{
|
|
2125
|
+
code: "KY",
|
|
2126
|
+
labelEs: "ISLAS CAIMAN"
|
|
2127
|
+
},
|
|
2128
|
+
{
|
|
2129
|
+
code: "CC",
|
|
2130
|
+
labelEs: "ISLAS COCOS"
|
|
2131
|
+
},
|
|
2132
|
+
{
|
|
2133
|
+
code: "CK",
|
|
2134
|
+
labelEs: "ISLAS COOK"
|
|
2135
|
+
},
|
|
2136
|
+
{
|
|
2137
|
+
code: "FO",
|
|
2138
|
+
labelEs: "ISLAS FEROE"
|
|
2139
|
+
},
|
|
2140
|
+
{
|
|
2141
|
+
code: "HM",
|
|
2142
|
+
labelEs: "ISLAS HEARD Y MCDONALD"
|
|
2143
|
+
},
|
|
2144
|
+
{
|
|
2145
|
+
code: "FK",
|
|
2146
|
+
labelEs: "ISLAS MALVINAS"
|
|
2147
|
+
},
|
|
2148
|
+
{
|
|
2149
|
+
code: "MP",
|
|
2150
|
+
labelEs: "ISLAS MARIANAS DEL NORTE"
|
|
2151
|
+
},
|
|
2152
|
+
{
|
|
2153
|
+
code: "MH",
|
|
2154
|
+
labelEs: "ISLAS MARSHALL"
|
|
2155
|
+
},
|
|
2156
|
+
{
|
|
2157
|
+
code: "UM",
|
|
2158
|
+
labelEs: "ISLAS MENORES ALEJADAS DE LOS ESTADOS UNIDOS"
|
|
2159
|
+
},
|
|
2160
|
+
{
|
|
2161
|
+
code: "PN",
|
|
2162
|
+
labelEs: "ISLAS PITCAIRN"
|
|
2163
|
+
},
|
|
2164
|
+
{
|
|
2165
|
+
code: "SB",
|
|
2166
|
+
labelEs: "ISLAS SALOMON"
|
|
2167
|
+
},
|
|
2168
|
+
{
|
|
2169
|
+
code: "TC",
|
|
2170
|
+
labelEs: "ISLAS TURCAS Y CAICOS"
|
|
2171
|
+
},
|
|
2172
|
+
{
|
|
2173
|
+
code: "VG",
|
|
2174
|
+
labelEs: "ISLAS VIRGENES BRITANICAS"
|
|
2175
|
+
},
|
|
2176
|
+
{
|
|
2177
|
+
code: "VI",
|
|
2178
|
+
labelEs: "ISLAS VIRGENES DE LOS ESTADOS UNIDOS"
|
|
2179
|
+
},
|
|
2180
|
+
{
|
|
2181
|
+
code: "IL",
|
|
2182
|
+
labelEs: "ISRAEL"
|
|
2183
|
+
},
|
|
2184
|
+
{
|
|
2185
|
+
code: "IT",
|
|
2186
|
+
labelEs: "ITALIA"
|
|
2187
|
+
},
|
|
2188
|
+
{
|
|
2189
|
+
code: "JM",
|
|
2190
|
+
labelEs: "JAMAICA"
|
|
2191
|
+
},
|
|
2192
|
+
{
|
|
2193
|
+
code: "JP",
|
|
2194
|
+
labelEs: "JAPON"
|
|
2195
|
+
},
|
|
2196
|
+
{
|
|
2197
|
+
code: "JE",
|
|
2198
|
+
labelEs: "JERSEY"
|
|
2199
|
+
},
|
|
2200
|
+
{
|
|
2201
|
+
code: "JO",
|
|
2202
|
+
labelEs: "JORDANIA"
|
|
2203
|
+
},
|
|
2204
|
+
{
|
|
2205
|
+
code: "KZ",
|
|
2206
|
+
labelEs: "KAZAJSTAN"
|
|
2207
|
+
},
|
|
2208
|
+
{
|
|
2209
|
+
code: "KE",
|
|
2210
|
+
labelEs: "KENIA"
|
|
2211
|
+
},
|
|
2212
|
+
{
|
|
2213
|
+
code: "KG",
|
|
2214
|
+
labelEs: "KIRGUISTAN"
|
|
2215
|
+
},
|
|
2216
|
+
{
|
|
2217
|
+
code: "KI",
|
|
2218
|
+
labelEs: "KIRIBATI"
|
|
2219
|
+
},
|
|
2220
|
+
{
|
|
2221
|
+
code: "XK",
|
|
2222
|
+
labelEs: "KOSOVO"
|
|
2223
|
+
},
|
|
2224
|
+
{
|
|
2225
|
+
code: "KW",
|
|
2226
|
+
labelEs: "KUWAIT"
|
|
2227
|
+
},
|
|
2228
|
+
{
|
|
2229
|
+
code: "LA",
|
|
2230
|
+
labelEs: "LAOS"
|
|
2231
|
+
},
|
|
2232
|
+
{
|
|
2233
|
+
code: "LS",
|
|
2234
|
+
labelEs: "LESOTHO"
|
|
2235
|
+
},
|
|
2236
|
+
{
|
|
2237
|
+
code: "LV",
|
|
2238
|
+
labelEs: "LETONIA"
|
|
2239
|
+
},
|
|
2240
|
+
{
|
|
2241
|
+
code: "LB",
|
|
2242
|
+
labelEs: "LIBANO"
|
|
2243
|
+
},
|
|
2244
|
+
{
|
|
2245
|
+
code: "LR",
|
|
2246
|
+
labelEs: "LIBERIA"
|
|
2247
|
+
},
|
|
2248
|
+
{
|
|
2249
|
+
code: "LY",
|
|
2250
|
+
labelEs: "LIBIA"
|
|
2251
|
+
},
|
|
2252
|
+
{
|
|
2253
|
+
code: "LI",
|
|
2254
|
+
labelEs: "LIECHTENSTEIN"
|
|
2255
|
+
},
|
|
2256
|
+
{
|
|
2257
|
+
code: "LT",
|
|
2258
|
+
labelEs: "LITUANIA"
|
|
2259
|
+
},
|
|
2260
|
+
{
|
|
2261
|
+
code: "LU",
|
|
2262
|
+
labelEs: "LUXEMBURGO"
|
|
2263
|
+
},
|
|
2264
|
+
{
|
|
2265
|
+
code: "MO",
|
|
2266
|
+
labelEs: "MACAO"
|
|
2267
|
+
},
|
|
2268
|
+
{
|
|
2269
|
+
code: "MK",
|
|
2270
|
+
labelEs: "MACEDONIA"
|
|
2271
|
+
},
|
|
2272
|
+
{
|
|
2273
|
+
code: "MG",
|
|
2274
|
+
labelEs: "MADAGASCAR"
|
|
2275
|
+
},
|
|
2276
|
+
{
|
|
2277
|
+
code: "MY",
|
|
2278
|
+
labelEs: "MALASIA"
|
|
2279
|
+
},
|
|
2280
|
+
{
|
|
2281
|
+
code: "MW",
|
|
2282
|
+
labelEs: "MALAWI"
|
|
2283
|
+
},
|
|
2284
|
+
{
|
|
2285
|
+
code: "MV",
|
|
2286
|
+
labelEs: "MALDIVAS"
|
|
2287
|
+
},
|
|
2288
|
+
{
|
|
2289
|
+
code: "ML",
|
|
2290
|
+
labelEs: "MALI"
|
|
2291
|
+
},
|
|
2292
|
+
{
|
|
2293
|
+
code: "MT",
|
|
2294
|
+
labelEs: "MALTA"
|
|
2295
|
+
},
|
|
2296
|
+
{
|
|
2297
|
+
code: "MA",
|
|
2298
|
+
labelEs: "MARRUECOS"
|
|
2299
|
+
},
|
|
2300
|
+
{
|
|
2301
|
+
code: "MQ",
|
|
2302
|
+
labelEs: "MARTINICA"
|
|
2303
|
+
},
|
|
2304
|
+
{
|
|
2305
|
+
code: "MU",
|
|
2306
|
+
labelEs: "MAURICIO"
|
|
2307
|
+
},
|
|
2308
|
+
{
|
|
2309
|
+
code: "MR",
|
|
2310
|
+
labelEs: "MAURITANIA"
|
|
2311
|
+
},
|
|
2312
|
+
{
|
|
2313
|
+
code: "YT",
|
|
2314
|
+
labelEs: "MAYOTTE"
|
|
2315
|
+
},
|
|
2316
|
+
{
|
|
2317
|
+
code: "MX",
|
|
2318
|
+
labelEs: "MEXICO"
|
|
2319
|
+
},
|
|
2320
|
+
{
|
|
2321
|
+
code: "FM",
|
|
2322
|
+
labelEs: "MICRONESIA"
|
|
2323
|
+
},
|
|
2324
|
+
{
|
|
2325
|
+
code: "MD",
|
|
2326
|
+
labelEs: "MOLDOVA"
|
|
2327
|
+
},
|
|
2328
|
+
{
|
|
2329
|
+
code: "MC",
|
|
2330
|
+
labelEs: "MONACO"
|
|
2331
|
+
},
|
|
2332
|
+
{
|
|
2333
|
+
code: "MN",
|
|
2334
|
+
labelEs: "MONGOLIA"
|
|
2335
|
+
},
|
|
2336
|
+
{
|
|
2337
|
+
code: "ME",
|
|
2338
|
+
labelEs: "MONTENEGRO"
|
|
2339
|
+
},
|
|
2340
|
+
{
|
|
2341
|
+
code: "MS",
|
|
2342
|
+
labelEs: "MONTSERRAT"
|
|
2343
|
+
},
|
|
2344
|
+
{
|
|
2345
|
+
code: "MZ",
|
|
2346
|
+
labelEs: "MOZAMBIQUE"
|
|
2347
|
+
},
|
|
2348
|
+
{
|
|
2349
|
+
code: "MM",
|
|
2350
|
+
labelEs: "MYANMAR"
|
|
2351
|
+
},
|
|
2352
|
+
{
|
|
2353
|
+
code: "NA",
|
|
2354
|
+
labelEs: "NAMIBIA"
|
|
2355
|
+
},
|
|
2356
|
+
{
|
|
2357
|
+
code: "NR",
|
|
2358
|
+
labelEs: "NAURU"
|
|
2359
|
+
},
|
|
2360
|
+
{
|
|
2361
|
+
code: "NP",
|
|
2362
|
+
labelEs: "NEPAL"
|
|
2363
|
+
},
|
|
2364
|
+
{
|
|
2365
|
+
code: "NI",
|
|
2366
|
+
labelEs: "NICARAGUA"
|
|
2367
|
+
},
|
|
2368
|
+
{
|
|
2369
|
+
code: "NE",
|
|
2370
|
+
labelEs: "NIGER"
|
|
2371
|
+
},
|
|
2372
|
+
{
|
|
2373
|
+
code: "NG",
|
|
2374
|
+
labelEs: "NIGERIA"
|
|
2375
|
+
},
|
|
2376
|
+
{
|
|
2377
|
+
code: "NU",
|
|
2378
|
+
labelEs: "NIUE"
|
|
2379
|
+
},
|
|
2380
|
+
{
|
|
2381
|
+
code: "NO",
|
|
2382
|
+
labelEs: "NORUEGA"
|
|
2383
|
+
},
|
|
2384
|
+
{
|
|
2385
|
+
code: "NC",
|
|
2386
|
+
labelEs: "NUEVA CALEDONIA"
|
|
2387
|
+
},
|
|
2388
|
+
{
|
|
2389
|
+
code: "NZ",
|
|
2390
|
+
labelEs: "NUEVA ZELANDA"
|
|
2391
|
+
},
|
|
2392
|
+
{
|
|
2393
|
+
code: "OM",
|
|
2394
|
+
labelEs: "OMAN"
|
|
2395
|
+
},
|
|
2396
|
+
{
|
|
2397
|
+
code: "NL",
|
|
2398
|
+
labelEs: "PAISES BAJOS"
|
|
2399
|
+
},
|
|
2400
|
+
{
|
|
2401
|
+
code: "PK",
|
|
2402
|
+
labelEs: "PAKISTAN"
|
|
2403
|
+
},
|
|
2404
|
+
{
|
|
2405
|
+
code: "PW",
|
|
2406
|
+
labelEs: "PALAOS"
|
|
2407
|
+
},
|
|
2408
|
+
{
|
|
2409
|
+
code: "PA",
|
|
2410
|
+
labelEs: "PANAMA"
|
|
2411
|
+
},
|
|
2412
|
+
{
|
|
2413
|
+
code: "PG",
|
|
2414
|
+
labelEs: "PAPUA NUEVA GUINEA"
|
|
2415
|
+
},
|
|
2416
|
+
{
|
|
2417
|
+
code: "PY",
|
|
2418
|
+
labelEs: "PARAGUAY"
|
|
2419
|
+
},
|
|
2420
|
+
{
|
|
2421
|
+
code: "PE",
|
|
2422
|
+
labelEs: "PERU"
|
|
2423
|
+
},
|
|
2424
|
+
{
|
|
2425
|
+
code: "PF",
|
|
2426
|
+
labelEs: "POLINESIA FRANCESA"
|
|
2427
|
+
},
|
|
2428
|
+
{
|
|
2429
|
+
code: "PL",
|
|
2430
|
+
labelEs: "POLONIA"
|
|
2431
|
+
},
|
|
2432
|
+
{
|
|
2433
|
+
code: "PT",
|
|
2434
|
+
labelEs: "PORTUGAL"
|
|
2435
|
+
},
|
|
2436
|
+
{
|
|
2437
|
+
code: "PR",
|
|
2438
|
+
labelEs: "PUERTO RICO"
|
|
2439
|
+
},
|
|
2440
|
+
{
|
|
2441
|
+
code: "QA",
|
|
2442
|
+
labelEs: "QATAR"
|
|
2443
|
+
},
|
|
2444
|
+
{
|
|
2445
|
+
code: "UK",
|
|
2446
|
+
labelEs: "REINO UNIDO"
|
|
2447
|
+
},
|
|
2448
|
+
{
|
|
2449
|
+
code: "CF",
|
|
2450
|
+
labelEs: "REPUBLICA CENTROAFRICANA"
|
|
2451
|
+
},
|
|
2452
|
+
{
|
|
2453
|
+
code: "CD",
|
|
2454
|
+
labelEs: "REPUBLICA DEMOCRATICA DEL CONGO"
|
|
2455
|
+
},
|
|
2456
|
+
{
|
|
2457
|
+
code: "DO",
|
|
2458
|
+
labelEs: "REPUBLICA DOMINICANA"
|
|
2459
|
+
},
|
|
2460
|
+
{
|
|
2461
|
+
code: "RE",
|
|
2462
|
+
labelEs: "REUNION"
|
|
2463
|
+
},
|
|
2464
|
+
{
|
|
2465
|
+
code: "RW",
|
|
2466
|
+
labelEs: "RUANDA"
|
|
2467
|
+
},
|
|
2468
|
+
{
|
|
2469
|
+
code: "RO",
|
|
2470
|
+
labelEs: "RUMANIA"
|
|
2471
|
+
},
|
|
2472
|
+
{
|
|
2473
|
+
code: "RU",
|
|
2474
|
+
labelEs: "RUSIA"
|
|
2475
|
+
},
|
|
2476
|
+
{
|
|
2477
|
+
code: "EH",
|
|
2478
|
+
labelEs: "SAHARA OCCIDENTAL"
|
|
2479
|
+
},
|
|
2480
|
+
{
|
|
2481
|
+
code: "WS",
|
|
2482
|
+
labelEs: "SAMOA"
|
|
2483
|
+
},
|
|
2484
|
+
{
|
|
2485
|
+
code: "AS",
|
|
2486
|
+
labelEs: "SAMOA AMERICANA"
|
|
2487
|
+
},
|
|
2488
|
+
{
|
|
2489
|
+
code: "BL",
|
|
2490
|
+
labelEs: "SAN BARTOLOME"
|
|
2491
|
+
},
|
|
2492
|
+
{
|
|
2493
|
+
code: "KN",
|
|
2494
|
+
labelEs: "SAN CRISTOBAL Y NIEVES"
|
|
2495
|
+
},
|
|
2496
|
+
{
|
|
2497
|
+
code: "SM",
|
|
2498
|
+
labelEs: "SAN MARINO"
|
|
2499
|
+
},
|
|
2500
|
+
{
|
|
2501
|
+
code: "MF",
|
|
2502
|
+
labelEs: "SAN MARTIN"
|
|
2503
|
+
},
|
|
2504
|
+
{
|
|
2505
|
+
code: "PM",
|
|
2506
|
+
labelEs: "SAN PEDRO Y MIQUELON"
|
|
2507
|
+
},
|
|
2508
|
+
{
|
|
2509
|
+
code: "VC",
|
|
2510
|
+
labelEs: "SAN VICENTE Y LAS GRANADINAS"
|
|
2511
|
+
},
|
|
2512
|
+
{
|
|
2513
|
+
code: "SH",
|
|
2514
|
+
labelEs: "SANTA ELENA"
|
|
2515
|
+
},
|
|
2516
|
+
{
|
|
2517
|
+
code: "LC",
|
|
2518
|
+
labelEs: "SANTA LUCIA"
|
|
2519
|
+
},
|
|
2520
|
+
{
|
|
2521
|
+
code: "VA",
|
|
2522
|
+
labelEs: "SANTA SEDE / ESTADO DE LA CIUDAD DEL VATICANO"
|
|
2523
|
+
},
|
|
2524
|
+
{
|
|
2525
|
+
code: "ST",
|
|
2526
|
+
labelEs: "SANTO TOME Y PRINCIPE"
|
|
2527
|
+
},
|
|
2528
|
+
{
|
|
2529
|
+
code: "SN",
|
|
2530
|
+
labelEs: "SENEGAL"
|
|
2531
|
+
},
|
|
2532
|
+
{
|
|
2533
|
+
code: "RS",
|
|
2534
|
+
labelEs: "SERBIA"
|
|
2535
|
+
},
|
|
2536
|
+
{
|
|
2537
|
+
code: "SC",
|
|
2538
|
+
labelEs: "SEYCHELLES"
|
|
2539
|
+
},
|
|
2540
|
+
{
|
|
2541
|
+
code: "SL",
|
|
2542
|
+
labelEs: "SIERRA LEONA"
|
|
2543
|
+
},
|
|
2544
|
+
{
|
|
2545
|
+
code: "SG",
|
|
2546
|
+
labelEs: "SINGAPUR"
|
|
2547
|
+
},
|
|
2548
|
+
{
|
|
2549
|
+
code: "SY",
|
|
2550
|
+
labelEs: "SIRIA"
|
|
2551
|
+
},
|
|
2552
|
+
{
|
|
2553
|
+
code: "SO",
|
|
2554
|
+
labelEs: "SOMALIA"
|
|
2555
|
+
},
|
|
2556
|
+
{
|
|
2557
|
+
code: "LK",
|
|
2558
|
+
labelEs: "SRI LANKA"
|
|
2559
|
+
},
|
|
2560
|
+
{
|
|
2561
|
+
code: "SZ",
|
|
2562
|
+
labelEs: "SUAZILANDIA"
|
|
2563
|
+
},
|
|
2564
|
+
{
|
|
2565
|
+
code: "ZA",
|
|
2566
|
+
labelEs: "SUDAFRICA"
|
|
2567
|
+
},
|
|
2568
|
+
{
|
|
2569
|
+
code: "SD",
|
|
2570
|
+
labelEs: "SUDAN"
|
|
2571
|
+
},
|
|
2572
|
+
{
|
|
2573
|
+
code: "SE",
|
|
2574
|
+
labelEs: "SUECIA"
|
|
2575
|
+
},
|
|
2576
|
+
{
|
|
2577
|
+
code: "CH",
|
|
2578
|
+
labelEs: "SUIZA"
|
|
2579
|
+
},
|
|
2580
|
+
{
|
|
2581
|
+
code: "SR",
|
|
2582
|
+
labelEs: "SURINAM"
|
|
2583
|
+
},
|
|
2584
|
+
{
|
|
2585
|
+
code: "SJ",
|
|
2586
|
+
labelEs: "SVALBARD Y JAN MAYEN"
|
|
2587
|
+
},
|
|
2588
|
+
{
|
|
2589
|
+
code: "TH",
|
|
2590
|
+
labelEs: "TAILANDIA"
|
|
2591
|
+
},
|
|
2592
|
+
{
|
|
2593
|
+
code: "TW",
|
|
2594
|
+
labelEs: "TAIWAN"
|
|
2595
|
+
},
|
|
2596
|
+
{
|
|
2597
|
+
code: "TZ",
|
|
2598
|
+
labelEs: "TANZANIA"
|
|
2599
|
+
},
|
|
2600
|
+
{
|
|
2601
|
+
code: "TJ",
|
|
2602
|
+
labelEs: "TAYIKISTAN"
|
|
2603
|
+
},
|
|
2604
|
+
{
|
|
2605
|
+
code: "IO",
|
|
2606
|
+
labelEs: "TERRITORIO BRITANICO DEL OCEANO INDICO"
|
|
2607
|
+
},
|
|
2608
|
+
{
|
|
2609
|
+
code: "TF",
|
|
2610
|
+
labelEs: "TERRITORIOS AUSTRALES FRANCESES"
|
|
2611
|
+
},
|
|
2612
|
+
{
|
|
2613
|
+
code: "PS",
|
|
2614
|
+
labelEs: "TERRITORIOS PALESTINOS"
|
|
2615
|
+
},
|
|
2616
|
+
{
|
|
2617
|
+
code: "TL",
|
|
2618
|
+
labelEs: "TIMOR ORIENTAL"
|
|
2619
|
+
},
|
|
2620
|
+
{
|
|
2621
|
+
code: "TG",
|
|
2622
|
+
labelEs: "TOGO"
|
|
2623
|
+
},
|
|
2624
|
+
{
|
|
2625
|
+
code: "TK",
|
|
2626
|
+
labelEs: "TOKELAU"
|
|
2627
|
+
},
|
|
2628
|
+
{
|
|
2629
|
+
code: "TO",
|
|
2630
|
+
labelEs: "TONGA"
|
|
2631
|
+
},
|
|
2632
|
+
{
|
|
2633
|
+
code: "TT",
|
|
2634
|
+
labelEs: "TRINIDAD Y TOBAGO"
|
|
2635
|
+
},
|
|
2636
|
+
{
|
|
2637
|
+
code: "TN",
|
|
2638
|
+
labelEs: "TUNEZ"
|
|
2639
|
+
},
|
|
2640
|
+
{
|
|
2641
|
+
code: "TM",
|
|
2642
|
+
labelEs: "TURKMENISTAN"
|
|
2643
|
+
},
|
|
2644
|
+
{
|
|
2645
|
+
code: "TR",
|
|
2646
|
+
labelEs: "TURQUIA"
|
|
2647
|
+
},
|
|
2648
|
+
{
|
|
2649
|
+
code: "TV",
|
|
2650
|
+
labelEs: "TUVALU"
|
|
2651
|
+
},
|
|
2652
|
+
{
|
|
2653
|
+
code: "UA",
|
|
2654
|
+
labelEs: "UCRANIA"
|
|
2655
|
+
},
|
|
2656
|
+
{
|
|
2657
|
+
code: "UG",
|
|
2658
|
+
labelEs: "UGANDA"
|
|
2659
|
+
},
|
|
2660
|
+
{
|
|
2661
|
+
code: "UY",
|
|
2662
|
+
labelEs: "URUGUAY"
|
|
2663
|
+
},
|
|
2664
|
+
{
|
|
2665
|
+
code: "UZ",
|
|
2666
|
+
labelEs: "UZBEKISTAN"
|
|
2667
|
+
},
|
|
2668
|
+
{
|
|
2669
|
+
code: "VU",
|
|
2670
|
+
labelEs: "VANUATU"
|
|
2671
|
+
},
|
|
2672
|
+
{
|
|
2673
|
+
code: "VE",
|
|
2674
|
+
labelEs: "VENEZUELA"
|
|
2675
|
+
},
|
|
2676
|
+
{
|
|
2677
|
+
code: "VN",
|
|
2678
|
+
labelEs: "VIETNAM"
|
|
2679
|
+
},
|
|
2680
|
+
{
|
|
2681
|
+
code: "WF",
|
|
2682
|
+
labelEs: "WALLIS Y FUTUNA"
|
|
2683
|
+
},
|
|
2684
|
+
{
|
|
2685
|
+
code: "YE",
|
|
2686
|
+
labelEs: "YEMEN"
|
|
2687
|
+
},
|
|
2688
|
+
{
|
|
2689
|
+
code: "DJ",
|
|
2690
|
+
labelEs: "YIBUTI"
|
|
2691
|
+
},
|
|
2692
|
+
{
|
|
2693
|
+
code: "ZM",
|
|
2694
|
+
labelEs: "ZAMBIA"
|
|
2695
|
+
},
|
|
2696
|
+
{
|
|
2697
|
+
code: "ZW",
|
|
2698
|
+
labelEs: "ZIMBABUE"
|
|
2699
|
+
}
|
|
2700
|
+
];
|
|
2701
|
+
|
|
2702
|
+
// src/lib/countries.ts
|
|
2703
|
+
var ITEMS = countries_default;
|
|
2704
|
+
var COUNTRY_OPTIONS = Object.freeze(
|
|
2705
|
+
[...ITEMS].sort(
|
|
2706
|
+
(left, right) => left.labelEs.localeCompare(right.labelEs, "es")
|
|
2707
|
+
)
|
|
2708
|
+
);
|
|
2709
|
+
var CODE_SET = new Set(ITEMS.map((item) => item.code));
|
|
2710
|
+
var BY_CODE = new Map(ITEMS.map((item) => [item.code, item]));
|
|
2711
|
+
var englishDisplayNames;
|
|
2712
|
+
function englishRegionName(code) {
|
|
2713
|
+
try {
|
|
2714
|
+
englishDisplayNames ??= new Intl.DisplayNames(["en"], { type: "region" });
|
|
2715
|
+
return englishDisplayNames.of(code);
|
|
2716
|
+
} catch {
|
|
2717
|
+
return void 0;
|
|
2718
|
+
}
|
|
2719
|
+
}
|
|
2720
|
+
function titleCaseEs(labelEs) {
|
|
2721
|
+
return labelEs.toLocaleLowerCase("es-MX").split(/\s+/).filter(Boolean).map((word) => word.charAt(0).toLocaleUpperCase("es-MX") + word.slice(1)).join(" ");
|
|
2722
|
+
}
|
|
2723
|
+
function isKnownCountryCode(code) {
|
|
2724
|
+
return CODE_SET.has(code.trim().toUpperCase());
|
|
2725
|
+
}
|
|
2726
|
+
function countryLabel(code, locale) {
|
|
2727
|
+
const normalized = code.trim().toUpperCase();
|
|
2728
|
+
const record = BY_CODE.get(normalized);
|
|
2729
|
+
if (!record) return normalized;
|
|
2730
|
+
if (locale === "es-MX") {
|
|
2731
|
+
return titleCaseEs(record.labelEs);
|
|
2732
|
+
}
|
|
2733
|
+
return englishRegionName(normalized) ?? titleCaseEs(record.labelEs);
|
|
2734
|
+
}
|
|
2735
|
+
function formatCountryOptionLabel(code, locale) {
|
|
2736
|
+
const normalized = code.trim().toUpperCase();
|
|
2737
|
+
return `${normalized} \u2014 ${countryLabel(normalized, locale)}`;
|
|
2738
|
+
}
|
|
2739
|
+
function countryPickerItems(locale) {
|
|
2740
|
+
return COUNTRY_OPTIONS.map((item) => ({
|
|
2741
|
+
value: item.code,
|
|
2742
|
+
label: formatCountryOptionLabel(item.code, locale)
|
|
2743
|
+
}));
|
|
2744
|
+
}
|
|
2745
|
+
function foldForSearch(text) {
|
|
2746
|
+
return text.normalize("NFD").replace(/\p{M}/gu, "").toLowerCase();
|
|
2747
|
+
}
|
|
2748
|
+
function filterCountries(query, locale) {
|
|
2749
|
+
const items = countryPickerItems(locale);
|
|
2750
|
+
const trimmed = query.trim();
|
|
2751
|
+
if (!trimmed) return items;
|
|
2752
|
+
const needle = foldForSearch(trimmed);
|
|
2753
|
+
return items.filter((item) => {
|
|
2754
|
+
const code = foldForSearch(item.value);
|
|
2755
|
+
const label = foldForSearch(item.label);
|
|
2756
|
+
return code.includes(needle) || label.includes(needle);
|
|
2757
|
+
});
|
|
2758
|
+
}
|
|
2759
|
+
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";
|
|
2760
|
+
function defaultLabels2(purpose, locale) {
|
|
2761
|
+
const es = locale === "es-MX";
|
|
2762
|
+
if (purpose === "nationality") {
|
|
2763
|
+
return {
|
|
2764
|
+
placeholder: es ? "Buscar pa\xEDs\u2026" : "Search country\u2026",
|
|
2765
|
+
search: es ? "Buscar pa\xEDs" : "Search country",
|
|
2766
|
+
noResults: es ? "Sin resultados" : "No results",
|
|
2767
|
+
clear: es ? "Limpiar" : "Clear",
|
|
2768
|
+
open: es ? "Abrir lista" : "Open list"
|
|
2769
|
+
};
|
|
2770
|
+
}
|
|
2771
|
+
return {
|
|
2772
|
+
placeholder: es ? "Buscar pa\xEDs\u2026" : "Search country\u2026",
|
|
2773
|
+
search: es ? "Buscar pa\xEDs" : "Search country",
|
|
2774
|
+
noResults: es ? "Sin resultados" : "No results",
|
|
2775
|
+
clear: es ? "Limpiar" : "Clear",
|
|
2776
|
+
open: es ? "Abrir lista" : "Open list"
|
|
2777
|
+
};
|
|
2778
|
+
}
|
|
2779
|
+
function findItem(items, code) {
|
|
2780
|
+
const normalized = code.trim().toUpperCase();
|
|
2781
|
+
if (!normalized) return null;
|
|
2782
|
+
return items.find((item) => item.value === normalized) ?? null;
|
|
2783
|
+
}
|
|
2784
|
+
function CountryPicker({
|
|
2785
|
+
value,
|
|
2786
|
+
onValueChange,
|
|
2787
|
+
purpose,
|
|
2788
|
+
locale = "es-MX",
|
|
2789
|
+
id,
|
|
2790
|
+
name,
|
|
2791
|
+
disabled,
|
|
2792
|
+
required,
|
|
2793
|
+
allowEmpty = true,
|
|
2794
|
+
className,
|
|
2795
|
+
labels: labelsProp,
|
|
2796
|
+
"aria-invalid": ariaInvalid
|
|
2797
|
+
}) {
|
|
2798
|
+
const labels = { ...defaultLabels2(purpose, locale), ...labelsProp };
|
|
2799
|
+
const items = React.useMemo(() => countryPickerItems(locale), [locale]);
|
|
2800
|
+
const selected = React.useMemo(() => findItem(items, value), [items, value]);
|
|
2801
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2802
|
+
name ? /* @__PURE__ */ jsx("input", { type: "hidden", name, value: value.trim().toUpperCase() }) : null,
|
|
2803
|
+
/* @__PURE__ */ jsxs(
|
|
2804
|
+
Combobox.Root,
|
|
2805
|
+
{
|
|
2806
|
+
items,
|
|
2807
|
+
value: selected,
|
|
2808
|
+
onValueChange: (item) => {
|
|
2809
|
+
onValueChange(item?.value ?? "");
|
|
2810
|
+
},
|
|
2811
|
+
disabled,
|
|
2812
|
+
itemToStringLabel: (item) => item.label,
|
|
2813
|
+
itemToStringValue: (item) => item.value,
|
|
2814
|
+
isItemEqualToValue: (item, current) => item.value === current.value,
|
|
2815
|
+
children: [
|
|
2816
|
+
/* @__PURE__ */ jsxs(
|
|
2817
|
+
Combobox.InputGroup,
|
|
2818
|
+
{
|
|
2819
|
+
className: cn("relative flex w-full items-center", className),
|
|
2820
|
+
children: [
|
|
2821
|
+
/* @__PURE__ */ jsx(
|
|
2822
|
+
Combobox.Input,
|
|
2823
|
+
{
|
|
2824
|
+
id,
|
|
2825
|
+
required,
|
|
2826
|
+
"aria-invalid": ariaInvalid,
|
|
2827
|
+
...labels.ariaLabel ? { "aria-label": labels.ariaLabel } : {},
|
|
2828
|
+
placeholder: labels.placeholder,
|
|
2829
|
+
className: cn(INPUT_CLASS, "pr-16")
|
|
2830
|
+
}
|
|
2831
|
+
),
|
|
2832
|
+
/* @__PURE__ */ jsxs("div", { className: "absolute inset-y-0 right-0 flex items-center gap-0.5 pr-1.5", children: [
|
|
2833
|
+
allowEmpty ? /* @__PURE__ */ jsx(
|
|
2834
|
+
Combobox.Clear,
|
|
2835
|
+
{
|
|
2836
|
+
className: "inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
2837
|
+
"aria-label": labels.clear,
|
|
2838
|
+
children: /* @__PURE__ */ jsx(XIcon, { className: "size-4", "aria-hidden": true })
|
|
2839
|
+
}
|
|
2840
|
+
) : null,
|
|
2841
|
+
/* @__PURE__ */ jsx(
|
|
2842
|
+
Combobox.Trigger,
|
|
2843
|
+
{
|
|
2844
|
+
className: "inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
2845
|
+
"aria-label": labels.open,
|
|
2846
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4", "aria-hidden": true })
|
|
2847
|
+
}
|
|
2848
|
+
)
|
|
2849
|
+
] })
|
|
2850
|
+
]
|
|
2851
|
+
}
|
|
2852
|
+
),
|
|
2853
|
+
/* @__PURE__ */ jsx(Combobox.Portal, { children: /* @__PURE__ */ jsx(
|
|
2854
|
+
Combobox.Positioner,
|
|
2855
|
+
{
|
|
2856
|
+
className: "isolate z-50 outline-none",
|
|
2857
|
+
sideOffset: 4,
|
|
2858
|
+
children: /* @__PURE__ */ jsxs(
|
|
2859
|
+
Combobox.Popup,
|
|
2860
|
+
{
|
|
2861
|
+
className: cn(
|
|
2862
|
+
"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",
|
|
2863
|
+
"data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95"
|
|
2864
|
+
),
|
|
2865
|
+
children: [
|
|
2866
|
+
/* @__PURE__ */ jsx(Combobox.Empty, { className: "px-3 py-2 text-sm text-muted-foreground", children: labels.noResults }),
|
|
2867
|
+
/* @__PURE__ */ jsx(Combobox.List, { className: "max-h-60 overflow-y-auto p-1 outline-none", children: (item) => /* @__PURE__ */ jsxs(
|
|
2868
|
+
Combobox.Item,
|
|
2869
|
+
{
|
|
2870
|
+
value: item,
|
|
2871
|
+
className: cn(
|
|
2872
|
+
"relative flex cursor-default items-center gap-2 rounded-md py-1.5 pr-2 pl-8 text-sm outline-none select-none",
|
|
2873
|
+
"data-highlighted:bg-accent data-highlighted:text-accent-foreground"
|
|
2874
|
+
),
|
|
2875
|
+
children: [
|
|
2876
|
+
/* @__PURE__ */ jsx(Combobox.ItemIndicator, { className: "absolute left-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4", "aria-hidden": true }) }),
|
|
2877
|
+
/* @__PURE__ */ jsx("span", { children: item.label })
|
|
2878
|
+
]
|
|
2879
|
+
},
|
|
2880
|
+
item.value
|
|
2881
|
+
) })
|
|
2882
|
+
]
|
|
2883
|
+
}
|
|
2884
|
+
)
|
|
2885
|
+
}
|
|
2886
|
+
) })
|
|
2887
|
+
]
|
|
2888
|
+
}
|
|
2889
|
+
)
|
|
2890
|
+
] });
|
|
2891
|
+
}
|
|
1702
2892
|
var DEFAULT_LABELS = {
|
|
1703
2893
|
uploadAria: "Upload image",
|
|
1704
2894
|
uploadHint: "Click to upload",
|
|
@@ -4108,6 +5298,6 @@ function MatchReview({
|
|
|
4108
5298
|
);
|
|
4109
5299
|
}
|
|
4110
5300
|
|
|
4111
|
-
export { AccountMenu, AppShell, AuditTimeline, AvatarEditor, AvatarEditorDialog, COOKIE_CONSENT_MAX_AGE, COOKIE_CONSENT_NAME, COOKIE_CONSENT_VALUES, ConfirmDestructiveDialog, CookieConsentBanner, CostBreakdownCard, DATA_TABLE_ROW_CLASS, DEFAULT_AUDIT_TIMELINE_LABELS, DEFAULT_COOKIE_CONSENT_BANNER_LABELS, DEFAULT_EDITABLE_SECTION_LABELS, DEFAULT_ENTITY_GRAPH_LABELS, DEFAULT_FILE_DROPZONE_LABELS, DEFAULT_FILE_UPLOAD_LABELS, DEFAULT_FILE_UPLOAD_TRAY_LABELS, DEFAULT_LEGAL_ACCEPT_CHECKBOX_LABELS, DEFAULT_LEGAL_ACCEPT_DIALOG_LABELS, DEFAULT_MATCH_REVIEW_LABELS, DEFAULT_NOTIFICATION_BELL_LABELS, DEFAULT_RISK_BADGE_LABELS, DashboardSkeleton, DataList, DataListItem, DataTable, DataTableSkeleton, DetailPageSkeleton, DimensionBreakdownTable, EditableSection, Empty2 as Empty, EmptyContent2 as EmptyContent, EmptyDescription2 as EmptyDescription, EmptyHeader2 as EmptyHeader, EmptyMedia2 as EmptyMedia, EmptyState, EmptyTitle2 as EmptyTitle, EntityGraph, ErrorState, Field, FieldMessage, FileDropzone, FileUploadMenu, FileUploadTray, FormCardSkeleton, LanguageContext, LanguageSwitcher, LegalAcceptCheckbox, LegalAcceptDialog, LegalMarkdown, ListSkeleton, LoadingState, MatchReview, MetricChartCard, MetricEmptyState, MetricSkeleton, NavTabs, NavigationProgress, NotificationBell, PageContainer, PageTitle, PageTitleSkeleton, RiskBadge, RouteLoading, SafeImage, SparklineStat, StatHighlightCard, THEME_INIT_SCRIPT, THEME_INIT_SCRIPT_ID, THEME_STORAGE_KEY, TIME_RANGE_OPTIONS, TableSkeleton, ThemeSwitcher, TimeRangePicker, avatarFallbackStyle, cn, cookieConsentAllowsReplay, cookieDomainFromHostname, createMultipartUploadController, defaultLanguages, fileMatchesAccept, getAvatarColors, getInitials, isCookieConsentValue, isEmbeddedWindow, matchClaimIsUnverified, parseCookieConsent, partRanges, progressFromBytes, readCookieConsent, renderShellLink, serializeCookieConsent, signalNavigationStart, sourceUrlIsHttps, suppressNavigationProgress, useEditableSection, useLanguageContext, useMediaQuery2 as useMediaQuery, writeCookieConsent };
|
|
5301
|
+
export { AccountMenu, AppShell, AuditTimeline, AvatarEditor, AvatarEditorDialog, COOKIE_CONSENT_MAX_AGE, COOKIE_CONSENT_NAME, COOKIE_CONSENT_VALUES, COUNTRY_OPTIONS, ConfirmDestructiveDialog, CookieConsentBanner, CostBreakdownCard, CountryPicker, DATA_TABLE_ROW_CLASS, DEFAULT_AUDIT_TIMELINE_LABELS, DEFAULT_COOKIE_CONSENT_BANNER_LABELS, DEFAULT_EDITABLE_SECTION_LABELS, DEFAULT_ENTITY_GRAPH_LABELS, DEFAULT_FILE_DROPZONE_LABELS, DEFAULT_FILE_UPLOAD_LABELS, DEFAULT_FILE_UPLOAD_TRAY_LABELS, DEFAULT_LEGAL_ACCEPT_CHECKBOX_LABELS, DEFAULT_LEGAL_ACCEPT_DIALOG_LABELS, DEFAULT_MATCH_REVIEW_LABELS, DEFAULT_NOTIFICATION_BELL_LABELS, DEFAULT_RISK_BADGE_LABELS, DashboardSkeleton, DataList, DataListItem, DataTable, DataTableSkeleton, DetailPageSkeleton, DimensionBreakdownTable, EditableSection, Empty2 as Empty, EmptyContent2 as EmptyContent, EmptyDescription2 as EmptyDescription, EmptyHeader2 as EmptyHeader, EmptyMedia2 as EmptyMedia, EmptyState, EmptyTitle2 as EmptyTitle, EntityGraph, ErrorState, Field, FieldMessage, FileDropzone, FileUploadMenu, FileUploadTray, FormCardSkeleton, LanguageContext, LanguageSwitcher, LegalAcceptCheckbox, LegalAcceptDialog, LegalMarkdown, ListSkeleton, LoadingState, MatchReview, MetricChartCard, MetricEmptyState, MetricSkeleton, NavTabs, NavigationProgress, NotificationBell, PageContainer, PageTitle, PageTitleSkeleton, RiskBadge, RouteLoading, SafeImage, SparklineStat, StatHighlightCard, THEME_INIT_SCRIPT, THEME_INIT_SCRIPT_ID, THEME_STORAGE_KEY, TIME_RANGE_OPTIONS, TableSkeleton, ThemeSwitcher, TimeRangePicker, avatarFallbackStyle, cn, cookieConsentAllowsReplay, cookieDomainFromHostname, countryLabel, countryPickerItems, createMultipartUploadController, defaultLanguages, fileMatchesAccept, filterCountries, formatCountryOptionLabel, getAvatarColors, getInitials, isCookieConsentValue, isEmbeddedWindow, isKnownCountryCode, matchClaimIsUnverified, parseCookieConsent, partRanges, progressFromBytes, readCookieConsent, renderShellLink, serializeCookieConsent, signalNavigationStart, sourceUrlIsHttps, suppressNavigationProgress, useEditableSection, useLanguageContext, useMediaQuery2 as useMediaQuery, writeCookieConsent };
|
|
4112
5302
|
//# sourceMappingURL=index.js.map
|
|
4113
5303
|
//# sourceMappingURL=index.js.map
|