@tantainnovative/ndpr-toolkit 3.0.0 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/dist/{PolicyExporter-BIqSVjfC.d.mts → PolicyExporter-Bgi6nz82.d.mts} +93 -1
  2. package/dist/{PolicyExporter-BNWaPBGU.d.ts → PolicyExporter-BnvuFncj.d.ts} +93 -1
  3. package/dist/adapters.js +1 -1
  4. package/dist/adapters.mjs +1 -1
  5. package/dist/breach.js +1 -1
  6. package/dist/breach.mjs +1 -1
  7. package/dist/chunk-256APOQM.js +2 -0
  8. package/dist/chunk-2FWCVWKN.js +2 -0
  9. package/dist/chunk-3DJGO6WG.js +2 -0
  10. package/dist/chunk-44W4H2EY.js +2 -0
  11. package/dist/chunk-4XCL62MJ.mjs +2 -0
  12. package/dist/chunk-555WWZ3W.js +2 -0
  13. package/dist/chunk-6BXUVS6E.js +81 -0
  14. package/dist/{chunk-KHRBU5K7.js → chunk-6RQGQZT2.js} +2 -2
  15. package/dist/chunk-6TA2MVTU.mjs +2 -0
  16. package/dist/chunk-6WIP33TW.mjs +2 -0
  17. package/dist/{chunk-2ORDHJRD.js → chunk-7AVN424U.js} +2 -2
  18. package/dist/{chunk-5VMHKNJY.js → chunk-7SMLHZ4B.js} +2 -2
  19. package/dist/chunk-A4PK7JB2.js +2 -0
  20. package/dist/chunk-ABDB7LEV.mjs +2 -0
  21. package/dist/chunk-BKRETVJ6.js +2 -0
  22. package/dist/chunk-CWUPGY3M.mjs +3 -0
  23. package/dist/chunk-DJGS7SSN.mjs +2 -0
  24. package/dist/{chunk-SVCRYM4I.mjs → chunk-E4NCJ7RD.mjs} +2 -2
  25. package/dist/chunk-E63VPR7U.js +2 -0
  26. package/dist/chunk-EH2I4L7M.mjs +316 -0
  27. package/dist/chunk-ELKB2AFZ.js +2 -0
  28. package/dist/chunk-FDDI426Y.mjs +2 -0
  29. package/dist/chunk-FOXZRRMW.mjs +2 -0
  30. package/dist/chunk-GCQRHMTQ.mjs +144 -0
  31. package/dist/chunk-GKKAK6ES.mjs +3 -0
  32. package/dist/chunk-GOD4LA2J.mjs +2 -0
  33. package/dist/{chunk-SWF3YVE5.js → chunk-GOU6FU6Y.js} +3 -3
  34. package/dist/chunk-HO5M7M4M.js +2 -0
  35. package/dist/chunk-I23WPZNQ.mjs +94 -0
  36. package/dist/chunk-I4M2AA3N.js +2 -0
  37. package/dist/chunk-I54CDQGN.js +3 -0
  38. package/dist/{chunk-6D3ZUGBB.mjs → chunk-IR7VCBWV.mjs} +2 -2
  39. package/dist/{chunk-4VVARDN2.mjs → chunk-K45S6YQV.mjs} +2 -2
  40. package/dist/chunk-KBAFOVE3.js +2 -0
  41. package/dist/{chunk-P7BSBCB3.js → chunk-KBP26GLC.js} +2 -2
  42. package/dist/chunk-KVOGOLIR.js +316 -0
  43. package/dist/chunk-LU4PFST7.js +144 -0
  44. package/dist/chunk-MDWG2KDA.mjs +2 -0
  45. package/dist/chunk-NN233SGA.mjs +3 -0
  46. package/dist/chunk-NRQELKAE.js +2 -0
  47. package/dist/chunk-NUDVUAD4.mjs +81 -0
  48. package/dist/chunk-NXQMU36Z.mjs +2 -0
  49. package/dist/chunk-P42Z5CFE.js +2 -0
  50. package/dist/chunk-PATONNTZ.mjs +2 -0
  51. package/dist/{chunk-WLSW4Z4W.mjs → chunk-PM7O5IGE.mjs} +2 -2
  52. package/dist/chunk-Q7VHB64E.mjs +2 -0
  53. package/dist/{chunk-PEH5GIMN.js → chunk-QH6YUVJS.js} +2 -2
  54. package/dist/chunk-QY7PD5XB.js +94 -0
  55. package/dist/chunk-R3OYAJI6.mjs +2 -0
  56. package/dist/chunk-S4GRSNB4.js +2 -0
  57. package/dist/chunk-SAA7UVI2.js +3 -0
  58. package/dist/{chunk-PYEX7DFR.mjs → chunk-SHMJNRHO.mjs} +3 -3
  59. package/dist/chunk-TVW6KBVV.mjs +2 -0
  60. package/dist/chunk-U62QYKVG.mjs +2 -0
  61. package/dist/chunk-UDNRAQLE.js +3 -0
  62. package/dist/{chunk-5RSOLEEP.js → chunk-UXMGBIX6.js} +4 -4
  63. package/dist/{chunk-UZ5EZOA7.js → chunk-VK27WVV3.js} +2 -2
  64. package/dist/{chunk-G26I6MP5.mjs → chunk-VWPGIES4.mjs} +2 -2
  65. package/dist/{chunk-NPLXE43Q.mjs → chunk-XQ4M5FHC.mjs} +2 -2
  66. package/dist/{chunk-CAB7O3GR.mjs → chunk-ZEOQYWOE.mjs} +4 -4
  67. package/dist/consent.js +1 -1
  68. package/dist/consent.mjs +1 -1
  69. package/dist/core.d.mts +9 -46
  70. package/dist/core.d.ts +9 -46
  71. package/dist/core.js +1 -1
  72. package/dist/core.mjs +1 -1
  73. package/dist/cross-border.js +1 -1
  74. package/dist/cross-border.mjs +1 -1
  75. package/dist/dpia.js +1 -1
  76. package/dist/dpia.mjs +1 -1
  77. package/dist/dsr.js +1 -1
  78. package/dist/dsr.mjs +1 -1
  79. package/dist/hooks.d.mts +2 -0
  80. package/dist/hooks.d.ts +2 -0
  81. package/dist/hooks.js +1 -1
  82. package/dist/hooks.mjs +1 -1
  83. package/dist/index.d.mts +2 -3
  84. package/dist/index.d.ts +2 -3
  85. package/dist/index.js +1 -1
  86. package/dist/index.mjs +1 -1
  87. package/dist/lawful-basis.js +1 -1
  88. package/dist/lawful-basis.mjs +1 -1
  89. package/dist/policy-engine-C-tShzZH.d.mts +154 -0
  90. package/dist/policy-engine-DSQpT55_.d.ts +154 -0
  91. package/dist/policy-sections-CfNVBLCh.d.mts +54 -0
  92. package/dist/policy-sections-DqH0iZRf.d.ts +54 -0
  93. package/dist/policy.d.mts +86 -5
  94. package/dist/policy.d.ts +86 -5
  95. package/dist/policy.js +1 -1
  96. package/dist/policy.mjs +1 -1
  97. package/dist/presets.d.mts +5 -15
  98. package/dist/presets.d.ts +5 -15
  99. package/dist/presets.js +1 -1
  100. package/dist/presets.mjs +1 -1
  101. package/dist/ropa.js +1 -1
  102. package/dist/ropa.mjs +1 -1
  103. package/dist/sanitize-9mOO_cJW.d.mts +147 -0
  104. package/dist/sanitize-9mOO_cJW.d.ts +147 -0
  105. package/dist/useAdaptivePolicyWizard-B9Op2gYM.d.ts +52 -0
  106. package/dist/useAdaptivePolicyWizard-N4eUM4Tj.d.mts +52 -0
  107. package/package.json +9 -3
  108. package/dist/PolicyGenerator-BvcWPbxp.d.mts +0 -96
  109. package/dist/PolicyGenerator-BzRwtlgn.d.ts +0 -96
  110. package/dist/chunk-27NYSWUG.mjs +0 -2
  111. package/dist/chunk-2SYNHRP6.mjs +0 -2
  112. package/dist/chunk-2W7ARAW2.js +0 -2
  113. package/dist/chunk-3F34NACG.js +0 -2
  114. package/dist/chunk-3RGJV3VF.js +0 -7
  115. package/dist/chunk-3V23O4ZJ.js +0 -2
  116. package/dist/chunk-3XAUN5IM.mjs +0 -3
  117. package/dist/chunk-6E54NSAO.mjs +0 -2
  118. package/dist/chunk-7F5F5YWI.mjs +0 -2
  119. package/dist/chunk-7FIUX3ZM.js +0 -89
  120. package/dist/chunk-CMZTI7SG.js +0 -2
  121. package/dist/chunk-EPF7J2FK.js +0 -3
  122. package/dist/chunk-FR7ZYZXB.js +0 -2
  123. package/dist/chunk-FXTZDKDC.mjs +0 -3
  124. package/dist/chunk-GIV2OHE6.mjs +0 -2
  125. package/dist/chunk-GPJVTGHR.mjs +0 -2
  126. package/dist/chunk-GVANK6PL.js +0 -3
  127. package/dist/chunk-HNZK7LY3.mjs +0 -2
  128. package/dist/chunk-IKEPXHCZ.js +0 -2
  129. package/dist/chunk-ILCNDOBU.js +0 -2
  130. package/dist/chunk-IQQW52EF.js +0 -2
  131. package/dist/chunk-ISSGO2YT.mjs +0 -72
  132. package/dist/chunk-J6IKAGUP.mjs +0 -89
  133. package/dist/chunk-KNE4NXCY.mjs +0 -7
  134. package/dist/chunk-LFNA6WYQ.mjs +0 -2
  135. package/dist/chunk-PGSA2O5P.mjs +0 -2
  136. package/dist/chunk-RGYK4VAY.mjs +0 -2
  137. package/dist/chunk-RSUDIFZV.mjs +0 -2
  138. package/dist/chunk-RYZEIDNR.js +0 -2
  139. package/dist/chunk-SBNAMPAP.mjs +0 -2
  140. package/dist/chunk-SSGJREE3.js +0 -2
  141. package/dist/chunk-U6VWHC46.js +0 -72
  142. package/dist/chunk-UK656RCG.js +0 -2
  143. package/dist/chunk-UOSEH6DC.js +0 -2
  144. package/dist/chunk-VDZKGCAF.js +0 -2
  145. package/dist/chunk-WSHSHIIM.mjs +0 -2
  146. package/dist/chunk-XSK4BSZJ.mjs +0 -2
  147. package/dist/chunk-Y34DQYS7.js +0 -2
  148. package/dist/chunk-YJCGEOLO.mjs +0 -2
  149. package/dist/chunk-ZCZ5RRZO.js +0 -2
@@ -0,0 +1,3 @@
1
+ import {e}from'./chunk-EH2I4L7M.mjs';import {a}from'./chunk-AYKLAEOU.mjs';import {d,b,a as a$1}from'./chunk-WWT2ZSNU.mjs';import Gr,{useState,useEffect}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var vr=["Organization","Data Collection","Processing","Review & Export"],ur=({currentStep:n,classNames:d,unstyled:r})=>jsx("div",{"data-ndpr-component":"policy-step-indicator",className:a("w-full flex items-center justify-between px-2 py-4",d==null?void 0:d.root,r),children:vr.map((o,p)=>{let t=p+1,i=t<n,v=t===n,h=p===vr.length-1;return jsxs(Gr.Fragment,{children:[jsxs("div",{className:a("flex flex-col items-center gap-1",d==null?void 0:d.stepWrapper,r),children:[jsx("div",{"aria-current":v?"step":void 0,className:a(["flex items-center justify-center rounded-full border-2 font-semibold transition-all",i?"w-8 h-8 bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))]":v?"w-9 h-9 bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] shadow-md":"w-8 h-8 bg-white dark:bg-gray-900 border-gray-300 dark:border-gray-600 text-gray-400 dark:text-gray-500"].join(" "),i?d==null?void 0:d.stepCompleted:v?d==null?void 0:d.stepCurrent:d==null?void 0:d.stepUpcoming,r),children:i?jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):jsx("span",{className:"text-xs leading-none",children:t})}),jsx("span",{className:a(["text-xs font-medium hidden sm:block",i||v?"text-[rgb(var(--ndpr-primary))]":"text-gray-400 dark:text-gray-500"].join(" "),d==null?void 0:d.stepLabel,r),children:o})]}),!h&&jsx("div",{className:a(["flex-1 h-0.5 mx-2",i?"bg-[rgb(var(--ndpr-primary))]":"bg-gray-200 dark:bg-gray-700"].join(" "),d==null?void 0:d.connector,r),"aria-hidden":"true"})]},t)})});var F="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",Ur="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",A=({label:n,required:d,children:r,classNames:o,unstyled:p})=>jsxs("div",{className:a("flex flex-col",o==null?void 0:o.field,p),children:[jsxs("label",{className:a(Ur,o==null?void 0:o.label,p),children:[n,d&&jsx("span",{className:"text-red-500 ml-0.5","aria-hidden":"true",children:"*"})]}),r]}),yr=({context:n,onUpdateOrg:d,classNames:r,unstyled:o})=>{var t,i,v;let p=n.org;return jsxs("div",{"data-ndpr-component":"policy-step-about",className:a("space-y-6",r==null?void 0:r.root,o),children:[jsxs("div",{children:[jsx("h2",{className:a("text-xl font-semibold text-gray-900 dark:text-gray-100",r==null?void 0:r.heading,o),children:"Organisation Details"}),jsxs("p",{className:a("text-sm text-gray-500 dark:text-gray-400 mt-1",r==null?void 0:r.subheading,o),children:["Tell us about your organisation. Fields marked ",jsx("span",{className:"text-red-500",children:"*"})," are required."]})]}),jsxs("div",{className:a("grid grid-cols-1 md:grid-cols-2 gap-4",r==null?void 0:r.grid,o),children:[jsx(A,{label:"Organisation Name",required:true,classNames:r,unstyled:o,children:jsx("input",{type:"text",value:p.name,onChange:x=>d({name:x.target.value}),placeholder:"Acme Corporation",className:a(F,r==null?void 0:r.input,o),"aria-required":"true"})}),jsx(A,{label:"Website",required:true,classNames:r,unstyled:o,children:jsx("input",{type:"url",value:p.website,onChange:x=>d({website:x.target.value}),placeholder:"https://example.com",className:a(F,r==null?void 0:r.input,o),"aria-required":"true"})}),jsx(A,{label:"Privacy Contact Email",required:true,classNames:r,unstyled:o,children:jsx("input",{type:"email",value:p.privacyEmail,onChange:x=>d({privacyEmail:x.target.value}),placeholder:"privacy@example.com",className:a(F,r==null?void 0:r.input,o),"aria-required":"true"})}),jsx(A,{label:"Industry",classNames:r,unstyled:o,children:jsxs("select",{value:p.industry,onChange:x=>d({industry:x.target.value}),className:a(F,r==null?void 0:r.select,o),children:[jsx("option",{value:"fintech",children:"Fintech"}),jsx("option",{value:"healthcare",children:"Healthcare"}),jsx("option",{value:"ecommerce",children:"E-commerce"}),jsx("option",{value:"saas",children:"SaaS"}),jsx("option",{value:"education",children:"Education"}),jsx("option",{value:"government",children:"Government"}),jsx("option",{value:"other",children:"Other"})]})}),jsx(A,{label:"Data Protection Officer (DPO) Name",classNames:r,unstyled:o,children:jsx("input",{type:"text",value:(t=p.dpoName)!=null?t:"",onChange:x=>d({dpoName:x.target.value}),placeholder:"Jane Smith",className:a(F,r==null?void 0:r.input,o)})}),jsx(A,{label:"DPO Email",classNames:r,unstyled:o,children:jsx("input",{type:"email",value:(i=p.dpoEmail)!=null?i:"",onChange:x=>d({dpoEmail:x.target.value}),placeholder:"dpo@example.com",className:a(F,r==null?void 0:r.input,o)})}),jsx(A,{label:"Registered Address",classNames:r,unstyled:o,children:jsx("input",{type:"text",value:(v=p.address)!=null?v:"",onChange:x=>d({address:x.target.value}),placeholder:"1 Victoria Island, Lagos, Nigeria",className:a(F,r==null?void 0:r.input,o)})}),jsx(A,{label:"Organisation Size",classNames:r,unstyled:o,children:jsxs("select",{value:p.orgSize,onChange:x=>d({orgSize:x.target.value}),className:a(F,r==null?void 0:r.select,o),children:[jsx("option",{value:"startup",children:"Startup (1\u201350 employees)"}),jsx("option",{value:"midsize",children:"Mid-size (51\u2013500 employees)"}),jsx("option",{value:"enterprise",children:"Enterprise (500+ employees)"})]})}),jsx(A,{label:"Country of Operation",classNames:r,unstyled:o,children:jsx("input",{type:"text",value:p.country,onChange:x=>d({country:x.target.value}),placeholder:"Nigeria",className:a(F,r==null?void 0:r.input,o)})})]})]})};var Vr={identity:"Identity",financial:"Financial",behavioral:"Behavioural",sensitive:"Sensitive",children:"Children"},Xr=["identity","financial","behavioral","sensitive","children"],Yr=["sensitive","children"],hr=({categories:n,onToggle:d,classNames:r,unstyled:o})=>{let p=Xr.reduce((t,i)=>{let v=n.filter(x=>x.group===i);return v.length>0&&(t[i]=v),t},{});return jsxs("div",{"data-ndpr-component":"policy-step-data",className:a("space-y-8",r==null?void 0:r.root,o),children:[jsxs("div",{children:[jsx("h2",{className:a("text-xl font-semibold text-gray-900 dark:text-gray-100",r==null?void 0:r.heading,o),children:"Data Categories"}),jsx("p",{className:a("text-sm text-gray-500 dark:text-gray-400 mt-1",r==null?void 0:r.subheading,o),children:"Select the categories of personal data your organisation collects. You must select at least one."})]}),Object.entries(p).map(([t,i])=>{let v=Yr.includes(t);return jsxs("div",{className:a("space-y-3",r==null?void 0:r.group,o),children:[jsxs("div",{className:a("flex items-center gap-2",r==null?void 0:r.groupHeader,o),children:[jsx("h3",{className:a("text-sm font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400",r==null?void 0:r.groupTitle,o),children:Vr[t]}),v&&jsx("span",{className:a("text-xs font-medium text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-900/20 px-2 py-0.5 rounded-full",r==null?void 0:r.sensitiveTag,o),children:"Sensitive"})]}),v&&jsx("p",{className:a("text-xs text-amber-700 dark:text-amber-400",r==null?void 0:r.sensitiveWarning,o),children:t==="children"?"Processing children's data requires parental consent under NDPA Section 31 and imposes heightened obligations.":"Sensitive/special-category data requires explicit consent and additional safeguards under NDPA Section 30."}),jsx("div",{className:a("grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",r==null?void 0:r.cardsGrid,o),children:i.map(x=>jsx("button",{type:"button",onClick:()=>d(x.id),"aria-pressed":x.selected,className:a(["text-left rounded-lg border p-4 transition-all cursor-pointer focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",x.selected?"bg-[rgb(var(--ndpr-primary))]/5 border-[rgb(var(--ndpr-primary))] dark:bg-[rgb(var(--ndpr-primary))]/10":"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"].join(" "),r==null?void 0:r.card,o),children:jsxs("div",{className:"flex items-start gap-3",children:[jsx("div",{className:a(["mt-0.5 w-4 h-4 rounded border-2 flex-shrink-0 flex items-center justify-center",x.selected?"bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))]":"border-gray-300 dark:border-gray-600"].join(" "),r==null?void 0:r.checkbox,o),"aria-hidden":"true",children:x.selected&&jsx("svg",{className:"w-2.5 h-2.5 text-[rgb(var(--ndpr-primary-foreground))]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),jsxs("div",{className:"min-w-0",children:[jsx("p",{className:a("text-sm font-medium text-gray-900 dark:text-gray-100",r==null?void 0:r.cardLabel,o),children:x.label}),jsx("p",{className:a("text-xs text-gray-500 dark:text-gray-400 mt-1 leading-relaxed",r==null?void 0:r.cardDataPoints,o),children:x.dataPoints.join(", ")})]})]})},x.id))})]},t)})]})};var Jr=[{value:"service_delivery",label:"Service Delivery",description:"Processing required to deliver the core product or service."},{value:"marketing",label:"Marketing & Communications",description:"Sending promotional messages, newsletters or offers."},{value:"analytics",label:"Analytics & Insights",description:"Analysing usage patterns to improve the product."},{value:"research",label:"Research & Development",description:"Using data to develop new features or products."},{value:"legal_compliance",label:"Legal Compliance",description:"Meeting statutory, regulatory or contractual obligations."},{value:"fraud_prevention",label:"Fraud Prevention & Security",description:"Detecting and preventing fraudulent activity."}],dr="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",pr="bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-4",gr=({id:n,checked:d,onChange:r})=>jsx("button",{id:n,type:"button",role:"switch","aria-checked":d,onClick:()=>r(!d),className:["relative inline-flex h-6 w-11 flex-shrink-0 rounded-full border-2 border-transparent cursor-pointer transition-colors focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",d?"bg-[rgb(var(--ndpr-primary))]":"bg-gray-200 dark:bg-gray-600"].join(" "),children:jsx("span",{"aria-hidden":"true",className:["pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition-transform",d?"translate-x-5":"translate-x-0"].join(" ")})}),lr=({context:n,onTogglePurpose:d,onUpdateContext:r,onAddProcessor:o,onRemoveProcessor:p,classNames:t,unstyled:i})=>{let[v,x]=useState({name:"",purpose:"",country:""}),[h,c]=useState(false),a$2=()=>{let{name:g,purpose:u,country:P}=v;!g.trim()||!u.trim()||!P.trim()||(o({name:g.trim(),purpose:u.trim(),country:P.trim()}),x({name:"",purpose:"",country:""}),c(false));};return jsxs("div",{"data-ndpr-component":"policy-step-processing",className:a("space-y-6",t==null?void 0:t.root,i),children:[jsxs("div",{children:[jsx("h2",{className:a("text-xl font-semibold text-gray-900 dark:text-gray-100",t==null?void 0:t.heading,i),children:"Processing Details"}),jsx("p",{className:a("text-sm text-gray-500 dark:text-gray-400 mt-1",t==null?void 0:t.subheading,i),children:"Define how and why you process personal data."})]}),jsxs("section",{className:a(pr,t==null?void 0:t.section,i),"aria-labelledby":"purposes-heading",children:[jsx("h3",{id:"purposes-heading",className:a("text-base font-semibold text-gray-900 dark:text-gray-100",t==null?void 0:t.sectionTitle,i),children:"Processing Purposes"}),jsx("p",{className:a("text-sm text-gray-500 dark:text-gray-400",t==null?void 0:t.sectionDescription,i),children:"Select all purposes for which you process personal data. At least one is required."}),jsx("div",{className:a("space-y-3",t==null?void 0:t.purposeList,i),children:Jr.map(g=>{let u=n.purposes.includes(g.value);return jsxs("label",{className:a("flex items-start gap-3 cursor-pointer group",t==null?void 0:t.purposeItem,i),children:[jsx("input",{type:"checkbox",checked:u,onChange:()=>d(g.value),className:a("mt-0.5 h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))] cursor-pointer",t==null?void 0:t.purposeCheckbox,i)}),jsxs("div",{children:[jsx("p",{className:a("text-sm font-medium text-gray-900 dark:text-gray-100",t==null?void 0:t.purposeLabel,i),children:g.label}),jsx("p",{className:a("text-xs text-gray-500 dark:text-gray-400",t==null?void 0:t.purposeDescription,i),children:g.description})]})]},g.value)})})]}),jsxs("section",{className:a(pr,t==null?void 0:t.section,i),"aria-labelledby":"thirdparty-heading",children:[jsxs("div",{className:"flex items-center justify-between",children:[jsx("h3",{id:"thirdparty-heading",className:a("text-base font-semibold text-gray-900 dark:text-gray-100",t==null?void 0:t.sectionTitle,i),children:"Third-Party Data Sharing"}),jsx(gr,{id:"thirdparty-toggle",checked:n.thirdPartyProcessors.length>0||h,onChange:g=>{g?c(true):(n.thirdPartyProcessors.forEach((u,P)=>p(0)),c(false));}})]}),(n.thirdPartyProcessors.length>0||h)&&jsxs("div",{className:a("space-y-4",t==null?void 0:t.processorSection,i),children:[n.thirdPartyProcessors.length>0&&jsx("div",{className:a("overflow-x-auto",t==null?void 0:t.processorTable,i),children:jsxs("table",{className:"w-full text-sm",children:[jsx("thead",{children:jsxs("tr",{className:a("text-left text-xs font-medium text-gray-500 dark:text-gray-400 border-b border-gray-200 dark:border-gray-700",t==null?void 0:t.tableHeader,i),children:[jsx("th",{className:"pb-2 pr-4",children:"Name"}),jsx("th",{className:"pb-2 pr-4",children:"Purpose"}),jsx("th",{className:"pb-2 pr-4",children:"Country"}),jsx("th",{className:"pb-2"})]})}),jsx("tbody",{className:"divide-y divide-gray-100 dark:divide-gray-700",children:n.thirdPartyProcessors.map((g,u)=>jsxs("tr",{children:[jsx("td",{className:a("py-2 pr-4 text-gray-900 dark:text-gray-100",t==null?void 0:t.tableCell,i),children:g.name}),jsx("td",{className:a("py-2 pr-4 text-gray-700 dark:text-gray-300",t==null?void 0:t.tableCell,i),children:g.purpose}),jsx("td",{className:a("py-2 pr-4 text-gray-700 dark:text-gray-300",t==null?void 0:t.tableCell,i),children:g.country}),jsx("td",{className:"py-2",children:jsx("button",{type:"button",onClick:()=>p(u),className:a("text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300 text-xs font-medium",t==null?void 0:t.removeButton,i),"aria-label":`Remove ${g.name}`,children:"Remove"})})]},u))})]})}),h?jsxs("div",{className:a("grid grid-cols-1 sm:grid-cols-3 gap-3 items-end",t==null?void 0:t.processorForm,i),children:[jsx("input",{type:"text",placeholder:"Processor name",value:v.name,onChange:g=>x(u=>b(a$1({},u),{name:g.target.value})),className:a(dr,t==null?void 0:t.input,i)}),jsx("input",{type:"text",placeholder:"Purpose",value:v.purpose,onChange:g=>x(u=>b(a$1({},u),{purpose:g.target.value})),className:a(dr,t==null?void 0:t.input,i)}),jsx("input",{type:"text",placeholder:"Country",value:v.country,onChange:g=>x(u=>b(a$1({},u),{country:g.target.value})),className:a(dr,t==null?void 0:t.input,i)}),jsxs("div",{className:"sm:col-span-3 flex gap-2",children:[jsx("button",{type:"button",onClick:a$2,className:a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium",t==null?void 0:t.addButton,i),children:"Add Processor"}),jsx("button",{type:"button",onClick:()=>c(false),className:a("px-4 py-2 bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-white rounded-md text-sm",t==null?void 0:t.cancelButton,i),children:"Cancel"})]})]}):jsxs("button",{type:"button",onClick:()=>c(true),className:a("flex items-center gap-1 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",t==null?void 0:t.addLink,i),children:[jsx("span",{"aria-hidden":"true",children:"+"})," Add processor"]})]})]}),jsxs("section",{className:a(pr,t==null?void 0:t.section,i),"aria-labelledby":"disclosures-heading",children:[jsx("h3",{id:"disclosures-heading",className:a("text-base font-semibold text-gray-900 dark:text-gray-100",t==null?void 0:t.sectionTitle,i),children:"Additional Disclosures"}),jsxs("div",{className:a("space-y-4",t==null?void 0:t.disclosureList,i),children:[jsxs("div",{className:a("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxs("div",{children:[jsx("p",{className:a("text-sm font-medium text-gray-900 dark:text-gray-100",t==null?void 0:t.disclosureLabel,i),children:"Cross-border Data Transfers"}),jsx("p",{className:a("text-xs text-gray-500 dark:text-gray-400 mt-0.5",t==null?void 0:t.disclosureDescription,i),children:"Do you transfer personal data outside Nigeria? This triggers NDPA Chapter 6 obligations."})]}),jsx(gr,{id:"cross-border-toggle",checked:n.hasCrossBorderTransfer,onChange:g=>r({hasCrossBorderTransfer:g})})]}),jsxs("div",{className:a("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxs("div",{children:[jsx("p",{className:a("text-sm font-medium text-gray-900 dark:text-gray-100",t==null?void 0:t.disclosureLabel,i),children:"Automated Decision-Making / Profiling"}),jsx("p",{className:a("text-xs text-gray-500 dark:text-gray-400 mt-0.5",t==null?void 0:t.disclosureDescription,i),children:"Do you use algorithms or AI to make decisions about individuals? Requires disclosure under NDPA Section 37."})]}),jsx(gr,{id:"automated-toggle",checked:n.hasAutomatedDecisions,onChange:g=>r({hasAutomatedDecisions:g})})]})]})]})]})};var kr=({section:n,index:d,isCustom:r,isEditing:o,editedContent:p,onEdit:t,onSaveEdit:i,onCancelEdit:v,onMoveUp:x,onMoveDown:h,onDelete:c,classNames:a$1,unstyled:g})=>{let[u,P]=useState(p!=null?p:n.template);return useEffect(()=>{p!==void 0&&P(p);},[p]),useEffect(()=>{o&&P(p!=null?p:n.template);},[o,p,n.template]),jsxs("div",{"data-ndpr-component":"policy-section-card",className:a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-3",a$1==null?void 0:a$1.root,g),children:[jsxs("div",{className:a("flex items-start justify-between gap-2",a$1==null?void 0:a$1.header,g),children:[jsxs("div",{className:a("flex items-center gap-3 min-w-0",a$1==null?void 0:a$1.titleRow,g),children:[jsx("span",{className:a("flex-shrink-0 w-7 h-7 rounded-full bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-300 text-xs font-semibold flex items-center justify-center",a$1==null?void 0:a$1.sectionNumber,g),"aria-hidden":"true",children:d+1}),jsxs("h4",{className:a("text-sm font-semibold text-gray-900 dark:text-gray-100 truncate",a$1==null?void 0:a$1.sectionTitle,g),children:[n.title,r&&jsx("span",{className:a("ml-2 text-xs font-normal text-gray-500 dark:text-gray-400 bg-gray-100 dark:bg-gray-700 px-1.5 py-0.5 rounded",a$1==null?void 0:a$1.customBadge,g),children:"Custom"})]})]}),jsxs("div",{className:a("flex items-center gap-1 flex-shrink-0",a$1==null?void 0:a$1.actions,g),children:[x&&jsx("button",{type:"button",onClick:x,className:a("p-1.5 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",a$1==null?void 0:a$1.moveButton,g),"aria-label":`Move "${n.title}" up`,children:jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})})}),h&&jsx("button",{type:"button",onClick:h,className:a("p-1.5 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",a$1==null?void 0:a$1.moveButton,g),"aria-label":`Move "${n.title}" down`,children:jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}),!o&&jsx("button",{type:"button",onClick:t,className:a("p-1.5 text-gray-400 hover:text-[rgb(var(--ndpr-primary))] rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",a$1==null?void 0:a$1.editButton,g),"aria-label":`Edit "${n.title}"`,children:jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),r&&c&&jsx("button",{type:"button",onClick:c,className:a("p-1.5 text-gray-400 hover:text-red-500 dark:hover:text-red-400 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",a$1==null?void 0:a$1.deleteButton,g),"aria-label":`Delete "${n.title}"`,children:jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]}),o?jsxs("div",{className:a("space-y-2",a$1==null?void 0:a$1.editArea,g),children:[jsx("textarea",{value:u,onChange:z=>P(z.target.value),rows:8,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm font-mono resize-y",a$1==null?void 0:a$1.textarea,g),"aria-label":`Edit content for ${n.title}`}),jsxs("div",{className:a("flex gap-2",a$1==null?void 0:a$1.editActions,g),children:[jsx("button",{type:"button",onClick:()=>i(u),className:a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium",a$1==null?void 0:a$1.saveButton,g),children:"Save"}),jsx("button",{type:"button",onClick:v,className:a("px-4 py-2 bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-white rounded-md text-sm",a$1==null?void 0:a$1.cancelButton,g),children:"Cancel"})]})]}):jsx("div",{className:a("text-sm text-gray-600 dark:text-gray-300 leading-relaxed line-clamp-4 whitespace-pre-wrap",a$1==null?void 0:a$1.content,g),children:n.template})]})};var Cr="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",wr=({onAdd:n,nextOrder:d,classNames:r,unstyled:o})=>{let[p,t]=useState(""),[i,v]=useState(""),[x,h]=useState(""),c=()=>{if(!p.trim()){h("Section title is required.");return}if(!i.trim()){h("Section content is required.");return}h(""),n({title:p.trim(),content:i.trim(),order:d}),t(""),v("");};return jsxs("div",{"data-ndpr-component":"custom-section-form",className:a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-4",r==null?void 0:r.root,o),children:[jsx("h4",{className:a("text-sm font-semibold text-gray-900 dark:text-gray-100",r==null?void 0:r.heading,o),children:"Add Custom Section"}),x&&jsx("p",{role:"alert",className:a("text-xs text-red-600 dark:text-red-400",r==null?void 0:r.error,o),children:x}),jsxs("div",{className:a("space-y-3",r==null?void 0:r.fields,o),children:[jsxs("div",{children:[jsxs("label",{htmlFor:"custom-section-title",className:a("block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",r==null?void 0:r.label,o),children:["Section Title ",jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsx("input",{id:"custom-section-title",type:"text",value:p,onChange:a=>{t(a.target.value),x&&h("");},placeholder:"e.g. Cookie Policy",className:a(Cr,r==null?void 0:r.input,o),"aria-required":"true"})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"custom-section-content",className:a("block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",r==null?void 0:r.label,o),children:["Content ",jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsx("textarea",{id:"custom-section-content",value:i,onChange:a=>{v(a.target.value),x&&h("");},placeholder:"Write the section content here...",rows:5,className:a(`${Cr} resize-y`,r==null?void 0:r.textarea,o),"aria-required":"true"})]})]}),jsx("div",{className:a("flex items-center gap-2",r==null?void 0:r.footer,o),children:jsx("button",{type:"button",onClick:c,className:a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium",r==null?void 0:r.addButton,o),children:"Add Section"})})]})};var Sr={compliant:{bg:"bg-green-50 dark:bg-green-900/20",text:"text-green-700 dark:text-green-300",border:"border-green-200 dark:border-green-700"},nearly_compliant:{bg:"bg-amber-50 dark:bg-amber-900/20",text:"text-amber-700 dark:text-amber-300",border:"border-amber-200 dark:border-amber-700"},not_compliant:{bg:"bg-red-50 dark:bg-red-900/20",text:"text-red-700 dark:text-red-300",border:"border-red-200 dark:border-red-700"}},Qr={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},N=({icon:n,label:d,description:r,actionLabel:o,loading:p,onClick:t,classNames:i,unstyled:v})=>jsxs("div",{className:a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 flex flex-col gap-3",i==null?void 0:i.formatCard,v),children:[jsxs("div",{className:a("flex items-center gap-3",i==null?void 0:i.formatHeader,v),children:[jsx("div",{className:a("w-10 h-10 rounded-lg bg-gray-100 dark:bg-gray-700 flex items-center justify-center flex-shrink-0",i==null?void 0:i.formatIcon,v),"aria-hidden":"true",children:n}),jsxs("div",{className:"min-w-0",children:[jsx("p",{className:a("text-sm font-semibold text-gray-900 dark:text-gray-100",i==null?void 0:i.formatLabel,v),children:d}),jsx("p",{className:a("text-xs text-gray-500 dark:text-gray-400",i==null?void 0:i.formatDescription,v),children:r})]})]}),jsx("button",{type:"button",onClick:t,disabled:p,className:a("w-full px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2",i==null?void 0:i.formatButton,v),children:p?jsxs(Fragment,{children:[jsxs("svg",{className:"animate-spin w-4 h-4",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),"Generating\u2026"]}):o})]}),mr=({complianceResult:n,onExportPDF:d$1,onExportDOCX:r,onExportHTML:o,onExportMarkdown:p,classNames:t,unstyled:i})=>{var P;let[v,x]=useState(false),[h,c]=useState(false),a$1=(P=Sr[n.rating])!=null?P:Sr.not_compliant,g=()=>d(null,null,function*(){x(true);try{yield d$1();}finally{x(false);}}),u=()=>d(null,null,function*(){c(true);try{yield r();}finally{c(false);}});return jsxs("div",{"data-ndpr-component":"policy-export-panel",className:a("space-y-6",t==null?void 0:t.root,i),children:[jsxs("div",{className:a(`rounded-lg border p-4 flex items-center gap-4 ${a$1.bg} ${a$1.border}`,t==null?void 0:t.complianceSummary,i),children:[jsxs("div",{className:a(`text-3xl font-bold ${a$1.text}`,t==null?void 0:t.complianceScore,i),"aria-label":`Compliance score: ${n.percentage}%`,children:[n.percentage,"%"]}),jsxs("div",{children:[jsx("p",{className:a(`text-sm font-semibold ${a$1.text}`,t==null?void 0:t.complianceRating,i),children:Qr[n.rating]}),jsxs("p",{className:a("text-xs text-gray-500 dark:text-gray-400 mt-0.5",t==null?void 0:t.complianceDetail,i),children:[n.score," / ",n.maxScore," points \u2022"," ",n.gaps.length," gap",n.gaps.length!==1?"s":""," remaining"]})]})]}),jsxs("div",{children:[jsx("h3",{className:a("text-sm font-semibold text-gray-900 dark:text-gray-100 mb-3",t==null?void 0:t.formatsHeading,i),children:"Export Format"}),jsxs("div",{className:a("grid grid-cols-1 sm:grid-cols-2 gap-3",t==null?void 0:t.formatsGrid,i),children:[jsx(N,{icon:jsx("svg",{className:"w-5 h-5 text-red-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-3 7v-1h4v1h-4zm0-3v-1h4v1h-4zm-2-5h8v1H8v-1z"})}),label:"PDF",description:"Professional formatted document, ideal for publishing.",actionLabel:"Download PDF",loading:v,onClick:g,classNames:t,unstyled:i}),jsx(N,{icon:jsx("svg",{className:"w-5 h-5 text-blue-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-5 8v-5h1.5l1 3 1-3H13v5h-1v-3.5l-.75 2.25h-.5L10 13.5V17H9zm5-1.5h.75c.55 0 .75-.25.75-.75 0-.4-.2-.65-.75-.65H14V15.5zm1 1.5h-2v-4h2c1.1 0 1.75.6 1.75 1.5 0 .55-.25.95-.65 1.15.5.2.8.65.8 1.2 0 1-.65 1.65-1.9 1.65V17zm-.25-1c.6 0 .9-.25.9-.75 0-.45-.3-.75-.9-.75H14V16h.75z"})}),label:"DOCX",description:"Editable Word document for further customisation.",actionLabel:"Download DOCX",loading:h,onClick:u,classNames:t,unstyled:i}),jsx(N,{icon:jsxs("svg",{className:"w-5 h-5 text-orange-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 15H9V8h2v9zm4 0h-2V8h2v9z"}),jsx("path",{d:"M9.5 6.5h1v1h-1zm4 0h1v1h-1z"}),jsx("path",{d:"M5 5h14v2H5zm0 12h14v2H5z"})]}),label:"HTML",description:"Copy-ready HTML to embed on your website.",actionLabel:"Copy HTML",onClick:o,classNames:t,unstyled:i}),jsx(N,{icon:jsx("svg",{className:"w-5 h-5 text-gray-500 dark:text-gray-300",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsx("path",{d:"M3 5h18v2H3V5zm0 4h12v2H3V9zm0 4h18v2H3v-2zm0 4h12v2H3v-2z"})}),label:"Markdown",description:"Plain-text format for documentation or Git repos.",actionLabel:"Copy Markdown",onClick:p,classNames:t,unstyled:i})]})]})]})};var Lr=({sections:n,customSections:d,sectionOverrides:r,complianceResult:o,onEditSection:p,onAddCustomSection:t,onRemoveCustomSection:i,onReorderSection:v,onExportPDF:x,onExportDOCX:h,onExportHTML:c,onExportMarkdown:a$2,classNames:g,unstyled:u})=>{let[P,z]=useState(null),[Q,Y]=useState(false),Z=new Set(d.map(f=>f.id)),er=(f,L)=>{p(f,L),z(null);},or=n.length>0?Math.max(...n.map(f=>{var L;return (L=f.order)!=null?L:0}))+1:1;return jsxs("div",{"data-ndpr-component":"policy-step-review",className:a("space-y-6",g==null?void 0:g.root,u),children:[jsxs("div",{children:[jsx("h2",{className:a("text-xl font-semibold text-gray-900 dark:text-gray-100",g==null?void 0:g.heading,u),children:"Review & Export"}),jsx("p",{className:a("text-sm text-gray-500 dark:text-gray-400 mt-1",g==null?void 0:g.subheading,u),children:"Review your generated policy sections, reorder or edit content, then export."})]}),jsx("div",{className:a("space-y-3",g==null?void 0:g.sectionList,u),children:n.map((f,L)=>jsx(kr,{section:r[f.id]?b(a$1({},f),{template:r[f.id]}):f,index:L,isCustom:Z.has(f.id),isEditing:P===f.id,editedContent:r[f.id],onEdit:()=>z(f.id),onSaveEdit:ir=>er(f.id,ir),onCancelEdit:()=>z(null),onMoveUp:L>0?()=>v(f.id,"up"):void 0,onMoveDown:L<n.length-1?()=>v(f.id,"down"):void 0,onDelete:Z.has(f.id)?()=>i(f.id):void 0,classNames:g,unstyled:u},f.id))}),!Q&&jsxs("button",{type:"button",onClick:()=>Y(true),className:a("flex items-center gap-2 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",g==null?void 0:g.addSectionButton,u),children:[jsx("span",{className:a("w-5 h-5 rounded-full border-2 border-[rgb(var(--ndpr-primary))] flex items-center justify-center text-xs font-bold leading-none",g==null?void 0:g.addSectionIcon,u),"aria-hidden":"true",children:"+"}),"Add Custom Section"]}),Q&&jsxs("div",{className:a("space-y-2",g==null?void 0:g.customFormWrapper,u),children:[jsx(wr,{onAdd:f=>{t(f),Y(false);},nextOrder:or,classNames:g,unstyled:u}),jsx("button",{type:"button",onClick:()=>Y(false),className:a("text-sm text-gray-500 dark:text-gray-400 hover:underline",g==null?void 0:g.cancelCustomForm,u),children:"Cancel"})]}),jsx("hr",{className:a("border-gray-200 dark:border-gray-700",g==null?void 0:g.divider,u)}),jsx(mr,{complianceResult:o,onExportPDF:x,onExportDOCX:h,onExportHTML:c,onExportMarkdown:a$2,classNames:g,unstyled:u})]})};var Dr={compliant:{stroke:"stroke-green-500 dark:stroke-green-400",text:"text-green-600 dark:text-green-400"},nearly_compliant:{stroke:"stroke-amber-500 dark:stroke-amber-400",text:"text-amber-600 dark:text-amber-400"},not_compliant:{stroke:"stroke-red-500 dark:stroke-red-400",text:"text-red-600 dark:text-red-400"}},Nr={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},Er=({score:n,maxScore:d,rating:r,classNames:o,unstyled:p})=>{var c,a$1;let t=d>0?Math.round(n/d*100):0,i=(c=Dr[r])!=null?c:Dr.not_compliant,v=36,x=2*Math.PI*v,h=x-t/100*x;return jsxs("div",{"data-ndpr-component":"compliance-score-ring",className:a("flex flex-col items-center gap-2",o==null?void 0:o.root,p),children:[jsxs("div",{className:a("relative w-24 h-24",o==null?void 0:o.svgWrapper,p),children:[jsxs("svg",{className:"w-24 h-24 -rotate-90",viewBox:"0 0 96 96","aria-hidden":"true",children:[jsx("circle",{cx:"48",cy:"48",r:v,fill:"none",className:"stroke-gray-200 dark:stroke-gray-700",strokeWidth:"8"}),jsx("circle",{cx:"48",cy:"48",r:v,fill:"none",className:i.stroke,strokeWidth:"8",strokeLinecap:"round",strokeDasharray:x,strokeDashoffset:h,style:{transition:"stroke-dashoffset 0.5s ease-out"}})]}),jsx("div",{className:a("absolute inset-0 flex flex-col items-center justify-center",o==null?void 0:o.centerText,p),children:jsxs("span",{className:a(`text-xl font-bold leading-none ${i.text}`,o==null?void 0:o.scoreValue,p),"aria-label":`${t}% compliance score`,children:[t,"%"]})})]}),jsx("p",{className:a(`text-xs font-semibold text-center ${i.text}`,o==null?void 0:o.ratingLabel,p),children:(a$1=Nr[r])!=null?a$1:r}),jsxs("p",{className:a("text-xs text-gray-500 dark:text-gray-400 text-center",o==null?void 0:o.scoreDetail,p),children:[n," / ",d," pts"]})]})};var rt={critical:"text-red-600 dark:text-red-400",important:"text-amber-600 dark:text-amber-400",recommended:"text-blue-600 dark:text-blue-400"},Fr=({gap:n,isPassed:d,onFix:r,classNames:o,unstyled:p})=>{let[t,i]=useState(false);return jsxs("div",{"data-ndpr-component":"compliance-requirement-item",className:a("border-b border-gray-100 dark:border-gray-700 last:border-0 py-2",o==null?void 0:o.root,p),children:[jsxs("button",{type:"button",onClick:()=>!d&&i(v=>!v),className:a("w-full flex items-start gap-2 text-left group",o==null?void 0:o.row,p),"aria-expanded":d?void 0:t,"aria-disabled":d,children:[jsx("span",{className:a(["mt-0.5 flex-shrink-0 w-4 h-4 rounded-full flex items-center justify-center",d?"bg-green-500":n.severity==="critical"?"bg-red-500":n.severity==="important"?"bg-amber-500":"bg-blue-400"].join(" "),o==null?void 0:o.statusIcon,p),"aria-hidden":"true",children:d?jsx("svg",{className:"w-2.5 h-2.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):jsx("svg",{className:"w-2.5 h-2.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("div",{className:"flex items-center justify-between gap-1",children:[jsx("p",{className:a(`text-xs font-medium ${d?"text-gray-700 dark:text-gray-300":"text-gray-900 dark:text-gray-100"}`,o==null?void 0:o.requirementLabel,p),children:n.requirement}),!d&&jsx("svg",{className:`flex-shrink-0 w-3 h-3 text-gray-400 transition-transform ${t?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),jsxs("p",{className:a("text-xs text-gray-400 dark:text-gray-500 mt-0.5",o==null?void 0:o.ndpaSection,p),children:["NDPA ",n.ndpaSection]})]})]}),!d&&t&&jsxs("div",{className:a("mt-2 ml-6 space-y-2",o==null?void 0:o.detail,p),children:[jsx("p",{className:a(`text-xs ${rt[n.severity]}`,o==null?void 0:o.message,p),children:n.message}),jsx("button",{type:"button",onClick:()=>{r(n.requirementId),i(false);},className:a("text-xs font-medium px-3 py-1 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))]",o==null?void 0:o.fixButton,p),children:n.fixLabel})]})]})};function et(n,d){let r=d.map(t=>({gap:{requirementId:t,requirement:t.split("-").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "),ndpaSection:"\u2014",severity:"recommended",message:"",fixType:"fill_field",fixLabel:""},isPassed:true})),o=n.map(t=>({gap:t,isPassed:false})),p={critical:0,important:1,recommended:2};return o.sort((t,i)=>p[t.gap.severity]-p[i.gap.severity]),[...o,...r]}var Ar=({complianceResult:n,onFix:d,classNames:r,unstyled:o})=>{let[p,t]=useState(false),i=et(n.gaps,n.passed);return jsxs("aside",{"data-ndpr-component":"compliance-checker-sidebar",className:a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",r==null?void 0:r.root,o),"aria-label":"NDPA compliance checker",children:[jsxs("div",{className:a("flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/50",r==null?void 0:r.header,o),children:[jsx("h2",{className:a("text-sm font-semibold text-gray-900 dark:text-gray-100",r==null?void 0:r.title,o),children:"NDPA Compliance"}),jsx("button",{type:"button",onClick:()=>t(v=>!v),className:a("p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",r==null?void 0:r.collapseButton,o),"aria-expanded":!p,"aria-label":p?"Expand compliance checker":"Collapse compliance checker",children:jsx("svg",{className:`w-4 h-4 transition-transform ${p?"-rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})})]}),!p&&jsxs("div",{className:a("p-4 space-y-4",r==null?void 0:r.body,o),children:[jsx("div",{className:a("flex justify-center",r==null?void 0:r.ringWrapper,o),children:jsx(Er,{score:n.score,maxScore:n.maxScore,rating:n.rating,classNames:r,unstyled:o})}),jsx("div",{className:a("grid grid-cols-3 gap-2 text-center",r==null?void 0:r.statsRow,o),children:[{count:n.gaps.filter(v=>v.severity==="critical").length,label:"Critical",color:"text-red-600 dark:text-red-400"},{count:n.gaps.filter(v=>v.severity==="important").length,label:"Important",color:"text-amber-600 dark:text-amber-400"},{count:n.passed.length,label:"Passed",color:"text-green-600 dark:text-green-400"}].map(({count:v,label:x,color:h})=>jsxs("div",{children:[jsx("p",{className:a(`text-base font-bold ${h}`,r==null?void 0:r.statValue,o),children:v}),jsx("p",{className:a("text-xs text-gray-500 dark:text-gray-400",r==null?void 0:r.statLabel,o),children:x})]},x))}),jsx("div",{className:a("overflow-y-auto max-h-80",r==null?void 0:r.requirementsList,o),children:i.length===0?jsx("p",{className:a("text-xs text-gray-500 dark:text-gray-400 text-center py-4",r==null?void 0:r.emptyState,o),children:"No requirements to display."}):i.map(({gap:v,isPassed:x})=>jsx(Fr,{gap:v,isPassed:x,onFix:d,classNames:r,unstyled:o},v.requirementId))})]})]})};function ot(n){let d=Date.now()-n;return d<1e4?"just now":d<6e4?`${Math.floor(d/1e3)}s ago`:d<36e5?`${Math.floor(d/6e4)}m ago`:new Date(n).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}var Mr=({lastSavedAt:n,isSaving:d,hasError:r,classNames:o,unstyled:p})=>{let t="idle";if(d?t="saving":r?t="error":n!==null&&(t="saved"),t==="idle")return null;let i=t==="saving"?"Saving\u2026":t==="error"?"Unable to save":`Draft saved ${n?ot(n):""}`;return jsxs("div",{"data-ndpr-component":"draft-save-indicator",role:"status","aria-live":"polite","aria-atomic":"true",className:a(`flex items-center gap-1.5 ${t==="error"?"text-red-500 dark:text-red-400":t==="saving"?"text-gray-400 dark:text-gray-500":"text-green-600 dark:text-green-400"}`,o==null?void 0:o.root,p),children:[t==="saving"&&jsxs("svg",{className:"animate-spin w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),t==="saved"&&jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),t==="error"&&jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})}),jsx("span",{className:a("text-xs font-medium",o==null?void 0:o.text,p),children:i})]})};var ce=({adapter:n,onComplete:d$1,classNames:r,unstyled:o})=>{let{currentStep:p,nextStep:t,prevStep:i,canProceed:v,context:x,updateOrg:h,updateContext:c,toggleDataCategory:a$1,togglePurpose:g,addProcessor:u,removeProcessor:P,sections:z,customSections:Q,sectionOverrides:Y,editSectionContent:Z,addCustomSection:er,removeCustomSection:or,reorderSections:f,complianceResult:L,applyFix:ir,handleExportPDF:Br,handleExportDOCX:Ir,handleExportHTML:zr,handleExportMarkdown:jr,lastSavedAt:Or,isLoading:_r}=e({adapter:n,onComplete:d$1}),nr=(D,J)=>{let H=URL.createObjectURL(D),q=document.createElement("a");q.href=H,q.download=J,q.click(),URL.revokeObjectURL(H);},Hr=()=>d(null,null,function*(){let D=yield Br();nr(D,"privacy-policy.pdf");}),qr=()=>d(null,null,function*(){let D=yield Ir();nr(D,"privacy-policy.docx");}),Wr=()=>{let D=zr();navigator.clipboard.writeText(D).catch(()=>{let J=new Blob([D],{type:"text/html"}),H=URL.createObjectURL(J),q=window.open(H,"_blank");q?q.addEventListener("load",()=>URL.revokeObjectURL(H)):URL.revokeObjectURL(H);});},$r=()=>{let D=jr();navigator.clipboard.writeText(D).catch(()=>{let J=new Blob([D],{type:"text/markdown"});nr(J,"privacy-policy.md");});};return _r?jsxs("div",{"data-ndpr-component":"adaptive-policy-wizard",className:a("flex items-center justify-center min-h-64 text-gray-400 dark:text-gray-500",r==null?void 0:r.root,o),"aria-busy":"true","aria-label":"Loading policy wizard",children:[jsxs("svg",{className:"animate-spin w-6 h-6 mr-2",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),jsx("span",{className:"text-sm",children:"Loading\u2026"})]}):jsx("div",{"data-ndpr-component":"adaptive-policy-wizard",className:a("min-h-screen bg-gray-50 dark:bg-gray-900",r==null?void 0:r.root,o),children:jsxs("div",{className:a("max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",r==null?void 0:r.container,o),children:[jsxs("div",{className:a("flex items-center justify-between mb-6",r==null?void 0:r.topBar,o),children:[jsx("h1",{className:a("text-2xl font-bold text-gray-900 dark:text-gray-100",r==null?void 0:r.wizardTitle,o),children:"Privacy Policy Builder"}),jsx(Mr,{lastSavedAt:Or,isSaving:false,hasError:false,classNames:r,unstyled:o})]}),jsx("div",{className:a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg px-4 mb-6",r==null?void 0:r.stepIndicatorWrapper,o),children:jsx(ur,{currentStep:p,classNames:r,unstyled:o})}),jsxs("div",{className:a("flex flex-col lg:flex-row gap-6 items-start",r==null?void 0:r.panels,o),children:[jsxs("main",{className:a("flex-1 min-w-0 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-6",r==null?void 0:r.mainPanel,o),children:[p===1&&jsx(yr,{context:x,onUpdateOrg:h,classNames:r,unstyled:o}),p===2&&jsx(hr,{categories:x.dataCategories,onToggle:a$1,classNames:r,unstyled:o}),p===3&&jsx(lr,{context:x,onTogglePurpose:g,onUpdateContext:c,onAddProcessor:u,onRemoveProcessor:P,classNames:r,unstyled:o}),p===4&&jsx(Lr,{sections:z,customSections:Q,sectionOverrides:Y,complianceResult:L,onEditSection:Z,onAddCustomSection:er,onRemoveCustomSection:or,onReorderSection:f,onExportPDF:Hr,onExportDOCX:qr,onExportHTML:Wr,onExportMarkdown:$r,classNames:r,unstyled:o}),jsxs("div",{className:a("flex items-center justify-between mt-8 pt-4 border-t border-gray-200 dark:border-gray-700",r==null?void 0:r.navigation,o),children:[jsx("button",{type:"button",onClick:i,disabled:p===1,className:a("px-4 py-2 bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-white rounded-md text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed hover:bg-gray-300 dark:hover:bg-gray-600 transition-colors",r==null?void 0:r.backButton,o),children:"Back"}),jsx("div",{className:"flex items-center gap-2",children:jsxs("span",{className:a("text-xs text-gray-400 dark:text-gray-500",r==null?void 0:r.stepCounter,o),children:["Step ",p," of 4"]})}),p<4?jsx("button",{type:"button",onClick:t,disabled:!v,className:a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed transition-colors",r==null?void 0:r.nextButton,o),children:"Next"}):jsx("span",{})]})]}),jsx("aside",{className:a("w-full lg:w-80 flex-shrink-0",r==null?void 0:r.sidebarWrapper,o),children:jsx(Ar,{complianceResult:L,onFix:ir,classNames:r,unstyled:o})})]})]})})};
2
+ export{ce as a};//# sourceMappingURL=chunk-NN233SGA.mjs.map
3
+ //# sourceMappingURL=chunk-NN233SGA.mjs.map
@@ -0,0 +1,2 @@
1
+ 'use strict';function o(i){var a,d;let t=[];return i.id||t.push("Request ID is required"),i.type||t.push("Request type is required"),i.status||t.push("Request status is required"),i.createdAt||t.push("Creation timestamp is required"),(a=i.subject)!=null&&a.name||t.push("Data subject name is required"),(d=i.subject)!=null&&d.email||t.push("Data subject email is required"),{formattedRequest:{requestId:i.id,requestType:i.type,status:i.status,createdDate:new Date(i.createdAt).toISOString(),lastUpdated:i.updatedAt?new Date(i.updatedAt).toISOString():void 0,dueDate:i.dueDate?new Date(i.dueDate).toISOString():void 0,dataSubject:i.subject?{name:i.subject.name,email:i.subject.email,phone:i.subject.phone||"Not provided",identifier:{type:i.subject.identifierType||"Not specified",value:i.subject.identifierValue||"Not provided"}}:void 0,additionalInformation:i.additionalInfo||{},verificationStatus:i.verification?`${i.verification.verified?"Verified":"Not verified"}${i.verification.method?` via ${i.verification.method}`:""}`:"Pending verification",attachments:i.attachments?i.attachments.map(e=>({name:e.name,type:e.type,addedOn:new Date(e.addedAt).toISOString()})):[]},isValid:t.length===0,validationErrors:t}}exports.a=o;//# sourceMappingURL=chunk-NRQELKAE.js.map
2
+ //# sourceMappingURL=chunk-NRQELKAE.js.map
@@ -0,0 +1,81 @@
1
+ import {a as a$1}from'./chunk-DJGS7SSN.mjs';import {a}from'./chunk-AYKLAEOU.mjs';import {useState,useEffect}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var ve=({breachData:g,initialAssessment:u={},onComplete:w,title:J="Breach Risk Assessment",description:_="Assess the risk level of this data breach to determine notification requirements under NDPA Section 40.",submitButtonText:K="Complete Assessment",className:ae="",buttonClassName:Z="",classNames:v={},unstyled:d=false,showBreachSummary:l=true,showNotificationRequirements:A=true})=>{let[j,se]=useState(u.confidentialityImpact||3),[P,b]=useState(u.integrityImpact||3),[D,C]=useState(u.availabilityImpact||3),[q,B]=useState(u.harmLikelihood||3),[E,I]=useState(u.harmSeverity||3),[M,O]=useState(u.risksToRightsAndFreedoms!==void 0?u.risksToRightsAndFreedoms:false),[G,W]=useState(u.highRisksToRightsAndFreedoms!==void 0?u.highRisksToRightsAndFreedoms:false),[Q,ie]=useState(u.justification||""),[Y,re]=useState(0),[R,h]=useState("low"),[x,f]=useState(false),[y,X]=useState(0),[U,z]=useState(0),[p,k]=useState(false);useEffect(()=>{let ee=j*.2+P*.1+D*.1+q*.3+E*.3;re(Number(ee.toFixed(1)));let L;ee<2?L="low":ee<3?L="medium":ee<4?L="high":L="critical",h(L),f(M||L==="high"||L==="critical");let ne=g.discoveredAt+4320*60*1e3;X(ne);let ce=Date.now(),pe=(ne-ce)/(3600*1e3);z(Number(pe.toFixed(1)));},[j,P,D,q,E,M,g.discoveredAt]);let T=o=>new Date(o).toLocaleString(),H=o=>{o.preventDefault();let N={id:u.id||`assessment_${Date.now()}`,breachId:g.id,assessedAt:Date.now(),assessor:u.assessor||{name:"Assessment User",role:"Data Protection Officer",email:"dpo@example.com"},confidentialityImpact:j,integrityImpact:P,availabilityImpact:D,harmLikelihood:q,harmSeverity:E,overallRiskScore:Y,riskLevel:R,risksToRightsAndFreedoms:M,highRisksToRightsAndFreedoms:G,justification:Q};w(N),k(true);},s=o=>{switch(o){case 1:return "Minimal";case 2:return "Low";case 3:return "Moderate";case 4:return "High";case 5:return "Severe";default:return "Unknown"}},m=o=>jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",critical:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[o]}`,v.riskBadge,d),children:o.charAt(0).toUpperCase()+o.slice(1)});return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${ae}`,v.root,d),children:[jsx("h2",{className:a("text-xl font-bold mb-2",v.title,d),children:J}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:_}),l&&jsxs("div",{className:"mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("h3",{className:"text-lg font-medium mb-2",children:"Breach Summary"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Title:"})," ",g.title]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Discovered:"})," ",T(g.discoveredAt)]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Status:"})," ",g.status.charAt(0).toUpperCase()+g.status.slice(1)]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Data Types:"})," ",g.dataTypes.join(", ")]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",g.affectedSystems.join(", ")]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",g.estimatedAffectedSubjects||"Unknown"]})]})]})]}),p?jsxs("div",{children:[jsxs("div",{className:"mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Assessment Results"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Overall Risk Level:"})," ",m(R)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risk Score:"})," ",Y," / 5"]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Assessed On:"})," ",T(Date.now())]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risks to Rights and Freedoms:"})," ",M?"Yes":"No"]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"High Risks to Rights and Freedoms:"})," ",G?"Yes":"No"]})]})]}),jsxs("div",{className:"mt-3",children:[jsx("p",{className:"text-sm mb-1",children:jsx("span",{className:"font-medium",children:"Justification:"})}),jsx("p",{className:"text-sm bg-white dark:bg-gray-800 p-2 rounded",children:Q})]})]}),A&&jsxs("div",{className:a(`mb-6 p-4 rounded-md ${x?U>24?"bg-yellow-50 dark:bg-yellow-900/20":"bg-red-50 dark:bg-red-900/20":"bg-green-50 dark:bg-green-900/20"}`,v.notificationStatus,d),children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Notification Requirements"}),x?jsxs("div",{children:[jsx("p",{className:`text-sm font-bold mb-2 ${U>24?"text-yellow-800 dark:text-yellow-200":"text-red-800 dark:text-red-200"}`,children:"NDPC Notification Required"}),jsx("p",{className:"text-sm mb-2",children:"Under the NDPA (Section 40), this breach must be reported to the NDPC within 72 hours of discovery."}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Notification Deadline:"})," ",T(y)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Time Remaining:"})," ",jsx("span",{className:U<24?"text-red-600 dark:text-red-400 font-bold":"",children:U>0?`${U} hours`:"Deadline passed"})]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Data Subject Notification:"})," ",G?"Required (NDPA Section 40(4))":"Not required unless directed by NDPC"]})]}):jsxs("div",{children:[jsx("p",{className:"text-sm font-bold mb-2 text-green-800 dark:text-green-200",children:"NDPC Notification Not Required"}),jsx("p",{className:"text-sm mb-2",children:"Based on this assessment, this breach does not need to be reported to the NDPC."}),jsx("p",{className:"text-sm mb-2",children:"However, the breach should still be documented internally for compliance purposes."})]}),jsxs("div",{className:"mt-3 text-sm",children:[jsx("p",{className:"font-medium",children:"Next Steps:"}),jsx("ul",{className:"list-disc pl-5 mt-1",children:x?jsxs(Fragment,{children:[jsx("li",{children:"Prepare a notification report for the NDPC"}),jsx("li",{children:"Document all aspects of the breach and your response"}),G&&jsx("li",{children:"Prepare communications for affected data subjects"}),jsx("li",{children:"Implement measures to mitigate the impact of the breach"})]}):jsxs(Fragment,{children:[jsx("li",{children:"Document the breach and this assessment in your internal records"}),jsx("li",{children:"Implement measures to prevent similar breaches in the future"}),jsx("li",{children:"Review and update security measures as needed"})]})})]})]}),jsx("button",{onClick:()=>k(false),className:a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${Z}`,v.primaryButton||v.submitButton,d),children:"Edit Assessment"})]}):jsx("form",{onSubmit:H,children:jsxs("div",{className:"space-y-6",children:[jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Impact Assessment"}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"confidentialityImpact",className:"block text-sm font-medium mb-1",children:["Confidentiality Impact (1-5)",jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How much has the confidentiality of data been compromised?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"confidentialityImpact",min:"1",max:"5",step:"1",value:j,onChange:o=>se(parseInt(o.target.value)),className:a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",v.slider,d)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(j)," (",j,")"]})]})]}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"integrityImpact",className:"block text-sm font-medium mb-1",children:["Integrity Impact (1-5)",jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How much has the integrity of data been compromised?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"integrityImpact",min:"1",max:"5",step:"1",value:P,onChange:o=>b(parseInt(o.target.value)),className:a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",v.slider,d)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(P)," (",P,")"]})]})]}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"availabilityImpact",className:"block text-sm font-medium mb-1",children:["Availability Impact (1-5)",jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How much has the availability of data or systems been compromised?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"availabilityImpact",min:"1",max:"5",step:"1",value:D,onChange:o=>C(parseInt(o.target.value)),className:a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",v.slider,d)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(D)," (",D,")"]})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Risk to Data Subjects"}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"harmLikelihood",className:"block text-sm font-medium mb-1",children:["Likelihood of Harm (1-5)",jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How likely is it that data subjects will experience harm?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"harmLikelihood",min:"1",max:"5",step:"1",value:q,onChange:o=>B(parseInt(o.target.value)),className:a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",v.slider,d)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(q)," (",q,")"]})]})]}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"harmSeverity",className:"block text-sm font-medium mb-1",children:["Severity of Harm (1-5)",jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How severe would the harm be to affected data subjects?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"harmSeverity",min:"1",max:"5",step:"1",value:E,onChange:o=>I(parseInt(o.target.value)),className:a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",v.slider,d)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(E)," (",E,")"]})]})]}),jsxs("div",{className:"mb-4",children:[jsxs("div",{className:"flex items-center mb-2",children:[jsx("input",{type:"checkbox",id:"risksToRightsAndFreedoms",checked:M,onChange:o=>O(o.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("label",{htmlFor:"risksToRightsAndFreedoms",className:"ml-2 text-sm font-medium",children:"This breach poses a risk to the rights and freedoms of data subjects"})]}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 ml-6",children:"Under the NDPA (Section 40), breaches that pose a risk to rights and freedoms must be reported to the NDPC within 72 hours."})]}),jsxs("div",{className:"mb-4",children:[jsxs("div",{className:"flex items-center mb-2",children:[jsx("input",{type:"checkbox",id:"highRisksToRightsAndFreedoms",checked:G,onChange:o=>W(o.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("label",{htmlFor:"highRisksToRightsAndFreedoms",className:"ml-2 text-sm font-medium",children:"This breach poses a high risk to the rights and freedoms of data subjects"})]}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 ml-6",children:"Under the NDPA (Section 40(4)), breaches that pose a high risk to rights and freedoms also require notification to affected data subjects without undue delay."})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Overall Assessment"}),jsxs("div",{className:"mb-4 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsx("span",{className:"font-medium",children:"Overall Risk Score:"}),jsxs("span",{className:a("",v.riskScore,d),children:[Y," / 5"]})]}),jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{className:"font-medium",children:"Risk Level:"}),m(R)]})]}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"justification",className:"block text-sm font-medium mb-1",children:["Justification for Assessment ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("textarea",{id:"justification",value:Q,onChange:o=>ie(o.target.value),rows:4,placeholder:"Explain the reasoning behind your assessment, including any factors that influenced your decision.",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true})]})]}),jsxs("div",{className:"mt-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Breach Notification Requirements"}),jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"Under the Nigeria Data Protection Act (NDPA), Section 40, data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. This assessment will determine if notification is required for this breach."})]}),jsx("div",{className:"mt-6",children:jsx("button",{type:"submit",className:a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${Z}`,v.primaryButton||v.submitButton,d),children:K})})]})})]})};var Ce=({breachReports:g,riskAssessments:u,regulatoryNotifications:w,onSelectBreach:J,onRequestAssessment:_,onRequestNotification:K,title:ae="Breach Notification Manager",description:Z="Manage data breach notifications and track compliance with NDPA Section 40 requirements.",className:v="",buttonClassName:d="",classNames:l={},unstyled:A=false,showBreachDetails:j=true,showNotificationTimeline:se=true,showDeadlineAlerts:P=true})=>{var H;let[b,D]=useState(null),[C,q]=useState(g),[B,E]=useState("all"),[I,M]=useState(""),[O,G]=useState("discoveredAt"),[W,Q]=useState("desc");useEffect(()=>{let s=[...g];if(B!=="all"&&(s=s.filter(m=>m.status===B)),I){let m=I.toLowerCase();s=s.filter(o=>o.title.toLowerCase().includes(m)||o.description.toLowerCase().includes(m)||o.affectedSystems.some(N=>N.toLowerCase().includes(m))||o.dataTypes.some(N=>N.toLowerCase().includes(m)));}s.sort((m,o)=>{let N=0;switch(O){case "title":N=m.title.localeCompare(o.title);break;case "discoveredAt":N=m.discoveredAt-o.discoveredAt;break;case "status":N=m.status.localeCompare(o.status);break;case "riskLevel":let F=u.find(L=>L.breachId===m.id),$=u.find(L=>L.breachId===o.id),oe=(F==null?void 0:F.riskLevel)||"unknown",ee=($==null?void 0:$.riskLevel)||"unknown";N=oe.localeCompare(ee);break;default:N=m.discoveredAt-o.discoveredAt;}return W==="asc"?N:-N}),q(s);},[g,B,I,O,W,u]),useEffect(()=>{C.length>0&&(b&&C.some(m=>m.id===b)||D(C[0].id));},[C,b]);let ie=s=>{D(s),J&&J(s);},Y=()=>{b&&_&&_(b);},re=()=>{b&&K&&K(b);},R=s=>new Date(s).toLocaleString(),h=b?g.find(s=>s.id===b):null,x=b?u.find(s=>s.breachId===b):null,f=b?w.find(s=>s.breachId===b):null,y=h?X(h,x):null;function X(s,m){let o=a$1(s,m||void 0),N=s.discoveredAt+o.timeframeHours*60*60*1e3;return {ndpcNotificationRequired:o.notificationRequired,ndpcNotificationDeadline:N,dataSubjectNotificationRequired:(m==null?void 0:m.highRisksToRightsAndFreedoms)||false,justification:o.justification}}function U(s){let m=Date.now(),o=(s-m)/(3600*1e3);return Number(o.toFixed(1))}let z=s=>s?jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",critical:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[s]}`,l.statusBadge,A),children:s.charAt(0).toUpperCase()+s.slice(1)}):null,p=s=>jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${{ongoing:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",contained:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",resolved:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200"}[s]||"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200"}`,l.statusBadge,A),children:s.charAt(0).toUpperCase()+s.slice(1)}),k=()=>{if(!h||!y)return null;if(!y.ndpcNotificationRequired)return jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"Notification Not Required"}),jsx("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:"Based on the risk assessment, NDPC notification is not required for this breach."})]});if(f)return jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"Notification Sent"}),jsxs("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:["Notification was sent to the NDPC on ",R(f.sentAt),"."]})]});let s=U(y.ndpcNotificationDeadline);return s<=0?jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Notification Deadline Passed"}),jsx("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:"The 72-hour deadline for NDPC notification has passed. Notification should be sent immediately."})]}):s<=24?jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Urgent: Notification Due Soon"}),jsxs("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:["Only ",s," hours remaining until the NDPC notification deadline."]})]}):jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium",children:"Notification Required"}),jsxs("p",{className:"text-xs text-yellow-700 dark:text-yellow-300 mt-1",children:["NDPC notification is required by ",R(y.ndpcNotificationDeadline)," (",s," hours remaining)."]})]})},T=()=>{if(!h)return null;let s=[{title:"Breach Discovered",date:h.discoveredAt,completed:true,description:`Breach was discovered on ${R(h.discoveredAt)}.`},{title:"Risk Assessment",date:x==null?void 0:x.assessedAt,completed:!!x,description:x?`Risk assessment completed on ${R(x.assessedAt)}.`:"Risk assessment has not been completed yet."}];return y!=null&&y.ndpcNotificationRequired&&s.push({title:"NDPC Notification",date:f==null?void 0:f.sentAt,completed:!!f,description:f?`Notification sent to the NDPC on ${R(f.sentAt)}.`:`Notification must be sent to the NDPC by ${R(y.ndpcNotificationDeadline)}.`}),y!=null&&y.dataSubjectNotificationRequired&&s.push({title:"Data Subject Notification",date:void 0,completed:false,description:"Notification to affected data subjects is required but has not been sent yet."}),jsxs("div",{className:a("mt-6",l.timeline,A),children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Notification Timeline"}),jsx("ol",{className:"relative border-l border-gray-200 dark:border-gray-700",children:s.map((m,o)=>jsxs("li",{className:a("mb-6 ml-4",l.timelineStep,A),children:[jsx("div",{className:`absolute w-3 h-3 rounded-full mt-1.5 -left-1.5 border ${m.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"}`}),jsx("time",{className:"mb-1 text-sm font-normal leading-none text-gray-600 dark:text-gray-500",children:m.date?R(m.date):"Pending"}),jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:m.title}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:m.description})]},o))})]})};return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${v}`,l.root,A),children:[jsxs("div",{className:a("",l.header,A),children:[jsx("h2",{className:a("text-xl font-bold mb-2",l.title,A),children:ae}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:Z})]}),jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-3 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"statusFilter",className:"block text-sm font-medium mb-1",children:"Status Filter"}),jsxs("select",{id:"statusFilter",value:B,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-[rgb(var(--ndpr-ring))]",children:[jsx("option",{value:"all",children:"All Statuses"}),jsx("option",{value:"ongoing",children:"Ongoing"}),jsx("option",{value:"contained",children:"Contained"}),jsx("option",{value:"resolved",children:"Resolved"})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"sortBy",className:"block text-sm font-medium mb-1",children:"Sort By"}),jsxs("select",{id:"sortBy",value:O,onChange:s=>G(s.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:[jsx("option",{value:"discoveredAt",children:"Discovery Date"}),jsx("option",{value:"title",children:"Title"}),jsx("option",{value:"status",children:"Status"}),jsx("option",{value:"riskLevel",children:"Risk Level"})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"searchTerm",className:"block text-sm font-medium mb-1",children:"Search"}),jsx("input",{type:"text",id:"searchTerm",value:I,onChange:s=>M(s.target.value),placeholder:"Search breaches...",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[jsxs("div",{className:"md:col-span-1",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Breach Reports"}),C.length===0?jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No breach reports found."}):jsx("div",{className:a("space-y-2 max-h-96 overflow-y-auto pr-2",l.breachList,A),children:C.map(s=>{let m=u.find($=>$.breachId===s.id),o=w.find($=>$.breachId===s.id),N=X(s,m),F=null;if(N!=null&&N.ndpcNotificationRequired)if(o)F=jsx("span",{className:"text-xs text-green-600 dark:text-green-400",children:"Notified"});else {let $=U(N.ndpcNotificationDeadline);$<=0?F=jsx("span",{className:"text-xs text-red-600 dark:text-red-400 font-bold",children:"Overdue"}):$<=24?F=jsx("span",{className:"text-xs text-red-600 dark:text-red-400",children:"Urgent"}):F=jsx("span",{className:"text-xs text-yellow-600 dark:text-yellow-400",children:"Required"});}else F=jsx("span",{className:"text-xs text-green-600 dark:text-green-400",children:"Not Required"});return jsxs("div",{className:a(`p-3 rounded-md cursor-pointer ${b===s.id?"bg-[rgb(var(--ndpr-primary)/0.05)] dark:bg-[rgb(var(--ndpr-primary)/0.1)] border border-[rgb(var(--ndpr-primary)/0.2)] dark:border-[rgb(var(--ndpr-primary)/0.3)]":"bg-gray-50 dark:bg-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600"}`,l.breachItem,A),onClick:()=>ie(s.id),children:[jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsx("h4",{className:"font-medium text-sm",children:s.title}),p(s.status)]}),jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:["Discovered: ",new Date(s.discoveredAt).toLocaleDateString()]}),jsxs("div",{className:"flex justify-between items-center mt-2",children:[jsx("div",{children:m&&z(m.riskLevel)}),jsx("div",{children:F})]})]},s.id)})})]}),jsx("div",{className:a("md:col-span-2",l.detailPanel,A),children:h?jsxs("div",{children:[jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsx("h3",{className:"text-lg font-medium",children:h.title}),p(h.status)]}),P&&jsx("div",{className:"mb-4",children:k()}),j&&jsxs("div",{className:"mb-6",children:[jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Discovered:"})," ",R(h.discoveredAt)]}),h.occurredAt&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Occurred:"})," ",R(h.occurredAt)]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Reporter:"})," ",h.reporter.name]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",h.affectedSystems.join(", ")]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Data Types:"})," ",h.dataTypes.join(", ")]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",h.estimatedAffectedSubjects||"Unknown"]})]})]}),jsxs("div",{className:"mb-4",children:[jsx("p",{className:"text-sm font-medium",children:"Description:"}),jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:h.description})]}),h.initialActions&&jsxs("div",{children:[jsx("p",{className:"text-sm font-medium",children:"Initial Actions Taken:"}),jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:h.initialActions})]})]}),jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Risk Assessment"}),x?jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:[jsxs("div",{className:"flex justify-between items-center mb-2",children:[jsx("p",{className:"text-sm font-medium",children:"Risk Level:"}),z(x.riskLevel)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risk Score:"})," ",x.overallRiskScore," / 5"]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risks to Rights and Freedoms:"})," ",x.risksToRightsAndFreedoms?"Yes":"No"]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"High Risks to Rights and Freedoms:"})," ",x.highRisksToRightsAndFreedoms?"Yes":"No"]}),jsx("p",{className:"text-sm mb-1",children:jsx("span",{className:"font-medium",children:"Justification:"})}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-300 bg-white dark:bg-gray-800 p-2 rounded-md",children:x.justification})]}):jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200",children:"Risk assessment has not been conducted yet."}),jsx("button",{onClick:Y,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${d}`,children:"Conduct Risk Assessment"})]})]}),jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Notification Status"}),f?jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:[jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Notification Sent:"})," ",R(f.sentAt)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Method:"})," ",f.method.charAt(0).toUpperCase()+f.method.slice(1)]}),f.referenceNumber&&jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Reference Number:"})," ",f.referenceNumber]}),(f.ndpcContact||f.nitdaContact)&&jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"NDPC Contact:"})," ",(H=f.ndpcContact||f.nitdaContact)==null?void 0:H.name]})]}):jsx("div",{children:y!=null&&y.ndpcNotificationRequired?jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200",children:"NDPC notification is required but has not been sent yet."}),jsx("button",{onClick:re,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${d}`,children:"Generate Notification"})]}):jsx("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:jsx("p",{className:"text-sm text-green-800 dark:text-green-200",children:"NDPC notification is not required for this breach."})})})]}),se&&T()]}):jsx("div",{className:"flex items-center justify-center h-64 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Select a breach to view details"})})})]})]})};var Te=({breachData:g,assessmentData:u,organizationInfo:w,onGenerate:J,title:_="Generate NDPC Notification Report",description:K="Generate a report for submission to the NDPC in compliance with NDPA Section 40 breach notification requirements.",generateButtonText:ae="Generate Report",className:Z="",buttonClassName:v="",classNames:d={},unstyled:l=false,showPreview:A=true,allowEditing:j=true,allowDownload:se=true,downloadFormat:P="pdf"})=>{let[b,D]=useState(""),[C,q]=useState(""),[B,E]=useState(""),[I,M]=useState(""),[O,G]=useState("email"),[W,Q]=useState(""),[ie,Y]=useState(""),[re,R]=useState(false),[h,x]=useState(false);useEffect(()=>{let p=y();D(p),R(true);},[g,u,w]);let f=p=>new Date(p).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),y=()=>`
2
+ NDPC DATA BREACH NOTIFICATION
3
+
4
+ Date: ${new Date().toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"})}
5
+
6
+ Reference: NDPA Section 40 - Breach Notification
7
+
8
+ ORGANIZATION DETAILS
9
+ -------------------
10
+ Organization Name: ${w.name}
11
+ ${w.registrationNumber?`Registration Number: ${w.registrationNumber}`:""}
12
+ Address: ${w.address}
13
+ ${w.website?`Website: ${w.website}`:""}
14
+
15
+ DATA PROTECTION OFFICER
16
+ ----------------------
17
+ Name: ${w.dpoName}
18
+ Email: ${w.dpoEmail}
19
+ ${w.dpoPhone?`Phone: ${w.dpoPhone}`:""}
20
+
21
+ BREACH DETAILS
22
+ -------------
23
+ Breach Title: ${g.title}
24
+ Date Discovered: ${f(g.discoveredAt)}
25
+ ${g.occurredAt?`Date Occurred: ${f(g.occurredAt)}`:"Date Occurred: Unknown"}
26
+ Status: ${g.status.charAt(0).toUpperCase()+g.status.slice(1)}
27
+
28
+ Description of the Breach:
29
+ ${g.description}
30
+
31
+ Affected Systems/Applications:
32
+ ${g.affectedSystems.join(", ")}
33
+
34
+ Types of Personal Data Involved:
35
+ ${g.dataTypes.join(", ")}
36
+
37
+ Estimated Number of Data Subjects Affected:
38
+ ${g.estimatedAffectedSubjects||"Unknown"}
39
+
40
+ RISK ASSESSMENT
41
+ --------------
42
+ ${u?`
43
+ Overall Risk Level: ${u.riskLevel.charAt(0).toUpperCase()+u.riskLevel.slice(1)}
44
+ Risk to Rights and Freedoms of Data Subjects: ${u.risksToRightsAndFreedoms?"Yes":"No"}
45
+ High Risk to Rights and Freedoms of Data Subjects: ${u.highRisksToRightsAndFreedoms?"Yes":"No"}
46
+
47
+ Justification for Risk Assessment:
48
+ ${u.justification}
49
+ `:"Risk assessment has not been conducted yet."}
50
+
51
+ MEASURES TAKEN
52
+ -------------
53
+ Measures taken or proposed to address the breach:
54
+ ${g.initialActions||"To be determined"}
55
+
56
+ Measures taken or proposed to mitigate possible adverse effects:
57
+ [Please specify measures taken to mitigate adverse effects]
58
+
59
+ NOTIFICATION TO DATA SUBJECTS (NDPA Section 40(4))
60
+ ----------------------------
61
+ Have data subjects been notified: [Yes/No]
62
+ If yes, date of notification: [Date]
63
+ If no, planned date of notification: [Date]
64
+ Reason for delay (if applicable): [Reason]
65
+
66
+ ADDITIONAL INFORMATION
67
+ ---------------------
68
+ [Any additional information relevant to the breach]
69
+
70
+ This notification is made in compliance with the Nigeria Data Protection Act (NDPA), Section 40.
71
+ `,X=p=>{p.preventDefault();let k={id:`notification_${Date.now()}`,breachId:g.id,sentAt:Date.now(),method:O,referenceNumber:W||void 0,ndpcContact:C?{name:C,email:B,phone:I||void 0}:void 0,content:b,attachments:[]};J(k),x(true);},U=()=>{let p,k,T;switch(P){case "html":{p="text/html",k="html",T=`<!DOCTYPE html>
72
+ <html lang="en">
73
+ <head>
74
+ <meta charset="UTF-8">
75
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
76
+ <title>NDPC Breach Notification Report</title>
77
+ <style>body{font-family:monospace;white-space:pre-wrap;max-width:800px;margin:2rem auto;padding:0 1rem;}</style>
78
+ </head>
79
+ <body>${b.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}</body>
80
+ </html>`;break}case "pdf":p="text/plain",k="pdf.txt",T=b;break;case "docx":p="text/plain",k="docx.txt",T=b;break;default:p="text/plain",k="txt",T=b;}let H=document.createElement("a"),s=new Blob([T],{type:p});H.href=URL.createObjectURL(s),H.download=`NDPC_Breach_Notification_${new Date().toISOString().split("T")[0]}.${k}`,document.body.appendChild(H),H.click(),document.body.removeChild(H);},z=()=>[{value:"email",label:"Email"},{value:"portal",label:"NDPC Portal"},{value:"letter",label:"Formal Letter"},{value:"other",label:"Other"}].map(k=>jsx("option",{value:k.value,children:k.label},k.value));return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${Z}`,d.root,l),children:[jsxs("div",{className:a("",d.header,l),children:[jsx("h2",{className:a("text-xl font-bold mb-2",d.title,l),children:_}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:K})]}),h?jsxs("div",{children:[jsxs("div",{className:"mb-6 p-4 bg-green-50 dark:bg-green-900/20 rounded-md",children:[jsx("h3",{className:"text-lg font-bold text-green-800 dark:text-green-200 mb-2",children:"Report Generated Successfully"}),jsx("p",{className:"text-green-700 dark:text-green-300",children:"Your NDPC notification report has been generated and is ready for submission. Please review the report carefully before submitting it to the NDPC."})]}),jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Submission Details"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxs("div",{children:[jsxs("p",{className:a("text-sm",d.field,l),children:[jsx("span",{className:a("font-medium",d.fieldLabel,l),children:"Method:"})," ",jsx("span",{className:a("",d.fieldValue,l),children:O.charAt(0).toUpperCase()+O.slice(1)})]}),C&&jsxs("p",{className:a("text-sm",d.field,l),children:[jsx("span",{className:a("font-medium",d.fieldLabel,l),children:"Contact Name:"})," ",jsx("span",{className:a("",d.fieldValue,l),children:C})]}),B&&jsxs("p",{className:a("text-sm",d.field,l),children:[jsx("span",{className:a("font-medium",d.fieldLabel,l),children:"Contact Email:"})," ",jsx("span",{className:a("",d.fieldValue,l),children:B})]}),I&&jsxs("p",{className:a("text-sm",d.field,l),children:[jsx("span",{className:a("font-medium",d.fieldLabel,l),children:"Contact Phone:"})," ",jsx("span",{className:a("",d.fieldValue,l),children:I})]})]}),jsxs("div",{children:[jsxs("p",{className:a("text-sm",d.field,l),children:[jsx("span",{className:a("font-medium",d.fieldLabel,l),children:"Date Generated:"})," ",jsx("span",{className:a("",d.fieldValue,l),children:f(Date.now())})]}),jsxs("p",{className:a("text-sm",d.field,l),children:[jsx("span",{className:a("font-medium",d.fieldLabel,l),children:"Breach ID:"})," ",jsx("span",{className:a("",d.fieldValue,l),children:g.id})]}),W&&jsxs("p",{className:a("text-sm",d.field,l),children:[jsx("span",{className:a("font-medium",d.fieldLabel,l),children:"Reference Number:"})," ",jsx("span",{className:a("",d.fieldValue,l),children:W})]})]})]})]}),A&&jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Report Preview"}),jsx("div",{className:a("bg-gray-50 dark:bg-gray-700 p-4 rounded-md",d.reportPreview,l),children:jsx("pre",{className:"whitespace-pre-wrap text-sm font-mono text-gray-800 dark:text-gray-200",children:b})})]}),jsxs("div",{className:"flex flex-wrap gap-3",children:[se&&jsxs("button",{onClick:U,className:a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${v}`,d.secondaryButton||d.downloadButton,l),children:["Download Report (",P.toUpperCase(),")"]}),jsx("button",{onClick:()=>x(false),className:`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${v}`,children:"Edit Report"})]})]}):jsx("form",{onSubmit:X,children:jsxs("div",{className:"space-y-6",children:[jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Notification Method"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"method",className:"block text-sm font-medium mb-1",children:["Method of Submission ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("select",{id:"method",value:O,onChange:p=>G(p.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true,children:z()})]}),jsxs("div",{children:[jsx("label",{htmlFor:"referenceNumber",className:"block text-sm font-medium mb-1",children:"Reference Number (if available)"}),jsx("input",{type:"text",id:"referenceNumber",value:W,onChange:p=>Q(p.target.value),placeholder:"e.g. NDPC/BR/2024/001",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"NDPC Contact (if known)"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[jsxs("div",{children:[jsx("label",{htmlFor:"contactName",className:"block text-sm font-medium mb-1",children:"Contact Name"}),jsx("input",{type:"text",id:"contactName",value:C,onChange:p=>q(p.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"contactEmail",className:"block text-sm font-medium mb-1",children:"Contact Email"}),jsx("input",{type:"email",id:"contactEmail",value:B,onChange:p=>E(p.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"contactPhone",className:"block text-sm font-medium mb-1",children:"Contact Phone"}),jsx("input",{type:"tel",id:"contactPhone",value:I,onChange:p=>M(p.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Additional Information"}),jsxs("div",{children:[jsx("label",{htmlFor:"additionalInfo",className:"block text-sm font-medium mb-1",children:"Additional Information to Include"}),jsx("textarea",{id:"additionalInfo",value:ie,onChange:p=>Y(p.target.value),rows:3,placeholder:"Any additional information you want to include in the report",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]}),j&&jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Report Content"}),jsxs("div",{children:[jsxs("label",{htmlFor:"reportContent",className:"block text-sm font-medium mb-1",children:["Edit Report Content ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("textarea",{id:"reportContent",value:b,onChange:p=>D(p.target.value),rows:20,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] font-mono text-sm",required:true})]})]}),jsxs("div",{className:"mt-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Breach Notification Requirements"}),jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"Under the Nigeria Data Protection Act (NDPA), Section 40, data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. This report will help you comply with this requirement."})]}),jsx("div",{className:"mt-6",children:jsx("button",{type:"submit",className:a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${v}`,d.primaryButton||d.generateButton,l),children:ae})})]})})]})};export{ve as a,Ce as b,Te as c};//# sourceMappingURL=chunk-NUDVUAD4.mjs.map
81
+ //# sourceMappingURL=chunk-NUDVUAD4.mjs.map
@@ -0,0 +1,2 @@
1
+ function o(i){var a,d;let t=[];return i.id||t.push("Request ID is required"),i.type||t.push("Request type is required"),i.status||t.push("Request status is required"),i.createdAt||t.push("Creation timestamp is required"),(a=i.subject)!=null&&a.name||t.push("Data subject name is required"),(d=i.subject)!=null&&d.email||t.push("Data subject email is required"),{formattedRequest:{requestId:i.id,requestType:i.type,status:i.status,createdDate:new Date(i.createdAt).toISOString(),lastUpdated:i.updatedAt?new Date(i.updatedAt).toISOString():void 0,dueDate:i.dueDate?new Date(i.dueDate).toISOString():void 0,dataSubject:i.subject?{name:i.subject.name,email:i.subject.email,phone:i.subject.phone||"Not provided",identifier:{type:i.subject.identifierType||"Not specified",value:i.subject.identifierValue||"Not provided"}}:void 0,additionalInformation:i.additionalInfo||{},verificationStatus:i.verification?`${i.verification.verified?"Verified":"Not verified"}${i.verification.method?` via ${i.verification.method}`:""}`:"Pending verification",attachments:i.attachments?i.attachments.map(e=>({name:e.name,type:e.type,addedOn:new Date(e.addedAt).toISOString()})):[]},isValid:t.length===0,validationErrors:t}}export{o as a};//# sourceMappingURL=chunk-NXQMU36Z.mjs.map
2
+ //# sourceMappingURL=chunk-NXQMU36Z.mjs.map
@@ -0,0 +1,2 @@
1
+ 'use strict';function h(n){var c;let i={low:0,medium:0,high:0,critical:0},l=0,o=[];((c=n.risks)!=null?c:[]).forEach(e=>{i[e.level]++,e.score>l&&(l=e.score),(e.level==="high"||e.level==="critical")&&!e.mitigated&&o.push(e);});let s;i.critical>0?s="critical":i.high>2||i.high>0&&i.medium>3?s="high":i.high>0||i.medium>1?s="medium":s="low";let r=s==="high"||s==="critical",a=o.length===0,t=[];return o.length>0&&t.push(`Mitigate the following high/critical risks before proceeding: ${o.map(e=>e.description).join(", ")}`),r&&t.push("Consult with the NDPC (Nigeria Data Protection Commission) before proceeding with this processing activity, as required by NDPA Section 39."),i.medium>0&&t.push("Implement additional safeguards to reduce medium-level risks where possible."),s!=="low"?t.push("Schedule a review of this DPIA in 6 months to reassess risks and effectiveness of mitigation measures."):t.push("Schedule a review of this DPIA in 12 months as part of regular compliance activities."),{overallRiskLevel:s,requiresConsultation:r,canProceed:a,recommendations:t}}exports.a=h;//# sourceMappingURL=chunk-P42Z5CFE.js.map
2
+ //# sourceMappingURL=chunk-P42Z5CFE.js.map
@@ -0,0 +1,2 @@
1
+ import {a as a$1}from'./chunk-DJGS7SSN.mjs';import {a as a$2}from'./chunk-6WIP33TW.mjs';import {a,b}from'./chunk-WWT2ZSNU.mjs';import {useRef,useReducer,useState,useCallback,useEffect}from'react';function G(c,d){switch(d.type){case "LOAD":return d.payload;case "ADD_REPORT":return b(a({},c),{reports:[...c.reports,d.payload]});case "UPDATE_REPORT":{let f=[...c.reports];return f[d.payload.index]=d.payload.report,b(a({},c),{reports:f})}case "SET_ASSESSMENT":{let{existing:f,id:S,assessment:g}=d.payload,A=f?c.assessments.map(R=>R.id===S?g:R):[...c.assessments,g];return b(a({},c),{assessments:A})}case "SET_NOTIFICATION":{let{existing:f,id:S,notification:g}=d.payload,A=f?c.notifications.map(R=>R.id===S?g:R):[...c.notifications,g];return b(a({},c),{notifications:A})}case "CLEAR":return {reports:[],assessments:[],notifications:[]}}}function J(c,d){return d?a$2(c):{load:()=>null,save:()=>{},remove:()=>{}}}function X({categories:c,initialReports:d=[],adapter:f,storageKey:S="ndpr_breach_data",useLocalStorage:g=true,onReport:A,onAssessment:R,onNotification:I}){let k=f!=null?f:J(S,g),E=useRef(k);E.current=k;let[b$1,y]=useReducer(G,{reports:d,assessments:[],notifications:[]}),[x,T]=useState(true),l=useRef(b$1);l.current=b$1;let h=useCallback(t=>{Promise.resolve(E.current.save(t)).catch(s=>{console.warn("[ndpr-toolkit] Failed to save breach data:",s);});},[]);useEffect(()=>{let t=false;try{let s=E.current.load(),i=e=>{var r,n,a;e&&y({type:"LOAD",payload:{reports:(r=e.reports)!=null?r:[],assessments:(n=e.assessments)!=null?n:[],notifications:(a=e.notifications)!=null?a:[]}}),T(!1);};s instanceof Promise?s.then(e=>{t||i(e);},()=>{t||T(!1);}):i(s);}catch(s){t||T(false);}return ()=>{t=true;}},[]);let B=useCallback(t=>`${t}_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,[]),_=useCallback(t=>{let s=a({id:B("breach"),reportedAt:Date.now()},t);y({type:"ADD_REPORT",payload:s});let i=l.current,e=b(a({},i),{reports:[...i.reports,s]});return h(e),A&&A(s),s},[B,A,h]),P=useCallback((t,s)=>{let i=l.current,e=i.reports.findIndex(a=>a.id===t);if(e===-1)return null;let r=a(a({},i.reports[e]),s);y({type:"UPDATE_REPORT",payload:{index:e,report:r}});let n=[...i.reports];return n[e]=r,h(b(a({},i),{reports:n})),r},[h]),w=useCallback(t=>l.current.reports.find(s=>s.id===t)||null,[]),L=useCallback((t,s)=>{let i=l.current,e=i.assessments.find(u=>u.breachId===t),r,n;e?(r=b(a(a({},e),s),{assessedAt:Date.now()}),n=true):(r=a({id:B("assessment"),breachId:t,assessedAt:Date.now()},s),n=false),y({type:"SET_ASSESSMENT",payload:{existing:n,id:e==null?void 0:e.id,assessment:r}});let a$1=n?i.assessments.map(u=>u.id===e.id?r:u):[...i.assessments,r];return h(b(a({},i),{assessments:a$1})),R&&R(r),r},[B,R,h]),U=useCallback(t=>l.current.assessments.find(s=>s.breachId===t)||null,[]),D=useCallback(t=>{let s=l.current.reports.find(N=>N.id===t)||null,i=l.current.assessments.find(N=>N.breachId===t)||null;if(!s)return null;let{severityLevel:e,notificationRequired:r,timeframeHours:n,justification:a}=a$1(s,i||void 0),u=s.discoveredAt+n*60*60*1e3;return {ndpcNotificationRequired:r,ndpcNotificationDeadline:u,dataSubjectNotificationRequired:e==="high"||e==="critical",justification:a}},[]),F=useCallback((t,s)=>{let i=l.current,e=i.notifications.find(u=>u.breachId===t),r,n;e?(r=b(a(a({},e),s),{sentAt:Date.now()}),n=true):(r=a({id:B("notification"),breachId:t,sentAt:Date.now()},s),n=false),y({type:"SET_NOTIFICATION",payload:{existing:n,id:e==null?void 0:e.id,notification:r}});let a$1=n?i.notifications.map(u=>u.id===e.id?r:u):[...i.notifications,r];return h(b(a({},i),{notifications:a$1})),I&&I(r),r},[B,I,h]),M=useCallback(t=>l.current.notifications.find(s=>s.breachId===t)||null,[]),$=useCallback((t=24)=>{let s=Date.now(),i=l.current,e=[];return i.reports.forEach(r=>{if(i.notifications.some(O=>O.breachId===r.id))return;let n=i.assessments.find(O=>O.breachId===r.id)||null;if(!n)return;let a=D(r.id);if(!a||!a.ndpcNotificationRequired)return;let N=(a.ndpcNotificationDeadline-s)/(3600*1e3);N<=t&&e.push({report:r,assessment:n,requirements:a,hoursRemaining:N});}),e.sort((r,n)=>r.hoursRemaining-n.hoursRemaining)},[D]),j=useCallback(()=>{y({type:"CLEAR"}),Promise.resolve(E.current.remove()).catch(t=>{console.warn("[ndpr-toolkit] Failed to remove breach data:",t);});},[]);return {reports:b$1.reports,assessments:b$1.assessments,notifications:b$1.notifications,reportBreach:_,updateReport:P,getReport:w,assessRisk:L,getAssessment:U,calculateNotificationRequirements:D,sendNotification:F,getNotification:M,getBreachesRequiringNotification:$,clearBreachData:j,isLoading:x}}export{X as a};//# sourceMappingURL=chunk-PATONNTZ.mjs.map
2
+ //# sourceMappingURL=chunk-PATONNTZ.mjs.map
@@ -1,2 +1,2 @@
1
- import {b as b$1,c,d}from'./chunk-PYEX7DFR.mjs';import {b,a}from'./chunk-WWT2ZSNU.mjs';import {useRef,useState,useEffect,useCallback}from'react';function E({initialData:S,adapter:l,onRecordAdd:p,onRecordUpdate:g,onRecordArchive:f}){let d$1=useRef(l);d$1.current=l;let[s,u]=useState(S),[v,P]=useState(l!==void 0);useEffect(()=>{if(!d$1.current)return;let t=false;try{let e=d$1.current.load();e instanceof Promise?e.then(r=>{t||(r&&u(r),P(!1));},()=>{t||P(!1);}):(e&&u(e),P(!1));}catch(e){t||P(false);}return ()=>{t=true;}},[]);let n=useCallback(t=>{d$1.current&&Promise.resolve(d$1.current.save(t)).catch(e=>{console.warn("[ndpr-toolkit] Failed to save ROPA:",e);});},[]),C=useCallback(t=>{u(e=>{let r=b(a({},e),{records:[...e.records,t],lastUpdated:Date.now()});return n(r),r}),p==null||p(t);},[p,n]),w=useCallback((t,e)=>{u(r=>{let a$1=b(a({},r),{records:r.records.map(R=>R.id===t?b(a(a({},R),e),{updatedAt:Date.now()}):R),lastUpdated:Date.now()});return n(a$1),a$1}),g==null||g(t,e);},[g,n]),x=useCallback(t=>{u(e=>{let r=b(a({},e),{records:e.records.map(a$1=>a$1.id===t?b(a({},a$1),{status:"archived",updatedAt:Date.now()}):a$1),lastUpdated:Date.now()});return n(r),r}),f==null||f(t);},[f,n]),D=useCallback(t=>s.records.find(e=>e.id===t),[s.records]),G=useCallback(()=>b$1(s),[s]),b$2=useCallback(()=>c(s),[s]),L=useCallback(()=>d(s),[s]);return {ropa:s,addRecord:C,updateRecord:w,archiveRecord:x,getRecord:D,getSummary:G,exportCSV:b$2,getComplianceGaps:L,isLoading:v}}export{E as a};//# sourceMappingURL=chunk-WLSW4Z4W.mjs.map
2
- //# sourceMappingURL=chunk-WLSW4Z4W.mjs.map
1
+ import {b as b$1,c,d}from'./chunk-SHMJNRHO.mjs';import {b,a}from'./chunk-WWT2ZSNU.mjs';import {useRef,useState,useEffect,useCallback}from'react';function E({initialData:S,adapter:l,onRecordAdd:p,onRecordUpdate:g,onRecordArchive:f}){let d$1=useRef(l);d$1.current=l;let[s,u]=useState(S),[v,P]=useState(l!==void 0);useEffect(()=>{if(!d$1.current)return;let t=false;try{let e=d$1.current.load();e instanceof Promise?e.then(r=>{t||(r&&u(r),P(!1));},()=>{t||P(!1);}):(e&&u(e),P(!1));}catch(e){t||P(false);}return ()=>{t=true;}},[]);let n=useCallback(t=>{d$1.current&&Promise.resolve(d$1.current.save(t)).catch(e=>{console.warn("[ndpr-toolkit] Failed to save ROPA:",e);});},[]),C=useCallback(t=>{u(e=>{let r=b(a({},e),{records:[...e.records,t],lastUpdated:Date.now()});return n(r),r}),p==null||p(t);},[p,n]),w=useCallback((t,e)=>{u(r=>{let a$1=b(a({},r),{records:r.records.map(R=>R.id===t?b(a(a({},R),e),{updatedAt:Date.now()}):R),lastUpdated:Date.now()});return n(a$1),a$1}),g==null||g(t,e);},[g,n]),x=useCallback(t=>{u(e=>{let r=b(a({},e),{records:e.records.map(a$1=>a$1.id===t?b(a({},a$1),{status:"archived",updatedAt:Date.now()}):a$1),lastUpdated:Date.now()});return n(r),r}),f==null||f(t);},[f,n]),D=useCallback(t=>s.records.find(e=>e.id===t),[s.records]),G=useCallback(()=>b$1(s),[s]),b$2=useCallback(()=>c(s),[s]),L=useCallback(()=>d(s),[s]);return {ropa:s,addRecord:C,updateRecord:w,archiveRecord:x,getRecord:D,getSummary:G,exportCSV:b$2,getComplianceGaps:L,isLoading:v}}export{E as a};//# sourceMappingURL=chunk-PM7O5IGE.mjs.map
2
+ //# sourceMappingURL=chunk-PM7O5IGE.mjs.map
@@ -0,0 +1,2 @@
1
+ import {a}from'./chunk-AYKLAEOU.mjs';import {b,a as a$1}from'./chunk-WWT2ZSNU.mjs';import {useState,useRef,useEffect,useCallback}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var _=({options:b$1,settings:l,onSave:v,title:h="Manage Your Privacy Settings",description:R="Update your consent preferences at any time. Required cookies cannot be disabled as they are necessary for the website to function. Consent management is provided in accordance with NDPA Sections 25-26.",saveButtonText:B="Save Preferences",resetButtonText:x="Reset to Defaults",version:$="1.0",className:S="",buttonClassName:o="",primaryButtonClassName:i="",secondaryButtonClassName:y="",classNames:e,unstyled:s,showSuccessMessage:m=true,successMessage:k="Your preferences have been saved.",successMessageDuration:T=3e3})=>{let[p,t]=useState({}),[r,d]=useState(false),g=useRef(null);useEffect(()=>()=>{g.current&&clearTimeout(g.current);},[]),useEffect(()=>{if(l&&l.consents)t(l.consents);else {let n={};b$1.forEach(c=>{n[c.id]=c.defaultValue||false;}),t(n);}},[b$1,l]);let I=(n,c)=>{t(Y=>b(a$1({},Y),{[n]:c}));},M=()=>{let n={consents:p,timestamp:Date.now(),version:$,method:"manager",hasInteracted:true};v(n),m&&(d(true),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{d(false);},T));},O=()=>{let n={};b$1.forEach(c=>{n[c.id]=c.defaultValue||false;}),t(n);},w=(e==null?void 0:e.primaryButton)||(e==null?void 0:e.saveButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${o} ${i}`,C=(e==null?void 0:e.secondaryButton)||(e==null?void 0:e.resetButton)||`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${o} ${y}`;return jsxs("div",{className:a(`bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 ${S}`,e==null?void 0:e.root,s),children:[jsx("h2",{className:a("text-xl font-bold mb-2",e==null?void 0:e.title,s),children:h}),jsx("p",{className:a("mb-6 text-gray-600 dark:text-gray-300",e==null?void 0:e.description,s),children:R}),jsx("div",{className:a("space-y-6",e==null?void 0:e.optionsList,s),children:b$1.map(n=>jsx("div",{className:a("border-b border-gray-200 dark:border-gray-700 pb-4 last:border-0",e==null?void 0:e.optionItem,s),children:jsxs("div",{className:"flex items-start justify-between",children:[jsxs("div",{children:[jsx("h3",{className:"font-medium text-gray-900 dark:text-white",children:n.label}),jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mt-1",children:n.description})]}),jsx("div",{className:"ml-4 flex-shrink-0",children:jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[jsx("input",{type:"checkbox",className:"sr-only peer",checked:p[n.id]||false,onChange:c=>I(n.id,c.target.checked),disabled:n.required}),jsx("div",{className:a(`w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-[rgb(var(--ndpr-ring)/0.3)] rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-[rgb(var(--ndpr-primary))] ${n.required?"opacity-60":""}`,e==null?void 0:e.toggle,s)}),jsxs("span",{className:"ml-3 text-sm font-medium text-gray-900 dark:text-gray-300",children:[p[n.id]?"Enabled":"Disabled",n.required&&jsx("span",{className:"text-xs text-red-500 ml-1",children:"(Required)"})]})]})})]})},n.id))}),r&&jsx("div",{className:"mt-4 p-3 bg-green-50 dark:bg-green-900/20 text-green-800 dark:text-green-200 rounded-md","aria-live":"polite",role:"status",children:k}),jsxs("div",{className:"mt-6 flex flex-wrap gap-3",children:[jsx("button",{onClick:M,className:a(w,e==null?void 0:e.saveButton,s),children:B}),jsx("button",{onClick:O,className:a(C,e==null?void 0:e.resetButton,s),children:x})]}),jsxs("div",{className:"mt-4 text-xs text-gray-600 dark:text-gray-400",children:[jsxs("p",{children:["Last updated: ",l?new Date(l.timestamp).toLocaleString():"Never"]}),jsxs("p",{children:["Version: ",$]})]})]})};var N=({settings:b,storageOptions:l={},onLoad:v,onSave:h,autoSave:R=true,autoLoad:B=true,classNames:x,unstyled:$,children:S})=>{let{storageKey:o="ndpr_consent",storageType:i="localStorage",cookieOptions:y={}}=l,[e,s]=useState(false),m=useCallback(()=>{let t=null;try{if(i==="localStorage"&&typeof window!="undefined"){let r=localStorage.getItem(o);r&&(t=JSON.parse(r));}else if(i==="sessionStorage"&&typeof window!="undefined"){let r=sessionStorage.getItem(o);r&&(t=JSON.parse(r));}else if(i==="cookie"&&typeof document!="undefined"){let d=document.cookie.split(";").find(g=>g.trim().startsWith(`${o}=`));if(d){let g=d.split("=")[1];t=JSON.parse(decodeURIComponent(g));}}s(!0),v&&v(t);}catch(r){console.error("Error loading consent settings:",r),s(true),v&&v(null);}return t},[i,o,v]),k=useCallback(t=>{try{let r=JSON.stringify(t);if(i==="localStorage"&&typeof window!="undefined")localStorage.setItem(o,r);else if(i==="sessionStorage"&&typeof window!="undefined")sessionStorage.setItem(o,r);else if(i==="cookie"&&typeof document!="undefined"){let{domain:d,path:g="/",expires:I=365,secure:M=!0,sameSite:O="Lax"}=y,w=new Date;w.setDate(w.getDate()+I);let C=`${o}=${encodeURIComponent(r)}; path=${g}; expires=${w.toUTCString()}`;d&&(C+=`; domain=${d}`),M&&(C+="; secure"),C+=`; samesite=${O}`,document.cookie=C;}return h&&h(t),!0}catch(r){return console.error("Error saving consent settings:",r),false}},[i,o,y,h]),T=useCallback(()=>{try{if(i==="localStorage"&&typeof window!="undefined")localStorage.removeItem(o);else if(i==="sessionStorage"&&typeof window!="undefined")sessionStorage.removeItem(o);else if(i==="cookie"&&typeof document!="undefined"){let{domain:t,path:r="/"}=y,d=`${o}=; path=${r}; expires=Thu, 01 Jan 1970 00:00:00 GMT`;t&&(d+=`; domain=${t}`),document.cookie=d;}return !0}catch(t){return console.error("Error clearing consent settings:",t),false}},[i,o,y]);useEffect(()=>{B&&!e&&m();},[B,e,m]),useEffect(()=>{R&&e&&k(b);},[b,R,e,k]);let p=a("",x==null?void 0:x.root,$);if(typeof S=="function"){let t=S({loadSettings:m,saveSettings:k,clearSettings:T,loaded:e});return p?jsx("div",{className:p,children:t}):jsx(Fragment,{children:t})}return p?jsx("div",{className:p,children:S}):jsx(Fragment,{children:S})};export{_ as a,N as b};//# sourceMappingURL=chunk-Q7VHB64E.mjs.map
2
+ //# sourceMappingURL=chunk-Q7VHB64E.mjs.map
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkEPF7J2FK_js=require('./chunk-EPF7J2FK.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var lr=({requestTypes:I,onSubmit:Q,onValidationError:q,title:X="Submit a Data Subject Request",description:V="Use this form to exercise your rights under the Nigeria Data Protection Act (NDPA), Part IV, Sections 29-36.",submitButtonText:s="Submit Request",className:A="",buttonClassName:D="",showConfirmation:N=true,confirmationMessage:rr="Your request has been submitted successfully. You will receive a confirmation email shortly.",requireIdentityVerification:_=true,identifierTypes:k=[{id:"email",label:"Email Address"},{id:"account",label:"Account Number"},{id:"customer_id",label:"Customer ID"}],collectAdditionalContact:er=true,labels:y={},classNames:r,unstyled:o=false,isSubmitting:f=false,defaultValues:g,onReset:S})=>{var G,Y,H,L,U,W;let[c,P]=react.useState((g==null?void 0:g.requestType)||""),[R,j]=react.useState(((G=g==null?void 0:g.dataSubject)==null?void 0:G.fullName)||""),[x,E]=react.useState(((Y=g==null?void 0:g.dataSubject)==null?void 0:Y.email)||""),[F,O]=react.useState(((H=g==null?void 0:g.dataSubject)==null?void 0:H.phone)||""),[B,z]=react.useState(((L=g==null?void 0:g.dataSubject)==null?void 0:L.identifierType)||((U=k[0])==null?void 0:U.id)||""),[T,M]=react.useState(((W=g==null?void 0:g.dataSubject)==null?void 0:W.identifierValue)||""),[b,w]=react.useState((g==null?void 0:g.additionalInfo)||{}),[ir,$]=react.useState(false),[d,Z]=react.useState({}),tr=()=>{var e;P(""),j(""),E(""),O(""),z(((e=k[0])==null?void 0:e.id)||""),M(""),w({}),$(false),Z({}),S==null||S();},u=I.find(e=>e.id===c),or=e=>{P(e.target.value),w({});},v=(e,a)=>{w(l=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},l),{[e]:a}));},nr=()=>{let e={};return R.trim()||(e.fullName="Full name is required"),x.trim()?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(x)||(e.email="Email is invalid"):e.email="Email is required",c||(e.requestType="Please select a request type"),_&&!T.trim()&&(e.identifierValue="Identifier value is required"),u!=null&&u.requiresAdditionalInfo&&u.additionalFields&&u.additionalFields.forEach(a=>{a.required&&!b[a.id]&&(e[`additional_${a.id}`]=`${a.label} is required`);}),Z(e),e},dr=e=>{e.preventDefault();let a=nr();if(Object.keys(a).length>0){q==null||q(a);return}let l=Object.keys(b).length>0?Object.fromEntries(Object.entries(b).map(([ar,C])=>[ar,typeof C=="string"?chunkEPF7J2FK_js.a(C):C])):void 0,h={requestType:c,dataSubject:{fullName:chunkEPF7J2FK_js.a(R),email:chunkEPF7J2FK_js.a(x),phone:F?chunkEPF7J2FK_js.a(F):void 0,identifierType:B,identifierValue:chunkEPF7J2FK_js.a(T)},additionalInfo:l,submittedAt:Date.now()};Q(h),N&&$(true);};return ir?jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`p-4 bg-green-50 dark:bg-green-900/20 rounded-md ${A}`,r==null?void 0:r.successMessage,o),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-lg font-bold text-green-800 dark:text-green-200 mb-2",r==null?void 0:r.title,o),children:"Request Submitted"}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-green-700 dark:text-green-300",r==null?void 0:r.description,o),children:rr}),jsxRuntime.jsx("button",{onClick:()=>$(false),className:chunkE64TU6IU_js.a(`mt-4 px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${D}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:"Submit Another Request"})]}):jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${A}`,r==null?void 0:r.root,o),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",r==null?void 0:r.title,o),children:X}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("mb-6 text-gray-600 dark:text-gray-300",r==null?void 0:r.description,o),children:V}),jsxRuntime.jsx("form",{onSubmit:dr,className:chunkE64TU6IU_js.a("",r==null?void 0:r.form,o),children:jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-4",r==null?void 0:r.fieldGroup,o),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Personal Information"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"fullName",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:[y.name||"Full Name"," ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"fullName",value:R,onChange:e=>j(e.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),required:true,"aria-invalid":!!d.fullName,"aria-describedby":d.fullName?"fullName-error":void 0}),d.fullName&&jsxRuntime.jsx("p",{id:"fullName-error",role:"alert",className:"mt-1 text-sm text-red-500",children:d.fullName})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"email",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:[y.email||"Email Address"," ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"email",id:"email",value:x,onChange:e=>E(e.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),required:true,"aria-invalid":!!d.email,"aria-describedby":d.email?"email-error":void 0}),d.email&&jsxRuntime.jsx("p",{id:"email-error",role:"alert",className:"mt-1 text-sm text-red-500",children:d.email})]}),er&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"phone",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:"Phone Number (Optional)"}),jsxRuntime.jsx("input",{type:"tel",id:"phone",value:F,onChange:e=>O(e.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Request Details"}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"requestType",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:[y.requestType||"Request Type"," ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsxs("select",{id:"requestType",value:c,onChange:or,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),required:true,"aria-invalid":!!d.requestType,"aria-describedby":d.requestType?"requestType-error":void 0,children:[jsxRuntime.jsx("option",{value:"",children:"Select a request type"}),I.map(e=>jsxRuntime.jsx("option",{value:e.id,children:e.name},e.id))]}),d.requestType&&jsxRuntime.jsx("p",{id:"requestType-error",role:"alert",className:"mt-1 text-sm text-red-500",children:d.requestType})]}),u&&jsxRuntime.jsxs("div",{className:"mb-4 p-3 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 mb-2",children:u.description}),jsxRuntime.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Estimated completion time: ",u.estimatedCompletionTime," ",u.estimatedCompletionTime===1?"day":"days"]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("label",{htmlFor:"requestDescription",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:y.description||"Additional Information"}),jsxRuntime.jsx("textarea",{id:"requestDescription",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.textarea,o),rows:4,placeholder:"Please provide any additional details that might help us process your request"})]})]}),_&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Identity Verification"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 mb-3",children:"To protect your privacy, we need to verify your identity before processing your request."}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"identifierType",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:["Identifier Type ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("select",{id:"identifierType",value:B,onChange:e=>z(e.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),required:true,children:k.map(e=>jsxRuntime.jsx("option",{value:e.id,children:e.label},e.id))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"identifierValue",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:["Identifier Value ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"identifierValue",value:T,onChange:e=>M(e.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),required:true,"aria-invalid":!!d.identifierValue,"aria-describedby":d.identifierValue?"identifierValue-error":void 0}),d.identifierValue&&jsxRuntime.jsx("p",{id:"identifierValue-error",role:"alert",className:"mt-1 text-sm text-red-500",children:d.identifierValue})]})]})]}),(u==null?void 0:u.requiresAdditionalInfo)&&u.additionalFields&&u.additionalFields.length>0&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Additional Information"}),jsxRuntime.jsx("div",{className:"space-y-4",children:u.additionalFields.map(e=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:e.id,className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:[e.label," ",e.required&&jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),e.type==="text"&&jsxRuntime.jsx("input",{type:"text",id:e.id,value:b[e.id]||"",onChange:a=>v(e.id,a.target.value),placeholder:e.placeholder,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),required:e.required,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0}),e.type==="textarea"&&jsxRuntime.jsx("textarea",{id:e.id,value:b[e.id]||"",onChange:a=>v(e.id,a.target.value),placeholder:e.placeholder,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.textarea,o),rows:4,required:e.required,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0}),e.type==="select"&&e.options&&jsxRuntime.jsxs("select",{id:e.id,value:b[e.id]||"",onChange:a=>v(e.id,a.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),required:e.required,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0,children:[jsxRuntime.jsx("option",{value:"",children:e.placeholder||"Select an option"}),e.options.map(a=>jsxRuntime.jsx("option",{value:a,children:a},a))]}),e.type==="checkbox"&&jsxRuntime.jsxs("div",{className:"flex items-start",children:[jsxRuntime.jsx("div",{className:"flex items-center h-5",children:jsxRuntime.jsx("input",{type:"checkbox",id:e.id,checked:!!b[e.id],onChange:a=>v(e.id,a.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]",required:e.required,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0})}),jsxRuntime.jsx("div",{className:"ml-3 text-sm",children:jsxRuntime.jsx("label",{htmlFor:e.id,className:"text-gray-700 dark:text-gray-300",children:e.placeholder||e.label})})]}),e.type==="file"&&jsxRuntime.jsx("input",{type:"file",id:e.id,onChange:a=>{var h;let l=(h=a.target.files)==null?void 0:h[0];l&&v(e.id,l);},className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),required:e.required,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0}),d[`additional_${e.id}`]&&jsxRuntime.jsx("p",{id:`additional-${e.id}-error`,role:"alert",className:"mt-1 text-sm text-red-500",children:d[`additional_${e.id}`]})]},e.id))})]}),jsxRuntime.jsxs("div",{className:"mt-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold mb-2",children:"Privacy Notice"}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-300",children:"The information you provide in this form will be used solely for the purpose of processing your data subject request. We will retain this information for as long as necessary to fulfill your request and to comply with our legal obligations. For more information, please refer to our Privacy Policy."})]}),jsxRuntime.jsxs("div",{className:"mt-6 flex gap-3 relative",children:[f&&(r==null?void 0:r.loadingOverlay)&&jsxRuntime.jsx("div",{className:r.loadingOverlay}),jsxRuntime.jsx("button",{type:"submit",disabled:f,className:chunkE64TU6IU_js.a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${D} ${f?"opacity-50 cursor-not-allowed":""}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:f?"Submitting...":y.submit||s}),jsxRuntime.jsx("button",{type:"button",onClick:tr,className:chunkE64TU6IU_js.a("px-6 py-3 bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-200 rounded-md hover:bg-gray-300 dark:hover:bg-gray-500 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2",void 0,o),children:"Reset"})]})]})})]})};exports.a=lr;//# sourceMappingURL=chunk-PEH5GIMN.js.map
2
- //# sourceMappingURL=chunk-PEH5GIMN.js.map
1
+ 'use strict';var chunkI54CDQGN_js=require('./chunk-I54CDQGN.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var lr=({requestTypes:I,onSubmit:Q,onValidationError:q,title:X="Submit a Data Subject Request",description:V="Use this form to exercise your rights under the Nigeria Data Protection Act (NDPA), Part IV, Sections 29-36.",submitButtonText:s="Submit Request",className:A="",buttonClassName:D="",showConfirmation:N=true,confirmationMessage:rr="Your request has been submitted successfully. You will receive a confirmation email shortly.",requireIdentityVerification:_=true,identifierTypes:k=[{id:"email",label:"Email Address"},{id:"account",label:"Account Number"},{id:"customer_id",label:"Customer ID"}],collectAdditionalContact:er=true,labels:y={},classNames:r,unstyled:o=false,isSubmitting:f=false,defaultValues:g,onReset:S})=>{var G,Y,H,L,U,W;let[c,P]=react.useState((g==null?void 0:g.requestType)||""),[R,j]=react.useState(((G=g==null?void 0:g.dataSubject)==null?void 0:G.fullName)||""),[x,E]=react.useState(((Y=g==null?void 0:g.dataSubject)==null?void 0:Y.email)||""),[F,O]=react.useState(((H=g==null?void 0:g.dataSubject)==null?void 0:H.phone)||""),[B,z]=react.useState(((L=g==null?void 0:g.dataSubject)==null?void 0:L.identifierType)||((U=k[0])==null?void 0:U.id)||""),[T,M]=react.useState(((W=g==null?void 0:g.dataSubject)==null?void 0:W.identifierValue)||""),[b,w]=react.useState((g==null?void 0:g.additionalInfo)||{}),[ir,$]=react.useState(false),[d,Z]=react.useState({}),tr=()=>{var e;P(""),j(""),E(""),O(""),z(((e=k[0])==null?void 0:e.id)||""),M(""),w({}),$(false),Z({}),S==null||S();},u=I.find(e=>e.id===c),or=e=>{P(e.target.value),w({});},v=(e,a)=>{w(l=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},l),{[e]:a}));},nr=()=>{let e={};return R.trim()||(e.fullName="Full name is required"),x.trim()?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(x)||(e.email="Email is invalid"):e.email="Email is required",c||(e.requestType="Please select a request type"),_&&!T.trim()&&(e.identifierValue="Identifier value is required"),u!=null&&u.requiresAdditionalInfo&&u.additionalFields&&u.additionalFields.forEach(a=>{a.required&&!b[a.id]&&(e[`additional_${a.id}`]=`${a.label} is required`);}),Z(e),e},dr=e=>{e.preventDefault();let a=nr();if(Object.keys(a).length>0){q==null||q(a);return}let l=Object.keys(b).length>0?Object.fromEntries(Object.entries(b).map(([ar,C])=>[ar,typeof C=="string"?chunkI54CDQGN_js.a(C):C])):void 0,h={requestType:c,dataSubject:{fullName:chunkI54CDQGN_js.a(R),email:chunkI54CDQGN_js.a(x),phone:F?chunkI54CDQGN_js.a(F):void 0,identifierType:B,identifierValue:chunkI54CDQGN_js.a(T)},additionalInfo:l,submittedAt:Date.now()};Q(h),N&&$(true);};return ir?jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`p-4 bg-green-50 dark:bg-green-900/20 rounded-md ${A}`,r==null?void 0:r.successMessage,o),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-lg font-bold text-green-800 dark:text-green-200 mb-2",r==null?void 0:r.title,o),children:"Request Submitted"}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-green-700 dark:text-green-300",r==null?void 0:r.description,o),children:rr}),jsxRuntime.jsx("button",{onClick:()=>$(false),className:chunkE64TU6IU_js.a(`mt-4 px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${D}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:"Submit Another Request"})]}):jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${A}`,r==null?void 0:r.root,o),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",r==null?void 0:r.title,o),children:X}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("mb-6 text-gray-600 dark:text-gray-300",r==null?void 0:r.description,o),children:V}),jsxRuntime.jsx("form",{onSubmit:dr,className:chunkE64TU6IU_js.a("",r==null?void 0:r.form,o),children:jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-4",r==null?void 0:r.fieldGroup,o),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Personal Information"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"fullName",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:[y.name||"Full Name"," ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"fullName",value:R,onChange:e=>j(e.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),required:true,"aria-invalid":!!d.fullName,"aria-describedby":d.fullName?"fullName-error":void 0}),d.fullName&&jsxRuntime.jsx("p",{id:"fullName-error",role:"alert",className:"mt-1 text-sm text-red-500",children:d.fullName})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"email",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:[y.email||"Email Address"," ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"email",id:"email",value:x,onChange:e=>E(e.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),required:true,"aria-invalid":!!d.email,"aria-describedby":d.email?"email-error":void 0}),d.email&&jsxRuntime.jsx("p",{id:"email-error",role:"alert",className:"mt-1 text-sm text-red-500",children:d.email})]}),er&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"phone",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:"Phone Number (Optional)"}),jsxRuntime.jsx("input",{type:"tel",id:"phone",value:F,onChange:e=>O(e.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Request Details"}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"requestType",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:[y.requestType||"Request Type"," ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsxs("select",{id:"requestType",value:c,onChange:or,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),required:true,"aria-invalid":!!d.requestType,"aria-describedby":d.requestType?"requestType-error":void 0,children:[jsxRuntime.jsx("option",{value:"",children:"Select a request type"}),I.map(e=>jsxRuntime.jsx("option",{value:e.id,children:e.name},e.id))]}),d.requestType&&jsxRuntime.jsx("p",{id:"requestType-error",role:"alert",className:"mt-1 text-sm text-red-500",children:d.requestType})]}),u&&jsxRuntime.jsxs("div",{className:"mb-4 p-3 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 mb-2",children:u.description}),jsxRuntime.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Estimated completion time: ",u.estimatedCompletionTime," ",u.estimatedCompletionTime===1?"day":"days"]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("label",{htmlFor:"requestDescription",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:y.description||"Additional Information"}),jsxRuntime.jsx("textarea",{id:"requestDescription",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.textarea,o),rows:4,placeholder:"Please provide any additional details that might help us process your request"})]})]}),_&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Identity Verification"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 mb-3",children:"To protect your privacy, we need to verify your identity before processing your request."}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"identifierType",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:["Identifier Type ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("select",{id:"identifierType",value:B,onChange:e=>z(e.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),required:true,children:k.map(e=>jsxRuntime.jsx("option",{value:e.id,children:e.label},e.id))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"identifierValue",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:["Identifier Value ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"identifierValue",value:T,onChange:e=>M(e.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),required:true,"aria-invalid":!!d.identifierValue,"aria-describedby":d.identifierValue?"identifierValue-error":void 0}),d.identifierValue&&jsxRuntime.jsx("p",{id:"identifierValue-error",role:"alert",className:"mt-1 text-sm text-red-500",children:d.identifierValue})]})]})]}),(u==null?void 0:u.requiresAdditionalInfo)&&u.additionalFields&&u.additionalFields.length>0&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Additional Information"}),jsxRuntime.jsx("div",{className:"space-y-4",children:u.additionalFields.map(e=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:e.id,className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:[e.label," ",e.required&&jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),e.type==="text"&&jsxRuntime.jsx("input",{type:"text",id:e.id,value:b[e.id]||"",onChange:a=>v(e.id,a.target.value),placeholder:e.placeholder,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),required:e.required,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0}),e.type==="textarea"&&jsxRuntime.jsx("textarea",{id:e.id,value:b[e.id]||"",onChange:a=>v(e.id,a.target.value),placeholder:e.placeholder,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.textarea,o),rows:4,required:e.required,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0}),e.type==="select"&&e.options&&jsxRuntime.jsxs("select",{id:e.id,value:b[e.id]||"",onChange:a=>v(e.id,a.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),required:e.required,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0,children:[jsxRuntime.jsx("option",{value:"",children:e.placeholder||"Select an option"}),e.options.map(a=>jsxRuntime.jsx("option",{value:a,children:a},a))]}),e.type==="checkbox"&&jsxRuntime.jsxs("div",{className:"flex items-start",children:[jsxRuntime.jsx("div",{className:"flex items-center h-5",children:jsxRuntime.jsx("input",{type:"checkbox",id:e.id,checked:!!b[e.id],onChange:a=>v(e.id,a.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]",required:e.required,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0})}),jsxRuntime.jsx("div",{className:"ml-3 text-sm",children:jsxRuntime.jsx("label",{htmlFor:e.id,className:"text-gray-700 dark:text-gray-300",children:e.placeholder||e.label})})]}),e.type==="file"&&jsxRuntime.jsx("input",{type:"file",id:e.id,onChange:a=>{var h;let l=(h=a.target.files)==null?void 0:h[0];l&&v(e.id,l);},className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),required:e.required,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0}),d[`additional_${e.id}`]&&jsxRuntime.jsx("p",{id:`additional-${e.id}-error`,role:"alert",className:"mt-1 text-sm text-red-500",children:d[`additional_${e.id}`]})]},e.id))})]}),jsxRuntime.jsxs("div",{className:"mt-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold mb-2",children:"Privacy Notice"}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-300",children:"The information you provide in this form will be used solely for the purpose of processing your data subject request. We will retain this information for as long as necessary to fulfill your request and to comply with our legal obligations. For more information, please refer to our Privacy Policy."})]}),jsxRuntime.jsxs("div",{className:"mt-6 flex gap-3 relative",children:[f&&(r==null?void 0:r.loadingOverlay)&&jsxRuntime.jsx("div",{className:r.loadingOverlay}),jsxRuntime.jsx("button",{type:"submit",disabled:f,className:chunkE64TU6IU_js.a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${D} ${f?"opacity-50 cursor-not-allowed":""}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:f?"Submitting...":y.submit||s}),jsxRuntime.jsx("button",{type:"button",onClick:tr,className:chunkE64TU6IU_js.a("px-6 py-3 bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-200 rounded-md hover:bg-gray-300 dark:hover:bg-gray-500 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2",void 0,o),children:"Reset"})]})]})})]})};exports.a=lr;//# sourceMappingURL=chunk-QH6YUVJS.js.map
2
+ //# sourceMappingURL=chunk-QH6YUVJS.js.map