"use strict";(globalThis.webpackChunkcomplianz_gdpr=globalThis.webpackChunkcomplianz_gdpr||[]).push([[2010,2111,3582],{52010:(e,t,l)=>{l.r(t),l.d(t,{default:()=>r});var a=l(45111),s=l(86087),i=l(10790);const r=e=>{const[t,l]=(0,s.useState)(!1);return(0,i.jsx)("div",{className:"cmplz-panel__list__item",style:e.style?e.style:{},children:(0,i.jsxs)("details",{open:t,children:[(0,i.jsxs)("summary",{onClick:e=>(e=>{e.preventDefault(),l(!t)})(e),children:[e.icon&&(0,i.jsx)(a.default,{name:e.icon}),(0,i.jsx)("h5",{className:"cmplz-panel__list__item__title",children:e.summary}),(0,i.jsx)("div",{className:"cmplz-panel__list__item__comment",children:e.comment}),(0,i.jsx)("div",{className:"cmplz-panel__list__item__icons",children:e.icons}),(0,i.jsx)(a.default,{name:"chevron-down",size:18})]}),(0,i.jsx)("div",{className:"cmplz-panel__list__item__details",children:t&&e.details})]})})}},52111:(e,t,l)=>{l.r(t),l.d(t,{default:()=>c});var a=l(52010),s=l(4219),i=l(86087),r=l(27723),d=l(52043),n=l(10790);const c=(0,i.memo)((e=>{const{updateField:t,setChangedField:l}=(0,s.default)(),{selectedMainMenuItem:c}=(0,d.default)(),[m,p]=wp.element.useState(e.thirdParty.name?e.thirdParty.name:""),[u,o]=wp.element.useState(e.thirdParty.purpose?e.thirdParty.purpose:""),[_,h]=wp.element.useState(e.thirdParty.country?e.thirdParty.country:""),[x,y]=wp.element.useState(e.thirdParty.data?e.thirdParty.data:""),f=(a,s)=>{let i=[...e.field.value];Array.isArray(i)||(i=[]);let r={...i[e.index]};r[s]=a,i[e.index]=r,t(e.field.id,i),l(e.field.id,i)};return(0,i.useEffect)((()=>{const e=setTimeout((()=>{f(m,"name")}),500);return()=>{clearTimeout(e)}}),[m]),(0,i.useEffect)((()=>{const e=setTimeout((()=>{f(x,"data")}),500);return()=>{clearTimeout(e)}}),[x]),(0,i.useEffect)((()=>{const e=setTimeout((()=>{f(_,"country")}),500);return()=>{clearTimeout(e)}}),[_]),(0,i.useEffect)((()=>{const e=setTimeout((()=>{f(u,"purpose")}),500);return()=>{clearTimeout(e)}}),[u]),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(a.default,{summary:m,details:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"cmplz-details-row",children:[(0,n.jsx)("label",{children:(0,r.__)("Name","complianz-gdpr")}),(0,n.jsx)("input",{onChange:e=>p(e.target.value),type:"text",placeholder:(0,r.__)("Name","complianz-gdpr"),value:m})]}),(0,n.jsxs)("div",{className:"cmplz-details-row",children:[(0,n.jsx)("label",{children:(0,r.__)("Country","complianz-gdpr")}),(0,n.jsx)("input",{onChange:e=>h(e.target.value),type:"text",placeholder:(0,r.__)("Country","complianz-gdpr"),value:_})]}),(0,n.jsxs)("div",{className:"cmplz-details-row",children:[(0,n.jsx)("label",{children:(0,r.__)("Purpose","complianz-gdpr")}),(0,n.jsx)("input",{onChange:e=>o(e.target.value),type:"text",placeholder:(0,r.__)("Purpose","complianz-gdpr"),value:u})]}),(0,n.jsxs)("div",{className:"cmplz-details-row",children:[(0,n.jsx)("label",{children:(0,r.__)("Data","complianz-gdpr")}),(0,n.jsx)("input",{onChange:e=>y(e.target.value),type:"text",placeholder:(0,r.__)("Data","complianz-gdpr"),value:x})]}),(0,n.jsx)("div",{className:"cmplz-details-row__buttons",children:(0,n.jsx)("button",{className:"button button-default cmplz-reset-button",onClick:a=>(async()=>{let a=e.field.value;Array.isArray(a)||(a=[]);let s=[...a];s.hasOwnProperty(e.index)&&s.splice(e.index,1),t(e.field.id,s),l(e.field.id,s),await saveFields(c,!1,!1)})(),children:(0,r.__)("Delete","complianz-gdpr")})})]})})})}))},53582:(e,t,l)=>{l.r(t),l.d(t,{default:()=>n});var a=l(27723),s=l(4219),i=l(86087),r=l(52111),d=l(10790);const n=(0,i.memo)((e=>{const{updateField:t,setChangedField:l}=(0,s.default)();let i=e.field,n=i.value;return Array.isArray(n)||(n=[]),(0,d.jsxs)("div",{className:"components-base-control cmplz-thirdparty",children:[(0,d.jsx)("div",{children:(0,d.jsx)("button",{onClick:()=>(()=>{let s=e.field.value;Array.isArray(s)||(s=[]);let r={},d=[...s];r.name=(0,a.__)("New Third Party","complianz-gdpr"),d.push(r),t(i.id,d),l(i.id,d)})(),className:"button button-default",children:(0,a.__)("Add new Third Party","complianz-gdpr")})}),(0,d.jsx)("div",{className:"cmplz-panel__list",children:n.map(((t,l)=>(0,d.jsx)(r.default,{field:e.field,updateField:e.updateField,index:l,thirdParty:t},l)))})]})}))}}]);