@abyss-project/commons-front-core 13.3.0 → 15.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.
- package/README.md +1 -1
- package/catalog/captures-plan.ts +4 -1
- package/catalog/catalog-entries.ts +6 -1
- package/catalog/expected-error.ts +6 -0
- package/catalog/pages/CookieConsent.tsx +38 -0
- package/catalog/pages/ErrorBoundary.tsx +22 -0
- package/catalog/pages/PasswordField.tsx +62 -0
- package/catalog/pages/Toast.tsx +17 -6
- package/catalog/pages/index.ts +6 -0
- package/catalog/specs/captures.spec.ts +10 -0
- package/catalog/specs/catalog-page.ts +6 -1
- package/catalog/specs/write-capture-index.ts +1 -0
- package/dist/CookieConsentSettings-B7NfjgaI.js +505 -0
- package/dist/{use-rich-intl.hook-BETUyCkW.js → Surface-BEhoEhyC.js} +844 -161
- package/dist/Tabs-DJ9_ZFjM.js +1946 -0
- package/dist/auth/components/AuthFlow/auth-flow.types.d.ts +2 -0
- package/dist/auth/components/AuthFlow/steps/MfaEnrollmentStep.component.d.ts +2 -0
- package/dist/auth/components/AuthFlow/steps/MfaStep.component.d.ts +10 -4
- package/dist/auth/components/AuthFlow/steps/PasskeyNudgeStep.component.d.ts +3 -1
- package/dist/auth/components/AuthHeroLayout/auth-hero-gradient.d.ts +18 -0
- package/dist/auth/components/MfaRequirementBanner/MfaRequirementBanner.component.d.ts +3 -1
- package/dist/auth/components/SecuritySettings/SecuritySettings.component.d.ts +1 -1
- package/dist/auth/components/SecuritySettings/sections/PasskeysSection.component.d.ts +6 -1
- package/dist/auth/components/SecuritySettings/sections/RecoveryCodesSection.component.d.ts +3 -1
- package/dist/auth/components/SecuritySettings/sections/TrustedDevicesSection.component.d.ts +6 -0
- package/dist/auth/components/index.d.ts +1 -0
- package/dist/auth/components/shared/AuthLoadingScreen.component.d.ts +5 -0
- package/dist/auth/components/shared/SingleDevicePasskeyAdvice.component.d.ts +13 -0
- package/dist/auth/components/shared/passkey-ceremonies.d.ts +6 -1
- package/dist/auth/components/shared/support-contact.d.ts +2 -0
- package/dist/auth/components/shared/use-async-resource.hook.d.ts +4 -1
- package/dist/auth/components/test-support/auth-sdk.mock.d.ts +5 -0
- package/dist/auth/components/test-support/auth-test-harness.d.ts +3 -0
- package/dist/clsx-OuTLNxxd.js +16 -0
- package/dist/{legacy/components/CookieConsent/CookieConsentBanner.component.d.ts → components/business/CookieConsent/CookieConsentBanner.d.ts} +1 -2
- package/dist/components/business/CookieConsent/CookieConsentSettings.d.ts +1 -0
- package/dist/{legacy/components → components/business}/CookieConsent/index.d.ts +2 -2
- package/dist/components/business/Support/AbyssServiceSelect.component.d.ts +26 -0
- package/dist/components/business/Support/SupportActionButtons.component.d.ts +7 -0
- package/dist/components/business/Support/SupportActivityLog.component.d.ts +7 -0
- package/dist/components/business/Support/SupportAttachmentsPanel.component.d.ts +7 -0
- package/dist/components/business/Support/SupportCategoryChip.component.d.ts +12 -0
- package/dist/components/business/Support/SupportCategoryGroupCards.component.d.ts +2 -0
- package/dist/components/business/Support/SupportCategorySelect.component.d.ts +21 -0
- package/dist/components/business/Support/SupportCreateTextField.d.ts +17 -0
- package/dist/components/business/Support/SupportMessageAttachment.component.d.ts +9 -0
- package/dist/components/business/Support/SupportMessageInput.component.d.ts +7 -0
- package/dist/components/business/Support/SupportMessageLink.component.d.ts +8 -0
- package/dist/components/business/Support/SupportMessageLink.component.spec.d.ts +1 -0
- package/dist/components/business/Support/SupportMessageThread.component.d.ts +8 -0
- package/dist/components/business/Support/SupportMessageThread.component.spec.d.ts +1 -0
- package/dist/components/business/Support/SupportPill.d.ts +18 -0
- package/dist/components/business/Support/SupportPriorityChip.component.d.ts +3 -0
- package/dist/components/business/Support/SupportSidebar.component.d.ts +7 -0
- package/dist/components/business/Support/SupportSidebar.component.spec.d.ts +1 -0
- package/dist/components/business/Support/SupportStatusBadge.component.d.ts +3 -0
- package/dist/components/business/Support/SupportStatusTimeline.component.d.ts +15 -0
- package/dist/components/business/Support/SupportSystemMessage.component.d.ts +11 -0
- package/dist/components/business/Support/SupportSystemMessage.component.spec.d.ts +1 -0
- package/dist/components/business/Support/SupportTagEditor.d.ts +15 -0
- package/dist/components/business/Support/SupportTicketCreateForm.component.d.ts +2 -0
- package/dist/components/business/Support/SupportTicketCreateForm.component.spec.d.ts +1 -0
- package/dist/components/business/Support/SupportTicketCreateStepper.component.d.ts +2 -0
- package/dist/components/business/Support/SupportTicketCreateStepper.component.spec.d.ts +1 -0
- package/dist/components/business/Support/SupportTicketDetail.component.d.ts +8 -0
- package/dist/components/business/Support/SupportTicketDetail.component.spec.d.ts +1 -0
- package/dist/components/business/Support/SupportTicketDetail.mobile-layout.spec.d.ts +1 -0
- package/dist/components/business/Support/SupportTicketList.component.spec.d.ts +1 -0
- package/dist/components/business/Support/SupportTicketList.week-preset.spec.d.ts +1 -0
- package/dist/components/business/Support/SupportTicketListFilterBar.d.ts +15 -0
- package/dist/components/business/Support/SupportTopBar.component.d.ts +7 -0
- package/dist/components/business/Support/support-action.d.ts +17 -0
- package/dist/components/business/Support/support-action.logic.d.ts +12 -0
- package/dist/components/business/Support/support-action.logic.spec.d.ts +1 -0
- package/dist/components/business/Support/support-attachment.logic.spec.d.ts +1 -0
- package/dist/components/business/Support/support-author.logic.spec.d.ts +1 -0
- package/dist/components/business/Support/support-create-stepper.logic.spec.d.ts +1 -0
- package/dist/components/business/Support/support-create.logic.d.ts +28 -0
- package/dist/components/business/Support/support-create.logic.spec.d.ts +1 -0
- package/dist/components/business/Support/support-message-anchor.d.ts +4 -0
- package/dist/components/business/Support/support-message-input.logic.spec.d.ts +1 -0
- package/dist/components/business/Support/support-service.logic.spec.d.ts +1 -0
- package/dist/components/business/Support/support-status-timeline.logic.spec.d.ts +1 -0
- package/dist/components/business/Support/support-tone.d.ts +11 -0
- package/dist/components/business/Support/test-support/support-detail.fixtures.d.ts +7 -0
- package/dist/components/business/Support/test-support/support-thread.fixtures.d.ts +9 -0
- package/dist/{legacy/components → components/business}/Support/types.d.ts +13 -4
- package/dist/components/business/Support/use-support-create-error-message.hook.d.ts +4 -0
- package/dist/components/business/index.d.ts +23 -0
- package/dist/components/inputs/ExpressionSearch/ExpressionSearch.d.ts +6 -1
- package/dist/components/inputs/FormField/FormField.d.ts +5 -1
- package/dist/components/inputs/PasswordField/PasswordField.d.ts +40 -0
- package/dist/components/inputs/PasswordField/PasswordField.spec.d.ts +1 -0
- package/dist/components/inputs/SegmentedControl/SegmentedControl.d.ts +9 -1
- package/dist/components/inputs/index.d.ts +1 -0
- package/dist/components/layers/Toast/Toast.d.ts +3 -18
- package/dist/components/layers/Toast/toast-clearance.d.ts +6 -0
- package/dist/components/layers/Toast/toast-store.d.ts +76 -0
- package/dist/components/states/ErrorBoundary/ErrorBoundary.d.ts +17 -0
- package/dist/components/states/ErrorBoundary/ErrorBoundary.spec.d.ts +1 -0
- package/dist/components/states/PageState/PageState.d.ts +3 -1
- package/dist/components/states/index.d.ts +1 -0
- package/dist/cookie-consent.d.ts +1 -1
- package/dist/cookie-consent.js +14 -15
- package/dist/demo/DemoBanner/DemoBanner.d.ts +16 -0
- package/dist/demo/DemoBanner/DemoBanner.spec.d.ts +1 -0
- package/dist/demo/DemoBanner/index.d.ts +1 -0
- package/dist/demo/demo-blocked.interceptor.d.ts +7 -0
- package/dist/demo/demo.en.d.ts +17 -0
- package/dist/demo/demo.fr.d.ts +17 -0
- package/dist/demo/index.d.ts +3 -0
- package/dist/demo/tests/demo-blocked.interceptor.spec.d.ts +1 -0
- package/dist/demo/use-demo-account.hook.d.ts +19 -0
- package/dist/design-theme-N9jJSXdK.js +27605 -0
- package/dist/{editors-CUsZNFfw.js → editors-QM76tqZI.js} +84 -84
- package/dist/editors.js +1 -1
- package/dist/hooks/use-rich-intl.hook.d.ts +210 -0
- package/dist/{index-CiDg4J7c.js → index-3-SmpH5N.js} +4 -4
- package/dist/{index-DErJ9c2q.js → index-4b2f7sdW.js} +2 -2
- package/dist/{index-DEBTvCWD.js → index-5OVR3WNo.js} +3 -3
- package/dist/{index-Lyt4_W7a.js → index-BKAfoA1a.js} +2 -2
- package/dist/{AbyssCloud-D_AbU9k7.js → index-C27b790L.js} +1438 -1083
- package/dist/{index-CYUixRIB.js → index-C6jhogFt.js} +2 -2
- package/dist/{index-D1ro2oTw.js → index-CM5COMvb.js} +2 -2
- package/dist/{index-BQ4GXlMJ.js → index-COUUAr5G.js} +1 -1
- package/dist/{index-C7a2XXcz.js → index-CQU0eEXk.js} +4 -4
- package/dist/{index-YzYX-H93.js → index-Ce0rv5wr.js} +3 -3
- package/dist/{index-CM0x-TnE.js → index-D1M_muSg.js} +2 -2
- package/dist/{index-CDpC4_po.js → index-D8ncJrf1.js} +2 -2
- package/dist/{index-DuMzZrqc.js → index-DA-HUFp6.js} +2 -2
- package/dist/{index-BzoBMWdL.js → index-DCk0q3d7.js} +3 -3
- package/dist/{index-Bn4gTAno.js → index-DW3SBSsW.js} +2 -2
- package/dist/{index-BhFOCfCj.js → index-DYXAfA_s.js} +2 -2
- package/dist/{index-pnfk6VZ7.js → index-DmAoL9-1.js} +4 -4
- package/dist/{index-CjV5ui_B.js → index-Taee9VIc.js} +2 -2
- package/dist/{index-GTkZik4b.js → index-jZGexiyT.js} +3 -3
- package/dist/{index-Ba41aBBN.js → index-mmrA4ErC.js} +2 -2
- package/dist/{index-TB7ekLl-.js → index-nKbvjf2P.js} +2 -2
- package/dist/{index-DobX4g2g.js → index-pX3CTxFd.js} +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +14545 -9182
- package/dist/legacy/components/Spotlight/ProjectLinkSelector/index.d.ts +1 -4
- package/dist/legacy/components/index.d.ts +1 -2
- package/dist/legacy/legacy-support-removed.spec.d.ts +1 -0
- package/dist/legacy.js +13350 -17922
- package/dist/theme/index.d.ts +1 -1
- package/dist/translations/en.d.ts +104 -0
- package/dist/translations/fr.d.ts +104 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/project-link-mode.d.ts +4 -0
- package/dist/utils/project-link-wording.utils.d.ts +1 -1
- package/dist/utils/service-config.d.ts +8 -0
- package/dist/utils/service-config.spec.d.ts +1 -0
- package/package.json +3 -3
- package/vite.config.ts +1 -1
- package/dist/AbyssCookieConsentProvider-Ds99df0E.js +0 -4562
- package/dist/CookieConsentSettings.component-DoWLHqw5.js +0 -78
- package/dist/Tabs-C1qcQ2i5.js +0 -2335
- package/dist/clsx-D8ItxkrZ.js +0 -446
- package/dist/design-theme-CYGZ6mAh.js +0 -23975
- package/dist/legacy/components/CookieConsent/CookieConsentSettings.component.d.ts +0 -2
- package/dist/legacy/components/Support/AbyssServiceSelect.component.d.ts +0 -37
- package/dist/legacy/components/Support/SupportActionButtons.component.d.ts +0 -3
- package/dist/legacy/components/Support/SupportActivityLog.component.d.ts +0 -3
- package/dist/legacy/components/Support/SupportAttachmentsPanel.component.d.ts +0 -3
- package/dist/legacy/components/Support/SupportCategoryChip.component.d.ts +0 -9
- package/dist/legacy/components/Support/SupportCategoryGroupCards.component.d.ts +0 -3
- package/dist/legacy/components/Support/SupportCategorySelect.component.d.ts +0 -22
- package/dist/legacy/components/Support/SupportMessageInput.component.d.ts +0 -3
- package/dist/legacy/components/Support/SupportMessageThread.component.d.ts +0 -3
- package/dist/legacy/components/Support/SupportPriorityChip.component.d.ts +0 -3
- package/dist/legacy/components/Support/SupportSidebar.component.d.ts +0 -3
- package/dist/legacy/components/Support/SupportStatusBadge.component.d.ts +0 -3
- package/dist/legacy/components/Support/SupportStatusTimeline.component.d.ts +0 -10
- package/dist/legacy/components/Support/SupportTicketCreateForm.component.d.ts +0 -3
- package/dist/legacy/components/Support/SupportTicketCreateStepper.component.d.ts +0 -3
- package/dist/legacy/components/Support/SupportTicketDetail.component.d.ts +0 -3
- package/dist/legacy/components/Support/SupportTopBar.component.d.ts +0 -3
- package/dist/legacy/components/Support/index.d.ts +0 -18
- /package/dist/{legacy/components/CookieConsent/AbyssCookieConsentProvider.spec.d.ts → auth/components/AuthFlow/steps/MfaStep.component.spec.d.ts} +0 -0
- /package/dist/{legacy/components/Support/SupportCategoryPick.component.spec.d.ts → auth/components/SecuritySettings/sections/SessionsSection.component.spec.d.ts} +0 -0
- /package/dist/{legacy/components/Support/SupportMessageLink.component.spec.d.ts → auth/components/shared/use-async-resource.hook.spec.d.ts} +0 -0
- /package/dist/{legacy/components → components/business}/CookieConsent/AbyssCookieConsentProvider.d.ts +0 -0
- /package/dist/{legacy/components/Support/SupportSystemMessage.component.spec.d.ts → components/business/CookieConsent/AbyssCookieConsentProvider.spec.d.ts} +0 -0
- /package/dist/{legacy/components/Support/SupportTicketDetail.mobile-layout.spec.d.ts → components/business/CookieConsent/CookieConsent.spec.d.ts} +0 -0
- /package/dist/{legacy/components/Support/SupportTicketList.week-preset.spec.d.ts → components/business/Support/AbyssServiceSelect.component.spec.d.ts} +0 -0
- /package/dist/{legacy/components/Support/support-attachment.logic.spec.d.ts → components/business/Support/SupportActivityLog.component.spec.d.ts} +0 -0
- /package/dist/{legacy/components/Support/support-author.logic.spec.d.ts → components/business/Support/SupportAttachmentsPanel.component.spec.d.ts} +0 -0
- /package/dist/{legacy/components/Support/support-create-stepper.logic.spec.d.ts → components/business/Support/SupportBadges.spec.d.ts} +0 -0
- /package/dist/{legacy/components/Support/support-message-input.logic.spec.d.ts → components/business/Support/SupportCategoryGroupCards.component.spec.d.ts} +0 -0
- /package/dist/{legacy/components/Support/support-service.logic.spec.d.ts → components/business/Support/SupportCategorySelect.component.spec.d.ts} +0 -0
- /package/dist/{legacy/components/Support/support-status-timeline.logic.spec.d.ts → components/business/Support/SupportMessageInput.component.spec.d.ts} +0 -0
- /package/dist/{legacy/components → components/business}/Support/SupportTicketList.component.d.ts +0 -0
- /package/dist/{legacy/components → components/business}/Support/support-attachment.logic.d.ts +0 -0
- /package/dist/{legacy/components → components/business}/Support/support-author.logic.d.ts +0 -0
- /package/dist/{legacy/components → components/business}/Support/support-category.logic.d.ts +0 -0
- /package/dist/{legacy/components → components/business}/Support/support-create-stepper.logic.d.ts +0 -0
- /package/dist/{legacy/components → components/business}/Support/support-message-input.logic.d.ts +0 -0
- /package/dist/{legacy/components → components/business}/Support/support-service.logic.d.ts +0 -0
- /package/dist/{legacy/components → components/business}/Support/support-status-timeline.logic.d.ts +0 -0
- /package/dist/{legacy/components → components/business}/Support/support-system-message.logic.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-BEhoEhyC.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
|
+
};
|