@tantainnovative/ndpr-toolkit 3.3.0 → 3.4.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/CHANGELOG.md +529 -0
- package/README.md +4 -4
- package/dist/{ConsentBanner-CDRT0o2k.d.mts → ConsentBanner-F5ayys5K.d.mts} +10 -0
- package/dist/{ConsentBanner-Vxyt8SCX.d.ts → ConsentBanner-VqIPophc.d.ts} +10 -0
- package/dist/{styling-B7CBzYG7.d.ts → ConsentManager-C7I3PDe8.d.mts} +2 -62
- package/dist/{styling-uJLsBbER.d.mts → ConsentManager-CQ2IZtUU.d.ts} +2 -62
- package/dist/{sanitize-B0AzEm1D.d.mts → NDPRProvider-DYFb8xEl.d.ts} +2 -94
- package/dist/{sanitize-B0AzEm1D.d.ts → NDPRProvider-U3QNu6MA.d.mts} +2 -94
- package/dist/adapters.js +1 -1
- package/dist/adapters.mjs +1 -1
- package/dist/breach.js +1 -1
- package/dist/breach.mjs +1 -1
- package/dist/chunk-2AW7KAZO.mjs +2 -0
- package/dist/chunk-2WH4DLV5.js +3 -0
- package/dist/chunk-3NQQSU4P.js +2 -0
- package/dist/chunk-3VQAYQR7.js +7 -0
- package/dist/chunk-4R42ZNO7.mjs +318 -0
- package/dist/chunk-5HL4UBFV.js +2 -0
- package/dist/chunk-6FGCGLH5.mjs +2 -0
- package/dist/chunk-6HZL2WDU.mjs +2 -0
- package/dist/chunk-6QPRDQZF.js +2 -0
- package/dist/chunk-74Z23WUA.mjs +2 -0
- package/dist/chunk-AHSMDPG5.js +132 -0
- package/dist/chunk-BN77GP4W.mjs +2 -0
- package/dist/chunk-C5QO3SX4.js +2 -0
- package/dist/chunk-CISJAQ6W.mjs +2 -0
- package/dist/chunk-DCJK5OZT.mjs +2 -0
- package/dist/chunk-DUY6F3GT.mjs +94 -0
- package/dist/chunk-EHAZIKDX.js +81 -0
- package/dist/chunk-EPT2K355.mjs +2 -0
- package/dist/chunk-HGGLW5TE.js +2 -0
- package/dist/chunk-HQSU7LGM.js +94 -0
- package/dist/chunk-IZCWCE7W.mjs +2 -0
- package/dist/chunk-JBSCER34.js +2 -0
- package/dist/chunk-KF3EFJEF.mjs +3 -0
- package/dist/chunk-KSERBMXW.mjs +4 -0
- package/dist/chunk-LJNNPAFU.mjs +2 -0
- package/dist/{chunk-UXMGBIX6.js → chunk-LSCMXAPY.mjs} +4 -4
- package/dist/chunk-LSNL4XR5.js +2 -0
- package/dist/chunk-M2TPT5GB.js +2 -0
- package/dist/chunk-MCWV7S2G.js +2 -0
- package/dist/chunk-MG73MOZC.mjs +15 -0
- package/dist/chunk-NCOZB2WU.mjs +2 -0
- package/dist/chunk-NQNFS3QI.js +7 -0
- package/dist/chunk-OPYQIJKY.js +2 -0
- package/dist/{chunk-ZEOQYWOE.mjs → chunk-P2YV6DR3.js} +4 -4
- package/dist/chunk-P6QAFBCV.js +2 -0
- package/dist/chunk-QVULSG6J.mjs +3 -0
- package/dist/chunk-R5FW5XUQ.mjs +2 -0
- package/dist/chunk-RGNP45VR.js +2 -0
- package/dist/chunk-RLYTX3MM.js +2 -0
- package/dist/chunk-RNTNHVKZ.js +15 -0
- package/dist/chunk-RRVKUCFR.mjs +2 -0
- package/dist/chunk-RXL6CZAI.js +2 -0
- package/dist/chunk-RY3PGVLZ.mjs +2 -0
- package/dist/chunk-SUEGUY35.js +2 -0
- package/dist/chunk-SYMQJO2W.mjs +7 -0
- package/dist/chunk-TCN22KYP.mjs +7 -0
- package/dist/chunk-UFPSUO52.js +318 -0
- package/dist/chunk-VTITKWGX.mjs +2 -0
- package/dist/chunk-WH6ZMUOS.mjs +81 -0
- package/dist/chunk-WTJGLNTB.js +3 -0
- package/dist/chunk-XHROISIF.mjs +2 -0
- package/dist/chunk-XMBSJJ5U.js +4 -0
- package/dist/chunk-XSEZDQLB.js +2 -0
- package/dist/chunk-Z6IIMLZU.mjs +2 -0
- package/dist/chunk-ZLSWOFAY.mjs +132 -0
- package/dist/chunk-ZPKVLTSX.js +2 -0
- package/dist/consent.d.mts +6 -4
- package/dist/consent.d.ts +6 -4
- package/dist/consent.js +1 -1
- package/dist/consent.mjs +1 -1
- package/dist/core.d.mts +6 -25
- package/dist/core.d.ts +6 -25
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/cross-border.d.mts +2 -2
- package/dist/cross-border.d.ts +2 -2
- package/dist/cross-border.js +1 -1
- package/dist/cross-border.mjs +1 -1
- package/dist/docx-BxKascXN.d.ts +64 -0
- package/dist/docx-CV7Vsry_.d.mts +64 -0
- package/dist/dpia.js +1 -1
- package/dist/dpia.mjs +1 -1
- package/dist/dsr.js +1 -1
- package/dist/dsr.mjs +1 -1
- package/dist/hooks.d.mts +4 -4
- package/dist/hooks.d.ts +4 -4
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/index.d.mts +8 -6
- package/dist/index.d.ts +8 -6
- 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/locale-CxJx2tzn.d.mts +25 -0
- package/dist/locale-DSkrtf-c.d.ts +25 -0
- package/dist/{policy-engine-C6nC2t3a.d.ts → policy-engine-CCUCud2T.d.ts} +1 -1
- package/dist/{policy-engine-DefZcX3R.d.mts → policy-engine-fYSqEqSW.d.mts} +1 -1
- package/dist/{policy-sections-DFDPVCCg.d.ts → policy-sections-BYx6fEFk.d.ts} +4 -2
- package/dist/{policy-sections-Bylm31kZ.d.mts → policy-sections-Dm97Nq8m.d.mts} +4 -2
- package/dist/{policy-templates-CIKcV0i1.d.ts → policy-templates-DhLwq4R-.d.ts} +8 -1
- package/dist/{policy-templates-DMsPwOSZ.d.mts → policy-templates-DwYl2329.d.mts} +8 -1
- package/dist/policy.d.mts +36 -71
- package/dist/policy.d.ts +36 -71
- package/dist/policy.js +1 -1
- package/dist/policy.mjs +1 -1
- package/dist/presets.d.mts +2 -2
- package/dist/presets.d.ts +2 -2
- 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-CxxwKxAx.d.mts +94 -0
- package/dist/sanitize-CxxwKxAx.d.ts +94 -0
- package/dist/server.d.mts +24 -0
- package/dist/server.d.ts +24 -0
- package/dist/server.js +2 -0
- package/dist/server.mjs +2 -0
- package/dist/styles.css +1423 -31
- package/dist/styling-BMDGQDgS.d.mts +64 -0
- package/dist/styling-BaoQtV06.d.ts +64 -0
- package/dist/unstyled.d.mts +52 -19
- package/dist/unstyled.d.ts +52 -19
- package/dist/unstyled.js +1 -1
- package/dist/unstyled.mjs +1 -1
- package/dist/{useAdaptivePolicyWizard-A1PyOy6P.d.mts → useAdaptivePolicyWizard-BnjW4OR4.d.mts} +1 -1
- package/dist/{useAdaptivePolicyWizard-LVIKhAxw.d.ts → useAdaptivePolicyWizard-sb3m4-Zk.d.ts} +1 -1
- package/dist/{useCrossBorderTransfer-BGNZt2lk.d.mts → useCrossBorderTransfer-DixjLjN1.d.mts} +1 -1
- package/dist/{useCrossBorderTransfer-COqjgjsu.d.ts → useCrossBorderTransfer-DvSq06lv.d.ts} +1 -1
- package/dist/{useDefaultPrivacyPolicy-BsYttRey.d.mts → useDefaultPrivacyPolicy-Cs2WQSYQ.d.mts} +34 -9
- package/dist/{useDefaultPrivacyPolicy-C-mG-A5S.d.ts → useDefaultPrivacyPolicy-DkOqMg2e.d.ts} +34 -9
- package/package.json +20 -6
- package/dist/chunk-256APOQM.js +0 -2
- package/dist/chunk-25OOUES4.js +0 -2
- package/dist/chunk-4JKTIR33.mjs +0 -2
- package/dist/chunk-5BUS6AI7.js +0 -2
- package/dist/chunk-6BXUVS6E.js +0 -81
- package/dist/chunk-6JCRDJQI.mjs +0 -2
- package/dist/chunk-6RQGQZT2.js +0 -2
- package/dist/chunk-6YN73KR7.mjs +0 -2
- package/dist/chunk-CDZDT2OS.mjs +0 -320
- package/dist/chunk-CSIJCLGZ.mjs +0 -2
- package/dist/chunk-CWUPGY3M.mjs +0 -3
- package/dist/chunk-E63VPR7U.js +0 -2
- package/dist/chunk-FDDI426Y.mjs +0 -2
- package/dist/chunk-GCQRHMTQ.mjs +0 -144
- package/dist/chunk-GMLCWGNJ.js +0 -7
- package/dist/chunk-GQVNLUP2.js +0 -94
- package/dist/chunk-GXLSOZCH.mjs +0 -2
- package/dist/chunk-IQJO7WIH.js +0 -7
- package/dist/chunk-LETEUS5X.mjs +0 -2
- package/dist/chunk-LU4PFST7.js +0 -144
- package/dist/chunk-M6XETYNL.js +0 -2
- package/dist/chunk-NBSVFQ5G.js +0 -2
- package/dist/chunk-NUDVUAD4.mjs +0 -81
- package/dist/chunk-NUULHXVL.mjs +0 -7
- package/dist/chunk-PM7O5IGE.mjs +0 -2
- package/dist/chunk-Q7VHB64E.mjs +0 -2
- package/dist/chunk-QDHHD2KR.mjs +0 -94
- package/dist/chunk-SAA7UVI2.js +0 -3
- package/dist/chunk-TI2M7H6R.mjs +0 -7
- package/dist/chunk-TKVJ3OOV.mjs +0 -2
- package/dist/chunk-TXXWCB5O.js +0 -320
- package/dist/chunk-UGY5ZYUG.js +0 -2
- package/dist/chunk-UO6QPJLH.js +0 -2
- package/dist/chunk-UX6ZZNEM.mjs +0 -3
- package/dist/chunk-VLSGE2YA.js +0 -2
- package/dist/chunk-XFUEZ3MP.mjs +0 -2
- package/dist/chunk-XHSHPB74.js +0 -2
- package/dist/chunk-YCX6BFOQ.js +0 -2
- package/dist/chunk-YURSF2YO.mjs +0 -2
- package/dist/chunk-YZXUAIYN.js +0 -3
- package/dist/chunk-ZGJA7OO4.js +0 -2
- package/dist/chunk-ZT7KNFAU.mjs +0 -2
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import {e,g,h,f}from'./chunk-75TJPK2N.mjs';import {a as a$1}from'./chunk-AYKLAEOU.mjs';import {b,a}from'./chunk-WWT2ZSNU.mjs';import {useState,useMemo,useEffect,useCallback}from'react';import {jsxs,jsx}from'react/jsx-runtime';var I=[{value:"adequacy_decision",label:"Adequacy Decision (Section 41)"},{value:"standard_clauses",label:"Standard Contractual Clauses (Section 42)"},{value:"binding_corporate_rules",label:"Binding Corporate Rules (Section 43)"},{value:"ndpc_authorization",label:"NDPC Authorization (Section 44)"},{value:"explicit_consent",label:"Explicit Consent (Section 45(a))"},{value:"contract_performance",label:"Contract Performance (Section 45(b))"},{value:"public_interest",label:"Public Interest (Section 45(c))"},{value:"legal_claims",label:"Legal Claims (Section 45(d))"},{value:"vital_interests",label:"Vital Interests (Section 45(e))"}],G=[{value:"adequate",label:"Adequate"},{value:"inadequate",label:"Inadequate"},{value:"pending_review",label:"Pending Review"},{value:"unknown",label:"Unknown"}],J=[{value:"one_time",label:"One-Time"},{value:"periodic",label:"Periodic"},{value:"continuous",label:"Continuous"}],X=[{value:"active",label:"Active"},{value:"suspended",label:"Suspended"},{value:"terminated",label:"Terminated"},{value:"pending_approval",label:"Pending Approval"}],Z={destinationCountry:"",destinationCountryCode:"",adequacyStatus:"unknown",transferMechanism:"adequacy_decision",dataCategories:"",includesSensitiveData:false,estimatedDataSubjects:"",recipientOrganization:"",recipientContactName:"",recipientContactEmail:"",recipientContactPhone:"",recipientContactAddress:"",purpose:"",safeguards:"",riskAssessment:"",riskLevel:"medium",frequency:"one_time",status:"active",tiaCompleted:false,tiaReference:"",ndpcApprovalApplied:false,ndpcApprovalApproved:false,ndpcApprovalReference:""},xe=({transfers:v,onAddTransfer:q,onUpdateTransfer:R,onRemoveTransfer:F,summary:E,title:ee="Cross-Border Data Transfer Manager",description:te="Manage and document cross-border personal data transfers in compliance with NDPA 2023 Part VI (Sections 41-45).",className:ae="",buttonClassName:M="",showSummary:re=true,showTIA:ie=true,classNames:a$2,unstyled:d})=>{let[f$1,y]=useState(null),[j,S]=useState(false),[h$1,z]=useState(null),[n,P]=useState(Z),[C,L]=useState(null),[k,ne]=useState("all"),[T,de]=useState("all"),x=useMemo(()=>{let e=[...v];return k!=="all"&&(e=e.filter(r=>r.status===k)),T!=="all"&&(e=e.filter(r=>r.transferMechanism===T)),e.sort((r,l)=>l.updatedAt-r.updatedAt),e},[v,k,T]);useEffect(()=>{x.length>0&&!f$1&&y(x[0].id);},[x,f$1]);let $=useMemo(()=>{var e;return f$1&&(e=v.find(r=>r.id===f$1))!=null?e:null},[v,f$1]),A=useCallback(e=>new Date(e).toLocaleDateString(),[]),_=useCallback(()=>{P(Z),z(null),L(null);},[]),pe=useCallback(()=>{_(),S(true);},[_]),le=useCallback(e=>{var r,l,c,g;z(e.id),P({destinationCountry:e.destinationCountry,destinationCountryCode:e.destinationCountryCode||"",adequacyStatus:e.adequacyStatus,transferMechanism:e.transferMechanism,dataCategories:e.dataCategories.join(", "),includesSensitiveData:e.includesSensitiveData,estimatedDataSubjects:((r=e.estimatedDataSubjects)==null?void 0:r.toString())||"",recipientOrganization:e.recipientOrganization,recipientContactName:e.recipientContact.name,recipientContactEmail:e.recipientContact.email,recipientContactPhone:e.recipientContact.phone||"",recipientContactAddress:e.recipientContact.address||"",purpose:e.purpose,safeguards:e.safeguards.join(`
|
|
2
|
+
`),riskAssessment:e.riskAssessment,riskLevel:e.riskLevel,frequency:e.frequency,status:e.status,tiaCompleted:e.tiaCompleted,tiaReference:e.tiaReference||"",ndpcApprovalApplied:((l=e.ndpcApproval)==null?void 0:l.applied)||false,ndpcApprovalApproved:((c=e.ndpcApproval)==null?void 0:c.approved)||false,ndpcApprovalReference:((g=e.ndpcApproval)==null?void 0:g.referenceNumber)||""}),S(true);},[]),o=useCallback((e,r)=>{P(l=>b(a({},l),{[e]:r}));},[]),V=useCallback(()=>{let e$1=e(n.transferMechanism),r=Date.now();return {destinationCountry:n.destinationCountry.trim(),destinationCountryCode:n.destinationCountryCode.trim()||void 0,adequacyStatus:n.adequacyStatus,transferMechanism:n.transferMechanism,dataCategories:n.dataCategories.split(",").map(l=>l.trim()).filter(Boolean),includesSensitiveData:n.includesSensitiveData,estimatedDataSubjects:n.estimatedDataSubjects?parseInt(n.estimatedDataSubjects,10):void 0,recipientOrganization:n.recipientOrganization.trim(),recipientContact:{name:n.recipientContactName.trim(),email:n.recipientContactEmail.trim(),phone:n.recipientContactPhone.trim()||void 0,address:n.recipientContactAddress.trim()||void 0},purpose:n.purpose.trim(),safeguards:n.safeguards.split(`
|
|
3
|
+
`).map(l=>l.trim()).filter(Boolean),riskAssessment:n.riskAssessment.trim(),riskLevel:n.riskLevel,frequency:n.frequency,status:e$1&&!n.ndpcApprovalApproved?"pending_approval":n.status,tiaCompleted:n.tiaCompleted,tiaReference:n.tiaReference.trim()||void 0,ndpcApproval:e$1?{required:true,applied:n.ndpcApprovalApplied,approved:n.ndpcApprovalApproved||void 0,referenceNumber:n.ndpcApprovalReference.trim()||void 0,appliedAt:n.ndpcApprovalApplied?r:void 0,approvedAt:n.ndpcApprovalApproved?r:void 0}:void 0,startDate:r,reviewDate:r+365*24*60*60*1e3}},[n]),oe=useCallback(()=>{let e=V(),r=a({id:h$1||"temp",createdAt:Date.now(),updatedAt:Date.now()},e),l=g(r);L(l),l.isValid&&(h$1?R&&R(h$1,e):q&&q(e),_(),S(false));},[V,h$1,R,q,_]),U=useCallback(()=>{_(),S(false);},[_]),se=useCallback(e=>{F&&F(e),f$1===e&&y(null);},[F,f$1]),H=useCallback(e=>jsxs("span",{className:a$1(`px-2 py-1 rounded text-xs font-medium ${{low:"ndpr-badge ndpr-badge--success",medium:"ndpr-badge ndpr-badge--warning",high:"ndpr-badge ndpr-badge--destructive"}[e]}`,a$2==null?void 0:a$2.riskBadge,d),children:[e.charAt(0).toUpperCase()+e.slice(1)," Risk"]}),[a$2==null?void 0:a$2.riskBadge,d]),Y=useCallback(e=>{let r={active:"ndpr-badge ndpr-badge--success",suspended:"ndpr-badge ndpr-badge--warning",terminated:"ndpr-badge ndpr-badge--neutral",pending_approval:"ndpr-badge ndpr-badge--info"},l={active:"Active",suspended:"Suspended",terminated:"Terminated",pending_approval:"Pending Approval"};return jsx("span",{className:a$1(`px-2 py-1 rounded text-xs font-medium ${r[e]}`,a$2==null?void 0:a$2.statusBadge,d),children:l[e]})},[a$2==null?void 0:a$2.statusBadge,d]),ce=useCallback(e$1=>{var c;e(e$1);let l=((c=I.find(g=>g.value===e$1))==null?void 0:c.label)||e$1;return jsx("span",{className:"px-2 py-1 rounded text-xs font-medium ndpr-badge ndpr-badge--info",children:l})},[]),D=useMemo(()=>E||{totalActiveTransfers:v.filter(e=>e.status==="active").length,pendingApproval:v.filter(e=>{var r,l;return e.status==="pending_approval"||((r=e.ndpcApproval)==null?void 0:r.required)&&!((l=e.ndpcApproval)!=null&&l.approved)}),highRiskTransfers:v.filter(e=>e.riskLevel==="high"&&e.status==="active"),missingTIA:v.filter(e=>!e.tiaCompleted&&e.status==="active"),byMechanism:{},byAdequacy:{},dueForReview:[],lastUpdated:Date.now()},[E,v]),ue=()=>jsxs("div",{"data-ndpr-component":"cross-border-transfer-manager",role:"status","aria-label":"Transfer compliance summary",className:a$1("mb-6 grid grid-cols-2 md:grid-cols-4 gap-4",a$2==null?void 0:a$2.summary,d),children:[jsxs("div",{className:a$1("ndpr-alert ndpr-alert--info",a$2==null?void 0:a$2.summaryCard,d),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:D.totalActiveTransfers}),jsx("p",{className:"text-sm ndpr-text-info",children:"Active Transfers"})]}),jsxs("div",{className:a$1("ndpr-alert ndpr-alert--info",a$2==null?void 0:a$2.summaryCard,d),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:D.pendingApproval.length}),jsx("p",{className:"text-sm ndpr-text-info",children:"Pending Approval"})]}),jsxs("div",{className:a$1("ndpr-alert ndpr-alert--destructive",a$2==null?void 0:a$2.summaryCard,d),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-destructive",children:D.highRiskTransfers.length}),jsx("p",{className:"text-sm ndpr-text-destructive",children:"High Risk"})]}),jsxs("div",{className:a$1("ndpr-alert ndpr-alert--warning",a$2==null?void 0:a$2.summaryCard,d),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-warning",children:D.missingTIA.length}),jsx("p",{className:"text-sm ndpr-text-warning",children:"Missing TIA"})]})]}),me=()=>{let e$1=e(n.transferMechanism);return jsxs("div",{className:a$1("bg-gray-50 dark:bg-gray-700 p-6 rounded-lg mb-6",a$2==null?void 0:a$2.form,d),children:[jsxs("div",{className:a$1("flex justify-between items-center mb-4",a$2==null?void 0:a$2.header,d),children:[jsx("h3",{className:"ndpr-section-heading",children:h$1?"Edit Transfer":"Add New Transfer"}),jsx("button",{onClick:U,"aria-label":"Cancel form",className:"text-gray-600 hover:ndpr-text-muted dark:hover:text-gray-200",children:"Cancel"})]}),C&&!C.isValid&&jsxs("div",{id:"cb-form-errors",role:"alert",className:"ndpr-alert ndpr-alert--destructive",children:[jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-1",children:"Please fix the following errors:"}),jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-destructive",children:C.errors.map((r,l)=>jsx("li",{children:r},l))})]}),C&&C.warnings.length>0&&jsxs("div",{id:"cb-form-warnings",role:"alert",className:"ndpr-alert ndpr-alert--warning",children:[jsx("p",{className:"text-sm font-medium ndpr-text-warning mb-1",children:"Warnings:"}),jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-warning",children:C.warnings.map((r,l)=>jsx("li",{children:r},l))})]}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"cb-destinationCountry",className:"ndpr-form-field__label",children:["Destination Country ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{id:"cb-destinationCountry",type:"text",value:n.destinationCountry,onChange:r=>o("destinationCountry",r.target.value),placeholder:"e.g. United Kingdom","aria-required":"true","aria-describedby":"cb-form-errors","aria-label":"Destination country",className:a$1("ndpr-form-field__input",a$2==null?void 0:a$2.input,d)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cb-destinationCountryCode",className:"ndpr-form-field__label",children:"Country Code (ISO)"}),jsx("input",{id:"cb-destinationCountryCode",type:"text",value:n.destinationCountryCode,onChange:r=>o("destinationCountryCode",r.target.value),placeholder:"e.g. GB",maxLength:3,"aria-label":"Country code in ISO format",className:a$1("ndpr-form-field__input",a$2==null?void 0:a$2.input,d)})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"cb-recipientOrganization",className:"ndpr-form-field__label",children:["Recipient Organization ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{id:"cb-recipientOrganization",type:"text",value:n.recipientOrganization,onChange:r=>o("recipientOrganization",r.target.value),placeholder:"Organization name","aria-required":"true","aria-describedby":"cb-form-errors",className:a$1("ndpr-form-field__input",a$2==null?void 0:a$2.input,d)})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"cb-transferMechanism",className:"ndpr-form-field__label",children:["Transfer Mechanism ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("select",{id:"cb-transferMechanism",value:n.transferMechanism,onChange:r=>o("transferMechanism",r.target.value),"aria-required":"true","aria-describedby":"cb-form-errors",className:a$1("ndpr-form-field__input",a$2==null?void 0:a$2.select,d),children:I.map(r=>jsx("option",{value:r.value,children:r.label},r.value))})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cb-adequacyStatus",className:"ndpr-form-field__label",children:"Adequacy Status"}),jsx("select",{id:"cb-adequacyStatus",value:n.adequacyStatus,onChange:r=>o("adequacyStatus",r.target.value),"aria-label":"Select adequacy status of destination country",className:a$1("ndpr-form-field__input",a$2==null?void 0:a$2.select,d),children:G.map(r=>jsx("option",{value:r.value,children:r.label},r.value))})]}),jsxs("div",{children:[jsx("label",{className:"ndpr-form-field__label",children:"Risk Level"}),jsxs("select",{value:n.riskLevel,onChange:r=>o("riskLevel",r.target.value),className:a$1("ndpr-form-field__input",a$2==null?void 0:a$2.select,d),children:[jsx("option",{value:"low",children:"Low"}),jsx("option",{value:"medium",children:"Medium"}),jsx("option",{value:"high",children:"High"})]})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{htmlFor:"cb-dataCategories",className:"ndpr-form-field__label",children:["Data Categories ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{id:"cb-dataCategories",type:"text",value:n.dataCategories,onChange:r=>o("dataCategories",r.target.value),placeholder:"Comma-separated, e.g. Names, Email addresses, Phone numbers","aria-required":"true","aria-describedby":"cb-dataCategories-help",className:a$1("ndpr-form-field__input",a$2==null?void 0:a$2.input,d)}),jsx("p",{id:"cb-dataCategories-help",className:"text-xs text-gray-500 mt-1",children:"Separate categories with commas"})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{type:"checkbox",id:"includesSensitiveData",checked:n.includesSensitiveData,onChange:r=>o("includesSensitiveData",r.target.checked),className:"ndpr-form-field__checkbox"}),jsx("label",{htmlFor:"includesSensitiveData",className:"ndpr-text-sm ndpr-font-medium",children:"Includes sensitive personal data"})]}),jsxs("div",{children:[jsx("label",{className:"ndpr-form-field__label",children:"Estimated Data Subjects"}),jsx("input",{type:"number",value:n.estimatedDataSubjects,onChange:r=>o("estimatedDataSubjects",r.target.value),placeholder:"Number of data subjects",className:a$1("ndpr-form-field__input",a$2==null?void 0:a$2.input,d)})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"cb-recipientContactName",className:"ndpr-form-field__label",children:["Recipient Contact Name ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{id:"cb-recipientContactName",type:"text",value:n.recipientContactName,onChange:r=>o("recipientContactName",r.target.value),placeholder:"Contact person name","aria-required":"true","aria-describedby":"cb-form-errors",className:a$1("ndpr-form-field__input",a$2==null?void 0:a$2.input,d)})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"cb-recipientContactEmail",className:"ndpr-form-field__label",children:["Recipient Contact Email ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{id:"cb-recipientContactEmail",type:"email",value:n.recipientContactEmail,onChange:r=>o("recipientContactEmail",r.target.value),placeholder:"contact@example.com","aria-required":"true","aria-describedby":"cb-form-errors",className:a$1("ndpr-form-field__input",a$2==null?void 0:a$2.input,d)})]}),jsxs("div",{children:[jsx("label",{className:"ndpr-form-field__label",children:"Recipient Contact Phone"}),jsx("input",{type:"text",value:n.recipientContactPhone,onChange:r=>o("recipientContactPhone",r.target.value),placeholder:"Phone number",className:a$1("ndpr-form-field__input",a$2==null?void 0:a$2.input,d)})]}),jsxs("div",{children:[jsx("label",{className:"ndpr-form-field__label",children:"Recipient Contact Address"}),jsx("input",{type:"text",value:n.recipientContactAddress,onChange:r=>o("recipientContactAddress",r.target.value),placeholder:"Address",className:a$1("ndpr-form-field__input",a$2==null?void 0:a$2.input,d)})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{htmlFor:"cb-purpose",className:"ndpr-form-field__label",children:["Purpose of Transfer ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("textarea",{id:"cb-purpose",value:n.purpose,onChange:r=>o("purpose",r.target.value),placeholder:"Describe the purpose of this data transfer",rows:2,"aria-required":"true","aria-describedby":"cb-form-errors",className:a$1("ndpr-form-field__input",a$2==null?void 0:a$2.input,d)})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{htmlFor:"cb-safeguards",className:"ndpr-form-field__label",children:["Safeguards ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("textarea",{id:"cb-safeguards",value:n.safeguards,onChange:r=>o("safeguards",r.target.value),placeholder:`One safeguard per line, e.g.
|
|
4
|
+
End-to-end encryption
|
|
5
|
+
Access control policies
|
|
6
|
+
Regular security audits`,rows:3,"aria-required":"true","aria-describedby":"cb-safeguards-help",className:a$1("ndpr-form-field__input",a$2==null?void 0:a$2.input,d)}),jsx("p",{id:"cb-safeguards-help",className:"text-xs text-gray-500 mt-1",children:"Enter one safeguard per line"})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{htmlFor:"cb-riskAssessment",className:"ndpr-form-field__label",children:["Risk Assessment Summary ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("textarea",{id:"cb-riskAssessment",value:n.riskAssessment,onChange:r=>o("riskAssessment",r.target.value),placeholder:"Summarize the risk assessment for this transfer",rows:2,"aria-required":"true","aria-describedby":"cb-form-errors",className:a$1("ndpr-form-field__input",a$2==null?void 0:a$2.input,d)})]}),jsxs("div",{children:[jsx("label",{className:"ndpr-form-field__label",children:"Transfer Frequency"}),jsx("select",{value:n.frequency,onChange:r=>o("frequency",r.target.value),className:a$1("ndpr-form-field__input",a$2==null?void 0:a$2.select,d),children:J.map(r=>jsx("option",{value:r.value,children:r.label},r.value))})]}),jsxs("div",{children:[jsx("label",{className:"ndpr-form-field__label",children:"Status"}),jsx("select",{value:n.status,onChange:r=>o("status",r.target.value),className:a$1("ndpr-form-field__input",a$2==null?void 0:a$2.select,d),children:X.map(r=>jsx("option",{value:r.value,children:r.label},r.value))})]})]}),e$1&&jsxs("div",{className:"mt-4 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsx("h4",{className:"text-sm font-medium ndpr-text-info mb-3",children:"NDPC Approval Required"}),jsx("p",{className:"text-xs ndpr-text-info mb-3",children:"The selected transfer mechanism requires approval from the Nigeria Data Protection Commission."}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{type:"checkbox",id:"ndpcApprovalApplied",checked:n.ndpcApprovalApplied,onChange:r=>o("ndpcApprovalApplied",r.target.checked),className:"ndpr-form-field__checkbox"}),jsx("label",{htmlFor:"ndpcApprovalApplied",className:"ndpr-text-sm",children:"Application submitted"})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{type:"checkbox",id:"ndpcApprovalApproved",checked:n.ndpcApprovalApproved,onChange:r=>o("ndpcApprovalApproved",r.target.checked),className:"ndpr-form-field__checkbox"}),jsx("label",{htmlFor:"ndpcApprovalApproved",className:"ndpr-text-sm",children:"Approval granted"})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{className:"ndpr-form-field__label",children:"NDPC Reference Number"}),jsx("input",{type:"text",value:n.ndpcApprovalReference,onChange:r=>o("ndpcApprovalReference",r.target.value),placeholder:"Reference number (if available)",className:a$1("ndpr-form-field__input",a$2==null?void 0:a$2.input,d)})]})]})]}),ie&&jsxs("div",{className:"mt-4 p-4 bg-gray-100 dark:bg-gray-600 rounded-md",children:[jsx("h4",{className:"text-sm font-medium mb-3",children:"Transfer Impact Assessment"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{type:"checkbox",id:"tiaCompleted",checked:n.tiaCompleted,onChange:r=>o("tiaCompleted",r.target.checked),className:"ndpr-form-field__checkbox"}),jsx("label",{htmlFor:"tiaCompleted",className:"ndpr-text-sm",children:"TIA completed"})]}),jsxs("div",{children:[jsx("label",{className:"ndpr-form-field__label",children:"TIA Reference"}),jsx("input",{type:"text",value:n.tiaReference,onChange:r=>o("tiaReference",r.target.value),placeholder:"Document reference",className:a$1("ndpr-form-field__input",a$2==null?void 0:a$2.input,d)})]})]})]}),jsxs("div",{className:"mt-4 flex justify-end gap-3",children:[jsx("button",{onClick:U,className:"px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-md text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-600",children:"Cancel"}),jsx("button",{onClick:oe,className:a$1(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${M}`,(a$2==null?void 0:a$2.primaryButton)||(a$2==null?void 0:a$2.submitButton),d),children:h$1?"Update Transfer":"Add Transfer"})]})]})},ve=e=>{var c,g$1;let r=h(e),l=g(e);return jsxs("div",{role:"status","aria-label":"Transfer details",className:a$1("",a$2==null?void 0:a$2.detailPanel,d),children:[jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxs("h3",{className:"ndpr-section-heading",children:[e.destinationCountry," \u2014 ",e.recipientOrganization]}),jsxs("div",{className:"flex gap-2",children:[Y(e.status),H(e.riskLevel)]})]}),!l.isValid&&jsxs("div",{className:"ndpr-alert ndpr-alert--destructive",children:[jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-1",children:"Compliance Issues"}),jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-destructive",children:l.errors.map((s,m)=>jsx("li",{children:s},m))})]}),l.warnings.length>0&&jsxs("div",{className:"ndpr-alert ndpr-alert--warning",children:[jsx("p",{className:"text-sm font-medium ndpr-text-warning mb-1",children:"Warnings"}),jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-warning",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:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Destination:"})," ",e.destinationCountry,e.destinationCountryCode?` (${e.destinationCountryCode})`:""]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Adequacy:"})," ",(c=G.find(s=>s.value===e.adequacyStatus))==null?void 0:c.label]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Frequency:"})," ",(g$1=J.find(s=>s.value===e.frequency))==null?void 0:g$1.label]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Start Date:"})," ",A(e.startDate)]}),e.endDate&&jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"End Date:"})," ",A(e.endDate)]}),e.reviewDate&&jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Next Review:"})," ",A(e.reviewDate)]})]}),jsxs("div",{children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Recipient:"})," ",e.recipientOrganization]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Contact:"})," ",e.recipientContact.name," (",e.recipientContact.email,")"]}),e.estimatedDataSubjects&&jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Data Subjects:"})," ",e.estimatedDataSubjects.toLocaleString()]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Sensitive Data:"})," ",e.includesSensitiveData?"Yes":"No"]})]})]}),jsxs("div",{className:"ndpr-form-field",children:[jsx("p",{className:"ndpr-form-field__label",children:"Transfer Mechanism"}),jsx("div",{className:"ndpr-panel",children:jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200",children:f(e.transferMechanism)})})]}),jsxs("div",{className:"ndpr-form-field",children:[jsx("p",{className:"ndpr-form-field__label",children:"Purpose"}),jsx("p",{className:"text-sm ndpr-text-muted bg-gray-50 dark:bg-gray-700 p-2 rounded-md",children:e.purpose})]}),jsxs("div",{className:"ndpr-form-field",children:[jsx("p",{className:"ndpr-form-field__label",children:"Data Categories"}),jsx("div",{className:"flex flex-wrap gap-1",children:e.dataCategories.map((s,m)=>jsx("span",{className:"px-2 py-1 bg-gray-100 dark:bg-gray-600 rounded text-xs",children:s},m))})]}),jsxs("div",{className:"ndpr-form-field",children:[jsx("p",{className:"ndpr-form-field__label",children:"Safeguards"}),jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-muted",children:e.safeguards.map((s,m)=>jsx("li",{children:s},m))})]}),jsxs("div",{className:"ndpr-form-field",children:[jsx("p",{className:"ndpr-form-field__label",children:"Risk Assessment"}),jsxs("div",{className:"ndpr-panel",children:[jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200 mb-2",children:e.riskAssessment}),jsxs("div",{className:"mt-2",role:"status","aria-label":"Automated risk assessment result",children:[jsxs("p",{className:"text-xs font-medium ndpr-text-muted mb-1",children:["Automated Assessment (Score: ",r.riskScore,")"]}),r.factors.length>0&&jsx("ul",{className:"list-disc list-inside text-xs ndpr-text-muted",children:r.factors.map((s,m)=>jsx("li",{children:s},m))}),r.recommendations.length>0&&jsxs("div",{className:"mt-2",children:[jsx("p",{className:"text-xs font-medium ndpr-text-muted mb-1",children:"Recommendations:"}),jsx("ul",{className:"list-disc list-inside text-xs ndpr-text-muted",children:r.recommendations.map((s,m)=>jsx("li",{children:s},m))})]})]})]})]}),e.ndpcApproval&&jsxs("div",{className:"ndpr-form-field",children:[jsx("p",{className:"ndpr-form-field__label",children:"NDPC Approval"}),jsxs("div",{className:a$1(`p-3 rounded-md ${e.ndpcApproval.approved?"ndpr-alert ndpr-alert--success":e.ndpcApproval.applied?"ndpr-alert ndpr-alert--warning":"ndpr-alert ndpr-alert--destructive"}`,a$2==null?void 0:a$2.approvalStatus,d),children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Status:"})," ",e.ndpcApproval.approved?"Approved":e.ndpcApproval.applied?"Application Submitted":"Not Applied"]}),e.ndpcApproval.referenceNumber&&jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Reference:"})," ",e.ndpcApproval.referenceNumber]}),e.ndpcApproval.appliedAt&&jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Applied:"})," ",A(e.ndpcApproval.appliedAt)]}),e.ndpcApproval.approvedAt&&jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Approved:"})," ",A(e.ndpcApproval.approvedAt)]})]})]}),jsxs("div",{className:"ndpr-form-field",children:[jsx("p",{className:"ndpr-form-field__label",children:"Transfer Impact Assessment"}),jsxs("div",{className:`p-3 rounded-md ${e.tiaCompleted?"ndpr-alert ndpr-alert--success":"ndpr-alert ndpr-alert--warning"}`,children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Status:"})," ",e.tiaCompleted?"Completed":"Not Completed"]}),e.tiaReference&&jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Reference:"})," ",e.tiaReference]})]})]}),jsxs("div",{className:"flex gap-3 mt-6",children:[jsx("button",{onClick:()=>le(e),"aria-label":`Edit transfer to ${e.destinationCountry}`,className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${M}`,children:"Edit"}),jsx("button",{onClick:()=>se(e.id),"aria-label":`Remove transfer to ${e.destinationCountry}`,className:"px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700",children:"Remove"})]})]})};return jsxs("div",{className:a$1(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${ae}`,a$2==null?void 0:a$2.root,d),children:[jsx("h2",{className:a$1("ndpr-section-heading",a$2==null?void 0:a$2.title,d),children:ee}),jsx("p",{className:"ndpr-card__subtitle",children:te}),re&&ue(),!j&&jsx("div",{className:"mb-6",children:jsx("button",{onClick:pe,className:a$1(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${M}`,(a$2==null?void 0:a$2.primaryButton)||(a$2==null?void 0:a$2.submitButton),d),children:"Add Transfer"})}),j&&me(),jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"cbStatusFilter",className:"ndpr-form-field__label",children:"Status Filter"}),jsxs("select",{id:"cbStatusFilter",value:k,onChange:e=>ne(e.target.value),"aria-label":"Filter transfers by status",className:a$1("ndpr-form-field__input",a$2==null?void 0:a$2.select,d),children:[jsx("option",{value:"all",children:"All Statuses"}),X.map(e=>jsx("option",{value:e.value,children:e.label},e.value))]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cbMechanismFilter",className:"ndpr-form-field__label",children:"Mechanism Filter"}),jsxs("select",{id:"cbMechanismFilter",value:T,onChange:e=>de(e.target.value),"aria-label":"Filter transfers by mechanism",className:a$1("ndpr-form-field__input",a$2==null?void 0:a$2.select,d),children:[jsx("option",{value:"all",children:"All Mechanisms"}),I.map(e=>jsx("option",{value:e.value,children:e.label},e.value))]})]})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[jsxs("div",{className:"md:col-span-1",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Transfers"}),x.length===0?jsx("p",{className:"ndpr-card__subtitle",children:"No cross-border transfers found."}):jsx("div",{className:a$1("space-y-2 max-h-96 overflow-y-auto pr-2",a$2==null?void 0:a$2.transferList,d),children:x.map(e=>{var r,l;return jsxs("div",{className:a$1(`p-3 rounded-md cursor-pointer ${f$1===e.id?"ndpr-alert ndpr-alert--info":"ndpr-panel"}`,a$2==null?void 0:a$2.transferItem,d),role:"button",tabIndex:0,"aria-label":`View transfer to ${e.destinationCountry}`,onClick:()=>y(e.id),onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),y(e.id));},children:[jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsx("h4",{className:"font-medium text-sm",children:e.destinationCountry}),H(e.riskLevel)]}),jsx("p",{className:"text-xs ndpr-text-muted mb-1",children:e.recipientOrganization}),jsx("p",{className:"text-xs ndpr-text-muted mb-1",children:ce(e.transferMechanism)}),jsxs("div",{className:"flex justify-between items-center mt-2",children:[Y(e.status),((r=e.ndpcApproval)==null?void 0:r.required)&&!((l=e.ndpcApproval)!=null&&l.approved)&&jsx("span",{className:"text-xs ndpr-text-info",children:"NDPC Pending"})]})]},e.id)})})]}),jsx("div",{className:"md:col-span-2",children:$?ve($):jsx("div",{className:"ndpr-empty-state",children:jsx("p",{className:"ndpr-card__subtitle",children:"Select a transfer to view details"})})})]})]})};export{xe as a};//# sourceMappingURL=chunk-SYMQJO2W.mjs.map
|
|
7
|
+
//# sourceMappingURL=chunk-SYMQJO2W.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import {a}from'./chunk-AYKLAEOU.mjs';import I,{useMemo}from'react';import {jsxs,jsx}from'react/jsx-runtime';var B=({result:a$1,sections:m,showFullReport:g=true,allowPrint:u=true,allowExport:v=true,onExport:f,className:N="",buttonClassName:x="",classNames:b={},unstyled:y=false})=>{let o=useMemo(()=>new Date().toLocaleDateString(),[]),d=(r,s)=>{let i=s?b[s]:void 0;return !i&&s==="printButton"&&(i=b.primaryButton),a(r,i,y)},l=r=>new Date(r).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),w=r=>{let s=a$1.answers[r];return s==null?"Not answered":typeof s=="boolean"?s?"Yes":"No":Array.isArray(s)?s.join(", "):String(s)},k=()=>{window.print();},C=r=>{f&&f(r);},R=r=>jsx("span",{className:d(`px-2 py-1 rounded text-xs font-medium ${{low:"ndpr-badge ndpr-badge--success",medium:"ndpr-badge ndpr-badge--warning",high:"ndpr-badge ndpr-badge--warning",critical:"ndpr-badge ndpr-badge--destructive"}[r]}`,"riskBadge"),children:r.charAt(0).toUpperCase()+r.slice(1)});return jsxs("div",{"data-ndpr-component":"dpia-report",className:`${d("bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 print:shadow-none print:p-0","root")} ${N}`,children:[jsxs("div",{className:d("mb-8 border-b border-gray-200 dark:border-gray-700 pb-6 print:pb-4","header"),children:[jsxs("div",{className:"flex justify-between items-start",children:[jsxs("div",{children:[jsx("h1",{className:d("ndpr-card__title","title"),children:"Data Protection Impact Assessment Report"}),jsx("h2",{className:"text-xl ndpr-text-muted mb-4",children:a$1.title})]}),(u||v)&&jsxs("div",{className:"flex space-x-2 print:hidden",children:[u&&jsx("button",{onClick:k,className:`${d("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")} ${x}`,children:jsxs("span",{className:"flex items-center",children:[jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"})}),"Print"]})}),v&&jsx("div",{className:"relative inline-block",children:jsx("button",{onClick:()=>C("pdf"),className:`px-3 py-1 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${x}`,children:jsxs("span",{className:"flex items-center",children:[jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Export PDF"]})})})]})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4",children:[jsxs("div",{children:[jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Assessor:"})," ",a$1.assessor.name,", ",a$1.assessor.role]}),jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Contact:"})," ",a$1.assessor.email]})]}),jsxs("div",{children:[jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Started:"})," ",l(a$1.startedAt)]}),jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Completed:"})," ",a$1.completedAt?l(a$1.completedAt):"In progress"]}),jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Next review:"})," ",a$1.reviewDate?l(a$1.reviewDate):"Not scheduled"]})]})]})]}),jsxs("div",{className:d("mb-8","summary"),children:[jsx("h2",{className:"ndpr-section-heading",children:"Executive Summary"}),jsxs("div",{className:"ndpr-panel",children:[jsxs("div",{className:"flex items-center mb-2",role:"status","aria-live":"polite",children:[jsx("span",{className:"font-medium mr-2",children:"Overall Risk Level:"}),R(a$1.overallRiskLevel)]}),jsxs("div",{className:d("mb-2","conclusion"),children:[jsx("span",{className:"font-medium",children:"Conclusion:"})," ",a$1.conclusion]}),jsxs("div",{role:"status","aria-live":"polite",children:[jsx("span",{className:"font-medium",children:"Can Proceed:"})," ",a$1.canProceed?"Yes":"No"]})]}),jsxs("div",{children:[jsx("h3",{className:"font-medium ndpr-text-foreground mb-2",children:"Processing Activity Description"}),jsx("p",{className:"ndpr-text-muted mb-4",children:a$1.processingDescription}),a$1.recommendations&&a$1.recommendations.length>0&&jsxs("div",{children:[jsx("h3",{className:"font-medium ndpr-text-foreground mb-2",children:"Key Recommendations"}),jsx("ul",{className:"list-disc pl-5 ndpr-text-muted",children:a$1.recommendations.map((r,s)=>jsx("li",{className:d("","recommendation"),children:r},s))})]})]})]}),jsxs("div",{className:"mb-8",children:[jsx("h2",{className:"ndpr-section-heading",children:"Identified Risks"}),a$1.risks.length===0?jsx("p",{className:"ndpr-text-muted",children:"No risks identified."}):jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:d("min-w-full divide-y divide-gray-200 dark:divide-gray-700","riskTable"),children:[jsx("thead",{className:"ndpr-panel",children:jsxs("tr",{children:[jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Risk"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Likelihood"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Impact"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Risk Level"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Mitigated"})]})}),jsx("tbody",{className:"ndpr-table",children:a$1.risks.map(r=>jsxs("tr",{className:d("","riskRow"),children:[jsx("td",{className:"ndpr-table__cell",children:r.description}),jsxs("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:[r.likelihood," / 5"]}),jsxs("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:[r.impact," / 5"]}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm",children:R(r.level)}),jsx("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:r.mitigated?jsx("span",{className:"ndpr-text-success",children:"Yes"}):jsx("span",{className:"ndpr-text-destructive",children:"No"})})]},r.id))})]})})]}),g&&jsxs("div",{children:[jsx("h2",{className:"ndpr-section-heading",children:"Full Assessment Details"}),m.map(r=>{let s=r.questions.filter(i=>a$1.answers[i.id]!==void 0);return s.length===0?null:jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-medium ndpr-text-foreground mb-2",children:r.title}),jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[jsx("thead",{className:"ndpr-panel",children:jsxs("tr",{children:[jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Question"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Answer"})]})}),jsx("tbody",{className:"ndpr-table",children:s.map(i=>jsxs("tr",{children:[jsx("td",{className:"ndpr-table__cell",children:i.text}),jsx("td",{className:"px-6 py-4 whitespace-normal text-sm ndpr-text-muted",children:w(i.id)})]},i.id))})]})})]},r.id)})]}),jsxs("div",{className:"mt-8 pt-4 border-t border-gray-200 dark:border-gray-700 text-sm ndpr-text-muted",children:[jsx("p",{children:"This DPIA was conducted in accordance with the Nigeria Data Protection Act (NDPA) 2023."}),jsxs("p",{children:["DPIA Report Version: ",a$1.version]}),jsxs("p",{children:["Generated on: ",o]})]})]})};var M=({steps:a$1,onStepClick:m,clickable:g=true,orientation:u="horizontal",className:v="",activeStepClassName:f="",completedStepClassName:N="",incompleteStepClassName:x="",classNames:b={},unstyled:y=false})=>{let o=(n,p)=>a(n,p?b[p]:void 0,y),d=n=>{g&&m&&m(n);},l=u==="vertical";return jsx("div",{"data-ndpr-component":"dpia-step-indicator",role:"navigation","aria-label":"Step progress",className:`${o(l?"flex flex-col space-y-4":"flex items-center justify-between","root")} ${v}`,children:a$1.map((n,p)=>{let w=p===a$1.length-1,k=n.active?o(`font-medium ${f||"ndpr-text-primary"}`,"label"):n.completed?o(N||"ndpr-text-success","label"):o(x||"ndpr-card__subtitle","label"),C=n.active?o("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)] ndpr-text-primary border-2 border-[rgb(var(--ndpr-primary))] dark:border-[rgb(var(--ndpr-primary))]","stepActive"):n.completed?o("flex items-center justify-center w-8 h-8 rounded-full bg-green-100 dark:bg-green-900 ndpr-text-success border-2 border-green-600 dark:border-green-400","stepCompleted"):o("flex items-center justify-center w-8 h-8 rounded-full bg-gray-100 dark:bg-gray-700 ndpr-text-muted border-2 border-gray-300 dark:border-gray-600","stepPending");return jsxs(I.Fragment,{children:[jsxs("div",{className:o(`${l?"flex items-start":"flex flex-col items-center"} ${g?"cursor-pointer":""}`,"step"),onClick:()=>d(n.id),"aria-current":n.active?"step":void 0,children:[jsx("div",{className:`
|
|
2
|
+
flex items-center justify-center
|
|
3
|
+
${l?"mr-4":""}
|
|
4
|
+
`,children:jsx("div",{className:C,children:n.icon?n.icon:n.completed?jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}):jsx("span",{children:p+1})})}),jsxs("div",{className:`
|
|
5
|
+
${l?"flex-1":"mt-2 text-center"}
|
|
6
|
+
`,children:[jsx("div",{className:`text-sm font-medium ${k}`,children:n.label}),n.description&&jsx("div",{className:"ndpr-form-field__hint",children:n.description})]})]}),!w&&jsx("div",{className:o(l?"ml-4 h-8 border-l-2 border-gray-300 dark:border-gray-600":"w-full border-t-2 border-gray-300 dark:border-gray-600 hidden sm:block","connector")})]},n.id)})})};export{B as a,M as b};//# sourceMappingURL=chunk-TCN22KYP.mjs.map
|
|
7
|
+
//# sourceMappingURL=chunk-TCN22KYP.mjs.map
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
'use strict';var chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js');function x(o){return o.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function k(o){return o.toLowerCase().replace(/[^a-z0-9\s-]/g,"").trim().replace(/\s+/g,"-")}function I(o){let l=o.split(`
|
|
2
|
+
`),s=[],e=false;for(let r of l){let n=r.trimEnd();n.startsWith("- ")||n.startsWith("\u2022 ")?(e||(s.push("<ul>"),e=true),s.push(` <li>${x(n.replace(/^[-•]\s*/,""))}</li>`)):(e&&(s.push("</ul>"),e=false),n.trim()===""||s.push(`<p>${x(n)}</p>`));}return e&&s.push("</ul>"),s.join(`
|
|
3
|
+
`)}var A=`
|
|
4
|
+
/* \u2500\u2500 Reset & Base \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
5
|
+
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
|
6
|
+
|
|
7
|
+
/* \u2500\u2500 Design tokens \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
8
|
+
:root {
|
|
9
|
+
--color-bg: #ffffff;
|
|
10
|
+
--color-surface: #f9fafb;
|
|
11
|
+
--color-border: #e5e7eb;
|
|
12
|
+
--color-text: #111827;
|
|
13
|
+
--color-text-muted: #6b7280;
|
|
14
|
+
--color-accent: #16a34a;
|
|
15
|
+
--color-accent-light: #dcfce7;
|
|
16
|
+
--color-heading: #064e3b;
|
|
17
|
+
--color-link: #15803d;
|
|
18
|
+
--color-link-hover: #166534;
|
|
19
|
+
--font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
20
|
+
--font-mono: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, monospace;
|
|
21
|
+
--radius: 8px;
|
|
22
|
+
--shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
|
|
23
|
+
--max-width: 860px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@media (prefers-color-scheme: dark) {
|
|
27
|
+
:root {
|
|
28
|
+
--color-bg: #0f172a;
|
|
29
|
+
--color-surface: #1e293b;
|
|
30
|
+
--color-border: #334155;
|
|
31
|
+
--color-text: #f1f5f9;
|
|
32
|
+
--color-text-muted: #94a3b8;
|
|
33
|
+
--color-accent: #22c55e;
|
|
34
|
+
--color-accent-light: #14532d;
|
|
35
|
+
--color-heading: #86efac;
|
|
36
|
+
--color-link: #4ade80;
|
|
37
|
+
--color-link-hover: #86efac;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* \u2500\u2500 Layout \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
42
|
+
html { font-size: 16px; scroll-behavior: smooth; }
|
|
43
|
+
|
|
44
|
+
body {
|
|
45
|
+
font-family: var(--font-sans);
|
|
46
|
+
background: var(--color-bg);
|
|
47
|
+
color: var(--color-text);
|
|
48
|
+
line-height: 1.7;
|
|
49
|
+
padding: 2rem 1.25rem;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.policy-wrapper {
|
|
53
|
+
max-width: var(--max-width);
|
|
54
|
+
margin: 0 auto;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* \u2500\u2500 Header \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
58
|
+
.policy-header {
|
|
59
|
+
background: var(--color-surface);
|
|
60
|
+
border: 1px solid var(--color-border);
|
|
61
|
+
border-radius: var(--radius);
|
|
62
|
+
padding: 2.5rem 2.5rem 2rem;
|
|
63
|
+
margin-bottom: 2rem;
|
|
64
|
+
box-shadow: var(--shadow);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.policy-header h1 {
|
|
68
|
+
font-size: 2rem;
|
|
69
|
+
font-weight: 700;
|
|
70
|
+
color: var(--color-heading);
|
|
71
|
+
line-height: 1.2;
|
|
72
|
+
margin-bottom: 0.75rem;
|
|
73
|
+
letter-spacing: -0.025em;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.policy-meta {
|
|
77
|
+
display: flex;
|
|
78
|
+
flex-wrap: wrap;
|
|
79
|
+
gap: 0.5rem 1.5rem;
|
|
80
|
+
font-size: 0.875rem;
|
|
81
|
+
color: var(--color-text-muted);
|
|
82
|
+
margin-top: 0.5rem;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.policy-meta span { white-space: nowrap; }
|
|
86
|
+
|
|
87
|
+
.compliance-badge {
|
|
88
|
+
display: inline-flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
gap: 0.35rem;
|
|
91
|
+
background: var(--color-accent-light);
|
|
92
|
+
color: var(--color-accent);
|
|
93
|
+
font-size: 0.75rem;
|
|
94
|
+
font-weight: 600;
|
|
95
|
+
padding: 0.25rem 0.75rem;
|
|
96
|
+
border-radius: 9999px;
|
|
97
|
+
margin-top: 1rem;
|
|
98
|
+
letter-spacing: 0.01em;
|
|
99
|
+
border: 1px solid var(--color-accent);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* \u2500\u2500 Navigation / TOC \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
103
|
+
.policy-toc {
|
|
104
|
+
background: var(--color-surface);
|
|
105
|
+
border: 1px solid var(--color-border);
|
|
106
|
+
border-left: 4px solid var(--color-accent);
|
|
107
|
+
border-radius: var(--radius);
|
|
108
|
+
padding: 1.5rem 2rem;
|
|
109
|
+
margin-bottom: 2.5rem;
|
|
110
|
+
box-shadow: var(--shadow);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.policy-toc h2 {
|
|
114
|
+
font-size: 1rem;
|
|
115
|
+
font-weight: 700;
|
|
116
|
+
text-transform: uppercase;
|
|
117
|
+
letter-spacing: 0.08em;
|
|
118
|
+
color: var(--color-text-muted);
|
|
119
|
+
margin-bottom: 1rem;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.policy-toc ol {
|
|
123
|
+
list-style: decimal;
|
|
124
|
+
padding-left: 1.25rem;
|
|
125
|
+
column-count: 1;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
@media (min-width: 600px) {
|
|
129
|
+
.policy-toc ol { column-count: 2; column-gap: 2rem; }
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.policy-toc li { margin-bottom: 0.35rem; break-inside: avoid; }
|
|
133
|
+
|
|
134
|
+
.policy-toc a {
|
|
135
|
+
color: var(--color-link);
|
|
136
|
+
text-decoration: none;
|
|
137
|
+
font-size: 0.9375rem;
|
|
138
|
+
transition: color 0.15s ease;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.policy-toc a:hover { color: var(--color-link-hover); text-decoration: underline; }
|
|
142
|
+
|
|
143
|
+
/* \u2500\u2500 Article / Sections \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
144
|
+
article.policy-body { display: flex; flex-direction: column; gap: 2.5rem; }
|
|
145
|
+
|
|
146
|
+
.policy-section {
|
|
147
|
+
background: var(--color-surface);
|
|
148
|
+
border: 1px solid var(--color-border);
|
|
149
|
+
border-radius: var(--radius);
|
|
150
|
+
padding: 2rem 2.5rem;
|
|
151
|
+
box-shadow: var(--shadow);
|
|
152
|
+
scroll-margin-top: 1.5rem;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.policy-section h2 {
|
|
156
|
+
font-size: 1.25rem;
|
|
157
|
+
font-weight: 700;
|
|
158
|
+
color: var(--color-heading);
|
|
159
|
+
margin-bottom: 1.25rem;
|
|
160
|
+
padding-bottom: 0.75rem;
|
|
161
|
+
border-bottom: 2px solid var(--color-accent-light);
|
|
162
|
+
display: flex;
|
|
163
|
+
align-items: baseline;
|
|
164
|
+
gap: 0.5rem;
|
|
165
|
+
line-height: 1.3;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.section-number {
|
|
169
|
+
font-size: 0.75rem;
|
|
170
|
+
font-weight: 700;
|
|
171
|
+
background: var(--color-accent);
|
|
172
|
+
color: #fff;
|
|
173
|
+
width: 1.5rem;
|
|
174
|
+
height: 1.5rem;
|
|
175
|
+
display: inline-flex;
|
|
176
|
+
align-items: center;
|
|
177
|
+
justify-content: center;
|
|
178
|
+
border-radius: 50%;
|
|
179
|
+
flex-shrink: 0;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.policy-section p {
|
|
183
|
+
margin-bottom: 0.875rem;
|
|
184
|
+
font-size: 0.9375rem;
|
|
185
|
+
color: var(--color-text);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.policy-section p:last-child { margin-bottom: 0; }
|
|
189
|
+
|
|
190
|
+
.policy-section ul {
|
|
191
|
+
margin: 0.75rem 0 0.875rem 1.5rem;
|
|
192
|
+
display: flex;
|
|
193
|
+
flex-direction: column;
|
|
194
|
+
gap: 0.35rem;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.policy-section ul li {
|
|
198
|
+
font-size: 0.9375rem;
|
|
199
|
+
color: var(--color-text);
|
|
200
|
+
position: relative;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.policy-section ul li::marker { color: var(--color-accent); }
|
|
204
|
+
|
|
205
|
+
/* \u2500\u2500 Footer \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
206
|
+
.policy-footer {
|
|
207
|
+
margin-top: 3rem;
|
|
208
|
+
padding: 1.5rem 2rem;
|
|
209
|
+
border-top: 1px solid var(--color-border);
|
|
210
|
+
text-align: center;
|
|
211
|
+
font-size: 0.8125rem;
|
|
212
|
+
color: var(--color-text-muted);
|
|
213
|
+
display: flex;
|
|
214
|
+
flex-direction: column;
|
|
215
|
+
gap: 0.35rem;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.policy-footer a { color: var(--color-link); text-decoration: none; }
|
|
219
|
+
.policy-footer a:hover { text-decoration: underline; }
|
|
220
|
+
|
|
221
|
+
/* \u2500\u2500 Print styles \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
222
|
+
@media print {
|
|
223
|
+
:root {
|
|
224
|
+
--color-bg: #fff;
|
|
225
|
+
--color-surface: #fff;
|
|
226
|
+
--color-border: #d1d5db;
|
|
227
|
+
--color-text: #000;
|
|
228
|
+
--color-text-muted: #374151;
|
|
229
|
+
--color-accent: #16a34a;
|
|
230
|
+
--color-accent-light: #f0fdf4;
|
|
231
|
+
--color-heading: #064e3b;
|
|
232
|
+
--color-link: #15803d;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
body { padding: 0; font-size: 10pt; }
|
|
236
|
+
.policy-wrapper { max-width: 100%; }
|
|
237
|
+
|
|
238
|
+
.policy-toc { break-inside: avoid; }
|
|
239
|
+
.policy-section { break-inside: avoid; box-shadow: none; border: 1px solid #d1d5db; }
|
|
240
|
+
|
|
241
|
+
.policy-toc ol { column-count: 2; }
|
|
242
|
+
.policy-footer { border-top: 1px solid #d1d5db; }
|
|
243
|
+
|
|
244
|
+
a { color: inherit; text-decoration: none; }
|
|
245
|
+
}
|
|
246
|
+
`.trim();function O(o,l){var $;let s=(l==null?void 0:l.includeStyles)!==false,e=($=l==null?void 0:l.customCSS)!=null?$:"",r=o.sections.filter(a=>a.included),n=x(o.organizationInfo.name||"Organisation"),t=x(o.title||"Privacy Policy"),d=x(o.version||"1.0"),i=o.effectiveDate?new Date(o.effectiveDate).toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}):new Date().toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}),p=o.lastUpdated?new Date(o.lastUpdated).toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}):i,y=o.organizationInfo.website?`<a href="${x(o.organizationInfo.website)}" target="_blank" rel="noopener">${x(o.organizationInfo.website)}</a>`:"",h=o.organizationInfo.privacyEmail?`<a href="mailto:${x(o.organizationInfo.privacyEmail)}">${x(o.organizationInfo.privacyEmail)}</a>`:"",z=`
|
|
247
|
+
<nav class="policy-toc" aria-label="Table of Contents">
|
|
248
|
+
<h2>Table of Contents</h2>
|
|
249
|
+
<ol>
|
|
250
|
+
${r.map((a,f)=>` <li><a href="#${k(a.title)}">${x(a.title)}</a></li>`).join(`
|
|
251
|
+
`)}
|
|
252
|
+
</ol>
|
|
253
|
+
</nav>`,P=r.map((a,f)=>{let c=k(a.title),w=a.template||a.defaultContent||"",m=I(w);return ` <section class="policy-section" id="${c}" aria-labelledby="section-heading-${c}">
|
|
254
|
+
<h2 id="section-heading-${c}">
|
|
255
|
+
<span class="section-number" aria-hidden="true">${f+1}</span>
|
|
256
|
+
${x(a.title)}
|
|
257
|
+
</h2>
|
|
258
|
+
${m}
|
|
259
|
+
</section>`}).join(`
|
|
260
|
+
|
|
261
|
+
`),u=e?e.replace(/<\/style>/gi,""):"",D=s?`<style>
|
|
262
|
+
${A}
|
|
263
|
+
${u?`
|
|
264
|
+
/* \u2500\u2500 Custom styles \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
265
|
+
${u}`:""}
|
|
266
|
+
</style>`:u?`<style>${u}</style>`:"";return `<!DOCTYPE html>
|
|
267
|
+
<html lang="en">
|
|
268
|
+
<head>
|
|
269
|
+
<meta charset="UTF-8" />
|
|
270
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
271
|
+
<meta name="description" content="Privacy Policy for ${n}" />
|
|
272
|
+
<meta name="generator" content="NDPA Toolkit" />
|
|
273
|
+
<title>${t} \u2014 ${n}</title>
|
|
274
|
+
${D}
|
|
275
|
+
</head>
|
|
276
|
+
<body>
|
|
277
|
+
<div class="policy-wrapper">
|
|
278
|
+
|
|
279
|
+
<header class="policy-header">
|
|
280
|
+
<h1>${t}</h1>
|
|
281
|
+
<div class="policy-meta">
|
|
282
|
+
<span><strong>Organisation:</strong> ${n}</span>
|
|
283
|
+
<span><strong>Effective:</strong> ${i}</span>
|
|
284
|
+
<span><strong>Version:</strong> ${d}</span>
|
|
285
|
+
${p!==i?`<span><strong>Last updated:</strong> ${p}</span>`:""}
|
|
286
|
+
</div>
|
|
287
|
+
<div>
|
|
288
|
+
<span class="compliance-badge" role="img" aria-label="NDPA compliant">✓ NDPA 2023 Compliant</span>
|
|
289
|
+
</div>
|
|
290
|
+
</header>
|
|
291
|
+
|
|
292
|
+
${z}
|
|
293
|
+
|
|
294
|
+
<article class="policy-body" aria-label="Policy content">
|
|
295
|
+
|
|
296
|
+
${P}
|
|
297
|
+
|
|
298
|
+
</article>
|
|
299
|
+
|
|
300
|
+
<footer class="policy-footer" role="contentinfo">
|
|
301
|
+
<div>${n}${y?` — ${y}`:""}</div>
|
|
302
|
+
${h?`<div>Privacy contact: ${h}</div>`:""}
|
|
303
|
+
<div>Effective ${i} • Version ${d}</div>
|
|
304
|
+
<div>Generated by <strong>NDPA Toolkit</strong> — Nigeria Data Protection Act 2023</div>
|
|
305
|
+
</footer>
|
|
306
|
+
|
|
307
|
+
</div>
|
|
308
|
+
</body>
|
|
309
|
+
</html>`}function H(o){return o.toLowerCase().replace(/[^a-z0-9\s-]/g,"").trim().replace(/\s+/g,"-")}function W(o){let l=o.sections.filter(d=>d.included),s=o.title||"Privacy Policy",e=o.organizationInfo.name||"Organisation",r=o.version||"1.0",n=o.effectiveDate?new Date(o.effectiveDate).toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}):new Date().toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}),t=[];return t.push(`# ${s}`),t.push(""),t.push(`_Effective: ${n} | Version: ${r} | ${e}_`),t.push(""),o.organizationInfo.website&&t.push(`**Website:** ${o.organizationInfo.website} `),o.organizationInfo.privacyEmail&&t.push(`**Privacy contact:** ${o.organizationInfo.privacyEmail} `),(o.organizationInfo.website||o.organizationInfo.privacyEmail)&&t.push(""),t.push("> This privacy policy is compliant with the **Nigeria Data Protection Act (NDPA) 2023**."),t.push(""),t.push("---"),t.push(""),l.length>0&&(t.push("## Table of Contents"),t.push(""),l.forEach((d,i)=>{let p=H(`${i+1} ${d.title}`);t.push(`${i+1}. [${d.title}](#${p})`);}),t.push(""),t.push("---"),t.push("")),l.forEach((d,i)=>{t.push(`## ${i+1}. ${d.title}`),t.push("");let p=(d.template||d.defaultContent||"").trim();if(p){let y=p.split(`
|
|
310
|
+
`);for(let h of y){let v=h.trimEnd();v.startsWith("-")||v.startsWith("\u2022")||v===""?t.push(v.replace(/^•/,"-")):t.push(v);}}t.push(""),t.push("---"),t.push("");}),t.push(`_Generated by **NDPA Toolkit** \u2014 ${e} \u2022 Version ${r}_`),t.push(""),t.join(`
|
|
311
|
+
`)}function B(o,l){return chunkMQFZHA2D_js.d(this,null,function*(){var $;let s;try{let a=yield import('jspdf');s=($=a.jsPDF)!=null?$:a.default;}catch(a){throw new Error(`[ndpr-toolkit] PDF export requires the "jspdf" package. Install it with:
|
|
312
|
+
pnpm add jspdf
|
|
313
|
+
See: https://ndprtoolkit.com.ng/docs/guides/styling-customization`)}let e=new s({unit:"mm",format:"a4"}),r=e.internal.pageSize.getWidth(),n=e.internal.pageSize.getHeight(),t=20,d=r-t*2,i=t,p=o.organizationInfo.name||"",y=o.title||"Privacy Policy",h=o.version||"1.0",v=o.effectiveDate?new Date(o.effectiveDate).toLocaleDateString():new Date().toLocaleDateString(),z=()=>{e.setFontSize(8),e.setFont("helvetica","italic"),e.setTextColor(150,150,150),e.text(p?`${p} \u2014 ${y}`:y,t,12),e.setDrawColor(220,220,220),e.setLineWidth(.3),e.line(t,14,r-t,14),e.setTextColor(0,0,0);},P=a=>{i+a>n-t-10&&(e.addPage(),i=t+8,z());};if((l==null?void 0:l.includeCoverPage)!==false){e.setFillColor(22,163,74),e.rect(0,0,r,12,"F"),e.setFontSize(28),e.setFont("helvetica","bold"),e.setTextColor(22,163,74);let a=e.splitTextToSize(y,d-10),f=72;a.forEach(w=>{e.text(w,r/2,f,{align:"center"}),f+=11;}),e.setDrawColor(22,163,74),e.setLineWidth(.6);let c=f+6;if(e.line(r/2-30,c,r/2+30,c),e.setFontSize(14),e.setFont("helvetica","normal"),e.setTextColor(40,40,40),e.text(p,r/2,c+14,{align:"center"}),e.setFontSize(10),e.setTextColor(100,100,100),e.text(`Effective Date: ${v}`,r/2,c+26,{align:"center"}),e.text(`Version ${h}`,r/2,c+34,{align:"center"}),(l==null?void 0:l.includeComplianceBadge)!==false){let w=c+52,m="Compliant with the Nigeria Data Protection Act (NDPA) 2023";e.setFontSize(8.5),e.setFont("helvetica","bold"),e.setTextColor(255,255,255);let g=e.getTextWidth(m),b=7,T=3.5,S=(r-g-b*2)/2;e.setFillColor(22,163,74),e.roundedRect(S,w-T-1,g+b*2,7+T,2,2,"F"),e.text(m,r/2,w+1.5,{align:"center"}),e.setTextColor(0,0,0);}e.setFillColor(22,163,74),e.rect(0,n-12,r,12,"F"),e.addPage(),i=t+8,z();}let u=o.sections.filter(a=>a.included);(l==null?void 0:l.includeTOC)!==false&&(e.setFontSize(18),e.setFont("helvetica","bold"),e.setTextColor(22,163,74),e.text("Table of Contents",t,i+4),e.setDrawColor(22,163,74),e.setLineWidth(.5),e.line(t,i+8,t+80,i+8),i+=18,e.setFontSize(10.5),e.setFont("helvetica","normal"),e.setTextColor(40,40,40),u.forEach((a,f)=>{P(7);let c=`${f+1}. ${a.title}`;e.text(c,t+4,i),i+=6.5;}),e.addPage(),i=t+8,z()),u.forEach((a,f)=>{P(18),e.setFillColor(22,163,74),e.circle(t+3.5,i-1.5,3.8,"F"),e.setFontSize(8),e.setFont("helvetica","bold"),e.setTextColor(255,255,255),e.text(String(f+1),t+3.5,i-.5,{align:"center"}),e.setFontSize(13),e.setFont("helvetica","bold"),e.setTextColor(22,163,74),e.text(a.title,t+11,i),i+=3,e.setDrawColor(200,200,200),e.setLineWidth(.25),e.line(t+11,i,r-t,i),i+=6;let c=(a.template||a.defaultContent||"").trim();if(c){let w=c.split(`
|
|
314
|
+
`);e.setFontSize(9.5),e.setFont("helvetica","normal"),e.setTextColor(50,50,50),w.forEach(m=>{let g=m.trimEnd();if(g===""){i+=3;return}let b=g.startsWith("-")||g.startsWith("\u2022"),T=b?t+8:t+4,S=b?g.replace(/^[-•]\s*/,""):g,C=d-(b?12:8);e.splitTextToSize(S,C).forEach((E,L)=>{P(5),b&&L===0&&(e.setFillColor(22,163,74),e.circle(t+4,i-1,.9,"F")),e.text(E,T,i),i+=5;});});}i+=10;});let D=e.getNumberOfPages();for(let a=1;a<=D;a++)e.setPage(a),e.setFontSize(7.5),e.setFont("helvetica","normal"),e.setTextColor(160,160,160),e.setDrawColor(220,220,220),e.setLineWidth(.3),e.line(t,n-12,r-t,n-12),e.text(p?`${p} \u2014 Privacy Policy`:"Privacy Policy",t,n-8),e.text(`Page ${a} of ${D}`,r-t,n-8,{align:"right"}),e.setTextColor(0,0,0);return e.setProperties({title:y,author:p,subject:"Privacy Policy \u2014 NDPA 2023 Compliant",keywords:"privacy policy, NDPA, Nigeria, data protection"}),e.output("blob")})}function G(o,l){return chunkMQFZHA2D_js.d(this,null,function*(){let s;try{s=yield import('docx');}catch(m){throw new Error(`[ndpr-toolkit] Word export requires the "docx" package. Install it with:
|
|
315
|
+
pnpm add docx
|
|
316
|
+
See: https://ndprtoolkit.com.ng/docs/guides/styling-customization`)}let{Document:e,Paragraph:r,TextRun:n,HeadingLevel:t,Packer:d,Header:i,Footer:p,PageNumber:y,AlignmentType:h,BorderStyle:v,ShadingType:z,TableOfContents:P}=s,u=o.organizationInfo.name||"",D=o.title||"Privacy Policy",$=o.version||"1.0",a=o.effectiveDate?new Date(o.effectiveDate).toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}):new Date().toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}),f=o.sections.filter(m=>m.included),c=[];if(c.push(new r({children:[new n({text:D,bold:true,size:52,color:"064e3b"})],heading:t.TITLE,spacing:{after:160},alignment:h.CENTER})),c.push(new r({children:[new n({text:`${u}${u?" \u2022 ":""}Version ${$} \u2022 Effective ${a}`,size:20,color:"6b7280",italics:true})],spacing:{after:120},alignment:h.CENTER})),c.push(new r({children:[new n({text:"Compliant with the Nigeria Data Protection Act (NDPA) 2023",size:18,color:"16a34a",bold:true})],spacing:{after:400},alignment:h.CENTER})),c.push(new r({children:[],spacing:{after:200},border:{bottom:{color:"16a34a",style:v.SINGLE,size:6,space:1}}})),(l==null?void 0:l.includeTOC)!==false){if(c.push(new r({children:[new n({text:"Table of Contents",bold:true,size:28,color:"064e3b"})],heading:t.HEADING_1,spacing:{before:400,after:200}})),typeof P=="function")try{c.push(new P("Table of Contents",{hyperlink:!0,headingStyleRange:"1-1"}));}catch(m){f.forEach((g,b)=>{c.push(new r({children:[new n({text:`${b+1}. ${g.title}`,size:22,color:"15803d"})],spacing:{after:80}}));});}else f.forEach((m,g)=>{c.push(new r({children:[new n({text:`${g+1}. ${m.title}`,size:22,color:"15803d"})],spacing:{after:80}}));});c.push(new r({children:[],pageBreakBefore:true}));}f.forEach((m,g)=>{c.push(new r({children:[new n({text:`${g+1}. ${m.title}`,bold:true,size:28,color:"064e3b"})],heading:t.HEADING_1,spacing:{before:400,after:200},border:{bottom:{color:"dcfce7",style:v.SINGLE,size:4,space:1}}}));let b=(m.template||m.defaultContent||"").trim();b&&b.split(`
|
|
317
|
+
`).forEach(S=>{let C=S.trimEnd();if(C===""){c.push(new r({children:[],spacing:{after:60}}));return}let F=C.startsWith("- ")||C.startsWith("\u2022 "),E=F?C.replace(/^[-•]\s*/,""):C;F?c.push(new r({children:[new n({text:E,size:22})],spacing:{after:80},bullet:{level:0}})):c.push(new r({children:[new n({text:E,size:22})],spacing:{after:100}}));});}),c.push(new r({children:[new n({text:`Generated by NDPA Toolkit \u2014 ${u}${u?" \u2014 ":""}Privacy Policy v${$}`,size:16,color:"9ca3af",italics:true})],spacing:{before:600},alignment:h.CENTER}));let w=new e({title:D,description:"Privacy Policy \u2014 NDPA 2023 Compliant",styles:{paragraphStyles:[{id:"Normal",name:"Normal",run:{font:"Calibri",size:22}}]},sections:[{headers:{default:new i({children:[new r({children:[new n({text:u||"Privacy Policy",size:16,color:"9ca3af"})],alignment:h.RIGHT})]})},footers:{default:new p({children:[new r({children:[new n({text:"Page ",size:16,color:"9ca3af"}),new n({children:[y.CURRENT],size:16,color:"9ca3af"}),new n({text:" of ",size:16,color:"9ca3af"}),new n({children:[y.TOTAL_PAGES],size:16,color:"9ca3af"})],alignment:h.CENTER})]})},children:c}]});return d.toBlob(w)})}exports.a=O;exports.b=W;exports.c=B;exports.d=G;//# sourceMappingURL=chunk-UFPSUO52.js.map
|
|
318
|
+
//# sourceMappingURL=chunk-UFPSUO52.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {b,d,a as a$1,c}from'./chunk-SHMJNRHO.mjs';import {a as a$2}from'./chunk-AYKLAEOU.mjs';import {a,b as b$1}from'./chunk-WWT2ZSNU.mjs';import {useState,useMemo,useEffect,useCallback}from'react';import {jsx,jsxs}from'react/jsx-runtime';var T=[{value:"consent",label:"Consent (Section 25(1)(a))"},{value:"contract",label:"Contract (Section 25(1)(b))"},{value:"legal_obligation",label:"Legal Obligation (Section 25(1)(c))"},{value:"vital_interests",label:"Vital Interests (Section 25(1)(d))"},{value:"public_interest",label:"Public Interest (Section 25(1)(e))"},{value:"legitimate_interests",label:"Legitimate Interests (Section 25(1)(f))"}],ee=[{value:"active",label:"Active"},{value:"inactive",label:"Inactive"},{value:"archived",label:"Archived"}],Ee=[{value:"data_subject",label:"Directly from Data Subject"},{value:"third_party",label:"Third Party"},{value:"public_source",label:"Public Source"},{value:"other",label:"Other"}];function Oe(){let l=Date.now();return {id:`proc_${l}_${Math.random().toString(36).substring(2,11)}`,name:"",description:"",controllerDetails:{name:"",contact:"",address:""},lawfulBasis:"consent",lawfulBasisJustification:"",purposes:[],dataCategories:[],dataSubjectCategories:[],recipients:[],retentionPeriod:"",securityMeasures:[],dataSource:"data_subject",dpiaRequired:false,automatedDecisionMaking:false,status:"active",createdAt:l,updatedAt:l}}function te(l){return l?new Date(l).toLocaleDateString():"N/A"}var $e=({ropa:l,onAddRecord:R,onUpdateRecord:D,onArchiveRecord:w,title:re="Record of Processing Activities (ROPA)",description:ie="Maintain a comprehensive record of all data processing activities as required by the NDPA accountability principle.",className:ae="",buttonClassName:B="",classNames:e,unstyled:n})=>{let[f,b$2]=useState("list"),[S,ne]=useState(""),[P,de]=useState("all"),[k,le]=useState("all"),[o,h]=useState(null),[U,C]=useState([]),[F,$]=useState(""),[I,H]=useState(""),[M,V]=useState(""),[L,J]=useState(""),[E,z]=useState(""),[O,G]=useState(""),[j,W]=useState(""),g=useMemo(()=>b(l),[l]),_=useMemo(()=>d(l),[l]),K=useMemo(()=>{let r=[...l.records];if(P!=="all"&&(r=r.filter(a=>a.status===P)),k!=="all"&&(r=r.filter(a=>a.lawfulBasis===k)),S){let a=S.toLowerCase();r=r.filter(p=>p.name.toLowerCase().includes(a)||p.description.toLowerCase().includes(a)||p.dataCategories.some(m=>m.toLowerCase().includes(a))||p.department&&p.department.toLowerCase().includes(a));}return r},[l.records,P,k,S]);useEffect(()=>{o&&($(o.purposes.join(", ")),H(o.dataCategories.join(", ")),V((o.sensitiveDataCategories||[]).join(", ")),J(o.dataSubjectCategories.join(", ")),z(o.recipients.join(", ")),G(o.securityMeasures.join(", ")),W((o.systemsUsed||[]).join(", ")));},[o==null?void 0:o.id]);let oe=useCallback(()=>{let r=Oe();r.controllerDetails.name=l.organizationName,r.controllerDetails.contact=l.organizationContact,r.controllerDetails.address=l.organizationAddress,l.ndpcRegistrationNumber&&(r.controllerDetails.registrationNumber=l.ndpcRegistrationNumber),l.dpoDetails&&(r.controllerDetails.dpoContact=l.dpoDetails.email),h(r),C([]),b$2("form");},[l.organizationName,l.organizationContact,l.organizationAddress,l.ndpcRegistrationNumber,l.dpoDetails]),pe=useCallback(r=>{h(a({},r)),C([]),b$2("form");},[]),v=r=>r.split(",").map(a=>a.trim()).filter(a=>a.length>0),ue=useCallback(()=>{if(!o)return;let r=b$1(a({},o),{purposes:v(F),dataCategories:v(I),sensitiveDataCategories:v(M),dataSubjectCategories:v(L),recipients:v(E),securityMeasures:v(O),systemsUsed:v(j),updatedAt:Date.now()});r.sensitiveDataCategories&&r.sensitiveDataCategories.length===0&&(r.sensitiveDataCategories=void 0),r.systemsUsed&&r.systemsUsed.length===0&&(r.systemsUsed=void 0);let a$2=a$1(r);if(!a$2.valid){C(a$2.errors);return}l.records.find(m=>m.id===r.id)?D==null||D(r.id,r):R==null||R(r),h(null),C([]),b$2("list");},[o,F,I,M,L,E,O,j,l.records,D,R]),ce=useCallback(r=>{w==null||w(r);},[w]),se=useCallback(()=>{let r=c(l),a=new Blob([r],{type:"text/csv;charset=utf-8;"}),p=URL.createObjectURL(a),m=document.createElement("a");m.href=p,m.download=`ropa_${l.organizationName.replace(/\s+/g,"_").toLowerCase()}_${new Date().toISOString().slice(0,10)}.csv`,m.click(),setTimeout(()=>URL.revokeObjectURL(p),100);},[l]),Q=useCallback(()=>{h(null),C([]),b$2("list");},[]),c$1=useCallback((r,a$1)=>{h(p=>p&&b$1(a({},p),{[r]:a$1}));},[]),q=useCallback((r,a$1)=>{h(p=>p&&b$1(a({},p),{controllerDetails:b$1(a({},p.controllerDetails),{[r]:a$1})}));},[]),ge=useCallback(r=>!!r.nextReviewDate&&r.nextReviewDate<=Date.now(),[]),me=useCallback(r=>{ne(r.target.value);},[]),ve=useCallback(r=>{de(r.target.value);},[]),fe=useCallback(r=>{le(r.target.value);},[]),be=useCallback(r=>{$(r.target.value);},[]),he=useCallback(r=>{H(r.target.value);},[]),_e=useCallback(r=>{V(r.target.value);},[]),xe=useCallback(r=>{J(r.target.value);},[]),Ce=useCallback(r=>{z(r.target.value);},[]),ye=useCallback(r=>{G(r.target.value);},[]),Re=useCallback(r=>{W(r.target.value);},[]),De=useCallback(()=>b$2("list"),[]),we=useCallback(()=>b$2("summary"),[]),Se=useCallback(r=>{let a={active:"ndpr-badge ndpr-badge--success",inactive:"ndpr-badge ndpr-badge--warning",archived:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300"},p={active:"Active",inactive:"Inactive",archived:"Archived"};return jsx("span",{className:a$2(`px-2 py-1 rounded text-xs font-medium ${a[r]}`,e==null?void 0:e.statusBadge,n),children:p[r]})},[e==null?void 0:e.statusBadge,n]),Pe=useCallback(r=>jsx("span",{className:"ndpr-badge ndpr-badge--info",children:{consent:"Consent",contract:"Contract",legal_obligation:"Legal Obligation",vital_interests:"Vital Interests",public_interest:"Public Interest",legitimate_interests:"Legitimate Interests"}[r]}),[]),ke=()=>jsxs("div",{className:a$2("mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",e==null?void 0:e.orgInfo,n),children:[jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[jsxs("div",{children:[jsx("p",{className:"text-sm font-medium ndpr-text-muted",children:"Organization"}),jsx("p",{className:"ndpr-section-heading",children:l.organizationName})]}),l.dpoDetails&&jsxs("div",{children:[jsx("p",{className:"text-sm font-medium ndpr-text-muted",children:"Data Protection Officer"}),jsx("p",{className:"ndpr-section-heading",children:l.dpoDetails.name}),jsx("p",{className:"ndpr-form-field__hint",children:l.dpoDetails.email})]}),l.ndpcRegistrationNumber&&jsxs("div",{children:[jsx("p",{className:"text-sm font-medium ndpr-text-muted",children:"NDPC Registration No."}),jsx("p",{className:"ndpr-section-heading",children:l.ndpcRegistrationNumber})]})]}),jsxs("div",{className:"mt-2 text-xs ndpr-text-muted",children:["Version ",l.version," | Last Updated: ",te(l.lastUpdated)]})]}),Ae=()=>jsxs("div",{className:a$2("mb-6",e==null?void 0:e.summary,n),children:[jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-4",children:[jsxs("div",{className:a$2("p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:g.totalRecords}),jsx("p",{className:"text-xs ndpr-text-info",children:"Total Records"})]}),jsxs("div",{className:a$2("p-4 bg-green-50 dark:bg-green-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-success",children:g.activeRecords}),jsx("p",{className:"text-xs ndpr-text-success",children:"Active"})]}),jsxs("div",{className:a$2("p-4 bg-purple-50 dark:bg-purple-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:g.crossBorderRecords}),jsx("p",{className:"text-xs ndpr-text-info",children:"Cross-Border"})]}),jsxs("div",{className:a$2("p-4 bg-orange-50 dark:bg-orange-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-warning",children:_.length}),jsx("p",{className:"text-xs ndpr-text-warning",children:"Records with Gaps"})]})]}),jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 mb-4",children:[jsxs("div",{className:"ndpr-panel",children:[jsx("p",{className:"ndpr-form-field__label",children:"By Lawful Basis"}),T.map(r=>jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"ndpr-card__subtitle",children:r.label.split(" (")[0]}),jsx("span",{className:"font-medium",children:g.byLawfulBasis[r.value]||0})]},r.value))]}),jsxs("div",{className:"ndpr-panel",children:[jsx("p",{className:"ndpr-form-field__label",children:"Risk Indicators"}),jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"ndpr-card__subtitle",children:"Sensitive Data"}),jsx("span",{className:"font-medium",children:g.sensitiveDataRecords})]}),jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"ndpr-card__subtitle",children:"DPIA Required"}),jsx("span",{className:"font-medium",children:g.dpiaRequiredRecords})]}),jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"ndpr-card__subtitle",children:"Automated Decisions"}),jsx("span",{className:"font-medium",children:g.automatedDecisionRecords})]}),jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"ndpr-card__subtitle",children:"Due for Review"}),jsx("span",{className:`font-medium ${g.recordsDueForReview.length>0?"ndpr-text-destructive":""}`,children:g.recordsDueForReview.length})]})]}),g.topDepartments.length>0&&jsxs("div",{className:"ndpr-panel",children:[jsx("p",{className:"ndpr-form-field__label",children:"Top Departments"}),g.topDepartments.slice(0,5).map(r=>jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"ndpr-card__subtitle",children:r.department}),jsx("span",{className:"font-medium",children:r.count})]},r.department))]})]}),_.length>0&&jsxs("div",{className:a$2("p-3 bg-red-50 dark:bg-red-900/20 rounded-md",e==null?void 0:e.complianceGap,n),role:"status","aria-live":"polite",children:[jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-2",children:"Compliance Gaps Detected"}),_.slice(0,5).map(r=>jsxs("div",{className:"mb-2",children:[jsx("p",{className:"text-xs font-medium ndpr-text-destructive",children:r.recordName}),jsx("ul",{className:"list-disc list-inside",children:r.gaps.map((a,p)=>jsx("li",{className:"text-xs ndpr-text-destructive",children:a},p))})]},r.recordId)),_.length>5&&jsxs("p",{className:"text-xs ndpr-text-destructive mt-1",children:["...and ",_.length-5," more record(s) with gaps."]})]})]}),Be=()=>jsxs("div",{children:[jsxs("div",{className:"mb-4 grid grid-cols-1 md:grid-cols-4 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"ropaSearch",className:"ndpr-form-field__label",children:"Search"}),jsx("input",{type:"text",id:"ropaSearch",value:S,onChange:me,placeholder:"Search records...",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"ropaStatusFilter",className:"ndpr-form-field__label",children:"Status"}),jsxs("select",{id:"ropaStatusFilter",value:P,onChange:ve,className:a$2("ndpr-form-field__input",e==null?void 0:e.select,n),children:[jsx("option",{value:"all",children:"All Statuses"}),ee.map(r=>jsx("option",{value:r.value,children:r.label},r.value))]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"ropaBasisFilter",className:"ndpr-form-field__label",children:"Lawful Basis"}),jsxs("select",{id:"ropaBasisFilter",value:k,onChange:fe,className:a$2("ndpr-form-field__input",e==null?void 0:e.select,n),children:[jsx("option",{value:"all",children:"All Bases"}),T.map(r=>jsx("option",{value:r.value,children:r.label.split(" (")[0]},r.value))]})]}),jsxs("div",{className:"flex items-end space-x-2",children:[jsx("button",{onClick:oe,className:a$2(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm ${B}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.submitButton),n),children:"Add Record"}),jsx("button",{onClick:se,"aria-label":"Export ROPA records as CSV",className:a$2(`px-4 py-2 bg-gray-600 text-white rounded hover:bg-gray-700 text-sm ${B}`,(e==null?void 0:e.secondaryButton)||(e==null?void 0:e.exportButton),n),children:"Export CSV"})]})]}),K.length===0?jsx("p",{className:"ndpr-empty-state",children:"No processing records found."}):jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:a$2("w-full text-sm text-left",e==null?void 0:e.table,n),children:[jsx("thead",{className:a$2("ndpr-table__head",e==null?void 0:e.tableHeader,n),children:jsxs("tr",{children:[jsx("th",{className:"ndpr-table__cell",children:"Name"}),jsx("th",{className:"ndpr-table__cell",children:"Lawful Basis"}),jsx("th",{className:"ndpr-table__cell",children:"Data Categories"}),jsx("th",{className:"ndpr-table__cell",children:"Status"}),jsx("th",{className:"ndpr-table__cell",children:"Last Reviewed"}),jsx("th",{className:"ndpr-table__cell",children:"Actions"})]})}),jsx("tbody",{children:K.map(r=>{let a=ge(r),p=_.some(m=>m.recordId===r.id);return jsxs("tr",{className:a$2(`border-b dark:border-gray-600 ${a?"bg-red-50 dark:bg-red-900/10":p?"bg-yellow-50 dark:bg-yellow-900/10":"bg-white dark:bg-gray-800"} hover:bg-gray-50 dark:hover:bg-gray-700`,e==null?void 0:e.tableRow,n),children:[jsx("td",{className:"ndpr-table__cell",children:jsxs("div",{children:[jsx("p",{className:"font-medium",children:r.name}),r.department&&jsx("p",{className:"ndpr-form-field__hint",children:r.department}),a&&jsx("span",{className:"text-xs ndpr-text-destructive font-medium",children:"Review Overdue"})]})}),jsx("td",{className:"ndpr-table__cell",children:Pe(r.lawfulBasis)}),jsx("td",{className:"ndpr-table__cell",children:jsx("p",{className:"text-xs ndpr-text-muted max-w-xs truncate",children:r.dataCategories.join(", ")})}),jsx("td",{className:"ndpr-table__cell",children:Se(r.status)}),jsx("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:te(r.lastReviewedAt)}),jsx("td",{className:"ndpr-table__cell",children:jsxs("div",{className:"ndpr-card__footer",children:[jsx("button",{onClick:()=>pe(r),"aria-label":`Edit record: ${r.name}`,className:"ndpr-text-primary hover:underline text-xs",children:"Edit"}),r.status!=="archived"&&jsx("button",{onClick:()=>ce(r.id),"aria-label":`Archive record: ${r.name}`,className:"ndpr-text-muted hover:underline text-xs",children:"Archive"})]})})]},r.id)})})]})})]}),Fe=useMemo(()=>o?!l.records.find(r=>r.id===o.id):true,[o,l.records]),Ie=()=>{if(!o)return null;let r=Fe;return jsxs("div",{"data-ndpr-component":"ropa-manager",className:a$2("",e==null?void 0:e.form,n),children:[jsxs("div",{className:a$2("flex justify-between items-center mb-4",e==null?void 0:e.header,n),children:[jsx("h3",{className:"ndpr-section-heading",children:r?"Add Processing Record":"Edit Processing Record"}),jsx("button",{onClick:Q,className:"ndpr-button ndpr-button--ghost ndpr-button--sm",children:"Cancel"})]}),U.length>0&&jsxs("div",{className:"ndpr-alert ndpr-alert--destructive",role:"status","aria-live":"polite",children:[jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-1",children:"Please fix the following errors:"}),jsx("ul",{className:"list-disc list-inside",children:U.map((a,p)=>jsx("li",{className:"text-xs ndpr-text-destructive",children:a},p))})]}),jsxs("div",{className:"ndpr-form-section",children:[jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsx("legend",{className:"ndpr-badge",children:"Basic Information"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsx("label",{htmlFor:"recordName",className:"ndpr-form-field__label",children:"Activity Name *"}),jsx("input",{type:"text",id:"recordName",value:o.name,onChange:a=>c$1("name",a.target.value),"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Customer Account Management"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"recordDepartment",className:"ndpr-form-field__label",children:"Department"}),jsx("input",{type:"text",id:"recordDepartment",value:o.department||"",onChange:a=>c$1("department",a.target.value||void 0),className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Marketing"})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"recordDescription",className:"ndpr-form-field__label",children:"Description *"}),jsx("textarea",{id:"recordDescription",value:o.description,onChange:a=>c$1("description",a.target.value),rows:3,"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Describe what personal data processing is performed..."})]}),jsxs("div",{children:[jsx("label",{htmlFor:"recordStatus",className:"ndpr-form-field__label",children:"Status *"}),jsx("select",{id:"recordStatus",value:o.status,onChange:a=>c$1("status",a.target.value),"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.select,n),children:ee.map(a=>jsx("option",{value:a.value,children:a.label},a.value))})]})]})]}),jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsx("legend",{className:"ndpr-badge",children:"Controller Details"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsx("label",{htmlFor:"controllerName",className:"ndpr-form-field__label",children:"Controller Name *"}),jsx("input",{type:"text",id:"controllerName",value:o.controllerDetails.name,onChange:a=>q("name",a.target.value),"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"controllerContact",className:"ndpr-form-field__label",children:"Controller Contact *"}),jsx("input",{type:"text",id:"controllerContact",value:o.controllerDetails.contact,onChange:a=>q("contact",a.target.value),"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n)})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"controllerAddress",className:"ndpr-form-field__label",children:"Controller Address *"}),jsx("input",{type:"text",id:"controllerAddress",value:o.controllerDetails.address,onChange:a=>q("address",a.target.value),"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n)})]})]})]}),jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsx("legend",{className:"ndpr-badge",children:"Lawful Basis (NDPA Section 25)"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsx("label",{htmlFor:"lawfulBasis",className:"ndpr-form-field__label",children:"Lawful Basis *"}),jsx("select",{id:"lawfulBasis",value:o.lawfulBasis,onChange:a=>c$1("lawfulBasis",a.target.value),"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.select,n),children:T.map(a=>jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxs("div",{children:[jsx("label",{htmlFor:"lawfulBasisJustification",className:"ndpr-form-field__label",children:"Justification *"}),jsx("textarea",{id:"lawfulBasisJustification",value:o.lawfulBasisJustification,onChange:a=>c$1("lawfulBasisJustification",a.target.value),rows:2,"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Explain why this lawful basis applies..."})]})]})]}),jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsx("legend",{className:"ndpr-badge",children:"Data Details"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsx("label",{htmlFor:"purposes",className:"ndpr-form-field__label",children:"Purposes * (comma-separated)"}),jsx("input",{type:"text",id:"purposes",value:F,onChange:be,"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Account management, Service delivery"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dataCategories",className:"ndpr-form-field__label",children:"Data Categories * (comma-separated)"}),jsx("input",{type:"text",id:"dataCategories",value:I,onChange:he,"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Name, Email, Phone number"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"sensitiveData",className:"ndpr-form-field__label",children:"Sensitive Data Categories (comma-separated)"}),jsx("input",{type:"text",id:"sensitiveData",value:M,onChange:_e,className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Health data, Biometric data"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"subjectCategories",className:"ndpr-form-field__label",children:"Data Subject Categories * (comma-separated)"}),jsx("input",{type:"text",id:"subjectCategories",value:L,onChange:xe,"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Customers, Employees"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"recipients",className:"ndpr-form-field__label",children:"Recipients * (comma-separated)"}),jsx("input",{type:"text",id:"recipients",value:E,onChange:Ce,"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Payment processors, Cloud service providers"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dataSource",className:"ndpr-form-field__label",children:"Data Source *"}),jsx("select",{id:"dataSource",value:o.dataSource,onChange:a=>c$1("dataSource",a.target.value),"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.select,n),children:Ee.map(a=>jsx("option",{value:a.value,children:a.label},a.value))})]}),o.dataSource==="third_party"&&jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"thirdPartyDetails",className:"ndpr-form-field__label",children:"Third-Party Source Details *"}),jsx("input",{type:"text",id:"thirdPartyDetails",value:o.thirdPartySourceDetails||"",onChange:a=>c$1("thirdPartySourceDetails",a.target.value||void 0),"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Describe the third-party data source..."})]})]})]}),jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsx("legend",{className:"ndpr-badge",children:"Retention and Security"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsx("label",{htmlFor:"retentionPeriod",className:"ndpr-form-field__label",children:"Retention Period *"}),jsx("input",{type:"text",id:"retentionPeriod",value:o.retentionPeriod,onChange:a=>c$1("retentionPeriod",a.target.value),"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., 5 years after account closure"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"retentionJustification",className:"ndpr-form-field__label",children:"Retention Justification"}),jsx("input",{type:"text",id:"retentionJustification",value:o.retentionJustification||"",onChange:a=>c$1("retentionJustification",a.target.value||void 0),className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Why this retention period is necessary..."})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"securityMeasures",className:"ndpr-form-field__label",children:"Security Measures * (comma-separated)"}),jsx("input",{type:"text",id:"securityMeasures",value:O,onChange:ye,"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Encryption at rest, Access controls, Audit logging"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"systemsUsed",className:"ndpr-form-field__label",children:"Systems Used (comma-separated)"}),jsx("input",{type:"text",id:"systemsUsed",value:j,onChange:Re,className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., CRM, ERP, Cloud Storage"})]})]})]}),jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsx("legend",{className:"ndpr-badge",children:"Risk Indicators"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",id:"dpiaRequired",checked:o.dpiaRequired,onChange:a=>c$1("dpiaRequired",a.target.checked),className:"ndpr-form-field__checkbox"}),jsx("label",{htmlFor:"dpiaRequired",className:"ndpr-text-sm ndpr-font-medium",children:"DPIA Required"})]}),o.dpiaRequired&&jsxs("div",{children:[jsx("label",{htmlFor:"dpiaReference",className:"ndpr-form-field__label",children:"DPIA Reference *"}),jsx("input",{type:"text",id:"dpiaReference",value:o.dpiaReference||"",onChange:a=>c$1("dpiaReference",a.target.value||void 0),"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Reference to the completed DPIA"})]}),jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",id:"automatedDecisionMaking",checked:o.automatedDecisionMaking,onChange:a=>c$1("automatedDecisionMaking",a.target.checked),className:"ndpr-form-field__checkbox"}),jsx("label",{htmlFor:"automatedDecisionMaking",className:"ndpr-text-sm ndpr-font-medium",children:"Automated Decision-Making"})]}),o.automatedDecisionMaking&&jsxs("div",{children:[jsx("label",{htmlFor:"automatedDecisionMakingDetails",className:"ndpr-form-field__label",children:"Automated Decision-Making Details *"}),jsx("textarea",{id:"automatedDecisionMakingDetails",value:o.automatedDecisionMakingDetails||"",onChange:a=>c$1("automatedDecisionMakingDetails",a.target.value||void 0),rows:2,"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Describe the automated decision-making process..."})]})]})]}),jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsx("legend",{className:"ndpr-badge",children:"Review Schedule"}),jsx("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:jsxs("div",{children:[jsx("label",{htmlFor:"nextReviewDate",className:"ndpr-form-field__label",children:"Next Review Date"}),jsx("input",{type:"date",id:"nextReviewDate",value:o.nextReviewDate?new Date(o.nextReviewDate).toISOString().slice(0,10):"",onChange:a=>c$1("nextReviewDate",a.target.value?new Date(a.target.value).getTime():void 0),className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n)})]})})]}),jsxs("div",{className:"flex justify-end space-x-3",children:[jsx("button",{onClick:Q,className:"ndpr-button ndpr-button--secondary ndpr-button--sm",children:"Cancel"}),jsx("button",{onClick:ue,className:a$2(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm ${B}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.submitButton),n),children:r?"Add Record":"Save Changes"})]})]})]})},Me=()=>jsxs("div",{className:"ndpr-section-divider ndpr-text-sm",children:[jsx("button",{onClick:De,className:`pb-2 text-sm font-medium ${f==="list"?"border-b-2 border-[rgb(var(--ndpr-primary))] ndpr-text-primary":"ndpr-text-muted hover:text-gray-700 dark:hover:text-gray-300"}`,children:"Processing Records"}),jsx("button",{onClick:we,className:`pb-2 text-sm font-medium ${f==="summary"?"border-b-2 border-[rgb(var(--ndpr-primary))] ndpr-text-primary":"ndpr-text-muted hover:text-gray-700 dark:hover:text-gray-300"}`,children:"Compliance Summary"})]});return jsxs("div",{className:a$2(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${ae}`,e==null?void 0:e.root,n),children:[jsx("h2",{className:a$2("ndpr-section-heading",e==null?void 0:e.title,n),children:re}),jsx("p",{className:"ndpr-card__subtitle",children:ie}),ke(),f!=="form"&&Me(),f==="list"&&Be(),f==="summary"&&Ae(),f==="form"&&Ie()]})};export{$e as a};//# sourceMappingURL=chunk-VTITKWGX.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-VTITKWGX.mjs.map
|