@tantainnovative/ndpr-toolkit 3.0.0 → 3.2.1

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 (149) hide show
  1. package/dist/{PolicyExporter-BIqSVjfC.d.mts → PolicyExporter-Bgi6nz82.d.mts} +93 -1
  2. package/dist/{PolicyExporter-BNWaPBGU.d.ts → PolicyExporter-BnvuFncj.d.ts} +93 -1
  3. package/dist/adapters.js +1 -1
  4. package/dist/adapters.mjs +1 -1
  5. package/dist/breach.js +1 -1
  6. package/dist/breach.mjs +1 -1
  7. package/dist/chunk-256APOQM.js +2 -0
  8. package/dist/chunk-2FWCVWKN.js +2 -0
  9. package/dist/chunk-3DJGO6WG.js +2 -0
  10. package/dist/chunk-44W4H2EY.js +2 -0
  11. package/dist/chunk-4XCL62MJ.mjs +2 -0
  12. package/dist/chunk-555WWZ3W.js +2 -0
  13. package/dist/chunk-6BXUVS6E.js +81 -0
  14. package/dist/{chunk-KHRBU5K7.js → chunk-6RQGQZT2.js} +2 -2
  15. package/dist/chunk-6TA2MVTU.mjs +2 -0
  16. package/dist/chunk-6WIP33TW.mjs +2 -0
  17. package/dist/{chunk-2ORDHJRD.js → chunk-7AVN424U.js} +2 -2
  18. package/dist/{chunk-5VMHKNJY.js → chunk-7SMLHZ4B.js} +2 -2
  19. package/dist/chunk-A4PK7JB2.js +2 -0
  20. package/dist/chunk-ABDB7LEV.mjs +2 -0
  21. package/dist/chunk-BKRETVJ6.js +2 -0
  22. package/dist/chunk-CWUPGY3M.mjs +3 -0
  23. package/dist/chunk-DJGS7SSN.mjs +2 -0
  24. package/dist/{chunk-SVCRYM4I.mjs → chunk-E4NCJ7RD.mjs} +2 -2
  25. package/dist/chunk-E63VPR7U.js +2 -0
  26. package/dist/chunk-EH2I4L7M.mjs +316 -0
  27. package/dist/chunk-ELKB2AFZ.js +2 -0
  28. package/dist/chunk-FDDI426Y.mjs +2 -0
  29. package/dist/chunk-FOXZRRMW.mjs +2 -0
  30. package/dist/chunk-GCQRHMTQ.mjs +144 -0
  31. package/dist/chunk-GKKAK6ES.mjs +3 -0
  32. package/dist/chunk-GOD4LA2J.mjs +2 -0
  33. package/dist/{chunk-SWF3YVE5.js → chunk-GOU6FU6Y.js} +3 -3
  34. package/dist/chunk-HO5M7M4M.js +2 -0
  35. package/dist/chunk-I23WPZNQ.mjs +94 -0
  36. package/dist/chunk-I4M2AA3N.js +2 -0
  37. package/dist/chunk-I54CDQGN.js +3 -0
  38. package/dist/{chunk-6D3ZUGBB.mjs → chunk-IR7VCBWV.mjs} +2 -2
  39. package/dist/{chunk-4VVARDN2.mjs → chunk-K45S6YQV.mjs} +2 -2
  40. package/dist/chunk-KBAFOVE3.js +2 -0
  41. package/dist/{chunk-P7BSBCB3.js → chunk-KBP26GLC.js} +2 -2
  42. package/dist/chunk-KVOGOLIR.js +316 -0
  43. package/dist/chunk-LU4PFST7.js +144 -0
  44. package/dist/chunk-MDWG2KDA.mjs +2 -0
  45. package/dist/chunk-NN233SGA.mjs +3 -0
  46. package/dist/chunk-NRQELKAE.js +2 -0
  47. package/dist/chunk-NUDVUAD4.mjs +81 -0
  48. package/dist/chunk-NXQMU36Z.mjs +2 -0
  49. package/dist/chunk-P42Z5CFE.js +2 -0
  50. package/dist/chunk-PATONNTZ.mjs +2 -0
  51. package/dist/{chunk-WLSW4Z4W.mjs → chunk-PM7O5IGE.mjs} +2 -2
  52. package/dist/chunk-Q7VHB64E.mjs +2 -0
  53. package/dist/{chunk-PEH5GIMN.js → chunk-QH6YUVJS.js} +2 -2
  54. package/dist/chunk-QY7PD5XB.js +94 -0
  55. package/dist/chunk-R3OYAJI6.mjs +2 -0
  56. package/dist/chunk-S4GRSNB4.js +2 -0
  57. package/dist/chunk-SAA7UVI2.js +3 -0
  58. package/dist/{chunk-PYEX7DFR.mjs → chunk-SHMJNRHO.mjs} +3 -3
  59. package/dist/chunk-TVW6KBVV.mjs +2 -0
  60. package/dist/chunk-U62QYKVG.mjs +2 -0
  61. package/dist/chunk-UDNRAQLE.js +3 -0
  62. package/dist/{chunk-5RSOLEEP.js → chunk-UXMGBIX6.js} +4 -4
  63. package/dist/{chunk-UZ5EZOA7.js → chunk-VK27WVV3.js} +2 -2
  64. package/dist/{chunk-G26I6MP5.mjs → chunk-VWPGIES4.mjs} +2 -2
  65. package/dist/{chunk-NPLXE43Q.mjs → chunk-XQ4M5FHC.mjs} +2 -2
  66. package/dist/{chunk-CAB7O3GR.mjs → chunk-ZEOQYWOE.mjs} +4 -4
  67. package/dist/consent.js +1 -1
  68. package/dist/consent.mjs +1 -1
  69. package/dist/core.d.mts +9 -46
  70. package/dist/core.d.ts +9 -46
  71. package/dist/core.js +1 -1
  72. package/dist/core.mjs +1 -1
  73. package/dist/cross-border.js +1 -1
  74. package/dist/cross-border.mjs +1 -1
  75. package/dist/dpia.js +1 -1
  76. package/dist/dpia.mjs +1 -1
  77. package/dist/dsr.js +1 -1
  78. package/dist/dsr.mjs +1 -1
  79. package/dist/hooks.d.mts +2 -0
  80. package/dist/hooks.d.ts +2 -0
  81. package/dist/hooks.js +1 -1
  82. package/dist/hooks.mjs +1 -1
  83. package/dist/index.d.mts +2 -3
  84. package/dist/index.d.ts +2 -3
  85. package/dist/index.js +1 -1
  86. package/dist/index.mjs +1 -1
  87. package/dist/lawful-basis.js +1 -1
  88. package/dist/lawful-basis.mjs +1 -1
  89. package/dist/policy-engine-C-tShzZH.d.mts +154 -0
  90. package/dist/policy-engine-DSQpT55_.d.ts +154 -0
  91. package/dist/policy-sections-CfNVBLCh.d.mts +54 -0
  92. package/dist/policy-sections-DqH0iZRf.d.ts +54 -0
  93. package/dist/policy.d.mts +86 -5
  94. package/dist/policy.d.ts +86 -5
  95. package/dist/policy.js +1 -1
  96. package/dist/policy.mjs +1 -1
  97. package/dist/presets.d.mts +5 -15
  98. package/dist/presets.d.ts +5 -15
  99. package/dist/presets.js +1 -1
  100. package/dist/presets.mjs +1 -1
  101. package/dist/ropa.js +1 -1
  102. package/dist/ropa.mjs +1 -1
  103. package/dist/sanitize-9mOO_cJW.d.mts +147 -0
  104. package/dist/sanitize-9mOO_cJW.d.ts +147 -0
  105. package/dist/useAdaptivePolicyWizard-B9Op2gYM.d.ts +52 -0
  106. package/dist/useAdaptivePolicyWizard-N4eUM4Tj.d.mts +52 -0
  107. package/package.json +9 -3
  108. package/dist/PolicyGenerator-BvcWPbxp.d.mts +0 -96
  109. package/dist/PolicyGenerator-BzRwtlgn.d.ts +0 -96
  110. package/dist/chunk-27NYSWUG.mjs +0 -2
  111. package/dist/chunk-2SYNHRP6.mjs +0 -2
  112. package/dist/chunk-2W7ARAW2.js +0 -2
  113. package/dist/chunk-3F34NACG.js +0 -2
  114. package/dist/chunk-3RGJV3VF.js +0 -7
  115. package/dist/chunk-3V23O4ZJ.js +0 -2
  116. package/dist/chunk-3XAUN5IM.mjs +0 -3
  117. package/dist/chunk-6E54NSAO.mjs +0 -2
  118. package/dist/chunk-7F5F5YWI.mjs +0 -2
  119. package/dist/chunk-7FIUX3ZM.js +0 -89
  120. package/dist/chunk-CMZTI7SG.js +0 -2
  121. package/dist/chunk-EPF7J2FK.js +0 -3
  122. package/dist/chunk-FR7ZYZXB.js +0 -2
  123. package/dist/chunk-FXTZDKDC.mjs +0 -3
  124. package/dist/chunk-GIV2OHE6.mjs +0 -2
  125. package/dist/chunk-GPJVTGHR.mjs +0 -2
  126. package/dist/chunk-GVANK6PL.js +0 -3
  127. package/dist/chunk-HNZK7LY3.mjs +0 -2
  128. package/dist/chunk-IKEPXHCZ.js +0 -2
  129. package/dist/chunk-ILCNDOBU.js +0 -2
  130. package/dist/chunk-IQQW52EF.js +0 -2
  131. package/dist/chunk-ISSGO2YT.mjs +0 -72
  132. package/dist/chunk-J6IKAGUP.mjs +0 -89
  133. package/dist/chunk-KNE4NXCY.mjs +0 -7
  134. package/dist/chunk-LFNA6WYQ.mjs +0 -2
  135. package/dist/chunk-PGSA2O5P.mjs +0 -2
  136. package/dist/chunk-RGYK4VAY.mjs +0 -2
  137. package/dist/chunk-RSUDIFZV.mjs +0 -2
  138. package/dist/chunk-RYZEIDNR.js +0 -2
  139. package/dist/chunk-SBNAMPAP.mjs +0 -2
  140. package/dist/chunk-SSGJREE3.js +0 -2
  141. package/dist/chunk-U6VWHC46.js +0 -72
  142. package/dist/chunk-UK656RCG.js +0 -2
  143. package/dist/chunk-UOSEH6DC.js +0 -2
  144. package/dist/chunk-VDZKGCAF.js +0 -2
  145. package/dist/chunk-WSHSHIIM.mjs +0 -2
  146. package/dist/chunk-XSK4BSZJ.mjs +0 -2
  147. package/dist/chunk-Y34DQYS7.js +0 -2
  148. package/dist/chunk-YJCGEOLO.mjs +0 -2
  149. package/dist/chunk-ZCZ5RRZO.js +0 -2
@@ -0,0 +1,147 @@
1
+ import React__default from 'react';
2
+
3
+ /**
4
+ * Locale strings for all toolkit components.
5
+ * Pass partial overrides — missing keys fall back to English defaults.
6
+ */
7
+ interface NDPRLocale {
8
+ consent?: {
9
+ title?: string;
10
+ description?: string;
11
+ acceptAll?: string;
12
+ rejectAll?: string;
13
+ customize?: string;
14
+ savePreferences?: string;
15
+ selectAll?: string;
16
+ deselectAll?: string;
17
+ required?: string;
18
+ cookieNotice?: string;
19
+ };
20
+ dsr?: {
21
+ title?: string;
22
+ description?: string;
23
+ submitRequest?: string;
24
+ reset?: string;
25
+ fullName?: string;
26
+ email?: string;
27
+ phone?: string;
28
+ requestType?: string;
29
+ additionalInfo?: string;
30
+ identityVerification?: string;
31
+ identifierType?: string;
32
+ identifierValue?: string;
33
+ privacyNotice?: string;
34
+ successMessage?: string;
35
+ };
36
+ breach?: {
37
+ title?: string;
38
+ description?: string;
39
+ submitReport?: string;
40
+ breachTitle?: string;
41
+ category?: string;
42
+ discoveredAt?: string;
43
+ detailedDescription?: string;
44
+ };
45
+ dpia?: {
46
+ title?: string;
47
+ next?: string;
48
+ previous?: string;
49
+ complete?: string;
50
+ progress?: string;
51
+ };
52
+ policy?: {
53
+ title?: string;
54
+ generate?: string;
55
+ preview?: string;
56
+ export?: string;
57
+ sections?: string;
58
+ variables?: string;
59
+ };
60
+ compliance?: {
61
+ score?: string;
62
+ excellent?: string;
63
+ good?: string;
64
+ needsWork?: string;
65
+ critical?: string;
66
+ recommendations?: string;
67
+ passed?: string;
68
+ gaps?: string;
69
+ };
70
+ common?: {
71
+ loading?: string;
72
+ error?: string;
73
+ save?: string;
74
+ cancel?: string;
75
+ delete?: string;
76
+ edit?: string;
77
+ add?: string;
78
+ back?: string;
79
+ next?: string;
80
+ search?: string;
81
+ noResults?: string;
82
+ };
83
+ }
84
+
85
+ declare const defaultLocale: Required<{
86
+ [K in keyof NDPRLocale]: Required<NonNullable<NDPRLocale[K]>>;
87
+ }>;
88
+
89
+ /**
90
+ * Configuration for the NDPR toolkit provider.
91
+ */
92
+ interface NDPRConfig {
93
+ /** The official name of the organisation */
94
+ organizationName?: string;
95
+ /** Email address of the Data Protection Officer */
96
+ dpoEmail?: string;
97
+ /** NDPC registration number, if registered */
98
+ ndpcRegistrationNumber?: string;
99
+ /** Prefix for localStorage/sessionStorage keys used by toolkit components */
100
+ storageKeyPrefix?: string;
101
+ /** When true, removes all default styles from toolkit components */
102
+ unstyled?: boolean;
103
+ /** Theme overrides applied as CSS custom properties */
104
+ theme?: {
105
+ /** Primary brand colour (e.g. "#0070f3") */
106
+ primary?: string;
107
+ /** Hover state for primary colour */
108
+ primaryHover?: string;
109
+ /** Foreground colour used on primary backgrounds */
110
+ primaryForeground?: string;
111
+ };
112
+ /**
113
+ * Locale strings for all toolkit components.
114
+ * Pass partial overrides — missing keys fall back to English defaults.
115
+ */
116
+ locale?: NDPRLocale;
117
+ }
118
+ /**
119
+ * Provides NDPR configuration to all descendant toolkit components.
120
+ *
121
+ * When a `theme` is supplied, the corresponding CSS custom properties
122
+ * (`--ndpr-primary`, `--ndpr-primary-hover`, `--ndpr-primary-foreground`)
123
+ * are set on the wrapping element so components can reference them.
124
+ */
125
+ declare const NDPRProvider: React__default.FC<NDPRConfig & {
126
+ children: React__default.ReactNode;
127
+ }>;
128
+ /**
129
+ * Returns the current NDPR configuration from the nearest `NDPRProvider`.
130
+ * If no provider is found, returns an empty config object.
131
+ */
132
+ declare function useNDPRConfig(): NDPRConfig;
133
+ /**
134
+ * Returns the resolved locale for the nearest `NDPRProvider`.
135
+ * Merges any partial `locale` prop with the default English strings,
136
+ * so all keys are always present and non-nullable.
137
+ */
138
+ declare function useNDPRLocale(): typeof defaultLocale;
139
+
140
+ /**
141
+ * Sanitizes user input to prevent XSS attacks.
142
+ * Escapes HTML special characters so that data rendered in dashboards
143
+ * or other consumer UIs cannot execute embedded scripts.
144
+ */
145
+ declare function sanitizeInput(input: string): string;
146
+
147
+ export { type NDPRConfig as N, NDPRProvider as a, type NDPRLocale as b, useNDPRLocale as c, defaultLocale as d, sanitizeInput as s, useNDPRConfig as u };
@@ -0,0 +1,52 @@
1
+ import { c as PrivacyPolicy, P as PolicySection } from './privacy-Ca6te9Ir.js';
2
+ import { P as PolicyDraft, C as ComplianceGap, T as TemplateContext, b as CustomSection, a as ComplianceResult, e as PDFExportOptions, f as DOCXExportOptions, H as HTMLExportOptions } from './policy-engine-DSQpT55_.js';
3
+ import { S as StorageAdapter } from './types-DK2CoKOC.js';
4
+
5
+ interface UseAdaptivePolicyWizardOptions {
6
+ adapter?: StorageAdapter<PolicyDraft>;
7
+ onComplete?: (policy: PrivacyPolicy) => void;
8
+ onComplianceChange?: (score: number, gaps: ComplianceGap[]) => void;
9
+ }
10
+ interface UseAdaptivePolicyWizardReturn {
11
+ currentStep: number;
12
+ goToStep: (step: number) => void;
13
+ nextStep: () => void;
14
+ prevStep: () => void;
15
+ canProceed: boolean;
16
+ context: TemplateContext;
17
+ updateContext: (updates: Partial<TemplateContext>) => void;
18
+ updateOrg: (updates: Partial<TemplateContext['org']>) => void;
19
+ toggleDataCategory: (categoryId: string) => void;
20
+ togglePurpose: (purpose: string) => void;
21
+ addProcessor: (processor: {
22
+ name: string;
23
+ purpose: string;
24
+ country: string;
25
+ }) => void;
26
+ removeProcessor: (index: number) => void;
27
+ policy: PrivacyPolicy | null;
28
+ sections: PolicySection[];
29
+ customSections: CustomSection[];
30
+ addCustomSection: (section: Omit<CustomSection, 'id' | 'required'>) => void;
31
+ updateCustomSection: (id: string, updates: Partial<CustomSection>) => void;
32
+ removeCustomSection: (id: string) => void;
33
+ reorderSections: (sectionId: string, direction: 'up' | 'down') => void;
34
+ editSectionContent: (sectionId: string, content: string) => void;
35
+ sectionOverrides: Record<string, string>;
36
+ complianceScore: number;
37
+ complianceResult: ComplianceResult;
38
+ complianceGaps: ComplianceGap[];
39
+ applyFix: (gapId: string) => void;
40
+ handleExportPDF: (options?: PDFExportOptions) => Promise<Blob>;
41
+ handleExportDOCX: (options?: DOCXExportOptions) => Promise<Blob>;
42
+ handleExportHTML: (options?: HTMLExportOptions) => string;
43
+ handleExportMarkdown: () => string;
44
+ isDraftSaved: boolean;
45
+ lastSavedAt: number | null;
46
+ saveDraft: () => Promise<void>;
47
+ discardDraft: () => void;
48
+ isLoading: boolean;
49
+ }
50
+ declare function useAdaptivePolicyWizard(options?: UseAdaptivePolicyWizardOptions): UseAdaptivePolicyWizardReturn;
51
+
52
+ export { type UseAdaptivePolicyWizardOptions as U, type UseAdaptivePolicyWizardReturn as a, useAdaptivePolicyWizard as u };
@@ -0,0 +1,52 @@
1
+ import { c as PrivacyPolicy, P as PolicySection } from './privacy-Ca6te9Ir.mjs';
2
+ import { P as PolicyDraft, C as ComplianceGap, T as TemplateContext, b as CustomSection, a as ComplianceResult, e as PDFExportOptions, f as DOCXExportOptions, H as HTMLExportOptions } from './policy-engine-C-tShzZH.mjs';
3
+ import { S as StorageAdapter } from './types-DK2CoKOC.mjs';
4
+
5
+ interface UseAdaptivePolicyWizardOptions {
6
+ adapter?: StorageAdapter<PolicyDraft>;
7
+ onComplete?: (policy: PrivacyPolicy) => void;
8
+ onComplianceChange?: (score: number, gaps: ComplianceGap[]) => void;
9
+ }
10
+ interface UseAdaptivePolicyWizardReturn {
11
+ currentStep: number;
12
+ goToStep: (step: number) => void;
13
+ nextStep: () => void;
14
+ prevStep: () => void;
15
+ canProceed: boolean;
16
+ context: TemplateContext;
17
+ updateContext: (updates: Partial<TemplateContext>) => void;
18
+ updateOrg: (updates: Partial<TemplateContext['org']>) => void;
19
+ toggleDataCategory: (categoryId: string) => void;
20
+ togglePurpose: (purpose: string) => void;
21
+ addProcessor: (processor: {
22
+ name: string;
23
+ purpose: string;
24
+ country: string;
25
+ }) => void;
26
+ removeProcessor: (index: number) => void;
27
+ policy: PrivacyPolicy | null;
28
+ sections: PolicySection[];
29
+ customSections: CustomSection[];
30
+ addCustomSection: (section: Omit<CustomSection, 'id' | 'required'>) => void;
31
+ updateCustomSection: (id: string, updates: Partial<CustomSection>) => void;
32
+ removeCustomSection: (id: string) => void;
33
+ reorderSections: (sectionId: string, direction: 'up' | 'down') => void;
34
+ editSectionContent: (sectionId: string, content: string) => void;
35
+ sectionOverrides: Record<string, string>;
36
+ complianceScore: number;
37
+ complianceResult: ComplianceResult;
38
+ complianceGaps: ComplianceGap[];
39
+ applyFix: (gapId: string) => void;
40
+ handleExportPDF: (options?: PDFExportOptions) => Promise<Blob>;
41
+ handleExportDOCX: (options?: DOCXExportOptions) => Promise<Blob>;
42
+ handleExportHTML: (options?: HTMLExportOptions) => string;
43
+ handleExportMarkdown: () => string;
44
+ isDraftSaved: boolean;
45
+ lastSavedAt: number | null;
46
+ saveDraft: () => Promise<void>;
47
+ discardDraft: () => void;
48
+ isLoading: boolean;
49
+ }
50
+ declare function useAdaptivePolicyWizard(options?: UseAdaptivePolicyWizardOptions): UseAdaptivePolicyWizardReturn;
51
+
52
+ export { type UseAdaptivePolicyWizardOptions as U, type UseAdaptivePolicyWizardReturn as a, useAdaptivePolicyWizard as u };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tantainnovative/ndpr-toolkit",
3
- "version": "3.0.0",
3
+ "version": "3.2.1",
4
4
  "private": false,
5
5
  "description": "Nigeria Data Protection Toolkit — enterprise-grade compliance components for the Nigeria Data Protection Act (NDPA) 2023",
6
6
  "keywords": [
@@ -221,6 +221,7 @@
221
221
  "@radix-ui/react-switch": "^1.2.6",
222
222
  "@radix-ui/react-tabs": "^1.1.13",
223
223
  "@tailwindcss/postcss": "^4.1.13",
224
+ "@tantainnovative/ndpr-toolkit": "3.2.0",
224
225
  "@testing-library/dom": "^10.4.1",
225
226
  "@testing-library/jest-dom": "^6.6.3",
226
227
  "@testing-library/react": "^16.3.0",
@@ -258,12 +259,15 @@
258
259
  "tw-animate-css": "^1.4.0",
259
260
  "typescript": "^5.0.0"
260
261
  },
262
+ "dependencies": {
263
+ "@phosphor-icons/react": "^2.1.10"
264
+ },
261
265
  "scripts": {
262
266
  "dev": "next dev --turbopack",
263
267
  "build": "next build && node scripts/post-build.js",
264
268
  "build:lib": "tsup && cp packages/ndpr-toolkit/src/styles.d.ts dist/styles.d.ts",
265
269
  "start": "next start",
266
- "lint": "next lint",
270
+ "lint": "next lint .",
267
271
  "test": "jest --passWithNoTests",
268
272
  "export": "next export",
269
273
  "build:static": "next build",
@@ -271,6 +275,8 @@
271
275
  "release": "commit-and-tag-version",
272
276
  "release:minor": "commit-and-tag-version --release-as minor",
273
277
  "release:major": "commit-and-tag-version --release-as major",
274
- "release:patch": "commit-and-tag-version --release-as patch"
278
+ "release:patch": "commit-and-tag-version --release-as patch",
279
+ "publish:cli": "cd packages/create-ndpr && npm publish --access public",
280
+ "publish:recipes": "cd packages/ndpr-recipes && npm publish --access public"
275
281
  }
276
282
  }
@@ -1,96 +0,0 @@
1
- import React__default from 'react';
2
- import { P as PolicySection, b as PolicyVariable } from './privacy-Ca6te9Ir.mjs';
3
-
4
- interface PolicyGeneratorClassNames {
5
- /** Root container */
6
- root?: string;
7
- /** Header area containing title and description */
8
- header?: string;
9
- /** Title element */
10
- title?: string;
11
- /** Description element */
12
- description?: string;
13
- /** Section list container */
14
- sectionList?: string;
15
- /** Individual section item */
16
- sectionItem?: string;
17
- /** Variable form container */
18
- form?: string;
19
- /** Form input fields */
20
- input?: string;
21
- /** Generate button */
22
- generateButton?: string;
23
- /** Alias for generateButton */
24
- primaryButton?: string;
25
- /** NDPA compliance notice */
26
- complianceNotice?: string;
27
- }
28
- interface PolicyGeneratorProps {
29
- /**
30
- * List of policy sections
31
- * @default DEFAULT_POLICY_SECTIONS
32
- */
33
- sections?: PolicySection[];
34
- /**
35
- * List of policy variables
36
- * @default DEFAULT_POLICY_VARIABLES
37
- */
38
- variables?: PolicyVariable[];
39
- /**
40
- * Callback function called when the policy is generated
41
- */
42
- onGenerate: (policy: {
43
- sections: PolicySection[];
44
- variables: PolicyVariable[];
45
- content: string;
46
- }) => void;
47
- /**
48
- * Title displayed on the generator
49
- * @default "NDPA Privacy Policy Generator"
50
- */
51
- title?: string;
52
- /**
53
- * Description text displayed on the generator
54
- * @default "Generate an NDPA-compliant privacy policy for your organization in accordance with NDPA Section 24."
55
- */
56
- description?: string;
57
- /**
58
- * Custom CSS class for the generator
59
- */
60
- className?: string;
61
- /**
62
- * Custom CSS class for the buttons
63
- */
64
- buttonClassName?: string;
65
- /**
66
- * Text for the generate button
67
- * @default "Generate Policy"
68
- */
69
- generateButtonText?: string;
70
- /**
71
- * Whether to show a preview of the generated policy
72
- * @default true
73
- */
74
- showPreview?: boolean;
75
- /**
76
- * Whether to allow editing the policy content
77
- * @default true
78
- */
79
- allowEditing?: boolean;
80
- /**
81
- * Override class names for internal elements
82
- */
83
- classNames?: PolicyGeneratorClassNames;
84
- /**
85
- * If true, removes all default styles. Use with classNames to apply your own.
86
- * @default false
87
- */
88
- unstyled?: boolean;
89
- }
90
- /**
91
- * Privacy policy generator component. Implements NDPA Section 24 transparency requirements,
92
- * helping organizations generate compliant privacy policies that disclose required information.
93
- */
94
- declare const PolicyGenerator: React__default.FC<PolicyGeneratorProps>;
95
-
96
- export { PolicyGenerator as P, type PolicyGeneratorClassNames as a, type PolicyGeneratorProps as b };
@@ -1,96 +0,0 @@
1
- import React__default from 'react';
2
- import { P as PolicySection, b as PolicyVariable } from './privacy-Ca6te9Ir.js';
3
-
4
- interface PolicyGeneratorClassNames {
5
- /** Root container */
6
- root?: string;
7
- /** Header area containing title and description */
8
- header?: string;
9
- /** Title element */
10
- title?: string;
11
- /** Description element */
12
- description?: string;
13
- /** Section list container */
14
- sectionList?: string;
15
- /** Individual section item */
16
- sectionItem?: string;
17
- /** Variable form container */
18
- form?: string;
19
- /** Form input fields */
20
- input?: string;
21
- /** Generate button */
22
- generateButton?: string;
23
- /** Alias for generateButton */
24
- primaryButton?: string;
25
- /** NDPA compliance notice */
26
- complianceNotice?: string;
27
- }
28
- interface PolicyGeneratorProps {
29
- /**
30
- * List of policy sections
31
- * @default DEFAULT_POLICY_SECTIONS
32
- */
33
- sections?: PolicySection[];
34
- /**
35
- * List of policy variables
36
- * @default DEFAULT_POLICY_VARIABLES
37
- */
38
- variables?: PolicyVariable[];
39
- /**
40
- * Callback function called when the policy is generated
41
- */
42
- onGenerate: (policy: {
43
- sections: PolicySection[];
44
- variables: PolicyVariable[];
45
- content: string;
46
- }) => void;
47
- /**
48
- * Title displayed on the generator
49
- * @default "NDPA Privacy Policy Generator"
50
- */
51
- title?: string;
52
- /**
53
- * Description text displayed on the generator
54
- * @default "Generate an NDPA-compliant privacy policy for your organization in accordance with NDPA Section 24."
55
- */
56
- description?: string;
57
- /**
58
- * Custom CSS class for the generator
59
- */
60
- className?: string;
61
- /**
62
- * Custom CSS class for the buttons
63
- */
64
- buttonClassName?: string;
65
- /**
66
- * Text for the generate button
67
- * @default "Generate Policy"
68
- */
69
- generateButtonText?: string;
70
- /**
71
- * Whether to show a preview of the generated policy
72
- * @default true
73
- */
74
- showPreview?: boolean;
75
- /**
76
- * Whether to allow editing the policy content
77
- * @default true
78
- */
79
- allowEditing?: boolean;
80
- /**
81
- * Override class names for internal elements
82
- */
83
- classNames?: PolicyGeneratorClassNames;
84
- /**
85
- * If true, removes all default styles. Use with classNames to apply your own.
86
- * @default false
87
- */
88
- unstyled?: boolean;
89
- }
90
- /**
91
- * Privacy policy generator component. Implements NDPA Section 24 transparency requirements,
92
- * helping organizations generate compliant privacy policies that disclose required information.
93
- */
94
- declare const PolicyGenerator: React__default.FC<PolicyGeneratorProps>;
95
-
96
- export { PolicyGenerator as P, type PolicyGeneratorClassNames as a, type PolicyGeneratorProps as b };
@@ -1,2 +0,0 @@
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
@@ -1,2 +0,0 @@
1
- function o(i){var a,d;let t=[];return i.id||t.push("Request ID is required"),i.type||t.push("Request type is required"),i.status||t.push("Request status is required"),i.createdAt||t.push("Creation timestamp is required"),(a=i.subject)!=null&&a.name||t.push("Data subject name is required"),(d=i.subject)!=null&&d.email||t.push("Data subject email is required"),{formattedRequest:{requestId:i.id,requestType:i.type,status:i.status,createdDate:new Date(i.createdAt).toISOString(),lastUpdated:i.updatedAt?new Date(i.updatedAt).toISOString():void 0,dueDate:i.dueDate?new Date(i.dueDate).toISOString():void 0,dataSubject:{name:i.subject.name,email:i.subject.email,phone:i.subject.phone||"Not provided",identifier:{type:i.subject.identifierType||"Not specified",value:i.subject.identifierValue||"Not provided"}},additionalInformation:i.additionalInfo||{},verificationStatus:i.verification?`${i.verification.verified?"Verified":"Not verified"}${i.verification.method?` via ${i.verification.method}`:""}`:"Pending verification",attachments:i.attachments?i.attachments.map(e=>({name:e.name,type:e.type,addedOn:new Date(e.addedAt).toISOString()})):[]},isValid:t.length===0,validationErrors:t}}export{o as a};//# sourceMappingURL=chunk-2SYNHRP6.mjs.map
2
- //# sourceMappingURL=chunk-2SYNHRP6.mjs.map
@@ -1,2 +0,0 @@
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
@@ -1,2 +0,0 @@
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
@@ -1,7 +0,0 @@
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
@@ -1,2 +0,0 @@
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
@@ -1,3 +0,0 @@
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
@@ -1,2 +0,0 @@
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