@tantainnovative/ndpr-toolkit 3.3.1 → 3.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +542 -0
- package/README.md +80 -38
- 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 +2 -1
- package/dist/breach.mjs +2 -1
- package/dist/chunk-2L7BSG7G.mjs +2 -0
- package/dist/chunk-3NQQSU4P.js +2 -0
- package/dist/chunk-3VQAYQR7.js +7 -0
- package/dist/chunk-4BOEFDDE.js +4 -0
- package/dist/chunk-5HL4UBFV.js +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-ASLMPY54.js +3 -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-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-I557S566.mjs +15 -0
- package/dist/chunk-IZCWCE7W.mjs +2 -0
- package/dist/chunk-JBSCER34.js +2 -0
- package/dist/chunk-JFFOPHU3.mjs +318 -0
- package/dist/chunk-KF3EFJEF.mjs +3 -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-MLOWRZXO.mjs +4 -0
- package/dist/chunk-NFJ4CB63.mjs +3 -0
- package/dist/chunk-NQNFS3QI.js +7 -0
- package/dist/{chunk-ZEOQYWOE.mjs → chunk-P2YV6DR3.js} +4 -4
- package/dist/chunk-P6QAFBCV.js +2 -0
- package/dist/chunk-R5FW5XUQ.mjs +2 -0
- package/dist/chunk-RLYTX3MM.js +2 -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-UHTJ6UFW.js +2 -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-YPKUHSK4.js +15 -0
- package/dist/chunk-Z73T6MWY.js +318 -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 +2 -1
- package/dist/consent.mjs +2 -1
- package/dist/core.d.mts +6 -29
- package/dist/core.d.ts +6 -29
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/cross-border.js +2 -1
- package/dist/cross-border.mjs +2 -1
- package/dist/docx-4n8g4zul.d.mts +64 -0
- package/dist/docx-VvcTLYZM.d.ts +64 -0
- package/dist/dpia.js +2 -1
- package/dist/dpia.mjs +2 -1
- package/dist/dsr.js +2 -1
- package/dist/dsr.mjs +2 -1
- package/dist/hooks.d.mts +3 -3
- package/dist/hooks.d.ts +3 -3
- package/dist/hooks.js +2 -1
- package/dist/hooks.mjs +2 -1
- package/dist/index.d.mts +7 -5
- package/dist/index.d.ts +7 -5
- package/dist/index.js +2 -1
- package/dist/index.mjs +2 -1
- package/dist/lawful-basis.js +2 -1
- package/dist/lawful-basis.mjs +2 -1
- package/dist/locale-CxJx2tzn.d.mts +25 -0
- package/dist/locale-DSkrtf-c.d.ts +25 -0
- package/dist/{policy-engine-DefZcX3R.d.mts → policy-engine-5qTfp2z4.d.mts} +21 -1
- package/dist/{policy-engine-C6nC2t3a.d.ts → policy-engine-DzPxskOK.d.ts} +21 -1
- package/dist/{policy-sections-DFDPVCCg.d.ts → policy-sections-9tCb7VU7.d.ts} +4 -2
- package/dist/{policy-sections-Bylm31kZ.d.mts → policy-sections-CBWcJv-R.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 +2 -1
- package/dist/policy.mjs +2 -1
- package/dist/presets.d.mts +2 -2
- package/dist/presets.d.ts +2 -2
- package/dist/presets.js +2 -1
- package/dist/presets.mjs +2 -1
- package/dist/ropa.js +2 -1
- package/dist/ropa.mjs +2 -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 +2 -1
- package/dist/unstyled.mjs +2 -1
- package/dist/{useAdaptivePolicyWizard-A1PyOy6P.d.mts → useAdaptivePolicyWizard-BSLyltzZ.d.mts} +1 -1
- package/dist/{useAdaptivePolicyWizard-LVIKhAxw.d.ts → useAdaptivePolicyWizard-CL7C7MTZ.d.ts} +1 -1
- package/dist/{useDefaultPrivacyPolicy-ySWU7nc-.d.mts → useDefaultPrivacyPolicy-Cs2WQSYQ.d.mts} +30 -9
- package/dist/{useDefaultPrivacyPolicy-DvCbeEl1.d.ts → useDefaultPrivacyPolicy-DkOqMg2e.d.ts} +30 -9
- package/package.json +14 -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-5ECDPRSZ.js +0 -7
- package/dist/chunk-6YN73KR7.mjs +0 -2
- package/dist/chunk-CDZDT2OS.mjs +0 -320
- package/dist/chunk-CWUPGY3M.mjs +0 -3
- package/dist/chunk-CYU6YUJQ.mjs +0 -81
- package/dist/chunk-EKHBORAH.js +0 -81
- package/dist/chunk-ENIMJ6SQ.js +0 -2
- package/dist/chunk-FLKJSGR7.mjs +0 -94
- package/dist/chunk-FWLPJ5YI.js +0 -94
- package/dist/chunk-GCQRHMTQ.mjs +0 -144
- package/dist/chunk-GMLCWGNJ.js +0 -7
- package/dist/chunk-GXLSOZCH.mjs +0 -2
- package/dist/chunk-LETEUS5X.mjs +0 -2
- package/dist/chunk-LU4PFST7.js +0 -144
- package/dist/chunk-NBSVFQ5G.js +0 -2
- package/dist/chunk-OYR3L4XS.mjs +0 -7
- package/dist/chunk-QF6XNKU6.mjs +0 -2
- package/dist/chunk-QJ3JNHO7.js +0 -2
- package/dist/chunk-QNCGRCAX.mjs +0 -2
- package/dist/chunk-SAA7UVI2.js +0 -3
- package/dist/chunk-TI2M7H6R.mjs +0 -7
- 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-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-ZT7KNFAU.mjs +0 -2
package/dist/chunk-5BUS6AI7.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkGOU6FU6Y_js=require('./chunk-GOU6FU6Y.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var _=[{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"}],Oe=[{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 je(){let d=Date.now();return {id:`proc_${d}_${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:d,updatedAt:d}}function te(d){return d?new Date(d).toLocaleDateString():"N/A"}var $e=({ropa:d,onAddRecord:w,onUpdateRecord:R,onArchiveRecord:D,title:re="Record of Processing Activities (ROPA)",description:ae="Maintain a comprehensive record of all data processing activities as required by the NDPA accountability principle.",className:ie="",buttonClassName:F="",classNames:e,unstyled:o})=>{let[v,x]=react.useState("list"),[S,oe]=react.useState(""),[P,ne]=react.useState("all"),[A,de]=react.useState("all"),[l,f]=react.useState(null),[U,k]=react.useState([]),[I,$]=react.useState(""),[M,H]=react.useState(""),[L,V]=react.useState(""),[E,J]=react.useState(""),[O,z]=react.useState(""),[j,G]=react.useState(""),[q,W]=react.useState(""),p=react.useMemo(()=>chunkGOU6FU6Y_js.b(d),[d]),y=react.useMemo(()=>chunkGOU6FU6Y_js.d(d),[d]),K=react.useMemo(()=>{let r=[...d.records];if(P!=="all"&&(r=r.filter(i=>i.status===P)),A!=="all"&&(r=r.filter(i=>i.lawfulBasis===A)),S){let i=S.toLowerCase();r=r.filter(u=>u.name.toLowerCase().includes(i)||u.description.toLowerCase().includes(i)||u.dataCategories.some(m=>m.toLowerCase().includes(i))||u.department&&u.department.toLowerCase().includes(i));}return r},[d.records,P,A,S]);react.useEffect(()=>{l&&($(l.purposes.join(", ")),H(l.dataCategories.join(", ")),V((l.sensitiveDataCategories||[]).join(", ")),J(l.dataSubjectCategories.join(", ")),z(l.recipients.join(", ")),G(l.securityMeasures.join(", ")),W((l.systemsUsed||[]).join(", ")));},[l==null?void 0:l.id]);let le=react.useCallback(()=>{let r=je();r.controllerDetails.name=d.organizationName,r.controllerDetails.contact=d.organizationContact,r.controllerDetails.address=d.organizationAddress,d.ndpcRegistrationNumber&&(r.controllerDetails.registrationNumber=d.ndpcRegistrationNumber),d.dpoDetails&&(r.controllerDetails.dpoContact=d.dpoDetails.email),f(r),k([]),x("form");},[d.organizationName,d.organizationContact,d.organizationAddress,d.ndpcRegistrationNumber,d.dpoDetails]),ue=react.useCallback(r=>{f(chunkMQFZHA2D_js.a({},r)),k([]),x("form");},[]),b=r=>r.split(",").map(i=>i.trim()).filter(i=>i.length>0),ge=react.useCallback(()=>{if(!l)return;let r=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},l),{purposes:b(I),dataCategories:b(M),sensitiveDataCategories:b(L),dataSubjectCategories:b(E),recipients:b(O),securityMeasures:b(j),systemsUsed:b(q),updatedAt:Date.now()});r.sensitiveDataCategories&&r.sensitiveDataCategories.length===0&&(r.sensitiveDataCategories=void 0),r.systemsUsed&&r.systemsUsed.length===0&&(r.systemsUsed=void 0);let i=chunkGOU6FU6Y_js.a(r);if(!i.valid){k(i.errors);return}d.records.find(m=>m.id===r.id)?R==null||R(r.id,r):w==null||w(r),f(null),k([]),x("list");},[l,I,M,L,E,O,j,q,d.records,R,w]),se=react.useCallback(r=>{D==null||D(r);},[D]),ce=react.useCallback(()=>{let r=chunkGOU6FU6Y_js.c(d),i=new Blob([r],{type:"text/csv;charset=utf-8;"}),u=URL.createObjectURL(i),m=document.createElement("a");m.href=u,m.download=`ropa_${d.organizationName.replace(/\s+/g,"_").toLowerCase()}_${new Date().toISOString().slice(0,10)}.csv`,m.click(),setTimeout(()=>URL.revokeObjectURL(u),100);},[d]),Q=react.useCallback(()=>{f(null),k([]),x("list");},[]),s=react.useCallback((r,i)=>{f(u=>u&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},u),{[r]:i}));},[]),T=react.useCallback((r,i)=>{f(u=>u&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},u),{controllerDetails:chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},u.controllerDetails),{[r]:i})}));},[]),pe=react.useCallback(r=>!!r.nextReviewDate&&r.nextReviewDate<=Date.now(),[]),me=react.useCallback(r=>{oe(r.target.value);},[]),be=react.useCallback(r=>{ne(r.target.value);},[]),ve=react.useCallback(r=>{de(r.target.value);},[]),xe=react.useCallback(r=>{$(r.target.value);},[]),fe=react.useCallback(r=>{H(r.target.value);},[]),ye=react.useCallback(r=>{V(r.target.value);},[]),he=react.useCallback(r=>{J(r.target.value);},[]),ke=react.useCallback(r=>{z(r.target.value);},[]),Ce=react.useCallback(r=>{G(r.target.value);},[]),we=react.useCallback(r=>{W(r.target.value);},[]),Re=react.useCallback(()=>x("list"),[]),De=react.useCallback(()=>x("summary"),[]),Se=react.useCallback(r=>{let i={active:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",inactive:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",archived:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300"},u={active:"Active",inactive:"Inactive",archived:"Archived"};return jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${i[r]}`,e==null?void 0:e.statusBadge,o),children:u[r]})},[e==null?void 0:e.statusBadge,o]),Pe=react.useCallback(r=>jsxRuntime.jsx("span",{className:"px-2 py-1 rounded text-xs font-medium bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",children:{consent:"Consent",contract:"Contract",legal_obligation:"Legal Obligation",vital_interests:"Vital Interests",public_interest:"Public Interest",legitimate_interests:"Legitimate Interests"}[r]}),[]),Ae=()=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",e==null?void 0:e.orgInfo,o),children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"Organization"}),jsxRuntime.jsx("p",{className:"text-sm font-semibold",children:d.organizationName})]}),d.dpoDetails&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"Data Protection Officer"}),jsxRuntime.jsx("p",{className:"text-sm font-semibold",children:d.dpoDetails.name}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:d.dpoDetails.email})]}),d.ndpcRegistrationNumber&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"NDPC Registration No."}),jsxRuntime.jsx("p",{className:"text-sm font-semibold",children:d.ndpcRegistrationNumber})]})]}),jsxRuntime.jsxs("div",{className:"mt-2 text-xs text-gray-600 dark:text-gray-400",children:["Version ",d.version," | Last Updated: ",te(d.lastUpdated)]})]}),Be=()=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6",e==null?void 0:e.summary,o),children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-blue-700 dark:text-blue-300",children:p.totalRecords}),jsxRuntime.jsx("p",{className:"text-xs text-blue-600 dark:text-blue-400",children:"Total Records"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("p-4 bg-green-50 dark:bg-green-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-green-700 dark:text-green-300",children:p.activeRecords}),jsxRuntime.jsx("p",{className:"text-xs text-green-600 dark:text-green-400",children:"Active"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("p-4 bg-purple-50 dark:bg-purple-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-purple-700 dark:text-purple-300",children:p.crossBorderRecords}),jsxRuntime.jsx("p",{className:"text-xs text-purple-600 dark:text-purple-400",children:"Cross-Border"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("p-4 bg-orange-50 dark:bg-orange-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-orange-700 dark:text-orange-300",children:y.length}),jsxRuntime.jsx("p",{className:"text-xs text-orange-600 dark:text-orange-400",children:"Records with Gaps"})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-2",children:"By Lawful Basis"}),_.map(r=>jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:r.label.split(" (")[0]}),jsxRuntime.jsx("span",{className:"font-medium",children:p.byLawfulBasis[r.value]||0})]},r.value))]}),jsxRuntime.jsxs("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-2",children:"Risk Indicators"}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Sensitive Data"}),jsxRuntime.jsx("span",{className:"font-medium",children:p.sensitiveDataRecords})]}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"DPIA Required"}),jsxRuntime.jsx("span",{className:"font-medium",children:p.dpiaRequiredRecords})]}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Automated Decisions"}),jsxRuntime.jsx("span",{className:"font-medium",children:p.automatedDecisionRecords})]}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Due for Review"}),jsxRuntime.jsx("span",{className:`font-medium ${p.recordsDueForReview.length>0?"text-red-600 dark:text-red-400":""}`,children:p.recordsDueForReview.length})]})]}),p.topDepartments.length>0&&jsxRuntime.jsxs("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-2",children:"Top Departments"}),p.topDepartments.slice(0,5).map(r=>jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:r.department}),jsxRuntime.jsx("span",{className:"font-medium",children:r.count})]},r.department))]})]}),y.length>0&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("p-3 bg-red-50 dark:bg-red-900/20 rounded-md",e==null?void 0:e.complianceGap,o),role:"status","aria-live":"polite",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-2",children:"Compliance Gaps Detected"}),y.slice(0,5).map(r=>jsxRuntime.jsxs("div",{className:"mb-2",children:[jsxRuntime.jsx("p",{className:"text-xs font-medium text-red-700 dark:text-red-300",children:r.recordName}),jsxRuntime.jsx("ul",{className:"list-disc list-inside",children:r.gaps.map((i,u)=>jsxRuntime.jsx("li",{className:"text-xs text-red-600 dark:text-red-400",children:i},u))})]},r.recordId)),y.length>5&&jsxRuntime.jsxs("p",{className:"text-xs text-red-600 dark:text-red-400 mt-1",children:["...and ",y.length-5," more record(s) with gaps."]})]})]}),Fe=()=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"mb-4 grid grid-cols-1 md:grid-cols-4 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"ropaSearch",className:"block text-sm font-medium mb-1",children:"Search"}),jsxRuntime.jsx("input",{type:"text",id:"ropaSearch",value:S,onChange:me,placeholder:"Search records...",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"ropaStatusFilter",className:"block text-sm font-medium mb-1",children:"Status"}),jsxRuntime.jsxs("select",{id:"ropaStatusFilter",value:P,onChange:be,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.select,o),children:[jsxRuntime.jsx("option",{value:"all",children:"All Statuses"}),ee.map(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label},r.value))]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"ropaBasisFilter",className:"block text-sm font-medium mb-1",children:"Lawful Basis"}),jsxRuntime.jsxs("select",{id:"ropaBasisFilter",value:A,onChange:ve,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.select,o),children:[jsxRuntime.jsx("option",{value:"all",children:"All Bases"}),_.map(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label.split(" (")[0]},r.value))]})]}),jsxRuntime.jsxs("div",{className:"flex items-end space-x-2",children:[jsxRuntime.jsx("button",{onClick:le,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm ${F}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.submitButton),o),children:"Add Record"}),jsxRuntime.jsx("button",{onClick:ce,"aria-label":"Export ROPA records as CSV",className:chunkE64TU6IU_js.a(`px-4 py-2 bg-gray-600 text-white rounded hover:bg-gray-700 text-sm ${F}`,(e==null?void 0:e.secondaryButton)||(e==null?void 0:e.exportButton),o),children:"Export CSV"})]})]}),K.length===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm text-center py-8",children:"No processing records found."}):jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:chunkE64TU6IU_js.a("w-full text-sm text-left",e==null?void 0:e.table,o),children:[jsxRuntime.jsx("thead",{className:chunkE64TU6IU_js.a("text-xs uppercase bg-gray-50 dark:bg-gray-700",e==null?void 0:e.tableHeader,o),children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Name"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Lawful Basis"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Data Categories"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Status"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Last Reviewed"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Actions"})]})}),jsxRuntime.jsx("tbody",{children:K.map(r=>{let i=pe(r),u=y.some(m=>m.recordId===r.id);return jsxRuntime.jsxs("tr",{className:chunkE64TU6IU_js.a(`border-b dark:border-gray-600 ${i?"bg-red-50 dark:bg-red-900/10":u?"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,o),children:[jsxRuntime.jsx("td",{className:"px-4 py-3",children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"font-medium",children:r.name}),r.department&&jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:r.department}),i&&jsxRuntime.jsx("span",{className:"text-xs text-red-600 dark:text-red-400 font-medium",children:"Review Overdue"})]})}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:Pe(r.lawfulBasis)}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-300 max-w-xs truncate",children:r.dataCategories.join(", ")})}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:Se(r.status)}),jsxRuntime.jsx("td",{className:"px-4 py-3 text-xs text-gray-600 dark:text-gray-400",children:te(r.lastReviewedAt)}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[jsxRuntime.jsx("button",{onClick:()=>ue(r),"aria-label":`Edit record: ${r.name}`,className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline text-xs",children:"Edit"}),r.status!=="archived"&&jsxRuntime.jsx("button",{onClick:()=>se(r.id),"aria-label":`Archive record: ${r.name}`,className:"text-gray-600 dark:text-gray-400 hover:underline text-xs",children:"Archive"})]})})]},r.id)})})]})})]}),Ie=react.useMemo(()=>l?!d.records.find(r=>r.id===l.id):true,[l,d.records]),Me=()=>{if(!l)return null;let r=Ie;return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",e==null?void 0:e.form,o),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex justify-between items-center mb-4",e==null?void 0:e.header,o),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium",children:r?"Add Processing Record":"Edit Processing Record"}),jsxRuntime.jsx("button",{onClick:Q,className:"text-gray-600 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 text-sm",children:"Cancel"})]}),U.length>0&&jsxRuntime.jsxs("div",{className:"mb-4 p-3 bg-red-50 dark:bg-red-900/20 rounded-md",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Please fix the following errors:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside",children:U.map((i,u)=>jsxRuntime.jsx("li",{className:"text-xs text-red-600 dark:text-red-400",children:i},u))})]}),jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsxRuntime.jsx("legend",{className:"text-sm font-medium px-2",children:"Basic Information"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recordName",className:"block text-sm font-medium mb-1",children:"Activity Name *"}),jsxRuntime.jsx("input",{type:"text",id:"recordName",value:l.name,onChange:i=>s("name",i.target.value),"aria-required":"true",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"e.g., Customer Account Management"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recordDepartment",className:"block text-sm font-medium mb-1",children:"Department"}),jsxRuntime.jsx("input",{type:"text",id:"recordDepartment",value:l.department||"",onChange:i=>s("department",i.target.value||void 0),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"e.g., Marketing"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"recordDescription",className:"block text-sm font-medium mb-1",children:"Description *"}),jsxRuntime.jsx("textarea",{id:"recordDescription",value:l.description,onChange:i=>s("description",i.target.value),rows:3,"aria-required":"true",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"Describe what personal data processing is performed..."})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recordStatus",className:"block text-sm font-medium mb-1",children:"Status *"}),jsxRuntime.jsx("select",{id:"recordStatus",value:l.status,onChange:i=>s("status",i.target.value),"aria-required":"true",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.select,o),children:ee.map(i=>jsxRuntime.jsx("option",{value:i.value,children:i.label},i.value))})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsxRuntime.jsx("legend",{className:"text-sm font-medium px-2",children:"Controller Details"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"controllerName",className:"block text-sm font-medium mb-1",children:"Controller Name *"}),jsxRuntime.jsx("input",{type:"text",id:"controllerName",value:l.controllerDetails.name,onChange:i=>T("name",i.target.value),"aria-required":"true",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"controllerContact",className:"block text-sm font-medium mb-1",children:"Controller Contact *"}),jsxRuntime.jsx("input",{type:"text",id:"controllerContact",value:l.controllerDetails.contact,onChange:i=>T("contact",i.target.value),"aria-required":"true",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o)})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"controllerAddress",className:"block text-sm font-medium mb-1",children:"Controller Address *"}),jsxRuntime.jsx("input",{type:"text",id:"controllerAddress",value:l.controllerDetails.address,onChange:i=>T("address",i.target.value),"aria-required":"true",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o)})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsxRuntime.jsx("legend",{className:"text-sm font-medium px-2",children:"Lawful Basis (NDPA Section 25)"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"lawfulBasis",className:"block text-sm font-medium mb-1",children:"Lawful Basis *"}),jsxRuntime.jsx("select",{id:"lawfulBasis",value:l.lawfulBasis,onChange:i=>s("lawfulBasis",i.target.value),"aria-required":"true",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.select,o),children:_.map(i=>jsxRuntime.jsx("option",{value:i.value,children:i.label},i.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"lawfulBasisJustification",className:"block text-sm font-medium mb-1",children:"Justification *"}),jsxRuntime.jsx("textarea",{id:"lawfulBasisJustification",value:l.lawfulBasisJustification,onChange:i=>s("lawfulBasisJustification",i.target.value),rows:2,"aria-required":"true",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"Explain why this lawful basis applies..."})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsxRuntime.jsx("legend",{className:"text-sm font-medium px-2",children:"Data Details"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"purposes",className:"block text-sm font-medium mb-1",children:"Purposes * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"purposes",value:I,onChange:xe,"aria-required":"true",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"e.g., Account management, Service delivery"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dataCategories",className:"block text-sm font-medium mb-1",children:"Data Categories * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"dataCategories",value:M,onChange:fe,"aria-required":"true",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"e.g., Name, Email, Phone number"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"sensitiveData",className:"block text-sm font-medium mb-1",children:"Sensitive Data Categories (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"sensitiveData",value:L,onChange:ye,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"e.g., Health data, Biometric data"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"subjectCategories",className:"block text-sm font-medium mb-1",children:"Data Subject Categories * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"subjectCategories",value:E,onChange:he,"aria-required":"true",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"e.g., Customers, Employees"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recipients",className:"block text-sm font-medium mb-1",children:"Recipients * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"recipients",value:O,onChange:ke,"aria-required":"true",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"e.g., Payment processors, Cloud service providers"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dataSource",className:"block text-sm font-medium mb-1",children:"Data Source *"}),jsxRuntime.jsx("select",{id:"dataSource",value:l.dataSource,onChange:i=>s("dataSource",i.target.value),"aria-required":"true",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.select,o),children:Oe.map(i=>jsxRuntime.jsx("option",{value:i.value,children:i.label},i.value))})]}),l.dataSource==="third_party"&&jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"thirdPartyDetails",className:"block text-sm font-medium mb-1",children:"Third-Party Source Details *"}),jsxRuntime.jsx("input",{type:"text",id:"thirdPartyDetails",value:l.thirdPartySourceDetails||"",onChange:i=>s("thirdPartySourceDetails",i.target.value||void 0),"aria-required":"true",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"Describe the third-party data source..."})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsxRuntime.jsx("legend",{className:"text-sm font-medium px-2",children:"Retention and Security"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"retentionPeriod",className:"block text-sm font-medium mb-1",children:"Retention Period *"}),jsxRuntime.jsx("input",{type:"text",id:"retentionPeriod",value:l.retentionPeriod,onChange:i=>s("retentionPeriod",i.target.value),"aria-required":"true",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"e.g., 5 years after account closure"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"retentionJustification",className:"block text-sm font-medium mb-1",children:"Retention Justification"}),jsxRuntime.jsx("input",{type:"text",id:"retentionJustification",value:l.retentionJustification||"",onChange:i=>s("retentionJustification",i.target.value||void 0),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"Why this retention period is necessary..."})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"securityMeasures",className:"block text-sm font-medium mb-1",children:"Security Measures * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"securityMeasures",value:j,onChange:Ce,"aria-required":"true",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"e.g., Encryption at rest, Access controls, Audit logging"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"systemsUsed",className:"block text-sm font-medium mb-1",children:"Systems Used (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"systemsUsed",value:q,onChange:we,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"e.g., CRM, ERP, Cloud Storage"})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsxRuntime.jsx("legend",{className:"text-sm font-medium px-2",children:"Risk Indicators"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"dpiaRequired",checked:l.dpiaRequired,onChange:i=>s("dpiaRequired",i.target.checked),className:"rounded border-gray-300 dark:border-gray-600"}),jsxRuntime.jsx("label",{htmlFor:"dpiaRequired",className:"text-sm font-medium",children:"DPIA Required"})]}),l.dpiaRequired&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dpiaReference",className:"block text-sm font-medium mb-1",children:"DPIA Reference *"}),jsxRuntime.jsx("input",{type:"text",id:"dpiaReference",value:l.dpiaReference||"",onChange:i=>s("dpiaReference",i.target.value||void 0),"aria-required":"true",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"Reference to the completed DPIA"})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"automatedDecisionMaking",checked:l.automatedDecisionMaking,onChange:i=>s("automatedDecisionMaking",i.target.checked),className:"rounded border-gray-300 dark:border-gray-600"}),jsxRuntime.jsx("label",{htmlFor:"automatedDecisionMaking",className:"text-sm font-medium",children:"Automated Decision-Making"})]}),l.automatedDecisionMaking&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"automatedDecisionMakingDetails",className:"block text-sm font-medium mb-1",children:"Automated Decision-Making Details *"}),jsxRuntime.jsx("textarea",{id:"automatedDecisionMakingDetails",value:l.automatedDecisionMakingDetails||"",onChange:i=>s("automatedDecisionMakingDetails",i.target.value||void 0),rows:2,"aria-required":"true",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"Describe the automated decision-making process..."})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsxRuntime.jsx("legend",{className:"text-sm font-medium px-2",children:"Review Schedule"}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"nextReviewDate",className:"block text-sm font-medium mb-1",children:"Next Review Date"}),jsxRuntime.jsx("input",{type:"date",id:"nextReviewDate",value:l.nextReviewDate?new Date(l.nextReviewDate).toISOString().slice(0,10):"",onChange:i=>s("nextReviewDate",i.target.value?new Date(i.target.value).getTime():void 0),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o)})]})})]}),jsxRuntime.jsxs("div",{className:"flex justify-end space-x-3",children:[jsxRuntime.jsx("button",{onClick:Q,className:"px-4 py-2 border border-gray-300 dark:border-gray-600 rounded hover:bg-gray-50 dark:hover:bg-gray-700 text-sm",children:"Cancel"}),jsxRuntime.jsx("button",{onClick:ge,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm ${F}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.submitButton),o),children:r?"Add Record":"Save Changes"})]})]})]})},Le=()=>jsxRuntime.jsxs("div",{className:"flex space-x-4 mb-6 border-b border-gray-200 dark:border-gray-600",children:[jsxRuntime.jsx("button",{onClick:Re,className:`pb-2 text-sm font-medium ${v==="list"?"border-b-2 border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300"}`,children:"Processing Records"}),jsxRuntime.jsx("button",{onClick:De,className:`pb-2 text-sm font-medium ${v==="summary"?"border-b-2 border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300"}`,children:"Compliance Summary"})]});return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${ie}`,e==null?void 0:e.root,o),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",e==null?void 0:e.title,o),children:re}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:ae}),Ae(),v!=="form"&&Le(),v==="list"&&Fe(),v==="summary"&&Be(),v==="form"&&Me()]})};exports.a=$e;//# sourceMappingURL=chunk-5BUS6AI7.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-5BUS6AI7.js.map
|
package/dist/chunk-5ECDPRSZ.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),S=require('react'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var S__default=/*#__PURE__*/_interopDefault(S);var j=({result:r,sections:c,showFullReport:p=true,allowPrint:x=true,allowExport:y=true,onExport:v,className:u="",buttonClassName:b="",classNames:k={},unstyled:f=false})=>{let o=S.useMemo(()=>new Date().toLocaleDateString(),[]),d=(a,s)=>{let n=s?k[s]:void 0;return !n&&s==="printButton"&&(n=k.primaryButton),chunkE64TU6IU_js.a(a,n,f)},l=a=>new Date(a).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),N=a=>{let s=r.answers[a];return s==null?"Not answered":typeof s=="boolean"?s?"Yes":"No":Array.isArray(s)?s.join(", "):String(s)},w=()=>{window.print();},C=a=>{v&&v(a);},A=a=>jsxRuntime.jsx("span",{className:d(`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",critical:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[a]}`,"riskBadge"),children:a.charAt(0).toUpperCase()+a.slice(1)});return jsxRuntime.jsxs("div",{className:`${d("bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 print:shadow-none print:p-0","root")} ${u}`,children:[jsxRuntime.jsxs("div",{className:d("mb-8 border-b border-gray-200 dark:border-gray-700 pb-6 print:pb-4","header"),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h1",{className:d("text-2xl font-bold text-gray-900 dark:text-white mb-2","title"),children:"Data Protection Impact Assessment Report"}),jsxRuntime.jsx("h2",{className:"text-xl text-gray-700 dark:text-gray-300 mb-4",children:r.title})]}),(x||y)&&jsxRuntime.jsxs("div",{className:"flex space-x-2 print:hidden",children:[x&&jsxRuntime.jsx("button",{onClick:w,className:`${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")} ${b}`,children:jsxRuntime.jsxs("span",{className:"flex items-center",children:[jsxRuntime.jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"})}),"Print"]})}),y&&jsxRuntime.jsx("div",{className:"relative inline-block",children:jsxRuntime.jsx("button",{onClick:()=>C("pdf"),className:`px-3 py-1 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${b}`,children:jsxRuntime.jsxs("span",{className:"flex items-center",children:[jsxRuntime.jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Export PDF"]})})})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Assessor:"})," ",r.assessor.name,", ",r.assessor.role]}),jsxRuntime.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Contact:"})," ",r.assessor.email]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Started:"})," ",l(r.startedAt)]}),jsxRuntime.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Completed:"})," ",r.completedAt?l(r.completedAt):"In progress"]}),jsxRuntime.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Next review:"})," ",r.reviewDate?l(r.reviewDate):"Not scheduled"]})]})]})]}),jsxRuntime.jsxs("div",{className:d("mb-8","summary"),children:[jsxRuntime.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Executive Summary"}),jsxRuntime.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md mb-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center mb-2",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("span",{className:"font-medium mr-2",children:"Overall Risk Level:"}),A(r.overallRiskLevel)]}),jsxRuntime.jsxs("div",{className:d("mb-2","conclusion"),children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Conclusion:"})," ",r.conclusion]}),jsxRuntime.jsxs("div",{role:"status","aria-live":"polite",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Can Proceed:"})," ",r.canProceed?"Yes":"No"]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-medium text-gray-900 dark:text-white mb-2",children:"Processing Activity Description"}),jsxRuntime.jsx("p",{className:"text-gray-700 dark:text-gray-300 mb-4",children:r.processingDescription}),r.recommendations&&r.recommendations.length>0&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-medium text-gray-900 dark:text-white mb-2",children:"Key Recommendations"}),jsxRuntime.jsx("ul",{className:"list-disc pl-5 text-gray-700 dark:text-gray-300",children:r.recommendations.map((a,s)=>jsxRuntime.jsx("li",{className:d("","recommendation"),children:a},s))})]})]})]}),jsxRuntime.jsxs("div",{className:"mb-8",children:[jsxRuntime.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Identified Risks"}),r.risks.length===0?jsxRuntime.jsx("p",{className:"text-gray-700 dark:text-gray-300",children:"No risks identified."}):jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:d("min-w-full divide-y divide-gray-200 dark:divide-gray-700","riskTable"),children:[jsxRuntime.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Risk"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Likelihood"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Impact"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Risk Level"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Mitigated"})]})}),jsxRuntime.jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:r.risks.map(a=>jsxRuntime.jsxs("tr",{className:d("","riskRow"),children:[jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-900 dark:text-gray-100",children:a.description}),jsxRuntime.jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-400",children:[a.likelihood," / 5"]}),jsxRuntime.jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-400",children:[a.impact," / 5"]}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm",children:A(a.level)}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-400",children:a.mitigated?jsxRuntime.jsx("span",{className:"text-green-600 dark:text-green-400",children:"Yes"}):jsxRuntime.jsx("span",{className:"text-red-600 dark:text-red-400",children:"No"})})]},a.id))})]})})]}),p&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Full Assessment Details"}),c.map(a=>{let s=a.questions.filter(n=>r.answers[n.id]!==void 0);return s.length===0?null:jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:a.title}),jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[jsxRuntime.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Question"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Answer"})]})}),jsxRuntime.jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:s.map(n=>jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-900 dark:text-gray-100",children:n.text}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-600 dark:text-gray-400",children:N(n.id)})]},n.id))})]})})]},a.id)})]}),jsxRuntime.jsxs("div",{className:"mt-8 pt-4 border-t border-gray-200 dark:border-gray-700 text-sm text-gray-600 dark:text-gray-400",children:[jsxRuntime.jsx("p",{children:"This DPIA was conducted in accordance with the Nigeria Data Protection Act (NDPA) 2023."}),jsxRuntime.jsxs("p",{children:["DPIA Report Version: ",r.version]}),jsxRuntime.jsxs("p",{children:["Generated on: ",o]})]})]})};var E=({steps:r,onStepClick:c,clickable:p=true,orientation:x="horizontal",className:y="",activeStepClassName:v="",completedStepClassName:u="",incompleteStepClassName:b="",classNames:k={},unstyled:f=false})=>{let o=(i,g)=>chunkE64TU6IU_js.a(i,g?k[g]:void 0,f),d=i=>{p&&c&&c(i);},l=x==="vertical";return jsxRuntime.jsx("div",{role:"navigation","aria-label":"Step progress",className:`${o(l?"flex flex-col space-y-4":"flex items-center justify-between","root")} ${y}`,children:r.map((i,g)=>{let N=g===r.length-1,w=i.active?o(`font-medium ${v||"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]"}`,"label"):i.completed?o(u||"text-green-600 dark:text-green-400","label"):o(b||"text-gray-600 dark:text-gray-400","label"),C=i.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)] text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] border-2 border-[rgb(var(--ndpr-primary))] dark:border-[rgb(var(--ndpr-primary))]","stepActive"):i.completed?o("flex items-center justify-center w-8 h-8 rounded-full bg-green-100 dark:bg-green-900 text-green-600 dark:text-green-400 border-2 border-green-600 dark:border-green-400","stepCompleted"):o("flex items-center justify-center w-8 h-8 rounded-full bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-400 border-2 border-gray-300 dark:border-gray-600","stepPending");return jsxRuntime.jsxs(S__default.default.Fragment,{children:[jsxRuntime.jsxs("div",{className:o(`${l?"flex items-start":"flex flex-col items-center"} ${p?"cursor-pointer":""}`,"step"),onClick:()=>d(i.id),"aria-current":i.active?"step":void 0,children:[jsxRuntime.jsx("div",{className:`
|
|
2
|
-
flex items-center justify-center
|
|
3
|
-
${l?"mr-4":""}
|
|
4
|
-
`,children:jsxRuntime.jsx("div",{className:C,children:i.icon?i.icon:i.completed?jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}):jsxRuntime.jsx("span",{children:g+1})})}),jsxRuntime.jsxs("div",{className:`
|
|
5
|
-
${l?"flex-1":"mt-2 text-center"}
|
|
6
|
-
`,children:[jsxRuntime.jsx("div",{className:`text-sm font-medium ${w}`,children:i.label}),i.description&&jsxRuntime.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-400 mt-1",children:i.description})]})]}),!N&&jsxRuntime.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")})]},i.id)})})};exports.a=j;exports.b=E;//# sourceMappingURL=chunk-5ECDPRSZ.js.map
|
|
7
|
-
//# sourceMappingURL=chunk-5ECDPRSZ.js.map
|
package/dist/chunk-6YN73KR7.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a as a$2}from'./chunk-GKKAK6ES.mjs';import {a}from'./chunk-AYKLAEOU.mjs';import {b,a as a$1}from'./chunk-WWT2ZSNU.mjs';import {useState}from'react';import {jsxs,jsx}from'react/jsx-runtime';var mr=({requestTypes:A,onSubmit:V,onValidationError:S,title:s="Submit a Data Subject Request",description:N="Use this form to exercise your rights under the Nigeria Data Protection Act (NDPA), Part IV, Sections 29-36.",submitButtonText:rr="Submit Request",className:D="",buttonClassName:_="",showConfirmation:er=true,confirmationMessage:ir="Your request has been submitted successfully. You will receive a confirmation email shortly.",requireIdentityVerification:P=true,identifierTypes:R=[{id:"email",label:"Email Address"},{id:"account",label:"Account Number"},{id:"customer_id",label:"Customer ID"}],collectAdditionalContact:tr=true,labels:f={},classNames:r,unstyled:o=false,isSubmitting:x=false,defaultValues:a$3,onReset:F})=>{var Y,H,L,U,W,J;let[h,j]=useState((a$3==null?void 0:a$3.requestType)||""),[T,E]=useState(((Y=a$3==null?void 0:a$3.dataSubject)==null?void 0:Y.fullName)||""),[q,O]=useState(((H=a$3==null?void 0:a$3.dataSubject)==null?void 0:H.email)||""),[w,B]=useState(((L=a$3==null?void 0:a$3.dataSubject)==null?void 0:L.phone)||""),[z,M]=useState(((U=a$3==null?void 0:a$3.dataSubject)==null?void 0:U.identifierType)||((W=R[0])==null?void 0:W.id)||""),[$,Z]=useState(((J=a$3==null?void 0:a$3.dataSubject)==null?void 0:J.identifierValue)||""),[l,C]=useState((a$3==null?void 0:a$3.additionalInfo)||{}),[or,I]=useState(false),[d,G]=useState({}),nr=()=>{var e;j(""),E(""),O(""),B(""),M(((e=R[0])==null?void 0:e.id)||""),Z(""),C({}),I(false),G({}),F==null||F();},u=A.find(e=>e.id===h),dr=e=>{j(e.target.value),C({});},c=(e,b$1)=>{C(m=>b(a$1({},m),{[e]:b$1}));},ar=()=>{let e={};return T.trim()||(e.fullName="Full name is required"),q.trim()?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(q)||(e.email="Email is invalid"):e.email="Email is required",h||(e.requestType="Please select a request type"),P&&!$.trim()&&(e.identifierValue="Identifier value is required"),u!=null&&u.requiresAdditionalInfo&&u.additionalFields&&u.additionalFields.forEach(b=>{b.required&&!l[b.id]&&(e[`additional_${b.id}`]=`${b.label} is required`);}),G(e),e},ur=e=>{e.preventDefault();let b=ar();if(Object.keys(b).length>0){S==null||S(b);return}let m=Object.keys(l).length>0?Object.fromEntries(Object.entries(l).map(([g,v])=>[g,typeof v=="string"?a$2(v):v])):void 0,k={requestType:h,dataSubject:{fullName:a$2(T),email:a$2(q),phone:w?a$2(w):void 0,identifierType:z,identifierValue:a$2($)},additionalInfo:m,submittedAt:Date.now()};V(k),er&&I(true);};return or?jsxs("div",{className:a(`p-4 bg-green-50 dark:bg-green-900/20 rounded-md ${D}`,r==null?void 0:r.successMessage,o),"aria-live":"polite",children:[jsx("h2",{className:a("text-lg font-bold text-green-800 dark:text-green-200 mb-2",r==null?void 0:r.title,o),children:"Request Submitted"}),jsx("p",{className:a("text-green-700 dark:text-green-300",r==null?void 0:r.description,o),children:ir}),jsx("button",{onClick:()=>I(false),className:a(`mt-4 px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${_}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:"Submit Another Request"})]}):jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${D}`,r==null?void 0:r.root,o),children:[jsx("h2",{className:a("text-xl font-bold mb-2",r==null?void 0:r.title,o),children:s}),jsx("p",{className:a("mb-6 text-gray-600 dark:text-gray-300",r==null?void 0:r.description,o),children:N}),jsx("form",{onSubmit:ur,className:a("",r==null?void 0:r.form,o),children:jsxs("div",{className:a("space-y-4",r==null?void 0:r.fieldGroup,o),children:[jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Personal Information"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"fullName",className:a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:[f.name||"Full Name"," ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",id:"fullName",value:T,onChange:e=>E(e.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),required:true,"aria-required":"true","aria-invalid":!!d.fullName,"aria-describedby":d.fullName?"fullName-error":void 0}),d.fullName&&jsx("p",{id:"fullName-error",role:"alert",className:"mt-1 text-sm text-red-500",children:d.fullName})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"email",className:a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:[f.email||"Email Address"," ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"email",id:"email",value:q,onChange:e=>O(e.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),required:true,"aria-required":"true","aria-invalid":!!d.email,"aria-describedby":d.email?"email-error":void 0}),d.email&&jsx("p",{id:"email-error",role:"alert",className:"mt-1 text-sm text-red-500",children:d.email})]}),tr&&jsxs("div",{children:[jsx("label",{htmlFor:"phone",className:a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:"Phone Number (Optional)"}),jsx("input",{type:"tel",id:"phone",value:w,onChange:e=>B(e.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Request Details"}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"requestType",className:a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:[f.requestType||"Request Type"," ",jsx("span",{className:"text-red-500",children:"*"})]}),jsxs("select",{id:"requestType",value:h,onChange:dr,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),required:true,"aria-required":"true","aria-invalid":!!d.requestType,"aria-describedby":d.requestType?"requestType-error":void 0,children:[jsx("option",{value:"",children:"Select a request type"}),A.map(e=>jsx("option",{value:e.id,children:e.name},e.id))]}),d.requestType&&jsx("p",{id:"requestType-error",role:"alert",className:"mt-1 text-sm text-red-500",children:d.requestType})]}),u&&jsxs("div",{className:"mb-4 p-3 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 mb-2",children:u.description}),jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Estimated completion time: ",u.estimatedCompletionTime," ",u.estimatedCompletionTime===1?"day":"days"]})]}),jsxs("div",{className:"mb-4",children:[jsx("label",{htmlFor:"requestDescription",className:a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:f.description||"Additional Information"}),jsx("textarea",{id:"requestDescription",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.textarea,o),rows:4,placeholder:"Please provide any additional details that might help us process your request"})]})]}),P&&jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Identity Verification"}),jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 mb-3",children:"To protect your privacy, we need to verify your identity before processing your request."}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"identifierType",className:a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:["Identifier Type ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("select",{id:"identifierType",value:z,onChange:e=>M(e.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),required:true,"aria-required":"true",children:R.map(e=>jsx("option",{value:e.id,children:e.label},e.id))})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"identifierValue",className:a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:["Identifier Value ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",id:"identifierValue",value:$,onChange:e=>Z(e.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),required:true,"aria-required":"true","aria-invalid":!!d.identifierValue,"aria-describedby":d.identifierValue?"identifierValue-error":void 0}),d.identifierValue&&jsx("p",{id:"identifierValue-error",role:"alert",className:"mt-1 text-sm text-red-500",children:d.identifierValue})]})]})]}),(u==null?void 0:u.requiresAdditionalInfo)&&u.additionalFields&&u.additionalFields.length>0&&jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Additional Information"}),jsx("div",{className:"space-y-4",children:u.additionalFields.map(e=>{var b,m,k;return jsxs("div",{children:[jsxs("label",{htmlFor:e.id,className:a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:[e.label," ",e.required&&jsx("span",{className:"text-red-500",children:"*"})]}),e.type==="text"&&jsx("input",{type:"text",id:e.id,value:String((b=l[e.id])!=null?b:""),onChange:g=>c(e.id,g.target.value),placeholder:e.placeholder,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),required:e.required,"aria-required":e.required||void 0,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0}),e.type==="textarea"&&jsx("textarea",{id:e.id,value:String((m=l[e.id])!=null?m:""),onChange:g=>c(e.id,g.target.value),placeholder:e.placeholder,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.textarea,o),rows:4,required:e.required,"aria-required":e.required||void 0,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0}),e.type==="select"&&e.options&&jsxs("select",{id:e.id,value:String((k=l[e.id])!=null?k:""),onChange:g=>c(e.id,g.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),required:e.required,"aria-required":e.required||void 0,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0,children:[jsx("option",{value:"",children:e.placeholder||"Select an option"}),e.options.map(g=>jsx("option",{value:g,children:g},g))]}),e.type==="checkbox"&&jsxs("div",{className:"flex items-start",children:[jsx("div",{className:"flex items-center h-5",children:jsx("input",{type:"checkbox",id:e.id,checked:!!l[e.id],onChange:g=>c(e.id,g.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]",required:e.required,"aria-required":e.required||void 0,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0})}),jsx("div",{className:"ml-3 text-sm",children:jsx("label",{htmlFor:e.id,className:"text-gray-700 dark:text-gray-300",children:e.placeholder||e.label})})]}),e.type==="file"&&jsx("input",{type:"file",id:e.id,onChange:g=>{var K;let v=(K=g.target.files)==null?void 0:K[0];v&&c(e.id,v.name);},className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),required:e.required,"aria-required":e.required||void 0,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0}),d[`additional_${e.id}`]&&jsx("p",{id:`additional-${e.id}-error`,role:"alert",className:"mt-1 text-sm text-red-500",children:d[`additional_${e.id}`]})]},e.id)})})]}),jsxs("div",{className:"mt-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("h3",{className:"text-sm font-semibold mb-2",children:"Privacy Notice"}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-300",children:"The information you provide in this form will be used solely for the purpose of processing your data subject request. We will retain this information for as long as necessary to fulfill your request and to comply with our legal obligations. For more information, please refer to our Privacy Policy."})]}),jsxs("div",{className:"mt-6 flex gap-3 relative",children:[x&&(r==null?void 0:r.loadingOverlay)&&jsx("div",{className:r.loadingOverlay}),jsx("button",{type:"submit",disabled:x,className:a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${_} ${x?"opacity-50 cursor-not-allowed":""}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:x?"Submitting...":f.submit||rr}),jsx("button",{type:"button",onClick:nr,className:a("px-6 py-3 bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-200 rounded-md hover:bg-gray-300 dark:hover:bg-gray-500 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2",void 0,o),children:"Reset"})]})]})})]})};export{mr as a};//# sourceMappingURL=chunk-6YN73KR7.mjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-6YN73KR7.mjs.map
|
package/dist/chunk-CDZDT2OS.mjs
DELETED
|
@@ -1,320 +0,0 @@
|
|
|
1
|
-
import {b,d as d$1,c}from'./chunk-GCQRHMTQ.mjs';import {a}from'./chunk-6WIP33TW.mjs';import {d,b as b$1,a as a$1}from'./chunk-WWT2ZSNU.mjs';import {useRef,useState,useEffect,useMemo,useCallback}from'react';function M(r){return r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function ce(r){return r.toLowerCase().replace(/[^a-z0-9\s-]/g,"").trim().replace(/\s+/g,"-")}function Le(r){let u=r.split(`
|
|
2
|
-
`),v=[],e=false;for(let a of u){let s=a.trimEnd();s.startsWith("- ")||s.startsWith("\u2022 ")?(e||(v.push("<ul>"),e=true),v.push(` <li>${M(s.replace(/^[-•]\s*/,""))}</li>`)):(e&&(v.push("</ul>"),e=false),s.trim()===""||v.push(`<p>${M(s)}</p>`));}return e&&v.push("</ul>"),v.join(`
|
|
3
|
-
`)}var Ne=`
|
|
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 ee(r,u){var R;let v=(u==null?void 0:u.includeStyles)!==false,e=(R=u==null?void 0:u.customCSS)!=null?R:"",a=r.sections.filter(d=>d.included),s=M(r.organizationInfo.name||"Organisation"),t=M(r.title||"Privacy Policy"),l=M(r.version||"1.0"),c=r.effectiveDate?new Date(r.effectiveDate).toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}):new Date().toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}),y=r.lastUpdated?new Date(r.lastUpdated).toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}):c,C=r.organizationInfo.website?`<a href="${M(r.organizationInfo.website)}" target="_blank" rel="noopener">${M(r.organizationInfo.website)}</a>`:"",x=r.organizationInfo.privacyEmail?`<a href="mailto:${M(r.organizationInfo.privacyEmail)}">${M(r.organizationInfo.privacyEmail)}</a>`:"",k=`
|
|
247
|
-
<nav class="policy-toc" aria-label="Table of Contents">
|
|
248
|
-
<h2>Table of Contents</h2>
|
|
249
|
-
<ol>
|
|
250
|
-
${a.map((d,w)=>` <li><a href="#${ce(d.title)}">${M(d.title)}</a></li>`).join(`
|
|
251
|
-
`)}
|
|
252
|
-
</ol>
|
|
253
|
-
</nav>`,F=a.map((d,w)=>{let p=ce(d.title),T=d.template||d.defaultContent||"",b=Le(T);return ` <section class="policy-section" id="${p}" aria-labelledby="section-heading-${p}">
|
|
254
|
-
<h2 id="section-heading-${p}">
|
|
255
|
-
<span class="section-number" aria-hidden="true">${w+1}</span>
|
|
256
|
-
${M(d.title)}
|
|
257
|
-
</h2>
|
|
258
|
-
${b}
|
|
259
|
-
</section>`}).join(`
|
|
260
|
-
|
|
261
|
-
`),z=e?e.replace(/<\/style>/gi,""):"",L=v?`<style>
|
|
262
|
-
${Ne}
|
|
263
|
-
${z?`
|
|
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
|
-
${z}`:""}
|
|
266
|
-
</style>`:z?`<style>${z}</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 ${s}" />
|
|
272
|
-
<meta name="generator" content="NDPA Toolkit" />
|
|
273
|
-
<title>${t} \u2014 ${s}</title>
|
|
274
|
-
${L}
|
|
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> ${s}</span>
|
|
283
|
-
<span><strong>Effective:</strong> ${c}</span>
|
|
284
|
-
<span><strong>Version:</strong> ${l}</span>
|
|
285
|
-
${y!==c?`<span><strong>Last updated:</strong> ${y}</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
|
-
${k}
|
|
293
|
-
|
|
294
|
-
<article class="policy-body" aria-label="Policy content">
|
|
295
|
-
|
|
296
|
-
${F}
|
|
297
|
-
|
|
298
|
-
</article>
|
|
299
|
-
|
|
300
|
-
<footer class="policy-footer" role="contentinfo">
|
|
301
|
-
<div>${s}${C?` — ${C}`:""}</div>
|
|
302
|
-
${x?`<div>Privacy contact: ${x}</div>`:""}
|
|
303
|
-
<div>Effective ${c} • Version ${l}</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 Ie(r){return r.toLowerCase().replace(/[^a-z0-9\s-]/g,"").trim().replace(/\s+/g,"-")}function te(r){let u=r.sections.filter(l=>l.included),v=r.title||"Privacy Policy",e=r.organizationInfo.name||"Organisation",a=r.version||"1.0",s=r.effectiveDate?new Date(r.effectiveDate).toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}):new Date().toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}),t=[];return t.push(`# ${v}`),t.push(""),t.push(`_Effective: ${s} | Version: ${a} | ${e}_`),t.push(""),r.organizationInfo.website&&t.push(`**Website:** ${r.organizationInfo.website} `),r.organizationInfo.privacyEmail&&t.push(`**Privacy contact:** ${r.organizationInfo.privacyEmail} `),(r.organizationInfo.website||r.organizationInfo.privacyEmail)&&t.push(""),t.push("> This privacy policy is compliant with the **Nigeria Data Protection Act (NDPA) 2023**."),t.push(""),t.push("---"),t.push(""),u.length>0&&(t.push("## Table of Contents"),t.push(""),u.forEach((l,c)=>{let y=Ie(`${c+1} ${l.title}`);t.push(`${c+1}. [${l.title}](#${y})`);}),t.push(""),t.push("---"),t.push("")),u.forEach((l,c)=>{t.push(`## ${c+1}. ${l.title}`),t.push("");let y=(l.template||l.defaultContent||"").trim();if(y){let C=y.split(`
|
|
310
|
-
`);for(let x of C){let D=x.trimEnd();D.startsWith("-")||D.startsWith("\u2022")||D===""?t.push(D.replace(/^•/,"-")):t.push(D);}}t.push(""),t.push("---"),t.push("");}),t.push(`_Generated by **NDPA Toolkit** \u2014 ${e} \u2022 Version ${a}_`),t.push(""),t.join(`
|
|
311
|
-
`)}function oe(r,u){return d(this,null,function*(){var R;let v;try{let d=yield import('jspdf');v=(R=d.jsPDF)!=null?R:d.default;}catch(d){throw new Error(`[ndpr-toolkit] PDF export requires the "jspdf" package. Install it with:
|
|
312
|
-
pnpm add jspdf
|
|
313
|
-
See: https://ndprtoolkit.com.ng/docs/guides/styling-customization`)}let e=new v({unit:"mm",format:"a4"}),a=e.internal.pageSize.getWidth(),s=e.internal.pageSize.getHeight(),t=20,l=a-t*2,c=t,y=r.organizationInfo.name||"",C=r.title||"Privacy Policy",x=r.version||"1.0",D=r.effectiveDate?new Date(r.effectiveDate).toLocaleDateString():new Date().toLocaleDateString(),k=()=>{e.setFontSize(8),e.setFont("helvetica","italic"),e.setTextColor(150,150,150),e.text(y?`${y} \u2014 ${C}`:C,t,12),e.setDrawColor(220,220,220),e.setLineWidth(.3),e.line(t,14,a-t,14),e.setTextColor(0,0,0);},F=d=>{c+d>s-t-10&&(e.addPage(),c=t+8,k());};if((u==null?void 0:u.includeCoverPage)!==false){e.setFillColor(22,163,74),e.rect(0,0,a,12,"F"),e.setFontSize(28),e.setFont("helvetica","bold"),e.setTextColor(22,163,74);let d=e.splitTextToSize(C,l-10),w=72;d.forEach(T=>{e.text(T,a/2,w,{align:"center"}),w+=11;}),e.setDrawColor(22,163,74),e.setLineWidth(.6);let p=w+6;if(e.line(a/2-30,p,a/2+30,p),e.setFontSize(14),e.setFont("helvetica","normal"),e.setTextColor(40,40,40),e.text(y,a/2,p+14,{align:"center"}),e.setFontSize(10),e.setTextColor(100,100,100),e.text(`Effective Date: ${D}`,a/2,p+26,{align:"center"}),e.text(`Version ${x}`,a/2,p+34,{align:"center"}),(u==null?void 0:u.includeComplianceBadge)!==false){let T=p+52,b="Compliant with the Nigeria Data Protection Act (NDPA) 2023";e.setFontSize(8.5),e.setFont("helvetica","bold"),e.setTextColor(255,255,255);let g=e.getTextWidth(b),m=7,_=3.5,H=(a-g-m*2)/2;e.setFillColor(22,163,74),e.roundedRect(H,T-_-1,g+m*2,7+_,2,2,"F"),e.text(b,a/2,T+1.5,{align:"center"}),e.setTextColor(0,0,0);}e.setFillColor(22,163,74),e.rect(0,s-12,a,12,"F"),e.addPage(),c=t+8,k();}let z=r.sections.filter(d=>d.included);(u==null?void 0:u.includeTOC)!==false&&(e.setFontSize(18),e.setFont("helvetica","bold"),e.setTextColor(22,163,74),e.text("Table of Contents",t,c+4),e.setDrawColor(22,163,74),e.setLineWidth(.5),e.line(t,c+8,t+80,c+8),c+=18,e.setFontSize(10.5),e.setFont("helvetica","normal"),e.setTextColor(40,40,40),z.forEach((d,w)=>{F(7);let p=`${w+1}. ${d.title}`;e.text(p,t+4,c),c+=6.5;}),e.addPage(),c=t+8,k()),z.forEach((d,w)=>{F(18),e.setFillColor(22,163,74),e.circle(t+3.5,c-1.5,3.8,"F"),e.setFontSize(8),e.setFont("helvetica","bold"),e.setTextColor(255,255,255),e.text(String(w+1),t+3.5,c-.5,{align:"center"}),e.setFontSize(13),e.setFont("helvetica","bold"),e.setTextColor(22,163,74),e.text(d.title,t+11,c),c+=3,e.setDrawColor(200,200,200),e.setLineWidth(.25),e.line(t+11,c,a-t,c),c+=6;let p=(d.template||d.defaultContent||"").trim();if(p){let T=p.split(`
|
|
314
|
-
`);e.setFontSize(9.5),e.setFont("helvetica","normal"),e.setTextColor(50,50,50),T.forEach(b=>{let g=b.trimEnd();if(g===""){c+=3;return}let m=g.startsWith("-")||g.startsWith("\u2022"),_=m?t+8:t+4,H=m?g.replace(/^[-•]\s*/,""):g,A=l-(m?12:8);e.splitTextToSize(H,A).forEach((X,Z)=>{F(5),m&&Z===0&&(e.setFillColor(22,163,74),e.circle(t+4,c-1,.9,"F")),e.text(X,_,c),c+=5;});});}c+=10;});let L=e.getNumberOfPages();for(let d=1;d<=L;d++)e.setPage(d),e.setFontSize(7.5),e.setFont("helvetica","normal"),e.setTextColor(160,160,160),e.setDrawColor(220,220,220),e.setLineWidth(.3),e.line(t,s-12,a-t,s-12),e.text(y?`${y} \u2014 Privacy Policy`:"Privacy Policy",t,s-8),e.text(`Page ${d} of ${L}`,a-t,s-8,{align:"right"}),e.setTextColor(0,0,0);return e.setProperties({title:C,author:y,subject:"Privacy Policy \u2014 NDPA 2023 Compliant",keywords:"privacy policy, NDPA, Nigeria, data protection"}),e.output("blob")})}function re(r,u){return d(this,null,function*(){let v;try{v=yield import('docx');}catch(b){throw new Error(`[ndpr-toolkit] Word export requires the "docx" package. Install it with:
|
|
315
|
-
pnpm add docx
|
|
316
|
-
See: https://ndprtoolkit.com.ng/docs/guides/styling-customization`)}let{Document:e,Paragraph:a,TextRun:s,HeadingLevel:t,Packer:l,Header:c,Footer:y,PageNumber:C,AlignmentType:x,BorderStyle:D,ShadingType:k,TableOfContents:F}=v,z=r.organizationInfo.name||"",L=r.title||"Privacy Policy",R=r.version||"1.0",d=r.effectiveDate?new Date(r.effectiveDate).toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}):new Date().toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}),w=r.sections.filter(b=>b.included),p=[];if(p.push(new a({children:[new s({text:L,bold:true,size:52,color:"064e3b"})],heading:t.TITLE,spacing:{after:160},alignment:x.CENTER})),p.push(new a({children:[new s({text:`${z}${z?" \u2022 ":""}Version ${R} \u2022 Effective ${d}`,size:20,color:"6b7280",italics:true})],spacing:{after:120},alignment:x.CENTER})),p.push(new a({children:[new s({text:"Compliant with the Nigeria Data Protection Act (NDPA) 2023",size:18,color:"16a34a",bold:true})],spacing:{after:400},alignment:x.CENTER})),p.push(new a({children:[],spacing:{after:200},border:{bottom:{color:"16a34a",style:D.SINGLE,size:6,space:1}}})),(u==null?void 0:u.includeTOC)!==false){if(p.push(new a({children:[new s({text:"Table of Contents",bold:true,size:28,color:"064e3b"})],heading:t.HEADING_1,spacing:{before:400,after:200}})),typeof F=="function")try{p.push(new F("Table of Contents",{hyperlink:!0,headingStyleRange:"1-1"}));}catch(b){w.forEach((g,m)=>{p.push(new a({children:[new s({text:`${m+1}. ${g.title}`,size:22,color:"15803d"})],spacing:{after:80}}));});}else w.forEach((b,g)=>{p.push(new a({children:[new s({text:`${g+1}. ${b.title}`,size:22,color:"15803d"})],spacing:{after:80}}));});p.push(new a({children:[],pageBreakBefore:true}));}w.forEach((b,g)=>{p.push(new a({children:[new s({text:`${g+1}. ${b.title}`,bold:true,size:28,color:"064e3b"})],heading:t.HEADING_1,spacing:{before:400,after:200},border:{bottom:{color:"dcfce7",style:D.SINGLE,size:4,space:1}}}));let m=(b.template||b.defaultContent||"").trim();m&&m.split(`
|
|
317
|
-
`).forEach(H=>{let A=H.trimEnd();if(A===""){p.push(new a({children:[],spacing:{after:60}}));return}let N=A.startsWith("- ")||A.startsWith("\u2022 "),X=N?A.replace(/^[-•]\s*/,""):A;N?p.push(new a({children:[new s({text:X,size:22})],spacing:{after:80},bullet:{level:0}})):p.push(new a({children:[new s({text:X,size:22})],spacing:{after:100}}));});}),p.push(new a({children:[new s({text:`Generated by NDPA Toolkit \u2014 ${z}${z?" \u2014 ":""}Privacy Policy v${R}`,size:16,color:"9ca3af",italics:true})],spacing:{before:600},alignment:x.CENTER}));let T=new e({title:L,description:"Privacy Policy \u2014 NDPA 2023 Compliant",styles:{paragraphStyles:[{id:"Normal",name:"Normal",run:{font:"Calibri",size:22}}]},sections:[{headers:{default:new c({children:[new a({children:[new s({text:z||"Privacy Policy",size:16,color:"9ca3af"})],alignment:x.RIGHT})]})},footers:{default:new y({children:[new a({children:[new s({text:"Page ",size:16,color:"9ca3af"}),new s({children:[C.CURRENT],size:16,color:"9ca3af"}),new s({text:" of ",size:16,color:"9ca3af"}),new s({children:[C.TOTAL_PAGES],size:16,color:"9ca3af"})],alignment:x.CENTER})]})},children:p}]});return l.toBlob(T)})}var le=10,Me="ndpr_policy_draft",Re=2e3;function de(){return `section_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function pe(){return `draft_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function U(r,u,v){let e=Date.now();return {id:v,title:`Privacy Policy${r.org.name?` \u2014 ${r.org.name}`:""}`,templateId:"adaptive-policy-wizard",organizationInfo:{name:r.org.name,website:r.org.website,privacyEmail:r.org.privacyEmail,address:r.org.address,dpoName:r.org.dpoName,dpoEmail:r.org.dpoEmail,industry:r.org.industry},sections:u,variableValues:{},effectiveDate:e,lastUpdated:e,version:"1.0",applicableFrameworks:["ndpa","ndpr"]}}function ot(r={}){var ne;let{onComplete:u,onComplianceChange:v}=r,e=useRef((ne=r.adapter)!=null?ne:a(Me));r.adapter&&(e.current=r.adapter);let a$2=useRef(pe()),[s,t]=useState(1),[l,c$1]=useState(b),[y,C]=useState([]),[x,D]=useState({}),[k,F]=useState([]),[z,L]=useState(false),[R,d$2]=useState(null),[w,p]=useState(true),T=useRef(false),b$2=useRef(null);useEffect(()=>{let o=false,n=i=>{i&&(a$2.current=i.id,c$1(i.templateContext),C(i.customSections),D(i.sectionOverrides),F(i.sectionOrder),t(i.currentStep),d$2(i.lastSavedAt),L(true));};try{let i=e.current.load();i instanceof Promise?i.then(h=>{o||(n(h),p(!1));},()=>{o||p(!1);}):(n(i),p(!1));}catch(i){o||p(false);}return ()=>{o=true;}},[]);let g=useMemo(()=>{let n=d$1(l).map(f=>x[f.id]?b$1(a$1({},f),{template:x[f.id]}):f),i=y.map(f=>{var E;return {id:f.id,title:f.title,template:(E=x[f.id])!=null?E:f.content,order:f.order,required:false,included:true}}),h=[...n,...i];if(k.length>0){let f=new Map(k.map((E,$)=>[E,$]));return [...h].sort((E,$)=>{let O=f.has(E.id)?f.get(E.id):h.length,W=f.has($.id)?f.get($.id):h.length;return O-W})}return [...h].sort((f,E)=>{var $,O;return (($=f.order)!=null?$:0)-((O=E.order)!=null?O:0)})},[l,y,x,k]),m=useMemo(()=>!l.org.name&&!l.org.privacyEmail?null:U(l,g,a$2.current),[l,g]),_=useMemo(()=>U(b(),[],a$2.current),[]),H=useMemo(()=>c(m!=null?m:_,l),[m,l,_]),A=H.percentage,N=H.gaps,X=useRef({score:-1,gaps:[]});useEffect(()=>{let o=X.current;v&&(A!==o.score||N!==o.gaps)&&v(A,N),X.current={score:A,gaps:N};},[A,N,v]);let Z=useMemo(()=>{switch(s){case 1:return l.org.name.trim().length>0&&l.org.privacyEmail.trim().length>0;case 2:return l.dataCategories.some(o=>o.selected);case 3:return l.purposes.length>0;case 4:return true;default:return false}},[s,l]),me=useCallback(o=>{let n=Math.min(Math.max(1,o),4);n<4&&(T.current=false),t(n);},[]),ue=useCallback(()=>{t(o=>Math.min(o+1,4));},[]),ge=useCallback(()=>{T.current=false,t(o=>Math.max(o-1,1));},[]),fe=useCallback(o=>{c$1(n=>a$1(a$1({},n),o));},[]),he=useCallback(o=>{c$1(n=>b$1(a$1({},n),{org:a$1(a$1({},n.org),o)}));},[]),ye=useCallback(o=>{c$1(n=>b$1(a$1({},n),{dataCategories:n.dataCategories.map(i=>i.id===o?b$1(a$1({},i),{selected:!i.selected}):i)}));},[]),ve=useCallback(o=>{c$1(n=>{let i=o,h=n.purposes.includes(i);return b$1(a$1({},n),{purposes:h?n.purposes.filter(f=>f!==o):[...n.purposes,i]})});},[]),xe=useCallback(o=>{c$1(n=>b$1(a$1({},n),{thirdPartyProcessors:[...n.thirdPartyProcessors,o]}));},[]),be=useCallback(o=>{c$1(n=>b$1(a$1({},n),{thirdPartyProcessors:n.thirdPartyProcessors.filter((i,h)=>h!==o)}));},[]),Pe=useCallback(o=>{C(n=>n.length>=le?n:[...n,b$1(a$1({},o),{id:de(),required:false})]);},[]),Ce=useCallback((o,n)=>{C(i=>i.map(h=>h.id===o?a$1(a$1({},h),n):h));},[]),we=useCallback(o=>{C(n=>n.filter(i=>i.id!==o)),F(n=>n.filter(i=>i!==o)),D(n=>{let i=a$1({},n);return delete i[o],i});},[]),Se=useCallback((o,n)=>{F(i=>{let h=i.length>0?i:g.map(O=>O.id),f=h.indexOf(o);if(f===-1){let O=g.map(Ae=>Ae.id),W=O.indexOf(o);if(W===-1)return i;let K=n==="up"?W-1:W+1;if(K<0||K>=O.length)return O;let j=[...O];return [j[W],j[K]]=[j[K],j[W]],j}let E=n==="up"?f-1:f+1;if(E<0||E>=h.length)return h;let $=[...h];return [$[f],$[E]]=[$[E],$[f]],$});},[g]),De=useCallback((o,n)=>{D(i=>b$1(a$1({},i),{[o]:n}));},[]),Te=useCallback(o=>{let n=N.find(i=>i.requirementId===o);if(n)switch(n.fixType){case "fill_field":{T.current=false;let h=["data-categories-disclosed"],f=["purpose-of-processing"];h.includes(o)?t(2):f.includes(o)?t(3):(t(1));break}case "add_section":{if(!n.suggestedContent)break;C(i=>i.length>=le?i:[...i,{id:de(),title:n.requirement,content:n.suggestedContent,order:999,required:false}]);break}case "add_content":{if(!n.suggestedContent)break;let i="data-subject-rights";D(h=>{var E,$,O;let f=(O=($=h[i])!=null?$:(E=g.find(W=>W.id===i))==null?void 0:E.template)!=null?O:"";return b$1(a$1({},h),{[i]:`${f}
|
|
318
|
-
|
|
319
|
-
${n.suggestedContent}`.trim()})});break}}},[N,g]),Y=useCallback(o=>({id:a$2.current,templateContext:l,customSections:y,sectionOverrides:x,sectionOrder:k,currentStep:o,lastSavedAt:Date.now(),status:"draft"}),[l,y,x,k]),Ee=useCallback(()=>d(null,null,function*(){let o=Y(s);try{yield Promise.resolve(e.current.save(o)),d$2(o.lastSavedAt),L(!0);}catch(n){console.warn("[ndpr-toolkit] Failed to save draft:",n);}}),[Y,s]),$e=useCallback(()=>{Promise.resolve(e.current.remove()).catch(o=>{console.warn("[ndpr-toolkit] Failed to remove draft:",o);}),a$2.current=pe(),T.current=false,c$1(b()),C([]),D({}),F([]),t(1),L(false),d$2(null);},[]);useEffect(()=>{if(!w)return b$2.current&&clearTimeout(b$2.current),b$2.current=setTimeout(()=>{let o=Y(s);Promise.resolve(e.current.save(o)).then(()=>{d$2(o.lastSavedAt),L(true);}).catch(n=>{console.warn("[ndpr-toolkit] Auto-save failed:",n);});},Re),()=>{b$2.current&&clearTimeout(b$2.current);}},[l,y,x,k,s,w,Y]),useEffect(()=>{s===4&&m&&u&&!T.current&&(T.current=true,u(m));},[s,m,u]);let ze=useCallback(o=>d(null,null,function*(){let n=m!=null?m:U(l,g,a$2.current);return oe(n,o)}),[m,l,g]),Oe=useCallback(o=>d(null,null,function*(){let n=m!=null?m:U(l,g,a$2.current);return re(n,o)}),[m,l,g]),ke=useCallback(o=>{let n=m!=null?m:U(l,g,a$2.current);return ee(n,o)},[m,l,g]),Fe=useCallback(()=>{let o=m!=null?m:U(l,g,a$2.current);return te(o)},[m,l,g]);return {currentStep:s,goToStep:me,nextStep:ue,prevStep:ge,canProceed:Z,context:l,updateContext:fe,updateOrg:he,toggleDataCategory:ye,togglePurpose:ve,addProcessor:xe,removeProcessor:be,policy:m,sections:g,customSections:y,addCustomSection:Pe,updateCustomSection:Ce,removeCustomSection:we,reorderSections:Se,editSectionContent:De,sectionOverrides:x,complianceScore:A,complianceResult:H,complianceGaps:N,applyFix:Te,handleExportPDF:ze,handleExportDOCX:Oe,handleExportHTML:ke,handleExportMarkdown:Fe,isDraftSaved:z,lastSavedAt:R,saveDraft:Ee,discardDraft:$e,isLoading:w}}export{ee as a,te as b,oe as c,re as d,ot as e};//# sourceMappingURL=chunk-CDZDT2OS.mjs.map
|
|
320
|
-
//# sourceMappingURL=chunk-CDZDT2OS.mjs.map
|
package/dist/chunk-CWUPGY3M.mjs
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import {a as a$2}from'./chunk-GKKAK6ES.mjs';import {a}from'./chunk-AYKLAEOU.mjs';import {a as a$1,b}from'./chunk-WWT2ZSNU.mjs';import {useState}from'react';import {jsxs,jsx}from'react/jsx-runtime';var qe=({categories:pe,onSubmit:ge,onValidationError:N,title:be="Report a Data Breach",formDescription:fe="Use this form to report a suspected or confirmed data breach in accordance with NDPA Section 40. All fields marked with * are required.",submitButtonText:ue="Submit Report",className:M="",buttonClassName:z="",classNames:d={},unstyled:c=false,isSubmitting:f=false,showConfirmation:he=true,confirmationMessage:ve="Your breach report has been submitted successfully. The data protection team has been notified.",allowAttachments:ye=true,maxAttachments:A=5,maxFileSize:k=5*1024*1024,allowedFileTypes:w=[".pdf",".jpg",".jpeg",".png",".doc",".docx",".xls",".xlsx",".txt"],defaultValues:t,onReset:S})=>{var ie,oe,se,ne,de;let L=r=>{if(!r)return "";let o=new Date(r),l=s=>String(s).padStart(2,"0");return `${o.getFullYear()}-${l(o.getMonth()+1)}-${l(o.getDate())}T${l(o.getHours())}:${l(o.getMinutes())}`},[D,O]=useState((t==null?void 0:t.title)||""),[C,Y]=useState((t==null?void 0:t.description)||""),[F,U]=useState((t==null?void 0:t.category)||""),[T,H]=useState(L(t==null?void 0:t.discoveredAt)),[R,_]=useState(L(t==null?void 0:t.occurredAt)),[B,Z]=useState(((ie=t==null?void 0:t.reporter)==null?void 0:ie.name)||""),[v,G]=useState(((oe=t==null?void 0:t.reporter)==null?void 0:oe.email)||""),[j,K]=useState(((se=t==null?void 0:t.reporter)==null?void 0:se.department)||""),[E,W]=useState(((ne=t==null?void 0:t.reporter)==null?void 0:ne.phone)||""),[J,Q]=useState((t==null?void 0:t.affectedSystems)||[]),[xe,X]=useState(((de=t==null?void 0:t.affectedSystems)==null?void 0:de.join(", "))||""),[q,V]=useState((t==null?void 0:t.dataTypes)||[]),[u,ee]=useState((t==null?void 0:t.estimatedAffectedSubjects)!=null?String(t.estimatedAffectedSubjects):""),[re,te]=useState((t==null?void 0:t.status)||"ongoing"),[I,ae]=useState((t==null?void 0:t.initialActions)||""),[y,$]=useState([]),[Ne,P]=useState(false),[i,h]=useState({}),Ae=()=>{O(""),Y(""),U(""),H(""),_(""),Z(""),G(""),K(""),W(""),Q([]),X(""),V([]),ee(""),te("ongoing"),ae(""),$([]),P(false),h({}),S==null||S();},ke=r=>{let o=r.target.value;X(o);let l=o.split(",").map(s=>s.trim()).filter(Boolean);Q(l);},we=r=>{V(o=>o.includes(r)?o.filter(l=>l!==r):[...o,r]);},Se=r=>{var me;let o=r.target.files;if(!o)return;let l=[],s={};if(y.length+o.length>A){s.attachments=`Maximum of ${A} files allowed`,h(p=>a$1(a$1({},p),s));return}for(let p=0;p<o.length;p++){let x=o[p];if(x.size>k){s.attachments=`File ${x.name} exceeds the maximum size of ${k/(1024*1024)}MB`;continue}let ce="."+((me=x.name.split(".").pop())==null?void 0:me.toLowerCase());if(!w.includes(ce)){s.attachments=`File type ${ce} is not allowed`;continue}l.push(x);}l.length>0&&$(p=>[...p,...l]),Object.keys(s).length>0?h(p=>a$1(a$1({},p),s)):h(p=>b(a$1({},p),{attachments:""}));},De=r=>{$(o=>o.filter((l,s)=>s!==r));},Ce=()=>{let r={};return D.trim()||(r.breachTitle="Breach title is required"),C.trim()||(r.description="Description is required"),F||(r.category="Category is required"),T||(r.discoveredAt="Discovery date is required"),B.trim()||(r.reporterName="Reporter name is required"),v.trim()?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(v)||(r.reporterEmail="Reporter email is invalid"):r.reporterEmail="Reporter email is required",j.trim()||(r.reporterDepartment="Reporter department is required"),J.length===0&&(r.affectedSystems="At least one affected system is required"),q.length===0&&(r.dataTypes="At least one data type is required"),u&&isNaN(Number(u))&&(r.estimatedAffectedSubjects="Estimated affected subjects must be a number"),h(r),r},Fe=r=>{r.preventDefault();let o=Ce();if(Object.keys(o).length>0){N==null||N(o);return}let l={title:a$2(D),description:a$2(C),category:F,discoveredAt:new Date(T).getTime(),occurredAt:R?new Date(R).getTime():void 0,reportedAt:Date.now(),reporter:{name:a$2(B),email:a$2(v),department:a$2(j),phone:E?a$2(E):void 0},affectedSystems:J.map(s=>a$2(s)),dataTypes:q,estimatedAffectedSubjects:u?Number(u):void 0,status:re,initialActions:I?a$2(I):void 0,attachments:y.map(s=>({name:s.name,type:s.type,size:s.size,file:s}))};ge(l),he&&P(true);};if(Ne)return jsxs("div",{className:`p-4 bg-green-50 dark:bg-green-900/20 rounded-md ${M}`,children:[jsx("h2",{className:"text-lg font-bold text-green-800 dark:text-green-200 mb-2",children:"Report Submitted"}),jsx("p",{className:"text-green-700 dark:text-green-300",children:ve}),jsxs("div",{className:"mt-4 p-4 bg-yellow-50 dark:bg-yellow-900/20 rounded-md",children:[jsx("h3",{className:"text-sm font-bold text-yellow-800 dark:text-yellow-200 mb-2",children:"Important: Next Steps"}),jsx("p",{className:"text-yellow-700 dark:text-yellow-300 text-sm",children:"Under the NDPA (Section 40), data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. The data protection team will assess this breach and determine if notification is required."})]}),jsx("button",{onClick:()=>P(false),className:`mt-4 px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${z}`,children:"Report Another Breach"})]});let Te=[{id:"personal",label:"Personal Information (names, addresses)"},{id:"contact",label:"Contact Information (email, phone)"},{id:"financial",label:"Financial Information (bank details, payment info)"},{id:"health",label:"Health Information"},{id:"identification",label:"Identification Documents (ID cards, passports)"},{id:"login",label:"Login Credentials"},{id:"biometric",label:"Biometric Data"},{id:"children",label:"Children's Data"},{id:"location",label:"Location Data"},{id:"communications",label:"Communications Content"}];return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${M}`,d.root,c),children:[jsx("h2",{className:a("text-xl font-bold mb-2",d.title,c),children:be}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:fe}),jsx("form",{onSubmit:Fe,className:a("",d.form,c),children:jsxs("div",{className:"space-y-6",children:[jsxs("div",{className:a("",d.fieldGroup,c),children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Breach Information"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"breachTitle",className:a("block text-sm font-medium mb-1",d.label,c),children:["Breach Title/Summary ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",id:"breachTitle",value:D,onChange:r=>O(r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",d.input,c),required:true,"aria-invalid":!!i.breachTitle,"aria-describedby":i.breachTitle?"breachTitle-error":void 0}),i.breachTitle&&jsx("p",{id:"breachTitle-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.breachTitle})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"category",className:a("block text-sm font-medium mb-1",d.label,c),children:["Breach Category ",jsx("span",{className:"text-red-500",children:"*"})]}),jsxs("select",{id:"category",value:F,onChange:r=>U(r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",d.select,c),required:true,"aria-invalid":!!i.category,"aria-describedby":i.category?"category-error":void 0,children:[jsx("option",{value:"",children:"Select a category"}),pe.map(r=>jsx("option",{value:r.id,children:r.name},r.id))]}),i.category&&jsx("p",{id:"category-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.category})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{htmlFor:"description",className:a("block text-sm font-medium mb-1",d.label,c),children:["Detailed Description ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("textarea",{id:"description",value:C,onChange:r=>Y(r.target.value),rows:4,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",d.textarea,c),required:true,"aria-invalid":!!i.description,"aria-describedby":i.description?"description-error":void 0}),i.description&&jsx("p",{id:"description-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.description})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"discoveredAt",className:"block text-sm font-medium mb-1",children:["Date Discovered ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"datetime-local",id:"discoveredAt",value:T,onChange:r=>H(r.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true,"aria-invalid":!!i.discoveredAt,"aria-describedby":i.discoveredAt?"discoveredAt-error":void 0}),i.discoveredAt&&jsx("p",{id:"discoveredAt-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.discoveredAt})]}),jsxs("div",{children:[jsx("label",{htmlFor:"occurredAt",className:"block text-sm font-medium mb-1",children:"Date Occurred (if known)"}),jsx("input",{type:"datetime-local",id:"occurredAt",value:R,onChange:r=>_(r.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Reporter Information"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"reporterName",className:"block text-sm font-medium mb-1",children:["Your Name ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",id:"reporterName",value:B,onChange:r=>Z(r.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true,"aria-invalid":!!i.reporterName,"aria-describedby":i.reporterName?"reporterName-error":void 0}),i.reporterName&&jsx("p",{id:"reporterName-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.reporterName})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"reporterEmail",className:"block text-sm font-medium mb-1",children:["Your Email ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"email",id:"reporterEmail",value:v,onChange:r=>G(r.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true,"aria-invalid":!!i.reporterEmail,"aria-describedby":i.reporterEmail?"reporterEmail-error":void 0}),i.reporterEmail&&jsx("p",{id:"reporterEmail-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.reporterEmail})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"reporterDepartment",className:"block text-sm font-medium mb-1",children:["Your Department ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",id:"reporterDepartment",value:j,onChange:r=>K(r.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true,"aria-invalid":!!i.reporterDepartment,"aria-describedby":i.reporterDepartment?"reporterDepartment-error":void 0}),i.reporterDepartment&&jsx("p",{id:"reporterDepartment-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.reporterDepartment})]}),jsxs("div",{children:[jsx("label",{htmlFor:"reporterPhone",className:"block text-sm font-medium mb-1",children:"Your Phone Number (Optional)"}),jsx("input",{type:"tel",id:"reporterPhone",value:E,onChange:r=>W(r.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Impact Information"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"affectedSystems",className:"block text-sm font-medium mb-1",children:["Affected Systems/Applications ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",id:"affectedSystems",value:xe,onChange:ke,placeholder:"e.g. CRM, Email Server, Website (comma separated)",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true,"aria-invalid":!!i.affectedSystems,"aria-describedby":i.affectedSystems?"affectedSystems-error":void 0}),i.affectedSystems&&jsx("p",{id:"affectedSystems-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.affectedSystems})]}),jsxs("div",{children:[jsx("label",{htmlFor:"estimatedAffectedSubjects",className:"block text-sm font-medium mb-1",children:"Estimated Number of Affected Data Subjects"}),jsx("input",{type:"text",id:"estimatedAffectedSubjects",value:u,onChange:r=>ee(r.target.value),placeholder:"e.g. 100",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]","aria-invalid":!!i.estimatedAffectedSubjects,"aria-describedby":i.estimatedAffectedSubjects?"estimatedAffectedSubjects-error":void 0}),i.estimatedAffectedSubjects&&jsx("p",{id:"estimatedAffectedSubjects-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.estimatedAffectedSubjects})]}),jsxs("fieldset",{className:"md:col-span-2",children:[jsxs("legend",{className:"block text-sm font-medium mb-1",children:["Types of Data Involved ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:Te.map(r=>jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"checkbox",id:`dataType_${r.id}`,checked:q.includes(r.id),onChange:()=>we(r.id),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("label",{htmlFor:`dataType_${r.id}`,className:"ml-2 text-sm text-gray-700 dark:text-gray-300",children:r.label})]},r.id))}),i.dataTypes&&jsx("p",{id:"dataTypes-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.dataTypes})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"status",className:"block text-sm font-medium mb-1",children:["Current Status ",jsx("span",{className:"text-red-500",children:"*"})]}),jsxs("select",{id:"status",value:re,onChange:r=>te(r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",d.select,c),required:true,children:[jsx("option",{value:"ongoing",children:"Ongoing (breach is still active)"}),jsx("option",{value:"contained",children:"Contained (breach is stopped but not resolved)"}),jsx("option",{value:"resolved",children:"Resolved (breach is fully addressed)"})]})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"initialActions",className:"block text-sm font-medium mb-1",children:"Initial Actions Taken"}),jsx("textarea",{id:"initialActions",value:I,onChange:r=>ae(r.target.value),placeholder:"Describe any immediate actions that have been taken to address the breach",rows:3,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",d.textarea,c)})]})]})]}),ye&&jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Attachments"}),jsxs("div",{className:"mb-4",children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"Upload Supporting Files (Optional)"}),jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-2",children:["Max ",A," files, ",k/(1024*1024),"MB each. Allowed types: ",w.join(", ")]}),jsx("input",{type:"file",onChange:Se,multiple:true,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",accept:w.join(",")}),i.attachments&&jsx("p",{id:"attachments-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.attachments})]}),y.length>0&&jsxs("div",{className:"mb-4",children:[jsx("h4",{className:"text-sm font-medium mb-2",children:"Attached Files:"}),jsx("ul",{className:"space-y-2",children:y.map((r,o)=>jsxs("li",{className:"flex items-center justify-between p-2 bg-gray-50 dark:bg-gray-700 rounded",children:[jsxs("div",{className:"flex items-center",children:[jsx("svg",{className:"w-4 h-4 text-gray-500 dark:text-gray-400 mr-2",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{fillRule:"evenodd",d:"M8 4a3 3 0 00-3 3v4a5 5 0 0010 0V7a1 1 0 112 0v4a7 7 0 11-14 0V7a5 5 0 0110 0v4a3 3 0 11-6 0V7a1 1 0 012 0v4a1 1 0 102 0V7a3 3 0 00-3-3z",clipRule:"evenodd"})}),jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:r.name}),jsxs("span",{className:"ml-2 text-xs text-gray-600 dark:text-gray-400",children:["(",(r.size/1024).toFixed(1)," KB)"]})]}),jsx("button",{type:"button",onClick:()=>De(o),className:"text-red-500 hover:text-red-700",children: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:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]},o))})]})]}),jsxs("div",{className:a("mt-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",d.notice,c),children:[jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Breach Notification Requirements"}),jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"Under the Nigeria Data Protection Act (NDPA), Section 40, data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. The data protection team will assess this breach and determine if notification is required."})]}),jsxs("div",{className:"mt-6 relative flex gap-3",children:[f&&d.loadingOverlay&&jsx("div",{className:d.loadingOverlay}),jsx("button",{type:"submit",disabled:f,className:a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${z} ${f?"opacity-50 cursor-not-allowed":""}`,d.primaryButton||d.submitButton,c),children:f?"Submitting...":ue}),jsx("button",{type:"button",onClick:Ae,disabled:f,className:a("px-6 py-3 bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-200 rounded-md hover:bg-gray-300 dark:hover:bg-gray-500 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2",void 0,c),children:"Reset"})]})]})})]})};
|
|
2
|
-
export{qe as a};//# sourceMappingURL=chunk-CWUPGY3M.mjs.map
|
|
3
|
-
//# sourceMappingURL=chunk-CWUPGY3M.mjs.map
|