"use strict";(self.webpackChunkcomplianz_gdpr=self.webpackChunkcomplianz_gdpr||[]).push([[8198],{88198:(t,e,s)=>{s.r(e),s.d(e,{default:()=>o});var a=s(9588),c=s(81621);const n={loaded:!1,tokenStatus:"",wscStatus:"",wscSignupDate:"",syncing:!1},o=(0,c.vt)(((t,e)=>({...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(!e().getStatusCalled)try{let e={};const{wsc_status:s,token_status:c,wsc_signup_date:n}=await a.doAction("get_wsc_status",e).then((t=>t));t({tokenStatus:c,wscStatus:s,wscSignupDate:n,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:e,redirect:s}=await a.doAction("reset_wsc").then((t=>t));e&&(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:e,wsc_status:s,token_status:c}=await a.doAction("enable_wsc").then((t=>t));t({updated:e,tokenStatus:c,wscStatus:s,loaded:!0})}catch(t){console.error("Enabling WSC error: ",t)}},disableWsc:async()=>{try{const{updated:e,wsc_status:s,token_status:c}=await a.doAction("disable_wsc").then((t=>t));t({updated:e,tokenStatus:c,wscStatus:s,loaded:!0})}catch(t){console.error("Disabling WSC error: ",t)}},requestActivationEmail:async()=>{try{await a.doAction("request_activation_email"),e().getStatus()}catch(t){console.error("Requesting activation email error: ",t)}}})))}}]);