@tantainnovative/ndpr-toolkit 3.2.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -1
- package/dist/{DPIAQuestionnaire-BkejviPj.d.mts → DPIAQuestionnaire-VXBoWFMC.d.ts} +3 -3
- package/dist/{DPIAQuestionnaire-DdSqXG3x.d.ts → DPIAQuestionnaire-jkt1Veb6.d.mts} +3 -3
- package/dist/{DSRRequestForm-BY8PogCU.d.mts → DSRRequestForm-D8rPTNmU.d.ts} +2 -2
- package/dist/{DSRRequestForm-CHUg9cZh.d.ts → DSRRequestForm-DRouEr9j.d.mts} +2 -2
- package/dist/{DSRTracker-Dr_aT0pg.d.ts → DSRTracker-Bl__d4df.d.ts} +1 -1
- package/dist/{DSRTracker-C6u_jAaK.d.mts → DSRTracker-CSVDfgQQ.d.mts} +1 -1
- package/dist/{StepIndicator-D9ZATz_O.d.ts → StepIndicator-CgrlokSV.d.ts} +1 -1
- package/dist/{StepIndicator-D-nwRTyo.d.mts → StepIndicator-W8S_QjgO.d.mts} +1 -1
- package/dist/adapters.js +1 -1
- package/dist/adapters.mjs +1 -1
- package/dist/breach.js +1 -1
- package/dist/breach.mjs +1 -1
- package/dist/chunk-256APOQM.js +2 -0
- package/dist/chunk-25OOUES4.js +2 -0
- package/dist/chunk-4JKTIR33.mjs +2 -0
- package/dist/chunk-5BUS6AI7.js +2 -0
- package/dist/chunk-5X32J5IA.mjs +2 -0
- package/dist/chunk-6BXUVS6E.js +81 -0
- package/dist/chunk-6JCRDJQI.mjs +2 -0
- package/dist/{chunk-KHRBU5K7.js → chunk-6RQGQZT2.js} +2 -2
- package/dist/chunk-6TA2MVTU.mjs +2 -0
- package/dist/chunk-6WIP33TW.mjs +2 -0
- package/dist/chunk-6YN73KR7.mjs +2 -0
- package/dist/chunk-75TJPK2N.mjs +2 -0
- package/dist/{chunk-2ORDHJRD.js → chunk-7AVN424U.js} +2 -2
- package/dist/chunk-7D2OIPHH.mjs +2 -0
- package/dist/{chunk-5VMHKNJY.js → chunk-7SMLHZ4B.js} +2 -2
- package/dist/chunk-A4PK7JB2.js +2 -0
- package/dist/chunk-ABDB7LEV.mjs +2 -0
- package/dist/chunk-BKRETVJ6.js +2 -0
- package/dist/chunk-C4YM4UMI.js +2 -0
- package/dist/chunk-CDZDT2OS.mjs +320 -0
- package/dist/chunk-CSIJCLGZ.mjs +2 -0
- package/dist/chunk-CWUPGY3M.mjs +3 -0
- package/dist/chunk-DJGS7SSN.mjs +2 -0
- package/dist/{chunk-SVCRYM4I.mjs → chunk-E4NCJ7RD.mjs} +2 -2
- package/dist/chunk-E63VPR7U.js +2 -0
- package/dist/chunk-ELKB2AFZ.js +2 -0
- package/dist/chunk-FDDI426Y.mjs +2 -0
- package/dist/chunk-GKKAK6ES.mjs +3 -0
- package/dist/chunk-GMLCWGNJ.js +7 -0
- package/dist/{chunk-SWF3YVE5.js → chunk-GOU6FU6Y.js} +3 -3
- package/dist/chunk-GQVNLUP2.js +94 -0
- package/dist/chunk-GXLSOZCH.mjs +2 -0
- package/dist/chunk-HO5M7M4M.js +2 -0
- package/dist/chunk-I4M2AA3N.js +2 -0
- package/dist/chunk-I54CDQGN.js +3 -0
- package/dist/chunk-IQJO7WIH.js +7 -0
- package/dist/chunk-JKKRPS4P.js +2 -0
- package/dist/chunk-LETEUS5X.mjs +2 -0
- package/dist/{chunk-P7BSBCB3.js → chunk-M6XETYNL.js} +2 -2
- package/dist/chunk-NBSVFQ5G.js +2 -0
- package/dist/chunk-NUDVUAD4.mjs +81 -0
- package/dist/chunk-NUULHXVL.mjs +7 -0
- package/dist/chunk-P42Z5CFE.js +2 -0
- package/dist/chunk-PATONNTZ.mjs +2 -0
- package/dist/{chunk-WLSW4Z4W.mjs → chunk-PM7O5IGE.mjs} +2 -2
- package/dist/chunk-Q7VHB64E.mjs +2 -0
- package/dist/chunk-QDHHD2KR.mjs +94 -0
- package/dist/chunk-R3OYAJI6.mjs +2 -0
- package/dist/chunk-S4GRSNB4.js +2 -0
- package/dist/chunk-SAA7UVI2.js +3 -0
- package/dist/{chunk-PYEX7DFR.mjs → chunk-SHMJNRHO.mjs} +3 -3
- package/dist/chunk-TI2M7H6R.mjs +7 -0
- package/dist/chunk-TKVJ3OOV.mjs +2 -0
- package/dist/chunk-TXXWCB5O.js +320 -0
- package/dist/chunk-U62QYKVG.mjs +2 -0
- package/dist/{chunk-44W4H2EY.js → chunk-UGY5ZYUG.js} +2 -2
- package/dist/chunk-UO6QPJLH.js +2 -0
- package/dist/chunk-UX6ZZNEM.mjs +3 -0
- package/dist/{chunk-5RSOLEEP.js → chunk-UXMGBIX6.js} +4 -4
- package/dist/chunk-VLSGE2YA.js +2 -0
- package/dist/{chunk-G26I6MP5.mjs → chunk-VWPGIES4.mjs} +2 -2
- package/dist/chunk-XFUEZ3MP.mjs +2 -0
- package/dist/chunk-XHSHPB74.js +2 -0
- package/dist/chunk-YCX6BFOQ.js +2 -0
- package/dist/chunk-YURSF2YO.mjs +2 -0
- package/dist/chunk-YZXUAIYN.js +3 -0
- package/dist/{chunk-CAB7O3GR.mjs → chunk-ZEOQYWOE.mjs} +4 -4
- package/dist/chunk-ZGJA7OO4.js +2 -0
- package/dist/chunk-ZT7KNFAU.mjs +2 -0
- package/dist/chunk-ZYLDLGFL.js +2 -0
- package/dist/consent.js +1 -1
- package/dist/consent.mjs +1 -1
- package/dist/core.d.mts +21 -9
- package/dist/core.d.ts +21 -9
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/cross-border.d.mts +68 -1
- package/dist/cross-border.d.ts +68 -1
- package/dist/cross-border.js +1 -1
- package/dist/cross-border.mjs +1 -1
- package/dist/{dpia-B0Pok5us.d.ts → dpia-D82hUrJe.d.ts} +1 -1
- package/dist/{dpia-CUfOmzvX.d.mts → dpia-DQDFw2_l.d.mts} +1 -1
- package/dist/{dpia-5OQVA1R_.d.mts → dpia-c9GiiOq0.d.mts} +2 -2
- package/dist/{dpia-5OQVA1R_.d.ts → dpia-c9GiiOq0.d.ts} +2 -2
- package/dist/dpia.d.mts +9 -9
- package/dist/dpia.d.ts +9 -9
- package/dist/dpia.js +1 -1
- package/dist/dpia.mjs +1 -1
- package/dist/{dsr-D_eTNc4S.d.mts → dsr-CIx5sd7e.d.ts} +2 -2
- package/dist/{dsr-pNtVb1BK.d.ts → dsr-XZ_HqTlA.d.mts} +2 -2
- package/dist/{dsr-Cm9lzWG7.d.mts → dsr-yKbqX531.d.mts} +1 -1
- package/dist/{dsr-Cm9lzWG7.d.ts → dsr-yKbqX531.d.ts} +1 -1
- package/dist/dsr.d.mts +9 -9
- package/dist/dsr.d.ts +9 -9
- package/dist/dsr.js +1 -1
- package/dist/dsr.mjs +1 -1
- package/dist/hooks.d.mts +6 -6
- package/dist/hooks.d.ts +6 -6
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/index.d.mts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lawful-basis.js +1 -1
- package/dist/lawful-basis.mjs +1 -1
- package/dist/{policy-engine-DSQpT55_.d.ts → policy-engine-C6nC2t3a.d.ts} +1 -1
- package/dist/{policy-engine-C-tShzZH.d.mts → policy-engine-DefZcX3R.d.mts} +1 -1
- package/dist/{policy-sections-CfNVBLCh.d.mts → policy-sections-Bylm31kZ.d.mts} +1 -1
- package/dist/{policy-sections-DqH0iZRf.d.ts → policy-sections-DFDPVCCg.d.ts} +1 -1
- package/dist/policy.d.mts +4 -4
- package/dist/policy.d.ts +4 -4
- package/dist/policy.js +1 -1
- package/dist/policy.mjs +1 -1
- package/dist/presets.d.mts +5 -5
- package/dist/presets.d.ts +5 -5
- package/dist/presets.js +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/ropa.js +1 -1
- package/dist/ropa.mjs +1 -1
- package/dist/{sanitize-9mOO_cJW.d.mts → sanitize-B0AzEm1D.d.mts} +14 -1
- package/dist/{sanitize-9mOO_cJW.d.ts → sanitize-B0AzEm1D.d.ts} +14 -1
- package/dist/{useAdaptivePolicyWizard-N4eUM4Tj.d.mts → useAdaptivePolicyWizard-A1PyOy6P.d.mts} +1 -1
- package/dist/{useAdaptivePolicyWizard-B9Op2gYM.d.ts → useAdaptivePolicyWizard-LVIKhAxw.d.ts} +1 -1
- package/dist/{useDPIA-DzWye8JB.d.mts → useDPIA-B6180UQn.d.mts} +9 -5
- package/dist/{useDPIA-Dl16Te3r.d.ts → useDPIA-CTqbNbww.d.ts} +9 -5
- package/dist/{useDSR-C1LksCfP.d.mts → useDSR-WvHk8_iu.d.mts} +2 -2
- package/dist/{useDSR-DZel52O1.d.ts → useDSR-wH4H6hSM.d.ts} +2 -2
- package/package.json +3 -2
- package/dist/chunk-27NYSWUG.mjs +0 -2
- package/dist/chunk-2SYNHRP6.mjs +0 -2
- package/dist/chunk-2W7ARAW2.js +0 -2
- package/dist/chunk-3F34NACG.js +0 -2
- package/dist/chunk-3UWT64FI.mjs +0 -2
- package/dist/chunk-3V23O4ZJ.js +0 -2
- package/dist/chunk-3XAUN5IM.mjs +0 -3
- package/dist/chunk-4JUDKBA2.mjs +0 -7
- package/dist/chunk-4VVARDN2.mjs +0 -2
- package/dist/chunk-6D3ZUGBB.mjs +0 -2
- package/dist/chunk-6E54NSAO.mjs +0 -2
- package/dist/chunk-7F5F5YWI.mjs +0 -2
- package/dist/chunk-BGHQTZAC.js +0 -94
- package/dist/chunk-CL53OI3I.js +0 -7
- package/dist/chunk-CMZTI7SG.js +0 -2
- package/dist/chunk-DQLDX5X6.js +0 -316
- package/dist/chunk-ELKEZEV5.mjs +0 -2
- package/dist/chunk-EPF7J2FK.js +0 -3
- package/dist/chunk-ER7X6E36.js +0 -2
- package/dist/chunk-FR7ZYZXB.js +0 -2
- package/dist/chunk-FXTZDKDC.mjs +0 -3
- package/dist/chunk-FY5G6DGZ.js +0 -7
- package/dist/chunk-GIV2OHE6.mjs +0 -2
- package/dist/chunk-GPJVTGHR.mjs +0 -2
- package/dist/chunk-GVANK6PL.js +0 -3
- package/dist/chunk-HNZK7LY3.mjs +0 -2
- package/dist/chunk-IKEPXHCZ.js +0 -2
- package/dist/chunk-IQF726GS.js +0 -2
- package/dist/chunk-IQQW52EF.js +0 -2
- package/dist/chunk-ISSGO2YT.mjs +0 -72
- package/dist/chunk-JZKH5RMC.js +0 -3
- package/dist/chunk-LFNA6WYQ.mjs +0 -2
- package/dist/chunk-NPI5T6NH.mjs +0 -7
- package/dist/chunk-NPLXE43Q.mjs +0 -2
- package/dist/chunk-PEH5GIMN.js +0 -2
- package/dist/chunk-PGSA2O5P.mjs +0 -2
- package/dist/chunk-QKK5S54L.mjs +0 -2
- package/dist/chunk-RGYK4VAY.mjs +0 -2
- package/dist/chunk-RSUDIFZV.mjs +0 -2
- package/dist/chunk-RYZEIDNR.js +0 -2
- package/dist/chunk-SBNAMPAP.mjs +0 -2
- package/dist/chunk-SKJCQKFL.mjs +0 -94
- package/dist/chunk-SSGJREE3.js +0 -2
- package/dist/chunk-TKBZRULW.mjs +0 -316
- package/dist/chunk-TVW6KBVV.mjs +0 -2
- package/dist/chunk-U6VWHC46.js +0 -72
- package/dist/chunk-UK656RCG.js +0 -2
- package/dist/chunk-UNKXYVXY.js +0 -2
- package/dist/chunk-UOSEH6DC.js +0 -2
- package/dist/chunk-UZ5EZOA7.js +0 -2
- package/dist/chunk-V37BM2LF.js +0 -2
- package/dist/chunk-V3MXWGXU.mjs +0 -2
- package/dist/chunk-VDZKGCAF.js +0 -2
- package/dist/chunk-XSK4BSZJ.mjs +0 -2
- package/dist/chunk-Y34DQYS7.js +0 -2
- package/dist/chunk-YJCGEOLO.mjs +0 -2
- package/dist/chunk-ZCZ5RRZO.js +0 -2
- package/dist/chunk-ZQSX5ZHB.mjs +0 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
'use strict';var chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js');function
|
|
1
|
+
'use strict';var chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js');function m(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function w(t,u){if(typeof t=="string"){let a=t,o=u,r=a,n=/\{\{([^}]+)\}\}/g,c;for(;(c=n.exec(a))!==null;){let e=c[1].trim(),i=o[e]||"";r=r.replace(new RegExp(`\\{\\{\\s*${m(e)}\\s*\\}\\}`,"g"),i);}return r}else {let a=t,o=u,r={},n=[];return a.filter(e=>e.included).sort((e,i)=>(e.order||0)-(i.order||0)).forEach(e=>{let i=e.template||e.customContent||e.defaultContent||"",h=/\{\{([^}]+)\}\}/g,p,g=[];for(;(p=h.exec(i))!==null;)g.push(p[1].trim());g.forEach(s=>{let l="";s in o&&(l=o[s]||""),l||n.push(s),i=i.replace(new RegExp(`\\{\\{\\s*${m(s)}\\s*\\}\\}`,"g"),l);}),r[e.id]=i;}),{fullText:Object.values(r).join(`
|
|
2
2
|
|
|
3
|
-
`),sectionTexts:r,missingVariables:Array.from(new Set(n))}}}var
|
|
3
|
+
`),sectionTexts:r,missingVariables:Array.from(new Set(n))}}}var y=[{id:"data-collection",title:"Data Collection",description:"Describes what personal data is collected and how it is obtained.",order:1,required:true,included:true,template:'{{orgName}} ("we", "us", or "our") collects personal data from users of our services at {{website}}. We collect information you provide directly, such as your name, email address, phone number, and any other details you submit through forms or communications. We may also collect data automatically, including IP addresses, browser type, device information, and usage patterns through cookies and similar technologies. All data collection is conducted in accordance with the Nigeria Data Protection Act (NDPA) 2023.',variables:["orgName","website"]},{id:"legal-basis",title:"Legal Basis for Processing",description:"Specifies the lawful basis for processing personal data under the NDPA.",order:2,required:true,included:true,template:`{{orgName}} processes personal data under one or more of the following lawful bases as prescribed by the NDPA 2023:
|
|
4
4
|
|
|
5
5
|
- Consent: where you have given clear, informed, and voluntary consent for a specific purpose.
|
|
6
6
|
- Contract: where processing is necessary to fulfil a contract with you or to take steps at your request before entering a contract.
|
|
@@ -59,5 +59,5 @@ DPO Email: {{dpoEmail}}
|
|
|
59
59
|
|
|
60
60
|
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 violated.
|
|
61
61
|
|
|
62
|
-
This policy is effective as of {{effectiveDate}} and applies to all {{industry}} services provided by {{orgName}}.`,variables:["orgName","address","privacyEmail","website","dpoName","dpoEmail","effectiveDate","industry"]}],
|
|
63
|
-
//# sourceMappingURL=chunk-
|
|
62
|
+
This policy is effective as of {{effectiveDate}} and applies to all {{industry}} services provided by {{orgName}}.`,variables:["orgName","address","privacyEmail","website","dpoName","dpoEmail","effectiveDate","industry"]}],f=[{id:"orgName",name:"orgName",description:"The official name of your organisation.",value:"",inputType:"text",required:true},{id:"website",name:"website",description:"Your organisation's website URL.",value:"",inputType:"url",required:true},{id:"privacyEmail",name:"privacyEmail",description:"Email address for privacy-related enquiries.",value:"",inputType:"email",required:true},{id:"dpoName",name:"dpoName",description:"Full name of your Data Protection Officer.",value:"",inputType:"text",required:false},{id:"dpoEmail",name:"dpoEmail",description:"Email address of your Data Protection Officer.",value:"",inputType:"email",required:false},{id:"address",name:"address",description:"Physical address of your organisation.",value:"",inputType:"textarea",required:false},{id:"industry",name:"industry",description:"The industry or sector your organisation operates in.",value:"",inputType:"text",required:false},{id:"effectiveDate",name:"effectiveDate",description:"The date this privacy policy becomes effective.",value:"",inputType:"date",required:false}];function b(){return {sections:y.map(t=>chunkMQFZHA2D_js.a({},t)),variables:f.map(t=>chunkMQFZHA2D_js.a({},t))}}exports.a=w;exports.b=y;exports.c=f;exports.d=b;//# sourceMappingURL=chunk-UXMGBIX6.js.map
|
|
63
|
+
//# sourceMappingURL=chunk-UXMGBIX6.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkJKKRPS4P_js=require('./chunk-JKKRPS4P.js'),chunkELKB2AFZ_js=require('./chunk-ELKB2AFZ.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function M(D,o){return o?chunkELKB2AFZ_js.a(D):{load:()=>null,save:()=>{},remove:()=>{}}}function Q({initialRequests:D=[],requestTypes:o,adapter:p,storageKey:O="ndpr_dsr_requests",useLocalStorage:P=true,onSubmit:m,onUpdate:f}){let y=p!=null?p:M(O,P),q=react.useRef(y);q.current=y;let[r,R]=react.useState(D),[x,l]=react.useState(true);react.useEffect(()=>{let e=false;try{let t=q.current.load();t instanceof Promise?t.then(s=>{e||(s&&R(s),l(!1));},()=>{e||l(!1);}):(t&&R(t),l(!1));}catch(t){e||l(false);}return ()=>{e=true;}},[]);let c=react.useCallback(e=>{Promise.resolve(q.current.save(e)).catch(t=>{console.warn("[ndpr-toolkit] Failed to save DSR requests:",t);});},[]),B=()=>"dsr_"+Date.now()+"_"+Math.random().toString(36).substr(2,9),I=react.useCallback(e=>{let t=o.find(g=>g.id===e.type),s=(t==null?void 0:t.estimatedCompletionTime)||30,u=Date.now(),a=u+s*24*60*60*1e3,b=e,{createdAt:A}=b,i=chunkMQFZHA2D_js.c(b,["createdAt"]),d=chunkMQFZHA2D_js.a({id:B(),status:"pending",createdAt:u,updatedAt:u,dueDate:a},i);return R(g=>{let v=[...g,d];return c(v),v}),m&&m(d),d},[o,c,m]),L=react.useCallback((e,t)=>{let s=null;return R(u=>{let a=u.findIndex(d=>d.id===e);if(a===-1)return u;let A=u[a];s=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},A),t),{updatedAt:Date.now()});let i=[...u];return i[a]=s,c(i),i}),s&&f&&f(s),s},[c,f]),_=react.useCallback(e=>r.find(t=>t.id===e)||null,[r]),U=react.useCallback(e=>r.filter(t=>t.status===e),[r]),F=react.useCallback(e=>r.filter(t=>t.type===e),[r]);return {requests:r,submitRequest:I,updateRequest:L,getRequest:_,getRequestsByStatus:U,getRequestsByType:F,getRequestType:e=>o.find(t=>t.id===e),formatRequest:e=>{let{formattedRequest:t}=chunkJKKRPS4P_js.a(e);return t},clearRequests:()=>{R([]),Promise.resolve(q.current.remove()).catch(e=>{console.warn("[ndpr-toolkit] Failed to remove DSR requests:",e);});},isLoading:x}}exports.a=Q;//# sourceMappingURL=chunk-VLSGE2YA.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-VLSGE2YA.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {a as a$2,b}from'./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import {a as a$2,b}from'./chunk-R3OYAJI6.mjs';import {a}from'./chunk-U62QYKVG.mjs';import {a as a$1}from'./chunk-6WIP33TW.mjs';import {useRef,useState,useEffect,useCallback}from'react';function F(n){if(!n)return a$1("ndpr_consent");let{storageKey:o="ndpr_consent",storageType:i="localStorage"}=n;return i==="sessionStorage"?a$2(o):i==="cookie"?b(o,n.cookieOptions):a$1(o)}function k(n,o,i,r,a$1,g,l){if(n){i(n);let{valid:s,errors:c}=a(n);r(s),a$1(c),g(!(s&&n.version===o));}else g(true);l(false);}function z({options:n,adapter:o,storageOptions:i,version:r="1.0",onChange:a$1}){let g=o!=null?o:F(i),l=useRef(g);l.current=g;let[s,c]=useState(null),[y,d]=useState(false),[E,C]=useState(false),[w,S]=useState([]),[I,v]=useState(true);useEffect(()=>{let e=false;try{let t=l.current.load();t instanceof Promise?t.then(m=>{e||k(m,r,c,C,S,d,v);},()=>{e||(d(!0),v(!1));}):k(t,r,c,C,S,d,v);}catch(t){e||(d(true),v(false));}return ()=>{e=true;}},[r]);let h=useCallback(e=>{let{valid:t,errors:m}=a(e);C(t),S(m),a$1==null||a$1(e),Promise.resolve(l.current.save(e)).catch(P=>{console.warn("[ndpr-toolkit] Failed to save consent:",P);});},[a$1]),f=useCallback(e=>{let t={consents:e,timestamp:Date.now(),version:r,method:"explicit",hasInteracted:true};c(t),h(t),d(false);},[r,h]),L=useCallback(()=>{let e={};n.forEach(t=>{e[t.id]=true;}),f(e);},[n,f]),U=useCallback(()=>{let e={};n.forEach(t=>{e[t.id]=t.required||false;}),f(e);},[n,f]),V=useCallback(e=>!!(s!=null&&s.consents[e]),[s]),j=useCallback(()=>{c(null),d(true),C(false),S([]),Promise.resolve(l.current.remove()).catch(e=>{console.warn("[ndpr-toolkit] Failed to remove consent:",e);});},[]);return {settings:s,hasConsent:V,updateConsent:f,acceptAll:L,rejectAll:U,shouldShowBanner:y,isValid:E,validationErrors:w,resetConsent:j,isLoading:I}}export{z as a};//# sourceMappingURL=chunk-VWPGIES4.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-VWPGIES4.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a}from'./chunk-AYKLAEOU.mjs';import {jsxs,jsx}from'react/jsx-runtime';var x={consent:"Consent",dsr:"Data Subject Rights",dpia:"DPIA",breach:"Breach Notification",policy:"Privacy Policy",lawfulBasis:"Lawful Basis",crossBorder:"Cross-Border",ropa:"ROPA"},p={critical:"rgb(var(--ndpr-destructive))","needs-work":"rgb(var(--ndpr-warning))",good:"rgb(var(--ndpr-primary))",excellent:"rgb(var(--ndpr-success))"},m={critical:"Critical","needs-work":"Needs Work",good:"Good",excellent:"Excellent"},f={critical:"Critical",high:"High",medium:"Medium",low:"Low"},C=({score:t,rating:o,classNames:e,unstyled:a$1})=>{let r=p[o],i=2*Math.PI*40,c=i*(1-t/100);return jsxs("div",{className:a("relative inline-flex items-center justify-center",e==null?void 0:e.scoreCircle,a$1),role:"img","aria-label":`Compliance score: ${t} out of 100, rated ${m[o]}`,children:[jsxs("svg",{width:"120",height:"120",viewBox:"0 0 100 100","aria-hidden":"true",children:[jsx("circle",{cx:"50",cy:"50",r:"40",fill:"none",stroke:"rgba(0,0,0,0.08)",strokeWidth:"8"}),jsx("circle",{cx:"50",cy:"50",r:"40",fill:"none",stroke:r,strokeWidth:"8",strokeLinecap:"round",strokeDasharray:i,strokeDashoffset:c,transform:"rotate(-90 50 50)",style:{transition:"stroke-dashoffset 0.4s ease"}})]}),jsx("span",{className:a("absolute text-2xl font-bold tabular-nums",e==null?void 0:e.scoreValue,a$1),style:{color:r},children:t})]})},y=({rating:t,className:o,unstyled:e})=>{let a$1=p[t];return jsx("span",{className:a("inline-block px-3 py-1 rounded-full text-sm font-semibold",o,e),style:{backgroundColor:`${a$1.replace("rgb(","rgba(").replace(")",", 0.12)")}`,color:a$1,border:`1px solid ${a$1.replace("rgb(","rgba(").replace(")",", 0.3)")}`},role:"status","aria-live":"polite",children:m[t]})},h=({moduleKey:t,module:o,classNames:e,unstyled:a$1})=>{var b;let r=o.score>=90?"excellent":o.score>=70?"good":o.score>=40?"needs-work":"critical",i=p[r];Math.round(o.score/100*(o.gaps.length+Math.round(o.score/100*5)));let u=o.gaps.length,g=(b=x[t])!=null?b:t;return jsxs("div",{className:a("rounded-lg border p-4 flex flex-col gap-2",e==null?void 0:e.moduleCard,a$1),style:{borderColor:`${i.replace("rgb(","rgba(").replace(")",", 0.25)")}`,backgroundColor:`${i.replace("rgb(","rgba(").replace(")",", 0.04)")}`},children:[jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{className:a("text-sm font-semibold truncate",e==null?void 0:e.moduleTitle,a$1),children:g}),jsx("span",{className:a("text-lg font-bold tabular-nums",e==null?void 0:e.moduleScore,a$1),style:{color:i},role:"status","aria-label":`${g} score: ${o.score}`,children:o.score})]}),jsx("div",{className:"h-1.5 rounded-full overflow-hidden",style:{backgroundColor:"rgba(0,0,0,0.08)"},role:"progressbar","aria-valuenow":o.score,"aria-valuemin":0,"aria-valuemax":100,"aria-label":`${g} compliance score: ${o.score}%`,children:jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${o.score}%`,backgroundColor:i}})}),u>0&&jsxs("p",{className:a("text-xs text-gray-500 dark:text-gray-400",e==null?void 0:e.moduleGaps,a$1),children:[u," gap",u!==1?"s":""," to address"]})]})},R=({rec:t,classNames:o,unstyled:e})=>{var i,c;let r=(i={critical:p.critical,high:p["needs-work"],medium:p.good,low:p.excellent}[t.priority])!=null?i:p.good;return jsxs("div",{"data-testid":"recommendation-item",className:a("flex gap-3 p-3 rounded-lg border border-gray-100 dark:border-gray-700 bg-white dark:bg-gray-800",o==null?void 0:o.recommendationItem,e),children:[jsx("span",{className:a("mt-0.5 shrink-0 inline-block px-2 py-0.5 rounded text-xs font-bold uppercase tracking-wide",o==null?void 0:o.recommendationPriority,e),style:{backgroundColor:`${r.replace("rgb(","rgba(").replace(")",", 0.12)")}`,color:r},children:(c=f[t.priority])!=null?c:t.priority}),jsxs("div",{className:"min-w-0 flex-1",children:[jsx("p",{className:a("text-sm font-medium text-gray-900 dark:text-gray-100",o==null?void 0:o.recommendationTitle,e),children:t.label}),jsx("p",{className:"mt-0.5 text-xs text-gray-500 dark:text-gray-400 leading-relaxed",children:t.recommendation}),jsxs("p",{className:"mt-1 text-xs text-gray-400 dark:text-gray-500",children:[t.ndpaSection," \u2022 Effort: ",t.effort]})]})]})},k=({report:t,title:o="NDPA Compliance Dashboard",showRecommendations:e=true,maxRecommendations:a$1=5,classNames:r,unstyled:i=false})=>{let c=t.recommendations.slice(0,a$1),u=Object.entries(t.modules);return jsxs("div",{"data-ndpr-component":"compliance-dashboard",className:a("w-full rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-900 shadow-sm p-6 flex flex-col gap-8",r==null?void 0:r.root,i),children:[jsxs("div",{className:a("flex flex-col sm:flex-row items-start sm:items-center gap-6",r==null?void 0:r.header,i),children:[jsx(C,{score:t.score,rating:t.rating,classNames:{scoreCircle:r==null?void 0:r.scoreCircle,scoreValue:r==null?void 0:r.scoreValue},unstyled:i}),jsxs("div",{className:"flex flex-col gap-2",children:[jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-gray-100 leading-tight",children:o}),jsx(y,{rating:t.rating,className:r==null?void 0:r.ratingBadge,unstyled:i}),jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Generated on"," ",new Date(t.generatedAt).toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"})]})]})]}),jsx("div",{className:a("grid grid-cols-2 sm:grid-cols-2 md:grid-cols-4 gap-3",r==null?void 0:r.modulesGrid,i),children:u.map(([g,b])=>jsx(h,{moduleKey:g,module:b,classNames:{moduleCard:r==null?void 0:r.moduleCard,moduleTitle:r==null?void 0:r.moduleTitle,moduleScore:r==null?void 0:r.moduleScore,moduleGaps:r==null?void 0:r.moduleGaps},unstyled:i},g))}),e&&c.length>0&&jsxs("div",{className:a("flex flex-col gap-3",r==null?void 0:r.recommendationsSection,i),children:[jsx("h3",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:"Recommendations"}),c.map(g=>jsx(R,{rec:g,classNames:{recommendationItem:r==null?void 0:r.recommendationItem,recommendationPriority:r==null?void 0:r.recommendationPriority,recommendationTitle:r==null?void 0:r.recommendationTitle},unstyled:i},`${g.module}-${g.key}`))]})]})};export{k as a};//# sourceMappingURL=chunk-XFUEZ3MP.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-XFUEZ3MP.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),jsxRuntime=require('react/jsx-runtime');var F=({sections:b,answers:x,onAnswerChange:u,currentSectionIndex:g,onNextSection:$,onPrevSection:B,validationErrors:P={},readOnly:n=false,className:A="",buttonClassName:f="",nextButtonText:I="Next",prevButtonText:Q="Previous",submitButtonText:C="Submit",showProgress:D=true,progress:o,classNames:m={},unstyled:S=false})=>{let v=b[g],L=g===b.length-1,i=(e,r)=>{let d=r?m[r]:void 0;return !d&&r==="nextButton"&&(d=m.primaryButton),!d&&r==="prevButton"&&(d=m.secondaryButton),chunkE64TU6IU_js.a(e,d,S)},T=e=>e.showWhen?e.showWhen.every(r=>{let d=x[r.questionId];switch(r.operator){case "equals":return d===r.value;case "contains":return Array.isArray(d)?d.includes(String(r.value)):false;case "greaterThan":return typeof d=="number"&&typeof r.value=="number"?d>r.value:false;case "lessThan":return typeof d=="number"&&typeof r.value=="number"?d<r.value:false;default:return true}}):true,y=e=>i(`w-full px-3 py-2 border rounded-md ${e?"border-red-500":"border-gray-300 dark:border-gray-600"} focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100`,"input"),V=e=>{if(!T(e))return null;let r=P[e.id],d=x[e.id],s=typeof d=="boolean"?String(d):d,h=e.guidance?`${e.id}-guidance`:void 0,k=r?`${e.id}-error`:void 0,c=[h,k].filter(Boolean).join(" ")||void 0;return jsxRuntime.jsxs("div",{className:i("mb-6","question"),children:[jsxRuntime.jsxs("div",{className:"mb-2",children:[jsxRuntime.jsxs("label",{htmlFor:e.id,className:i("block text-sm font-medium text-gray-900 dark:text-gray-100","questionText"),children:[e.text,e.required&&jsxRuntime.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),e.guidance&&jsxRuntime.jsx("p",{id:h,className:i("mt-1 text-sm text-gray-600 dark:text-gray-400","guidance"),children:e.guidance})]}),e.type==="text"&&jsxRuntime.jsx("input",{type:"text",id:e.id,value:s||"",onChange:a=>u(e.id,a.target.value),disabled:n,className:y(r),"aria-required":e.required||void 0,"aria-describedby":c,"aria-invalid":r?true:void 0}),e.type==="textarea"&&jsxRuntime.jsx("textarea",{id:e.id,value:s||"",onChange:a=>u(e.id,a.target.value),disabled:n,rows:4,className:y(r),"aria-required":e.required||void 0,"aria-describedby":c,"aria-invalid":r?true:void 0}),e.type==="select"&&e.options&&jsxRuntime.jsxs("select",{id:e.id,value:s||"",onChange:a=>u(e.id,a.target.value),disabled:n,className:y(r),"aria-required":e.required||void 0,"aria-describedby":c,"aria-invalid":r?true:void 0,children:[jsxRuntime.jsx("option",{value:"",children:"Select an option"}),e.options.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))]}),e.type==="radio"&&e.options&&jsxRuntime.jsx("div",{className:i("space-y-2","radioGroup"),role:"radiogroup","aria-required":e.required||void 0,"aria-describedby":c,"aria-invalid":r?true:void 0,children:e.options.map(a=>jsxRuntime.jsxs("div",{className:i("flex items-center","radioOption"),children:[jsxRuntime.jsx("input",{type:"radio",id:`${e.id}_${a.value}`,name:e.id,value:a.value,checked:s===a.value,onChange:()=>u(e.id,a.value),disabled:n,className:"h-4 w-4 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))] border-gray-300 dark:border-gray-600"}),jsxRuntime.jsxs("label",{htmlFor:`${e.id}_${a.value}`,className:"ml-2 block text-sm text-gray-900 dark:text-gray-100",children:[a.label,a.riskLevel&&jsxRuntime.jsxs("span",{className:`ml-2 text-xs px-2 py-1 rounded ${a.riskLevel==="low"?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":a.riskLevel==="medium"?"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200":"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}`,children:[a.riskLevel.charAt(0).toUpperCase()+a.riskLevel.slice(1)," Risk"]})]})]},a.value))}),e.type==="checkbox"&&e.options&&jsxRuntime.jsx("div",{className:"space-y-2",role:"group","aria-label":e.text,"aria-describedby":c,"aria-invalid":r?true:void 0,children:e.options.map(a=>jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"checkbox",id:`${e.id}_${a.value}`,value:a.value,checked:Array.isArray(s)?s.includes(a.value):false,onChange:p=>{let N=Array.isArray(s)?[...s]:[];p.target.checked?u(e.id,[...N,a.value]):u(e.id,N.filter(j=>j!==a.value));},disabled:n,className:"h-4 w-4 rounded text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))] border-gray-300 dark:border-gray-600"}),jsxRuntime.jsx("label",{htmlFor:`${e.id}_${a.value}`,className:"ml-2 block text-sm text-gray-900 dark:text-gray-100",children:a.label})]},a.value))}),e.type==="scale"&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"flex justify-between mb-2",children:e.scaleLabels&&Object.entries(e.scaleLabels).map(([a,p])=>jsxRuntime.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-400 text-center",style:{width:`${100/Object.keys(e.scaleLabels||{}).length}%`},children:p},a))}),jsxRuntime.jsx("input",{type:"range",id:e.id,min:e.minValue||1,max:e.maxValue||5,value:typeof s=="number"?s:e.minValue||1,onChange:a=>u(e.id,parseInt(a.target.value,10)),disabled:n,className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700","aria-required":e.required||void 0,"aria-describedby":c,"aria-invalid":r?true:void 0}),jsxRuntime.jsxs("div",{className:"mt-1 text-sm text-gray-600 dark:text-gray-400 text-center",children:["Selected value: ",s||e.minValue||1]})]}),r&&jsxRuntime.jsx("p",{id:k,className:"mt-1 text-sm text-red-500",role:"alert",children:r})]},e.id)};return v?jsxRuntime.jsxs("div",{className:`${i("bg-white dark:bg-gray-800 rounded-lg shadow-md p-6","root")} ${A}`,children:[D&&jsxRuntime.jsxs("div",{className:i("mb-6","header"),children:[jsxRuntime.jsxs("div",{className:"flex justify-between text-sm text-gray-600 dark:text-gray-400 mb-1",children:[jsxRuntime.jsxs("span",{children:["Section ",g+1," of ",b.length]}),jsxRuntime.jsx("span",{children:o!==void 0?`${o}% Complete`:""})]}),jsxRuntime.jsx("div",{className:i("w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700","progressBar"),role:"progressbar","aria-valuenow":o!==void 0?o:Math.round((g+1)/b.length*100),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Questionnaire progress",children:jsxRuntime.jsx("div",{className:"bg-[rgb(var(--ndpr-primary))] h-2.5 rounded-full",style:{width:`${o!==void 0?o:(g+1)/b.length*100}%`}})})]}),jsxRuntime.jsx("h2",{className:i("text-xl font-bold mb-2 text-gray-900 dark:text-white","title"),children:v.title}),v.description&&jsxRuntime.jsx("p",{className:i("mb-6 text-gray-600 dark:text-gray-300","sectionTitle"),children:v.description}),jsxRuntime.jsx("div",{className:i("space-y-6","section"),children:v.questions.map(e=>V(e))}),jsxRuntime.jsxs("div",{className:i("mt-8 flex justify-between","navigation"),children:[jsxRuntime.jsx("button",{type:"button",onClick:B,disabled:g===0||n,className:`${i("px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 disabled:opacity-50 disabled:cursor-not-allowed","prevButton")} ${f}`,children:Q}),jsxRuntime.jsx("button",{type:"button",onClick:$,disabled:n,className:`${i("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] disabled:opacity-50 disabled:cursor-not-allowed","nextButton")} ${f}`,children:L?C:I})]})]}):jsxRuntime.jsx("div",{children:"No section found."})};exports.a=F;//# sourceMappingURL=chunk-XHSHPB74.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-XHSHPB74.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkI54CDQGN_js=require('./chunk-I54CDQGN.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var mr=({requestTypes:A,onSubmit:V,onValidationError:S,title:s="Submit a Data Subject Request",description:N="Use this form to exercise your rights under the Nigeria Data Protection Act (NDPA), Part IV, Sections 29-36.",submitButtonText:rr="Submit Request",className:D="",buttonClassName:_="",showConfirmation:er=true,confirmationMessage:ir="Your request has been submitted successfully. You will receive a confirmation email shortly.",requireIdentityVerification:P=true,identifierTypes:R=[{id:"email",label:"Email Address"},{id:"account",label:"Account Number"},{id:"customer_id",label:"Customer ID"}],collectAdditionalContact:tr=true,labels:f={},classNames:r,unstyled:o=false,isSubmitting:x=false,defaultValues:a,onReset:F})=>{var Y,H,L,U,W,J;let[h,j]=react.useState((a==null?void 0:a.requestType)||""),[T,E]=react.useState(((Y=a==null?void 0:a.dataSubject)==null?void 0:Y.fullName)||""),[q,O]=react.useState(((H=a==null?void 0:a.dataSubject)==null?void 0:H.email)||""),[w,B]=react.useState(((L=a==null?void 0:a.dataSubject)==null?void 0:L.phone)||""),[z,M]=react.useState(((U=a==null?void 0:a.dataSubject)==null?void 0:U.identifierType)||((W=R[0])==null?void 0:W.id)||""),[$,Z]=react.useState(((J=a==null?void 0:a.dataSubject)==null?void 0:J.identifierValue)||""),[l,C]=react.useState((a==null?void 0:a.additionalInfo)||{}),[or,I]=react.useState(false),[d,G]=react.useState({}),nr=()=>{var e;j(""),E(""),O(""),B(""),M(((e=R[0])==null?void 0:e.id)||""),Z(""),C({}),I(false),G({}),F==null||F();},u=A.find(e=>e.id===h),dr=e=>{j(e.target.value),C({});},c=(e,b)=>{C(m=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},m),{[e]:b}));},ar=()=>{let e={};return T.trim()||(e.fullName="Full name is required"),q.trim()?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(q)||(e.email="Email is invalid"):e.email="Email is required",h||(e.requestType="Please select a request type"),P&&!$.trim()&&(e.identifierValue="Identifier value is required"),u!=null&&u.requiresAdditionalInfo&&u.additionalFields&&u.additionalFields.forEach(b=>{b.required&&!l[b.id]&&(e[`additional_${b.id}`]=`${b.label} is required`);}),G(e),e},ur=e=>{e.preventDefault();let b=ar();if(Object.keys(b).length>0){S==null||S(b);return}let m=Object.keys(l).length>0?Object.fromEntries(Object.entries(l).map(([g,v])=>[g,typeof v=="string"?chunkI54CDQGN_js.a(v):v])):void 0,k={requestType:h,dataSubject:{fullName:chunkI54CDQGN_js.a(T),email:chunkI54CDQGN_js.a(q),phone:w?chunkI54CDQGN_js.a(w):void 0,identifierType:z,identifierValue:chunkI54CDQGN_js.a($)},additionalInfo:m,submittedAt:Date.now()};V(k),er&&I(true);};return or?jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`p-4 bg-green-50 dark:bg-green-900/20 rounded-md ${D}`,r==null?void 0:r.successMessage,o),"aria-live":"polite",children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-lg font-bold text-green-800 dark:text-green-200 mb-2",r==null?void 0:r.title,o),children:"Request Submitted"}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-green-700 dark:text-green-300",r==null?void 0:r.description,o),children:ir}),jsxRuntime.jsx("button",{onClick:()=>I(false),className:chunkE64TU6IU_js.a(`mt-4 px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${_}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:"Submit Another Request"})]}):jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${D}`,r==null?void 0:r.root,o),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",r==null?void 0:r.title,o),children:s}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("mb-6 text-gray-600 dark:text-gray-300",r==null?void 0:r.description,o),children:N}),jsxRuntime.jsx("form",{onSubmit:ur,className:chunkE64TU6IU_js.a("",r==null?void 0:r.form,o),children:jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-4",r==null?void 0:r.fieldGroup,o),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Personal Information"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"fullName",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:[f.name||"Full Name"," ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"fullName",value:T,onChange:e=>E(e.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),required:true,"aria-required":"true","aria-invalid":!!d.fullName,"aria-describedby":d.fullName?"fullName-error":void 0}),d.fullName&&jsxRuntime.jsx("p",{id:"fullName-error",role:"alert",className:"mt-1 text-sm text-red-500",children:d.fullName})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"email",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:[f.email||"Email Address"," ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"email",id:"email",value:q,onChange:e=>O(e.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),required:true,"aria-required":"true","aria-invalid":!!d.email,"aria-describedby":d.email?"email-error":void 0}),d.email&&jsxRuntime.jsx("p",{id:"email-error",role:"alert",className:"mt-1 text-sm text-red-500",children:d.email})]}),tr&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"phone",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:"Phone Number (Optional)"}),jsxRuntime.jsx("input",{type:"tel",id:"phone",value:w,onChange:e=>B(e.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Request Details"}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"requestType",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:[f.requestType||"Request Type"," ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsxs("select",{id:"requestType",value:h,onChange:dr,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),required:true,"aria-required":"true","aria-invalid":!!d.requestType,"aria-describedby":d.requestType?"requestType-error":void 0,children:[jsxRuntime.jsx("option",{value:"",children:"Select a request type"}),A.map(e=>jsxRuntime.jsx("option",{value:e.id,children:e.name},e.id))]}),d.requestType&&jsxRuntime.jsx("p",{id:"requestType-error",role:"alert",className:"mt-1 text-sm text-red-500",children:d.requestType})]}),u&&jsxRuntime.jsxs("div",{className:"mb-4 p-3 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 mb-2",children:u.description}),jsxRuntime.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Estimated completion time: ",u.estimatedCompletionTime," ",u.estimatedCompletionTime===1?"day":"days"]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("label",{htmlFor:"requestDescription",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:f.description||"Additional Information"}),jsxRuntime.jsx("textarea",{id:"requestDescription",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.textarea,o),rows:4,placeholder:"Please provide any additional details that might help us process your request"})]})]}),P&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Identity Verification"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 mb-3",children:"To protect your privacy, we need to verify your identity before processing your request."}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"identifierType",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:["Identifier Type ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("select",{id:"identifierType",value:z,onChange:e=>M(e.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),required:true,"aria-required":"true",children:R.map(e=>jsxRuntime.jsx("option",{value:e.id,children:e.label},e.id))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"identifierValue",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:["Identifier Value ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"identifierValue",value:$,onChange:e=>Z(e.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),required:true,"aria-required":"true","aria-invalid":!!d.identifierValue,"aria-describedby":d.identifierValue?"identifierValue-error":void 0}),d.identifierValue&&jsxRuntime.jsx("p",{id:"identifierValue-error",role:"alert",className:"mt-1 text-sm text-red-500",children:d.identifierValue})]})]})]}),(u==null?void 0:u.requiresAdditionalInfo)&&u.additionalFields&&u.additionalFields.length>0&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Additional Information"}),jsxRuntime.jsx("div",{className:"space-y-4",children:u.additionalFields.map(e=>{var b,m,k;return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:e.id,className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:[e.label," ",e.required&&jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),e.type==="text"&&jsxRuntime.jsx("input",{type:"text",id:e.id,value:String((b=l[e.id])!=null?b:""),onChange:g=>c(e.id,g.target.value),placeholder:e.placeholder,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),required:e.required,"aria-required":e.required||void 0,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0}),e.type==="textarea"&&jsxRuntime.jsx("textarea",{id:e.id,value:String((m=l[e.id])!=null?m:""),onChange:g=>c(e.id,g.target.value),placeholder:e.placeholder,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.textarea,o),rows:4,required:e.required,"aria-required":e.required||void 0,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0}),e.type==="select"&&e.options&&jsxRuntime.jsxs("select",{id:e.id,value:String((k=l[e.id])!=null?k:""),onChange:g=>c(e.id,g.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),required:e.required,"aria-required":e.required||void 0,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0,children:[jsxRuntime.jsx("option",{value:"",children:e.placeholder||"Select an option"}),e.options.map(g=>jsxRuntime.jsx("option",{value:g,children:g},g))]}),e.type==="checkbox"&&jsxRuntime.jsxs("div",{className:"flex items-start",children:[jsxRuntime.jsx("div",{className:"flex items-center h-5",children:jsxRuntime.jsx("input",{type:"checkbox",id:e.id,checked:!!l[e.id],onChange:g=>c(e.id,g.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]",required:e.required,"aria-required":e.required||void 0,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0})}),jsxRuntime.jsx("div",{className:"ml-3 text-sm",children:jsxRuntime.jsx("label",{htmlFor:e.id,className:"text-gray-700 dark:text-gray-300",children:e.placeholder||e.label})})]}),e.type==="file"&&jsxRuntime.jsx("input",{type:"file",id:e.id,onChange:g=>{var K;let v=(K=g.target.files)==null?void 0:K[0];v&&c(e.id,v.name);},className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),required:e.required,"aria-required":e.required||void 0,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0}),d[`additional_${e.id}`]&&jsxRuntime.jsx("p",{id:`additional-${e.id}-error`,role:"alert",className:"mt-1 text-sm text-red-500",children:d[`additional_${e.id}`]})]},e.id)})})]}),jsxRuntime.jsxs("div",{className:"mt-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold mb-2",children:"Privacy Notice"}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-300",children:"The information you provide in this form will be used solely for the purpose of processing your data subject request. We will retain this information for as long as necessary to fulfill your request and to comply with our legal obligations. For more information, please refer to our Privacy Policy."})]}),jsxRuntime.jsxs("div",{className:"mt-6 flex gap-3 relative",children:[x&&(r==null?void 0:r.loadingOverlay)&&jsxRuntime.jsx("div",{className:r.loadingOverlay}),jsxRuntime.jsx("button",{type:"submit",disabled:x,className:chunkE64TU6IU_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 ${_} ${x?"opacity-50 cursor-not-allowed":""}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:x?"Submitting...":f.submit||rr}),jsxRuntime.jsx("button",{type:"button",onClick:nr,className:chunkE64TU6IU_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,o),children:"Reset"})]})]})})]})};exports.a=mr;//# sourceMappingURL=chunk-YCX6BFOQ.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-YCX6BFOQ.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {b,d,a as a$1,c}from'./chunk-SHMJNRHO.mjs';import {a as a$2}from'./chunk-AYKLAEOU.mjs';import {a,b as b$1}from'./chunk-WWT2ZSNU.mjs';import {useState,useMemo,useEffect,useCallback}from'react';import {jsx,jsxs}from'react/jsx-runtime';var _=[{value:"consent",label:"Consent (Section 25(1)(a))"},{value:"contract",label:"Contract (Section 25(1)(b))"},{value:"legal_obligation",label:"Legal Obligation (Section 25(1)(c))"},{value:"vital_interests",label:"Vital Interests (Section 25(1)(d))"},{value:"public_interest",label:"Public Interest (Section 25(1)(e))"},{value:"legitimate_interests",label:"Legitimate Interests (Section 25(1)(f))"}],ee=[{value:"active",label:"Active"},{value:"inactive",label:"Inactive"},{value:"archived",label:"Archived"}],Oe=[{value:"data_subject",label:"Directly from Data Subject"},{value:"third_party",label:"Third Party"},{value:"public_source",label:"Public Source"},{value:"other",label:"Other"}];function je(){let d=Date.now();return {id:`proc_${d}_${Math.random().toString(36).substring(2,11)}`,name:"",description:"",controllerDetails:{name:"",contact:"",address:""},lawfulBasis:"consent",lawfulBasisJustification:"",purposes:[],dataCategories:[],dataSubjectCategories:[],recipients:[],retentionPeriod:"",securityMeasures:[],dataSource:"data_subject",dpiaRequired:false,automatedDecisionMaking:false,status:"active",createdAt:d,updatedAt:d}}function te(d){return d?new Date(d).toLocaleDateString():"N/A"}var $e=({ropa:d$1,onAddRecord:w,onUpdateRecord:R,onArchiveRecord:D,title:re="Record of Processing Activities (ROPA)",description:ae="Maintain a comprehensive record of all data processing activities as required by the NDPA accountability principle.",className:ie="",buttonClassName:F="",classNames:e,unstyled:o})=>{let[v,x]=useState("list"),[S,oe]=useState(""),[P,ne]=useState("all"),[A,de]=useState("all"),[l,f]=useState(null),[U,k]=useState([]),[I,$]=useState(""),[M,H]=useState(""),[L,V]=useState(""),[E,J]=useState(""),[O,z]=useState(""),[j,G]=useState(""),[q,W]=useState(""),p=useMemo(()=>b(d$1),[d$1]),y=useMemo(()=>d(d$1),[d$1]),K=useMemo(()=>{let r=[...d$1.records];if(P!=="all"&&(r=r.filter(i=>i.status===P)),A!=="all"&&(r=r.filter(i=>i.lawfulBasis===A)),S){let i=S.toLowerCase();r=r.filter(u=>u.name.toLowerCase().includes(i)||u.description.toLowerCase().includes(i)||u.dataCategories.some(m=>m.toLowerCase().includes(i))||u.department&&u.department.toLowerCase().includes(i));}return r},[d$1.records,P,A,S]);useEffect(()=>{l&&($(l.purposes.join(", ")),H(l.dataCategories.join(", ")),V((l.sensitiveDataCategories||[]).join(", ")),J(l.dataSubjectCategories.join(", ")),z(l.recipients.join(", ")),G(l.securityMeasures.join(", ")),W((l.systemsUsed||[]).join(", ")));},[l==null?void 0:l.id]);let le=useCallback(()=>{let r=je();r.controllerDetails.name=d$1.organizationName,r.controllerDetails.contact=d$1.organizationContact,r.controllerDetails.address=d$1.organizationAddress,d$1.ndpcRegistrationNumber&&(r.controllerDetails.registrationNumber=d$1.ndpcRegistrationNumber),d$1.dpoDetails&&(r.controllerDetails.dpoContact=d$1.dpoDetails.email),f(r),k([]),x("form");},[d$1.organizationName,d$1.organizationContact,d$1.organizationAddress,d$1.ndpcRegistrationNumber,d$1.dpoDetails]),ue=useCallback(r=>{f(a({},r)),k([]),x("form");},[]),b$2=r=>r.split(",").map(i=>i.trim()).filter(i=>i.length>0),ge=useCallback(()=>{if(!l)return;let r=b$1(a({},l),{purposes:b$2(I),dataCategories:b$2(M),sensitiveDataCategories:b$2(L),dataSubjectCategories:b$2(E),recipients:b$2(O),securityMeasures:b$2(j),systemsUsed:b$2(q),updatedAt:Date.now()});r.sensitiveDataCategories&&r.sensitiveDataCategories.length===0&&(r.sensitiveDataCategories=void 0),r.systemsUsed&&r.systemsUsed.length===0&&(r.systemsUsed=void 0);let i=a$1(r);if(!i.valid){k(i.errors);return}d$1.records.find(m=>m.id===r.id)?R==null||R(r.id,r):w==null||w(r),f(null),k([]),x("list");},[l,I,M,L,E,O,j,q,d$1.records,R,w]),se=useCallback(r=>{D==null||D(r);},[D]),ce=useCallback(()=>{let r=c(d$1),i=new Blob([r],{type:"text/csv;charset=utf-8;"}),u=URL.createObjectURL(i),m=document.createElement("a");m.href=u,m.download=`ropa_${d$1.organizationName.replace(/\s+/g,"_").toLowerCase()}_${new Date().toISOString().slice(0,10)}.csv`,m.click(),setTimeout(()=>URL.revokeObjectURL(u),100);},[d$1]),Q=useCallback(()=>{f(null),k([]),x("list");},[]),s=useCallback((r,i)=>{f(u=>u&&b$1(a({},u),{[r]:i}));},[]),T=useCallback((r,i)=>{f(u=>u&&b$1(a({},u),{controllerDetails:b$1(a({},u.controllerDetails),{[r]:i})}));},[]),pe=useCallback(r=>!!r.nextReviewDate&&r.nextReviewDate<=Date.now(),[]),me=useCallback(r=>{oe(r.target.value);},[]),be=useCallback(r=>{ne(r.target.value);},[]),ve=useCallback(r=>{de(r.target.value);},[]),xe=useCallback(r=>{$(r.target.value);},[]),fe=useCallback(r=>{H(r.target.value);},[]),ye=useCallback(r=>{V(r.target.value);},[]),he=useCallback(r=>{J(r.target.value);},[]),ke=useCallback(r=>{z(r.target.value);},[]),Ce=useCallback(r=>{G(r.target.value);},[]),we=useCallback(r=>{W(r.target.value);},[]),Re=useCallback(()=>x("list"),[]),De=useCallback(()=>x("summary"),[]),Se=useCallback(r=>{let i={active:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",inactive:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",archived:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300"},u={active:"Active",inactive:"Inactive",archived:"Archived"};return jsx("span",{className:a$2(`px-2 py-1 rounded text-xs font-medium ${i[r]}`,e==null?void 0:e.statusBadge,o),children:u[r]})},[e==null?void 0:e.statusBadge,o]),Pe=useCallback(r=>jsx("span",{className:"px-2 py-1 rounded text-xs font-medium bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",children:{consent:"Consent",contract:"Contract",legal_obligation:"Legal Obligation",vital_interests:"Vital Interests",public_interest:"Public Interest",legitimate_interests:"Legitimate Interests"}[r]}),[]),Ae=()=>jsxs("div",{className:a$2("mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",e==null?void 0:e.orgInfo,o),children:[jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[jsxs("div",{children:[jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"Organization"}),jsx("p",{className:"text-sm font-semibold",children:d$1.organizationName})]}),d$1.dpoDetails&&jsxs("div",{children:[jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"Data Protection Officer"}),jsx("p",{className:"text-sm font-semibold",children:d$1.dpoDetails.name}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:d$1.dpoDetails.email})]}),d$1.ndpcRegistrationNumber&&jsxs("div",{children:[jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"NDPC Registration No."}),jsx("p",{className:"text-sm font-semibold",children:d$1.ndpcRegistrationNumber})]})]}),jsxs("div",{className:"mt-2 text-xs text-gray-600 dark:text-gray-400",children:["Version ",d$1.version," | Last Updated: ",te(d$1.lastUpdated)]})]}),Be=()=>jsxs("div",{className:a$2("mb-6",e==null?void 0:e.summary,o),children:[jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-4",children:[jsxs("div",{className:a$2("p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-blue-700 dark:text-blue-300",children:p.totalRecords}),jsx("p",{className:"text-xs text-blue-600 dark:text-blue-400",children:"Total Records"})]}),jsxs("div",{className:a$2("p-4 bg-green-50 dark:bg-green-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-green-700 dark:text-green-300",children:p.activeRecords}),jsx("p",{className:"text-xs text-green-600 dark:text-green-400",children:"Active"})]}),jsxs("div",{className:a$2("p-4 bg-purple-50 dark:bg-purple-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-purple-700 dark:text-purple-300",children:p.crossBorderRecords}),jsx("p",{className:"text-xs text-purple-600 dark:text-purple-400",children:"Cross-Border"})]}),jsxs("div",{className:a$2("p-4 bg-orange-50 dark:bg-orange-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-orange-700 dark:text-orange-300",children:y.length}),jsx("p",{className:"text-xs text-orange-600 dark:text-orange-400",children:"Records with Gaps"})]})]}),jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 mb-4",children:[jsxs("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("p",{className:"text-sm font-medium mb-2",children:"By Lawful Basis"}),_.map(r=>jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"text-gray-600 dark:text-gray-400",children:r.label.split(" (")[0]}),jsx("span",{className:"font-medium",children:p.byLawfulBasis[r.value]||0})]},r.value))]}),jsxs("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("p",{className:"text-sm font-medium mb-2",children:"Risk Indicators"}),jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Sensitive Data"}),jsx("span",{className:"font-medium",children:p.sensitiveDataRecords})]}),jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"DPIA Required"}),jsx("span",{className:"font-medium",children:p.dpiaRequiredRecords})]}),jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Automated Decisions"}),jsx("span",{className:"font-medium",children:p.automatedDecisionRecords})]}),jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Due for Review"}),jsx("span",{className:`font-medium ${p.recordsDueForReview.length>0?"text-red-600 dark:text-red-400":""}`,children:p.recordsDueForReview.length})]})]}),p.topDepartments.length>0&&jsxs("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("p",{className:"text-sm font-medium mb-2",children:"Top Departments"}),p.topDepartments.slice(0,5).map(r=>jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"text-gray-600 dark:text-gray-400",children:r.department}),jsx("span",{className:"font-medium",children:r.count})]},r.department))]})]}),y.length>0&&jsxs("div",{className:a$2("p-3 bg-red-50 dark:bg-red-900/20 rounded-md",e==null?void 0:e.complianceGap,o),role:"status","aria-live":"polite",children:[jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-2",children:"Compliance Gaps Detected"}),y.slice(0,5).map(r=>jsxs("div",{className:"mb-2",children:[jsx("p",{className:"text-xs font-medium text-red-700 dark:text-red-300",children:r.recordName}),jsx("ul",{className:"list-disc list-inside",children:r.gaps.map((i,u)=>jsx("li",{className:"text-xs text-red-600 dark:text-red-400",children:i},u))})]},r.recordId)),y.length>5&&jsxs("p",{className:"text-xs text-red-600 dark:text-red-400 mt-1",children:["...and ",y.length-5," more record(s) with gaps."]})]})]}),Fe=()=>jsxs("div",{children:[jsxs("div",{className:"mb-4 grid grid-cols-1 md:grid-cols-4 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"ropaSearch",className:"block text-sm font-medium mb-1",children:"Search"}),jsx("input",{type:"text",id:"ropaSearch",value:S,onChange:me,placeholder:"Search records...",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"ropaStatusFilter",className:"block text-sm font-medium mb-1",children:"Status"}),jsxs("select",{id:"ropaStatusFilter",value:P,onChange:be,className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.select,o),children:[jsx("option",{value:"all",children:"All Statuses"}),ee.map(r=>jsx("option",{value:r.value,children:r.label},r.value))]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"ropaBasisFilter",className:"block text-sm font-medium mb-1",children:"Lawful Basis"}),jsxs("select",{id:"ropaBasisFilter",value:A,onChange:ve,className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.select,o),children:[jsx("option",{value:"all",children:"All Bases"}),_.map(r=>jsx("option",{value:r.value,children:r.label.split(" (")[0]},r.value))]})]}),jsxs("div",{className:"flex items-end space-x-2",children:[jsx("button",{onClick:le,className:a$2(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm ${F}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.submitButton),o),children:"Add Record"}),jsx("button",{onClick:ce,"aria-label":"Export ROPA records as CSV",className:a$2(`px-4 py-2 bg-gray-600 text-white rounded hover:bg-gray-700 text-sm ${F}`,(e==null?void 0:e.secondaryButton)||(e==null?void 0:e.exportButton),o),children:"Export CSV"})]})]}),K.length===0?jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm text-center py-8",children:"No processing records found."}):jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:a$2("w-full text-sm text-left",e==null?void 0:e.table,o),children:[jsx("thead",{className:a$2("text-xs uppercase bg-gray-50 dark:bg-gray-700",e==null?void 0:e.tableHeader,o),children:jsxs("tr",{children:[jsx("th",{className:"px-4 py-3",children:"Name"}),jsx("th",{className:"px-4 py-3",children:"Lawful Basis"}),jsx("th",{className:"px-4 py-3",children:"Data Categories"}),jsx("th",{className:"px-4 py-3",children:"Status"}),jsx("th",{className:"px-4 py-3",children:"Last Reviewed"}),jsx("th",{className:"px-4 py-3",children:"Actions"})]})}),jsx("tbody",{children:K.map(r=>{let i=pe(r),u=y.some(m=>m.recordId===r.id);return jsxs("tr",{className:a$2(`border-b dark:border-gray-600 ${i?"bg-red-50 dark:bg-red-900/10":u?"bg-yellow-50 dark:bg-yellow-900/10":"bg-white dark:bg-gray-800"} hover:bg-gray-50 dark:hover:bg-gray-700`,e==null?void 0:e.tableRow,o),children:[jsx("td",{className:"px-4 py-3",children:jsxs("div",{children:[jsx("p",{className:"font-medium",children:r.name}),r.department&&jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:r.department}),i&&jsx("span",{className:"text-xs text-red-600 dark:text-red-400 font-medium",children:"Review Overdue"})]})}),jsx("td",{className:"px-4 py-3",children:Pe(r.lawfulBasis)}),jsx("td",{className:"px-4 py-3",children:jsx("p",{className:"text-xs text-gray-600 dark:text-gray-300 max-w-xs truncate",children:r.dataCategories.join(", ")})}),jsx("td",{className:"px-4 py-3",children:Se(r.status)}),jsx("td",{className:"px-4 py-3 text-xs text-gray-600 dark:text-gray-400",children:te(r.lastReviewedAt)}),jsx("td",{className:"px-4 py-3",children:jsxs("div",{className:"flex space-x-2",children:[jsx("button",{onClick:()=>ue(r),"aria-label":`Edit record: ${r.name}`,className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline text-xs",children:"Edit"}),r.status!=="archived"&&jsx("button",{onClick:()=>se(r.id),"aria-label":`Archive record: ${r.name}`,className:"text-gray-600 dark:text-gray-400 hover:underline text-xs",children:"Archive"})]})})]},r.id)})})]})})]}),Ie=useMemo(()=>l?!d$1.records.find(r=>r.id===l.id):true,[l,d$1.records]),Me=()=>{if(!l)return null;let r=Ie;return jsxs("div",{className:a$2("",e==null?void 0:e.form,o),children:[jsxs("div",{className:a$2("flex justify-between items-center mb-4",e==null?void 0:e.header,o),children:[jsx("h3",{className:"text-lg font-medium",children:r?"Add Processing Record":"Edit Processing Record"}),jsx("button",{onClick:Q,className:"text-gray-600 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 text-sm",children:"Cancel"})]}),U.length>0&&jsxs("div",{className:"mb-4 p-3 bg-red-50 dark:bg-red-900/20 rounded-md",role:"status","aria-live":"polite",children:[jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Please fix the following errors:"}),jsx("ul",{className:"list-disc list-inside",children:U.map((i,u)=>jsx("li",{className:"text-xs text-red-600 dark:text-red-400",children:i},u))})]}),jsxs("div",{className:"space-y-6",children:[jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsx("legend",{className:"text-sm font-medium px-2",children:"Basic Information"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"recordName",className:"block text-sm font-medium mb-1",children:"Activity Name *"}),jsx("input",{type:"text",id:"recordName",value:l.name,onChange:i=>s("name",i.target.value),"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"e.g., Customer Account Management"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"recordDepartment",className:"block text-sm font-medium mb-1",children:"Department"}),jsx("input",{type:"text",id:"recordDepartment",value:l.department||"",onChange:i=>s("department",i.target.value||void 0),className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"e.g., Marketing"})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"recordDescription",className:"block text-sm font-medium mb-1",children:"Description *"}),jsx("textarea",{id:"recordDescription",value:l.description,onChange:i=>s("description",i.target.value),rows:3,"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"Describe what personal data processing is performed..."})]}),jsxs("div",{children:[jsx("label",{htmlFor:"recordStatus",className:"block text-sm font-medium mb-1",children:"Status *"}),jsx("select",{id:"recordStatus",value:l.status,onChange:i=>s("status",i.target.value),"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.select,o),children:ee.map(i=>jsx("option",{value:i.value,children:i.label},i.value))})]})]})]}),jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsx("legend",{className:"text-sm font-medium px-2",children:"Controller Details"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"controllerName",className:"block text-sm font-medium mb-1",children:"Controller Name *"}),jsx("input",{type:"text",id:"controllerName",value:l.controllerDetails.name,onChange:i=>T("name",i.target.value),"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"controllerContact",className:"block text-sm font-medium mb-1",children:"Controller Contact *"}),jsx("input",{type:"text",id:"controllerContact",value:l.controllerDetails.contact,onChange:i=>T("contact",i.target.value),"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o)})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"controllerAddress",className:"block text-sm font-medium mb-1",children:"Controller Address *"}),jsx("input",{type:"text",id:"controllerAddress",value:l.controllerDetails.address,onChange:i=>T("address",i.target.value),"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o)})]})]})]}),jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsx("legend",{className:"text-sm font-medium px-2",children:"Lawful Basis (NDPA Section 25)"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"lawfulBasis",className:"block text-sm font-medium mb-1",children:"Lawful Basis *"}),jsx("select",{id:"lawfulBasis",value:l.lawfulBasis,onChange:i=>s("lawfulBasis",i.target.value),"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.select,o),children:_.map(i=>jsx("option",{value:i.value,children:i.label},i.value))})]}),jsxs("div",{children:[jsx("label",{htmlFor:"lawfulBasisJustification",className:"block text-sm font-medium mb-1",children:"Justification *"}),jsx("textarea",{id:"lawfulBasisJustification",value:l.lawfulBasisJustification,onChange:i=>s("lawfulBasisJustification",i.target.value),rows:2,"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"Explain why this lawful basis applies..."})]})]})]}),jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsx("legend",{className:"text-sm font-medium px-2",children:"Data Details"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"purposes",className:"block text-sm font-medium mb-1",children:"Purposes * (comma-separated)"}),jsx("input",{type:"text",id:"purposes",value:I,onChange:xe,"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"e.g., Account management, Service delivery"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dataCategories",className:"block text-sm font-medium mb-1",children:"Data Categories * (comma-separated)"}),jsx("input",{type:"text",id:"dataCategories",value:M,onChange:fe,"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"e.g., Name, Email, Phone number"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"sensitiveData",className:"block text-sm font-medium mb-1",children:"Sensitive Data Categories (comma-separated)"}),jsx("input",{type:"text",id:"sensitiveData",value:L,onChange:ye,className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"e.g., Health data, Biometric data"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"subjectCategories",className:"block text-sm font-medium mb-1",children:"Data Subject Categories * (comma-separated)"}),jsx("input",{type:"text",id:"subjectCategories",value:E,onChange:he,"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"e.g., Customers, Employees"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"recipients",className:"block text-sm font-medium mb-1",children:"Recipients * (comma-separated)"}),jsx("input",{type:"text",id:"recipients",value:O,onChange:ke,"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"e.g., Payment processors, Cloud service providers"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dataSource",className:"block text-sm font-medium mb-1",children:"Data Source *"}),jsx("select",{id:"dataSource",value:l.dataSource,onChange:i=>s("dataSource",i.target.value),"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.select,o),children:Oe.map(i=>jsx("option",{value:i.value,children:i.label},i.value))})]}),l.dataSource==="third_party"&&jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"thirdPartyDetails",className:"block text-sm font-medium mb-1",children:"Third-Party Source Details *"}),jsx("input",{type:"text",id:"thirdPartyDetails",value:l.thirdPartySourceDetails||"",onChange:i=>s("thirdPartySourceDetails",i.target.value||void 0),"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"Describe the third-party data source..."})]})]})]}),jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsx("legend",{className:"text-sm font-medium px-2",children:"Retention and Security"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"retentionPeriod",className:"block text-sm font-medium mb-1",children:"Retention Period *"}),jsx("input",{type:"text",id:"retentionPeriod",value:l.retentionPeriod,onChange:i=>s("retentionPeriod",i.target.value),"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"e.g., 5 years after account closure"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"retentionJustification",className:"block text-sm font-medium mb-1",children:"Retention Justification"}),jsx("input",{type:"text",id:"retentionJustification",value:l.retentionJustification||"",onChange:i=>s("retentionJustification",i.target.value||void 0),className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"Why this retention period is necessary..."})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"securityMeasures",className:"block text-sm font-medium mb-1",children:"Security Measures * (comma-separated)"}),jsx("input",{type:"text",id:"securityMeasures",value:j,onChange:Ce,"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"e.g., Encryption at rest, Access controls, Audit logging"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"systemsUsed",className:"block text-sm font-medium mb-1",children:"Systems Used (comma-separated)"}),jsx("input",{type:"text",id:"systemsUsed",value:q,onChange:we,className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"e.g., CRM, ERP, Cloud Storage"})]})]})]}),jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsx("legend",{className:"text-sm font-medium px-2",children:"Risk Indicators"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",id:"dpiaRequired",checked:l.dpiaRequired,onChange:i=>s("dpiaRequired",i.target.checked),className:"rounded border-gray-300 dark:border-gray-600"}),jsx("label",{htmlFor:"dpiaRequired",className:"text-sm font-medium",children:"DPIA Required"})]}),l.dpiaRequired&&jsxs("div",{children:[jsx("label",{htmlFor:"dpiaReference",className:"block text-sm font-medium mb-1",children:"DPIA Reference *"}),jsx("input",{type:"text",id:"dpiaReference",value:l.dpiaReference||"",onChange:i=>s("dpiaReference",i.target.value||void 0),"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"Reference to the completed DPIA"})]}),jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",id:"automatedDecisionMaking",checked:l.automatedDecisionMaking,onChange:i=>s("automatedDecisionMaking",i.target.checked),className:"rounded border-gray-300 dark:border-gray-600"}),jsx("label",{htmlFor:"automatedDecisionMaking",className:"text-sm font-medium",children:"Automated Decision-Making"})]}),l.automatedDecisionMaking&&jsxs("div",{children:[jsx("label",{htmlFor:"automatedDecisionMakingDetails",className:"block text-sm font-medium mb-1",children:"Automated Decision-Making Details *"}),jsx("textarea",{id:"automatedDecisionMakingDetails",value:l.automatedDecisionMakingDetails||"",onChange:i=>s("automatedDecisionMakingDetails",i.target.value||void 0),rows:2,"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"Describe the automated decision-making process..."})]})]})]}),jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsx("legend",{className:"text-sm font-medium px-2",children:"Review Schedule"}),jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:jsxs("div",{children:[jsx("label",{htmlFor:"nextReviewDate",className:"block text-sm font-medium mb-1",children:"Next Review Date"}),jsx("input",{type:"date",id:"nextReviewDate",value:l.nextReviewDate?new Date(l.nextReviewDate).toISOString().slice(0,10):"",onChange:i=>s("nextReviewDate",i.target.value?new Date(i.target.value).getTime():void 0),className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o)})]})})]}),jsxs("div",{className:"flex justify-end space-x-3",children:[jsx("button",{onClick:Q,className:"px-4 py-2 border border-gray-300 dark:border-gray-600 rounded hover:bg-gray-50 dark:hover:bg-gray-700 text-sm",children:"Cancel"}),jsx("button",{onClick:ge,className:a$2(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm ${F}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.submitButton),o),children:r?"Add Record":"Save Changes"})]})]})]})},Le=()=>jsxs("div",{className:"flex space-x-4 mb-6 border-b border-gray-200 dark:border-gray-600",children:[jsx("button",{onClick:Re,className:`pb-2 text-sm font-medium ${v==="list"?"border-b-2 border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300"}`,children:"Processing Records"}),jsx("button",{onClick:De,className:`pb-2 text-sm font-medium ${v==="summary"?"border-b-2 border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300"}`,children:"Compliance Summary"})]});return jsxs("div",{className:a$2(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${ie}`,e==null?void 0:e.root,o),children:[jsx("h2",{className:a$2("text-xl font-bold mb-2",e==null?void 0:e.title,o),children:re}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:ae}),Ae(),v!=="form"&&Le(),v==="list"&&Fe(),v==="summary"&&Be(),v==="form"&&Me()]})};export{$e as a};//# sourceMappingURL=chunk-YURSF2YO.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-YURSF2YO.mjs.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use strict';var chunkTXXWCB5O_js=require('./chunk-TXXWCB5O.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),Gr=require('react'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Gr__default=/*#__PURE__*/_interopDefault(Gr);var br=["Organization","Data Collection","Processing","Review & Export"],vr=({currentStep:d,classNames:p,unstyled:r})=>jsxRuntime.jsx("nav",{"data-ndpr-component":"policy-step-indicator","aria-label":"Policy wizard progress",className:chunkE64TU6IU_js.a("w-full flex items-center justify-between px-2 py-4",p==null?void 0:p.root,r),children:br.map((o,n)=>{let t=n+1,i=t<d,a=t===d,v=n===br.length-1;return jsxRuntime.jsxs(Gr__default.default.Fragment,{children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex flex-col items-center gap-1",p==null?void 0:p.stepWrapper,r),children:[jsxRuntime.jsx("div",{"aria-current":a?"step":void 0,"aria-label":`Step ${t}: ${o}${i?" (completed)":a?" (current)":""}`,className:chunkE64TU6IU_js.a(["flex items-center justify-center rounded-full border-2 font-semibold transition-all",i?"w-8 h-8 bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))]":a?"w-9 h-9 bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] shadow-md":"w-8 h-8 bg-white dark:bg-gray-900 border-gray-300 dark:border-gray-600 text-gray-400 dark:text-gray-500"].join(" "),i?p==null?void 0:p.stepCompleted:a?p==null?void 0:p.stepCurrent:p==null?void 0:p.stepUpcoming,r),children:i?jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):jsxRuntime.jsx("span",{className:"text-xs leading-none",children:t})}),jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(["text-xs font-medium hidden sm:block",i||a?"text-[rgb(var(--ndpr-primary))]":"text-gray-400 dark:text-gray-500"].join(" "),p==null?void 0:p.stepLabel,r),children:o})]}),!v&&jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a(["flex-1 h-0.5 mx-2",i?"bg-[rgb(var(--ndpr-primary))]":"bg-gray-200 dark:bg-gray-700"].join(" "),p==null?void 0:p.connector,r),"aria-hidden":"true"})]},t)})});var $="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",Vr="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",A=({id:d,label:p,required:r,description:o,children:n,classNames:t,unstyled:i})=>{let a=o?`${d}-desc`:void 0;return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex flex-col",t==null?void 0:t.field,i),children:[jsxRuntime.jsxs("label",{htmlFor:d,className:chunkE64TU6IU_js.a(Vr,t==null?void 0:t.label,i),children:[p,r&&jsxRuntime.jsx("span",{className:"text-red-500 ml-0.5","aria-hidden":"true",children:"*"})]}),o&&jsxRuntime.jsx("p",{id:a,className:"text-xs text-gray-500 dark:text-gray-400 mb-1",children:o}),n]})},yr=({context:d,onUpdateOrg:p,classNames:r,unstyled:o})=>{var i,a,x;let n=Gr.useId(),t=d.org;return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-about",className:chunkE64TU6IU_js.a("space-y-6",r==null?void 0:r.root,o),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-semibold text-gray-900 dark:text-gray-100",r==null?void 0:r.heading,o),children:"Organisation Details"}),jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm text-gray-500 dark:text-gray-400 mt-1",r==null?void 0:r.subheading,o),children:["Tell us about your organisation. Fields marked ",jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})," are required."]})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("grid grid-cols-1 md:grid-cols-2 gap-4",r==null?void 0:r.grid,o),children:[jsxRuntime.jsx(A,{id:`${n}-org-name`,label:"Organisation Name",required:true,classNames:r,unstyled:o,children:jsxRuntime.jsx("input",{id:`${n}-org-name`,type:"text",value:t.name,onChange:v=>p({name:v.target.value}),placeholder:"Acme Corporation",className:chunkE64TU6IU_js.a($,r==null?void 0:r.input,o),"aria-required":"true"})}),jsxRuntime.jsx(A,{id:`${n}-website`,label:"Website",required:true,classNames:r,unstyled:o,children:jsxRuntime.jsx("input",{id:`${n}-website`,type:"url",value:t.website,onChange:v=>p({website:v.target.value}),placeholder:"https://example.com",className:chunkE64TU6IU_js.a($,r==null?void 0:r.input,o),"aria-required":"true"})}),jsxRuntime.jsx(A,{id:`${n}-privacy-email`,label:"Privacy Contact Email",required:true,classNames:r,unstyled:o,children:jsxRuntime.jsx("input",{id:`${n}-privacy-email`,type:"email",value:t.privacyEmail,onChange:v=>p({privacyEmail:v.target.value}),placeholder:"privacy@example.com",className:chunkE64TU6IU_js.a($,r==null?void 0:r.input,o),"aria-required":"true"})}),jsxRuntime.jsx(A,{id:`${n}-industry`,label:"Industry",classNames:r,unstyled:o,children:jsxRuntime.jsxs("select",{id:`${n}-industry`,value:t.industry,onChange:v=>p({industry:v.target.value}),className:chunkE64TU6IU_js.a($,r==null?void 0:r.select,o),children:[jsxRuntime.jsx("option",{value:"fintech",children:"Fintech"}),jsxRuntime.jsx("option",{value:"healthcare",children:"Healthcare"}),jsxRuntime.jsx("option",{value:"ecommerce",children:"E-commerce"}),jsxRuntime.jsx("option",{value:"saas",children:"SaaS"}),jsxRuntime.jsx("option",{value:"education",children:"Education"}),jsxRuntime.jsx("option",{value:"government",children:"Government"}),jsxRuntime.jsx("option",{value:"other",children:"Other"})]})}),jsxRuntime.jsx(A,{id:`${n}-dpo-name`,label:"Data Protection Officer (DPO) Name",classNames:r,unstyled:o,children:jsxRuntime.jsx("input",{id:`${n}-dpo-name`,type:"text",value:(i=t.dpoName)!=null?i:"",onChange:v=>p({dpoName:v.target.value}),placeholder:"Jane Smith",className:chunkE64TU6IU_js.a($,r==null?void 0:r.input,o)})}),jsxRuntime.jsx(A,{id:`${n}-dpo-email`,label:"DPO Email",classNames:r,unstyled:o,children:jsxRuntime.jsx("input",{id:`${n}-dpo-email`,type:"email",value:(a=t.dpoEmail)!=null?a:"",onChange:v=>p({dpoEmail:v.target.value}),placeholder:"dpo@example.com",className:chunkE64TU6IU_js.a($,r==null?void 0:r.input,o)})}),jsxRuntime.jsx(A,{id:`${n}-address`,label:"Registered Address",classNames:r,unstyled:o,children:jsxRuntime.jsx("input",{id:`${n}-address`,type:"text",value:(x=t.address)!=null?x:"",onChange:v=>p({address:v.target.value}),placeholder:"1 Victoria Island, Lagos, Nigeria",className:chunkE64TU6IU_js.a($,r==null?void 0:r.input,o)})}),jsxRuntime.jsx(A,{id:`${n}-org-size`,label:"Organisation Size",classNames:r,unstyled:o,children:jsxRuntime.jsxs("select",{id:`${n}-org-size`,value:t.orgSize,onChange:v=>p({orgSize:v.target.value}),className:chunkE64TU6IU_js.a($,r==null?void 0:r.select,o),children:[jsxRuntime.jsx("option",{value:"startup",children:"Startup (1\u201350 employees)"}),jsxRuntime.jsx("option",{value:"midsize",children:"Mid-size (51\u2013500 employees)"}),jsxRuntime.jsx("option",{value:"enterprise",children:"Enterprise (500+ employees)"})]})}),jsxRuntime.jsx(A,{id:`${n}-country`,label:"Country of Operation",classNames:r,unstyled:o,children:jsxRuntime.jsx("input",{id:`${n}-country`,type:"text",value:t.country,onChange:v=>p({country:v.target.value}),placeholder:"Nigeria",className:chunkE64TU6IU_js.a($,r==null?void 0:r.input,o)})})]})]})};var Xr={identity:"Identity",financial:"Financial",behavioral:"Behavioural",sensitive:"Sensitive",children:"Children"},Yr=["identity","financial","behavioral","sensitive","children"],Jr=["sensitive","children"],lr=({categories:d,onToggle:p,classNames:r,unstyled:o})=>{let n=Yr.reduce((t,i)=>{let a=d.filter(x=>x.group===i);return a.length>0&&(t[i]=a),t},{});return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-data",className:chunkE64TU6IU_js.a("space-y-8",r==null?void 0:r.root,o),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-semibold text-gray-900 dark:text-gray-100",r==null?void 0:r.heading,o),children:"Data Categories"}),jsxRuntime.jsx("p",{id:"data-categories-desc",className:chunkE64TU6IU_js.a("text-sm text-gray-500 dark:text-gray-400 mt-1",r==null?void 0:r.subheading,o),children:"Select the categories of personal data your organisation collects. You must select at least one."})]}),Object.entries(n).map(([t,i])=>{let a=Jr.includes(t);return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-3",r==null?void 0:r.group,o),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-center gap-2",r==null?void 0:r.groupHeader,o),children:[jsxRuntime.jsx("h3",{className:chunkE64TU6IU_js.a("text-sm font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400",r==null?void 0:r.groupTitle,o),children:Xr[t]}),a&&jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("text-xs font-medium text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-900/20 px-2 py-0.5 rounded-full",r==null?void 0:r.sensitiveTag,o),children:"Sensitive"})]}),a&&jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-xs text-amber-700 dark:text-amber-400",r==null?void 0:r.sensitiveWarning,o),children:t==="children"?"Processing children's data requires parental consent under NDPA Section 31 and imposes heightened obligations.":"Sensitive/special-category data requires explicit consent and additional safeguards under NDPA Section 30."}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",r==null?void 0:r.cardsGrid,o),children:i.map(x=>jsxRuntime.jsx("button",{type:"button",onClick:()=>p(x.id),"aria-pressed":x.selected,className:chunkE64TU6IU_js.a(["text-left rounded-lg border p-4 transition-all cursor-pointer focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",x.selected?"bg-[rgb(var(--ndpr-primary))]/5 border-[rgb(var(--ndpr-primary))] dark:bg-[rgb(var(--ndpr-primary))]/10":"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"].join(" "),r==null?void 0:r.card,o),children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a(["mt-0.5 w-4 h-4 rounded border-2 flex-shrink-0 flex items-center justify-center",x.selected?"bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))]":"border-gray-300 dark:border-gray-600"].join(" "),r==null?void 0:r.checkbox,o),"aria-hidden":"true",children:x.selected&&jsxRuntime.jsx("svg",{className:"w-2.5 h-2.5 text-[rgb(var(--ndpr-primary-foreground))]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-sm font-medium text-gray-900 dark:text-gray-100",r==null?void 0:r.cardLabel,o),children:x.label}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400 mt-1 leading-relaxed",r==null?void 0:r.cardDataPoints,o),children:x.dataPoints.join(", ")})]})]})},x.id))})]},t)})]})};var Qr=[{value:"service_delivery",label:"Service Delivery",description:"Processing required to deliver the core product or service."},{value:"marketing",label:"Marketing & Communications",description:"Sending promotional messages, newsletters or offers."},{value:"analytics",label:"Analytics & Insights",description:"Analysing usage patterns to improve the product."},{value:"research",label:"Research & Development",description:"Using data to develop new features or products."},{value:"legal_compliance",label:"Legal Compliance",description:"Meeting statutory, regulatory or contractual obligations."},{value:"fraud_prevention",label:"Fraud Prevention & Security",description:"Detecting and preventing fraudulent activity."}],dr="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",pr="bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-4",gr=({id:d,checked:p,onChange:r})=>jsxRuntime.jsx("button",{id:d,type:"button",role:"switch","aria-checked":p,onClick:()=>r(!p),className:["relative inline-flex h-6 w-11 flex-shrink-0 rounded-full border-2 border-transparent cursor-pointer transition-colors focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",p?"bg-[rgb(var(--ndpr-primary))]":"bg-gray-200 dark:bg-gray-600"].join(" "),children:jsxRuntime.jsx("span",{"aria-hidden":"true",className:["pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition-transform",p?"translate-x-5":"translate-x-0"].join(" ")})}),fr=({context:d,onTogglePurpose:p,onUpdateContext:r,onAddProcessor:o,onRemoveProcessor:n,classNames:t,unstyled:i})=>{let a=Gr.useId(),[x,v]=Gr.useState({name:"",purpose:"",country:""}),[k,g]=Gr.useState(false),u=()=>{let{name:b,purpose:h,country:m}=x;!b.trim()||!h.trim()||!m.trim()||(o({name:b.trim(),purpose:h.trim(),country:m.trim()}),v({name:"",purpose:"",country:""}),g(false));};return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-processing",className:chunkE64TU6IU_js.a("space-y-6",t==null?void 0:t.root,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-semibold text-gray-900 dark:text-gray-100",t==null?void 0:t.heading,i),children:"Processing Details"}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-sm text-gray-500 dark:text-gray-400 mt-1",t==null?void 0:t.subheading,i),children:"Define how and why you process personal data."})]}),jsxRuntime.jsxs("section",{className:chunkE64TU6IU_js.a(pr,t==null?void 0:t.section,i),"aria-labelledby":"purposes-heading",children:[jsxRuntime.jsx("h3",{id:"purposes-heading",className:chunkE64TU6IU_js.a("text-base font-semibold text-gray-900 dark:text-gray-100",t==null?void 0:t.sectionTitle,i),children:"Processing Purposes"}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-sm text-gray-500 dark:text-gray-400",t==null?void 0:t.sectionDescription,i),children:"Select all purposes for which you process personal data. At least one is required."}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-3",t==null?void 0:t.purposeList,i),children:Qr.map(b=>{let h=d.purposes.includes(b.value),m=`${a}-purpose-${b.value}`,z=`${a}-purpose-desc-${b.value}`;return jsxRuntime.jsxs("label",{htmlFor:m,className:chunkE64TU6IU_js.a("flex items-start gap-3 cursor-pointer group",t==null?void 0:t.purposeItem,i),children:[jsxRuntime.jsx("input",{id:m,type:"checkbox",checked:h,onChange:()=>p(b.value),"aria-describedby":z,className:chunkE64TU6IU_js.a("mt-0.5 h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))] cursor-pointer",t==null?void 0:t.purposeCheckbox,i)}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-sm font-medium text-gray-900 dark:text-gray-100",t==null?void 0:t.purposeLabel,i),children:b.label}),jsxRuntime.jsx("p",{id:z,className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400",t==null?void 0:t.purposeDescription,i),children:b.description})]})]},b.value)})})]}),jsxRuntime.jsxs("section",{className:chunkE64TU6IU_js.a(pr,t==null?void 0:t.section,i),"aria-labelledby":"thirdparty-heading",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("h3",{id:"thirdparty-heading",className:chunkE64TU6IU_js.a("text-base font-semibold text-gray-900 dark:text-gray-100",t==null?void 0:t.sectionTitle,i),children:"Third-Party Data Sharing"}),jsxRuntime.jsx(gr,{id:`${a}-thirdparty-toggle`,checked:d.thirdPartyProcessors.length>0||k,onChange:b=>{b?g(true):(d.thirdPartyProcessors.forEach((h,m)=>n(0)),g(false));}})]}),(d.thirdPartyProcessors.length>0||k)&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-4",t==null?void 0:t.processorSection,i),children:[d.thirdPartyProcessors.length>0&&jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("overflow-x-auto",t==null?void 0:t.processorTable,i),children:jsxRuntime.jsxs("table",{className:"w-full text-sm",children:[jsxRuntime.jsx("thead",{children:jsxRuntime.jsxs("tr",{className:chunkE64TU6IU_js.a("text-left text-xs font-medium text-gray-500 dark:text-gray-400 border-b border-gray-200 dark:border-gray-700",t==null?void 0:t.tableHeader,i),children:[jsxRuntime.jsx("th",{className:"pb-2 pr-4",children:"Name"}),jsxRuntime.jsx("th",{className:"pb-2 pr-4",children:"Purpose"}),jsxRuntime.jsx("th",{className:"pb-2 pr-4",children:"Country"}),jsxRuntime.jsx("th",{className:"pb-2"})]})}),jsxRuntime.jsx("tbody",{className:"divide-y divide-gray-100 dark:divide-gray-700",children:d.thirdPartyProcessors.map((b,h)=>jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("td",{className:chunkE64TU6IU_js.a("py-2 pr-4 text-gray-900 dark:text-gray-100",t==null?void 0:t.tableCell,i),children:b.name}),jsxRuntime.jsx("td",{className:chunkE64TU6IU_js.a("py-2 pr-4 text-gray-700 dark:text-gray-300",t==null?void 0:t.tableCell,i),children:b.purpose}),jsxRuntime.jsx("td",{className:chunkE64TU6IU_js.a("py-2 pr-4 text-gray-700 dark:text-gray-300",t==null?void 0:t.tableCell,i),children:b.country}),jsxRuntime.jsx("td",{className:"py-2",children:jsxRuntime.jsx("button",{type:"button",onClick:()=>n(h),className:chunkE64TU6IU_js.a("text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300 text-xs font-medium",t==null?void 0:t.removeButton,i),"aria-label":`Remove ${b.name}`,children:"Remove"})})]},h))})]})}),k?jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("grid grid-cols-1 sm:grid-cols-3 gap-3 items-end",t==null?void 0:t.processorForm,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:`${a}-proc-name`,className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Processor Name"}),jsxRuntime.jsx("input",{id:`${a}-proc-name`,type:"text",placeholder:"Processor name",value:x.name,onChange:b=>v(h=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},h),{name:b.target.value})),"aria-required":"true",className:chunkE64TU6IU_js.a(dr,t==null?void 0:t.input,i)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:`${a}-proc-purpose`,className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Purpose"}),jsxRuntime.jsx("input",{id:`${a}-proc-purpose`,type:"text",placeholder:"Purpose",value:x.purpose,onChange:b=>v(h=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},h),{purpose:b.target.value})),"aria-required":"true",className:chunkE64TU6IU_js.a(dr,t==null?void 0:t.input,i)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:`${a}-proc-country`,className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Country"}),jsxRuntime.jsx("input",{id:`${a}-proc-country`,type:"text",placeholder:"Country",value:x.country,onChange:b=>v(h=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},h),{country:b.target.value})),"aria-required":"true",className:chunkE64TU6IU_js.a(dr,t==null?void 0:t.input,i)})]}),jsxRuntime.jsxs("div",{className:"sm:col-span-3 flex gap-2",children:[jsxRuntime.jsx("button",{type:"button",onClick:u,className:chunkE64TU6IU_js.a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium",t==null?void 0:t.addButton,i),children:"Add Processor"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>g(false),className:chunkE64TU6IU_js.a("px-4 py-2 bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-white rounded-md text-sm",t==null?void 0:t.cancelButton,i),children:"Cancel"})]})]}):jsxRuntime.jsxs("button",{type:"button",onClick:()=>g(true),className:chunkE64TU6IU_js.a("flex items-center gap-1 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",t==null?void 0:t.addLink,i),children:[jsxRuntime.jsx("span",{"aria-hidden":"true",children:"+"})," Add processor"]})]})]}),jsxRuntime.jsxs("section",{className:chunkE64TU6IU_js.a(pr,t==null?void 0:t.section,i),"aria-labelledby":"disclosures-heading",children:[jsxRuntime.jsx("h3",{id:"disclosures-heading",className:chunkE64TU6IU_js.a("text-base font-semibold text-gray-900 dark:text-gray-100",t==null?void 0:t.sectionTitle,i),children:"Additional Disclosures"}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-4",t==null?void 0:t.disclosureList,i),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{id:`${a}-cross-border-label`,className:chunkE64TU6IU_js.a("text-sm font-medium text-gray-900 dark:text-gray-100",t==null?void 0:t.disclosureLabel,i),children:"Cross-border Data Transfers"}),jsxRuntime.jsx("p",{id:`${a}-cross-border-desc`,className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400 mt-0.5",t==null?void 0:t.disclosureDescription,i),children:"Do you transfer personal data outside Nigeria? This triggers NDPA Chapter 6 obligations."})]}),jsxRuntime.jsx(gr,{id:`${a}-cross-border-toggle`,checked:d.hasCrossBorderTransfer,onChange:b=>r({hasCrossBorderTransfer:b})})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{id:`${a}-automated-label`,className:chunkE64TU6IU_js.a("text-sm font-medium text-gray-900 dark:text-gray-100",t==null?void 0:t.disclosureLabel,i),children:"Automated Decision-Making / Profiling"}),jsxRuntime.jsx("p",{id:`${a}-automated-desc`,className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400 mt-0.5",t==null?void 0:t.disclosureDescription,i),children:"Do you use algorithms or AI to make decisions about individuals? Requires disclosure under NDPA Section 37."})]}),jsxRuntime.jsx(gr,{id:`${a}-automated-toggle`,checked:d.hasAutomatedDecisions,onChange:b=>r({hasAutomatedDecisions:b})})]})]})]})]})};var kr=({section:d,index:p,isCustom:r,isEditing:o,editedContent:n,onEdit:t,onSaveEdit:i,onCancelEdit:a,onMoveUp:x,onMoveDown:v,onDelete:k,classNames:g,unstyled:u})=>{let[b,h]=Gr.useState(n!=null?n:d.template);return Gr.useEffect(()=>{n!==void 0&&h(n);},[n]),Gr.useEffect(()=>{o&&h(n!=null?n:d.template);},[o,n,d.template]),jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-section-card",className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-3",g==null?void 0:g.root,u),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-start justify-between gap-2",g==null?void 0:g.header,u),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-center gap-3 min-w-0",g==null?void 0:g.titleRow,u),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("flex-shrink-0 w-7 h-7 rounded-full bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-300 text-xs font-semibold flex items-center justify-center",g==null?void 0:g.sectionNumber,u),"aria-hidden":"true",children:p+1}),jsxRuntime.jsxs("h4",{className:chunkE64TU6IU_js.a("text-sm font-semibold text-gray-900 dark:text-gray-100 truncate",g==null?void 0:g.sectionTitle,u),children:[d.title,r&&jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("ml-2 text-xs font-normal text-gray-500 dark:text-gray-400 bg-gray-100 dark:bg-gray-700 px-1.5 py-0.5 rounded",g==null?void 0:g.customBadge,u),children:"Custom"})]})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-center gap-1 flex-shrink-0",g==null?void 0:g.actions,u),children:[x&&jsxRuntime.jsx("button",{type:"button",onClick:x,className:chunkE64TU6IU_js.a("p-1.5 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",g==null?void 0:g.moveButton,u),"aria-label":`Move "${d.title}" up`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})})}),v&&jsxRuntime.jsx("button",{type:"button",onClick:v,className:chunkE64TU6IU_js.a("p-1.5 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",g==null?void 0:g.moveButton,u),"aria-label":`Move "${d.title}" down`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}),!o&&jsxRuntime.jsx("button",{type:"button",onClick:t,className:chunkE64TU6IU_js.a("p-1.5 text-gray-400 hover:text-[rgb(var(--ndpr-primary))] rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",g==null?void 0:g.editButton,u),"aria-label":`Edit "${d.title}"`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),r&&k&&jsxRuntime.jsx("button",{type:"button",onClick:k,className:chunkE64TU6IU_js.a("p-1.5 text-gray-400 hover:text-red-500 dark:hover:text-red-400 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",g==null?void 0:g.deleteButton,u),"aria-label":`Delete "${d.title}"`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]}),o?jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-2",g==null?void 0:g.editArea,u),children:[jsxRuntime.jsx("textarea",{value:b,onChange:m=>h(m.target.value),rows:8,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm font-mono resize-y",g==null?void 0:g.textarea,u),"aria-label":`Edit content for ${d.title}`}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex gap-2",g==null?void 0:g.editActions,u),children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>i(b),className:chunkE64TU6IU_js.a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium",g==null?void 0:g.saveButton,u),children:"Save"}),jsxRuntime.jsx("button",{type:"button",onClick:a,className:chunkE64TU6IU_js.a("px-4 py-2 bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-white rounded-md text-sm",g==null?void 0:g.cancelButton,u),children:"Cancel"})]})]}):jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("text-sm text-gray-600 dark:text-gray-300 leading-relaxed line-clamp-4 whitespace-pre-wrap",g==null?void 0:g.content,u),children:d.template})]})};var Cr="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",wr=({onAdd:d,nextOrder:p,classNames:r,unstyled:o})=>{let n=Gr.useId(),[t,i]=Gr.useState(""),[a,x]=Gr.useState(""),[v,k]=Gr.useState(""),g=()=>{if(!t.trim()){k("Section title is required.");return}if(!a.trim()){k("Section content is required.");return}k(""),d({title:t.trim(),content:a.trim(),order:p}),i(""),x("");};return jsxRuntime.jsxs("div",{"data-ndpr-component":"custom-section-form",className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-4",r==null?void 0:r.root,o),children:[jsxRuntime.jsx("h4",{className:chunkE64TU6IU_js.a("text-sm font-semibold text-gray-900 dark:text-gray-100",r==null?void 0:r.heading,o),children:"Add Custom Section"}),v&&jsxRuntime.jsx("p",{role:"alert",className:chunkE64TU6IU_js.a("text-xs text-red-600 dark:text-red-400",r==null?void 0:r.error,o),children:v}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-3",r==null?void 0:r.fields,o),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:`${n}-custom-section-title`,className:chunkE64TU6IU_js.a("block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",r==null?void 0:r.label,o),children:["Section Title ",jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsxRuntime.jsx("input",{id:`${n}-custom-section-title`,type:"text",value:t,onChange:u=>{i(u.target.value),v&&k("");},placeholder:"e.g. Cookie Policy",className:chunkE64TU6IU_js.a(Cr,r==null?void 0:r.input,o),"aria-required":"true"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:`${n}-custom-section-content`,className:chunkE64TU6IU_js.a("block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",r==null?void 0:r.label,o),children:["Content ",jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsxRuntime.jsx("textarea",{id:`${n}-custom-section-content`,value:a,onChange:u=>{x(u.target.value),v&&k("");},placeholder:"Write the section content here...",rows:5,className:chunkE64TU6IU_js.a(`${Cr} resize-y`,r==null?void 0:r.textarea,o),"aria-required":"true"})]})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("flex items-center gap-2",r==null?void 0:r.footer,o),children:jsxRuntime.jsx("button",{type:"button",onClick:g,className:chunkE64TU6IU_js.a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium",r==null?void 0:r.addButton,o),children:"Add Section"})})]})};var mr={compliant:{bg:"bg-green-50 dark:bg-green-900/20",text:"text-green-700 dark:text-green-300",border:"border-green-200 dark:border-green-700"},nearly_compliant:{bg:"bg-amber-50 dark:bg-amber-900/20",text:"text-amber-700 dark:text-amber-300",border:"border-amber-200 dark:border-amber-700"},not_compliant:{bg:"bg-red-50 dark:bg-red-900/20",text:"text-red-700 dark:text-red-300",border:"border-red-200 dark:border-red-700"}},sr={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},N=({icon:d,label:p,description:r,actionLabel:o,loading:n,onClick:t,classNames:i,unstyled:a})=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 flex flex-col gap-3",i==null?void 0:i.formatCard,a),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-center gap-3",i==null?void 0:i.formatHeader,a),children:[jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("w-10 h-10 rounded-lg bg-gray-100 dark:bg-gray-700 flex items-center justify-center flex-shrink-0",i==null?void 0:i.formatIcon,a),"aria-hidden":"true",children:d}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-sm font-semibold text-gray-900 dark:text-gray-100",i==null?void 0:i.formatLabel,a),children:p}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400",i==null?void 0:i.formatDescription,a),children:r})]})]}),jsxRuntime.jsx("button",{type:"button",onClick:t,disabled:n,className:chunkE64TU6IU_js.a("w-full px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2",i==null?void 0:i.formatButton,a),children:n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("svg",{className:"animate-spin w-4 h-4",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),"Generating\u2026"]}):o})]}),Sr=({complianceResult:d,onExportPDF:p,onExportDOCX:r,onExportHTML:o,onExportMarkdown:n,classNames:t,unstyled:i})=>{var h;let[a,x]=Gr.useState(false),[v,k]=Gr.useState(false),g=(h=mr[d.rating])!=null?h:mr.not_compliant,u=()=>chunkMQFZHA2D_js.d(null,null,function*(){x(true);try{yield p();}finally{x(false);}}),b=()=>chunkMQFZHA2D_js.d(null,null,function*(){k(true);try{yield r();}finally{k(false);}});return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-export-panel",className:chunkE64TU6IU_js.a("space-y-6",t==null?void 0:t.root,i),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`rounded-lg border p-4 flex items-center gap-4 ${g.bg} ${g.border}`,t==null?void 0:t.complianceSummary,i),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`text-3xl font-bold ${g.text}`,t==null?void 0:t.complianceScore,i),"aria-label":`Compliance score: ${d.percentage}%`,children:[d.percentage,"%"]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a(`text-sm font-semibold ${g.text}`,t==null?void 0:t.complianceRating,i),children:sr[d.rating]}),jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400 mt-0.5",t==null?void 0:t.complianceDetail,i),children:[d.score," / ",d.maxScore," points \u2022"," ",d.gaps.length," gap",d.gaps.length!==1?"s":""," remaining"]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:chunkE64TU6IU_js.a("text-sm font-semibold text-gray-900 dark:text-gray-100 mb-3",t==null?void 0:t.formatsHeading,i),children:"Export Format"}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("grid grid-cols-1 sm:grid-cols-2 gap-3",t==null?void 0:t.formatsGrid,i),children:[jsxRuntime.jsx(N,{icon:jsxRuntime.jsx("svg",{className:"w-5 h-5 text-red-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-3 7v-1h4v1h-4zm0-3v-1h4v1h-4zm-2-5h8v1H8v-1z"})}),label:"PDF",description:"Professional formatted document, ideal for publishing.",actionLabel:"Download PDF",loading:a,onClick:u,classNames:t,unstyled:i}),jsxRuntime.jsx(N,{icon:jsxRuntime.jsx("svg",{className:"w-5 h-5 text-blue-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-5 8v-5h1.5l1 3 1-3H13v5h-1v-3.5l-.75 2.25h-.5L10 13.5V17H9zm5-1.5h.75c.55 0 .75-.25.75-.75 0-.4-.2-.65-.75-.65H14V15.5zm1 1.5h-2v-4h2c1.1 0 1.75.6 1.75 1.5 0 .55-.25.95-.65 1.15.5.2.8.65.8 1.2 0 1-.65 1.65-1.9 1.65V17zm-.25-1c.6 0 .9-.25.9-.75 0-.45-.3-.75-.9-.75H14V16h.75z"})}),label:"DOCX",description:"Editable Word document for further customisation.",actionLabel:"Download DOCX",loading:v,onClick:b,classNames:t,unstyled:i}),jsxRuntime.jsx(N,{icon:jsxRuntime.jsxs("svg",{className:"w-5 h-5 text-orange-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 15H9V8h2v9zm4 0h-2V8h2v9z"}),jsxRuntime.jsx("path",{d:"M9.5 6.5h1v1h-1zm4 0h1v1h-1z"}),jsxRuntime.jsx("path",{d:"M5 5h14v2H5zm0 12h14v2H5z"})]}),label:"HTML",description:"Copy-ready HTML to embed on your website.",actionLabel:"Copy HTML",onClick:o,classNames:t,unstyled:i}),jsxRuntime.jsx(N,{icon:jsxRuntime.jsx("svg",{className:"w-5 h-5 text-gray-500 dark:text-gray-300",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M3 5h18v2H3V5zm0 4h12v2H3V9zm0 4h18v2H3v-2zm0 4h12v2H3v-2z"})}),label:"Markdown",description:"Plain-text format for documentation or Git repos.",actionLabel:"Copy Markdown",onClick:n,classNames:t,unstyled:i})]})]})]})};var Lr=({sections:d,customSections:p,sectionOverrides:r,complianceResult:o,onEditSection:n,onAddCustomSection:t,onRemoveCustomSection:i,onReorderSection:a,onExportPDF:x,onExportDOCX:v,onExportHTML:k,onExportMarkdown:g,classNames:u,unstyled:b})=>{let[h,m]=Gr.useState(null),[z,J]=Gr.useState(false),Z=new Set(p.map(f=>f.id)),er=(f,D)=>{n(f,D),m(null);},or=d.length>0?Math.max(...d.map(f=>{var D;return (D=f.order)!=null?D:0}))+1:1;return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-review",className:chunkE64TU6IU_js.a("space-y-6",u==null?void 0:u.root,b),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-semibold text-gray-900 dark:text-gray-100",u==null?void 0:u.heading,b),children:"Review & Export"}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-sm text-gray-500 dark:text-gray-400 mt-1",u==null?void 0:u.subheading,b),children:"Review your generated policy sections, reorder or edit content, then export."})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-3",u==null?void 0:u.sectionList,b),"aria-live":"polite",children:d.map((f,D)=>jsxRuntime.jsx(kr,{section:r[f.id]?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},f),{template:r[f.id]}):f,index:D,isCustom:Z.has(f.id),isEditing:h===f.id,editedContent:r[f.id],onEdit:()=>m(f.id),onSaveEdit:ir=>er(f.id,ir),onCancelEdit:()=>m(null),onMoveUp:D>0?()=>a(f.id,"up"):void 0,onMoveDown:D<d.length-1?()=>a(f.id,"down"):void 0,onDelete:Z.has(f.id)?()=>i(f.id):void 0,classNames:u,unstyled:b},f.id))}),!z&&jsxRuntime.jsxs("button",{type:"button",onClick:()=>J(true),className:chunkE64TU6IU_js.a("flex items-center gap-2 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",u==null?void 0:u.addSectionButton,b),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("w-5 h-5 rounded-full border-2 border-[rgb(var(--ndpr-primary))] flex items-center justify-center text-xs font-bold leading-none",u==null?void 0:u.addSectionIcon,b),"aria-hidden":"true",children:"+"}),"Add Custom Section"]}),z&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-2",u==null?void 0:u.customFormWrapper,b),children:[jsxRuntime.jsx(wr,{onAdd:f=>{t(f),J(false);},nextOrder:or,classNames:u,unstyled:b}),jsxRuntime.jsx("button",{type:"button",onClick:()=>J(false),className:chunkE64TU6IU_js.a("text-sm text-gray-500 dark:text-gray-400 hover:underline",u==null?void 0:u.cancelCustomForm,b),children:"Cancel"})]}),jsxRuntime.jsx("hr",{className:chunkE64TU6IU_js.a("border-gray-200 dark:border-gray-700",u==null?void 0:u.divider,b)}),jsxRuntime.jsx(Sr,{complianceResult:o,onExportPDF:x,onExportDOCX:v,onExportHTML:k,onExportMarkdown:g,classNames:u,unstyled:b})]})};var Dr={compliant:{stroke:"stroke-green-500 dark:stroke-green-400",text:"text-green-600 dark:text-green-400"},nearly_compliant:{stroke:"stroke-amber-500 dark:stroke-amber-400",text:"text-amber-600 dark:text-amber-400"},not_compliant:{stroke:"stroke-red-500 dark:stroke-red-400",text:"text-red-600 dark:text-red-400"}},tt={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},Fr=({score:d,maxScore:p,rating:r,classNames:o,unstyled:n})=>{var k,g;let t=p>0?Math.round(d/p*100):0,i=(k=Dr[r])!=null?k:Dr.not_compliant,a=36,x=2*Math.PI*a,v=x-t/100*x;return jsxRuntime.jsxs("div",{"data-ndpr-component":"compliance-score-ring",className:chunkE64TU6IU_js.a("flex flex-col items-center gap-2",o==null?void 0:o.root,n),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("relative w-24 h-24",o==null?void 0:o.svgWrapper,n),children:[jsxRuntime.jsxs("svg",{className:"w-24 h-24 -rotate-90",viewBox:"0 0 96 96","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{cx:"48",cy:"48",r:a,fill:"none",className:"stroke-gray-200 dark:stroke-gray-700",strokeWidth:"8"}),jsxRuntime.jsx("circle",{cx:"48",cy:"48",r:a,fill:"none",className:i.stroke,strokeWidth:"8",strokeLinecap:"round",strokeDasharray:x,strokeDashoffset:v,style:{transition:"stroke-dashoffset 0.5s ease-out"}})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("absolute inset-0 flex flex-col items-center justify-center",o==null?void 0:o.centerText,n),children:jsxRuntime.jsxs("span",{className:chunkE64TU6IU_js.a(`text-xl font-bold leading-none ${i.text}`,o==null?void 0:o.scoreValue,n),"aria-label":`${t}% compliance score`,children:[t,"%"]})})]}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a(`text-xs font-semibold text-center ${i.text}`,o==null?void 0:o.ratingLabel,n),children:(g=tt[r])!=null?g:r}),jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400 text-center",o==null?void 0:o.scoreDetail,n),children:[d," / ",p," pts"]})]})};var ot={critical:"text-red-600 dark:text-red-400",important:"text-amber-600 dark:text-amber-400",recommended:"text-blue-600 dark:text-blue-400"},Er=({gap:d,isPassed:p,onFix:r,classNames:o,unstyled:n})=>{let[t,i]=Gr.useState(false);return jsxRuntime.jsxs("div",{"data-ndpr-component":"compliance-requirement-item",className:chunkE64TU6IU_js.a("border-b border-gray-100 dark:border-gray-700 last:border-0 py-2",o==null?void 0:o.root,n),children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>!p&&i(a=>!a),className:chunkE64TU6IU_js.a("w-full flex items-start gap-2 text-left group",o==null?void 0:o.row,n),"aria-expanded":p?void 0:t,"aria-disabled":p,children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(["mt-0.5 flex-shrink-0 w-4 h-4 rounded-full flex items-center justify-center",p?"bg-green-500":d.severity==="critical"?"bg-red-500":d.severity==="important"?"bg-amber-500":"bg-blue-400"].join(" "),o==null?void 0:o.statusIcon,n),"aria-hidden":"true",children:p?jsxRuntime.jsx("svg",{className:"w-2.5 h-2.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):jsxRuntime.jsx("svg",{className:"w-2.5 h-2.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-1",children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a(`text-xs font-medium ${p?"text-gray-700 dark:text-gray-300":"text-gray-900 dark:text-gray-100"}`,o==null?void 0:o.requirementLabel,n),children:d.requirement}),!p&&jsxRuntime.jsx("svg",{className:`flex-shrink-0 w-3 h-3 text-gray-400 transition-transform ${t?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-400 dark:text-gray-500 mt-0.5",o==null?void 0:o.ndpaSection,n),children:["NDPA ",d.ndpaSection]})]})]}),!p&&t&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mt-2 ml-6 space-y-2",o==null?void 0:o.detail,n),children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a(`text-xs ${ot[d.severity]}`,o==null?void 0:o.message,n),children:d.message}),jsxRuntime.jsx("button",{type:"button",onClick:()=>{r(d.requirementId),i(false);},className:chunkE64TU6IU_js.a("text-xs font-medium px-3 py-1 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))]",o==null?void 0:o.fixButton,n),children:d.fixLabel})]})]})};function nt(d,p){let r=p.map(t=>({gap:{requirementId:t,requirement:t.split("-").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "),ndpaSection:"\u2014",severity:"recommended",message:"",fixType:"fill_field",fixLabel:""},isPassed:true})),o=d.map(t=>({gap:t,isPassed:false})),n={critical:0,important:1,recommended:2};return o.sort((t,i)=>n[t.gap.severity]-n[i.gap.severity]),[...o,...r]}var $r=({complianceResult:d,onFix:p,classNames:r,unstyled:o})=>{let[n,t]=Gr.useState(false),i=nt(d.gaps,d.passed);return jsxRuntime.jsxs("aside",{"data-ndpr-component":"compliance-checker-sidebar",className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",r==null?void 0:r.root,o),"aria-label":"NDPA compliance checker",children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/50",r==null?void 0:r.header,o),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-sm font-semibold text-gray-900 dark:text-gray-100",r==null?void 0:r.title,o),children:"NDPA Compliance"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>t(a=>!a),className:chunkE64TU6IU_js.a("p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",r==null?void 0:r.collapseButton,o),"aria-expanded":!n,"aria-label":n?"Expand compliance checker":"Collapse compliance checker",children:jsxRuntime.jsx("svg",{className:`w-4 h-4 transition-transform ${n?"-rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})})]}),!n&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("p-4 space-y-4",r==null?void 0:r.body,o),children:[jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("flex justify-center",r==null?void 0:r.ringWrapper,o),children:jsxRuntime.jsx(Fr,{score:d.score,maxScore:d.maxScore,rating:d.rating,classNames:r,unstyled:o})}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("grid grid-cols-3 gap-2 text-center",r==null?void 0:r.statsRow,o),children:[{count:d.gaps.filter(a=>a.severity==="critical").length,label:"Critical",color:"text-red-600 dark:text-red-400"},{count:d.gaps.filter(a=>a.severity==="important").length,label:"Important",color:"text-amber-600 dark:text-amber-400"},{count:d.passed.length,label:"Passed",color:"text-green-600 dark:text-green-400"}].map(({count:a,label:x,color:v})=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a(`text-base font-bold ${v}`,r==null?void 0:r.statValue,o),children:a}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400",r==null?void 0:r.statLabel,o),children:x})]},x))}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("overflow-y-auto max-h-80",r==null?void 0:r.requirementsList,o),children:i.length===0?jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400 text-center py-4",r==null?void 0:r.emptyState,o),children:"No requirements to display."}):i.map(({gap:a,isPassed:x})=>jsxRuntime.jsx(Er,{gap:a,isPassed:x,onFix:p,classNames:r,unstyled:o},a.requirementId))})]})]})};function dt(d){let p=Date.now()-d;return p<1e4?"just now":p<6e4?`${Math.floor(p/1e3)}s ago`:p<36e5?`${Math.floor(p/6e4)}m ago`:new Date(d).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}var Ir=({lastSavedAt:d,isSaving:p,hasError:r,classNames:o,unstyled:n})=>{let t="idle";if(p?t="saving":r?t="error":d!==null&&(t="saved"),t==="idle")return null;let i=t==="saving"?"Saving\u2026":t==="error"?"Unable to save":`Draft saved ${d?dt(d):""}`;return jsxRuntime.jsxs("div",{"data-ndpr-component":"draft-save-indicator",role:"status","aria-live":"polite","aria-atomic":"true",className:chunkE64TU6IU_js.a(`flex items-center gap-1.5 ${t==="error"?"text-red-500 dark:text-red-400":t==="saving"?"text-gray-400 dark:text-gray-500":"text-green-600 dark:text-green-400"}`,o==null?void 0:o.root,n),children:[t==="saving"&&jsxRuntime.jsxs("svg",{className:"animate-spin w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),t==="saved"&&jsxRuntime.jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),t==="error"&&jsxRuntime.jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})}),jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("text-xs font-medium",o==null?void 0:o.text,n),children:i})]})};var me=({adapter:d,onComplete:p,classNames:r,unstyled:o})=>{let{currentStep:n,nextStep:t,prevStep:i,canProceed:a,context:x,updateOrg:v,updateContext:k,toggleDataCategory:g,togglePurpose:u,addProcessor:b,removeProcessor:h,sections:m,customSections:z,sectionOverrides:J,editSectionContent:Z,addCustomSection:er,removeCustomSection:or,reorderSections:f,complianceResult:D,applyFix:ir,handleExportPDF:Tr,handleExportDOCX:Mr,handleExportHTML:Br,handleExportMarkdown:zr,lastSavedAt:jr,isLoading:qr}=chunkTXXWCB5O_js.e({adapter:d,onComplete:p}),nr=(F,K)=>{let _=URL.createObjectURL(F),H=document.createElement("a");H.href=_,H.download=K,H.click(),URL.revokeObjectURL(_);},Or=()=>chunkMQFZHA2D_js.d(null,null,function*(){let F=yield Tr();nr(F,"privacy-policy.pdf");}),_r=()=>chunkMQFZHA2D_js.d(null,null,function*(){let F=yield Mr();nr(F,"privacy-policy.docx");}),Hr=()=>{let F=Br();navigator.clipboard.writeText(F).catch(()=>{let K=new Blob([F],{type:"text/html"}),_=URL.createObjectURL(K),H=window.open(_,"_blank");H?H.addEventListener("load",()=>URL.revokeObjectURL(_)):URL.revokeObjectURL(_);});},Wr=()=>{let F=zr();navigator.clipboard.writeText(F).catch(()=>{let K=new Blob([F],{type:"text/markdown"});nr(K,"privacy-policy.md");});};return qr?jsxRuntime.jsxs("div",{"data-ndpr-component":"adaptive-policy-wizard",className:chunkE64TU6IU_js.a("flex items-center justify-center min-h-64 text-gray-400 dark:text-gray-500",r==null?void 0:r.root,o),"aria-busy":"true","aria-label":"Loading policy wizard",children:[jsxRuntime.jsxs("svg",{className:"animate-spin w-6 h-6 mr-2",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),jsxRuntime.jsx("span",{className:"text-sm",children:"Loading\u2026"})]}):jsxRuntime.jsx("div",{"data-ndpr-component":"adaptive-policy-wizard",className:chunkE64TU6IU_js.a("min-h-screen bg-gray-50 dark:bg-gray-900",r==null?void 0:r.root,o),children:jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",r==null?void 0:r.container,o),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-center justify-between mb-6",r==null?void 0:r.topBar,o),children:[jsxRuntime.jsx("h1",{className:chunkE64TU6IU_js.a("text-2xl font-bold text-gray-900 dark:text-gray-100",r==null?void 0:r.wizardTitle,o),children:"Privacy Policy Builder"}),jsxRuntime.jsx(Ir,{lastSavedAt:jr,isSaving:false,hasError:false,classNames:r,unstyled:o})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg px-4 mb-6",r==null?void 0:r.stepIndicatorWrapper,o),children:jsxRuntime.jsx(vr,{currentStep:n,classNames:r,unstyled:o})}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex flex-col lg:flex-row gap-6 items-start",r==null?void 0:r.panels,o),children:[jsxRuntime.jsxs("main",{"aria-live":"polite",className:chunkE64TU6IU_js.a("flex-1 min-w-0 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-6",r==null?void 0:r.mainPanel,o),children:[n===1&&jsxRuntime.jsx(yr,{context:x,onUpdateOrg:v,classNames:r,unstyled:o}),n===2&&jsxRuntime.jsx(lr,{categories:x.dataCategories,onToggle:g,classNames:r,unstyled:o}),n===3&&jsxRuntime.jsx(fr,{context:x,onTogglePurpose:u,onUpdateContext:k,onAddProcessor:b,onRemoveProcessor:h,classNames:r,unstyled:o}),n===4&&jsxRuntime.jsx(Lr,{sections:m,customSections:z,sectionOverrides:J,complianceResult:D,onEditSection:Z,onAddCustomSection:er,onRemoveCustomSection:or,onReorderSection:f,onExportPDF:Or,onExportDOCX:_r,onExportHTML:Hr,onExportMarkdown:Wr,classNames:r,unstyled:o}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-center justify-between mt-8 pt-4 border-t border-gray-200 dark:border-gray-700",r==null?void 0:r.navigation,o),children:[jsxRuntime.jsx("button",{type:"button",onClick:i,disabled:n===1,className:chunkE64TU6IU_js.a("px-4 py-2 bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-white rounded-md text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed hover:bg-gray-300 dark:hover:bg-gray-600 transition-colors",r==null?void 0:r.backButton,o),children:"Back"}),jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:jsxRuntime.jsxs("span",{className:chunkE64TU6IU_js.a("text-xs text-gray-400 dark:text-gray-500",r==null?void 0:r.stepCounter,o),children:["Step ",n," of 4"]})}),n<4?jsxRuntime.jsx("button",{type:"button",onClick:t,disabled:!a,className:chunkE64TU6IU_js.a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed transition-colors",r==null?void 0:r.nextButton,o),children:"Next"}):jsxRuntime.jsx("span",{})]})]}),jsxRuntime.jsx("aside",{className:chunkE64TU6IU_js.a("w-full lg:w-80 flex-shrink-0",r==null?void 0:r.sidebarWrapper,o),children:jsxRuntime.jsx($r,{complianceResult:D,onFix:ir,classNames:r,unstyled:o})})]})]})})};
|
|
2
|
+
exports.a=me;//# sourceMappingURL=chunk-YZXUAIYN.js.map
|
|
3
|
+
//# sourceMappingURL=chunk-YZXUAIYN.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {a}from'./chunk-WWT2ZSNU.mjs';function
|
|
1
|
+
import {a}from'./chunk-WWT2ZSNU.mjs';function m(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function w(t,u){if(typeof t=="string"){let a=t,o=u,r=a,n=/\{\{([^}]+)\}\}/g,c;for(;(c=n.exec(a))!==null;){let e=c[1].trim(),i=o[e]||"";r=r.replace(new RegExp(`\\{\\{\\s*${m(e)}\\s*\\}\\}`,"g"),i);}return r}else {let a=t,o=u,r={},n=[];return a.filter(e=>e.included).sort((e,i)=>(e.order||0)-(i.order||0)).forEach(e=>{let i=e.template||e.customContent||e.defaultContent||"",h=/\{\{([^}]+)\}\}/g,p,g=[];for(;(p=h.exec(i))!==null;)g.push(p[1].trim());g.forEach(s=>{let l="";s in o&&(l=o[s]||""),l||n.push(s),i=i.replace(new RegExp(`\\{\\{\\s*${m(s)}\\s*\\}\\}`,"g"),l);}),r[e.id]=i;}),{fullText:Object.values(r).join(`
|
|
2
2
|
|
|
3
|
-
`),sectionTexts:r,missingVariables:Array.from(new Set(n))}}}var
|
|
3
|
+
`),sectionTexts:r,missingVariables:Array.from(new Set(n))}}}var y=[{id:"data-collection",title:"Data Collection",description:"Describes what personal data is collected and how it is obtained.",order:1,required:true,included:true,template:'{{orgName}} ("we", "us", or "our") collects personal data from users of our services at {{website}}. We collect information you provide directly, such as your name, email address, phone number, and any other details you submit through forms or communications. We may also collect data automatically, including IP addresses, browser type, device information, and usage patterns through cookies and similar technologies. All data collection is conducted in accordance with the Nigeria Data Protection Act (NDPA) 2023.',variables:["orgName","website"]},{id:"legal-basis",title:"Legal Basis for Processing",description:"Specifies the lawful basis for processing personal data under the NDPA.",order:2,required:true,included:true,template:`{{orgName}} processes personal data under one or more of the following lawful bases as prescribed by the NDPA 2023:
|
|
4
4
|
|
|
5
5
|
- Consent: where you have given clear, informed, and voluntary consent for a specific purpose.
|
|
6
6
|
- Contract: where processing is necessary to fulfil a contract with you or to take steps at your request before entering a contract.
|
|
@@ -59,5 +59,5 @@ DPO Email: {{dpoEmail}}
|
|
|
59
59
|
|
|
60
60
|
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 violated.
|
|
61
61
|
|
|
62
|
-
This policy is effective as of {{effectiveDate}} and applies to all {{industry}} services provided by {{orgName}}.`,variables:["orgName","address","privacyEmail","website","dpoName","dpoEmail","effectiveDate","industry"]}],
|
|
63
|
-
//# sourceMappingURL=chunk-
|
|
62
|
+
This policy is effective as of {{effectiveDate}} and applies to all {{industry}} services provided by {{orgName}}.`,variables:["orgName","address","privacyEmail","website","dpoName","dpoEmail","effectiveDate","industry"]}],f=[{id:"orgName",name:"orgName",description:"The official name of your organisation.",value:"",inputType:"text",required:true},{id:"website",name:"website",description:"Your organisation's website URL.",value:"",inputType:"url",required:true},{id:"privacyEmail",name:"privacyEmail",description:"Email address for privacy-related enquiries.",value:"",inputType:"email",required:true},{id:"dpoName",name:"dpoName",description:"Full name of your Data Protection Officer.",value:"",inputType:"text",required:false},{id:"dpoEmail",name:"dpoEmail",description:"Email address of your Data Protection Officer.",value:"",inputType:"email",required:false},{id:"address",name:"address",description:"Physical address of your organisation.",value:"",inputType:"textarea",required:false},{id:"industry",name:"industry",description:"The industry or sector your organisation operates in.",value:"",inputType:"text",required:false},{id:"effectiveDate",name:"effectiveDate",description:"The date this privacy policy becomes effective.",value:"",inputType:"date",required:false}];function b(){return {sections:y.map(t=>a({},t)),variables:f.map(t=>a({},t))}}export{w as a,y as b,f as c,b as d};//# sourceMappingURL=chunk-ZEOQYWOE.mjs.map
|
|
63
|
+
//# sourceMappingURL=chunk-ZEOQYWOE.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkP42Z5CFE_js=require('./chunk-P42Z5CFE.js'),chunkELKB2AFZ_js=require('./chunk-ELKB2AFZ.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function H(i,m){return m?chunkELKB2AFZ_js.a(i):{load:()=>null,save:()=>{},remove:()=>{}}}function Y({sections:i,initialAnswers:m={},adapter:v,storageKey:E="ndpr_dpia_data",useLocalStorage:M=true,onComplete:w}){let D=v!=null?v:H(E,M),d=react.useRef(D);d.current=D;let[f,A]=react.useState(0),[a,p]=react.useState(m),[C,g]=react.useState(true);react.useEffect(()=>{let r=false;try{let t=d.current.load();t instanceof Promise?t.then(e=>{r||(e&&p(e),g(!1));},()=>{r||g(!1);}):(t&&p(t),g(!1));}catch(t){r||g(false);}return ()=>{r=true;}},[]);let c=i[f]||null,V=r=>{Promise.resolve(d.current.save(r)).catch(t=>{console.warn("[ndpr-toolkit] Failed to save DPIA answers:",t);});},T=(r,t)=>{p(e=>{let s=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},e),{[r]:t});return V(s),s});},I=r=>r.showWhen?r.showWhen.every(t=>{let e=a[t.questionId];switch(t.operator){case "equals":return e===t.value;case "contains":return Array.isArray(e)?e.includes(String(t.value)):false;case "greaterThan":return typeof e=="number"&&typeof t.value=="number"?e>t.value:false;case "lessThan":return typeof e=="number"&&typeof t.value=="number"?e<t.value:false;default:return true}}):true,P=()=>c?c.questions.filter(I):[],b=()=>c?P().every(t=>{if(!t.required)return true;let e=a[t.id];return !(e==null||typeof e=="string"&&e.trim()===""||Array.isArray(e)&&e.length===0)}):false,_=()=>{let r={};return c&&P().forEach(e=>{if(!e.required)return;let s=a[e.id];s==null||typeof s=="string"&&s.trim()===""?r[e.id]="This question is required":Array.isArray(s)&&s.length===0&&(r[e.id]="At least one option must be selected");}),r},$=()=>b()&&f<i.length-1?(A(r=>r+1),true):false,O=()=>f>0?(A(r=>r-1),true):false,U=r=>r>=0&&r<i.length?(A(r),true):false,B=()=>i.every(r=>r.questions.filter(I).every(e=>{if(!e.required)return true;let s=a[e.id];return !(s==null||typeof s=="string"&&s.trim()===""||Array.isArray(s)&&s.length===0)})),F=()=>{let r=[];return i.forEach(t=>{t.questions.forEach(e=>{let s=a[e.id];if(s!=null&&e.riskLevel)if(["select","radio","checkbox"].includes(e.type)&&e.options)(Array.isArray(s)?s:[s]).forEach(o=>{var y;let l=(y=e.options)==null?void 0:y.find(u=>u.value===o);if(l!=null&&l.riskLevel){let u=l.riskLevel,S=u==="low"?1:u==="medium"?3:5,k=u==="low"?1:u==="medium"?3:5;r.push({id:`risk_${r.length+1}`,description:`${e.text} - ${l.label}`,likelihood:S,impact:k,score:S*k,level:u,mitigated:false,relatedQuestionIds:[e.id]});}});else {let n=e.riskLevel,o=n==="low"?1:n==="medium"?3:5,l=n==="low"?1:n==="medium"?3:5;r.push({id:`risk_${r.length+1}`,description:e.text,likelihood:o,impact:l,score:o*l,level:n,mitigated:false,relatedQuestionIds:[e.id]});}});}),r},W=(r,t,e)=>{let s=F(),n={id:`dpia_${Date.now()}`,title:t,processingDescription:e,startedAt:Date.now(),completedAt:Date.now(),assessor:r,answers:a,risks:s,overallRiskLevel:"low",canProceed:true,conclusion:"",version:"1.0"},o=chunkP42Z5CFE_js.a(n);return n.overallRiskLevel=o.overallRiskLevel,n.canProceed=o.canProceed,n.conclusion=o.canProceed?"Based on the assessment, the processing can proceed with appropriate safeguards.":"Based on the assessment, the processing should not proceed without further mitigation measures.",n.recommendations=o.recommendations,w&&w(n),n},K=()=>{p({}),A(0),Promise.resolve(d.current.remove()).catch(r=>{console.warn("[ndpr-toolkit] Failed to remove DPIA data:",r);});},j=(()=>{let r=0,t=0;return i.forEach(e=>{e.questions.forEach(s=>{if(s.required&&I(s)){t++;let n=a[s.id];n!=null&&!(typeof n=="string"&&n.trim()==="")&&!(Array.isArray(n)&&n.length===0)&&r++;}});}),t>0?Math.round(r/t*100):0})();return {currentSectionIndex:f,currentSection:c,answers:a,updateAnswer:T,nextSection:$,prevSection:O,goToSection:U,isCurrentSectionValid:b,getCurrentSectionErrors:_,isComplete:B,completeDPIA:W,getVisibleQuestions:P,resetDPIA:K,progress:j,isLoading:C}}exports.a=Y;//# sourceMappingURL=chunk-ZGJA7OO4.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-ZGJA7OO4.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {d,c,a as a$1,b as b$1}from'./chunk-TXBZPCGF.mjs';import {a as a$2}from'./chunk-AYKLAEOU.mjs';import {b,a}from'./chunk-WWT2ZSNU.mjs';import {useState,useMemo,useCallback}from'react';import {jsx,jsxs}from'react/jsx-runtime';var q={name:"",description:"",lawfulBasis:"consent",lawfulBasisJustification:"",dataCategories:"",involvesSensitiveData:false,sensitiveDataCondition:"",dataSubjectCategories:"",purposes:"",retentionPeriod:"",retentionJustification:"",recipients:"",crossBorderTransfer:false,reviewDate:"",liaPurposeTest:"",liaNecessityTest:"",liaBalancingTest:"",liaSafeguards:"",liaConclusion:""},Q=[{value:"consent",label:"Consent"},{value:"contract",label:"Contract"},{value:"legal_obligation",label:"Legal Obligation"},{value:"vital_interests",label:"Vital Interests"},{value:"public_interest",label:"Public Interest"},{value:"legitimate_interests",label:"Legitimate Interests"}],X=[{value:"explicit_consent",label:"Explicit Consent"},{value:"employment_law",label:"Employment Law"},{value:"vital_interests_incapable",label:"Vital Interests (Incapable)"},{value:"nonprofit_legitimate",label:"Nonprofit Legitimate Activities"},{value:"publicly_available",label:"Publicly Available Data"},{value:"legal_claims",label:"Legal Claims"},{value:"substantial_public_interest",label:"Substantial Public Interest"},{value:"health_purposes",label:"Health Purposes"},{value:"public_health",label:"Public Health"},{value:"archiving_research",label:"Archiving / Research"}],Ce=({activities:c$1,onAddActivity:F,onUpdateActivity:_,onArchiveActivity:j,title:Z="Lawful Basis Tracker",description:ee="Document and track the lawful basis for each processing activity as required by NDPA 2023 Section 25.",className:te="",buttonClassName:m="",showSummary:re=true,showComplianceGaps:ie=true,classNames:r,unstyled:o})=>{let[h,v]=useState("list"),[a$3,w]=useState(q),[f,I]=useState(null),[J,ae]=useState(null),[A,ne]=useState("all"),[B,oe]=useState("all"),[S,de]=useState(""),[g,k]=useState([]),V=useMemo(()=>{let e=[...c$1];if(A!=="all"&&(e=e.filter(l=>l.status===A)),B!=="all"&&(e=e.filter(l=>l.lawfulBasis===B)),S){let l=S.toLowerCase();e=e.filter(u=>u.name.toLowerCase().includes(l)||u.description.toLowerCase().includes(l)||u.purposes.some(N=>N.toLowerCase().includes(l)));}return e.sort((l,u)=>u.updatedAt-l.updatedAt),e},[c$1,A,B,S]),C=useCallback(e=>new Date(e).toLocaleDateString(),[]),P=useMemo(()=>d(c$1),[c$1]),x=useMemo(()=>c(c$1),[c$1]),D=useCallback(e=>e.split(",").map(l=>l.trim()).filter(l=>l.length>0),[]),le=useCallback(()=>{w(q),I(null),k([]),v("form");},[]),M=useCallback(e=>{w({name:e.name,description:e.description,lawfulBasis:e.lawfulBasis,lawfulBasisJustification:e.lawfulBasisJustification,dataCategories:e.dataCategories.join(", "),involvesSensitiveData:e.involvesSensitiveData,sensitiveDataCondition:e.sensitiveDataCondition||"",dataSubjectCategories:e.dataSubjectCategories.join(", "),purposes:e.purposes.join(", "),retentionPeriod:e.retentionPeriod,retentionJustification:e.retentionJustification||"",recipients:(e.recipients||[]).join(", "),crossBorderTransfer:e.crossBorderTransfer,reviewDate:e.reviewDate?new Date(e.reviewDate).toISOString().split("T")[0]:"",liaPurposeTest:"",liaNecessityTest:"",liaBalancingTest:"",liaSafeguards:"",liaConclusion:""}),I(e.id),k([]),v("form");},[]),se=useCallback(()=>{let e={name:a$3.name,description:a$3.description,lawfulBasis:a$3.lawfulBasis,lawfulBasisJustification:a$3.lawfulBasisJustification,dataCategories:D(a$3.dataCategories),involvesSensitiveData:a$3.involvesSensitiveData,sensitiveDataCondition:a$3.sensitiveDataCondition||void 0,dataSubjectCategories:D(a$3.dataSubjectCategories),purposes:D(a$3.purposes),retentionPeriod:a$3.retentionPeriod,retentionJustification:a$3.retentionJustification||void 0,recipients:a$3.recipients?D(a$3.recipients):void 0,crossBorderTransfer:a$3.crossBorderTransfer,reviewDate:a$3.reviewDate?new Date(a$3.reviewDate).getTime():void 0,status:"active"},l=b(a({},e),{id:f||"temp",createdAt:Date.now(),updatedAt:Date.now()}),u=a$1(l);if(!u.isValid){k(u.errors);return}f&&_?_(f,e):F&&F(e),w(q),I(null),k([]),v("list");},[a$3,f,_,F,D]),G=useCallback(e=>{j&&j(e);},[j]),ue=useCallback(e=>{ae(e),v("detail");},[]),n=useMemo(()=>J?c$1.find(e=>e.id===J):null,[c$1,J]),H=useCallback(e=>{let l={active:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",inactive:"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200",under_review:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",archived:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"},u={active:"Active",inactive:"Inactive",under_review:"Under Review",archived:"Archived"};return jsx("span",{className:a$2(`px-2 py-1 rounded text-xs font-medium ${l[e]}`,r==null?void 0:r.statusBadge,o),children:u[e]})},[r==null?void 0:r.statusBadge,o]),U=useCallback(e=>{let l={consent:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",contract:"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200",legal_obligation:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",vital_interests:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",public_interest:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",legitimate_interests:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200"},u={consent:"Consent",contract:"Contract",legal_obligation:"Legal Obligation",vital_interests:"Vital Interests",public_interest:"Public Interest",legitimate_interests:"Legitimate Interests"};return jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${l[e]}`,children:u[e]})},[]),Y=useCallback(e=>e.dpoApproval?e.dpoApproval.approved?jsx("span",{className:"px-2 py-1 rounded text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",children:"Approved"}):jsx("span",{className:"px-2 py-1 rounded text-xs font-medium bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",children:"Pending Approval"}):jsx("span",{className:"px-2 py-1 rounded text-xs font-medium bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-400",children:"No DPO Review"}),[]),pe=()=>jsxs("div",{className:a$2("grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",r==null?void 0:r.summary,o),role:"status","aria-label":"Compliance summary",children:[jsxs("div",{className:a$2("bg-blue-50 dark:bg-blue-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-blue-800 dark:text-blue-200",children:P.totalActivities}),jsx("p",{className:"text-sm text-blue-600 dark:text-blue-300",children:"Total Activities"})]}),jsxs("div",{className:a$2("bg-orange-50 dark:bg-orange-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-orange-800 dark:text-orange-200",children:P.sensitiveDataActivities}),jsx("p",{className:"text-sm text-orange-600 dark:text-orange-300",children:"Sensitive Data"})]}),jsxs("div",{className:a$2("bg-purple-50 dark:bg-purple-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-purple-800 dark:text-purple-200",children:P.crossBorderActivities}),jsx("p",{className:"text-sm text-purple-600 dark:text-purple-300",children:"Cross-Border Transfers"})]}),jsxs("div",{className:a$2("bg-red-50 dark:bg-red-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-red-800 dark:text-red-200",children:P.activitiesWithoutApproval.length}),jsx("p",{className:"text-sm text-red-600 dark:text-red-300",children:"Pending Approval"})]})]}),R=useMemo(()=>x.filter(e=>e.severity==="high"),[x]),E=useMemo(()=>x.filter(e=>e.severity==="medium"),[x]),ge=()=>x.length===0?jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-4 rounded-lg mb-6",role:"status","aria-label":"No compliance gaps",children:[jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"No compliance gaps detected."}),jsx("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:"All processing activities appear to be properly documented."})]}):jsxs("div",{className:"mb-6",role:"status","aria-label":`${x.length} compliance gaps detected`,children:[R.length>0&&jsxs("div",{className:a$2("bg-red-50 dark:bg-red-900/20 p-4 rounded-lg mb-3",r==null?void 0:r.gapAlert,o),children:[jsxs("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium mb-2",children:["High Priority (",R.length,")"]}),jsx("ul",{className:"space-y-1",children:R.map((e,l)=>jsx("li",{className:"text-xs text-red-700 dark:text-red-300",children:e.description},l))})]}),E.length>0&&jsxs("div",{className:a$2("bg-yellow-50 dark:bg-yellow-900/20 p-4 rounded-lg",r==null?void 0:r.gapAlert,o),children:[jsxs("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium mb-2",children:["Medium Priority (",E.length,")"]}),jsx("ul",{className:"space-y-1",children:E.map((e,l)=>jsx("li",{className:"text-xs text-yellow-700 dark:text-yellow-300",children:e.description},l))})]})]}),W=useCallback(()=>{v("list"),k([]);},[]),ce=useCallback(()=>{v("list");},[]),s=useCallback((e,l)=>{w(u=>b(a({},u),{[e]:l}));},[]),be=useCallback(e=>{w(l=>b(a({},l),{involvesSensitiveData:e,sensitiveDataCondition:e?l.sensitiveDataCondition:""}));},[]),me=()=>jsxs("div",{className:a$2("",r==null?void 0:r.form,o),children:[jsxs("div",{className:a$2("flex justify-between items-center mb-4",r==null?void 0:r.header,o),children:[jsx("h3",{className:"text-lg font-medium",children:f?"Edit Processing Activity":"New Processing Activity"}),jsx("button",{onClick:W,className:`px-4 py-2 text-gray-600 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded hover:bg-gray-200 dark:hover:bg-gray-600 ${m}`,children:"Cancel"})]}),g.length>0&&jsxs("div",{id:"form-errors",className:"bg-red-50 dark:bg-red-900/20 p-4 rounded-lg mb-4",role:"alert",children:[jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium mb-2",children:"Please correct the following errors:"}),jsx("ul",{className:"list-disc list-inside space-y-1",children:g.map((e,l)=>jsx("li",{className:"text-xs text-red-700 dark:text-red-300",children:e},l))})]}),jsxs("div",{className:"space-y-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"activityName",className:"block text-sm font-medium mb-1",children:"Activity Name *"}),jsx("input",{type:"text",id:"activityName",value:a$3.name,onChange:e=>s("name",e.target.value),placeholder:"e.g., Customer Account Management","aria-required":"true","aria-describedby":g.length>0?"form-errors":void 0,className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"activityDescription",className:"block text-sm font-medium mb-1",children:"Description *"}),jsx("textarea",{id:"activityDescription",value:a$3.description,onChange:e=>s("description",e.target.value),placeholder:"Describe what processing is performed...",rows:3,"aria-required":"true","aria-describedby":g.length>0?"form-errors":void 0,className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"lawfulBasis",className:"block text-sm font-medium mb-1",children:"Lawful Basis (NDPA Section 25) *"}),jsx("select",{id:"lawfulBasis",value:a$3.lawfulBasis,onChange:e=>s("lawfulBasis",e.target.value),"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:Q.map(e=>jsx("option",{value:e.value,children:e.label},e.value))}),jsx("p",{className:"mt-1 text-xs text-gray-600 dark:text-gray-400",children:b$1(a$3.lawfulBasis)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"justification",className:"block text-sm font-medium mb-1",children:"Lawful Basis Justification *"}),jsx("textarea",{id:"justification",value:a$3.lawfulBasisJustification,onChange:e=>s("lawfulBasisJustification",e.target.value),placeholder:"Document why this lawful basis applies to this processing activity...",rows:3,"aria-required":"true","aria-describedby":g.length>0?"form-errors":void 0,className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),a$3.lawfulBasis==="legitimate_interests"&&jsxs("div",{className:"border border-indigo-200 dark:border-indigo-800 rounded-lg p-4 bg-indigo-50 dark:bg-indigo-900/20",children:[jsx("h4",{className:"text-sm font-semibold text-indigo-800 dark:text-indigo-200 mb-3",children:"Legitimate Interest Assessment (LIA)"}),jsx("p",{className:"text-xs text-indigo-600 dark:text-indigo-300 mb-4",children:"NDPA Section 25(1)(f) requires a balancing test when relying on legitimate interests."}),jsxs("div",{className:"space-y-3",children:[jsxs("div",{children:[jsx("label",{htmlFor:"liaPurpose",className:"block text-sm font-medium mb-1",children:"Purpose Test"}),jsx("textarea",{id:"liaPurpose",value:a$3.liaPurposeTest,onChange:e=>s("liaPurposeTest",e.target.value),placeholder:"Describe the legitimate interest being pursued...",rows:2,className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"liaNecessity",className:"block text-sm font-medium mb-1",children:"Necessity Test"}),jsx("textarea",{id:"liaNecessity",value:a$3.liaNecessityTest,onChange:e=>s("liaNecessityTest",e.target.value),placeholder:"Explain why this processing is necessary for the stated purpose...",rows:2,className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"liaBalancing",className:"block text-sm font-medium mb-1",children:"Balancing Test"}),jsx("textarea",{id:"liaBalancing",value:a$3.liaBalancingTest,onChange:e=>s("liaBalancingTest",e.target.value),placeholder:"Assess the impact on data subjects' rights and interests...",rows:2,className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"liaSafeguards",className:"block text-sm font-medium mb-1",children:"Safeguards"}),jsx("input",{type:"text",id:"liaSafeguards",value:a$3.liaSafeguards,onChange:e=>s("liaSafeguards",e.target.value),placeholder:"List safeguards (comma-separated)...",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"liaConclusion",className:"block text-sm font-medium mb-1",children:"Conclusion"}),jsx("textarea",{id:"liaConclusion",value:a$3.liaConclusion,onChange:e=>s("liaConclusion",e.target.value),placeholder:"State your overall conclusion...",rows:2,className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dataCategories",className:"block text-sm font-medium mb-1",children:"Data Categories *"}),jsx("input",{type:"text",id:"dataCategories",value:a$3.dataCategories,onChange:e=>s("dataCategories",e.target.value),placeholder:"e.g., Name, Email, Phone Number (comma-separated)","aria-required":"true","aria-describedby":g.length>0?"form-errors":void 0,className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsx("div",{children:jsxs("label",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",checked:a$3.involvesSensitiveData,onChange:e=>be(e.target.checked),className:"rounded border-gray-300 dark:border-gray-600 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("span",{className:"text-sm font-medium",children:"Involves Sensitive Personal Data (NDPA Section 27)"})]})}),a$3.involvesSensitiveData&&jsxs("div",{children:[jsx("label",{htmlFor:"sensitiveCondition",className:"block text-sm font-medium mb-1",children:"Sensitive Data Condition (NDPA Section 27) *"}),jsxs("select",{id:"sensitiveCondition",value:a$3.sensitiveDataCondition,onChange:e=>s("sensitiveDataCondition",e.target.value),"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:[jsx("option",{value:"",children:"Select a condition..."}),X.map(e=>jsx("option",{value:e.value,children:e.label},e.value))]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dataSubjectCategories",className:"block text-sm font-medium mb-1",children:"Data Subject Categories *"}),jsx("input",{type:"text",id:"dataSubjectCategories",value:a$3.dataSubjectCategories,onChange:e=>s("dataSubjectCategories",e.target.value),placeholder:"e.g., Customers, Employees, Vendors (comma-separated)","aria-required":"true","aria-describedby":g.length>0?"form-errors":void 0,className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"purposes",className:"block text-sm font-medium mb-1",children:"Processing Purposes *"}),jsx("input",{type:"text",id:"purposes",value:a$3.purposes,onChange:e=>s("purposes",e.target.value),placeholder:"e.g., Account management, Service delivery (comma-separated)","aria-required":"true","aria-describedby":g.length>0?"form-errors":void 0,className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"retentionPeriod",className:"block text-sm font-medium mb-1",children:"Retention Period *"}),jsx("input",{type:"text",id:"retentionPeriod",value:a$3.retentionPeriod,onChange:e=>s("retentionPeriod",e.target.value),placeholder:"e.g., 3 years after account closure","aria-required":"true","aria-describedby":g.length>0?"form-errors":void 0,className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"retentionJustification",className:"block text-sm font-medium mb-1",children:"Retention Justification"}),jsx("input",{type:"text",id:"retentionJustification",value:a$3.retentionJustification,onChange:e=>s("retentionJustification",e.target.value),placeholder:"Reason for the retention period",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"recipients",className:"block text-sm font-medium mb-1",children:"Recipients"}),jsx("input",{type:"text",id:"recipients",value:a$3.recipients,onChange:e=>s("recipients",e.target.value),placeholder:"e.g., Payment processor, Cloud provider (comma-separated)",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsx("div",{children:jsxs("label",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",checked:a$3.crossBorderTransfer,onChange:e=>s("crossBorderTransfer",e.target.checked),className:"rounded border-gray-300 dark:border-gray-600 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("span",{className:"text-sm font-medium",children:"Involves Cross-Border Transfer Outside Nigeria"})]})}),jsxs("div",{children:[jsx("label",{htmlFor:"reviewDate",className:"block text-sm font-medium mb-1",children:"Next Review Date"}),jsx("input",{type:"date",id:"reviewDate",value:a$3.reviewDate,onChange:e=>s("reviewDate",e.target.value),className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{className:"flex justify-end space-x-3 pt-4",children:[jsx("button",{onClick:W,className:`px-4 py-2 text-gray-600 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded hover:bg-gray-200 dark:hover:bg-gray-600 ${m}`,children:"Cancel"}),jsx("button",{onClick:se,className:a$2(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${m}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:f?"Update Activity":"Create Activity"})]})]})]}),ve=()=>{var l;if(!n)return jsx("div",{className:"flex items-center justify-center h-64 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Activity not found."})});let e=a$1(n);return jsxs("div",{children:[jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxs("div",{children:[jsx("button",{onClick:ce,className:"text-sm text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline mb-2","aria-label":"Back to activities list",children:"Back to list"}),jsx("h3",{className:"text-lg font-medium",children:n.name})]}),jsxs("div",{className:"flex space-x-2",children:[U(n.lawfulBasis),H(n.status),Y(n)]})]}),e.warnings.length>0&&jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md mb-4",children:[jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium mb-1",children:"Warnings"}),jsx("ul",{className:"list-disc list-inside space-y-1",children:e.warnings.map((u,N)=>jsx("li",{className:"text-xs text-yellow-700 dark:text-yellow-300",children:u},N))})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Description:"})," ",n.description]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Lawful Basis:"})," ",b$1(n.lawfulBasis)]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Justification:"})," ",n.lawfulBasisJustification]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Data Categories:"})," ",n.dataCategories.join(", ")]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Data Subject Categories:"})," ",n.dataSubjectCategories.join(", ")]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Purposes:"})," ",n.purposes.join(", ")]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Retention Period:"})," ",n.retentionPeriod,n.retentionJustification&&jsxs("span",{className:"text-gray-600 dark:text-gray-400",children:[" ","(",n.retentionJustification,")"]})]})]})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Sensitive Data:"})," ",n.involvesSensitiveData?"Yes":"No",n.sensitiveDataCondition&&jsxs("span",{children:[" ","(Condition:"," ",((l=X.find(u=>u.value===n.sensitiveDataCondition))==null?void 0:l.label)||n.sensitiveDataCondition,")"]})]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Cross-Border Transfer:"})," ",n.crossBorderTransfer?"Yes":"No"]}),n.recipients&&n.recipients.length>0&&jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Recipients:"})," ",n.recipients.join(", ")]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Created:"})," ",C(n.createdAt)]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Last Updated:"})," ",C(n.updatedAt)]}),n.reviewDate&&jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Next Review:"})," ",C(n.reviewDate),n.reviewDate<Date.now()&&jsx("span",{className:"text-red-600 dark:text-red-400 font-medium",children:" (Overdue)"})]})]})]}),n.dpoApproval&&jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md mb-6",children:[jsx("h4",{className:"text-sm font-semibold mb-2",children:"DPO Approval"}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Status:"})," ",n.dpoApproval.approved?"Approved":"Not Approved"]}),jsxs("p",{className:"text-sm mt-1",children:[jsx("span",{className:"font-medium",children:"Approved By:"})," ",n.dpoApproval.approvedBy]}),jsxs("p",{className:"text-sm mt-1",children:[jsx("span",{className:"font-medium",children:"Date:"})," ",C(n.dpoApproval.approvedAt)]}),n.dpoApproval.notes&&jsxs("p",{className:"text-sm mt-1",children:[jsx("span",{className:"font-medium",children:"Notes:"})," ",n.dpoApproval.notes]})]}),jsxs("div",{className:"flex space-x-3",children:[jsx("button",{onClick:()=>M(n),"aria-label":`Edit ${n.name}`,className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${m}`,children:"Edit"}),n.status!=="archived"&&jsx("button",{onClick:()=>G(n.id),"aria-label":`Archive ${n.name}`,className:`px-4 py-2 bg-gray-600 text-white rounded hover:bg-gray-700 ${m}`,children:"Archive"})]})]})},fe=()=>jsxs("div",{children:[jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-4 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"basisFilter",className:"block text-sm font-medium mb-1",children:"Lawful Basis"}),jsxs("select",{id:"basisFilter",value:B,onChange:e=>oe(e.target.value),"aria-label":"Filter by lawful basis",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:[jsx("option",{value:"all",children:"All Bases"}),Q.map(e=>jsx("option",{value:e.value,children:e.label},e.value))]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"statusFilterSelect",className:"block text-sm font-medium mb-1",children:"Status"}),jsxs("select",{id:"statusFilterSelect",value:A,onChange:e=>ne(e.target.value),"aria-label":"Filter by status",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:[jsx("option",{value:"all",children:"All Statuses"}),jsx("option",{value:"active",children:"Active"}),jsx("option",{value:"inactive",children:"Inactive"}),jsx("option",{value:"under_review",children:"Under Review"}),jsx("option",{value:"archived",children:"Archived"})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"searchInput",className:"block text-sm font-medium mb-1",children:"Search"}),jsx("input",{type:"text",id:"searchInput",value:S,onChange:e=>de(e.target.value),placeholder:"Search activities...",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsx("div",{className:"flex items-end",children:jsx("button",{onClick:le,className:a$2(`w-full px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${m}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:"Add Activity"})})]}),V.length===0?jsx("div",{className:"flex items-center justify-center h-32 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No processing activities found."})}):jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:a$2("w-full text-sm text-left",r==null?void 0:r.table,o),children:[jsx("thead",{className:a$2("text-xs uppercase bg-gray-50 dark:bg-gray-700",r==null?void 0:r.tableHeader,o),children:jsxs("tr",{children:[jsx("th",{className:"px-4 py-3",children:"Activity"}),jsx("th",{className:"px-4 py-3",children:"Lawful Basis"}),jsx("th",{className:"px-4 py-3",children:"Status"}),jsx("th",{className:"px-4 py-3",children:"DPO Approval"}),jsx("th",{className:"px-4 py-3",children:"Sensitive Data"}),jsx("th",{className:"px-4 py-3",children:"Last Updated"}),jsx("th",{className:"px-4 py-3",children:"Actions"})]})}),jsx("tbody",{children:V.map(e=>jsxs("tr",{className:a$2("border-b border-gray-200 dark:border-gray-600 hover:bg-gray-50 dark:hover:bg-gray-700",r==null?void 0:r.tableRow,o),children:[jsxs("td",{className:"px-4 py-3",children:[jsx("button",{onClick:()=>ue(e.id),className:"font-medium text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline text-left",children:e.name}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mt-1 truncate max-w-xs",children:e.description})]}),jsx("td",{className:"px-4 py-3",children:U(e.lawfulBasis)}),jsx("td",{className:"px-4 py-3",children:H(e.status)}),jsx("td",{className:"px-4 py-3",children:Y(e)}),jsx("td",{className:"px-4 py-3",children:jsx("span",{className:`text-xs ${e.involvesSensitiveData?"text-orange-600 dark:text-orange-400 font-medium":"text-gray-600 dark:text-gray-400"}`,children:e.involvesSensitiveData?"Yes":"No"})}),jsx("td",{className:"px-4 py-3 text-xs text-gray-600 dark:text-gray-400",children:C(e.updatedAt)}),jsx("td",{className:"px-4 py-3",children:jsxs("div",{className:"flex space-x-2",children:[jsx("button",{onClick:()=>M(e),"aria-label":`Edit ${e.name}`,className:"text-xs text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline",children:"Edit"}),e.status!=="archived"&&jsx("button",{onClick:()=>G(e.id),"aria-label":`Archive ${e.name}`,className:"text-xs text-gray-600 dark:text-gray-400 hover:underline",children:"Archive"})]})})]},e.id))})]})})]});return jsxs("div",{className:a$2(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${te}`,r==null?void 0:r.root,o),children:[jsx("h2",{className:a$2("text-xl font-bold mb-2",r==null?void 0:r.title,o),children:Z}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:ee}),re&&h==="list"&&pe(),ie&&h==="list"&&ge(),h==="list"&&fe(),h==="form"&&me(),h==="detail"&&ve()]})};export{Ce as a};//# sourceMappingURL=chunk-ZT7KNFAU.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-ZT7KNFAU.mjs.map
|