@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.
Files changed (171) hide show
  1. package/dist/govcitizenhub/GovCitizenHubRoot.d.ts.map +1 -1
  2. package/dist/govcitizenhub/GovCitizenHubRoot.js +44 -36
  3. package/dist/govcitizenhub/GovCitizenHubRoot.js.map +1 -1
  4. package/dist/govcitizenhub/GovCitizenHubRoutes.d.ts.map +1 -1
  5. package/dist/govcitizenhub/GovCitizenHubRoutes.js +134 -6
  6. package/dist/govcitizenhub/GovCitizenHubRoutes.js.map +1 -1
  7. package/dist/govcitizenhub/components/DocumentUploadField.d.ts +17 -11
  8. package/dist/govcitizenhub/components/DocumentUploadField.d.ts.map +1 -1
  9. package/dist/govcitizenhub/components/DocumentUploadField.js +45 -42
  10. package/dist/govcitizenhub/components/DocumentUploadField.js.map +1 -1
  11. package/dist/govcitizenhub/components/GovCharts.js +127 -51
  12. package/dist/govcitizenhub/components/GovCharts.js.map +1 -1
  13. package/dist/govcitizenhub/hooks/index.d.ts +2 -0
  14. package/dist/govcitizenhub/hooks/index.d.ts.map +1 -1
  15. package/dist/govcitizenhub/hooks/index.js +2 -0
  16. package/dist/govcitizenhub/hooks/useGovApi.d.ts +23 -0
  17. package/dist/govcitizenhub/hooks/useGovApi.d.ts.map +1 -1
  18. package/dist/govcitizenhub/hooks/useGovApi.js +18 -7
  19. package/dist/govcitizenhub/hooks/useGovApi.js.map +1 -1
  20. package/dist/govcitizenhub/hooks/useGovCitizenHubAnalytics.d.ts +24 -0
  21. package/dist/govcitizenhub/hooks/useGovCitizenHubAnalytics.d.ts.map +1 -0
  22. package/dist/govcitizenhub/hooks/useGovCitizenHubAnalytics.js +40 -0
  23. package/dist/govcitizenhub/hooks/useGovCitizenHubAnalytics.js.map +1 -0
  24. package/dist/govcitizenhub/hooks/useIntelligenceApi.d.ts +214 -0
  25. package/dist/govcitizenhub/hooks/useIntelligenceApi.d.ts.map +1 -0
  26. package/dist/govcitizenhub/hooks/useIntelligenceApi.js +1140 -0
  27. package/dist/govcitizenhub/hooks/useIntelligenceApi.js.map +1 -0
  28. package/dist/govcitizenhub/index.d.ts +1 -0
  29. package/dist/govcitizenhub/index.d.ts.map +1 -1
  30. package/dist/govcitizenhub/index.js +18 -0
  31. package/dist/govcitizenhub/pages/agencies/AgenciesPage.js +7 -7
  32. package/dist/govcitizenhub/pages/agencies/AgencyFormDialog.js +6 -6
  33. package/dist/govcitizenhub/pages/applications/ApplicationDetailPage.d.ts.map +1 -1
  34. package/dist/govcitizenhub/pages/applications/ApplicationDetailPage.js +178 -172
  35. package/dist/govcitizenhub/pages/applications/ApplicationDetailPage.js.map +1 -1
  36. package/dist/govcitizenhub/pages/applications/ApplicationsPage.js +35 -35
  37. package/dist/govcitizenhub/pages/applications/ApplicationsPage.js.map +1 -1
  38. package/dist/govcitizenhub/pages/applications/NewApplicationPage.d.ts.map +1 -1
  39. package/dist/govcitizenhub/pages/applications/NewApplicationPage.js +151 -147
  40. package/dist/govcitizenhub/pages/applications/NewApplicationPage.js.map +1 -1
  41. package/dist/govcitizenhub/pages/documents/DocumentsPage.js +5 -5
  42. package/dist/govcitizenhub/pages/grievances/GrievanceDetailPage.js +30 -30
  43. package/dist/govcitizenhub/pages/grievances/GrievanceDetailPage.js.map +1 -1
  44. package/dist/govcitizenhub/pages/grievances/GrievancesPage.d.ts.map +1 -1
  45. package/dist/govcitizenhub/pages/grievances/GrievancesPage.js +176 -172
  46. package/dist/govcitizenhub/pages/grievances/GrievancesPage.js.map +1 -1
  47. package/dist/govcitizenhub/pages/intelligence/AdminLevelsPage.d.ts +4 -0
  48. package/dist/govcitizenhub/pages/intelligence/AdminLevelsPage.d.ts.map +1 -0
  49. package/dist/govcitizenhub/pages/intelligence/AdminLevelsPage.js +634 -0
  50. package/dist/govcitizenhub/pages/intelligence/AdminLevelsPage.js.map +1 -0
  51. package/dist/govcitizenhub/pages/intelligence/AssetFormDialog.d.ts +20 -0
  52. package/dist/govcitizenhub/pages/intelligence/AssetFormDialog.d.ts.map +1 -0
  53. package/dist/govcitizenhub/pages/intelligence/AssetFormDialog.js +537 -0
  54. package/dist/govcitizenhub/pages/intelligence/AssetFormDialog.js.map +1 -0
  55. package/dist/govcitizenhub/pages/intelligence/AssetImage.d.ts +11 -0
  56. package/dist/govcitizenhub/pages/intelligence/AssetImage.d.ts.map +1 -0
  57. package/dist/govcitizenhub/pages/intelligence/AssetImage.js +25 -0
  58. package/dist/govcitizenhub/pages/intelligence/AssetImage.js.map +1 -0
  59. package/dist/govcitizenhub/pages/intelligence/AssetMapPanel.d.ts +15 -0
  60. package/dist/govcitizenhub/pages/intelligence/AssetMapPanel.d.ts.map +1 -0
  61. package/dist/govcitizenhub/pages/intelligence/AssetMapPanel.js +203 -0
  62. package/dist/govcitizenhub/pages/intelligence/AssetMapPanel.js.map +1 -0
  63. package/dist/govcitizenhub/pages/intelligence/BenchmarkPage.d.ts +4 -0
  64. package/dist/govcitizenhub/pages/intelligence/BenchmarkPage.d.ts.map +1 -0
  65. package/dist/govcitizenhub/pages/intelligence/BenchmarkPage.js +497 -0
  66. package/dist/govcitizenhub/pages/intelligence/BenchmarkPage.js.map +1 -0
  67. package/dist/govcitizenhub/pages/intelligence/BudgetPage.d.ts +4 -0
  68. package/dist/govcitizenhub/pages/intelligence/BudgetPage.d.ts.map +1 -0
  69. package/dist/govcitizenhub/pages/intelligence/BudgetPage.js +1084 -0
  70. package/dist/govcitizenhub/pages/intelligence/BudgetPage.js.map +1 -0
  71. package/dist/govcitizenhub/pages/intelligence/ConsultationFormDialog.d.ts +13 -0
  72. package/dist/govcitizenhub/pages/intelligence/ConsultationFormDialog.d.ts.map +1 -0
  73. package/dist/govcitizenhub/pages/intelligence/ConsultationFormDialog.js +581 -0
  74. package/dist/govcitizenhub/pages/intelligence/ConsultationFormDialog.js.map +1 -0
  75. package/dist/govcitizenhub/pages/intelligence/ConsultationParticipateDialog.d.ts +11 -0
  76. package/dist/govcitizenhub/pages/intelligence/ConsultationParticipateDialog.d.ts.map +1 -0
  77. package/dist/govcitizenhub/pages/intelligence/ConsultationParticipateDialog.js +429 -0
  78. package/dist/govcitizenhub/pages/intelligence/ConsultationParticipateDialog.js.map +1 -0
  79. package/dist/govcitizenhub/pages/intelligence/ConsultationResultsPanel.d.ts +8 -0
  80. package/dist/govcitizenhub/pages/intelligence/ConsultationResultsPanel.d.ts.map +1 -0
  81. package/dist/govcitizenhub/pages/intelligence/ConsultationResultsPanel.js +235 -0
  82. package/dist/govcitizenhub/pages/intelligence/ConsultationResultsPanel.js.map +1 -0
  83. package/dist/govcitizenhub/pages/intelligence/ConsultationsPage.d.ts +4 -0
  84. package/dist/govcitizenhub/pages/intelligence/ConsultationsPage.d.ts.map +1 -0
  85. package/dist/govcitizenhub/pages/intelligence/ConsultationsPage.js +534 -0
  86. package/dist/govcitizenhub/pages/intelligence/ConsultationsPage.js.map +1 -0
  87. package/dist/govcitizenhub/pages/intelligence/CorrectionsPage.d.ts +4 -0
  88. package/dist/govcitizenhub/pages/intelligence/CorrectionsPage.d.ts.map +1 -0
  89. package/dist/govcitizenhub/pages/intelligence/CorrectionsPage.js +723 -0
  90. package/dist/govcitizenhub/pages/intelligence/CorrectionsPage.js.map +1 -0
  91. package/dist/govcitizenhub/pages/intelligence/ElectionsPage.d.ts +5 -0
  92. package/dist/govcitizenhub/pages/intelligence/ElectionsPage.d.ts.map +1 -0
  93. package/dist/govcitizenhub/pages/intelligence/ElectionsPage.js +1029 -0
  94. package/dist/govcitizenhub/pages/intelligence/ElectionsPage.js.map +1 -0
  95. package/dist/govcitizenhub/pages/intelligence/GovernancePage.d.ts +5 -0
  96. package/dist/govcitizenhub/pages/intelligence/GovernancePage.d.ts.map +1 -0
  97. package/dist/govcitizenhub/pages/intelligence/GovernancePage.js +1545 -0
  98. package/dist/govcitizenhub/pages/intelligence/GovernancePage.js.map +1 -0
  99. package/dist/govcitizenhub/pages/intelligence/IndicatorCatalogPage.d.ts +4 -0
  100. package/dist/govcitizenhub/pages/intelligence/IndicatorCatalogPage.d.ts.map +1 -0
  101. package/dist/govcitizenhub/pages/intelligence/IndicatorCatalogPage.js +960 -0
  102. package/dist/govcitizenhub/pages/intelligence/IndicatorCatalogPage.js.map +1 -0
  103. package/dist/govcitizenhub/pages/intelligence/IndicatorsPage.d.ts +13 -0
  104. package/dist/govcitizenhub/pages/intelligence/IndicatorsPage.d.ts.map +1 -0
  105. package/dist/govcitizenhub/pages/intelligence/IndicatorsPage.js +927 -0
  106. package/dist/govcitizenhub/pages/intelligence/IndicatorsPage.js.map +1 -0
  107. package/dist/govcitizenhub/pages/intelligence/JurisdictionDirectoryPage.d.ts +4 -0
  108. package/dist/govcitizenhub/pages/intelligence/JurisdictionDirectoryPage.d.ts.map +1 -0
  109. package/dist/govcitizenhub/pages/intelligence/JurisdictionDirectoryPage.js +620 -0
  110. package/dist/govcitizenhub/pages/intelligence/JurisdictionDirectoryPage.js.map +1 -0
  111. package/dist/govcitizenhub/pages/intelligence/JurisdictionLayout.d.ts +20 -0
  112. package/dist/govcitizenhub/pages/intelligence/JurisdictionLayout.d.ts.map +1 -0
  113. package/dist/govcitizenhub/pages/intelligence/JurisdictionLayout.js +183 -0
  114. package/dist/govcitizenhub/pages/intelligence/JurisdictionLayout.js.map +1 -0
  115. package/dist/govcitizenhub/pages/intelligence/JurisdictionProfilePage.d.ts +4 -0
  116. package/dist/govcitizenhub/pages/intelligence/JurisdictionProfilePage.d.ts.map +1 -0
  117. package/dist/govcitizenhub/pages/intelligence/JurisdictionProfilePage.js +629 -0
  118. package/dist/govcitizenhub/pages/intelligence/JurisdictionProfilePage.js.map +1 -0
  119. package/dist/govcitizenhub/pages/intelligence/OpenDataPage.d.ts +4 -0
  120. package/dist/govcitizenhub/pages/intelligence/OpenDataPage.d.ts.map +1 -0
  121. package/dist/govcitizenhub/pages/intelligence/OpenDataPage.js +1124 -0
  122. package/dist/govcitizenhub/pages/intelligence/OpenDataPage.js.map +1 -0
  123. package/dist/govcitizenhub/pages/intelligence/ProjectsPage.d.ts +4 -0
  124. package/dist/govcitizenhub/pages/intelligence/ProjectsPage.d.ts.map +1 -0
  125. package/dist/govcitizenhub/pages/intelligence/ProjectsPage.js +1518 -0
  126. package/dist/govcitizenhub/pages/intelligence/ProjectsPage.js.map +1 -0
  127. package/dist/govcitizenhub/pages/intelligence/PublicAssetsPage.d.ts +4 -0
  128. package/dist/govcitizenhub/pages/intelligence/PublicAssetsPage.d.ts.map +1 -0
  129. package/dist/govcitizenhub/pages/intelligence/PublicAssetsPage.js +577 -0
  130. package/dist/govcitizenhub/pages/intelligence/PublicAssetsPage.js.map +1 -0
  131. package/dist/govcitizenhub/pages/intelligence/ServicePerformancePage.d.ts +4 -0
  132. package/dist/govcitizenhub/pages/intelligence/ServicePerformancePage.d.ts.map +1 -0
  133. package/dist/govcitizenhub/pages/intelligence/ServicePerformancePage.js +534 -0
  134. package/dist/govcitizenhub/pages/intelligence/ServicePerformancePage.js.map +1 -0
  135. package/dist/govcitizenhub/pages/intelligence/TimelinePage.d.ts +5 -0
  136. package/dist/govcitizenhub/pages/intelligence/TimelinePage.d.ts.map +1 -0
  137. package/dist/govcitizenhub/pages/intelligence/TimelinePage.js +538 -0
  138. package/dist/govcitizenhub/pages/intelligence/TimelinePage.js.map +1 -0
  139. package/dist/govcitizenhub/pages/intelligence/consultationQuestions.d.ts +53 -0
  140. package/dist/govcitizenhub/pages/intelligence/consultationQuestions.d.ts.map +1 -0
  141. package/dist/govcitizenhub/pages/intelligence/consultationQuestions.js +138 -0
  142. package/dist/govcitizenhub/pages/intelligence/consultationQuestions.js.map +1 -0
  143. package/dist/govcitizenhub/pages/intelligence/index.d.ts +27 -0
  144. package/dist/govcitizenhub/pages/intelligence/index.d.ts.map +1 -0
  145. package/dist/govcitizenhub/pages/intelligence/index.js +17 -0
  146. package/dist/govcitizenhub/pages/payments/PaymentsPage.d.ts.map +1 -1
  147. package/dist/govcitizenhub/pages/payments/PaymentsPage.js +53 -49
  148. package/dist/govcitizenhub/pages/payments/PaymentsPage.js.map +1 -1
  149. package/dist/govcitizenhub/pages/permits/IssuePermitDialog.d.ts.map +1 -1
  150. package/dist/govcitizenhub/pages/permits/IssuePermitDialog.js +82 -76
  151. package/dist/govcitizenhub/pages/permits/IssuePermitDialog.js.map +1 -1
  152. package/dist/govcitizenhub/pages/permits/PermitsPage.d.ts.map +1 -1
  153. package/dist/govcitizenhub/pages/permits/PermitsPage.js +174 -120
  154. package/dist/govcitizenhub/pages/permits/PermitsPage.js.map +1 -1
  155. package/dist/govcitizenhub/pages/services/ServiceDetailPage.js +8 -8
  156. package/dist/govcitizenhub/pages/services/ServiceFormDialog.js +98 -98
  157. package/dist/govcitizenhub/pages/services/ServiceFormDialog.js.map +1 -1
  158. package/dist/govcitizenhub/types/index.d.ts +1 -0
  159. package/dist/govcitizenhub/types/index.d.ts.map +1 -1
  160. package/dist/govcitizenhub/types/intelligence.d.ts +1559 -0
  161. package/dist/govcitizenhub/types/intelligence.d.ts.map +1 -0
  162. package/dist/govcitizenhub/types/intelligence.js +125 -0
  163. package/dist/govcitizenhub/types/intelligence.js.map +1 -0
  164. package/dist/index.js +19 -2
  165. package/dist/node_modules/recharts/es6/chart/BarChart.js +24 -0
  166. package/dist/node_modules/recharts/es6/chart/BarChart.js.map +1 -0
  167. package/dist/utils/pageContext.d.ts +1 -0
  168. package/dist/utils/pageContext.d.ts.map +1 -1
  169. package/dist/utils/pageContext.js +44 -17
  170. package/dist/utils/pageContext.js.map +1 -1
  171. package/package.json +1 -1
@@ -8,17 +8,18 @@ import { EmptyState as o } from "../../components/EmptyState.js";
8
8
  import { useGovAgencies as s, useGovGrievances as c, useGovReportGrievance as l } from "../../hooks/useGovApi.js";
9
9
  import { useCursorPager as u } from "../../hooks/useCursorPager.js";
10
10
  import { FILE_FOLDERS as d, uploadFileToFiles as f } from "../../hooks/useFiles.js";
11
+ import { useGovCitizenHubAnalytics as p } from "../../hooks/useGovCitizenHubAnalytics.js";
11
12
  import "../../hooks/index.js";
12
- import { ErrorView as p } from "../../components/StateViews.js";
13
- import { FilterTabs as m } from "../../components/FilterTabs.js";
14
- import { describeError as h, notify as g } from "../../lib/toast.js";
15
- import { Pagination as _ } from "../../components/Pagination.js";
16
- import { useEffect as v, useState as y } from "react";
17
- import { BadgeCheck as b, Camera as x, ChevronRight as S, CircleHelp as C, GraduationCap as w, HandHeart as T, HeartPulse as E, Loader2 as ee, MapPin as D, Megaphone as O, Plus as k, Receipt as A, ScrollText as j, Wrench as M, X as te } from "lucide-react";
18
- import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
19
- import { Button as I, GlassCard as L, Input as R, Label as z, ResponsiveDialog as ne, ResponsiveDialogContent as re, ResponsiveDialogDescription as B, ResponsiveDialogFooter as V, ResponsiveDialogHeader as ie, ResponsiveDialogTitle as ae, Select as H, SelectContent as U, SelectItem as W, SelectTrigger as G, SelectValue as K, Skeleton as q, Textarea as oe } from "@burdenoff/fe-libs/ui";
13
+ import { ErrorView as m } from "../../components/StateViews.js";
14
+ import { FilterTabs as h } from "../../components/FilterTabs.js";
15
+ import { Pagination as g } from "../../components/Pagination.js";
16
+ import { describeError as _, notify as v } from "../../lib/toast.js";
17
+ import { useEffect as y, useState as b } from "react";
18
+ import { BadgeCheck as x, Camera as S, ChevronRight as C, CircleHelp as w, GraduationCap as T, HandHeart as E, HeartPulse as D, Loader2 as ee, MapPin as O, Megaphone as k, Plus as A, Receipt as j, ScrollText as M, Wrench as N, X as te } from "lucide-react";
19
+ import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
20
+ import { Button as L, GlassCard as R, Input as z, Label as B, ResponsiveDialog as ne, ResponsiveDialogContent as re, ResponsiveDialogDescription as ie, ResponsiveDialogFooter as ae, ResponsiveDialogHeader as oe, ResponsiveDialogTitle as se, Select as V, SelectContent as H, SelectItem as U, SelectTrigger as W, SelectValue as G, Skeleton as K, Textarea as ce } from "@burdenoff/fe-libs/ui";
20
21
  //#region src/govcitizenhub/pages/grievances/GrievancesPage.tsx
21
- var J = 15, Y = 5, X = 1e3, Z = [
22
+ var q = 15, J = 5, Y = 1e3, X = [
22
23
  {
23
24
  value: "ALL",
24
25
  label: "All"
@@ -43,7 +44,7 @@ var J = 15, Y = 5, X = 1e3, Z = [
43
44
  value: "CLOSED",
44
45
  label: "Closed"
45
46
  }
46
- ], se = [
47
+ ], le = [
47
48
  "GRIEVANCES",
48
49
  "HEALTH",
49
50
  "UTILITIES",
@@ -53,272 +54,275 @@ var J = 15, Y = 5, X = 1e3, Z = [
53
54
  "LICENCES_AND_PERMITS",
54
55
  "TAXES_AND_PAYMENTS",
55
56
  "OTHER"
56
- ], ce = [
57
+ ], ue = [
57
58
  "LOW",
58
59
  "NORMAL",
59
60
  "HIGH",
60
61
  "URGENT"
61
- ], Q = {
62
- CERTIFICATES: j,
63
- EDUCATION: w,
64
- GRIEVANCES: O,
65
- HEALTH: E,
66
- LICENCES_AND_PERMITS: b,
67
- OTHER: C,
68
- SOCIAL_WELFARE: T,
69
- TAXES_AND_PAYMENTS: A,
70
- UTILITIES: M
62
+ ], Z = {
63
+ CERTIFICATES: M,
64
+ EDUCATION: T,
65
+ GRIEVANCES: k,
66
+ HEALTH: D,
67
+ LICENCES_AND_PERMITS: x,
68
+ OTHER: w,
69
+ SOCIAL_WELFARE: E,
70
+ TAXES_AND_PAYMENTS: j,
71
+ UTILITIES: N
71
72
  };
72
- function $() {
73
- let { navigateTo: t } = e(), s = u(), [l, d] = y("ALL"), [f, h] = y(!1), { data: g, isLoading: v, isError: b, refetch: w } = c({
73
+ function Q() {
74
+ let { navigateTo: t } = e(), s = u(), [l, d] = b("ALL"), [f, p] = b(!1), { data: _, isLoading: v, isError: y, refetch: x } = c({
74
75
  status: l === "ALL" ? void 0 : l,
75
76
  pagination: {
76
- limit: J,
77
+ limit: q,
77
78
  cursor: s.cursor
78
79
  }
79
- }), T = g?.items ?? [];
80
- return /* @__PURE__ */ F(n, {
80
+ }), T = _?.items ?? [];
81
+ return /* @__PURE__ */ I(n, {
81
82
  title: "Grievances",
82
83
  titleGradient: !0,
83
84
  description: "Civic complaints reported by citizens, triaged through to resolution.",
84
- actions: /* @__PURE__ */ F(I, {
85
- onClick: () => h(!0),
86
- children: [/* @__PURE__ */ P(k, { className: "mr-1.5 h-4 w-4" }), " Report grievance"]
85
+ actions: /* @__PURE__ */ I(L, {
86
+ onClick: () => p(!0),
87
+ children: [/* @__PURE__ */ F(A, { className: "mr-1.5 h-4 w-4" }), " Report grievance"]
87
88
  }),
88
89
  children: [
89
- /* @__PURE__ */ P("div", {
90
+ /* @__PURE__ */ F("div", {
90
91
  className: "mb-5",
91
- children: /* @__PURE__ */ P(m, {
92
- options: Z,
92
+ children: /* @__PURE__ */ F(h, {
93
+ options: X,
93
94
  value: l,
94
95
  onChange: (e) => {
95
96
  d(e), s.reset();
96
97
  }
97
98
  })
98
99
  }),
99
- v ? /* @__PURE__ */ P("div", {
100
+ v ? /* @__PURE__ */ F("div", {
100
101
  className: "space-y-3",
101
- children: Array.from({ length: 6 }, (e, t) => /* @__PURE__ */ P(q, { className: "h-[72px] w-full rounded-card" }, t))
102
- }) : b ? /* @__PURE__ */ P(p, {
102
+ children: Array.from({ length: 6 }, (e, t) => /* @__PURE__ */ F(K, { className: "h-[72px] w-full rounded-card" }, t))
103
+ }) : y ? /* @__PURE__ */ F(m, {
103
104
  message: "We couldn't load grievances.",
104
- onRetry: () => w()
105
- }) : T.length === 0 && s.page === 0 ? /* @__PURE__ */ P(o, {
105
+ onRetry: () => x()
106
+ }) : T.length === 0 && s.page === 0 ? /* @__PURE__ */ F(o, {
106
107
  illustration: "empty-data",
107
108
  title: "No grievances found",
108
109
  description: l === "ALL" ? "Report the first civic grievance." : "No grievances match this status.",
109
- action: /* @__PURE__ */ F(I, {
110
- onClick: () => h(!0),
111
- children: [/* @__PURE__ */ P(k, { className: "mr-1.5 h-4 w-4" }), " Report grievance"]
110
+ action: /* @__PURE__ */ I(L, {
111
+ onClick: () => p(!0),
112
+ children: [/* @__PURE__ */ F(A, { className: "mr-1.5 h-4 w-4" }), " Report grievance"]
112
113
  })
113
- }) : /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(L, {
114
+ }) : /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(R, {
114
115
  treatment: "plain",
115
116
  className: "divide-y divide-border-subtle border-border-seam p-0",
116
- children: T.map((e) => /* @__PURE__ */ F("button", {
117
+ children: T.map((e) => /* @__PURE__ */ I("button", {
117
118
  type: "button",
118
119
  onClick: () => t(`grievances/${e.id}`),
119
120
  className: "group flex w-full items-center gap-3 px-4 py-4 text-left outline-none transition-colors hover:bg-bg-sunken focus-visible:bg-bg-sunken sm:px-5",
120
121
  children: [
121
- /* @__PURE__ */ P("span", {
122
+ /* @__PURE__ */ F("span", {
122
123
  className: "inline-flex size-10 shrink-0 items-center justify-center rounded-xl bg-bg-sunken text-text-secondary group-hover:bg-bg-surface",
123
- children: /* @__PURE__ */ P(Q[e.category] ?? C, { className: "size-5" })
124
+ children: /* @__PURE__ */ F(Z[e.category] ?? w, { className: "size-5" })
124
125
  }),
125
- /* @__PURE__ */ F("div", {
126
+ /* @__PURE__ */ I("div", {
126
127
  className: "min-w-0 flex-1",
127
- children: [/* @__PURE__ */ F("div", {
128
+ children: [/* @__PURE__ */ I("div", {
128
129
  className: "flex flex-wrap items-center gap-x-2 gap-y-1",
129
- children: [/* @__PURE__ */ P("span", {
130
+ children: [/* @__PURE__ */ F("span", {
130
131
  className: "truncate font-medium text-text-primary",
131
132
  children: e.title
132
- }), /* @__PURE__ */ P(a, { status: e.priority })]
133
- }), /* @__PURE__ */ F("p", {
133
+ }), /* @__PURE__ */ F(a, { status: e.priority })]
134
+ }), /* @__PURE__ */ I("p", {
134
135
  className: "mt-0.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-text-muted",
135
136
  children: [
136
- /* @__PURE__ */ P("span", { children: r(e.category) }),
137
- e.location && /* @__PURE__ */ F("span", {
137
+ /* @__PURE__ */ F("span", { children: r(e.category) }),
138
+ e.location && /* @__PURE__ */ I("span", {
138
139
  className: "flex items-center gap-1",
139
140
  children: [
140
- /* @__PURE__ */ P(D, { className: "size-3" }),
141
+ /* @__PURE__ */ F(O, { className: "size-3" }),
141
142
  " ",
142
143
  e.location
143
144
  ]
144
145
  }),
145
- e.photoFileIds.length > 0 && /* @__PURE__ */ F("span", {
146
+ e.photoFileIds.length > 0 && /* @__PURE__ */ I("span", {
146
147
  className: "flex items-center gap-1",
147
148
  children: [
148
- /* @__PURE__ */ P(x, { className: "size-3" }),
149
+ /* @__PURE__ */ F(S, { className: "size-3" }),
149
150
  " ",
150
151
  e.photoFileIds.length
151
152
  ]
152
153
  }),
153
- /* @__PURE__ */ F("span", { children: ["Reported ", i(e.createdAt)] })
154
+ /* @__PURE__ */ I("span", { children: ["Reported ", i(e.createdAt)] })
154
155
  ]
155
156
  })]
156
157
  }),
157
- /* @__PURE__ */ P(a, {
158
+ /* @__PURE__ */ F(a, {
158
159
  status: e.status,
159
160
  className: "hidden sm:inline-flex"
160
161
  }),
161
- /* @__PURE__ */ P(S, { className: "size-4 shrink-0 text-text-muted transition-transform group-hover:translate-x-0.5" })
162
+ /* @__PURE__ */ F(C, { className: "size-4 shrink-0 text-text-muted transition-transform group-hover:translate-x-0.5" })
162
163
  ]
163
164
  }, e.id))
164
- }), /* @__PURE__ */ P(_, {
165
+ }), /* @__PURE__ */ F(g, {
165
166
  page: s.page,
166
- pageSize: J,
167
+ pageSize: q,
167
168
  itemCount: T.length,
168
- hasMore: g?.pageInfo.hasMore ?? !1,
169
- onPageChange: (e) => s.onPageChange(e, g?.pageInfo.cursor)
169
+ hasMore: _?.pageInfo.hasMore ?? !1,
170
+ onPageChange: (e) => s.onPageChange(e, _?.pageInfo.cursor)
170
171
  })] }),
171
- /* @__PURE__ */ P(le, {
172
+ /* @__PURE__ */ F(de, {
172
173
  open: f,
173
- onOpenChange: h,
174
+ onOpenChange: p,
174
175
  onReported: (e) => t(`grievances/${e}`)
175
176
  })
176
177
  ]
177
178
  });
178
179
  }
179
- function le({ open: e, onOpenChange: n, onReported: i }) {
180
- let a = l(), { data: o } = s({ isActive: !0 }), [c, u] = y(""), [p, m] = y(""), [_, b] = y("GRIEVANCES"), [S, C] = y("NORMAL"), [w, T] = y(""), [E, O] = y(""), [A, j] = y([]), [M, N] = y(!1), [L, q] = y(null);
181
- v(() => {
182
- e && (u(""), m(""), b("GRIEVANCES"), C("NORMAL"), T(""), O(""), j([]), q(null));
183
- }, [e]);
184
- let J = async (e) => {
180
+ function de({ open: n, onOpenChange: i, onReported: a }) {
181
+ let { workspaceId: o } = e(), { emitGrievanceReported: c } = p(), u = l(), { data: m } = s({ isActive: !0 }), [h, g] = b(""), [x, C] = b(""), [w, T] = b("GRIEVANCES"), [E, D] = b("NORMAL"), [k, j] = b(""), [M, N] = b(""), [P, R] = b([]), [K, q] = b(!1), [X, Z] = b(null);
182
+ y(() => {
183
+ n && (g(""), C(""), T("GRIEVANCES"), D("NORMAL"), j(""), N(""), R([]), Z(null));
184
+ }, [n]);
185
+ let Q = async (e) => {
185
186
  let t = e.target.files?.[0];
186
- if (e.target.value = "", !(!t || A.length >= Y)) {
187
- N(!0);
187
+ if (e.target.value = "", !(!t || P.length >= J)) {
188
+ q(!0);
188
189
  try {
189
190
  let e = await f(t, d.grievances);
190
- j((t) => [...t, e]), g.success("Photo attached", e.name);
191
+ R((t) => [...t, e]), v.success("Photo attached", e.name);
191
192
  } catch (e) {
192
- g.error("Could not attach photo", h(e));
193
+ v.error("Could not attach photo", _(e));
193
194
  } finally {
194
- N(!1);
195
+ q(!1);
195
196
  }
196
197
  }
197
- }, Z = (e) => j((t) => t.filter((t) => t.id !== e)), Q = async () => {
198
- if (!c.trim()) {
199
- q("A title is required.");
198
+ }, de = (e) => R((t) => t.filter((t) => t.id !== e)), fe = async () => {
199
+ if (!h.trim()) {
200
+ Z("A title is required.");
200
201
  return;
201
202
  }
202
- if (!p.trim()) {
203
- q("Please describe the grievance.");
203
+ if (!x.trim()) {
204
+ Z("Please describe the grievance.");
204
205
  return;
205
206
  }
206
207
  try {
207
- let e = await a.mutateAsync({
208
- title: c.trim(),
209
- description: p.trim(),
210
- category: _,
211
- priority: S,
212
- location: w.trim() || null,
213
- agencyId: E || null,
214
- photoFileIds: A.length ? A.map((e) => e.id) : null
208
+ let e = await u.mutateAsync({
209
+ title: h.trim(),
210
+ description: x.trim(),
211
+ category: w,
212
+ priority: E,
213
+ location: k.trim() || null,
214
+ agencyId: M || null,
215
+ photoFileIds: P.length ? P.map((e) => e.id) : null
215
216
  });
216
- g.success("Grievance reported", e.title), i(e.id), n(!1);
217
+ v.success("Grievance reported", e.title), c({
218
+ workspaceId: o,
219
+ id: e.id
220
+ }), a(e.id), i(!1);
217
221
  } catch (e) {
218
- q(h(e));
222
+ Z(_(e));
219
223
  }
220
- }, $ = a.isPending;
221
- return /* @__PURE__ */ P(ne, {
222
- open: e,
223
- onOpenChange: (e) => $ ? void 0 : n(e),
224
- children: /* @__PURE__ */ F(re, {
224
+ }, $ = u.isPending;
225
+ return /* @__PURE__ */ F(ne, {
226
+ open: n,
227
+ onOpenChange: (e) => $ ? void 0 : i(e),
228
+ children: /* @__PURE__ */ I(re, {
225
229
  className: "max-h-[92vh] overflow-y-auto sm:max-w-2xl",
226
230
  children: [
227
- /* @__PURE__ */ F(ie, { children: [/* @__PURE__ */ P(ae, { children: "Report a grievance" }), /* @__PURE__ */ P(B, { children: "Tell us what went wrong. We will route it to the right agency and track it to resolution." })] }),
228
- /* @__PURE__ */ F("div", {
231
+ /* @__PURE__ */ I(oe, { children: [/* @__PURE__ */ F(se, { children: "Report a grievance" }), /* @__PURE__ */ F(ie, { children: "Tell us what went wrong. We will route it to the right agency and track it to resolution." })] }),
232
+ /* @__PURE__ */ I("div", {
229
233
  className: "flex flex-col gap-4 py-2",
230
234
  children: [
231
- /* @__PURE__ */ F("div", {
235
+ /* @__PURE__ */ I("div", {
232
236
  className: "grid gap-4 sm:grid-cols-2",
233
- children: [/* @__PURE__ */ F("div", {
237
+ children: [/* @__PURE__ */ I("div", {
234
238
  className: "grid gap-1.5",
235
- children: [/* @__PURE__ */ F(z, {
239
+ children: [/* @__PURE__ */ I(B, {
236
240
  htmlFor: "g-title",
237
- children: ["Title ", /* @__PURE__ */ P("span", {
241
+ children: ["Title ", /* @__PURE__ */ F("span", {
238
242
  className: "text-status-error-text",
239
243
  children: "*"
240
244
  })]
241
- }), /* @__PURE__ */ P(R, {
245
+ }), /* @__PURE__ */ F(z, {
242
246
  id: "g-title",
243
- value: c,
244
- onChange: (e) => u(e.target.value),
247
+ value: h,
248
+ onChange: (e) => g(e.target.value),
245
249
  placeholder: "e.g. Broken street light on Main Road"
246
250
  })]
247
- }), /* @__PURE__ */ F("div", {
251
+ }), /* @__PURE__ */ I("div", {
248
252
  className: "grid gap-1.5",
249
- children: [/* @__PURE__ */ F(z, { children: ["Category ", /* @__PURE__ */ P("span", {
253
+ children: [/* @__PURE__ */ I(B, { children: ["Category ", /* @__PURE__ */ F("span", {
250
254
  className: "text-status-error-text",
251
255
  children: "*"
252
- })] }), /* @__PURE__ */ F(H, {
253
- value: _,
254
- onValueChange: (e) => b(e),
255
- children: [/* @__PURE__ */ P(G, {
256
+ })] }), /* @__PURE__ */ I(V, {
257
+ value: w,
258
+ onValueChange: (e) => T(e),
259
+ children: [/* @__PURE__ */ F(W, {
256
260
  "aria-label": "Category",
257
- children: /* @__PURE__ */ P(K, {})
258
- }), /* @__PURE__ */ P(U, { children: se.map((e) => /* @__PURE__ */ P(W, {
261
+ children: /* @__PURE__ */ F(G, {})
262
+ }), /* @__PURE__ */ F(H, { children: le.map((e) => /* @__PURE__ */ F(U, {
259
263
  value: e,
260
264
  children: r(e)
261
265
  }, e)) })]
262
266
  })]
263
267
  })]
264
268
  }),
265
- /* @__PURE__ */ F("div", {
269
+ /* @__PURE__ */ I("div", {
266
270
  className: "grid gap-4 sm:grid-cols-2",
267
- children: [/* @__PURE__ */ F("div", {
271
+ children: [/* @__PURE__ */ I("div", {
268
272
  className: "grid gap-1.5",
269
273
  children: [
270
- /* @__PURE__ */ F(z, {
274
+ /* @__PURE__ */ I(B, {
271
275
  htmlFor: "g-desc",
272
- children: ["Description ", /* @__PURE__ */ P("span", {
276
+ children: ["Description ", /* @__PURE__ */ F("span", {
273
277
  className: "text-status-error-text",
274
278
  children: "*"
275
279
  })]
276
280
  }),
277
- /* @__PURE__ */ P(oe, {
281
+ /* @__PURE__ */ F(ce, {
278
282
  id: "g-desc",
279
- value: p,
280
- onChange: (e) => m(e.target.value.slice(0, X)),
283
+ value: x,
284
+ onChange: (e) => C(e.target.value.slice(0, Y)),
281
285
  placeholder: "Provide details about the issue. Include when it happened, how often, and any other relevant information.",
282
286
  rows: 5
283
287
  }),
284
- /* @__PURE__ */ F("p", {
288
+ /* @__PURE__ */ I("p", {
285
289
  className: "text-right text-xs text-text-muted tabular-nums",
286
290
  children: [
287
- p.length,
291
+ x.length,
288
292
  " / ",
289
- X
293
+ Y
290
294
  ]
291
295
  })
292
296
  ]
293
- }), /* @__PURE__ */ F("div", {
297
+ }), /* @__PURE__ */ I("div", {
294
298
  className: "flex flex-col gap-4",
295
- children: [/* @__PURE__ */ F("div", {
299
+ children: [/* @__PURE__ */ I("div", {
296
300
  className: "grid gap-1.5",
297
- children: [/* @__PURE__ */ F(z, { children: ["Priority ", /* @__PURE__ */ P("span", {
301
+ children: [/* @__PURE__ */ I(B, { children: ["Priority ", /* @__PURE__ */ F("span", {
298
302
  className: "text-status-error-text",
299
303
  children: "*"
300
- })] }), /* @__PURE__ */ F(H, {
301
- value: S,
302
- onValueChange: (e) => C(e),
303
- children: [/* @__PURE__ */ P(G, {
304
+ })] }), /* @__PURE__ */ I(V, {
305
+ value: E,
306
+ onValueChange: (e) => D(e),
307
+ children: [/* @__PURE__ */ F(W, {
304
308
  "aria-label": "Priority",
305
- children: /* @__PURE__ */ P(K, {})
306
- }), /* @__PURE__ */ P(U, { children: ce.map((e) => /* @__PURE__ */ P(W, {
309
+ children: /* @__PURE__ */ F(G, {})
310
+ }), /* @__PURE__ */ F(H, { children: ue.map((e) => /* @__PURE__ */ F(U, {
307
311
  value: e,
308
312
  children: r(e)
309
313
  }, e)) })]
310
314
  })]
311
- }), /* @__PURE__ */ F("div", {
315
+ }), /* @__PURE__ */ I("div", {
312
316
  className: "grid gap-1.5",
313
- children: [/* @__PURE__ */ P(z, {
317
+ children: [/* @__PURE__ */ F(B, {
314
318
  htmlFor: "g-loc",
315
319
  children: "Location"
316
- }), /* @__PURE__ */ F("div", {
320
+ }), /* @__PURE__ */ I("div", {
317
321
  className: "relative",
318
- children: [/* @__PURE__ */ P(D, { className: "pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-text-muted" }), /* @__PURE__ */ P(R, {
322
+ children: [/* @__PURE__ */ F(O, { className: "pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-text-muted" }), /* @__PURE__ */ F(z, {
319
323
  id: "g-loc",
320
- value: w,
321
- onChange: (e) => T(e.target.value),
324
+ value: k,
325
+ onChange: (e) => j(e.target.value),
322
326
  placeholder: "Street, area, landmark",
323
327
  className: "pl-9"
324
328
  })]
@@ -326,92 +330,92 @@ function le({ open: e, onOpenChange: n, onReported: i }) {
326
330
  })]
327
331
  })]
328
332
  }),
329
- /* @__PURE__ */ F("div", {
333
+ /* @__PURE__ */ I("div", {
330
334
  className: "grid gap-1.5",
331
- children: [/* @__PURE__ */ P(z, { children: "Route to agency" }), /* @__PURE__ */ F(H, {
332
- value: E,
333
- onValueChange: O,
334
- children: [/* @__PURE__ */ P(G, {
335
+ children: [/* @__PURE__ */ F(B, { children: "Route to agency" }), /* @__PURE__ */ I(V, {
336
+ value: M,
337
+ onValueChange: N,
338
+ children: [/* @__PURE__ */ F(W, {
335
339
  "aria-label": "Agency",
336
- children: /* @__PURE__ */ P(K, { placeholder: "Auto-route to the right agency" })
337
- }), /* @__PURE__ */ P(U, { children: (o ?? []).map((e) => /* @__PURE__ */ P(W, {
340
+ children: /* @__PURE__ */ F(G, { placeholder: "Auto-route to the right agency" })
341
+ }), /* @__PURE__ */ F(H, { children: (m ?? []).map((e) => /* @__PURE__ */ F(U, {
338
342
  value: e.id,
339
343
  children: e.name
340
344
  }, e.id)) })]
341
345
  })]
342
346
  }),
343
- /* @__PURE__ */ F("div", {
347
+ /* @__PURE__ */ I("div", {
344
348
  className: "grid gap-1.5",
345
349
  children: [
346
- /* @__PURE__ */ P(z, { children: "Photos" }),
347
- /* @__PURE__ */ F("div", {
350
+ /* @__PURE__ */ F(B, { children: "Photos" }),
351
+ /* @__PURE__ */ I("div", {
348
352
  className: "flex flex-wrap gap-3",
349
- children: [A.map((e) => /* @__PURE__ */ F("div", {
353
+ children: [P.map((e) => /* @__PURE__ */ I("div", {
350
354
  className: "group relative size-24 overflow-hidden rounded-xl border border-border-seam bg-bg-sunken",
351
- children: [e.url ? /* @__PURE__ */ P("img", {
355
+ children: [e.url ? /* @__PURE__ */ F("img", {
352
356
  src: e.url,
353
357
  alt: e.name,
354
358
  className: "size-full object-cover",
355
359
  loading: "lazy"
356
- }) : /* @__PURE__ */ P("span", {
360
+ }) : /* @__PURE__ */ F("span", {
357
361
  className: "flex size-full items-center justify-center",
358
- children: /* @__PURE__ */ P(x, { className: "size-6 text-text-muted" })
359
- }), /* @__PURE__ */ P("button", {
362
+ children: /* @__PURE__ */ F(S, { className: "size-6 text-text-muted" })
363
+ }), /* @__PURE__ */ F("button", {
360
364
  type: "button",
361
- onClick: () => Z(e.id),
365
+ onClick: () => de(e.id),
362
366
  "aria-label": `Remove ${e.name}`,
363
367
  className: "absolute right-1 top-1 inline-flex size-6 items-center justify-center rounded-full bg-bg-canvas/80 text-text-primary backdrop-blur transition-colors hover:bg-bg-canvas focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
364
- children: /* @__PURE__ */ P(te, { className: "size-3.5" })
368
+ children: /* @__PURE__ */ F(te, { className: "size-3.5" })
365
369
  })]
366
- }, e.id)), A.length < Y && /* @__PURE__ */ F("label", {
367
- className: t("flex size-24 cursor-pointer flex-col items-center justify-center gap-1 rounded-xl border-2 border-dashed border-border-default text-text-secondary transition-colors hover:border-action-primary-bg hover:bg-[var(--color-accent-soft)]", M && "pointer-events-none opacity-60"),
370
+ }, e.id)), P.length < J && /* @__PURE__ */ I("label", {
371
+ className: t("flex size-24 cursor-pointer flex-col items-center justify-center gap-1 rounded-xl border-2 border-dashed border-border-default text-text-secondary transition-colors hover:border-action-primary-bg hover:bg-[var(--color-accent-soft)]", K && "pointer-events-none opacity-60"),
368
372
  children: [
369
- M ? /* @__PURE__ */ P(ee, { className: "size-5 animate-spin" }) : /* @__PURE__ */ P(x, { className: "size-5" }),
370
- /* @__PURE__ */ P("span", {
373
+ K ? /* @__PURE__ */ F(ee, { className: "size-5 animate-spin" }) : /* @__PURE__ */ F(S, { className: "size-5" }),
374
+ /* @__PURE__ */ F("span", {
371
375
  className: "text-xs font-medium",
372
- children: M ? "Uploading…" : "Add photo"
376
+ children: K ? "Uploading…" : "Add photo"
373
377
  }),
374
- /* @__PURE__ */ P("input", {
378
+ /* @__PURE__ */ F("input", {
375
379
  type: "file",
376
380
  accept: "image/*",
377
381
  className: "sr-only",
378
- onChange: (e) => void J(e),
379
- disabled: M
382
+ onChange: (e) => void Q(e),
383
+ disabled: K
380
384
  })
381
385
  ]
382
386
  })]
383
387
  }),
384
- /* @__PURE__ */ F("p", {
388
+ /* @__PURE__ */ I("p", {
385
389
  className: "text-xs text-text-muted",
386
390
  children: [
387
391
  "JPG or PNG. You can attach up to ",
388
- Y,
392
+ J,
389
393
  " photos."
390
394
  ]
391
395
  })
392
396
  ]
393
397
  }),
394
- L && /* @__PURE__ */ P("p", {
398
+ X && /* @__PURE__ */ F("p", {
395
399
  className: "text-sm text-status-error-text",
396
- children: L
400
+ children: X
397
401
  })
398
402
  ]
399
403
  }),
400
- /* @__PURE__ */ F(V, { children: [/* @__PURE__ */ P(I, {
404
+ /* @__PURE__ */ I(ae, { children: [/* @__PURE__ */ F(L, {
401
405
  variant: "outline",
402
- onClick: () => n(!1),
406
+ onClick: () => i(!1),
403
407
  disabled: $,
404
408
  children: "Cancel"
405
- }), /* @__PURE__ */ F(I, {
406
- onClick: Q,
407
- disabled: $ || M,
408
- children: [/* @__PURE__ */ P(k, { className: "mr-1.5 h-4 w-4" }), " Submit grievance"]
409
+ }), /* @__PURE__ */ I(L, {
410
+ onClick: fe,
411
+ disabled: $ || K,
412
+ children: [/* @__PURE__ */ F(A, { className: "mr-1.5 h-4 w-4" }), " Submit grievance"]
409
413
  })] })
410
414
  ]
411
415
  })
412
416
  });
413
417
  }
414
418
  //#endregion
415
- export { Q as CATEGORY_ICON, $ as GrievancesPage };
419
+ export { Z as CATEGORY_ICON, Q as GrievancesPage };
416
420
 
417
421
  //# sourceMappingURL=GrievancesPage.js.map