@burdenoff/microfe-ecoimpacthub 2026.720.4 → 2026.720.6
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/ecoimpacthub/EcoImpactHubAdminRoot.d.ts +10 -0
- package/dist/ecoimpacthub/EcoImpactHubAdminRoot.d.ts.map +1 -0
- package/dist/ecoimpacthub/EcoImpactHubAdminRoot.js +579 -0
- package/dist/ecoimpacthub/EcoImpactHubAdminRoot.js.map +1 -0
- package/dist/ecoimpacthub/components/DashboardCustomizerDialog.d.ts +11 -0
- package/dist/ecoimpacthub/components/DashboardCustomizerDialog.d.ts.map +1 -0
- package/dist/ecoimpacthub/components/DashboardCustomizerDialog.js +182 -0
- package/dist/ecoimpacthub/components/DashboardCustomizerDialog.js.map +1 -0
- package/dist/ecoimpacthub/hooks/index.d.ts +1 -0
- package/dist/ecoimpacthub/hooks/index.d.ts.map +1 -1
- package/dist/ecoimpacthub/hooks/index.js +1 -0
- package/dist/ecoimpacthub/hooks/useDashboardLayout.d.ts +29 -0
- package/dist/ecoimpacthub/hooks/useDashboardLayout.d.ts.map +1 -0
- package/dist/ecoimpacthub/hooks/useDashboardLayout.js +95 -0
- package/dist/ecoimpacthub/hooks/useDashboardLayout.js.map +1 -0
- package/dist/ecoimpacthub/index.d.ts +1 -0
- package/dist/ecoimpacthub/index.d.ts.map +1 -1
- package/dist/ecoimpacthub/index.js +1 -0
- package/dist/ecoimpacthub/pages/DashboardPage.d.ts +7 -0
- package/dist/ecoimpacthub/pages/DashboardPage.d.ts.map +1 -1
- package/dist/ecoimpacthub/pages/DashboardPage.js +505 -447
- package/dist/ecoimpacthub/pages/DashboardPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/carbon/CarbonPage.js +1 -1
- package/dist/ecoimpacthub/pages/habitat/HabitatProjectsPage.js +4 -4
- package/dist/ecoimpacthub/pages/monitoring/MonitoringPage.js +1 -1
- package/dist/ecoimpacthub/pages/reports/ReportsPage.js +4 -4
- package/dist/index.js +3 -2
- package/dist/stories/DashboardCustomizerDialog.stories.d.ts +9 -0
- package/dist/stories/DashboardCustomizerDialog.stories.d.ts.map +1 -0
- package/dist/stories/DataTable.stories.d.ts +11 -0
- package/dist/stories/DataTable.stories.d.ts.map +1 -0
- package/dist/stories/FeatureFlagGate.stories.d.ts +19 -0
- package/dist/stories/FeatureFlagGate.stories.d.ts.map +1 -0
- package/dist/stories/FilterTabs.stories.d.ts +9 -0
- package/dist/stories/FilterTabs.stories.d.ts.map +1 -0
- package/dist/stories/PageLayout.stories.d.ts +10 -0
- package/dist/stories/PageLayout.stories.d.ts.map +1 -0
- package/dist/stories/Pagination.stories.d.ts +11 -0
- package/dist/stories/Pagination.stories.d.ts.map +1 -0
- package/dist/stories/StateViews.stories.d.ts +10 -0
- package/dist/stories/StateViews.stories.d.ts.map +1 -0
- package/dist/stories/Tabs.stories.d.ts +9 -0
- package/dist/stories/Tabs.stories.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -3,32 +3,34 @@ import { Tooltip as t } from "../../node_modules/recharts/es6/component/Tooltip.
|
|
|
3
3
|
import { ResponsiveContainer as n } from "../../node_modules/recharts/es6/component/ResponsiveContainer.js";
|
|
4
4
|
import { Cell as r } from "../../node_modules/recharts/es6/component/Cell.js";
|
|
5
5
|
import { LabelList as i } from "../../node_modules/recharts/es6/component/LabelList.js";
|
|
6
|
-
import { Bar as
|
|
7
|
-
import { CartesianGrid as
|
|
8
|
-
import { XAxis as
|
|
9
|
-
import { YAxis as
|
|
10
|
-
import { BarChart as
|
|
11
|
-
import { PageLayout as
|
|
12
|
-
import { MetricsCard as
|
|
13
|
-
import { formatCo2e as
|
|
14
|
-
import { StatusBadge as
|
|
15
|
-
import { MiniBar as
|
|
16
|
-
import { LoadingView as
|
|
17
|
-
import { EmptyState as
|
|
18
|
-
import {
|
|
6
|
+
import { Bar as ee } from "../../node_modules/recharts/es6/cartesian/Bar.js";
|
|
7
|
+
import { CartesianGrid as te } from "../../node_modules/recharts/es6/cartesian/CartesianGrid.js";
|
|
8
|
+
import { XAxis as a } from "../../node_modules/recharts/es6/cartesian/XAxis.js";
|
|
9
|
+
import { YAxis as ne } from "../../node_modules/recharts/es6/cartesian/YAxis.js";
|
|
10
|
+
import { BarChart as re } from "../../node_modules/recharts/es6/chart/BarChart.js";
|
|
11
|
+
import { PageLayout as o } from "../components/PageLayout.js";
|
|
12
|
+
import { MetricsCard as s } from "../components/MetricsCard.js";
|
|
13
|
+
import { formatCo2e as c, formatEnumLabel as ie, formatNumber as l, formatPercent as ae, formatRelativeTime as u } from "../utils/formatters.js";
|
|
14
|
+
import { StatusBadge as d } from "../components/StatusBadge.js";
|
|
15
|
+
import { MiniBar as f } from "../components/MiniBar.js";
|
|
16
|
+
import { LoadingView as p, Section as m } from "../components/StateViews.js";
|
|
17
|
+
import { EmptyState as h } from "../components/EmptyState.js";
|
|
18
|
+
import { useDashboardLayout as oe } from "../hooks/useDashboardLayout.js";
|
|
19
|
+
import { DashboardCustomizerDialog as se } from "../components/DashboardCustomizerDialog.js";
|
|
20
|
+
import { Meter as ce, SCOPE_HUE as g, ScopeLegend as le, ScopeSplitBar as ue } from "./carbonVisuals.js";
|
|
19
21
|
import "../context/index.js";
|
|
20
|
-
import { useEcoCarbonTotals as
|
|
22
|
+
import { useEcoCarbonTotals as de, useEcoHabitatProjects as fe, useEcoMeasurements as pe, useEcoObservations as me, useEcoSensors as he, useEcoSites as ge, useEcoSpecies as _e } from "../hooks/useEcoImpactHubApi.js";
|
|
21
23
|
import "../hooks/index.js";
|
|
22
|
-
import { useMemo as
|
|
23
|
-
import { ArrowRight as
|
|
24
|
-
import { Fragment as
|
|
25
|
-
import { GlassCard as
|
|
24
|
+
import { useMemo as ve, useState as ye } from "react";
|
|
25
|
+
import { ArrowRight as _, Binoculars as v, Factory as y, LayoutGrid as be, MapPin as xe, PawPrint as Se, Radio as Ce, ShieldCheck as we, StickyNote as Te, Trees as Ee, TriangleAlert as De } from "lucide-react";
|
|
26
|
+
import { Fragment as Oe, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
27
|
+
import { Button as S, GlassCard as C } from "@burdenoff/fe-libs/ui";
|
|
26
28
|
//#region src/ecoimpacthub/pages/DashboardPage.tsx
|
|
27
|
-
var
|
|
29
|
+
var w = new Set([
|
|
28
30
|
"PLANNED",
|
|
29
31
|
"IN_PROGRESS",
|
|
30
32
|
"MONITORING"
|
|
31
|
-
]),
|
|
33
|
+
]), T = {
|
|
32
34
|
LEAST_CONCERN: "var(--color-status-success-text)",
|
|
33
35
|
NEAR_THREATENED: "var(--color-accent-teal)",
|
|
34
36
|
VULNERABLE: "var(--color-status-warning-text)",
|
|
@@ -38,32 +40,32 @@ var N = new Set([
|
|
|
38
40
|
DATA_DEFICIENT: "var(--color-text-tertiary)",
|
|
39
41
|
NOT_EVALUATED: "var(--color-text-tertiary)"
|
|
40
42
|
};
|
|
41
|
-
function
|
|
42
|
-
let { navigateTo:
|
|
43
|
+
function E() {
|
|
44
|
+
let { navigateTo: E, currentUser: D, workspaceId: ke } = e(), [Ae, O] = ye(!1), k = oe(ke, D?.id), A = ge({ pagination: {
|
|
43
45
|
limit: 100,
|
|
44
46
|
offset: 0
|
|
45
|
-
} }),
|
|
47
|
+
} }), j = _e({ pagination: {
|
|
46
48
|
limit: 100,
|
|
47
49
|
offset: 0
|
|
48
|
-
} }),
|
|
50
|
+
} }), M = fe(), N = de(), P = pe({
|
|
49
51
|
breachesOnly: !0,
|
|
50
52
|
pagination: {
|
|
51
53
|
limit: 6,
|
|
52
54
|
offset: 0
|
|
53
55
|
}
|
|
54
|
-
}),
|
|
56
|
+
}), je = me({ pagination: {
|
|
55
57
|
limit: 6,
|
|
56
58
|
offset: 0
|
|
57
|
-
} }),
|
|
59
|
+
} }), Me = he(), F = A.data?.items ?? [], I = j.data?.items ?? [], L = M.data?.items ?? [], R = Me.data?.items ?? [], z = F.filter((e) => e.status === "ACTIVE").length, Ne = I.filter((e) => e.isPriority).length, B = I.filter((e) => [
|
|
58
60
|
"VULNERABLE",
|
|
59
61
|
"ENDANGERED",
|
|
60
62
|
"CRITICALLY_ENDANGERED"
|
|
61
|
-
].includes(e.conservationStatus)).length,
|
|
63
|
+
].includes(e.conservationStatus)).length, V = L.filter((e) => w.has(e.status)).length, H = R.filter((e) => e.status === "ONLINE").length, U = R.filter((e) => [
|
|
62
64
|
"OFFLINE",
|
|
63
65
|
"DEGRADED",
|
|
64
66
|
"MAINTENANCE"
|
|
65
|
-
].includes(e.status)).length,
|
|
66
|
-
let e =
|
|
67
|
+
].includes(e.status)).length, W = ve(() => {
|
|
68
|
+
let e = N.data;
|
|
67
69
|
return e ? [
|
|
68
70
|
{
|
|
69
71
|
scope: "SCOPE_1",
|
|
@@ -81,450 +83,506 @@ function F() {
|
|
|
81
83
|
kg: e.scope3
|
|
82
84
|
}
|
|
83
85
|
] : [];
|
|
84
|
-
}, [
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
children: /* @__PURE__ */
|
|
86
|
+
}, [N.data]), Pe = A.isLoading && j.isLoading && M.isLoading && N.isLoading, G = /* @__PURE__ */ x(S, {
|
|
87
|
+
type: "button",
|
|
88
|
+
variant: "outline",
|
|
89
|
+
size: "sm",
|
|
90
|
+
onClick: () => O(!0),
|
|
91
|
+
children: [/* @__PURE__ */ b(be, { className: "mr-1.5 h-3.5 w-3.5" }), "Customize dashboard"]
|
|
90
92
|
});
|
|
91
|
-
|
|
92
|
-
return /* @__PURE__ */ j(c, {
|
|
93
|
+
if (Pe) return /* @__PURE__ */ b(o, {
|
|
93
94
|
title: "EcoImpactHub",
|
|
94
95
|
titleGradient: !0,
|
|
95
96
|
aurora: !0,
|
|
96
|
-
|
|
97
|
+
actions: G,
|
|
98
|
+
children: /* @__PURE__ */ b(p, { label: "Loading your impact overview…" })
|
|
99
|
+
});
|
|
100
|
+
let Fe = D?.firstName || D?.name || "there", K = P.data?.items ?? [], q = je.data?.items ?? [], J = /* @__PURE__ */ x("div", {
|
|
101
|
+
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6",
|
|
97
102
|
children: [
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
className: "
|
|
133
|
-
children:
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
className: "
|
|
161
|
-
children:
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
103
|
+
/* @__PURE__ */ b(s, {
|
|
104
|
+
icon: /* @__PURE__ */ b(xe, { className: "h-5 w-5" }),
|
|
105
|
+
value: A.data?.pageInfo?.hasMore ? `${F.length}+` : l(F.length),
|
|
106
|
+
label: "Monitored sites",
|
|
107
|
+
footer: /* @__PURE__ */ x("div", {
|
|
108
|
+
className: "space-y-2",
|
|
109
|
+
children: [/* @__PURE__ */ b(f, {
|
|
110
|
+
value: F.length ? z / F.length * 100 : 0,
|
|
111
|
+
height: 4,
|
|
112
|
+
barClassName: "bg-action-primary-bg"
|
|
113
|
+
}), /* @__PURE__ */ x("p", {
|
|
114
|
+
className: "text-xs text-text-tertiary",
|
|
115
|
+
children: [/* @__PURE__ */ b("span", {
|
|
116
|
+
className: "tabular-nums text-text-secondary",
|
|
117
|
+
children: z
|
|
118
|
+
}), " active"]
|
|
119
|
+
})]
|
|
120
|
+
})
|
|
121
|
+
}),
|
|
122
|
+
/* @__PURE__ */ b(s, {
|
|
123
|
+
icon: /* @__PURE__ */ b(Se, { className: "h-5 w-5" }),
|
|
124
|
+
value: j.data?.pageInfo?.hasMore ? `${I.length}+` : l(I.length),
|
|
125
|
+
label: "Species tracked",
|
|
126
|
+
accent: B > 0 ? "warning" : void 0,
|
|
127
|
+
footer: /* @__PURE__ */ x("div", {
|
|
128
|
+
className: "space-y-2",
|
|
129
|
+
children: [/* @__PURE__ */ b(f, {
|
|
130
|
+
value: I.length ? B / I.length * 100 : 0,
|
|
131
|
+
height: 4,
|
|
132
|
+
barClassName: "bg-status-warning-text"
|
|
133
|
+
}), /* @__PURE__ */ x("p", {
|
|
134
|
+
className: "text-xs text-text-tertiary",
|
|
135
|
+
children: [
|
|
136
|
+
/* @__PURE__ */ b("span", {
|
|
137
|
+
className: "tabular-nums text-text-secondary",
|
|
138
|
+
children: Ne
|
|
139
|
+
}),
|
|
140
|
+
" priority ·",
|
|
141
|
+
" ",
|
|
142
|
+
/* @__PURE__ */ b("span", {
|
|
143
|
+
className: "tabular-nums text-text-secondary",
|
|
144
|
+
children: B
|
|
145
|
+
}),
|
|
146
|
+
" threatened"
|
|
147
|
+
]
|
|
148
|
+
})]
|
|
149
|
+
})
|
|
150
|
+
}),
|
|
151
|
+
/* @__PURE__ */ b(s, {
|
|
152
|
+
icon: /* @__PURE__ */ b(Ee, { className: "h-5 w-5" }),
|
|
153
|
+
value: l(V),
|
|
154
|
+
label: "Active habitat projects",
|
|
155
|
+
footer: /* @__PURE__ */ x("div", {
|
|
156
|
+
className: "space-y-2",
|
|
157
|
+
children: [/* @__PURE__ */ b(f, {
|
|
158
|
+
value: L.length ? V / L.length * 100 : 0,
|
|
159
|
+
height: 4,
|
|
160
|
+
barClassName: "bg-action-primary-bg"
|
|
161
|
+
}), /* @__PURE__ */ x("p", {
|
|
162
|
+
className: "text-xs text-text-tertiary",
|
|
163
|
+
children: [
|
|
164
|
+
/* @__PURE__ */ b("span", {
|
|
165
|
+
className: "tabular-nums text-text-secondary",
|
|
166
|
+
children: l(L.length)
|
|
167
|
+
}),
|
|
168
|
+
" ",
|
|
169
|
+
"total"
|
|
170
|
+
]
|
|
171
|
+
})]
|
|
172
|
+
})
|
|
173
|
+
}),
|
|
174
|
+
/* @__PURE__ */ b(s, {
|
|
175
|
+
icon: /* @__PURE__ */ b(y, { className: "h-5 w-5" }),
|
|
176
|
+
value: N.data ? c(N.data.total) : "—",
|
|
177
|
+
label: "Total footprint",
|
|
178
|
+
featured: !0,
|
|
179
|
+
footer: N.data && N.data.total > 0 ? /* @__PURE__ */ x("div", {
|
|
180
|
+
className: "space-y-2",
|
|
181
|
+
children: [/* @__PURE__ */ b(ue, {
|
|
182
|
+
scope1: N.data.scope1,
|
|
183
|
+
scope2: N.data.scope2,
|
|
184
|
+
scope3: N.data.scope3,
|
|
185
|
+
height: 6
|
|
186
|
+
}), /* @__PURE__ */ b("p", {
|
|
187
|
+
className: "text-xs text-text-tertiary",
|
|
188
|
+
children: "Scope 1 · 2 · 3 split"
|
|
189
|
+
})]
|
|
190
|
+
}) : void 0
|
|
191
|
+
}),
|
|
192
|
+
/* @__PURE__ */ b(s, {
|
|
193
|
+
icon: /* @__PURE__ */ b(Ce, { className: "h-5 w-5" }),
|
|
194
|
+
value: l(H),
|
|
195
|
+
label: "Sensors online",
|
|
196
|
+
accent: U > 0 ? "warning" : "success",
|
|
197
|
+
footer: /* @__PURE__ */ x("div", {
|
|
198
|
+
className: "space-y-2",
|
|
199
|
+
children: [/* @__PURE__ */ b(f, {
|
|
200
|
+
value: R.length ? H / R.length * 100 : 0,
|
|
201
|
+
height: 4,
|
|
202
|
+
barClassName: "bg-status-success-text"
|
|
203
|
+
}), /* @__PURE__ */ x("p", {
|
|
204
|
+
className: "text-xs text-text-tertiary",
|
|
205
|
+
children: [/* @__PURE__ */ b("span", {
|
|
206
|
+
className: "tabular-nums text-text-secondary",
|
|
207
|
+
children: U
|
|
208
|
+
}), " need attention"]
|
|
209
|
+
})]
|
|
210
|
+
})
|
|
211
|
+
}),
|
|
212
|
+
/* @__PURE__ */ b(s, {
|
|
213
|
+
icon: /* @__PURE__ */ b(De, { className: "h-5 w-5" }),
|
|
214
|
+
value: P.data?.pageInfo?.hasMore ? `${K.length}+` : l(K.length),
|
|
215
|
+
label: "Open breaches",
|
|
216
|
+
accent: K.length > 0 ? "error" : "success",
|
|
217
|
+
footer: /* @__PURE__ */ b("p", {
|
|
218
|
+
className: K.length > 0 ? "text-xs font-medium text-status-error-text" : "text-xs text-text-tertiary",
|
|
219
|
+
children: K.length > 0 ? "Needs attention" : "All parameters in range"
|
|
220
|
+
})
|
|
221
|
+
})
|
|
222
|
+
]
|
|
223
|
+
}), Y = /* @__PURE__ */ x(C, {
|
|
224
|
+
treatment: "glass",
|
|
225
|
+
className: "p-6 h-full",
|
|
226
|
+
children: [/* @__PURE__ */ x("div", {
|
|
227
|
+
className: "mb-4 flex flex-wrap items-start justify-between gap-3",
|
|
228
|
+
children: [/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("h2", {
|
|
229
|
+
className: "text-base font-semibold text-text-primary",
|
|
230
|
+
children: "Carbon footprint by scope"
|
|
231
|
+
}), /* @__PURE__ */ b("p", {
|
|
232
|
+
className: "mt-0.5 text-sm text-text-secondary",
|
|
233
|
+
children: "GHG Protocol Scope 1 / 2 / 3 emissions (CO₂e)."
|
|
234
|
+
})] }), /* @__PURE__ */ x("div", {
|
|
235
|
+
className: "flex items-center gap-4",
|
|
236
|
+
children: [N.data && N.data.total > 0 && /* @__PURE__ */ x("div", {
|
|
237
|
+
className: "text-right",
|
|
238
|
+
children: [/* @__PURE__ */ b("p", {
|
|
239
|
+
className: "text-lg font-semibold tabular-nums text-text-primary",
|
|
240
|
+
children: c(N.data.total)
|
|
241
|
+
}), /* @__PURE__ */ b("p", {
|
|
242
|
+
className: "text-xs text-text-tertiary",
|
|
243
|
+
children: "total"
|
|
244
|
+
})]
|
|
245
|
+
}), /* @__PURE__ */ x("button", {
|
|
246
|
+
type: "button",
|
|
247
|
+
onClick: () => E("carbon"),
|
|
248
|
+
className: "inline-flex items-center gap-1 text-sm font-medium text-accent hover:underline",
|
|
249
|
+
children: ["Ledger ", /* @__PURE__ */ b(_, { className: "h-4 w-4" })]
|
|
250
|
+
})]
|
|
251
|
+
})]
|
|
252
|
+
}), W.every((e) => e.kg === 0) ? /* @__PURE__ */ b(h, {
|
|
253
|
+
illustration: "empty-data",
|
|
254
|
+
icon: /* @__PURE__ */ b(y, { className: "h-10 w-10" }),
|
|
255
|
+
title: "No carbon entries yet",
|
|
256
|
+
description: "Record activity in the carbon ledger to see your Scope 1–3 footprint here."
|
|
257
|
+
}) : /* @__PURE__ */ x(Oe, { children: [/* @__PURE__ */ b("div", {
|
|
258
|
+
className: "h-56",
|
|
259
|
+
children: /* @__PURE__ */ b(n, {
|
|
260
|
+
width: "100%",
|
|
261
|
+
height: "100%",
|
|
262
|
+
children: /* @__PURE__ */ x(re, {
|
|
263
|
+
data: W,
|
|
264
|
+
margin: {
|
|
265
|
+
top: 20,
|
|
266
|
+
right: 8,
|
|
267
|
+
left: 8,
|
|
268
|
+
bottom: 0
|
|
269
|
+
},
|
|
270
|
+
children: [
|
|
271
|
+
/* @__PURE__ */ b("defs", { children: W.map((e) => /* @__PURE__ */ x("linearGradient", {
|
|
272
|
+
id: `ecoScopeGrad-${e.scope}`,
|
|
273
|
+
x1: "0",
|
|
274
|
+
y1: "0",
|
|
275
|
+
x2: "0",
|
|
276
|
+
y2: "1",
|
|
277
|
+
children: [/* @__PURE__ */ b("stop", {
|
|
278
|
+
offset: "0%",
|
|
279
|
+
style: {
|
|
280
|
+
stopColor: g[e.scope],
|
|
281
|
+
stopOpacity: 1
|
|
282
|
+
}
|
|
283
|
+
}), /* @__PURE__ */ b("stop", {
|
|
284
|
+
offset: "100%",
|
|
285
|
+
style: {
|
|
286
|
+
stopColor: g[e.scope],
|
|
287
|
+
stopOpacity: .55
|
|
288
|
+
}
|
|
187
289
|
})]
|
|
188
|
-
})
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
290
|
+
}, e.scope)) }),
|
|
291
|
+
/* @__PURE__ */ b(te, {
|
|
292
|
+
vertical: !1,
|
|
293
|
+
stroke: "var(--color-border-seam)",
|
|
294
|
+
strokeOpacity: .6,
|
|
295
|
+
strokeDasharray: "3 4"
|
|
296
|
+
}),
|
|
297
|
+
/* @__PURE__ */ b(a, {
|
|
298
|
+
dataKey: "label",
|
|
299
|
+
tick: {
|
|
300
|
+
fill: "var(--color-text-secondary)",
|
|
301
|
+
fontSize: 12
|
|
302
|
+
},
|
|
303
|
+
axisLine: { stroke: "var(--color-border-seam)" },
|
|
304
|
+
tickLine: !1,
|
|
305
|
+
dy: 4
|
|
306
|
+
}),
|
|
307
|
+
/* @__PURE__ */ b(ne, {
|
|
308
|
+
tick: {
|
|
309
|
+
fill: "var(--color-text-tertiary)",
|
|
310
|
+
fontSize: 11
|
|
311
|
+
},
|
|
312
|
+
axisLine: !1,
|
|
313
|
+
tickLine: !1,
|
|
314
|
+
width: 48,
|
|
315
|
+
tickFormatter: (e) => e >= 1e3 ? `${Math.round(e / 1e3)}t` : `${e}`
|
|
316
|
+
}),
|
|
317
|
+
/* @__PURE__ */ b(t, {
|
|
318
|
+
cursor: {
|
|
319
|
+
fill: "var(--color-bg-sunken)",
|
|
320
|
+
opacity: .4
|
|
321
|
+
},
|
|
322
|
+
contentStyle: {
|
|
323
|
+
background: "var(--color-bg-surface)",
|
|
324
|
+
border: "1px solid var(--color-border-seam)",
|
|
325
|
+
borderRadius: 12,
|
|
326
|
+
color: "var(--color-text-primary)"
|
|
327
|
+
},
|
|
328
|
+
formatter: (e) => [c(e), "Emissions"]
|
|
329
|
+
}),
|
|
330
|
+
/* @__PURE__ */ x(ee, {
|
|
331
|
+
dataKey: "kg",
|
|
332
|
+
radius: [
|
|
333
|
+
8,
|
|
334
|
+
8,
|
|
335
|
+
2,
|
|
336
|
+
2
|
|
337
|
+
],
|
|
338
|
+
maxBarSize: 72,
|
|
339
|
+
children: [W.map((e) => /* @__PURE__ */ b(r, { fill: `url(#ecoScopeGrad-${e.scope})` }, e.scope)), /* @__PURE__ */ b(i, {
|
|
340
|
+
dataKey: "kg",
|
|
341
|
+
position: "top",
|
|
342
|
+
formatter: (e) => e > 0 ? c(e) : "",
|
|
343
|
+
style: {
|
|
344
|
+
fill: "var(--color-text-secondary)",
|
|
345
|
+
fontSize: 11,
|
|
346
|
+
fontWeight: 600
|
|
347
|
+
}
|
|
207
348
|
})]
|
|
208
349
|
})
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
350
|
+
]
|
|
351
|
+
})
|
|
352
|
+
})
|
|
353
|
+
}), /* @__PURE__ */ b(le, {
|
|
354
|
+
data: W,
|
|
355
|
+
className: "mt-4 border-t border-border-seam pt-4"
|
|
356
|
+
})] })]
|
|
357
|
+
}), X = /* @__PURE__ */ x(C, {
|
|
358
|
+
treatment: "glass",
|
|
359
|
+
className: "p-6 h-full",
|
|
360
|
+
children: [/* @__PURE__ */ x("div", {
|
|
361
|
+
className: "mb-4 flex items-center justify-between gap-3",
|
|
362
|
+
children: [/* @__PURE__ */ x("div", {
|
|
363
|
+
className: "flex items-center gap-2",
|
|
364
|
+
children: [/* @__PURE__ */ b("h2", {
|
|
365
|
+
className: "text-base font-semibold text-text-primary",
|
|
366
|
+
children: "Recent breaches"
|
|
367
|
+
}), K.length > 0 && /* @__PURE__ */ b("span", {
|
|
368
|
+
className: "rounded-full bg-status-error-bg-subtle px-2 py-0.5 text-xs font-medium tabular-nums text-status-error-text",
|
|
369
|
+
children: P.data?.pageInfo?.hasMore ? `${K.length}+` : K.length
|
|
370
|
+
})]
|
|
371
|
+
}), /* @__PURE__ */ x("button", {
|
|
372
|
+
type: "button",
|
|
373
|
+
onClick: () => E("monitoring"),
|
|
374
|
+
className: "inline-flex items-center gap-1 text-sm font-medium text-accent hover:underline",
|
|
375
|
+
children: ["Monitoring ", /* @__PURE__ */ b(_, { className: "h-4 w-4" })]
|
|
376
|
+
})]
|
|
377
|
+
}), K.length === 0 ? /* @__PURE__ */ x("div", {
|
|
378
|
+
className: "flex flex-col items-center justify-center rounded-xl border border-dashed border-border-seam py-10 text-center",
|
|
379
|
+
children: [
|
|
380
|
+
/* @__PURE__ */ b("span", {
|
|
381
|
+
className: "flex size-12 items-center justify-center rounded-full bg-status-success-bg-subtle",
|
|
382
|
+
children: /* @__PURE__ */ b(we, { className: "h-6 w-6 text-status-success-text" })
|
|
383
|
+
}),
|
|
384
|
+
/* @__PURE__ */ b("p", {
|
|
385
|
+
className: "mt-3 text-sm font-medium text-text-primary",
|
|
386
|
+
children: "All parameters in range"
|
|
387
|
+
}),
|
|
388
|
+
/* @__PURE__ */ b("p", {
|
|
389
|
+
className: "mt-1 text-xs text-text-tertiary",
|
|
390
|
+
children: "No open threshold breaches."
|
|
391
|
+
})
|
|
392
|
+
]
|
|
393
|
+
}) : /* @__PURE__ */ b("ul", {
|
|
394
|
+
className: "space-y-2.5",
|
|
395
|
+
children: K.map((e) => /* @__PURE__ */ x("li", {
|
|
396
|
+
className: "flex items-start justify-between gap-3 rounded-xl bg-bg-sunken/50 p-3",
|
|
397
|
+
children: [/* @__PURE__ */ x("div", {
|
|
398
|
+
className: "flex min-w-0 items-start gap-2.5",
|
|
399
|
+
children: [/* @__PURE__ */ b("span", {
|
|
400
|
+
"aria-hidden": "true",
|
|
401
|
+
className: "mt-1.5 size-2 shrink-0 rounded-full bg-status-error-text motion-safe:animate-vc-glow-pulse"
|
|
402
|
+
}), /* @__PURE__ */ x("div", {
|
|
403
|
+
className: "min-w-0",
|
|
404
|
+
children: [/* @__PURE__ */ b("p", {
|
|
405
|
+
className: "truncate text-sm font-medium text-text-primary",
|
|
406
|
+
children: e.parameter
|
|
407
|
+
}), /* @__PURE__ */ x("p", {
|
|
408
|
+
className: "text-xs text-text-tertiary",
|
|
409
|
+
children: [
|
|
410
|
+
/* @__PURE__ */ x("span", {
|
|
411
|
+
className: "tabular-nums",
|
|
412
|
+
children: [
|
|
413
|
+
l(e.value),
|
|
414
|
+
" ",
|
|
415
|
+
e.unit
|
|
416
|
+
]
|
|
417
|
+
}),
|
|
418
|
+
" ",
|
|
419
|
+
"· ",
|
|
420
|
+
u(e.recordedAt)
|
|
421
|
+
]
|
|
422
|
+
})]
|
|
423
|
+
})]
|
|
424
|
+
}), /* @__PURE__ */ b(d, { status: "BREACH" })]
|
|
425
|
+
}, e.id))
|
|
426
|
+
})]
|
|
427
|
+
}), Z = {
|
|
428
|
+
kpis: J,
|
|
429
|
+
carbonByScope: Y,
|
|
430
|
+
recentBreaches: X,
|
|
431
|
+
recentObservations: /* @__PURE__ */ b(m, {
|
|
432
|
+
title: "Recent field observations",
|
|
433
|
+
description: "Latest wildlife & biodiversity sightings recorded across your sites.",
|
|
434
|
+
action: /* @__PURE__ */ x("button", {
|
|
435
|
+
type: "button",
|
|
436
|
+
onClick: () => E("observations"),
|
|
437
|
+
className: "inline-flex items-center gap-1 text-sm font-medium text-accent hover:underline",
|
|
438
|
+
children: ["All observations ", /* @__PURE__ */ b(_, { className: "h-4 w-4" })]
|
|
221
439
|
}),
|
|
222
|
-
/* @__PURE__ */
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
className: "
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
440
|
+
children: q.length === 0 ? /* @__PURE__ */ b(h, {
|
|
441
|
+
illustration: "empty-data",
|
|
442
|
+
icon: /* @__PURE__ */ b(v, { className: "h-10 w-10" }),
|
|
443
|
+
title: "No observations yet",
|
|
444
|
+
description: "Record your first field observation to build your biodiversity dataset."
|
|
445
|
+
}) : /* @__PURE__ */ b("div", {
|
|
446
|
+
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
447
|
+
children: q.map((e) => /* @__PURE__ */ x(C, {
|
|
448
|
+
treatment: "plain",
|
|
449
|
+
className: "p-4 transition-shadow hover:shadow-float",
|
|
450
|
+
children: [/* @__PURE__ */ x("div", {
|
|
451
|
+
className: "flex items-start justify-between gap-2",
|
|
452
|
+
children: [/* @__PURE__ */ x("div", {
|
|
453
|
+
className: "flex min-w-0 items-start gap-2.5",
|
|
454
|
+
children: [/* @__PURE__ */ b("span", {
|
|
455
|
+
className: "mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-accent",
|
|
456
|
+
children: /* @__PURE__ */ b(v, { className: "h-4 w-4" })
|
|
457
|
+
}), /* @__PURE__ */ x("div", {
|
|
458
|
+
className: "min-w-0",
|
|
459
|
+
children: [/* @__PURE__ */ b("p", {
|
|
460
|
+
className: "truncate text-sm font-semibold text-text-primary",
|
|
461
|
+
children: e.species?.commonName ?? "Unknown species"
|
|
462
|
+
}), e.species?.scientificName && /* @__PURE__ */ b("p", {
|
|
463
|
+
className: "truncate text-xs italic text-text-tertiary",
|
|
464
|
+
children: e.species.scientificName
|
|
245
465
|
})]
|
|
246
|
-
}), /* @__PURE__ */ j("button", {
|
|
247
|
-
type: "button",
|
|
248
|
-
onClick: () => F("carbon"),
|
|
249
|
-
className: "inline-flex items-center gap-1 text-sm font-medium text-accent hover:underline",
|
|
250
|
-
children: ["Ledger ", /* @__PURE__ */ A(T, { className: "h-4 w-4" })]
|
|
251
466
|
})]
|
|
467
|
+
}), /* @__PURE__ */ x("span", {
|
|
468
|
+
className: "shrink-0 rounded-full bg-[var(--color-accent-soft)] px-2 py-0.5 text-xs font-medium tabular-nums text-text-primary",
|
|
469
|
+
children: ["×", l(e.count)]
|
|
470
|
+
})]
|
|
471
|
+
}), /* @__PURE__ */ x("div", {
|
|
472
|
+
className: "mt-3 flex items-center justify-between border-t border-border-seam/70 pt-2.5",
|
|
473
|
+
children: [/* @__PURE__ */ b("span", {
|
|
474
|
+
className: "rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-text-secondary",
|
|
475
|
+
children: ie(e.method)
|
|
476
|
+
}), /* @__PURE__ */ b("span", {
|
|
477
|
+
className: "text-xs text-text-tertiary",
|
|
478
|
+
children: u(e.observedAt)
|
|
252
479
|
})]
|
|
253
|
-
})
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
480
|
+
})]
|
|
481
|
+
}, e.id))
|
|
482
|
+
})
|
|
483
|
+
}),
|
|
484
|
+
conservationStatus: I.length > 0 ? /* @__PURE__ */ b(m, {
|
|
485
|
+
title: "Conservation status",
|
|
486
|
+
description: "Distribution of tracked species by IUCN-style status.",
|
|
487
|
+
children: /* @__PURE__ */ b(C, {
|
|
488
|
+
treatment: "plain",
|
|
489
|
+
className: "p-6",
|
|
490
|
+
children: /* @__PURE__ */ b("div", {
|
|
491
|
+
className: "space-y-3.5",
|
|
492
|
+
children: (() => {
|
|
493
|
+
let e = /* @__PURE__ */ new Map();
|
|
494
|
+
for (let t of I) e.set(t.conservationStatus, (e.get(t.conservationStatus) ?? 0) + 1);
|
|
495
|
+
let t = I.length;
|
|
496
|
+
return [...e.entries()].sort((e, t) => t[1] - e[1]).map(([e, n]) => {
|
|
497
|
+
let r = n / t * 100, i = T[e] ?? "var(--color-text-tertiary)";
|
|
498
|
+
return /* @__PURE__ */ x("div", {
|
|
499
|
+
className: "flex items-center gap-3 sm:gap-4",
|
|
271
500
|
children: [
|
|
272
|
-
/* @__PURE__ */
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
y1: "0",
|
|
276
|
-
x2: "0",
|
|
277
|
-
y2: "1",
|
|
278
|
-
children: [/* @__PURE__ */ A("stop", {
|
|
279
|
-
offset: "0%",
|
|
280
|
-
style: {
|
|
281
|
-
stopColor: y[e.scope],
|
|
282
|
-
stopOpacity: 1
|
|
283
|
-
}
|
|
284
|
-
}), /* @__PURE__ */ A("stop", {
|
|
285
|
-
offset: "100%",
|
|
286
|
-
style: {
|
|
287
|
-
stopColor: y[e.scope],
|
|
288
|
-
stopOpacity: .55
|
|
289
|
-
}
|
|
290
|
-
})]
|
|
291
|
-
}, e.scope)) }),
|
|
292
|
-
/* @__PURE__ */ A(o, {
|
|
293
|
-
vertical: !1,
|
|
294
|
-
stroke: "var(--color-border-seam)",
|
|
295
|
-
strokeOpacity: .6,
|
|
296
|
-
strokeDasharray: "3 4"
|
|
297
|
-
}),
|
|
298
|
-
/* @__PURE__ */ A(s, {
|
|
299
|
-
dataKey: "label",
|
|
300
|
-
tick: {
|
|
301
|
-
fill: "var(--color-text-secondary)",
|
|
302
|
-
fontSize: 12
|
|
303
|
-
},
|
|
304
|
-
axisLine: { stroke: "var(--color-border-seam)" },
|
|
305
|
-
tickLine: !1,
|
|
306
|
-
dy: 4
|
|
501
|
+
/* @__PURE__ */ b("div", {
|
|
502
|
+
className: "w-36 shrink-0 sm:w-48",
|
|
503
|
+
children: /* @__PURE__ */ b(d, { status: e })
|
|
307
504
|
}),
|
|
308
|
-
/* @__PURE__ */
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
},
|
|
313
|
-
axisLine: !1,
|
|
314
|
-
tickLine: !1,
|
|
315
|
-
width: 48,
|
|
316
|
-
tickFormatter: (e) => e >= 1e3 ? `${Math.round(e / 1e3)}t` : `${e}`
|
|
505
|
+
/* @__PURE__ */ b(ce, {
|
|
506
|
+
value: r,
|
|
507
|
+
color: i,
|
|
508
|
+
className: "flex-1"
|
|
317
509
|
}),
|
|
318
|
-
/* @__PURE__ */
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
opacity: .4
|
|
322
|
-
},
|
|
323
|
-
contentStyle: {
|
|
324
|
-
background: "var(--color-bg-surface)",
|
|
325
|
-
border: "1px solid var(--color-border-seam)",
|
|
326
|
-
borderRadius: 12,
|
|
327
|
-
color: "var(--color-text-primary)"
|
|
328
|
-
},
|
|
329
|
-
formatter: (e) => [u(e), "Emissions"]
|
|
510
|
+
/* @__PURE__ */ b("span", {
|
|
511
|
+
className: "w-9 shrink-0 text-right text-sm font-medium tabular-nums text-text-primary",
|
|
512
|
+
children: n
|
|
330
513
|
}),
|
|
331
|
-
/* @__PURE__ */
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
8,
|
|
335
|
-
8,
|
|
336
|
-
2,
|
|
337
|
-
2
|
|
338
|
-
],
|
|
339
|
-
maxBarSize: 72,
|
|
340
|
-
children: [Z.map((e) => /* @__PURE__ */ A(r, { fill: `url(#ecoScopeGrad-${e.scope})` }, e.scope)), /* @__PURE__ */ A(i, {
|
|
341
|
-
dataKey: "kg",
|
|
342
|
-
position: "top",
|
|
343
|
-
formatter: (e) => e > 0 ? u(e) : "",
|
|
344
|
-
style: {
|
|
345
|
-
fill: "var(--color-text-secondary)",
|
|
346
|
-
fontSize: 11,
|
|
347
|
-
fontWeight: 600
|
|
348
|
-
}
|
|
349
|
-
})]
|
|
514
|
+
/* @__PURE__ */ b("span", {
|
|
515
|
+
className: "hidden w-12 shrink-0 text-right text-xs tabular-nums text-text-tertiary sm:inline",
|
|
516
|
+
children: ae(r)
|
|
350
517
|
})
|
|
351
518
|
]
|
|
352
|
-
})
|
|
353
|
-
})
|
|
354
|
-
})
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
children: "No open threshold breaches."
|
|
392
|
-
})
|
|
393
|
-
]
|
|
394
|
-
}) : /* @__PURE__ */ A("ul", {
|
|
395
|
-
className: "space-y-2.5",
|
|
396
|
-
children: Q.map((e) => /* @__PURE__ */ j("li", {
|
|
397
|
-
className: "flex items-start justify-between gap-3 rounded-xl bg-bg-sunken/50 p-3",
|
|
398
|
-
children: [/* @__PURE__ */ j("div", {
|
|
399
|
-
className: "flex min-w-0 items-start gap-2.5",
|
|
400
|
-
children: [/* @__PURE__ */ A("span", {
|
|
401
|
-
"aria-hidden": "true",
|
|
402
|
-
className: "mt-1.5 size-2 shrink-0 rounded-full bg-status-error-text motion-safe:animate-vc-glow-pulse"
|
|
403
|
-
}), /* @__PURE__ */ j("div", {
|
|
404
|
-
className: "min-w-0",
|
|
405
|
-
children: [/* @__PURE__ */ A("p", {
|
|
406
|
-
className: "truncate text-sm font-medium text-text-primary",
|
|
407
|
-
children: e.parameter
|
|
408
|
-
}), /* @__PURE__ */ j("p", {
|
|
409
|
-
className: "text-xs text-text-tertiary",
|
|
410
|
-
children: [
|
|
411
|
-
/* @__PURE__ */ j("span", {
|
|
412
|
-
className: "tabular-nums",
|
|
413
|
-
children: [
|
|
414
|
-
f(e.value),
|
|
415
|
-
" ",
|
|
416
|
-
e.unit
|
|
417
|
-
]
|
|
418
|
-
}),
|
|
419
|
-
" ",
|
|
420
|
-
"· ",
|
|
421
|
-
m(e.recordedAt)
|
|
422
|
-
]
|
|
423
|
-
})]
|
|
424
|
-
})]
|
|
425
|
-
}), /* @__PURE__ */ A(h, { status: "BREACH" })]
|
|
426
|
-
}, e.id))
|
|
427
|
-
})]
|
|
428
|
-
})]
|
|
429
|
-
}),
|
|
430
|
-
/* @__PURE__ */ A(_, {
|
|
431
|
-
title: "Recent field observations",
|
|
432
|
-
description: "Latest wildlife & biodiversity sightings recorded across your sites.",
|
|
433
|
-
action: /* @__PURE__ */ j("button", {
|
|
434
|
-
type: "button",
|
|
435
|
-
onClick: () => F("observations"),
|
|
436
|
-
className: "inline-flex items-center gap-1 text-sm font-medium text-accent hover:underline",
|
|
437
|
-
children: ["All observations ", /* @__PURE__ */ A(T, { className: "h-4 w-4" })]
|
|
438
|
-
}),
|
|
439
|
-
children: $.length === 0 ? /* @__PURE__ */ A(v, {
|
|
440
|
-
illustration: "empty-data",
|
|
441
|
-
icon: /* @__PURE__ */ A(E, { className: "h-10 w-10" }),
|
|
442
|
-
title: "No observations yet",
|
|
443
|
-
description: "Record your first field observation to build your biodiversity dataset."
|
|
444
|
-
}) : /* @__PURE__ */ A("div", {
|
|
519
|
+
}, e);
|
|
520
|
+
});
|
|
521
|
+
})()
|
|
522
|
+
})
|
|
523
|
+
})
|
|
524
|
+
}) : null
|
|
525
|
+
}, Q = k.layout.widgetOrder, $ = [];
|
|
526
|
+
for (let e = 0; e < Q.length; e++) {
|
|
527
|
+
let t = Q[e];
|
|
528
|
+
if (t === "kpis") {
|
|
529
|
+
$.push(/* @__PURE__ */ b("div", { children: Z[t] }, t));
|
|
530
|
+
continue;
|
|
531
|
+
}
|
|
532
|
+
if (t === "carbonByScope" && Q[e + 1] === "recentBreaches") {
|
|
533
|
+
$.push(/* @__PURE__ */ x("div", {
|
|
534
|
+
className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
535
|
+
children: [/* @__PURE__ */ b("div", {
|
|
536
|
+
className: "lg:col-span-2",
|
|
537
|
+
children: Y
|
|
538
|
+
}), /* @__PURE__ */ b("div", { children: X })]
|
|
539
|
+
}, `${t}-pair`)), e += 1;
|
|
540
|
+
continue;
|
|
541
|
+
}
|
|
542
|
+
if (t === "recentBreaches" && Q[e - 1] === "carbonByScope") continue;
|
|
543
|
+
let n = Z[t];
|
|
544
|
+
n && $.push(/* @__PURE__ */ b("div", { children: n }, t));
|
|
545
|
+
}
|
|
546
|
+
return /* @__PURE__ */ x(o, {
|
|
547
|
+
title: "EcoImpactHub",
|
|
548
|
+
titleGradient: !0,
|
|
549
|
+
aurora: !0,
|
|
550
|
+
description: `Welcome back, ${Fe} — your environment, conservation & sustainability control room.`,
|
|
551
|
+
actions: G,
|
|
552
|
+
children: [/* @__PURE__ */ x("div", {
|
|
553
|
+
className: "space-y-6",
|
|
554
|
+
children: [$, k.layout.notes.length > 0 && /* @__PURE__ */ b(m, {
|
|
555
|
+
title: "Custom notes",
|
|
556
|
+
description: "Your personal notes, visible only to you.",
|
|
557
|
+
children: /* @__PURE__ */ b("div", {
|
|
445
558
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
446
|
-
children:
|
|
559
|
+
children: k.layout.notes.map((e) => /* @__PURE__ */ b(C, {
|
|
447
560
|
treatment: "plain",
|
|
448
|
-
className: "p-4
|
|
449
|
-
children:
|
|
450
|
-
className: "flex items-start
|
|
451
|
-
children: [/* @__PURE__ */
|
|
452
|
-
className: "
|
|
453
|
-
children: [/* @__PURE__ */
|
|
454
|
-
className: "
|
|
455
|
-
children:
|
|
456
|
-
}), /* @__PURE__ */
|
|
457
|
-
className: "
|
|
458
|
-
children:
|
|
459
|
-
className: "truncate text-sm font-semibold text-text-primary",
|
|
460
|
-
children: e.species?.commonName ?? "Unknown species"
|
|
461
|
-
}), e.species?.scientificName && /* @__PURE__ */ A("p", {
|
|
462
|
-
className: "truncate text-xs italic text-text-tertiary",
|
|
463
|
-
children: e.species.scientificName
|
|
464
|
-
})]
|
|
561
|
+
className: "p-4",
|
|
562
|
+
children: /* @__PURE__ */ x("div", {
|
|
563
|
+
className: "flex items-start gap-2.5",
|
|
564
|
+
children: [/* @__PURE__ */ b(Te, { className: "mt-0.5 h-4 w-4 shrink-0 text-accent" }), /* @__PURE__ */ x("div", {
|
|
565
|
+
className: "min-w-0",
|
|
566
|
+
children: [e.title && /* @__PURE__ */ b("p", {
|
|
567
|
+
className: "truncate text-sm font-semibold text-text-primary",
|
|
568
|
+
children: e.title
|
|
569
|
+
}), e.body && /* @__PURE__ */ b("p", {
|
|
570
|
+
className: "mt-0.5 text-sm text-text-secondary",
|
|
571
|
+
children: e.body
|
|
465
572
|
})]
|
|
466
|
-
}), /* @__PURE__ */ j("span", {
|
|
467
|
-
className: "shrink-0 rounded-full bg-[var(--color-accent-soft)] px-2 py-0.5 text-xs font-medium tabular-nums text-text-primary",
|
|
468
|
-
children: ["×", f(e.count)]
|
|
469
|
-
})]
|
|
470
|
-
}), /* @__PURE__ */ j("div", {
|
|
471
|
-
className: "mt-3 flex items-center justify-between border-t border-border-seam/70 pt-2.5",
|
|
472
|
-
children: [/* @__PURE__ */ A("span", {
|
|
473
|
-
className: "rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-text-secondary",
|
|
474
|
-
children: d(e.method)
|
|
475
|
-
}), /* @__PURE__ */ A("span", {
|
|
476
|
-
className: "text-xs text-text-tertiary",
|
|
477
|
-
children: m(e.observedAt)
|
|
478
573
|
})]
|
|
479
|
-
})
|
|
574
|
+
})
|
|
480
575
|
}, e.id))
|
|
481
576
|
})
|
|
482
|
-
})
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
className: "p-6",
|
|
489
|
-
children: /* @__PURE__ */ A("div", {
|
|
490
|
-
className: "space-y-3.5",
|
|
491
|
-
children: (() => {
|
|
492
|
-
let e = /* @__PURE__ */ new Map();
|
|
493
|
-
for (let t of U) e.set(t.conservationStatus, (e.get(t.conservationStatus) ?? 0) + 1);
|
|
494
|
-
let t = U.length;
|
|
495
|
-
return [...e.entries()].sort((e, t) => t[1] - e[1]).map(([e, n]) => {
|
|
496
|
-
let r = n / t * 100, i = P[e] ?? "var(--color-text-tertiary)";
|
|
497
|
-
return /* @__PURE__ */ j("div", {
|
|
498
|
-
className: "flex items-center gap-3 sm:gap-4",
|
|
499
|
-
children: [
|
|
500
|
-
/* @__PURE__ */ A("div", {
|
|
501
|
-
className: "w-36 shrink-0 sm:w-48",
|
|
502
|
-
children: /* @__PURE__ */ A(h, { status: e })
|
|
503
|
-
}),
|
|
504
|
-
/* @__PURE__ */ A(re, {
|
|
505
|
-
value: r,
|
|
506
|
-
color: i,
|
|
507
|
-
className: "flex-1"
|
|
508
|
-
}),
|
|
509
|
-
/* @__PURE__ */ A("span", {
|
|
510
|
-
className: "w-9 shrink-0 text-right text-sm font-medium tabular-nums text-text-primary",
|
|
511
|
-
children: n
|
|
512
|
-
}),
|
|
513
|
-
/* @__PURE__ */ A("span", {
|
|
514
|
-
className: "hidden w-12 shrink-0 text-right text-xs tabular-nums text-text-tertiary sm:inline",
|
|
515
|
-
children: p(r)
|
|
516
|
-
})
|
|
517
|
-
]
|
|
518
|
-
}, e);
|
|
519
|
-
});
|
|
520
|
-
})()
|
|
521
|
-
})
|
|
522
|
-
})
|
|
523
|
-
})
|
|
524
|
-
]
|
|
577
|
+
})]
|
|
578
|
+
}), /* @__PURE__ */ b(se, {
|
|
579
|
+
open: Ae,
|
|
580
|
+
onOpenChange: O,
|
|
581
|
+
layout: k
|
|
582
|
+
})]
|
|
525
583
|
});
|
|
526
584
|
}
|
|
527
585
|
//#endregion
|
|
528
|
-
export {
|
|
586
|
+
export { E as DashboardPage };
|
|
529
587
|
|
|
530
588
|
//# sourceMappingURL=DashboardPage.js.map
|