"use strict";(globalThis.webpackChunkcomplianz_gdpr=globalThis.webpackChunkcomplianz_gdpr||[]).push([[8198],{88198:(t,s,a)=>{a.r(s),a.d(s,{default:()=>o});var e=a(9588),c=a(81621);const n={loaded:!1,tokenStatus:"",wscStatus:"",wscSignupDate:"",batchStats:null,syncing:!1},o=(0,c.vt)((t,s)=>({...n,startOnboarding:async()=>{const t=new URL(cmplz_settings.dashboard_url);t.searchParams.set("websitescan",""),setTimeout(()=>{window.location.href=t.href},500)},getStatus:async()=>{if(!s().getStatusCalled)try{const s={},{wsc_status:a,token_status:c,wsc_signup_date:n,batch_stats:o}=await e.doAction("get_wsc_status",s).then(t=>t);t({tokenStatus:c,wscStatus:a,wscSignupDate:n,batchStats:null!=o?o:null,loaded:!0})}catch(t){console.error("Getting status error: ",t)}},resetWsc:async()=>{if(confirm("Are you sure? This will delete all your Website Scan data."))try{const{result:s,redirect:a}=await e.doAction("reset_wsc").then(t=>t);s&&(t(t=>({...n,startOnboarding:t.startOnboarding,getStatus:t.getStatus,enableWsc:t.enableWsc,disableWsc:t.disableWsc,resetWsc:t.resetWsc})),setTimeout(()=>{window.location.reload()},500))}catch(t){console.error("Resetting WSC error: ",t)}finally{setTimeout(()=>{window.location.reload()},300)}},enableWsc:async()=>{try{const{updated:s,wsc_status:a,token_status:c}=await e.doAction("enable_wsc").then(t=>t);t({updated:s,tokenStatus:c,wscStatus:a,loaded:!0})}catch(t){console.error("Enabling WSC error: ",t)}},disableWsc:async()=>{try{const{updated:s,wsc_status:a,token_status:c}=await e.doAction("disable_wsc").then(t=>t);t({updated:s,tokenStatus:c,wscStatus:a,loaded:!0})}catch(t){console.error("Disabling WSC error: ",t)}},requestActivationEmail:async()=>{try{await e.doAction("request_activation_email"),s().getStatus()}catch(t){console.error("Requesting activation email error: ",t)}}}))}}]);