@tantainnovative/ndpr-toolkit 3.2.1 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -1
- package/dist/{DPIAQuestionnaire-BkejviPj.d.mts → DPIAQuestionnaire-VXBoWFMC.d.ts} +3 -3
- package/dist/{DPIAQuestionnaire-DdSqXG3x.d.ts → DPIAQuestionnaire-jkt1Veb6.d.mts} +3 -3
- package/dist/{DSRRequestForm-BY8PogCU.d.mts → DSRRequestForm-D8rPTNmU.d.ts} +2 -2
- package/dist/{DSRRequestForm-CHUg9cZh.d.ts → DSRRequestForm-DRouEr9j.d.mts} +2 -2
- package/dist/{DSRTracker-Dr_aT0pg.d.ts → DSRTracker-Bl__d4df.d.ts} +1 -1
- package/dist/{DSRTracker-C6u_jAaK.d.mts → DSRTracker-CSVDfgQQ.d.mts} +1 -1
- package/dist/{StepIndicator-D9ZATz_O.d.ts → StepIndicator-CgrlokSV.d.ts} +1 -1
- package/dist/{StepIndicator-D-nwRTyo.d.mts → StepIndicator-W8S_QjgO.d.mts} +1 -1
- package/dist/chunk-25OOUES4.js +2 -0
- package/dist/chunk-4JKTIR33.mjs +2 -0
- package/dist/chunk-5BUS6AI7.js +2 -0
- package/dist/chunk-5X32J5IA.mjs +2 -0
- package/dist/chunk-6JCRDJQI.mjs +2 -0
- package/dist/chunk-6YN73KR7.mjs +2 -0
- package/dist/chunk-75TJPK2N.mjs +2 -0
- package/dist/{chunk-NXQMU36Z.mjs → chunk-7D2OIPHH.mjs} +2 -2
- package/dist/chunk-C4YM4UMI.js +2 -0
- package/dist/{chunk-EH2I4L7M.mjs → chunk-CDZDT2OS.mjs} +14 -10
- package/dist/chunk-CSIJCLGZ.mjs +2 -0
- package/dist/chunk-GMLCWGNJ.js +7 -0
- package/dist/chunk-GQVNLUP2.js +94 -0
- package/dist/chunk-GXLSOZCH.mjs +2 -0
- package/dist/chunk-IQJO7WIH.js +7 -0
- package/dist/{chunk-NRQELKAE.js → chunk-JKKRPS4P.js} +2 -2
- package/dist/chunk-LETEUS5X.mjs +2 -0
- package/dist/{chunk-KBP26GLC.js → chunk-M6XETYNL.js} +2 -2
- package/dist/chunk-NBSVFQ5G.js +2 -0
- package/dist/chunk-NUULHXVL.mjs +7 -0
- package/dist/chunk-QDHHD2KR.mjs +94 -0
- package/dist/chunk-TI2M7H6R.mjs +7 -0
- package/dist/chunk-TKVJ3OOV.mjs +2 -0
- package/dist/{chunk-KVOGOLIR.js → chunk-TXXWCB5O.js} +14 -10
- package/dist/{chunk-44W4H2EY.js → chunk-UGY5ZYUG.js} +2 -2
- package/dist/chunk-UO6QPJLH.js +2 -0
- package/dist/chunk-UX6ZZNEM.mjs +3 -0
- package/dist/{chunk-3DJGO6WG.js → chunk-VLSGE2YA.js} +2 -2
- package/dist/chunk-XFUEZ3MP.mjs +2 -0
- package/dist/chunk-XHSHPB74.js +2 -0
- package/dist/chunk-YCX6BFOQ.js +2 -0
- package/dist/chunk-YURSF2YO.mjs +2 -0
- package/dist/chunk-YZXUAIYN.js +3 -0
- package/dist/chunk-ZGJA7OO4.js +2 -0
- package/dist/chunk-ZT7KNFAU.mjs +2 -0
- package/dist/chunk-ZYLDLGFL.js +2 -0
- package/dist/consent.js +1 -1
- package/dist/consent.mjs +1 -1
- package/dist/core.d.mts +21 -9
- package/dist/core.d.ts +21 -9
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/cross-border.d.mts +68 -1
- package/dist/cross-border.d.ts +68 -1
- package/dist/cross-border.js +1 -1
- package/dist/cross-border.mjs +1 -1
- package/dist/{dpia-B0Pok5us.d.ts → dpia-D82hUrJe.d.ts} +1 -1
- package/dist/{dpia-CUfOmzvX.d.mts → dpia-DQDFw2_l.d.mts} +1 -1
- package/dist/{dpia-5OQVA1R_.d.mts → dpia-c9GiiOq0.d.mts} +2 -2
- package/dist/{dpia-5OQVA1R_.d.ts → dpia-c9GiiOq0.d.ts} +2 -2
- package/dist/dpia.d.mts +9 -9
- package/dist/dpia.d.ts +9 -9
- package/dist/dpia.js +1 -1
- package/dist/dpia.mjs +1 -1
- package/dist/{dsr-D_eTNc4S.d.mts → dsr-CIx5sd7e.d.ts} +2 -2
- package/dist/{dsr-pNtVb1BK.d.ts → dsr-XZ_HqTlA.d.mts} +2 -2
- package/dist/{dsr-Cm9lzWG7.d.mts → dsr-yKbqX531.d.mts} +1 -1
- package/dist/{dsr-Cm9lzWG7.d.ts → dsr-yKbqX531.d.ts} +1 -1
- package/dist/dsr.d.mts +9 -9
- package/dist/dsr.d.ts +9 -9
- package/dist/dsr.js +1 -1
- package/dist/dsr.mjs +1 -1
- package/dist/hooks.d.mts +6 -6
- package/dist/hooks.d.ts +6 -6
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/index.d.mts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lawful-basis.js +1 -1
- package/dist/lawful-basis.mjs +1 -1
- package/dist/{policy-engine-DSQpT55_.d.ts → policy-engine-C6nC2t3a.d.ts} +1 -1
- package/dist/{policy-engine-C-tShzZH.d.mts → policy-engine-DefZcX3R.d.mts} +1 -1
- package/dist/{policy-sections-CfNVBLCh.d.mts → policy-sections-Bylm31kZ.d.mts} +1 -1
- package/dist/{policy-sections-DqH0iZRf.d.ts → policy-sections-DFDPVCCg.d.ts} +1 -1
- package/dist/policy.d.mts +4 -4
- package/dist/policy.d.ts +4 -4
- package/dist/policy.js +1 -1
- package/dist/policy.mjs +1 -1
- package/dist/presets.d.mts +5 -5
- package/dist/presets.d.ts +5 -5
- package/dist/presets.js +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/ropa.js +1 -1
- package/dist/ropa.mjs +1 -1
- package/dist/{sanitize-9mOO_cJW.d.mts → sanitize-B0AzEm1D.d.mts} +14 -1
- package/dist/{sanitize-9mOO_cJW.d.ts → sanitize-B0AzEm1D.d.ts} +14 -1
- package/dist/{useAdaptivePolicyWizard-N4eUM4Tj.d.mts → useAdaptivePolicyWizard-A1PyOy6P.d.mts} +1 -1
- package/dist/{useAdaptivePolicyWizard-B9Op2gYM.d.ts → useAdaptivePolicyWizard-LVIKhAxw.d.ts} +1 -1
- package/dist/{useDPIA-DzWye8JB.d.mts → useDPIA-B6180UQn.d.mts} +9 -5
- package/dist/{useDPIA-Dl16Te3r.d.ts → useDPIA-CTqbNbww.d.ts} +9 -5
- package/dist/{useDSR-C1LksCfP.d.mts → useDSR-WvHk8_iu.d.mts} +2 -2
- package/dist/{useDSR-DZel52O1.d.ts → useDSR-wH4H6hSM.d.ts} +2 -2
- package/package.json +1 -1
- package/dist/chunk-2FWCVWKN.js +0 -2
- package/dist/chunk-3UWT64FI.mjs +0 -2
- package/dist/chunk-4JUDKBA2.mjs +0 -7
- package/dist/chunk-4XCL62MJ.mjs +0 -2
- package/dist/chunk-555WWZ3W.js +0 -2
- package/dist/chunk-CL53OI3I.js +0 -7
- package/dist/chunk-ELKEZEV5.mjs +0 -2
- package/dist/chunk-ER7X6E36.js +0 -2
- package/dist/chunk-FOXZRRMW.mjs +0 -2
- package/dist/chunk-FY5G6DGZ.js +0 -7
- package/dist/chunk-GOD4LA2J.mjs +0 -2
- package/dist/chunk-I23WPZNQ.mjs +0 -94
- package/dist/chunk-IQF726GS.js +0 -2
- package/dist/chunk-IR7VCBWV.mjs +0 -2
- package/dist/chunk-K45S6YQV.mjs +0 -2
- package/dist/chunk-KBAFOVE3.js +0 -2
- package/dist/chunk-MDWG2KDA.mjs +0 -2
- package/dist/chunk-NN233SGA.mjs +0 -3
- package/dist/chunk-NPI5T6NH.mjs +0 -7
- package/dist/chunk-QH6YUVJS.js +0 -2
- package/dist/chunk-QKK5S54L.mjs +0 -2
- package/dist/chunk-QY7PD5XB.js +0 -94
- package/dist/chunk-TVW6KBVV.mjs +0 -2
- package/dist/chunk-UDNRAQLE.js +0 -3
- package/dist/chunk-UNKXYVXY.js +0 -2
- package/dist/chunk-V37BM2LF.js +0 -2
- package/dist/chunk-V3MXWGXU.mjs +0 -2
- package/dist/chunk-VK27WVV3.js +0 -2
- package/dist/chunk-XQ4M5FHC.mjs +0 -2
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import {a}from'./chunk-AYKLAEOU.mjs';import {jsxs,jsx}from'react/jsx-runtime';import D from'react';var S=({result:r,sections:m,showFullReport:p=true,allowPrint:x=true,allowExport:y=true,onExport:v,className:u="",buttonClassName:b="",classNames:k={},unstyled:N=false})=>{let i=(a$1,s)=>{let d=s?k[s]:void 0;return !d&&s==="printButton"&&(d=k.primaryButton),a(a$1,d,N)},g=a=>new Date(a).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),l=a=>{let s=r.answers[a];return s==null?"Not answered":typeof s=="boolean"?s?"Yes":"No":Array.isArray(s)?s.join(", "):String(s)},w=()=>{window.print();},C=a=>{v&&v(a);},h=a=>jsx("span",{className:i(`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"}[a]}`,"riskBadge"),children:a.charAt(0).toUpperCase()+a.slice(1)});return jsxs("div",{className:`${i("bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 print:shadow-none print:p-0","root")} ${u}`,children:[jsxs("div",{className:i("mb-8 border-b border-gray-200 dark:border-gray-700 pb-6 print:pb-4","header"),children:[jsxs("div",{className:"flex justify-between items-start",children:[jsxs("div",{children:[jsx("h1",{className:i("text-2xl font-bold text-gray-900 dark:text-white mb-2","title"),children:"Data Protection Impact Assessment Report"}),jsx("h2",{className:"text-xl text-gray-700 dark:text-gray-300 mb-4",children:r.title})]}),(x||y)&&jsxs("div",{className:"flex space-x-2 print:hidden",children:[x&&jsx("button",{onClick:w,className:`${i("px-3 py-1 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600","printButton")} ${b}`,children:jsxs("span",{className:"flex items-center",children:[jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"})}),"Print"]})}),y&&jsx("div",{className:"relative inline-block",children:jsx("button",{onClick:()=>C("pdf"),className:`px-3 py-1 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${b}`,children:jsxs("span",{className:"flex items-center",children:[jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Export PDF"]})})})]})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsx("span",{className:"font-medium",children:"Assessor:"})," ",r.assessor.name,", ",r.assessor.role]}),jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsx("span",{className:"font-medium",children:"Contact:"})," ",r.assessor.email]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsx("span",{className:"font-medium",children:"Started:"})," ",g(r.startedAt)]}),jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsx("span",{className:"font-medium",children:"Completed:"})," ",r.completedAt?g(r.completedAt):"In progress"]}),jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsx("span",{className:"font-medium",children:"Next review:"})," ",r.reviewDate?g(r.reviewDate):"Not scheduled"]})]})]})]}),jsxs("div",{className:i("mb-8","summary"),children:[jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Executive Summary"}),jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md mb-4",children:[jsxs("div",{className:"flex items-center mb-2",role:"status","aria-live":"polite",children:[jsx("span",{className:"font-medium mr-2",children:"Overall Risk Level:"}),h(r.overallRiskLevel)]}),jsxs("div",{className:i("mb-2","conclusion"),children:[jsx("span",{className:"font-medium",children:"Conclusion:"})," ",r.conclusion]}),jsxs("div",{role:"status","aria-live":"polite",children:[jsx("span",{className:"font-medium",children:"Can Proceed:"})," ",r.canProceed?"Yes":"No"]})]}),jsxs("div",{children:[jsx("h3",{className:"font-medium text-gray-900 dark:text-white mb-2",children:"Processing Activity Description"}),jsx("p",{className:"text-gray-700 dark:text-gray-300 mb-4",children:r.processingDescription}),r.recommendations&&r.recommendations.length>0&&jsxs("div",{children:[jsx("h3",{className:"font-medium text-gray-900 dark:text-white mb-2",children:"Key Recommendations"}),jsx("ul",{className:"list-disc pl-5 text-gray-700 dark:text-gray-300",children:r.recommendations.map((a,s)=>jsx("li",{className:i("","recommendation"),children:a},s))})]})]})]}),jsxs("div",{className:"mb-8",children:[jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Identified Risks"}),r.risks.length===0?jsx("p",{className:"text-gray-700 dark:text-gray-300",children:"No risks identified."}):jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:i("min-w-full divide-y divide-gray-200 dark:divide-gray-700","riskTable"),children:[jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:jsxs("tr",{children:[jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Risk"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Likelihood"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Impact"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Risk Level"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Mitigated"})]})}),jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:r.risks.map(a=>jsxs("tr",{className:i("","riskRow"),children:[jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-900 dark:text-gray-100",children:a.description}),jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-400",children:[a.likelihood," / 5"]}),jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-400",children:[a.impact," / 5"]}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm",children:h(a.level)}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-400",children:a.mitigated?jsx("span",{className:"text-green-600 dark:text-green-400",children:"Yes"}):jsx("span",{className:"text-red-600 dark:text-red-400",children:"No"})})]},a.id))})]})})]}),p&&jsxs("div",{children:[jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Full Assessment Details"}),m.map(a=>{let s=a.questions.filter(d=>r.answers[d.id]!==void 0);return s.length===0?null:jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:a.title}),jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:jsxs("tr",{children:[jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Question"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Answer"})]})}),jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:s.map(d=>jsxs("tr",{children:[jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-900 dark:text-gray-100",children:d.text}),jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-600 dark:text-gray-400",children:l(d.id)})]},d.id))})]})})]},a.id)})]}),jsxs("div",{className:"mt-8 pt-4 border-t border-gray-200 dark:border-gray-700 text-sm text-gray-600 dark:text-gray-400",children:[jsx("p",{children:"This DPIA was conducted in accordance with the Nigeria Data Protection Act (NDPA) 2023."}),jsxs("p",{children:["DPIA Report Version: ",r.version]}),jsxs("p",{children:["Generated on: ",new Date().toLocaleDateString()]})]})]})};var F=({steps:r,onStepClick:m,clickable:p=true,orientation:x="horizontal",className:y="",activeStepClassName:v="",completedStepClassName:u="",incompleteStepClassName:b="",classNames:k={},unstyled:N=false})=>{let i=(n,l)=>a(n,l?k[l]:void 0,N),g=n=>{p&&m&&m(n);},c=x==="vertical";return jsx("div",{role:"navigation","aria-label":"Step progress",className:`${i(c?"flex flex-col space-y-4":"flex items-center justify-between","root")} ${y}`,children:r.map((n,l)=>{let w=l===r.length-1,C=n.active?i(`font-medium ${v||"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]"}`,"label"):n.completed?i(u||"text-green-600 dark:text-green-400","label"):i(b||"text-gray-600 dark:text-gray-400","label"),h=n.active?i("flex items-center justify-center w-8 h-8 rounded-full bg-[rgb(var(--ndpr-primary)/0.1)] dark:bg-[rgb(var(--ndpr-primary)/0.2)] text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] border-2 border-[rgb(var(--ndpr-primary))] dark:border-[rgb(var(--ndpr-primary))]","stepActive"):n.completed?i("flex items-center justify-center w-8 h-8 rounded-full bg-green-100 dark:bg-green-900 text-green-600 dark:text-green-400 border-2 border-green-600 dark:border-green-400","stepCompleted"):i("flex items-center justify-center w-8 h-8 rounded-full bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-400 border-2 border-gray-300 dark:border-gray-600","stepPending");return jsxs(D.Fragment,{children:[jsxs("div",{className:i(`${c?"flex items-start":"flex flex-col items-center"} ${p?"cursor-pointer":""}`,"step"),onClick:()=>g(n.id),"aria-current":n.active?"step":void 0,children:[jsx("div",{className:`
|
|
2
|
+
flex items-center justify-center
|
|
3
|
+
${c?"mr-4":""}
|
|
4
|
+
`,children:jsx("div",{className:h,children:n.icon?n.icon:n.completed?jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}):jsx("span",{children:l+1})})}),jsxs("div",{className:`
|
|
5
|
+
${c?"flex-1":"mt-2 text-center"}
|
|
6
|
+
`,children:[jsx("div",{className:`text-sm font-medium ${C}`,children:n.label}),n.description&&jsx("div",{className:"text-xs text-gray-600 dark:text-gray-400 mt-1",children:n.description})]})]}),!w&&jsx("div",{className:i(c?"ml-4 h-8 border-l-2 border-gray-300 dark:border-gray-600":"w-full border-t-2 border-gray-300 dark:border-gray-600 hidden sm:block","connector")})]},n.id)})})};export{S as a,F as b};//# sourceMappingURL=chunk-NUULHXVL.mjs.map
|
|
7
|
+
//# sourceMappingURL=chunk-NUULHXVL.mjs.map
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import {b,c,a as a$2}from'./chunk-ZEOQYWOE.mjs';import {a}from'./chunk-AYKLAEOU.mjs';import {d,b as b$1,a as a$1}from'./chunk-WWT2ZSNU.mjs';import {useId,useState,useEffect}from'react';import {jsxs,jsx}from'react/jsx-runtime';var fe=({sections:E=b,variables:M=c,onGenerate:T,title:Y="NDPA Privacy Policy Generator",description:V="Generate an NDPA-compliant privacy policy for your organization in accordance with NDPA Section 24.",className:N="",buttonClassName:F="",generateButtonText:Q="Generate Policy",showPreview:R=true,allowEditing:X=true,classNames:r,unstyled:h=false})=>{let P=useId(),[A,a$3]=useState(E),[o,g]=useState(M),[s,$]=useState("sections"),[L,J]=useState(""),[I,q]=useState(""),[K,Z]=useState(false),[v,O]=useState({});useEffect(()=>{a$3(E);},[E]),useEffect(()=>{g(M);},[M]);let G=l=>{a$3(c=>c.map(d=>d.id===l?b$1(a$1({},d),{included:!d.included}):d));},W=(l,c)=>{g(d=>d.map(u=>u.id===l?b$1(a$1({},u),{value:c}):u)),v[l]&&O(d=>{let u=a$1({},d);return delete u[l],u});},j=()=>{let l={},c=true;return o.forEach(d=>{d.required&&!d.value&&(l[d.id]=`${d.name} is required`,c=false);}),O(l),c},ee=()=>{if(!j()){$("variables");return}let l=A.filter(u=>u.included),c=Object.fromEntries(o.map(u=>[u.name,u.value])),d="";l.forEach(u=>{d+=`## ${u.title}
|
|
2
|
+
|
|
3
|
+
`,d+=a$2(u.template,c),d+=`
|
|
4
|
+
|
|
5
|
+
`;}),J(d),q(d),Z(true),$("preview");},x=()=>{T({sections:A,variables:o,content:X?I:L});},m=()=>jsxs("div",{className:a("space-y-4",r==null?void 0:r.sectionList,h),role:"group","aria-labelledby":`${P}-sections-heading`,children:[jsx("h3",{id:`${P}-sections-heading`,className:"text-lg font-medium mb-4",children:"Select Policy Sections"}),A.map(l=>{let c=`${P}-section-${l.id}`,d=l.description?`${P}-section-desc-${l.id}`:void 0;return jsx("div",{className:a("border border-gray-200 dark:border-gray-700 rounded-md p-4",r==null?void 0:r.sectionItem,h),children:jsxs("div",{className:"flex items-start",children:[jsx("div",{className:"flex items-center h-5",children:jsx("input",{id:c,type:"checkbox",checked:l.included,onChange:()=>G(l.id),disabled:l.required,"aria-describedby":d,className:a("w-4 h-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))] dark:focus:ring-[rgb(var(--ndpr-ring))] dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600",r==null?void 0:r.input,h)})}),jsxs("div",{className:"ml-3 text-sm",children:[jsxs("label",{htmlFor:c,className:"font-medium text-gray-900 dark:text-white",children:[l.title," ",l.required&&jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"}),l.required&&jsx("span",{className:"sr-only",children:" (required)"})]}),l.description&&jsx("p",{id:d,className:"text-gray-600 dark:text-gray-400 mt-1",children:l.description})]})]})},l.id)}),jsx("div",{className:"mt-6",children:jsx("button",{onClick:()=>$("variables"),className:a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${F}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.generateButton),h),children:"Next: Fill Variables"})})]}),w=()=>{let l={};return o.forEach(c=>{let d=c.id.split(".")[0];l[d]||(l[d]=[]),l[d].push(c);}),jsxs("div",{className:a("",r==null?void 0:r.form,h),children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Fill Policy Variables"}),jsx("div",{className:"space-y-6",children:Object.entries(l).map(([c,d])=>{let u=A.find(e=>e.id===c);return u&&!u.included?null:jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-md p-4",children:[jsx("h4",{className:"font-medium text-lg mb-3",children:u?u.title:"General Information"}),jsx("div",{className:"space-y-4",children:d.map(e=>{let f=`${P}-var-${e.id}`,b=e.description?`${P}-var-desc-${e.id}`:void 0,z=v[e.id]?`${P}-var-err-${e.id}`:void 0,B=[b,z].filter(Boolean).join(" ")||void 0;return jsxs("div",{children:[jsxs("label",{htmlFor:f,className:"block text-sm font-medium mb-1",children:[e.name," ",e.required&&jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),e.description&&jsx("p",{id:b,className:"text-xs text-gray-600 dark:text-gray-400 mb-2",children:e.description}),e.inputType==="textarea"?jsx("textarea",{id:f,value:e.value,onChange:D=>W(e.id,D.target.value),rows:4,className:a(`w-full px-3 py-2 border ${v[e.id]?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,r==null?void 0:r.input,h),required:e.required,"aria-required":e.required||void 0,"aria-describedby":B,"aria-invalid":v[e.id]?true:void 0}):e.inputType==="select"&&e.options?jsxs("select",{id:f,value:e.value,onChange:D=>W(e.id,D.target.value),className:a(`w-full px-3 py-2 border ${v[e.id]?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,r==null?void 0:r.input,h),required:e.required,"aria-required":e.required||void 0,"aria-describedby":B,"aria-invalid":v[e.id]?true:void 0,children:[jsx("option",{value:"",children:"Select an option"}),e.options.map(D=>jsx("option",{value:D,children:D},D))]}):jsx("input",{id:f,type:e.inputType,value:e.value,onChange:D=>W(e.id,D.target.value),className:a(`w-full px-3 py-2 border ${v[e.id]?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,r==null?void 0:r.input,h),required:e.required,"aria-required":e.required||void 0,"aria-describedby":B,"aria-invalid":v[e.id]?true:void 0}),v[e.id]&&jsx("p",{id:z,role:"alert",className:"mt-1 text-sm text-red-600 dark:text-red-500",children:v[e.id]})]},e.id)})})]},c)})}),jsxs("div",{className:"mt-6 flex space-x-4",children:[jsx("button",{onClick:()=>$("sections"),className:`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${F}`,children:"Back to Sections"}),jsx("button",{onClick:ee,className:a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${F}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.generateButton),h),children:Q})]})]})},C=()=>{let l=`${P}-policy-content`;return jsxs("div",{children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Preview Generated Policy"}),X?jsxs("div",{className:"mb-4",children:[jsx("label",{htmlFor:l,className:"block text-sm font-medium mb-1",children:"Edit Policy Content"}),jsx("textarea",{id:l,value:I,onChange:c=>q(c.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"})]}):jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md mb-4","aria-live":"polite",children:jsx("div",{className:"prose dark:prose-invert max-w-none",children:L.split(`
|
|
6
|
+
`).map((c,d)=>c.startsWith("## ")?jsx("h3",{className:"text-xl font-bold mt-6 mb-3",children:c.substring(3)},d):c.startsWith("### ")?jsx("h4",{className:"text-lg font-bold mt-4 mb-2",children:c.substring(4)},d):c===""?jsx("br",{},d):jsx("p",{className:"mb-2",children:c},d))})}),jsxs("div",{className:"mt-6 flex space-x-4",children:[jsx("button",{onClick:()=>$("variables"),className:`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${F}`,children:"Back to Variables"}),jsx("button",{onClick:x,className:`px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${F}`,children:"Save Policy"})]})]})},U=()=>{switch(s){case "sections":return m();case "variables":return w();case "preview":return C();default:return m()}};return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${N}`,r==null?void 0:r.root,h),children:[jsxs("div",{className:a("mb-6",r==null?void 0:r.header,h),children:[jsx("h2",{className:a("text-xl font-bold mb-2",r==null?void 0:r.title,h),children:Y}),jsx("p",{className:a("text-gray-600 dark:text-gray-300",r==null?void 0:r.description,h),children:V})]}),jsx("nav",{"aria-label":"Policy generation steps",className:"mb-8",children:jsxs("ol",{className:"flex items-center w-full",children:[jsxs("li",{className:`flex w-full items-center ${s==="sections"?"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400"} after:content-[''] after:w-full after:h-1 after:border-b after:border-gray-200 after:border-1 after:hidden sm:after:inline-block after:mx-6 xl:after:mx-10`,children:[jsx("span",{className:`flex items-center justify-center w-8 h-8 ${s==="sections"?"bg-[rgb(var(--ndpr-primary)/0.1)] dark:bg-[rgb(var(--ndpr-primary)/0.2)]":"bg-gray-100 dark:bg-gray-700"} rounded-full shrink-0`,"aria-current":s==="sections"?"step":void 0,children:"1"}),jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Sections"}),jsx("span",{className:"sr-only",children:s==="sections"?" (current step)":""})]}),jsxs("li",{className:`flex w-full items-center ${s==="variables"?"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400"} after:content-[''] after:w-full after:h-1 after:border-b after:border-gray-200 after:border-1 after:hidden sm:after:inline-block after:mx-6 xl:after:mx-10`,children:[jsx("span",{className:`flex items-center justify-center w-8 h-8 ${s==="variables"?"bg-[rgb(var(--ndpr-primary)/0.1)] dark:bg-[rgb(var(--ndpr-primary)/0.2)]":"bg-gray-100 dark:bg-gray-700"} rounded-full shrink-0`,"aria-current":s==="variables"?"step":void 0,children:"2"}),jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Variables"}),jsx("span",{className:"sr-only",children:s==="variables"?" (current step)":""})]}),jsxs("li",{className:`flex items-center ${s==="preview"?"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400"}`,children:[jsx("span",{className:`flex items-center justify-center w-8 h-8 ${s==="preview"?"bg-[rgb(var(--ndpr-primary)/0.1)] dark:bg-[rgb(var(--ndpr-primary)/0.2)]":"bg-gray-100 dark:bg-gray-700"} rounded-full shrink-0`,"aria-current":s==="preview"?"step":void 0,children:"3"}),jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Preview"}),jsx("span",{className:"sr-only",children:s==="preview"?" (current step)":""})]})]})}),jsxs("div",{className:a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",r==null?void 0:r.complianceNotice,h),children:[jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Compliance Notice"}),jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"This tool helps you generate a privacy policy that aligns with the Nigeria Data Protection Act (NDPA) 2023. While we strive to ensure compliance, we recommend having the final policy reviewed by a legal professional familiar with NDPA requirements."})]}),U()]})};var Ee=({content:E,sections:M,variables:T,onExport:Y,onEdit:V,title:N="Privacy Policy Preview",description:F="Preview your NDPA-compliant privacy policy before exporting.",className:Q="",buttonClassName:R="",showExportOptions:X=true,showEditButton:r=true,showTableOfContents:h=true,showMetadata:P=true,organizationName:A,lastUpdated:a$1=new Date,classNames:o,unstyled:g=false})=>{let s=useId(),[$,L]=useState("preview"),J=`${s}-tab-preview`,I=`${s}-tab-markdown`,q=`${s}-panel-preview`,K=`${s}-panel-markdown`,v=(()=>{let x=E.split(`
|
|
7
|
+
`),m=[];return x.forEach(w=>{if(w.startsWith("## ")){let C=w.substring(3).trim(),U=`${s}-${C.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;m.push({id:U,title:C,level:2});}else if(w.startsWith("### ")){let C=w.substring(4).trim(),U=`${s}-${C.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;m.push({id:U,title:C,level:3});}}),m})(),O=x=>{if(Y)Y(x);else if(x==="markdown"){let m=document.createElement("a"),w=new Blob([E],{type:"text/markdown"});m.href=URL.createObjectURL(w),m.download=`privacy-policy-${new Date().toISOString().split("T")[0]}.md`,document.body.appendChild(m),m.click(),document.body.removeChild(m);}},G=()=>!h||v.length===0?null:jsxs("nav",{"aria-label":"Table of contents",className:"mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Table of Contents"}),jsx("ul",{className:"space-y-1",children:v.map((x,m)=>jsx("li",{style:{marginLeft:`${(x.level-2)*1.5}rem`},children:jsx("a",{href:`#${x.id}`,className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline",children:x.title})},m))})]}),W=()=>P?jsxs("div",{className:"mb-6",children:[jsx("h1",{className:"text-2xl font-bold mb-2",children:A?`${A} Privacy Policy`:"Privacy Policy"}),jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Last Updated: ",a$1.toLocaleDateString()]})]}):null,j=()=>jsx("div",{className:a("prose dark:prose-invert max-w-none",o==null?void 0:o.sectionContent,g),children:E.split(`
|
|
8
|
+
`).map((x,m)=>{if(x.startsWith("## ")){let w=x.substring(3).trim(),C=`${s}-${w.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return jsx("h3",{id:C,className:a("text-xl font-bold mt-6 mb-3",o==null?void 0:o.sectionTitle,g),children:w},m)}else if(x.startsWith("### ")){let w=x.substring(4).trim(),C=`${s}-${w.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return jsx("h4",{id:C,className:a("text-lg font-bold mt-4 mb-2",o==null?void 0:o.sectionTitle,g),children:w},m)}else return x===""?jsx("br",{},m):jsx("p",{className:"mb-2",children:x},m)})}),ee=()=>X?jsxs("div",{className:"mt-6",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Export Options"}),jsxs("div",{className:"flex flex-wrap gap-3",children:[jsx("button",{onClick:()=>O("pdf"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${R}`,children:"Export as PDF"}),jsx("button",{onClick:()=>O("docx"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${R}`,children:"Export as DOCX"}),jsx("button",{onClick:()=>O("html"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${R}`,children:"Export as HTML"}),jsx("button",{onClick:()=>O("markdown"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${R}`,children:"Export as Markdown"})]})]}):null;return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${Q}`,o==null?void 0:o.root,g),children:[jsxs("div",{className:a("flex justify-between items-start mb-6",o==null?void 0:o.header,g),children:[jsxs("div",{children:[jsx("h2",{className:a("text-xl font-bold mb-2",o==null?void 0:o.title,g),children:N}),jsx("p",{className:a("text-gray-600 dark:text-gray-300",o==null?void 0:o.description,g),children:F})]}),r&&V&&jsx("button",{onClick:V,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 ${R}`,children:"Edit Policy"})]}),jsxs("div",{className:a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",o==null?void 0:o.complianceNotice,g),children:[jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Compliance Notice"}),jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"This privacy policy has been generated to align with the Nigeria Data Protection Act (NDPA) 2023. We recommend having the final policy reviewed by a legal professional familiar with NDPA requirements before publishing it on your website or sharing it with your users."})]}),jsx("div",{className:"mb-6 border-b border-gray-200 dark:border-gray-700",children:jsxs("div",{role:"tablist","aria-label":"Policy view options",className:"flex flex-wrap -mb-px",children:[jsx("div",{className:"mr-2",children:jsx("button",{role:"tab",id:J,"aria-selected":$==="preview","aria-controls":q,onClick:()=>L("preview"),className:`inline-block p-4 ${$==="preview"?"text-[rgb(var(--ndpr-primary))] border-b-2 border-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] dark:border-[rgb(var(--ndpr-primary))]":"text-gray-600 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"}`,children:"Preview"})}),jsx("div",{className:"mr-2",children:jsx("button",{role:"tab",id:I,"aria-selected":$==="markdown","aria-controls":K,onClick:()=>L("markdown"),className:`inline-block p-4 ${$==="markdown"?"text-[rgb(var(--ndpr-primary))] border-b-2 border-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] dark:border-[rgb(var(--ndpr-primary))]":"text-gray-600 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"}`,children:"Markdown"})})]})}),jsx("div",{className:a("bg-white dark:bg-gray-800 p-4 rounded-md",o==null?void 0:o.content,g),children:$==="preview"?jsxs("div",{role:"tabpanel",id:q,"aria-labelledby":J,"aria-live":"polite",children:[W(),G(),jsx("div",{className:a("bg-gray-50 dark:bg-gray-700 p-6 rounded-md",o==null?void 0:o.section,g),children:j()})]}):jsx("div",{role:"tabpanel",id:K,"aria-labelledby":I,children:jsx("pre",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md overflow-auto whitespace-pre-wrap font-mono text-sm text-gray-800 dark:text-gray-200",children:E})})}),ee()]})};var Ae=({content:E,title:M="Privacy Policy",organizationName:T,lastUpdated:Y=new Date,onExportComplete:V,componentTitle:N="Export Privacy Policy",description:F="Export your NDPA-compliant privacy policy in various formats.",className:Q="",buttonClassName:R="",showExportHistory:X=true,includeComplianceNotice:r=true,includeLogo:h=false,logoUrl:P,customStyles:A,classNames:a$1,unstyled:o=false})=>{let g=useId(),[s,$]=useState([]),[L,J]=useState("pdf"),[I,q]=useState(false),[K,Z]=useState(null),[v,O]=useState(""),[G,W]=useState(""),[j,ee]=useState(""),[x,m]=useState(false),w=e=>{let f=new Date().toISOString().split("T")[0];return `${T?T.toLowerCase().replace(/[^a-z0-9]+/g,"-"):"privacy-policy"}-privacy-policy-${f}.${e.toLowerCase()}`},C=e=>v?v.endsWith(`.${e.toLowerCase()}`)?v:`${v}.${e.toLowerCase()}`:w(e),U=()=>{let e=T?`${T} ${M}`:M,f=Y.toLocaleDateString(),b=`<!DOCTYPE html>
|
|
9
|
+
<html lang="en">
|
|
10
|
+
<head>
|
|
11
|
+
<meta charset="UTF-8">
|
|
12
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
13
|
+
<title>${e}</title>
|
|
14
|
+
<style>
|
|
15
|
+
body {
|
|
16
|
+
font-family: Arial, sans-serif;
|
|
17
|
+
line-height: 1.6;
|
|
18
|
+
color: #333;
|
|
19
|
+
max-width: 800px;
|
|
20
|
+
margin: 0 auto;
|
|
21
|
+
padding: 20px;
|
|
22
|
+
}
|
|
23
|
+
h1 {
|
|
24
|
+
font-size: 24px;
|
|
25
|
+
margin-bottom: 10px;
|
|
26
|
+
}
|
|
27
|
+
h2 {
|
|
28
|
+
font-size: 20px;
|
|
29
|
+
margin-top: 30px;
|
|
30
|
+
margin-bottom: 10px;
|
|
31
|
+
border-bottom: 1px solid #eee;
|
|
32
|
+
padding-bottom: 5px;
|
|
33
|
+
}
|
|
34
|
+
h3 {
|
|
35
|
+
font-size: 18px;
|
|
36
|
+
margin-top: 20px;
|
|
37
|
+
margin-bottom: 10px;
|
|
38
|
+
}
|
|
39
|
+
p {
|
|
40
|
+
margin-bottom: 15px;
|
|
41
|
+
}
|
|
42
|
+
.header {
|
|
43
|
+
text-align: center;
|
|
44
|
+
margin-bottom: 30px;
|
|
45
|
+
}
|
|
46
|
+
.footer {
|
|
47
|
+
margin-top: 50px;
|
|
48
|
+
text-align: center;
|
|
49
|
+
font-size: 12px;
|
|
50
|
+
color: #666;
|
|
51
|
+
border-top: 1px solid #eee;
|
|
52
|
+
padding-top: 20px;
|
|
53
|
+
}
|
|
54
|
+
.logo {
|
|
55
|
+
max-width: 200px;
|
|
56
|
+
margin-bottom: 20px;
|
|
57
|
+
}
|
|
58
|
+
.last-updated {
|
|
59
|
+
font-size: 12px;
|
|
60
|
+
color: #666;
|
|
61
|
+
margin-bottom: 30px;
|
|
62
|
+
}
|
|
63
|
+
.compliance-notice {
|
|
64
|
+
background-color: #f8f9fa;
|
|
65
|
+
border: 1px solid #e9ecef;
|
|
66
|
+
padding: 15px;
|
|
67
|
+
margin-bottom: 30px;
|
|
68
|
+
font-size: 14px;
|
|
69
|
+
}
|
|
70
|
+
${A||""}
|
|
71
|
+
</style>
|
|
72
|
+
</head>
|
|
73
|
+
<body>
|
|
74
|
+
<div class="header">
|
|
75
|
+
${h&&P?`<img src="${P}" alt="${T||"Company"} Logo" class="logo">`:""}
|
|
76
|
+
${G?`<div class="custom-header">${G}</div>`:""}
|
|
77
|
+
<h1>${e}</h1>
|
|
78
|
+
<div class="last-updated">Last Updated: ${f}</div>
|
|
79
|
+
</div>`;r&&(b+=`
|
|
80
|
+
<div class="compliance-notice">
|
|
81
|
+
<strong>NDPA Compliance Notice:</strong> This privacy policy has been created to comply with the Nigeria Data Protection Act (NDPA) 2023.
|
|
82
|
+
It outlines how we collect, use, disclose, and protect your personal information in accordance with NDPA requirements.
|
|
83
|
+
</div>`);let z=E.replace(/^## (.*?)$/gm,"<h2>$1</h2>").replace(/^### (.*?)$/gm,"<h3>$1</h3>").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>");return b+=`
|
|
84
|
+
<div class="content">
|
|
85
|
+
<p>${z}</p>
|
|
86
|
+
</div>
|
|
87
|
+
|
|
88
|
+
<div class="footer">
|
|
89
|
+
${j?`<div class="custom-footer">${j}</div>`:""}
|
|
90
|
+
<p>© ${new Date().getFullYear()} ${T||"Company"}. All rights reserved.</p>
|
|
91
|
+
</div>
|
|
92
|
+
</body>
|
|
93
|
+
</html>`,b},l=()=>d(null,null,function*(){q(true),Z(null);try{let e=L.toLowerCase(),f="",b;switch(e){case "pdf":let te=U();b=new Blob([te],{type:"text/html"}),f=URL.createObjectURL(b);break;case "docx":b=new Blob([E],{type:"text/plain"}),f=URL.createObjectURL(b);break;case "html":let pe=U();b=new Blob([pe],{type:"text/html"}),f=URL.createObjectURL(b);break;default:b=new Blob([E],{type:"text/markdown"}),f=URL.createObjectURL(b);break}let z=C(e),B=document.createElement("a");B.href=f,B.download=z,document.body.appendChild(B),B.click(),document.body.removeChild(B);let D={id:`export_${Date.now()}`,format:e,timestamp:Date.now(),url:f,filename:z};$(te=>[D,...te]),V&&V(e,f);}catch(e){console.error("Export error:",e),Z("An error occurred during export. Please try again.");}finally{q(false);}}),c=()=>{let e=[{value:"pdf",label:"PDF Document (.pdf)"},{value:"docx",label:"Word Document (.docx)"},{value:"html",label:"Web Page (.html)"},{value:"markdown",label:"Markdown (.md)"}],f=`${g}-export-format`;return jsxs("div",{className:a("mb-6",a$1==null?void 0:a$1.formatSelector,o),children:[jsx("label",{htmlFor:f,className:"block text-sm font-medium mb-1",children:"Export Format"}),jsx("select",{id:f,value:L,onChange:b=>J(b.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",a$1==null?void 0:a$1.formatOption,o),children:e.map(b=>jsx("option",{value:b.value,children:b.label},b.value))})]})},d$1=()=>x?jsxs("div",{className:"mb-6 space-y-4 border border-gray-200 dark:border-gray-700 rounded-md p-4",children:[jsxs("div",{className:"flex justify-between items-center",children:[jsx("h3",{className:"text-md font-medium",children:"Advanced Export Options"}),jsx("button",{type:"button",onClick:()=>m(false),className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] text-sm",children:"Hide Advanced Options"})]}),jsxs("div",{children:[jsx("label",{htmlFor:`${g}-custom-filename`,className:"block text-sm font-medium mb-1",children:"Custom Filename"}),jsx("input",{type:"text",id:`${g}-custom-filename`,value:v,onChange:e=>O(e.target.value),placeholder:w(L),"aria-describedby":`${g}-custom-filename-desc`,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))]"}),jsx("p",{id:`${g}-custom-filename-desc`,className:"text-xs text-gray-600 dark:text-gray-400 mt-1",children:"Leave blank to use the default filename format."})]}),jsxs("div",{children:[jsx("label",{htmlFor:`${g}-custom-header`,className:"block text-sm font-medium mb-1",children:"Custom Header HTML (for HTML/PDF exports)"}),jsx("textarea",{id:`${g}-custom-header`,value:G,onChange:e=>W(e.target.value),rows:3,placeholder:"<div>Custom header content</div>",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]}),jsxs("div",{children:[jsx("label",{htmlFor:`${g}-custom-footer`,className:"block text-sm font-medium mb-1",children:"Custom Footer HTML (for HTML/PDF exports)"}),jsx("textarea",{id:`${g}-custom-footer`,value:j,onChange:e=>ee(e.target.value),rows:3,placeholder:"<div>Custom footer content</div>",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]}),jsxs("div",{className:"flex items-start",children:[jsx("div",{className:"flex items-center h-5",children:jsx("input",{id:`${g}-include-compliance-notice`,type:"checkbox",checked:r,onChange:e=>m(e.target.checked),"aria-describedby":`${g}-compliance-notice-desc`,className:"w-4 h-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))] dark:focus:ring-[rgb(var(--ndpr-ring))] dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"})}),jsxs("div",{className:"ml-3 text-sm",children:[jsx("label",{htmlFor:`${g}-include-compliance-notice`,className:"font-medium text-gray-900 dark:text-white",children:"Include NDPA Compliance Notice"}),jsx("p",{id:`${g}-compliance-notice-desc`,className:"text-gray-600 dark:text-gray-400",children:"Adds a notice explaining that this policy complies with NDPA requirements."})]})]})]}):jsx("button",{type:"button",onClick:()=>m(true),className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] text-sm mb-6",children:"Show Advanced Options"}),u=()=>!X||s.length===0?null:jsxs("div",{className:a("mt-6",a$1==null?void 0:a$1.preview,o),children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Export History"}),jsx("div",{className:"bg-gray-50 dark:bg-gray-700 rounded-md overflow-hidden",children:jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-600",children:[jsx("thead",{className:"bg-gray-100 dark:bg-gray-800",children:jsxs("tr",{children:[jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Date"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Format"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Filename"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Actions"})]})}),jsx("tbody",{className:"bg-white dark:bg-gray-700 divide-y divide-gray-200 dark:divide-gray-600",children:s.map(e=>jsxs("tr",{children:[jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-300",children:new Date(e.timestamp).toLocaleString()}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-300",children:e.format.toUpperCase()}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-300",children:e.filename}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:jsx("a",{href:e.url,download:e.filename,className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:text-[rgb(var(--ndpr-primary-hover))] dark:hover:text-[rgb(var(--ndpr-primary-hover))] mr-4",children:"Download"})})]},e.id))})]})})]});return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${Q}`,a$1==null?void 0:a$1.root,o),children:[jsxs("div",{className:a("mb-6",a$1==null?void 0:a$1.header,o),children:[jsx("h2",{className:a("text-xl font-bold mb-2",a$1==null?void 0:a$1.title,o),children:N}),jsx("p",{className:a("text-gray-600 dark:text-gray-300",a$1==null?void 0:a$1.description,o),children:F})]}),c(),d$1(),jsxs("div",{className:"mb-6",children:[jsx("button",{onClick:l,disabled:I,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 ${R} ${I?"opacity-70 cursor-not-allowed":""}`,(a$1==null?void 0:a$1.primaryButton)||(a$1==null?void 0:a$1.exportButton),o),children:I?"Exporting...":`Export as ${L.toUpperCase()}`}),K&&jsx("p",{className:"mt-2 text-sm text-red-600 dark:text-red-500",children:K})]}),jsxs("div",{className:a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",a$1==null?void 0:a$1.complianceNotice,o),children:[jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"Export Tips"}),jsxs("ul",{className:"text-blue-700 dark:text-blue-300 text-sm list-disc list-inside space-y-1",children:[jsx("li",{children:"PDF format is recommended for printing or sharing with stakeholders."}),jsx("li",{children:"HTML format is ideal for publishing on your website."}),jsx("li",{children:"DOCX format allows for further editing in Microsoft Word or similar applications."}),jsx("li",{children:"Markdown format is useful for version control systems or technical documentation."})]})]}),u()]})};export{fe as a,Ee as b,Ae as c};//# sourceMappingURL=chunk-QDHHD2KR.mjs.map
|
|
94
|
+
//# sourceMappingURL=chunk-QDHHD2KR.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import {e,g,h,f}from'./chunk-75TJPK2N.mjs';import {a as a$1}from'./chunk-AYKLAEOU.mjs';import {b,a}from'./chunk-WWT2ZSNU.mjs';import {useState,useMemo,useEffect,useCallback}from'react';import {jsxs,jsx}from'react/jsx-runtime';var _=[{value:"adequacy_decision",label:"Adequacy Decision (Section 41)"},{value:"standard_clauses",label:"Standard Contractual Clauses (Section 42)"},{value:"binding_corporate_rules",label:"Binding Corporate Rules (Section 43)"},{value:"ndpc_authorization",label:"NDPC Authorization (Section 44)"},{value:"explicit_consent",label:"Explicit Consent (Section 45(a))"},{value:"contract_performance",label:"Contract Performance (Section 45(b))"},{value:"public_interest",label:"Public Interest (Section 45(c))"},{value:"legal_claims",label:"Legal Claims (Section 45(d))"},{value:"vital_interests",label:"Vital Interests (Section 45(e))"}],G=[{value:"adequate",label:"Adequate"},{value:"inadequate",label:"Inadequate"},{value:"pending_review",label:"Pending Review"},{value:"unknown",label:"Unknown"}],J=[{value:"one_time",label:"One-Time"},{value:"periodic",label:"Periodic"},{value:"continuous",label:"Continuous"}],X=[{value:"active",label:"Active"},{value:"suspended",label:"Suspended"},{value:"terminated",label:"Terminated"},{value:"pending_approval",label:"Pending Approval"}],Z={destinationCountry:"",destinationCountryCode:"",adequacyStatus:"unknown",transferMechanism:"adequacy_decision",dataCategories:"",includesSensitiveData:false,estimatedDataSubjects:"",recipientOrganization:"",recipientContactName:"",recipientContactEmail:"",recipientContactPhone:"",recipientContactAddress:"",purpose:"",safeguards:"",riskAssessment:"",riskLevel:"medium",frequency:"one_time",status:"active",tiaCompleted:false,tiaReference:"",ndpcApprovalApplied:false,ndpcApprovalApproved:false,ndpcApprovalReference:""},Ce=({transfers:g$1,onAddTransfer:q,onUpdateTransfer:F,onRemoveTransfer:M,summary:E,title:ee="Cross-Border Data Transfer Manager",description:te="Manage and document cross-border personal data transfers in compliance with NDPA 2023 Part VI (Sections 41-45).",className:re="",buttonClassName:P="",showSummary:ae=true,showTIA:ie=true,classNames:r,unstyled:d})=>{let[b$1,A]=useState(null),[j,w]=useState(false),[x,z]=useState(null),[n,B]=useState(Z),[y,L]=useState(null),[S,ne]=useState("all"),[T,de]=useState("all"),C=useMemo(()=>{let e=[...g$1];return S!=="all"&&(e=e.filter(a=>a.status===S)),T!=="all"&&(e=e.filter(a=>a.transferMechanism===T)),e.sort((a,l)=>l.updatedAt-a.updatedAt),e},[g$1,S,T]);useEffect(()=>{C.length>0&&!b$1&&A(C[0].id);},[C,b$1]);let $=useMemo(()=>{var e;return b$1&&(e=g$1.find(a=>a.id===b$1))!=null?e:null},[g$1,b$1]),k=useCallback(e=>new Date(e).toLocaleDateString(),[]),h$1=useCallback(()=>{B(Z),z(null),L(null);},[]),oe=useCallback(()=>{h$1(),w(true);},[h$1]),le=useCallback(e=>{var a,l,u,v;z(e.id),B({destinationCountry:e.destinationCountry,destinationCountryCode:e.destinationCountryCode||"",adequacyStatus:e.adequacyStatus,transferMechanism:e.transferMechanism,dataCategories:e.dataCategories.join(", "),includesSensitiveData:e.includesSensitiveData,estimatedDataSubjects:((a=e.estimatedDataSubjects)==null?void 0:a.toString())||"",recipientOrganization:e.recipientOrganization,recipientContactName:e.recipientContact.name,recipientContactEmail:e.recipientContact.email,recipientContactPhone:e.recipientContact.phone||"",recipientContactAddress:e.recipientContact.address||"",purpose:e.purpose,safeguards:e.safeguards.join(`
|
|
2
|
+
`),riskAssessment:e.riskAssessment,riskLevel:e.riskLevel,frequency:e.frequency,status:e.status,tiaCompleted:e.tiaCompleted,tiaReference:e.tiaReference||"",ndpcApprovalApplied:((l=e.ndpcApproval)==null?void 0:l.applied)||false,ndpcApprovalApproved:((u=e.ndpcApproval)==null?void 0:u.approved)||false,ndpcApprovalReference:((v=e.ndpcApproval)==null?void 0:v.referenceNumber)||""}),w(true);},[]),p=useCallback((e,a$1)=>{B(l=>b(a({},l),{[e]:a$1}));},[]),V=useCallback(()=>{let e$1=e(n.transferMechanism),a=Date.now();return {destinationCountry:n.destinationCountry.trim(),destinationCountryCode:n.destinationCountryCode.trim()||void 0,adequacyStatus:n.adequacyStatus,transferMechanism:n.transferMechanism,dataCategories:n.dataCategories.split(",").map(l=>l.trim()).filter(Boolean),includesSensitiveData:n.includesSensitiveData,estimatedDataSubjects:n.estimatedDataSubjects?parseInt(n.estimatedDataSubjects,10):void 0,recipientOrganization:n.recipientOrganization.trim(),recipientContact:{name:n.recipientContactName.trim(),email:n.recipientContactEmail.trim(),phone:n.recipientContactPhone.trim()||void 0,address:n.recipientContactAddress.trim()||void 0},purpose:n.purpose.trim(),safeguards:n.safeguards.split(`
|
|
3
|
+
`).map(l=>l.trim()).filter(Boolean),riskAssessment:n.riskAssessment.trim(),riskLevel:n.riskLevel,frequency:n.frequency,status:e$1&&!n.ndpcApprovalApproved?"pending_approval":n.status,tiaCompleted:n.tiaCompleted,tiaReference:n.tiaReference.trim()||void 0,ndpcApproval:e$1?{required:true,applied:n.ndpcApprovalApplied,approved:n.ndpcApprovalApproved||void 0,referenceNumber:n.ndpcApprovalReference.trim()||void 0,appliedAt:n.ndpcApprovalApplied?a:void 0,approvedAt:n.ndpcApprovalApproved?a:void 0}:void 0,startDate:a,reviewDate:a+365*24*60*60*1e3}},[n]),pe=useCallback(()=>{let e=V(),a$1=a({id:x||"temp",createdAt:Date.now(),updatedAt:Date.now()},e),l=g(a$1);L(l),l.isValid&&(x?F&&F(x,e):q&&q(e),h$1(),w(false));},[V,x,F,q,h$1]),U=useCallback(()=>{h$1(),w(false);},[h$1]),se=useCallback(e=>{M&&M(e),b$1===e&&A(null);},[M,b$1]),H=useCallback(e=>jsxs("span",{className:a$1(`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[e]}`,r==null?void 0:r.riskBadge,d),children:[e.charAt(0).toUpperCase()+e.slice(1)," Risk"]}),[r==null?void 0:r.riskBadge,d]),Y=useCallback(e=>{let a={active:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",suspended:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",terminated:"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200",pending_approval:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200"},l={active:"Active",suspended:"Suspended",terminated:"Terminated",pending_approval:"Pending Approval"};return jsx("span",{className:a$1(`px-2 py-1 rounded text-xs font-medium ${a[e]}`,r==null?void 0:r.statusBadge,d),children:l[e]})},[r==null?void 0:r.statusBadge,d]),ue=useCallback(e$1=>{var u;let a=e(e$1),l=((u=_.find(v=>v.value===e$1))==null?void 0:u.label)||e$1;return jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${a?"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200":"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200"}`,children:l})},[]),D=useMemo(()=>E||{totalActiveTransfers:g$1.filter(e=>e.status==="active").length,pendingApproval:g$1.filter(e=>{var a,l;return e.status==="pending_approval"||((a=e.ndpcApproval)==null?void 0:a.required)&&!((l=e.ndpcApproval)!=null&&l.approved)}),highRiskTransfers:g$1.filter(e=>e.riskLevel==="high"&&e.status==="active"),missingTIA:g$1.filter(e=>!e.tiaCompleted&&e.status==="active"),byMechanism:{},byAdequacy:{},dueForReview:[],lastUpdated:Date.now()},[E,g$1]),ce=()=>jsxs("div",{role:"status","aria-label":"Transfer compliance summary",className:a$1("mb-6 grid grid-cols-2 md:grid-cols-4 gap-4",r==null?void 0:r.summary,d),children:[jsxs("div",{className:a$1("bg-blue-50 dark:bg-blue-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,d),children:[jsx("p",{className:"text-2xl font-bold text-blue-800 dark:text-blue-200",children:D.totalActiveTransfers}),jsx("p",{className:"text-sm text-blue-600 dark:text-blue-300",children:"Active Transfers"})]}),jsxs("div",{className:a$1("bg-purple-50 dark:bg-purple-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,d),children:[jsx("p",{className:"text-2xl font-bold text-purple-800 dark:text-purple-200",children:D.pendingApproval.length}),jsx("p",{className:"text-sm text-purple-600 dark:text-purple-300",children:"Pending Approval"})]}),jsxs("div",{className:a$1("bg-red-50 dark:bg-red-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,d),children:[jsx("p",{className:"text-2xl font-bold text-red-800 dark:text-red-200",children:D.highRiskTransfers.length}),jsx("p",{className:"text-sm text-red-600 dark:text-red-300",children:"High Risk"})]}),jsxs("div",{className:a$1("bg-yellow-50 dark:bg-yellow-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,d),children:[jsx("p",{className:"text-2xl font-bold text-yellow-800 dark:text-yellow-200",children:D.missingTIA.length}),jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-300",children:"Missing TIA"})]})]}),me=()=>{let e$1=e(n.transferMechanism);return jsxs("div",{className:a$1("bg-gray-50 dark:bg-gray-700 p-6 rounded-lg mb-6",r==null?void 0:r.form,d),children:[jsxs("div",{className:a$1("flex justify-between items-center mb-4",r==null?void 0:r.header,d),children:[jsx("h3",{className:"text-lg font-medium",children:x?"Edit Transfer":"Add New Transfer"}),jsx("button",{onClick:U,"aria-label":"Cancel form",className:"text-gray-600 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:"Cancel"})]}),y&&!y.isValid&&jsxs("div",{id:"cb-form-errors",role:"alert",className:"mb-4 bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Please fix the following errors:"}),jsx("ul",{className:"list-disc list-inside text-sm text-red-700 dark:text-red-300",children:y.errors.map((a,l)=>jsx("li",{children:a},l))})]}),y&&y.warnings.length>0&&jsxs("div",{id:"cb-form-warnings",role:"alert",className:"mb-4 bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm font-medium text-yellow-800 dark:text-yellow-200 mb-1",children:"Warnings:"}),jsx("ul",{className:"list-disc list-inside text-sm text-yellow-700 dark:text-yellow-300",children:y.warnings.map((a,l)=>jsx("li",{children:a},l))})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"cb-destinationCountry",className:"block text-sm font-medium mb-1",children:["Destination Country ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{id:"cb-destinationCountry",type:"text",value:n.destinationCountry,onChange:a=>p("destinationCountry",a.target.value),placeholder:"e.g. United Kingdom","aria-required":"true","aria-describedby":"cb-form-errors","aria-label":"Destination country",className:a$1("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,d)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cb-destinationCountryCode",className:"block text-sm font-medium mb-1",children:"Country Code (ISO)"}),jsx("input",{id:"cb-destinationCountryCode",type:"text",value:n.destinationCountryCode,onChange:a=>p("destinationCountryCode",a.target.value),placeholder:"e.g. GB",maxLength:3,"aria-label":"Country code in ISO format",className:a$1("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,d)})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"cb-recipientOrganization",className:"block text-sm font-medium mb-1",children:["Recipient Organization ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{id:"cb-recipientOrganization",type:"text",value:n.recipientOrganization,onChange:a=>p("recipientOrganization",a.target.value),placeholder:"Organization name","aria-required":"true","aria-describedby":"cb-form-errors",className:a$1("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,d)})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"cb-transferMechanism",className:"block text-sm font-medium mb-1",children:["Transfer Mechanism ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("select",{id:"cb-transferMechanism",value:n.transferMechanism,onChange:a=>p("transferMechanism",a.target.value),"aria-required":"true","aria-describedby":"cb-form-errors",className:a$1("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,d),children:_.map(a=>jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cb-adequacyStatus",className:"block text-sm font-medium mb-1",children:"Adequacy Status"}),jsx("select",{id:"cb-adequacyStatus",value:n.adequacyStatus,onChange:a=>p("adequacyStatus",a.target.value),"aria-label":"Select adequacy status of destination country",className:a$1("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,d),children:G.map(a=>jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxs("div",{children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"Risk Level"}),jsxs("select",{value:n.riskLevel,onChange:a=>p("riskLevel",a.target.value),className:a$1("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,d),children:[jsx("option",{value:"low",children:"Low"}),jsx("option",{value:"medium",children:"Medium"}),jsx("option",{value:"high",children:"High"})]})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{htmlFor:"cb-dataCategories",className:"block text-sm font-medium mb-1",children:["Data Categories ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{id:"cb-dataCategories",type:"text",value:n.dataCategories,onChange:a=>p("dataCategories",a.target.value),placeholder:"Comma-separated, e.g. Names, Email addresses, Phone numbers","aria-required":"true","aria-describedby":"cb-dataCategories-help",className:a$1("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,d)}),jsx("p",{id:"cb-dataCategories-help",className:"text-xs text-gray-500 mt-1",children:"Separate categories with commas"})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{type:"checkbox",id:"includesSensitiveData",checked:n.includesSensitiveData,onChange:a=>p("includesSensitiveData",a.target.checked),className:"h-4 w-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("label",{htmlFor:"includesSensitiveData",className:"text-sm font-medium",children:"Includes sensitive personal data"})]}),jsxs("div",{children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"Estimated Data Subjects"}),jsx("input",{type:"number",value:n.estimatedDataSubjects,onChange:a=>p("estimatedDataSubjects",a.target.value),placeholder:"Number of data subjects",className:a$1("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,d)})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"cb-recipientContactName",className:"block text-sm font-medium mb-1",children:["Recipient Contact Name ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{id:"cb-recipientContactName",type:"text",value:n.recipientContactName,onChange:a=>p("recipientContactName",a.target.value),placeholder:"Contact person name","aria-required":"true","aria-describedby":"cb-form-errors",className:a$1("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,d)})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"cb-recipientContactEmail",className:"block text-sm font-medium mb-1",children:["Recipient Contact Email ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{id:"cb-recipientContactEmail",type:"email",value:n.recipientContactEmail,onChange:a=>p("recipientContactEmail",a.target.value),placeholder:"contact@example.com","aria-required":"true","aria-describedby":"cb-form-errors",className:a$1("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,d)})]}),jsxs("div",{children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"Recipient Contact Phone"}),jsx("input",{type:"text",value:n.recipientContactPhone,onChange:a=>p("recipientContactPhone",a.target.value),placeholder:"Phone number",className:a$1("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,d)})]}),jsxs("div",{children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"Recipient Contact Address"}),jsx("input",{type:"text",value:n.recipientContactAddress,onChange:a=>p("recipientContactAddress",a.target.value),placeholder:"Address",className:a$1("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,d)})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{htmlFor:"cb-purpose",className:"block text-sm font-medium mb-1",children:["Purpose of Transfer ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("textarea",{id:"cb-purpose",value:n.purpose,onChange:a=>p("purpose",a.target.value),placeholder:"Describe the purpose of this data transfer",rows:2,"aria-required":"true","aria-describedby":"cb-form-errors",className:a$1("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,d)})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{htmlFor:"cb-safeguards",className:"block text-sm font-medium mb-1",children:["Safeguards ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("textarea",{id:"cb-safeguards",value:n.safeguards,onChange:a=>p("safeguards",a.target.value),placeholder:`One safeguard per line, e.g.
|
|
4
|
+
End-to-end encryption
|
|
5
|
+
Access control policies
|
|
6
|
+
Regular security audits`,rows:3,"aria-required":"true","aria-describedby":"cb-safeguards-help",className:a$1("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,d)}),jsx("p",{id:"cb-safeguards-help",className:"text-xs text-gray-500 mt-1",children:"Enter one safeguard per line"})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{htmlFor:"cb-riskAssessment",className:"block text-sm font-medium mb-1",children:["Risk Assessment Summary ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("textarea",{id:"cb-riskAssessment",value:n.riskAssessment,onChange:a=>p("riskAssessment",a.target.value),placeholder:"Summarize the risk assessment for this transfer",rows:2,"aria-required":"true","aria-describedby":"cb-form-errors",className:a$1("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,d)})]}),jsxs("div",{children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"Transfer Frequency"}),jsx("select",{value:n.frequency,onChange:a=>p("frequency",a.target.value),className:a$1("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,d),children:J.map(a=>jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxs("div",{children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"Status"}),jsx("select",{value:n.status,onChange:a=>p("status",a.target.value),className:a$1("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,d),children:X.map(a=>jsx("option",{value:a.value,children:a.label},a.value))})]})]}),e$1&&jsxs("div",{className:"mt-4 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsx("h4",{className:"text-sm font-medium text-blue-800 dark:text-blue-200 mb-3",children:"NDPC Approval Required"}),jsx("p",{className:"text-xs text-blue-700 dark:text-blue-300 mb-3",children:"The selected transfer mechanism requires approval from the Nigeria Data Protection Commission."}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{type:"checkbox",id:"ndpcApprovalApplied",checked:n.ndpcApprovalApplied,onChange:a=>p("ndpcApprovalApplied",a.target.checked),className:"h-4 w-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("label",{htmlFor:"ndpcApprovalApplied",className:"text-sm",children:"Application submitted"})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{type:"checkbox",id:"ndpcApprovalApproved",checked:n.ndpcApprovalApproved,onChange:a=>p("ndpcApprovalApproved",a.target.checked),className:"h-4 w-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("label",{htmlFor:"ndpcApprovalApproved",className:"text-sm",children:"Approval granted"})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"NDPC Reference Number"}),jsx("input",{type:"text",value:n.ndpcApprovalReference,onChange:a=>p("ndpcApprovalReference",a.target.value),placeholder:"Reference number (if available)",className:a$1("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,d)})]})]})]}),ie&&jsxs("div",{className:"mt-4 p-4 bg-gray-100 dark:bg-gray-600 rounded-md",children:[jsx("h4",{className:"text-sm font-medium mb-3",children:"Transfer Impact Assessment"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{type:"checkbox",id:"tiaCompleted",checked:n.tiaCompleted,onChange:a=>p("tiaCompleted",a.target.checked),className:"h-4 w-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("label",{htmlFor:"tiaCompleted",className:"text-sm",children:"TIA completed"})]}),jsxs("div",{children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"TIA Reference"}),jsx("input",{type:"text",value:n.tiaReference,onChange:a=>p("tiaReference",a.target.value),placeholder:"Document reference",className:a$1("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,d)})]})]})]}),jsxs("div",{className:"mt-4 flex justify-end gap-3",children:[jsx("button",{onClick:U,className:"px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-md text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-600",children:"Cancel"}),jsx("button",{onClick:pe,className:a$1(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${P}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),d),children:x?"Update Transfer":"Add Transfer"})]})]})},ge=e=>{var u,v;let a=h(e),l=g(e);return jsxs("div",{role:"status","aria-label":"Transfer details",className:a$1("",r==null?void 0:r.detailPanel,d),children:[jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxs("h3",{className:"text-lg font-medium",children:[e.destinationCountry," \u2014 ",e.recipientOrganization]}),jsxs("div",{className:"flex gap-2",children:[Y(e.status),H(e.riskLevel)]})]}),!l.isValid&&jsxs("div",{className:"mb-4 bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Compliance Issues"}),jsx("ul",{className:"list-disc list-inside text-sm text-red-700 dark:text-red-300",children:l.errors.map((s,m)=>jsx("li",{children:s},m))})]}),l.warnings.length>0&&jsxs("div",{className:"mb-4 bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm font-medium text-yellow-800 dark:text-yellow-200 mb-1",children:"Warnings"}),jsx("ul",{className:"list-disc list-inside text-sm text-yellow-700 dark:text-yellow-300",children:l.warnings.map((s,m)=>jsx("li",{children:s},m))})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Destination:"})," ",e.destinationCountry,e.destinationCountryCode?` (${e.destinationCountryCode})`:""]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Adequacy:"})," ",(u=G.find(s=>s.value===e.adequacyStatus))==null?void 0:u.label]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Frequency:"})," ",(v=J.find(s=>s.value===e.frequency))==null?void 0:v.label]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Start Date:"})," ",k(e.startDate)]}),e.endDate&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"End Date:"})," ",k(e.endDate)]}),e.reviewDate&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Next Review:"})," ",k(e.reviewDate)]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Recipient:"})," ",e.recipientOrganization]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Contact:"})," ",e.recipientContact.name," (",e.recipientContact.email,")"]}),e.estimatedDataSubjects&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Data Subjects:"})," ",e.estimatedDataSubjects.toLocaleString()]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Sensitive Data:"})," ",e.includesSensitiveData?"Yes":"No"]})]})]}),jsxs("div",{className:"mb-4",children:[jsx("p",{className:"text-sm font-medium mb-1",children:"Transfer Mechanism"}),jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200",children:f(e.transferMechanism)})})]}),jsxs("div",{className:"mb-4",children:[jsx("p",{className:"text-sm font-medium mb-1",children:"Purpose"}),jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md",children:e.purpose})]}),jsxs("div",{className:"mb-4",children:[jsx("p",{className:"text-sm font-medium mb-1",children:"Data Categories"}),jsx("div",{className:"flex flex-wrap gap-1",children:e.dataCategories.map((s,m)=>jsx("span",{className:"px-2 py-1 bg-gray-100 dark:bg-gray-600 rounded text-xs",children:s},m))})]}),jsxs("div",{className:"mb-4",children:[jsx("p",{className:"text-sm font-medium mb-1",children:"Safeguards"}),jsx("ul",{className:"list-disc list-inside text-sm text-gray-600 dark:text-gray-300",children:e.safeguards.map((s,m)=>jsx("li",{children:s},m))})]}),jsxs("div",{className:"mb-4",children:[jsx("p",{className:"text-sm font-medium mb-1",children:"Risk Assessment"}),jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200 mb-2",children:e.riskAssessment}),jsxs("div",{className:"mt-2",role:"status","aria-label":"Automated risk assessment result",children:[jsxs("p",{className:"text-xs font-medium text-gray-600 dark:text-gray-400 mb-1",children:["Automated Assessment (Score: ",a.riskScore,")"]}),a.factors.length>0&&jsx("ul",{className:"list-disc list-inside text-xs text-gray-600 dark:text-gray-400",children:a.factors.map((s,m)=>jsx("li",{children:s},m))}),a.recommendations.length>0&&jsxs("div",{className:"mt-2",children:[jsx("p",{className:"text-xs font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Recommendations:"}),jsx("ul",{className:"list-disc list-inside text-xs text-gray-600 dark:text-gray-400",children:a.recommendations.map((s,m)=>jsx("li",{children:s},m))})]})]})]})]}),e.ndpcApproval&&jsxs("div",{className:"mb-4",children:[jsx("p",{className:"text-sm font-medium mb-1",children:"NDPC Approval"}),jsxs("div",{className:a$1(`p-3 rounded-md ${e.ndpcApproval.approved?"bg-green-50 dark:bg-green-900/20":e.ndpcApproval.applied?"bg-yellow-50 dark:bg-yellow-900/20":"bg-red-50 dark:bg-red-900/20"}`,r==null?void 0:r.approvalStatus,d),children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Status:"})," ",e.ndpcApproval.approved?"Approved":e.ndpcApproval.applied?"Application Submitted":"Not Applied"]}),e.ndpcApproval.referenceNumber&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Reference:"})," ",e.ndpcApproval.referenceNumber]}),e.ndpcApproval.appliedAt&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Applied:"})," ",k(e.ndpcApproval.appliedAt)]}),e.ndpcApproval.approvedAt&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Approved:"})," ",k(e.ndpcApproval.approvedAt)]})]})]}),jsxs("div",{className:"mb-4",children:[jsx("p",{className:"text-sm font-medium mb-1",children:"Transfer Impact Assessment"}),jsxs("div",{className:`p-3 rounded-md ${e.tiaCompleted?"bg-green-50 dark:bg-green-900/20":"bg-yellow-50 dark:bg-yellow-900/20"}`,children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Status:"})," ",e.tiaCompleted?"Completed":"Not Completed"]}),e.tiaReference&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Reference:"})," ",e.tiaReference]})]})]}),jsxs("div",{className:"flex gap-3 mt-6",children:[jsx("button",{onClick:()=>le(e),"aria-label":`Edit transfer to ${e.destinationCountry}`,className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${P}`,children:"Edit"}),jsx("button",{onClick:()=>se(e.id),"aria-label":`Remove transfer to ${e.destinationCountry}`,className:"px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700",children:"Remove"})]})]})};return jsxs("div",{className:a$1(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${re}`,r==null?void 0:r.root,d),children:[jsx("h2",{className:a$1("text-xl font-bold mb-2",r==null?void 0:r.title,d),children:ee}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:te}),ae&&ce(),!j&&jsx("div",{className:"mb-6",children:jsx("button",{onClick:oe,className:a$1(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${P}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),d),children:"Add Transfer"})}),j&&me(),jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"cbStatusFilter",className:"block text-sm font-medium mb-1",children:"Status Filter"}),jsxs("select",{id:"cbStatusFilter",value:S,onChange:e=>ne(e.target.value),"aria-label":"Filter transfers by status",className:a$1("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,d),children:[jsx("option",{value:"all",children:"All Statuses"}),X.map(e=>jsx("option",{value:e.value,children:e.label},e.value))]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cbMechanismFilter",className:"block text-sm font-medium mb-1",children:"Mechanism Filter"}),jsxs("select",{id:"cbMechanismFilter",value:T,onChange:e=>de(e.target.value),"aria-label":"Filter transfers by mechanism",className:a$1("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,d),children:[jsx("option",{value:"all",children:"All Mechanisms"}),_.map(e=>jsx("option",{value:e.value,children:e.label},e.value))]})]})]}),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:"Transfers"}),C.length===0?jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No cross-border transfers found."}):jsx("div",{className:a$1("space-y-2 max-h-96 overflow-y-auto pr-2",r==null?void 0:r.transferList,d),children:C.map(e=>{var a,l;return jsxs("div",{className:a$1(`p-3 rounded-md cursor-pointer ${b$1===e.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"}`,r==null?void 0:r.transferItem,d),role:"button",tabIndex:0,"aria-label":`View transfer to ${e.destinationCountry}`,onClick:()=>A(e.id),onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),A(e.id));},children:[jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsx("h4",{className:"font-medium text-sm",children:e.destinationCountry}),H(e.riskLevel)]}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:e.recipientOrganization}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:ue(e.transferMechanism)}),jsxs("div",{className:"flex justify-between items-center mt-2",children:[Y(e.status),((a=e.ndpcApproval)==null?void 0:a.required)&&!((l=e.ndpcApproval)!=null&&l.approved)&&jsx("span",{className:"text-xs text-purple-600 dark:text-purple-400",children:"NDPC Pending"})]})]},e.id)})})]}),jsx("div",{className:"md:col-span-2",children:$?ge($):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 transfer to view details"})})})]})]})};export{Ce as a};//# sourceMappingURL=chunk-TI2M7H6R.mjs.map
|
|
7
|
+
//# sourceMappingURL=chunk-TI2M7H6R.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {g}from'./chunk-75TJPK2N.mjs';import {a as a$1}from'./chunk-6WIP33TW.mjs';import {b,a}from'./chunk-WWT2ZSNU.mjs';import {useRef,useState,useEffect,useCallback}from'react';function j(m,l){return l?a$1(m):{load:()=>null,save:()=>{},remove:()=>{}}}function Q({initialTransfers:m=[],adapter:l,storageKey:R="ndpr_cross_border_transfers",useLocalStorage:q=true,onAdd:g$1,onUpdate:C,onRemove:B}={}){let y=l!=null?l:j(R,q),v=useRef(y);v.current=y;let[i,u]=useState(m),[x,T]=useState(true);useEffect(()=>{let e=false;try{let r=v.current.load();r instanceof Promise?r.then(t=>{e||(t&&u(t),T(!1));},()=>{e||T(!1);}):(r&&u(r),T(!1));}catch(r){e||T(false);}return ()=>{e=true;}},[]);let f=useCallback(e=>{Promise.resolve(v.current.save(e)).catch(r=>{console.warn("[ndpr-toolkit] Failed to save cross-border transfers:",r);});},[]),M=()=>"cbt_"+Date.now()+"_"+Math.random().toString(36).substring(2,11),D=useCallback(e=>{let r=Date.now(),t=b(a({},e),{id:M(),createdAt:r,updatedAt:r});return u(a=>{let n=[...a,t];return f(n),n}),g$1&&g$1(t),t},[g$1,f]),k=useCallback((e,r)=>{let t=null;return u(a$1=>{let n=a$1.findIndex(A=>A.id===e);if(n===-1)return a$1;t=b(a(a({},a$1[n]),r),{updatedAt:Date.now()});let o=[...a$1];return o[n]=t,f(o),o}),t&&C&&C(t),t},[C,f]),I=useCallback(e=>{let r=false;return u(t=>{if(t.findIndex(o=>o.id===e)===-1)return t;r=true;let n=t.filter(o=>o.id!==e);return f(n),n}),r&&B&&B(e),r},[B,f]),L=useCallback(e=>i.find(r=>r.id===e)||null,[i]),U=useCallback(()=>{let e=Date.now(),r=i.filter(s=>s.status==="active"),t=["adequacy_decision","standard_clauses","binding_corporate_rules","ndpc_authorization","explicit_consent","contract_performance","public_interest","legal_claims","vital_interests"],a={};for(let s of t)a[s]=r.filter(c=>c.transferMechanism===s).length;let n=["adequate","inadequate","pending_review","unknown"],o={};for(let s of n)o[s]=r.filter(c=>c.adequacyStatus===s).length;let A=i.filter(s=>{var c,b;return s.status==="pending_approval"||((c=s.ndpcApproval)==null?void 0:c.required)&&!((b=s.ndpcApproval)!=null&&b.approved)}),P=720*60*60*1e3,V=i.filter(s=>s.reviewDate&&s.reviewDate<=e+P&&s.status==="active"),F=i.filter(s=>!s.tiaCompleted&&s.status==="active"),z=i.filter(s=>s.riskLevel==="high"&&s.status==="active");return {totalActiveTransfers:r.length,byMechanism:a,byAdequacy:o,pendingApproval:A,dueForReview:V,missingTIA:F,highRiskTransfers:z,lastUpdated:e}},[i]),O=useCallback(e=>g(e),[]);return {transfers:i,addTransfer:D,updateTransfer:k,removeTransfer:I,getTransfer:L,getSummary:U,validateTransfer:O,isLoading:x}}export{Q as a};//# sourceMappingURL=chunk-TKVJ3OOV.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-TKVJ3OOV.mjs.map
|
|
@@ -243,14 +243,14 @@
|
|
|
243
243
|
|
|
244
244
|
a { color: inherit; text-decoration: none; }
|
|
245
245
|
}
|
|
246
|
-
`.trim();function ee(r,u){var R;let v=(u==null?void 0:u.includeStyles)!==false,e=(R=u==null?void 0:u.customCSS)!=null?R:"",a=r.sections.filter(d=>d.included),s=M(r.organizationInfo.name||"Organisation"),t=M(r.title||"Privacy Policy"),l=M(r.version||"1.0"),c=r.effectiveDate?new Date(r.effectiveDate).toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}):new Date().toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}),y=r.lastUpdated?new Date(r.lastUpdated).toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}):c,C=r.organizationInfo.website?`<a href="${M(r.organizationInfo.website)}" target="_blank" rel="noopener">${M(r.organizationInfo.website)}</a>`:"",x=r.organizationInfo.privacyEmail?`<a href="mailto:${M(r.organizationInfo.privacyEmail)}">${M(r.organizationInfo.privacyEmail)}</a>`:"",
|
|
246
|
+
`.trim();function ee(r,u){var R;let v=(u==null?void 0:u.includeStyles)!==false,e=(R=u==null?void 0:u.customCSS)!=null?R:"",a=r.sections.filter(d=>d.included),s=M(r.organizationInfo.name||"Organisation"),t=M(r.title||"Privacy Policy"),l=M(r.version||"1.0"),c=r.effectiveDate?new Date(r.effectiveDate).toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}):new Date().toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}),y=r.lastUpdated?new Date(r.lastUpdated).toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}):c,C=r.organizationInfo.website?`<a href="${M(r.organizationInfo.website)}" target="_blank" rel="noopener">${M(r.organizationInfo.website)}</a>`:"",x=r.organizationInfo.privacyEmail?`<a href="mailto:${M(r.organizationInfo.privacyEmail)}">${M(r.organizationInfo.privacyEmail)}</a>`:"",k=`
|
|
247
247
|
<nav class="policy-toc" aria-label="Table of Contents">
|
|
248
248
|
<h2>Table of Contents</h2>
|
|
249
249
|
<ol>
|
|
250
250
|
${a.map((d,w)=>` <li><a href="#${ce(d.title)}">${M(d.title)}</a></li>`).join(`
|
|
251
251
|
`)}
|
|
252
252
|
</ol>
|
|
253
|
-
</nav>`,
|
|
253
|
+
</nav>`,F=a.map((d,w)=>{let p=ce(d.title),T=d.template||d.defaultContent||"",b=Le(T);return ` <section class="policy-section" id="${p}" aria-labelledby="section-heading-${p}">
|
|
254
254
|
<h2 id="section-heading-${p}">
|
|
255
255
|
<span class="section-number" aria-hidden="true">${w+1}</span>
|
|
256
256
|
${M(d.title)}
|
|
@@ -289,11 +289,11 @@ ${L}
|
|
|
289
289
|
</div>
|
|
290
290
|
</header>
|
|
291
291
|
|
|
292
|
-
${
|
|
292
|
+
${k}
|
|
293
293
|
|
|
294
294
|
<article class="policy-body" aria-label="Policy content">
|
|
295
295
|
|
|
296
|
-
${
|
|
296
|
+
${F}
|
|
297
297
|
|
|
298
298
|
</article>
|
|
299
299
|
|
|
@@ -308,9 +308,13 @@ ${k}
|
|
|
308
308
|
</body>
|
|
309
309
|
</html>`}function Ie(r){return r.toLowerCase().replace(/[^a-z0-9\s-]/g,"").trim().replace(/\s+/g,"-")}function te(r){let u=r.sections.filter(l=>l.included),v=r.title||"Privacy Policy",e=r.organizationInfo.name||"Organisation",a=r.version||"1.0",s=r.effectiveDate?new Date(r.effectiveDate).toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}):new Date().toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}),t=[];return t.push(`# ${v}`),t.push(""),t.push(`_Effective: ${s} | Version: ${a} | ${e}_`),t.push(""),r.organizationInfo.website&&t.push(`**Website:** ${r.organizationInfo.website} `),r.organizationInfo.privacyEmail&&t.push(`**Privacy contact:** ${r.organizationInfo.privacyEmail} `),(r.organizationInfo.website||r.organizationInfo.privacyEmail)&&t.push(""),t.push("> This privacy policy is compliant with the **Nigeria Data Protection Act (NDPA) 2023**."),t.push(""),t.push("---"),t.push(""),u.length>0&&(t.push("## Table of Contents"),t.push(""),u.forEach((l,c)=>{let y=Ie(`${c+1} ${l.title}`);t.push(`${c+1}. [${l.title}](#${y})`);}),t.push(""),t.push("---"),t.push("")),u.forEach((l,c)=>{t.push(`## ${c+1}. ${l.title}`),t.push("");let y=(l.template||l.defaultContent||"").trim();if(y){let C=y.split(`
|
|
310
310
|
`);for(let x of C){let D=x.trimEnd();D.startsWith("-")||D.startsWith("\u2022")||D===""?t.push(D.replace(/^•/,"-")):t.push(D);}}t.push(""),t.push("---"),t.push("");}),t.push(`_Generated by **NDPA Toolkit** \u2014 ${e} \u2022 Version ${a}_`),t.push(""),t.join(`
|
|
311
|
-
`)}function oe(r,u){return chunkMQFZHA2D_js.d(this,null,function*(){var R;let v;try{let d=yield import('jspdf');v=(R=d.jsPDF)!=null?R:d.default;}catch(d){throw new Error(
|
|
312
|
-
|
|
313
|
-
`)
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
311
|
+
`)}function oe(r,u){return chunkMQFZHA2D_js.d(this,null,function*(){var R;let v;try{let d=yield import('jspdf');v=(R=d.jsPDF)!=null?R:d.default;}catch(d){throw new Error(`[ndpr-toolkit] PDF export requires the "jspdf" package. Install it with:
|
|
312
|
+
pnpm add jspdf
|
|
313
|
+
See: https://ndprtoolkit.com.ng/docs/guides/styling-customization`)}let e=new v({unit:"mm",format:"a4"}),a=e.internal.pageSize.getWidth(),s=e.internal.pageSize.getHeight(),t=20,l=a-t*2,c=t,y=r.organizationInfo.name||"",C=r.title||"Privacy Policy",x=r.version||"1.0",D=r.effectiveDate?new Date(r.effectiveDate).toLocaleDateString():new Date().toLocaleDateString(),k=()=>{e.setFontSize(8),e.setFont("helvetica","italic"),e.setTextColor(150,150,150),e.text(y?`${y} \u2014 ${C}`:C,t,12),e.setDrawColor(220,220,220),e.setLineWidth(.3),e.line(t,14,a-t,14),e.setTextColor(0,0,0);},F=d=>{c+d>s-t-10&&(e.addPage(),c=t+8,k());};if((u==null?void 0:u.includeCoverPage)!==false){e.setFillColor(22,163,74),e.rect(0,0,a,12,"F"),e.setFontSize(28),e.setFont("helvetica","bold"),e.setTextColor(22,163,74);let d=e.splitTextToSize(C,l-10),w=72;d.forEach(T=>{e.text(T,a/2,w,{align:"center"}),w+=11;}),e.setDrawColor(22,163,74),e.setLineWidth(.6);let p=w+6;if(e.line(a/2-30,p,a/2+30,p),e.setFontSize(14),e.setFont("helvetica","normal"),e.setTextColor(40,40,40),e.text(y,a/2,p+14,{align:"center"}),e.setFontSize(10),e.setTextColor(100,100,100),e.text(`Effective Date: ${D}`,a/2,p+26,{align:"center"}),e.text(`Version ${x}`,a/2,p+34,{align:"center"}),(u==null?void 0:u.includeComplianceBadge)!==false){let T=p+52,b="Compliant with the Nigeria Data Protection Act (NDPA) 2023";e.setFontSize(8.5),e.setFont("helvetica","bold"),e.setTextColor(255,255,255);let g=e.getTextWidth(b),m=7,_=3.5,H=(a-g-m*2)/2;e.setFillColor(22,163,74),e.roundedRect(H,T-_-1,g+m*2,7+_,2,2,"F"),e.text(b,a/2,T+1.5,{align:"center"}),e.setTextColor(0,0,0);}e.setFillColor(22,163,74),e.rect(0,s-12,a,12,"F"),e.addPage(),c=t+8,k();}let z=r.sections.filter(d=>d.included);(u==null?void 0:u.includeTOC)!==false&&(e.setFontSize(18),e.setFont("helvetica","bold"),e.setTextColor(22,163,74),e.text("Table of Contents",t,c+4),e.setDrawColor(22,163,74),e.setLineWidth(.5),e.line(t,c+8,t+80,c+8),c+=18,e.setFontSize(10.5),e.setFont("helvetica","normal"),e.setTextColor(40,40,40),z.forEach((d,w)=>{F(7);let p=`${w+1}. ${d.title}`;e.text(p,t+4,c),c+=6.5;}),e.addPage(),c=t+8,k()),z.forEach((d,w)=>{F(18),e.setFillColor(22,163,74),e.circle(t+3.5,c-1.5,3.8,"F"),e.setFontSize(8),e.setFont("helvetica","bold"),e.setTextColor(255,255,255),e.text(String(w+1),t+3.5,c-.5,{align:"center"}),e.setFontSize(13),e.setFont("helvetica","bold"),e.setTextColor(22,163,74),e.text(d.title,t+11,c),c+=3,e.setDrawColor(200,200,200),e.setLineWidth(.25),e.line(t+11,c,a-t,c),c+=6;let p=(d.template||d.defaultContent||"").trim();if(p){let T=p.split(`
|
|
314
|
+
`);e.setFontSize(9.5),e.setFont("helvetica","normal"),e.setTextColor(50,50,50),T.forEach(b=>{let g=b.trimEnd();if(g===""){c+=3;return}let m=g.startsWith("-")||g.startsWith("\u2022"),_=m?t+8:t+4,H=m?g.replace(/^[-•]\s*/,""):g,A=l-(m?12:8);e.splitTextToSize(H,A).forEach((X,Z)=>{F(5),m&&Z===0&&(e.setFillColor(22,163,74),e.circle(t+4,c-1,.9,"F")),e.text(X,_,c),c+=5;});});}c+=10;});let L=e.getNumberOfPages();for(let d=1;d<=L;d++)e.setPage(d),e.setFontSize(7.5),e.setFont("helvetica","normal"),e.setTextColor(160,160,160),e.setDrawColor(220,220,220),e.setLineWidth(.3),e.line(t,s-12,a-t,s-12),e.text(y?`${y} \u2014 Privacy Policy`:"Privacy Policy",t,s-8),e.text(`Page ${d} of ${L}`,a-t,s-8,{align:"right"}),e.setTextColor(0,0,0);return e.setProperties({title:C,author:y,subject:"Privacy Policy \u2014 NDPA 2023 Compliant",keywords:"privacy policy, NDPA, Nigeria, data protection"}),e.output("blob")})}function re(r,u){return chunkMQFZHA2D_js.d(this,null,function*(){let v;try{v=yield import('docx');}catch(b){throw new Error(`[ndpr-toolkit] Word export requires the "docx" package. Install it with:
|
|
315
|
+
pnpm add docx
|
|
316
|
+
See: https://ndprtoolkit.com.ng/docs/guides/styling-customization`)}let{Document:e,Paragraph:a,TextRun:s,HeadingLevel:t,Packer:l,Header:c,Footer:y,PageNumber:C,AlignmentType:x,BorderStyle:D,ShadingType:k,TableOfContents:F}=v,z=r.organizationInfo.name||"",L=r.title||"Privacy Policy",R=r.version||"1.0",d=r.effectiveDate?new Date(r.effectiveDate).toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}):new Date().toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}),w=r.sections.filter(b=>b.included),p=[];if(p.push(new a({children:[new s({text:L,bold:true,size:52,color:"064e3b"})],heading:t.TITLE,spacing:{after:160},alignment:x.CENTER})),p.push(new a({children:[new s({text:`${z}${z?" \u2022 ":""}Version ${R} \u2022 Effective ${d}`,size:20,color:"6b7280",italics:true})],spacing:{after:120},alignment:x.CENTER})),p.push(new a({children:[new s({text:"Compliant with the Nigeria Data Protection Act (NDPA) 2023",size:18,color:"16a34a",bold:true})],spacing:{after:400},alignment:x.CENTER})),p.push(new a({children:[],spacing:{after:200},border:{bottom:{color:"16a34a",style:D.SINGLE,size:6,space:1}}})),(u==null?void 0:u.includeTOC)!==false){if(p.push(new a({children:[new s({text:"Table of Contents",bold:true,size:28,color:"064e3b"})],heading:t.HEADING_1,spacing:{before:400,after:200}})),typeof F=="function")try{p.push(new F("Table of Contents",{hyperlink:!0,headingStyleRange:"1-1"}));}catch(b){w.forEach((g,m)=>{p.push(new a({children:[new s({text:`${m+1}. ${g.title}`,size:22,color:"15803d"})],spacing:{after:80}}));});}else w.forEach((b,g)=>{p.push(new a({children:[new s({text:`${g+1}. ${b.title}`,size:22,color:"15803d"})],spacing:{after:80}}));});p.push(new a({children:[],pageBreakBefore:true}));}w.forEach((b,g)=>{p.push(new a({children:[new s({text:`${g+1}. ${b.title}`,bold:true,size:28,color:"064e3b"})],heading:t.HEADING_1,spacing:{before:400,after:200},border:{bottom:{color:"dcfce7",style:D.SINGLE,size:4,space:1}}}));let m=(b.template||b.defaultContent||"").trim();m&&m.split(`
|
|
317
|
+
`).forEach(H=>{let A=H.trimEnd();if(A===""){p.push(new a({children:[],spacing:{after:60}}));return}let N=A.startsWith("- ")||A.startsWith("\u2022 "),X=N?A.replace(/^[-•]\s*/,""):A;N?p.push(new a({children:[new s({text:X,size:22})],spacing:{after:80},bullet:{level:0}})):p.push(new a({children:[new s({text:X,size:22})],spacing:{after:100}}));});}),p.push(new a({children:[new s({text:`Generated by NDPA Toolkit \u2014 ${z}${z?" \u2014 ":""}Privacy Policy v${R}`,size:16,color:"9ca3af",italics:true})],spacing:{before:600},alignment:x.CENTER}));let T=new e({title:L,description:"Privacy Policy \u2014 NDPA 2023 Compliant",styles:{paragraphStyles:[{id:"Normal",name:"Normal",run:{font:"Calibri",size:22}}]},sections:[{headers:{default:new c({children:[new a({children:[new s({text:z||"Privacy Policy",size:16,color:"9ca3af"})],alignment:x.RIGHT})]})},footers:{default:new y({children:[new a({children:[new s({text:"Page ",size:16,color:"9ca3af"}),new s({children:[C.CURRENT],size:16,color:"9ca3af"}),new s({text:" of ",size:16,color:"9ca3af"}),new s({children:[C.TOTAL_PAGES],size:16,color:"9ca3af"})],alignment:x.CENTER})]})},children:p}]});return l.toBlob(T)})}var le=10,Me="ndpr_policy_draft",Re=2e3;function de(){return `section_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function pe(){return `draft_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function U(r,u,v){let e=Date.now();return {id:v,title:`Privacy Policy${r.org.name?` \u2014 ${r.org.name}`:""}`,templateId:"adaptive-policy-wizard",organizationInfo:{name:r.org.name,website:r.org.website,privacyEmail:r.org.privacyEmail,address:r.org.address,dpoName:r.org.dpoName,dpoEmail:r.org.dpoEmail,industry:r.org.industry},sections:u,variableValues:{},effectiveDate:e,lastUpdated:e,version:"1.0",applicableFrameworks:["ndpa","ndpr"]}}function ot(r={}){var ne;let{onComplete:u,onComplianceChange:v}=r,e=react.useRef((ne=r.adapter)!=null?ne:chunkELKB2AFZ_js.a(Me));r.adapter&&(e.current=r.adapter);let a=react.useRef(pe()),[s,t]=react.useState(1),[l,c]=react.useState(chunkLU4PFST7_js.b),[y,C]=react.useState([]),[x,D]=react.useState({}),[k,F]=react.useState([]),[z,L]=react.useState(false),[R,d]=react.useState(null),[w,p]=react.useState(true),T=react.useRef(false),b=react.useRef(null);react.useEffect(()=>{let o=false,n=i=>{i&&(a.current=i.id,c(i.templateContext),C(i.customSections),D(i.sectionOverrides),F(i.sectionOrder),t(i.currentStep),d(i.lastSavedAt),L(true));};try{let i=e.current.load();i instanceof Promise?i.then(h=>{o||(n(h),p(!1));},()=>{o||p(!1);}):(n(i),p(!1));}catch(i){o||p(false);}return ()=>{o=true;}},[]);let g=react.useMemo(()=>{let n=chunkLU4PFST7_js.d(l).map(f=>x[f.id]?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},f),{template:x[f.id]}):f),i=y.map(f=>{var E;return {id:f.id,title:f.title,template:(E=x[f.id])!=null?E:f.content,order:f.order,required:false,included:true}}),h=[...n,...i];if(k.length>0){let f=new Map(k.map((E,$)=>[E,$]));return [...h].sort((E,$)=>{let O=f.has(E.id)?f.get(E.id):h.length,W=f.has($.id)?f.get($.id):h.length;return O-W})}return [...h].sort((f,E)=>{var $,O;return (($=f.order)!=null?$:0)-((O=E.order)!=null?O:0)})},[l,y,x,k]),m=react.useMemo(()=>!l.org.name&&!l.org.privacyEmail?null:U(l,g,a.current),[l,g]),_=react.useMemo(()=>U(chunkLU4PFST7_js.b(),[],a.current),[]),H=react.useMemo(()=>chunkLU4PFST7_js.c(m!=null?m:_,l),[m,l,_]),A=H.percentage,N=H.gaps,X=react.useRef({score:-1,gaps:[]});react.useEffect(()=>{let o=X.current;v&&(A!==o.score||N!==o.gaps)&&v(A,N),X.current={score:A,gaps:N};},[A,N,v]);let Z=react.useMemo(()=>{switch(s){case 1:return l.org.name.trim().length>0&&l.org.privacyEmail.trim().length>0;case 2:return l.dataCategories.some(o=>o.selected);case 3:return l.purposes.length>0;case 4:return true;default:return false}},[s,l]),me=react.useCallback(o=>{let n=Math.min(Math.max(1,o),4);n<4&&(T.current=false),t(n);},[]),ue=react.useCallback(()=>{t(o=>Math.min(o+1,4));},[]),ge=react.useCallback(()=>{T.current=false,t(o=>Math.max(o-1,1));},[]),fe=react.useCallback(o=>{c(n=>chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},n),o));},[]),he=react.useCallback(o=>{c(n=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},n),{org:chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},n.org),o)}));},[]),ye=react.useCallback(o=>{c(n=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},n),{dataCategories:n.dataCategories.map(i=>i.id===o?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{selected:!i.selected}):i)}));},[]),ve=react.useCallback(o=>{c(n=>{let i=o,h=n.purposes.includes(i);return chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},n),{purposes:h?n.purposes.filter(f=>f!==o):[...n.purposes,i]})});},[]),xe=react.useCallback(o=>{c(n=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},n),{thirdPartyProcessors:[...n.thirdPartyProcessors,o]}));},[]),be=react.useCallback(o=>{c(n=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},n),{thirdPartyProcessors:n.thirdPartyProcessors.filter((i,h)=>h!==o)}));},[]),Pe=react.useCallback(o=>{C(n=>n.length>=le?n:[...n,chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},o),{id:de(),required:false})]);},[]),Ce=react.useCallback((o,n)=>{C(i=>i.map(h=>h.id===o?chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},h),n):h));},[]),we=react.useCallback(o=>{C(n=>n.filter(i=>i.id!==o)),F(n=>n.filter(i=>i!==o)),D(n=>{let i=chunkMQFZHA2D_js.a({},n);return delete i[o],i});},[]),Se=react.useCallback((o,n)=>{F(i=>{let h=i.length>0?i:g.map(O=>O.id),f=h.indexOf(o);if(f===-1){let O=g.map(Ae=>Ae.id),W=O.indexOf(o);if(W===-1)return i;let K=n==="up"?W-1:W+1;if(K<0||K>=O.length)return O;let j=[...O];return [j[W],j[K]]=[j[K],j[W]],j}let E=n==="up"?f-1:f+1;if(E<0||E>=h.length)return h;let $=[...h];return [$[f],$[E]]=[$[E],$[f]],$});},[g]),De=react.useCallback((o,n)=>{D(i=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{[o]:n}));},[]),Te=react.useCallback(o=>{let n=N.find(i=>i.requirementId===o);if(n)switch(n.fixType){case "fill_field":{T.current=false;let h=["data-categories-disclosed"],f=["purpose-of-processing"];h.includes(o)?t(2):f.includes(o)?t(3):(t(1));break}case "add_section":{if(!n.suggestedContent)break;C(i=>i.length>=le?i:[...i,{id:de(),title:n.requirement,content:n.suggestedContent,order:999,required:false}]);break}case "add_content":{if(!n.suggestedContent)break;let i="data-subject-rights";D(h=>{var E,$,O;let f=(O=($=h[i])!=null?$:(E=g.find(W=>W.id===i))==null?void 0:E.template)!=null?O:"";return chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},h),{[i]:`${f}
|
|
318
|
+
|
|
319
|
+
${n.suggestedContent}`.trim()})});break}}},[N,g]),Y=react.useCallback(o=>({id:a.current,templateContext:l,customSections:y,sectionOverrides:x,sectionOrder:k,currentStep:o,lastSavedAt:Date.now(),status:"draft"}),[l,y,x,k]),Ee=react.useCallback(()=>chunkMQFZHA2D_js.d(null,null,function*(){let o=Y(s);try{yield Promise.resolve(e.current.save(o)),d(o.lastSavedAt),L(!0);}catch(n){console.warn("[ndpr-toolkit] Failed to save draft:",n);}}),[Y,s]),$e=react.useCallback(()=>{Promise.resolve(e.current.remove()).catch(o=>{console.warn("[ndpr-toolkit] Failed to remove draft:",o);}),a.current=pe(),T.current=false,c(chunkLU4PFST7_js.b()),C([]),D({}),F([]),t(1),L(false),d(null);},[]);react.useEffect(()=>{if(!w)return b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{let o=Y(s);Promise.resolve(e.current.save(o)).then(()=>{d(o.lastSavedAt),L(true);}).catch(n=>{console.warn("[ndpr-toolkit] Auto-save failed:",n);});},Re),()=>{b.current&&clearTimeout(b.current);}},[l,y,x,k,s,w,Y]),react.useEffect(()=>{s===4&&m&&u&&!T.current&&(T.current=true,u(m));},[s,m,u]);let ze=react.useCallback(o=>chunkMQFZHA2D_js.d(null,null,function*(){let n=m!=null?m:U(l,g,a.current);return oe(n,o)}),[m,l,g]),Oe=react.useCallback(o=>chunkMQFZHA2D_js.d(null,null,function*(){let n=m!=null?m:U(l,g,a.current);return re(n,o)}),[m,l,g]),ke=react.useCallback(o=>{let n=m!=null?m:U(l,g,a.current);return ee(n,o)},[m,l,g]),Fe=react.useCallback(()=>{let o=m!=null?m:U(l,g,a.current);return te(o)},[m,l,g]);return {currentStep:s,goToStep:me,nextStep:ue,prevStep:ge,canProceed:Z,context:l,updateContext:fe,updateOrg:he,toggleDataCategory:ye,togglePurpose:ve,addProcessor:xe,removeProcessor:be,policy:m,sections:g,customSections:y,addCustomSection:Pe,updateCustomSection:Ce,removeCustomSection:we,reorderSections:Se,editSectionContent:De,sectionOverrides:x,complianceScore:A,complianceResult:H,complianceGaps:N,applyFix:Te,handleExportPDF:ze,handleExportDOCX:Oe,handleExportHTML:ke,handleExportMarkdown:Fe,isDraftSaved:z,lastSavedAt:R,saveDraft:Ee,discardDraft:$e,isLoading:w}}exports.a=ee;exports.b=te;exports.c=oe;exports.d=re;exports.e=ot;//# sourceMappingURL=chunk-TXXWCB5O.js.map
|
|
320
|
+
//# sourceMappingURL=chunk-TXXWCB5O.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
'use strict';var chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var c={consent:{title:"We Value Your Privacy",description:"We use cookies and similar technologies to provide our services and enhance your experience. Your consent is collected in accordance with NDPA Sections 25-26.",acceptAll:"Accept All",rejectAll:"Reject All",customize:"Customize",savePreferences:"Save Preferences",selectAll:"Select All",deselectAll:"Deselect All",required:"Required",cookieNotice:'By clicking "Accept All", you agree to the use of ALL cookies. Visit our Cookie Policy to learn more.'},dsr:{title:"Submit a Data Subject Request",description:"Use this form to exercise your rights under the Nigeria Data Protection Act (NDPA), Part IV, Sections 29-36.",submitRequest:"Submit Request",reset:"Reset",fullName:"Full Name",email:"Email Address",phone:"Phone Number (Optional)",requestType:"Request Type",additionalInfo:"Additional Information",identityVerification:"Identity Verification",identifierType:"Identifier Type",identifierValue:"Identifier Value",privacyNotice:"The information you provide in this form will be used solely for the purpose of processing your data subject request.",successMessage:"Your request has been submitted successfully."},breach:{title:"Report a Data Breach",description:"Use this form to report a suspected or confirmed data breach in accordance with NDPA Section 40.",submitReport:"Submit Report",breachTitle:"Breach Title/Summary",category:"Category",discoveredAt:"Date Discovered",detailedDescription:"Detailed Description"},dpia:{title:"Data Protection Impact Assessment",next:"Next",previous:"Previous",complete:"Complete Assessment",progress:"Progress"},policy:{title:"Privacy Policy Generator",generate:"Generate Policy",preview:"Preview",export:"Export",sections:"Sections",variables:"Variables"},compliance:{score:"Compliance Score",excellent:"Excellent",good:"Good",needsWork:"Needs Work",critical:"Critical",recommendations:"Recommendations",passed:"Passed",gaps:"Gaps"},common:{loading:"Loading...",error:"An error occurred",save:"Save",cancel:"Cancel",delete:"Delete",edit:"Edit",add:"Add",back:"Back",next:"Next",search:"Search",noResults:"No results found"}};function f(o){if(!o)return c;let t=chunkMQFZHA2D_js.a({},c);for(let e of Object.keys(o))o[e]&&(t[e]=chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},c[e]),o[e]));return t}var p=react.createContext({}),d=class extends react.Component{constructor(e){super(e);this.reset=()=>{this.setState({error:null});};this.state={error:null};}static getDerivedStateFromError(e){return {error:e}}componentDidCatch(e,r){var l,i;(i=(l=this.props).onError)==null||i.call(l,e,r);}render(){let{error:e}=this.state;if(e){let{fallback:r}=this.props;return typeof r=="function"?r(e,this.reset):r!==void 0?r:jsxRuntime.jsxs("div",{role:"alert",style:{padding:"16px",border:"1px solid #e53e3e",borderRadius:"4px",backgroundColor:"#fff5f5",color:"#c53030"},children:[jsxRuntime.jsx("h3",{style:{margin:"0 0 8px 0",fontSize:"16px"},children:"Something went wrong"}),jsxRuntime.jsx("p",{style:{margin:0,fontSize:"14px"},children:e.message})]})}return this.props.children}},A=l=>{var i=l,{children:o,fallback:t,onError:e}=i,r=chunkMQFZHA2D_js.c(i,["children","fallback","onError"]);let u=react.useMemo(()=>{if(!r.theme)return;let a={};return r.theme.primary&&(a["--ndpr-primary"]=r.theme.primary),r.theme.primaryHover&&(a["--ndpr-primary-hover"]=r.theme.primaryHover),r.theme.primaryForeground&&(a["--ndpr-primary-foreground"]=r.theme.primaryForeground),Object.keys(a).length>0?a:void 0},[r.theme]);return jsxRuntime.jsx(p.Provider,{value:r,children:jsxRuntime.jsx(d,{fallback:t,onError:e,children:u?jsxRuntime.jsx("div",{style:u,children:o}):o})})};function C(){return react.useContext(p)}function k(){let{locale:o}=react.useContext(p);return react.useMemo(()=>f(o),[o])}exports.a=c;exports.b=f;exports.c=A;exports.d=C;exports.e=k;//# sourceMappingURL=chunk-UGY5ZYUG.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-UGY5ZYUG.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkTDDAYVKK_js=require('./chunk-TDDAYVKK.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var q={name:"",description:"",lawfulBasis:"consent",lawfulBasisJustification:"",dataCategories:"",involvesSensitiveData:false,sensitiveDataCondition:"",dataSubjectCategories:"",purposes:"",retentionPeriod:"",retentionJustification:"",recipients:"",crossBorderTransfer:false,reviewDate:"",liaPurposeTest:"",liaNecessityTest:"",liaBalancingTest:"",liaSafeguards:"",liaConclusion:""},Q=[{value:"consent",label:"Consent"},{value:"contract",label:"Contract"},{value:"legal_obligation",label:"Legal Obligation"},{value:"vital_interests",label:"Vital Interests"},{value:"public_interest",label:"Public Interest"},{value:"legitimate_interests",label:"Legitimate Interests"}],X=[{value:"explicit_consent",label:"Explicit Consent"},{value:"employment_law",label:"Employment Law"},{value:"vital_interests_incapable",label:"Vital Interests (Incapable)"},{value:"nonprofit_legitimate",label:"Nonprofit Legitimate Activities"},{value:"publicly_available",label:"Publicly Available Data"},{value:"legal_claims",label:"Legal Claims"},{value:"substantial_public_interest",label:"Substantial Public Interest"},{value:"health_purposes",label:"Health Purposes"},{value:"public_health",label:"Public Health"},{value:"archiving_research",label:"Archiving / Research"}],Ce=({activities:c,onAddActivity:F,onUpdateActivity:_,onArchiveActivity:j,title:Z="Lawful Basis Tracker",description:ee="Document and track the lawful basis for each processing activity as required by NDPA 2023 Section 25.",className:te="",buttonClassName:m="",showSummary:re=true,showComplianceGaps:ie=true,classNames:r,unstyled:o})=>{let[h,v]=react.useState("list"),[a,w]=react.useState(q),[f,I]=react.useState(null),[J,ae]=react.useState(null),[A,ne]=react.useState("all"),[B,oe]=react.useState("all"),[S,de]=react.useState(""),[g,k]=react.useState([]),V=react.useMemo(()=>{let e=[...c];if(A!=="all"&&(e=e.filter(l=>l.status===A)),B!=="all"&&(e=e.filter(l=>l.lawfulBasis===B)),S){let l=S.toLowerCase();e=e.filter(u=>u.name.toLowerCase().includes(l)||u.description.toLowerCase().includes(l)||u.purposes.some(N=>N.toLowerCase().includes(l)));}return e.sort((l,u)=>u.updatedAt-l.updatedAt),e},[c,A,B,S]),C=react.useCallback(e=>new Date(e).toLocaleDateString(),[]),P=react.useMemo(()=>chunkTDDAYVKK_js.d(c),[c]),x=react.useMemo(()=>chunkTDDAYVKK_js.c(c),[c]),D=react.useCallback(e=>e.split(",").map(l=>l.trim()).filter(l=>l.length>0),[]),le=react.useCallback(()=>{w(q),I(null),k([]),v("form");},[]),M=react.useCallback(e=>{w({name:e.name,description:e.description,lawfulBasis:e.lawfulBasis,lawfulBasisJustification:e.lawfulBasisJustification,dataCategories:e.dataCategories.join(", "),involvesSensitiveData:e.involvesSensitiveData,sensitiveDataCondition:e.sensitiveDataCondition||"",dataSubjectCategories:e.dataSubjectCategories.join(", "),purposes:e.purposes.join(", "),retentionPeriod:e.retentionPeriod,retentionJustification:e.retentionJustification||"",recipients:(e.recipients||[]).join(", "),crossBorderTransfer:e.crossBorderTransfer,reviewDate:e.reviewDate?new Date(e.reviewDate).toISOString().split("T")[0]:"",liaPurposeTest:"",liaNecessityTest:"",liaBalancingTest:"",liaSafeguards:"",liaConclusion:""}),I(e.id),k([]),v("form");},[]),se=react.useCallback(()=>{let e={name:a.name,description:a.description,lawfulBasis:a.lawfulBasis,lawfulBasisJustification:a.lawfulBasisJustification,dataCategories:D(a.dataCategories),involvesSensitiveData:a.involvesSensitiveData,sensitiveDataCondition:a.sensitiveDataCondition||void 0,dataSubjectCategories:D(a.dataSubjectCategories),purposes:D(a.purposes),retentionPeriod:a.retentionPeriod,retentionJustification:a.retentionJustification||void 0,recipients:a.recipients?D(a.recipients):void 0,crossBorderTransfer:a.crossBorderTransfer,reviewDate:a.reviewDate?new Date(a.reviewDate).getTime():void 0,status:"active"},l=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},e),{id:f||"temp",createdAt:Date.now(),updatedAt:Date.now()}),u=chunkTDDAYVKK_js.a(l);if(!u.isValid){k(u.errors);return}f&&_?_(f,e):F&&F(e),w(q),I(null),k([]),v("list");},[a,f,_,F,D]),G=react.useCallback(e=>{j&&j(e);},[j]),ue=react.useCallback(e=>{ae(e),v("detail");},[]),n=react.useMemo(()=>J?c.find(e=>e.id===J):null,[c,J]),H=react.useCallback(e=>{let l={active:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",inactive:"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200",under_review:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",archived:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"},u={active:"Active",inactive:"Inactive",under_review:"Under Review",archived:"Archived"};return jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${l[e]}`,r==null?void 0:r.statusBadge,o),children:u[e]})},[r==null?void 0:r.statusBadge,o]),U=react.useCallback(e=>{let l={consent:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",contract:"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200",legal_obligation:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",vital_interests:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",public_interest:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",legitimate_interests:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200"},u={consent:"Consent",contract:"Contract",legal_obligation:"Legal Obligation",vital_interests:"Vital Interests",public_interest:"Public Interest",legitimate_interests:"Legitimate Interests"};return jsxRuntime.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${l[e]}`,children:u[e]})},[]),Y=react.useCallback(e=>e.dpoApproval?e.dpoApproval.approved?jsxRuntime.jsx("span",{className:"px-2 py-1 rounded text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",children:"Approved"}):jsxRuntime.jsx("span",{className:"px-2 py-1 rounded text-xs font-medium bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",children:"Pending Approval"}):jsxRuntime.jsx("span",{className:"px-2 py-1 rounded text-xs font-medium bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-400",children:"No DPO Review"}),[]),pe=()=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",r==null?void 0:r.summary,o),role:"status","aria-label":"Compliance summary",children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-blue-50 dark:bg-blue-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-blue-800 dark:text-blue-200",children:P.totalActivities}),jsxRuntime.jsx("p",{className:"text-sm text-blue-600 dark:text-blue-300",children:"Total Activities"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-orange-50 dark:bg-orange-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-orange-800 dark:text-orange-200",children:P.sensitiveDataActivities}),jsxRuntime.jsx("p",{className:"text-sm text-orange-600 dark:text-orange-300",children:"Sensitive Data"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-purple-50 dark:bg-purple-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-purple-800 dark:text-purple-200",children:P.crossBorderActivities}),jsxRuntime.jsx("p",{className:"text-sm text-purple-600 dark:text-purple-300",children:"Cross-Border Transfers"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-red-50 dark:bg-red-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-red-800 dark:text-red-200",children:P.activitiesWithoutApproval.length}),jsxRuntime.jsx("p",{className:"text-sm text-red-600 dark:text-red-300",children:"Pending Approval"})]})]}),R=react.useMemo(()=>x.filter(e=>e.severity==="high"),[x]),E=react.useMemo(()=>x.filter(e=>e.severity==="medium"),[x]),ge=()=>x.length===0?jsxRuntime.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-4 rounded-lg mb-6",role:"status","aria-label":"No compliance gaps",children:[jsxRuntime.jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"No compliance gaps detected."}),jsxRuntime.jsx("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:"All processing activities appear to be properly documented."})]}):jsxRuntime.jsxs("div",{className:"mb-6",role:"status","aria-label":`${x.length} compliance gaps detected`,children:[R.length>0&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-red-50 dark:bg-red-900/20 p-4 rounded-lg mb-3",r==null?void 0:r.gapAlert,o),children:[jsxRuntime.jsxs("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium mb-2",children:["High Priority (",R.length,")"]}),jsxRuntime.jsx("ul",{className:"space-y-1",children:R.map((e,l)=>jsxRuntime.jsx("li",{className:"text-xs text-red-700 dark:text-red-300",children:e.description},l))})]}),E.length>0&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-yellow-50 dark:bg-yellow-900/20 p-4 rounded-lg",r==null?void 0:r.gapAlert,o),children:[jsxRuntime.jsxs("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium mb-2",children:["Medium Priority (",E.length,")"]}),jsxRuntime.jsx("ul",{className:"space-y-1",children:E.map((e,l)=>jsxRuntime.jsx("li",{className:"text-xs text-yellow-700 dark:text-yellow-300",children:e.description},l))})]})]}),W=react.useCallback(()=>{v("list"),k([]);},[]),ce=react.useCallback(()=>{v("list");},[]),s=react.useCallback((e,l)=>{w(u=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},u),{[e]:l}));},[]),be=react.useCallback(e=>{w(l=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},l),{involvesSensitiveData:e,sensitiveDataCondition:e?l.sensitiveDataCondition:""}));},[]),me=()=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",r==null?void 0:r.form,o),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex justify-between items-center mb-4",r==null?void 0:r.header,o),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium",children:f?"Edit Processing Activity":"New Processing Activity"}),jsxRuntime.jsx("button",{onClick:W,className:`px-4 py-2 text-gray-600 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded hover:bg-gray-200 dark:hover:bg-gray-600 ${m}`,children:"Cancel"})]}),g.length>0&&jsxRuntime.jsxs("div",{id:"form-errors",className:"bg-red-50 dark:bg-red-900/20 p-4 rounded-lg mb-4",role:"alert",children:[jsxRuntime.jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium mb-2",children:"Please correct the following errors:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside space-y-1",children:g.map((e,l)=>jsxRuntime.jsx("li",{className:"text-xs text-red-700 dark:text-red-300",children:e},l))})]}),jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"activityName",className:"block text-sm font-medium mb-1",children:"Activity Name *"}),jsxRuntime.jsx("input",{type:"text",id:"activityName",value:a.name,onChange:e=>s("name",e.target.value),placeholder:"e.g., Customer Account Management","aria-required":"true","aria-describedby":g.length>0?"form-errors":void 0,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("label",{htmlFor:"activityDescription",className:"block text-sm font-medium mb-1",children:"Description *"}),jsxRuntime.jsx("textarea",{id:"activityDescription",value:a.description,onChange:e=>s("description",e.target.value),placeholder:"Describe what processing is performed...",rows:3,"aria-required":"true","aria-describedby":g.length>0?"form-errors":void 0,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("label",{htmlFor:"lawfulBasis",className:"block text-sm font-medium mb-1",children:"Lawful Basis (NDPA Section 25) *"}),jsxRuntime.jsx("select",{id:"lawfulBasis",value:a.lawfulBasis,onChange:e=>s("lawfulBasis",e.target.value),"aria-required":"true",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),children:Q.map(e=>jsxRuntime.jsx("option",{value:e.value,children:e.label},e.value))}),jsxRuntime.jsx("p",{className:"mt-1 text-xs text-gray-600 dark:text-gray-400",children:chunkTDDAYVKK_js.b(a.lawfulBasis)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"justification",className:"block text-sm font-medium mb-1",children:"Lawful Basis Justification *"}),jsxRuntime.jsx("textarea",{id:"justification",value:a.lawfulBasisJustification,onChange:e=>s("lawfulBasisJustification",e.target.value),placeholder:"Document why this lawful basis applies to this processing activity...",rows:3,"aria-required":"true","aria-describedby":g.length>0?"form-errors":void 0,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)})]}),a.lawfulBasis==="legitimate_interests"&&jsxRuntime.jsxs("div",{className:"border border-indigo-200 dark:border-indigo-800 rounded-lg p-4 bg-indigo-50 dark:bg-indigo-900/20",children:[jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-indigo-800 dark:text-indigo-200 mb-3",children:"Legitimate Interest Assessment (LIA)"}),jsxRuntime.jsx("p",{className:"text-xs text-indigo-600 dark:text-indigo-300 mb-4",children:"NDPA Section 25(1)(f) requires a balancing test when relying on legitimate interests."}),jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"liaPurpose",className:"block text-sm font-medium mb-1",children:"Purpose Test"}),jsxRuntime.jsx("textarea",{id:"liaPurpose",value:a.liaPurposeTest,onChange:e=>s("liaPurposeTest",e.target.value),placeholder:"Describe the legitimate interest being pursued...",rows:2,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("label",{htmlFor:"liaNecessity",className:"block text-sm font-medium mb-1",children:"Necessity Test"}),jsxRuntime.jsx("textarea",{id:"liaNecessity",value:a.liaNecessityTest,onChange:e=>s("liaNecessityTest",e.target.value),placeholder:"Explain why this processing is necessary for the stated purpose...",rows:2,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("label",{htmlFor:"liaBalancing",className:"block text-sm font-medium mb-1",children:"Balancing Test"}),jsxRuntime.jsx("textarea",{id:"liaBalancing",value:a.liaBalancingTest,onChange:e=>s("liaBalancingTest",e.target.value),placeholder:"Assess the impact on data subjects' rights and interests...",rows:2,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("label",{htmlFor:"liaSafeguards",className:"block text-sm font-medium mb-1",children:"Safeguards"}),jsxRuntime.jsx("input",{type:"text",id:"liaSafeguards",value:a.liaSafeguards,onChange:e=>s("liaSafeguards",e.target.value),placeholder:"List safeguards (comma-separated)...",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("label",{htmlFor:"liaConclusion",className:"block text-sm font-medium mb-1",children:"Conclusion"}),jsxRuntime.jsx("textarea",{id:"liaConclusion",value:a.liaConclusion,onChange:e=>s("liaConclusion",e.target.value),placeholder:"State your overall conclusion...",rows:2,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("label",{htmlFor:"dataCategories",className:"block text-sm font-medium mb-1",children:"Data Categories *"}),jsxRuntime.jsx("input",{type:"text",id:"dataCategories",value:a.dataCategories,onChange:e=>s("dataCategories",e.target.value),placeholder:"e.g., Name, Email, Phone Number (comma-separated)","aria-required":"true","aria-describedby":g.length>0?"form-errors":void 0,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.jsx("div",{children:jsxRuntime.jsxs("label",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:a.involvesSensitiveData,onChange:e=>be(e.target.checked),className:"rounded border-gray-300 dark:border-gray-600 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Involves Sensitive Personal Data (NDPA Section 27)"})]})}),a.involvesSensitiveData&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"sensitiveCondition",className:"block text-sm font-medium mb-1",children:"Sensitive Data Condition (NDPA Section 27) *"}),jsxRuntime.jsxs("select",{id:"sensitiveCondition",value:a.sensitiveDataCondition,onChange:e=>s("sensitiveDataCondition",e.target.value),"aria-required":"true",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),children:[jsxRuntime.jsx("option",{value:"",children:"Select a condition..."}),X.map(e=>jsxRuntime.jsx("option",{value:e.value,children:e.label},e.value))]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dataSubjectCategories",className:"block text-sm font-medium mb-1",children:"Data Subject Categories *"}),jsxRuntime.jsx("input",{type:"text",id:"dataSubjectCategories",value:a.dataSubjectCategories,onChange:e=>s("dataSubjectCategories",e.target.value),placeholder:"e.g., Customers, Employees, Vendors (comma-separated)","aria-required":"true","aria-describedby":g.length>0?"form-errors":void 0,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("label",{htmlFor:"purposes",className:"block text-sm font-medium mb-1",children:"Processing Purposes *"}),jsxRuntime.jsx("input",{type:"text",id:"purposes",value:a.purposes,onChange:e=>s("purposes",e.target.value),placeholder:"e.g., Account management, Service delivery (comma-separated)","aria-required":"true","aria-describedby":g.length>0?"form-errors":void 0,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",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"retentionPeriod",className:"block text-sm font-medium mb-1",children:"Retention Period *"}),jsxRuntime.jsx("input",{type:"text",id:"retentionPeriod",value:a.retentionPeriod,onChange:e=>s("retentionPeriod",e.target.value),placeholder:"e.g., 3 years after account closure","aria-required":"true","aria-describedby":g.length>0?"form-errors":void 0,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("label",{htmlFor:"retentionJustification",className:"block text-sm font-medium mb-1",children:"Retention Justification"}),jsxRuntime.jsx("input",{type:"text",id:"retentionJustification",value:a.retentionJustification,onChange:e=>s("retentionJustification",e.target.value),placeholder:"Reason for the retention period",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("label",{htmlFor:"recipients",className:"block text-sm font-medium mb-1",children:"Recipients"}),jsxRuntime.jsx("input",{type:"text",id:"recipients",value:a.recipients,onChange:e=>s("recipients",e.target.value),placeholder:"e.g., Payment processor, Cloud provider (comma-separated)",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.jsx("div",{children:jsxRuntime.jsxs("label",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:a.crossBorderTransfer,onChange:e=>s("crossBorderTransfer",e.target.checked),className:"rounded border-gray-300 dark:border-gray-600 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Involves Cross-Border Transfer Outside Nigeria"})]})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"reviewDate",className:"block text-sm font-medium mb-1",children:"Next Review Date"}),jsxRuntime.jsx("input",{type:"date",id:"reviewDate",value:a.reviewDate,onChange:e=>s("reviewDate",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",{className:"flex justify-end space-x-3 pt-4",children:[jsxRuntime.jsx("button",{onClick:W,className:`px-4 py-2 text-gray-600 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded hover:bg-gray-200 dark:hover:bg-gray-600 ${m}`,children:"Cancel"}),jsxRuntime.jsx("button",{onClick:se,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${m}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:f?"Update Activity":"Create Activity"})]})]})]}),ve=()=>{var l;if(!n)return jsxRuntime.jsx("div",{className:"flex items-center justify-center h-64 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Activity not found."})});let e=chunkTDDAYVKK_js.a(n);return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("button",{onClick:ce,className:"text-sm text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline mb-2","aria-label":"Back to activities list",children:"Back to list"}),jsxRuntime.jsx("h3",{className:"text-lg font-medium",children:n.name})]}),jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[U(n.lawfulBasis),H(n.status),Y(n)]})]}),e.warnings.length>0&&jsxRuntime.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium mb-1",children:"Warnings"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside space-y-1",children:e.warnings.map((u,N)=>jsxRuntime.jsx("li",{className:"text-xs text-yellow-700 dark:text-yellow-300",children:u},N))})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Description:"})," ",n.description]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Lawful Basis:"})," ",chunkTDDAYVKK_js.b(n.lawfulBasis)]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Justification:"})," ",n.lawfulBasisJustification]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Categories:"})," ",n.dataCategories.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Subject Categories:"})," ",n.dataSubjectCategories.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Purposes:"})," ",n.purposes.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Retention Period:"})," ",n.retentionPeriod,n.retentionJustification&&jsxRuntime.jsxs("span",{className:"text-gray-600 dark:text-gray-400",children:[" ","(",n.retentionJustification,")"]})]})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Sensitive Data:"})," ",n.involvesSensitiveData?"Yes":"No",n.sensitiveDataCondition&&jsxRuntime.jsxs("span",{children:[" ","(Condition:"," ",((l=X.find(u=>u.value===n.sensitiveDataCondition))==null?void 0:l.label)||n.sensitiveDataCondition,")"]})]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Cross-Border Transfer:"})," ",n.crossBorderTransfer?"Yes":"No"]}),n.recipients&&n.recipients.length>0&&jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Recipients:"})," ",n.recipients.join(", ")]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Created:"})," ",C(n.createdAt)]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Last Updated:"})," ",C(n.updatedAt)]}),n.reviewDate&&jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Next Review:"})," ",C(n.reviewDate),n.reviewDate<Date.now()&&jsxRuntime.jsx("span",{className:"text-red-600 dark:text-red-400 font-medium",children:" (Overdue)"})]})]})]}),n.dpoApproval&&jsxRuntime.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md mb-6",children:[jsxRuntime.jsx("h4",{className:"text-sm font-semibold mb-2",children:"DPO Approval"}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",n.dpoApproval.approved?"Approved":"Not Approved"]}),jsxRuntime.jsxs("p",{className:"text-sm mt-1",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Approved By:"})," ",n.dpoApproval.approvedBy]}),jsxRuntime.jsxs("p",{className:"text-sm mt-1",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Date:"})," ",C(n.dpoApproval.approvedAt)]}),n.dpoApproval.notes&&jsxRuntime.jsxs("p",{className:"text-sm mt-1",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Notes:"})," ",n.dpoApproval.notes]})]}),jsxRuntime.jsxs("div",{className:"flex space-x-3",children:[jsxRuntime.jsx("button",{onClick:()=>M(n),"aria-label":`Edit ${n.name}`,className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${m}`,children:"Edit"}),n.status!=="archived"&&jsxRuntime.jsx("button",{onClick:()=>G(n.id),"aria-label":`Archive ${n.name}`,className:`px-4 py-2 bg-gray-600 text-white rounded hover:bg-gray-700 ${m}`,children:"Archive"})]})]})},fe=()=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-4 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"basisFilter",className:"block text-sm font-medium mb-1",children:"Lawful Basis"}),jsxRuntime.jsxs("select",{id:"basisFilter",value:B,onChange:e=>oe(e.target.value),"aria-label":"Filter by lawful basis",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),children:[jsxRuntime.jsx("option",{value:"all",children:"All Bases"}),Q.map(e=>jsxRuntime.jsx("option",{value:e.value,children:e.label},e.value))]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"statusFilterSelect",className:"block text-sm font-medium mb-1",children:"Status"}),jsxRuntime.jsxs("select",{id:"statusFilterSelect",value:A,onChange:e=>ne(e.target.value),"aria-label":"Filter by status",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),children:[jsxRuntime.jsx("option",{value:"all",children:"All Statuses"}),jsxRuntime.jsx("option",{value:"active",children:"Active"}),jsxRuntime.jsx("option",{value:"inactive",children:"Inactive"}),jsxRuntime.jsx("option",{value:"under_review",children:"Under Review"}),jsxRuntime.jsx("option",{value:"archived",children:"Archived"})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"searchInput",className:"block text-sm font-medium mb-1",children:"Search"}),jsxRuntime.jsx("input",{type:"text",id:"searchInput",value:S,onChange:e=>de(e.target.value),placeholder:"Search activities...",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.jsx("div",{className:"flex items-end",children:jsxRuntime.jsx("button",{onClick:le,className:chunkE64TU6IU_js.a(`w-full px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${m}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:"Add Activity"})})]}),V.length===0?jsxRuntime.jsx("div",{className:"flex items-center justify-center h-32 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No processing activities found."})}):jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:chunkE64TU6IU_js.a("w-full text-sm text-left",r==null?void 0:r.table,o),children:[jsxRuntime.jsx("thead",{className:chunkE64TU6IU_js.a("text-xs uppercase bg-gray-50 dark:bg-gray-700",r==null?void 0:r.tableHeader,o),children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Activity"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Lawful Basis"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Status"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"DPO Approval"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Sensitive Data"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Last Updated"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Actions"})]})}),jsxRuntime.jsx("tbody",{children:V.map(e=>jsxRuntime.jsxs("tr",{className:chunkE64TU6IU_js.a("border-b border-gray-200 dark:border-gray-600 hover:bg-gray-50 dark:hover:bg-gray-700",r==null?void 0:r.tableRow,o),children:[jsxRuntime.jsxs("td",{className:"px-4 py-3",children:[jsxRuntime.jsx("button",{onClick:()=>ue(e.id),className:"font-medium text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline text-left",children:e.name}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mt-1 truncate max-w-xs",children:e.description})]}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:U(e.lawfulBasis)}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:H(e.status)}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:Y(e)}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:jsxRuntime.jsx("span",{className:`text-xs ${e.involvesSensitiveData?"text-orange-600 dark:text-orange-400 font-medium":"text-gray-600 dark:text-gray-400"}`,children:e.involvesSensitiveData?"Yes":"No"})}),jsxRuntime.jsx("td",{className:"px-4 py-3 text-xs text-gray-600 dark:text-gray-400",children:C(e.updatedAt)}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[jsxRuntime.jsx("button",{onClick:()=>M(e),"aria-label":`Edit ${e.name}`,className:"text-xs text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline",children:"Edit"}),e.status!=="archived"&&jsxRuntime.jsx("button",{onClick:()=>G(e.id),"aria-label":`Archive ${e.name}`,className:"text-xs text-gray-600 dark:text-gray-400 hover:underline",children:"Archive"})]})})]},e.id))})]})})]});return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${te}`,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:Z}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:ee}),re&&h==="list"&&pe(),ie&&h==="list"&&ge(),h==="list"&&fe(),h==="form"&&me(),h==="detail"&&ve()]})};exports.a=Ce;//# sourceMappingURL=chunk-UO6QPJLH.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-UO6QPJLH.js.map
|