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