@burdenoff/microfe-eventfullymanaged 2026.1124.3 → 2026.1124.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"AnalyticsPage.js","names":["ANALYTICS_SNAPSHOTS_WITH_METRICS_QUERY","METRIC_FIELDS","statusVariant","value","status","formatGeneratedAt","parsed","shortDate","humanizeStatus","word","MetricTile","Icon","GlassCard","label","AnalyticsPage","pagination","usePagination","useQuery","summaryQuery","useDashboardSummaryQuery","upsertSnapshot","creating","useUpsertAnalyticsSnapshotMutation","snapshotName","setSnapshotName","useState","eventsQuery","useEventsQuery","events","useMemo","throughputEventIdOverride","setThroughputEventIdOverride","throughputEventId","throughputQuery","useCheckInThroughputQuery","throughputTimezone","throughputSeries","point","snapshots","data","total","summary","checkInCount","registrationsSeries","at","snapshot","a","b","statusBreakdown","entry","CHART_SERIES_COLORS","index","registrationTotal","entityCounts","onCreate","trimmed","response","mutationSucceeded","notify","refetch","error","describeError","summaryLoading","PagePurpose","EmphasisPanel","GradientText","Input","Button","Sparkles","AttendanceForecast","fetchMoreResult","previous","event","EventDraftAssistant","Skeleton","CalendarDays","ClipboardList","Users","QrCode","MapPin","Trophy","Ticket","EventAreaChart","EventDonutChart","ChartLegend","slice","EventBarChart","Select","SelectTrigger","SelectValue","SelectContent","SelectItem","BarChart3","loading","IllustratedEmptyState","generatedAt","captured","raw","field","Badge","Pagination"],"sources":["../../../../src/eventfullymanaged/pages/modules/AnalyticsPage.tsx"],"sourcesContent":["import { BarChart3, CalendarDays, ClipboardList, MapPin, QrCode, Sparkles, Ticket, Trophy, Users } from 'lucide-react';\nimport type { LucideIcon } from 'lucide-react';\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport {\n Badge,\n Button,\n EmphasisPanel,\n GlassCard,\n GradientText,\n IllustratedEmptyState,\n Input,\n PagePurpose,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n Skeleton,\n} from '@burdenoff/fe-libs/ui';\nimport { useMemo, useState } from 'react';\n\nimport {\n CHART_SERIES_COLORS,\n ChartLegend,\n EventAreaChart,\n EventBarChart,\n EventDonutChart,\n type AreaPoint,\n type BarDatum,\n type DonutSlice,\n} from '../../components/EventCharts';\nimport { Pagination, usePagination } from '../../components/Pagination';\nimport { AttendanceForecast } from '../../components/AttendanceForecast';\nimport { EventDraftAssistant } from '../../components/EventDraftAssistant';\nimport {\n useCheckInThroughputQuery,\n useDashboardSummaryQuery,\n useEventsQuery,\n useUpsertAnalyticsSnapshotMutation,\n} from '../../api/eventApi';\nimport { describeError, mutationSucceeded } from '../../lib/mutationResult';\nimport { notify } from '../../lib/toast';\n\n/**\n * Snapshot metrics are computed server-side at generation time and returned on\n * the `metrics` JSON field of an analytics snapshot. The shared\n * `useAnalyticsSnapshotsQuery` hook does not select `metrics`, so this page owns\n * a dedicated query (distinct operation name) that pulls the metric payload in\n * addition to the identity fields.\n */\nconst ANALYTICS_SNAPSHOTS_WITH_METRICS_QUERY = gql`\n query EventfullymanagedAnalyticsSnapshotsWithMetrics($limit: Int, $offset: Int) {\n analyticsSnapshots: eventfullyManagedAnalyticsSnapshots(limit: $limit, offset: $offset) {\n total\n items {\n id\n name\n title\n status\n metrics\n createdAt\n }\n }\n }\n`;\n\ntype SnapshotMetrics = {\n totalEvents?: number | null;\n activeEvents?: number | null;\n totalRegistrations?: number | null;\n totalAttendees?: number | null;\n totalVenues?: number | null;\n totalSponsors?: number | null;\n upcomingSessions?: number | null;\n generatedAt?: string | null;\n};\n\ntype SnapshotRow = {\n id: string;\n name?: string | null;\n title?: string | null;\n status?: string | null;\n createdAt?: string | null;\n metrics?: SnapshotMetrics | null;\n};\n\ntype SnapshotsResponse = {\n analyticsSnapshots: { total: number; items: SnapshotRow[] };\n};\n\nconst METRIC_FIELDS: { key: keyof SnapshotMetrics; label: string }[] = [\n { key: 'totalEvents', label: 'Events' },\n { key: 'activeEvents', label: 'Active' },\n { key: 'totalRegistrations', label: 'Registrations' },\n { key: 'totalAttendees', label: 'Attendees' },\n { key: 'totalVenues', label: 'Venues' },\n { key: 'totalSponsors', label: 'Sponsors' },\n { key: 'upcomingSessions', label: 'Upcoming Sessions' },\n];\n\nfunction statusVariant(status: string): 'success' | 'warning' | 'secondary' | 'info' {\n const value = status.toLowerCase();\n if (['active', 'published', 'completed'].includes(value)) return 'success';\n if (['inactive', 'cancelled', 'archived', 'expired'].includes(value)) return 'warning';\n if (['draft', 'created', 'pending', 'scheduled'].includes(value)) return 'info';\n return 'secondary';\n}\n\nfunction formatGeneratedAt(value?: string | null): string | null {\n if (!value) return null;\n const parsed = new Date(value);\n return Number.isNaN(parsed.getTime()) ? null : parsed.toLocaleString();\n}\n\nfunction shortDate(value?: string | null): string {\n if (!value) return '—';\n const parsed = new Date(value);\n if (Number.isNaN(parsed.getTime())) return '—';\n return parsed.toLocaleDateString(undefined, { month: 'short', day: 'numeric' });\n}\n\n/** Humanise a registration status token (e.g. `checked_in` → `Checked In`). */\nfunction humanizeStatus(status: string): string {\n return status\n .replace(/[_-]+/g, ' ')\n .split(' ')\n .filter(Boolean)\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(' ');\n}\n\nfunction MetricTile({ icon: Icon, label, value }: { icon: LucideIcon; label: string; value: number }) {\n return (\n <GlassCard treatment=\"metric\" className=\"p-4\">\n <div className=\"flex items-center gap-2 text-text-secondary\">\n <Icon className=\"h-4 w-4 text-accent-primary\" />\n <p className=\"text-xs font-medium uppercase tracking-wide\">{label}</p>\n </div>\n <p className=\"mt-2 text-2xl font-bold tabular-nums text-text-primary\">{value.toLocaleString()}</p>\n </GlassCard>\n );\n}\n\nexport default function AnalyticsPage() {\n const pagination = usePagination({ pageSize: 8 });\n const { data, loading, refetch } = useQuery<SnapshotsResponse, { limit: number; offset: number }>(\n ANALYTICS_SNAPSHOTS_WITH_METRICS_QUERY,\n { variables: { limit: pagination.limit, offset: pagination.offset } }\n );\n const summaryQuery = useDashboardSummaryQuery();\n const [upsertSnapshot, { loading: creating }] = useUpsertAnalyticsSnapshotMutation();\n const [snapshotName, setSnapshotName] = useState('overview');\n\n // BOFF-3999 — check-in throughput is scoped to one event; default to the\n // first event once the list loads.\n const eventsQuery = useEventsQuery({ limit: 50, offset: 0 });\n const events = useMemo(() => eventsQuery.data?.events.items ?? [], [eventsQuery.data]);\n // Derived (not effect-synced): an explicit user pick wins, otherwise fall\n // back to the first loaded event — avoids a setState-in-effect render.\n const [throughputEventIdOverride, setThroughputEventIdOverride] = useState('');\n const throughputEventId = throughputEventIdOverride || events[0]?.id || '';\n const throughputQuery = useCheckInThroughputQuery({ eventId: throughputEventId });\n // BOFF-11389 — the server buckets `hour` in the event's own IANA timezone\n // (returned per-point as `timezone`); label each bar in that same zone\n // instead of the viewer's browser zone, or bucket and label disagree.\n const throughputTimezone = throughputQuery.data?.checkInThroughput[0]?.timezone ?? null;\n const throughputSeries = useMemo<BarDatum[]>(() => {\n return (throughputQuery.data?.checkInThroughput ?? []).map((point) => ({\n name: new Date(point.hour).toLocaleTimeString(undefined, { hour: 'numeric', timeZone: point.timezone }),\n value: point.count,\n }));\n }, [throughputQuery.data]);\n\n const snapshots = useMemo(() => data?.analyticsSnapshots.items ?? [], [data]);\n const total = data?.analyticsSnapshots.total ?? 0;\n\n const summary = summaryQuery.data?.dashboardSummary;\n\n // BOFF-11386 — checked-in count comes from the server aggregate (same live-\n // registration population as totalRegistrations), not a 200-row sample.\n const checkInCount = summary?.checkedInRegistrations ?? 0;\n\n // Registrations over time: the totalRegistrations captured on each snapshot,\n // ordered oldest → newest. Purely real, snapshot-derived — never synthesised.\n const registrationsSeries = useMemo<AreaPoint[]>(() => {\n return snapshots\n .map((snapshot) => {\n const at = snapshot.metrics?.generatedAt ?? snapshot.createdAt ?? null;\n const parsed = at ? new Date(at) : null;\n const value =\n typeof snapshot.metrics?.totalRegistrations === 'number' ? snapshot.metrics.totalRegistrations : null;\n return parsed && !Number.isNaN(parsed.getTime()) && value !== null\n ? { time: parsed.getTime(), label: shortDate(at), value }\n : null;\n })\n .filter((point): point is { time: number; label: string; value: number } => point !== null)\n .sort((a, b) => a.time - b.time)\n .map(({ label, value }) => ({ label, value }));\n }, [snapshots]);\n\n // BOFF-11386 — registrations-by-status donut, from the server aggregate\n // (same live-registration population as totalRegistrations), not a\n // 200-row client-side sample.\n const statusBreakdown = useMemo<DonutSlice[]>(() => {\n return (summary?.registrationsByStatus ?? [])\n .slice()\n .sort((a, b) => b.count - a.count)\n .map((entry, index) => ({\n name: humanizeStatus(entry.status || 'unknown'),\n value: entry.count,\n color: CHART_SERIES_COLORS[index % CHART_SERIES_COLORS.length],\n }));\n }, [summary]);\n\n const registrationTotal = summary?.totalRegistrations ?? 0;\n\n // Entity-count bar chart from the real dashboard summary + derived check-ins.\n const entityCounts = useMemo<BarDatum[]>(() => {\n if (!summary) return [];\n return [\n { name: 'Events', value: summary.totalEvents },\n { name: 'Regs', value: summary.totalRegistrations },\n { name: 'Attendees', value: summary.totalAttendees },\n { name: 'Check-ins', value: checkInCount },\n { name: 'Venues', value: summary.totalVenues },\n { name: 'Sponsors', value: summary.totalSponsors },\n { name: 'Sessions', value: summary.upcomingSessions },\n ];\n }, [summary, checkInCount]);\n\n // BOFF-11388 — the mutation always inserts (no lookup by name), so an\n // unvalidated name let two clicks, or two uses of the same label, produce\n // duplicate snapshots. Block a name already in the loaded page instead.\n const onCreate = async () => {\n const trimmed = snapshotName.trim();\n if (!trimmed) return;\n if (snapshots.some((snapshot) => (snapshot.name ?? '').toLowerCase() === trimmed.toLowerCase())) {\n notify.error('Snapshot name already used', 'Pick a different name, or delete the existing snapshot first.');\n return;\n }\n try {\n const response = await upsertSnapshot({\n variables: {\n input: {\n name: trimmed,\n title: trimmed,\n status: 'created',\n metadata: {},\n },\n },\n });\n if (!mutationSucceeded(response, response.data?.upsertAnalyticsSnapshot?.id, 'Could not generate snapshot')) {\n return;\n }\n notify.success('Snapshot generated');\n await refetch();\n } catch (error) {\n notify.error('Could not generate snapshot', describeError(error));\n }\n };\n\n const summaryLoading = summaryQuery.loading && !summary;\n\n return (\n <div className=\"space-y-6 p-6\">\n <PagePurpose>\n Analytics shows current totals across every entity you manage, how registrations break down by status, and a\n trend line built from your saved snapshots. Generate a snapshot to record today&apos;s numbers for the\n workspace; each one is kept on its own and does not get replaced by later snapshots.\n </PagePurpose>\n\n <EmphasisPanel>\n <div className=\"flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between\">\n <div>\n <h1 className=\"text-2xl font-bold text-text-primary\">\n <GradientText>Analytics</GradientText>\n </h1>\n <p className=\"mt-1 text-sm text-text-secondary\">\n Current metrics from live event operations, loaded when the page opens, plus point-in-time snapshots you\n control.\n </p>\n </div>\n <div className=\"flex w-full flex-col gap-2 sm:w-auto sm:flex-row\">\n <Input\n value={snapshotName}\n onChange={(e) => setSnapshotName(e.target.value)}\n placeholder=\"daily-summary\"\n aria-label=\"Snapshot name\"\n className=\"sm:w-48\"\n />\n <Button type=\"button\" disabled={creating} onClick={onCreate}>\n <Sparkles className=\"h-4 w-4\" />\n {creating ? 'Generating...' : 'Generate snapshot'}\n </Button>\n </div>\n </div>\n </EmphasisPanel>\n\n <AttendanceForecast\n events={events}\n total={eventsQuery.data?.events.total ?? 0}\n loading={eventsQuery.loading}\n failed={Boolean(eventsQuery.error)}\n reload={() => eventsQuery.refetch()}\n loadMore={() =>\n eventsQuery.fetchMore({\n variables: { limit: 50, offset: events.length },\n updateQuery: (previous, { fetchMoreResult }) => ({\n events: {\n total: fetchMoreResult.events.total,\n items: Array.from(\n new Map(\n [...previous.events.items, ...fetchMoreResult.events.items].map((event) => [event.id, event])\n ).values()\n ),\n },\n }),\n })\n }\n />\n\n <EventDraftAssistant events={events} />\n\n <div className=\"grid grid-cols-1 gap-6 xl:grid-cols-[minmax(0,1fr)_320px]\">\n <div className=\"space-y-6\">\n {/* Live metric tiles */}\n {summaryLoading ? (\n <div className=\"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4\">\n {Array.from({ length: 7 }).map((_, index) => (\n <Skeleton key={index} className=\"h-[92px] rounded-card\" />\n ))}\n </div>\n ) : summary ? (\n <div className=\"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4\">\n <MetricTile icon={CalendarDays} label=\"Events\" value={summary.totalEvents} />\n <MetricTile icon={ClipboardList} label=\"Registrations\" value={summary.totalRegistrations} />\n <MetricTile icon={Users} label=\"Attendees\" value={summary.totalAttendees} />\n <MetricTile icon={QrCode} label=\"Check-ins\" value={checkInCount} />\n <MetricTile icon={MapPin} label=\"Venues\" value={summary.totalVenues} />\n <MetricTile icon={Trophy} label=\"Sponsors\" value={summary.totalSponsors} />\n <MetricTile icon={Ticket} label=\"Upcoming Sessions\" value={summary.upcomingSessions} />\n </div>\n ) : null}\n\n {/* Registrations over time + by status */}\n <div className=\"grid grid-cols-1 gap-6 lg:grid-cols-2\">\n <GlassCard treatment=\"insight\" className=\"p-5\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-base font-semibold text-text-primary\">Registrations over time</h2>\n <span className=\"text-xs text-text-muted\">By snapshot</span>\n </div>\n <div className=\"mt-4\">\n <EventAreaChart data={registrationsSeries} emptyLabel=\"Generate a few snapshots to chart the trend\" />\n </div>\n </GlassCard>\n\n <GlassCard treatment=\"insight\" className=\"p-5\">\n <h2 className=\"text-base font-semibold text-text-primary\">Registrations by status</h2>\n <div className=\"mt-4 flex flex-col items-center gap-4 sm:flex-row\">\n <div className=\"w-full sm:w-1/2\">\n <EventDonutChart\n data={statusBreakdown}\n centerValue={registrationTotal.toLocaleString()}\n centerLabel=\"Registrations\"\n emptyLabel=\"No registrations yet\"\n />\n </div>\n <div className=\"w-full sm:w-1/2\">\n <ChartLegend\n items={statusBreakdown.map((slice) => ({\n label: slice.name,\n color: slice.color ?? 'var(--color-chart-1)',\n value: slice.value.toLocaleString(),\n }))}\n />\n </div>\n </div>\n </GlassCard>\n </div>\n\n {/* Entity totals */}\n <GlassCard treatment=\"insight\" className=\"p-5\">\n <h2 className=\"text-base font-semibold text-text-primary\">Portfolio totals</h2>\n <p className=\"mt-0.5 text-xs text-text-muted\">Live counts across every entity you manage.</p>\n <div className=\"mt-4\">\n <EventBarChart data={entityCounts} emptyLabel=\"No operational data yet\" />\n </div>\n </GlassCard>\n\n {/* BOFF-3999 — check-in throughput by hour, scoped to one event. */}\n <GlassCard treatment=\"insight\" className=\"p-5\">\n <div className=\"flex flex-wrap items-center justify-between gap-3\">\n <div>\n <h2 className=\"text-base font-semibold text-text-primary\">Check-in throughput</h2>\n <p className=\"mt-0.5 text-xs text-text-muted\">\n Scans per hour at the door for the selected event\n {throughputTimezone ? ` (${throughputTimezone})` : ''}.\n </p>\n </div>\n {events.length > 0 ? (\n <Select value={throughputEventId} onValueChange={setThroughputEventIdOverride}>\n <SelectTrigger className=\"w-full sm:w-56\" aria-label=\"Select event for check-in throughput\">\n <SelectValue placeholder=\"Select event\" />\n </SelectTrigger>\n <SelectContent>\n {events.map((event) => (\n <SelectItem key={event.id} value={event.id}>\n {event.name}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n ) : null}\n </div>\n <div className=\"mt-4\">\n <EventBarChart\n data={throughputSeries}\n emptyLabel={\n throughputEventId ? 'No check-ins recorded yet for this event' : 'Select an event to see throughput'\n }\n />\n </div>\n </GlassCard>\n </div>\n\n {/* Saved snapshots rail */}\n <aside className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-base font-semibold text-text-primary\">\n Saved snapshots {total > 0 ? <span className=\"text-text-muted\">({total})</span> : null}\n </h2>\n <BarChart3 className=\"h-4 w-4 text-text-muted\" />\n </div>\n\n {loading && snapshots.length === 0 ? (\n <div className=\"space-y-3\">\n {Array.from({ length: 3 }).map((_, index) => (\n <Skeleton key={index} className=\"h-24 rounded-card\" />\n ))}\n </div>\n ) : snapshots.length === 0 ? (\n <GlassCard treatment=\"plain\" className=\"border-border-seam\">\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title=\"No snapshots yet\"\n description=\"Generate your first snapshot to freeze the current metrics.\"\n className=\"py-8\"\n />\n </GlassCard>\n ) : (\n <div className=\"space-y-3\">\n {snapshots.map((snapshot) => {\n const generatedAt =\n formatGeneratedAt(snapshot.metrics?.generatedAt) ?? formatGeneratedAt(snapshot.createdAt);\n const captured = METRIC_FIELDS.map((field) => {\n const raw = snapshot.metrics?.[field.key];\n return { label: field.label, value: typeof raw === 'number' ? raw : null };\n }).filter((entry) => entry.value !== null);\n return (\n <GlassCard key={snapshot.id} treatment=\"plain\" className=\"border-border-seam p-4\">\n <div className=\"flex items-start justify-between gap-2\">\n <div className=\"min-w-0\">\n <h3 className=\"truncate text-sm font-semibold text-text-primary\">\n {snapshot.title ?? snapshot.name ?? `Snapshot ${snapshot.id}`}\n </h3>\n {generatedAt ? <p className=\"mt-0.5 text-xs text-text-muted\">{generatedAt}</p> : null}\n </div>\n {snapshot.status ? (\n <Badge variant={statusVariant(snapshot.status)} className=\"shrink-0 uppercase\">\n {snapshot.status}\n </Badge>\n ) : null}\n </div>\n {captured.length > 0 ? (\n <dl className=\"mt-3 space-y-1.5\">\n {captured.map((entry) => (\n <div key={entry.label} className=\"flex items-center justify-between text-xs\">\n <dt className=\"text-text-secondary\">{entry.label}</dt>\n <dd className=\"font-semibold tabular-nums text-text-primary\">\n {(entry.value ?? 0).toLocaleString()}\n </dd>\n </div>\n ))}\n </dl>\n ) : (\n <p className=\"mt-3 text-xs text-text-muted\">No metrics captured.</p>\n )}\n </GlassCard>\n );\n })}\n\n <Pagination\n offset={pagination.offset}\n limit={pagination.limit}\n loadedCount={snapshots.length}\n total={total}\n onPrev={pagination.prevPage}\n onNext={pagination.nextPage}\n itemLabel=\"snapshots\"\n loading={loading}\n />\n </div>\n )}\n </aside>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAmDA,IAAMA,IAAyC,CAAG;;;;;;;;;;;;;;GAwC5C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,kBAAC,OAAD;UAAK,WAAU;UAAf,UAAA,CACE,kBAAC,MAAD;WAAI,WAAU;WACX,UAAAiC,EAAS,SAASA,EAAS,QAAQ,YAAYA,EAAS;UACvD,CAAA,GACHkD,IAAc,kBAAC,KAAD;WAAG,WAAU;WAAkC,UAAAA;UAAe,CAAA,IAAI,IAC9E;SACJ,CAAA,GAAAlD,EAAS,SACR,kBAACsD,IAAD;UAAO,SAASjG,EAAc2C,EAAS,MAAM;UAAG,WAAU;UACvD,UAAAA,EAAS;SACL,CAAA,IACL,IACD;QACJ,CAAA,GAAAmD,EAAS,SAAS,IACjB,kBAAC,MAAD;SAAI,WAAU;SACX,UAAAA,EAAS,KAAK,MACb,kBAAC,OAAD;UAAuB,WAAU;UAAjC,UAAA,CACE,kBAAC,MAAD;WAAI,WAAU;WAAuB,UAAA/C,EAAM;UAAU,CAAA,GACrD,kBAAC,MAAD;WAAI,WAAU;WACV,WAAAA,EAAM,SAAS,EAAA,CAAG,eAAe;UACjC,CAAA,CACD;SALK,GAAAA,EAAM,KAKX,CACN;QACC,CAAA,IAEJ,kBAAC,KAAD;SAAG,WAAU;SAA+B,UAAA;QAAuB,CAAA,CAE5D;OA5BK,GAAAJ,EAAS,EA4Bd;MAEf,CAAC,GAED,kBAACuD,IAAD;OACE,QAAQrF,EAAW;OACnB,OAAOA,EAAW;OAClB,aAAauB,EAAU;OAChB;OACP,QAAQvB,EAAW;OACnB,QAAQA,EAAW;OACnB,WAAU;OACD;MACV,CAAA,CACE;KAEF,CAAA,CAAA;IACJ,CAAA,CAAA;;EACF;;AAET"}
1
+ {"version":3,"file":"AnalyticsPage.js","names":["ANALYTICS_SNAPSHOTS_WITH_METRICS_QUERY","METRIC_FIELDS","statusVariant","value","status","formatGeneratedAt","parsed","shortDate","humanizeStatus","word","MetricTile","Icon","GlassCard","label","AnalyticsPage","pagination","usePagination","useQuery","summaryQuery","useDashboardSummaryQuery","upsertSnapshot","creating","useUpsertAnalyticsSnapshotMutation","snapshotName","setSnapshotName","useState","eventsQuery","useEventsQuery","events","useMemo","throughputEventIdOverride","setThroughputEventIdOverride","throughputEventId","throughputQuery","useCheckInThroughputQuery","throughputTimezone","throughputSeries","point","snapshots","data","total","summary","checkInCount","registrationsSeries","at","snapshot","a","b","statusBreakdown","entry","CHART_SERIES_COLORS","index","registrationTotal","entityCounts","onCreate","trimmed","response","mutationSucceeded","notify","refetch","error","describeError","summaryLoading","PagePurpose","EmphasisPanel","GradientText","Input","Button","Sparkles","AttendanceForecast","fetchMoreResult","previous","event","AiOperationsPanel","EventDraftAssistant","Skeleton","CalendarDays","ClipboardList","Users","QrCode","MapPin","Trophy","Ticket","EventAreaChart","EventDonutChart","ChartLegend","slice","EventBarChart","Select","SelectTrigger","SelectValue","SelectContent","SelectItem","BarChart3","loading","IllustratedEmptyState","generatedAt","captured","raw","field","Badge","Pagination"],"sources":["../../../../src/eventfullymanaged/pages/modules/AnalyticsPage.tsx"],"sourcesContent":["import { BarChart3, CalendarDays, ClipboardList, MapPin, QrCode, Sparkles, Ticket, Trophy, Users } from 'lucide-react';\nimport type { LucideIcon } from 'lucide-react';\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport {\n Badge,\n Button,\n EmphasisPanel,\n GlassCard,\n GradientText,\n IllustratedEmptyState,\n Input,\n PagePurpose,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n Skeleton,\n} from '@burdenoff/fe-libs/ui';\nimport { useMemo, useState } from 'react';\n\nimport {\n CHART_SERIES_COLORS,\n ChartLegend,\n EventAreaChart,\n EventBarChart,\n EventDonutChart,\n type AreaPoint,\n type BarDatum,\n type DonutSlice,\n} from '../../components/EventCharts';\nimport { Pagination, usePagination } from '../../components/Pagination';\nimport { AiOperationsPanel } from '../../components/AiOperationsPanel';\nimport { AttendanceForecast } from '../../components/AttendanceForecast';\nimport { EventDraftAssistant } from '../../components/EventDraftAssistant';\nimport {\n useCheckInThroughputQuery,\n useDashboardSummaryQuery,\n useEventsQuery,\n useUpsertAnalyticsSnapshotMutation,\n} from '../../api/eventApi';\nimport { describeError, mutationSucceeded } from '../../lib/mutationResult';\nimport { notify } from '../../lib/toast';\n\n/**\n * Snapshot metrics are computed server-side at generation time and returned on\n * the `metrics` JSON field of an analytics snapshot. The shared\n * `useAnalyticsSnapshotsQuery` hook does not select `metrics`, so this page owns\n * a dedicated query (distinct operation name) that pulls the metric payload in\n * addition to the identity fields.\n */\nconst ANALYTICS_SNAPSHOTS_WITH_METRICS_QUERY = gql`\n query EventfullymanagedAnalyticsSnapshotsWithMetrics($limit: Int, $offset: Int) {\n analyticsSnapshots: eventfullyManagedAnalyticsSnapshots(limit: $limit, offset: $offset) {\n total\n items {\n id\n name\n title\n status\n metrics\n createdAt\n }\n }\n }\n`;\n\ntype SnapshotMetrics = {\n totalEvents?: number | null;\n activeEvents?: number | null;\n totalRegistrations?: number | null;\n totalAttendees?: number | null;\n totalVenues?: number | null;\n totalSponsors?: number | null;\n upcomingSessions?: number | null;\n generatedAt?: string | null;\n};\n\ntype SnapshotRow = {\n id: string;\n name?: string | null;\n title?: string | null;\n status?: string | null;\n createdAt?: string | null;\n metrics?: SnapshotMetrics | null;\n};\n\ntype SnapshotsResponse = {\n analyticsSnapshots: { total: number; items: SnapshotRow[] };\n};\n\nconst METRIC_FIELDS: { key: keyof SnapshotMetrics; label: string }[] = [\n { key: 'totalEvents', label: 'Events' },\n { key: 'activeEvents', label: 'Active' },\n { key: 'totalRegistrations', label: 'Registrations' },\n { key: 'totalAttendees', label: 'Attendees' },\n { key: 'totalVenues', label: 'Venues' },\n { key: 'totalSponsors', label: 'Sponsors' },\n { key: 'upcomingSessions', label: 'Upcoming Sessions' },\n];\n\nfunction statusVariant(status: string): 'success' | 'warning' | 'secondary' | 'info' {\n const value = status.toLowerCase();\n if (['active', 'published', 'completed'].includes(value)) return 'success';\n if (['inactive', 'cancelled', 'archived', 'expired'].includes(value)) return 'warning';\n if (['draft', 'created', 'pending', 'scheduled'].includes(value)) return 'info';\n return 'secondary';\n}\n\nfunction formatGeneratedAt(value?: string | null): string | null {\n if (!value) return null;\n const parsed = new Date(value);\n return Number.isNaN(parsed.getTime()) ? null : parsed.toLocaleString();\n}\n\nfunction shortDate(value?: string | null): string {\n if (!value) return '—';\n const parsed = new Date(value);\n if (Number.isNaN(parsed.getTime())) return '—';\n return parsed.toLocaleDateString(undefined, { month: 'short', day: 'numeric' });\n}\n\n/** Humanise a registration status token (e.g. `checked_in` → `Checked In`). */\nfunction humanizeStatus(status: string): string {\n return status\n .replace(/[_-]+/g, ' ')\n .split(' ')\n .filter(Boolean)\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(' ');\n}\n\nfunction MetricTile({ icon: Icon, label, value }: { icon: LucideIcon; label: string; value: number }) {\n return (\n <GlassCard treatment=\"metric\" className=\"p-4\">\n <div className=\"flex items-center gap-2 text-text-secondary\">\n <Icon className=\"h-4 w-4 text-accent-primary\" />\n <p className=\"text-xs font-medium uppercase tracking-wide\">{label}</p>\n </div>\n <p className=\"mt-2 text-2xl font-bold tabular-nums text-text-primary\">{value.toLocaleString()}</p>\n </GlassCard>\n );\n}\n\nexport default function AnalyticsPage() {\n const pagination = usePagination({ pageSize: 8 });\n const { data, loading, refetch } = useQuery<SnapshotsResponse, { limit: number; offset: number }>(\n ANALYTICS_SNAPSHOTS_WITH_METRICS_QUERY,\n { variables: { limit: pagination.limit, offset: pagination.offset } }\n );\n const summaryQuery = useDashboardSummaryQuery();\n const [upsertSnapshot, { loading: creating }] = useUpsertAnalyticsSnapshotMutation();\n const [snapshotName, setSnapshotName] = useState('overview');\n\n // BOFF-3999 — check-in throughput is scoped to one event; default to the\n // first event once the list loads.\n const eventsQuery = useEventsQuery({ limit: 50, offset: 0 });\n const events = useMemo(() => eventsQuery.data?.events.items ?? [], [eventsQuery.data]);\n // Derived (not effect-synced): an explicit user pick wins, otherwise fall\n // back to the first loaded event — avoids a setState-in-effect render.\n const [throughputEventIdOverride, setThroughputEventIdOverride] = useState('');\n const throughputEventId = throughputEventIdOverride || events[0]?.id || '';\n const throughputQuery = useCheckInThroughputQuery({ eventId: throughputEventId });\n // BOFF-11389 — the server buckets `hour` in the event's own IANA timezone\n // (returned per-point as `timezone`); label each bar in that same zone\n // instead of the viewer's browser zone, or bucket and label disagree.\n const throughputTimezone = throughputQuery.data?.checkInThroughput[0]?.timezone ?? null;\n const throughputSeries = useMemo<BarDatum[]>(() => {\n return (throughputQuery.data?.checkInThroughput ?? []).map((point) => ({\n name: new Date(point.hour).toLocaleTimeString(undefined, { hour: 'numeric', timeZone: point.timezone }),\n value: point.count,\n }));\n }, [throughputQuery.data]);\n\n const snapshots = useMemo(() => data?.analyticsSnapshots.items ?? [], [data]);\n const total = data?.analyticsSnapshots.total ?? 0;\n\n const summary = summaryQuery.data?.dashboardSummary;\n\n // BOFF-11386 — checked-in count comes from the server aggregate (same live-\n // registration population as totalRegistrations), not a 200-row sample.\n const checkInCount = summary?.checkedInRegistrations ?? 0;\n\n // Registrations over time: the totalRegistrations captured on each snapshot,\n // ordered oldest → newest. Purely real, snapshot-derived — never synthesised.\n const registrationsSeries = useMemo<AreaPoint[]>(() => {\n return snapshots\n .map((snapshot) => {\n const at = snapshot.metrics?.generatedAt ?? snapshot.createdAt ?? null;\n const parsed = at ? new Date(at) : null;\n const value =\n typeof snapshot.metrics?.totalRegistrations === 'number' ? snapshot.metrics.totalRegistrations : null;\n return parsed && !Number.isNaN(parsed.getTime()) && value !== null\n ? { time: parsed.getTime(), label: shortDate(at), value }\n : null;\n })\n .filter((point): point is { time: number; label: string; value: number } => point !== null)\n .sort((a, b) => a.time - b.time)\n .map(({ label, value }) => ({ label, value }));\n }, [snapshots]);\n\n // BOFF-11386 — registrations-by-status donut, from the server aggregate\n // (same live-registration population as totalRegistrations), not a\n // 200-row client-side sample.\n const statusBreakdown = useMemo<DonutSlice[]>(() => {\n return (summary?.registrationsByStatus ?? [])\n .slice()\n .sort((a, b) => b.count - a.count)\n .map((entry, index) => ({\n name: humanizeStatus(entry.status || 'unknown'),\n value: entry.count,\n color: CHART_SERIES_COLORS[index % CHART_SERIES_COLORS.length],\n }));\n }, [summary]);\n\n const registrationTotal = summary?.totalRegistrations ?? 0;\n\n // Entity-count bar chart from the real dashboard summary + derived check-ins.\n const entityCounts = useMemo<BarDatum[]>(() => {\n if (!summary) return [];\n return [\n { name: 'Events', value: summary.totalEvents },\n { name: 'Regs', value: summary.totalRegistrations },\n { name: 'Attendees', value: summary.totalAttendees },\n { name: 'Check-ins', value: checkInCount },\n { name: 'Venues', value: summary.totalVenues },\n { name: 'Sponsors', value: summary.totalSponsors },\n { name: 'Sessions', value: summary.upcomingSessions },\n ];\n }, [summary, checkInCount]);\n\n // BOFF-11388 — the mutation always inserts (no lookup by name), so an\n // unvalidated name let two clicks, or two uses of the same label, produce\n // duplicate snapshots. Block a name already in the loaded page instead.\n const onCreate = async () => {\n const trimmed = snapshotName.trim();\n if (!trimmed) return;\n if (snapshots.some((snapshot) => (snapshot.name ?? '').toLowerCase() === trimmed.toLowerCase())) {\n notify.error('Snapshot name already used', 'Pick a different name, or delete the existing snapshot first.');\n return;\n }\n try {\n const response = await upsertSnapshot({\n variables: {\n input: {\n name: trimmed,\n title: trimmed,\n status: 'created',\n metadata: {},\n },\n },\n });\n if (!mutationSucceeded(response, response.data?.upsertAnalyticsSnapshot?.id, 'Could not generate snapshot')) {\n return;\n }\n notify.success('Snapshot generated');\n await refetch();\n } catch (error) {\n notify.error('Could not generate snapshot', describeError(error));\n }\n };\n\n const summaryLoading = summaryQuery.loading && !summary;\n\n return (\n <div className=\"space-y-6 p-6\">\n <PagePurpose>\n Analytics shows current totals across every entity you manage, how registrations break down by status, and a\n trend line built from your saved snapshots. Generate a snapshot to record today&apos;s numbers for the\n workspace; each one is kept on its own and does not get replaced by later snapshots.\n </PagePurpose>\n\n <EmphasisPanel>\n <div className=\"flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between\">\n <div>\n <h1 className=\"text-2xl font-bold text-text-primary\">\n <GradientText>Analytics</GradientText>\n </h1>\n <p className=\"mt-1 text-sm text-text-secondary\">\n Current metrics from live event operations, loaded when the page opens, plus point-in-time snapshots you\n control.\n </p>\n </div>\n <div className=\"flex w-full flex-col gap-2 sm:w-auto sm:flex-row\">\n <Input\n value={snapshotName}\n onChange={(e) => setSnapshotName(e.target.value)}\n placeholder=\"daily-summary\"\n aria-label=\"Snapshot name\"\n className=\"sm:w-48\"\n />\n <Button type=\"button\" disabled={creating} onClick={onCreate}>\n <Sparkles className=\"h-4 w-4\" />\n {creating ? 'Generating...' : 'Generate snapshot'}\n </Button>\n </div>\n </div>\n </EmphasisPanel>\n\n <AttendanceForecast\n events={events}\n total={eventsQuery.data?.events.total ?? 0}\n loading={eventsQuery.loading}\n failed={Boolean(eventsQuery.error)}\n reload={() => eventsQuery.refetch()}\n loadMore={() =>\n eventsQuery.fetchMore({\n variables: { limit: 50, offset: events.length },\n updateQuery: (previous, { fetchMoreResult }) => ({\n events: {\n total: fetchMoreResult.events.total,\n items: Array.from(\n new Map(\n [...previous.events.items, ...fetchMoreResult.events.items].map((event) => [event.id, event])\n ).values()\n ),\n },\n }),\n })\n }\n />\n\n <AiOperationsPanel events={events} />\n\n <EventDraftAssistant events={events} />\n\n <div className=\"grid grid-cols-1 gap-6 xl:grid-cols-[minmax(0,1fr)_320px]\">\n <div className=\"space-y-6\">\n {/* Live metric tiles */}\n {summaryLoading ? (\n <div className=\"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4\">\n {Array.from({ length: 7 }).map((_, index) => (\n <Skeleton key={index} className=\"h-[92px] rounded-card\" />\n ))}\n </div>\n ) : summary ? (\n <div className=\"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4\">\n <MetricTile icon={CalendarDays} label=\"Events\" value={summary.totalEvents} />\n <MetricTile icon={ClipboardList} label=\"Registrations\" value={summary.totalRegistrations} />\n <MetricTile icon={Users} label=\"Attendees\" value={summary.totalAttendees} />\n <MetricTile icon={QrCode} label=\"Check-ins\" value={checkInCount} />\n <MetricTile icon={MapPin} label=\"Venues\" value={summary.totalVenues} />\n <MetricTile icon={Trophy} label=\"Sponsors\" value={summary.totalSponsors} />\n <MetricTile icon={Ticket} label=\"Upcoming Sessions\" value={summary.upcomingSessions} />\n </div>\n ) : null}\n\n {/* Registrations over time + by status */}\n <div className=\"grid grid-cols-1 gap-6 lg:grid-cols-2\">\n <GlassCard treatment=\"insight\" className=\"p-5\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-base font-semibold text-text-primary\">Registrations over time</h2>\n <span className=\"text-xs text-text-muted\">By snapshot</span>\n </div>\n <div className=\"mt-4\">\n <EventAreaChart data={registrationsSeries} emptyLabel=\"Generate a few snapshots to chart the trend\" />\n </div>\n </GlassCard>\n\n <GlassCard treatment=\"insight\" className=\"p-5\">\n <h2 className=\"text-base font-semibold text-text-primary\">Registrations by status</h2>\n <div className=\"mt-4 flex flex-col items-center gap-4 sm:flex-row\">\n <div className=\"w-full sm:w-1/2\">\n <EventDonutChart\n data={statusBreakdown}\n centerValue={registrationTotal.toLocaleString()}\n centerLabel=\"Registrations\"\n emptyLabel=\"No registrations yet\"\n />\n </div>\n <div className=\"w-full sm:w-1/2\">\n <ChartLegend\n items={statusBreakdown.map((slice) => ({\n label: slice.name,\n color: slice.color ?? 'var(--color-chart-1)',\n value: slice.value.toLocaleString(),\n }))}\n />\n </div>\n </div>\n </GlassCard>\n </div>\n\n {/* Entity totals */}\n <GlassCard treatment=\"insight\" className=\"p-5\">\n <h2 className=\"text-base font-semibold text-text-primary\">Portfolio totals</h2>\n <p className=\"mt-0.5 text-xs text-text-muted\">Live counts across every entity you manage.</p>\n <div className=\"mt-4\">\n <EventBarChart data={entityCounts} emptyLabel=\"No operational data yet\" />\n </div>\n </GlassCard>\n\n {/* BOFF-3999 — check-in throughput by hour, scoped to one event. */}\n <GlassCard treatment=\"insight\" className=\"p-5\">\n <div className=\"flex flex-wrap items-center justify-between gap-3\">\n <div>\n <h2 className=\"text-base font-semibold text-text-primary\">Check-in throughput</h2>\n <p className=\"mt-0.5 text-xs text-text-muted\">\n Scans per hour at the door for the selected event\n {throughputTimezone ? ` (${throughputTimezone})` : ''}.\n </p>\n </div>\n {events.length > 0 ? (\n <Select value={throughputEventId} onValueChange={setThroughputEventIdOverride}>\n <SelectTrigger className=\"w-full sm:w-56\" aria-label=\"Select event for check-in throughput\">\n <SelectValue placeholder=\"Select event\" />\n </SelectTrigger>\n <SelectContent>\n {events.map((event) => (\n <SelectItem key={event.id} value={event.id}>\n {event.name}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n ) : null}\n </div>\n <div className=\"mt-4\">\n <EventBarChart\n data={throughputSeries}\n emptyLabel={\n throughputEventId ? 'No check-ins recorded yet for this event' : 'Select an event to see throughput'\n }\n />\n </div>\n </GlassCard>\n </div>\n\n {/* Saved snapshots rail */}\n <aside className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-base font-semibold text-text-primary\">\n Saved snapshots {total > 0 ? <span className=\"text-text-muted\">({total})</span> : null}\n </h2>\n <BarChart3 className=\"h-4 w-4 text-text-muted\" />\n </div>\n\n {loading && snapshots.length === 0 ? (\n <div className=\"space-y-3\">\n {Array.from({ length: 3 }).map((_, index) => (\n <Skeleton key={index} className=\"h-24 rounded-card\" />\n ))}\n </div>\n ) : snapshots.length === 0 ? (\n <GlassCard treatment=\"plain\" className=\"border-border-seam\">\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title=\"No snapshots yet\"\n description=\"Generate your first snapshot to freeze the current metrics.\"\n className=\"py-8\"\n />\n </GlassCard>\n ) : (\n <div className=\"space-y-3\">\n {snapshots.map((snapshot) => {\n const generatedAt =\n formatGeneratedAt(snapshot.metrics?.generatedAt) ?? formatGeneratedAt(snapshot.createdAt);\n const captured = METRIC_FIELDS.map((field) => {\n const raw = snapshot.metrics?.[field.key];\n return { label: field.label, value: typeof raw === 'number' ? raw : null };\n }).filter((entry) => entry.value !== null);\n return (\n <GlassCard key={snapshot.id} treatment=\"plain\" className=\"border-border-seam p-4\">\n <div className=\"flex items-start justify-between gap-2\">\n <div className=\"min-w-0\">\n <h3 className=\"truncate text-sm font-semibold text-text-primary\">\n {snapshot.title ?? snapshot.name ?? `Snapshot ${snapshot.id}`}\n </h3>\n {generatedAt ? <p className=\"mt-0.5 text-xs text-text-muted\">{generatedAt}</p> : null}\n </div>\n {snapshot.status ? (\n <Badge variant={statusVariant(snapshot.status)} className=\"shrink-0 uppercase\">\n {snapshot.status}\n </Badge>\n ) : null}\n </div>\n {captured.length > 0 ? (\n <dl className=\"mt-3 space-y-1.5\">\n {captured.map((entry) => (\n <div key={entry.label} className=\"flex items-center justify-between text-xs\">\n <dt className=\"text-text-secondary\">{entry.label}</dt>\n <dd className=\"font-semibold tabular-nums text-text-primary\">\n {(entry.value ?? 0).toLocaleString()}\n </dd>\n </div>\n ))}\n </dl>\n ) : (\n <p className=\"mt-3 text-xs text-text-muted\">No metrics captured.</p>\n )}\n </GlassCard>\n );\n })}\n\n <Pagination\n offset={pagination.offset}\n limit={pagination.limit}\n loadedCount={snapshots.length}\n total={total}\n onPrev={pagination.prevPage}\n onNext={pagination.nextPage}\n itemLabel=\"snapshots\"\n loading={loading}\n />\n </div>\n )}\n </aside>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAoDA,IAAMA,IAAyC,CAAG;;;;;;;;;;;;;;GAwC5CC,IAAiE;CACrE;EAAE,KAAK;EAAe,OAAO;CAAS;CACtC;EAAE,KAAK;EAAgB,OAAO;CAAS;CACvC;EAAE,KAAK;EAAsB,OAAO;CAAgB;CACpD;EAAE,KAAK;EAAkB,OAAO;CAAY;CAC5C;EAAE,KAAK;EAAe,OAAO;CAAS;CACtC;EAAE,KAAK;EAAiB,OAAO;CAAW;CAC1C;EAAE,KAAK;EAAoB,OAAO;CAAoB;AACxD;AAEA,SAASC,EAAc,GAA8D;CACnF,IAAMC,IA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