@tantainnovative/ndpr-toolkit 3.10.2 → 3.10.4

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.
Files changed (107) hide show
  1. package/CHANGELOG.md +86 -0
  2. package/README.md +16 -16
  3. package/dist/breach.js +1 -1
  4. package/dist/breach.mjs +1 -1
  5. package/dist/{chunk-EEQALYOY.mjs → chunk-25TNTLHJ.mjs} +1 -1
  6. package/dist/{chunk-GTYXVAJX.mjs → chunk-43OQNS2J.mjs} +3 -3
  7. package/dist/chunk-5EKQX6GM.mjs +1 -0
  8. package/dist/{chunk-W7OLQRJP.js → chunk-6GM2PBTF.js} +1 -1
  9. package/dist/{chunk-Q64735OC.js → chunk-6LJHLE6G.js} +8 -8
  10. package/dist/{chunk-TMXK4QKK.mjs → chunk-6N5SJO4T.mjs} +1 -1
  11. package/dist/{chunk-EFIBHKQE.mjs → chunk-7RBO42IW.mjs} +1 -1
  12. package/dist/{chunk-RMQ7OLNY.mjs → chunk-BIJSMSUU.mjs} +8 -8
  13. package/dist/chunk-CNM6G5IA.js +1 -0
  14. package/dist/{chunk-UKLU6BQF.mjs → chunk-CWY2FMIC.mjs} +1 -1
  15. package/dist/{chunk-LVGT3DLT.js → chunk-D2ZKDQVL.js} +1 -1
  16. package/dist/chunk-D3DVVJCT.js +1 -0
  17. package/dist/{chunk-V3RYHNHN.js → chunk-EKNWO4DK.js} +1 -1
  18. package/dist/chunk-FMJ6ICLJ.js +1 -0
  19. package/dist/{chunk-R7545FP4.mjs → chunk-GEP52QFH.mjs} +1 -1
  20. package/dist/chunk-IPWX5I5P.mjs +2 -0
  21. package/dist/chunk-IVSNHT24.mjs +0 -0
  22. package/dist/{chunk-N3MQQUQP.js → chunk-JS7SYL5P.js} +0 -0
  23. package/dist/chunk-JWAN5J4Y.js +1 -0
  24. package/dist/{chunk-2MIQXECH.mjs → chunk-KE2FZH2V.mjs} +1 -1
  25. package/dist/chunk-KY6WYHWB.mjs +2 -0
  26. package/dist/{chunk-XO3VQYTL.js → chunk-M6VSZEFM.js} +2 -2
  27. package/dist/chunk-MOHBL6LX.mjs +1 -0
  28. package/dist/{chunk-EFIWANHF.mjs → chunk-MTSZ7GL6.mjs} +1 -1
  29. package/dist/{chunk-Y3MKMAFQ.mjs → chunk-NBQQ2GN3.mjs} +1 -1
  30. package/dist/{chunk-UAV7V4EM.js → chunk-NDKDKDDX.js} +1 -1
  31. package/dist/{chunk-3GRGYT3P.js → chunk-NUOHT3LO.js} +1 -1
  32. package/dist/chunk-O2RDZGM2.js +2 -0
  33. package/dist/{chunk-LTPSN2SU.mjs → chunk-OLEUIYE2.mjs} +1 -1
  34. package/dist/{chunk-HXWHL4BD.js → chunk-QHW4UKGJ.js} +2 -2
  35. package/dist/{chunk-HWHBINVN.mjs → chunk-RBMLGRDN.mjs} +1 -1
  36. package/dist/{chunk-Z763UI5U.js → chunk-RC3XFXTJ.js} +1 -1
  37. package/dist/{chunk-QPRYXVH2.js → chunk-RDALAH3Y.js} +1 -1
  38. package/dist/{chunk-I3Y4LOSL.js → chunk-SSH4U4TJ.js} +3 -3
  39. package/dist/{chunk-ATFUSHC2.mjs → chunk-TDHH7GS2.mjs} +1 -1
  40. package/dist/chunk-TWJHEIQH.js +2 -0
  41. package/dist/{chunk-XS3Z4UT7.js → chunk-US2VGJ7I.js} +1 -1
  42. package/dist/{chunk-VYAL2TGT.mjs → chunk-UVXS7KRV.mjs} +1 -1
  43. package/dist/{chunk-7IFSWCQP.js → chunk-WKTKTLMF.js} +1 -1
  44. package/dist/chunk-WYH3OA5L.mjs +1 -0
  45. package/dist/consent.js +1 -1
  46. package/dist/consent.mjs +1 -1
  47. package/dist/core.d.mts +2 -2
  48. package/dist/core.d.ts +2 -2
  49. package/dist/core.js +1 -1
  50. package/dist/core.mjs +1 -1
  51. package/dist/cross-border-lite.js +1 -1
  52. package/dist/cross-border-lite.mjs +1 -1
  53. package/dist/cross-border.d.mts +3 -3
  54. package/dist/cross-border.d.ts +3 -3
  55. package/dist/cross-border.js +1 -1
  56. package/dist/cross-border.mjs +1 -1
  57. package/dist/dpia.d.mts +3 -3
  58. package/dist/dpia.d.ts +3 -3
  59. package/dist/dsr.d.mts +1 -1
  60. package/dist/dsr.d.ts +1 -1
  61. package/dist/dsr.js +1 -1
  62. package/dist/dsr.mjs +1 -1
  63. package/dist/headless.d.mts +3 -3
  64. package/dist/headless.d.ts +3 -3
  65. package/dist/headless.js +1 -1
  66. package/dist/headless.mjs +1 -1
  67. package/dist/hooks.d.mts +3 -3
  68. package/dist/hooks.d.ts +3 -3
  69. package/dist/hooks.js +1 -1
  70. package/dist/hooks.mjs +1 -1
  71. package/dist/index.d.mts +7 -7
  72. package/dist/index.d.ts +7 -7
  73. package/dist/index.js +1 -1
  74. package/dist/index.mjs +1 -1
  75. package/dist/policy.js +1 -1
  76. package/dist/policy.mjs +1 -1
  77. package/dist/presets-consent.js +1 -1
  78. package/dist/presets-consent.mjs +1 -1
  79. package/dist/presets-dsr.js +1 -1
  80. package/dist/presets-dsr.mjs +1 -1
  81. package/dist/presets-policy.js +1 -1
  82. package/dist/presets-policy.mjs +1 -1
  83. package/dist/presets.d.mts +1 -1
  84. package/dist/presets.d.ts +1 -1
  85. package/dist/presets.js +1 -1
  86. package/dist/presets.mjs +1 -1
  87. package/dist/server.d.mts +2 -2
  88. package/dist/server.d.ts +2 -2
  89. package/dist/server.js +1 -1
  90. package/dist/server.mjs +1 -1
  91. package/dist/unstyled.d.mts +1 -1
  92. package/dist/unstyled.d.ts +1 -1
  93. package/dist/unstyled.js +1 -1
  94. package/dist/unstyled.mjs +1 -1
  95. package/package.json +34 -1
  96. package/dist/chunk-4QXTB3L6.js +0 -1
  97. package/dist/chunk-5IOC3VAW.js +0 -1
  98. package/dist/chunk-732C2EVN.js +0 -1
  99. package/dist/chunk-AOHKVFAS.mjs +0 -322
  100. package/dist/chunk-BFAX7JQA.mjs +0 -1
  101. package/dist/chunk-LQTARVPU.mjs +0 -1
  102. package/dist/chunk-RYREGZVQ.js +0 -1
  103. package/dist/chunk-S6COXIZA.js +0 -2
  104. package/dist/chunk-W47OSMT6.js +0 -2
  105. package/dist/chunk-W65ZWTLD.mjs +0 -1
  106. package/dist/chunk-XJO4DH3L.mjs +0 -2
  107. package/dist/chunk-ZHFLBL63.mjs +0 -2
@@ -1 +1 @@
1
- import {e,d}from'./chunk-RMQ7OLNY.mjs';import {b,a as a$1}from'./chunk-ZJYULEER.mjs';var x={saas:{id:"saas",label:"SaaS / B2B Software",description:"Multi-tenant cloud software. Account credentials, usage analytics, cross-border transfer to the SaaS vendor, automated processing for features like spam filtering or fraud scoring.",examples:["team collaboration tools","CRM","developer tools","workflow automation"]},ecommerce:{id:"ecommerce",label:"Ecommerce / Online Store",description:"Online retail. Customer identity, payment data, shipping address, cart abandonment cookies, marketing analytics, third-party payment processors.",examples:["online retail","D2C brand","marketplace","food delivery"]},school:{id:"school",label:"School / Education",description:"Educational institution or edtech platform. Student data including minors (NDPA Section 31 \u2014 parental consent required), academic records, attendance, behavioural data for learning analytics.",examples:["K-12 school","edtech app","tutoring platform","online courses"]},healthcare:{id:"healthcare",label:"Healthcare / HealthTech",description:"Medical practice, hospital, telemedicine, or health insurance. Sensitive personal data (NDPA Section 30 \u2014 medical), prescription history, insurance claims, biometric data.",examples:["hospital","telemedicine","pharmacy","health insurance"]},procurement:{id:"procurement",label:"Procurement / B2G",description:"Government procurement, vendor management, public-sector bidding. Vendor company data, tax IDs, beneficial-owner information, contract records, sometimes politically-exposed-person (PEP) data.",examples:["e-procurement portal","vendor registry","government supplier database"]}},a={fullName:"full-name",contactDetails:"contact-details",govIds:"government-ids",credentials:"account-credentials",payment:"payment-info",financialRecords:"financial-records",bvn:"bvn",device:"device-info",usage:"usage-data",location:"location-data",cookies:"cookies",health:"health-data",biometric:"biometric-data",children:"children"};function s(e){let t=new Set(e);return d.map(r=>b(a$1({},r),{selected:t.has(r.id)}))}function h(e,t){var r,c,l,d,p,m;return t?b(a$1({},e),{org:b(a$1({},e.org),{name:(r=t.orgName)!=null?r:e.org.name,website:(c=t.website)!=null?c:e.org.website,privacyEmail:(l=t.privacyEmail)!=null?l:e.org.privacyEmail,address:(d=t.address)!=null?d:e.org.address,dpoName:(p=t.dpoName)!=null?p:e.org.dpoName,dpoEmail:(m=t.dpoEmail)!=null?m:e.org.dpoEmail})}):e}var f=["service_delivery","analytics","marketing","fraud_prevention"],y=["service_delivery","marketing","analytics","fraud_prevention","legal_compliance"],v=["service_delivery","analytics","legal_compliance"],C=["service_delivery","legal_compliance","research"],T=["service_delivery","legal_compliance","fraud_prevention"];function P(){let e$1=e();return e$1.org.industry="saas",e$1.org.orgSize="startup",e$1.dataCategories=s([a.fullName,a.contactDetails,a.credentials,a.device,a.usage,a.cookies]),e$1.purposes=f,e$1.hasChildrenData=false,e$1.hasSensitiveData=false,e$1.hasFinancialData=false,e$1.hasCrossBorderTransfer=true,e$1.hasAutomatedDecisions=false,e$1}function S(){let e$1=e();return e$1.org.industry="ecommerce",e$1.org.orgSize="midsize",e$1.dataCategories=s([a.fullName,a.contactDetails,a.payment,a.financialRecords,a.device,a.usage,a.location,a.cookies]),e$1.purposes=y,e$1.hasChildrenData=false,e$1.hasSensitiveData=false,e$1.hasFinancialData=true,e$1.hasCrossBorderTransfer=true,e$1.hasAutomatedDecisions=true,e$1}function D(){let e$1=e();return e$1.org.industry="education",e$1.org.orgSize="midsize",e$1.dataCategories=s([a.fullName,a.contactDetails,a.govIds,a.credentials,a.usage,a.cookies,a.children]),e$1.purposes=v,e$1.hasChildrenData=true,e$1.hasSensitiveData=false,e$1.hasFinancialData=false,e$1.hasCrossBorderTransfer=false,e$1.hasAutomatedDecisions=false,e$1}function E(){let e$1=e();return e$1.org.industry="healthcare",e$1.org.orgSize="enterprise",e$1.dataCategories=s([a.fullName,a.contactDetails,a.govIds,a.payment,a.health,a.biometric]),e$1.purposes=C,e$1.hasChildrenData=false,e$1.hasSensitiveData=true,e$1.hasFinancialData=true,e$1.hasCrossBorderTransfer=false,e$1.hasAutomatedDecisions=false,e$1}function O(){let e$1=e();return e$1.org.industry="government",e$1.org.orgSize="enterprise",e$1.dataCategories=s([a.fullName,a.contactDetails,a.govIds,a.financialRecords,a.bvn]),e$1.purposes=T,e$1.hasChildrenData=false,e$1.hasSensitiveData=false,e$1.hasFinancialData=true,e$1.hasCrossBorderTransfer=false,e$1.hasAutomatedDecisions=false,e$1}var g={saas:P,ecommerce:S,school:D,healthcare:E,procurement:O};function _(e,t){let r=g[e];if(!r)throw new Error(`[ndpr-toolkit] Unknown org template id: ${String(e)}. Expected one of: ${Object.keys(g).join(", ")}.`);return h(r(),t)}export{x as a,_ as b};
1
+ import {e,d}from'./chunk-BIJSMSUU.mjs';import {b,a as a$1}from'./chunk-ZJYULEER.mjs';var x={saas:{id:"saas",label:"SaaS / B2B Software",description:"Multi-tenant cloud software. Account credentials, usage analytics, cross-border transfer to the SaaS vendor, automated processing for features like spam filtering or fraud scoring.",examples:["team collaboration tools","CRM","developer tools","workflow automation"]},ecommerce:{id:"ecommerce",label:"Ecommerce / Online Store",description:"Online retail. Customer identity, payment data, shipping address, cart abandonment cookies, marketing analytics, third-party payment processors.",examples:["online retail","D2C brand","marketplace","food delivery"]},school:{id:"school",label:"School / Education",description:"Educational institution or edtech platform. Student data including minors (NDPA Section 31 \u2014 parental consent required), academic records, attendance, behavioural data for learning analytics.",examples:["K-12 school","edtech app","tutoring platform","online courses"]},healthcare:{id:"healthcare",label:"Healthcare / HealthTech",description:"Medical practice, hospital, telemedicine, or health insurance. Sensitive personal data (NDPA Section 30 \u2014 medical), prescription history, insurance claims, biometric data.",examples:["hospital","telemedicine","pharmacy","health insurance"]},procurement:{id:"procurement",label:"Procurement / B2G",description:"Government procurement, vendor management, public-sector bidding. Vendor company data, tax IDs, beneficial-owner information, contract records, sometimes politically-exposed-person (PEP) data.",examples:["e-procurement portal","vendor registry","government supplier database"]}},a={fullName:"full-name",contactDetails:"contact-details",govIds:"government-ids",credentials:"account-credentials",payment:"payment-info",financialRecords:"financial-records",bvn:"bvn",device:"device-info",usage:"usage-data",location:"location-data",cookies:"cookies",health:"health-data",biometric:"biometric-data",children:"children"};function s(e){let t=new Set(e);return d.map(r=>b(a$1({},r),{selected:t.has(r.id)}))}function h(e,t){var r,c,l,d,p,m;return t?b(a$1({},e),{org:b(a$1({},e.org),{name:(r=t.orgName)!=null?r:e.org.name,website:(c=t.website)!=null?c:e.org.website,privacyEmail:(l=t.privacyEmail)!=null?l:e.org.privacyEmail,address:(d=t.address)!=null?d:e.org.address,dpoName:(p=t.dpoName)!=null?p:e.org.dpoName,dpoEmail:(m=t.dpoEmail)!=null?m:e.org.dpoEmail})}):e}var f=["service_delivery","analytics","marketing","fraud_prevention"],y=["service_delivery","marketing","analytics","fraud_prevention","legal_compliance"],v=["service_delivery","analytics","legal_compliance"],C=["service_delivery","legal_compliance","research"],T=["service_delivery","legal_compliance","fraud_prevention"];function P(){let e$1=e();return e$1.org.industry="saas",e$1.org.orgSize="startup",e$1.dataCategories=s([a.fullName,a.contactDetails,a.credentials,a.device,a.usage,a.cookies]),e$1.purposes=f,e$1.hasChildrenData=false,e$1.hasSensitiveData=false,e$1.hasFinancialData=false,e$1.hasCrossBorderTransfer=true,e$1.hasAutomatedDecisions=false,e$1}function S(){let e$1=e();return e$1.org.industry="ecommerce",e$1.org.orgSize="midsize",e$1.dataCategories=s([a.fullName,a.contactDetails,a.payment,a.financialRecords,a.device,a.usage,a.location,a.cookies]),e$1.purposes=y,e$1.hasChildrenData=false,e$1.hasSensitiveData=false,e$1.hasFinancialData=true,e$1.hasCrossBorderTransfer=true,e$1.hasAutomatedDecisions=true,e$1}function D(){let e$1=e();return e$1.org.industry="education",e$1.org.orgSize="midsize",e$1.dataCategories=s([a.fullName,a.contactDetails,a.govIds,a.credentials,a.usage,a.cookies,a.children]),e$1.purposes=v,e$1.hasChildrenData=true,e$1.hasSensitiveData=false,e$1.hasFinancialData=false,e$1.hasCrossBorderTransfer=false,e$1.hasAutomatedDecisions=false,e$1}function E(){let e$1=e();return e$1.org.industry="healthcare",e$1.org.orgSize="enterprise",e$1.dataCategories=s([a.fullName,a.contactDetails,a.govIds,a.payment,a.health,a.biometric]),e$1.purposes=C,e$1.hasChildrenData=false,e$1.hasSensitiveData=true,e$1.hasFinancialData=true,e$1.hasCrossBorderTransfer=false,e$1.hasAutomatedDecisions=false,e$1}function O(){let e$1=e();return e$1.org.industry="government",e$1.org.orgSize="enterprise",e$1.dataCategories=s([a.fullName,a.contactDetails,a.govIds,a.financialRecords,a.bvn]),e$1.purposes=T,e$1.hasChildrenData=false,e$1.hasSensitiveData=false,e$1.hasFinancialData=true,e$1.hasCrossBorderTransfer=false,e$1.hasAutomatedDecisions=false,e$1}var g={saas:P,ecommerce:S,school:D,healthcare:E,procurement:O};function _(e,t){let r=g[e];if(!r)throw new Error(`[ndpr-toolkit] Unknown org template id: ${String(e)}. Expected one of: ${Object.keys(g).join(", ")}.`);return h(r(),t)}export{x as a,_ as b};
@@ -1,4 +1,4 @@
1
- 'use strict';var chunkQ64735OC_js=require('./chunk-Q64735OC.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js');function s(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function q(e){let n=new Set,o=new RegExp(`${s(chunkQ64735OC_js.a)}([^${s("\xBB")}]+)${s("\xBB")}`,"g"),i;for(;(i=o.exec(e))!==null;)n.add(i[1].trim());let r=/\{\{\s*([^}\s]+)\s*\}\}/g;for(;(i=r.exec(e))!==null;)n.add(i[1].trim());return Array.from(n)}function P(e,n){if(typeof e=="string"){let o=e,i=n,r=o,c=/\{\{([^}]+)\}\}/g,d;for(;(d=c.exec(o))!==null;){let t=d[1].trim(),a=i[t]||"";r=r.replace(new RegExp(`\\{\\{\\s*${s(t)}\\s*\\}\\}`,"g"),a);}return r}else {let o=e,i=n,r={},c=[];return o.filter(t=>t.included).sort((t,a)=>(t.order||0)-(a.order||0)).forEach(t=>{let a=t.template||t.customContent||t.defaultContent||"",y=/\{\{([^}]+)\}\}/g,m,h=[];for(;(m=y.exec(a))!==null;)h.push(m[1].trim());h.forEach(l=>{let u="";l in i&&(u=i[l]||""),u||c.push(l),a=a.replace(new RegExp(`\\{\\{\\s*${s(l)}\\s*\\}\\}`,"g"),u);}),r[t.id]=a;}),{fullText:Object.values(r).join(`
1
+ 'use strict';var chunk6LJHLE6G_js=require('./chunk-6LJHLE6G.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js');function s(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function q(e){let n=new Set,o=new RegExp(`${s(chunk6LJHLE6G_js.a)}([^${s("\xBB")}]+)${s("\xBB")}`,"g"),i;for(;(i=o.exec(e))!==null;)n.add(i[1].trim());let r=/\{\{\s*([^}\s]+)\s*\}\}/g;for(;(i=r.exec(e))!==null;)n.add(i[1].trim());return Array.from(n)}function P(e,n){if(typeof e=="string"){let o=e,i=n,r=o,c=/\{\{([^}]+)\}\}/g,d;for(;(d=c.exec(o))!==null;){let t=d[1].trim(),a=i[t]||"";r=r.replace(new RegExp(`\\{\\{\\s*${s(t)}\\s*\\}\\}`,"g"),a);}return r}else {let o=e,i=n,r={},c=[];return o.filter(t=>t.included).sort((t,a)=>(t.order||0)-(a.order||0)).forEach(t=>{let a=t.template||t.customContent||t.defaultContent||"",y=/\{\{([^}]+)\}\}/g,m,h=[];for(;(m=y.exec(a))!==null;)h.push(m[1].trim());h.forEach(l=>{let u="";l in i&&(u=i[l]||""),u||c.push(l),a=a.replace(new RegExp(`\\{\\{\\s*${s(l)}\\s*\\}\\}`,"g"),u);}),r[t.id]=a;}),{fullText:Object.values(r).join(`
2
2
 
3
3
  `),sectionTexts:r,missingVariables:Array.from(new Set(c))}}}var w=[{id:"data-collection",title:"Data Collection",description:"Describes what personal data is collected and how it is obtained.",order:1,required:true,included:true,template:'{{orgName}} ("we", "us", or "our") collects personal data from users of our services at {{website}}. We collect information you provide directly, such as your name, email address, phone number, and any other details you submit through forms or communications. We may also collect data automatically, including IP addresses, browser type, device information, and usage patterns through cookies and similar technologies. All data collection is conducted in accordance with the Nigeria Data Protection Act (NDPA) 2023.',variables:["orgName","website"]},{id:"legal-basis",title:"Legal Basis for Processing",description:"Specifies the lawful basis for processing personal data under the NDPA.",order:2,required:true,included:true,template:`{{orgName}} processes personal data under one or more of the following lawful bases as prescribed by the NDPA 2023:
4
4
 
@@ -0,0 +1 @@
1
+ 'use strict';var chunkL2VO3MEJ_js=require('./chunk-L2VO3MEJ.js'),chunkNDKDKDDX_js=require('./chunk-NDKDKDDX.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react'),reactDom=require('react-dom'),jsxRuntime=require('react/jsx-runtime');var Vn=({options:d,onSave:bn,title:A,description:y,acceptAllButtonText:P,rejectAllButtonText:E,customizeButtonText:D,saveButtonText:z,position:pn="bottom",variant:a="bar",zIndex:x=9999,version:C="1.0",show:h,manageStorage:L=true,storageKey:w="ndpr_consent",className:V="",buttonClassName:j="",primaryButtonClassName:ln="",secondaryButtonClassName:fn="",classNames:n,unstyled:o,onAnalytics:k})=>{var U,X,Z,T,m,N,nn,tn,en;let c=chunkNDKDKDDX_js.c(),gn=(U=A!=null?A:c.consent.title)!=null?U:"We Value Your Privacy",vn=(X=y!=null?y:c.consent.description)!=null?X:"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.",_n=(Z=P!=null?P:c.consent.acceptAll)!=null?Z:"Accept All",Cn=(T=E!=null?E:c.consent.rejectAll)!=null?T:"Reject All",hn=(m=D!=null?D:c.consent.customize)!=null?m:"Customize",an=(N=z!=null?z:c.consent.savePreferences)!=null?N:"Save Preferences",kn=(nn=c.consent.selectAll)!=null?nn:"Select All",Sn=(tn=c.consent.deselectAll)!=null?tn:"Deselect All",[b,u]=react.useState(false),[f,I]=react.useState(false),[S,B]=react.useState({}),[s,Bn]=react.useState(false),Rn=chunkL2VO3MEJ_js.a({active:b}),$=react.useRef(null),q=react.useRef(false);react.useEffect(()=>{Bn(true);},[]);let p=react.useCallback((t,e)=>{k==null||k(chunkRFPLZDIO_js.a({action:t,timestamp:Date.now(),version:C},e!==void 0?{categories:e}:{}));},[k,C]);react.useEffect(()=>{let t={};if(d.forEach(e=>{t[e.id]=e.defaultValue||false;}),B(t),h===void 0)if(!L)u(true);else {let e=localStorage.getItem(w);if(e)try{JSON.parse(e).version!==C?u(!0):u(!1);}catch(G){u(true);}else u(true);}else u(h);},[d,w,C,L]),react.useEffect(()=>{h!==void 0&&u(h);},[h]);let An=()=>{let t={};d.forEach(e=>{t[e.id]=true;}),p("accepted_all",t),H(t);},J=()=>{let t={};d.forEach(e=>{t[e.id]=e.required||false;}),p("rejected_all",t),H(t);},yn=(t,e)=>{B(G=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},G),{[t]:e}));},Pn=()=>{let t={};d.forEach(e=>{t[e.id]=true;}),B(t);},En=()=>{let t={};d.forEach(e=>{t[e.id]=e.required||false;}),B(t);},W=d.length>0&&d.every(t=>S[t.id]),Dn=()=>{p("customized",S),H(S);},H=t=>{let e={consents:t,timestamp:Date.now(),version:C,method:f?"customize":"banner",hasInteracted:true};L&&localStorage.setItem(w,JSON.stringify(e)),bn(e),u(false),I(false);};if(react.useEffect(()=>{if(!b)return;let t=e=>{e.key==="Escape"&&(p("dismissed"),J());};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[b,p,d,f]),react.useEffect(()=>{b&&!q.current&&(q.current=true,p("shown")),b||(q.current=false);},[b,p]),react.useEffect(()=>{if(f&&$.current){let t=$.current;t.style.maxHeight="0px",t.style.opacity="0",t.offsetHeight,t.style.maxHeight=`${t.scrollHeight}px`,t.style.opacity="1";}},[f]),!b)return null;let g=a==="modal"?"center":pn,Y=g==="inline",O=g==="center",v=["ndpr-consent-banner"];a!=="bar"&&v.push(`ndpr-consent-banner--${a}`),g==="top"?v.push("ndpr-consent-banner--top"):g==="bottom"?v.push("ndpr-consent-banner--bottom"):g==="inline"&&v.push("ndpr-consent-banner--inline"),V&&v.push(V);let zn=v.join(" "),K=`ndpr-consent-banner__button ndpr-consent-banner__button--primary ${j} ${ln}`.trim(),Ln=`ndpr-consent-banner__button ndpr-consent-banner__button--secondary ${j} ${fn}`.trim(),wn=`ndpr-consent-banner__button ndpr-consent-banner__button--ghost ${j}`.trim(),jn=(n==null?void 0:n.primaryButton)||(n==null?void 0:n.acceptButton)||K,Q=(n==null?void 0:n.secondaryButton)||(n==null?void 0:n.rejectButton)||Ln,In=(n==null?void 0:n.customizeButton)||wn,$n=(n==null?void 0:n.saveButton)||K,F=jsxRuntime.jsx("div",{ref:Rn,tabIndex:-1,"data-ndpr-component":"consent-banner","data-ndpr-variant":a,"data-ndpr-position":g,className:chunkAME4HJR4_js.a(zn,n==null?void 0:n.root,o),style:!Y&&!O?{zIndex:x}:void 0,role:"dialog","aria-modal":O||void 0,"aria-labelledby":"consent-banner-title","aria-describedby":"consent-banner-description",children:jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-consent-banner__container",n==null?void 0:n.container,o),children:[jsxRuntime.jsx("h2",{id:"consent-banner-title",className:chunkAME4HJR4_js.a("ndpr-consent-banner__title",n==null?void 0:n.title,o),children:gn}),jsxRuntime.jsx("p",{id:"consent-banner-description",className:chunkAME4HJR4_js.a("ndpr-consent-banner__description",n==null?void 0:n.description,o),children:vn}),f&&jsxRuntime.jsxs("div",{ref:$,className:chunkAME4HJR4_js.a("ndpr-consent-banner__customize-panel",n==null?void 0:n.customizePanel,o),children:[jsxRuntime.jsx("div",{className:o?"":"ndpr-consent-banner__select-all-row",children:jsxRuntime.jsx("button",{type:"button",onClick:W?En:Pn,className:chunkAME4HJR4_js.a("ndpr-consent-banner__select-all-button",n==null?void 0:n.selectAllButton,o),children:W?Sn:kn})}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("ndpr-consent-banner__options-list",n==null?void 0:n.optionsList,o),children:d.map(t=>jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-consent-banner__option",n==null?void 0:n.optionItem,o),children:[jsxRuntime.jsx("input",{id:`consent-${t.id}`,type:"checkbox",checked:S[t.id]||false,onChange:e=>yn(t.id,e.target.checked),disabled:t.required,className:chunkAME4HJR4_js.a("ndpr-consent-banner__option-checkbox",n==null?void 0:n.optionCheckbox,o)}),jsxRuntime.jsxs("div",{className:o?"":"ndpr-consent-banner__option-text",children:[jsxRuntime.jsxs("label",{htmlFor:`consent-${t.id}`,className:chunkAME4HJR4_js.a("ndpr-consent-banner__option-label",n==null?void 0:n.optionLabel,o),children:[t.label,t.required&&jsxRuntime.jsx("span",{className:o?"":"ndpr-consent-banner__required-marker",children:" *"})]}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-consent-banner__option-description",n==null?void 0:n.optionDescription,o),children:t.description})]})]},t.id))}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-consent-banner__buttons",n==null?void 0:n.buttonGroup,o),children:[jsxRuntime.jsx("button",{onClick:Dn,className:chunkAME4HJR4_js.a($n,n==null?void 0:n.saveButton,o),children:an}),jsxRuntime.jsx("button",{onClick:()=>I(false),className:chunkAME4HJR4_js.a(Q,n==null?void 0:n.rejectButton,o),children:(en=c.common.back)!=null?en:"Back"})]})]}),!f&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-consent-banner__buttons",n==null?void 0:n.buttonGroup,o),children:[jsxRuntime.jsx("button",{onClick:An,className:chunkAME4HJR4_js.a(jn,n==null?void 0:n.acceptButton,o),children:_n}),jsxRuntime.jsx("button",{onClick:J,className:chunkAME4HJR4_js.a(Q,n==null?void 0:n.rejectButton,o),children:Cn}),jsxRuntime.jsx("button",{onClick:()=>I(true),className:chunkAME4HJR4_js.a(In,n==null?void 0:n.customizeButton,o),children:hn})]}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("ndpr-consent-banner__footer-text",void 0,o),children:'By clicking "Accept All", you agree to the use of ALL cookies. Visit our Cookie Policy to learn more.'})]})});if(Y)return F;if(O){let t=jsxRuntime.jsx("div",{className:o?"":"ndpr-consent-banner__overlay",style:{zIndex:x},children:F});return s?reactDom.createPortal(t,document.body):null}return s?reactDom.createPortal(F,document.body):null};exports.a=Vn;
@@ -1 +1 @@
1
- 'use strict';var chunk732C2EVN_js=require('./chunk-732C2EVN.js'),jsxRuntime=require('react/jsx-runtime');var p=[{id:"essential",label:"Essential Cookies",description:"Required for basic site functionality. Cannot be disabled.",required:true,purpose:"Site operation"},{id:"analytics",label:"Analytics",description:"Help us understand how visitors use our site to improve the experience.",required:false,purpose:"Usage analytics"},{id:"marketing",label:"Marketing",description:"Used to deliver relevant advertisements and track campaign effectiveness.",required:false,purpose:"Targeted advertising"},{id:"preferences",label:"Preferences",description:"Remember your settings and preferences for a personalised experience.",required:false,purpose:"Personalisation"}],f=({extraOptions:a=[],options:t,adapter:n,position:o="bottom",classNames:l,unstyled:d,onSave:s,copy:e})=>{let m=t!=null?t:[...p,...a];return jsxRuntime.jsx(chunk732C2EVN_js.a,{options:m,onSave:i=>{n&&n.save(i),s==null||s(i);},position:o,classNames:l,unstyled:d,manageStorage:!n,title:e==null?void 0:e.title,description:e==null?void 0:e.description,acceptAllButtonText:e==null?void 0:e.acceptAll,rejectAllButtonText:e==null?void 0:e.rejectAll,customizeButtonText:e==null?void 0:e.customize,saveButtonText:e==null?void 0:e.save})};exports.a=f;
1
+ 'use strict';var chunkD3DVVJCT_js=require('./chunk-D3DVVJCT.js'),jsxRuntime=require('react/jsx-runtime');var p=[{id:"essential",label:"Essential Cookies",description:"Required for basic site functionality. Cannot be disabled.",required:true,purpose:"Site operation"},{id:"analytics",label:"Analytics",description:"Help us understand how visitors use our site to improve the experience.",required:false,purpose:"Usage analytics"},{id:"marketing",label:"Marketing",description:"Used to deliver relevant advertisements and track campaign effectiveness.",required:false,purpose:"Targeted advertising"},{id:"preferences",label:"Preferences",description:"Remember your settings and preferences for a personalised experience.",required:false,purpose:"Personalisation"}],f=({extraOptions:a=[],options:t,adapter:n,position:o="bottom",classNames:l,unstyled:d,onSave:s,copy:e})=>{let m=t!=null?t:[...p,...a];return jsxRuntime.jsx(chunkD3DVVJCT_js.a,{options:m,onSave:i=>{n&&n.save(i),s==null||s(i);},position:o,classNames:l,unstyled:d,manageStorage:!n,title:e==null?void 0:e.title,description:e==null?void 0:e.description,acceptAllButtonText:e==null?void 0:e.acceptAll,rejectAllButtonText:e==null?void 0:e.rejectAll,customizeButtonText:e==null?void 0:e.customize,saveButtonText:e==null?void 0:e.save})};exports.a=f;
@@ -0,0 +1 @@
1
+ 'use strict';var e={consent:{title:"A M\u1ECDy\xEC \xC0\u1E63\xEDr\xED R\u1EB9",description:"A \u0144 lo k\xFAk\xEC \xE0ti \xE0w\u1ECDn \xECm\u1ECD\u0300-\u1EB9\u0300r\u1ECD t\xF3 j\u1ECDra l\xE1ti p\xE8s\xE8 i\u1E63\u1EB9\u0301 wa \xE0ti l\xE1ti m\xFA \xECr\xEDr\xED r\u1EB9 d\xE1ra s\xED i. A \u0144 gba \xECfoh\xF9n\u1E63\u1ECD\u0300kan r\u1EB9 g\u1EB9\u0301g\u1EB9\u0301 b\xED Abala 25-26 ti \xD2fin \xCCd\xE1\xE0b\xF2b\xF2 D\xE1t\xE0 ti N\xE0\xECj\xEDr\xED\xE0.",acceptAll:"Gba Gbogbo",rejectAll:"K\u1ECD Gbogbo",customize:"\u1E62\xE0t\xFAn\u1E63e",savePreferences:"T\u1ECD\u0301j\xFA \xC0\u1E63\xE0y\xE0n",selectAll:"Yan Gbogbo",deselectAll:"Y\u1ECD Gbogbo K\xFAr\xF2",required:"K\xF2 \u1E62e Y\u1EB9ra F\xFAn",cookieNotice:'N\xEDpa t\xEDt\u1EB9 "Gba Gbogbo", o foh\xF9n \u1E63\u1ECD\u0300kan p\u1EB9\u0300l\xFA l\xEDlo gbogbo k\xFAk\xEC. \u1E62\xE0b\u1EB9\u0300w\xF2 \xCCl\xE0n\xE0 K\xFAk\xEC wa l\xE1ti k\u1EB9\u0301k\u1ECD\u0300\u1ECD\u0301 s\xEDi.'},dsr:{title:"Fi \xCCb\xE9\xE8r\xE8 On\xED-d\xE1t\xE0 S\xEDl\u1EB9\u0300",description:"Lo f\u1ECD\u0301\u1ECD\u0300m\xF9 y\xEC\xED l\xE1ti lo \xE0w\u1ECDn \u1EB9\u0300t\u1ECD\u0301 r\u1EB9 l\xE1b\u1EB9\u0301 \xD2fin \xCCd\xE1\xE0b\xF2b\xF2 D\xE1t\xE0 ti N\xE0\xECj\xEDr\xED\xE0 (NDPA), Ap\xE1 K\u1EB9f\xE0, Abala 34-38.",submitRequest:"Fi \xCCb\xE9\xE8r\xE8 S\xEDl\u1EB9\u0300",reset:"T\xFAn B\u1EB9\u0300r\u1EB9\u0300",fullName:"Or\xFAk\u1ECD K\xEDk\xFAn",email:"\xC0d\xEDr\u1EB9\u0301s\xEC \xCDme\xE8l\xEC",phone:"N\u1ECD\u0301mb\xE0 F\xF3\xF2n\xF9 (\xC0\u1E63\xE0y\xE0n)",requestType:"Ir\xFA \xCCb\xE9\xE8r\xE8",additionalInfo:"\xC0l\xE0y\xE9 \xC0fik\xFAn",identityVerification:"\xCCd\xE1nil\xF3j\xFA \xCCd\xE1nim\u1ECD\u0300",identifierType:"Ir\xFA \xCCd\xE1nim\u1ECD\u0300",identifierValue:"Iye \xCCd\xE1nim\u1ECD\u0300",privacyNotice:"\xC0w\u1ECDn \xECr\xF2y\xECn t\xED o b\xE1 p\xE8s\xE8 n\xEDn\xFA f\u1ECD\u0301\u1ECD\u0300m\xF9 y\xEC\xED ni a \xF3 l\xF2 f\xFAn \xE8te \u1E63\xED\u1E63e \xE0b\xF3j\xFAt\xF3 \xECb\xE9\xE8r\xE8 on\xED-d\xE1t\xE0 r\u1EB9 n\xECkan.",successMessage:"A ti fi \xECb\xE9\xE8r\xE8 r\u1EB9 s\xEDl\u1EB9\u0300 d\xE1rad\xE1ra."},breach:{title:"\u1E62e \xCCr\xF2y\xECn \xCCr\xFAfin D\xE1t\xE0",description:"Lo f\u1ECD\u0301\u1ECD\u0300m\xF9 y\xEC\xED l\xE1ti \u1E63e \xECr\xF2y\xECn \xECr\xFAfin d\xE1t\xE0 t\xED a fura s\xED t\xE0b\xED t\xED a ti fidi r\u1EB9\u0300 m\xFAl\u1EB9\u0300 g\u1EB9\u0301g\u1EB9\u0301 b\xED Abala 40 ti NDPA.",submitReport:"Fi \xCCr\xF2y\xECn S\xEDl\u1EB9\u0300",breachTitle:"\xC0k\u1ECDl\xE9/\xC0k\xF3p\u1ECD\u0300 \xCCr\xFAfin",category:"\u1EB8\u0300ka",discoveredAt:"\u1ECCj\u1ECD\u0301 T\xED A R\xED I",detailedDescription:"\xC0l\xE0y\xE9 K\xEDk\xFAn"},dpia:{title:"\xCCgb\xE9l\xE9w\u1ECD\u0300n Ipa \xCCd\xE1\xE0b\xF2b\xF2 D\xE1t\xE0",next:"T\u1EB9\u0300l\xE9",previous:"S\u1EB9\u0301y\xECn",complete:"Par\xED \xCCgb\xE9l\xE9w\u1ECD\u0300n",progress:"\xCCl\u1ECDs\xEDw\xE1j\xFA"},policy:{title:"Ol\xF9pil\u1EB9\u0300\u1E63\u1EB9\u0300 \xCCl\xE0n\xE0 \xC0\u1E63\xEDr\xED",generate:"\u1E62\u1EB9\u0300d\xE1 \xCCl\xE0n\xE0",preview:"\xC0y\u1EB9\u0300w\xF2",export:"Gb\xE9 J\xE1de",sections:"\xC0w\u1ECDn Abala",variables:"\xC0w\u1ECDn On\xEDy\xEDpad\xE0"},compliance:{score:"\xC0m\xEC \xCCb\xE1mu",excellent:"K\xF2 L\xE8 D\xE1ra Ju",good:"\xD3 D\xE1ra",needsWork:"N\xEDl\xF2 \xC0t\xFAn\u1E63e",critical:"P\xE0t\xE0k\xEC Gan",recommendations:"\xC0w\u1ECDn \xC0b\xE1",passed:"K\u1ECDj\xE1",gaps:"\xC0w\u1ECDn \xC0\xECp\xE9"},common:{loading:"\u0143 gb\xE9y\u1EB9\u0300w\xF2...",error:"\xC0\u1E63\xEC\u1E63e kan \u1E63\u1EB9l\u1EB9\u0300",save:"T\u1ECD\u0301j\xFA",cancel:"Fagil\xE9",delete:"Pa r\u1EB9\u0301",edit:"\u1E62\xE0t\xFAn\u1E63e",add:"Fik\xFAn",back:"Pad\xE0",next:"T\u1EB9\u0300l\xE9",search:"W\xE1",noResults:"K\xF2 s\xED \xE8s\xEC kankan"}};var i={consent:{title:"Any\u1ECB Na-akwanyere Nzuzo G\u1ECB \xD9gw\xF9",description:"Any\u1ECB na-eji kuki na tekn\u1ECDl\u1ECDj\u1ECB nd\u1ECB yiri ya enyere \u1ECDr\u1EE5 any\u1ECB aka ma melite ah\u1EE5m\u1ECBhe g\u1ECB. A na-anak\u1ECDta nkwenye g\u1ECB d\u1ECBka iwu NDPA Ngalaba 25-26 si kwuo.",acceptAll:"Nabata Niile",rejectAll:"J\u1EE5 Niile",customize:"Hazie",savePreferences:"Chekwaa Nh\u1ECDr\u1ECD",selectAll:"H\u1ECDr\u1ECD Niile",deselectAll:"Wep\u1EE5 Niile",required:"Ach\u1ECDr\u1ECD",cookieNotice:'Site na \u1ECBp\u1ECB "Nabata Niile", \u1ECB kwenyere na iji kuki niile. Gaa na Am\u1EE5ma Kuki any\u1ECB \u1ECBm\u1EE5takwu.'},dsr:{title:"Tinye Ar\u1ECBr\u1ECB\u1ECD Onye Nwe Data",description:"Jiri f\u1ECD\u1ECDm\u1EE5 a mee ka ikike g\u1ECB n'okpuru Iwu Nchedo Data nke Na\u1ECBjir\u1ECBa (NDPA), Nkebi Isii, Ngalaba 34-38 r\u1EE5\u1ECD \u1ECDr\u1EE5.",submitRequest:"Tinye Ar\u1ECBr\u1ECB\u1ECD",reset:"Maliteghar\u1ECBa",fullName:"Aha Zuru Oke",email:"Adrees\u1ECB Email",phone:"N\u1ECDmb\xE0 Ekwent\u1ECB (Nh\u1ECDr\u1ECD)",requestType:"\u1EE4d\u1ECB Ar\u1ECBr\u1ECB\u1ECD",additionalInfo:"Ozi Nd\u1ECB \u1ECCz\u1ECD",identityVerification:"Nyocha Njirimara",identifierType:"\u1EE4d\u1ECB Njirimara",identifierValue:"Uru Njirimara",privacyNotice:"A ga-eji ozi \u1ECB nyere na f\u1ECD\u1ECDm\u1EE5 a naan\u1ECB maka ebumnuche nke ilek\u1ECDta ar\u1ECBr\u1ECB\u1ECD onye nwe data g\u1ECB.",successMessage:"Etinyela ar\u1ECBr\u1ECB\u1ECD g\u1ECB nke \u1ECDma."},breach:{title:"K\u1ECD\u1ECD Mwap\u1EE5 Data",description:"Jiri f\u1ECD\u1ECDm\u1EE5 a k\u1ECD\u1ECD mwap\u1EE5 data a na-echere ma \u1ECD b\u1EE5 nke e gosip\u1EE5tara d\u1ECBka iwu NDPA Ngalaba 40 si kwuo.",submitReport:"Tinye Ak\u1EE5k\u1ECD",breachTitle:"Isiokwu/Nch\u1ECBk\u1ECDta Mwap\u1EE5",category:"Udi",discoveredAt:"\u1EE4b\u1ECDch\u1ECB A Ch\u1ECDp\u1EE5tara",detailedDescription:"Nk\u1ECDwa Zuru Oke"},dpia:{title:"Nyocha Mmet\u1EE5ta Nchedo Data",next:"\u1ECCz\u1ECD",previous:"Az\u1EE5",complete:"Mechaa Nyocha",progress:"\u1ECCganihu"},policy:{title:"Ngwa Mmep\u1EE5ta Am\u1EE5ma Nzuzo",generate:"Mep\u1EE5ta Am\u1EE5ma",preview:"Lelee",export:"Bup\u1EE5ta",sections:"Ngalaba",variables:"Mgbanwe"},compliance:{score:"Akara Ndabere",excellent:"Kachas\u1ECB Mma",good:"\u1ECC D\u1ECB Mma",needsWork:"Ch\u1ECDr\u1ECD Mmezighar\u1ECB",critical:"D\u1ECB Oke Mkpa",recommendations:"Nd\u1EE5m\u1ECDd\u1EE5",passed:"Gafere",gaps:"Oghere"},common:{loading:"Na-ebugo...",error:"Mperi mere",save:"Chekwaa",cancel:"Kagbuo",delete:"Hichap\u1EE5",edit:"Dezie",add:"Tinye",back:"Laghachi",next:"\u1ECCz\u1ECD",search:"Ch\u1ECD\u1ECD",noResults:"Enwegh\u1ECB nsonaaz\u1EE5"}};var t={consent:{title:"Muna Daraja Sirrin Ka",description:"Muna amfani da kukis da fasahohi irin su don samar da ayyukanmu da inganta kwarewar ka. Ana tattara yardar ka bisa ga Sashe na 25-26 na Dokar Kare Bayanan Nijeriya.",acceptAll:"Kar\u0253i Duka",rejectAll:"\u0198i Duka",customize:"Gyara Za\u0253i",savePreferences:"Ajiye Za\u0253u\u0253\u0253uka",selectAll:"Za\u0253i Duka",deselectAll:"Cire Duka",required:"Wajibi Ne",cookieNotice:'Ta hanyar danna "Kar\u0253i Duka", ka yarda da amfani da dukkan kukis. Ziyarci Manufar Kukis don \u0199arin bayani.'},dsr:{title:"\u0198addamar da Bu\u0199atar Mai Bayanan",description:"Yi amfani da wannan fom don aiwatar da ha\u0199\u0199o\u0199in ka a \u0199ar\u0199ashin Dokar Kare Bayanan Nijeriya (NDPA), Bangare na Shida, Sashe 34-38.",submitRequest:"\u0198addamar da Bu\u0199ata",reset:"Sake Saiti",fullName:"Sunan Cikakke",email:"Adireshin Imel",phone:"Lambar Waya (Na Za\u0253i)",requestType:"Nau'in Bu\u0199ata",additionalInfo:"\u0198arin Bayani",identityVerification:"Tabbatar da Ainihi",identifierType:"Nau'in Ganewa",identifierValue:"Darajar Ganewa",privacyNotice:"Za a yi amfani da bayanan da ka bayar a cikin wannan fom ne kawai don sarrafa bu\u0199atar mai bayanan ka.",successMessage:"An \u0199addamar da bu\u0199atar ka cikin nasara."},breach:{title:"Bayar da Rahoton Karya Bayanan",description:"Yi amfani da wannan fom don bayar da rahoton zargin ko tabbatar da karya bayanan bisa ga Sashe na 40 na NDPA.",submitReport:"\u0198addamar da Rahoto",breachTitle:"Taken/Ta\u0199aitaccen Karya",category:"Rukunin",discoveredAt:"Ranar da Aka Gano",detailedDescription:"Cikakken Bayani"},dpia:{title:"Tantance Tasirin Kare Bayanan",next:"Na Gaba",previous:"Na Baya",complete:"Kammala Tantancewa",progress:"Ci Gaba"},policy:{title:"Mai \u0198ir\u0199irar Manufar Sirri",generate:"\u0198ir\u0199iri Manufa",preview:"Duba",export:"Fitar",sections:"Sassa",variables:"Masu Canjin"},compliance:{score:"Makin Bin Doka",excellent:"Kyakkyawa Sosai",good:"Mai Kyau",needsWork:"Yana Bu\u0199atar Gyara",critical:"Mai Muhimmanci",recommendations:"Shawarwari",passed:"Ya Wuce",gaps:"Gi\u0253i"},common:{loading:"Ana lodawa...",error:"Kuskure ya faru",save:"Ajiye",cancel:"Soke",delete:"Goge",edit:"Gyara",add:"\u0198ara",back:"Komawa",next:"Na Gaba",search:"Bincika",noResults:"Ba a sami sakamako ba"}};var o={consent:{title:"Your Privacy Dey Important to Us",description:"We dey use cookies and technologies wey dey similar to give you beta service and make your experience sweet. We dey collect your consent as NDPA Sections 25-26 talk am.",acceptAll:"Accept Everything",rejectAll:"Reject Everything",customize:"Choose Wetin You Want",savePreferences:"Save Your Choice",selectAll:"Select Everything",deselectAll:"Remove Everything",required:"E Dey Required",cookieNotice:'If you click "Accept Everything", you don agree say we fit use all the cookies. Check our Cookie Policy to sabi more.'},dsr:{title:"Send Data Subject Request",description:"Use this form take exercise your rights under the Nigeria Data Protection Act (NDPA), Part VI, Sections 34-38.",submitRequest:"Send Your Request",reset:"Start Again",fullName:"Your Full Name",email:"Email Address",phone:"Phone Number (If You Want)",requestType:"Type of Request",additionalInfo:"Any Other Information",identityVerification:"Verify Your Identity",identifierType:"Type of ID",identifierValue:"ID Value",privacyNotice:"The information wey you give for this form, na only for processing your data subject request we go use am.",successMessage:"We don receive your request successfully."},breach:{title:"Report Data Breach",description:"Use this form report any data breach wey you suspect or wey don happen, as NDPA Section 40 talk am.",submitReport:"Send Report",breachTitle:"Breach Title/Summary",category:"Category",discoveredAt:"Date Wey You Discover Am",detailedDescription:"Full Gist About Wetin Happen"},dpia:{title:"Data Protection Impact Assessment",next:"Next",previous:"Go Back",complete:"Finish Assessment",progress:"Progress"},policy:{title:"Privacy Policy Generator",generate:"Create Policy",preview:"Preview",export:"Export",sections:"Sections",variables:"Variables"},compliance:{score:"Compliance Score",excellent:"E Dey Excellent",good:"E Good",needsWork:"E Need Work",critical:"E Dey Critical",recommendations:"Wetin We Recommend",passed:"E Pass",gaps:"Gaps"},common:{loading:"E dey load...",error:"Error don happen",save:"Save",cancel:"Cancel",delete:"Delete",edit:"Edit",add:"Add",back:"Go Back",next:"Next",search:"Search",noResults:"We no find any result"}};exports.a=e;exports.b=i;exports.c=t;exports.d=o;
@@ -1 +1 @@
1
- import {a}from'./chunk-ATFUSHC2.mjs';import {b}from'./chunk-UKLU6BQF.mjs';import {c,b as b$1,a as a$1}from'./chunk-ZJYULEER.mjs';import {useMemo}from'react';import {jsx}from'react/jsx-runtime';var u=d=>{var o=d,{template:e,templateOverrides:r,initialContext:t}=o,l=c(o,["template","templateOverrides","initialContext"]);let n=useMemo(()=>{if(t)return t;if(e)return b(e,r)},[t,e,r]);return jsx(a,b$1(a$1({},l),{initialContext:n}))};export{u as a};
1
+ import {a}from'./chunk-TDHH7GS2.mjs';import {b}from'./chunk-CWY2FMIC.mjs';import {c,b as b$1,a as a$1}from'./chunk-ZJYULEER.mjs';import {useMemo}from'react';import {jsx}from'react/jsx-runtime';var u=d=>{var o=d,{template:e,templateOverrides:r,initialContext:t}=o,l=c(o,["template","templateOverrides","initialContext"]);let n=useMemo(()=>{if(t)return t;if(e)return b(e,r)},[t,e,r]);return jsx(a,b$1(a$1({},l),{initialContext:n}))};export{u as a};
@@ -0,0 +1,2 @@
1
+ import {a as a$2}from'./chunk-EWVK45Z3.mjs';import {c}from'./chunk-25TNTLHJ.mjs';import {a}from'./chunk-SFGW37LE.mjs';import {b,a as a$1}from'./chunk-ZJYULEER.mjs';import {useState}from'react';import {jsxs,jsx}from'react/jsx-runtime';var Tr=({requestTypes:y,onSubmit:nr,onValidationError:F,title:T,description:C,submitButtonText:$,className:q="",buttonClassName:dr="",showConfirmation:pr=true,confirmationMessage:ar="Your request has been submitted successfully. You will receive a confirmation email shortly.",requireIdentityVerification:O=true,identifierTypes:D=[{id:"email",label:"Email Address"},{id:"account",label:"Account Number"},{id:"customer_id",label:"Customer ID"}],collectAdditionalContact:ur=true,labels:v={},classNames:r,unstyled:e=false,isSubmitting:A=false,defaultValues:p,onReset:I})=>{var W,J,K,Q,X,V,N,s,rr;if(!Array.isArray(y))throw new Error("[ndpr-toolkit] <DSRRequestForm requestTypes={...} /> requires an array of RequestType[]. See https://ndprtoolkit.com.ng/docs/components/dsr#requesttypes \u2014 or use the `<NDPRSubjectRights />` preset which ships sensible defaults.");let x=c(),br=(W=T!=null?T:x.dsr.title)!=null?W:"Submit a Data Subject Request",fr=(J=C!=null?C:x.dsr.description)!=null?J:"Use this form to exercise your rights under the Nigeria Data Protection Act (NDPA), Part VI.",lr=(K=$!=null?$:x.dsr.submitRequest)!=null?K:"Submit Request",[c$1,z]=useState((p==null?void 0:p.requestType)||""),[P,B]=useState(((Q=p==null?void 0:p.dataSubject)==null?void 0:Q.fullName)||""),[S,M]=useState(((X=p==null?void 0:p.dataSubject)==null?void 0:X.email)||""),[k,Z]=useState(((V=p==null?void 0:p.dataSubject)==null?void 0:V.phone)||""),[G,L]=useState(((N=p==null?void 0:p.dataSubject)==null?void 0:N.identifierType)||((s=D[0])==null?void 0:s.id)||""),[w,Y]=useState(((rr=p==null?void 0:p.dataSubject)==null?void 0:rr.identifierValue)||""),[l,j]=useState((p==null?void 0:p.additionalInfo)||{}),[_r,E]=useState(false),[d,H]=useState({}),mr=()=>{var i;z(""),B(""),M(""),Z(""),L(((i=D[0])==null?void 0:i.id)||""),Y(""),j({}),E(false),H({}),I==null||I();},a$3=y.find(i=>i.id===c$1),gr=i=>{z(i.target.value),j({});},h=(i,b$1)=>{j(_=>b(a$1({},_),{[i]:b$1}));},vr=()=>{let i={};return P.trim()||(i.fullName="Full name is required"),S.trim()?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(S)||(i.email="Email is invalid"):i.email="Email is required",c$1||(i.requestType="Please select a request type"),O&&!w.trim()&&(i.identifierValue="Identifier value is required"),a$3!=null&&a$3.requiresAdditionalInfo&&a$3.additionalFields&&a$3.additionalFields.forEach(b=>{b.required&&!l[b.id]&&(i[`additional_${b.id}`]=`${b.label} is required`);}),H(i),i},hr=i=>{i.preventDefault();let b=vr();if(Object.keys(b).length>0){F==null||F(b);return}let _=Object.keys(l).length>0?Object.fromEntries(Object.entries(l).map(([u,m])=>[u,typeof m=="string"?a$2(m):m])):void 0,R={requestType:c$1,dataSubject:{fullName:a$2(P),email:a$2(S),phone:k?a$2(k):void 0,identifierType:G,identifierValue:a$2(w)},additionalInfo:_,submittedAt:Date.now()};nr(R),pr&&E(true);},U=`ndpr-dsr-form__button ndpr-dsr-form__button--primary ${dr}`.trim(),qr="ndpr-dsr-form__button ndpr-dsr-form__button--secondary";return _r?jsxs("div",{"data-ndpr-component":"dsr-request-form","data-ndpr-state":"submitted",className:a(`ndpr-dsr-form__success${q?` ${q}`:""}`,r==null?void 0:r.successMessage,e),"aria-live":"polite",children:[jsx("h2",{className:a("ndpr-dsr-form__success-title",r==null?void 0:r.title,e),children:"Request Submitted"}),jsx("p",{className:a("ndpr-dsr-form__success-body",r==null?void 0:r.description,e),children:ar}),jsx("button",{onClick:()=>E(false),className:a(U,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),e),children:"Submit Another Request"})]}):jsxs("div",{"data-ndpr-component":"dsr-request-form",className:a(`ndpr-dsr-form${q?` ${q}`:""}`,r==null?void 0:r.root,e),children:[jsx("h2",{className:a("ndpr-dsr-form__title",r==null?void 0:r.title,e),children:br}),jsx("p",{className:a("ndpr-dsr-form__description",r==null?void 0:r.description,e),children:fr}),jsx("form",{onSubmit:hr,className:a("",r==null?void 0:r.form,e),children:jsxs("div",{className:a("ndpr-dsr-form__sections",r==null?void 0:r.fieldGroup,e),children:[jsxs("div",{children:[jsx("h3",{className:e?"":"ndpr-form-section__heading",children:"Personal Information"}),jsxs("div",{className:e?"":"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"fullName",className:a("ndpr-form-field__label",r==null?void 0:r.label,e),children:[v.name||"Full Name"," ",jsx("span",{className:e?"":"ndpr-form-field__required",children:"*"})]}),jsx("input",{type:"text",id:"fullName",value:P,onChange:i=>B(i.target.value),className:a("ndpr-form-field__input",r==null?void 0:r.input,e),required:true,"aria-required":"true","aria-invalid":!!d.fullName,"aria-describedby":d.fullName?"fullName-error":void 0}),d.fullName&&jsx("p",{id:"fullName-error",role:"alert",className:e?"":"ndpr-form-field__error",children:d.fullName})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"email",className:a("ndpr-form-field__label",r==null?void 0:r.label,e),children:[v.email||"Email Address"," ",jsx("span",{className:e?"":"ndpr-form-field__required",children:"*"})]}),jsx("input",{type:"email",id:"email",value:S,onChange:i=>M(i.target.value),className:a("ndpr-form-field__input",r==null?void 0:r.input,e),required:true,"aria-required":"true","aria-invalid":!!d.email,"aria-describedby":d.email?"email-error":void 0}),d.email&&jsx("p",{id:"email-error",role:"alert",className:e?"":"ndpr-form-field__error",children:d.email})]}),ur&&jsxs("div",{children:[jsx("label",{htmlFor:"phone",className:a("ndpr-form-field__label",r==null?void 0:r.label,e),children:"Phone Number (Optional)"}),jsx("input",{type:"tel",id:"phone",value:k,onChange:i=>Z(i.target.value),className:a("ndpr-form-field__input",r==null?void 0:r.input,e)})]})]})]}),jsxs("div",{children:[jsx("h3",{className:e?"":"ndpr-form-section__heading",children:"Request Details"}),jsxs("div",{className:e?"":"ndpr-form-field",children:[jsxs("label",{htmlFor:"requestType",className:a("ndpr-form-field__label",r==null?void 0:r.label,e),children:[v.requestType||"Request Type"," ",jsx("span",{className:e?"":"ndpr-form-field__required",children:"*"})]}),jsxs("select",{id:"requestType",value:c$1,onChange:gr,className:a("ndpr-form-field__select",r==null?void 0:r.select,e),required:true,"aria-required":"true","aria-invalid":!!d.requestType,"aria-describedby":d.requestType?"requestType-error":void 0,children:[jsx("option",{value:"",children:"Select a request type"}),y.map(i=>jsx("option",{value:i.id,children:i.name},i.id))]}),d.requestType&&jsx("p",{id:"requestType-error",role:"alert",className:e?"":"ndpr-form-field__error",children:d.requestType})]}),a$3&&jsxs("div",{className:e?"":"ndpr-dsr-form__type-info",children:[jsx("p",{children:a$3.description}),jsxs("p",{children:["Estimated completion time: ",a$3.estimatedCompletionTime," ",a$3.estimatedCompletionTime===1?"day":"days"]})]}),jsxs("div",{className:e?"":"ndpr-form-field",children:[jsx("label",{htmlFor:"requestDescription",className:a("ndpr-form-field__label",r==null?void 0:r.label,e),children:v.description||"Additional Information"}),jsx("textarea",{id:"requestDescription",className:a("ndpr-form-field__textarea",r==null?void 0:r.textarea,e),rows:4,placeholder:"Please provide any additional details that might help us process your request"})]})]}),O&&jsxs("div",{children:[jsx("h3",{className:e?"":"ndpr-form-section__heading",children:"Identity Verification"}),jsx("p",{className:e?"":"ndpr-form-section__hint",children:"To protect your privacy, we need to verify your identity before processing your request."}),jsxs("div",{className:e?"":"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"identifierType",className:a("ndpr-form-field__label",r==null?void 0:r.label,e),children:["Identifier Type ",jsx("span",{className:e?"":"ndpr-form-field__required",children:"*"})]}),jsx("select",{id:"identifierType",value:G,onChange:i=>L(i.target.value),className:a("ndpr-form-field__select",r==null?void 0:r.select,e),required:true,"aria-required":"true",children:D.map(i=>jsx("option",{value:i.id,children:i.label},i.id))})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"identifierValue",className:a("ndpr-form-field__label",r==null?void 0:r.label,e),children:["Identifier Value ",jsx("span",{className:e?"":"ndpr-form-field__required",children:"*"})]}),jsx("input",{type:"text",id:"identifierValue",value:w,onChange:i=>Y(i.target.value),className:a("ndpr-form-field__input",r==null?void 0:r.input,e),required:true,"aria-required":"true","aria-invalid":!!d.identifierValue,"aria-describedby":d.identifierValue?"identifierValue-error":void 0}),d.identifierValue&&jsx("p",{id:"identifierValue-error",role:"alert",className:e?"":"ndpr-form-field__error",children:d.identifierValue})]})]})]}),(a$3==null?void 0:a$3.requiresAdditionalInfo)&&a$3.additionalFields&&a$3.additionalFields.length>0&&jsxs("div",{children:[jsx("h3",{className:e?"":"ndpr-form-section__heading",children:"Additional Information"}),jsx("div",{className:e?"":"ndpr-form-section",children:a$3.additionalFields.map(i=>{var b,_,R;return jsxs("div",{children:[jsxs("label",{htmlFor:i.id,className:a("ndpr-form-field__label",r==null?void 0:r.label,e),children:[i.label," ",i.required&&jsx("span",{className:e?"":"ndpr-form-field__required",children:"*"})]}),i.type==="text"&&jsx("input",{type:"text",id:i.id,value:String((b=l[i.id])!=null?b:""),onChange:u=>h(i.id,u.target.value),placeholder:i.placeholder,className:a("ndpr-form-field__input",r==null?void 0:r.input,e),required:i.required,"aria-required":i.required||void 0,"aria-invalid":!!d[`additional_${i.id}`],"aria-describedby":d[`additional_${i.id}`]?`additional-${i.id}-error`:void 0}),i.type==="textarea"&&jsx("textarea",{id:i.id,value:String((_=l[i.id])!=null?_:""),onChange:u=>h(i.id,u.target.value),placeholder:i.placeholder,className:a("ndpr-form-field__textarea",r==null?void 0:r.textarea,e),rows:4,required:i.required,"aria-required":i.required||void 0,"aria-invalid":!!d[`additional_${i.id}`],"aria-describedby":d[`additional_${i.id}`]?`additional-${i.id}-error`:void 0}),i.type==="select"&&i.options&&jsxs("select",{id:i.id,value:String((R=l[i.id])!=null?R:""),onChange:u=>h(i.id,u.target.value),className:a("ndpr-form-field__select",r==null?void 0:r.select,e),required:i.required,"aria-required":i.required||void 0,"aria-invalid":!!d[`additional_${i.id}`],"aria-describedby":d[`additional_${i.id}`]?`additional-${i.id}-error`:void 0,children:[jsx("option",{value:"",children:i.placeholder||"Select an option"}),i.options.map(u=>jsx("option",{value:u,children:u},u))]}),i.type==="checkbox"&&jsxs("div",{className:e?"":"ndpr-form-field__checkbox-row",children:[jsx("input",{type:"checkbox",id:i.id,checked:!!l[i.id],onChange:u=>h(i.id,u.target.checked),className:e?"":"ndpr-form-field__checkbox",required:i.required,"aria-required":i.required||void 0,"aria-invalid":!!d[`additional_${i.id}`],"aria-describedby":d[`additional_${i.id}`]?`additional-${i.id}-error`:void 0}),jsx("label",{htmlFor:i.id,className:a("ndpr-form-field__label",r==null?void 0:r.label,e),children:i.placeholder||i.label})]}),i.type==="file"&&jsx("input",{type:"file",id:i.id,onChange:u=>{var ir;let m=(ir=u.target.files)==null?void 0:ir[0];m&&h(i.id,m.name);},className:a("ndpr-form-field__input",r==null?void 0:r.input,e),required:i.required,"aria-required":i.required||void 0,"aria-invalid":!!d[`additional_${i.id}`],"aria-describedby":d[`additional_${i.id}`]?`additional-${i.id}-error`:void 0}),d[`additional_${i.id}`]&&jsx("p",{id:`additional-${i.id}-error`,role:"alert",className:e?"":"ndpr-form-field__error",children:d[`additional_${i.id}`]})]},i.id)})})]}),jsxs("div",{className:e?"":"ndpr-dsr-form__notice",children:[jsx("h3",{className:e?"":"ndpr-dsr-form__notice-title",children:"Privacy Notice"}),jsx("p",{className:e?"":"ndpr-dsr-form__notice-body",children:"The information you provide in this form will be used solely for the purpose of processing your data subject request. We will retain this information for as long as necessary to fulfill your request and to comply with our legal obligations. For more information, please refer to our Privacy Policy."})]}),jsxs("div",{className:e?"":"ndpr-dsr-form__actions",children:[A&&(r==null?void 0:r.loadingOverlay)&&jsx("div",{className:r.loadingOverlay}),jsx("button",{type:"submit",disabled:A,className:a(U,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),e),children:A?"Submitting...":v.submit||lr}),jsx("button",{type:"button",onClick:mr,className:a(qr,void 0,e),children:"Reset"})]})]})})]})};
2
+ export{Tr as a};
Binary file
@@ -0,0 +1 @@
1
+ 'use strict';var chunk6GM2PBTF_js=require('./chunk-6GM2PBTF.js'),chunkNUOHT3LO_js=require('./chunk-NUOHT3LO.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var u=d=>{var o=d,{template:e,templateOverrides:r,initialContext:t}=o,l=chunkRFPLZDIO_js.c(o,["template","templateOverrides","initialContext"]);let n=react.useMemo(()=>{if(t)return t;if(e)return chunkNUOHT3LO_js.b(e,r)},[t,e,r]);return jsxRuntime.jsx(chunk6GM2PBTF_js.a,chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},l),{initialContext:n}))};exports.a=u;
@@ -1,3 +1,3 @@
1
- import {c as c$1,d as d$1,a as a$2,b as b$1}from'./chunk-AOHKVFAS.mjs';import {e,c,f}from'./chunk-RMQ7OLNY.mjs';import {a}from'./chunk-DBZSN4WP.mjs';import {b,a as a$1,d}from'./chunk-ZJYULEER.mjs';import {useRef,useState,useEffect,useMemo,useCallback}from'react';var nt=10,Rt="ndpr_policy_draft",_t=2e3;function st(){return `section_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function it(){return `draft_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function w(u,A,M){let S=Date.now();return {id:M,title:`Privacy Policy${u.org.name?` \u2014 ${u.org.name}`:""}`,templateId:"adaptive-policy-wizard",organizationInfo:{name:u.org.name,website:u.org.website,privacyEmail:u.org.privacyEmail,address:u.org.address,dpoName:u.org.dpoName,dpoEmail:u.org.dpoEmail,industry:u.org.industry},sections:A,variableValues:{},effectiveDate:S,lastUpdated:S,version:"1.0",applicableFrameworks:["ndpa","ndpr"]}}function Ut(u={}){var K;let{onComplete:A,onComplianceChange:M}=u,S=useRef((K=u.adapter)!=null?K:a(Rt));u.adapter&&(S.current=u.adapter);let f$1=useRef(it()),[P,C]=useState(1),[n,v]=useState(()=>{var t;return (t=u.initialContext)!=null?t:e()}),[b$2,O]=useState([]),[x,I]=useState({}),[E,$]=useState([]),[at,q]=useState(false),[ct,z]=useState(null),[N,U]=useState(true),T=useRef(false),R=useRef(null);useEffect(()=>{let t=false,e=r=>{r&&(f$1.current=r.id,v(r.templateContext),O(r.customSections),I(r.sectionOverrides),$(r.sectionOrder),C(r.currentStep),z(r.lastSavedAt),q(true));};try{let r=S.current.load();r instanceof Promise?r.then(i=>{t||(e(i),U(!1));},()=>{t||U(!1);}):(e(r),U(!1));}catch(r){t||U(false);}return ()=>{t=true;}},[]);let d$2=useMemo(()=>{let e=c(n).map(o=>x[o.id]?b(a$1({},o),{template:x[o.id]}):o),r=b$2.map(o=>{var l;return {id:o.id,title:o.title,template:(l=x[o.id])!=null?l:o.content,order:o.order,required:false,included:true}}),i=[...e,...r];if(E.length>0){let o=new Map(E.map((l,p)=>[l,p]));return [...i].sort((l,p)=>{let m=o.has(l.id)?o.get(l.id):i.length,y=o.has(p.id)?o.get(p.id):i.length;return m-y})}return [...i].sort((o,l)=>{var p,m;return ((p=o.order)!=null?p:0)-((m=l.order)!=null?m:0)})},[n,b$2,x,E]),s=useMemo(()=>!n.org.name&&!n.org.privacyEmail?null:w(n,d$2,f$1.current),[n,d$2]),Y=useMemo(()=>w(e(),[],f$1.current),[]),V=useMemo(()=>f(s!=null?s:Y,n),[s,n,Y]),_=V.percentage,D=V.gaps,j=useRef({score:-1,gaps:[]});useEffect(()=>{let t=j.current;M&&(_!==t.score||D!==t.gaps)&&M(_,D),j.current={score:_,gaps:D};},[_,D,M]);let lt=useMemo(()=>{switch(P){case 1:return n.org.name.trim().length>0&&n.org.privacyEmail.trim().length>0;case 2:return n.dataCategories.some(t=>t.selected);case 3:return n.purposes.length>0;case 4:return true;default:return false}},[P,n]),dt=useCallback(t=>{let e=Math.min(Math.max(1,t),4);e<4&&(T.current=false),C(e);},[]),pt=useCallback(()=>{C(t=>Math.min(t+1,4));},[]),ut=useCallback(()=>{T.current=false,C(t=>Math.max(t-1,1));},[]),mt=useCallback(t=>{v(e=>a$1(a$1({},e),t));},[]),gt=useCallback(t=>{v(e=>b(a$1({},e),{org:a$1(a$1({},e.org),t)}));},[]),ft=useCallback(t=>{v(e=>b(a$1({},e),{dataCategories:e.dataCategories.map(r=>r.id===t?b(a$1({},r),{selected:!r.selected}):r)}));},[]),Pt=useCallback(t=>{v(e=>{let r=t,i=e.purposes.includes(r);return b(a$1({},e),{purposes:i?e.purposes.filter(o=>o!==t):[...e.purposes,r]})});},[]),Ct=useCallback(t=>{v(e=>b(a$1({},e),{thirdPartyProcessors:[...e.thirdPartyProcessors,t]}));},[]),yt=useCallback(t=>{v(e=>b(a$1({},e),{thirdPartyProcessors:e.thirdPartyProcessors.filter((r,i)=>i!==t)}));},[]),St=useCallback(t=>{O(e=>e.length>=nt?e:[...e,b(a$1({},t),{id:st(),required:false})]);},[]),vt=useCallback((t,e)=>{O(r=>r.map(i=>i.id===t?a$1(a$1({},i),e):i));},[]),xt=useCallback(t=>{O(e=>e.filter(r=>r.id!==t)),$(e=>e.filter(r=>r!==t)),I(e=>{let r=a$1({},e);return delete r[t],r});},[]),ht=useCallback((t,e)=>{$(r=>{let i=r.length>0?r:d$2.map(m=>m.id),o=i.indexOf(t);if(o===-1){let m=d$2.map(It=>It.id),y=m.indexOf(t);if(y===-1)return r;let G=e==="up"?y-1:y+1;if(G<0||G>=m.length)return m;let k=[...m];return [k[y],k[G]]=[k[G],k[y]],k}let l=e==="up"?o-1:o+1;if(l<0||l>=i.length)return i;let p=[...i];return [p[o],p[l]]=[p[l],p[o]],p});},[d$2]),Dt=useCallback((t,e)=>{I(r=>b(a$1({},r),{[t]:e}));},[]),bt=useCallback(t=>{let e=D.find(r=>r.requirementId===t);if(e)switch(e.fixType){case "fill_field":{T.current=false;let i=["data-categories-disclosed"],o=["purpose-of-processing"];i.includes(t)?C(2):o.includes(t)?C(3):(C(1));break}case "add_section":{if(!e.suggestedContent)break;O(r=>r.length>=nt?r:[...r,{id:st(),title:e.requirement,content:e.suggestedContent,order:999,required:false}]);break}case "add_content":{if(!e.suggestedContent)break;let r="data-subject-rights";I(i=>{var l,p,m;let o=(m=(p=i[r])!=null?p:(l=d$2.find(y=>y.id===r))==null?void 0:l.template)!=null?m:"";return b(a$1({},i),{[r]:`${o}
1
+ import {c as c$1,d as d$1,a as a$2,b as b$1}from'./chunk-IVSNHT24.mjs';import {e,c,f}from'./chunk-BIJSMSUU.mjs';import {a}from'./chunk-DBZSN4WP.mjs';import {b,a as a$1,d}from'./chunk-ZJYULEER.mjs';import {useRef,useState,useEffect,useMemo,useCallback}from'react';var nt=10,Rt="ndpr_policy_draft",_t=2e3;function st(){return `section_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function it(){return `draft_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function w(u,A,M){let S=Date.now();return {id:M,title:`Privacy Policy${u.org.name?` \u2014 ${u.org.name}`:""}`,templateId:"adaptive-policy-wizard",organizationInfo:{name:u.org.name,website:u.org.website,privacyEmail:u.org.privacyEmail,address:u.org.address,dpoName:u.org.dpoName,dpoEmail:u.org.dpoEmail,industry:u.org.industry},sections:A,variableValues:{},effectiveDate:S,lastUpdated:S,version:"1.0",applicableFrameworks:["ndpa","ndpr"]}}function Ut(u={}){var K;let{onComplete:A,onComplianceChange:M}=u,S=useRef((K=u.adapter)!=null?K:a(Rt));u.adapter&&(S.current=u.adapter);let f$1=useRef(it()),[P,C]=useState(1),[n,v]=useState(()=>{var t;return (t=u.initialContext)!=null?t:e()}),[b$2,O]=useState([]),[x,I]=useState({}),[E,$]=useState([]),[at,q]=useState(false),[ct,z]=useState(null),[N,U]=useState(true),T=useRef(false),R=useRef(null);useEffect(()=>{let t=false,e=r=>{r&&(f$1.current=r.id,v(r.templateContext),O(r.customSections),I(r.sectionOverrides),$(r.sectionOrder),C(r.currentStep),z(r.lastSavedAt),q(true));};try{let r=S.current.load();r instanceof Promise?r.then(i=>{t||(e(i),U(!1));},()=>{t||U(!1);}):(e(r),U(!1));}catch(r){t||U(false);}return ()=>{t=true;}},[]);let d$2=useMemo(()=>{let e=c(n).map(o=>x[o.id]?b(a$1({},o),{template:x[o.id]}):o),r=b$2.map(o=>{var l;return {id:o.id,title:o.title,template:(l=x[o.id])!=null?l:o.content,order:o.order,required:false,included:true}}),i=[...e,...r];if(E.length>0){let o=new Map(E.map((l,p)=>[l,p]));return [...i].sort((l,p)=>{let m=o.has(l.id)?o.get(l.id):i.length,y=o.has(p.id)?o.get(p.id):i.length;return m-y})}return [...i].sort((o,l)=>{var p,m;return ((p=o.order)!=null?p:0)-((m=l.order)!=null?m:0)})},[n,b$2,x,E]),s=useMemo(()=>!n.org.name&&!n.org.privacyEmail?null:w(n,d$2,f$1.current),[n,d$2]),Y=useMemo(()=>w(e(),[],f$1.current),[]),V=useMemo(()=>f(s!=null?s:Y,n),[s,n,Y]),_=V.percentage,D=V.gaps,j=useRef({score:-1,gaps:[]});useEffect(()=>{let t=j.current;M&&(_!==t.score||D!==t.gaps)&&M(_,D),j.current={score:_,gaps:D};},[_,D,M]);let lt=useMemo(()=>{switch(P){case 1:return n.org.name.trim().length>0&&n.org.privacyEmail.trim().length>0;case 2:return n.dataCategories.some(t=>t.selected);case 3:return n.purposes.length>0;case 4:return true;default:return false}},[P,n]),dt=useCallback(t=>{let e=Math.min(Math.max(1,t),4);e<4&&(T.current=false),C(e);},[]),pt=useCallback(()=>{C(t=>Math.min(t+1,4));},[]),ut=useCallback(()=>{T.current=false,C(t=>Math.max(t-1,1));},[]),mt=useCallback(t=>{v(e=>a$1(a$1({},e),t));},[]),gt=useCallback(t=>{v(e=>b(a$1({},e),{org:a$1(a$1({},e.org),t)}));},[]),ft=useCallback(t=>{v(e=>b(a$1({},e),{dataCategories:e.dataCategories.map(r=>r.id===t?b(a$1({},r),{selected:!r.selected}):r)}));},[]),Pt=useCallback(t=>{v(e=>{let r=t,i=e.purposes.includes(r);return b(a$1({},e),{purposes:i?e.purposes.filter(o=>o!==t):[...e.purposes,r]})});},[]),Ct=useCallback(t=>{v(e=>b(a$1({},e),{thirdPartyProcessors:[...e.thirdPartyProcessors,t]}));},[]),yt=useCallback(t=>{v(e=>b(a$1({},e),{thirdPartyProcessors:e.thirdPartyProcessors.filter((r,i)=>i!==t)}));},[]),St=useCallback(t=>{O(e=>e.length>=nt?e:[...e,b(a$1({},t),{id:st(),required:false})]);},[]),vt=useCallback((t,e)=>{O(r=>r.map(i=>i.id===t?a$1(a$1({},i),e):i));},[]),xt=useCallback(t=>{O(e=>e.filter(r=>r.id!==t)),$(e=>e.filter(r=>r!==t)),I(e=>{let r=a$1({},e);return delete r[t],r});},[]),ht=useCallback((t,e)=>{$(r=>{let i=r.length>0?r:d$2.map(m=>m.id),o=i.indexOf(t);if(o===-1){let m=d$2.map(It=>It.id),y=m.indexOf(t);if(y===-1)return r;let G=e==="up"?y-1:y+1;if(G<0||G>=m.length)return m;let k=[...m];return [k[y],k[G]]=[k[G],k[y]],k}let l=e==="up"?o-1:o+1;if(l<0||l>=i.length)return i;let p=[...i];return [p[o],p[l]]=[p[l],p[o]],p});},[d$2]),Dt=useCallback((t,e)=>{I(r=>b(a$1({},r),{[t]:e}));},[]),bt=useCallback(t=>{let e=D.find(r=>r.requirementId===t);if(e)switch(e.fixType){case "fill_field":{T.current=false;let i=["data-categories-disclosed"],o=["purpose-of-processing"];i.includes(t)?C(2):o.includes(t)?C(3):(C(1));break}case "add_section":{if(!e.suggestedContent)break;O(r=>r.length>=nt?r:[...r,{id:st(),title:e.requirement,content:e.suggestedContent,order:999,required:false}]);break}case "add_content":{if(!e.suggestedContent)break;let r="data-subject-rights";I(i=>{var l,p,m;let o=(m=(p=i[r])!=null?p:(l=d$2.find(y=>y.id===r))==null?void 0:l.template)!=null?m:"";return b(a$1({},i),{[r]:`${o}
2
2
 
3
3
  ${e.suggestedContent}`.trim()})});break}}},[D,d$2]),X=useCallback(t=>({id:f$1.current,templateContext:n,customSections:b$2,sectionOverrides:x,sectionOrder:E,currentStep:t,lastSavedAt:Date.now(),status:"draft"}),[n,b$2,x,E]),Ot=useCallback(()=>d(null,null,function*(){let t=X(P);try{yield Promise.resolve(S.current.save(t)),z(t.lastSavedAt),q(!0);}catch(e){console.warn("[ndpr-toolkit] Failed to save draft:",e);}}),[X,P]),Et=useCallback(()=>{Promise.resolve(S.current.remove()).catch(t=>{console.warn("[ndpr-toolkit] Failed to remove draft:",t);}),f$1.current=it(),T.current=false,v(e()),O([]),I({}),$([]),C(1),q(false),z(null);},[]);useEffect(()=>{if(!N)return R.current&&clearTimeout(R.current),R.current=setTimeout(()=>{let t=X(P);Promise.resolve(S.current.save(t)).then(()=>{z(t.lastSavedAt),q(true);}).catch(e=>{console.warn("[ndpr-toolkit] Auto-save failed:",e);});},_t),()=>{R.current&&clearTimeout(R.current);}},[n,b$2,x,E,P,N,X]),useEffect(()=>{P===4&&s&&A&&!T.current&&(T.current=true,A(s));},[P,s,A]);let Tt=useCallback(t=>d(null,null,function*(){let e=s!=null?s:w(n,d$2,f$1.current);return c$1(e,t)}),[s,n,d$2]),wt=useCallback(t=>d(null,null,function*(){let e=s!=null?s:w(n,d$2,f$1.current);return d$1(e,t)}),[s,n,d$2]),At=useCallback(t=>{let e=s!=null?s:w(n,d$2,f$1.current);return a$2(e,t)},[s,n,d$2]),Mt=useCallback(()=>{let t=s!=null?s:w(n,d$2,f$1.current);return b$1(t)},[s,n,d$2]);return {currentStep:P,goToStep:dt,nextStep:pt,prevStep:ut,canProceed:lt,context:n,updateContext:mt,updateOrg:gt,toggleDataCategory:ft,togglePurpose:Pt,addProcessor:Ct,removeProcessor:yt,policy:s,sections:d$2,customSections:b$2,addCustomSection:St,updateCustomSection:vt,removeCustomSection:xt,reorderSections:ht,editSectionContent:Dt,sectionOverrides:x,complianceScore:_,complianceResult:V,complianceGaps:D,applyFix:bt,handleExportPDF:Tt,handleExportDOCX:wt,handleExportHTML:At,handleExportMarkdown:Mt,isDraftSaved:at,lastSavedAt:ct,saveDraft:Ot,discardDraft:Et,isLoading:N}}export{Ut as a};
@@ -0,0 +1,2 @@
1
+ import {a as a$2}from'./chunk-EWVK45Z3.mjs';import {c}from'./chunk-25TNTLHJ.mjs';import {a}from'./chunk-SFGW37LE.mjs';import {a as a$1,b}from'./chunk-ZJYULEER.mjs';import {useState}from'react';import {jsxs,jsx}from'react/jsx-runtime';var fr=({categories:Ze,onSubmit:Ge,onValidationError:u,title:x,formDescription:C,submitButtonText:S,className:Q="",buttonClassName:X="",classNames:d={},unstyled:c$1=false,isSubmitting:f=false,showConfirmation:Ke=true,confirmationMessage:We="Your breach report has been submitted successfully. The data protection team has been notified.",allowAttachments:Je=true,maxAttachments:A=5,maxFileSize:D=5*1024*1024,allowedFileTypes:R=[".pdf",".jpg",".jpeg",".png",".doc",".docx",".xls",".xlsx",".txt"],defaultValues:t,onReset:w})=>{var we,Fe,qe,Pe,ke,je,Te,Ie,Ee,Be,Me,$e,Oe,Le;let F=c(),Qe=(we=x!=null?x:F.breach.title)!=null?we:"Report a Data Breach",Xe=(Fe=C!=null?C:F.breach.description)!=null?Fe:"Use this form to report a suspected or confirmed data breach in accordance with NDPA Section 40. All fields marked with * are required.",Ve=(qe=S!=null?S:F.breach.submitReport)!=null?qe:"Submit Report",V=r=>{if(!r)return "";let o=new Date(r),l=s=>String(s).padStart(2,"0");return `${o.getFullYear()}-${l(o.getMonth()+1)}-${l(o.getDate())}T${l(o.getHours())}:${l(o.getMinutes())}`},[q,ee]=useState((t==null?void 0:t.title)||""),[P,re]=useState((t==null?void 0:t.description)||""),[k,te]=useState((t==null?void 0:t.category)||""),[j,ie]=useState(V(t==null?void 0:t.discoveredAt)),[T,ae]=useState(V(t==null?void 0:t.occurredAt)),[I,ne]=useState(((Pe=t==null?void 0:t.reporter)==null?void 0:Pe.name)||""),[N,oe]=useState(((ke=t==null?void 0:t.reporter)==null?void 0:ke.email)||""),[E,se]=useState(((je=t==null?void 0:t.reporter)==null?void 0:je.department)||""),[B,de]=useState(((Te=t==null?void 0:t.reporter)==null?void 0:Te.phone)||""),[me,ce]=useState((t==null?void 0:t.affectedSystems)||[]),[er,pe]=useState(((Ie=t==null?void 0:t.affectedSystems)==null?void 0:Ie.join(", "))||""),[M,le]=useState((t==null?void 0:t.dataTypes)||[]),[h,ge]=useState((t==null?void 0:t.estimatedAffectedSubjects)!=null?String(t.estimatedAffectedSubjects):""),[$,be]=useState((t==null?void 0:t.approximateRecordCount)!=null?String(t.approximateRecordCount):""),[O,fe]=useState(((Ee=t==null?void 0:t.dataSubjectCategories)==null?void 0:Ee.join(", "))||""),[he,ve]=useState((Be=t==null?void 0:t.involvesSensitiveData)!=null?Be:false),[L,Ne]=useState((t==null?void 0:t.likelyConsequences)||""),[z,_e]=useState((t==null?void 0:t.mitigationMeasures)||""),[Y,ye]=useState(((Me=t==null?void 0:t.dpoContact)==null?void 0:Me.name)||""),[U,ue]=useState((($e=t==null?void 0:t.dpoContact)==null?void 0:$e.email)||""),[H,xe]=useState(((Oe=t==null?void 0:t.dpoContact)==null?void 0:Oe.phone)||""),[Z,Ce]=useState((Le=t==null?void 0:t.isPhasedReport)!=null?Le:false),[G,Se]=useState((t==null?void 0:t.supplementsReportId)||""),[Ae,De]=useState((t==null?void 0:t.status)||"ongoing"),[K,Re]=useState((t==null?void 0:t.initialActions)||""),[_,W]=useState([]),[rr,J]=useState(false),[a$3,v]=useState({}),tr=()=>{ee(""),re(""),te(""),ie(""),ae(""),ne(""),oe(""),se(""),de(""),ce([]),pe(""),le([]),ge(""),be(""),fe(""),ve(false),Ne(""),_e(""),ye(""),ue(""),xe(""),Ce(false),Se(""),De("ongoing"),Re(""),W([]),J(false),v({}),w==null||w();},ir=r=>{let o=r.target.value;pe(o);let l=o.split(",").map(s=>s.trim()).filter(Boolean);ce(l);},ar=r=>{le(o=>o.includes(r)?o.filter(l=>l!==r):[...o,r]);},nr=r=>{var ze;let o=r.target.files;if(!o)return;let l=[],s={};if(_.length+o.length>A){s.attachments=`Maximum of ${A} files allowed`,v(g=>a$1(a$1({},g),s));return}for(let g=0;g<o.length;g++){let y=o[g];if(y.size>D){s.attachments=`File ${y.name} exceeds the maximum size of ${D/(1024*1024)}MB`;continue}let Ye="."+((ze=y.name.split(".").pop())==null?void 0:ze.toLowerCase());if(!R.includes(Ye)){s.attachments=`File type ${Ye} is not allowed`;continue}l.push(y);}l.length>0&&W(g=>[...g,...l]),Object.keys(s).length>0?v(g=>a$1(a$1({},g),s)):v(g=>b(a$1({},g),{attachments:""}));},or=r=>{W(o=>o.filter((l,s)=>s!==r));},sr=()=>{let r={};return q.trim()||(r.breachTitle="Breach title is required"),P.trim()||(r.description="Description is required"),k||(r.category="Category is required"),j||(r.discoveredAt="Discovery date is required"),I.trim()||(r.reporterName="Reporter name is required"),N.trim()?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(N)||(r.reporterEmail="Reporter email is invalid"):r.reporterEmail="Reporter email is required",E.trim()||(r.reporterDepartment="Reporter department is required"),me.length===0&&(r.affectedSystems="At least one affected system is required"),M.length===0&&(r.dataTypes="At least one data type is required"),h&&isNaN(Number(h))&&(r.estimatedAffectedSubjects="Estimated affected subjects must be a number"),v(r),r},dr=r=>{r.preventDefault();let o=sr();if(Object.keys(o).length>0){u==null||u(o);return}let l={title:a$2(q),description:a$2(P),category:k,discoveredAt:new Date(j).getTime(),occurredAt:T?new Date(T).getTime():void 0,reportedAt:Date.now(),reporter:{name:a$2(I),email:a$2(N),department:a$2(E),phone:B?a$2(B):void 0},affectedSystems:me.map(s=>a$2(s)),dataTypes:M,estimatedAffectedSubjects:h?Number(h):void 0,approximateRecordCount:$?Number($):void 0,dataSubjectCategories:O?O.split(",").map(s=>a$2(s.trim())).filter(Boolean):void 0,involvesSensitiveData:he,likelyConsequences:L?a$2(L):void 0,mitigationMeasures:z?a$2(z):void 0,dpoContact:Y||U?{name:a$2(Y),email:a$2(U),phone:H?a$2(H):void 0}:void 0,isPhasedReport:Z||void 0,supplementsReportId:G?a$2(G):void 0,status:Ae,initialActions:K?a$2(K):void 0,attachments:_.map(s=>({name:s.name,type:s.type,size:s.size,file:s}))};Ge(l),Ke&&J(true);};if(rr)return jsxs("div",{"data-ndpr-component":"breach-report-form",className:`p-4 bg-green-50 dark:bg-green-900/20 rounded-md ${Q}`,children:[jsx("h2",{className:"text-lg font-bold ndpr-text-success mb-2",children:"Report Submitted"}),jsx("p",{className:"ndpr-text-success",children:We}),jsxs("div",{className:"mt-4 p-4 bg-yellow-50 dark:bg-yellow-900/20 rounded-md",children:[jsx("h3",{className:"text-sm font-bold ndpr-text-warning mb-2",children:"Important: Next Steps"}),jsx("p",{className:"ndpr-text-warning text-sm",children:"Under the NDPA (Section 40), data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. The data protection team will assess this breach and determine if notification is required."})]}),jsx("button",{onClick:()=>J(false),className:`mt-4 px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${X}`,children:"Report Another Breach"})]});let mr=[{id:"personal",label:"Personal Information (names, addresses)"},{id:"contact",label:"Contact Information (email, phone)"},{id:"financial",label:"Financial Information (bank details, payment info)"},{id:"health",label:"Health Information"},{id:"identification",label:"Identification Documents (ID cards, passports)"},{id:"login",label:"Login Credentials"},{id:"biometric",label:"Biometric Data"},{id:"children",label:"Children's Data"},{id:"location",label:"Location Data"},{id:"communications",label:"Communications Content"}];return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${Q}`,d.root,c$1),children:[jsx("h2",{className:a("ndpr-section-heading",d.title,c$1),children:Qe}),jsx("p",{className:"ndpr-card__subtitle",children:Xe}),jsx("form",{onSubmit:dr,className:a("",d.form,c$1),children:jsxs("div",{className:"ndpr-form-section",children:[jsxs("div",{className:a("",d.fieldGroup,c$1),children:[jsx("h3",{className:"ndpr-section-heading",children:"Breach Information"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"breachTitle",className:a("ndpr-form-field__label",d.label,c$1),children:["Breach Title/Summary ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{type:"text",id:"breachTitle",value:q,onChange:r=>ee(r.target.value),className:a("ndpr-form-field__input",d.input,c$1),required:true,"aria-invalid":!!a$3.breachTitle,"aria-describedby":a$3.breachTitle?"breachTitle-error":void 0}),a$3.breachTitle&&jsx("p",{id:"breachTitle-error",role:"alert",className:"ndpr-form-field__error",children:a$3.breachTitle})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"category",className:a("ndpr-form-field__label",d.label,c$1),children:["Breach Category ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxs("select",{id:"category",value:k,onChange:r=>te(r.target.value),className:a("ndpr-form-field__input",d.select,c$1),required:true,"aria-invalid":!!a$3.category,"aria-describedby":a$3.category?"category-error":void 0,children:[jsx("option",{value:"",children:"Select a category"}),Ze.map(r=>jsx("option",{value:r.id,children:r.name},r.id))]}),a$3.category&&jsx("p",{id:"category-error",role:"alert",className:"ndpr-form-field__error",children:a$3.category})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{htmlFor:"description",className:a("ndpr-form-field__label",d.label,c$1),children:["Detailed Description ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("textarea",{id:"description",value:P,onChange:r=>re(r.target.value),rows:4,className:a("ndpr-form-field__input",d.textarea,c$1),required:true,"aria-invalid":!!a$3.description,"aria-describedby":a$3.description?"description-error":void 0}),a$3.description&&jsx("p",{id:"description-error",role:"alert",className:"ndpr-form-field__error",children:a$3.description})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"discoveredAt",className:"ndpr-form-field__label",children:["Date Discovered ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{type:"datetime-local",id:"discoveredAt",value:j,onChange:r=>ie(r.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a$3.discoveredAt,"aria-describedby":a$3.discoveredAt?"discoveredAt-error":void 0}),a$3.discoveredAt&&jsx("p",{id:"discoveredAt-error",role:"alert",className:"ndpr-form-field__error",children:a$3.discoveredAt})]}),jsxs("div",{children:[jsx("label",{htmlFor:"occurredAt",className:"ndpr-form-field__label",children:"Date Occurred (if known)"}),jsx("input",{type:"datetime-local",id:"occurredAt",value:T,onChange:r=>ae(r.target.value),className:"ndpr-form-field__input"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"Reporter Information"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"reporterName",className:"ndpr-form-field__label",children:["Your Name ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{type:"text",id:"reporterName",value:I,onChange:r=>ne(r.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a$3.reporterName,"aria-describedby":a$3.reporterName?"reporterName-error":void 0}),a$3.reporterName&&jsx("p",{id:"reporterName-error",role:"alert",className:"ndpr-form-field__error",children:a$3.reporterName})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"reporterEmail",className:"ndpr-form-field__label",children:["Your Email ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{type:"email",id:"reporterEmail",value:N,onChange:r=>oe(r.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a$3.reporterEmail,"aria-describedby":a$3.reporterEmail?"reporterEmail-error":void 0}),a$3.reporterEmail&&jsx("p",{id:"reporterEmail-error",role:"alert",className:"ndpr-form-field__error",children:a$3.reporterEmail})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"reporterDepartment",className:"ndpr-form-field__label",children:["Your Department ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{type:"text",id:"reporterDepartment",value:E,onChange:r=>se(r.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a$3.reporterDepartment,"aria-describedby":a$3.reporterDepartment?"reporterDepartment-error":void 0}),a$3.reporterDepartment&&jsx("p",{id:"reporterDepartment-error",role:"alert",className:"ndpr-form-field__error",children:a$3.reporterDepartment})]}),jsxs("div",{children:[jsx("label",{htmlFor:"reporterPhone",className:"ndpr-form-field__label",children:"Your Phone Number (Optional)"}),jsx("input",{type:"tel",id:"reporterPhone",value:B,onChange:r=>de(r.target.value),className:"ndpr-form-field__input"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"Impact Information"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"affectedSystems",className:"ndpr-form-field__label",children:["Affected Systems/Applications ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{type:"text",id:"affectedSystems",value:er,onChange:ir,placeholder:"e.g. CRM, Email Server, Website (comma separated)",className:"ndpr-form-field__input",required:true,"aria-invalid":!!a$3.affectedSystems,"aria-describedby":a$3.affectedSystems?"affectedSystems-error":void 0}),a$3.affectedSystems&&jsx("p",{id:"affectedSystems-error",role:"alert",className:"ndpr-form-field__error",children:a$3.affectedSystems})]}),jsxs("div",{children:[jsx("label",{htmlFor:"estimatedAffectedSubjects",className:"ndpr-form-field__label",children:"Estimated Number of Affected Data Subjects"}),jsx("input",{type:"text",id:"estimatedAffectedSubjects",value:h,onChange:r=>ge(r.target.value),placeholder:"e.g. 100",className:"ndpr-form-field__input","aria-invalid":!!a$3.estimatedAffectedSubjects,"aria-describedby":a$3.estimatedAffectedSubjects?"estimatedAffectedSubjects-error":void 0}),a$3.estimatedAffectedSubjects&&jsx("p",{id:"estimatedAffectedSubjects-error",role:"alert",className:"ndpr-form-field__error",children:a$3.estimatedAffectedSubjects})]}),jsxs("fieldset",{className:"md:col-span-2","aria-invalid":!!a$3.dataTypes,"aria-describedby":a$3.dataTypes?"dataTypes-error":void 0,children:[jsxs("legend",{className:"ndpr-form-field__label",children:["Types of Data Involved ",jsx("span",{className:"ndpr-form-field__required","aria-hidden":"true",children:"*"}),jsx("span",{className:"sr-only",children:"(required)"})]}),jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:mr.map(r=>jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"checkbox",id:`dataType_${r.id}`,checked:M.includes(r.id),onChange:()=>ar(r.id),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("label",{htmlFor:`dataType_${r.id}`,className:"ml-2 text-sm ndpr-text-muted",children:r.label})]},r.id))}),a$3.dataTypes&&jsx("p",{id:"dataTypes-error",role:"alert",className:"ndpr-form-field__error",children:a$3.dataTypes})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"status",className:"ndpr-form-field__label",children:["Current Status ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxs("select",{id:"status",value:Ae,onChange:r=>De(r.target.value),className:a("ndpr-form-field__input",d.select,c$1),required:true,children:[jsx("option",{value:"ongoing",children:"Ongoing (breach is still active)"}),jsx("option",{value:"contained",children:"Contained (breach is stopped but not resolved)"}),jsx("option",{value:"resolved",children:"Resolved (breach is fully addressed)"})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"approximateRecordCount",className:"ndpr-form-field__label",children:"Approximate Number of Records Concerned"}),jsx("input",{type:"text",id:"approximateRecordCount",value:$,onChange:r=>be(r.target.value),placeholder:"e.g. 5000",className:"ndpr-form-field__input"}),jsx("p",{className:"text-xs ndpr-text-muted mt-1",children:"Required for the NDPC report (NDPA Section 40(2))."})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dataSubjectCategories",className:"ndpr-form-field__label",children:"Categories of Data Subjects Affected"}),jsx("input",{type:"text",id:"dataSubjectCategories",value:O,onChange:r=>fe(r.target.value),placeholder:"e.g. customers, employees, minors",className:"ndpr-form-field__input"}),jsx("p",{className:"text-xs ndpr-text-muted mt-1",children:"Comma-separated. Required for the NDPC report (NDPA Section 40(2))."})]}),jsxs("div",{className:"md:col-span-2 flex items-center",children:[jsx("input",{id:"involvesSensitiveData",type:"checkbox",checked:he,onChange:r=>ve(r.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("label",{htmlFor:"involvesSensitiveData",className:"ml-2 text-sm ndpr-text-muted",children:"Sensitive personal data (NDPA Section 30) is involved"})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"likelyConsequences",className:"ndpr-form-field__label",children:"Likely Consequences for Data Subjects"}),jsx("textarea",{id:"likelyConsequences",value:L,onChange:r=>Ne(r.target.value),placeholder:"e.g. identity theft, financial loss, reputational damage, discrimination",rows:3,className:a("ndpr-form-field__input",d.textarea,c$1)}),jsx("p",{className:"text-xs ndpr-text-muted mt-1",children:"Required content for NDPC report and Section 40(3) communications to data subjects."})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"mitigationMeasures",className:"ndpr-form-field__label",children:"Mitigation Measures"}),jsx("textarea",{id:"mitigationMeasures",value:z,onChange:r=>_e(r.target.value),placeholder:"Measures taken or proposed to mitigate possible adverse effects (NDPA Section 40(3))",rows:3,className:a("ndpr-form-field__input",d.textarea,c$1)})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("h4",{className:"ndpr-section-heading text-sm mt-4",children:"Data Protection Officer (NDPC contact)"}),jsx("p",{className:"text-xs ndpr-text-muted mb-2",children:"Defaults to organisation-level DPO if left blank."})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dpoName",className:"ndpr-form-field__label",children:"DPO Name"}),jsx("input",{type:"text",id:"dpoName",value:Y,onChange:r=>ye(r.target.value),className:"ndpr-form-field__input"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dpoEmail",className:"ndpr-form-field__label",children:"DPO Email"}),jsx("input",{type:"email",id:"dpoEmail",value:U,onChange:r=>ue(r.target.value),className:"ndpr-form-field__input"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dpoPhone",className:"ndpr-form-field__label",children:"DPO Phone"}),jsx("input",{type:"tel",id:"dpoPhone",value:H,onChange:r=>xe(r.target.value),className:"ndpr-form-field__input"})]}),jsxs("div",{className:"md:col-span-2 flex items-center mt-2",children:[jsx("input",{id:"isPhasedReport",type:"checkbox",checked:Z,onChange:r=>Ce(r.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("label",{htmlFor:"isPhasedReport",className:"ml-2 text-sm ndpr-text-muted",children:"This is a phased / interim report (Section 40(2) \u2014 complete info not yet available)"})]}),Z&&jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"supplementsReportId",className:"ndpr-form-field__label",children:"Supplements Report ID (if applicable)"}),jsx("input",{type:"text",id:"supplementsReportId",value:G,onChange:r=>Se(r.target.value),placeholder:"Prior report ID this report supplements",className:"ndpr-form-field__input"})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"initialActions",className:"ndpr-form-field__label",children:"Initial Actions Taken"}),jsx("textarea",{id:"initialActions",value:K,onChange:r=>Re(r.target.value),placeholder:"Describe any immediate actions that have been taken to address the breach",rows:3,className:a("ndpr-form-field__input",d.textarea,c$1)})]})]})]}),Je&&jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"Attachments"}),jsxs("div",{className:"ndpr-form-field",children:[jsx("label",{className:"ndpr-form-field__label",children:"Upload Supporting Files (Optional)"}),jsxs("p",{className:"text-xs ndpr-text-muted mb-2",children:["Max ",A," files, ",D/(1024*1024),"MB each. Allowed types: ",R.join(", ")]}),jsx("input",{type:"file",onChange:nr,multiple:true,className:"ndpr-form-field__input",accept:R.join(",")}),a$3.attachments&&jsx("p",{id:"attachments-error",role:"alert",className:"ndpr-form-field__error",children:a$3.attachments})]}),_.length>0&&jsxs("div",{className:"ndpr-form-field",children:[jsx("h4",{className:"ndpr-form-field__label",children:"Attached Files:"}),jsx("ul",{className:"ndpr-form-section",children:_.map((r,o)=>jsxs("li",{className:"flex items-center justify-between p-2 bg-gray-50 dark:bg-gray-700 rounded",children:[jsxs("div",{className:"flex items-center",children:[jsx("svg",{className:"w-4 h-4 ndpr-text-muted mr-2",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{fillRule:"evenodd",d:"M8 4a3 3 0 00-3 3v4a5 5 0 0010 0V7a1 1 0 112 0v4a7 7 0 11-14 0V7a5 5 0 0110 0v4a3 3 0 11-6 0V7a1 1 0 012 0v4a1 1 0 102 0V7a3 3 0 00-3-3z",clipRule:"evenodd"})}),jsx("span",{className:"text-sm ndpr-text-muted",children:r.name}),jsxs("span",{className:"ml-2 text-xs ndpr-text-muted",children:["(",(r.size/1024).toFixed(1)," KB)"]})]}),jsxs("button",{type:"button",onClick:()=>or(o),"aria-label":`Remove attachment ${r.name}`,className:"text-red-500 hover:ndpr-text-destructive p-2 min-w-[44px] min-h-[44px] flex items-center justify-center",children:[jsx("svg",{"aria-hidden":"true",focusable:"false",className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})}),jsx("span",{className:"sr-only",children:"Remove"})]})]},o))})]})]}),jsxs("div",{className:a("ndpr-alert ndpr-alert--info",d.notice,c$1),children:[jsx("h3",{className:"text-sm font-bold ndpr-text-info mb-2",children:"NDPA Breach Notification Requirements"}),jsx("p",{className:"ndpr-text-info text-sm",children:"Under the Nigeria Data Protection Act (NDPA), Section 40, data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. The data protection team will assess this breach and determine if notification is required."})]}),jsxs("div",{className:"mt-6 relative flex gap-3",children:[f&&d.loadingOverlay&&jsx("div",{className:d.loadingOverlay}),jsx("button",{type:"submit",disabled:f,className:a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${X} ${f?"opacity-50 cursor-not-allowed":""}`,d.primaryButton||d.submitButton,c$1),children:f?"Submitting...":Ve}),jsx("button",{type:"button",onClick:tr,disabled:f,className:a("px-6 py-3 bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-200 rounded-md hover:bg-gray-300 dark:hover:bg-gray-500 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2",void 0,c$1),children:"Reset"})]})]})})]})};
2
+ export{fr as a};
@@ -1,6 +1,6 @@
1
- 'use strict';var chunkLVGT3DLT_js=require('./chunk-LVGT3DLT.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var ye=({sections:_=chunkLVGT3DLT_js.c,variables:U=chunkLVGT3DLT_js.d,onGenerate:L,title:M="NDPA Privacy Policy Generator",description:V="Generate an NDPA-compliant privacy policy for your organization in accordance with NDPA Section 24.",className:K="",buttonClassName:T="",generateButtonText:Q="Generate Policy",showPreview:B=true,allowEditing:N=true,classNames:r,unstyled:x=false})=>{let P=react.useId(),[A,n]=react.useState(_),[i,s]=react.useState(U),[m,$]=react.useState("sections"),[S,X]=react.useState(""),[F,R]=react.useState(""),[J,Z]=react.useState(false),[v,I]=react.useState({});react.useEffect(()=>{n(_);},[_]),react.useEffect(()=>{s(U);},[U]);let G=l=>{n(c=>c.map(a=>a.id===l?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},a),{included:!a.included}):a));},W=(l,c)=>{s(a=>a.map(b=>b.id===l?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},b),{value:c}):b)),v[l]&&I(a=>{let b=chunkRFPLZDIO_js.a({},a);return delete b[l],b});},j=()=>{let l={},c=true;return i.forEach(a=>{a.required&&!a.value&&(l[a.id]=`${a.name} is required`,c=false);}),I(l),c},ee=()=>{if(!j()){$("variables");return}let l=A.filter(b=>b.included),c=Object.fromEntries(i.map(b=>[b.name,b.value])),a="";l.forEach(b=>{a+=`## ${b.title}
1
+ 'use strict';var chunkD2ZKDQVL_js=require('./chunk-D2ZKDQVL.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var ye=({sections:_=chunkD2ZKDQVL_js.c,variables:U=chunkD2ZKDQVL_js.d,onGenerate:L,title:M="NDPA Privacy Policy Generator",description:V="Generate an NDPA-compliant privacy policy for your organization in accordance with NDPA Section 24.",className:K="",buttonClassName:T="",generateButtonText:Q="Generate Policy",showPreview:B=true,allowEditing:N=true,classNames:r,unstyled:x=false})=>{let P=react.useId(),[A,n]=react.useState(_),[i,s]=react.useState(U),[m,$]=react.useState("sections"),[S,X]=react.useState(""),[F,R]=react.useState(""),[J,Z]=react.useState(false),[v,I]=react.useState({});react.useEffect(()=>{n(_);},[_]),react.useEffect(()=>{s(U);},[U]);let G=l=>{n(c=>c.map(a=>a.id===l?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},a),{included:!a.included}):a));},W=(l,c)=>{s(a=>a.map(b=>b.id===l?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},b),{value:c}):b)),v[l]&&I(a=>{let b=chunkRFPLZDIO_js.a({},a);return delete b[l],b});},j=()=>{let l={},c=true;return i.forEach(a=>{a.required&&!a.value&&(l[a.id]=`${a.name} is required`,c=false);}),I(l),c},ee=()=>{if(!j()){$("variables");return}let l=A.filter(b=>b.included),c=Object.fromEntries(i.map(b=>[b.name,b.value])),a="";l.forEach(b=>{a+=`## ${b.title}
2
2
 
3
- `,a+=chunkLVGT3DLT_js.b(b.template,c),a+=`
3
+ `,a+=chunkD2ZKDQVL_js.b(b.template,c),a+=`
4
4
 
5
5
  `;}),X(a),R(a),Z(true),$("preview");},h=()=>{L({sections:A,variables:i,content:N?F:S});},g=()=>jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-generator",className:chunkAME4HJR4_js.a("ndpr-form-section",r==null?void 0:r.sectionList,x),role:"group","aria-labelledby":`${P}-sections-heading`,children:[jsxRuntime.jsx("h3",{id:`${P}-sections-heading`,className:"text-lg font-medium mb-4",children:"Select Policy Sections"}),A.map(l=>{let c=`${P}-section-${l.id}`,a=l.description?`${P}-section-desc-${l.id}`:void 0;return jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("border border-gray-200 dark:border-gray-700 rounded-md p-4",r==null?void 0:r.sectionItem,x),children:jsxRuntime.jsxs("div",{className:"flex items-start",children:[jsxRuntime.jsx("div",{className:"flex items-center h-5",children:jsxRuntime.jsx("input",{id:c,type:"checkbox",checked:l.included,onChange:()=>G(l.id),disabled:l.required,"aria-describedby":a,className:chunkAME4HJR4_js.a("w-4 h-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))] dark:focus:ring-[rgb(var(--ndpr-ring))] dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600",r==null?void 0:r.input,x)})}),jsxRuntime.jsxs("div",{className:"ml-3 text-sm",children:[jsxRuntime.jsxs("label",{htmlFor:c,className:"font-medium ndpr-text-foreground",children:[l.title," ",l.required&&jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"}),l.required&&jsxRuntime.jsx("span",{className:"sr-only",children:" (required)"})]}),l.description&&jsxRuntime.jsx("p",{id:a,className:"ndpr-text-muted mt-1",children:l.description})]})]})},l.id)}),jsxRuntime.jsx("div",{className:"mt-6",children:jsxRuntime.jsx("button",{onClick:()=>$("variables"),className:chunkAME4HJR4_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${T}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.generateButton),x),children:"Next: Fill Variables"})})]}),w=()=>{let l={};return i.forEach(c=>{let a=c.id.split(".")[0];l[a]||(l[a]=[]),l[a].push(c);}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("",r==null?void 0:r.form,x),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Fill Policy Variables"}),jsxRuntime.jsx("div",{className:"ndpr-form-section",children:Object.entries(l).map(([c,a])=>{let b=A.find(e=>e.id===c);return b&&!b.included?null:jsxRuntime.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-md p-4",children:[jsxRuntime.jsx("h4",{className:"font-medium text-lg mb-3",children:b?b.title:"General Information"}),jsxRuntime.jsx("div",{className:"ndpr-form-section",children:a.map(e=>{let y=`${P}-var-${e.id}`,u=e.description?`${P}-var-desc-${e.id}`:void 0,z=v[e.id]?`${P}-var-err-${e.id}`:void 0,O=[u,z].filter(Boolean).join(" ")||void 0;return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:y,className:"ndpr-form-field__label",children:[e.name," ",e.required&&jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),e.description&&jsxRuntime.jsx("p",{id:u,className:"text-xs ndpr-text-muted mb-2",children:e.description}),e.inputType==="textarea"?jsxRuntime.jsx("textarea",{id:y,value:e.value,onChange:E=>W(e.id,E.target.value),rows:4,className:chunkAME4HJR4_js.a(`w-full px-3 py-2 border ${v[e.id]?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,r==null?void 0:r.input,x),required:e.required,"aria-required":e.required||void 0,"aria-describedby":O,"aria-invalid":v[e.id]?true:void 0}):e.inputType==="select"&&e.options?jsxRuntime.jsxs("select",{id:y,value:e.value,onChange:E=>W(e.id,E.target.value),className:chunkAME4HJR4_js.a(`w-full px-3 py-2 border ${v[e.id]?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,r==null?void 0:r.input,x),required:e.required,"aria-required":e.required||void 0,"aria-describedby":O,"aria-invalid":v[e.id]?true:void 0,children:[jsxRuntime.jsx("option",{value:"",children:"Select an option"}),e.options.map(E=>jsxRuntime.jsx("option",{value:E,children:E},E))]}):jsxRuntime.jsx("input",{id:y,type:e.inputType,value:e.value,onChange:E=>W(e.id,E.target.value),className:chunkAME4HJR4_js.a(`w-full px-3 py-2 border ${v[e.id]?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,r==null?void 0:r.input,x),required:e.required,"aria-required":e.required||void 0,"aria-describedby":O,"aria-invalid":v[e.id]?true:void 0}),v[e.id]&&jsxRuntime.jsx("p",{id:z,role:"alert",className:"mt-1 text-sm ndpr-text-destructive dark:text-red-500",children:v[e.id]})]},e.id)})})]},c)})}),jsxRuntime.jsxs("div",{className:"mt-6 flex space-x-4",children:[jsxRuntime.jsx("button",{onClick:()=>$("sections"),className:`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${T}`,children:"Back to Sections"}),jsxRuntime.jsx("button",{onClick:ee,className:chunkAME4HJR4_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${T}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.generateButton),x),children:Q})]})]})},C=()=>{let l=`${P}-policy-content`;return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Preview Generated Policy"}),N?jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("label",{htmlFor:l,className:"ndpr-form-field__label",children:"Edit Policy Content"}),jsxRuntime.jsx("textarea",{id:l,value:F,onChange:c=>R(c.target.value),rows:20,className:"ndpr-form-field__input ndpr-form-field__input--mono"})]}):jsxRuntime.jsx("div",{className:"ndpr-panel","aria-live":"polite",children:jsxRuntime.jsx("div",{className:"prose dark:prose-invert max-w-none",children:S.split(`
6
6
  `).map((c,a)=>c.startsWith("## ")?jsxRuntime.jsx("h3",{className:"text-xl font-bold mt-6 mb-3",children:c.substring(3)},a):c.startsWith("### ")?jsxRuntime.jsx("h4",{className:"text-lg font-bold mt-4 mb-2",children:c.substring(4)},a):c===""?jsxRuntime.jsx("br",{},a):jsxRuntime.jsx("p",{className:"mb-2",children:c},a))})}),jsxRuntime.jsxs("div",{className:"mt-6 flex space-x-4",children:[jsxRuntime.jsx("button",{onClick:()=>$("variables"),className:`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${T}`,children:"Back to Variables"}),jsxRuntime.jsx("button",{onClick:h,className:`px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${T}`,children:"Save Policy"})]})]})},q=()=>{switch(m){case "sections":return g();case "variables":return w();case "preview":return C();default:return g()}};return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${K}`,r==null?void 0:r.root,x),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("mb-6",r==null?void 0:r.header,x),children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",r==null?void 0:r.title,x),children:M}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-card__subtitle",r==null?void 0:r.description,x),children:V})]}),jsxRuntime.jsx("nav",{"aria-label":"Policy generation steps",className:"mb-8",children:jsxRuntime.jsxs("ol",{className:"flex items-center w-full",children:[jsxRuntime.jsxs("li",{className:`flex w-full items-center ${m==="sections"?"ndpr-text-primary":"ndpr-card__subtitle"} after:content-[''] after:w-full after:h-1 after:border-b after:border-gray-200 after:border-1 after:hidden sm:after:inline-block after:mx-6 xl:after:mx-10`,children:[jsxRuntime.jsx("span",{className:`flex items-center justify-center w-8 h-8 ${m==="sections"?"ndpr-alert ndpr-alert--info":"ndpr-panel"} rounded-full shrink-0`,"aria-current":m==="sections"?"step":void 0,children:"1"}),jsxRuntime.jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Sections"}),jsxRuntime.jsx("span",{className:"sr-only",children:m==="sections"?" (current step)":""})]}),jsxRuntime.jsxs("li",{className:`flex w-full items-center ${m==="variables"?"ndpr-text-primary":"ndpr-card__subtitle"} after:content-[''] after:w-full after:h-1 after:border-b after:border-gray-200 after:border-1 after:hidden sm:after:inline-block after:mx-6 xl:after:mx-10`,children:[jsxRuntime.jsx("span",{className:`flex items-center justify-center w-8 h-8 ${m==="variables"?"ndpr-alert ndpr-alert--info":"ndpr-panel"} rounded-full shrink-0`,"aria-current":m==="variables"?"step":void 0,children:"2"}),jsxRuntime.jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Variables"}),jsxRuntime.jsx("span",{className:"sr-only",children:m==="variables"?" (current step)":""})]}),jsxRuntime.jsxs("li",{className:`flex items-center ${m==="preview"?"ndpr-text-primary":"ndpr-card__subtitle"}`,children:[jsxRuntime.jsx("span",{className:`flex items-center justify-center w-8 h-8 ${m==="preview"?"ndpr-alert ndpr-alert--info":"ndpr-panel"} rounded-full shrink-0`,"aria-current":m==="preview"?"step":void 0,children:"3"}),jsxRuntime.jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Preview"}),jsxRuntime.jsx("span",{className:"sr-only",children:m==="preview"?" (current step)":""})]})]})}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-alert ndpr-alert--info",r==null?void 0:r.complianceNotice,x),children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold ndpr-text-info mb-2",children:"NDPA Compliance Notice"}),jsxRuntime.jsx("p",{className:"ndpr-text-info text-sm",children:"This tool helps you generate a privacy policy that aligns with the Nigeria Data Protection Act (NDPA) 2023. While we strive to ensure compliance, we recommend having the final policy reviewed by a legal professional familiar with NDPA requirements."})]}),q()]})};var _e=({content:_,sections:U,variables:L,onExport:M,onEdit:V,title:K="Privacy Policy Preview",description:T="Preview your NDPA-compliant privacy policy before exporting.",className:Q="",buttonClassName:B="",showExportOptions:N=true,showEditButton:r=true,showTableOfContents:x=true,showMetadata:P=true,organizationName:A,lastUpdated:n,classNames:i,unstyled:s=false})=>{let m=react.useId(),[$,S]=react.useState("preview"),X=`${m}-tab-preview`,F=`${m}-tab-markdown`,R=`${m}-panel-preview`,J=`${m}-panel-markdown`,v=(()=>{let h=_.split(`
@@ -0,0 +1 @@
1
+ import {a}from'./chunk-7RBO42IW.mjs';import {useMemo}from'react';function c({input:e}){let p=JSON.stringify(e);return useMemo(()=>a(e),[p])}export{c as a};
@@ -1 +1 @@
1
- import {a}from'./chunk-XJO4DH3L.mjs';import {d,a as a$1}from'./chunk-ZJYULEER.mjs';import {jsx}from'react/jsx-runtime';var q=[{id:"access",name:"Access My Data",description:"Request a copy of your personal data held by us",ndpaSection:"Section 34(1)(a)\u2013(b)",estimatedCompletionTime:30,requiresAdditionalInfo:false},{id:"rectification",name:"Correct My Data",description:"Request corrections to inaccurate personal data",ndpaSection:"Section 34(1)(c)",estimatedCompletionTime:30,requiresAdditionalInfo:true,additionalFields:[{id:"correction_details",label:"What data needs to be corrected?",type:"textarea",required:true,placeholder:"Please describe the inaccurate data and what the correct information should be"}]},{id:"erasure",name:"Delete My Data",description:"Request deletion of your personal data",ndpaSection:"Section 34(1)(d), Section 34(2)",estimatedCompletionTime:30,requiresAdditionalInfo:false},{id:"portability",name:"Export My Data",description:"Receive your data in a portable format",ndpaSection:"Section 38",estimatedCompletionTime:30,requiresAdditionalInfo:false},{id:"restrict",name:"Restrict Processing",description:"Request restriction of data processing",ndpaSection:"Section 34(1)(e)",estimatedCompletionTime:30,requiresAdditionalInfo:false},{id:"object",name:"Object to Processing",description:"Object to processing of your personal data",ndpaSection:"Section 36",estimatedCompletionTime:30,requiresAdditionalInfo:false},{id:"withdraw_consent",name:"Withdraw My Consent",description:"Withdraw consent previously given for processing",ndpaSection:"Section 35",estimatedCompletionTime:30,requiresAdditionalInfo:false}],C=({requestTypes:R=q,adapter:s,classNames:y,unstyled:S,onSubmit:u=()=>{},submitTo:n,submitOptions:e,onSubmitError:t,onSubmitSuccess:r})=>jsx(a,{requestTypes:R,onSubmit:a=>d(null,null,function*(){var d,c;if(n){let h=typeof(e==null?void 0:e.headers)=="function"?e.headers():(d=e==null?void 0:e.headers)!=null?d:{};try{let o=yield fetch(n,{method:"POST",headers:a$1({"Content-Type":"application/json"},h),credentials:(c=e==null?void 0:e.credentials)!=null?c:"same-origin",body:JSON.stringify(a)});if(!o.ok)t==null||t({response:o});else if(r){let l;try{let i=yield o.clone().text();i&&(l=JSON.parse(i));}catch(i){}r({response:o,data:a,body:l});}}catch(o){t==null||t({error:o});}}else s&&s.save(a);u(a);}),classNames:y,unstyled:S});export{C as a};
1
+ import {a}from'./chunk-IPWX5I5P.mjs';import {d,a as a$1}from'./chunk-ZJYULEER.mjs';import {jsx}from'react/jsx-runtime';var q=[{id:"access",name:"Access My Data",description:"Request a copy of your personal data held by us",ndpaSection:"Section 34(1)(a)\u2013(b)",estimatedCompletionTime:30,requiresAdditionalInfo:false},{id:"rectification",name:"Correct My Data",description:"Request corrections to inaccurate personal data",ndpaSection:"Section 34(1)(c)",estimatedCompletionTime:30,requiresAdditionalInfo:true,additionalFields:[{id:"correction_details",label:"What data needs to be corrected?",type:"textarea",required:true,placeholder:"Please describe the inaccurate data and what the correct information should be"}]},{id:"erasure",name:"Delete My Data",description:"Request deletion of your personal data",ndpaSection:"Section 34(1)(d), Section 34(2)",estimatedCompletionTime:30,requiresAdditionalInfo:false},{id:"portability",name:"Export My Data",description:"Receive your data in a portable format",ndpaSection:"Section 38",estimatedCompletionTime:30,requiresAdditionalInfo:false},{id:"restrict",name:"Restrict Processing",description:"Request restriction of data processing",ndpaSection:"Section 34(1)(e)",estimatedCompletionTime:30,requiresAdditionalInfo:false},{id:"object",name:"Object to Processing",description:"Object to processing of your personal data",ndpaSection:"Section 36",estimatedCompletionTime:30,requiresAdditionalInfo:false},{id:"withdraw_consent",name:"Withdraw My Consent",description:"Withdraw consent previously given for processing",ndpaSection:"Section 35",estimatedCompletionTime:30,requiresAdditionalInfo:false}],C=({requestTypes:R=q,adapter:s,classNames:y,unstyled:S,onSubmit:u=()=>{},submitTo:n,submitOptions:e,onSubmitError:t,onSubmitSuccess:r})=>jsx(a,{requestTypes:R,onSubmit:a=>d(null,null,function*(){var d,c;if(n){let h=typeof(e==null?void 0:e.headers)=="function"?e.headers():(d=e==null?void 0:e.headers)!=null?d:{};try{let o=yield fetch(n,{method:"POST",headers:a$1({"Content-Type":"application/json"},h),credentials:(c=e==null?void 0:e.credentials)!=null?c:"same-origin",body:JSON.stringify(a)});if(!o.ok)t==null||t({response:o});else if(r){let l;try{let i=yield o.clone().text();i&&(l=JSON.parse(i));}catch(i){}r({response:o,data:a,body:l});}}catch(o){t==null||t({error:o});}}else s&&s.save(a);u(a);}),classNames:y,unstyled:S});export{C as a};
@@ -1,4 +1,4 @@
1
- import {a as a$1}from'./chunk-RMQ7OLNY.mjs';import {a}from'./chunk-ZJYULEER.mjs';function s(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function q(e){let n=new Set,o=new RegExp(`${s(a$1)}([^${s("\xBB")}]+)${s("\xBB")}`,"g"),i;for(;(i=o.exec(e))!==null;)n.add(i[1].trim());let r=/\{\{\s*([^}\s]+)\s*\}\}/g;for(;(i=r.exec(e))!==null;)n.add(i[1].trim());return Array.from(n)}function P(e,n){if(typeof e=="string"){let o=e,i=n,r=o,c=/\{\{([^}]+)\}\}/g,d;for(;(d=c.exec(o))!==null;){let t=d[1].trim(),a=i[t]||"";r=r.replace(new RegExp(`\\{\\{\\s*${s(t)}\\s*\\}\\}`,"g"),a);}return r}else {let o=e,i=n,r={},c=[];return o.filter(t=>t.included).sort((t,a)=>(t.order||0)-(a.order||0)).forEach(t=>{let a=t.template||t.customContent||t.defaultContent||"",y=/\{\{([^}]+)\}\}/g,m,h=[];for(;(m=y.exec(a))!==null;)h.push(m[1].trim());h.forEach(l=>{let u="";l in i&&(u=i[l]||""),u||c.push(l),a=a.replace(new RegExp(`\\{\\{\\s*${s(l)}\\s*\\}\\}`,"g"),u);}),r[t.id]=a;}),{fullText:Object.values(r).join(`
1
+ import {a as a$1}from'./chunk-BIJSMSUU.mjs';import {a}from'./chunk-ZJYULEER.mjs';function s(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function q(e){let n=new Set,o=new RegExp(`${s(a$1)}([^${s("\xBB")}]+)${s("\xBB")}`,"g"),i;for(;(i=o.exec(e))!==null;)n.add(i[1].trim());let r=/\{\{\s*([^}\s]+)\s*\}\}/g;for(;(i=r.exec(e))!==null;)n.add(i[1].trim());return Array.from(n)}function P(e,n){if(typeof e=="string"){let o=e,i=n,r=o,c=/\{\{([^}]+)\}\}/g,d;for(;(d=c.exec(o))!==null;){let t=d[1].trim(),a=i[t]||"";r=r.replace(new RegExp(`\\{\\{\\s*${s(t)}\\s*\\}\\}`,"g"),a);}return r}else {let o=e,i=n,r={},c=[];return o.filter(t=>t.included).sort((t,a)=>(t.order||0)-(a.order||0)).forEach(t=>{let a=t.template||t.customContent||t.defaultContent||"",y=/\{\{([^}]+)\}\}/g,m,h=[];for(;(m=y.exec(a))!==null;)h.push(m[1].trim());h.forEach(l=>{let u="";l in i&&(u=i[l]||""),u||c.push(l),a=a.replace(new RegExp(`\\{\\{\\s*${s(l)}\\s*\\}\\}`,"g"),u);}),r[t.id]=a;}),{fullText:Object.values(r).join(`
2
2
 
3
3
  `),sectionTexts:r,missingVariables:Array.from(new Set(c))}}}var w=[{id:"data-collection",title:"Data Collection",description:"Describes what personal data is collected and how it is obtained.",order:1,required:true,included:true,template:'{{orgName}} ("we", "us", or "our") collects personal data from users of our services at {{website}}. We collect information you provide directly, such as your name, email address, phone number, and any other details you submit through forms or communications. We may also collect data automatically, including IP addresses, browser type, device information, and usage patterns through cookies and similar technologies. All data collection is conducted in accordance with the Nigeria Data Protection Act (NDPA) 2023.',variables:["orgName","website"]},{id:"legal-basis",title:"Legal Basis for Processing",description:"Specifies the lawful basis for processing personal data under the NDPA.",order:2,required:true,included:true,template:`{{orgName}} processes personal data under one or more of the following lawful bases as prescribed by the NDPA 2023:
4
4
 
@@ -1 +1 @@
1
- 'use strict';var chunk7IFSWCQP_js=require('./chunk-7IFSWCQP.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var d=react.createContext({}),s=class extends react.Component{constructor(e){super(e);this.reset=()=>{this.setState({error:null});};this.state={error:null};}static getDerivedStateFromError(e){return {error:e}}componentDidCatch(e,r){var a,t;(t=(a=this.props).onError)==null||t.call(a,e,r);}render(){let{error:e}=this.state;if(e){let{fallback:r}=this.props;return typeof r=="function"?r(e,this.reset):r!==void 0?r:jsxRuntime.jsxs("div",{role:"alert",style:{padding:"16px",border:"1px solid #e53e3e",borderRadius:"4px",backgroundColor:"#fff5f5",color:"#c53030"},children:[jsxRuntime.jsx("h3",{style:{margin:"0 0 8px 0",fontSize:"16px"},children:"Something went wrong"}),jsxRuntime.jsx("p",{style:{margin:0,fontSize:"14px"},children:e.message})]})}return this.props.children}},E=a=>{var t=a,{children:o,fallback:p,onError:e}=t,r=chunkRFPLZDIO_js.c(t,["children","fallback","onError"]);let l=react.useMemo(()=>{if(!r.theme)return;let n={};return r.theme.primary&&(n["--ndpr-primary"]=r.theme.primary),r.theme.primaryHover&&(n["--ndpr-primary-hover"]=r.theme.primaryHover),r.theme.primaryForeground&&(n["--ndpr-primary-foreground"]=r.theme.primaryForeground),Object.keys(n).length>0?n:void 0},[r.theme]);return jsxRuntime.jsx(d.Provider,{value:r,children:jsxRuntime.jsx(s,{fallback:p,onError:e,children:l?jsxRuntime.jsx("div",{style:l,children:o}):o})})};function v(){return react.useContext(d)}function D(){let{locale:o}=react.useContext(d);return react.useMemo(()=>chunk7IFSWCQP_js.b(o),[o])}exports.a=E;exports.b=v;exports.c=D;
1
+ 'use strict';var chunkWKTKTLMF_js=require('./chunk-WKTKTLMF.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var d=react.createContext({}),s=class extends react.Component{constructor(e){super(e);this.reset=()=>{this.setState({error:null});};this.state={error:null};}static getDerivedStateFromError(e){return {error:e}}componentDidCatch(e,r){var a,t;(t=(a=this.props).onError)==null||t.call(a,e,r);}render(){let{error:e}=this.state;if(e){let{fallback:r}=this.props;return typeof r=="function"?r(e,this.reset):r!==void 0?r:jsxRuntime.jsxs("div",{role:"alert",style:{padding:"16px",border:"1px solid #e53e3e",borderRadius:"4px",backgroundColor:"#fff5f5",color:"#c53030"},children:[jsxRuntime.jsx("h3",{style:{margin:"0 0 8px 0",fontSize:"16px"},children:"Something went wrong"}),jsxRuntime.jsx("p",{style:{margin:0,fontSize:"14px"},children:e.message})]})}return this.props.children}},E=a=>{var t=a,{children:o,fallback:p,onError:e}=t,r=chunkRFPLZDIO_js.c(t,["children","fallback","onError"]);let l=react.useMemo(()=>{if(!r.theme)return;let n={};return r.theme.primary&&(n["--ndpr-primary"]=r.theme.primary),r.theme.primaryHover&&(n["--ndpr-primary-hover"]=r.theme.primaryHover),r.theme.primaryForeground&&(n["--ndpr-primary-foreground"]=r.theme.primaryForeground),Object.keys(n).length>0?n:void 0},[r.theme]);return jsxRuntime.jsx(d.Provider,{value:r,children:jsxRuntime.jsx(s,{fallback:p,onError:e,children:l?jsxRuntime.jsx("div",{style:l,children:o}):o})})};function v(){return react.useContext(d)}function D(){let{locale:o}=react.useContext(d);return react.useMemo(()=>chunkWKTKTLMF_js.b(o),[o])}exports.a=E;exports.b=v;exports.c=D;
@@ -1 +1 @@
1
- 'use strict';var chunkQ64735OC_js=require('./chunk-Q64735OC.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js');var x={saas:{id:"saas",label:"SaaS / B2B Software",description:"Multi-tenant cloud software. Account credentials, usage analytics, cross-border transfer to the SaaS vendor, automated processing for features like spam filtering or fraud scoring.",examples:["team collaboration tools","CRM","developer tools","workflow automation"]},ecommerce:{id:"ecommerce",label:"Ecommerce / Online Store",description:"Online retail. Customer identity, payment data, shipping address, cart abandonment cookies, marketing analytics, third-party payment processors.",examples:["online retail","D2C brand","marketplace","food delivery"]},school:{id:"school",label:"School / Education",description:"Educational institution or edtech platform. Student data including minors (NDPA Section 31 \u2014 parental consent required), academic records, attendance, behavioural data for learning analytics.",examples:["K-12 school","edtech app","tutoring platform","online courses"]},healthcare:{id:"healthcare",label:"Healthcare / HealthTech",description:"Medical practice, hospital, telemedicine, or health insurance. Sensitive personal data (NDPA Section 30 \u2014 medical), prescription history, insurance claims, biometric data.",examples:["hospital","telemedicine","pharmacy","health insurance"]},procurement:{id:"procurement",label:"Procurement / B2G",description:"Government procurement, vendor management, public-sector bidding. Vendor company data, tax IDs, beneficial-owner information, contract records, sometimes politically-exposed-person (PEP) data.",examples:["e-procurement portal","vendor registry","government supplier database"]}},a={fullName:"full-name",contactDetails:"contact-details",govIds:"government-ids",credentials:"account-credentials",payment:"payment-info",financialRecords:"financial-records",bvn:"bvn",device:"device-info",usage:"usage-data",location:"location-data",cookies:"cookies",health:"health-data",biometric:"biometric-data",children:"children"};function s(e){let t=new Set(e);return chunkQ64735OC_js.d.map(r=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},r),{selected:t.has(r.id)}))}function h(e,t){var r,c,l,d,p,m;return t?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},e),{org:chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},e.org),{name:(r=t.orgName)!=null?r:e.org.name,website:(c=t.website)!=null?c:e.org.website,privacyEmail:(l=t.privacyEmail)!=null?l:e.org.privacyEmail,address:(d=t.address)!=null?d:e.org.address,dpoName:(p=t.dpoName)!=null?p:e.org.dpoName,dpoEmail:(m=t.dpoEmail)!=null?m:e.org.dpoEmail})}):e}var f=["service_delivery","analytics","marketing","fraud_prevention"],y=["service_delivery","marketing","analytics","fraud_prevention","legal_compliance"],v=["service_delivery","analytics","legal_compliance"],C=["service_delivery","legal_compliance","research"],T=["service_delivery","legal_compliance","fraud_prevention"];function P(){let e=chunkQ64735OC_js.e();return e.org.industry="saas",e.org.orgSize="startup",e.dataCategories=s([a.fullName,a.contactDetails,a.credentials,a.device,a.usage,a.cookies]),e.purposes=f,e.hasChildrenData=false,e.hasSensitiveData=false,e.hasFinancialData=false,e.hasCrossBorderTransfer=true,e.hasAutomatedDecisions=false,e}function S(){let e=chunkQ64735OC_js.e();return e.org.industry="ecommerce",e.org.orgSize="midsize",e.dataCategories=s([a.fullName,a.contactDetails,a.payment,a.financialRecords,a.device,a.usage,a.location,a.cookies]),e.purposes=y,e.hasChildrenData=false,e.hasSensitiveData=false,e.hasFinancialData=true,e.hasCrossBorderTransfer=true,e.hasAutomatedDecisions=true,e}function D(){let e=chunkQ64735OC_js.e();return e.org.industry="education",e.org.orgSize="midsize",e.dataCategories=s([a.fullName,a.contactDetails,a.govIds,a.credentials,a.usage,a.cookies,a.children]),e.purposes=v,e.hasChildrenData=true,e.hasSensitiveData=false,e.hasFinancialData=false,e.hasCrossBorderTransfer=false,e.hasAutomatedDecisions=false,e}function E(){let e=chunkQ64735OC_js.e();return e.org.industry="healthcare",e.org.orgSize="enterprise",e.dataCategories=s([a.fullName,a.contactDetails,a.govIds,a.payment,a.health,a.biometric]),e.purposes=C,e.hasChildrenData=false,e.hasSensitiveData=true,e.hasFinancialData=true,e.hasCrossBorderTransfer=false,e.hasAutomatedDecisions=false,e}function O(){let e=chunkQ64735OC_js.e();return e.org.industry="government",e.org.orgSize="enterprise",e.dataCategories=s([a.fullName,a.contactDetails,a.govIds,a.financialRecords,a.bvn]),e.purposes=T,e.hasChildrenData=false,e.hasSensitiveData=false,e.hasFinancialData=true,e.hasCrossBorderTransfer=false,e.hasAutomatedDecisions=false,e}var g={saas:P,ecommerce:S,school:D,healthcare:E,procurement:O};function _(e,t){let r=g[e];if(!r)throw new Error(`[ndpr-toolkit] Unknown org template id: ${String(e)}. Expected one of: ${Object.keys(g).join(", ")}.`);return h(r(),t)}exports.a=x;exports.b=_;
1
+ 'use strict';var chunk6LJHLE6G_js=require('./chunk-6LJHLE6G.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js');var x={saas:{id:"saas",label:"SaaS / B2B Software",description:"Multi-tenant cloud software. Account credentials, usage analytics, cross-border transfer to the SaaS vendor, automated processing for features like spam filtering or fraud scoring.",examples:["team collaboration tools","CRM","developer tools","workflow automation"]},ecommerce:{id:"ecommerce",label:"Ecommerce / Online Store",description:"Online retail. Customer identity, payment data, shipping address, cart abandonment cookies, marketing analytics, third-party payment processors.",examples:["online retail","D2C brand","marketplace","food delivery"]},school:{id:"school",label:"School / Education",description:"Educational institution or edtech platform. Student data including minors (NDPA Section 31 \u2014 parental consent required), academic records, attendance, behavioural data for learning analytics.",examples:["K-12 school","edtech app","tutoring platform","online courses"]},healthcare:{id:"healthcare",label:"Healthcare / HealthTech",description:"Medical practice, hospital, telemedicine, or health insurance. Sensitive personal data (NDPA Section 30 \u2014 medical), prescription history, insurance claims, biometric data.",examples:["hospital","telemedicine","pharmacy","health insurance"]},procurement:{id:"procurement",label:"Procurement / B2G",description:"Government procurement, vendor management, public-sector bidding. Vendor company data, tax IDs, beneficial-owner information, contract records, sometimes politically-exposed-person (PEP) data.",examples:["e-procurement portal","vendor registry","government supplier database"]}},a={fullName:"full-name",contactDetails:"contact-details",govIds:"government-ids",credentials:"account-credentials",payment:"payment-info",financialRecords:"financial-records",bvn:"bvn",device:"device-info",usage:"usage-data",location:"location-data",cookies:"cookies",health:"health-data",biometric:"biometric-data",children:"children"};function s(e){let t=new Set(e);return chunk6LJHLE6G_js.d.map(r=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},r),{selected:t.has(r.id)}))}function h(e,t){var r,c,l,d,p,m;return t?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},e),{org:chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},e.org),{name:(r=t.orgName)!=null?r:e.org.name,website:(c=t.website)!=null?c:e.org.website,privacyEmail:(l=t.privacyEmail)!=null?l:e.org.privacyEmail,address:(d=t.address)!=null?d:e.org.address,dpoName:(p=t.dpoName)!=null?p:e.org.dpoName,dpoEmail:(m=t.dpoEmail)!=null?m:e.org.dpoEmail})}):e}var f=["service_delivery","analytics","marketing","fraud_prevention"],y=["service_delivery","marketing","analytics","fraud_prevention","legal_compliance"],v=["service_delivery","analytics","legal_compliance"],C=["service_delivery","legal_compliance","research"],T=["service_delivery","legal_compliance","fraud_prevention"];function P(){let e=chunk6LJHLE6G_js.e();return e.org.industry="saas",e.org.orgSize="startup",e.dataCategories=s([a.fullName,a.contactDetails,a.credentials,a.device,a.usage,a.cookies]),e.purposes=f,e.hasChildrenData=false,e.hasSensitiveData=false,e.hasFinancialData=false,e.hasCrossBorderTransfer=true,e.hasAutomatedDecisions=false,e}function S(){let e=chunk6LJHLE6G_js.e();return e.org.industry="ecommerce",e.org.orgSize="midsize",e.dataCategories=s([a.fullName,a.contactDetails,a.payment,a.financialRecords,a.device,a.usage,a.location,a.cookies]),e.purposes=y,e.hasChildrenData=false,e.hasSensitiveData=false,e.hasFinancialData=true,e.hasCrossBorderTransfer=true,e.hasAutomatedDecisions=true,e}function D(){let e=chunk6LJHLE6G_js.e();return e.org.industry="education",e.org.orgSize="midsize",e.dataCategories=s([a.fullName,a.contactDetails,a.govIds,a.credentials,a.usage,a.cookies,a.children]),e.purposes=v,e.hasChildrenData=true,e.hasSensitiveData=false,e.hasFinancialData=false,e.hasCrossBorderTransfer=false,e.hasAutomatedDecisions=false,e}function E(){let e=chunk6LJHLE6G_js.e();return e.org.industry="healthcare",e.org.orgSize="enterprise",e.dataCategories=s([a.fullName,a.contactDetails,a.govIds,a.payment,a.health,a.biometric]),e.purposes=C,e.hasChildrenData=false,e.hasSensitiveData=true,e.hasFinancialData=true,e.hasCrossBorderTransfer=false,e.hasAutomatedDecisions=false,e}function O(){let e=chunk6LJHLE6G_js.e();return e.org.industry="government",e.org.orgSize="enterprise",e.dataCategories=s([a.fullName,a.contactDetails,a.govIds,a.financialRecords,a.bvn]),e.purposes=T,e.hasChildrenData=false,e.hasSensitiveData=false,e.hasFinancialData=true,e.hasCrossBorderTransfer=false,e.hasAutomatedDecisions=false,e}var g={saas:P,ecommerce:S,school:D,healthcare:E,procurement:O};function _(e,t){let r=g[e];if(!r)throw new Error(`[ndpr-toolkit] Unknown org template id: ${String(e)}. Expected one of: ${Object.keys(g).join(", ")}.`);return h(r(),t)}exports.a=x;exports.b=_;
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkUXUMYP4L_js=require('./chunk-UXUMYP4L.js'),chunkNDKDKDDX_js=require('./chunk-NDKDKDDX.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var fr=({categories:Ze,onSubmit:Ge,onValidationError:u,title:x,formDescription:C,submitButtonText:S,className:Q="",buttonClassName:X="",classNames:d={},unstyled:c=false,isSubmitting:f=false,showConfirmation:Ke=true,confirmationMessage:We="Your breach report has been submitted successfully. The data protection team has been notified.",allowAttachments:Je=true,maxAttachments:A=5,maxFileSize:D=5*1024*1024,allowedFileTypes:R=[".pdf",".jpg",".jpeg",".png",".doc",".docx",".xls",".xlsx",".txt"],defaultValues:t,onReset:w})=>{var we,Fe,qe,Pe,ke,je,Te,Ie,Ee,Be,Me,$e,Oe,Le;let F=chunkNDKDKDDX_js.c(),Qe=(we=x!=null?x:F.breach.title)!=null?we:"Report a Data Breach",Xe=(Fe=C!=null?C:F.breach.description)!=null?Fe:"Use this form to report a suspected or confirmed data breach in accordance with NDPA Section 40. All fields marked with * are required.",Ve=(qe=S!=null?S:F.breach.submitReport)!=null?qe:"Submit Report",V=r=>{if(!r)return "";let o=new Date(r),l=s=>String(s).padStart(2,"0");return `${o.getFullYear()}-${l(o.getMonth()+1)}-${l(o.getDate())}T${l(o.getHours())}:${l(o.getMinutes())}`},[q,ee]=react.useState((t==null?void 0:t.title)||""),[P,re]=react.useState((t==null?void 0:t.description)||""),[k,te]=react.useState((t==null?void 0:t.category)||""),[j,ie]=react.useState(V(t==null?void 0:t.discoveredAt)),[T,ae]=react.useState(V(t==null?void 0:t.occurredAt)),[I,ne]=react.useState(((Pe=t==null?void 0:t.reporter)==null?void 0:Pe.name)||""),[N,oe]=react.useState(((ke=t==null?void 0:t.reporter)==null?void 0:ke.email)||""),[E,se]=react.useState(((je=t==null?void 0:t.reporter)==null?void 0:je.department)||""),[B,de]=react.useState(((Te=t==null?void 0:t.reporter)==null?void 0:Te.phone)||""),[me,ce]=react.useState((t==null?void 0:t.affectedSystems)||[]),[er,pe]=react.useState(((Ie=t==null?void 0:t.affectedSystems)==null?void 0:Ie.join(", "))||""),[M,le]=react.useState((t==null?void 0:t.dataTypes)||[]),[h,ge]=react.useState((t==null?void 0:t.estimatedAffectedSubjects)!=null?String(t.estimatedAffectedSubjects):""),[$,be]=react.useState((t==null?void 0:t.approximateRecordCount)!=null?String(t.approximateRecordCount):""),[O,fe]=react.useState(((Ee=t==null?void 0:t.dataSubjectCategories)==null?void 0:Ee.join(", "))||""),[he,ve]=react.useState((Be=t==null?void 0:t.involvesSensitiveData)!=null?Be:false),[L,Ne]=react.useState((t==null?void 0:t.likelyConsequences)||""),[z,_e]=react.useState((t==null?void 0:t.mitigationMeasures)||""),[Y,ye]=react.useState(((Me=t==null?void 0:t.dpoContact)==null?void 0:Me.name)||""),[U,ue]=react.useState((($e=t==null?void 0:t.dpoContact)==null?void 0:$e.email)||""),[H,xe]=react.useState(((Oe=t==null?void 0:t.dpoContact)==null?void 0:Oe.phone)||""),[Z,Ce]=react.useState((Le=t==null?void 0:t.isPhasedReport)!=null?Le:false),[G,Se]=react.useState((t==null?void 0:t.supplementsReportId)||""),[Ae,De]=react.useState((t==null?void 0:t.status)||"ongoing"),[K,Re]=react.useState((t==null?void 0:t.initialActions)||""),[_,W]=react.useState([]),[rr,J]=react.useState(false),[a,v]=react.useState({}),tr=()=>{ee(""),re(""),te(""),ie(""),ae(""),ne(""),oe(""),se(""),de(""),ce([]),pe(""),le([]),ge(""),be(""),fe(""),ve(false),Ne(""),_e(""),ye(""),ue(""),xe(""),Ce(false),Se(""),De("ongoing"),Re(""),W([]),J(false),v({}),w==null||w();},ir=r=>{let o=r.target.value;pe(o);let l=o.split(",").map(s=>s.trim()).filter(Boolean);ce(l);},ar=r=>{le(o=>o.includes(r)?o.filter(l=>l!==r):[...o,r]);},nr=r=>{var ze;let o=r.target.files;if(!o)return;let l=[],s={};if(_.length+o.length>A){s.attachments=`Maximum of ${A} files allowed`,v(g=>chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},g),s));return}for(let g=0;g<o.length;g++){let y=o[g];if(y.size>D){s.attachments=`File ${y.name} exceeds the maximum size of ${D/(1024*1024)}MB`;continue}let Ye="."+((ze=y.name.split(".").pop())==null?void 0:ze.toLowerCase());if(!R.includes(Ye)){s.attachments=`File type ${Ye} is not allowed`;continue}l.push(y);}l.length>0&&W(g=>[...g,...l]),Object.keys(s).length>0?v(g=>chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},g),s)):v(g=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},g),{attachments:""}));},or=r=>{W(o=>o.filter((l,s)=>s!==r));},sr=()=>{let r={};return q.trim()||(r.breachTitle="Breach title is required"),P.trim()||(r.description="Description is required"),k||(r.category="Category is required"),j||(r.discoveredAt="Discovery date is required"),I.trim()||(r.reporterName="Reporter name is required"),N.trim()?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(N)||(r.reporterEmail="Reporter email is invalid"):r.reporterEmail="Reporter email is required",E.trim()||(r.reporterDepartment="Reporter department is required"),me.length===0&&(r.affectedSystems="At least one affected system is required"),M.length===0&&(r.dataTypes="At least one data type is required"),h&&isNaN(Number(h))&&(r.estimatedAffectedSubjects="Estimated affected subjects must be a number"),v(r),r},dr=r=>{r.preventDefault();let o=sr();if(Object.keys(o).length>0){u==null||u(o);return}let l={title:chunkUXUMYP4L_js.a(q),description:chunkUXUMYP4L_js.a(P),category:k,discoveredAt:new Date(j).getTime(),occurredAt:T?new Date(T).getTime():void 0,reportedAt:Date.now(),reporter:{name:chunkUXUMYP4L_js.a(I),email:chunkUXUMYP4L_js.a(N),department:chunkUXUMYP4L_js.a(E),phone:B?chunkUXUMYP4L_js.a(B):void 0},affectedSystems:me.map(s=>chunkUXUMYP4L_js.a(s)),dataTypes:M,estimatedAffectedSubjects:h?Number(h):void 0,approximateRecordCount:$?Number($):void 0,dataSubjectCategories:O?O.split(",").map(s=>chunkUXUMYP4L_js.a(s.trim())).filter(Boolean):void 0,involvesSensitiveData:he,likelyConsequences:L?chunkUXUMYP4L_js.a(L):void 0,mitigationMeasures:z?chunkUXUMYP4L_js.a(z):void 0,dpoContact:Y||U?{name:chunkUXUMYP4L_js.a(Y),email:chunkUXUMYP4L_js.a(U),phone:H?chunkUXUMYP4L_js.a(H):void 0}:void 0,isPhasedReport:Z||void 0,supplementsReportId:G?chunkUXUMYP4L_js.a(G):void 0,status:Ae,initialActions:K?chunkUXUMYP4L_js.a(K):void 0,attachments:_.map(s=>({name:s.name,type:s.type,size:s.size,file:s}))};Ge(l),Ke&&J(true);};if(rr)return jsxRuntime.jsxs("div",{"data-ndpr-component":"breach-report-form",className:`p-4 bg-green-50 dark:bg-green-900/20 rounded-md ${Q}`,children:[jsxRuntime.jsx("h2",{className:"text-lg font-bold ndpr-text-success mb-2",children:"Report Submitted"}),jsxRuntime.jsx("p",{className:"ndpr-text-success",children:We}),jsxRuntime.jsxs("div",{className:"mt-4 p-4 bg-yellow-50 dark:bg-yellow-900/20 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold ndpr-text-warning mb-2",children:"Important: Next Steps"}),jsxRuntime.jsx("p",{className:"ndpr-text-warning text-sm",children:"Under the NDPA (Section 40), data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. The data protection team will assess this breach and determine if notification is required."})]}),jsxRuntime.jsx("button",{onClick:()=>J(false),className:`mt-4 px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${X}`,children:"Report Another Breach"})]});let mr=[{id:"personal",label:"Personal Information (names, addresses)"},{id:"contact",label:"Contact Information (email, phone)"},{id:"financial",label:"Financial Information (bank details, payment info)"},{id:"health",label:"Health Information"},{id:"identification",label:"Identification Documents (ID cards, passports)"},{id:"login",label:"Login Credentials"},{id:"biometric",label:"Biometric Data"},{id:"children",label:"Children's Data"},{id:"location",label:"Location Data"},{id:"communications",label:"Communications Content"}];return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${Q}`,d.root,c),children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",d.title,c),children:Qe}),jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:Xe}),jsxRuntime.jsx("form",{onSubmit:dr,className:chunkAME4HJR4_js.a("",d.form,c),children:jsxRuntime.jsxs("div",{className:"ndpr-form-section",children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("",d.fieldGroup,c),children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:"Breach Information"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"breachTitle",className:chunkAME4HJR4_js.a("ndpr-form-field__label",d.label,c),children:["Breach Title/Summary ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"breachTitle",value:q,onChange:r=>ee(r.target.value),className:chunkAME4HJR4_js.a("ndpr-form-field__input",d.input,c),required:true,"aria-invalid":!!a.breachTitle,"aria-describedby":a.breachTitle?"breachTitle-error":void 0}),a.breachTitle&&jsxRuntime.jsx("p",{id:"breachTitle-error",role:"alert",className:"ndpr-form-field__error",children:a.breachTitle})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"category",className:chunkAME4HJR4_js.a("ndpr-form-field__label",d.label,c),children:["Breach Category ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsxs("select",{id:"category",value:k,onChange:r=>te(r.target.value),className:chunkAME4HJR4_js.a("ndpr-form-field__input",d.select,c),required:true,"aria-invalid":!!a.category,"aria-describedby":a.category?"category-error":void 0,children:[jsxRuntime.jsx("option",{value:"",children:"Select a category"}),Ze.map(r=>jsxRuntime.jsx("option",{value:r.id,children:r.name},r.id))]}),a.category&&jsxRuntime.jsx("p",{id:"category-error",role:"alert",className:"ndpr-form-field__error",children:a.category})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{htmlFor:"description",className:chunkAME4HJR4_js.a("ndpr-form-field__label",d.label,c),children:["Detailed Description ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"description",value:P,onChange:r=>re(r.target.value),rows:4,className:chunkAME4HJR4_js.a("ndpr-form-field__input",d.textarea,c),required:true,"aria-invalid":!!a.description,"aria-describedby":a.description?"description-error":void 0}),a.description&&jsxRuntime.jsx("p",{id:"description-error",role:"alert",className:"ndpr-form-field__error",children:a.description})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"discoveredAt",className:"ndpr-form-field__label",children:["Date Discovered ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"datetime-local",id:"discoveredAt",value:j,onChange:r=>ie(r.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a.discoveredAt,"aria-describedby":a.discoveredAt?"discoveredAt-error":void 0}),a.discoveredAt&&jsxRuntime.jsx("p",{id:"discoveredAt-error",role:"alert",className:"ndpr-form-field__error",children:a.discoveredAt})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"occurredAt",className:"ndpr-form-field__label",children:"Date Occurred (if known)"}),jsxRuntime.jsx("input",{type:"datetime-local",id:"occurredAt",value:T,onChange:r=>ae(r.target.value),className:"ndpr-form-field__input"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:"Reporter Information"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reporterName",className:"ndpr-form-field__label",children:["Your Name ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"reporterName",value:I,onChange:r=>ne(r.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a.reporterName,"aria-describedby":a.reporterName?"reporterName-error":void 0}),a.reporterName&&jsxRuntime.jsx("p",{id:"reporterName-error",role:"alert",className:"ndpr-form-field__error",children:a.reporterName})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reporterEmail",className:"ndpr-form-field__label",children:["Your Email ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"email",id:"reporterEmail",value:N,onChange:r=>oe(r.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a.reporterEmail,"aria-describedby":a.reporterEmail?"reporterEmail-error":void 0}),a.reporterEmail&&jsxRuntime.jsx("p",{id:"reporterEmail-error",role:"alert",className:"ndpr-form-field__error",children:a.reporterEmail})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reporterDepartment",className:"ndpr-form-field__label",children:["Your Department ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"reporterDepartment",value:E,onChange:r=>se(r.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a.reporterDepartment,"aria-describedby":a.reporterDepartment?"reporterDepartment-error":void 0}),a.reporterDepartment&&jsxRuntime.jsx("p",{id:"reporterDepartment-error",role:"alert",className:"ndpr-form-field__error",children:a.reporterDepartment})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"reporterPhone",className:"ndpr-form-field__label",children:"Your Phone Number (Optional)"}),jsxRuntime.jsx("input",{type:"tel",id:"reporterPhone",value:B,onChange:r=>de(r.target.value),className:"ndpr-form-field__input"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:"Impact Information"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"affectedSystems",className:"ndpr-form-field__label",children:["Affected Systems/Applications ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"affectedSystems",value:er,onChange:ir,placeholder:"e.g. CRM, Email Server, Website (comma separated)",className:"ndpr-form-field__input",required:true,"aria-invalid":!!a.affectedSystems,"aria-describedby":a.affectedSystems?"affectedSystems-error":void 0}),a.affectedSystems&&jsxRuntime.jsx("p",{id:"affectedSystems-error",role:"alert",className:"ndpr-form-field__error",children:a.affectedSystems})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"estimatedAffectedSubjects",className:"ndpr-form-field__label",children:"Estimated Number of Affected Data Subjects"}),jsxRuntime.jsx("input",{type:"text",id:"estimatedAffectedSubjects",value:h,onChange:r=>ge(r.target.value),placeholder:"e.g. 100",className:"ndpr-form-field__input","aria-invalid":!!a.estimatedAffectedSubjects,"aria-describedby":a.estimatedAffectedSubjects?"estimatedAffectedSubjects-error":void 0}),a.estimatedAffectedSubjects&&jsxRuntime.jsx("p",{id:"estimatedAffectedSubjects-error",role:"alert",className:"ndpr-form-field__error",children:a.estimatedAffectedSubjects})]}),jsxRuntime.jsxs("fieldset",{className:"md:col-span-2","aria-invalid":!!a.dataTypes,"aria-describedby":a.dataTypes?"dataTypes-error":void 0,children:[jsxRuntime.jsxs("legend",{className:"ndpr-form-field__label",children:["Types of Data Involved ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required","aria-hidden":"true",children:"*"}),jsxRuntime.jsx("span",{className:"sr-only",children:"(required)"})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:mr.map(r=>jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"checkbox",id:`dataType_${r.id}`,checked:M.includes(r.id),onChange:()=>ar(r.id),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:`dataType_${r.id}`,className:"ml-2 text-sm ndpr-text-muted",children:r.label})]},r.id))}),a.dataTypes&&jsxRuntime.jsx("p",{id:"dataTypes-error",role:"alert",className:"ndpr-form-field__error",children:a.dataTypes})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"status",className:"ndpr-form-field__label",children:["Current Status ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsxs("select",{id:"status",value:Ae,onChange:r=>De(r.target.value),className:chunkAME4HJR4_js.a("ndpr-form-field__input",d.select,c),required:true,children:[jsxRuntime.jsx("option",{value:"ongoing",children:"Ongoing (breach is still active)"}),jsxRuntime.jsx("option",{value:"contained",children:"Contained (breach is stopped but not resolved)"}),jsxRuntime.jsx("option",{value:"resolved",children:"Resolved (breach is fully addressed)"})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"approximateRecordCount",className:"ndpr-form-field__label",children:"Approximate Number of Records Concerned"}),jsxRuntime.jsx("input",{type:"text",id:"approximateRecordCount",value:$,onChange:r=>be(r.target.value),placeholder:"e.g. 5000",className:"ndpr-form-field__input"}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted mt-1",children:"Required for the NDPC report (NDPA Section 40(2))."})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dataSubjectCategories",className:"ndpr-form-field__label",children:"Categories of Data Subjects Affected"}),jsxRuntime.jsx("input",{type:"text",id:"dataSubjectCategories",value:O,onChange:r=>fe(r.target.value),placeholder:"e.g. customers, employees, minors",className:"ndpr-form-field__input"}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted mt-1",children:"Comma-separated. Required for the NDPC report (NDPA Section 40(2))."})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2 flex items-center",children:[jsxRuntime.jsx("input",{id:"involvesSensitiveData",type:"checkbox",checked:he,onChange:r=>ve(r.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"involvesSensitiveData",className:"ml-2 text-sm ndpr-text-muted",children:"Sensitive personal data (NDPA Section 30) is involved"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"likelyConsequences",className:"ndpr-form-field__label",children:"Likely Consequences for Data Subjects"}),jsxRuntime.jsx("textarea",{id:"likelyConsequences",value:L,onChange:r=>Ne(r.target.value),placeholder:"e.g. identity theft, financial loss, reputational damage, discrimination",rows:3,className:chunkAME4HJR4_js.a("ndpr-form-field__input",d.textarea,c)}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted mt-1",children:"Required content for NDPC report and Section 40(3) communications to data subjects."})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"mitigationMeasures",className:"ndpr-form-field__label",children:"Mitigation Measures"}),jsxRuntime.jsx("textarea",{id:"mitigationMeasures",value:z,onChange:r=>_e(r.target.value),placeholder:"Measures taken or proposed to mitigate possible adverse effects (NDPA Section 40(3))",rows:3,className:chunkAME4HJR4_js.a("ndpr-form-field__input",d.textarea,c)})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("h4",{className:"ndpr-section-heading text-sm mt-4",children:"Data Protection Officer (NDPC contact)"}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted mb-2",children:"Defaults to organisation-level DPO if left blank."})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dpoName",className:"ndpr-form-field__label",children:"DPO Name"}),jsxRuntime.jsx("input",{type:"text",id:"dpoName",value:Y,onChange:r=>ye(r.target.value),className:"ndpr-form-field__input"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dpoEmail",className:"ndpr-form-field__label",children:"DPO Email"}),jsxRuntime.jsx("input",{type:"email",id:"dpoEmail",value:U,onChange:r=>ue(r.target.value),className:"ndpr-form-field__input"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dpoPhone",className:"ndpr-form-field__label",children:"DPO Phone"}),jsxRuntime.jsx("input",{type:"tel",id:"dpoPhone",value:H,onChange:r=>xe(r.target.value),className:"ndpr-form-field__input"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2 flex items-center mt-2",children:[jsxRuntime.jsx("input",{id:"isPhasedReport",type:"checkbox",checked:Z,onChange:r=>Ce(r.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"isPhasedReport",className:"ml-2 text-sm ndpr-text-muted",children:"This is a phased / interim report (Section 40(2) \u2014 complete info not yet available)"})]}),Z&&jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"supplementsReportId",className:"ndpr-form-field__label",children:"Supplements Report ID (if applicable)"}),jsxRuntime.jsx("input",{type:"text",id:"supplementsReportId",value:G,onChange:r=>Se(r.target.value),placeholder:"Prior report ID this report supplements",className:"ndpr-form-field__input"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"initialActions",className:"ndpr-form-field__label",children:"Initial Actions Taken"}),jsxRuntime.jsx("textarea",{id:"initialActions",value:K,onChange:r=>Re(r.target.value),placeholder:"Describe any immediate actions that have been taken to address the breach",rows:3,className:chunkAME4HJR4_js.a("ndpr-form-field__input",d.textarea,c)})]})]})]}),Je&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:"Attachments"}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("label",{className:"ndpr-form-field__label",children:"Upload Supporting Files (Optional)"}),jsxRuntime.jsxs("p",{className:"text-xs ndpr-text-muted mb-2",children:["Max ",A," files, ",D/(1024*1024),"MB each. Allowed types: ",R.join(", ")]}),jsxRuntime.jsx("input",{type:"file",onChange:nr,multiple:true,className:"ndpr-form-field__input",accept:R.join(",")}),a.attachments&&jsxRuntime.jsx("p",{id:"attachments-error",role:"alert",className:"ndpr-form-field__error",children:a.attachments})]}),_.length>0&&jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("h4",{className:"ndpr-form-field__label",children:"Attached Files:"}),jsxRuntime.jsx("ul",{className:"ndpr-form-section",children:_.map((r,o)=>jsxRuntime.jsxs("li",{className:"flex items-center justify-between p-2 bg-gray-50 dark:bg-gray-700 rounded",children:[jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("svg",{className:"w-4 h-4 ndpr-text-muted mr-2",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{fillRule:"evenodd",d:"M8 4a3 3 0 00-3 3v4a5 5 0 0010 0V7a1 1 0 112 0v4a7 7 0 11-14 0V7a5 5 0 0110 0v4a3 3 0 11-6 0V7a1 1 0 012 0v4a1 1 0 102 0V7a3 3 0 00-3-3z",clipRule:"evenodd"})}),jsxRuntime.jsx("span",{className:"text-sm ndpr-text-muted",children:r.name}),jsxRuntime.jsxs("span",{className:"ml-2 text-xs ndpr-text-muted",children:["(",(r.size/1024).toFixed(1)," KB)"]})]}),jsxRuntime.jsxs("button",{type:"button",onClick:()=>or(o),"aria-label":`Remove attachment ${r.name}`,className:"text-red-500 hover:ndpr-text-destructive p-2 min-w-[44px] min-h-[44px] flex items-center justify-center",children:[jsxRuntime.jsx("svg",{"aria-hidden":"true",focusable:"false",className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})}),jsxRuntime.jsx("span",{className:"sr-only",children:"Remove"})]})]},o))})]})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-alert ndpr-alert--info",d.notice,c),children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold ndpr-text-info mb-2",children:"NDPA Breach Notification Requirements"}),jsxRuntime.jsx("p",{className:"ndpr-text-info text-sm",children:"Under the Nigeria Data Protection Act (NDPA), Section 40, data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. The data protection team will assess this breach and determine if notification is required."})]}),jsxRuntime.jsxs("div",{className:"mt-6 relative flex gap-3",children:[f&&d.loadingOverlay&&jsxRuntime.jsx("div",{className:d.loadingOverlay}),jsxRuntime.jsx("button",{type:"submit",disabled:f,className:chunkAME4HJR4_js.a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${X} ${f?"opacity-50 cursor-not-allowed":""}`,d.primaryButton||d.submitButton,c),children:f?"Submitting...":Ve}),jsxRuntime.jsx("button",{type:"button",onClick:tr,disabled:f,className:chunkAME4HJR4_js.a("px-6 py-3 bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-200 rounded-md hover:bg-gray-300 dark:hover:bg-gray-500 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2",void 0,c),children:"Reset"})]})]})})]})};
2
+ exports.a=fr;
@@ -1 +1 @@
1
- import {a}from'./chunk-BFAX7JQA.mjs';import {jsx}from'react/jsx-runtime';var p=[{id:"essential",label:"Essential Cookies",description:"Required for basic site functionality. Cannot be disabled.",required:true,purpose:"Site operation"},{id:"analytics",label:"Analytics",description:"Help us understand how visitors use our site to improve the experience.",required:false,purpose:"Usage analytics"},{id:"marketing",label:"Marketing",description:"Used to deliver relevant advertisements and track campaign effectiveness.",required:false,purpose:"Targeted advertising"},{id:"preferences",label:"Preferences",description:"Remember your settings and preferences for a personalised experience.",required:false,purpose:"Personalisation"}],f=({extraOptions:a$1=[],options:t,adapter:n,position:o="bottom",classNames:l,unstyled:d,onSave:s,copy:e})=>{let m=t!=null?t:[...p,...a$1];return jsx(a,{options:m,onSave:i=>{n&&n.save(i),s==null||s(i);},position:o,classNames:l,unstyled:d,manageStorage:!n,title:e==null?void 0:e.title,description:e==null?void 0:e.description,acceptAllButtonText:e==null?void 0:e.acceptAll,rejectAllButtonText:e==null?void 0:e.rejectAll,customizeButtonText:e==null?void 0:e.customize,saveButtonText:e==null?void 0:e.save})};export{f as a};
1
+ import {a}from'./chunk-WYH3OA5L.mjs';import {jsx}from'react/jsx-runtime';var p=[{id:"essential",label:"Essential Cookies",description:"Required for basic site functionality. Cannot be disabled.",required:true,purpose:"Site operation"},{id:"analytics",label:"Analytics",description:"Help us understand how visitors use our site to improve the experience.",required:false,purpose:"Usage analytics"},{id:"marketing",label:"Marketing",description:"Used to deliver relevant advertisements and track campaign effectiveness.",required:false,purpose:"Targeted advertising"},{id:"preferences",label:"Preferences",description:"Remember your settings and preferences for a personalised experience.",required:false,purpose:"Personalisation"}],f=({extraOptions:a$1=[],options:t,adapter:n,position:o="bottom",classNames:l,unstyled:d,onSave:s,copy:e})=>{let m=t!=null?t:[...p,...a$1];return jsx(a,{options:m,onSave:i=>{n&&n.save(i),s==null||s(i);},position:o,classNames:l,unstyled:d,manageStorage:!n,title:e==null?void 0:e.title,description:e==null?void 0:e.description,acceptAllButtonText:e==null?void 0:e.acceptAll,rejectAllButtonText:e==null?void 0:e.rejectAll,customizeButtonText:e==null?void 0:e.customize,saveButtonText:e==null?void 0:e.save})};export{f as a};
@@ -1,3 +1,3 @@
1
- 'use strict';var chunkN3MQQUQP_js=require('./chunk-N3MQQUQP.js'),chunkQ64735OC_js=require('./chunk-Q64735OC.js'),chunkVWED6UTN_js=require('./chunk-VWED6UTN.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react');var nt=10,Rt="ndpr_policy_draft",_t=2e3;function st(){return `section_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function it(){return `draft_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function w(u,A,M){let S=Date.now();return {id:M,title:`Privacy Policy${u.org.name?` \u2014 ${u.org.name}`:""}`,templateId:"adaptive-policy-wizard",organizationInfo:{name:u.org.name,website:u.org.website,privacyEmail:u.org.privacyEmail,address:u.org.address,dpoName:u.org.dpoName,dpoEmail:u.org.dpoEmail,industry:u.org.industry},sections:A,variableValues:{},effectiveDate:S,lastUpdated:S,version:"1.0",applicableFrameworks:["ndpa","ndpr"]}}function Ut(u={}){var K;let{onComplete:A,onComplianceChange:M}=u,S=react.useRef((K=u.adapter)!=null?K:chunkVWED6UTN_js.a(Rt));u.adapter&&(S.current=u.adapter);let f=react.useRef(it()),[P,C]=react.useState(1),[n,v]=react.useState(()=>{var t;return (t=u.initialContext)!=null?t:chunkQ64735OC_js.e()}),[b,O]=react.useState([]),[x,I]=react.useState({}),[E,$]=react.useState([]),[at,q]=react.useState(false),[ct,z]=react.useState(null),[N,U]=react.useState(true),T=react.useRef(false),R=react.useRef(null);react.useEffect(()=>{let t=false,e=r=>{r&&(f.current=r.id,v(r.templateContext),O(r.customSections),I(r.sectionOverrides),$(r.sectionOrder),C(r.currentStep),z(r.lastSavedAt),q(true));};try{let r=S.current.load();r instanceof Promise?r.then(i=>{t||(e(i),U(!1));},()=>{t||U(!1);}):(e(r),U(!1));}catch(r){t||U(false);}return ()=>{t=true;}},[]);let d=react.useMemo(()=>{let e=chunkQ64735OC_js.c(n).map(o=>x[o.id]?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},o),{template:x[o.id]}):o),r=b.map(o=>{var l;return {id:o.id,title:o.title,template:(l=x[o.id])!=null?l:o.content,order:o.order,required:false,included:true}}),i=[...e,...r];if(E.length>0){let o=new Map(E.map((l,p)=>[l,p]));return [...i].sort((l,p)=>{let m=o.has(l.id)?o.get(l.id):i.length,y=o.has(p.id)?o.get(p.id):i.length;return m-y})}return [...i].sort((o,l)=>{var p,m;return ((p=o.order)!=null?p:0)-((m=l.order)!=null?m:0)})},[n,b,x,E]),s=react.useMemo(()=>!n.org.name&&!n.org.privacyEmail?null:w(n,d,f.current),[n,d]),Y=react.useMemo(()=>w(chunkQ64735OC_js.e(),[],f.current),[]),V=react.useMemo(()=>chunkQ64735OC_js.f(s!=null?s:Y,n),[s,n,Y]),_=V.percentage,D=V.gaps,j=react.useRef({score:-1,gaps:[]});react.useEffect(()=>{let t=j.current;M&&(_!==t.score||D!==t.gaps)&&M(_,D),j.current={score:_,gaps:D};},[_,D,M]);let lt=react.useMemo(()=>{switch(P){case 1:return n.org.name.trim().length>0&&n.org.privacyEmail.trim().length>0;case 2:return n.dataCategories.some(t=>t.selected);case 3:return n.purposes.length>0;case 4:return true;default:return false}},[P,n]),dt=react.useCallback(t=>{let e=Math.min(Math.max(1,t),4);e<4&&(T.current=false),C(e);},[]),pt=react.useCallback(()=>{C(t=>Math.min(t+1,4));},[]),ut=react.useCallback(()=>{T.current=false,C(t=>Math.max(t-1,1));},[]),mt=react.useCallback(t=>{v(e=>chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},e),t));},[]),gt=react.useCallback(t=>{v(e=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},e),{org:chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},e.org),t)}));},[]),ft=react.useCallback(t=>{v(e=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},e),{dataCategories:e.dataCategories.map(r=>r.id===t?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},r),{selected:!r.selected}):r)}));},[]),Pt=react.useCallback(t=>{v(e=>{let r=t,i=e.purposes.includes(r);return chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},e),{purposes:i?e.purposes.filter(o=>o!==t):[...e.purposes,r]})});},[]),Ct=react.useCallback(t=>{v(e=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},e),{thirdPartyProcessors:[...e.thirdPartyProcessors,t]}));},[]),yt=react.useCallback(t=>{v(e=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},e),{thirdPartyProcessors:e.thirdPartyProcessors.filter((r,i)=>i!==t)}));},[]),St=react.useCallback(t=>{O(e=>e.length>=nt?e:[...e,chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},t),{id:st(),required:false})]);},[]),vt=react.useCallback((t,e)=>{O(r=>r.map(i=>i.id===t?chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},i),e):i));},[]),xt=react.useCallback(t=>{O(e=>e.filter(r=>r.id!==t)),$(e=>e.filter(r=>r!==t)),I(e=>{let r=chunkRFPLZDIO_js.a({},e);return delete r[t],r});},[]),ht=react.useCallback((t,e)=>{$(r=>{let i=r.length>0?r:d.map(m=>m.id),o=i.indexOf(t);if(o===-1){let m=d.map(It=>It.id),y=m.indexOf(t);if(y===-1)return r;let G=e==="up"?y-1:y+1;if(G<0||G>=m.length)return m;let k=[...m];return [k[y],k[G]]=[k[G],k[y]],k}let l=e==="up"?o-1:o+1;if(l<0||l>=i.length)return i;let p=[...i];return [p[o],p[l]]=[p[l],p[o]],p});},[d]),Dt=react.useCallback((t,e)=>{I(r=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},r),{[t]:e}));},[]),bt=react.useCallback(t=>{let e=D.find(r=>r.requirementId===t);if(e)switch(e.fixType){case "fill_field":{T.current=false;let i=["data-categories-disclosed"],o=["purpose-of-processing"];i.includes(t)?C(2):o.includes(t)?C(3):(C(1));break}case "add_section":{if(!e.suggestedContent)break;O(r=>r.length>=nt?r:[...r,{id:st(),title:e.requirement,content:e.suggestedContent,order:999,required:false}]);break}case "add_content":{if(!e.suggestedContent)break;let r="data-subject-rights";I(i=>{var l,p,m;let o=(m=(p=i[r])!=null?p:(l=d.find(y=>y.id===r))==null?void 0:l.template)!=null?m:"";return chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},i),{[r]:`${o}
1
+ 'use strict';var chunkJS7SYL5P_js=require('./chunk-JS7SYL5P.js'),chunk6LJHLE6G_js=require('./chunk-6LJHLE6G.js'),chunkVWED6UTN_js=require('./chunk-VWED6UTN.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react');var nt=10,Rt="ndpr_policy_draft",_t=2e3;function st(){return `section_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function it(){return `draft_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function w(u,A,M){let S=Date.now();return {id:M,title:`Privacy Policy${u.org.name?` \u2014 ${u.org.name}`:""}`,templateId:"adaptive-policy-wizard",organizationInfo:{name:u.org.name,website:u.org.website,privacyEmail:u.org.privacyEmail,address:u.org.address,dpoName:u.org.dpoName,dpoEmail:u.org.dpoEmail,industry:u.org.industry},sections:A,variableValues:{},effectiveDate:S,lastUpdated:S,version:"1.0",applicableFrameworks:["ndpa","ndpr"]}}function Ut(u={}){var K;let{onComplete:A,onComplianceChange:M}=u,S=react.useRef((K=u.adapter)!=null?K:chunkVWED6UTN_js.a(Rt));u.adapter&&(S.current=u.adapter);let f=react.useRef(it()),[P,C]=react.useState(1),[n,v]=react.useState(()=>{var t;return (t=u.initialContext)!=null?t:chunk6LJHLE6G_js.e()}),[b,O]=react.useState([]),[x,I]=react.useState({}),[E,$]=react.useState([]),[at,q]=react.useState(false),[ct,z]=react.useState(null),[N,U]=react.useState(true),T=react.useRef(false),R=react.useRef(null);react.useEffect(()=>{let t=false,e=r=>{r&&(f.current=r.id,v(r.templateContext),O(r.customSections),I(r.sectionOverrides),$(r.sectionOrder),C(r.currentStep),z(r.lastSavedAt),q(true));};try{let r=S.current.load();r instanceof Promise?r.then(i=>{t||(e(i),U(!1));},()=>{t||U(!1);}):(e(r),U(!1));}catch(r){t||U(false);}return ()=>{t=true;}},[]);let d=react.useMemo(()=>{let e=chunk6LJHLE6G_js.c(n).map(o=>x[o.id]?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},o),{template:x[o.id]}):o),r=b.map(o=>{var l;return {id:o.id,title:o.title,template:(l=x[o.id])!=null?l:o.content,order:o.order,required:false,included:true}}),i=[...e,...r];if(E.length>0){let o=new Map(E.map((l,p)=>[l,p]));return [...i].sort((l,p)=>{let m=o.has(l.id)?o.get(l.id):i.length,y=o.has(p.id)?o.get(p.id):i.length;return m-y})}return [...i].sort((o,l)=>{var p,m;return ((p=o.order)!=null?p:0)-((m=l.order)!=null?m:0)})},[n,b,x,E]),s=react.useMemo(()=>!n.org.name&&!n.org.privacyEmail?null:w(n,d,f.current),[n,d]),Y=react.useMemo(()=>w(chunk6LJHLE6G_js.e(),[],f.current),[]),V=react.useMemo(()=>chunk6LJHLE6G_js.f(s!=null?s:Y,n),[s,n,Y]),_=V.percentage,D=V.gaps,j=react.useRef({score:-1,gaps:[]});react.useEffect(()=>{let t=j.current;M&&(_!==t.score||D!==t.gaps)&&M(_,D),j.current={score:_,gaps:D};},[_,D,M]);let lt=react.useMemo(()=>{switch(P){case 1:return n.org.name.trim().length>0&&n.org.privacyEmail.trim().length>0;case 2:return n.dataCategories.some(t=>t.selected);case 3:return n.purposes.length>0;case 4:return true;default:return false}},[P,n]),dt=react.useCallback(t=>{let e=Math.min(Math.max(1,t),4);e<4&&(T.current=false),C(e);},[]),pt=react.useCallback(()=>{C(t=>Math.min(t+1,4));},[]),ut=react.useCallback(()=>{T.current=false,C(t=>Math.max(t-1,1));},[]),mt=react.useCallback(t=>{v(e=>chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},e),t));},[]),gt=react.useCallback(t=>{v(e=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},e),{org:chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},e.org),t)}));},[]),ft=react.useCallback(t=>{v(e=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},e),{dataCategories:e.dataCategories.map(r=>r.id===t?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},r),{selected:!r.selected}):r)}));},[]),Pt=react.useCallback(t=>{v(e=>{let r=t,i=e.purposes.includes(r);return chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},e),{purposes:i?e.purposes.filter(o=>o!==t):[...e.purposes,r]})});},[]),Ct=react.useCallback(t=>{v(e=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},e),{thirdPartyProcessors:[...e.thirdPartyProcessors,t]}));},[]),yt=react.useCallback(t=>{v(e=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},e),{thirdPartyProcessors:e.thirdPartyProcessors.filter((r,i)=>i!==t)}));},[]),St=react.useCallback(t=>{O(e=>e.length>=nt?e:[...e,chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},t),{id:st(),required:false})]);},[]),vt=react.useCallback((t,e)=>{O(r=>r.map(i=>i.id===t?chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},i),e):i));},[]),xt=react.useCallback(t=>{O(e=>e.filter(r=>r.id!==t)),$(e=>e.filter(r=>r!==t)),I(e=>{let r=chunkRFPLZDIO_js.a({},e);return delete r[t],r});},[]),ht=react.useCallback((t,e)=>{$(r=>{let i=r.length>0?r:d.map(m=>m.id),o=i.indexOf(t);if(o===-1){let m=d.map(It=>It.id),y=m.indexOf(t);if(y===-1)return r;let G=e==="up"?y-1:y+1;if(G<0||G>=m.length)return m;let k=[...m];return [k[y],k[G]]=[k[G],k[y]],k}let l=e==="up"?o-1:o+1;if(l<0||l>=i.length)return i;let p=[...i];return [p[o],p[l]]=[p[l],p[o]],p});},[d]),Dt=react.useCallback((t,e)=>{I(r=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},r),{[t]:e}));},[]),bt=react.useCallback(t=>{let e=D.find(r=>r.requirementId===t);if(e)switch(e.fixType){case "fill_field":{T.current=false;let i=["data-categories-disclosed"],o=["purpose-of-processing"];i.includes(t)?C(2):o.includes(t)?C(3):(C(1));break}case "add_section":{if(!e.suggestedContent)break;O(r=>r.length>=nt?r:[...r,{id:st(),title:e.requirement,content:e.suggestedContent,order:999,required:false}]);break}case "add_content":{if(!e.suggestedContent)break;let r="data-subject-rights";I(i=>{var l,p,m;let o=(m=(p=i[r])!=null?p:(l=d.find(y=>y.id===r))==null?void 0:l.template)!=null?m:"";return chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},i),{[r]:`${o}
2
2
 
3
- ${e.suggestedContent}`.trim()})});break}}},[D,d]),X=react.useCallback(t=>({id:f.current,templateContext:n,customSections:b,sectionOverrides:x,sectionOrder:E,currentStep:t,lastSavedAt:Date.now(),status:"draft"}),[n,b,x,E]),Ot=react.useCallback(()=>chunkRFPLZDIO_js.d(null,null,function*(){let t=X(P);try{yield Promise.resolve(S.current.save(t)),z(t.lastSavedAt),q(!0);}catch(e){console.warn("[ndpr-toolkit] Failed to save draft:",e);}}),[X,P]),Et=react.useCallback(()=>{Promise.resolve(S.current.remove()).catch(t=>{console.warn("[ndpr-toolkit] Failed to remove draft:",t);}),f.current=it(),T.current=false,v(chunkQ64735OC_js.e()),O([]),I({}),$([]),C(1),q(false),z(null);},[]);react.useEffect(()=>{if(!N)return R.current&&clearTimeout(R.current),R.current=setTimeout(()=>{let t=X(P);Promise.resolve(S.current.save(t)).then(()=>{z(t.lastSavedAt),q(true);}).catch(e=>{console.warn("[ndpr-toolkit] Auto-save failed:",e);});},_t),()=>{R.current&&clearTimeout(R.current);}},[n,b,x,E,P,N,X]),react.useEffect(()=>{P===4&&s&&A&&!T.current&&(T.current=true,A(s));},[P,s,A]);let Tt=react.useCallback(t=>chunkRFPLZDIO_js.d(null,null,function*(){let e=s!=null?s:w(n,d,f.current);return chunkN3MQQUQP_js.c(e,t)}),[s,n,d]),wt=react.useCallback(t=>chunkRFPLZDIO_js.d(null,null,function*(){let e=s!=null?s:w(n,d,f.current);return chunkN3MQQUQP_js.d(e,t)}),[s,n,d]),At=react.useCallback(t=>{let e=s!=null?s:w(n,d,f.current);return chunkN3MQQUQP_js.a(e,t)},[s,n,d]),Mt=react.useCallback(()=>{let t=s!=null?s:w(n,d,f.current);return chunkN3MQQUQP_js.b(t)},[s,n,d]);return {currentStep:P,goToStep:dt,nextStep:pt,prevStep:ut,canProceed:lt,context:n,updateContext:mt,updateOrg:gt,toggleDataCategory:ft,togglePurpose:Pt,addProcessor:Ct,removeProcessor:yt,policy:s,sections:d,customSections:b,addCustomSection:St,updateCustomSection:vt,removeCustomSection:xt,reorderSections:ht,editSectionContent:Dt,sectionOverrides:x,complianceScore:_,complianceResult:V,complianceGaps:D,applyFix:bt,handleExportPDF:Tt,handleExportDOCX:wt,handleExportHTML:At,handleExportMarkdown:Mt,isDraftSaved:at,lastSavedAt:ct,saveDraft:Ot,discardDraft:Et,isLoading:N}}exports.a=Ut;
3
+ ${e.suggestedContent}`.trim()})});break}}},[D,d]),X=react.useCallback(t=>({id:f.current,templateContext:n,customSections:b,sectionOverrides:x,sectionOrder:E,currentStep:t,lastSavedAt:Date.now(),status:"draft"}),[n,b,x,E]),Ot=react.useCallback(()=>chunkRFPLZDIO_js.d(null,null,function*(){let t=X(P);try{yield Promise.resolve(S.current.save(t)),z(t.lastSavedAt),q(!0);}catch(e){console.warn("[ndpr-toolkit] Failed to save draft:",e);}}),[X,P]),Et=react.useCallback(()=>{Promise.resolve(S.current.remove()).catch(t=>{console.warn("[ndpr-toolkit] Failed to remove draft:",t);}),f.current=it(),T.current=false,v(chunk6LJHLE6G_js.e()),O([]),I({}),$([]),C(1),q(false),z(null);},[]);react.useEffect(()=>{if(!N)return R.current&&clearTimeout(R.current),R.current=setTimeout(()=>{let t=X(P);Promise.resolve(S.current.save(t)).then(()=>{z(t.lastSavedAt),q(true);}).catch(e=>{console.warn("[ndpr-toolkit] Auto-save failed:",e);});},_t),()=>{R.current&&clearTimeout(R.current);}},[n,b,x,E,P,N,X]),react.useEffect(()=>{P===4&&s&&A&&!T.current&&(T.current=true,A(s));},[P,s,A]);let Tt=react.useCallback(t=>chunkRFPLZDIO_js.d(null,null,function*(){let e=s!=null?s:w(n,d,f.current);return chunkJS7SYL5P_js.c(e,t)}),[s,n,d]),wt=react.useCallback(t=>chunkRFPLZDIO_js.d(null,null,function*(){let e=s!=null?s:w(n,d,f.current);return chunkJS7SYL5P_js.d(e,t)}),[s,n,d]),At=react.useCallback(t=>{let e=s!=null?s:w(n,d,f.current);return chunkJS7SYL5P_js.a(e,t)},[s,n,d]),Mt=react.useCallback(()=>{let t=s!=null?s:w(n,d,f.current);return chunkJS7SYL5P_js.b(t)},[s,n,d]);return {currentStep:P,goToStep:dt,nextStep:pt,prevStep:ut,canProceed:lt,context:n,updateContext:mt,updateOrg:gt,toggleDataCategory:ft,togglePurpose:Pt,addProcessor:Ct,removeProcessor:yt,policy:s,sections:d,customSections:b,addCustomSection:St,updateCustomSection:vt,removeCustomSection:xt,reorderSections:ht,editSectionContent:Dt,sectionOverrides:x,complianceScore:_,complianceResult:V,complianceGaps:D,applyFix:bt,handleExportPDF:Tt,handleExportDOCX:wt,handleExportHTML:At,handleExportMarkdown:Mt,isDraftSaved:at,lastSavedAt:ct,saveDraft:Ot,discardDraft:Et,isLoading:N}}exports.a=Ut;
@@ -1 +1 @@
1
- import {a as a$1}from'./chunk-ZJYULEER.mjs';var i={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.'},dsr:{title:"Submit a Data Subject Request",description:"Use this form to exercise your rights under the Nigeria Data Protection Act (NDPA), Part IV, Sections 29-36.",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."},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"},dpia:{title:"Data Protection Impact Assessment",next:"Next",previous:"Previous",complete:"Complete Assessment",progress:"Progress"},policy:{title:"Privacy Policy Generator",generate:"Generate Policy",preview:"Preview",export:"Export",sections:"Sections",variables:"Variables"},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 a(e){if(!e)return i;let r=a$1({},i);for(let t of Object.keys(e))e[t]&&(r[t]=a$1(a$1({},i[t]),e[t]));return r}export{i as a,a as b};
1
+ import {a as a$1}from'./chunk-ZJYULEER.mjs';var i={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.'},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."},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"},dpia:{title:"Data Protection Impact Assessment",next:"Next",previous:"Previous",complete:"Complete Assessment",progress:"Progress"},policy:{title:"Privacy Policy Generator",generate:"Generate Policy",preview:"Preview",export:"Export",sections:"Sections",variables:"Variables"},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 a(e){if(!e)return i;let r=a$1({},i);for(let t of Object.keys(e))e[t]&&(r[t]=a$1(a$1({},i[t]),e[t]));return r}export{i as a,a as b};