@tantainnovative/ndpr-toolkit 3.2.0 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) hide show
  1. package/README.md +34 -1
  2. package/dist/{DPIAQuestionnaire-BkejviPj.d.mts → DPIAQuestionnaire-VXBoWFMC.d.ts} +3 -3
  3. package/dist/{DPIAQuestionnaire-DdSqXG3x.d.ts → DPIAQuestionnaire-jkt1Veb6.d.mts} +3 -3
  4. package/dist/{DSRRequestForm-BY8PogCU.d.mts → DSRRequestForm-D8rPTNmU.d.ts} +2 -2
  5. package/dist/{DSRRequestForm-CHUg9cZh.d.ts → DSRRequestForm-DRouEr9j.d.mts} +2 -2
  6. package/dist/{DSRTracker-Dr_aT0pg.d.ts → DSRTracker-Bl__d4df.d.ts} +1 -1
  7. package/dist/{DSRTracker-C6u_jAaK.d.mts → DSRTracker-CSVDfgQQ.d.mts} +1 -1
  8. package/dist/{StepIndicator-D9ZATz_O.d.ts → StepIndicator-CgrlokSV.d.ts} +1 -1
  9. package/dist/{StepIndicator-D-nwRTyo.d.mts → StepIndicator-W8S_QjgO.d.mts} +1 -1
  10. package/dist/adapters.js +1 -1
  11. package/dist/adapters.mjs +1 -1
  12. package/dist/breach.js +1 -1
  13. package/dist/breach.mjs +1 -1
  14. package/dist/chunk-256APOQM.js +2 -0
  15. package/dist/chunk-25OOUES4.js +2 -0
  16. package/dist/chunk-4JKTIR33.mjs +2 -0
  17. package/dist/chunk-5BUS6AI7.js +2 -0
  18. package/dist/chunk-5X32J5IA.mjs +2 -0
  19. package/dist/chunk-6BXUVS6E.js +81 -0
  20. package/dist/chunk-6JCRDJQI.mjs +2 -0
  21. package/dist/{chunk-KHRBU5K7.js → chunk-6RQGQZT2.js} +2 -2
  22. package/dist/chunk-6TA2MVTU.mjs +2 -0
  23. package/dist/chunk-6WIP33TW.mjs +2 -0
  24. package/dist/chunk-6YN73KR7.mjs +2 -0
  25. package/dist/chunk-75TJPK2N.mjs +2 -0
  26. package/dist/{chunk-2ORDHJRD.js → chunk-7AVN424U.js} +2 -2
  27. package/dist/chunk-7D2OIPHH.mjs +2 -0
  28. package/dist/{chunk-5VMHKNJY.js → chunk-7SMLHZ4B.js} +2 -2
  29. package/dist/chunk-A4PK7JB2.js +2 -0
  30. package/dist/chunk-ABDB7LEV.mjs +2 -0
  31. package/dist/chunk-BKRETVJ6.js +2 -0
  32. package/dist/chunk-C4YM4UMI.js +2 -0
  33. package/dist/chunk-CDZDT2OS.mjs +320 -0
  34. package/dist/chunk-CSIJCLGZ.mjs +2 -0
  35. package/dist/chunk-CWUPGY3M.mjs +3 -0
  36. package/dist/chunk-DJGS7SSN.mjs +2 -0
  37. package/dist/{chunk-SVCRYM4I.mjs → chunk-E4NCJ7RD.mjs} +2 -2
  38. package/dist/chunk-E63VPR7U.js +2 -0
  39. package/dist/chunk-ELKB2AFZ.js +2 -0
  40. package/dist/chunk-FDDI426Y.mjs +2 -0
  41. package/dist/chunk-GKKAK6ES.mjs +3 -0
  42. package/dist/chunk-GMLCWGNJ.js +7 -0
  43. package/dist/{chunk-SWF3YVE5.js → chunk-GOU6FU6Y.js} +3 -3
  44. package/dist/chunk-GQVNLUP2.js +94 -0
  45. package/dist/chunk-GXLSOZCH.mjs +2 -0
  46. package/dist/chunk-HO5M7M4M.js +2 -0
  47. package/dist/chunk-I4M2AA3N.js +2 -0
  48. package/dist/chunk-I54CDQGN.js +3 -0
  49. package/dist/chunk-IQJO7WIH.js +7 -0
  50. package/dist/chunk-JKKRPS4P.js +2 -0
  51. package/dist/chunk-LETEUS5X.mjs +2 -0
  52. package/dist/{chunk-P7BSBCB3.js → chunk-M6XETYNL.js} +2 -2
  53. package/dist/chunk-NBSVFQ5G.js +2 -0
  54. package/dist/chunk-NUDVUAD4.mjs +81 -0
  55. package/dist/chunk-NUULHXVL.mjs +7 -0
  56. package/dist/chunk-P42Z5CFE.js +2 -0
  57. package/dist/chunk-PATONNTZ.mjs +2 -0
  58. package/dist/{chunk-WLSW4Z4W.mjs → chunk-PM7O5IGE.mjs} +2 -2
  59. package/dist/chunk-Q7VHB64E.mjs +2 -0
  60. package/dist/chunk-QDHHD2KR.mjs +94 -0
  61. package/dist/chunk-R3OYAJI6.mjs +2 -0
  62. package/dist/chunk-S4GRSNB4.js +2 -0
  63. package/dist/chunk-SAA7UVI2.js +3 -0
  64. package/dist/{chunk-PYEX7DFR.mjs → chunk-SHMJNRHO.mjs} +3 -3
  65. package/dist/chunk-TI2M7H6R.mjs +7 -0
  66. package/dist/chunk-TKVJ3OOV.mjs +2 -0
  67. package/dist/chunk-TXXWCB5O.js +320 -0
  68. package/dist/chunk-U62QYKVG.mjs +2 -0
  69. package/dist/{chunk-44W4H2EY.js → chunk-UGY5ZYUG.js} +2 -2
  70. package/dist/chunk-UO6QPJLH.js +2 -0
  71. package/dist/chunk-UX6ZZNEM.mjs +3 -0
  72. package/dist/{chunk-5RSOLEEP.js → chunk-UXMGBIX6.js} +4 -4
  73. package/dist/chunk-VLSGE2YA.js +2 -0
  74. package/dist/{chunk-G26I6MP5.mjs → chunk-VWPGIES4.mjs} +2 -2
  75. package/dist/chunk-XFUEZ3MP.mjs +2 -0
  76. package/dist/chunk-XHSHPB74.js +2 -0
  77. package/dist/chunk-YCX6BFOQ.js +2 -0
  78. package/dist/chunk-YURSF2YO.mjs +2 -0
  79. package/dist/chunk-YZXUAIYN.js +3 -0
  80. package/dist/{chunk-CAB7O3GR.mjs → chunk-ZEOQYWOE.mjs} +4 -4
  81. package/dist/chunk-ZGJA7OO4.js +2 -0
  82. package/dist/chunk-ZT7KNFAU.mjs +2 -0
  83. package/dist/chunk-ZYLDLGFL.js +2 -0
  84. package/dist/consent.js +1 -1
  85. package/dist/consent.mjs +1 -1
  86. package/dist/core.d.mts +21 -9
  87. package/dist/core.d.ts +21 -9
  88. package/dist/core.js +1 -1
  89. package/dist/core.mjs +1 -1
  90. package/dist/cross-border.d.mts +68 -1
  91. package/dist/cross-border.d.ts +68 -1
  92. package/dist/cross-border.js +1 -1
  93. package/dist/cross-border.mjs +1 -1
  94. package/dist/{dpia-B0Pok5us.d.ts → dpia-D82hUrJe.d.ts} +1 -1
  95. package/dist/{dpia-CUfOmzvX.d.mts → dpia-DQDFw2_l.d.mts} +1 -1
  96. package/dist/{dpia-5OQVA1R_.d.mts → dpia-c9GiiOq0.d.mts} +2 -2
  97. package/dist/{dpia-5OQVA1R_.d.ts → dpia-c9GiiOq0.d.ts} +2 -2
  98. package/dist/dpia.d.mts +9 -9
  99. package/dist/dpia.d.ts +9 -9
  100. package/dist/dpia.js +1 -1
  101. package/dist/dpia.mjs +1 -1
  102. package/dist/{dsr-D_eTNc4S.d.mts → dsr-CIx5sd7e.d.ts} +2 -2
  103. package/dist/{dsr-pNtVb1BK.d.ts → dsr-XZ_HqTlA.d.mts} +2 -2
  104. package/dist/{dsr-Cm9lzWG7.d.mts → dsr-yKbqX531.d.mts} +1 -1
  105. package/dist/{dsr-Cm9lzWG7.d.ts → dsr-yKbqX531.d.ts} +1 -1
  106. package/dist/dsr.d.mts +9 -9
  107. package/dist/dsr.d.ts +9 -9
  108. package/dist/dsr.js +1 -1
  109. package/dist/dsr.mjs +1 -1
  110. package/dist/hooks.d.mts +6 -6
  111. package/dist/hooks.d.ts +6 -6
  112. package/dist/hooks.js +1 -1
  113. package/dist/hooks.mjs +1 -1
  114. package/dist/index.d.mts +11 -11
  115. package/dist/index.d.ts +11 -11
  116. package/dist/index.js +1 -1
  117. package/dist/index.mjs +1 -1
  118. package/dist/lawful-basis.js +1 -1
  119. package/dist/lawful-basis.mjs +1 -1
  120. package/dist/{policy-engine-DSQpT55_.d.ts → policy-engine-C6nC2t3a.d.ts} +1 -1
  121. package/dist/{policy-engine-C-tShzZH.d.mts → policy-engine-DefZcX3R.d.mts} +1 -1
  122. package/dist/{policy-sections-CfNVBLCh.d.mts → policy-sections-Bylm31kZ.d.mts} +1 -1
  123. package/dist/{policy-sections-DqH0iZRf.d.ts → policy-sections-DFDPVCCg.d.ts} +1 -1
  124. package/dist/policy.d.mts +4 -4
  125. package/dist/policy.d.ts +4 -4
  126. package/dist/policy.js +1 -1
  127. package/dist/policy.mjs +1 -1
  128. package/dist/presets.d.mts +5 -5
  129. package/dist/presets.d.ts +5 -5
  130. package/dist/presets.js +1 -1
  131. package/dist/presets.mjs +1 -1
  132. package/dist/ropa.js +1 -1
  133. package/dist/ropa.mjs +1 -1
  134. package/dist/{sanitize-9mOO_cJW.d.mts → sanitize-B0AzEm1D.d.mts} +14 -1
  135. package/dist/{sanitize-9mOO_cJW.d.ts → sanitize-B0AzEm1D.d.ts} +14 -1
  136. package/dist/{useAdaptivePolicyWizard-N4eUM4Tj.d.mts → useAdaptivePolicyWizard-A1PyOy6P.d.mts} +1 -1
  137. package/dist/{useAdaptivePolicyWizard-B9Op2gYM.d.ts → useAdaptivePolicyWizard-LVIKhAxw.d.ts} +1 -1
  138. package/dist/{useDPIA-DzWye8JB.d.mts → useDPIA-B6180UQn.d.mts} +9 -5
  139. package/dist/{useDPIA-Dl16Te3r.d.ts → useDPIA-CTqbNbww.d.ts} +9 -5
  140. package/dist/{useDSR-C1LksCfP.d.mts → useDSR-WvHk8_iu.d.mts} +2 -2
  141. package/dist/{useDSR-DZel52O1.d.ts → useDSR-wH4H6hSM.d.ts} +2 -2
  142. package/package.json +3 -2
  143. package/dist/chunk-27NYSWUG.mjs +0 -2
  144. package/dist/chunk-2SYNHRP6.mjs +0 -2
  145. package/dist/chunk-2W7ARAW2.js +0 -2
  146. package/dist/chunk-3F34NACG.js +0 -2
  147. package/dist/chunk-3UWT64FI.mjs +0 -2
  148. package/dist/chunk-3V23O4ZJ.js +0 -2
  149. package/dist/chunk-3XAUN5IM.mjs +0 -3
  150. package/dist/chunk-4JUDKBA2.mjs +0 -7
  151. package/dist/chunk-4VVARDN2.mjs +0 -2
  152. package/dist/chunk-6D3ZUGBB.mjs +0 -2
  153. package/dist/chunk-6E54NSAO.mjs +0 -2
  154. package/dist/chunk-7F5F5YWI.mjs +0 -2
  155. package/dist/chunk-BGHQTZAC.js +0 -94
  156. package/dist/chunk-CL53OI3I.js +0 -7
  157. package/dist/chunk-CMZTI7SG.js +0 -2
  158. package/dist/chunk-DQLDX5X6.js +0 -316
  159. package/dist/chunk-ELKEZEV5.mjs +0 -2
  160. package/dist/chunk-EPF7J2FK.js +0 -3
  161. package/dist/chunk-ER7X6E36.js +0 -2
  162. package/dist/chunk-FR7ZYZXB.js +0 -2
  163. package/dist/chunk-FXTZDKDC.mjs +0 -3
  164. package/dist/chunk-FY5G6DGZ.js +0 -7
  165. package/dist/chunk-GIV2OHE6.mjs +0 -2
  166. package/dist/chunk-GPJVTGHR.mjs +0 -2
  167. package/dist/chunk-GVANK6PL.js +0 -3
  168. package/dist/chunk-HNZK7LY3.mjs +0 -2
  169. package/dist/chunk-IKEPXHCZ.js +0 -2
  170. package/dist/chunk-IQF726GS.js +0 -2
  171. package/dist/chunk-IQQW52EF.js +0 -2
  172. package/dist/chunk-ISSGO2YT.mjs +0 -72
  173. package/dist/chunk-JZKH5RMC.js +0 -3
  174. package/dist/chunk-LFNA6WYQ.mjs +0 -2
  175. package/dist/chunk-NPI5T6NH.mjs +0 -7
  176. package/dist/chunk-NPLXE43Q.mjs +0 -2
  177. package/dist/chunk-PEH5GIMN.js +0 -2
  178. package/dist/chunk-PGSA2O5P.mjs +0 -2
  179. package/dist/chunk-QKK5S54L.mjs +0 -2
  180. package/dist/chunk-RGYK4VAY.mjs +0 -2
  181. package/dist/chunk-RSUDIFZV.mjs +0 -2
  182. package/dist/chunk-RYZEIDNR.js +0 -2
  183. package/dist/chunk-SBNAMPAP.mjs +0 -2
  184. package/dist/chunk-SKJCQKFL.mjs +0 -94
  185. package/dist/chunk-SSGJREE3.js +0 -2
  186. package/dist/chunk-TKBZRULW.mjs +0 -316
  187. package/dist/chunk-TVW6KBVV.mjs +0 -2
  188. package/dist/chunk-U6VWHC46.js +0 -72
  189. package/dist/chunk-UK656RCG.js +0 -2
  190. package/dist/chunk-UNKXYVXY.js +0 -2
  191. package/dist/chunk-UOSEH6DC.js +0 -2
  192. package/dist/chunk-UZ5EZOA7.js +0 -2
  193. package/dist/chunk-V37BM2LF.js +0 -2
  194. package/dist/chunk-V3MXWGXU.mjs +0 -2
  195. package/dist/chunk-VDZKGCAF.js +0 -2
  196. package/dist/chunk-XSK4BSZJ.mjs +0 -2
  197. package/dist/chunk-Y34DQYS7.js +0 -2
  198. package/dist/chunk-YJCGEOLO.mjs +0 -2
  199. package/dist/chunk-ZCZ5RRZO.js +0 -2
  200. package/dist/chunk-ZQSX5ZHB.mjs +0 -3
@@ -0,0 +1,320 @@
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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}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">&#10003; 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?` &mdash; ${C}`:""}</div>
302
+ ${x?`<div>Privacy contact: ${x}</div>`:""}
303
+ <div>Effective ${c} &bull; Version ${l}</div>
304
+ <div>Generated by <strong>NDPA Toolkit</strong> &mdash; 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
@@ -0,0 +1,2 @@
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
@@ -0,0 +1,3 @@
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
@@ -0,0 +1,2 @@
1
+ function R(e,s){if(s){let{riskLevel:t,risksToRightsAndFreedoms:o,highRisksToRightsAndFreedoms:d}=s;return {severityLevel:t,notificationRequired:o,urgentNotificationRequired:d,timeframeHours:72,justification:s.justification||"Based on risk assessment results"}}let r={ongoing:e.status==="ongoing",sensitiveData:["health","financial","biometric","children","location","religious","political","ethnic"].some(t=>e.dataTypes.includes(t)),largeScale:(e.estimatedAffectedSubjects||0)>1e3,delayedDiscovery:e.occurredAt&&e.discoveredAt-e.occurredAt>10080*60*1e3},c=Object.values(r).filter(Boolean).length,i;c===0?i="low":c===1?i="medium":c===2?i="high":i="critical";let a=i!=="low",l=i==="high"||i==="critical",u=72,n=Object.entries(r).filter(([t,o])=>o).map(([t,o])=>t).join(", "),f=n?`${i.charAt(0).toUpperCase()+i.slice(1)} risk (factors: ${n})`:`${i.charAt(0).toUpperCase()+i.slice(1)} risk`;return {severityLevel:i,notificationRequired:a,urgentNotificationRequired:l,timeframeHours:u,justification:f}}export{R as a};//# sourceMappingURL=chunk-DJGS7SSN.mjs.map
2
+ //# sourceMappingURL=chunk-DJGS7SSN.mjs.map
@@ -1,2 +1,2 @@
1
- import {d,a as a$1}from'./chunk-TXBZPCGF.mjs';import {a as a$2}from'./chunk-SBNAMPAP.mjs';import {b,a}from'./chunk-WWT2ZSNU.mjs';import {useRef,useState,useEffect,useCallback}from'react';function F(v,c){return c?a$2(v):{load:()=>null,save:()=>{},remove:()=>{}}}function z({initialActivities:v=[],adapter:c,storageKey:b$1="ndpr_lawful_basis_activities",useLocalStorage:R=true,onAdd:g,onUpdate:A,onRemove:y}={}){let p=c!=null?c:F(b$1,R),f=useRef(p);f.current=p;let[o,u]=useState(v),[x,l]=useState(true);useEffect(()=>{let t=false;try{let i=f.current.load();i instanceof Promise?i.then(e=>{t||(e&&u(e),l(!1));},()=>{t||l(!1);}):(i&&u(i),l(!1));}catch(i){t||l(false);}return ()=>{t=true;}},[]);let a$2=useCallback(t=>{Promise.resolve(f.current.save(t)).catch(i=>{console.warn("[ndpr-toolkit] Failed to save lawful basis activities:",i);});},[]),_=()=>"lb_"+Date.now()+"_"+Math.random().toString(36).substring(2,11),h=useCallback(t=>{let i=Date.now(),e=b(a({},t),{id:_(),createdAt:i,updatedAt:i});return u(s=>{let r=[...s,e];return a$2(r),r}),g&&g(e),e},[g,a$2]),O=useCallback((t,i)=>{let e=null;return u(s=>{let r=s.findIndex(k=>k.id===t);if(r===-1)return s;e=b(a(a({},s[r]),i),{id:s[r].id,updatedAt:Date.now()});let P=[...s];return P[r]=e,a$2(P),P}),e&&A&&A(e),e},[A,a$2]),D=useCallback(t=>{u(i=>{let e=i.filter(s=>s.id!==t);return a$2(e),e}),y&&y(t);},[y,a$2]),I=useCallback(t=>o.find(i=>i.id===t)||null,[o]),U=useCallback(()=>d(o),[o]),V=useCallback(t=>a$1(t),[]);return {activities:o,addActivity:h,updateActivity:O,removeActivity:D,getActivity:I,getSummary:U,validateActivity:V,isLoading:x}}export{z as a};//# sourceMappingURL=chunk-SVCRYM4I.mjs.map
2
- //# sourceMappingURL=chunk-SVCRYM4I.mjs.map
1
+ import {d,a as a$1}from'./chunk-TXBZPCGF.mjs';import {a as a$2}from'./chunk-6WIP33TW.mjs';import {b,a}from'./chunk-WWT2ZSNU.mjs';import {useRef,useState,useEffect,useCallback}from'react';function F(v,c){return c?a$2(v):{load:()=>null,save:()=>{},remove:()=>{}}}function z({initialActivities:v=[],adapter:c,storageKey:b$1="ndpr_lawful_basis_activities",useLocalStorage:R=true,onAdd:g,onUpdate:A,onRemove:y}={}){let p=c!=null?c:F(b$1,R),f=useRef(p);f.current=p;let[o,u]=useState(v),[x,l]=useState(true);useEffect(()=>{let t=false;try{let i=f.current.load();i instanceof Promise?i.then(e=>{t||(e&&u(e),l(!1));},()=>{t||l(!1);}):(i&&u(i),l(!1));}catch(i){t||l(false);}return ()=>{t=true;}},[]);let a$2=useCallback(t=>{Promise.resolve(f.current.save(t)).catch(i=>{console.warn("[ndpr-toolkit] Failed to save lawful basis activities:",i);});},[]),_=()=>"lb_"+Date.now()+"_"+Math.random().toString(36).substring(2,11),h=useCallback(t=>{let i=Date.now(),e=b(a({},t),{id:_(),createdAt:i,updatedAt:i});return u(s=>{let r=[...s,e];return a$2(r),r}),g&&g(e),e},[g,a$2]),O=useCallback((t,i)=>{let e=null;return u(s=>{let r=s.findIndex(k=>k.id===t);if(r===-1)return s;e=b(a(a({},s[r]),i),{id:s[r].id,updatedAt:Date.now()});let P=[...s];return P[r]=e,a$2(P),P}),e&&A&&A(e),e},[A,a$2]),D=useCallback(t=>{u(i=>{let e=i.filter(s=>s.id!==t);return a$2(e),e}),y&&y(t);},[y,a$2]),I=useCallback(t=>o.find(i=>i.id===t)||null,[o]),U=useCallback(()=>d(o),[o]),V=useCallback(t=>a$1(t),[]);return {activities:o,addActivity:h,updateActivity:O,removeActivity:D,getActivity:I,getSummary:U,validateActivity:V,isLoading:x}}export{z as a};//# sourceMappingURL=chunk-E4NCJ7RD.mjs.map
2
+ //# sourceMappingURL=chunk-E4NCJ7RD.mjs.map
@@ -0,0 +1,2 @@
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
@@ -0,0 +1,2 @@
1
+ 'use strict';function n(e){return {load(){if(typeof window=="undefined")return null;try{let t=localStorage.getItem(e);return t?JSON.parse(t):null}catch(t){return null}},save(t){if(typeof window!="undefined")try{localStorage.setItem(e,JSON.stringify(t));}catch(r){}},remove(){if(typeof window!="undefined")try{localStorage.removeItem(e);}catch(t){}}}}exports.a=n;//# sourceMappingURL=chunk-ELKB2AFZ.js.map
2
+ //# sourceMappingURL=chunk-ELKB2AFZ.js.map
@@ -0,0 +1,2 @@
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
@@ -0,0 +1,3 @@
1
+ function r(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;")}
2
+ export{r as a};//# sourceMappingURL=chunk-GKKAK6ES.mjs.map
3
+ //# sourceMappingURL=chunk-GKKAK6ES.mjs.map
@@ -0,0 +1,7 @@
1
+ 'use strict';var chunkC4YM4UMI_js=require('./chunk-C4YM4UMI.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var _=[{value:"adequacy_decision",label:"Adequacy Decision (Section 41)"},{value:"standard_clauses",label:"Standard Contractual Clauses (Section 42)"},{value:"binding_corporate_rules",label:"Binding Corporate Rules (Section 43)"},{value:"ndpc_authorization",label:"NDPC Authorization (Section 44)"},{value:"explicit_consent",label:"Explicit Consent (Section 45(a))"},{value:"contract_performance",label:"Contract Performance (Section 45(b))"},{value:"public_interest",label:"Public Interest (Section 45(c))"},{value:"legal_claims",label:"Legal Claims (Section 45(d))"},{value:"vital_interests",label:"Vital Interests (Section 45(e))"}],G=[{value:"adequate",label:"Adequate"},{value:"inadequate",label:"Inadequate"},{value:"pending_review",label:"Pending Review"},{value:"unknown",label:"Unknown"}],J=[{value:"one_time",label:"One-Time"},{value:"periodic",label:"Periodic"},{value:"continuous",label:"Continuous"}],X=[{value:"active",label:"Active"},{value:"suspended",label:"Suspended"},{value:"terminated",label:"Terminated"},{value:"pending_approval",label:"Pending Approval"}],Z={destinationCountry:"",destinationCountryCode:"",adequacyStatus:"unknown",transferMechanism:"adequacy_decision",dataCategories:"",includesSensitiveData:false,estimatedDataSubjects:"",recipientOrganization:"",recipientContactName:"",recipientContactEmail:"",recipientContactPhone:"",recipientContactAddress:"",purpose:"",safeguards:"",riskAssessment:"",riskLevel:"medium",frequency:"one_time",status:"active",tiaCompleted:false,tiaReference:"",ndpcApprovalApplied:false,ndpcApprovalApproved:false,ndpcApprovalReference:""},Ce=({transfers:g,onAddTransfer:q,onUpdateTransfer:F,onRemoveTransfer:M,summary:E,title:ee="Cross-Border Data Transfer Manager",description:te="Manage and document cross-border personal data transfers in compliance with NDPA 2023 Part VI (Sections 41-45).",className:re="",buttonClassName:P="",showSummary:ae=true,showTIA:ie=true,classNames:r,unstyled:d})=>{let[b,A]=react.useState(null),[j,w]=react.useState(false),[x,z]=react.useState(null),[n,B]=react.useState(Z),[y,L]=react.useState(null),[S,ne]=react.useState("all"),[T,de]=react.useState("all"),C=react.useMemo(()=>{let e=[...g];return S!=="all"&&(e=e.filter(a=>a.status===S)),T!=="all"&&(e=e.filter(a=>a.transferMechanism===T)),e.sort((a,l)=>l.updatedAt-a.updatedAt),e},[g,S,T]);react.useEffect(()=>{C.length>0&&!b&&A(C[0].id);},[C,b]);let $=react.useMemo(()=>{var e;return b&&(e=g.find(a=>a.id===b))!=null?e:null},[g,b]),k=react.useCallback(e=>new Date(e).toLocaleDateString(),[]),h=react.useCallback(()=>{B(Z),z(null),L(null);},[]),oe=react.useCallback(()=>{h(),w(true);},[h]),le=react.useCallback(e=>{var a,l,u,v;z(e.id),B({destinationCountry:e.destinationCountry,destinationCountryCode:e.destinationCountryCode||"",adequacyStatus:e.adequacyStatus,transferMechanism:e.transferMechanism,dataCategories:e.dataCategories.join(", "),includesSensitiveData:e.includesSensitiveData,estimatedDataSubjects:((a=e.estimatedDataSubjects)==null?void 0:a.toString())||"",recipientOrganization:e.recipientOrganization,recipientContactName:e.recipientContact.name,recipientContactEmail:e.recipientContact.email,recipientContactPhone:e.recipientContact.phone||"",recipientContactAddress:e.recipientContact.address||"",purpose:e.purpose,safeguards:e.safeguards.join(`
2
+ `),riskAssessment:e.riskAssessment,riskLevel:e.riskLevel,frequency:e.frequency,status:e.status,tiaCompleted:e.tiaCompleted,tiaReference:e.tiaReference||"",ndpcApprovalApplied:((l=e.ndpcApproval)==null?void 0:l.applied)||false,ndpcApprovalApproved:((u=e.ndpcApproval)==null?void 0:u.approved)||false,ndpcApprovalReference:((v=e.ndpcApproval)==null?void 0:v.referenceNumber)||""}),w(true);},[]),p=react.useCallback((e,a)=>{B(l=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},l),{[e]:a}));},[]),V=react.useCallback(()=>{let e=chunkC4YM4UMI_js.e(n.transferMechanism),a=Date.now();return {destinationCountry:n.destinationCountry.trim(),destinationCountryCode:n.destinationCountryCode.trim()||void 0,adequacyStatus:n.adequacyStatus,transferMechanism:n.transferMechanism,dataCategories:n.dataCategories.split(",").map(l=>l.trim()).filter(Boolean),includesSensitiveData:n.includesSensitiveData,estimatedDataSubjects:n.estimatedDataSubjects?parseInt(n.estimatedDataSubjects,10):void 0,recipientOrganization:n.recipientOrganization.trim(),recipientContact:{name:n.recipientContactName.trim(),email:n.recipientContactEmail.trim(),phone:n.recipientContactPhone.trim()||void 0,address:n.recipientContactAddress.trim()||void 0},purpose:n.purpose.trim(),safeguards:n.safeguards.split(`
3
+ `).map(l=>l.trim()).filter(Boolean),riskAssessment:n.riskAssessment.trim(),riskLevel:n.riskLevel,frequency:n.frequency,status:e&&!n.ndpcApprovalApproved?"pending_approval":n.status,tiaCompleted:n.tiaCompleted,tiaReference:n.tiaReference.trim()||void 0,ndpcApproval:e?{required:true,applied:n.ndpcApprovalApplied,approved:n.ndpcApprovalApproved||void 0,referenceNumber:n.ndpcApprovalReference.trim()||void 0,appliedAt:n.ndpcApprovalApplied?a:void 0,approvedAt:n.ndpcApprovalApproved?a:void 0}:void 0,startDate:a,reviewDate:a+365*24*60*60*1e3}},[n]),pe=react.useCallback(()=>{let e=V(),a=chunkMQFZHA2D_js.a({id:x||"temp",createdAt:Date.now(),updatedAt:Date.now()},e),l=chunkC4YM4UMI_js.g(a);L(l),l.isValid&&(x?F&&F(x,e):q&&q(e),h(),w(false));},[V,x,F,q,h]),U=react.useCallback(()=>{h(),w(false);},[h]),se=react.useCallback(e=>{M&&M(e),b===e&&A(null);},[M,b]),H=react.useCallback(e=>jsxRuntime.jsxs("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[e]}`,r==null?void 0:r.riskBadge,d),children:[e.charAt(0).toUpperCase()+e.slice(1)," Risk"]}),[r==null?void 0:r.riskBadge,d]),Y=react.useCallback(e=>{let a={active:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",suspended:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",terminated:"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200",pending_approval:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200"},l={active:"Active",suspended:"Suspended",terminated:"Terminated",pending_approval:"Pending Approval"};return jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${a[e]}`,r==null?void 0:r.statusBadge,d),children:l[e]})},[r==null?void 0:r.statusBadge,d]),ue=react.useCallback(e=>{var u;let a=chunkC4YM4UMI_js.e(e),l=((u=_.find(v=>v.value===e))==null?void 0:u.label)||e;return jsxRuntime.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${a?"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200":"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200"}`,children:l})},[]),D=react.useMemo(()=>E||{totalActiveTransfers:g.filter(e=>e.status==="active").length,pendingApproval:g.filter(e=>{var a,l;return e.status==="pending_approval"||((a=e.ndpcApproval)==null?void 0:a.required)&&!((l=e.ndpcApproval)!=null&&l.approved)}),highRiskTransfers:g.filter(e=>e.riskLevel==="high"&&e.status==="active"),missingTIA:g.filter(e=>!e.tiaCompleted&&e.status==="active"),byMechanism:{},byAdequacy:{},dueForReview:[],lastUpdated:Date.now()},[E,g]),ce=()=>jsxRuntime.jsxs("div",{role:"status","aria-label":"Transfer compliance summary",className:chunkE64TU6IU_js.a("mb-6 grid grid-cols-2 md:grid-cols-4 gap-4",r==null?void 0:r.summary,d),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-blue-50 dark:bg-blue-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,d),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-blue-800 dark:text-blue-200",children:D.totalActiveTransfers}),jsxRuntime.jsx("p",{className:"text-sm text-blue-600 dark:text-blue-300",children:"Active Transfers"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-purple-50 dark:bg-purple-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,d),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-purple-800 dark:text-purple-200",children:D.pendingApproval.length}),jsxRuntime.jsx("p",{className:"text-sm text-purple-600 dark:text-purple-300",children:"Pending Approval"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-red-50 dark:bg-red-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,d),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-red-800 dark:text-red-200",children:D.highRiskTransfers.length}),jsxRuntime.jsx("p",{className:"text-sm text-red-600 dark:text-red-300",children:"High Risk"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-yellow-50 dark:bg-yellow-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,d),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-yellow-800 dark:text-yellow-200",children:D.missingTIA.length}),jsxRuntime.jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-300",children:"Missing TIA"})]})]}),me=()=>{let e=chunkC4YM4UMI_js.e(n.transferMechanism);return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-gray-50 dark:bg-gray-700 p-6 rounded-lg mb-6",r==null?void 0:r.form,d),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex justify-between items-center mb-4",r==null?void 0:r.header,d),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium",children:x?"Edit Transfer":"Add New Transfer"}),jsxRuntime.jsx("button",{onClick:U,"aria-label":"Cancel form",className:"text-gray-600 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:"Cancel"})]}),y&&!y.isValid&&jsxRuntime.jsxs("div",{id:"cb-form-errors",role:"alert",className:"mb-4 bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Please fix the following errors:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm text-red-700 dark:text-red-300",children:y.errors.map((a,l)=>jsxRuntime.jsx("li",{children:a},l))})]}),y&&y.warnings.length>0&&jsxRuntime.jsxs("div",{id:"cb-form-warnings",role:"alert",className:"mb-4 bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-yellow-800 dark:text-yellow-200 mb-1",children:"Warnings:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm text-yellow-700 dark:text-yellow-300",children:y.warnings.map((a,l)=>jsxRuntime.jsx("li",{children:a},l))})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"cb-destinationCountry",className:"block text-sm font-medium mb-1",children:["Destination Country ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{id:"cb-destinationCountry",type:"text",value:n.destinationCountry,onChange:a=>p("destinationCountry",a.target.value),placeholder:"e.g. United Kingdom","aria-required":"true","aria-describedby":"cb-form-errors","aria-label":"Destination country",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cb-destinationCountryCode",className:"block text-sm font-medium mb-1",children:"Country Code (ISO)"}),jsxRuntime.jsx("input",{id:"cb-destinationCountryCode",type:"text",value:n.destinationCountryCode,onChange:a=>p("destinationCountryCode",a.target.value),placeholder:"e.g. GB",maxLength:3,"aria-label":"Country code in ISO format",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"cb-recipientOrganization",className:"block text-sm font-medium mb-1",children:["Recipient Organization ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{id:"cb-recipientOrganization",type:"text",value:n.recipientOrganization,onChange:a=>p("recipientOrganization",a.target.value),placeholder:"Organization name","aria-required":"true","aria-describedby":"cb-form-errors",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"cb-transferMechanism",className:"block text-sm font-medium mb-1",children:["Transfer Mechanism ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("select",{id:"cb-transferMechanism",value:n.transferMechanism,onChange:a=>p("transferMechanism",a.target.value),"aria-required":"true","aria-describedby":"cb-form-errors",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,d),children:_.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cb-adequacyStatus",className:"block text-sm font-medium mb-1",children:"Adequacy Status"}),jsxRuntime.jsx("select",{id:"cb-adequacyStatus",value:n.adequacyStatus,onChange:a=>p("adequacyStatus",a.target.value),"aria-label":"Select adequacy status of destination country",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,d),children:G.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Risk Level"}),jsxRuntime.jsxs("select",{value:n.riskLevel,onChange:a=>p("riskLevel",a.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,d),children:[jsxRuntime.jsx("option",{value:"low",children:"Low"}),jsxRuntime.jsx("option",{value:"medium",children:"Medium"}),jsxRuntime.jsx("option",{value:"high",children:"High"})]})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{htmlFor:"cb-dataCategories",className:"block text-sm font-medium mb-1",children:["Data Categories ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{id:"cb-dataCategories",type:"text",value:n.dataCategories,onChange:a=>p("dataCategories",a.target.value),placeholder:"Comma-separated, e.g. Names, Email addresses, Phone numbers","aria-required":"true","aria-describedby":"cb-dataCategories-help",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,d)}),jsxRuntime.jsx("p",{id:"cb-dataCategories-help",className:"text-xs text-gray-500 mt-1",children:"Separate categories with commas"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"includesSensitiveData",checked:n.includesSensitiveData,onChange:a=>p("includesSensitiveData",a.target.checked),className:"h-4 w-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"includesSensitiveData",className:"text-sm font-medium",children:"Includes sensitive personal data"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Estimated Data Subjects"}),jsxRuntime.jsx("input",{type:"number",value:n.estimatedDataSubjects,onChange:a=>p("estimatedDataSubjects",a.target.value),placeholder:"Number of data subjects",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"cb-recipientContactName",className:"block text-sm font-medium mb-1",children:["Recipient Contact Name ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{id:"cb-recipientContactName",type:"text",value:n.recipientContactName,onChange:a=>p("recipientContactName",a.target.value),placeholder:"Contact person name","aria-required":"true","aria-describedby":"cb-form-errors",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"cb-recipientContactEmail",className:"block text-sm font-medium mb-1",children:["Recipient Contact Email ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{id:"cb-recipientContactEmail",type:"email",value:n.recipientContactEmail,onChange:a=>p("recipientContactEmail",a.target.value),placeholder:"contact@example.com","aria-required":"true","aria-describedby":"cb-form-errors",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Recipient Contact Phone"}),jsxRuntime.jsx("input",{type:"text",value:n.recipientContactPhone,onChange:a=>p("recipientContactPhone",a.target.value),placeholder:"Phone number",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Recipient Contact Address"}),jsxRuntime.jsx("input",{type:"text",value:n.recipientContactAddress,onChange:a=>p("recipientContactAddress",a.target.value),placeholder:"Address",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{htmlFor:"cb-purpose",className:"block text-sm font-medium mb-1",children:["Purpose of Transfer ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"cb-purpose",value:n.purpose,onChange:a=>p("purpose",a.target.value),placeholder:"Describe the purpose of this data transfer",rows:2,"aria-required":"true","aria-describedby":"cb-form-errors",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{htmlFor:"cb-safeguards",className:"block text-sm font-medium mb-1",children:["Safeguards ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"cb-safeguards",value:n.safeguards,onChange:a=>p("safeguards",a.target.value),placeholder:`One safeguard per line, e.g.
4
+ End-to-end encryption
5
+ Access control policies
6
+ Regular security audits`,rows:3,"aria-required":"true","aria-describedby":"cb-safeguards-help",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,d)}),jsxRuntime.jsx("p",{id:"cb-safeguards-help",className:"text-xs text-gray-500 mt-1",children:"Enter one safeguard per line"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{htmlFor:"cb-riskAssessment",className:"block text-sm font-medium mb-1",children:["Risk Assessment Summary ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"cb-riskAssessment",value:n.riskAssessment,onChange:a=>p("riskAssessment",a.target.value),placeholder:"Summarize the risk assessment for this transfer",rows:2,"aria-required":"true","aria-describedby":"cb-form-errors",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Transfer Frequency"}),jsxRuntime.jsx("select",{value:n.frequency,onChange:a=>p("frequency",a.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,d),children:J.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Status"}),jsxRuntime.jsx("select",{value:n.status,onChange:a=>p("status",a.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,d),children:X.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]})]}),e&&jsxRuntime.jsxs("div",{className:"mt-4 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium text-blue-800 dark:text-blue-200 mb-3",children:"NDPC Approval Required"}),jsxRuntime.jsx("p",{className:"text-xs text-blue-700 dark:text-blue-300 mb-3",children:"The selected transfer mechanism requires approval from the Nigeria Data Protection Commission."}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"ndpcApprovalApplied",checked:n.ndpcApprovalApplied,onChange:a=>p("ndpcApprovalApplied",a.target.checked),className:"h-4 w-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"ndpcApprovalApplied",className:"text-sm",children:"Application submitted"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"ndpcApprovalApproved",checked:n.ndpcApprovalApproved,onChange:a=>p("ndpcApprovalApproved",a.target.checked),className:"h-4 w-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"ndpcApprovalApproved",className:"text-sm",children:"Approval granted"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"NDPC Reference Number"}),jsxRuntime.jsx("input",{type:"text",value:n.ndpcApprovalReference,onChange:a=>p("ndpcApprovalReference",a.target.value),placeholder:"Reference number (if available)",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,d)})]})]})]}),ie&&jsxRuntime.jsxs("div",{className:"mt-4 p-4 bg-gray-100 dark:bg-gray-600 rounded-md",children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium mb-3",children:"Transfer Impact Assessment"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"tiaCompleted",checked:n.tiaCompleted,onChange:a=>p("tiaCompleted",a.target.checked),className:"h-4 w-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"tiaCompleted",className:"text-sm",children:"TIA completed"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"TIA Reference"}),jsxRuntime.jsx("input",{type:"text",value:n.tiaReference,onChange:a=>p("tiaReference",a.target.value),placeholder:"Document reference",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,d)})]})]})]}),jsxRuntime.jsxs("div",{className:"mt-4 flex justify-end gap-3",children:[jsxRuntime.jsx("button",{onClick:U,className:"px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-md text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-600",children:"Cancel"}),jsxRuntime.jsx("button",{onClick:pe,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${P}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),d),children:x?"Update Transfer":"Add Transfer"})]})]})},ge=e=>{var u,v;let a=chunkC4YM4UMI_js.h(e),l=chunkC4YM4UMI_js.g(e);return jsxRuntime.jsxs("div",{role:"status","aria-label":"Transfer details",className:chunkE64TU6IU_js.a("",r==null?void 0:r.detailPanel,d),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxRuntime.jsxs("h3",{className:"text-lg font-medium",children:[e.destinationCountry," \u2014 ",e.recipientOrganization]}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[Y(e.status),H(e.riskLevel)]})]}),!l.isValid&&jsxRuntime.jsxs("div",{className:"mb-4 bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Compliance Issues"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm text-red-700 dark:text-red-300",children:l.errors.map((s,m)=>jsxRuntime.jsx("li",{children:s},m))})]}),l.warnings.length>0&&jsxRuntime.jsxs("div",{className:"mb-4 bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-yellow-800 dark:text-yellow-200 mb-1",children:"Warnings"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm text-yellow-700 dark:text-yellow-300",children:l.warnings.map((s,m)=>jsxRuntime.jsx("li",{children:s},m))})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Destination:"})," ",e.destinationCountry,e.destinationCountryCode?` (${e.destinationCountryCode})`:""]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Adequacy:"})," ",(u=G.find(s=>s.value===e.adequacyStatus))==null?void 0:u.label]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Frequency:"})," ",(v=J.find(s=>s.value===e.frequency))==null?void 0:v.label]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Start Date:"})," ",k(e.startDate)]}),e.endDate&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"End Date:"})," ",k(e.endDate)]}),e.reviewDate&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Next Review:"})," ",k(e.reviewDate)]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Recipient:"})," ",e.recipientOrganization]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Contact:"})," ",e.recipientContact.name," (",e.recipientContact.email,")"]}),e.estimatedDataSubjects&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Subjects:"})," ",e.estimatedDataSubjects.toLocaleString()]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Sensitive Data:"})," ",e.includesSensitiveData?"Yes":"No"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"Transfer Mechanism"}),jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:jsxRuntime.jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200",children:chunkC4YM4UMI_js.f(e.transferMechanism)})})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"Purpose"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md",children:e.purpose})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"Data Categories"}),jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1",children:e.dataCategories.map((s,m)=>jsxRuntime.jsx("span",{className:"px-2 py-1 bg-gray-100 dark:bg-gray-600 rounded text-xs",children:s},m))})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"Safeguards"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm text-gray-600 dark:text-gray-300",children:e.safeguards.map((s,m)=>jsxRuntime.jsx("li",{children:s},m))})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"Risk Assessment"}),jsxRuntime.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200 mb-2",children:e.riskAssessment}),jsxRuntime.jsxs("div",{className:"mt-2",role:"status","aria-label":"Automated risk assessment result",children:[jsxRuntime.jsxs("p",{className:"text-xs font-medium text-gray-600 dark:text-gray-400 mb-1",children:["Automated Assessment (Score: ",a.riskScore,")"]}),a.factors.length>0&&jsxRuntime.jsx("ul",{className:"list-disc list-inside text-xs text-gray-600 dark:text-gray-400",children:a.factors.map((s,m)=>jsxRuntime.jsx("li",{children:s},m))}),a.recommendations.length>0&&jsxRuntime.jsxs("div",{className:"mt-2",children:[jsxRuntime.jsx("p",{className:"text-xs font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Recommendations:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-xs text-gray-600 dark:text-gray-400",children:a.recommendations.map((s,m)=>jsxRuntime.jsx("li",{children:s},m))})]})]})]})]}),e.ndpcApproval&&jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"NDPC Approval"}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`p-3 rounded-md ${e.ndpcApproval.approved?"bg-green-50 dark:bg-green-900/20":e.ndpcApproval.applied?"bg-yellow-50 dark:bg-yellow-900/20":"bg-red-50 dark:bg-red-900/20"}`,r==null?void 0:r.approvalStatus,d),children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",e.ndpcApproval.approved?"Approved":e.ndpcApproval.applied?"Application Submitted":"Not Applied"]}),e.ndpcApproval.referenceNumber&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reference:"})," ",e.ndpcApproval.referenceNumber]}),e.ndpcApproval.appliedAt&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Applied:"})," ",k(e.ndpcApproval.appliedAt)]}),e.ndpcApproval.approvedAt&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Approved:"})," ",k(e.ndpcApproval.approvedAt)]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"Transfer Impact Assessment"}),jsxRuntime.jsxs("div",{className:`p-3 rounded-md ${e.tiaCompleted?"bg-green-50 dark:bg-green-900/20":"bg-yellow-50 dark:bg-yellow-900/20"}`,children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",e.tiaCompleted?"Completed":"Not Completed"]}),e.tiaReference&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reference:"})," ",e.tiaReference]})]})]}),jsxRuntime.jsxs("div",{className:"flex gap-3 mt-6",children:[jsxRuntime.jsx("button",{onClick:()=>le(e),"aria-label":`Edit transfer to ${e.destinationCountry}`,className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${P}`,children:"Edit"}),jsxRuntime.jsx("button",{onClick:()=>se(e.id),"aria-label":`Remove transfer to ${e.destinationCountry}`,className:"px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700",children:"Remove"})]})]})};return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${re}`,r==null?void 0:r.root,d),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",r==null?void 0:r.title,d),children:ee}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:te}),ae&&ce(),!j&&jsxRuntime.jsx("div",{className:"mb-6",children:jsxRuntime.jsx("button",{onClick:oe,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${P}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),d),children:"Add Transfer"})}),j&&me(),jsxRuntime.jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cbStatusFilter",className:"block text-sm font-medium mb-1",children:"Status Filter"}),jsxRuntime.jsxs("select",{id:"cbStatusFilter",value:S,onChange:e=>ne(e.target.value),"aria-label":"Filter transfers by status",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,d),children:[jsxRuntime.jsx("option",{value:"all",children:"All Statuses"}),X.map(e=>jsxRuntime.jsx("option",{value:e.value,children:e.label},e.value))]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cbMechanismFilter",className:"block text-sm font-medium mb-1",children:"Mechanism Filter"}),jsxRuntime.jsxs("select",{id:"cbMechanismFilter",value:T,onChange:e=>de(e.target.value),"aria-label":"Filter transfers by mechanism",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,d),children:[jsxRuntime.jsx("option",{value:"all",children:"All Mechanisms"}),_.map(e=>jsxRuntime.jsx("option",{value:e.value,children:e.label},e.value))]})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[jsxRuntime.jsxs("div",{className:"md:col-span-1",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Transfers"}),C.length===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No cross-border transfers found."}):jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-2 max-h-96 overflow-y-auto pr-2",r==null?void 0:r.transferList,d),children:C.map(e=>{var a,l;return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`p-3 rounded-md cursor-pointer ${b===e.id?"bg-[rgb(var(--ndpr-primary)/0.05)] dark:bg-[rgb(var(--ndpr-primary)/0.1)] border border-[rgb(var(--ndpr-primary)/0.2)] dark:border-[rgb(var(--ndpr-primary)/0.3)]":"bg-gray-50 dark:bg-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600"}`,r==null?void 0:r.transferItem,d),role:"button",tabIndex:0,"aria-label":`View transfer to ${e.destinationCountry}`,onClick:()=>A(e.id),onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),A(e.id));},children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:e.destinationCountry}),H(e.riskLevel)]}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:e.recipientOrganization}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:ue(e.transferMechanism)}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center mt-2",children:[Y(e.status),((a=e.ndpcApproval)==null?void 0:a.required)&&!((l=e.ndpcApproval)!=null&&l.approved)&&jsxRuntime.jsx("span",{className:"text-xs text-purple-600 dark:text-purple-400",children:"NDPC Pending"})]})]},e.id)})})]}),jsxRuntime.jsx("div",{className:"md:col-span-2",children:$?ge($):jsxRuntime.jsx("div",{className:"flex items-center justify-center h-64 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Select a transfer to view details"})})})]})]})};exports.a=Ce;//# sourceMappingURL=chunk-GMLCWGNJ.js.map
7
+ //# sourceMappingURL=chunk-GMLCWGNJ.js.map