@tantainnovative/ndpr-toolkit 2.1.2 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/README.md +73 -2
  2. package/dist/{breach-6z0r-KuE.d.mts → breach-B_-6lDqS.d.mts} +1 -1
  3. package/dist/{breach-BFfnvtRk.d.ts → breach-CzXqSsaY.d.ts} +1 -1
  4. package/dist/{breach-BtFbDOmV.d.mts → breach-Eu9byel8.d.mts} +1 -1
  5. package/dist/{breach-BtFbDOmV.d.ts → breach-Eu9byel8.d.ts} +1 -1
  6. package/dist/breach-ouXoVTWs.d.ts +438 -0
  7. package/dist/breach-yRiyyc4n.d.mts +438 -0
  8. package/dist/breach.d.mts +5 -275
  9. package/dist/breach.d.ts +5 -275
  10. package/dist/breach.js +1 -1
  11. package/dist/breach.mjs +1 -1
  12. package/dist/chunk-2XFAV267.mjs +2 -0
  13. package/dist/chunk-32UIWTGD.js +72 -0
  14. package/dist/chunk-4JUDKBA2.mjs +7 -0
  15. package/dist/chunk-4VVARDN2.mjs +2 -0
  16. package/dist/chunk-5RSOLEEP.js +63 -0
  17. package/dist/chunk-AYKLAEOU.mjs +2 -0
  18. package/dist/chunk-BGHQTZAC.js +94 -0
  19. package/dist/chunk-BZTTQS4A.mjs +7 -0
  20. package/dist/chunk-CAB7O3GR.mjs +63 -0
  21. package/dist/chunk-CL53OI3I.js +7 -0
  22. package/dist/chunk-E64TU6IU.js +2 -0
  23. package/dist/chunk-EKVTLHBQ.js +2 -0
  24. package/dist/chunk-ELKEZEV5.mjs +2 -0
  25. package/dist/chunk-EPF7J2FK.js +3 -0
  26. package/dist/chunk-ER7X6E36.js +2 -0
  27. package/dist/chunk-FXTZDKDC.mjs +3 -0
  28. package/dist/chunk-IBEKLDBY.mjs +2 -0
  29. package/dist/chunk-ILCNDOBU.js +2 -0
  30. package/dist/chunk-K3GMTMQ6.js +2 -0
  31. package/dist/chunk-MJGOLP5M.js +2 -0
  32. package/dist/chunk-NW4A3JW6.mjs +2 -0
  33. package/dist/chunk-P3PULLYP.mjs +2 -0
  34. package/dist/chunk-SKJCQKFL.mjs +94 -0
  35. package/dist/chunk-TCJCE6WN.js +2 -0
  36. package/dist/chunk-UZ5EZOA7.js +2 -0
  37. package/dist/chunk-WSHSHIIM.mjs +2 -0
  38. package/dist/chunk-XMYUYQH7.mjs +72 -0
  39. package/dist/chunk-ZNTMZ6NM.js +7 -0
  40. package/dist/consent-audit-BdByjYlM.d.mts +65 -0
  41. package/dist/consent-audit-DhbfMR0n.d.ts +65 -0
  42. package/dist/consent.d.mts +120 -7
  43. package/dist/consent.d.ts +120 -7
  44. package/dist/consent.js +1 -1
  45. package/dist/consent.mjs +1 -1
  46. package/dist/core.d.mts +62 -12
  47. package/dist/core.d.ts +62 -12
  48. package/dist/core.js +1 -1
  49. package/dist/core.mjs +1 -1
  50. package/dist/{cross-border-BrIy1ieh.d.ts → cross-border-BMcqLvjC.d.mts} +1 -1
  51. package/dist/{cross-border-BrIy1ieh.d.mts → cross-border-BMcqLvjC.d.ts} +1 -1
  52. package/dist/cross-border-entry-BrWVPly6.d.ts +91 -0
  53. package/dist/cross-border-entry-cCTvpwnT.d.mts +91 -0
  54. package/dist/cross-border.d.mts +4 -58
  55. package/dist/cross-border.d.ts +4 -58
  56. package/dist/cross-border.js +1 -1
  57. package/dist/cross-border.mjs +1 -1
  58. package/dist/{dpia-vWfE_9bO.d.mts → dpia-5OQVA1R_.d.mts} +1 -1
  59. package/dist/{dpia-vWfE_9bO.d.ts → dpia-5OQVA1R_.d.ts} +1 -1
  60. package/dist/{dpia-fdtTd2DI.d.ts → dpia-B0Pok5us.d.ts} +1 -1
  61. package/dist/{dpia-B9ZZJG5a.d.mts → dpia-CUfOmzvX.d.mts} +1 -1
  62. package/dist/dpia.d.mts +119 -5
  63. package/dist/dpia.d.ts +119 -5
  64. package/dist/dpia.js +1 -1
  65. package/dist/dpia.mjs +1 -1
  66. package/dist/dsr-190YpijW.d.ts +307 -0
  67. package/dist/dsr-BTT-Xd7H.d.mts +307 -0
  68. package/dist/{dsr-pQzQ3H1O.d.mts → dsr-Cm9lzWG7.d.mts} +1 -1
  69. package/dist/{dsr-pQzQ3H1O.d.ts → dsr-Cm9lzWG7.d.ts} +1 -1
  70. package/dist/{dsr-whPkiI0_.d.mts → dsr-D_eTNc4S.d.mts} +1 -1
  71. package/dist/{dsr-jq5NUEdz.d.ts → dsr-pNtVb1BK.d.ts} +1 -1
  72. package/dist/dsr.d.mts +5 -192
  73. package/dist/dsr.d.ts +5 -192
  74. package/dist/dsr.js +1 -1
  75. package/dist/dsr.mjs +1 -1
  76. package/dist/hooks.d.mts +14 -14
  77. package/dist/hooks.d.ts +14 -14
  78. package/dist/hooks.js +1 -1
  79. package/dist/hooks.mjs +1 -1
  80. package/dist/index.d.mts +28 -27
  81. package/dist/index.d.ts +28 -27
  82. package/dist/index.js +1 -1
  83. package/dist/index.mjs +1 -1
  84. package/dist/{lawful-basis-v04AhbK2.d.ts → lawful-basis-BEyI0kGg.d.ts} +2 -2
  85. package/dist/{lawful-basis-D-oXFizg.d.mts → lawful-basis-C2eGaoHM.d.mts} +2 -2
  86. package/dist/{lawful-basis-CWtvDG1x.d.mts → lawful-basis-Cv1VmDLn.d.mts} +1 -1
  87. package/dist/{lawful-basis-CWtvDG1x.d.ts → lawful-basis-Cv1VmDLn.d.ts} +1 -1
  88. package/dist/lawful-basis-entry-15qjKcNO.d.ts +87 -0
  89. package/dist/lawful-basis-entry-CxZrofwG.d.mts +87 -0
  90. package/dist/lawful-basis.d.mts +5 -55
  91. package/dist/lawful-basis.d.ts +5 -55
  92. package/dist/lawful-basis.js +1 -1
  93. package/dist/lawful-basis.mjs +1 -1
  94. package/dist/policy-D2_jh5-T.d.ts +293 -0
  95. package/dist/policy-E0fXZkda.d.mts +293 -0
  96. package/dist/policy-templates-CIKcV0i1.d.ts +36 -0
  97. package/dist/policy-templates-DMsPwOSZ.d.mts +36 -0
  98. package/dist/policy.d.mts +5 -195
  99. package/dist/policy.d.ts +5 -195
  100. package/dist/policy.js +1 -1
  101. package/dist/policy.mjs +1 -1
  102. package/dist/{ropa-Rb4dsFSz.d.mts → ropa-DP7pPPql.d.mts} +2 -2
  103. package/dist/{ropa-BebGfqKQ.d.ts → ropa-Li6UlL5H.d.ts} +2 -2
  104. package/dist/ropa-entry-B0D7X1GV.d.ts +80 -0
  105. package/dist/ropa-entry-DiOThOc2.d.mts +80 -0
  106. package/dist/ropa.d.mts +5 -45
  107. package/dist/ropa.d.ts +5 -45
  108. package/dist/ropa.js +1 -1
  109. package/dist/ropa.mjs +1 -1
  110. package/dist/styles.css +40 -28
  111. package/dist/styles.d.ts +1 -0
  112. package/dist/unstyled.js +1 -1
  113. package/dist/unstyled.mjs +1 -1
  114. package/dist/{useBreach-WrZzJilM.d.mts → useBreach-BBSoIcZO.d.mts} +1 -1
  115. package/dist/{useBreach-vrh_XMpI.d.ts → useBreach-lFLbSyAN.d.ts} +1 -1
  116. package/dist/{useCrossBorderTransfer-TVnY8_UX.d.mts → useCrossBorderTransfer-BZVFCXfr.d.mts} +1 -1
  117. package/dist/{useCrossBorderTransfer-D4FQYfFt.d.ts → useCrossBorderTransfer-DmtACeqW.d.ts} +1 -1
  118. package/dist/{useDPIA-DFDHBLSa.d.ts → useDPIA-DBsg2yZx.d.ts} +1 -1
  119. package/dist/{useDPIA-FqPofFaV.d.mts → useDPIA-Da7-Q_yW.d.mts} +1 -1
  120. package/dist/{useDSR-DAqqOBXb.d.ts → useDSR-CYI7WCXr.d.ts} +1 -1
  121. package/dist/{useDSR-OXM5Q9rf.d.mts → useDSR-YYZ6FYFs.d.mts} +1 -1
  122. package/dist/{usePrivacyPolicy-CfySfBLS.d.ts → useDefaultPrivacyPolicy-B7kTHbZh.d.ts} +39 -2
  123. package/dist/{usePrivacyPolicy-Dit2sFuV.d.mts → useDefaultPrivacyPolicy-CUluF_ic.d.mts} +39 -2
  124. package/dist/{useLawfulBasis-RILM_xsx.d.ts → useLawfulBasis-CCWF9waR.d.ts} +2 -2
  125. package/dist/{useLawfulBasis-DNQ8YszQ.d.mts → useLawfulBasis-CpWuHtyh.d.mts} +2 -2
  126. package/dist/{useROPA-Bcs6cRdi.d.ts → useROPA-BhJ3kvHp.d.ts} +1 -1
  127. package/dist/{useROPA-nmcSiUYv.d.mts → useROPA-DLFdjkxP.d.mts} +1 -1
  128. package/package.json +30 -21
  129. package/dist/chunk-2XHD22J7.mjs +0 -7
  130. package/dist/chunk-4DKT6IB6.js +0 -94
  131. package/dist/chunk-6JFTAYXV.mjs +0 -2
  132. package/dist/chunk-6JVYYLS7.js +0 -2
  133. package/dist/chunk-6SGG6WPA.mjs +0 -2
  134. package/dist/chunk-AQEGDEQM.js +0 -7
  135. package/dist/chunk-C2IJWCZQ.mjs +0 -2
  136. package/dist/chunk-DB3JH4DS.mjs +0 -2
  137. package/dist/chunk-FFW7RUAG.mjs +0 -94
  138. package/dist/chunk-FK3CSFLJ.js +0 -2
  139. package/dist/chunk-IWUUVRLJ.js +0 -2
  140. package/dist/chunk-JUN6YPLL.mjs +0 -72
  141. package/dist/chunk-L3FKTBGV.js +0 -72
  142. package/dist/chunk-PM7CMTMB.js +0 -4
  143. package/dist/chunk-RB26MIRI.js +0 -2
  144. package/dist/chunk-RHWW5FDP.js +0 -16
  145. package/dist/chunk-SLNMKGQ2.mjs +0 -2
  146. package/dist/chunk-UUWVBENC.js +0 -2
  147. package/dist/chunk-UYP64PV7.mjs +0 -4
  148. package/dist/chunk-XMKA6GVK.mjs +0 -16
  149. package/dist/consent-DCc5zjXI.d.mts +0 -24
  150. package/dist/consent-DLWb5ota.d.ts +0 -24
  151. package/dist/privacy-9FcJceMr.d.mts +0 -15
  152. package/dist/privacy-BXz7O2ej.d.ts +0 -15
package/dist/breach.d.ts CHANGED
@@ -1,275 +1,5 @@
1
- import React from 'react';
2
- import { a as BreachCategory, B as BreachReport, R as RiskAssessment, b as RegulatoryNotification } from './breach-BtFbDOmV.js';
3
- export { N as NotificationRequirement } from './breach-BtFbDOmV.js';
4
- export { u as useBreach } from './useBreach-vrh_XMpI.js';
5
- export { c as calculateBreachSeverity } from './breach-BFfnvtRk.js';
6
-
7
- interface BreachReportFormProps {
8
- /**
9
- * Available breach categories
10
- */
11
- categories: BreachCategory[];
12
- /**
13
- * Callback function called when form is submitted
14
- */
15
- onSubmit: (formData: any) => void;
16
- /**
17
- * Title displayed on the form
18
- * @default "Report a Data Breach"
19
- */
20
- title?: string;
21
- /**
22
- * Description text displayed on the form
23
- * @default "Use this form to report a suspected or confirmed data breach. All fields marked with * are required."
24
- */
25
- formDescription?: string;
26
- /**
27
- * Text for the submit button
28
- * @default "Submit Report"
29
- */
30
- submitButtonText?: string;
31
- /**
32
- * Custom CSS class for the form
33
- */
34
- className?: string;
35
- /**
36
- * Custom CSS class for the submit button
37
- */
38
- buttonClassName?: string;
39
- /**
40
- * Whether to show a confirmation message after submission
41
- * @default true
42
- */
43
- showConfirmation?: boolean;
44
- /**
45
- * Confirmation message to display after submission
46
- * @default "Your breach report has been submitted successfully. The data protection team has been notified."
47
- */
48
- confirmationMessage?: string;
49
- /**
50
- * Whether to allow file attachments
51
- * @default true
52
- */
53
- allowAttachments?: boolean;
54
- /**
55
- * Maximum number of attachments allowed
56
- * @default 5
57
- */
58
- maxAttachments?: number;
59
- /**
60
- * Maximum file size for attachments (in bytes)
61
- * @default 5242880 (5MB)
62
- */
63
- maxFileSize?: number;
64
- /**
65
- * Allowed file types for attachments
66
- * @default ['.pdf', '.jpg', '.jpeg', '.png', '.doc', '.docx', '.xls', '.xlsx', '.txt']
67
- */
68
- allowedFileTypes?: string[];
69
- }
70
- declare const BreachReportForm: React.FC<BreachReportFormProps>;
71
-
72
- interface BreachRiskAssessmentProps {
73
- /**
74
- * The breach data to assess
75
- */
76
- breachData: BreachReport;
77
- /**
78
- * Initial assessment data (if editing an existing assessment)
79
- */
80
- initialAssessment?: Partial<RiskAssessment>;
81
- /**
82
- * Callback function called when assessment is completed
83
- */
84
- onComplete: (assessment: RiskAssessment) => void;
85
- /**
86
- * Title displayed on the assessment form
87
- * @default "Breach Risk Assessment"
88
- */
89
- title?: string;
90
- /**
91
- * Description text displayed on the assessment form
92
- * @default "Assess the risk level of this data breach to determine notification requirements."
93
- */
94
- description?: string;
95
- /**
96
- * Text for the submit button
97
- * @default "Complete Assessment"
98
- */
99
- submitButtonText?: string;
100
- /**
101
- * Custom CSS class for the form
102
- */
103
- className?: string;
104
- /**
105
- * Custom CSS class for the submit button
106
- */
107
- buttonClassName?: string;
108
- /**
109
- * Whether to show the breach summary
110
- * @default true
111
- */
112
- showBreachSummary?: boolean;
113
- /**
114
- * Whether to show notification requirements after assessment
115
- * @default true
116
- */
117
- showNotificationRequirements?: boolean;
118
- }
119
- declare const BreachRiskAssessment: React.FC<BreachRiskAssessmentProps>;
120
-
121
- interface BreachNotificationManagerProps {
122
- /**
123
- * List of breach reports to manage
124
- */
125
- breachReports: BreachReport[];
126
- /**
127
- * List of risk assessments
128
- */
129
- riskAssessments: RiskAssessment[];
130
- /**
131
- * List of regulatory notifications
132
- */
133
- regulatoryNotifications: RegulatoryNotification[];
134
- /**
135
- * Callback function called when a breach is selected
136
- */
137
- onSelectBreach?: (breachId: string) => void;
138
- /**
139
- * Callback function called when a risk assessment is requested
140
- */
141
- onRequestAssessment?: (breachId: string) => void;
142
- /**
143
- * Callback function called when a notification is requested
144
- */
145
- onRequestNotification?: (breachId: string) => void;
146
- /**
147
- * Title displayed on the manager
148
- * @default "Breach Notification Manager"
149
- */
150
- title?: string;
151
- /**
152
- * Description text displayed on the manager
153
- * @default "Manage data breach notifications and track compliance with NDPA requirements."
154
- */
155
- description?: string;
156
- /**
157
- * Custom CSS class for the manager
158
- */
159
- className?: string;
160
- /**
161
- * Custom CSS class for the buttons
162
- */
163
- buttonClassName?: string;
164
- /**
165
- * Whether to show the breach details
166
- * @default true
167
- */
168
- showBreachDetails?: boolean;
169
- /**
170
- * Whether to show the notification timeline
171
- * @default true
172
- */
173
- showNotificationTimeline?: boolean;
174
- /**
175
- * Whether to show the deadline alerts
176
- * @default true
177
- */
178
- showDeadlineAlerts?: boolean;
179
- }
180
- declare const BreachNotificationManager: React.FC<BreachNotificationManagerProps>;
181
-
182
- interface OrganizationInfo {
183
- /**
184
- * Name of the organization
185
- */
186
- name: string;
187
- /**
188
- * Registration number or business ID
189
- */
190
- registrationNumber?: string;
191
- /**
192
- * Physical address of the organization
193
- */
194
- address: string;
195
- /**
196
- * Website URL
197
- */
198
- website?: string;
199
- /**
200
- * Name of the Data Protection Officer
201
- */
202
- dpoName: string;
203
- /**
204
- * Email of the Data Protection Officer
205
- */
206
- dpoEmail: string;
207
- /**
208
- * Phone number of the Data Protection Officer
209
- */
210
- dpoPhone?: string;
211
- }
212
- interface RegulatoryReportGeneratorProps {
213
- /**
214
- * The breach data to include in the report
215
- */
216
- breachData: BreachReport;
217
- /**
218
- * The risk assessment data
219
- */
220
- assessmentData?: RiskAssessment;
221
- /**
222
- * Organization information to include in the report
223
- */
224
- organizationInfo: OrganizationInfo;
225
- /**
226
- * Callback function called when the report is generated
227
- */
228
- onGenerate: (report: RegulatoryNotification) => void;
229
- /**
230
- * Title displayed on the generator form
231
- * @default "Generate NDPC Notification Report"
232
- */
233
- title?: string;
234
- /**
235
- * Description text displayed on the generator form
236
- * @default "Generate a report for submission to the NDPC in compliance with the NDPA breach notification requirements."
237
- */
238
- description?: string;
239
- /**
240
- * Text for the generate button
241
- * @default "Generate Report"
242
- */
243
- generateButtonText?: string;
244
- /**
245
- * Custom CSS class for the form
246
- */
247
- className?: string;
248
- /**
249
- * Custom CSS class for the buttons
250
- */
251
- buttonClassName?: string;
252
- /**
253
- * Whether to show a preview of the generated report
254
- * @default true
255
- */
256
- showPreview?: boolean;
257
- /**
258
- * Whether to allow editing the report content
259
- * @default true
260
- */
261
- allowEditing?: boolean;
262
- /**
263
- * Whether to allow downloading the report
264
- * @default true
265
- */
266
- allowDownload?: boolean;
267
- /**
268
- * Format for downloading the report
269
- * @default "pdf"
270
- */
271
- downloadFormat?: 'pdf' | 'docx' | 'html';
272
- }
273
- declare const RegulatoryReportGenerator: React.FC<RegulatoryReportGeneratorProps>;
274
-
275
- export { BreachCategory, BreachNotificationManager, BreachReport, BreachReportForm, BreachRiskAssessment, RegulatoryNotification, RegulatoryReportGenerator, RiskAssessment };
1
+ export { a as BreachNotificationManager, b as BreachNotificationManagerClassNames, c as BreachReportForm, d as BreachReportFormClassNames, e as BreachRiskAssessment, f as BreachRiskAssessmentClassNames, R as RegulatoryReportGenerator, g as RegulatoryReportGeneratorClassNames } from './breach-ouXoVTWs.js';
2
+ export { u as useBreach } from './useBreach-lFLbSyAN.js';
3
+ export { c as calculateBreachSeverity } from './breach-CzXqSsaY.js';
4
+ export { B as BreachCategory, a as BreachReport, N as NotificationRequirement, R as RegulatoryNotification, b as RiskAssessment } from './breach-Eu9byel8.js';
5
+ import 'react';
package/dist/breach.js CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkL3FKTBGV_js=require('./chunk-L3FKTBGV.js'),chunkLI6WJ3LZ_js=require('./chunk-LI6WJ3LZ.js'),chunkRYZEIDNR_js=require('./chunk-RYZEIDNR.js');require('./chunk-MQFZHA2D.js');Object.defineProperty(exports,"BreachNotificationManager",{enumerable:true,get:function(){return chunkL3FKTBGV_js.c}});Object.defineProperty(exports,"BreachReportForm",{enumerable:true,get:function(){return chunkL3FKTBGV_js.a}});Object.defineProperty(exports,"BreachRiskAssessment",{enumerable:true,get:function(){return chunkL3FKTBGV_js.b}});Object.defineProperty(exports,"RegulatoryReportGenerator",{enumerable:true,get:function(){return chunkL3FKTBGV_js.d}});Object.defineProperty(exports,"useBreach",{enumerable:true,get:function(){return chunkLI6WJ3LZ_js.a}});Object.defineProperty(exports,"calculateBreachSeverity",{enumerable:true,get:function(){return chunkRYZEIDNR_js.a}});//# sourceMappingURL=breach.js.map
1
+ 'use strict';var chunk32UIWTGD_js=require('./chunk-32UIWTGD.js'),chunkLI6WJ3LZ_js=require('./chunk-LI6WJ3LZ.js'),chunkRYZEIDNR_js=require('./chunk-RYZEIDNR.js');require('./chunk-EPF7J2FK.js'),require('./chunk-E64TU6IU.js'),require('./chunk-MQFZHA2D.js');Object.defineProperty(exports,"BreachNotificationManager",{enumerable:true,get:function(){return chunk32UIWTGD_js.c}});Object.defineProperty(exports,"BreachReportForm",{enumerable:true,get:function(){return chunk32UIWTGD_js.a}});Object.defineProperty(exports,"BreachRiskAssessment",{enumerable:true,get:function(){return chunk32UIWTGD_js.b}});Object.defineProperty(exports,"RegulatoryReportGenerator",{enumerable:true,get:function(){return chunk32UIWTGD_js.d}});Object.defineProperty(exports,"useBreach",{enumerable:true,get:function(){return chunkLI6WJ3LZ_js.a}});Object.defineProperty(exports,"calculateBreachSeverity",{enumerable:true,get:function(){return chunkRYZEIDNR_js.a}});//# sourceMappingURL=breach.js.map
2
2
  //# sourceMappingURL=breach.js.map
package/dist/breach.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export{c as BreachNotificationManager,a as BreachReportForm,b as BreachRiskAssessment,d as RegulatoryReportGenerator}from'./chunk-JUN6YPLL.mjs';export{a as useBreach}from'./chunk-OITITR6K.mjs';export{a as calculateBreachSeverity}from'./chunk-RGYK4VAY.mjs';import'./chunk-WWT2ZSNU.mjs';//# sourceMappingURL=breach.mjs.map
1
+ export{c as BreachNotificationManager,a as BreachReportForm,b as BreachRiskAssessment,d as RegulatoryReportGenerator}from'./chunk-XMYUYQH7.mjs';export{a as useBreach}from'./chunk-OITITR6K.mjs';export{a as calculateBreachSeverity}from'./chunk-RGYK4VAY.mjs';import'./chunk-FXTZDKDC.mjs';import'./chunk-AYKLAEOU.mjs';import'./chunk-WWT2ZSNU.mjs';//# sourceMappingURL=breach.mjs.map
2
2
  //# sourceMappingURL=breach.mjs.map
@@ -0,0 +1,2 @@
1
+ import {a,d}from'./chunk-CAB7O3GR.mjs';import {b,a as a$1}from'./chunk-WWT2ZSNU.mjs';import {useState,useEffect}from'react';function O({templates:y,initialPolicy:c,storageKey:f="ndpr_privacy_policy",useLocalStorage:m=true,onGenerate:g}){let[n,u]=useState(c||null),[a$2,p]=useState(null),[d,P]=useState({name:"",website:"",privacyEmail:"",address:"",privacyPhone:"",dpoName:"",dpoEmail:"",industry:""});useEffect(()=>{if(m&&typeof window!="undefined"&&!c)try{let i=localStorage.getItem(f);if(i){let{policy:o,template:e,organizationInfo:t}=JSON.parse(i);if(o&&u(o),e){let s=y.find(x=>x.id===e.id);s&&p(s);}t&&P(t);}}catch(i){console.error("Error loading privacy policy data:",i);}},[f,m,c,y]),useEffect(()=>{if(m&&typeof window!="undefined")try{localStorage.setItem(f,JSON.stringify({policy:n,template:a$2,organizationInfo:d}));}catch(i){console.error("Error saving privacy policy data:",i);}},[n,a$2,d,f,m]);let V=i=>{let o=y.find(s=>s.id===i);if(!o)return false;p(o);o.sections.map(s=>b(a$1({},s),{customContent:void 0}));return Object.keys(o.variables).forEach(s=>{o.variables[s].defaultValue||"";}),true},h=i=>{P(o=>a$1(a$1({},o),i));},w=(i,o)=>{a$2&&(n?u(e=>e&&b(a$1({},e),{sections:e.sections.map(t=>t.id===i?b(a$1({},t),{included:o}):t)})):p(e=>e&&b(a$1({},e),{sections:e.sections.map(t=>t.id===i?b(a$1({},t),{included:o}):t)})));},z=(i,o)=>{a$2&&(n?u(e=>e&&b(a$1({},e),{sections:e.sections.map(t=>t.id===i?b(a$1({},t),{customContent:o}):t)})):p(e=>e&&b(a$1({},e),{sections:e.sections.map(t=>t.id===i?b(a$1({},t),{customContent:o}):t)})));},E=(i,o)=>{n&&u(e=>e&&b(a$1({},e),{variableValues:b(a$1({},e.variableValues),{[i]:o})}));},S=()=>"policy_"+Date.now()+"_"+Math.random().toString(36).substr(2,9);return {policy:n,selectedTemplate:a$2,organizationInfo:d,selectTemplate:V,updateOrganizationInfo:h,toggleSection:w,updateSectionContent:z,updateVariableValue:E,generatePolicy:()=>{if(!a$2)throw new Error("No template selected");let i=Date.now(),o={id:(n==null?void 0:n.id)||S(),title:`Privacy Policy for ${d.name}`,templateId:a$2.id,organizationInfo:d,sections:a$2.sections.map(e=>{var t;return b(a$1({},e),{customContent:(t=n==null?void 0:n.sections.find(s=>s.id===e.id))==null?void 0:t.customContent})}),variableValues:(n==null?void 0:n.variableValues)||{},effectiveDate:i,lastUpdated:i,version:"1.0"};return u(o),g&&g(o),o},getPolicyText:()=>{if(!n)return {fullText:"",sectionTexts:{},missingVariables:[]};let i=a(n.sections,n.organizationInfo);return typeof i=="string"?{fullText:i,sectionTexts:{full:i},missingVariables:[]}:i},resetPolicy:()=>{u(null),p(null),P({name:"",website:"",privacyEmail:"",address:"",privacyPhone:"",dpoName:"",dpoEmail:"",industry:""}),m&&typeof window!="undefined"&&localStorage.removeItem(f);},isValid:()=>{let i=[];if(a$2||i.push("No template selected"),d.name||i.push("Organization name is required"),d.website||i.push("Organization website is required"),d.privacyEmail||i.push("Privacy contact email is required"),a$2){let o=a$2.sections.filter(t=>t.required),e=(n==null?void 0:n.sections.filter(t=>t.included))||[];o.forEach(t=>{e.some(s=>s.id===t.id)||i.push(`Required section "${t.title}" must be included`);});}return a$2&&n&&Object.entries(a$2.variables).forEach(([o,e])=>{e.required&&!n.variableValues[o]&&i.push(`Required variable "${e.name}" must have a value`);}),{valid:i.length===0,errors:i}}}}function J(y={}){let{orgInfo:c,storageKey:f,useLocalStorage:m}=y,{sections:g,variables:n}=d();if(c)for(let a of n)c.name&&a.name==="orgName"&&(a.value=c.name),c.email&&a.name==="privacyEmail"&&(a.value=c.email),c.dpoName&&a.name==="dpoName"&&(a.value=c.dpoName);let u={id:"default-business",name:"Default Business Policy",description:"NDPA-compliant privacy policy template for businesses.",organizationType:"business",sections:g,variables:Object.fromEntries(n.map(a=>[a.name,{name:a.name,description:a.description,required:a.required,defaultValue:a.value||void 0}])),version:"1.0",lastUpdated:Date.now(),ndpaCompliant:true};return O({templates:[u],storageKey:f,useLocalStorage:m})}export{O as a,J as b};//# sourceMappingURL=chunk-2XFAV267.mjs.map
2
+ //# sourceMappingURL=chunk-2XFAV267.mjs.map
@@ -0,0 +1,72 @@
1
+ 'use strict';var chunkRYZEIDNR_js=require('./chunk-RYZEIDNR.js'),chunkEPF7J2FK_js=require('./chunk-EPF7J2FK.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var ze=({categories:N,onSubmit:x,onValidationError:D,title:oe="Report a Data Breach",formDescription:ne="Use this form to report a suspected or confirmed data breach in accordance with NDPA Section 40. All fields marked with * are required.",submitButtonText:de="Submit Report",className:me="",buttonClassName:ee="",classNames:u={},unstyled:n=false,isSubmitting:p=false,showConfirmation:P=true,confirmationMessage:Z="Your breach report has been submitted successfully. The data protection team has been notified.",allowAttachments:pe=true,maxAttachments:L=5,maxFileSize:C=5*1024*1024,allowedFileTypes:I=[".pdf",".jpg",".jpeg",".png",".doc",".docx",".xls",".xlsx",".txt"],defaultValues:d,onReset:q})=>{var we,Re,Ae,Ce,Se;let E=i=>{if(!i)return "";let A=new Date(i),Y=T=>String(T).padStart(2,"0");return `${A.getFullYear()}-${Y(A.getMonth()+1)}-${Y(A.getDate())}T${Y(A.getHours())}:${Y(A.getMinutes())}`},[O,M]=react.useState((d==null?void 0:d.title)||""),[_,J]=react.useState((d==null?void 0:d.description)||""),[z,K]=react.useState((d==null?void 0:d.category)||""),[V,le]=react.useState(E(d==null?void 0:d.discoveredAt)),[Q,ce]=react.useState(E(d==null?void 0:d.occurredAt)),[B,k]=react.useState(((we=d==null?void 0:d.reporter)==null?void 0:we.name)||""),[w,y]=react.useState(((Re=d==null?void 0:d.reporter)==null?void 0:Re.email)||""),[S,te]=react.useState(((Ae=d==null?void 0:d.reporter)==null?void 0:Ae.department)||""),[U,ae]=react.useState(((Ce=d==null?void 0:d.reporter)==null?void 0:Ce.phone)||""),[h,j]=react.useState((d==null?void 0:d.affectedSystems)||[]),[ge,be]=react.useState(((Se=d==null?void 0:d.affectedSystems)==null?void 0:Se.join(", "))||""),[s,f]=react.useState((d==null?void 0:d.dataTypes)||[]),[m,R]=react.useState((d==null?void 0:d.estimatedAffectedSubjects)!=null?String(d.estimatedAffectedSubjects):""),[H,G]=react.useState((d==null?void 0:d.status)||"ongoing"),[ue,re]=react.useState((d==null?void 0:d.initialActions)||""),[$,xe]=react.useState([]),[ye,ve]=react.useState(false),[b,Ne]=react.useState({}),je=()=>{M(""),J(""),K(""),le(""),ce(""),k(""),y(""),te(""),ae(""),j([]),be(""),f([]),R(""),G("ongoing"),re(""),xe([]),ve(false),Ne({}),q==null||q();},$e=i=>{let A=i.target.value;be(A);let Y=A.split(",").map(T=>T.trim()).filter(Boolean);j(Y);},Le=i=>{f(A=>A.includes(i)?A.filter(Y=>Y!==i):[...A,i]);},qe=i=>{var De;let A=i.target.files;if(!A)return;let Y=[],T={};if($.length+A.length>L){T.attachments=`Maximum of ${L} files allowed`,Ne(X=>chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},X),T));return}for(let X=0;X<A.length;X++){let ke=A[X];if(ke.size>C){T.attachments=`File ${ke.name} exceeds the maximum size of ${C/(1024*1024)}MB`;continue}let Be="."+((De=ke.name.split(".").pop())==null?void 0:De.toLowerCase());if(!I.includes(Be)){T.attachments=`File type ${Be} is not allowed`;continue}Y.push(ke);}Object.keys(T).length>0?Ne(X=>chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},X),T)):(xe(X=>[...X,...Y]),Ne(X=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},X),{attachments:""})));},Ee=i=>{xe(A=>A.filter((Y,T)=>T!==i));},Oe=()=>{let i={};return O.trim()||(i.breachTitle="Breach title is required"),_.trim()||(i.description="Description is required"),z||(i.category="Category is required"),V||(i.discoveredAt="Discovery date is required"),B.trim()||(i.reporterName="Reporter name is required"),w.trim()?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(w)||(i.reporterEmail="Reporter email is invalid"):i.reporterEmail="Reporter email is required",S.trim()||(i.reporterDepartment="Reporter department is required"),h.length===0&&(i.affectedSystems="At least one affected system is required"),s.length===0&&(i.dataTypes="At least one data type is required"),m&&isNaN(Number(m))&&(i.estimatedAffectedSubjects="Estimated affected subjects must be a number"),Ne(i),i},Me=i=>{i.preventDefault();let A=Oe();if(Object.keys(A).length>0){D==null||D(A);return}let Y={title:chunkEPF7J2FK_js.a(O),description:chunkEPF7J2FK_js.a(_),category:z,discoveredAt:new Date(V).getTime(),occurredAt:Q?new Date(Q).getTime():void 0,reportedAt:Date.now(),reporter:{name:chunkEPF7J2FK_js.a(B),email:chunkEPF7J2FK_js.a(w),department:chunkEPF7J2FK_js.a(S),phone:U?chunkEPF7J2FK_js.a(U):void 0},affectedSystems:h.map(T=>chunkEPF7J2FK_js.a(T)),dataTypes:s,estimatedAffectedSubjects:m?Number(m):void 0,status:H,initialActions:ue?chunkEPF7J2FK_js.a(ue):void 0,attachments:$.map(T=>({name:T.name,type:T.type,size:T.size,file:T}))};x(Y),P&&ve(true);};if(ye)return jsxRuntime.jsxs("div",{className:`p-4 bg-green-50 dark:bg-green-900/20 rounded-md ${me}`,children:[jsxRuntime.jsx("h2",{className:"text-lg font-bold text-green-800 dark:text-green-200 mb-2",children:"Report Submitted"}),jsxRuntime.jsx("p",{className:"text-green-700 dark:text-green-300",children:Z}),jsxRuntime.jsxs("div",{className:"mt-4 p-4 bg-yellow-50 dark:bg-yellow-900/20 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold text-yellow-800 dark:text-yellow-200 mb-2",children:"Important: Next Steps"}),jsxRuntime.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."})]}),jsxRuntime.jsx("button",{onClick:()=>ve(false),className:`mt-4 px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${ee}`,children:"Report Another Breach"})]});let Ue=[{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 jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${me}`,u.root,n),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",u.title,n),children:oe}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:ne}),jsxRuntime.jsx("form",{onSubmit:Me,className:chunkE64TU6IU_js.a("",u.form,n),children:jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",u.fieldGroup,n),children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Breach Information"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"breachTitle",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",u.label,n),children:["Breach Title/Summary ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"breachTitle",value:O,onChange:i=>M(i.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))]",u.input,n),required:true,"aria-invalid":!!b.breachTitle,"aria-describedby":b.breachTitle?"breachTitle-error":void 0}),b.breachTitle&&jsxRuntime.jsx("p",{id:"breachTitle-error",role:"alert",className:"mt-1 text-sm text-red-500",children:b.breachTitle})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"category",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",u.label,n),children:["Breach Category ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsxs("select",{id:"category",value:z,onChange:i=>K(i.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))]",u.select,n),required:true,"aria-invalid":!!b.category,"aria-describedby":b.category?"category-error":void 0,children:[jsxRuntime.jsx("option",{value:"",children:"Select a category"}),N.map(i=>jsxRuntime.jsx("option",{value:i.id,children:i.name},i.id))]}),b.category&&jsxRuntime.jsx("p",{id:"category-error",role:"alert",className:"mt-1 text-sm text-red-500",children:b.category})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{htmlFor:"description",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",u.label,n),children:["Detailed Description ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"description",value:_,onChange:i=>J(i.target.value),rows:4,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))]",u.textarea,n),required:true,"aria-invalid":!!b.description,"aria-describedby":b.description?"description-error":void 0}),b.description&&jsxRuntime.jsx("p",{id:"description-error",role:"alert",className:"mt-1 text-sm text-red-500",children:b.description})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"discoveredAt",className:"block text-sm font-medium mb-1",children:["Date Discovered ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"datetime-local",id:"discoveredAt",value:V,onChange:i=>le(i.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":!!b.discoveredAt,"aria-describedby":b.discoveredAt?"discoveredAt-error":void 0}),b.discoveredAt&&jsxRuntime.jsx("p",{id:"discoveredAt-error",role:"alert",className:"mt-1 text-sm text-red-500",children:b.discoveredAt})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"occurredAt",className:"block text-sm font-medium mb-1",children:"Date Occurred (if known)"}),jsxRuntime.jsx("input",{type:"datetime-local",id:"occurredAt",value:Q,onChange:i=>ce(i.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))]"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Reporter Information"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reporterName",className:"block text-sm font-medium mb-1",children:["Your Name ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"reporterName",value:B,onChange:i=>k(i.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":!!b.reporterName,"aria-describedby":b.reporterName?"reporterName-error":void 0}),b.reporterName&&jsxRuntime.jsx("p",{id:"reporterName-error",role:"alert",className:"mt-1 text-sm text-red-500",children:b.reporterName})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reporterEmail",className:"block text-sm font-medium mb-1",children:["Your Email ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"email",id:"reporterEmail",value:w,onChange:i=>y(i.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":!!b.reporterEmail,"aria-describedby":b.reporterEmail?"reporterEmail-error":void 0}),b.reporterEmail&&jsxRuntime.jsx("p",{id:"reporterEmail-error",role:"alert",className:"mt-1 text-sm text-red-500",children:b.reporterEmail})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reporterDepartment",className:"block text-sm font-medium mb-1",children:["Your Department ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"reporterDepartment",value:S,onChange:i=>te(i.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":!!b.reporterDepartment,"aria-describedby":b.reporterDepartment?"reporterDepartment-error":void 0}),b.reporterDepartment&&jsxRuntime.jsx("p",{id:"reporterDepartment-error",role:"alert",className:"mt-1 text-sm text-red-500",children:b.reporterDepartment})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"reporterPhone",className:"block text-sm font-medium mb-1",children:"Your Phone Number (Optional)"}),jsxRuntime.jsx("input",{type:"tel",id:"reporterPhone",value:U,onChange:i=>ae(i.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))]"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Impact Information"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"affectedSystems",className:"block text-sm font-medium mb-1",children:["Affected Systems/Applications ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"affectedSystems",value:ge,onChange:$e,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":!!b.affectedSystems,"aria-describedby":b.affectedSystems?"affectedSystems-error":void 0}),b.affectedSystems&&jsxRuntime.jsx("p",{id:"affectedSystems-error",role:"alert",className:"mt-1 text-sm text-red-500",children:b.affectedSystems})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"estimatedAffectedSubjects",className:"block text-sm font-medium mb-1",children:"Estimated Number of Affected Data Subjects"}),jsxRuntime.jsx("input",{type:"text",id:"estimatedAffectedSubjects",value:m,onChange:i=>R(i.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":!!b.estimatedAffectedSubjects,"aria-describedby":b.estimatedAffectedSubjects?"estimatedAffectedSubjects-error":void 0}),b.estimatedAffectedSubjects&&jsxRuntime.jsx("p",{id:"estimatedAffectedSubjects-error",role:"alert",className:"mt-1 text-sm text-red-500",children:b.estimatedAffectedSubjects})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Types of Data Involved ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:Ue.map(i=>jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"checkbox",id:`dataType_${i.id}`,checked:s.includes(i.id),onChange:()=>Le(i.id),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:`dataType_${i.id}`,className:"ml-2 text-sm text-gray-700 dark:text-gray-300",children:i.label})]},i.id))}),b.dataTypes&&jsxRuntime.jsx("p",{id:"dataTypes-error",role:"alert",className:"mt-1 text-sm text-red-500",children:b.dataTypes})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"status",className:"block text-sm font-medium mb-1",children:["Current Status ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsxs("select",{id:"status",value:H,onChange:i=>G(i.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))]",u.select,n),required:true,children:[jsxRuntime.jsx("option",{value:"ongoing",children:"Ongoing (breach is still active)"}),jsxRuntime.jsx("option",{value:"contained",children:"Contained (breach is stopped but not resolved)"}),jsxRuntime.jsx("option",{value:"resolved",children:"Resolved (breach is fully addressed)"})]})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"initialActions",className:"block text-sm font-medium mb-1",children:"Initial Actions Taken"}),jsxRuntime.jsx("textarea",{id:"initialActions",value:ue,onChange:i=>re(i.target.value),placeholder:"Describe any immediate actions that have been taken to address the breach",rows:3,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))]",u.textarea,n)})]})]})]}),pe&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Attachments"}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Upload Supporting Files (Optional)"}),jsxRuntime.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-2",children:["Max ",L," files, ",C/(1024*1024),"MB each. Allowed types: ",I.join(", ")]}),jsxRuntime.jsx("input",{type:"file",onChange:qe,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:I.join(",")}),b.attachments&&jsxRuntime.jsx("p",{id:"attachments-error",role:"alert",className:"mt-1 text-sm text-red-500",children:b.attachments})]}),$.length>0&&jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium mb-2",children:"Attached Files:"}),jsxRuntime.jsx("ul",{className:"space-y-2",children:$.map((i,A)=>jsxRuntime.jsxs("li",{className:"flex items-center justify-between p-2 bg-gray-50 dark:bg-gray-700 rounded",children:[jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.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:jsxRuntime.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"})}),jsxRuntime.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:i.name}),jsxRuntime.jsxs("span",{className:"ml-2 text-xs text-gray-600 dark:text-gray-400",children:["(",(i.size/1024).toFixed(1)," KB)"]})]}),jsxRuntime.jsx("button",{type:"button",onClick:()=>Ee(A),className:"text-red-500 hover:text-red-700",children:jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.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"})})})]},A))})]})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mt-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",u.notice,n),children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Breach Notification Requirements"}),jsxRuntime.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."})]}),jsxRuntime.jsxs("div",{className:"mt-6 relative flex gap-3",children:[p&&u.loadingOverlay&&jsxRuntime.jsx("div",{className:u.loadingOverlay}),jsxRuntime.jsx("button",{type:"submit",disabled:p,className:chunkE64TU6IU_js.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 ${ee} ${p?"opacity-50 cursor-not-allowed":""}`,u.primaryButton||u.submitButton,n),children:p?"Submitting...":de}),jsxRuntime.jsx("button",{type:"button",onClick:je,disabled:p,className:chunkE64TU6IU_js.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,n),children:"Reset"})]})]})})]})};var tt=({breachData:N,initialAssessment:x={},onComplete:D,title:oe="Breach Risk Assessment",description:ne="Assess the risk level of this data breach to determine notification requirements under NDPA Section 40.",submitButtonText:de="Complete Assessment",className:me="",buttonClassName:ee="",classNames:u={},unstyled:n=false,showBreachSummary:p=true,showNotificationRequirements:P=true})=>{let[Z,pe]=react.useState(x.confidentialityImpact||3),[L,C]=react.useState(x.integrityImpact||3),[I,d]=react.useState(x.availabilityImpact||3),[q,E]=react.useState(x.harmLikelihood||3),[O,M]=react.useState(x.harmSeverity||3),[_,J]=react.useState(x.risksToRightsAndFreedoms!==void 0?x.risksToRightsAndFreedoms:false),[z,K]=react.useState(x.highRisksToRightsAndFreedoms!==void 0?x.highRisksToRightsAndFreedoms:false),[V,le]=react.useState(x.justification||""),[Q,ce]=react.useState(0),[B,k]=react.useState("low"),[w,y]=react.useState(false),[S,te]=react.useState(0),[U,ae]=react.useState(0),[h,j]=react.useState(false);react.useEffect(()=>{let re=Z*.2+L*.1+I*.1+q*.3+O*.3;ce(Number(re.toFixed(1)));let $;re<2?$="low":re<3?$="medium":re<4?$="high":$="critical",k($),y(_||$==="high"||$==="critical");let ye=N.discoveredAt+4320*60*1e3;te(ye);let ve=Date.now(),b=(ye-ve)/(3600*1e3);ae(Number(b.toFixed(1)));},[Z,L,I,q,O,_,N.discoveredAt]);let ge=m=>new Date(m).toLocaleString(),be=m=>{m.preventDefault();let R={id:x.id||`assessment_${Date.now()}`,breachId:N.id,assessedAt:Date.now(),assessor:x.assessor||{name:"Assessment User",role:"Data Protection Officer",email:"dpo@example.com"},confidentialityImpact:Z,integrityImpact:L,availabilityImpact:I,harmLikelihood:q,harmSeverity:O,overallRiskScore:Q,riskLevel:B,risksToRightsAndFreedoms:_,highRisksToRightsAndFreedoms:z,justification:V};D(R),j(true);},s=m=>{switch(m){case 1:return "Minimal";case 2:return "Low";case 3:return "Moderate";case 4:return "High";case 5:return "Severe";default:return "Unknown"}},f=m=>jsxRuntime.jsx("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-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",critical:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[m]}`,u.riskBadge,n),children:m.charAt(0).toUpperCase()+m.slice(1)});return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${me}`,u.root,n),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",u.title,n),children:oe}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:ne}),p&&jsxRuntime.jsxs("div",{className:"mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-2",children:"Breach Summary"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Title:"})," ",N.title]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Discovered:"})," ",ge(N.discoveredAt)]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",N.status.charAt(0).toUpperCase()+N.status.slice(1)]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Types:"})," ",N.dataTypes.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",N.affectedSystems.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",N.estimatedAffectedSubjects||"Unknown"]})]})]})]}),h?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Assessment Results"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Overall Risk Level:"})," ",f(B)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risk Score:"})," ",Q," / 5"]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Assessed On:"})," ",ge(Date.now())]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risks to Rights and Freedoms:"})," ",_?"Yes":"No"]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"High Risks to Rights and Freedoms:"})," ",z?"Yes":"No"]})]})]}),jsxRuntime.jsxs("div",{className:"mt-3",children:[jsxRuntime.jsx("p",{className:"text-sm mb-1",children:jsxRuntime.jsx("span",{className:"font-medium",children:"Justification:"})}),jsxRuntime.jsx("p",{className:"text-sm bg-white dark:bg-gray-800 p-2 rounded",children:V})]})]}),P&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`mb-6 p-4 rounded-md ${w?U>24?"bg-yellow-50 dark:bg-yellow-900/20":"bg-red-50 dark:bg-red-900/20":"bg-green-50 dark:bg-green-900/20"}`,u.notificationStatus,n),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Notification Requirements"}),w?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:`text-sm font-bold mb-2 ${U>24?"text-yellow-800 dark:text-yellow-200":"text-red-800 dark:text-red-200"}`,children:"NDPC Notification Required"}),jsxRuntime.jsx("p",{className:"text-sm mb-2",children:"Under the NDPA (Section 40), this breach must be reported to the NDPC within 72 hours of discovery."}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Notification Deadline:"})," ",ge(S)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Time Remaining:"})," ",jsxRuntime.jsx("span",{className:U<24?"text-red-600 dark:text-red-400 font-bold":"",children:U>0?`${U} hours`:"Deadline passed"})]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Subject Notification:"})," ",z?"Required (NDPA Section 40(4))":"Not required unless directed by NDPC"]})]}):jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-bold mb-2 text-green-800 dark:text-green-200",children:"NDPC Notification Not Required"}),jsxRuntime.jsx("p",{className:"text-sm mb-2",children:"Based on this assessment, this breach does not need to be reported to the NDPC."}),jsxRuntime.jsx("p",{className:"text-sm mb-2",children:"However, the breach should still be documented internally for compliance purposes."})]}),jsxRuntime.jsxs("div",{className:"mt-3 text-sm",children:[jsxRuntime.jsx("p",{className:"font-medium",children:"Next Steps:"}),jsxRuntime.jsx("ul",{className:"list-disc pl-5 mt-1",children:w?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("li",{children:"Prepare a notification report for the NDPC"}),jsxRuntime.jsx("li",{children:"Document all aspects of the breach and your response"}),z&&jsxRuntime.jsx("li",{children:"Prepare communications for affected data subjects"}),jsxRuntime.jsx("li",{children:"Implement measures to mitigate the impact of the breach"})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("li",{children:"Document the breach and this assessment in your internal records"}),jsxRuntime.jsx("li",{children:"Implement measures to prevent similar breaches in the future"}),jsxRuntime.jsx("li",{children:"Review and update security measures as needed"})]})})]})]}),jsxRuntime.jsx("button",{onClick:()=>j(false),className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${ee}`,u.primaryButton||u.submitButton,n),children:"Edit Assessment"})]}):jsxRuntime.jsx("form",{onSubmit:be,children:jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Impact Assessment"}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"confidentialityImpact",className:"block text-sm font-medium mb-1",children:["Confidentiality Impact (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How much has the confidentiality of data been compromised?"})]}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"range",id:"confidentialityImpact",min:"1",max:"5",step:"1",value:Z,onChange:m=>pe(parseInt(m.target.value)),className:chunkE64TU6IU_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",u.slider,n)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(Z)," (",Z,")"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"integrityImpact",className:"block text-sm font-medium mb-1",children:["Integrity Impact (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How much has the integrity of data been compromised?"})]}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"range",id:"integrityImpact",min:"1",max:"5",step:"1",value:L,onChange:m=>C(parseInt(m.target.value)),className:chunkE64TU6IU_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",u.slider,n)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(L)," (",L,")"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"availabilityImpact",className:"block text-sm font-medium mb-1",children:["Availability Impact (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How much has the availability of data or systems been compromised?"})]}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"range",id:"availabilityImpact",min:"1",max:"5",step:"1",value:I,onChange:m=>d(parseInt(m.target.value)),className:chunkE64TU6IU_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",u.slider,n)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(I)," (",I,")"]})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Risk to Data Subjects"}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"harmLikelihood",className:"block text-sm font-medium mb-1",children:["Likelihood of Harm (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How likely is it that data subjects will experience harm?"})]}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"range",id:"harmLikelihood",min:"1",max:"5",step:"1",value:q,onChange:m=>E(parseInt(m.target.value)),className:chunkE64TU6IU_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",u.slider,n)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(q)," (",q,")"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"harmSeverity",className:"block text-sm font-medium mb-1",children:["Severity of Harm (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How severe would the harm be to affected data subjects?"})]}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"range",id:"harmSeverity",min:"1",max:"5",step:"1",value:O,onChange:m=>M(parseInt(m.target.value)),className:chunkE64TU6IU_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",u.slider,n)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(O)," (",O,")"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center mb-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"risksToRightsAndFreedoms",checked:_,onChange:m=>J(m.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"risksToRightsAndFreedoms",className:"ml-2 text-sm font-medium",children:"This breach poses a risk to the rights and freedoms of data subjects"})]}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 ml-6",children:"Under the NDPA (Section 40), breaches that pose a risk to rights and freedoms must be reported to the NDPC within 72 hours."})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center mb-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"highRisksToRightsAndFreedoms",checked:z,onChange:m=>K(m.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"highRisksToRightsAndFreedoms",className:"ml-2 text-sm font-medium",children:"This breach poses a high risk to the rights and freedoms of data subjects"})]}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 ml-6",children:"Under the NDPA (Section 40(4)), breaches that pose a high risk to rights and freedoms also require notification to affected data subjects without undue delay."})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Overall Assessment"}),jsxRuntime.jsxs("div",{className:"mb-4 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Overall Risk Score:"}),jsxRuntime.jsxs("span",{className:chunkE64TU6IU_js.a("",u.riskScore,n),children:[Q," / 5"]})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risk Level:"}),f(B)]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"justification",className:"block text-sm font-medium mb-1",children:["Justification for Assessment ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"justification",value:V,onChange:m=>le(m.target.value),rows:4,placeholder:"Explain the reasoning behind your assessment, including any factors that influenced your decision.",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})]})]}),jsxRuntime.jsxs("div",{className:"mt-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Breach Notification Requirements"}),jsxRuntime.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. This assessment will determine if notification is required for this breach."})]}),jsxRuntime.jsx("div",{className:"mt-6",children:jsxRuntime.jsx("button",{type:"submit",className:chunkE64TU6IU_js.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 ${ee}`,u.primaryButton||u.submitButton,n),children:de})})]})})]})};var dt=({breachReports:N,riskAssessments:x,regulatoryNotifications:D,onSelectBreach:oe,onRequestAssessment:ne,onRequestNotification:de,title:me="Breach Notification Manager",description:ee="Manage data breach notifications and track compliance with NDPA Section 40 requirements.",className:u="",buttonClassName:n="",classNames:p={},unstyled:P=false,showBreachDetails:Z=true,showNotificationTimeline:pe=true,showDeadlineAlerts:L=true})=>{var be;let[C,I]=react.useState(null),[d,q]=react.useState(N),[E,O]=react.useState("all"),[M,_]=react.useState(""),[J,z]=react.useState("discoveredAt"),[K,V]=react.useState("desc");react.useEffect(()=>{let s=[...N];if(E!=="all"&&(s=s.filter(f=>f.status===E)),M){let f=M.toLowerCase();s=s.filter(m=>m.title.toLowerCase().includes(f)||m.description.toLowerCase().includes(f)||m.affectedSystems.some(R=>R.toLowerCase().includes(f))||m.dataTypes.some(R=>R.toLowerCase().includes(f)));}s.sort((f,m)=>{let R=0;switch(J){case "title":R=f.title.localeCompare(m.title);break;case "discoveredAt":R=f.discoveredAt-m.discoveredAt;break;case "status":R=f.status.localeCompare(m.status);break;case "riskLevel":let H=x.find($=>$.breachId===f.id),G=x.find($=>$.breachId===m.id),ue=(H==null?void 0:H.riskLevel)||"unknown",re=(G==null?void 0:G.riskLevel)||"unknown";R=ue.localeCompare(re);break;default:R=f.discoveredAt-m.discoveredAt;}return K==="asc"?R:-R}),q(s);},[N,E,M,J,K,x]),react.useEffect(()=>{d.length>0&&!C&&I(d[0].id);},[d,C]);let le=s=>{I(s),oe&&oe(s);},Q=()=>{C&&ne&&ne(C);},ce=()=>{C&&de&&de(C);},B=s=>new Date(s).toLocaleString(),k=C?N.find(s=>s.id===C):null,w=C?x.find(s=>s.breachId===C):null,y=C?D.find(s=>s.breachId===C):null,S=k?te(k,w):null;function te(s,f){let m=chunkRYZEIDNR_js.a(s,f||void 0),R=s.discoveredAt+m.timeframeHours*60*60*1e3;return {ndpcNotificationRequired:m.notificationRequired,ndpcNotificationDeadline:R,dataSubjectNotificationRequired:(f==null?void 0:f.highRisksToRightsAndFreedoms)||false,justification:m.justification}}function U(s){let f=Date.now(),m=(s-f)/(3600*1e3);return Number(m.toFixed(1))}let ae=s=>s?jsxRuntime.jsx("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-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",critical:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[s]}`,p.statusBadge,P),children:s.charAt(0).toUpperCase()+s.slice(1)}):null,h=s=>jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${{ongoing:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",contained:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",resolved:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200"}[s]||"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200"}`,p.statusBadge,P),children:s.charAt(0).toUpperCase()+s.slice(1)}),j=()=>{if(!k||!S)return null;if(!S.ndpcNotificationRequired)return jsxRuntime.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"Notification Not Required"}),jsxRuntime.jsx("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:"Based on the risk assessment, NDPC notification is not required for this breach."})]});if(y)return jsxRuntime.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"Notification Sent"}),jsxRuntime.jsxs("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:["Notification was sent to the NDPC on ",B(y.sentAt),"."]})]});let s=U(S.ndpcNotificationDeadline);return s<=0?jsxRuntime.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Notification Deadline Passed"}),jsxRuntime.jsx("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:"The 72-hour deadline for NDPC notification has passed. Notification should be sent immediately."})]}):s<=24?jsxRuntime.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Urgent: Notification Due Soon"}),jsxRuntime.jsxs("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:["Only ",s," hours remaining until the NDPC notification deadline."]})]}):jsxRuntime.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium",children:"Notification Required"}),jsxRuntime.jsxs("p",{className:"text-xs text-yellow-700 dark:text-yellow-300 mt-1",children:["NDPC notification is required by ",B(S.ndpcNotificationDeadline)," (",s," hours remaining)."]})]})},ge=()=>{if(!k)return null;let s=[{title:"Breach Discovered",date:k.discoveredAt,completed:true,description:`Breach was discovered on ${B(k.discoveredAt)}.`},{title:"Risk Assessment",date:w==null?void 0:w.assessedAt,completed:!!w,description:w?`Risk assessment completed on ${B(w.assessedAt)}.`:"Risk assessment has not been completed yet."}];return S!=null&&S.ndpcNotificationRequired&&s.push({title:"NDPC Notification",date:y==null?void 0:y.sentAt,completed:!!y,description:y?`Notification sent to the NDPC on ${B(y.sentAt)}.`:`Notification must be sent to the NDPC by ${B(S.ndpcNotificationDeadline)}.`}),S!=null&&S.dataSubjectNotificationRequired&&s.push({title:"Data Subject Notification",date:void 0,completed:false,description:"Notification to affected data subjects is required but has not been sent yet."}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mt-6",p.timeline,P),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Notification Timeline"}),jsxRuntime.jsx("ol",{className:"relative border-l border-gray-200 dark:border-gray-700",children:s.map((f,m)=>jsxRuntime.jsxs("li",{className:chunkE64TU6IU_js.a("mb-6 ml-4",p.timelineStep,P),children:[jsxRuntime.jsx("div",{className:`absolute w-3 h-3 rounded-full mt-1.5 -left-1.5 border ${f.completed?"bg-green-500 border-green-500 dark:border-green-500":"bg-gray-200 border-gray-200 dark:bg-gray-700 dark:border-gray-700"}`}),jsxRuntime.jsx("time",{className:"mb-1 text-sm font-normal leading-none text-gray-600 dark:text-gray-500",children:f.date?B(f.date):"Pending"}),jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:f.title}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:f.description})]},m))})]})};return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${u}`,p.root,P),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",p.header,P),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",p.title,P),children:me}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:ee})]}),jsxRuntime.jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-3 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"statusFilter",className:"block text-sm font-medium mb-1",children:"Status Filter"}),jsxRuntime.jsxs("select",{id:"statusFilter",value:E,onChange:s=>O(s.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))]",children:[jsxRuntime.jsx("option",{value:"all",children:"All Statuses"}),jsxRuntime.jsx("option",{value:"ongoing",children:"Ongoing"}),jsxRuntime.jsx("option",{value:"contained",children:"Contained"}),jsxRuntime.jsx("option",{value:"resolved",children:"Resolved"})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"sortBy",className:"block text-sm font-medium mb-1",children:"Sort By"}),jsxRuntime.jsxs("select",{id:"sortBy",value:J,onChange:s=>z(s.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))]",children:[jsxRuntime.jsx("option",{value:"discoveredAt",children:"Discovery Date"}),jsxRuntime.jsx("option",{value:"title",children:"Title"}),jsxRuntime.jsx("option",{value:"status",children:"Status"}),jsxRuntime.jsx("option",{value:"riskLevel",children:"Risk Level"})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"searchTerm",className:"block text-sm font-medium mb-1",children:"Search"}),jsxRuntime.jsx("input",{type:"text",id:"searchTerm",value:M,onChange:s=>_(s.target.value),placeholder:"Search breaches...",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))]"})]})]}),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:"Breach Reports"}),d.length===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No breach reports found."}):jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-2 max-h-96 overflow-y-auto pr-2",p.breachList,P),children:d.map(s=>{let f=x.find(G=>G.breachId===s.id),m=D.find(G=>G.breachId===s.id),R=te(s,f),H=null;if(R!=null&&R.ndpcNotificationRequired)if(m)H=jsxRuntime.jsx("span",{className:"text-xs text-green-600 dark:text-green-400",children:"Notified"});else {let G=U(R.ndpcNotificationDeadline);G<=0?H=jsxRuntime.jsx("span",{className:"text-xs text-red-600 dark:text-red-400 font-bold",children:"Overdue"}):G<=24?H=jsxRuntime.jsx("span",{className:"text-xs text-red-600 dark:text-red-400",children:"Urgent"}):H=jsxRuntime.jsx("span",{className:"text-xs text-yellow-600 dark:text-yellow-400",children:"Required"});}else H=jsxRuntime.jsx("span",{className:"text-xs text-green-600 dark:text-green-400",children:"Not Required"});return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`p-3 rounded-md cursor-pointer ${C===s.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"}`,p.breachItem,P),onClick:()=>le(s.id),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:s.title}),h(s.status)]}),jsxRuntime.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:["Discovered: ",new Date(s.discoveredAt).toLocaleDateString()]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center mt-2",children:[jsxRuntime.jsx("div",{children:f&&ae(f.riskLevel)}),jsxRuntime.jsx("div",{children:H})]})]},s.id)})})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("md:col-span-2",p.detailPanel,P),children:k?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium",children:k.title}),h(k.status)]}),L&&jsxRuntime.jsx("div",{className:"mb-4",children:j()}),Z&&jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Discovered:"})," ",B(k.discoveredAt)]}),k.occurredAt&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Occurred:"})," ",B(k.occurredAt)]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reporter:"})," ",k.reporter.name]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",k.affectedSystems.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Types:"})," ",k.dataTypes.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",k.estimatedAffectedSubjects||"Unknown"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"Description:"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:k.description})]}),k.initialActions&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"Initial Actions Taken:"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:k.initialActions})]})]}),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Risk Assessment"}),w?jsxRuntime.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-2",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"Risk Level:"}),ae(w.riskLevel)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risk Score:"})," ",w.overallRiskScore," / 5"]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risks to Rights and Freedoms:"})," ",w.risksToRightsAndFreedoms?"Yes":"No"]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"High Risks to Rights and Freedoms:"})," ",w.highRisksToRightsAndFreedoms?"Yes":"No"]}),jsxRuntime.jsx("p",{className:"text-sm mb-1",children:jsxRuntime.jsx("span",{className:"font-medium",children:"Justification:"})}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-300 bg-white dark:bg-gray-800 p-2 rounded-md",children:w.justification})]}):jsxRuntime.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200",children:"Risk assessment has not been conducted yet."}),jsxRuntime.jsx("button",{onClick:Q,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${n}`,children:"Conduct Risk Assessment"})]})]}),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Notification Status"}),y?jsxRuntime.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:[jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Notification Sent:"})," ",B(y.sentAt)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Method:"})," ",y.method.charAt(0).toUpperCase()+y.method.slice(1)]}),y.referenceNumber&&jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reference Number:"})," ",y.referenceNumber]}),(y.ndpcContact||y.nitdaContact)&&jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"NDPC Contact:"})," ",(be=y.ndpcContact||y.nitdaContact)==null?void 0:be.name]})]}):jsxRuntime.jsx("div",{children:S!=null&&S.ndpcNotificationRequired?jsxRuntime.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200",children:"NDPC notification is required but has not been sent yet."}),jsxRuntime.jsx("button",{onClick:ce,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${n}`,children:"Generate Notification"})]}):jsxRuntime.jsx("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:jsxRuntime.jsx("p",{className:"text-sm text-green-800 dark:text-green-200",children:"NDPC notification is not required for this breach."})})})]}),pe&&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 breach to view details"})})})]})]})};var bt=({breachData:N,assessmentData:x,organizationInfo:D,onGenerate:oe,title:ne="Generate NDPC Notification Report",description:de="Generate a report for submission to the NDPC in compliance with NDPA Section 40 breach notification requirements.",generateButtonText:me="Generate Report",className:ee="",buttonClassName:u="",classNames:n={},unstyled:p=false,showPreview:P=true,allowEditing:Z=true,allowDownload:pe=true,downloadFormat:L="pdf"})=>{let[C,I]=react.useState(""),[d,q]=react.useState(""),[E,O]=react.useState(""),[M,_]=react.useState(""),[J,z]=react.useState("email"),[K,V]=react.useState(""),[le,Q]=react.useState(""),[ce,B]=react.useState(false),[k,w]=react.useState(false);react.useEffect(()=>{if(!ce){let h=S();I(h),B(true);}},[N,x,D]);let y=h=>new Date(h).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),S=()=>`
2
+ NDPC DATA BREACH NOTIFICATION
3
+
4
+ Date: ${new Date().toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"})}
5
+
6
+ Reference: NDPA Section 40 - Breach Notification
7
+
8
+ ORGANIZATION DETAILS
9
+ -------------------
10
+ Organization Name: ${D.name}
11
+ ${D.registrationNumber?`Registration Number: ${D.registrationNumber}`:""}
12
+ Address: ${D.address}
13
+ ${D.website?`Website: ${D.website}`:""}
14
+
15
+ DATA PROTECTION OFFICER
16
+ ----------------------
17
+ Name: ${D.dpoName}
18
+ Email: ${D.dpoEmail}
19
+ ${D.dpoPhone?`Phone: ${D.dpoPhone}`:""}
20
+
21
+ BREACH DETAILS
22
+ -------------
23
+ Breach Title: ${N.title}
24
+ Date Discovered: ${y(N.discoveredAt)}
25
+ ${N.occurredAt?`Date Occurred: ${y(N.occurredAt)}`:"Date Occurred: Unknown"}
26
+ Status: ${N.status.charAt(0).toUpperCase()+N.status.slice(1)}
27
+
28
+ Description of the Breach:
29
+ ${N.description}
30
+
31
+ Affected Systems/Applications:
32
+ ${N.affectedSystems.join(", ")}
33
+
34
+ Types of Personal Data Involved:
35
+ ${N.dataTypes.join(", ")}
36
+
37
+ Estimated Number of Data Subjects Affected:
38
+ ${N.estimatedAffectedSubjects||"Unknown"}
39
+
40
+ RISK ASSESSMENT
41
+ --------------
42
+ ${x?`
43
+ Overall Risk Level: ${x.riskLevel.charAt(0).toUpperCase()+x.riskLevel.slice(1)}
44
+ Risk to Rights and Freedoms of Data Subjects: ${x.risksToRightsAndFreedoms?"Yes":"No"}
45
+ High Risk to Rights and Freedoms of Data Subjects: ${x.highRisksToRightsAndFreedoms?"Yes":"No"}
46
+
47
+ Justification for Risk Assessment:
48
+ ${x.justification}
49
+ `:"Risk assessment has not been conducted yet."}
50
+
51
+ MEASURES TAKEN
52
+ -------------
53
+ Measures taken or proposed to address the breach:
54
+ ${N.initialActions||"To be determined"}
55
+
56
+ Measures taken or proposed to mitigate possible adverse effects:
57
+ [Please specify measures taken to mitigate adverse effects]
58
+
59
+ NOTIFICATION TO DATA SUBJECTS (NDPA Section 40(4))
60
+ ----------------------------
61
+ Have data subjects been notified: [Yes/No]
62
+ If yes, date of notification: [Date]
63
+ If no, planned date of notification: [Date]
64
+ Reason for delay (if applicable): [Reason]
65
+
66
+ ADDITIONAL INFORMATION
67
+ ---------------------
68
+ [Any additional information relevant to the breach]
69
+
70
+ This notification is made in compliance with the Nigeria Data Protection Act (NDPA), Section 40.
71
+ `,te=h=>{h.preventDefault();let j={id:`notification_${Date.now()}`,breachId:N.id,sentAt:Date.now(),method:J,referenceNumber:K||void 0,ndpcContact:d?{name:d,email:E,phone:M||void 0}:void 0,content:C,attachments:[]};oe(j),w(true);},U=()=>{let h=document.createElement("a"),j=new Blob([C],{type:"text/plain"});h.href=URL.createObjectURL(j),h.download=`NDPC_Breach_Notification_${new Date().toISOString().split("T")[0]}.txt`,document.body.appendChild(h),h.click(),document.body.removeChild(h);},ae=()=>[{value:"email",label:"Email"},{value:"portal",label:"NDPC Portal"},{value:"letter",label:"Formal Letter"},{value:"other",label:"Other"}].map(j=>jsxRuntime.jsx("option",{value:j.value,children:j.label},j.value));return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${ee}`,n.root,p),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",n.header,p),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",n.title,p),children:ne}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:de})]}),k?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"mb-6 p-4 bg-green-50 dark:bg-green-900/20 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-lg font-bold text-green-800 dark:text-green-200 mb-2",children:"Report Generated Successfully"}),jsxRuntime.jsx("p",{className:"text-green-700 dark:text-green-300",children:"Your NDPC notification report has been generated and is ready for submission. Please review the report carefully before submitting it to the NDPC."})]}),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Submission Details"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",n.field,p),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",n.fieldLabel,p),children:"Method:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",n.fieldValue,p),children:J.charAt(0).toUpperCase()+J.slice(1)})]}),d&&jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",n.field,p),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",n.fieldLabel,p),children:"Contact Name:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",n.fieldValue,p),children:d})]}),E&&jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",n.field,p),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",n.fieldLabel,p),children:"Contact Email:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",n.fieldValue,p),children:E})]}),M&&jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",n.field,p),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",n.fieldLabel,p),children:"Contact Phone:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",n.fieldValue,p),children:M})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",n.field,p),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",n.fieldLabel,p),children:"Date Generated:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",n.fieldValue,p),children:y(Date.now())})]}),jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",n.field,p),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",n.fieldLabel,p),children:"Breach ID:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",n.fieldValue,p),children:N.id})]}),K&&jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",n.field,p),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",n.fieldLabel,p),children:"Reference Number:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",n.fieldValue,p),children:K})]})]})]})]}),P&&jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Report Preview"}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("bg-gray-50 dark:bg-gray-700 p-4 rounded-md",n.reportPreview,p),children:jsxRuntime.jsx("pre",{className:"whitespace-pre-wrap text-sm font-mono text-gray-800 dark:text-gray-200",children:C})})]}),jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-3",children:[pe&&jsxRuntime.jsxs("button",{onClick:U,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${u}`,n.secondaryButton||n.downloadButton,p),children:["Download Report (",L.toUpperCase(),")"]}),jsxRuntime.jsx("button",{onClick:()=>w(false),className:`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${u}`,children:"Edit Report"})]})]}):jsxRuntime.jsx("form",{onSubmit:te,children:jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Notification Method"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"method",className:"block text-sm font-medium mb-1",children:["Method of Submission ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("select",{id:"method",value:J,onChange:h=>z(h.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,children:ae()})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"referenceNumber",className:"block text-sm font-medium mb-1",children:"Reference Number (if available)"}),jsxRuntime.jsx("input",{type:"text",id:"referenceNumber",value:K,onChange:h=>V(h.target.value),placeholder:"e.g. NDPC/BR/2024/001",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))]"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"NDPC Contact (if known)"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"contactName",className:"block text-sm font-medium mb-1",children:"Contact Name"}),jsxRuntime.jsx("input",{type:"text",id:"contactName",value:d,onChange:h=>q(h.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))]"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"contactEmail",className:"block text-sm font-medium mb-1",children:"Contact Email"}),jsxRuntime.jsx("input",{type:"email",id:"contactEmail",value:E,onChange:h=>O(h.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))]"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"contactPhone",className:"block text-sm font-medium mb-1",children:"Contact Phone"}),jsxRuntime.jsx("input",{type:"tel",id:"contactPhone",value:M,onChange:h=>_(h.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))]"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Additional Information"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"additionalInfo",className:"block text-sm font-medium mb-1",children:"Additional Information to Include"}),jsxRuntime.jsx("textarea",{id:"additionalInfo",value:le,onChange:h=>Q(h.target.value),rows:3,placeholder:"Any additional information you want to include in the report",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))]"})]})]}),Z&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Report Content"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reportContent",className:"block text-sm font-medium mb-1",children:["Edit Report Content ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"reportContent",value:C,onChange:h=>I(h.target.value),rows:20,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))] font-mono text-sm",required:true})]})]}),jsxRuntime.jsxs("div",{className:"mt-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Breach Notification Requirements"}),jsxRuntime.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. This report will help you comply with this requirement."})]}),jsxRuntime.jsx("div",{className:"mt-6",children:jsxRuntime.jsx("button",{type:"submit",className:chunkE64TU6IU_js.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 ${u}`,n.primaryButton||n.generateButton,p),children:me})})]})})]})};exports.a=ze;exports.b=tt;exports.c=dt;exports.d=bt;//# sourceMappingURL=chunk-32UIWTGD.js.map
72
+ //# sourceMappingURL=chunk-32UIWTGD.js.map