@tantainnovative/ndpr-toolkit 3.2.1 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -4
- 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/breach.js +1 -1
- package/dist/breach.mjs +1 -1
- package/dist/chunk-25OOUES4.js +2 -0
- package/dist/chunk-2AW7KAZO.mjs +2 -0
- package/dist/chunk-4JKTIR33.mjs +2 -0
- package/dist/chunk-5BUS6AI7.js +2 -0
- package/dist/chunk-5ECDPRSZ.js +7 -0
- package/dist/chunk-5X32J5IA.mjs +2 -0
- package/dist/chunk-6FGCGLH5.mjs +2 -0
- package/dist/chunk-6YN73KR7.mjs +2 -0
- package/dist/chunk-75TJPK2N.mjs +2 -0
- package/dist/{chunk-NXQMU36Z.mjs → chunk-7D2OIPHH.mjs} +2 -2
- package/dist/chunk-C4YM4UMI.js +2 -0
- package/dist/{chunk-EH2I4L7M.mjs → chunk-CDZDT2OS.mjs} +14 -10
- package/dist/chunk-CYU6YUJQ.mjs +81 -0
- package/dist/chunk-DCJK5OZT.mjs +2 -0
- package/dist/chunk-EKHBORAH.js +81 -0
- package/dist/chunk-ENIMJ6SQ.js +2 -0
- package/dist/chunk-FLKJSGR7.mjs +94 -0
- package/dist/chunk-FWLPJ5YI.js +94 -0
- package/dist/chunk-GMLCWGNJ.js +7 -0
- package/dist/chunk-GXLSOZCH.mjs +2 -0
- package/dist/{chunk-NRQELKAE.js → chunk-JKKRPS4P.js} +2 -2
- package/dist/chunk-LETEUS5X.mjs +2 -0
- package/dist/chunk-M2TPT5GB.js +2 -0
- package/dist/chunk-MCWV7S2G.js +2 -0
- package/dist/chunk-NBSVFQ5G.js +2 -0
- package/dist/chunk-OPYQIJKY.js +2 -0
- package/dist/chunk-OYR3L4XS.mjs +7 -0
- package/dist/chunk-QF6XNKU6.mjs +2 -0
- package/dist/{chunk-256APOQM.js → chunk-QJ3JNHO7.js} +2 -2
- package/dist/{chunk-Q7VHB64E.mjs → chunk-QNCGRCAX.mjs} +2 -2
- package/dist/chunk-TI2M7H6R.mjs +7 -0
- package/dist/{chunk-KVOGOLIR.js → chunk-TXXWCB5O.js} +14 -10
- package/dist/{chunk-44W4H2EY.js → chunk-UGY5ZYUG.js} +2 -2
- package/dist/chunk-UO6QPJLH.js +2 -0
- package/dist/chunk-UX6ZZNEM.mjs +3 -0
- package/dist/chunk-XFUEZ3MP.mjs +2 -0
- package/dist/chunk-XHSHPB74.js +2 -0
- package/dist/chunk-XSEZDQLB.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-Z6IIMLZU.mjs +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 +25 -9
- package/dist/core.d.ts +25 -9
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/cross-border.d.mts +70 -3
- package/dist/cross-border.d.ts +70 -3
- 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 +8 -8
- package/dist/hooks.d.ts +8 -8
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/index.d.mts +13 -13
- package/dist/index.d.ts +13 -13
- 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 +6 -6
- package/dist/policy.d.ts +6 -6
- 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/{useCrossBorderTransfer-BGNZt2lk.d.mts → useCrossBorderTransfer-DixjLjN1.d.mts} +1 -1
- package/dist/{useCrossBorderTransfer-COqjgjsu.d.ts → useCrossBorderTransfer-DvSq06lv.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/dist/{useDefaultPrivacyPolicy-C-mG-A5S.d.ts → useDefaultPrivacyPolicy-DvCbeEl1.d.ts} +5 -1
- package/dist/{useDefaultPrivacyPolicy-BsYttRey.d.mts → useDefaultPrivacyPolicy-ySWU7nc-.d.mts} +5 -1
- package/package.json +7 -5
- package/dist/chunk-2FWCVWKN.js +0 -2
- package/dist/chunk-3DJGO6WG.js +0 -2
- package/dist/chunk-3UWT64FI.mjs +0 -2
- package/dist/chunk-4JUDKBA2.mjs +0 -7
- package/dist/chunk-4XCL62MJ.mjs +0 -2
- package/dist/chunk-555WWZ3W.js +0 -2
- package/dist/chunk-6BXUVS6E.js +0 -81
- package/dist/chunk-6RQGQZT2.js +0 -2
- package/dist/chunk-CL53OI3I.js +0 -7
- package/dist/chunk-E63VPR7U.js +0 -2
- package/dist/chunk-ELKEZEV5.mjs +0 -2
- package/dist/chunk-ER7X6E36.js +0 -2
- package/dist/chunk-FDDI426Y.mjs +0 -2
- package/dist/chunk-FOXZRRMW.mjs +0 -2
- package/dist/chunk-FY5G6DGZ.js +0 -7
- package/dist/chunk-GOD4LA2J.mjs +0 -2
- package/dist/chunk-I23WPZNQ.mjs +0 -94
- package/dist/chunk-IQF726GS.js +0 -2
- package/dist/chunk-IR7VCBWV.mjs +0 -2
- package/dist/chunk-K45S6YQV.mjs +0 -2
- package/dist/chunk-KBAFOVE3.js +0 -2
- package/dist/chunk-KBP26GLC.js +0 -2
- package/dist/chunk-MDWG2KDA.mjs +0 -2
- package/dist/chunk-NN233SGA.mjs +0 -3
- package/dist/chunk-NPI5T6NH.mjs +0 -7
- package/dist/chunk-NUDVUAD4.mjs +0 -81
- package/dist/chunk-PM7O5IGE.mjs +0 -2
- package/dist/chunk-QH6YUVJS.js +0 -2
- package/dist/chunk-QKK5S54L.mjs +0 -2
- package/dist/chunk-QY7PD5XB.js +0 -94
- package/dist/chunk-TVW6KBVV.mjs +0 -2
- package/dist/chunk-UDNRAQLE.js +0 -3
- package/dist/chunk-UNKXYVXY.js +0 -2
- package/dist/chunk-V37BM2LF.js +0 -2
- package/dist/chunk-V3MXWGXU.mjs +0 -2
- package/dist/chunk-VK27WVV3.js +0 -2
- package/dist/chunk-XQ4M5FHC.mjs +0 -2
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
'use strict';var chunkBKRETVJ6_js=require('./chunk-BKRETVJ6.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var xe=({breachData:g,initialAssessment:u={},onComplete:w,title:_="Breach Risk Assessment",description:K="Assess the risk level of this data breach to determine notification requirements under NDPA Section 40.",submitButtonText:Z="Complete Assessment",className:ae="",buttonClassName:Q="",classNames:v={},unstyled:n=false,showBreachSummary:l=true,showNotificationRequirements:C=true})=>{let[L,se]=react.useState(u.confidentialityImpact||3),[I,b]=react.useState(u.integrityImpact||3),[P,S]=react.useState(u.availabilityImpact||3),[j,T]=react.useState(u.harmLikelihood||3),[q,F]=react.useState(u.harmSeverity||3),[U,E]=react.useState(u.risksToRightsAndFreedoms!==void 0?u.risksToRightsAndFreedoms:false),[H,M]=react.useState(u.highRisksToRightsAndFreedoms!==void 0?u.highRisksToRightsAndFreedoms:false),[X,ie]=react.useState(u.justification||""),[Y,re]=react.useState(0),[R,h]=react.useState("low"),[x,f]=react.useState(false),[y,z]=react.useState(0),[O,ee]=react.useState(0),[p,k]=react.useState(false),[G]=react.useState(()=>Date.now());react.useEffect(()=>{let V=L*.2+I*.1+P*.1+j*.3+q*.3;re(Number(V.toFixed(1)));let J;V<2?J="low":V<3?J="medium":V<4?J="high":J="critical",h(J),f(U||J==="high"||J==="critical");let de=g.discoveredAt+4320*60*1e3;z(de);let pe=Date.now(),ge=(de-pe)/(3600*1e3);ee(Number(ge.toFixed(1)));},[L,I,P,j,q,U,g.discoveredAt]);let B=d=>new Date(d).toLocaleString(),s=d=>{d.preventDefault();let D={id:u.id||`assessment_${Date.now()}`,breachId:g.id,assessedAt:Date.now(),assessor:u.assessor||{name:"Assessment User",role:"Data Protection Officer",email:"dpo@example.com"},confidentialityImpact:L,integrityImpact:I,availabilityImpact:P,harmLikelihood:j,harmSeverity:q,overallRiskScore:Y,riskLevel:R,risksToRightsAndFreedoms:U,highRisksToRightsAndFreedoms:H,justification:X};w(D),k(true);},m=d=>{switch(d){case 1:return "Minimal";case 2:return "Low";case 3:return "Moderate";case 4:return "High";case 5:return "Severe";default:return "Unknown"}},N=d=>jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",critical:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[d]}`,v.riskBadge,n),children:d.charAt(0).toUpperCase()+d.slice(1)});return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${ae}`,v.root,n),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",v.title,n),children:_}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:K}),l&&jsxRuntime.jsxs("div",{className:"mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-2",children:"Breach Summary"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Title:"})," ",g.title]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Discovered:"})," ",B(g.discoveredAt)]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",g.status.charAt(0).toUpperCase()+g.status.slice(1)]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Types:"})," ",g.dataTypes.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",g.affectedSystems.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",g.estimatedAffectedSubjects||"Unknown"]})]})]})]}),p?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Assessment Results"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Overall Risk Level:"})," ",N(R)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risk Score:"})," ",Y," / 5"]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Assessed On:"})," ",B(G)]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risks to Rights and Freedoms:"})," ",U?"Yes":"No"]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"High Risks to Rights and Freedoms:"})," ",H?"Yes":"No"]})]})]}),jsxRuntime.jsxs("div",{className:"mt-3",children:[jsxRuntime.jsx("p",{className:"text-sm mb-1",children:jsxRuntime.jsx("span",{className:"font-medium",children:"Justification:"})}),jsxRuntime.jsx("p",{className:"text-sm bg-white dark:bg-gray-800 p-2 rounded",children:X})]})]}),C&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`mb-6 p-4 rounded-md ${x?O>24?"bg-yellow-50 dark:bg-yellow-900/20":"bg-red-50 dark:bg-red-900/20":"bg-green-50 dark:bg-green-900/20"}`,v.notificationStatus,n),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Notification Requirements"}),x?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:`text-sm font-bold mb-2 ${O>24?"text-yellow-800 dark:text-yellow-200":"text-red-800 dark:text-red-200"}`,children:"NDPC Notification Required"}),jsxRuntime.jsx("p",{className:"text-sm mb-2",children:"Under the NDPA (Section 40), this breach must be reported to the NDPC within 72 hours of discovery."}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Notification Deadline:"})," ",B(y)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Time Remaining:"})," ",jsxRuntime.jsx("span",{className:O<24?"text-red-600 dark:text-red-400 font-bold":"",children:O>0?`${O} hours`:"Deadline passed"})]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Subject Notification:"})," ",H?"Required (NDPA Section 40(4))":"Not required unless directed by NDPC"]})]}):jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-bold mb-2 text-green-800 dark:text-green-200",children:"NDPC Notification Not Required"}),jsxRuntime.jsx("p",{className:"text-sm mb-2",children:"Based on this assessment, this breach does not need to be reported to the NDPC."}),jsxRuntime.jsx("p",{className:"text-sm mb-2",children:"However, the breach should still be documented internally for compliance purposes."})]}),jsxRuntime.jsxs("div",{className:"mt-3 text-sm",children:[jsxRuntime.jsx("p",{className:"font-medium",children:"Next Steps:"}),jsxRuntime.jsx("ul",{className:"list-disc pl-5 mt-1",children:x?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("li",{children:"Prepare a notification report for the NDPC"}),jsxRuntime.jsx("li",{children:"Document all aspects of the breach and your response"}),H&&jsxRuntime.jsx("li",{children:"Prepare communications for affected data subjects"}),jsxRuntime.jsx("li",{children:"Implement measures to mitigate the impact of the breach"})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("li",{children:"Document the breach and this assessment in your internal records"}),jsxRuntime.jsx("li",{children:"Implement measures to prevent similar breaches in the future"}),jsxRuntime.jsx("li",{children:"Review and update security measures as needed"})]})})]})]}),jsxRuntime.jsx("button",{onClick:()=>k(false),className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${Q}`,v.primaryButton||v.submitButton,n),children:"Edit Assessment"})]}):jsxRuntime.jsx("form",{onSubmit:s,children:jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Impact Assessment"}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"confidentialityImpact",className:"block text-sm font-medium mb-1",children:["Confidentiality Impact (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How much has the confidentiality of data been compromised?"})]}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"range",id:"confidentialityImpact",min:"1",max:"5",step:"1",value:L,onChange:d=>se(parseInt(d.target.value)),className:chunkE64TU6IU_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",v.slider,n)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[m(L)," (",L,")"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"integrityImpact",className:"block text-sm font-medium mb-1",children:["Integrity Impact (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How much has the integrity of data been compromised?"})]}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"range",id:"integrityImpact",min:"1",max:"5",step:"1",value:I,onChange:d=>b(parseInt(d.target.value)),className:chunkE64TU6IU_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",v.slider,n)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[m(I)," (",I,")"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"availabilityImpact",className:"block text-sm font-medium mb-1",children:["Availability Impact (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How much has the availability of data or systems been compromised?"})]}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"range",id:"availabilityImpact",min:"1",max:"5",step:"1",value:P,onChange:d=>S(parseInt(d.target.value)),className:chunkE64TU6IU_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",v.slider,n)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[m(P)," (",P,")"]})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Risk to Data Subjects"}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"harmLikelihood",className:"block text-sm font-medium mb-1",children:["Likelihood of Harm (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How likely is it that data subjects will experience harm?"})]}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"range",id:"harmLikelihood",min:"1",max:"5",step:"1",value:j,onChange:d=>T(parseInt(d.target.value)),className:chunkE64TU6IU_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",v.slider,n)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[m(j)," (",j,")"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"harmSeverity",className:"block text-sm font-medium mb-1",children:["Severity of Harm (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How severe would the harm be to affected data subjects?"})]}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"range",id:"harmSeverity",min:"1",max:"5",step:"1",value:q,onChange:d=>F(parseInt(d.target.value)),className:chunkE64TU6IU_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",v.slider,n)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[m(q)," (",q,")"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center mb-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"risksToRightsAndFreedoms",checked:U,onChange:d=>E(d.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"risksToRightsAndFreedoms",className:"ml-2 text-sm font-medium",children:"This breach poses a risk to the rights and freedoms of data subjects"})]}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 ml-6",children:"Under the NDPA (Section 40), breaches that pose a risk to rights and freedoms must be reported to the NDPC within 72 hours."})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center mb-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"highRisksToRightsAndFreedoms",checked:H,onChange:d=>M(d.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"highRisksToRightsAndFreedoms",className:"ml-2 text-sm font-medium",children:"This breach poses a high risk to the rights and freedoms of data subjects"})]}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 ml-6",children:"Under the NDPA (Section 40(4)), breaches that pose a high risk to rights and freedoms also require notification to affected data subjects without undue delay."})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Overall Assessment"}),jsxRuntime.jsxs("div",{className:"mb-4 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Overall Risk Score:"}),jsxRuntime.jsxs("span",{className:chunkE64TU6IU_js.a("",v.riskScore,n),children:[Y," / 5"]})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risk Level:"}),N(R)]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"justification",className:"block text-sm font-medium mb-1",children:["Justification for Assessment ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"justification",value:X,onChange:d=>ie(d.target.value),rows:4,placeholder:"Explain the reasoning behind your assessment, including any factors that influenced your decision.",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true})]})]}),jsxRuntime.jsxs("div",{className:"mt-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Breach Notification Requirements"}),jsxRuntime.jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"Under the Nigeria Data Protection Act (NDPA), Section 40, data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. This assessment will determine if notification is required for this breach."})]}),jsxRuntime.jsx("div",{className:"mt-6",children:jsxRuntime.jsx("button",{type:"submit",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 ${Q}`,v.primaryButton||v.submitButton,n),children:Z})})]})})]})};var Se=({breachReports:g,riskAssessments:u,regulatoryNotifications:w,onSelectBreach:_,onRequestAssessment:K,onRequestNotification:Z,title:ae="Breach Notification Manager",description:Q="Manage data breach notifications and track compliance with NDPA Section 40 requirements.",className:v="",buttonClassName:n="",classNames:l={},unstyled:C=false,showBreachDetails:L=true,showNotificationTimeline:se=true,showDeadlineAlerts:I=true})=>{var B;let[b,P]=react.useState(null),[S,j]=react.useState(g),[T,q]=react.useState("all"),[F,U]=react.useState(""),[E,H]=react.useState("discoveredAt"),[M,X]=react.useState("desc");react.useEffect(()=>{let s=[...g];if(T!=="all"&&(s=s.filter(m=>m.status===T)),F){let m=F.toLowerCase();s=s.filter(N=>N.title.toLowerCase().includes(m)||N.description.toLowerCase().includes(m)||N.affectedSystems.some(d=>d.toLowerCase().includes(m))||N.dataTypes.some(d=>d.toLowerCase().includes(m)));}s.sort((m,N)=>{let d=0;switch(E){case "title":d=m.title.localeCompare(N.title);break;case "discoveredAt":d=m.discoveredAt-N.discoveredAt;break;case "status":d=m.status.localeCompare(N.status);break;case "riskLevel":let D=u.find(V=>V.breachId===m.id),$=u.find(V=>V.breachId===N.id),oe=(D==null?void 0:D.riskLevel)||"unknown",ne=($==null?void 0:$.riskLevel)||"unknown";d=oe.localeCompare(ne);break;default:d=m.discoveredAt-N.discoveredAt;}return M==="asc"?d:-d}),j(s);},[g,T,F,E,M,u]),react.useEffect(()=>{S.length>0&&(b&&S.some(m=>m.id===b)||P(S[0].id));},[S,b]);let ie=s=>{P(s),_&&_(s);},Y=()=>{b&&K&&K(b);},re=()=>{b&&Z&&Z(b);},R=s=>new Date(s).toLocaleString(),h=b?g.find(s=>s.id===b):null,x=b?u.find(s=>s.breachId===b):null,f=b?w.find(s=>s.breachId===b):null,y=h?z(h,x):null;function z(s,m){let N=chunkBKRETVJ6_js.a(s,m||void 0),d=s.discoveredAt+N.timeframeHours*60*60*1e3;return {ndpcNotificationRequired:N.notificationRequired,ndpcNotificationDeadline:d,dataSubjectNotificationRequired:(m==null?void 0:m.highRisksToRightsAndFreedoms)||false,justification:N.justification}}function O(s){let m=Date.now(),N=(s-m)/(3600*1e3);return Number(N.toFixed(1))}let ee=s=>s?jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",critical:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[s]}`,l.statusBadge,C),children:s.charAt(0).toUpperCase()+s.slice(1)}):null,p=s=>jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${{ongoing:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",contained:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",resolved:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200"}[s]||"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200"}`,l.statusBadge,C),children:s.charAt(0).toUpperCase()+s.slice(1)}),k=()=>{if(!h||!y)return null;if(!y.ndpcNotificationRequired)return jsxRuntime.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"Notification Not Required"}),jsxRuntime.jsx("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:"Based on the risk assessment, NDPC notification is not required for this breach."})]});if(f)return jsxRuntime.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"Notification Sent"}),jsxRuntime.jsxs("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:["Notification was sent to the NDPC on ",R(f.sentAt),"."]})]});let s=O(y.ndpcNotificationDeadline);return s<=0?jsxRuntime.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Notification Deadline Passed"}),jsxRuntime.jsx("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:"The 72-hour deadline for NDPC notification has passed. Notification should be sent immediately."})]}):s<=24?jsxRuntime.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Urgent: Notification Due Soon"}),jsxRuntime.jsxs("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:["Only ",s," hours remaining until the NDPC notification deadline."]})]}):jsxRuntime.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium",children:"Notification Required"}),jsxRuntime.jsxs("p",{className:"text-xs text-yellow-700 dark:text-yellow-300 mt-1",children:["NDPC notification is required by ",R(y.ndpcNotificationDeadline)," (",s," hours remaining)."]})]})},G=()=>{if(!h)return null;let s=[{title:"Breach Discovered",date:h.discoveredAt,completed:true,description:`Breach was discovered on ${R(h.discoveredAt)}.`},{title:"Risk Assessment",date:x==null?void 0:x.assessedAt,completed:!!x,description:x?`Risk assessment completed on ${R(x.assessedAt)}.`:"Risk assessment has not been completed yet."}];return y!=null&&y.ndpcNotificationRequired&&s.push({title:"NDPC Notification",date:f==null?void 0:f.sentAt,completed:!!f,description:f?`Notification sent to the NDPC on ${R(f.sentAt)}.`:`Notification must be sent to the NDPC by ${R(y.ndpcNotificationDeadline)}.`}),y!=null&&y.dataSubjectNotificationRequired&&s.push({title:"Data Subject Notification",date:void 0,completed:false,description:"Notification to affected data subjects is required but has not been sent yet."}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mt-6",l.timeline,C),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Notification Timeline"}),jsxRuntime.jsx("ol",{className:"relative border-l border-gray-200 dark:border-gray-700",children:s.map((m,N)=>jsxRuntime.jsxs("li",{className:chunkE64TU6IU_js.a("mb-6 ml-4",l.timelineStep,C),children:[jsxRuntime.jsx("div",{className:`absolute w-3 h-3 rounded-full mt-1.5 -left-1.5 border ${m.completed?"bg-green-500 border-green-500 dark:border-green-500":"bg-gray-200 border-gray-200 dark:bg-gray-700 dark:border-gray-700"}`}),jsxRuntime.jsx("time",{className:"mb-1 text-sm font-normal leading-none text-gray-600 dark:text-gray-500",children:m.date?R(m.date):"Pending"}),jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:m.title}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:m.description})]},N))})]})};return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${v}`,l.root,C),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",l.header,C),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",l.title,C),children:ae}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:Q})]}),jsxRuntime.jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-3 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"statusFilter",className:"block text-sm font-medium mb-1",children:"Status Filter"}),jsxRuntime.jsxs("select",{id:"statusFilter",value:T,onChange:s=>q(s.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:[jsxRuntime.jsx("option",{value:"all",children:"All Statuses"}),jsxRuntime.jsx("option",{value:"ongoing",children:"Ongoing"}),jsxRuntime.jsx("option",{value:"contained",children:"Contained"}),jsxRuntime.jsx("option",{value:"resolved",children:"Resolved"})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"sortBy",className:"block text-sm font-medium mb-1",children:"Sort By"}),jsxRuntime.jsxs("select",{id:"sortBy",value:E,onChange:s=>H(s.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:[jsxRuntime.jsx("option",{value:"discoveredAt",children:"Discovery Date"}),jsxRuntime.jsx("option",{value:"title",children:"Title"}),jsxRuntime.jsx("option",{value:"status",children:"Status"}),jsxRuntime.jsx("option",{value:"riskLevel",children:"Risk Level"})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"searchTerm",className:"block text-sm font-medium mb-1",children:"Search"}),jsxRuntime.jsx("input",{type:"text",id:"searchTerm",value:F,onChange:s=>U(s.target.value),placeholder:"Search breaches...",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[jsxRuntime.jsxs("div",{className:"md:col-span-1",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Breach Reports"}),S.length===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No breach reports found."}):jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-2 max-h-96 overflow-y-auto pr-2",l.breachList,C),children:S.map(s=>{let m=u.find($=>$.breachId===s.id),N=w.find($=>$.breachId===s.id),d=z(s,m),D=null;if(d!=null&&d.ndpcNotificationRequired)if(N)D=jsxRuntime.jsx("span",{className:"text-xs text-green-600 dark:text-green-400",children:"Notified"});else {let $=O(d.ndpcNotificationDeadline);$<=0?D=jsxRuntime.jsx("span",{className:"text-xs text-red-600 dark:text-red-400 font-bold",children:"Overdue"}):$<=24?D=jsxRuntime.jsx("span",{className:"text-xs text-red-600 dark:text-red-400",children:"Urgent"}):D=jsxRuntime.jsx("span",{className:"text-xs text-yellow-600 dark:text-yellow-400",children:"Required"});}else D=jsxRuntime.jsx("span",{className:"text-xs text-green-600 dark:text-green-400",children:"Not Required"});return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`p-3 rounded-md cursor-pointer ${b===s.id?"bg-[rgb(var(--ndpr-primary)/0.05)] dark:bg-[rgb(var(--ndpr-primary)/0.1)] border border-[rgb(var(--ndpr-primary)/0.2)] dark:border-[rgb(var(--ndpr-primary)/0.3)]":"bg-gray-50 dark:bg-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600"}`,l.breachItem,C),onClick:()=>ie(s.id),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:s.title}),p(s.status)]}),jsxRuntime.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:["Discovered: ",new Date(s.discoveredAt).toLocaleDateString()]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center mt-2",children:[jsxRuntime.jsx("div",{children:m&&ee(m.riskLevel)}),jsxRuntime.jsx("div",{children:D})]})]},s.id)})})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("md:col-span-2",l.detailPanel,C),children:h?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium",children:h.title}),p(h.status)]}),I&&jsxRuntime.jsx("div",{className:"mb-4",children:k()}),L&&jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Discovered:"})," ",R(h.discoveredAt)]}),h.occurredAt&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Occurred:"})," ",R(h.occurredAt)]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reporter:"})," ",h.reporter.name]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",h.affectedSystems.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Types:"})," ",h.dataTypes.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",h.estimatedAffectedSubjects||"Unknown"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"Description:"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:h.description})]}),h.initialActions&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"Initial Actions Taken:"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:h.initialActions})]})]}),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Risk Assessment"}),x?jsxRuntime.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-2",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"Risk Level:"}),ee(x.riskLevel)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risk Score:"})," ",x.overallRiskScore," / 5"]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risks to Rights and Freedoms:"})," ",x.risksToRightsAndFreedoms?"Yes":"No"]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"High Risks to Rights and Freedoms:"})," ",x.highRisksToRightsAndFreedoms?"Yes":"No"]}),jsxRuntime.jsx("p",{className:"text-sm mb-1",children:jsxRuntime.jsx("span",{className:"font-medium",children:"Justification:"})}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-300 bg-white dark:bg-gray-800 p-2 rounded-md",children:x.justification})]}):jsxRuntime.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200",children:"Risk assessment has not been conducted yet."}),jsxRuntime.jsx("button",{onClick:Y,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${n}`,children:"Conduct Risk Assessment"})]})]}),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Notification Status"}),f?jsxRuntime.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:[jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Notification Sent:"})," ",R(f.sentAt)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Method:"})," ",f.method.charAt(0).toUpperCase()+f.method.slice(1)]}),f.referenceNumber&&jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reference Number:"})," ",f.referenceNumber]}),(f.ndpcContact||f.nitdaContact)&&jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"NDPC Contact:"})," ",(B=f.ndpcContact||f.nitdaContact)==null?void 0:B.name]})]}):jsxRuntime.jsx("div",{children:y!=null&&y.ndpcNotificationRequired?jsxRuntime.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200",children:"NDPC notification is required but has not been sent yet."}),jsxRuntime.jsx("button",{onClick:re,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${n}`,children:"Generate Notification"})]}):jsxRuntime.jsx("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:jsxRuntime.jsx("p",{className:"text-sm text-green-800 dark:text-green-200",children:"NDPC notification is not required for this breach."})})})]}),se&&G()]}):jsxRuntime.jsx("div",{className:"flex items-center justify-center h-64 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Select a breach to view details"})})})]})]})};var Fe=({breachData:g,assessmentData:u,organizationInfo:w,onGenerate:_,title:K="Generate NDPC Notification Report",description:Z="Generate a report for submission to the NDPC in compliance with NDPA Section 40 breach notification requirements.",generateButtonText:ae="Generate Report",className:Q="",buttonClassName:v="",classNames:n={},unstyled:l=false,showPreview:C=true,allowEditing:L=true,allowDownload:se=true,downloadFormat:I="pdf"})=>{let[b,P]=react.useState(""),[S,j]=react.useState(""),[T,q]=react.useState(""),[F,U]=react.useState(""),[E,H]=react.useState("email"),[M,X]=react.useState(""),[ie,Y]=react.useState(""),[re,R]=react.useState(false),[h,x]=react.useState(false);react.useEffect(()=>{let p=y();P(p),R(true);},[g,u,w]);let f=p=>new Date(p).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),y=()=>`
|
|
2
|
+
NDPC DATA BREACH NOTIFICATION
|
|
3
|
+
|
|
4
|
+
Date: ${new Date().toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"})}
|
|
5
|
+
|
|
6
|
+
Reference: NDPA Section 40 - Breach Notification
|
|
7
|
+
|
|
8
|
+
ORGANIZATION DETAILS
|
|
9
|
+
-------------------
|
|
10
|
+
Organization Name: ${w.name}
|
|
11
|
+
${w.registrationNumber?`Registration Number: ${w.registrationNumber}`:""}
|
|
12
|
+
Address: ${w.address}
|
|
13
|
+
${w.website?`Website: ${w.website}`:""}
|
|
14
|
+
|
|
15
|
+
DATA PROTECTION OFFICER
|
|
16
|
+
----------------------
|
|
17
|
+
Name: ${w.dpoName}
|
|
18
|
+
Email: ${w.dpoEmail}
|
|
19
|
+
${w.dpoPhone?`Phone: ${w.dpoPhone}`:""}
|
|
20
|
+
|
|
21
|
+
BREACH DETAILS
|
|
22
|
+
-------------
|
|
23
|
+
Breach Title: ${g.title}
|
|
24
|
+
Date Discovered: ${f(g.discoveredAt)}
|
|
25
|
+
${g.occurredAt?`Date Occurred: ${f(g.occurredAt)}`:"Date Occurred: Unknown"}
|
|
26
|
+
Status: ${g.status.charAt(0).toUpperCase()+g.status.slice(1)}
|
|
27
|
+
|
|
28
|
+
Description of the Breach:
|
|
29
|
+
${g.description}
|
|
30
|
+
|
|
31
|
+
Affected Systems/Applications:
|
|
32
|
+
${g.affectedSystems.join(", ")}
|
|
33
|
+
|
|
34
|
+
Types of Personal Data Involved:
|
|
35
|
+
${g.dataTypes.join(", ")}
|
|
36
|
+
|
|
37
|
+
Estimated Number of Data Subjects Affected:
|
|
38
|
+
${g.estimatedAffectedSubjects||"Unknown"}
|
|
39
|
+
|
|
40
|
+
RISK ASSESSMENT
|
|
41
|
+
--------------
|
|
42
|
+
${u?`
|
|
43
|
+
Overall Risk Level: ${u.riskLevel.charAt(0).toUpperCase()+u.riskLevel.slice(1)}
|
|
44
|
+
Risk to Rights and Freedoms of Data Subjects: ${u.risksToRightsAndFreedoms?"Yes":"No"}
|
|
45
|
+
High Risk to Rights and Freedoms of Data Subjects: ${u.highRisksToRightsAndFreedoms?"Yes":"No"}
|
|
46
|
+
|
|
47
|
+
Justification for Risk Assessment:
|
|
48
|
+
${u.justification}
|
|
49
|
+
`:"Risk assessment has not been conducted yet."}
|
|
50
|
+
|
|
51
|
+
MEASURES TAKEN
|
|
52
|
+
-------------
|
|
53
|
+
Measures taken or proposed to address the breach:
|
|
54
|
+
${g.initialActions||"To be determined"}
|
|
55
|
+
|
|
56
|
+
Measures taken or proposed to mitigate possible adverse effects:
|
|
57
|
+
[Please specify measures taken to mitigate adverse effects]
|
|
58
|
+
|
|
59
|
+
NOTIFICATION TO DATA SUBJECTS (NDPA Section 40(4))
|
|
60
|
+
----------------------------
|
|
61
|
+
Have data subjects been notified: [Yes/No]
|
|
62
|
+
If yes, date of notification: [Date]
|
|
63
|
+
If no, planned date of notification: [Date]
|
|
64
|
+
Reason for delay (if applicable): [Reason]
|
|
65
|
+
|
|
66
|
+
ADDITIONAL INFORMATION
|
|
67
|
+
---------------------
|
|
68
|
+
[Any additional information relevant to the breach]
|
|
69
|
+
|
|
70
|
+
This notification is made in compliance with the Nigeria Data Protection Act (NDPA), Section 40.
|
|
71
|
+
`,z=p=>{p.preventDefault();let k={id:`notification_${Date.now()}`,breachId:g.id,sentAt:Date.now(),method:E,referenceNumber:M||void 0,ndpcContact:S?{name:S,email:T,phone:F||void 0}:void 0,content:b,attachments:[]};_(k),x(true);},O=()=>{let p,k,G;switch(I){case "html":{p="text/html",k="html",G=`<!DOCTYPE html>
|
|
72
|
+
<html lang="en">
|
|
73
|
+
<head>
|
|
74
|
+
<meta charset="UTF-8">
|
|
75
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
76
|
+
<title>NDPC Breach Notification Report</title>
|
|
77
|
+
<style>body{font-family:monospace;white-space:pre-wrap;max-width:800px;margin:2rem auto;padding:0 1rem;}</style>
|
|
78
|
+
</head>
|
|
79
|
+
<body>${b.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}</body>
|
|
80
|
+
</html>`;break}case "pdf":p="text/plain",k="pdf.txt",G=b;break;case "docx":p="text/plain",k="docx.txt",G=b;break;default:p="text/plain",k="txt",G=b;}let B=document.createElement("a"),s=new Blob([G],{type:p});B.href=URL.createObjectURL(s),B.download=`NDPC_Breach_Notification_${new Date().toISOString().split("T")[0]}.${k}`,document.body.appendChild(B),B.click(),document.body.removeChild(B);},ee=()=>[{value:"email",label:"Email"},{value:"portal",label:"NDPC Portal"},{value:"letter",label:"Formal Letter"},{value:"other",label:"Other"}].map(k=>jsxRuntime.jsx("option",{value:k.value,children:k.label},k.value));return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${Q}`,n.root,l),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",n.header,l),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",n.title,l),children:K}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:Z})]}),h?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"mb-6 p-4 bg-green-50 dark:bg-green-900/20 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-lg font-bold text-green-800 dark:text-green-200 mb-2",children:"Report Generated Successfully"}),jsxRuntime.jsx("p",{className:"text-green-700 dark:text-green-300",children:"Your NDPC notification report has been generated and is ready for submission. Please review the report carefully before submitting it to the NDPC."})]}),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Submission Details"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",n.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",n.fieldLabel,l),children:"Method:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",n.fieldValue,l),children:E.charAt(0).toUpperCase()+E.slice(1)})]}),S&&jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",n.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",n.fieldLabel,l),children:"Contact Name:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",n.fieldValue,l),children:S})]}),T&&jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",n.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",n.fieldLabel,l),children:"Contact Email:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",n.fieldValue,l),children:T})]}),F&&jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",n.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",n.fieldLabel,l),children:"Contact Phone:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",n.fieldValue,l),children:F})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",n.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",n.fieldLabel,l),children:"Date Generated:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",n.fieldValue,l),children:f(Date.now())})]}),jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",n.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",n.fieldLabel,l),children:"Breach ID:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",n.fieldValue,l),children:g.id})]}),M&&jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",n.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",n.fieldLabel,l),children:"Reference Number:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",n.fieldValue,l),children:M})]})]})]})]}),C&&jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Report Preview"}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("bg-gray-50 dark:bg-gray-700 p-4 rounded-md",n.reportPreview,l),children:jsxRuntime.jsx("pre",{className:"whitespace-pre-wrap text-sm font-mono text-gray-800 dark:text-gray-200",children:b})})]}),jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-3",children:[se&&jsxRuntime.jsxs("button",{onClick:O,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${v}`,n.secondaryButton||n.downloadButton,l),children:["Download Report (",I.toUpperCase(),")"]}),jsxRuntime.jsx("button",{onClick:()=>x(false),className:`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 ${v}`,children:"Edit Report"})]})]}):jsxRuntime.jsx("form",{onSubmit:z,children:jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Notification Method"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"method",className:"block text-sm font-medium mb-1",children:["Method of Submission ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("select",{id:"method",value:E,onChange:p=>H(p.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true,children:ee()})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"referenceNumber",className:"block text-sm font-medium mb-1",children:"Reference Number (if available)"}),jsxRuntime.jsx("input",{type:"text",id:"referenceNumber",value:M,onChange:p=>X(p.target.value),placeholder:"e.g. NDPC/BR/2024/001",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"NDPC Contact (if known)"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"contactName",className:"block text-sm font-medium mb-1",children:"Contact Name"}),jsxRuntime.jsx("input",{type:"text",id:"contactName",value:S,onChange:p=>j(p.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"contactEmail",className:"block text-sm font-medium mb-1",children:"Contact Email"}),jsxRuntime.jsx("input",{type:"email",id:"contactEmail",value:T,onChange:p=>q(p.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"contactPhone",className:"block text-sm font-medium mb-1",children:"Contact Phone"}),jsxRuntime.jsx("input",{type:"tel",id:"contactPhone",value:F,onChange:p=>U(p.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Additional Information"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"additionalInfo",className:"block text-sm font-medium mb-1",children:"Additional Information to Include"}),jsxRuntime.jsx("textarea",{id:"additionalInfo",value:ie,onChange:p=>Y(p.target.value),rows:3,placeholder:"Any additional information you want to include in the report",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]}),L&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Report Content"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reportContent",className:"block text-sm font-medium mb-1",children:["Edit Report Content ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"reportContent",value:b,onChange:p=>P(p.target.value),rows:20,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] font-mono text-sm",required:true})]})]}),jsxRuntime.jsxs("div",{className:"mt-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Breach Notification Requirements"}),jsxRuntime.jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"Under the Nigeria Data Protection Act (NDPA), Section 40, data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. This report will help you comply with this requirement."})]}),jsxRuntime.jsx("div",{className:"mt-6",children:jsxRuntime.jsx("button",{type:"submit",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 ${v}`,n.primaryButton||n.generateButton,l),children:ae})})]})})]})};exports.a=xe;exports.b=Se;exports.c=Fe;//# sourceMappingURL=chunk-EKHBORAH.js.map
|
|
81
|
+
//# sourceMappingURL=chunk-EKHBORAH.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkUXMGBIX6_js=require('./chunk-UXMGBIX6.js'),chunkELKB2AFZ_js=require('./chunk-ELKB2AFZ.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function F(y,l){return l?chunkELKB2AFZ_js.a(y):{load:()=>null,save:()=>{},remove:()=>{}}}function E({templates:y,initialPolicy:l,adapter:g,storageKey:S="ndpr_privacy_policy",useLocalStorage:h=true,onGenerate:P}){let b=g!=null?g:F(S,h),f=react.useRef(b);f.current=b;let[n,s]=react.useState(l||null),[r,v]=react.useState(null),[u,O]=react.useState({name:"",website:"",privacyEmail:"",address:"",privacyPhone:"",dpoName:"",dpoEmail:"",industry:""}),[q,T]=react.useState(true),V=react.useRef(y);V.current=y,react.useEffect(()=>{if(l){T(false);return}let e=false;try{let a=f.current.load(),t=i=>{if(i){if(s(i),i.templateId){let d=V.current.find(p=>p.id===i.templateId);d&&v(d);}i.organizationInfo&&O(i.organizationInfo);}T(!1);};a instanceof Promise?a.then(i=>{e||t(i);},()=>{e||T(!1);}):t(a);}catch(a){e||T(false);}return ()=>{e=true;}},[l]);let R=e=>{Promise.resolve(f.current.save(e)).catch(a=>{console.warn("[ndpr-toolkit] Failed to save policy:",a);});},A=react.useCallback(e=>{let a=y.find(p=>p.id===e);if(!a)return false;v(a);let t=a.sections.map(p=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},p),{customContent:void 0})),i={};Object.keys(a.variables).forEach(p=>{i[p]=a.variables[p].defaultValue||"";});let d=Date.now();return s({id:"policy_"+d+"_"+Math.random().toString(36).substr(2,9),title:"",templateId:a.id,organizationInfo:u,sections:t,variableValues:i,effectiveDate:d,lastUpdated:d,version:"1.0"}),true},[y,u]),C=react.useCallback(e=>{O(a=>chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},a),e));},[]),N=react.useCallback((e,a)=>{r&&(n?s(t=>t&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t),{sections:t.sections.map(i=>i.id===e?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{included:a}):i)})):v(t=>t&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t),{sections:t.sections.map(i=>i.id===e?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{included:a}):i)})));},[r,n]),U=react.useCallback((e,a)=>{r&&(n?s(t=>t&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t),{sections:t.sections.map(i=>i.id===e?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{customContent:a}):i)})):v(t=>t&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t),{sections:t.sections.map(i=>i.id===e?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{customContent:a}):i)})));},[r,n]),L=react.useCallback((e,a)=>{n&&s(t=>t&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t),{variableValues:chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t.variableValues),{[e]:a})}));},[n]),_=()=>"policy_"+Date.now()+"_"+Math.random().toString(36).substr(2,9),k=react.useCallback(()=>{if(!r)return null;let e=Date.now(),a={id:(n==null?void 0:n.id)||_(),title:`Privacy Policy for ${u.name}`,templateId:r.id,organizationInfo:u,sections:r.sections.map(t=>{var i;return chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t),{customContent:(i=n==null?void 0:n.sections.find(d=>d.id===t.id))==null?void 0:i.customContent})}),variableValues:(n==null?void 0:n.variableValues)||{},effectiveDate:e,lastUpdated:e,version:"1.0"};return s(a),R(a),P&&P(a),a},[r,n,u,P]),j=react.useCallback(()=>{if(!n)return {fullText:"",sectionTexts:{},missingVariables:[]};let e=chunkUXMGBIX6_js.a(n.sections,n.organizationInfo);return typeof e=="string"?{fullText:e,sectionTexts:{full:e},missingVariables:[]}:e},[n]),K=react.useCallback(()=>{s(null),v(null),O({name:"",website:"",privacyEmail:"",address:"",privacyPhone:"",dpoName:"",dpoEmail:"",industry:""}),Promise.resolve(f.current.remove()).catch(e=>{console.warn("[ndpr-toolkit] Failed to remove policy:",e);});},[]),$=react.useCallback(()=>{let e=[];if(r||e.push("No template selected"),u.name||e.push("Organization name is required"),u.website||e.push("Organization website is required"),u.privacyEmail||e.push("Privacy contact email is required"),r){let a=r.sections.filter(i=>i.required),t=(n==null?void 0:n.sections.filter(i=>i.included))||[];a.forEach(i=>{t.some(d=>d.id===i.id)||e.push(`Required section "${i.title}" must be included`);});}return r&&n&&Object.entries(r.variables).forEach(([a,t])=>{t.required&&!n.variableValues[a]&&e.push(`Required variable "${t.name}" must have a value`);}),{valid:e.length===0,errors:e}},[r,u,n]);return {policy:n,selectedTemplate:r,organizationInfo:u,selectTemplate:A,updateOrganizationInfo:C,toggleSection:N,updateSectionContent:U,updateVariableValue:L,generatePolicy:k,getPolicyText:j,resetPolicy:K,isValid:$,isLoading:q}}function Z(y={}){let{orgInfo:l,storageKey:g,useLocalStorage:S,adapter:h}=y,{sections:P,variables:b}=chunkUXMGBIX6_js.d(),f={};l&&(l.name&&(f.orgName=l.name),l.email&&(f.privacyEmail=l.email),l.dpoName&&(f.dpoName=l.dpoName));let n={id:"default-business",name:"Default Business Policy",description:"NDPA-compliant privacy policy template for businesses.",organizationType:"business",sections:P,variables:Object.fromEntries(b.map(s=>[s.name,{name:s.name,description:s.description,required:s.required,defaultValue:f[s.name]||s.value||void 0}])),version:"1.0",lastUpdated:Date.now(),ndpaCompliant:true};return E({templates:[n],adapter:h,storageKey:g,useLocalStorage:S})}exports.a=E;exports.b=Z;//# sourceMappingURL=chunk-ENIMJ6SQ.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-ENIMJ6SQ.js.map
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import {b,c,a as a$2}from'./chunk-ZEOQYWOE.mjs';import {a}from'./chunk-AYKLAEOU.mjs';import {d,b as b$1,a as a$1}from'./chunk-WWT2ZSNU.mjs';import {useId,useState,useEffect}from'react';import {jsxs,jsx}from'react/jsx-runtime';var fe=({sections:E=b,variables:M=c,onGenerate:T,title:V="NDPA Privacy Policy Generator",description:G="Generate an NDPA-compliant privacy policy for your organization in accordance with NDPA Section 24.",className:K="",buttonClassName:A="",generateButtonText:Q="Generate Policy",showPreview:R=true,allowEditing:N=true,classNames:r,unstyled:h=false})=>{let P=useId(),[F,n]=useState(E),[o,g]=useState(M),[s,$]=useState("sections"),[L,X]=useState(""),[I,q]=useState(""),[J,Z]=useState(false),[v,O]=useState({});useEffect(()=>{n(E);},[E]),useEffect(()=>{g(M);},[M]);let W=l=>{n(c=>c.map(d=>d.id===l?b$1(a$1({},d),{included:!d.included}):d));},j=(l,c)=>{g(d=>d.map(u=>u.id===l?b$1(a$1({},u),{value:c}):u)),v[l]&&O(d=>{let u=a$1({},d);return delete u[l],u});},z=()=>{let l={},c=true;return o.forEach(d=>{d.required&&!d.value&&(l[d.id]=`${d.name} is required`,c=false);}),O(l),c},ee=()=>{if(!z()){$("variables");return}let l=F.filter(u=>u.included),c=Object.fromEntries(o.map(u=>[u.name,u.value])),d="";l.forEach(u=>{d+=`## ${u.title}
|
|
2
|
+
|
|
3
|
+
`,d+=a$2(u.template,c),d+=`
|
|
4
|
+
|
|
5
|
+
`;}),X(d),q(d),Z(true),$("preview");},x=()=>{T({sections:F,variables:o,content:N?I:L});},m=()=>jsxs("div",{className:a("space-y-4",r==null?void 0:r.sectionList,h),role:"group","aria-labelledby":`${P}-sections-heading`,children:[jsx("h3",{id:`${P}-sections-heading`,className:"text-lg font-medium mb-4",children:"Select Policy Sections"}),F.map(l=>{let c=`${P}-section-${l.id}`,d=l.description?`${P}-section-desc-${l.id}`:void 0;return jsx("div",{className:a("border border-gray-200 dark:border-gray-700 rounded-md p-4",r==null?void 0:r.sectionItem,h),children:jsxs("div",{className:"flex items-start",children:[jsx("div",{className:"flex items-center h-5",children:jsx("input",{id:c,type:"checkbox",checked:l.included,onChange:()=>W(l.id),disabled:l.required,"aria-describedby":d,className:a("w-4 h-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))] dark:focus:ring-[rgb(var(--ndpr-ring))] dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600",r==null?void 0:r.input,h)})}),jsxs("div",{className:"ml-3 text-sm",children:[jsxs("label",{htmlFor:c,className:"font-medium text-gray-900 dark:text-white",children:[l.title," ",l.required&&jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"}),l.required&&jsx("span",{className:"sr-only",children:" (required)"})]}),l.description&&jsx("p",{id:d,className:"text-gray-600 dark:text-gray-400 mt-1",children:l.description})]})]})},l.id)}),jsx("div",{className:"mt-6",children:jsx("button",{onClick:()=>$("variables"),className:a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${A}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.generateButton),h),children:"Next: Fill Variables"})})]}),k=()=>{let l={};return o.forEach(c=>{let d=c.id.split(".")[0];l[d]||(l[d]=[]),l[d].push(c);}),jsxs("div",{className:a("",r==null?void 0:r.form,h),children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Fill Policy Variables"}),jsx("div",{className:"space-y-6",children:Object.entries(l).map(([c,d])=>{let u=F.find(e=>e.id===c);return u&&!u.included?null:jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-md p-4",children:[jsx("h4",{className:"font-medium text-lg mb-3",children:u?u.title:"General Information"}),jsx("div",{className:"space-y-4",children:d.map(e=>{let f=`${P}-var-${e.id}`,b=e.description?`${P}-var-desc-${e.id}`:void 0,_=v[e.id]?`${P}-var-err-${e.id}`:void 0,B=[b,_].filter(Boolean).join(" ")||void 0;return jsxs("div",{children:[jsxs("label",{htmlFor:f,className:"block text-sm font-medium mb-1",children:[e.name," ",e.required&&jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),e.description&&jsx("p",{id:b,className:"text-xs text-gray-600 dark:text-gray-400 mb-2",children:e.description}),e.inputType==="textarea"?jsx("textarea",{id:f,value:e.value,onChange:D=>j(e.id,D.target.value),rows:4,className:a(`w-full px-3 py-2 border ${v[e.id]?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,r==null?void 0:r.input,h),required:e.required,"aria-required":e.required||void 0,"aria-describedby":B,"aria-invalid":v[e.id]?true:void 0}):e.inputType==="select"&&e.options?jsxs("select",{id:f,value:e.value,onChange:D=>j(e.id,D.target.value),className:a(`w-full px-3 py-2 border ${v[e.id]?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,r==null?void 0:r.input,h),required:e.required,"aria-required":e.required||void 0,"aria-describedby":B,"aria-invalid":v[e.id]?true:void 0,children:[jsx("option",{value:"",children:"Select an option"}),e.options.map(D=>jsx("option",{value:D,children:D},D))]}):jsx("input",{id:f,type:e.inputType,value:e.value,onChange:D=>j(e.id,D.target.value),className:a(`w-full px-3 py-2 border ${v[e.id]?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,r==null?void 0:r.input,h),required:e.required,"aria-required":e.required||void 0,"aria-describedby":B,"aria-invalid":v[e.id]?true:void 0}),v[e.id]&&jsx("p",{id:_,role:"alert",className:"mt-1 text-sm text-red-600 dark:text-red-500",children:v[e.id]})]},e.id)})})]},c)})}),jsxs("div",{className:"mt-6 flex space-x-4",children:[jsx("button",{onClick:()=>$("sections"),className:`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 ${A}`,children:"Back to Sections"}),jsx("button",{onClick:ee,className:a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${A}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.generateButton),h),children:Q})]})]})},C=()=>{let l=`${P}-policy-content`;return jsxs("div",{children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Preview Generated Policy"}),N?jsxs("div",{className:"mb-4",children:[jsx("label",{htmlFor:l,className:"block text-sm font-medium mb-1",children:"Edit Policy Content"}),jsx("textarea",{id:l,value:I,onChange:c=>q(c.target.value),rows:20,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] font-mono text-sm"})]}):jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md mb-4","aria-live":"polite",children:jsx("div",{className:"prose dark:prose-invert max-w-none",children:L.split(`
|
|
6
|
+
`).map((c,d)=>c.startsWith("## ")?jsx("h3",{className:"text-xl font-bold mt-6 mb-3",children:c.substring(3)},d):c.startsWith("### ")?jsx("h4",{className:"text-lg font-bold mt-4 mb-2",children:c.substring(4)},d):c===""?jsx("br",{},d):jsx("p",{className:"mb-2",children:c},d))})}),jsxs("div",{className:"mt-6 flex space-x-4",children:[jsx("button",{onClick:()=>$("variables"),className:`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 ${A}`,children:"Back to Variables"}),jsx("button",{onClick:x,className:`px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${A}`,children:"Save Policy"})]})]})},H=()=>{switch(s){case "sections":return m();case "variables":return k();case "preview":return C();default:return m()}};return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${K}`,r==null?void 0:r.root,h),children:[jsxs("div",{className:a("mb-6",r==null?void 0:r.header,h),children:[jsx("h2",{className:a("text-xl font-bold mb-2",r==null?void 0:r.title,h),children:V}),jsx("p",{className:a("text-gray-600 dark:text-gray-300",r==null?void 0:r.description,h),children:G})]}),jsx("nav",{"aria-label":"Policy generation steps",className:"mb-8",children:jsxs("ol",{className:"flex items-center w-full",children:[jsxs("li",{className:`flex w-full items-center ${s==="sections"?"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400"} after:content-[''] after:w-full after:h-1 after:border-b after:border-gray-200 after:border-1 after:hidden sm:after:inline-block after:mx-6 xl:after:mx-10`,children:[jsx("span",{className:`flex items-center justify-center w-8 h-8 ${s==="sections"?"bg-[rgb(var(--ndpr-primary)/0.1)] dark:bg-[rgb(var(--ndpr-primary)/0.2)]":"bg-gray-100 dark:bg-gray-700"} rounded-full shrink-0`,"aria-current":s==="sections"?"step":void 0,children:"1"}),jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Sections"}),jsx("span",{className:"sr-only",children:s==="sections"?" (current step)":""})]}),jsxs("li",{className:`flex w-full items-center ${s==="variables"?"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400"} after:content-[''] after:w-full after:h-1 after:border-b after:border-gray-200 after:border-1 after:hidden sm:after:inline-block after:mx-6 xl:after:mx-10`,children:[jsx("span",{className:`flex items-center justify-center w-8 h-8 ${s==="variables"?"bg-[rgb(var(--ndpr-primary)/0.1)] dark:bg-[rgb(var(--ndpr-primary)/0.2)]":"bg-gray-100 dark:bg-gray-700"} rounded-full shrink-0`,"aria-current":s==="variables"?"step":void 0,children:"2"}),jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Variables"}),jsx("span",{className:"sr-only",children:s==="variables"?" (current step)":""})]}),jsxs("li",{className:`flex items-center ${s==="preview"?"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400"}`,children:[jsx("span",{className:`flex items-center justify-center w-8 h-8 ${s==="preview"?"bg-[rgb(var(--ndpr-primary)/0.1)] dark:bg-[rgb(var(--ndpr-primary)/0.2)]":"bg-gray-100 dark:bg-gray-700"} rounded-full shrink-0`,"aria-current":s==="preview"?"step":void 0,children:"3"}),jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Preview"}),jsx("span",{className:"sr-only",children:s==="preview"?" (current step)":""})]})]})}),jsxs("div",{className:a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",r==null?void 0:r.complianceNotice,h),children:[jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Compliance Notice"}),jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"This tool helps you generate a privacy policy that aligns with the Nigeria Data Protection Act (NDPA) 2023. While we strive to ensure compliance, we recommend having the final policy reviewed by a legal professional familiar with NDPA requirements."})]}),H()]})};var Ee=({content:E,sections:M,variables:T,onExport:V,onEdit:G,title:K="Privacy Policy Preview",description:A="Preview your NDPA-compliant privacy policy before exporting.",className:Q="",buttonClassName:R="",showExportOptions:N=true,showEditButton:r=true,showTableOfContents:h=true,showMetadata:P=true,organizationName:F,lastUpdated:n,classNames:o,unstyled:g=false})=>{let s=useId(),[$,L]=useState("preview"),X=`${s}-tab-preview`,I=`${s}-tab-markdown`,q=`${s}-panel-preview`,J=`${s}-panel-markdown`,v=(()=>{let x=E.split(`
|
|
7
|
+
`),m=[];return x.forEach(k=>{if(k.startsWith("## ")){let C=k.substring(3).trim(),H=`${s}-${C.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;m.push({id:H,title:C,level:2});}else if(k.startsWith("### ")){let C=k.substring(4).trim(),H=`${s}-${C.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;m.push({id:H,title:C,level:3});}}),m})(),O=x=>{if(V)V(x);else if(x==="markdown"){let m=document.createElement("a"),k=new Blob([E],{type:"text/markdown"});m.href=URL.createObjectURL(k),m.download=`privacy-policy-${new Date().toISOString().split("T")[0]}.md`,document.body.appendChild(m),m.click(),document.body.removeChild(m);}},W=()=>!h||v.length===0?null:jsxs("nav",{"aria-label":"Table of contents",className:"mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Table of Contents"}),jsx("ul",{className:"space-y-1",children:v.map((x,m)=>jsx("li",{style:{marginLeft:`${(x.level-2)*1.5}rem`},children:jsx("a",{href:`#${x.id}`,className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline",children:x.title})},m))})]}),j=()=>P?jsxs("div",{className:"mb-6",children:[jsx("h1",{className:"text-2xl font-bold mb-2",children:F?`${F} Privacy Policy`:"Privacy Policy"}),jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Last Updated: ",n?n.toLocaleDateString():"N/A"]})]}):null,z=()=>jsx("div",{className:a("prose dark:prose-invert max-w-none",o==null?void 0:o.sectionContent,g),children:E.split(`
|
|
8
|
+
`).map((x,m)=>{if(x.startsWith("## ")){let k=x.substring(3).trim(),C=`${s}-${k.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return jsx("h3",{id:C,className:a("text-xl font-bold mt-6 mb-3",o==null?void 0:o.sectionTitle,g),children:k},m)}else if(x.startsWith("### ")){let k=x.substring(4).trim(),C=`${s}-${k.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return jsx("h4",{id:C,className:a("text-lg font-bold mt-4 mb-2",o==null?void 0:o.sectionTitle,g),children:k},m)}else return x===""?jsx("br",{},m):jsx("p",{className:"mb-2",children:x},m)})}),ee=()=>N?jsxs("div",{className:"mt-6",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Export Options"}),jsxs("div",{className:"flex flex-wrap gap-3",children:[jsx("button",{onClick:()=>O("pdf"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${R}`,children:"Export as PDF"}),jsx("button",{onClick:()=>O("docx"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${R}`,children:"Export as DOCX"}),jsx("button",{onClick:()=>O("html"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${R}`,children:"Export as HTML"}),jsx("button",{onClick:()=>O("markdown"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${R}`,children:"Export as Markdown"})]})]}):null;return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${Q}`,o==null?void 0:o.root,g),children:[jsxs("div",{className:a("flex justify-between items-start mb-6",o==null?void 0:o.header,g),children:[jsxs("div",{children:[jsx("h2",{className:a("text-xl font-bold mb-2",o==null?void 0:o.title,g),children:K}),jsx("p",{className:a("text-gray-600 dark:text-gray-300",o==null?void 0:o.description,g),children:A})]}),r&&G&&jsx("button",{onClick:G,className:`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 ${R}`,children:"Edit Policy"})]}),jsxs("div",{className:a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",o==null?void 0:o.complianceNotice,g),children:[jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Compliance Notice"}),jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"This privacy policy has been generated to align with the Nigeria Data Protection Act (NDPA) 2023. We recommend having the final policy reviewed by a legal professional familiar with NDPA requirements before publishing it on your website or sharing it with your users."})]}),jsx("div",{className:"mb-6 border-b border-gray-200 dark:border-gray-700",children:jsxs("div",{role:"tablist","aria-label":"Policy view options",className:"flex flex-wrap -mb-px",children:[jsx("div",{className:"mr-2",children:jsx("button",{role:"tab",id:X,"aria-selected":$==="preview","aria-controls":q,onClick:()=>L("preview"),className:`inline-block p-4 ${$==="preview"?"text-[rgb(var(--ndpr-primary))] border-b-2 border-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] dark:border-[rgb(var(--ndpr-primary))]":"text-gray-600 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"}`,children:"Preview"})}),jsx("div",{className:"mr-2",children:jsx("button",{role:"tab",id:I,"aria-selected":$==="markdown","aria-controls":J,onClick:()=>L("markdown"),className:`inline-block p-4 ${$==="markdown"?"text-[rgb(var(--ndpr-primary))] border-b-2 border-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] dark:border-[rgb(var(--ndpr-primary))]":"text-gray-600 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"}`,children:"Markdown"})})]})}),jsx("div",{className:a("bg-white dark:bg-gray-800 p-4 rounded-md",o==null?void 0:o.content,g),children:$==="preview"?jsxs("div",{role:"tabpanel",id:q,"aria-labelledby":X,"aria-live":"polite",children:[j(),W(),jsx("div",{className:a("bg-gray-50 dark:bg-gray-700 p-6 rounded-md",o==null?void 0:o.section,g),children:z()})]}):jsx("div",{role:"tabpanel",id:J,"aria-labelledby":I,children:jsx("pre",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md overflow-auto whitespace-pre-wrap font-mono text-sm text-gray-800 dark:text-gray-200",children:E})})}),ee()]})};var Fe=({content:E,title:M="Privacy Policy",organizationName:T,lastUpdated:V,onExportComplete:G,componentTitle:K="Export Privacy Policy",description:A="Export your NDPA-compliant privacy policy in various formats.",className:Q="",buttonClassName:R="",showExportHistory:N=true,includeComplianceNotice:r=true,includeLogo:h=false,logoUrl:P,customStyles:F,classNames:n,unstyled:o=false})=>{let g=useId(),[s,$]=useState([]),[L,X]=useState("pdf"),[I,q]=useState(false),[J,Z]=useState(null),[v,O]=useState(""),[W,j]=useState(""),[z,ee]=useState(""),[x,m]=useState(false),k=e=>{let f=new Date().toISOString().split("T")[0];return `${T?T.toLowerCase().replace(/[^a-z0-9]+/g,"-"):"privacy-policy"}-privacy-policy-${f}.${e.toLowerCase()}`},C=e=>v?v.endsWith(`.${e.toLowerCase()}`)?v:`${v}.${e.toLowerCase()}`:k(e),H=()=>{let e=T?`${T} ${M}`:M,f=V?V.toLocaleDateString():"N/A",b=`<!DOCTYPE html>
|
|
9
|
+
<html lang="en">
|
|
10
|
+
<head>
|
|
11
|
+
<meta charset="UTF-8">
|
|
12
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
13
|
+
<title>${e}</title>
|
|
14
|
+
<style>
|
|
15
|
+
body {
|
|
16
|
+
font-family: Arial, sans-serif;
|
|
17
|
+
line-height: 1.6;
|
|
18
|
+
color: #333;
|
|
19
|
+
max-width: 800px;
|
|
20
|
+
margin: 0 auto;
|
|
21
|
+
padding: 20px;
|
|
22
|
+
}
|
|
23
|
+
h1 {
|
|
24
|
+
font-size: 24px;
|
|
25
|
+
margin-bottom: 10px;
|
|
26
|
+
}
|
|
27
|
+
h2 {
|
|
28
|
+
font-size: 20px;
|
|
29
|
+
margin-top: 30px;
|
|
30
|
+
margin-bottom: 10px;
|
|
31
|
+
border-bottom: 1px solid #eee;
|
|
32
|
+
padding-bottom: 5px;
|
|
33
|
+
}
|
|
34
|
+
h3 {
|
|
35
|
+
font-size: 18px;
|
|
36
|
+
margin-top: 20px;
|
|
37
|
+
margin-bottom: 10px;
|
|
38
|
+
}
|
|
39
|
+
p {
|
|
40
|
+
margin-bottom: 15px;
|
|
41
|
+
}
|
|
42
|
+
.header {
|
|
43
|
+
text-align: center;
|
|
44
|
+
margin-bottom: 30px;
|
|
45
|
+
}
|
|
46
|
+
.footer {
|
|
47
|
+
margin-top: 50px;
|
|
48
|
+
text-align: center;
|
|
49
|
+
font-size: 12px;
|
|
50
|
+
color: #666;
|
|
51
|
+
border-top: 1px solid #eee;
|
|
52
|
+
padding-top: 20px;
|
|
53
|
+
}
|
|
54
|
+
.logo {
|
|
55
|
+
max-width: 200px;
|
|
56
|
+
margin-bottom: 20px;
|
|
57
|
+
}
|
|
58
|
+
.last-updated {
|
|
59
|
+
font-size: 12px;
|
|
60
|
+
color: #666;
|
|
61
|
+
margin-bottom: 30px;
|
|
62
|
+
}
|
|
63
|
+
.compliance-notice {
|
|
64
|
+
background-color: #f8f9fa;
|
|
65
|
+
border: 1px solid #e9ecef;
|
|
66
|
+
padding: 15px;
|
|
67
|
+
margin-bottom: 30px;
|
|
68
|
+
font-size: 14px;
|
|
69
|
+
}
|
|
70
|
+
${F||""}
|
|
71
|
+
</style>
|
|
72
|
+
</head>
|
|
73
|
+
<body>
|
|
74
|
+
<div class="header">
|
|
75
|
+
${h&&P?`<img src="${P}" alt="${T||"Company"} Logo" class="logo">`:""}
|
|
76
|
+
${W?`<div class="custom-header">${W}</div>`:""}
|
|
77
|
+
<h1>${e}</h1>
|
|
78
|
+
<div class="last-updated">Last Updated: ${f}</div>
|
|
79
|
+
</div>`;r&&(b+=`
|
|
80
|
+
<div class="compliance-notice">
|
|
81
|
+
<strong>NDPA Compliance Notice:</strong> This privacy policy has been created to comply with the Nigeria Data Protection Act (NDPA) 2023.
|
|
82
|
+
It outlines how we collect, use, disclose, and protect your personal information in accordance with NDPA requirements.
|
|
83
|
+
</div>`);let _=E.replace(/^## (.*?)$/gm,"<h2>$1</h2>").replace(/^### (.*?)$/gm,"<h3>$1</h3>").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>");return b+=`
|
|
84
|
+
<div class="content">
|
|
85
|
+
<p>${_}</p>
|
|
86
|
+
</div>
|
|
87
|
+
|
|
88
|
+
<div class="footer">
|
|
89
|
+
${z?`<div class="custom-footer">${z}</div>`:""}
|
|
90
|
+
<p>© ${new Date().getFullYear()} ${T||"Company"}. All rights reserved.</p>
|
|
91
|
+
</div>
|
|
92
|
+
</body>
|
|
93
|
+
</html>`,b},l=()=>d(null,null,function*(){q(true),Z(null);try{let e=L.toLowerCase(),f="",b;switch(e){case "pdf":let te=H();b=new Blob([te],{type:"text/html"}),f=URL.createObjectURL(b);break;case "docx":b=new Blob([E],{type:"text/plain"}),f=URL.createObjectURL(b);break;case "html":let pe=H();b=new Blob([pe],{type:"text/html"}),f=URL.createObjectURL(b);break;default:b=new Blob([E],{type:"text/markdown"}),f=URL.createObjectURL(b);break}let _=C(e),B=document.createElement("a");B.href=f,B.download=_,document.body.appendChild(B),B.click(),document.body.removeChild(B);let D={id:`export_${Date.now()}`,format:e,timestamp:Date.now(),url:f,filename:_};$(te=>[D,...te]),G&&G(e,f);}catch(e){console.error("[ndpr-toolkit] Export error:",e),Z("An error occurred during export. Please try again.");}finally{q(false);}}),c=()=>{let e=[{value:"pdf",label:"PDF Document (.pdf)"},{value:"docx",label:"Word Document (.docx)"},{value:"html",label:"Web Page (.html)"},{value:"markdown",label:"Markdown (.md)"}],f=`${g}-export-format`;return jsxs("div",{className:a("mb-6",n==null?void 0:n.formatSelector,o),children:[jsx("label",{htmlFor:f,className:"block text-sm font-medium mb-1",children:"Export Format"}),jsx("select",{id:f,value:L,onChange:b=>X(b.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",n==null?void 0:n.formatOption,o),children:e.map(b=>jsx("option",{value:b.value,children:b.label},b.value))})]})},d$1=()=>x?jsxs("div",{className:"mb-6 space-y-4 border border-gray-200 dark:border-gray-700 rounded-md p-4",children:[jsxs("div",{className:"flex justify-between items-center",children:[jsx("h3",{className:"text-md font-medium",children:"Advanced Export Options"}),jsx("button",{type:"button",onClick:()=>m(false),className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] text-sm",children:"Hide Advanced Options"})]}),jsxs("div",{children:[jsx("label",{htmlFor:`${g}-custom-filename`,className:"block text-sm font-medium mb-1",children:"Custom Filename"}),jsx("input",{type:"text",id:`${g}-custom-filename`,value:v,onChange:e=>O(e.target.value),placeholder:k(L),"aria-describedby":`${g}-custom-filename-desc`,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("p",{id:`${g}-custom-filename-desc`,className:"text-xs text-gray-600 dark:text-gray-400 mt-1",children:"Leave blank to use the default filename format."})]}),jsxs("div",{children:[jsx("label",{htmlFor:`${g}-custom-header`,className:"block text-sm font-medium mb-1",children:"Custom Header HTML (for HTML/PDF exports)"}),jsx("textarea",{id:`${g}-custom-header`,value:W,onChange:e=>j(e.target.value),rows:3,placeholder:"<div>Custom header content</div>",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]}),jsxs("div",{children:[jsx("label",{htmlFor:`${g}-custom-footer`,className:"block text-sm font-medium mb-1",children:"Custom Footer HTML (for HTML/PDF exports)"}),jsx("textarea",{id:`${g}-custom-footer`,value:z,onChange:e=>ee(e.target.value),rows:3,placeholder:"<div>Custom footer content</div>",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]}),jsxs("div",{className:"flex items-start",children:[jsx("div",{className:"flex items-center h-5",children:jsx("input",{id:`${g}-include-compliance-notice`,type:"checkbox",checked:r,onChange:e=>m(e.target.checked),"aria-describedby":`${g}-compliance-notice-desc`,className:"w-4 h-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))] dark:focus:ring-[rgb(var(--ndpr-ring))] dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"})}),jsxs("div",{className:"ml-3 text-sm",children:[jsx("label",{htmlFor:`${g}-include-compliance-notice`,className:"font-medium text-gray-900 dark:text-white",children:"Include NDPA Compliance Notice"}),jsx("p",{id:`${g}-compliance-notice-desc`,className:"text-gray-600 dark:text-gray-400",children:"Adds a notice explaining that this policy complies with NDPA requirements."})]})]})]}):jsx("button",{type:"button",onClick:()=>m(true),className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] text-sm mb-6",children:"Show Advanced Options"}),u=()=>!N||s.length===0?null:jsxs("div",{className:a("mt-6",n==null?void 0:n.preview,o),children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Export History"}),jsx("div",{className:"bg-gray-50 dark:bg-gray-700 rounded-md overflow-hidden",children:jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-600",children:[jsx("thead",{className:"bg-gray-100 dark:bg-gray-800",children:jsxs("tr",{children:[jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Date"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Format"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Filename"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Actions"})]})}),jsx("tbody",{className:"bg-white dark:bg-gray-700 divide-y divide-gray-200 dark:divide-gray-600",children:s.map(e=>jsxs("tr",{children:[jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-300",children:new Date(e.timestamp).toLocaleString()}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-300",children:e.format.toUpperCase()}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-300",children:e.filename}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:jsx("a",{href:e.url,download:e.filename,className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:text-[rgb(var(--ndpr-primary-hover))] dark:hover:text-[rgb(var(--ndpr-primary-hover))] mr-4",children:"Download"})})]},e.id))})]})})]});return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${Q}`,n==null?void 0:n.root,o),children:[jsxs("div",{className:a("mb-6",n==null?void 0:n.header,o),children:[jsx("h2",{className:a("text-xl font-bold mb-2",n==null?void 0:n.title,o),children:K}),jsx("p",{className:a("text-gray-600 dark:text-gray-300",n==null?void 0:n.description,o),children:A})]}),c(),d$1(),jsxs("div",{className:"mb-6",children:[jsx("button",{onClick:l,disabled:I,className:a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${R} ${I?"opacity-70 cursor-not-allowed":""}`,(n==null?void 0:n.primaryButton)||(n==null?void 0:n.exportButton),o),children:I?"Exporting...":`Export as ${L.toUpperCase()}`}),J&&jsx("p",{className:"mt-2 text-sm text-red-600 dark:text-red-500",children:J})]}),jsxs("div",{className:a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",n==null?void 0:n.complianceNotice,o),children:[jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"Export Tips"}),jsxs("ul",{className:"text-blue-700 dark:text-blue-300 text-sm list-disc list-inside space-y-1",children:[jsx("li",{children:"PDF format is recommended for printing or sharing with stakeholders."}),jsx("li",{children:"HTML format is ideal for publishing on your website."}),jsx("li",{children:"DOCX format allows for further editing in Microsoft Word or similar applications."}),jsx("li",{children:"Markdown format is useful for version control systems or technical documentation."})]})]}),u()]})};export{fe as a,Ee as b,Fe as c};//# sourceMappingURL=chunk-FLKJSGR7.mjs.map
|
|
94
|
+
//# sourceMappingURL=chunk-FLKJSGR7.mjs.map
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
'use strict';var chunkUXMGBIX6_js=require('./chunk-UXMGBIX6.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var fe=({sections:E=chunkUXMGBIX6_js.b,variables:M=chunkUXMGBIX6_js.c,onGenerate:T,title:V="NDPA Privacy Policy Generator",description:G="Generate an NDPA-compliant privacy policy for your organization in accordance with NDPA Section 24.",className:K="",buttonClassName:A="",generateButtonText:Q="Generate Policy",showPreview:R=true,allowEditing:N=true,classNames:r,unstyled:h=false})=>{let P=react.useId(),[F,n]=react.useState(E),[o,g]=react.useState(M),[s,$]=react.useState("sections"),[L,X]=react.useState(""),[I,q]=react.useState(""),[J,Z]=react.useState(false),[v,O]=react.useState({});react.useEffect(()=>{n(E);},[E]),react.useEffect(()=>{g(M);},[M]);let W=l=>{n(c=>c.map(d=>d.id===l?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},d),{included:!d.included}):d));},j=(l,c)=>{g(d=>d.map(u=>u.id===l?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},u),{value:c}):u)),v[l]&&O(d=>{let u=chunkMQFZHA2D_js.a({},d);return delete u[l],u});},z=()=>{let l={},c=true;return o.forEach(d=>{d.required&&!d.value&&(l[d.id]=`${d.name} is required`,c=false);}),O(l),c},ee=()=>{if(!z()){$("variables");return}let l=F.filter(u=>u.included),c=Object.fromEntries(o.map(u=>[u.name,u.value])),d="";l.forEach(u=>{d+=`## ${u.title}
|
|
2
|
+
|
|
3
|
+
`,d+=chunkUXMGBIX6_js.a(u.template,c),d+=`
|
|
4
|
+
|
|
5
|
+
`;}),X(d),q(d),Z(true),$("preview");},x=()=>{T({sections:F,variables:o,content:N?I:L});},m=()=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-4",r==null?void 0:r.sectionList,h),role:"group","aria-labelledby":`${P}-sections-heading`,children:[jsxRuntime.jsx("h3",{id:`${P}-sections-heading`,className:"text-lg font-medium mb-4",children:"Select Policy Sections"}),F.map(l=>{let c=`${P}-section-${l.id}`,d=l.description?`${P}-section-desc-${l.id}`:void 0;return jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("border border-gray-200 dark:border-gray-700 rounded-md p-4",r==null?void 0:r.sectionItem,h),children:jsxRuntime.jsxs("div",{className:"flex items-start",children:[jsxRuntime.jsx("div",{className:"flex items-center h-5",children:jsxRuntime.jsx("input",{id:c,type:"checkbox",checked:l.included,onChange:()=>W(l.id),disabled:l.required,"aria-describedby":d,className:chunkE64TU6IU_js.a("w-4 h-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))] dark:focus:ring-[rgb(var(--ndpr-ring))] dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600",r==null?void 0:r.input,h)})}),jsxRuntime.jsxs("div",{className:"ml-3 text-sm",children:[jsxRuntime.jsxs("label",{htmlFor:c,className:"font-medium text-gray-900 dark:text-white",children:[l.title," ",l.required&&jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"}),l.required&&jsxRuntime.jsx("span",{className:"sr-only",children:" (required)"})]}),l.description&&jsxRuntime.jsx("p",{id:d,className:"text-gray-600 dark:text-gray-400 mt-1",children:l.description})]})]})},l.id)}),jsxRuntime.jsx("div",{className:"mt-6",children:jsxRuntime.jsx("button",{onClick:()=>$("variables"),className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${A}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.generateButton),h),children:"Next: Fill Variables"})})]}),k=()=>{let l={};return o.forEach(c=>{let d=c.id.split(".")[0];l[d]||(l[d]=[]),l[d].push(c);}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",r==null?void 0:r.form,h),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Fill Policy Variables"}),jsxRuntime.jsx("div",{className:"space-y-6",children:Object.entries(l).map(([c,d])=>{let u=F.find(e=>e.id===c);return u&&!u.included?null:jsxRuntime.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-md p-4",children:[jsxRuntime.jsx("h4",{className:"font-medium text-lg mb-3",children:u?u.title:"General Information"}),jsxRuntime.jsx("div",{className:"space-y-4",children:d.map(e=>{let f=`${P}-var-${e.id}`,b=e.description?`${P}-var-desc-${e.id}`:void 0,_=v[e.id]?`${P}-var-err-${e.id}`:void 0,B=[b,_].filter(Boolean).join(" ")||void 0;return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:f,className:"block text-sm font-medium mb-1",children:[e.name," ",e.required&&jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),e.description&&jsxRuntime.jsx("p",{id:b,className:"text-xs text-gray-600 dark:text-gray-400 mb-2",children:e.description}),e.inputType==="textarea"?jsxRuntime.jsx("textarea",{id:f,value:e.value,onChange:D=>j(e.id,D.target.value),rows:4,className:chunkE64TU6IU_js.a(`w-full px-3 py-2 border ${v[e.id]?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,r==null?void 0:r.input,h),required:e.required,"aria-required":e.required||void 0,"aria-describedby":B,"aria-invalid":v[e.id]?true:void 0}):e.inputType==="select"&&e.options?jsxRuntime.jsxs("select",{id:f,value:e.value,onChange:D=>j(e.id,D.target.value),className:chunkE64TU6IU_js.a(`w-full px-3 py-2 border ${v[e.id]?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,r==null?void 0:r.input,h),required:e.required,"aria-required":e.required||void 0,"aria-describedby":B,"aria-invalid":v[e.id]?true:void 0,children:[jsxRuntime.jsx("option",{value:"",children:"Select an option"}),e.options.map(D=>jsxRuntime.jsx("option",{value:D,children:D},D))]}):jsxRuntime.jsx("input",{id:f,type:e.inputType,value:e.value,onChange:D=>j(e.id,D.target.value),className:chunkE64TU6IU_js.a(`w-full px-3 py-2 border ${v[e.id]?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,r==null?void 0:r.input,h),required:e.required,"aria-required":e.required||void 0,"aria-describedby":B,"aria-invalid":v[e.id]?true:void 0}),v[e.id]&&jsxRuntime.jsx("p",{id:_,role:"alert",className:"mt-1 text-sm text-red-600 dark:text-red-500",children:v[e.id]})]},e.id)})})]},c)})}),jsxRuntime.jsxs("div",{className:"mt-6 flex space-x-4",children:[jsxRuntime.jsx("button",{onClick:()=>$("sections"),className:`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 ${A}`,children:"Back to Sections"}),jsxRuntime.jsx("button",{onClick:ee,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${A}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.generateButton),h),children:Q})]})]})},C=()=>{let l=`${P}-policy-content`;return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Preview Generated Policy"}),N?jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("label",{htmlFor:l,className:"block text-sm font-medium mb-1",children:"Edit Policy Content"}),jsxRuntime.jsx("textarea",{id:l,value:I,onChange:c=>q(c.target.value),rows:20,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] font-mono text-sm"})]}):jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md mb-4","aria-live":"polite",children:jsxRuntime.jsx("div",{className:"prose dark:prose-invert max-w-none",children:L.split(`
|
|
6
|
+
`).map((c,d)=>c.startsWith("## ")?jsxRuntime.jsx("h3",{className:"text-xl font-bold mt-6 mb-3",children:c.substring(3)},d):c.startsWith("### ")?jsxRuntime.jsx("h4",{className:"text-lg font-bold mt-4 mb-2",children:c.substring(4)},d):c===""?jsxRuntime.jsx("br",{},d):jsxRuntime.jsx("p",{className:"mb-2",children:c},d))})}),jsxRuntime.jsxs("div",{className:"mt-6 flex space-x-4",children:[jsxRuntime.jsx("button",{onClick:()=>$("variables"),className:`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 ${A}`,children:"Back to Variables"}),jsxRuntime.jsx("button",{onClick:x,className:`px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${A}`,children:"Save Policy"})]})]})},H=()=>{switch(s){case "sections":return m();case "variables":return k();case "preview":return C();default:return m()}};return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${K}`,r==null?void 0:r.root,h),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6",r==null?void 0:r.header,h),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",r==null?void 0:r.title,h),children:V}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-gray-600 dark:text-gray-300",r==null?void 0:r.description,h),children:G})]}),jsxRuntime.jsx("nav",{"aria-label":"Policy generation steps",className:"mb-8",children:jsxRuntime.jsxs("ol",{className:"flex items-center w-full",children:[jsxRuntime.jsxs("li",{className:`flex w-full items-center ${s==="sections"?"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400"} after:content-[''] after:w-full after:h-1 after:border-b after:border-gray-200 after:border-1 after:hidden sm:after:inline-block after:mx-6 xl:after:mx-10`,children:[jsxRuntime.jsx("span",{className:`flex items-center justify-center w-8 h-8 ${s==="sections"?"bg-[rgb(var(--ndpr-primary)/0.1)] dark:bg-[rgb(var(--ndpr-primary)/0.2)]":"bg-gray-100 dark:bg-gray-700"} rounded-full shrink-0`,"aria-current":s==="sections"?"step":void 0,children:"1"}),jsxRuntime.jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Sections"}),jsxRuntime.jsx("span",{className:"sr-only",children:s==="sections"?" (current step)":""})]}),jsxRuntime.jsxs("li",{className:`flex w-full items-center ${s==="variables"?"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400"} after:content-[''] after:w-full after:h-1 after:border-b after:border-gray-200 after:border-1 after:hidden sm:after:inline-block after:mx-6 xl:after:mx-10`,children:[jsxRuntime.jsx("span",{className:`flex items-center justify-center w-8 h-8 ${s==="variables"?"bg-[rgb(var(--ndpr-primary)/0.1)] dark:bg-[rgb(var(--ndpr-primary)/0.2)]":"bg-gray-100 dark:bg-gray-700"} rounded-full shrink-0`,"aria-current":s==="variables"?"step":void 0,children:"2"}),jsxRuntime.jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Variables"}),jsxRuntime.jsx("span",{className:"sr-only",children:s==="variables"?" (current step)":""})]}),jsxRuntime.jsxs("li",{className:`flex items-center ${s==="preview"?"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400"}`,children:[jsxRuntime.jsx("span",{className:`flex items-center justify-center w-8 h-8 ${s==="preview"?"bg-[rgb(var(--ndpr-primary)/0.1)] dark:bg-[rgb(var(--ndpr-primary)/0.2)]":"bg-gray-100 dark:bg-gray-700"} rounded-full shrink-0`,"aria-current":s==="preview"?"step":void 0,children:"3"}),jsxRuntime.jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Preview"}),jsxRuntime.jsx("span",{className:"sr-only",children:s==="preview"?" (current step)":""})]})]})}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",r==null?void 0:r.complianceNotice,h),children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Compliance Notice"}),jsxRuntime.jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"This tool helps you generate a privacy policy that aligns with the Nigeria Data Protection Act (NDPA) 2023. While we strive to ensure compliance, we recommend having the final policy reviewed by a legal professional familiar with NDPA requirements."})]}),H()]})};var Ee=({content:E,sections:M,variables:T,onExport:V,onEdit:G,title:K="Privacy Policy Preview",description:A="Preview your NDPA-compliant privacy policy before exporting.",className:Q="",buttonClassName:R="",showExportOptions:N=true,showEditButton:r=true,showTableOfContents:h=true,showMetadata:P=true,organizationName:F,lastUpdated:n,classNames:o,unstyled:g=false})=>{let s=react.useId(),[$,L]=react.useState("preview"),X=`${s}-tab-preview`,I=`${s}-tab-markdown`,q=`${s}-panel-preview`,J=`${s}-panel-markdown`,v=(()=>{let x=E.split(`
|
|
7
|
+
`),m=[];return x.forEach(k=>{if(k.startsWith("## ")){let C=k.substring(3).trim(),H=`${s}-${C.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;m.push({id:H,title:C,level:2});}else if(k.startsWith("### ")){let C=k.substring(4).trim(),H=`${s}-${C.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;m.push({id:H,title:C,level:3});}}),m})(),O=x=>{if(V)V(x);else if(x==="markdown"){let m=document.createElement("a"),k=new Blob([E],{type:"text/markdown"});m.href=URL.createObjectURL(k),m.download=`privacy-policy-${new Date().toISOString().split("T")[0]}.md`,document.body.appendChild(m),m.click(),document.body.removeChild(m);}},W=()=>!h||v.length===0?null:jsxRuntime.jsxs("nav",{"aria-label":"Table of contents",className:"mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Table of Contents"}),jsxRuntime.jsx("ul",{className:"space-y-1",children:v.map((x,m)=>jsxRuntime.jsx("li",{style:{marginLeft:`${(x.level-2)*1.5}rem`},children:jsxRuntime.jsx("a",{href:`#${x.id}`,className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline",children:x.title})},m))})]}),j=()=>P?jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h1",{className:"text-2xl font-bold mb-2",children:F?`${F} Privacy Policy`:"Privacy Policy"}),jsxRuntime.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Last Updated: ",n?n.toLocaleDateString():"N/A"]})]}):null,z=()=>jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("prose dark:prose-invert max-w-none",o==null?void 0:o.sectionContent,g),children:E.split(`
|
|
8
|
+
`).map((x,m)=>{if(x.startsWith("## ")){let k=x.substring(3).trim(),C=`${s}-${k.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return jsxRuntime.jsx("h3",{id:C,className:chunkE64TU6IU_js.a("text-xl font-bold mt-6 mb-3",o==null?void 0:o.sectionTitle,g),children:k},m)}else if(x.startsWith("### ")){let k=x.substring(4).trim(),C=`${s}-${k.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return jsxRuntime.jsx("h4",{id:C,className:chunkE64TU6IU_js.a("text-lg font-bold mt-4 mb-2",o==null?void 0:o.sectionTitle,g),children:k},m)}else return x===""?jsxRuntime.jsx("br",{},m):jsxRuntime.jsx("p",{className:"mb-2",children:x},m)})}),ee=()=>N?jsxRuntime.jsxs("div",{className:"mt-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Export Options"}),jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-3",children:[jsxRuntime.jsx("button",{onClick:()=>O("pdf"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${R}`,children:"Export as PDF"}),jsxRuntime.jsx("button",{onClick:()=>O("docx"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${R}`,children:"Export as DOCX"}),jsxRuntime.jsx("button",{onClick:()=>O("html"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${R}`,children:"Export as HTML"}),jsxRuntime.jsx("button",{onClick:()=>O("markdown"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${R}`,children:"Export as Markdown"})]})]}):null;return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${Q}`,o==null?void 0:o.root,g),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex justify-between items-start mb-6",o==null?void 0:o.header,g),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",o==null?void 0:o.title,g),children:K}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-gray-600 dark:text-gray-300",o==null?void 0:o.description,g),children:A})]}),r&&G&&jsxRuntime.jsx("button",{onClick:G,className:`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 ${R}`,children:"Edit Policy"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",o==null?void 0:o.complianceNotice,g),children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Compliance Notice"}),jsxRuntime.jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"This privacy policy has been generated to align with the Nigeria Data Protection Act (NDPA) 2023. We recommend having the final policy reviewed by a legal professional familiar with NDPA requirements before publishing it on your website or sharing it with your users."})]}),jsxRuntime.jsx("div",{className:"mb-6 border-b border-gray-200 dark:border-gray-700",children:jsxRuntime.jsxs("div",{role:"tablist","aria-label":"Policy view options",className:"flex flex-wrap -mb-px",children:[jsxRuntime.jsx("div",{className:"mr-2",children:jsxRuntime.jsx("button",{role:"tab",id:X,"aria-selected":$==="preview","aria-controls":q,onClick:()=>L("preview"),className:`inline-block p-4 ${$==="preview"?"text-[rgb(var(--ndpr-primary))] border-b-2 border-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] dark:border-[rgb(var(--ndpr-primary))]":"text-gray-600 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"}`,children:"Preview"})}),jsxRuntime.jsx("div",{className:"mr-2",children:jsxRuntime.jsx("button",{role:"tab",id:I,"aria-selected":$==="markdown","aria-controls":J,onClick:()=>L("markdown"),className:`inline-block p-4 ${$==="markdown"?"text-[rgb(var(--ndpr-primary))] border-b-2 border-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] dark:border-[rgb(var(--ndpr-primary))]":"text-gray-600 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"}`,children:"Markdown"})})]})}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-800 p-4 rounded-md",o==null?void 0:o.content,g),children:$==="preview"?jsxRuntime.jsxs("div",{role:"tabpanel",id:q,"aria-labelledby":X,"aria-live":"polite",children:[j(),W(),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("bg-gray-50 dark:bg-gray-700 p-6 rounded-md",o==null?void 0:o.section,g),children:z()})]}):jsxRuntime.jsx("div",{role:"tabpanel",id:J,"aria-labelledby":I,children:jsxRuntime.jsx("pre",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md overflow-auto whitespace-pre-wrap font-mono text-sm text-gray-800 dark:text-gray-200",children:E})})}),ee()]})};var Fe=({content:E,title:M="Privacy Policy",organizationName:T,lastUpdated:V,onExportComplete:G,componentTitle:K="Export Privacy Policy",description:A="Export your NDPA-compliant privacy policy in various formats.",className:Q="",buttonClassName:R="",showExportHistory:N=true,includeComplianceNotice:r=true,includeLogo:h=false,logoUrl:P,customStyles:F,classNames:n,unstyled:o=false})=>{let g=react.useId(),[s,$]=react.useState([]),[L,X]=react.useState("pdf"),[I,q]=react.useState(false),[J,Z]=react.useState(null),[v,O]=react.useState(""),[W,j]=react.useState(""),[z,ee]=react.useState(""),[x,m]=react.useState(false),k=e=>{let f=new Date().toISOString().split("T")[0];return `${T?T.toLowerCase().replace(/[^a-z0-9]+/g,"-"):"privacy-policy"}-privacy-policy-${f}.${e.toLowerCase()}`},C=e=>v?v.endsWith(`.${e.toLowerCase()}`)?v:`${v}.${e.toLowerCase()}`:k(e),H=()=>{let e=T?`${T} ${M}`:M,f=V?V.toLocaleDateString():"N/A",b=`<!DOCTYPE html>
|
|
9
|
+
<html lang="en">
|
|
10
|
+
<head>
|
|
11
|
+
<meta charset="UTF-8">
|
|
12
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
13
|
+
<title>${e}</title>
|
|
14
|
+
<style>
|
|
15
|
+
body {
|
|
16
|
+
font-family: Arial, sans-serif;
|
|
17
|
+
line-height: 1.6;
|
|
18
|
+
color: #333;
|
|
19
|
+
max-width: 800px;
|
|
20
|
+
margin: 0 auto;
|
|
21
|
+
padding: 20px;
|
|
22
|
+
}
|
|
23
|
+
h1 {
|
|
24
|
+
font-size: 24px;
|
|
25
|
+
margin-bottom: 10px;
|
|
26
|
+
}
|
|
27
|
+
h2 {
|
|
28
|
+
font-size: 20px;
|
|
29
|
+
margin-top: 30px;
|
|
30
|
+
margin-bottom: 10px;
|
|
31
|
+
border-bottom: 1px solid #eee;
|
|
32
|
+
padding-bottom: 5px;
|
|
33
|
+
}
|
|
34
|
+
h3 {
|
|
35
|
+
font-size: 18px;
|
|
36
|
+
margin-top: 20px;
|
|
37
|
+
margin-bottom: 10px;
|
|
38
|
+
}
|
|
39
|
+
p {
|
|
40
|
+
margin-bottom: 15px;
|
|
41
|
+
}
|
|
42
|
+
.header {
|
|
43
|
+
text-align: center;
|
|
44
|
+
margin-bottom: 30px;
|
|
45
|
+
}
|
|
46
|
+
.footer {
|
|
47
|
+
margin-top: 50px;
|
|
48
|
+
text-align: center;
|
|
49
|
+
font-size: 12px;
|
|
50
|
+
color: #666;
|
|
51
|
+
border-top: 1px solid #eee;
|
|
52
|
+
padding-top: 20px;
|
|
53
|
+
}
|
|
54
|
+
.logo {
|
|
55
|
+
max-width: 200px;
|
|
56
|
+
margin-bottom: 20px;
|
|
57
|
+
}
|
|
58
|
+
.last-updated {
|
|
59
|
+
font-size: 12px;
|
|
60
|
+
color: #666;
|
|
61
|
+
margin-bottom: 30px;
|
|
62
|
+
}
|
|
63
|
+
.compliance-notice {
|
|
64
|
+
background-color: #f8f9fa;
|
|
65
|
+
border: 1px solid #e9ecef;
|
|
66
|
+
padding: 15px;
|
|
67
|
+
margin-bottom: 30px;
|
|
68
|
+
font-size: 14px;
|
|
69
|
+
}
|
|
70
|
+
${F||""}
|
|
71
|
+
</style>
|
|
72
|
+
</head>
|
|
73
|
+
<body>
|
|
74
|
+
<div class="header">
|
|
75
|
+
${h&&P?`<img src="${P}" alt="${T||"Company"} Logo" class="logo">`:""}
|
|
76
|
+
${W?`<div class="custom-header">${W}</div>`:""}
|
|
77
|
+
<h1>${e}</h1>
|
|
78
|
+
<div class="last-updated">Last Updated: ${f}</div>
|
|
79
|
+
</div>`;r&&(b+=`
|
|
80
|
+
<div class="compliance-notice">
|
|
81
|
+
<strong>NDPA Compliance Notice:</strong> This privacy policy has been created to comply with the Nigeria Data Protection Act (NDPA) 2023.
|
|
82
|
+
It outlines how we collect, use, disclose, and protect your personal information in accordance with NDPA requirements.
|
|
83
|
+
</div>`);let _=E.replace(/^## (.*?)$/gm,"<h2>$1</h2>").replace(/^### (.*?)$/gm,"<h3>$1</h3>").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>");return b+=`
|
|
84
|
+
<div class="content">
|
|
85
|
+
<p>${_}</p>
|
|
86
|
+
</div>
|
|
87
|
+
|
|
88
|
+
<div class="footer">
|
|
89
|
+
${z?`<div class="custom-footer">${z}</div>`:""}
|
|
90
|
+
<p>© ${new Date().getFullYear()} ${T||"Company"}. All rights reserved.</p>
|
|
91
|
+
</div>
|
|
92
|
+
</body>
|
|
93
|
+
</html>`,b},l=()=>chunkMQFZHA2D_js.d(null,null,function*(){q(true),Z(null);try{let e=L.toLowerCase(),f="",b;switch(e){case "pdf":let te=H();b=new Blob([te],{type:"text/html"}),f=URL.createObjectURL(b);break;case "docx":b=new Blob([E],{type:"text/plain"}),f=URL.createObjectURL(b);break;case "html":let pe=H();b=new Blob([pe],{type:"text/html"}),f=URL.createObjectURL(b);break;default:b=new Blob([E],{type:"text/markdown"}),f=URL.createObjectURL(b);break}let _=C(e),B=document.createElement("a");B.href=f,B.download=_,document.body.appendChild(B),B.click(),document.body.removeChild(B);let D={id:`export_${Date.now()}`,format:e,timestamp:Date.now(),url:f,filename:_};$(te=>[D,...te]),G&&G(e,f);}catch(e){console.error("[ndpr-toolkit] Export error:",e),Z("An error occurred during export. Please try again.");}finally{q(false);}}),c=()=>{let e=[{value:"pdf",label:"PDF Document (.pdf)"},{value:"docx",label:"Word Document (.docx)"},{value:"html",label:"Web Page (.html)"},{value:"markdown",label:"Markdown (.md)"}],f=`${g}-export-format`;return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6",n==null?void 0:n.formatSelector,o),children:[jsxRuntime.jsx("label",{htmlFor:f,className:"block text-sm font-medium mb-1",children:"Export Format"}),jsxRuntime.jsx("select",{id:f,value:L,onChange:b=>X(b.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))]",n==null?void 0:n.formatOption,o),children:e.map(b=>jsxRuntime.jsx("option",{value:b.value,children:b.label},b.value))})]})},d=()=>x?jsxRuntime.jsxs("div",{className:"mb-6 space-y-4 border border-gray-200 dark:border-gray-700 rounded-md p-4",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center",children:[jsxRuntime.jsx("h3",{className:"text-md font-medium",children:"Advanced Export Options"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>m(false),className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] text-sm",children:"Hide Advanced Options"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:`${g}-custom-filename`,className:"block text-sm font-medium mb-1",children:"Custom Filename"}),jsxRuntime.jsx("input",{type:"text",id:`${g}-custom-filename`,value:v,onChange:e=>O(e.target.value),placeholder:k(L),"aria-describedby":`${g}-custom-filename-desc`,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("p",{id:`${g}-custom-filename-desc`,className:"text-xs text-gray-600 dark:text-gray-400 mt-1",children:"Leave blank to use the default filename format."})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:`${g}-custom-header`,className:"block text-sm font-medium mb-1",children:"Custom Header HTML (for HTML/PDF exports)"}),jsxRuntime.jsx("textarea",{id:`${g}-custom-header`,value:W,onChange:e=>j(e.target.value),rows:3,placeholder:"<div>Custom header content</div>",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:`${g}-custom-footer`,className:"block text-sm font-medium mb-1",children:"Custom Footer HTML (for HTML/PDF exports)"}),jsxRuntime.jsx("textarea",{id:`${g}-custom-footer`,value:z,onChange:e=>ee(e.target.value),rows:3,placeholder:"<div>Custom footer content</div>",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]}),jsxRuntime.jsxs("div",{className:"flex items-start",children:[jsxRuntime.jsx("div",{className:"flex items-center h-5",children:jsxRuntime.jsx("input",{id:`${g}-include-compliance-notice`,type:"checkbox",checked:r,onChange:e=>m(e.target.checked),"aria-describedby":`${g}-compliance-notice-desc`,className:"w-4 h-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))] dark:focus:ring-[rgb(var(--ndpr-ring))] dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"})}),jsxRuntime.jsxs("div",{className:"ml-3 text-sm",children:[jsxRuntime.jsx("label",{htmlFor:`${g}-include-compliance-notice`,className:"font-medium text-gray-900 dark:text-white",children:"Include NDPA Compliance Notice"}),jsxRuntime.jsx("p",{id:`${g}-compliance-notice-desc`,className:"text-gray-600 dark:text-gray-400",children:"Adds a notice explaining that this policy complies with NDPA requirements."})]})]})]}):jsxRuntime.jsx("button",{type:"button",onClick:()=>m(true),className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] text-sm mb-6",children:"Show Advanced Options"}),u=()=>!N||s.length===0?null:jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mt-6",n==null?void 0:n.preview,o),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Export History"}),jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-700 rounded-md overflow-hidden",children:jsxRuntime.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-600",children:[jsxRuntime.jsx("thead",{className:"bg-gray-100 dark:bg-gray-800",children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Date"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Format"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Filename"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Actions"})]})}),jsxRuntime.jsx("tbody",{className:"bg-white dark:bg-gray-700 divide-y divide-gray-200 dark:divide-gray-600",children:s.map(e=>jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-300",children:new Date(e.timestamp).toLocaleString()}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-300",children:e.format.toUpperCase()}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-300",children:e.filename}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:jsxRuntime.jsx("a",{href:e.url,download:e.filename,className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:text-[rgb(var(--ndpr-primary-hover))] dark:hover:text-[rgb(var(--ndpr-primary-hover))] mr-4",children:"Download"})})]},e.id))})]})})]});return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${Q}`,n==null?void 0:n.root,o),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6",n==null?void 0:n.header,o),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",n==null?void 0:n.title,o),children:K}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-gray-600 dark:text-gray-300",n==null?void 0:n.description,o),children:A})]}),c(),d(),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("button",{onClick:l,disabled:I,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 ${R} ${I?"opacity-70 cursor-not-allowed":""}`,(n==null?void 0:n.primaryButton)||(n==null?void 0:n.exportButton),o),children:I?"Exporting...":`Export as ${L.toUpperCase()}`}),J&&jsxRuntime.jsx("p",{className:"mt-2 text-sm text-red-600 dark:text-red-500",children:J})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",n==null?void 0:n.complianceNotice,o),children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"Export Tips"}),jsxRuntime.jsxs("ul",{className:"text-blue-700 dark:text-blue-300 text-sm list-disc list-inside space-y-1",children:[jsxRuntime.jsx("li",{children:"PDF format is recommended for printing or sharing with stakeholders."}),jsxRuntime.jsx("li",{children:"HTML format is ideal for publishing on your website."}),jsxRuntime.jsx("li",{children:"DOCX format allows for further editing in Microsoft Word or similar applications."}),jsxRuntime.jsx("li",{children:"Markdown format is useful for version control systems or technical documentation."})]})]}),u()]})};exports.a=fe;exports.b=Ee;exports.c=Fe;//# sourceMappingURL=chunk-FWLPJ5YI.js.map
|
|
94
|
+
//# sourceMappingURL=chunk-FWLPJ5YI.js.map
|