"use strict";(globalThis.webpackChunkcomplianz_gdpr=globalThis.webpackChunkcomplianz_gdpr||[]).push([[6472,4056],{36472:(e,t,l)=>{l.r(t),l.d(t,{default:()=>s});var a=l(51280),n=l(15832),r=l(93396),c=l(88496),o=l(14056);const s=e=>{const[t,l]=(0,c.useState)(!1),[s,i]=(0,c.useState)(!1),[m,u]=(0,c.useState)(!1);(0,c.useEffect)((()=>{let t=e.options;if(0===t.length){let l={label:e.name,value:0};t.unshift(l)}else if(!t.filter((e=>0===e.value)).length>0){let l={label:e.name,value:0};t.unshift(l)}u(t)}),[e.options]);const p=()=>{if(s||!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),l=window.document.createElement("a");l.setAttribute("href",e),l.setAttribute("download",m.filter((e=>e.value===t))[0].label),window.document.body.appendChild(l),l.click(),setTimeout((function(){window.URL.revokeObjectURL(e)}),6e4)}},e.onprogress=function(e){i(!0)}};return(0,a.createElement)("div",{className:"cmplz-single-document-other-documents"},(0,a.createElement)(o.default,{onChange:e=>l(e),defaultValue:"0",canBeEmpty:!1,value:t,options:m}),(0,a.createElement)("div",{onClick:()=>p()},(0,a.createElement)(n.default,{name:"file-download",color:0==t||s?"grey":"black",tooltip:(0,r.__)("Download file","complianz-gdpr"),size:14})),m.length>0&&(0,a.createElement)("a",{href:e.link},(0,a.createElement)(n.default,{name:"circle-chevron-right",color:"black",tooltip:(0,r.__)("Go to overview","complianz-gdpr"),size:14})),0===m.length&&(0,a.createElement)("a",{href:e.link},(0,a.createElement)(n.default,{name:"plus",color:"black",tooltip:(0,r.__)("Create new","complianz-gdpr"),size:14})))}},14056:(e,t,l)=>{l.r(t),l.d(t,{default:()=>s});var a=l(51280),n=l(88496),r=l(39992),c=l(15832),o=l(93396);const s=(0,n.memo)((({value:e=!1,onChange:t,required:l,defaultValue:n,disabled:s,options:i={},canBeEmpty:m=!0,label:u})=>{if(Array.isArray(i)){let e={};i.map((t=>{e[t.value]=t.label})),i=e}return m?(""===e||!1===e||0===e)&&(e="0",i={0:(0,o.__)("Select an option","complianz-gdpr"),...i}):e||(e=Object.keys(i)[0]),(0,a.createElement)("div",{className:"cmplz-input-group cmplz-select-group",key:u},(0,a.createElement)(r.Ss,{value:e,defaultValue:n,onValueChange:t,required:l,disabled:s&&!Array.isArray(s)},(0,a.createElement)(r.mf,{className:"cmplz-select-group__trigger"},(0,a.createElement)(r.s3,null),(0,a.createElement)(c.default,{name:"chevron-down"})),(0,a.createElement)(r.kP,{className:"cmplz-select-group__content",position:"popper"},(0,a.createElement)(r.O4,{className:"cmplz-select-group__scroll-button"},(0,a.createElement)(c.default,{name:"chevron-up"})),(0,a.createElement)(r.mm,{className:"cmplz-select-group__viewport"},(0,a.createElement)(r.WM,null,Object.entries(i).map((([e,t])=>(0,a.createElement)(r.iY,{disabled:Array.isArray(s)&&s.includes(e),className:"cmplz-select-group__item",key:e,value:e},(0,a.createElement)(r.CC,null,t)))))),(0,a.createElement)(r.y8,{className:"cmplz-select-group__scroll-button"},(0,a.createElement)(c.default,{name:"chevron-down"})))))}))}}]);