xertica-ui 2.4.1 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/README.md +28 -2
  3. package/bin/generate-tokens.ts +9 -9
  4. package/components/brand/xertica-provider/XerticaProvider.tsx +4 -1
  5. package/components/layout/sidebar/sidebar.stories.tsx +201 -0
  6. package/components/layout/sidebar/sidebar.tsx +86 -1
  7. package/components/pages/template-page/TemplatePage.stories.tsx +8 -15
  8. package/components/ui/chart/chart.test.tsx +1 -1
  9. package/components/ui/chart/chart.tsx +13 -6
  10. package/contexts/BrandColorsContext.tsx +39 -8
  11. package/contexts/theme-data.ts +51 -0
  12. package/dist/AssistantChart-BZTPJ5dP.cjs +3551 -0
  13. package/dist/AssistantChart-DMJJ_Amf.js +3383 -0
  14. package/dist/BrandColorsContext-BMRJ04Wf.js +718 -0
  15. package/dist/BrandColorsContext-BwY-b6M4.cjs +725 -0
  16. package/dist/VerifyEmailPage-CGIwmWrm.js +3296 -0
  17. package/dist/VerifyEmailPage-CpqqpLpo.cjs +3305 -0
  18. package/dist/XerticaProvider-CeS5G_n5.cjs +45 -0
  19. package/dist/XerticaProvider-ra2NciRq.js +43 -0
  20. package/dist/assistant.cjs.js +1 -1
  21. package/dist/assistant.es.js +1 -1
  22. package/dist/brand.cjs.js +1 -1
  23. package/dist/brand.es.js +1 -1
  24. package/dist/cli.js +45 -9
  25. package/dist/components/brand/xertica-provider/XerticaProvider.d.ts +3 -1
  26. package/dist/components/ui/chart/chart.d.ts +12 -3
  27. package/dist/contexts/theme-data.d.ts +4 -0
  28. package/dist/hooks.cjs.js +1 -1
  29. package/dist/hooks.es.js +1 -1
  30. package/dist/index.cjs.js +6 -6
  31. package/dist/index.es.js +6 -6
  32. package/dist/layout.cjs.js +1 -1
  33. package/dist/layout.es.js +1 -1
  34. package/dist/pages.cjs.js +1 -1
  35. package/dist/pages.es.js +1 -1
  36. package/dist/rich-text-editor-B2CKz7nx.cjs +2903 -0
  37. package/dist/rich-text-editor-DloeW0wc.js +2832 -0
  38. package/dist/sidebar-0ocFLSks.js +878 -0
  39. package/dist/sidebar-CeTMuzOx.cjs +881 -0
  40. package/dist/ui.cjs.js +2 -2
  41. package/dist/ui.es.js +2 -2
  42. package/dist/xertica-assistant-CyikE3N_.js +2173 -0
  43. package/dist/xertica-assistant-QFUnv5I2.cjs +2180 -0
  44. package/dist/xertica-ui.css +1 -1
  45. package/docs/components/sidebar.md +19 -2
  46. package/llms-compact.txt +30 -1
  47. package/llms.txt +1 -1
  48. package/package.json +2 -2
  49. package/styles/xertica/tokens.css +9 -9
  50. package/templates/guidelines/Guidelines.md +643 -355
  51. package/templates/package.json +2 -2
  52. package/templates/src/styles/xertica/tokens.css +9 -9
@@ -0,0 +1,3296 @@
1
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
+ import React__default, { useState, createContext, useContext, useMemo, useRef, useCallback, useEffect } from 'react';
3
+ import { B as Button, c as cn } from './button-DZHzN1Gd.js';
4
+ import { I as Input, S as ScrollArea } from './input-cc-PTD4R.js';
5
+ import { I as ImageWithFallback, L as Label, P as PageHeader, M as Map, C as Checkbox, S as Separator, T as Tabs, p as TabsList, q as TabsTrigger, o as TabsContent, n as Switch, R as RadioGroup, m as RadioGroupItem, A as AlertDialog, j as AlertDialogTrigger, c as AlertDialogContent, f as AlertDialogHeader, i as AlertDialogTitle, d as AlertDialogDescription, e as AlertDialogFooter, b as AlertDialogCancel, a as AlertDialogAction } from './alert-dialog-DqlRW_An.js';
6
+ import { L as LanguageSelector, X as XerticaLogo } from './XerticaXLogo-BX3ueACh.js';
7
+ import { ArrowLeft, Lock, FileText, Home, CheckCircle2, AlertCircle, Coffee, ShoppingBag, Landmark, Hotel, Utensils, MapPin, Filter, X, MousePointer2, Circle, Square, Hexagon, Undo, Trash2, Save, Check, Pencil, Layers, Settings, Users, Mail, Phone, Search, User, Calendar, Bell, FileEdit, ArrowRightLeft, Clock, Plus, Archive, Map as Map$1 } from 'lucide-react';
8
+ import { useNavigate, Link, useLocation } from 'react-router-dom';
9
+ import { H as Header, S as Sidebar } from './sidebar-0ocFLSks.js';
10
+ import { C as Card, e as CardHeader, f as CardTitle, b as CardContent, d as CardFooter, c as CardDescription, S as Skeleton } from './skeleton-DtR5tkYe.js';
11
+ import { B as Badge, P as Progress } from './progress-C7Lti5wo.js';
12
+ import { a as useOptionalLayout } from './LayoutContext-DNl1xSoX.js';
13
+ import { u as useLanguage, a as useTheme } from './ThemeContext-x_F2zsnv.js';
14
+ import { useQuery } from '@tanstack/react-query';
15
+ import { useTranslation } from 'react-i18next';
16
+ import { F as FeatureCardSkeleton } from './FeatureCardSkeleton-DZqc96mt.js';
17
+ import { X as XerticaAssistant, g as gerarResposta } from './xertica-assistant-CyikE3N_.js';
18
+ import i18n from 'i18next';
19
+ import { k as Dialog, n as DialogContent, q as DialogHeader, t as DialogTitle, o as DialogDescription, A as Alert, b as AlertTitle, a as AlertDescription, V as Textarea, T as Table, Q as TableHeader, U as TableRow, O as TableHead, K as TableBody, M as TableCell, u as DialogTrigger, p as DialogFooter } from './rich-text-editor-DloeW0wc.js';
20
+ import { S as Select, h as SelectTrigger, i as SelectValue, a as SelectContent, c as SelectItem } from './select-D-xvCZK2.js';
21
+ import { S as Slider } from './slider-DQCNUUMj.js';
22
+ import { toast } from 'sonner';
23
+ import { create } from 'zustand';
24
+
25
+ function ForgotPasswordPage() {
26
+ const navigate = useNavigate();
27
+ const [email, setEmail] = useState("");
28
+ const [isLoading, setIsLoading] = useState(false);
29
+ const handleSubmit = async (e) => {
30
+ e.preventDefault();
31
+ setIsLoading(true);
32
+ await new Promise((resolve) => setTimeout(resolve, 1500));
33
+ navigate("/verify-email", { state: { email } });
34
+ setIsLoading(false);
35
+ };
36
+ const handleSocialLogin = (_provider) => {
37
+ };
38
+ return /* @__PURE__ */ jsxs("div", { className: "h-screen w-full flex overflow-y-auto", children: [
39
+ /* @__PURE__ */ jsxs("div", { className: "hidden lg:flex lg:flex-1 relative overflow-hidden", children: [
40
+ /* @__PURE__ */ jsx(
41
+ ImageWithFallback,
42
+ {
43
+ src: "https://images.unsplash.com/photo-1557804506-669a67965ba0?w=1200&h=800&fit=crop&auto=format",
44
+ alt: "Segurança e tecnologia",
45
+ className: "absolute inset-0 w-full h-full object-cover"
46
+ }
47
+ ),
48
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-[image:var(--gradient-diagonal)] opacity-80" })
49
+ ] }),
50
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 flex items-center justify-center px-4 sm:px-6 lg:px-8 lg:flex-none lg:w-1/2 relative bg-muted", children: [
51
+ /* @__PURE__ */ jsx("div", { className: "absolute top-4 right-4 z-20", children: /* @__PURE__ */ jsx(LanguageSelector, { variant: "minimal", showIcon: false }) }),
52
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-0 lg:hidden bg-[image:var(--gradient-diagonal)] opacity-10 dark:opacity-5" }),
53
+ /* @__PURE__ */ jsxs("div", { className: "w-full max-w-sm space-y-6 relative z-10", children: [
54
+ /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
55
+ /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center mb-4", children: /* @__PURE__ */ jsx(
56
+ XerticaLogo,
57
+ {
58
+ className: "h-12 w-auto text-primary dark:text-foreground",
59
+ variant: "theme"
60
+ }
61
+ ) }),
62
+ /* @__PURE__ */ jsx("h2", { className: "text-sm text-muted-foreground", children: "Recuperar senha" }),
63
+ /* @__PURE__ */ jsx("p", { className: "mt-2 text-muted-foreground", children: "Digite seu e-mail e enviaremos as instruções para redefinir sua senha" })
64
+ ] }),
65
+ /* @__PURE__ */ jsxs("form", { className: "space-y-6", onSubmit: handleSubmit, children: [
66
+ /* @__PURE__ */ jsxs("div", { className: "form-group space-y-2", children: [
67
+ /* @__PURE__ */ jsx(Label, { htmlFor: "email", className: "form-label", children: "E-mail" }),
68
+ /* @__PURE__ */ jsx(
69
+ Input,
70
+ {
71
+ id: "email",
72
+ name: "email",
73
+ type: "email",
74
+ required: true,
75
+ className: "w-full",
76
+ placeholder: "seu@email.com",
77
+ value: email,
78
+ onChange: (e) => setEmail(e.target.value)
79
+ }
80
+ )
81
+ ] }),
82
+ /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
83
+ /* @__PURE__ */ jsx(Button, { type: "submit", className: "w-full", disabled: isLoading, children: isLoading ? "Enviando..." : "Enviar instruções" }),
84
+ /* @__PURE__ */ jsxs(
85
+ Button,
86
+ {
87
+ type: "button",
88
+ onClick: () => navigate("/login"),
89
+ variant: "outline",
90
+ className: "w-full text-muted-foreground hover:text-foreground",
91
+ children: [
92
+ /* @__PURE__ */ jsx(ArrowLeft, { className: "w-4 h-4 mr-2" }),
93
+ "Voltar para o login"
94
+ ]
95
+ }
96
+ )
97
+ ] })
98
+ ] }),
99
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
100
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center", children: /* @__PURE__ */ jsx("div", { className: "w-full border-t border-border" }) }),
101
+ /* @__PURE__ */ jsx("div", { className: "relative flex justify-center text-sm", children: /* @__PURE__ */ jsx("span", { className: "bg-muted px-2 text-muted-foreground", children: "ou continue com" }) })
102
+ ] }),
103
+ /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
104
+ /* @__PURE__ */ jsxs(
105
+ Button,
106
+ {
107
+ type: "button",
108
+ variant: "outline",
109
+ className: "w-full justify-center",
110
+ onClick: () => handleSocialLogin(),
111
+ children: [
112
+ /* @__PURE__ */ jsxs("svg", { className: "w-5 h-5 mr-2", viewBox: "0 0 48 48", xmlns: "http://www.w3.org/2000/svg", children: [
113
+ /* @__PURE__ */ jsx(
114
+ "path",
115
+ {
116
+ fill: "#EA4335",
117
+ d: "M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"
118
+ }
119
+ ),
120
+ /* @__PURE__ */ jsx(
121
+ "path",
122
+ {
123
+ fill: "#4285F4",
124
+ d: "M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"
125
+ }
126
+ ),
127
+ /* @__PURE__ */ jsx(
128
+ "path",
129
+ {
130
+ fill: "#FBBC05",
131
+ d: "M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"
132
+ }
133
+ ),
134
+ /* @__PURE__ */ jsx(
135
+ "path",
136
+ {
137
+ fill: "#34A853",
138
+ d: "M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"
139
+ }
140
+ ),
141
+ /* @__PURE__ */ jsx("path", { fill: "none", d: "M0 0h48v48H0z" })
142
+ ] }),
143
+ /* @__PURE__ */ jsx("span", { children: "Entrar com Google" })
144
+ ]
145
+ }
146
+ ),
147
+ /* @__PURE__ */ jsxs(
148
+ Button,
149
+ {
150
+ type: "button",
151
+ variant: "outline",
152
+ className: "w-full justify-center",
153
+ onClick: () => handleSocialLogin(),
154
+ children: [
155
+ /* @__PURE__ */ jsx(Lock, { className: "w-5 h-5 mr-2 text-[var(--chart-4)]" }),
156
+ /* @__PURE__ */ jsx("span", { children: "Entrar com MT Login" })
157
+ ]
158
+ }
159
+ ),
160
+ /* @__PURE__ */ jsx(
161
+ Button,
162
+ {
163
+ type: "button",
164
+ variant: "outline",
165
+ className: "w-full justify-center font-normal",
166
+ onClick: () => handleSocialLogin(),
167
+ children: /* @__PURE__ */ jsxs("span", { children: [
168
+ "Entrar com ",
169
+ /* @__PURE__ */ jsx("strong", { className: "font-semibold", children: "gov.br" })
170
+ ] })
171
+ }
172
+ )
173
+ ] })
174
+ ] })
175
+ ] })
176
+ ] });
177
+ }
178
+
179
+ const SIDEBAR_COLLAPSED_WIDTH = 80;
180
+
181
+ const t = (key, options) => i18n.t(key, options);
182
+ const MOCK_TEAM_MEMBERS = [
183
+ {
184
+ id: "1",
185
+ name: "Ana Silva",
186
+ email: "ana.silva@example.com",
187
+ role: "Developer",
188
+ status: "active"
189
+ },
190
+ {
191
+ id: "2",
192
+ name: "Bruno Costa",
193
+ email: "bruno.costa@example.com",
194
+ role: "Designer",
195
+ status: "active"
196
+ },
197
+ {
198
+ id: "3",
199
+ name: "Carla Oliveira",
200
+ email: "carla.oliveira@example.com",
201
+ role: "Manager",
202
+ status: "away"
203
+ },
204
+ {
205
+ id: "4",
206
+ name: "Diego Santos",
207
+ email: "diego.santos@example.com",
208
+ role: "Analyst",
209
+ status: "inactive"
210
+ }
211
+ ];
212
+ async function fetchTeamMembers() {
213
+ await new Promise((resolve) => setTimeout(resolve, 250));
214
+ return MOCK_TEAM_MEMBERS;
215
+ }
216
+ async function fetchFeatureCards() {
217
+ await new Promise((resolve) => setTimeout(resolve, 100));
218
+ return [
219
+ {
220
+ id: "template-cli",
221
+ title: t("home.templateCliTitle"),
222
+ description: t("home.templateCliDescription"),
223
+ badge: t("home.templateClibadge"),
224
+ href: "/template"
225
+ }
226
+ ];
227
+ }
228
+
229
+ function useTeamMembers() {
230
+ const { language } = useLanguage();
231
+ return useQuery({
232
+ // Language is part of the key so each locale has its own cache slot.
233
+ queryKey: ["home", "team-members", language],
234
+ queryFn: fetchTeamMembers,
235
+ staleTime: 2 * 60 * 1e3
236
+ // 2 min
237
+ });
238
+ }
239
+
240
+ function useFeatureCards() {
241
+ const { language } = useLanguage();
242
+ return useQuery({
243
+ // Language is part of the key so each locale has its own cache slot.
244
+ queryKey: ["home", "feature-cards", language],
245
+ queryFn: fetchFeatureCards,
246
+ staleTime: 10 * 60 * 1e3
247
+ // 10 min — feature list is fairly static
248
+ });
249
+ }
250
+
251
+ const useDashboardStore = create((set) => ({
252
+ // Filters
253
+ activeTab: "overview",
254
+ setActiveTab: (tab) => set({ activeTab: tab }),
255
+ // UI toggles
256
+ statsExpanded: true,
257
+ toggleStats: () => set((state) => ({ statsExpanded: !state.statsExpanded })),
258
+ // Showcase controls
259
+ progress: 45,
260
+ setProgress: (value) => set({ progress: value }),
261
+ sliderValue: [50],
262
+ setSliderValue: (value) => set({ sliderValue: value }),
263
+ switchEnabled: false,
264
+ toggleSwitch: () => set((state) => ({ switchEnabled: !state.switchEnabled }))
265
+ }));
266
+
267
+ function isDev() {
268
+ return false;
269
+ }
270
+ function SectionErrorFallback({ error, reset }) {
271
+ return /* @__PURE__ */ jsxs(
272
+ "div",
273
+ {
274
+ role: "alert",
275
+ className: "flex flex-col items-center justify-center gap-3 p-6 rounded-[var(--radius-lg)] border border-destructive/30 bg-destructive/5 text-center",
276
+ children: [
277
+ /* @__PURE__ */ jsxs(
278
+ "svg",
279
+ {
280
+ width: "24",
281
+ height: "24",
282
+ viewBox: "0 0 24 24",
283
+ fill: "none",
284
+ stroke: "currentColor",
285
+ strokeWidth: "2",
286
+ strokeLinecap: "round",
287
+ strokeLinejoin: "round",
288
+ className: "text-destructive shrink-0",
289
+ "aria-hidden": "true",
290
+ children: [
291
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
292
+ /* @__PURE__ */ jsx("line", { x1: "12", y1: "8", x2: "12", y2: "12" }),
293
+ /* @__PURE__ */ jsx("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })
294
+ ]
295
+ }
296
+ ),
297
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
298
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: "Não foi possível carregar este conteúdo" }),
299
+ isDev()
300
+ ] }),
301
+ /* @__PURE__ */ jsx(
302
+ "button",
303
+ {
304
+ onClick: reset,
305
+ className: "inline-flex items-center px-3 py-1.5 text-xs rounded-[var(--radius-button)] border border-border bg-background hover:bg-accent hover:text-accent-foreground transition-colors",
306
+ children: "Tentar novamente"
307
+ }
308
+ )
309
+ ]
310
+ }
311
+ );
312
+ }
313
+
314
+ class ErrorBoundary extends React__default.Component {
315
+ constructor(props) {
316
+ super(props);
317
+ this.state = { hasError: false, error: null };
318
+ this.reset = this.reset.bind(this);
319
+ }
320
+ static getDerivedStateFromError(error) {
321
+ return { hasError: true, error };
322
+ }
323
+ componentDidCatch(error, info) {
324
+ this.props.onError?.(error, info);
325
+ }
326
+ componentDidUpdate(prevProps) {
327
+ if (!this.state.hasError) return;
328
+ const { resetKeys } = this.props;
329
+ if (!resetKeys?.length) return;
330
+ const prevKeys = prevProps.resetKeys ?? [];
331
+ const changed = resetKeys.some((key, i) => key !== prevKeys[i]);
332
+ if (changed) this.reset();
333
+ }
334
+ reset() {
335
+ this.setState({ hasError: false, error: null });
336
+ }
337
+ render() {
338
+ const { hasError, error } = this.state;
339
+ const { children, fallback: Fallback } = this.props;
340
+ if (hasError && error) {
341
+ return /* @__PURE__ */ jsx(Fallback, { error, reset: this.reset });
342
+ }
343
+ return children;
344
+ }
345
+ }
346
+ function SectionErrorBoundary({ children, onError, resetKeys }) {
347
+ return /* @__PURE__ */ jsx(ErrorBoundary, { fallback: SectionErrorFallback, onError, resetKeys, children });
348
+ }
349
+
350
+ function HomeContent() {
351
+ const { t } = useTranslation();
352
+ const layout = useOptionalLayout();
353
+ const sidebarExpanded = layout?.sidebarExpanded ?? false;
354
+ const sidebarWidth = layout?.sidebarWidth ?? 256;
355
+ const navigate = useNavigate();
356
+ const { data: featureCards = [], isLoading } = useFeatureCards();
357
+ return /* @__PURE__ */ jsxs(
358
+ "div",
359
+ {
360
+ style: {
361
+ paddingLeft: sidebarExpanded ? `${sidebarWidth}px` : SIDEBAR_COLLAPSED_WIDTH
362
+ },
363
+ className: "flex-1 flex flex-col overflow-hidden transition-all duration-300",
364
+ children: [
365
+ /* @__PURE__ */ jsx(
366
+ Header,
367
+ {
368
+ showThemeToggle: true,
369
+ showLanguageSelector: true,
370
+ breadcrumbs: [{ label: t("nav.designSystem"), href: "/home" }, { label: t("nav.home") }],
371
+ renderLink: (href, props) => /* @__PURE__ */ jsx(Link, { to: href, ...props })
372
+ }
373
+ ),
374
+ /* @__PURE__ */ jsx("main", { className: "flex-1 overflow-hidden bg-muted", children: /* @__PURE__ */ jsx(ScrollArea, { className: "h-full", children: /* @__PURE__ */ jsx("div", { className: "p-5 sm:p-4 md:p-6", children: /* @__PURE__ */ jsxs("div", { className: "max-w-6xl mx-auto space-y-8", children: [
375
+ /* @__PURE__ */ jsx(PageHeader, { title: t("home.welcome"), subtitle: t("home.subtitle") }),
376
+ /* @__PURE__ */ jsx(SectionErrorBoundary, { children: /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6", children: isLoading ? /* @__PURE__ */ jsxs(Fragment, { children: [
377
+ /* @__PURE__ */ jsx(FeatureCardSkeleton, { showAction: true }),
378
+ /* @__PURE__ */ jsx(FeatureCardSkeleton, { showAction: true }),
379
+ /* @__PURE__ */ jsx(FeatureCardSkeleton, { showAction: true })
380
+ ] }) : featureCards.map((card) => /* @__PURE__ */ jsxs(
381
+ Card,
382
+ {
383
+ className: "hover:shadow-xl transition-shadow duration-200 flex flex-col h-full",
384
+ children: [
385
+ /* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
386
+ /* @__PURE__ */ jsx("div", { className: "p-2 bg-[var(--chart-2)]/20 rounded-[var(--radius)]", children: /* @__PURE__ */ jsx(FileText, { className: "w-6 h-6 text-[var(--chart-2)]" }) }),
387
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
388
+ /* @__PURE__ */ jsx(CardTitle, { className: "text-sm", children: t(`home.${card.id.replace(/-/g, "")}Title`, {
389
+ defaultValue: card.title
390
+ }) }),
391
+ card.badge && /* @__PURE__ */ jsx(Badge, { variant: "default", className: "text-xs", children: t(`home.${card.id.replace(/-/g, "")}badge`, {
392
+ defaultValue: card.badge
393
+ }) })
394
+ ] })
395
+ ] }) }),
396
+ /* @__PURE__ */ jsx(CardContent, { className: "flex-1", children: /* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: t(`home.${card.id.replace(/-/g, "")}Description`, {
397
+ defaultValue: card.description
398
+ }) }) }),
399
+ /* @__PURE__ */ jsx(CardFooter, { children: /* @__PURE__ */ jsx(
400
+ Button,
401
+ {
402
+ variant: "outline",
403
+ className: "w-full",
404
+ onClick: () => navigate(card.href),
405
+ children: t("common.view")
406
+ }
407
+ ) })
408
+ ]
409
+ },
410
+ card.id
411
+ )) }) })
412
+ ] }) }) }) })
413
+ ]
414
+ }
415
+ );
416
+ }
417
+
418
+ const routes = [
419
+ { path: "/home", label: "Home", icon: Home },
420
+ { path: "/template", label: "Template", icon: FileText }
421
+ ];
422
+
423
+ const AuthContext = createContext(null);
424
+ function useAuth() {
425
+ const ctx = useContext(AuthContext);
426
+ if (!ctx) throw new Error("useAuth must be used within <AuthProvider>");
427
+ return ctx;
428
+ }
429
+
430
+ async function fetchAssistantConfig() {
431
+ await new Promise((resolve) => setTimeout(resolve, 150));
432
+ const t = (key) => i18n.t(key);
433
+ return {
434
+ suggestions: [
435
+ { id: "1", text: t("assistant.suggestions.whatCanIAsk") },
436
+ { id: "2", text: t("assistant.suggestions.whatDoYouDo") },
437
+ { id: "3", text: t("assistant.suggestions.whichProjects") },
438
+ { id: "4", text: t("assistant.suggestions.nextProject") }
439
+ ],
440
+ richSuggestions: [
441
+ { id: "rich-1", text: t("assistant.richSuggestions.viewPerformance") },
442
+ { id: "rich-2", text: t("assistant.richSuggestions.generateReport") },
443
+ { id: "rich-3", text: t("assistant.richSuggestions.createDocument") },
444
+ { id: "rich-4", text: t("assistant.richSuggestions.generatePodcast") }
445
+ ],
446
+ feedbackOptions: [
447
+ t("assistant.feedback.notWhatIWanted"),
448
+ t("assistant.feedback.incorrectInfo"),
449
+ t("assistant.feedback.incompleteAnswer")
450
+ ]
451
+ };
452
+ }
453
+ function getMockRichSuggestions() {
454
+ return [
455
+ { id: "rich-1", text: i18n.t("assistant.richSuggestions.viewPerformance") },
456
+ { id: "rich-2", text: i18n.t("assistant.richSuggestions.generateReport") },
457
+ { id: "rich-3", text: i18n.t("assistant.richSuggestions.createDocument") },
458
+ { id: "rich-4", text: i18n.t("assistant.richSuggestions.generatePodcast") }
459
+ ];
460
+ }
461
+ function getMockFeedbackOptions() {
462
+ return [
463
+ i18n.t("assistant.feedback.notWhatIWanted"),
464
+ i18n.t("assistant.feedback.incorrectInfo"),
465
+ i18n.t("assistant.feedback.incompleteAnswer")
466
+ ];
467
+ }
468
+
469
+ function useAssistantConfig() {
470
+ const { language } = useLanguage();
471
+ return useQuery({
472
+ // Language is part of the key so each locale has its own cache slot.
473
+ queryKey: ["assistant", "config", language],
474
+ queryFn: fetchAssistantConfig,
475
+ staleTime: 30 * 60 * 1e3
476
+ // 30 min — config rarely changes
477
+ });
478
+ }
479
+
480
+ function HomePage() {
481
+ const { user, logout } = useAuth();
482
+ const layout = useOptionalLayout();
483
+ const [localSidebarExpanded, setLocalSidebarExpanded] = React__default.useState(false);
484
+ const [localAssistantExpanded, setLocalAssistantExpanded] = React__default.useState(false);
485
+ const sidebarExpanded = layout?.sidebarExpanded ?? localSidebarExpanded;
486
+ const sidebarWidth = layout?.sidebarWidth ?? 280;
487
+ const assistenteExpanded = layout?.assistenteExpanded ?? localAssistantExpanded;
488
+ const toggleSidebar = layout?.toggleSidebar ?? (() => setLocalSidebarExpanded((value) => !value));
489
+ const toggleAssistente = layout?.toggleAssistente ?? (() => setLocalAssistantExpanded((value) => !value));
490
+ const location = useLocation();
491
+ const navigate = useNavigate();
492
+ const { data: assistantConfig } = useAssistantConfig();
493
+ return /* @__PURE__ */ jsxs("div", { className: "h-screen flex bg-muted overflow-hidden relative", children: [
494
+ /* @__PURE__ */ jsx(
495
+ Sidebar,
496
+ {
497
+ expanded: sidebarExpanded,
498
+ width: sidebarWidth,
499
+ onToggle: toggleSidebar,
500
+ user: {
501
+ ...user,
502
+ name: "Ariel Santos",
503
+ avatar: "https://github.com/shadcn.png"
504
+ },
505
+ onLogout: logout,
506
+ onSettingsClick: () => navigate("/settings"),
507
+ location,
508
+ navigate,
509
+ routes
510
+ }
511
+ ),
512
+ /* @__PURE__ */ jsx(HomeContent, {}),
513
+ /* @__PURE__ */ jsx(
514
+ XerticaAssistant,
515
+ {
516
+ isExpanded: assistenteExpanded,
517
+ onToggle: toggleAssistente,
518
+ defaultTab: "chat",
519
+ demoMode: true,
520
+ responseGenerator: gerarResposta,
521
+ suggestions: assistantConfig?.suggestions,
522
+ richSuggestions: assistantConfig?.richSuggestions ?? getMockRichSuggestions(),
523
+ feedbackOptions: assistantConfig?.feedbackOptions ?? getMockFeedbackOptions(),
524
+ onEvaluation: () => {
525
+ }
526
+ }
527
+ )
528
+ ] });
529
+ }
530
+
531
+ function LoginPage({ onLogin }) {
532
+ const navigate = useNavigate();
533
+ const { t } = useTranslation();
534
+ const [email, setEmail] = useState("");
535
+ const [password, setPassword] = useState("");
536
+ const [isLoading, setIsLoading] = useState(false);
537
+ const [error, setError] = useState("");
538
+ const handleSubmit = async (e) => {
539
+ e.preventDefault();
540
+ setError("");
541
+ setIsLoading(true);
542
+ await new Promise((resolve) => setTimeout(resolve, 1e3));
543
+ const success = onLogin(email, password);
544
+ if (!success) {
545
+ setError(t("login.errorFillFields"));
546
+ }
547
+ setIsLoading(false);
548
+ };
549
+ const handleSocialLogin = (_provider) => {
550
+ onLogin("social@user.com", "social-auth");
551
+ };
552
+ return /* @__PURE__ */ jsxs("div", { className: "h-screen w-full flex overflow-y-auto", children: [
553
+ /* @__PURE__ */ jsxs("div", { className: "hidden lg:flex lg:flex-1 relative overflow-hidden", children: [
554
+ /* @__PURE__ */ jsx(
555
+ ImageWithFallback,
556
+ {
557
+ src: "https://images.unsplash.com/photo-1551434678-e076c223a692?w=1200&h=800&fit=crop&auto=format",
558
+ alt: t("login.heroImageAlt"),
559
+ className: "absolute inset-0 w-full h-full object-cover"
560
+ }
561
+ ),
562
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-[image:var(--gradient-diagonal)] opacity-80" })
563
+ ] }),
564
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 flex items-center justify-center px-4 sm:px-6 lg:px-8 lg:flex-none lg:w-1/2 relative bg-muted", children: [
565
+ /* @__PURE__ */ jsx("div", { className: "absolute top-4 right-4 z-20", children: /* @__PURE__ */ jsx(LanguageSelector, { variant: "minimal", showIcon: false }) }),
566
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-0 lg:hidden bg-[image:var(--gradient-diagonal)] opacity-10 dark:opacity-5" }),
567
+ /* @__PURE__ */ jsxs("div", { className: "w-full max-w-sm space-y-6 relative z-10", children: [
568
+ /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
569
+ /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center mb-4", children: /* @__PURE__ */ jsx(
570
+ XerticaLogo,
571
+ {
572
+ className: "h-12 w-auto text-primary dark:text-foreground",
573
+ variant: "theme"
574
+ }
575
+ ) }),
576
+ /* @__PURE__ */ jsx("h2", { className: "text-sm text-muted-foreground", children: t("login.heading") })
577
+ ] }),
578
+ /* @__PURE__ */ jsxs("form", { className: "space-y-6", onSubmit: handleSubmit, children: [
579
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
580
+ /* @__PURE__ */ jsx(Label, { htmlFor: "email", children: t("login.emailLabel") }),
581
+ /* @__PURE__ */ jsx(
582
+ Input,
583
+ {
584
+ id: "email",
585
+ name: "email",
586
+ type: "email",
587
+ required: true,
588
+ className: "w-full",
589
+ placeholder: t("login.emailPlaceholder"),
590
+ value: email,
591
+ onChange: (e) => setEmail(e.target.value)
592
+ }
593
+ )
594
+ ] }),
595
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
596
+ /* @__PURE__ */ jsx(Label, { htmlFor: "password", children: t("login.passwordLabel") }),
597
+ /* @__PURE__ */ jsx(
598
+ Input,
599
+ {
600
+ id: "password",
601
+ name: "password",
602
+ type: "password",
603
+ required: true,
604
+ className: "w-full",
605
+ placeholder: "••••••••",
606
+ value: password,
607
+ onChange: (e) => setPassword(e.target.value)
608
+ }
609
+ )
610
+ ] }),
611
+ error && /* @__PURE__ */ jsx("div", { className: "text-destructive text-sm text-center", children: error }),
612
+ /* @__PURE__ */ jsx(Button, { type: "submit", className: "w-full", disabled: isLoading, children: isLoading ? t("login.submitting") : t("login.submit") }),
613
+ /* @__PURE__ */ jsx("div", { className: "text-center", children: /* @__PURE__ */ jsx(
614
+ "button",
615
+ {
616
+ type: "button",
617
+ onClick: () => navigate("/forgot-password"),
618
+ className: "text-sm text-primary hover:opacity-80 transition-colors",
619
+ children: t("login.forgotPassword")
620
+ }
621
+ ) })
622
+ ] }),
623
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
624
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center", children: /* @__PURE__ */ jsx("div", { className: "w-full border-t border-border" }) }),
625
+ /* @__PURE__ */ jsx("div", { className: "relative flex justify-center text-sm", children: /* @__PURE__ */ jsx("span", { className: "bg-muted px-2 text-muted-foreground", children: t("login.orContinueWith") }) })
626
+ ] }),
627
+ /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
628
+ /* @__PURE__ */ jsxs(
629
+ Button,
630
+ {
631
+ type: "button",
632
+ variant: "outline",
633
+ className: "w-full justify-center",
634
+ onClick: () => handleSocialLogin(),
635
+ children: [
636
+ /* @__PURE__ */ jsxs("svg", { className: "w-5 h-5 mr-2", viewBox: "0 0 48 48", xmlns: "http://www.w3.org/2000/svg", children: [
637
+ /* @__PURE__ */ jsx(
638
+ "path",
639
+ {
640
+ fill: "#EA4335",
641
+ d: "M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"
642
+ }
643
+ ),
644
+ /* @__PURE__ */ jsx(
645
+ "path",
646
+ {
647
+ fill: "#4285F4",
648
+ d: "M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"
649
+ }
650
+ ),
651
+ /* @__PURE__ */ jsx(
652
+ "path",
653
+ {
654
+ fill: "#FBBC05",
655
+ d: "M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"
656
+ }
657
+ ),
658
+ /* @__PURE__ */ jsx(
659
+ "path",
660
+ {
661
+ fill: "#34A853",
662
+ d: "M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"
663
+ }
664
+ ),
665
+ /* @__PURE__ */ jsx("path", { fill: "none", d: "M0 0h48v48H0z" })
666
+ ] }),
667
+ /* @__PURE__ */ jsx("span", { children: t("login.signInWithGoogle") })
668
+ ]
669
+ }
670
+ ),
671
+ /* @__PURE__ */ jsxs(
672
+ Button,
673
+ {
674
+ type: "button",
675
+ variant: "outline",
676
+ className: "w-full justify-center",
677
+ onClick: () => handleSocialLogin(),
678
+ children: [
679
+ /* @__PURE__ */ jsx(Lock, { className: "w-5 h-5 mr-2 text-[var(--chart-4)]" }),
680
+ /* @__PURE__ */ jsx("span", { children: t("login.signInWithMTLogin") })
681
+ ]
682
+ }
683
+ ),
684
+ /* @__PURE__ */ jsx(
685
+ Button,
686
+ {
687
+ type: "button",
688
+ variant: "outline",
689
+ className: "w-full justify-center font-normal",
690
+ onClick: () => handleSocialLogin(),
691
+ children: /* @__PURE__ */ jsx("span", { children: t("login.signInWithGovBr") })
692
+ }
693
+ )
694
+ ] })
695
+ ] })
696
+ ] })
697
+ ] });
698
+ }
699
+
700
+ function ResetPasswordPage() {
701
+ const navigate = useNavigate();
702
+ const { t } = useTranslation();
703
+ const [password, setPassword] = useState("");
704
+ const [confirmPassword, setConfirmPassword] = useState("");
705
+ const [isLoading, setIsLoading] = useState(false);
706
+ const [error, setError] = useState("");
707
+ const [passwordStrength, setPasswordStrength] = useState(
708
+ null
709
+ );
710
+ const checkPasswordStrength = (pwd) => {
711
+ if (pwd.length === 0) {
712
+ setPasswordStrength(null);
713
+ return;
714
+ }
715
+ if (pwd.length < 6) {
716
+ setPasswordStrength("weak");
717
+ } else if (pwd.length < 10) {
718
+ setPasswordStrength("medium");
719
+ } else {
720
+ setPasswordStrength("strong");
721
+ }
722
+ };
723
+ const handlePasswordChange = (value) => {
724
+ setPassword(value);
725
+ checkPasswordStrength(value);
726
+ setError("");
727
+ };
728
+ const handleSubmit = async (e) => {
729
+ e.preventDefault();
730
+ setError("");
731
+ if (password.length < 6) {
732
+ setError(t("resetPassword.errorMinLength"));
733
+ return;
734
+ }
735
+ if (password !== confirmPassword) {
736
+ setError(t("resetPassword.errorMismatch"));
737
+ return;
738
+ }
739
+ setIsLoading(true);
740
+ await new Promise((resolve) => setTimeout(resolve, 1500));
741
+ navigate("/login", { state: { resetSuccess: true } });
742
+ setIsLoading(false);
743
+ };
744
+ const getStrengthColor = () => {
745
+ switch (passwordStrength) {
746
+ case "weak":
747
+ return "text-destructive";
748
+ case "medium":
749
+ return "text-[var(--chart-3)]";
750
+ case "strong":
751
+ return "text-[var(--chart-2)]";
752
+ default:
753
+ return "text-muted-foreground";
754
+ }
755
+ };
756
+ const getStrengthText = () => {
757
+ switch (passwordStrength) {
758
+ case "weak":
759
+ return t("resetPassword.strengthWeak");
760
+ case "medium":
761
+ return t("resetPassword.strengthMedium");
762
+ case "strong":
763
+ return t("resetPassword.strengthStrong");
764
+ default:
765
+ return "";
766
+ }
767
+ };
768
+ return /* @__PURE__ */ jsxs("div", { className: "h-screen w-full flex overflow-y-auto", children: [
769
+ /* @__PURE__ */ jsxs("div", { className: "hidden lg:flex lg:flex-1 relative overflow-hidden", children: [
770
+ /* @__PURE__ */ jsx(
771
+ ImageWithFallback,
772
+ {
773
+ src: "https://images.unsplash.com/photo-1555949963-aa79dcee981c?w=1200&h=800&fit=crop&auto=format",
774
+ alt: t("resetPassword.heroImageAlt"),
775
+ className: "absolute inset-0 w-full h-full object-cover"
776
+ }
777
+ ),
778
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-[image:var(--gradient-diagonal)] opacity-80" })
779
+ ] }),
780
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 flex items-center justify-center px-4 sm:px-6 lg:px-8 lg:flex-none lg:w-1/2 relative bg-muted", children: [
781
+ /* @__PURE__ */ jsx("div", { className: "absolute top-4 right-4 z-20", children: /* @__PURE__ */ jsx(LanguageSelector, { variant: "minimal", showIcon: false }) }),
782
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-0 lg:hidden bg-[image:var(--gradient-diagonal)] opacity-10 dark:opacity-5" }),
783
+ /* @__PURE__ */ jsxs("div", { className: "w-full max-w-sm space-y-6 relative z-10", children: [
784
+ /* @__PURE__ */ jsxs(
785
+ "button",
786
+ {
787
+ onClick: () => navigate("/login"),
788
+ className: "flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors",
789
+ children: [
790
+ /* @__PURE__ */ jsx(ArrowLeft, { className: "w-4 h-4" }),
791
+ /* @__PURE__ */ jsx("span", { className: "text-small", children: t("resetPassword.backToLogin") })
792
+ ]
793
+ }
794
+ ),
795
+ /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
796
+ /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center mb-4", children: /* @__PURE__ */ jsx(
797
+ XerticaLogo,
798
+ {
799
+ className: "h-12 w-auto text-primary dark:text-foreground",
800
+ variant: "theme"
801
+ }
802
+ ) }),
803
+ /* @__PURE__ */ jsx("h2", { className: "text-sm text-muted-foreground", children: t("resetPassword.heading") }),
804
+ /* @__PURE__ */ jsx("p", { className: "mt-2 text-muted-foreground", children: t("resetPassword.subheading") })
805
+ ] }),
806
+ /* @__PURE__ */ jsxs("form", { className: "space-y-6", onSubmit: handleSubmit, children: [
807
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
808
+ /* @__PURE__ */ jsx(Label, { htmlFor: "password", children: t("resetPassword.newPasswordLabel") }),
809
+ /* @__PURE__ */ jsx(
810
+ Input,
811
+ {
812
+ id: "password",
813
+ name: "password",
814
+ type: "password",
815
+ required: true,
816
+ className: "w-full",
817
+ placeholder: "••••••••",
818
+ value: password,
819
+ onChange: (e) => handlePasswordChange(e.target.value)
820
+ }
821
+ ),
822
+ passwordStrength && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
823
+ /* @__PURE__ */ jsx("div", { className: "flex-1 h-1 bg-muted rounded-full overflow-hidden", children: /* @__PURE__ */ jsx(
824
+ "div",
825
+ {
826
+ className: `h-full transition-all duration-300 ${passwordStrength === "weak" ? "w-1/3 bg-destructive" : passwordStrength === "medium" ? "w-2/3 bg-[var(--chart-3)]" : "w-full bg-[var(--chart-2)]"}`
827
+ }
828
+ ) }),
829
+ /* @__PURE__ */ jsx("span", { className: `text-small ${getStrengthColor()}`, children: getStrengthText() })
830
+ ] })
831
+ ] }),
832
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
833
+ /* @__PURE__ */ jsx(Label, { htmlFor: "confirmPassword", children: t("resetPassword.confirmPasswordLabel") }),
834
+ /* @__PURE__ */ jsx(
835
+ Input,
836
+ {
837
+ id: "confirmPassword",
838
+ name: "confirmPassword",
839
+ type: "password",
840
+ required: true,
841
+ className: "w-full",
842
+ placeholder: "••••••••",
843
+ value: confirmPassword,
844
+ onChange: (e) => {
845
+ setConfirmPassword(e.target.value);
846
+ setError("");
847
+ }
848
+ }
849
+ )
850
+ ] }),
851
+ /* @__PURE__ */ jsxs("div", { className: "bg-accent rounded-[var(--radius)] p-4 space-y-2", children: [
852
+ /* @__PURE__ */ jsx("p", { className: "text-sm", children: t("resetPassword.requirements") }),
853
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
854
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
855
+ /* @__PURE__ */ jsx(
856
+ CheckCircle2,
857
+ {
858
+ className: `w-4 h-4 ${password.length >= 6 ? "text-[var(--chart-2)]" : "text-muted-foreground"}`
859
+ }
860
+ ),
861
+ /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: t("resetPassword.requirementMinChars") })
862
+ ] }),
863
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
864
+ /* @__PURE__ */ jsx(
865
+ CheckCircle2,
866
+ {
867
+ className: `w-4 h-4 ${password === confirmPassword && password.length > 0 ? "text-[var(--chart-2)]" : "text-muted-foreground"}`
868
+ }
869
+ ),
870
+ /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: t("resetPassword.requirementMatch") })
871
+ ] })
872
+ ] })
873
+ ] }),
874
+ error && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-destructive bg-destructive/10 rounded-[var(--radius)] p-3", children: [
875
+ /* @__PURE__ */ jsx(AlertCircle, { className: "w-4 h-4 flex-shrink-0" }),
876
+ /* @__PURE__ */ jsx("span", { className: "text-sm", children: error })
877
+ ] }),
878
+ /* @__PURE__ */ jsx(Button, { type: "submit", className: "w-full", disabled: isLoading, children: isLoading ? t("resetPassword.submitting") : t("resetPassword.submit") })
879
+ ] })
880
+ ] })
881
+ ] })
882
+ ] });
883
+ }
884
+
885
+ function createLucideIconSvg(iconName) {
886
+ const iconPaths = {
887
+ utensils: '<path d="M3 2v7c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V2"></path><path d="M7 2v20"></path><path d="M21 15V2v0a5 5 0 0 0-5 5v6c0 1.1.9 2 2 2h3Zm0 0v7"></path>',
888
+ hotel: '<path d="M18 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2Z"></path><path d="M8 6h8"></path><path d="M8 10h8"></path><path d="M8 14h8"></path><path d="M8 18h8"></path>',
889
+ landmark: '<path d="m3 21 18-18"></path><path d="M9 15V6h6v9"></path><path d="M12 3v3"></path><path d="M3 15h18"></path><path d="M6 21v-6"></path><path d="M18 21v-6"></path>',
890
+ shopping: '<path d="M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z"></path><path d="M3 6h18"></path><path d="M16 10a4 4 0 0 1-8 0"></path>',
891
+ coffee: '<path d="M17 8h1a4 4 0 1 1 0 8h-1"></path><path d="M3 8h14v9a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4Z"></path><line x1="6" x2="6" y1="2" y2="4"></line><line x1="10" x2="10" y1="2" y2="4"></line><line x1="14" x2="14" y1="2" y2="4"></line>'
892
+ };
893
+ const path = iconPaths[iconName] || "";
894
+ return `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">${path}</svg>`;
895
+ }
896
+ const markerGroups = {
897
+ restaurant: {
898
+ id: "restaurant",
899
+ name: "Restaurantes",
900
+ color: "var(--destructive)",
901
+ // red
902
+ iconColor: "#FFFFFF",
903
+ // white para contraste
904
+ iconName: "utensils",
905
+ icon: Utensils
906
+ },
907
+ hotel: {
908
+ id: "hotel",
909
+ name: "Hotéis",
910
+ color: "var(--info)",
911
+ // blue
912
+ iconColor: "#FFFFFF",
913
+ iconName: "hotel",
914
+ icon: Hotel
915
+ },
916
+ landmark: {
917
+ id: "landmark",
918
+ name: "Pontos Turísticos",
919
+ color: "var(--success)",
920
+ // green
921
+ iconColor: "#FFFFFF",
922
+ iconName: "landmark",
923
+ icon: Landmark
924
+ },
925
+ shopping: {
926
+ id: "shopping",
927
+ name: "Compras",
928
+ color: "var(--warning)",
929
+ // orange
930
+ iconColor: "#FFFFFF",
931
+ iconName: "shopping",
932
+ icon: ShoppingBag
933
+ },
934
+ cafe: {
935
+ id: "cafe",
936
+ name: "Cafeterias",
937
+ color: "var(--primary)",
938
+ // purple
939
+ iconColor: "#FFFFFF",
940
+ iconName: "coffee",
941
+ icon: Coffee
942
+ }
943
+ };
944
+ const sampleLocations = [
945
+ // Restaurantes
946
+ {
947
+ position: { lat: -23.5505, lng: -46.6333 },
948
+ title: "Restaurante Italiano",
949
+ info: "Melhor pizza da cidade",
950
+ group: "restaurant"
951
+ },
952
+ {
953
+ position: { lat: -23.5485, lng: -46.635 },
954
+ title: "Sushi Bar",
955
+ info: "Comida japonesa autêntica",
956
+ group: "restaurant"
957
+ },
958
+ {
959
+ position: { lat: -23.552, lng: -46.631 },
960
+ title: "Churrascaria Premium",
961
+ info: "Rodízio tradicional brasileiro",
962
+ group: "restaurant"
963
+ },
964
+ // Hotéis
965
+ {
966
+ position: { lat: -23.5475, lng: -46.6361 },
967
+ title: "Hotel Luxo",
968
+ info: "5 estrelas - Vista panorâmica",
969
+ group: "hotel"
970
+ },
971
+ {
972
+ position: { lat: -23.553, lng: -46.634 },
973
+ title: "Hotel Boutique",
974
+ info: "Design moderno e aconchegante",
975
+ group: "hotel"
976
+ },
977
+ // Pontos Turísticos
978
+ {
979
+ position: { lat: -23.5613, lng: -46.6563 },
980
+ title: "Parque Ibirapuera",
981
+ info: "Maior parque urbano da cidade",
982
+ group: "landmark"
983
+ },
984
+ {
985
+ position: { lat: -23.5558, lng: -46.6396 },
986
+ title: "MASP",
987
+ info: "Museu de Arte de São Paulo",
988
+ group: "landmark"
989
+ },
990
+ {
991
+ position: { lat: -23.5489, lng: -46.6388 },
992
+ title: "Avenida Paulista",
993
+ info: "Centro financeiro e cultural",
994
+ group: "landmark"
995
+ },
996
+ // Shopping
997
+ {
998
+ position: { lat: -23.5465, lng: -46.64 },
999
+ title: "Shopping Center",
1000
+ info: "Mais de 300 lojas",
1001
+ group: "shopping"
1002
+ },
1003
+ {
1004
+ position: { lat: -23.554, lng: -46.638 },
1005
+ title: "Galeria de Arte",
1006
+ info: "Arte contemporânea e design",
1007
+ group: "shopping"
1008
+ },
1009
+ // Cafeterias
1010
+ {
1011
+ position: { lat: -23.5495, lng: -46.6345 },
1012
+ title: "Café Artesanal",
1013
+ info: "Café especial e brunch",
1014
+ group: "cafe"
1015
+ },
1016
+ {
1017
+ position: { lat: -23.551, lng: -46.637 },
1018
+ title: "Coffee House",
1019
+ info: "Café gourmet e wi-fi",
1020
+ group: "cafe"
1021
+ },
1022
+ {
1023
+ position: { lat: -23.5525, lng: -46.6355 },
1024
+ title: "Café Cultural",
1025
+ info: "Livros e café",
1026
+ group: "cafe"
1027
+ }
1028
+ ];
1029
+ function FilterableMapExample({ apiKey }) {
1030
+ const [activeFilters, setActiveFilters] = useState(
1031
+ new Set(Object.keys(markerGroups))
1032
+ );
1033
+ const [showFilters, setShowFilters] = useState(true);
1034
+ const filteredLocations = useMemo(() => {
1035
+ return sampleLocations.filter((location) => activeFilters.has(location.group));
1036
+ }, [activeFilters]);
1037
+ const toggleFilter = (groupId) => {
1038
+ setActiveFilters((prev) => {
1039
+ const newFilters = new Set(prev);
1040
+ if (newFilters.has(groupId)) {
1041
+ newFilters.delete(groupId);
1042
+ } else {
1043
+ newFilters.add(groupId);
1044
+ }
1045
+ return newFilters;
1046
+ });
1047
+ };
1048
+ const toggleAll = () => {
1049
+ if (activeFilters.size === Object.keys(markerGroups).length) {
1050
+ setActiveFilters(/* @__PURE__ */ new Set());
1051
+ } else {
1052
+ setActiveFilters(new Set(Object.keys(markerGroups)));
1053
+ }
1054
+ };
1055
+ const markersWithCustomization = filteredLocations.map((location) => ({
1056
+ ...location,
1057
+ customColor: markerGroups[location.group].color,
1058
+ iconSvg: createLucideIconSvg(markerGroups[location.group].iconName),
1059
+ iconColor: markerGroups[location.group].iconColor
1060
+ }));
1061
+ const getGroupCount = (groupId) => {
1062
+ return sampleLocations.filter((loc) => loc.group === groupId).length;
1063
+ };
1064
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
1065
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
1066
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1067
+ /* @__PURE__ */ jsx(MapPin, { className: "w-5 h-5 text-primary" }),
1068
+ /* @__PURE__ */ jsx("h3", { children: "Filtro por Categorias" })
1069
+ ] }),
1070
+ /* @__PURE__ */ jsxs(Badge, { variant: "secondary", children: [
1071
+ filteredLocations.length,
1072
+ " de ",
1073
+ sampleLocations.length,
1074
+ " locais"
1075
+ ] })
1076
+ ] }),
1077
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: "Use os filtros compactos no canto superior esquerdo do mapa para visualizar marcadores por categoria" }),
1078
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
1079
+ /* @__PURE__ */ jsx(
1080
+ Map,
1081
+ {
1082
+ center: { lat: -23.5505, lng: -46.6333 },
1083
+ zoom: 14,
1084
+ markers: markersWithCustomization,
1085
+ height: "500px",
1086
+ zoomControl: true,
1087
+ fullscreenControl: true,
1088
+ apiKey
1089
+ }
1090
+ ),
1091
+ /* @__PURE__ */ jsx(
1092
+ "div",
1093
+ {
1094
+ className: cn(
1095
+ "absolute top-4 left-4 z-10 transition-all duration-300",
1096
+ showFilters ? "translate-x-0" : "-translate-x-full"
1097
+ ),
1098
+ children: /* @__PURE__ */ jsxs("div", { className: "p-2.5 rounded-lg shadow-[var(--shadow-elevation-sm)] bg-card border border-border max-w-[220px]", children: [
1099
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2 gap-2", children: [
1100
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
1101
+ /* @__PURE__ */ jsx(Filter, { className: "w-3.5 h-3.5 text-foreground" }),
1102
+ /* @__PURE__ */ jsx("span", { className: "text-sm text-foreground", children: "Filtros" })
1103
+ ] }),
1104
+ /* @__PURE__ */ jsx(
1105
+ Button,
1106
+ {
1107
+ size: "sm",
1108
+ variant: "ghost",
1109
+ onClick: () => setShowFilters(false),
1110
+ className: "h-5 w-5 p-0",
1111
+ children: /* @__PURE__ */ jsx(X, { className: "w-3 h-3" })
1112
+ }
1113
+ )
1114
+ ] }),
1115
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
1116
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2 py-0.5", children: [
1117
+ /* @__PURE__ */ jsx(
1118
+ Checkbox,
1119
+ {
1120
+ id: "filter-all",
1121
+ checked: activeFilters.size === Object.keys(markerGroups).length,
1122
+ onCheckedChange: toggleAll
1123
+ }
1124
+ ),
1125
+ /* @__PURE__ */ jsxs(
1126
+ Label,
1127
+ {
1128
+ htmlFor: "filter-all",
1129
+ className: "flex items-center gap-1.5 cursor-pointer text-sm",
1130
+ children: [
1131
+ /* @__PURE__ */ jsx(MapPin, { className: "w-3.5 h-3.5" }),
1132
+ "Todos",
1133
+ /* @__PURE__ */ jsx(Badge, { variant: "secondary", className: "text-xs h-4 px-1", children: sampleLocations.length })
1134
+ ]
1135
+ }
1136
+ )
1137
+ ] }),
1138
+ Object.entries(markerGroups).map(([id, group]) => {
1139
+ const groupId = id;
1140
+ const Icon = group.icon;
1141
+ const isActive = activeFilters.has(groupId);
1142
+ const count = getGroupCount(groupId);
1143
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2 py-0.5", children: [
1144
+ /* @__PURE__ */ jsx(
1145
+ Checkbox,
1146
+ {
1147
+ id: `filter-${id}`,
1148
+ checked: isActive,
1149
+ onCheckedChange: () => toggleFilter(groupId)
1150
+ }
1151
+ ),
1152
+ /* @__PURE__ */ jsxs(
1153
+ Label,
1154
+ {
1155
+ htmlFor: `filter-${id}`,
1156
+ className: "flex items-center gap-1.5 cursor-pointer text-sm",
1157
+ children: [
1158
+ /* @__PURE__ */ jsx(Icon, { className: "w-3.5 h-3.5", style: { color: group.color } }),
1159
+ /* @__PURE__ */ jsx("span", { className: isActive ? "text-foreground" : "text-muted-foreground", children: group.name }),
1160
+ /* @__PURE__ */ jsx(Badge, { variant: "outline", className: "text-xs h-4 px-1", children: count })
1161
+ ]
1162
+ }
1163
+ )
1164
+ ] }, id);
1165
+ })
1166
+ ] })
1167
+ ] })
1168
+ }
1169
+ ),
1170
+ !showFilters && /* @__PURE__ */ jsxs(
1171
+ Button,
1172
+ {
1173
+ size: "sm",
1174
+ onClick: () => setShowFilters(true),
1175
+ className: "absolute top-4 left-4 z-10 h-8 bg-primary text-primary-foreground",
1176
+ children: [
1177
+ /* @__PURE__ */ jsx(Filter, { className: "w-3.5 h-3.5 mr-1.5" }),
1178
+ "Filtros"
1179
+ ]
1180
+ }
1181
+ )
1182
+ ] }),
1183
+ /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-3 justify-center pt-2 border-t border-border", children: Object.entries(markerGroups).map(([id, group]) => {
1184
+ const Icon = group.icon;
1185
+ const count = getGroupCount(id);
1186
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 px-3 py-1 rounded-lg bg-muted", children: [
1187
+ /* @__PURE__ */ jsx("div", { className: "w-3 h-3 rounded-full", style: { backgroundColor: group.color } }),
1188
+ /* @__PURE__ */ jsx(Icon, { className: "w-4 h-4", style: { color: group.color } }),
1189
+ /* @__PURE__ */ jsx("span", { className: "text-sm", style: { color: "var(--foreground)" }, children: group.name }),
1190
+ /* @__PURE__ */ jsx(Badge, { variant: "secondary", className: "text-xs h-5", children: count })
1191
+ ] }, id);
1192
+ }) }),
1193
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-3", children: [
1194
+ /* @__PURE__ */ jsxs("div", { className: "text-center p-3 rounded-lg bg-muted", children: [
1195
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: "Total de Locais" }),
1196
+ /* @__PURE__ */ jsx("p", { className: "text-2xl text-foreground", children: sampleLocations.length })
1197
+ ] }),
1198
+ /* @__PURE__ */ jsxs("div", { className: "text-center p-3 rounded-lg bg-muted", children: [
1199
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: "Visíveis" }),
1200
+ /* @__PURE__ */ jsx("p", { className: "text-2xl text-primary", children: filteredLocations.length })
1201
+ ] }),
1202
+ /* @__PURE__ */ jsxs("div", { className: "text-center p-3 rounded-lg bg-muted", children: [
1203
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: "Categorias" }),
1204
+ /* @__PURE__ */ jsx("p", { className: "text-2xl text-foreground", children: Object.keys(markerGroups).length })
1205
+ ] }),
1206
+ /* @__PURE__ */ jsxs("div", { className: "text-center p-3 rounded-lg bg-muted", children: [
1207
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: "Filtros Ativos" }),
1208
+ /* @__PURE__ */ jsx("p", { className: "text-2xl text-chart-2", children: activeFilters.size })
1209
+ ] })
1210
+ ] })
1211
+ ] });
1212
+ }
1213
+
1214
+ function DrawingMapExample({ apiKey }) {
1215
+ const [mapInstance, setMapInstance] = useState(null);
1216
+ const [selectedMode, setSelectedMode] = useState(null);
1217
+ const [shapes, setShapes] = useState([]);
1218
+ const [showSaveDialog, setShowSaveDialog] = useState(false);
1219
+ const [savedData, setSavedData] = useState("");
1220
+ const [isDrawingPolygon, setIsDrawingPolygon] = useState(false);
1221
+ const tempPolylineRef = useRef(null);
1222
+ const polygonPathRef = useRef([]);
1223
+ const mapListenersRef = useRef([]);
1224
+ const colors = {
1225
+ fill: "#2C275B",
1226
+ // Primary do CSS
1227
+ stroke: "#2C275B",
1228
+ fillOpacity: 0.2,
1229
+ strokeWeight: 2,
1230
+ editable: true,
1231
+ draggable: true
1232
+ };
1233
+ const addMarker = useCallback(
1234
+ (position) => {
1235
+ if (!mapInstance) return;
1236
+ const marker = new google.maps.marker.AdvancedMarkerElement({
1237
+ position,
1238
+ map: mapInstance,
1239
+ gmpDraggable: true,
1240
+ // Propriedade correta para AdvancedMarkerElement
1241
+ title: "Marcador"
1242
+ });
1243
+ marker.addListener("dragend", () => {
1244
+ toast.info("Posição do marcador atualizada");
1245
+ });
1246
+ const newShape = { type: "marker", overlay: marker };
1247
+ setShapes((prev) => [...prev, newShape]);
1248
+ toast.success("Marcador adicionado");
1249
+ },
1250
+ [mapInstance]
1251
+ );
1252
+ const addCircle = useCallback(
1253
+ (center) => {
1254
+ if (!mapInstance) return;
1255
+ const circle = new google.maps.Circle({
1256
+ map: mapInstance,
1257
+ center,
1258
+ radius: 500,
1259
+ fillColor: colors.fill,
1260
+ fillOpacity: colors.fillOpacity,
1261
+ strokeColor: colors.stroke,
1262
+ strokeWeight: colors.strokeWeight,
1263
+ editable: true,
1264
+ draggable: true
1265
+ });
1266
+ const newShape = { type: "circle", overlay: circle };
1267
+ setShapes((prev) => [...prev, newShape]);
1268
+ toast.success("Círculo adicionado");
1269
+ },
1270
+ [mapInstance, colors]
1271
+ );
1272
+ const addRectangle = useCallback(
1273
+ (center) => {
1274
+ if (!mapInstance) return;
1275
+ const offset = 5e-3;
1276
+ const bounds = {
1277
+ north: center.lat() + offset,
1278
+ south: center.lat() - offset,
1279
+ east: center.lng() + offset,
1280
+ west: center.lng() - offset
1281
+ };
1282
+ const rectangle = new google.maps.Rectangle({
1283
+ map: mapInstance,
1284
+ bounds,
1285
+ fillColor: colors.fill,
1286
+ fillOpacity: colors.fillOpacity,
1287
+ strokeColor: colors.stroke,
1288
+ strokeWeight: colors.strokeWeight,
1289
+ editable: true,
1290
+ draggable: true
1291
+ });
1292
+ const newShape = { type: "rectangle", overlay: rectangle };
1293
+ setShapes((prev) => [...prev, newShape]);
1294
+ toast.success("Retângulo adicionado");
1295
+ },
1296
+ [mapInstance, colors]
1297
+ );
1298
+ const cancelPolygonDrawing = useCallback(() => {
1299
+ if (tempPolylineRef.current) {
1300
+ tempPolylineRef.current.setMap(null);
1301
+ tempPolylineRef.current = null;
1302
+ }
1303
+ polygonPathRef.current = [];
1304
+ setIsDrawingPolygon(false);
1305
+ }, []);
1306
+ const finishPolygon = useCallback(() => {
1307
+ if (!mapInstance || polygonPathRef.current.length < 3) {
1308
+ if (polygonPathRef.current.length < 3 && polygonPathRef.current.length > 0) {
1309
+ toast.error("Polígono precisa de pelo menos 3 pontos.");
1310
+ }
1311
+ return;
1312
+ }
1313
+ const polygon = new google.maps.Polygon({
1314
+ map: mapInstance,
1315
+ paths: polygonPathRef.current,
1316
+ fillColor: colors.fill,
1317
+ fillOpacity: colors.fillOpacity,
1318
+ strokeColor: colors.stroke,
1319
+ strokeWeight: colors.strokeWeight,
1320
+ editable: true,
1321
+ draggable: true
1322
+ });
1323
+ const newShape = { type: "polygon", overlay: polygon };
1324
+ setShapes((prev) => [...prev, newShape]);
1325
+ cancelPolygonDrawing();
1326
+ toast.success("Polígono criado com sucesso!");
1327
+ }, [mapInstance, colors, cancelPolygonDrawing]);
1328
+ const addPolygonPoint = useCallback(
1329
+ (point) => {
1330
+ if (!mapInstance) return;
1331
+ if (!isDrawingPolygon) {
1332
+ setIsDrawingPolygon(true);
1333
+ polygonPathRef.current = [point];
1334
+ tempPolylineRef.current = new google.maps.Polyline({
1335
+ map: mapInstance,
1336
+ path: polygonPathRef.current,
1337
+ strokeColor: colors.stroke,
1338
+ strokeOpacity: 0.8,
1339
+ strokeWeight: 2,
1340
+ geodesic: true,
1341
+ clickable: false
1342
+ // Importante: não capturar cliques para não atrapalhar o mapa
1343
+ });
1344
+ toast.info("Clique para adicionar pontos. Duplo clique ou botão check para fechar.", {
1345
+ duration: 4e3
1346
+ });
1347
+ } else {
1348
+ polygonPathRef.current.push(point);
1349
+ tempPolylineRef.current?.setPath(polygonPathRef.current);
1350
+ }
1351
+ },
1352
+ [mapInstance, isDrawingPolygon, colors]
1353
+ );
1354
+ const clearListeners = () => {
1355
+ mapListenersRef.current.forEach((listener) => google.maps.event.removeListener(listener));
1356
+ mapListenersRef.current = [];
1357
+ };
1358
+ useEffect(() => {
1359
+ if (!mapInstance) return;
1360
+ clearListeners();
1361
+ if (!selectedMode) {
1362
+ mapInstance.setOptions({ draggableCursor: "grab", clickableIcons: true });
1363
+ return;
1364
+ }
1365
+ mapInstance.setOptions({
1366
+ draggableCursor: "crosshair",
1367
+ clickableIcons: false
1368
+ });
1369
+ const clickListener = mapInstance.addListener("click", (e) => {
1370
+ if (!e.latLng) return;
1371
+ switch (selectedMode) {
1372
+ case "marker":
1373
+ addMarker(e.latLng);
1374
+ break;
1375
+ case "circle":
1376
+ addCircle(e.latLng);
1377
+ break;
1378
+ case "rectangle":
1379
+ addRectangle(e.latLng);
1380
+ break;
1381
+ case "polygon":
1382
+ addPolygonPoint(e.latLng);
1383
+ break;
1384
+ }
1385
+ });
1386
+ mapListenersRef.current.push(clickListener);
1387
+ if (selectedMode === "polygon") {
1388
+ const dblClickListener = mapInstance.addListener("dblclick", (e) => {
1389
+ if (e.domEvent) e.domEvent.stopPropagation();
1390
+ finishPolygon();
1391
+ });
1392
+ mapListenersRef.current.push(dblClickListener);
1393
+ }
1394
+ return () => {
1395
+ clearListeners();
1396
+ };
1397
+ }, [
1398
+ mapInstance,
1399
+ selectedMode,
1400
+ addMarker,
1401
+ addCircle,
1402
+ addRectangle,
1403
+ addPolygonPoint,
1404
+ finishPolygon
1405
+ ]);
1406
+ const handleModeChange = (mode) => {
1407
+ if (isDrawingPolygon) {
1408
+ cancelPolygonDrawing();
1409
+ }
1410
+ setSelectedMode(mode);
1411
+ };
1412
+ const clearAll = () => {
1413
+ shapes.forEach((shape) => {
1414
+ if ("setMap" in shape.overlay) shape.overlay.setMap(null);
1415
+ else shape.overlay.map = null;
1416
+ });
1417
+ setShapes([]);
1418
+ if (isDrawingPolygon) cancelPolygonDrawing();
1419
+ toast.info("Mapa limpo");
1420
+ };
1421
+ const undoLast = () => {
1422
+ if (isDrawingPolygon) {
1423
+ if (polygonPathRef.current.length > 0) {
1424
+ polygonPathRef.current.pop();
1425
+ tempPolylineRef.current?.setPath(polygonPathRef.current);
1426
+ if (polygonPathRef.current.length === 0) {
1427
+ cancelPolygonDrawing();
1428
+ }
1429
+ }
1430
+ return;
1431
+ }
1432
+ if (shapes.length === 0) return;
1433
+ const lastShape = shapes[shapes.length - 1];
1434
+ if ("setMap" in lastShape.overlay) lastShape.overlay.setMap(null);
1435
+ else lastShape.overlay.map = null;
1436
+ setShapes((prev) => prev.slice(0, prev.length - 1));
1437
+ };
1438
+ const handleSave = () => {
1439
+ if (shapes.length === 0) {
1440
+ toast.error("Adicione desenhos ao mapa antes de salvar.");
1441
+ return;
1442
+ }
1443
+ const exportData = shapes.map((s) => {
1444
+ let data = {};
1445
+ if (s.type === "marker") {
1446
+ const marker = s.overlay;
1447
+ const pos = marker.position;
1448
+ if (pos) {
1449
+ const lat = typeof pos.lat === "function" ? pos.lat() : pos.lat;
1450
+ const lng = typeof pos.lng === "function" ? pos.lng() : pos.lng;
1451
+ data = { lat, lng };
1452
+ }
1453
+ } else if (s.type === "circle") {
1454
+ const circle = s.overlay;
1455
+ data = {
1456
+ center: { lat: circle.getCenter()?.lat(), lng: circle.getCenter()?.lng() },
1457
+ radius: circle.getRadius()
1458
+ };
1459
+ } else if (s.type === "rectangle") {
1460
+ const rect = s.overlay;
1461
+ const bounds = rect.getBounds();
1462
+ data = {
1463
+ north: bounds?.getNorthEast().lat(),
1464
+ south: bounds?.getSouthWest().lat(),
1465
+ east: bounds?.getNorthEast().lng(),
1466
+ west: bounds?.getSouthWest().lng()
1467
+ };
1468
+ } else if (s.type === "polygon") {
1469
+ const poly = s.overlay;
1470
+ const path = poly.getPath();
1471
+ data = path.getArray().map((coord) => ({ lat: coord.lat(), lng: coord.lng() }));
1472
+ }
1473
+ return { type: s.type, data };
1474
+ });
1475
+ setSavedData(JSON.stringify(exportData, null, 2));
1476
+ setShowSaveDialog(true);
1477
+ };
1478
+ const ToolButton = ({
1479
+ active,
1480
+ onClick,
1481
+ icon: Icon,
1482
+ label
1483
+ }) => /* @__PURE__ */ jsxs(
1484
+ Button,
1485
+ {
1486
+ variant: active ? "default" : "ghost",
1487
+ className: `w-full justify-start gap-3 ${active ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:text-foreground"}`,
1488
+ onClick,
1489
+ children: [
1490
+ /* @__PURE__ */ jsx(Icon, { className: "h-4 w-4" }),
1491
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: label })
1492
+ ]
1493
+ }
1494
+ );
1495
+ return /* @__PURE__ */ jsxs(Card, { className: "h-full border-0 shadow-none md:border md:shadow-sm", children: [
1496
+ /* @__PURE__ */ jsx(CardHeader, { className: "border-b bg-muted/20 pb-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
1497
+ /* @__PURE__ */ jsxs("div", { children: [
1498
+ /* @__PURE__ */ jsx(CardTitle, { children: "Ferramentas de Desenho" }),
1499
+ /* @__PURE__ */ jsx(CardDescription, { className: "mt-1", children: "Crie geometrias personalizadas no mapa" })
1500
+ ] }),
1501
+ /* @__PURE__ */ jsxs(Badge, { variant: "outline", className: "h-6", children: [
1502
+ shapes.length,
1503
+ " ",
1504
+ shapes.length === 1 ? "elemento" : "elementos"
1505
+ ] })
1506
+ ] }) }),
1507
+ /* @__PURE__ */ jsxs(CardContent, { className: "p-0 flex flex-col md:flex-row h-[600px] bg-background", children: [
1508
+ /* @__PURE__ */ jsxs("div", { className: "w-full md:w-64 border-b md:border-b-0 md:border-r bg-muted/10 flex flex-col", children: [
1509
+ /* @__PURE__ */ jsx(ScrollArea, { className: "flex-1", children: /* @__PURE__ */ jsxs("div", { className: "p-4 space-y-6", children: [
1510
+ /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
1511
+ /* @__PURE__ */ jsx("h4", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider px-2", children: "Ferramentas" }),
1512
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
1513
+ /* @__PURE__ */ jsx(
1514
+ ToolButton,
1515
+ {
1516
+ active: selectedMode === null,
1517
+ onClick: () => handleModeChange(null),
1518
+ icon: MousePointer2,
1519
+ label: "Navegar"
1520
+ }
1521
+ ),
1522
+ /* @__PURE__ */ jsx(
1523
+ ToolButton,
1524
+ {
1525
+ active: selectedMode === "marker",
1526
+ onClick: () => handleModeChange("marker"),
1527
+ icon: MapPin,
1528
+ label: "Marcador"
1529
+ }
1530
+ ),
1531
+ /* @__PURE__ */ jsx(
1532
+ ToolButton,
1533
+ {
1534
+ active: selectedMode === "circle",
1535
+ onClick: () => handleModeChange("circle"),
1536
+ icon: Circle,
1537
+ label: "Círculo"
1538
+ }
1539
+ ),
1540
+ /* @__PURE__ */ jsx(
1541
+ ToolButton,
1542
+ {
1543
+ active: selectedMode === "rectangle",
1544
+ onClick: () => handleModeChange("rectangle"),
1545
+ icon: Square,
1546
+ label: "Retângulo"
1547
+ }
1548
+ ),
1549
+ /* @__PURE__ */ jsx(
1550
+ ToolButton,
1551
+ {
1552
+ active: selectedMode === "polygon",
1553
+ onClick: () => handleModeChange("polygon"),
1554
+ icon: Hexagon,
1555
+ label: "Polígono"
1556
+ }
1557
+ )
1558
+ ] })
1559
+ ] }),
1560
+ /* @__PURE__ */ jsx(Separator, {}),
1561
+ /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
1562
+ /* @__PURE__ */ jsx("h4", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider px-2", children: "Ações" }),
1563
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-2", children: [
1564
+ /* @__PURE__ */ jsxs(
1565
+ Button,
1566
+ {
1567
+ variant: "outline",
1568
+ onClick: undoLast,
1569
+ disabled: shapes.length === 0 && !isDrawingPolygon,
1570
+ className: "w-full",
1571
+ title: "Desfazer último",
1572
+ "aria-label": "Desfazer último",
1573
+ children: [
1574
+ /* @__PURE__ */ jsx(Undo, { className: "h-4 w-4 mr-2" }),
1575
+ "Desfazer"
1576
+ ]
1577
+ }
1578
+ ),
1579
+ /* @__PURE__ */ jsxs(
1580
+ Button,
1581
+ {
1582
+ variant: "destructive",
1583
+ onClick: clearAll,
1584
+ disabled: shapes.length === 0 && !isDrawingPolygon,
1585
+ className: "w-full bg-destructive/10 text-destructive hover:bg-destructive hover:text-destructive-foreground border-0 shadow-none",
1586
+ children: [
1587
+ /* @__PURE__ */ jsx(Trash2, { className: "h-4 w-4 mr-2" }),
1588
+ "Limpar"
1589
+ ]
1590
+ }
1591
+ )
1592
+ ] }),
1593
+ /* @__PURE__ */ jsxs(
1594
+ Button,
1595
+ {
1596
+ variant: "default",
1597
+ onClick: handleSave,
1598
+ disabled: shapes.length === 0,
1599
+ className: "w-full mt-2",
1600
+ children: [
1601
+ /* @__PURE__ */ jsx(Save, { className: "h-4 w-4 mr-2" }),
1602
+ "Salvar GeoJSON"
1603
+ ]
1604
+ }
1605
+ )
1606
+ ] })
1607
+ ] }) }),
1608
+ isDrawingPolygon && /* @__PURE__ */ jsxs("div", { className: "p-4 bg-primary/5 border-t border-primary/10", children: [
1609
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2 text-primary text-xs font-medium", children: [
1610
+ /* @__PURE__ */ jsxs("span", { className: "relative flex h-2 w-2", children: [
1611
+ /* @__PURE__ */ jsx("span", { className: "animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75" }),
1612
+ /* @__PURE__ */ jsx("span", { className: "relative inline-flex rounded-full h-2 w-2 bg-primary" })
1613
+ ] }),
1614
+ "Desenhando Polígono..."
1615
+ ] }),
1616
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
1617
+ /* @__PURE__ */ jsxs(
1618
+ Button,
1619
+ {
1620
+ size: "sm",
1621
+ className: "w-full bg-green-600 hover:bg-green-700 text-white",
1622
+ onClick: finishPolygon,
1623
+ children: [
1624
+ /* @__PURE__ */ jsx(Check, { className: "h-3 w-3 mr-1" }),
1625
+ " Concluir"
1626
+ ]
1627
+ }
1628
+ ),
1629
+ /* @__PURE__ */ jsxs(
1630
+ Button,
1631
+ {
1632
+ size: "sm",
1633
+ variant: "outline",
1634
+ className: "w-full",
1635
+ onClick: cancelPolygonDrawing,
1636
+ children: [
1637
+ /* @__PURE__ */ jsx(X, { className: "h-3 w-3 mr-1" }),
1638
+ " Cancelar"
1639
+ ]
1640
+ }
1641
+ )
1642
+ ] })
1643
+ ] })
1644
+ ] }),
1645
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 relative bg-muted/5 min-h-[400px]", children: [
1646
+ /* @__PURE__ */ jsx(
1647
+ Map,
1648
+ {
1649
+ className: "h-full w-full rounded-none md:rounded-br-lg",
1650
+ center: { lat: -23.5505, lng: -46.6333 },
1651
+ zoom: 13,
1652
+ height: "100%",
1653
+ mapContainerClassName: "h-full w-full rounded-none md:rounded-br-lg",
1654
+ disableDefaultUI: true,
1655
+ zoomControl: true,
1656
+ onMapLoad: setMapInstance,
1657
+ apiKey
1658
+ }
1659
+ ),
1660
+ selectedMode && !isDrawingPolygon && /* @__PURE__ */ jsxs("div", { className: "absolute bottom-6 left-1/2 -translate-x-1/2 bg-background/90 backdrop-blur border px-4 py-2 rounded-full shadow-sm text-xs font-medium text-muted-foreground pointer-events-none z-10", children: [
1661
+ selectedMode === "marker" && "Clique no mapa para adicionar um marcador",
1662
+ selectedMode === "circle" && "Clique no mapa para definir o centro do círculo",
1663
+ selectedMode === "rectangle" && "Clique no mapa para criar um retângulo",
1664
+ selectedMode === "polygon" && "Clique sequencialmente para desenhar a área"
1665
+ ] })
1666
+ ] }),
1667
+ /* @__PURE__ */ jsx(Dialog, { open: showSaveDialog, onOpenChange: setShowSaveDialog, children: /* @__PURE__ */ jsxs(DialogContent, { className: "max-w-md", children: [
1668
+ /* @__PURE__ */ jsxs(DialogHeader, { children: [
1669
+ /* @__PURE__ */ jsx(DialogTitle, { children: "Dados Geográficos (GeoJSON)" }),
1670
+ /* @__PURE__ */ jsx(DialogDescription, { children: "Copie os dados das formas desenhadas abaixo." })
1671
+ ] }),
1672
+ /* @__PURE__ */ jsx("div", { className: "relative mt-2", children: /* @__PURE__ */ jsx(
1673
+ "pre",
1674
+ {
1675
+ className: "p-4 rounded-lg bg-muted overflow-auto max-h-[300px] text-xs font-mono",
1676
+ "data-custom-scrollbar": true,
1677
+ children: savedData
1678
+ }
1679
+ ) }),
1680
+ /* @__PURE__ */ jsx("div", { className: "flex justify-end mt-4", children: /* @__PURE__ */ jsx(Button, { onClick: () => setShowSaveDialog(false), children: "Fechar" }) })
1681
+ ] }) })
1682
+ ] })
1683
+ ] });
1684
+ }
1685
+
1686
+ function MapShowcase() {
1687
+ const [activeTab, setActiveTab] = useState("simple");
1688
+ const [isTransitioning, setIsTransitioning] = useState(false);
1689
+ const [apiKey, setApiKey] = useState("");
1690
+ const [inputApiKey, setInputApiKey] = useState("");
1691
+ const [showTraffic, setShowTraffic] = useState(false);
1692
+ const [showTransit, setShowTransit] = useState(false);
1693
+ const [showBicycling, setShowBicycling] = useState(false);
1694
+ const [showZoomControl, setShowZoomControl] = useState(true);
1695
+ const [showMapTypeControl, setShowMapTypeControl] = useState(false);
1696
+ const [showStreetViewControl, setShowStreetViewControl] = useState(false);
1697
+ const [showFullscreenControl, setShowFullscreenControl] = useState(true);
1698
+ const handleTabChange = (value) => {
1699
+ if (value === activeTab) return;
1700
+ setIsTransitioning(true);
1701
+ setTimeout(() => {
1702
+ setActiveTab(value);
1703
+ setIsTransitioning(false);
1704
+ }, 50);
1705
+ };
1706
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-8", children: [
1707
+ /* @__PURE__ */ jsx(
1708
+ PageHeader,
1709
+ {
1710
+ title: "Mapas",
1711
+ subtitle: "Biblioteca de componentes de mapa para visualização de dados geoespaciais. Utiliza a API do Google Maps com estilização personalizada do Xertica UI.",
1712
+ actions: /* @__PURE__ */ jsx(Badge, { children: "Design System" })
1713
+ }
1714
+ ),
1715
+ /* @__PURE__ */ jsxs(Card, { children: [
1716
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
1717
+ /* @__PURE__ */ jsx(CardTitle, { children: "Configuração da API Key" }),
1718
+ /* @__PURE__ */ jsx(CardDescription, { children: "Insira sua Google Maps API Key para renderizar os mapas abaixo." })
1719
+ ] }),
1720
+ /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-md items-center space-x-2", children: [
1721
+ /* @__PURE__ */ jsx(
1722
+ Input,
1723
+ {
1724
+ type: "password",
1725
+ placeholder: "Cole sua Google Maps API Key aqui",
1726
+ "aria-label": "Google Maps API Key",
1727
+ value: inputApiKey,
1728
+ onChange: (e) => setInputApiKey(e.target.value),
1729
+ className: "max-w-md h-10"
1730
+ }
1731
+ ),
1732
+ /* @__PURE__ */ jsx(Button, { onClick: () => setApiKey(inputApiKey), children: "Salvar" })
1733
+ ] }) })
1734
+ ] }),
1735
+ /* @__PURE__ */ jsxs(Tabs, { value: activeTab, onValueChange: handleTabChange, className: "w-full", children: [
1736
+ /* @__PURE__ */ jsxs(TabsList, { className: "grid w-full grid-cols-4 mb-8", children: [
1737
+ /* @__PURE__ */ jsx(TabsTrigger, { value: "simple", children: "Mapas Simples" }),
1738
+ /* @__PURE__ */ jsx(TabsTrigger, { value: "markers", children: "Marcadores" }),
1739
+ /* @__PURE__ */ jsx(TabsTrigger, { value: "controls", children: "Controles" }),
1740
+ /* @__PURE__ */ jsxs(TabsTrigger, { value: "drawing", className: "flex items-center gap-2", children: [
1741
+ /* @__PURE__ */ jsx(Pencil, { className: "w-3 h-3" }),
1742
+ " Desenho"
1743
+ ] })
1744
+ ] }),
1745
+ /* @__PURE__ */ jsx(TabsContent, { value: "simple", className: "space-y-8", children: !isTransitioning && activeTab === "simple" && /* @__PURE__ */ jsxs(Fragment, { children: [
1746
+ /* @__PURE__ */ jsxs(Card, { children: [
1747
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
1748
+ /* @__PURE__ */ jsx(CardTitle, { children: "Mapa Padrão" }),
1749
+ /* @__PURE__ */ jsx(CardDescription, { children: "Configuração básica do mapa centralizado em uma coordenada específica." })
1750
+ ] }),
1751
+ /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx(
1752
+ Map,
1753
+ {
1754
+ center: { lat: -23.5505, lng: -46.6333 },
1755
+ zoom: 13,
1756
+ height: "400px",
1757
+ apiKey
1758
+ }
1759
+ ) })
1760
+ ] }),
1761
+ /* @__PURE__ */ jsxs(Card, { children: [
1762
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
1763
+ /* @__PURE__ */ jsx(CardTitle, { children: "Camadas (Layers)" }),
1764
+ /* @__PURE__ */ jsx(CardDescription, { children: "Sobreposição de informações como tráfego, transporte público e ciclovias." })
1765
+ ] }),
1766
+ /* @__PURE__ */ jsxs(CardContent, { className: "space-y-4", children: [
1767
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-6 p-4 border rounded-lg bg-muted/50", children: [
1768
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
1769
+ /* @__PURE__ */ jsx(Switch, { id: "traffic", checked: showTraffic, onCheckedChange: setShowTraffic }),
1770
+ /* @__PURE__ */ jsxs(Label, { htmlFor: "traffic", className: "flex items-center gap-2", children: [
1771
+ /* @__PURE__ */ jsx(Layers, { className: "w-4 h-4" }),
1772
+ " Trânsito"
1773
+ ] })
1774
+ ] }),
1775
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
1776
+ /* @__PURE__ */ jsx(Switch, { id: "transit", checked: showTransit, onCheckedChange: setShowTransit }),
1777
+ /* @__PURE__ */ jsxs(Label, { htmlFor: "transit", className: "flex items-center gap-2", children: [
1778
+ /* @__PURE__ */ jsx(Layers, { className: "w-4 h-4" }),
1779
+ " Transporte"
1780
+ ] })
1781
+ ] }),
1782
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
1783
+ /* @__PURE__ */ jsx(
1784
+ Switch,
1785
+ {
1786
+ id: "bicycling",
1787
+ checked: showBicycling,
1788
+ onCheckedChange: setShowBicycling
1789
+ }
1790
+ ),
1791
+ /* @__PURE__ */ jsxs(Label, { htmlFor: "bicycling", className: "flex items-center gap-2", children: [
1792
+ /* @__PURE__ */ jsx(Layers, { className: "w-4 h-4" }),
1793
+ " Ciclovias"
1794
+ ] })
1795
+ ] })
1796
+ ] }),
1797
+ /* @__PURE__ */ jsx(
1798
+ Map,
1799
+ {
1800
+ center: { lat: -23.5505, lng: -46.6333 },
1801
+ zoom: 12,
1802
+ height: "500px",
1803
+ layers: {
1804
+ traffic: showTraffic,
1805
+ transit: showTransit,
1806
+ bicycling: showBicycling
1807
+ },
1808
+ apiKey
1809
+ }
1810
+ )
1811
+ ] })
1812
+ ] }),
1813
+ /* @__PURE__ */ jsxs("div", { className: "grid md:grid-cols-3 gap-4", children: [
1814
+ /* @__PURE__ */ jsxs(Card, { children: [
1815
+ /* @__PURE__ */ jsx(CardHeader, { className: "p-4 pb-2", children: /* @__PURE__ */ jsx(CardTitle, { className: "text-sm", children: "São Paulo" }) }),
1816
+ /* @__PURE__ */ jsx(CardContent, { className: "p-4 pt-0", children: /* @__PURE__ */ jsx(
1817
+ Map,
1818
+ {
1819
+ center: { lat: -23.5505, lng: -46.6333 },
1820
+ zoom: 11,
1821
+ height: "200px",
1822
+ disableDefaultUI: true,
1823
+ apiKey
1824
+ }
1825
+ ) })
1826
+ ] }),
1827
+ /* @__PURE__ */ jsxs(Card, { children: [
1828
+ /* @__PURE__ */ jsx(CardHeader, { className: "p-4 pb-2", children: /* @__PURE__ */ jsx(CardTitle, { className: "text-sm", children: "Rio de Janeiro" }) }),
1829
+ /* @__PURE__ */ jsx(CardContent, { className: "p-4 pt-0", children: /* @__PURE__ */ jsx(
1830
+ Map,
1831
+ {
1832
+ center: { lat: -22.9068, lng: -43.1729 },
1833
+ zoom: 11,
1834
+ height: "200px",
1835
+ disableDefaultUI: true,
1836
+ apiKey
1837
+ }
1838
+ ) })
1839
+ ] }),
1840
+ /* @__PURE__ */ jsxs(Card, { children: [
1841
+ /* @__PURE__ */ jsx(CardHeader, { className: "p-4 pb-2", children: /* @__PURE__ */ jsx(CardTitle, { className: "text-sm", children: "New York" }) }),
1842
+ /* @__PURE__ */ jsx(CardContent, { className: "p-4 pt-0", children: /* @__PURE__ */ jsx(
1843
+ Map,
1844
+ {
1845
+ center: { lat: 40.7128, lng: -74.006 },
1846
+ zoom: 11,
1847
+ height: "200px",
1848
+ disableDefaultUI: true,
1849
+ apiKey
1850
+ }
1851
+ ) })
1852
+ ] })
1853
+ ] })
1854
+ ] }) }),
1855
+ /* @__PURE__ */ jsx(TabsContent, { value: "markers", className: "space-y-8", children: !isTransitioning && activeTab === "markers" && /* @__PURE__ */ jsxs(Fragment, { children: [
1856
+ /* @__PURE__ */ jsxs(Card, { children: [
1857
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
1858
+ /* @__PURE__ */ jsx(CardTitle, { children: "Marcadores e Pins" }),
1859
+ /* @__PURE__ */ jsx(CardDescription, { children: "Exemplos de marcadores personalizados com diferentes cores e informações." })
1860
+ ] }),
1861
+ /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx(
1862
+ Map,
1863
+ {
1864
+ center: { lat: -23.5505, lng: -46.6333 },
1865
+ zoom: 13,
1866
+ height: "500px",
1867
+ apiKey,
1868
+ markers: [
1869
+ {
1870
+ position: { lat: -23.5505, lng: -46.6333 },
1871
+ title: "Principal",
1872
+ info: "Marcador padrão",
1873
+ customColor: "#4F46E5"
1874
+ },
1875
+ {
1876
+ position: { lat: -23.54, lng: -46.64 },
1877
+ title: "Secundário",
1878
+ info: "Marcador de alerta",
1879
+ customColor: "#EF4444",
1880
+ icon: "!"
1881
+ },
1882
+ {
1883
+ position: { lat: -23.56, lng: -46.62 },
1884
+ title: "Loja",
1885
+ info: "Ponto de venda",
1886
+ customColor: "#10B981",
1887
+ icon: "S"
1888
+ }
1889
+ ]
1890
+ }
1891
+ ) })
1892
+ ] }),
1893
+ /* @__PURE__ */ jsxs(Card, { children: [
1894
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
1895
+ /* @__PURE__ */ jsx(CardTitle, { children: "Marcador com Ações" }),
1896
+ /* @__PURE__ */ jsx(CardDescription, { children: "Marcador interativo que exibe conteúdo rico (texto, imagem, botões) ao ser clicado." })
1897
+ ] }),
1898
+ /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx(
1899
+ Map,
1900
+ {
1901
+ center: { lat: -23.5505, lng: -46.6333 },
1902
+ zoom: 13,
1903
+ height: "500px",
1904
+ apiKey,
1905
+ markers: [
1906
+ {
1907
+ position: { lat: -23.5505, lng: -46.6333 },
1908
+ label: "🏢",
1909
+ richContent: /* @__PURE__ */ jsxs("div", { className: "p-4 max-w-[260px]", children: [
1910
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
1911
+ /* @__PURE__ */ jsx("h4", { className: "font-semibold text-base", children: "Xertica HQ" }),
1912
+ /* @__PURE__ */ jsx(Badge, { variant: "outline", className: "text-[10px] h-5", children: "Open" })
1913
+ ] }),
1914
+ /* @__PURE__ */ jsxs("div", { className: "w-full h-32 bg-muted rounded-md mb-3 overflow-hidden relative", children: [
1915
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-[image:var(--gradient-diagonal)] opacity-80" }),
1916
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center text-white font-medium", children: "Office View" })
1917
+ ] }),
1918
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mb-3 leading-relaxed", children: "Sede principal em São Paulo. Espaço moderno para reuniões e eventos." }),
1919
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-2", children: [
1920
+ /* @__PURE__ */ jsx(Button, { size: "sm", className: "w-full h-8 text-xs shadow-sm", children: "Navegar" }),
1921
+ /* @__PURE__ */ jsx(
1922
+ Button,
1923
+ {
1924
+ size: "sm",
1925
+ variant: "outline",
1926
+ className: "w-full h-8 text-xs bg-background",
1927
+ children: "Detalhes"
1928
+ }
1929
+ )
1930
+ ] })
1931
+ ] })
1932
+ }
1933
+ ]
1934
+ }
1935
+ ) })
1936
+ ] }),
1937
+ /* @__PURE__ */ jsxs(Card, { children: [
1938
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
1939
+ /* @__PURE__ */ jsx(CardTitle, { children: "Áreas e Zonas" }),
1940
+ /* @__PURE__ */ jsx(CardDescription, { children: "Delimitação de áreas geográficas usando círculos e polígonos." })
1941
+ ] }),
1942
+ /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx(
1943
+ Map,
1944
+ {
1945
+ center: { lat: -23.5505, lng: -46.6333 },
1946
+ zoom: 12,
1947
+ height: "500px",
1948
+ apiKey,
1949
+ markers: [
1950
+ {
1951
+ position: { lat: -23.5505, lng: -46.6333 },
1952
+ title: "Centro da Zona",
1953
+ info: "Raio de 3km",
1954
+ customColor: "#6366F1"
1955
+ }
1956
+ ],
1957
+ circle: {
1958
+ center: { lat: -23.5505, lng: -46.6333 },
1959
+ radius: 3e3,
1960
+ fillColor: "#6366F1",
1961
+ strokeColor: "#4F46E5"
1962
+ },
1963
+ polygon: {
1964
+ paths: [
1965
+ [
1966
+ { lat: -23.52, lng: -46.6 },
1967
+ { lat: -23.52, lng: -46.66 },
1968
+ { lat: -23.58, lng: -46.66 },
1969
+ { lat: -23.58, lng: -46.6 }
1970
+ ]
1971
+ ],
1972
+ fillColor: "#10B981",
1973
+ strokeColor: "#059669"
1974
+ }
1975
+ }
1976
+ ) })
1977
+ ] })
1978
+ ] }) }),
1979
+ /* @__PURE__ */ jsx(TabsContent, { value: "controls", className: "space-y-8", children: !isTransitioning && activeTab === "controls" && /* @__PURE__ */ jsxs(Fragment, { children: [
1980
+ /* @__PURE__ */ jsxs(Card, { children: [
1981
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
1982
+ /* @__PURE__ */ jsx(CardTitle, { children: "Controles do Mapa" }),
1983
+ /* @__PURE__ */ jsx(CardDescription, { children: "Personalize a interface do mapa ativando ou desativando controles nativos." })
1984
+ ] }),
1985
+ /* @__PURE__ */ jsxs(CardContent, { className: "space-y-4", children: [
1986
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-4 p-4 border rounded-lg bg-muted/50", children: [
1987
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
1988
+ /* @__PURE__ */ jsx(
1989
+ Checkbox,
1990
+ {
1991
+ id: "zoom",
1992
+ checked: showZoomControl,
1993
+ onCheckedChange: (c) => setShowZoomControl(!!c)
1994
+ }
1995
+ ),
1996
+ /* @__PURE__ */ jsx(Label, { htmlFor: "zoom", children: "Zoom Control" })
1997
+ ] }),
1998
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
1999
+ /* @__PURE__ */ jsx(
2000
+ Checkbox,
2001
+ {
2002
+ id: "maptype",
2003
+ checked: showMapTypeControl,
2004
+ onCheckedChange: (c) => setShowMapTypeControl(!!c)
2005
+ }
2006
+ ),
2007
+ /* @__PURE__ */ jsx(Label, { htmlFor: "maptype", children: "Map Type" })
2008
+ ] }),
2009
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
2010
+ /* @__PURE__ */ jsx(
2011
+ Checkbox,
2012
+ {
2013
+ id: "streetview",
2014
+ checked: showStreetViewControl,
2015
+ onCheckedChange: (c) => setShowStreetViewControl(!!c)
2016
+ }
2017
+ ),
2018
+ /* @__PURE__ */ jsx(Label, { htmlFor: "streetview", children: "Street View" })
2019
+ ] }),
2020
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
2021
+ /* @__PURE__ */ jsx(
2022
+ Checkbox,
2023
+ {
2024
+ id: "fullscreen",
2025
+ checked: showFullscreenControl,
2026
+ onCheckedChange: (c) => setShowFullscreenControl(!!c)
2027
+ }
2028
+ ),
2029
+ /* @__PURE__ */ jsx(Label, { htmlFor: "fullscreen", children: "Fullscreen" })
2030
+ ] })
2031
+ ] }),
2032
+ /* @__PURE__ */ jsx(
2033
+ Map,
2034
+ {
2035
+ center: { lat: -23.5505, lng: -46.6333 },
2036
+ zoom: 13,
2037
+ height: "400px",
2038
+ apiKey,
2039
+ zoomControl: showZoomControl,
2040
+ mapTypeControl: showMapTypeControl,
2041
+ streetViewControl: showStreetViewControl,
2042
+ fullscreenControl: showFullscreenControl
2043
+ }
2044
+ )
2045
+ ] })
2046
+ ] }),
2047
+ /* @__PURE__ */ jsxs(Card, { children: [
2048
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
2049
+ /* @__PURE__ */ jsx(CardTitle, { children: "Filtros Interativos" }),
2050
+ /* @__PURE__ */ jsx(CardDescription, { children: "Exemplo avançado de mapa com controles customizados para filtragem de marcadores." })
2051
+ ] }),
2052
+ /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx(FilterableMapExample, { apiKey }) })
2053
+ ] })
2054
+ ] }) }),
2055
+ /* @__PURE__ */ jsx(TabsContent, { value: "drawing", className: "space-y-8", children: !isTransitioning && activeTab === "drawing" && /* @__PURE__ */ jsx(DrawingMapExample, { apiKey }) })
2056
+ ] }),
2057
+ /* @__PURE__ */ jsxs("div", { className: "grid md:grid-cols-3 gap-6 pt-8 border-t", children: [
2058
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
2059
+ /* @__PURE__ */ jsx("h4", { className: "font-semibold text-sm", children: "Documentação" }),
2060
+ /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
2061
+ "Verifique ",
2062
+ /* @__PURE__ */ jsx("code", { children: "MAP_SETUP.md" }),
2063
+ " para configuração inicial e requisitos de API."
2064
+ ] })
2065
+ ] }),
2066
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
2067
+ /* @__PURE__ */ jsx("h4", { className: "font-semibold text-sm", children: "Performance" }),
2068
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Utiliza carregamento assíncrono e AdvancedMarkerElement para melhor desempenho." })
2069
+ ] }),
2070
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
2071
+ /* @__PURE__ */ jsx("h4", { className: "font-semibold text-sm", children: "Design System" }),
2072
+ /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
2073
+ "Componentes seguem estritamente as variáveis de tokens do ",
2074
+ /* @__PURE__ */ jsx("code", { children: "globals.css" }),
2075
+ "."
2076
+ ] })
2077
+ ] })
2078
+ ] })
2079
+ ] });
2080
+ }
2081
+
2082
+ function TemplateContent() {
2083
+ const { t } = useTranslation();
2084
+ const layout = useOptionalLayout();
2085
+ const { disableDarkMode } = useTheme();
2086
+ const [localSidebarExpanded, setLocalSidebarExpanded] = useState(false);
2087
+ const [localSidebarWidth, setLocalSidebarWidth] = useState(280);
2088
+ const sidebarExpanded = layout?.sidebarExpanded ?? localSidebarExpanded;
2089
+ const sidebarWidth = layout?.sidebarWidth ?? localSidebarWidth;
2090
+ const setSidebarWidth = layout?.setSidebarWidth ?? setLocalSidebarWidth;
2091
+ layout?.toggleSidebar ?? (() => setLocalSidebarExpanded((value) => !value));
2092
+ useNavigate();
2093
+ const { data: teamMembers = [], isLoading: teamLoading } = useTeamMembers();
2094
+ const progress = useDashboardStore((s) => s.progress);
2095
+ const setProgress = useDashboardStore((s) => s.setProgress);
2096
+ const sliderValue = useDashboardStore((s) => s.sliderValue);
2097
+ const setSliderValue = useDashboardStore((s) => s.setSliderValue);
2098
+ const switchEnabled = useDashboardStore((s) => s.switchEnabled);
2099
+ const toggleSwitch = useDashboardStore((s) => s.toggleSwitch);
2100
+ const [showSidebarUser, setShowSidebarUser] = useState(true);
2101
+ const [showSidebarSettings, setShowSidebarSettings] = useState(true);
2102
+ const [showSidebarLogout, setShowSidebarLogout] = useState(true);
2103
+ const [showHeaderActions, setShowHeaderActions] = useState(true);
2104
+ const [showHeaderBreadcrumbs, setShowHeaderBreadcrumbs] = useState(true);
2105
+ const handleFormSubmit = (e) => {
2106
+ e.preventDefault();
2107
+ toast.success(t("templates.formSubmitSuccess"));
2108
+ };
2109
+ return /* @__PURE__ */ jsxs(
2110
+ "div",
2111
+ {
2112
+ className: "flex-1 flex flex-col overflow-hidden transition-all duration-300",
2113
+ style: {
2114
+ paddingLeft: sidebarExpanded ? `${sidebarWidth}px` : "80px"
2115
+ },
2116
+ children: [
2117
+ /* @__PURE__ */ jsx(
2118
+ Header,
2119
+ {
2120
+ showThemeToggle: true,
2121
+ showLanguageSelector: true,
2122
+ breadcrumbs: [
2123
+ { label: t("nav.designSystem"), href: "/home", icon: /* @__PURE__ */ jsx(Home, { className: "w-4 h-4" }) },
2124
+ { label: t("templates.breadcrumb") }
2125
+ ],
2126
+ renderLink: (href, props) => /* @__PURE__ */ jsx(Link, { to: href, ...props })
2127
+ }
2128
+ ),
2129
+ /* @__PURE__ */ jsx("main", { className: "flex-1 overflow-hidden bg-muted", children: /* @__PURE__ */ jsx(ScrollArea, { className: "h-full", children: /* @__PURE__ */ jsx("div", { className: "p-5 sm:p-4 md:p-6", children: /* @__PURE__ */ jsxs("div", { className: "max-w-6xl mx-auto space-y-8", children: [
2130
+ /* @__PURE__ */ jsx(PageHeader, { title: t("templates.title"), subtitle: t("templates.subtitle") }),
2131
+ /* @__PURE__ */ jsxs("section", { children: [
2132
+ /* @__PURE__ */ jsx("h3", { className: "mb-4", children: t("templates.headerWithBreadcrumbs.sectionTitle") }),
2133
+ /* @__PURE__ */ jsxs(Card, { children: [
2134
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
2135
+ /* @__PURE__ */ jsx(CardTitle, { children: t("templates.headerWithBreadcrumbs.cardTitle") }),
2136
+ /* @__PURE__ */ jsx(CardDescription, { children: t("templates.headerWithBreadcrumbs.cardDescription") })
2137
+ ] }),
2138
+ /* @__PURE__ */ jsxs(CardContent, { className: "p-0 border-t bg-background overflow-hidden rounded-b-[var(--radius-lg)]", children: [
2139
+ /* @__PURE__ */ jsx(
2140
+ Header,
2141
+ {
2142
+ className: "border-b",
2143
+ breadcrumbs: [
2144
+ {
2145
+ label: t("templates.headerWithBreadcrumbs.breadcrumbs.dashboard"),
2146
+ href: "#",
2147
+ icon: /* @__PURE__ */ jsx(Home, { className: "w-4 h-4" })
2148
+ },
2149
+ {
2150
+ label: t("templates.headerWithBreadcrumbs.breadcrumbs.settings"),
2151
+ href: "#",
2152
+ icon: /* @__PURE__ */ jsx(Settings, { className: "w-4 h-4" })
2153
+ },
2154
+ {
2155
+ label: t("templates.headerWithBreadcrumbs.breadcrumbs.users"),
2156
+ href: "#",
2157
+ icon: /* @__PURE__ */ jsx(Users, { className: "w-4 h-4" })
2158
+ },
2159
+ { label: t("templates.headerWithBreadcrumbs.breadcrumbs.accessProfile") }
2160
+ ],
2161
+ showLanguageSelector: true,
2162
+ showThemeToggle: true
2163
+ }
2164
+ ),
2165
+ /* @__PURE__ */ jsxs("div", { className: "p-6 min-h-[200px]", children: [
2166
+ /* @__PURE__ */ jsx("h4", { className: "text-lg font-semibold mb-2", children: t("templates.headerWithBreadcrumbs.exampleContentTitle") }),
2167
+ /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground", children: [
2168
+ t("templates.headerWithBreadcrumbs.exampleContentDescriptionPart1"),
2169
+ /* @__PURE__ */ jsx("strong", { children: "Header" }),
2170
+ t("templates.headerWithBreadcrumbs.exampleContentDescriptionPart2")
2171
+ ] })
2172
+ ] })
2173
+ ] })
2174
+ ] })
2175
+ ] }),
2176
+ /* @__PURE__ */ jsx(Separator, { className: "my-8" }),
2177
+ /* @__PURE__ */ jsxs("section", { children: [
2178
+ /* @__PURE__ */ jsx("h3", { className: "mb-4", children: t("templates.sections.alerts") }),
2179
+ /* @__PURE__ */ jsxs("div", { className: "grid gap-4 md:grid-cols-2", children: [
2180
+ /* @__PURE__ */ jsxs(Alert, { variant: "info", children: [
2181
+ /* @__PURE__ */ jsx(AlertTitle, { children: t("templates.alerts.infoTitle") }),
2182
+ /* @__PURE__ */ jsx(AlertDescription, { children: t("templates.alerts.infoDescription") })
2183
+ ] }),
2184
+ /* @__PURE__ */ jsxs(Alert, { variant: "destructive", children: [
2185
+ /* @__PURE__ */ jsx(AlertTitle, { children: t("templates.alerts.errorTitle") }),
2186
+ /* @__PURE__ */ jsx(AlertDescription, { children: t("templates.alerts.errorDescription") })
2187
+ ] }),
2188
+ /* @__PURE__ */ jsxs(Alert, { variant: "success", children: [
2189
+ /* @__PURE__ */ jsx(AlertTitle, { children: t("templates.alerts.successTitle") }),
2190
+ /* @__PURE__ */ jsx(AlertDescription, { children: t("templates.alerts.successDescription") })
2191
+ ] }),
2192
+ /* @__PURE__ */ jsxs(Alert, { variant: "warning", children: [
2193
+ /* @__PURE__ */ jsx(AlertTitle, { children: t("templates.alerts.warningTitle") }),
2194
+ /* @__PURE__ */ jsx(AlertDescription, { children: t("templates.alerts.warningDescription") })
2195
+ ] })
2196
+ ] })
2197
+ ] }),
2198
+ /* @__PURE__ */ jsx(Separator, { className: "my-8" }),
2199
+ /* @__PURE__ */ jsxs("section", { children: [
2200
+ /* @__PURE__ */ jsx("h3", { className: "mb-4", children: t("templates.sections.cardsAndTabs") }),
2201
+ /* @__PURE__ */ jsxs(Tabs, { defaultValue: "overview", className: "w-full", children: [
2202
+ /* @__PURE__ */ jsxs(TabsList, { className: "grid w-full grid-cols-4", children: [
2203
+ /* @__PURE__ */ jsx(TabsTrigger, { value: "overview", children: t("templates.tabs.overview") }),
2204
+ /* @__PURE__ */ jsx(TabsTrigger, { value: "forms", children: t("templates.tabs.forms") }),
2205
+ /* @__PURE__ */ jsx(TabsTrigger, { value: "data", children: t("templates.tabs.data") }),
2206
+ /* @__PURE__ */ jsx(TabsTrigger, { value: "settings", children: t("templates.tabs.settings") })
2207
+ ] }),
2208
+ /* @__PURE__ */ jsxs(TabsContent, { value: "overview", className: "space-y-4", children: [
2209
+ /* @__PURE__ */ jsxs("div", { className: "grid gap-4 md:grid-cols-3", children: [
2210
+ /* @__PURE__ */ jsxs(Card, { children: [
2211
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
2212
+ /* @__PURE__ */ jsx(CardTitle, { children: t("stats.totalUsers") }),
2213
+ /* @__PURE__ */ jsx(CardDescription, { children: t("stats.last30Days") })
2214
+ ] }),
2215
+ /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsxs("div", { className: "text-foreground", children: [
2216
+ /* @__PURE__ */ jsx("span", { className: "[font-size:var(--text-stats)] [font-weight:var(--font-weight-bold)]", children: "1,234" }),
2217
+ /* @__PURE__ */ jsx(Badge, { variant: "default", className: "ml-2", children: "+12%" })
2218
+ ] }) })
2219
+ ] }),
2220
+ /* @__PURE__ */ jsxs(Card, { children: [
2221
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
2222
+ /* @__PURE__ */ jsx(CardTitle, { children: t("stats.totalRevenue") }),
2223
+ /* @__PURE__ */ jsx(CardDescription, { children: t("stats.currentMonth") })
2224
+ ] }),
2225
+ /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsxs("div", { className: "text-foreground", children: [
2226
+ /* @__PURE__ */ jsx("span", { className: "[font-size:var(--text-stats)] [font-weight:var(--font-weight-bold)]", children: "$ 45.2k" }),
2227
+ /* @__PURE__ */ jsx(Badge, { variant: "secondary", className: "ml-2", children: "+8%" })
2228
+ ] }) })
2229
+ ] }),
2230
+ /* @__PURE__ */ jsxs(Card, { children: [
2231
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
2232
+ /* @__PURE__ */ jsx(CardTitle, { children: t("stats.conversionRate") }),
2233
+ /* @__PURE__ */ jsx(CardDescription, { children: t("stats.currentWeek") })
2234
+ ] }),
2235
+ /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsxs("div", { className: "text-foreground", children: [
2236
+ /* @__PURE__ */ jsx("span", { className: "[font-size:var(--text-stats)] [font-weight:var(--font-weight-bold)]", children: "3.2%" }),
2237
+ /* @__PURE__ */ jsx(Badge, { variant: "outline", className: "ml-2", children: "-2%" })
2238
+ ] }) })
2239
+ ] })
2240
+ ] }),
2241
+ /* @__PURE__ */ jsxs(Card, { children: [
2242
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
2243
+ /* @__PURE__ */ jsx(CardTitle, { children: t("templates.overview.progressTitle") }),
2244
+ /* @__PURE__ */ jsx(CardDescription, { children: t("templates.overview.progressDescription") })
2245
+ ] }),
2246
+ /* @__PURE__ */ jsxs(CardContent, { className: "space-y-6", children: [
2247
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
2248
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
2249
+ /* @__PURE__ */ jsx(Label, { children: t("templates.overview.projectProgress") }),
2250
+ /* @__PURE__ */ jsxs("span", { className: "[font-size:var(--text-small)] text-muted-foreground", children: [
2251
+ progress,
2252
+ "%"
2253
+ ] })
2254
+ ] }),
2255
+ /* @__PURE__ */ jsx(Progress, { value: progress, className: "w-full" }),
2256
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
2257
+ /* @__PURE__ */ jsx(
2258
+ Button,
2259
+ {
2260
+ size: "sm",
2261
+ onClick: () => setProgress(Math.max(0, progress - 10)),
2262
+ children: "-10%"
2263
+ }
2264
+ ),
2265
+ /* @__PURE__ */ jsx(
2266
+ Button,
2267
+ {
2268
+ size: "sm",
2269
+ onClick: () => setProgress(Math.min(100, progress + 10)),
2270
+ children: "+10%"
2271
+ }
2272
+ )
2273
+ ] })
2274
+ ] }),
2275
+ /* @__PURE__ */ jsx(Separator, {}),
2276
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
2277
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
2278
+ /* @__PURE__ */ jsx(Label, { children: t("templates.overview.volume") }),
2279
+ /* @__PURE__ */ jsxs("span", { className: "[font-size:var(--text-small)] text-muted-foreground", children: [
2280
+ sliderValue[0],
2281
+ "%"
2282
+ ] })
2283
+ ] }),
2284
+ /* @__PURE__ */ jsx(
2285
+ Slider,
2286
+ {
2287
+ value: sliderValue,
2288
+ onValueChange: setSliderValue,
2289
+ min: 0,
2290
+ max: 100,
2291
+ step: 1,
2292
+ className: "w-full",
2293
+ "aria-label": t("templates.overview.volume")
2294
+ }
2295
+ )
2296
+ ] })
2297
+ ] })
2298
+ ] })
2299
+ ] }),
2300
+ /* @__PURE__ */ jsx(TabsContent, { value: "forms", className: "space-y-4", children: /* @__PURE__ */ jsxs(Card, { children: [
2301
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
2302
+ /* @__PURE__ */ jsx(CardTitle, { children: t("templates.forms.registrationTitle") }),
2303
+ /* @__PURE__ */ jsx(CardDescription, { children: t("templates.forms.registrationDescription") })
2304
+ ] }),
2305
+ /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsxs("form", { onSubmit: handleFormSubmit, className: "space-y-4", children: [
2306
+ /* @__PURE__ */ jsxs("div", { className: "grid gap-4 md:grid-cols-2", children: [
2307
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
2308
+ /* @__PURE__ */ jsx(Label, { htmlFor: "firstName", children: t("templates.forms.firstName") }),
2309
+ /* @__PURE__ */ jsx(
2310
+ Input,
2311
+ {
2312
+ id: "firstName",
2313
+ placeholder: t("templates.forms.firstNamePlaceholder")
2314
+ }
2315
+ )
2316
+ ] }),
2317
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
2318
+ /* @__PURE__ */ jsx(Label, { htmlFor: "lastName", children: t("templates.forms.lastName") }),
2319
+ /* @__PURE__ */ jsx(
2320
+ Input,
2321
+ {
2322
+ id: "lastName",
2323
+ placeholder: t("templates.forms.lastNamePlaceholder")
2324
+ }
2325
+ )
2326
+ ] })
2327
+ ] }),
2328
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
2329
+ /* @__PURE__ */ jsx(Label, { htmlFor: "email", children: t("templates.forms.email") }),
2330
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
2331
+ /* @__PURE__ */ jsx(Mail, { className: "absolute left-3 top-3 h-4 w-4 text-muted-foreground" }),
2332
+ /* @__PURE__ */ jsx(
2333
+ Input,
2334
+ {
2335
+ id: "email",
2336
+ type: "email",
2337
+ placeholder: t("templates.forms.emailPlaceholder"),
2338
+ className: "pl-10"
2339
+ }
2340
+ )
2341
+ ] })
2342
+ ] }),
2343
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
2344
+ /* @__PURE__ */ jsx(Label, { htmlFor: "phone", children: t("templates.forms.phone") }),
2345
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
2346
+ /* @__PURE__ */ jsx(Phone, { className: "absolute left-3 top-3 h-4 w-4 text-muted-foreground" }),
2347
+ /* @__PURE__ */ jsx(
2348
+ Input,
2349
+ {
2350
+ id: "phone",
2351
+ type: "tel",
2352
+ placeholder: t("templates.forms.phonePlaceholder"),
2353
+ className: "pl-10"
2354
+ }
2355
+ )
2356
+ ] })
2357
+ ] }),
2358
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
2359
+ /* @__PURE__ */ jsx(Label, { htmlFor: "role", children: t("templates.forms.role") }),
2360
+ /* @__PURE__ */ jsxs(Select, { children: [
2361
+ /* @__PURE__ */ jsx(SelectTrigger, { id: "role", children: /* @__PURE__ */ jsx(SelectValue, { placeholder: t("templates.forms.rolePlaceholder") }) }),
2362
+ /* @__PURE__ */ jsxs(SelectContent, { children: [
2363
+ /* @__PURE__ */ jsx(SelectItem, { value: "developer", children: t("templates.forms.roles.developer") }),
2364
+ /* @__PURE__ */ jsx(SelectItem, { value: "designer", children: t("templates.forms.roles.designer") }),
2365
+ /* @__PURE__ */ jsx(SelectItem, { value: "manager", children: t("templates.forms.roles.manager") }),
2366
+ /* @__PURE__ */ jsx(SelectItem, { value: "analyst", children: t("templates.forms.roles.analyst") })
2367
+ ] })
2368
+ ] })
2369
+ ] }),
2370
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
2371
+ /* @__PURE__ */ jsx(Label, { htmlFor: "bio", children: t("templates.forms.bio") }),
2372
+ /* @__PURE__ */ jsx(
2373
+ Textarea,
2374
+ {
2375
+ id: "bio",
2376
+ placeholder: t("templates.forms.bioPlaceholder"),
2377
+ rows: 4
2378
+ }
2379
+ )
2380
+ ] }),
2381
+ /* @__PURE__ */ jsx(Separator, {}),
2382
+ /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
2383
+ /* @__PURE__ */ jsx("h4", { children: t("templates.forms.preferences") }),
2384
+ /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
2385
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
2386
+ /* @__PURE__ */ jsx(Checkbox, { id: "newsletter" }),
2387
+ /* @__PURE__ */ jsx(Label, { htmlFor: "newsletter", className: "font-normal", children: t("templates.forms.newsletter") })
2388
+ ] }),
2389
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
2390
+ /* @__PURE__ */ jsx(Checkbox, { id: "notifications" }),
2391
+ /* @__PURE__ */ jsx(Label, { htmlFor: "notifications", className: "font-normal", children: t("templates.forms.pushNotifications") })
2392
+ ] }),
2393
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
2394
+ /* @__PURE__ */ jsx(Checkbox, { id: "updates" }),
2395
+ /* @__PURE__ */ jsx(Label, { htmlFor: "updates", className: "font-normal", children: t("templates.forms.featureUpdates") })
2396
+ ] })
2397
+ ] }),
2398
+ /* @__PURE__ */ jsx(Separator, {}),
2399
+ /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
2400
+ /* @__PURE__ */ jsx(Label, { children: t("templates.forms.accountType") }),
2401
+ /* @__PURE__ */ jsxs(
2402
+ RadioGroup,
2403
+ {
2404
+ defaultValue: "personal",
2405
+ "aria-label": t("templates.forms.accountType"),
2406
+ children: [
2407
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
2408
+ /* @__PURE__ */ jsx(RadioGroupItem, { value: "personal", id: "personal" }),
2409
+ /* @__PURE__ */ jsx(Label, { htmlFor: "personal", className: "font-normal", children: t("templates.forms.accountPersonal") })
2410
+ ] }),
2411
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
2412
+ /* @__PURE__ */ jsx(RadioGroupItem, { value: "business", id: "business" }),
2413
+ /* @__PURE__ */ jsx(Label, { htmlFor: "business", className: "font-normal", children: t("templates.forms.accountBusiness") })
2414
+ ] }),
2415
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
2416
+ /* @__PURE__ */ jsx(RadioGroupItem, { value: "enterprise", id: "enterprise" }),
2417
+ /* @__PURE__ */ jsx(Label, { htmlFor: "enterprise", className: "font-normal", children: t("templates.forms.accountEnterprise") })
2418
+ ] })
2419
+ ]
2420
+ }
2421
+ )
2422
+ ] })
2423
+ ] })
2424
+ ] }) }),
2425
+ /* @__PURE__ */ jsxs(CardFooter, { className: "flex justify-between", children: [
2426
+ /* @__PURE__ */ jsx(Button, { variant: "outline", children: t("templates.forms.cancel") }),
2427
+ /* @__PURE__ */ jsx(Button, { onClick: handleFormSubmit, children: t("templates.forms.createAccount") })
2428
+ ] })
2429
+ ] }) }),
2430
+ /* @__PURE__ */ jsx(TabsContent, { value: "data", className: "space-y-4", children: /* @__PURE__ */ jsx(SectionErrorBoundary, { children: /* @__PURE__ */ jsxs(Card, { children: [
2431
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
2432
+ /* @__PURE__ */ jsx(CardTitle, { children: t("templates.data.title") }),
2433
+ /* @__PURE__ */ jsx(CardDescription, { children: t("templates.data.description") })
2434
+ ] }),
2435
+ /* @__PURE__ */ jsxs(CardContent, { children: [
2436
+ /* @__PURE__ */ jsx("div", { className: "mb-4", children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
2437
+ /* @__PURE__ */ jsx(Search, { className: "absolute left-3 top-3 h-4 w-4 text-muted-foreground" }),
2438
+ /* @__PURE__ */ jsx(
2439
+ Input,
2440
+ {
2441
+ placeholder: t("templates.data.searchPlaceholder"),
2442
+ "aria-label": t("templates.data.searchPlaceholder"),
2443
+ className: "pl-10"
2444
+ }
2445
+ )
2446
+ ] }) }),
2447
+ /* @__PURE__ */ jsx("div", { className: "rounded-[var(--radius-lg)] border border-border overflow-hidden", children: /* @__PURE__ */ jsxs(Table, { children: [
2448
+ /* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
2449
+ /* @__PURE__ */ jsx(TableHead, { children: t("team.name") }),
2450
+ /* @__PURE__ */ jsx(TableHead, { children: t("team.email") }),
2451
+ /* @__PURE__ */ jsx(TableHead, { children: t("team.role") }),
2452
+ /* @__PURE__ */ jsx(TableHead, { children: t("team.status") }),
2453
+ /* @__PURE__ */ jsx(TableHead, { className: "text-right", children: t("team.actions") })
2454
+ ] }) }),
2455
+ /* @__PURE__ */ jsx(TableBody, { children: teamLoading ? /* @__PURE__ */ jsx(Fragment, { children: Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ jsxs(TableRow, { children: [
2456
+ /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
2457
+ /* @__PURE__ */ jsx(Skeleton, { className: "size-8 rounded-full shrink-0" }),
2458
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3.5 w-28" })
2459
+ ] }) }),
2460
+ /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-3.5 w-36" }) }),
2461
+ /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-3.5 w-20" }) }),
2462
+ /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-16 rounded-full" }) }),
2463
+ /* @__PURE__ */ jsx(TableCell, { className: "text-right", children: /* @__PURE__ */ jsx(Skeleton, { className: "h-7 w-14 ml-auto" }) })
2464
+ ] }, i)) }) : teamMembers.map((member) => /* @__PURE__ */ jsxs(TableRow, { children: [
2465
+ /* @__PURE__ */ jsx(TableCell, { children: member.name }),
2466
+ /* @__PURE__ */ jsx(TableCell, { children: member.email }),
2467
+ /* @__PURE__ */ jsx(TableCell, { children: t(`team.roles.${member.role}`) }),
2468
+ /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(
2469
+ Badge,
2470
+ {
2471
+ variant: member.status === "active" ? "default" : member.status === "away" ? "secondary" : "outline",
2472
+ children: t(`common.${member.status}`)
2473
+ }
2474
+ ) }),
2475
+ /* @__PURE__ */ jsx(TableCell, { className: "text-right", children: /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", children: t("common.edit") }) })
2476
+ ] }, member.id)) })
2477
+ ] }) })
2478
+ ] }),
2479
+ /* @__PURE__ */ jsxs(CardFooter, { className: "flex justify-between items-center", children: [
2480
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: t("team.showing", {
2481
+ count: teamMembers.length,
2482
+ total: teamMembers.length
2483
+ }) }),
2484
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
2485
+ /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", children: t("common.previous") }),
2486
+ /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", children: t("common.next") })
2487
+ ] })
2488
+ ] })
2489
+ ] }) }) }),
2490
+ /* @__PURE__ */ jsx(TabsContent, { value: "settings", className: "space-y-4", children: /* @__PURE__ */ jsxs(Card, { children: [
2491
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
2492
+ /* @__PURE__ */ jsx(CardTitle, { children: t("templates.settings.title") }),
2493
+ /* @__PURE__ */ jsx(CardDescription, { children: t("templates.settings.description") })
2494
+ ] }),
2495
+ /* @__PURE__ */ jsxs(CardContent, { className: "space-y-6", children: [
2496
+ !disableDarkMode && /* @__PURE__ */ jsxs(Fragment, { children: [
2497
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
2498
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
2499
+ /* @__PURE__ */ jsx(Label, { htmlFor: "dark-mode", children: t("templates.settings.darkMode") }),
2500
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: t("templates.settings.darkModeDescription") })
2501
+ ] }),
2502
+ /* @__PURE__ */ jsx(
2503
+ Switch,
2504
+ {
2505
+ id: "dark-mode",
2506
+ checked: switchEnabled,
2507
+ onCheckedChange: toggleSwitch
2508
+ }
2509
+ )
2510
+ ] }),
2511
+ /* @__PURE__ */ jsx(Separator, {})
2512
+ ] }),
2513
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
2514
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
2515
+ /* @__PURE__ */ jsx(Label, { htmlFor: "email-notifications", children: t("templates.settings.emailNotifications") }),
2516
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: t("templates.settings.emailNotificationsDescription") })
2517
+ ] }),
2518
+ /* @__PURE__ */ jsx(Switch, { id: "email-notifications", defaultChecked: true })
2519
+ ] }),
2520
+ /* @__PURE__ */ jsx(Separator, {}),
2521
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
2522
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
2523
+ /* @__PURE__ */ jsx(Label, { htmlFor: "push-notifications", children: t("templates.settings.pushNotifications") }),
2524
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: t("templates.settings.pushNotificationsDescription") })
2525
+ ] }),
2526
+ /* @__PURE__ */ jsx(Switch, { id: "push-notifications" })
2527
+ ] }),
2528
+ /* @__PURE__ */ jsx(Separator, {}),
2529
+ /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
2530
+ /* @__PURE__ */ jsx(Label, { children: t("templates.settings.language") }),
2531
+ /* @__PURE__ */ jsxs(Select, { defaultValue: "pt-br", children: [
2532
+ /* @__PURE__ */ jsx(SelectTrigger, { "aria-label": t("templates.settings.language"), children: /* @__PURE__ */ jsx(SelectValue, {}) }),
2533
+ /* @__PURE__ */ jsxs(SelectContent, { children: [
2534
+ /* @__PURE__ */ jsx(SelectItem, { value: "pt-br", children: t("templates.settings.languages.ptBR") }),
2535
+ /* @__PURE__ */ jsx(SelectItem, { value: "en", children: t("templates.settings.languages.en") }),
2536
+ /* @__PURE__ */ jsx(SelectItem, { value: "es", children: t("templates.settings.languages.es") })
2537
+ ] })
2538
+ ] })
2539
+ ] }),
2540
+ /* @__PURE__ */ jsx(Separator, {}),
2541
+ /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
2542
+ /* @__PURE__ */ jsx(Label, { children: t("templates.settings.timezone") }),
2543
+ /* @__PURE__ */ jsxs(Select, { defaultValue: "america-sao-paulo", children: [
2544
+ /* @__PURE__ */ jsx(SelectTrigger, { "aria-label": t("templates.settings.timezone"), children: /* @__PURE__ */ jsx(SelectValue, {}) }),
2545
+ /* @__PURE__ */ jsxs(SelectContent, { children: [
2546
+ /* @__PURE__ */ jsx(SelectItem, { value: "america-sao-paulo", children: t("templates.settings.timezones.saoPaulo") }),
2547
+ /* @__PURE__ */ jsx(SelectItem, { value: "america-new-york", children: t("templates.settings.timezones.newYork") }),
2548
+ /* @__PURE__ */ jsx(SelectItem, { value: "europe-london", children: t("templates.settings.timezones.london") })
2549
+ ] })
2550
+ ] })
2551
+ ] })
2552
+ ] }),
2553
+ /* @__PURE__ */ jsxs(CardFooter, { className: "flex justify-between", children: [
2554
+ /* @__PURE__ */ jsx(Button, { variant: "outline", children: t("templates.settings.restoreDefaults") }),
2555
+ /* @__PURE__ */ jsx(Button, { children: t("templates.settings.saveChanges") })
2556
+ ] })
2557
+ ] }) })
2558
+ ] })
2559
+ ] }),
2560
+ /* @__PURE__ */ jsx(Separator, { className: "my-8" }),
2561
+ /* @__PURE__ */ jsxs("section", { children: [
2562
+ /* @__PURE__ */ jsx("h3", { className: "mb-4", children: t("templates.sections.buttons") }),
2563
+ /* @__PURE__ */ jsxs(Card, { children: [
2564
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
2565
+ /* @__PURE__ */ jsx(CardTitle, { children: t("templates.buttons.title") }),
2566
+ /* @__PURE__ */ jsx(CardDescription, { children: t("templates.buttons.description") })
2567
+ ] }),
2568
+ /* @__PURE__ */ jsxs(CardContent, { className: "space-y-6", children: [
2569
+ /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
2570
+ /* @__PURE__ */ jsx(Label, { children: t("templates.buttons.variants") }),
2571
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-3", children: [
2572
+ /* @__PURE__ */ jsx(Button, { variant: "default", children: "Default" }),
2573
+ /* @__PURE__ */ jsx(Button, { variant: "secondary", children: "Secondary" }),
2574
+ /* @__PURE__ */ jsx(Button, { variant: "outline", children: "Outline" }),
2575
+ /* @__PURE__ */ jsx(Button, { variant: "ghost", children: "Ghost" }),
2576
+ /* @__PURE__ */ jsx(Button, { variant: "link", children: "Link" }),
2577
+ /* @__PURE__ */ jsx(Button, { variant: "destructive", children: "Destructive" })
2578
+ ] })
2579
+ ] }),
2580
+ /* @__PURE__ */ jsx(Separator, {}),
2581
+ /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
2582
+ /* @__PURE__ */ jsx(Label, { children: t("templates.buttons.sizes") }),
2583
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [
2584
+ /* @__PURE__ */ jsx(Button, { size: "sm", children: "Small" }),
2585
+ /* @__PURE__ */ jsx(Button, { size: "default", children: "Default" }),
2586
+ /* @__PURE__ */ jsx(Button, { size: "lg", children: "Large" }),
2587
+ /* @__PURE__ */ jsx(Button, { size: "icon", "aria-label": t("nav.settings"), children: /* @__PURE__ */ jsx(Settings, { className: "h-4 w-4" }) })
2588
+ ] })
2589
+ ] }),
2590
+ /* @__PURE__ */ jsx(Separator, {}),
2591
+ /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
2592
+ /* @__PURE__ */ jsx(Label, { children: t("templates.buttons.withIcons") }),
2593
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-3", children: [
2594
+ /* @__PURE__ */ jsxs(Button, { children: [
2595
+ /* @__PURE__ */ jsx(User, { className: "mr-2 h-4 w-4" }),
2596
+ t("templates.buttons.profile")
2597
+ ] }),
2598
+ /* @__PURE__ */ jsxs(Button, { variant: "secondary", children: [
2599
+ /* @__PURE__ */ jsx(Mail, { className: "mr-2 h-4 w-4" }),
2600
+ t("templates.buttons.messages")
2601
+ ] }),
2602
+ /* @__PURE__ */ jsxs(Button, { variant: "outline", children: [
2603
+ /* @__PURE__ */ jsx(Calendar, { className: "mr-2 h-4 w-4" }),
2604
+ t("templates.buttons.schedule")
2605
+ ] })
2606
+ ] })
2607
+ ] }),
2608
+ /* @__PURE__ */ jsx(Separator, {}),
2609
+ /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
2610
+ /* @__PURE__ */ jsx(Label, { children: t("templates.buttons.states") }),
2611
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-3", children: [
2612
+ /* @__PURE__ */ jsx(Button, { disabled: true, children: t("templates.buttons.disabled") }),
2613
+ /* @__PURE__ */ jsx(Button, { variant: "outline", disabled: true, children: t("templates.buttons.outlineDisabled") })
2614
+ ] })
2615
+ ] })
2616
+ ] })
2617
+ ] })
2618
+ ] }),
2619
+ /* @__PURE__ */ jsx(Separator, { className: "my-8" }),
2620
+ /* @__PURE__ */ jsxs("section", { children: [
2621
+ /* @__PURE__ */ jsx("h3", { className: "mb-4", children: t("templates.sections.badges") }),
2622
+ /* @__PURE__ */ jsxs(Card, { children: [
2623
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
2624
+ /* @__PURE__ */ jsx(CardTitle, { children: t("templates.badges.title") }),
2625
+ /* @__PURE__ */ jsx(CardDescription, { children: t("templates.badges.description") })
2626
+ ] }),
2627
+ /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-3", children: [
2628
+ /* @__PURE__ */ jsx(Badge, { variant: "default", children: "Default" }),
2629
+ /* @__PURE__ */ jsx(Badge, { variant: "secondary", children: "Secondary" }),
2630
+ /* @__PURE__ */ jsx(Badge, { variant: "outline", children: "Outline" }),
2631
+ /* @__PURE__ */ jsx(Badge, { variant: "destructive", children: "Destructive" }),
2632
+ /* @__PURE__ */ jsx(Badge, { className: "bg-success text-success-foreground", children: "Success" }),
2633
+ /* @__PURE__ */ jsx(Badge, { className: "bg-warning text-warning-foreground", children: "Warning" }),
2634
+ /* @__PURE__ */ jsx(Badge, { className: "bg-info text-info-foreground", children: "Info" })
2635
+ ] }) })
2636
+ ] })
2637
+ ] }),
2638
+ /* @__PURE__ */ jsx(Separator, { className: "my-8" }),
2639
+ /* @__PURE__ */ jsxs("section", { children: [
2640
+ /* @__PURE__ */ jsx("h3", { className: "mb-4", children: t("templates.sections.dialogs") }),
2641
+ /* @__PURE__ */ jsxs("div", { className: "grid gap-4 md:grid-cols-2", children: [
2642
+ /* @__PURE__ */ jsxs(Card, { children: [
2643
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
2644
+ /* @__PURE__ */ jsx(CardTitle, { children: t("templates.dialogs.dialogTitle") }),
2645
+ /* @__PURE__ */ jsx(CardDescription, { children: t("templates.dialogs.dialogDescription") })
2646
+ ] }),
2647
+ /* @__PURE__ */ jsx(CardContent, { className: "flex justify-center py-6", children: /* @__PURE__ */ jsxs(Dialog, { children: [
2648
+ /* @__PURE__ */ jsx(DialogTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Button, { variant: "outline", children: t("templates.dialogs.editProfile") }) }),
2649
+ /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-[425px]", children: [
2650
+ /* @__PURE__ */ jsxs(DialogHeader, { children: [
2651
+ /* @__PURE__ */ jsx(DialogTitle, { children: t("templates.dialogs.editProfile") }),
2652
+ /* @__PURE__ */ jsx(DialogDescription, { children: t("templates.dialogs.editProfileDescription") })
2653
+ ] }),
2654
+ /* @__PURE__ */ jsxs("div", { className: "grid gap-4 py-4", children: [
2655
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-4 items-center gap-4", children: [
2656
+ /* @__PURE__ */ jsx(Label, { htmlFor: "name", className: "text-right", children: t("templates.dialogs.name") }),
2657
+ /* @__PURE__ */ jsx(Input, { id: "name", defaultValue: "John Doe", className: "col-span-3" })
2658
+ ] }),
2659
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-4 items-center gap-4", children: [
2660
+ /* @__PURE__ */ jsx(Label, { htmlFor: "username", className: "text-right", children: t("templates.dialogs.username") }),
2661
+ /* @__PURE__ */ jsx(Input, { id: "username", defaultValue: "@johndoe", className: "col-span-3" })
2662
+ ] })
2663
+ ] }),
2664
+ /* @__PURE__ */ jsx(DialogFooter, { children: /* @__PURE__ */ jsx(Button, { type: "submit", children: t("templates.dialogs.update") }) })
2665
+ ] })
2666
+ ] }) })
2667
+ ] }),
2668
+ /* @__PURE__ */ jsxs(Card, { children: [
2669
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
2670
+ /* @__PURE__ */ jsx(CardTitle, { children: t("templates.dialogs.alertDialogTitle") }),
2671
+ /* @__PURE__ */ jsx(CardDescription, { children: t("templates.dialogs.alertDialogDescription") })
2672
+ ] }),
2673
+ /* @__PURE__ */ jsx(CardContent, { className: "flex justify-center py-6", children: /* @__PURE__ */ jsxs(AlertDialog, { children: [
2674
+ /* @__PURE__ */ jsx(AlertDialogTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Button, { variant: "destructive", children: t("templates.dialogs.deleteAccount") }) }),
2675
+ /* @__PURE__ */ jsxs(AlertDialogContent, { className: "sm:max-w-[425px]", children: [
2676
+ /* @__PURE__ */ jsxs(AlertDialogHeader, { children: [
2677
+ /* @__PURE__ */ jsx(AlertDialogTitle, { children: t("templates.dialogs.areYouSure") }),
2678
+ /* @__PURE__ */ jsx(AlertDialogDescription, { children: t("templates.dialogs.deleteWarning") })
2679
+ ] }),
2680
+ /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [
2681
+ /* @__PURE__ */ jsx(AlertDialogCancel, { children: t("templates.dialogs.cancel") }),
2682
+ /* @__PURE__ */ jsx(AlertDialogAction, { className: "bg-destructive text-destructive-foreground hover:bg-destructive/90", children: t("templates.dialogs.continue") })
2683
+ ] })
2684
+ ] })
2685
+ ] }) })
2686
+ ] })
2687
+ ] })
2688
+ ] }),
2689
+ /* @__PURE__ */ jsx(Separator, { className: "my-8" }),
2690
+ /* @__PURE__ */ jsx("section", { children: /* @__PURE__ */ jsx(MapShowcase, {}) }),
2691
+ /* @__PURE__ */ jsx(Separator, { className: "my-8" }),
2692
+ /* @__PURE__ */ jsxs("section", { children: [
2693
+ /* @__PURE__ */ jsx("h3", { className: "mb-4", children: t("templates.headerVariations.sectionTitle") }),
2694
+ /* @__PURE__ */ jsxs(Card, { children: [
2695
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
2696
+ /* @__PURE__ */ jsx(CardTitle, { children: t("templates.headerVariations.cardTitle") }),
2697
+ /* @__PURE__ */ jsx(CardDescription, { children: t("templates.headerVariations.cardDescription") })
2698
+ ] }),
2699
+ /* @__PURE__ */ jsxs(CardContent, { className: "space-y-6", children: [
2700
+ /* @__PURE__ */ jsxs("div", { className: "p-4 border rounded-[var(--radius-lg)] bg-muted/30", children: [
2701
+ /* @__PURE__ */ jsx("h4", { className: "text-sm font-semibold mb-4", children: t("templates.headerVariations.visibleElements") }),
2702
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-6", children: [
2703
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
2704
+ /* @__PURE__ */ jsx(
2705
+ Switch,
2706
+ {
2707
+ id: "header-actions",
2708
+ checked: showHeaderActions,
2709
+ onCheckedChange: setShowHeaderActions
2710
+ }
2711
+ ),
2712
+ /* @__PURE__ */ jsx(Label, { htmlFor: "header-actions", className: "cursor-pointer", children: t("templates.headerVariations.actionButtons") })
2713
+ ] }),
2714
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
2715
+ /* @__PURE__ */ jsx(
2716
+ Switch,
2717
+ {
2718
+ id: "header-bread",
2719
+ checked: showHeaderBreadcrumbs,
2720
+ onCheckedChange: setShowHeaderBreadcrumbs
2721
+ }
2722
+ ),
2723
+ /* @__PURE__ */ jsx(Label, { htmlFor: "header-bread", className: "cursor-pointer", children: t("templates.headerVariations.breadcrumbsLabel") })
2724
+ ] })
2725
+ ] })
2726
+ ] }),
2727
+ /* @__PURE__ */ jsxs("div", { className: "relative border rounded-[var(--radius-lg)] bg-muted/10 overflow-hidden shadow-inner", children: [
2728
+ /* @__PURE__ */ jsx("div", { className: "p-4 bg-background/50 border-b text-xs font-mono text-muted-foreground", children: t("templates.headerVariations.preview") }),
2729
+ /* @__PURE__ */ jsx(
2730
+ Header,
2731
+ {
2732
+ title: !showHeaderBreadcrumbs ? t("templates.headerVariations.currentPage") : void 0,
2733
+ breadcrumbs: showHeaderBreadcrumbs ? [
2734
+ {
2735
+ label: t("templates.headerVariations.breadcrumbBrand"),
2736
+ href: "#",
2737
+ icon: /* @__PURE__ */ jsx(Home, { className: "w-4 h-4" })
2738
+ },
2739
+ {
2740
+ label: t("templates.headerVariations.breadcrumbSettings"),
2741
+ href: "#"
2742
+ },
2743
+ { label: t("templates.headerVariations.breadcrumbProfile") }
2744
+ ] : void 0,
2745
+ actions: showHeaderActions ? [
2746
+ {
2747
+ id: "notify",
2748
+ icon: /* @__PURE__ */ jsx(Bell, { className: "w-5 h-5" }),
2749
+ onClick: () => toast(t("templates.headerVariations.notificationsOpenedToast"))
2750
+ },
2751
+ {
2752
+ id: "mail",
2753
+ label: t("templates.headerVariations.messagesLabel"),
2754
+ icon: /* @__PURE__ */ jsx(Mail, { className: "w-5 h-5" }),
2755
+ onClick: () => toast(t("templates.headerVariations.messagesOpenedToast"))
2756
+ }
2757
+ ] : void 0
2758
+ }
2759
+ ),
2760
+ /* @__PURE__ */ jsx("div", { className: "h-32 flex items-center justify-center text-muted-foreground text-sm italic", children: t("templates.headerVariations.contentArea") })
2761
+ ] })
2762
+ ] })
2763
+ ] })
2764
+ ] }),
2765
+ /* @__PURE__ */ jsx(Separator, { className: "my-8" }),
2766
+ /* @__PURE__ */ jsxs("section", { children: [
2767
+ /* @__PURE__ */ jsx("h3", { className: "mb-4", children: t("templates.sections.sidebarVariations") }),
2768
+ /* @__PURE__ */ jsxs(Card, { children: [
2769
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
2770
+ /* @__PURE__ */ jsx(CardTitle, { children: t("templates.sidebar.title") }),
2771
+ /* @__PURE__ */ jsx(CardDescription, { children: t("templates.sidebar.description") })
2772
+ ] }),
2773
+ /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsxs(Tabs, { defaultValue: "assistant", className: "w-full", children: [
2774
+ /* @__PURE__ */ jsxs(TabsList, { className: "mb-4", children: [
2775
+ /* @__PURE__ */ jsx(TabsTrigger, { value: "assistant", children: t("templates.sidebar.assistantMode") }),
2776
+ /* @__PURE__ */ jsx(TabsTrigger, { value: "default", children: t("templates.sidebar.defaultMode") })
2777
+ ] }),
2778
+ /* @__PURE__ */ jsxs("div", { className: "mb-6 p-4 border rounded-[var(--radius-lg)] bg-muted/30", children: [
2779
+ /* @__PURE__ */ jsx("h4", { className: "text-sm font-semibold mb-4", children: t("templates.sidebarControls.footerSettings") }),
2780
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-6 mt-2", children: [
2781
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
2782
+ /* @__PURE__ */ jsx(
2783
+ Switch,
2784
+ {
2785
+ id: "show-user",
2786
+ checked: showSidebarUser,
2787
+ onCheckedChange: setShowSidebarUser
2788
+ }
2789
+ ),
2790
+ /* @__PURE__ */ jsx(Label, { htmlFor: "show-user", className: "cursor-pointer", children: t("templates.sidebarControls.userProfile") })
2791
+ ] }),
2792
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
2793
+ /* @__PURE__ */ jsx(
2794
+ Switch,
2795
+ {
2796
+ id: "show-settings",
2797
+ checked: showSidebarSettings,
2798
+ onCheckedChange: setShowSidebarSettings
2799
+ }
2800
+ ),
2801
+ /* @__PURE__ */ jsx(Label, { htmlFor: "show-settings", className: "cursor-pointer", children: t("templates.sidebarControls.settings") })
2802
+ ] }),
2803
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
2804
+ /* @__PURE__ */ jsx(
2805
+ Switch,
2806
+ {
2807
+ id: "show-logout",
2808
+ checked: showSidebarLogout,
2809
+ onCheckedChange: setShowSidebarLogout
2810
+ }
2811
+ ),
2812
+ /* @__PURE__ */ jsx(Label, { htmlFor: "show-logout", className: "cursor-pointer", children: t("templates.sidebarControls.logoutButton") })
2813
+ ] })
2814
+ ] }),
2815
+ /* @__PURE__ */ jsxs("div", { className: "mt-6 pt-6 border-t", children: [
2816
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-4", children: [
2817
+ /* @__PURE__ */ jsx("h4", { className: "text-sm font-semibold", children: t("templates.sidebarControls.sidebarWidthDesktop") }),
2818
+ /* @__PURE__ */ jsxs("span", { className: "text-xs font-mono bg-muted px-2 py-1 rounded", children: [
2819
+ sidebarWidth,
2820
+ "px"
2821
+ ] })
2822
+ ] }),
2823
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [
2824
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground w-12 text-right", children: "240px" }),
2825
+ /* @__PURE__ */ jsx(
2826
+ Slider,
2827
+ {
2828
+ value: [sidebarWidth],
2829
+ onValueChange: (val) => setSidebarWidth(val[0]),
2830
+ min: 240,
2831
+ max: 450,
2832
+ step: 10,
2833
+ className: "flex-1",
2834
+ "aria-label": t("templates.sidebarControls.sidebarWidthAriaLabel")
2835
+ }
2836
+ ),
2837
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground w-12", children: "450px" })
2838
+ ] })
2839
+ ] })
2840
+ ] }),
2841
+ /* @__PURE__ */ jsx(TabsContent, { value: "assistant", children: /* @__PURE__ */ jsxs(
2842
+ "div",
2843
+ {
2844
+ className: "relative h-[600px] border rounded-[var(--radius-lg)] bg-muted/20 overflow-hidden",
2845
+ style: { transform: "translateZ(0)" },
2846
+ children: [
2847
+ /* @__PURE__ */ jsx(
2848
+ Sidebar,
2849
+ {
2850
+ expanded: true,
2851
+ width: sidebarWidth,
2852
+ onToggle: () => {
2853
+ },
2854
+ user: { email: "admin@xertica.com" },
2855
+ onLogout: () => toast(t("templates.sidebar.logoutToast")),
2856
+ location: { pathname: "/assistant/current" },
2857
+ navigate: () => {
2858
+ },
2859
+ variant: "assistant",
2860
+ search: {
2861
+ show: true,
2862
+ placeholder: t("templates.sidebar.searchTopicsPlaceholder"),
2863
+ filter: {
2864
+ show: true,
2865
+ content: /* @__PURE__ */ jsxs("div", { className: "p-2 space-y-2", children: [
2866
+ /* @__PURE__ */ jsx("div", { className: "text-xs font-semibold uppercase text-muted-foreground px-2", children: t("templates.sidebarControls.filterByStatus") }),
2867
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-2 p-1", children: [
2868
+ /* @__PURE__ */ jsx(Badge, { className: "bg-sidebar-foreground/20 text-sidebar-foreground border-none cursor-pointer hover:bg-sidebar-foreground/30", children: t("templates.sidebarControls.filterActive") }),
2869
+ /* @__PURE__ */ jsx(
2870
+ Badge,
2871
+ {
2872
+ variant: "outline",
2873
+ className: "text-sidebar-foreground/70 border-sidebar-foreground/20 cursor-pointer hover:bg-sidebar-foreground/10",
2874
+ children: t("templates.sidebarControls.filterArchived")
2875
+ }
2876
+ ),
2877
+ /* @__PURE__ */ jsx(
2878
+ Badge,
2879
+ {
2880
+ variant: "outline",
2881
+ className: "text-sidebar-foreground/70 border-sidebar-foreground/20 cursor-pointer hover:bg-sidebar-foreground/10",
2882
+ children: t("templates.sidebarControls.filterPending")
2883
+ }
2884
+ )
2885
+ ] })
2886
+ ] })
2887
+ }
2888
+ },
2889
+ fixedArea: {
2890
+ show: true,
2891
+ content: /* @__PURE__ */ jsxs(Button, { className: "w-full bg-sidebar-primary hover:bg-sidebar-primary/90 text-sidebar-primary-foreground shadow-lg font-bold border-none transition-all duration-300 transform hover:scale-[1.02] active:scale-[0.98]", children: [
2892
+ /* @__PURE__ */ jsx(Plus, { className: "w-4 h-4 mr-2" }),
2893
+ t("templates.sidebar.newConversation")
2894
+ ] })
2895
+ },
2896
+ navigationGroups: [
2897
+ {
2898
+ id: "recent",
2899
+ label: t("templates.sidebar.recent"),
2900
+ icon: Clock,
2901
+ items: [
2902
+ {
2903
+ path: "/assistant/refatoracao",
2904
+ label: t("templates.sidebar.items.sidebarRefactor"),
2905
+ description: t(
2906
+ "templates.sidebar.items.sidebarRefactorDescription"
2907
+ ),
2908
+ actions: [
2909
+ {
2910
+ label: t("templates.sidebar.actions.rename"),
2911
+ icon: FileEdit,
2912
+ onClick: () => toast(t("templates.sidebar.actions.renameToast"))
2913
+ },
2914
+ {
2915
+ label: t("templates.sidebar.actions.move"),
2916
+ icon: ArrowRightLeft,
2917
+ children: [
2918
+ {
2919
+ label: t("templates.sidebar.actions.moveActive"),
2920
+ onClick: () => toast(t("templates.sidebar.actions.moveActiveToast"))
2921
+ },
2922
+ {
2923
+ label: t("templates.sidebar.actions.moveMonitoring"),
2924
+ onClick: () => toast(
2925
+ t("templates.sidebar.actions.moveMonitoringToast")
2926
+ )
2927
+ },
2928
+ {
2929
+ label: t("templates.sidebar.actions.moveArchive"),
2930
+ onClick: () => toast(
2931
+ t("templates.sidebar.actions.moveArchiveToast")
2932
+ )
2933
+ }
2934
+ ]
2935
+ },
2936
+ {
2937
+ label: t("templates.sidebar.actions.clear"),
2938
+ icon: Trash2,
2939
+ onClick: () => toast(t("templates.sidebar.actions.clearToast")),
2940
+ variant: "destructive"
2941
+ }
2942
+ ]
2943
+ }
2944
+ ]
2945
+ },
2946
+ {
2947
+ id: "projects",
2948
+ label: t("templates.sidebar.constructionMonitoring"),
2949
+ icon: Map$1,
2950
+ actions: [
2951
+ {
2952
+ label: t("templates.sidebar.actions.newCategory"),
2953
+ icon: Plus,
2954
+ onClick: () => toast(t("templates.sidebar.actions.newCategoryToast"))
2955
+ },
2956
+ {
2957
+ label: t("templates.sidebar.actions.archiveGroup"),
2958
+ icon: Archive,
2959
+ onClick: () => toast(t("templates.sidebar.actions.archiveGroupToast"))
2960
+ }
2961
+ ],
2962
+ items: [
2963
+ {
2964
+ path: "/assistant/br163",
2965
+ label: t("templates.sidebar.items.br163Restoration"),
2966
+ icon: () => /* @__PURE__ */ jsx("div", { className: "w-2 h-2 rounded-full bg-yellow-500" }),
2967
+ description: /* @__PURE__ */ jsxs("div", { className: "space-y-1.5 min-w-[160px]", children: [
2968
+ /* @__PURE__ */ jsx(
2969
+ Progress,
2970
+ {
2971
+ value: 67,
2972
+ className: "h-1.5 bg-sidebar-foreground/10"
2973
+ }
2974
+ ),
2975
+ /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center text-[10px] text-sidebar-foreground/60", children: [
2976
+ /* @__PURE__ */ jsx("span", { children: t("templates.sidebar.items.br163Location") }),
2977
+ /* @__PURE__ */ jsx("span", { children: "67%" })
2978
+ ] })
2979
+ ] })
2980
+ }
2981
+ ]
2982
+ }
2983
+ ],
2984
+ footer: {
2985
+ showUser: showSidebarUser,
2986
+ showSettings: showSidebarSettings,
2987
+ showLogout: showSidebarLogout
2988
+ }
2989
+ }
2990
+ ),
2991
+ /* @__PURE__ */ jsx(
2992
+ "div",
2993
+ {
2994
+ className: "absolute inset-y-0 right-0 p-8 flex items-center justify-center transition-all duration-300",
2995
+ style: { left: `${sidebarWidth}px` },
2996
+ children: /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-center", children: t("templates.sidebar.assistantContent") })
2997
+ }
2998
+ )
2999
+ ]
3000
+ }
3001
+ ) }),
3002
+ /* @__PURE__ */ jsx(TabsContent, { value: "default", children: /* @__PURE__ */ jsxs(
3003
+ "div",
3004
+ {
3005
+ className: "relative h-[600px] border rounded-[var(--radius-lg)] bg-muted/20 overflow-hidden",
3006
+ style: { transform: "translateZ(0)" },
3007
+ children: [
3008
+ /* @__PURE__ */ jsx(
3009
+ Sidebar,
3010
+ {
3011
+ expanded: true,
3012
+ width: sidebarWidth,
3013
+ onToggle: () => {
3014
+ },
3015
+ user: {
3016
+ name: "Ariel Santos",
3017
+ email: "admin@xertica.com",
3018
+ avatar: "https://github.com/shadcn.png"
3019
+ },
3020
+ onLogout: () => toast(t("templates.sidebar.logoutToast")),
3021
+ onSettingsClick: () => toast(t("templates.sidebar.settingsClickedToast")),
3022
+ location: { pathname: "/home" },
3023
+ navigate: () => {
3024
+ },
3025
+ variant: "default",
3026
+ routes: [
3027
+ {
3028
+ path: "/home",
3029
+ label: t("templates.sidebar.routes.home"),
3030
+ icon: Home
3031
+ },
3032
+ {
3033
+ path: "/dashboard",
3034
+ label: t("templates.sidebar.routes.dashboard"),
3035
+ icon: Users
3036
+ },
3037
+ {
3038
+ path: "/settings",
3039
+ label: t("templates.sidebar.routes.settings"),
3040
+ icon: Settings
3041
+ }
3042
+ ],
3043
+ footer: {
3044
+ showUser: showSidebarUser,
3045
+ showSettings: showSidebarSettings,
3046
+ showLogout: showSidebarLogout
3047
+ }
3048
+ }
3049
+ ),
3050
+ /* @__PURE__ */ jsx(
3051
+ "div",
3052
+ {
3053
+ className: "absolute inset-y-0 right-0 p-8 flex items-center justify-center transition-all duration-300",
3054
+ style: { left: `${sidebarWidth}px` },
3055
+ children: /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-center", children: t("templates.sidebar.defaultContent") })
3056
+ }
3057
+ )
3058
+ ]
3059
+ }
3060
+ ) })
3061
+ ] }) })
3062
+ ] })
3063
+ ] }),
3064
+ /* @__PURE__ */ jsx(Separator, { className: "my-8" }),
3065
+ /* @__PURE__ */ jsxs(Card, { className: "mt-8", children: [
3066
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
3067
+ /* @__PURE__ */ jsx(CardTitle, { children: t("templates.footer.title") }),
3068
+ /* @__PURE__ */ jsx(CardDescription, { children: t("templates.footer.subtitle") })
3069
+ ] }),
3070
+ /* @__PURE__ */ jsxs(CardContent, { className: "space-y-4", children: [
3071
+ /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground", children: [
3072
+ t("templates.footer.descriptionPart1"),
3073
+ /* @__PURE__ */ jsx("code", { className: "bg-muted px-2 py-1 rounded-[var(--radius-sm)] [font-size:var(--text-small)]", children: "xertica-ui" }),
3074
+ t("templates.footer.descriptionPart2")
3075
+ ] }),
3076
+ /* @__PURE__ */ jsxs(Alert, { variant: "info", children: [
3077
+ /* @__PURE__ */ jsx(AlertTitle, { children: t("templates.footer.tipTitle") }),
3078
+ /* @__PURE__ */ jsxs(AlertDescription, { children: [
3079
+ t("templates.footer.tipDescriptionPart1"),
3080
+ /* @__PURE__ */ jsx("code", { className: "bg-muted px-1 rounded", children: "styles/xertica/tokens.css" }),
3081
+ t("templates.footer.tipDescriptionPart2")
3082
+ ] })
3083
+ ] })
3084
+ ] })
3085
+ ] })
3086
+ ] }) }) }) })
3087
+ ]
3088
+ }
3089
+ );
3090
+ }
3091
+
3092
+ function TemplatePage() {
3093
+ const { user, logout } = useAuth();
3094
+ const layout = useOptionalLayout();
3095
+ const [localSidebarExpanded, setLocalSidebarExpanded] = React__default.useState(false);
3096
+ const [localAssistantExpanded, setLocalAssistantExpanded] = React__default.useState(false);
3097
+ const sidebarExpanded = layout?.sidebarExpanded ?? localSidebarExpanded;
3098
+ const sidebarWidth = layout?.sidebarWidth ?? 280;
3099
+ const assistenteExpanded = layout?.assistenteExpanded ?? localAssistantExpanded;
3100
+ const toggleSidebar = layout?.toggleSidebar ?? (() => setLocalSidebarExpanded((value) => !value));
3101
+ const toggleAssistente = layout?.toggleAssistente ?? (() => setLocalAssistantExpanded((value) => !value));
3102
+ const location = useLocation();
3103
+ const navigate = useNavigate();
3104
+ return /* @__PURE__ */ jsxs("div", { className: "h-screen flex bg-muted overflow-hidden relative", children: [
3105
+ /* @__PURE__ */ jsx(
3106
+ Sidebar,
3107
+ {
3108
+ expanded: sidebarExpanded,
3109
+ width: sidebarWidth,
3110
+ onToggle: toggleSidebar,
3111
+ user: {
3112
+ ...user,
3113
+ name: "Ariel Santos",
3114
+ avatar: "https://github.com/shadcn.png"
3115
+ },
3116
+ onLogout: logout,
3117
+ onSettingsClick: () => navigate("/settings"),
3118
+ location,
3119
+ navigate,
3120
+ routes
3121
+ }
3122
+ ),
3123
+ /* @__PURE__ */ jsx(TemplateContent, {}),
3124
+ /* @__PURE__ */ jsx(
3125
+ XerticaAssistant,
3126
+ {
3127
+ isExpanded: assistenteExpanded,
3128
+ onToggle: toggleAssistente,
3129
+ onEvaluation: () => {
3130
+ }
3131
+ }
3132
+ )
3133
+ ] });
3134
+ }
3135
+
3136
+ function VerifyEmailPage() {
3137
+ const navigate = useNavigate();
3138
+ const location = useLocation();
3139
+ const { t } = useTranslation();
3140
+ const email = location.state?.email || "your@email.com";
3141
+ const [isResending, setIsResending] = useState(false);
3142
+ const [resendSuccess, setResendSuccess] = useState(false);
3143
+ const handleResend = async () => {
3144
+ setIsResending(true);
3145
+ setResendSuccess(false);
3146
+ await new Promise((resolve) => setTimeout(resolve, 1500));
3147
+ setIsResending(false);
3148
+ setResendSuccess(true);
3149
+ setTimeout(() => setResendSuccess(false), 3e3);
3150
+ };
3151
+ const handleSocialLogin = (_provider) => {
3152
+ };
3153
+ return /* @__PURE__ */ jsxs("div", { className: "h-screen w-full flex overflow-y-auto", children: [
3154
+ /* @__PURE__ */ jsxs("div", { className: "hidden lg:flex lg:flex-1 relative overflow-hidden", children: [
3155
+ /* @__PURE__ */ jsx(
3156
+ ImageWithFallback,
3157
+ {
3158
+ src: "https://images.unsplash.com/photo-1563986768609-322da13575f3?w=1200&h=800&fit=crop&auto=format",
3159
+ alt: t("verifyEmail.heroImageAlt"),
3160
+ className: "absolute inset-0 w-full h-full object-cover"
3161
+ }
3162
+ ),
3163
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-[image:var(--gradient-diagonal)] opacity-80" })
3164
+ ] }),
3165
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 flex items-center justify-center px-4 sm:px-6 lg:px-8 lg:flex-none lg:w-1/2 relative bg-muted", children: [
3166
+ /* @__PURE__ */ jsx("div", { className: "absolute top-4 right-4 z-20", children: /* @__PURE__ */ jsx(LanguageSelector, { variant: "minimal", showIcon: false }) }),
3167
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-0 lg:hidden bg-[image:var(--gradient-diagonal)] opacity-10 dark:opacity-5" }),
3168
+ /* @__PURE__ */ jsxs("div", { className: "w-full max-w-sm space-y-6 relative z-10", children: [
3169
+ /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
3170
+ /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center mb-4", children: /* @__PURE__ */ jsx(
3171
+ XerticaLogo,
3172
+ {
3173
+ className: "h-12 w-auto text-primary dark:text-foreground",
3174
+ variant: "theme"
3175
+ }
3176
+ ) }),
3177
+ /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center mb-4", children: /* @__PURE__ */ jsx("div", { className: "p-4 bg-primary/10 rounded-[var(--radius)]", children: /* @__PURE__ */ jsx(Mail, { className: "w-12 h-12 text-primary" }) }) }),
3178
+ /* @__PURE__ */ jsx("h2", { className: "text-sm text-muted-foreground", children: t("verifyEmail.heading") }),
3179
+ /* @__PURE__ */ jsx("p", { className: "mt-2 text-muted-foreground", children: t("verifyEmail.instructionsSent") }),
3180
+ /* @__PURE__ */ jsx("p", { className: "mt-1 text-primary", children: email })
3181
+ ] }),
3182
+ /* @__PURE__ */ jsxs("div", { className: "bg-accent rounded-[var(--radius)] p-4 space-y-3", children: [
3183
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: t("verifyEmail.instructions") }),
3184
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 text-muted-foreground", children: [
3185
+ /* @__PURE__ */ jsx(CheckCircle2, { className: "w-4 h-4 mt-0.5 flex-shrink-0 text-[var(--chart-2)]" }),
3186
+ /* @__PURE__ */ jsx("span", { className: "text-sm", children: t("verifyEmail.checkSpam") })
3187
+ ] })
3188
+ ] }),
3189
+ resendSuccess && /* @__PURE__ */ jsxs("div", { className: "bg-[var(--chart-2)]/10 border border-[var(--chart-2)]/20 rounded-[var(--radius)] p-3 flex items-center gap-2", children: [
3190
+ /* @__PURE__ */ jsx(CheckCircle2, { className: "w-5 h-5 text-[var(--chart-2)] flex-shrink-0" }),
3191
+ /* @__PURE__ */ jsx("span", { className: "text-sm text-[var(--chart-2)]", children: t("verifyEmail.resentSuccess") })
3192
+ ] }),
3193
+ /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
3194
+ /* @__PURE__ */ jsx("p", { className: "text-center text-muted-foreground", children: t("verifyEmail.notReceived") }),
3195
+ /* @__PURE__ */ jsx(
3196
+ Button,
3197
+ {
3198
+ variant: "outline",
3199
+ className: "w-full",
3200
+ onClick: handleResend,
3201
+ disabled: isResending,
3202
+ children: isResending ? t("verifyEmail.resending") : t("verifyEmail.resend")
3203
+ }
3204
+ ),
3205
+ /* @__PURE__ */ jsxs(
3206
+ Button,
3207
+ {
3208
+ type: "button",
3209
+ onClick: () => navigate("/login"),
3210
+ variant: "outline",
3211
+ className: "w-full text-muted-foreground hover:text-foreground",
3212
+ children: [
3213
+ /* @__PURE__ */ jsx(ArrowLeft, { className: "w-4 h-4 mr-2" }),
3214
+ t("verifyEmail.backToLogin")
3215
+ ]
3216
+ }
3217
+ )
3218
+ ] }),
3219
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
3220
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center", children: /* @__PURE__ */ jsx("div", { className: "w-full border-t border-border" }) }),
3221
+ /* @__PURE__ */ jsx("div", { className: "relative flex justify-center text-sm", children: /* @__PURE__ */ jsx("span", { className: "bg-muted px-2 text-muted-foreground", children: t("login.orContinueWith") }) })
3222
+ ] }),
3223
+ /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
3224
+ /* @__PURE__ */ jsxs(
3225
+ Button,
3226
+ {
3227
+ type: "button",
3228
+ variant: "outline",
3229
+ className: "w-full justify-center",
3230
+ onClick: () => handleSocialLogin(),
3231
+ children: [
3232
+ /* @__PURE__ */ jsxs("svg", { className: "w-5 h-5 mr-2", viewBox: "0 0 48 48", xmlns: "http://www.w3.org/2000/svg", children: [
3233
+ /* @__PURE__ */ jsx(
3234
+ "path",
3235
+ {
3236
+ fill: "#EA4335",
3237
+ d: "M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"
3238
+ }
3239
+ ),
3240
+ /* @__PURE__ */ jsx(
3241
+ "path",
3242
+ {
3243
+ fill: "#4285F4",
3244
+ d: "M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"
3245
+ }
3246
+ ),
3247
+ /* @__PURE__ */ jsx(
3248
+ "path",
3249
+ {
3250
+ fill: "#FBBC05",
3251
+ d: "M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"
3252
+ }
3253
+ ),
3254
+ /* @__PURE__ */ jsx(
3255
+ "path",
3256
+ {
3257
+ fill: "#34A853",
3258
+ d: "M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"
3259
+ }
3260
+ ),
3261
+ /* @__PURE__ */ jsx("path", { fill: "none", d: "M0 0h48v48H0z" })
3262
+ ] }),
3263
+ /* @__PURE__ */ jsx("span", { children: t("login.signInWithGoogle") })
3264
+ ]
3265
+ }
3266
+ ),
3267
+ /* @__PURE__ */ jsxs(
3268
+ Button,
3269
+ {
3270
+ type: "button",
3271
+ variant: "outline",
3272
+ className: "w-full justify-center",
3273
+ onClick: () => handleSocialLogin(),
3274
+ children: [
3275
+ /* @__PURE__ */ jsx(Lock, { className: "w-5 h-5 mr-2 text-[var(--chart-4)]" }),
3276
+ /* @__PURE__ */ jsx("span", { children: t("login.signInWithMTLogin") })
3277
+ ]
3278
+ }
3279
+ ),
3280
+ /* @__PURE__ */ jsx(
3281
+ Button,
3282
+ {
3283
+ type: "button",
3284
+ variant: "outline",
3285
+ className: "w-full justify-center font-normal",
3286
+ onClick: () => handleSocialLogin(),
3287
+ children: /* @__PURE__ */ jsx("span", { children: t("login.signInWithGovBr") })
3288
+ }
3289
+ )
3290
+ ] })
3291
+ ] })
3292
+ ] })
3293
+ ] });
3294
+ }
3295
+
3296
+ export { ForgotPasswordPage as F, HomeContent as H, LoginPage as L, ResetPasswordPage as R, TemplateContent as T, VerifyEmailPage as V, HomePage as a, TemplatePage as b };