@tantainnovative/ndpr-toolkit 3.4.0 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/README.md +80 -38
- package/dist/adapters.d.mts +34 -25
- package/dist/adapters.d.ts +34 -25
- package/dist/breach.d.mts +803 -44
- package/dist/breach.d.ts +803 -44
- package/dist/breach.js +2 -1
- package/dist/breach.mjs +2 -1
- package/dist/{chunk-2WH4DLV5.js → chunk-3EGQWLJ6.js} +3 -3
- package/dist/chunk-B4Z5MBUC.mjs +2 -0
- package/dist/{chunk-LSCMXAPY.mjs → chunk-CKGJK4D7.mjs} +3 -3
- package/dist/{chunk-XSEZDQLB.js → chunk-CKJAECGV.js} +2 -2
- package/dist/{chunk-AHSMDPG5.js → chunk-CPK5D5FY.js} +2 -2
- package/dist/{chunk-DCJK5OZT.mjs → chunk-CWHBCQGT.mjs} +2 -2
- package/dist/{chunk-KSERBMXW.mjs → chunk-F5TXUA4O.mjs} +3 -3
- package/dist/{chunk-BN77GP4W.mjs → chunk-GN5C32JB.mjs} +2 -2
- package/dist/{chunk-ZLSWOFAY.mjs → chunk-GRLIPT5V.mjs} +2 -2
- package/dist/{chunk-DUY6F3GT.mjs → chunk-H3EYBSVP.mjs} +3 -3
- package/dist/{chunk-MG73MOZC.mjs → chunk-I557S566.mjs} +2 -2
- package/dist/{chunk-QVULSG6J.mjs → chunk-ID2NYIVE.mjs} +3 -3
- package/dist/chunk-J5WCPZLW.js +2 -0
- package/dist/{chunk-4R42ZNO7.mjs → chunk-JFFOPHU3.mjs} +57 -57
- package/dist/{chunk-P2YV6DR3.js → chunk-LIM64IV2.js} +3 -3
- package/dist/chunk-LU7PKE7Y.mjs +2 -0
- package/dist/{chunk-HQSU7LGM.js → chunk-LWXZMKC2.js} +4 -4
- package/dist/{chunk-XMBSJJ5U.js → chunk-ORFC66EA.js} +3 -3
- package/dist/{chunk-VTITKWGX.mjs → chunk-QSVVAZVT.mjs} +2 -2
- package/dist/chunk-SCWNM4PC.mjs +2 -0
- package/dist/{chunk-EHAZIKDX.js → chunk-SKKOMFXH.js} +2 -2
- package/dist/{chunk-WH6ZMUOS.mjs → chunk-TUNQUVHU.mjs} +2 -2
- package/dist/chunk-TV4U6AIS.js +2 -0
- package/dist/{chunk-ZYLDLGFL.js → chunk-VIQUXWJC.js} +2 -2
- package/dist/{chunk-SUEGUY35.js → chunk-XIM7KMD6.js} +2 -2
- package/dist/{chunk-P6QAFBCV.js → chunk-XNSZ7KUH.js} +2 -2
- package/dist/{chunk-RNTNHVKZ.js → chunk-YPKUHSK4.js} +2 -2
- package/dist/{chunk-UFPSUO52.js → chunk-Z73T6MWY.js} +57 -57
- package/dist/consent.d.mts +648 -84
- package/dist/consent.d.ts +648 -84
- package/dist/consent.js +2 -1
- package/dist/consent.mjs +2 -1
- package/dist/core.d.mts +2049 -23
- package/dist/core.d.ts +2049 -23
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/cross-border.d.mts +470 -99
- package/dist/cross-border.d.ts +470 -99
- package/dist/cross-border.js +1 -0
- package/dist/cross-border.mjs +1 -0
- package/dist/dpia.d.mts +591 -37
- package/dist/dpia.d.ts +591 -37
- package/dist/dpia.js +1 -0
- package/dist/dpia.mjs +1 -0
- package/dist/dsr.d.mts +654 -37
- package/dist/dsr.d.ts +654 -37
- package/dist/dsr.js +2 -1
- package/dist/dsr.mjs +2 -1
- package/dist/hooks.d.mts +2174 -30
- package/dist/hooks.d.ts +2174 -30
- package/dist/hooks.js +2 -1
- package/dist/hooks.mjs +2 -1
- package/dist/index.d.mts +4428 -43
- package/dist/index.d.ts +4428 -43
- package/dist/index.js +2 -1
- package/dist/index.mjs +2 -1
- package/dist/lawful-basis.d.mts +368 -32
- package/dist/lawful-basis.d.ts +368 -32
- package/dist/lawful-basis.js +1 -0
- package/dist/lawful-basis.mjs +1 -0
- package/dist/policy.d.mts +1178 -83
- package/dist/policy.d.ts +1178 -83
- package/dist/policy.js +2 -1
- package/dist/policy.mjs +2 -1
- package/dist/presets.d.mts +1020 -114
- package/dist/presets.d.ts +1020 -114
- package/dist/presets.js +2 -1
- package/dist/presets.mjs +2 -1
- package/dist/ropa.d.mts +396 -31
- package/dist/ropa.d.ts +396 -31
- package/dist/ropa.js +2 -1
- package/dist/ropa.mjs +2 -1
- package/dist/server.d.mts +2133 -24
- package/dist/server.d.ts +2133 -24
- package/dist/server.js +1 -1
- package/dist/server.mjs +1 -1
- package/dist/unstyled.d.mts +523 -55
- package/dist/unstyled.d.ts +523 -55
- package/dist/unstyled.js +2 -1
- package/dist/unstyled.mjs +2 -1
- package/package.json +3 -3
- package/dist/BreachReportForm-DpRrBoxU.d.ts +0 -158
- package/dist/BreachReportForm-yJ2Zl6gz.d.mts +0 -158
- package/dist/ConsentBanner-F5ayys5K.d.mts +0 -156
- package/dist/ConsentBanner-VqIPophc.d.ts +0 -156
- package/dist/ConsentManager-C7I3PDe8.d.mts +0 -105
- package/dist/ConsentManager-CQ2IZtUU.d.ts +0 -105
- package/dist/CrossBorderTransferManager-D5Lc0e46.d.ts +0 -90
- package/dist/CrossBorderTransferManager-DkZhv9vD.d.mts +0 -90
- package/dist/DPIAQuestionnaire-VXBoWFMC.d.ts +0 -123
- package/dist/DPIAQuestionnaire-jkt1Veb6.d.mts +0 -123
- package/dist/DSRRequestForm-D8rPTNmU.d.ts +0 -146
- package/dist/DSRRequestForm-DRouEr9j.d.mts +0 -146
- package/dist/DSRTracker-Bl__d4df.d.ts +0 -163
- package/dist/DSRTracker-CSVDfgQQ.d.mts +0 -163
- package/dist/LawfulBasisTracker-CBqOxX1D.d.mts +0 -85
- package/dist/LawfulBasisTracker-Cg30NbDA.d.ts +0 -85
- package/dist/NDPRDashboard-CLJpEg0X.d.mts +0 -44
- package/dist/NDPRDashboard-DDWNd2Ah.d.ts +0 -44
- package/dist/NDPRProvider-DYFb8xEl.d.ts +0 -68
- package/dist/NDPRProvider-U3QNu6MA.d.mts +0 -68
- package/dist/PolicyExporter-Bgi6nz82.d.mts +0 -291
- package/dist/PolicyExporter-BnvuFncj.d.ts +0 -291
- package/dist/ROPAManager-BS4eB8Hw.d.mts +0 -79
- package/dist/ROPAManager-qxTrXLkD.d.ts +0 -79
- package/dist/RegulatoryReportGenerator-BUYgzTTT.d.ts +0 -282
- package/dist/RegulatoryReportGenerator-DwcHcEFp.d.mts +0 -282
- package/dist/StepIndicator-CgrlokSV.d.ts +0 -171
- package/dist/StepIndicator-W8S_QjgO.d.mts +0 -171
- package/dist/breach-B_-6lDqS.d.mts +0 -17
- package/dist/breach-CzXqSsaY.d.ts +0 -17
- package/dist/breach-Eu9byel8.d.mts +0 -185
- package/dist/breach-Eu9byel8.d.ts +0 -185
- package/dist/chunk-5X32J5IA.mjs +0 -2
- package/dist/chunk-7D2OIPHH.mjs +0 -2
- package/dist/chunk-JKKRPS4P.js +0 -2
- package/dist/chunk-NCOZB2WU.mjs +0 -2
- package/dist/chunk-RGNP45VR.js +0 -2
- package/dist/compliance-score-racQe_E_.d.mts +0 -115
- package/dist/compliance-score-racQe_E_.d.ts +0 -115
- package/dist/consent-CmVzqZUk.d.mts +0 -99
- package/dist/consent-CmVzqZUk.d.ts +0 -99
- package/dist/consent-audit-BdByjYlM.d.mts +0 -65
- package/dist/consent-audit-DhbfMR0n.d.ts +0 -65
- package/dist/cross-border-BBi9rZyO.d.mts +0 -54
- package/dist/cross-border-Dy-U9Hu6.d.ts +0 -54
- package/dist/cross-border-UyT00llA.d.mts +0 -141
- package/dist/cross-border-UyT00llA.d.ts +0 -141
- package/dist/docx-BxKascXN.d.ts +0 -64
- package/dist/docx-CV7Vsry_.d.mts +0 -64
- package/dist/dpia-D82hUrJe.d.ts +0 -15
- package/dist/dpia-DQDFw2_l.d.mts +0 -15
- package/dist/dpia-c9GiiOq0.d.mts +0 -137
- package/dist/dpia-c9GiiOq0.d.ts +0 -137
- package/dist/dsr-CIx5sd7e.d.ts +0 -14
- package/dist/dsr-XZ_HqTlA.d.mts +0 -14
- package/dist/dsr-yKbqX531.d.mts +0 -128
- package/dist/dsr-yKbqX531.d.ts +0 -128
- package/dist/lawful-basis-BEyI0kGg.d.ts +0 -57
- package/dist/lawful-basis-C2eGaoHM.d.mts +0 -57
- package/dist/lawful-basis-Cv1VmDLn.d.mts +0 -112
- package/dist/lawful-basis-Cv1VmDLn.d.ts +0 -112
- package/dist/locale-CxJx2tzn.d.mts +0 -25
- package/dist/locale-DSkrtf-c.d.ts +0 -25
- package/dist/policy-engine-CCUCud2T.d.ts +0 -154
- package/dist/policy-engine-fYSqEqSW.d.mts +0 -154
- package/dist/policy-sections-BYx6fEFk.d.ts +0 -56
- package/dist/policy-sections-Dm97Nq8m.d.mts +0 -56
- package/dist/policy-templates-DhLwq4R-.d.ts +0 -43
- package/dist/policy-templates-DwYl2329.d.mts +0 -43
- package/dist/privacy-Ca6te9Ir.d.mts +0 -138
- package/dist/privacy-Ca6te9Ir.d.ts +0 -138
- package/dist/ropa-BDTM06tr.d.ts +0 -152
- package/dist/ropa-CFHuT7jE.d.mts +0 -152
- package/dist/ropa-CyynscU6.d.ts +0 -51
- package/dist/ropa-NIgxd8uP.d.mts +0 -51
- package/dist/sanitize-CxxwKxAx.d.mts +0 -94
- package/dist/sanitize-CxxwKxAx.d.ts +0 -94
- package/dist/styling-BMDGQDgS.d.mts +0 -64
- package/dist/styling-BaoQtV06.d.ts +0 -64
- package/dist/types-DK2CoKOC.d.mts +0 -10
- package/dist/types-DK2CoKOC.d.ts +0 -10
- package/dist/useAdaptivePolicyWizard-BnjW4OR4.d.mts +0 -52
- package/dist/useAdaptivePolicyWizard-sb3m4-Zk.d.ts +0 -52
- package/dist/useBreach-CPr86Yan.d.mts +0 -115
- package/dist/useBreach-DkVXvtJK.d.ts +0 -115
- package/dist/useConsent-DCNkIJHR.d.mts +0 -75
- package/dist/useConsent-dOcELSfX.d.ts +0 -75
- package/dist/useCrossBorderTransfer-DixjLjN1.d.mts +0 -78
- package/dist/useCrossBorderTransfer-DvSq06lv.d.ts +0 -78
- package/dist/useDPIA-B6180UQn.d.mts +0 -109
- package/dist/useDPIA-CTqbNbww.d.ts +0 -109
- package/dist/useDSR-WvHk8_iu.d.mts +0 -85
- package/dist/useDSR-wH4H6hSM.d.ts +0 -85
- package/dist/useDefaultPrivacyPolicy-Cs2WQSYQ.d.mts +0 -162
- package/dist/useDefaultPrivacyPolicy-DkOqMg2e.d.ts +0 -162
- package/dist/useLawfulBasis-CKJ-kw84.d.mts +0 -79
- package/dist/useLawfulBasis-DFTmu1ca.d.ts +0 -79
- package/dist/useROPA-BSSU1rfx.d.ts +0 -76
- package/dist/useROPA-C2hjaBTz.d.mts +0 -76
|
@@ -11,5 +11,5 @@ import {a}from'./chunk-WWT2ZSNU.mjs';var m=[{id:"full-name",label:"Full Name",gr
|
|
|
11
11
|
4. Right to Restrict Processing (Section 37)
|
|
12
12
|
5. Right to Data Portability (Section 38)
|
|
13
13
|
6. Right to Object (Section 37)`})},{id:"right-to-withdraw-consent",name:"Right to Withdraw Consent",ndpaSection:"NDPA Section 25(2)",severity:"important",points:7,check:e=>{let t=g(e).toLowerCase();return t.includes("withdraw")&&t.includes("consent")},gap:()=>({message:"The policy does not mention the right to withdraw consent. Data subjects must be informed that they can withdraw consent at any time without affecting the lawfulness of prior processing.",fixType:"add_content",fixLabel:"Add withdrawal clause",suggestedContent:"You have the right to withdraw your consent at any time, without affecting the lawfulness of processing carried out prior to withdrawal. To withdraw your consent, contact us at the email address provided in this policy."})},{id:"right-to-lodge-complaint",name:"Right to Lodge Complaint with NDPC",ndpaSection:"NDPA Section 40",severity:"important",points:7,check:e=>{let t=g(e).toLowerCase();return t.includes("ndpc")||t.includes("nigeria data protection commission")},gap:()=>({message:"The policy does not mention the right to lodge a complaint with the Nigeria Data Protection Commission (NDPC). Data subjects must be informed of this right.",fixType:"add_content",fixLabel:"Add NDPC complaint reference",suggestedContent:"You have the right to lodge a complaint with the Nigeria Data Protection Commission (NDPC) if you believe your data protection rights have been infringed. Website: https://ndpc.gov.ng"})},{id:"cross-border-safeguards",name:"Cross-Border Transfer Safeguards",ndpaSection:"NDPA Sections 43-44",severity:"important",points:7,check:(e,t)=>t.hasCrossBorderTransfer?o(e,"cross-border-transfers"):true,gap:()=>({message:"Cross-border data transfers are indicated but the policy lacks a section describing the safeguards in place. The NDPA requires disclosure of transfer mechanisms and adequacy assessments.",fixType:"add_section",fixLabel:"Add cross-border section",suggestedContent:"Where we transfer personal data outside Nigeria, we ensure compliance with Sections 43 and 44 of the NDPA 2023 by implementing appropriate safeguards, including adequacy assessments and Standard Contractual Clauses."})},{id:"automated-decision-disclosure",name:"Automated Decision-Making Disclosure",ndpaSection:"NDPA Section 39",severity:"important",points:7,check:(e,t)=>t.hasAutomatedDecisions?o(e,"automated-decision-making"):true,gap:()=>({message:"Automated decision-making is indicated but the policy does not include a section disclosing this. The NDPA requires you to inform data subjects about automated decisions, including the logic involved and the right to human intervention.",fixType:"add_section",fixLabel:"Add automated decisions section",suggestedContent:"We use automated decision-making in certain processes. You have the right to request human intervention, express your point of view, and contest automated decisions, in accordance with Section 39 of the NDPA 2023."})},{id:"children-data-protection",name:"Children's Data Protection",ndpaSection:"NDPA Section 31",severity:"recommended",points:5,check:(e,t)=>t.hasChildrenData?o(e,"children-data-protection"):true,gap:()=>({message:"Children's data processing is indicated but the policy does not include a dedicated children's data protection section. The NDPA requires enhanced protections including parental consent for children under 13.",fixType:"add_section",fixLabel:"Add children's data section",suggestedContent:"We do not knowingly collect personal data from children under the age of 13 without verifiable parental or guardian consent. Parents and guardians may request access to, correction of, or deletion of their child's data at any time."})},{id:"dpo-contact-info",name:"DPO Contact Information",ndpaSection:"NDPA Section 30",severity:"recommended",points:5,check:e=>{var t,i;return ((t=e.organizationInfo.dpoName)!=null?t:"").trim().length>0&&((i=e.organizationInfo.dpoEmail)!=null?i:"").trim().length>0},gap:()=>({message:"The Data Protection Officer (DPO) contact information is not provided. While not always mandatory, appointing a DPO and publishing their contact details is strongly recommended under the NDPA.",fixType:"fill_field",fixLabel:"Add DPO details",suggestedContent:"Provide the full name and email address of your Data Protection Officer in the Organisation Info section."})},{id:"security-measures",name:"Security Measures Described",ndpaSection:"NDPA Section 28",severity:"recommended",points:5,check:e=>o(e,"data-security"),gap:()=>({message:"The policy does not describe the technical and organisational security measures in place to protect personal data. Describing these measures builds trust and demonstrates NDPA compliance.",fixType:"add_section",fixLabel:"Add security section",suggestedContent:"We implement appropriate technical and organisational measures to protect personal data, including encryption in transit and at rest, access controls, regular security assessments, and incident response procedures aligned with NDPA breach notification requirements."})},{id:"policy-effective-date",name:"Policy Effective Date",ndpaSection:"NDPA Section 24",severity:"recommended",points:5,check:e=>e.effectiveDate>0,gap:()=>({message:"The policy does not have an effective date set. An effective date is important for version control and for data subjects to know when the policy was last updated.",fixType:"fill_field",fixLabel:"Set effective date",suggestedContent:"Set the policy's effective date to the date you intend to publish it."})}];function P(e,t){let i=u.reduce((n,d)=>n+d.points,0),a$1=0,s=[],l=[];for(let n of u)if(n.check(e,t))a$1+=n.points,l.push(n.id);else {let d=n.gap(t);s.push(a({requirementId:n.id,requirement:n.name,ndpaSection:n.ndpaSection,severity:n.severity},d));}let h=Math.round(a$1/i*100),r;return a$1>=100?r="compliant":a$1>=80?r="nearly_compliant":r="not_compliant",{score:a$1,maxScore:i,percentage:h,rating:r,gaps:s,passed:l}}
|
|
14
|
-
export{m as a,f as b,P as c};//# sourceMappingURL=chunk-
|
|
15
|
-
//# sourceMappingURL=chunk-
|
|
14
|
+
export{m as a,f as b,P as c};//# sourceMappingURL=chunk-I557S566.mjs.map
|
|
15
|
+
//# sourceMappingURL=chunk-I557S566.mjs.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {a}from'./chunk-KSERBMXW.mjs';import {a as a$1}from'./chunk-AYKLAEOU.mjs';import {d,b,a as a$2}from'./chunk-WWT2ZSNU.mjs';import Gr,{useId,useState,useEffect}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var vr=["Organization","Data Collection","Processing","Review & Export"],lr=({currentStep:d,classNames:p,unstyled:r})=>jsx("nav",{"data-ndpr-component":"policy-step-indicator","aria-label":"Policy wizard progress",className:a$1("w-full flex items-center justify-between px-2 py-4",p==null?void 0:p.root,r),children:vr.map((e,n)=>{let t=n+1,i=t<d,u=t===d,l=n===vr.length-1;return jsxs(Gr.Fragment,{children:[jsxs("div",{className:a$1("flex flex-col items-center gap-1",p==null?void 0:p.stepWrapper,r),children:[jsx("div",{"aria-current":u?"step":void 0,"aria-label":`Step ${t}: ${e}${i?" (completed)":u?" (current)":""}`,className:a$1(["flex items-center justify-center rounded-full border-2 font-semibold transition-all",i?"w-8 h-8 bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))]":u?"w-9 h-9 bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] shadow-md":"w-8 h-8 bg-white dark:bg-gray-900 border-gray-300 dark:border-gray-600 text-gray-400 dark:text-gray-500"].join(" "),i?p==null?void 0:p.stepCompleted:u?p==null?void 0:p.stepCurrent:p==null?void 0:p.stepUpcoming,r),children:i?jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):jsx("span",{className:"text-xs leading-none",children:t})}),jsx("span",{className:a$1(["text-xs font-medium hidden sm:block",i||u?"text-[rgb(var(--ndpr-primary))]":"ndpr-card__subtitle"].join(" "),p==null?void 0:p.stepLabel,r),children:e})]}),!l&&jsx("div",{className:a$1(["flex-1 h-0.5 mx-2",i?"bg-[rgb(var(--ndpr-primary))]":"bg-gray-200 dark:bg-gray-700"].join(" "),p==null?void 0:p.connector,r),"aria-hidden":"true"})]},t)})});var $="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 ndpr-text-foreground focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",Vr="block text-sm font-medium ndpr-text-muted mb-1",A=({id:d,label:p,required:r,description:e,children:n,classNames:t,unstyled:i})=>{let u=e?`${d}-desc`:void 0;return jsxs("div",{className:a$1("flex flex-col",t==null?void 0:t.field,i),children:[jsxs("label",{htmlFor:d,className:a$1(Vr,t==null?void 0:t.label,i),children:[p,r&&jsx("span",{className:"text-red-500 ml-0.5","aria-hidden":"true",children:"*"})]}),e&&jsx("p",{id:u,className:"text-xs ndpr-text-muted mb-1",children:e}),n]})},fr=({context:d,onUpdateOrg:p,classNames:r,unstyled:e})=>{var i,u,b;let n=useId(),t=d.org;return jsxs("div",{"data-ndpr-component":"policy-step-about",className:a$1("ndpr-form-section",r==null?void 0:r.root,e),children:[jsxs("div",{children:[jsx("h2",{className:a$1("ndpr-section-heading",r==null?void 0:r.heading,e),children:"Organisation Details"}),jsxs("p",{className:a$1("ndpr-form-field__hint",r==null?void 0:r.subheading,e),children:["Tell us about your organisation. Fields marked ",jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})," are required."]})]}),jsxs("div",{className:a$1("grid grid-cols-1 md:grid-cols-2 gap-4",r==null?void 0:r.grid,e),children:[jsx(A,{id:`${n}-org-name`,label:"Organisation Name",required:true,classNames:r,unstyled:e,children:jsx("input",{id:`${n}-org-name`,type:"text",value:t.name,onChange:l=>p({name:l.target.value}),placeholder:"Acme Corporation",className:a$1($,r==null?void 0:r.input,e),"aria-required":"true"})}),jsx(A,{id:`${n}-website`,label:"Website",required:true,classNames:r,unstyled:e,children:jsx("input",{id:`${n}-website`,type:"url",value:t.website,onChange:l=>p({website:l.target.value}),placeholder:"https://example.com",className:a$1($,r==null?void 0:r.input,e),"aria-required":"true"})}),jsx(A,{id:`${n}-privacy-email`,label:"Privacy Contact Email",required:true,classNames:r,unstyled:e,children:jsx("input",{id:`${n}-privacy-email`,type:"email",value:t.privacyEmail,onChange:l=>p({privacyEmail:l.target.value}),placeholder:"privacy@example.com",className:a$1($,r==null?void 0:r.input,e),"aria-required":"true"})}),jsx(A,{id:`${n}-industry`,label:"Industry",classNames:r,unstyled:e,children:jsxs("select",{id:`${n}-industry`,value:t.industry,onChange:l=>p({industry:l.target.value}),className:a$1($,r==null?void 0:r.select,e),children:[jsx("option",{value:"fintech",children:"Fintech"}),jsx("option",{value:"healthcare",children:"Healthcare"}),jsx("option",{value:"ecommerce",children:"E-commerce"}),jsx("option",{value:"saas",children:"SaaS"}),jsx("option",{value:"education",children:"Education"}),jsx("option",{value:"government",children:"Government"}),jsx("option",{value:"other",children:"Other"})]})}),jsx(A,{id:`${n}-dpo-name`,label:"Data Protection Officer (DPO) Name",classNames:r,unstyled:e,children:jsx("input",{id:`${n}-dpo-name`,type:"text",value:(i=t.dpoName)!=null?i:"",onChange:l=>p({dpoName:l.target.value}),placeholder:"Jane Smith",className:a$1($,r==null?void 0:r.input,e)})}),jsx(A,{id:`${n}-dpo-email`,label:"DPO Email",classNames:r,unstyled:e,children:jsx("input",{id:`${n}-dpo-email`,type:"email",value:(u=t.dpoEmail)!=null?u:"",onChange:l=>p({dpoEmail:l.target.value}),placeholder:"dpo@example.com",className:a$1($,r==null?void 0:r.input,e)})}),jsx(A,{id:`${n}-address`,label:"Registered Address",classNames:r,unstyled:e,children:jsx("input",{id:`${n}-address`,type:"text",value:(b=t.address)!=null?b:"",onChange:l=>p({address:l.target.value}),placeholder:"1 Victoria Island, Lagos, Nigeria",className:a$1($,r==null?void 0:r.input,e)})}),jsx(A,{id:`${n}-org-size`,label:"Organisation Size",classNames:r,unstyled:e,children:jsxs("select",{id:`${n}-org-size`,value:t.orgSize,onChange:l=>p({orgSize:l.target.value}),className:a$1($,r==null?void 0:r.select,e),children:[jsx("option",{value:"startup",children:"Startup (1\u201350 employees)"}),jsx("option",{value:"midsize",children:"Mid-size (51\u2013500 employees)"}),jsx("option",{value:"enterprise",children:"Enterprise (500+ employees)"})]})}),jsx(A,{id:`${n}-country`,label:"Country of Operation",classNames:r,unstyled:e,children:jsx("input",{id:`${n}-country`,type:"text",value:t.country,onChange:l=>p({country:l.target.value}),placeholder:"Nigeria",className:a$1($,r==null?void 0:r.input,e)})})]})]})};var Xr={identity:"Identity",financial:"Financial",behavioral:"Behavioural",sensitive:"Sensitive",children:"Children"},Yr=["identity","financial","behavioral","sensitive","children"],Jr=["sensitive","children"],xr=({categories:d,onToggle:p,classNames:r,unstyled:e})=>{let n=Yr.reduce((t,i)=>{let u=d.filter(b=>b.group===i);return u.length>0&&(t[i]=u),t},{});return jsxs("div",{"data-ndpr-component":"policy-step-data",className:a$1("space-y-8",r==null?void 0:r.root,e),children:[jsxs("div",{children:[jsx("h2",{className:a$1("ndpr-section-heading",r==null?void 0:r.heading,e),children:"Data Categories"}),jsx("p",{id:"data-categories-desc",className:a$1("ndpr-form-field__hint",r==null?void 0:r.subheading,e),children:"Select the categories of personal data your organisation collects. You must select at least one."})]}),Object.entries(n).map(([t,i])=>{let u=Jr.includes(t);return jsxs("div",{className:a$1("space-y-3",r==null?void 0:r.group,e),children:[jsxs("div",{className:a$1("flex items-center gap-2",r==null?void 0:r.groupHeader,e),children:[jsx("h3",{className:a$1("text-sm font-semibold uppercase tracking-wide ndpr-text-muted",r==null?void 0:r.groupTitle,e),children:Xr[t]}),u&&jsx("span",{className:a$1("text-xs font-medium ndpr-text-warning bg-amber-50 dark:bg-amber-900/20 px-2 py-0.5 rounded-full",r==null?void 0:r.sensitiveTag,e),children:"Sensitive"})]}),u&&jsx("p",{className:a$1("text-xs ndpr-text-warning",r==null?void 0:r.sensitiveWarning,e),children:t==="children"?"Processing children's data requires parental consent under NDPA Section 31 and imposes heightened obligations.":"Sensitive/special-category data requires explicit consent and additional safeguards under NDPA Section 30."}),jsx("div",{className:a$1("grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",r==null?void 0:r.cardsGrid,e),children:i.map(b=>jsx("button",{type:"button",onClick:()=>p(b.id),"aria-pressed":b.selected,className:a$1(["text-left rounded-lg border p-4 transition-all cursor-pointer focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",b.selected?"bg-[rgb(var(--ndpr-primary))]/5 border-[rgb(var(--ndpr-primary))] dark:bg-[rgb(var(--ndpr-primary))]/10":"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"].join(" "),r==null?void 0:r.card,e),children:jsxs("div",{className:"flex items-start gap-3",children:[jsx("div",{className:a$1(["mt-0.5 w-4 h-4 rounded border-2 flex-shrink-0 flex items-center justify-center",b.selected?"bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))]":"border-gray-300 dark:border-gray-600"].join(" "),r==null?void 0:r.checkbox,e),"aria-hidden":"true",children:b.selected&&jsx("svg",{className:"w-2.5 h-2.5 text-[rgb(var(--ndpr-primary-foreground))]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),jsxs("div",{className:"min-w-0",children:[jsx("p",{className:a$1("text-sm font-medium ndpr-text-foreground",r==null?void 0:r.cardLabel,e),children:b.label}),jsx("p",{className:a$1("text-xs ndpr-text-muted mt-1 leading-relaxed",r==null?void 0:r.cardDataPoints,e),children:b.dataPoints.join(", ")})]})]})},b.id))})]},t)})]})};var Qr=[{value:"service_delivery",label:"Service Delivery",description:"Processing required to deliver the core product or service."},{value:"marketing",label:"Marketing & Communications",description:"Sending promotional messages, newsletters or offers."},{value:"analytics",label:"Analytics & Insights",description:"Analysing usage patterns to improve the product."},{value:"research",label:"Research & Development",description:"Using data to develop new features or products."},{value:"legal_compliance",label:"Legal Compliance",description:"Meeting statutory, regulatory or contractual obligations."},{value:"fraud_prevention",label:"Fraud Prevention & Security",description:"Detecting and preventing fraudulent activity."}],dr="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 ndpr-text-foreground focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",pr="ndpr-card ndpr-card--compact",gr=({id:d,checked:p,onChange:r})=>jsx("button",{id:d,type:"button",role:"switch","aria-checked":p,onClick:()=>r(!p),className:["relative inline-flex h-6 w-11 flex-shrink-0 rounded-full border-2 border-transparent cursor-pointer transition-colors focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",p?"bg-[rgb(var(--ndpr-primary))]":"bg-gray-200 dark:bg-gray-600"].join(" "),children:jsx("span",{"aria-hidden":"true",className:["pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition-transform",p?"translate-x-5":"translate-x-0"].join(" ")})}),hr=({context:d,onTogglePurpose:p,onUpdateContext:r,onAddProcessor:e,onRemoveProcessor:n,classNames:t,unstyled:i})=>{let u=useId(),[b$1,l]=useState({name:"",purpose:"",country:""}),[C,g]=useState(false),a=()=>{let{name:v,purpose:c,country:S}=b$1;!v.trim()||!c.trim()||!S.trim()||(e({name:v.trim(),purpose:c.trim(),country:S.trim()}),l({name:"",purpose:"",country:""}),g(false));};return jsxs("div",{"data-ndpr-component":"policy-step-processing",className:a$1("ndpr-form-section",t==null?void 0:t.root,i),children:[jsxs("div",{children:[jsx("h2",{className:a$1("ndpr-section-heading",t==null?void 0:t.heading,i),children:"Processing Details"}),jsx("p",{className:a$1("ndpr-form-field__hint",t==null?void 0:t.subheading,i),children:"Define how and why you process personal data."})]}),jsxs("section",{className:a$1(pr,t==null?void 0:t.section,i),"aria-labelledby":"purposes-heading",children:[jsx("h3",{id:"purposes-heading",className:a$1("text-base font-semibold ndpr-text-foreground",t==null?void 0:t.sectionTitle,i),children:"Processing Purposes"}),jsx("p",{className:a$1("ndpr-form-field__hint",t==null?void 0:t.sectionDescription,i),children:"Select all purposes for which you process personal data. At least one is required."}),jsx("div",{className:a$1("space-y-3",t==null?void 0:t.purposeList,i),children:Qr.map(v=>{let c=d.purposes.includes(v.value),S=`${u}-purpose-${v.value}`,B=`${u}-purpose-desc-${v.value}`;return jsxs("label",{htmlFor:S,className:a$1("flex items-start gap-3 cursor-pointer group",t==null?void 0:t.purposeItem,i),children:[jsx("input",{id:S,type:"checkbox",checked:c,onChange:()=>p(v.value),"aria-describedby":B,className:a$1("mt-0.5 h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))] cursor-pointer",t==null?void 0:t.purposeCheckbox,i)}),jsxs("div",{children:[jsx("p",{className:a$1("text-sm font-medium ndpr-text-foreground",t==null?void 0:t.purposeLabel,i),children:v.label}),jsx("p",{id:B,className:a$1("ndpr-form-field__hint",t==null?void 0:t.purposeDescription,i),children:v.description})]})]},v.value)})})]}),jsxs("section",{className:a$1(pr,t==null?void 0:t.section,i),"aria-labelledby":"thirdparty-heading",children:[jsxs("div",{className:"flex items-center justify-between",children:[jsx("h3",{id:"thirdparty-heading",className:a$1("text-base font-semibold ndpr-text-foreground",t==null?void 0:t.sectionTitle,i),children:"Third-Party Data Sharing"}),jsx(gr,{id:`${u}-thirdparty-toggle`,checked:d.thirdPartyProcessors.length>0||C,onChange:v=>{v?g(true):(d.thirdPartyProcessors.forEach((c,S)=>n(0)),g(false));}})]}),(d.thirdPartyProcessors.length>0||C)&&jsxs("div",{className:a$1("ndpr-form-section",t==null?void 0:t.processorSection,i),children:[d.thirdPartyProcessors.length>0&&jsx("div",{className:a$1("overflow-x-auto",t==null?void 0:t.processorTable,i),children:jsxs("table",{className:"w-full text-sm",children:[jsx("thead",{children:jsxs("tr",{className:a$1("text-left text-xs font-medium ndpr-text-muted border-b border-gray-200 dark:border-gray-700",t==null?void 0:t.tableHeader,i),children:[jsx("th",{className:"pb-2 pr-4",children:"Name"}),jsx("th",{className:"pb-2 pr-4",children:"Purpose"}),jsx("th",{className:"pb-2 pr-4",children:"Country"}),jsx("th",{className:"pb-2"})]})}),jsx("tbody",{className:"divide-y divide-gray-100 dark:divide-gray-700",children:d.thirdPartyProcessors.map((v,c)=>jsxs("tr",{children:[jsx("td",{className:a$1("py-2 pr-4 ndpr-text-foreground",t==null?void 0:t.tableCell,i),children:v.name}),jsx("td",{className:a$1("py-2 pr-4 ndpr-text-muted",t==null?void 0:t.tableCell,i),children:v.purpose}),jsx("td",{className:a$1("py-2 pr-4 ndpr-text-muted",t==null?void 0:t.tableCell,i),children:v.country}),jsx("td",{className:"py-2",children:jsx("button",{type:"button",onClick:()=>n(c),className:a$1("text-red-500 hover:ndpr-text-destructive dark:hover:text-red-300 text-xs font-medium",t==null?void 0:t.removeButton,i),"aria-label":`Remove ${v.name}`,children:"Remove"})})]},c))})]})}),C?jsxs("div",{className:a$1("grid grid-cols-1 sm:grid-cols-3 gap-3 items-end",t==null?void 0:t.processorForm,i),children:[jsxs("div",{children:[jsx("label",{htmlFor:`${u}-proc-name`,className:"block text-xs font-medium ndpr-text-muted mb-1",children:"Processor Name"}),jsx("input",{id:`${u}-proc-name`,type:"text",placeholder:"Processor name",value:b$1.name,onChange:v=>l(c=>b(a$2({},c),{name:v.target.value})),"aria-required":"true",className:a$1(dr,t==null?void 0:t.input,i)})]}),jsxs("div",{children:[jsx("label",{htmlFor:`${u}-proc-purpose`,className:"block text-xs font-medium ndpr-text-muted mb-1",children:"Purpose"}),jsx("input",{id:`${u}-proc-purpose`,type:"text",placeholder:"Purpose",value:b$1.purpose,onChange:v=>l(c=>b(a$2({},c),{purpose:v.target.value})),"aria-required":"true",className:a$1(dr,t==null?void 0:t.input,i)})]}),jsxs("div",{children:[jsx("label",{htmlFor:`${u}-proc-country`,className:"block text-xs font-medium ndpr-text-muted mb-1",children:"Country"}),jsx("input",{id:`${u}-proc-country`,type:"text",placeholder:"Country",value:b$1.country,onChange:v=>l(c=>b(a$2({},c),{country:v.target.value})),"aria-required":"true",className:a$1(dr,t==null?void 0:t.input,i)})]}),jsxs("div",{className:"sm:col-span-3 flex gap-2",children:[jsx("button",{type:"button",onClick:a,className:a$1("ndpr-button ndpr-button--primary ndpr-button--sm",t==null?void 0:t.addButton,i),children:"Add Processor"}),jsx("button",{type:"button",onClick:()=>g(false),className:a$1("ndpr-button ndpr-button--secondary ndpr-button--sm",t==null?void 0:t.cancelButton,i),children:"Cancel"})]})]}):jsxs("button",{type:"button",onClick:()=>g(true),className:a$1("flex items-center gap-1 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",t==null?void 0:t.addLink,i),children:[jsx("span",{"aria-hidden":"true",children:"+"})," Add processor"]})]})]}),jsxs("section",{className:a$1(pr,t==null?void 0:t.section,i),"aria-labelledby":"disclosures-heading",children:[jsx("h3",{id:"disclosures-heading",className:a$1("text-base font-semibold ndpr-text-foreground",t==null?void 0:t.sectionTitle,i),children:"Additional Disclosures"}),jsxs("div",{className:a$1("ndpr-form-section",t==null?void 0:t.disclosureList,i),children:[jsxs("div",{className:a$1("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxs("div",{children:[jsx("p",{id:`${u}-cross-border-label`,className:a$1("text-sm font-medium ndpr-text-foreground",t==null?void 0:t.disclosureLabel,i),children:"Cross-border Data Transfers"}),jsx("p",{id:`${u}-cross-border-desc`,className:a$1("text-xs ndpr-text-muted mt-0.5",t==null?void 0:t.disclosureDescription,i),children:"Do you transfer personal data outside Nigeria? This triggers NDPA Chapter 6 obligations."})]}),jsx(gr,{id:`${u}-cross-border-toggle`,checked:d.hasCrossBorderTransfer,onChange:v=>r({hasCrossBorderTransfer:v})})]}),jsxs("div",{className:a$1("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxs("div",{children:[jsx("p",{id:`${u}-automated-label`,className:a$1("text-sm font-medium ndpr-text-foreground",t==null?void 0:t.disclosureLabel,i),children:"Automated Decision-Making / Profiling"}),jsx("p",{id:`${u}-automated-desc`,className:a$1("text-xs ndpr-text-muted mt-0.5",t==null?void 0:t.disclosureDescription,i),children:"Do you use algorithms or automated systems to make decisions about individuals? Requires disclosure under NDPA Section 37."})]}),jsx(gr,{id:`${u}-automated-toggle`,checked:d.hasAutomatedDecisions,onChange:v=>r({hasAutomatedDecisions:v})})]})]})]})]})};var Cr=({section:d,index:p,isCustom:r,isEditing:e,editedContent:n,onEdit:t,onSaveEdit:i,onCancelEdit:u,onMoveUp:b,onMoveDown:l,onDelete:C,classNames:g,unstyled:a})=>{let[v,c]=useState(n!=null?n:d.template);return useEffect(()=>{n!==void 0&&c(n);},[n]),useEffect(()=>{e&&c(n!=null?n:d.template);},[e,n,d.template]),jsxs("div",{"data-ndpr-component":"policy-section-card",className:a$1("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-3",g==null?void 0:g.root,a),children:[jsxs("div",{className:a$1("flex items-start justify-between gap-2",g==null?void 0:g.header,a),children:[jsxs("div",{className:a$1("flex items-center gap-3 min-w-0",g==null?void 0:g.titleRow,a),children:[jsx("span",{className:a$1("flex-shrink-0 w-7 h-7 rounded-full bg-gray-100 dark:bg-gray-700 ndpr-text-muted text-xs font-semibold flex items-center justify-center",g==null?void 0:g.sectionNumber,a),"aria-hidden":"true",children:p+1}),jsxs("h4",{className:a$1("text-sm font-semibold ndpr-text-foreground truncate",g==null?void 0:g.sectionTitle,a),children:[d.title,r&&jsx("span",{className:a$1("ml-2 text-xs font-normal ndpr-text-muted bg-gray-100 dark:bg-gray-700 px-1.5 py-0.5 rounded",g==null?void 0:g.customBadge,a),children:"Custom"})]})]}),jsxs("div",{className:a$1("flex items-center gap-1 flex-shrink-0",g==null?void 0:g.actions,a),children:[b&&jsx("button",{type:"button",onClick:b,className:a$1("ndpr-button ndpr-button--icon",g==null?void 0:g.moveButton,a),"aria-label":`Move "${d.title}" up`,children:jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})})}),l&&jsx("button",{type:"button",onClick:l,className:a$1("ndpr-button ndpr-button--icon",g==null?void 0:g.moveButton,a),"aria-label":`Move "${d.title}" down`,children:jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}),!e&&jsx("button",{type:"button",onClick:t,className:a$1("p-1.5 text-gray-400 hover:text-[rgb(var(--ndpr-primary))] rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",g==null?void 0:g.editButton,a),"aria-label":`Edit "${d.title}"`,children:jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),r&&C&&jsx("button",{type:"button",onClick:C,className:a$1("p-1.5 text-gray-400 hover:text-red-500 dark:hover:text-red-400 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",g==null?void 0:g.deleteButton,a),"aria-label":`Delete "${d.title}"`,children:jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]}),e?jsxs("div",{className:a$1("space-y-2",g==null?void 0:g.editArea,a),children:[jsx("textarea",{value:v,onChange:S=>c(S.target.value),rows:8,className:a$1("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 ndpr-text-foreground focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm font-mono resize-y",g==null?void 0:g.textarea,a),"aria-label":`Edit content for ${d.title}`}),jsxs("div",{className:a$1("flex gap-2",g==null?void 0:g.editActions,a),children:[jsx("button",{type:"button",onClick:()=>i(v),className:a$1("ndpr-button ndpr-button--primary ndpr-button--sm",g==null?void 0:g.saveButton,a),children:"Save"}),jsx("button",{type:"button",onClick:u,className:a$1("ndpr-button ndpr-button--secondary ndpr-button--sm",g==null?void 0:g.cancelButton,a),children:"Cancel"})]})]}):jsx("div",{className:a$1("text-sm ndpr-text-muted leading-relaxed line-clamp-4 whitespace-pre-wrap",g==null?void 0:g.content,a),children:d.template})]})};var kr="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 ndpr-text-foreground focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",wr=({onAdd:d,nextOrder:p,classNames:r,unstyled:e})=>{let n=useId(),[t,i]=useState(""),[u,b]=useState(""),[l,C]=useState(""),g=()=>{if(!t.trim()){C("Section title is required.");return}if(!u.trim()){C("Section content is required.");return}C(""),d({title:t.trim(),content:u.trim(),order:p}),i(""),b("");};return jsxs("div",{"data-ndpr-component":"custom-section-form",className:a$1("ndpr-card ndpr-card--compact",r==null?void 0:r.root,e),children:[jsx("h4",{className:a$1("ndpr-section-heading",r==null?void 0:r.heading,e),children:"Add Custom Section"}),l&&jsx("p",{role:"alert",className:a$1("text-xs ndpr-text-destructive",r==null?void 0:r.error,e),children:l}),jsxs("div",{className:a$1("space-y-3",r==null?void 0:r.fields,e),children:[jsxs("div",{children:[jsxs("label",{htmlFor:`${n}-custom-section-title`,className:a$1("block text-xs font-medium ndpr-text-muted mb-1",r==null?void 0:r.label,e),children:["Section Title ",jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsx("input",{id:`${n}-custom-section-title`,type:"text",value:t,onChange:a=>{i(a.target.value),l&&C("");},placeholder:"e.g. Cookie Policy",className:a$1(kr,r==null?void 0:r.input,e),"aria-required":"true"})]}),jsxs("div",{children:[jsxs("label",{htmlFor:`${n}-custom-section-content`,className:a$1("block text-xs font-medium ndpr-text-muted mb-1",r==null?void 0:r.label,e),children:["Content ",jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsx("textarea",{id:`${n}-custom-section-content`,value:u,onChange:a=>{b(a.target.value),l&&C("");},placeholder:"Write the section content here...",rows:5,className:a$1(`${kr} resize-y`,r==null?void 0:r.textarea,e),"aria-required":"true"})]})]}),jsx("div",{className:a$1("flex items-center gap-2",r==null?void 0:r.footer,e),children:jsx("button",{type:"button",onClick:g,className:a$1("ndpr-button ndpr-button--primary ndpr-button--sm",r==null?void 0:r.addButton,e),children:"Add Section"})})]})};var Sr={compliant:{bg:"ndpr-alert ndpr-alert--success",text:"ndpr-text-success",border:"border-green-200 dark:border-green-700"},nearly_compliant:{bg:"bg-amber-50 dark:bg-amber-900/20",text:"ndpr-text-warning",border:"border-amber-200 dark:border-amber-700"},not_compliant:{bg:"ndpr-alert ndpr-alert--destructive",text:"ndpr-text-destructive",border:"border-red-200 dark:border-red-700"}},sr={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},N=({icon:d,label:p,description:r,actionLabel:e,loading:n,onClick:t,classNames:i,unstyled:u})=>jsxs("div",{className:a$1("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 flex flex-col gap-3",i==null?void 0:i.formatCard,u),children:[jsxs("div",{className:a$1("flex items-center gap-3",i==null?void 0:i.formatHeader,u),children:[jsx("div",{className:a$1("w-10 h-10 rounded-lg bg-gray-100 dark:bg-gray-700 flex items-center justify-center flex-shrink-0",i==null?void 0:i.formatIcon,u),"aria-hidden":"true",children:d}),jsxs("div",{className:"min-w-0",children:[jsx("p",{className:a$1("ndpr-section-heading",i==null?void 0:i.formatLabel,u),children:p}),jsx("p",{className:a$1("ndpr-form-field__hint",i==null?void 0:i.formatDescription,u),children:r})]})]}),jsx("button",{type:"button",onClick:t,disabled:n,className:a$1("w-full px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2",i==null?void 0:i.formatButton,u),children:n?jsxs(Fragment,{children:[jsxs("svg",{className:"animate-spin w-4 h-4",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),"Generating\u2026"]}):e})]}),mr=({complianceResult:d$1,onExportPDF:p,onExportDOCX:r,onExportHTML:e,onExportMarkdown:n,classNames:t,unstyled:i})=>{var c;let[u,b]=useState(false),[l,C]=useState(false),g=(c=Sr[d$1.rating])!=null?c:Sr.not_compliant,a=()=>d(null,null,function*(){b(true);try{yield p();}finally{b(false);}}),v=()=>d(null,null,function*(){C(true);try{yield r();}finally{C(false);}});return jsxs("div",{"data-ndpr-component":"policy-export-panel",className:a$1("ndpr-form-section",t==null?void 0:t.root,i),children:[jsxs("div",{className:a$1(`rounded-lg border p-4 flex items-center gap-4 ${g.bg} ${g.border}`,t==null?void 0:t.complianceSummary,i),children:[jsxs("div",{className:a$1(`text-3xl font-bold ${g.text}`,t==null?void 0:t.complianceScore,i),"aria-label":`Compliance score: ${d$1.percentage}%`,children:[d$1.percentage,"%"]}),jsxs("div",{children:[jsx("p",{className:a$1(`text-sm font-semibold ${g.text}`,t==null?void 0:t.complianceRating,i),children:sr[d$1.rating]}),jsxs("p",{className:a$1("text-xs ndpr-text-muted mt-0.5",t==null?void 0:t.complianceDetail,i),children:[d$1.score," / ",d$1.maxScore," points \u2022"," ",d$1.gaps.length," gap",d$1.gaps.length!==1?"s":""," remaining"]})]})]}),jsxs("div",{children:[jsx("h3",{className:a$1("ndpr-section-heading",t==null?void 0:t.formatsHeading,i),children:"Export Format"}),jsxs("div",{className:a$1("grid grid-cols-1 sm:grid-cols-2 gap-3",t==null?void 0:t.formatsGrid,i),children:[jsx(N,{icon:jsx("svg",{className:"w-5 h-5 text-red-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-3 7v-1h4v1h-4zm0-3v-1h4v1h-4zm-2-5h8v1H8v-1z"})}),label:"PDF",description:"Professional formatted document, ideal for publishing.",actionLabel:"Download PDF",loading:u,onClick:a,classNames:t,unstyled:i}),jsx(N,{icon:jsx("svg",{className:"w-5 h-5 text-blue-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-5 8v-5h1.5l1 3 1-3H13v5h-1v-3.5l-.75 2.25h-.5L10 13.5V17H9zm5-1.5h.75c.55 0 .75-.25.75-.75 0-.4-.2-.65-.75-.65H14V15.5zm1 1.5h-2v-4h2c1.1 0 1.75.6 1.75 1.5 0 .55-.25.95-.65 1.15.5.2.8.65.8 1.2 0 1-.65 1.65-1.9 1.65V17zm-.25-1c.6 0 .9-.25.9-.75 0-.45-.3-.75-.9-.75H14V16h.75z"})}),label:"DOCX",description:"Editable Word document for further customisation.",actionLabel:"Download DOCX",loading:l,onClick:v,classNames:t,unstyled:i}),jsx(N,{icon:jsxs("svg",{className:"w-5 h-5 text-orange-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 15H9V8h2v9zm4 0h-2V8h2v9z"}),jsx("path",{d:"M9.5 6.5h1v1h-1zm4 0h1v1h-1z"}),jsx("path",{d:"M5 5h14v2H5zm0 12h14v2H5z"})]}),label:"HTML",description:"Copy-ready HTML to embed on your website.",actionLabel:"Copy HTML",onClick:e,classNames:t,unstyled:i}),jsx(N,{icon:jsx("svg",{className:"w-5 h-5 ndpr-text-muted",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsx("path",{d:"M3 5h18v2H3V5zm0 4h12v2H3V9zm0 4h18v2H3v-2zm0 4h12v2H3v-2z"})}),label:"Markdown",description:"Plain-text format for documentation or Git repos.",actionLabel:"Copy Markdown",onClick:n,classNames:t,unstyled:i})]})]})]})};var Lr=({sections:d,customSections:p,sectionOverrides:r,complianceResult:e,onEditSection:n,onAddCustomSection:t,onRemoveCustomSection:i,onReorderSection:u,onExportPDF:b$1,onExportDOCX:l,onExportHTML:C,onExportMarkdown:g,classNames:a,unstyled:v})=>{let[c,S]=useState(null),[B,J]=useState(false),Z=new Set(p.map(h=>h.id)),or=(h,D)=>{n(h,D),S(null);},er=d.length>0?Math.max(...d.map(h=>{var D;return (D=h.order)!=null?D:0}))+1:1;return jsxs("div",{"data-ndpr-component":"policy-step-review",className:a$1("ndpr-form-section",a==null?void 0:a.root,v),children:[jsxs("div",{children:[jsx("h2",{className:a$1("ndpr-section-heading",a==null?void 0:a.heading,v),children:"Review & Export"}),jsx("p",{className:a$1("ndpr-form-field__hint",a==null?void 0:a.subheading,v),children:"Review your generated policy sections, reorder or edit content, then export."})]}),jsx("div",{className:a$1("space-y-3",a==null?void 0:a.sectionList,v),"aria-live":"polite",children:d.map((h,D)=>jsx(Cr,{section:r[h.id]?b(a$2({},h),{template:r[h.id]}):h,index:D,isCustom:Z.has(h.id),isEditing:c===h.id,editedContent:r[h.id],onEdit:()=>S(h.id),onSaveEdit:ir=>or(h.id,ir),onCancelEdit:()=>S(null),onMoveUp:D>0?()=>u(h.id,"up"):void 0,onMoveDown:D<d.length-1?()=>u(h.id,"down"):void 0,onDelete:Z.has(h.id)?()=>i(h.id):void 0,classNames:a,unstyled:v},h.id))}),!B&&jsxs("button",{type:"button",onClick:()=>J(true),className:a$1("flex items-center gap-2 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",a==null?void 0:a.addSectionButton,v),children:[jsx("span",{className:a$1("w-5 h-5 rounded-full border-2 border-[rgb(var(--ndpr-primary))] flex items-center justify-center text-xs font-bold leading-none",a==null?void 0:a.addSectionIcon,v),"aria-hidden":"true",children:"+"}),"Add Custom Section"]}),B&&jsxs("div",{className:a$1("space-y-2",a==null?void 0:a.customFormWrapper,v),children:[jsx(wr,{onAdd:h=>{t(h),J(false);},nextOrder:er,classNames:a,unstyled:v}),jsx("button",{type:"button",onClick:()=>J(false),className:a$1("text-sm ndpr-text-muted hover:underline",a==null?void 0:a.cancelCustomForm,v),children:"Cancel"})]}),jsx("hr",{className:a$1("border-gray-200 dark:border-gray-700",a==null?void 0:a.divider,v)}),jsx(mr,{complianceResult:e,onExportPDF:b$1,onExportDOCX:l,onExportHTML:C,onExportMarkdown:g,classNames:a,unstyled:v})]})};var Dr={compliant:{stroke:"stroke-green-500 dark:stroke-green-400",text:"ndpr-text-success"},nearly_compliant:{stroke:"stroke-amber-500 dark:stroke-amber-400",text:"ndpr-text-warning"},not_compliant:{stroke:"stroke-red-500 dark:stroke-red-400",text:"ndpr-text-destructive"}},tt={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},Fr=({score:d,maxScore:p,rating:r,classNames:e,unstyled:n})=>{var C,g;let t=p>0?Math.round(d/p*100):0,i=(C=Dr[r])!=null?C:Dr.not_compliant,u=36,b=2*Math.PI*u,l=b-t/100*b;return jsxs("div",{"data-ndpr-component":"compliance-score-ring",className:a$1("flex flex-col items-center gap-2",e==null?void 0:e.root,n),children:[jsxs("div",{className:a$1("relative w-24 h-24",e==null?void 0:e.svgWrapper,n),children:[jsxs("svg",{className:"w-24 h-24 -rotate-90",viewBox:"0 0 96 96","aria-hidden":"true",children:[jsx("circle",{cx:"48",cy:"48",r:u,fill:"none",className:"stroke-gray-200 dark:stroke-gray-700",strokeWidth:"8"}),jsx("circle",{cx:"48",cy:"48",r:u,fill:"none",className:i.stroke,strokeWidth:"8",strokeLinecap:"round",strokeDasharray:b,strokeDashoffset:l,style:{transition:"stroke-dashoffset 0.5s ease-out"}})]}),jsx("div",{className:a$1("absolute inset-0 flex flex-col items-center justify-center",e==null?void 0:e.centerText,n),children:jsxs("span",{className:a$1(`text-xl font-bold leading-none ${i.text}`,e==null?void 0:e.scoreValue,n),"aria-label":`${t}% compliance score`,children:[t,"%"]})})]}),jsx("p",{className:a$1(`text-xs font-semibold text-center ${i.text}`,e==null?void 0:e.ratingLabel,n),children:(g=tt[r])!=null?g:r}),jsxs("p",{className:a$1("text-xs ndpr-text-muted text-center",e==null?void 0:e.scoreDetail,n),children:[d," / ",p," pts"]})]})};var et={critical:"ndpr-text-destructive",important:"ndpr-text-warning",recommended:"ndpr-text-info"},Er=({gap:d,isPassed:p,onFix:r,classNames:e,unstyled:n})=>{let[t,i]=useState(false);return jsxs("div",{"data-ndpr-component":"compliance-requirement-item",className:a$1("border-b border-gray-100 dark:border-gray-700 last:border-0 py-2",e==null?void 0:e.root,n),children:[jsxs("button",{type:"button",onClick:()=>!p&&i(u=>!u),className:a$1("w-full flex items-start gap-2 text-left group",e==null?void 0:e.row,n),"aria-expanded":p?void 0:t,"aria-disabled":p,children:[jsx("span",{className:a$1(["mt-0.5 flex-shrink-0 w-4 h-4 rounded-full flex items-center justify-center",p?"bg-green-500":d.severity==="critical"?"bg-red-500":d.severity==="important"?"bg-amber-500":"bg-blue-400"].join(" "),e==null?void 0:e.statusIcon,n),"aria-hidden":"true",children:p?jsx("svg",{className:"w-2.5 h-2.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):jsx("svg",{className:"w-2.5 h-2.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("div",{className:"flex items-center justify-between gap-1",children:[jsx("p",{className:a$1(`text-xs font-medium ${p?"ndpr-text-muted":"ndpr-text-foreground"}`,e==null?void 0:e.requirementLabel,n),children:d.requirement}),!p&&jsx("svg",{className:`flex-shrink-0 w-3 h-3 text-gray-400 transition-transform ${t?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),jsxs("p",{className:a$1("text-xs text-gray-400 dark:text-gray-500 mt-0.5",e==null?void 0:e.ndpaSection,n),children:["NDPA ",d.ndpaSection]})]})]}),!p&&t&&jsxs("div",{className:a$1("mt-2 ml-6 space-y-2",e==null?void 0:e.detail,n),children:[jsx("p",{className:a$1(`text-xs ${et[d.severity]}`,e==null?void 0:e.message,n),children:d.message}),jsx("button",{type:"button",onClick:()=>{r(d.requirementId),i(false);},className:a$1("text-xs font-medium px-3 py-1 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))]",e==null?void 0:e.fixButton,n),children:d.fixLabel})]})]})};function nt(d,p){let r=p.map(t=>({gap:{requirementId:t,requirement:t.split("-").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "),ndpaSection:"\u2014",severity:"recommended",message:"",fixType:"fill_field",fixLabel:""},isPassed:true})),e=d.map(t=>({gap:t,isPassed:false})),n={critical:0,important:1,recommended:2};return e.sort((t,i)=>n[t.gap.severity]-n[i.gap.severity]),[...e,...r]}var $r=({complianceResult:d,onFix:p,classNames:r,unstyled:e})=>{let[n,t]=useState(false),i=nt(d.gaps,d.passed);return jsxs("aside",{"data-ndpr-component":"compliance-checker-sidebar",className:a$1("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",r==null?void 0:r.root,e),"aria-label":"NDPA compliance checker",children:[jsxs("div",{className:a$1("flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/50",r==null?void 0:r.header,e),children:[jsx("h2",{className:a$1("ndpr-section-heading",r==null?void 0:r.title,e),children:"NDPA Compliance"}),jsx("button",{type:"button",onClick:()=>t(u=>!u),className:a$1("p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",r==null?void 0:r.collapseButton,e),"aria-expanded":!n,"aria-label":n?"Expand compliance checker":"Collapse compliance checker",children:jsx("svg",{className:`w-4 h-4 transition-transform ${n?"-rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})})]}),!n&&jsxs("div",{className:a$1("p-4 space-y-4",r==null?void 0:r.body,e),children:[jsx("div",{className:a$1("flex justify-center",r==null?void 0:r.ringWrapper,e),children:jsx(Fr,{score:d.score,maxScore:d.maxScore,rating:d.rating,classNames:r,unstyled:e})}),jsx("div",{className:a$1("grid grid-cols-3 gap-2 text-center",r==null?void 0:r.statsRow,e),children:[{count:d.gaps.filter(u=>u.severity==="critical").length,label:"Critical",color:"ndpr-text-destructive"},{count:d.gaps.filter(u=>u.severity==="important").length,label:"Important",color:"ndpr-text-warning"},{count:d.passed.length,label:"Passed",color:"ndpr-text-success"}].map(({count:u,label:b,color:l})=>jsxs("div",{children:[jsx("p",{className:a$1(`text-base font-bold ${l}`,r==null?void 0:r.statValue,e),children:u}),jsx("p",{className:a$1("ndpr-form-field__hint",r==null?void 0:r.statLabel,e),children:b})]},b))}),jsx("div",{className:a$1("overflow-y-auto max-h-80",r==null?void 0:r.requirementsList,e),children:i.length===0?jsx("p",{className:a$1("ndpr-empty-state",r==null?void 0:r.emptyState,e),children:"No requirements to display."}):i.map(({gap:u,isPassed:b})=>jsx(Er,{gap:u,isPassed:b,onFix:p,classNames:r,unstyled:e},u.requirementId))})]})]})};function dt(d){let p=Date.now()-d;return p<1e4?"just now":p<6e4?`${Math.floor(p/1e3)}s ago`:p<36e5?`${Math.floor(p/6e4)}m ago`:new Date(d).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}var Ir=({lastSavedAt:d,isSaving:p,hasError:r,classNames:e,unstyled:n})=>{let t="idle";if(p?t="saving":r?t="error":d!==null&&(t="saved"),t==="idle")return null;let i=t==="saving"?"Saving\u2026":t==="error"?"Unable to save":`Draft saved ${d?dt(d):""}`;return jsxs("div",{"data-ndpr-component":"draft-save-indicator",role:"status","aria-live":"polite","aria-atomic":"true",className:a$1(`flex items-center gap-1.5 ${t==="error"?"text-red-500 dark:text-red-400":t==="saving"?"ndpr-card__subtitle":"ndpr-text-success"}`,e==null?void 0:e.root,n),children:[t==="saving"&&jsxs("svg",{className:"animate-spin w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),t==="saved"&&jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),t==="error"&&jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})}),jsx("span",{className:a$1("text-xs font-medium",e==null?void 0:e.text,n),children:i})]})};var mo=({adapter:d$1,onComplete:p,classNames:r,unstyled:e})=>{let{currentStep:n,nextStep:t,prevStep:i,canProceed:u,context:b,updateOrg:l,updateContext:C,toggleDataCategory:g,togglePurpose:a$2,addProcessor:v,removeProcessor:c,sections:S,customSections:B,sectionOverrides:J,editSectionContent:Z,addCustomSection:or,removeCustomSection:er,reorderSections:h,complianceResult:D,applyFix:ir,handleExportPDF:Tr,handleExportDOCX:_r,handleExportHTML:Mr,handleExportMarkdown:Br,lastSavedAt:zr,isLoading:jr}=a({adapter:d$1,onComplete:p}),nr=(F,K)=>{let O=URL.createObjectURL(F),H=document.createElement("a");H.href=O,H.download=K,H.click(),URL.revokeObjectURL(O);},qr=()=>d(null,null,function*(){let F=yield Tr();nr(F,"privacy-policy.pdf");}),Or=()=>d(null,null,function*(){let F=yield _r();nr(F,"privacy-policy.docx");}),Hr=()=>{let F=Mr();navigator.clipboard.writeText(F).catch(()=>{let K=new Blob([F],{type:"text/html"}),O=URL.createObjectURL(K),H=window.open(O,"_blank");H?H.addEventListener("load",()=>URL.revokeObjectURL(O)):URL.revokeObjectURL(O);});},Wr=()=>{let F=Br();navigator.clipboard.writeText(F).catch(()=>{let K=new Blob([F],{type:"text/markdown"});nr(K,"privacy-policy.md");});};return jr?jsxs("div",{"data-ndpr-component":"adaptive-policy-wizard",className:a$1("flex items-center justify-center min-h-64 text-gray-400 dark:text-gray-500",r==null?void 0:r.root,e),"aria-busy":"true","aria-label":"Loading policy wizard",children:[jsxs("svg",{className:"animate-spin w-6 h-6 mr-2",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),jsx("span",{className:"ndpr-text-sm",children:"Loading\u2026"})]}):jsx("div",{"data-ndpr-component":"adaptive-policy-wizard",className:a$1("min-h-screen bg-gray-50 dark:bg-gray-900",r==null?void 0:r.root,e),children:jsxs("div",{className:a$1("max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",r==null?void 0:r.container,e),children:[jsxs("div",{className:a$1("flex items-center justify-between mb-6",r==null?void 0:r.topBar,e),children:[jsx("h1",{className:a$1("text-2xl font-bold ndpr-text-foreground",r==null?void 0:r.wizardTitle,e),children:"Privacy Policy Builder"}),jsx(Ir,{lastSavedAt:zr,isSaving:false,hasError:false,classNames:r,unstyled:e})]}),jsx("div",{className:a$1("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg px-4 mb-6",r==null?void 0:r.stepIndicatorWrapper,e),children:jsx(lr,{currentStep:n,classNames:r,unstyled:e})}),jsxs("div",{className:a$1("flex flex-col lg:flex-row gap-6 items-start",r==null?void 0:r.panels,e),children:[jsxs("main",{"aria-live":"polite",className:a$1("flex-1 min-w-0 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-6",r==null?void 0:r.mainPanel,e),children:[n===1&&jsx(fr,{context:b,onUpdateOrg:l,classNames:r,unstyled:e}),n===2&&jsx(xr,{categories:b.dataCategories,onToggle:g,classNames:r,unstyled:e}),n===3&&jsx(hr,{context:b,onTogglePurpose:a$2,onUpdateContext:C,onAddProcessor:v,onRemoveProcessor:c,classNames:r,unstyled:e}),n===4&&jsx(Lr,{sections:S,customSections:B,sectionOverrides:J,complianceResult:D,onEditSection:Z,onAddCustomSection:or,onRemoveCustomSection:er,onReorderSection:h,onExportPDF:qr,onExportDOCX:Or,onExportHTML:Hr,onExportMarkdown:Wr,classNames:r,unstyled:e}),jsxs("div",{className:a$1("flex items-center justify-between mt-8 pt-4 border-t border-gray-200 dark:border-gray-700",r==null?void 0:r.navigation,e),children:[jsx("button",{type:"button",onClick:i,disabled:n===1,className:a$1("px-4 py-2 bg-gray-200 dark:bg-gray-700 ndpr-text-foreground rounded-md text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed hover:bg-gray-300 dark:hover:bg-gray-600 transition-colors",r==null?void 0:r.backButton,e),children:"Back"}),jsx("div",{className:"flex items-center gap-2",children:jsxs("span",{className:a$1("ndpr-form-field__hint",r==null?void 0:r.stepCounter,e),children:["Step ",n," of 4"]})}),n<4?jsx("button",{type:"button",onClick:t,disabled:!u,className:a$1("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed transition-colors",r==null?void 0:r.nextButton,e),children:"Next"}):jsx("span",{})]})]}),jsx("aside",{className:a$1("w-full lg:w-80 flex-shrink-0",r==null?void 0:r.sidebarWrapper,e),children:jsx($r,{complianceResult:D,onFix:ir,classNames:r,unstyled:e})})]})]})})};
|
|
2
|
-
export{mo as a};//# sourceMappingURL=chunk-
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import {a}from'./chunk-F5TXUA4O.mjs';import {a as a$1}from'./chunk-AYKLAEOU.mjs';import {d,b,a as a$2}from'./chunk-WWT2ZSNU.mjs';import Gr,{useId,useState,useEffect}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var vr=["Organization","Data Collection","Processing","Review & Export"],lr=({currentStep:d,classNames:p,unstyled:r})=>jsx("nav",{"data-ndpr-component":"policy-step-indicator","aria-label":"Policy wizard progress",className:a$1("w-full flex items-center justify-between px-2 py-4",p==null?void 0:p.root,r),children:vr.map((e,n)=>{let t=n+1,i=t<d,u=t===d,l=n===vr.length-1;return jsxs(Gr.Fragment,{children:[jsxs("div",{className:a$1("flex flex-col items-center gap-1",p==null?void 0:p.stepWrapper,r),children:[jsx("div",{"aria-current":u?"step":void 0,"aria-label":`Step ${t}: ${e}${i?" (completed)":u?" (current)":""}`,className:a$1(["flex items-center justify-center rounded-full border-2 font-semibold transition-all",i?"w-8 h-8 bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))]":u?"w-9 h-9 bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] shadow-md":"w-8 h-8 bg-white dark:bg-gray-900 border-gray-300 dark:border-gray-600 text-gray-400 dark:text-gray-500"].join(" "),i?p==null?void 0:p.stepCompleted:u?p==null?void 0:p.stepCurrent:p==null?void 0:p.stepUpcoming,r),children:i?jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):jsx("span",{className:"text-xs leading-none",children:t})}),jsx("span",{className:a$1(["text-xs font-medium hidden sm:block",i||u?"text-[rgb(var(--ndpr-primary))]":"ndpr-card__subtitle"].join(" "),p==null?void 0:p.stepLabel,r),children:e})]}),!l&&jsx("div",{className:a$1(["flex-1 h-0.5 mx-2",i?"bg-[rgb(var(--ndpr-primary))]":"bg-gray-200 dark:bg-gray-700"].join(" "),p==null?void 0:p.connector,r),"aria-hidden":"true"})]},t)})});var $="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 ndpr-text-foreground focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",Vr="block text-sm font-medium ndpr-text-muted mb-1",A=({id:d,label:p,required:r,description:e,children:n,classNames:t,unstyled:i})=>{let u=e?`${d}-desc`:void 0;return jsxs("div",{className:a$1("flex flex-col",t==null?void 0:t.field,i),children:[jsxs("label",{htmlFor:d,className:a$1(Vr,t==null?void 0:t.label,i),children:[p,r&&jsx("span",{className:"text-red-500 ml-0.5","aria-hidden":"true",children:"*"})]}),e&&jsx("p",{id:u,className:"text-xs ndpr-text-muted mb-1",children:e}),n]})},fr=({context:d,onUpdateOrg:p,classNames:r,unstyled:e})=>{var i,u,b;let n=useId(),t=d.org;return jsxs("div",{"data-ndpr-component":"policy-step-about",className:a$1("ndpr-form-section",r==null?void 0:r.root,e),children:[jsxs("div",{children:[jsx("h2",{className:a$1("ndpr-section-heading",r==null?void 0:r.heading,e),children:"Organisation Details"}),jsxs("p",{className:a$1("ndpr-form-field__hint",r==null?void 0:r.subheading,e),children:["Tell us about your organisation. Fields marked ",jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})," are required."]})]}),jsxs("div",{className:a$1("grid grid-cols-1 md:grid-cols-2 gap-4",r==null?void 0:r.grid,e),children:[jsx(A,{id:`${n}-org-name`,label:"Organisation Name",required:true,classNames:r,unstyled:e,children:jsx("input",{id:`${n}-org-name`,type:"text",value:t.name,onChange:l=>p({name:l.target.value}),placeholder:"Acme Corporation",className:a$1($,r==null?void 0:r.input,e),"aria-required":"true"})}),jsx(A,{id:`${n}-website`,label:"Website",required:true,classNames:r,unstyled:e,children:jsx("input",{id:`${n}-website`,type:"url",value:t.website,onChange:l=>p({website:l.target.value}),placeholder:"https://example.com",className:a$1($,r==null?void 0:r.input,e),"aria-required":"true"})}),jsx(A,{id:`${n}-privacy-email`,label:"Privacy Contact Email",required:true,classNames:r,unstyled:e,children:jsx("input",{id:`${n}-privacy-email`,type:"email",value:t.privacyEmail,onChange:l=>p({privacyEmail:l.target.value}),placeholder:"privacy@example.com",className:a$1($,r==null?void 0:r.input,e),"aria-required":"true"})}),jsx(A,{id:`${n}-industry`,label:"Industry",classNames:r,unstyled:e,children:jsxs("select",{id:`${n}-industry`,value:t.industry,onChange:l=>p({industry:l.target.value}),className:a$1($,r==null?void 0:r.select,e),children:[jsx("option",{value:"fintech",children:"Fintech"}),jsx("option",{value:"healthcare",children:"Healthcare"}),jsx("option",{value:"ecommerce",children:"E-commerce"}),jsx("option",{value:"saas",children:"SaaS"}),jsx("option",{value:"education",children:"Education"}),jsx("option",{value:"government",children:"Government"}),jsx("option",{value:"other",children:"Other"})]})}),jsx(A,{id:`${n}-dpo-name`,label:"Data Protection Officer (DPO) Name",classNames:r,unstyled:e,children:jsx("input",{id:`${n}-dpo-name`,type:"text",value:(i=t.dpoName)!=null?i:"",onChange:l=>p({dpoName:l.target.value}),placeholder:"Jane Smith",className:a$1($,r==null?void 0:r.input,e)})}),jsx(A,{id:`${n}-dpo-email`,label:"DPO Email",classNames:r,unstyled:e,children:jsx("input",{id:`${n}-dpo-email`,type:"email",value:(u=t.dpoEmail)!=null?u:"",onChange:l=>p({dpoEmail:l.target.value}),placeholder:"dpo@example.com",className:a$1($,r==null?void 0:r.input,e)})}),jsx(A,{id:`${n}-address`,label:"Registered Address",classNames:r,unstyled:e,children:jsx("input",{id:`${n}-address`,type:"text",value:(b=t.address)!=null?b:"",onChange:l=>p({address:l.target.value}),placeholder:"1 Victoria Island, Lagos, Nigeria",className:a$1($,r==null?void 0:r.input,e)})}),jsx(A,{id:`${n}-org-size`,label:"Organisation Size",classNames:r,unstyled:e,children:jsxs("select",{id:`${n}-org-size`,value:t.orgSize,onChange:l=>p({orgSize:l.target.value}),className:a$1($,r==null?void 0:r.select,e),children:[jsx("option",{value:"startup",children:"Startup (1\u201350 employees)"}),jsx("option",{value:"midsize",children:"Mid-size (51\u2013500 employees)"}),jsx("option",{value:"enterprise",children:"Enterprise (500+ employees)"})]})}),jsx(A,{id:`${n}-country`,label:"Country of Operation",classNames:r,unstyled:e,children:jsx("input",{id:`${n}-country`,type:"text",value:t.country,onChange:l=>p({country:l.target.value}),placeholder:"Nigeria",className:a$1($,r==null?void 0:r.input,e)})})]})]})};var Xr={identity:"Identity",financial:"Financial",behavioral:"Behavioural",sensitive:"Sensitive",children:"Children"},Yr=["identity","financial","behavioral","sensitive","children"],Jr=["sensitive","children"],xr=({categories:d,onToggle:p,classNames:r,unstyled:e})=>{let n=Yr.reduce((t,i)=>{let u=d.filter(b=>b.group===i);return u.length>0&&(t[i]=u),t},{});return jsxs("div",{"data-ndpr-component":"policy-step-data",className:a$1("space-y-8",r==null?void 0:r.root,e),children:[jsxs("div",{children:[jsx("h2",{className:a$1("ndpr-section-heading",r==null?void 0:r.heading,e),children:"Data Categories"}),jsx("p",{id:"data-categories-desc",className:a$1("ndpr-form-field__hint",r==null?void 0:r.subheading,e),children:"Select the categories of personal data your organisation collects. You must select at least one."})]}),Object.entries(n).map(([t,i])=>{let u=Jr.includes(t);return jsxs("div",{className:a$1("space-y-3",r==null?void 0:r.group,e),children:[jsxs("div",{className:a$1("flex items-center gap-2",r==null?void 0:r.groupHeader,e),children:[jsx("h3",{className:a$1("text-sm font-semibold uppercase tracking-wide ndpr-text-muted",r==null?void 0:r.groupTitle,e),children:Xr[t]}),u&&jsx("span",{className:a$1("text-xs font-medium ndpr-text-warning bg-amber-50 dark:bg-amber-900/20 px-2 py-0.5 rounded-full",r==null?void 0:r.sensitiveTag,e),children:"Sensitive"})]}),u&&jsx("p",{className:a$1("text-xs ndpr-text-warning",r==null?void 0:r.sensitiveWarning,e),children:t==="children"?"Processing children's data requires parental consent under NDPA Section 31 and imposes heightened obligations.":"Sensitive/special-category data requires explicit consent and additional safeguards under NDPA Section 30."}),jsx("div",{className:a$1("grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",r==null?void 0:r.cardsGrid,e),children:i.map(b=>jsx("button",{type:"button",onClick:()=>p(b.id),"aria-pressed":b.selected,className:a$1(["text-left rounded-lg border p-4 transition-all cursor-pointer focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",b.selected?"bg-[rgb(var(--ndpr-primary))]/5 border-[rgb(var(--ndpr-primary))] dark:bg-[rgb(var(--ndpr-primary))]/10":"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"].join(" "),r==null?void 0:r.card,e),children:jsxs("div",{className:"flex items-start gap-3",children:[jsx("div",{className:a$1(["mt-0.5 w-4 h-4 rounded border-2 flex-shrink-0 flex items-center justify-center",b.selected?"bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))]":"border-gray-300 dark:border-gray-600"].join(" "),r==null?void 0:r.checkbox,e),"aria-hidden":"true",children:b.selected&&jsx("svg",{className:"w-2.5 h-2.5 text-[rgb(var(--ndpr-primary-foreground))]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),jsxs("div",{className:"min-w-0",children:[jsx("p",{className:a$1("text-sm font-medium ndpr-text-foreground",r==null?void 0:r.cardLabel,e),children:b.label}),jsx("p",{className:a$1("text-xs ndpr-text-muted mt-1 leading-relaxed",r==null?void 0:r.cardDataPoints,e),children:b.dataPoints.join(", ")})]})]})},b.id))})]},t)})]})};var Qr=[{value:"service_delivery",label:"Service Delivery",description:"Processing required to deliver the core product or service."},{value:"marketing",label:"Marketing & Communications",description:"Sending promotional messages, newsletters or offers."},{value:"analytics",label:"Analytics & Insights",description:"Analysing usage patterns to improve the product."},{value:"research",label:"Research & Development",description:"Using data to develop new features or products."},{value:"legal_compliance",label:"Legal Compliance",description:"Meeting statutory, regulatory or contractual obligations."},{value:"fraud_prevention",label:"Fraud Prevention & Security",description:"Detecting and preventing fraudulent activity."}],dr="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 ndpr-text-foreground focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",pr="ndpr-card ndpr-card--compact",gr=({id:d,checked:p,onChange:r})=>jsx("button",{id:d,type:"button",role:"switch","aria-checked":p,onClick:()=>r(!p),className:["relative inline-flex h-6 w-11 flex-shrink-0 rounded-full border-2 border-transparent cursor-pointer transition-colors focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",p?"bg-[rgb(var(--ndpr-primary))]":"bg-gray-200 dark:bg-gray-600"].join(" "),children:jsx("span",{"aria-hidden":"true",className:["pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition-transform",p?"translate-x-5":"translate-x-0"].join(" ")})}),hr=({context:d,onTogglePurpose:p,onUpdateContext:r,onAddProcessor:e,onRemoveProcessor:n,classNames:t,unstyled:i})=>{let u=useId(),[b$1,l]=useState({name:"",purpose:"",country:""}),[C,g]=useState(false),a=()=>{let{name:v,purpose:c,country:S}=b$1;!v.trim()||!c.trim()||!S.trim()||(e({name:v.trim(),purpose:c.trim(),country:S.trim()}),l({name:"",purpose:"",country:""}),g(false));};return jsxs("div",{"data-ndpr-component":"policy-step-processing",className:a$1("ndpr-form-section",t==null?void 0:t.root,i),children:[jsxs("div",{children:[jsx("h2",{className:a$1("ndpr-section-heading",t==null?void 0:t.heading,i),children:"Processing Details"}),jsx("p",{className:a$1("ndpr-form-field__hint",t==null?void 0:t.subheading,i),children:"Define how and why you process personal data."})]}),jsxs("section",{className:a$1(pr,t==null?void 0:t.section,i),"aria-labelledby":"purposes-heading",children:[jsx("h3",{id:"purposes-heading",className:a$1("text-base font-semibold ndpr-text-foreground",t==null?void 0:t.sectionTitle,i),children:"Processing Purposes"}),jsx("p",{className:a$1("ndpr-form-field__hint",t==null?void 0:t.sectionDescription,i),children:"Select all purposes for which you process personal data. At least one is required."}),jsx("div",{className:a$1("space-y-3",t==null?void 0:t.purposeList,i),children:Qr.map(v=>{let c=d.purposes.includes(v.value),S=`${u}-purpose-${v.value}`,B=`${u}-purpose-desc-${v.value}`;return jsxs("label",{htmlFor:S,className:a$1("flex items-start gap-3 cursor-pointer group",t==null?void 0:t.purposeItem,i),children:[jsx("input",{id:S,type:"checkbox",checked:c,onChange:()=>p(v.value),"aria-describedby":B,className:a$1("mt-0.5 h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))] cursor-pointer",t==null?void 0:t.purposeCheckbox,i)}),jsxs("div",{children:[jsx("p",{className:a$1("text-sm font-medium ndpr-text-foreground",t==null?void 0:t.purposeLabel,i),children:v.label}),jsx("p",{id:B,className:a$1("ndpr-form-field__hint",t==null?void 0:t.purposeDescription,i),children:v.description})]})]},v.value)})})]}),jsxs("section",{className:a$1(pr,t==null?void 0:t.section,i),"aria-labelledby":"thirdparty-heading",children:[jsxs("div",{className:"flex items-center justify-between",children:[jsx("h3",{id:"thirdparty-heading",className:a$1("text-base font-semibold ndpr-text-foreground",t==null?void 0:t.sectionTitle,i),children:"Third-Party Data Sharing"}),jsx(gr,{id:`${u}-thirdparty-toggle`,checked:d.thirdPartyProcessors.length>0||C,onChange:v=>{v?g(true):(d.thirdPartyProcessors.forEach((c,S)=>n(0)),g(false));}})]}),(d.thirdPartyProcessors.length>0||C)&&jsxs("div",{className:a$1("ndpr-form-section",t==null?void 0:t.processorSection,i),children:[d.thirdPartyProcessors.length>0&&jsx("div",{className:a$1("overflow-x-auto",t==null?void 0:t.processorTable,i),children:jsxs("table",{className:"w-full text-sm",children:[jsx("thead",{children:jsxs("tr",{className:a$1("text-left text-xs font-medium ndpr-text-muted border-b border-gray-200 dark:border-gray-700",t==null?void 0:t.tableHeader,i),children:[jsx("th",{className:"pb-2 pr-4",children:"Name"}),jsx("th",{className:"pb-2 pr-4",children:"Purpose"}),jsx("th",{className:"pb-2 pr-4",children:"Country"}),jsx("th",{className:"pb-2"})]})}),jsx("tbody",{className:"divide-y divide-gray-100 dark:divide-gray-700",children:d.thirdPartyProcessors.map((v,c)=>jsxs("tr",{children:[jsx("td",{className:a$1("py-2 pr-4 ndpr-text-foreground",t==null?void 0:t.tableCell,i),children:v.name}),jsx("td",{className:a$1("py-2 pr-4 ndpr-text-muted",t==null?void 0:t.tableCell,i),children:v.purpose}),jsx("td",{className:a$1("py-2 pr-4 ndpr-text-muted",t==null?void 0:t.tableCell,i),children:v.country}),jsx("td",{className:"py-2",children:jsx("button",{type:"button",onClick:()=>n(c),className:a$1("text-red-500 hover:ndpr-text-destructive dark:hover:text-red-300 text-xs font-medium",t==null?void 0:t.removeButton,i),"aria-label":`Remove ${v.name}`,children:"Remove"})})]},c))})]})}),C?jsxs("div",{className:a$1("grid grid-cols-1 sm:grid-cols-3 gap-3 items-end",t==null?void 0:t.processorForm,i),children:[jsxs("div",{children:[jsx("label",{htmlFor:`${u}-proc-name`,className:"block text-xs font-medium ndpr-text-muted mb-1",children:"Processor Name"}),jsx("input",{id:`${u}-proc-name`,type:"text",placeholder:"Processor name",value:b$1.name,onChange:v=>l(c=>b(a$2({},c),{name:v.target.value})),"aria-required":"true",className:a$1(dr,t==null?void 0:t.input,i)})]}),jsxs("div",{children:[jsx("label",{htmlFor:`${u}-proc-purpose`,className:"block text-xs font-medium ndpr-text-muted mb-1",children:"Purpose"}),jsx("input",{id:`${u}-proc-purpose`,type:"text",placeholder:"Purpose",value:b$1.purpose,onChange:v=>l(c=>b(a$2({},c),{purpose:v.target.value})),"aria-required":"true",className:a$1(dr,t==null?void 0:t.input,i)})]}),jsxs("div",{children:[jsx("label",{htmlFor:`${u}-proc-country`,className:"block text-xs font-medium ndpr-text-muted mb-1",children:"Country"}),jsx("input",{id:`${u}-proc-country`,type:"text",placeholder:"Country",value:b$1.country,onChange:v=>l(c=>b(a$2({},c),{country:v.target.value})),"aria-required":"true",className:a$1(dr,t==null?void 0:t.input,i)})]}),jsxs("div",{className:"sm:col-span-3 flex gap-2",children:[jsx("button",{type:"button",onClick:a,className:a$1("ndpr-button ndpr-button--primary ndpr-button--sm",t==null?void 0:t.addButton,i),children:"Add Processor"}),jsx("button",{type:"button",onClick:()=>g(false),className:a$1("ndpr-button ndpr-button--secondary ndpr-button--sm",t==null?void 0:t.cancelButton,i),children:"Cancel"})]})]}):jsxs("button",{type:"button",onClick:()=>g(true),className:a$1("flex items-center gap-1 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",t==null?void 0:t.addLink,i),children:[jsx("span",{"aria-hidden":"true",children:"+"})," Add processor"]})]})]}),jsxs("section",{className:a$1(pr,t==null?void 0:t.section,i),"aria-labelledby":"disclosures-heading",children:[jsx("h3",{id:"disclosures-heading",className:a$1("text-base font-semibold ndpr-text-foreground",t==null?void 0:t.sectionTitle,i),children:"Additional Disclosures"}),jsxs("div",{className:a$1("ndpr-form-section",t==null?void 0:t.disclosureList,i),children:[jsxs("div",{className:a$1("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxs("div",{children:[jsx("p",{id:`${u}-cross-border-label`,className:a$1("text-sm font-medium ndpr-text-foreground",t==null?void 0:t.disclosureLabel,i),children:"Cross-border Data Transfers"}),jsx("p",{id:`${u}-cross-border-desc`,className:a$1("text-xs ndpr-text-muted mt-0.5",t==null?void 0:t.disclosureDescription,i),children:"Do you transfer personal data outside Nigeria? This triggers NDPA Chapter 6 obligations."})]}),jsx(gr,{id:`${u}-cross-border-toggle`,checked:d.hasCrossBorderTransfer,onChange:v=>r({hasCrossBorderTransfer:v})})]}),jsxs("div",{className:a$1("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxs("div",{children:[jsx("p",{id:`${u}-automated-label`,className:a$1("text-sm font-medium ndpr-text-foreground",t==null?void 0:t.disclosureLabel,i),children:"Automated Decision-Making / Profiling"}),jsx("p",{id:`${u}-automated-desc`,className:a$1("text-xs ndpr-text-muted mt-0.5",t==null?void 0:t.disclosureDescription,i),children:"Do you use algorithms or automated systems to make decisions about individuals? Requires disclosure under NDPA Section 37."})]}),jsx(gr,{id:`${u}-automated-toggle`,checked:d.hasAutomatedDecisions,onChange:v=>r({hasAutomatedDecisions:v})})]})]})]})]})};var Cr=({section:d,index:p,isCustom:r,isEditing:e,editedContent:n,onEdit:t,onSaveEdit:i,onCancelEdit:u,onMoveUp:b,onMoveDown:l,onDelete:C,classNames:g,unstyled:a})=>{let[v,c]=useState(n!=null?n:d.template);return useEffect(()=>{n!==void 0&&c(n);},[n]),useEffect(()=>{e&&c(n!=null?n:d.template);},[e,n,d.template]),jsxs("div",{"data-ndpr-component":"policy-section-card",className:a$1("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-3",g==null?void 0:g.root,a),children:[jsxs("div",{className:a$1("flex items-start justify-between gap-2",g==null?void 0:g.header,a),children:[jsxs("div",{className:a$1("flex items-center gap-3 min-w-0",g==null?void 0:g.titleRow,a),children:[jsx("span",{className:a$1("flex-shrink-0 w-7 h-7 rounded-full bg-gray-100 dark:bg-gray-700 ndpr-text-muted text-xs font-semibold flex items-center justify-center",g==null?void 0:g.sectionNumber,a),"aria-hidden":"true",children:p+1}),jsxs("h4",{className:a$1("text-sm font-semibold ndpr-text-foreground truncate",g==null?void 0:g.sectionTitle,a),children:[d.title,r&&jsx("span",{className:a$1("ml-2 text-xs font-normal ndpr-text-muted bg-gray-100 dark:bg-gray-700 px-1.5 py-0.5 rounded",g==null?void 0:g.customBadge,a),children:"Custom"})]})]}),jsxs("div",{className:a$1("flex items-center gap-1 flex-shrink-0",g==null?void 0:g.actions,a),children:[b&&jsx("button",{type:"button",onClick:b,className:a$1("ndpr-button ndpr-button--icon",g==null?void 0:g.moveButton,a),"aria-label":`Move "${d.title}" up`,children:jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})})}),l&&jsx("button",{type:"button",onClick:l,className:a$1("ndpr-button ndpr-button--icon",g==null?void 0:g.moveButton,a),"aria-label":`Move "${d.title}" down`,children:jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}),!e&&jsx("button",{type:"button",onClick:t,className:a$1("p-1.5 text-gray-400 hover:text-[rgb(var(--ndpr-primary))] rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",g==null?void 0:g.editButton,a),"aria-label":`Edit "${d.title}"`,children:jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),r&&C&&jsx("button",{type:"button",onClick:C,className:a$1("p-1.5 text-gray-400 hover:text-red-500 dark:hover:text-red-400 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",g==null?void 0:g.deleteButton,a),"aria-label":`Delete "${d.title}"`,children:jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]}),e?jsxs("div",{className:a$1("space-y-2",g==null?void 0:g.editArea,a),children:[jsx("textarea",{value:v,onChange:S=>c(S.target.value),rows:8,className:a$1("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 ndpr-text-foreground focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm font-mono resize-y",g==null?void 0:g.textarea,a),"aria-label":`Edit content for ${d.title}`}),jsxs("div",{className:a$1("flex gap-2",g==null?void 0:g.editActions,a),children:[jsx("button",{type:"button",onClick:()=>i(v),className:a$1("ndpr-button ndpr-button--primary ndpr-button--sm",g==null?void 0:g.saveButton,a),children:"Save"}),jsx("button",{type:"button",onClick:u,className:a$1("ndpr-button ndpr-button--secondary ndpr-button--sm",g==null?void 0:g.cancelButton,a),children:"Cancel"})]})]}):jsx("div",{className:a$1("text-sm ndpr-text-muted leading-relaxed line-clamp-4 whitespace-pre-wrap",g==null?void 0:g.content,a),children:d.template})]})};var kr="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 ndpr-text-foreground focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",wr=({onAdd:d,nextOrder:p,classNames:r,unstyled:e})=>{let n=useId(),[t,i]=useState(""),[u,b]=useState(""),[l,C]=useState(""),g=()=>{if(!t.trim()){C("Section title is required.");return}if(!u.trim()){C("Section content is required.");return}C(""),d({title:t.trim(),content:u.trim(),order:p}),i(""),b("");};return jsxs("div",{"data-ndpr-component":"custom-section-form",className:a$1("ndpr-card ndpr-card--compact",r==null?void 0:r.root,e),children:[jsx("h4",{className:a$1("ndpr-section-heading",r==null?void 0:r.heading,e),children:"Add Custom Section"}),l&&jsx("p",{role:"alert",className:a$1("text-xs ndpr-text-destructive",r==null?void 0:r.error,e),children:l}),jsxs("div",{className:a$1("space-y-3",r==null?void 0:r.fields,e),children:[jsxs("div",{children:[jsxs("label",{htmlFor:`${n}-custom-section-title`,className:a$1("block text-xs font-medium ndpr-text-muted mb-1",r==null?void 0:r.label,e),children:["Section Title ",jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsx("input",{id:`${n}-custom-section-title`,type:"text",value:t,onChange:a=>{i(a.target.value),l&&C("");},placeholder:"e.g. Cookie Policy",className:a$1(kr,r==null?void 0:r.input,e),"aria-required":"true"})]}),jsxs("div",{children:[jsxs("label",{htmlFor:`${n}-custom-section-content`,className:a$1("block text-xs font-medium ndpr-text-muted mb-1",r==null?void 0:r.label,e),children:["Content ",jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsx("textarea",{id:`${n}-custom-section-content`,value:u,onChange:a=>{b(a.target.value),l&&C("");},placeholder:"Write the section content here...",rows:5,className:a$1(`${kr} resize-y`,r==null?void 0:r.textarea,e),"aria-required":"true"})]})]}),jsx("div",{className:a$1("flex items-center gap-2",r==null?void 0:r.footer,e),children:jsx("button",{type:"button",onClick:g,className:a$1("ndpr-button ndpr-button--primary ndpr-button--sm",r==null?void 0:r.addButton,e),children:"Add Section"})})]})};var Sr={compliant:{bg:"ndpr-alert ndpr-alert--success",text:"ndpr-text-success",border:"border-green-200 dark:border-green-700"},nearly_compliant:{bg:"bg-amber-50 dark:bg-amber-900/20",text:"ndpr-text-warning",border:"border-amber-200 dark:border-amber-700"},not_compliant:{bg:"ndpr-alert ndpr-alert--destructive",text:"ndpr-text-destructive",border:"border-red-200 dark:border-red-700"}},sr={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},N=({icon:d,label:p,description:r,actionLabel:e,loading:n,onClick:t,classNames:i,unstyled:u})=>jsxs("div",{className:a$1("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 flex flex-col gap-3",i==null?void 0:i.formatCard,u),children:[jsxs("div",{className:a$1("flex items-center gap-3",i==null?void 0:i.formatHeader,u),children:[jsx("div",{className:a$1("w-10 h-10 rounded-lg bg-gray-100 dark:bg-gray-700 flex items-center justify-center flex-shrink-0",i==null?void 0:i.formatIcon,u),"aria-hidden":"true",children:d}),jsxs("div",{className:"min-w-0",children:[jsx("p",{className:a$1("ndpr-section-heading",i==null?void 0:i.formatLabel,u),children:p}),jsx("p",{className:a$1("ndpr-form-field__hint",i==null?void 0:i.formatDescription,u),children:r})]})]}),jsx("button",{type:"button",onClick:t,disabled:n,className:a$1("w-full px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2",i==null?void 0:i.formatButton,u),children:n?jsxs(Fragment,{children:[jsxs("svg",{className:"animate-spin w-4 h-4",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),"Generating\u2026"]}):e})]}),mr=({complianceResult:d$1,onExportPDF:p,onExportDOCX:r,onExportHTML:e,onExportMarkdown:n,classNames:t,unstyled:i})=>{var c;let[u,b]=useState(false),[l,C]=useState(false),g=(c=Sr[d$1.rating])!=null?c:Sr.not_compliant,a=()=>d(null,null,function*(){b(true);try{yield p();}finally{b(false);}}),v=()=>d(null,null,function*(){C(true);try{yield r();}finally{C(false);}});return jsxs("div",{"data-ndpr-component":"policy-export-panel",className:a$1("ndpr-form-section",t==null?void 0:t.root,i),children:[jsxs("div",{className:a$1(`rounded-lg border p-4 flex items-center gap-4 ${g.bg} ${g.border}`,t==null?void 0:t.complianceSummary,i),children:[jsxs("div",{className:a$1(`text-3xl font-bold ${g.text}`,t==null?void 0:t.complianceScore,i),"aria-label":`Compliance score: ${d$1.percentage}%`,children:[d$1.percentage,"%"]}),jsxs("div",{children:[jsx("p",{className:a$1(`text-sm font-semibold ${g.text}`,t==null?void 0:t.complianceRating,i),children:sr[d$1.rating]}),jsxs("p",{className:a$1("text-xs ndpr-text-muted mt-0.5",t==null?void 0:t.complianceDetail,i),children:[d$1.score," / ",d$1.maxScore," points \u2022"," ",d$1.gaps.length," gap",d$1.gaps.length!==1?"s":""," remaining"]})]})]}),jsxs("div",{children:[jsx("h3",{className:a$1("ndpr-section-heading",t==null?void 0:t.formatsHeading,i),children:"Export Format"}),jsxs("div",{className:a$1("grid grid-cols-1 sm:grid-cols-2 gap-3",t==null?void 0:t.formatsGrid,i),children:[jsx(N,{icon:jsx("svg",{className:"w-5 h-5 text-red-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-3 7v-1h4v1h-4zm0-3v-1h4v1h-4zm-2-5h8v1H8v-1z"})}),label:"PDF",description:"Professional formatted document, ideal for publishing.",actionLabel:"Download PDF",loading:u,onClick:a,classNames:t,unstyled:i}),jsx(N,{icon:jsx("svg",{className:"w-5 h-5 text-blue-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-5 8v-5h1.5l1 3 1-3H13v5h-1v-3.5l-.75 2.25h-.5L10 13.5V17H9zm5-1.5h.75c.55 0 .75-.25.75-.75 0-.4-.2-.65-.75-.65H14V15.5zm1 1.5h-2v-4h2c1.1 0 1.75.6 1.75 1.5 0 .55-.25.95-.65 1.15.5.2.8.65.8 1.2 0 1-.65 1.65-1.9 1.65V17zm-.25-1c.6 0 .9-.25.9-.75 0-.45-.3-.75-.9-.75H14V16h.75z"})}),label:"DOCX",description:"Editable Word document for further customisation.",actionLabel:"Download DOCX",loading:l,onClick:v,classNames:t,unstyled:i}),jsx(N,{icon:jsxs("svg",{className:"w-5 h-5 text-orange-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 15H9V8h2v9zm4 0h-2V8h2v9z"}),jsx("path",{d:"M9.5 6.5h1v1h-1zm4 0h1v1h-1z"}),jsx("path",{d:"M5 5h14v2H5zm0 12h14v2H5z"})]}),label:"HTML",description:"Copy-ready HTML to embed on your website.",actionLabel:"Copy HTML",onClick:e,classNames:t,unstyled:i}),jsx(N,{icon:jsx("svg",{className:"w-5 h-5 ndpr-text-muted",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsx("path",{d:"M3 5h18v2H3V5zm0 4h12v2H3V9zm0 4h18v2H3v-2zm0 4h12v2H3v-2z"})}),label:"Markdown",description:"Plain-text format for documentation or Git repos.",actionLabel:"Copy Markdown",onClick:n,classNames:t,unstyled:i})]})]})]})};var Lr=({sections:d,customSections:p,sectionOverrides:r,complianceResult:e,onEditSection:n,onAddCustomSection:t,onRemoveCustomSection:i,onReorderSection:u,onExportPDF:b$1,onExportDOCX:l,onExportHTML:C,onExportMarkdown:g,classNames:a,unstyled:v})=>{let[c,S]=useState(null),[B,J]=useState(false),Z=new Set(p.map(h=>h.id)),or=(h,D)=>{n(h,D),S(null);},er=d.length>0?Math.max(...d.map(h=>{var D;return (D=h.order)!=null?D:0}))+1:1;return jsxs("div",{"data-ndpr-component":"policy-step-review",className:a$1("ndpr-form-section",a==null?void 0:a.root,v),children:[jsxs("div",{children:[jsx("h2",{className:a$1("ndpr-section-heading",a==null?void 0:a.heading,v),children:"Review & Export"}),jsx("p",{className:a$1("ndpr-form-field__hint",a==null?void 0:a.subheading,v),children:"Review your generated policy sections, reorder or edit content, then export."})]}),jsx("div",{className:a$1("space-y-3",a==null?void 0:a.sectionList,v),"aria-live":"polite",children:d.map((h,D)=>jsx(Cr,{section:r[h.id]?b(a$2({},h),{template:r[h.id]}):h,index:D,isCustom:Z.has(h.id),isEditing:c===h.id,editedContent:r[h.id],onEdit:()=>S(h.id),onSaveEdit:ir=>or(h.id,ir),onCancelEdit:()=>S(null),onMoveUp:D>0?()=>u(h.id,"up"):void 0,onMoveDown:D<d.length-1?()=>u(h.id,"down"):void 0,onDelete:Z.has(h.id)?()=>i(h.id):void 0,classNames:a,unstyled:v},h.id))}),!B&&jsxs("button",{type:"button",onClick:()=>J(true),className:a$1("flex items-center gap-2 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",a==null?void 0:a.addSectionButton,v),children:[jsx("span",{className:a$1("w-5 h-5 rounded-full border-2 border-[rgb(var(--ndpr-primary))] flex items-center justify-center text-xs font-bold leading-none",a==null?void 0:a.addSectionIcon,v),"aria-hidden":"true",children:"+"}),"Add Custom Section"]}),B&&jsxs("div",{className:a$1("space-y-2",a==null?void 0:a.customFormWrapper,v),children:[jsx(wr,{onAdd:h=>{t(h),J(false);},nextOrder:er,classNames:a,unstyled:v}),jsx("button",{type:"button",onClick:()=>J(false),className:a$1("text-sm ndpr-text-muted hover:underline",a==null?void 0:a.cancelCustomForm,v),children:"Cancel"})]}),jsx("hr",{className:a$1("border-gray-200 dark:border-gray-700",a==null?void 0:a.divider,v)}),jsx(mr,{complianceResult:e,onExportPDF:b$1,onExportDOCX:l,onExportHTML:C,onExportMarkdown:g,classNames:a,unstyled:v})]})};var Dr={compliant:{stroke:"stroke-green-500 dark:stroke-green-400",text:"ndpr-text-success"},nearly_compliant:{stroke:"stroke-amber-500 dark:stroke-amber-400",text:"ndpr-text-warning"},not_compliant:{stroke:"stroke-red-500 dark:stroke-red-400",text:"ndpr-text-destructive"}},tt={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},Fr=({score:d,maxScore:p,rating:r,classNames:e,unstyled:n})=>{var C,g;let t=p>0?Math.round(d/p*100):0,i=(C=Dr[r])!=null?C:Dr.not_compliant,u=36,b=2*Math.PI*u,l=b-t/100*b;return jsxs("div",{"data-ndpr-component":"compliance-score-ring",className:a$1("flex flex-col items-center gap-2",e==null?void 0:e.root,n),children:[jsxs("div",{className:a$1("relative w-24 h-24",e==null?void 0:e.svgWrapper,n),children:[jsxs("svg",{className:"w-24 h-24 -rotate-90",viewBox:"0 0 96 96","aria-hidden":"true",children:[jsx("circle",{cx:"48",cy:"48",r:u,fill:"none",className:"stroke-gray-200 dark:stroke-gray-700",strokeWidth:"8"}),jsx("circle",{cx:"48",cy:"48",r:u,fill:"none",className:i.stroke,strokeWidth:"8",strokeLinecap:"round",strokeDasharray:b,strokeDashoffset:l,style:{transition:"stroke-dashoffset 0.5s ease-out"}})]}),jsx("div",{className:a$1("absolute inset-0 flex flex-col items-center justify-center",e==null?void 0:e.centerText,n),children:jsxs("span",{className:a$1(`text-xl font-bold leading-none ${i.text}`,e==null?void 0:e.scoreValue,n),"aria-label":`${t}% compliance score`,children:[t,"%"]})})]}),jsx("p",{className:a$1(`text-xs font-semibold text-center ${i.text}`,e==null?void 0:e.ratingLabel,n),children:(g=tt[r])!=null?g:r}),jsxs("p",{className:a$1("text-xs ndpr-text-muted text-center",e==null?void 0:e.scoreDetail,n),children:[d," / ",p," pts"]})]})};var et={critical:"ndpr-text-destructive",important:"ndpr-text-warning",recommended:"ndpr-text-info"},Er=({gap:d,isPassed:p,onFix:r,classNames:e,unstyled:n})=>{let[t,i]=useState(false);return jsxs("div",{"data-ndpr-component":"compliance-requirement-item",className:a$1("border-b border-gray-100 dark:border-gray-700 last:border-0 py-2",e==null?void 0:e.root,n),children:[jsxs("button",{type:"button",onClick:()=>!p&&i(u=>!u),className:a$1("w-full flex items-start gap-2 text-left group",e==null?void 0:e.row,n),"aria-expanded":p?void 0:t,"aria-disabled":p,children:[jsx("span",{className:a$1(["mt-0.5 flex-shrink-0 w-4 h-4 rounded-full flex items-center justify-center",p?"bg-green-500":d.severity==="critical"?"bg-red-500":d.severity==="important"?"bg-amber-500":"bg-blue-400"].join(" "),e==null?void 0:e.statusIcon,n),"aria-hidden":"true",children:p?jsx("svg",{className:"w-2.5 h-2.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):jsx("svg",{className:"w-2.5 h-2.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("div",{className:"flex items-center justify-between gap-1",children:[jsx("p",{className:a$1(`text-xs font-medium ${p?"ndpr-text-muted":"ndpr-text-foreground"}`,e==null?void 0:e.requirementLabel,n),children:d.requirement}),!p&&jsx("svg",{className:`flex-shrink-0 w-3 h-3 text-gray-400 transition-transform ${t?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),jsxs("p",{className:a$1("text-xs text-gray-400 dark:text-gray-500 mt-0.5",e==null?void 0:e.ndpaSection,n),children:["NDPA ",d.ndpaSection]})]})]}),!p&&t&&jsxs("div",{className:a$1("mt-2 ml-6 space-y-2",e==null?void 0:e.detail,n),children:[jsx("p",{className:a$1(`text-xs ${et[d.severity]}`,e==null?void 0:e.message,n),children:d.message}),jsx("button",{type:"button",onClick:()=>{r(d.requirementId),i(false);},className:a$1("text-xs font-medium px-3 py-1 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))]",e==null?void 0:e.fixButton,n),children:d.fixLabel})]})]})};function nt(d,p){let r=p.map(t=>({gap:{requirementId:t,requirement:t.split("-").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "),ndpaSection:"\u2014",severity:"recommended",message:"",fixType:"fill_field",fixLabel:""},isPassed:true})),e=d.map(t=>({gap:t,isPassed:false})),n={critical:0,important:1,recommended:2};return e.sort((t,i)=>n[t.gap.severity]-n[i.gap.severity]),[...e,...r]}var $r=({complianceResult:d,onFix:p,classNames:r,unstyled:e})=>{let[n,t]=useState(false),i=nt(d.gaps,d.passed);return jsxs("aside",{"data-ndpr-component":"compliance-checker-sidebar",className:a$1("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",r==null?void 0:r.root,e),"aria-label":"NDPA compliance checker",children:[jsxs("div",{className:a$1("flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/50",r==null?void 0:r.header,e),children:[jsx("h2",{className:a$1("ndpr-section-heading",r==null?void 0:r.title,e),children:"NDPA Compliance"}),jsx("button",{type:"button",onClick:()=>t(u=>!u),className:a$1("p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",r==null?void 0:r.collapseButton,e),"aria-expanded":!n,"aria-label":n?"Expand compliance checker":"Collapse compliance checker",children:jsx("svg",{className:`w-4 h-4 transition-transform ${n?"-rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})})]}),!n&&jsxs("div",{className:a$1("p-4 space-y-4",r==null?void 0:r.body,e),children:[jsx("div",{className:a$1("flex justify-center",r==null?void 0:r.ringWrapper,e),children:jsx(Fr,{score:d.score,maxScore:d.maxScore,rating:d.rating,classNames:r,unstyled:e})}),jsx("div",{className:a$1("grid grid-cols-3 gap-2 text-center",r==null?void 0:r.statsRow,e),children:[{count:d.gaps.filter(u=>u.severity==="critical").length,label:"Critical",color:"ndpr-text-destructive"},{count:d.gaps.filter(u=>u.severity==="important").length,label:"Important",color:"ndpr-text-warning"},{count:d.passed.length,label:"Passed",color:"ndpr-text-success"}].map(({count:u,label:b,color:l})=>jsxs("div",{children:[jsx("p",{className:a$1(`text-base font-bold ${l}`,r==null?void 0:r.statValue,e),children:u}),jsx("p",{className:a$1("ndpr-form-field__hint",r==null?void 0:r.statLabel,e),children:b})]},b))}),jsx("div",{className:a$1("overflow-y-auto max-h-80",r==null?void 0:r.requirementsList,e),children:i.length===0?jsx("p",{className:a$1("ndpr-empty-state",r==null?void 0:r.emptyState,e),children:"No requirements to display."}):i.map(({gap:u,isPassed:b})=>jsx(Er,{gap:u,isPassed:b,onFix:p,classNames:r,unstyled:e},u.requirementId))})]})]})};function dt(d){let p=Date.now()-d;return p<1e4?"just now":p<6e4?`${Math.floor(p/1e3)}s ago`:p<36e5?`${Math.floor(p/6e4)}m ago`:new Date(d).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}var Ir=({lastSavedAt:d,isSaving:p,hasError:r,classNames:e,unstyled:n})=>{let t="idle";if(p?t="saving":r?t="error":d!==null&&(t="saved"),t==="idle")return null;let i=t==="saving"?"Saving\u2026":t==="error"?"Unable to save":`Draft saved ${d?dt(d):""}`;return jsxs("div",{"data-ndpr-component":"draft-save-indicator",role:"status","aria-live":"polite","aria-atomic":"true",className:a$1(`flex items-center gap-1.5 ${t==="error"?"text-red-500 dark:text-red-400":t==="saving"?"ndpr-card__subtitle":"ndpr-text-success"}`,e==null?void 0:e.root,n),children:[t==="saving"&&jsxs("svg",{className:"animate-spin w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),t==="saved"&&jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),t==="error"&&jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})}),jsx("span",{className:a$1("text-xs font-medium",e==null?void 0:e.text,n),children:i})]})};var mo=({adapter:d$1,onComplete:p,classNames:r,unstyled:e})=>{let{currentStep:n,nextStep:t,prevStep:i,canProceed:u,context:b,updateOrg:l,updateContext:C,toggleDataCategory:g,togglePurpose:a$2,addProcessor:v,removeProcessor:c,sections:S,customSections:B,sectionOverrides:J,editSectionContent:Z,addCustomSection:or,removeCustomSection:er,reorderSections:h,complianceResult:D,applyFix:ir,handleExportPDF:Tr,handleExportDOCX:_r,handleExportHTML:Mr,handleExportMarkdown:Br,lastSavedAt:zr,isLoading:jr}=a({adapter:d$1,onComplete:p}),nr=(F,K)=>{let O=URL.createObjectURL(F),H=document.createElement("a");H.href=O,H.download=K,H.click(),URL.revokeObjectURL(O);},qr=()=>d(null,null,function*(){let F=yield Tr();nr(F,"privacy-policy.pdf");}),Or=()=>d(null,null,function*(){let F=yield _r();nr(F,"privacy-policy.docx");}),Hr=()=>{let F=Mr();navigator.clipboard.writeText(F).catch(()=>{let K=new Blob([F],{type:"text/html"}),O=URL.createObjectURL(K),H=window.open(O,"_blank");H?H.addEventListener("load",()=>URL.revokeObjectURL(O)):URL.revokeObjectURL(O);});},Wr=()=>{let F=Br();navigator.clipboard.writeText(F).catch(()=>{let K=new Blob([F],{type:"text/markdown"});nr(K,"privacy-policy.md");});};return jr?jsxs("div",{"data-ndpr-component":"adaptive-policy-wizard",className:a$1("flex items-center justify-center min-h-64 text-gray-400 dark:text-gray-500",r==null?void 0:r.root,e),"aria-busy":"true","aria-label":"Loading policy wizard",children:[jsxs("svg",{className:"animate-spin w-6 h-6 mr-2",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),jsx("span",{className:"ndpr-text-sm",children:"Loading\u2026"})]}):jsx("div",{"data-ndpr-component":"adaptive-policy-wizard",className:a$1("min-h-screen bg-gray-50 dark:bg-gray-900",r==null?void 0:r.root,e),children:jsxs("div",{className:a$1("max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",r==null?void 0:r.container,e),children:[jsxs("div",{className:a$1("flex items-center justify-between mb-6",r==null?void 0:r.topBar,e),children:[jsx("h1",{className:a$1("text-2xl font-bold ndpr-text-foreground",r==null?void 0:r.wizardTitle,e),children:"Privacy Policy Builder"}),jsx(Ir,{lastSavedAt:zr,isSaving:false,hasError:false,classNames:r,unstyled:e})]}),jsx("div",{className:a$1("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg px-4 mb-6",r==null?void 0:r.stepIndicatorWrapper,e),children:jsx(lr,{currentStep:n,classNames:r,unstyled:e})}),jsxs("div",{className:a$1("flex flex-col lg:flex-row gap-6 items-start",r==null?void 0:r.panels,e),children:[jsxs("main",{"aria-live":"polite",className:a$1("flex-1 min-w-0 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-6",r==null?void 0:r.mainPanel,e),children:[n===1&&jsx(fr,{context:b,onUpdateOrg:l,classNames:r,unstyled:e}),n===2&&jsx(xr,{categories:b.dataCategories,onToggle:g,classNames:r,unstyled:e}),n===3&&jsx(hr,{context:b,onTogglePurpose:a$2,onUpdateContext:C,onAddProcessor:v,onRemoveProcessor:c,classNames:r,unstyled:e}),n===4&&jsx(Lr,{sections:S,customSections:B,sectionOverrides:J,complianceResult:D,onEditSection:Z,onAddCustomSection:or,onRemoveCustomSection:er,onReorderSection:h,onExportPDF:qr,onExportDOCX:Or,onExportHTML:Hr,onExportMarkdown:Wr,classNames:r,unstyled:e}),jsxs("div",{className:a$1("flex items-center justify-between mt-8 pt-4 border-t border-gray-200 dark:border-gray-700",r==null?void 0:r.navigation,e),children:[jsx("button",{type:"button",onClick:i,disabled:n===1,className:a$1("px-4 py-2 bg-gray-200 dark:bg-gray-700 ndpr-text-foreground rounded-md text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed hover:bg-gray-300 dark:hover:bg-gray-600 transition-colors",r==null?void 0:r.backButton,e),children:"Back"}),jsx("div",{className:"flex items-center gap-2",children:jsxs("span",{className:a$1("ndpr-form-field__hint",r==null?void 0:r.stepCounter,e),children:["Step ",n," of 4"]})}),n<4?jsx("button",{type:"button",onClick:t,disabled:!u,className:a$1("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed transition-colors",r==null?void 0:r.nextButton,e),children:"Next"}):jsx("span",{})]})]}),jsx("aside",{className:a$1("w-full lg:w-80 flex-shrink-0",r==null?void 0:r.sidebarWrapper,e),children:jsx($r,{complianceResult:D,onFix:ir,classNames:r,unstyled:e})})]})]})})};
|
|
2
|
+
export{mo as a};//# sourceMappingURL=chunk-ID2NYIVE.mjs.map
|
|
3
|
+
//# sourceMappingURL=chunk-ID2NYIVE.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var l=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function d(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function r(e){return typeof e=="string"&&e.trim().length>0}function m(e,n={}){var u,f;let{requireIdentityVerification:o=true,allowedRequestTypes:a}=n,i={};if(!d(e))return {valid:false,errors:{_root:"Payload must be an object"}};r(e.requestType)?a&&!a.includes(e.requestType)&&(i.requestType=`Request type "${e.requestType}" is not in the allowed set`):i.requestType="Request type is required";let t=e.dataSubject;if(d(t)?(r(t.fullName)||(i["dataSubject.fullName"]="Full name is required"),r(t.email)?l.test(t.email)||(i["dataSubject.email"]="Email address format is invalid"):i["dataSubject.email"]="Email address is required",t.phone!==void 0&&typeof t.phone!="string"&&(i["dataSubject.phone"]="Phone must be a string when provided"),o&&(r(t.identifierType)||(i["dataSubject.identifierType"]="Identifier type is required"),r(t.identifierValue)||(i["dataSubject.identifierValue"]="Identifier value is required"))):i.dataSubject="Data subject information is required",(typeof e.submittedAt!="number"||!Number.isFinite(e.submittedAt))&&(i.submittedAt="submittedAt must be a finite number (ms timestamp)"),e.additionalInfo!==void 0&&!d(e.additionalInfo)&&(i.additionalInfo="additionalInfo must be an object when provided"),Object.keys(i).length>0)return {valid:false,errors:i};let s=t;return {valid:true,errors:{},data:{requestType:e.requestType,dataSubject:{fullName:s.fullName,email:s.email,phone:s.phone,identifierType:(u=s.identifierType)!=null?u:"",identifierValue:(f=s.identifierValue)!=null?f:""},additionalInfo:e.additionalInfo,submittedAt:e.submittedAt}}}function c(e){var a,i;let n=[];return e.id||n.push("Request ID is required"),e.type||n.push("Request type is required"),e.status||n.push("Request status is required"),e.createdAt||n.push("Creation timestamp is required"),(a=e.subject)!=null&&a.name||n.push("Data subject name is required"),(i=e.subject)!=null&&i.email||n.push("Data subject email is required"),{formattedRequest:{requestId:e.id,requestType:e.type,status:e.status,createdDate:new Date(e.createdAt).toISOString(),lastUpdated:e.updatedAt?new Date(e.updatedAt).toISOString():void 0,dueDate:e.dueDate?new Date(e.dueDate).toISOString():void 0,dataSubject:e.subject?{name:e.subject.name,email:e.subject.email,phone:e.subject.phone||"Not provided",identifier:{type:e.subject.identifierType||"Not specified",value:e.subject.identifierValue||"Not provided"}}:void 0,additionalInformation:e.additionalInfo||{},verificationStatus:e.verification?`${e.verification.verified?"Verified":"Not verified"}${e.verification.method?` via ${e.verification.method}`:""}`:"Pending verification",attachments:e.attachments?e.attachments.map(t=>({name:t.name,type:t.type,addedOn:new Date(t.addedAt).toISOString()})):[]},isValid:n.length===0,validationErrors:n}}exports.a=m;exports.b=c;//# sourceMappingURL=chunk-J5WCPZLW.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-J5WCPZLW.js.map
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import {d}from'./chunk-WWT2ZSNU.mjs';function x(o){return o.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function
|
|
2
|
-
`),s=[],e=false;for(let r of
|
|
3
|
-
`)}var
|
|
4
|
-
/* \u2500\u2500 Reset & Base \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
5
|
-
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
|
6
|
-
|
|
7
|
-
/* \u2500\u2500 Design tokens \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
8
|
-
:root {
|
|
1
|
+
import {d}from'./chunk-WWT2ZSNU.mjs';function x(o){return o.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function O(o,c){var r,i;if(!o)return "";let s={},e=(r=c.organizationInfo)!=null?r:{};typeof e.name=="string"&&e.name&&(s.orgName=e.name);for(let[t,l]of Object.entries(e))typeof l=="string"&&l&&!(t in s)&&(s[t]=l);for(let[t,l]of Object.entries((i=c.variableValues)!=null?i:{}))typeof l=="string"&&l&&(s[t]=l);return o.replace(/\{\{\s*([^}\s]+)\s*\}\}/g,(t,l)=>{let a=String(l).trim();return Object.prototype.hasOwnProperty.call(s,a)?s[a]:t})}function F(o){return o.toLowerCase().replace(/[^a-z0-9\s-]/g,"").trim().replace(/\s+/g,"-")}function A(o){let c=o.split(`
|
|
2
|
+
`),s=[],e=false;for(let r of c){let i=r.trimEnd();i.startsWith("- ")||i.startsWith("\u2022 ")?(e||(s.push("<ul>"),e=true),s.push(` <li>${x(i.replace(/^[-•]\s*/,""))}</li>`)):(e&&(s.push("</ul>"),e=false),i.trim()===""||s.push(`<p>${x(i)}</p>`));}return e&&s.push("</ul>"),s.join(`
|
|
3
|
+
`)}var H=`
|
|
9
4
|
--color-bg: #ffffff;
|
|
10
5
|
--color-surface: #f9fafb;
|
|
11
6
|
--color-border: #e5e7eb;
|
|
@@ -15,29 +10,34 @@ import {d}from'./chunk-WWT2ZSNU.mjs';function x(o){return o.replace(/&/g,"&"
|
|
|
15
10
|
--color-accent-light: #dcfce7;
|
|
16
11
|
--color-heading: #064e3b;
|
|
17
12
|
--color-link: #15803d;
|
|
18
|
-
--color-link-hover: #166534
|
|
13
|
+
--color-link-hover: #166534;`,L=`
|
|
14
|
+
--color-bg: #0f172a;
|
|
15
|
+
--color-surface: #1e293b;
|
|
16
|
+
--color-border: #334155;
|
|
17
|
+
--color-text: #f1f5f9;
|
|
18
|
+
--color-text-muted: #94a3b8;
|
|
19
|
+
--color-accent: #22c55e;
|
|
20
|
+
--color-accent-light: #14532d;
|
|
21
|
+
--color-heading: #86efac;
|
|
22
|
+
--color-link: #4ade80;
|
|
23
|
+
--color-link-hover: #86efac;`;function W(o){let c=o==="auto"?" color-scheme: light dark;":o==="dark"?" color-scheme: dark;":" color-scheme: light;",s=o==="dark"?L:H,e=o==="auto"?`
|
|
24
|
+
|
|
25
|
+
@media (prefers-color-scheme: dark) {
|
|
26
|
+
:root {${L}
|
|
27
|
+
}
|
|
28
|
+
}`:"";return `
|
|
29
|
+
:root {
|
|
30
|
+
${c}${s}
|
|
19
31
|
--font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
20
32
|
--font-mono: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, monospace;
|
|
21
33
|
--radius: 8px;
|
|
22
34
|
--shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
|
|
23
35
|
--max-width: 860px;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
:root {
|
|
28
|
-
--color-bg: #0f172a;
|
|
29
|
-
--color-surface: #1e293b;
|
|
30
|
-
--color-border: #334155;
|
|
31
|
-
--color-text: #f1f5f9;
|
|
32
|
-
--color-text-muted: #94a3b8;
|
|
33
|
-
--color-accent: #22c55e;
|
|
34
|
-
--color-accent-light: #14532d;
|
|
35
|
-
--color-heading: #86efac;
|
|
36
|
-
--color-link: #4ade80;
|
|
37
|
-
--color-link-hover: #86efac;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
36
|
+
}${e}`}var B=`
|
|
37
|
+
/* \u2500\u2500 Reset & Base \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
38
|
+
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
|
40
39
|
|
|
40
|
+
/* \u2500\u2500 Design tokens \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */`,R=`
|
|
41
41
|
/* \u2500\u2500 Layout \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
42
42
|
html { font-size: 16px; scroll-behavior: smooth; }
|
|
43
43
|
|
|
@@ -243,76 +243,76 @@ import {d}from'./chunk-WWT2ZSNU.mjs';function x(o){return o.replace(/&/g,"&"
|
|
|
243
243
|
|
|
244
244
|
a { color: inherit; text-decoration: none; }
|
|
245
245
|
}
|
|
246
|
-
`.trim()
|
|
246
|
+
`;function G(o){return `${B}${W(o)}${R}`.trim()}function _(o,c){var d,g;let s=(c==null?void 0:c.includeStyles)!==false,e=(d=c==null?void 0:c.customCSS)!=null?d:"",r=(g=c==null?void 0:c.theme)!=null?g:"light",i=o.sections.filter(n=>n.included),t=x(o.organizationInfo.name||"Organisation"),l=x(o.title||"Privacy Policy"),a=x(o.version||"1.0"),m=o.effectiveDate?new Date(o.effectiveDate).toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}):new Date().toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}),y=o.lastUpdated?new Date(o.lastUpdated).toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}):m,u=o.organizationInfo.website?`<a href="${x(o.organizationInfo.website)}" target="_blank" rel="noopener">${x(o.organizationInfo.website)}</a>`:"",b=o.organizationInfo.privacyEmail?`<a href="mailto:${x(o.organizationInfo.privacyEmail)}">${x(o.organizationInfo.privacyEmail)}</a>`:"",$=`
|
|
247
247
|
<nav class="policy-toc" aria-label="Table of Contents">
|
|
248
248
|
<h2>Table of Contents</h2>
|
|
249
249
|
<ol>
|
|
250
|
-
${
|
|
250
|
+
${i.map((n,v)=>` <li><a href="#${F(n.title)}">${x(n.title)}</a></li>`).join(`
|
|
251
251
|
`)}
|
|
252
252
|
</ol>
|
|
253
|
-
</nav>`,
|
|
254
|
-
<h2 id="section-heading-${
|
|
255
|
-
<span class="section-number" aria-hidden="true">${
|
|
256
|
-
${x(
|
|
253
|
+
</nav>`,w=i.map((n,v)=>{let p=F(n.title),f=n.template||n.defaultContent||"",h=O(f,{variableValues:o.variableValues,organizationInfo:o.organizationInfo}),z=A(h);return ` <section class="policy-section" id="${p}" aria-labelledby="section-heading-${p}">
|
|
254
|
+
<h2 id="section-heading-${p}">
|
|
255
|
+
<span class="section-number" aria-hidden="true">${v+1}</span>
|
|
256
|
+
${x(n.title)}
|
|
257
257
|
</h2>
|
|
258
|
-
${
|
|
258
|
+
${z}
|
|
259
259
|
</section>`}).join(`
|
|
260
260
|
|
|
261
|
-
`),
|
|
262
|
-
${
|
|
263
|
-
${
|
|
261
|
+
`),P=e?e.replace(/<\/style>/gi,""):"",D=s?`<style>
|
|
262
|
+
${G(r)}
|
|
263
|
+
${P?`
|
|
264
264
|
/* \u2500\u2500 Custom styles \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
265
|
-
${
|
|
266
|
-
</style>`:
|
|
265
|
+
${P}`:""}
|
|
266
|
+
</style>`:P?`<style>${P}</style>`:"";return `<!DOCTYPE html>
|
|
267
267
|
<html lang="en">
|
|
268
268
|
<head>
|
|
269
269
|
<meta charset="UTF-8" />
|
|
270
270
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
271
|
-
<meta name="description" content="Privacy Policy for ${
|
|
271
|
+
<meta name="description" content="Privacy Policy for ${t}" />
|
|
272
272
|
<meta name="generator" content="NDPA Toolkit" />
|
|
273
|
-
<title>${
|
|
273
|
+
<title>${l} \u2014 ${t}</title>
|
|
274
274
|
${D}
|
|
275
275
|
</head>
|
|
276
276
|
<body>
|
|
277
277
|
<div class="policy-wrapper">
|
|
278
278
|
|
|
279
279
|
<header class="policy-header">
|
|
280
|
-
<h1>${
|
|
280
|
+
<h1>${l}</h1>
|
|
281
281
|
<div class="policy-meta">
|
|
282
|
-
<span><strong>Organisation:</strong> ${
|
|
283
|
-
<span><strong>Effective:</strong> ${
|
|
284
|
-
<span><strong>Version:</strong> ${
|
|
285
|
-
${
|
|
282
|
+
<span><strong>Organisation:</strong> ${t}</span>
|
|
283
|
+
<span><strong>Effective:</strong> ${m}</span>
|
|
284
|
+
<span><strong>Version:</strong> ${a}</span>
|
|
285
|
+
${y!==m?`<span><strong>Last updated:</strong> ${y}</span>`:""}
|
|
286
286
|
</div>
|
|
287
287
|
<div>
|
|
288
288
|
<span class="compliance-badge" role="img" aria-label="NDPA compliant">✓ NDPA 2023 Compliant</span>
|
|
289
289
|
</div>
|
|
290
290
|
</header>
|
|
291
291
|
|
|
292
|
-
${
|
|
292
|
+
${$}
|
|
293
293
|
|
|
294
294
|
<article class="policy-body" aria-label="Policy content">
|
|
295
295
|
|
|
296
|
-
${
|
|
296
|
+
${w}
|
|
297
297
|
|
|
298
298
|
</article>
|
|
299
299
|
|
|
300
300
|
<footer class="policy-footer" role="contentinfo">
|
|
301
|
-
<div>${
|
|
302
|
-
${
|
|
303
|
-
<div>Effective ${
|
|
301
|
+
<div>${t}${u?` — ${u}`:""}</div>
|
|
302
|
+
${b?`<div>Privacy contact: ${b}</div>`:""}
|
|
303
|
+
<div>Effective ${m} • Version ${a}</div>
|
|
304
304
|
<div>Generated by <strong>NDPA Toolkit</strong> — Nigeria Data Protection Act 2023</div>
|
|
305
305
|
</footer>
|
|
306
306
|
|
|
307
307
|
</div>
|
|
308
308
|
</body>
|
|
309
|
-
</html>`}function
|
|
310
|
-
`);for(let
|
|
311
|
-
`)}function
|
|
309
|
+
</html>`}function j(o){return o.toLowerCase().replace(/[^a-z0-9\s-]/g,"").trim().replace(/\s+/g,"-")}function V(o){let c=o.sections.filter(l=>l.included),s=o.title||"Privacy Policy",e=o.organizationInfo.name||"Organisation",r=o.version||"1.0",i=o.effectiveDate?new Date(o.effectiveDate).toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}):new Date().toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}),t=[];return t.push(`# ${s}`),t.push(""),t.push(`_Effective: ${i} | Version: ${r} | ${e}_`),t.push(""),o.organizationInfo.website&&t.push(`**Website:** ${o.organizationInfo.website} `),o.organizationInfo.privacyEmail&&t.push(`**Privacy contact:** ${o.organizationInfo.privacyEmail} `),(o.organizationInfo.website||o.organizationInfo.privacyEmail)&&t.push(""),t.push("> This privacy policy is compliant with the **Nigeria Data Protection Act (NDPA) 2023**."),t.push(""),t.push("---"),t.push(""),c.length>0&&(t.push("## Table of Contents"),t.push(""),c.forEach((l,a)=>{let m=j(`${a+1} ${l.title}`);t.push(`${a+1}. [${l.title}](#${m})`);}),t.push(""),t.push("---"),t.push("")),c.forEach((l,a)=>{t.push(`## ${a+1}. ${l.title}`),t.push("");let m=(l.template||l.defaultContent||"").trim();if(m){let y=m.split(`
|
|
310
|
+
`);for(let u of y){let b=u.trimEnd();b.startsWith("-")||b.startsWith("\u2022")||b===""?t.push(b.replace(/^•/,"-")):t.push(b);}}t.push(""),t.push("---"),t.push("");}),t.push(`_Generated by **NDPA Toolkit** \u2014 ${e} \u2022 Version ${r}_`),t.push(""),t.join(`
|
|
311
|
+
`)}function M(o,c){return d(this,null,function*(){var D;let s;try{let d=yield import('jspdf');s=(D=d.jsPDF)!=null?D:d.default;}catch(d){throw new Error(`[ndpr-toolkit] PDF export requires the "jspdf" package. Install it with:
|
|
312
312
|
pnpm add jspdf
|
|
313
|
-
See: https://ndprtoolkit.com.ng/docs/guides/styling-customization`)}let e=new s({unit:"mm",format:"a4"}),r=e.internal.pageSize.getWidth(),
|
|
314
|
-
`);e.setFontSize(9.5),e.setFont("helvetica","normal"),e.setTextColor(50,50,50),
|
|
313
|
+
See: https://ndprtoolkit.com.ng/docs/guides/styling-customization`)}let e=new s({unit:"mm",format:"a4"}),r=e.internal.pageSize.getWidth(),i=e.internal.pageSize.getHeight(),t=20,l=r-t*2,a=t,m=o.organizationInfo.name||"",y=o.title||"Privacy Policy",u=o.version||"1.0",b=o.effectiveDate?new Date(o.effectiveDate).toLocaleDateString():new Date().toLocaleDateString(),T=()=>{e.setFontSize(8),e.setFont("helvetica","italic"),e.setTextColor(150,150,150),e.text(m?`${m} \u2014 ${y}`:y,t,12),e.setDrawColor(220,220,220),e.setLineWidth(.3),e.line(t,14,r-t,14),e.setTextColor(0,0,0);},$=d=>{a+d>i-t-10&&(e.addPage(),a=t+8,T());};if((c==null?void 0:c.includeCoverPage)!==false){e.setFillColor(22,163,74),e.rect(0,0,r,12,"F"),e.setFontSize(28),e.setFont("helvetica","bold"),e.setTextColor(22,163,74);let d=e.splitTextToSize(y,l-10),g=72;d.forEach(v=>{e.text(v,r/2,g,{align:"center"}),g+=11;}),e.setDrawColor(22,163,74),e.setLineWidth(.6);let n=g+6;if(e.line(r/2-30,n,r/2+30,n),e.setFontSize(14),e.setFont("helvetica","normal"),e.setTextColor(40,40,40),e.text(m,r/2,n+14,{align:"center"}),e.setFontSize(10),e.setTextColor(100,100,100),e.text(`Effective Date: ${b}`,r/2,n+26,{align:"center"}),e.text(`Version ${u}`,r/2,n+34,{align:"center"}),(c==null?void 0:c.includeComplianceBadge)!==false){let v=n+52,p="Compliant with the Nigeria Data Protection Act (NDPA) 2023";e.setFontSize(8.5),e.setFont("helvetica","bold"),e.setTextColor(255,255,255);let f=e.getTextWidth(p),h=7,z=3.5,S=(r-f-h*2)/2;e.setFillColor(22,163,74),e.roundedRect(S,v-z-1,f+h*2,7+z,2,2,"F"),e.text(p,r/2,v+1.5,{align:"center"}),e.setTextColor(0,0,0);}e.setFillColor(22,163,74),e.rect(0,i-12,r,12,"F"),e.addPage(),a=t+8,T();}let w=o.sections.filter(d=>d.included);(c==null?void 0:c.includeTOC)!==false&&(e.setFontSize(18),e.setFont("helvetica","bold"),e.setTextColor(22,163,74),e.text("Table of Contents",t,a+4),e.setDrawColor(22,163,74),e.setLineWidth(.5),e.line(t,a+8,t+80,a+8),a+=18,e.setFontSize(10.5),e.setFont("helvetica","normal"),e.setTextColor(40,40,40),w.forEach((d,g)=>{$(7);let n=`${g+1}. ${d.title}`;e.text(n,t+4,a),a+=6.5;}),e.addPage(),a=t+8,T()),w.forEach((d,g)=>{$(18),e.setFillColor(22,163,74),e.circle(t+3.5,a-1.5,3.8,"F"),e.setFontSize(8),e.setFont("helvetica","bold"),e.setTextColor(255,255,255),e.text(String(g+1),t+3.5,a-.5,{align:"center"}),e.setFontSize(13),e.setFont("helvetica","bold"),e.setTextColor(22,163,74),e.text(d.title,t+11,a),a+=3,e.setDrawColor(200,200,200),e.setLineWidth(.25),e.line(t+11,a,r-t,a),a+=6;let n=(d.template||d.defaultContent||"").trim();if(n){let v=n.split(`
|
|
314
|
+
`);e.setFontSize(9.5),e.setFont("helvetica","normal"),e.setTextColor(50,50,50),v.forEach(p=>{let f=p.trimEnd();if(f===""){a+=3;return}let h=f.startsWith("-")||f.startsWith("\u2022"),z=h?t+8:t+4,S=h?f.replace(/^[-•]\s*/,""):f,C=l-(h?12:8);e.splitTextToSize(S,C).forEach((E,I)=>{$(5),h&&I===0&&(e.setFillColor(22,163,74),e.circle(t+4,a-1,.9,"F")),e.text(E,z,a),a+=5;});});}a+=10;});let P=e.getNumberOfPages();for(let d=1;d<=P;d++)e.setPage(d),e.setFontSize(7.5),e.setFont("helvetica","normal"),e.setTextColor(160,160,160),e.setDrawColor(220,220,220),e.setLineWidth(.3),e.line(t,i-12,r-t,i-12),e.text(m?`${m} \u2014 Privacy Policy`:"Privacy Policy",t,i-8),e.text(`Page ${d} of ${P}`,r-t,i-8,{align:"right"}),e.setTextColor(0,0,0);return e.setProperties({title:y,author:m,subject:"Privacy Policy \u2014 NDPA 2023 Compliant",keywords:"privacy policy, NDPA, Nigeria, data protection"}),e.output("blob")})}function X(o,c){return d(this,null,function*(){let s;try{s=yield import('docx');}catch(p){throw new Error(`[ndpr-toolkit] Word export requires the "docx" package. Install it with:
|
|
315
315
|
pnpm add docx
|
|
316
|
-
See: https://ndprtoolkit.com.ng/docs/guides/styling-customization`)}let{Document:e,Paragraph:r,TextRun:
|
|
317
|
-
`).forEach(S=>{let C=S.trimEnd();if(C===""){
|
|
318
|
-
//# sourceMappingURL=chunk-
|
|
316
|
+
See: https://ndprtoolkit.com.ng/docs/guides/styling-customization`)}let{Document:e,Paragraph:r,TextRun:i,HeadingLevel:t,Packer:l,Header:a,Footer:m,PageNumber:y,AlignmentType:u,BorderStyle:b,ShadingType:T,TableOfContents:$}=s,w=o.organizationInfo.name||"",P=o.title||"Privacy Policy",D=o.version||"1.0",d=o.effectiveDate?new Date(o.effectiveDate).toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}):new Date().toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}),g=o.sections.filter(p=>p.included),n=[];if(n.push(new r({children:[new i({text:P,bold:true,size:52,color:"064e3b"})],heading:t.TITLE,spacing:{after:160},alignment:u.CENTER})),n.push(new r({children:[new i({text:`${w}${w?" \u2022 ":""}Version ${D} \u2022 Effective ${d}`,size:20,color:"6b7280",italics:true})],spacing:{after:120},alignment:u.CENTER})),n.push(new r({children:[new i({text:"Compliant with the Nigeria Data Protection Act (NDPA) 2023",size:18,color:"16a34a",bold:true})],spacing:{after:400},alignment:u.CENTER})),n.push(new r({children:[],spacing:{after:200},border:{bottom:{color:"16a34a",style:b.SINGLE,size:6,space:1}}})),(c==null?void 0:c.includeTOC)!==false){if(n.push(new r({children:[new i({text:"Table of Contents",bold:true,size:28,color:"064e3b"})],heading:t.HEADING_1,spacing:{before:400,after:200}})),typeof $=="function")try{n.push(new $("Table of Contents",{hyperlink:!0,headingStyleRange:"1-1"}));}catch(p){g.forEach((f,h)=>{n.push(new r({children:[new i({text:`${h+1}. ${f.title}`,size:22,color:"15803d"})],spacing:{after:80}}));});}else g.forEach((p,f)=>{n.push(new r({children:[new i({text:`${f+1}. ${p.title}`,size:22,color:"15803d"})],spacing:{after:80}}));});n.push(new r({children:[],pageBreakBefore:true}));}g.forEach((p,f)=>{n.push(new r({children:[new i({text:`${f+1}. ${p.title}`,bold:true,size:28,color:"064e3b"})],heading:t.HEADING_1,spacing:{before:400,after:200},border:{bottom:{color:"dcfce7",style:b.SINGLE,size:4,space:1}}}));let h=(p.template||p.defaultContent||"").trim();h&&h.split(`
|
|
317
|
+
`).forEach(S=>{let C=S.trimEnd();if(C===""){n.push(new r({children:[],spacing:{after:60}}));return}let N=C.startsWith("- ")||C.startsWith("\u2022 "),E=N?C.replace(/^[-•]\s*/,""):C;N?n.push(new r({children:[new i({text:E,size:22})],spacing:{after:80},bullet:{level:0}})):n.push(new r({children:[new i({text:E,size:22})],spacing:{after:100}}));});}),n.push(new r({children:[new i({text:`Generated by NDPA Toolkit \u2014 ${w}${w?" \u2014 ":""}Privacy Policy v${D}`,size:16,color:"9ca3af",italics:true})],spacing:{before:600},alignment:u.CENTER}));let v=new e({title:P,description:"Privacy Policy \u2014 NDPA 2023 Compliant",styles:{paragraphStyles:[{id:"Normal",name:"Normal",run:{font:"Calibri",size:22}}]},sections:[{headers:{default:new a({children:[new r({children:[new i({text:w||"Privacy Policy",size:16,color:"9ca3af"})],alignment:u.RIGHT})]})},footers:{default:new m({children:[new r({children:[new i({text:"Page ",size:16,color:"9ca3af"}),new i({children:[y.CURRENT],size:16,color:"9ca3af"}),new i({text:" of ",size:16,color:"9ca3af"}),new i({children:[y.TOTAL_PAGES],size:16,color:"9ca3af"})],alignment:u.CENTER})]})},children:n}]});return l.toBlob(v)})}export{_ as a,V as b,M as c,X as d};//# sourceMappingURL=chunk-JFFOPHU3.mjs.map
|
|
318
|
+
//# sourceMappingURL=chunk-JFFOPHU3.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkCPK5D5FY_js=require('./chunk-CPK5D5FY.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js');function s(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function q(e){let n=new Set,o=new RegExp(`${s(chunkCPK5D5FY_js.a)}([^${s("\xBB")}]+)${s("\xBB")}`,"g"),i;for(;(i=o.exec(e))!==null;)n.add(i[1].trim());let r=/\{\{\s*([^}\s]+)\s*\}\}/g;for(;(i=r.exec(e))!==null;)n.add(i[1].trim());return Array.from(n)}function P(e,n){if(typeof e=="string"){let o=e,i=n,r=o,c=/\{\{([^}]+)\}\}/g,d;for(;(d=c.exec(o))!==null;){let t=d[1].trim(),a=i[t]||"";r=r.replace(new RegExp(`\\{\\{\\s*${s(t)}\\s*\\}\\}`,"g"),a);}return r}else {let o=e,i=n,r={},c=[];return o.filter(t=>t.included).sort((t,a)=>(t.order||0)-(a.order||0)).forEach(t=>{let a=t.template||t.customContent||t.defaultContent||"",y=/\{\{([^}]+)\}\}/g,m,h=[];for(;(m=y.exec(a))!==null;)h.push(m[1].trim());h.forEach(l=>{let u="";l in i&&(u=i[l]||""),u||c.push(l),a=a.replace(new RegExp(`\\{\\{\\s*${s(l)}\\s*\\}\\}`,"g"),u);}),r[t.id]=a;}),{fullText:Object.values(r).join(`
|
|
2
2
|
|
|
3
3
|
`),sectionTexts:r,missingVariables:Array.from(new Set(c))}}}var w=[{id:"data-collection",title:"Data Collection",description:"Describes what personal data is collected and how it is obtained.",order:1,required:true,included:true,template:'{{orgName}} ("we", "us", or "our") collects personal data from users of our services at {{website}}. We collect information you provide directly, such as your name, email address, phone number, and any other details you submit through forms or communications. We may also collect data automatically, including IP addresses, browser type, device information, and usage patterns through cookies and similar technologies. All data collection is conducted in accordance with the Nigeria Data Protection Act (NDPA) 2023.',variables:["orgName","website"]},{id:"legal-basis",title:"Legal Basis for Processing",description:"Specifies the lawful basis for processing personal data under the NDPA.",order:2,required:true,included:true,template:`{{orgName}} processes personal data under one or more of the following lawful bases as prescribed by the NDPA 2023:
|
|
4
4
|
|
|
@@ -59,5 +59,5 @@ DPO Email: {{dpoEmail}}
|
|
|
59
59
|
|
|
60
60
|
You also have the right to lodge a complaint with the Nigeria Data Protection Commission (NDPC) if you believe your data protection rights have been violated.
|
|
61
61
|
|
|
62
|
-
This policy is effective as of {{effectiveDate}} and applies to all {{industry}} services provided by {{orgName}}.`,variables:["orgName","address","privacyEmail","website","dpoName","dpoEmail","effectiveDate","industry"]}],v=[{id:"orgName",name:"orgName",description:"The official name of your organisation.",value:"",inputType:"text",required:true},{id:"website",name:"website",description:"Your organisation's website URL.",value:"",inputType:"url",required:true},{id:"privacyEmail",name:"privacyEmail",description:"Email address for privacy-related enquiries.",value:"",inputType:"email",required:true},{id:"dpoName",name:"dpoName",description:"Full name of your Data Protection Officer.",value:"",inputType:"text",required:false},{id:"dpoEmail",name:"dpoEmail",description:"Email address of your Data Protection Officer.",value:"",inputType:"email",required:false},{id:"address",name:"address",description:"Physical address of your organisation.",value:"",inputType:"textarea",required:false},{id:"industry",name:"industry",description:"The industry or sector your organisation operates in.",value:"",inputType:"text",required:false},{id:"effectiveDate",name:"effectiveDate",description:"The date this privacy policy becomes effective.",value:"",inputType:"date",required:false}];function N(){return {sections:w.map(e=>chunkMQFZHA2D_js.a({},e)),variables:v.map(e=>chunkMQFZHA2D_js.a({},e))}}exports.a=q;exports.b=P;exports.c=w;exports.d=v;exports.e=N;//# sourceMappingURL=chunk-
|
|
63
|
-
//# sourceMappingURL=chunk-
|
|
62
|
+
This policy is effective as of {{effectiveDate}} and applies to all {{industry}} services provided by {{orgName}}.`,variables:["orgName","address","privacyEmail","website","dpoName","dpoEmail","effectiveDate","industry"]}],v=[{id:"orgName",name:"orgName",description:"The official name of your organisation.",value:"",inputType:"text",required:true},{id:"website",name:"website",description:"Your organisation's website URL.",value:"",inputType:"url",required:true},{id:"privacyEmail",name:"privacyEmail",description:"Email address for privacy-related enquiries.",value:"",inputType:"email",required:true},{id:"dpoName",name:"dpoName",description:"Full name of your Data Protection Officer.",value:"",inputType:"text",required:false},{id:"dpoEmail",name:"dpoEmail",description:"Email address of your Data Protection Officer.",value:"",inputType:"email",required:false},{id:"address",name:"address",description:"Physical address of your organisation.",value:"",inputType:"textarea",required:false},{id:"industry",name:"industry",description:"The industry or sector your organisation operates in.",value:"",inputType:"text",required:false},{id:"effectiveDate",name:"effectiveDate",description:"The date this privacy policy becomes effective.",value:"",inputType:"date",required:false}];function N(){return {sections:w.map(e=>chunkMQFZHA2D_js.a({},e)),variables:v.map(e=>chunkMQFZHA2D_js.a({},e))}}exports.a=q;exports.b=P;exports.c=w;exports.d=v;exports.e=N;//# sourceMappingURL=chunk-LIM64IV2.js.map
|
|
63
|
+
//# sourceMappingURL=chunk-LIM64IV2.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {b as b$1,e}from'./chunk-CKGJK4D7.mjs';import {a as a$1}from'./chunk-6WIP33TW.mjs';import {b,a}from'./chunk-WWT2ZSNU.mjs';import {useRef,useState,useEffect,useCallback}from'react';function W(e,s){return s?a$1(e):{load:()=>null,save:()=>{},remove:()=>{}}}function A({templates:e,initialPolicy:s,adapter:y,storageKey:l="ndpr_privacy_policy",persist:f,useLocalStorage:D,onGenerate:T}){var V;let O=(V=f!=null?f:D)!=null?V:true,w=y!=null?y:W(l,O),c=useRef(w);c.current=w;let[n,p]=useState(s||null),[o,g]=useState(null),[u,S]=useState({name:"",website:"",privacyEmail:"",address:"",privacyPhone:"",dpoName:"",dpoEmail:"",industry:""}),[C,E]=useState(true),R=useRef(e);R.current=e,useEffect(()=>{if(s){E(false);return}let t=false;try{let r=c.current.load(),i=a=>{if(a){if(p(a),a.templateId){let P=R.current.find(b=>b.id===a.templateId);P&&g(P);}a.organizationInfo&&S(a.organizationInfo);}E(!1);};r instanceof Promise?r.then(a=>{t||i(a);},()=>{t||E(!1);}):i(r);}catch(r){t||E(false);}return ()=>{t=true;}},[s]);let k=t=>{Promise.resolve(c.current.save(t)).catch(r=>{console.warn("[ndpr-toolkit] Failed to save policy:",r);});},j=useCallback(t=>{let r=e.find(b=>b.id===t);if(!r)return false;g(r);let i=r.sections.map(b$1=>b(a({},b$1),{customContent:void 0})),a$1={};Object.keys(r.variables).forEach(b=>{a$1[b]=r.variables[b].defaultValue||"";});let P=Date.now();return p({id:"policy_"+P+"_"+Math.random().toString(36).substr(2,9),title:"",templateId:r.id,organizationInfo:u,sections:i,variableValues:a$1,effectiveDate:P,lastUpdated:P,version:"1.0"}),true},[e,u]),I=useCallback(t=>{S(r=>a(a({},r),t));},[]),F=useCallback((t,r)=>{o&&(n?p(i=>i&&b(a({},i),{sections:i.sections.map(a$1=>a$1.id===t?b(a({},a$1),{included:r}):a$1)})):g(i=>i&&b(a({},i),{sections:i.sections.map(a$1=>a$1.id===t?b(a({},a$1),{included:r}):a$1)})));},[o,n]),M=useCallback((t,r)=>{o&&(n?p(i=>i&&b(a({},i),{sections:i.sections.map(a$1=>a$1.id===t?b(a({},a$1),{customContent:r}):a$1)})):g(i=>i&&b(a({},i),{sections:i.sections.map(a$1=>a$1.id===t?b(a({},a$1),{customContent:r}):a$1)})));},[o,n]),$=useCallback((t,r)=>{n&&p(i=>i&&b(a({},i),{variableValues:b(a({},i.variableValues),{[t]:r})}));},[n]),B=()=>"policy_"+Date.now()+"_"+Math.random().toString(36).substr(2,9),G=useCallback(()=>{if(!o)return null;let t=Date.now(),r={id:(n==null?void 0:n.id)||B(),title:`Privacy Policy for ${u.name}`,templateId:o.id,organizationInfo:u,sections:o.sections.map(i=>{var a$1;return b(a({},i),{customContent:(a$1=n==null?void 0:n.sections.find(P=>P.id===i.id))==null?void 0:a$1.customContent})}),variableValues:(n==null?void 0:n.variableValues)||{},effectiveDate:t,lastUpdated:t,version:"1.0"};return p(r),k(r),T&&T(r),r},[o,n,u,T]),K=useCallback(()=>{if(!n)return {fullText:"",sectionTexts:{},missingVariables:[]};let t=b$1(n.sections,n.organizationInfo);return typeof t=="string"?{fullText:t,sectionTexts:{full:t},missingVariables:[]}:t},[n]),H=useCallback(()=>{p(null),g(null),S({name:"",website:"",privacyEmail:"",address:"",privacyPhone:"",dpoName:"",dpoEmail:"",industry:""}),Promise.resolve(c.current.remove()).catch(t=>{console.warn("[ndpr-toolkit] Failed to remove policy:",t);});},[]),J=useCallback(()=>{let t=[];if(o||t.push("No template selected"),u.name||t.push("Organization name is required"),u.website||t.push("Organization website is required"),u.privacyEmail||t.push("Privacy contact email is required"),o){let r=o.sections.filter(a=>a.required),i=(n==null?void 0:n.sections.filter(a=>a.included))||[];r.forEach(a=>{i.some(P=>P.id===a.id)||t.push(`Required section "${a.title}" must be included`);});}return o&&n&&Object.entries(o.variables).forEach(([r,i])=>{i.required&&!n.variableValues[r]&&t.push(`Required variable "${i.name}" must have a value`);}),{valid:t.length===0,errors:t}},[o,u,n]);return {policy:n,selectedTemplate:o,organizationInfo:u,selectTemplate:j,updateOrganizationInfo:I,toggleSection:F,updateSectionContent:M,updateVariableValue:$,generatePolicy:G,getPolicyText:K,resetPolicy:H,isValid:J,isLoading:C}}var _="default-business";function X(e){return e.toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"})}function Y(e$1){let{sections:s,variables:y}=e(),l={};return e$1&&(e$1.name&&(l.orgName=e$1.name),e$1.email&&(l.privacyEmail=e$1.email),e$1.website&&(l.website=e$1.website),e$1.address&&(l.address=e$1.address),e$1.industry&&(l.industry=e$1.industry),e$1.dpoName&&(l.dpoName=e$1.dpoName),e$1.dpoEmail&&(l.dpoEmail=e$1.dpoEmail)),l.effectiveDate||(l.effectiveDate=X(new Date)),{id:_,name:"Default Business Policy",description:"NDPA-compliant privacy policy template for businesses.",organizationType:"business",sections:s,variables:Object.fromEntries(y.map(f=>[f.name,{name:f.name,description:f.description,required:f.required,defaultValue:l[f.name]||f.value||void 0}])),version:"1.0",lastUpdated:Date.now(),ndpaCompliant:true}}function Z(e){if(!e)return {};let s={};return e.name&&(s.name=e.name),e.email&&(s.privacyEmail=e.email),e.website&&(s.website=e.website),e.address&&(s.address=e.address),e.industry&&(s.industry=e.industry),e.dpoName&&(s.dpoName=e.dpoName),e.dpoEmail&&(s.dpoEmail=e.dpoEmail),s}function ce(e={}){var o;let{orgInfo:s,autoGenerate:y=true,storageKey:l,persist:f,useLocalStorage:D,adapter:T}=e,O=(o=f!=null?f:D)!=null?o:true,w=useRef(null);w.current===null&&(w.current=Y(s));let c=A({templates:[w.current],adapter:T,storageKey:l,persist:O}),n=useRef(false),p=useRef(false);return useEffect(()=>{if(!y||c.isLoading||n.current)return;if(!T&&O!==false&&typeof window!="undefined"&&typeof window.localStorage!="undefined")try{if(window.localStorage.getItem(l!=null?l:"ndpr_privacy_policy")){n.current=!0,p.current=!0;return}}catch(S){}if(c.policy){n.current=true,p.current=true;return}n.current=true;let u=Z(s);Object.keys(u).length>0&&c.updateOrganizationInfo(u),c.selectedTemplate||c.selectTemplate(_);},[y,c.isLoading]),useEffect(()=>{var u;if(!y||p.current||!n.current||!c.selectedTemplate)return;let g=(u=s==null?void 0:s.name)!=null?u:"";g&&c.organizationInfo.name!==g||(p.current=true,c.generatePolicy());},[y,c.selectedTemplate,c.organizationInfo]),c}export{A as a,ce as b};//# sourceMappingURL=chunk-LU7PKE7Y.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-LU7PKE7Y.mjs.map
|