@sonatel-os/strapi-plugin-split 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const designSystem = require("@strapi/design-system");
5
+ const admin = require("@strapi/strapi/admin");
6
+ const api = require("./api-cwZGoKZx.js");
7
+ const index = require("./index-oyRhs5fN.js");
8
+ const Row = ({ k, v, hint }) => /* @__PURE__ */ jsxRuntime.jsxs(
9
+ designSystem.Flex,
10
+ {
11
+ justifyContent: "space-between",
12
+ alignItems: "flex-start",
13
+ gap: 4,
14
+ paddingTop: 3,
15
+ paddingBottom: 3,
16
+ style: { borderBottom: "1px solid #eaeaef" },
17
+ children: [
18
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { style: { flex: 1, minWidth: 0 }, children: [
19
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", fontWeight: "semiBold", tag: "p", children: k }),
20
+ hint ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", tag: "p", children: hint }) : null
21
+ ] }),
22
+ /* @__PURE__ */ jsxRuntime.jsx(api.Mono, { variant: "pi", fontWeight: "semiBold", children: String(v ?? "—") || "—" })
23
+ ]
24
+ }
25
+ );
26
+ const SettingsPage = () => {
27
+ const { data, isLoading, isError } = api.useGetSettingsQuery();
28
+ if (isLoading) return /* @__PURE__ */ jsxRuntime.jsx(admin.Page.Loading, {});
29
+ if (isError) return /* @__PURE__ */ jsxRuntime.jsx(admin.Page.Error, {});
30
+ const s = data ?? {};
31
+ const methods = Object.entries(s.methods ?? {});
32
+ return /* @__PURE__ */ jsxRuntime.jsx(admin.Page.Protect, { permissions: index.PERMISSIONS.settingsRead, children: /* @__PURE__ */ jsxRuntime.jsxs(admin.Page.Main, { children: [
33
+ /* @__PURE__ */ jsxRuntime.jsx(admin.Page.Title, { children: "Split · Configuration" }),
34
+ /* @__PURE__ */ jsxRuntime.jsx(
35
+ admin.Layouts.Header,
36
+ {
37
+ title: "Split configuration",
38
+ subtitle: "Read from config/plugins.js and the server environment. Nothing here is edited in the admin."
39
+ }
40
+ ),
41
+ /* @__PURE__ */ jsxRuntime.jsx(admin.Layouts.Content, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: [
42
+ /* @__PURE__ */ jsxRuntime.jsxs(
43
+ api.Section,
44
+ {
45
+ title: "Who is calling",
46
+ help: "The app routes under /api/split are protected by Strapi API tokens. The caller names the person with a header.",
47
+ children: [
48
+ /* @__PURE__ */ jsxRuntime.jsx(
49
+ Row,
50
+ {
51
+ k: "Person id header",
52
+ v: s.people?.idHeader,
53
+ hint: "Any stable id the host owns; a phone number is stored under one spelling."
54
+ }
55
+ ),
56
+ /* @__PURE__ */ jsxRuntime.jsx(
57
+ Row,
58
+ {
59
+ k: "Display name header",
60
+ v: s.people?.nameHeader,
61
+ hint: "Optional; refreshes the person's name."
62
+ }
63
+ ),
64
+ /* @__PURE__ */ jsxRuntime.jsx(Row, { k: "Create unknown people", v: s.people?.autoProvision ? "yes" : "no" }),
65
+ /* @__PURE__ */ jsxRuntime.jsx(
66
+ Row,
67
+ {
68
+ k: "Home country code",
69
+ v: s.countryCode,
70
+ hint: "Dropped from stored phone numbers."
71
+ }
72
+ )
73
+ ]
74
+ }
75
+ ),
76
+ /* @__PURE__ */ jsxRuntime.jsxs(api.Section, { title: "Groups and amounts", index: 1, children: [
77
+ /* @__PURE__ */ jsxRuntime.jsx(Row, { k: "Invite code prefix", v: s.inviteCodePrefix }),
78
+ /* @__PURE__ */ jsxRuntime.jsx(Row, { k: "Groups per person", v: s.limits?.maxGroupsPerPerson }),
79
+ /* @__PURE__ */ jsxRuntime.jsx(Row, { k: "Members per group", v: s.limits?.maxMembersPerGroup }),
80
+ /* @__PURE__ */ jsxRuntime.jsx(
81
+ Row,
82
+ {
83
+ k: "Largest amount",
84
+ v: s.limits?.maxAmount,
85
+ hint: "One expense or one settlement, in the currency's smallest unit."
86
+ }
87
+ )
88
+ ] }),
89
+ /* @__PURE__ */ jsxRuntime.jsx(
90
+ api.Section,
91
+ {
92
+ title: "Settlement methods",
93
+ help: "An instant method is one the host pays itself: it is confirmed at once. The others wait for the receiver.",
94
+ index: 2,
95
+ children: methods.map(([name, m]) => /* @__PURE__ */ jsxRuntime.jsx(Row, { k: name, v: m.instant ? "instant" : "receiver confirms" }, name))
96
+ }
97
+ )
98
+ ] }) })
99
+ ] }) });
100
+ };
101
+ exports.SettingsPage = SettingsPage;
@@ -0,0 +1,101 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Flex, Box, Typography } from "@strapi/design-system";
3
+ import { Page, Layouts } from "@strapi/strapi/admin";
4
+ import { m as useGetSettingsQuery, b as Section, M as Mono } from "./api-BCYZ56eI.mjs";
5
+ import { a as PERMISSIONS } from "./index-PFbwTznf.mjs";
6
+ const Row = ({ k, v, hint }) => /* @__PURE__ */ jsxs(
7
+ Flex,
8
+ {
9
+ justifyContent: "space-between",
10
+ alignItems: "flex-start",
11
+ gap: 4,
12
+ paddingTop: 3,
13
+ paddingBottom: 3,
14
+ style: { borderBottom: "1px solid #eaeaef" },
15
+ children: [
16
+ /* @__PURE__ */ jsxs(Box, { style: { flex: 1, minWidth: 0 }, children: [
17
+ /* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "semiBold", tag: "p", children: k }),
18
+ hint ? /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", tag: "p", children: hint }) : null
19
+ ] }),
20
+ /* @__PURE__ */ jsx(Mono, { variant: "pi", fontWeight: "semiBold", children: String(v ?? "—") || "—" })
21
+ ]
22
+ }
23
+ );
24
+ const SettingsPage = () => {
25
+ const { data, isLoading, isError } = useGetSettingsQuery();
26
+ if (isLoading) return /* @__PURE__ */ jsx(Page.Loading, {});
27
+ if (isError) return /* @__PURE__ */ jsx(Page.Error, {});
28
+ const s = data ?? {};
29
+ const methods = Object.entries(s.methods ?? {});
30
+ return /* @__PURE__ */ jsx(Page.Protect, { permissions: PERMISSIONS.settingsRead, children: /* @__PURE__ */ jsxs(Page.Main, { children: [
31
+ /* @__PURE__ */ jsx(Page.Title, { children: "Split · Configuration" }),
32
+ /* @__PURE__ */ jsx(
33
+ Layouts.Header,
34
+ {
35
+ title: "Split configuration",
36
+ subtitle: "Read from config/plugins.js and the server environment. Nothing here is edited in the admin."
37
+ }
38
+ ),
39
+ /* @__PURE__ */ jsx(Layouts.Content, { children: /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "stretch", gap: 6, children: [
40
+ /* @__PURE__ */ jsxs(
41
+ Section,
42
+ {
43
+ title: "Who is calling",
44
+ help: "The app routes under /api/split are protected by Strapi API tokens. The caller names the person with a header.",
45
+ children: [
46
+ /* @__PURE__ */ jsx(
47
+ Row,
48
+ {
49
+ k: "Person id header",
50
+ v: s.people?.idHeader,
51
+ hint: "Any stable id the host owns; a phone number is stored under one spelling."
52
+ }
53
+ ),
54
+ /* @__PURE__ */ jsx(
55
+ Row,
56
+ {
57
+ k: "Display name header",
58
+ v: s.people?.nameHeader,
59
+ hint: "Optional; refreshes the person's name."
60
+ }
61
+ ),
62
+ /* @__PURE__ */ jsx(Row, { k: "Create unknown people", v: s.people?.autoProvision ? "yes" : "no" }),
63
+ /* @__PURE__ */ jsx(
64
+ Row,
65
+ {
66
+ k: "Home country code",
67
+ v: s.countryCode,
68
+ hint: "Dropped from stored phone numbers."
69
+ }
70
+ )
71
+ ]
72
+ }
73
+ ),
74
+ /* @__PURE__ */ jsxs(Section, { title: "Groups and amounts", index: 1, children: [
75
+ /* @__PURE__ */ jsx(Row, { k: "Invite code prefix", v: s.inviteCodePrefix }),
76
+ /* @__PURE__ */ jsx(Row, { k: "Groups per person", v: s.limits?.maxGroupsPerPerson }),
77
+ /* @__PURE__ */ jsx(Row, { k: "Members per group", v: s.limits?.maxMembersPerGroup }),
78
+ /* @__PURE__ */ jsx(
79
+ Row,
80
+ {
81
+ k: "Largest amount",
82
+ v: s.limits?.maxAmount,
83
+ hint: "One expense or one settlement, in the currency's smallest unit."
84
+ }
85
+ )
86
+ ] }),
87
+ /* @__PURE__ */ jsx(
88
+ Section,
89
+ {
90
+ title: "Settlement methods",
91
+ help: "An instant method is one the host pays itself: it is confirmed at once. The others wait for the receiver.",
92
+ index: 2,
93
+ children: methods.map(([name, m]) => /* @__PURE__ */ jsx(Row, { k: name, v: m.instant ? "instant" : "receiver confirms" }, name))
94
+ }
95
+ )
96
+ ] }) })
97
+ ] }) });
98
+ };
99
+ export {
100
+ SettingsPage
101
+ };
@@ -0,0 +1,466 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { Flex, Box, Typography, Badge, Button } from "@strapi/design-system";
4
+ import { Lightbulb, ChevronDown, ChevronUp, ArrowRight } from "@strapi/icons";
5
+ import "@strapi/icons/symbols";
6
+ import { useNavigate } from "react-router-dom";
7
+ import { styled, css, keyframes } from "styled-components";
8
+ import { adminApi } from "@strapi/strapi/admin";
9
+ import { P as PLUGIN_ID } from "./index-PFbwTznf.mjs";
10
+ const SPRING = "cubic-bezier(0.32, 0.72, 0, 1)";
11
+ const rise = keyframes`
12
+ from { opacity: 0; transform: translateY(14px); filter: blur(6px); }
13
+ to { opacity: 1; transform: translateY(0); filter: blur(0); }
14
+ `;
15
+ const reveal = css`
16
+ animation: ${rise} 720ms ${SPRING} both;
17
+ animation-delay: calc(var(--i, 0) * 70ms);
18
+ @media (prefers-reduced-motion: reduce) {
19
+ animation: none;
20
+ }
21
+ `;
22
+ const Shell = styled.div`
23
+ ${reveal};
24
+ width: 100%;
25
+ height: 100%;
26
+ background: ${({ theme }) => theme.colors.neutral150};
27
+ border: 1px solid ${({ theme }) => theme.colors.neutral150};
28
+ border-radius: 2rem;
29
+ padding: 0.5rem;
30
+ box-shadow:
31
+ 0 1px 2px rgba(33, 33, 52, 0.04),
32
+ 0 18px 40px -24px rgba(33, 33, 52, 0.22);
33
+ transition:
34
+ transform 480ms ${SPRING},
35
+ box-shadow 480ms ${SPRING};
36
+ ${({ $hover }) => $hover && css`
37
+ cursor: pointer;
38
+ &:hover {
39
+ transform: translateY(-3px);
40
+ box-shadow:
41
+ 0 1px 2px rgba(33, 33, 52, 0.04),
42
+ 0 28px 56px -24px rgba(33, 33, 52, 0.28);
43
+ }
44
+ &:active {
45
+ transform: translateY(-1px) scale(0.995);
46
+ }
47
+ `}
48
+ `;
49
+ const Core = styled(Box)`
50
+ position: relative;
51
+ background: ${({ theme }) => theme.colors.neutral0};
52
+ border-radius: calc(2rem - 0.5rem);
53
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
54
+ height: 100%;
55
+ ${({ $accent }) => $accent && css`
56
+ overflow: hidden;
57
+ &::before {
58
+ content: '';
59
+ position: absolute;
60
+ top: -60px;
61
+ right: -60px;
62
+ width: 180px;
63
+ height: 180px;
64
+ border-radius: 50%;
65
+ background: radial-gradient(circle, ${$accent}33 0%, ${$accent}00 70%);
66
+ pointer-events: none;
67
+ }
68
+ `}
69
+ `;
70
+ const Card = ({ style, onClick, className, accent, hover, index, children, ...rest }) => /* @__PURE__ */ jsx(
71
+ Shell,
72
+ {
73
+ style: { ...index != null ? { "--i": index } : {}, ...style },
74
+ onClick,
75
+ className,
76
+ $hover: Boolean(hover || onClick),
77
+ children: /* @__PURE__ */ jsx(Core, { $accent: accent, ...rest, children })
78
+ }
79
+ );
80
+ const Eyebrow = styled(Typography).attrs({ variant: "sigma", tag: "p" })`
81
+ letter-spacing: 0.18em;
82
+ text-transform: uppercase;
83
+ font-size: 1rem;
84
+ color: ${({ theme }) => theme.colors.neutral500};
85
+ `;
86
+ const Section = ({ title, eyebrow, help, aside, children, index, accent, ...rest }) => /* @__PURE__ */ jsxs(Card, { padding: 6, index, accent, ...rest, children: [
87
+ title || aside ? /* @__PURE__ */ jsxs(
88
+ Flex,
89
+ {
90
+ justifyContent: "space-between",
91
+ alignItems: "flex-start",
92
+ paddingBottom: help ? 2 : 5,
93
+ gap: 4,
94
+ children: [
95
+ /* @__PURE__ */ jsxs(Box, { children: [
96
+ eyebrow ? /* @__PURE__ */ jsx(Eyebrow, { paddingBottom: 1, children: eyebrow }) : null,
97
+ typeof title === "string" ? /* @__PURE__ */ jsx(Typography, { variant: "delta", tag: "h2", fontWeight: "bold", children: title }) : title
98
+ ] }),
99
+ aside
100
+ ]
101
+ }
102
+ ) : null,
103
+ help ? /* @__PURE__ */ jsx(
104
+ Typography,
105
+ {
106
+ variant: "pi",
107
+ textColor: "neutral600",
108
+ tag: "p",
109
+ paddingBottom: 5,
110
+ style: { maxWidth: "72ch" },
111
+ children: help
112
+ }
113
+ ) : null,
114
+ children
115
+ ] });
116
+ const Big = styled(Typography)`
117
+ font-size: 3.2rem;
118
+ line-height: 1;
119
+ font-weight: 700;
120
+ letter-spacing: -0.035em;
121
+ font-variant-numeric: tabular-nums;
122
+ `;
123
+ const StatTile = ({ label, value, hint, accent, icon, index, children }) => /* @__PURE__ */ jsxs(Card, { padding: 5, accent, index, children: [
124
+ /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", alignItems: "center", children: [
125
+ /* @__PURE__ */ jsx(Eyebrow, { children: label }),
126
+ icon ? /* @__PURE__ */ jsx(
127
+ Box,
128
+ {
129
+ style: {
130
+ color: accent ?? "#8E8EA9",
131
+ display: "inline-flex",
132
+ width: 32,
133
+ height: 32,
134
+ borderRadius: 10,
135
+ alignItems: "center",
136
+ justifyContent: "center",
137
+ background: `${accent ?? "#8E8EA9"}14`
138
+ },
139
+ children: icon
140
+ }
141
+ ) : null
142
+ ] }),
143
+ /* @__PURE__ */ jsx(Box, { paddingTop: 4, paddingBottom: 1, children: /* @__PURE__ */ jsx(Big, { tag: "p", children: value }) }),
144
+ hint ? /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral500", tag: "p", children: hint }) : null,
145
+ children
146
+ ] });
147
+ const PillBtn = styled.button`
148
+ display: inline-flex;
149
+ align-items: center;
150
+ gap: 1rem;
151
+ padding: 0.4rem 0.4rem 0.4rem 1.6rem;
152
+ border-radius: 999px;
153
+ border: 0;
154
+ cursor: pointer;
155
+ font: inherit;
156
+ font-size: 1.4rem;
157
+ font-weight: 600;
158
+ color: ${({ theme, $tone }) => $tone === "light" ? theme.colors.neutral800 : theme.colors.neutral0};
159
+ background: ${({ theme, $tone }) => $tone === "light" ? theme.colors.neutral0 : theme.colors.neutral800};
160
+ box-shadow:
161
+ inset 0 1px 0 rgba(255, 255, 255, 0.12),
162
+ 0 10px 24px -12px rgba(33, 33, 52, 0.45);
163
+ transition:
164
+ transform 420ms ${SPRING},
165
+ box-shadow 420ms ${SPRING};
166
+ span.disc {
167
+ display: inline-flex;
168
+ align-items: center;
169
+ justify-content: center;
170
+ width: 3rem;
171
+ height: 3rem;
172
+ border-radius: 50%;
173
+ background: ${({ $tone }) => $tone === "light" ? "rgba(33,33,52,0.06)" : "rgba(255,255,255,0.14)"};
174
+ transition: transform 420ms ${SPRING};
175
+ svg {
176
+ width: 1.4rem;
177
+ height: 1.4rem;
178
+ }
179
+ }
180
+ &:hover {
181
+ transform: translateY(-1px);
182
+ box-shadow:
183
+ inset 0 1px 0 rgba(255, 255, 255, 0.12),
184
+ 0 16px 30px -12px rgba(33, 33, 52, 0.5);
185
+ }
186
+ &:hover span.disc {
187
+ transform: translate(2px, -1px) scale(1.06);
188
+ }
189
+ &:active {
190
+ transform: scale(0.98);
191
+ }
192
+ `;
193
+ const Pill = ({ children, onClick, tone = "dark", icon = /* @__PURE__ */ jsx(ArrowRight, {}) }) => /* @__PURE__ */ jsxs(PillBtn, { type: "button", onClick, $tone: tone, children: [
194
+ children,
195
+ /* @__PURE__ */ jsx("span", { className: "disc", "aria-hidden": true, children: icon })
196
+ ] });
197
+ styled.span`
198
+ display: inline-block;
199
+ width: 10px;
200
+ height: 10px;
201
+ border-radius: 50%;
202
+ background: ${({ $color }) => $color};
203
+ box-shadow:
204
+ 0 0 0 2px ${({ theme }) => theme.colors.neutral0},
205
+ 0 0 0 3px ${({ $color }) => $color}33;
206
+ `;
207
+ const STATUS_LABEL = {
208
+ active: "Active",
209
+ inactive: "Inactive",
210
+ archived: "Archived",
211
+ pending: "Pending",
212
+ confirmed: "Confirmed",
213
+ rejected: "Rejected",
214
+ cancelled: "Cancelled"
215
+ };
216
+ const StatusBadge = ({ status, label }) => {
217
+ const map = {
218
+ active: "success",
219
+ live: "success",
220
+ open: "success",
221
+ pending: "warning",
222
+ scheduled: "warning",
223
+ fulfilled: "success",
224
+ accepted: "success",
225
+ confirmed: "success",
226
+ draft: "secondary",
227
+ archived: "neutral",
228
+ inactive: "neutral",
229
+ closed: "neutral",
230
+ cancelled: "danger",
231
+ rejected: "danger",
232
+ expired: "neutral"
233
+ };
234
+ const v = map[status] ?? "neutral";
235
+ return /* @__PURE__ */ jsx(Badge, { backgroundColor: `${v}100`, textColor: `${v}700`, size: "S", children: label ?? STATUS_LABEL[status] ?? status });
236
+ };
237
+ const Mono = styled(Typography)`
238
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
239
+ letter-spacing: 0.04em;
240
+ font-variant-numeric: tabular-nums;
241
+ `;
242
+ const Bar = ({ value, max, color }) => {
243
+ const w = max ? Math.min(100, Math.round(value / max * 100)) : 0;
244
+ return /* @__PURE__ */ jsx(Box, { background: "neutral150", hasRadius: true, style: { height: 8, overflow: "hidden" }, children: /* @__PURE__ */ jsx(
245
+ Box,
246
+ {
247
+ style: {
248
+ width: `${w}%`,
249
+ height: "100%",
250
+ borderRadius: 999,
251
+ background: color ? `linear-gradient(90deg, ${color}, ${color}cc)` : "linear-gradient(90deg, #FF7900, #FACC15)",
252
+ transition: `width 700ms ${SPRING}`
253
+ }
254
+ }
255
+ ) });
256
+ };
257
+ const introKey = (k) => `split.intro.${k}`;
258
+ const recallCollapsed = (k) => {
259
+ try {
260
+ return window.localStorage.getItem(introKey(k)) === "1";
261
+ } catch {
262
+ return false;
263
+ }
264
+ };
265
+ const rememberCollapsed = (k, v) => {
266
+ try {
267
+ if (v) window.localStorage.setItem(introKey(k), "1");
268
+ else window.localStorage.removeItem(introKey(k));
269
+ } catch {
270
+ }
271
+ };
272
+ const IntroShell = styled.div`
273
+ ${reveal};
274
+ position: relative;
275
+ overflow: hidden;
276
+ border-radius: 2rem;
277
+ padding: 0.5rem;
278
+ background: linear-gradient(135deg, #eef0ff 0%, #f6f6f9 55%, #fff4ea 100%);
279
+ box-shadow: 0 18px 40px -28px rgba(73, 69, 255, 0.35);
280
+ `;
281
+ const IntroCore = styled.div`
282
+ position: relative;
283
+ border-radius: calc(2rem - 0.5rem);
284
+ background: rgba(255, 255, 255, 0.72);
285
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
286
+ padding: ${({ $collapsed }) => $collapsed ? "1rem 1.6rem" : "2.4rem 2.8rem"};
287
+ transition: padding 420ms ${SPRING};
288
+ `;
289
+ const StepNo = styled.span`
290
+ display: inline-flex;
291
+ align-items: center;
292
+ justify-content: center;
293
+ width: 2.4rem;
294
+ height: 2.4rem;
295
+ border-radius: 50%;
296
+ flex-shrink: 0;
297
+ font-size: 1.1rem;
298
+ font-weight: 700;
299
+ background: ${({ theme }) => theme.colors.neutral800};
300
+ color: ${({ theme }) => theme.colors.neutral0};
301
+ `;
302
+ const Intro = ({ id, title, body = [], steps = [], links = [] }) => {
303
+ const navigate = useNavigate();
304
+ const [collapsed, setCollapsed] = useState(() => recallCollapsed(id));
305
+ const toggle = () => {
306
+ rememberCollapsed(id, !collapsed);
307
+ setCollapsed(!collapsed);
308
+ };
309
+ return /* @__PURE__ */ jsx(Box, { marginBottom: 7, children: /* @__PURE__ */ jsx(IntroShell, { children: /* @__PURE__ */ jsxs(IntroCore, { $collapsed: collapsed, children: [
310
+ /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", alignItems: "center", gap: 4, children: [
311
+ /* @__PURE__ */ jsxs(Flex, { gap: 3, alignItems: "center", children: [
312
+ /* @__PURE__ */ jsx(Box, { style: { color: "#4945FF", display: "flex" }, children: /* @__PURE__ */ jsx(Lightbulb, { width: "1.8rem", height: "1.8rem" }) }),
313
+ /* @__PURE__ */ jsxs(Box, { children: [
314
+ collapsed ? null : /* @__PURE__ */ jsx(Eyebrow, { children: "Guide" }),
315
+ /* @__PURE__ */ jsx(Typography, { variant: collapsed ? "omega" : "beta", fontWeight: "bold", tag: "h2", children: title })
316
+ ] })
317
+ ] }),
318
+ /* @__PURE__ */ jsx(
319
+ Button,
320
+ {
321
+ variant: "ghost",
322
+ size: "S",
323
+ onClick: toggle,
324
+ endIcon: collapsed ? /* @__PURE__ */ jsx(ChevronDown, {}) : /* @__PURE__ */ jsx(ChevronUp, {}),
325
+ children: collapsed ? "Show the guide" : "Hide"
326
+ }
327
+ )
328
+ ] }),
329
+ collapsed ? null : /* @__PURE__ */ jsxs(Flex, { gap: 10, alignItems: "flex-start", paddingTop: 4, wrap: "wrap", children: [
330
+ /* @__PURE__ */ jsxs(Box, { style: { flex: "2 1 360px", minWidth: 0 }, children: [
331
+ body.map((p, i) => /* @__PURE__ */ jsx(
332
+ Typography,
333
+ {
334
+ tag: "p",
335
+ textColor: "neutral700",
336
+ paddingBottom: 3,
337
+ style: { maxWidth: "68ch", lineHeight: 1.6 },
338
+ children: p
339
+ },
340
+ i
341
+ )),
342
+ links.length ? /* @__PURE__ */ jsx(Flex, { gap: 3, paddingTop: 2, wrap: "wrap", children: links.map((l) => /* @__PURE__ */ jsx(Pill, { tone: "light", onClick: () => navigate(l.to), children: l.label }, l.to)) }) : null
343
+ ] }),
344
+ steps.length ? /* @__PURE__ */ jsxs(Box, { style: { flex: "1 1 260px", minWidth: 0 }, children: [
345
+ /* @__PURE__ */ jsx(Eyebrow, { paddingBottom: 3, children: "How to" }),
346
+ /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 3, children: steps.map((s, i) => {
347
+ const label = typeof s === "string" ? s : s.label;
348
+ const to = typeof s === "string" ? null : s.to;
349
+ return /* @__PURE__ */ jsxs(Flex, { gap: 3, alignItems: "center", children: [
350
+ /* @__PURE__ */ jsx(StepNo, { children: i + 1 }),
351
+ to ? /* @__PURE__ */ jsx(
352
+ Button,
353
+ {
354
+ variant: "ghost",
355
+ size: "S",
356
+ onClick: () => navigate(to),
357
+ style: { padding: 0 },
358
+ children: label
359
+ }
360
+ ) : /* @__PURE__ */ jsx(Typography, { variant: "omega", children: label })
361
+ ] }, i);
362
+ }) })
363
+ ] }) : null
364
+ ] })
365
+ ] }) }) });
366
+ };
367
+ styled(Flex)`
368
+ border-top: 1px solid ${({ theme }) => theme.colors.neutral150};
369
+ &:first-child {
370
+ border-top: none;
371
+ }
372
+ `;
373
+ styled.span`
374
+ display: inline-flex;
375
+ width: 2.4rem;
376
+ height: 2.4rem;
377
+ border-radius: 50%;
378
+ border: 2px solid ${({ theme }) => theme.colors.neutral300};
379
+ flex-shrink: 0;
380
+ `;
381
+ const BASE = `/${PLUGIN_ID}`;
382
+ const TAG = Object.freeze({ DASH: "SplitDashboard", GROUP: "SplitGroup", PERSON: "SplitPerson" });
383
+ const unwrap = (res) => res && typeof res === "object" && "data" in res ? res.data : res;
384
+ const qs = (params = {}) => {
385
+ const clean = Object.fromEntries(
386
+ Object.entries(params).filter(([, v]) => v !== void 0 && v !== null && v !== "")
387
+ );
388
+ const s = new URLSearchParams(clean).toString();
389
+ return s ? `?${s}` : "";
390
+ };
391
+ const enc = encodeURIComponent;
392
+ const api = adminApi.enhanceEndpoints({ addTagTypes: Object.values(TAG) }).injectEndpoints({
393
+ endpoints: (b) => ({
394
+ getDashboard: b.query({
395
+ query: () => `${BASE}/dashboard`,
396
+ transformResponse: unwrap,
397
+ providesTags: [TAG.DASH]
398
+ }),
399
+ getGroups: b.query({ query: (p) => `${BASE}/groups${qs(p)}`, providesTags: [TAG.GROUP] }),
400
+ getGroup: b.query({
401
+ query: (id) => `${BASE}/groups/${enc(id)}`,
402
+ transformResponse: unwrap,
403
+ providesTags: (_r, _e, id) => [{ type: TAG.GROUP, id }]
404
+ }),
405
+ archiveGroup: b.mutation({
406
+ query: (id) => ({ url: `${BASE}/groups/${enc(id)}/archive`, method: "POST" }),
407
+ invalidatesTags: (_r, _e, id) => [TAG.GROUP, { type: TAG.GROUP, id }, TAG.DASH]
408
+ }),
409
+ getPeople: b.query({ query: (p) => `${BASE}/people${qs(p)}`, providesTags: [TAG.PERSON] }),
410
+ getPerson: b.query({
411
+ query: (id) => `${BASE}/people/${enc(id)}`,
412
+ transformResponse: unwrap,
413
+ providesTags: (_r, _e, id) => [{ type: TAG.PERSON, id }]
414
+ }),
415
+ revealPhone: b.mutation({
416
+ query: (id) => ({ url: `${BASE}/people/${enc(id)}/phone`, method: "GET" }),
417
+ transformResponse: unwrap
418
+ }),
419
+ setPersonActive: b.mutation({
420
+ query: ({ id, isActive }) => ({
421
+ url: `${BASE}/people/${enc(id)}/active`,
422
+ method: "PUT",
423
+ data: { data: { isActive } }
424
+ }),
425
+ invalidatesTags: (_r, _e, { id }) => [TAG.PERSON, { type: TAG.PERSON, id }]
426
+ }),
427
+ getSettlements: b.query({ query: (p) => `${BASE}/settlements${qs(p)}` }),
428
+ getEvents: b.query({ query: (p) => `${BASE}/events${qs(p)}` }),
429
+ getSettings: b.query({ query: () => `${BASE}/settings`, transformResponse: unwrap })
430
+ }),
431
+ overrideExisting: true
432
+ });
433
+ const {
434
+ useGetDashboardQuery,
435
+ useGetGroupsQuery,
436
+ useGetGroupQuery,
437
+ useArchiveGroupMutation,
438
+ useGetPeopleQuery,
439
+ useGetPersonQuery,
440
+ useRevealPhoneMutation,
441
+ useSetPersonActiveMutation,
442
+ useGetSettlementsQuery,
443
+ useGetEventsQuery,
444
+ useGetSettingsQuery
445
+ } = api;
446
+ export {
447
+ Bar as B,
448
+ Eyebrow as E,
449
+ Intro as I,
450
+ Mono as M,
451
+ SPRING as S,
452
+ StatTile as a,
453
+ Section as b,
454
+ useGetGroupsQuery as c,
455
+ StatusBadge as d,
456
+ useGetGroupQuery as e,
457
+ useArchiveGroupMutation as f,
458
+ useGetPeopleQuery as g,
459
+ useGetPersonQuery as h,
460
+ useRevealPhoneMutation as i,
461
+ useSetPersonActiveMutation as j,
462
+ useGetSettlementsQuery as k,
463
+ useGetEventsQuery as l,
464
+ useGetSettingsQuery as m,
465
+ useGetDashboardQuery as u
466
+ };