"use strict";(globalThis.webpackChunkcomplianz_gdpr=globalThis.webpackChunkcomplianz_gdpr||[]).push([[8708,6745],{48708:(t,e,a)=>{a.r(e),a.d(e,{default:()=>c});var n=a(86087),s=a(16745),i=a(45111),l=a(27723),o=a(56427),r=a(4219);const c=(0,n.memo)((()=>{const{progress:t,active:e,start:a,next:c,total:p,copySites:m}=(0,s.default)(),[u,g]=(0,n.useState)(!1),{addHelpNotice:d,removeHelpNotice:y}=(0,r.default)();return(0,n.useEffect)((()=>{t<100?e&&((async()=>{await m(!1)})(),d("copy-multisite","warning",(0,l.__)("Complianz is currently copying settings of site %1$s to %2$s of %3$s sites.","complianz-gdpr").replace("%1$s",a).replace("%2$s",c).replace("%3$s",p),(0,l.__)("Copying settings...","complianz-gdpr"),!1)):y("copy-multisite")}),[t]),(0,n.createElement)(n.Fragment,null,(0,n.createElement)("div",{className:"cmplz-export-container"},(0,n.createElement)(o.__experimentalConfirmDialog,{isOpen:u,onConfirm:async()=>{g(!1),await m(!0)},onCancel:()=>{g(!1)}},(0,l.__)("Are you sure? This will overwrite the settings in all your subsites with the Complianz settings of this site.","complianz-gdpr")),(0,n.createElement)("button",{className:"button button-default",onClick:()=>g(!0)},(0,l.__)("Start","complianz-gdpr"),e&&(0,n.createElement)(n.Fragment,null," ",t,"%",(0,n.createElement)(i.default,{name:"loading",color:"grey"})))))}))},16745:(t,e,a)=>{a.r(e),a.d(e,{default:()=>i});var n=a(81621),s=a(9588);const i=(0,n.vt)(((t,e)=>({progress:0,total:0,start:0,next:0,active:!1,copySites:async e=>{let a={restart:e};t({active:!0});const{start:n,next:i,total:l}=await s.doAction("copy_multisite",a).then((t=>t));let o=Math.round(i/l*100);t({progress:o,start:n,next:i,total:l}),o>=100&&t({active:!1})}})))}}]);