@tantainnovative/ndpr-toolkit 5.1.1 → 5.1.2
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 +24 -0
- package/README.md +1 -1
- package/dist/breach.js +1 -1
- package/dist/breach.mjs +1 -1
- package/dist/{chunk-BRJKIF7E.mjs → chunk-2ASQQYJR.mjs} +1 -1
- package/dist/{chunk-3SIYRGJF.js → chunk-2MGLU3FY.js} +3 -3
- package/dist/{chunk-CSE36REY.js → chunk-2OSZT7KI.js} +1 -1
- package/dist/{chunk-MAD7QYRK.js → chunk-37VR2MXL.js} +1 -1
- package/dist/{chunk-3H6FYU3Z.mjs → chunk-5E56KT7E.mjs} +1 -1
- package/dist/{chunk-V5TZJJWU.mjs → chunk-5LJ652AH.mjs} +1 -1
- package/dist/{chunk-F5MGMNQF.js → chunk-6KQADEFS.js} +1 -1
- package/dist/{chunk-D2UWB5OI.js → chunk-6MO3GS3B.js} +1 -1
- package/dist/{chunk-WPH6CJDL.mjs → chunk-6UGLAVRM.mjs} +1 -1
- package/dist/{chunk-TTMGFC6C.js → chunk-7563FVMY.js} +1 -1
- package/dist/{chunk-SBSYHCPK.mjs → chunk-AS2M5OTX.mjs} +1 -1
- package/dist/chunk-BHUJWWCO.js +1 -0
- package/dist/{chunk-42UJFTII.js → chunk-C32TMS75.js} +1 -1
- package/dist/{chunk-6A6VI7ZP.mjs → chunk-C77CRJLD.mjs} +1 -1
- package/dist/{chunk-3I6FYA5C.js → chunk-C7OOUURS.js} +1 -1
- package/dist/{chunk-BPMVJOHH.mjs → chunk-CNCEP66F.mjs} +1 -1
- package/dist/{chunk-WCTFED27.js → chunk-DRQURLN5.js} +1 -1
- package/dist/{chunk-L3FR4PQE.mjs → chunk-EAV4BZKO.mjs} +1 -1
- package/dist/{chunk-J7BIJ45O.mjs → chunk-EF5CLD4V.mjs} +1 -1
- package/dist/{chunk-4FXRJH37.js → chunk-ERCGW2DJ.js} +1 -1
- package/dist/{chunk-UZNWXJ2W.js → chunk-FRHFIEWZ.js} +1 -1
- package/dist/{chunk-ELK6VFKC.mjs → chunk-HDPXARLC.mjs} +1 -1
- package/dist/{chunk-I2ZBMR7F.mjs → chunk-HMKXK23C.mjs} +1 -1
- package/dist/{chunk-YDKWD6MQ.js → chunk-I5ZDNSX5.js} +1 -1
- package/dist/{chunk-RDALAH3Y.js → chunk-JVMHWM3I.js} +1 -1
- package/dist/{chunk-PSPYIRIF.mjs → chunk-KUI5W44P.mjs} +1 -1
- package/dist/{chunk-6YFPDGNB.js → chunk-LP5KXMBY.js} +1 -1
- package/dist/{chunk-N72RNTGP.mjs → chunk-MIQQYXTE.mjs} +1 -1
- package/dist/{chunk-WVHMY2BV.mjs → chunk-OLTLB5MP.mjs} +1 -1
- package/dist/{chunk-FRQFU44F.mjs → chunk-PHA3YMFO.mjs} +1 -1
- package/dist/{chunk-ZD2W3YU2.js → chunk-PXUX4FYM.js} +1 -1
- package/dist/{chunk-37VFK5SR.js → chunk-QG72X7G4.js} +1 -1
- package/dist/{chunk-NBOJ2KGN.mjs → chunk-RW7V7DDR.mjs} +1 -1
- package/dist/{chunk-3E4IH7CE.js → chunk-SMEZAQNJ.js} +1 -1
- package/dist/{chunk-B2EXRSYG.mjs → chunk-TWWGNFPF.mjs} +1 -1
- package/dist/{chunk-ASEUTU45.js → chunk-TYR5PFYD.js} +1 -1
- package/dist/{chunk-KH3EQJQE.js → chunk-VEWLYTRA.js} +1 -1
- package/dist/{chunk-63WM5PHZ.js → chunk-VTBHDHYK.js} +1 -1
- package/dist/{chunk-DK7P5JEG.mjs → chunk-WLZTATLL.mjs} +1 -1
- package/dist/chunk-XAB5C2JG.mjs +1 -0
- package/dist/{chunk-7RBO42IW.mjs → chunk-YX7DEHPA.mjs} +1 -1
- package/dist/{chunk-ZQHGIOYP.mjs → chunk-YZHEEGGK.mjs} +1 -1
- package/dist/consent.js +1 -1
- package/dist/consent.mjs +1 -1
- package/dist/core.d.mts +2 -2
- package/dist/core.d.ts +2 -2
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/cross-border-lite.d.mts +1 -1
- package/dist/cross-border-lite.d.ts +1 -1
- package/dist/cross-border-lite.js +1 -1
- package/dist/cross-border-lite.mjs +1 -1
- package/dist/cross-border.js +1 -1
- package/dist/cross-border.mjs +1 -1
- package/dist/dpia.js +1 -1
- package/dist/dpia.mjs +1 -1
- package/dist/dsr.js +1 -1
- package/dist/dsr.mjs +1 -1
- package/dist/headless.d.mts +1 -1
- package/dist/headless.d.ts +1 -1
- package/dist/headless.js +1 -1
- package/dist/headless.mjs +1 -1
- package/dist/hooks.d.mts +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/index.d.mts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lawful-basis-lite.d.mts +1 -1
- package/dist/lawful-basis-lite.d.ts +1 -1
- package/dist/lawful-basis-lite.js +1 -1
- package/dist/lawful-basis-lite.mjs +1 -1
- package/dist/lawful-basis.d.mts +1 -1
- package/dist/lawful-basis.d.ts +1 -1
- package/dist/lawful-basis.js +1 -1
- package/dist/lawful-basis.mjs +1 -1
- package/dist/policy.d.mts +5 -4
- package/dist/policy.d.ts +5 -4
- package/dist/policy.js +1 -1
- package/dist/policy.mjs +1 -1
- package/dist/presets-consent.js +1 -1
- package/dist/presets-consent.mjs +1 -1
- package/dist/presets-dsr.js +1 -1
- package/dist/presets-dsr.mjs +1 -1
- package/dist/presets-policy.d.mts +1 -1
- package/dist/presets-policy.d.ts +1 -1
- package/dist/presets-policy.js +1 -1
- package/dist/presets-policy.mjs +1 -1
- package/dist/presets.d.mts +2 -2
- package/dist/presets.d.ts +2 -2
- package/dist/presets.js +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/ropa-lite.js +1 -1
- package/dist/ropa-lite.mjs +1 -1
- package/dist/ropa.js +1 -1
- package/dist/ropa.mjs +1 -1
- package/dist/server.d.mts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +1 -1
- package/dist/server.mjs +1 -1
- package/dist/unstyled.js +1 -1
- package/dist/unstyled.mjs +1 -1
- package/package.json +8 -4
- package/dist/chunk-FC3PTJFL.js +0 -1
- package/dist/chunk-IQO3SIAG.mjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var chunk4CVBQC66_js=require('./chunk-4CVBQC66.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),chunkYDKWD6MQ_js=require('./chunk-YDKWD6MQ.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var $=[{value:"consent",label:"Consent (Section 25(1)(a))"},{value:"contract",label:"Contract (Section 25(1)(b))"},{value:"legal_obligation",label:"Legal Obligation (Section 25(1)(c))"},{value:"vital_interests",label:"Vital Interests (Section 25(1)(d))"},{value:"public_interest",label:"Public Interest (Section 25(1)(e))"},{value:"legitimate_interests",label:"Legitimate Interests (Section 25(1)(f))"}],de=[{value:"active",label:"Active"},{value:"inactive",label:"Inactive"},{value:"archived",label:"Archived"}],$e=[{value:"data_subject",label:"Directly from Data Subject"},{value:"third_party",label:"Third Party"},{value:"public_source",label:"Public Source"},{value:"other",label:"Other"}],He={active:"ndpr-badge ndpr-badge--success",inactive:"ndpr-badge ndpr-badge--warning",archived:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300"},Ve={active:"Active",inactive:"Inactive",archived:"Archived"},Ge={consent:"Consent",contract:"Contract",legal_obligation:"Legal Obligation",vital_interests:"Vital Interests",public_interest:"Public Interest",legitimate_interests:"Legitimate Interests"};function Je(){let o=Date.now();return {id:`proc_${o}_${Math.random().toString(36).substring(2,11)}`,name:"",description:"",controllerDetails:{name:"",contact:"",address:""},lawfulBasis:"consent",lawfulBasisJustification:"",purposes:[],dataCategories:[],dataSubjectCategories:[],recipients:[],retentionPeriod:"",securityMeasures:[],dataSource:"data_subject",dpiaRequired:false,automatedDecisionMaking:false,status:"active",createdAt:o,updatedAt:o}}function oe(o){return o?new Date(o).toLocaleDateString():"N/A"}var Ye=({ropa:o,onAdd:D,onUpdate:y,onArchive:S,title:B,description:I,className:le="",buttonClassName:F="",classNames:e,unstyled:n})=>{var N,ee;let H=chunkYDKWD6MQ_js.c(),pe=(N=B!=null?B:H.ropa.title)!=null?N:"Record of Processing Activities (ROPA)",ce=(ee=I!=null?I:H.ropa.description)!=null?ee:"Maintain a comprehensive record of all data processing activities as required by the NDPA accountability principle.",[f,b]=react.useState("list"),[w,ue]=react.useState(""),[P,se]=react.useState("all"),[k,ge]=react.useState("all"),[l,h]=react.useState(null),[V,C]=react.useState([]),[L,G]=react.useState(""),[E,J]=react.useState(""),[M,z]=react.useState(""),[O,W]=react.useState(""),[T,K]=react.useState(""),[j,Q]=react.useState(""),[q,X]=react.useState(""),g=react.useMemo(()=>chunk4CVBQC66_js.b(o),[o]),_=react.useMemo(()=>chunk4CVBQC66_js.d(o),[o]),Y=react.useMemo(()=>{let r=[...o.records];if(P!=="all"&&(r=r.filter(a=>a.status===P)),k!=="all"&&(r=r.filter(a=>a.lawfulBasis===k)),w){let a=w.toLowerCase();r=r.filter(p=>p.name.toLowerCase().includes(a)||p.description.toLowerCase().includes(a)||p.dataCategories.some(m=>m.toLowerCase().includes(a))||p.department&&p.department.toLowerCase().includes(a));}return r},[o.records,P,k,w]);react.useEffect(()=>{l&&(G(l.purposes.join(", ")),J(l.dataCategories.join(", ")),z((l.sensitiveDataCategories||[]).join(", ")),W(l.dataSubjectCategories.join(", ")),K(l.recipients.join(", ")),Q(l.securityMeasures.join(", ")),X((l.systemsUsed||[]).join(", ")));},[l==null?void 0:l.id]);let me=react.useCallback(()=>{let r=Je();r.controllerDetails.name=o.organizationName,r.controllerDetails.contact=o.organizationContact,r.controllerDetails.address=o.organizationAddress,o.ndpcRegistrationNumber&&(r.controllerDetails.registrationNumber=o.ndpcRegistrationNumber),o.dpoDetails&&(r.controllerDetails.dpoContact=o.dpoDetails.email),h(r),C([]),b("form");},[o.organizationName,o.organizationContact,o.organizationAddress,o.ndpcRegistrationNumber,o.dpoDetails]),ve=react.useCallback(r=>{h(chunkRFPLZDIO_js.a({},r)),C([]),b("form");},[]),v=r=>r.split(",").map(a=>a.trim()).filter(a=>a.length>0),fe=react.useCallback(()=>{if(!l)return;let r=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},l),{purposes:v(L),dataCategories:v(E),sensitiveDataCategories:v(M),dataSubjectCategories:v(O),recipients:v(T),securityMeasures:v(j),systemsUsed:v(q),updatedAt:Date.now()});r.sensitiveDataCategories&&r.sensitiveDataCategories.length===0&&(r.sensitiveDataCategories=void 0),r.systemsUsed&&r.systemsUsed.length===0&&(r.systemsUsed=void 0);let a=chunk4CVBQC66_js.a(r);if(!a.valid){C(a.errors);return}o.records.find(m=>m.id===r.id)?y==null||y(r.id,r):D==null||D(r),h(null),C([]),b("list");},[l,L,E,M,O,T,j,q,o.records,y,D]),be=react.useCallback(r=>{S==null||S(r);},[S]),he=react.useCallback(()=>{let r=chunk4CVBQC66_js.c(o),a=new Blob([r],{type:"text/csv;charset=utf-8;"}),p=URL.createObjectURL(a),m=document.createElement("a");m.href=p,m.download=`ropa_${o.organizationName.replace(/\s+/g,"_").toLowerCase()}_${new Date().toISOString().slice(0,10)}.csv`,m.click(),setTimeout(()=>URL.revokeObjectURL(p),100);},[o]),Z=react.useCallback(()=>{h(null),C([]),b("list");},[]),u=react.useCallback((r,a)=>{h(p=>p&&chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},p),{[r]:a}));},[]),U=react.useCallback((r,a)=>{h(p=>p&&chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},p),{controllerDetails:chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},p.controllerDetails),{[r]:a})}));},[]),_e=react.useCallback(r=>!!r.nextReviewDate&&r.nextReviewDate<=Date.now(),[]),xe=react.useCallback(r=>{ue(r.target.value);},[]),Ce=react.useCallback(r=>{se(r.target.value);},[]),Re=react.useCallback(r=>{ge(r.target.value);},[]),De=react.useCallback(r=>{G(r.target.value);},[]),ye=react.useCallback(r=>{J(r.target.value);},[]),Se=react.useCallback(r=>{z(r.target.value);},[]),we=react.useCallback(r=>{W(r.target.value);},[]),Pe=react.useCallback(r=>{K(r.target.value);},[]),ke=react.useCallback(r=>{Q(r.target.value);},[]),Ae=react.useCallback(r=>{X(r.target.value);},[]),Be=react.useCallback(()=>b("list"),[]),Ie=react.useCallback(()=>b("summary"),[]),Fe=react.useCallback(r=>jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a(`px-2 py-1 rounded text-xs font-medium ${He[r]}`,e==null?void 0:e.statusBadge,n),children:Ve[r]}),[e==null?void 0:e.statusBadge,n]),Le=react.useCallback(r=>jsxRuntime.jsx("span",{className:"ndpr-badge ndpr-badge--info",children:Ge[r]}),[]),Ee=()=>jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",e==null?void 0:e.orgInfo,n),children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-muted",children:"Organization"}),jsxRuntime.jsx("p",{className:"ndpr-section-heading",children:o.organizationName})]}),o.dpoDetails&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-muted",children:"Data Protection Officer"}),jsxRuntime.jsx("p",{className:"ndpr-section-heading",children:o.dpoDetails.name}),jsxRuntime.jsx("p",{className:"ndpr-form-field__hint",children:o.dpoDetails.email})]}),o.ndpcRegistrationNumber&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-muted",children:"NDPC Registration No."}),jsxRuntime.jsx("p",{className:"ndpr-section-heading",children:o.ndpcRegistrationNumber})]})]}),jsxRuntime.jsxs("div",{className:"mt-2 text-xs ndpr-text-muted",children:["Version ",o.version," | Last Updated: ",oe(o.lastUpdated)]})]}),Me=()=>jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("mb-6",e==null?void 0:e.summary,n),children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:g.totalRecords}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-info",children:"Total Records"})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("p-4 bg-green-50 dark:bg-green-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-success",children:g.activeRecords}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-success",children:"Active"})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("p-4 bg-purple-50 dark:bg-purple-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:g.crossBorderRecords}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-info",children:"Cross-Border"})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("p-4 bg-orange-50 dark:bg-orange-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-warning",children:_.length}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-warning",children:"Records with Gaps"})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"By Lawful Basis"}),$.map(r=>jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:r.label.split(" (")[0]}),jsxRuntime.jsx("span",{className:"font-medium",children:g.byLawfulBasis[r.value]||0})]},r.value))]}),jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Risk Indicators"}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:"Sensitive Data"}),jsxRuntime.jsx("span",{className:"font-medium",children:g.sensitiveDataRecords})]}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:"DPIA Required"}),jsxRuntime.jsx("span",{className:"font-medium",children:g.dpiaRequiredRecords})]}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:"Automated Decisions"}),jsxRuntime.jsx("span",{className:"font-medium",children:g.automatedDecisionRecords})]}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:"Due for Review"}),jsxRuntime.jsx("span",{className:`font-medium ${g.recordsDueForReview.length>0?"ndpr-text-destructive":""}`,children:g.recordsDueForReview.length})]})]}),g.topDepartments.length>0&&jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Top Departments"}),g.topDepartments.slice(0,5).map(r=>jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:r.department}),jsxRuntime.jsx("span",{className:"font-medium",children:r.count})]},r.department))]})]}),_.length>0&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("p-3 bg-red-50 dark:bg-red-900/20 rounded-md",e==null?void 0:e.complianceGap,n),role:"status","aria-live":"polite",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-2",children:"Compliance Gaps Detected"}),_.slice(0,5).map(r=>jsxRuntime.jsxs("div",{className:"mb-2",children:[jsxRuntime.jsx("p",{className:"text-xs font-medium ndpr-text-destructive",children:r.recordName}),jsxRuntime.jsx("ul",{className:"list-disc list-inside",children:r.gaps.map((a,p)=>jsxRuntime.jsx("li",{className:"text-xs ndpr-text-destructive",children:a},p))})]},r.recordId)),_.length>5&&jsxRuntime.jsxs("p",{className:"text-xs ndpr-text-destructive mt-1",children:["...and ",_.length-5," more record(s) with gaps."]})]})]}),Oe=()=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"mb-4 grid grid-cols-1 md:grid-cols-4 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"ropaSearch",className:"ndpr-form-field__label",children:"Search"}),jsxRuntime.jsx("input",{type:"text",id:"ropaSearch",value:w,onChange:xe,placeholder:"Search records...",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"ropaStatusFilter",className:"ndpr-form-field__label",children:"Status"}),jsxRuntime.jsxs("select",{id:"ropaStatusFilter",value:P,onChange:Ce,className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.select,n),children:[jsxRuntime.jsx("option",{value:"all",children:"All Statuses"}),de.map(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label},r.value))]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"ropaBasisFilter",className:"ndpr-form-field__label",children:"Lawful Basis"}),jsxRuntime.jsxs("select",{id:"ropaBasisFilter",value:k,onChange:Re,className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.select,n),children:[jsxRuntime.jsx("option",{value:"all",children:"All Bases"}),$.map(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label.split(" (")[0]},r.value))]})]}),jsxRuntime.jsxs("div",{className:"flex items-end space-x-2",children:[jsxRuntime.jsx("button",{onClick:me,className:chunkAME4HJR4_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm ${F}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.submitButton),n),children:"Add Record"}),jsxRuntime.jsx("button",{onClick:he,"aria-label":"Export ROPA records as CSV",className:chunkAME4HJR4_js.a(`px-4 py-2 bg-gray-600 text-white rounded hover:bg-gray-700 text-sm ${F}`,(e==null?void 0:e.secondaryButton)||(e==null?void 0:e.exportButton),n),children:"Export CSV"})]})]}),Y.length===0?jsxRuntime.jsx("p",{className:"ndpr-empty-state",children:"No processing records found."}):jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:chunkAME4HJR4_js.a("w-full text-sm text-left",e==null?void 0:e.table,n),children:[jsxRuntime.jsx("thead",{className:chunkAME4HJR4_js.a("ndpr-table__head",e==null?void 0:e.tableHeader,n),children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Name"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Lawful Basis"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Data Categories"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Status"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Last Reviewed"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Actions"})]})}),jsxRuntime.jsx("tbody",{children:Y.map(r=>{let a=_e(r),p=_.some(m=>m.recordId===r.id);return jsxRuntime.jsxs("tr",{className:chunkAME4HJR4_js.a(`border-b dark:border-gray-600 ${a?"bg-red-50 dark:bg-red-900/10":p?"bg-yellow-50 dark:bg-yellow-900/10":"bg-white dark:bg-gray-800"} hover:bg-gray-50 dark:hover:bg-gray-700`,e==null?void 0:e.tableRow,n),children:[jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"font-medium",children:r.name}),r.department&&jsxRuntime.jsx("p",{className:"ndpr-form-field__hint",children:r.department}),a&&jsxRuntime.jsx("span",{className:"text-xs ndpr-text-destructive font-medium",children:"Review Overdue"})]})}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:Le(r.lawfulBasis)}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted max-w-xs truncate",children:r.dataCategories.join(", ")})}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:Fe(r.status)}),jsxRuntime.jsx("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:oe(r.lastReviewedAt)}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:jsxRuntime.jsxs("div",{className:"ndpr-card__footer",children:[jsxRuntime.jsx("button",{onClick:()=>ve(r),"aria-label":`Edit record: ${r.name}`,className:"ndpr-text-primary hover:underline text-xs",children:"Edit"}),r.status!=="archived"&&jsxRuntime.jsx("button",{onClick:()=>be(r.id),"aria-label":`Archive record: ${r.name}`,className:"ndpr-text-muted hover:underline text-xs",children:"Archive"})]})})]},r.id)})})]})})]}),Te=react.useMemo(()=>l?!o.records.find(r=>r.id===l.id):true,[l,o.records]),je=()=>{if(!l)return null;let r=Te;return jsxRuntime.jsxs("div",{"data-ndpr-component":"ropa-manager",className:chunkAME4HJR4_js.a("",e==null?void 0:e.form,n),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex justify-between items-center mb-4",e==null?void 0:e.header,n),children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:r?"Add Processing Record":"Edit Processing Record"}),jsxRuntime.jsx("button",{onClick:Z,className:"ndpr-button ndpr-button--ghost ndpr-button--sm",children:"Cancel"})]}),V.length>0&&jsxRuntime.jsxs("div",{className:"ndpr-alert ndpr-alert--destructive",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-1",children:"Please fix the following errors:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside",children:V.map((a,p)=>jsxRuntime.jsx("li",{className:"text-xs ndpr-text-destructive",children:a},p))})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-section",children:[jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Basic Information"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recordName",className:"ndpr-form-field__label",children:"Activity Name *"}),jsxRuntime.jsx("input",{type:"text",id:"recordName",value:l.name,onChange:a=>u("name",a.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Customer Account Management"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recordDepartment",className:"ndpr-form-field__label",children:"Department"}),jsxRuntime.jsx("input",{type:"text",id:"recordDepartment",value:l.department||"",onChange:a=>u("department",a.target.value||void 0),className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Marketing"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"recordDescription",className:"ndpr-form-field__label",children:"Description *"}),jsxRuntime.jsx("textarea",{id:"recordDescription",value:l.description,onChange:a=>u("description",a.target.value),rows:3,"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Describe what personal data processing is performed..."})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recordStatus",className:"ndpr-form-field__label",children:"Status *"}),jsxRuntime.jsx("select",{id:"recordStatus",value:l.status,onChange:a=>u("status",a.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.select,n),children:de.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Controller Details"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"controllerName",className:"ndpr-form-field__label",children:"Controller Name *"}),jsxRuntime.jsx("input",{type:"text",id:"controllerName",value:l.controllerDetails.name,onChange:a=>U("name",a.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"controllerContact",className:"ndpr-form-field__label",children:"Controller Contact *"}),jsxRuntime.jsx("input",{type:"text",id:"controllerContact",value:l.controllerDetails.contact,onChange:a=>U("contact",a.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n)})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"controllerAddress",className:"ndpr-form-field__label",children:"Controller Address *"}),jsxRuntime.jsx("input",{type:"text",id:"controllerAddress",value:l.controllerDetails.address,onChange:a=>U("address",a.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n)})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Lawful Basis (NDPA Section 25)"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"lawfulBasis",className:"ndpr-form-field__label",children:"Lawful Basis *"}),jsxRuntime.jsx("select",{id:"lawfulBasis",value:l.lawfulBasis,onChange:a=>u("lawfulBasis",a.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.select,n),children:$.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"lawfulBasisJustification",className:"ndpr-form-field__label",children:"Justification *"}),jsxRuntime.jsx("textarea",{id:"lawfulBasisJustification",value:l.lawfulBasisJustification,onChange:a=>u("lawfulBasisJustification",a.target.value),rows:2,"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Explain why this lawful basis applies..."})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Data Details"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"purposes",className:"ndpr-form-field__label",children:"Purposes * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"purposes",value:L,onChange:De,"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Account management, Service delivery"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dataCategories",className:"ndpr-form-field__label",children:"Data Categories * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"dataCategories",value:E,onChange:ye,"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Name, Email, Phone number"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"sensitiveData",className:"ndpr-form-field__label",children:"Sensitive Data Categories (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"sensitiveData",value:M,onChange:Se,className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Health data, Biometric data"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"subjectCategories",className:"ndpr-form-field__label",children:"Data Subject Categories * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"subjectCategories",value:O,onChange:we,"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Customers, Employees"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recipients",className:"ndpr-form-field__label",children:"Recipients * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"recipients",value:T,onChange:Pe,"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Payment processors, Cloud service providers"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dataSource",className:"ndpr-form-field__label",children:"Data Source *"}),jsxRuntime.jsx("select",{id:"dataSource",value:l.dataSource,onChange:a=>u("dataSource",a.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.select,n),children:$e.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),l.dataSource==="third_party"&&jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"thirdPartyDetails",className:"ndpr-form-field__label",children:"Third-Party Source Details *"}),jsxRuntime.jsx("input",{type:"text",id:"thirdPartyDetails",value:l.thirdPartySourceDetails||"",onChange:a=>u("thirdPartySourceDetails",a.target.value||void 0),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Describe the third-party data source..."})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Retention and Security"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"retentionPeriod",className:"ndpr-form-field__label",children:"Retention Period *"}),jsxRuntime.jsx("input",{type:"text",id:"retentionPeriod",value:l.retentionPeriod,onChange:a=>u("retentionPeriod",a.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., 5 years after account closure"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"retentionJustification",className:"ndpr-form-field__label",children:"Retention Justification"}),jsxRuntime.jsx("input",{type:"text",id:"retentionJustification",value:l.retentionJustification||"",onChange:a=>u("retentionJustification",a.target.value||void 0),className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Why this retention period is necessary..."})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"securityMeasures",className:"ndpr-form-field__label",children:"Security Measures * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"securityMeasures",value:j,onChange:ke,"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Encryption at rest, Access controls, Audit logging"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"systemsUsed",className:"ndpr-form-field__label",children:"Systems Used (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"systemsUsed",value:q,onChange:Ae,className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., CRM, ERP, Cloud Storage"})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Risk Indicators"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"dpiaRequired",checked:l.dpiaRequired,onChange:a=>u("dpiaRequired",a.target.checked),className:"ndpr-form-field__checkbox"}),jsxRuntime.jsx("label",{htmlFor:"dpiaRequired",className:"ndpr-text-sm ndpr-font-medium",children:"DPIA Required"})]}),l.dpiaRequired&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dpiaReference",className:"ndpr-form-field__label",children:"DPIA Reference *"}),jsxRuntime.jsx("input",{type:"text",id:"dpiaReference",value:l.dpiaReference||"",onChange:a=>u("dpiaReference",a.target.value||void 0),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Reference to the completed DPIA"})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"automatedDecisionMaking",checked:l.automatedDecisionMaking,onChange:a=>u("automatedDecisionMaking",a.target.checked),className:"ndpr-form-field__checkbox"}),jsxRuntime.jsx("label",{htmlFor:"automatedDecisionMaking",className:"ndpr-text-sm ndpr-font-medium",children:"Automated Decision-Making"})]}),l.automatedDecisionMaking&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"automatedDecisionMakingDetails",className:"ndpr-form-field__label",children:"Automated Decision-Making Details *"}),jsxRuntime.jsx("textarea",{id:"automatedDecisionMakingDetails",value:l.automatedDecisionMakingDetails||"",onChange:a=>u("automatedDecisionMakingDetails",a.target.value||void 0),rows:2,"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Describe the automated decision-making process..."})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Review Schedule"}),jsxRuntime.jsx("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"nextReviewDate",className:"ndpr-form-field__label",children:"Next Review Date"}),jsxRuntime.jsx("input",{type:"date",id:"nextReviewDate",value:l.nextReviewDate?new Date(l.nextReviewDate).toISOString().slice(0,10):"",onChange:a=>u("nextReviewDate",a.target.value?new Date(a.target.value).getTime():void 0),className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n)})]})})]}),jsxRuntime.jsxs("div",{className:"flex justify-end space-x-3",children:[jsxRuntime.jsx("button",{onClick:Z,className:"ndpr-button ndpr-button--secondary ndpr-button--sm",children:"Cancel"}),jsxRuntime.jsx("button",{onClick:fe,className:chunkAME4HJR4_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm ${F}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.submitButton),n),children:r?"Add Record":"Save Changes"})]})]})]})},qe=()=>jsxRuntime.jsxs("div",{className:"ndpr-section-divider ndpr-text-sm",children:[jsxRuntime.jsx("button",{onClick:Be,className:`pb-2 text-sm font-medium ${f==="list"?"border-b-2 border-[rgb(var(--ndpr-primary))] ndpr-text-primary":"ndpr-text-muted hover:text-gray-700 dark:hover:text-gray-300"}`,children:"Processing Records"}),jsxRuntime.jsx("button",{onClick:Ie,className:`pb-2 text-sm font-medium ${f==="summary"?"border-b-2 border-[rgb(var(--ndpr-primary))] ndpr-text-primary":"ndpr-text-muted hover:text-gray-700 dark:hover:text-gray-300"}`,children:"Compliance Summary"})]});return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${le}`,e==null?void 0:e.root,n),children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",e==null?void 0:e.title,n),children:pe}),jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:ce}),Ee(),f!=="form"&&qe(),f==="list"&&Oe(),f==="summary"&&Me(),f==="form"&&je()]})};exports.a=Ye;
|
|
1
|
+
'use strict';var chunk4CVBQC66_js=require('./chunk-4CVBQC66.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),chunkI5ZDNSX5_js=require('./chunk-I5ZDNSX5.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var $=[{value:"consent",label:"Consent (Section 25(1)(a))"},{value:"contract",label:"Contract (Section 25(1)(b))"},{value:"legal_obligation",label:"Legal Obligation (Section 25(1)(c))"},{value:"vital_interests",label:"Vital Interests (Section 25(1)(d))"},{value:"public_interest",label:"Public Interest (Section 25(1)(e))"},{value:"legitimate_interests",label:"Legitimate Interests (Section 25(1)(f))"}],de=[{value:"active",label:"Active"},{value:"inactive",label:"Inactive"},{value:"archived",label:"Archived"}],$e=[{value:"data_subject",label:"Directly from Data Subject"},{value:"third_party",label:"Third Party"},{value:"public_source",label:"Public Source"},{value:"other",label:"Other"}],He={active:"ndpr-badge ndpr-badge--success",inactive:"ndpr-badge ndpr-badge--warning",archived:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300"},Ve={active:"Active",inactive:"Inactive",archived:"Archived"},Ge={consent:"Consent",contract:"Contract",legal_obligation:"Legal Obligation",vital_interests:"Vital Interests",public_interest:"Public Interest",legitimate_interests:"Legitimate Interests"};function Je(){let o=Date.now();return {id:`proc_${o}_${Math.random().toString(36).substring(2,11)}`,name:"",description:"",controllerDetails:{name:"",contact:"",address:""},lawfulBasis:"consent",lawfulBasisJustification:"",purposes:[],dataCategories:[],dataSubjectCategories:[],recipients:[],retentionPeriod:"",securityMeasures:[],dataSource:"data_subject",dpiaRequired:false,automatedDecisionMaking:false,status:"active",createdAt:o,updatedAt:o}}function oe(o){return o?new Date(o).toLocaleDateString():"N/A"}var Ye=({ropa:o,onAdd:D,onUpdate:y,onArchive:S,title:B,description:I,className:le="",buttonClassName:F="",classNames:e,unstyled:n})=>{var N,ee;let H=chunkI5ZDNSX5_js.c(),pe=(N=B!=null?B:H.ropa.title)!=null?N:"Record of Processing Activities (ROPA)",ce=(ee=I!=null?I:H.ropa.description)!=null?ee:"Maintain a comprehensive record of all data processing activities as required by the NDPA accountability principle.",[f,b]=react.useState("list"),[w,ue]=react.useState(""),[P,se]=react.useState("all"),[k,ge]=react.useState("all"),[l,h]=react.useState(null),[V,C]=react.useState([]),[L,G]=react.useState(""),[E,J]=react.useState(""),[M,z]=react.useState(""),[O,W]=react.useState(""),[T,K]=react.useState(""),[j,Q]=react.useState(""),[q,X]=react.useState(""),g=react.useMemo(()=>chunk4CVBQC66_js.b(o),[o]),_=react.useMemo(()=>chunk4CVBQC66_js.d(o),[o]),Y=react.useMemo(()=>{let r=[...o.records];if(P!=="all"&&(r=r.filter(a=>a.status===P)),k!=="all"&&(r=r.filter(a=>a.lawfulBasis===k)),w){let a=w.toLowerCase();r=r.filter(p=>p.name.toLowerCase().includes(a)||p.description.toLowerCase().includes(a)||p.dataCategories.some(m=>m.toLowerCase().includes(a))||p.department&&p.department.toLowerCase().includes(a));}return r},[o.records,P,k,w]);react.useEffect(()=>{l&&(G(l.purposes.join(", ")),J(l.dataCategories.join(", ")),z((l.sensitiveDataCategories||[]).join(", ")),W(l.dataSubjectCategories.join(", ")),K(l.recipients.join(", ")),Q(l.securityMeasures.join(", ")),X((l.systemsUsed||[]).join(", ")));},[l==null?void 0:l.id]);let me=react.useCallback(()=>{let r=Je();r.controllerDetails.name=o.organizationName,r.controllerDetails.contact=o.organizationContact,r.controllerDetails.address=o.organizationAddress,o.ndpcRegistrationNumber&&(r.controllerDetails.registrationNumber=o.ndpcRegistrationNumber),o.dpoDetails&&(r.controllerDetails.dpoContact=o.dpoDetails.email),h(r),C([]),b("form");},[o.organizationName,o.organizationContact,o.organizationAddress,o.ndpcRegistrationNumber,o.dpoDetails]),ve=react.useCallback(r=>{h(chunkRFPLZDIO_js.a({},r)),C([]),b("form");},[]),v=r=>r.split(",").map(a=>a.trim()).filter(a=>a.length>0),fe=react.useCallback(()=>{if(!l)return;let r=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},l),{purposes:v(L),dataCategories:v(E),sensitiveDataCategories:v(M),dataSubjectCategories:v(O),recipients:v(T),securityMeasures:v(j),systemsUsed:v(q),updatedAt:Date.now()});r.sensitiveDataCategories&&r.sensitiveDataCategories.length===0&&(r.sensitiveDataCategories=void 0),r.systemsUsed&&r.systemsUsed.length===0&&(r.systemsUsed=void 0);let a=chunk4CVBQC66_js.a(r);if(!a.valid){C(a.errors);return}o.records.find(m=>m.id===r.id)?y==null||y(r.id,r):D==null||D(r),h(null),C([]),b("list");},[l,L,E,M,O,T,j,q,o.records,y,D]),be=react.useCallback(r=>{S==null||S(r);},[S]),he=react.useCallback(()=>{let r=chunk4CVBQC66_js.c(o),a=new Blob([r],{type:"text/csv;charset=utf-8;"}),p=URL.createObjectURL(a),m=document.createElement("a");m.href=p,m.download=`ropa_${o.organizationName.replace(/\s+/g,"_").toLowerCase()}_${new Date().toISOString().slice(0,10)}.csv`,m.click(),setTimeout(()=>URL.revokeObjectURL(p),100);},[o]),Z=react.useCallback(()=>{h(null),C([]),b("list");},[]),u=react.useCallback((r,a)=>{h(p=>p&&chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},p),{[r]:a}));},[]),U=react.useCallback((r,a)=>{h(p=>p&&chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},p),{controllerDetails:chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},p.controllerDetails),{[r]:a})}));},[]),_e=react.useCallback(r=>!!r.nextReviewDate&&r.nextReviewDate<=Date.now(),[]),xe=react.useCallback(r=>{ue(r.target.value);},[]),Ce=react.useCallback(r=>{se(r.target.value);},[]),Re=react.useCallback(r=>{ge(r.target.value);},[]),De=react.useCallback(r=>{G(r.target.value);},[]),ye=react.useCallback(r=>{J(r.target.value);},[]),Se=react.useCallback(r=>{z(r.target.value);},[]),we=react.useCallback(r=>{W(r.target.value);},[]),Pe=react.useCallback(r=>{K(r.target.value);},[]),ke=react.useCallback(r=>{Q(r.target.value);},[]),Ae=react.useCallback(r=>{X(r.target.value);},[]),Be=react.useCallback(()=>b("list"),[]),Ie=react.useCallback(()=>b("summary"),[]),Fe=react.useCallback(r=>jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a(`px-2 py-1 rounded text-xs font-medium ${He[r]}`,e==null?void 0:e.statusBadge,n),children:Ve[r]}),[e==null?void 0:e.statusBadge,n]),Le=react.useCallback(r=>jsxRuntime.jsx("span",{className:"ndpr-badge ndpr-badge--info",children:Ge[r]}),[]),Ee=()=>jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",e==null?void 0:e.orgInfo,n),children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-muted",children:"Organization"}),jsxRuntime.jsx("p",{className:"ndpr-section-heading",children:o.organizationName})]}),o.dpoDetails&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-muted",children:"Data Protection Officer"}),jsxRuntime.jsx("p",{className:"ndpr-section-heading",children:o.dpoDetails.name}),jsxRuntime.jsx("p",{className:"ndpr-form-field__hint",children:o.dpoDetails.email})]}),o.ndpcRegistrationNumber&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-muted",children:"NDPC Registration No."}),jsxRuntime.jsx("p",{className:"ndpr-section-heading",children:o.ndpcRegistrationNumber})]})]}),jsxRuntime.jsxs("div",{className:"mt-2 text-xs ndpr-text-muted",children:["Version ",o.version," | Last Updated: ",oe(o.lastUpdated)]})]}),Me=()=>jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("mb-6",e==null?void 0:e.summary,n),children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:g.totalRecords}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-info",children:"Total Records"})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("p-4 bg-green-50 dark:bg-green-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-success",children:g.activeRecords}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-success",children:"Active"})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("p-4 bg-purple-50 dark:bg-purple-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:g.crossBorderRecords}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-info",children:"Cross-Border"})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("p-4 bg-orange-50 dark:bg-orange-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-warning",children:_.length}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-warning",children:"Records with Gaps"})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"By Lawful Basis"}),$.map(r=>jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:r.label.split(" (")[0]}),jsxRuntime.jsx("span",{className:"font-medium",children:g.byLawfulBasis[r.value]||0})]},r.value))]}),jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Risk Indicators"}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:"Sensitive Data"}),jsxRuntime.jsx("span",{className:"font-medium",children:g.sensitiveDataRecords})]}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:"DPIA Required"}),jsxRuntime.jsx("span",{className:"font-medium",children:g.dpiaRequiredRecords})]}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:"Automated Decisions"}),jsxRuntime.jsx("span",{className:"font-medium",children:g.automatedDecisionRecords})]}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:"Due for Review"}),jsxRuntime.jsx("span",{className:`font-medium ${g.recordsDueForReview.length>0?"ndpr-text-destructive":""}`,children:g.recordsDueForReview.length})]})]}),g.topDepartments.length>0&&jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Top Departments"}),g.topDepartments.slice(0,5).map(r=>jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:r.department}),jsxRuntime.jsx("span",{className:"font-medium",children:r.count})]},r.department))]})]}),_.length>0&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("p-3 bg-red-50 dark:bg-red-900/20 rounded-md",e==null?void 0:e.complianceGap,n),role:"status","aria-live":"polite",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-2",children:"Compliance Gaps Detected"}),_.slice(0,5).map(r=>jsxRuntime.jsxs("div",{className:"mb-2",children:[jsxRuntime.jsx("p",{className:"text-xs font-medium ndpr-text-destructive",children:r.recordName}),jsxRuntime.jsx("ul",{className:"list-disc list-inside",children:r.gaps.map((a,p)=>jsxRuntime.jsx("li",{className:"text-xs ndpr-text-destructive",children:a},p))})]},r.recordId)),_.length>5&&jsxRuntime.jsxs("p",{className:"text-xs ndpr-text-destructive mt-1",children:["...and ",_.length-5," more record(s) with gaps."]})]})]}),Oe=()=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"mb-4 grid grid-cols-1 md:grid-cols-4 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"ropaSearch",className:"ndpr-form-field__label",children:"Search"}),jsxRuntime.jsx("input",{type:"text",id:"ropaSearch",value:w,onChange:xe,placeholder:"Search records...",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"ropaStatusFilter",className:"ndpr-form-field__label",children:"Status"}),jsxRuntime.jsxs("select",{id:"ropaStatusFilter",value:P,onChange:Ce,className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.select,n),children:[jsxRuntime.jsx("option",{value:"all",children:"All Statuses"}),de.map(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label},r.value))]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"ropaBasisFilter",className:"ndpr-form-field__label",children:"Lawful Basis"}),jsxRuntime.jsxs("select",{id:"ropaBasisFilter",value:k,onChange:Re,className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.select,n),children:[jsxRuntime.jsx("option",{value:"all",children:"All Bases"}),$.map(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label.split(" (")[0]},r.value))]})]}),jsxRuntime.jsxs("div",{className:"flex items-end space-x-2",children:[jsxRuntime.jsx("button",{onClick:me,className:chunkAME4HJR4_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm ${F}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.submitButton),n),children:"Add Record"}),jsxRuntime.jsx("button",{onClick:he,"aria-label":"Export ROPA records as CSV",className:chunkAME4HJR4_js.a(`px-4 py-2 bg-gray-600 text-white rounded hover:bg-gray-700 text-sm ${F}`,(e==null?void 0:e.secondaryButton)||(e==null?void 0:e.exportButton),n),children:"Export CSV"})]})]}),Y.length===0?jsxRuntime.jsx("p",{className:"ndpr-empty-state",children:"No processing records found."}):jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:chunkAME4HJR4_js.a("w-full text-sm text-left",e==null?void 0:e.table,n),children:[jsxRuntime.jsx("thead",{className:chunkAME4HJR4_js.a("ndpr-table__head",e==null?void 0:e.tableHeader,n),children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Name"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Lawful Basis"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Data Categories"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Status"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Last Reviewed"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Actions"})]})}),jsxRuntime.jsx("tbody",{children:Y.map(r=>{let a=_e(r),p=_.some(m=>m.recordId===r.id);return jsxRuntime.jsxs("tr",{className:chunkAME4HJR4_js.a(`border-b dark:border-gray-600 ${a?"bg-red-50 dark:bg-red-900/10":p?"bg-yellow-50 dark:bg-yellow-900/10":"bg-white dark:bg-gray-800"} hover:bg-gray-50 dark:hover:bg-gray-700`,e==null?void 0:e.tableRow,n),children:[jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"font-medium",children:r.name}),r.department&&jsxRuntime.jsx("p",{className:"ndpr-form-field__hint",children:r.department}),a&&jsxRuntime.jsx("span",{className:"text-xs ndpr-text-destructive font-medium",children:"Review Overdue"})]})}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:Le(r.lawfulBasis)}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted max-w-xs truncate",children:r.dataCategories.join(", ")})}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:Fe(r.status)}),jsxRuntime.jsx("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:oe(r.lastReviewedAt)}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:jsxRuntime.jsxs("div",{className:"ndpr-card__footer",children:[jsxRuntime.jsx("button",{onClick:()=>ve(r),"aria-label":`Edit record: ${r.name}`,className:"ndpr-text-primary hover:underline text-xs",children:"Edit"}),r.status!=="archived"&&jsxRuntime.jsx("button",{onClick:()=>be(r.id),"aria-label":`Archive record: ${r.name}`,className:"ndpr-text-muted hover:underline text-xs",children:"Archive"})]})})]},r.id)})})]})})]}),Te=react.useMemo(()=>l?!o.records.find(r=>r.id===l.id):true,[l,o.records]),je=()=>{if(!l)return null;let r=Te;return jsxRuntime.jsxs("div",{"data-ndpr-component":"ropa-manager",className:chunkAME4HJR4_js.a("",e==null?void 0:e.form,n),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex justify-between items-center mb-4",e==null?void 0:e.header,n),children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:r?"Add Processing Record":"Edit Processing Record"}),jsxRuntime.jsx("button",{onClick:Z,className:"ndpr-button ndpr-button--ghost ndpr-button--sm",children:"Cancel"})]}),V.length>0&&jsxRuntime.jsxs("div",{className:"ndpr-alert ndpr-alert--destructive",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-1",children:"Please fix the following errors:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside",children:V.map((a,p)=>jsxRuntime.jsx("li",{className:"text-xs ndpr-text-destructive",children:a},p))})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-section",children:[jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Basic Information"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recordName",className:"ndpr-form-field__label",children:"Activity Name *"}),jsxRuntime.jsx("input",{type:"text",id:"recordName",value:l.name,onChange:a=>u("name",a.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Customer Account Management"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recordDepartment",className:"ndpr-form-field__label",children:"Department"}),jsxRuntime.jsx("input",{type:"text",id:"recordDepartment",value:l.department||"",onChange:a=>u("department",a.target.value||void 0),className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Marketing"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"recordDescription",className:"ndpr-form-field__label",children:"Description *"}),jsxRuntime.jsx("textarea",{id:"recordDescription",value:l.description,onChange:a=>u("description",a.target.value),rows:3,"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Describe what personal data processing is performed..."})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recordStatus",className:"ndpr-form-field__label",children:"Status *"}),jsxRuntime.jsx("select",{id:"recordStatus",value:l.status,onChange:a=>u("status",a.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.select,n),children:de.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Controller Details"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"controllerName",className:"ndpr-form-field__label",children:"Controller Name *"}),jsxRuntime.jsx("input",{type:"text",id:"controllerName",value:l.controllerDetails.name,onChange:a=>U("name",a.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"controllerContact",className:"ndpr-form-field__label",children:"Controller Contact *"}),jsxRuntime.jsx("input",{type:"text",id:"controllerContact",value:l.controllerDetails.contact,onChange:a=>U("contact",a.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n)})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"controllerAddress",className:"ndpr-form-field__label",children:"Controller Address *"}),jsxRuntime.jsx("input",{type:"text",id:"controllerAddress",value:l.controllerDetails.address,onChange:a=>U("address",a.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n)})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Lawful Basis (NDPA Section 25)"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"lawfulBasis",className:"ndpr-form-field__label",children:"Lawful Basis *"}),jsxRuntime.jsx("select",{id:"lawfulBasis",value:l.lawfulBasis,onChange:a=>u("lawfulBasis",a.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.select,n),children:$.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"lawfulBasisJustification",className:"ndpr-form-field__label",children:"Justification *"}),jsxRuntime.jsx("textarea",{id:"lawfulBasisJustification",value:l.lawfulBasisJustification,onChange:a=>u("lawfulBasisJustification",a.target.value),rows:2,"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Explain why this lawful basis applies..."})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Data Details"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"purposes",className:"ndpr-form-field__label",children:"Purposes * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"purposes",value:L,onChange:De,"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Account management, Service delivery"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dataCategories",className:"ndpr-form-field__label",children:"Data Categories * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"dataCategories",value:E,onChange:ye,"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Name, Email, Phone number"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"sensitiveData",className:"ndpr-form-field__label",children:"Sensitive Data Categories (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"sensitiveData",value:M,onChange:Se,className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Health data, Biometric data"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"subjectCategories",className:"ndpr-form-field__label",children:"Data Subject Categories * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"subjectCategories",value:O,onChange:we,"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Customers, Employees"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recipients",className:"ndpr-form-field__label",children:"Recipients * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"recipients",value:T,onChange:Pe,"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Payment processors, Cloud service providers"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dataSource",className:"ndpr-form-field__label",children:"Data Source *"}),jsxRuntime.jsx("select",{id:"dataSource",value:l.dataSource,onChange:a=>u("dataSource",a.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.select,n),children:$e.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),l.dataSource==="third_party"&&jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"thirdPartyDetails",className:"ndpr-form-field__label",children:"Third-Party Source Details *"}),jsxRuntime.jsx("input",{type:"text",id:"thirdPartyDetails",value:l.thirdPartySourceDetails||"",onChange:a=>u("thirdPartySourceDetails",a.target.value||void 0),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Describe the third-party data source..."})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Retention and Security"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"retentionPeriod",className:"ndpr-form-field__label",children:"Retention Period *"}),jsxRuntime.jsx("input",{type:"text",id:"retentionPeriod",value:l.retentionPeriod,onChange:a=>u("retentionPeriod",a.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., 5 years after account closure"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"retentionJustification",className:"ndpr-form-field__label",children:"Retention Justification"}),jsxRuntime.jsx("input",{type:"text",id:"retentionJustification",value:l.retentionJustification||"",onChange:a=>u("retentionJustification",a.target.value||void 0),className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Why this retention period is necessary..."})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"securityMeasures",className:"ndpr-form-field__label",children:"Security Measures * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"securityMeasures",value:j,onChange:ke,"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Encryption at rest, Access controls, Audit logging"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"systemsUsed",className:"ndpr-form-field__label",children:"Systems Used (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"systemsUsed",value:q,onChange:Ae,className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., CRM, ERP, Cloud Storage"})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Risk Indicators"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"dpiaRequired",checked:l.dpiaRequired,onChange:a=>u("dpiaRequired",a.target.checked),className:"ndpr-form-field__checkbox"}),jsxRuntime.jsx("label",{htmlFor:"dpiaRequired",className:"ndpr-text-sm ndpr-font-medium",children:"DPIA Required"})]}),l.dpiaRequired&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dpiaReference",className:"ndpr-form-field__label",children:"DPIA Reference *"}),jsxRuntime.jsx("input",{type:"text",id:"dpiaReference",value:l.dpiaReference||"",onChange:a=>u("dpiaReference",a.target.value||void 0),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Reference to the completed DPIA"})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"automatedDecisionMaking",checked:l.automatedDecisionMaking,onChange:a=>u("automatedDecisionMaking",a.target.checked),className:"ndpr-form-field__checkbox"}),jsxRuntime.jsx("label",{htmlFor:"automatedDecisionMaking",className:"ndpr-text-sm ndpr-font-medium",children:"Automated Decision-Making"})]}),l.automatedDecisionMaking&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"automatedDecisionMakingDetails",className:"ndpr-form-field__label",children:"Automated Decision-Making Details *"}),jsxRuntime.jsx("textarea",{id:"automatedDecisionMakingDetails",value:l.automatedDecisionMakingDetails||"",onChange:a=>u("automatedDecisionMakingDetails",a.target.value||void 0),rows:2,"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Describe the automated decision-making process..."})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Review Schedule"}),jsxRuntime.jsx("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"nextReviewDate",className:"ndpr-form-field__label",children:"Next Review Date"}),jsxRuntime.jsx("input",{type:"date",id:"nextReviewDate",value:l.nextReviewDate?new Date(l.nextReviewDate).toISOString().slice(0,10):"",onChange:a=>u("nextReviewDate",a.target.value?new Date(a.target.value).getTime():void 0),className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n)})]})})]}),jsxRuntime.jsxs("div",{className:"flex justify-end space-x-3",children:[jsxRuntime.jsx("button",{onClick:Z,className:"ndpr-button ndpr-button--secondary ndpr-button--sm",children:"Cancel"}),jsxRuntime.jsx("button",{onClick:fe,className:chunkAME4HJR4_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm ${F}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.submitButton),n),children:r?"Add Record":"Save Changes"})]})]})]})},qe=()=>jsxRuntime.jsxs("div",{className:"ndpr-section-divider ndpr-text-sm",children:[jsxRuntime.jsx("button",{onClick:Be,className:`pb-2 text-sm font-medium ${f==="list"?"border-b-2 border-[rgb(var(--ndpr-primary))] ndpr-text-primary":"ndpr-text-muted hover:text-gray-700 dark:hover:text-gray-300"}`,children:"Processing Records"}),jsxRuntime.jsx("button",{onClick:Ie,className:`pb-2 text-sm font-medium ${f==="summary"?"border-b-2 border-[rgb(var(--ndpr-primary))] ndpr-text-primary":"ndpr-text-muted hover:text-gray-700 dark:hover:text-gray-300"}`,children:"Compliance Summary"})]});return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${le}`,e==null?void 0:e.root,n),children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",e==null?void 0:e.title,n),children:pe}),jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:ce}),Ee(),f!=="form"&&qe(),f==="list"&&Oe(),f==="summary"&&Me(),f==="form"&&je()]})};exports.a=Ye;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {c as c$1,d,b as b$1}from'./chunk-NBQQ2GN3.mjs';import {a}from'./chunk-SFGW37LE.mjs';import {c}from'./chunk-
|
|
1
|
+
import {c as c$1,d,b as b$1}from'./chunk-NBQQ2GN3.mjs';import {a}from'./chunk-SFGW37LE.mjs';import {c}from'./chunk-PHA3YMFO.mjs';import {d as d$1,b,a as a$1}from'./chunk-ZJYULEER.mjs';import {useId,useState,useEffect}from'react';import {jsxs,jsx}from'react/jsx-runtime';var Ee=({sections:E=c$1,variables:R=d,onGenerate:S,title:F,description:A,className:N="",buttonClassName:P="",generateButtonText:Y,showPreview:q=true,allowEditing:Q=true,classNames:t,unstyled:y=false})=>{var W,de,ae;let B=c(),Z=(W=F!=null?F:B.policy.generatorTitle)!=null?W:"NDPA Privacy Policy Generator",l=(de=A!=null?A:B.policy.generatorDescription)!=null?de:"Generate an NDPA-compliant privacy policy for your organization in accordance with NDPA Section 27.",i=(ae=Y!=null?Y:B.policy.generate)!=null?ae:"Generate Policy",m=useId(),[L,ee]=useState(E),[b$2,k]=useState(R),[g,$]=useState("sections"),[X,H]=useState(""),[U,M]=useState(""),[ne,T]=useState(false),[h,G]=useState({});useEffect(()=>{ee(E);},[E]),useEffect(()=>{k(R);},[R]);let oe=p=>{ee(c=>c.map(e=>e.id===p?b(a$1({},e),{included:!e.included}):e));},I=(p,c)=>{k(e=>e.map(d=>d.id===p?b(a$1({},d),{value:c}):d)),h[p]&&G(e=>{let d=a$1({},e);return delete d[p],d});},ie=()=>{let p={},c=true;return b$2.forEach(e=>{e.required&&!e.value&&(p[e.id]=`${e.name} is required`,c=false);}),G(p),c},re=()=>{if(!ie()){$("variables");return}let p=L.filter(d=>d.included),c=Object.fromEntries(b$2.map(d=>[d.name,d.value])),e="";p.forEach(d=>{e+=`## ${d.title}
|
|
2
2
|
|
|
3
3
|
`,e+=b$1(d.template,c),e+=`
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-ZJYULEER.mjs';var r={consent:{title:"We Value Your Privacy",description:"We use cookies and similar technologies to provide our services and enhance your experience. Your consent is collected in accordance with NDPA Sections 25-26.",acceptAll:"Accept All",rejectAll:"Reject All",customize:"Customize",savePreferences:"Save Preferences",selectAll:"Select All",deselectAll:"Deselect All",required:"Required",cookieNotice:'By clicking "Accept All", you agree to the use of ALL cookies. Visit our Cookie Policy to learn more.',managerTitle:"Manage Your Privacy Settings",managerDescription:"Update your consent preferences at any time. Required cookies cannot be disabled as they are necessary for the website to function. Consent management is provided in accordance with NDPA Sections 25-26.",resetToDefaults:"Reset to Defaults"},dsr:{title:"Submit a Data Subject Request",description:"Use this form to exercise your rights under the Nigeria Data Protection Act (NDPA), Part VI, Sections 34-38.",submitRequest:"Submit Request",reset:"Reset",fullName:"Full Name",email:"Email Address",phone:"Phone Number (Optional)",requestType:"Request Type",additionalInfo:"Additional Information",identityVerification:"Identity Verification",identifierType:"Identifier Type",identifierValue:"Identifier Value",privacyNotice:"The information you provide in this form will be used solely for the purpose of processing your data subject request.",successMessage:"Your request has been submitted successfully.",dashboardTitle:"Data Subject Request Dashboard",dashboardDescription:"Track and manage data subject requests in compliance with NDPA Part IV requirements.",trackerTitle:"DSR Request Tracker",trackerDescription:"Track the status and progress of data subject requests as required by NDPA Part IV."},breach:{title:"Report a Data Breach",description:"Use this form to report a suspected or confirmed data breach in accordance with NDPA Section 40.",submitReport:"Submit Report",breachTitle:"Breach Title/Summary",category:"Category",discoveredAt:"Date Discovered",detailedDescription:"Detailed Description",riskAssessmentTitle:"Breach Risk Assessment",riskAssessmentDescription:"Assess the risk level of this data breach to determine notification requirements under NDPA Section 40.",notificationManagerTitle:"Breach Notification Manager",notificationManagerDescription:"Manage data breach notifications and track compliance with NDPA Section 40 requirements.",regulatoryReportTitle:"Generate NDPC Notification Report",regulatoryReportDescription:"Generate a report for submission to the NDPC in compliance with NDPA Section 40 breach notification requirements."},dpia:{title:"Data Protection Impact Assessment",next:"Next",previous:"Previous",complete:"Complete Assessment",progress:"Progress",submit:"Submit",reportTitle:"Data Protection Impact Assessment Report"},policy:{title:"Privacy Policy Generator",generate:"Generate Policy",preview:"Preview",export:"Export",sections:"Sections",variables:"Variables",generatorTitle:"NDPA Privacy Policy Generator",generatorDescription:"Generate an NDPA-compliant privacy policy for your organization in accordance with NDPA Section
|
|
1
|
+
import {a}from'./chunk-ZJYULEER.mjs';var r={consent:{title:"We Value Your Privacy",description:"We use cookies and similar technologies to provide our services and enhance your experience. Your consent is collected in accordance with NDPA Sections 25-26.",acceptAll:"Accept All",rejectAll:"Reject All",customize:"Customize",savePreferences:"Save Preferences",selectAll:"Select All",deselectAll:"Deselect All",required:"Required",cookieNotice:'By clicking "Accept All", you agree to the use of ALL cookies. Visit our Cookie Policy to learn more.',managerTitle:"Manage Your Privacy Settings",managerDescription:"Update your consent preferences at any time. Required cookies cannot be disabled as they are necessary for the website to function. Consent management is provided in accordance with NDPA Sections 25-26.",resetToDefaults:"Reset to Defaults"},dsr:{title:"Submit a Data Subject Request",description:"Use this form to exercise your rights under the Nigeria Data Protection Act (NDPA), Part VI, Sections 34-38.",submitRequest:"Submit Request",reset:"Reset",fullName:"Full Name",email:"Email Address",phone:"Phone Number (Optional)",requestType:"Request Type",additionalInfo:"Additional Information",identityVerification:"Identity Verification",identifierType:"Identifier Type",identifierValue:"Identifier Value",privacyNotice:"The information you provide in this form will be used solely for the purpose of processing your data subject request.",successMessage:"Your request has been submitted successfully.",dashboardTitle:"Data Subject Request Dashboard",dashboardDescription:"Track and manage data subject requests in compliance with NDPA Part IV requirements.",trackerTitle:"DSR Request Tracker",trackerDescription:"Track the status and progress of data subject requests as required by NDPA Part IV."},breach:{title:"Report a Data Breach",description:"Use this form to report a suspected or confirmed data breach in accordance with NDPA Section 40.",submitReport:"Submit Report",breachTitle:"Breach Title/Summary",category:"Category",discoveredAt:"Date Discovered",detailedDescription:"Detailed Description",riskAssessmentTitle:"Breach Risk Assessment",riskAssessmentDescription:"Assess the risk level of this data breach to determine notification requirements under NDPA Section 40.",notificationManagerTitle:"Breach Notification Manager",notificationManagerDescription:"Manage data breach notifications and track compliance with NDPA Section 40 requirements.",regulatoryReportTitle:"Generate NDPC Notification Report",regulatoryReportDescription:"Generate a report for submission to the NDPC in compliance with NDPA Section 40 breach notification requirements."},dpia:{title:"Data Protection Impact Assessment",next:"Next",previous:"Previous",complete:"Complete Assessment",progress:"Progress",submit:"Submit",reportTitle:"Data Protection Impact Assessment Report"},policy:{title:"Privacy Policy Generator",generate:"Generate Policy",preview:"Preview",export:"Export",sections:"Sections",variables:"Variables",generatorTitle:"NDPA Privacy Policy Generator",generatorDescription:"Generate an NDPA-compliant privacy policy for your organization in accordance with NDPA Section 27.",previewTitle:"Privacy Policy Preview",previewDescription:"Preview your NDPA-compliant privacy policy before exporting.",exporterTitle:"Privacy Policy",exporterDescription:"Export your NDPA-compliant privacy policy in various formats.",wizardTitle:"Privacy Policy Builder"},lawfulBasis:{title:"Lawful Basis Tracker",description:"Document and track the lawful basis for each processing activity as required by NDPA 2023 Section 25."},crossBorder:{title:"Cross-Border Data Transfer Manager",description:"Manage and document cross-border personal data transfers in compliance with NDPA 2023 Part VIII (Sections 41-43)."},ropa:{title:"Record of Processing Activities (ROPA)",description:"Maintain a comprehensive record of all data processing activities as required by the NDPA accountability principle."},compliance:{score:"Compliance Score",excellent:"Excellent",good:"Good",needsWork:"Needs Work",critical:"Critical",recommendations:"Recommendations",passed:"Passed",gaps:"Gaps"},common:{loading:"Loading...",error:"An error occurred",save:"Save",cancel:"Cancel",delete:"Delete",edit:"Edit",add:"Add",back:"Back",next:"Next",search:"Search",noResults:"No results found"}};function c(e){if(!e)return r;let o=a({},r);for(let t of Object.keys(e))e[t]&&(o[t]=a(a({},r[t]),e[t]));return o}export{r as a,c as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var chunkQHW4UKGJ_js=require('./chunk-QHW4UKGJ.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),chunkYDKWD6MQ_js=require('./chunk-YDKWD6MQ.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),Nr=require('react'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Nr__default=/*#__PURE__*/_interopDefault(Nr);var cr=["Organization","Data Collection","Processing","Review & Export"],yr=({currentStep:n,classNames:p,unstyled:r})=>jsxRuntime.jsx("nav",{"data-ndpr-component":"policy-step-indicator","aria-label":"Policy wizard progress",className:chunkAME4HJR4_js.a("w-full flex items-center justify-between px-2 py-4",p==null?void 0:p.root,r),children:cr.map((e,d)=>{let t=d+1,i=t<n,u=t===n,v=d===cr.length-1;return jsxRuntime.jsxs(Nr__default.default.Fragment,{children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex flex-col items-center gap-1",p==null?void 0:p.stepWrapper,r),children:[jsxRuntime.jsx("div",{"aria-current":u?"step":void 0,"aria-label":`Step ${t}: ${e}${i?" (completed)":u?" (current)":""}`,className:chunkAME4HJR4_js.a(["flex items-center justify-center rounded-full border-2 font-semibold transition-all",i?"w-8 h-8 bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))]":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?jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):jsxRuntime.jsx("span",{className:"text-xs leading-none",children:t})}),jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a(["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})]}),!v&&jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a(["flex-1 h-0.5 mx-2",i?"bg-[rgb(var(--ndpr-primary))]":"bg-gray-200 dark:bg-gray-700"].join(" "),p==null?void 0:p.connector,r),"aria-hidden":"true"})]},t)})});var $="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 ndpr-text-foreground focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",rt="block text-sm font-medium ndpr-text-muted mb-1",A=({id:n,label:p,required:r,description:e,children:d,classNames:t,unstyled:i})=>{let u=e?`${n}-desc`:void 0;return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex flex-col",t==null?void 0:t.field,i),children:[jsxRuntime.jsxs("label",{htmlFor:n,className:chunkAME4HJR4_js.a(rt,t==null?void 0:t.label,i),children:[p,r&&jsxRuntime.jsx("span",{className:"text-red-500 ml-0.5","aria-hidden":"true",children:"*"})]}),e&&jsxRuntime.jsx("p",{id:u,className:"text-xs ndpr-text-muted mb-1",children:e}),d]})},Cr=({context:n,onUpdateOrg:p,classNames:r,unstyled:e})=>{var i,u,l;let d=Nr.useId(),t=n.org;return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-about",className:chunkAME4HJR4_js.a("ndpr-form-section",r==null?void 0:r.root,e),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",r==null?void 0:r.heading,e),children:"Organisation Details"}),jsxRuntime.jsxs("p",{className:chunkAME4HJR4_js.a("ndpr-form-field__hint",r==null?void 0:r.subheading,e),children:["Tell us about your organisation. Fields marked ",jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})," are required."]})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("grid grid-cols-1 md:grid-cols-2 gap-4",r==null?void 0:r.grid,e),children:[jsxRuntime.jsx(A,{id:`${d}-org-name`,label:"Organisation Name",required:true,classNames:r,unstyled:e,children:jsxRuntime.jsx("input",{id:`${d}-org-name`,type:"text",value:t.name,onChange:v=>p({name:v.target.value}),placeholder:"Acme Corporation",className:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e),"aria-required":"true"})}),jsxRuntime.jsx(A,{id:`${d}-website`,label:"Website",required:true,classNames:r,unstyled:e,children:jsxRuntime.jsx("input",{id:`${d}-website`,type:"url",value:t.website,onChange:v=>p({website:v.target.value}),placeholder:"https://example.com",className:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e),"aria-required":"true"})}),jsxRuntime.jsx(A,{id:`${d}-privacy-email`,label:"Privacy Contact Email",required:true,classNames:r,unstyled:e,children:jsxRuntime.jsx("input",{id:`${d}-privacy-email`,type:"email",value:t.privacyEmail,onChange:v=>p({privacyEmail:v.target.value}),placeholder:"privacy@example.com",className:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e),"aria-required":"true"})}),jsxRuntime.jsx(A,{id:`${d}-industry`,label:"Industry",classNames:r,unstyled:e,children:jsxRuntime.jsxs("select",{id:`${d}-industry`,value:t.industry,onChange:v=>p({industry:v.target.value}),className:chunkAME4HJR4_js.a($,r==null?void 0:r.select,e),children:[jsxRuntime.jsx("option",{value:"fintech",children:"Fintech"}),jsxRuntime.jsx("option",{value:"healthcare",children:"Healthcare"}),jsxRuntime.jsx("option",{value:"ecommerce",children:"E-commerce"}),jsxRuntime.jsx("option",{value:"saas",children:"SaaS"}),jsxRuntime.jsx("option",{value:"education",children:"Education"}),jsxRuntime.jsx("option",{value:"government",children:"Government"}),jsxRuntime.jsx("option",{value:"other",children:"Other"})]})}),jsxRuntime.jsx(A,{id:`${d}-dpo-name`,label:"Data Protection Officer (DPO) Name",classNames:r,unstyled:e,children:jsxRuntime.jsx("input",{id:`${d}-dpo-name`,type:"text",value:(i=t.dpoName)!=null?i:"",onChange:v=>p({dpoName:v.target.value}),placeholder:"Jane Smith",className:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e)})}),jsxRuntime.jsx(A,{id:`${d}-dpo-email`,label:"DPO Email",classNames:r,unstyled:e,children:jsxRuntime.jsx("input",{id:`${d}-dpo-email`,type:"email",value:(u=t.dpoEmail)!=null?u:"",onChange:v=>p({dpoEmail:v.target.value}),placeholder:"dpo@example.com",className:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e)})}),jsxRuntime.jsx(A,{id:`${d}-address`,label:"Registered Address",classNames:r,unstyled:e,children:jsxRuntime.jsx("input",{id:`${d}-address`,type:"text",value:(l=t.address)!=null?l:"",onChange:v=>p({address:v.target.value}),placeholder:"1 Victoria Island, Lagos, Nigeria",className:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e)})}),jsxRuntime.jsx(A,{id:`${d}-org-size`,label:"Organisation Size",classNames:r,unstyled:e,children:jsxRuntime.jsxs("select",{id:`${d}-org-size`,value:t.orgSize,onChange:v=>p({orgSize:v.target.value}),className:chunkAME4HJR4_js.a($,r==null?void 0:r.select,e),children:[jsxRuntime.jsx("option",{value:"startup",children:"Startup (1\u201350 employees)"}),jsxRuntime.jsx("option",{value:"midsize",children:"Mid-size (51\u2013500 employees)"}),jsxRuntime.jsx("option",{value:"enterprise",children:"Enterprise (500+ employees)"})]})}),jsxRuntime.jsx(A,{id:`${d}-country`,label:"Country of Operation",classNames:r,unstyled:e,children:jsxRuntime.jsx("input",{id:`${d}-country`,type:"text",value:t.country,onChange:v=>p({country:v.target.value}),placeholder:"Nigeria",className:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e)})})]})]})};var tt={identity:"Identity",financial:"Financial",behavioral:"Behavioural",sensitive:"Sensitive",children:"Children"},ot=["identity","financial","behavioral","sensitive","children"],et=["sensitive","children"],kr=({categories:n,onToggle:p,classNames:r,unstyled:e})=>{let d=ot.reduce((t,i)=>{let u=n.filter(l=>l.group===i);return u.length>0&&(t[i]=u),t},{});return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-data",className:chunkAME4HJR4_js.a("space-y-8",r==null?void 0:r.root,e),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",r==null?void 0:r.heading,e),children:"Data Categories"}),jsxRuntime.jsx("p",{id:"data-categories-desc",className:chunkAME4HJR4_js.a("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(d).map(([t,i])=>{let u=et.includes(t);return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("space-y-3",r==null?void 0:r.group,e),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center gap-2",r==null?void 0:r.groupHeader,e),children:[jsxRuntime.jsx("h3",{className:chunkAME4HJR4_js.a("text-sm font-semibold uppercase tracking-wide ndpr-text-muted",r==null?void 0:r.groupTitle,e),children:tt[t]}),u&&jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("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&&jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("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."}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",r==null?void 0:r.cardsGrid,e),children:i.map(l=>jsxRuntime.jsx("button",{type:"button",onClick:()=>p(l.id),"aria-pressed":l.selected,className:chunkAME4HJR4_js.a(["text-left rounded-lg border p-4 transition-all cursor-pointer focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",l.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:jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a(["mt-0.5 w-4 h-4 rounded border-2 flex-shrink-0 flex items-center justify-center",l.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:l.selected&&jsxRuntime.jsx("svg",{className:"w-2.5 h-2.5 text-[rgb(var(--ndpr-primary-foreground))]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("text-sm font-medium ndpr-text-foreground",r==null?void 0:r.cardLabel,e),children:l.label}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("text-xs ndpr-text-muted mt-1 leading-relaxed",r==null?void 0:r.cardDataPoints,e),children:l.dataPoints.join(", ")})]})]})},l.id))})]},t)})]})};var nt=[{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:n,checked:p,onChange:r})=>jsxRuntime.jsx("button",{id:n,type:"button",role:"switch","aria-checked":p,onClick:()=>r(!p),className:["relative inline-flex h-6 w-11 flex-shrink-0 rounded-full border-2 border-transparent cursor-pointer transition-colors focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",p?"bg-[rgb(var(--ndpr-primary))]":"bg-gray-200 dark:bg-gray-600"].join(" "),children:jsxRuntime.jsx("span",{"aria-hidden":"true",className:["pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition-transform",p?"translate-x-5":"translate-x-0"].join(" ")})}),Pr=({context:n,onTogglePurpose:p,onUpdateContext:r,onAddProcessor:e,onRemoveProcessor:d,classNames:t,unstyled:i})=>{let u=Nr.useId(),[l,v]=Nr.useState({name:"",purpose:"",country:""}),[C,g]=Nr.useState(false),a=()=>{let{name:b,purpose:c,country:m}=l;!b.trim()||!c.trim()||!m.trim()||(e({name:b.trim(),purpose:c.trim(),country:m.trim()}),v({name:"",purpose:"",country:""}),g(false));};return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-processing",className:chunkAME4HJR4_js.a("ndpr-form-section",t==null?void 0:t.root,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",t==null?void 0:t.heading,i),children:"Processing Details"}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-form-field__hint",t==null?void 0:t.subheading,i),children:"Define how and why you process personal data."})]}),jsxRuntime.jsxs("section",{className:chunkAME4HJR4_js.a(pr,t==null?void 0:t.section,i),"aria-labelledby":"purposes-heading",children:[jsxRuntime.jsx("h3",{id:"purposes-heading",className:chunkAME4HJR4_js.a("text-base font-semibold ndpr-text-foreground",t==null?void 0:t.sectionTitle,i),children:"Processing Purposes"}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("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."}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("space-y-3",t==null?void 0:t.purposeList,i),children:nt.map(b=>{let c=n.purposes.includes(b.value),m=`${u}-purpose-${b.value}`,B=`${u}-purpose-desc-${b.value}`;return jsxRuntime.jsxs("label",{htmlFor:m,className:chunkAME4HJR4_js.a("flex items-start gap-3 cursor-pointer group",t==null?void 0:t.purposeItem,i),children:[jsxRuntime.jsx("input",{id:m,type:"checkbox",checked:c,onChange:()=>p(b.value),"aria-describedby":B,className:chunkAME4HJR4_js.a("mt-0.5 h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))] cursor-pointer",t==null?void 0:t.purposeCheckbox,i)}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("text-sm font-medium ndpr-text-foreground",t==null?void 0:t.purposeLabel,i),children:b.label}),jsxRuntime.jsx("p",{id:B,className:chunkAME4HJR4_js.a("ndpr-form-field__hint",t==null?void 0:t.purposeDescription,i),children:b.description})]})]},b.value)})})]}),jsxRuntime.jsxs("section",{className:chunkAME4HJR4_js.a(pr,t==null?void 0:t.section,i),"aria-labelledby":"thirdparty-heading",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("h3",{id:"thirdparty-heading",className:chunkAME4HJR4_js.a("text-base font-semibold ndpr-text-foreground",t==null?void 0:t.sectionTitle,i),children:"Third-Party Data Sharing"}),jsxRuntime.jsx(gr,{id:`${u}-thirdparty-toggle`,checked:n.thirdPartyProcessors.length>0||C,onChange:b=>{b?g(true):(n.thirdPartyProcessors.forEach((c,m)=>d(0)),g(false));}})]}),(n.thirdPartyProcessors.length>0||C)&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-form-section",t==null?void 0:t.processorSection,i),children:[n.thirdPartyProcessors.length>0&&jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("overflow-x-auto",t==null?void 0:t.processorTable,i),children:jsxRuntime.jsxs("table",{className:"w-full text-sm",children:[jsxRuntime.jsx("thead",{children:jsxRuntime.jsxs("tr",{className:chunkAME4HJR4_js.a("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:[jsxRuntime.jsx("th",{className:"pb-2 pr-4",children:"Name"}),jsxRuntime.jsx("th",{className:"pb-2 pr-4",children:"Purpose"}),jsxRuntime.jsx("th",{className:"pb-2 pr-4",children:"Country"}),jsxRuntime.jsx("th",{className:"pb-2"})]})}),jsxRuntime.jsx("tbody",{className:"divide-y divide-gray-100 dark:divide-gray-700",children:n.thirdPartyProcessors.map((b,c)=>jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("td",{className:chunkAME4HJR4_js.a("py-2 pr-4 ndpr-text-foreground",t==null?void 0:t.tableCell,i),children:b.name}),jsxRuntime.jsx("td",{className:chunkAME4HJR4_js.a("py-2 pr-4 ndpr-text-muted",t==null?void 0:t.tableCell,i),children:b.purpose}),jsxRuntime.jsx("td",{className:chunkAME4HJR4_js.a("py-2 pr-4 ndpr-text-muted",t==null?void 0:t.tableCell,i),children:b.country}),jsxRuntime.jsx("td",{className:"py-2",children:jsxRuntime.jsx("button",{type:"button",onClick:()=>d(c),className:chunkAME4HJR4_js.a("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 ${b.name}`,children:"Remove"})})]},c))})]})}),C?jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("grid grid-cols-1 sm:grid-cols-3 gap-3 items-end",t==null?void 0:t.processorForm,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:`${u}-proc-name`,className:"block text-xs font-medium ndpr-text-muted mb-1",children:"Processor Name"}),jsxRuntime.jsx("input",{id:`${u}-proc-name`,type:"text",placeholder:"Processor name",value:l.name,onChange:b=>v(c=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},c),{name:b.target.value})),"aria-required":"true",className:chunkAME4HJR4_js.a(dr,t==null?void 0:t.input,i)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:`${u}-proc-purpose`,className:"block text-xs font-medium ndpr-text-muted mb-1",children:"Purpose"}),jsxRuntime.jsx("input",{id:`${u}-proc-purpose`,type:"text",placeholder:"Purpose",value:l.purpose,onChange:b=>v(c=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},c),{purpose:b.target.value})),"aria-required":"true",className:chunkAME4HJR4_js.a(dr,t==null?void 0:t.input,i)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:`${u}-proc-country`,className:"block text-xs font-medium ndpr-text-muted mb-1",children:"Country"}),jsxRuntime.jsx("input",{id:`${u}-proc-country`,type:"text",placeholder:"Country",value:l.country,onChange:b=>v(c=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},c),{country:b.target.value})),"aria-required":"true",className:chunkAME4HJR4_js.a(dr,t==null?void 0:t.input,i)})]}),jsxRuntime.jsxs("div",{className:"sm:col-span-3 flex gap-2",children:[jsxRuntime.jsx("button",{type:"button",onClick:a,className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--primary ndpr-button--sm",t==null?void 0:t.addButton,i),children:"Add Processor"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>g(false),className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--secondary ndpr-button--sm",t==null?void 0:t.cancelButton,i),children:"Cancel"})]})]}):jsxRuntime.jsxs("button",{type:"button",onClick:()=>g(true),className:chunkAME4HJR4_js.a("flex items-center gap-1 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",t==null?void 0:t.addLink,i),children:[jsxRuntime.jsx("span",{"aria-hidden":"true",children:"+"})," Add processor"]})]})]}),jsxRuntime.jsxs("section",{className:chunkAME4HJR4_js.a(pr,t==null?void 0:t.section,i),"aria-labelledby":"disclosures-heading",children:[jsxRuntime.jsx("h3",{id:"disclosures-heading",className:chunkAME4HJR4_js.a("text-base font-semibold ndpr-text-foreground",t==null?void 0:t.sectionTitle,i),children:"Additional Disclosures"}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-form-section",t==null?void 0:t.disclosureList,i),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{id:`${u}-cross-border-label`,className:chunkAME4HJR4_js.a("text-sm font-medium ndpr-text-foreground",t==null?void 0:t.disclosureLabel,i),children:"Cross-border Data Transfers"}),jsxRuntime.jsx("p",{id:`${u}-cross-border-desc`,className:chunkAME4HJR4_js.a("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."})]}),jsxRuntime.jsx(gr,{id:`${u}-cross-border-toggle`,checked:n.hasCrossBorderTransfer,onChange:b=>r({hasCrossBorderTransfer:b})})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{id:`${u}-automated-label`,className:chunkAME4HJR4_js.a("text-sm font-medium ndpr-text-foreground",t==null?void 0:t.disclosureLabel,i),children:"Automated Decision-Making / Profiling"}),jsxRuntime.jsx("p",{id:`${u}-automated-desc`,className:chunkAME4HJR4_js.a("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."})]}),jsxRuntime.jsx(gr,{id:`${u}-automated-toggle`,checked:n.hasAutomatedDecisions,onChange:b=>r({hasAutomatedDecisions:b})})]})]})]})]})};var Sr=({section:n,index:p,isCustom:r,isEditing:e,editedContent:d,onEdit:t,onSaveEdit:i,onCancelEdit:u,onMoveUp:l,onMoveDown:v,onDelete:C,classNames:g,unstyled:a})=>{let[b,c]=Nr.useState(d!=null?d:n.template);return Nr.useEffect(()=>{d!==void 0&&c(d);},[d]),Nr.useEffect(()=>{e&&c(d!=null?d:n.template);},[e,d,n.template]),jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-section-card",className:chunkAME4HJR4_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-3",g==null?void 0:g.root,a),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-start justify-between gap-2",g==null?void 0:g.header,a),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center gap-3 min-w-0",g==null?void 0:g.titleRow,a),children:[jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("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}),jsxRuntime.jsxs("h4",{className:chunkAME4HJR4_js.a("text-sm font-semibold ndpr-text-foreground truncate",g==null?void 0:g.sectionTitle,a),children:[n.title,r&&jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("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"})]})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center gap-1 flex-shrink-0",g==null?void 0:g.actions,a),children:[l&&jsxRuntime.jsx("button",{type:"button",onClick:l,className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--icon",g==null?void 0:g.moveButton,a),"aria-label":`Move "${n.title}" up`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})})}),v&&jsxRuntime.jsx("button",{type:"button",onClick:v,className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--icon",g==null?void 0:g.moveButton,a),"aria-label":`Move "${n.title}" down`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}),!e&&jsxRuntime.jsx("button",{type:"button",onClick:t,className:chunkAME4HJR4_js.a("p-1.5 text-gray-400 hover:text-[rgb(var(--ndpr-primary))] rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",g==null?void 0:g.editButton,a),"aria-label":`Edit "${n.title}"`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),r&&C&&jsxRuntime.jsx("button",{type:"button",onClick:C,className:chunkAME4HJR4_js.a("p-1.5 text-gray-400 hover:text-red-500 dark:hover:text-red-400 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",g==null?void 0:g.deleteButton,a),"aria-label":`Delete "${n.title}"`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]}),e?jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("space-y-2",g==null?void 0:g.editArea,a),children:[jsxRuntime.jsx("textarea",{value:b,onChange:m=>c(m.target.value),rows:8,className:chunkAME4HJR4_js.a("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 ${n.title}`}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex gap-2",g==null?void 0:g.editActions,a),children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>i(b),className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--primary ndpr-button--sm",g==null?void 0:g.saveButton,a),children:"Save"}),jsxRuntime.jsx("button",{type:"button",onClick:u,className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--secondary ndpr-button--sm",g==null?void 0:g.cancelButton,a),children:"Cancel"})]})]}):jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("text-sm ndpr-text-muted leading-relaxed line-clamp-4 whitespace-pre-wrap",g==null?void 0:g.content,a),children:n.template})]})};var Rr="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",Lr=({onAdd:n,nextOrder:p,classNames:r,unstyled:e})=>{let d=Nr.useId(),[t,i]=Nr.useState(""),[u,l]=Nr.useState(""),[v,C]=Nr.useState(""),g=()=>{if(!t.trim()){C("Section title is required.");return}if(!u.trim()){C("Section content is required.");return}C(""),n({title:t.trim(),content:u.trim(),order:p}),i(""),l("");};return jsxRuntime.jsxs("div",{"data-ndpr-component":"custom-section-form",className:chunkAME4HJR4_js.a("ndpr-card ndpr-card--compact",r==null?void 0:r.root,e),children:[jsxRuntime.jsx("h4",{className:chunkAME4HJR4_js.a("ndpr-section-heading",r==null?void 0:r.heading,e),children:"Add Custom Section"}),v&&jsxRuntime.jsx("p",{role:"alert",className:chunkAME4HJR4_js.a("text-xs ndpr-text-destructive",r==null?void 0:r.error,e),children:v}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("space-y-3",r==null?void 0:r.fields,e),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:`${d}-custom-section-title`,className:chunkAME4HJR4_js.a("block text-xs font-medium ndpr-text-muted mb-1",r==null?void 0:r.label,e),children:["Section Title ",jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsxRuntime.jsx("input",{id:`${d}-custom-section-title`,type:"text",value:t,onChange:a=>{i(a.target.value),v&&C("");},placeholder:"e.g. Cookie Policy",className:chunkAME4HJR4_js.a(Rr,r==null?void 0:r.input,e),"aria-required":"true"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:`${d}-custom-section-content`,className:chunkAME4HJR4_js.a("block text-xs font-medium ndpr-text-muted mb-1",r==null?void 0:r.label,e),children:["Content ",jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsxRuntime.jsx("textarea",{id:`${d}-custom-section-content`,value:u,onChange:a=>{l(a.target.value),v&&C("");},placeholder:"Write the section content here...",rows:5,className:chunkAME4HJR4_js.a(`${Rr} resize-y`,r==null?void 0:r.textarea,e),"aria-required":"true"})]})]}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("flex items-center gap-2",r==null?void 0:r.footer,e),children:jsxRuntime.jsx("button",{type:"button",onClick:g,className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--primary ndpr-button--sm",r==null?void 0:r.addButton,e),children:"Add Section"})})]})};var Fr={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"}},gt={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},N=({icon:n,label:p,description:r,actionLabel:e,loading:d,onClick:t,classNames:i,unstyled:u})=>jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 flex flex-col gap-3",i==null?void 0:i.formatCard,u),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center gap-3",i==null?void 0:i.formatHeader,u),children:[jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("w-10 h-10 rounded-lg bg-gray-100 dark:bg-gray-700 flex items-center justify-center flex-shrink-0",i==null?void 0:i.formatIcon,u),"aria-hidden":"true",children:n}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-section-heading",i==null?void 0:i.formatLabel,u),children:p}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-form-field__hint",i==null?void 0:i.formatDescription,u),children:r})]})]}),jsxRuntime.jsx("button",{type:"button",onClick:t,disabled:d,className:chunkAME4HJR4_js.a("w-full px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2",i==null?void 0:i.formatButton,u),children:d?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("svg",{className:"animate-spin w-4 h-4",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),"Generating\u2026"]}):e})]}),Er=({complianceResult:n,onExportPDF:p,onExportDOCX:r,onExportHTML:e,onExportMarkdown:d,classNames:t,unstyled:i})=>{var c;let[u,l]=Nr.useState(false),[v,C]=Nr.useState(false),g=(c=Fr[n.rating])!=null?c:Fr.not_compliant,a=()=>chunkRFPLZDIO_js.d(null,null,function*(){l(true);try{yield p();}finally{l(false);}}),b=()=>chunkRFPLZDIO_js.d(null,null,function*(){C(true);try{yield r();}finally{C(false);}});return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-export-panel",className:chunkAME4HJR4_js.a("ndpr-form-section",t==null?void 0:t.root,i),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`rounded-lg border p-4 flex items-center gap-4 ${g.bg} ${g.border}`,t==null?void 0:t.complianceSummary,i),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`text-3xl font-bold ${g.text}`,t==null?void 0:t.complianceScore,i),"aria-label":`Compliance score: ${n.percentage}%`,children:[n.percentage,"%"]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a(`text-sm font-semibold ${g.text}`,t==null?void 0:t.complianceRating,i),children:gt[n.rating]}),jsxRuntime.jsxs("p",{className:chunkAME4HJR4_js.a("text-xs ndpr-text-muted mt-0.5",t==null?void 0:t.complianceDetail,i),children:[n.score," / ",n.maxScore," points \u2022"," ",n.gaps.length," gap",n.gaps.length!==1?"s":""," remaining"]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:chunkAME4HJR4_js.a("ndpr-section-heading",t==null?void 0:t.formatsHeading,i),children:"Export Format"}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("grid grid-cols-1 sm:grid-cols-2 gap-3",t==null?void 0:t.formatsGrid,i),children:[jsxRuntime.jsx(N,{icon:jsxRuntime.jsx("svg",{className:"w-5 h-5 text-red-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-3 7v-1h4v1h-4zm0-3v-1h4v1h-4zm-2-5h8v1H8v-1z"})}),label:"PDF",description:"Professional formatted document, ideal for publishing.",actionLabel:"Download PDF",loading:u,onClick:a,classNames:t,unstyled:i}),jsxRuntime.jsx(N,{icon:jsxRuntime.jsx("svg",{className:"w-5 h-5 text-blue-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-5 8v-5h1.5l1 3 1-3H13v5h-1v-3.5l-.75 2.25h-.5L10 13.5V17H9zm5-1.5h.75c.55 0 .75-.25.75-.75 0-.4-.2-.65-.75-.65H14V15.5zm1 1.5h-2v-4h2c1.1 0 1.75.6 1.75 1.5 0 .55-.25.95-.65 1.15.5.2.8.65.8 1.2 0 1-.65 1.65-1.9 1.65V17zm-.25-1c.6 0 .9-.25.9-.75 0-.45-.3-.75-.9-.75H14V16h.75z"})}),label:"DOCX",description:"Editable Word document for further customisation.",actionLabel:"Download DOCX",loading:v,onClick:b,classNames:t,unstyled:i}),jsxRuntime.jsx(N,{icon:jsxRuntime.jsxs("svg",{className:"w-5 h-5 text-orange-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 15H9V8h2v9zm4 0h-2V8h2v9z"}),jsxRuntime.jsx("path",{d:"M9.5 6.5h1v1h-1zm4 0h1v1h-1z"}),jsxRuntime.jsx("path",{d:"M5 5h14v2H5zm0 12h14v2H5z"})]}),label:"HTML",description:"Copy-ready HTML to embed on your website.",actionLabel:"Copy HTML",onClick:e,classNames:t,unstyled:i}),jsxRuntime.jsx(N,{icon:jsxRuntime.jsx("svg",{className:"w-5 h-5 ndpr-text-muted",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M3 5h18v2H3V5zm0 4h12v2H3V9zm0 4h18v2H3v-2zm0 4h12v2H3v-2z"})}),label:"Markdown",description:"Plain-text format for documentation or Git repos.",actionLabel:"Copy Markdown",onClick:d,classNames:t,unstyled:i})]})]})]})};var Ar=({sections:n,customSections:p,sectionOverrides:r,complianceResult:e,onEditSection:d,onAddCustomSection:t,onRemoveCustomSection:i,onReorderSection:u,onExportPDF:l,onExportDOCX:v,onExportHTML:C,onExportMarkdown:g,classNames:a,unstyled:b})=>{let[c,m]=Nr.useState(null),[B,J]=Nr.useState(false),Z=new Set(p.map(h=>h.id)),or=(h,F)=>{d(h,F),m(null);},er=n.length>0?Math.max(...n.map(h=>{var F;return (F=h.order)!=null?F:0}))+1:1;return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-review",className:chunkAME4HJR4_js.a("ndpr-form-section",a==null?void 0:a.root,b),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",a==null?void 0:a.heading,b),children:"Review & Export"}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-form-field__hint",a==null?void 0:a.subheading,b),children:"Review your generated policy sections, reorder or edit content, then export."})]}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("space-y-3",a==null?void 0:a.sectionList,b),"aria-live":"polite",children:n.map((h,F)=>jsxRuntime.jsx(Sr,{section:r[h.id]?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},h),{template:r[h.id]}):h,index:F,isCustom:Z.has(h.id),isEditing:c===h.id,editedContent:r[h.id],onEdit:()=>m(h.id),onSaveEdit:ir=>or(h.id,ir),onCancelEdit:()=>m(null),onMoveUp:F>0?()=>u(h.id,"up"):void 0,onMoveDown:F<n.length-1?()=>u(h.id,"down"):void 0,onDelete:Z.has(h.id)?()=>i(h.id):void 0,classNames:a,unstyled:b},h.id))}),!B&&jsxRuntime.jsxs("button",{type:"button",onClick:()=>J(true),className:chunkAME4HJR4_js.a("flex items-center gap-2 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",a==null?void 0:a.addSectionButton,b),children:[jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("w-5 h-5 rounded-full border-2 border-[rgb(var(--ndpr-primary))] flex items-center justify-center text-xs font-bold leading-none",a==null?void 0:a.addSectionIcon,b),"aria-hidden":"true",children:"+"}),"Add Custom Section"]}),B&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("space-y-2",a==null?void 0:a.customFormWrapper,b),children:[jsxRuntime.jsx(Lr,{onAdd:h=>{t(h),J(false);},nextOrder:er,classNames:a,unstyled:b}),jsxRuntime.jsx("button",{type:"button",onClick:()=>J(false),className:chunkAME4HJR4_js.a("text-sm ndpr-text-muted hover:underline",a==null?void 0:a.cancelCustomForm,b),children:"Cancel"})]}),jsxRuntime.jsx("hr",{className:chunkAME4HJR4_js.a("border-gray-200 dark:border-gray-700",a==null?void 0:a.divider,b)}),jsxRuntime.jsx(Er,{complianceResult:e,onExportPDF:l,onExportDOCX:v,onExportHTML:C,onExportMarkdown:g,classNames:a,unstyled:b})]})};var Tr={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"}},at={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},Ir=({score:n,maxScore:p,rating:r,classNames:e,unstyled:d})=>{var C,g;let t=p>0?Math.round(n/p*100):0,i=(C=Tr[r])!=null?C:Tr.not_compliant,u=36,l=2*Math.PI*u,v=l-t/100*l;return jsxRuntime.jsxs("div",{"data-ndpr-component":"compliance-score-ring",className:chunkAME4HJR4_js.a("flex flex-col items-center gap-2",e==null?void 0:e.root,d),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("relative w-24 h-24",e==null?void 0:e.svgWrapper,d),children:[jsxRuntime.jsxs("svg",{className:"w-24 h-24 -rotate-90",viewBox:"0 0 96 96","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{cx:"48",cy:"48",r:u,fill:"none",className:"stroke-gray-200 dark:stroke-gray-700",strokeWidth:"8"}),jsxRuntime.jsx("circle",{cx:"48",cy:"48",r:u,fill:"none",className:i.stroke,strokeWidth:"8",strokeLinecap:"round",strokeDasharray:l,strokeDashoffset:v,style:{transition:"stroke-dashoffset 0.5s ease-out"}})]}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("absolute inset-0 flex flex-col items-center justify-center",e==null?void 0:e.centerText,d),children:jsxRuntime.jsxs("span",{className:chunkAME4HJR4_js.a(`text-xl font-bold leading-none ${i.text}`,e==null?void 0:e.scoreValue,d),"aria-label":`${t}% compliance score`,children:[t,"%"]})})]}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a(`text-xs font-semibold text-center ${i.text}`,e==null?void 0:e.ratingLabel,d),children:(g=at[r])!=null?g:r}),jsxRuntime.jsxs("p",{className:chunkAME4HJR4_js.a("text-xs ndpr-text-muted text-center",e==null?void 0:e.scoreDetail,d),children:[n," / ",p," pts"]})]})};var bt={critical:"ndpr-text-destructive",important:"ndpr-text-warning",recommended:"ndpr-text-info"},_r=({gap:n,isPassed:p,onFix:r,classNames:e,unstyled:d})=>{let[t,i]=Nr.useState(false);return jsxRuntime.jsxs("div",{"data-ndpr-component":"compliance-requirement-item",className:chunkAME4HJR4_js.a("border-b border-gray-100 dark:border-gray-700 last:border-0 py-2",e==null?void 0:e.root,d),children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>!p&&i(u=>!u),className:chunkAME4HJR4_js.a("w-full flex items-start gap-2 text-left group",e==null?void 0:e.row,d),"aria-expanded":p?void 0:t,"aria-disabled":p,children:[jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a(["mt-0.5 flex-shrink-0 w-4 h-4 rounded-full flex items-center justify-center",p?"bg-green-500":n.severity==="critical"?"bg-red-500":n.severity==="important"?"bg-amber-500":"bg-blue-400"].join(" "),e==null?void 0:e.statusIcon,d),"aria-hidden":"true",children:p?jsxRuntime.jsx("svg",{className:"w-2.5 h-2.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):jsxRuntime.jsx("svg",{className:"w-2.5 h-2.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-1",children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a(`text-xs font-medium ${p?"ndpr-text-muted":"ndpr-text-foreground"}`,e==null?void 0:e.requirementLabel,d),children:n.requirement}),!p&&jsxRuntime.jsx("svg",{className:`flex-shrink-0 w-3 h-3 text-gray-400 transition-transform ${t?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),jsxRuntime.jsxs("p",{className:chunkAME4HJR4_js.a("text-xs text-gray-400 dark:text-gray-500 mt-0.5",e==null?void 0:e.ndpaSection,d),children:["NDPA ",n.ndpaSection]})]})]}),!p&&t&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("mt-2 ml-6 space-y-2",e==null?void 0:e.detail,d),children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a(`text-xs ${bt[n.severity]}`,e==null?void 0:e.message,d),children:n.message}),jsxRuntime.jsx("button",{type:"button",onClick:()=>{r(n.requirementId),i(false);},className:chunkAME4HJR4_js.a("text-xs font-medium px-3 py-1 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))]",e==null?void 0:e.fixButton,d),children:n.fixLabel})]})]})};function ft(n,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=n.map(t=>({gap:t,isPassed:false})),d={critical:0,important:1,recommended:2};return e.sort((t,i)=>d[t.gap.severity]-d[i.gap.severity]),[...e,...r]}var Mr=({complianceResult:n,onFix:p,classNames:r,unstyled:e})=>{let[d,t]=Nr.useState(false),i=ft(n.gaps,n.passed);return jsxRuntime.jsxs("aside",{"data-ndpr-component":"compliance-checker-sidebar",className:chunkAME4HJR4_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",r==null?void 0:r.root,e),"aria-label":"NDPA compliance checker",children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/50",r==null?void 0:r.header,e),children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",r==null?void 0:r.title,e),children:"NDPA Compliance"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>t(u=>!u),className:chunkAME4HJR4_js.a("p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",r==null?void 0:r.collapseButton,e),"aria-expanded":!d,"aria-label":d?"Expand compliance checker":"Collapse compliance checker",children:jsxRuntime.jsx("svg",{className:`w-4 h-4 transition-transform ${d?"-rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})})]}),!d&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("p-4 space-y-4",r==null?void 0:r.body,e),children:[jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("flex justify-center",r==null?void 0:r.ringWrapper,e),children:jsxRuntime.jsx(Ir,{score:n.score,maxScore:n.maxScore,rating:n.rating,classNames:r,unstyled:e})}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("grid grid-cols-3 gap-2 text-center",r==null?void 0:r.statsRow,e),children:[{count:n.gaps.filter(u=>u.severity==="critical").length,label:"Critical",color:"ndpr-text-destructive"},{count:n.gaps.filter(u=>u.severity==="important").length,label:"Important",color:"ndpr-text-warning"},{count:n.passed.length,label:"Passed",color:"ndpr-text-success"}].map(({count:u,label:l,color:v})=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a(`text-base font-bold ${v}`,r==null?void 0:r.statValue,e),children:u}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-form-field__hint",r==null?void 0:r.statLabel,e),children:l})]},l))}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("overflow-y-auto max-h-80",r==null?void 0:r.requirementsList,e),children:i.length===0?jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-empty-state",r==null?void 0:r.emptyState,e),children:"No requirements to display."}):i.map(({gap:u,isPassed:l})=>jsxRuntime.jsx(_r,{gap:u,isPassed:l,onFix:p,classNames:r,unstyled:e},u.requirementId))})]})]})};function xt(n){let p=Date.now()-n;return p<1e4?"just now":p<6e4?`${Math.floor(p/1e3)}s ago`:p<36e5?`${Math.floor(p/6e4)}m ago`:new Date(n).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}var zr=({lastSavedAt:n,isSaving:p,hasError:r,classNames:e,unstyled:d})=>{let t="idle";if(p?t="saving":r?t="error":n!==null&&(t="saved"),t==="idle")return null;let i=t==="saving"?"Saving\u2026":t==="error"?"Unable to save":`Draft saved ${n?xt(n):""}`;return jsxRuntime.jsxs("div",{"data-ndpr-component":"draft-save-indicator",role:"status","aria-live":"polite","aria-atomic":"true",className:chunkAME4HJR4_js.a(`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,d),children:[t==="saving"&&jsxRuntime.jsxs("svg",{className:"animate-spin w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),t==="saved"&&jsxRuntime.jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),t==="error"&&jsxRuntime.jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})}),jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("text-xs font-medium",e==null?void 0:e.text,d),children:i})]})};var _o=({adapter:n,onComplete:p,classNames:r,unstyled:e,initialContext:d})=>{var vr,br,lr;let t=chunkYDKWD6MQ_js.c(),i=(vr=t.policy.wizardTitle)!=null?vr:"Privacy Policy Builder",u=(br=t.common.back)!=null?br:"Back",l=(lr=t.common.next)!=null?lr:"Next",{currentStep:v,nextStep:C,prevStep:g,canProceed:a,context:b,updateOrg:c,updateContext:m,toggleDataCategory:B,togglePurpose:J,addProcessor:Z,removeProcessor:or,sections:er,customSections:h,sectionOverrides:F,editSectionContent:ir,addCustomSection:jr,removeCustomSection:qr,reorderSections:Or,complianceResult:ar,applyFix:Hr,handleExportPDF:Wr,handleExportDOCX:Gr,handleExportHTML:Ur,handleExportMarkdown:Vr,lastSavedAt:Xr,isLoading:Yr}=chunkQHW4UKGJ_js.a({adapter:n,onComplete:p,initialContext:d}),nr=(D,K)=>{let O=URL.createObjectURL(D),H=document.createElement("a");H.href=O,H.download=K,H.click(),URL.revokeObjectURL(O);},Jr=()=>chunkRFPLZDIO_js.d(null,null,function*(){let D=yield Wr();nr(D,"privacy-policy.pdf");}),Kr=()=>chunkRFPLZDIO_js.d(null,null,function*(){let D=yield Gr();nr(D,"privacy-policy.docx");}),Qr=()=>{let D=Ur();navigator.clipboard.writeText(D).catch(()=>{let K=new Blob([D],{type:"text/html"}),O=URL.createObjectURL(K),H=window.open(O,"_blank");H?H.addEventListener("load",()=>URL.revokeObjectURL(O)):URL.revokeObjectURL(O);});},Zr=()=>{let D=Vr();navigator.clipboard.writeText(D).catch(()=>{let K=new Blob([D],{type:"text/markdown"});nr(K,"privacy-policy.md");});};return Yr?jsxRuntime.jsxs("div",{"data-ndpr-component":"adaptive-policy-wizard",className:chunkAME4HJR4_js.a("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:[jsxRuntime.jsxs("svg",{className:"animate-spin w-6 h-6 mr-2",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),jsxRuntime.jsx("span",{className:"ndpr-text-sm",children:"Loading\u2026"})]}):jsxRuntime.jsx("div",{"data-ndpr-component":"adaptive-policy-wizard",className:chunkAME4HJR4_js.a("min-h-screen bg-gray-50 dark:bg-gray-900",r==null?void 0:r.root,e),children:jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",r==null?void 0:r.container,e),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center justify-between mb-6",r==null?void 0:r.topBar,e),children:[jsxRuntime.jsx("h1",{className:chunkAME4HJR4_js.a("text-2xl font-bold ndpr-text-foreground",r==null?void 0:r.wizardTitle,e),children:i}),jsxRuntime.jsx(zr,{lastSavedAt:Xr,isSaving:false,hasError:false,classNames:r,unstyled:e})]}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg px-4 mb-6",r==null?void 0:r.stepIndicatorWrapper,e),children:jsxRuntime.jsx(yr,{currentStep:v,classNames:r,unstyled:e})}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex flex-col lg:flex-row gap-6 items-start",r==null?void 0:r.panels,e),children:[jsxRuntime.jsxs("main",{"aria-live":"polite",className:chunkAME4HJR4_js.a("flex-1 min-w-0 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-6",r==null?void 0:r.mainPanel,e),children:[v===1&&jsxRuntime.jsx(Cr,{context:b,onUpdateOrg:c,classNames:r,unstyled:e}),v===2&&jsxRuntime.jsx(kr,{categories:b.dataCategories,onToggle:B,classNames:r,unstyled:e}),v===3&&jsxRuntime.jsx(Pr,{context:b,onTogglePurpose:J,onUpdateContext:m,onAddProcessor:Z,onRemoveProcessor:or,classNames:r,unstyled:e}),v===4&&jsxRuntime.jsx(Ar,{sections:er,customSections:h,sectionOverrides:F,complianceResult:ar,onEditSection:ir,onAddCustomSection:jr,onRemoveCustomSection:qr,onReorderSection:Or,onExportPDF:Jr,onExportDOCX:Kr,onExportHTML:Qr,onExportMarkdown:Zr,classNames:r,unstyled:e}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center justify-between mt-8 pt-4 border-t border-gray-200 dark:border-gray-700",r==null?void 0:r.navigation,e),children:[jsxRuntime.jsx("button",{type:"button",onClick:g,disabled:v===1,className:chunkAME4HJR4_js.a("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:u}),jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:jsxRuntime.jsxs("span",{className:chunkAME4HJR4_js.a("ndpr-form-field__hint",r==null?void 0:r.stepCounter,e),children:["Step ",v," of 4"]})}),v<4?jsxRuntime.jsx("button",{type:"button",onClick:C,disabled:!a,className:chunkAME4HJR4_js.a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed transition-colors",r==null?void 0:r.nextButton,e),children:l}):jsxRuntime.jsx("span",{})]})]}),jsxRuntime.jsx("aside",{className:chunkAME4HJR4_js.a("w-full lg:w-80 flex-shrink-0",r==null?void 0:r.sidebarWrapper,e),children:jsxRuntime.jsx(Mr,{complianceResult:ar,onFix:Hr,classNames:r,unstyled:e})})]})]})})};
|
|
1
|
+
'use strict';var chunkQHW4UKGJ_js=require('./chunk-QHW4UKGJ.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),chunkI5ZDNSX5_js=require('./chunk-I5ZDNSX5.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),Nr=require('react'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Nr__default=/*#__PURE__*/_interopDefault(Nr);var cr=["Organization","Data Collection","Processing","Review & Export"],yr=({currentStep:n,classNames:p,unstyled:r})=>jsxRuntime.jsx("nav",{"data-ndpr-component":"policy-step-indicator","aria-label":"Policy wizard progress",className:chunkAME4HJR4_js.a("w-full flex items-center justify-between px-2 py-4",p==null?void 0:p.root,r),children:cr.map((e,d)=>{let t=d+1,i=t<n,u=t===n,v=d===cr.length-1;return jsxRuntime.jsxs(Nr__default.default.Fragment,{children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex flex-col items-center gap-1",p==null?void 0:p.stepWrapper,r),children:[jsxRuntime.jsx("div",{"aria-current":u?"step":void 0,"aria-label":`Step ${t}: ${e}${i?" (completed)":u?" (current)":""}`,className:chunkAME4HJR4_js.a(["flex items-center justify-center rounded-full border-2 font-semibold transition-all",i?"w-8 h-8 bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))]":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?jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):jsxRuntime.jsx("span",{className:"text-xs leading-none",children:t})}),jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a(["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})]}),!v&&jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a(["flex-1 h-0.5 mx-2",i?"bg-[rgb(var(--ndpr-primary))]":"bg-gray-200 dark:bg-gray-700"].join(" "),p==null?void 0:p.connector,r),"aria-hidden":"true"})]},t)})});var $="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 ndpr-text-foreground focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",rt="block text-sm font-medium ndpr-text-muted mb-1",A=({id:n,label:p,required:r,description:e,children:d,classNames:t,unstyled:i})=>{let u=e?`${n}-desc`:void 0;return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex flex-col",t==null?void 0:t.field,i),children:[jsxRuntime.jsxs("label",{htmlFor:n,className:chunkAME4HJR4_js.a(rt,t==null?void 0:t.label,i),children:[p,r&&jsxRuntime.jsx("span",{className:"text-red-500 ml-0.5","aria-hidden":"true",children:"*"})]}),e&&jsxRuntime.jsx("p",{id:u,className:"text-xs ndpr-text-muted mb-1",children:e}),d]})},Cr=({context:n,onUpdateOrg:p,classNames:r,unstyled:e})=>{var i,u,l;let d=Nr.useId(),t=n.org;return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-about",className:chunkAME4HJR4_js.a("ndpr-form-section",r==null?void 0:r.root,e),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",r==null?void 0:r.heading,e),children:"Organisation Details"}),jsxRuntime.jsxs("p",{className:chunkAME4HJR4_js.a("ndpr-form-field__hint",r==null?void 0:r.subheading,e),children:["Tell us about your organisation. Fields marked ",jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})," are required."]})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("grid grid-cols-1 md:grid-cols-2 gap-4",r==null?void 0:r.grid,e),children:[jsxRuntime.jsx(A,{id:`${d}-org-name`,label:"Organisation Name",required:true,classNames:r,unstyled:e,children:jsxRuntime.jsx("input",{id:`${d}-org-name`,type:"text",value:t.name,onChange:v=>p({name:v.target.value}),placeholder:"Acme Corporation",className:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e),"aria-required":"true"})}),jsxRuntime.jsx(A,{id:`${d}-website`,label:"Website",required:true,classNames:r,unstyled:e,children:jsxRuntime.jsx("input",{id:`${d}-website`,type:"url",value:t.website,onChange:v=>p({website:v.target.value}),placeholder:"https://example.com",className:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e),"aria-required":"true"})}),jsxRuntime.jsx(A,{id:`${d}-privacy-email`,label:"Privacy Contact Email",required:true,classNames:r,unstyled:e,children:jsxRuntime.jsx("input",{id:`${d}-privacy-email`,type:"email",value:t.privacyEmail,onChange:v=>p({privacyEmail:v.target.value}),placeholder:"privacy@example.com",className:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e),"aria-required":"true"})}),jsxRuntime.jsx(A,{id:`${d}-industry`,label:"Industry",classNames:r,unstyled:e,children:jsxRuntime.jsxs("select",{id:`${d}-industry`,value:t.industry,onChange:v=>p({industry:v.target.value}),className:chunkAME4HJR4_js.a($,r==null?void 0:r.select,e),children:[jsxRuntime.jsx("option",{value:"fintech",children:"Fintech"}),jsxRuntime.jsx("option",{value:"healthcare",children:"Healthcare"}),jsxRuntime.jsx("option",{value:"ecommerce",children:"E-commerce"}),jsxRuntime.jsx("option",{value:"saas",children:"SaaS"}),jsxRuntime.jsx("option",{value:"education",children:"Education"}),jsxRuntime.jsx("option",{value:"government",children:"Government"}),jsxRuntime.jsx("option",{value:"other",children:"Other"})]})}),jsxRuntime.jsx(A,{id:`${d}-dpo-name`,label:"Data Protection Officer (DPO) Name",classNames:r,unstyled:e,children:jsxRuntime.jsx("input",{id:`${d}-dpo-name`,type:"text",value:(i=t.dpoName)!=null?i:"",onChange:v=>p({dpoName:v.target.value}),placeholder:"Jane Smith",className:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e)})}),jsxRuntime.jsx(A,{id:`${d}-dpo-email`,label:"DPO Email",classNames:r,unstyled:e,children:jsxRuntime.jsx("input",{id:`${d}-dpo-email`,type:"email",value:(u=t.dpoEmail)!=null?u:"",onChange:v=>p({dpoEmail:v.target.value}),placeholder:"dpo@example.com",className:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e)})}),jsxRuntime.jsx(A,{id:`${d}-address`,label:"Registered Address",classNames:r,unstyled:e,children:jsxRuntime.jsx("input",{id:`${d}-address`,type:"text",value:(l=t.address)!=null?l:"",onChange:v=>p({address:v.target.value}),placeholder:"1 Victoria Island, Lagos, Nigeria",className:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e)})}),jsxRuntime.jsx(A,{id:`${d}-org-size`,label:"Organisation Size",classNames:r,unstyled:e,children:jsxRuntime.jsxs("select",{id:`${d}-org-size`,value:t.orgSize,onChange:v=>p({orgSize:v.target.value}),className:chunkAME4HJR4_js.a($,r==null?void 0:r.select,e),children:[jsxRuntime.jsx("option",{value:"startup",children:"Startup (1\u201350 employees)"}),jsxRuntime.jsx("option",{value:"midsize",children:"Mid-size (51\u2013500 employees)"}),jsxRuntime.jsx("option",{value:"enterprise",children:"Enterprise (500+ employees)"})]})}),jsxRuntime.jsx(A,{id:`${d}-country`,label:"Country of Operation",classNames:r,unstyled:e,children:jsxRuntime.jsx("input",{id:`${d}-country`,type:"text",value:t.country,onChange:v=>p({country:v.target.value}),placeholder:"Nigeria",className:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e)})})]})]})};var tt={identity:"Identity",financial:"Financial",behavioral:"Behavioural",sensitive:"Sensitive",children:"Children"},ot=["identity","financial","behavioral","sensitive","children"],et=["sensitive","children"],kr=({categories:n,onToggle:p,classNames:r,unstyled:e})=>{let d=ot.reduce((t,i)=>{let u=n.filter(l=>l.group===i);return u.length>0&&(t[i]=u),t},{});return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-data",className:chunkAME4HJR4_js.a("space-y-8",r==null?void 0:r.root,e),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",r==null?void 0:r.heading,e),children:"Data Categories"}),jsxRuntime.jsx("p",{id:"data-categories-desc",className:chunkAME4HJR4_js.a("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(d).map(([t,i])=>{let u=et.includes(t);return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("space-y-3",r==null?void 0:r.group,e),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center gap-2",r==null?void 0:r.groupHeader,e),children:[jsxRuntime.jsx("h3",{className:chunkAME4HJR4_js.a("text-sm font-semibold uppercase tracking-wide ndpr-text-muted",r==null?void 0:r.groupTitle,e),children:tt[t]}),u&&jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("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&&jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("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."}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",r==null?void 0:r.cardsGrid,e),children:i.map(l=>jsxRuntime.jsx("button",{type:"button",onClick:()=>p(l.id),"aria-pressed":l.selected,className:chunkAME4HJR4_js.a(["text-left rounded-lg border p-4 transition-all cursor-pointer focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",l.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:jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a(["mt-0.5 w-4 h-4 rounded border-2 flex-shrink-0 flex items-center justify-center",l.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:l.selected&&jsxRuntime.jsx("svg",{className:"w-2.5 h-2.5 text-[rgb(var(--ndpr-primary-foreground))]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("text-sm font-medium ndpr-text-foreground",r==null?void 0:r.cardLabel,e),children:l.label}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("text-xs ndpr-text-muted mt-1 leading-relaxed",r==null?void 0:r.cardDataPoints,e),children:l.dataPoints.join(", ")})]})]})},l.id))})]},t)})]})};var nt=[{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:n,checked:p,onChange:r})=>jsxRuntime.jsx("button",{id:n,type:"button",role:"switch","aria-checked":p,onClick:()=>r(!p),className:["relative inline-flex h-6 w-11 flex-shrink-0 rounded-full border-2 border-transparent cursor-pointer transition-colors focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",p?"bg-[rgb(var(--ndpr-primary))]":"bg-gray-200 dark:bg-gray-600"].join(" "),children:jsxRuntime.jsx("span",{"aria-hidden":"true",className:["pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition-transform",p?"translate-x-5":"translate-x-0"].join(" ")})}),Pr=({context:n,onTogglePurpose:p,onUpdateContext:r,onAddProcessor:e,onRemoveProcessor:d,classNames:t,unstyled:i})=>{let u=Nr.useId(),[l,v]=Nr.useState({name:"",purpose:"",country:""}),[C,g]=Nr.useState(false),a=()=>{let{name:b,purpose:c,country:m}=l;!b.trim()||!c.trim()||!m.trim()||(e({name:b.trim(),purpose:c.trim(),country:m.trim()}),v({name:"",purpose:"",country:""}),g(false));};return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-processing",className:chunkAME4HJR4_js.a("ndpr-form-section",t==null?void 0:t.root,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",t==null?void 0:t.heading,i),children:"Processing Details"}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-form-field__hint",t==null?void 0:t.subheading,i),children:"Define how and why you process personal data."})]}),jsxRuntime.jsxs("section",{className:chunkAME4HJR4_js.a(pr,t==null?void 0:t.section,i),"aria-labelledby":"purposes-heading",children:[jsxRuntime.jsx("h3",{id:"purposes-heading",className:chunkAME4HJR4_js.a("text-base font-semibold ndpr-text-foreground",t==null?void 0:t.sectionTitle,i),children:"Processing Purposes"}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("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."}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("space-y-3",t==null?void 0:t.purposeList,i),children:nt.map(b=>{let c=n.purposes.includes(b.value),m=`${u}-purpose-${b.value}`,B=`${u}-purpose-desc-${b.value}`;return jsxRuntime.jsxs("label",{htmlFor:m,className:chunkAME4HJR4_js.a("flex items-start gap-3 cursor-pointer group",t==null?void 0:t.purposeItem,i),children:[jsxRuntime.jsx("input",{id:m,type:"checkbox",checked:c,onChange:()=>p(b.value),"aria-describedby":B,className:chunkAME4HJR4_js.a("mt-0.5 h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))] cursor-pointer",t==null?void 0:t.purposeCheckbox,i)}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("text-sm font-medium ndpr-text-foreground",t==null?void 0:t.purposeLabel,i),children:b.label}),jsxRuntime.jsx("p",{id:B,className:chunkAME4HJR4_js.a("ndpr-form-field__hint",t==null?void 0:t.purposeDescription,i),children:b.description})]})]},b.value)})})]}),jsxRuntime.jsxs("section",{className:chunkAME4HJR4_js.a(pr,t==null?void 0:t.section,i),"aria-labelledby":"thirdparty-heading",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("h3",{id:"thirdparty-heading",className:chunkAME4HJR4_js.a("text-base font-semibold ndpr-text-foreground",t==null?void 0:t.sectionTitle,i),children:"Third-Party Data Sharing"}),jsxRuntime.jsx(gr,{id:`${u}-thirdparty-toggle`,checked:n.thirdPartyProcessors.length>0||C,onChange:b=>{b?g(true):(n.thirdPartyProcessors.forEach((c,m)=>d(0)),g(false));}})]}),(n.thirdPartyProcessors.length>0||C)&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-form-section",t==null?void 0:t.processorSection,i),children:[n.thirdPartyProcessors.length>0&&jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("overflow-x-auto",t==null?void 0:t.processorTable,i),children:jsxRuntime.jsxs("table",{className:"w-full text-sm",children:[jsxRuntime.jsx("thead",{children:jsxRuntime.jsxs("tr",{className:chunkAME4HJR4_js.a("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:[jsxRuntime.jsx("th",{className:"pb-2 pr-4",children:"Name"}),jsxRuntime.jsx("th",{className:"pb-2 pr-4",children:"Purpose"}),jsxRuntime.jsx("th",{className:"pb-2 pr-4",children:"Country"}),jsxRuntime.jsx("th",{className:"pb-2"})]})}),jsxRuntime.jsx("tbody",{className:"divide-y divide-gray-100 dark:divide-gray-700",children:n.thirdPartyProcessors.map((b,c)=>jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("td",{className:chunkAME4HJR4_js.a("py-2 pr-4 ndpr-text-foreground",t==null?void 0:t.tableCell,i),children:b.name}),jsxRuntime.jsx("td",{className:chunkAME4HJR4_js.a("py-2 pr-4 ndpr-text-muted",t==null?void 0:t.tableCell,i),children:b.purpose}),jsxRuntime.jsx("td",{className:chunkAME4HJR4_js.a("py-2 pr-4 ndpr-text-muted",t==null?void 0:t.tableCell,i),children:b.country}),jsxRuntime.jsx("td",{className:"py-2",children:jsxRuntime.jsx("button",{type:"button",onClick:()=>d(c),className:chunkAME4HJR4_js.a("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 ${b.name}`,children:"Remove"})})]},c))})]})}),C?jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("grid grid-cols-1 sm:grid-cols-3 gap-3 items-end",t==null?void 0:t.processorForm,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:`${u}-proc-name`,className:"block text-xs font-medium ndpr-text-muted mb-1",children:"Processor Name"}),jsxRuntime.jsx("input",{id:`${u}-proc-name`,type:"text",placeholder:"Processor name",value:l.name,onChange:b=>v(c=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},c),{name:b.target.value})),"aria-required":"true",className:chunkAME4HJR4_js.a(dr,t==null?void 0:t.input,i)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:`${u}-proc-purpose`,className:"block text-xs font-medium ndpr-text-muted mb-1",children:"Purpose"}),jsxRuntime.jsx("input",{id:`${u}-proc-purpose`,type:"text",placeholder:"Purpose",value:l.purpose,onChange:b=>v(c=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},c),{purpose:b.target.value})),"aria-required":"true",className:chunkAME4HJR4_js.a(dr,t==null?void 0:t.input,i)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:`${u}-proc-country`,className:"block text-xs font-medium ndpr-text-muted mb-1",children:"Country"}),jsxRuntime.jsx("input",{id:`${u}-proc-country`,type:"text",placeholder:"Country",value:l.country,onChange:b=>v(c=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},c),{country:b.target.value})),"aria-required":"true",className:chunkAME4HJR4_js.a(dr,t==null?void 0:t.input,i)})]}),jsxRuntime.jsxs("div",{className:"sm:col-span-3 flex gap-2",children:[jsxRuntime.jsx("button",{type:"button",onClick:a,className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--primary ndpr-button--sm",t==null?void 0:t.addButton,i),children:"Add Processor"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>g(false),className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--secondary ndpr-button--sm",t==null?void 0:t.cancelButton,i),children:"Cancel"})]})]}):jsxRuntime.jsxs("button",{type:"button",onClick:()=>g(true),className:chunkAME4HJR4_js.a("flex items-center gap-1 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",t==null?void 0:t.addLink,i),children:[jsxRuntime.jsx("span",{"aria-hidden":"true",children:"+"})," Add processor"]})]})]}),jsxRuntime.jsxs("section",{className:chunkAME4HJR4_js.a(pr,t==null?void 0:t.section,i),"aria-labelledby":"disclosures-heading",children:[jsxRuntime.jsx("h3",{id:"disclosures-heading",className:chunkAME4HJR4_js.a("text-base font-semibold ndpr-text-foreground",t==null?void 0:t.sectionTitle,i),children:"Additional Disclosures"}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-form-section",t==null?void 0:t.disclosureList,i),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{id:`${u}-cross-border-label`,className:chunkAME4HJR4_js.a("text-sm font-medium ndpr-text-foreground",t==null?void 0:t.disclosureLabel,i),children:"Cross-border Data Transfers"}),jsxRuntime.jsx("p",{id:`${u}-cross-border-desc`,className:chunkAME4HJR4_js.a("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."})]}),jsxRuntime.jsx(gr,{id:`${u}-cross-border-toggle`,checked:n.hasCrossBorderTransfer,onChange:b=>r({hasCrossBorderTransfer:b})})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{id:`${u}-automated-label`,className:chunkAME4HJR4_js.a("text-sm font-medium ndpr-text-foreground",t==null?void 0:t.disclosureLabel,i),children:"Automated Decision-Making / Profiling"}),jsxRuntime.jsx("p",{id:`${u}-automated-desc`,className:chunkAME4HJR4_js.a("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."})]}),jsxRuntime.jsx(gr,{id:`${u}-automated-toggle`,checked:n.hasAutomatedDecisions,onChange:b=>r({hasAutomatedDecisions:b})})]})]})]})]})};var Sr=({section:n,index:p,isCustom:r,isEditing:e,editedContent:d,onEdit:t,onSaveEdit:i,onCancelEdit:u,onMoveUp:l,onMoveDown:v,onDelete:C,classNames:g,unstyled:a})=>{let[b,c]=Nr.useState(d!=null?d:n.template);return Nr.useEffect(()=>{d!==void 0&&c(d);},[d]),Nr.useEffect(()=>{e&&c(d!=null?d:n.template);},[e,d,n.template]),jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-section-card",className:chunkAME4HJR4_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-3",g==null?void 0:g.root,a),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-start justify-between gap-2",g==null?void 0:g.header,a),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center gap-3 min-w-0",g==null?void 0:g.titleRow,a),children:[jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("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}),jsxRuntime.jsxs("h4",{className:chunkAME4HJR4_js.a("text-sm font-semibold ndpr-text-foreground truncate",g==null?void 0:g.sectionTitle,a),children:[n.title,r&&jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("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"})]})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center gap-1 flex-shrink-0",g==null?void 0:g.actions,a),children:[l&&jsxRuntime.jsx("button",{type:"button",onClick:l,className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--icon",g==null?void 0:g.moveButton,a),"aria-label":`Move "${n.title}" up`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})})}),v&&jsxRuntime.jsx("button",{type:"button",onClick:v,className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--icon",g==null?void 0:g.moveButton,a),"aria-label":`Move "${n.title}" down`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}),!e&&jsxRuntime.jsx("button",{type:"button",onClick:t,className:chunkAME4HJR4_js.a("p-1.5 text-gray-400 hover:text-[rgb(var(--ndpr-primary))] rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",g==null?void 0:g.editButton,a),"aria-label":`Edit "${n.title}"`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),r&&C&&jsxRuntime.jsx("button",{type:"button",onClick:C,className:chunkAME4HJR4_js.a("p-1.5 text-gray-400 hover:text-red-500 dark:hover:text-red-400 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",g==null?void 0:g.deleteButton,a),"aria-label":`Delete "${n.title}"`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]}),e?jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("space-y-2",g==null?void 0:g.editArea,a),children:[jsxRuntime.jsx("textarea",{value:b,onChange:m=>c(m.target.value),rows:8,className:chunkAME4HJR4_js.a("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 ${n.title}`}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex gap-2",g==null?void 0:g.editActions,a),children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>i(b),className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--primary ndpr-button--sm",g==null?void 0:g.saveButton,a),children:"Save"}),jsxRuntime.jsx("button",{type:"button",onClick:u,className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--secondary ndpr-button--sm",g==null?void 0:g.cancelButton,a),children:"Cancel"})]})]}):jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("text-sm ndpr-text-muted leading-relaxed line-clamp-4 whitespace-pre-wrap",g==null?void 0:g.content,a),children:n.template})]})};var Rr="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",Lr=({onAdd:n,nextOrder:p,classNames:r,unstyled:e})=>{let d=Nr.useId(),[t,i]=Nr.useState(""),[u,l]=Nr.useState(""),[v,C]=Nr.useState(""),g=()=>{if(!t.trim()){C("Section title is required.");return}if(!u.trim()){C("Section content is required.");return}C(""),n({title:t.trim(),content:u.trim(),order:p}),i(""),l("");};return jsxRuntime.jsxs("div",{"data-ndpr-component":"custom-section-form",className:chunkAME4HJR4_js.a("ndpr-card ndpr-card--compact",r==null?void 0:r.root,e),children:[jsxRuntime.jsx("h4",{className:chunkAME4HJR4_js.a("ndpr-section-heading",r==null?void 0:r.heading,e),children:"Add Custom Section"}),v&&jsxRuntime.jsx("p",{role:"alert",className:chunkAME4HJR4_js.a("text-xs ndpr-text-destructive",r==null?void 0:r.error,e),children:v}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("space-y-3",r==null?void 0:r.fields,e),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:`${d}-custom-section-title`,className:chunkAME4HJR4_js.a("block text-xs font-medium ndpr-text-muted mb-1",r==null?void 0:r.label,e),children:["Section Title ",jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsxRuntime.jsx("input",{id:`${d}-custom-section-title`,type:"text",value:t,onChange:a=>{i(a.target.value),v&&C("");},placeholder:"e.g. Cookie Policy",className:chunkAME4HJR4_js.a(Rr,r==null?void 0:r.input,e),"aria-required":"true"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:`${d}-custom-section-content`,className:chunkAME4HJR4_js.a("block text-xs font-medium ndpr-text-muted mb-1",r==null?void 0:r.label,e),children:["Content ",jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsxRuntime.jsx("textarea",{id:`${d}-custom-section-content`,value:u,onChange:a=>{l(a.target.value),v&&C("");},placeholder:"Write the section content here...",rows:5,className:chunkAME4HJR4_js.a(`${Rr} resize-y`,r==null?void 0:r.textarea,e),"aria-required":"true"})]})]}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("flex items-center gap-2",r==null?void 0:r.footer,e),children:jsxRuntime.jsx("button",{type:"button",onClick:g,className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--primary ndpr-button--sm",r==null?void 0:r.addButton,e),children:"Add Section"})})]})};var Fr={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"}},gt={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},N=({icon:n,label:p,description:r,actionLabel:e,loading:d,onClick:t,classNames:i,unstyled:u})=>jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 flex flex-col gap-3",i==null?void 0:i.formatCard,u),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center gap-3",i==null?void 0:i.formatHeader,u),children:[jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("w-10 h-10 rounded-lg bg-gray-100 dark:bg-gray-700 flex items-center justify-center flex-shrink-0",i==null?void 0:i.formatIcon,u),"aria-hidden":"true",children:n}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-section-heading",i==null?void 0:i.formatLabel,u),children:p}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-form-field__hint",i==null?void 0:i.formatDescription,u),children:r})]})]}),jsxRuntime.jsx("button",{type:"button",onClick:t,disabled:d,className:chunkAME4HJR4_js.a("w-full px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2",i==null?void 0:i.formatButton,u),children:d?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("svg",{className:"animate-spin w-4 h-4",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),"Generating\u2026"]}):e})]}),Er=({complianceResult:n,onExportPDF:p,onExportDOCX:r,onExportHTML:e,onExportMarkdown:d,classNames:t,unstyled:i})=>{var c;let[u,l]=Nr.useState(false),[v,C]=Nr.useState(false),g=(c=Fr[n.rating])!=null?c:Fr.not_compliant,a=()=>chunkRFPLZDIO_js.d(null,null,function*(){l(true);try{yield p();}finally{l(false);}}),b=()=>chunkRFPLZDIO_js.d(null,null,function*(){C(true);try{yield r();}finally{C(false);}});return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-export-panel",className:chunkAME4HJR4_js.a("ndpr-form-section",t==null?void 0:t.root,i),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`rounded-lg border p-4 flex items-center gap-4 ${g.bg} ${g.border}`,t==null?void 0:t.complianceSummary,i),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`text-3xl font-bold ${g.text}`,t==null?void 0:t.complianceScore,i),"aria-label":`Compliance score: ${n.percentage}%`,children:[n.percentage,"%"]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a(`text-sm font-semibold ${g.text}`,t==null?void 0:t.complianceRating,i),children:gt[n.rating]}),jsxRuntime.jsxs("p",{className:chunkAME4HJR4_js.a("text-xs ndpr-text-muted mt-0.5",t==null?void 0:t.complianceDetail,i),children:[n.score," / ",n.maxScore," points \u2022"," ",n.gaps.length," gap",n.gaps.length!==1?"s":""," remaining"]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:chunkAME4HJR4_js.a("ndpr-section-heading",t==null?void 0:t.formatsHeading,i),children:"Export Format"}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("grid grid-cols-1 sm:grid-cols-2 gap-3",t==null?void 0:t.formatsGrid,i),children:[jsxRuntime.jsx(N,{icon:jsxRuntime.jsx("svg",{className:"w-5 h-5 text-red-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-3 7v-1h4v1h-4zm0-3v-1h4v1h-4zm-2-5h8v1H8v-1z"})}),label:"PDF",description:"Professional formatted document, ideal for publishing.",actionLabel:"Download PDF",loading:u,onClick:a,classNames:t,unstyled:i}),jsxRuntime.jsx(N,{icon:jsxRuntime.jsx("svg",{className:"w-5 h-5 text-blue-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-5 8v-5h1.5l1 3 1-3H13v5h-1v-3.5l-.75 2.25h-.5L10 13.5V17H9zm5-1.5h.75c.55 0 .75-.25.75-.75 0-.4-.2-.65-.75-.65H14V15.5zm1 1.5h-2v-4h2c1.1 0 1.75.6 1.75 1.5 0 .55-.25.95-.65 1.15.5.2.8.65.8 1.2 0 1-.65 1.65-1.9 1.65V17zm-.25-1c.6 0 .9-.25.9-.75 0-.45-.3-.75-.9-.75H14V16h.75z"})}),label:"DOCX",description:"Editable Word document for further customisation.",actionLabel:"Download DOCX",loading:v,onClick:b,classNames:t,unstyled:i}),jsxRuntime.jsx(N,{icon:jsxRuntime.jsxs("svg",{className:"w-5 h-5 text-orange-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 15H9V8h2v9zm4 0h-2V8h2v9z"}),jsxRuntime.jsx("path",{d:"M9.5 6.5h1v1h-1zm4 0h1v1h-1z"}),jsxRuntime.jsx("path",{d:"M5 5h14v2H5zm0 12h14v2H5z"})]}),label:"HTML",description:"Copy-ready HTML to embed on your website.",actionLabel:"Copy HTML",onClick:e,classNames:t,unstyled:i}),jsxRuntime.jsx(N,{icon:jsxRuntime.jsx("svg",{className:"w-5 h-5 ndpr-text-muted",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M3 5h18v2H3V5zm0 4h12v2H3V9zm0 4h18v2H3v-2zm0 4h12v2H3v-2z"})}),label:"Markdown",description:"Plain-text format for documentation or Git repos.",actionLabel:"Copy Markdown",onClick:d,classNames:t,unstyled:i})]})]})]})};var Ar=({sections:n,customSections:p,sectionOverrides:r,complianceResult:e,onEditSection:d,onAddCustomSection:t,onRemoveCustomSection:i,onReorderSection:u,onExportPDF:l,onExportDOCX:v,onExportHTML:C,onExportMarkdown:g,classNames:a,unstyled:b})=>{let[c,m]=Nr.useState(null),[B,J]=Nr.useState(false),Z=new Set(p.map(h=>h.id)),or=(h,F)=>{d(h,F),m(null);},er=n.length>0?Math.max(...n.map(h=>{var F;return (F=h.order)!=null?F:0}))+1:1;return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-review",className:chunkAME4HJR4_js.a("ndpr-form-section",a==null?void 0:a.root,b),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",a==null?void 0:a.heading,b),children:"Review & Export"}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-form-field__hint",a==null?void 0:a.subheading,b),children:"Review your generated policy sections, reorder or edit content, then export."})]}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("space-y-3",a==null?void 0:a.sectionList,b),"aria-live":"polite",children:n.map((h,F)=>jsxRuntime.jsx(Sr,{section:r[h.id]?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},h),{template:r[h.id]}):h,index:F,isCustom:Z.has(h.id),isEditing:c===h.id,editedContent:r[h.id],onEdit:()=>m(h.id),onSaveEdit:ir=>or(h.id,ir),onCancelEdit:()=>m(null),onMoveUp:F>0?()=>u(h.id,"up"):void 0,onMoveDown:F<n.length-1?()=>u(h.id,"down"):void 0,onDelete:Z.has(h.id)?()=>i(h.id):void 0,classNames:a,unstyled:b},h.id))}),!B&&jsxRuntime.jsxs("button",{type:"button",onClick:()=>J(true),className:chunkAME4HJR4_js.a("flex items-center gap-2 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",a==null?void 0:a.addSectionButton,b),children:[jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("w-5 h-5 rounded-full border-2 border-[rgb(var(--ndpr-primary))] flex items-center justify-center text-xs font-bold leading-none",a==null?void 0:a.addSectionIcon,b),"aria-hidden":"true",children:"+"}),"Add Custom Section"]}),B&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("space-y-2",a==null?void 0:a.customFormWrapper,b),children:[jsxRuntime.jsx(Lr,{onAdd:h=>{t(h),J(false);},nextOrder:er,classNames:a,unstyled:b}),jsxRuntime.jsx("button",{type:"button",onClick:()=>J(false),className:chunkAME4HJR4_js.a("text-sm ndpr-text-muted hover:underline",a==null?void 0:a.cancelCustomForm,b),children:"Cancel"})]}),jsxRuntime.jsx("hr",{className:chunkAME4HJR4_js.a("border-gray-200 dark:border-gray-700",a==null?void 0:a.divider,b)}),jsxRuntime.jsx(Er,{complianceResult:e,onExportPDF:l,onExportDOCX:v,onExportHTML:C,onExportMarkdown:g,classNames:a,unstyled:b})]})};var Tr={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"}},at={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},Ir=({score:n,maxScore:p,rating:r,classNames:e,unstyled:d})=>{var C,g;let t=p>0?Math.round(n/p*100):0,i=(C=Tr[r])!=null?C:Tr.not_compliant,u=36,l=2*Math.PI*u,v=l-t/100*l;return jsxRuntime.jsxs("div",{"data-ndpr-component":"compliance-score-ring",className:chunkAME4HJR4_js.a("flex flex-col items-center gap-2",e==null?void 0:e.root,d),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("relative w-24 h-24",e==null?void 0:e.svgWrapper,d),children:[jsxRuntime.jsxs("svg",{className:"w-24 h-24 -rotate-90",viewBox:"0 0 96 96","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{cx:"48",cy:"48",r:u,fill:"none",className:"stroke-gray-200 dark:stroke-gray-700",strokeWidth:"8"}),jsxRuntime.jsx("circle",{cx:"48",cy:"48",r:u,fill:"none",className:i.stroke,strokeWidth:"8",strokeLinecap:"round",strokeDasharray:l,strokeDashoffset:v,style:{transition:"stroke-dashoffset 0.5s ease-out"}})]}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("absolute inset-0 flex flex-col items-center justify-center",e==null?void 0:e.centerText,d),children:jsxRuntime.jsxs("span",{className:chunkAME4HJR4_js.a(`text-xl font-bold leading-none ${i.text}`,e==null?void 0:e.scoreValue,d),"aria-label":`${t}% compliance score`,children:[t,"%"]})})]}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a(`text-xs font-semibold text-center ${i.text}`,e==null?void 0:e.ratingLabel,d),children:(g=at[r])!=null?g:r}),jsxRuntime.jsxs("p",{className:chunkAME4HJR4_js.a("text-xs ndpr-text-muted text-center",e==null?void 0:e.scoreDetail,d),children:[n," / ",p," pts"]})]})};var bt={critical:"ndpr-text-destructive",important:"ndpr-text-warning",recommended:"ndpr-text-info"},_r=({gap:n,isPassed:p,onFix:r,classNames:e,unstyled:d})=>{let[t,i]=Nr.useState(false);return jsxRuntime.jsxs("div",{"data-ndpr-component":"compliance-requirement-item",className:chunkAME4HJR4_js.a("border-b border-gray-100 dark:border-gray-700 last:border-0 py-2",e==null?void 0:e.root,d),children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>!p&&i(u=>!u),className:chunkAME4HJR4_js.a("w-full flex items-start gap-2 text-left group",e==null?void 0:e.row,d),"aria-expanded":p?void 0:t,"aria-disabled":p,children:[jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a(["mt-0.5 flex-shrink-0 w-4 h-4 rounded-full flex items-center justify-center",p?"bg-green-500":n.severity==="critical"?"bg-red-500":n.severity==="important"?"bg-amber-500":"bg-blue-400"].join(" "),e==null?void 0:e.statusIcon,d),"aria-hidden":"true",children:p?jsxRuntime.jsx("svg",{className:"w-2.5 h-2.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):jsxRuntime.jsx("svg",{className:"w-2.5 h-2.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-1",children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a(`text-xs font-medium ${p?"ndpr-text-muted":"ndpr-text-foreground"}`,e==null?void 0:e.requirementLabel,d),children:n.requirement}),!p&&jsxRuntime.jsx("svg",{className:`flex-shrink-0 w-3 h-3 text-gray-400 transition-transform ${t?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),jsxRuntime.jsxs("p",{className:chunkAME4HJR4_js.a("text-xs text-gray-400 dark:text-gray-500 mt-0.5",e==null?void 0:e.ndpaSection,d),children:["NDPA ",n.ndpaSection]})]})]}),!p&&t&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("mt-2 ml-6 space-y-2",e==null?void 0:e.detail,d),children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a(`text-xs ${bt[n.severity]}`,e==null?void 0:e.message,d),children:n.message}),jsxRuntime.jsx("button",{type:"button",onClick:()=>{r(n.requirementId),i(false);},className:chunkAME4HJR4_js.a("text-xs font-medium px-3 py-1 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))]",e==null?void 0:e.fixButton,d),children:n.fixLabel})]})]})};function ft(n,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=n.map(t=>({gap:t,isPassed:false})),d={critical:0,important:1,recommended:2};return e.sort((t,i)=>d[t.gap.severity]-d[i.gap.severity]),[...e,...r]}var Mr=({complianceResult:n,onFix:p,classNames:r,unstyled:e})=>{let[d,t]=Nr.useState(false),i=ft(n.gaps,n.passed);return jsxRuntime.jsxs("aside",{"data-ndpr-component":"compliance-checker-sidebar",className:chunkAME4HJR4_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",r==null?void 0:r.root,e),"aria-label":"NDPA compliance checker",children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/50",r==null?void 0:r.header,e),children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",r==null?void 0:r.title,e),children:"NDPA Compliance"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>t(u=>!u),className:chunkAME4HJR4_js.a("p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",r==null?void 0:r.collapseButton,e),"aria-expanded":!d,"aria-label":d?"Expand compliance checker":"Collapse compliance checker",children:jsxRuntime.jsx("svg",{className:`w-4 h-4 transition-transform ${d?"-rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})})]}),!d&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("p-4 space-y-4",r==null?void 0:r.body,e),children:[jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("flex justify-center",r==null?void 0:r.ringWrapper,e),children:jsxRuntime.jsx(Ir,{score:n.score,maxScore:n.maxScore,rating:n.rating,classNames:r,unstyled:e})}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("grid grid-cols-3 gap-2 text-center",r==null?void 0:r.statsRow,e),children:[{count:n.gaps.filter(u=>u.severity==="critical").length,label:"Critical",color:"ndpr-text-destructive"},{count:n.gaps.filter(u=>u.severity==="important").length,label:"Important",color:"ndpr-text-warning"},{count:n.passed.length,label:"Passed",color:"ndpr-text-success"}].map(({count:u,label:l,color:v})=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a(`text-base font-bold ${v}`,r==null?void 0:r.statValue,e),children:u}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-form-field__hint",r==null?void 0:r.statLabel,e),children:l})]},l))}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("overflow-y-auto max-h-80",r==null?void 0:r.requirementsList,e),children:i.length===0?jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-empty-state",r==null?void 0:r.emptyState,e),children:"No requirements to display."}):i.map(({gap:u,isPassed:l})=>jsxRuntime.jsx(_r,{gap:u,isPassed:l,onFix:p,classNames:r,unstyled:e},u.requirementId))})]})]})};function xt(n){let p=Date.now()-n;return p<1e4?"just now":p<6e4?`${Math.floor(p/1e3)}s ago`:p<36e5?`${Math.floor(p/6e4)}m ago`:new Date(n).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}var zr=({lastSavedAt:n,isSaving:p,hasError:r,classNames:e,unstyled:d})=>{let t="idle";if(p?t="saving":r?t="error":n!==null&&(t="saved"),t==="idle")return null;let i=t==="saving"?"Saving\u2026":t==="error"?"Unable to save":`Draft saved ${n?xt(n):""}`;return jsxRuntime.jsxs("div",{"data-ndpr-component":"draft-save-indicator",role:"status","aria-live":"polite","aria-atomic":"true",className:chunkAME4HJR4_js.a(`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,d),children:[t==="saving"&&jsxRuntime.jsxs("svg",{className:"animate-spin w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),t==="saved"&&jsxRuntime.jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),t==="error"&&jsxRuntime.jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})}),jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("text-xs font-medium",e==null?void 0:e.text,d),children:i})]})};var _o=({adapter:n,onComplete:p,classNames:r,unstyled:e,initialContext:d})=>{var vr,br,lr;let t=chunkI5ZDNSX5_js.c(),i=(vr=t.policy.wizardTitle)!=null?vr:"Privacy Policy Builder",u=(br=t.common.back)!=null?br:"Back",l=(lr=t.common.next)!=null?lr:"Next",{currentStep:v,nextStep:C,prevStep:g,canProceed:a,context:b,updateOrg:c,updateContext:m,toggleDataCategory:B,togglePurpose:J,addProcessor:Z,removeProcessor:or,sections:er,customSections:h,sectionOverrides:F,editSectionContent:ir,addCustomSection:jr,removeCustomSection:qr,reorderSections:Or,complianceResult:ar,applyFix:Hr,handleExportPDF:Wr,handleExportDOCX:Gr,handleExportHTML:Ur,handleExportMarkdown:Vr,lastSavedAt:Xr,isLoading:Yr}=chunkQHW4UKGJ_js.a({adapter:n,onComplete:p,initialContext:d}),nr=(D,K)=>{let O=URL.createObjectURL(D),H=document.createElement("a");H.href=O,H.download=K,H.click(),URL.revokeObjectURL(O);},Jr=()=>chunkRFPLZDIO_js.d(null,null,function*(){let D=yield Wr();nr(D,"privacy-policy.pdf");}),Kr=()=>chunkRFPLZDIO_js.d(null,null,function*(){let D=yield Gr();nr(D,"privacy-policy.docx");}),Qr=()=>{let D=Ur();navigator.clipboard.writeText(D).catch(()=>{let K=new Blob([D],{type:"text/html"}),O=URL.createObjectURL(K),H=window.open(O,"_blank");H?H.addEventListener("load",()=>URL.revokeObjectURL(O)):URL.revokeObjectURL(O);});},Zr=()=>{let D=Vr();navigator.clipboard.writeText(D).catch(()=>{let K=new Blob([D],{type:"text/markdown"});nr(K,"privacy-policy.md");});};return Yr?jsxRuntime.jsxs("div",{"data-ndpr-component":"adaptive-policy-wizard",className:chunkAME4HJR4_js.a("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:[jsxRuntime.jsxs("svg",{className:"animate-spin w-6 h-6 mr-2",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),jsxRuntime.jsx("span",{className:"ndpr-text-sm",children:"Loading\u2026"})]}):jsxRuntime.jsx("div",{"data-ndpr-component":"adaptive-policy-wizard",className:chunkAME4HJR4_js.a("min-h-screen bg-gray-50 dark:bg-gray-900",r==null?void 0:r.root,e),children:jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",r==null?void 0:r.container,e),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center justify-between mb-6",r==null?void 0:r.topBar,e),children:[jsxRuntime.jsx("h1",{className:chunkAME4HJR4_js.a("text-2xl font-bold ndpr-text-foreground",r==null?void 0:r.wizardTitle,e),children:i}),jsxRuntime.jsx(zr,{lastSavedAt:Xr,isSaving:false,hasError:false,classNames:r,unstyled:e})]}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg px-4 mb-6",r==null?void 0:r.stepIndicatorWrapper,e),children:jsxRuntime.jsx(yr,{currentStep:v,classNames:r,unstyled:e})}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex flex-col lg:flex-row gap-6 items-start",r==null?void 0:r.panels,e),children:[jsxRuntime.jsxs("main",{"aria-live":"polite",className:chunkAME4HJR4_js.a("flex-1 min-w-0 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-6",r==null?void 0:r.mainPanel,e),children:[v===1&&jsxRuntime.jsx(Cr,{context:b,onUpdateOrg:c,classNames:r,unstyled:e}),v===2&&jsxRuntime.jsx(kr,{categories:b.dataCategories,onToggle:B,classNames:r,unstyled:e}),v===3&&jsxRuntime.jsx(Pr,{context:b,onTogglePurpose:J,onUpdateContext:m,onAddProcessor:Z,onRemoveProcessor:or,classNames:r,unstyled:e}),v===4&&jsxRuntime.jsx(Ar,{sections:er,customSections:h,sectionOverrides:F,complianceResult:ar,onEditSection:ir,onAddCustomSection:jr,onRemoveCustomSection:qr,onReorderSection:Or,onExportPDF:Jr,onExportDOCX:Kr,onExportHTML:Qr,onExportMarkdown:Zr,classNames:r,unstyled:e}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center justify-between mt-8 pt-4 border-t border-gray-200 dark:border-gray-700",r==null?void 0:r.navigation,e),children:[jsxRuntime.jsx("button",{type:"button",onClick:g,disabled:v===1,className:chunkAME4HJR4_js.a("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:u}),jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:jsxRuntime.jsxs("span",{className:chunkAME4HJR4_js.a("ndpr-form-field__hint",r==null?void 0:r.stepCounter,e),children:["Step ",v," of 4"]})}),v<4?jsxRuntime.jsx("button",{type:"button",onClick:C,disabled:!a,className:chunkAME4HJR4_js.a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed transition-colors",r==null?void 0:r.nextButton,e),children:l}):jsxRuntime.jsx("span",{})]})]}),jsxRuntime.jsx("aside",{className:chunkAME4HJR4_js.a("w-full lg:w-80 flex-shrink-0",r==null?void 0:r.sidebarWrapper,e),children:jsxRuntime.jsx(Mr,{complianceResult:ar,onFix:Hr,classNames:r,unstyled:e})})]})]})})};
|
|
2
2
|
exports.a=_o;
|