@redacto.io/consent-sdk-react-native 5.0.0-beta.9 → 5.0.1-beta.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/dist/index.d.mts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +611 -522
- package/dist/index.mjs +530 -441
- package/dist/privacy-center.js +254 -128
- package/dist/privacy-center.mjs +231 -105
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -19,8 +19,8 @@ import {
|
|
|
19
19
|
Modal,
|
|
20
20
|
Pressable,
|
|
21
21
|
ScrollView,
|
|
22
|
-
StyleSheet as
|
|
23
|
-
Text as
|
|
22
|
+
StyleSheet as StyleSheet5,
|
|
23
|
+
Text as Text3,
|
|
24
24
|
TextInput,
|
|
25
25
|
TouchableOpacity as TouchableOpacity3,
|
|
26
26
|
View as View3
|
|
@@ -90,6 +90,8 @@ var sandboxQueryIdentity = (sandbox) => sandboxBodyIdentity(sandbox);
|
|
|
90
90
|
|
|
91
91
|
// src/constants.ts
|
|
92
92
|
var DEFAULT_CONSENT_API_BASE_URL = "https://api.redacto.io/consent";
|
|
93
|
+
var REQUIRED_MARKER_GLYPH = " *";
|
|
94
|
+
var REQUIRED_MARKER_COLOR = "red";
|
|
93
95
|
|
|
94
96
|
// src/RedactoNoticeConsent/api/index.ts
|
|
95
97
|
var apiCache = /* @__PURE__ */ new Map();
|
|
@@ -466,122 +468,6 @@ var verifyGuardianStatus = async ({
|
|
|
466
468
|
};
|
|
467
469
|
};
|
|
468
470
|
|
|
469
|
-
// src/shared/notice-consent-status.ts
|
|
470
|
-
import { jwtDecode as jwtDecode2 } from "jwt-decode";
|
|
471
|
-
var decodeNoticeConsentToken = (token) => {
|
|
472
|
-
try {
|
|
473
|
-
return jwtDecode2(token);
|
|
474
|
-
} catch {
|
|
475
|
-
return null;
|
|
476
|
-
}
|
|
477
|
-
};
|
|
478
|
-
var fetchNoticeConsentStatusForScope = async ({
|
|
479
|
-
accessToken,
|
|
480
|
-
ledgerBaseUrl,
|
|
481
|
-
organisationUuid,
|
|
482
|
-
workspaceUuid,
|
|
483
|
-
noticeUuid,
|
|
484
|
-
signal
|
|
485
|
-
}) => {
|
|
486
|
-
if (!accessToken || !ledgerBaseUrl || !organisationUuid || !workspaceUuid || !noticeUuid) {
|
|
487
|
-
return null;
|
|
488
|
-
}
|
|
489
|
-
try {
|
|
490
|
-
const response = await fetch(
|
|
491
|
-
`${ledgerBaseUrl}/public/organisations/${organisationUuid}/workspaces/${workspaceUuid}/notices/${noticeUuid}/check-consent`,
|
|
492
|
-
{
|
|
493
|
-
method: "POST",
|
|
494
|
-
headers: {
|
|
495
|
-
Authorization: `Bearer ${accessToken}`,
|
|
496
|
-
"Content-Type": "application/json"
|
|
497
|
-
},
|
|
498
|
-
body: "{}",
|
|
499
|
-
signal
|
|
500
|
-
}
|
|
501
|
-
);
|
|
502
|
-
if (!response.ok) {
|
|
503
|
-
return null;
|
|
504
|
-
}
|
|
505
|
-
const data = await response.json();
|
|
506
|
-
const body = data && typeof data === "object" && "detail" in data && data.detail ? data.detail : data;
|
|
507
|
-
if (!body || !Array.isArray(body.purposes)) {
|
|
508
|
-
return null;
|
|
509
|
-
}
|
|
510
|
-
return body;
|
|
511
|
-
} catch {
|
|
512
|
-
return null;
|
|
513
|
-
}
|
|
514
|
-
};
|
|
515
|
-
var fetchNoticeConsentStatus = async ({
|
|
516
|
-
accessToken,
|
|
517
|
-
ledgerBaseUrl,
|
|
518
|
-
noticeUuid,
|
|
519
|
-
signal
|
|
520
|
-
}) => {
|
|
521
|
-
if (!accessToken || !ledgerBaseUrl || !noticeUuid) {
|
|
522
|
-
return null;
|
|
523
|
-
}
|
|
524
|
-
const decodedToken = decodeNoticeConsentToken(accessToken);
|
|
525
|
-
if (!decodedToken) {
|
|
526
|
-
return null;
|
|
527
|
-
}
|
|
528
|
-
const {
|
|
529
|
-
organisation_uuid: ORGANISATION_UUID,
|
|
530
|
-
workspace_uuid: WORKSPACE_UUID
|
|
531
|
-
} = decodedToken;
|
|
532
|
-
if (!ORGANISATION_UUID || !WORKSPACE_UUID) {
|
|
533
|
-
return null;
|
|
534
|
-
}
|
|
535
|
-
return fetchNoticeConsentStatusForScope({
|
|
536
|
-
accessToken,
|
|
537
|
-
ledgerBaseUrl,
|
|
538
|
-
organisationUuid: ORGANISATION_UUID,
|
|
539
|
-
workspaceUuid: WORKSPACE_UUID,
|
|
540
|
-
noticeUuid,
|
|
541
|
-
signal
|
|
542
|
-
});
|
|
543
|
-
};
|
|
544
|
-
var isNoticeFullyConsented = (status) => status.consented && status.all_mandatory_active;
|
|
545
|
-
var buildLedgerConsentOverlay = (status, configPurposes) => {
|
|
546
|
-
var _a, _b;
|
|
547
|
-
const byUuid = new Map(status.purposes.map((p) => [p.uuid, p]));
|
|
548
|
-
const hasHistory = status.purposes.some(
|
|
549
|
-
(p) => (p.status || "INACTIVE") !== "INACTIVE"
|
|
550
|
-
);
|
|
551
|
-
if (!hasHistory) {
|
|
552
|
-
return null;
|
|
553
|
-
}
|
|
554
|
-
const purpose_selections = {};
|
|
555
|
-
for (const cp of configPurposes) {
|
|
556
|
-
const lp = byUuid.get(cp.uuid);
|
|
557
|
-
const purposeStatus = (lp == null ? void 0 : lp.status) || "INACTIVE";
|
|
558
|
-
const selectedByUuid = new Map(
|
|
559
|
-
((lp == null ? void 0 : lp.data_elements) || []).map((de) => [de.uuid, de.selected])
|
|
560
|
-
);
|
|
561
|
-
const data_elements = {};
|
|
562
|
-
for (const de of cp.data_elements) {
|
|
563
|
-
data_elements[de.uuid] = {
|
|
564
|
-
selected: (_a = selectedByUuid.get(de.uuid)) != null ? _a : false,
|
|
565
|
-
enabled: de.enabled,
|
|
566
|
-
required: de.required
|
|
567
|
-
};
|
|
568
|
-
}
|
|
569
|
-
purpose_selections[cp.uuid] = {
|
|
570
|
-
selected: (_b = lp == null ? void 0 : lp.selected) != null ? _b : false,
|
|
571
|
-
status: purposeStatus,
|
|
572
|
-
needs_reconsent: purposeStatus !== "ACTIVE",
|
|
573
|
-
data_elements
|
|
574
|
-
};
|
|
575
|
-
}
|
|
576
|
-
const reconsent_required = configPurposes.some(
|
|
577
|
-
(cp) => {
|
|
578
|
-
var _a2;
|
|
579
|
-
return (((_a2 = purpose_selections[cp.uuid]) == null ? void 0 : _a2.status) || "INACTIVE") !== "ACTIVE";
|
|
580
|
-
}
|
|
581
|
-
);
|
|
582
|
-
return { reconsent_required, purpose_selections };
|
|
583
|
-
};
|
|
584
|
-
|
|
585
471
|
// src/RedactoNoticeConsent/components/Checkbox.tsx
|
|
586
472
|
import { TouchableOpacity, View, StyleSheet } from "react-native";
|
|
587
473
|
import Svg, { Path } from "react-native-svg";
|
|
@@ -655,18 +541,28 @@ var styles = StyleSheet.create({
|
|
|
655
541
|
}
|
|
656
542
|
});
|
|
657
543
|
|
|
544
|
+
// src/RedactoNoticeConsent/components/RequiredMarker.tsx
|
|
545
|
+
import { StyleSheet as StyleSheet2, Text } from "react-native";
|
|
546
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
547
|
+
var RequiredMarker = () => /* @__PURE__ */ jsx2(Text, { style: styles2.marker, children: REQUIRED_MARKER_GLYPH });
|
|
548
|
+
var styles2 = StyleSheet2.create({
|
|
549
|
+
marker: {
|
|
550
|
+
color: REQUIRED_MARKER_COLOR
|
|
551
|
+
}
|
|
552
|
+
});
|
|
553
|
+
|
|
658
554
|
// src/RedactoNoticeConsent/components/VerificationScreen.tsx
|
|
659
555
|
import { useEffect, useRef } from "react";
|
|
660
556
|
import {
|
|
661
557
|
ActivityIndicator,
|
|
662
558
|
Animated,
|
|
663
|
-
StyleSheet as
|
|
664
|
-
Text,
|
|
559
|
+
StyleSheet as StyleSheet3,
|
|
560
|
+
Text as Text2,
|
|
665
561
|
TouchableOpacity as TouchableOpacity2,
|
|
666
562
|
View as View2
|
|
667
563
|
} from "react-native";
|
|
668
564
|
import Svg2, { Circle as SvgCircle, Path as Path2 } from "react-native-svg";
|
|
669
|
-
import { jsx as
|
|
565
|
+
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
670
566
|
var VerificationScreen = ({
|
|
671
567
|
status,
|
|
672
568
|
errorMessage,
|
|
@@ -735,18 +631,18 @@ var VerificationScreen = ({
|
|
|
735
631
|
}
|
|
736
632
|
};
|
|
737
633
|
const renderPendingContent = () => /* @__PURE__ */ jsxs(View2, { style: s.centerContent, children: [
|
|
738
|
-
/* @__PURE__ */
|
|
634
|
+
/* @__PURE__ */ jsx3(ActivityIndicator, { size: "large", color: acceptBg, style: s.pendingSpinner }),
|
|
739
635
|
/* @__PURE__ */ jsxs(View2, { style: s.infoBanner, children: [
|
|
740
636
|
/* @__PURE__ */ jsxs(Svg2, { width: 16, height: 16, viewBox: "0 0 24 24", fill: "none", style: s.infoBannerIcon, children: [
|
|
741
|
-
/* @__PURE__ */
|
|
742
|
-
/* @__PURE__ */
|
|
637
|
+
/* @__PURE__ */ jsx3(SvgCircle, { cx: "12", cy: "12", r: "10", stroke: "#059669", strokeWidth: 2 }),
|
|
638
|
+
/* @__PURE__ */ jsx3(Path2, { d: "M12 16v-4M12 8h.01", stroke: "#059669", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" })
|
|
743
639
|
] }),
|
|
744
|
-
/* @__PURE__ */
|
|
640
|
+
/* @__PURE__ */ jsx3(Text2, { style: s.infoBannerText, children: "Please complete the verification in Safari. This screen will update automatically when verification is complete." })
|
|
745
641
|
] })
|
|
746
642
|
] });
|
|
747
643
|
const renderSuccessContent = () => /* @__PURE__ */ jsxs(View2, { style: s.centerContent, children: [
|
|
748
644
|
/* @__PURE__ */ jsxs(View2, { style: s.iconWrapper, children: [
|
|
749
|
-
/* @__PURE__ */
|
|
645
|
+
/* @__PURE__ */ jsx3(
|
|
750
646
|
Animated.View,
|
|
751
647
|
{
|
|
752
648
|
style: [
|
|
@@ -763,7 +659,7 @@ var VerificationScreen = ({
|
|
|
763
659
|
]
|
|
764
660
|
}
|
|
765
661
|
),
|
|
766
|
-
/* @__PURE__ */
|
|
662
|
+
/* @__PURE__ */ jsx3(Animated.View, { style: [s.successCircle, { transform: [{ scale: scaleAnim }] }], children: /* @__PURE__ */ jsx3(Svg2, { width: 30, height: 30, viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx3(
|
|
767
663
|
Path2,
|
|
768
664
|
{
|
|
769
665
|
d: "M5 13L9 17L19 7",
|
|
@@ -774,7 +670,7 @@ var VerificationScreen = ({
|
|
|
774
670
|
}
|
|
775
671
|
) }) })
|
|
776
672
|
] }),
|
|
777
|
-
/* @__PURE__ */
|
|
673
|
+
/* @__PURE__ */ jsx3(
|
|
778
674
|
Animated.Text,
|
|
779
675
|
{
|
|
780
676
|
style: [
|
|
@@ -784,7 +680,7 @@ var VerificationScreen = ({
|
|
|
784
680
|
children: "Verification Completed"
|
|
785
681
|
}
|
|
786
682
|
),
|
|
787
|
-
/* @__PURE__ */
|
|
683
|
+
/* @__PURE__ */ jsx3(
|
|
788
684
|
Animated.Text,
|
|
789
685
|
{
|
|
790
686
|
style: [
|
|
@@ -796,7 +692,7 @@ var VerificationScreen = ({
|
|
|
796
692
|
)
|
|
797
693
|
] });
|
|
798
694
|
const renderErrorContent = () => /* @__PURE__ */ jsxs(View2, { style: s.centerContent, children: [
|
|
799
|
-
/* @__PURE__ */
|
|
695
|
+
/* @__PURE__ */ jsx3(View2, { style: s.iconWrapper, children: /* @__PURE__ */ jsx3(Animated.View, { style: [s.errorCircle, { transform: [{ scale: scaleAnim }] }], children: /* @__PURE__ */ jsx3(Svg2, { width: 30, height: 30, viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx3(
|
|
800
696
|
Path2,
|
|
801
697
|
{
|
|
802
698
|
d: "M18 6L6 18M6 6L18 18",
|
|
@@ -820,7 +716,7 @@ var VerificationScreen = ({
|
|
|
820
716
|
}
|
|
821
717
|
),
|
|
822
718
|
/* @__PURE__ */ jsxs(Animated.View, { style: [s.errorBanner, { opacity: contentAnim }], children: [
|
|
823
|
-
/* @__PURE__ */
|
|
719
|
+
/* @__PURE__ */ jsx3(Svg2, { width: 16, height: 16, viewBox: "0 0 24 24", fill: "none", style: s.infoBannerIcon, children: /* @__PURE__ */ jsx3(
|
|
824
720
|
Path2,
|
|
825
721
|
{
|
|
826
722
|
d: "M12 9v4M12 17h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z",
|
|
@@ -830,69 +726,69 @@ var VerificationScreen = ({
|
|
|
830
726
|
strokeLinejoin: "round"
|
|
831
727
|
}
|
|
832
728
|
) }),
|
|
833
|
-
/* @__PURE__ */
|
|
729
|
+
/* @__PURE__ */ jsx3(Text2, { style: s.errorBannerText, children: getErrorGuidance() })
|
|
834
730
|
] })
|
|
835
731
|
] });
|
|
836
732
|
const renderBottomButtons = () => {
|
|
837
733
|
if (status === "verified") {
|
|
838
734
|
if (!onContinue) return null;
|
|
839
|
-
return /* @__PURE__ */
|
|
735
|
+
return /* @__PURE__ */ jsx3(View2, { style: [s.bottomSection, { borderTopColor: borderColor }], children: /* @__PURE__ */ jsx3(
|
|
840
736
|
TouchableOpacity2,
|
|
841
737
|
{
|
|
842
738
|
style: [s.primaryButton, { backgroundColor: acceptBg }],
|
|
843
739
|
onPress: onContinue,
|
|
844
740
|
activeOpacity: 0.8,
|
|
845
|
-
children: /* @__PURE__ */
|
|
741
|
+
children: /* @__PURE__ */ jsx3(Text2, { style: [s.primaryButtonText, { color: acceptText }], children: "Continue" })
|
|
846
742
|
}
|
|
847
743
|
) });
|
|
848
744
|
}
|
|
849
745
|
if (status === "failed" || status === "expired") {
|
|
850
746
|
return /* @__PURE__ */ jsxs(View2, { style: [s.bottomSection, { borderTopColor: borderColor }], children: [
|
|
851
|
-
errorCode === "GUARDIAN_UNDER_18" && onChangeGuardian ? /* @__PURE__ */
|
|
747
|
+
errorCode === "GUARDIAN_UNDER_18" && onChangeGuardian ? /* @__PURE__ */ jsx3(
|
|
852
748
|
TouchableOpacity2,
|
|
853
749
|
{
|
|
854
750
|
style: [s.primaryButton, { backgroundColor: acceptBg }],
|
|
855
751
|
onPress: onChangeGuardian,
|
|
856
752
|
activeOpacity: 0.8,
|
|
857
|
-
children: /* @__PURE__ */
|
|
753
|
+
children: /* @__PURE__ */ jsx3(Text2, { style: [s.primaryButtonText, { color: acceptText }], children: "Change Guardian" })
|
|
858
754
|
}
|
|
859
|
-
) : canRetry !== false ? /* @__PURE__ */
|
|
755
|
+
) : canRetry !== false ? /* @__PURE__ */ jsx3(
|
|
860
756
|
TouchableOpacity2,
|
|
861
757
|
{
|
|
862
758
|
style: [s.primaryButton, { backgroundColor: acceptBg }],
|
|
863
759
|
onPress: onRetry,
|
|
864
760
|
activeOpacity: 0.8,
|
|
865
|
-
children: /* @__PURE__ */
|
|
761
|
+
children: /* @__PURE__ */ jsx3(Text2, { style: [s.primaryButtonText, { color: acceptText }], children: "Try Again" })
|
|
866
762
|
}
|
|
867
763
|
) : null,
|
|
868
|
-
/* @__PURE__ */
|
|
764
|
+
/* @__PURE__ */ jsx3(
|
|
869
765
|
TouchableOpacity2,
|
|
870
766
|
{
|
|
871
767
|
style: [s.outlineButton, { backgroundColor: declineBg, borderColor }],
|
|
872
768
|
onPress: onBack,
|
|
873
769
|
activeOpacity: 0.8,
|
|
874
|
-
children: /* @__PURE__ */
|
|
770
|
+
children: /* @__PURE__ */ jsx3(Text2, { style: [s.outlineButtonText, { color: declineText }], children: "Go Back" })
|
|
875
771
|
}
|
|
876
772
|
)
|
|
877
773
|
] });
|
|
878
774
|
}
|
|
879
|
-
return /* @__PURE__ */
|
|
775
|
+
return /* @__PURE__ */ jsx3(View2, { style: [s.bottomSection, { borderTopColor: borderColor }], children: /* @__PURE__ */ jsx3(
|
|
880
776
|
TouchableOpacity2,
|
|
881
777
|
{
|
|
882
778
|
style: [s.outlineButton, { backgroundColor: declineBg, borderColor }],
|
|
883
779
|
onPress: onBack,
|
|
884
780
|
activeOpacity: 0.8,
|
|
885
|
-
children: /* @__PURE__ */
|
|
781
|
+
children: /* @__PURE__ */ jsx3(Text2, { style: [s.outlineButtonText, { color: declineText }], children: "Cancel" })
|
|
886
782
|
}
|
|
887
783
|
) });
|
|
888
784
|
};
|
|
889
785
|
return /* @__PURE__ */ jsxs(View2, { style: s.root, children: [
|
|
890
|
-
/* @__PURE__ */
|
|
891
|
-
/* @__PURE__ */
|
|
786
|
+
/* @__PURE__ */ jsx3(View2, { style: [s.topSection, { borderBottomColor: borderColor }], children: /* @__PURE__ */ jsx3(Text2, { style: [s.topTitle, { color: headingColor }], children: "Guardian Verification" }) }),
|
|
787
|
+
/* @__PURE__ */ jsx3(View2, { style: s.centerArea, children: status === "verified" ? renderSuccessContent() : status === "failed" || status === "expired" ? renderErrorContent() : renderPendingContent() }),
|
|
892
788
|
renderBottomButtons()
|
|
893
789
|
] });
|
|
894
790
|
};
|
|
895
|
-
var s =
|
|
791
|
+
var s = StyleSheet3.create({
|
|
896
792
|
root: {
|
|
897
793
|
flex: 1
|
|
898
794
|
},
|
|
@@ -902,7 +798,7 @@ var s = StyleSheet2.create({
|
|
|
902
798
|
alignItems: "center",
|
|
903
799
|
paddingHorizontal: 20,
|
|
904
800
|
paddingVertical: 16,
|
|
905
|
-
borderBottomWidth:
|
|
801
|
+
borderBottomWidth: StyleSheet3.hairlineWidth,
|
|
906
802
|
borderBottomColor: "#E5E7EB"
|
|
907
803
|
},
|
|
908
804
|
topTitle: {
|
|
@@ -1010,7 +906,7 @@ var s = StyleSheet2.create({
|
|
|
1010
906
|
bottomSection: {
|
|
1011
907
|
padding: 20,
|
|
1012
908
|
gap: 8,
|
|
1013
|
-
borderTopWidth:
|
|
909
|
+
borderTopWidth: StyleSheet3.hairlineWidth,
|
|
1014
910
|
borderTopColor: "#E5E7EB"
|
|
1015
911
|
},
|
|
1016
912
|
primaryButton: {
|
|
@@ -1045,10 +941,13 @@ var DPO_AUDIO_ELEMENT_MAP = [
|
|
|
1045
941
|
{ audioKey: "dpo_text_audio_url", elementId: "dpo-dpo-text" },
|
|
1046
942
|
{ audioKey: "dpo_anchor_text_audio_url", elementId: "dpo-dpo-link" }
|
|
1047
943
|
];
|
|
944
|
+
var DEFAULT_ACCEPT_ALL_BUTTON_TEXT = "Accept All";
|
|
945
|
+
var DEFAULT_ACCEPT_SELECTED_BUTTON_TEXT = "Accept Selected";
|
|
946
|
+
var DEFAULT_DECLINE_BUTTON_TEXT = "Decline";
|
|
1048
947
|
|
|
1049
948
|
// src/RedactoNoticeConsent/styles.ts
|
|
1050
|
-
import { StyleSheet as
|
|
1051
|
-
var
|
|
949
|
+
import { StyleSheet as StyleSheet4, Platform } from "react-native";
|
|
950
|
+
var styles3 = StyleSheet4.create({
|
|
1052
951
|
overlay: {
|
|
1053
952
|
flex: 1,
|
|
1054
953
|
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
@@ -1210,6 +1109,29 @@ var styles2 = StyleSheet3.create({
|
|
|
1210
1109
|
backgroundColor: "#ffffff",
|
|
1211
1110
|
flexShrink: 0
|
|
1212
1111
|
},
|
|
1112
|
+
/**
|
|
1113
|
+
* The main notice footer. Wide: one row with decline pushed left and the
|
|
1114
|
+
* accepts grouped right (see `declineSpacer`). Narrow: a full-width stack.
|
|
1115
|
+
* The guardian-verification and age-gate sub-flows still use
|
|
1116
|
+
* `bottomSection` — they have their own two-button layout.
|
|
1117
|
+
*/
|
|
1118
|
+
actionButtonRow: {
|
|
1119
|
+
flexDirection: "row",
|
|
1120
|
+
alignItems: "center",
|
|
1121
|
+
gap: 10,
|
|
1122
|
+
paddingTop: 15,
|
|
1123
|
+
paddingBottom: 16,
|
|
1124
|
+
backgroundColor: "#ffffff",
|
|
1125
|
+
flexShrink: 0
|
|
1126
|
+
},
|
|
1127
|
+
actionButtonStack: {
|
|
1128
|
+
flexDirection: "column",
|
|
1129
|
+
gap: 10,
|
|
1130
|
+
paddingTop: 15,
|
|
1131
|
+
paddingBottom: 16,
|
|
1132
|
+
backgroundColor: "#ffffff",
|
|
1133
|
+
flexShrink: 0
|
|
1134
|
+
},
|
|
1213
1135
|
button: {
|
|
1214
1136
|
borderRadius: 8,
|
|
1215
1137
|
paddingVertical: 9,
|
|
@@ -1217,6 +1139,24 @@ var styles2 = StyleSheet3.create({
|
|
|
1217
1139
|
alignItems: "center",
|
|
1218
1140
|
justifyContent: "center"
|
|
1219
1141
|
},
|
|
1142
|
+
/**
|
|
1143
|
+
* In the wide row each button shrinks to its own label so the left/right
|
|
1144
|
+
* split survives; `flexShrink` lets a long translated label wrap rather than
|
|
1145
|
+
* overflow the modal.
|
|
1146
|
+
*/
|
|
1147
|
+
rowButton: {
|
|
1148
|
+
flexShrink: 1,
|
|
1149
|
+
paddingHorizontal: 16
|
|
1150
|
+
},
|
|
1151
|
+
/** In the narrow stack every button spans the full width. */
|
|
1152
|
+
stackButton: {
|
|
1153
|
+
alignSelf: "stretch",
|
|
1154
|
+
paddingHorizontal: 16
|
|
1155
|
+
},
|
|
1156
|
+
/** Pushes everything after decline to the right edge of the wide row. */
|
|
1157
|
+
declineSpacer: {
|
|
1158
|
+
marginRight: "auto"
|
|
1159
|
+
},
|
|
1220
1160
|
buttonText: {
|
|
1221
1161
|
fontWeight: "400",
|
|
1222
1162
|
fontSize: 16,
|
|
@@ -1229,6 +1169,19 @@ var styles2 = StyleSheet3.create({
|
|
|
1229
1169
|
acceptButtonText: {
|
|
1230
1170
|
color: "#ffffff"
|
|
1231
1171
|
},
|
|
1172
|
+
/**
|
|
1173
|
+
* The accept-all shortcut. Outlined rather than filled so the primary
|
|
1174
|
+
* "accept selected" action stays dominant, but tinted with the accent colour
|
|
1175
|
+
* so it still reads as an accept next to the neutral decline button.
|
|
1176
|
+
*/
|
|
1177
|
+
acceptSecondaryButton: {
|
|
1178
|
+
borderWidth: 1,
|
|
1179
|
+
borderColor: "#4f87ff",
|
|
1180
|
+
backgroundColor: "#ffffff"
|
|
1181
|
+
},
|
|
1182
|
+
acceptSecondaryButtonText: {
|
|
1183
|
+
color: "#4f87ff"
|
|
1184
|
+
},
|
|
1232
1185
|
cancelButton: {
|
|
1233
1186
|
borderWidth: 1,
|
|
1234
1187
|
borderColor: "#d0d5dd",
|
|
@@ -1308,9 +1261,6 @@ var styles2 = StyleSheet3.create({
|
|
|
1308
1261
|
fontSize: 14,
|
|
1309
1262
|
flex: 1
|
|
1310
1263
|
},
|
|
1311
|
-
requiredAsterisk: {
|
|
1312
|
-
color: "red"
|
|
1313
|
-
},
|
|
1314
1264
|
divider: {
|
|
1315
1265
|
height: 1,
|
|
1316
1266
|
backgroundColor: "#e5e7eb",
|
|
@@ -1375,6 +1325,24 @@ var styles2 = StyleSheet3.create({
|
|
|
1375
1325
|
}
|
|
1376
1326
|
});
|
|
1377
1327
|
|
|
1328
|
+
// src/RedactoNoticeConsent/utils/consentSelection.ts
|
|
1329
|
+
var dataElementKey = (purposeUuid, elementUuid) => `${purposeUuid}-${elementUuid}`;
|
|
1330
|
+
var buildSelectionForMode = (purposes, mode, current) => {
|
|
1331
|
+
if (mode === "selected") {
|
|
1332
|
+
return current;
|
|
1333
|
+
}
|
|
1334
|
+
const selectedPurposes = {};
|
|
1335
|
+
const selectedDataElements = {};
|
|
1336
|
+
purposes.forEach((purpose) => {
|
|
1337
|
+
selectedPurposes[purpose.uuid] = true;
|
|
1338
|
+
purpose.data_elements.forEach((element) => {
|
|
1339
|
+
selectedDataElements[dataElementKey(purpose.uuid, element.uuid)] = element.enabled;
|
|
1340
|
+
});
|
|
1341
|
+
});
|
|
1342
|
+
return { selectedPurposes, selectedDataElements };
|
|
1343
|
+
};
|
|
1344
|
+
var hasRequiredDataElement = (purpose) => purpose.data_elements.some((element) => element.required);
|
|
1345
|
+
|
|
1378
1346
|
// src/RedactoNoticeConsent/useResponsive.ts
|
|
1379
1347
|
import { useWindowDimensions } from "react-native";
|
|
1380
1348
|
var useResponsive = () => {
|
|
@@ -1387,13 +1355,13 @@ var useResponsive = () => {
|
|
|
1387
1355
|
};
|
|
1388
1356
|
|
|
1389
1357
|
// src/RedactoNoticeConsent/RedactoNoticeConsent.tsx
|
|
1390
|
-
import { Fragment, jsx as
|
|
1358
|
+
import { Fragment, jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1391
1359
|
function RemoteLogo({ uri }) {
|
|
1392
1360
|
const isSvg = uri.toLowerCase().endsWith(".svg") || uri.toLowerCase().includes("image/svg");
|
|
1393
1361
|
if (isSvg && SvgUri) {
|
|
1394
|
-
return /* @__PURE__ */
|
|
1362
|
+
return /* @__PURE__ */ jsx4(SvgUri, { uri, width: 32, height: 32 });
|
|
1395
1363
|
}
|
|
1396
|
-
return /* @__PURE__ */
|
|
1364
|
+
return /* @__PURE__ */ jsx4(Image, { style: styles3.logo, source: { uri } });
|
|
1397
1365
|
}
|
|
1398
1366
|
function stripHtml(html) {
|
|
1399
1367
|
return html.replace(/<[^>]*>/g, "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/ /g, " ").trim();
|
|
@@ -1446,16 +1414,16 @@ var PurposeItem = ({
|
|
|
1446
1414
|
const headingColor = (settings == null ? void 0 : settings.headingColor) || "#323B4B";
|
|
1447
1415
|
const textColor = (settings == null ? void 0 : settings.textColor) || "#344054";
|
|
1448
1416
|
return /* @__PURE__ */ jsxs2(View3, { children: [
|
|
1449
|
-
/* @__PURE__ */ jsxs2(View3, { style:
|
|
1417
|
+
/* @__PURE__ */ jsxs2(View3, { style: styles3.optionItem, children: [
|
|
1450
1418
|
/* @__PURE__ */ jsxs2(
|
|
1451
1419
|
TouchableOpacity3,
|
|
1452
1420
|
{
|
|
1453
|
-
style:
|
|
1421
|
+
style: styles3.optionLeft,
|
|
1454
1422
|
onPress: () => onPurposeCollapse(purpose.uuid),
|
|
1455
1423
|
accessibilityRole: "button",
|
|
1456
1424
|
accessibilityLabel: `${collapsedPurposes[purpose.uuid] ? "Expand" : "Collapse"} ${getTranslatedText("purposes.name", purpose.name, purpose.uuid)} details`,
|
|
1457
1425
|
children: [
|
|
1458
|
-
/* @__PURE__ */
|
|
1426
|
+
/* @__PURE__ */ jsx4(View3, { style: styles3.purposeChevron, children: /* @__PURE__ */ jsx4(Svg3, { width: 7, height: 12, viewBox: "0 0 7 12", fill: "none", children: /* @__PURE__ */ jsx4(
|
|
1459
1427
|
Path3,
|
|
1460
1428
|
{
|
|
1461
1429
|
d: "M1 1L6 6L1 11",
|
|
@@ -1466,25 +1434,28 @@ var PurposeItem = ({
|
|
|
1466
1434
|
transform: !collapsedPurposes[purpose.uuid] ? "rotate(90 3.5 6)" : void 0
|
|
1467
1435
|
}
|
|
1468
1436
|
) }) }),
|
|
1469
|
-
/* @__PURE__ */ jsxs2(View3, { style:
|
|
1470
|
-
/* @__PURE__ */
|
|
1471
|
-
|
|
1437
|
+
/* @__PURE__ */ jsxs2(View3, { style: styles3.optionTextContainer, children: [
|
|
1438
|
+
/* @__PURE__ */ jsxs2(
|
|
1439
|
+
Text3,
|
|
1472
1440
|
{
|
|
1473
1441
|
style: [
|
|
1474
|
-
|
|
1442
|
+
styles3.optionTitle,
|
|
1475
1443
|
{ color: headingColor },
|
|
1476
|
-
activeTTSSegmentKey === `purpose_name_${purpose.uuid}` ?
|
|
1444
|
+
activeTTSSegmentKey === `purpose_name_${purpose.uuid}` ? styles3.ttsHighlight : null
|
|
1477
1445
|
],
|
|
1478
|
-
children:
|
|
1446
|
+
children: [
|
|
1447
|
+
getTranslatedText("purposes.name", purpose.name, purpose.uuid),
|
|
1448
|
+
hasRequiredDataElement(purpose) && /* @__PURE__ */ jsx4(RequiredMarker, {})
|
|
1449
|
+
]
|
|
1479
1450
|
}
|
|
1480
1451
|
),
|
|
1481
|
-
/* @__PURE__ */
|
|
1482
|
-
|
|
1452
|
+
/* @__PURE__ */ jsx4(
|
|
1453
|
+
Text3,
|
|
1483
1454
|
{
|
|
1484
1455
|
style: [
|
|
1485
|
-
|
|
1456
|
+
styles3.optionDescription,
|
|
1486
1457
|
{ color: textColor },
|
|
1487
|
-
activeTTSSegmentKey === `purpose_desc_${purpose.uuid}` ?
|
|
1458
|
+
activeTTSSegmentKey === `purpose_desc_${purpose.uuid}` ? styles3.ttsHighlight : null
|
|
1488
1459
|
],
|
|
1489
1460
|
children: getTranslatedText("purposes.description", purpose.description, purpose.uuid)
|
|
1490
1461
|
}
|
|
@@ -1493,7 +1464,7 @@ var PurposeItem = ({
|
|
|
1493
1464
|
]
|
|
1494
1465
|
}
|
|
1495
1466
|
),
|
|
1496
|
-
!isAlreadyConsented && /* @__PURE__ */
|
|
1467
|
+
!isAlreadyConsented && /* @__PURE__ */ jsx4(
|
|
1497
1468
|
Checkbox,
|
|
1498
1469
|
{
|
|
1499
1470
|
checked: selectedPurposes[purpose.uuid] || false,
|
|
@@ -1503,7 +1474,7 @@ var PurposeItem = ({
|
|
|
1503
1474
|
accessibilityLabel: `Select all data elements for ${getTranslatedText("purposes.name", purpose.name, purpose.uuid)}`
|
|
1504
1475
|
}
|
|
1505
1476
|
),
|
|
1506
|
-
isAlreadyConsented && /* @__PURE__ */
|
|
1477
|
+
isAlreadyConsented && /* @__PURE__ */ jsx4(View3, { style: styles3.consentedCheckmark, children: /* @__PURE__ */ jsx4(Svg3, { width: 12, height: 12, viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ jsx4(
|
|
1507
1478
|
Path3,
|
|
1508
1479
|
{
|
|
1509
1480
|
d: "M4 6L5.5 7.5L8.5 4.5",
|
|
@@ -1514,22 +1485,22 @@ var PurposeItem = ({
|
|
|
1514
1485
|
}
|
|
1515
1486
|
) }) })
|
|
1516
1487
|
] }),
|
|
1517
|
-
!collapsedPurposes[purpose.uuid] && purpose.data_elements && purpose.data_elements.length > 0 && /* @__PURE__ */
|
|
1488
|
+
!collapsedPurposes[purpose.uuid] && purpose.data_elements && purpose.data_elements.length > 0 && /* @__PURE__ */ jsx4(View3, { style: styles3.dataElementsContainer, children: purpose.data_elements.map((dataElement) => /* @__PURE__ */ jsxs2(View3, { style: styles3.dataElementItem, children: [
|
|
1518
1489
|
/* @__PURE__ */ jsxs2(
|
|
1519
|
-
|
|
1490
|
+
Text3,
|
|
1520
1491
|
{
|
|
1521
1492
|
style: [
|
|
1522
|
-
|
|
1493
|
+
styles3.dataElementText,
|
|
1523
1494
|
{ color: textColor },
|
|
1524
|
-
activeTTSSegmentKey === `element_${dataElement.uuid}` ?
|
|
1495
|
+
activeTTSSegmentKey === `element_${dataElement.uuid}` ? styles3.ttsHighlight : null
|
|
1525
1496
|
],
|
|
1526
1497
|
children: [
|
|
1527
1498
|
getTranslatedText("data_elements.name", dataElement.name, dataElement.uuid),
|
|
1528
|
-
dataElement.required && /* @__PURE__ */
|
|
1499
|
+
dataElement.required && /* @__PURE__ */ jsx4(RequiredMarker, {})
|
|
1529
1500
|
]
|
|
1530
1501
|
}
|
|
1531
1502
|
),
|
|
1532
|
-
!isAlreadyConsented && /* @__PURE__ */
|
|
1503
|
+
!isAlreadyConsented && /* @__PURE__ */ jsx4(
|
|
1533
1504
|
Checkbox,
|
|
1534
1505
|
{
|
|
1535
1506
|
checked: selectedDataElements[`${purpose.uuid}-${dataElement.uuid}`] || false,
|
|
@@ -1541,7 +1512,7 @@ var PurposeItem = ({
|
|
|
1541
1512
|
),
|
|
1542
1513
|
isAlreadyConsented && (() => {
|
|
1543
1514
|
const wasSelected = initialDataElementSelections[`${purpose.uuid}-${dataElement.uuid}`] || false;
|
|
1544
|
-
return wasSelected ? /* @__PURE__ */
|
|
1515
|
+
return wasSelected ? /* @__PURE__ */ jsx4(View3, { style: styles3.consentedCheckmarkSmall, children: /* @__PURE__ */ jsx4(Svg3, { width: 10, height: 10, viewBox: "0 0 10 10", fill: "none", children: /* @__PURE__ */ jsx4(
|
|
1545
1516
|
Path3,
|
|
1546
1517
|
{
|
|
1547
1518
|
d: "M3 5L4.5 6.5L7.5 3.5",
|
|
@@ -1550,7 +1521,7 @@ var PurposeItem = ({
|
|
|
1550
1521
|
strokeLinecap: "round",
|
|
1551
1522
|
strokeLinejoin: "round"
|
|
1552
1523
|
}
|
|
1553
|
-
) }) }) : /* @__PURE__ */
|
|
1524
|
+
) }) }) : /* @__PURE__ */ jsx4(View3, { style: styles3.notConsentedCircle });
|
|
1554
1525
|
})()
|
|
1555
1526
|
] }, dataElement.uuid)) })
|
|
1556
1527
|
] });
|
|
@@ -1562,47 +1533,47 @@ var GuardianForm = ({ formData, errors, isSubmitting, onChange, onNext, onDeclin
|
|
|
1562
1533
|
const textColor = (settings == null ? void 0 : settings.textColor) || "#344054";
|
|
1563
1534
|
const [showRelationshipDropdown, setShowRelationshipDropdown] = useState(false);
|
|
1564
1535
|
return /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
1565
|
-
/* @__PURE__ */
|
|
1566
|
-
logoUrl ? /* @__PURE__ */
|
|
1567
|
-
/* @__PURE__ */
|
|
1536
|
+
/* @__PURE__ */ jsx4(View3, { style: styles3.topSection, children: /* @__PURE__ */ jsxs2(View3, { style: styles3.topLeft, children: [
|
|
1537
|
+
logoUrl ? /* @__PURE__ */ jsx4(RemoteLogo, { uri: logoUrl, style: { height: 32, width: 80 } }) : null,
|
|
1538
|
+
/* @__PURE__ */ jsx4(Text3, { style: [styles3.title, { color: (settings == null ? void 0 : settings.headingColor) || "#323B4B" }], children: "Guardian Verification" })
|
|
1568
1539
|
] }) }),
|
|
1569
|
-
/* @__PURE__ */
|
|
1570
|
-
/* @__PURE__ */ jsxs2(ScrollView, { style:
|
|
1571
|
-
/* @__PURE__ */
|
|
1572
|
-
/* @__PURE__ */
|
|
1540
|
+
/* @__PURE__ */ jsx4(View3, { style: styles3.divider }),
|
|
1541
|
+
/* @__PURE__ */ jsxs2(ScrollView, { style: styles3.middleSection, showsVerticalScrollIndicator: false, children: [
|
|
1542
|
+
/* @__PURE__ */ jsx4(Text3, { style: [styles3.privacyText, { color: textColor, fontSize: 13, lineHeight: 20 }], children: "Since you are under the age of consent, a legal guardian must verify their identity via DigiLocker before consent can be provided on your behalf." }),
|
|
1543
|
+
/* @__PURE__ */ jsx4(View3, { style: guardianStyles.infoBanner, children: /* @__PURE__ */ jsx4(Text3, { style: guardianStyles.infoBannerText, children: "Please ensure the name and phone number entered below match the guardian's official Aadhaar-linked records for successful verification." }) }),
|
|
1573
1544
|
/* @__PURE__ */ jsxs2(View3, { style: { marginTop: 16, gap: 12 }, children: [
|
|
1574
|
-
/* @__PURE__ */ jsxs2(View3, { style:
|
|
1575
|
-
/* @__PURE__ */ jsxs2(
|
|
1545
|
+
/* @__PURE__ */ jsxs2(View3, { style: styles3.inputContainer, children: [
|
|
1546
|
+
/* @__PURE__ */ jsxs2(Text3, { style: [styles3.inputLabel, { color: textColor }], children: [
|
|
1576
1547
|
"Guardian's Full Name ",
|
|
1577
|
-
/* @__PURE__ */
|
|
1548
|
+
/* @__PURE__ */ jsx4(Text3, { style: { color: "red" }, children: "*" })
|
|
1578
1549
|
] }),
|
|
1579
|
-
/* @__PURE__ */
|
|
1550
|
+
/* @__PURE__ */ jsx4(
|
|
1580
1551
|
TextInput,
|
|
1581
1552
|
{
|
|
1582
1553
|
value: formData.guardianName,
|
|
1583
1554
|
onChangeText: (v) => onChange("guardianName", v),
|
|
1584
1555
|
style: [
|
|
1585
|
-
|
|
1556
|
+
styles3.textInput,
|
|
1586
1557
|
{ borderColor: errors.guardianName ? "#DC2626" : borderColor, color: textColor }
|
|
1587
1558
|
],
|
|
1588
1559
|
placeholder: "e.g. Rajesh Kumar",
|
|
1589
1560
|
placeholderTextColor: "#9CA3AF"
|
|
1590
1561
|
}
|
|
1591
1562
|
),
|
|
1592
|
-
errors.guardianName ? /* @__PURE__ */
|
|
1563
|
+
errors.guardianName ? /* @__PURE__ */ jsx4(Text3, { style: styles3.inputError, children: errors.guardianName }) : null
|
|
1593
1564
|
] }),
|
|
1594
|
-
/* @__PURE__ */ jsxs2(View3, { style:
|
|
1595
|
-
/* @__PURE__ */ jsxs2(
|
|
1565
|
+
/* @__PURE__ */ jsxs2(View3, { style: styles3.inputContainer, children: [
|
|
1566
|
+
/* @__PURE__ */ jsxs2(Text3, { style: [styles3.inputLabel, { color: textColor }], children: [
|
|
1596
1567
|
"Guardian's Phone Number ",
|
|
1597
|
-
/* @__PURE__ */
|
|
1568
|
+
/* @__PURE__ */ jsx4(Text3, { style: { color: "red" }, children: "*" })
|
|
1598
1569
|
] }),
|
|
1599
|
-
/* @__PURE__ */
|
|
1570
|
+
/* @__PURE__ */ jsx4(
|
|
1600
1571
|
TextInput,
|
|
1601
1572
|
{
|
|
1602
1573
|
value: formData.guardianContact,
|
|
1603
1574
|
onChangeText: (v) => onChange("guardianContact", v),
|
|
1604
1575
|
style: [
|
|
1605
|
-
|
|
1576
|
+
styles3.textInput,
|
|
1606
1577
|
{ borderColor: errors.guardianContact ? "#DC2626" : borderColor, color: textColor }
|
|
1607
1578
|
],
|
|
1608
1579
|
placeholder: "e.g. 9876543210",
|
|
@@ -1610,20 +1581,20 @@ var GuardianForm = ({ formData, errors, isSubmitting, onChange, onNext, onDeclin
|
|
|
1610
1581
|
keyboardType: "phone-pad"
|
|
1611
1582
|
}
|
|
1612
1583
|
),
|
|
1613
|
-
/* @__PURE__ */
|
|
1614
|
-
errors.guardianContact ? /* @__PURE__ */
|
|
1584
|
+
/* @__PURE__ */ jsx4(Text3, { style: { fontSize: 11, color: "#667085", marginTop: 4 }, children: "Mobile number linked to guardian's Aadhaar" }),
|
|
1585
|
+
errors.guardianContact ? /* @__PURE__ */ jsx4(Text3, { style: styles3.inputError, children: errors.guardianContact }) : null
|
|
1615
1586
|
] }),
|
|
1616
|
-
/* @__PURE__ */ jsxs2(View3, { style:
|
|
1617
|
-
/* @__PURE__ */ jsxs2(
|
|
1587
|
+
/* @__PURE__ */ jsxs2(View3, { style: styles3.inputContainer, children: [
|
|
1588
|
+
/* @__PURE__ */ jsxs2(Text3, { style: [styles3.inputLabel, { color: textColor }], children: [
|
|
1618
1589
|
"Relationship ",
|
|
1619
|
-
/* @__PURE__ */
|
|
1590
|
+
/* @__PURE__ */ jsx4(Text3, { style: { color: "red" }, children: "*" })
|
|
1620
1591
|
] }),
|
|
1621
1592
|
/* @__PURE__ */ jsxs2(View3, { style: { position: "relative" }, children: [
|
|
1622
1593
|
/* @__PURE__ */ jsxs2(
|
|
1623
1594
|
TouchableOpacity3,
|
|
1624
1595
|
{
|
|
1625
1596
|
style: [
|
|
1626
|
-
|
|
1597
|
+
styles3.textInput,
|
|
1627
1598
|
{
|
|
1628
1599
|
borderColor: errors.guardianRelationship ? "#DC2626" : borderColor,
|
|
1629
1600
|
flexDirection: "row",
|
|
@@ -1633,8 +1604,8 @@ var GuardianForm = ({ formData, errors, isSubmitting, onChange, onNext, onDeclin
|
|
|
1633
1604
|
],
|
|
1634
1605
|
onPress: () => setShowRelationshipDropdown((v) => !v),
|
|
1635
1606
|
children: [
|
|
1636
|
-
/* @__PURE__ */
|
|
1637
|
-
/* @__PURE__ */
|
|
1607
|
+
/* @__PURE__ */ jsx4(Text3, { style: { color: formData.guardianRelationship ? textColor : "#9CA3AF", fontSize: 13 }, children: formData.guardianRelationship || "Select relationship" }),
|
|
1608
|
+
/* @__PURE__ */ jsx4(Svg3, { width: 12, height: 12, viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsx4(
|
|
1638
1609
|
Path3,
|
|
1639
1610
|
{
|
|
1640
1611
|
d: "M4 6L8 10L12 6",
|
|
@@ -1647,7 +1618,7 @@ var GuardianForm = ({ formData, errors, isSubmitting, onChange, onNext, onDeclin
|
|
|
1647
1618
|
]
|
|
1648
1619
|
}
|
|
1649
1620
|
),
|
|
1650
|
-
showRelationshipDropdown && /* @__PURE__ */
|
|
1621
|
+
showRelationshipDropdown && /* @__PURE__ */ jsx4(View3, { style: guardianStyles.relationshipDropdown, children: RELATIONSHIP_OPTIONS.map((option) => /* @__PURE__ */ jsx4(
|
|
1651
1622
|
TouchableOpacity3,
|
|
1652
1623
|
{
|
|
1653
1624
|
style: [
|
|
@@ -1658,41 +1629,41 @@ var GuardianForm = ({ formData, errors, isSubmitting, onChange, onNext, onDeclin
|
|
|
1658
1629
|
onChange("guardianRelationship", option);
|
|
1659
1630
|
setShowRelationshipDropdown(false);
|
|
1660
1631
|
},
|
|
1661
|
-
children: /* @__PURE__ */
|
|
1632
|
+
children: /* @__PURE__ */ jsx4(Text3, { style: [guardianStyles.relationshipItemText, { color: textColor }], children: option })
|
|
1662
1633
|
},
|
|
1663
1634
|
option
|
|
1664
1635
|
)) })
|
|
1665
1636
|
] }),
|
|
1666
|
-
errors.guardianRelationship ? /* @__PURE__ */
|
|
1637
|
+
errors.guardianRelationship ? /* @__PURE__ */ jsx4(Text3, { style: styles3.inputError, children: errors.guardianRelationship }) : null
|
|
1667
1638
|
] }),
|
|
1668
|
-
errors.general ? /* @__PURE__ */
|
|
1639
|
+
errors.general ? /* @__PURE__ */ jsx4(View3, { style: styles3.errorContainer, children: /* @__PURE__ */ jsx4(Text3, { style: styles3.errorText, children: errors.general }) }) : null
|
|
1669
1640
|
] })
|
|
1670
1641
|
] }),
|
|
1671
|
-
/* @__PURE__ */ jsxs2(View3, { style:
|
|
1672
|
-
/* @__PURE__ */
|
|
1642
|
+
/* @__PURE__ */ jsxs2(View3, { style: styles3.bottomSection, children: [
|
|
1643
|
+
/* @__PURE__ */ jsx4(
|
|
1673
1644
|
TouchableOpacity3,
|
|
1674
1645
|
{
|
|
1675
1646
|
style: [
|
|
1676
|
-
|
|
1677
|
-
|
|
1647
|
+
styles3.button,
|
|
1648
|
+
styles3.acceptButton,
|
|
1678
1649
|
((_a = settings == null ? void 0 : settings.button) == null ? void 0 : _a.accept) ? { backgroundColor: settings.button.accept.backgroundColor } : null
|
|
1679
1650
|
],
|
|
1680
1651
|
onPress: onNext,
|
|
1681
1652
|
disabled: isSubmitting,
|
|
1682
1653
|
accessibilityLabel: "Submit guardian information and proceed",
|
|
1683
|
-
children: isSubmitting ? /* @__PURE__ */
|
|
1684
|
-
|
|
1685
|
-
|
|
1654
|
+
children: isSubmitting ? /* @__PURE__ */ jsx4(ActivityIndicator2, { size: "small", color: ((_c = (_b = settings == null ? void 0 : settings.button) == null ? void 0 : _b.accept) == null ? void 0 : _c.textColor) || "#ffffff" }) : /* @__PURE__ */ jsx4(Text3, { style: [
|
|
1655
|
+
styles3.buttonText,
|
|
1656
|
+
styles3.acceptButtonText,
|
|
1686
1657
|
((_d = settings == null ? void 0 : settings.button) == null ? void 0 : _d.accept) ? { color: settings.button.accept.textColor } : null
|
|
1687
1658
|
], children: "Verify via DigiLocker" })
|
|
1688
1659
|
}
|
|
1689
1660
|
),
|
|
1690
|
-
/* @__PURE__ */
|
|
1661
|
+
/* @__PURE__ */ jsx4(
|
|
1691
1662
|
TouchableOpacity3,
|
|
1692
1663
|
{
|
|
1693
1664
|
style: [
|
|
1694
|
-
|
|
1695
|
-
|
|
1665
|
+
styles3.button,
|
|
1666
|
+
styles3.cancelButton,
|
|
1696
1667
|
((_e = settings == null ? void 0 : settings.button) == null ? void 0 : _e.decline) ? {
|
|
1697
1668
|
backgroundColor: settings.button.decline.backgroundColor,
|
|
1698
1669
|
borderColor: (settings == null ? void 0 : settings.borderColor) || "#d0d5dd"
|
|
@@ -1701,9 +1672,9 @@ var GuardianForm = ({ formData, errors, isSubmitting, onChange, onNext, onDeclin
|
|
|
1701
1672
|
onPress: onDecline,
|
|
1702
1673
|
disabled: isSubmitting,
|
|
1703
1674
|
accessibilityLabel: "Cancel guardian information form",
|
|
1704
|
-
children: /* @__PURE__ */
|
|
1705
|
-
|
|
1706
|
-
|
|
1675
|
+
children: /* @__PURE__ */ jsx4(Text3, { style: [
|
|
1676
|
+
styles3.buttonText,
|
|
1677
|
+
styles3.cancelButtonText,
|
|
1707
1678
|
((_f = settings == null ? void 0 : settings.button) == null ? void 0 : _f.decline) ? { color: settings.button.decline.textColor } : null
|
|
1708
1679
|
], children: "Cancel" })
|
|
1709
1680
|
}
|
|
@@ -1711,7 +1682,7 @@ var GuardianForm = ({ formData, errors, isSubmitting, onChange, onNext, onDeclin
|
|
|
1711
1682
|
] })
|
|
1712
1683
|
] });
|
|
1713
1684
|
};
|
|
1714
|
-
var guardianStyles =
|
|
1685
|
+
var guardianStyles = StyleSheet5.create({
|
|
1715
1686
|
infoBanner: {
|
|
1716
1687
|
backgroundColor: "#EFF6FF",
|
|
1717
1688
|
borderWidth: 1,
|
|
@@ -1754,42 +1725,42 @@ var guardianStyles = StyleSheet4.create({
|
|
|
1754
1725
|
var AgeVerification = ({ onYes, onNo, onClose, settings, logoUrl }) => {
|
|
1755
1726
|
var _a, _b, _c, _d;
|
|
1756
1727
|
return /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
1757
|
-
/* @__PURE__ */ jsxs2(View3, { style:
|
|
1758
|
-
/* @__PURE__ */ jsxs2(View3, { style:
|
|
1759
|
-
logoUrl ? /* @__PURE__ */
|
|
1760
|
-
/* @__PURE__ */
|
|
1728
|
+
/* @__PURE__ */ jsxs2(View3, { style: styles3.topSection, children: [
|
|
1729
|
+
/* @__PURE__ */ jsxs2(View3, { style: styles3.topLeft, children: [
|
|
1730
|
+
logoUrl ? /* @__PURE__ */ jsx4(RemoteLogo, { uri: logoUrl, style: { height: 32, width: 80 } }) : null,
|
|
1731
|
+
/* @__PURE__ */ jsx4(Text3, { style: [styles3.title, { color: (settings == null ? void 0 : settings.headingColor) || "#323B4B" }], children: "Age Verification Required" })
|
|
1761
1732
|
] }),
|
|
1762
|
-
onClose ? /* @__PURE__ */
|
|
1733
|
+
onClose ? /* @__PURE__ */ jsx4(TouchableOpacity3, { onPress: onClose, hitSlop: { top: 8, bottom: 8, left: 8, right: 8 }, children: /* @__PURE__ */ jsx4(Svg3, { width: 18, height: 18, viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx4(Path3, { d: "M18 6L6 18M6 6l12 12", stroke: "#9CA3AF", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }) }) }) : null
|
|
1763
1734
|
] }),
|
|
1764
|
-
/* @__PURE__ */
|
|
1765
|
-
/* @__PURE__ */ jsxs2(ScrollView, { style:
|
|
1766
|
-
/* @__PURE__ */
|
|
1767
|
-
/* @__PURE__ */
|
|
1735
|
+
/* @__PURE__ */ jsx4(View3, { style: styles3.divider }),
|
|
1736
|
+
/* @__PURE__ */ jsxs2(ScrollView, { style: styles3.middleSection, showsVerticalScrollIndicator: false, children: [
|
|
1737
|
+
/* @__PURE__ */ jsx4(Text3, { style: [styles3.privacyText, { color: (settings == null ? void 0 : settings.textColor) || "#344054" }], children: "To proceed with this consent form, we need to verify your age." }),
|
|
1738
|
+
/* @__PURE__ */ jsx4(Text3, { style: [styles3.privacyText, { color: (settings == null ? void 0 : settings.textColor) || "#344054", marginTop: 12, fontWeight: "600" }], children: "Are you 18 years of age or older?" })
|
|
1768
1739
|
] }),
|
|
1769
|
-
/* @__PURE__ */ jsxs2(View3, { style:
|
|
1770
|
-
/* @__PURE__ */
|
|
1740
|
+
/* @__PURE__ */ jsxs2(View3, { style: styles3.bottomSection, children: [
|
|
1741
|
+
/* @__PURE__ */ jsx4(
|
|
1771
1742
|
TouchableOpacity3,
|
|
1772
1743
|
{
|
|
1773
1744
|
style: [
|
|
1774
|
-
|
|
1775
|
-
|
|
1745
|
+
styles3.button,
|
|
1746
|
+
styles3.acceptButton,
|
|
1776
1747
|
((_a = settings == null ? void 0 : settings.button) == null ? void 0 : _a.accept) ? { backgroundColor: settings.button.accept.backgroundColor } : null
|
|
1777
1748
|
],
|
|
1778
1749
|
onPress: onYes,
|
|
1779
1750
|
accessibilityLabel: "Yes, I am 18 or older",
|
|
1780
|
-
children: /* @__PURE__ */
|
|
1781
|
-
|
|
1782
|
-
|
|
1751
|
+
children: /* @__PURE__ */ jsx4(Text3, { style: [
|
|
1752
|
+
styles3.buttonText,
|
|
1753
|
+
styles3.acceptButtonText,
|
|
1783
1754
|
((_b = settings == null ? void 0 : settings.button) == null ? void 0 : _b.accept) ? { color: settings.button.accept.textColor } : null
|
|
1784
1755
|
], children: "Yes, I am 18 or older" })
|
|
1785
1756
|
}
|
|
1786
1757
|
),
|
|
1787
|
-
/* @__PURE__ */
|
|
1758
|
+
/* @__PURE__ */ jsx4(
|
|
1788
1759
|
TouchableOpacity3,
|
|
1789
1760
|
{
|
|
1790
1761
|
style: [
|
|
1791
|
-
|
|
1792
|
-
|
|
1762
|
+
styles3.button,
|
|
1763
|
+
styles3.cancelButton,
|
|
1793
1764
|
((_c = settings == null ? void 0 : settings.button) == null ? void 0 : _c.decline) ? {
|
|
1794
1765
|
backgroundColor: settings.button.decline.backgroundColor,
|
|
1795
1766
|
borderColor: (settings == null ? void 0 : settings.borderColor) || "#d0d5dd"
|
|
@@ -1797,9 +1768,9 @@ var AgeVerification = ({ onYes, onNo, onClose, settings, logoUrl }) => {
|
|
|
1797
1768
|
],
|
|
1798
1769
|
onPress: onNo,
|
|
1799
1770
|
accessibilityLabel: "No, I am under 18",
|
|
1800
|
-
children: /* @__PURE__ */
|
|
1801
|
-
|
|
1802
|
-
|
|
1771
|
+
children: /* @__PURE__ */ jsx4(Text3, { style: [
|
|
1772
|
+
styles3.buttonText,
|
|
1773
|
+
styles3.cancelButtonText,
|
|
1803
1774
|
((_d = settings == null ? void 0 : settings.button) == null ? void 0 : _d.decline) ? { color: settings.button.decline.textColor } : null
|
|
1804
1775
|
], children: "No, I am under 18" })
|
|
1805
1776
|
}
|
|
@@ -1830,7 +1801,7 @@ var RedactoNoticeConsent = ({
|
|
|
1830
1801
|
includeFullyConsentedData = false,
|
|
1831
1802
|
reviewModeButtonText
|
|
1832
1803
|
}) => {
|
|
1833
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
|
|
1804
|
+
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;
|
|
1834
1805
|
const { isMobile } = useResponsive();
|
|
1835
1806
|
const sandboxParams = useMemo(
|
|
1836
1807
|
() => ({
|
|
@@ -1888,7 +1859,6 @@ var RedactoNoticeConsent = ({
|
|
|
1888
1859
|
const abortControllerRef = useRef2(null);
|
|
1889
1860
|
const hasBootstrappedLanguageRef = useRef2(false);
|
|
1890
1861
|
const fetchContent = useCallback(async () => {
|
|
1891
|
-
var _a2, _b2;
|
|
1892
1862
|
if (abortControllerRef.current) {
|
|
1893
1863
|
abortControllerRef.current.abort();
|
|
1894
1864
|
}
|
|
@@ -1909,23 +1879,8 @@ var RedactoNoticeConsent = ({
|
|
|
1909
1879
|
...sandboxParams
|
|
1910
1880
|
});
|
|
1911
1881
|
const activeConfig2 = data.detail.active_config;
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
if (accessToken && ledgerBaseUrl && !applicationId && !token) {
|
|
1915
|
-
const ledgerStatus = await fetchNoticeConsentStatus({
|
|
1916
|
-
accessToken,
|
|
1917
|
-
ledgerBaseUrl,
|
|
1918
|
-
noticeUuid: noticeId,
|
|
1919
|
-
signal: (_a2 = abortControllerRef.current) == null ? void 0 : _a2.signal
|
|
1920
|
-
});
|
|
1921
|
-
if (ledgerStatus) {
|
|
1922
|
-
const overlay = buildLedgerConsentOverlay(ledgerStatus, activeConfig2.purposes);
|
|
1923
|
-
reconsentRequired = (_b2 = overlay == null ? void 0 : overlay.reconsent_required) != null ? _b2 : false;
|
|
1924
|
-
purposeSelections = overlay == null ? void 0 : overlay.purpose_selections;
|
|
1925
|
-
data.detail.purpose_selections = purposeSelections;
|
|
1926
|
-
data.detail.reconsent_required = reconsentRequired;
|
|
1927
|
-
}
|
|
1928
|
-
}
|
|
1882
|
+
const purposeSelections = data.detail.purpose_selections;
|
|
1883
|
+
const reconsentRequired = data.detail.reconsent_required || false;
|
|
1929
1884
|
const noticeIsMinor = data.detail.is_minor || false;
|
|
1930
1885
|
setIsMinor(noticeIsMinor);
|
|
1931
1886
|
const initialCollapsed = {};
|
|
@@ -1938,9 +1893,9 @@ var RedactoNoticeConsent = ({
|
|
|
1938
1893
|
const purposeSelected = sel ? sel.selected : false;
|
|
1939
1894
|
initialPurposeState[purpose.uuid] = purposeSelected;
|
|
1940
1895
|
purpose.data_elements.forEach((el) => {
|
|
1941
|
-
var
|
|
1896
|
+
var _a2, _b2, _c2;
|
|
1942
1897
|
const combinedId = `${purpose.uuid}-${el.uuid}`;
|
|
1943
|
-
const elementSel = (_c2 = (
|
|
1898
|
+
const elementSel = (_c2 = (_b2 = (_a2 = sel == null ? void 0 : sel.data_elements) == null ? void 0 : _a2[el.uuid]) == null ? void 0 : _b2.selected) != null ? _c2 : false;
|
|
1944
1899
|
initialDataElementState[combinedId] = elementSel;
|
|
1945
1900
|
initialDataElementSelectionsMap[combinedId] = elementSel;
|
|
1946
1901
|
});
|
|
@@ -2024,6 +1979,9 @@ var RedactoNoticeConsent = ({
|
|
|
2024
1979
|
confirm_button_text: data.detail.confirm_button_text_audio_url,
|
|
2025
1980
|
decline_button_text: data.detail.decline_button_text_audio_url
|
|
2026
1981
|
};
|
|
1982
|
+
if (data.detail.accept_all_button_text_audio_url) {
|
|
1983
|
+
urls.accept_all_button_text = data.detail.accept_all_button_text_audio_url;
|
|
1984
|
+
}
|
|
2027
1985
|
if (data.detail.privacy_center_anchor_text_audio_url) {
|
|
2028
1986
|
urls.privacy_center_anchor_text = data.detail.privacy_center_anchor_text_audio_url;
|
|
2029
1987
|
}
|
|
@@ -2233,6 +2191,7 @@ var RedactoNoticeConsent = ({
|
|
|
2233
2191
|
DPO_AUDIO_ELEMENT_MAP.forEach(({ elementId }) => {
|
|
2234
2192
|
pushSegment(elementId, ttsAudioUrls[elementId]);
|
|
2235
2193
|
});
|
|
2194
|
+
pushSegment("accept_all_button_text", ttsAudioUrls.accept_all_button_text);
|
|
2236
2195
|
pushSegment("confirm_button_text", ttsAudioUrls.confirm_button_text);
|
|
2237
2196
|
pushSegment("decline_button_text", ttsAudioUrls.decline_button_text);
|
|
2238
2197
|
if (queue.length === 0) {
|
|
@@ -2384,12 +2343,20 @@ var RedactoNoticeConsent = ({
|
|
|
2384
2343
|
return newState;
|
|
2385
2344
|
});
|
|
2386
2345
|
}, [content]);
|
|
2387
|
-
const handleAccept = useCallback(async () => {
|
|
2346
|
+
const handleAccept = useCallback(async (mode = "selected") => {
|
|
2388
2347
|
if (!content) return;
|
|
2389
2348
|
try {
|
|
2390
2349
|
setIsSubmitting(true);
|
|
2391
2350
|
setErrorMessage(null);
|
|
2392
2351
|
const activeConfig2 = content.detail.active_config;
|
|
2352
|
+
const selection = buildSelectionForMode(activeConfig2.purposes, mode, {
|
|
2353
|
+
selectedPurposes,
|
|
2354
|
+
selectedDataElements
|
|
2355
|
+
});
|
|
2356
|
+
if (mode !== "selected") {
|
|
2357
|
+
setSelectedPurposes(selection.selectedPurposes);
|
|
2358
|
+
setSelectedDataElements(selection.selectedDataElements);
|
|
2359
|
+
}
|
|
2393
2360
|
await submitConsentEvent({
|
|
2394
2361
|
accessToken,
|
|
2395
2362
|
baseUrl,
|
|
@@ -2397,10 +2364,10 @@ var RedactoNoticeConsent = ({
|
|
|
2397
2364
|
noticeUuid: activeConfig2.notice_uuid,
|
|
2398
2365
|
purposes: activeConfig2.purposes.map((purpose) => ({
|
|
2399
2366
|
...purpose,
|
|
2400
|
-
selected: selectedPurposes[purpose.uuid] || false,
|
|
2367
|
+
selected: selection.selectedPurposes[purpose.uuid] || false,
|
|
2401
2368
|
data_elements: purpose.data_elements.map((el) => ({
|
|
2402
2369
|
...el,
|
|
2403
|
-
selected: selectedDataElements[`${purpose.uuid}-${el.uuid}`] || false
|
|
2370
|
+
selected: selection.selectedDataElements[`${purpose.uuid}-${el.uuid}`] || false
|
|
2404
2371
|
}))
|
|
2405
2372
|
})),
|
|
2406
2373
|
declined: false,
|
|
@@ -2529,13 +2496,43 @@ var RedactoNoticeConsent = ({
|
|
|
2529
2496
|
}, [activeConfig, selectedDataElements]);
|
|
2530
2497
|
const acceptButtonStyle = { backgroundColor: acceptBackgroundColor };
|
|
2531
2498
|
const acceptButtonTextStyle = { color: acceptTextColor };
|
|
2499
|
+
const acceptAllButtonStyle = {
|
|
2500
|
+
backgroundColor: ((_j = (_i = settings == null ? void 0 : settings.button) == null ? void 0 : _i.acceptAll) == null ? void 0 : _j.backgroundColor) || acceptBackgroundColor
|
|
2501
|
+
};
|
|
2502
|
+
const acceptAllButtonTextStyle = {
|
|
2503
|
+
color: ((_l = (_k = settings == null ? void 0 : settings.button) == null ? void 0 : _k.acceptAll) == null ? void 0 : _l.textColor) || acceptTextColor
|
|
2504
|
+
};
|
|
2505
|
+
const acceptSelectedButtonStyle = {
|
|
2506
|
+
backgroundColor: "#ffffff",
|
|
2507
|
+
borderColor: accentColor
|
|
2508
|
+
};
|
|
2509
|
+
const acceptSelectedButtonTextStyle = { color: accentColor };
|
|
2532
2510
|
const declineButtonStyle = { backgroundColor: declineBackgroundColor, borderColor };
|
|
2533
2511
|
const declineButtonTextStyle = { color: declineTextColor };
|
|
2512
|
+
const acceptAllLabel = getTranslatedText(
|
|
2513
|
+
"accept_all_button_text",
|
|
2514
|
+
(activeConfig == null ? void 0 : activeConfig.accept_all_button_text) || DEFAULT_ACCEPT_ALL_BUTTON_TEXT
|
|
2515
|
+
);
|
|
2516
|
+
const acceptSelectedLabel = getTranslatedText(
|
|
2517
|
+
"confirm_button_text",
|
|
2518
|
+
(activeConfig == null ? void 0 : activeConfig.confirm_button_text) || DEFAULT_ACCEPT_SELECTED_BUTTON_TEXT
|
|
2519
|
+
);
|
|
2520
|
+
const declineLabel = getTranslatedText(
|
|
2521
|
+
"decline_button_text",
|
|
2522
|
+
(activeConfig == null ? void 0 : activeConfig.decline_button_text) || DEFAULT_DECLINE_BUTTON_TEXT
|
|
2523
|
+
);
|
|
2524
|
+
const footerButtonOrder = isMobile ? ["acceptAll", "acceptSelected", "decline"] : ["decline", "acceptSelected", "acceptAll"];
|
|
2525
|
+
const widthStyle = isMobile ? styles3.stackButton : styles3.rowButton;
|
|
2526
|
+
const handleAcceptAll = useCallback(() => handleAccept("all"), [handleAccept]);
|
|
2527
|
+
const handleAcceptSelected = useCallback(
|
|
2528
|
+
() => handleAccept("selected"),
|
|
2529
|
+
[handleAccept]
|
|
2530
|
+
);
|
|
2534
2531
|
const modalBg = (settings == null ? void 0 : settings.backgroundColor) ? { backgroundColor: settings.backgroundColor } : {};
|
|
2535
2532
|
const translatedNoticeText = activeConfig ? stripHtml(getTranslatedText("notice_text", activeConfig.notice_text || "")) : "";
|
|
2536
2533
|
const translatedAdditionalText = activeConfig ? stripHtml(getTranslatedText("additional_text", activeConfig.additional_text || "")) : "";
|
|
2537
2534
|
if (!isVisible && !isLoading) return null;
|
|
2538
|
-
return /* @__PURE__ */
|
|
2535
|
+
return /* @__PURE__ */ jsx4(
|
|
2539
2536
|
Modal,
|
|
2540
2537
|
{
|
|
2541
2538
|
visible: isVisible || isLoading,
|
|
@@ -2543,27 +2540,27 @@ var RedactoNoticeConsent = ({
|
|
|
2543
2540
|
animationType: "fade",
|
|
2544
2541
|
onRequestClose: blockUI ? void 0 : handleDecline,
|
|
2545
2542
|
accessibilityViewIsModal: true,
|
|
2546
|
-
children: /* @__PURE__ */ jsxs2(View3, { style:
|
|
2547
|
-
isLanguageDropdownOpen && /* @__PURE__ */
|
|
2543
|
+
children: /* @__PURE__ */ jsxs2(View3, { style: styles3.overlay, children: [
|
|
2544
|
+
isLanguageDropdownOpen && /* @__PURE__ */ jsx4(
|
|
2548
2545
|
Pressable,
|
|
2549
2546
|
{
|
|
2550
|
-
style: [
|
|
2547
|
+
style: [StyleSheet5.absoluteFillObject, { zIndex: 1 }],
|
|
2551
2548
|
onPress: () => setIsLanguageDropdownOpen(false)
|
|
2552
2549
|
}
|
|
2553
2550
|
),
|
|
2554
|
-
/* @__PURE__ */
|
|
2551
|
+
/* @__PURE__ */ jsx4(
|
|
2555
2552
|
View3,
|
|
2556
2553
|
{
|
|
2557
2554
|
style: [
|
|
2558
|
-
|
|
2555
|
+
styles3.modal,
|
|
2559
2556
|
modalBg,
|
|
2560
2557
|
{ zIndex: 2 },
|
|
2561
2558
|
(settings == null ? void 0 : settings.borderRadius) ? { borderRadius: parseInt(settings.borderRadius, 10) } : null
|
|
2562
2559
|
],
|
|
2563
|
-
children: isLoading ? /* @__PURE__ */ jsxs2(View3, { style:
|
|
2564
|
-
/* @__PURE__ */
|
|
2565
|
-
/* @__PURE__ */
|
|
2566
|
-
] }) : showVerificationScreen ? /* @__PURE__ */
|
|
2560
|
+
children: isLoading ? /* @__PURE__ */ jsxs2(View3, { style: styles3.loadingContainer, children: [
|
|
2561
|
+
/* @__PURE__ */ jsx4(ActivityIndicator2, { size: "large", color: acceptBackgroundColor }),
|
|
2562
|
+
/* @__PURE__ */ jsx4(Text3, { style: styles3.loadingText, children: "Loading..." })
|
|
2563
|
+
] }) : showVerificationScreen ? /* @__PURE__ */ jsx4(View3, { style: styles3.content, children: /* @__PURE__ */ jsx4(
|
|
2567
2564
|
VerificationScreen,
|
|
2568
2565
|
{
|
|
2569
2566
|
status: verificationStatus,
|
|
@@ -2600,7 +2597,7 @@ var RedactoNoticeConsent = ({
|
|
|
2600
2597
|
}
|
|
2601
2598
|
}
|
|
2602
2599
|
}
|
|
2603
|
-
) }) : showGuardianForm ? /* @__PURE__ */
|
|
2600
|
+
) }) : showGuardianForm ? /* @__PURE__ */ jsx4(View3, { style: styles3.content, children: /* @__PURE__ */ jsx4(
|
|
2604
2601
|
GuardianForm,
|
|
2605
2602
|
{
|
|
2606
2603
|
formData: guardianFormData,
|
|
@@ -2627,7 +2624,7 @@ var RedactoNoticeConsent = ({
|
|
|
2627
2624
|
},
|
|
2628
2625
|
logoUrl
|
|
2629
2626
|
}
|
|
2630
|
-
) }) : showAgeVerification ? /* @__PURE__ */
|
|
2627
|
+
) }) : showAgeVerification ? /* @__PURE__ */ jsx4(View3, { style: styles3.content, children: /* @__PURE__ */ jsx4(
|
|
2631
2628
|
AgeVerification,
|
|
2632
2629
|
{
|
|
2633
2630
|
onYes: () => {
|
|
@@ -2655,22 +2652,22 @@ var RedactoNoticeConsent = ({
|
|
|
2655
2652
|
},
|
|
2656
2653
|
logoUrl
|
|
2657
2654
|
}
|
|
2658
|
-
) }) : /* @__PURE__ */ jsxs2(View3, { style:
|
|
2659
|
-
errorMessage ? /* @__PURE__ */ jsxs2(View3, { style:
|
|
2660
|
-
/* @__PURE__ */
|
|
2661
|
-
/* @__PURE__ */
|
|
2655
|
+
) }) : /* @__PURE__ */ jsxs2(View3, { style: styles3.content, children: [
|
|
2656
|
+
errorMessage ? /* @__PURE__ */ jsxs2(View3, { style: styles3.errorContainer, children: [
|
|
2657
|
+
/* @__PURE__ */ jsx4(Text3, { style: styles3.errorText, children: errorMessage }),
|
|
2658
|
+
/* @__PURE__ */ jsx4(TouchableOpacity3, { onPress: () => setErrorMessage(null), hitSlop: { top: 8, bottom: 8, left: 8, right: 8 }, children: /* @__PURE__ */ jsx4(Svg3, { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsx4(Path3, { d: "M12 4L4 12M4 4L12 12", stroke: "#DC2626", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }) }) })
|
|
2662
2659
|
] }) : null,
|
|
2663
|
-
/* @__PURE__ */ jsxs2(View3, { style:
|
|
2664
|
-
/* @__PURE__ */ jsxs2(View3, { style:
|
|
2665
|
-
logoUrl ? /* @__PURE__ */
|
|
2666
|
-
/* @__PURE__ */
|
|
2667
|
-
|
|
2660
|
+
/* @__PURE__ */ jsxs2(View3, { style: styles3.topSection, children: [
|
|
2661
|
+
/* @__PURE__ */ jsxs2(View3, { style: styles3.topLeft, children: [
|
|
2662
|
+
logoUrl ? /* @__PURE__ */ jsx4(RemoteLogo, { uri: logoUrl, style: { height: 32, width: 80 } }) : null,
|
|
2663
|
+
/* @__PURE__ */ jsx4(
|
|
2664
|
+
Text3,
|
|
2668
2665
|
{
|
|
2669
2666
|
style: [
|
|
2670
|
-
|
|
2667
|
+
styles3.title,
|
|
2671
2668
|
{ color: headingColor },
|
|
2672
2669
|
isMobile ? { fontSize: 16 } : null,
|
|
2673
|
-
activeTTSSegmentKey === "notice_banner_heading" ?
|
|
2670
|
+
activeTTSSegmentKey === "notice_banner_heading" ? styles3.ttsHighlight : null
|
|
2674
2671
|
],
|
|
2675
2672
|
numberOfLines: 2,
|
|
2676
2673
|
children: getTranslatedText(
|
|
@@ -2681,31 +2678,31 @@ var RedactoNoticeConsent = ({
|
|
|
2681
2678
|
)
|
|
2682
2679
|
] }),
|
|
2683
2680
|
/* @__PURE__ */ jsxs2(View3, { style: { flexDirection: "row", gap: 8, alignItems: "center" }, children: [
|
|
2684
|
-
isTTSAvailable && /* @__PURE__ */
|
|
2681
|
+
isTTSAvailable && /* @__PURE__ */ jsx4(
|
|
2685
2682
|
TouchableOpacity3,
|
|
2686
2683
|
{
|
|
2687
|
-
style: [
|
|
2684
|
+
style: [styles3.topRight, ((_m = settings == null ? void 0 : settings.button) == null ? void 0 : _m.language) ? { backgroundColor: settings.button.language.backgroundColor, borderColor: settings.button.language.backgroundColor } : null],
|
|
2688
2685
|
onPress: toggleAudio,
|
|
2689
2686
|
accessibilityLabel: isPlaying && !isPaused ? "Pause audio" : isPaused ? "Resume audio" : "Start audio",
|
|
2690
2687
|
children: isPlaying && !isPaused ? /* @__PURE__ */ jsxs2(Svg3, { width: 16, height: 16, viewBox: "0 0 24 24", fill: "none", children: [
|
|
2691
|
-
/* @__PURE__ */
|
|
2692
|
-
/* @__PURE__ */
|
|
2688
|
+
/* @__PURE__ */ jsx4(Rect, { x: "6", y: "4", width: "4", height: "16", fill: ((_o = (_n = settings == null ? void 0 : settings.button) == null ? void 0 : _n.language) == null ? void 0 : _o.textColor) || "#344054" }),
|
|
2689
|
+
/* @__PURE__ */ jsx4(Rect, { x: "14", y: "4", width: "4", height: "16", fill: ((_q = (_p = settings == null ? void 0 : settings.button) == null ? void 0 : _p.language) == null ? void 0 : _q.textColor) || "#344054" })
|
|
2693
2690
|
] }) : /* @__PURE__ */ jsxs2(Svg3, { width: 16, height: 16, viewBox: "0 0 24 24", fill: "none", children: [
|
|
2694
|
-
/* @__PURE__ */
|
|
2691
|
+
/* @__PURE__ */ jsx4(
|
|
2695
2692
|
Path3,
|
|
2696
2693
|
{
|
|
2697
2694
|
d: "M11 5L6 9H2V15H6L11 19V5Z",
|
|
2698
|
-
stroke: ((
|
|
2695
|
+
stroke: ((_s = (_r = settings == null ? void 0 : settings.button) == null ? void 0 : _r.language) == null ? void 0 : _s.textColor) || "#344054",
|
|
2699
2696
|
strokeWidth: 2,
|
|
2700
2697
|
strokeLinecap: "round",
|
|
2701
2698
|
strokeLinejoin: "round"
|
|
2702
2699
|
}
|
|
2703
2700
|
),
|
|
2704
|
-
/* @__PURE__ */
|
|
2701
|
+
/* @__PURE__ */ jsx4(
|
|
2705
2702
|
Path3,
|
|
2706
2703
|
{
|
|
2707
2704
|
d: "M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07",
|
|
2708
|
-
stroke: ((
|
|
2705
|
+
stroke: ((_u = (_t = settings == null ? void 0 : settings.button) == null ? void 0 : _t.language) == null ? void 0 : _u.textColor) || "#344054",
|
|
2709
2706
|
strokeWidth: 2,
|
|
2710
2707
|
strokeLinecap: "round",
|
|
2711
2708
|
strokeLinejoin: "round"
|
|
@@ -2714,23 +2711,23 @@ var RedactoNoticeConsent = ({
|
|
|
2714
2711
|
] })
|
|
2715
2712
|
}
|
|
2716
2713
|
),
|
|
2717
|
-
supportedLanguages.length > 0 && /* @__PURE__ */ jsxs2(View3, { style:
|
|
2714
|
+
supportedLanguages.length > 0 && /* @__PURE__ */ jsxs2(View3, { style: styles3.languageSelectorContainer, children: [
|
|
2718
2715
|
/* @__PURE__ */ jsxs2(
|
|
2719
2716
|
TouchableOpacity3,
|
|
2720
2717
|
{
|
|
2721
2718
|
style: [
|
|
2722
|
-
|
|
2723
|
-
((
|
|
2719
|
+
styles3.topRight,
|
|
2720
|
+
((_v = settings == null ? void 0 : settings.button) == null ? void 0 : _v.language) ? { backgroundColor: settings.button.language.backgroundColor, borderColor: settings.button.language.backgroundColor } : null
|
|
2724
2721
|
],
|
|
2725
2722
|
onPress: () => setIsLanguageDropdownOpen((v) => !v),
|
|
2726
2723
|
accessibilityLabel: `Select language. Current: ${selectedLanguage}`,
|
|
2727
2724
|
children: [
|
|
2728
|
-
/* @__PURE__ */
|
|
2729
|
-
/* @__PURE__ */
|
|
2725
|
+
/* @__PURE__ */ jsx4(Text3, { style: [styles3.topRightText, ((_w = settings == null ? void 0 : settings.button) == null ? void 0 : _w.language) ? { color: settings.button.language.textColor } : null], children: selectedLanguage }),
|
|
2726
|
+
/* @__PURE__ */ jsx4(Svg3, { width: 12, height: 12, viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsx4(
|
|
2730
2727
|
Path3,
|
|
2731
2728
|
{
|
|
2732
2729
|
d: "M4 6L8 10L12 6",
|
|
2733
|
-
stroke: ((
|
|
2730
|
+
stroke: ((_y = (_x = settings == null ? void 0 : settings.button) == null ? void 0 : _x.language) == null ? void 0 : _y.textColor) || "#344054",
|
|
2734
2731
|
strokeWidth: 2,
|
|
2735
2732
|
strokeLinecap: "round",
|
|
2736
2733
|
strokeLinejoin: "round"
|
|
@@ -2739,23 +2736,23 @@ var RedactoNoticeConsent = ({
|
|
|
2739
2736
|
]
|
|
2740
2737
|
}
|
|
2741
2738
|
),
|
|
2742
|
-
isLanguageDropdownOpen && /* @__PURE__ */
|
|
2739
|
+
isLanguageDropdownOpen && /* @__PURE__ */ jsx4(View3, { style: styles3.languageDropdown, children: /* @__PURE__ */ jsx4(ScrollView, { children: supportedLanguages.map((lang) => /* @__PURE__ */ jsx4(
|
|
2743
2740
|
TouchableOpacity3,
|
|
2744
2741
|
{
|
|
2745
2742
|
style: [
|
|
2746
|
-
|
|
2747
|
-
lang === selectedLanguage ?
|
|
2743
|
+
styles3.languageItem,
|
|
2744
|
+
lang === selectedLanguage ? styles3.selectedLanguageItem : null
|
|
2748
2745
|
],
|
|
2749
2746
|
onPress: () => {
|
|
2750
2747
|
setSelectedLanguage(lang);
|
|
2751
2748
|
setIsLanguageDropdownOpen(false);
|
|
2752
2749
|
},
|
|
2753
|
-
children: /* @__PURE__ */
|
|
2754
|
-
|
|
2750
|
+
children: /* @__PURE__ */ jsx4(
|
|
2751
|
+
Text3,
|
|
2755
2752
|
{
|
|
2756
2753
|
style: [
|
|
2757
|
-
|
|
2758
|
-
lang === selectedLanguage ?
|
|
2754
|
+
styles3.languageItemText,
|
|
2755
|
+
lang === selectedLanguage ? styles3.selectedLanguageItemText : null
|
|
2759
2756
|
],
|
|
2760
2757
|
children: lang
|
|
2761
2758
|
}
|
|
@@ -2766,38 +2763,38 @@ var RedactoNoticeConsent = ({
|
|
|
2766
2763
|
] })
|
|
2767
2764
|
] })
|
|
2768
2765
|
] }),
|
|
2769
|
-
/* @__PURE__ */ jsxs2(ScrollView, { style:
|
|
2770
|
-
translatedNoticeText ? /* @__PURE__ */
|
|
2771
|
-
|
|
2766
|
+
/* @__PURE__ */ jsxs2(ScrollView, { style: styles3.middleSection, showsVerticalScrollIndicator: false, children: [
|
|
2767
|
+
translatedNoticeText ? /* @__PURE__ */ jsx4(
|
|
2768
|
+
Text3,
|
|
2772
2769
|
{
|
|
2773
2770
|
style: [
|
|
2774
|
-
|
|
2771
|
+
styles3.privacyText,
|
|
2775
2772
|
{ color: textColor },
|
|
2776
|
-
activeTTSSegmentKey === "notice_text" ?
|
|
2773
|
+
activeTTSSegmentKey === "notice_text" ? styles3.ttsHighlight : null
|
|
2777
2774
|
],
|
|
2778
2775
|
children: translatedNoticeText
|
|
2779
2776
|
}
|
|
2780
2777
|
) : null,
|
|
2781
2778
|
(activeConfig == null ? void 0 : activeConfig.privacy_policy_url) ? /* @__PURE__ */ jsxs2(
|
|
2782
|
-
|
|
2779
|
+
Text3,
|
|
2783
2780
|
{
|
|
2784
2781
|
style: [
|
|
2785
|
-
|
|
2782
|
+
styles3.privacyText,
|
|
2786
2783
|
{ marginTop: 8 },
|
|
2787
2784
|
{ color: textColor }
|
|
2788
2785
|
],
|
|
2789
2786
|
children: [
|
|
2790
|
-
/* @__PURE__ */ jsxs2(
|
|
2787
|
+
/* @__PURE__ */ jsxs2(Text3, { style: activeTTSSegmentKey === "privacy_policy_prefix_text" ? styles3.ttsHighlight : null, children: [
|
|
2791
2788
|
getTranslatedText("privacy_policy_prefix_text", activeConfig.privacy_policy_prefix_text || ""),
|
|
2792
2789
|
" "
|
|
2793
2790
|
] }),
|
|
2794
|
-
/* @__PURE__ */
|
|
2795
|
-
|
|
2791
|
+
/* @__PURE__ */ jsx4(
|
|
2792
|
+
Text3,
|
|
2796
2793
|
{
|
|
2797
2794
|
style: [
|
|
2798
|
-
|
|
2795
|
+
styles3.link,
|
|
2799
2796
|
{ color: linkColor },
|
|
2800
|
-
activeTTSSegmentKey === "privacy_policy_anchor_text" ?
|
|
2797
|
+
activeTTSSegmentKey === "privacy_policy_anchor_text" ? styles3.ttsHighlight : null
|
|
2801
2798
|
],
|
|
2802
2799
|
onPress: () => Linking.openURL(activeConfig.privacy_policy_url),
|
|
2803
2800
|
children: getTranslatedText("privacy_policy_anchor_text", activeConfig.privacy_policy_anchor_text || "Privacy Policy")
|
|
@@ -2806,23 +2803,23 @@ var RedactoNoticeConsent = ({
|
|
|
2806
2803
|
]
|
|
2807
2804
|
}
|
|
2808
2805
|
) : null,
|
|
2809
|
-
(activeConfig == null ? void 0 : activeConfig.purposes) && activeConfig.purposes.length > 0 ? /* @__PURE__ */
|
|
2810
|
-
|
|
2806
|
+
(activeConfig == null ? void 0 : activeConfig.purposes) && activeConfig.purposes.length > 0 ? /* @__PURE__ */ jsx4(
|
|
2807
|
+
Text3,
|
|
2811
2808
|
{
|
|
2812
2809
|
style: [
|
|
2813
|
-
|
|
2810
|
+
styles3.subTitle,
|
|
2814
2811
|
{ marginTop: 16, marginBottom: 8 },
|
|
2815
2812
|
{ color: headingColor },
|
|
2816
|
-
activeTTSSegmentKey === "purpose_section_heading" ?
|
|
2813
|
+
activeTTSSegmentKey === "purpose_section_heading" ? styles3.ttsHighlight : null
|
|
2817
2814
|
],
|
|
2818
2815
|
children: getTranslatedText("purpose_section_heading", activeConfig.purpose_section_heading || "Data Purposes")
|
|
2819
2816
|
}
|
|
2820
2817
|
) : null,
|
|
2821
|
-
/* @__PURE__ */
|
|
2818
|
+
/* @__PURE__ */ jsx4(View3, { style: styles3.optionsContainer, children: activeConfig == null ? void 0 : activeConfig.purposes.map((purpose) => {
|
|
2822
2819
|
var _a2;
|
|
2823
2820
|
const purposeSelection = (_a2 = content == null ? void 0 : content.detail.purpose_selections) == null ? void 0 : _a2[purpose.uuid];
|
|
2824
2821
|
const isAlreadyConsented = !isReconsentMode && ((purposeSelection == null ? void 0 : purposeSelection.selected) || false) && !(purposeSelection == null ? void 0 : purposeSelection.needs_reconsent);
|
|
2825
|
-
return /* @__PURE__ */
|
|
2822
|
+
return /* @__PURE__ */ jsx4(
|
|
2826
2823
|
PurposeItem,
|
|
2827
2824
|
{
|
|
2828
2825
|
purpose,
|
|
@@ -2855,19 +2852,19 @@ var RedactoNoticeConsent = ({
|
|
|
2855
2852
|
}
|
|
2856
2853
|
return fallback;
|
|
2857
2854
|
};
|
|
2858
|
-
return /* @__PURE__ */
|
|
2859
|
-
translatedAdditionalText ? /* @__PURE__ */ jsxs2(
|
|
2855
|
+
return /* @__PURE__ */ jsx4(View3, { style: { marginTop: 8, paddingTop: 8, borderTopWidth: 1, borderTopColor: "rgba(152, 162, 179, 0.3)", opacity: 0.6 }, children: /* @__PURE__ */ jsxs2(Text3, { style: [styles3.privacyText, { fontSize: 14, color: dpoTextColor }], children: [
|
|
2856
|
+
translatedAdditionalText ? /* @__PURE__ */ jsxs2(Text3, { style: activeTTSSegmentKey === "additional_text" ? styles3.ttsHighlight : null, children: [
|
|
2860
2857
|
translatedAdditionalText,
|
|
2861
2858
|
" "
|
|
2862
2859
|
] }) : null,
|
|
2863
2860
|
(activeConfig == null ? void 0 : activeConfig.privacy_center_url) ? /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
2864
|
-
/* @__PURE__ */
|
|
2865
|
-
|
|
2861
|
+
/* @__PURE__ */ jsx4(
|
|
2862
|
+
Text3,
|
|
2866
2863
|
{
|
|
2867
2864
|
style: [
|
|
2868
|
-
|
|
2865
|
+
styles3.link,
|
|
2869
2866
|
{ color: linkColor },
|
|
2870
|
-
activeTTSSegmentKey === "privacy_center_anchor_text" ?
|
|
2867
|
+
activeTTSSegmentKey === "privacy_center_anchor_text" ? styles3.ttsHighlight : null
|
|
2871
2868
|
],
|
|
2872
2869
|
onPress: () => Linking.openURL(activeConfig.privacy_center_url),
|
|
2873
2870
|
children: getTranslatedText("privacy_center_anchor_text", activeConfig.privacy_center_anchor_text || "Privacy Center")
|
|
@@ -2876,17 +2873,17 @@ var RedactoNoticeConsent = ({
|
|
|
2876
2873
|
".\n"
|
|
2877
2874
|
] }) : null,
|
|
2878
2875
|
(dpo == null ? void 0 : dpo.grievance_text) ? /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
2879
|
-
/* @__PURE__ */ jsxs2(
|
|
2876
|
+
/* @__PURE__ */ jsxs2(Text3, { style: activeTTSSegmentKey === "dpo-grievance-text" ? styles3.ttsHighlight : null, children: [
|
|
2880
2877
|
getT("grievance_text", dpo.grievance_text),
|
|
2881
2878
|
" "
|
|
2882
2879
|
] }),
|
|
2883
|
-
/* @__PURE__ */
|
|
2884
|
-
|
|
2880
|
+
/* @__PURE__ */ jsx4(
|
|
2881
|
+
Text3,
|
|
2885
2882
|
{
|
|
2886
2883
|
style: [
|
|
2887
|
-
|
|
2884
|
+
styles3.link,
|
|
2888
2885
|
{ color: linkColor },
|
|
2889
|
-
activeTTSSegmentKey === "dpo-grievance-link" ?
|
|
2886
|
+
activeTTSSegmentKey === "dpo-grievance-link" ? styles3.ttsHighlight : null
|
|
2890
2887
|
],
|
|
2891
2888
|
onPress: () => Linking.openURL(dpo.grievance_url),
|
|
2892
2889
|
children: getT("grievance_anchor_text", dpo.grievance_anchor_text)
|
|
@@ -2894,15 +2891,15 @@ var RedactoNoticeConsent = ({
|
|
|
2894
2891
|
),
|
|
2895
2892
|
dpo.grievance_email ? /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
2896
2893
|
" ",
|
|
2897
|
-
/* @__PURE__ */
|
|
2894
|
+
/* @__PURE__ */ jsx4(Text3, { style: activeTTSSegmentKey === "dpo-grievance-email-connector" ? styles3.ttsHighlight : null, children: getT("grievance_email_connector_text", dpo.grievance_email_connector_text || "or email to") }),
|
|
2898
2895
|
" ",
|
|
2899
|
-
/* @__PURE__ */
|
|
2900
|
-
|
|
2896
|
+
/* @__PURE__ */ jsx4(
|
|
2897
|
+
Text3,
|
|
2901
2898
|
{
|
|
2902
2899
|
style: [
|
|
2903
|
-
|
|
2900
|
+
styles3.link,
|
|
2904
2901
|
{ color: linkColor },
|
|
2905
|
-
activeTTSSegmentKey === "dpo-grievance-email" ?
|
|
2902
|
+
activeTTSSegmentKey === "dpo-grievance-email" ? styles3.ttsHighlight : null
|
|
2906
2903
|
],
|
|
2907
2904
|
onPress: () => Linking.openURL(`mailto:${dpo.grievance_email}`),
|
|
2908
2905
|
children: dpo.grievance_email
|
|
@@ -2912,17 +2909,17 @@ var RedactoNoticeConsent = ({
|
|
|
2912
2909
|
"\n"
|
|
2913
2910
|
] }) : null,
|
|
2914
2911
|
(dpo == null ? void 0 : dpo.dp_board_text) ? /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
2915
|
-
/* @__PURE__ */ jsxs2(
|
|
2912
|
+
/* @__PURE__ */ jsxs2(Text3, { style: activeTTSSegmentKey === "dpo-dp-board-text" ? styles3.ttsHighlight : null, children: [
|
|
2916
2913
|
getT("dp_board_text", dpo.dp_board_text),
|
|
2917
2914
|
" "
|
|
2918
2915
|
] }),
|
|
2919
|
-
/* @__PURE__ */
|
|
2920
|
-
|
|
2916
|
+
/* @__PURE__ */ jsx4(
|
|
2917
|
+
Text3,
|
|
2921
2918
|
{
|
|
2922
2919
|
style: [
|
|
2923
|
-
|
|
2920
|
+
styles3.link,
|
|
2924
2921
|
{ color: linkColor },
|
|
2925
|
-
activeTTSSegmentKey === "dpo-dp-board-link" ?
|
|
2922
|
+
activeTTSSegmentKey === "dpo-dp-board-link" ? styles3.ttsHighlight : null
|
|
2926
2923
|
],
|
|
2927
2924
|
onPress: () => Linking.openURL(dpo.dp_board_url),
|
|
2928
2925
|
children: getT("dp_board_anchor_text", dpo.dp_board_anchor_text)
|
|
@@ -2931,17 +2928,17 @@ var RedactoNoticeConsent = ({
|
|
|
2931
2928
|
"\n"
|
|
2932
2929
|
] }) : null,
|
|
2933
2930
|
(dpo == null ? void 0 : dpo.dpo_text) ? /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
2934
|
-
/* @__PURE__ */ jsxs2(
|
|
2931
|
+
/* @__PURE__ */ jsxs2(Text3, { style: activeTTSSegmentKey === "dpo-dpo-text" ? styles3.ttsHighlight : null, children: [
|
|
2935
2932
|
getT("dpo_text", dpo.dpo_text),
|
|
2936
2933
|
" "
|
|
2937
2934
|
] }),
|
|
2938
|
-
/* @__PURE__ */
|
|
2939
|
-
|
|
2935
|
+
/* @__PURE__ */ jsx4(
|
|
2936
|
+
Text3,
|
|
2940
2937
|
{
|
|
2941
2938
|
style: [
|
|
2942
|
-
|
|
2939
|
+
styles3.link,
|
|
2943
2940
|
{ color: linkColor },
|
|
2944
|
-
activeTTSSegmentKey === "dpo-dpo-link" ?
|
|
2941
|
+
activeTTSSegmentKey === "dpo-dpo-link" ? styles3.ttsHighlight : null
|
|
2945
2942
|
],
|
|
2946
2943
|
onPress: () => Linking.openURL(dpo.dpo_url),
|
|
2947
2944
|
children: getT("dpo_anchor_text", dpo.dpo_anchor_text)
|
|
@@ -2951,62 +2948,114 @@ var RedactoNoticeConsent = ({
|
|
|
2951
2948
|
] }) });
|
|
2952
2949
|
})() : null
|
|
2953
2950
|
] }),
|
|
2954
|
-
/* @__PURE__ */
|
|
2955
|
-
|
|
2951
|
+
/* @__PURE__ */ jsx4(
|
|
2952
|
+
View3,
|
|
2956
2953
|
{
|
|
2957
|
-
style:
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2954
|
+
style: isReviewMode ? styles3.bottomSection : isMobile ? styles3.actionButtonStack : styles3.actionButtonRow,
|
|
2955
|
+
children: isReviewMode ? /* @__PURE__ */ jsx4(
|
|
2956
|
+
TouchableOpacity3,
|
|
2957
|
+
{
|
|
2958
|
+
style: [styles3.button, styles3.acceptButton, acceptButtonStyle],
|
|
2959
|
+
onPress: () => setIsReviewMode(false),
|
|
2960
|
+
children: /* @__PURE__ */ jsx4(Text3, { style: [styles3.buttonText, styles3.acceptButtonText, acceptButtonTextStyle], children: reviewModeButtonText || "Update Consent" })
|
|
2961
|
+
}
|
|
2962
|
+
) : (
|
|
2963
|
+
/* Rendered in a different order per breakpoint rather than
|
|
2964
|
+
reordered with styles, so focus order follows visual order. */
|
|
2965
|
+
footerButtonOrder.map((slot) => {
|
|
2966
|
+
if (slot === "acceptAll") {
|
|
2967
|
+
return /* @__PURE__ */ jsx4(
|
|
2968
|
+
TouchableOpacity3,
|
|
2969
|
+
{
|
|
2970
|
+
style: [
|
|
2971
|
+
styles3.button,
|
|
2972
|
+
widthStyle,
|
|
2973
|
+
styles3.acceptButton,
|
|
2974
|
+
acceptAllButtonStyle,
|
|
2975
|
+
isSubmitting ? { opacity: 0.5 } : null
|
|
2976
|
+
],
|
|
2977
|
+
onPress: handleAcceptAll,
|
|
2978
|
+
disabled: isSubmitting,
|
|
2979
|
+
accessibilityLabel: acceptAllLabel,
|
|
2980
|
+
children: /* @__PURE__ */ jsx4(
|
|
2981
|
+
Text3,
|
|
2982
|
+
{
|
|
2983
|
+
style: [
|
|
2984
|
+
styles3.buttonText,
|
|
2985
|
+
styles3.acceptButtonText,
|
|
2986
|
+
acceptAllButtonTextStyle,
|
|
2987
|
+
activeTTSSegmentKey === "accept_all_button_text" ? styles3.ttsHighlight : null
|
|
2988
|
+
],
|
|
2989
|
+
children: acceptAllLabel
|
|
2990
|
+
}
|
|
2991
|
+
)
|
|
2992
|
+
},
|
|
2993
|
+
slot
|
|
2994
|
+
);
|
|
2984
2995
|
}
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
2996
|
+
if (slot === "acceptSelected") {
|
|
2997
|
+
return /* @__PURE__ */ jsx4(
|
|
2998
|
+
TouchableOpacity3,
|
|
2999
|
+
{
|
|
3000
|
+
style: [
|
|
3001
|
+
styles3.button,
|
|
3002
|
+
widthStyle,
|
|
3003
|
+
styles3.acceptSecondaryButton,
|
|
3004
|
+
acceptSelectedButtonStyle,
|
|
3005
|
+
isSubmitting || !areAllRequiredElementsChecked ? { opacity: 0.5 } : null
|
|
3006
|
+
],
|
|
3007
|
+
onPress: handleAcceptSelected,
|
|
3008
|
+
disabled: isSubmitting || !areAllRequiredElementsChecked,
|
|
3009
|
+
accessibilityLabel: isSubmitting ? "Submitting consent" : acceptSelectedLabel,
|
|
3010
|
+
children: isSubmitting ? /* @__PURE__ */ jsx4(ActivityIndicator2, { size: "small", color: accentColor }) : /* @__PURE__ */ jsx4(
|
|
3011
|
+
Text3,
|
|
3012
|
+
{
|
|
3013
|
+
style: [
|
|
3014
|
+
styles3.buttonText,
|
|
3015
|
+
styles3.acceptSecondaryButtonText,
|
|
3016
|
+
acceptSelectedButtonTextStyle,
|
|
3017
|
+
activeTTSSegmentKey === "confirm_button_text" ? styles3.ttsHighlight : null
|
|
3018
|
+
],
|
|
3019
|
+
children: acceptSelectedLabel
|
|
3020
|
+
}
|
|
3021
|
+
)
|
|
3022
|
+
},
|
|
3023
|
+
slot
|
|
3024
|
+
);
|
|
3005
3025
|
}
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3026
|
+
return /* @__PURE__ */ jsx4(
|
|
3027
|
+
TouchableOpacity3,
|
|
3028
|
+
{
|
|
3029
|
+
style: [
|
|
3030
|
+
styles3.button,
|
|
3031
|
+
widthStyle,
|
|
3032
|
+
styles3.cancelButton,
|
|
3033
|
+
declineButtonStyle,
|
|
3034
|
+
isMobile ? null : styles3.declineSpacer,
|
|
3035
|
+
isSubmitting ? { opacity: 0.5 } : null
|
|
3036
|
+
],
|
|
3037
|
+
onPress: handleDecline,
|
|
3038
|
+
disabled: isSubmitting,
|
|
3039
|
+
accessibilityLabel: declineLabel,
|
|
3040
|
+
children: /* @__PURE__ */ jsx4(
|
|
3041
|
+
Text3,
|
|
3042
|
+
{
|
|
3043
|
+
style: [
|
|
3044
|
+
styles3.buttonText,
|
|
3045
|
+
styles3.cancelButtonText,
|
|
3046
|
+
declineButtonTextStyle,
|
|
3047
|
+
activeTTSSegmentKey === "decline_button_text" ? styles3.ttsHighlight : null
|
|
3048
|
+
],
|
|
3049
|
+
children: declineLabel
|
|
3050
|
+
}
|
|
3051
|
+
)
|
|
3052
|
+
},
|
|
3053
|
+
slot
|
|
3054
|
+
);
|
|
3055
|
+
})
|
|
3056
|
+
)
|
|
3057
|
+
}
|
|
3058
|
+
)
|
|
3010
3059
|
] })
|
|
3011
3060
|
}
|
|
3012
3061
|
)
|
|
@@ -3027,7 +3076,7 @@ import {
|
|
|
3027
3076
|
import {
|
|
3028
3077
|
ActivityIndicator as ActivityIndicator3,
|
|
3029
3078
|
ScrollView as ScrollView2,
|
|
3030
|
-
Text as
|
|
3079
|
+
Text as Text4,
|
|
3031
3080
|
TouchableOpacity as TouchableOpacity4,
|
|
3032
3081
|
View as View4
|
|
3033
3082
|
} from "react-native";
|
|
@@ -3155,9 +3204,49 @@ var submitConsentEvent2 = async ({
|
|
|
3155
3204
|
}
|
|
3156
3205
|
};
|
|
3157
3206
|
|
|
3207
|
+
// src/shared/notice-consent-status.ts
|
|
3208
|
+
var fetchNoticeConsentStatusForScope = async ({
|
|
3209
|
+
accessToken,
|
|
3210
|
+
ledgerBaseUrl,
|
|
3211
|
+
organisationUuid,
|
|
3212
|
+
workspaceUuid,
|
|
3213
|
+
noticeUuid,
|
|
3214
|
+
signal
|
|
3215
|
+
}) => {
|
|
3216
|
+
if (!accessToken || !ledgerBaseUrl || !organisationUuid || !workspaceUuid || !noticeUuid) {
|
|
3217
|
+
return null;
|
|
3218
|
+
}
|
|
3219
|
+
try {
|
|
3220
|
+
const response = await fetch(
|
|
3221
|
+
`${ledgerBaseUrl}/public/organisations/${organisationUuid}/workspaces/${workspaceUuid}/notices/${noticeUuid}/check-consent`,
|
|
3222
|
+
{
|
|
3223
|
+
method: "POST",
|
|
3224
|
+
headers: {
|
|
3225
|
+
Authorization: `Bearer ${accessToken}`,
|
|
3226
|
+
"Content-Type": "application/json"
|
|
3227
|
+
},
|
|
3228
|
+
body: "{}",
|
|
3229
|
+
signal
|
|
3230
|
+
}
|
|
3231
|
+
);
|
|
3232
|
+
if (!response.ok) {
|
|
3233
|
+
return null;
|
|
3234
|
+
}
|
|
3235
|
+
const data = await response.json();
|
|
3236
|
+
const body = data && typeof data === "object" && "detail" in data && data.detail ? data.detail : data;
|
|
3237
|
+
if (!body || !Array.isArray(body.purposes)) {
|
|
3238
|
+
return null;
|
|
3239
|
+
}
|
|
3240
|
+
return body;
|
|
3241
|
+
} catch {
|
|
3242
|
+
return null;
|
|
3243
|
+
}
|
|
3244
|
+
};
|
|
3245
|
+
var isNoticeFullyConsented = (status) => status.consented && status.all_mandatory_active;
|
|
3246
|
+
|
|
3158
3247
|
// src/RedactoNoticeConsentInline/styles.ts
|
|
3159
|
-
import { StyleSheet as
|
|
3160
|
-
var
|
|
3248
|
+
import { StyleSheet as StyleSheet6, Platform as Platform2 } from "react-native";
|
|
3249
|
+
var styles4 = StyleSheet6.create({
|
|
3161
3250
|
container: {
|
|
3162
3251
|
width: "100%",
|
|
3163
3252
|
borderRadius: 8,
|
|
@@ -3357,9 +3446,6 @@ var styles3 = StyleSheet5.create({
|
|
|
3357
3446
|
color: "#DC2626",
|
|
3358
3447
|
fontSize: 14
|
|
3359
3448
|
},
|
|
3360
|
-
requiredAsterisk: {
|
|
3361
|
-
color: "red"
|
|
3362
|
-
},
|
|
3363
3449
|
purposeChevron: {
|
|
3364
3450
|
marginLeft: 5,
|
|
3365
3451
|
alignItems: "center",
|
|
@@ -3411,7 +3497,7 @@ var styles3 = StyleSheet5.create({
|
|
|
3411
3497
|
});
|
|
3412
3498
|
|
|
3413
3499
|
// src/RedactoNoticeConsentInline/RedactoNoticeConsentInline.tsx
|
|
3414
|
-
import { jsx as
|
|
3500
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
3415
3501
|
var RedactoConsentInlineComponent = ({
|
|
3416
3502
|
org_uuid,
|
|
3417
3503
|
workspace_uuid,
|
|
@@ -3722,28 +3808,28 @@ var RedactoConsentInlineComponent = ({
|
|
|
3722
3808
|
);
|
|
3723
3809
|
if (hasAlreadyConsented || fetchError) return null;
|
|
3724
3810
|
if (isLoading) {
|
|
3725
|
-
return /* @__PURE__ */ jsxs3(View4, { style:
|
|
3726
|
-
/* @__PURE__ */
|
|
3727
|
-
/* @__PURE__ */
|
|
3811
|
+
return /* @__PURE__ */ jsxs3(View4, { style: styles4.loadingContainer, children: [
|
|
3812
|
+
/* @__PURE__ */ jsx5(ActivityIndicator3, { size: "large", color: "#4f87ff" }),
|
|
3813
|
+
/* @__PURE__ */ jsx5(Text4, { style: [styles4.loadingText, { color: textColor }], children: "Loading..." })
|
|
3728
3814
|
] });
|
|
3729
3815
|
}
|
|
3730
3816
|
if (!content) return null;
|
|
3731
3817
|
return /* @__PURE__ */ jsxs3(View4, { style: { gap: 16 }, children: [
|
|
3732
|
-
errorMessage ? /* @__PURE__ */
|
|
3733
|
-
supportedLanguages.length > 0 && /* @__PURE__ */ jsxs3(View4, { style: [
|
|
3734
|
-
/* @__PURE__ */
|
|
3735
|
-
/* @__PURE__ */ jsxs3(View4, { style:
|
|
3818
|
+
errorMessage ? /* @__PURE__ */ jsx5(View4, { style: styles4.errorContainer, children: /* @__PURE__ */ jsx5(Text4, { style: styles4.errorText, children: errorMessage }) }) : null,
|
|
3819
|
+
supportedLanguages.length > 0 && /* @__PURE__ */ jsxs3(View4, { style: [styles4.topSection, { borderBottomWidth: 0, paddingBottom: 0 }], children: [
|
|
3820
|
+
/* @__PURE__ */ jsx5(View4, {}),
|
|
3821
|
+
/* @__PURE__ */ jsxs3(View4, { style: styles4.languageSelectorContainer, children: [
|
|
3736
3822
|
/* @__PURE__ */ jsxs3(
|
|
3737
3823
|
TouchableOpacity4,
|
|
3738
3824
|
{
|
|
3739
3825
|
style: [
|
|
3740
|
-
|
|
3826
|
+
styles4.topRight,
|
|
3741
3827
|
((_a = settings == null ? void 0 : settings.button) == null ? void 0 : _a.language) ? { backgroundColor: settings.button.language.backgroundColor, borderColor: settings.button.language.backgroundColor } : null
|
|
3742
3828
|
],
|
|
3743
3829
|
onPress: () => setIsLanguageDropdownOpen((v) => !v),
|
|
3744
3830
|
children: [
|
|
3745
|
-
/* @__PURE__ */
|
|
3746
|
-
/* @__PURE__ */
|
|
3831
|
+
/* @__PURE__ */ jsx5(Text4, { style: [styles4.topRightText, ((_b = settings == null ? void 0 : settings.button) == null ? void 0 : _b.language) ? { color: settings.button.language.textColor } : null], children: selectedLanguage }),
|
|
3832
|
+
/* @__PURE__ */ jsx5(Svg4, { width: 12, height: 12, viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsx5(
|
|
3747
3833
|
Path4,
|
|
3748
3834
|
{
|
|
3749
3835
|
d: "M4 6L8 10L12 6",
|
|
@@ -3756,34 +3842,34 @@ var RedactoConsentInlineComponent = ({
|
|
|
3756
3842
|
]
|
|
3757
3843
|
}
|
|
3758
3844
|
),
|
|
3759
|
-
isLanguageDropdownOpen && /* @__PURE__ */
|
|
3845
|
+
isLanguageDropdownOpen && /* @__PURE__ */ jsx5(View4, { style: styles4.languageDropdown, children: /* @__PURE__ */ jsx5(ScrollView2, { children: supportedLanguages.map((lang) => /* @__PURE__ */ jsx5(
|
|
3760
3846
|
TouchableOpacity4,
|
|
3761
3847
|
{
|
|
3762
3848
|
style: [
|
|
3763
|
-
|
|
3764
|
-
lang === selectedLanguage ?
|
|
3849
|
+
styles4.languageItem,
|
|
3850
|
+
lang === selectedLanguage ? styles4.selectedLanguageItem : null
|
|
3765
3851
|
],
|
|
3766
3852
|
onPress: () => {
|
|
3767
3853
|
setSelectedLanguage(lang);
|
|
3768
3854
|
setIsLanguageDropdownOpen(false);
|
|
3769
3855
|
},
|
|
3770
|
-
children: /* @__PURE__ */
|
|
3856
|
+
children: /* @__PURE__ */ jsx5(Text4, { style: [styles4.languageItemText, lang === selectedLanguage ? styles4.selectedLanguageItemText : null], children: lang })
|
|
3771
3857
|
},
|
|
3772
3858
|
lang
|
|
3773
3859
|
)) }) })
|
|
3774
3860
|
] })
|
|
3775
3861
|
] }),
|
|
3776
3862
|
content.purposes.map((purpose) => /* @__PURE__ */ jsxs3(View4, { children: [
|
|
3777
|
-
/* @__PURE__ */ jsxs3(View4, { style:
|
|
3863
|
+
/* @__PURE__ */ jsxs3(View4, { style: styles4.optionItem, children: [
|
|
3778
3864
|
/* @__PURE__ */ jsxs3(
|
|
3779
3865
|
TouchableOpacity4,
|
|
3780
3866
|
{
|
|
3781
|
-
style:
|
|
3867
|
+
style: styles4.optionLeft,
|
|
3782
3868
|
onPress: () => togglePurposeCollapse(purpose.uuid),
|
|
3783
3869
|
accessibilityRole: "button",
|
|
3784
3870
|
accessibilityLabel: `${collapsedPurposes[purpose.uuid] ? "Expand" : "Collapse"} ${getTranslatedText("purposes.name", purpose.name, purpose.uuid)}`,
|
|
3785
3871
|
children: [
|
|
3786
|
-
/* @__PURE__ */
|
|
3872
|
+
/* @__PURE__ */ jsx5(View4, { style: styles4.purposeChevron, children: /* @__PURE__ */ jsx5(Svg4, { width: 7, height: 12, viewBox: "0 0 7 12", fill: "none", children: /* @__PURE__ */ jsx5(
|
|
3787
3873
|
Path4,
|
|
3788
3874
|
{
|
|
3789
3875
|
d: "M1 1L6 6L1 11",
|
|
@@ -3794,14 +3880,17 @@ var RedactoConsentInlineComponent = ({
|
|
|
3794
3880
|
transform: !collapsedPurposes[purpose.uuid] ? "rotate(90 3.5 6)" : void 0
|
|
3795
3881
|
}
|
|
3796
3882
|
) }) }),
|
|
3797
|
-
/* @__PURE__ */ jsxs3(View4, { style:
|
|
3798
|
-
/* @__PURE__ */
|
|
3799
|
-
|
|
3883
|
+
/* @__PURE__ */ jsxs3(View4, { style: styles4.optionTextContainer, children: [
|
|
3884
|
+
/* @__PURE__ */ jsxs3(Text4, { style: [styles4.optionTitle, { color: headingColor }, isMobile ? { fontSize: 14 } : null], children: [
|
|
3885
|
+
getTranslatedText("purposes.name", purpose.name, purpose.uuid),
|
|
3886
|
+
hasRequiredDataElement(purpose) && /* @__PURE__ */ jsx5(RequiredMarker, {})
|
|
3887
|
+
] }),
|
|
3888
|
+
/* @__PURE__ */ jsx5(Text4, { style: [styles4.optionDescription, { color: textColor }, isMobile ? { fontSize: 11 } : null], children: getTranslatedText("purposes.description", purpose.description, purpose.uuid) })
|
|
3800
3889
|
] })
|
|
3801
3890
|
]
|
|
3802
3891
|
}
|
|
3803
3892
|
),
|
|
3804
|
-
/* @__PURE__ */
|
|
3893
|
+
/* @__PURE__ */ jsx5(
|
|
3805
3894
|
Checkbox,
|
|
3806
3895
|
{
|
|
3807
3896
|
checked: selectedPurposes[purpose.uuid] || false,
|
|
@@ -3812,12 +3901,12 @@ var RedactoConsentInlineComponent = ({
|
|
|
3812
3901
|
}
|
|
3813
3902
|
)
|
|
3814
3903
|
] }),
|
|
3815
|
-
!collapsedPurposes[purpose.uuid] && purpose.data_elements && purpose.data_elements.length > 0 && /* @__PURE__ */
|
|
3816
|
-
/* @__PURE__ */ jsxs3(
|
|
3904
|
+
!collapsedPurposes[purpose.uuid] && purpose.data_elements && purpose.data_elements.length > 0 && /* @__PURE__ */ jsx5(View4, { style: styles4.dataElementsContainer, children: purpose.data_elements.map((dataElement) => /* @__PURE__ */ jsxs3(View4, { style: styles4.dataElementItem, children: [
|
|
3905
|
+
/* @__PURE__ */ jsxs3(Text4, { style: [styles4.dataElementText, { color: textColor }, isMobile ? { fontSize: 12 } : null], children: [
|
|
3817
3906
|
getTranslatedText("data_elements.name", dataElement.name, dataElement.uuid),
|
|
3818
|
-
dataElement.required && /* @__PURE__ */
|
|
3907
|
+
dataElement.required && /* @__PURE__ */ jsx5(RequiredMarker, {})
|
|
3819
3908
|
] }),
|
|
3820
|
-
/* @__PURE__ */
|
|
3909
|
+
/* @__PURE__ */ jsx5(
|
|
3821
3910
|
Checkbox,
|
|
3822
3911
|
{
|
|
3823
3912
|
checked: selectedDataElements[`${purpose.uuid}-${dataElement.uuid}`] || false,
|