@redacto.io/consent-sdk-react 10.2.2-beta.1 → 10.2.2-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +16 -1
- package/dist/index.d.ts +16 -1
- package/dist/index.js +457 -228
- package/dist/index.mjs +457 -228
- package/dist/privacy-center.d.mts +1 -1
- package/dist/privacy-center.d.ts +1 -1
- package/dist/privacy-center.js +17 -12
- package/dist/privacy-center.mjs +17 -12
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -668,6 +668,15 @@ var CONFIRM_DIALOG_COPY = {
|
|
|
668
668
|
confirm: "Yes",
|
|
669
669
|
cancel: "No"
|
|
670
670
|
};
|
|
671
|
+
var OTP_GATE_LENGTH = 6;
|
|
672
|
+
var OTP_GATE_COPY = {
|
|
673
|
+
title: "Enter the verification code",
|
|
674
|
+
description: "Ask the customer to read out the code they were sent. Your selections are locked until it is confirmed.",
|
|
675
|
+
submit: "Confirm code",
|
|
676
|
+
verifying: "Verifying...",
|
|
677
|
+
failed: "Could not verify that code."
|
|
678
|
+
};
|
|
679
|
+
var PRODUCT_POLICIES_LABEL = "Privacy policies:";
|
|
671
680
|
|
|
672
681
|
// src/RedactoNoticeConsent/styles.ts
|
|
673
682
|
var styles = {
|
|
@@ -1062,6 +1071,65 @@ var styles = {
|
|
|
1062
1071
|
textAlign: "center",
|
|
1063
1072
|
fontFamily: "inherit"
|
|
1064
1073
|
},
|
|
1074
|
+
otpGateLocked: {
|
|
1075
|
+
pointerEvents: "none",
|
|
1076
|
+
opacity: 0.55
|
|
1077
|
+
},
|
|
1078
|
+
otpGatePanel: {
|
|
1079
|
+
margin: "8px 0 4px",
|
|
1080
|
+
padding: "12px",
|
|
1081
|
+
border: "1px solid #e5e7eb",
|
|
1082
|
+
borderRadius: "8px",
|
|
1083
|
+
background: "#f9fafb"
|
|
1084
|
+
},
|
|
1085
|
+
otpGateTitle: {
|
|
1086
|
+
margin: 0,
|
|
1087
|
+
fontSize: "13px",
|
|
1088
|
+
fontWeight: 600,
|
|
1089
|
+
color: "#111827"
|
|
1090
|
+
},
|
|
1091
|
+
otpGateDescription: {
|
|
1092
|
+
margin: "4px 0 10px",
|
|
1093
|
+
fontSize: "12px",
|
|
1094
|
+
lineHeight: 1.4,
|
|
1095
|
+
color: "#6b7280"
|
|
1096
|
+
},
|
|
1097
|
+
otpGateDigits: {
|
|
1098
|
+
display: "flex",
|
|
1099
|
+
gap: "8px",
|
|
1100
|
+
justifyContent: "space-between"
|
|
1101
|
+
},
|
|
1102
|
+
otpGateDigit: {
|
|
1103
|
+
width: "100%",
|
|
1104
|
+
minWidth: 0,
|
|
1105
|
+
boxSizing: "border-box",
|
|
1106
|
+
padding: "10px 0",
|
|
1107
|
+
fontSize: "18px",
|
|
1108
|
+
fontWeight: 600,
|
|
1109
|
+
textAlign: "center",
|
|
1110
|
+
border: "1px solid #d1d5db",
|
|
1111
|
+
borderRadius: "8px",
|
|
1112
|
+
background: "#ffffff"
|
|
1113
|
+
},
|
|
1114
|
+
otpGateInput: {
|
|
1115
|
+
width: "100%",
|
|
1116
|
+
boxSizing: "border-box",
|
|
1117
|
+
padding: "8px 10px",
|
|
1118
|
+
fontSize: "16px",
|
|
1119
|
+
letterSpacing: "0.3em",
|
|
1120
|
+
textAlign: "center",
|
|
1121
|
+
border: "1px solid #d1d5db",
|
|
1122
|
+
borderRadius: "6px"
|
|
1123
|
+
},
|
|
1124
|
+
otpGateError: {
|
|
1125
|
+
margin: "8px 0 0",
|
|
1126
|
+
fontSize: "12px",
|
|
1127
|
+
color: "#dc2626"
|
|
1128
|
+
},
|
|
1129
|
+
otpGateButton: {
|
|
1130
|
+
width: "100%",
|
|
1131
|
+
marginTop: "10px"
|
|
1132
|
+
},
|
|
1065
1133
|
acceptButton: {
|
|
1066
1134
|
backgroundColor: "#4f87ff",
|
|
1067
1135
|
border: "none",
|
|
@@ -3434,6 +3502,7 @@ var RedactoNoticeConsent = ({
|
|
|
3434
3502
|
onAccept,
|
|
3435
3503
|
onDecline,
|
|
3436
3504
|
onError,
|
|
3505
|
+
otpGate,
|
|
3437
3506
|
settings,
|
|
3438
3507
|
applicationId,
|
|
3439
3508
|
validateAgainst = "all",
|
|
@@ -3445,7 +3514,7 @@ var RedactoNoticeConsent = ({
|
|
|
3445
3514
|
reviewModeButtonText = "Continue",
|
|
3446
3515
|
defaultOpenProducts
|
|
3447
3516
|
}) => {
|
|
3448
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
3517
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B;
|
|
3449
3518
|
const sandboxParams = useMemo2(
|
|
3450
3519
|
() => ({
|
|
3451
3520
|
token,
|
|
@@ -3539,6 +3608,19 @@ var RedactoNoticeConsent = ({
|
|
|
3539
3608
|
const [selfDeclaredAdult, setSelfDeclaredAdult] = useState(false);
|
|
3540
3609
|
const [showGuardianForm, setShowGuardianForm] = useState(false);
|
|
3541
3610
|
const [isSubmittingGuardian, setIsSubmittingGuardian] = useState(false);
|
|
3611
|
+
const [otpPendingMode, setOtpPendingMode] = useState(null);
|
|
3612
|
+
const otpVerifiedRef = useRef3(false);
|
|
3613
|
+
const otpTokenAtVerifyRef = useRef3(void 0);
|
|
3614
|
+
const [otpAcceptAfterToken, setOtpAcceptAfterToken] = useState(null);
|
|
3615
|
+
const [otpCode, setOtpCode] = useState("");
|
|
3616
|
+
const [otpError, setOtpError] = useState(null);
|
|
3617
|
+
const [otpBusy, setOtpBusy] = useState(false);
|
|
3618
|
+
const otpLocked = otpPendingMode !== null;
|
|
3619
|
+
const focusOtpDigit = (index) => {
|
|
3620
|
+
var _a2;
|
|
3621
|
+
if (index < 0 || index >= OTP_GATE_LENGTH) return;
|
|
3622
|
+
(_a2 = document.getElementById(`notice-otp-digit-${index}`)) == null ? void 0 : _a2.focus();
|
|
3623
|
+
};
|
|
3542
3624
|
const [guardianFormData, setGuardianFormData] = useState({
|
|
3543
3625
|
guardianName: "",
|
|
3544
3626
|
guardianContact: "",
|
|
@@ -4366,6 +4448,11 @@ var RedactoNoticeConsent = ({
|
|
|
4366
4448
|
};
|
|
4367
4449
|
const handleAccept = async (mode = "selected") => {
|
|
4368
4450
|
const submitController = new AbortController();
|
|
4451
|
+
if ((otpGate == null ? void 0 : otpGate.required) && !otpVerifiedRef.current) {
|
|
4452
|
+
setOtpPendingMode(mode);
|
|
4453
|
+
setOtpError(null);
|
|
4454
|
+
return;
|
|
4455
|
+
}
|
|
4369
4456
|
try {
|
|
4370
4457
|
if (isMinorFlow && !verificationReference) {
|
|
4371
4458
|
setErrorMessage(
|
|
@@ -5289,6 +5376,58 @@ var RedactoNoticeConsent = ({
|
|
|
5289
5376
|
(content == null ? void 0 : content.decline_button_text) || DEFAULT_DECLINE_BUTTON_TEXT
|
|
5290
5377
|
)
|
|
5291
5378
|
};
|
|
5379
|
+
const handleOtpConfirm = async () => {
|
|
5380
|
+
var _a2;
|
|
5381
|
+
if (!otpGate || otpCode.length !== OTP_GATE_LENGTH) {
|
|
5382
|
+
return;
|
|
5383
|
+
}
|
|
5384
|
+
setOtpBusy(true);
|
|
5385
|
+
setOtpError(null);
|
|
5386
|
+
const result = await otpGate.onVerify(otpCode);
|
|
5387
|
+
if (!result.ok) {
|
|
5388
|
+
setOtpError((_a2 = result.message) != null ? _a2 : OTP_GATE_COPY.failed);
|
|
5389
|
+
setOtpCode("");
|
|
5390
|
+
setOtpBusy(false);
|
|
5391
|
+
return;
|
|
5392
|
+
}
|
|
5393
|
+
const mode = otpPendingMode != null ? otpPendingMode : "selected";
|
|
5394
|
+
otpVerifiedRef.current = true;
|
|
5395
|
+
setOtpPendingMode(null);
|
|
5396
|
+
setOtpBusy(false);
|
|
5397
|
+
otpTokenAtVerifyRef.current = accessToken;
|
|
5398
|
+
setOtpAcceptAfterToken(mode);
|
|
5399
|
+
};
|
|
5400
|
+
useEffect4(() => {
|
|
5401
|
+
if (!otpAcceptAfterToken) {
|
|
5402
|
+
return;
|
|
5403
|
+
}
|
|
5404
|
+
if (accessToken === otpTokenAtVerifyRef.current) {
|
|
5405
|
+
return;
|
|
5406
|
+
}
|
|
5407
|
+
const mode = otpAcceptAfterToken;
|
|
5408
|
+
setOtpAcceptAfterToken(null);
|
|
5409
|
+
void handleAccept(mode);
|
|
5410
|
+
}, [accessToken, otpAcceptAfterToken]);
|
|
5411
|
+
const productPolicyLinks = useMemo2(() => {
|
|
5412
|
+
var _a2;
|
|
5413
|
+
const policies = content == null ? void 0 : content.product_privacy_policies;
|
|
5414
|
+
if (!policies) {
|
|
5415
|
+
return [];
|
|
5416
|
+
}
|
|
5417
|
+
return ((_a2 = content == null ? void 0 : content.products) != null ? _a2 : []).filter((product) => Boolean(policies[product.uuid])).map((product) => ({
|
|
5418
|
+
uuid: product.uuid,
|
|
5419
|
+
name: product.name,
|
|
5420
|
+
url: policies[product.uuid]
|
|
5421
|
+
}));
|
|
5422
|
+
}, [content]);
|
|
5423
|
+
const showNoticePolicyLink = useMemo2(() => {
|
|
5424
|
+
var _a2;
|
|
5425
|
+
const products = (_a2 = content == null ? void 0 : content.products) != null ? _a2 : [];
|
|
5426
|
+
if (productPolicyLinks.length === 0 || products.length === 0) {
|
|
5427
|
+
return true;
|
|
5428
|
+
}
|
|
5429
|
+
return productPolicyLinks.length < products.length;
|
|
5430
|
+
}, [content, productPolicyLinks]);
|
|
5292
5431
|
const handleAcceptAll = () => handleAccept("all");
|
|
5293
5432
|
const handleAcceptSelected = () => handleAccept("selected");
|
|
5294
5433
|
const linkStyle = {
|
|
@@ -5899,8 +6038,8 @@ var RedactoNoticeConsent = ({
|
|
|
5899
6038
|
},
|
|
5900
6039
|
`privacy-notice-text-${selectedLanguage}`
|
|
5901
6040
|
),
|
|
5902
|
-
/* @__PURE__ */ jsx5("br", {}),
|
|
5903
|
-
/* @__PURE__ */ jsxs4(
|
|
6041
|
+
showNoticePolicyLink && /* @__PURE__ */ jsx5("br", {}),
|
|
6042
|
+
showNoticePolicyLink && /* @__PURE__ */ jsxs4(
|
|
5904
6043
|
"span",
|
|
5905
6044
|
{
|
|
5906
6045
|
id: "privacy-policy-text",
|
|
@@ -5949,10 +6088,33 @@ var RedactoNoticeConsent = ({
|
|
|
5949
6088
|
},
|
|
5950
6089
|
`purpose-section-heading-${selectedLanguage}`
|
|
5951
6090
|
),
|
|
5952
|
-
|
|
5953
|
-
/* @__PURE__ */
|
|
5954
|
-
|
|
5955
|
-
(
|
|
6091
|
+
/* @__PURE__ */ jsxs4("div", { style: otpLocked ? styles.otpGateLocked : void 0, children: [
|
|
6092
|
+
categorizedPurposes && !isMultiProduct(content == null ? void 0 : content.products) ? /* @__PURE__ */ jsx5("div", { style: styles.optionsContainer, children: soleProductSection(
|
|
6093
|
+
/* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
6094
|
+
categorizedPurposes.alreadyConsented.map(
|
|
6095
|
+
(purpose) => /* @__PURE__ */ jsx5(
|
|
6096
|
+
PurposeItem,
|
|
6097
|
+
{
|
|
6098
|
+
purpose,
|
|
6099
|
+
selectedPurposes,
|
|
6100
|
+
collapsedPurposes,
|
|
6101
|
+
selectedDataElements,
|
|
6102
|
+
recordedAnswers,
|
|
6103
|
+
settings,
|
|
6104
|
+
styles,
|
|
6105
|
+
responsiveStyles,
|
|
6106
|
+
onPurposeToggle: handlePurposeCheckboxChange,
|
|
6107
|
+
onPurposeCollapse: togglePurposeCollapse,
|
|
6108
|
+
onDataElementToggle: handleDataElementCheckboxChange,
|
|
6109
|
+
getTranslatedText,
|
|
6110
|
+
isAlreadyConsented: true,
|
|
6111
|
+
selectedLanguage,
|
|
6112
|
+
initialDataElementSelections
|
|
6113
|
+
},
|
|
6114
|
+
`${purpose.uuid}-${selectedLanguage}`
|
|
6115
|
+
)
|
|
6116
|
+
),
|
|
6117
|
+
categorizedPurposes.needsConsent.map((purpose) => /* @__PURE__ */ jsx5(
|
|
5956
6118
|
PurposeItem,
|
|
5957
6119
|
{
|
|
5958
6120
|
purpose,
|
|
@@ -5967,246 +6129,247 @@ var RedactoNoticeConsent = ({
|
|
|
5967
6129
|
onPurposeCollapse: togglePurposeCollapse,
|
|
5968
6130
|
onDataElementToggle: handleDataElementCheckboxChange,
|
|
5969
6131
|
getTranslatedText,
|
|
5970
|
-
isAlreadyConsented:
|
|
5971
|
-
selectedLanguage
|
|
5972
|
-
initialDataElementSelections
|
|
6132
|
+
isAlreadyConsented: false,
|
|
6133
|
+
selectedLanguage
|
|
5973
6134
|
},
|
|
5974
6135
|
`${purpose.uuid}-${selectedLanguage}`
|
|
5975
|
-
)
|
|
5976
|
-
)
|
|
5977
|
-
|
|
5978
|
-
|
|
5979
|
-
|
|
5980
|
-
|
|
5981
|
-
|
|
5982
|
-
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
|
|
5986
|
-
|
|
5987
|
-
|
|
5988
|
-
|
|
5989
|
-
|
|
5990
|
-
|
|
5991
|
-
getTranslatedText,
|
|
5992
|
-
isAlreadyConsented: false,
|
|
5993
|
-
selectedLanguage
|
|
5994
|
-
},
|
|
5995
|
-
`${purpose.uuid}-${selectedLanguage}`
|
|
5996
|
-
))
|
|
5997
|
-
] })
|
|
5998
|
-
) }) : (
|
|
5999
|
-
/* Regular consent UI */
|
|
6000
|
-
/* @__PURE__ */ jsx5("div", { style: styles.optionsContainer, children: isMultiProduct(content == null ? void 0 : content.products) ? productGroups.map((group) => {
|
|
6001
|
-
var _a2;
|
|
6002
|
-
const boxPurposes = productBoxPurposes(
|
|
6003
|
-
group.purposes
|
|
6004
|
-
);
|
|
6005
|
-
const selectedInGroup = boxPurposes.filter(
|
|
6006
|
-
(purpose) => selectedPurposes[productPurposeKey(
|
|
6007
|
-
group.product.uuid,
|
|
6008
|
-
purpose.uuid
|
|
6009
|
-
)]
|
|
6010
|
-
).length;
|
|
6011
|
-
return /* @__PURE__ */ jsxs4("div", { children: [
|
|
6012
|
-
/* @__PURE__ */ jsx5(
|
|
6013
|
-
ProductSectionHeader,
|
|
6014
|
-
{
|
|
6015
|
-
product: group.product,
|
|
6016
|
-
isRequired: productIsRequiredFor(
|
|
6017
|
-
group.product.uuid
|
|
6018
|
-
),
|
|
6019
|
-
purposeCount: boxPurposes.length,
|
|
6020
|
-
requiredOnly: boxPurposes.length < group.purposes.length,
|
|
6021
|
-
allSelected: selectedInGroup === boxPurposes.length,
|
|
6022
|
-
someSelected: selectedInGroup > 0,
|
|
6023
|
-
collapsed: collapsedProducts[group.product.uuid] || false,
|
|
6024
|
-
locked: (_a2 = consentedProducts[group.product.uuid]) != null ? _a2 : false,
|
|
6025
|
-
settings,
|
|
6026
|
-
styles,
|
|
6027
|
-
responsiveStyles,
|
|
6028
|
-
onToggleCollapse: toggleProductCollapse,
|
|
6029
|
-
onToggleSelect: handleProductCheckboxChange,
|
|
6030
|
-
getTranslatedText
|
|
6031
|
-
}
|
|
6032
|
-
),
|
|
6033
|
-
/* @__PURE__ */ jsx5(
|
|
6034
|
-
"div",
|
|
6035
|
-
{
|
|
6036
|
-
id: `product-${group.product.uuid}`,
|
|
6037
|
-
style: styles.sectionBody,
|
|
6038
|
-
hidden: collapsedProducts[group.product.uuid] || false,
|
|
6039
|
-
children: group.purposes.map((purpose) => {
|
|
6040
|
-
var _a3;
|
|
6041
|
-
return /* @__PURE__ */ jsx5(
|
|
6042
|
-
PurposeItem,
|
|
6043
|
-
{
|
|
6044
|
-
purpose,
|
|
6045
|
-
productUuid: group.product.uuid,
|
|
6046
|
-
selectedPurposes,
|
|
6047
|
-
collapsedPurposes,
|
|
6048
|
-
selectedDataElements,
|
|
6049
|
-
recordedAnswers,
|
|
6050
|
-
settings,
|
|
6051
|
-
styles,
|
|
6052
|
-
responsiveStyles,
|
|
6053
|
-
onPurposeToggle: handlePurposeCheckboxChange,
|
|
6054
|
-
onPurposeCollapse: togglePurposeCollapse,
|
|
6055
|
-
onDataElementToggle: handleDataElementCheckboxChange,
|
|
6056
|
-
getTranslatedText,
|
|
6057
|
-
isAlreadyConsented: (_a3 = consentedPurposes[productPurposeKey(
|
|
6058
|
-
group.product.uuid,
|
|
6059
|
-
purpose.uuid
|
|
6060
|
-
)]) != null ? _a3 : false,
|
|
6061
|
-
selectedLanguage,
|
|
6062
|
-
initialDataElementSelections
|
|
6063
|
-
},
|
|
6064
|
-
`${group.product.uuid}-${purpose.uuid}-${selectedLanguage}`
|
|
6065
|
-
);
|
|
6066
|
-
})
|
|
6067
|
-
}
|
|
6068
|
-
)
|
|
6069
|
-
] }, group.product.uuid);
|
|
6070
|
-
}) : soleProductSection(
|
|
6071
|
-
(_y = content == null ? void 0 : content.purposes) == null ? void 0 : _y.map((purpose) => /* @__PURE__ */ jsx5(
|
|
6072
|
-
PurposeItem,
|
|
6073
|
-
{
|
|
6074
|
-
purpose,
|
|
6075
|
-
selectedPurposes,
|
|
6076
|
-
collapsedPurposes,
|
|
6077
|
-
selectedDataElements,
|
|
6078
|
-
recordedAnswers,
|
|
6079
|
-
settings,
|
|
6080
|
-
styles,
|
|
6081
|
-
responsiveStyles,
|
|
6082
|
-
onPurposeToggle: handlePurposeCheckboxChange,
|
|
6083
|
-
onPurposeCollapse: togglePurposeCollapse,
|
|
6084
|
-
onDataElementToggle: handleDataElementCheckboxChange,
|
|
6085
|
-
getTranslatedText,
|
|
6086
|
-
isAlreadyConsented: isFullyConsentedReviewMode,
|
|
6087
|
-
selectedLanguage,
|
|
6088
|
-
initialDataElementSelections
|
|
6089
|
-
},
|
|
6090
|
-
`${purpose.uuid}-${selectedLanguage}`
|
|
6091
|
-
))
|
|
6092
|
-
) })
|
|
6093
|
-
),
|
|
6094
|
-
((content == null ? void 0 : content.privacy_center_url) || (content == null ? void 0 : content.dpo_info)) && /* @__PURE__ */ jsx5(
|
|
6095
|
-
"div",
|
|
6096
|
-
{
|
|
6097
|
-
style: {
|
|
6098
|
-
...styles.privacyText,
|
|
6099
|
-
...responsiveStyles.privacyText,
|
|
6100
|
-
...componentTextStyle,
|
|
6101
|
-
fontSize: isMobile ? "13px" : "14px",
|
|
6102
|
-
lineHeight: "1.4",
|
|
6103
|
-
borderTop: "1px solid rgba(152, 162, 179, 0.3)",
|
|
6104
|
-
paddingTop: "12px",
|
|
6105
|
-
marginTop: "12px"
|
|
6106
|
-
},
|
|
6107
|
-
children: /* @__PURE__ */ jsxs4("p", { style: { margin: 0, opacity: 0.6 }, children: [
|
|
6108
|
-
content.privacy_center_url && /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
6109
|
-
content.additional_text && /* @__PURE__ */ jsx5("span", { id: "additional-text", children: getTranslatedText(
|
|
6110
|
-
"additional_text",
|
|
6111
|
-
content.additional_text
|
|
6112
|
-
) }),
|
|
6113
|
-
" ",
|
|
6136
|
+
))
|
|
6137
|
+
] })
|
|
6138
|
+
) }) : (
|
|
6139
|
+
/* Regular consent UI */
|
|
6140
|
+
/* @__PURE__ */ jsx5("div", { style: styles.optionsContainer, children: isMultiProduct(content == null ? void 0 : content.products) ? productGroups.map((group) => {
|
|
6141
|
+
var _a2;
|
|
6142
|
+
const boxPurposes = productBoxPurposes(
|
|
6143
|
+
group.purposes
|
|
6144
|
+
);
|
|
6145
|
+
const selectedInGroup = boxPurposes.filter(
|
|
6146
|
+
(purpose) => selectedPurposes[productPurposeKey(
|
|
6147
|
+
group.product.uuid,
|
|
6148
|
+
purpose.uuid
|
|
6149
|
+
)]
|
|
6150
|
+
).length;
|
|
6151
|
+
return /* @__PURE__ */ jsxs4("div", { children: [
|
|
6114
6152
|
/* @__PURE__ */ jsx5(
|
|
6115
|
-
|
|
6153
|
+
ProductSectionHeader,
|
|
6116
6154
|
{
|
|
6117
|
-
|
|
6118
|
-
|
|
6119
|
-
|
|
6120
|
-
|
|
6121
|
-
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
-
|
|
6125
|
-
|
|
6155
|
+
product: group.product,
|
|
6156
|
+
isRequired: productIsRequiredFor(
|
|
6157
|
+
group.product.uuid
|
|
6158
|
+
),
|
|
6159
|
+
purposeCount: boxPurposes.length,
|
|
6160
|
+
requiredOnly: boxPurposes.length < group.purposes.length,
|
|
6161
|
+
allSelected: selectedInGroup === boxPurposes.length,
|
|
6162
|
+
someSelected: selectedInGroup > 0,
|
|
6163
|
+
collapsed: collapsedProducts[group.product.uuid] || false,
|
|
6164
|
+
locked: (_a2 = consentedProducts[group.product.uuid]) != null ? _a2 : false,
|
|
6165
|
+
settings,
|
|
6166
|
+
styles,
|
|
6167
|
+
responsiveStyles,
|
|
6168
|
+
onToggleCollapse: toggleProductCollapse,
|
|
6169
|
+
onToggleSelect: handleProductCheckboxChange,
|
|
6170
|
+
getTranslatedText
|
|
6126
6171
|
}
|
|
6127
6172
|
),
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
content.dpo_info && /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
6131
|
-
content.privacy_center_url && /* @__PURE__ */ jsx5("br", {}),
|
|
6132
|
-
/* @__PURE__ */ jsx5("span", { id: "dpo-grievance-text", children: getTranslatedDpoText(
|
|
6133
|
-
"grievance_text",
|
|
6134
|
-
content.dpo_info.grievance_text || ""
|
|
6135
|
-
) }),
|
|
6136
|
-
" ",
|
|
6137
|
-
content.dpo_info.grievance_url && /* @__PURE__ */ jsx5(
|
|
6138
|
-
"a",
|
|
6173
|
+
/* @__PURE__ */ jsx5(
|
|
6174
|
+
"div",
|
|
6139
6175
|
{
|
|
6140
|
-
id:
|
|
6141
|
-
style:
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6176
|
+
id: `product-${group.product.uuid}`,
|
|
6177
|
+
style: styles.sectionBody,
|
|
6178
|
+
hidden: collapsedProducts[group.product.uuid] || false,
|
|
6179
|
+
children: group.purposes.map((purpose) => {
|
|
6180
|
+
var _a3;
|
|
6181
|
+
return /* @__PURE__ */ jsx5(
|
|
6182
|
+
PurposeItem,
|
|
6183
|
+
{
|
|
6184
|
+
purpose,
|
|
6185
|
+
productUuid: group.product.uuid,
|
|
6186
|
+
selectedPurposes,
|
|
6187
|
+
collapsedPurposes,
|
|
6188
|
+
selectedDataElements,
|
|
6189
|
+
recordedAnswers,
|
|
6190
|
+
settings,
|
|
6191
|
+
styles,
|
|
6192
|
+
responsiveStyles,
|
|
6193
|
+
onPurposeToggle: handlePurposeCheckboxChange,
|
|
6194
|
+
onPurposeCollapse: togglePurposeCollapse,
|
|
6195
|
+
onDataElementToggle: handleDataElementCheckboxChange,
|
|
6196
|
+
getTranslatedText,
|
|
6197
|
+
isAlreadyConsented: (_a3 = consentedPurposes[productPurposeKey(
|
|
6198
|
+
group.product.uuid,
|
|
6199
|
+
purpose.uuid
|
|
6200
|
+
)]) != null ? _a3 : false,
|
|
6201
|
+
selectedLanguage,
|
|
6202
|
+
initialDataElementSelections
|
|
6203
|
+
},
|
|
6204
|
+
`${group.product.uuid}-${purpose.uuid}-${selectedLanguage}`
|
|
6205
|
+
);
|
|
6206
|
+
})
|
|
6149
6207
|
}
|
|
6150
|
-
)
|
|
6151
|
-
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
|
|
6155
|
-
|
|
6208
|
+
)
|
|
6209
|
+
] }, group.product.uuid);
|
|
6210
|
+
}) : soleProductSection(
|
|
6211
|
+
(_y = content == null ? void 0 : content.purposes) == null ? void 0 : _y.map((purpose) => /* @__PURE__ */ jsx5(
|
|
6212
|
+
PurposeItem,
|
|
6213
|
+
{
|
|
6214
|
+
purpose,
|
|
6215
|
+
selectedPurposes,
|
|
6216
|
+
collapsedPurposes,
|
|
6217
|
+
selectedDataElements,
|
|
6218
|
+
recordedAnswers,
|
|
6219
|
+
settings,
|
|
6220
|
+
styles,
|
|
6221
|
+
responsiveStyles,
|
|
6222
|
+
onPurposeToggle: handlePurposeCheckboxChange,
|
|
6223
|
+
onPurposeCollapse: togglePurposeCollapse,
|
|
6224
|
+
onDataElementToggle: handleDataElementCheckboxChange,
|
|
6225
|
+
getTranslatedText,
|
|
6226
|
+
isAlreadyConsented: isFullyConsentedReviewMode,
|
|
6227
|
+
selectedLanguage,
|
|
6228
|
+
initialDataElementSelections
|
|
6229
|
+
},
|
|
6230
|
+
`${purpose.uuid}-${selectedLanguage}`
|
|
6231
|
+
))
|
|
6232
|
+
) })
|
|
6233
|
+
),
|
|
6234
|
+
((content == null ? void 0 : content.privacy_center_url) || (content == null ? void 0 : content.dpo_info)) && /* @__PURE__ */ jsx5(
|
|
6235
|
+
"div",
|
|
6236
|
+
{
|
|
6237
|
+
style: {
|
|
6238
|
+
...styles.privacyText,
|
|
6239
|
+
...responsiveStyles.privacyText,
|
|
6240
|
+
...componentTextStyle,
|
|
6241
|
+
fontSize: isMobile ? "13px" : "14px",
|
|
6242
|
+
lineHeight: "1.4",
|
|
6243
|
+
borderTop: "1px solid rgba(152, 162, 179, 0.3)",
|
|
6244
|
+
paddingTop: "12px",
|
|
6245
|
+
marginTop: "12px"
|
|
6246
|
+
},
|
|
6247
|
+
children: /* @__PURE__ */ jsxs4("p", { style: { margin: 0, opacity: 0.6 }, children: [
|
|
6248
|
+
content.privacy_center_url && /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
6249
|
+
content.additional_text && /* @__PURE__ */ jsx5("span", { id: "additional-text", children: getTranslatedText(
|
|
6250
|
+
"additional_text",
|
|
6251
|
+
content.additional_text
|
|
6156
6252
|
) }),
|
|
6157
6253
|
" ",
|
|
6158
6254
|
/* @__PURE__ */ jsx5(
|
|
6159
6255
|
"a",
|
|
6160
6256
|
{
|
|
6161
|
-
id: "
|
|
6257
|
+
id: "privacy-center-link",
|
|
6162
6258
|
style: { ...styles.link, ...linkStyle },
|
|
6163
|
-
href:
|
|
6164
|
-
|
|
6259
|
+
href: content.privacy_center_url,
|
|
6260
|
+
target: "_blank",
|
|
6261
|
+
rel: "noopener noreferrer",
|
|
6262
|
+
children: getTranslatedText(
|
|
6263
|
+
"privacy_center_anchor_text",
|
|
6264
|
+
content.privacy_center_anchor_text || "Privacy Center"
|
|
6265
|
+
)
|
|
6165
6266
|
}
|
|
6166
|
-
)
|
|
6267
|
+
),
|
|
6268
|
+
"."
|
|
6167
6269
|
] }),
|
|
6168
|
-
/* @__PURE__ */
|
|
6169
|
-
|
|
6170
|
-
"
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
"
|
|
6176
|
-
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
|
|
6270
|
+
productPolicyLinks.length > 0 && /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
6271
|
+
content.privacy_center_url && /* @__PURE__ */ jsx5("br", {}),
|
|
6272
|
+
/* @__PURE__ */ jsx5("span", { id: "product-privacy-policies-label", children: getTranslatedText(
|
|
6273
|
+
"product_privacy_policies_label",
|
|
6274
|
+
PRODUCT_POLICIES_LABEL
|
|
6275
|
+
) }),
|
|
6276
|
+
" ",
|
|
6277
|
+
productPolicyLinks.map((entry, index) => /* @__PURE__ */ jsxs4("span", { children: [
|
|
6278
|
+
index > 0 && ", ",
|
|
6279
|
+
/* @__PURE__ */ jsx5(
|
|
6280
|
+
"a",
|
|
6281
|
+
{
|
|
6282
|
+
id: `product-privacy-policy-${entry.uuid}`,
|
|
6283
|
+
style: { ...styles.link, ...linkStyle },
|
|
6284
|
+
href: entry.url,
|
|
6285
|
+
target: "_blank",
|
|
6286
|
+
rel: "noopener noreferrer",
|
|
6287
|
+
children: entry.name
|
|
6288
|
+
}
|
|
6185
6289
|
)
|
|
6186
|
-
}
|
|
6187
|
-
),
|
|
6188
|
-
/* @__PURE__ */
|
|
6189
|
-
|
|
6190
|
-
"
|
|
6191
|
-
|
|
6192
|
-
|
|
6193
|
-
|
|
6194
|
-
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
"
|
|
6202
|
-
|
|
6290
|
+
] }, entry.uuid))
|
|
6291
|
+
] }),
|
|
6292
|
+
content.dpo_info && /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
6293
|
+
(content.privacy_center_url || productPolicyLinks.length > 0) && /* @__PURE__ */ jsx5("br", {}),
|
|
6294
|
+
/* @__PURE__ */ jsx5("span", { id: "dpo-grievance-text", children: getTranslatedDpoText(
|
|
6295
|
+
"grievance_text",
|
|
6296
|
+
content.dpo_info.grievance_text || ""
|
|
6297
|
+
) }),
|
|
6298
|
+
" ",
|
|
6299
|
+
content.dpo_info.grievance_url && /* @__PURE__ */ jsx5(
|
|
6300
|
+
"a",
|
|
6301
|
+
{
|
|
6302
|
+
id: "dpo-grievance-link",
|
|
6303
|
+
style: { ...styles.link, ...linkStyle },
|
|
6304
|
+
href: content.dpo_info.grievance_url,
|
|
6305
|
+
target: "_blank",
|
|
6306
|
+
rel: "noopener noreferrer",
|
|
6307
|
+
children: getTranslatedDpoText(
|
|
6308
|
+
"grievance_anchor_text",
|
|
6309
|
+
content.dpo_info.grievance_anchor_text || "click here"
|
|
6310
|
+
)
|
|
6311
|
+
}
|
|
6312
|
+
),
|
|
6313
|
+
content.dpo_info.grievance_email && /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
6314
|
+
" ",
|
|
6315
|
+
/* @__PURE__ */ jsx5("span", { id: "dpo-grievance-email-connector", children: getTranslatedDpoText(
|
|
6316
|
+
"grievance_email_connector_text",
|
|
6317
|
+
content.dpo_info.grievance_email_connector_text || "or email to"
|
|
6318
|
+
) }),
|
|
6319
|
+
" ",
|
|
6320
|
+
/* @__PURE__ */ jsx5(
|
|
6321
|
+
"a",
|
|
6322
|
+
{
|
|
6323
|
+
id: "dpo-grievance-email",
|
|
6324
|
+
style: { ...styles.link, ...linkStyle },
|
|
6325
|
+
href: `mailto:${content.dpo_info.grievance_email}`,
|
|
6326
|
+
children: content.dpo_info.grievance_email
|
|
6327
|
+
}
|
|
6203
6328
|
)
|
|
6204
|
-
}
|
|
6205
|
-
|
|
6329
|
+
] }),
|
|
6330
|
+
/* @__PURE__ */ jsx5("br", {}),
|
|
6331
|
+
/* @__PURE__ */ jsx5("span", { id: "dpo-dp-board-text", children: getTranslatedDpoText(
|
|
6332
|
+
"dp_board_text",
|
|
6333
|
+
content.dpo_info.dp_board_text || ""
|
|
6334
|
+
) }),
|
|
6335
|
+
" ",
|
|
6336
|
+
content.dpo_info.dp_board_url && /* @__PURE__ */ jsx5(
|
|
6337
|
+
"a",
|
|
6338
|
+
{
|
|
6339
|
+
id: "dpo-dp-board-link",
|
|
6340
|
+
style: { ...styles.link, ...linkStyle },
|
|
6341
|
+
href: content.dpo_info.dp_board_url,
|
|
6342
|
+
target: "_blank",
|
|
6343
|
+
rel: "noopener noreferrer",
|
|
6344
|
+
children: getTranslatedDpoText(
|
|
6345
|
+
"dp_board_anchor_text",
|
|
6346
|
+
content.dpo_info.dp_board_anchor_text || "here"
|
|
6347
|
+
)
|
|
6348
|
+
}
|
|
6349
|
+
),
|
|
6350
|
+
/* @__PURE__ */ jsx5("br", {}),
|
|
6351
|
+
/* @__PURE__ */ jsx5("span", { id: "dpo-dpo-text", children: getTranslatedDpoText(
|
|
6352
|
+
"dpo_text",
|
|
6353
|
+
content.dpo_info.dpo_text || ""
|
|
6354
|
+
) }),
|
|
6355
|
+
" ",
|
|
6356
|
+
content.dpo_info.dpo_email && /* @__PURE__ */ jsx5(
|
|
6357
|
+
"a",
|
|
6358
|
+
{
|
|
6359
|
+
id: "dpo-dpo-link",
|
|
6360
|
+
style: { ...styles.link, ...linkStyle },
|
|
6361
|
+
href: `mailto:${content.dpo_info.dpo_email}`,
|
|
6362
|
+
children: getTranslatedDpoText(
|
|
6363
|
+
"dpo_anchor_text",
|
|
6364
|
+
content.dpo_info.dpo_anchor_text || "Click here"
|
|
6365
|
+
)
|
|
6366
|
+
}
|
|
6367
|
+
)
|
|
6368
|
+
] })
|
|
6206
6369
|
] })
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
)
|
|
6370
|
+
}
|
|
6371
|
+
)
|
|
6372
|
+
] })
|
|
6210
6373
|
]
|
|
6211
6374
|
}
|
|
6212
6375
|
),
|
|
@@ -6219,6 +6382,72 @@ var RedactoNoticeConsent = ({
|
|
|
6219
6382
|
children: confirmHint
|
|
6220
6383
|
}
|
|
6221
6384
|
),
|
|
6385
|
+
otpLocked && /* @__PURE__ */ jsxs4("div", { style: styles.otpGatePanel, children: [
|
|
6386
|
+
/* @__PURE__ */ jsx5("p", { style: styles.otpGateTitle, children: (_z = otpGate == null ? void 0 : otpGate.title) != null ? _z : OTP_GATE_COPY.title }),
|
|
6387
|
+
/* @__PURE__ */ jsx5("p", { style: styles.otpGateDescription, children: (_A = otpGate == null ? void 0 : otpGate.description) != null ? _A : OTP_GATE_COPY.description }),
|
|
6388
|
+
/* @__PURE__ */ jsx5("div", { style: styles.otpGateDigits, children: Array.from({ length: OTP_GATE_LENGTH }).map((_, i) => {
|
|
6389
|
+
var _a2;
|
|
6390
|
+
return /* @__PURE__ */ jsx5(
|
|
6391
|
+
"input",
|
|
6392
|
+
{
|
|
6393
|
+
id: `notice-otp-digit-${i}`,
|
|
6394
|
+
style: styles.otpGateDigit,
|
|
6395
|
+
inputMode: "numeric",
|
|
6396
|
+
autoComplete: i === 0 ? "one-time-code" : "off",
|
|
6397
|
+
maxLength: 1,
|
|
6398
|
+
value: (_a2 = otpCode[i]) != null ? _a2 : "",
|
|
6399
|
+
disabled: otpBusy,
|
|
6400
|
+
"aria-label": `Digit ${i + 1}`,
|
|
6401
|
+
onChange: (e) => {
|
|
6402
|
+
const digit = e.target.value.replace(/[^0-9]/g, "");
|
|
6403
|
+
if (!digit) return;
|
|
6404
|
+
const next = otpCode.split("");
|
|
6405
|
+
next[i] = digit[digit.length - 1];
|
|
6406
|
+
setOtpCode(next.join("").slice(0, OTP_GATE_LENGTH));
|
|
6407
|
+
focusOtpDigit(i + 1);
|
|
6408
|
+
},
|
|
6409
|
+
onKeyDown: (e) => {
|
|
6410
|
+
if (e.key !== "Backspace") return;
|
|
6411
|
+
e.preventDefault();
|
|
6412
|
+
const next = otpCode.split("");
|
|
6413
|
+
if (next[i]) {
|
|
6414
|
+
next[i] = "";
|
|
6415
|
+
setOtpCode(next.join(""));
|
|
6416
|
+
return;
|
|
6417
|
+
}
|
|
6418
|
+
next[i - 1] = "";
|
|
6419
|
+
setOtpCode(next.join(""));
|
|
6420
|
+
focusOtpDigit(i - 1);
|
|
6421
|
+
},
|
|
6422
|
+
onPaste: (e) => {
|
|
6423
|
+
e.preventDefault();
|
|
6424
|
+
const pasted = e.clipboardData.getData("text").replace(/[^0-9]/g, "").slice(0, OTP_GATE_LENGTH);
|
|
6425
|
+
if (!pasted) return;
|
|
6426
|
+
setOtpCode(pasted);
|
|
6427
|
+
focusOtpDigit(pasted.length - 1);
|
|
6428
|
+
}
|
|
6429
|
+
},
|
|
6430
|
+
`notice-otp-digit-${i}`
|
|
6431
|
+
);
|
|
6432
|
+
}) }),
|
|
6433
|
+
otpError && /* @__PURE__ */ jsx5("p", { style: styles.otpGateError, children: otpError }),
|
|
6434
|
+
/* @__PURE__ */ jsx5(
|
|
6435
|
+
"button",
|
|
6436
|
+
{
|
|
6437
|
+
type: "button",
|
|
6438
|
+
style: {
|
|
6439
|
+
...styles.button,
|
|
6440
|
+
...responsiveStyles.button,
|
|
6441
|
+
...styles.acceptButton,
|
|
6442
|
+
...acceptAllButtonStyle,
|
|
6443
|
+
...styles.otpGateButton
|
|
6444
|
+
},
|
|
6445
|
+
onClick: handleOtpConfirm,
|
|
6446
|
+
disabled: otpBusy || otpCode.length !== OTP_GATE_LENGTH,
|
|
6447
|
+
children: otpBusy ? OTP_GATE_COPY.verifying : (_B = otpGate == null ? void 0 : otpGate.submitLabel) != null ? _B : OTP_GATE_COPY.submit
|
|
6448
|
+
}
|
|
6449
|
+
)
|
|
6450
|
+
] }),
|
|
6222
6451
|
/* @__PURE__ */ jsx5(
|
|
6223
6452
|
"div",
|
|
6224
6453
|
{
|