@tantainnovative/ndpr-toolkit 2.1.2 → 2.2.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 (118) hide show
  1. package/README.md +56 -0
  2. package/dist/{breach-6z0r-KuE.d.mts → breach-B_-6lDqS.d.mts} +1 -1
  3. package/dist/{breach-BFfnvtRk.d.ts → breach-CzXqSsaY.d.ts} +1 -1
  4. package/dist/{breach-BtFbDOmV.d.mts → breach-Eu9byel8.d.mts} +1 -1
  5. package/dist/{breach-BtFbDOmV.d.ts → breach-Eu9byel8.d.ts} +1 -1
  6. package/dist/breach.d.mts +81 -5
  7. package/dist/breach.d.ts +81 -5
  8. package/dist/breach.js +1 -1
  9. package/dist/breach.mjs +1 -1
  10. package/dist/chunk-4RGDNVR5.mjs +72 -0
  11. package/dist/chunk-6LM3RAFO.js +7 -0
  12. package/dist/chunk-7DNQSOER.js +2 -0
  13. package/dist/chunk-A7DRHSDQ.mjs +2 -0
  14. package/dist/chunk-FC6EG34C.js +72 -0
  15. package/dist/chunk-FDB6KZUD.mjs +2 -0
  16. package/dist/chunk-FZUCKGIM.mjs +7 -0
  17. package/dist/chunk-G3JNFZPT.js +2 -0
  18. package/dist/chunk-HXCRMA4J.mjs +2 -0
  19. package/dist/chunk-IC7VOOKJ.mjs +2 -0
  20. package/dist/chunk-ICUZG6CD.mjs +2 -0
  21. package/dist/chunk-IW5PHOG7.mjs +7 -0
  22. package/dist/chunk-JKEAPTYP.js +7 -0
  23. package/dist/chunk-N52S64SU.js +2 -0
  24. package/dist/chunk-SKAMVXBI.mjs +94 -0
  25. package/dist/chunk-VURIXCGY.js +2 -0
  26. package/dist/chunk-VXRY3V42.js +94 -0
  27. package/dist/chunk-YBPHGEL2.js +2 -0
  28. package/dist/consent.d.mts +68 -2
  29. package/dist/consent.d.ts +68 -2
  30. package/dist/consent.js +1 -1
  31. package/dist/consent.mjs +1 -1
  32. package/dist/core.d.mts +10 -10
  33. package/dist/core.d.ts +10 -10
  34. package/dist/{cross-border-BrIy1ieh.d.ts → cross-border-BMcqLvjC.d.mts} +1 -1
  35. package/dist/{cross-border-BrIy1ieh.d.mts → cross-border-BMcqLvjC.d.ts} +1 -1
  36. package/dist/cross-border-entry-BfF7jw5o.d.mts +84 -0
  37. package/dist/cross-border-entry-CtX8_o-_.d.ts +84 -0
  38. package/dist/cross-border.d.mts +4 -58
  39. package/dist/cross-border.d.ts +4 -58
  40. package/dist/cross-border.js +1 -1
  41. package/dist/cross-border.mjs +1 -1
  42. package/dist/{dpia-vWfE_9bO.d.mts → dpia-5OQVA1R_.d.mts} +1 -1
  43. package/dist/{dpia-vWfE_9bO.d.ts → dpia-5OQVA1R_.d.ts} +1 -1
  44. package/dist/{dpia-fdtTd2DI.d.ts → dpia-B0Pok5us.d.ts} +1 -1
  45. package/dist/{dpia-B9ZZJG5a.d.mts → dpia-CUfOmzvX.d.mts} +1 -1
  46. package/dist/dpia.d.mts +105 -5
  47. package/dist/dpia.d.ts +105 -5
  48. package/dist/dpia.js +1 -1
  49. package/dist/dpia.mjs +1 -1
  50. package/dist/{dsr-pQzQ3H1O.d.mts → dsr-Cm9lzWG7.d.mts} +1 -1
  51. package/dist/{dsr-pQzQ3H1O.d.ts → dsr-Cm9lzWG7.d.ts} +1 -1
  52. package/dist/{dsr-whPkiI0_.d.mts → dsr-D_eTNc4S.d.mts} +1 -1
  53. package/dist/{dsr-jq5NUEdz.d.ts → dsr-pNtVb1BK.d.ts} +1 -1
  54. package/dist/dsr.d.mts +66 -5
  55. package/dist/dsr.d.ts +66 -5
  56. package/dist/dsr.js +1 -1
  57. package/dist/dsr.mjs +1 -1
  58. package/dist/hooks.d.mts +13 -13
  59. package/dist/hooks.d.ts +13 -13
  60. package/dist/index.d.mts +24 -24
  61. package/dist/index.d.ts +24 -24
  62. package/dist/index.js +1 -1
  63. package/dist/index.mjs +1 -1
  64. package/dist/{lawful-basis-v04AhbK2.d.ts → lawful-basis-BEyI0kGg.d.ts} +2 -2
  65. package/dist/{lawful-basis-D-oXFizg.d.mts → lawful-basis-C2eGaoHM.d.mts} +2 -2
  66. package/dist/{lawful-basis-CWtvDG1x.d.mts → lawful-basis-Cv1VmDLn.d.mts} +1 -1
  67. package/dist/{lawful-basis-CWtvDG1x.d.ts → lawful-basis-Cv1VmDLn.d.ts} +1 -1
  68. package/dist/lawful-basis-entry-BeSX7u0U.d.ts +81 -0
  69. package/dist/lawful-basis-entry-CMPPM9Rh.d.mts +81 -0
  70. package/dist/lawful-basis.d.mts +5 -55
  71. package/dist/lawful-basis.d.ts +5 -55
  72. package/dist/lawful-basis.js +1 -1
  73. package/dist/lawful-basis.mjs +1 -1
  74. package/dist/policy-dmsRlqgM.d.ts +283 -0
  75. package/dist/policy-kZN23hrR.d.mts +283 -0
  76. package/dist/policy.d.mts +3 -193
  77. package/dist/policy.d.ts +3 -193
  78. package/dist/policy.js +1 -1
  79. package/dist/policy.mjs +1 -1
  80. package/dist/{ropa-Rb4dsFSz.d.mts → ropa-DP7pPPql.d.mts} +2 -2
  81. package/dist/{ropa-BebGfqKQ.d.ts → ropa-Li6UlL5H.d.ts} +2 -2
  82. package/dist/ropa-entry-CZJ91ymk.d.mts +71 -0
  83. package/dist/ropa-entry-DIEQ9WFs.d.ts +71 -0
  84. package/dist/ropa.d.mts +5 -45
  85. package/dist/ropa.d.ts +5 -45
  86. package/dist/ropa.js +1 -1
  87. package/dist/ropa.mjs +1 -1
  88. package/dist/unstyled.js +1 -1
  89. package/dist/unstyled.mjs +1 -1
  90. package/dist/{useBreach-WrZzJilM.d.mts → useBreach-BBSoIcZO.d.mts} +1 -1
  91. package/dist/{useBreach-vrh_XMpI.d.ts → useBreach-lFLbSyAN.d.ts} +1 -1
  92. package/dist/{useCrossBorderTransfer-TVnY8_UX.d.mts → useCrossBorderTransfer-BZVFCXfr.d.mts} +1 -1
  93. package/dist/{useCrossBorderTransfer-D4FQYfFt.d.ts → useCrossBorderTransfer-DmtACeqW.d.ts} +1 -1
  94. package/dist/{useDPIA-DFDHBLSa.d.ts → useDPIA-DBsg2yZx.d.ts} +1 -1
  95. package/dist/{useDPIA-FqPofFaV.d.mts → useDPIA-Da7-Q_yW.d.mts} +1 -1
  96. package/dist/{useDSR-DAqqOBXb.d.ts → useDSR-CYI7WCXr.d.ts} +1 -1
  97. package/dist/{useDSR-OXM5Q9rf.d.mts → useDSR-YYZ6FYFs.d.mts} +1 -1
  98. package/dist/{useLawfulBasis-RILM_xsx.d.ts → useLawfulBasis-CCWF9waR.d.ts} +2 -2
  99. package/dist/{useLawfulBasis-DNQ8YszQ.d.mts → useLawfulBasis-CpWuHtyh.d.mts} +2 -2
  100. package/dist/{useROPA-Bcs6cRdi.d.ts → useROPA-BhJ3kvHp.d.ts} +1 -1
  101. package/dist/{useROPA-nmcSiUYv.d.mts → useROPA-DLFdjkxP.d.mts} +1 -1
  102. package/package.json +22 -15
  103. package/dist/chunk-2XHD22J7.mjs +0 -7
  104. package/dist/chunk-4DKT6IB6.js +0 -94
  105. package/dist/chunk-6JFTAYXV.mjs +0 -2
  106. package/dist/chunk-6JVYYLS7.js +0 -2
  107. package/dist/chunk-6SGG6WPA.mjs +0 -2
  108. package/dist/chunk-AQEGDEQM.js +0 -7
  109. package/dist/chunk-C2IJWCZQ.mjs +0 -2
  110. package/dist/chunk-FFW7RUAG.mjs +0 -94
  111. package/dist/chunk-FK3CSFLJ.js +0 -2
  112. package/dist/chunk-JUN6YPLL.mjs +0 -72
  113. package/dist/chunk-L3FKTBGV.js +0 -72
  114. package/dist/chunk-RB26MIRI.js +0 -2
  115. package/dist/chunk-RHWW5FDP.js +0 -16
  116. package/dist/chunk-SLNMKGQ2.mjs +0 -2
  117. package/dist/chunk-UUWVBENC.js +0 -2
  118. package/dist/chunk-XMKA6GVK.mjs +0 -16
package/dist/ropa.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export{a as ROPAManager}from'./chunk-6SGG6WPA.mjs';export{a as useROPA}from'./chunk-T44JQT2O.mjs';export{c as exportROPAToCSV,b as generateROPASummary,d as identifyComplianceGaps,a as validateProcessingRecord}from'./chunk-PYEX7DFR.mjs';import'./chunk-WWT2ZSNU.mjs';//# sourceMappingURL=ropa.mjs.map
1
+ export{a as ROPAManager}from'./chunk-A7DRHSDQ.mjs';export{a as useROPA}from'./chunk-T44JQT2O.mjs';export{c as exportROPAToCSV,b as generateROPASummary,d as identifyComplianceGaps,a as validateProcessingRecord}from'./chunk-PYEX7DFR.mjs';import'./chunk-FDB6KZUD.mjs';import'./chunk-WWT2ZSNU.mjs';//# sourceMappingURL=ropa.mjs.map
2
2
  //# sourceMappingURL=ropa.mjs.map
package/dist/unstyled.js CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';require('./chunk-MQFZHA2D.js');var e=require('react');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var e__default=/*#__PURE__*/_interopDefault(e);var v=e.createContext(void 0);function i(){let n=e.useContext(v);if(!n)throw new Error("useConsent must be used within a ConsentProvider");return n}var C=({className:n,children:a})=>{let{showBanner:o,acceptAll:r,rejectAll:l,openSettings:c}=i();return o?e__default.default.createElement("div",{className:n,role:"region","aria-label":"Cookie consent"},a||e__default.default.createElement(e__default.default.Fragment,null,e__default.default.createElement("div",null,e__default.default.createElement("h3",null,"Cookie Consent"),e__default.default.createElement("p",null,"We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies.")),e__default.default.createElement("div",null,e__default.default.createElement("button",{onClick:r,"aria-label":"Accept all cookies"},"Accept All"),e__default.default.createElement("button",{onClick:l,"aria-label":"Reject non-essential cookies"},"Reject All"),e__default.default.createElement("button",{onClick:c,"aria-label":"Manage cookie preferences"},"Manage Preferences")))):null};var h=[{id:"necessary",name:"Necessary Cookies",description:"These cookies are essential for the website to function properly.",disabled:true},{id:"analytics",name:"Analytics Cookies",description:"These cookies help us understand how visitors interact with our website.",disabled:false},{id:"marketing",name:"Marketing Cookies",description:"These cookies are used to track visitors across websites for marketing purposes.",disabled:false},{id:"functional",name:"Functional Cookies",description:"These cookies enable personalized features and functionality.",disabled:false}],f=({className:n,children:a})=>{let{showSettings:o,consentState:r,updateConsent:l,savePreferences:c,closeSettings:p}=i();if(!o)return null;let g=()=>{c(r);};return e__default.default.createElement("div",{className:n,role:"dialog","aria-label":"Cookie preferences"},a||e__default.default.createElement(e__default.default.Fragment,null,e__default.default.createElement("div",null,e__default.default.createElement("h2",null,"Cookie Preferences"),e__default.default.createElement("p",null,"Manage your cookie preferences. You can enable or disable different categories of cookies below.")),e__default.default.createElement("div",null,h.map(s=>e__default.default.createElement("div",{key:s.id},e__default.default.createElement("div",null,e__default.default.createElement("h4",null,s.name),e__default.default.createElement("p",null,s.description)),e__default.default.createElement("input",{type:"checkbox",checked:r[s.id],onChange:k=>l(s.id,k.target.checked),disabled:s.disabled,"aria-label":`Toggle ${s.name}`})))),e__default.default.createElement("div",null,e__default.default.createElement("button",{onClick:p,"aria-label":"Cancel changes"},"Cancel"),e__default.default.createElement("button",{onClick:g,"aria-label":"Save cookie preferences"},"Save Preferences"))))};var u=({category:n,className:a,label:o})=>{let{consentState:r,updateConsent:l}=i();return e__default.default.createElement("label",{className:a},e__default.default.createElement("input",{type:"checkbox",checked:r[n],onChange:c=>l(n,c.target.checked),"aria-label":o||`Toggle ${n} cookies`}),o&&e__default.default.createElement("span",null,o))};exports.ConsentBanner=C;exports.ConsentSettings=f;exports.ConsentToggle=u;//# sourceMappingURL=unstyled.js.map
1
+ 'use strict';require('./chunk-MQFZHA2D.js');var react=require('react'),jsxRuntime=require('react/jsx-runtime');var m=react.createContext(void 0);function a(){let e=react.useContext(m);if(!e)throw new Error("useConsent must be used within a ConsentProvider");return e}var f=({className:e,children:i})=>{let{showBanner:t,acceptAll:s,rejectAll:l,openSettings:c}=a();return t?jsxRuntime.jsx("div",{className:e,role:"region","aria-label":"Cookie consent",children:i||jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{children:"Cookie Consent"}),jsxRuntime.jsx("p",{children:"We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies."})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("button",{onClick:s,"aria-label":"Accept all cookies",children:"Accept All"}),jsxRuntime.jsx("button",{onClick:l,"aria-label":"Reject non-essential cookies",children:"Reject All"}),jsxRuntime.jsx("button",{onClick:c,"aria-label":"Manage cookie preferences",children:"Manage Preferences"})]})]})}):null};var w=[{id:"necessary",name:"Necessary Cookies",description:"These cookies are essential for the website to function properly.",disabled:true},{id:"analytics",name:"Analytics Cookies",description:"These cookies help us understand how visitors interact with our website.",disabled:false},{id:"marketing",name:"Marketing Cookies",description:"These cookies are used to track visitors across websites for marketing purposes.",disabled:false},{id:"functional",name:"Functional Cookies",description:"These cookies enable personalized features and functionality.",disabled:false}],u=({className:e,children:i})=>{let{showSettings:t,consentState:s,updateConsent:l,savePreferences:c,closeSettings:k}=a();if(!t)return null;let b=()=>{c(s);};return jsxRuntime.jsx("div",{className:e,role:"dialog","aria-label":"Cookie preferences",children:i||jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{children:"Cookie Preferences"}),jsxRuntime.jsx("p",{children:"Manage your cookie preferences. You can enable or disable different categories of cookies below."})]}),jsxRuntime.jsx("div",{children:w.map(o=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h4",{children:o.name}),jsxRuntime.jsx("p",{children:o.description})]}),jsxRuntime.jsx("input",{type:"checkbox",checked:s[o.id],onChange:v=>l(o.id,v.target.checked),disabled:o.disabled,"aria-label":`Toggle ${o.name}`})]},o.id))}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("button",{onClick:k,"aria-label":"Cancel changes",children:"Cancel"}),jsxRuntime.jsx("button",{onClick:b,"aria-label":"Save cookie preferences",children:"Save Preferences"})]})]})})};var g=({category:e,className:i,label:t})=>{let{consentState:s,updateConsent:l}=a();return jsxRuntime.jsxs("label",{className:i,children:[jsxRuntime.jsx("input",{type:"checkbox",checked:s[e],onChange:c=>l(e,c.target.checked),"aria-label":t||`Toggle ${e} cookies`}),t&&jsxRuntime.jsx("span",{children:t})]})};exports.ConsentBanner=f;exports.ConsentSettings=u;exports.ConsentToggle=g;//# sourceMappingURL=unstyled.js.map
2
2
  //# sourceMappingURL=unstyled.js.map
package/dist/unstyled.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import'./chunk-WWT2ZSNU.mjs';import e,{createContext,useContext}from'react';var v=createContext(void 0);function i(){let n=useContext(v);if(!n)throw new Error("useConsent must be used within a ConsentProvider");return n}var C=({className:n,children:a})=>{let{showBanner:o,acceptAll:r,rejectAll:l,openSettings:c}=i();return o?e.createElement("div",{className:n,role:"region","aria-label":"Cookie consent"},a||e.createElement(e.Fragment,null,e.createElement("div",null,e.createElement("h3",null,"Cookie Consent"),e.createElement("p",null,"We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies.")),e.createElement("div",null,e.createElement("button",{onClick:r,"aria-label":"Accept all cookies"},"Accept All"),e.createElement("button",{onClick:l,"aria-label":"Reject non-essential cookies"},"Reject All"),e.createElement("button",{onClick:c,"aria-label":"Manage cookie preferences"},"Manage Preferences")))):null};var h=[{id:"necessary",name:"Necessary Cookies",description:"These cookies are essential for the website to function properly.",disabled:true},{id:"analytics",name:"Analytics Cookies",description:"These cookies help us understand how visitors interact with our website.",disabled:false},{id:"marketing",name:"Marketing Cookies",description:"These cookies are used to track visitors across websites for marketing purposes.",disabled:false},{id:"functional",name:"Functional Cookies",description:"These cookies enable personalized features and functionality.",disabled:false}],f=({className:n,children:a})=>{let{showSettings:o,consentState:r,updateConsent:l,savePreferences:c,closeSettings:p}=i();if(!o)return null;let g=()=>{c(r);};return e.createElement("div",{className:n,role:"dialog","aria-label":"Cookie preferences"},a||e.createElement(e.Fragment,null,e.createElement("div",null,e.createElement("h2",null,"Cookie Preferences"),e.createElement("p",null,"Manage your cookie preferences. You can enable or disable different categories of cookies below.")),e.createElement("div",null,h.map(s=>e.createElement("div",{key:s.id},e.createElement("div",null,e.createElement("h4",null,s.name),e.createElement("p",null,s.description)),e.createElement("input",{type:"checkbox",checked:r[s.id],onChange:k=>l(s.id,k.target.checked),disabled:s.disabled,"aria-label":`Toggle ${s.name}`})))),e.createElement("div",null,e.createElement("button",{onClick:p,"aria-label":"Cancel changes"},"Cancel"),e.createElement("button",{onClick:g,"aria-label":"Save cookie preferences"},"Save Preferences"))))};var u=({category:n,className:a,label:o})=>{let{consentState:r,updateConsent:l}=i();return e.createElement("label",{className:a},e.createElement("input",{type:"checkbox",checked:r[n],onChange:c=>l(n,c.target.checked),"aria-label":o||`Toggle ${n} cookies`}),o&&e.createElement("span",null,o))};export{C as ConsentBanner,f as ConsentSettings,u as ConsentToggle};//# sourceMappingURL=unstyled.mjs.map
1
+ import'./chunk-WWT2ZSNU.mjs';import {createContext,useContext}from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var m=createContext(void 0);function a(){let e=useContext(m);if(!e)throw new Error("useConsent must be used within a ConsentProvider");return e}var f=({className:e,children:i})=>{let{showBanner:t,acceptAll:s,rejectAll:l,openSettings:c}=a();return t?jsx("div",{className:e,role:"region","aria-label":"Cookie consent",children:i||jsxs(Fragment,{children:[jsxs("div",{children:[jsx("h3",{children:"Cookie Consent"}),jsx("p",{children:"We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies."})]}),jsxs("div",{children:[jsx("button",{onClick:s,"aria-label":"Accept all cookies",children:"Accept All"}),jsx("button",{onClick:l,"aria-label":"Reject non-essential cookies",children:"Reject All"}),jsx("button",{onClick:c,"aria-label":"Manage cookie preferences",children:"Manage Preferences"})]})]})}):null};var w=[{id:"necessary",name:"Necessary Cookies",description:"These cookies are essential for the website to function properly.",disabled:true},{id:"analytics",name:"Analytics Cookies",description:"These cookies help us understand how visitors interact with our website.",disabled:false},{id:"marketing",name:"Marketing Cookies",description:"These cookies are used to track visitors across websites for marketing purposes.",disabled:false},{id:"functional",name:"Functional Cookies",description:"These cookies enable personalized features and functionality.",disabled:false}],u=({className:e,children:i})=>{let{showSettings:t,consentState:s,updateConsent:l,savePreferences:c,closeSettings:k}=a();if(!t)return null;let b=()=>{c(s);};return jsx("div",{className:e,role:"dialog","aria-label":"Cookie preferences",children:i||jsxs(Fragment,{children:[jsxs("div",{children:[jsx("h2",{children:"Cookie Preferences"}),jsx("p",{children:"Manage your cookie preferences. You can enable or disable different categories of cookies below."})]}),jsx("div",{children:w.map(o=>jsxs("div",{children:[jsxs("div",{children:[jsx("h4",{children:o.name}),jsx("p",{children:o.description})]}),jsx("input",{type:"checkbox",checked:s[o.id],onChange:v=>l(o.id,v.target.checked),disabled:o.disabled,"aria-label":`Toggle ${o.name}`})]},o.id))}),jsxs("div",{children:[jsx("button",{onClick:k,"aria-label":"Cancel changes",children:"Cancel"}),jsx("button",{onClick:b,"aria-label":"Save cookie preferences",children:"Save Preferences"})]})]})})};var g=({category:e,className:i,label:t})=>{let{consentState:s,updateConsent:l}=a();return jsxs("label",{className:i,children:[jsx("input",{type:"checkbox",checked:s[e],onChange:c=>l(e,c.target.checked),"aria-label":t||`Toggle ${e} cookies`}),t&&jsx("span",{children:t})]})};export{f as ConsentBanner,u as ConsentSettings,g as ConsentToggle};//# sourceMappingURL=unstyled.mjs.map
2
2
  //# sourceMappingURL=unstyled.mjs.map
@@ -1,4 +1,4 @@
1
- import { a as BreachCategory, B as BreachReport, R as RiskAssessment, b as RegulatoryNotification, N as NotificationRequirement } from './breach-BtFbDOmV.mjs';
1
+ import { B as BreachCategory, a as BreachReport, b as RiskAssessment, R as RegulatoryNotification, N as NotificationRequirement } from './breach-Eu9byel8.mjs';
2
2
 
3
3
  interface UseBreachOptions {
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { a as BreachCategory, B as BreachReport, R as RiskAssessment, b as RegulatoryNotification, N as NotificationRequirement } from './breach-BtFbDOmV.js';
1
+ import { B as BreachCategory, a as BreachReport, b as RiskAssessment, R as RegulatoryNotification, N as NotificationRequirement } from './breach-Eu9byel8.js';
2
2
 
3
3
  interface UseBreachOptions {
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { C as CrossBorderTransfer, b as CrossBorderSummary, d as TransferValidationResult } from './cross-border-BrIy1ieh.mjs';
1
+ import { a as CrossBorderTransfer, C as CrossBorderSummary, d as TransferValidationResult } from './cross-border-BMcqLvjC.mjs';
2
2
 
3
3
  interface UseCrossBorderTransferOptions {
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { C as CrossBorderTransfer, b as CrossBorderSummary, d as TransferValidationResult } from './cross-border-BrIy1ieh.js';
1
+ import { a as CrossBorderTransfer, C as CrossBorderSummary, d as TransferValidationResult } from './cross-border-BMcqLvjC.js';
2
2
 
3
3
  interface UseCrossBorderTransferOptions {
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { a as DPIASection, b as DPIAResult, D as DPIAQuestion } from './dpia-vWfE_9bO.js';
1
+ import { c as DPIASection, a as DPIAResult, D as DPIAQuestion } from './dpia-5OQVA1R_.js';
2
2
 
3
3
  interface UseDPIAOptions {
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { a as DPIASection, b as DPIAResult, D as DPIAQuestion } from './dpia-vWfE_9bO.mjs';
1
+ import { c as DPIASection, a as DPIAResult, D as DPIAQuestion } from './dpia-5OQVA1R_.mjs';
2
2
 
3
3
  interface UseDPIAOptions {
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { D as DSRRequest, R as RequestType, c as RequestStatus } from './dsr-pQzQ3H1O.js';
1
+ import { D as DSRRequest, c as RequestType, R as RequestStatus } from './dsr-Cm9lzWG7.js';
2
2
 
3
3
  interface UseDSROptions {
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { D as DSRRequest, R as RequestType, c as RequestStatus } from './dsr-pQzQ3H1O.mjs';
1
+ import { D as DSRRequest, c as RequestType, R as RequestStatus } from './dsr-Cm9lzWG7.mjs';
2
2
 
3
3
  interface UseDSROptions {
4
4
  /**
@@ -1,5 +1,5 @@
1
- import { P as ProcessingActivity, b as LawfulBasisSummary } from './lawful-basis-CWtvDG1x.js';
2
- import { c as LawfulBasisValidationResult } from './lawful-basis-v04AhbK2.js';
1
+ import { P as ProcessingActivity, a as LawfulBasisSummary } from './lawful-basis-Cv1VmDLn.js';
2
+ import { a as LawfulBasisValidationResult } from './lawful-basis-BEyI0kGg.js';
3
3
 
4
4
  interface UseLawfulBasisOptions {
5
5
  /**
@@ -1,5 +1,5 @@
1
- import { P as ProcessingActivity, b as LawfulBasisSummary } from './lawful-basis-CWtvDG1x.mjs';
2
- import { c as LawfulBasisValidationResult } from './lawful-basis-D-oXFizg.mjs';
1
+ import { P as ProcessingActivity, a as LawfulBasisSummary } from './lawful-basis-Cv1VmDLn.mjs';
2
+ import { a as LawfulBasisValidationResult } from './lawful-basis-C2eGaoHM.mjs';
3
3
 
4
4
  interface UseLawfulBasisOptions {
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { R as RecordOfProcessingActivities, P as ProcessingRecord, a as ROPASummary, b as ROPAComplianceGap } from './ropa-BebGfqKQ.js';
1
+ import { c as RecordOfProcessingActivities, P as ProcessingRecord, a as ROPASummary, R as ROPAComplianceGap } from './ropa-Li6UlL5H.js';
2
2
 
3
3
  interface UseROPAOptions {
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { R as RecordOfProcessingActivities, P as ProcessingRecord, a as ROPASummary, b as ROPAComplianceGap } from './ropa-Rb4dsFSz.mjs';
1
+ import { c as RecordOfProcessingActivities, P as ProcessingRecord, a as ROPASummary, R as ROPAComplianceGap } from './ropa-DP7pPPql.mjs';
2
2
 
3
3
  interface UseROPAOptions {
4
4
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tantainnovative/ndpr-toolkit",
3
- "version": "2.1.2",
3
+ "version": "2.2.0",
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": [
@@ -199,9 +199,10 @@
199
199
  "@mdx-js/loader": "^3.1.1",
200
200
  "@mdx-js/react": "^3.1.1",
201
201
  "@next/mdx": "^16.2.2",
202
- "@next/font": "^14.2.15",
203
- "gray-matter": "^4.0.3",
204
- "reading-time": "^1.5.0",
202
+ "@radix-ui/react-label": "^2.1.8",
203
+ "@radix-ui/react-slot": "^1.2.4",
204
+ "@radix-ui/react-switch": "^1.2.6",
205
+ "@radix-ui/react-tabs": "^1.1.13",
205
206
  "@tailwindcss/postcss": "^4.1.13",
206
207
  "@testing-library/jest-dom": "^6.6.3",
207
208
  "@testing-library/react": "^16.3.0",
@@ -211,25 +212,31 @@
211
212
  "@typescript-eslint/eslint-plugin": "^8.0.0",
212
213
  "@typescript-eslint/parser": "^8.0.0",
213
214
  "autoprefixer": "^10.4.21",
214
- "eslint": "^9.0.0",
215
+ "class-variance-authority": "^0.7.1",
216
+ "clsx": "^2.1.1",
217
+ "commit-and-tag-version": "^12.7.1",
218
+ "eslint": "^10.2.0",
215
219
  "eslint-plugin-react": "^7.30.0",
216
220
  "eslint-plugin-react-hooks": "^4.5.0",
217
221
  "gh-pages": "^6.3.0",
222
+ "gray-matter": "^4.0.3",
218
223
  "husky": "^9.1.7",
219
224
  "jest": "^29.5.0",
220
- "jest-environment-jsdom": "^30.2.0",
225
+ "jest-environment-jsdom": "^30.3.0",
226
+ "jspdf": "^4.2.1",
221
227
  "lint-staged": "^16.2.3",
222
- "next": "^15.5.4",
228
+ "lucide-react": "0.507.0",
229
+ "next": "^16.2.2",
223
230
  "postcss": "^8.5.6",
224
- "posthog-js": "^1.268.8",
231
+ "posthog-js": "^1.364.7",
225
232
  "posthog-node": "^5.9.2",
226
233
  "react": "^19.1.1",
227
234
  "react-dom": "^19.1.1",
228
- "react-test-renderer": "^18.2.0",
229
- "standard-version": "^9.5.0",
235
+ "reading-time": "^1.5.0",
236
+ "tailwind-merge": "^3.5.0",
230
237
  "tailwindcss": "^4.1.13",
231
238
  "ts-jest": "^29.0.0",
232
- "tsup": "^8.5.0",
239
+ "tsup": "^8.5.1",
233
240
  "tw-animate-css": "^1.4.0",
234
241
  "typescript": "^5.0.0"
235
242
  },
@@ -243,9 +250,9 @@
243
250
  "export": "next export",
244
251
  "build:static": "next build",
245
252
  "deploy": "next build && touch out/.nojekyll && gh-pages -d out",
246
- "release": "standard-version",
247
- "release:minor": "standard-version --release-as minor",
248
- "release:major": "standard-version --release-as major",
249
- "release:patch": "standard-version --release-as patch"
253
+ "release": "commit-and-tag-version",
254
+ "release:minor": "commit-and-tag-version --release-as minor",
255
+ "release:major": "commit-and-tag-version --release-as major",
256
+ "release:patch": "commit-and-tag-version --release-as patch"
250
257
  }
251
258
  }
@@ -1,7 +0,0 @@
1
- import {a,d,c,b}from'./chunk-QKK5S54L.mjs';import {b as b$1,a as a$1}from'./chunk-WWT2ZSNU.mjs';import e,{useState,useEffect}from'react';var T=[{value:"adequacy_decision",label:"Adequacy Decision (Section 41)"},{value:"standard_clauses",label:"Standard Contractual Clauses (Section 42)"},{value:"binding_corporate_rules",label:"Binding Corporate Rules (Section 43)"},{value:"ndpc_authorization",label:"NDPC Authorization (Section 44)"},{value:"explicit_consent",label:"Explicit Consent (Section 45(a))"},{value:"contract_performance",label:"Contract Performance (Section 45(b))"},{value:"public_interest",label:"Public Interest (Section 45(c))"},{value:"legal_claims",label:"Legal Claims (Section 45(d))"},{value:"vital_interests",label:"Vital Interests (Section 45(e))"}],$=[{value:"adequate",label:"Adequate"},{value:"inadequate",label:"Inadequate"},{value:"pending_review",label:"Pending Review"},{value:"unknown",label:"Unknown"}],U=[{value:"one_time",label:"One-Time"},{value:"periodic",label:"Periodic"},{value:"continuous",label:"Continuous"}],V=[{value:"active",label:"Active"},{value:"suspended",label:"Suspended"},{value:"terminated",label:"Terminated"},{value:"pending_approval",label:"Pending Approval"}],H={destinationCountry:"",destinationCountryCode:"",adequacyStatus:"unknown",transferMechanism:"adequacy_decision",dataCategories:"",includesSensitiveData:false,estimatedDataSubjects:"",recipientOrganization:"",recipientContactName:"",recipientContactEmail:"",recipientContactPhone:"",recipientContactAddress:"",purpose:"",safeguards:"",riskAssessment:"",riskLevel:"medium",frequency:"one_time",status:"active",tiaCompleted:false,tiaReference:"",ndpcApprovalApplied:false,ndpcApprovalApproved:false,ndpcApprovalReference:""},ue=({transfers:o,onAddTransfer:D,onUpdateTransfer:q,onRemoveTransfer:M,summary:Y,title:Q="Cross-Border Data Transfer Manager",description:W="Manage and document cross-border personal data transfers in compliance with NDPA 2023 Part VI (Sections 41-45).",className:G="",buttonClassName:h="",showSummary:K=true,showTIA:J=true})=>{let[u,C]=useState(null),[F,g]=useState(false),[b$2,P]=useState(null),[t,A]=useState(H),[c$1,O]=useState(null),[x,X]=useState("all"),[y,Z]=useState("all"),[v,R]=useState(o);useEffect(()=>{let a=[...o];x!=="all"&&(a=a.filter(s=>s.status===x)),y!=="all"&&(a=a.filter(s=>s.transferMechanism===y)),a.sort((s,r)=>r.updatedAt-s.updatedAt),R(a);},[o,x,y]),useEffect(()=>{v.length>0&&!u&&C(v[0].id);},[v,u]);let I=u?o.find(a=>a.id===u):null,f=a=>new Date(a).toLocaleDateString(),N=()=>{A(H),P(null),O(null);},ee=()=>{N(),g(true);},ae=a=>{var s,r,d,p;P(a.id),A({destinationCountry:a.destinationCountry,destinationCountryCode:a.destinationCountryCode||"",adequacyStatus:a.adequacyStatus,transferMechanism:a.transferMechanism,dataCategories:a.dataCategories.join(", "),includesSensitiveData:a.includesSensitiveData,estimatedDataSubjects:((s=a.estimatedDataSubjects)==null?void 0:s.toString())||"",recipientOrganization:a.recipientOrganization,recipientContactName:a.recipientContact.name,recipientContactEmail:a.recipientContact.email,recipientContactPhone:a.recipientContact.phone||"",recipientContactAddress:a.recipientContact.address||"",purpose:a.purpose,safeguards:a.safeguards.join(`
2
- `),riskAssessment:a.riskAssessment,riskLevel:a.riskLevel,frequency:a.frequency,status:a.status,tiaCompleted:a.tiaCompleted,tiaReference:a.tiaReference||"",ndpcApprovalApplied:((r=a.ndpcApproval)==null?void 0:r.applied)||false,ndpcApprovalApproved:((d=a.ndpcApproval)==null?void 0:d.approved)||false,ndpcApprovalReference:((p=a.ndpcApproval)==null?void 0:p.referenceNumber)||""}),g(true);},l=(a,s)=>{A(r=>b$1(a$1({},r),{[a]:s}));},se=()=>{let a$1=a(t.transferMechanism),s=Date.now();return {destinationCountry:t.destinationCountry.trim(),destinationCountryCode:t.destinationCountryCode.trim()||void 0,adequacyStatus:t.adequacyStatus,transferMechanism:t.transferMechanism,dataCategories:t.dataCategories.split(",").map(r=>r.trim()).filter(Boolean),includesSensitiveData:t.includesSensitiveData,estimatedDataSubjects:t.estimatedDataSubjects?parseInt(t.estimatedDataSubjects,10):void 0,recipientOrganization:t.recipientOrganization.trim(),recipientContact:{name:t.recipientContactName.trim(),email:t.recipientContactEmail.trim(),phone:t.recipientContactPhone.trim()||void 0,address:t.recipientContactAddress.trim()||void 0},purpose:t.purpose.trim(),safeguards:t.safeguards.split(`
3
- `).map(r=>r.trim()).filter(Boolean),riskAssessment:t.riskAssessment.trim(),riskLevel:t.riskLevel,frequency:t.frequency,status:a$1&&!t.ndpcApprovalApproved?"pending_approval":t.status,tiaCompleted:t.tiaCompleted,tiaReference:t.tiaReference.trim()||void 0,ndpcApproval:a$1?{required:true,applied:t.ndpcApprovalApplied,approved:t.ndpcApprovalApproved||void 0,referenceNumber:t.ndpcApprovalReference.trim()||void 0,appliedAt:t.ndpcApprovalApplied?s:void 0,approvedAt:t.ndpcApprovalApproved?s:void 0}:void 0,startDate:s,reviewDate:s+365*24*60*60*1e3}},te=()=>{let a=se(),s=a$1({id:b$2||"temp",createdAt:Date.now(),updatedAt:Date.now()},a),r=c(s);O(r),r.isValid&&(b$2?q&&q(b$2,a):D&&D(a),N(),g(false));},re=a=>{M&&M(a),u===a&&C(null);},_=a=>e.createElement("span",{className:`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[a]}`},a.charAt(0).toUpperCase()+a.slice(1)," Risk"),B=a=>{let s={active:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",suspended:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",terminated:"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200",pending_approval:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200"},r={active:"Active",suspended:"Suspended",terminated:"Terminated",pending_approval:"Pending Approval"};return e.createElement("span",{className:`px-2 py-1 rounded text-xs font-medium ${s[a]}`},r[a])},le=a$1=>{var d;let s=a(a$1),r=((d=T.find(p=>p.value===a$1))==null?void 0:d.label)||a$1;return e.createElement("span",{className:`px-2 py-1 rounded text-xs font-medium ${s?"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200":"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200"}`},r)},ne=()=>{let a=Y||{totalActiveTransfers:o.filter(s=>s.status==="active").length,pendingApproval:o.filter(s=>{var r,d;return s.status==="pending_approval"||((r=s.ndpcApproval)==null?void 0:r.required)&&!((d=s.ndpcApproval)!=null&&d.approved)}),highRiskTransfers:o.filter(s=>s.riskLevel==="high"&&s.status==="active"),missingTIA:o.filter(s=>!s.tiaCompleted&&s.status==="active")};return e.createElement("div",{className:"mb-6 grid grid-cols-2 md:grid-cols-4 gap-4"},e.createElement("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-4 rounded-lg"},e.createElement("p",{className:"text-2xl font-bold text-blue-800 dark:text-blue-200"},a.totalActiveTransfers),e.createElement("p",{className:"text-sm text-blue-600 dark:text-blue-300"},"Active Transfers")),e.createElement("div",{className:"bg-purple-50 dark:bg-purple-900/20 p-4 rounded-lg"},e.createElement("p",{className:"text-2xl font-bold text-purple-800 dark:text-purple-200"},a.pendingApproval.length),e.createElement("p",{className:"text-sm text-purple-600 dark:text-purple-300"},"Pending Approval")),e.createElement("div",{className:"bg-red-50 dark:bg-red-900/20 p-4 rounded-lg"},e.createElement("p",{className:"text-2xl font-bold text-red-800 dark:text-red-200"},a.highRiskTransfers.length),e.createElement("p",{className:"text-sm text-red-600 dark:text-red-300"},"High Risk")),e.createElement("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-4 rounded-lg"},e.createElement("p",{className:"text-2xl font-bold text-yellow-800 dark:text-yellow-200"},a.missingTIA.length),e.createElement("p",{className:"text-sm text-yellow-600 dark:text-yellow-300"},"Missing TIA")))},de=()=>{let a$1=a(t.transferMechanism);return e.createElement("div",{className:"bg-gray-50 dark:bg-gray-700 p-6 rounded-lg mb-6"},e.createElement("div",{className:"flex justify-between items-center mb-4"},e.createElement("h3",{className:"text-lg font-medium"},b$2?"Edit Transfer":"Add New Transfer"),e.createElement("button",{onClick:()=>{N(),g(false);},className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200"},"Cancel")),c$1&&!c$1.isValid&&e.createElement("div",{className:"mb-4 bg-red-50 dark:bg-red-900/20 p-3 rounded-md"},e.createElement("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1"},"Please fix the following errors:"),e.createElement("ul",{className:"list-disc list-inside text-sm text-red-700 dark:text-red-300"},c$1.errors.map((s,r)=>e.createElement("li",{key:r},s)))),c$1&&c$1.warnings.length>0&&e.createElement("div",{className:"mb-4 bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md"},e.createElement("p",{className:"text-sm font-medium text-yellow-800 dark:text-yellow-200 mb-1"},"Warnings:"),e.createElement("ul",{className:"list-disc list-inside text-sm text-yellow-700 dark:text-yellow-300"},c$1.warnings.map((s,r)=>e.createElement("li",{key:r},s)))),e.createElement("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4"},e.createElement("div",null,e.createElement("label",{className:"block text-sm font-medium mb-1"},"Destination Country ",e.createElement("span",{className:"text-red-500"},"*")),e.createElement("input",{type:"text",value:t.destinationCountry,onChange:s=>l("destinationCountry",s.target.value),placeholder:"e.g. United Kingdom",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-blue-500"})),e.createElement("div",null,e.createElement("label",{className:"block text-sm font-medium mb-1"},"Country Code (ISO)"),e.createElement("input",{type:"text",value:t.destinationCountryCode,onChange:s=>l("destinationCountryCode",s.target.value),placeholder:"e.g. GB",maxLength:3,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-blue-500"})),e.createElement("div",null,e.createElement("label",{className:"block text-sm font-medium mb-1"},"Recipient Organization ",e.createElement("span",{className:"text-red-500"},"*")),e.createElement("input",{type:"text",value:t.recipientOrganization,onChange:s=>l("recipientOrganization",s.target.value),placeholder:"Organization name",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-blue-500"})),e.createElement("div",null,e.createElement("label",{className:"block text-sm font-medium mb-1"},"Transfer Mechanism ",e.createElement("span",{className:"text-red-500"},"*")),e.createElement("select",{value:t.transferMechanism,onChange:s=>l("transferMechanism",s.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"},T.map(s=>e.createElement("option",{key:s.value,value:s.value},s.label)))),e.createElement("div",null,e.createElement("label",{className:"block text-sm font-medium mb-1"},"Adequacy Status"),e.createElement("select",{value:t.adequacyStatus,onChange:s=>l("adequacyStatus",s.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"},$.map(s=>e.createElement("option",{key:s.value,value:s.value},s.label)))),e.createElement("div",null,e.createElement("label",{className:"block text-sm font-medium mb-1"},"Risk Level"),e.createElement("select",{value:t.riskLevel,onChange:s=>l("riskLevel",s.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"},e.createElement("option",{value:"low"},"Low"),e.createElement("option",{value:"medium"},"Medium"),e.createElement("option",{value:"high"},"High"))),e.createElement("div",{className:"md:col-span-2"},e.createElement("label",{className:"block text-sm font-medium mb-1"},"Data Categories ",e.createElement("span",{className:"text-red-500"},"*")),e.createElement("input",{type:"text",value:t.dataCategories,onChange:s=>l("dataCategories",s.target.value),placeholder:"Comma-separated, e.g. Names, Email addresses, Phone numbers",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-blue-500"})),e.createElement("div",{className:"flex items-center gap-2"},e.createElement("input",{type:"checkbox",id:"includesSensitiveData",checked:t.includesSensitiveData,onChange:s=>l("includesSensitiveData",s.target.checked),className:"h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"}),e.createElement("label",{htmlFor:"includesSensitiveData",className:"text-sm font-medium"},"Includes sensitive personal data")),e.createElement("div",null,e.createElement("label",{className:"block text-sm font-medium mb-1"},"Estimated Data Subjects"),e.createElement("input",{type:"number",value:t.estimatedDataSubjects,onChange:s=>l("estimatedDataSubjects",s.target.value),placeholder:"Number of data subjects",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-blue-500"})),e.createElement("div",null,e.createElement("label",{className:"block text-sm font-medium mb-1"},"Recipient Contact Name ",e.createElement("span",{className:"text-red-500"},"*")),e.createElement("input",{type:"text",value:t.recipientContactName,onChange:s=>l("recipientContactName",s.target.value),placeholder:"Contact person name",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-blue-500"})),e.createElement("div",null,e.createElement("label",{className:"block text-sm font-medium mb-1"},"Recipient Contact Email ",e.createElement("span",{className:"text-red-500"},"*")),e.createElement("input",{type:"email",value:t.recipientContactEmail,onChange:s=>l("recipientContactEmail",s.target.value),placeholder:"contact@example.com",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-blue-500"})),e.createElement("div",null,e.createElement("label",{className:"block text-sm font-medium mb-1"},"Recipient Contact Phone"),e.createElement("input",{type:"text",value:t.recipientContactPhone,onChange:s=>l("recipientContactPhone",s.target.value),placeholder:"Phone number",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-blue-500"})),e.createElement("div",null,e.createElement("label",{className:"block text-sm font-medium mb-1"},"Recipient Contact Address"),e.createElement("input",{type:"text",value:t.recipientContactAddress,onChange:s=>l("recipientContactAddress",s.target.value),placeholder:"Address",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-blue-500"})),e.createElement("div",{className:"md:col-span-2"},e.createElement("label",{className:"block text-sm font-medium mb-1"},"Purpose of Transfer ",e.createElement("span",{className:"text-red-500"},"*")),e.createElement("textarea",{value:t.purpose,onChange:s=>l("purpose",s.target.value),placeholder:"Describe the purpose of this data transfer",rows:2,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-blue-500"})),e.createElement("div",{className:"md:col-span-2"},e.createElement("label",{className:"block text-sm font-medium mb-1"},"Safeguards ",e.createElement("span",{className:"text-red-500"},"*")),e.createElement("textarea",{value:t.safeguards,onChange:s=>l("safeguards",s.target.value),placeholder:`One safeguard per line, e.g.
4
- End-to-end encryption
5
- Access control policies
6
- Regular security audits`,rows:3,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-blue-500"})),e.createElement("div",{className:"md:col-span-2"},e.createElement("label",{className:"block text-sm font-medium mb-1"},"Risk Assessment Summary ",e.createElement("span",{className:"text-red-500"},"*")),e.createElement("textarea",{value:t.riskAssessment,onChange:s=>l("riskAssessment",s.target.value),placeholder:"Summarize the risk assessment for this transfer",rows:2,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-blue-500"})),e.createElement("div",null,e.createElement("label",{className:"block text-sm font-medium mb-1"},"Transfer Frequency"),e.createElement("select",{value:t.frequency,onChange:s=>l("frequency",s.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"},U.map(s=>e.createElement("option",{key:s.value,value:s.value},s.label)))),e.createElement("div",null,e.createElement("label",{className:"block text-sm font-medium mb-1"},"Status"),e.createElement("select",{value:t.status,onChange:s=>l("status",s.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"},V.map(s=>e.createElement("option",{key:s.value,value:s.value},s.label))))),a$1&&e.createElement("div",{className:"mt-4 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md"},e.createElement("h4",{className:"text-sm font-medium text-blue-800 dark:text-blue-200 mb-3"},"NDPC Approval Required"),e.createElement("p",{className:"text-xs text-blue-700 dark:text-blue-300 mb-3"},"The selected transfer mechanism requires approval from the Nigeria Data Protection Commission."),e.createElement("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4"},e.createElement("div",{className:"flex items-center gap-2"},e.createElement("input",{type:"checkbox",id:"ndpcApprovalApplied",checked:t.ndpcApprovalApplied,onChange:s=>l("ndpcApprovalApplied",s.target.checked),className:"h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"}),e.createElement("label",{htmlFor:"ndpcApprovalApplied",className:"text-sm"},"Application submitted")),e.createElement("div",{className:"flex items-center gap-2"},e.createElement("input",{type:"checkbox",id:"ndpcApprovalApproved",checked:t.ndpcApprovalApproved,onChange:s=>l("ndpcApprovalApproved",s.target.checked),className:"h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"}),e.createElement("label",{htmlFor:"ndpcApprovalApproved",className:"text-sm"},"Approval granted")),e.createElement("div",{className:"md:col-span-2"},e.createElement("label",{className:"block text-sm font-medium mb-1"},"NDPC Reference Number"),e.createElement("input",{type:"text",value:t.ndpcApprovalReference,onChange:s=>l("ndpcApprovalReference",s.target.value),placeholder:"Reference number (if available)",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-blue-500"})))),J&&e.createElement("div",{className:"mt-4 p-4 bg-gray-100 dark:bg-gray-600 rounded-md"},e.createElement("h4",{className:"text-sm font-medium mb-3"},"Transfer Impact Assessment"),e.createElement("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4"},e.createElement("div",{className:"flex items-center gap-2"},e.createElement("input",{type:"checkbox",id:"tiaCompleted",checked:t.tiaCompleted,onChange:s=>l("tiaCompleted",s.target.checked),className:"h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"}),e.createElement("label",{htmlFor:"tiaCompleted",className:"text-sm"},"TIA completed")),e.createElement("div",null,e.createElement("label",{className:"block text-sm font-medium mb-1"},"TIA Reference"),e.createElement("input",{type:"text",value:t.tiaReference,onChange:s=>l("tiaReference",s.target.value),placeholder:"Document reference",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-blue-500"})))),e.createElement("div",{className:"mt-4 flex justify-end gap-3"},e.createElement("button",{onClick:()=>{N(),g(false);},className:"px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-md text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-600"},"Cancel"),e.createElement("button",{onClick:te,className:`px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 ${h}`},b$2?"Update Transfer":"Add Transfer")))},ie=a=>{var d$1,p;let s=d(a),r=c(a);return e.createElement("div",null,e.createElement("div",{className:"flex justify-between items-start mb-4"},e.createElement("h3",{className:"text-lg font-medium"},a.destinationCountry," \u2014 ",a.recipientOrganization),e.createElement("div",{className:"flex gap-2"},B(a.status),_(a.riskLevel))),!r.isValid&&e.createElement("div",{className:"mb-4 bg-red-50 dark:bg-red-900/20 p-3 rounded-md"},e.createElement("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1"},"Compliance Issues"),e.createElement("ul",{className:"list-disc list-inside text-sm text-red-700 dark:text-red-300"},r.errors.map((n,i)=>e.createElement("li",{key:i},n)))),r.warnings.length>0&&e.createElement("div",{className:"mb-4 bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md"},e.createElement("p",{className:"text-sm font-medium text-yellow-800 dark:text-yellow-200 mb-1"},"Warnings"),e.createElement("ul",{className:"list-disc list-inside text-sm text-yellow-700 dark:text-yellow-300"},r.warnings.map((n,i)=>e.createElement("li",{key:i},n)))),e.createElement("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"},e.createElement("div",null,e.createElement("p",{className:"text-sm"},e.createElement("span",{className:"font-medium"},"Destination:")," ",a.destinationCountry,a.destinationCountryCode?` (${a.destinationCountryCode})`:""),e.createElement("p",{className:"text-sm"},e.createElement("span",{className:"font-medium"},"Adequacy:")," ",(d$1=$.find(n=>n.value===a.adequacyStatus))==null?void 0:d$1.label),e.createElement("p",{className:"text-sm"},e.createElement("span",{className:"font-medium"},"Frequency:")," ",(p=U.find(n=>n.value===a.frequency))==null?void 0:p.label),e.createElement("p",{className:"text-sm"},e.createElement("span",{className:"font-medium"},"Start Date:")," ",f(a.startDate)),a.endDate&&e.createElement("p",{className:"text-sm"},e.createElement("span",{className:"font-medium"},"End Date:")," ",f(a.endDate)),a.reviewDate&&e.createElement("p",{className:"text-sm"},e.createElement("span",{className:"font-medium"},"Next Review:")," ",f(a.reviewDate))),e.createElement("div",null,e.createElement("p",{className:"text-sm"},e.createElement("span",{className:"font-medium"},"Recipient:")," ",a.recipientOrganization),e.createElement("p",{className:"text-sm"},e.createElement("span",{className:"font-medium"},"Contact:")," ",a.recipientContact.name," (",a.recipientContact.email,")"),a.estimatedDataSubjects&&e.createElement("p",{className:"text-sm"},e.createElement("span",{className:"font-medium"},"Data Subjects:")," ",a.estimatedDataSubjects.toLocaleString()),e.createElement("p",{className:"text-sm"},e.createElement("span",{className:"font-medium"},"Sensitive Data:")," ",a.includesSensitiveData?"Yes":"No"))),e.createElement("div",{className:"mb-4"},e.createElement("p",{className:"text-sm font-medium mb-1"},"Transfer Mechanism"),e.createElement("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md"},e.createElement("p",{className:"text-sm text-gray-700 dark:text-gray-200"},b(a.transferMechanism)))),e.createElement("div",{className:"mb-4"},e.createElement("p",{className:"text-sm font-medium mb-1"},"Purpose"),e.createElement("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md"},a.purpose)),e.createElement("div",{className:"mb-4"},e.createElement("p",{className:"text-sm font-medium mb-1"},"Data Categories"),e.createElement("div",{className:"flex flex-wrap gap-1"},a.dataCategories.map((n,i)=>e.createElement("span",{key:i,className:"px-2 py-1 bg-gray-100 dark:bg-gray-600 rounded text-xs"},n)))),e.createElement("div",{className:"mb-4"},e.createElement("p",{className:"text-sm font-medium mb-1"},"Safeguards"),e.createElement("ul",{className:"list-disc list-inside text-sm text-gray-600 dark:text-gray-300"},a.safeguards.map((n,i)=>e.createElement("li",{key:i},n)))),e.createElement("div",{className:"mb-4"},e.createElement("p",{className:"text-sm font-medium mb-1"},"Risk Assessment"),e.createElement("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md"},e.createElement("p",{className:"text-sm text-gray-700 dark:text-gray-200 mb-2"},a.riskAssessment),e.createElement("div",{className:"mt-2"},e.createElement("p",{className:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-1"},"Automated Assessment (Score: ",s.riskScore,")"),s.factors.length>0&&e.createElement("ul",{className:"list-disc list-inside text-xs text-gray-500 dark:text-gray-400"},s.factors.map((n,i)=>e.createElement("li",{key:i},n))),s.recommendations.length>0&&e.createElement("div",{className:"mt-2"},e.createElement("p",{className:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-1"},"Recommendations:"),e.createElement("ul",{className:"list-disc list-inside text-xs text-gray-500 dark:text-gray-400"},s.recommendations.map((n,i)=>e.createElement("li",{key:i},n))))))),a.ndpcApproval&&e.createElement("div",{className:"mb-4"},e.createElement("p",{className:"text-sm font-medium mb-1"},"NDPC Approval"),e.createElement("div",{className:`p-3 rounded-md ${a.ndpcApproval.approved?"bg-green-50 dark:bg-green-900/20":a.ndpcApproval.applied?"bg-yellow-50 dark:bg-yellow-900/20":"bg-red-50 dark:bg-red-900/20"}`},e.createElement("p",{className:"text-sm"},e.createElement("span",{className:"font-medium"},"Status:")," ",a.ndpcApproval.approved?"Approved":a.ndpcApproval.applied?"Application Submitted":"Not Applied"),a.ndpcApproval.referenceNumber&&e.createElement("p",{className:"text-sm"},e.createElement("span",{className:"font-medium"},"Reference:")," ",a.ndpcApproval.referenceNumber),a.ndpcApproval.appliedAt&&e.createElement("p",{className:"text-sm"},e.createElement("span",{className:"font-medium"},"Applied:")," ",f(a.ndpcApproval.appliedAt)),a.ndpcApproval.approvedAt&&e.createElement("p",{className:"text-sm"},e.createElement("span",{className:"font-medium"},"Approved:")," ",f(a.ndpcApproval.approvedAt)))),e.createElement("div",{className:"mb-4"},e.createElement("p",{className:"text-sm font-medium mb-1"},"Transfer Impact Assessment"),e.createElement("div",{className:`p-3 rounded-md ${a.tiaCompleted?"bg-green-50 dark:bg-green-900/20":"bg-yellow-50 dark:bg-yellow-900/20"}`},e.createElement("p",{className:"text-sm"},e.createElement("span",{className:"font-medium"},"Status:")," ",a.tiaCompleted?"Completed":"Not Completed"),a.tiaReference&&e.createElement("p",{className:"text-sm"},e.createElement("span",{className:"font-medium"},"Reference:")," ",a.tiaReference))),e.createElement("div",{className:"flex gap-3 mt-6"},e.createElement("button",{onClick:()=>ae(a),className:`px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 ${h}`},"Edit"),e.createElement("button",{onClick:()=>re(a.id),className:"px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700"},"Remove")))};return e.createElement("div",{className:`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${G}`},e.createElement("h2",{className:"text-xl font-bold mb-2"},Q),e.createElement("p",{className:"mb-6 text-gray-600 dark:text-gray-300"},W),K&&ne(),!F&&e.createElement("div",{className:"mb-6"},e.createElement("button",{onClick:ee,className:`px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 ${h}`},"Add Transfer")),F&&de(),e.createElement("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-2 gap-4"},e.createElement("div",null,e.createElement("label",{htmlFor:"cbStatusFilter",className:"block text-sm font-medium mb-1"},"Status Filter"),e.createElement("select",{id:"cbStatusFilter",value:x,onChange:a=>X(a.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-blue-500"},e.createElement("option",{value:"all"},"All Statuses"),V.map(a=>e.createElement("option",{key:a.value,value:a.value},a.label)))),e.createElement("div",null,e.createElement("label",{htmlFor:"cbMechanismFilter",className:"block text-sm font-medium mb-1"},"Mechanism Filter"),e.createElement("select",{id:"cbMechanismFilter",value:y,onChange:a=>Z(a.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-blue-500"},e.createElement("option",{value:"all"},"All Mechanisms"),T.map(a=>e.createElement("option",{key:a.value,value:a.value},a.label))))),e.createElement("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6"},e.createElement("div",{className:"md:col-span-1"},e.createElement("h3",{className:"text-lg font-medium mb-3"},"Transfers"),v.length===0?e.createElement("p",{className:"text-gray-500 dark:text-gray-400 text-sm"},"No cross-border transfers found."):e.createElement("div",{className:"space-y-2 max-h-96 overflow-y-auto pr-2"},v.map(a=>{var s,r;return e.createElement("div",{key:a.id,className:`p-3 rounded-md cursor-pointer ${u===a.id?"bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800":"bg-gray-50 dark:bg-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600"}`,onClick:()=>C(a.id)},e.createElement("div",{className:"flex justify-between items-start mb-1"},e.createElement("h4",{className:"font-medium text-sm"},a.destinationCountry),_(a.riskLevel)),e.createElement("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-1"},a.recipientOrganization),e.createElement("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-1"},le(a.transferMechanism)),e.createElement("div",{className:"flex justify-between items-center mt-2"},B(a.status),((s=a.ndpcApproval)==null?void 0:s.required)&&!((r=a.ndpcApproval)!=null&&r.approved)&&e.createElement("span",{className:"text-xs text-purple-600 dark:text-purple-400"},"NDPC Pending")))}))),e.createElement("div",{className:"md:col-span-2"},I?ie(I):e.createElement("div",{className:"flex items-center justify-center h-64 bg-gray-50 dark:bg-gray-700 rounded-md"},e.createElement("p",{className:"text-gray-500 dark:text-gray-400"},"Select a transfer to view details")))))};export{ue as a};//# sourceMappingURL=chunk-2XHD22J7.mjs.map
7
- //# sourceMappingURL=chunk-2XHD22J7.mjs.map
@@ -1,94 +0,0 @@
1
- 'use strict';var chunkPM7CMTMB_js=require('./chunk-PM7CMTMB.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),t=require('react');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var t__default=/*#__PURE__*/_interopDefault(t);var ae=({sections:g,variables:E,onGenerate:v,title:T="NDPA Privacy Policy Generator",description:D="Generate an NDPA-compliant privacy policy for your organization.",className:q="",buttonClassName:k="",generateButtonText:V="Generate Policy",showPreview:$=true,allowEditing:A=true})=>{let[w,O]=t.useState(g),[N,S]=t.useState(E),[x,y]=t.useState("sections"),[f,W]=t.useState(""),[P,h]=t.useState(""),[j,H]=t.useState(false),[u,U]=t.useState({});t.useEffect(()=>{O(g);},[g]),t.useEffect(()=>{S(E);},[E]);let n=a=>{O(d=>d.map(s=>s.id===a?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},s),{included:!s.included}):s));},l=(a,d)=>{S(s=>s.map(m=>m.id===a?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},m),{value:d}):m)),u[a]&&U(s=>{let m=chunkMQFZHA2D_js.a({},s);return delete m[a],m});},c=()=>{let a={},d=true;return N.forEach(s=>{s.required&&!s.value&&(a[s.id]=`${s.name} is required`,d=false);}),U(a),d},p=()=>{if(!c()){y("variables");return}let a=w.filter(m=>m.included),d=Object.fromEntries(N.map(m=>[m.name,m.value])),s="";a.forEach(m=>{s+=`## ${m.title}
2
-
3
- `,s+=chunkPM7CMTMB_js.a(m.template,d),s+=`
4
-
5
- `;}),W(s),h(s),H(true),y("preview");},L=()=>{v({sections:w,variables:N,content:A?P:f});},M=()=>t__default.default.createElement("div",{className:"space-y-4"},t__default.default.createElement("h3",{className:"text-lg font-medium mb-4"},"Select Policy Sections"),w.map(a=>t__default.default.createElement("div",{key:a.id,className:"border border-gray-200 dark:border-gray-700 rounded-md p-4"},t__default.default.createElement("div",{className:"flex items-start"},t__default.default.createElement("div",{className:"flex items-center h-5"},t__default.default.createElement("input",{id:`section-${a.id}`,type:"checkbox",checked:a.included,onChange:()=>n(a.id),disabled:a.required,className:"w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"})),t__default.default.createElement("div",{className:"ml-3 text-sm"},t__default.default.createElement("label",{htmlFor:`section-${a.id}`,className:"font-medium text-gray-900 dark:text-white"},a.title," ",a.required&&t__default.default.createElement("span",{className:"text-red-500"},"*")),a.description&&t__default.default.createElement("p",{className:"text-gray-500 dark:text-gray-400 mt-1"},a.description))))),t__default.default.createElement("div",{className:"mt-6"},t__default.default.createElement("button",{onClick:()=>y("variables"),className:`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${k}`},"Next: Fill Variables"))),B=()=>{let a={};return N.forEach(d=>{let s=d.id.split(".")[0];a[s]||(a[s]=[]),a[s].push(d);}),t__default.default.createElement("div",null,t__default.default.createElement("h3",{className:"text-lg font-medium mb-4"},"Fill Policy Variables"),t__default.default.createElement("div",{className:"space-y-6"},Object.entries(a).map(([d,s])=>{let m=w.find(e=>e.id===d);return m&&!m.included?null:t__default.default.createElement("div",{key:d,className:"border border-gray-200 dark:border-gray-700 rounded-md p-4"},t__default.default.createElement("h4",{className:"font-medium text-lg mb-3"},m?m.title:"General Information"),t__default.default.createElement("div",{className:"space-y-4"},s.map(e=>t__default.default.createElement("div",{key:e.id},t__default.default.createElement("label",{htmlFor:`var-${e.id}`,className:"block text-sm font-medium mb-1"},e.name," ",e.required&&t__default.default.createElement("span",{className:"text-red-500"},"*")),e.description&&t__default.default.createElement("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-2"},e.description),e.inputType==="textarea"?t__default.default.createElement("textarea",{id:`var-${e.id}`,value:e.value,onChange:i=>l(e.id,i.target.value),rows:4,className:`w-full px-3 py-2 border ${u[e.id]?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-blue-500"} rounded-md focus:outline-none focus:ring-2`,required:e.required}):e.inputType==="select"&&e.options?t__default.default.createElement("select",{id:`var-${e.id}`,value:e.value,onChange:i=>l(e.id,i.target.value),className:`w-full px-3 py-2 border ${u[e.id]?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-blue-500"} rounded-md focus:outline-none focus:ring-2`,required:e.required},t__default.default.createElement("option",{value:""},"Select an option"),e.options.map(i=>t__default.default.createElement("option",{key:i,value:i},i))):t__default.default.createElement("input",{id:`var-${e.id}`,type:e.inputType,value:e.value,onChange:i=>l(e.id,i.target.value),className:`w-full px-3 py-2 border ${u[e.id]?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-blue-500"} rounded-md focus:outline-none focus:ring-2`,required:e.required}),u[e.id]&&t__default.default.createElement("p",{className:"mt-1 text-sm text-red-600 dark:text-red-500"},u[e.id])))))})),t__default.default.createElement("div",{className:"mt-6 flex space-x-4"},t__default.default.createElement("button",{onClick:()=>y("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 ${k}`},"Back to Sections"),t__default.default.createElement("button",{onClick:p,className:`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${k}`},V)))},Y=()=>t__default.default.createElement("div",null,t__default.default.createElement("h3",{className:"text-lg font-medium mb-4"},"Preview Generated Policy"),A?t__default.default.createElement("div",{className:"mb-4"},t__default.default.createElement("label",{htmlFor:"policy-content",className:"block text-sm font-medium mb-1"},"Edit Policy Content"),t__default.default.createElement("textarea",{id:"policy-content",value:P,onChange:a=>h(a.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-blue-500 font-mono text-sm"})):t__default.default.createElement("div",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md mb-4"},t__default.default.createElement("div",{className:"prose dark:prose-invert max-w-none"},f.split(`
6
- `).map((a,d)=>a.startsWith("## ")?t__default.default.createElement("h2",{key:d,className:"text-xl font-bold mt-6 mb-3"},a.substring(3)):a.startsWith("### ")?t__default.default.createElement("h3",{key:d,className:"text-lg font-bold mt-4 mb-2"},a.substring(4)):a===""?t__default.default.createElement("br",{key:d}):t__default.default.createElement("p",{key:d,className:"mb-2"},a)))),t__default.default.createElement("div",{className:"mt-6 flex space-x-4"},t__default.default.createElement("button",{onClick:()=>y("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 ${k}`},"Back to Variables"),t__default.default.createElement("button",{onClick:L,className:`px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${k}`},"Save Policy"))),z=()=>{switch(x){case "sections":return M();case "variables":return B();case "preview":return Y();default:return M()}};return t__default.default.createElement("div",{className:`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${q}`},t__default.default.createElement("h2",{className:"text-xl font-bold mb-2"},T),t__default.default.createElement("p",{className:"mb-6 text-gray-600 dark:text-gray-300"},D),t__default.default.createElement("div",{className:"mb-8"},t__default.default.createElement("ol",{className:"flex items-center w-full"},t__default.default.createElement("li",{className:`flex w-full items-center ${x==="sections"?"text-blue-600 dark:text-blue-500":"text-gray-500 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`},t__default.default.createElement("span",{className:`flex items-center justify-center w-8 h-8 ${x==="sections"?"bg-blue-100 dark:bg-blue-800":"bg-gray-100 dark:bg-gray-700"} rounded-full shrink-0`},"1"),t__default.default.createElement("span",{className:"hidden sm:inline-flex sm:ml-2"},"Sections")),t__default.default.createElement("li",{className:`flex w-full items-center ${x==="variables"?"text-blue-600 dark:text-blue-500":"text-gray-500 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`},t__default.default.createElement("span",{className:`flex items-center justify-center w-8 h-8 ${x==="variables"?"bg-blue-100 dark:bg-blue-800":"bg-gray-100 dark:bg-gray-700"} rounded-full shrink-0`},"2"),t__default.default.createElement("span",{className:"hidden sm:inline-flex sm:ml-2"},"Variables")),t__default.default.createElement("li",{className:`flex items-center ${x==="preview"?"text-blue-600 dark:text-blue-500":"text-gray-500 dark:text-gray-400"}`},t__default.default.createElement("span",{className:`flex items-center justify-center w-8 h-8 ${x==="preview"?"bg-blue-100 dark:bg-blue-800":"bg-gray-100 dark:bg-gray-700"} rounded-full shrink-0`},"3"),t__default.default.createElement("span",{className:"hidden sm:inline-flex sm:ml-2"},"Preview")))),t__default.default.createElement("div",{className:"mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md"},t__default.default.createElement("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2"},"NDPA Compliance Notice"),t__default.default.createElement("p",{className:"text-blue-700 dark:text-blue-300 text-sm"},"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.")),z())};var ne=({content:g,sections:E,variables:v,onExport:T,onEdit:D,title:q="Privacy Policy Preview",description:k="Preview your NDPA-compliant privacy policy before exporting.",className:V="",buttonClassName:$="",showExportOptions:A=true,showEditButton:w=true,showTableOfContents:O=true,showMetadata:N=true,organizationName:S,lastUpdated:x=new Date})=>{let[y,f]=t.useState("preview"),P=(()=>{let n=g.split(`
7
- `),l=[];return n.forEach(c=>{if(c.startsWith("## ")){let p=c.substring(3).trim(),L=p.toLowerCase().replace(/[^a-z0-9]+/g,"-");l.push({id:L,title:p,level:2});}else if(c.startsWith("### ")){let p=c.substring(4).trim(),L=p.toLowerCase().replace(/[^a-z0-9]+/g,"-");l.push({id:L,title:p,level:3});}}),l})(),h=n=>{if(T)T(n);else if(n==="markdown"){let l=document.createElement("a"),c=new Blob([g],{type:"text/markdown"});l.href=URL.createObjectURL(c),l.download=`privacy-policy-${new Date().toISOString().split("T")[0]}.md`,document.body.appendChild(l),l.click(),document.body.removeChild(l);}},j=()=>!O||P.length===0?null:t__default.default.createElement("div",{className:"mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md"},t__default.default.createElement("h3",{className:"text-lg font-medium mb-3"},"Table of Contents"),t__default.default.createElement("ul",{className:"space-y-1"},P.map((n,l)=>t__default.default.createElement("li",{key:l,style:{marginLeft:`${(n.level-2)*1.5}rem`}},t__default.default.createElement("a",{href:`#${n.id}`,className:"text-blue-600 dark:text-blue-400 hover:underline"},n.title))))),H=()=>N?t__default.default.createElement("div",{className:"mb-6"},t__default.default.createElement("h1",{className:"text-2xl font-bold mb-2"},S?`${S} Privacy Policy`:"Privacy Policy"),t__default.default.createElement("p",{className:"text-sm text-gray-500 dark:text-gray-400"},"Last Updated: ",x.toLocaleDateString())):null,u=()=>t__default.default.createElement("div",{className:"prose dark:prose-invert max-w-none"},g.split(`
8
- `).map((n,l)=>{if(n.startsWith("## ")){let c=n.substring(3).trim(),p=c.toLowerCase().replace(/[^a-z0-9]+/g,"-");return t__default.default.createElement("h2",{id:p,key:l,className:"text-xl font-bold mt-6 mb-3"},c)}else if(n.startsWith("### ")){let c=n.substring(4).trim(),p=c.toLowerCase().replace(/[^a-z0-9]+/g,"-");return t__default.default.createElement("h3",{id:p,key:l,className:"text-lg font-bold mt-4 mb-2"},c)}else return n===""?t__default.default.createElement("br",{key:l}):t__default.default.createElement("p",{key:l,className:"mb-2"},n)})),U=()=>A?t__default.default.createElement("div",{className:"mt-6"},t__default.default.createElement("h3",{className:"text-lg font-medium mb-3"},"Export Options"),t__default.default.createElement("div",{className:"flex flex-wrap gap-3"},t__default.default.createElement("button",{onClick:()=>h("pdf"),className:`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${$}`},"Export as PDF"),t__default.default.createElement("button",{onClick:()=>h("docx"),className:`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${$}`},"Export as DOCX"),t__default.default.createElement("button",{onClick:()=>h("html"),className:`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${$}`},"Export as HTML"),t__default.default.createElement("button",{onClick:()=>h("markdown"),className:`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${$}`},"Export as Markdown"))):null;return t__default.default.createElement("div",{className:`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${V}`},t__default.default.createElement("div",{className:"flex justify-between items-start mb-6"},t__default.default.createElement("div",null,t__default.default.createElement("h2",{className:"text-xl font-bold mb-2"},q),t__default.default.createElement("p",{className:"text-gray-600 dark:text-gray-300"},k)),w&&D&&t__default.default.createElement("button",{onClick:D,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 ${$}`},"Edit Policy")),t__default.default.createElement("div",{className:"mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md"},t__default.default.createElement("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2"},"NDPA Compliance Notice"),t__default.default.createElement("p",{className:"text-blue-700 dark:text-blue-300 text-sm"},"This privacy policy has been generated to align with the Nigeria Data Protection Act (NDPA) 2023. We recommend having the final policy reviewed by a legal professional familiar with NDPA requirements before publishing it on your website or sharing it with your users.")),t__default.default.createElement("div",{className:"mb-6 border-b border-gray-200 dark:border-gray-700"},t__default.default.createElement("ul",{className:"flex flex-wrap -mb-px"},t__default.default.createElement("li",{className:"mr-2"},t__default.default.createElement("button",{onClick:()=>f("preview"),className:`inline-block p-4 ${y==="preview"?"text-blue-600 border-b-2 border-blue-600 dark:text-blue-500 dark:border-blue-500":"text-gray-500 hover:text-gray-600 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"}`},"Preview")),t__default.default.createElement("li",{className:"mr-2"},t__default.default.createElement("button",{onClick:()=>f("markdown"),className:`inline-block p-4 ${y==="markdown"?"text-blue-600 border-b-2 border-blue-600 dark:text-blue-500 dark:border-blue-500":"text-gray-500 hover:text-gray-600 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"}`},"Markdown")))),t__default.default.createElement("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-md"},y==="preview"?t__default.default.createElement("div",null,H(),j(),t__default.default.createElement("div",{className:"bg-gray-50 dark:bg-gray-700 p-6 rounded-md"},u())):t__default.default.createElement("div",null,t__default.default.createElement("pre",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md overflow-auto whitespace-pre-wrap font-mono text-sm text-gray-800 dark:text-gray-200"},g))),U())};var ce=({content:g,title:E="Privacy Policy",organizationName:v,lastUpdated:T=new Date,onExportComplete:D,componentTitle:q="Export Privacy Policy",description:k="Export your NDPA-compliant privacy policy in various formats.",className:V="",buttonClassName:$="",showExportHistory:A=true,includeComplianceNotice:w=true,includeLogo:O=false,logoUrl:N,customStyles:S})=>{let[x,y]=t.useState([]),[f,W]=t.useState("pdf"),[P,h]=t.useState(false),[j,H]=t.useState(null),[u,U]=t.useState(""),[n,l]=t.useState(""),[c,p]=t.useState(""),[L,M]=t.useState(false),B=e=>{let i=new Date().toISOString().split("T")[0];return `${v?v.toLowerCase().replace(/[^a-z0-9]+/g,"-"):"privacy-policy"}-privacy-policy-${i}.${e.toLowerCase()}`},Y=e=>u?u.endsWith(`.${e.toLowerCase()}`)?u:`${u}.${e.toLowerCase()}`:B(e),z=()=>{let e=v?`${v} ${E}`:E,i=T.toLocaleDateString(),b=`<!DOCTYPE html>
9
- <html lang="en">
10
- <head>
11
- <meta charset="UTF-8">
12
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
13
- <title>${e}</title>
14
- <style>
15
- body {
16
- font-family: Arial, sans-serif;
17
- line-height: 1.6;
18
- color: #333;
19
- max-width: 800px;
20
- margin: 0 auto;
21
- padding: 20px;
22
- }
23
- h1 {
24
- font-size: 24px;
25
- margin-bottom: 10px;
26
- }
27
- h2 {
28
- font-size: 20px;
29
- margin-top: 30px;
30
- margin-bottom: 10px;
31
- border-bottom: 1px solid #eee;
32
- padding-bottom: 5px;
33
- }
34
- h3 {
35
- font-size: 18px;
36
- margin-top: 20px;
37
- margin-bottom: 10px;
38
- }
39
- p {
40
- margin-bottom: 15px;
41
- }
42
- .header {
43
- text-align: center;
44
- margin-bottom: 30px;
45
- }
46
- .footer {
47
- margin-top: 50px;
48
- text-align: center;
49
- font-size: 12px;
50
- color: #666;
51
- border-top: 1px solid #eee;
52
- padding-top: 20px;
53
- }
54
- .logo {
55
- max-width: 200px;
56
- margin-bottom: 20px;
57
- }
58
- .last-updated {
59
- font-size: 12px;
60
- color: #666;
61
- margin-bottom: 30px;
62
- }
63
- .compliance-notice {
64
- background-color: #f8f9fa;
65
- border: 1px solid #e9ecef;
66
- padding: 15px;
67
- margin-bottom: 30px;
68
- font-size: 14px;
69
- }
70
- ${S||""}
71
- </style>
72
- </head>
73
- <body>
74
- <div class="header">
75
- ${O&&N?`<img src="${N}" alt="${v||"Company"} Logo" class="logo">`:""}
76
- ${n?`<div class="custom-header">${n}</div>`:""}
77
- <h1>${e}</h1>
78
- <div class="last-updated">Last Updated: ${i}</div>
79
- </div>`;w&&(b+=`
80
- <div class="compliance-notice">
81
- <strong>NDPA Compliance Notice:</strong> This privacy policy has been created to comply with the Nigeria Data Protection Act (NDPA) 2023.
82
- It outlines how we collect, use, disclose, and protect your personal information in accordance with NDPA requirements.
83
- </div>`);let I=g.replace(/^## (.*?)$/gm,"<h2>$1</h2>").replace(/^### (.*?)$/gm,"<h3>$1</h3>").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>");return b+=`
84
- <div class="content">
85
- <p>${I}</p>
86
- </div>
87
-
88
- <div class="footer">
89
- ${c?`<div class="custom-footer">${c}</div>`:""}
90
- <p>&copy; ${new Date().getFullYear()} ${v||"Company"}. All rights reserved.</p>
91
- </div>
92
- </body>
93
- </html>`,b},a=()=>chunkMQFZHA2D_js.d(null,null,function*(){h(true),H(null);try{let e=f.toLowerCase(),i="",b;switch(e){case "pdf":let _=z();b=new Blob([_],{type:"text/html"}),i=URL.createObjectURL(b);break;case "docx":b=new Blob([g],{type:"text/plain"}),i=URL.createObjectURL(b);break;case "html":let ee=z();b=new Blob([ee],{type:"text/html"}),i=URL.createObjectURL(b);break;case "markdown":default:b=new Blob([g],{type:"text/markdown"}),i=URL.createObjectURL(b);break}let I=Y(e),G=document.createElement("a");G.href=i,G.download=I,document.body.appendChild(G),G.click(),document.body.removeChild(G);let R={id:`export_${Date.now()}`,format:e,timestamp:Date.now(),url:i,filename:I};y(_=>[R,..._]),D&&D(e,i);}catch(e){console.error("Export error:",e),H("An error occurred during export. Please try again.");}finally{h(false);}}),d=()=>t__default.default.createElement("div",{className:"mb-6"},t__default.default.createElement("label",{htmlFor:"export-format",className:"block text-sm font-medium mb-1"},"Export Format"),t__default.default.createElement("select",{id:"export-format",value:f,onChange:i=>W(i.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"},[{value:"pdf",label:"PDF Document (.pdf)"},{value:"docx",label:"Word Document (.docx)"},{value:"html",label:"Web Page (.html)"},{value:"markdown",label:"Markdown (.md)"}].map(i=>t__default.default.createElement("option",{key:i.value,value:i.value},i.label)))),s=()=>L?t__default.default.createElement("div",{className:"mb-6 space-y-4 border border-gray-200 dark:border-gray-700 rounded-md p-4"},t__default.default.createElement("div",{className:"flex justify-between items-center"},t__default.default.createElement("h3",{className:"text-md font-medium"},"Advanced Export Options"),t__default.default.createElement("button",{type:"button",onClick:()=>M(false),className:"text-blue-600 dark:text-blue-400 text-sm"},"Hide Advanced Options")),t__default.default.createElement("div",null,t__default.default.createElement("label",{htmlFor:"custom-filename",className:"block text-sm font-medium mb-1"},"Custom Filename"),t__default.default.createElement("input",{type:"text",id:"custom-filename",value:u,onChange:e=>U(e.target.value),placeholder:B(f),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-blue-500"}),t__default.default.createElement("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1"},"Leave blank to use the default filename format.")),t__default.default.createElement("div",null,t__default.default.createElement("label",{htmlFor:"custom-header",className:"block text-sm font-medium mb-1"},"Custom Header HTML (for HTML/PDF exports)"),t__default.default.createElement("textarea",{id:"custom-header",value:n,onChange:e=>l(e.target.value),rows:3,placeholder:"<div>Custom header content</div>",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-blue-500"})),t__default.default.createElement("div",null,t__default.default.createElement("label",{htmlFor:"custom-footer",className:"block text-sm font-medium mb-1"},"Custom Footer HTML (for HTML/PDF exports)"),t__default.default.createElement("textarea",{id:"custom-footer",value:c,onChange:e=>p(e.target.value),rows:3,placeholder:"<div>Custom footer content</div>",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-blue-500"})),t__default.default.createElement("div",{className:"flex items-start"},t__default.default.createElement("div",{className:"flex items-center h-5"},t__default.default.createElement("input",{id:"include-compliance-notice",type:"checkbox",checked:w,onChange:e=>M(e.target.checked),className:"w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"})),t__default.default.createElement("div",{className:"ml-3 text-sm"},t__default.default.createElement("label",{htmlFor:"include-compliance-notice",className:"font-medium text-gray-900 dark:text-white"},"Include NDPA Compliance Notice"),t__default.default.createElement("p",{className:"text-gray-500 dark:text-gray-400"},"Adds a notice explaining that this policy complies with NDPA requirements.")))):t__default.default.createElement("button",{type:"button",onClick:()=>M(true),className:"text-blue-600 dark:text-blue-400 text-sm mb-6"},"Show Advanced Options"),m=()=>!A||x.length===0?null:t__default.default.createElement("div",{className:"mt-6"},t__default.default.createElement("h3",{className:"text-lg font-medium mb-3"},"Export History"),t__default.default.createElement("div",{className:"bg-gray-50 dark:bg-gray-700 rounded-md overflow-hidden"},t__default.default.createElement("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-600"},t__default.default.createElement("thead",{className:"bg-gray-100 dark:bg-gray-800"},t__default.default.createElement("tr",null,t__default.default.createElement("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider"},"Date"),t__default.default.createElement("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider"},"Format"),t__default.default.createElement("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider"},"Filename"),t__default.default.createElement("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider"},"Actions"))),t__default.default.createElement("tbody",{className:"bg-white dark:bg-gray-700 divide-y divide-gray-200 dark:divide-gray-600"},x.map(e=>t__default.default.createElement("tr",{key:e.id},t__default.default.createElement("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300"},new Date(e.timestamp).toLocaleString()),t__default.default.createElement("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300"},e.format.toUpperCase()),t__default.default.createElement("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300"},e.filename),t__default.default.createElement("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium"},t__default.default.createElement("a",{href:e.url,download:e.filename,className:"text-blue-600 dark:text-blue-400 hover:text-blue-900 dark:hover:text-blue-300 mr-4"},"Download"))))))));return t__default.default.createElement("div",{className:`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${V}`},t__default.default.createElement("h2",{className:"text-xl font-bold mb-2"},q),t__default.default.createElement("p",{className:"mb-6 text-gray-600 dark:text-gray-300"},k),d(),s(),t__default.default.createElement("div",{className:"mb-6"},t__default.default.createElement("button",{onClick:a,disabled:P,className:`px-6 py-3 bg-blue-600 text-white rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 ${$} ${P?"opacity-70 cursor-not-allowed":""}`},P?"Exporting...":`Export as ${f.toUpperCase()}`),j&&t__default.default.createElement("p",{className:"mt-2 text-sm text-red-600 dark:text-red-500"},j)),t__default.default.createElement("div",{className:"mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md"},t__default.default.createElement("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2"},"Export Tips"),t__default.default.createElement("ul",{className:"text-blue-700 dark:text-blue-300 text-sm list-disc list-inside space-y-1"},t__default.default.createElement("li",null,"PDF format is recommended for printing or sharing with stakeholders."),t__default.default.createElement("li",null,"HTML format is ideal for publishing on your website."),t__default.default.createElement("li",null,"DOCX format allows for further editing in Microsoft Word or similar applications."),t__default.default.createElement("li",null,"Markdown format is useful for version control systems or technical documentation."))),m())};exports.a=ae;exports.b=ne;exports.c=ce;//# sourceMappingURL=chunk-4DKT6IB6.js.map
94
- //# sourceMappingURL=chunk-4DKT6IB6.js.map
@@ -1,2 +0,0 @@
1
- import {a}from'./chunk-2SYNHRP6.mjs';import {b,a as a$1}from'./chunk-WWT2ZSNU.mjs';import e,{useState,useEffect}from'react';var ae=({requestTypes:f,onSubmit:P,title:O="Submit a Data Subject Request",description:M="Use this form to exercise your rights under the Nigeria Data Protection Act (NDPA).",submitButtonText:H="Submit Request",className:K="",buttonClassName:_="",showConfirmation:B=true,confirmationMessage:W="Your request has been submitted successfully. You will receive a confirmation email shortly.",requireIdentityVerification:U=true,identifierTypes:F=[{id:"email",label:"Email Address"},{id:"account",label:"Account Number"},{id:"customer_id",label:"Customer ID"}],collectAdditionalContact:A=true,labels:y={}})=>{var m;let[p,N]=useState(""),[T,j]=useState(""),[k,C]=useState(""),[$,w]=useState(""),[I,V]=useState(((m=F[0])==null?void 0:m.id)||""),[E,L]=useState(""),[h,v]=useState({}),[z,Y]=useState(false),[x,G]=useState({}),g=f.find(t=>t.id===p),J=t=>{N(t.target.value),v({});},l=(t,o)=>{v(u=>b(a$1({},u),{[t]:o}));},a=()=>{let t={};return T.trim()||(t.fullName="Full name is required"),k.trim()?/\S+@\S+\.\S+/.test(k)||(t.email="Email is invalid"):t.email="Email is required",p||(t.requestType="Please select a request type"),U&&!E.trim()&&(t.identifierValue="Identifier value is required"),g!=null&&g.requiresAdditionalInfo&&g.additionalFields&&g.additionalFields.forEach(o=>{o.required&&!h[o.id]&&(t[`additional_${o.id}`]=`${o.label} is required`);}),G(t),Object.keys(t).length===0},n=t=>{if(t.preventDefault(),!a())return;let o={requestType:p,dataSubject:{fullName:T,email:k,phone:$||void 0,identifierType:I,identifierValue:E},additionalInfo:Object.keys(h).length>0?h:void 0,submittedAt:Date.now()};P(o),B&&Y(true);};return z?e.createElement("div",{className:`p-4 bg-green-50 dark:bg-green-900/20 rounded-md ${K}`},e.createElement("h2",{className:"text-lg font-bold text-green-800 dark:text-green-200 mb-2"},"Request Submitted"),e.createElement("p",{className:"text-green-700 dark:text-green-300"},W),e.createElement("button",{onClick:()=>Y(false),className:`mt-4 px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${_}`},"Submit Another Request")):e.createElement("div",{className:`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${K}`},e.createElement("h2",{className:"text-xl font-bold mb-2"},O),e.createElement("p",{className:"mb-6 text-gray-600 dark:text-gray-300"},M),e.createElement("form",{onSubmit:n},e.createElement("div",{className:"space-y-4"},e.createElement("div",null,e.createElement("h3",{className:"text-lg font-semibold mb-3"},"Personal Information"),e.createElement("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2"},e.createElement("div",null,e.createElement("label",{htmlFor:"fullName",className:"block text-sm font-medium mb-1"},y.name||"Full Name"," ",e.createElement("span",{className:"text-red-500"},"*")),e.createElement("input",{type:"text",id:"fullName",value:T,onChange:t=>j(t.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-blue-500",required:true}),x.fullName&&e.createElement("p",{className:"mt-1 text-sm text-red-500"},x.fullName)),e.createElement("div",null,e.createElement("label",{htmlFor:"email",className:"block text-sm font-medium mb-1"},y.email||"Email Address"," ",e.createElement("span",{className:"text-red-500"},"*")),e.createElement("input",{type:"email",id:"email",value:k,onChange:t=>C(t.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-blue-500",required:true}),x.email&&e.createElement("p",{className:"mt-1 text-sm text-red-500"},x.email)),A&&e.createElement("div",null,e.createElement("label",{htmlFor:"phone",className:"block text-sm font-medium mb-1"},"Phone Number (Optional)"),e.createElement("input",{type:"tel",id:"phone",value:$,onChange:t=>w(t.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-blue-500"})))),e.createElement("div",null,e.createElement("h3",{className:"text-lg font-semibold mb-3"},"Request Details"),e.createElement("div",{className:"mb-4"},e.createElement("label",{htmlFor:"requestType",className:"block text-sm font-medium mb-1"},y.requestType||"Request Type"," ",e.createElement("span",{className:"text-red-500"},"*")),e.createElement("select",{id:"requestType",value:p,onChange:J,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-blue-500",required:true},e.createElement("option",{value:""},"Select a request type"),f.map(t=>e.createElement("option",{key:t.id,value:t.id},t.name))),x.requestType&&e.createElement("p",{className:"mt-1 text-sm text-red-500"},x.requestType)),g&&e.createElement("div",{className:"mb-4 p-3 bg-gray-50 dark:bg-gray-700 rounded-md"},e.createElement("p",{className:"text-sm text-gray-600 dark:text-gray-300 mb-2"},g.description),e.createElement("p",{className:"text-sm text-gray-500 dark:text-gray-400"},"Estimated completion time: ",g.estimatedCompletionTime," ",g.estimatedCompletionTime===1?"day":"days")),e.createElement("div",{className:"mb-4"},e.createElement("label",{htmlFor:"requestDescription",className:"block text-sm font-medium mb-1"},y.description||"Additional Information"),e.createElement("textarea",{id:"requestDescription",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-blue-500",rows:4,placeholder:"Please provide any additional details that might help us process your request"}))),U&&e.createElement("div",null,e.createElement("h3",{className:"text-lg font-semibold mb-3"},"Identity Verification"),e.createElement("p",{className:"text-sm text-gray-600 dark:text-gray-300 mb-3"},"To protect your privacy, we need to verify your identity before processing your request."),e.createElement("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2"},e.createElement("div",null,e.createElement("label",{htmlFor:"identifierType",className:"block text-sm font-medium mb-1"},"Identifier Type ",e.createElement("span",{className:"text-red-500"},"*")),e.createElement("select",{id:"identifierType",value:I,onChange:t=>V(t.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-blue-500",required:true},F.map(t=>e.createElement("option",{key:t.id,value:t.id},t.label)))),e.createElement("div",null,e.createElement("label",{htmlFor:"identifierValue",className:"block text-sm font-medium mb-1"},"Identifier Value ",e.createElement("span",{className:"text-red-500"},"*")),e.createElement("input",{type:"text",id:"identifierValue",value:E,onChange:t=>L(t.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-blue-500",required:true}),x.identifierValue&&e.createElement("p",{className:"mt-1 text-sm text-red-500"},x.identifierValue)))),(g==null?void 0:g.requiresAdditionalInfo)&&g.additionalFields&&g.additionalFields.length>0&&e.createElement("div",null,e.createElement("h3",{className:"text-lg font-semibold mb-3"},"Additional Information"),e.createElement("div",{className:"space-y-4"},g.additionalFields.map(t=>e.createElement("div",{key:t.id},e.createElement("label",{htmlFor:t.id,className:"block text-sm font-medium mb-1"},t.label," ",t.required&&e.createElement("span",{className:"text-red-500"},"*")),t.type==="text"&&e.createElement("input",{type:"text",id:t.id,value:h[t.id]||"",onChange:o=>l(t.id,o.target.value),placeholder:t.placeholder,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-blue-500",required:t.required}),t.type==="textarea"&&e.createElement("textarea",{id:t.id,value:h[t.id]||"",onChange:o=>l(t.id,o.target.value),placeholder:t.placeholder,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-blue-500",rows:4,required:t.required}),t.type==="select"&&t.options&&e.createElement("select",{id:t.id,value:h[t.id]||"",onChange:o=>l(t.id,o.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-blue-500",required:t.required},e.createElement("option",{value:""},t.placeholder||"Select an option"),t.options.map(o=>e.createElement("option",{key:o,value:o},o))),t.type==="checkbox"&&e.createElement("div",{className:"flex items-start"},e.createElement("div",{className:"flex items-center h-5"},e.createElement("input",{type:"checkbox",id:t.id,checked:!!h[t.id],onChange:o=>l(t.id,o.target.checked),className:"h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500",required:t.required})),e.createElement("div",{className:"ml-3 text-sm"},e.createElement("label",{htmlFor:t.id,className:"text-gray-700 dark:text-gray-300"},t.placeholder||t.label))),t.type==="file"&&e.createElement("input",{type:"file",id:t.id,onChange:o=>{var b;let u=(b=o.target.files)==null?void 0:b[0];u&&l(t.id,u);},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-blue-500",required:t.required}),x[`additional_${t.id}`]&&e.createElement("p",{className:"mt-1 text-sm text-red-500"},x[`additional_${t.id}`]))))),e.createElement("div",{className:"mt-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md"},e.createElement("h3",{className:"text-sm font-semibold mb-2"},"Privacy Notice"),e.createElement("p",{className:"text-xs text-gray-600 dark:text-gray-300"},"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.")),e.createElement("div",{className:"mt-6"},e.createElement("button",{type:"submit",className:`px-6 py-3 bg-blue-600 text-white rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 ${_}`},y.submit||H)))))};var ne=({requests:f,onSelectRequest:P,onUpdateStatus:O,onAssignRequest:M,title:H="Data Subject Request Dashboard",description:K="Track and manage data subject requests in compliance with NDPA requirements.",className:_="",buttonClassName:B="",showRequestDetails:W=true,showRequestTimeline:U=true,showDeadlineAlerts:F=true,assignees:A=[]})=>{let[y,p]=useState(null),[N,T]=useState(f),[j,k]=useState("all"),[C,$]=useState("all"),[w,I]=useState(""),[V,E]=useState("createdAt"),[L,h]=useState("desc"),[v,z]=useState("");useEffect(()=>{let s=[...f];if(j!=="all"&&(s=s.filter(d=>d.status===j)),C!=="all"&&(s=s.filter(d=>d.type===C)),w){let d=w.toLowerCase();s=s.filter(c=>c.subject.name.toLowerCase().includes(d)||c.subject.email.toLowerCase().includes(d)||c.description&&c.description.toLowerCase().includes(d));}s.sort((d,c)=>{let D=0;switch(V){case "createdAt":D=d.createdAt-c.createdAt;break;case "dueDate":D=(d.dueDate||0)-(c.dueDate||0);break;case "type":D=d.type.localeCompare(c.type);break;case "status":D=d.status.localeCompare(c.status);break;default:D=d.createdAt-c.createdAt;}return L==="asc"?D:-D}),T(s);},[f,j,C,w,V,L]),useEffect(()=>{N.length>0&&!y&&p(N[0].id);},[N,y]);let Y=s=>{p(s),P&&P(s);},x=s=>{y&&O&&O(y,s);},G=()=>{y&&v&&M&&(M(y,v),z(""));},g=s=>new Date(s).toLocaleDateString(),J=s=>{let d=Date.now(),c=(s-d)/(1440*60*1e3);return Math.ceil(c)},l=y?f.find(s=>s.id===y):null,a$1=s=>{let d={information:"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200",access:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",rectification:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",erasure:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",restriction:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",portability:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",objection:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",automated_decision_making:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200"},c={information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making"};return e.createElement("span",{className:`px-2 py-1 rounded text-xs font-medium ${d[s]}`},c[s])},n=s=>e.createElement("span",{className:`px-2 py-1 rounded text-xs font-medium ${{pending:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",inProgress:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",completed:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",rejected:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",awaitingVerification:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200"}[s]}`},s==="inProgress"?"In Progress":s==="awaitingVerification"?"Awaiting Verification":s.charAt(0).toUpperCase()+s.slice(1)),m=s=>{if(!s.dueDate)return null;let d=J(s.dueDate);return d<=0?e.createElement("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md"},e.createElement("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium"},"Deadline Passed"),e.createElement("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1"},"The response deadline has passed. Immediate action is required.")):d<=3?e.createElement("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md"},e.createElement("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium"},"Urgent: Deadline Approaching"),e.createElement("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1"},"Only ",d," day",d!==1?"s":""," remaining until the response deadline.")):d<=7?e.createElement("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md"},e.createElement("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium"},"Deadline Approaching"),e.createElement("p",{className:"text-xs text-yellow-700 dark:text-yellow-300 mt-1"},d," days remaining until the response deadline.")):e.createElement("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md"},e.createElement("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium"},"Deadline Tracking"),e.createElement("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1"},d," days remaining until the response deadline."))},t=s=>{let d=[{title:"Request Received",date:s.createdAt,completed:true,description:`Request was received on ${g(s.createdAt)}.`}];return s.verifiedAt?d.push({title:"Identity Verified",date:s.verifiedAt,completed:true,description:`Data subject's identity was verified on ${g(s.verifiedAt)}.`}):s.status==="awaitingVerification"&&d.push({title:"Identity Verification",date:Date.now(),completed:false,description:"Awaiting verification of data subject's identity."}),(s.status==="inProgress"||s.status==="completed"||s.status==="rejected")&&d.push({title:"Processing Started",date:s.updatedAt,completed:true,description:`Request processing started on ${g(s.updatedAt)}.`}),s.status==="completed"?d.push({title:"Request Completed",date:s.completedAt||Date.now(),completed:true,description:`Request was completed on ${g(s.completedAt||Date.now())}.`}):s.status==="rejected"&&d.push({title:"Request Rejected",date:s.completedAt||Date.now(),completed:true,description:`Request was rejected on ${g(s.completedAt||Date.now())}.${s.rejectionReason?` Reason: ${s.rejectionReason}`:""}`}),s.dueDate&&d.push({title:"Response Deadline",date:s.dueDate,completed:Date.now()>s.dueDate,description:`Response is due by ${g(s.dueDate)}.`}),e.createElement("div",{className:"mt-6"},e.createElement("h3",{className:"text-lg font-medium mb-4"},"Request Timeline"),e.createElement("ol",{className:"relative border-l border-gray-200 dark:border-gray-700"},d.map((c,D)=>e.createElement("li",{key:D,className:"mb-6 ml-4"},e.createElement("div",{className:`absolute w-3 h-3 rounded-full mt-1.5 -left-1.5 border ${c.completed?"bg-green-500 border-green-500 dark:border-green-500":"bg-gray-200 border-gray-200 dark:bg-gray-700 dark:border-gray-700"}`}),e.createElement("time",{className:"mb-1 text-sm font-normal leading-none text-gray-400 dark:text-gray-500"},c.date?g(c.date):"Pending"),e.createElement("h4",{className:"text-sm font-semibold text-gray-900 dark:text-white"},c.title),e.createElement("p",{className:"text-xs text-gray-500 dark:text-gray-400"},c.description)))))},o=()=>[{value:"all",label:"All Types"},{value:"information",label:"Information (NDPA Section 29)"},{value:"access",label:"Access (NDPA Section 30)"},{value:"rectification",label:"Rectification (NDPA Section 31)"},{value:"erasure",label:"Erasure (NDPA Section 32)"},{value:"restriction",label:"Restriction (NDPA Section 33)"},{value:"portability",label:"Portability (NDPA Section 34)"},{value:"objection",label:"Objection (NDPA Section 35)"},{value:"automated_decision_making",label:"Automated Decision-Making (NDPA Section 36)"}].map(d=>e.createElement("option",{key:d.value,value:d.value},d.label)),u=()=>[{value:"all",label:"All Statuses"},{value:"pending",label:"Pending"},{value:"awaitingVerification",label:"Awaiting Verification"},{value:"inProgress",label:"In Progress"},{value:"completed",label:"Completed"},{value:"rejected",label:"Rejected"}].map(d=>e.createElement("option",{key:d.value,value:d.value},d.label)),b=()=>[{value:"pending",label:"Pending"},{value:"awaitingVerification",label:"Awaiting Verification"},{value:"inProgress",label:"In Progress"},{value:"completed",label:"Completed"},{value:"rejected",label:"Rejected"}].map(d=>e.createElement("option",{key:d.value,value:d.value},d.label));return e.createElement("div",{className:`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${_}`},e.createElement("h2",{className:"text-xl font-bold mb-2"},H),e.createElement("p",{className:"mb-6 text-gray-600 dark:text-gray-300"},K),e.createElement("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-4 gap-4"},e.createElement("div",null,e.createElement("label",{htmlFor:"statusFilter",className:"block text-sm font-medium mb-1"},"Status Filter"),e.createElement("select",{id:"statusFilter",value:j,onChange:s=>k(s.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"},u())),e.createElement("div",null,e.createElement("label",{htmlFor:"typeFilter",className:"block text-sm font-medium mb-1"},"Request Type Filter"),e.createElement("select",{id:"typeFilter",value:C,onChange:s=>$(s.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"},o())),e.createElement("div",null,e.createElement("label",{htmlFor:"sortBy",className:"block text-sm font-medium mb-1"},"Sort By"),e.createElement("select",{id:"sortBy",value:V,onChange:s=>E(s.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"},e.createElement("option",{value:"createdAt"},"Date Received"),e.createElement("option",{value:"dueDate"},"Due Date"),e.createElement("option",{value:"type"},"Request Type"),e.createElement("option",{value:"status"},"Status"))),e.createElement("div",null,e.createElement("label",{htmlFor:"searchTerm",className:"block text-sm font-medium mb-1"},"Search"),e.createElement("input",{type:"text",id:"searchTerm",value:w,onChange:s=>I(s.target.value),placeholder:"Search requests...",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-blue-500"}))),e.createElement("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6"},e.createElement("div",{className:"md:col-span-1"},e.createElement("h3",{className:"text-lg font-medium mb-3"},"DSR Requests"),N.length===0?e.createElement("p",{className:"text-gray-500 dark:text-gray-400 text-sm"},"No data subject requests found."):e.createElement("div",{className:"space-y-2 max-h-96 overflow-y-auto pr-2"},N.map(s=>{let d=s.dueDate?J(s.dueDate):null,c=null;return d!==null&&(d<=0?c=e.createElement("span",{className:"text-xs text-red-600 dark:text-red-400 font-bold"},"Overdue"):d<=3?c=e.createElement("span",{className:"text-xs text-red-600 dark:text-red-400"},"Urgent"):d<=7&&(c=e.createElement("span",{className:"text-xs text-yellow-600 dark:text-yellow-400"},"Soon"))),e.createElement("div",{key:s.id,className:`p-3 rounded-md cursor-pointer ${y===s.id?"bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800":"bg-gray-50 dark:bg-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600"}`,onClick:()=>Y(s.id)},e.createElement("div",{className:"flex justify-between items-start mb-1"},e.createElement("h4",{className:"font-medium text-sm"},s.subject.name),a$1(s.type)),e.createElement("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-1"},s.subject.email),e.createElement("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-1"},"Received: ",g(s.createdAt)),e.createElement("div",{className:"flex justify-between items-center mt-2"},e.createElement("div",null,n(s.status)),e.createElement("div",null,c)))}))),e.createElement("div",{className:"md:col-span-2"},l?e.createElement("div",null,e.createElement("div",{className:"flex justify-between items-start mb-4"},e.createElement("h3",{className:"text-lg font-medium"},l.subject.name),e.createElement("div",{className:"flex space-x-2"},a$1(l.type),n(l.status))),F&&l.dueDate&&e.createElement("div",{className:"mb-4"},m(l)),W&&e.createElement("div",{className:"mb-6"},e.createElement("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4"},e.createElement("div",null,e.createElement("p",{className:"text-sm"},e.createElement("span",{className:"font-medium"},"Email:")," ",l.subject.email),l.subject.phone&&e.createElement("p",{className:"text-sm"},e.createElement("span",{className:"font-medium"},"Phone:")," ",l.subject.phone),e.createElement("p",{className:"text-sm"},e.createElement("span",{className:"font-medium"},"Received:")," ",g(l.createdAt))),e.createElement("div",null,e.createElement("p",{className:"text-sm"},e.createElement("span",{className:"font-medium"},"Request Type:")," ",{information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making"}[l.type]||l.type),e.createElement("p",{className:"text-sm"},e.createElement("span",{className:"font-medium"},"Status:")," ",l.status==="inProgress"?"In Progress":l.status==="awaitingVerification"?"Awaiting Verification":l.status.charAt(0).toUpperCase()+l.status.slice(1)),l.dueDate&&e.createElement("p",{className:"text-sm"},e.createElement("span",{className:"font-medium"},"Due Date:")," ",g(l.dueDate)))),l.description&&e.createElement("div",{className:"mb-4"},e.createElement("p",{className:"text-sm font-medium"},"Request Details:"),e.createElement("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1"},l.description)),l.additionalInfo&&e.createElement("div",null,e.createElement("p",{className:"text-sm font-medium"},"Additional Information:"),e.createElement("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1"},typeof l.additionalInfo=="object"?JSON.stringify(l.additionalInfo,null,2):String(l.additionalInfo||"No additional information provided")))),e.createElement("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-2 gap-4"},e.createElement("div",null,e.createElement("h3",{className:"text-md font-medium mb-2"},"Update Status"),e.createElement("div",{className:"flex space-x-2"},e.createElement("select",{value:l.status,onChange:s=>x(s.target.value),className:"flex-grow px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"},b()),e.createElement("button",{onClick:()=>x(l.status),className:`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${B}`},"Update"))),A.length>0&&e.createElement("div",null,e.createElement("h3",{className:"text-md font-medium mb-2"},"Assign Request"),e.createElement("div",{className:"flex space-x-2"},e.createElement("select",{value:v,onChange:s=>z(s.target.value),className:"flex-grow px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"},e.createElement("option",{value:""},"Select Assignee"),A.map(s=>e.createElement("option",{key:s,value:s},s))),e.createElement("button",{onClick:G,disabled:!v,className:`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 disabled:bg-gray-300 disabled:text-gray-500 ${B}`},"Assign")))),e.createElement("div",{className:"mb-6"},e.createElement("h3",{className:"text-lg font-medium mb-3"},"Request Summary"),e.createElement("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md"},e.createElement("pre",{className:"whitespace-pre-wrap text-sm font-mono text-gray-800 dark:text-gray-200"},e.createElement("pre",null,JSON.stringify(a(l),null,2))))),U&&t(l)):e.createElement("div",{className:"flex items-center justify-center h-64 bg-gray-50 dark:bg-gray-700 rounded-md"},e.createElement("p",{className:"text-gray-500 dark:text-gray-400"},"Select a request to view details")))))};var ue=({requests:f,onSelectRequest:P,title:O="DSR Request Tracker",description:M="Track the status and progress of data subject requests.",className:H="",buttonClassName:K="",showSummaryStats:_=true,showTypeBreakdown:B=true,showStatusBreakdown:W=true,showTimelineChart:U=true,showOverdueRequests:F=true})=>{let[A,y]=useState("30days"),[p,N]=useState(f),[T,j]=useState([]),[k,C]=useState([]);useEffect(()=>{let a=Date.now(),n;switch(A){case "7days":n=f.filter(o=>a-o.createdAt<=10080*60*1e3);break;case "30days":n=f.filter(o=>a-o.createdAt<=720*60*60*1e3);break;case "90days":n=f.filter(o=>a-o.createdAt<=2160*60*60*1e3);break;default:n=[...f];}N(n);let m=n.filter(o=>o.dueDate&&a>o.dueDate&&o.status!=="completed"&&o.status!=="rejected");j(m);let t=n.filter(o=>o.dueDate&&a<o.dueDate&&o.dueDate-a<=10080*60*1e3&&o.status!=="completed"&&o.status!=="rejected");C(t);},[f,A]);let $=a=>{P&&P(a);},w=a=>new Date(a).toLocaleDateString(),I=a=>{let n=Date.now(),m=(a-n)/(1440*60*1e3);return Math.ceil(m)},V=()=>{let a=p.filter(m=>m.status==="completed"&&m.completedAt&&m.createdAt);if(a.length===0)return null;let n=a.reduce((m,t)=>{let o=((t.completedAt||0)-t.createdAt)/864e5;return m+o},0);return Number((n/a.length).toFixed(1))},E=()=>{let a=p.filter(m=>(m.status==="completed"||m.status==="rejected")&&m.completedAt&&m.dueDate);if(a.length===0)return null;let n=a.filter(m=>(m.completedAt||0)<=(m.dueDate||0));return Math.round(n.length/a.length*100)},L=()=>{let a={};return p.forEach(n=>{a[n.type]=(a[n.type]||0)+1;}),{information:a.information||0,access:a.access||0,rectification:a.rectification||0,erasure:a.erasure||0,restriction:a.restriction||0,portability:a.portability||0,objection:a.objection||0,automated_decision_making:a.automated_decision_making||0}},h=()=>{let a={};return p.forEach(n=>{a[n.status]=(a[n.status]||0)+1;}),{pending:a.pending||0,awaitingVerification:a.awaitingVerification||0,inProgress:a.inProgress||0,completed:a.completed||0,rejected:a.rejected||0}},v=a=>{let n={information:"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200",access:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",rectification:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",erasure:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",restriction:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",portability:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",objection:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",automated_decision_making:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200"},m={information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making"};return e.createElement("span",{className:`px-2 py-1 rounded text-xs font-medium ${n[a]}`},m[a])},Y=()=>{let a=p.length,n=p.filter(u=>u.status!=="completed"&&u.status!=="rejected").length;p.filter(u=>u.status==="completed"||u.status==="rejected").length;let t=V(),o=E();return e.createElement("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-6"},e.createElement("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow"},e.createElement("h4",{className:"text-sm font-medium text-gray-500 dark:text-gray-400 mb-1"},"Total Requests"),e.createElement("p",{className:"text-2xl font-bold"},a)),e.createElement("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow"},e.createElement("h4",{className:"text-sm font-medium text-gray-500 dark:text-gray-400 mb-1"},"Pending Requests"),e.createElement("p",{className:"text-2xl font-bold"},n)),e.createElement("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow"},e.createElement("h4",{className:"text-sm font-medium text-gray-500 dark:text-gray-400 mb-1"},"Avg. Response Time"),e.createElement("p",{className:"text-2xl font-bold"},t!==null?`${t} days`:"N/A")),e.createElement("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow"},e.createElement("h4",{className:"text-sm font-medium text-gray-500 dark:text-gray-400 mb-1"},"Compliance Rate"),e.createElement("p",{className:"text-2xl font-bold"},o!==null?`${o}%`:"N/A")))},x=()=>{let a=L(),n=p.length,m=Object.entries(a).sort(([,t],[,o])=>o-t).map(([t])=>t);return e.createElement("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6"},e.createElement("h3",{className:"text-lg font-medium mb-4"},"Request Types"),n===0?e.createElement("p",{className:"text-gray-500 dark:text-gray-400 text-sm"},"No data available for the selected timeframe."):e.createElement("div",{className:"space-y-4"},m.map(t=>{let o=a[t],u=Math.round(o/n*100);return e.createElement("div",{key:t},e.createElement("div",{className:"flex justify-between items-center mb-1"},e.createElement("div",{className:"flex items-center"},v(t),e.createElement("span",{className:"ml-2 text-sm"},o," requests")),e.createElement("span",{className:"text-sm font-medium"},u,"%")),e.createElement("div",{className:"w-full bg-gray-200 dark:bg-gray-600 rounded-full h-2.5"},e.createElement("div",{className:"bg-blue-600 h-2.5 rounded-full",style:{width:`${u}%`}})))})))},G=()=>{let a=h(),n=p.length,m=["pending","awaitingVerification","inProgress","completed","rejected"],t={pending:"bg-yellow-500",awaitingVerification:"bg-purple-500",inProgress:"bg-blue-500",completed:"bg-green-500",rejected:"bg-red-500"};return e.createElement("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6"},e.createElement("h3",{className:"text-lg font-medium mb-4"},"Request Status"),n===0?e.createElement("p",{className:"text-gray-500 dark:text-gray-400 text-sm"},"No data available for the selected timeframe."):e.createElement("div",null,e.createElement("div",{className:"flex h-4 mb-2"},m.map(o=>{let u=a[o],b=u/n*100;return b>0?e.createElement("div",{key:o,className:`${t[o]} first:rounded-l-full last:rounded-r-full`,style:{width:`${b}%`},title:`${o}: ${u} (${Math.round(b)}%)`}):null})),e.createElement("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-2 mt-4"},m.map(o=>{let u=a[o],b=Math.round(u/n*100);return e.createElement("div",{key:o,className:"flex items-center"},e.createElement("div",{className:`w-3 h-3 rounded-full ${t[o]} mr-2`}),e.createElement("div",null,e.createElement("p",{className:"text-xs font-medium"},o==="inProgress"?"In Progress":o==="awaitingVerification"?"Awaiting Verification":o.charAt(0).toUpperCase()+o.slice(1)),e.createElement("p",{className:"text-xs text-gray-500 dark:text-gray-400"},u," (",b,"%)")))}))))},g=()=>{let a={};p.forEach(u=>{let b=new Date(u.createdAt),s=`${b.getFullYear()}-${String(b.getMonth()+1).padStart(2,"0")}`;a[s]=(a[s]||0)+1;});let m=Object.keys(a).sort().slice(-6),t=Math.max(...Object.values(a).filter(u=>u>0),1),o=u=>{let[b,s]=u.split("-");return `${s}/${b.slice(2)}`};return e.createElement("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6"},e.createElement("h3",{className:"text-lg font-medium mb-4"},"Request Timeline"),m.length===0?e.createElement("p",{className:"text-gray-500 dark:text-gray-400 text-sm"},"No data available for the selected timeframe."):e.createElement("div",{className:"h-40"},e.createElement("div",{className:"flex h-32 items-end justify-between space-x-2"},m.map(u=>{let b=a[u],s=`${b/t*100}%`;return e.createElement("div",{key:u,className:"flex flex-col items-center flex-1"},e.createElement("div",{className:"w-full bg-blue-500 rounded-t",style:{height:s},title:`${o(u)}: ${b} requests`}))})),e.createElement("div",{className:"flex justify-between mt-2"},m.map(u=>e.createElement("div",{key:u,className:"text-xs text-center"},o(u))))))},J=()=>e.createElement("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6"},e.createElement("h3",{className:"text-lg font-medium mb-4"},"Overdue Requests"),T.length===0?e.createElement("p",{className:"text-gray-500 dark:text-gray-400 text-sm"},"No overdue requests."):e.createElement("div",{className:"space-y-2 max-h-60 overflow-y-auto"},T.map(a=>e.createElement("div",{key:a.id,className:"p-3 bg-red-50 dark:bg-red-900/20 rounded-md cursor-pointer hover:bg-red-100 dark:hover:bg-red-900/30",onClick:()=>$(a.id)},e.createElement("div",{className:"flex justify-between items-start mb-1"},e.createElement("h4",{className:"font-medium text-sm"},a.subject.name),v(a.type)),e.createElement("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-1"},a.subject.email),e.createElement("div",{className:"flex justify-between items-center"},e.createElement("p",{className:"text-xs text-gray-500 dark:text-gray-400"},"Due: ",w(a.dueDate||0)),e.createElement("p",{className:"text-xs font-bold text-red-600 dark:text-red-400"},"Overdue by ",Math.abs(I(a.dueDate||0))," days")))))),l=()=>e.createElement("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6"},e.createElement("h3",{className:"text-lg font-medium mb-4"},"Upcoming Deadlines"),k.length===0?e.createElement("p",{className:"text-gray-500 dark:text-gray-400 text-sm"},"No upcoming deadlines in the next 7 days."):e.createElement("div",{className:"space-y-2 max-h-60 overflow-y-auto"},k.map(a=>{let n=I(a.dueDate||0);return e.createElement("div",{key:a.id,className:"p-3 bg-yellow-50 dark:bg-yellow-900/20 rounded-md cursor-pointer hover:bg-yellow-100 dark:hover:bg-yellow-900/30",onClick:()=>$(a.id)},e.createElement("div",{className:"flex justify-between items-start mb-1"},e.createElement("h4",{className:"font-medium text-sm"},a.subject.name),v(a.type)),e.createElement("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-1"},a.subject.email),e.createElement("div",{className:"flex justify-between items-center"},e.createElement("p",{className:"text-xs text-gray-500 dark:text-gray-400"},"Due: ",w(a.dueDate||0)),e.createElement("p",{className:`text-xs font-bold ${n<=3?"text-red-600 dark:text-red-400":"text-yellow-600 dark:text-yellow-400"}`},"Due in ",n," days")))})));return e.createElement("div",{className:`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${H}`},e.createElement("div",{className:"flex flex-col md:flex-row md:justify-between md:items-center mb-6"},e.createElement("div",null,e.createElement("h2",{className:"text-xl font-bold mb-2"},O),e.createElement("p",{className:"text-gray-600 dark:text-gray-300"},M)),e.createElement("div",{className:"mt-4 md:mt-0"},e.createElement("label",{htmlFor:"timeframe",className:"block text-sm font-medium mb-1"},"Timeframe"),e.createElement("select",{id:"timeframe",value:A,onChange:a=>y(a.target.value),className:"px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"},e.createElement("option",{value:"7days"},"Last 7 Days"),e.createElement("option",{value:"30days"},"Last 30 Days"),e.createElement("option",{value:"90days"},"Last 90 Days"),e.createElement("option",{value:"all"},"All Time")))),_&&Y(),e.createElement("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6"},e.createElement("div",null,B&&x(),W&&G()),e.createElement("div",null,U&&g(),F&&J(),F&&l())))};export{ae as a,ne as b,ue as c};//# sourceMappingURL=chunk-6JFTAYXV.mjs.map
2
- //# sourceMappingURL=chunk-6JFTAYXV.mjs.map