"use strict";(globalThis.webpackChunkcomplianz_gdpr=globalThis.webpackChunkcomplianz_gdpr||[]).push([[9758,9091],{99091:(e,t,a)=>{a.r(t),a.d(t,{UseCookieScanData:()=>i});var o=a(81621),n=a(9588);const i=(0,o.vt)(((e,t)=>({initialLoadCompleted:!1,setInitialLoadCompleted:t=>e({initialLoadCompleted:t}),iframeLoaded:!1,loading:!1,nextPage:!1,progress:0,cookies:[],lastLoadedIframe:"",setIframeLoaded:t=>e({iframeLoaded:t}),setLastLoadedIframe:t=>e((e=>({lastLoadedIframe:t}))),setProgress:t=>e({progress:t}),fetchProgress:()=>(e({loading:!0}),n.doAction("get_scan_progress",{}).then((t=>(e({initialLoadCompleted:!0,loading:!1,nextPage:t.next_page,progress:t.progress,cookies:t.cookies}),t))))})))},79758:(e,t,a)=>{a.r(t),a.d(t,{default:()=>m});var o=a(51609),n=a(86087),i=a(9588),s=a(4219),r=a(52043),l=a(56427),d=a(99091),c=a(32828);const m=(0,n.memo)((({type:e="action",style:t="tertiary",label:a,onClick:m,href:g="",target:u="",disabled:p,action:f,field:C,children:b})=>{if(!a&&!b)return null;const h=(C&&C.button_text?C.button_text:a)||b,{fetchFieldsData:_,showSavedSettingsNotice:L}=(0,s.default)(),{setInitialLoadCompleted:k,setProgress:w}=(0,d.UseCookieScanData)(),{setProgressLoaded:v}=(0,c.default)(),{selectedSubMenuItem:x}=(0,r.default)(),[I,y]=(0,n.useState)(!1),D=`button cmplz-button button--${t} button-${e}`,P=async e=>{await i.doAction(C.action,{}).then((e=>{e.success&&(_(x),"reset_settings"===e.id&&(k(!1),w(0),v(!1)),L(e.message))}))},S=C&&C.warn?C.warn:"";return"action"===e?(0,o.createElement)(o.Fragment,null,l.__experimentalConfirmDialog&&(0,o.createElement)(l.__experimentalConfirmDialog,{isOpen:I,onConfirm:async()=>{y(!1),await P()},onCancel:()=>{y(!1)}},S),(0,o.createElement)("button",{className:D,onClick:async t=>{if("action"!==e||!m)return"action"===e&&f?l.__experimentalConfirmDialog?void(C&&C.warn?y(!0):await P()):void await P():void(window.location.href=C.url);m(t)},disabled:p},h)):"link"===e?(0,o.createElement)("a",{className:D,href:g,target:u},h):void 0}))}}]);