@abyss-project/commons-front-core 13.3.0 → 14.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 (94) hide show
  1. package/catalog/captures-plan.ts +4 -1
  2. package/catalog/catalog-entries.ts +6 -1
  3. package/catalog/expected-error.ts +6 -0
  4. package/catalog/pages/CookieConsent.tsx +38 -0
  5. package/catalog/pages/ErrorBoundary.tsx +22 -0
  6. package/catalog/pages/PasswordField.tsx +62 -0
  7. package/catalog/pages/Toast.tsx +17 -6
  8. package/catalog/pages/index.ts +6 -0
  9. package/catalog/specs/captures.spec.ts +10 -0
  10. package/catalog/specs/catalog-page.ts +6 -1
  11. package/catalog/specs/write-capture-index.ts +1 -0
  12. package/dist/{AbyssCloud-D_AbU9k7.js → AbyssCloud-B3rMelRi.js} +636 -712
  13. package/dist/CookieConsentSettings-DyJGEnVA.js +505 -0
  14. package/dist/{use-rich-intl.hook-BETUyCkW.js → Surface-B_J_I_1i.js} +700 -147
  15. package/dist/Tabs-_TzugjHZ.js +1941 -0
  16. package/dist/auth/components/AuthHeroLayout/auth-hero-gradient.d.ts +18 -0
  17. package/dist/auth/components/shared/AuthLoadingScreen.component.d.ts +5 -0
  18. package/dist/auth/components/shared/use-async-resource.hook.d.ts +4 -1
  19. package/dist/auth/components/shared/use-async-resource.hook.spec.d.ts +1 -0
  20. package/dist/components/business/CookieConsent/AbyssCookieConsentProvider.spec.d.ts +1 -0
  21. package/dist/components/business/CookieConsent/CookieConsent.spec.d.ts +1 -0
  22. package/dist/{legacy/components/CookieConsent/CookieConsentBanner.component.d.ts → components/business/CookieConsent/CookieConsentBanner.d.ts} +1 -2
  23. package/dist/components/business/CookieConsent/CookieConsentSettings.d.ts +1 -0
  24. package/dist/{legacy/components → components/business}/CookieConsent/index.d.ts +2 -2
  25. package/dist/components/business/index.d.ts +3 -0
  26. package/dist/components/inputs/FormField/FormField.d.ts +5 -1
  27. package/dist/components/inputs/PasswordField/PasswordField.d.ts +40 -0
  28. package/dist/components/inputs/PasswordField/PasswordField.spec.d.ts +1 -0
  29. package/dist/components/inputs/index.d.ts +1 -0
  30. package/dist/components/layers/Toast/Toast.d.ts +3 -18
  31. package/dist/components/layers/Toast/toast-clearance.d.ts +6 -0
  32. package/dist/components/layers/Toast/toast-store.d.ts +76 -0
  33. package/dist/components/states/ErrorBoundary/ErrorBoundary.d.ts +17 -0
  34. package/dist/components/states/ErrorBoundary/ErrorBoundary.spec.d.ts +1 -0
  35. package/dist/components/states/PageState/PageState.d.ts +3 -1
  36. package/dist/components/states/index.d.ts +1 -0
  37. package/dist/cookie-consent.d.ts +1 -1
  38. package/dist/cookie-consent.js +14 -15
  39. package/dist/demo/DemoBanner/DemoBanner.d.ts +16 -0
  40. package/dist/demo/DemoBanner/DemoBanner.spec.d.ts +1 -0
  41. package/dist/demo/DemoBanner/index.d.ts +1 -0
  42. package/dist/demo/demo-blocked.interceptor.d.ts +7 -0
  43. package/dist/demo/demo.en.d.ts +17 -0
  44. package/dist/demo/demo.fr.d.ts +17 -0
  45. package/dist/demo/index.d.ts +3 -0
  46. package/dist/demo/tests/demo-blocked.interceptor.spec.d.ts +1 -0
  47. package/dist/demo/use-demo-account.hook.d.ts +19 -0
  48. package/dist/design-theme-D5L0JNbX.js +26599 -0
  49. package/dist/{editors-CUsZNFfw.js → editors-C6Rocm6M.js} +83 -83
  50. package/dist/editors.js +1 -1
  51. package/dist/hooks/use-rich-intl.hook.d.ts +80 -0
  52. package/dist/{index-BQ4GXlMJ.js → index-5AavH8Oo.js} +1 -1
  53. package/dist/{index-Bn4gTAno.js → index-B58_3EoW.js} +2 -2
  54. package/dist/{index-DuMzZrqc.js → index-BElPTqLa.js} +2 -2
  55. package/dist/{index-D1ro2oTw.js → index-BI4ooqu1.js} +2 -2
  56. package/dist/{index-TB7ekLl-.js → index-BYDMmzla.js} +2 -2
  57. package/dist/{index-CM0x-TnE.js → index-C1GCQ2Ke.js} +2 -2
  58. package/dist/{index-DEBTvCWD.js → index-C1I7MW-q.js} +3 -3
  59. package/dist/{index-pnfk6VZ7.js → index-CDI4_t7D.js} +4 -4
  60. package/dist/{index-Lyt4_W7a.js → index-CDWJlhuZ.js} +2 -2
  61. package/dist/{index-C7a2XXcz.js → index-CKJMsjnV.js} +4 -4
  62. package/dist/{index-CDpC4_po.js → index-Cskjr11h.js} +2 -2
  63. package/dist/{index-DErJ9c2q.js → index-CuYK_i3Q.js} +2 -2
  64. package/dist/{index-GTkZik4b.js → index-Cwgj3j50.js} +3 -3
  65. package/dist/{index-CjV5ui_B.js → index-Czhx2OUB.js} +2 -2
  66. package/dist/{index-CiDg4J7c.js → index-DGoR-pBV.js} +4 -4
  67. package/dist/{index-YzYX-H93.js → index-DjAZPCEQ.js} +3 -3
  68. package/dist/{index-Ba41aBBN.js → index-Dutd4cJm.js} +2 -2
  69. package/dist/{index-DobX4g2g.js → index-Dym_r-do.js} +2 -2
  70. package/dist/{index-BhFOCfCj.js → index-TshVV9T4.js} +2 -2
  71. package/dist/{index-BzoBMWdL.js → index-UjGNADrL.js} +3 -3
  72. package/dist/{index-CYUixRIB.js → index-u-EAOYOb.js} +2 -2
  73. package/dist/index.d.ts +1 -0
  74. package/dist/index.js +5483 -4750
  75. package/dist/legacy/components/Spotlight/ProjectLinkSelector/index.d.ts +1 -4
  76. package/dist/legacy/components/Support/AbyssServiceSelect.component.d.ts +1 -1
  77. package/dist/legacy/components/index.d.ts +1 -1
  78. package/dist/legacy.js +9626 -8129
  79. package/dist/translations/en.d.ts +39 -0
  80. package/dist/translations/fr.d.ts +39 -0
  81. package/dist/utils/index.d.ts +2 -0
  82. package/dist/utils/project-link-mode.d.ts +4 -0
  83. package/dist/utils/project-link-wording.utils.d.ts +1 -1
  84. package/dist/utils/service-config.d.ts +8 -0
  85. package/dist/utils/service-config.spec.d.ts +1 -0
  86. package/package.json +3 -3
  87. package/vite.config.ts +1 -1
  88. package/dist/AbyssCookieConsentProvider-Ds99df0E.js +0 -4562
  89. package/dist/CookieConsentSettings.component-DoWLHqw5.js +0 -78
  90. package/dist/Tabs-C1qcQ2i5.js +0 -2335
  91. package/dist/design-theme-CYGZ6mAh.js +0 -23975
  92. package/dist/legacy/components/CookieConsent/CookieConsentSettings.component.d.ts +0 -2
  93. /package/dist/{legacy/components/CookieConsent/AbyssCookieConsentProvider.spec.d.ts → auth/components/SecuritySettings/sections/SessionsSection.component.spec.d.ts} +0 -0
  94. /package/dist/{legacy/components → components/business}/CookieConsent/AbyssCookieConsentProvider.d.ts +0 -0
@@ -0,0 +1,505 @@
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-B_J_I_1i.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
+ };