@abyss-project/commons-front-core 17.2.1 → 18.0.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.
Files changed (65) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +2 -1
  3. package/catalog/captures-plan.ts +120 -116
  4. package/catalog/catalog-entries.ts +149 -148
  5. package/catalog/pages/AppShell.tsx +18 -9
  6. package/catalog/pages/CookieConsent.tsx +54 -31
  7. package/catalog/pages/DeliveryHistory.tsx +66 -66
  8. package/catalog/pages/DeliverySubscriptions.tsx +110 -110
  9. package/catalog/pages/ScheduledTasks.tsx +117 -117
  10. package/catalog/pages/index.ts +166 -165
  11. package/catalog/playwright.ci.config.ts +4 -3
  12. package/catalog/specs/captures.spec.ts +145 -145
  13. package/catalog/specs/cookie-consent-modal.spec.ts +187 -0
  14. package/catalog/specs/write-capture-index.ts +81 -81
  15. package/dist/CookieConsentSettings-B7HIIzyI.js +595 -0
  16. package/dist/{Surface-BDfRxVLj.js → Surface-dziv23sf.js} +56 -51
  17. package/dist/{Tabs-DEY2HEqj.js → Tabs-_onUZBA-.js} +613 -591
  18. package/dist/components/business/CookieConsent/AbyssCookieConsentProvider.d.ts +11 -3
  19. package/dist/components/business/CookieConsent/CookieConsentBanner.d.ts +4 -3
  20. package/dist/components/business/CookieConsent/CookieConsentPreferences.d.ts +12 -0
  21. package/dist/components/business/CookieConsent/index.d.ts +2 -0
  22. package/dist/components/business/CookieConsent/use-banner-portal.d.ts +36 -0
  23. package/dist/components/inputs/NumberField/NumberField.d.ts +18 -2
  24. package/dist/components/layers/Toast/toast-clearance.d.ts +5 -0
  25. package/dist/components/structure/AccountMenu/AccountMenu.d.ts +2 -1
  26. package/dist/components/structure/AppShell/SpaceSwitcher.d.ts +4 -2
  27. package/dist/components/structure/AppShell/app-shell.types.d.ts +5 -1
  28. package/dist/components/structure/FilterBar/FilterBar.d.ts +7 -2
  29. package/dist/cookie-consent.js +26 -17
  30. package/dist/{design-theme-Bd0pEPei.js → design-theme-B3C3z1gE.js} +1 -1
  31. package/dist/{editors-CtkDomwX.js → editors-BhQlONOy.js} +27 -27
  32. package/dist/editors.js +1 -1
  33. package/dist/hooks/use-cookie-consent.hook.spec.d.ts +1 -0
  34. package/dist/hooks/use-rich-intl.hook.d.ts +2 -0
  35. package/dist/{index-DKsvuaEj.js → index-B6LMTOKG.js} +3 -3
  36. package/dist/{index-B9avfa3r.js → index-B6w5_TeJ.js} +3 -3
  37. package/dist/{index-Ch8JqU5w.js → index-BBF-FvT6.js} +2 -2
  38. package/dist/{index-CqgMX8kF.js → index-BGAZK8Vk.js} +2 -2
  39. package/dist/{index-DnQguWf1.js → index-BGJobvxw.js} +1 -1
  40. package/dist/{index-SN7FZBya.js → index-BTDlbjWW.js} +2 -2
  41. package/dist/{index-Cl3hwdsZ.js → index-BcjlG5TB.js} +2 -2
  42. package/dist/{index-CSdO6zlX.js → index-BeMiREqf.js} +2 -2
  43. package/dist/{index-psJ1Q-lU.js → index-ByN6DcaL.js} +2 -2
  44. package/dist/{index-DtpGwH5a.js → index-CJI1dJrw.js} +3 -3
  45. package/dist/{index-CEjiERmo.js → index-D1mQgWN3.js} +2 -2
  46. package/dist/{index-BcXqvMY8.js → index-DLlWMDxB.js} +4 -4
  47. package/dist/{index-DFZlN4E3.js → index-DNd8NZnu.js} +4 -4
  48. package/dist/{index-mUtvzoSi.js → index-Dakpr4C1.js} +3 -3
  49. package/dist/{index-D0EF36wh.js → index-DkZAsKob.js} +2 -2
  50. package/dist/{index-FUuoLSZ0.js → index-DprTO7yi.js} +4 -4
  51. package/dist/{index-DZbCUZUp.js → index-N4BwXTyk.js} +2 -2
  52. package/dist/{index-IVjoNq-p.js → index-V4F4Sk7y.js} +2 -2
  53. package/dist/{index-DcV2fWbx.js → index-y-TnfE6Z.js} +2 -2
  54. package/dist/{index-DtncSsmw.js → index-yFJTDKIX.js} +2 -2
  55. package/dist/{index-DVBqUPxf.js → index-ytgNPz5f.js} +2 -2
  56. package/dist/index.js +3480 -3417
  57. package/dist/legacy.js +1728 -1707
  58. package/dist/translations/en.d.ts +1 -0
  59. package/dist/translations/fr.d.ts +1 -0
  60. package/dist/utils/cookie-consent-contract.d.ts +55 -0
  61. package/dist/utils/cookie-consent-contract.spec.d.ts +1 -0
  62. package/dist/utils/cookie-storage.utils.d.ts +1 -8
  63. package/dist/utils/index.d.ts +1 -0
  64. package/package.json +1 -1
  65. package/dist/CookieConsentSettings-CtLrSfve.js +0 -505
@@ -202,6 +202,7 @@ declare const _default: {
202
202
  'accept-all': string;
203
203
  'reject-all': string;
204
204
  configure: string;
205
+ manage: string;
205
206
  cancel: string;
206
207
  save: string;
207
208
  };
@@ -202,6 +202,7 @@ declare const _default: {
202
202
  'accept-all': string;
203
203
  'reject-all': string;
204
204
  configure: string;
205
+ manage: string;
205
206
  cancel: string;
206
207
  save: string;
207
208
  };
@@ -0,0 +1,55 @@
1
+ /**
2
+ * THE COOKIE-CONSENT CONTRACT OF THE WHOLE ESTATE, AS A LEAF FILE.
3
+ *
4
+ * One choice is shared by every `*.abyss-project.fr` surface: the React fronts read and write it
5
+ * through this package, the marketing site (Next.js, no dependency on this package) reads and
6
+ * writes the very same cookie with its own copy of this format. Everything the two sides must
7
+ * agree on lives here and imports nothing (no React, no MUI, no SDK), so it can be read, tested and
8
+ * copied on its own. `cookie-consent-contract.spec.ts` pins golden vectors that the marketing site
9
+ * pins identically: if one side drifts, its own test fails.
10
+ */
11
+ /**
12
+ * The consent version every surface of the estate pins (the `consentVersion` of its provider, and
13
+ * of the marketing site's copy of this file). Bump it when the legal copy or the list of trackers
14
+ * changes: every stored choice of another version asks again. One value for all, or each surface
15
+ * would re-ask the choice the other made.
16
+ */
17
+ export declare const CONSENT_VERSION = "2026-11-03";
18
+ /** Name of the apex cookie that carries the choice. */
19
+ export declare const COOKIE_NAME = "abyssCookieConsent";
20
+ /**
21
+ * How long a choice is valid, in days: six months. A single constant, for the `Max-Age` of the
22
+ * cookie and for the validity check, so the two can never disagree.
23
+ */
24
+ export declare const CONSENT_VALIDITY_DAYS = 183;
25
+ export declare const CONSENT_VALIDITY_MS: number;
26
+ /** `Max-Age` of the cookie, in seconds. */
27
+ export declare const COOKIE_MAX_AGE_SECONDS: number;
28
+ /**
29
+ * Attributes of the cookie besides `Max-Age`. `Domain=<apex>` is added when the host is given one
30
+ * (`.abyss-project.fr` in staging and production) and `Secure` over https.
31
+ */
32
+ export declare const COOKIE_PATH = "/";
33
+ export declare const COOKIE_SAME_SITE = "Lax";
34
+ /**
35
+ * What the cookie holds, short keys to keep it small. The value is `btoa(JSON.stringify(...))`,
36
+ * read back through `decodeURIComponent` then `atob` then `JSON.parse`; every field is required.
37
+ */
38
+ export interface StoredConsent {
39
+ /** analytics */
40
+ a: boolean;
41
+ /** marketing */
42
+ m: boolean;
43
+ /** decidedAt, ISO 8601 */
44
+ d: string;
45
+ /** consentVersion */
46
+ v: string;
47
+ }
48
+ export declare const encodeStoredConsent: (consent: StoredConsent) => string;
49
+ /** `null` for anything that is not a well-formed choice (bad base64, bad JSON, missing field). */
50
+ export declare const decodeStoredConsent: (raw: string) => StoredConsent | null;
51
+ /**
52
+ * Whether a stored choice still counts: of the expected version, with a readable date, and decided
53
+ * less than six months ago. Anything else asks again.
54
+ */
55
+ export declare const isStoredConsentValid: (stored: StoredConsent, expectedVersion: string, now?: number) => boolean;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,11 +1,4 @@
1
- export declare const COOKIE_NAME = "abyssCookieConsent";
2
- export declare const VALIDITY_DAYS = 365;
3
- export interface StoredConsent {
4
- a: boolean;
5
- m: boolean;
6
- d: string;
7
- v: string;
8
- }
1
+ import { StoredConsent } from './cookie-consent-contract';
9
2
  interface CookieOptions {
10
3
  domain?: string;
11
4
  }
@@ -10,6 +10,7 @@ export * from './space-display-name.utils';
10
10
  export * from './cloud-space-url.utils';
11
11
  export * from './billing-quota-error.utils';
12
12
  export * from './quota-refusal-toast.utils';
13
+ export * from './cookie-consent-contract';
13
14
  export * from './cookie-storage.utils';
14
15
  export * from './cookie-consent-reconcile.utils';
15
16
  export * from './cookie-consent.types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abyss-project/commons-front-core",
3
- "version": "17.2.1",
3
+ "version": "18.0.0",
4
4
  "description": "Front Core package of AbyssProject",
5
5
  "main": "dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -1,505 +0,0 @@
1
- import { jsxs as g, jsx as a, Fragment as P } from "react/jsx-runtime";
2
- import { useState as y, useCallback as p, useEffect as T, useId as h, useRef as Q, createContext as X, useContext as F, useMemo as Z } from "react";
3
- import I from "@mui/material/Button";
4
- import H from "@mui/material/Switch";
5
- import { styled as d } from "@mui/material/styles";
6
- import { p as o, h as ee, d as D, D as O, a as $, t as V, u as A, S as Y, M as te, b as ne } from "./Surface-BDfRxVLj.js";
7
- import { useQuery as ie, useMutation as oe } from "@tanstack/react-query";
8
- import { AbyssCore as W } from "@abyss-project/main";
9
- import se from "@mui/material/Link";
10
- const b = "abyssCookieConsent", K = 365, ae = K * 24 * 60 * 60, ce = () => typeof window > "u" ? !1 : window.location.protocol === "https:", U = (e, t) => {
11
- const n = [
12
- "Path=/",
13
- `Max-Age=${t}`,
14
- "SameSite=Lax"
15
- ];
16
- return e.domain && n.push(`Domain=${e.domain}`), ce() && n.push("Secure"), n.join("; ");
17
- }, re = () => {
18
- if (typeof document > "u")
19
- return null;
20
- const e = document.cookie.split(";").map((n) => n.trim()).find((n) => n.startsWith(`${b}=`));
21
- if (!e)
22
- return null;
23
- const t = e.slice(b.length + 1);
24
- try {
25
- const n = atob(decodeURIComponent(t)), i = JSON.parse(n);
26
- return typeof i.a != "boolean" || typeof i.m != "boolean" || typeof i.d != "string" || typeof i.v != "string" ? null : i;
27
- } catch {
28
- return null;
29
- }
30
- }, L = (e, t = {}) => {
31
- if (typeof document > "u")
32
- return;
33
- const n = btoa(JSON.stringify(e));
34
- document.cookie = `${b}=${n}; ${U(
35
- t,
36
- ae
37
- )}`;
38
- }, de = (e = {}) => {
39
- typeof document > "u" || (document.cookie = `${b}=; ${U(e, 0)}`);
40
- };
41
- var M = /* @__PURE__ */ ((e) => (e.NOOP = "noop", e.ADOPT_DB = "adopt-db", e.PUSH_COOKIE = "push-cookie", e))(M || {});
42
- const j = (e) => ({
43
- essentials: !0,
44
- analytics: e.analytics,
45
- marketing: e.marketing,
46
- decidedAt: typeof e.decidedAt == "string" ? e.decidedAt : new Date(e.decidedAt).toISOString(),
47
- consentVersion: e.consentVersion
48
- }), le = (e, t) => {
49
- if (!e && !t)
50
- return { action: "noop", value: null };
51
- if (!e && t)
52
- return { action: "adopt-db", value: j(t) };
53
- if (e && !t)
54
- return { action: "push-cookie", value: e };
55
- const n = new Date(e.decidedAt).getTime(), i = new Date(
56
- typeof t.decidedAt == "string" ? t.decidedAt : t.decidedAt.toISOString()
57
- ).getTime();
58
- return i > n ? { action: "adopt-db", value: j(t) } : n > i ? { action: "push-cookie", value: e } : { action: "noop", value: e };
59
- }, ue = K * 24 * 60 * 60 * 1e3, fe = (e) => ({
60
- essentials: !0,
61
- analytics: e.a,
62
- marketing: e.m,
63
- decidedAt: e.d,
64
- consentVersion: e.v
65
- }), N = (e) => ({
66
- a: e.analytics,
67
- m: e.marketing,
68
- d: e.decidedAt,
69
- v: e.consentVersion
70
- }), ge = (e, t, n) => {
71
- if (n.v !== t)
72
- return !1;
73
- const i = new Date(e).getTime();
74
- return Number.isNaN(i) ? !1 : Date.now() - i < ue;
75
- }, me = (e) => {
76
- const t = re();
77
- return !t || !ge(t.d, e, t) ? null : fe(t);
78
- }, ye = (e) => {
79
- const [t, n] = y(
80
- () => me(e.consentVersion)
81
- ), i = ie({
82
- queryKey: ["cookie-consent", "me"],
83
- queryFn: async () => (await W.sdk.user.cookieConsent.get()).data.consent,
84
- enabled: e.isAuthenticated,
85
- retry: !1,
86
- refetchOnWindowFocus: !1
87
- }), c = oe({
88
- mutationFn: async (r) => (await W.sdk.user.cookieConsent.upsert({
89
- analytics: r.analytics,
90
- marketing: r.marketing,
91
- decidedAt: r.decidedAt,
92
- consentVersion: r.consentVersion
93
- })).data.consent
94
- }), s = p(
95
- (r) => {
96
- L(N(r), { domain: e.domain }), n(r), e.isAuthenticated && c.mutate(r);
97
- },
98
- [e.domain, e.isAuthenticated, c]
99
- );
100
- T(() => {
101
- if (!e.isAuthenticated || i.isLoading || i.isError)
102
- return;
103
- const r = le(t, i.data ?? null);
104
- r.action === M.ADOPT_DB && r.value ? (L(N(r.value), { domain: e.domain }), n(r.value)) : r.action === M.PUSH_COOKIE && r.value && c.mutate(r.value);
105
- }, [e.isAuthenticated, i.isLoading, i.isError, i.data]);
106
- const l = p(() => {
107
- s({
108
- essentials: !0,
109
- analytics: !0,
110
- marketing: !0,
111
- decidedAt: (/* @__PURE__ */ new Date()).toISOString(),
112
- consentVersion: e.consentVersion
113
- });
114
- }, [e.consentVersion, s]), u = p(() => {
115
- s({
116
- essentials: !0,
117
- analytics: !1,
118
- marketing: !1,
119
- decidedAt: (/* @__PURE__ */ new Date()).toISOString(),
120
- consentVersion: e.consentVersion
121
- });
122
- }, [e.consentVersion, s]), f = p(
123
- (r) => {
124
- s({
125
- essentials: !0,
126
- analytics: r.analytics,
127
- marketing: r.marketing,
128
- decidedAt: (/* @__PURE__ */ new Date()).toISOString(),
129
- consentVersion: e.consentVersion
130
- });
131
- },
132
- [e.consentVersion, s]
133
- ), k = p(() => {
134
- de({ domain: e.domain }), n(null);
135
- }, [e.domain]);
136
- return {
137
- consent: t,
138
- isResolved: t !== null,
139
- acceptAll: l,
140
- rejectAll: u,
141
- save: f,
142
- reset: k
143
- };
144
- }, pe = "https://abyss-project.fr/cgu", he = d("div")(({ theme: e }) => {
145
- const { tokens: t, space: n } = e.design;
146
- return {
147
- display: "flex",
148
- alignItems: "center",
149
- justifyContent: "space-between",
150
- gap: o(n[6]),
151
- minWidth: 0,
152
- paddingTop: o(n[3]),
153
- paddingBottom: o(n[3]),
154
- "& + &": { borderTop: ee(t["border.subtle"]) },
155
- [D.down(O.Tablet)]: {
156
- flexDirection: "column",
157
- alignItems: "stretch",
158
- gap: o(n[3])
159
- }
160
- };
161
- }), ke = d("div")(({ theme: e }) => ({
162
- display: "flex",
163
- flexDirection: "column",
164
- gap: o(e.design.space[1]),
165
- flex: "1 1 auto",
166
- minWidth: 0,
167
- overflowWrap: "anywhere"
168
- })), ve = d("label")(({ theme: e }) => ({
169
- fontSize: o(e.design.typeScale.body),
170
- fontWeight: $.medium,
171
- color: e.design.tokens["text.primary"]
172
- })), Ce = d("div")(({ theme: e }) => ({
173
- fontSize: o(e.design.typeScale.small),
174
- lineHeight: e.typography.body2.lineHeight,
175
- color: e.design.tokens["text.secondary"]
176
- })), be = d("div")({
177
- display: "flex",
178
- flex: "none",
179
- alignItems: "center",
180
- justifyContent: "flex-end",
181
- maxWidth: "100%",
182
- [D.down(O.Tablet)]: {
183
- justifyContent: "flex-start"
184
- }
185
- });
186
- function q({
187
- label: e,
188
- description: t,
189
- control: n,
190
- htmlFor: i
191
- }) {
192
- const c = h(), s = `${c}-label`, l = t !== void 0 ? `${c}-description` : void 0;
193
- return /* @__PURE__ */ g(
194
- he,
195
- {
196
- role: "group",
197
- "aria-labelledby": s,
198
- "aria-describedby": l,
199
- children: [
200
- /* @__PURE__ */ g(ke, { children: [
201
- /* @__PURE__ */ a(
202
- ve,
203
- {
204
- id: s,
205
- htmlFor: i,
206
- as: i === void 0 ? "span" : "label",
207
- children: e
208
- }
209
- ),
210
- t !== void 0 && /* @__PURE__ */ a(Ce, { id: l, children: t })
211
- ] }),
212
- /* @__PURE__ */ a(be, { children: n })
213
- ]
214
- }
215
- );
216
- }
217
- const B = "--abyss-toast-clearance", C = d(I)(({ theme: e }) => V(e)), Ae = d("div")(({ theme: e }) => {
218
- const { space: t, elevations: n, durations: i, easings: c } = e.design;
219
- return {
220
- position: "fixed",
221
- zIndex: e.zIndex.snackbar,
222
- bottom: o(t[6]),
223
- right: o(t[6]),
224
- width: 420,
225
- maxWidth: `calc(100vw - ${o(2 * t[6])})`,
226
- "& > *": {
227
- boxShadow: n.overlay,
228
- animation: `cookie-consent-in ${i.slow}ms ${c.sheet}`
229
- },
230
- "@keyframes cookie-consent-in": {
231
- from: { opacity: 0, transform: `translateY(${o(t[3])})` },
232
- to: { opacity: 1, transform: "translateY(0)" }
233
- },
234
- "@media (prefers-reduced-motion: reduce)": {
235
- "& > *": { animation: "none" }
236
- },
237
- [D.down(O.Tablet)]: {
238
- bottom: o(t[3]),
239
- right: o(t[3]),
240
- left: o(t[3]),
241
- width: "auto",
242
- maxWidth: "none"
243
- }
244
- };
245
- }), Se = d("h2")(({ theme: e }) => ({
246
- margin: 0,
247
- fontSize: o(e.design.typeScale.sectionTitle),
248
- fontWeight: $.semibold,
249
- color: e.design.tokens["text.primary"]
250
- })), we = d("p")(({ theme: e }) => ({
251
- margin: `${o(e.design.space[2])} 0 0`,
252
- fontSize: o(e.design.typeScale.body),
253
- color: e.design.tokens["text.secondary"]
254
- })), xe = d(se)(({ theme: e }) => ({
255
- alignSelf: "flex-start",
256
- marginTop: o(e.design.space[3]),
257
- fontSize: o(e.design.typeScale.body),
258
- color: e.design.tokens["accent.text"]
259
- })), Re = d("div")(({ theme: e }) => ({
260
- display: "flex",
261
- gap: o(e.design.space[2]),
262
- marginTop: o(e.design.space[4]),
263
- "& > *": { flex: 1 }
264
- })), Me = d(I)(({ theme: e }) => ({
265
- ...V(e),
266
- marginTop: o(e.design.space[2]),
267
- color: e.design.tokens["text.secondary"]
268
- })), Te = d("span")(({ theme: e }) => ({
269
- fontSize: o(e.design.typeScale.small),
270
- color: e.design.tokens["text.secondary"],
271
- whiteSpace: "nowrap"
272
- })), Ie = d("div")(({ theme: e }) => ({
273
- display: "flex",
274
- alignItems: "center",
275
- gap: o(e.design.space[2])
276
- }));
277
- function x({
278
- category: e,
279
- checked: t,
280
- locked: n = !1,
281
- onChange: i
282
- }) {
283
- const c = A(), s = h();
284
- return /* @__PURE__ */ a(
285
- q,
286
- {
287
- label: c.formatRichMessage({
288
- id: `cookies.category.${e}.title`
289
- }),
290
- description: c.formatRichMessage({
291
- id: `cookies.category.${e}.description`
292
- }),
293
- htmlFor: s,
294
- control: /* @__PURE__ */ g(Ie, { children: [
295
- n && /* @__PURE__ */ a(Te, { children: c.formatRichMessage({
296
- id: "cookies.category.essentials.always-on"
297
- }) }),
298
- /* @__PURE__ */ a(
299
- H,
300
- {
301
- id: s,
302
- checked: t,
303
- disabled: n,
304
- onChange: (l, u) => i == null ? void 0 : i(u)
305
- }
306
- )
307
- ] })
308
- }
309
- );
310
- }
311
- function De({ api: e }) {
312
- const t = A(), { acceptAll: n, rejectAll: i, save: c } = e, s = h(), l = h(), [u, f] = y(!1), [k, r] = y(!1), [S, G] = y(!1), z = Q(null);
313
- T(() => {
314
- const w = z.current;
315
- if (w === null)
316
- return;
317
- const _ = document.documentElement, v = () => {
318
- _.style.setProperty(
319
- B,
320
- o(window.innerHeight - w.getBoundingClientRect().top)
321
- );
322
- };
323
- v();
324
- const m = typeof ResizeObserver > "u" ? null : new ResizeObserver(v);
325
- return m == null || m.observe(w), window.addEventListener("resize", v), () => {
326
- m == null || m.disconnect(), window.removeEventListener("resize", v), _.style.removeProperty(B);
327
- };
328
- }, [u]);
329
- const J = () => {
330
- c({ analytics: k, marketing: S }), f(!1);
331
- };
332
- return /* @__PURE__ */ g(P, { children: [
333
- !u && /* @__PURE__ */ a(Ae, { ref: z, children: /* @__PURE__ */ g(
334
- Y,
335
- {
336
- padding: 4,
337
- role: "dialog",
338
- "aria-modal": !1,
339
- "aria-labelledby": s,
340
- "aria-describedby": l,
341
- children: [
342
- /* @__PURE__ */ a(Se, { id: s, children: t.formatRichMessage({ id: "cookies.banner.title" }) }),
343
- /* @__PURE__ */ a(we, { id: l, children: t.formatRichMessage({ id: "cookies.banner.description" }) }),
344
- /* @__PURE__ */ a(
345
- xe,
346
- {
347
- href: pe,
348
- rel: "noreferrer",
349
- underline: "hover",
350
- children: t.formatRichMessage({ id: "cookies.banner.privacy-link" })
351
- }
352
- ),
353
- /* @__PURE__ */ g(Re, { children: [
354
- /* @__PURE__ */ a(C, { variant: "contained", onClick: n, children: t.formatRichMessage({ id: "cookies.action.accept-all" }) }),
355
- /* @__PURE__ */ a(C, { variant: "outlined", onClick: i, children: t.formatRichMessage({ id: "cookies.action.reject-all" }) })
356
- ] }),
357
- /* @__PURE__ */ a(
358
- Me,
359
- {
360
- variant: "text",
361
- size: "small",
362
- fullWidth: !0,
363
- onClick: () => f(!0),
364
- children: t.formatRichMessage({ id: "cookies.action.configure" })
365
- }
366
- )
367
- ]
368
- }
369
- ) }),
370
- /* @__PURE__ */ g(
371
- te,
372
- {
373
- open: u,
374
- onClose: () => f(!1),
375
- size: ne.Small,
376
- title: t.formatRichMessage({ id: "cookies.configure.title" }),
377
- actions: /* @__PURE__ */ g(P, { children: [
378
- /* @__PURE__ */ a(C, { variant: "text", onClick: () => f(!1), children: t.formatRichMessage({ id: "cookies.action.cancel" }) }),
379
- /* @__PURE__ */ a(C, { variant: "contained", onClick: J, children: t.formatRichMessage({ id: "cookies.action.save" }) })
380
- ] }),
381
- children: [
382
- /* @__PURE__ */ a(x, { category: "essentials", checked: !0, locked: !0 }),
383
- /* @__PURE__ */ a(
384
- x,
385
- {
386
- category: "analytics",
387
- checked: k,
388
- onChange: r
389
- }
390
- ),
391
- /* @__PURE__ */ a(
392
- x,
393
- {
394
- category: "marketing",
395
- checked: S,
396
- onChange: G
397
- }
398
- )
399
- ]
400
- }
401
- )
402
- ] });
403
- }
404
- const E = X(null), Oe = () => {
405
- const e = F(E);
406
- if (!e)
407
- throw new Error(
408
- "useAbyssCookieConsent must be used inside <AbyssCookieConsentProvider>"
409
- );
410
- return e;
411
- }, He = () => F(E), Ye = ({ children: e, consentVersion: t, isAuthenticated: n, domain: i, renderBanner: c }) => {
412
- const s = ye({ isAuthenticated: n, consentVersion: t, domain: i }), l = Z(() => s.isResolved ? null : c ? c(s) : /* @__PURE__ */ a(De, { api: s }), [s, c]);
413
- return /* @__PURE__ */ g(E.Provider, { value: s, children: [
414
- e,
415
- l
416
- ] });
417
- }, $e = d(I)(({ theme: e }) => V(e)), Ve = d("h2")(({ theme: e }) => ({
418
- margin: `0 0 ${o(e.design.space[2])}`,
419
- fontSize: o(e.design.typeScale.sectionTitle),
420
- fontWeight: $.semibold,
421
- color: e.design.tokens["text.primary"]
422
- })), Ee = d("div")(({ theme: e }) => ({
423
- display: "flex",
424
- marginTop: o(e.design.space[3])
425
- }));
426
- function R({
427
- category: e,
428
- checked: t,
429
- locked: n = !1,
430
- onChange: i
431
- }) {
432
- const c = A(), s = h();
433
- return /* @__PURE__ */ a(
434
- q,
435
- {
436
- label: c.formatRichMessage({
437
- id: `cookies.category.${e}.title`
438
- }),
439
- description: c.formatRichMessage({
440
- id: `cookies.category.${e}.description`
441
- }),
442
- htmlFor: s,
443
- control: /* @__PURE__ */ a(
444
- H,
445
- {
446
- id: s,
447
- checked: t,
448
- disabled: n,
449
- onChange: (l, u) => i == null ? void 0 : i(u)
450
- }
451
- )
452
- }
453
- );
454
- }
455
- function Ke() {
456
- const e = A(), { consent: t, save: n } = Oe(), [i, c] = y((t == null ? void 0 : t.analytics) ?? !1), [s, l] = y((t == null ? void 0 : t.marketing) ?? !1), u = t == null ? void 0 : t.analytics, f = t == null ? void 0 : t.marketing;
457
- return T(() => {
458
- u !== void 0 && c(u), f !== void 0 && l(f);
459
- }, [u, f]), /* @__PURE__ */ g(Y, { padding: 4, children: [
460
- /* @__PURE__ */ a(Ve, { children: e.formatRichMessage({ id: "cookies.configure.title" }) }),
461
- /* @__PURE__ */ a(R, { category: "essentials", checked: !0, locked: !0 }),
462
- /* @__PURE__ */ a(
463
- R,
464
- {
465
- category: "analytics",
466
- checked: i,
467
- onChange: c
468
- }
469
- ),
470
- /* @__PURE__ */ a(
471
- R,
472
- {
473
- category: "marketing",
474
- checked: s,
475
- onChange: l
476
- }
477
- ),
478
- /* @__PURE__ */ a(Ee, { children: /* @__PURE__ */ a(
479
- $e,
480
- {
481
- variant: "contained",
482
- onClick: () => n({ analytics: i, marketing: s }),
483
- children: e.formatRichMessage({ id: "cookies.action.save" })
484
- }
485
- ) })
486
- ] });
487
- }
488
- export {
489
- Ye as A,
490
- De as C,
491
- pe as D,
492
- M as R,
493
- q as S,
494
- B as T,
495
- K as V,
496
- He as a,
497
- Ke as b,
498
- ye as c,
499
- b as d,
500
- de as e,
501
- le as f,
502
- re as r,
503
- Oe as u,
504
- L as w
505
- };