@tantainnovative/ndpr-toolkit 3.2.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -1
- package/dist/{DPIAQuestionnaire-BkejviPj.d.mts → DPIAQuestionnaire-VXBoWFMC.d.ts} +3 -3
- package/dist/{DPIAQuestionnaire-DdSqXG3x.d.ts → DPIAQuestionnaire-jkt1Veb6.d.mts} +3 -3
- package/dist/{DSRRequestForm-BY8PogCU.d.mts → DSRRequestForm-D8rPTNmU.d.ts} +2 -2
- package/dist/{DSRRequestForm-CHUg9cZh.d.ts → DSRRequestForm-DRouEr9j.d.mts} +2 -2
- package/dist/{DSRTracker-Dr_aT0pg.d.ts → DSRTracker-Bl__d4df.d.ts} +1 -1
- package/dist/{DSRTracker-C6u_jAaK.d.mts → DSRTracker-CSVDfgQQ.d.mts} +1 -1
- package/dist/{StepIndicator-D9ZATz_O.d.ts → StepIndicator-CgrlokSV.d.ts} +1 -1
- package/dist/{StepIndicator-D-nwRTyo.d.mts → StepIndicator-W8S_QjgO.d.mts} +1 -1
- package/dist/adapters.js +1 -1
- package/dist/adapters.mjs +1 -1
- package/dist/breach.js +1 -1
- package/dist/breach.mjs +1 -1
- package/dist/chunk-256APOQM.js +2 -0
- package/dist/chunk-25OOUES4.js +2 -0
- package/dist/chunk-4JKTIR33.mjs +2 -0
- package/dist/chunk-5BUS6AI7.js +2 -0
- package/dist/chunk-5X32J5IA.mjs +2 -0
- package/dist/chunk-6BXUVS6E.js +81 -0
- package/dist/chunk-6JCRDJQI.mjs +2 -0
- package/dist/{chunk-KHRBU5K7.js → chunk-6RQGQZT2.js} +2 -2
- package/dist/chunk-6TA2MVTU.mjs +2 -0
- package/dist/chunk-6WIP33TW.mjs +2 -0
- package/dist/chunk-6YN73KR7.mjs +2 -0
- package/dist/chunk-75TJPK2N.mjs +2 -0
- package/dist/{chunk-2ORDHJRD.js → chunk-7AVN424U.js} +2 -2
- package/dist/chunk-7D2OIPHH.mjs +2 -0
- package/dist/{chunk-5VMHKNJY.js → chunk-7SMLHZ4B.js} +2 -2
- package/dist/chunk-A4PK7JB2.js +2 -0
- package/dist/chunk-ABDB7LEV.mjs +2 -0
- package/dist/chunk-BKRETVJ6.js +2 -0
- package/dist/chunk-C4YM4UMI.js +2 -0
- package/dist/chunk-CDZDT2OS.mjs +320 -0
- package/dist/chunk-CSIJCLGZ.mjs +2 -0
- package/dist/chunk-CWUPGY3M.mjs +3 -0
- package/dist/chunk-DJGS7SSN.mjs +2 -0
- package/dist/{chunk-SVCRYM4I.mjs → chunk-E4NCJ7RD.mjs} +2 -2
- package/dist/chunk-E63VPR7U.js +2 -0
- package/dist/chunk-ELKB2AFZ.js +2 -0
- package/dist/chunk-FDDI426Y.mjs +2 -0
- package/dist/chunk-GKKAK6ES.mjs +3 -0
- package/dist/chunk-GMLCWGNJ.js +7 -0
- package/dist/{chunk-SWF3YVE5.js → chunk-GOU6FU6Y.js} +3 -3
- package/dist/chunk-GQVNLUP2.js +94 -0
- package/dist/chunk-GXLSOZCH.mjs +2 -0
- package/dist/chunk-HO5M7M4M.js +2 -0
- package/dist/chunk-I4M2AA3N.js +2 -0
- package/dist/chunk-I54CDQGN.js +3 -0
- package/dist/chunk-IQJO7WIH.js +7 -0
- package/dist/chunk-JKKRPS4P.js +2 -0
- package/dist/chunk-LETEUS5X.mjs +2 -0
- package/dist/{chunk-P7BSBCB3.js → chunk-M6XETYNL.js} +2 -2
- package/dist/chunk-NBSVFQ5G.js +2 -0
- package/dist/chunk-NUDVUAD4.mjs +81 -0
- package/dist/chunk-NUULHXVL.mjs +7 -0
- package/dist/chunk-P42Z5CFE.js +2 -0
- package/dist/chunk-PATONNTZ.mjs +2 -0
- package/dist/{chunk-WLSW4Z4W.mjs → chunk-PM7O5IGE.mjs} +2 -2
- package/dist/chunk-Q7VHB64E.mjs +2 -0
- package/dist/chunk-QDHHD2KR.mjs +94 -0
- package/dist/chunk-R3OYAJI6.mjs +2 -0
- package/dist/chunk-S4GRSNB4.js +2 -0
- package/dist/chunk-SAA7UVI2.js +3 -0
- package/dist/{chunk-PYEX7DFR.mjs → chunk-SHMJNRHO.mjs} +3 -3
- package/dist/chunk-TI2M7H6R.mjs +7 -0
- package/dist/chunk-TKVJ3OOV.mjs +2 -0
- package/dist/chunk-TXXWCB5O.js +320 -0
- package/dist/chunk-U62QYKVG.mjs +2 -0
- package/dist/{chunk-44W4H2EY.js → chunk-UGY5ZYUG.js} +2 -2
- package/dist/chunk-UO6QPJLH.js +2 -0
- package/dist/chunk-UX6ZZNEM.mjs +3 -0
- package/dist/{chunk-5RSOLEEP.js → chunk-UXMGBIX6.js} +4 -4
- package/dist/chunk-VLSGE2YA.js +2 -0
- package/dist/{chunk-G26I6MP5.mjs → chunk-VWPGIES4.mjs} +2 -2
- package/dist/chunk-XFUEZ3MP.mjs +2 -0
- package/dist/chunk-XHSHPB74.js +2 -0
- package/dist/chunk-YCX6BFOQ.js +2 -0
- package/dist/chunk-YURSF2YO.mjs +2 -0
- package/dist/chunk-YZXUAIYN.js +3 -0
- package/dist/{chunk-CAB7O3GR.mjs → chunk-ZEOQYWOE.mjs} +4 -4
- package/dist/chunk-ZGJA7OO4.js +2 -0
- package/dist/chunk-ZT7KNFAU.mjs +2 -0
- package/dist/chunk-ZYLDLGFL.js +2 -0
- package/dist/consent.js +1 -1
- package/dist/consent.mjs +1 -1
- package/dist/core.d.mts +21 -9
- package/dist/core.d.ts +21 -9
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/cross-border.d.mts +68 -1
- package/dist/cross-border.d.ts +68 -1
- package/dist/cross-border.js +1 -1
- package/dist/cross-border.mjs +1 -1
- package/dist/{dpia-B0Pok5us.d.ts → dpia-D82hUrJe.d.ts} +1 -1
- package/dist/{dpia-CUfOmzvX.d.mts → dpia-DQDFw2_l.d.mts} +1 -1
- package/dist/{dpia-5OQVA1R_.d.mts → dpia-c9GiiOq0.d.mts} +2 -2
- package/dist/{dpia-5OQVA1R_.d.ts → dpia-c9GiiOq0.d.ts} +2 -2
- package/dist/dpia.d.mts +9 -9
- package/dist/dpia.d.ts +9 -9
- package/dist/dpia.js +1 -1
- package/dist/dpia.mjs +1 -1
- package/dist/{dsr-D_eTNc4S.d.mts → dsr-CIx5sd7e.d.ts} +2 -2
- package/dist/{dsr-pNtVb1BK.d.ts → dsr-XZ_HqTlA.d.mts} +2 -2
- package/dist/{dsr-Cm9lzWG7.d.mts → dsr-yKbqX531.d.mts} +1 -1
- package/dist/{dsr-Cm9lzWG7.d.ts → dsr-yKbqX531.d.ts} +1 -1
- package/dist/dsr.d.mts +9 -9
- package/dist/dsr.d.ts +9 -9
- package/dist/dsr.js +1 -1
- package/dist/dsr.mjs +1 -1
- package/dist/hooks.d.mts +6 -6
- package/dist/hooks.d.ts +6 -6
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/index.d.mts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lawful-basis.js +1 -1
- package/dist/lawful-basis.mjs +1 -1
- package/dist/{policy-engine-DSQpT55_.d.ts → policy-engine-C6nC2t3a.d.ts} +1 -1
- package/dist/{policy-engine-C-tShzZH.d.mts → policy-engine-DefZcX3R.d.mts} +1 -1
- package/dist/{policy-sections-CfNVBLCh.d.mts → policy-sections-Bylm31kZ.d.mts} +1 -1
- package/dist/{policy-sections-DqH0iZRf.d.ts → policy-sections-DFDPVCCg.d.ts} +1 -1
- package/dist/policy.d.mts +4 -4
- package/dist/policy.d.ts +4 -4
- package/dist/policy.js +1 -1
- package/dist/policy.mjs +1 -1
- package/dist/presets.d.mts +5 -5
- package/dist/presets.d.ts +5 -5
- package/dist/presets.js +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/ropa.js +1 -1
- package/dist/ropa.mjs +1 -1
- package/dist/{sanitize-9mOO_cJW.d.mts → sanitize-B0AzEm1D.d.mts} +14 -1
- package/dist/{sanitize-9mOO_cJW.d.ts → sanitize-B0AzEm1D.d.ts} +14 -1
- package/dist/{useAdaptivePolicyWizard-N4eUM4Tj.d.mts → useAdaptivePolicyWizard-A1PyOy6P.d.mts} +1 -1
- package/dist/{useAdaptivePolicyWizard-B9Op2gYM.d.ts → useAdaptivePolicyWizard-LVIKhAxw.d.ts} +1 -1
- package/dist/{useDPIA-DzWye8JB.d.mts → useDPIA-B6180UQn.d.mts} +9 -5
- package/dist/{useDPIA-Dl16Te3r.d.ts → useDPIA-CTqbNbww.d.ts} +9 -5
- package/dist/{useDSR-C1LksCfP.d.mts → useDSR-WvHk8_iu.d.mts} +2 -2
- package/dist/{useDSR-DZel52O1.d.ts → useDSR-wH4H6hSM.d.ts} +2 -2
- package/package.json +3 -2
- package/dist/chunk-27NYSWUG.mjs +0 -2
- package/dist/chunk-2SYNHRP6.mjs +0 -2
- package/dist/chunk-2W7ARAW2.js +0 -2
- package/dist/chunk-3F34NACG.js +0 -2
- package/dist/chunk-3UWT64FI.mjs +0 -2
- package/dist/chunk-3V23O4ZJ.js +0 -2
- package/dist/chunk-3XAUN5IM.mjs +0 -3
- package/dist/chunk-4JUDKBA2.mjs +0 -7
- package/dist/chunk-4VVARDN2.mjs +0 -2
- package/dist/chunk-6D3ZUGBB.mjs +0 -2
- package/dist/chunk-6E54NSAO.mjs +0 -2
- package/dist/chunk-7F5F5YWI.mjs +0 -2
- package/dist/chunk-BGHQTZAC.js +0 -94
- package/dist/chunk-CL53OI3I.js +0 -7
- package/dist/chunk-CMZTI7SG.js +0 -2
- package/dist/chunk-DQLDX5X6.js +0 -316
- package/dist/chunk-ELKEZEV5.mjs +0 -2
- package/dist/chunk-EPF7J2FK.js +0 -3
- package/dist/chunk-ER7X6E36.js +0 -2
- package/dist/chunk-FR7ZYZXB.js +0 -2
- package/dist/chunk-FXTZDKDC.mjs +0 -3
- package/dist/chunk-FY5G6DGZ.js +0 -7
- package/dist/chunk-GIV2OHE6.mjs +0 -2
- package/dist/chunk-GPJVTGHR.mjs +0 -2
- package/dist/chunk-GVANK6PL.js +0 -3
- package/dist/chunk-HNZK7LY3.mjs +0 -2
- package/dist/chunk-IKEPXHCZ.js +0 -2
- package/dist/chunk-IQF726GS.js +0 -2
- package/dist/chunk-IQQW52EF.js +0 -2
- package/dist/chunk-ISSGO2YT.mjs +0 -72
- package/dist/chunk-JZKH5RMC.js +0 -3
- package/dist/chunk-LFNA6WYQ.mjs +0 -2
- package/dist/chunk-NPI5T6NH.mjs +0 -7
- package/dist/chunk-NPLXE43Q.mjs +0 -2
- package/dist/chunk-PEH5GIMN.js +0 -2
- package/dist/chunk-PGSA2O5P.mjs +0 -2
- package/dist/chunk-QKK5S54L.mjs +0 -2
- package/dist/chunk-RGYK4VAY.mjs +0 -2
- package/dist/chunk-RSUDIFZV.mjs +0 -2
- package/dist/chunk-RYZEIDNR.js +0 -2
- package/dist/chunk-SBNAMPAP.mjs +0 -2
- package/dist/chunk-SKJCQKFL.mjs +0 -94
- package/dist/chunk-SSGJREE3.js +0 -2
- package/dist/chunk-TKBZRULW.mjs +0 -316
- package/dist/chunk-TVW6KBVV.mjs +0 -2
- package/dist/chunk-U6VWHC46.js +0 -72
- package/dist/chunk-UK656RCG.js +0 -2
- package/dist/chunk-UNKXYVXY.js +0 -2
- package/dist/chunk-UOSEH6DC.js +0 -2
- package/dist/chunk-UZ5EZOA7.js +0 -2
- package/dist/chunk-V37BM2LF.js +0 -2
- package/dist/chunk-V3MXWGXU.mjs +0 -2
- package/dist/chunk-VDZKGCAF.js +0 -2
- package/dist/chunk-XSK4BSZJ.mjs +0 -2
- package/dist/chunk-Y34DQYS7.js +0 -2
- package/dist/chunk-YJCGEOLO.mjs +0 -2
- package/dist/chunk-ZCZ5RRZO.js +0 -2
- package/dist/chunk-ZQSX5ZHB.mjs +0 -3
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
'use strict';var chunkLU4PFST7_js=require('./chunk-LU4PFST7.js'),chunkELKB2AFZ_js=require('./chunk-ELKB2AFZ.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function M(r){return r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function ce(r){return r.toLowerCase().replace(/[^a-z0-9\s-]/g,"").trim().replace(/\s+/g,"-")}function Le(r){let u=r.split(`
|
|
2
|
+
`),v=[],e=false;for(let a of u){let s=a.trimEnd();s.startsWith("- ")||s.startsWith("\u2022 ")?(e||(v.push("<ul>"),e=true),v.push(` <li>${M(s.replace(/^[-•]\s*/,""))}</li>`)):(e&&(v.push("</ul>"),e=false),s.trim()===""||v.push(`<p>${M(s)}</p>`));}return e&&v.push("</ul>"),v.join(`
|
|
3
|
+
`)}var Ne=`
|
|
4
|
+
/* \u2500\u2500 Reset & Base \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
5
|
+
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
|
6
|
+
|
|
7
|
+
/* \u2500\u2500 Design tokens \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
8
|
+
:root {
|
|
9
|
+
--color-bg: #ffffff;
|
|
10
|
+
--color-surface: #f9fafb;
|
|
11
|
+
--color-border: #e5e7eb;
|
|
12
|
+
--color-text: #111827;
|
|
13
|
+
--color-text-muted: #6b7280;
|
|
14
|
+
--color-accent: #16a34a;
|
|
15
|
+
--color-accent-light: #dcfce7;
|
|
16
|
+
--color-heading: #064e3b;
|
|
17
|
+
--color-link: #15803d;
|
|
18
|
+
--color-link-hover: #166534;
|
|
19
|
+
--font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
20
|
+
--font-mono: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, monospace;
|
|
21
|
+
--radius: 8px;
|
|
22
|
+
--shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
|
|
23
|
+
--max-width: 860px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@media (prefers-color-scheme: dark) {
|
|
27
|
+
:root {
|
|
28
|
+
--color-bg: #0f172a;
|
|
29
|
+
--color-surface: #1e293b;
|
|
30
|
+
--color-border: #334155;
|
|
31
|
+
--color-text: #f1f5f9;
|
|
32
|
+
--color-text-muted: #94a3b8;
|
|
33
|
+
--color-accent: #22c55e;
|
|
34
|
+
--color-accent-light: #14532d;
|
|
35
|
+
--color-heading: #86efac;
|
|
36
|
+
--color-link: #4ade80;
|
|
37
|
+
--color-link-hover: #86efac;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* \u2500\u2500 Layout \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
42
|
+
html { font-size: 16px; scroll-behavior: smooth; }
|
|
43
|
+
|
|
44
|
+
body {
|
|
45
|
+
font-family: var(--font-sans);
|
|
46
|
+
background: var(--color-bg);
|
|
47
|
+
color: var(--color-text);
|
|
48
|
+
line-height: 1.7;
|
|
49
|
+
padding: 2rem 1.25rem;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.policy-wrapper {
|
|
53
|
+
max-width: var(--max-width);
|
|
54
|
+
margin: 0 auto;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* \u2500\u2500 Header \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
58
|
+
.policy-header {
|
|
59
|
+
background: var(--color-surface);
|
|
60
|
+
border: 1px solid var(--color-border);
|
|
61
|
+
border-radius: var(--radius);
|
|
62
|
+
padding: 2.5rem 2.5rem 2rem;
|
|
63
|
+
margin-bottom: 2rem;
|
|
64
|
+
box-shadow: var(--shadow);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.policy-header h1 {
|
|
68
|
+
font-size: 2rem;
|
|
69
|
+
font-weight: 700;
|
|
70
|
+
color: var(--color-heading);
|
|
71
|
+
line-height: 1.2;
|
|
72
|
+
margin-bottom: 0.75rem;
|
|
73
|
+
letter-spacing: -0.025em;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.policy-meta {
|
|
77
|
+
display: flex;
|
|
78
|
+
flex-wrap: wrap;
|
|
79
|
+
gap: 0.5rem 1.5rem;
|
|
80
|
+
font-size: 0.875rem;
|
|
81
|
+
color: var(--color-text-muted);
|
|
82
|
+
margin-top: 0.5rem;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.policy-meta span { white-space: nowrap; }
|
|
86
|
+
|
|
87
|
+
.compliance-badge {
|
|
88
|
+
display: inline-flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
gap: 0.35rem;
|
|
91
|
+
background: var(--color-accent-light);
|
|
92
|
+
color: var(--color-accent);
|
|
93
|
+
font-size: 0.75rem;
|
|
94
|
+
font-weight: 600;
|
|
95
|
+
padding: 0.25rem 0.75rem;
|
|
96
|
+
border-radius: 9999px;
|
|
97
|
+
margin-top: 1rem;
|
|
98
|
+
letter-spacing: 0.01em;
|
|
99
|
+
border: 1px solid var(--color-accent);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* \u2500\u2500 Navigation / TOC \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
103
|
+
.policy-toc {
|
|
104
|
+
background: var(--color-surface);
|
|
105
|
+
border: 1px solid var(--color-border);
|
|
106
|
+
border-left: 4px solid var(--color-accent);
|
|
107
|
+
border-radius: var(--radius);
|
|
108
|
+
padding: 1.5rem 2rem;
|
|
109
|
+
margin-bottom: 2.5rem;
|
|
110
|
+
box-shadow: var(--shadow);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.policy-toc h2 {
|
|
114
|
+
font-size: 1rem;
|
|
115
|
+
font-weight: 700;
|
|
116
|
+
text-transform: uppercase;
|
|
117
|
+
letter-spacing: 0.08em;
|
|
118
|
+
color: var(--color-text-muted);
|
|
119
|
+
margin-bottom: 1rem;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.policy-toc ol {
|
|
123
|
+
list-style: decimal;
|
|
124
|
+
padding-left: 1.25rem;
|
|
125
|
+
column-count: 1;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
@media (min-width: 600px) {
|
|
129
|
+
.policy-toc ol { column-count: 2; column-gap: 2rem; }
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.policy-toc li { margin-bottom: 0.35rem; break-inside: avoid; }
|
|
133
|
+
|
|
134
|
+
.policy-toc a {
|
|
135
|
+
color: var(--color-link);
|
|
136
|
+
text-decoration: none;
|
|
137
|
+
font-size: 0.9375rem;
|
|
138
|
+
transition: color 0.15s ease;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.policy-toc a:hover { color: var(--color-link-hover); text-decoration: underline; }
|
|
142
|
+
|
|
143
|
+
/* \u2500\u2500 Article / Sections \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
144
|
+
article.policy-body { display: flex; flex-direction: column; gap: 2.5rem; }
|
|
145
|
+
|
|
146
|
+
.policy-section {
|
|
147
|
+
background: var(--color-surface);
|
|
148
|
+
border: 1px solid var(--color-border);
|
|
149
|
+
border-radius: var(--radius);
|
|
150
|
+
padding: 2rem 2.5rem;
|
|
151
|
+
box-shadow: var(--shadow);
|
|
152
|
+
scroll-margin-top: 1.5rem;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.policy-section h2 {
|
|
156
|
+
font-size: 1.25rem;
|
|
157
|
+
font-weight: 700;
|
|
158
|
+
color: var(--color-heading);
|
|
159
|
+
margin-bottom: 1.25rem;
|
|
160
|
+
padding-bottom: 0.75rem;
|
|
161
|
+
border-bottom: 2px solid var(--color-accent-light);
|
|
162
|
+
display: flex;
|
|
163
|
+
align-items: baseline;
|
|
164
|
+
gap: 0.5rem;
|
|
165
|
+
line-height: 1.3;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.section-number {
|
|
169
|
+
font-size: 0.75rem;
|
|
170
|
+
font-weight: 700;
|
|
171
|
+
background: var(--color-accent);
|
|
172
|
+
color: #fff;
|
|
173
|
+
width: 1.5rem;
|
|
174
|
+
height: 1.5rem;
|
|
175
|
+
display: inline-flex;
|
|
176
|
+
align-items: center;
|
|
177
|
+
justify-content: center;
|
|
178
|
+
border-radius: 50%;
|
|
179
|
+
flex-shrink: 0;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.policy-section p {
|
|
183
|
+
margin-bottom: 0.875rem;
|
|
184
|
+
font-size: 0.9375rem;
|
|
185
|
+
color: var(--color-text);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.policy-section p:last-child { margin-bottom: 0; }
|
|
189
|
+
|
|
190
|
+
.policy-section ul {
|
|
191
|
+
margin: 0.75rem 0 0.875rem 1.5rem;
|
|
192
|
+
display: flex;
|
|
193
|
+
flex-direction: column;
|
|
194
|
+
gap: 0.35rem;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.policy-section ul li {
|
|
198
|
+
font-size: 0.9375rem;
|
|
199
|
+
color: var(--color-text);
|
|
200
|
+
position: relative;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.policy-section ul li::marker { color: var(--color-accent); }
|
|
204
|
+
|
|
205
|
+
/* \u2500\u2500 Footer \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
206
|
+
.policy-footer {
|
|
207
|
+
margin-top: 3rem;
|
|
208
|
+
padding: 1.5rem 2rem;
|
|
209
|
+
border-top: 1px solid var(--color-border);
|
|
210
|
+
text-align: center;
|
|
211
|
+
font-size: 0.8125rem;
|
|
212
|
+
color: var(--color-text-muted);
|
|
213
|
+
display: flex;
|
|
214
|
+
flex-direction: column;
|
|
215
|
+
gap: 0.35rem;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.policy-footer a { color: var(--color-link); text-decoration: none; }
|
|
219
|
+
.policy-footer a:hover { text-decoration: underline; }
|
|
220
|
+
|
|
221
|
+
/* \u2500\u2500 Print styles \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
222
|
+
@media print {
|
|
223
|
+
:root {
|
|
224
|
+
--color-bg: #fff;
|
|
225
|
+
--color-surface: #fff;
|
|
226
|
+
--color-border: #d1d5db;
|
|
227
|
+
--color-text: #000;
|
|
228
|
+
--color-text-muted: #374151;
|
|
229
|
+
--color-accent: #16a34a;
|
|
230
|
+
--color-accent-light: #f0fdf4;
|
|
231
|
+
--color-heading: #064e3b;
|
|
232
|
+
--color-link: #15803d;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
body { padding: 0; font-size: 10pt; }
|
|
236
|
+
.policy-wrapper { max-width: 100%; }
|
|
237
|
+
|
|
238
|
+
.policy-toc { break-inside: avoid; }
|
|
239
|
+
.policy-section { break-inside: avoid; box-shadow: none; border: 1px solid #d1d5db; }
|
|
240
|
+
|
|
241
|
+
.policy-toc ol { column-count: 2; }
|
|
242
|
+
.policy-footer { border-top: 1px solid #d1d5db; }
|
|
243
|
+
|
|
244
|
+
a { color: inherit; text-decoration: none; }
|
|
245
|
+
}
|
|
246
|
+
`.trim();function ee(r,u){var R;let v=(u==null?void 0:u.includeStyles)!==false,e=(R=u==null?void 0:u.customCSS)!=null?R:"",a=r.sections.filter(d=>d.included),s=M(r.organizationInfo.name||"Organisation"),t=M(r.title||"Privacy Policy"),l=M(r.version||"1.0"),c=r.effectiveDate?new Date(r.effectiveDate).toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}):new Date().toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}),y=r.lastUpdated?new Date(r.lastUpdated).toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}):c,C=r.organizationInfo.website?`<a href="${M(r.organizationInfo.website)}" target="_blank" rel="noopener">${M(r.organizationInfo.website)}</a>`:"",x=r.organizationInfo.privacyEmail?`<a href="mailto:${M(r.organizationInfo.privacyEmail)}">${M(r.organizationInfo.privacyEmail)}</a>`:"",k=`
|
|
247
|
+
<nav class="policy-toc" aria-label="Table of Contents">
|
|
248
|
+
<h2>Table of Contents</h2>
|
|
249
|
+
<ol>
|
|
250
|
+
${a.map((d,w)=>` <li><a href="#${ce(d.title)}">${M(d.title)}</a></li>`).join(`
|
|
251
|
+
`)}
|
|
252
|
+
</ol>
|
|
253
|
+
</nav>`,F=a.map((d,w)=>{let p=ce(d.title),T=d.template||d.defaultContent||"",b=Le(T);return ` <section class="policy-section" id="${p}" aria-labelledby="section-heading-${p}">
|
|
254
|
+
<h2 id="section-heading-${p}">
|
|
255
|
+
<span class="section-number" aria-hidden="true">${w+1}</span>
|
|
256
|
+
${M(d.title)}
|
|
257
|
+
</h2>
|
|
258
|
+
${b}
|
|
259
|
+
</section>`}).join(`
|
|
260
|
+
|
|
261
|
+
`),z=e?e.replace(/<\/style>/gi,""):"",L=v?`<style>
|
|
262
|
+
${Ne}
|
|
263
|
+
${z?`
|
|
264
|
+
/* \u2500\u2500 Custom styles \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
265
|
+
${z}`:""}
|
|
266
|
+
</style>`:z?`<style>${z}</style>`:"";return `<!DOCTYPE html>
|
|
267
|
+
<html lang="en">
|
|
268
|
+
<head>
|
|
269
|
+
<meta charset="UTF-8" />
|
|
270
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
271
|
+
<meta name="description" content="Privacy Policy for ${s}" />
|
|
272
|
+
<meta name="generator" content="NDPA Toolkit" />
|
|
273
|
+
<title>${t} \u2014 ${s}</title>
|
|
274
|
+
${L}
|
|
275
|
+
</head>
|
|
276
|
+
<body>
|
|
277
|
+
<div class="policy-wrapper">
|
|
278
|
+
|
|
279
|
+
<header class="policy-header">
|
|
280
|
+
<h1>${t}</h1>
|
|
281
|
+
<div class="policy-meta">
|
|
282
|
+
<span><strong>Organisation:</strong> ${s}</span>
|
|
283
|
+
<span><strong>Effective:</strong> ${c}</span>
|
|
284
|
+
<span><strong>Version:</strong> ${l}</span>
|
|
285
|
+
${y!==c?`<span><strong>Last updated:</strong> ${y}</span>`:""}
|
|
286
|
+
</div>
|
|
287
|
+
<div>
|
|
288
|
+
<span class="compliance-badge" role="img" aria-label="NDPA compliant">✓ NDPA 2023 Compliant</span>
|
|
289
|
+
</div>
|
|
290
|
+
</header>
|
|
291
|
+
|
|
292
|
+
${k}
|
|
293
|
+
|
|
294
|
+
<article class="policy-body" aria-label="Policy content">
|
|
295
|
+
|
|
296
|
+
${F}
|
|
297
|
+
|
|
298
|
+
</article>
|
|
299
|
+
|
|
300
|
+
<footer class="policy-footer" role="contentinfo">
|
|
301
|
+
<div>${s}${C?` — ${C}`:""}</div>
|
|
302
|
+
${x?`<div>Privacy contact: ${x}</div>`:""}
|
|
303
|
+
<div>Effective ${c} • Version ${l}</div>
|
|
304
|
+
<div>Generated by <strong>NDPA Toolkit</strong> — Nigeria Data Protection Act 2023</div>
|
|
305
|
+
</footer>
|
|
306
|
+
|
|
307
|
+
</div>
|
|
308
|
+
</body>
|
|
309
|
+
</html>`}function Ie(r){return r.toLowerCase().replace(/[^a-z0-9\s-]/g,"").trim().replace(/\s+/g,"-")}function te(r){let u=r.sections.filter(l=>l.included),v=r.title||"Privacy Policy",e=r.organizationInfo.name||"Organisation",a=r.version||"1.0",s=r.effectiveDate?new Date(r.effectiveDate).toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}):new Date().toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}),t=[];return t.push(`# ${v}`),t.push(""),t.push(`_Effective: ${s} | Version: ${a} | ${e}_`),t.push(""),r.organizationInfo.website&&t.push(`**Website:** ${r.organizationInfo.website} `),r.organizationInfo.privacyEmail&&t.push(`**Privacy contact:** ${r.organizationInfo.privacyEmail} `),(r.organizationInfo.website||r.organizationInfo.privacyEmail)&&t.push(""),t.push("> This privacy policy is compliant with the **Nigeria Data Protection Act (NDPA) 2023**."),t.push(""),t.push("---"),t.push(""),u.length>0&&(t.push("## Table of Contents"),t.push(""),u.forEach((l,c)=>{let y=Ie(`${c+1} ${l.title}`);t.push(`${c+1}. [${l.title}](#${y})`);}),t.push(""),t.push("---"),t.push("")),u.forEach((l,c)=>{t.push(`## ${c+1}. ${l.title}`),t.push("");let y=(l.template||l.defaultContent||"").trim();if(y){let C=y.split(`
|
|
310
|
+
`);for(let x of C){let D=x.trimEnd();D.startsWith("-")||D.startsWith("\u2022")||D===""?t.push(D.replace(/^•/,"-")):t.push(D);}}t.push(""),t.push("---"),t.push("");}),t.push(`_Generated by **NDPA Toolkit** \u2014 ${e} \u2022 Version ${a}_`),t.push(""),t.join(`
|
|
311
|
+
`)}function oe(r,u){return chunkMQFZHA2D_js.d(this,null,function*(){var R;let v;try{let d=yield import('jspdf');v=(R=d.jsPDF)!=null?R:d.default;}catch(d){throw new Error(`[ndpr-toolkit] PDF export requires the "jspdf" package. Install it with:
|
|
312
|
+
pnpm add jspdf
|
|
313
|
+
See: https://ndprtoolkit.com.ng/docs/guides/styling-customization`)}let e=new v({unit:"mm",format:"a4"}),a=e.internal.pageSize.getWidth(),s=e.internal.pageSize.getHeight(),t=20,l=a-t*2,c=t,y=r.organizationInfo.name||"",C=r.title||"Privacy Policy",x=r.version||"1.0",D=r.effectiveDate?new Date(r.effectiveDate).toLocaleDateString():new Date().toLocaleDateString(),k=()=>{e.setFontSize(8),e.setFont("helvetica","italic"),e.setTextColor(150,150,150),e.text(y?`${y} \u2014 ${C}`:C,t,12),e.setDrawColor(220,220,220),e.setLineWidth(.3),e.line(t,14,a-t,14),e.setTextColor(0,0,0);},F=d=>{c+d>s-t-10&&(e.addPage(),c=t+8,k());};if((u==null?void 0:u.includeCoverPage)!==false){e.setFillColor(22,163,74),e.rect(0,0,a,12,"F"),e.setFontSize(28),e.setFont("helvetica","bold"),e.setTextColor(22,163,74);let d=e.splitTextToSize(C,l-10),w=72;d.forEach(T=>{e.text(T,a/2,w,{align:"center"}),w+=11;}),e.setDrawColor(22,163,74),e.setLineWidth(.6);let p=w+6;if(e.line(a/2-30,p,a/2+30,p),e.setFontSize(14),e.setFont("helvetica","normal"),e.setTextColor(40,40,40),e.text(y,a/2,p+14,{align:"center"}),e.setFontSize(10),e.setTextColor(100,100,100),e.text(`Effective Date: ${D}`,a/2,p+26,{align:"center"}),e.text(`Version ${x}`,a/2,p+34,{align:"center"}),(u==null?void 0:u.includeComplianceBadge)!==false){let T=p+52,b="Compliant with the Nigeria Data Protection Act (NDPA) 2023";e.setFontSize(8.5),e.setFont("helvetica","bold"),e.setTextColor(255,255,255);let g=e.getTextWidth(b),m=7,_=3.5,H=(a-g-m*2)/2;e.setFillColor(22,163,74),e.roundedRect(H,T-_-1,g+m*2,7+_,2,2,"F"),e.text(b,a/2,T+1.5,{align:"center"}),e.setTextColor(0,0,0);}e.setFillColor(22,163,74),e.rect(0,s-12,a,12,"F"),e.addPage(),c=t+8,k();}let z=r.sections.filter(d=>d.included);(u==null?void 0:u.includeTOC)!==false&&(e.setFontSize(18),e.setFont("helvetica","bold"),e.setTextColor(22,163,74),e.text("Table of Contents",t,c+4),e.setDrawColor(22,163,74),e.setLineWidth(.5),e.line(t,c+8,t+80,c+8),c+=18,e.setFontSize(10.5),e.setFont("helvetica","normal"),e.setTextColor(40,40,40),z.forEach((d,w)=>{F(7);let p=`${w+1}. ${d.title}`;e.text(p,t+4,c),c+=6.5;}),e.addPage(),c=t+8,k()),z.forEach((d,w)=>{F(18),e.setFillColor(22,163,74),e.circle(t+3.5,c-1.5,3.8,"F"),e.setFontSize(8),e.setFont("helvetica","bold"),e.setTextColor(255,255,255),e.text(String(w+1),t+3.5,c-.5,{align:"center"}),e.setFontSize(13),e.setFont("helvetica","bold"),e.setTextColor(22,163,74),e.text(d.title,t+11,c),c+=3,e.setDrawColor(200,200,200),e.setLineWidth(.25),e.line(t+11,c,a-t,c),c+=6;let p=(d.template||d.defaultContent||"").trim();if(p){let T=p.split(`
|
|
314
|
+
`);e.setFontSize(9.5),e.setFont("helvetica","normal"),e.setTextColor(50,50,50),T.forEach(b=>{let g=b.trimEnd();if(g===""){c+=3;return}let m=g.startsWith("-")||g.startsWith("\u2022"),_=m?t+8:t+4,H=m?g.replace(/^[-•]\s*/,""):g,A=l-(m?12:8);e.splitTextToSize(H,A).forEach((X,Z)=>{F(5),m&&Z===0&&(e.setFillColor(22,163,74),e.circle(t+4,c-1,.9,"F")),e.text(X,_,c),c+=5;});});}c+=10;});let L=e.getNumberOfPages();for(let d=1;d<=L;d++)e.setPage(d),e.setFontSize(7.5),e.setFont("helvetica","normal"),e.setTextColor(160,160,160),e.setDrawColor(220,220,220),e.setLineWidth(.3),e.line(t,s-12,a-t,s-12),e.text(y?`${y} \u2014 Privacy Policy`:"Privacy Policy",t,s-8),e.text(`Page ${d} of ${L}`,a-t,s-8,{align:"right"}),e.setTextColor(0,0,0);return e.setProperties({title:C,author:y,subject:"Privacy Policy \u2014 NDPA 2023 Compliant",keywords:"privacy policy, NDPA, Nigeria, data protection"}),e.output("blob")})}function re(r,u){return chunkMQFZHA2D_js.d(this,null,function*(){let v;try{v=yield import('docx');}catch(b){throw new Error(`[ndpr-toolkit] Word export requires the "docx" package. Install it with:
|
|
315
|
+
pnpm add docx
|
|
316
|
+
See: https://ndprtoolkit.com.ng/docs/guides/styling-customization`)}let{Document:e,Paragraph:a,TextRun:s,HeadingLevel:t,Packer:l,Header:c,Footer:y,PageNumber:C,AlignmentType:x,BorderStyle:D,ShadingType:k,TableOfContents:F}=v,z=r.organizationInfo.name||"",L=r.title||"Privacy Policy",R=r.version||"1.0",d=r.effectiveDate?new Date(r.effectiveDate).toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}):new Date().toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}),w=r.sections.filter(b=>b.included),p=[];if(p.push(new a({children:[new s({text:L,bold:true,size:52,color:"064e3b"})],heading:t.TITLE,spacing:{after:160},alignment:x.CENTER})),p.push(new a({children:[new s({text:`${z}${z?" \u2022 ":""}Version ${R} \u2022 Effective ${d}`,size:20,color:"6b7280",italics:true})],spacing:{after:120},alignment:x.CENTER})),p.push(new a({children:[new s({text:"Compliant with the Nigeria Data Protection Act (NDPA) 2023",size:18,color:"16a34a",bold:true})],spacing:{after:400},alignment:x.CENTER})),p.push(new a({children:[],spacing:{after:200},border:{bottom:{color:"16a34a",style:D.SINGLE,size:6,space:1}}})),(u==null?void 0:u.includeTOC)!==false){if(p.push(new a({children:[new s({text:"Table of Contents",bold:true,size:28,color:"064e3b"})],heading:t.HEADING_1,spacing:{before:400,after:200}})),typeof F=="function")try{p.push(new F("Table of Contents",{hyperlink:!0,headingStyleRange:"1-1"}));}catch(b){w.forEach((g,m)=>{p.push(new a({children:[new s({text:`${m+1}. ${g.title}`,size:22,color:"15803d"})],spacing:{after:80}}));});}else w.forEach((b,g)=>{p.push(new a({children:[new s({text:`${g+1}. ${b.title}`,size:22,color:"15803d"})],spacing:{after:80}}));});p.push(new a({children:[],pageBreakBefore:true}));}w.forEach((b,g)=>{p.push(new a({children:[new s({text:`${g+1}. ${b.title}`,bold:true,size:28,color:"064e3b"})],heading:t.HEADING_1,spacing:{before:400,after:200},border:{bottom:{color:"dcfce7",style:D.SINGLE,size:4,space:1}}}));let m=(b.template||b.defaultContent||"").trim();m&&m.split(`
|
|
317
|
+
`).forEach(H=>{let A=H.trimEnd();if(A===""){p.push(new a({children:[],spacing:{after:60}}));return}let N=A.startsWith("- ")||A.startsWith("\u2022 "),X=N?A.replace(/^[-•]\s*/,""):A;N?p.push(new a({children:[new s({text:X,size:22})],spacing:{after:80},bullet:{level:0}})):p.push(new a({children:[new s({text:X,size:22})],spacing:{after:100}}));});}),p.push(new a({children:[new s({text:`Generated by NDPA Toolkit \u2014 ${z}${z?" \u2014 ":""}Privacy Policy v${R}`,size:16,color:"9ca3af",italics:true})],spacing:{before:600},alignment:x.CENTER}));let T=new e({title:L,description:"Privacy Policy \u2014 NDPA 2023 Compliant",styles:{paragraphStyles:[{id:"Normal",name:"Normal",run:{font:"Calibri",size:22}}]},sections:[{headers:{default:new c({children:[new a({children:[new s({text:z||"Privacy Policy",size:16,color:"9ca3af"})],alignment:x.RIGHT})]})},footers:{default:new y({children:[new a({children:[new s({text:"Page ",size:16,color:"9ca3af"}),new s({children:[C.CURRENT],size:16,color:"9ca3af"}),new s({text:" of ",size:16,color:"9ca3af"}),new s({children:[C.TOTAL_PAGES],size:16,color:"9ca3af"})],alignment:x.CENTER})]})},children:p}]});return l.toBlob(T)})}var le=10,Me="ndpr_policy_draft",Re=2e3;function de(){return `section_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function pe(){return `draft_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function U(r,u,v){let e=Date.now();return {id:v,title:`Privacy Policy${r.org.name?` \u2014 ${r.org.name}`:""}`,templateId:"adaptive-policy-wizard",organizationInfo:{name:r.org.name,website:r.org.website,privacyEmail:r.org.privacyEmail,address:r.org.address,dpoName:r.org.dpoName,dpoEmail:r.org.dpoEmail,industry:r.org.industry},sections:u,variableValues:{},effectiveDate:e,lastUpdated:e,version:"1.0",applicableFrameworks:["ndpa","ndpr"]}}function ot(r={}){var ne;let{onComplete:u,onComplianceChange:v}=r,e=react.useRef((ne=r.adapter)!=null?ne:chunkELKB2AFZ_js.a(Me));r.adapter&&(e.current=r.adapter);let a=react.useRef(pe()),[s,t]=react.useState(1),[l,c]=react.useState(chunkLU4PFST7_js.b),[y,C]=react.useState([]),[x,D]=react.useState({}),[k,F]=react.useState([]),[z,L]=react.useState(false),[R,d]=react.useState(null),[w,p]=react.useState(true),T=react.useRef(false),b=react.useRef(null);react.useEffect(()=>{let o=false,n=i=>{i&&(a.current=i.id,c(i.templateContext),C(i.customSections),D(i.sectionOverrides),F(i.sectionOrder),t(i.currentStep),d(i.lastSavedAt),L(true));};try{let i=e.current.load();i instanceof Promise?i.then(h=>{o||(n(h),p(!1));},()=>{o||p(!1);}):(n(i),p(!1));}catch(i){o||p(false);}return ()=>{o=true;}},[]);let g=react.useMemo(()=>{let n=chunkLU4PFST7_js.d(l).map(f=>x[f.id]?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},f),{template:x[f.id]}):f),i=y.map(f=>{var E;return {id:f.id,title:f.title,template:(E=x[f.id])!=null?E:f.content,order:f.order,required:false,included:true}}),h=[...n,...i];if(k.length>0){let f=new Map(k.map((E,$)=>[E,$]));return [...h].sort((E,$)=>{let O=f.has(E.id)?f.get(E.id):h.length,W=f.has($.id)?f.get($.id):h.length;return O-W})}return [...h].sort((f,E)=>{var $,O;return (($=f.order)!=null?$:0)-((O=E.order)!=null?O:0)})},[l,y,x,k]),m=react.useMemo(()=>!l.org.name&&!l.org.privacyEmail?null:U(l,g,a.current),[l,g]),_=react.useMemo(()=>U(chunkLU4PFST7_js.b(),[],a.current),[]),H=react.useMemo(()=>chunkLU4PFST7_js.c(m!=null?m:_,l),[m,l,_]),A=H.percentage,N=H.gaps,X=react.useRef({score:-1,gaps:[]});react.useEffect(()=>{let o=X.current;v&&(A!==o.score||N!==o.gaps)&&v(A,N),X.current={score:A,gaps:N};},[A,N,v]);let Z=react.useMemo(()=>{switch(s){case 1:return l.org.name.trim().length>0&&l.org.privacyEmail.trim().length>0;case 2:return l.dataCategories.some(o=>o.selected);case 3:return l.purposes.length>0;case 4:return true;default:return false}},[s,l]),me=react.useCallback(o=>{let n=Math.min(Math.max(1,o),4);n<4&&(T.current=false),t(n);},[]),ue=react.useCallback(()=>{t(o=>Math.min(o+1,4));},[]),ge=react.useCallback(()=>{T.current=false,t(o=>Math.max(o-1,1));},[]),fe=react.useCallback(o=>{c(n=>chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},n),o));},[]),he=react.useCallback(o=>{c(n=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},n),{org:chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},n.org),o)}));},[]),ye=react.useCallback(o=>{c(n=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},n),{dataCategories:n.dataCategories.map(i=>i.id===o?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{selected:!i.selected}):i)}));},[]),ve=react.useCallback(o=>{c(n=>{let i=o,h=n.purposes.includes(i);return chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},n),{purposes:h?n.purposes.filter(f=>f!==o):[...n.purposes,i]})});},[]),xe=react.useCallback(o=>{c(n=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},n),{thirdPartyProcessors:[...n.thirdPartyProcessors,o]}));},[]),be=react.useCallback(o=>{c(n=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},n),{thirdPartyProcessors:n.thirdPartyProcessors.filter((i,h)=>h!==o)}));},[]),Pe=react.useCallback(o=>{C(n=>n.length>=le?n:[...n,chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},o),{id:de(),required:false})]);},[]),Ce=react.useCallback((o,n)=>{C(i=>i.map(h=>h.id===o?chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},h),n):h));},[]),we=react.useCallback(o=>{C(n=>n.filter(i=>i.id!==o)),F(n=>n.filter(i=>i!==o)),D(n=>{let i=chunkMQFZHA2D_js.a({},n);return delete i[o],i});},[]),Se=react.useCallback((o,n)=>{F(i=>{let h=i.length>0?i:g.map(O=>O.id),f=h.indexOf(o);if(f===-1){let O=g.map(Ae=>Ae.id),W=O.indexOf(o);if(W===-1)return i;let K=n==="up"?W-1:W+1;if(K<0||K>=O.length)return O;let j=[...O];return [j[W],j[K]]=[j[K],j[W]],j}let E=n==="up"?f-1:f+1;if(E<0||E>=h.length)return h;let $=[...h];return [$[f],$[E]]=[$[E],$[f]],$});},[g]),De=react.useCallback((o,n)=>{D(i=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{[o]:n}));},[]),Te=react.useCallback(o=>{let n=N.find(i=>i.requirementId===o);if(n)switch(n.fixType){case "fill_field":{T.current=false;let h=["data-categories-disclosed"],f=["purpose-of-processing"];h.includes(o)?t(2):f.includes(o)?t(3):(t(1));break}case "add_section":{if(!n.suggestedContent)break;C(i=>i.length>=le?i:[...i,{id:de(),title:n.requirement,content:n.suggestedContent,order:999,required:false}]);break}case "add_content":{if(!n.suggestedContent)break;let i="data-subject-rights";D(h=>{var E,$,O;let f=(O=($=h[i])!=null?$:(E=g.find(W=>W.id===i))==null?void 0:E.template)!=null?O:"";return chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},h),{[i]:`${f}
|
|
318
|
+
|
|
319
|
+
${n.suggestedContent}`.trim()})});break}}},[N,g]),Y=react.useCallback(o=>({id:a.current,templateContext:l,customSections:y,sectionOverrides:x,sectionOrder:k,currentStep:o,lastSavedAt:Date.now(),status:"draft"}),[l,y,x,k]),Ee=react.useCallback(()=>chunkMQFZHA2D_js.d(null,null,function*(){let o=Y(s);try{yield Promise.resolve(e.current.save(o)),d(o.lastSavedAt),L(!0);}catch(n){console.warn("[ndpr-toolkit] Failed to save draft:",n);}}),[Y,s]),$e=react.useCallback(()=>{Promise.resolve(e.current.remove()).catch(o=>{console.warn("[ndpr-toolkit] Failed to remove draft:",o);}),a.current=pe(),T.current=false,c(chunkLU4PFST7_js.b()),C([]),D({}),F([]),t(1),L(false),d(null);},[]);react.useEffect(()=>{if(!w)return b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{let o=Y(s);Promise.resolve(e.current.save(o)).then(()=>{d(o.lastSavedAt),L(true);}).catch(n=>{console.warn("[ndpr-toolkit] Auto-save failed:",n);});},Re),()=>{b.current&&clearTimeout(b.current);}},[l,y,x,k,s,w,Y]),react.useEffect(()=>{s===4&&m&&u&&!T.current&&(T.current=true,u(m));},[s,m,u]);let ze=react.useCallback(o=>chunkMQFZHA2D_js.d(null,null,function*(){let n=m!=null?m:U(l,g,a.current);return oe(n,o)}),[m,l,g]),Oe=react.useCallback(o=>chunkMQFZHA2D_js.d(null,null,function*(){let n=m!=null?m:U(l,g,a.current);return re(n,o)}),[m,l,g]),ke=react.useCallback(o=>{let n=m!=null?m:U(l,g,a.current);return ee(n,o)},[m,l,g]),Fe=react.useCallback(()=>{let o=m!=null?m:U(l,g,a.current);return te(o)},[m,l,g]);return {currentStep:s,goToStep:me,nextStep:ue,prevStep:ge,canProceed:Z,context:l,updateContext:fe,updateOrg:he,toggleDataCategory:ye,togglePurpose:ve,addProcessor:xe,removeProcessor:be,policy:m,sections:g,customSections:y,addCustomSection:Pe,updateCustomSection:Ce,removeCustomSection:we,reorderSections:Se,editSectionContent:De,sectionOverrides:x,complianceScore:A,complianceResult:H,complianceGaps:N,applyFix:Te,handleExportPDF:ze,handleExportDOCX:Oe,handleExportHTML:ke,handleExportMarkdown:Fe,isDraftSaved:z,lastSavedAt:R,saveDraft:Ee,discardDraft:$e,isLoading:w}}exports.a=ee;exports.b=te;exports.c=oe;exports.d=re;exports.e=ot;//# sourceMappingURL=chunk-TXXWCB5O.js.map
|
|
320
|
+
//# sourceMappingURL=chunk-TXXWCB5O.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function o(e){let t=[];if((!e.consents||Object.keys(e.consents).length===0)&&t.push("Consent settings must include at least one consent option"),e.timestamp?(typeof e.timestamp!="number"||isNaN(e.timestamp))&&t.push("Consent timestamp must be a valid number"):t.push("Consent timestamp is required"),e.version||t.push("Consent version is required"),e.method||t.push("Consent collection method is required"),e.hasInteracted===void 0&&t.push("User interaction status is required"),e.timestamp){let n=new Date;n.setMonth(n.getMonth()-13);let s=n.getTime();e.timestamp<s&&t.push("Consent is older than 13 months and should be refreshed");}return {valid:t.length===0,errors:t}}function i(e){let t=[];return (!e||e.length===0)&&t.push("At least one consent option is required"),e==null||e.forEach(n=>{(!n.purpose||n.purpose.trim()==="")&&t.push(`Consent option "${n.id}" is missing a purpose. NDPA Section 26 requires consent to be specific to a stated purpose.`);}),{valid:t.length===0,errors:t}}export{o as a,i as b};//# sourceMappingURL=chunk-U62QYKVG.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-U62QYKVG.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
'use strict';var chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var c={consent:{title:"We Value Your Privacy",description:"We use cookies and similar technologies to provide our services and enhance your experience. Your consent is collected in accordance with NDPA Sections 25-26.",acceptAll:"Accept All",rejectAll:"Reject All",customize:"Customize",savePreferences:"Save Preferences",selectAll:"Select All",deselectAll:"Deselect All",required:"Required",cookieNotice:'By clicking "Accept All", you agree to the use of ALL cookies. Visit our Cookie Policy to learn more.'},dsr:{title:"Submit a Data Subject Request",description:"Use this form to exercise your rights under the Nigeria Data Protection Act (NDPA), Part IV, Sections 29-36.",submitRequest:"Submit Request",reset:"Reset",fullName:"Full Name",email:"Email Address",phone:"Phone Number (Optional)",requestType:"Request Type",additionalInfo:"Additional Information",identityVerification:"Identity Verification",identifierType:"Identifier Type",identifierValue:"Identifier Value",privacyNotice:"The information you provide in this form will be used solely for the purpose of processing your data subject request.",successMessage:"Your request has been submitted successfully."},breach:{title:"Report a Data Breach",description:"Use this form to report a suspected or confirmed data breach in accordance with NDPA Section 40.",submitReport:"Submit Report",breachTitle:"Breach Title/Summary",category:"Category",discoveredAt:"Date Discovered",detailedDescription:"Detailed Description"},dpia:{title:"Data Protection Impact Assessment",next:"Next",previous:"Previous",complete:"Complete Assessment",progress:"Progress"},policy:{title:"Privacy Policy Generator",generate:"Generate Policy",preview:"Preview",export:"Export",sections:"Sections",variables:"Variables"},compliance:{score:"Compliance Score",excellent:"Excellent",good:"Good",needsWork:"Needs Work",critical:"Critical",recommendations:"Recommendations",passed:"Passed",gaps:"Gaps"},common:{loading:"Loading...",error:"An error occurred",save:"Save",cancel:"Cancel",delete:"Delete",edit:"Edit",add:"Add",back:"Back",next:"Next",search:"Search",noResults:"No results found"}};function f(o){if(!o)return c;let t=chunkMQFZHA2D_js.a({},c);for(let e of Object.keys(o))o[e]&&(t[e]=chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},c[e]),o[e]));return t}var p=react.createContext({}),d=class extends react.Component{constructor(e){super(e);this.reset=()=>{this.setState({error:null});};this.state={error:null};}static getDerivedStateFromError(e){return {error:e}}componentDidCatch(e,r){var l,i;(i=(l=this.props).onError)==null||i.call(l,e,r);}render(){let{error:e}=this.state;if(e){let{fallback:r}=this.props;return typeof r=="function"?r(e,this.reset):r!==void 0?r:jsxRuntime.jsxs("div",{role:"alert",style:{padding:"16px",border:"1px solid #e53e3e",borderRadius:"4px",backgroundColor:"#fff5f5",color:"#c53030"},children:[jsxRuntime.jsx("h3",{style:{margin:"0 0 8px 0",fontSize:"16px"},children:"Something went wrong"}),jsxRuntime.jsx("p",{style:{margin:0,fontSize:"14px"},children:e.message})]})}return this.props.children}},A=l=>{var i=l,{children:o,fallback:t,onError:e}=i,r=chunkMQFZHA2D_js.c(i,["children","fallback","onError"]);let u=react.useMemo(()=>{if(!r.theme)return;let a={};return r.theme.primary&&(a["--ndpr-primary"]=r.theme.primary),r.theme.primaryHover&&(a["--ndpr-primary-hover"]=r.theme.primaryHover),r.theme.primaryForeground&&(a["--ndpr-primary-foreground"]=r.theme.primaryForeground),Object.keys(a).length>0?a:void 0},[r.theme]);return jsxRuntime.jsx(p.Provider,{value:r,children:jsxRuntime.jsx(d,{fallback:t,onError:e,children:u?jsxRuntime.jsx("div",{style:u,children:o}):o})})};function C(){return react.useContext(p)}function k(){let{locale:o}=react.useContext(p);return react.useMemo(()=>f(o),[o])}exports.a=c;exports.b=f;exports.c=A;exports.d=C;exports.e=k;//# sourceMappingURL=chunk-UGY5ZYUG.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-UGY5ZYUG.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkTDDAYVKK_js=require('./chunk-TDDAYVKK.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var q={name:"",description:"",lawfulBasis:"consent",lawfulBasisJustification:"",dataCategories:"",involvesSensitiveData:false,sensitiveDataCondition:"",dataSubjectCategories:"",purposes:"",retentionPeriod:"",retentionJustification:"",recipients:"",crossBorderTransfer:false,reviewDate:"",liaPurposeTest:"",liaNecessityTest:"",liaBalancingTest:"",liaSafeguards:"",liaConclusion:""},Q=[{value:"consent",label:"Consent"},{value:"contract",label:"Contract"},{value:"legal_obligation",label:"Legal Obligation"},{value:"vital_interests",label:"Vital Interests"},{value:"public_interest",label:"Public Interest"},{value:"legitimate_interests",label:"Legitimate Interests"}],X=[{value:"explicit_consent",label:"Explicit Consent"},{value:"employment_law",label:"Employment Law"},{value:"vital_interests_incapable",label:"Vital Interests (Incapable)"},{value:"nonprofit_legitimate",label:"Nonprofit Legitimate Activities"},{value:"publicly_available",label:"Publicly Available Data"},{value:"legal_claims",label:"Legal Claims"},{value:"substantial_public_interest",label:"Substantial Public Interest"},{value:"health_purposes",label:"Health Purposes"},{value:"public_health",label:"Public Health"},{value:"archiving_research",label:"Archiving / Research"}],Ce=({activities:c,onAddActivity:F,onUpdateActivity:_,onArchiveActivity:j,title:Z="Lawful Basis Tracker",description:ee="Document and track the lawful basis for each processing activity as required by NDPA 2023 Section 25.",className:te="",buttonClassName:m="",showSummary:re=true,showComplianceGaps:ie=true,classNames:r,unstyled:o})=>{let[h,v]=react.useState("list"),[a,w]=react.useState(q),[f,I]=react.useState(null),[J,ae]=react.useState(null),[A,ne]=react.useState("all"),[B,oe]=react.useState("all"),[S,de]=react.useState(""),[g,k]=react.useState([]),V=react.useMemo(()=>{let e=[...c];if(A!=="all"&&(e=e.filter(l=>l.status===A)),B!=="all"&&(e=e.filter(l=>l.lawfulBasis===B)),S){let l=S.toLowerCase();e=e.filter(u=>u.name.toLowerCase().includes(l)||u.description.toLowerCase().includes(l)||u.purposes.some(N=>N.toLowerCase().includes(l)));}return e.sort((l,u)=>u.updatedAt-l.updatedAt),e},[c,A,B,S]),C=react.useCallback(e=>new Date(e).toLocaleDateString(),[]),P=react.useMemo(()=>chunkTDDAYVKK_js.d(c),[c]),x=react.useMemo(()=>chunkTDDAYVKK_js.c(c),[c]),D=react.useCallback(e=>e.split(",").map(l=>l.trim()).filter(l=>l.length>0),[]),le=react.useCallback(()=>{w(q),I(null),k([]),v("form");},[]),M=react.useCallback(e=>{w({name:e.name,description:e.description,lawfulBasis:e.lawfulBasis,lawfulBasisJustification:e.lawfulBasisJustification,dataCategories:e.dataCategories.join(", "),involvesSensitiveData:e.involvesSensitiveData,sensitiveDataCondition:e.sensitiveDataCondition||"",dataSubjectCategories:e.dataSubjectCategories.join(", "),purposes:e.purposes.join(", "),retentionPeriod:e.retentionPeriod,retentionJustification:e.retentionJustification||"",recipients:(e.recipients||[]).join(", "),crossBorderTransfer:e.crossBorderTransfer,reviewDate:e.reviewDate?new Date(e.reviewDate).toISOString().split("T")[0]:"",liaPurposeTest:"",liaNecessityTest:"",liaBalancingTest:"",liaSafeguards:"",liaConclusion:""}),I(e.id),k([]),v("form");},[]),se=react.useCallback(()=>{let e={name:a.name,description:a.description,lawfulBasis:a.lawfulBasis,lawfulBasisJustification:a.lawfulBasisJustification,dataCategories:D(a.dataCategories),involvesSensitiveData:a.involvesSensitiveData,sensitiveDataCondition:a.sensitiveDataCondition||void 0,dataSubjectCategories:D(a.dataSubjectCategories),purposes:D(a.purposes),retentionPeriod:a.retentionPeriod,retentionJustification:a.retentionJustification||void 0,recipients:a.recipients?D(a.recipients):void 0,crossBorderTransfer:a.crossBorderTransfer,reviewDate:a.reviewDate?new Date(a.reviewDate).getTime():void 0,status:"active"},l=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},e),{id:f||"temp",createdAt:Date.now(),updatedAt:Date.now()}),u=chunkTDDAYVKK_js.a(l);if(!u.isValid){k(u.errors);return}f&&_?_(f,e):F&&F(e),w(q),I(null),k([]),v("list");},[a,f,_,F,D]),G=react.useCallback(e=>{j&&j(e);},[j]),ue=react.useCallback(e=>{ae(e),v("detail");},[]),n=react.useMemo(()=>J?c.find(e=>e.id===J):null,[c,J]),H=react.useCallback(e=>{let l={active:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",inactive:"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200",under_review:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",archived:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"},u={active:"Active",inactive:"Inactive",under_review:"Under Review",archived:"Archived"};return jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${l[e]}`,r==null?void 0:r.statusBadge,o),children:u[e]})},[r==null?void 0:r.statusBadge,o]),U=react.useCallback(e=>{let l={consent:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",contract:"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200",legal_obligation:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",vital_interests:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",public_interest:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",legitimate_interests:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200"},u={consent:"Consent",contract:"Contract",legal_obligation:"Legal Obligation",vital_interests:"Vital Interests",public_interest:"Public Interest",legitimate_interests:"Legitimate Interests"};return jsxRuntime.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${l[e]}`,children:u[e]})},[]),Y=react.useCallback(e=>e.dpoApproval?e.dpoApproval.approved?jsxRuntime.jsx("span",{className:"px-2 py-1 rounded text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",children:"Approved"}):jsxRuntime.jsx("span",{className:"px-2 py-1 rounded text-xs font-medium bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",children:"Pending Approval"}):jsxRuntime.jsx("span",{className:"px-2 py-1 rounded text-xs font-medium bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-400",children:"No DPO Review"}),[]),pe=()=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",r==null?void 0:r.summary,o),role:"status","aria-label":"Compliance summary",children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-blue-50 dark:bg-blue-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-blue-800 dark:text-blue-200",children:P.totalActivities}),jsxRuntime.jsx("p",{className:"text-sm text-blue-600 dark:text-blue-300",children:"Total Activities"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-orange-50 dark:bg-orange-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-orange-800 dark:text-orange-200",children:P.sensitiveDataActivities}),jsxRuntime.jsx("p",{className:"text-sm text-orange-600 dark:text-orange-300",children:"Sensitive Data"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-purple-50 dark:bg-purple-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-purple-800 dark:text-purple-200",children:P.crossBorderActivities}),jsxRuntime.jsx("p",{className:"text-sm text-purple-600 dark:text-purple-300",children:"Cross-Border Transfers"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-red-50 dark:bg-red-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-red-800 dark:text-red-200",children:P.activitiesWithoutApproval.length}),jsxRuntime.jsx("p",{className:"text-sm text-red-600 dark:text-red-300",children:"Pending Approval"})]})]}),R=react.useMemo(()=>x.filter(e=>e.severity==="high"),[x]),E=react.useMemo(()=>x.filter(e=>e.severity==="medium"),[x]),ge=()=>x.length===0?jsxRuntime.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-4 rounded-lg mb-6",role:"status","aria-label":"No compliance gaps",children:[jsxRuntime.jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"No compliance gaps detected."}),jsxRuntime.jsx("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:"All processing activities appear to be properly documented."})]}):jsxRuntime.jsxs("div",{className:"mb-6",role:"status","aria-label":`${x.length} compliance gaps detected`,children:[R.length>0&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-red-50 dark:bg-red-900/20 p-4 rounded-lg mb-3",r==null?void 0:r.gapAlert,o),children:[jsxRuntime.jsxs("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium mb-2",children:["High Priority (",R.length,")"]}),jsxRuntime.jsx("ul",{className:"space-y-1",children:R.map((e,l)=>jsxRuntime.jsx("li",{className:"text-xs text-red-700 dark:text-red-300",children:e.description},l))})]}),E.length>0&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-yellow-50 dark:bg-yellow-900/20 p-4 rounded-lg",r==null?void 0:r.gapAlert,o),children:[jsxRuntime.jsxs("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium mb-2",children:["Medium Priority (",E.length,")"]}),jsxRuntime.jsx("ul",{className:"space-y-1",children:E.map((e,l)=>jsxRuntime.jsx("li",{className:"text-xs text-yellow-700 dark:text-yellow-300",children:e.description},l))})]})]}),W=react.useCallback(()=>{v("list"),k([]);},[]),ce=react.useCallback(()=>{v("list");},[]),s=react.useCallback((e,l)=>{w(u=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},u),{[e]:l}));},[]),be=react.useCallback(e=>{w(l=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},l),{involvesSensitiveData:e,sensitiveDataCondition:e?l.sensitiveDataCondition:""}));},[]),me=()=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",r==null?void 0:r.form,o),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex justify-between items-center mb-4",r==null?void 0:r.header,o),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium",children:f?"Edit Processing Activity":"New Processing Activity"}),jsxRuntime.jsx("button",{onClick:W,className:`px-4 py-2 text-gray-600 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded hover:bg-gray-200 dark:hover:bg-gray-600 ${m}`,children:"Cancel"})]}),g.length>0&&jsxRuntime.jsxs("div",{id:"form-errors",className:"bg-red-50 dark:bg-red-900/20 p-4 rounded-lg mb-4",role:"alert",children:[jsxRuntime.jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium mb-2",children:"Please correct the following errors:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside space-y-1",children:g.map((e,l)=>jsxRuntime.jsx("li",{className:"text-xs text-red-700 dark:text-red-300",children:e},l))})]}),jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"activityName",className:"block text-sm font-medium mb-1",children:"Activity Name *"}),jsxRuntime.jsx("input",{type:"text",id:"activityName",value:a.name,onChange:e=>s("name",e.target.value),placeholder:"e.g., Customer Account Management","aria-required":"true","aria-describedby":g.length>0?"form-errors":void 0,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"activityDescription",className:"block text-sm font-medium mb-1",children:"Description *"}),jsxRuntime.jsx("textarea",{id:"activityDescription",value:a.description,onChange:e=>s("description",e.target.value),placeholder:"Describe what processing is performed...",rows:3,"aria-required":"true","aria-describedby":g.length>0?"form-errors":void 0,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"lawfulBasis",className:"block text-sm font-medium mb-1",children:"Lawful Basis (NDPA Section 25) *"}),jsxRuntime.jsx("select",{id:"lawfulBasis",value:a.lawfulBasis,onChange:e=>s("lawfulBasis",e.target.value),"aria-required":"true",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:Q.map(e=>jsxRuntime.jsx("option",{value:e.value,children:e.label},e.value))}),jsxRuntime.jsx("p",{className:"mt-1 text-xs text-gray-600 dark:text-gray-400",children:chunkTDDAYVKK_js.b(a.lawfulBasis)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"justification",className:"block text-sm font-medium mb-1",children:"Lawful Basis Justification *"}),jsxRuntime.jsx("textarea",{id:"justification",value:a.lawfulBasisJustification,onChange:e=>s("lawfulBasisJustification",e.target.value),placeholder:"Document why this lawful basis applies to this processing activity...",rows:3,"aria-required":"true","aria-describedby":g.length>0?"form-errors":void 0,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),a.lawfulBasis==="legitimate_interests"&&jsxRuntime.jsxs("div",{className:"border border-indigo-200 dark:border-indigo-800 rounded-lg p-4 bg-indigo-50 dark:bg-indigo-900/20",children:[jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-indigo-800 dark:text-indigo-200 mb-3",children:"Legitimate Interest Assessment (LIA)"}),jsxRuntime.jsx("p",{className:"text-xs text-indigo-600 dark:text-indigo-300 mb-4",children:"NDPA Section 25(1)(f) requires a balancing test when relying on legitimate interests."}),jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"liaPurpose",className:"block text-sm font-medium mb-1",children:"Purpose Test"}),jsxRuntime.jsx("textarea",{id:"liaPurpose",value:a.liaPurposeTest,onChange:e=>s("liaPurposeTest",e.target.value),placeholder:"Describe the legitimate interest being pursued...",rows:2,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"liaNecessity",className:"block text-sm font-medium mb-1",children:"Necessity Test"}),jsxRuntime.jsx("textarea",{id:"liaNecessity",value:a.liaNecessityTest,onChange:e=>s("liaNecessityTest",e.target.value),placeholder:"Explain why this processing is necessary for the stated purpose...",rows:2,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"liaBalancing",className:"block text-sm font-medium mb-1",children:"Balancing Test"}),jsxRuntime.jsx("textarea",{id:"liaBalancing",value:a.liaBalancingTest,onChange:e=>s("liaBalancingTest",e.target.value),placeholder:"Assess the impact on data subjects' rights and interests...",rows:2,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"liaSafeguards",className:"block text-sm font-medium mb-1",children:"Safeguards"}),jsxRuntime.jsx("input",{type:"text",id:"liaSafeguards",value:a.liaSafeguards,onChange:e=>s("liaSafeguards",e.target.value),placeholder:"List safeguards (comma-separated)...",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"liaConclusion",className:"block text-sm font-medium mb-1",children:"Conclusion"}),jsxRuntime.jsx("textarea",{id:"liaConclusion",value:a.liaConclusion,onChange:e=>s("liaConclusion",e.target.value),placeholder:"State your overall conclusion...",rows:2,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dataCategories",className:"block text-sm font-medium mb-1",children:"Data Categories *"}),jsxRuntime.jsx("input",{type:"text",id:"dataCategories",value:a.dataCategories,onChange:e=>s("dataCategories",e.target.value),placeholder:"e.g., Name, Email, Phone Number (comma-separated)","aria-required":"true","aria-describedby":g.length>0?"form-errors":void 0,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsx("div",{children:jsxRuntime.jsxs("label",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:a.involvesSensitiveData,onChange:e=>be(e.target.checked),className:"rounded border-gray-300 dark:border-gray-600 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Involves Sensitive Personal Data (NDPA Section 27)"})]})}),a.involvesSensitiveData&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"sensitiveCondition",className:"block text-sm font-medium mb-1",children:"Sensitive Data Condition (NDPA Section 27) *"}),jsxRuntime.jsxs("select",{id:"sensitiveCondition",value:a.sensitiveDataCondition,onChange:e=>s("sensitiveDataCondition",e.target.value),"aria-required":"true",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:[jsxRuntime.jsx("option",{value:"",children:"Select a condition..."}),X.map(e=>jsxRuntime.jsx("option",{value:e.value,children:e.label},e.value))]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dataSubjectCategories",className:"block text-sm font-medium mb-1",children:"Data Subject Categories *"}),jsxRuntime.jsx("input",{type:"text",id:"dataSubjectCategories",value:a.dataSubjectCategories,onChange:e=>s("dataSubjectCategories",e.target.value),placeholder:"e.g., Customers, Employees, Vendors (comma-separated)","aria-required":"true","aria-describedby":g.length>0?"form-errors":void 0,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"purposes",className:"block text-sm font-medium mb-1",children:"Processing Purposes *"}),jsxRuntime.jsx("input",{type:"text",id:"purposes",value:a.purposes,onChange:e=>s("purposes",e.target.value),placeholder:"e.g., Account management, Service delivery (comma-separated)","aria-required":"true","aria-describedby":g.length>0?"form-errors":void 0,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"retentionPeriod",className:"block text-sm font-medium mb-1",children:"Retention Period *"}),jsxRuntime.jsx("input",{type:"text",id:"retentionPeriod",value:a.retentionPeriod,onChange:e=>s("retentionPeriod",e.target.value),placeholder:"e.g., 3 years after account closure","aria-required":"true","aria-describedby":g.length>0?"form-errors":void 0,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"retentionJustification",className:"block text-sm font-medium mb-1",children:"Retention Justification"}),jsxRuntime.jsx("input",{type:"text",id:"retentionJustification",value:a.retentionJustification,onChange:e=>s("retentionJustification",e.target.value),placeholder:"Reason for the retention period",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recipients",className:"block text-sm font-medium mb-1",children:"Recipients"}),jsxRuntime.jsx("input",{type:"text",id:"recipients",value:a.recipients,onChange:e=>s("recipients",e.target.value),placeholder:"e.g., Payment processor, Cloud provider (comma-separated)",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsx("div",{children:jsxRuntime.jsxs("label",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:a.crossBorderTransfer,onChange:e=>s("crossBorderTransfer",e.target.checked),className:"rounded border-gray-300 dark:border-gray-600 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Involves Cross-Border Transfer Outside Nigeria"})]})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"reviewDate",className:"block text-sm font-medium mb-1",children:"Next Review Date"}),jsxRuntime.jsx("input",{type:"date",id:"reviewDate",value:a.reviewDate,onChange:e=>s("reviewDate",e.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{className:"flex justify-end space-x-3 pt-4",children:[jsxRuntime.jsx("button",{onClick:W,className:`px-4 py-2 text-gray-600 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded hover:bg-gray-200 dark:hover:bg-gray-600 ${m}`,children:"Cancel"}),jsxRuntime.jsx("button",{onClick:se,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${m}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:f?"Update Activity":"Create Activity"})]})]})]}),ve=()=>{var l;if(!n)return jsxRuntime.jsx("div",{className:"flex items-center justify-center h-64 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Activity not found."})});let e=chunkTDDAYVKK_js.a(n);return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("button",{onClick:ce,className:"text-sm text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline mb-2","aria-label":"Back to activities list",children:"Back to list"}),jsxRuntime.jsx("h3",{className:"text-lg font-medium",children:n.name})]}),jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[U(n.lawfulBasis),H(n.status),Y(n)]})]}),e.warnings.length>0&&jsxRuntime.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium mb-1",children:"Warnings"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside space-y-1",children:e.warnings.map((u,N)=>jsxRuntime.jsx("li",{className:"text-xs text-yellow-700 dark:text-yellow-300",children:u},N))})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Description:"})," ",n.description]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Lawful Basis:"})," ",chunkTDDAYVKK_js.b(n.lawfulBasis)]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Justification:"})," ",n.lawfulBasisJustification]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Categories:"})," ",n.dataCategories.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Subject Categories:"})," ",n.dataSubjectCategories.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Purposes:"})," ",n.purposes.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Retention Period:"})," ",n.retentionPeriod,n.retentionJustification&&jsxRuntime.jsxs("span",{className:"text-gray-600 dark:text-gray-400",children:[" ","(",n.retentionJustification,")"]})]})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Sensitive Data:"})," ",n.involvesSensitiveData?"Yes":"No",n.sensitiveDataCondition&&jsxRuntime.jsxs("span",{children:[" ","(Condition:"," ",((l=X.find(u=>u.value===n.sensitiveDataCondition))==null?void 0:l.label)||n.sensitiveDataCondition,")"]})]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Cross-Border Transfer:"})," ",n.crossBorderTransfer?"Yes":"No"]}),n.recipients&&n.recipients.length>0&&jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Recipients:"})," ",n.recipients.join(", ")]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Created:"})," ",C(n.createdAt)]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Last Updated:"})," ",C(n.updatedAt)]}),n.reviewDate&&jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Next Review:"})," ",C(n.reviewDate),n.reviewDate<Date.now()&&jsxRuntime.jsx("span",{className:"text-red-600 dark:text-red-400 font-medium",children:" (Overdue)"})]})]})]}),n.dpoApproval&&jsxRuntime.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md mb-6",children:[jsxRuntime.jsx("h4",{className:"text-sm font-semibold mb-2",children:"DPO Approval"}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",n.dpoApproval.approved?"Approved":"Not Approved"]}),jsxRuntime.jsxs("p",{className:"text-sm mt-1",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Approved By:"})," ",n.dpoApproval.approvedBy]}),jsxRuntime.jsxs("p",{className:"text-sm mt-1",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Date:"})," ",C(n.dpoApproval.approvedAt)]}),n.dpoApproval.notes&&jsxRuntime.jsxs("p",{className:"text-sm mt-1",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Notes:"})," ",n.dpoApproval.notes]})]}),jsxRuntime.jsxs("div",{className:"flex space-x-3",children:[jsxRuntime.jsx("button",{onClick:()=>M(n),"aria-label":`Edit ${n.name}`,className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${m}`,children:"Edit"}),n.status!=="archived"&&jsxRuntime.jsx("button",{onClick:()=>G(n.id),"aria-label":`Archive ${n.name}`,className:`px-4 py-2 bg-gray-600 text-white rounded hover:bg-gray-700 ${m}`,children:"Archive"})]})]})},fe=()=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-4 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"basisFilter",className:"block text-sm font-medium mb-1",children:"Lawful Basis"}),jsxRuntime.jsxs("select",{id:"basisFilter",value:B,onChange:e=>oe(e.target.value),"aria-label":"Filter by lawful basis",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:[jsxRuntime.jsx("option",{value:"all",children:"All Bases"}),Q.map(e=>jsxRuntime.jsx("option",{value:e.value,children:e.label},e.value))]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"statusFilterSelect",className:"block text-sm font-medium mb-1",children:"Status"}),jsxRuntime.jsxs("select",{id:"statusFilterSelect",value:A,onChange:e=>ne(e.target.value),"aria-label":"Filter by status",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:[jsxRuntime.jsx("option",{value:"all",children:"All Statuses"}),jsxRuntime.jsx("option",{value:"active",children:"Active"}),jsxRuntime.jsx("option",{value:"inactive",children:"Inactive"}),jsxRuntime.jsx("option",{value:"under_review",children:"Under Review"}),jsxRuntime.jsx("option",{value:"archived",children:"Archived"})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"searchInput",className:"block text-sm font-medium mb-1",children:"Search"}),jsxRuntime.jsx("input",{type:"text",id:"searchInput",value:S,onChange:e=>de(e.target.value),placeholder:"Search activities...",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsx("div",{className:"flex items-end",children:jsxRuntime.jsx("button",{onClick:le,className:chunkE64TU6IU_js.a(`w-full px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${m}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:"Add Activity"})})]}),V.length===0?jsxRuntime.jsx("div",{className:"flex items-center justify-center h-32 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No processing activities found."})}):jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:chunkE64TU6IU_js.a("w-full text-sm text-left",r==null?void 0:r.table,o),children:[jsxRuntime.jsx("thead",{className:chunkE64TU6IU_js.a("text-xs uppercase bg-gray-50 dark:bg-gray-700",r==null?void 0:r.tableHeader,o),children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Activity"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Lawful Basis"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Status"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"DPO Approval"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Sensitive Data"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Last Updated"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Actions"})]})}),jsxRuntime.jsx("tbody",{children:V.map(e=>jsxRuntime.jsxs("tr",{className:chunkE64TU6IU_js.a("border-b border-gray-200 dark:border-gray-600 hover:bg-gray-50 dark:hover:bg-gray-700",r==null?void 0:r.tableRow,o),children:[jsxRuntime.jsxs("td",{className:"px-4 py-3",children:[jsxRuntime.jsx("button",{onClick:()=>ue(e.id),className:"font-medium text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline text-left",children:e.name}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mt-1 truncate max-w-xs",children:e.description})]}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:U(e.lawfulBasis)}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:H(e.status)}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:Y(e)}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:jsxRuntime.jsx("span",{className:`text-xs ${e.involvesSensitiveData?"text-orange-600 dark:text-orange-400 font-medium":"text-gray-600 dark:text-gray-400"}`,children:e.involvesSensitiveData?"Yes":"No"})}),jsxRuntime.jsx("td",{className:"px-4 py-3 text-xs text-gray-600 dark:text-gray-400",children:C(e.updatedAt)}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[jsxRuntime.jsx("button",{onClick:()=>M(e),"aria-label":`Edit ${e.name}`,className:"text-xs text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline",children:"Edit"}),e.status!=="archived"&&jsxRuntime.jsx("button",{onClick:()=>G(e.id),"aria-label":`Archive ${e.name}`,className:"text-xs text-gray-600 dark:text-gray-400 hover:underline",children:"Archive"})]})})]},e.id))})]})})]});return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${te}`,r==null?void 0:r.root,o),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",r==null?void 0:r.title,o),children:Z}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:ee}),re&&h==="list"&&pe(),ie&&h==="list"&&ge(),h==="list"&&fe(),h==="form"&&me(),h==="detail"&&ve()]})};exports.a=Ce;//# sourceMappingURL=chunk-UO6QPJLH.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-UO6QPJLH.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import {e}from'./chunk-CDZDT2OS.mjs';import {a}from'./chunk-AYKLAEOU.mjs';import {d,b,a as a$1}from'./chunk-WWT2ZSNU.mjs';import Gr,{useId,useState,useEffect}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var br=["Organization","Data Collection","Processing","Review & Export"],vr=({currentStep:d,classNames:p,unstyled:r})=>jsx("nav",{"data-ndpr-component":"policy-step-indicator","aria-label":"Policy wizard progress",className:a("w-full flex items-center justify-between px-2 py-4",p==null?void 0:p.root,r),children:br.map((o,n)=>{let t=n+1,i=t<d,a$1=t===d,v=n===br.length-1;return jsxs(Gr.Fragment,{children:[jsxs("div",{className:a("flex flex-col items-center gap-1",p==null?void 0:p.stepWrapper,r),children:[jsx("div",{"aria-current":a$1?"step":void 0,"aria-label":`Step ${t}: ${o}${i?" (completed)":a$1?" (current)":""}`,className:a(["flex items-center justify-center rounded-full border-2 font-semibold transition-all",i?"w-8 h-8 bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))]":a$1?"w-9 h-9 bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] shadow-md":"w-8 h-8 bg-white dark:bg-gray-900 border-gray-300 dark:border-gray-600 text-gray-400 dark:text-gray-500"].join(" "),i?p==null?void 0:p.stepCompleted:a$1?p==null?void 0:p.stepCurrent:p==null?void 0:p.stepUpcoming,r),children:i?jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):jsx("span",{className:"text-xs leading-none",children:t})}),jsx("span",{className:a(["text-xs font-medium hidden sm:block",i||a$1?"text-[rgb(var(--ndpr-primary))]":"text-gray-400 dark:text-gray-500"].join(" "),p==null?void 0:p.stepLabel,r),children:o})]}),!v&&jsx("div",{className:a(["flex-1 h-0.5 mx-2",i?"bg-[rgb(var(--ndpr-primary))]":"bg-gray-200 dark:bg-gray-700"].join(" "),p==null?void 0:p.connector,r),"aria-hidden":"true"})]},t)})});var $="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",Vr="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",A=({id:d,label:p,required:r,description:o,children:n,classNames:t,unstyled:i})=>{let a$1=o?`${d}-desc`:void 0;return jsxs("div",{className:a("flex flex-col",t==null?void 0:t.field,i),children:[jsxs("label",{htmlFor:d,className:a(Vr,t==null?void 0:t.label,i),children:[p,r&&jsx("span",{className:"text-red-500 ml-0.5","aria-hidden":"true",children:"*"})]}),o&&jsx("p",{id:a$1,className:"text-xs text-gray-500 dark:text-gray-400 mb-1",children:o}),n]})},yr=({context:d,onUpdateOrg:p,classNames:r,unstyled:o})=>{var i,a$1,x;let n=useId(),t=d.org;return jsxs("div",{"data-ndpr-component":"policy-step-about",className:a("space-y-6",r==null?void 0:r.root,o),children:[jsxs("div",{children:[jsx("h2",{className:a("text-xl font-semibold text-gray-900 dark:text-gray-100",r==null?void 0:r.heading,o),children:"Organisation Details"}),jsxs("p",{className:a("text-sm text-gray-500 dark:text-gray-400 mt-1",r==null?void 0:r.subheading,o),children:["Tell us about your organisation. Fields marked ",jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})," are required."]})]}),jsxs("div",{className:a("grid grid-cols-1 md:grid-cols-2 gap-4",r==null?void 0:r.grid,o),children:[jsx(A,{id:`${n}-org-name`,label:"Organisation Name",required:true,classNames:r,unstyled:o,children:jsx("input",{id:`${n}-org-name`,type:"text",value:t.name,onChange:v=>p({name:v.target.value}),placeholder:"Acme Corporation",className:a($,r==null?void 0:r.input,o),"aria-required":"true"})}),jsx(A,{id:`${n}-website`,label:"Website",required:true,classNames:r,unstyled:o,children:jsx("input",{id:`${n}-website`,type:"url",value:t.website,onChange:v=>p({website:v.target.value}),placeholder:"https://example.com",className:a($,r==null?void 0:r.input,o),"aria-required":"true"})}),jsx(A,{id:`${n}-privacy-email`,label:"Privacy Contact Email",required:true,classNames:r,unstyled:o,children:jsx("input",{id:`${n}-privacy-email`,type:"email",value:t.privacyEmail,onChange:v=>p({privacyEmail:v.target.value}),placeholder:"privacy@example.com",className:a($,r==null?void 0:r.input,o),"aria-required":"true"})}),jsx(A,{id:`${n}-industry`,label:"Industry",classNames:r,unstyled:o,children:jsxs("select",{id:`${n}-industry`,value:t.industry,onChange:v=>p({industry:v.target.value}),className:a($,r==null?void 0:r.select,o),children:[jsx("option",{value:"fintech",children:"Fintech"}),jsx("option",{value:"healthcare",children:"Healthcare"}),jsx("option",{value:"ecommerce",children:"E-commerce"}),jsx("option",{value:"saas",children:"SaaS"}),jsx("option",{value:"education",children:"Education"}),jsx("option",{value:"government",children:"Government"}),jsx("option",{value:"other",children:"Other"})]})}),jsx(A,{id:`${n}-dpo-name`,label:"Data Protection Officer (DPO) Name",classNames:r,unstyled:o,children:jsx("input",{id:`${n}-dpo-name`,type:"text",value:(i=t.dpoName)!=null?i:"",onChange:v=>p({dpoName:v.target.value}),placeholder:"Jane Smith",className:a($,r==null?void 0:r.input,o)})}),jsx(A,{id:`${n}-dpo-email`,label:"DPO Email",classNames:r,unstyled:o,children:jsx("input",{id:`${n}-dpo-email`,type:"email",value:(a$1=t.dpoEmail)!=null?a$1:"",onChange:v=>p({dpoEmail:v.target.value}),placeholder:"dpo@example.com",className:a($,r==null?void 0:r.input,o)})}),jsx(A,{id:`${n}-address`,label:"Registered Address",classNames:r,unstyled:o,children:jsx("input",{id:`${n}-address`,type:"text",value:(x=t.address)!=null?x:"",onChange:v=>p({address:v.target.value}),placeholder:"1 Victoria Island, Lagos, Nigeria",className:a($,r==null?void 0:r.input,o)})}),jsx(A,{id:`${n}-org-size`,label:"Organisation Size",classNames:r,unstyled:o,children:jsxs("select",{id:`${n}-org-size`,value:t.orgSize,onChange:v=>p({orgSize:v.target.value}),className:a($,r==null?void 0:r.select,o),children:[jsx("option",{value:"startup",children:"Startup (1\u201350 employees)"}),jsx("option",{value:"midsize",children:"Mid-size (51\u2013500 employees)"}),jsx("option",{value:"enterprise",children:"Enterprise (500+ employees)"})]})}),jsx(A,{id:`${n}-country`,label:"Country of Operation",classNames:r,unstyled:o,children:jsx("input",{id:`${n}-country`,type:"text",value:t.country,onChange:v=>p({country:v.target.value}),placeholder:"Nigeria",className:a($,r==null?void 0:r.input,o)})})]})]})};var Xr={identity:"Identity",financial:"Financial",behavioral:"Behavioural",sensitive:"Sensitive",children:"Children"},Yr=["identity","financial","behavioral","sensitive","children"],Jr=["sensitive","children"],lr=({categories:d,onToggle:p,classNames:r,unstyled:o})=>{let n=Yr.reduce((t,i)=>{let a=d.filter(x=>x.group===i);return a.length>0&&(t[i]=a),t},{});return jsxs("div",{"data-ndpr-component":"policy-step-data",className:a("space-y-8",r==null?void 0:r.root,o),children:[jsxs("div",{children:[jsx("h2",{className:a("text-xl font-semibold text-gray-900 dark:text-gray-100",r==null?void 0:r.heading,o),children:"Data Categories"}),jsx("p",{id:"data-categories-desc",className:a("text-sm text-gray-500 dark:text-gray-400 mt-1",r==null?void 0:r.subheading,o),children:"Select the categories of personal data your organisation collects. You must select at least one."})]}),Object.entries(n).map(([t,i])=>{let a$1=Jr.includes(t);return jsxs("div",{className:a("space-y-3",r==null?void 0:r.group,o),children:[jsxs("div",{className:a("flex items-center gap-2",r==null?void 0:r.groupHeader,o),children:[jsx("h3",{className:a("text-sm font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400",r==null?void 0:r.groupTitle,o),children:Xr[t]}),a$1&&jsx("span",{className:a("text-xs font-medium text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-900/20 px-2 py-0.5 rounded-full",r==null?void 0:r.sensitiveTag,o),children:"Sensitive"})]}),a$1&&jsx("p",{className:a("text-xs text-amber-700 dark:text-amber-400",r==null?void 0:r.sensitiveWarning,o),children:t==="children"?"Processing children's data requires parental consent under NDPA Section 31 and imposes heightened obligations.":"Sensitive/special-category data requires explicit consent and additional safeguards under NDPA Section 30."}),jsx("div",{className:a("grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",r==null?void 0:r.cardsGrid,o),children:i.map(x=>jsx("button",{type:"button",onClick:()=>p(x.id),"aria-pressed":x.selected,className:a(["text-left rounded-lg border p-4 transition-all cursor-pointer focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",x.selected?"bg-[rgb(var(--ndpr-primary))]/5 border-[rgb(var(--ndpr-primary))] dark:bg-[rgb(var(--ndpr-primary))]/10":"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"].join(" "),r==null?void 0:r.card,o),children:jsxs("div",{className:"flex items-start gap-3",children:[jsx("div",{className:a(["mt-0.5 w-4 h-4 rounded border-2 flex-shrink-0 flex items-center justify-center",x.selected?"bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))]":"border-gray-300 dark:border-gray-600"].join(" "),r==null?void 0:r.checkbox,o),"aria-hidden":"true",children:x.selected&&jsx("svg",{className:"w-2.5 h-2.5 text-[rgb(var(--ndpr-primary-foreground))]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),jsxs("div",{className:"min-w-0",children:[jsx("p",{className:a("text-sm font-medium text-gray-900 dark:text-gray-100",r==null?void 0:r.cardLabel,o),children:x.label}),jsx("p",{className:a("text-xs text-gray-500 dark:text-gray-400 mt-1 leading-relaxed",r==null?void 0:r.cardDataPoints,o),children:x.dataPoints.join(", ")})]})]})},x.id))})]},t)})]})};var Qr=[{value:"service_delivery",label:"Service Delivery",description:"Processing required to deliver the core product or service."},{value:"marketing",label:"Marketing & Communications",description:"Sending promotional messages, newsletters or offers."},{value:"analytics",label:"Analytics & Insights",description:"Analysing usage patterns to improve the product."},{value:"research",label:"Research & Development",description:"Using data to develop new features or products."},{value:"legal_compliance",label:"Legal Compliance",description:"Meeting statutory, regulatory or contractual obligations."},{value:"fraud_prevention",label:"Fraud Prevention & Security",description:"Detecting and preventing fraudulent activity."}],dr="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",pr="bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-4",gr=({id:d,checked:p,onChange:r})=>jsx("button",{id:d,type:"button",role:"switch","aria-checked":p,onClick:()=>r(!p),className:["relative inline-flex h-6 w-11 flex-shrink-0 rounded-full border-2 border-transparent cursor-pointer transition-colors focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",p?"bg-[rgb(var(--ndpr-primary))]":"bg-gray-200 dark:bg-gray-600"].join(" "),children:jsx("span",{"aria-hidden":"true",className:["pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition-transform",p?"translate-x-5":"translate-x-0"].join(" ")})}),fr=({context:d,onTogglePurpose:p,onUpdateContext:r,onAddProcessor:o,onRemoveProcessor:n,classNames:t,unstyled:i})=>{let a$2=useId(),[x,v]=useState({name:"",purpose:"",country:""}),[k,g]=useState(false),u=()=>{let{name:b,purpose:h,country:m}=x;!b.trim()||!h.trim()||!m.trim()||(o({name:b.trim(),purpose:h.trim(),country:m.trim()}),v({name:"",purpose:"",country:""}),g(false));};return jsxs("div",{"data-ndpr-component":"policy-step-processing",className:a("space-y-6",t==null?void 0:t.root,i),children:[jsxs("div",{children:[jsx("h2",{className:a("text-xl font-semibold text-gray-900 dark:text-gray-100",t==null?void 0:t.heading,i),children:"Processing Details"}),jsx("p",{className:a("text-sm text-gray-500 dark:text-gray-400 mt-1",t==null?void 0:t.subheading,i),children:"Define how and why you process personal data."})]}),jsxs("section",{className:a(pr,t==null?void 0:t.section,i),"aria-labelledby":"purposes-heading",children:[jsx("h3",{id:"purposes-heading",className:a("text-base font-semibold text-gray-900 dark:text-gray-100",t==null?void 0:t.sectionTitle,i),children:"Processing Purposes"}),jsx("p",{className:a("text-sm text-gray-500 dark:text-gray-400",t==null?void 0:t.sectionDescription,i),children:"Select all purposes for which you process personal data. At least one is required."}),jsx("div",{className:a("space-y-3",t==null?void 0:t.purposeList,i),children:Qr.map(b=>{let h=d.purposes.includes(b.value),m=`${a$2}-purpose-${b.value}`,z=`${a$2}-purpose-desc-${b.value}`;return jsxs("label",{htmlFor:m,className:a("flex items-start gap-3 cursor-pointer group",t==null?void 0:t.purposeItem,i),children:[jsx("input",{id:m,type:"checkbox",checked:h,onChange:()=>p(b.value),"aria-describedby":z,className:a("mt-0.5 h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))] cursor-pointer",t==null?void 0:t.purposeCheckbox,i)}),jsxs("div",{children:[jsx("p",{className:a("text-sm font-medium text-gray-900 dark:text-gray-100",t==null?void 0:t.purposeLabel,i),children:b.label}),jsx("p",{id:z,className:a("text-xs text-gray-500 dark:text-gray-400",t==null?void 0:t.purposeDescription,i),children:b.description})]})]},b.value)})})]}),jsxs("section",{className:a(pr,t==null?void 0:t.section,i),"aria-labelledby":"thirdparty-heading",children:[jsxs("div",{className:"flex items-center justify-between",children:[jsx("h3",{id:"thirdparty-heading",className:a("text-base font-semibold text-gray-900 dark:text-gray-100",t==null?void 0:t.sectionTitle,i),children:"Third-Party Data Sharing"}),jsx(gr,{id:`${a$2}-thirdparty-toggle`,checked:d.thirdPartyProcessors.length>0||k,onChange:b=>{b?g(true):(d.thirdPartyProcessors.forEach((h,m)=>n(0)),g(false));}})]}),(d.thirdPartyProcessors.length>0||k)&&jsxs("div",{className:a("space-y-4",t==null?void 0:t.processorSection,i),children:[d.thirdPartyProcessors.length>0&&jsx("div",{className:a("overflow-x-auto",t==null?void 0:t.processorTable,i),children:jsxs("table",{className:"w-full text-sm",children:[jsx("thead",{children:jsxs("tr",{className:a("text-left text-xs font-medium text-gray-500 dark:text-gray-400 border-b border-gray-200 dark:border-gray-700",t==null?void 0:t.tableHeader,i),children:[jsx("th",{className:"pb-2 pr-4",children:"Name"}),jsx("th",{className:"pb-2 pr-4",children:"Purpose"}),jsx("th",{className:"pb-2 pr-4",children:"Country"}),jsx("th",{className:"pb-2"})]})}),jsx("tbody",{className:"divide-y divide-gray-100 dark:divide-gray-700",children:d.thirdPartyProcessors.map((b,h)=>jsxs("tr",{children:[jsx("td",{className:a("py-2 pr-4 text-gray-900 dark:text-gray-100",t==null?void 0:t.tableCell,i),children:b.name}),jsx("td",{className:a("py-2 pr-4 text-gray-700 dark:text-gray-300",t==null?void 0:t.tableCell,i),children:b.purpose}),jsx("td",{className:a("py-2 pr-4 text-gray-700 dark:text-gray-300",t==null?void 0:t.tableCell,i),children:b.country}),jsx("td",{className:"py-2",children:jsx("button",{type:"button",onClick:()=>n(h),className:a("text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300 text-xs font-medium",t==null?void 0:t.removeButton,i),"aria-label":`Remove ${b.name}`,children:"Remove"})})]},h))})]})}),k?jsxs("div",{className:a("grid grid-cols-1 sm:grid-cols-3 gap-3 items-end",t==null?void 0:t.processorForm,i),children:[jsxs("div",{children:[jsx("label",{htmlFor:`${a$2}-proc-name`,className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Processor Name"}),jsx("input",{id:`${a$2}-proc-name`,type:"text",placeholder:"Processor name",value:x.name,onChange:b$1=>v(h=>b(a$1({},h),{name:b$1.target.value})),"aria-required":"true",className:a(dr,t==null?void 0:t.input,i)})]}),jsxs("div",{children:[jsx("label",{htmlFor:`${a$2}-proc-purpose`,className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Purpose"}),jsx("input",{id:`${a$2}-proc-purpose`,type:"text",placeholder:"Purpose",value:x.purpose,onChange:b$1=>v(h=>b(a$1({},h),{purpose:b$1.target.value})),"aria-required":"true",className:a(dr,t==null?void 0:t.input,i)})]}),jsxs("div",{children:[jsx("label",{htmlFor:`${a$2}-proc-country`,className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Country"}),jsx("input",{id:`${a$2}-proc-country`,type:"text",placeholder:"Country",value:x.country,onChange:b$1=>v(h=>b(a$1({},h),{country:b$1.target.value})),"aria-required":"true",className:a(dr,t==null?void 0:t.input,i)})]}),jsxs("div",{className:"sm:col-span-3 flex gap-2",children:[jsx("button",{type:"button",onClick:u,className:a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium",t==null?void 0:t.addButton,i),children:"Add Processor"}),jsx("button",{type:"button",onClick:()=>g(false),className:a("px-4 py-2 bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-white rounded-md text-sm",t==null?void 0:t.cancelButton,i),children:"Cancel"})]})]}):jsxs("button",{type:"button",onClick:()=>g(true),className:a("flex items-center gap-1 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",t==null?void 0:t.addLink,i),children:[jsx("span",{"aria-hidden":"true",children:"+"})," Add processor"]})]})]}),jsxs("section",{className:a(pr,t==null?void 0:t.section,i),"aria-labelledby":"disclosures-heading",children:[jsx("h3",{id:"disclosures-heading",className:a("text-base font-semibold text-gray-900 dark:text-gray-100",t==null?void 0:t.sectionTitle,i),children:"Additional Disclosures"}),jsxs("div",{className:a("space-y-4",t==null?void 0:t.disclosureList,i),children:[jsxs("div",{className:a("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxs("div",{children:[jsx("p",{id:`${a$2}-cross-border-label`,className:a("text-sm font-medium text-gray-900 dark:text-gray-100",t==null?void 0:t.disclosureLabel,i),children:"Cross-border Data Transfers"}),jsx("p",{id:`${a$2}-cross-border-desc`,className:a("text-xs text-gray-500 dark:text-gray-400 mt-0.5",t==null?void 0:t.disclosureDescription,i),children:"Do you transfer personal data outside Nigeria? This triggers NDPA Chapter 6 obligations."})]}),jsx(gr,{id:`${a$2}-cross-border-toggle`,checked:d.hasCrossBorderTransfer,onChange:b=>r({hasCrossBorderTransfer:b})})]}),jsxs("div",{className:a("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxs("div",{children:[jsx("p",{id:`${a$2}-automated-label`,className:a("text-sm font-medium text-gray-900 dark:text-gray-100",t==null?void 0:t.disclosureLabel,i),children:"Automated Decision-Making / Profiling"}),jsx("p",{id:`${a$2}-automated-desc`,className:a("text-xs text-gray-500 dark:text-gray-400 mt-0.5",t==null?void 0:t.disclosureDescription,i),children:"Do you use algorithms or AI to make decisions about individuals? Requires disclosure under NDPA Section 37."})]}),jsx(gr,{id:`${a$2}-automated-toggle`,checked:d.hasAutomatedDecisions,onChange:b=>r({hasAutomatedDecisions:b})})]})]})]})]})};var kr=({section:d,index:p,isCustom:r,isEditing:o,editedContent:n,onEdit:t,onSaveEdit:i,onCancelEdit:a$1,onMoveUp:x,onMoveDown:v,onDelete:k,classNames:g,unstyled:u})=>{let[b,h]=useState(n!=null?n:d.template);return useEffect(()=>{n!==void 0&&h(n);},[n]),useEffect(()=>{o&&h(n!=null?n:d.template);},[o,n,d.template]),jsxs("div",{"data-ndpr-component":"policy-section-card",className:a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-3",g==null?void 0:g.root,u),children:[jsxs("div",{className:a("flex items-start justify-between gap-2",g==null?void 0:g.header,u),children:[jsxs("div",{className:a("flex items-center gap-3 min-w-0",g==null?void 0:g.titleRow,u),children:[jsx("span",{className:a("flex-shrink-0 w-7 h-7 rounded-full bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-300 text-xs font-semibold flex items-center justify-center",g==null?void 0:g.sectionNumber,u),"aria-hidden":"true",children:p+1}),jsxs("h4",{className:a("text-sm font-semibold text-gray-900 dark:text-gray-100 truncate",g==null?void 0:g.sectionTitle,u),children:[d.title,r&&jsx("span",{className:a("ml-2 text-xs font-normal text-gray-500 dark:text-gray-400 bg-gray-100 dark:bg-gray-700 px-1.5 py-0.5 rounded",g==null?void 0:g.customBadge,u),children:"Custom"})]})]}),jsxs("div",{className:a("flex items-center gap-1 flex-shrink-0",g==null?void 0:g.actions,u),children:[x&&jsx("button",{type:"button",onClick:x,className:a("p-1.5 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",g==null?void 0:g.moveButton,u),"aria-label":`Move "${d.title}" up`,children:jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})})}),v&&jsx("button",{type:"button",onClick:v,className:a("p-1.5 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",g==null?void 0:g.moveButton,u),"aria-label":`Move "${d.title}" down`,children:jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}),!o&&jsx("button",{type:"button",onClick:t,className:a("p-1.5 text-gray-400 hover:text-[rgb(var(--ndpr-primary))] rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",g==null?void 0:g.editButton,u),"aria-label":`Edit "${d.title}"`,children:jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),r&&k&&jsx("button",{type:"button",onClick:k,className:a("p-1.5 text-gray-400 hover:text-red-500 dark:hover:text-red-400 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",g==null?void 0:g.deleteButton,u),"aria-label":`Delete "${d.title}"`,children:jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]}),o?jsxs("div",{className:a("space-y-2",g==null?void 0:g.editArea,u),children:[jsx("textarea",{value:b,onChange:m=>h(m.target.value),rows:8,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm font-mono resize-y",g==null?void 0:g.textarea,u),"aria-label":`Edit content for ${d.title}`}),jsxs("div",{className:a("flex gap-2",g==null?void 0:g.editActions,u),children:[jsx("button",{type:"button",onClick:()=>i(b),className:a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium",g==null?void 0:g.saveButton,u),children:"Save"}),jsx("button",{type:"button",onClick:a$1,className:a("px-4 py-2 bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-white rounded-md text-sm",g==null?void 0:g.cancelButton,u),children:"Cancel"})]})]}):jsx("div",{className:a("text-sm text-gray-600 dark:text-gray-300 leading-relaxed line-clamp-4 whitespace-pre-wrap",g==null?void 0:g.content,u),children:d.template})]})};var Cr="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",wr=({onAdd:d,nextOrder:p,classNames:r,unstyled:o})=>{let n=useId(),[t,i]=useState(""),[a$1,x]=useState(""),[v,k]=useState(""),g=()=>{if(!t.trim()){k("Section title is required.");return}if(!a$1.trim()){k("Section content is required.");return}k(""),d({title:t.trim(),content:a$1.trim(),order:p}),i(""),x("");};return jsxs("div",{"data-ndpr-component":"custom-section-form",className:a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-4",r==null?void 0:r.root,o),children:[jsx("h4",{className:a("text-sm font-semibold text-gray-900 dark:text-gray-100",r==null?void 0:r.heading,o),children:"Add Custom Section"}),v&&jsx("p",{role:"alert",className:a("text-xs text-red-600 dark:text-red-400",r==null?void 0:r.error,o),children:v}),jsxs("div",{className:a("space-y-3",r==null?void 0:r.fields,o),children:[jsxs("div",{children:[jsxs("label",{htmlFor:`${n}-custom-section-title`,className:a("block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",r==null?void 0:r.label,o),children:["Section Title ",jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsx("input",{id:`${n}-custom-section-title`,type:"text",value:t,onChange:u=>{i(u.target.value),v&&k("");},placeholder:"e.g. Cookie Policy",className:a(Cr,r==null?void 0:r.input,o),"aria-required":"true"})]}),jsxs("div",{children:[jsxs("label",{htmlFor:`${n}-custom-section-content`,className:a("block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",r==null?void 0:r.label,o),children:["Content ",jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsx("textarea",{id:`${n}-custom-section-content`,value:a$1,onChange:u=>{x(u.target.value),v&&k("");},placeholder:"Write the section content here...",rows:5,className:a(`${Cr} resize-y`,r==null?void 0:r.textarea,o),"aria-required":"true"})]})]}),jsx("div",{className:a("flex items-center gap-2",r==null?void 0:r.footer,o),children:jsx("button",{type:"button",onClick:g,className:a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium",r==null?void 0:r.addButton,o),children:"Add Section"})})]})};var mr={compliant:{bg:"bg-green-50 dark:bg-green-900/20",text:"text-green-700 dark:text-green-300",border:"border-green-200 dark:border-green-700"},nearly_compliant:{bg:"bg-amber-50 dark:bg-amber-900/20",text:"text-amber-700 dark:text-amber-300",border:"border-amber-200 dark:border-amber-700"},not_compliant:{bg:"bg-red-50 dark:bg-red-900/20",text:"text-red-700 dark:text-red-300",border:"border-red-200 dark:border-red-700"}},sr={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},N=({icon:d,label:p,description:r,actionLabel:o,loading:n,onClick:t,classNames:i,unstyled:a$1})=>jsxs("div",{className:a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 flex flex-col gap-3",i==null?void 0:i.formatCard,a$1),children:[jsxs("div",{className:a("flex items-center gap-3",i==null?void 0:i.formatHeader,a$1),children:[jsx("div",{className:a("w-10 h-10 rounded-lg bg-gray-100 dark:bg-gray-700 flex items-center justify-center flex-shrink-0",i==null?void 0:i.formatIcon,a$1),"aria-hidden":"true",children:d}),jsxs("div",{className:"min-w-0",children:[jsx("p",{className:a("text-sm font-semibold text-gray-900 dark:text-gray-100",i==null?void 0:i.formatLabel,a$1),children:p}),jsx("p",{className:a("text-xs text-gray-500 dark:text-gray-400",i==null?void 0:i.formatDescription,a$1),children:r})]})]}),jsx("button",{type:"button",onClick:t,disabled:n,className:a("w-full px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2",i==null?void 0:i.formatButton,a$1),children:n?jsxs(Fragment,{children:[jsxs("svg",{className:"animate-spin w-4 h-4",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),"Generating\u2026"]}):o})]}),Sr=({complianceResult:d$1,onExportPDF:p,onExportDOCX:r,onExportHTML:o,onExportMarkdown:n,classNames:t,unstyled:i})=>{var h;let[a$1,x]=useState(false),[v,k]=useState(false),g=(h=mr[d$1.rating])!=null?h:mr.not_compliant,u=()=>d(null,null,function*(){x(true);try{yield p();}finally{x(false);}}),b=()=>d(null,null,function*(){k(true);try{yield r();}finally{k(false);}});return jsxs("div",{"data-ndpr-component":"policy-export-panel",className:a("space-y-6",t==null?void 0:t.root,i),children:[jsxs("div",{className:a(`rounded-lg border p-4 flex items-center gap-4 ${g.bg} ${g.border}`,t==null?void 0:t.complianceSummary,i),children:[jsxs("div",{className:a(`text-3xl font-bold ${g.text}`,t==null?void 0:t.complianceScore,i),"aria-label":`Compliance score: ${d$1.percentage}%`,children:[d$1.percentage,"%"]}),jsxs("div",{children:[jsx("p",{className:a(`text-sm font-semibold ${g.text}`,t==null?void 0:t.complianceRating,i),children:sr[d$1.rating]}),jsxs("p",{className:a("text-xs text-gray-500 dark:text-gray-400 mt-0.5",t==null?void 0:t.complianceDetail,i),children:[d$1.score," / ",d$1.maxScore," points \u2022"," ",d$1.gaps.length," gap",d$1.gaps.length!==1?"s":""," remaining"]})]})]}),jsxs("div",{children:[jsx("h3",{className:a("text-sm font-semibold text-gray-900 dark:text-gray-100 mb-3",t==null?void 0:t.formatsHeading,i),children:"Export Format"}),jsxs("div",{className:a("grid grid-cols-1 sm:grid-cols-2 gap-3",t==null?void 0:t.formatsGrid,i),children:[jsx(N,{icon:jsx("svg",{className:"w-5 h-5 text-red-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-3 7v-1h4v1h-4zm0-3v-1h4v1h-4zm-2-5h8v1H8v-1z"})}),label:"PDF",description:"Professional formatted document, ideal for publishing.",actionLabel:"Download PDF",loading:a$1,onClick:u,classNames:t,unstyled:i}),jsx(N,{icon:jsx("svg",{className:"w-5 h-5 text-blue-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-5 8v-5h1.5l1 3 1-3H13v5h-1v-3.5l-.75 2.25h-.5L10 13.5V17H9zm5-1.5h.75c.55 0 .75-.25.75-.75 0-.4-.2-.65-.75-.65H14V15.5zm1 1.5h-2v-4h2c1.1 0 1.75.6 1.75 1.5 0 .55-.25.95-.65 1.15.5.2.8.65.8 1.2 0 1-.65 1.65-1.9 1.65V17zm-.25-1c.6 0 .9-.25.9-.75 0-.45-.3-.75-.9-.75H14V16h.75z"})}),label:"DOCX",description:"Editable Word document for further customisation.",actionLabel:"Download DOCX",loading:v,onClick:b,classNames:t,unstyled:i}),jsx(N,{icon:jsxs("svg",{className:"w-5 h-5 text-orange-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 15H9V8h2v9zm4 0h-2V8h2v9z"}),jsx("path",{d:"M9.5 6.5h1v1h-1zm4 0h1v1h-1z"}),jsx("path",{d:"M5 5h14v2H5zm0 12h14v2H5z"})]}),label:"HTML",description:"Copy-ready HTML to embed on your website.",actionLabel:"Copy HTML",onClick:o,classNames:t,unstyled:i}),jsx(N,{icon:jsx("svg",{className:"w-5 h-5 text-gray-500 dark:text-gray-300",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsx("path",{d:"M3 5h18v2H3V5zm0 4h12v2H3V9zm0 4h18v2H3v-2zm0 4h12v2H3v-2z"})}),label:"Markdown",description:"Plain-text format for documentation or Git repos.",actionLabel:"Copy Markdown",onClick:n,classNames:t,unstyled:i})]})]})]})};var Lr=({sections:d,customSections:p,sectionOverrides:r,complianceResult:o,onEditSection:n,onAddCustomSection:t,onRemoveCustomSection:i,onReorderSection:a$2,onExportPDF:x,onExportDOCX:v,onExportHTML:k,onExportMarkdown:g,classNames:u,unstyled:b$1})=>{let[h,m]=useState(null),[z,J]=useState(false),Z=new Set(p.map(f=>f.id)),er=(f,D)=>{n(f,D),m(null);},or=d.length>0?Math.max(...d.map(f=>{var D;return (D=f.order)!=null?D:0}))+1:1;return jsxs("div",{"data-ndpr-component":"policy-step-review",className:a("space-y-6",u==null?void 0:u.root,b$1),children:[jsxs("div",{children:[jsx("h2",{className:a("text-xl font-semibold text-gray-900 dark:text-gray-100",u==null?void 0:u.heading,b$1),children:"Review & Export"}),jsx("p",{className:a("text-sm text-gray-500 dark:text-gray-400 mt-1",u==null?void 0:u.subheading,b$1),children:"Review your generated policy sections, reorder or edit content, then export."})]}),jsx("div",{className:a("space-y-3",u==null?void 0:u.sectionList,b$1),"aria-live":"polite",children:d.map((f,D)=>jsx(kr,{section:r[f.id]?b(a$1({},f),{template:r[f.id]}):f,index:D,isCustom:Z.has(f.id),isEditing:h===f.id,editedContent:r[f.id],onEdit:()=>m(f.id),onSaveEdit:ir=>er(f.id,ir),onCancelEdit:()=>m(null),onMoveUp:D>0?()=>a$2(f.id,"up"):void 0,onMoveDown:D<d.length-1?()=>a$2(f.id,"down"):void 0,onDelete:Z.has(f.id)?()=>i(f.id):void 0,classNames:u,unstyled:b$1},f.id))}),!z&&jsxs("button",{type:"button",onClick:()=>J(true),className:a("flex items-center gap-2 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",u==null?void 0:u.addSectionButton,b$1),children:[jsx("span",{className:a("w-5 h-5 rounded-full border-2 border-[rgb(var(--ndpr-primary))] flex items-center justify-center text-xs font-bold leading-none",u==null?void 0:u.addSectionIcon,b$1),"aria-hidden":"true",children:"+"}),"Add Custom Section"]}),z&&jsxs("div",{className:a("space-y-2",u==null?void 0:u.customFormWrapper,b$1),children:[jsx(wr,{onAdd:f=>{t(f),J(false);},nextOrder:or,classNames:u,unstyled:b$1}),jsx("button",{type:"button",onClick:()=>J(false),className:a("text-sm text-gray-500 dark:text-gray-400 hover:underline",u==null?void 0:u.cancelCustomForm,b$1),children:"Cancel"})]}),jsx("hr",{className:a("border-gray-200 dark:border-gray-700",u==null?void 0:u.divider,b$1)}),jsx(Sr,{complianceResult:o,onExportPDF:x,onExportDOCX:v,onExportHTML:k,onExportMarkdown:g,classNames:u,unstyled:b$1})]})};var Dr={compliant:{stroke:"stroke-green-500 dark:stroke-green-400",text:"text-green-600 dark:text-green-400"},nearly_compliant:{stroke:"stroke-amber-500 dark:stroke-amber-400",text:"text-amber-600 dark:text-amber-400"},not_compliant:{stroke:"stroke-red-500 dark:stroke-red-400",text:"text-red-600 dark:text-red-400"}},tt={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},Fr=({score:d,maxScore:p,rating:r,classNames:o,unstyled:n})=>{var k,g;let t=p>0?Math.round(d/p*100):0,i=(k=Dr[r])!=null?k:Dr.not_compliant,a$1=36,x=2*Math.PI*a$1,v=x-t/100*x;return jsxs("div",{"data-ndpr-component":"compliance-score-ring",className:a("flex flex-col items-center gap-2",o==null?void 0:o.root,n),children:[jsxs("div",{className:a("relative w-24 h-24",o==null?void 0:o.svgWrapper,n),children:[jsxs("svg",{className:"w-24 h-24 -rotate-90",viewBox:"0 0 96 96","aria-hidden":"true",children:[jsx("circle",{cx:"48",cy:"48",r:a$1,fill:"none",className:"stroke-gray-200 dark:stroke-gray-700",strokeWidth:"8"}),jsx("circle",{cx:"48",cy:"48",r:a$1,fill:"none",className:i.stroke,strokeWidth:"8",strokeLinecap:"round",strokeDasharray:x,strokeDashoffset:v,style:{transition:"stroke-dashoffset 0.5s ease-out"}})]}),jsx("div",{className:a("absolute inset-0 flex flex-col items-center justify-center",o==null?void 0:o.centerText,n),children:jsxs("span",{className:a(`text-xl font-bold leading-none ${i.text}`,o==null?void 0:o.scoreValue,n),"aria-label":`${t}% compliance score`,children:[t,"%"]})})]}),jsx("p",{className:a(`text-xs font-semibold text-center ${i.text}`,o==null?void 0:o.ratingLabel,n),children:(g=tt[r])!=null?g:r}),jsxs("p",{className:a("text-xs text-gray-500 dark:text-gray-400 text-center",o==null?void 0:o.scoreDetail,n),children:[d," / ",p," pts"]})]})};var ot={critical:"text-red-600 dark:text-red-400",important:"text-amber-600 dark:text-amber-400",recommended:"text-blue-600 dark:text-blue-400"},Er=({gap:d,isPassed:p,onFix:r,classNames:o,unstyled:n})=>{let[t,i]=useState(false);return jsxs("div",{"data-ndpr-component":"compliance-requirement-item",className:a("border-b border-gray-100 dark:border-gray-700 last:border-0 py-2",o==null?void 0:o.root,n),children:[jsxs("button",{type:"button",onClick:()=>!p&&i(a=>!a),className:a("w-full flex items-start gap-2 text-left group",o==null?void 0:o.row,n),"aria-expanded":p?void 0:t,"aria-disabled":p,children:[jsx("span",{className:a(["mt-0.5 flex-shrink-0 w-4 h-4 rounded-full flex items-center justify-center",p?"bg-green-500":d.severity==="critical"?"bg-red-500":d.severity==="important"?"bg-amber-500":"bg-blue-400"].join(" "),o==null?void 0:o.statusIcon,n),"aria-hidden":"true",children:p?jsx("svg",{className:"w-2.5 h-2.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):jsx("svg",{className:"w-2.5 h-2.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("div",{className:"flex items-center justify-between gap-1",children:[jsx("p",{className:a(`text-xs font-medium ${p?"text-gray-700 dark:text-gray-300":"text-gray-900 dark:text-gray-100"}`,o==null?void 0:o.requirementLabel,n),children:d.requirement}),!p&&jsx("svg",{className:`flex-shrink-0 w-3 h-3 text-gray-400 transition-transform ${t?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),jsxs("p",{className:a("text-xs text-gray-400 dark:text-gray-500 mt-0.5",o==null?void 0:o.ndpaSection,n),children:["NDPA ",d.ndpaSection]})]})]}),!p&&t&&jsxs("div",{className:a("mt-2 ml-6 space-y-2",o==null?void 0:o.detail,n),children:[jsx("p",{className:a(`text-xs ${ot[d.severity]}`,o==null?void 0:o.message,n),children:d.message}),jsx("button",{type:"button",onClick:()=>{r(d.requirementId),i(false);},className:a("text-xs font-medium px-3 py-1 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))]",o==null?void 0:o.fixButton,n),children:d.fixLabel})]})]})};function nt(d,p){let r=p.map(t=>({gap:{requirementId:t,requirement:t.split("-").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "),ndpaSection:"\u2014",severity:"recommended",message:"",fixType:"fill_field",fixLabel:""},isPassed:true})),o=d.map(t=>({gap:t,isPassed:false})),n={critical:0,important:1,recommended:2};return o.sort((t,i)=>n[t.gap.severity]-n[i.gap.severity]),[...o,...r]}var $r=({complianceResult:d,onFix:p,classNames:r,unstyled:o})=>{let[n,t]=useState(false),i=nt(d.gaps,d.passed);return jsxs("aside",{"data-ndpr-component":"compliance-checker-sidebar",className:a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",r==null?void 0:r.root,o),"aria-label":"NDPA compliance checker",children:[jsxs("div",{className:a("flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/50",r==null?void 0:r.header,o),children:[jsx("h2",{className:a("text-sm font-semibold text-gray-900 dark:text-gray-100",r==null?void 0:r.title,o),children:"NDPA Compliance"}),jsx("button",{type:"button",onClick:()=>t(a=>!a),className:a("p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",r==null?void 0:r.collapseButton,o),"aria-expanded":!n,"aria-label":n?"Expand compliance checker":"Collapse compliance checker",children:jsx("svg",{className:`w-4 h-4 transition-transform ${n?"-rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})})]}),!n&&jsxs("div",{className:a("p-4 space-y-4",r==null?void 0:r.body,o),children:[jsx("div",{className:a("flex justify-center",r==null?void 0:r.ringWrapper,o),children:jsx(Fr,{score:d.score,maxScore:d.maxScore,rating:d.rating,classNames:r,unstyled:o})}),jsx("div",{className:a("grid grid-cols-3 gap-2 text-center",r==null?void 0:r.statsRow,o),children:[{count:d.gaps.filter(a=>a.severity==="critical").length,label:"Critical",color:"text-red-600 dark:text-red-400"},{count:d.gaps.filter(a=>a.severity==="important").length,label:"Important",color:"text-amber-600 dark:text-amber-400"},{count:d.passed.length,label:"Passed",color:"text-green-600 dark:text-green-400"}].map(({count:a$1,label:x,color:v})=>jsxs("div",{children:[jsx("p",{className:a(`text-base font-bold ${v}`,r==null?void 0:r.statValue,o),children:a$1}),jsx("p",{className:a("text-xs text-gray-500 dark:text-gray-400",r==null?void 0:r.statLabel,o),children:x})]},x))}),jsx("div",{className:a("overflow-y-auto max-h-80",r==null?void 0:r.requirementsList,o),children:i.length===0?jsx("p",{className:a("text-xs text-gray-500 dark:text-gray-400 text-center py-4",r==null?void 0:r.emptyState,o),children:"No requirements to display."}):i.map(({gap:a,isPassed:x})=>jsx(Er,{gap:a,isPassed:x,onFix:p,classNames:r,unstyled:o},a.requirementId))})]})]})};function dt(d){let p=Date.now()-d;return p<1e4?"just now":p<6e4?`${Math.floor(p/1e3)}s ago`:p<36e5?`${Math.floor(p/6e4)}m ago`:new Date(d).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}var Ir=({lastSavedAt:d,isSaving:p,hasError:r,classNames:o,unstyled:n})=>{let t="idle";if(p?t="saving":r?t="error":d!==null&&(t="saved"),t==="idle")return null;let i=t==="saving"?"Saving\u2026":t==="error"?"Unable to save":`Draft saved ${d?dt(d):""}`;return jsxs("div",{"data-ndpr-component":"draft-save-indicator",role:"status","aria-live":"polite","aria-atomic":"true",className:a(`flex items-center gap-1.5 ${t==="error"?"text-red-500 dark:text-red-400":t==="saving"?"text-gray-400 dark:text-gray-500":"text-green-600 dark:text-green-400"}`,o==null?void 0:o.root,n),children:[t==="saving"&&jsxs("svg",{className:"animate-spin w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),t==="saved"&&jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),t==="error"&&jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.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"})}),jsx("span",{className:a("text-xs font-medium",o==null?void 0:o.text,n),children:i})]})};var me=({adapter:d$1,onComplete:p,classNames:r,unstyled:o})=>{let{currentStep:n,nextStep:t,prevStep:i,canProceed:a$1,context:x,updateOrg:v,updateContext:k,toggleDataCategory:g,togglePurpose:u,addProcessor:b,removeProcessor:h,sections:m,customSections:z,sectionOverrides:J,editSectionContent:Z,addCustomSection:er,removeCustomSection:or,reorderSections:f,complianceResult:D,applyFix:ir,handleExportPDF:Tr,handleExportDOCX:Mr,handleExportHTML:Br,handleExportMarkdown:zr,lastSavedAt:jr,isLoading:qr}=e({adapter:d$1,onComplete:p}),nr=(F,K)=>{let _=URL.createObjectURL(F),H=document.createElement("a");H.href=_,H.download=K,H.click(),URL.revokeObjectURL(_);},Or=()=>d(null,null,function*(){let F=yield Tr();nr(F,"privacy-policy.pdf");}),_r=()=>d(null,null,function*(){let F=yield Mr();nr(F,"privacy-policy.docx");}),Hr=()=>{let F=Br();navigator.clipboard.writeText(F).catch(()=>{let K=new Blob([F],{type:"text/html"}),_=URL.createObjectURL(K),H=window.open(_,"_blank");H?H.addEventListener("load",()=>URL.revokeObjectURL(_)):URL.revokeObjectURL(_);});},Wr=()=>{let F=zr();navigator.clipboard.writeText(F).catch(()=>{let K=new Blob([F],{type:"text/markdown"});nr(K,"privacy-policy.md");});};return qr?jsxs("div",{"data-ndpr-component":"adaptive-policy-wizard",className:a("flex items-center justify-center min-h-64 text-gray-400 dark:text-gray-500",r==null?void 0:r.root,o),"aria-busy":"true","aria-label":"Loading policy wizard",children:[jsxs("svg",{className:"animate-spin w-6 h-6 mr-2",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),jsx("span",{className:"text-sm",children:"Loading\u2026"})]}):jsx("div",{"data-ndpr-component":"adaptive-policy-wizard",className:a("min-h-screen bg-gray-50 dark:bg-gray-900",r==null?void 0:r.root,o),children:jsxs("div",{className:a("max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",r==null?void 0:r.container,o),children:[jsxs("div",{className:a("flex items-center justify-between mb-6",r==null?void 0:r.topBar,o),children:[jsx("h1",{className:a("text-2xl font-bold text-gray-900 dark:text-gray-100",r==null?void 0:r.wizardTitle,o),children:"Privacy Policy Builder"}),jsx(Ir,{lastSavedAt:jr,isSaving:false,hasError:false,classNames:r,unstyled:o})]}),jsx("div",{className:a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg px-4 mb-6",r==null?void 0:r.stepIndicatorWrapper,o),children:jsx(vr,{currentStep:n,classNames:r,unstyled:o})}),jsxs("div",{className:a("flex flex-col lg:flex-row gap-6 items-start",r==null?void 0:r.panels,o),children:[jsxs("main",{"aria-live":"polite",className:a("flex-1 min-w-0 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-6",r==null?void 0:r.mainPanel,o),children:[n===1&&jsx(yr,{context:x,onUpdateOrg:v,classNames:r,unstyled:o}),n===2&&jsx(lr,{categories:x.dataCategories,onToggle:g,classNames:r,unstyled:o}),n===3&&jsx(fr,{context:x,onTogglePurpose:u,onUpdateContext:k,onAddProcessor:b,onRemoveProcessor:h,classNames:r,unstyled:o}),n===4&&jsx(Lr,{sections:m,customSections:z,sectionOverrides:J,complianceResult:D,onEditSection:Z,onAddCustomSection:er,onRemoveCustomSection:or,onReorderSection:f,onExportPDF:Or,onExportDOCX:_r,onExportHTML:Hr,onExportMarkdown:Wr,classNames:r,unstyled:o}),jsxs("div",{className:a("flex items-center justify-between mt-8 pt-4 border-t border-gray-200 dark:border-gray-700",r==null?void 0:r.navigation,o),children:[jsx("button",{type:"button",onClick:i,disabled:n===1,className:a("px-4 py-2 bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-white rounded-md text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed hover:bg-gray-300 dark:hover:bg-gray-600 transition-colors",r==null?void 0:r.backButton,o),children:"Back"}),jsx("div",{className:"flex items-center gap-2",children:jsxs("span",{className:a("text-xs text-gray-400 dark:text-gray-500",r==null?void 0:r.stepCounter,o),children:["Step ",n," of 4"]})}),n<4?jsx("button",{type:"button",onClick:t,disabled:!a$1,className:a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed transition-colors",r==null?void 0:r.nextButton,o),children:"Next"}):jsx("span",{})]})]}),jsx("aside",{className:a("w-full lg:w-80 flex-shrink-0",r==null?void 0:r.sidebarWrapper,o),children:jsx($r,{complianceResult:D,onFix:ir,classNames:r,unstyled:o})})]})]})})};
|
|
2
|
+
export{me as a};//# sourceMappingURL=chunk-UX6ZZNEM.mjs.map
|
|
3
|
+
//# sourceMappingURL=chunk-UX6ZZNEM.mjs.map
|