@tantainnovative/ndpr-toolkit 3.5.1 → 3.5.5
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 +100 -0
- package/README.md +12 -7
- package/dist/adapters.js +1 -2
- package/dist/adapters.mjs +1 -2
- package/dist/breach.d.mts +80 -1
- package/dist/breach.d.ts +80 -1
- package/dist/breach.js +1 -2
- package/dist/breach.mjs +1 -2
- package/dist/{chunk-PATONNTZ.mjs → chunk-3HOXQNCH.mjs} +1 -2
- package/dist/{chunk-MJGOLP5M.js → chunk-3IA3KDII.js} +1 -2
- package/dist/{chunk-M2TPT5GB.js → chunk-3JPDTXGC.js} +1 -2
- package/dist/{chunk-BKRETVJ6.js → chunk-3YTAOT5O.js} +1 -2
- package/dist/{chunk-GOU6FU6Y.js → chunk-4CVBQC66.js} +1 -2
- package/dist/{chunk-E4NCJ7RD.mjs → chunk-4G3SRVRI.mjs} +1 -2
- package/dist/{chunk-6QPRDQZF.js → chunk-4QXTB3L6.js} +1 -2
- package/dist/{chunk-XNSZ7KUH.js → chunk-5GVMKUMP.js} +1 -2
- package/dist/chunk-66NQ5CVY.mjs +1 -0
- package/dist/{chunk-JBSCER34.js → chunk-6NXXQYQL.js} +1 -2
- package/dist/chunk-732C2EVN.js +1 -0
- package/dist/chunk-7BJXI2HI.mjs +1 -0
- package/dist/{chunk-C5QO3SX4.js → chunk-7IFSWCQP.js} +1 -2
- package/dist/{chunk-A4PK7JB2.js → chunk-7ZZO7GVB.js} +1 -2
- package/dist/chunk-AME4HJR4.js +1 -0
- package/dist/chunk-AOHKVFAS.mjs +322 -0
- package/dist/{chunk-HO5M7M4M.js → chunk-B46SJB5V.js} +1 -2
- package/dist/chunk-BFAX7JQA.mjs +1 -0
- package/dist/{chunk-ID2NYIVE.mjs → chunk-BNHQFZHL.mjs} +2 -3
- package/dist/{chunk-RLYTX3MM.js → chunk-BRS52EDT.js} +1 -2
- package/dist/{chunk-OPYQIJKY.js → chunk-C7IDR2IV.js} +1 -2
- package/dist/{chunk-CISJAQ6W.mjs → chunk-COD3RMTL.mjs} +1 -2
- package/dist/chunk-CR2QZTGW.js +1 -0
- package/dist/{chunk-6WIP33TW.mjs → chunk-DBZSN4WP.mjs} +1 -2
- package/dist/{chunk-74Z23WUA.mjs → chunk-EEQALYOY.mjs} +1 -2
- package/dist/chunk-EFIBHKQE.mjs +1 -0
- package/dist/{chunk-GKKAK6ES.mjs → chunk-EWVK45Z3.mjs} +1 -2
- package/dist/{chunk-QSVVAZVT.mjs → chunk-EXEXUAF6.mjs} +1 -2
- package/dist/chunk-EZCGTHQV.js +6 -0
- package/dist/{chunk-SYMQJO2W.mjs → chunk-GTYXVAJX.mjs} +2 -3
- package/dist/{chunk-6FGCGLH5.mjs → chunk-H3XJV2IR.mjs} +1 -2
- package/dist/chunk-HBLGN4SD.js +1 -0
- package/dist/{chunk-MCWV7S2G.js → chunk-HHK5LHEG.js} +1 -2
- package/dist/{chunk-XHROISIF.mjs → chunk-HWHBINVN.mjs} +1 -2
- package/dist/{chunk-3EGQWLJ6.js → chunk-I2LMQWK3.js} +2 -3
- package/dist/{chunk-NQNFS3QI.js → chunk-I3Y4LOSL.js} +4 -5
- package/dist/chunk-ITCY2Z66.mjs +4 -0
- package/dist/{chunk-Z6IIMLZU.mjs → chunk-KDAZQO3N.mjs} +1 -2
- package/dist/{chunk-J5WCPZLW.js → chunk-L2BRFMVS.js} +1 -2
- package/dist/chunk-L2VO3MEJ.js +1 -0
- package/dist/{chunk-R5FW5XUQ.mjs → chunk-LQTARVPU.mjs} +1 -2
- package/dist/{chunk-6TA2MVTU.mjs → chunk-LRRENTT5.mjs} +1 -2
- package/dist/{chunk-LIM64IV2.js → chunk-LVGT3DLT.js} +2 -3
- package/dist/{chunk-TXBZPCGF.mjs → chunk-LWIKDDSU.mjs} +1 -2
- package/dist/chunk-MPBPAEZC.mjs +1 -0
- package/dist/{chunk-Z73T6MWY.js → chunk-N3MQQUQP.js} +39 -35
- package/dist/{chunk-RY3PGVLZ.mjs → chunk-NBZUZYTB.mjs} +1 -2
- package/dist/{chunk-HGGLW5TE.js → chunk-NUWVPRNI.js} +1 -2
- package/dist/chunk-O45PKBZA.mjs +6 -0
- package/dist/chunk-O6CUBNXK.mjs +3 -0
- package/dist/{chunk-7SMLHZ4B.js → chunk-P4LNLCSF.js} +1 -2
- package/dist/{chunk-VWPGIES4.mjs → chunk-PCU6GKBE.mjs} +1 -2
- package/dist/chunk-PGI2LM6P.js +103 -0
- package/dist/{chunk-U62QYKVG.mjs → chunk-PJNKQPQP.mjs} +1 -2
- package/dist/{chunk-LSNL4XR5.js → chunk-PZRQWPWD.js} +1 -2
- package/dist/chunk-Q64735OC.js +144 -0
- package/dist/chunk-QPRYXVH2.js +1 -0
- package/dist/{chunk-MQFZHA2D.js → chunk-RFPLZDIO.js} +1 -2
- package/dist/chunk-RMQ7OLNY.mjs +144 -0
- package/dist/{chunk-2AW7KAZO.mjs → chunk-RPXRPGHL.mjs} +1 -2
- package/dist/chunk-RYREGZVQ.js +1 -0
- package/dist/{chunk-B4Z5MBUC.mjs → chunk-RZ6GC6WN.mjs} +1 -2
- package/dist/chunk-S6COXIZA.js +2 -0
- package/dist/chunk-SFGW37LE.mjs +1 -0
- package/dist/{chunk-3NQQSU4P.js → chunk-SJDDNB6M.js} +1 -2
- package/dist/{chunk-H3EYBSVP.mjs → chunk-TMXK4QKK.mjs} +2 -3
- package/dist/{chunk-P42Z5CFE.js → chunk-TQZWJGJ2.js} +1 -2
- package/dist/{chunk-EPT2K355.mjs → chunk-U5RWJRGA.mjs} +1 -2
- package/dist/{chunk-R3OYAJI6.mjs → chunk-UASG46LP.mjs} +1 -2
- package/dist/{chunk-RXL6CZAI.js → chunk-UAV7V4EM.js} +1 -2
- package/dist/chunk-UI536RU2.js +3 -0
- package/dist/{chunk-7AVN424U.js → chunk-UTFBKL73.js} +1 -2
- package/dist/{chunk-I54CDQGN.js → chunk-UXUMYP4L.js} +1 -2
- package/dist/{chunk-P3PULLYP.mjs → chunk-V7UFP6QU.mjs} +1 -2
- package/dist/{chunk-I4M2AA3N.js → chunk-VJTQXVAF.js} +1 -2
- package/dist/{chunk-ELKB2AFZ.js → chunk-VWED6UTN.js} +1 -2
- package/dist/{chunk-LU7PKE7Y.mjs → chunk-VYAL2TGT.mjs} +1 -2
- package/dist/chunk-W47OSMT6.js +2 -0
- package/dist/chunk-W65ZWTLD.mjs +1 -0
- package/dist/{chunk-5HL4UBFV.js → chunk-WDDCKYWA.js} +1 -2
- package/dist/{chunk-DJGS7SSN.mjs → chunk-WTGKZX7J.mjs} +1 -2
- package/dist/{chunk-TDDAYVKK.js → chunk-WZYCBW2R.js} +1 -2
- package/dist/chunk-X3GCGC3H.mjs +103 -0
- package/dist/chunk-XJO4DH3L.mjs +2 -0
- package/dist/{chunk-LWXZMKC2.js → chunk-XO3VQYTL.js} +7 -8
- package/dist/{chunk-IZCWCE7W.mjs → chunk-XOH4WXOZ.mjs} +1 -2
- package/dist/{chunk-SHMJNRHO.mjs → chunk-XP5PL6K7.mjs} +1 -2
- package/dist/{chunk-CKGJK4D7.mjs → chunk-Y3MKMAFQ.mjs} +2 -3
- package/dist/chunk-YFBDJ4FH.js +1 -0
- package/dist/chunk-YTU4FNM2.mjs +1 -0
- package/dist/{chunk-TV4U6AIS.js → chunk-Z763UI5U.js} +1 -2
- package/dist/chunk-ZHFLBL63.mjs +2 -0
- package/dist/{chunk-RRVKUCFR.mjs → chunk-ZIZL37BG.mjs} +1 -2
- package/dist/{chunk-WWT2ZSNU.mjs → chunk-ZJYULEER.mjs} +1 -2
- package/dist/{chunk-LJNNPAFU.mjs → chunk-ZQZJNKVB.mjs} +1 -2
- package/dist/chunk-ZVOIR4QH.js +4 -0
- package/dist/consent.js +1 -2
- package/dist/consent.mjs +1 -2
- package/dist/core.d.mts +98 -19
- package/dist/core.d.ts +98 -19
- package/dist/core.js +1 -2
- package/dist/core.mjs +1 -2
- package/dist/cross-border.d.mts +36 -14
- package/dist/cross-border.d.ts +36 -14
- package/dist/cross-border.js +1 -2
- package/dist/cross-border.mjs +1 -2
- package/dist/dpia.d.mts +4 -4
- package/dist/dpia.d.ts +4 -4
- package/dist/dpia.js +1 -2
- package/dist/dpia.mjs +1 -2
- package/dist/dsr.d.mts +30 -17
- package/dist/dsr.d.ts +30 -17
- package/dist/dsr.js +1 -2
- package/dist/dsr.mjs +1 -2
- package/dist/hooks.d.mts +113 -20
- package/dist/hooks.d.ts +113 -20
- package/dist/hooks.js +1 -2
- package/dist/hooks.mjs +1 -2
- package/dist/index.d.mts +422 -26
- package/dist/index.d.ts +422 -26
- package/dist/index.js +1 -2
- package/dist/index.mjs +1 -2
- package/dist/lawful-basis.js +1 -2
- package/dist/lawful-basis.mjs +1 -2
- package/dist/policy.js +1 -2
- package/dist/policy.mjs +1 -2
- package/dist/presets.d.mts +54 -5
- package/dist/presets.d.ts +54 -5
- package/dist/presets.js +1 -2
- package/dist/presets.mjs +1 -2
- package/dist/ropa.js +1 -2
- package/dist/ropa.mjs +1 -2
- package/dist/server.d.mts +89 -19
- package/dist/server.d.ts +89 -19
- package/dist/server.js +1 -2
- package/dist/server.mjs +1 -2
- package/dist/styles.css +34 -0
- package/dist/unstyled.d.mts +3 -1
- package/dist/unstyled.d.ts +3 -1
- package/dist/unstyled.js +1 -2
- package/dist/unstyled.mjs +1 -2
- package/package.json +59 -20
- package/dist/chunk-3VQAYQR7.js +0 -7
- package/dist/chunk-6HZL2WDU.mjs +0 -2
- package/dist/chunk-75TJPK2N.mjs +0 -2
- package/dist/chunk-ABDB7LEV.mjs +0 -2
- package/dist/chunk-AYKLAEOU.mjs +0 -2
- package/dist/chunk-C4YM4UMI.js +0 -2
- package/dist/chunk-CKJAECGV.js +0 -2
- package/dist/chunk-CPK5D5FY.js +0 -132
- package/dist/chunk-CWHBCQGT.mjs +0 -2
- package/dist/chunk-E64TU6IU.js +0 -2
- package/dist/chunk-F5TXUA4O.mjs +0 -4
- package/dist/chunk-GN5C32JB.mjs +0 -2
- package/dist/chunk-GRLIPT5V.mjs +0 -132
- package/dist/chunk-I557S566.mjs +0 -15
- package/dist/chunk-JFFOPHU3.mjs +0 -318
- package/dist/chunk-KF3EFJEF.mjs +0 -3
- package/dist/chunk-ORFC66EA.js +0 -4
- package/dist/chunk-S4GRSNB4.js +0 -2
- package/dist/chunk-SCWNM4PC.mjs +0 -2
- package/dist/chunk-SKKOMFXH.js +0 -81
- package/dist/chunk-TCN22KYP.mjs +0 -7
- package/dist/chunk-TUNQUVHU.mjs +0 -81
- package/dist/chunk-VIQUXWJC.js +0 -2
- package/dist/chunk-WTJGLNTB.js +0 -3
- package/dist/chunk-XIM7KMD6.js +0 -2
- package/dist/chunk-YPKUHSK4.js +0 -15
- package/dist/chunk-ZPKVLTSX.js +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var p=["critical","high","medium","low"];function m(e){let i=new Date(e).getTime();if(isNaN(i))return 1/0;let t=(Date.now()-i)/(1e3*60*60*24*30.44);return Math.max(0,t)}function u(e){if(e.length===0)return 100;let i=e.filter(t=>t.pass).length;return Math.round(i/e.length*100)}function f(e){return [{key:"hasConsentMechanism",label:"Consent collection mechanism",priority:"critical",effort:"high",recommendation:"Implement a clear, affirmative consent collection mechanism before processing personal data.",ndpaSection:"Section 25",pass:e.hasConsentMechanism},{key:"hasPurposeSpecification",label:"Purpose specification at collection",priority:"critical",effort:"medium",recommendation:"Specify and communicate the purpose of data collection at the point of consent.",ndpaSection:"Section 25",pass:e.hasPurposeSpecification},{key:"hasWithdrawalMechanism",label:"Consent withdrawal mechanism",priority:"high",effort:"medium",recommendation:"Provide a simple mechanism for data subjects to withdraw consent at any time.",ndpaSection:"Section 26",pass:e.hasWithdrawalMechanism},{key:"hasMinorProtection",label:"Minor (child) data protection controls",priority:"high",effort:"high",recommendation:"Implement age-verification and parental-consent controls for processing data of minors.",ndpaSection:"Section 26",pass:e.hasMinorProtection},{key:"consentRecordsRetained",label:"Consent records retained",priority:"medium",effort:"low",recommendation:"Retain records of all consents obtained, including what was agreed to and when.",ndpaSection:"Section 25",pass:e.consentRecordsRetained}]}function g(e){let i=e.responseTimelineDays<=30;return [{key:"hasRequestMechanism",label:"DSR submission mechanism",priority:"critical",effort:"high",recommendation:"Implement a formal channel (e.g. a web form or email address) for data subjects to submit requests.",ndpaSection:"Section 34",pass:e.hasRequestMechanism},{key:"supportsAccess",label:"Right of access supported",priority:"high",effort:"medium",recommendation:"Enable data subjects to request and receive a copy of their personal data.",ndpaSection:"Section 34(1)(a)\u2013(b)",pass:e.supportsAccess},{key:"supportsRectification",label:"Right to rectification supported",priority:"high",effort:"medium",recommendation:"Allow data subjects to request correction of inaccurate or incomplete personal data.",ndpaSection:"Section 34(1)(c)",pass:e.supportsRectification},{key:"supportsErasure",label:"Right to erasure supported",priority:"high",effort:"high",recommendation:"Implement processes to delete personal data upon valid erasure requests.",ndpaSection:"Section 34(1)(d), Section 34(2)",pass:e.supportsErasure},{key:"supportsPortability",label:"Right to data portability supported",priority:"medium",effort:"high",recommendation:"Provide personal data in a structured, machine-readable format upon request.",ndpaSection:"Section 38",pass:e.supportsPortability},{key:"supportsObjection",label:"Right to object supported",priority:"medium",effort:"medium",recommendation:"Honour objections to processing where no compelling legitimate grounds override the data subject's interests.",ndpaSection:"Section 36",pass:e.supportsObjection},{key:"responseTimeline",label:"DSR response within 30 days",priority:"high",effort:"medium",recommendation:"Reduce DSR response time to 30 days or less per NDPC guidance (GAID 2025).",ndpaSection:"Section 34 (NDPC GAID 2025 timeline guidance)",pass:i}]}function y(e){return [{key:"conductedForHighRisk",label:"DPIA conducted for high-risk processing",priority:"critical",effort:"high",recommendation:"Conduct a Data Protection Impact Assessment before undertaking high-risk processing activities.",ndpaSection:"Section 28",pass:e.conductedForHighRisk},{key:"documentedRisks",label:"Risks documented in DPIA",priority:"high",effort:"medium",recommendation:"Document identified risks to data subjects' rights and freedoms within the DPIA.",ndpaSection:"Section 28",pass:e.documentedRisks},{key:"mitigationMeasures",label:"Mitigation measures documented",priority:"high",effort:"medium",recommendation:"Document mitigation measures and residual risk acceptance within the DPIA.",ndpaSection:"Section 28",pass:e.mitigationMeasures}]}function b(e){return [{key:"hasNotificationProcess",label:"Breach notification process in place",priority:"critical",effort:"high",recommendation:"Establish a documented breach notification process covering detection, assessment, and reporting.",ndpaSection:"Section 40",pass:e.hasNotificationProcess},{key:"notifiesWithin72Hours",label:"NDPC notified within 72 hours",priority:"critical",effort:"medium",recommendation:"Ensure the NDPC is notified of qualifying breaches within 72 hours of discovery.",ndpaSection:"Section 40",pass:e.notifiesWithin72Hours},{key:"hasRiskAssessment",label:"Breach risk assessment performed",priority:"high",effort:"medium",recommendation:"Perform a risk assessment for every identified breach to determine notification obligations.",ndpaSection:"Section 40",pass:e.hasRiskAssessment},{key:"hasRecordKeeping",label:"Breach records maintained",priority:"medium",effort:"low",recommendation:"Maintain a breach register documenting all incidents, assessments, and actions taken.",ndpaSection:"Section 40",pass:e.hasRecordKeeping}]}function S(e){let t=m(e.lastUpdated)<=13;return [{key:"hasPrivacyPolicy",label:"Privacy policy exists",priority:"critical",effort:"high",recommendation:"Draft and publish a comprehensive privacy policy that satisfies NDPA requirements.",ndpaSection:"Section 27",pass:e.hasPrivacyPolicy},{key:"isPubliclyAccessible",label:"Privacy policy publicly accessible",priority:"high",effort:"low",recommendation:"Make the privacy policy easily accessible to data subjects on your website or app.",ndpaSection:"Section 27",pass:e.isPubliclyAccessible},{key:"policyUpToDate",label:"Privacy policy reviewed within 13 months",priority:"medium",effort:"medium",recommendation:"Review and update the privacy policy at least annually to reflect current practices.",ndpaSection:"Section 27",pass:t},{key:"coversAllSections",label:"Privacy policy covers all required sections",priority:"high",effort:"medium",recommendation:"Ensure the privacy policy addresses all NDPA-mandated disclosures including lawful basis, retention, and subject rights.",ndpaSection:"Section 27",pass:e.coversAllSections}]}function R(e){return [{key:"documentedForAllProcessing",label:"Lawful basis documented for all processing",priority:"critical",effort:"high",recommendation:"Identify and document a valid lawful basis for every processing activity before it begins.",ndpaSection:"Section 25(1)",pass:e.documentedForAllProcessing},{key:"hasLegitimateInterestAssessment",label:"Legitimate interest assessment completed",priority:"medium",effort:"medium",recommendation:"Complete a Legitimate Interest Assessment (LIA) where legitimate interests is the chosen lawful basis.",ndpaSection:"Section 25(1)",pass:e.hasLegitimateInterestAssessment}]}function v(e){return [{key:"hasTransferMechanisms",label:"Transfer mechanisms in place",priority:"critical",effort:"high",recommendation:"Implement appropriate transfer mechanisms (SCCs, BCRs, adequacy decisions, or Section 43 derogations) for all cross-border transfers.",ndpaSection:"Section 41",pass:e.hasTransferMechanisms},{key:"adequacyAssessed",label:"Adequacy of destination country assessed",priority:"high",effort:"medium",recommendation:"Assess whether the destination country provides an adequate level of data protection before transferring.",ndpaSection:"Section 42",pass:e.adequacyAssessed},{key:"ndpcApprovalObtained",label:"NDPC approval obtained where required",priority:"high",effort:"high",recommendation:"Obtain NDPC approval (e.g. for binding corporate rules, codes of conduct, or certification mechanisms) for transfers to countries without adequacy decisions where required.",ndpaSection:"Section 42(5)",pass:e.ndpcApprovalObtained}]}function w(e){let t=m(e.lastReviewed)<=6;return [{key:"maintained",label:"Record of Processing Activities maintained",priority:"critical",effort:"high",recommendation:"Create and maintain a comprehensive Record of Processing Activities (ROPA) as required by the NDPA.",ndpaSection:"Section 29",pass:e.maintained},{key:"includesAllProcessing",label:"ROPA includes all processing activities",priority:"high",effort:"medium",recommendation:"Ensure the ROPA captures every processing activity across all departments and systems.",ndpaSection:"Section 29",pass:e.includesAllProcessing},{key:"ropaUpToDate",label:"ROPA reviewed within 6 months",priority:"medium",effort:"low",recommendation:"Review and update the ROPA at least every six months to reflect changes in processing activities.",ndpaSection:"Section 29",pass:t}]}var k=[{name:"consent",weight:.2,ndpaSections:["Section 25","Section 26"],evaluate:e=>f(e.consent)},{name:"dsr",weight:.15,ndpaSections:["Section 34","Section 35","Section 36","Section 37","Section 38"],evaluate:e=>g(e.dsr)},{name:"breach",weight:.15,ndpaSections:["Section 40"],evaluate:e=>b(e.breach)},{name:"policy",weight:.12,ndpaSections:["Section 27"],evaluate:e=>S(e.policy)},{name:"dpia",weight:.12,ndpaSections:["Section 28"],evaluate:e=>y(e.dpia)},{name:"lawfulBasis",weight:.1,ndpaSections:["Section 25(1)"],evaluate:e=>R(e.lawfulBasis)},{name:"crossBorder",weight:.08,ndpaSections:["Section 41","Section 42","Section 43"],evaluate:e=>v(e.crossBorder)},{name:"ropa",weight:.08,ndpaSections:["Section 29"],evaluate:e=>w(e.ropa)}];function P(e){return e>=90?"excellent":e>=70?"good":e>=40?"needs-work":"critical"}function A(e){let i={},t=[],s=0;for(let o of k){let a=o.evaluate(e),c=u(a),l=c*o.weight;s+=l;let d=[];for(let n of a)n.pass||(d.push(n.label),t.push({module:o.name,key:n.key,label:n.label,priority:n.priority,effort:n.effort,recommendation:n.recommendation,ndpaSection:n.ndpaSection}));i[o.name]={name:o.name,score:c,maxScore:100,weightedScore:Math.round(l*100)/100,ndpaSections:o.ndpaSections,gaps:d};}t.sort((o,a)=>p.indexOf(o.priority)-p.indexOf(a.priority));let r=Math.round(s),h=[{section:"Section 25",title:"Consent and lawful basis for processing"},{section:"Section 26",title:"Withdrawal of consent and minor protection"},{section:"Section 28",title:"Data Protection Impact Assessment"},{section:"Section 29",title:"Privacy notice requirements"},{section:"Section 30",title:"Records of processing activities"},{section:"Section 34",title:"Right of access"},{section:"Section 35",title:"Right to rectification"},{section:"Section 36",title:"Right to erasure"},{section:"Section 37",title:"Right to data portability"},{section:"Section 38",title:"Right to object"},{section:"Section 39",title:"Response timelines for data subject requests"},{section:"Section 40",title:"Data breach notification"},{section:"Section 43",title:"Cross-border transfer restrictions"},{section:"Section 44",title:"NDPC approval for cross-border transfers"}];return {score:r,rating:P(r),modules:i,recommendations:t,regulatoryReferences:h,generatedAt:new Date().toISOString()}}exports.a=A;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
'use strict';var o=Object.defineProperty,p=Object.defineProperties;var q=Object.getOwnPropertyDescriptors;var f=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable;var j=(a,c,b)=>c in a?o(a,c,{enumerable:true,configurable:true,writable:true,value:b}):a[c]=b,r=(a,c)=>{for(var b in c||(c={}))k.call(c,b)&&j(a,b,c[b]);if(f)for(var b of f(c))l.call(c,b)&&j(a,b,c[b]);return a},s=(a,c)=>p(a,q(c));var t=(a,c)=>{var b={};for(var d in a)k.call(a,d)&&c.indexOf(d)<0&&(b[d]=a[d]);if(a!=null&&f)for(var d of f(a))c.indexOf(d)<0&&l.call(a,d)&&(b[d]=a[d]);return b};var u=(a,c,b)=>new Promise((d,i)=>{var m=e=>{try{g(b.next(e));}catch(h){i(h);}},n=e=>{try{g(b.throw(e));}catch(h){i(h);}},g=e=>e.done?d(e.value):Promise.resolve(e.value).then(m,n);g((b=b.apply(a,c)).next());});exports.a=r;exports.b=s;exports.c=t;exports.d=u
|
|
2
|
-
//# sourceMappingURL=chunk-MQFZHA2D.js.map
|
|
1
|
+
'use strict';var o=Object.defineProperty,p=Object.defineProperties;var q=Object.getOwnPropertyDescriptors;var f=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable;var j=(a,c,b)=>c in a?o(a,c,{enumerable:true,configurable:true,writable:true,value:b}):a[c]=b,r=(a,c)=>{for(var b in c||(c={}))k.call(c,b)&&j(a,b,c[b]);if(f)for(var b of f(c))l.call(c,b)&&j(a,b,c[b]);return a},s=(a,c)=>p(a,q(c));var t=(a,c)=>{var b={};for(var d in a)k.call(a,d)&&c.indexOf(d)<0&&(b[d]=a[d]);if(a!=null&&f)for(var d of f(a))c.indexOf(d)<0&&l.call(a,d)&&(b[d]=a[d]);return b};var u=(a,c,b)=>new Promise((d,i)=>{var m=e=>{try{g(b.next(e));}catch(h){i(h);}},n=e=>{try{g(b.throw(e));}catch(h){i(h);}},g=e=>e.done?d(e.value):Promise.resolve(e.value).then(m,n);g((b=b.apply(a,c)).next());});exports.a=r;exports.b=s;exports.c=t;exports.d=u;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import {a}from'./chunk-ZJYULEER.mjs';var y="\xABTODO: ",W="\xBB";function c(e){return `${y}${e}\xBB`}function s(e,t,i,n,a){return {id:e,title:t,template:i,order:n,required:a,included:true}}function b(e){return e.filter(t=>t.selected)}function v(e){return {service_delivery:"Service Delivery \u2014 to provide, maintain, and improve the services you have requested from us",marketing:"Marketing \u2014 to send promotional communications where you have opted in to receive them",analytics:"Analytics \u2014 to analyse usage patterns and improve user experience",research:"Research \u2014 to conduct research and development for service improvement",legal_compliance:"Legal Compliance \u2014 to meet our obligations under Nigerian law, including the NDPA 2023",fraud_prevention:"Fraud Prevention \u2014 to detect, prevent, and respond to fraud, security threats, and abuse"}[e]}function P(e,t){let i=e.org.name||c("orgName"),n=e.org.website||c("website"),a=new Date().toISOString().slice(0,10);return s("introduction","Introduction & Scope",`This Privacy Policy explains how ${i} ("we", "us", or "our") collects, uses, stores, and protects personal data when you use our services and visit our website at ${n}. This policy is issued in compliance with the Nigeria Data Protection Act (NDPA) 2023 and the Nigeria Data Protection Regulation (NDPR). It applies to all personal data processed by ${i}, whether collected online or offline.
|
|
2
|
+
|
|
3
|
+
Effective Date: ${a}.
|
|
4
|
+
|
|
5
|
+
We are committed to protecting your privacy and ensuring that your personal data is handled responsibly and in accordance with applicable data protection legislation.`,t,true)}function w(e,t){let i=e.org.name||c("orgName"),n=b(e.dataCategories),a={identity:"Identity & Contact Information",financial:"Financial Information",behavioral:"Technical & Behavioral Data",sensitive:"Sensitive / Special-Category Data",children:"Children's Data"},o="",d=["identity","financial","behavioral","sensitive","children"];for(let p of d){let r=n.filter(l=>l.group===p);if(r.length>0){o+=`
|
|
6
|
+
${a[p]}:
|
|
7
|
+
`;for(let l of r)o+=`- ${l.label}: ${l.dataPoints.join(", ")}.
|
|
8
|
+
`;}}return o===""&&(o=`
|
|
9
|
+
- Personal data categories have not yet been specified.
|
|
10
|
+
`),s("data-collection","Data We Collect",`${i} collects the following categories of personal data in the course of providing our services. Data may be collected directly from you (e.g. through forms, account registration, or correspondence) or automatically (e.g. through cookies, server logs, and similar technologies).
|
|
11
|
+
`+o+`
|
|
12
|
+
We only collect personal data that is adequate, relevant, and limited to what is necessary for the purposes described in this policy, in accordance with the NDPA 2023.`,t,true)}function D(e,t){let i=e.org.name||c("orgName"),n=[];return (e.purposes.includes("service_delivery")||e.purposes.length===0)&&(n.push("- Consent: where you have given clear, informed, and voluntary consent for specific processing activities (NDPA Section 25)."),n.push("- Contract: where processing is necessary for the performance of a contract to which you are a party, or to take pre-contractual steps at your request (NDPA Section 25).")),e.purposes.includes("legal_compliance")&&n.push("- Legal Obligation: where processing is required for compliance with a legal obligation to which we are subject under Nigerian law."),e.purposes.includes("fraud_prevention")&&n.push("- Legitimate Interest: where processing is necessary for our legitimate interests (such as fraud prevention and network security), provided those interests are not overridden by your rights and freedoms (NDPA Section 25)."),e.purposes.includes("research")&&n.push("- Public Interest / Research: where processing is necessary for scientific or historical research purposes, or statistical purposes, subject to appropriate safeguards."),n.length===0&&(n.push("- Consent: where you have given clear, informed, and voluntary consent for specific processing activities (NDPA Section 25)."),n.push("- Contract: where processing is necessary for the performance of a contract to which you are a party (NDPA Section 25).")),s("legal-basis","Legal Basis for Processing",`${i} processes personal data under one or more of the following lawful bases as prescribed by the Nigeria Data Protection Act (NDPA) 2023:
|
|
13
|
+
|
|
14
|
+
`+n.join(`
|
|
15
|
+
`)+`
|
|
16
|
+
|
|
17
|
+
We will always inform you of the specific legal basis applicable to each processing activity at the time of data collection.`,t,true)}function S(e,t){let n=(e.purposes.length>0?e.purposes:["service_delivery"]).map(a=>`- ${v(a)}`).join(`
|
|
18
|
+
`);return s("data-usage","How We Use Your Data",`We process the personal data we collect for the following purposes:
|
|
19
|
+
|
|
20
|
+
`+n+`
|
|
21
|
+
|
|
22
|
+
We will not process your personal data for purposes incompatible with those stated above without providing you with prior notice and, where required by the NDPA, obtaining your consent.`,t,true)}function C(e,t){let i=e.org.name||c("orgName"),n=e.thirdPartyProcessors,a;return n.length>0?a=`We share personal data with the following third-party processors under data processing agreements that comply with the NDPA 2023:
|
|
23
|
+
|
|
24
|
+
| Processor | Purpose | Country |
|
|
25
|
+
| --- | --- | --- |
|
|
26
|
+
`+n.map(d=>`| ${d.name} | ${d.purpose} | ${d.country} |`).join(`
|
|
27
|
+
`)+`
|
|
28
|
+
|
|
29
|
+
All processors are contractually required to implement appropriate technical and organisational measures to protect personal data.`:a="We do not currently share your personal data with third-party processors. Should this change, we will update this policy and, where required, obtain your consent before any sharing takes place.",s("data-sharing","Data Sharing & Disclosure",`${i} does not sell personal data under any circumstances.
|
|
30
|
+
|
|
31
|
+
`+a+`
|
|
32
|
+
|
|
33
|
+
We may also disclose personal data where required by law, regulation, or valid legal process, including requests from Nigerian regulatory and law enforcement authorities.`,t,true)}function N(e,t){let i=e.org.privacyEmail||c("privacyEmail");return s("data-subject-rights","Your Rights as a Data Subject",`Under the Nigeria Data Protection Act (NDPA) 2023, you are entitled to the following rights regarding your personal data:
|
|
34
|
+
|
|
35
|
+
1. Right of Access \u2014 You may request confirmation of whether we process your personal data and obtain a copy of that data (NDPA Section 34(1)(a)\u2013(b)).
|
|
36
|
+
2. Right to Rectification \u2014 You may request correction of inaccurate or incomplete personal data we hold about you (NDPA Section 34(1)(c)).
|
|
37
|
+
3. Right to Erasure \u2014 You may request deletion of your personal data where there is no compelling legal reason for its continued processing (NDPA Section 34(1)(d), Section 34(2)).
|
|
38
|
+
4. Right to Restrict Processing \u2014 You may request that we limit the processing of your personal data in certain circumstances (NDPA Section 34(1)(e)).
|
|
39
|
+
5. Right to Withdraw Consent \u2014 Where processing is based on consent, you may withdraw that consent at any time (NDPA Section 35), without affecting the lawfulness of processing carried out prior to withdrawal.
|
|
40
|
+
6. Right to Object \u2014 You may object to the processing of your personal data where processing is based on legitimate interest or is carried out for direct marketing purposes (NDPA Section 36).
|
|
41
|
+
7. Right Not to Be Subject to Automated Decisions \u2014 You have the right not to be subject to a decision based solely on automated processing, including profiling, that produces legal or similarly significant effects (NDPA Section 37).
|
|
42
|
+
8. Right to Data Portability \u2014 You may request to receive your personal data in a structured, commonly used, and machine-readable format (NDPA Section 38).
|
|
43
|
+
|
|
44
|
+
To exercise any of these rights, please contact us at ${i}. We will respond to your request within 30 days (extendable in complex cases per NDPC GAID 2025). If you are unsatisfied with our response, you have the right to lodge a complaint with the Nigeria Data Protection Commission (NDPC) under NDPA Section 46(1).`,t,true)}function A(e,t){let i=e.org.privacyEmail||c("privacyEmail"),n=e.org.industry,a="";return n==="fintech"?a=`
|
|
45
|
+
- Compliance with Payment Card Industry Data Security Standard (PCI-DSS) for cardholder data protection.
|
|
46
|
+
- End-to-end encryption of financial transactions.
|
|
47
|
+
- Multi-factor authentication for account access.`:n==="healthcare"?a=`
|
|
48
|
+
- HIPAA-aligned safeguards for health information, including access controls and audit logging.
|
|
49
|
+
- Segregation of medical data from other personal data.
|
|
50
|
+
- Role-based access controls restricting health data to authorised personnel.`:n==="ecommerce"?a=`
|
|
51
|
+
- PCI-DSS compliant payment processing.
|
|
52
|
+
- Secure checkout and tokenisation of payment credentials.`:n==="government"&&(a=`
|
|
53
|
+
- Compliance with Nigeria's Cybercrimes Act 2015 requirements.
|
|
54
|
+
- Government-grade access controls and audit trails.`),s("data-security","Data Security Measures",`We implement appropriate technical and organisational measures to protect personal data against unauthorised access, alteration, disclosure, or destruction. These measures include:
|
|
55
|
+
|
|
56
|
+
- Encryption of personal data in transit (TLS 1.2+) and at rest (AES-256).
|
|
57
|
+
- Access controls and least-privilege principles for all systems handling personal data.
|
|
58
|
+
- Regular security assessments, penetration testing, and vulnerability scanning.
|
|
59
|
+
- Staff training on data protection obligations and information security best practices.
|
|
60
|
+
- Incident response procedures aligned with NDPA breach notification requirements (72-hour notification to NDPC).`+a+`
|
|
61
|
+
|
|
62
|
+
While we employ industry-standard safeguards, no method of electronic transmission or storage is entirely secure. If you become aware of any security incident affecting your data, please contact us immediately at ${i}.`,t,true)}function T(e,t){let i=e.org.name||c("orgName"),n=e.org.privacyEmail||c("privacyEmail"),a=[];e.org.address&&a.push(`Address: ${e.org.address}`),e.org.website&&a.push(`Website: ${e.org.website}`);let o=[];e.org.dpoName&&o.push(`Data Protection Officer: ${e.org.dpoName}`),e.org.dpoEmail&&o.push(`DPO Email: ${e.org.dpoEmail}`);let d=o.length>0?`
|
|
63
|
+
|
|
64
|
+
${o.join(`
|
|
65
|
+
`)}`:"";return s("contact-info","Contact Information",`If you have questions, concerns, or requests regarding this privacy policy or our data protection practices, please contact us:
|
|
66
|
+
|
|
67
|
+
Organisation: ${i}
|
|
68
|
+
Email: ${n}`+(a.length>0?`
|
|
69
|
+
${a.join(`
|
|
70
|
+
`)}`:"")+d+`
|
|
71
|
+
|
|
72
|
+
You also have the right to lodge a complaint with the Nigeria Data Protection Commission (NDPC) if you believe your data protection rights have been infringed.
|
|
73
|
+
|
|
74
|
+
Nigeria Data Protection Commission
|
|
75
|
+
Website: https://ndpc.gov.ng
|
|
76
|
+
Email: info@ndpc.gov.ng`,t,true)}function x(e){return s("children-data-protection","Children's Data Protection",`We recognise the importance of protecting the privacy of children. In accordance with Section 31 of the NDPA 2023, we implement the following safeguards when processing children's personal data:
|
|
77
|
+
|
|
78
|
+
- We do not knowingly collect personal data from children under the age of 13 without verifiable parental or guardian consent.
|
|
79
|
+
- Where we process data of children between the ages of 13 and 17, we obtain consent from a parent or guardian, taking into account the child's age and maturity.
|
|
80
|
+
- Parents and guardians may request access to, correction of, or deletion of their child's personal data at any time by contacting us.
|
|
81
|
+
- We limit the collection of children's data to what is strictly necessary for the service provided and do not use it for marketing or profiling.
|
|
82
|
+
- A Data Protection Impact Assessment (DPIA) is conducted before any new processing activity involving children's data.
|
|
83
|
+
|
|
84
|
+
If we discover that we have inadvertently collected personal data from a child without appropriate consent, we will delete that data promptly.`,e,true)}function I(e){return s("sensitive-data-processing","Sensitive / Special-Category Data",`Certain categories of personal data are considered sensitive under the NDPA 2023 and require additional safeguards. Sensitive data includes information relating to health, biometric identifiers, ethnic origin, religious or political beliefs, and genetic data.
|
|
85
|
+
|
|
86
|
+
We process sensitive personal data only where:
|
|
87
|
+
|
|
88
|
+
- You have given explicit consent for the specific processing purpose.
|
|
89
|
+
- Processing is necessary to protect your vital interests or those of another person.
|
|
90
|
+
- Processing is required for the establishment, exercise, or defence of legal claims.
|
|
91
|
+
- Processing is necessary for reasons of substantial public interest under Nigerian law.
|
|
92
|
+
|
|
93
|
+
Enhanced security measures are applied to all sensitive data, including additional encryption, strict access controls, and enhanced audit logging. Sensitive data is stored separately from other personal data where technically feasible.`,e,true)}function k(e,t){let i=e.thirdPartyProcessors.filter(a=>a.country.toLowerCase()!=="nigeria"),n="";return i.length>0&&(n=`
|
|
94
|
+
|
|
95
|
+
We currently transfer personal data to the following jurisdictions: ${Array.from(new Set(i.map(o=>o.country))).join(", ")}. Each transfer is subject to the safeguards described above.`),s("cross-border-transfers","Cross-Border Data Transfers",`Where we transfer personal data outside Nigeria, we do so in strict compliance with Sections 43 and 44 of the NDPA 2023. We ensure that any cross-border transfer of personal data is subject to one or more of the following safeguards:
|
|
96
|
+
|
|
97
|
+
- The receiving country has been assessed by the NDPC as providing an adequate level of data protection.
|
|
98
|
+
- We have put in place appropriate contractual safeguards, such as Standard Contractual Clauses approved by the NDPC.
|
|
99
|
+
- You have provided explicit consent to the transfer after being informed of the associated risks.
|
|
100
|
+
- The transfer is necessary for the performance of a contract between you and us, or for pre-contractual steps taken at your request.
|
|
101
|
+
- The NDPC has granted an administrative authorisation for the transfer.`+n,t,true)}function q(e){return s("automated-decision-making","Automated Decision-Making & Profiling",`In accordance with Section 37 of the NDPA 2023, we inform you of any automated decision-making processes, including profiling, that produce legal effects or similarly significant effects on you.
|
|
102
|
+
|
|
103
|
+
Where we use automated decision-making:
|
|
104
|
+
|
|
105
|
+
- We will inform you that automated processing is being used and provide meaningful information about the logic involved.
|
|
106
|
+
- You have the right to request human intervention in any automated decision.
|
|
107
|
+
- You have the right to express your point of view and contest the decision.
|
|
108
|
+
- We will carry out regular reviews of automated decision-making systems to ensure fairness, accuracy, and absence of bias.
|
|
109
|
+
- We will not base automated decisions solely on sensitive personal data unless you have given explicit consent or the processing is authorised by Nigerian law.
|
|
110
|
+
|
|
111
|
+
You may object to automated decision-making at any time by contacting us using the details provided in this policy.`,e,true)}function R(e,t){let i=e.org.name||c("orgName"),n=e.org.industry,a="";return n==="fintech"?a=`
|
|
112
|
+
|
|
113
|
+
Financial transaction records are retained for a minimum of six (6) years in compliance with the Central Bank of Nigeria (CBN) guidelines and the Money Laundering (Prevention and Prohibition) Act.`:n==="healthcare"?a=`
|
|
114
|
+
|
|
115
|
+
Medical and health records are retained for a minimum of ten (10) years after the last date of treatment, or longer where required by applicable health regulations.`:n==="ecommerce"?a=`
|
|
116
|
+
|
|
117
|
+
Order and transaction records are retained for six (6) years in accordance with Nigerian tax and commercial law requirements.`:n==="education"&&(a=`
|
|
118
|
+
|
|
119
|
+
Student academic records may be retained indefinitely for verification purposes. Other personal data is retained only for the duration of enrolment plus five (5) years.`),s("data-retention","Data Retention Schedule",`${i} retains personal data only for as long as necessary to fulfil the purposes for which it was collected, or as required by applicable Nigerian law. Our retention periods are determined based on the following criteria:
|
|
120
|
+
|
|
121
|
+
- The nature and sensitivity of the personal data.
|
|
122
|
+
- The purposes for which the data is processed.
|
|
123
|
+
- Legal, regulatory, and contractual obligations (including NDPA 2023 requirements).
|
|
124
|
+
- Legitimate business needs such as maintaining records for audits, dispute resolution, and regulatory examinations.
|
|
125
|
+
|
|
126
|
+
General retention periods:
|
|
127
|
+
- Account data: retained for the duration of your relationship with us, plus three (3) years.
|
|
128
|
+
- Communication records: retained for two (2) years from the date of correspondence.
|
|
129
|
+
- Analytics and usage data: retained in identifiable form for twelve (12) months, then aggregated or anonymised.`+a+`
|
|
130
|
+
|
|
131
|
+
When personal data is no longer required, it is securely deleted or irreversibly anonymised in accordance with our internal data retention and disposal policy.`,t,true)}function E(e){let t=1,i=[];return i.push(P(e,t++)),i.push(w(e,t++)),i.push(D(e,t++)),i.push(S(e,t++)),i.push(C(e,t++)),i.push(N(e,t++)),i.push(A(e,t++)),i.push(T(e,t++)),e.hasChildrenData&&i.push(x(t++)),e.hasSensitiveData&&i.push(I(t++)),e.hasCrossBorderTransfer&&i.push(k(e,t++)),e.hasAutomatedDecisions&&i.push(q(t++)),i.push(R(e,t++)),i}var L=[{id:"full-name",label:"Full Name",group:"identity",dataPoints:["first name","last name","middle name","title"],selected:false},{id:"contact-details",label:"Contact Details",group:"identity",dataPoints:["email address","phone number","postal address"],selected:false},{id:"government-ids",label:"Government-Issued Identifiers",group:"identity",dataPoints:["NIN","passport number","driver's licence number","voter's card number"],selected:false},{id:"account-credentials",label:"Account Credentials",group:"identity",dataPoints:["username","hashed password","security questions"],selected:false},{id:"payment-info",label:"Payment Information",group:"financial",dataPoints:["credit/debit card number","bank account number","billing address"],selected:false},{id:"financial-records",label:"Financial Records",group:"financial",dataPoints:["transaction history","account balance","income details"],selected:false},{id:"bvn",label:"Bank Verification Number (BVN)",group:"financial",dataPoints:["BVN"],selected:false},{id:"device-info",label:"Device & Browser Information",group:"behavioral",dataPoints:["IP address","browser type","operating system","device identifiers"],selected:false},{id:"usage-data",label:"Usage & Analytics Data",group:"behavioral",dataPoints:["pages visited","click patterns","session duration","referral source"],selected:false},{id:"location-data",label:"Location Data",group:"behavioral",dataPoints:["GPS coordinates","city","country","timezone"],selected:false},{id:"cookies",label:"Cookies & Tracking Technologies",group:"behavioral",dataPoints:["cookie identifiers","pixel tags","local storage data"],selected:false},{id:"health-data",label:"Health & Medical Data",group:"sensitive",dataPoints:["medical history","prescriptions","health insurance details","disability status"],selected:false},{id:"biometric-data",label:"Biometric Data",group:"sensitive",dataPoints:["fingerprints","facial recognition data","voiceprints"],selected:false},{id:"ethnic-religious",label:"Ethnic Origin & Religious Beliefs",group:"sensitive",dataPoints:["ethnic origin","religious affiliation","political opinions"],selected:false},{id:"child-identity",label:"Child Identity Information",group:"children",dataPoints:["child's name","date of birth","school name","parent/guardian contact"],selected:false},{id:"child-activity",label:"Child Online Activity",group:"children",dataPoints:["content viewed","in-app activity","communications"],selected:false}];function O(){return {org:{name:"",website:"",privacyEmail:"",address:"",dpoName:"",dpoEmail:"",industry:"other",orgSize:"startup",country:"Nigeria"},dataCategories:L.map(e=>a({},e)),purposes:[],hasChildrenData:false,hasSensitiveData:false,hasFinancialData:false,hasCrossBorderTransfer:false,hasAutomatedDecisions:false,thirdPartyProcessors:[]}}function u(e,t){return e.sections.some(i=>i.id===t&&i.included)}function h(e,t){var n;let i=e.sections.find(a=>a.id===t&&a.included);return (n=i==null?void 0:i.template)!=null?n:""}function f(e){return e.sections.filter(t=>t.included).map(t=>t.template).join(`
|
|
132
|
+
`)}var m=[{id:"controller-identity",name:"Controller Identity",ndpaSection:"NDPA Section 24(1)(a)",severity:"critical",points:10,check:e=>{var t,i;return ((t=e.organizationInfo.name)!=null?t:"").trim().length>0&&((i=e.organizationInfo.privacyEmail)!=null?i:"").trim().length>0},gap:()=>({message:"The policy does not identify the data controller. The organisation name and contact email must be provided so data subjects know who is responsible for their data.",fixType:"fill_field",fixLabel:"Add organisation details",suggestedContent:"Provide your organisation's registered name and a valid privacy contact email address in the Organisation Info section."})},{id:"purpose-of-processing",name:"Purpose of Processing",ndpaSection:"NDPA Section 24(1)(b)",severity:"critical",points:10,check:(e,t)=>t.purposes.length>0,gap:()=>({message:"No processing purposes have been selected. The NDPA requires you to clearly state the specific purposes for which personal data is collected and processed.",fixType:"fill_field",fixLabel:"Select processing purposes",suggestedContent:"Select at least one processing purpose (e.g. service delivery, analytics, marketing) in the wizard."})},{id:"lawful-basis",name:"Lawful Basis Identified",ndpaSection:"NDPA Section 25",severity:"critical",points:10,check:e=>u(e,"legal-basis"),gap:()=>({message:"The policy does not include a section identifying the lawful basis for processing. Under the NDPA, every processing activity must be grounded in a lawful basis such as consent, contract, or legitimate interest.",fixType:"add_section",fixLabel:"Add legal basis section",suggestedContent:`We process personal data under one or more of the following lawful bases as prescribed by the NDPA 2023:
|
|
133
|
+
|
|
134
|
+
- Consent: where you have given clear, informed, and voluntary consent.
|
|
135
|
+
- Contract: where processing is necessary for the performance of a contract.
|
|
136
|
+
- Legal Obligation: where processing is required by Nigerian law.
|
|
137
|
+
- Legitimate Interest: where processing is necessary for our legitimate interests, provided they do not override your rights.`})},{id:"data-categories-disclosed",name:"Data Categories Disclosed",ndpaSection:"NDPA Section 24(1)(c)",severity:"critical",points:10,check:(e,t)=>t.dataCategories.some(i=>i.selected),gap:()=>({message:"No data categories have been selected. The NDPA requires you to disclose the categories of personal data you collect (e.g. identity, financial, behavioral data).",fixType:"fill_field",fixLabel:"Select data categories",suggestedContent:"Select the categories of personal data your organisation collects in the Data Collection step of the wizard."})},{id:"recipients-disclosed",name:"Recipients Disclosed",ndpaSection:"NDPA Section 24(1)(e)",severity:"critical",points:10,check:(e,t)=>{if(!u(e,"data-sharing"))return false;if(t.thirdPartyProcessors.length>0){let i=h(e,"data-sharing");return t.thirdPartyProcessors.every(n=>i.includes(n.name))}return true},gap:e=>({message:e.thirdPartyProcessors.length>0?"The data sharing section does not list all third-party processors. Each processor must be named with its purpose and location.":"The policy does not include a data sharing section. Even if you do not share data, you must state this clearly.",fixType:e.thirdPartyProcessors.length>0?"add_content":"add_section",fixLabel:e.thirdPartyProcessors.length>0?"Update sharing section":"Add data sharing section",suggestedContent:"We do not sell personal data. We may share your data with service providers under strict data processing agreements that comply with the NDPA 2023."})},{id:"retention-periods",name:"Retention Periods Specified",ndpaSection:"NDPA Section 24(1)(f)",severity:"critical",points:10,check:e=>u(e,"data-retention"),gap:()=>({message:"The policy does not include a data retention section. The NDPA requires you to specify the period for which personal data will be stored, or the criteria used to determine that period.",fixType:"add_section",fixLabel:"Add retention schedule",suggestedContent:"We retain personal data only for as long as necessary to fulfil the purposes for which it was collected, or as required by applicable Nigerian law. When personal data is no longer needed, it is securely deleted or anonymised."})},{id:"data-subject-rights",name:"Data Subject Rights Listed",ndpaSection:"NDPA Sections 34-39",severity:"important",points:7,check:e=>{if(!u(e,"data-subject-rights"))return false;let t=h(e,"data-subject-rights").toLowerCase();return ["access","rectification","erasure","portability","restrict","object"].every(n=>t.includes(n))},gap:()=>({message:"The data subject rights section is missing or does not cover all six NDPA rights: access, rectification, erasure, portability, restriction, and objection.",fixType:"add_content",fixLabel:"Add missing rights",suggestedContent:`Under the NDPA 2023, you have the following rights:
|
|
138
|
+
1. Right of Access (Section 34)
|
|
139
|
+
2. Right to Rectification (Section 35)
|
|
140
|
+
3. Right to Erasure (Section 36)
|
|
141
|
+
4. Right to Restrict Processing (Section 37)
|
|
142
|
+
5. Right to Data Portability (Section 38)
|
|
143
|
+
6. Right to Object (Section 37)`})},{id:"right-to-withdraw-consent",name:"Right to Withdraw Consent",ndpaSection:"NDPA Section 25(2)",severity:"important",points:7,check:e=>{let t=f(e).toLowerCase();return t.includes("withdraw")&&t.includes("consent")},gap:()=>({message:"The policy does not mention the right to withdraw consent. Data subjects must be informed that they can withdraw consent at any time without affecting the lawfulness of prior processing.",fixType:"add_content",fixLabel:"Add withdrawal clause",suggestedContent:"You have the right to withdraw your consent at any time, without affecting the lawfulness of processing carried out prior to withdrawal. To withdraw your consent, contact us at the email address provided in this policy."})},{id:"right-to-lodge-complaint",name:"Right to Lodge Complaint with NDPC",ndpaSection:"NDPA Section 40",severity:"important",points:7,check:e=>{let t=f(e).toLowerCase();return t.includes("ndpc")||t.includes("nigeria data protection commission")},gap:()=>({message:"The policy does not mention the right to lodge a complaint with the Nigeria Data Protection Commission (NDPC). Data subjects must be informed of this right.",fixType:"add_content",fixLabel:"Add NDPC complaint reference",suggestedContent:"You have the right to lodge a complaint with the Nigeria Data Protection Commission (NDPC) if you believe your data protection rights have been infringed. Website: https://ndpc.gov.ng"})},{id:"cross-border-safeguards",name:"Cross-Border Transfer Safeguards",ndpaSection:"NDPA Sections 43-44",severity:"important",points:7,check:(e,t)=>t.hasCrossBorderTransfer?u(e,"cross-border-transfers"):true,gap:()=>({message:"Cross-border data transfers are indicated but the policy lacks a section describing the safeguards in place. The NDPA requires disclosure of transfer mechanisms and adequacy assessments.",fixType:"add_section",fixLabel:"Add cross-border section",suggestedContent:"Where we transfer personal data outside Nigeria, we ensure compliance with Sections 43 and 44 of the NDPA 2023 by implementing appropriate safeguards, including adequacy assessments and Standard Contractual Clauses."})},{id:"automated-decision-disclosure",name:"Automated Decision-Making Disclosure",ndpaSection:"NDPA Section 39",severity:"important",points:7,check:(e,t)=>t.hasAutomatedDecisions?u(e,"automated-decision-making"):true,gap:()=>({message:"Automated decision-making is indicated but the policy does not include a section disclosing this. The NDPA requires you to inform data subjects about automated decisions, including the logic involved and the right to human intervention.",fixType:"add_section",fixLabel:"Add automated decisions section",suggestedContent:"We use automated decision-making in certain processes. You have the right to request human intervention, express your point of view, and contest automated decisions, in accordance with Section 39 of the NDPA 2023."})},{id:"children-data-protection",name:"Children's Data Protection",ndpaSection:"NDPA Section 31",severity:"recommended",points:5,check:(e,t)=>t.hasChildrenData?u(e,"children-data-protection"):true,gap:()=>({message:"Children's data processing is indicated but the policy does not include a dedicated children's data protection section. The NDPA requires enhanced protections including parental consent for children under 13.",fixType:"add_section",fixLabel:"Add children's data section",suggestedContent:"We do not knowingly collect personal data from children under the age of 13 without verifiable parental or guardian consent. Parents and guardians may request access to, correction of, or deletion of their child's data at any time."})},{id:"dpo-contact-info",name:"DPO Contact Information",ndpaSection:"NDPA Section 30",severity:"recommended",points:5,check:e=>{var t,i;return ((t=e.organizationInfo.dpoName)!=null?t:"").trim().length>0&&((i=e.organizationInfo.dpoEmail)!=null?i:"").trim().length>0},gap:()=>({message:"The Data Protection Officer (DPO) contact information is not provided. While not always mandatory, appointing a DPO and publishing their contact details is strongly recommended under the NDPA.",fixType:"fill_field",fixLabel:"Add DPO details",suggestedContent:"Provide the full name and email address of your Data Protection Officer in the Organisation Info section."})},{id:"security-measures",name:"Security Measures Described",ndpaSection:"NDPA Section 28",severity:"recommended",points:5,check:e=>u(e,"data-security"),gap:()=>({message:"The policy does not describe the technical and organisational security measures in place to protect personal data. Describing these measures builds trust and demonstrates NDPA compliance.",fixType:"add_section",fixLabel:"Add security section",suggestedContent:"We implement appropriate technical and organisational measures to protect personal data, including encryption in transit and at rest, access controls, regular security assessments, and incident response procedures aligned with NDPA breach notification requirements."})},{id:"policy-effective-date",name:"Policy Effective Date",ndpaSection:"NDPA Section 24",severity:"recommended",points:5,check:e=>e.effectiveDate>0,gap:()=>({message:"The policy does not have an effective date set. An effective date is important for version control and for data subjects to know when the policy was last updated.",fixType:"fill_field",fixLabel:"Set effective date",suggestedContent:"Set the policy's effective date to the date you intend to publish it."})}];function B(e,t){let i=m.reduce((r,l)=>r+l.points,0),n=0,a$1=[],o=[];for(let r of m)if(r.check(e,t))n+=r.points,o.push(r.id);else {let l=r.gap(t);a$1.push(a({requirementId:r.id,requirement:r.name,ndpaSection:r.ndpaSection,severity:r.severity},l));}let d=Math.round(n/i*100),p;return n>=100?p="compliant":n>=80?p="nearly_compliant":p="not_compliant",{score:n,maxScore:i,percentage:d,rating:p,gaps:a$1,passed:o}}
|
|
144
|
+
export{y as a,W as b,E as c,L as d,O as e,B as f};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import {b as b$1,c,d}from'./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-2AW7KAZO.mjs.map
|
|
1
|
+
import {b as b$1,c,d}from'./chunk-XP5PL6K7.mjs';import {b,a}from'./chunk-ZJYULEER.mjs';import {useRef,useState,useEffect,useCallback}from'react';function E({initialData:S,adapter:R,onRecordAdd:g,onRecordUpdate:f,onRecordArchive:P}){let d$1=useRef(R);d$1.current=R;let[s,u]=useState(S),[v,p]=useState(true);useEffect(()=>{if(!d$1.current){p(false);return}let t=false;try{let e=d$1.current.load();e instanceof Promise?e.then(r=>{t||(r&&u(r),p(!1));},()=>{t||p(!1);}):(e&&u(e),p(!1));}catch(e){t||p(false);}return ()=>{t=true;}},[]);let a$1=useCallback(t=>{d$1.current&&Promise.resolve(d$1.current.save(t)).catch(e=>{console.warn("[ndpr-toolkit] Failed to save ROPA:",e);});},[]),C=useCallback(t=>{u(e=>{let r=b(a({},e),{records:[...e.records,t],lastUpdated:Date.now()});return a$1(r),r}),g==null||g(t);},[g,a$1]),w=useCallback((t,e)=>{u(r=>{let n=b(a({},r),{records:r.records.map(l=>l.id===t?b(a(a({},l),e),{updatedAt:Date.now()}):l),lastUpdated:Date.now()});return a$1(n),n}),f==null||f(t,e);},[f,a$1]),x=useCallback(t=>{u(e=>{let r=b(a({},e),{records:e.records.map(n=>n.id===t?b(a({},n),{status:"archived",updatedAt:Date.now()}):n),lastUpdated:Date.now()});return a$1(r),r}),P==null||P(t);},[P,a$1]),D=useCallback(t=>s.records.find(e=>e.id===t),[s.records]),G=useCallback(()=>b$1(s),[s]),b$2=useCallback(()=>c(s),[s]),L=useCallback(()=>d(s),[s]);return {ropa:s,addRecord:C,updateRecord:w,archiveRecord:x,getRecord:D,getSummary:G,exportCSV:b$2,getComplianceGaps:L,isLoading:v}}export{E as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkQPRYXVH2_js=require('./chunk-QPRYXVH2.js'),react=require('react');function c({input:e}){let p=JSON.stringify(e);return react.useMemo(()=>chunkQPRYXVH2_js.a(e),[p])}exports.a=c;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
var l=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function d(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function r(e){return typeof e=="string"&&e.trim().length>0}function m(e,n={}){var u,f;let{requireIdentityVerification:o=true,allowedRequestTypes:a}=n,i={};if(!d(e))return {valid:false,errors:{_root:"Payload must be an object"}};r(e.requestType)?a&&!a.includes(e.requestType)&&(i.requestType=`Request type "${e.requestType}" is not in the allowed set`):i.requestType="Request type is required";let t=e.dataSubject;if(d(t)?(r(t.fullName)||(i["dataSubject.fullName"]="Full name is required"),r(t.email)?l.test(t.email)||(i["dataSubject.email"]="Email address format is invalid"):i["dataSubject.email"]="Email address is required",t.phone!==void 0&&typeof t.phone!="string"&&(i["dataSubject.phone"]="Phone must be a string when provided"),o&&(r(t.identifierType)||(i["dataSubject.identifierType"]="Identifier type is required"),r(t.identifierValue)||(i["dataSubject.identifierValue"]="Identifier value is required"))):i.dataSubject="Data subject information is required",(typeof e.submittedAt!="number"||!Number.isFinite(e.submittedAt))&&(i.submittedAt="submittedAt must be a finite number (ms timestamp)"),e.additionalInfo!==void 0&&!d(e.additionalInfo)&&(i.additionalInfo="additionalInfo must be an object when provided"),Object.keys(i).length>0)return {valid:false,errors:i};let s=t;return {valid:true,errors:{},data:{requestType:e.requestType,dataSubject:{fullName:s.fullName,email:s.email,phone:s.phone,identifierType:(u=s.identifierType)!=null?u:"",identifierValue:(f=s.identifierValue)!=null?f:""},additionalInfo:e.additionalInfo,submittedAt:e.submittedAt}}}function c(e){var a,i;let n=[];return e.id||n.push("Request ID is required"),e.type||n.push("Request type is required"),e.status||n.push("Request status is required"),e.createdAt||n.push("Creation timestamp is required"),(a=e.subject)!=null&&a.name||n.push("Data subject name is required"),(i=e.subject)!=null&&i.email||n.push("Data subject email is required"),{formattedRequest:{requestId:e.id,requestType:e.type,status:e.status,createdDate:new Date(e.createdAt).toISOString(),lastUpdated:e.updatedAt?new Date(e.updatedAt).toISOString():void 0,dueDate:e.dueDate?new Date(e.dueDate).toISOString():void 0,dataSubject:e.subject?{name:e.subject.name,email:e.subject.email,phone:e.subject.phone||"Not provided",identifier:{type:e.subject.identifierType||"Not specified",value:e.subject.identifierValue||"Not provided"}}:void 0,additionalInformation:e.additionalInfo||{},verificationStatus:e.verification?`${e.verification.verified?"Verified":"Not verified"}${e.verification.method?` via ${e.verification.method}`:""}`:"Pending verification",attachments:e.attachments?e.attachments.map(t=>({name:t.name,type:t.type,addedOn:new Date(t.addedAt).toISOString()})):[]},isValid:n.length===0,validationErrors:n}}export{m as a,c as b}
|
|
2
|
-
//# sourceMappingURL=chunk-B4Z5MBUC.mjs.map
|
|
1
|
+
var l=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function d(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function r(e){return typeof e=="string"&&e.trim().length>0}function m(e,n={}){var u,f;let{requireIdentityVerification:o=true,allowedRequestTypes:a}=n,i={};if(!d(e))return {valid:false,errors:{_root:"Payload must be an object"}};r(e.requestType)?a&&!a.includes(e.requestType)&&(i.requestType=`Request type "${e.requestType}" is not in the allowed set`):i.requestType="Request type is required";let t=e.dataSubject;if(d(t)?(r(t.fullName)||(i["dataSubject.fullName"]="Full name is required"),r(t.email)?l.test(t.email)||(i["dataSubject.email"]="Email address format is invalid"):i["dataSubject.email"]="Email address is required",t.phone!==void 0&&typeof t.phone!="string"&&(i["dataSubject.phone"]="Phone must be a string when provided"),o&&(r(t.identifierType)||(i["dataSubject.identifierType"]="Identifier type is required"),r(t.identifierValue)||(i["dataSubject.identifierValue"]="Identifier value is required"))):i.dataSubject="Data subject information is required",(typeof e.submittedAt!="number"||!Number.isFinite(e.submittedAt))&&(i.submittedAt="submittedAt must be a finite number (ms timestamp)"),e.additionalInfo!==void 0&&!d(e.additionalInfo)&&(i.additionalInfo="additionalInfo must be an object when provided"),Object.keys(i).length>0)return {valid:false,errors:i};let s=t;return {valid:true,errors:{},data:{requestType:e.requestType,dataSubject:{fullName:s.fullName,email:s.email,phone:s.phone,identifierType:(u=s.identifierType)!=null?u:"",identifierValue:(f=s.identifierValue)!=null?f:""},additionalInfo:e.additionalInfo,submittedAt:e.submittedAt}}}function c(e){var a,i;let n=[];return e.id||n.push("Request ID is required"),e.type||n.push("Request type is required"),e.status||n.push("Request status is required"),e.createdAt||n.push("Creation timestamp is required"),(a=e.subject)!=null&&a.name||n.push("Data subject name is required"),(i=e.subject)!=null&&i.email||n.push("Data subject email is required"),{formattedRequest:{requestId:e.id,requestType:e.type,status:e.status,createdDate:new Date(e.createdAt).toISOString(),lastUpdated:e.updatedAt?new Date(e.updatedAt).toISOString():void 0,dueDate:e.dueDate?new Date(e.dueDate).toISOString():void 0,dataSubject:e.subject?{name:e.subject.name,email:e.subject.email,phone:e.subject.phone||"Not provided",identifier:{type:e.subject.identifierType||"Not specified",value:e.subject.identifierValue||"Not provided"}}:void 0,additionalInformation:e.additionalInfo||{},verificationStatus:e.verification?`${e.verification.verified?"Verified":"Not verified"}${e.verification.method?` via ${e.verification.method}`:""}`:"Pending verification",attachments:e.attachments?e.attachments.map(t=>({name:t.name,type:t.type,addedOn:new Date(t.addedAt).toISOString()})):[]},isValid:n.length===0,validationErrors:n}}export{m as a,c as b};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkUXUMYP4L_js=require('./chunk-UXUMYP4L.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var or=({categories:Me,onSubmit:$e,onValidationError:u,title:Oe="Report a Data Breach",formDescription:Le="Use this form to report a suspected or confirmed data breach in accordance with NDPA Section 40. All fields marked with * are required.",submitButtonText:ze="Submit Report",className:G="",buttonClassName:K="",classNames:d={},unstyled:c=false,isSubmitting:f=false,showConfirmation:Ye=true,confirmationMessage:Ue="Your breach report has been submitted successfully. The data protection team has been notified.",allowAttachments:He=true,maxAttachments:x=5,maxFileSize:C=5*1024*1024,allowedFileTypes:S=[".pdf",".jpg",".jpeg",".png",".doc",".docx",".xls",".xlsx",".txt"],defaultValues:t,onReset:A})=>{var Se,Ae,De,Re,we,Fe,qe,Pe,ke,Te,je;let W=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,J]=react.useState((t==null?void 0:t.title)||""),[R,Q]=react.useState((t==null?void 0:t.description)||""),[w,X]=react.useState((t==null?void 0:t.category)||""),[F,V]=react.useState(W(t==null?void 0:t.discoveredAt)),[q,ee]=react.useState(W(t==null?void 0:t.occurredAt)),[P,re]=react.useState(((Se=t==null?void 0:t.reporter)==null?void 0:Se.name)||""),[N,te]=react.useState(((Ae=t==null?void 0:t.reporter)==null?void 0:Ae.email)||""),[k,ie]=react.useState(((De=t==null?void 0:t.reporter)==null?void 0:De.department)||""),[T,ae]=react.useState(((Re=t==null?void 0:t.reporter)==null?void 0:Re.phone)||""),[ne,oe]=react.useState((t==null?void 0:t.affectedSystems)||[]),[Ze,se]=react.useState(((we=t==null?void 0:t.affectedSystems)==null?void 0:we.join(", "))||""),[j,de]=react.useState((t==null?void 0:t.dataTypes)||[]),[h,me]=react.useState((t==null?void 0:t.estimatedAffectedSubjects)!=null?String(t.estimatedAffectedSubjects):""),[I,ce]=react.useState((t==null?void 0:t.approximateRecordCount)!=null?String(t.approximateRecordCount):""),[B,pe]=react.useState(((Fe=t==null?void 0:t.dataSubjectCategories)==null?void 0:Fe.join(", "))||""),[le,ge]=react.useState((qe=t==null?void 0:t.involvesSensitiveData)!=null?qe:false),[E,be]=react.useState((t==null?void 0:t.likelyConsequences)||""),[M,fe]=react.useState((t==null?void 0:t.mitigationMeasures)||""),[$,he]=react.useState(((Pe=t==null?void 0:t.dpoContact)==null?void 0:Pe.name)||""),[O,ve]=react.useState(((ke=t==null?void 0:t.dpoContact)==null?void 0:ke.email)||""),[L,Ne]=react.useState(((Te=t==null?void 0:t.dpoContact)==null?void 0:Te.phone)||""),[z,_e]=react.useState((je=t==null?void 0:t.isPhasedReport)!=null?je:false),[Y,ye]=react.useState((t==null?void 0:t.supplementsReportId)||""),[ue,xe]=react.useState((t==null?void 0:t.status)||"ongoing"),[U,Ce]=react.useState((t==null?void 0:t.initialActions)||""),[_,H]=react.useState([]),[Ge,Z]=react.useState(false),[a,v]=react.useState({}),Ke=()=>{J(""),Q(""),X(""),V(""),ee(""),re(""),te(""),ie(""),ae(""),oe([]),se(""),de([]),me(""),ce(""),pe(""),ge(false),be(""),fe(""),he(""),ve(""),Ne(""),_e(false),ye(""),xe("ongoing"),Ce(""),H([]),Z(false),v({}),A==null||A();},We=r=>{let o=r.target.value;se(o);let l=o.split(",").map(s=>s.trim()).filter(Boolean);oe(l);},Je=r=>{de(o=>o.includes(r)?o.filter(l=>l!==r):[...o,r]);},Qe=r=>{var Ie;let o=r.target.files;if(!o)return;let l=[],s={};if(_.length+o.length>x){s.attachments=`Maximum of ${x} files allowed`,v(g=>chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},g),s));return}for(let g=0;g<o.length;g++){let y=o[g];if(y.size>C){s.attachments=`File ${y.name} exceeds the maximum size of ${C/(1024*1024)}MB`;continue}let Be="."+((Ie=y.name.split(".").pop())==null?void 0:Ie.toLowerCase());if(!S.includes(Be)){s.attachments=`File type ${Be} is not allowed`;continue}l.push(y);}l.length>0&&H(g=>[...g,...l]),Object.keys(s).length>0?v(g=>chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},g),s)):v(g=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},g),{attachments:""}));},Xe=r=>{H(o=>o.filter((l,s)=>s!==r));},Ve=()=>{let r={};return D.trim()||(r.breachTitle="Breach title is required"),R.trim()||(r.description="Description is required"),w||(r.category="Category is required"),F||(r.discoveredAt="Discovery date is required"),P.trim()||(r.reporterName="Reporter name is required"),N.trim()?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(N)||(r.reporterEmail="Reporter email is invalid"):r.reporterEmail="Reporter email is required",k.trim()||(r.reporterDepartment="Reporter department is required"),ne.length===0&&(r.affectedSystems="At least one affected system is required"),j.length===0&&(r.dataTypes="At least one data type is required"),h&&isNaN(Number(h))&&(r.estimatedAffectedSubjects="Estimated affected subjects must be a number"),v(r),r},er=r=>{r.preventDefault();let o=Ve();if(Object.keys(o).length>0){u==null||u(o);return}let l={title:chunkUXUMYP4L_js.a(D),description:chunkUXUMYP4L_js.a(R),category:w,discoveredAt:new Date(F).getTime(),occurredAt:q?new Date(q).getTime():void 0,reportedAt:Date.now(),reporter:{name:chunkUXUMYP4L_js.a(P),email:chunkUXUMYP4L_js.a(N),department:chunkUXUMYP4L_js.a(k),phone:T?chunkUXUMYP4L_js.a(T):void 0},affectedSystems:ne.map(s=>chunkUXUMYP4L_js.a(s)),dataTypes:j,estimatedAffectedSubjects:h?Number(h):void 0,approximateRecordCount:I?Number(I):void 0,dataSubjectCategories:B?B.split(",").map(s=>chunkUXUMYP4L_js.a(s.trim())).filter(Boolean):void 0,involvesSensitiveData:le,likelyConsequences:E?chunkUXUMYP4L_js.a(E):void 0,mitigationMeasures:M?chunkUXUMYP4L_js.a(M):void 0,dpoContact:$||O?{name:chunkUXUMYP4L_js.a($),email:chunkUXUMYP4L_js.a(O),phone:L?chunkUXUMYP4L_js.a(L):void 0}:void 0,isPhasedReport:z||void 0,supplementsReportId:Y?chunkUXUMYP4L_js.a(Y):void 0,status:ue,initialActions:U?chunkUXUMYP4L_js.a(U):void 0,attachments:_.map(s=>({name:s.name,type:s.type,size:s.size,file:s}))};$e(l),Ye&&Z(true);};if(Ge)return jsxRuntime.jsxs("div",{"data-ndpr-component":"breach-report-form",className:`p-4 bg-green-50 dark:bg-green-900/20 rounded-md ${G}`,children:[jsxRuntime.jsx("h2",{className:"text-lg font-bold ndpr-text-success mb-2",children:"Report Submitted"}),jsxRuntime.jsx("p",{className:"ndpr-text-success",children:Ue}),jsxRuntime.jsxs("div",{className:"mt-4 p-4 bg-yellow-50 dark:bg-yellow-900/20 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold ndpr-text-warning mb-2",children:"Important: Next Steps"}),jsxRuntime.jsx("p",{className:"ndpr-text-warning 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."})]}),jsxRuntime.jsx("button",{onClick:()=>Z(false),className:`mt-4 px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${K}`,children:"Report Another Breach"})]});let rr=[{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 jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${G}`,d.root,c),children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",d.title,c),children:Oe}),jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:Le}),jsxRuntime.jsx("form",{onSubmit:er,className:chunkAME4HJR4_js.a("",d.form,c),children:jsxRuntime.jsxs("div",{className:"ndpr-form-section",children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("",d.fieldGroup,c),children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:"Breach Information"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"breachTitle",className:chunkAME4HJR4_js.a("ndpr-form-field__label",d.label,c),children:["Breach Title/Summary ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"breachTitle",value:D,onChange:r=>J(r.target.value),className:chunkAME4HJR4_js.a("ndpr-form-field__input",d.input,c),required:true,"aria-invalid":!!a.breachTitle,"aria-describedby":a.breachTitle?"breachTitle-error":void 0}),a.breachTitle&&jsxRuntime.jsx("p",{id:"breachTitle-error",role:"alert",className:"ndpr-form-field__error",children:a.breachTitle})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"category",className:chunkAME4HJR4_js.a("ndpr-form-field__label",d.label,c),children:["Breach Category ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsxs("select",{id:"category",value:w,onChange:r=>X(r.target.value),className:chunkAME4HJR4_js.a("ndpr-form-field__input",d.select,c),required:true,"aria-invalid":!!a.category,"aria-describedby":a.category?"category-error":void 0,children:[jsxRuntime.jsx("option",{value:"",children:"Select a category"}),Me.map(r=>jsxRuntime.jsx("option",{value:r.id,children:r.name},r.id))]}),a.category&&jsxRuntime.jsx("p",{id:"category-error",role:"alert",className:"ndpr-form-field__error",children:a.category})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{htmlFor:"description",className:chunkAME4HJR4_js.a("ndpr-form-field__label",d.label,c),children:["Detailed Description ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"description",value:R,onChange:r=>Q(r.target.value),rows:4,className:chunkAME4HJR4_js.a("ndpr-form-field__input",d.textarea,c),required:true,"aria-invalid":!!a.description,"aria-describedby":a.description?"description-error":void 0}),a.description&&jsxRuntime.jsx("p",{id:"description-error",role:"alert",className:"ndpr-form-field__error",children:a.description})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"discoveredAt",className:"ndpr-form-field__label",children:["Date Discovered ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"datetime-local",id:"discoveredAt",value:F,onChange:r=>V(r.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a.discoveredAt,"aria-describedby":a.discoveredAt?"discoveredAt-error":void 0}),a.discoveredAt&&jsxRuntime.jsx("p",{id:"discoveredAt-error",role:"alert",className:"ndpr-form-field__error",children:a.discoveredAt})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"occurredAt",className:"ndpr-form-field__label",children:"Date Occurred (if known)"}),jsxRuntime.jsx("input",{type:"datetime-local",id:"occurredAt",value:q,onChange:r=>ee(r.target.value),className:"ndpr-form-field__input"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:"Reporter Information"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reporterName",className:"ndpr-form-field__label",children:["Your Name ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"reporterName",value:P,onChange:r=>re(r.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a.reporterName,"aria-describedby":a.reporterName?"reporterName-error":void 0}),a.reporterName&&jsxRuntime.jsx("p",{id:"reporterName-error",role:"alert",className:"ndpr-form-field__error",children:a.reporterName})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reporterEmail",className:"ndpr-form-field__label",children:["Your Email ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"email",id:"reporterEmail",value:N,onChange:r=>te(r.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a.reporterEmail,"aria-describedby":a.reporterEmail?"reporterEmail-error":void 0}),a.reporterEmail&&jsxRuntime.jsx("p",{id:"reporterEmail-error",role:"alert",className:"ndpr-form-field__error",children:a.reporterEmail})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reporterDepartment",className:"ndpr-form-field__label",children:["Your Department ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"reporterDepartment",value:k,onChange:r=>ie(r.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a.reporterDepartment,"aria-describedby":a.reporterDepartment?"reporterDepartment-error":void 0}),a.reporterDepartment&&jsxRuntime.jsx("p",{id:"reporterDepartment-error",role:"alert",className:"ndpr-form-field__error",children:a.reporterDepartment})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"reporterPhone",className:"ndpr-form-field__label",children:"Your Phone Number (Optional)"}),jsxRuntime.jsx("input",{type:"tel",id:"reporterPhone",value:T,onChange:r=>ae(r.target.value),className:"ndpr-form-field__input"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:"Impact Information"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"affectedSystems",className:"ndpr-form-field__label",children:["Affected Systems/Applications ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"affectedSystems",value:Ze,onChange:We,placeholder:"e.g. CRM, Email Server, Website (comma separated)",className:"ndpr-form-field__input",required:true,"aria-invalid":!!a.affectedSystems,"aria-describedby":a.affectedSystems?"affectedSystems-error":void 0}),a.affectedSystems&&jsxRuntime.jsx("p",{id:"affectedSystems-error",role:"alert",className:"ndpr-form-field__error",children:a.affectedSystems})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"estimatedAffectedSubjects",className:"ndpr-form-field__label",children:"Estimated Number of Affected Data Subjects"}),jsxRuntime.jsx("input",{type:"text",id:"estimatedAffectedSubjects",value:h,onChange:r=>me(r.target.value),placeholder:"e.g. 100",className:"ndpr-form-field__input","aria-invalid":!!a.estimatedAffectedSubjects,"aria-describedby":a.estimatedAffectedSubjects?"estimatedAffectedSubjects-error":void 0}),a.estimatedAffectedSubjects&&jsxRuntime.jsx("p",{id:"estimatedAffectedSubjects-error",role:"alert",className:"ndpr-form-field__error",children:a.estimatedAffectedSubjects})]}),jsxRuntime.jsxs("fieldset",{className:"md:col-span-2","aria-invalid":!!a.dataTypes,"aria-describedby":a.dataTypes?"dataTypes-error":void 0,children:[jsxRuntime.jsxs("legend",{className:"ndpr-form-field__label",children:["Types of Data Involved ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required","aria-hidden":"true",children:"*"}),jsxRuntime.jsx("span",{className:"sr-only",children:"(required)"})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:rr.map(r=>jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"checkbox",id:`dataType_${r.id}`,checked:j.includes(r.id),onChange:()=>Je(r.id),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:`dataType_${r.id}`,className:"ml-2 text-sm ndpr-text-muted",children:r.label})]},r.id))}),a.dataTypes&&jsxRuntime.jsx("p",{id:"dataTypes-error",role:"alert",className:"ndpr-form-field__error",children:a.dataTypes})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"status",className:"ndpr-form-field__label",children:["Current Status ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsxs("select",{id:"status",value:ue,onChange:r=>xe(r.target.value),className:chunkAME4HJR4_js.a("ndpr-form-field__input",d.select,c),required:true,children:[jsxRuntime.jsx("option",{value:"ongoing",children:"Ongoing (breach is still active)"}),jsxRuntime.jsx("option",{value:"contained",children:"Contained (breach is stopped but not resolved)"}),jsxRuntime.jsx("option",{value:"resolved",children:"Resolved (breach is fully addressed)"})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"approximateRecordCount",className:"ndpr-form-field__label",children:"Approximate Number of Records Concerned"}),jsxRuntime.jsx("input",{type:"text",id:"approximateRecordCount",value:I,onChange:r=>ce(r.target.value),placeholder:"e.g. 5000",className:"ndpr-form-field__input"}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted mt-1",children:"Required for the NDPC report (NDPA Section 40(2))."})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dataSubjectCategories",className:"ndpr-form-field__label",children:"Categories of Data Subjects Affected"}),jsxRuntime.jsx("input",{type:"text",id:"dataSubjectCategories",value:B,onChange:r=>pe(r.target.value),placeholder:"e.g. customers, employees, minors",className:"ndpr-form-field__input"}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted mt-1",children:"Comma-separated. Required for the NDPC report (NDPA Section 40(2))."})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2 flex items-center",children:[jsxRuntime.jsx("input",{id:"involvesSensitiveData",type:"checkbox",checked:le,onChange:r=>ge(r.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"involvesSensitiveData",className:"ml-2 text-sm ndpr-text-muted",children:"Sensitive personal data (NDPA Section 30) is involved"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"likelyConsequences",className:"ndpr-form-field__label",children:"Likely Consequences for Data Subjects"}),jsxRuntime.jsx("textarea",{id:"likelyConsequences",value:E,onChange:r=>be(r.target.value),placeholder:"e.g. identity theft, financial loss, reputational damage, discrimination",rows:3,className:chunkAME4HJR4_js.a("ndpr-form-field__input",d.textarea,c)}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted mt-1",children:"Required content for NDPC report and Section 40(3) communications to data subjects."})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"mitigationMeasures",className:"ndpr-form-field__label",children:"Mitigation Measures"}),jsxRuntime.jsx("textarea",{id:"mitigationMeasures",value:M,onChange:r=>fe(r.target.value),placeholder:"Measures taken or proposed to mitigate possible adverse effects (NDPA Section 40(3))",rows:3,className:chunkAME4HJR4_js.a("ndpr-form-field__input",d.textarea,c)})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("h4",{className:"ndpr-section-heading text-sm mt-4",children:"Data Protection Officer (NDPC contact)"}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted mb-2",children:"Defaults to organisation-level DPO if left blank."})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dpoName",className:"ndpr-form-field__label",children:"DPO Name"}),jsxRuntime.jsx("input",{type:"text",id:"dpoName",value:$,onChange:r=>he(r.target.value),className:"ndpr-form-field__input"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dpoEmail",className:"ndpr-form-field__label",children:"DPO Email"}),jsxRuntime.jsx("input",{type:"email",id:"dpoEmail",value:O,onChange:r=>ve(r.target.value),className:"ndpr-form-field__input"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dpoPhone",className:"ndpr-form-field__label",children:"DPO Phone"}),jsxRuntime.jsx("input",{type:"tel",id:"dpoPhone",value:L,onChange:r=>Ne(r.target.value),className:"ndpr-form-field__input"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2 flex items-center mt-2",children:[jsxRuntime.jsx("input",{id:"isPhasedReport",type:"checkbox",checked:z,onChange:r=>_e(r.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"isPhasedReport",className:"ml-2 text-sm ndpr-text-muted",children:"This is a phased / interim report (Section 40(2) \u2014 complete info not yet available)"})]}),z&&jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"supplementsReportId",className:"ndpr-form-field__label",children:"Supplements Report ID (if applicable)"}),jsxRuntime.jsx("input",{type:"text",id:"supplementsReportId",value:Y,onChange:r=>ye(r.target.value),placeholder:"Prior report ID this report supplements",className:"ndpr-form-field__input"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"initialActions",className:"ndpr-form-field__label",children:"Initial Actions Taken"}),jsxRuntime.jsx("textarea",{id:"initialActions",value:U,onChange:r=>Ce(r.target.value),placeholder:"Describe any immediate actions that have been taken to address the breach",rows:3,className:chunkAME4HJR4_js.a("ndpr-form-field__input",d.textarea,c)})]})]})]}),He&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:"Attachments"}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("label",{className:"ndpr-form-field__label",children:"Upload Supporting Files (Optional)"}),jsxRuntime.jsxs("p",{className:"text-xs ndpr-text-muted mb-2",children:["Max ",x," files, ",C/(1024*1024),"MB each. Allowed types: ",S.join(", ")]}),jsxRuntime.jsx("input",{type:"file",onChange:Qe,multiple:true,className:"ndpr-form-field__input",accept:S.join(",")}),a.attachments&&jsxRuntime.jsx("p",{id:"attachments-error",role:"alert",className:"ndpr-form-field__error",children:a.attachments})]}),_.length>0&&jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("h4",{className:"ndpr-form-field__label",children:"Attached Files:"}),jsxRuntime.jsx("ul",{className:"ndpr-form-section",children:_.map((r,o)=>jsxRuntime.jsxs("li",{className:"flex items-center justify-between p-2 bg-gray-50 dark:bg-gray-700 rounded",children:[jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("svg",{className:"w-4 h-4 ndpr-text-muted mr-2",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.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"})}),jsxRuntime.jsx("span",{className:"text-sm ndpr-text-muted",children:r.name}),jsxRuntime.jsxs("span",{className:"ml-2 text-xs ndpr-text-muted",children:["(",(r.size/1024).toFixed(1)," KB)"]})]}),jsxRuntime.jsxs("button",{type:"button",onClick:()=>Xe(o),"aria-label":`Remove attachment ${r.name}`,className:"text-red-500 hover:ndpr-text-destructive p-2 min-w-[44px] min-h-[44px] flex items-center justify-center",children:[jsxRuntime.jsx("svg",{"aria-hidden":"true",focusable:"false",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:"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"})}),jsxRuntime.jsx("span",{className:"sr-only",children:"Remove"})]})]},o))})]})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-alert ndpr-alert--info",d.notice,c),children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold ndpr-text-info mb-2",children:"NDPA Breach Notification Requirements"}),jsxRuntime.jsx("p",{className:"ndpr-text-info 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."})]}),jsxRuntime.jsxs("div",{className:"mt-6 relative flex gap-3",children:[f&&d.loadingOverlay&&jsxRuntime.jsx("div",{className:d.loadingOverlay}),jsxRuntime.jsx("button",{type:"submit",disabled:f,className:chunkAME4HJR4_js.a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${K} ${f?"opacity-50 cursor-not-allowed":""}`,d.primaryButton||d.submitButton,c),children:f?"Submitting...":ze}),jsxRuntime.jsx("button",{type:"button",onClick:Ke,disabled:f,className:chunkAME4HJR4_js.a("px-6 py-3 bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-200 rounded-md hover:bg-gray-300 dark:hover:bg-gray-500 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2",void 0,c),children:"Reset"})]})]})})]})};
|
|
2
|
+
exports.a=or;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function s(t,n,r){return r?n||"":n||t}export{s as a};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
2
|
-
//# sourceMappingURL=chunk-3NQQSU4P.js.map
|
|
1
|
+
'use strict';var chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var G=({settings:k,storageOptions:O={},onLoad:i,onSave:p,autoSave:v=true,autoLoad:w=true,classNames:u,unstyled:h,children:c})=>{let{storageKey:o="ndpr_consent",storageType:n="localStorage",cookieOptions:l={}}=O,[r,$]=react.useState(false),S=react.useCallback(()=>{let e=null;try{if(n==="localStorage"&&typeof window!="undefined"){let t=localStorage.getItem(o);t&&(e=JSON.parse(t));}else if(n==="sessionStorage"&&typeof window!="undefined"){let t=sessionStorage.getItem(o);t&&(e=JSON.parse(t));}else if(n==="cookie"&&typeof document!="undefined"){let s=document.cookie.split(";").find(a=>a.trim().startsWith(`${o}=`));if(s){let a=s.split("=")[1];e=JSON.parse(decodeURIComponent(a));}}$(!0),i&&i(e);}catch(t){console.error("[ndpr-toolkit] Error loading consent settings:",t),$(true),i&&i(null);}return e},[n,o,i]),m=react.useCallback(e=>{try{let t=JSON.stringify(e);if(n==="localStorage"&&typeof window!="undefined")localStorage.setItem(o,t);else if(n==="sessionStorage"&&typeof window!="undefined")sessionStorage.setItem(o,t);else if(n==="cookie"&&typeof document!="undefined"){let{domain:s,path:a="/",expires:N=365,secure:D=!0,sameSite:E="Lax"}=l,C=new Date;C.setDate(C.getDate()+N);let g=`${o}=${encodeURIComponent(t)}; path=${a}; expires=${C.toUTCString()}`;s&&(g+=`; domain=${s}`),D&&(g+="; secure"),g+=`; samesite=${E}`,document.cookie=g;}return p&&p(e),!0}catch(t){return console.error("[ndpr-toolkit] Error saving consent settings:",t),false}},[n,o,l,p]),x=react.useCallback(()=>{try{if(n==="localStorage"&&typeof window!="undefined")localStorage.removeItem(o);else if(n==="sessionStorage"&&typeof window!="undefined")sessionStorage.removeItem(o);else if(n==="cookie"&&typeof document!="undefined"){let{domain:e,path:t="/"}=l,s=`${o}=; path=${t}; expires=Thu, 01 Jan 1970 00:00:00 GMT`;e&&(s+=`; domain=${e}`),document.cookie=s;}return !0}catch(e){return console.error("[ndpr-toolkit] Error clearing consent settings:",e),false}},[n,o,l]);react.useEffect(()=>{w&&!r&&S();},[w,r,S]),react.useEffect(()=>{v&&r&&m(k);},[k,v,r,m]);let d=chunkAME4HJR4_js.a("",u==null?void 0:u.root,h);if(typeof c=="function"){let e=c({loadSettings:S,saveSettings:m,clearSettings:x,loaded:r});return d?jsxRuntime.jsx("div",{className:d,children:e}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:e})}return d?jsxRuntime.jsx("div",{className:d,children:c}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:c})};exports.a=G;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {c,d,b as b$1}from'./chunk-
|
|
1
|
+
import {c,d,b as b$1}from'./chunk-Y3MKMAFQ.mjs';import {a}from'./chunk-SFGW37LE.mjs';import {d as d$1,b,a as a$1}from'./chunk-ZJYULEER.mjs';import {useId,useState,useEffect}from'react';import {jsxs,jsx}from'react/jsx-runtime';var ye=({sections:_=c,variables:U=d,onGenerate:L,title:M="NDPA Privacy Policy Generator",description:V="Generate an NDPA-compliant privacy policy for your organization in accordance with NDPA Section 24.",className:K="",buttonClassName:T="",generateButtonText:Q="Generate Policy",showPreview:B=true,allowEditing:N=true,classNames:r,unstyled:x=false})=>{let P=useId(),[A,n]=useState(_),[i,s]=useState(U),[m,$]=useState("sections"),[S,X]=useState(""),[F,R]=useState(""),[J,Z]=useState(false),[v,I]=useState({});useEffect(()=>{n(_);},[_]),useEffect(()=>{s(U);},[U]);let G=l=>{n(c=>c.map(a=>a.id===l?b(a$1({},a),{included:!a.included}):a));},W=(l,c)=>{s(a=>a.map(b$1=>b$1.id===l?b(a$1({},b$1),{value:c}):b$1)),v[l]&&I(a=>{let b=a$1({},a);return delete b[l],b});},j=()=>{let l={},c=true;return i.forEach(a=>{a.required&&!a.value&&(l[a.id]=`${a.name} is required`,c=false);}),I(l),c},ee=()=>{if(!j()){$("variables");return}let l=A.filter(b=>b.included),c=Object.fromEntries(i.map(b=>[b.name,b.value])),a="";l.forEach(b=>{a+=`## ${b.title}
|
|
2
2
|
|
|
3
3
|
`,a+=b$1(b.template,c),a+=`
|
|
4
4
|
|
|
@@ -90,5 +90,4 @@ import {c,d,b as b$1}from'./chunk-CKGJK4D7.mjs';import {a}from'./chunk-AYKLAEOU.
|
|
|
90
90
|
<p>© ${new Date().getFullYear()} ${L||"Company"}. All rights reserved.</p>
|
|
91
91
|
</div>
|
|
92
92
|
</body>
|
|
93
|
-
</html>`,u},l=()=>d$1(null,null,function*(){R(true),Z(null);try{let e=S.toLowerCase(),y="",u;switch(e){case "pdf":let te=q();u=new Blob([te],{type:"text/html"}),y=URL.createObjectURL(u);break;case "docx":u=new Blob([_],{type:"text/plain"}),y=URL.createObjectURL(u);break;case "html":let pe=q();u=new Blob([pe],{type:"text/html"}),y=URL.createObjectURL(u);break;default:u=new Blob([_],{type:"text/markdown"}),y=URL.createObjectURL(u);break}let z=C(e),O=document.createElement("a");O.href=y,O.download=z,document.body.appendChild(O),O.click(),document.body.removeChild(O);let E={id:`export_${Date.now()}`,format:e,timestamp:Date.now(),url:y,filename:z};$(te=>[E,...te]),V&&V(e,y);}catch(e){console.error("[ndpr-toolkit] Export error:",e),Z("An error occurred during export. Please try again.");}finally{R(false);}}),c=()=>{let e=[{value:"pdf",label:"PDF Document (.pdf)"},{value:"docx",label:"Word Document (.docx)"},{value:"html",label:"Web Page (.html)"},{value:"markdown",label:"Markdown (.md)"}],y=`${s}-export-format`;return jsxs("div",{"data-ndpr-component":"policy-exporter",className:a("mb-6",n==null?void 0:n.formatSelector,i),children:[jsx("label",{htmlFor:y,className:"ndpr-form-field__label",children:"Export Format"}),jsx("select",{id:y,value:S,onChange:u=>X(u.target.value),className:a("ndpr-form-field__input",n==null?void 0:n.formatOption,i),children:e.map(u=>jsx("option",{value:u.value,children:u.label},u.value))})]})},a$1=()=>h?jsxs("div",{className:"mb-6 space-y-4 border border-gray-200 dark:border-gray-700 rounded-md p-4",children:[jsxs("div",{className:"flex justify-between items-center",children:[jsx("h3",{className:"text-md font-medium",children:"Advanced Export Options"}),jsx("button",{type:"button",onClick:()=>g(false),className:"ndpr-text-primary text-sm",children:"Hide Advanced Options"})]}),jsxs("div",{children:[jsx("label",{htmlFor:`${s}-custom-filename`,className:"ndpr-form-field__label",children:"Custom Filename"}),jsx("input",{type:"text",id:`${s}-custom-filename`,value:v,onChange:e=>I(e.target.value),placeholder:w(S),"aria-describedby":`${s}-custom-filename-desc`,className:"ndpr-form-field__input"}),jsx("p",{id:`${s}-custom-filename-desc`,className:"ndpr-form-field__hint",children:"Leave blank to use the default filename format."})]}),jsxs("div",{children:[jsx("label",{htmlFor:`${s}-custom-header`,className:"ndpr-form-field__label",children:"Custom Header HTML (for HTML/PDF exports)"}),jsx("textarea",{id:`${s}-custom-header`,value:G,onChange:e=>W(e.target.value),rows:3,placeholder:"<div>Custom header content</div>",className:"ndpr-form-field__input"})]}),jsxs("div",{children:[jsx("label",{htmlFor:`${s}-custom-footer`,className:"ndpr-form-field__label",children:"Custom Footer HTML (for HTML/PDF exports)"}),jsx("textarea",{id:`${s}-custom-footer`,value:j,onChange:e=>ee(e.target.value),rows:3,placeholder:"<div>Custom footer content</div>",className:"ndpr-form-field__input"})]}),jsxs("div",{className:"flex items-start",children:[jsx("div",{className:"flex items-center h-5",children:jsx("input",{id:`${s}-include-compliance-notice`,type:"checkbox",checked:r,onChange:e=>g(e.target.checked),"aria-describedby":`${s}-compliance-notice-desc`,className:"w-4 h-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))] dark:focus:ring-[rgb(var(--ndpr-ring))] dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"})}),jsxs("div",{className:"ml-3 text-sm",children:[jsx("label",{htmlFor:`${s}-include-compliance-notice`,className:"font-medium ndpr-text-foreground",children:"Include NDPA Compliance Notice"}),jsx("p",{id:`${s}-compliance-notice-desc`,className:"ndpr-card__subtitle",children:"Adds a notice explaining that this policy complies with NDPA requirements."})]})]})]}):jsx("button",{type:"button",onClick:()=>g(true),className:"ndpr-text-primary text-sm mb-6",children:"Show Advanced Options"}),b=()=>!N||m.length===0?null:jsxs("div",{className:a("mt-6",n==null?void 0:n.preview,i),children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Export History"}),jsx("div",{className:"bg-gray-50 dark:bg-gray-700 rounded-md overflow-hidden",children:jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-600",children:[jsx("thead",{className:"bg-gray-100 dark:bg-gray-800",children:jsxs("tr",{children:[jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Date"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Format"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Filename"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Actions"})]})}),jsx("tbody",{className:"bg-white dark:bg-gray-700 divide-y divide-gray-200 dark:divide-gray-600",children:m.map(e=>jsxs("tr",{children:[jsx("td",{className:"ndpr-table__cell",children:new Date(e.timestamp).toLocaleString()}),jsx("td",{className:"ndpr-table__cell",children:e.format.toUpperCase()}),jsx("td",{className:"ndpr-table__cell",children:e.filename}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:jsx("a",{href:e.url,download:e.filename,className:"ndpr-text-primary hover:text-[rgb(var(--ndpr-primary-hover))] dark:hover:text-[rgb(var(--ndpr-primary-hover))] mr-4",children:"Download"})})]},e.id))})]})})]});return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${Q}`,n==null?void 0:n.root,i),children:[jsxs("div",{className:a("mb-6",n==null?void 0:n.header,i),children:[jsx("h2",{className:a("ndpr-section-heading",n==null?void 0:n.title,i),children:K}),jsx("p",{className:a("ndpr-card__subtitle",n==null?void 0:n.description,i),children:T})]}),c(),a$1(),jsxs("div",{className:"mb-6",children:[jsx("button",{onClick:l,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 ${B} ${F?"opacity-70 cursor-not-allowed":""}`,(n==null?void 0:n.primaryButton)||(n==null?void 0:n.exportButton),i),children:F?"Exporting...":`Export as ${S.toUpperCase()}`}),J&&jsx("p",{className:"mt-2 text-sm ndpr-text-destructive dark:text-red-500",children:J})]}),jsxs("div",{className:a("ndpr-alert ndpr-alert--info",n==null?void 0:n.complianceNotice,i),children:[jsx("h3",{className:"text-sm font-bold ndpr-text-info mb-2",children:"Export Tips"}),jsxs("ul",{className:"ndpr-text-info text-sm list-disc list-inside space-y-1",children:[jsx("li",{children:"PDF format is recommended for printing or sharing with stakeholders."}),jsx("li",{children:"HTML format is ideal for publishing on your website."}),jsx("li",{children:"DOCX format allows for further editing in Microsoft Word or similar applications."}),jsx("li",{children:"Markdown format is useful for version control systems or technical documentation."})]})]}),b()]})};export{ye as a,_e as b,Ae as c}
|
|
94
|
-
//# sourceMappingURL=chunk-H3EYBSVP.mjs.map
|
|
93
|
+
</html>`,u},l=()=>d$1(null,null,function*(){R(true),Z(null);try{let e=S.toLowerCase(),y="",u;switch(e){case "pdf":let te=q();u=new Blob([te],{type:"text/html"}),y=URL.createObjectURL(u);break;case "docx":u=new Blob([_],{type:"text/plain"}),y=URL.createObjectURL(u);break;case "html":let pe=q();u=new Blob([pe],{type:"text/html"}),y=URL.createObjectURL(u);break;default:u=new Blob([_],{type:"text/markdown"}),y=URL.createObjectURL(u);break}let z=C(e),O=document.createElement("a");O.href=y,O.download=z,document.body.appendChild(O),O.click(),document.body.removeChild(O);let E={id:`export_${Date.now()}`,format:e,timestamp:Date.now(),url:y,filename:z};$(te=>[E,...te]),V&&V(e,y);}catch(e){console.error("[ndpr-toolkit] Export error:",e),Z("An error occurred during export. Please try again.");}finally{R(false);}}),c=()=>{let e=[{value:"pdf",label:"PDF Document (.pdf)"},{value:"docx",label:"Word Document (.docx)"},{value:"html",label:"Web Page (.html)"},{value:"markdown",label:"Markdown (.md)"}],y=`${s}-export-format`;return jsxs("div",{"data-ndpr-component":"policy-exporter",className:a("mb-6",n==null?void 0:n.formatSelector,i),children:[jsx("label",{htmlFor:y,className:"ndpr-form-field__label",children:"Export Format"}),jsx("select",{id:y,value:S,onChange:u=>X(u.target.value),className:a("ndpr-form-field__input",n==null?void 0:n.formatOption,i),children:e.map(u=>jsx("option",{value:u.value,children:u.label},u.value))})]})},a$1=()=>h?jsxs("div",{className:"mb-6 space-y-4 border border-gray-200 dark:border-gray-700 rounded-md p-4",children:[jsxs("div",{className:"flex justify-between items-center",children:[jsx("h3",{className:"text-md font-medium",children:"Advanced Export Options"}),jsx("button",{type:"button",onClick:()=>g(false),className:"ndpr-text-primary text-sm",children:"Hide Advanced Options"})]}),jsxs("div",{children:[jsx("label",{htmlFor:`${s}-custom-filename`,className:"ndpr-form-field__label",children:"Custom Filename"}),jsx("input",{type:"text",id:`${s}-custom-filename`,value:v,onChange:e=>I(e.target.value),placeholder:w(S),"aria-describedby":`${s}-custom-filename-desc`,className:"ndpr-form-field__input"}),jsx("p",{id:`${s}-custom-filename-desc`,className:"ndpr-form-field__hint",children:"Leave blank to use the default filename format."})]}),jsxs("div",{children:[jsx("label",{htmlFor:`${s}-custom-header`,className:"ndpr-form-field__label",children:"Custom Header HTML (for HTML/PDF exports)"}),jsx("textarea",{id:`${s}-custom-header`,value:G,onChange:e=>W(e.target.value),rows:3,placeholder:"<div>Custom header content</div>",className:"ndpr-form-field__input"})]}),jsxs("div",{children:[jsx("label",{htmlFor:`${s}-custom-footer`,className:"ndpr-form-field__label",children:"Custom Footer HTML (for HTML/PDF exports)"}),jsx("textarea",{id:`${s}-custom-footer`,value:j,onChange:e=>ee(e.target.value),rows:3,placeholder:"<div>Custom footer content</div>",className:"ndpr-form-field__input"})]}),jsxs("div",{className:"flex items-start",children:[jsx("div",{className:"flex items-center h-5",children:jsx("input",{id:`${s}-include-compliance-notice`,type:"checkbox",checked:r,onChange:e=>g(e.target.checked),"aria-describedby":`${s}-compliance-notice-desc`,className:"w-4 h-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))] dark:focus:ring-[rgb(var(--ndpr-ring))] dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"})}),jsxs("div",{className:"ml-3 text-sm",children:[jsx("label",{htmlFor:`${s}-include-compliance-notice`,className:"font-medium ndpr-text-foreground",children:"Include NDPA Compliance Notice"}),jsx("p",{id:`${s}-compliance-notice-desc`,className:"ndpr-card__subtitle",children:"Adds a notice explaining that this policy complies with NDPA requirements."})]})]})]}):jsx("button",{type:"button",onClick:()=>g(true),className:"ndpr-text-primary text-sm mb-6",children:"Show Advanced Options"}),b=()=>!N||m.length===0?null:jsxs("div",{className:a("mt-6",n==null?void 0:n.preview,i),children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Export History"}),jsx("div",{className:"bg-gray-50 dark:bg-gray-700 rounded-md overflow-hidden",children:jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-600",children:[jsx("thead",{className:"bg-gray-100 dark:bg-gray-800",children:jsxs("tr",{children:[jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Date"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Format"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Filename"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Actions"})]})}),jsx("tbody",{className:"bg-white dark:bg-gray-700 divide-y divide-gray-200 dark:divide-gray-600",children:m.map(e=>jsxs("tr",{children:[jsx("td",{className:"ndpr-table__cell",children:new Date(e.timestamp).toLocaleString()}),jsx("td",{className:"ndpr-table__cell",children:e.format.toUpperCase()}),jsx("td",{className:"ndpr-table__cell",children:e.filename}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:jsx("a",{href:e.url,download:e.filename,className:"ndpr-text-primary hover:text-[rgb(var(--ndpr-primary-hover))] dark:hover:text-[rgb(var(--ndpr-primary-hover))] mr-4",children:"Download"})})]},e.id))})]})})]});return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${Q}`,n==null?void 0:n.root,i),children:[jsxs("div",{className:a("mb-6",n==null?void 0:n.header,i),children:[jsx("h2",{className:a("ndpr-section-heading",n==null?void 0:n.title,i),children:K}),jsx("p",{className:a("ndpr-card__subtitle",n==null?void 0:n.description,i),children:T})]}),c(),a$1(),jsxs("div",{className:"mb-6",children:[jsx("button",{onClick:l,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 ${B} ${F?"opacity-70 cursor-not-allowed":""}`,(n==null?void 0:n.primaryButton)||(n==null?void 0:n.exportButton),i),children:F?"Exporting...":`Export as ${S.toUpperCase()}`}),J&&jsx("p",{className:"mt-2 text-sm ndpr-text-destructive dark:text-red-500",children:J})]}),jsxs("div",{className:a("ndpr-alert ndpr-alert--info",n==null?void 0:n.complianceNotice,i),children:[jsx("h3",{className:"text-sm font-bold ndpr-text-info mb-2",children:"Export Tips"}),jsxs("ul",{className:"ndpr-text-info text-sm list-disc list-inside space-y-1",children:[jsx("li",{children:"PDF format is recommended for printing or sharing with stakeholders."}),jsx("li",{children:"HTML format is ideal for publishing on your website."}),jsx("li",{children:"DOCX format allows for further editing in Microsoft Word or similar applications."}),jsx("li",{children:"Markdown format is useful for version control systems or technical documentation."})]})]}),b()]})};export{ye as a,_e as b,Ae as c};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
'use strict';function h(n){var c;let i={low:0,medium:0,high:0,critical:0},l=0,o=[];((c=n.risks)!=null?c:[]).forEach(e=>{i[e.level]++,e.score>l&&(l=e.score),(e.level==="high"||e.level==="critical")&&!e.mitigated&&o.push(e);});let s;i.critical>0?s="critical":i.high>2||i.high>0&&i.medium>3?s="high":i.high>0||i.medium>1?s="medium":s="low";let r=s==="high"||s==="critical",a=o.length===0,t=[];return o.length>0&&t.push(`Mitigate the following high/critical risks before proceeding: ${o.map(e=>e.description).join(", ")}`),r&&t.push("Consult with the NDPC (Nigeria Data Protection Commission) before proceeding with this processing activity, as required by NDPA Section
|
|
2
|
-
//# sourceMappingURL=chunk-P42Z5CFE.js.map
|
|
1
|
+
'use strict';function h(n){var c;let i={low:0,medium:0,high:0,critical:0},l=0,o=[];((c=n.risks)!=null?c:[]).forEach(e=>{i[e.level]++,e.score>l&&(l=e.score),(e.level==="high"||e.level==="critical")&&!e.mitigated&&o.push(e);});let s;i.critical>0?s="critical":i.high>2||i.high>0&&i.medium>3?s="high":i.high>0||i.medium>1?s="medium":s="low";let r=s==="high"||s==="critical",a=o.length===0,t=[];return o.length>0&&t.push(`Mitigate the following high/critical risks before proceeding: ${o.map(e=>e.description).join(", ")}`),r&&t.push("Consult with the NDPC (Nigeria Data Protection Commission) before proceeding with this processing activity, as required by NDPA Section 28(2)."),i.medium>0&&t.push("Implement additional safeguards to reduce medium-level risks where possible."),s!=="low"?t.push("Schedule a review of this DPIA in 6 months to reassess risks and effectiveness of mitigation measures."):t.push("Schedule a review of this DPIA in 12 months as part of regular compliance activities."),{overallRiskLevel:s,requiresConsultation:r,canProceed:a,recommendations:t}}exports.a=h;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-EPT2K355.mjs.map
|
|
1
|
+
import {a}from'./chunk-SFGW37LE.mjs';import {b,a as a$1}from'./chunk-ZJYULEER.mjs';import {useState,useRef,useEffect}from'react';import {jsxs,jsx}from'react/jsx-runtime';var G=({options:p,settings:d,onSave:S,title:l="Manage Your Privacy Settings",description:R="Update your consent preferences at any time. Required cookies cannot be disabled as they are necessary for the website to function. Consent management is provided in accordance with NDPA Sections 25-26.",saveButtonText:w="Save Preferences",resetButtonText:M="Reset to Defaults",version:_="1.0",className:f="",buttonClassName:v="",primaryButtonClassName:T="",secondaryButtonClassName:k="",classNames:n,unstyled:e,showSuccessMessage:$=true,successMessage:D="Your preferences have been saved.",successMessageDuration:P=3e3})=>{let[u,c]=useState({}),[q,b$1]=useState(false),g=useRef(null);useEffect(()=>()=>{g.current&&clearTimeout(g.current);},[]),useEffect(()=>{if(d&&d.consents)c(d.consents);else {let t={};p.forEach(o=>{t[o.id]=o.defaultValue||false;}),c(t);}},[p,d]);let x=(t,o)=>{c(s=>b(a$1({},s),{[t]:o}));},E=()=>{let t={consents:u,timestamp:Date.now(),version:_,method:"manager",hasInteracted:true};S(t),$&&(b$1(true),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{b$1(false);},P));},I=()=>{let t={};p.forEach(o=>{t[o.id]=o.defaultValue||false;}),c(t);},L=`ndpr-consent-manager__button ndpr-consent-manager__button--primary ${v} ${T}`.trim(),y=`ndpr-consent-manager__button ndpr-consent-manager__button--secondary ${v} ${k}`.trim(),V=(n==null?void 0:n.primaryButton)||(n==null?void 0:n.saveButton)||L,F=(n==null?void 0:n.secondaryButton)||(n==null?void 0:n.resetButton)||y,O=`ndpr-consent-manager${f?` ${f}`:""}`;return jsxs("div",{"data-ndpr-component":"consent-manager",className:a(O,n==null?void 0:n.root,e),children:[jsx("h2",{className:a("ndpr-consent-manager__title",n==null?void 0:n.title,e),children:l}),jsx("p",{className:a("ndpr-consent-manager__description",n==null?void 0:n.description,e),children:R}),jsx("div",{className:a("ndpr-consent-manager__options-list",n==null?void 0:n.optionsList,e),children:p.map(t=>{let o=`consent-manager-${t.id}`;return jsxs("div",{className:a("ndpr-consent-manager__option",n==null?void 0:n.optionItem,e),children:[jsxs("div",{className:e?"":"ndpr-consent-manager__option-info",children:[jsx("h3",{className:e?"":"ndpr-consent-manager__option-label",children:t.label}),jsx("p",{className:e?"":"ndpr-consent-manager__option-description",children:t.description})]}),jsxs("label",{htmlFor:o,className:e?"":"ndpr-consent-manager__toggle-wrapper",children:[jsx("input",{id:o,type:"checkbox",className:e?"":"ndpr-consent-manager__toggle-input",checked:u[t.id]||false,onChange:s=>x(t.id,s.target.checked),disabled:t.required}),jsx("span",{"aria-hidden":"true",className:a("ndpr-consent-manager__toggle",n==null?void 0:n.toggle,e)}),jsxs("span",{className:e?"":"ndpr-consent-manager__toggle-status",children:[u[t.id]?"Enabled":"Disabled",t.required&&jsx("span",{className:e?"":"ndpr-consent-manager__required-marker",children:"(Required)"})]})]})]},t.id)})}),q&&jsx("div",{className:e?"":"ndpr-consent-manager__success","aria-live":"polite",role:"status",children:D}),jsxs("div",{className:e?"":"ndpr-consent-manager__buttons",children:[jsx("button",{onClick:E,className:a(V,n==null?void 0:n.saveButton,e),children:w}),jsx("button",{onClick:I,className:a(F,n==null?void 0:n.resetButton,e),children:M})]}),jsxs("div",{className:e?"":"ndpr-consent-manager__meta",children:[jsxs("p",{children:["Last updated: ",d?new Date(d.timestamp).toLocaleString():"Never"]}),jsxs("p",{children:["Version: ",_]})]})]})};export{G as a};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
function p(t){return {load(){if(typeof window=="undefined")return null;try{let e=sessionStorage.getItem(t);return e?JSON.parse(e):null}catch(e){return null}},save(e){if(typeof window!="undefined")try{sessionStorage.setItem(t,JSON.stringify(e));}catch(i){}},remove(){if(typeof window!="undefined")try{sessionStorage.removeItem(t);}catch(e){}}}}function m(t,e={}){let{domain:i,path:s="/",expires:d=365,secure:u=true,sameSite:c="Lax"}=e;return {load(){if(typeof document=="undefined")return null;try{let n=encodeURIComponent(t),a=document.cookie.split(";").map(o=>o.trim()).find(o=>o.startsWith(`${n}=`));if(!a)return null;let r=a.indexOf("=");return JSON.parse(decodeURIComponent(a.slice(r+1)))}catch(n){return null}},save(n){if(typeof document=="undefined")return;let a=u||c==="None",r=`${encodeURIComponent(t)}=${encodeURIComponent(JSON.stringify(n))}; path=${s}; samesite=${c}`;if(d>0){let o=new Date;o.setDate(o.getDate()+d),r+=`; expires=${o.toUTCString()}`;}i&&(r+=`; domain=${i}`),a&&(r+="; secure"),document.cookie=r;},remove(){if(typeof document=="undefined")return;let n=`${encodeURIComponent(t)}=; path=${s}; expires=Thu, 01 Jan 1970 00:00:00 GMT`;i&&(n+=`; domain=${i}`),document.cookie=n;}}}export{p as a,m as b}
|
|
2
|
-
//# sourceMappingURL=chunk-R3OYAJI6.mjs.map
|
|
1
|
+
function p(t){return {load(){if(typeof window=="undefined")return null;try{let e=sessionStorage.getItem(t);return e?JSON.parse(e):null}catch(e){return null}},save(e){if(typeof window!="undefined")try{sessionStorage.setItem(t,JSON.stringify(e));}catch(i){}},remove(){if(typeof window!="undefined")try{sessionStorage.removeItem(t);}catch(e){}}}}function m(t,e={}){let{domain:i,path:s="/",expires:d=365,secure:u=true,sameSite:c="Lax"}=e;return {load(){if(typeof document=="undefined")return null;try{let n=encodeURIComponent(t),a=document.cookie.split(";").map(o=>o.trim()).find(o=>o.startsWith(`${n}=`));if(!a)return null;let r=a.indexOf("=");return JSON.parse(decodeURIComponent(a.slice(r+1)))}catch(n){return null}},save(n){if(typeof document=="undefined")return;let a=u||c==="None",r=`${encodeURIComponent(t)}=${encodeURIComponent(JSON.stringify(n))}; path=${s}; samesite=${c}`;if(d>0){let o=new Date;o.setDate(o.getDate()+d),r+=`; expires=${o.toUTCString()}`;}i&&(r+=`; domain=${i}`),a&&(r+="; secure"),document.cookie=r;},remove(){if(typeof document=="undefined")return;let n=`${encodeURIComponent(t)}=; path=${s}; expires=Thu, 01 Jan 1970 00:00:00 GMT`;i&&(n+=`; domain=${i}`),document.cookie=n;}}}export{p as a,m as b};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
2
|
-
//# sourceMappingURL=chunk-RXL6CZAI.js.map
|
|
1
|
+
'use strict';var chunk7IFSWCQP_js=require('./chunk-7IFSWCQP.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var d=react.createContext({}),s=class extends react.Component{constructor(e){super(e);this.reset=()=>{this.setState({error:null});};this.state={error:null};}static getDerivedStateFromError(e){return {error:e}}componentDidCatch(e,r){var a,t;(t=(a=this.props).onError)==null||t.call(a,e,r);}render(){let{error:e}=this.state;if(e){let{fallback:r}=this.props;return typeof r=="function"?r(e,this.reset):r!==void 0?r:jsxRuntime.jsxs("div",{role:"alert",style:{padding:"16px",border:"1px solid #e53e3e",borderRadius:"4px",backgroundColor:"#fff5f5",color:"#c53030"},children:[jsxRuntime.jsx("h3",{style:{margin:"0 0 8px 0",fontSize:"16px"},children:"Something went wrong"}),jsxRuntime.jsx("p",{style:{margin:0,fontSize:"14px"},children:e.message})]})}return this.props.children}},E=a=>{var t=a,{children:o,fallback:p,onError:e}=t,r=chunkRFPLZDIO_js.c(t,["children","fallback","onError"]);let l=react.useMemo(()=>{if(!r.theme)return;let n={};return r.theme.primary&&(n["--ndpr-primary"]=r.theme.primary),r.theme.primaryHover&&(n["--ndpr-primary-hover"]=r.theme.primaryHover),r.theme.primaryForeground&&(n["--ndpr-primary-foreground"]=r.theme.primaryForeground),Object.keys(n).length>0?n:void 0},[r.theme]);return jsxRuntime.jsx(d.Provider,{value:r,children:jsxRuntime.jsx(s,{fallback:p,onError:e,children:l?jsxRuntime.jsx("div",{style:l,children:o}):o})})};function v(){return react.useContext(d)}function D(){let{locale:o}=react.useContext(d);return react.useMemo(()=>chunk7IFSWCQP_js.b(o),[o])}exports.a=E;exports.b=v;exports.c=D;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use strict';var chunkN3MQQUQP_js=require('./chunk-N3MQQUQP.js'),chunkQ64735OC_js=require('./chunk-Q64735OC.js'),chunkVWED6UTN_js=require('./chunk-VWED6UTN.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react');var nt=10,Rt="ndpr_policy_draft",_t=2e3;function st(){return `section_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function it(){return `draft_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function w(u,A,M){let S=Date.now();return {id:M,title:`Privacy Policy${u.org.name?` \u2014 ${u.org.name}`:""}`,templateId:"adaptive-policy-wizard",organizationInfo:{name:u.org.name,website:u.org.website,privacyEmail:u.org.privacyEmail,address:u.org.address,dpoName:u.org.dpoName,dpoEmail:u.org.dpoEmail,industry:u.org.industry},sections:A,variableValues:{},effectiveDate:S,lastUpdated:S,version:"1.0",applicableFrameworks:["ndpa","ndpr"]}}function Ut(u={}){var K;let{onComplete:A,onComplianceChange:M}=u,S=react.useRef((K=u.adapter)!=null?K:chunkVWED6UTN_js.a(Rt));u.adapter&&(S.current=u.adapter);let f=react.useRef(it()),[P,y]=react.useState(1),[n,v]=react.useState(chunkQ64735OC_js.e),[b,O]=react.useState([]),[x,I]=react.useState({}),[E,$]=react.useState([]),[at,q]=react.useState(false),[ct,z]=react.useState(null),[N,U]=react.useState(true),T=react.useRef(false),R=react.useRef(null);react.useEffect(()=>{let t=false,e=r=>{r&&(f.current=r.id,v(r.templateContext),O(r.customSections),I(r.sectionOverrides),$(r.sectionOrder),y(r.currentStep),z(r.lastSavedAt),q(true));};try{let r=S.current.load();r instanceof Promise?r.then(i=>{t||(e(i),U(!1));},()=>{t||U(!1);}):(e(r),U(!1));}catch(r){t||U(false);}return ()=>{t=true;}},[]);let l=react.useMemo(()=>{let e=chunkQ64735OC_js.c(n).map(o=>x[o.id]?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},o),{template:x[o.id]}):o),r=b.map(o=>{var d;return {id:o.id,title:o.title,template:(d=x[o.id])!=null?d:o.content,order:o.order,required:false,included:true}}),i=[...e,...r];if(E.length>0){let o=new Map(E.map((d,p)=>[d,p]));return [...i].sort((d,p)=>{let m=o.has(d.id)?o.get(d.id):i.length,C=o.has(p.id)?o.get(p.id):i.length;return m-C})}return [...i].sort((o,d)=>{var p,m;return ((p=o.order)!=null?p:0)-((m=d.order)!=null?m:0)})},[n,b,x,E]),s=react.useMemo(()=>!n.org.name&&!n.org.privacyEmail?null:w(n,l,f.current),[n,l]),Y=react.useMemo(()=>w(chunkQ64735OC_js.e(),[],f.current),[]),V=react.useMemo(()=>chunkQ64735OC_js.f(s!=null?s:Y,n),[s,n,Y]),_=V.percentage,D=V.gaps,j=react.useRef({score:-1,gaps:[]});react.useEffect(()=>{let t=j.current;M&&(_!==t.score||D!==t.gaps)&&M(_,D),j.current={score:_,gaps:D};},[_,D,M]);let dt=react.useMemo(()=>{switch(P){case 1:return n.org.name.trim().length>0&&n.org.privacyEmail.trim().length>0;case 2:return n.dataCategories.some(t=>t.selected);case 3:return n.purposes.length>0;case 4:return true;default:return false}},[P,n]),lt=react.useCallback(t=>{let e=Math.min(Math.max(1,t),4);e<4&&(T.current=false),y(e);},[]),pt=react.useCallback(()=>{y(t=>Math.min(t+1,4));},[]),ut=react.useCallback(()=>{T.current=false,y(t=>Math.max(t-1,1));},[]),mt=react.useCallback(t=>{v(e=>chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},e),t));},[]),gt=react.useCallback(t=>{v(e=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},e),{org:chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},e.org),t)}));},[]),ft=react.useCallback(t=>{v(e=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},e),{dataCategories:e.dataCategories.map(r=>r.id===t?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},r),{selected:!r.selected}):r)}));},[]),Pt=react.useCallback(t=>{v(e=>{let r=t,i=e.purposes.includes(r);return chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},e),{purposes:i?e.purposes.filter(o=>o!==t):[...e.purposes,r]})});},[]),yt=react.useCallback(t=>{v(e=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},e),{thirdPartyProcessors:[...e.thirdPartyProcessors,t]}));},[]),Ct=react.useCallback(t=>{v(e=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},e),{thirdPartyProcessors:e.thirdPartyProcessors.filter((r,i)=>i!==t)}));},[]),St=react.useCallback(t=>{O(e=>e.length>=nt?e:[...e,chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},t),{id:st(),required:false})]);},[]),vt=react.useCallback((t,e)=>{O(r=>r.map(i=>i.id===t?chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},i),e):i));},[]),xt=react.useCallback(t=>{O(e=>e.filter(r=>r.id!==t)),$(e=>e.filter(r=>r!==t)),I(e=>{let r=chunkRFPLZDIO_js.a({},e);return delete r[t],r});},[]),ht=react.useCallback((t,e)=>{$(r=>{let i=r.length>0?r:l.map(m=>m.id),o=i.indexOf(t);if(o===-1){let m=l.map(It=>It.id),C=m.indexOf(t);if(C===-1)return r;let G=e==="up"?C-1:C+1;if(G<0||G>=m.length)return m;let k=[...m];return [k[C],k[G]]=[k[G],k[C]],k}let d=e==="up"?o-1:o+1;if(d<0||d>=i.length)return i;let p=[...i];return [p[o],p[d]]=[p[d],p[o]],p});},[l]),Dt=react.useCallback((t,e)=>{I(r=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},r),{[t]:e}));},[]),bt=react.useCallback(t=>{let e=D.find(r=>r.requirementId===t);if(e)switch(e.fixType){case "fill_field":{T.current=false;let i=["data-categories-disclosed"],o=["purpose-of-processing"];i.includes(t)?y(2):o.includes(t)?y(3):(y(1));break}case "add_section":{if(!e.suggestedContent)break;O(r=>r.length>=nt?r:[...r,{id:st(),title:e.requirement,content:e.suggestedContent,order:999,required:false}]);break}case "add_content":{if(!e.suggestedContent)break;let r="data-subject-rights";I(i=>{var d,p,m;let o=(m=(p=i[r])!=null?p:(d=l.find(C=>C.id===r))==null?void 0:d.template)!=null?m:"";return chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},i),{[r]:`${o}
|
|
2
|
+
|
|
3
|
+
${e.suggestedContent}`.trim()})});break}}},[D,l]),X=react.useCallback(t=>({id:f.current,templateContext:n,customSections:b,sectionOverrides:x,sectionOrder:E,currentStep:t,lastSavedAt:Date.now(),status:"draft"}),[n,b,x,E]),Ot=react.useCallback(()=>chunkRFPLZDIO_js.d(null,null,function*(){let t=X(P);try{yield Promise.resolve(S.current.save(t)),z(t.lastSavedAt),q(!0);}catch(e){console.warn("[ndpr-toolkit] Failed to save draft:",e);}}),[X,P]),Et=react.useCallback(()=>{Promise.resolve(S.current.remove()).catch(t=>{console.warn("[ndpr-toolkit] Failed to remove draft:",t);}),f.current=it(),T.current=false,v(chunkQ64735OC_js.e()),O([]),I({}),$([]),y(1),q(false),z(null);},[]);react.useEffect(()=>{if(!N)return R.current&&clearTimeout(R.current),R.current=setTimeout(()=>{let t=X(P);Promise.resolve(S.current.save(t)).then(()=>{z(t.lastSavedAt),q(true);}).catch(e=>{console.warn("[ndpr-toolkit] Auto-save failed:",e);});},_t),()=>{R.current&&clearTimeout(R.current);}},[n,b,x,E,P,N,X]),react.useEffect(()=>{P===4&&s&&A&&!T.current&&(T.current=true,A(s));},[P,s,A]);let Tt=react.useCallback(t=>chunkRFPLZDIO_js.d(null,null,function*(){let e=s!=null?s:w(n,l,f.current);return chunkN3MQQUQP_js.c(e,t)}),[s,n,l]),wt=react.useCallback(t=>chunkRFPLZDIO_js.d(null,null,function*(){let e=s!=null?s:w(n,l,f.current);return chunkN3MQQUQP_js.d(e,t)}),[s,n,l]),At=react.useCallback(t=>{let e=s!=null?s:w(n,l,f.current);return chunkN3MQQUQP_js.a(e,t)},[s,n,l]),Mt=react.useCallback(()=>{let t=s!=null?s:w(n,l,f.current);return chunkN3MQQUQP_js.b(t)},[s,n,l]);return {currentStep:P,goToStep:lt,nextStep:pt,prevStep:ut,canProceed:dt,context:n,updateContext:mt,updateOrg:gt,toggleDataCategory:ft,togglePurpose:Pt,addProcessor:yt,removeProcessor:Ct,policy:s,sections:l,customSections:b,addCustomSection:St,updateCustomSection:vt,removeCustomSection:xt,reorderSections:ht,editSectionContent:Dt,sectionOverrides:x,complianceScore:_,complianceResult:V,complianceGaps:D,applyFix:bt,handleExportPDF:Tt,handleExportDOCX:wt,handleExportHTML:At,handleExportMarkdown:Mt,isDraftSaved:at,lastSavedAt:ct,saveDraft:Ot,discardDraft:Et,isLoading:N}}exports.a=Ut;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
2
|
-
//# sourceMappingURL=chunk-7AVN424U.js.map
|
|
1
|
+
'use strict';var chunkWZYCBW2R_js=require('./chunk-WZYCBW2R.js'),chunkVWED6UTN_js=require('./chunk-VWED6UTN.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react');function F(v,c){return c?chunkVWED6UTN_js.a(v):{load:()=>null,save:()=>{},remove:()=>{}}}function z({initialActivities:v=[],adapter:c,storageKey:b="ndpr_lawful_basis_activities",useLocalStorage:R=true,onAdd:g,onUpdate:A,onRemove:y}={}){let p=c!=null?c:F(b,R),f=react.useRef(p);f.current=p;let[o,u]=react.useState(v),[x,l]=react.useState(true);react.useEffect(()=>{let t=false;try{let i=f.current.load();i instanceof Promise?i.then(e=>{t||(e&&u(e),l(!1));},()=>{t||l(!1);}):(i&&u(i),l(!1));}catch(i){t||l(false);}return ()=>{t=true;}},[]);let a=react.useCallback(t=>{Promise.resolve(f.current.save(t)).catch(i=>{console.warn("[ndpr-toolkit] Failed to save lawful basis activities:",i);});},[]),_=()=>"lb_"+Date.now()+"_"+Math.random().toString(36).substring(2,11),h=react.useCallback(t=>{let i=Date.now(),e=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},t),{id:_(),createdAt:i,updatedAt:i});return u(s=>{let r=[...s,e];return a(r),r}),g&&g(e),e},[g,a]),O=react.useCallback((t,i)=>{let e=null;return u(s=>{let r=s.findIndex(k=>k.id===t);if(r===-1)return s;e=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},s[r]),i),{id:s[r].id,updatedAt:Date.now()});let P=[...s];return P[r]=e,a(P),P}),e&&A&&A(e),e},[A,a]),D=react.useCallback(t=>{u(i=>{let e=i.filter(s=>s.id!==t);return a(e),e}),y&&y(t);},[y,a]),I=react.useCallback(t=>o.find(i=>i.id===t)||null,[o]),U=react.useCallback(()=>chunkWZYCBW2R_js.d(o),[o]),V=react.useCallback(t=>chunkWZYCBW2R_js.a(t),[]);return {activities:o,addActivity:h,updateActivity:O,removeActivity:D,getActivity:I,getSummary:U,validateActivity:V,isLoading:x}}exports.a=z;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
'use strict';function r(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")}
|
|
2
|
-
exports.a=r
|
|
3
|
-
//# sourceMappingURL=chunk-I54CDQGN.js.map
|
|
2
|
+
exports.a=r;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-P3PULLYP.mjs.map
|
|
1
|
+
import {a as a$1}from'./chunk-ZJYULEER.mjs';var i="ndpr_consent",c="_audit";function a(n,e){if(!n)return "consent_given";let t=n.consents,o=e.consents;return Object.values(o).every(r=>!r)||Object.keys(t).some(r=>t[r]&&o[r]===false)?"consent_withdrawn":"consent_updated"}function y(n,e,t){return {action:t!=null?t:a(e!=null?e:null,n),timestamp:n.timestamp||Date.now(),version:n.version,categories:a$1({},n.consents),method:n.method,userAgent:typeof navigator!="undefined"?navigator.userAgent:void 0}}function d(n=i){let e=`${n}${c}`;if(typeof window=="undefined")return [];try{let t=localStorage.getItem(e);if(!t)return [];let o=JSON.parse(t);return Array.isArray(o)?o:[]}catch(t){return []}}function g(n,e=i){let t=`${e}${c}`;if(typeof window!="undefined")try{let o=d(e);o.push(n),localStorage.setItem(t,JSON.stringify(o));}catch(o){}}export{y as a,d as b,g as c};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
2
|
-
//# sourceMappingURL=chunk-I4M2AA3N.js.map
|
|
1
|
+
'use strict';var chunk3YTAOT5O_js=require('./chunk-3YTAOT5O.js'),chunkVWED6UTN_js=require('./chunk-VWED6UTN.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react');function G(c,d){switch(d.type){case "LOAD":return d.payload;case "ADD_REPORT":return chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},c),{reports:[...c.reports,d.payload]});case "UPDATE_REPORT":{let f=[...c.reports];return f[d.payload.index]=d.payload.report,chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},c),{reports:f})}case "SET_ASSESSMENT":{let{existing:f,id:S,assessment:g}=d.payload,A=f?c.assessments.map(R=>R.id===S?g:R):[...c.assessments,g];return chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},c),{assessments:A})}case "SET_NOTIFICATION":{let{existing:f,id:S,notification:g}=d.payload,A=f?c.notifications.map(R=>R.id===S?g:R):[...c.notifications,g];return chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},c),{notifications:A})}case "CLEAR":return {reports:[],assessments:[],notifications:[]}}}function J(c,d){return d?chunkVWED6UTN_js.a(c):{load:()=>null,save:()=>{},remove:()=>{}}}function X({categories:c,initialReports:d=[],adapter:f,storageKey:S="ndpr_breach_data",useLocalStorage:g=true,onReport:A,onAssessment:R,onNotification:I}){let k=f!=null?f:J(S,g),E=react.useRef(k);E.current=k;let[b,y]=react.useReducer(G,{reports:d,assessments:[],notifications:[]}),[x,T]=react.useState(true),l=react.useRef(b);l.current=b;let h=react.useCallback(t=>{Promise.resolve(E.current.save(t)).catch(s=>{console.warn("[ndpr-toolkit] Failed to save breach data:",s);});},[]);react.useEffect(()=>{let t=false;try{let s=E.current.load(),i=e=>{var r,n,a;e&&y({type:"LOAD",payload:{reports:(r=e.reports)!=null?r:[],assessments:(n=e.assessments)!=null?n:[],notifications:(a=e.notifications)!=null?a:[]}}),T(!1);};s instanceof Promise?s.then(e=>{t||i(e);},()=>{t||T(!1);}):i(s);}catch(s){t||T(false);}return ()=>{t=true;}},[]);let B=react.useCallback(t=>`${t}_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,[]),_=react.useCallback(t=>{let s=chunkRFPLZDIO_js.a({id:B("breach"),reportedAt:Date.now()},t);y({type:"ADD_REPORT",payload:s});let i=l.current,e=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},i),{reports:[...i.reports,s]});return h(e),A&&A(s),s},[B,A,h]),P=react.useCallback((t,s)=>{let i=l.current,e=i.reports.findIndex(a=>a.id===t);if(e===-1)return null;let r=chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},i.reports[e]),s);y({type:"UPDATE_REPORT",payload:{index:e,report:r}});let n=[...i.reports];return n[e]=r,h(chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},i),{reports:n})),r},[h]),w=react.useCallback(t=>l.current.reports.find(s=>s.id===t)||null,[]),L=react.useCallback((t,s)=>{let i=l.current,e=i.assessments.find(u=>u.breachId===t),r,n;e?(r=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},e),s),{assessedAt:Date.now()}),n=true):(r=chunkRFPLZDIO_js.a({id:B("assessment"),breachId:t,assessedAt:Date.now()},s),n=false),y({type:"SET_ASSESSMENT",payload:{existing:n,id:e==null?void 0:e.id,assessment:r}});let a=n?i.assessments.map(u=>u.id===e.id?r:u):[...i.assessments,r];return h(chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},i),{assessments:a})),R&&R(r),r},[B,R,h]),U=react.useCallback(t=>l.current.assessments.find(s=>s.breachId===t)||null,[]),D=react.useCallback(t=>{let s=l.current.reports.find(N=>N.id===t)||null,i=l.current.assessments.find(N=>N.breachId===t)||null;if(!s)return null;let{severityLevel:e,notificationRequired:r,timeframeHours:n,justification:a}=chunk3YTAOT5O_js.a(s,i||void 0),u=s.discoveredAt+n*60*60*1e3;return {ndpcNotificationRequired:r,ndpcNotificationDeadline:u,dataSubjectNotificationRequired:e==="high"||e==="critical",justification:a}},[]),F=react.useCallback((t,s)=>{let i=l.current,e=i.notifications.find(u=>u.breachId===t),r,n;e?(r=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},e),s),{sentAt:Date.now()}),n=true):(r=chunkRFPLZDIO_js.a({id:B("notification"),breachId:t,sentAt:Date.now()},s),n=false),y({type:"SET_NOTIFICATION",payload:{existing:n,id:e==null?void 0:e.id,notification:r}});let a=n?i.notifications.map(u=>u.id===e.id?r:u):[...i.notifications,r];return h(chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},i),{notifications:a})),I&&I(r),r},[B,I,h]),M=react.useCallback(t=>l.current.notifications.find(s=>s.breachId===t)||null,[]),$=react.useCallback((t=24)=>{let s=Date.now(),i=l.current,e=[];return i.reports.forEach(r=>{if(i.notifications.some(O=>O.breachId===r.id))return;let n=i.assessments.find(O=>O.breachId===r.id)||null;if(!n)return;let a=D(r.id);if(!a||!a.ndpcNotificationRequired)return;let N=(a.ndpcNotificationDeadline-s)/(3600*1e3);N<=t&&e.push({report:r,assessment:n,requirements:a,hoursRemaining:N});}),e.sort((r,n)=>r.hoursRemaining-n.hoursRemaining)},[D]),j=react.useCallback(()=>{y({type:"CLEAR"}),Promise.resolve(E.current.remove()).catch(t=>{console.warn("[ndpr-toolkit] Failed to remove breach data:",t);});},[]);return {reports:b.reports,assessments:b.assessments,notifications:b.notifications,reportBreach:_,updateReport:P,getReport:w,assessRisk:L,getAssessment:U,calculateNotificationRequirements:D,sendNotification:F,getNotification:M,getBreachesRequiringNotification:$,clearBreachData:j,isLoading:x}}exports.a=X;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
'use strict';function n(e){return {load(){if(typeof window=="undefined")return null;try{let t=localStorage.getItem(e);return t?JSON.parse(t):null}catch(t){return null}},save(t){if(typeof window!="undefined")try{localStorage.setItem(e,JSON.stringify(t));}catch(r){}},remove(){if(typeof window!="undefined")try{localStorage.removeItem(e);}catch(t){}}}}exports.a=n
|
|
2
|
-
//# sourceMappingURL=chunk-ELKB2AFZ.js.map
|
|
1
|
+
'use strict';function n(e){return {load(){if(typeof window=="undefined")return null;try{let t=localStorage.getItem(e);return t?JSON.parse(t):null}catch(t){return null}},save(t){if(typeof window!="undefined")try{localStorage.setItem(e,JSON.stringify(t));}catch(r){}},remove(){if(typeof window!="undefined")try{localStorage.removeItem(e);}catch(t){}}}}exports.a=n;
|