@tantainnovative/ndpr-toolkit 3.0.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{PolicyExporter-BIqSVjfC.d.mts → PolicyExporter-Bgi6nz82.d.mts} +93 -1
- package/dist/{PolicyExporter-BNWaPBGU.d.ts → PolicyExporter-BnvuFncj.d.ts} +93 -1
- package/dist/chunk-44W4H2EY.js +2 -0
- package/dist/chunk-BGHQTZAC.js +94 -0
- package/dist/chunk-DQLDX5X6.js +316 -0
- package/dist/chunk-GCQRHMTQ.mjs +144 -0
- package/dist/chunk-JZKH5RMC.js +3 -0
- package/dist/chunk-LU4PFST7.js +144 -0
- package/dist/chunk-SKJCQKFL.mjs +94 -0
- package/dist/chunk-TKBZRULW.mjs +316 -0
- package/dist/chunk-TVW6KBVV.mjs +2 -0
- package/dist/chunk-ZQSX5ZHB.mjs +3 -0
- package/dist/core.d.mts +9 -46
- package/dist/core.d.ts +9 -46
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/hooks.d.mts +2 -0
- package/dist/hooks.d.ts +2 -0
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/index.d.mts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/policy-engine-C-tShzZH.d.mts +154 -0
- package/dist/policy-engine-DSQpT55_.d.ts +154 -0
- package/dist/policy-sections-CfNVBLCh.d.mts +54 -0
- package/dist/policy-sections-DqH0iZRf.d.ts +54 -0
- package/dist/policy.d.mts +86 -5
- package/dist/policy.d.ts +86 -5
- package/dist/policy.js +1 -1
- package/dist/policy.mjs +1 -1
- package/dist/presets.d.mts +5 -15
- package/dist/presets.d.ts +5 -15
- package/dist/presets.js +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/sanitize-9mOO_cJW.d.mts +147 -0
- package/dist/sanitize-9mOO_cJW.d.ts +147 -0
- package/dist/useAdaptivePolicyWizard-B9Op2gYM.d.ts +52 -0
- package/dist/useAdaptivePolicyWizard-N4eUM4Tj.d.mts +52 -0
- package/package.json +7 -2
- package/dist/PolicyGenerator-BvcWPbxp.d.mts +0 -96
- package/dist/PolicyGenerator-BzRwtlgn.d.ts +0 -96
- package/dist/chunk-3RGJV3VF.js +0 -7
- package/dist/chunk-7FIUX3ZM.js +0 -89
- package/dist/chunk-ILCNDOBU.js +0 -2
- package/dist/chunk-J6IKAGUP.mjs +0 -89
- package/dist/chunk-KNE4NXCY.mjs +0 -7
- package/dist/chunk-WSHSHIIM.mjs +0 -2
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
import {b,d as d$1,c}from'./chunk-GCQRHMTQ.mjs';import {a}from'./chunk-SBNAMPAP.mjs';import {d,b as b$1,a as a$1}from'./chunk-WWT2ZSNU.mjs';import {useRef,useState,useEffect,useMemo,useCallback}from'react';function R(r){return r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function le(r){return r.toLowerCase().replace(/[^a-z0-9\s-]/g,"").trim().replace(/\s+/g,"-")}function Ne(r){let m=r.split(`
|
|
2
|
+
`),v=[],e=false;for(let a of m){let s=a.trimEnd();s.startsWith("- ")||s.startsWith("\u2022 ")?(e||(v.push("<ul>"),e=true),v.push(` <li>${R(s.replace(/^[-•]\s*/,""))}</li>`)):(e&&(v.push("</ul>"),e=false),s.trim()===""||v.push(`<p>${R(s)}</p>`));}return e&&v.push("</ul>"),v.join(`
|
|
3
|
+
`)}var Ie=`
|
|
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 te(r,m){var L;let v=(m==null?void 0:m.includeStyles)!==false,e=(L=m==null?void 0:m.customCSS)!=null?L:"",a=r.sections.filter(D=>D.included),s=R(r.organizationInfo.name||"Organisation"),t=R(r.title||"Privacy Policy"),l=R(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,w=r.organizationInfo.website?`<a href="${R(r.organizationInfo.website)}" target="_blank" rel="noopener">${R(r.organizationInfo.website)}</a>`:"",x=r.organizationInfo.privacyEmail?`<a href="mailto:${R(r.organizationInfo.privacyEmail)}">${R(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,f)=>` <li><a href="#${le(D.title)}">${R(D.title)}</a></li>`).join(`
|
|
251
|
+
`)}
|
|
252
|
+
</ol>
|
|
253
|
+
</nav>`,A=a.map((D,f)=>{let P=le(D.title),p=D.template||D.defaultContent||"",E=Ne(p);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">${f+1}</span>
|
|
256
|
+
${R(D.title)}
|
|
257
|
+
</h2>
|
|
258
|
+
${E}
|
|
259
|
+
</section>`}).join(`
|
|
260
|
+
|
|
261
|
+
`),N=v?`<style>
|
|
262
|
+
${Ie}
|
|
263
|
+
${e?`
|
|
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
|
+
${e}`:""}
|
|
266
|
+
</style>`:e?`<style>${e}</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
|
+
${N}
|
|
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
|
+
${A}
|
|
297
|
+
|
|
298
|
+
</article>
|
|
299
|
+
|
|
300
|
+
<footer class="policy-footer" role="contentinfo">
|
|
301
|
+
<div>${s}${w?` — ${w}`:""}</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 Me(r){return r.toLowerCase().replace(/[^a-z0-9\s-]/g,"").trim().replace(/\s+/g,"-")}function oe(r){let m=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(""),m.length>0&&(t.push("## Table of Contents"),t.push(""),m.forEach((l,c)=>{let y=Me(`${c+1} ${l.title}`);t.push(`${c+1}. [${l.title}](#${y})`);}),t.push(""),t.push("---"),t.push("")),m.forEach((l,c)=>{t.push(`## ${c+1}. ${l.title}`),t.push("");let y=(l.template||l.defaultContent||"").trim();if(y){let w=y.split(`
|
|
310
|
+
`);for(let x of w){let S=x.trimEnd();S.startsWith("-")||S.startsWith("\u2022")||S===""?t.push(S.replace(/^•/,"-")):t.push(S);}}t.push(""),t.push("---"),t.push("");}),t.push(`_Generated by **NDPA Toolkit** — ${e} • Version ${a}_`),t.push(""),t.join(`
|
|
311
|
+
`)}function re(r,m){return d(this,null,function*(){var D;let v;try{let f=yield import('jspdf');v=(D=f.jsPDF)!=null?D:f.default;}catch(f){throw new Error('The "jspdf" package is required for PDF export. Install it with: pnpm add jspdf')}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||"",w=r.title||"Privacy Policy",x=r.version||"1.0",S=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 ${w}`:w,t,12),e.setDrawColor(220,220,220),e.setLineWidth(.3),e.line(t,14,a-t,14),e.setTextColor(0,0,0);},A=f=>{c+f>s-t-10&&(e.addPage(),c=t+8,k());};if((m==null?void 0:m.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 f=e.splitTextToSize(w,l-10),P=72;f.forEach(E=>{e.text(E,a/2,P,{align:"center"}),P+=11;}),e.setDrawColor(22,163,74),e.setLineWidth(.6);let p=P+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: ${S}`,a/2,p+26,{align:"center"}),e.text(`Version ${x}`,a/2,p+34,{align:"center"}),(m==null?void 0:m.includeComplianceBadge)!==false){let E=p+52,u="Compliant with the Nigeria Data Protection Act (NDPA) 2023";e.setFontSize(8.5),e.setFont("helvetica","bold"),e.setTextColor(255,255,255);let d=e.getTextWidth(u),z=7,H=3.5,I=(a-d-z*2)/2;e.setFillColor(22,163,74),e.roundedRect(I,E-H-1,d+z*2,7+H,2,2,"F"),e.text(u,a/2,E+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 N=r.sections.filter(f=>f.included);(m==null?void 0:m.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),N.forEach((f,P)=>{A(7);let p=`${P+1}. ${f.title}`;e.text(p,t+4,c),c+=6.5;}),e.addPage(),c=t+8,k()),N.forEach((f,P)=>{A(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(P+1),t+3.5,c-.5,{align:"center"}),e.setFontSize(13),e.setFont("helvetica","bold"),e.setTextColor(22,163,74),e.text(f.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=(f.template||f.defaultContent||"").trim();if(p){let E=p.split(`
|
|
312
|
+
`);e.setFontSize(9.5),e.setFont("helvetica","normal"),e.setTextColor(50,50,50),E.forEach(u=>{let d=u.trimEnd();if(d===""){c+=3;return}let z=d.startsWith("-")||d.startsWith("\u2022"),H=z?t+8:t+4,I=z?d.replace(/^[-•]\s*/,""):d,O=l-(z?12:8);e.splitTextToSize(I,O).forEach((X,Z)=>{A(5),z&&Z===0&&(e.setFillColor(22,163,74),e.circle(t+4,c-1,.9,"F")),e.text(X,H,c),c+=5;});});}c+=10;});let L=e.getNumberOfPages();for(let f=1;f<=L;f++)e.setPage(f),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 ${f} of ${L}`,a-t,s-8,{align:"right"}),e.setTextColor(0,0,0);return e.setProperties({title:w,author:y,subject:"Privacy Policy \u2014 NDPA 2023 Compliant",keywords:"privacy policy, NDPA, Nigeria, data protection"}),e.output("blob")})}function ne(r,m){return d(this,null,function*(){let v;try{v=yield import('docx');}catch(u){throw new Error('The "docx" package is required for Word export. Install it with: pnpm add docx')}let{Document:e,Paragraph:a,TextRun:s,HeadingLevel:t,Packer:l,Header:c,Footer:y,PageNumber:w,AlignmentType:x,BorderStyle:S,ShadingType:k,TableOfContents:A}=v,N=r.organizationInfo.name||"",L=r.title||"Privacy Policy",D=r.version||"1.0",f=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"}),P=r.sections.filter(u=>u.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:`${N}${N?" \u2022 ":""}Version ${D} \u2022 Effective ${f}`,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:S.SINGLE,size:6,space:1}}})),(m==null?void 0:m.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 A=="function")try{p.push(new A("Table of Contents",{hyperlink:!0,headingStyleRange:"1-1"}));}catch(u){P.forEach((d,z)=>{p.push(new a({children:[new s({text:`${z+1}. ${d.title}`,size:22,color:"15803d"})],spacing:{after:80}}));});}else P.forEach((u,d)=>{p.push(new a({children:[new s({text:`${d+1}. ${u.title}`,size:22,color:"15803d"})],spacing:{after:80}}));});p.push(new a({children:[],pageBreakBefore:true}));}P.forEach((u,d)=>{p.push(new a({children:[new s({text:`${d+1}. ${u.title}`,bold:true,size:28,color:"064e3b"})],heading:t.HEADING_1,spacing:{before:400,after:200},border:{bottom:{color:"dcfce7",style:S.SINGLE,size:4,space:1}}}));let z=(u.template||u.defaultContent||"").trim();z&&z.split(`
|
|
313
|
+
`).forEach(I=>{let O=I.trimEnd();if(O===""){p.push(new a({children:[],spacing:{after:60}}));return}let B=O.startsWith("- ")||O.startsWith("\u2022 "),X=B?O.replace(/^[-•]\s*/,""):O;B?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 ${N}${N?" \u2014 ":""}Privacy Policy v${D}`,size:16,color:"9ca3af",italics:true})],spacing:{before:600},alignment:x.CENTER}));let E=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:N||"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:[w.CURRENT],size:16,color:"9ca3af"}),new s({text:" of ",size:16,color:"9ca3af"}),new s({children:[w.TOTAL_PAGES],size:16,color:"9ca3af"})],alignment:x.CENTER})]})},children:p}]});return l.toBlob(E)})}var de=10,pe="ndpr_policy_draft",Re=2e3;function me(){return `section_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function ue(){return `draft_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function U(r,m,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:m,variableValues:{},effectiveDate:e,lastUpdated:e,version:"1.0",applicableFrameworks:["ndpa","ndpr"]}}function ot(r={}){var ie,ae;let{onComplete:m,onComplianceChange:v}=r,e=useRef((ie=r.adapter)!=null?ie:a(pe));e.current=(ae=r.adapter)!=null?ae:a(pe);let a$2=useRef(ue()),[s,t]=useState(1),[l,c$1]=useState(b),[y,w]=useState([]),[x,S]=useState({}),[k,A]=useState([]),[N,L]=useState(false),[D,f]=useState(null),[P,p]=useState(true),E=useRef(null);useEffect(()=>{let o=false,n=i=>{i&&(a$2.current=i.id,c$1(i.templateContext),w(i.customSections),S(i.sectionOverrides),A(i.sectionOrder),t(i.currentStep),f(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 u=useMemo(()=>{let n=d$1(l).map(g=>x[g.id]?b$1(a$1({},g),{template:x[g.id]}):g),i=y.map(g=>{var T;return {id:g.id,title:g.title,template:(T=x[g.id])!=null?T:g.content,order:g.order,required:false,included:true}}),h=[...n,...i];if(k.length>0){let g=new Map(k.map((T,$)=>[T,$]));return [...h].sort((T,$)=>{let F=g.has(T.id)?g.get(T.id):h.length,W=g.has($.id)?g.get($.id):h.length;return F-W})}return [...h].sort((g,T)=>{var $,F;return (($=g.order)!=null?$:0)-((F=T.order)!=null?F:0)})},[l,y,x,k]),d$2=useMemo(()=>!l.org.name&&!l.org.privacyEmail?null:U(l,u,a$2.current),[l,u]),z=useMemo(()=>U(b(),[],a$2.current),[]),H=useMemo(()=>c(d$2!=null?d$2:z,l),[d$2,l,z]),I=H.percentage,O=H.gaps,B=useRef({score:-1,gaps:[]});useEffect(()=>{let o=B.current;v&&(I!==o.score||O!==o.gaps)&&v(I,O),B.current={score:I,gaps:O};},[I,O,v]);let X=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]),Z=useCallback(o=>{t(Math.min(Math.max(1,o),4));},[]),fe=useCallback(()=>{t(o=>Math.min(o+1,4));},[]),ge=useCallback(()=>{t(o=>Math.max(o-1,1));},[]),he=useCallback(o=>{c$1(n=>a$1(a$1({},n),o));},[]),ye=useCallback(o=>{c$1(n=>b$1(a$1({},n),{org:a$1(a$1({},n.org),o)}));},[]),ve=useCallback(o=>{c$1(n=>b$1(a$1({},n),{dataCategories:n.dataCategories.map(i=>i.id===o?b$1(a$1({},i),{selected:!i.selected}):i)}));},[]),xe=useCallback(o=>{c$1(n=>{let i=n.purposes.includes(o);return b$1(a$1({},n),{purposes:i?n.purposes.filter(h=>h!==o):[...n.purposes,o]})});},[]),be=useCallback(o=>{c$1(n=>b$1(a$1({},n),{thirdPartyProcessors:[...n.thirdPartyProcessors,o]}));},[]),Pe=useCallback(o=>{c$1(n=>b$1(a$1({},n),{thirdPartyProcessors:n.thirdPartyProcessors.filter((i,h)=>h!==o)}));},[]),we=useCallback(o=>{w(n=>n.length>=de?n:[...n,b$1(a$1({},o),{id:me(),required:false})]);},[]),Ce=useCallback((o,n)=>{w(i=>i.map(h=>h.id===o?a$1(a$1({},h),n):h));},[]),Se=useCallback(o=>{w(n=>n.filter(i=>i.id!==o)),A(n=>n.filter(i=>i!==o)),S(n=>{let i=a$1({},n);return delete i[o],i});},[]),De=useCallback((o,n)=>{A(i=>{let h=i.length>0?i:u.map(F=>F.id),g=h.indexOf(o);if(g===-1){let F=u.map(Le=>Le.id),W=F.indexOf(o);if(W===-1)return i;let Y=n==="up"?W-1:W+1;if(Y<0||Y>=F.length)return F;let j=[...F];return [j[W],j[Y]]=[j[Y],j[W]],j}let T=n==="up"?g-1:g+1;if(T<0||T>=h.length)return h;let $=[...h];return [$[g],$[T]]=[$[T],$[g]],$});},[u]),Te=useCallback((o,n)=>{S(i=>b$1(a$1({},i),{[o]:n}));},[]),Ee=useCallback(o=>{let n=O.find(i=>i.requirementId===o);if(n)switch(n.fixType){case "fill_field":{let h=["data-categories-disclosed"],g=["purpose-of-processing"];h.includes(o)?t(2):g.includes(o)?t(3):(t(1));break}case "add_section":{if(!n.suggestedContent)break;w(i=>i.length>=de?i:[...i,{id:me(),title:n.requirement,content:n.suggestedContent,order:999,required:false}]);break}case "add_content":{if(!n.suggestedContent)break;let i="data-subject-rights";S(h=>{var T,$,F;let g=(F=($=h[i])!=null?$:(T=u.find(W=>W.id===i))==null?void 0:T.template)!=null?F:"";return b$1(a$1({},h),{[i]:`${g}
|
|
314
|
+
|
|
315
|
+
${n.suggestedContent}`.trim()})});break}}},[O,u]),V=useCallback(o=>({id:a$2.current,templateContext:l,customSections:y,sectionOverrides:x,sectionOrder:k,currentStep:o,lastSavedAt:Date.now(),status:"draft"}),[l,y,x,k]),$e=useCallback(()=>d(null,null,function*(){let o=V(s);try{yield Promise.resolve(e.current.save(o)),f(o.lastSavedAt),L(!0);}catch(n){console.warn("[ndpr-toolkit] Failed to save draft:",n);}}),[V,s]),ze=useCallback(()=>{Promise.resolve(e.current.remove()).catch(o=>{console.warn("[ndpr-toolkit] Failed to remove draft:",o);}),a$2.current=ue(),c$1(b()),w([]),S({}),A([]),t(1),L(false),f(null);},[]);useEffect(()=>{if(!P)return E.current&&clearTimeout(E.current),E.current=setTimeout(()=>{let o=V(s);Promise.resolve(e.current.save(o)).then(()=>{f(o.lastSavedAt),L(true);}).catch(n=>{console.warn("[ndpr-toolkit] Auto-save failed:",n);});},Re),()=>{E.current&&clearTimeout(E.current);}},[l,y,x,k,s,P,V]),useEffect(()=>{s===4&&d$2&&m&&m(d$2);},[s,d$2,m]);let Oe=useCallback(o=>d(null,null,function*(){let n=d$2!=null?d$2:U(l,u,a$2.current);return re(n,o)}),[d$2,l,u]),Fe=useCallback(o=>d(null,null,function*(){let n=d$2!=null?d$2:U(l,u,a$2.current);return ne(n,o)}),[d$2,l,u]),ke=useCallback(o=>{let n=d$2!=null?d$2:U(l,u,a$2.current);return te(n,o)},[d$2,l,u]),Ae=useCallback(()=>{let o=d$2!=null?d$2:U(l,u,a$2.current);return oe(o)},[d$2,l,u]);return {currentStep:s,goToStep:Z,nextStep:fe,prevStep:ge,canProceed:X,context:l,updateContext:he,updateOrg:ye,toggleDataCategory:ve,togglePurpose:xe,addProcessor:be,removeProcessor:Pe,policy:d$2,sections:u,customSections:y,addCustomSection:we,updateCustomSection:Ce,removeCustomSection:Se,reorderSections:De,editSectionContent:Te,sectionOverrides:x,complianceScore:I,complianceResult:H,complianceGaps:O,applyFix:Ee,handleExportPDF:Oe,handleExportDOCX:Fe,handleExportHTML:ke,handleExportMarkdown:Ae,isDraftSaved:N,lastSavedAt:D,saveDraft:$e,discardDraft:ze,isLoading:P}}export{te as a,oe as b,re as c,ne as d,ot as e};//# sourceMappingURL=chunk-TKBZRULW.mjs.map
|
|
316
|
+
//# sourceMappingURL=chunk-TKBZRULW.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a as a$1,c}from'./chunk-WWT2ZSNU.mjs';import {createContext,useMemo,useContext}from'react';import {jsx}from'react/jsx-runtime';var a={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 d(t){if(!t)return a;let e=a$1({},a);for(let r of Object.keys(t))t[r]&&(e[r]=a$1(a$1({},a[r]),t[r]));return e}var s=createContext({}),v=r=>{var c$1=r,{children:t}=c$1,e=c(c$1,["children"]);let n=useMemo(()=>{if(!e.theme)return;let o={};return e.theme.primary&&(o["--ndpr-primary"]=e.theme.primary),e.theme.primaryHover&&(o["--ndpr-primary-hover"]=e.theme.primaryHover),e.theme.primaryForeground&&(o["--ndpr-primary-foreground"]=e.theme.primaryForeground),Object.keys(o).length>0?o:void 0},[e.theme]);return jsx(s.Provider,{value:e,children:n?jsx("div",{style:n,children:t}):t})};function A(){return useContext(s)}function b(){let{locale:t}=useContext(s);return useMemo(()=>d(t),[t])}export{a,d as b,v as c,A as d,b as e};//# sourceMappingURL=chunk-TVW6KBVV.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-TVW6KBVV.mjs.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import {e}from'./chunk-TKBZRULW.mjs';import {a}from'./chunk-AYKLAEOU.mjs';import {d,b,a as a$1}from'./chunk-WWT2ZSNU.mjs';import Gr,{useState,useEffect}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var vr=["Organization","Data Collection","Processing","Review & Export"],ur=({currentStep:n,classNames:d,unstyled:r})=>jsx("div",{"data-ndpr-component":"policy-step-indicator",className:a("w-full flex items-center justify-between px-2 py-4",d==null?void 0:d.root,r),children:vr.map((o,p)=>{let t=p+1,i=t<n,v=t===n,h=p===vr.length-1;return jsxs(Gr.Fragment,{children:[jsxs("div",{className:a("flex flex-col items-center gap-1",d==null?void 0:d.stepWrapper,r),children:[jsx("div",{"aria-current":v?"step":void 0,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))]":v?"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?d==null?void 0:d.stepCompleted:v?d==null?void 0:d.stepCurrent:d==null?void 0:d.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||v?"text-[rgb(var(--ndpr-primary))]":"text-gray-400 dark:text-gray-500"].join(" "),d==null?void 0:d.stepLabel,r),children:o})]}),!h&&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(" "),d==null?void 0:d.connector,r),"aria-hidden":"true"})]},t)})});var F="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",Ur="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",A=({label:n,required:d,children:r,classNames:o,unstyled:p})=>jsxs("div",{className:a("flex flex-col",o==null?void 0:o.field,p),children:[jsxs("label",{className:a(Ur,o==null?void 0:o.label,p),children:[n,d&&jsx("span",{className:"text-red-500 ml-0.5","aria-hidden":"true",children:"*"})]}),r]}),yr=({context:n,onUpdateOrg:d,classNames:r,unstyled:o})=>{var t,i,v;let p=n.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",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,{label:"Organisation Name",required:true,classNames:r,unstyled:o,children:jsx("input",{type:"text",value:p.name,onChange:x=>d({name:x.target.value}),placeholder:"Acme Corporation",className:a(F,r==null?void 0:r.input,o),"aria-required":"true"})}),jsx(A,{label:"Website",required:true,classNames:r,unstyled:o,children:jsx("input",{type:"url",value:p.website,onChange:x=>d({website:x.target.value}),placeholder:"https://example.com",className:a(F,r==null?void 0:r.input,o),"aria-required":"true"})}),jsx(A,{label:"Privacy Contact Email",required:true,classNames:r,unstyled:o,children:jsx("input",{type:"email",value:p.privacyEmail,onChange:x=>d({privacyEmail:x.target.value}),placeholder:"privacy@example.com",className:a(F,r==null?void 0:r.input,o),"aria-required":"true"})}),jsx(A,{label:"Industry",classNames:r,unstyled:o,children:jsxs("select",{value:p.industry,onChange:x=>d({industry:x.target.value}),className:a(F,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,{label:"Data Protection Officer (DPO) Name",classNames:r,unstyled:o,children:jsx("input",{type:"text",value:(t=p.dpoName)!=null?t:"",onChange:x=>d({dpoName:x.target.value}),placeholder:"Jane Smith",className:a(F,r==null?void 0:r.input,o)})}),jsx(A,{label:"DPO Email",classNames:r,unstyled:o,children:jsx("input",{type:"email",value:(i=p.dpoEmail)!=null?i:"",onChange:x=>d({dpoEmail:x.target.value}),placeholder:"dpo@example.com",className:a(F,r==null?void 0:r.input,o)})}),jsx(A,{label:"Registered Address",classNames:r,unstyled:o,children:jsx("input",{type:"text",value:(v=p.address)!=null?v:"",onChange:x=>d({address:x.target.value}),placeholder:"1 Victoria Island, Lagos, Nigeria",className:a(F,r==null?void 0:r.input,o)})}),jsx(A,{label:"Organisation Size",classNames:r,unstyled:o,children:jsxs("select",{value:p.orgSize,onChange:x=>d({orgSize:x.target.value}),className:a(F,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,{label:"Country of Operation",classNames:r,unstyled:o,children:jsx("input",{type:"text",value:p.country,onChange:x=>d({country:x.target.value}),placeholder:"Nigeria",className:a(F,r==null?void 0:r.input,o)})})]})]})};var Vr={identity:"Identity",financial:"Financial",behavioral:"Behavioural",sensitive:"Sensitive",children:"Children"},Xr=["identity","financial","behavioral","sensitive","children"],Yr=["sensitive","children"],hr=({categories:n,onToggle:d,classNames:r,unstyled:o})=>{let p=Xr.reduce((t,i)=>{let v=n.filter(x=>x.group===i);return v.length>0&&(t[i]=v),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",{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(p).map(([t,i])=>{let v=Yr.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:Vr[t]}),v&&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"})]}),v&&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:()=>d(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 Jr=[{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:n,checked:d,onChange:r})=>jsx("button",{id:n,type:"button",role:"switch","aria-checked":d,onClick:()=>r(!d),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))]",d?"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",d?"translate-x-5":"translate-x-0"].join(" ")})}),lr=({context:n,onTogglePurpose:d,onUpdateContext:r,onAddProcessor:o,onRemoveProcessor:p,classNames:t,unstyled:i})=>{let[v,x]=useState({name:"",purpose:"",country:""}),[h,c]=useState(false),a$2=()=>{let{name:g,purpose:u,country:P}=v;!g.trim()||!u.trim()||!P.trim()||(o({name:g.trim(),purpose:u.trim(),country:P.trim()}),x({name:"",purpose:"",country:""}),c(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:Jr.map(g=>{let u=n.purposes.includes(g.value);return jsxs("label",{className:a("flex items-start gap-3 cursor-pointer group",t==null?void 0:t.purposeItem,i),children:[jsx("input",{type:"checkbox",checked:u,onChange:()=>d(g.value),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:g.label}),jsx("p",{className:a("text-xs text-gray-500 dark:text-gray-400",t==null?void 0:t.purposeDescription,i),children:g.description})]})]},g.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:"thirdparty-toggle",checked:n.thirdPartyProcessors.length>0||h,onChange:g=>{g?c(true):(n.thirdPartyProcessors.forEach((u,P)=>p(0)),c(false));}})]}),(n.thirdPartyProcessors.length>0||h)&&jsxs("div",{className:a("space-y-4",t==null?void 0:t.processorSection,i),children:[n.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:n.thirdPartyProcessors.map((g,u)=>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:g.name}),jsx("td",{className:a("py-2 pr-4 text-gray-700 dark:text-gray-300",t==null?void 0:t.tableCell,i),children:g.purpose}),jsx("td",{className:a("py-2 pr-4 text-gray-700 dark:text-gray-300",t==null?void 0:t.tableCell,i),children:g.country}),jsx("td",{className:"py-2",children:jsx("button",{type:"button",onClick:()=>p(u),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 ${g.name}`,children:"Remove"})})]},u))})]})}),h?jsxs("div",{className:a("grid grid-cols-1 sm:grid-cols-3 gap-3 items-end",t==null?void 0:t.processorForm,i),children:[jsx("input",{type:"text",placeholder:"Processor name",value:v.name,onChange:g=>x(u=>b(a$1({},u),{name:g.target.value})),className:a(dr,t==null?void 0:t.input,i)}),jsx("input",{type:"text",placeholder:"Purpose",value:v.purpose,onChange:g=>x(u=>b(a$1({},u),{purpose:g.target.value})),className:a(dr,t==null?void 0:t.input,i)}),jsx("input",{type:"text",placeholder:"Country",value:v.country,onChange:g=>x(u=>b(a$1({},u),{country:g.target.value})),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:a$2,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:()=>c(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:()=>c(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",{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",{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:"cross-border-toggle",checked:n.hasCrossBorderTransfer,onChange:g=>r({hasCrossBorderTransfer:g})})]}),jsxs("div",{className:a("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxs("div",{children:[jsx("p",{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",{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:"automated-toggle",checked:n.hasAutomatedDecisions,onChange:g=>r({hasAutomatedDecisions:g})})]})]})]})]})};var kr=({section:n,index:d,isCustom:r,isEditing:o,editedContent:p,onEdit:t,onSaveEdit:i,onCancelEdit:v,onMoveUp:x,onMoveDown:h,onDelete:c,classNames:a$1,unstyled:g})=>{let[u,P]=useState(p!=null?p:n.template);return useEffect(()=>{p!==void 0&&P(p);},[p]),useEffect(()=>{o&&P(p!=null?p:n.template);},[o,p,n.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",a$1==null?void 0:a$1.root,g),children:[jsxs("div",{className:a("flex items-start justify-between gap-2",a$1==null?void 0:a$1.header,g),children:[jsxs("div",{className:a("flex items-center gap-3 min-w-0",a$1==null?void 0:a$1.titleRow,g),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",a$1==null?void 0:a$1.sectionNumber,g),"aria-hidden":"true",children:d+1}),jsxs("h4",{className:a("text-sm font-semibold text-gray-900 dark:text-gray-100 truncate",a$1==null?void 0:a$1.sectionTitle,g),children:[n.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",a$1==null?void 0:a$1.customBadge,g),children:"Custom"})]})]}),jsxs("div",{className:a("flex items-center gap-1 flex-shrink-0",a$1==null?void 0:a$1.actions,g),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",a$1==null?void 0:a$1.moveButton,g),"aria-label":`Move "${n.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"})})}),h&&jsx("button",{type:"button",onClick:h,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",a$1==null?void 0:a$1.moveButton,g),"aria-label":`Move "${n.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",a$1==null?void 0:a$1.editButton,g),"aria-label":`Edit "${n.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&&c&&jsx("button",{type:"button",onClick:c,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",a$1==null?void 0:a$1.deleteButton,g),"aria-label":`Delete "${n.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",a$1==null?void 0:a$1.editArea,g),children:[jsx("textarea",{value:u,onChange:z=>P(z.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",a$1==null?void 0:a$1.textarea,g),"aria-label":`Edit content for ${n.title}`}),jsxs("div",{className:a("flex gap-2",a$1==null?void 0:a$1.editActions,g),children:[jsx("button",{type:"button",onClick:()=>i(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",a$1==null?void 0:a$1.saveButton,g),children:"Save"}),jsx("button",{type:"button",onClick:v,className:a("px-4 py-2 bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-white rounded-md text-sm",a$1==null?void 0:a$1.cancelButton,g),children:"Cancel"})]})]}):jsx("div",{className:a("text-sm text-gray-600 dark:text-gray-300 leading-relaxed line-clamp-4 whitespace-pre-wrap",a$1==null?void 0:a$1.content,g),children:n.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:n,nextOrder:d,classNames:r,unstyled:o})=>{let[p,t]=useState(""),[i,v]=useState(""),[x,h]=useState(""),c=()=>{if(!p.trim()){h("Section title is required.");return}if(!i.trim()){h("Section content is required.");return}h(""),n({title:p.trim(),content:i.trim(),order:d}),t(""),v("");};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"}),x&&jsx("p",{role:"alert",className:a("text-xs text-red-600 dark:text-red-400",r==null?void 0:r.error,o),children:x}),jsxs("div",{className:a("space-y-3",r==null?void 0:r.fields,o),children:[jsxs("div",{children:[jsxs("label",{htmlFor:"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:"custom-section-title",type:"text",value:p,onChange:a=>{t(a.target.value),x&&h("");},placeholder:"e.g. Cookie Policy",className:a(Cr,r==null?void 0:r.input,o),"aria-required":"true"})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"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:"custom-section-content",value:i,onChange:a=>{v(a.target.value),x&&h("");},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:c,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 Sr={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"}},Qr={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},N=({icon:n,label:d,description:r,actionLabel:o,loading:p,onClick:t,classNames:i,unstyled:v})=>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,v),children:[jsxs("div",{className:a("flex items-center gap-3",i==null?void 0:i.formatHeader,v),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,v),"aria-hidden":"true",children:n}),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,v),children:d}),jsx("p",{className:a("text-xs text-gray-500 dark:text-gray-400",i==null?void 0:i.formatDescription,v),children:r})]})]}),jsx("button",{type:"button",onClick:t,disabled:p,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,v),children:p?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})]}),mr=({complianceResult:n,onExportPDF:d$1,onExportDOCX:r,onExportHTML:o,onExportMarkdown:p,classNames:t,unstyled:i})=>{var P;let[v,x]=useState(false),[h,c]=useState(false),a$1=(P=Sr[n.rating])!=null?P:Sr.not_compliant,g=()=>d(null,null,function*(){x(true);try{yield d$1();}finally{x(false);}}),u=()=>d(null,null,function*(){c(true);try{yield r();}finally{c(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 ${a$1.bg} ${a$1.border}`,t==null?void 0:t.complianceSummary,i),children:[jsxs("div",{className:a(`text-3xl font-bold ${a$1.text}`,t==null?void 0:t.complianceScore,i),"aria-label":`Compliance score: ${n.percentage}%`,children:[n.percentage,"%"]}),jsxs("div",{children:[jsx("p",{className:a(`text-sm font-semibold ${a$1.text}`,t==null?void 0:t.complianceRating,i),children:Qr[n.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:[n.score," / ",n.maxScore," points \u2022"," ",n.gaps.length," gap",n.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:v,onClick:g,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:h,onClick:u,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:p,classNames:t,unstyled:i})]})]})]})};var Lr=({sections:n,customSections:d,sectionOverrides:r,complianceResult:o,onEditSection:p,onAddCustomSection:t,onRemoveCustomSection:i,onReorderSection:v,onExportPDF:x,onExportDOCX:h,onExportHTML:c,onExportMarkdown:a$2,classNames:g,unstyled:u})=>{let[P,z]=useState(null),[Q,Y]=useState(false),Z=new Set(d.map(f=>f.id)),er=(f,L)=>{p(f,L),z(null);},or=n.length>0?Math.max(...n.map(f=>{var L;return (L=f.order)!=null?L:0}))+1:1;return jsxs("div",{"data-ndpr-component":"policy-step-review",className:a("space-y-6",g==null?void 0:g.root,u),children:[jsxs("div",{children:[jsx("h2",{className:a("text-xl font-semibold text-gray-900 dark:text-gray-100",g==null?void 0:g.heading,u),children:"Review & Export"}),jsx("p",{className:a("text-sm text-gray-500 dark:text-gray-400 mt-1",g==null?void 0:g.subheading,u),children:"Review your generated policy sections, reorder or edit content, then export."})]}),jsx("div",{className:a("space-y-3",g==null?void 0:g.sectionList,u),children:n.map((f,L)=>jsx(kr,{section:r[f.id]?b(a$1({},f),{template:r[f.id]}):f,index:L,isCustom:Z.has(f.id),isEditing:P===f.id,editedContent:r[f.id],onEdit:()=>z(f.id),onSaveEdit:ir=>er(f.id,ir),onCancelEdit:()=>z(null),onMoveUp:L>0?()=>v(f.id,"up"):void 0,onMoveDown:L<n.length-1?()=>v(f.id,"down"):void 0,onDelete:Z.has(f.id)?()=>i(f.id):void 0,classNames:g,unstyled:u},f.id))}),!Q&&jsxs("button",{type:"button",onClick:()=>Y(true),className:a("flex items-center gap-2 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",g==null?void 0:g.addSectionButton,u),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",g==null?void 0:g.addSectionIcon,u),"aria-hidden":"true",children:"+"}),"Add Custom Section"]}),Q&&jsxs("div",{className:a("space-y-2",g==null?void 0:g.customFormWrapper,u),children:[jsx(wr,{onAdd:f=>{t(f),Y(false);},nextOrder:or,classNames:g,unstyled:u}),jsx("button",{type:"button",onClick:()=>Y(false),className:a("text-sm text-gray-500 dark:text-gray-400 hover:underline",g==null?void 0:g.cancelCustomForm,u),children:"Cancel"})]}),jsx("hr",{className:a("border-gray-200 dark:border-gray-700",g==null?void 0:g.divider,u)}),jsx(mr,{complianceResult:o,onExportPDF:x,onExportDOCX:h,onExportHTML:c,onExportMarkdown:a$2,classNames:g,unstyled:u})]})};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"}},Nr={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},Er=({score:n,maxScore:d,rating:r,classNames:o,unstyled:p})=>{var c,a$1;let t=d>0?Math.round(n/d*100):0,i=(c=Dr[r])!=null?c:Dr.not_compliant,v=36,x=2*Math.PI*v,h=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,p),children:[jsxs("div",{className:a("relative w-24 h-24",o==null?void 0:o.svgWrapper,p),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:v,fill:"none",className:"stroke-gray-200 dark:stroke-gray-700",strokeWidth:"8"}),jsx("circle",{cx:"48",cy:"48",r:v,fill:"none",className:i.stroke,strokeWidth:"8",strokeLinecap:"round",strokeDasharray:x,strokeDashoffset:h,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,p),children:jsxs("span",{className:a(`text-xl font-bold leading-none ${i.text}`,o==null?void 0:o.scoreValue,p),"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,p),children:(a$1=Nr[r])!=null?a$1:r}),jsxs("p",{className:a("text-xs text-gray-500 dark:text-gray-400 text-center",o==null?void 0:o.scoreDetail,p),children:[n," / ",d," pts"]})]})};var rt={critical:"text-red-600 dark:text-red-400",important:"text-amber-600 dark:text-amber-400",recommended:"text-blue-600 dark:text-blue-400"},Fr=({gap:n,isPassed:d,onFix:r,classNames:o,unstyled:p})=>{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,p),children:[jsxs("button",{type:"button",onClick:()=>!d&&i(v=>!v),className:a("w-full flex items-start gap-2 text-left group",o==null?void 0:o.row,p),"aria-expanded":d?void 0:t,"aria-disabled":d,children:[jsx("span",{className:a(["mt-0.5 flex-shrink-0 w-4 h-4 rounded-full flex items-center justify-center",d?"bg-green-500":n.severity==="critical"?"bg-red-500":n.severity==="important"?"bg-amber-500":"bg-blue-400"].join(" "),o==null?void 0:o.statusIcon,p),"aria-hidden":"true",children:d?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 ${d?"text-gray-700 dark:text-gray-300":"text-gray-900 dark:text-gray-100"}`,o==null?void 0:o.requirementLabel,p),children:n.requirement}),!d&&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,p),children:["NDPA ",n.ndpaSection]})]})]}),!d&&t&&jsxs("div",{className:a("mt-2 ml-6 space-y-2",o==null?void 0:o.detail,p),children:[jsx("p",{className:a(`text-xs ${rt[n.severity]}`,o==null?void 0:o.message,p),children:n.message}),jsx("button",{type:"button",onClick:()=>{r(n.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,p),children:n.fixLabel})]})]})};function et(n,d){let r=d.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=n.map(t=>({gap:t,isPassed:false})),p={critical:0,important:1,recommended:2};return o.sort((t,i)=>p[t.gap.severity]-p[i.gap.severity]),[...o,...r]}var Ar=({complianceResult:n,onFix:d,classNames:r,unstyled:o})=>{let[p,t]=useState(false),i=et(n.gaps,n.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(v=>!v),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":!p,"aria-label":p?"Expand compliance checker":"Collapse compliance checker",children:jsx("svg",{className:`w-4 h-4 transition-transform ${p?"-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"})})})]}),!p&&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(Er,{score:n.score,maxScore:n.maxScore,rating:n.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:n.gaps.filter(v=>v.severity==="critical").length,label:"Critical",color:"text-red-600 dark:text-red-400"},{count:n.gaps.filter(v=>v.severity==="important").length,label:"Important",color:"text-amber-600 dark:text-amber-400"},{count:n.passed.length,label:"Passed",color:"text-green-600 dark:text-green-400"}].map(({count:v,label:x,color:h})=>jsxs("div",{children:[jsx("p",{className:a(`text-base font-bold ${h}`,r==null?void 0:r.statValue,o),children:v}),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:v,isPassed:x})=>jsx(Fr,{gap:v,isPassed:x,onFix:d,classNames:r,unstyled:o},v.requirementId))})]})]})};function ot(n){let d=Date.now()-n;return d<1e4?"just now":d<6e4?`${Math.floor(d/1e3)}s ago`:d<36e5?`${Math.floor(d/6e4)}m ago`:new Date(n).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}var Mr=({lastSavedAt:n,isSaving:d,hasError:r,classNames:o,unstyled:p})=>{let t="idle";if(d?t="saving":r?t="error":n!==null&&(t="saved"),t==="idle")return null;let i=t==="saving"?"Saving\u2026":t==="error"?"Unable to save":`Draft saved ${n?ot(n):""}`;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,p),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,p),children:i})]})};var ce=({adapter:n,onComplete:d$1,classNames:r,unstyled:o})=>{let{currentStep:p,nextStep:t,prevStep:i,canProceed:v,context:x,updateOrg:h,updateContext:c,toggleDataCategory:a$1,togglePurpose:g,addProcessor:u,removeProcessor:P,sections:z,customSections:Q,sectionOverrides:Y,editSectionContent:Z,addCustomSection:er,removeCustomSection:or,reorderSections:f,complianceResult:L,applyFix:ir,handleExportPDF:Br,handleExportDOCX:Ir,handleExportHTML:zr,handleExportMarkdown:jr,lastSavedAt:Or,isLoading:_r}=e({adapter:n,onComplete:d$1}),nr=(D,J)=>{let H=URL.createObjectURL(D),q=document.createElement("a");q.href=H,q.download=J,q.click(),URL.revokeObjectURL(H);},Hr=()=>d(null,null,function*(){let D=yield Br();nr(D,"privacy-policy.pdf");}),qr=()=>d(null,null,function*(){let D=yield Ir();nr(D,"privacy-policy.docx");}),Wr=()=>{let D=zr();navigator.clipboard.writeText(D).catch(()=>{let J=new Blob([D],{type:"text/html"}),H=URL.createObjectURL(J),q=window.open(H,"_blank");q?q.addEventListener("load",()=>URL.revokeObjectURL(H)):URL.revokeObjectURL(H);});},$r=()=>{let D=jr();navigator.clipboard.writeText(D).catch(()=>{let J=new Blob([D],{type:"text/markdown"});nr(J,"privacy-policy.md");});};return _r?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(Mr,{lastSavedAt:Or,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(ur,{currentStep:p,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",{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:[p===1&&jsx(yr,{context:x,onUpdateOrg:h,classNames:r,unstyled:o}),p===2&&jsx(hr,{categories:x.dataCategories,onToggle:a$1,classNames:r,unstyled:o}),p===3&&jsx(lr,{context:x,onTogglePurpose:g,onUpdateContext:c,onAddProcessor:u,onRemoveProcessor:P,classNames:r,unstyled:o}),p===4&&jsx(Lr,{sections:z,customSections:Q,sectionOverrides:Y,complianceResult:L,onEditSection:Z,onAddCustomSection:er,onRemoveCustomSection:or,onReorderSection:f,onExportPDF:Hr,onExportDOCX:qr,onExportHTML:Wr,onExportMarkdown:$r,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:p===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 ",p," of 4"]})}),p<4?jsx("button",{type:"button",onClick:t,disabled:!v,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(Ar,{complianceResult:L,onFix:ir,classNames:r,unstyled:o})})]})]})})};
|
|
2
|
+
export{ce as a};//# sourceMappingURL=chunk-ZQSX5ZHB.mjs.map
|
|
3
|
+
//# sourceMappingURL=chunk-ZQSX5ZHB.mjs.map
|
package/dist/core.d.mts
CHANGED
|
@@ -9,59 +9,22 @@ export { P as ProcessingRecord, R as ROPASummary, a as RecordOfProcessingActivit
|
|
|
9
9
|
export { L as LawfulBasisComplianceGap, a as LawfulBasisValidationResult, b as assessComplianceGaps, g as generateLawfulBasisSummary, c as getLawfulBasisDescription, v as validateProcessingActivity } from './lawful-basis-C2eGaoHM.mjs';
|
|
10
10
|
export { T as TransferRiskResult, a as TransferValidationResult, b as assessTransferRisk, g as getTransferMechanismDescription, i as isNDPCApprovalRequired, v as validateTransfer } from './cross-border-BBi9rZyO.mjs';
|
|
11
11
|
export { R as ROPAComplianceGap, a as ROPAValidationResult, e as exportROPAToCSV, g as generateROPASummary, i as identifyComplianceGaps, v as validateProcessingRecord } from './ropa-NIgxd8uP.mjs';
|
|
12
|
-
import
|
|
12
|
+
import { b as NDPRLocale, d as defaultLocale } from './sanitize-9mOO_cJW.mjs';
|
|
13
|
+
export { N as NDPRConfig, a as NDPRProvider, s as sanitizeInput, u as useNDPRConfig, c as useNDPRLocale } from './sanitize-9mOO_cJW.mjs';
|
|
13
14
|
export { C as ConsentAuditEntry, a as appendAuditEntry, c as createAuditEntry, g as getAuditLog, v as validateConsent, b as validateConsentOptions } from './consent-audit-BdByjYlM.mjs';
|
|
14
15
|
export { f as formatDSRRequest } from './dsr-D_eTNc4S.mjs';
|
|
15
16
|
export { a as assessDPIARisk } from './dpia-CUfOmzvX.mjs';
|
|
16
17
|
export { c as calculateBreachSeverity } from './breach-B_-6lDqS.mjs';
|
|
17
18
|
export { D as DEFAULT_POLICY_SECTIONS, a as DEFAULT_POLICY_VARIABLES, c as createBusinessPolicyTemplate, g as generatePolicyText } from './policy-templates-DMsPwOSZ.mjs';
|
|
19
|
+
export { C as ComplianceGap, a as ComplianceResult, b as CustomSection, D as DataCategory, P as PolicyDraft, T as TemplateContext, c as ThirdPartyProcessor, d as createDefaultContext } from './policy-engine-C-tShzZH.mjs';
|
|
20
|
+
export { a as assemblePolicy, e as evaluatePolicyCompliance } from './policy-sections-CfNVBLCh.mjs';
|
|
18
21
|
export { C as ComplianceInput, a as ComplianceRating, b as ComplianceReport, E as EffortLevel, M as ModuleScore, R as Recommendation, c as RecommendationPriority, d as RegulatoryReference, g as getComplianceScore } from './compliance-score-racQe_E_.mjs';
|
|
22
|
+
import 'react';
|
|
19
23
|
|
|
20
24
|
/**
|
|
21
|
-
*
|
|
25
|
+
* Deep merges a partial locale with the default English locale.
|
|
26
|
+
* Any missing keys fall back to English.
|
|
22
27
|
*/
|
|
23
|
-
|
|
24
|
-
/** The official name of the organisation */
|
|
25
|
-
organizationName?: string;
|
|
26
|
-
/** Email address of the Data Protection Officer */
|
|
27
|
-
dpoEmail?: string;
|
|
28
|
-
/** NDPC registration number, if registered */
|
|
29
|
-
ndpcRegistrationNumber?: string;
|
|
30
|
-
/** Prefix for localStorage/sessionStorage keys used by toolkit components */
|
|
31
|
-
storageKeyPrefix?: string;
|
|
32
|
-
/** When true, removes all default styles from toolkit components */
|
|
33
|
-
unstyled?: boolean;
|
|
34
|
-
/** Theme overrides applied as CSS custom properties */
|
|
35
|
-
theme?: {
|
|
36
|
-
/** Primary brand colour (e.g. "#0070f3") */
|
|
37
|
-
primary?: string;
|
|
38
|
-
/** Hover state for primary colour */
|
|
39
|
-
primaryHover?: string;
|
|
40
|
-
/** Foreground colour used on primary backgrounds */
|
|
41
|
-
primaryForeground?: string;
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Provides NDPR configuration to all descendant toolkit components.
|
|
46
|
-
*
|
|
47
|
-
* When a `theme` is supplied, the corresponding CSS custom properties
|
|
48
|
-
* (`--ndpr-primary`, `--ndpr-primary-hover`, `--ndpr-primary-foreground`)
|
|
49
|
-
* are set on the wrapping element so components can reference them.
|
|
50
|
-
*/
|
|
51
|
-
declare const NDPRProvider: React__default.FC<NDPRConfig & {
|
|
52
|
-
children: React__default.ReactNode;
|
|
53
|
-
}>;
|
|
54
|
-
/**
|
|
55
|
-
* Returns the current NDPR configuration from the nearest `NDPRProvider`.
|
|
56
|
-
* If no provider is found, returns an empty config object.
|
|
57
|
-
*/
|
|
58
|
-
declare function useNDPRConfig(): NDPRConfig;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Sanitizes user input to prevent XSS attacks.
|
|
62
|
-
* Escapes HTML special characters so that data rendered in dashboards
|
|
63
|
-
* or other consumer UIs cannot execute embedded scripts.
|
|
64
|
-
*/
|
|
65
|
-
declare function sanitizeInput(input: string): string;
|
|
28
|
+
declare function mergeLocale(partial?: NDPRLocale): typeof defaultLocale;
|
|
66
29
|
|
|
67
|
-
export {
|
|
30
|
+
export { NDPRLocale, defaultLocale, mergeLocale };
|
package/dist/core.d.ts
CHANGED
|
@@ -9,59 +9,22 @@ export { P as ProcessingRecord, R as ROPASummary, a as RecordOfProcessingActivit
|
|
|
9
9
|
export { L as LawfulBasisComplianceGap, a as LawfulBasisValidationResult, b as assessComplianceGaps, g as generateLawfulBasisSummary, c as getLawfulBasisDescription, v as validateProcessingActivity } from './lawful-basis-BEyI0kGg.js';
|
|
10
10
|
export { T as TransferRiskResult, a as TransferValidationResult, b as assessTransferRisk, g as getTransferMechanismDescription, i as isNDPCApprovalRequired, v as validateTransfer } from './cross-border-Dy-U9Hu6.js';
|
|
11
11
|
export { R as ROPAComplianceGap, a as ROPAValidationResult, e as exportROPAToCSV, g as generateROPASummary, i as identifyComplianceGaps, v as validateProcessingRecord } from './ropa-CyynscU6.js';
|
|
12
|
-
import
|
|
12
|
+
import { b as NDPRLocale, d as defaultLocale } from './sanitize-9mOO_cJW.js';
|
|
13
|
+
export { N as NDPRConfig, a as NDPRProvider, s as sanitizeInput, u as useNDPRConfig, c as useNDPRLocale } from './sanitize-9mOO_cJW.js';
|
|
13
14
|
export { C as ConsentAuditEntry, a as appendAuditEntry, c as createAuditEntry, g as getAuditLog, v as validateConsent, b as validateConsentOptions } from './consent-audit-DhbfMR0n.js';
|
|
14
15
|
export { f as formatDSRRequest } from './dsr-pNtVb1BK.js';
|
|
15
16
|
export { a as assessDPIARisk } from './dpia-B0Pok5us.js';
|
|
16
17
|
export { c as calculateBreachSeverity } from './breach-CzXqSsaY.js';
|
|
17
18
|
export { D as DEFAULT_POLICY_SECTIONS, a as DEFAULT_POLICY_VARIABLES, c as createBusinessPolicyTemplate, g as generatePolicyText } from './policy-templates-CIKcV0i1.js';
|
|
19
|
+
export { C as ComplianceGap, a as ComplianceResult, b as CustomSection, D as DataCategory, P as PolicyDraft, T as TemplateContext, c as ThirdPartyProcessor, d as createDefaultContext } from './policy-engine-DSQpT55_.js';
|
|
20
|
+
export { a as assemblePolicy, e as evaluatePolicyCompliance } from './policy-sections-DqH0iZRf.js';
|
|
18
21
|
export { C as ComplianceInput, a as ComplianceRating, b as ComplianceReport, E as EffortLevel, M as ModuleScore, R as Recommendation, c as RecommendationPriority, d as RegulatoryReference, g as getComplianceScore } from './compliance-score-racQe_E_.js';
|
|
22
|
+
import 'react';
|
|
19
23
|
|
|
20
24
|
/**
|
|
21
|
-
*
|
|
25
|
+
* Deep merges a partial locale with the default English locale.
|
|
26
|
+
* Any missing keys fall back to English.
|
|
22
27
|
*/
|
|
23
|
-
|
|
24
|
-
/** The official name of the organisation */
|
|
25
|
-
organizationName?: string;
|
|
26
|
-
/** Email address of the Data Protection Officer */
|
|
27
|
-
dpoEmail?: string;
|
|
28
|
-
/** NDPC registration number, if registered */
|
|
29
|
-
ndpcRegistrationNumber?: string;
|
|
30
|
-
/** Prefix for localStorage/sessionStorage keys used by toolkit components */
|
|
31
|
-
storageKeyPrefix?: string;
|
|
32
|
-
/** When true, removes all default styles from toolkit components */
|
|
33
|
-
unstyled?: boolean;
|
|
34
|
-
/** Theme overrides applied as CSS custom properties */
|
|
35
|
-
theme?: {
|
|
36
|
-
/** Primary brand colour (e.g. "#0070f3") */
|
|
37
|
-
primary?: string;
|
|
38
|
-
/** Hover state for primary colour */
|
|
39
|
-
primaryHover?: string;
|
|
40
|
-
/** Foreground colour used on primary backgrounds */
|
|
41
|
-
primaryForeground?: string;
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Provides NDPR configuration to all descendant toolkit components.
|
|
46
|
-
*
|
|
47
|
-
* When a `theme` is supplied, the corresponding CSS custom properties
|
|
48
|
-
* (`--ndpr-primary`, `--ndpr-primary-hover`, `--ndpr-primary-foreground`)
|
|
49
|
-
* are set on the wrapping element so components can reference them.
|
|
50
|
-
*/
|
|
51
|
-
declare const NDPRProvider: React__default.FC<NDPRConfig & {
|
|
52
|
-
children: React__default.ReactNode;
|
|
53
|
-
}>;
|
|
54
|
-
/**
|
|
55
|
-
* Returns the current NDPR configuration from the nearest `NDPRProvider`.
|
|
56
|
-
* If no provider is found, returns an empty config object.
|
|
57
|
-
*/
|
|
58
|
-
declare function useNDPRConfig(): NDPRConfig;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Sanitizes user input to prevent XSS attacks.
|
|
62
|
-
* Escapes HTML special characters so that data rendered in dashboards
|
|
63
|
-
* or other consumer UIs cannot execute embedded scripts.
|
|
64
|
-
*/
|
|
65
|
-
declare function sanitizeInput(input: string): string;
|
|
28
|
+
declare function mergeLocale(partial?: NDPRLocale): typeof defaultLocale;
|
|
66
29
|
|
|
67
|
-
export {
|
|
30
|
+
export { NDPRLocale, defaultLocale, mergeLocale };
|