"use strict";(globalThis.webpackChunkcomplianz_gdpr=globalThis.webpackChunkcomplianz_gdpr||[]).push([[3192,6716,8217,5228],{56716:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var o=n(81621),a=n(9588);const l=(0,o.vt)(((e,t)=>({documents:[],documentDataLoaded:!1,processingAgreementOptions:[],proofOfConsentOptions:[],dataBreachOptions:[],region:"",setRegion:t=>{"undefined"!=typeof Storage&&(sessionStorage.cmplzSelectedRegion=t),e((e=>({region:t})))},getRegion:()=>{let t="all";"undefined"!=typeof Storage&&sessionStorage.cmplzSelectedRegion&&(t=sessionStorage.cmplzSelectedRegion),e((e=>({region:t})))},getDocuments:async()=>{const{documents:t,processingAgreementOptions:n,proofOfConsentOptions:o,dataBreachOptions:l}=await a.doAction("documents_block_data").then((e=>e));e((e=>({documentDataLoaded:!0,documents:t,processingAgreementOptions:n,proofOfConsentOptions:o,dataBreachOptions:l})))}})))},3192:(e,t,n)=>{n.r(t),n.d(t,{default:()=>c});var o=n(86087),a=n(27723),l=n(56716),r=n(4219),s=n(98217);const c=()=>{const{getFieldValue:e,fields:t}=(0,r.default)(),[n,c]=(0,o.useState)(!1);(0,o.useEffect)((()=>{c(e("records_of_consent"))}),[t]);const{processingAgreementOptions:i,dataBreachOptions:p,proofOfConsentOptions:m}=(0,l.default)();return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("h3",{className:"cmplz-h4"},(0,a.__)("Other documents","complianz-gdpr")),(0,o.createElement)(s.default,{type:"processing-agreements",link:"#tools/processing-agreements",name:(0,a.__)("Processing Agreement","complianz-gdpr"),options:i}),(0,o.createElement)(s.default,{type:"data-breaches",link:"#tools/data-breach-reports",name:(0,a.__)("Data Breach","complianz-gdpr"),options:p}),(0,o.createElement)(s.default,{type:"proof-of-consent",link:n?"#tools/records-of-consent":"#tools/proof-of-consent",name:(0,a.__)("Proof of Consent","complianz-gdpr"),options:m}))}},98217:(e,t,n)=>{n.r(t),n.d(t,{default:()=>s});var o=n(86087),a=n(45111),l=n(27723),r=n(25228);const s=e=>{const[t,n]=(0,o.useState)(!1),[s,c]=(0,o.useState)(!1),[i,p]=(0,o.useState)(!1);(0,o.useEffect)((()=>{let t=e.options;if(0===t.length){let n={label:e.name,value:0};t.unshift(n)}else if(!t.filter((e=>0===e.value)).length>0){let n={label:e.name,value:0};t.unshift(n)}p(t)}),[e.options]);const m=()=>{if(s||!t||0===t)return;c(!0);let e=new XMLHttpRequest;e.responseType="blob",e.open("get",t,!0),e.send(),e.onreadystatechange=function(){if(4==this.readyState&&200==this.status){var e=window.URL.createObjectURL(this.response),n=window.document.createElement("a");n.setAttribute("href",e),n.setAttribute("download",i.filter((e=>e.value===t))[0].label),window.document.body.appendChild(n),n.click(),setTimeout((function(){window.URL.revokeObjectURL(e)}),6e4)}},e.onprogress=function(e){c(!0)}};return(0,o.createElement)("div",{className:"cmplz-single-document-other-documents"},(0,o.createElement)(r.default,{onChange:e=>n(e),defaultValue:"0",canBeEmpty:!1,value:t,options:i}),(0,o.createElement)("div",{onClick:()=>m()},(0,o.createElement)(a.default,{name:"file-download",color:0==t||s?"grey":"black",tooltip:(0,l.__)("Download file","complianz-gdpr"),size:14})),i.length>0&&(0,o.createElement)("a",{href:e.link},(0,o.createElement)(a.default,{name:"circle-chevron-right",color:"black",tooltip:(0,l.__)("Go to overview","complianz-gdpr"),size:14})),0===i.length&&(0,o.createElement)("a",{href:e.link},(0,o.createElement)(a.default,{name:"plus",color:"black",tooltip:(0,l.__)("Create new","complianz-gdpr"),size:14})))}},25228:(e,t,n)=>{n.r(t),n.d(t,{default:()=>s});var o=n(86087),a=n(45296),l=n(45111),r=n(27723);const s=(0,o.memo)((({value:e=!1,onChange:t,required:n,defaultValue:s,disabled:c,options:i={},canBeEmpty:p=!0,label:m})=>{if(Array.isArray(i)){let e={};i.map((t=>{e[t.value]=t.label})),i=e}return p?(""===e||!1===e||0===e)&&(e="0",i={0:(0,r.__)("Select an option","complianz-gdpr"),...i}):e||(e=Object.keys(i)[0]),(0,o.createElement)("div",{className:"cmplz-input-group cmplz-select-group",key:m},(0,o.createElement)(a.bL,{value:e,defaultValue:s,onValueChange:t,required:n,disabled:c&&!Array.isArray(c)},(0,o.createElement)(a.l9,{className:"cmplz-select-group__trigger"},(0,o.createElement)(a.WT,null),(0,o.createElement)(l.default,{name:"chevron-down"})),(0,o.createElement)(a.UC,{className:"cmplz-select-group__content",position:"popper"},(0,o.createElement)(a.PP,{className:"cmplz-select-group__scroll-button"},(0,o.createElement)(l.default,{name:"chevron-up"})),(0,o.createElement)(a.LM,{className:"cmplz-select-group__viewport"},(0,o.createElement)(a.YJ,null,Object.entries(i).map((([e,t])=>(0,o.createElement)(a.q7,{disabled:Array.isArray(c)&&c.includes(e),className:"cmplz-select-group__item",key:e,value:e},(0,o.createElement)(a.p4,null,t)))))),(0,o.createElement)(a.wn,{className:"cmplz-select-group__scroll-button"},(0,o.createElement)(l.default,{name:"chevron-down"})))))}))}}]);