@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
package/dist/chunk-4JUDKBA2.mjs
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import {a as a$1,d,c,b}from'./chunk-QKK5S54L.mjs';import {a}from'./chunk-AYKLAEOU.mjs';import {b as b$1,a as a$2}from'./chunk-WWT2ZSNU.mjs';import {useState,useEffect}from'react';import {jsxs,jsx}from'react/jsx-runtime';var M=[{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))"}],H=[{value:"adequate",label:"Adequate"},{value:"inadequate",label:"Inadequate"},{value:"pending_review",label:"Pending Review"},{value:"unknown",label:"Unknown"}],Y=[{value:"one_time",label:"One-Time"},{value:"periodic",label:"Periodic"},{value:"continuous",label:"Continuous"}],Q=[{value:"active",label:"Active"},{value:"suspended",label:"Suspended"},{value:"terminated",label:"Terminated"},{value:"pending_approval",label:"Pending Approval"}],W={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:""},xe=({transfers:c$1,onAddTransfer:P,onUpdateTransfer:F,onRemoveTransfer:B,summary:G,title:K="Cross-Border Data Transfer Manager",description:J="Manage and document cross-border personal data transfers in compliance with NDPA 2023 Part VI (Sections 41-45).",className:X="",buttonClassName:T="",showSummary:Z=true,showTIA:ee=true,classNames:r,unstyled:o})=>{let[v,D]=useState(null),[I,x]=useState(false),[y,O]=useState(null),[i,R]=useState(W),[f,_]=useState(null),[C,te]=useState("all"),[A,re]=useState("all"),[k,ae]=useState(c$1);useEffect(()=>{let t=[...c$1];C!=="all"&&(t=t.filter(a=>a.status===C)),A!=="all"&&(t=t.filter(a=>a.transferMechanism===A)),t.sort((a,l)=>l.updatedAt-a.updatedAt),ae(t);},[c$1,C,A]),useEffect(()=>{k.length>0&&!v&&D(k[0].id);},[k,v]);let j=v?c$1.find(t=>t.id===v):null,h=t=>new Date(t).toLocaleDateString(),w=()=>{R(W),O(null),_(null);},ne=()=>{w(),x(true);},ie=t=>{var a,l,u,b;O(t.id),R({destinationCountry:t.destinationCountry,destinationCountryCode:t.destinationCountryCode||"",adequacyStatus:t.adequacyStatus,transferMechanism:t.transferMechanism,dataCategories:t.dataCategories.join(", "),includesSensitiveData:t.includesSensitiveData,estimatedDataSubjects:((a=t.estimatedDataSubjects)==null?void 0:a.toString())||"",recipientOrganization:t.recipientOrganization,recipientContactName:t.recipientContact.name,recipientContactEmail:t.recipientContact.email,recipientContactPhone:t.recipientContact.phone||"",recipientContactAddress:t.recipientContact.address||"",purpose:t.purpose,safeguards:t.safeguards.join(`
|
|
2
|
-
`),riskAssessment:t.riskAssessment,riskLevel:t.riskLevel,frequency:t.frequency,status:t.status,tiaCompleted:t.tiaCompleted,tiaReference:t.tiaReference||"",ndpcApprovalApplied:((l=t.ndpcApproval)==null?void 0:l.applied)||false,ndpcApprovalApproved:((u=t.ndpcApproval)==null?void 0:u.approved)||false,ndpcApprovalReference:((b=t.ndpcApproval)==null?void 0:b.referenceNumber)||""}),x(true);},p=(t,a)=>{R(l=>b$1(a$2({},l),{[t]:a}));},de=()=>{let t=a$1(i.transferMechanism),a=Date.now();return {destinationCountry:i.destinationCountry.trim(),destinationCountryCode:i.destinationCountryCode.trim()||void 0,adequacyStatus:i.adequacyStatus,transferMechanism:i.transferMechanism,dataCategories:i.dataCategories.split(",").map(l=>l.trim()).filter(Boolean),includesSensitiveData:i.includesSensitiveData,estimatedDataSubjects:i.estimatedDataSubjects?parseInt(i.estimatedDataSubjects,10):void 0,recipientOrganization:i.recipientOrganization.trim(),recipientContact:{name:i.recipientContactName.trim(),email:i.recipientContactEmail.trim(),phone:i.recipientContactPhone.trim()||void 0,address:i.recipientContactAddress.trim()||void 0},purpose:i.purpose.trim(),safeguards:i.safeguards.split(`
|
|
3
|
-
`).map(l=>l.trim()).filter(Boolean),riskAssessment:i.riskAssessment.trim(),riskLevel:i.riskLevel,frequency:i.frequency,status:t&&!i.ndpcApprovalApproved?"pending_approval":i.status,tiaCompleted:i.tiaCompleted,tiaReference:i.tiaReference.trim()||void 0,ndpcApproval:t?{required:true,applied:i.ndpcApprovalApplied,approved:i.ndpcApprovalApproved||void 0,referenceNumber:i.ndpcApprovalReference.trim()||void 0,appliedAt:i.ndpcApprovalApplied?a:void 0,approvedAt:i.ndpcApprovalApproved?a:void 0}:void 0,startDate:a,reviewDate:a+365*24*60*60*1e3}},oe=()=>{let t=de(),a=a$2({id:y||"temp",createdAt:Date.now(),updatedAt:Date.now()},t),l=c(a);_(l),l.isValid&&(y?F&&F(y,t):P&&P(t),w(),x(false));},le=t=>{B&&B(t),v===t&&D(null);},E=t=>jsxs("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[t]}`,r==null?void 0:r.riskBadge,o),children:[t.charAt(0).toUpperCase()+t.slice(1)," Risk"]}),L=t=>{let a$1={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(`px-2 py-1 rounded text-xs font-medium ${a$1[t]}`,r==null?void 0:r.statusBadge,o),children:l[t]})},pe=t=>{var u;let a=a$1(t),l=((u=M.find(b=>b.value===t))==null?void 0:u.label)||t;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})},se=()=>{let t=G||{totalActiveTransfers:c$1.filter(a=>a.status==="active").length,pendingApproval:c$1.filter(a=>{var l,u;return a.status==="pending_approval"||((l=a.ndpcApproval)==null?void 0:l.required)&&!((u=a.ndpcApproval)!=null&&u.approved)}),highRiskTransfers:c$1.filter(a=>a.riskLevel==="high"&&a.status==="active"),missingTIA:c$1.filter(a=>!a.tiaCompleted&&a.status==="active")};return jsxs("div",{className:a("mb-6 grid grid-cols-2 md:grid-cols-4 gap-4",r==null?void 0:r.summary,o),children:[jsxs("div",{className:a("bg-blue-50 dark:bg-blue-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-blue-800 dark:text-blue-200",children:t.totalActiveTransfers}),jsx("p",{className:"text-sm text-blue-600 dark:text-blue-300",children:"Active Transfers"})]}),jsxs("div",{className:a("bg-purple-50 dark:bg-purple-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-purple-800 dark:text-purple-200",children:t.pendingApproval.length}),jsx("p",{className:"text-sm text-purple-600 dark:text-purple-300",children:"Pending Approval"})]}),jsxs("div",{className:a("bg-red-50 dark:bg-red-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-red-800 dark:text-red-200",children:t.highRiskTransfers.length}),jsx("p",{className:"text-sm text-red-600 dark:text-red-300",children:"High Risk"})]}),jsxs("div",{className:a("bg-yellow-50 dark:bg-yellow-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-yellow-800 dark:text-yellow-200",children:t.missingTIA.length}),jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-300",children:"Missing TIA"})]})]})},ue=()=>{let t=a$1(i.transferMechanism);return jsxs("div",{className:a("bg-gray-50 dark:bg-gray-700 p-6 rounded-lg mb-6",r==null?void 0:r.form,o),children:[jsxs("div",{className:a("flex justify-between items-center mb-4",r==null?void 0:r.header,o),children:[jsx("h3",{className:"text-lg font-medium",children:y?"Edit Transfer":"Add New Transfer"}),jsx("button",{onClick:()=>{w(),x(false);},className:"text-gray-600 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:"Cancel"})]}),f&&!f.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:"Please fix the following errors:"}),jsx("ul",{className:"list-disc list-inside text-sm text-red-700 dark:text-red-300",children:f.errors.map((a,l)=>jsx("li",{children:a},l))})]}),f&&f.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:f.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",{className:"block text-sm font-medium mb-1",children:["Destination Country ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",value:i.destinationCountry,onChange:a=>p("destinationCountry",a.target.value),placeholder:"e.g. United Kingdom",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"Country Code (ISO)"}),jsx("input",{type:"text",value:i.destinationCountryCode,onChange:a=>p("destinationCountryCode",a.target.value),placeholder:"e.g. GB",maxLength:3,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsxs("label",{className:"block text-sm font-medium mb-1",children:["Recipient Organization ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",value:i.recipientOrganization,onChange:a=>p("recipientOrganization",a.target.value),placeholder:"Organization name",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsxs("label",{className:"block text-sm font-medium mb-1",children:["Transfer Mechanism ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("select",{value:i.transferMechanism,onChange:a=>p("transferMechanism",a.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:M.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:"Adequacy Status"}),jsx("select",{value:i.adequacyStatus,onChange:a=>p("adequacyStatus",a.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:H.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:i.riskLevel,onChange:a=>p("riskLevel",a.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),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",{className:"block text-sm font-medium mb-1",children:["Data Categories ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",value:i.dataCategories,onChange:a=>p("dataCategories",a.target.value),placeholder:"Comma-separated, e.g. Names, Email addresses, Phone numbers",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{type:"checkbox",id:"includesSensitiveData",checked:i.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:i.estimatedDataSubjects,onChange:a=>p("estimatedDataSubjects",a.target.value),placeholder:"Number of data subjects",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsxs("label",{className:"block text-sm font-medium mb-1",children:["Recipient Contact Name ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",value:i.recipientContactName,onChange:a=>p("recipientContactName",a.target.value),placeholder:"Contact person name",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsxs("label",{className:"block text-sm font-medium mb-1",children:["Recipient Contact Email ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"email",value:i.recipientContactEmail,onChange:a=>p("recipientContactEmail",a.target.value),placeholder:"contact@example.com",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"Recipient Contact Phone"}),jsx("input",{type:"text",value:i.recipientContactPhone,onChange:a=>p("recipientContactPhone",a.target.value),placeholder:"Phone number",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"Recipient Contact Address"}),jsx("input",{type:"text",value:i.recipientContactAddress,onChange:a=>p("recipientContactAddress",a.target.value),placeholder:"Address",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{className:"block text-sm font-medium mb-1",children:["Purpose of Transfer ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("textarea",{value:i.purpose,onChange:a=>p("purpose",a.target.value),placeholder:"Describe the purpose of this data transfer",rows:2,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{className:"block text-sm font-medium mb-1",children:["Safeguards ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("textarea",{value:i.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,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{className:"block text-sm font-medium mb-1",children:["Risk Assessment Summary ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("textarea",{value:i.riskAssessment,onChange:a=>p("riskAssessment",a.target.value),placeholder:"Summarize the risk assessment for this transfer",rows:2,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"Transfer Frequency"}),jsx("select",{value:i.frequency,onChange:a=>p("frequency",a.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:Y.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:i.status,onChange:a=>p("status",a.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:Q.map(a=>jsx("option",{value:a.value,children:a.label},a.value))})]})]}),t&&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:i.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:i.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:i.ndpcApprovalReference,onChange:a=>p("ndpcApprovalReference",a.target.value),placeholder:"Reference number (if available)",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]})]})]}),ee&&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:i.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:i.tiaReference,onChange:a=>p("tiaReference",a.target.value),placeholder:"Document reference",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]})]})]}),jsxs("div",{className:"mt-4 flex justify-end gap-3",children:[jsx("button",{onClick:()=>{w(),x(false);},className:"px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-md text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-600",children:"Cancel"}),jsx("button",{onClick:oe,className:a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${T}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:y?"Update Transfer":"Add Transfer"})]})]})},me=t=>{var u,b$1;let a$1=d(t),l=c(t);return jsxs("div",{className:a("",r==null?void 0:r.detailPanel,o),children:[jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxs("h3",{className:"text-lg font-medium",children:[t.destinationCountry," \u2014 ",t.recipientOrganization]}),jsxs("div",{className:"flex gap-2",children:[L(t.status),E(t.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:"})," ",t.destinationCountry,t.destinationCountryCode?` (${t.destinationCountryCode})`:""]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Adequacy:"})," ",(u=H.find(s=>s.value===t.adequacyStatus))==null?void 0:u.label]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Frequency:"})," ",(b$1=Y.find(s=>s.value===t.frequency))==null?void 0:b$1.label]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Start Date:"})," ",h(t.startDate)]}),t.endDate&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"End Date:"})," ",h(t.endDate)]}),t.reviewDate&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Next Review:"})," ",h(t.reviewDate)]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Recipient:"})," ",t.recipientOrganization]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Contact:"})," ",t.recipientContact.name," (",t.recipientContact.email,")"]}),t.estimatedDataSubjects&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Data Subjects:"})," ",t.estimatedDataSubjects.toLocaleString()]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Sensitive Data:"})," ",t.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:b(t.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:t.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:t.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:t.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:t.riskAssessment}),jsxs("div",{className:"mt-2",children:[jsxs("p",{className:"text-xs font-medium text-gray-600 dark:text-gray-400 mb-1",children:["Automated Assessment (Score: ",a$1.riskScore,")"]}),a$1.factors.length>0&&jsx("ul",{className:"list-disc list-inside text-xs text-gray-600 dark:text-gray-400",children:a$1.factors.map((s,m)=>jsx("li",{children:s},m))}),a$1.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$1.recommendations.map((s,m)=>jsx("li",{children:s},m))})]})]})]})]}),t.ndpcApproval&&jsxs("div",{className:"mb-4",children:[jsx("p",{className:"text-sm font-medium mb-1",children:"NDPC Approval"}),jsxs("div",{className:a(`p-3 rounded-md ${t.ndpcApproval.approved?"bg-green-50 dark:bg-green-900/20":t.ndpcApproval.applied?"bg-yellow-50 dark:bg-yellow-900/20":"bg-red-50 dark:bg-red-900/20"}`,r==null?void 0:r.approvalStatus,o),children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Status:"})," ",t.ndpcApproval.approved?"Approved":t.ndpcApproval.applied?"Application Submitted":"Not Applied"]}),t.ndpcApproval.referenceNumber&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Reference:"})," ",t.ndpcApproval.referenceNumber]}),t.ndpcApproval.appliedAt&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Applied:"})," ",h(t.ndpcApproval.appliedAt)]}),t.ndpcApproval.approvedAt&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Approved:"})," ",h(t.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 ${t.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:"})," ",t.tiaCompleted?"Completed":"Not Completed"]}),t.tiaReference&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Reference:"})," ",t.tiaReference]})]})]}),jsxs("div",{className:"flex gap-3 mt-6",children:[jsx("button",{onClick:()=>ie(t),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${T}`,children:"Edit"}),jsx("button",{onClick:()=>le(t.id),className:"px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700",children:"Remove"})]})]})};return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${X}`,r==null?void 0:r.root,o),children:[jsx("h2",{className:a("text-xl font-bold mb-2",r==null?void 0:r.title,o),children:K}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:J}),Z&&se(),!I&&jsx("div",{className:"mb-6",children:jsx("button",{onClick:ne,className:a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${T}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:"Add Transfer"})}),I&&ue(),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:C,onChange:t=>te(t.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:[jsx("option",{value:"all",children:"All Statuses"}),Q.map(t=>jsx("option",{value:t.value,children:t.label},t.value))]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cbMechanismFilter",className:"block text-sm font-medium mb-1",children:"Mechanism Filter"}),jsxs("select",{id:"cbMechanismFilter",value:A,onChange:t=>re(t.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:[jsx("option",{value:"all",children:"All Mechanisms"}),M.map(t=>jsx("option",{value:t.value,children:t.label},t.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"}),k.length===0?jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No cross-border transfers found."}):jsx("div",{className:a("space-y-2 max-h-96 overflow-y-auto pr-2",r==null?void 0:r.transferList,o),children:k.map(t=>{var a$1,l;return jsxs("div",{className:a(`p-3 rounded-md cursor-pointer ${v===t.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,o),onClick:()=>D(t.id),children:[jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsx("h4",{className:"font-medium text-sm",children:t.destinationCountry}),E(t.riskLevel)]}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:t.recipientOrganization}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:pe(t.transferMechanism)}),jsxs("div",{className:"flex justify-between items-center mt-2",children:[L(t.status),((a$1=t.ndpcApproval)==null?void 0:a$1.required)&&!((l=t.ndpcApproval)!=null&&l.approved)&&jsx("span",{className:"text-xs text-purple-600 dark:text-purple-400",children:"NDPC Pending"})]})]},t.id)})})]}),jsx("div",{className:"md:col-span-2",children:j?me(j):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{xe as a};//# sourceMappingURL=chunk-4JUDKBA2.mjs.map
|
|
7
|
-
//# sourceMappingURL=chunk-4JUDKBA2.mjs.map
|
package/dist/chunk-4XCL62MJ.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-AYKLAEOU.mjs';import {a,b}from'./chunk-WWT2ZSNU.mjs';import {useState,useRef,useEffect,useCallback}from'react';import {createPortal}from'react-dom';import {jsx,jsxs}from'react/jsx-runtime';var pt=({options:d,onSave:W,title:Y="We Value Your Privacy",description:m="We use cookies and similar technologies to provide our services and enhance your experience. Your consent is collected in accordance with NDPA Sections 25-26.",acceptAllButtonText:K="Accept All",rejectAllButtonText:Q="Reject All",customizeButtonText:U="Customize",saveButtonText:X="Save Preferences",position:A="bottom",zIndex:T=9999,version:f="1.0",show:p,manageStorage:R=true,storageKey:E="ndpr_consent",className:Z="",buttonClassName:h="",primaryButtonClassName:q="",secondaryButtonClassName:s="",classNames:t,unstyled:o,onAnalytics:y})=>{let[g,u]=useState(false),[v,a$2]=useState(false),[C,B]=useState({}),[H,N]=useState(false),z=useRef(null),$=useRef(null),j=useRef(false);useEffect(()=>{N(true);},[]);let l=useCallback((e,n)=>{y==null||y(a({action:e,timestamp:Date.now(),version:f},n!==void 0?{categories:n}:{}));},[y,f]);useEffect(()=>{let e={};if(d.forEach(n=>{e[n.id]=n.defaultValue||false;}),B(e),p===void 0)if(!R)u(true);else {let n=localStorage.getItem(E);if(n)try{JSON.parse(n).version!==f?u(!0):u(!1);}catch(L){u(true);}else u(true);}else u(p);},[d,E,f,R]),useEffect(()=>{p!==void 0&&u(p);},[p]);let tt=()=>{let e={};d.forEach(n=>{e[n.id]=true;}),l("accepted_all",e),P(e);},et=()=>{let e={};d.forEach(n=>{e[n.id]=n.required||false;}),l("rejected_all",e),P(e);},nt=(e,n)=>{B(L=>b(a({},L),{[e]:n}));},rt=()=>{let e={};d.forEach(n=>{e[n.id]=true;}),B(e);},ot=()=>{let e={};d.forEach(n=>{e[n.id]=n.required||false;}),B(e);},_=d.length>0&&d.every(e=>C[e.id]),it=()=>{l("customized",C),P(C);},P=e=>{let n={consents:e,timestamp:Date.now(),version:f,method:v?"customize":"banner",hasInteracted:true};R&&localStorage.setItem(E,JSON.stringify(n)),W(n),u(false),a$2(false);},M=useCallback(()=>{l("dismissed"),u(false),a$2(false);},[l]);if(useEffect(()=>{if(!g)return;let e=n=>{n.key==="Escape"&&M();};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[g,M]),useEffect(()=>{g&&!j.current&&(j.current=true,l("shown")),g||(j.current=false);},[g,l]),useEffect(()=>{g&&z.current&&z.current.focus();},[g]),useEffect(()=>{if(v&&$.current){let e=$.current;e.style.maxHeight="0px",e.style.opacity="0",e.offsetHeight,e.style.maxHeight=`${e.scrollHeight}px`,e.style.opacity="1";}},[v]),!g)return null;let dt=(t==null?void 0:t.primaryButton)||(t==null?void 0:t.acceptButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${h} ${q}`,F=(t==null?void 0:t.secondaryButton)||(t==null?void 0:t.rejectButton)||`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${h} ${s}`,ut=(t==null?void 0:t.customizeButton)||`px-4 py-2 bg-transparent text-gray-800 dark:text-white hover:underline ${h}`,gt=(t==null?void 0:t.saveButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${h} ${q}`,k=A==="inline",w=A==="center",x;k||w?x="":A==="top"?x="fixed inset-x-0 top-0":x="fixed inset-x-0 bottom-0";let D=jsx("div",{ref:z,tabIndex:-1,"data-ndpr-component":"consent-banner",className:a$1(`${k?"":x} bg-white dark:bg-gray-800 shadow-lg p-3 sm:p-4 border border-gray-200 dark:border-gray-700 ${w?"max-w-lg w-full":""} ${Z}`,t==null?void 0:t.root,o),style:!k&&!w?{zIndex:T}:void 0,role:"dialog","aria-labelledby":"consent-banner-title","aria-describedby":"consent-banner-description",children:jsxs("div",{className:a$1("max-w-6xl mx-auto",t==null?void 0:t.container,o),children:[jsx("h2",{id:"consent-banner-title",className:a$1("text-lg font-bold mb-2",t==null?void 0:t.title,o),children:Y}),jsx("p",{id:"consent-banner-description",className:a$1("text-sm sm:text-base mb-4",t==null?void 0:t.description,o),children:m}),v&&jsxs("div",{ref:$,className:a$1("mb-4 p-3 sm:p-4 rounded-md border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700/50",t==null?void 0:t.customizePanel,o),style:{overflow:"hidden",transition:"max-height 0.3s ease-out, opacity 0.3s ease-out"},children:[jsx("div",{className:"mb-3 flex items-center justify-end",children:jsx("button",{type:"button",onClick:_?ot:rt,className:a$1("text-sm font-medium text-[rgb(var(--ndpr-primary))] hover:underline",t==null?void 0:t.selectAllButton,o),children:_?"Deselect All":"Select All"})}),jsx("div",{className:a$1("space-y-3",t==null?void 0:t.optionsList,o),children:d.map(e=>jsxs("div",{className:a$1("flex items-start",t==null?void 0:t.optionItem,o),children:[jsx("div",{className:"flex items-center h-5",children:jsx("input",{id:`consent-${e.id}`,type:"checkbox",checked:C[e.id]||false,onChange:n=>nt(e.id,n.target.checked),disabled:e.required,className:a$1("h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]",t==null?void 0:t.optionCheckbox,o)})}),jsxs("div",{className:"ml-3 text-sm",children:[jsxs("label",{htmlFor:`consent-${e.id}`,className:a$1("font-medium",t==null?void 0:t.optionLabel,o),children:[e.label," ",e.required&&jsx("span",{className:"text-red-500",children:"*"})]}),jsx("p",{className:a$1("text-gray-600 dark:text-gray-400",t==null?void 0:t.optionDescription,o),children:e.description})]})]},e.id))}),jsxs("div",{className:a$1("mt-4 flex flex-col sm:flex-row flex-wrap gap-2",t==null?void 0:t.buttonGroup,o),children:[jsx("button",{onClick:it,className:a$1(gt,t==null?void 0:t.saveButton,o),children:X}),jsx("button",{onClick:()=>a$2(false),className:a$1(F,t==null?void 0:t.rejectButton,o),children:"Back"})]})]}),!v&&jsxs("div",{className:a$1("flex flex-col sm:flex-row flex-wrap gap-2",t==null?void 0:t.buttonGroup,o),children:[jsx("button",{onClick:tt,className:a$1(dt,t==null?void 0:t.acceptButton,o),children:K}),jsx("button",{onClick:et,className:a$1(F,t==null?void 0:t.rejectButton,o),children:Q}),jsx("button",{onClick:()=>a$2(true),className:a$1(ut,t==null?void 0:t.customizeButton,o),children:U})]}),jsx("div",{className:a$1("mt-2 text-xs text-gray-600 dark:text-gray-400",void 0,o),children:'By clicking "Accept All", you agree to the use of ALL cookies. Visit our Cookie Policy to learn more.'})]})});if(k)return D;if(w){let e=jsxs("div",{className:"fixed inset-0 flex items-center justify-center",style:{zIndex:T},children:[jsx("div",{className:"absolute inset-0 bg-black/50","aria-hidden":"true"}),jsx("div",{className:"relative",children:D})]});return H?createPortal(e,document.body):null}return H?createPortal(D,document.body):null};export{pt as a};//# sourceMappingURL=chunk-4XCL62MJ.mjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-4XCL62MJ.mjs.map
|
package/dist/chunk-555WWZ3W.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),reactDom=require('react-dom'),jsxRuntime=require('react/jsx-runtime');var pt=({options:d,onSave:W,title:Y="We Value Your Privacy",description:m="We use cookies and similar technologies to provide our services and enhance your experience. Your consent is collected in accordance with NDPA Sections 25-26.",acceptAllButtonText:K="Accept All",rejectAllButtonText:Q="Reject All",customizeButtonText:U="Customize",saveButtonText:X="Save Preferences",position:A="bottom",zIndex:T=9999,version:f="1.0",show:p,manageStorage:R=true,storageKey:E="ndpr_consent",className:Z="",buttonClassName:h="",primaryButtonClassName:q="",secondaryButtonClassName:s="",classNames:t,unstyled:o,onAnalytics:y})=>{let[g,u]=react.useState(false),[v,a]=react.useState(false),[C,B]=react.useState({}),[H,N]=react.useState(false),z=react.useRef(null),$=react.useRef(null),j=react.useRef(false);react.useEffect(()=>{N(true);},[]);let l=react.useCallback((e,n)=>{y==null||y(chunkMQFZHA2D_js.a({action:e,timestamp:Date.now(),version:f},n!==void 0?{categories:n}:{}));},[y,f]);react.useEffect(()=>{let e={};if(d.forEach(n=>{e[n.id]=n.defaultValue||false;}),B(e),p===void 0)if(!R)u(true);else {let n=localStorage.getItem(E);if(n)try{JSON.parse(n).version!==f?u(!0):u(!1);}catch(L){u(true);}else u(true);}else u(p);},[d,E,f,R]),react.useEffect(()=>{p!==void 0&&u(p);},[p]);let tt=()=>{let e={};d.forEach(n=>{e[n.id]=true;}),l("accepted_all",e),P(e);},et=()=>{let e={};d.forEach(n=>{e[n.id]=n.required||false;}),l("rejected_all",e),P(e);},nt=(e,n)=>{B(L=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},L),{[e]:n}));},rt=()=>{let e={};d.forEach(n=>{e[n.id]=true;}),B(e);},ot=()=>{let e={};d.forEach(n=>{e[n.id]=n.required||false;}),B(e);},_=d.length>0&&d.every(e=>C[e.id]),it=()=>{l("customized",C),P(C);},P=e=>{let n={consents:e,timestamp:Date.now(),version:f,method:v?"customize":"banner",hasInteracted:true};R&&localStorage.setItem(E,JSON.stringify(n)),W(n),u(false),a(false);},M=react.useCallback(()=>{l("dismissed"),u(false),a(false);},[l]);if(react.useEffect(()=>{if(!g)return;let e=n=>{n.key==="Escape"&&M();};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[g,M]),react.useEffect(()=>{g&&!j.current&&(j.current=true,l("shown")),g||(j.current=false);},[g,l]),react.useEffect(()=>{g&&z.current&&z.current.focus();},[g]),react.useEffect(()=>{if(v&&$.current){let e=$.current;e.style.maxHeight="0px",e.style.opacity="0",e.offsetHeight,e.style.maxHeight=`${e.scrollHeight}px`,e.style.opacity="1";}},[v]),!g)return null;let dt=(t==null?void 0:t.primaryButton)||(t==null?void 0:t.acceptButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${h} ${q}`,F=(t==null?void 0:t.secondaryButton)||(t==null?void 0:t.rejectButton)||`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${h} ${s}`,ut=(t==null?void 0:t.customizeButton)||`px-4 py-2 bg-transparent text-gray-800 dark:text-white hover:underline ${h}`,gt=(t==null?void 0:t.saveButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${h} ${q}`,k=A==="inline",w=A==="center",x;k||w?x="":A==="top"?x="fixed inset-x-0 top-0":x="fixed inset-x-0 bottom-0";let D=jsxRuntime.jsx("div",{ref:z,tabIndex:-1,"data-ndpr-component":"consent-banner",className:chunkE64TU6IU_js.a(`${k?"":x} bg-white dark:bg-gray-800 shadow-lg p-3 sm:p-4 border border-gray-200 dark:border-gray-700 ${w?"max-w-lg w-full":""} ${Z}`,t==null?void 0:t.root,o),style:!k&&!w?{zIndex:T}:void 0,role:"dialog","aria-labelledby":"consent-banner-title","aria-describedby":"consent-banner-description",children:jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("max-w-6xl mx-auto",t==null?void 0:t.container,o),children:[jsxRuntime.jsx("h2",{id:"consent-banner-title",className:chunkE64TU6IU_js.a("text-lg font-bold mb-2",t==null?void 0:t.title,o),children:Y}),jsxRuntime.jsx("p",{id:"consent-banner-description",className:chunkE64TU6IU_js.a("text-sm sm:text-base mb-4",t==null?void 0:t.description,o),children:m}),v&&jsxRuntime.jsxs("div",{ref:$,className:chunkE64TU6IU_js.a("mb-4 p-3 sm:p-4 rounded-md border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700/50",t==null?void 0:t.customizePanel,o),style:{overflow:"hidden",transition:"max-height 0.3s ease-out, opacity 0.3s ease-out"},children:[jsxRuntime.jsx("div",{className:"mb-3 flex items-center justify-end",children:jsxRuntime.jsx("button",{type:"button",onClick:_?ot:rt,className:chunkE64TU6IU_js.a("text-sm font-medium text-[rgb(var(--ndpr-primary))] hover:underline",t==null?void 0:t.selectAllButton,o),children:_?"Deselect All":"Select All"})}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-3",t==null?void 0:t.optionsList,o),children:d.map(e=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-start",t==null?void 0:t.optionItem,o),children:[jsxRuntime.jsx("div",{className:"flex items-center h-5",children:jsxRuntime.jsx("input",{id:`consent-${e.id}`,type:"checkbox",checked:C[e.id]||false,onChange:n=>nt(e.id,n.target.checked),disabled:e.required,className:chunkE64TU6IU_js.a("h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]",t==null?void 0:t.optionCheckbox,o)})}),jsxRuntime.jsxs("div",{className:"ml-3 text-sm",children:[jsxRuntime.jsxs("label",{htmlFor:`consent-${e.id}`,className:chunkE64TU6IU_js.a("font-medium",t==null?void 0:t.optionLabel,o),children:[e.label," ",e.required&&jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-gray-600 dark:text-gray-400",t==null?void 0:t.optionDescription,o),children:e.description})]})]},e.id))}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mt-4 flex flex-col sm:flex-row flex-wrap gap-2",t==null?void 0:t.buttonGroup,o),children:[jsxRuntime.jsx("button",{onClick:it,className:chunkE64TU6IU_js.a(gt,t==null?void 0:t.saveButton,o),children:X}),jsxRuntime.jsx("button",{onClick:()=>a(false),className:chunkE64TU6IU_js.a(F,t==null?void 0:t.rejectButton,o),children:"Back"})]})]}),!v&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex flex-col sm:flex-row flex-wrap gap-2",t==null?void 0:t.buttonGroup,o),children:[jsxRuntime.jsx("button",{onClick:tt,className:chunkE64TU6IU_js.a(dt,t==null?void 0:t.acceptButton,o),children:K}),jsxRuntime.jsx("button",{onClick:et,className:chunkE64TU6IU_js.a(F,t==null?void 0:t.rejectButton,o),children:Q}),jsxRuntime.jsx("button",{onClick:()=>a(true),className:chunkE64TU6IU_js.a(ut,t==null?void 0:t.customizeButton,o),children:U})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("mt-2 text-xs text-gray-600 dark:text-gray-400",void 0,o),children:'By clicking "Accept All", you agree to the use of ALL cookies. Visit our Cookie Policy to learn more.'})]})});if(k)return D;if(w){let e=jsxRuntime.jsxs("div",{className:"fixed inset-0 flex items-center justify-center",style:{zIndex:T},children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/50","aria-hidden":"true"}),jsxRuntime.jsx("div",{className:"relative",children:D})]});return H?reactDom.createPortal(e,document.body):null}return H?reactDom.createPortal(D,document.body):null};exports.a=pt;//# sourceMappingURL=chunk-555WWZ3W.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-555WWZ3W.js.map
|
package/dist/chunk-CL53OI3I.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkIQF726GS_js=require('./chunk-IQF726GS.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var M=[{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))"}],H=[{value:"adequate",label:"Adequate"},{value:"inadequate",label:"Inadequate"},{value:"pending_review",label:"Pending Review"},{value:"unknown",label:"Unknown"}],Y=[{value:"one_time",label:"One-Time"},{value:"periodic",label:"Periodic"},{value:"continuous",label:"Continuous"}],Q=[{value:"active",label:"Active"},{value:"suspended",label:"Suspended"},{value:"terminated",label:"Terminated"},{value:"pending_approval",label:"Pending Approval"}],W={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:""},xe=({transfers:c,onAddTransfer:P,onUpdateTransfer:F,onRemoveTransfer:B,summary:G,title:K="Cross-Border Data Transfer Manager",description:J="Manage and document cross-border personal data transfers in compliance with NDPA 2023 Part VI (Sections 41-45).",className:X="",buttonClassName:T="",showSummary:Z=true,showTIA:ee=true,classNames:r,unstyled:o})=>{let[v,D]=react.useState(null),[I,x]=react.useState(false),[y,O]=react.useState(null),[i,R]=react.useState(W),[f,_]=react.useState(null),[C,te]=react.useState("all"),[A,re]=react.useState("all"),[k,ae]=react.useState(c);react.useEffect(()=>{let t=[...c];C!=="all"&&(t=t.filter(a=>a.status===C)),A!=="all"&&(t=t.filter(a=>a.transferMechanism===A)),t.sort((a,l)=>l.updatedAt-a.updatedAt),ae(t);},[c,C,A]),react.useEffect(()=>{k.length>0&&!v&&D(k[0].id);},[k,v]);let j=v?c.find(t=>t.id===v):null,h=t=>new Date(t).toLocaleDateString(),w=()=>{R(W),O(null),_(null);},ne=()=>{w(),x(true);},ie=t=>{var a,l,u,b;O(t.id),R({destinationCountry:t.destinationCountry,destinationCountryCode:t.destinationCountryCode||"",adequacyStatus:t.adequacyStatus,transferMechanism:t.transferMechanism,dataCategories:t.dataCategories.join(", "),includesSensitiveData:t.includesSensitiveData,estimatedDataSubjects:((a=t.estimatedDataSubjects)==null?void 0:a.toString())||"",recipientOrganization:t.recipientOrganization,recipientContactName:t.recipientContact.name,recipientContactEmail:t.recipientContact.email,recipientContactPhone:t.recipientContact.phone||"",recipientContactAddress:t.recipientContact.address||"",purpose:t.purpose,safeguards:t.safeguards.join(`
|
|
2
|
-
`),riskAssessment:t.riskAssessment,riskLevel:t.riskLevel,frequency:t.frequency,status:t.status,tiaCompleted:t.tiaCompleted,tiaReference:t.tiaReference||"",ndpcApprovalApplied:((l=t.ndpcApproval)==null?void 0:l.applied)||false,ndpcApprovalApproved:((u=t.ndpcApproval)==null?void 0:u.approved)||false,ndpcApprovalReference:((b=t.ndpcApproval)==null?void 0:b.referenceNumber)||""}),x(true);},p=(t,a)=>{R(l=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},l),{[t]:a}));},de=()=>{let t=chunkIQF726GS_js.a(i.transferMechanism),a=Date.now();return {destinationCountry:i.destinationCountry.trim(),destinationCountryCode:i.destinationCountryCode.trim()||void 0,adequacyStatus:i.adequacyStatus,transferMechanism:i.transferMechanism,dataCategories:i.dataCategories.split(",").map(l=>l.trim()).filter(Boolean),includesSensitiveData:i.includesSensitiveData,estimatedDataSubjects:i.estimatedDataSubjects?parseInt(i.estimatedDataSubjects,10):void 0,recipientOrganization:i.recipientOrganization.trim(),recipientContact:{name:i.recipientContactName.trim(),email:i.recipientContactEmail.trim(),phone:i.recipientContactPhone.trim()||void 0,address:i.recipientContactAddress.trim()||void 0},purpose:i.purpose.trim(),safeguards:i.safeguards.split(`
|
|
3
|
-
`).map(l=>l.trim()).filter(Boolean),riskAssessment:i.riskAssessment.trim(),riskLevel:i.riskLevel,frequency:i.frequency,status:t&&!i.ndpcApprovalApproved?"pending_approval":i.status,tiaCompleted:i.tiaCompleted,tiaReference:i.tiaReference.trim()||void 0,ndpcApproval:t?{required:true,applied:i.ndpcApprovalApplied,approved:i.ndpcApprovalApproved||void 0,referenceNumber:i.ndpcApprovalReference.trim()||void 0,appliedAt:i.ndpcApprovalApplied?a:void 0,approvedAt:i.ndpcApprovalApproved?a:void 0}:void 0,startDate:a,reviewDate:a+365*24*60*60*1e3}},oe=()=>{let t=de(),a=chunkMQFZHA2D_js.a({id:y||"temp",createdAt:Date.now(),updatedAt:Date.now()},t),l=chunkIQF726GS_js.c(a);_(l),l.isValid&&(y?F&&F(y,t):P&&P(t),w(),x(false));},le=t=>{B&&B(t),v===t&&D(null);},E=t=>jsxRuntime.jsxs("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[t]}`,r==null?void 0:r.riskBadge,o),children:[t.charAt(0).toUpperCase()+t.slice(1)," Risk"]}),L=t=>{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 jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${a[t]}`,r==null?void 0:r.statusBadge,o),children:l[t]})},pe=t=>{var u;let a=chunkIQF726GS_js.a(t),l=((u=M.find(b=>b.value===t))==null?void 0:u.label)||t;return jsxRuntime.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})},se=()=>{let t=G||{totalActiveTransfers:c.filter(a=>a.status==="active").length,pendingApproval:c.filter(a=>{var l,u;return a.status==="pending_approval"||((l=a.ndpcApproval)==null?void 0:l.required)&&!((u=a.ndpcApproval)!=null&&u.approved)}),highRiskTransfers:c.filter(a=>a.riskLevel==="high"&&a.status==="active"),missingTIA:c.filter(a=>!a.tiaCompleted&&a.status==="active")};return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6 grid grid-cols-2 md:grid-cols-4 gap-4",r==null?void 0:r.summary,o),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:t.totalActiveTransfers}),jsxRuntime.jsx("p",{className:"text-sm text-blue-600 dark:text-blue-300",children:"Active Transfers"})]}),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:t.pendingApproval.length}),jsxRuntime.jsx("p",{className:"text-sm text-purple-600 dark:text-purple-300",children:"Pending Approval"})]}),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:t.highRiskTransfers.length}),jsxRuntime.jsx("p",{className:"text-sm text-red-600 dark:text-red-300",children:"High Risk"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-yellow-50 dark:bg-yellow-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-yellow-800 dark:text-yellow-200",children:t.missingTIA.length}),jsxRuntime.jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-300",children:"Missing TIA"})]})]})},ue=()=>{let t=chunkIQF726GS_js.a(i.transferMechanism);return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-gray-50 dark:bg-gray-700 p-6 rounded-lg mb-6",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:y?"Edit Transfer":"Add New Transfer"}),jsxRuntime.jsx("button",{onClick:()=>{w(),x(false);},className:"text-gray-600 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:"Cancel"})]}),f&&!f.isValid&&jsxRuntime.jsxs("div",{className:"mb-4 bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Please fix the following errors:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm text-red-700 dark:text-red-300",children:f.errors.map((a,l)=>jsxRuntime.jsx("li",{children:a},l))})]}),f&&f.warnings.length>0&&jsxRuntime.jsxs("div",{className:"mb-4 bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-yellow-800 dark:text-yellow-200 mb-1",children:"Warnings:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm text-yellow-700 dark:text-yellow-300",children:f.warnings.map((a,l)=>jsxRuntime.jsx("li",{children:a},l))})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Destination Country ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",value:i.destinationCountry,onChange:a=>p("destinationCountry",a.target.value),placeholder:"e.g. United Kingdom",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",{className:"block text-sm font-medium mb-1",children:"Country Code (ISO)"}),jsxRuntime.jsx("input",{type:"text",value:i.destinationCountryCode,onChange:a=>p("destinationCountryCode",a.target.value),placeholder:"e.g. GB",maxLength:3,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.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Recipient Organization ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",value:i.recipientOrganization,onChange:a=>p("recipientOrganization",a.target.value),placeholder:"Organization name",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.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Transfer Mechanism ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("select",{value:i.transferMechanism,onChange:a=>p("transferMechanism",a.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:M.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Adequacy Status"}),jsxRuntime.jsx("select",{value:i.adequacyStatus,onChange:a=>p("adequacyStatus",a.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:H.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Risk Level"}),jsxRuntime.jsxs("select",{value:i.riskLevel,onChange:a=>p("riskLevel",a.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:[jsxRuntime.jsx("option",{value:"low",children:"Low"}),jsxRuntime.jsx("option",{value:"medium",children:"Medium"}),jsxRuntime.jsx("option",{value:"high",children:"High"})]})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Data Categories ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",value:i.dataCategories,onChange:a=>p("dataCategories",a.target.value),placeholder:"Comma-separated, e.g. Names, Email addresses, Phone numbers",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 items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"includesSensitiveData",checked:i.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))]"}),jsxRuntime.jsx("label",{htmlFor:"includesSensitiveData",className:"text-sm font-medium",children:"Includes sensitive personal data"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Estimated Data Subjects"}),jsxRuntime.jsx("input",{type:"number",value:i.estimatedDataSubjects,onChange:a=>p("estimatedDataSubjects",a.target.value),placeholder:"Number of data subjects",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.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Recipient Contact Name ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",value:i.recipientContactName,onChange:a=>p("recipientContactName",a.target.value),placeholder:"Contact person name",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.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Recipient Contact Email ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"email",value:i.recipientContactEmail,onChange:a=>p("recipientContactEmail",a.target.value),placeholder:"contact@example.com",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",{className:"block text-sm font-medium mb-1",children:"Recipient Contact Phone"}),jsxRuntime.jsx("input",{type:"text",value:i.recipientContactPhone,onChange:a=>p("recipientContactPhone",a.target.value),placeholder:"Phone number",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",{className:"block text-sm font-medium mb-1",children:"Recipient Contact Address"}),jsxRuntime.jsx("input",{type:"text",value:i.recipientContactAddress,onChange:a=>p("recipientContactAddress",a.target.value),placeholder:"Address",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:"md:col-span-2",children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Purpose of Transfer ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("textarea",{value:i.purpose,onChange:a=>p("purpose",a.target.value),placeholder:"Describe the purpose of this data transfer",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",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Safeguards ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("textarea",{value:i.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,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:"md:col-span-2",children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Risk Assessment Summary ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("textarea",{value:i.riskAssessment,onChange:a=>p("riskAssessment",a.target.value),placeholder:"Summarize the risk assessment for this transfer",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",{className:"block text-sm font-medium mb-1",children:"Transfer Frequency"}),jsxRuntime.jsx("select",{value:i.frequency,onChange:a=>p("frequency",a.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:Y.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Status"}),jsxRuntime.jsx("select",{value:i.status,onChange:a=>p("status",a.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:Q.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]})]}),t&&jsxRuntime.jsxs("div",{className:"mt-4 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium text-blue-800 dark:text-blue-200 mb-3",children:"NDPC Approval Required"}),jsxRuntime.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."}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"ndpcApprovalApplied",checked:i.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))]"}),jsxRuntime.jsx("label",{htmlFor:"ndpcApprovalApplied",className:"text-sm",children:"Application submitted"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"ndpcApprovalApproved",checked:i.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))]"}),jsxRuntime.jsx("label",{htmlFor:"ndpcApprovalApproved",className:"text-sm",children:"Approval granted"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"NDPC Reference Number"}),jsxRuntime.jsx("input",{type:"text",value:i.ndpcApprovalReference,onChange:a=>p("ndpcApprovalReference",a.target.value),placeholder:"Reference number (if available)",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)})]})]})]}),ee&&jsxRuntime.jsxs("div",{className:"mt-4 p-4 bg-gray-100 dark:bg-gray-600 rounded-md",children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium mb-3",children:"Transfer Impact Assessment"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"tiaCompleted",checked:i.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))]"}),jsxRuntime.jsx("label",{htmlFor:"tiaCompleted",className:"text-sm",children:"TIA completed"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"TIA Reference"}),jsxRuntime.jsx("input",{type:"text",value:i.tiaReference,onChange:a=>p("tiaReference",a.target.value),placeholder:"Document reference",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:"mt-4 flex justify-end gap-3",children:[jsxRuntime.jsx("button",{onClick:()=>{w(),x(false);},className:"px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-md text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-600",children:"Cancel"}),jsxRuntime.jsx("button",{onClick:oe,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${T}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:y?"Update Transfer":"Add Transfer"})]})]})},me=t=>{var u,b;let a=chunkIQF726GS_js.d(t),l=chunkIQF726GS_js.c(t);return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",r==null?void 0:r.detailPanel,o),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxRuntime.jsxs("h3",{className:"text-lg font-medium",children:[t.destinationCountry," \u2014 ",t.recipientOrganization]}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[L(t.status),E(t.riskLevel)]})]}),!l.isValid&&jsxRuntime.jsxs("div",{className:"mb-4 bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Compliance Issues"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm text-red-700 dark:text-red-300",children:l.errors.map((s,m)=>jsxRuntime.jsx("li",{children:s},m))})]}),l.warnings.length>0&&jsxRuntime.jsxs("div",{className:"mb-4 bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-yellow-800 dark:text-yellow-200 mb-1",children:"Warnings"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm text-yellow-700 dark:text-yellow-300",children:l.warnings.map((s,m)=>jsxRuntime.jsx("li",{children:s},m))})]}),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:"Destination:"})," ",t.destinationCountry,t.destinationCountryCode?` (${t.destinationCountryCode})`:""]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Adequacy:"})," ",(u=H.find(s=>s.value===t.adequacyStatus))==null?void 0:u.label]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Frequency:"})," ",(b=Y.find(s=>s.value===t.frequency))==null?void 0:b.label]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Start Date:"})," ",h(t.startDate)]}),t.endDate&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"End Date:"})," ",h(t.endDate)]}),t.reviewDate&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Next Review:"})," ",h(t.reviewDate)]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Recipient:"})," ",t.recipientOrganization]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Contact:"})," ",t.recipientContact.name," (",t.recipientContact.email,")"]}),t.estimatedDataSubjects&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Subjects:"})," ",t.estimatedDataSubjects.toLocaleString()]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Sensitive Data:"})," ",t.includesSensitiveData?"Yes":"No"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"Transfer Mechanism"}),jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:jsxRuntime.jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200",children:chunkIQF726GS_js.b(t.transferMechanism)})})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"Purpose"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md",children:t.purpose})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"Data Categories"}),jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1",children:t.dataCategories.map((s,m)=>jsxRuntime.jsx("span",{className:"px-2 py-1 bg-gray-100 dark:bg-gray-600 rounded text-xs",children:s},m))})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"Safeguards"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm text-gray-600 dark:text-gray-300",children:t.safeguards.map((s,m)=>jsxRuntime.jsx("li",{children:s},m))})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"Risk Assessment"}),jsxRuntime.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200 mb-2",children:t.riskAssessment}),jsxRuntime.jsxs("div",{className:"mt-2",children:[jsxRuntime.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&&jsxRuntime.jsx("ul",{className:"list-disc list-inside text-xs text-gray-600 dark:text-gray-400",children:a.factors.map((s,m)=>jsxRuntime.jsx("li",{children:s},m))}),a.recommendations.length>0&&jsxRuntime.jsxs("div",{className:"mt-2",children:[jsxRuntime.jsx("p",{className:"text-xs font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Recommendations:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-xs text-gray-600 dark:text-gray-400",children:a.recommendations.map((s,m)=>jsxRuntime.jsx("li",{children:s},m))})]})]})]})]}),t.ndpcApproval&&jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"NDPC Approval"}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`p-3 rounded-md ${t.ndpcApproval.approved?"bg-green-50 dark:bg-green-900/20":t.ndpcApproval.applied?"bg-yellow-50 dark:bg-yellow-900/20":"bg-red-50 dark:bg-red-900/20"}`,r==null?void 0:r.approvalStatus,o),children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",t.ndpcApproval.approved?"Approved":t.ndpcApproval.applied?"Application Submitted":"Not Applied"]}),t.ndpcApproval.referenceNumber&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reference:"})," ",t.ndpcApproval.referenceNumber]}),t.ndpcApproval.appliedAt&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Applied:"})," ",h(t.ndpcApproval.appliedAt)]}),t.ndpcApproval.approvedAt&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Approved:"})," ",h(t.ndpcApproval.approvedAt)]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"Transfer Impact Assessment"}),jsxRuntime.jsxs("div",{className:`p-3 rounded-md ${t.tiaCompleted?"bg-green-50 dark:bg-green-900/20":"bg-yellow-50 dark:bg-yellow-900/20"}`,children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",t.tiaCompleted?"Completed":"Not Completed"]}),t.tiaReference&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reference:"})," ",t.tiaReference]})]})]}),jsxRuntime.jsxs("div",{className:"flex gap-3 mt-6",children:[jsxRuntime.jsx("button",{onClick:()=>ie(t),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${T}`,children:"Edit"}),jsxRuntime.jsx("button",{onClick:()=>le(t.id),className:"px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700",children:"Remove"})]})]})};return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${X}`,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:K}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:J}),Z&&se(),!I&&jsxRuntime.jsx("div",{className:"mb-6",children:jsxRuntime.jsx("button",{onClick:ne,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${T}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:"Add Transfer"})}),I&&ue(),jsxRuntime.jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cbStatusFilter",className:"block text-sm font-medium mb-1",children:"Status Filter"}),jsxRuntime.jsxs("select",{id:"cbStatusFilter",value:C,onChange:t=>te(t.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:[jsxRuntime.jsx("option",{value:"all",children:"All Statuses"}),Q.map(t=>jsxRuntime.jsx("option",{value:t.value,children:t.label},t.value))]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cbMechanismFilter",className:"block text-sm font-medium mb-1",children:"Mechanism Filter"}),jsxRuntime.jsxs("select",{id:"cbMechanismFilter",value:A,onChange:t=>re(t.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:[jsxRuntime.jsx("option",{value:"all",children:"All Mechanisms"}),M.map(t=>jsxRuntime.jsx("option",{value:t.value,children:t.label},t.value))]})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[jsxRuntime.jsxs("div",{className:"md:col-span-1",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Transfers"}),k.length===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No cross-border transfers found."}):jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-2 max-h-96 overflow-y-auto pr-2",r==null?void 0:r.transferList,o),children:k.map(t=>{var a,l;return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`p-3 rounded-md cursor-pointer ${v===t.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,o),onClick:()=>D(t.id),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:t.destinationCountry}),E(t.riskLevel)]}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:t.recipientOrganization}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:pe(t.transferMechanism)}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center mt-2",children:[L(t.status),((a=t.ndpcApproval)==null?void 0:a.required)&&!((l=t.ndpcApproval)!=null&&l.approved)&&jsxRuntime.jsx("span",{className:"text-xs text-purple-600 dark:text-purple-400",children:"NDPC Pending"})]})]},t.id)})})]}),jsxRuntime.jsx("div",{className:"md:col-span-2",children:j?me(j):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:"Select a transfer to view details"})})})]})]})};exports.a=xe;//# sourceMappingURL=chunk-CL53OI3I.js.map
|
|
7
|
-
//# sourceMappingURL=chunk-CL53OI3I.js.map
|
package/dist/chunk-ELKEZEV5.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {d,c,b as b$1,a as a$2}from'./chunk-TXBZPCGF.mjs';import {a}from'./chunk-AYKLAEOU.mjs';import {b,a as a$1}from'./chunk-WWT2ZSNU.mjs';import {useState,useEffect}from'react';import {jsxs,jsx}from'react/jsx-runtime';var F={name:"",description:"",lawfulBasis:"consent",lawfulBasisJustification:"",dataCategories:"",involvesSensitiveData:false,sensitiveDataCondition:"",dataSubjectCategories:"",purposes:"",retentionPeriod:"",retentionJustification:"",recipients:"",crossBorderTransfer:false,reviewDate:"",liaPurposeTest:"",liaNecessityTest:"",liaBalancingTest:"",liaSafeguards:"",liaConclusion:""},H=[{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"}],Y=[{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"}],fe=({activities:b$2,onAddActivity:_,onUpdateActivity:j,onArchiveActivity:I,title:W="Lawful Basis Tracker",description:q="Document and track the lawful basis for each processing activity as required by NDPA 2023 Section 25.",className:z="",buttonClassName:f="",showSummary:K=true,showComplianceGaps:Q=true,classNames:r,unstyled:o})=>{let[y,m]=useState("list"),[a$3,p]=useState(F),[h,S]=useState(null),[J,X]=useState(null),[k,Z]=useState("all"),[C,ee]=useState("all"),[A,te]=useState(""),[R,x]=useState([]),[N,re]=useState(b$2);useEffect(()=>{let t=[...b$2];if(k!=="all"&&(t=t.filter(l=>l.status===k)),C!=="all"&&(t=t.filter(l=>l.lawfulBasis===C)),A){let l=A.toLowerCase();t=t.filter(s=>s.name.toLowerCase().includes(l)||s.description.toLowerCase().includes(l)||s.purposes.some(v=>v.toLowerCase().includes(l)));}t.sort((l,s)=>s.updatedAt-l.updatedAt),re(t);},[b$2,k,C,A]);let w=t=>new Date(t).toLocaleDateString(),D=d(b$2),P=c(b$2),B=t=>t.split(",").map(l=>l.trim()).filter(l=>l.length>0),ie=()=>{p(F),S(null),x([]),m("form");},E=t=>{p({name:t.name,description:t.description,lawfulBasis:t.lawfulBasis,lawfulBasisJustification:t.lawfulBasisJustification,dataCategories:t.dataCategories.join(", "),involvesSensitiveData:t.involvesSensitiveData,sensitiveDataCondition:t.sensitiveDataCondition||"",dataSubjectCategories:t.dataSubjectCategories.join(", "),purposes:t.purposes.join(", "),retentionPeriod:t.retentionPeriod,retentionJustification:t.retentionJustification||"",recipients:(t.recipients||[]).join(", "),crossBorderTransfer:t.crossBorderTransfer,reviewDate:t.reviewDate?new Date(t.reviewDate).toISOString().split("T")[0]:"",liaPurposeTest:"",liaNecessityTest:"",liaBalancingTest:"",liaSafeguards:"",liaConclusion:""}),S(t.id),x([]),m("form");},ae=()=>{let t={name:a$3.name,description:a$3.description,lawfulBasis:a$3.lawfulBasis,lawfulBasisJustification:a$3.lawfulBasisJustification,dataCategories:B(a$3.dataCategories),involvesSensitiveData:a$3.involvesSensitiveData,sensitiveDataCondition:a$3.sensitiveDataCondition||void 0,dataSubjectCategories:B(a$3.dataSubjectCategories),purposes:B(a$3.purposes),retentionPeriod:a$3.retentionPeriod,retentionJustification:a$3.retentionJustification||void 0,recipients:a$3.recipients?B(a$3.recipients):void 0,crossBorderTransfer:a$3.crossBorderTransfer,reviewDate:a$3.reviewDate?new Date(a$3.reviewDate).getTime():void 0,status:"active"},l=b(a$1({},t),{id:h||"temp",createdAt:Date.now(),updatedAt:Date.now()}),s=a$2(l);if(!s.isValid){x(s.errors);return}h&&j?j(h,t):_&&_(t),p(F),S(null),x([]),m("list");},O=t=>{I&&I(t);},ne=t=>{X(t),m("detail");},d$1=J?b$2.find(t=>t.id===J):null,V=t=>{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"},s={active:"Active",inactive:"Inactive",under_review:"Under Review",archived:"Archived"};return jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${l[t]}`,r==null?void 0:r.statusBadge,o),children:s[t]})},$=t=>{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"},s={consent:"Consent",contract:"Contract",legal_obligation:"Legal Obligation",vital_interests:"Vital Interests",public_interest:"Public Interest",legitimate_interests:"Legitimate Interests"};return jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${l[t]}`,children:s[t]})},M=t=>t.dpoApproval?t.dpoApproval.approved?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"}):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"}):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"}),oe=()=>jsxs("div",{className:a("grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",r==null?void 0:r.summary,o),children:[jsxs("div",{className:a("bg-blue-50 dark:bg-blue-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-blue-800 dark:text-blue-200",children:D.totalActivities}),jsx("p",{className:"text-sm text-blue-600 dark:text-blue-300",children:"Total Activities"})]}),jsxs("div",{className:a("bg-orange-50 dark:bg-orange-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-orange-800 dark:text-orange-200",children:D.sensitiveDataActivities}),jsx("p",{className:"text-sm text-orange-600 dark:text-orange-300",children:"Sensitive Data"})]}),jsxs("div",{className:a("bg-purple-50 dark:bg-purple-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-purple-800 dark:text-purple-200",children:D.crossBorderActivities}),jsx("p",{className:"text-sm text-purple-600 dark:text-purple-300",children:"Cross-Border Transfers"})]}),jsxs("div",{className:a("bg-red-50 dark:bg-red-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-red-800 dark:text-red-200",children:D.activitiesWithoutApproval.length}),jsx("p",{className:"text-sm text-red-600 dark:text-red-300",children:"Pending Approval"})]})]}),de=()=>{if(P.length===0)return jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-4 rounded-lg mb-6",children:[jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"No compliance gaps detected."}),jsx("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:"All processing activities appear to be properly documented."})]});let t=P.filter(s=>s.severity==="high"),l=P.filter(s=>s.severity==="medium");return jsxs("div",{className:"mb-6",children:[t.length>0&&jsxs("div",{className:a("bg-red-50 dark:bg-red-900/20 p-4 rounded-lg mb-3",r==null?void 0:r.gapAlert,o),children:[jsxs("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium mb-2",children:["High Priority (",t.length,")"]}),jsx("ul",{className:"space-y-1",children:t.map((s,v)=>jsx("li",{className:"text-xs text-red-700 dark:text-red-300",children:s.description},v))})]}),l.length>0&&jsxs("div",{className:a("bg-yellow-50 dark:bg-yellow-900/20 p-4 rounded-lg",r==null?void 0:r.gapAlert,o),children:[jsxs("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium mb-2",children:["Medium Priority (",l.length,")"]}),jsx("ul",{className:"space-y-1",children:l.map((s,v)=>jsx("li",{className:"text-xs text-yellow-700 dark:text-yellow-300",children:s.description},v))})]})]})},le=()=>jsxs("div",{className:a("",r==null?void 0:r.form,o),children:[jsxs("div",{className:a("flex justify-between items-center mb-4",r==null?void 0:r.header,o),children:[jsx("h3",{className:"text-lg font-medium",children:h?"Edit Processing Activity":"New Processing Activity"}),jsx("button",{onClick:()=>{m("list"),x([]);},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 ${f}`,children:"Cancel"})]}),R.length>0&&jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-4 rounded-lg mb-4",children:[jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium mb-2",children:"Please correct the following errors:"}),jsx("ul",{className:"list-disc list-inside space-y-1",children:R.map((t,l)=>jsx("li",{className:"text-xs text-red-700 dark:text-red-300",children:t},l))})]}),jsxs("div",{className:"space-y-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"activityName",className:"block text-sm font-medium mb-1",children:"Activity Name *"}),jsx("input",{type:"text",id:"activityName",value:a$3.name,onChange:t=>p(b(a$1({},a$3),{name:t.target.value})),placeholder:"e.g., Customer Account Management",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"activityDescription",className:"block text-sm font-medium mb-1",children:"Description *"}),jsx("textarea",{id:"activityDescription",value:a$3.description,onChange:t=>p(b(a$1({},a$3),{description:t.target.value})),placeholder:"Describe what processing is performed...",rows:3,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"lawfulBasis",className:"block text-sm font-medium mb-1",children:"Lawful Basis (NDPA Section 25) *"}),jsx("select",{id:"lawfulBasis",value:a$3.lawfulBasis,onChange:t=>p(b(a$1({},a$3),{lawfulBasis:t.target.value})),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:H.map(t=>jsx("option",{value:t.value,children:t.label},t.value))}),jsx("p",{className:"mt-1 text-xs text-gray-600 dark:text-gray-400",children:b$1(a$3.lawfulBasis)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"justification",className:"block text-sm font-medium mb-1",children:"Lawful Basis Justification *"}),jsx("textarea",{id:"justification",value:a$3.lawfulBasisJustification,onChange:t=>p(b(a$1({},a$3),{lawfulBasisJustification:t.target.value})),placeholder:"Document why this lawful basis applies to this processing activity...",rows:3,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),a$3.lawfulBasis==="legitimate_interests"&&jsxs("div",{className:"border border-indigo-200 dark:border-indigo-800 rounded-lg p-4 bg-indigo-50 dark:bg-indigo-900/20",children:[jsx("h4",{className:"text-sm font-semibold text-indigo-800 dark:text-indigo-200 mb-3",children:"Legitimate Interest Assessment (LIA)"}),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."}),jsxs("div",{className:"space-y-3",children:[jsxs("div",{children:[jsx("label",{htmlFor:"liaPurpose",className:"block text-sm font-medium mb-1",children:"Purpose Test"}),jsx("textarea",{id:"liaPurpose",value:a$3.liaPurposeTest,onChange:t=>p(b(a$1({},a$3),{liaPurposeTest:t.target.value})),placeholder:"Describe the legitimate interest being pursued...",rows:2,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"liaNecessity",className:"block text-sm font-medium mb-1",children:"Necessity Test"}),jsx("textarea",{id:"liaNecessity",value:a$3.liaNecessityTest,onChange:t=>p(b(a$1({},a$3),{liaNecessityTest:t.target.value})),placeholder:"Explain why this processing is necessary for the stated purpose...",rows:2,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"liaBalancing",className:"block text-sm font-medium mb-1",children:"Balancing Test"}),jsx("textarea",{id:"liaBalancing",value:a$3.liaBalancingTest,onChange:t=>p(b(a$1({},a$3),{liaBalancingTest:t.target.value})),placeholder:"Assess the impact on data subjects' rights and interests...",rows:2,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"liaSafeguards",className:"block text-sm font-medium mb-1",children:"Safeguards"}),jsx("input",{type:"text",id:"liaSafeguards",value:a$3.liaSafeguards,onChange:t=>p(b(a$1({},a$3),{liaSafeguards:t.target.value})),placeholder:"List safeguards (comma-separated)...",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"liaConclusion",className:"block text-sm font-medium mb-1",children:"Conclusion"}),jsx("textarea",{id:"liaConclusion",value:a$3.liaConclusion,onChange:t=>p(b(a$1({},a$3),{liaConclusion:t.target.value})),placeholder:"State your overall conclusion...",rows:2,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dataCategories",className:"block text-sm font-medium mb-1",children:"Data Categories *"}),jsx("input",{type:"text",id:"dataCategories",value:a$3.dataCategories,onChange:t=>p(b(a$1({},a$3),{dataCategories:t.target.value})),placeholder:"e.g., Name, Email, Phone Number (comma-separated)",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsx("div",{children:jsxs("label",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",checked:a$3.involvesSensitiveData,onChange:t=>p(b(a$1({},a$3),{involvesSensitiveData:t.target.checked,sensitiveDataCondition:t.target.checked?a$3.sensitiveDataCondition:""})),className:"rounded border-gray-300 dark:border-gray-600 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("span",{className:"text-sm font-medium",children:"Involves Sensitive Personal Data (NDPA Section 27)"})]})}),a$3.involvesSensitiveData&&jsxs("div",{children:[jsx("label",{htmlFor:"sensitiveCondition",className:"block text-sm font-medium mb-1",children:"Sensitive Data Condition (NDPA Section 27) *"}),jsxs("select",{id:"sensitiveCondition",value:a$3.sensitiveDataCondition,onChange:t=>p(b(a$1({},a$3),{sensitiveDataCondition:t.target.value})),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:[jsx("option",{value:"",children:"Select a condition..."}),Y.map(t=>jsx("option",{value:t.value,children:t.label},t.value))]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dataSubjectCategories",className:"block text-sm font-medium mb-1",children:"Data Subject Categories *"}),jsx("input",{type:"text",id:"dataSubjectCategories",value:a$3.dataSubjectCategories,onChange:t=>p(b(a$1({},a$3),{dataSubjectCategories:t.target.value})),placeholder:"e.g., Customers, Employees, Vendors (comma-separated)",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"purposes",className:"block text-sm font-medium mb-1",children:"Processing Purposes *"}),jsx("input",{type:"text",id:"purposes",value:a$3.purposes,onChange:t=>p(b(a$1({},a$3),{purposes:t.target.value})),placeholder:"e.g., Account management, Service delivery (comma-separated)",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"retentionPeriod",className:"block text-sm font-medium mb-1",children:"Retention Period *"}),jsx("input",{type:"text",id:"retentionPeriod",value:a$3.retentionPeriod,onChange:t=>p(b(a$1({},a$3),{retentionPeriod:t.target.value})),placeholder:"e.g., 3 years after account closure",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"retentionJustification",className:"block text-sm font-medium mb-1",children:"Retention Justification"}),jsx("input",{type:"text",id:"retentionJustification",value:a$3.retentionJustification,onChange:t=>p(b(a$1({},a$3),{retentionJustification:t.target.value})),placeholder:"Reason for the retention period",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"recipients",className:"block text-sm font-medium mb-1",children:"Recipients"}),jsx("input",{type:"text",id:"recipients",value:a$3.recipients,onChange:t=>p(b(a$1({},a$3),{recipients:t.target.value})),placeholder:"e.g., Payment processor, Cloud provider (comma-separated)",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsx("div",{children:jsxs("label",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",checked:a$3.crossBorderTransfer,onChange:t=>p(b(a$1({},a$3),{crossBorderTransfer:t.target.checked})),className:"rounded border-gray-300 dark:border-gray-600 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("span",{className:"text-sm font-medium",children:"Involves Cross-Border Transfer Outside Nigeria"})]})}),jsxs("div",{children:[jsx("label",{htmlFor:"reviewDate",className:"block text-sm font-medium mb-1",children:"Next Review Date"}),jsx("input",{type:"date",id:"reviewDate",value:a$3.reviewDate,onChange:t=>p(b(a$1({},a$3),{reviewDate:t.target.value})),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{className:"flex justify-end space-x-3 pt-4",children:[jsx("button",{onClick:()=>{m("list"),x([]);},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 ${f}`,children:"Cancel"}),jsx("button",{onClick:ae,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.submitButton),o),children:h?"Update Activity":"Create Activity"})]})]})]}),se=()=>{var l;if(!d$1)return 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:"Activity not found."})});let t=a$2(d$1);return jsxs("div",{children:[jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxs("div",{children:[jsx("button",{onClick:()=>m("list"),className:"text-sm text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline mb-2",children:"Back to list"}),jsx("h3",{className:"text-lg font-medium",children:d$1.name})]}),jsxs("div",{className:"flex space-x-2",children:[$(d$1.lawfulBasis),V(d$1.status),M(d$1)]})]}),t.warnings.length>0&&jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md mb-4",children:[jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium mb-1",children:"Warnings"}),jsx("ul",{className:"list-disc list-inside space-y-1",children:t.warnings.map((s,v)=>jsx("li",{className:"text-xs text-yellow-700 dark:text-yellow-300",children:s},v))})]}),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:"Description:"})," ",d$1.description]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Lawful Basis:"})," ",b$1(d$1.lawfulBasis)]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Justification:"})," ",d$1.lawfulBasisJustification]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Data Categories:"})," ",d$1.dataCategories.join(", ")]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Data Subject Categories:"})," ",d$1.dataSubjectCategories.join(", ")]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Purposes:"})," ",d$1.purposes.join(", ")]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Retention Period:"})," ",d$1.retentionPeriod,d$1.retentionJustification&&jsxs("span",{className:"text-gray-600 dark:text-gray-400",children:[" ","(",d$1.retentionJustification,")"]})]})]})]}),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:"Sensitive Data:"})," ",d$1.involvesSensitiveData?"Yes":"No",d$1.sensitiveDataCondition&&jsxs("span",{children:[" ","(Condition:"," ",((l=Y.find(s=>s.value===d$1.sensitiveDataCondition))==null?void 0:l.label)||d$1.sensitiveDataCondition,")"]})]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Cross-Border Transfer:"})," ",d$1.crossBorderTransfer?"Yes":"No"]}),d$1.recipients&&d$1.recipients.length>0&&jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Recipients:"})," ",d$1.recipients.join(", ")]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Created:"})," ",w(d$1.createdAt)]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Last Updated:"})," ",w(d$1.updatedAt)]}),d$1.reviewDate&&jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Next Review:"})," ",w(d$1.reviewDate),d$1.reviewDate<Date.now()&&jsx("span",{className:"text-red-600 dark:text-red-400 font-medium",children:" (Overdue)"})]})]})]}),d$1.dpoApproval&&jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md mb-6",children:[jsx("h4",{className:"text-sm font-semibold mb-2",children:"DPO Approval"}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Status:"})," ",d$1.dpoApproval.approved?"Approved":"Not Approved"]}),jsxs("p",{className:"text-sm mt-1",children:[jsx("span",{className:"font-medium",children:"Approved By:"})," ",d$1.dpoApproval.approvedBy]}),jsxs("p",{className:"text-sm mt-1",children:[jsx("span",{className:"font-medium",children:"Date:"})," ",w(d$1.dpoApproval.approvedAt)]}),d$1.dpoApproval.notes&&jsxs("p",{className:"text-sm mt-1",children:[jsx("span",{className:"font-medium",children:"Notes:"})," ",d$1.dpoApproval.notes]})]}),jsxs("div",{className:"flex space-x-3",children:[jsx("button",{onClick:()=>E(d$1),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${f}`,children:"Edit"}),d$1.status!=="archived"&&jsx("button",{onClick:()=>O(d$1.id),className:`px-4 py-2 bg-gray-600 text-white rounded hover:bg-gray-700 ${f}`,children:"Archive"})]})]})},pe=()=>jsxs("div",{children:[jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-4 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"basisFilter",className:"block text-sm font-medium mb-1",children:"Lawful Basis"}),jsxs("select",{id:"basisFilter",value:C,onChange:t=>ee(t.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:[jsx("option",{value:"all",children:"All Bases"}),H.map(t=>jsx("option",{value:t.value,children:t.label},t.value))]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"statusFilterSelect",className:"block text-sm font-medium mb-1",children:"Status"}),jsxs("select",{id:"statusFilterSelect",value:k,onChange:t=>Z(t.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:[jsx("option",{value:"all",children:"All Statuses"}),jsx("option",{value:"active",children:"Active"}),jsx("option",{value:"inactive",children:"Inactive"}),jsx("option",{value:"under_review",children:"Under Review"}),jsx("option",{value:"archived",children:"Archived"})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"searchInput",className:"block text-sm font-medium mb-1",children:"Search"}),jsx("input",{type:"text",id:"searchInput",value:A,onChange:t=>te(t.target.value),placeholder:"Search activities...",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsx("div",{className:"flex items-end",children:jsx("button",{onClick:ie,className:a(`w-full 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.submitButton),o),children:"Add Activity"})})]}),N.length===0?jsx("div",{className:"flex items-center justify-center h-32 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No processing activities found."})}):jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:a("w-full text-sm text-left",r==null?void 0:r.table,o),children:[jsx("thead",{className:a("text-xs uppercase bg-gray-50 dark:bg-gray-700",r==null?void 0:r.tableHeader,o),children:jsxs("tr",{children:[jsx("th",{className:"px-4 py-3",children:"Activity"}),jsx("th",{className:"px-4 py-3",children:"Lawful Basis"}),jsx("th",{className:"px-4 py-3",children:"Status"}),jsx("th",{className:"px-4 py-3",children:"DPO Approval"}),jsx("th",{className:"px-4 py-3",children:"Sensitive Data"}),jsx("th",{className:"px-4 py-3",children:"Last Updated"}),jsx("th",{className:"px-4 py-3",children:"Actions"})]})}),jsx("tbody",{children:N.map(t=>jsxs("tr",{className: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:[jsxs("td",{className:"px-4 py-3",children:[jsx("button",{onClick:()=>ne(t.id),className:"font-medium text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline text-left",children:t.name}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mt-1 truncate max-w-xs",children:t.description})]}),jsx("td",{className:"px-4 py-3",children:$(t.lawfulBasis)}),jsx("td",{className:"px-4 py-3",children:V(t.status)}),jsx("td",{className:"px-4 py-3",children:M(t)}),jsx("td",{className:"px-4 py-3",children:jsx("span",{className:`text-xs ${t.involvesSensitiveData?"text-orange-600 dark:text-orange-400 font-medium":"text-gray-600 dark:text-gray-400"}`,children:t.involvesSensitiveData?"Yes":"No"})}),jsx("td",{className:"px-4 py-3 text-xs text-gray-600 dark:text-gray-400",children:w(t.updatedAt)}),jsx("td",{className:"px-4 py-3",children:jsxs("div",{className:"flex space-x-2",children:[jsx("button",{onClick:()=>E(t),className:"text-xs text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline",children:"Edit"}),t.status!=="archived"&&jsx("button",{onClick:()=>O(t.id),className:"text-xs text-gray-600 dark:text-gray-400 hover:underline",children:"Archive"})]})})]},t.id))})]})})]});return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${z}`,r==null?void 0:r.root,o),children:[jsx("h2",{className:a("text-xl font-bold mb-2",r==null?void 0:r.title,o),children:W}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:q}),K&&y==="list"&&oe(),Q&&y==="list"&&de(),y==="list"&&pe(),y==="form"&&le(),y==="detail"&&se()]})};export{fe as a};//# sourceMappingURL=chunk-ELKEZEV5.mjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-ELKEZEV5.mjs.map
|
package/dist/chunk-ER7X6E36.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
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 F={name:"",description:"",lawfulBasis:"consent",lawfulBasisJustification:"",dataCategories:"",involvesSensitiveData:false,sensitiveDataCondition:"",dataSubjectCategories:"",purposes:"",retentionPeriod:"",retentionJustification:"",recipients:"",crossBorderTransfer:false,reviewDate:"",liaPurposeTest:"",liaNecessityTest:"",liaBalancingTest:"",liaSafeguards:"",liaConclusion:""},H=[{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"}],Y=[{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"}],fe=({activities:b,onAddActivity:_,onUpdateActivity:j,onArchiveActivity:I,title:W="Lawful Basis Tracker",description:q="Document and track the lawful basis for each processing activity as required by NDPA 2023 Section 25.",className:z="",buttonClassName:f="",showSummary:K=true,showComplianceGaps:Q=true,classNames:r,unstyled:o})=>{let[y,m]=react.useState("list"),[a,p]=react.useState(F),[h,S]=react.useState(null),[J,X]=react.useState(null),[k,Z]=react.useState("all"),[C,ee]=react.useState("all"),[A,te]=react.useState(""),[R,x]=react.useState([]),[N,re]=react.useState(b);react.useEffect(()=>{let t=[...b];if(k!=="all"&&(t=t.filter(l=>l.status===k)),C!=="all"&&(t=t.filter(l=>l.lawfulBasis===C)),A){let l=A.toLowerCase();t=t.filter(s=>s.name.toLowerCase().includes(l)||s.description.toLowerCase().includes(l)||s.purposes.some(v=>v.toLowerCase().includes(l)));}t.sort((l,s)=>s.updatedAt-l.updatedAt),re(t);},[b,k,C,A]);let w=t=>new Date(t).toLocaleDateString(),D=chunkTDDAYVKK_js.d(b),P=chunkTDDAYVKK_js.c(b),B=t=>t.split(",").map(l=>l.trim()).filter(l=>l.length>0),ie=()=>{p(F),S(null),x([]),m("form");},E=t=>{p({name:t.name,description:t.description,lawfulBasis:t.lawfulBasis,lawfulBasisJustification:t.lawfulBasisJustification,dataCategories:t.dataCategories.join(", "),involvesSensitiveData:t.involvesSensitiveData,sensitiveDataCondition:t.sensitiveDataCondition||"",dataSubjectCategories:t.dataSubjectCategories.join(", "),purposes:t.purposes.join(", "),retentionPeriod:t.retentionPeriod,retentionJustification:t.retentionJustification||"",recipients:(t.recipients||[]).join(", "),crossBorderTransfer:t.crossBorderTransfer,reviewDate:t.reviewDate?new Date(t.reviewDate).toISOString().split("T")[0]:"",liaPurposeTest:"",liaNecessityTest:"",liaBalancingTest:"",liaSafeguards:"",liaConclusion:""}),S(t.id),x([]),m("form");},ae=()=>{let t={name:a.name,description:a.description,lawfulBasis:a.lawfulBasis,lawfulBasisJustification:a.lawfulBasisJustification,dataCategories:B(a.dataCategories),involvesSensitiveData:a.involvesSensitiveData,sensitiveDataCondition:a.sensitiveDataCondition||void 0,dataSubjectCategories:B(a.dataSubjectCategories),purposes:B(a.purposes),retentionPeriod:a.retentionPeriod,retentionJustification:a.retentionJustification||void 0,recipients:a.recipients?B(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({},t),{id:h||"temp",createdAt:Date.now(),updatedAt:Date.now()}),s=chunkTDDAYVKK_js.a(l);if(!s.isValid){x(s.errors);return}h&&j?j(h,t):_&&_(t),p(F),S(null),x([]),m("list");},O=t=>{I&&I(t);},ne=t=>{X(t),m("detail");},d=J?b.find(t=>t.id===J):null,V=t=>{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"},s={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[t]}`,r==null?void 0:r.statusBadge,o),children:s[t]})},$=t=>{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"},s={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[t]}`,children:s[t]})},M=t=>t.dpoApproval?t.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"}),oe=()=>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),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:D.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:D.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:D.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:D.activitiesWithoutApproval.length}),jsxRuntime.jsx("p",{className:"text-sm text-red-600 dark:text-red-300",children:"Pending Approval"})]})]}),de=()=>{if(P.length===0)return jsxRuntime.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-4 rounded-lg mb-6",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."})]});let t=P.filter(s=>s.severity==="high"),l=P.filter(s=>s.severity==="medium");return jsxRuntime.jsxs("div",{className:"mb-6",children:[t.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 (",t.length,")"]}),jsxRuntime.jsx("ul",{className:"space-y-1",children:t.map((s,v)=>jsxRuntime.jsx("li",{className:"text-xs text-red-700 dark:text-red-300",children:s.description},v))})]}),l.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 (",l.length,")"]}),jsxRuntime.jsx("ul",{className:"space-y-1",children:l.map((s,v)=>jsxRuntime.jsx("li",{className:"text-xs text-yellow-700 dark:text-yellow-300",children:s.description},v))})]})]})},le=()=>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:h?"Edit Processing Activity":"New Processing Activity"}),jsxRuntime.jsx("button",{onClick:()=>{m("list"),x([]);},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 ${f}`,children:"Cancel"})]}),R.length>0&&jsxRuntime.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-4 rounded-lg mb-4",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:R.map((t,l)=>jsxRuntime.jsx("li",{className:"text-xs text-red-700 dark:text-red-300",children:t},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:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{name:t.target.value})),placeholder:"e.g., Customer Account Management",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:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{description:t.target.value})),placeholder:"Describe what processing is performed...",rows:3,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:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{lawfulBasis:t.target.value})),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:H.map(t=>jsxRuntime.jsx("option",{value:t.value,children:t.label},t.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:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{lawfulBasisJustification:t.target.value})),placeholder:"Document why this lawful basis applies to this processing activity...",rows:3,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:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{liaPurposeTest:t.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:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{liaNecessityTest:t.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:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{liaBalancingTest:t.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:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{liaSafeguards:t.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:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{liaConclusion:t.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:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{dataCategories:t.target.value})),placeholder:"e.g., Name, Email, Phone Number (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.involvesSensitiveData,onChange:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{involvesSensitiveData:t.target.checked,sensitiveDataCondition:t.target.checked?a.sensitiveDataCondition:""})),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:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{sensitiveDataCondition:t.target.value})),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:[jsxRuntime.jsx("option",{value:"",children:"Select a condition..."}),Y.map(t=>jsxRuntime.jsx("option",{value:t.value,children:t.label},t.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:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{dataSubjectCategories:t.target.value})),placeholder:"e.g., Customers, Employees, Vendors (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:"purposes",className:"block text-sm font-medium mb-1",children:"Processing Purposes *"}),jsxRuntime.jsx("input",{type:"text",id:"purposes",value:a.purposes,onChange:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{purposes:t.target.value})),placeholder:"e.g., Account management, Service delivery (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",{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:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{retentionPeriod:t.target.value})),placeholder:"e.g., 3 years after account closure",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:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{retentionJustification:t.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:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{recipients:t.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:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{crossBorderTransfer:t.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:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{reviewDate:t.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:()=>{m("list"),x([]);},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 ${f}`,children:"Cancel"}),jsxRuntime.jsx("button",{onClick:ae,className:chunkE64TU6IU_js.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.submitButton),o),children:h?"Update Activity":"Create Activity"})]})]})]}),se=()=>{var l;if(!d)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 t=chunkTDDAYVKK_js.a(d);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:()=>m("list"),className:"text-sm text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline mb-2",children:"Back to list"}),jsxRuntime.jsx("h3",{className:"text-lg font-medium",children:d.name})]}),jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[$(d.lawfulBasis),V(d.status),M(d)]})]}),t.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:t.warnings.map((s,v)=>jsxRuntime.jsx("li",{className:"text-xs text-yellow-700 dark:text-yellow-300",children:s},v))})]}),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:"})," ",d.description]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Lawful Basis:"})," ",chunkTDDAYVKK_js.b(d.lawfulBasis)]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Justification:"})," ",d.lawfulBasisJustification]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Categories:"})," ",d.dataCategories.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Subject Categories:"})," ",d.dataSubjectCategories.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Purposes:"})," ",d.purposes.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Retention Period:"})," ",d.retentionPeriod,d.retentionJustification&&jsxRuntime.jsxs("span",{className:"text-gray-600 dark:text-gray-400",children:[" ","(",d.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:"})," ",d.involvesSensitiveData?"Yes":"No",d.sensitiveDataCondition&&jsxRuntime.jsxs("span",{children:[" ","(Condition:"," ",((l=Y.find(s=>s.value===d.sensitiveDataCondition))==null?void 0:l.label)||d.sensitiveDataCondition,")"]})]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Cross-Border Transfer:"})," ",d.crossBorderTransfer?"Yes":"No"]}),d.recipients&&d.recipients.length>0&&jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Recipients:"})," ",d.recipients.join(", ")]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Created:"})," ",w(d.createdAt)]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Last Updated:"})," ",w(d.updatedAt)]}),d.reviewDate&&jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Next Review:"})," ",w(d.reviewDate),d.reviewDate<Date.now()&&jsxRuntime.jsx("span",{className:"text-red-600 dark:text-red-400 font-medium",children:" (Overdue)"})]})]})]}),d.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:"})," ",d.dpoApproval.approved?"Approved":"Not Approved"]}),jsxRuntime.jsxs("p",{className:"text-sm mt-1",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Approved By:"})," ",d.dpoApproval.approvedBy]}),jsxRuntime.jsxs("p",{className:"text-sm mt-1",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Date:"})," ",w(d.dpoApproval.approvedAt)]}),d.dpoApproval.notes&&jsxRuntime.jsxs("p",{className:"text-sm mt-1",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Notes:"})," ",d.dpoApproval.notes]})]}),jsxRuntime.jsxs("div",{className:"flex space-x-3",children:[jsxRuntime.jsx("button",{onClick:()=>E(d),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${f}`,children:"Edit"}),d.status!=="archived"&&jsxRuntime.jsx("button",{onClick:()=>O(d.id),className:`px-4 py-2 bg-gray-600 text-white rounded hover:bg-gray-700 ${f}`,children:"Archive"})]})]})},pe=()=>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:C,onChange:t=>ee(t.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:[jsxRuntime.jsx("option",{value:"all",children:"All Bases"}),H.map(t=>jsxRuntime.jsx("option",{value:t.value,children:t.label},t.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:k,onChange:t=>Z(t.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),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:A,onChange:t=>te(t.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:ie,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))] ${f}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:"Add Activity"})})]}),N.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:N.map(t=>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:()=>ne(t.id),className:"font-medium text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline text-left",children:t.name}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mt-1 truncate max-w-xs",children:t.description})]}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:$(t.lawfulBasis)}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:V(t.status)}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:M(t)}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:jsxRuntime.jsx("span",{className:`text-xs ${t.involvesSensitiveData?"text-orange-600 dark:text-orange-400 font-medium":"text-gray-600 dark:text-gray-400"}`,children:t.involvesSensitiveData?"Yes":"No"})}),jsxRuntime.jsx("td",{className:"px-4 py-3 text-xs text-gray-600 dark:text-gray-400",children:w(t.updatedAt)}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[jsxRuntime.jsx("button",{onClick:()=>E(t),className:"text-xs text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline",children:"Edit"}),t.status!=="archived"&&jsxRuntime.jsx("button",{onClick:()=>O(t.id),className:"text-xs text-gray-600 dark:text-gray-400 hover:underline",children:"Archive"})]})})]},t.id))})]})})]});return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${z}`,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:W}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:q}),K&&y==="list"&&oe(),Q&&y==="list"&&de(),y==="list"&&pe(),y==="form"&&le(),y==="detail"&&se()]})};exports.a=fe;//# sourceMappingURL=chunk-ER7X6E36.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-ER7X6E36.js.map
|
package/dist/chunk-FOXZRRMW.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-NXQMU36Z.mjs';import {a as a$2}from'./chunk-6WIP33TW.mjs';import {c,a,b}from'./chunk-WWT2ZSNU.mjs';import {useRef,useState,useEffect,useCallback}from'react';function M(D,o){return o?a$2(D):{load:()=>null,save:()=>{},remove:()=>{}}}function Q({initialRequests:D=[],requestTypes:o,adapter:f,storageKey:x="ndpr_dsr_requests",useLocalStorage:B=true,onSubmit:p,onUpdate:m}){let y=f!=null?f:M(x,B),q=useRef(y);q.current=y;let[r,R]=useState(D),[I,l]=useState(true);useEffect(()=>{let e=false;try{let t=q.current.load();t instanceof Promise?t.then(s=>{e||(s&&R(s),l(!1));},()=>{e||l(!1);}):(t&&R(t),l(!1));}catch(t){e||l(false);}return ()=>{e=true;}},[]);let c$1=useCallback(e=>{Promise.resolve(q.current.save(e)).catch(t=>{console.warn("[ndpr-toolkit] Failed to save DSR requests:",t);});},[]),L=()=>"dsr_"+Date.now()+"_"+Math.random().toString(36).substr(2,9),O=useCallback(e=>{let t=o.find(g=>g.id===e.type),s=(t==null?void 0:t.estimatedCompletionTime)||30,u=Date.now(),a$1=u+s*24*60*60*1e3,v=e,{createdAt:A}=v,i=c(v,["createdAt"]),d=a({id:L(),status:"pending",createdAt:u,updatedAt:u,dueDate:a$1},i);return R(g=>{let b=[...g,d];return c$1(b),b}),p&&p(d),d},[o,c$1,p]),_=useCallback((e,t)=>{let s=null;return R(u=>{let a$1=u.findIndex(d=>d.id===e);if(a$1===-1)return u;let A=u[a$1];s=b(a(a({},A),t),{updatedAt:Date.now()});let i=[...u];return i[a$1]=s,c$1(i),i}),s&&m&&m(s),s},[c$1,m]),k=useCallback(e=>r.find(t=>t.id===e)||null,[r]),U=useCallback(e=>r.filter(t=>t.status===e),[r]),F=useCallback(e=>r.filter(t=>t.type===e),[r]);return {requests:r,submitRequest:O,updateRequest:_,getRequest:k,getRequestsByStatus:U,getRequestsByType:F,getRequestType:e=>o.find(t=>t.id===e),formatRequest:e=>{let{formattedRequest:t}=a$1(e);return t},clearRequests:()=>{R([]),Promise.resolve(q.current.remove()).catch(e=>{console.warn("[ndpr-toolkit] Failed to remove DSR requests:",e);});},isLoading:I}}export{Q as a};//# sourceMappingURL=chunk-FOXZRRMW.mjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-FOXZRRMW.mjs.map
|
package/dist/chunk-FY5G6DGZ.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),jsxRuntime=require('react/jsx-runtime'),D=require('react');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var D__default=/*#__PURE__*/_interopDefault(D);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,s)=>{let d=s?k[s]:void 0;return !d&&s==="printButton"&&(d=k.primaryButton),chunkE64TU6IU_js.a(a,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=>jsxRuntime.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 jsxRuntime.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:[jsxRuntime.jsxs("div",{className:i("mb-8 border-b border-gray-200 dark:border-gray-700 pb-6 print:pb-4","header"),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h1",{className:i("text-2xl font-bold text-gray-900 dark:text-white mb-2","title"),children:"Data Protection Impact Assessment Report"}),jsxRuntime.jsx("h2",{className:"text-xl text-gray-700 dark:text-gray-300 mb-4",children:r.title})]}),(x||y)&&jsxRuntime.jsxs("div",{className:"flex space-x-2 print:hidden",children:[x&&jsxRuntime.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:jsxRuntime.jsxs("span",{className:"flex items-center",children:[jsxRuntime.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:jsxRuntime.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&&jsxRuntime.jsx("div",{className:"relative inline-block",children:jsxRuntime.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:jsxRuntime.jsxs("span",{className:"flex items-center",children:[jsxRuntime.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:jsxRuntime.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"]})})})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Assessor:"})," ",r.assessor.name,", ",r.assessor.role]}),jsxRuntime.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Contact:"})," ",r.assessor.email]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Started:"})," ",g(r.startedAt)]}),jsxRuntime.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Completed:"})," ",r.completedAt?g(r.completedAt):"In progress"]}),jsxRuntime.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Next review:"})," ",r.reviewDate?g(r.reviewDate):"Not scheduled"]})]})]})]}),jsxRuntime.jsxs("div",{className:i("mb-8","summary"),children:[jsxRuntime.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Executive Summary"}),jsxRuntime.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md mb-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium mr-2",children:"Overall Risk Level:"}),h(r.overallRiskLevel)]}),jsxRuntime.jsxs("div",{className:i("mb-2","conclusion"),children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Conclusion:"})," ",r.conclusion]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Can Proceed:"})," ",r.canProceed?"Yes":"No"]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-medium text-gray-900 dark:text-white mb-2",children:"Processing Activity Description"}),jsxRuntime.jsx("p",{className:"text-gray-700 dark:text-gray-300 mb-4",children:r.processingDescription}),r.recommendations&&r.recommendations.length>0&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-medium text-gray-900 dark:text-white mb-2",children:"Key Recommendations"}),jsxRuntime.jsx("ul",{className:"list-disc pl-5 text-gray-700 dark:text-gray-300",children:r.recommendations.map((a,s)=>jsxRuntime.jsx("li",{className:i("","recommendation"),children:a},s))})]})]})]}),jsxRuntime.jsxs("div",{className:"mb-8",children:[jsxRuntime.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Identified Risks"}),r.risks.length===0?jsxRuntime.jsx("p",{className:"text-gray-700 dark:text-gray-300",children:"No risks identified."}):jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:i("min-w-full divide-y divide-gray-200 dark:divide-gray-700","riskTable"),children:[jsxRuntime.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.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"})]})}),jsxRuntime.jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:r.risks.map(a=>jsxRuntime.jsxs("tr",{className:i("","riskRow"),children:[jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-900 dark:text-gray-100",children:a.description}),jsxRuntime.jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-400",children:[a.likelihood," / 5"]}),jsxRuntime.jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-400",children:[a.impact," / 5"]}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm",children:h(a.level)}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-400",children:a.mitigated?jsxRuntime.jsx("span",{className:"text-green-600 dark:text-green-400",children:"Yes"}):jsxRuntime.jsx("span",{className:"text-red-600 dark:text-red-400",children:"No"})})]},a.id))})]})})]}),p&&jsxRuntime.jsxs("div",{children:[jsxRuntime.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:jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:a.title}),jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[jsxRuntime.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.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"}),jsxRuntime.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"})]})}),jsxRuntime.jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:s.map(d=>jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-900 dark:text-gray-100",children:d.text}),jsxRuntime.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)})]}),jsxRuntime.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:[jsxRuntime.jsx("p",{children:"This DPIA was conducted in accordance with the Nigeria Data Protection Act (NDPA) 2023."}),jsxRuntime.jsxs("p",{children:["DPIA Report Version: ",r.version]}),jsxRuntime.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)=>chunkE64TU6IU_js.a(n,l?k[l]:void 0,N),g=n=>{p&&m&&m(n);},c=x==="vertical";return jsxRuntime.jsx("div",{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 jsxRuntime.jsxs(D__default.default.Fragment,{children:[jsxRuntime.jsxs("div",{className:i(`${c?"flex items-start":"flex flex-col items-center"} ${p?"cursor-pointer":""}`,"step"),onClick:()=>g(n.id),children:[jsxRuntime.jsx("div",{className:`
|
|
2
|
-
flex items-center justify-center
|
|
3
|
-
${c?"mr-4":""}
|
|
4
|
-
`,children:jsxRuntime.jsx("div",{className:h,children:n.icon?n.icon:n.completed?jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.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"})}):jsxRuntime.jsx("span",{children:l+1})})}),jsxRuntime.jsxs("div",{className:`
|
|
5
|
-
${c?"flex-1":"mt-2 text-center"}
|
|
6
|
-
`,children:[jsxRuntime.jsx("div",{className:`text-sm font-medium ${C}`,children:n.label}),n.description&&jsxRuntime.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-400 mt-1",children:n.description})]})]}),!w&&jsxRuntime.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)})})};exports.a=S;exports.b=F;//# sourceMappingURL=chunk-FY5G6DGZ.js.map
|
|
7
|
-
//# sourceMappingURL=chunk-FY5G6DGZ.js.map
|
package/dist/chunk-GOD4LA2J.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-6TA2MVTU.mjs';import {a as a$2}from'./chunk-6WIP33TW.mjs';import {b,a}from'./chunk-WWT2ZSNU.mjs';import {useRef,useState,useEffect}from'react';function H(i,A){return A?a$2(i):{load:()=>null,save:()=>{},remove:()=>{}}}function Y({sections:i,initialAnswers:A={},adapter:v,storageKey:E="ndpr_dpia_data",useLocalStorage:C=true,onComplete:P}){let b$1=v!=null?v:H(E,C),d=useRef(b$1);d.current=b$1;let[f,g]=useState(0),[a$2,p]=useState(A),[T,m]=useState(true);useEffect(()=>{let r=false;try{let t=d.current.load();t instanceof Promise?t.then(e=>{r||(e&&p(e),m(!1));},()=>{r||m(!1);}):(t&&p(t),m(!1));}catch(t){r||m(false);}return ()=>{r=true;}},[]);let c=i[f]||null,_=r=>{Promise.resolve(d.current.save(r)).catch(t=>{console.warn("[ndpr-toolkit] Failed to save DPIA answers:",t);});},$=(r,t)=>{p(e=>{let s=b(a({},e),{[r]:t});return _(s),s});},h=r=>r.showWhen?r.showWhen.every(t=>{let e=a$2[t.questionId];switch(t.operator){case "equals":return e===t.value;case "contains":return Array.isArray(e)?e.includes(t.value):false;case "greaterThan":return typeof e=="number"?e>t.value:false;case "lessThan":return typeof e=="number"?e<t.value:false;default:return true}}):true,y=()=>c?c.questions.filter(h):[],w=()=>c?y().every(t=>{if(!t.required)return true;let e=a$2[t.id];return !(e==null||typeof e=="string"&&e.trim()===""||Array.isArray(e)&&e.length===0)}):false,O=()=>{let r={};return c&&y().forEach(e=>{if(!e.required)return;let s=a$2[e.id];s==null||typeof s=="string"&&s.trim()===""?r[e.id]="This question is required":Array.isArray(s)&&s.length===0&&(r[e.id]="At least one option must be selected");}),r},U=()=>w()&&f<i.length-1?(g(r=>r+1),true):false,V=()=>f>0?(g(r=>r-1),true):false,B=r=>r>=0&&r<i.length?(g(r),true):false,F=()=>i.every(r=>r.questions.filter(h).every(e=>{if(!e.required)return true;let s=a$2[e.id];return !(s==null||typeof s=="string"&&s.trim()===""||Array.isArray(s)&&s.length===0)})),W=()=>{let r=[];return i.forEach(t=>{t.questions.forEach(e=>{let s=a$2[e.id];if(s!=null&&e.riskLevel)if(["select","radio","checkbox"].includes(e.type)&&e.options)(Array.isArray(s)?s:[s]).forEach(o=>{var D;let l=(D=e.options)==null?void 0:D.find(u=>u.value===o);if(l!=null&&l.riskLevel){let u=l.riskLevel,R=u==="low"?1:u==="medium"?3:5,S=u==="low"?1:u==="medium"?3:5;r.push({id:`risk_${r.length+1}`,description:`${e.text} - ${l.label}`,likelihood:R,impact:S,score:R*S,level:u,mitigated:false,relatedQuestionIds:[e.id]});}});else {let n=e.riskLevel,o=n==="low"?1:n==="medium"?3:5,l=n==="low"?1:n==="medium"?3:5;r.push({id:`risk_${r.length+1}`,description:e.text,likelihood:o,impact:l,score:o*l,level:n,mitigated:false,relatedQuestionIds:[e.id]});}});}),r},K=(r,t,e)=>{let s=W(),n={id:`dpia_${Date.now()}`,title:t,processingDescription:e,startedAt:Date.now(),completedAt:Date.now(),assessor:r,answers:a$2,risks:s,overallRiskLevel:"low",canProceed:true,conclusion:"",version:"1.0"},o=a$1(n);return n.overallRiskLevel=o.overallRiskLevel,n.canProceed=o.canProceed,n.conclusion=o.canProceed?"Based on the assessment, the processing can proceed with appropriate safeguards.":"Based on the assessment, the processing should not proceed without further mitigation measures.",n.recommendations=o.recommendations,P&&P(n),n},M=()=>{p({}),g(0),Promise.resolve(d.current.remove()).catch(r=>{console.warn("[ndpr-toolkit] Failed to remove DPIA data:",r);});},j=(()=>{let r=0,t=0;return i.forEach(e=>{e.questions.forEach(s=>{if(s.required&&h(s)){t++;let n=a$2[s.id];n!=null&&!(typeof n=="string"&&n.trim()==="")&&!(Array.isArray(n)&&n.length===0)&&r++;}});}),t>0?Math.round(r/t*100):0})();return {currentSectionIndex:f,currentSection:c,answers:a$2,updateAnswer:$,nextSection:U,prevSection:V,goToSection:B,isCurrentSectionValid:w,getCurrentSectionErrors:O,isComplete:F,completeDPIA:K,getVisibleQuestions:y,resetDPIA:M,progress:j,isLoading:T}}export{Y as a};//# sourceMappingURL=chunk-GOD4LA2J.mjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-GOD4LA2J.mjs.map
|