@tantainnovative/ndpr-toolkit 3.3.0 → 3.4.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/CHANGELOG.md +529 -0
- package/README.md +4 -4
- package/dist/{ConsentBanner-CDRT0o2k.d.mts → ConsentBanner-F5ayys5K.d.mts} +10 -0
- package/dist/{ConsentBanner-Vxyt8SCX.d.ts → ConsentBanner-VqIPophc.d.ts} +10 -0
- package/dist/{styling-B7CBzYG7.d.ts → ConsentManager-C7I3PDe8.d.mts} +2 -62
- package/dist/{styling-uJLsBbER.d.mts → ConsentManager-CQ2IZtUU.d.ts} +2 -62
- package/dist/{sanitize-B0AzEm1D.d.mts → NDPRProvider-DYFb8xEl.d.ts} +2 -94
- package/dist/{sanitize-B0AzEm1D.d.ts → NDPRProvider-U3QNu6MA.d.mts} +2 -94
- 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-2AW7KAZO.mjs +2 -0
- package/dist/chunk-2WH4DLV5.js +3 -0
- package/dist/chunk-3NQQSU4P.js +2 -0
- package/dist/chunk-3VQAYQR7.js +7 -0
- package/dist/chunk-4R42ZNO7.mjs +318 -0
- package/dist/chunk-5HL4UBFV.js +2 -0
- package/dist/chunk-6FGCGLH5.mjs +2 -0
- package/dist/chunk-6HZL2WDU.mjs +2 -0
- package/dist/chunk-6QPRDQZF.js +2 -0
- package/dist/chunk-74Z23WUA.mjs +2 -0
- package/dist/chunk-AHSMDPG5.js +132 -0
- package/dist/chunk-BN77GP4W.mjs +2 -0
- package/dist/chunk-C5QO3SX4.js +2 -0
- package/dist/chunk-CISJAQ6W.mjs +2 -0
- package/dist/chunk-DCJK5OZT.mjs +2 -0
- package/dist/chunk-DUY6F3GT.mjs +94 -0
- package/dist/chunk-EHAZIKDX.js +81 -0
- package/dist/chunk-EPT2K355.mjs +2 -0
- package/dist/chunk-HGGLW5TE.js +2 -0
- package/dist/chunk-HQSU7LGM.js +94 -0
- package/dist/chunk-IZCWCE7W.mjs +2 -0
- package/dist/chunk-JBSCER34.js +2 -0
- package/dist/chunk-KF3EFJEF.mjs +3 -0
- package/dist/chunk-KSERBMXW.mjs +4 -0
- package/dist/chunk-LJNNPAFU.mjs +2 -0
- package/dist/{chunk-UXMGBIX6.js → chunk-LSCMXAPY.mjs} +4 -4
- package/dist/chunk-LSNL4XR5.js +2 -0
- package/dist/chunk-M2TPT5GB.js +2 -0
- package/dist/chunk-MCWV7S2G.js +2 -0
- package/dist/chunk-MG73MOZC.mjs +15 -0
- package/dist/chunk-NCOZB2WU.mjs +2 -0
- package/dist/chunk-NQNFS3QI.js +7 -0
- package/dist/chunk-OPYQIJKY.js +2 -0
- package/dist/{chunk-ZEOQYWOE.mjs → chunk-P2YV6DR3.js} +4 -4
- package/dist/chunk-P6QAFBCV.js +2 -0
- package/dist/chunk-QVULSG6J.mjs +3 -0
- package/dist/chunk-R5FW5XUQ.mjs +2 -0
- package/dist/chunk-RGNP45VR.js +2 -0
- package/dist/chunk-RLYTX3MM.js +2 -0
- package/dist/chunk-RNTNHVKZ.js +15 -0
- package/dist/chunk-RRVKUCFR.mjs +2 -0
- package/dist/chunk-RXL6CZAI.js +2 -0
- package/dist/chunk-RY3PGVLZ.mjs +2 -0
- package/dist/chunk-SUEGUY35.js +2 -0
- package/dist/chunk-SYMQJO2W.mjs +7 -0
- package/dist/chunk-TCN22KYP.mjs +7 -0
- package/dist/chunk-UFPSUO52.js +318 -0
- package/dist/chunk-VTITKWGX.mjs +2 -0
- package/dist/chunk-WH6ZMUOS.mjs +81 -0
- package/dist/chunk-WTJGLNTB.js +3 -0
- package/dist/chunk-XHROISIF.mjs +2 -0
- package/dist/chunk-XMBSJJ5U.js +4 -0
- package/dist/chunk-XSEZDQLB.js +2 -0
- package/dist/chunk-Z6IIMLZU.mjs +2 -0
- package/dist/chunk-ZLSWOFAY.mjs +132 -0
- package/dist/chunk-ZPKVLTSX.js +2 -0
- package/dist/consent.d.mts +6 -4
- package/dist/consent.d.ts +6 -4
- package/dist/consent.js +1 -1
- package/dist/consent.mjs +1 -1
- package/dist/core.d.mts +6 -25
- package/dist/core.d.ts +6 -25
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/cross-border.d.mts +2 -2
- package/dist/cross-border.d.ts +2 -2
- package/dist/cross-border.js +1 -1
- package/dist/cross-border.mjs +1 -1
- package/dist/docx-BxKascXN.d.ts +64 -0
- package/dist/docx-CV7Vsry_.d.mts +64 -0
- package/dist/dpia.js +1 -1
- package/dist/dpia.mjs +1 -1
- package/dist/dsr.js +1 -1
- package/dist/dsr.mjs +1 -1
- package/dist/hooks.d.mts +4 -4
- package/dist/hooks.d.ts +4 -4
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/index.d.mts +8 -6
- package/dist/index.d.ts +8 -6
- 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/locale-CxJx2tzn.d.mts +25 -0
- package/dist/locale-DSkrtf-c.d.ts +25 -0
- package/dist/{policy-engine-C6nC2t3a.d.ts → policy-engine-CCUCud2T.d.ts} +1 -1
- package/dist/{policy-engine-DefZcX3R.d.mts → policy-engine-fYSqEqSW.d.mts} +1 -1
- package/dist/{policy-sections-DFDPVCCg.d.ts → policy-sections-BYx6fEFk.d.ts} +4 -2
- package/dist/{policy-sections-Bylm31kZ.d.mts → policy-sections-Dm97Nq8m.d.mts} +4 -2
- package/dist/{policy-templates-CIKcV0i1.d.ts → policy-templates-DhLwq4R-.d.ts} +8 -1
- package/dist/{policy-templates-DMsPwOSZ.d.mts → policy-templates-DwYl2329.d.mts} +8 -1
- package/dist/policy.d.mts +36 -71
- package/dist/policy.d.ts +36 -71
- package/dist/policy.js +1 -1
- package/dist/policy.mjs +1 -1
- package/dist/presets.d.mts +2 -2
- package/dist/presets.d.ts +2 -2
- 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-CxxwKxAx.d.mts +94 -0
- package/dist/sanitize-CxxwKxAx.d.ts +94 -0
- package/dist/server.d.mts +24 -0
- package/dist/server.d.ts +24 -0
- package/dist/server.js +2 -0
- package/dist/server.mjs +2 -0
- package/dist/styles.css +1423 -31
- package/dist/styling-BMDGQDgS.d.mts +64 -0
- package/dist/styling-BaoQtV06.d.ts +64 -0
- package/dist/unstyled.d.mts +52 -19
- package/dist/unstyled.d.ts +52 -19
- package/dist/unstyled.js +1 -1
- package/dist/unstyled.mjs +1 -1
- package/dist/{useAdaptivePolicyWizard-A1PyOy6P.d.mts → useAdaptivePolicyWizard-BnjW4OR4.d.mts} +1 -1
- package/dist/{useAdaptivePolicyWizard-LVIKhAxw.d.ts → useAdaptivePolicyWizard-sb3m4-Zk.d.ts} +1 -1
- package/dist/{useCrossBorderTransfer-BGNZt2lk.d.mts → useCrossBorderTransfer-DixjLjN1.d.mts} +1 -1
- package/dist/{useCrossBorderTransfer-COqjgjsu.d.ts → useCrossBorderTransfer-DvSq06lv.d.ts} +1 -1
- package/dist/{useDefaultPrivacyPolicy-BsYttRey.d.mts → useDefaultPrivacyPolicy-Cs2WQSYQ.d.mts} +34 -9
- package/dist/{useDefaultPrivacyPolicy-C-mG-A5S.d.ts → useDefaultPrivacyPolicy-DkOqMg2e.d.ts} +34 -9
- package/package.json +20 -6
- package/dist/chunk-256APOQM.js +0 -2
- package/dist/chunk-25OOUES4.js +0 -2
- package/dist/chunk-4JKTIR33.mjs +0 -2
- package/dist/chunk-5BUS6AI7.js +0 -2
- package/dist/chunk-6BXUVS6E.js +0 -81
- package/dist/chunk-6JCRDJQI.mjs +0 -2
- package/dist/chunk-6RQGQZT2.js +0 -2
- package/dist/chunk-6YN73KR7.mjs +0 -2
- package/dist/chunk-CDZDT2OS.mjs +0 -320
- package/dist/chunk-CSIJCLGZ.mjs +0 -2
- package/dist/chunk-CWUPGY3M.mjs +0 -3
- package/dist/chunk-E63VPR7U.js +0 -2
- package/dist/chunk-FDDI426Y.mjs +0 -2
- package/dist/chunk-GCQRHMTQ.mjs +0 -144
- package/dist/chunk-GMLCWGNJ.js +0 -7
- package/dist/chunk-GQVNLUP2.js +0 -94
- package/dist/chunk-GXLSOZCH.mjs +0 -2
- package/dist/chunk-IQJO7WIH.js +0 -7
- package/dist/chunk-LETEUS5X.mjs +0 -2
- package/dist/chunk-LU4PFST7.js +0 -144
- package/dist/chunk-M6XETYNL.js +0 -2
- package/dist/chunk-NBSVFQ5G.js +0 -2
- package/dist/chunk-NUDVUAD4.mjs +0 -81
- package/dist/chunk-NUULHXVL.mjs +0 -7
- package/dist/chunk-PM7O5IGE.mjs +0 -2
- package/dist/chunk-Q7VHB64E.mjs +0 -2
- package/dist/chunk-QDHHD2KR.mjs +0 -94
- package/dist/chunk-SAA7UVI2.js +0 -3
- package/dist/chunk-TI2M7H6R.mjs +0 -7
- package/dist/chunk-TKVJ3OOV.mjs +0 -2
- package/dist/chunk-TXXWCB5O.js +0 -320
- package/dist/chunk-UGY5ZYUG.js +0 -2
- package/dist/chunk-UO6QPJLH.js +0 -2
- package/dist/chunk-UX6ZZNEM.mjs +0 -3
- package/dist/chunk-VLSGE2YA.js +0 -2
- package/dist/chunk-XFUEZ3MP.mjs +0 -2
- package/dist/chunk-XHSHPB74.js +0 -2
- package/dist/chunk-YCX6BFOQ.js +0 -2
- package/dist/chunk-YURSF2YO.mjs +0 -2
- package/dist/chunk-YZXUAIYN.js +0 -3
- package/dist/chunk-ZGJA7OO4.js +0 -2
- package/dist/chunk-ZT7KNFAU.mjs +0 -2
package/dist/chunk-CDZDT2OS.mjs
DELETED
|
@@ -1,320 +0,0 @@
|
|
|
1
|
-
import {b,d as d$1,c}from'./chunk-GCQRHMTQ.mjs';import {a}from'./chunk-6WIP33TW.mjs';import {d,b as b$1,a as a$1}from'./chunk-WWT2ZSNU.mjs';import {useRef,useState,useEffect,useMemo,useCallback}from'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 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 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=useRef((ne=r.adapter)!=null?ne:a(Me));r.adapter&&(e.current=r.adapter);let a$2=useRef(pe()),[s,t]=useState(1),[l,c$1]=useState(b),[y,C]=useState([]),[x,D]=useState({}),[k,F]=useState([]),[z,L]=useState(false),[R,d$2]=useState(null),[w,p]=useState(true),T=useRef(false),b$2=useRef(null);useEffect(()=>{let o=false,n=i=>{i&&(a$2.current=i.id,c$1(i.templateContext),C(i.customSections),D(i.sectionOverrides),F(i.sectionOrder),t(i.currentStep),d$2(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=useMemo(()=>{let n=d$1(l).map(f=>x[f.id]?b$1(a$1({},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=useMemo(()=>!l.org.name&&!l.org.privacyEmail?null:U(l,g,a$2.current),[l,g]),_=useMemo(()=>U(b(),[],a$2.current),[]),H=useMemo(()=>c(m!=null?m:_,l),[m,l,_]),A=H.percentage,N=H.gaps,X=useRef({score:-1,gaps:[]});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=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=useCallback(o=>{let n=Math.min(Math.max(1,o),4);n<4&&(T.current=false),t(n);},[]),ue=useCallback(()=>{t(o=>Math.min(o+1,4));},[]),ge=useCallback(()=>{T.current=false,t(o=>Math.max(o-1,1));},[]),fe=useCallback(o=>{c$1(n=>a$1(a$1({},n),o));},[]),he=useCallback(o=>{c$1(n=>b$1(a$1({},n),{org:a$1(a$1({},n.org),o)}));},[]),ye=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)}));},[]),ve=useCallback(o=>{c$1(n=>{let i=o,h=n.purposes.includes(i);return b$1(a$1({},n),{purposes:h?n.purposes.filter(f=>f!==o):[...n.purposes,i]})});},[]),xe=useCallback(o=>{c$1(n=>b$1(a$1({},n),{thirdPartyProcessors:[...n.thirdPartyProcessors,o]}));},[]),be=useCallback(o=>{c$1(n=>b$1(a$1({},n),{thirdPartyProcessors:n.thirdPartyProcessors.filter((i,h)=>h!==o)}));},[]),Pe=useCallback(o=>{C(n=>n.length>=le?n:[...n,b$1(a$1({},o),{id:de(),required:false})]);},[]),Ce=useCallback((o,n)=>{C(i=>i.map(h=>h.id===o?a$1(a$1({},h),n):h));},[]),we=useCallback(o=>{C(n=>n.filter(i=>i.id!==o)),F(n=>n.filter(i=>i!==o)),D(n=>{let i=a$1({},n);return delete i[o],i});},[]),Se=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=useCallback((o,n)=>{D(i=>b$1(a$1({},i),{[o]:n}));},[]),Te=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 b$1(a$1({},h),{[i]:`${f}
|
|
318
|
-
|
|
319
|
-
${n.suggestedContent}`.trim()})});break}}},[N,g]),Y=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]),Ee=useCallback(()=>d(null,null,function*(){let o=Y(s);try{yield Promise.resolve(e.current.save(o)),d$2(o.lastSavedAt),L(!0);}catch(n){console.warn("[ndpr-toolkit] Failed to save draft:",n);}}),[Y,s]),$e=useCallback(()=>{Promise.resolve(e.current.remove()).catch(o=>{console.warn("[ndpr-toolkit] Failed to remove draft:",o);}),a$2.current=pe(),T.current=false,c$1(b()),C([]),D({}),F([]),t(1),L(false),d$2(null);},[]);useEffect(()=>{if(!w)return b$2.current&&clearTimeout(b$2.current),b$2.current=setTimeout(()=>{let o=Y(s);Promise.resolve(e.current.save(o)).then(()=>{d$2(o.lastSavedAt),L(true);}).catch(n=>{console.warn("[ndpr-toolkit] Auto-save failed:",n);});},Re),()=>{b$2.current&&clearTimeout(b$2.current);}},[l,y,x,k,s,w,Y]),useEffect(()=>{s===4&&m&&u&&!T.current&&(T.current=true,u(m));},[s,m,u]);let ze=useCallback(o=>d(null,null,function*(){let n=m!=null?m:U(l,g,a$2.current);return oe(n,o)}),[m,l,g]),Oe=useCallback(o=>d(null,null,function*(){let n=m!=null?m:U(l,g,a$2.current);return re(n,o)}),[m,l,g]),ke=useCallback(o=>{let n=m!=null?m:U(l,g,a$2.current);return ee(n,o)},[m,l,g]),Fe=useCallback(()=>{let o=m!=null?m:U(l,g,a$2.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}}export{ee as a,te as b,oe as c,re as d,ot as e};//# sourceMappingURL=chunk-CDZDT2OS.mjs.map
|
|
320
|
-
//# sourceMappingURL=chunk-CDZDT2OS.mjs.map
|
package/dist/chunk-CSIJCLGZ.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-7D2OIPHH.mjs';import {a as a$2}from'./chunk-6WIP33TW.mjs';import {c,a,b}from'./chunk-WWT2ZSNU.mjs';import {useRef,useState,useEffect,useCallback}from'react';function M(D,o){return o?a$2(D):{load:()=>null,save:()=>{},remove:()=>{}}}function Q({initialRequests:D=[],requestTypes:o,adapter:p,storageKey:O="ndpr_dsr_requests",useLocalStorage:P=true,onSubmit:m,onUpdate:f}){let y=p!=null?p:M(O,P),q=useRef(y);q.current=y;let[r,R]=useState(D),[x,l]=useState(true);useEffect(()=>{let e=false;try{let t=q.current.load();t instanceof Promise?t.then(s=>{e||(s&&R(s),l(!1));},()=>{e||l(!1);}):(t&&R(t),l(!1));}catch(t){e||l(false);}return ()=>{e=true;}},[]);let c$1=useCallback(e=>{Promise.resolve(q.current.save(e)).catch(t=>{console.warn("[ndpr-toolkit] Failed to save DSR requests:",t);});},[]),B=()=>"dsr_"+Date.now()+"_"+Math.random().toString(36).substr(2,9),I=useCallback(e=>{let t=o.find(g=>g.id===e.type),s=(t==null?void 0:t.estimatedCompletionTime)||30,u=Date.now(),a$1=u+s*24*60*60*1e3,b=e,{createdAt:A}=b,i=c(b,["createdAt"]),d=a({id:B(),status:"pending",createdAt:u,updatedAt:u,dueDate:a$1},i);return R(g=>{let v=[...g,d];return c$1(v),v}),m&&m(d),d},[o,c$1,m]),L=useCallback((e,t)=>{let s=null;return R(u=>{let a$1=u.findIndex(d=>d.id===e);if(a$1===-1)return u;let A=u[a$1];s=b(a(a({},A),t),{updatedAt:Date.now()});let i=[...u];return i[a$1]=s,c$1(i),i}),s&&f&&f(s),s},[c$1,f]),_=useCallback(e=>r.find(t=>t.id===e)||null,[r]),U=useCallback(e=>r.filter(t=>t.status===e),[r]),F=useCallback(e=>r.filter(t=>t.type===e),[r]);return {requests:r,submitRequest:I,updateRequest:L,getRequest:_,getRequestsByStatus:U,getRequestsByType:F,getRequestType:e=>o.find(t=>t.id===e),formatRequest:e=>{let{formattedRequest:t}=a$1(e);return t},clearRequests:()=>{R([]),Promise.resolve(q.current.remove()).catch(e=>{console.warn("[ndpr-toolkit] Failed to remove DSR requests:",e);});},isLoading:x}}export{Q as a};//# sourceMappingURL=chunk-CSIJCLGZ.mjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-CSIJCLGZ.mjs.map
|
package/dist/chunk-CWUPGY3M.mjs
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import {a as a$2}from'./chunk-GKKAK6ES.mjs';import {a}from'./chunk-AYKLAEOU.mjs';import {a as a$1,b}from'./chunk-WWT2ZSNU.mjs';import {useState}from'react';import {jsxs,jsx}from'react/jsx-runtime';var qe=({categories:pe,onSubmit:ge,onValidationError:N,title:be="Report a Data Breach",formDescription:fe="Use this form to report a suspected or confirmed data breach in accordance with NDPA Section 40. All fields marked with * are required.",submitButtonText:ue="Submit Report",className:M="",buttonClassName:z="",classNames:d={},unstyled:c=false,isSubmitting:f=false,showConfirmation:he=true,confirmationMessage:ve="Your breach report has been submitted successfully. The data protection team has been notified.",allowAttachments:ye=true,maxAttachments:A=5,maxFileSize:k=5*1024*1024,allowedFileTypes:w=[".pdf",".jpg",".jpeg",".png",".doc",".docx",".xls",".xlsx",".txt"],defaultValues:t,onReset:S})=>{var ie,oe,se,ne,de;let L=r=>{if(!r)return "";let o=new Date(r),l=s=>String(s).padStart(2,"0");return `${o.getFullYear()}-${l(o.getMonth()+1)}-${l(o.getDate())}T${l(o.getHours())}:${l(o.getMinutes())}`},[D,O]=useState((t==null?void 0:t.title)||""),[C,Y]=useState((t==null?void 0:t.description)||""),[F,U]=useState((t==null?void 0:t.category)||""),[T,H]=useState(L(t==null?void 0:t.discoveredAt)),[R,_]=useState(L(t==null?void 0:t.occurredAt)),[B,Z]=useState(((ie=t==null?void 0:t.reporter)==null?void 0:ie.name)||""),[v,G]=useState(((oe=t==null?void 0:t.reporter)==null?void 0:oe.email)||""),[j,K]=useState(((se=t==null?void 0:t.reporter)==null?void 0:se.department)||""),[E,W]=useState(((ne=t==null?void 0:t.reporter)==null?void 0:ne.phone)||""),[J,Q]=useState((t==null?void 0:t.affectedSystems)||[]),[xe,X]=useState(((de=t==null?void 0:t.affectedSystems)==null?void 0:de.join(", "))||""),[q,V]=useState((t==null?void 0:t.dataTypes)||[]),[u,ee]=useState((t==null?void 0:t.estimatedAffectedSubjects)!=null?String(t.estimatedAffectedSubjects):""),[re,te]=useState((t==null?void 0:t.status)||"ongoing"),[I,ae]=useState((t==null?void 0:t.initialActions)||""),[y,$]=useState([]),[Ne,P]=useState(false),[i,h]=useState({}),Ae=()=>{O(""),Y(""),U(""),H(""),_(""),Z(""),G(""),K(""),W(""),Q([]),X(""),V([]),ee(""),te("ongoing"),ae(""),$([]),P(false),h({}),S==null||S();},ke=r=>{let o=r.target.value;X(o);let l=o.split(",").map(s=>s.trim()).filter(Boolean);Q(l);},we=r=>{V(o=>o.includes(r)?o.filter(l=>l!==r):[...o,r]);},Se=r=>{var me;let o=r.target.files;if(!o)return;let l=[],s={};if(y.length+o.length>A){s.attachments=`Maximum of ${A} files allowed`,h(p=>a$1(a$1({},p),s));return}for(let p=0;p<o.length;p++){let x=o[p];if(x.size>k){s.attachments=`File ${x.name} exceeds the maximum size of ${k/(1024*1024)}MB`;continue}let ce="."+((me=x.name.split(".").pop())==null?void 0:me.toLowerCase());if(!w.includes(ce)){s.attachments=`File type ${ce} is not allowed`;continue}l.push(x);}l.length>0&&$(p=>[...p,...l]),Object.keys(s).length>0?h(p=>a$1(a$1({},p),s)):h(p=>b(a$1({},p),{attachments:""}));},De=r=>{$(o=>o.filter((l,s)=>s!==r));},Ce=()=>{let r={};return D.trim()||(r.breachTitle="Breach title is required"),C.trim()||(r.description="Description is required"),F||(r.category="Category is required"),T||(r.discoveredAt="Discovery date is required"),B.trim()||(r.reporterName="Reporter name is required"),v.trim()?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(v)||(r.reporterEmail="Reporter email is invalid"):r.reporterEmail="Reporter email is required",j.trim()||(r.reporterDepartment="Reporter department is required"),J.length===0&&(r.affectedSystems="At least one affected system is required"),q.length===0&&(r.dataTypes="At least one data type is required"),u&&isNaN(Number(u))&&(r.estimatedAffectedSubjects="Estimated affected subjects must be a number"),h(r),r},Fe=r=>{r.preventDefault();let o=Ce();if(Object.keys(o).length>0){N==null||N(o);return}let l={title:a$2(D),description:a$2(C),category:F,discoveredAt:new Date(T).getTime(),occurredAt:R?new Date(R).getTime():void 0,reportedAt:Date.now(),reporter:{name:a$2(B),email:a$2(v),department:a$2(j),phone:E?a$2(E):void 0},affectedSystems:J.map(s=>a$2(s)),dataTypes:q,estimatedAffectedSubjects:u?Number(u):void 0,status:re,initialActions:I?a$2(I):void 0,attachments:y.map(s=>({name:s.name,type:s.type,size:s.size,file:s}))};ge(l),he&&P(true);};if(Ne)return jsxs("div",{className:`p-4 bg-green-50 dark:bg-green-900/20 rounded-md ${M}`,children:[jsx("h2",{className:"text-lg font-bold text-green-800 dark:text-green-200 mb-2",children:"Report Submitted"}),jsx("p",{className:"text-green-700 dark:text-green-300",children:ve}),jsxs("div",{className:"mt-4 p-4 bg-yellow-50 dark:bg-yellow-900/20 rounded-md",children:[jsx("h3",{className:"text-sm font-bold text-yellow-800 dark:text-yellow-200 mb-2",children:"Important: Next Steps"}),jsx("p",{className:"text-yellow-700 dark:text-yellow-300 text-sm",children:"Under the NDPA (Section 40), data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. The data protection team will assess this breach and determine if notification is required."})]}),jsx("button",{onClick:()=>P(false),className:`mt-4 px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${z}`,children:"Report Another Breach"})]});let Te=[{id:"personal",label:"Personal Information (names, addresses)"},{id:"contact",label:"Contact Information (email, phone)"},{id:"financial",label:"Financial Information (bank details, payment info)"},{id:"health",label:"Health Information"},{id:"identification",label:"Identification Documents (ID cards, passports)"},{id:"login",label:"Login Credentials"},{id:"biometric",label:"Biometric Data"},{id:"children",label:"Children's Data"},{id:"location",label:"Location Data"},{id:"communications",label:"Communications Content"}];return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${M}`,d.root,c),children:[jsx("h2",{className:a("text-xl font-bold mb-2",d.title,c),children:be}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:fe}),jsx("form",{onSubmit:Fe,className:a("",d.form,c),children:jsxs("div",{className:"space-y-6",children:[jsxs("div",{className:a("",d.fieldGroup,c),children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Breach Information"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"breachTitle",className:a("block text-sm font-medium mb-1",d.label,c),children:["Breach Title/Summary ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",id:"breachTitle",value:D,onChange:r=>O(r.target.value),className: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))]",d.input,c),required:true,"aria-invalid":!!i.breachTitle,"aria-describedby":i.breachTitle?"breachTitle-error":void 0}),i.breachTitle&&jsx("p",{id:"breachTitle-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.breachTitle})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"category",className:a("block text-sm font-medium mb-1",d.label,c),children:["Breach Category ",jsx("span",{className:"text-red-500",children:"*"})]}),jsxs("select",{id:"category",value:F,onChange:r=>U(r.target.value),className: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))]",d.select,c),required:true,"aria-invalid":!!i.category,"aria-describedby":i.category?"category-error":void 0,children:[jsx("option",{value:"",children:"Select a category"}),pe.map(r=>jsx("option",{value:r.id,children:r.name},r.id))]}),i.category&&jsx("p",{id:"category-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.category})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{htmlFor:"description",className:a("block text-sm font-medium mb-1",d.label,c),children:["Detailed Description ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("textarea",{id:"description",value:C,onChange:r=>Y(r.target.value),rows:4,className: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))]",d.textarea,c),required:true,"aria-invalid":!!i.description,"aria-describedby":i.description?"description-error":void 0}),i.description&&jsx("p",{id:"description-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.description})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"discoveredAt",className:"block text-sm font-medium mb-1",children:["Date Discovered ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"datetime-local",id:"discoveredAt",value:T,onChange:r=>H(r.target.value),className:"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))]",required:true,"aria-invalid":!!i.discoveredAt,"aria-describedby":i.discoveredAt?"discoveredAt-error":void 0}),i.discoveredAt&&jsx("p",{id:"discoveredAt-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.discoveredAt})]}),jsxs("div",{children:[jsx("label",{htmlFor:"occurredAt",className:"block text-sm font-medium mb-1",children:"Date Occurred (if known)"}),jsx("input",{type:"datetime-local",id:"occurredAt",value:R,onChange:r=>_(r.target.value),className:"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))]"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Reporter Information"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"reporterName",className:"block text-sm font-medium mb-1",children:["Your Name ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",id:"reporterName",value:B,onChange:r=>Z(r.target.value),className:"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))]",required:true,"aria-invalid":!!i.reporterName,"aria-describedby":i.reporterName?"reporterName-error":void 0}),i.reporterName&&jsx("p",{id:"reporterName-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.reporterName})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"reporterEmail",className:"block text-sm font-medium mb-1",children:["Your Email ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"email",id:"reporterEmail",value:v,onChange:r=>G(r.target.value),className:"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))]",required:true,"aria-invalid":!!i.reporterEmail,"aria-describedby":i.reporterEmail?"reporterEmail-error":void 0}),i.reporterEmail&&jsx("p",{id:"reporterEmail-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.reporterEmail})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"reporterDepartment",className:"block text-sm font-medium mb-1",children:["Your Department ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",id:"reporterDepartment",value:j,onChange:r=>K(r.target.value),className:"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))]",required:true,"aria-invalid":!!i.reporterDepartment,"aria-describedby":i.reporterDepartment?"reporterDepartment-error":void 0}),i.reporterDepartment&&jsx("p",{id:"reporterDepartment-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.reporterDepartment})]}),jsxs("div",{children:[jsx("label",{htmlFor:"reporterPhone",className:"block text-sm font-medium mb-1",children:"Your Phone Number (Optional)"}),jsx("input",{type:"tel",id:"reporterPhone",value:E,onChange:r=>W(r.target.value),className:"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))]"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Impact Information"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"affectedSystems",className:"block text-sm font-medium mb-1",children:["Affected Systems/Applications ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",id:"affectedSystems",value:xe,onChange:ke,placeholder:"e.g. CRM, Email Server, Website (comma separated)",className:"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))]",required:true,"aria-invalid":!!i.affectedSystems,"aria-describedby":i.affectedSystems?"affectedSystems-error":void 0}),i.affectedSystems&&jsx("p",{id:"affectedSystems-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.affectedSystems})]}),jsxs("div",{children:[jsx("label",{htmlFor:"estimatedAffectedSubjects",className:"block text-sm font-medium mb-1",children:"Estimated Number of Affected Data Subjects"}),jsx("input",{type:"text",id:"estimatedAffectedSubjects",value:u,onChange:r=>ee(r.target.value),placeholder:"e.g. 100",className:"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))]","aria-invalid":!!i.estimatedAffectedSubjects,"aria-describedby":i.estimatedAffectedSubjects?"estimatedAffectedSubjects-error":void 0}),i.estimatedAffectedSubjects&&jsx("p",{id:"estimatedAffectedSubjects-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.estimatedAffectedSubjects})]}),jsxs("fieldset",{className:"md:col-span-2",children:[jsxs("legend",{className:"block text-sm font-medium mb-1",children:["Types of Data Involved ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:Te.map(r=>jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"checkbox",id:`dataType_${r.id}`,checked:q.includes(r.id),onChange:()=>we(r.id),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("label",{htmlFor:`dataType_${r.id}`,className:"ml-2 text-sm text-gray-700 dark:text-gray-300",children:r.label})]},r.id))}),i.dataTypes&&jsx("p",{id:"dataTypes-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.dataTypes})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"status",className:"block text-sm font-medium mb-1",children:["Current Status ",jsx("span",{className:"text-red-500",children:"*"})]}),jsxs("select",{id:"status",value:re,onChange:r=>te(r.target.value),className: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))]",d.select,c),required:true,children:[jsx("option",{value:"ongoing",children:"Ongoing (breach is still active)"}),jsx("option",{value:"contained",children:"Contained (breach is stopped but not resolved)"}),jsx("option",{value:"resolved",children:"Resolved (breach is fully addressed)"})]})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"initialActions",className:"block text-sm font-medium mb-1",children:"Initial Actions Taken"}),jsx("textarea",{id:"initialActions",value:I,onChange:r=>ae(r.target.value),placeholder:"Describe any immediate actions that have been taken to address the breach",rows:3,className: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))]",d.textarea,c)})]})]})]}),ye&&jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Attachments"}),jsxs("div",{className:"mb-4",children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"Upload Supporting Files (Optional)"}),jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-2",children:["Max ",A," files, ",k/(1024*1024),"MB each. Allowed types: ",w.join(", ")]}),jsx("input",{type:"file",onChange:Se,multiple:true,className:"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))]",accept:w.join(",")}),i.attachments&&jsx("p",{id:"attachments-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.attachments})]}),y.length>0&&jsxs("div",{className:"mb-4",children:[jsx("h4",{className:"text-sm font-medium mb-2",children:"Attached Files:"}),jsx("ul",{className:"space-y-2",children:y.map((r,o)=>jsxs("li",{className:"flex items-center justify-between p-2 bg-gray-50 dark:bg-gray-700 rounded",children:[jsxs("div",{className:"flex items-center",children:[jsx("svg",{className:"w-4 h-4 text-gray-500 dark:text-gray-400 mr-2",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{fillRule:"evenodd",d:"M8 4a3 3 0 00-3 3v4a5 5 0 0010 0V7a1 1 0 112 0v4a7 7 0 11-14 0V7a5 5 0 0110 0v4a3 3 0 11-6 0V7a1 1 0 012 0v4a1 1 0 102 0V7a3 3 0 00-3-3z",clipRule:"evenodd"})}),jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:r.name}),jsxs("span",{className:"ml-2 text-xs text-gray-600 dark:text-gray-400",children:["(",(r.size/1024).toFixed(1)," KB)"]})]}),jsx("button",{type:"button",onClick:()=>De(o),className:"text-red-500 hover:text-red-700",children:jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]},o))})]})]}),jsxs("div",{className:a("mt-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",d.notice,c),children:[jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Breach Notification Requirements"}),jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"Under the Nigeria Data Protection Act (NDPA), Section 40, data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. The data protection team will assess this breach and determine if notification is required."})]}),jsxs("div",{className:"mt-6 relative flex gap-3",children:[f&&d.loadingOverlay&&jsx("div",{className:d.loadingOverlay}),jsx("button",{type:"submit",disabled:f,className:a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${z} ${f?"opacity-50 cursor-not-allowed":""}`,d.primaryButton||d.submitButton,c),children:f?"Submitting...":ue}),jsx("button",{type:"button",onClick:Ae,disabled:f,className:a("px-6 py-3 bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-200 rounded-md hover:bg-gray-300 dark:hover:bg-gray-500 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2",void 0,c),children:"Reset"})]})]})})]})};
|
|
2
|
-
export{qe as a};//# sourceMappingURL=chunk-CWUPGY3M.mjs.map
|
|
3
|
-
//# sourceMappingURL=chunk-CWUPGY3M.mjs.map
|
package/dist/chunk-E63VPR7U.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkUXMGBIX6_js=require('./chunk-UXMGBIX6.js'),chunkELKB2AFZ_js=require('./chunk-ELKB2AFZ.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function j(d,a){return a?chunkELKB2AFZ_js.a(d):{load:()=>null,save:()=>{},remove:()=>{}}}function E({templates:d,initialPolicy:a,adapter:g,storageKey:I="ndpr_privacy_policy",useLocalStorage:h=true,onGenerate:v}){let f=g!=null?g:j(I,h),p=react.useRef(f);p.current=f;let[o,m]=react.useState(a||null),[l,P]=react.useState(null),[y,O]=react.useState({name:"",website:"",privacyEmail:"",address:"",privacyPhone:"",dpoName:"",dpoEmail:"",industry:""}),[D,b]=react.useState(true),S=react.useRef(d);S.current=d,react.useEffect(()=>{if(a){b(false);return}let e=false;try{let n=p.current.load(),t=i=>{if(i){if(m(i),i.templateId){let c=S.current.find(u=>u.id===i.templateId);c&&P(c);}i.organizationInfo&&O(i.organizationInfo);}b(!1);};n instanceof Promise?n.then(i=>{e||t(i);},()=>{e||b(!1);}):t(n);}catch(n){e||b(false);}return ()=>{e=true;}},[a]);let q=e=>{Promise.resolve(p.current.save(e)).catch(n=>{console.warn("[ndpr-toolkit] Failed to save policy:",n);});},N=e=>{let n=d.find(u=>u.id===e);if(!n)return false;P(n);let t=n.sections.map(u=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},u),{customContent:void 0})),i={};Object.keys(n.variables).forEach(u=>{i[u]=n.variables[u].defaultValue||"";});let c=Date.now();return m({id:"policy_"+c+"_"+Math.random().toString(36).substr(2,9),title:"",templateId:n.id,organizationInfo:y,sections:t,variableValues:i,effectiveDate:c,lastUpdated:c,version:"1.0"}),true},R=e=>{O(n=>chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},n),e));},U=(e,n)=>{l&&(o?m(t=>t&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t),{sections:t.sections.map(i=>i.id===e?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{included:n}):i)})):P(t=>t&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t),{sections:t.sections.map(i=>i.id===e?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{included:n}):i)})));},C=(e,n)=>{l&&(o?m(t=>t&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t),{sections:t.sections.map(i=>i.id===e?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{customContent:n}):i)})):P(t=>t&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t),{sections:t.sections.map(i=>i.id===e?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{customContent:n}):i)})));},A=(e,n)=>{o&&m(t=>t&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t),{variableValues:chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t.variableValues),{[e]:n})}));},L=()=>"policy_"+Date.now()+"_"+Math.random().toString(36).substr(2,9);return {policy:o,selectedTemplate:l,organizationInfo:y,selectTemplate:N,updateOrganizationInfo:R,toggleSection:U,updateSectionContent:C,updateVariableValue:A,generatePolicy:()=>{if(!l)throw new Error("No template selected");let e=Date.now(),n={id:(o==null?void 0:o.id)||L(),title:`Privacy Policy for ${y.name}`,templateId:l.id,organizationInfo:y,sections:l.sections.map(t=>{var i;return chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t),{customContent:(i=o==null?void 0:o.sections.find(c=>c.id===t.id))==null?void 0:i.customContent})}),variableValues:(o==null?void 0:o.variableValues)||{},effectiveDate:e,lastUpdated:e,version:"1.0"};return m(n),q(n),v&&v(n),n},getPolicyText:()=>{if(!o)return {fullText:"",sectionTexts:{},missingVariables:[]};let e=chunkUXMGBIX6_js.a(o.sections,o.organizationInfo);return typeof e=="string"?{fullText:e,sectionTexts:{full:e},missingVariables:[]}:e},resetPolicy:()=>{m(null),P(null),O({name:"",website:"",privacyEmail:"",address:"",privacyPhone:"",dpoName:"",dpoEmail:"",industry:""}),Promise.resolve(p.current.remove()).catch(e=>{console.warn("[ndpr-toolkit] Failed to remove policy:",e);});},isValid:()=>{let e=[];if(l||e.push("No template selected"),y.name||e.push("Organization name is required"),y.website||e.push("Organization website is required"),y.privacyEmail||e.push("Privacy contact email is required"),l){let n=l.sections.filter(i=>i.required),t=(o==null?void 0:o.sections.filter(i=>i.included))||[];n.forEach(i=>{t.some(c=>c.id===i.id)||e.push(`Required section "${i.title}" must be included`);});}return l&&o&&Object.entries(l.variables).forEach(([n,t])=>{t.required&&!o.variableValues[n]&&e.push(`Required variable "${t.name}" must have a value`);}),{valid:e.length===0,errors:e}},isLoading:D}}function X(d={}){let{orgInfo:a,storageKey:g,useLocalStorage:I}=d,{sections:h,variables:v}=chunkUXMGBIX6_js.d(),f={};a&&(a.name&&(f.orgName=a.name),a.email&&(f.privacyEmail=a.email),a.dpoName&&(f.dpoName=a.dpoName));let p={id:"default-business",name:"Default Business Policy",description:"NDPA-compliant privacy policy template for businesses.",organizationType:"business",sections:h,variables:Object.fromEntries(v.map(o=>[o.name,{name:o.name,description:o.description,required:o.required,defaultValue:f[o.name]||o.value||void 0}])),version:"1.0",lastUpdated:Date.now(),ndpaCompliant:true};return E({templates:[p],storageKey:g,useLocalStorage:I})}exports.a=E;exports.b=X;//# sourceMappingURL=chunk-E63VPR7U.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-E63VPR7U.js.map
|
package/dist/chunk-FDDI426Y.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a,d}from'./chunk-ZEOQYWOE.mjs';import {a as a$2}from'./chunk-6WIP33TW.mjs';import {b,a as a$1}from'./chunk-WWT2ZSNU.mjs';import {useRef,useState,useEffect}from'react';function j(d,a){return a?a$2(d):{load:()=>null,save:()=>{},remove:()=>{}}}function E({templates:d,initialPolicy:a$2,adapter:g,storageKey:I="ndpr_privacy_policy",useLocalStorage:h=true,onGenerate:v}){let f=g!=null?g:j(I,h),p=useRef(f);p.current=f;let[o,m]=useState(a$2||null),[l,P]=useState(null),[y,O]=useState({name:"",website:"",privacyEmail:"",address:"",privacyPhone:"",dpoName:"",dpoEmail:"",industry:""}),[D,b$1]=useState(true),S=useRef(d);S.current=d,useEffect(()=>{if(a$2){b$1(false);return}let e=false;try{let n=p.current.load(),t=i=>{if(i){if(m(i),i.templateId){let c=S.current.find(u=>u.id===i.templateId);c&&P(c);}i.organizationInfo&&O(i.organizationInfo);}b$1(!1);};n instanceof Promise?n.then(i=>{e||t(i);},()=>{e||b$1(!1);}):t(n);}catch(n){e||b$1(false);}return ()=>{e=true;}},[a$2]);let q=e=>{Promise.resolve(p.current.save(e)).catch(n=>{console.warn("[ndpr-toolkit] Failed to save policy:",n);});},N=e=>{let n=d.find(u=>u.id===e);if(!n)return false;P(n);let t=n.sections.map(u=>b(a$1({},u),{customContent:void 0})),i={};Object.keys(n.variables).forEach(u=>{i[u]=n.variables[u].defaultValue||"";});let c=Date.now();return m({id:"policy_"+c+"_"+Math.random().toString(36).substr(2,9),title:"",templateId:n.id,organizationInfo:y,sections:t,variableValues:i,effectiveDate:c,lastUpdated:c,version:"1.0"}),true},R=e=>{O(n=>a$1(a$1({},n),e));},U=(e,n)=>{l&&(o?m(t=>t&&b(a$1({},t),{sections:t.sections.map(i=>i.id===e?b(a$1({},i),{included:n}):i)})):P(t=>t&&b(a$1({},t),{sections:t.sections.map(i=>i.id===e?b(a$1({},i),{included:n}):i)})));},C=(e,n)=>{l&&(o?m(t=>t&&b(a$1({},t),{sections:t.sections.map(i=>i.id===e?b(a$1({},i),{customContent:n}):i)})):P(t=>t&&b(a$1({},t),{sections:t.sections.map(i=>i.id===e?b(a$1({},i),{customContent:n}):i)})));},A=(e,n)=>{o&&m(t=>t&&b(a$1({},t),{variableValues:b(a$1({},t.variableValues),{[e]:n})}));},L=()=>"policy_"+Date.now()+"_"+Math.random().toString(36).substr(2,9);return {policy:o,selectedTemplate:l,organizationInfo:y,selectTemplate:N,updateOrganizationInfo:R,toggleSection:U,updateSectionContent:C,updateVariableValue:A,generatePolicy:()=>{if(!l)throw new Error("No template selected");let e=Date.now(),n={id:(o==null?void 0:o.id)||L(),title:`Privacy Policy for ${y.name}`,templateId:l.id,organizationInfo:y,sections:l.sections.map(t=>{var i;return b(a$1({},t),{customContent:(i=o==null?void 0:o.sections.find(c=>c.id===t.id))==null?void 0:i.customContent})}),variableValues:(o==null?void 0:o.variableValues)||{},effectiveDate:e,lastUpdated:e,version:"1.0"};return m(n),q(n),v&&v(n),n},getPolicyText:()=>{if(!o)return {fullText:"",sectionTexts:{},missingVariables:[]};let e=a(o.sections,o.organizationInfo);return typeof e=="string"?{fullText:e,sectionTexts:{full:e},missingVariables:[]}:e},resetPolicy:()=>{m(null),P(null),O({name:"",website:"",privacyEmail:"",address:"",privacyPhone:"",dpoName:"",dpoEmail:"",industry:""}),Promise.resolve(p.current.remove()).catch(e=>{console.warn("[ndpr-toolkit] Failed to remove policy:",e);});},isValid:()=>{let e=[];if(l||e.push("No template selected"),y.name||e.push("Organization name is required"),y.website||e.push("Organization website is required"),y.privacyEmail||e.push("Privacy contact email is required"),l){let n=l.sections.filter(i=>i.required),t=(o==null?void 0:o.sections.filter(i=>i.included))||[];n.forEach(i=>{t.some(c=>c.id===i.id)||e.push(`Required section "${i.title}" must be included`);});}return l&&o&&Object.entries(l.variables).forEach(([n,t])=>{t.required&&!o.variableValues[n]&&e.push(`Required variable "${t.name}" must have a value`);}),{valid:e.length===0,errors:e}},isLoading:D}}function X(d$1={}){let{orgInfo:a,storageKey:g,useLocalStorage:I}=d$1,{sections:h,variables:v}=d(),f={};a&&(a.name&&(f.orgName=a.name),a.email&&(f.privacyEmail=a.email),a.dpoName&&(f.dpoName=a.dpoName));let p={id:"default-business",name:"Default Business Policy",description:"NDPA-compliant privacy policy template for businesses.",organizationType:"business",sections:h,variables:Object.fromEntries(v.map(o=>[o.name,{name:o.name,description:o.description,required:o.required,defaultValue:f[o.name]||o.value||void 0}])),version:"1.0",lastUpdated:Date.now(),ndpaCompliant:true};return E({templates:[p],storageKey:g,useLocalStorage:I})}export{E as a,X as b};//# sourceMappingURL=chunk-FDDI426Y.mjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-FDDI426Y.mjs.map
|