@burdenoff/microfe-govcitizenhub 2026.720.6 → 2026.730.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/govcitizenhub/GovCitizenHubRoot.d.ts.map +1 -1
- package/dist/govcitizenhub/GovCitizenHubRoot.js +44 -36
- package/dist/govcitizenhub/GovCitizenHubRoot.js.map +1 -1
- package/dist/govcitizenhub/GovCitizenHubRoutes.d.ts.map +1 -1
- package/dist/govcitizenhub/GovCitizenHubRoutes.js +134 -6
- package/dist/govcitizenhub/GovCitizenHubRoutes.js.map +1 -1
- package/dist/govcitizenhub/components/DocumentUploadField.d.ts +17 -11
- package/dist/govcitizenhub/components/DocumentUploadField.d.ts.map +1 -1
- package/dist/govcitizenhub/components/DocumentUploadField.js +45 -42
- package/dist/govcitizenhub/components/DocumentUploadField.js.map +1 -1
- package/dist/govcitizenhub/components/GovCharts.js +127 -51
- package/dist/govcitizenhub/components/GovCharts.js.map +1 -1
- package/dist/govcitizenhub/hooks/index.d.ts +2 -0
- package/dist/govcitizenhub/hooks/index.d.ts.map +1 -1
- package/dist/govcitizenhub/hooks/index.js +2 -0
- package/dist/govcitizenhub/hooks/useGovApi.d.ts +23 -0
- package/dist/govcitizenhub/hooks/useGovApi.d.ts.map +1 -1
- package/dist/govcitizenhub/hooks/useGovApi.js +18 -7
- package/dist/govcitizenhub/hooks/useGovApi.js.map +1 -1
- package/dist/govcitizenhub/hooks/useGovCitizenHubAnalytics.d.ts +24 -0
- package/dist/govcitizenhub/hooks/useGovCitizenHubAnalytics.d.ts.map +1 -0
- package/dist/govcitizenhub/hooks/useGovCitizenHubAnalytics.js +40 -0
- package/dist/govcitizenhub/hooks/useGovCitizenHubAnalytics.js.map +1 -0
- package/dist/govcitizenhub/hooks/useIntelligenceApi.d.ts +214 -0
- package/dist/govcitizenhub/hooks/useIntelligenceApi.d.ts.map +1 -0
- package/dist/govcitizenhub/hooks/useIntelligenceApi.js +1140 -0
- package/dist/govcitizenhub/hooks/useIntelligenceApi.js.map +1 -0
- package/dist/govcitizenhub/index.d.ts +1 -0
- package/dist/govcitizenhub/index.d.ts.map +1 -1
- package/dist/govcitizenhub/index.js +18 -0
- package/dist/govcitizenhub/pages/agencies/AgenciesPage.js +7 -7
- package/dist/govcitizenhub/pages/agencies/AgencyFormDialog.js +6 -6
- package/dist/govcitizenhub/pages/applications/ApplicationDetailPage.d.ts.map +1 -1
- package/dist/govcitizenhub/pages/applications/ApplicationDetailPage.js +178 -172
- package/dist/govcitizenhub/pages/applications/ApplicationDetailPage.js.map +1 -1
- package/dist/govcitizenhub/pages/applications/ApplicationsPage.js +35 -35
- package/dist/govcitizenhub/pages/applications/ApplicationsPage.js.map +1 -1
- package/dist/govcitizenhub/pages/applications/NewApplicationPage.d.ts.map +1 -1
- package/dist/govcitizenhub/pages/applications/NewApplicationPage.js +151 -147
- package/dist/govcitizenhub/pages/applications/NewApplicationPage.js.map +1 -1
- package/dist/govcitizenhub/pages/documents/DocumentsPage.js +5 -5
- package/dist/govcitizenhub/pages/grievances/GrievanceDetailPage.js +30 -30
- package/dist/govcitizenhub/pages/grievances/GrievanceDetailPage.js.map +1 -1
- package/dist/govcitizenhub/pages/grievances/GrievancesPage.d.ts.map +1 -1
- package/dist/govcitizenhub/pages/grievances/GrievancesPage.js +176 -172
- package/dist/govcitizenhub/pages/grievances/GrievancesPage.js.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/AdminLevelsPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/AdminLevelsPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/AdminLevelsPage.js +634 -0
- package/dist/govcitizenhub/pages/intelligence/AdminLevelsPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/AssetFormDialog.d.ts +20 -0
- package/dist/govcitizenhub/pages/intelligence/AssetFormDialog.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/AssetFormDialog.js +537 -0
- package/dist/govcitizenhub/pages/intelligence/AssetFormDialog.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/AssetImage.d.ts +11 -0
- package/dist/govcitizenhub/pages/intelligence/AssetImage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/AssetImage.js +25 -0
- package/dist/govcitizenhub/pages/intelligence/AssetImage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/AssetMapPanel.d.ts +15 -0
- package/dist/govcitizenhub/pages/intelligence/AssetMapPanel.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/AssetMapPanel.js +203 -0
- package/dist/govcitizenhub/pages/intelligence/AssetMapPanel.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/BenchmarkPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/BenchmarkPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/BenchmarkPage.js +497 -0
- package/dist/govcitizenhub/pages/intelligence/BenchmarkPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/BudgetPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/BudgetPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/BudgetPage.js +1084 -0
- package/dist/govcitizenhub/pages/intelligence/BudgetPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationFormDialog.d.ts +13 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationFormDialog.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationFormDialog.js +581 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationFormDialog.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationParticipateDialog.d.ts +11 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationParticipateDialog.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationParticipateDialog.js +429 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationParticipateDialog.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationResultsPanel.d.ts +8 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationResultsPanel.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationResultsPanel.js +235 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationResultsPanel.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationsPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationsPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationsPage.js +534 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationsPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/CorrectionsPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/CorrectionsPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/CorrectionsPage.js +723 -0
- package/dist/govcitizenhub/pages/intelligence/CorrectionsPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ElectionsPage.d.ts +5 -0
- package/dist/govcitizenhub/pages/intelligence/ElectionsPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ElectionsPage.js +1029 -0
- package/dist/govcitizenhub/pages/intelligence/ElectionsPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/GovernancePage.d.ts +5 -0
- package/dist/govcitizenhub/pages/intelligence/GovernancePage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/GovernancePage.js +1545 -0
- package/dist/govcitizenhub/pages/intelligence/GovernancePage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/IndicatorCatalogPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/IndicatorCatalogPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/IndicatorCatalogPage.js +960 -0
- package/dist/govcitizenhub/pages/intelligence/IndicatorCatalogPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/IndicatorsPage.d.ts +13 -0
- package/dist/govcitizenhub/pages/intelligence/IndicatorsPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/IndicatorsPage.js +927 -0
- package/dist/govcitizenhub/pages/intelligence/IndicatorsPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionDirectoryPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionDirectoryPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionDirectoryPage.js +620 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionDirectoryPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionLayout.d.ts +20 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionLayout.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionLayout.js +183 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionLayout.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionProfilePage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionProfilePage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionProfilePage.js +629 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionProfilePage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/OpenDataPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/OpenDataPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/OpenDataPage.js +1124 -0
- package/dist/govcitizenhub/pages/intelligence/OpenDataPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ProjectsPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/ProjectsPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ProjectsPage.js +1518 -0
- package/dist/govcitizenhub/pages/intelligence/ProjectsPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/PublicAssetsPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/PublicAssetsPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/PublicAssetsPage.js +577 -0
- package/dist/govcitizenhub/pages/intelligence/PublicAssetsPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ServicePerformancePage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/ServicePerformancePage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ServicePerformancePage.js +534 -0
- package/dist/govcitizenhub/pages/intelligence/ServicePerformancePage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/TimelinePage.d.ts +5 -0
- package/dist/govcitizenhub/pages/intelligence/TimelinePage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/TimelinePage.js +538 -0
- package/dist/govcitizenhub/pages/intelligence/TimelinePage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/consultationQuestions.d.ts +53 -0
- package/dist/govcitizenhub/pages/intelligence/consultationQuestions.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/consultationQuestions.js +138 -0
- package/dist/govcitizenhub/pages/intelligence/consultationQuestions.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/index.d.ts +27 -0
- package/dist/govcitizenhub/pages/intelligence/index.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/index.js +17 -0
- package/dist/govcitizenhub/pages/payments/PaymentsPage.d.ts.map +1 -1
- package/dist/govcitizenhub/pages/payments/PaymentsPage.js +53 -49
- package/dist/govcitizenhub/pages/payments/PaymentsPage.js.map +1 -1
- package/dist/govcitizenhub/pages/permits/IssuePermitDialog.d.ts.map +1 -1
- package/dist/govcitizenhub/pages/permits/IssuePermitDialog.js +82 -76
- package/dist/govcitizenhub/pages/permits/IssuePermitDialog.js.map +1 -1
- package/dist/govcitizenhub/pages/permits/PermitsPage.d.ts.map +1 -1
- package/dist/govcitizenhub/pages/permits/PermitsPage.js +174 -120
- package/dist/govcitizenhub/pages/permits/PermitsPage.js.map +1 -1
- package/dist/govcitizenhub/pages/services/ServiceDetailPage.js +8 -8
- package/dist/govcitizenhub/pages/services/ServiceFormDialog.js +98 -98
- package/dist/govcitizenhub/pages/services/ServiceFormDialog.js.map +1 -1
- package/dist/govcitizenhub/types/index.d.ts +1 -0
- package/dist/govcitizenhub/types/index.d.ts.map +1 -1
- package/dist/govcitizenhub/types/intelligence.d.ts +1559 -0
- package/dist/govcitizenhub/types/intelligence.d.ts.map +1 -0
- package/dist/govcitizenhub/types/intelligence.js +125 -0
- package/dist/govcitizenhub/types/intelligence.js.map +1 -0
- package/dist/index.js +19 -2
- package/dist/node_modules/recharts/es6/chart/BarChart.js +24 -0
- package/dist/node_modules/recharts/es6/chart/BarChart.js.map +1 -0
- package/dist/utils/pageContext.d.ts +1 -0
- package/dist/utils/pageContext.d.ts.map +1 -1
- package/dist/utils/pageContext.js +44 -17
- package/dist/utils/pageContext.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,534 @@
|
|
|
1
|
+
import { cn as e } from "../../utils/cn.js";
|
|
2
|
+
import { formatCurrency as t, formatDateTime as n, formatEnumLabel as r, formatNumber as i, formatRelativeTime as a } from "../../utils/formatters.js";
|
|
3
|
+
import { StatusBadge as o } from "../../components/StatusBadge.js";
|
|
4
|
+
import { EmptyState as s } from "../../components/EmptyState.js";
|
|
5
|
+
import { useGovCloseConsultation as c, useGovConsultations as l, useGovDeleteConsultation as u, useGovMyConsultationResponse as d, useGovOpenConsultation as f, useGovPublishConsultationResults as p } from "../../hooks/useIntelligenceApi.js";
|
|
6
|
+
import { useCursorPager as m } from "../../hooks/useCursorPager.js";
|
|
7
|
+
import "../../hooks/index.js";
|
|
8
|
+
import { ErrorView as h, LoadingView as g } from "../../components/StateViews.js";
|
|
9
|
+
import { FilterTabs as _ } from "../../components/FilterTabs.js";
|
|
10
|
+
import { SectionCard as v } from "../../components/SectionCard.js";
|
|
11
|
+
import { Pagination as y } from "../../components/Pagination.js";
|
|
12
|
+
import { describeError as b, notify as x } from "../../lib/toast.js";
|
|
13
|
+
import { JurisdictionLayout as ee } from "./JurisdictionLayout.js";
|
|
14
|
+
import { ConfirmDialog as te } from "../../components/ConfirmDialog.js";
|
|
15
|
+
import { QUESTION_TYPE_LABELS as S, describeAnswerValue as C, parseConsultationAnswers as w, parseConsultationQuestions as T, readAllocation as E } from "./consultationQuestions.js";
|
|
16
|
+
import { ConsultationFormDialog as ne } from "./ConsultationFormDialog.js";
|
|
17
|
+
import { ConsultationParticipateDialog as re } from "./ConsultationParticipateDialog.js";
|
|
18
|
+
import { ConsultationResultsPanel as D } from "./ConsultationResultsPanel.js";
|
|
19
|
+
import { useMemo as O, useState as k } from "react";
|
|
20
|
+
import { BarChart3 as A, CalendarClock as j, CheckCircle2 as M, ChevronDown as N, ChevronUp as P, Coins as F, ListFilter as ie, Lock as I, MessageSquareQuote as L, MoreVertical as R, Pencil as z, Plus as B, Send as V, Trash2 as H, Unlock as U, Upload as W, Users as G } from "lucide-react";
|
|
21
|
+
import { useParams as ae } from "react-router-dom";
|
|
22
|
+
import { Fragment as oe, jsx as K, jsxs as q } from "react/jsx-runtime";
|
|
23
|
+
import { Button as J, DropdownMenu as Y, DropdownMenuContent as X, DropdownMenuItem as Z, DropdownMenuSeparator as Q, DropdownMenuTrigger as $, GlassCard as se, Select as ce, SelectContent as le, SelectItem as ue, SelectTrigger as de, SelectValue as fe, Switch as pe } from "@burdenoff/fe-libs/ui";
|
|
24
|
+
//#region src/govcitizenhub/pages/intelligence/ConsultationsPage.tsx
|
|
25
|
+
var me = 10, he = 48, ge = [
|
|
26
|
+
{
|
|
27
|
+
value: "ALL",
|
|
28
|
+
label: "All"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
value: "DRAFT",
|
|
32
|
+
label: "Draft"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
value: "OPEN",
|
|
36
|
+
label: "Open"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
value: "CLOSED",
|
|
40
|
+
label: "Closed"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
value: "PUBLISHED",
|
|
44
|
+
label: "Published"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
value: "CANCELLED",
|
|
48
|
+
label: "Cancelled"
|
|
49
|
+
}
|
|
50
|
+
], _e = [
|
|
51
|
+
"SURVEY",
|
|
52
|
+
"POLL",
|
|
53
|
+
"PARTICIPATORY_BUDGET",
|
|
54
|
+
"PUBLIC_HEARING",
|
|
55
|
+
"FEEDBACK"
|
|
56
|
+
];
|
|
57
|
+
function ve() {
|
|
58
|
+
let { jurisdictionId: e } = ae(), t = m(), [n, i] = k("ALL"), [a, o] = k("ALL"), [d, S] = k(!1), [C, w] = k(!1), [T, E] = k(null), [D, A] = k(null), [j, M] = k(null), [N, P] = k({}), F = (e, t) => {
|
|
59
|
+
P((n) => ({
|
|
60
|
+
...n,
|
|
61
|
+
[e]: n[e] === t ? "none" : t
|
|
62
|
+
}));
|
|
63
|
+
}, I = f(), L = c(), R = p(), z = u(), { data: V, isLoading: H, isError: U, refetch: W } = l(O(() => ({
|
|
64
|
+
jurisdictionId: e,
|
|
65
|
+
consultationType: a === "ALL" ? void 0 : a,
|
|
66
|
+
status: d || n === "ALL" ? void 0 : n,
|
|
67
|
+
openOnly: d ? !0 : void 0
|
|
68
|
+
}), [
|
|
69
|
+
e,
|
|
70
|
+
a,
|
|
71
|
+
n,
|
|
72
|
+
d
|
|
73
|
+
]), {
|
|
74
|
+
limit: me,
|
|
75
|
+
cursor: t.cursor
|
|
76
|
+
}), G = O(() => V?.items ?? [], [V]), Y = n !== "ALL" || a !== "ALL" || d, X = () => {
|
|
77
|
+
i("ALL"), o("ALL"), S(!1), t.reset();
|
|
78
|
+
}, Z = () => {
|
|
79
|
+
E(null), w(!0);
|
|
80
|
+
}, Q = async (e, t, n, r) => {
|
|
81
|
+
try {
|
|
82
|
+
await e(), x.success(t, n);
|
|
83
|
+
} catch (e) {
|
|
84
|
+
x.error(r, b(e));
|
|
85
|
+
}
|
|
86
|
+
}, $ = async () => {
|
|
87
|
+
if (j) try {
|
|
88
|
+
await z.mutateAsync(j.id), x.success("Consultation deleted", `${j.title} was removed.`), M(null);
|
|
89
|
+
} catch (e) {
|
|
90
|
+
x.error("Could not delete the consultation", b(e));
|
|
91
|
+
}
|
|
92
|
+
}, se = I.isPending || L.isPending || R.isPending;
|
|
93
|
+
return /* @__PURE__ */ q(ee, {
|
|
94
|
+
actions: /* @__PURE__ */ q(J, {
|
|
95
|
+
onClick: Z,
|
|
96
|
+
children: [/* @__PURE__ */ K(B, {
|
|
97
|
+
className: "mr-1.5 h-4 w-4",
|
|
98
|
+
"aria-hidden": "true"
|
|
99
|
+
}), " New consultation"]
|
|
100
|
+
}),
|
|
101
|
+
children: [
|
|
102
|
+
/* @__PURE__ */ q("div", {
|
|
103
|
+
className: "flex flex-col gap-6",
|
|
104
|
+
children: [/* @__PURE__ */ K(v, {
|
|
105
|
+
title: "Filter consultations",
|
|
106
|
+
icon: /* @__PURE__ */ K(ie, {}),
|
|
107
|
+
children: /* @__PURE__ */ q("div", {
|
|
108
|
+
className: "flex flex-col gap-4",
|
|
109
|
+
children: [d ? /* @__PURE__ */ K("p", {
|
|
110
|
+
className: "text-sm text-text-muted",
|
|
111
|
+
children: "Showing only consultations that are accepting responses right now, so the status filter does not apply."
|
|
112
|
+
}) : /* @__PURE__ */ K("div", {
|
|
113
|
+
className: "overflow-x-auto pb-1",
|
|
114
|
+
children: /* @__PURE__ */ K(_, {
|
|
115
|
+
options: ge,
|
|
116
|
+
value: n,
|
|
117
|
+
onChange: (e) => {
|
|
118
|
+
i(e), t.reset();
|
|
119
|
+
}
|
|
120
|
+
})
|
|
121
|
+
}), /* @__PURE__ */ q("div", {
|
|
122
|
+
className: "flex flex-wrap items-end gap-4",
|
|
123
|
+
children: [
|
|
124
|
+
/* @__PURE__ */ q("div", {
|
|
125
|
+
className: "grid min-w-[14rem] flex-1 gap-1.5",
|
|
126
|
+
children: [/* @__PURE__ */ K("span", {
|
|
127
|
+
className: "text-xs font-medium text-text-muted",
|
|
128
|
+
children: "Type"
|
|
129
|
+
}), /* @__PURE__ */ q(ce, {
|
|
130
|
+
value: a,
|
|
131
|
+
onValueChange: (e) => {
|
|
132
|
+
o(e), t.reset();
|
|
133
|
+
},
|
|
134
|
+
children: [/* @__PURE__ */ K(de, {
|
|
135
|
+
"aria-label": "Filter by consultation type",
|
|
136
|
+
children: /* @__PURE__ */ K(fe, {})
|
|
137
|
+
}), /* @__PURE__ */ q(le, { children: [/* @__PURE__ */ K(ue, {
|
|
138
|
+
value: "ALL",
|
|
139
|
+
children: "Any type"
|
|
140
|
+
}), _e.map((e) => /* @__PURE__ */ K(ue, {
|
|
141
|
+
value: e,
|
|
142
|
+
children: r(e)
|
|
143
|
+
}, e))] })]
|
|
144
|
+
})]
|
|
145
|
+
}),
|
|
146
|
+
/* @__PURE__ */ q("div", {
|
|
147
|
+
className: "flex items-center gap-2.5 pb-1.5",
|
|
148
|
+
children: [/* @__PURE__ */ K(pe, {
|
|
149
|
+
id: "consultations-open-only",
|
|
150
|
+
checked: d,
|
|
151
|
+
onCheckedChange: (e) => {
|
|
152
|
+
S(e === !0), t.reset();
|
|
153
|
+
}
|
|
154
|
+
}), /* @__PURE__ */ K("label", {
|
|
155
|
+
htmlFor: "consultations-open-only",
|
|
156
|
+
className: "cursor-pointer text-sm text-text-secondary",
|
|
157
|
+
children: "Accepting responses right now"
|
|
158
|
+
})]
|
|
159
|
+
}),
|
|
160
|
+
Y && /* @__PURE__ */ K(J, {
|
|
161
|
+
variant: "ghost",
|
|
162
|
+
size: "sm",
|
|
163
|
+
className: "pb-1.5",
|
|
164
|
+
onClick: X,
|
|
165
|
+
children: "Clear filters"
|
|
166
|
+
})
|
|
167
|
+
]
|
|
168
|
+
})]
|
|
169
|
+
})
|
|
170
|
+
}), H ? /* @__PURE__ */ K(g, { label: "Loading consultations…" }) : U ? /* @__PURE__ */ K(h, {
|
|
171
|
+
message: "We couldn't load consultations for this jurisdiction.",
|
|
172
|
+
onRetry: () => {
|
|
173
|
+
W();
|
|
174
|
+
}
|
|
175
|
+
}) : G.length === 0 ? /* @__PURE__ */ K(s, {
|
|
176
|
+
illustration: "empty-data",
|
|
177
|
+
title: Y ? "No consultations match these filters" : "No consultations published yet",
|
|
178
|
+
description: Y ? "Nothing matches the current filters. Try widening them." : "Run a survey, a poll, a public hearing or a participatory budget so residents can shape decisions here.",
|
|
179
|
+
action: Y ? /* @__PURE__ */ K(J, {
|
|
180
|
+
variant: "outline",
|
|
181
|
+
onClick: X,
|
|
182
|
+
children: "Clear filters"
|
|
183
|
+
}) : /* @__PURE__ */ q(J, {
|
|
184
|
+
onClick: Z,
|
|
185
|
+
children: [/* @__PURE__ */ K(B, {
|
|
186
|
+
className: "mr-1.5 h-4 w-4",
|
|
187
|
+
"aria-hidden": "true"
|
|
188
|
+
}), " New consultation"]
|
|
189
|
+
})
|
|
190
|
+
}) : /* @__PURE__ */ q(oe, { children: [/* @__PURE__ */ K("div", {
|
|
191
|
+
className: "flex flex-col gap-4",
|
|
192
|
+
children: G.map((e) => /* @__PURE__ */ K(ye, {
|
|
193
|
+
consultation: e,
|
|
194
|
+
lifecycleBusy: se,
|
|
195
|
+
expanded: N[e.id] ?? "none",
|
|
196
|
+
onTogglePanel: (t) => F(e.id, t),
|
|
197
|
+
onParticipate: () => A(e),
|
|
198
|
+
onEdit: () => {
|
|
199
|
+
E(e), w(!0);
|
|
200
|
+
},
|
|
201
|
+
onDelete: () => M(e),
|
|
202
|
+
onOpen: () => void Q(() => I.mutateAsync(e.id), "Consultation opened", `${e.title} is now accepting responses.`, "Could not open the consultation"),
|
|
203
|
+
onClose: () => void Q(() => L.mutateAsync(e.id), "Consultation closed", `${e.title} no longer accepts responses.`, "Could not close the consultation"),
|
|
204
|
+
onPublishResults: () => void Q(() => R.mutateAsync(e.id), "Results published", `The aggregate for ${e.title} is now public.`, "Could not publish the results")
|
|
205
|
+
}, e.id))
|
|
206
|
+
}), /* @__PURE__ */ K(y, {
|
|
207
|
+
page: t.page,
|
|
208
|
+
pageSize: me,
|
|
209
|
+
itemCount: G.length,
|
|
210
|
+
hasMore: V?.pageInfo.hasMore ?? !1,
|
|
211
|
+
onPageChange: (e) => t.onPageChange(e, V?.pageInfo.cursor)
|
|
212
|
+
})] })]
|
|
213
|
+
}),
|
|
214
|
+
C && e && /* @__PURE__ */ K(ne, {
|
|
215
|
+
jurisdictionId: e,
|
|
216
|
+
consultation: T,
|
|
217
|
+
onClose: () => {
|
|
218
|
+
w(!1), E(null);
|
|
219
|
+
}
|
|
220
|
+
}),
|
|
221
|
+
D && /* @__PURE__ */ K(re, {
|
|
222
|
+
consultation: D,
|
|
223
|
+
onSubmitted: () => P((e) => ({
|
|
224
|
+
...e,
|
|
225
|
+
[D.id]: "response"
|
|
226
|
+
})),
|
|
227
|
+
onClose: () => A(null)
|
|
228
|
+
}),
|
|
229
|
+
/* @__PURE__ */ K(te, {
|
|
230
|
+
open: j !== null,
|
|
231
|
+
onOpenChange: (e) => {
|
|
232
|
+
e || M(null);
|
|
233
|
+
},
|
|
234
|
+
title: "Delete this consultation?",
|
|
235
|
+
description: j ? `${j.title} and the responses recorded against it will no longer be readable.` : void 0,
|
|
236
|
+
confirmLabel: "Delete consultation",
|
|
237
|
+
destructive: !0,
|
|
238
|
+
onConfirm: $
|
|
239
|
+
})
|
|
240
|
+
]
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
function ye({ consultation: s, lifecycleBusy: c, expanded: l, onTogglePanel: u, onParticipate: d, onEdit: f, onDelete: p, onOpen: m, onClose: h, onPublishResults: g }) {
|
|
244
|
+
let _ = O(() => T(s.questions).length, [s.questions]), [v] = k(() => Date.now()), y = O(() => {
|
|
245
|
+
if (!s.closesAt || !s.isAcceptingResponses) return null;
|
|
246
|
+
let e = new Date(s.closesAt).getTime();
|
|
247
|
+
if (Number.isNaN(e)) return null;
|
|
248
|
+
let t = e - v;
|
|
249
|
+
return t <= 0 ? null : {
|
|
250
|
+
label: `Closes ${a(s.closesAt)}`,
|
|
251
|
+
urgent: t <= he * 36e5
|
|
252
|
+
};
|
|
253
|
+
}, [
|
|
254
|
+
s.closesAt,
|
|
255
|
+
s.isAcceptingResponses,
|
|
256
|
+
v
|
|
257
|
+
]), b = s.isAcceptingResponses && !s.hasRespondedByMe;
|
|
258
|
+
return /* @__PURE__ */ q(se, {
|
|
259
|
+
treatment: "plain",
|
|
260
|
+
className: "border-border-seam p-5",
|
|
261
|
+
children: [
|
|
262
|
+
/* @__PURE__ */ q("div", {
|
|
263
|
+
className: "flex flex-wrap items-start gap-3",
|
|
264
|
+
children: [/* @__PURE__ */ q("div", {
|
|
265
|
+
className: "min-w-0 flex-1",
|
|
266
|
+
children: [/* @__PURE__ */ K("h3", {
|
|
267
|
+
className: "text-base font-semibold text-text-primary",
|
|
268
|
+
children: s.title
|
|
269
|
+
}), s.description && /* @__PURE__ */ K("p", {
|
|
270
|
+
className: "mt-1 line-clamp-3 text-sm text-text-secondary",
|
|
271
|
+
children: s.description
|
|
272
|
+
})]
|
|
273
|
+
}), /* @__PURE__ */ q("div", {
|
|
274
|
+
className: "flex shrink-0 items-center gap-2",
|
|
275
|
+
children: [/* @__PURE__ */ K(o, { status: s.status }), /* @__PURE__ */ q(Y, { children: [/* @__PURE__ */ K($, {
|
|
276
|
+
asChild: !0,
|
|
277
|
+
children: /* @__PURE__ */ K(J, {
|
|
278
|
+
variant: "ghost",
|
|
279
|
+
size: "sm",
|
|
280
|
+
"aria-label": `Actions for ${s.title}`,
|
|
281
|
+
children: /* @__PURE__ */ K(R, {
|
|
282
|
+
className: "size-4",
|
|
283
|
+
"aria-hidden": "true"
|
|
284
|
+
})
|
|
285
|
+
})
|
|
286
|
+
}), /* @__PURE__ */ q(X, {
|
|
287
|
+
align: "end",
|
|
288
|
+
children: [
|
|
289
|
+
/* @__PURE__ */ q(Z, {
|
|
290
|
+
onSelect: f,
|
|
291
|
+
children: [/* @__PURE__ */ K(z, {
|
|
292
|
+
className: "mr-2 size-4",
|
|
293
|
+
"aria-hidden": "true"
|
|
294
|
+
}), " Edit consultation"]
|
|
295
|
+
}),
|
|
296
|
+
s.status === "DRAFT" && /* @__PURE__ */ q(Z, {
|
|
297
|
+
disabled: c,
|
|
298
|
+
onSelect: m,
|
|
299
|
+
children: [/* @__PURE__ */ K(U, {
|
|
300
|
+
className: "mr-2 size-4",
|
|
301
|
+
"aria-hidden": "true"
|
|
302
|
+
}), " Open for responses"]
|
|
303
|
+
}),
|
|
304
|
+
s.status === "OPEN" && /* @__PURE__ */ q(Z, {
|
|
305
|
+
disabled: c,
|
|
306
|
+
onSelect: h,
|
|
307
|
+
children: [/* @__PURE__ */ K(I, {
|
|
308
|
+
className: "mr-2 size-4",
|
|
309
|
+
"aria-hidden": "true"
|
|
310
|
+
}), " Close consultation"]
|
|
311
|
+
}),
|
|
312
|
+
s.status === "CLOSED" && /* @__PURE__ */ q(Z, {
|
|
313
|
+
disabled: c,
|
|
314
|
+
onSelect: g,
|
|
315
|
+
children: [/* @__PURE__ */ K(W, {
|
|
316
|
+
className: "mr-2 size-4",
|
|
317
|
+
"aria-hidden": "true"
|
|
318
|
+
}), " Publish results"]
|
|
319
|
+
}),
|
|
320
|
+
/* @__PURE__ */ K(Q, {}),
|
|
321
|
+
/* @__PURE__ */ q(Z, {
|
|
322
|
+
onSelect: p,
|
|
323
|
+
children: [/* @__PURE__ */ K(H, {
|
|
324
|
+
className: "mr-2 size-4",
|
|
325
|
+
"aria-hidden": "true"
|
|
326
|
+
}), " Delete consultation"]
|
|
327
|
+
})
|
|
328
|
+
]
|
|
329
|
+
})] })]
|
|
330
|
+
})]
|
|
331
|
+
}),
|
|
332
|
+
/* @__PURE__ */ q("div", {
|
|
333
|
+
className: "mt-3 flex flex-wrap items-center gap-2",
|
|
334
|
+
children: [
|
|
335
|
+
/* @__PURE__ */ K("span", {
|
|
336
|
+
className: "rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary",
|
|
337
|
+
children: r(s.consultationType)
|
|
338
|
+
}),
|
|
339
|
+
/* @__PURE__ */ q("span", {
|
|
340
|
+
className: "rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary",
|
|
341
|
+
children: [
|
|
342
|
+
i(_),
|
|
343
|
+
" question",
|
|
344
|
+
_ === 1 ? "" : "s"
|
|
345
|
+
]
|
|
346
|
+
}),
|
|
347
|
+
s.allowAnonymous && /* @__PURE__ */ K("span", {
|
|
348
|
+
className: "rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary",
|
|
349
|
+
children: "Anonymous allowed"
|
|
350
|
+
}),
|
|
351
|
+
s.budgetAmount != null && /* @__PURE__ */ q("span", {
|
|
352
|
+
className: "inline-flex items-center gap-1.5 rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary",
|
|
353
|
+
children: [
|
|
354
|
+
/* @__PURE__ */ K(F, {
|
|
355
|
+
className: "size-3.5",
|
|
356
|
+
"aria-hidden": "true"
|
|
357
|
+
}),
|
|
358
|
+
t(s.budgetAmount, s.currencyCode),
|
|
359
|
+
" pot"
|
|
360
|
+
]
|
|
361
|
+
}),
|
|
362
|
+
s.tags.map((e) => /* @__PURE__ */ K("span", {
|
|
363
|
+
className: "rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-text-secondary",
|
|
364
|
+
children: e
|
|
365
|
+
}, e))
|
|
366
|
+
]
|
|
367
|
+
}),
|
|
368
|
+
/* @__PURE__ */ q("dl", {
|
|
369
|
+
className: "mt-4 grid gap-3 sm:grid-cols-3",
|
|
370
|
+
children: [
|
|
371
|
+
/* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K("dt", {
|
|
372
|
+
className: "text-xs text-text-muted",
|
|
373
|
+
children: "Opens"
|
|
374
|
+
}), /* @__PURE__ */ K("dd", {
|
|
375
|
+
className: "text-sm text-text-secondary",
|
|
376
|
+
children: s.opensAt ? n(s.opensAt) : "Not scheduled"
|
|
377
|
+
})] }),
|
|
378
|
+
/* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K("dt", {
|
|
379
|
+
className: "text-xs text-text-muted",
|
|
380
|
+
children: "Closes"
|
|
381
|
+
}), /* @__PURE__ */ K("dd", {
|
|
382
|
+
className: "text-sm text-text-secondary",
|
|
383
|
+
children: s.closesAt ? n(s.closesAt) : "No closing date"
|
|
384
|
+
})] }),
|
|
385
|
+
/* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K("dt", {
|
|
386
|
+
className: "text-xs text-text-muted",
|
|
387
|
+
children: "Responses"
|
|
388
|
+
}), /* @__PURE__ */ q("dd", {
|
|
389
|
+
className: "inline-flex items-center gap-1.5 text-sm text-text-secondary tabular-nums",
|
|
390
|
+
children: [/* @__PURE__ */ K(G, {
|
|
391
|
+
className: "size-4 text-text-muted",
|
|
392
|
+
"aria-hidden": "true"
|
|
393
|
+
}), i(s.responseCount)]
|
|
394
|
+
})] })
|
|
395
|
+
]
|
|
396
|
+
}),
|
|
397
|
+
y && /* @__PURE__ */ q("p", {
|
|
398
|
+
className: e("mt-3 inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-medium", y.urgent ? "bg-status-warning-bg-subtle text-status-warning-text" : "bg-status-success-bg-subtle text-status-success-text"),
|
|
399
|
+
children: [
|
|
400
|
+
/* @__PURE__ */ K(j, {
|
|
401
|
+
className: "size-3.5",
|
|
402
|
+
"aria-hidden": "true"
|
|
403
|
+
}),
|
|
404
|
+
" ",
|
|
405
|
+
y.label
|
|
406
|
+
]
|
|
407
|
+
}),
|
|
408
|
+
/* @__PURE__ */ q("div", {
|
|
409
|
+
className: "mt-4 flex flex-wrap items-center gap-2 border-t border-border-seam pt-4",
|
|
410
|
+
children: [
|
|
411
|
+
b ? /* @__PURE__ */ q(J, {
|
|
412
|
+
onClick: d,
|
|
413
|
+
children: [/* @__PURE__ */ K(V, {
|
|
414
|
+
className: "mr-1.5 h-4 w-4",
|
|
415
|
+
"aria-hidden": "true"
|
|
416
|
+
}), " Participate"]
|
|
417
|
+
}) : s.hasRespondedByMe ? /* @__PURE__ */ q("span", {
|
|
418
|
+
className: "inline-flex items-center gap-1.5 rounded-full bg-status-success-bg-subtle px-3 py-1 text-sm font-medium text-status-success-text",
|
|
419
|
+
children: [/* @__PURE__ */ K(M, {
|
|
420
|
+
className: "size-4",
|
|
421
|
+
"aria-hidden": "true"
|
|
422
|
+
}), " You have responded"]
|
|
423
|
+
}) : /* @__PURE__ */ K("span", {
|
|
424
|
+
className: "text-sm text-text-muted",
|
|
425
|
+
children: s.status === "DRAFT" ? "Not open for responses yet." : "This consultation is not accepting responses."
|
|
426
|
+
}),
|
|
427
|
+
s.hasRespondedByMe && /* @__PURE__ */ q(J, {
|
|
428
|
+
variant: "outline",
|
|
429
|
+
onClick: () => u("response"),
|
|
430
|
+
children: [
|
|
431
|
+
/* @__PURE__ */ K(L, {
|
|
432
|
+
className: "mr-1.5 h-4 w-4",
|
|
433
|
+
"aria-hidden": "true"
|
|
434
|
+
}),
|
|
435
|
+
"Your response",
|
|
436
|
+
K(l === "response" ? P : N, {
|
|
437
|
+
className: "ml-1.5 h-4 w-4",
|
|
438
|
+
"aria-hidden": "true"
|
|
439
|
+
})
|
|
440
|
+
]
|
|
441
|
+
}),
|
|
442
|
+
/* @__PURE__ */ q(J, {
|
|
443
|
+
variant: "outline",
|
|
444
|
+
onClick: () => u("results"),
|
|
445
|
+
children: [
|
|
446
|
+
/* @__PURE__ */ K(A, {
|
|
447
|
+
className: "mr-1.5 h-4 w-4",
|
|
448
|
+
"aria-hidden": "true"
|
|
449
|
+
}),
|
|
450
|
+
"Results",
|
|
451
|
+
K(l === "results" ? P : N, {
|
|
452
|
+
className: "ml-1.5 h-4 w-4",
|
|
453
|
+
"aria-hidden": "true"
|
|
454
|
+
})
|
|
455
|
+
]
|
|
456
|
+
})
|
|
457
|
+
]
|
|
458
|
+
}),
|
|
459
|
+
l === "response" && /* @__PURE__ */ K("div", {
|
|
460
|
+
className: "mt-4 border-t border-border-seam pt-4",
|
|
461
|
+
children: /* @__PURE__ */ K(be, { consultation: s })
|
|
462
|
+
}),
|
|
463
|
+
l === "results" && /* @__PURE__ */ K("div", {
|
|
464
|
+
className: "mt-4 border-t border-border-seam pt-4",
|
|
465
|
+
children: /* @__PURE__ */ K(D, { consultation: s })
|
|
466
|
+
})
|
|
467
|
+
]
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
function be({ consultation: e }) {
|
|
471
|
+
let { data: i, isLoading: a, isError: o, refetch: c } = d(e.id), l = O(() => T(e.questions), [e.questions]), u = O(() => w(i?.answers ?? null), [i]), f = O(() => new Map(u.map((e) => [e.questionId, e.value])), [u]);
|
|
472
|
+
if (a) return /* @__PURE__ */ K(g, {
|
|
473
|
+
label: "Loading your response…",
|
|
474
|
+
className: "min-h-[8rem]"
|
|
475
|
+
});
|
|
476
|
+
if (o) return /* @__PURE__ */ K(h, {
|
|
477
|
+
className: "min-h-[8rem]",
|
|
478
|
+
message: "We couldn't load your response.",
|
|
479
|
+
onRetry: () => {
|
|
480
|
+
c();
|
|
481
|
+
}
|
|
482
|
+
});
|
|
483
|
+
if (!i) return /* @__PURE__ */ K(s, {
|
|
484
|
+
icon: /* @__PURE__ */ K(L, {
|
|
485
|
+
className: "size-8",
|
|
486
|
+
"aria-hidden": "true"
|
|
487
|
+
}),
|
|
488
|
+
title: "No response linked to your account",
|
|
489
|
+
description: "Anonymous submissions store no respondent id, so they cannot be shown back to you."
|
|
490
|
+
});
|
|
491
|
+
let p = l.filter((e) => f.has(e.id));
|
|
492
|
+
return /* @__PURE__ */ q("div", {
|
|
493
|
+
className: "flex flex-col gap-3",
|
|
494
|
+
children: [/* @__PURE__ */ q("p", {
|
|
495
|
+
className: "text-sm text-text-muted",
|
|
496
|
+
children: [
|
|
497
|
+
"Submitted ",
|
|
498
|
+
n(i.submittedAt),
|
|
499
|
+
i.sentiment ? ` · overall sentiment: ${r(i.sentiment)}` : ""
|
|
500
|
+
]
|
|
501
|
+
}), p.length === 0 ? /* @__PURE__ */ K("p", {
|
|
502
|
+
className: "text-sm text-text-muted",
|
|
503
|
+
children: "Your response recorded no answers against the current questions."
|
|
504
|
+
}) : /* @__PURE__ */ K("dl", {
|
|
505
|
+
className: "flex flex-col gap-3",
|
|
506
|
+
children: p.map((n) => {
|
|
507
|
+
let r = f.get(n.id);
|
|
508
|
+
return /* @__PURE__ */ q("div", {
|
|
509
|
+
className: "rounded-lg border border-border-seam bg-bg-sunken/40 p-3",
|
|
510
|
+
children: [/* @__PURE__ */ q("dt", {
|
|
511
|
+
className: "text-sm font-medium text-text-primary",
|
|
512
|
+
children: [n.label, /* @__PURE__ */ K("span", {
|
|
513
|
+
className: "ml-2 text-xs font-normal text-text-muted",
|
|
514
|
+
children: S[n.type]
|
|
515
|
+
})]
|
|
516
|
+
}), /* @__PURE__ */ K("dd", {
|
|
517
|
+
className: "mt-1 text-sm text-text-secondary",
|
|
518
|
+
children: n.type === "BUDGET_ALLOCATION" ? /* @__PURE__ */ K("ul", {
|
|
519
|
+
className: "flex flex-col gap-0.5",
|
|
520
|
+
children: Object.entries(E(r)).map(([n, r]) => /* @__PURE__ */ q("li", {
|
|
521
|
+
className: "flex justify-between gap-4 tabular-nums",
|
|
522
|
+
children: [/* @__PURE__ */ K("span", { children: n }), /* @__PURE__ */ K("span", { children: t(r, e.currencyCode) })]
|
|
523
|
+
}, n))
|
|
524
|
+
}) : C(n, r).join(", ") || "—"
|
|
525
|
+
})]
|
|
526
|
+
}, n.id);
|
|
527
|
+
})
|
|
528
|
+
})]
|
|
529
|
+
});
|
|
530
|
+
}
|
|
531
|
+
//#endregion
|
|
532
|
+
export { ve as ConsultationsPage };
|
|
533
|
+
|
|
534
|
+
//# sourceMappingURL=ConsultationsPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConsultationsPage.js","names":[],"sources":["../../../../src/govcitizenhub/pages/intelligence/ConsultationsPage.tsx"],"sourcesContent":["/**\n * ConsultationsPage — public participation for one jurisdiction.\n * @module govcitizenhub/pages/intelligence\n *\n * Route: `/govcitizenhub/intelligence/:jurisdictionId/consultations`.\n *\n * Reads `govConsultations` (type / status / open-now filters, cursor\n * paginated). Every card carries only server-supplied facts: the dates the\n * author published, the service-computed `isAcceptingResponses` and\n * `hasRespondedByMe`, and the transactional `responseCount` — never a tally\n * derived from the loaded page, and never a placeholder figure.\n *\n * Participation runs through `ConsultationParticipateDialog`, which renders the\n * consultation's own `questions` schema. After submitting, the respondent's own\n * answers are shown from `govMyConsultationResponse` (self-scoped — an anonymous\n * submission is deliberately not retrievable, and the panel says so).\n *\n * Results come from `govConsultationResults` via `ConsultationResultsPanel`,\n * which treats suppression as a state to explain rather than an empty chart.\n *\n * Cache: the shared mutation hooks invalidate the consultation list, the\n * consultation, its results and the caller's own response, and `govQuery` clears\n * the 15s response cache around every write.\n */\n\nimport { useMemo, useState, type ReactElement } from 'react';\nimport { useParams } from 'react-router-dom';\nimport {\n BarChart3,\n CalendarClock,\n CheckCircle2,\n ChevronDown,\n ChevronUp,\n Coins,\n ListFilter,\n Lock,\n MessageSquareQuote,\n MoreVertical,\n Pencil,\n Plus,\n Send,\n Trash2,\n Unlock,\n Upload,\n Users,\n} from 'lucide-react';\nimport {\n Button,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n GlassCard,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n Switch,\n} from '@burdenoff/fe-libs/ui';\n\nimport { SectionCard } from '../../components/SectionCard';\nimport { EmptyState } from '../../components/EmptyState';\nimport { ErrorView, LoadingView } from '../../components/StateViews';\nimport { FilterTabs, type FilterOption } from '../../components/FilterTabs';\nimport { Pagination } from '../../components/Pagination';\nimport { StatusBadge } from '../../components/StatusBadge';\nimport { ConfirmDialog } from '../../components/ConfirmDialog';\nimport { JurisdictionLayout } from './JurisdictionLayout';\nimport { ConsultationFormDialog } from './ConsultationFormDialog';\nimport { ConsultationParticipateDialog } from './ConsultationParticipateDialog';\nimport { ConsultationResultsPanel } from './ConsultationResultsPanel';\nimport {\n describeAnswerValue,\n parseConsultationAnswers,\n parseConsultationQuestions,\n readAllocation,\n QUESTION_TYPE_LABELS,\n} from './consultationQuestions';\nimport {\n useCursorPager,\n useGovCloseConsultation,\n useGovConsultations,\n useGovDeleteConsultation,\n useGovMyConsultationResponse,\n useGovOpenConsultation,\n useGovPublishConsultationResults,\n} from '../../hooks';\nimport { describeError, notify } from '../../lib/toast';\nimport {\n formatCurrency,\n formatDateTime,\n formatEnumLabel,\n formatNumber,\n formatRelativeTime,\n} from '../../utils/formatters';\nimport { cn } from '../../utils/cn';\nimport type {\n GovConsultation,\n GovConsultationFilterInput,\n GovConsultationStatus,\n GovConsultationType,\n} from '../../types';\n\nconst PAGE_SIZE = 10;\n\n/** Below this many hours left, the closing countdown is flagged as urgent. */\nconst URGENT_HOURS = 48;\n\ntype StatusFilter = 'ALL' | GovConsultationStatus;\ntype TypeFilter = 'ALL' | GovConsultationType;\n\nconst STATUS_OPTIONS: FilterOption<StatusFilter>[] = [\n { value: 'ALL', label: 'All' },\n { value: 'DRAFT', label: 'Draft' },\n { value: 'OPEN', label: 'Open' },\n { value: 'CLOSED', label: 'Closed' },\n { value: 'PUBLISHED', label: 'Published' },\n { value: 'CANCELLED', label: 'Cancelled' },\n];\n\nconst CONSULTATION_TYPES: readonly GovConsultationType[] = [\n 'SURVEY',\n 'POLL',\n 'PARTICIPATORY_BUDGET',\n 'PUBLIC_HEARING',\n 'FEEDBACK',\n];\n\n/** Which detail panel a card currently has expanded. */\ntype ExpandedPanel = 'none' | 'response' | 'results';\n\nexport function ConsultationsPage(): ReactElement {\n const { jurisdictionId } = useParams<{ jurisdictionId: string }>();\n const pager = useCursorPager();\n\n const [status, setStatus] = useState<StatusFilter>('ALL');\n const [type, setType] = useState<TypeFilter>('ALL');\n const [openOnly, setOpenOnly] = useState(false);\n\n const [formOpen, setFormOpen] = useState(false);\n const [editing, setEditing] = useState<GovConsultation | null>(null);\n const [participating, setParticipating] = useState<GovConsultation | null>(null);\n const [pendingDelete, setPendingDelete] = useState<GovConsultation | null>(null);\n /**\n * Which detail panel each card has open, keyed by consultation id. Lifted out\n * of the card so a fresh submission can reveal the respondent's own answers\n * straight away without a state-syncing effect.\n */\n const [expandedPanels, setExpandedPanels] = useState<Record<string, ExpandedPanel>>({});\n\n const togglePanel = (consultationId: string, panel: ExpandedPanel): void => {\n setExpandedPanels((current) => ({\n ...current,\n [consultationId]: current[consultationId] === panel ? 'none' : panel,\n }));\n };\n\n const openConsultation = useGovOpenConsultation();\n const closeConsultation = useGovCloseConsultation();\n const publishResults = useGovPublishConsultationResults();\n const deleteConsultation = useGovDeleteConsultation();\n\n const filter = useMemo<GovConsultationFilterInput>(\n () => ({\n jurisdictionId,\n consultationType: type === 'ALL' ? undefined : type,\n status: openOnly || status === 'ALL' ? undefined : status,\n openOnly: openOnly ? true : undefined,\n }),\n [jurisdictionId, type, status, openOnly]\n );\n\n const { data, isLoading, isError, refetch } = useGovConsultations(filter, {\n limit: PAGE_SIZE,\n cursor: pager.cursor,\n });\n\n const consultations = useMemo(() => data?.items ?? [], [data]);\n const filtersApplied = status !== 'ALL' || type !== 'ALL' || openOnly;\n\n const clearFilters = (): void => {\n setStatus('ALL');\n setType('ALL');\n setOpenOnly(false);\n pager.reset();\n };\n\n const openCreate = (): void => {\n setEditing(null);\n setFormOpen(true);\n };\n\n const runLifecycle = async (\n action: () => Promise<unknown>,\n successTitle: string,\n successBody: string,\n failureTitle: string\n ): Promise<void> => {\n try {\n await action();\n notify.success(successTitle, successBody);\n } catch (err) {\n notify.error(failureTitle, describeError(err));\n }\n };\n\n const confirmDelete = async (): Promise<void> => {\n if (!pendingDelete) return;\n try {\n await deleteConsultation.mutateAsync(pendingDelete.id);\n notify.success('Consultation deleted', `${pendingDelete.title} was removed.`);\n setPendingDelete(null);\n } catch (err) {\n notify.error('Could not delete the consultation', describeError(err));\n }\n };\n\n const lifecycleBusy =\n openConsultation.isPending || closeConsultation.isPending || publishResults.isPending;\n\n return (\n <JurisdictionLayout\n actions={\n <Button onClick={openCreate}>\n <Plus className=\"mr-1.5 h-4 w-4\" aria-hidden=\"true\" /> New consultation\n </Button>\n }\n >\n <div className=\"flex flex-col gap-6\">\n <SectionCard title=\"Filter consultations\" icon={<ListFilter />}>\n <div className=\"flex flex-col gap-4\">\n {openOnly ? (\n <p className=\"text-sm text-text-muted\">\n Showing only consultations that are accepting responses right now, so the status\n filter does not apply.\n </p>\n ) : (\n <div className=\"overflow-x-auto pb-1\">\n <FilterTabs\n options={STATUS_OPTIONS}\n value={status}\n onChange={(next) => {\n setStatus(next);\n pager.reset();\n }}\n />\n </div>\n )}\n\n <div className=\"flex flex-wrap items-end gap-4\">\n <div className=\"grid min-w-[14rem] flex-1 gap-1.5\">\n <span className=\"text-xs font-medium text-text-muted\">Type</span>\n <Select\n value={type}\n onValueChange={(value) => {\n setType(value as TypeFilter);\n pager.reset();\n }}\n >\n <SelectTrigger aria-label=\"Filter by consultation type\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"ALL\">Any type</SelectItem>\n {CONSULTATION_TYPES.map((entry) => (\n <SelectItem key={entry} value={entry}>\n {formatEnumLabel(entry)}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n\n <div className=\"flex items-center gap-2.5 pb-1.5\">\n <Switch\n id=\"consultations-open-only\"\n checked={openOnly}\n onCheckedChange={(next) => {\n setOpenOnly(next === true);\n pager.reset();\n }}\n />\n <label\n htmlFor=\"consultations-open-only\"\n className=\"cursor-pointer text-sm text-text-secondary\"\n >\n Accepting responses right now\n </label>\n </div>\n\n {filtersApplied && (\n <Button variant=\"ghost\" size=\"sm\" className=\"pb-1.5\" onClick={clearFilters}>\n Clear filters\n </Button>\n )}\n </div>\n </div>\n </SectionCard>\n\n {isLoading ? (\n <LoadingView label=\"Loading consultations…\" />\n ) : isError ? (\n <ErrorView\n message=\"We couldn't load consultations for this jurisdiction.\"\n onRetry={() => {\n void refetch();\n }}\n />\n ) : consultations.length === 0 ? (\n <EmptyState\n illustration=\"empty-data\"\n title={\n filtersApplied ? 'No consultations match these filters' : 'No consultations published yet'\n }\n description={\n filtersApplied\n ? 'Nothing matches the current filters. Try widening them.'\n : 'Run a survey, a poll, a public hearing or a participatory budget so residents can shape decisions here.'\n }\n action={\n filtersApplied ? (\n <Button variant=\"outline\" onClick={clearFilters}>\n Clear filters\n </Button>\n ) : (\n <Button onClick={openCreate}>\n <Plus className=\"mr-1.5 h-4 w-4\" aria-hidden=\"true\" /> New consultation\n </Button>\n )\n }\n />\n ) : (\n <>\n <div className=\"flex flex-col gap-4\">\n {consultations.map((consultation) => (\n <ConsultationCard\n key={consultation.id}\n consultation={consultation}\n lifecycleBusy={lifecycleBusy}\n expanded={expandedPanels[consultation.id] ?? 'none'}\n onTogglePanel={(panel) => togglePanel(consultation.id, panel)}\n onParticipate={() => setParticipating(consultation)}\n onEdit={() => {\n setEditing(consultation);\n setFormOpen(true);\n }}\n onDelete={() => setPendingDelete(consultation)}\n onOpen={() =>\n void runLifecycle(\n () => openConsultation.mutateAsync(consultation.id),\n 'Consultation opened',\n `${consultation.title} is now accepting responses.`,\n 'Could not open the consultation'\n )\n }\n onClose={() =>\n void runLifecycle(\n () => closeConsultation.mutateAsync(consultation.id),\n 'Consultation closed',\n `${consultation.title} no longer accepts responses.`,\n 'Could not close the consultation'\n )\n }\n onPublishResults={() =>\n void runLifecycle(\n () => publishResults.mutateAsync(consultation.id),\n 'Results published',\n `The aggregate for ${consultation.title} is now public.`,\n 'Could not publish the results'\n )\n }\n />\n ))}\n </div>\n <Pagination\n page={pager.page}\n pageSize={PAGE_SIZE}\n itemCount={consultations.length}\n hasMore={data?.pageInfo.hasMore ?? false}\n onPageChange={(target) => pager.onPageChange(target, data?.pageInfo.cursor)}\n />\n </>\n )}\n </div>\n\n {formOpen && jurisdictionId && (\n <ConsultationFormDialog\n jurisdictionId={jurisdictionId}\n consultation={editing}\n onClose={() => {\n setFormOpen(false);\n setEditing(null);\n }}\n />\n )}\n\n {participating && (\n <ConsultationParticipateDialog\n consultation={participating}\n onSubmitted={() =>\n setExpandedPanels((current) => ({ ...current, [participating.id]: 'response' }))\n }\n onClose={() => setParticipating(null)}\n />\n )}\n\n <ConfirmDialog\n open={pendingDelete !== null}\n onOpenChange={(next) => {\n if (!next) setPendingDelete(null);\n }}\n title=\"Delete this consultation?\"\n description={\n pendingDelete\n ? `${pendingDelete.title} and the responses recorded against it will no longer be readable.`\n : undefined\n }\n confirmLabel=\"Delete consultation\"\n destructive\n onConfirm={confirmDelete}\n />\n </JurisdictionLayout>\n );\n}\n\ninterface ConsultationCardProps {\n consultation: GovConsultation;\n lifecycleBusy: boolean;\n /** Which detail panel this card currently shows. Owned by the page. */\n expanded: ExpandedPanel;\n onTogglePanel: (panel: ExpandedPanel) => void;\n onParticipate: () => void;\n onEdit: () => void;\n onDelete: () => void;\n onOpen: () => void;\n onClose: () => void;\n onPublishResults: () => void;\n}\n\nfunction ConsultationCard({\n consultation,\n lifecycleBusy,\n expanded,\n onTogglePanel,\n onParticipate,\n onEdit,\n onDelete,\n onOpen,\n onClose,\n onPublishResults,\n}: ConsultationCardProps): ReactElement {\n const questionCount = useMemo(\n () => parseConsultationQuestions(consultation.questions).length,\n [consultation.questions]\n );\n\n // Render-stable clock: the countdown is relative to when the card mounted, so\n // rendering stays pure (no `Date.now()` read in the render body).\n const [nowMs] = useState(() => Date.now());\n\n const countdown = useMemo(() => {\n if (!consultation.closesAt || !consultation.isAcceptingResponses) return null;\n const closesAtMs = new Date(consultation.closesAt).getTime();\n if (Number.isNaN(closesAtMs)) return null;\n const remainingMs = closesAtMs - nowMs;\n if (remainingMs <= 0) return null;\n return {\n label: `Closes ${formatRelativeTime(consultation.closesAt)}`,\n urgent: remainingMs <= URGENT_HOURS * 3_600_000,\n };\n }, [consultation.closesAt, consultation.isAcceptingResponses, nowMs]);\n\n const canParticipate = consultation.isAcceptingResponses && !consultation.hasRespondedByMe;\n\n return (\n <GlassCard treatment=\"plain\" className=\"border-border-seam p-5\">\n <div className=\"flex flex-wrap items-start gap-3\">\n <div className=\"min-w-0 flex-1\">\n <h3 className=\"text-base font-semibold text-text-primary\">{consultation.title}</h3>\n {consultation.description && (\n <p className=\"mt-1 line-clamp-3 text-sm text-text-secondary\">\n {consultation.description}\n </p>\n )}\n </div>\n <div className=\"flex shrink-0 items-center gap-2\">\n <StatusBadge status={consultation.status} />\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"ghost\" size=\"sm\" aria-label={`Actions for ${consultation.title}`}>\n <MoreVertical className=\"size-4\" aria-hidden=\"true\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n <DropdownMenuItem onSelect={onEdit}>\n <Pencil className=\"mr-2 size-4\" aria-hidden=\"true\" /> Edit consultation\n </DropdownMenuItem>\n {consultation.status === 'DRAFT' && (\n <DropdownMenuItem disabled={lifecycleBusy} onSelect={onOpen}>\n <Unlock className=\"mr-2 size-4\" aria-hidden=\"true\" /> Open for responses\n </DropdownMenuItem>\n )}\n {consultation.status === 'OPEN' && (\n <DropdownMenuItem disabled={lifecycleBusy} onSelect={onClose}>\n <Lock className=\"mr-2 size-4\" aria-hidden=\"true\" /> Close consultation\n </DropdownMenuItem>\n )}\n {consultation.status === 'CLOSED' && (\n <DropdownMenuItem disabled={lifecycleBusy} onSelect={onPublishResults}>\n <Upload className=\"mr-2 size-4\" aria-hidden=\"true\" /> Publish results\n </DropdownMenuItem>\n )}\n <DropdownMenuSeparator />\n <DropdownMenuItem onSelect={onDelete}>\n <Trash2 className=\"mr-2 size-4\" aria-hidden=\"true\" /> Delete consultation\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n </div>\n\n <div className=\"mt-3 flex flex-wrap items-center gap-2\">\n <span className=\"rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary\">\n {formatEnumLabel(consultation.consultationType)}\n </span>\n <span className=\"rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary\">\n {formatNumber(questionCount)} question{questionCount === 1 ? '' : 's'}\n </span>\n {consultation.allowAnonymous && (\n <span className=\"rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary\">\n Anonymous allowed\n </span>\n )}\n {consultation.budgetAmount != null && (\n <span className=\"inline-flex items-center gap-1.5 rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary\">\n <Coins className=\"size-3.5\" aria-hidden=\"true\" />\n {formatCurrency(consultation.budgetAmount, consultation.currencyCode)} pot\n </span>\n )}\n {consultation.tags.map((tag) => (\n <span\n key={tag}\n className=\"rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-text-secondary\"\n >\n {tag}\n </span>\n ))}\n </div>\n\n <dl className=\"mt-4 grid gap-3 sm:grid-cols-3\">\n <div>\n <dt className=\"text-xs text-text-muted\">Opens</dt>\n <dd className=\"text-sm text-text-secondary\">\n {consultation.opensAt ? formatDateTime(consultation.opensAt) : 'Not scheduled'}\n </dd>\n </div>\n <div>\n <dt className=\"text-xs text-text-muted\">Closes</dt>\n <dd className=\"text-sm text-text-secondary\">\n {consultation.closesAt ? formatDateTime(consultation.closesAt) : 'No closing date'}\n </dd>\n </div>\n <div>\n <dt className=\"text-xs text-text-muted\">Responses</dt>\n <dd className=\"inline-flex items-center gap-1.5 text-sm text-text-secondary tabular-nums\">\n <Users className=\"size-4 text-text-muted\" aria-hidden=\"true\" />\n {formatNumber(consultation.responseCount)}\n </dd>\n </div>\n </dl>\n\n {countdown && (\n <p\n className={cn(\n 'mt-3 inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-medium',\n countdown.urgent\n ? 'bg-status-warning-bg-subtle text-status-warning-text'\n : 'bg-status-success-bg-subtle text-status-success-text'\n )}\n >\n <CalendarClock className=\"size-3.5\" aria-hidden=\"true\" /> {countdown.label}\n </p>\n )}\n\n <div className=\"mt-4 flex flex-wrap items-center gap-2 border-t border-border-seam pt-4\">\n {canParticipate ? (\n <Button onClick={onParticipate}>\n <Send className=\"mr-1.5 h-4 w-4\" aria-hidden=\"true\" /> Participate\n </Button>\n ) : consultation.hasRespondedByMe ? (\n <span className=\"inline-flex items-center gap-1.5 rounded-full bg-status-success-bg-subtle px-3 py-1 text-sm font-medium text-status-success-text\">\n <CheckCircle2 className=\"size-4\" aria-hidden=\"true\" /> You have responded\n </span>\n ) : (\n <span className=\"text-sm text-text-muted\">\n {consultation.status === 'DRAFT'\n ? 'Not open for responses yet.'\n : 'This consultation is not accepting responses.'}\n </span>\n )}\n\n {consultation.hasRespondedByMe && (\n <Button variant=\"outline\" onClick={() => onTogglePanel('response')}>\n <MessageSquareQuote className=\"mr-1.5 h-4 w-4\" aria-hidden=\"true\" />\n Your response\n {expanded === 'response' ? (\n <ChevronUp className=\"ml-1.5 h-4 w-4\" aria-hidden=\"true\" />\n ) : (\n <ChevronDown className=\"ml-1.5 h-4 w-4\" aria-hidden=\"true\" />\n )}\n </Button>\n )}\n\n <Button variant=\"outline\" onClick={() => onTogglePanel('results')}>\n <BarChart3 className=\"mr-1.5 h-4 w-4\" aria-hidden=\"true\" />\n Results\n {expanded === 'results' ? (\n <ChevronUp className=\"ml-1.5 h-4 w-4\" aria-hidden=\"true\" />\n ) : (\n <ChevronDown className=\"ml-1.5 h-4 w-4\" aria-hidden=\"true\" />\n )}\n </Button>\n </div>\n\n {expanded === 'response' && (\n <div className=\"mt-4 border-t border-border-seam pt-4\">\n <MyResponsePanel consultation={consultation} />\n </div>\n )}\n\n {expanded === 'results' && (\n <div className=\"mt-4 border-t border-border-seam pt-4\">\n <ConsultationResultsPanel consultation={consultation} />\n </div>\n )}\n </GlassCard>\n );\n}\n\n/** The calling actor's own submitted answers, read back from the self-scoped query. */\nfunction MyResponsePanel({ consultation }: { consultation: GovConsultation }): ReactElement {\n const { data, isLoading, isError, refetch } = useGovMyConsultationResponse(consultation.id);\n\n const questions = useMemo(\n () => parseConsultationQuestions(consultation.questions),\n [consultation.questions]\n );\n const answers = useMemo(() => parseConsultationAnswers(data?.answers ?? null), [data]);\n const answerById = useMemo(\n () => new Map(answers.map((answer) => [answer.questionId, answer.value])),\n [answers]\n );\n\n if (isLoading) {\n return <LoadingView label=\"Loading your response…\" className=\"min-h-[8rem]\" />;\n }\n\n if (isError) {\n return (\n <ErrorView\n className=\"min-h-[8rem]\"\n message=\"We couldn't load your response.\"\n onRetry={() => {\n void refetch();\n }}\n />\n );\n }\n\n if (!data) {\n return (\n <EmptyState\n icon={<MessageSquareQuote className=\"size-8\" aria-hidden=\"true\" />}\n title=\"No response linked to your account\"\n description=\"Anonymous submissions store no respondent id, so they cannot be shown back to you.\"\n />\n );\n }\n\n const answered = questions.filter((question) => answerById.has(question.id));\n\n return (\n <div className=\"flex flex-col gap-3\">\n <p className=\"text-sm text-text-muted\">\n Submitted {formatDateTime(data.submittedAt)}\n {data.sentiment ? ` · overall sentiment: ${formatEnumLabel(data.sentiment)}` : ''}\n </p>\n\n {answered.length === 0 ? (\n <p className=\"text-sm text-text-muted\">\n Your response recorded no answers against the current questions.\n </p>\n ) : (\n <dl className=\"flex flex-col gap-3\">\n {answered.map((question) => {\n const value = answerById.get(question.id);\n return (\n <div\n key={question.id}\n className=\"rounded-lg border border-border-seam bg-bg-sunken/40 p-3\"\n >\n <dt className=\"text-sm font-medium text-text-primary\">\n {question.label}\n <span className=\"ml-2 text-xs font-normal text-text-muted\">\n {QUESTION_TYPE_LABELS[question.type]}\n </span>\n </dt>\n <dd className=\"mt-1 text-sm text-text-secondary\">\n {question.type === 'BUDGET_ALLOCATION' ? (\n <ul className=\"flex flex-col gap-0.5\">\n {Object.entries(readAllocation(value)).map(([option, amount]) => (\n <li key={option} className=\"flex justify-between gap-4 tabular-nums\">\n <span>{option}</span>\n <span>{formatCurrency(amount, consultation.currencyCode)}</span>\n </li>\n ))}\n </ul>\n ) : (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