@tantainnovative/ndpr-toolkit 2.4.0 → 3.0.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 (184) hide show
  1. package/README.md +226 -246
  2. package/dist/BreachReportForm-DpRrBoxU.d.ts +158 -0
  3. package/dist/BreachReportForm-yJ2Zl6gz.d.mts +158 -0
  4. package/dist/ConsentBanner-CDRT0o2k.d.mts +146 -0
  5. package/dist/ConsentBanner-Vxyt8SCX.d.ts +146 -0
  6. package/dist/{cross-border-entry-BrWVPly6.d.ts → CrossBorderTransferManager-D5Lc0e46.d.ts} +4 -5
  7. package/dist/{cross-border-entry-cCTvpwnT.d.mts → CrossBorderTransferManager-DkZhv9vD.d.mts} +4 -5
  8. package/dist/DPIAQuestionnaire-BkejviPj.d.mts +123 -0
  9. package/dist/DPIAQuestionnaire-DdSqXG3x.d.ts +123 -0
  10. package/dist/DSRRequestForm-BY8PogCU.d.mts +146 -0
  11. package/dist/DSRRequestForm-CHUg9cZh.d.ts +146 -0
  12. package/dist/DSRTracker-C6u_jAaK.d.mts +163 -0
  13. package/dist/DSRTracker-Dr_aT0pg.d.ts +163 -0
  14. package/dist/{lawful-basis-entry-CxZrofwG.d.mts → LawfulBasisTracker-CBqOxX1D.d.mts} +3 -5
  15. package/dist/{lawful-basis-entry-15qjKcNO.d.ts → LawfulBasisTracker-Cg30NbDA.d.ts} +3 -5
  16. package/dist/NDPRDashboard-CLJpEg0X.d.mts +44 -0
  17. package/dist/NDPRDashboard-DDWNd2Ah.d.ts +44 -0
  18. package/dist/{policy-E0fXZkda.d.mts → PolicyExporter-BIqSVjfC.d.mts} +4 -98
  19. package/dist/{policy-D2_jh5-T.d.ts → PolicyExporter-BNWaPBGU.d.ts} +4 -98
  20. package/dist/PolicyGenerator-BvcWPbxp.d.mts +96 -0
  21. package/dist/PolicyGenerator-BzRwtlgn.d.ts +96 -0
  22. package/dist/{ropa-entry-B0D7X1GV.d.ts → ROPAManager-BS4eB8Hw.d.mts} +4 -5
  23. package/dist/{ropa-entry-DiOThOc2.d.mts → ROPAManager-qxTrXLkD.d.ts} +4 -5
  24. package/dist/{breach-ouXoVTWs.d.ts → RegulatoryReportGenerator-BUYgzTTT.d.ts} +6 -162
  25. package/dist/{breach-yRiyyc4n.d.mts → RegulatoryReportGenerator-DwcHcEFp.d.mts} +6 -162
  26. package/dist/StepIndicator-D-nwRTyo.d.mts +171 -0
  27. package/dist/StepIndicator-D9ZATz_O.d.ts +171 -0
  28. package/dist/adapters.d.mts +25 -0
  29. package/dist/adapters.d.ts +25 -0
  30. package/dist/adapters.js +2 -0
  31. package/dist/adapters.mjs +2 -0
  32. package/dist/breach.d.mts +43 -4
  33. package/dist/breach.d.ts +43 -4
  34. package/dist/breach.js +1 -1
  35. package/dist/breach.mjs +1 -1
  36. package/dist/chunk-27NYSWUG.mjs +2 -0
  37. package/dist/chunk-2ORDHJRD.js +2 -0
  38. package/dist/chunk-2W7ARAW2.js +2 -0
  39. package/dist/chunk-3F34NACG.js +2 -0
  40. package/dist/chunk-3RGJV3VF.js +7 -0
  41. package/dist/chunk-3UWT64FI.mjs +2 -0
  42. package/dist/chunk-3V23O4ZJ.js +2 -0
  43. package/dist/chunk-3XAUN5IM.mjs +3 -0
  44. package/dist/chunk-5VMHKNJY.js +2 -0
  45. package/dist/chunk-6D3ZUGBB.mjs +2 -0
  46. package/dist/chunk-6E54NSAO.mjs +2 -0
  47. package/dist/chunk-7F5F5YWI.mjs +2 -0
  48. package/dist/chunk-7FIUX3ZM.js +89 -0
  49. package/dist/chunk-FR7ZYZXB.js +2 -0
  50. package/dist/chunk-FY5G6DGZ.js +7 -0
  51. package/dist/chunk-G26I6MP5.mjs +2 -0
  52. package/dist/chunk-GPJVTGHR.mjs +2 -0
  53. package/dist/chunk-GVANK6PL.js +3 -0
  54. package/dist/chunk-HNZK7LY3.mjs +2 -0
  55. package/dist/chunk-IKEPXHCZ.js +2 -0
  56. package/dist/chunk-IQQW52EF.js +2 -0
  57. package/dist/chunk-ISSGO2YT.mjs +72 -0
  58. package/dist/chunk-J6IKAGUP.mjs +89 -0
  59. package/dist/chunk-KHRBU5K7.js +2 -0
  60. package/dist/chunk-KNE4NXCY.mjs +7 -0
  61. package/dist/chunk-LFNA6WYQ.mjs +2 -0
  62. package/dist/chunk-NPI5T6NH.mjs +7 -0
  63. package/dist/chunk-NPLXE43Q.mjs +2 -0
  64. package/dist/chunk-P7BSBCB3.js +2 -0
  65. package/dist/chunk-PEH5GIMN.js +2 -0
  66. package/dist/chunk-RSUDIFZV.mjs +2 -0
  67. package/dist/chunk-SBNAMPAP.mjs +2 -0
  68. package/dist/chunk-SVCRYM4I.mjs +2 -0
  69. package/dist/chunk-U6VWHC46.js +72 -0
  70. package/dist/chunk-UK656RCG.js +2 -0
  71. package/dist/chunk-UNKXYVXY.js +2 -0
  72. package/dist/chunk-UOSEH6DC.js +2 -0
  73. package/dist/chunk-V37BM2LF.js +2 -0
  74. package/dist/chunk-V3MXWGXU.mjs +2 -0
  75. package/dist/chunk-VDZKGCAF.js +2 -0
  76. package/dist/chunk-WLSW4Z4W.mjs +2 -0
  77. package/dist/chunk-XSK4BSZJ.mjs +2 -0
  78. package/dist/chunk-YJCGEOLO.mjs +2 -0
  79. package/dist/chunk-ZCZ5RRZO.js +2 -0
  80. package/dist/compliance-score-racQe_E_.d.mts +115 -0
  81. package/dist/compliance-score-racQe_E_.d.ts +115 -0
  82. package/dist/consent.d.mts +67 -295
  83. package/dist/consent.d.ts +67 -295
  84. package/dist/consent.js +1 -1
  85. package/dist/consent.mjs +1 -1
  86. package/dist/core.d.mts +8 -5
  87. package/dist/core.d.ts +8 -5
  88. package/dist/core.js +1 -1
  89. package/dist/core.mjs +1 -1
  90. package/dist/cross-border-BBi9rZyO.d.mts +54 -0
  91. package/dist/cross-border-Dy-U9Hu6.d.ts +54 -0
  92. package/dist/{cross-border-BMcqLvjC.d.mts → cross-border-UyT00llA.d.mts} +1 -52
  93. package/dist/{cross-border-BMcqLvjC.d.ts → cross-border-UyT00llA.d.ts} +1 -52
  94. package/dist/cross-border.d.mts +32 -4
  95. package/dist/cross-border.d.ts +32 -4
  96. package/dist/cross-border.js +1 -1
  97. package/dist/cross-border.mjs +1 -1
  98. package/dist/dpia.d.mts +28 -284
  99. package/dist/dpia.d.ts +28 -284
  100. package/dist/dpia.js +1 -1
  101. package/dist/dpia.mjs +1 -1
  102. package/dist/dsr.d.mts +36 -4
  103. package/dist/dsr.d.ts +36 -4
  104. package/dist/dsr.js +1 -1
  105. package/dist/dsr.mjs +1 -1
  106. package/dist/hooks.d.mts +21 -10
  107. package/dist/hooks.d.ts +21 -10
  108. package/dist/hooks.js +1 -1
  109. package/dist/hooks.mjs +1 -1
  110. package/dist/index.d.mts +28 -18
  111. package/dist/index.d.ts +28 -18
  112. package/dist/index.js +1 -1
  113. package/dist/index.mjs +1 -1
  114. package/dist/lawful-basis.d.mts +31 -4
  115. package/dist/lawful-basis.d.ts +31 -4
  116. package/dist/lawful-basis.js +1 -1
  117. package/dist/lawful-basis.mjs +1 -1
  118. package/dist/policy.d.mts +36 -4
  119. package/dist/policy.d.ts +36 -4
  120. package/dist/policy.js +1 -1
  121. package/dist/policy.mjs +1 -1
  122. package/dist/presets.d.mts +124 -0
  123. package/dist/presets.d.ts +124 -0
  124. package/dist/presets.js +2 -0
  125. package/dist/presets.mjs +2 -0
  126. package/dist/{ropa-Li6UlL5H.d.ts → ropa-BDTM06tr.d.ts} +1 -49
  127. package/dist/{ropa-DP7pPPql.d.mts → ropa-CFHuT7jE.d.mts} +1 -49
  128. package/dist/ropa-CyynscU6.d.ts +51 -0
  129. package/dist/ropa-NIgxd8uP.d.mts +51 -0
  130. package/dist/ropa.d.mts +30 -4
  131. package/dist/ropa.d.ts +30 -4
  132. package/dist/ropa.js +1 -1
  133. package/dist/ropa.mjs +1 -1
  134. package/dist/styling-B7CBzYG7.d.ts +165 -0
  135. package/dist/styling-uJLsBbER.d.mts +165 -0
  136. package/dist/types-DK2CoKOC.d.mts +10 -0
  137. package/dist/types-DK2CoKOC.d.ts +10 -0
  138. package/dist/unstyled.d.mts +4 -4
  139. package/dist/unstyled.d.ts +4 -4
  140. package/dist/{useBreach-BBSoIcZO.d.mts → useBreach-CPr86Yan.d.mts} +18 -2
  141. package/dist/{useBreach-lFLbSyAN.d.ts → useBreach-DkVXvtJK.d.ts} +18 -2
  142. package/dist/{useConsent-D0pAfTlb.d.ts → useConsent-DCNkIJHR.d.mts} +12 -2
  143. package/dist/{useConsent-DOt2Njst.d.mts → useConsent-dOcELSfX.d.ts} +12 -2
  144. package/dist/{useCrossBorderTransfer-DmtACeqW.d.ts → useCrossBorderTransfer-BGNZt2lk.d.mts} +15 -3
  145. package/dist/{useCrossBorderTransfer-BZVFCXfr.d.mts → useCrossBorderTransfer-COqjgjsu.d.ts} +15 -3
  146. package/dist/{useDPIA-DBsg2yZx.d.ts → useDPIA-Dl16Te3r.d.ts} +13 -2
  147. package/dist/{useDPIA-Da7-Q_yW.d.mts → useDPIA-DzWye8JB.d.mts} +13 -2
  148. package/dist/{useDSR-YYZ6FYFs.d.mts → useDSR-C1LksCfP.d.mts} +13 -2
  149. package/dist/{useDSR-CYI7WCXr.d.ts → useDSR-DZel52O1.d.ts} +13 -2
  150. package/dist/{useDefaultPrivacyPolicy-CUluF_ic.d.mts → useDefaultPrivacyPolicy-BsYttRey.d.mts} +13 -2
  151. package/dist/{useDefaultPrivacyPolicy-B7kTHbZh.d.ts → useDefaultPrivacyPolicy-C-mG-A5S.d.ts} +13 -2
  152. package/dist/{useLawfulBasis-CpWuHtyh.d.mts → useLawfulBasis-CKJ-kw84.d.mts} +13 -2
  153. package/dist/{useLawfulBasis-CCWF9waR.d.ts → useLawfulBasis-DFTmu1ca.d.ts} +13 -2
  154. package/dist/{useROPA-BhJ3kvHp.d.ts → useROPA-BSSU1rfx.d.ts} +14 -2
  155. package/dist/{useROPA-DLFdjkxP.d.mts → useROPA-C2hjaBTz.d.mts} +14 -2
  156. package/package.json +18 -2
  157. package/dist/chunk-2XFAV267.mjs +0 -2
  158. package/dist/chunk-32UIWTGD.js +0 -72
  159. package/dist/chunk-3YCV2BA6.js +0 -2
  160. package/dist/chunk-4A354HL3.js +0 -2
  161. package/dist/chunk-5ZBO2UPH.js +0 -2
  162. package/dist/chunk-6GGGTRDZ.mjs +0 -2
  163. package/dist/chunk-BGHQTZAC.js +0 -94
  164. package/dist/chunk-BZTTQS4A.mjs +0 -7
  165. package/dist/chunk-EKVTLHBQ.js +0 -2
  166. package/dist/chunk-GMLNWS2N.mjs +0 -2
  167. package/dist/chunk-IBEKLDBY.mjs +0 -2
  168. package/dist/chunk-K3GMTMQ6.js +0 -2
  169. package/dist/chunk-L52PDW6O.mjs +0 -2
  170. package/dist/chunk-LI6WJ3LZ.js +0 -2
  171. package/dist/chunk-LXRXDTPI.js +0 -2
  172. package/dist/chunk-NW4A3JW6.mjs +0 -2
  173. package/dist/chunk-OITITR6K.mjs +0 -2
  174. package/dist/chunk-PDJGTQMY.mjs +0 -2
  175. package/dist/chunk-SKJCQKFL.mjs +0 -94
  176. package/dist/chunk-T44JQT2O.mjs +0 -2
  177. package/dist/chunk-TCJCE6WN.js +0 -2
  178. package/dist/chunk-VMJBW3EF.mjs +0 -2
  179. package/dist/chunk-WW3X3ELF.js +0 -2
  180. package/dist/chunk-XMYUYQH7.mjs +0 -72
  181. package/dist/chunk-ZNTMZ6NM.js +0 -7
  182. package/dist/chunk-ZU73VG3X.js +0 -2
  183. package/dist/dsr-190YpijW.d.ts +0 -307
  184. package/dist/dsr-BTT-Xd7H.d.mts +0 -307
@@ -0,0 +1,171 @@
1
+ import React__default from 'react';
2
+ import { a as DPIAResult, c as DPIASection } from './dpia-5OQVA1R_.js';
3
+
4
+ interface DPIAReportClassNames {
5
+ /** Outermost wrapper */
6
+ root?: string;
7
+ /** Report header area */
8
+ header?: string;
9
+ /** Main report title */
10
+ title?: string;
11
+ /** Executive summary section */
12
+ summary?: string;
13
+ /** Risk level badge */
14
+ riskBadge?: string;
15
+ /** Risks table element */
16
+ riskTable?: string;
17
+ /** Individual risk row */
18
+ riskRow?: string;
19
+ /** Recommendation list item */
20
+ recommendation?: string;
21
+ /** Conclusion text */
22
+ conclusion?: string;
23
+ /** Print button */
24
+ printButton?: string;
25
+ /** Alias for printButton */
26
+ primaryButton?: string;
27
+ }
28
+ interface DPIAReportProps {
29
+ /**
30
+ * The DPIA result to display
31
+ */
32
+ result: DPIAResult;
33
+ /**
34
+ * The sections of the DPIA questionnaire
35
+ */
36
+ sections: DPIASection[];
37
+ /**
38
+ * Whether to show the full report or just a summary
39
+ * @default true
40
+ */
41
+ showFullReport?: boolean;
42
+ /**
43
+ * Whether to allow printing the report
44
+ * @default true
45
+ */
46
+ allowPrint?: boolean;
47
+ /**
48
+ * Whether to allow exporting the report as PDF
49
+ * @default true
50
+ */
51
+ allowExport?: boolean;
52
+ /**
53
+ * Callback function called when the report is exported
54
+ */
55
+ onExport?: (format: 'pdf' | 'docx' | 'html') => void;
56
+ /**
57
+ * Custom CSS class for the report container
58
+ */
59
+ className?: string;
60
+ /**
61
+ * Custom CSS class for the buttons
62
+ */
63
+ buttonClassName?: string;
64
+ /**
65
+ * Per-section class name overrides
66
+ */
67
+ classNames?: DPIAReportClassNames;
68
+ /**
69
+ * When true, all default classes are stripped.
70
+ * Only explicit overrides from `classNames` are applied.
71
+ * @default false
72
+ */
73
+ unstyled?: boolean;
74
+ }
75
+ /**
76
+ * DPIA report component. Implements NDPA Sections 38-39 requirements for documenting
77
+ * and presenting Data Protection Impact Assessment findings, risks, and recommendations.
78
+ */
79
+ declare const DPIAReport: React__default.FC<DPIAReportProps>;
80
+
81
+ interface Step {
82
+ /**
83
+ * Unique identifier for the step
84
+ */
85
+ id: string;
86
+ /**
87
+ * Display label for the step
88
+ */
89
+ label: string;
90
+ /**
91
+ * Optional description for the step
92
+ */
93
+ description?: string;
94
+ /**
95
+ * Whether the step is completed
96
+ */
97
+ completed: boolean;
98
+ /**
99
+ * Whether the step is the current active step
100
+ */
101
+ active: boolean;
102
+ /**
103
+ * Optional icon for the step
104
+ */
105
+ icon?: React__default.ReactNode;
106
+ }
107
+ interface StepIndicatorClassNames {
108
+ /** Outermost wrapper */
109
+ root?: string;
110
+ /** Individual step wrapper */
111
+ step?: string;
112
+ /** Active step circle / indicator */
113
+ stepActive?: string;
114
+ /** Completed step circle / indicator */
115
+ stepCompleted?: string;
116
+ /** Pending (incomplete, inactive) step circle / indicator */
117
+ stepPending?: string;
118
+ /** Connector line between steps */
119
+ connector?: string;
120
+ /** Step label text */
121
+ label?: string;
122
+ }
123
+ interface StepIndicatorProps {
124
+ /**
125
+ * Array of steps to display
126
+ */
127
+ steps: Step[];
128
+ /**
129
+ * Callback function called when a step is clicked
130
+ */
131
+ onStepClick?: (stepId: string) => void;
132
+ /**
133
+ * Whether the steps are clickable
134
+ * @default true
135
+ */
136
+ clickable?: boolean;
137
+ /**
138
+ * Orientation of the step indicator
139
+ * @default "horizontal"
140
+ */
141
+ orientation?: 'horizontal' | 'vertical';
142
+ /**
143
+ * Custom CSS class for the container
144
+ */
145
+ className?: string;
146
+ /**
147
+ * Custom CSS class for the active step
148
+ */
149
+ activeStepClassName?: string;
150
+ /**
151
+ * Custom CSS class for completed steps
152
+ */
153
+ completedStepClassName?: string;
154
+ /**
155
+ * Custom CSS class for incomplete steps
156
+ */
157
+ incompleteStepClassName?: string;
158
+ /**
159
+ * Per-section class name overrides
160
+ */
161
+ classNames?: StepIndicatorClassNames;
162
+ /**
163
+ * When true, all default classes are stripped.
164
+ * Only explicit overrides from `classNames` are applied.
165
+ * @default false
166
+ */
167
+ unstyled?: boolean;
168
+ }
169
+ declare const StepIndicator: React__default.FC<StepIndicatorProps>;
170
+
171
+ export { DPIAReport as D, StepIndicator as S, type DPIAReportClassNames as a, type StepIndicatorClassNames as b, type DPIAReportProps as c, type StepIndicatorProps as d };
@@ -0,0 +1,25 @@
1
+ import { S as StorageAdapter } from './types-DK2CoKOC.mjs';
2
+
3
+ declare function localStorageAdapter<T = unknown>(key: string): StorageAdapter<T>;
4
+
5
+ declare function sessionStorageAdapter<T = unknown>(key: string): StorageAdapter<T>;
6
+
7
+ interface CookieAdapterOptions {
8
+ domain?: string;
9
+ path?: string;
10
+ expires?: number;
11
+ secure?: boolean;
12
+ sameSite?: 'Strict' | 'Lax' | 'None';
13
+ }
14
+ declare function cookieAdapter<T = unknown>(key: string, options?: CookieAdapterOptions): StorageAdapter<T>;
15
+
16
+ interface ApiAdapterOptions {
17
+ headers?: Record<string, string>;
18
+ }
19
+ declare function apiAdapter<T = unknown>(endpoint: string, options?: ApiAdapterOptions): StorageAdapter<T>;
20
+
21
+ declare function memoryAdapter<T = unknown>(initialData?: T): StorageAdapter<T>;
22
+
23
+ declare function composeAdapters<T = unknown>(primary: StorageAdapter<T>, ...secondaries: StorageAdapter<T>[]): StorageAdapter<T>;
24
+
25
+ export { type ApiAdapterOptions, type CookieAdapterOptions, StorageAdapter, apiAdapter, composeAdapters, cookieAdapter, localStorageAdapter, memoryAdapter, sessionStorageAdapter };
@@ -0,0 +1,25 @@
1
+ import { S as StorageAdapter } from './types-DK2CoKOC.js';
2
+
3
+ declare function localStorageAdapter<T = unknown>(key: string): StorageAdapter<T>;
4
+
5
+ declare function sessionStorageAdapter<T = unknown>(key: string): StorageAdapter<T>;
6
+
7
+ interface CookieAdapterOptions {
8
+ domain?: string;
9
+ path?: string;
10
+ expires?: number;
11
+ secure?: boolean;
12
+ sameSite?: 'Strict' | 'Lax' | 'None';
13
+ }
14
+ declare function cookieAdapter<T = unknown>(key: string, options?: CookieAdapterOptions): StorageAdapter<T>;
15
+
16
+ interface ApiAdapterOptions {
17
+ headers?: Record<string, string>;
18
+ }
19
+ declare function apiAdapter<T = unknown>(endpoint: string, options?: ApiAdapterOptions): StorageAdapter<T>;
20
+
21
+ declare function memoryAdapter<T = unknown>(initialData?: T): StorageAdapter<T>;
22
+
23
+ declare function composeAdapters<T = unknown>(primary: StorageAdapter<T>, ...secondaries: StorageAdapter<T>[]): StorageAdapter<T>;
24
+
25
+ export { type ApiAdapterOptions, type CookieAdapterOptions, StorageAdapter, apiAdapter, composeAdapters, cookieAdapter, localStorageAdapter, memoryAdapter, sessionStorageAdapter };
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunk3F34NACG_js=require('./chunk-3F34NACG.js'),chunkUK656RCG_js=require('./chunk-UK656RCG.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js');function l(e,t={}){var a;let r=(a=t.headers)!=null?a:{};return {load(){return chunkMQFZHA2D_js.d(this,null,function*(){try{let o=yield fetch(e,{method:"GET",headers:chunkMQFZHA2D_js.a({},r)});return o.ok?yield o.json():null}catch(o){return null}})},save(o){return chunkMQFZHA2D_js.d(this,null,function*(){try{yield fetch(e,{method:"POST",headers:chunkMQFZHA2D_js.a({"Content-Type":"application/json"},r),body:JSON.stringify(o)});}catch(d){console.warn(`[ndpr-toolkit] Failed to save to ${e}`);}})},remove(){return chunkMQFZHA2D_js.d(this,null,function*(){try{yield fetch(e,{method:"DELETE",headers:chunkMQFZHA2D_js.a({},r)});}catch(o){console.warn(`[ndpr-toolkit] Failed to delete from ${e}`);}})}}}function f(e){let t=e!=null?e:null;return {load(){return t},save(r){t=r;},remove(){t=null;}}}function u(e,...t){return {load(){return e.load()},save(r){let a=e.save(r),p=()=>chunkMQFZHA2D_js.d(null,null,function*(){for(let o of t)try{yield o.save(r);}catch(d){console.warn("[ndpr-toolkit] Secondary adapter save failed:",d);}});return a instanceof Promise?a.then(()=>p()):p()},remove(){let r=e.remove(),a=()=>chunkMQFZHA2D_js.d(null,null,function*(){for(let p of t)try{yield p.remove();}catch(o){console.warn("[ndpr-toolkit] Secondary adapter remove failed:",o);}});return r instanceof Promise?r.then(()=>a()):a()}}}Object.defineProperty(exports,"cookieAdapter",{enumerable:true,get:function(){return chunk3F34NACG_js.b}});Object.defineProperty(exports,"sessionStorageAdapter",{enumerable:true,get:function(){return chunk3F34NACG_js.a}});Object.defineProperty(exports,"localStorageAdapter",{enumerable:true,get:function(){return chunkUK656RCG_js.a}});exports.apiAdapter=l;exports.composeAdapters=u;exports.memoryAdapter=f;//# sourceMappingURL=adapters.js.map
2
+ //# sourceMappingURL=adapters.js.map
@@ -0,0 +1,2 @@
1
+ export{b as cookieAdapter,a as sessionStorageAdapter}from'./chunk-YJCGEOLO.mjs';export{a as localStorageAdapter}from'./chunk-SBNAMPAP.mjs';import {d,a}from'./chunk-WWT2ZSNU.mjs';function l(e,t={}){var a$1;let r=(a$1=t.headers)!=null?a$1:{};return {load(){return d(this,null,function*(){try{let o=yield fetch(e,{method:"GET",headers:a({},r)});return o.ok?yield o.json():null}catch(o){return null}})},save(o){return d(this,null,function*(){try{yield fetch(e,{method:"POST",headers:a({"Content-Type":"application/json"},r),body:JSON.stringify(o)});}catch(d){console.warn(`[ndpr-toolkit] Failed to save to ${e}`);}})},remove(){return d(this,null,function*(){try{yield fetch(e,{method:"DELETE",headers:a({},r)});}catch(o){console.warn(`[ndpr-toolkit] Failed to delete from ${e}`);}})}}}function f(e){let t=e!=null?e:null;return {load(){return t},save(r){t=r;},remove(){t=null;}}}function u(e,...t){return {load(){return e.load()},save(r){let a=e.save(r),p=()=>d(null,null,function*(){for(let o of t)try{yield o.save(r);}catch(d){console.warn("[ndpr-toolkit] Secondary adapter save failed:",d);}});return a instanceof Promise?a.then(()=>p()):p()},remove(){let r=e.remove(),a=()=>d(null,null,function*(){for(let p of t)try{yield p.remove();}catch(o){console.warn("[ndpr-toolkit] Secondary adapter remove failed:",o);}});return r instanceof Promise?r.then(()=>a()):a()}}}export{l as apiAdapter,u as composeAdapters,f as memoryAdapter};//# sourceMappingURL=adapters.mjs.map
2
+ //# sourceMappingURL=adapters.mjs.map
package/dist/breach.d.mts CHANGED
@@ -1,5 +1,44 @@
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-yRiyyc4n.mjs';
2
- export { u as useBreach } from './useBreach-BBSoIcZO.mjs';
1
+ import { c as BreachReportFormProps } from './BreachReportForm-yJ2Zl6gz.mjs';
2
+ export { B as BreachFormSubmission, a as BreachReportForm, b as BreachReportFormClassNames } from './BreachReportForm-yJ2Zl6gz.mjs';
3
+ import { e as BreachRiskAssessmentProps, f as BreachNotificationManagerProps, g as RegulatoryReportGeneratorProps } from './RegulatoryReportGenerator-DwcHcEFp.mjs';
4
+ export { B as BreachNotificationManager, a as BreachNotificationManagerClassNames, b as BreachRiskAssessment, c as BreachRiskAssessmentClassNames, R as RegulatoryReportGenerator, d as RegulatoryReportGeneratorClassNames } from './RegulatoryReportGenerator-DwcHcEFp.mjs';
5
+ import { U as UseBreachReturn } from './useBreach-CPr86Yan.mjs';
6
+ export { u as useBreach } from './useBreach-CPr86Yan.mjs';
3
7
  export { c as calculateBreachSeverity } from './breach-B_-6lDqS.mjs';
4
- export { B as BreachCategory, a as BreachReport, N as NotificationRequirement, R as RegulatoryNotification, b as RiskAssessment } from './breach-Eu9byel8.mjs';
5
- import 'react';
8
+ import { B as BreachCategory, a as BreachReport, b as RiskAssessment, R as RegulatoryNotification } from './breach-Eu9byel8.mjs';
9
+ export { N as NotificationRequirement } from './breach-Eu9byel8.mjs';
10
+ import * as React from 'react';
11
+ import React__default from 'react';
12
+ import { S as StorageAdapter } from './types-DK2CoKOC.mjs';
13
+
14
+ interface BreachProviderProps {
15
+ categories: BreachCategory[];
16
+ adapter?: StorageAdapter<{
17
+ reports: BreachReport[];
18
+ assessments: RiskAssessment[];
19
+ notifications: RegulatoryNotification[];
20
+ }>;
21
+ storageKey?: string;
22
+ useLocalStorage?: boolean;
23
+ initialReports?: BreachReport[];
24
+ onReport?: (report: BreachReport) => void;
25
+ onAssessment?: (assessment: RiskAssessment) => void;
26
+ onNotification?: (notification: RegulatoryNotification) => void;
27
+ children: React__default.ReactNode;
28
+ }
29
+ declare const BreachProvider: React__default.FC<BreachProviderProps>;
30
+
31
+ declare const Breach: {
32
+ Provider: React.FC<BreachProviderProps>;
33
+ ReportForm: React.FC<BreachReportFormProps>;
34
+ RiskAssessment: React.FC<BreachRiskAssessmentProps>;
35
+ NotificationManager: React.FC<BreachNotificationManagerProps>;
36
+ ReportGenerator: React.FC<RegulatoryReportGeneratorProps>;
37
+ };
38
+
39
+ interface BreachContextValue extends UseBreachReturn {
40
+ categories: BreachCategory[];
41
+ }
42
+ declare function useBreachCompound(): BreachContextValue;
43
+
44
+ export { Breach, BreachCategory, BreachProvider, type BreachProviderProps, BreachReport, RegulatoryNotification, RiskAssessment, StorageAdapter, useBreachCompound };
package/dist/breach.d.ts CHANGED
@@ -1,5 +1,44 @@
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';
1
+ import { c as BreachReportFormProps } from './BreachReportForm-DpRrBoxU.js';
2
+ export { B as BreachFormSubmission, a as BreachReportForm, b as BreachReportFormClassNames } from './BreachReportForm-DpRrBoxU.js';
3
+ import { e as BreachRiskAssessmentProps, f as BreachNotificationManagerProps, g as RegulatoryReportGeneratorProps } from './RegulatoryReportGenerator-BUYgzTTT.js';
4
+ export { B as BreachNotificationManager, a as BreachNotificationManagerClassNames, b as BreachRiskAssessment, c as BreachRiskAssessmentClassNames, R as RegulatoryReportGenerator, d as RegulatoryReportGeneratorClassNames } from './RegulatoryReportGenerator-BUYgzTTT.js';
5
+ import { U as UseBreachReturn } from './useBreach-DkVXvtJK.js';
6
+ export { u as useBreach } from './useBreach-DkVXvtJK.js';
3
7
  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';
8
+ import { B as BreachCategory, a as BreachReport, b as RiskAssessment, R as RegulatoryNotification } from './breach-Eu9byel8.js';
9
+ export { N as NotificationRequirement } from './breach-Eu9byel8.js';
10
+ import * as React from 'react';
11
+ import React__default from 'react';
12
+ import { S as StorageAdapter } from './types-DK2CoKOC.js';
13
+
14
+ interface BreachProviderProps {
15
+ categories: BreachCategory[];
16
+ adapter?: StorageAdapter<{
17
+ reports: BreachReport[];
18
+ assessments: RiskAssessment[];
19
+ notifications: RegulatoryNotification[];
20
+ }>;
21
+ storageKey?: string;
22
+ useLocalStorage?: boolean;
23
+ initialReports?: BreachReport[];
24
+ onReport?: (report: BreachReport) => void;
25
+ onAssessment?: (assessment: RiskAssessment) => void;
26
+ onNotification?: (notification: RegulatoryNotification) => void;
27
+ children: React__default.ReactNode;
28
+ }
29
+ declare const BreachProvider: React__default.FC<BreachProviderProps>;
30
+
31
+ declare const Breach: {
32
+ Provider: React.FC<BreachProviderProps>;
33
+ ReportForm: React.FC<BreachReportFormProps>;
34
+ RiskAssessment: React.FC<BreachRiskAssessmentProps>;
35
+ NotificationManager: React.FC<BreachNotificationManagerProps>;
36
+ ReportGenerator: React.FC<RegulatoryReportGeneratorProps>;
37
+ };
38
+
39
+ interface BreachContextValue extends UseBreachReturn {
40
+ categories: BreachCategory[];
41
+ }
42
+ declare function useBreachCompound(): BreachContextValue;
43
+
44
+ export { Breach, BreachCategory, BreachProvider, type BreachProviderProps, BreachReport, RegulatoryNotification, RiskAssessment, StorageAdapter, useBreachCompound };
package/dist/breach.js CHANGED
@@ -1,2 +1,2 @@
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
1
+ 'use strict';var chunkU6VWHC46_js=require('./chunk-U6VWHC46.js'),chunkGVANK6PL_js=require('./chunk-GVANK6PL.js'),chunk2W7ARAW2_js=require('./chunk-2W7ARAW2.js'),chunkRYZEIDNR_js=require('./chunk-RYZEIDNR.js');require('./chunk-EPF7J2FK.js'),require('./chunk-E64TU6IU.js'),require('./chunk-UK656RCG.js');var chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var p=react.createContext(null);function P(){let e=react.useContext(p);if(!e)throw new Error("Breach compound components must be wrapped in <Breach.Provider>. Example: <Breach.Provider categories={...}><Breach.ReportForm /></Breach.Provider>");return e}var s=({categories:e,adapter:m,storageKey:h,useLocalStorage:B,initialReports:f,onReport:R,onAssessment:x,onNotification:u,children:d})=>{let y=chunk2W7ARAW2_js.a({categories:e,adapter:m,storageKey:h,useLocalStorage:B,initialReports:f,onReport:R,onAssessment:x,onNotification:u}),l=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},y),{categories:e});return jsxRuntime.jsx(p.Provider,{value:l,children:d})};var A={Provider:s,ReportForm:chunkGVANK6PL_js.a,RiskAssessment:chunkU6VWHC46_js.a,NotificationManager:chunkU6VWHC46_js.b,ReportGenerator:chunkU6VWHC46_js.c};Object.defineProperty(exports,"BreachNotificationManager",{enumerable:true,get:function(){return chunkU6VWHC46_js.b}});Object.defineProperty(exports,"BreachRiskAssessment",{enumerable:true,get:function(){return chunkU6VWHC46_js.a}});Object.defineProperty(exports,"RegulatoryReportGenerator",{enumerable:true,get:function(){return chunkU6VWHC46_js.c}});Object.defineProperty(exports,"BreachReportForm",{enumerable:true,get:function(){return chunkGVANK6PL_js.a}});Object.defineProperty(exports,"useBreach",{enumerable:true,get:function(){return chunk2W7ARAW2_js.a}});Object.defineProperty(exports,"calculateBreachSeverity",{enumerable:true,get:function(){return chunkRYZEIDNR_js.a}});exports.Breach=A;exports.BreachProvider=s;exports.useBreachCompound=P;//# 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-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
1
+ import {c,b,a}from'./chunk-ISSGO2YT.mjs';export{b as BreachNotificationManager,a as BreachRiskAssessment,c as RegulatoryReportGenerator}from'./chunk-ISSGO2YT.mjs';import {a as a$1}from'./chunk-3XAUN5IM.mjs';export{a as BreachReportForm}from'./chunk-3XAUN5IM.mjs';import {a as a$2}from'./chunk-LFNA6WYQ.mjs';export{a as useBreach}from'./chunk-LFNA6WYQ.mjs';export{a as calculateBreachSeverity}from'./chunk-RGYK4VAY.mjs';import'./chunk-FXTZDKDC.mjs';import'./chunk-AYKLAEOU.mjs';import'./chunk-SBNAMPAP.mjs';import {b as b$1,a as a$3}from'./chunk-WWT2ZSNU.mjs';import {createContext,useContext}from'react';import {jsx}from'react/jsx-runtime';var p=createContext(null);function P(){let e=useContext(p);if(!e)throw new Error("Breach compound components must be wrapped in <Breach.Provider>. Example: <Breach.Provider categories={...}><Breach.ReportForm /></Breach.Provider>");return e}var s=({categories:e,adapter:m,storageKey:h,useLocalStorage:B,initialReports:f,onReport:R,onAssessment:x,onNotification:u,children:d})=>{let y=a$2({categories:e,adapter:m,storageKey:h,useLocalStorage:B,initialReports:f,onReport:R,onAssessment:x,onNotification:u}),l=b$1(a$3({},y),{categories:e});return jsx(p.Provider,{value:l,children:d})};var A={Provider:s,ReportForm:a$1,RiskAssessment:a,NotificationManager:b,ReportGenerator:c};export{A as Breach,s as BreachProvider,P as useBreachCompound};//# sourceMappingURL=breach.mjs.map
2
2
  //# sourceMappingURL=breach.mjs.map
@@ -0,0 +1,2 @@
1
+ import {a}from'./chunk-AYKLAEOU.mjs';import {b,a as a$1}from'./chunk-WWT2ZSNU.mjs';import {useState,useEffect}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var G=({options:l,settings:u,onSave:v,title:h="Manage Your Privacy Settings",description:x="Update your consent preferences at any time. Required cookies cannot be disabled as they are necessary for the website to function. Consent management is provided in accordance with NDPA Sections 25-26.",saveButtonText:m="Save Preferences",resetButtonText:y="Reset to Defaults",version:k="1.0",className:S="",buttonClassName:i="",primaryButtonClassName:a$2="",secondaryButtonClassName:w="",classNames:e,unstyled:s,showSuccessMessage:R=true,successMessage:B="Your preferences have been saved.",successMessageDuration:D=3e3})=>{let[p,n]=useState({}),[o,d]=useState(false);useEffect(()=>{if(u&&u.consents)n(u.consents);else {let t={};l.forEach(c=>{t[c.id]=c.defaultValue||false;}),n(t);}},[l,u]);let b$1=(t,c)=>{n(L=>b(a$1({},L),{[t]:c}));},I=()=>{let t={consents:p,timestamp:Date.now(),version:k,method:"manager",hasInteracted:true};v(t),R&&(d(true),setTimeout(()=>{d(false);},D));},M=()=>{let t={};l.forEach(c=>{t[c.id]=c.defaultValue||false;}),n(t);},O=(e==null?void 0:e.primaryButton)||(e==null?void 0:e.saveButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${i} ${a$2}`,C=(e==null?void 0:e.secondaryButton)||(e==null?void 0:e.resetButton)||`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 ${i} ${w}`;return jsxs("div",{className:a(`bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 ${S}`,e==null?void 0:e.root,s),children:[jsx("h2",{className:a("text-xl font-bold mb-2",e==null?void 0:e.title,s),children:h}),jsx("p",{className:a("mb-6 text-gray-600 dark:text-gray-300",e==null?void 0:e.description,s),children:x}),jsx("div",{className:a("space-y-6",e==null?void 0:e.optionsList,s),children:l.map(t=>jsx("div",{className:a("border-b border-gray-200 dark:border-gray-700 pb-4 last:border-0",e==null?void 0:e.optionItem,s),children:jsxs("div",{className:"flex items-start justify-between",children:[jsxs("div",{children:[jsx("h3",{className:"font-medium text-gray-900 dark:text-white",children:t.label}),jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mt-1",children:t.description})]}),jsx("div",{className:"ml-4 flex-shrink-0",children:jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[jsx("input",{type:"checkbox",className:"sr-only peer",checked:p[t.id]||false,onChange:c=>b$1(t.id,c.target.checked),disabled:t.required}),jsx("div",{className:a(`w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-[rgb(var(--ndpr-ring)/0.3)] rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-[rgb(var(--ndpr-primary))] ${t.required?"opacity-60":""}`,e==null?void 0:e.toggle,s)}),jsxs("span",{className:"ml-3 text-sm font-medium text-gray-900 dark:text-gray-300",children:[p[t.id]?"Enabled":"Disabled",t.required&&jsx("span",{className:"text-xs text-red-500 ml-1",children:"(Required)"})]})]})})]})},t.id))}),o&&jsx("div",{className:"mt-4 p-3 bg-green-50 dark:bg-green-900/20 text-green-800 dark:text-green-200 rounded-md",children:B}),jsxs("div",{className:"mt-6 flex flex-wrap gap-3",children:[jsx("button",{onClick:I,className:a(O,e==null?void 0:e.saveButton,s),children:m}),jsx("button",{onClick:M,className:a(C,e==null?void 0:e.resetButton,s),children:y})]}),jsxs("div",{className:"mt-4 text-xs text-gray-600 dark:text-gray-400",children:[jsxs("p",{children:["Last updated: ",u?new Date(u.timestamp).toLocaleString():"Never"]}),jsxs("p",{children:["Version: ",k]})]})]})};var X=({settings:l,storageOptions:u={},onLoad:v,onSave:h,autoSave:x=true,autoLoad:m=true,classNames:y,unstyled:k,children:S})=>{let{storageKey:i="ndpr_consent",storageType:a$1="localStorage",cookieOptions:w={}}=u,[e,s]=useState(false);useEffect(()=>{m&&!e&&R();},[m,e]),useEffect(()=>{x&&e&&B(l);},[l,x,e]);let R=()=>{let n=null;try{if(a$1==="localStorage"&&typeof window!="undefined"){let o=localStorage.getItem(i);o&&(n=JSON.parse(o));}else if(a$1==="sessionStorage"&&typeof window!="undefined"){let o=sessionStorage.getItem(i);o&&(n=JSON.parse(o));}else if(a$1==="cookie"&&typeof document!="undefined"){let d=document.cookie.split(";").find(b=>b.trim().startsWith(`${i}=`));if(d){let b=d.split("=")[1];n=JSON.parse(decodeURIComponent(b));}}s(!0),v&&v(n);}catch(o){console.error("Error loading consent settings:",o),s(true),v&&v(null);}return n},B=n=>{try{let o=JSON.stringify(n);if(a$1==="localStorage"&&typeof window!="undefined")localStorage.setItem(i,o);else if(a$1==="sessionStorage"&&typeof window!="undefined")sessionStorage.setItem(i,o);else if(a$1==="cookie"&&typeof document!="undefined"){let{domain:d,path:b="/",expires:I=365,secure:M=!0,sameSite:O="Lax"}=w,C=new Date;C.setDate(C.getDate()+I);let t=`${i}=${encodeURIComponent(o)}; path=${b}; expires=${C.toUTCString()}`;d&&(t+=`; domain=${d}`),M&&(t+="; secure"),t+=`; samesite=${O}`,document.cookie=t;}return h&&h(n),!0}catch(o){return console.error("Error saving consent settings:",o),false}},D=()=>{try{if(a$1==="localStorage"&&typeof window!="undefined")localStorage.removeItem(i);else if(a$1==="sessionStorage"&&typeof window!="undefined")sessionStorage.removeItem(i);else if(a$1==="cookie"&&typeof document!="undefined"){let{domain:n,path:o="/"}=w,d=`${i}=; path=${o}; expires=Thu, 01 Jan 1970 00:00:00 GMT`;n&&(d+=`; domain=${n}`),document.cookie=d;}return !0}catch(n){return console.error("Error clearing consent settings:",n),false}},p=a("",y==null?void 0:y.root,k);if(typeof S=="function"){let n=S({loadSettings:R,saveSettings:B,clearSettings:D,loaded:e});return p?jsx("div",{className:p,children:n}):jsx(Fragment,{children:n})}return p?jsx("div",{className:p,children:S}):jsx(Fragment,{children:S})};export{G as a,X as b};//# sourceMappingURL=chunk-27NYSWUG.mjs.map
2
+ //# sourceMappingURL=chunk-27NYSWUG.mjs.map
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkTDDAYVKK_js=require('./chunk-TDDAYVKK.js'),chunkUK656RCG_js=require('./chunk-UK656RCG.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function F(v,c){return c?chunkUK656RCG_js.a(v):{load:()=>null,save:()=>{},remove:()=>{}}}function z({initialActivities:v=[],adapter:c,storageKey:b="ndpr_lawful_basis_activities",useLocalStorage:R=true,onAdd:g,onUpdate:A,onRemove:y}={}){let p=c!=null?c:F(b,R),f=react.useRef(p);f.current=p;let[o,u]=react.useState(v),[x,l]=react.useState(true);react.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=react.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=react.useCallback(t=>{let i=Date.now(),e=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t),{id:_(),createdAt:i,updatedAt:i});return u(s=>{let r=[...s,e];return a(r),r}),g&&g(e),e},[g,a]),O=react.useCallback((t,i)=>{let e=null;return u(s=>{let r=s.findIndex(k=>k.id===t);if(r===-1)return s;e=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},s[r]),i),{id:s[r].id,updatedAt:Date.now()});let P=[...s];return P[r]=e,a(P),P}),e&&A&&A(e),e},[A,a]),D=react.useCallback(t=>{u(i=>{let e=i.filter(s=>s.id!==t);return a(e),e}),y&&y(t);},[y,a]),I=react.useCallback(t=>o.find(i=>i.id===t)||null,[o]),U=react.useCallback(()=>chunkTDDAYVKK_js.d(o),[o]),V=react.useCallback(t=>chunkTDDAYVKK_js.a(t),[]);return {activities:o,addActivity:h,updateActivity:O,removeActivity:D,getActivity:I,getSummary:U,validateActivity:V,isLoading:x}}exports.a=z;//# sourceMappingURL=chunk-2ORDHJRD.js.map
2
+ //# sourceMappingURL=chunk-2ORDHJRD.js.map
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkRYZEIDNR_js=require('./chunk-RYZEIDNR.js'),chunkUK656RCG_js=require('./chunk-UK656RCG.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function K(q,h){return h?chunkUK656RCG_js.a(q):{load:()=>null,save:()=>{},remove:()=>{}}}function W({categories:q,initialReports:h=[],adapter:g,storageKey:L="ndpr_breach_data",useLocalStorage:P=true,onReport:v,onAssessment:S,onNotification:I}){let D=g!=null?g:K(L,P),d=react.useRef(D);d.current=D;let[a,m]=react.useState(h),[u,A]=react.useState([]),[c,B]=react.useState([]),[U,N]=react.useState(true);react.useEffect(()=>{let e=false;try{let s=d.current.load(),r=t=>{var i,n,l;t&&(m((i=t.reports)!=null?i:[]),A((n=t.assessments)!=null?n:[]),B((l=t.notifications)!=null?l:[])),N(!1);};s instanceof Promise?s.then(t=>{e||r(t);},()=>{e||N(!1);}):r(s);}catch(s){e||N(false);}return ()=>{e=true;}},[]);let f=(e,s,r)=>{Promise.resolve(d.current.save({reports:e,assessments:s,notifications:r})).catch(t=>{console.warn("[ndpr-toolkit] Failed to save breach data:",t);});},y=e=>`${e}_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,_=e=>{let s=chunkMQFZHA2D_js.a({id:y("breach"),reportedAt:Date.now()},e),r=[...a,s];return m(r),f(r,u,c),v&&v(s),s},$=(e,s)=>{let r=a.findIndex(n=>n.id===e);if(r===-1)return null;let t=chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},a[r]),s),i=[...a];return i[r]=t,m(i),f(i,u,c),t},w=e=>a.find(s=>s.id===e)||null,j=(e,s)=>{let r=u.find(n=>n.breachId===e),t,i;return r?(i=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},r),s),{assessedAt:Date.now()}),t=u.map(n=>n.id===r.id?i:n)):(i=chunkMQFZHA2D_js.a({id:y("assessment"),breachId:e,assessedAt:Date.now()},s),t=[...u,i]),A(t),f(a,t,c),S&&S(i),i},b=e=>u.find(s=>s.breachId===e)||null,x=e=>{let s=w(e),r=b(e);if(!s)return null;let{severityLevel:t,notificationRequired:i,timeframeHours:n,justification:l}=chunkRYZEIDNR_js.a(s,r||void 0),R=s.discoveredAt+n*60*60*1e3;return {ndpcNotificationRequired:i,ndpcNotificationDeadline:R,dataSubjectNotificationRequired:t==="high"||t==="critical",justification:l}};return {reports:a,assessments:u,notifications:c,reportBreach:_,updateReport:$,getReport:w,assessRisk:j,getAssessment:b,calculateNotificationRequirements:x,sendNotification:(e,s)=>{let r=c.find(n=>n.breachId===e),t,i;return r?(i=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},r),s),{sentAt:Date.now()}),t=c.map(n=>n.id===r.id?i:n)):(i=chunkMQFZHA2D_js.a({id:y("notification"),breachId:e,sentAt:Date.now()},s),t=[...c,i]),B(t),f(a,u,t),I&&I(i),i},getNotification:e=>c.find(s=>s.breachId===e)||null,getBreachesRequiringNotification:(e=24)=>{let s=Date.now(),r=[];return a.forEach(t=>{if(c.some(E=>E.breachId===t.id))return;let i=b(t.id);if(!i)return;let n=x(t.id);if(!n||!n.ndpcNotificationRequired)return;let R=(n.ndpcNotificationDeadline-s)/(3600*1e3);R<=e&&r.push({report:t,assessment:i,requirements:n,hoursRemaining:R});}),r.sort((t,i)=>t.hoursRemaining-i.hoursRemaining)},clearBreachData:()=>{m([]),A([]),B([]),Promise.resolve(d.current.remove()).catch(e=>{console.warn("[ndpr-toolkit] Failed to remove breach data:",e);});},isLoading:U}}exports.a=W;//# sourceMappingURL=chunk-2W7ARAW2.js.map
2
+ //# sourceMappingURL=chunk-2W7ARAW2.js.map
@@ -0,0 +1,2 @@
1
+ 'use strict';function p(t){return {load(){if(typeof window=="undefined")return null;try{let n=sessionStorage.getItem(t);return n?JSON.parse(n):null}catch(n){return null}},save(n){typeof window!="undefined"&&sessionStorage.setItem(t,JSON.stringify(n));},remove(){typeof window!="undefined"&&sessionStorage.removeItem(t);}}}function f(t,n={}){let{domain:r,path:a="/",expires:s=365,secure:d=true,sameSite:u="Lax"}=n;return {load(){if(typeof document=="undefined")return null;try{let e=document.cookie.split(";").map(o=>o.trim()).find(o=>o.startsWith(`${t}=`));return e?JSON.parse(decodeURIComponent(e.split("=")[1])):null}catch(e){return null}},save(e){if(typeof document=="undefined")return;let o=new Date;o.setDate(o.getDate()+s);let i=`${t}=${encodeURIComponent(JSON.stringify(e))}; path=${a}; expires=${o.toUTCString()}; samesite=${u}`;r&&(i+=`; domain=${r}`),d&&(i+="; secure"),document.cookie=i;},remove(){if(typeof document=="undefined")return;let e=`${t}=; path=${a}; expires=Thu, 01 Jan 1970 00:00:00 GMT`;r&&(e+=`; domain=${r}`),document.cookie=e;}}}exports.a=p;exports.b=f;//# sourceMappingURL=chunk-3F34NACG.js.map
2
+ //# sourceMappingURL=chunk-3F34NACG.js.map
@@ -0,0 +1,7 @@
1
+ 'use strict';var chunk5RSOLEEP_js=require('./chunk-5RSOLEEP.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var tr=({sections:x=chunk5RSOLEEP_js.b,variables:h=chunk5RSOLEEP_js.c,onGenerate:F,title:L="NDPA Privacy Policy Generator",description:I="Generate an NDPA-compliant privacy policy for your organization in accordance with NDPA Section 24.",className:R="",buttonClassName:y="",generateButtonText:O="Generate Policy",showPreview:K=true,allowEditing:P=true,classNames:r,unstyled:p=false})=>{let[f,$]=react.useState(x),[s,S]=react.useState(h),[l,m]=react.useState("sections"),[C,j]=react.useState(""),[E,G]=react.useState(""),[Q,_]=react.useState(false),[b,V]=react.useState({});react.useEffect(()=>{$(x);},[x]),react.useEffect(()=>{S(h);},[h]);let W=t=>{$(d=>d.map(n=>n.id===t?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},n),{included:!n.included}):n));},k=(t,d)=>{S(n=>n.map(a=>a.id===t?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{value:d}):a)),b[t]&&V(n=>{let a=chunkMQFZHA2D_js.a({},n);return delete a[t],a});},U=()=>{let t={},d=true;return s.forEach(n=>{n.required&&!n.value&&(t[n.id]=`${n.name} is required`,d=false);}),V(t),d},Y=()=>{if(!U()){m("variables");return}let t=f.filter(a=>a.included),d=Object.fromEntries(s.map(a=>[a.name,a.value])),n="";t.forEach(a=>{n+=`## ${a.title}
2
+
3
+ `,n+=chunk5RSOLEEP_js.a(a.template,d),n+=`
4
+
5
+ `;}),j(n),G(n),_(true),m("preview");},z=()=>{F({sections:f,variables:s,content:P?E:C});},q=()=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-4",r==null?void 0:r.sectionList,p),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Select Policy Sections"}),f.map(t=>jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("border border-gray-200 dark:border-gray-700 rounded-md p-4",r==null?void 0:r.sectionItem,p),children:jsxRuntime.jsxs("div",{className:"flex items-start",children:[jsxRuntime.jsx("div",{className:"flex items-center h-5",children:jsxRuntime.jsx("input",{id:`section-${t.id}`,type:"checkbox",checked:t.included,onChange:()=>W(t.id),disabled:t.required,className:chunkE64TU6IU_js.a("w-4 h-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))] dark:focus:ring-[rgb(var(--ndpr-ring))] dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600",r==null?void 0:r.input,p)})}),jsxRuntime.jsxs("div",{className:"ml-3 text-sm",children:[jsxRuntime.jsxs("label",{htmlFor:`section-${t.id}`,className:"font-medium text-gray-900 dark:text-white",children:[t.title," ",t.required&&jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),t.description&&jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 mt-1",children:t.description})]})]})},t.id)),jsxRuntime.jsx("div",{className:"mt-6",children:jsxRuntime.jsx("button",{onClick:()=>m("variables"),className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${y}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.generateButton),p),children:"Next: Fill Variables"})})]}),M=()=>{let t={};return s.forEach(d=>{let n=d.id.split(".")[0];t[n]||(t[n]=[]),t[n].push(d);}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",r==null?void 0:r.form,p),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Fill Policy Variables"}),jsxRuntime.jsx("div",{className:"space-y-6",children:Object.entries(t).map(([d,n])=>{let a=f.find(i=>i.id===d);return a&&!a.included?null:jsxRuntime.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-md p-4",children:[jsxRuntime.jsx("h4",{className:"font-medium text-lg mb-3",children:a?a.title:"General Information"}),jsxRuntime.jsx("div",{className:"space-y-4",children:n.map(i=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:`var-${i.id}`,className:"block text-sm font-medium mb-1",children:[i.name," ",i.required&&jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),i.description&&jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-2",children:i.description}),i.inputType==="textarea"?jsxRuntime.jsx("textarea",{id:`var-${i.id}`,value:i.value,onChange:c=>k(i.id,c.target.value),rows:4,className:chunkE64TU6IU_js.a(`w-full px-3 py-2 border ${b[i.id]?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,r==null?void 0:r.input,p),required:i.required}):i.inputType==="select"&&i.options?jsxRuntime.jsxs("select",{id:`var-${i.id}`,value:i.value,onChange:c=>k(i.id,c.target.value),className:chunkE64TU6IU_js.a(`w-full px-3 py-2 border ${b[i.id]?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,r==null?void 0:r.input,p),required:i.required,children:[jsxRuntime.jsx("option",{value:"",children:"Select an option"}),i.options.map(c=>jsxRuntime.jsx("option",{value:c,children:c},c))]}):jsxRuntime.jsx("input",{id:`var-${i.id}`,type:i.inputType,value:i.value,onChange:c=>k(i.id,c.target.value),className:chunkE64TU6IU_js.a(`w-full px-3 py-2 border ${b[i.id]?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,r==null?void 0:r.input,p),required:i.required}),b[i.id]&&jsxRuntime.jsx("p",{className:"mt-1 text-sm text-red-600 dark:text-red-500",children:b[i.id]})]},i.id))})]},d)})}),jsxRuntime.jsxs("div",{className:"mt-6 flex space-x-4",children:[jsxRuntime.jsx("button",{onClick:()=>m("sections"),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 ${y}`,children:"Back to Sections"}),jsxRuntime.jsx("button",{onClick:Y,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${y}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.generateButton),p),children:O})]})]})},H=()=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Preview Generated Policy"}),P?jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("label",{htmlFor:"policy-content",className:"block text-sm font-medium mb-1",children:"Edit Policy Content"}),jsxRuntime.jsx("textarea",{id:"policy-content",value:E,onChange:t=>G(t.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"})]}):jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md mb-4",children:jsxRuntime.jsx("div",{className:"prose dark:prose-invert max-w-none",children:C.split(`
6
+ `).map((t,d)=>t.startsWith("## ")?jsxRuntime.jsx("h2",{className:"text-xl font-bold mt-6 mb-3",children:t.substring(3)},d):t.startsWith("### ")?jsxRuntime.jsx("h3",{className:"text-lg font-bold mt-4 mb-2",children:t.substring(4)},d):t===""?jsxRuntime.jsx("br",{},d):jsxRuntime.jsx("p",{className:"mb-2",children:t},d))})}),jsxRuntime.jsxs("div",{className:"mt-6 flex space-x-4",children:[jsxRuntime.jsx("button",{onClick:()=>m("variables"),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 ${y}`,children:"Back to Variables"}),jsxRuntime.jsx("button",{onClick:z,className:`px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${y}`,children:"Save Policy"})]})]}),J=()=>{switch(l){case "sections":return q();case "variables":return M();case "preview":return H();default:return q()}};return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${R}`,r==null?void 0:r.root,p),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6",r==null?void 0:r.header,p),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",r==null?void 0:r.title,p),children:L}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-gray-600 dark:text-gray-300",r==null?void 0:r.description,p),children:I})]}),jsxRuntime.jsx("div",{className:"mb-8",children:jsxRuntime.jsxs("ol",{className:"flex items-center w-full",children:[jsxRuntime.jsxs("li",{className:`flex w-full items-center ${l==="sections"?"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400"} after:content-[''] after:w-full after:h-1 after:border-b after:border-gray-200 after:border-1 after:hidden sm:after:inline-block after:mx-6 xl:after:mx-10`,children:[jsxRuntime.jsx("span",{className:`flex items-center justify-center w-8 h-8 ${l==="sections"?"bg-[rgb(var(--ndpr-primary)/0.1)] dark:bg-[rgb(var(--ndpr-primary)/0.2)]":"bg-gray-100 dark:bg-gray-700"} rounded-full shrink-0`,children:"1"}),jsxRuntime.jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Sections"})]}),jsxRuntime.jsxs("li",{className:`flex w-full items-center ${l==="variables"?"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400"} after:content-[''] after:w-full after:h-1 after:border-b after:border-gray-200 after:border-1 after:hidden sm:after:inline-block after:mx-6 xl:after:mx-10`,children:[jsxRuntime.jsx("span",{className:`flex items-center justify-center w-8 h-8 ${l==="variables"?"bg-[rgb(var(--ndpr-primary)/0.1)] dark:bg-[rgb(var(--ndpr-primary)/0.2)]":"bg-gray-100 dark:bg-gray-700"} rounded-full shrink-0`,children:"2"}),jsxRuntime.jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Variables"})]}),jsxRuntime.jsxs("li",{className:`flex items-center ${l==="preview"?"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400"}`,children:[jsxRuntime.jsx("span",{className:`flex items-center justify-center w-8 h-8 ${l==="preview"?"bg-[rgb(var(--ndpr-primary)/0.1)] dark:bg-[rgb(var(--ndpr-primary)/0.2)]":"bg-gray-100 dark:bg-gray-700"} rounded-full shrink-0`,children:"3"}),jsxRuntime.jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Preview"})]})]})}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",r==null?void 0:r.complianceNotice,p),children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Compliance Notice"}),jsxRuntime.jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"This tool helps you generate a privacy policy that aligns with the Nigeria Data Protection Act (NDPA) 2023. While we strive to ensure compliance, we recommend having the final policy reviewed by a legal professional familiar with NDPA requirements."})]}),J()]})};exports.a=tr;//# sourceMappingURL=chunk-3RGJV3VF.js.map
7
+ //# sourceMappingURL=chunk-3RGJV3VF.js.map
@@ -0,0 +1,2 @@
1
+ import {a}from'./chunk-AYKLAEOU.mjs';import {jsxs,jsx}from'react/jsx-runtime';var m={consent:"Consent",dsr:"Data Subject Rights",dpia:"DPIA",breach:"Breach Notification",policy:"Privacy Policy",lawfulBasis:"Lawful Basis",crossBorder:"Cross-Border",ropa:"ROPA"},p={critical:"rgb(var(--ndpr-destructive))","needs-work":"rgb(var(--ndpr-warning))",good:"rgb(var(--ndpr-primary))",excellent:"rgb(var(--ndpr-success))"},x={critical:"Critical","needs-work":"Needs Work",good:"Good",excellent:"Excellent"},f={critical:"Critical",high:"High",medium:"Medium",low:"Low"},y=({score:t,rating:e,classNames:o,unstyled:a$1})=>{let r=p[e],i=2*Math.PI*40,l=i*(1-t/100);return jsxs("div",{className:a("relative inline-flex items-center justify-center",o==null?void 0:o.scoreCircle,a$1),children:[jsxs("svg",{width:"120",height:"120",viewBox:"0 0 100 100","aria-hidden":"true",children:[jsx("circle",{cx:"50",cy:"50",r:"40",fill:"none",stroke:"rgba(0,0,0,0.08)",strokeWidth:"8"}),jsx("circle",{cx:"50",cy:"50",r:"40",fill:"none",stroke:r,strokeWidth:"8",strokeLinecap:"round",strokeDasharray:i,strokeDashoffset:l,transform:"rotate(-90 50 50)",style:{transition:"stroke-dashoffset 0.4s ease"}})]}),jsx("span",{className:a("absolute text-2xl font-bold tabular-nums",o==null?void 0:o.scoreValue,a$1),style:{color:r},children:t})]})},C=({rating:t,className:e,unstyled:o})=>{let a$1=p[t];return jsx("span",{className:a("inline-block px-3 py-1 rounded-full text-sm font-semibold",e,o),style:{backgroundColor:`${a$1.replace("rgb(","rgba(").replace(")",", 0.12)")}`,color:a$1,border:`1px solid ${a$1.replace("rgb(","rgba(").replace(")",", 0.3)")}`},children:x[t]})},h=({moduleKey:t,module:e,classNames:o,unstyled:a$1})=>{var b;let r=e.score>=90?"excellent":e.score>=70?"good":e.score>=40?"needs-work":"critical",i=p[r];Math.round(e.score/100*(e.gaps.length+Math.round(e.score/100*5)));let u=e.gaps.length,c=(b=m[t])!=null?b:t;return jsxs("div",{className:a("rounded-lg border p-4 flex flex-col gap-2",o==null?void 0:o.moduleCard,a$1),style:{borderColor:`${i.replace("rgb(","rgba(").replace(")",", 0.25)")}`,backgroundColor:`${i.replace("rgb(","rgba(").replace(")",", 0.04)")}`},children:[jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{className:a("text-sm font-semibold truncate",o==null?void 0:o.moduleTitle,a$1),children:c}),jsx("span",{className:a("text-lg font-bold tabular-nums",o==null?void 0:o.moduleScore,a$1),style:{color:i},children:e.score})]}),jsx("div",{className:"h-1.5 rounded-full overflow-hidden",style:{backgroundColor:"rgba(0,0,0,0.08)"},role:"progressbar","aria-valuenow":e.score,"aria-valuemin":0,"aria-valuemax":100,children:jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${e.score}%`,backgroundColor:i}})}),u>0&&jsxs("p",{className:a("text-xs text-gray-500 dark:text-gray-400",o==null?void 0:o.moduleGaps,a$1),children:[u," gap",u!==1?"s":""," to address"]})]})},R=({rec:t,classNames:e,unstyled:o})=>{var i,l;let r=(i={critical:p.critical,high:p["needs-work"],medium:p.good,low:p.excellent}[t.priority])!=null?i:p.good;return jsxs("div",{"data-testid":"recommendation-item",className:a("flex gap-3 p-3 rounded-lg border border-gray-100 dark:border-gray-700 bg-white dark:bg-gray-800",e==null?void 0:e.recommendationItem,o),children:[jsx("span",{className:a("mt-0.5 shrink-0 inline-block px-2 py-0.5 rounded text-xs font-bold uppercase tracking-wide",e==null?void 0:e.recommendationPriority,o),style:{backgroundColor:`${r.replace("rgb(","rgba(").replace(")",", 0.12)")}`,color:r},children:(l=f[t.priority])!=null?l:t.priority}),jsxs("div",{className:"min-w-0 flex-1",children:[jsx("p",{className:a("text-sm font-medium text-gray-900 dark:text-gray-100",e==null?void 0:e.recommendationTitle,o),children:t.label}),jsx("p",{className:"mt-0.5 text-xs text-gray-500 dark:text-gray-400 leading-relaxed",children:t.recommendation}),jsxs("p",{className:"mt-1 text-xs text-gray-400 dark:text-gray-500",children:[t.ndpaSection," \u2022 Effort: ",t.effort]})]})]})},k=({report:t,title:e="NDPA Compliance Dashboard",showRecommendations:o=true,maxRecommendations:a$1=5,classNames:r,unstyled:i=false})=>{let l=t.recommendations.slice(0,a$1),u=Object.entries(t.modules);return jsxs("div",{"data-ndpr-component":"compliance-dashboard",className:a("w-full rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-900 shadow-sm p-6 flex flex-col gap-8",r==null?void 0:r.root,i),children:[jsxs("div",{className:a("flex flex-col sm:flex-row items-start sm:items-center gap-6",r==null?void 0:r.header,i),children:[jsx(y,{score:t.score,rating:t.rating,classNames:{scoreCircle:r==null?void 0:r.scoreCircle,scoreValue:r==null?void 0:r.scoreValue},unstyled:i}),jsxs("div",{className:"flex flex-col gap-2",children:[jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-gray-100 leading-tight",children:e}),jsx(C,{rating:t.rating,className:r==null?void 0:r.ratingBadge,unstyled:i}),jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Generated on"," ",new Date(t.generatedAt).toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"})]})]})]}),jsx("div",{className:a("grid grid-cols-2 sm:grid-cols-2 md:grid-cols-4 gap-3",r==null?void 0:r.modulesGrid,i),children:u.map(([c,b])=>jsx(h,{moduleKey:c,module:b,classNames:{moduleCard:r==null?void 0:r.moduleCard,moduleTitle:r==null?void 0:r.moduleTitle,moduleScore:r==null?void 0:r.moduleScore,moduleGaps:r==null?void 0:r.moduleGaps},unstyled:i},c))}),o&&l.length>0&&jsxs("div",{className:a("flex flex-col gap-3",r==null?void 0:r.recommendationsSection,i),children:[jsx("h3",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:"Recommendations"}),l.map(c=>jsx(R,{rec:c,classNames:{recommendationItem:r==null?void 0:r.recommendationItem,recommendationPriority:r==null?void 0:r.recommendationPriority,recommendationTitle:r==null?void 0:r.recommendationTitle},unstyled:i},`${c.module}-${c.key}`))]})]})};export{k as a};//# sourceMappingURL=chunk-3UWT64FI.mjs.map
2
+ //# sourceMappingURL=chunk-3UWT64FI.mjs.map
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkCMZTI7SG_js=require('./chunk-CMZTI7SG.js'),chunkUK656RCG_js=require('./chunk-UK656RCG.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function _(c,a){return a?chunkUK656RCG_js.a(c):{load:()=>null,save:()=>{},remove:()=>{}}}function Q({initialRequests:c=[],requestTypes:a,adapter:S,storageKey:h="ndpr_dsr_requests",useLocalStorage:P=true,onSubmit:D,onUpdate:f}){let m=S!=null?S:_(h,P),i=react.useRef(m);i.current=m;let[q,r]=react.useState(c),[x,d]=react.useState(true);react.useEffect(()=>{let e=false;try{let t=i.current.load();t instanceof Promise?t.then(s=>{e||(s&&r(s),d(!1));},()=>{e||d(!1);}):(t&&r(t),d(!1));}catch(t){e||d(false);}return ()=>{e=true;}},[]);let g=react.useCallback(e=>{Promise.resolve(i.current.save(e)).catch(t=>{console.warn("[ndpr-toolkit] Failed to save DSR requests:",t);});},[]),I=()=>"dsr_"+Date.now()+"_"+Math.random().toString(36).substr(2,9);return {requests:q,submitRequest:e=>{let t=a.find(p=>p.id===e.type),s=(t==null?void 0:t.estimatedCompletionTime)||30,u=Date.now(),n=u+s*24*60*60*1e3,A=e,{createdAt:y}=A,o=chunkMQFZHA2D_js.c(A,["createdAt"]),R=chunkMQFZHA2D_js.a({id:I(),status:"pending",createdAt:u,updatedAt:u,dueDate:n},o);return r(p=>{let b=[...p,R];return g(b),b}),D&&D(R),R},updateRequest:(e,t)=>{let s=null;return r(u=>{let n=u.findIndex(R=>R.id===e);if(n===-1)return u;let y=u[n];s=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},y),t),{updatedAt:Date.now()});let o=[...u];return o[n]=s,g(o),o}),s&&f&&f(s),s},getRequest:e=>q.find(t=>t.id===e)||null,getRequestsByStatus:e=>q.filter(t=>t.status===e),getRequestsByType:e=>q.filter(t=>t.type===e),getRequestType:e=>a.find(t=>t.id===e),formatRequest:e=>{let{formattedRequest:t}=chunkCMZTI7SG_js.a(e);return t},clearRequests:()=>{r([]),Promise.resolve(i.current.remove()).catch(e=>{console.warn("[ndpr-toolkit] Failed to remove DSR requests:",e);});},isLoading:x}}exports.a=Q;//# sourceMappingURL=chunk-3V23O4ZJ.js.map
2
+ //# sourceMappingURL=chunk-3V23O4ZJ.js.map
@@ -0,0 +1,3 @@
1
+ import {a as a$2}from'./chunk-FXTZDKDC.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:ve=true,confirmationMessage:he="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)||""),[h,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,v]=useState({}),Ae=()=>{O(""),Y(""),U(""),H(""),_(""),Z(""),G(""),K(""),W(""),Q([]),X(""),V([]),ee(""),te("ongoing"),ae(""),$([]),P(false),v({}),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`,v(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);}Object.keys(s).length>0?v(p=>a$1(a$1({},p),s)):($(p=>[...p,...l]),v(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"),h.trim()?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(h)||(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"),v(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(h),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),ve&&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:he}),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:h,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("div",{className:"md:col-span-2",children:[jsxs("label",{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-3XAUN5IM.mjs.map
3
+ //# sourceMappingURL=chunk-3XAUN5IM.mjs.map
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunk3F34NACG_js=require('./chunk-3F34NACG.js'),chunkY34DQYS7_js=require('./chunk-Y34DQYS7.js'),chunkUK656RCG_js=require('./chunk-UK656RCG.js'),react=require('react');function F(n){if(!n)return chunkUK656RCG_js.a("ndpr_consent");let{storageKey:o="ndpr_consent",storageType:i="localStorage"}=n;return i==="sessionStorage"?chunk3F34NACG_js.a(o):i==="cookie"?chunk3F34NACG_js.b(o,n.cookieOptions):chunkUK656RCG_js.a(o)}function k(n,o,i,r,a,g,l){if(n){i(n);let{valid:s,errors:c}=chunkY34DQYS7_js.a(n);r(s),a(c),g(!(s&&n.version===o));}else g(true);l(false);}function z({options:n,adapter:o,storageOptions:i,version:r="1.0",onChange:a}){let g=o!=null?o:F(i),l=react.useRef(g);l.current=g;let[s,c]=react.useState(null),[y,d]=react.useState(false),[E,C]=react.useState(false),[w,S]=react.useState([]),[I,v]=react.useState(true);react.useEffect(()=>{let e=false;try{let t=l.current.load();t instanceof Promise?t.then(m=>{e||k(m,r,c,C,S,d,v);},()=>{e||(d(!0),v(!1));}):k(t,r,c,C,S,d,v);}catch(t){e||(d(true),v(false));}return ()=>{e=true;}},[r]);let h=react.useCallback(e=>{let{valid:t,errors:m}=chunkY34DQYS7_js.a(e);C(t),S(m),a==null||a(e),Promise.resolve(l.current.save(e)).catch(P=>{console.warn("[ndpr-toolkit] Failed to save consent:",P);});},[a]),f=react.useCallback(e=>{let t={consents:e,timestamp:Date.now(),version:r,method:"explicit",hasInteracted:true};c(t),h(t),d(false);},[r,h]),L=react.useCallback(()=>{let e={};n.forEach(t=>{e[t.id]=true;}),f(e);},[n,f]),U=react.useCallback(()=>{let e={};n.forEach(t=>{e[t.id]=t.required||false;}),f(e);},[n,f]),V=react.useCallback(e=>!!(s!=null&&s.consents[e]),[s]),j=react.useCallback(()=>{c(null),d(true),C(false),S([]),Promise.resolve(l.current.remove()).catch(e=>{console.warn("[ndpr-toolkit] Failed to remove consent:",e);});},[]);return {settings:s,hasConsent:V,updateConsent:f,acceptAll:L,rejectAll:U,shouldShowBanner:y,isValid:E,validationErrors:w,resetConsent:j,isLoading:I}}exports.a=z;//# sourceMappingURL=chunk-5VMHKNJY.js.map
2
+ //# sourceMappingURL=chunk-5VMHKNJY.js.map
@@ -0,0 +1,2 @@
1
+ import {a as a$2}from'./chunk-FXTZDKDC.mjs';import {a}from'./chunk-AYKLAEOU.mjs';import {b,a as a$1}from'./chunk-WWT2ZSNU.mjs';import {useState}from'react';import {jsxs,jsx}from'react/jsx-runtime';var lr=({requestTypes:I,onSubmit:Q,onValidationError:q,title:X="Submit a Data Subject Request",description:V="Use this form to exercise your rights under the Nigeria Data Protection Act (NDPA), Part IV, Sections 29-36.",submitButtonText:s="Submit Request",className:A="",buttonClassName:D="",showConfirmation:N=true,confirmationMessage:rr="Your request has been submitted successfully. You will receive a confirmation email shortly.",requireIdentityVerification:_=true,identifierTypes:k=[{id:"email",label:"Email Address"},{id:"account",label:"Account Number"},{id:"customer_id",label:"Customer ID"}],collectAdditionalContact:er=true,labels:y={},classNames:r,unstyled:o=false,isSubmitting:f=false,defaultValues:g,onReset:S})=>{var G,Y,H,L,U,W;let[c,P]=useState((g==null?void 0:g.requestType)||""),[R,j]=useState(((G=g==null?void 0:g.dataSubject)==null?void 0:G.fullName)||""),[x,E]=useState(((Y=g==null?void 0:g.dataSubject)==null?void 0:Y.email)||""),[F,O]=useState(((H=g==null?void 0:g.dataSubject)==null?void 0:H.phone)||""),[B,z]=useState(((L=g==null?void 0:g.dataSubject)==null?void 0:L.identifierType)||((U=k[0])==null?void 0:U.id)||""),[T,M]=useState(((W=g==null?void 0:g.dataSubject)==null?void 0:W.identifierValue)||""),[b$1,w]=useState((g==null?void 0:g.additionalInfo)||{}),[ir,$]=useState(false),[d,Z]=useState({}),tr=()=>{var e;P(""),j(""),E(""),O(""),z(((e=k[0])==null?void 0:e.id)||""),M(""),w({}),$(false),Z({}),S==null||S();},u=I.find(e=>e.id===c),or=e=>{P(e.target.value),w({});},v=(e,a)=>{w(l=>b(a$1({},l),{[e]:a}));},nr=()=>{let e={};return R.trim()||(e.fullName="Full name is required"),x.trim()?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(x)||(e.email="Email is invalid"):e.email="Email is required",c||(e.requestType="Please select a request type"),_&&!T.trim()&&(e.identifierValue="Identifier value is required"),u!=null&&u.requiresAdditionalInfo&&u.additionalFields&&u.additionalFields.forEach(a=>{a.required&&!b$1[a.id]&&(e[`additional_${a.id}`]=`${a.label} is required`);}),Z(e),e},dr=e=>{e.preventDefault();let a=nr();if(Object.keys(a).length>0){q==null||q(a);return}let l=Object.keys(b$1).length>0?Object.fromEntries(Object.entries(b$1).map(([ar,C])=>[ar,typeof C=="string"?a$2(C):C])):void 0,h={requestType:c,dataSubject:{fullName:a$2(R),email:a$2(x),phone:F?a$2(F):void 0,identifierType:B,identifierValue:a$2(T)},additionalInfo:l,submittedAt:Date.now()};Q(h),N&&$(true);};return ir?jsxs("div",{className:a(`p-4 bg-green-50 dark:bg-green-900/20 rounded-md ${A}`,r==null?void 0:r.successMessage,o),children:[jsx("h2",{className:a("text-lg font-bold text-green-800 dark:text-green-200 mb-2",r==null?void 0:r.title,o),children:"Request Submitted"}),jsx("p",{className:a("text-green-700 dark:text-green-300",r==null?void 0:r.description,o),children:rr}),jsx("button",{onClick:()=>$(false),className:a(`mt-4 px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${D}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:"Submit Another Request"})]}):jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${A}`,r==null?void 0:r.root,o),children:[jsx("h2",{className:a("text-xl font-bold mb-2",r==null?void 0:r.title,o),children:X}),jsx("p",{className:a("mb-6 text-gray-600 dark:text-gray-300",r==null?void 0:r.description,o),children:V}),jsx("form",{onSubmit:dr,className:a("",r==null?void 0:r.form,o),children:jsxs("div",{className:a("space-y-4",r==null?void 0:r.fieldGroup,o),children:[jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Personal Information"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"fullName",className:a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:[y.name||"Full Name"," ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",id:"fullName",value:R,onChange:e=>j(e.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))]",r==null?void 0:r.input,o),required:true,"aria-invalid":!!d.fullName,"aria-describedby":d.fullName?"fullName-error":void 0}),d.fullName&&jsx("p",{id:"fullName-error",role:"alert",className:"mt-1 text-sm text-red-500",children:d.fullName})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"email",className:a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:[y.email||"Email Address"," ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"email",id:"email",value:x,onChange:e=>E(e.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))]",r==null?void 0:r.input,o),required:true,"aria-invalid":!!d.email,"aria-describedby":d.email?"email-error":void 0}),d.email&&jsx("p",{id:"email-error",role:"alert",className:"mt-1 text-sm text-red-500",children:d.email})]}),er&&jsxs("div",{children:[jsx("label",{htmlFor:"phone",className:a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:"Phone Number (Optional)"}),jsx("input",{type:"tel",id:"phone",value:F,onChange:e=>O(e.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))]",r==null?void 0:r.input,o)})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Request Details"}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"requestType",className:a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:[y.requestType||"Request Type"," ",jsx("span",{className:"text-red-500",children:"*"})]}),jsxs("select",{id:"requestType",value:c,onChange:or,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))]",r==null?void 0:r.select,o),required:true,"aria-invalid":!!d.requestType,"aria-describedby":d.requestType?"requestType-error":void 0,children:[jsx("option",{value:"",children:"Select a request type"}),I.map(e=>jsx("option",{value:e.id,children:e.name},e.id))]}),d.requestType&&jsx("p",{id:"requestType-error",role:"alert",className:"mt-1 text-sm text-red-500",children:d.requestType})]}),u&&jsxs("div",{className:"mb-4 p-3 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 mb-2",children:u.description}),jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Estimated completion time: ",u.estimatedCompletionTime," ",u.estimatedCompletionTime===1?"day":"days"]})]}),jsxs("div",{className:"mb-4",children:[jsx("label",{htmlFor:"requestDescription",className:a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:y.description||"Additional Information"}),jsx("textarea",{id:"requestDescription",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))]",r==null?void 0:r.textarea,o),rows:4,placeholder:"Please provide any additional details that might help us process your request"})]})]}),_&&jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Identity Verification"}),jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 mb-3",children:"To protect your privacy, we need to verify your identity before processing your request."}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"identifierType",className:a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:["Identifier Type ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("select",{id:"identifierType",value:B,onChange:e=>z(e.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))]",r==null?void 0:r.select,o),required:true,children:k.map(e=>jsx("option",{value:e.id,children:e.label},e.id))})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"identifierValue",className:a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:["Identifier Value ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",id:"identifierValue",value:T,onChange:e=>M(e.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))]",r==null?void 0:r.input,o),required:true,"aria-invalid":!!d.identifierValue,"aria-describedby":d.identifierValue?"identifierValue-error":void 0}),d.identifierValue&&jsx("p",{id:"identifierValue-error",role:"alert",className:"mt-1 text-sm text-red-500",children:d.identifierValue})]})]})]}),(u==null?void 0:u.requiresAdditionalInfo)&&u.additionalFields&&u.additionalFields.length>0&&jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Additional Information"}),jsx("div",{className:"space-y-4",children:u.additionalFields.map(e=>jsxs("div",{children:[jsxs("label",{htmlFor:e.id,className:a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:[e.label," ",e.required&&jsx("span",{className:"text-red-500",children:"*"})]}),e.type==="text"&&jsx("input",{type:"text",id:e.id,value:b$1[e.id]||"",onChange:a=>v(e.id,a.target.value),placeholder:e.placeholder,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))]",r==null?void 0:r.input,o),required:e.required,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0}),e.type==="textarea"&&jsx("textarea",{id:e.id,value:b$1[e.id]||"",onChange:a=>v(e.id,a.target.value),placeholder:e.placeholder,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))]",r==null?void 0:r.textarea,o),rows:4,required:e.required,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0}),e.type==="select"&&e.options&&jsxs("select",{id:e.id,value:b$1[e.id]||"",onChange:a=>v(e.id,a.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))]",r==null?void 0:r.select,o),required:e.required,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0,children:[jsx("option",{value:"",children:e.placeholder||"Select an option"}),e.options.map(a=>jsx("option",{value:a,children:a},a))]}),e.type==="checkbox"&&jsxs("div",{className:"flex items-start",children:[jsx("div",{className:"flex items-center h-5",children:jsx("input",{type:"checkbox",id:e.id,checked:!!b$1[e.id],onChange:a=>v(e.id,a.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]",required:e.required,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0})}),jsx("div",{className:"ml-3 text-sm",children:jsx("label",{htmlFor:e.id,className:"text-gray-700 dark:text-gray-300",children:e.placeholder||e.label})})]}),e.type==="file"&&jsx("input",{type:"file",id:e.id,onChange:a=>{var h;let l=(h=a.target.files)==null?void 0:h[0];l&&v(e.id,l);},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))]",r==null?void 0:r.input,o),required:e.required,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0}),d[`additional_${e.id}`]&&jsx("p",{id:`additional-${e.id}-error`,role:"alert",className:"mt-1 text-sm text-red-500",children:d[`additional_${e.id}`]})]},e.id))})]}),jsxs("div",{className:"mt-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("h3",{className:"text-sm font-semibold mb-2",children:"Privacy Notice"}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-300",children:"The information you provide in this form will be used solely for the purpose of processing your data subject request. We will retain this information for as long as necessary to fulfill your request and to comply with our legal obligations. For more information, please refer to our Privacy Policy."})]}),jsxs("div",{className:"mt-6 flex gap-3 relative",children:[f&&(r==null?void 0:r.loadingOverlay)&&jsx("div",{className:r.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 ${D} ${f?"opacity-50 cursor-not-allowed":""}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:f?"Submitting...":y.submit||s}),jsx("button",{type:"button",onClick:tr,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,o),children:"Reset"})]})]})})]})};export{lr as a};//# sourceMappingURL=chunk-6D3ZUGBB.mjs.map
2
+ //# sourceMappingURL=chunk-6D3ZUGBB.mjs.map
@@ -0,0 +1,2 @@
1
+ import {a,d}from'./chunk-CAB7O3GR.mjs';import {a as a$2}from'./chunk-SBNAMPAP.mjs';import {b,a as a$1}from'./chunk-WWT2ZSNU.mjs';import {useRef,useState,useEffect}from'react';function _(f,s){return s?a$2(f):{load:()=>null,save:()=>{},remove:()=>{}}}function z({templates:f,initialPolicy:s,adapter:y,storageKey:T="ndpr_privacy_policy",useLocalStorage:I=true,onGenerate:p}){let P=y!=null?y:_(T,I),o=useRef(P);o.current=P;let[a$2,d]=useState(s||null),[u,g]=useState(null),[m,h]=useState({name:"",website:"",privacyEmail:"",address:"",privacyPhone:"",dpoName:"",dpoEmail:"",industry:""}),[w,v]=useState(true);useEffect(()=>{if(s){v(false);return}let e=false;try{let n=o.current.load(),i=t=>{if(t){if(d(t),t.templateId){let l=f.find(U=>U.id===t.templateId);l&&g(l);}t.organizationInfo&&h(t.organizationInfo);}v(!1);};n instanceof Promise?n.then(t=>{e||i(t);},()=>{e||v(!1);}):i(n);}catch(n){e||v(false);}return ()=>{e=true;}},[s,f]);let x=e=>{Promise.resolve(o.current.save(e)).catch(n=>{console.warn("[ndpr-toolkit] Failed to save policy:",n);});},E=e=>{let n=f.find(l=>l.id===e);if(!n)return false;g(n);n.sections.map(l=>b(a$1({},l),{customContent:void 0}));return Object.keys(n.variables).forEach(l=>{n.variables[l].defaultValue||"";}),true},q=e=>{h(n=>a$1(a$1({},n),e));},N=(e,n)=>{u&&(a$2?d(i=>i&&b(a$1({},i),{sections:i.sections.map(t=>t.id===e?b(a$1({},t),{included:n}):t)})):g(i=>i&&b(a$1({},i),{sections:i.sections.map(t=>t.id===e?b(a$1({},t),{included:n}):t)})));},D=(e,n)=>{u&&(a$2?d(i=>i&&b(a$1({},i),{sections:i.sections.map(t=>t.id===e?b(a$1({},t),{customContent:n}):t)})):g(i=>i&&b(a$1({},i),{sections:i.sections.map(t=>t.id===e?b(a$1({},t),{customContent:n}):t)})));},C=(e,n)=>{a$2&&d(i=>i&&b(a$1({},i),{variableValues:b(a$1({},i.variableValues),{[e]:n})}));},R=()=>"policy_"+Date.now()+"_"+Math.random().toString(36).substr(2,9);return {policy:a$2,selectedTemplate:u,organizationInfo:m,selectTemplate:E,updateOrganizationInfo:q,toggleSection:N,updateSectionContent:D,updateVariableValue:C,generatePolicy:()=>{if(!u)throw new Error("No template selected");let e=Date.now(),n={id:(a$2==null?void 0:a$2.id)||R(),title:`Privacy Policy for ${m.name}`,templateId:u.id,organizationInfo:m,sections:u.sections.map(i=>{var t;return b(a$1({},i),{customContent:(t=a$2==null?void 0:a$2.sections.find(l=>l.id===i.id))==null?void 0:t.customContent})}),variableValues:(a$2==null?void 0:a$2.variableValues)||{},effectiveDate:e,lastUpdated:e,version:"1.0"};return d(n),x(n),p&&p(n),n},getPolicyText:()=>{if(!a$2)return {fullText:"",sectionTexts:{},missingVariables:[]};let e=a(a$2.sections,a$2.organizationInfo);return typeof e=="string"?{fullText:e,sectionTexts:{full:e},missingVariables:[]}:e},resetPolicy:()=>{d(null),g(null),h({name:"",website:"",privacyEmail:"",address:"",privacyPhone:"",dpoName:"",dpoEmail:"",industry:""}),Promise.resolve(o.current.remove()).catch(e=>{console.warn("[ndpr-toolkit] Failed to remove policy:",e);});},isValid:()=>{let e=[];if(u||e.push("No template selected"),m.name||e.push("Organization name is required"),m.website||e.push("Organization website is required"),m.privacyEmail||e.push("Privacy contact email is required"),u){let n=u.sections.filter(t=>t.required),i=(a$2==null?void 0:a$2.sections.filter(t=>t.included))||[];n.forEach(t=>{i.some(l=>l.id===t.id)||e.push(`Required section "${t.title}" must be included`);});}return u&&a$2&&Object.entries(u.variables).forEach(([n,i])=>{i.required&&!a$2.variableValues[n]&&e.push(`Required variable "${i.name}" must have a value`);}),{valid:e.length===0,errors:e}},isLoading:w}}function W(f={}){let{orgInfo:s,storageKey:y,useLocalStorage:T}=f,{sections:I,variables:p}=d();if(s)for(let o of p)s.name&&o.name==="orgName"&&(o.value=s.name),s.email&&o.name==="privacyEmail"&&(o.value=s.email),s.dpoName&&o.name==="dpoName"&&(o.value=s.dpoName);let P={id:"default-business",name:"Default Business Policy",description:"NDPA-compliant privacy policy template for businesses.",organizationType:"business",sections:I,variables:Object.fromEntries(p.map(o=>[o.name,{name:o.name,description:o.description,required:o.required,defaultValue:o.value||void 0}])),version:"1.0",lastUpdated:Date.now(),ndpaCompliant:true};return z({templates:[P],storageKey:y,useLocalStorage:T})}export{z as a,W as b};//# sourceMappingURL=chunk-6E54NSAO.mjs.map
2
+ //# sourceMappingURL=chunk-6E54NSAO.mjs.map
@@ -0,0 +1,2 @@
1
+ import {a as a$1}from'./chunk-AYKLAEOU.mjs';import {a,b}from'./chunk-WWT2ZSNU.mjs';import {useState,useRef,useCallback,useEffect}from'react';import {createPortal}from'react-dom';import {jsx,jsxs}from'react/jsx-runtime';var lt=({options:d,onSave:J,title:M="We Value Your Privacy",description:W="We use cookies and similar technologies to provide our services and enhance your experience. Your consent is collected in accordance with NDPA Sections 25-26.",acceptAllButtonText:Y="Accept All",rejectAllButtonText:K="Reject All",customizeButtonText:Q="Customize",saveButtonText:U="Save Preferences",position:A="bottom",zIndex:T=9999,version:f="1.0",show:p,manageStorage:R=true,storageKey:E="ndpr_consent",className:X="",buttonClassName:y="",primaryButtonClassName:q="",secondaryButtonClassName:Z="",classNames:t,unstyled:o,onAnalytics:h})=>{let[g,u]=useState(false),[v,a$2]=useState(false),[C,B]=useState({}),z=useRef(null),$=useRef(null),j=useRef(false),b$1=useCallback((e,n)=>{h==null||h(a({action:e,timestamp:Date.now(),version:f},n!==void 0?{categories:n}:{}));},[h,f]);useEffect(()=>{let e={};if(d.forEach(n=>{e[n.id]=n.defaultValue||false;}),B(e),p===void 0)if(!R)u(true);else {let n=localStorage.getItem(E);if(n)try{JSON.parse(n).version!==f?u(!0):u(!1);}catch(D){u(true);}else u(true);}else u(p);},[d,E,f,R]),useEffect(()=>{p!==void 0&&u(p);},[p]);let s=()=>{let e={};d.forEach(n=>{e[n.id]=true;}),b$1("accepted_all",e),P(e);},N=()=>{let e={};d.forEach(n=>{e[n.id]=n.required||false;}),b$1("rejected_all",e),P(e);},tt=(e,n)=>{B(D=>b(a({},D),{[e]:n}));},et=()=>{let e={};d.forEach(n=>{e[n.id]=true;}),B(e);},nt=()=>{let e={};d.forEach(n=>{e[n.id]=n.required||false;}),B(e);},H=d.length>0&&d.every(e=>C[e.id]),rt=()=>{b$1("customized",C),P(C);},P=e=>{let n={consents:e,timestamp:Date.now(),version:f,method:v?"customize":"banner",hasInteracted:true};R&&localStorage.setItem(E,JSON.stringify(n)),J(n),u(false),a$2(false);},_=useCallback(()=>{b$1("dismissed"),u(false),a$2(false);},[b$1]);if(useEffect(()=>{if(!g)return;let e=n=>{n.key==="Escape"&&_();};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[g,_]),useEffect(()=>{g&&!j.current&&(j.current=true,b$1("shown")),g||(j.current=false);},[g,b$1]),useEffect(()=>{g&&z.current&&z.current.focus();},[g]),useEffect(()=>{if(v&&$.current){let e=$.current;e.style.maxHeight="0px",e.style.opacity="0",e.offsetHeight,e.style.maxHeight=`${e.scrollHeight}px`,e.style.opacity="1";}},[v]),!g)return null;let ot=(t==null?void 0:t.primaryButton)||(t==null?void 0:t.acceptButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${y} ${q}`,m=(t==null?void 0:t.secondaryButton)||(t==null?void 0:t.rejectButton)||`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 ${y} ${Z}`,it=(t==null?void 0:t.customizeButton)||`px-4 py-2 bg-transparent text-gray-800 dark:text-white hover:underline ${y}`,dt=(t==null?void 0:t.saveButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${y} ${q}`,k=A==="inline",w=A==="center",x;k||w?x="":A==="top"?x="fixed inset-x-0 top-0":x="fixed inset-x-0 bottom-0";let S=jsx("div",{ref:z,tabIndex:-1,"data-ndpr-component":"consent-banner",className:a$1(`${k?"":x} bg-white dark:bg-gray-800 shadow-lg p-3 sm:p-4 border border-gray-200 dark:border-gray-700 ${w?"max-w-lg w-full":""} ${X}`,t==null?void 0:t.root,o),style:!k&&!w?{zIndex:T}:void 0,role:"dialog","aria-labelledby":"consent-banner-title","aria-describedby":"consent-banner-description",children:jsxs("div",{className:a$1("max-w-6xl mx-auto",t==null?void 0:t.container,o),children:[jsx("h2",{id:"consent-banner-title",className:a$1("text-lg font-bold mb-2",t==null?void 0:t.title,o),children:M}),jsx("p",{id:"consent-banner-description",className:a$1("text-sm sm:text-base mb-4",t==null?void 0:t.description,o),children:W}),v&&jsxs("div",{ref:$,className:a$1("mb-4 p-3 sm:p-4 rounded-md border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700/50",t==null?void 0:t.customizePanel,o),style:{overflow:"hidden",transition:"max-height 0.3s ease-out, opacity 0.3s ease-out"},children:[jsx("div",{className:"mb-3 flex items-center justify-end",children:jsx("button",{type:"button",onClick:H?nt:et,className:a$1("text-sm font-medium text-[rgb(var(--ndpr-primary))] hover:underline",t==null?void 0:t.selectAllButton,o),children:H?"Deselect All":"Select All"})}),jsx("div",{className:a$1("space-y-3",t==null?void 0:t.optionsList,o),children:d.map(e=>jsxs("div",{className:a$1("flex items-start",t==null?void 0:t.optionItem,o),children:[jsx("div",{className:"flex items-center h-5",children:jsx("input",{id:`consent-${e.id}`,type:"checkbox",checked:C[e.id]||false,onChange:n=>tt(e.id,n.target.checked),disabled:e.required,className:a$1("h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]",t==null?void 0:t.optionCheckbox,o)})}),jsxs("div",{className:"ml-3 text-sm",children:[jsxs("label",{htmlFor:`consent-${e.id}`,className:a$1("font-medium",t==null?void 0:t.optionLabel,o),children:[e.label," ",e.required&&jsx("span",{className:"text-red-500",children:"*"})]}),jsx("p",{className:a$1("text-gray-600 dark:text-gray-400",t==null?void 0:t.optionDescription,o),children:e.description})]})]},e.id))}),jsxs("div",{className:a$1("mt-4 flex flex-col sm:flex-row flex-wrap gap-2",t==null?void 0:t.buttonGroup,o),children:[jsx("button",{onClick:rt,className:a$1(dt,t==null?void 0:t.saveButton,o),children:U}),jsx("button",{onClick:()=>a$2(false),className:a$1(m,t==null?void 0:t.rejectButton,o),children:"Back"})]})]}),!v&&jsxs("div",{className:a$1("flex flex-col sm:flex-row flex-wrap gap-2",t==null?void 0:t.buttonGroup,o),children:[jsx("button",{onClick:s,className:a$1(ot,t==null?void 0:t.acceptButton,o),children:Y}),jsx("button",{onClick:N,className:a$1(m,t==null?void 0:t.rejectButton,o),children:K}),jsx("button",{onClick:()=>a$2(true),className:a$1(it,t==null?void 0:t.customizeButton,o),children:Q})]}),jsx("div",{className:a$1("mt-2 text-xs text-gray-600 dark:text-gray-400",void 0,o),children:'By clicking "Accept All", you agree to the use of ALL cookies. Visit our Cookie Policy to learn more.'})]})});if(k)return S;if(w){let e=jsxs("div",{className:"fixed inset-0 flex items-center justify-center",style:{zIndex:T},children:[jsx("div",{className:"absolute inset-0 bg-black/50","aria-hidden":"true"}),jsx("div",{className:"relative",children:S})]});return typeof document!="undefined"?createPortal(e,document.body):e}return typeof document!="undefined"?createPortal(S,document.body):S};export{lt as a};//# sourceMappingURL=chunk-7F5F5YWI.mjs.map
2
+ //# sourceMappingURL=chunk-7F5F5YWI.mjs.map