"use strict";(self.webpackChunkcomplianz_gdpr=self.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:()=>i});var o=n(51609),a=n(27723),l=n(86087),r=n(56716),s=n(4219),c=n(98217);const i=()=>{const{getFieldValue:e,fields:t}=(0,s.default)(),[n,i]=(0,l.useState)(!1);(0,l.useEffect)((()=>{i(e("records_of_consent"))}),[t]);const{processingAgreementOptions:p,dataBreachOptions:m,proofOfConsentOptions:d}=(0,r.default)();return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("h3",{className:"cmplz-h4"},(0,a.__)("Other documents","complianz-gdpr")),(0,o.createElement)(c.default,{type:"processing-agreements",link:"#tools/processing-agreements",name:(0,a.__)("Processing Agreement","complianz-gdpr"),options:p}),(0,o.createElement)(c.default,{type:"data-breaches",link:"#tools/data-breach-reports",name:(0,a.__)("Data Breach","complianz-gdpr"),options:m}),(0,o.createElement)(c.default,{type:"proof-of-consent",link:n?"#tools/records-of-consent":"#tools/proof-of-consent",name:(0,a.__)("Proof of Consent","complianz-gdpr"),options:d}))}},98217:(e,t,n)=>{n.r(t),n.d(t,{default:()=>c});var o=n(51609),a=n(45111),l=n(27723),r=n(86087),s=n(25228);const c=e=>{const[t,n]=(0,r.useState)(!1),[c,i]=(0,r.useState)(!1),[p,m]=(0,r.useState)(!1);(0,r.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)}m(t)}),[e.options]);const d=()=>{if(c||!t||0===t)return;i(!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",p.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){i(!0)}};return(0,o.createElement)("div",{className:"cmplz-single-document-other-documents"},(0,o.createElement)(s.default,{onChange:e=>n(e),defaultValue:"0",canBeEmpty:!1,value:t,options:p}),(0,o.createElement)("div",{onClick:()=>d()},(0,o.createElement)(a.default,{name:"file-download",color:0==t||c?"grey":"black",tooltip:(0,l.__)("Download file","complianz-gdpr"),size:14})),p.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===p.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:()=>c});var o=n(51609),a=n(86087),l=n(45296),r=n(45111),s=n(27723);const c=(0,a.memo)((({value:e=!1,onChange:t,required:n,defaultValue:a,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,s.__)("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)(l.bL,{value:e,defaultValue:a,onValueChange:t,required:n,disabled:c&&!Array.isArray(c)},(0,o.createElement)(l.l9,{className:"cmplz-select-group__trigger"},(0,o.createElement)(l.WT,null),(0,o.createElement)(r.default,{name:"chevron-down"})),(0,o.createElement)(l.UC,{className:"cmplz-select-group__content",position:"popper"},(0,o.createElement)(l.PP,{className:"cmplz-select-group__scroll-button"},(0,o.createElement)(r.default,{name:"chevron-up"})),(0,o.createElement)(l.LM,{className:"cmplz-select-group__viewport"},(0,o.createElement)(l.YJ,null,Object.entries(i).map((([e,t])=>(0,o.createElement)(l.q7,{disabled:Array.isArray(c)&&c.includes(e),className:"cmplz-select-group__item",key:e,value:e},(0,o.createElement)(l.p4,null,t)))))),(0,o.createElement)(l.wn,{className:"cmplz-select-group__scroll-button"},(0,o.createElement)(r.default,{name:"chevron-down"})))))}))}}]);