"use strict";(self.webpackChunkcomplianz_gdpr=self.webpackChunkcomplianz_gdpr||[]).push([[5035,9684,5683,9166],{9684:(e,t,a)=>{a.r(t),a.d(t,{default:()=>_});var s=a(51609),c=a(27723),i=a(45111),n=a(47143),l=a(9588),o=a(99166),d=a(4219),r=a(32828),m=a(52043),u=a(42838),p=a.n(u);const _=({notice:e,index:t})=>{const{dismissNotice:a,fetchProgressData:u}=(0,r.default)(),{getField:_,setHighLightField:g,fetchFieldsData:h}=(0,d.default)(),{setSelectedSubMenuItem:f}=(0,m.default)();let v="premium"===e.icon,b=e.url&&-1!==e.url.indexOf("complianz.io"),z=e.status.charAt(0).toUpperCase()+e.status.slice(1);return(0,s.createElement)("div",{key:t,className:"cmplz-task-element"},(0,s.createElement)("span",{className:"cmplz-task-status cmplz-"+e.status},z),(0,s.createElement)("p",{className:"cmplz-task-message",dangerouslySetInnerHTML:{__html:p().sanitize(e.message)}}),b&&e.url&&(0,s.createElement)("a",{target:"_blank",href:e.url,rel:"noopener noreferrer"},(0,c.__)("More info","complianz-gdpr")),e.clear_cache_id&&(0,s.createElement)("span",{className:"cmplz-task-enable button button-secondary",onClick:()=>(async e=>{let t={};t.cache_id=e,l.doAction("clear_cache",t).then((async e=>{(0,n.dispatch)("core/notices").createNotice("success",(0,c.__)("Re-started test","complianz-gdpr"),{__unstableHTML:!0,id:"cmplz_clear_cache",type:"snackbar",isDismissible:!0}).then((0,o.default)(3e3)).then((e=>{(0,n.dispatch)("core/notices").removeNotice("rsssl_clear_cache")})),await h(),await u()}))})(e.clear_cache_id)},(0,c.__)("Re-check","complianz-gdpr")),!v&&!b&&e.url&&(0,s.createElement)("a",{className:"cmplz-task-enable button button-secondary",href:e.url},(0,c.__)("View","complianz-gdpr")),!v&&e.highlight_field_id&&(0,s.createElement)("span",{className:"cmplz-task-enable button button-secondary",onClick:()=>(async()=>{g(e.highlight_field_id);let t=_(e.highlight_field_id);await f(t.menu_id)})()},(0,c.__)("View","complianz-gdpr")),e.plus_one&&(0,s.createElement)("span",{className:"cmplz-plusone"},"1"),e.dismissible&&"completed"!==e.status&&(0,s.createElement)("div",{className:"cmplz-task-dismiss"},(0,s.createElement)("button",{type:"button",onClick:t=>a(e.id)},(0,s.createElement)(i.default,{name:"times"}))))}},35035:(e,t,a)=>{a.r(t),a.d(t,{default:()=>m});var s=a(51609),c=a(9684),i=a(99695),n=a(27723),l=a(4219),o=a(35683),d=a(86087),r=a(32828);const m=(0,d.memo)((e=>{const{fields:t,setChangedField:a,updateField:m}=(0,l.default)(),{setProgressLoaded:u}=(0,r.default)(),{licenseStatus:p,licenseNotices:_,getLicenseNotices:g,noticesLoaded:h,activateLicense:f,deactivateLicense:v,processing:b}=(0,o.default)();(0,d.useEffect)((()=>{h||g()}),[]);let z=e.field,N=b?"cmplz-processing":"";return(0,s.createElement)("div",{className:"components-base-control"},(0,s.createElement)("div",{className:"cmplz-license-field"},(0,s.createElement)("input",{className:"components-text-control__input",type:"password",id:z.id,value:z.value,onChange:e=>{return t=e.target.value,a(z.id,t),void m(z.id,t);var t}}),(0,s.createElement)("button",{className:"button button-default",disabled:b,onClick:()=>(async()=>{"valid"===p?await v():await f(e.field.value),u(!1)})()},"valid"===p&&(0,n.__)("Deactivate","complianz-gdpr"),"valid"!==p&&(0,n.__)("Activate","complianz-gdpr"))),!h&&(0,s.createElement)(i.default,null),h&&(0,s.createElement)("div",{className:N},_.map(((e,t)=>(0,s.createElement)(c.default,{key:t,index:t,notice:e,highLightField:""})))))}))},35683:(e,t,a)=>{a.r(t),a.d(t,{default:()=>i});var s=a(81621),c=a(9588);const i=(0,s.vt)(((e,t)=>({licenseStatus:cmplz_settings.licenseStatus,processing:!1,licenseNotices:[],noticesLoaded:!1,getLicenseNotices:async()=>{const{licenseStatus:t,notices:a}=await c.doAction("license_notices",{}).then((e=>e));e((e=>({noticesLoaded:!0,licenseNotices:a,licenseStatus:t})))},activateLicense:async t=>{let a={};a.license=t,e({processing:!0});const{licenseStatus:s,notices:i}=await c.doAction("activate_license",a);e((e=>({processing:!1,licenseNotices:i,licenseStatus:s})))},deactivateLicense:async()=>{e({processing:!0});const{licenseStatus:t,notices:a}=await c.doAction("deactivate_license");e((e=>({processing:!1,licenseNotices:a,licenseStatus:t})))}})))},99166:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});const s=e=>function(t){return new Promise((a=>setTimeout((()=>a(t)),e)))}}}]);