"use strict";(globalThis.webpackChunkcomplianz_gdpr=globalThis.webpackChunkcomplianz_gdpr||[]).push([[847,9091,9758,5228,2489,4759,2921],{99091:(e,t,n)=>{n.r(t),n.d(t,{UseCookieScanData:()=>c});var a=n(81621),r=n(9588);const c=(0,a.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}),r.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,n)=>{n.r(t),n.d(t,{default:()=>d});var a=n(86087),r=n(9588),c=n(4219),l=n(52043),s=n(56427),o=n(99091),i=n(32828);const d=(0,a.memo)((({type:e="action",style:t="tertiary",label:n,onClick:d,href:u="",target:p="",disabled:m,action:h,field:f,children:g})=>{if(!n&&!g)return null;const b=(f&&f.button_text?f.button_text:n)||g,{fetchFieldsData:_,showSavedSettingsNotice:E}=(0,c.default)(),{setInitialLoadCompleted:k,setProgress:v}=(0,o.UseCookieScanData)(),{setProgressLoaded:y}=(0,i.default)(),{selectedSubMenuItem:C}=(0,l.default)(),[w,A]=(0,a.useState)(!1),N=`button cmplz-button button--${t} button-${e}`,z=async e=>{await r.doAction(f.action,{}).then((e=>{e.success&&(_(C),"reset_settings"===e.id&&(k(!1),v(0),y(!1)),E(e.message))}))},S=f&&f.warn?f.warn:"";return"action"===e?(0,a.createElement)(a.Fragment,null,s.__experimentalConfirmDialog&&(0,a.createElement)(s.__experimentalConfirmDialog,{isOpen:w,onConfirm:async()=>{A(!1),await z()},onCancel:()=>{A(!1)}},S),(0,a.createElement)("button",{className:N,onClick:async t=>{if("action"!==e||!d)return"action"===e&&h?s.__experimentalConfirmDialog?void(f&&f.warn?A(!0):await z()):void await z():void(window.location.href=f.url);d(t)},disabled:m},b)):"link"===e?(0,a.createElement)("a",{className:N,href:u,target:p},b):void 0}))},81366:(e,t,n)=>{n.r(t),n.d(t,{default:()=>S});var a=n(86087),r=n(58168),c=n(51609),l=n(91071),s=n(62133),o=n(9957),i=n(81351),d=n(85357),u=n(31769),p=n(7971),m=n(12579);const h="Checkbox",[f,g]=(0,s.A)(h),[b,_]=f(h),E=(0,c.forwardRef)(((e,t)=>{const{__scopeCheckbox:n,name:a,checked:s,defaultChecked:d,required:u,disabled:p,value:h="on",onCheckedChange:f,...g}=e,[_,E]=(0,c.useState)(null),C=(0,l.s)(t,(e=>E(e))),w=(0,c.useRef)(!1),A=!_||Boolean(_.closest("form")),[N=!1,z]=(0,i.i)({prop:s,defaultProp:d,onChange:f}),S=(0,c.useRef)(N);return(0,c.useEffect)((()=>{const e=null==_?void 0:_.form;if(e){const t=()=>z(S.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}}),[_,z]),(0,c.createElement)(b,{scope:n,state:N,disabled:p},(0,c.createElement)(m.sG.button,(0,r.A)({type:"button",role:"checkbox","aria-checked":v(N)?"mixed":N,"aria-required":u,"data-state":y(N),"data-disabled":p?"":void 0,disabled:p,value:h},g,{ref:C,onKeyDown:(0,o.m)(e.onKeyDown,(e=>{"Enter"===e.key&&e.preventDefault()})),onClick:(0,o.m)(e.onClick,(e=>{z((e=>!!v(e)||!e)),A&&(w.current=e.isPropagationStopped(),w.current||e.stopPropagation())}))})),A&&(0,c.createElement)(k,{control:_,bubbles:!w.current,name:a,value:h,checked:N,required:u,disabled:p,style:{transform:"translateX(-100%)"}}))})),k=e=>{const{control:t,checked:n,bubbles:a=!0,...l}=e,s=(0,c.useRef)(null),o=(0,d.Z)(n),i=(0,u.X)(t);return(0,c.useEffect)((()=>{const e=s.current,t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(o!==n&&r){const t=new Event("click",{bubbles:a});e.indeterminate=v(n),r.call(e,!v(n)&&n),e.dispatchEvent(t)}}),[o,n,a]),(0,c.createElement)("input",(0,r.A)({type:"checkbox","aria-hidden":!0,defaultChecked:!v(n)&&n},l,{tabIndex:-1,ref:s,style:{...e.style,...i,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function v(e){return"indeterminate"===e}function y(e){return v(e)?"indeterminate":e?"checked":"unchecked"}const C=E,w=(0,c.forwardRef)(((e,t)=>{const{__scopeCheckbox:n,forceMount:a,...l}=e,s=_("CheckboxIndicator",n);return(0,c.createElement)(p.C,{present:a||v(s.state)||!0===s.state},(0,c.createElement)(m.sG.span,(0,r.A)({"data-state":y(s.state),"data-disabled":s.disabled?"":void 0},l,{ref:t,style:{pointerEvents:"none",...e.style}})))}));var A=n(27723),N=n(45111),z=n(79758);const S=(0,a.memo)((({indeterminate:e,label:t,value:n,id:r,onChange:c,required:l,disabled:s,options:o={}})=>{const[i,d]=(0,a.useState)(!1),[u,p]=(0,a.useState)(!1);let m=n;Array.isArray(m)||(m=""===m?[]:[m]),(0,a.useEffect)((()=>{let e=1===Object.keys(o).length&&"true"===Object.keys(o)[0];d(e)}),[]),e&&(n=!0);const h=m;let f=!1;Object.keys(o).length>10&&(f=!0);const g=e=>i?n:h.includes(""+e)||h.includes(parseInt(e)),b=()=>{p(!u)};let _=s&&!Array.isArray(s);return 0===Object.keys(o).length?(0,a.createElement)(a.Fragment,null,(0,A.__)("No options found","complianz-gdpr")):(0,a.createElement)("div",{className:"cmplz-checkbox-group"},Object.entries(o).map((([o,d],p)=>(0,a.createElement)("div",{key:o,className:"cmplz-checkbox-group__item"+(!u&&p>9?" cmplz-hidden":"")},(0,a.createElement)(C,{className:"cmplz-checkbox-group__checkbox",id:r+"_"+o,checked:g(o),"aria-label":t,disabled:_||Array.isArray(s)&&s.includes(o),required:l,onCheckedChange:e=>((e,t)=>{if(i)c(!n);else{const e=h.includes(""+t)||h.includes(parseInt(t))?h.filter((e=>e!==""+t&&e!==parseInt(t))):[...h,t];c(e)}})(0,o)},(0,a.createElement)(w,{className:"cmplz-checkbox-group__indicator"},(0,a.createElement)(N.default,{name:e?"indeterminate":"check",size:14,color:"dark-blue"}))),(0,a.createElement)("label",{className:"cmplz-checkbox-group__label",htmlFor:r+"_"+o},d)))),!u&&f&&(0,a.createElement)(z.default,{onClick:()=>b()},(0,A.__)("Show more","complianz-gdpr")),u&&f&&(0,a.createElement)(z.default,{onClick:()=>b()},(0,A.__)("Show less","complianz-gdpr")))}))},25228:(e,t,n)=>{n.r(t),n.d(t,{default:()=>s});var a=n(86087),r=n(45296),c=n(45111),l=n(27723);const s=(0,a.memo)((({value:e=!1,onChange:t,required:n,defaultValue:s,disabled:o,options:i={},canBeEmpty:d=!0,label:u})=>{if(Array.isArray(i)){let e={};i.map((t=>{e[t.value]=t.label})),i=e}return d?(""===e||!1===e||0===e)&&(e="0",i={0:(0,l.__)("Select an option","complianz-gdpr"),...i}):e||(e=Object.keys(i)[0]),(0,a.createElement)("div",{className:"cmplz-input-group cmplz-select-group",key:u},(0,a.createElement)(r.bL,{value:e,defaultValue:s,onValueChange:t,required:n,disabled:o&&!Array.isArray(o)},(0,a.createElement)(r.l9,{className:"cmplz-select-group__trigger"},(0,a.createElement)(r.WT,null),(0,a.createElement)(c.default,{name:"chevron-down"})),(0,a.createElement)(r.UC,{className:"cmplz-select-group__content",position:"popper"},(0,a.createElement)(r.PP,{className:"cmplz-select-group__scroll-button"},(0,a.createElement)(c.default,{name:"chevron-up"})),(0,a.createElement)(r.LM,{className:"cmplz-select-group__viewport"},(0,a.createElement)(r.YJ,null,Object.entries(i).map((([e,t])=>(0,a.createElement)(r.q7,{disabled:Array.isArray(o)&&o.includes(e),className:"cmplz-select-group__item",key:e,value:e},(0,a.createElement)(r.p4,null,t)))))),(0,a.createElement)(r.wn,{className:"cmplz-select-group__scroll-button"},(0,a.createElement)(c.default,{name:"chevron-down"})))))}))},10800:(e,t,n)=>{n.r(t),n.d(t,{default:()=>w});var a=n(86087),r=n(58168),c=n(51609),l=n(9957),s=n(91071),o=n(62133),i=n(81351),d=n(85357),u=n(31769),p=n(12579);const m="Switch",[h,f]=(0,o.A)(m),[g,b]=h(m),_=(0,c.forwardRef)(((e,t)=>{const{__scopeSwitch:n,name:a,checked:o,defaultChecked:d,required:u,disabled:m,value:h="on",onCheckedChange:f,...b}=e,[_,v]=(0,c.useState)(null),y=(0,s.s)(t,(e=>v(e))),C=(0,c.useRef)(!1),w=!_||Boolean(_.closest("form")),[A=!1,N]=(0,i.i)({prop:o,defaultProp:d,onChange:f});return(0,c.createElement)(g,{scope:n,checked:A,disabled:m},(0,c.createElement)(p.sG.button,(0,r.A)({type:"button",role:"switch","aria-checked":A,"aria-required":u,"data-state":k(A),"data-disabled":m?"":void 0,disabled:m,value:h},b,{ref:y,onClick:(0,l.m)(e.onClick,(e=>{N((e=>!e)),w&&(C.current=e.isPropagationStopped(),C.current||e.stopPropagation())}))})),w&&(0,c.createElement)(E,{control:_,bubbles:!C.current,name:a,value:h,checked:A,required:u,disabled:m,style:{transform:"translateX(-100%)"}}))})),E=e=>{const{control:t,checked:n,bubbles:a=!0,...l}=e,s=(0,c.useRef)(null),o=(0,d.Z)(n),i=(0,u.X)(t);return(0,c.useEffect)((()=>{const e=s.current,t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(o!==n&&r){const t=new Event("click",{bubbles:a});r.call(e,n),e.dispatchEvent(t)}}),[o,n,a]),(0,c.createElement)("input",(0,r.A)({type:"checkbox","aria-hidden":!0,defaultChecked:n},l,{tabIndex:-1,ref:s,style:{...e.style,...i,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function k(e){return e?"checked":"unchecked"}const v=_,y=(0,c.forwardRef)(((e,t)=>{const{__scopeSwitch:n,...a}=e,l=b("SwitchThumb",n);return(0,c.createElement)(p.sG.span,(0,r.A)({"data-state":k(l.checked),"data-disabled":l.disabled?"":void 0},a,{ref:t}))}));var C=n(4219);const w=(0,a.memo)((({value:e,onChange:t,required:n,disabled:r,className:c,label:l,id:s})=>{const{getField:o}=(0,C.default)();let i=e;return"0"!==e&&"1"!==e||(i="1"===e),(0,a.createElement)("div",{className:"cmplz-input-group cmplz-switch-group"},(0,a.createElement)(v,{className:"cmplz-switch-root "+c,checked:i,onCheckedChange:e=>{"banner"===o(s).data_target&&(e=e?"1":"0"),t(e)},disabled:r,required:n},(0,a.createElement)(y,{className:"cmplz-switch-thumb"})))}))},32489:(e,t,n)=>{n.r(t),n.d(t,{default:()=>c});var a=n(86087),r=n(51609);const c=(0,r.memo)((({value:e,onChange:t,required:n,disabled:c,id:l,name:s,placeholder:o})=>{const i=l||s,[d,u]=(0,r.useState)("");return(0,r.useEffect)((()=>{u(e||"")}),[e]),(0,r.useEffect)((()=>{if(e===d)return;const n=setTimeout((()=>{t(d)}),400);return()=>{clearTimeout(n)}}),[d]),(0,a.createElement)("div",{className:"cmplz-input-group cmplz-text-input-group"},(0,a.createElement)("input",{type:"text",id:i,name:s,value:d,onChange:e=>(e=>{u(e)})(e.target.value),required:n,disabled:c,className:"cmplz-text-input-group__input",placeholder:o}))}))},34759:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var a=n(81621),r=n(16535),c=n(9588);const l=(0,a.vt)(((e,t)=>({integrationsLoaded:!1,fetching:!1,services:[],plugins:[],scripts:[],placeholders:[],blockedScripts:[],setScript:(t,n)=>{e((0,r.Ay)((e=>{if("block_script"===n){let n=e.blockedScripts;if(t.urls){for(const[e,a]of Object.entries(t.urls)){if(!a||0===a.length)continue;let e=!1;for(const[t,r]of Object.entries(n))a===t&&(e=!0);e||(n[a]=a)}e.blockedScripts=n}}const a=e.scripts[n].findIndex((e=>e.id===t.id));-1!==a&&(e.scripts[n][a]=t)})))},fetchIntegrationsData:async()=>{if(t().fetching)return;e({fetching:!0});const{services:n,plugins:a,scripts:r,placeholders:c,blocked_scripts:l}=await s();let o=r;o.block_script&&o.block_script.length>0&&o.block_script.forEach(((e,t)=>{e.id=t})),o.add_script&&o.add_script.length>0&&o.add_script.forEach(((e,t)=>{e.id=t})),o.whitelist_script&&o.whitelist_script.length>0&&o.whitelist_script.forEach(((e,t)=>{e.id=t})),e((()=>({integrationsLoaded:!0,services:n,plugins:a,scripts:o,fetching:!1,placeholders:c,blockedScripts:l})))},addScript:n=>{e({fetching:!0}),t().scripts[n]&&Array.isArray(t().scripts[n])||e((0,r.Ay)((e=>{e.scripts[n]=[]}))),e((0,r.Ay)((e=>{e.scripts[n].push({name:"general",id:e.scripts[n].length,enable:!0})})));let a=t().scripts;return c.doAction("update_scripts",{scripts:a}).then((t=>(e({fetching:!1}),t))).catch((e=>{console.error(e)}))},saveScript:(n,a)=>{e({fetching:!0}),t().scripts[a]&&Array.isArray(t().scripts[a])||e((0,r.Ay)((e=>{e.scripts[a]=[]}))),e((0,r.Ay)((e=>{const t=e.scripts[a].findIndex((e=>e.id===n.id));-1!==t&&(e.scripts[a][t]=n)})));let l=t().scripts;return c.doAction("update_scripts",{scripts:l}).then((t=>(e({fetching:!1}),t))).catch((e=>{console.error(e)}))},deleteScript:(n,a)=>{e({fetching:!0}),t().scripts[a]&&Array.isArray(t().scripts[a])||e((0,r.Ay)((e=>{e.scripts[a]=[]}))),e((0,r.Ay)((e=>{const t=e.scripts[a].findIndex((e=>e.id===n.id));-1!==t&&e.scripts[a].splice(t,1)})));let l=t().scripts;return c.doAction("update_scripts",{scripts:l}).then((t=>(e({fetching:!1}),t))).catch((e=>{console.error(e)}))},updatePluginStatus:async(t,n)=>{e({fetching:!0}),e((0,r.Ay)((e=>{const a=e.plugins.findIndex((e=>e.id===t));-1!==a&&(e.plugins[a].enabled=n)})));const a=await c.doAction("update_plugin_status",{plugin:t,enabled:n}).then((e=>e)).catch((e=>{console.error(e)}));return e({fetching:!1}),a},updatePlaceholderStatus:async(t,n,a)=>{e({fetching:!0}),a&&e((0,r.Ay)((e=>{const a=e.plugins.findIndex((e=>e.id===t));-1!==a&&(e.plugins[a].placeholder=n?"enabled":"disabled")})));const l=await c.doAction("update_placeholder_status",{id:t,enabled:n}).then((e=>e)).catch((e=>{console.error(e)}));return e({fetching:!1}),l}}))),s=()=>c.doAction("get_integrations_data",{}).then((e=>e)).catch((e=>{console.error(e)}))},60847:(e,t,n)=>{n.r(t),n.d(t,{default:()=>d});var a=n(86087),r=(n(10800),n(32921)),c=n(32489),l=n(25228),s=n(27723),o=n(34759),i=n(81366);const d=e=>{const{setScript:t,fetching:n,placeholders:d}=(0,o.default)(),u=e.script,p=e.type,m=(n,a)=>{let r={...u};r[a]=n,t(r,e.type)};return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"cmplz-details-row cmplz-details-row__checkbox"},(0,a.createElement)("label",null,(0,s.__)("Placeholder","complianz-gdpr")),(0,a.createElement)(i.default,{id:u.id+"placeholder",disabled:n,value:u.enable_placeholder,onChange:e=>m(e,"enable_placeholder"),options:{true:(0,s.__)("Enable placeholder","complianz-gdpr")}})),!!u.enable_placeholder&&(0,a.createElement)(a.Fragment,null,"block_script"===p&&(0,a.createElement)("div",{className:"cmplz-details-row cmplz-details-row__checkbox"},(0,a.createElement)(i.default,{id:u.id+"iframe",disabled:n,value:u.iframe||"",onChange:e=>m(e||"","iframe"),options:{true:(0,s.__)("The blocked content is an iframe","complianz-gdpr")}})),!u.iframe&&(0,a.createElement)("div",{className:"cmplz-details-row cmplz-details-row"},(0,a.createElement)("p",null,(0,s.__)("Enter the div class or ID that should be targeted.","complianz-gdpr"),(0,r.default)("https://complianz.io/integrating-plugins/#placeholder/")),(0,a.createElement)(c.default,{disabled:n,value:u.placeholder_class||"",onChange:e=>m(e||"","placeholder_class"),name:"placeholder_class",placeholder:(0,s.__)("Your CSS class","complianz-gdpr")})),(0,a.createElement)("div",{className:"cmplz-details-row cmplz-details-row__checkbox"},(0,a.createElement)(l.default,{disabled:n,value:u.placeholder?u.placeholder:"default",options:d,onChange:e=>m(e||"default","placeholder")}))))}},32921:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var a=n(86087),r=n(27723),c=n(44124);const l=e=>(0,a.createElement)(a.Fragment,null," ",(0,a.createElement)(c.default,{url:e,target:"_blank",rel:"noopener noreferrer",text:(0,r.__)("For more information, please read this %sarticle%s.","complianz-gdpr")})," ")},7971:(e,t,n)=>{n.d(t,{C:()=>s});var a=n(51609),r=n(75795),c=n(91071),l=n(88200);const s=e=>{const{present:t,children:n}=e,s=function(e){const[t,n]=(0,a.useState)(),c=(0,a.useRef)({}),s=(0,a.useRef)(e),i=(0,a.useRef)("none"),d=e?"mounted":"unmounted",[u,p]=function(e,t){return(0,a.useReducer)(((e,n)=>{const a=t[e][n];return null!=a?a:e}),e)}(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return(0,a.useEffect)((()=>{const e=o(c.current);i.current="mounted"===u?e:"none"}),[u]),(0,l.N)((()=>{const t=c.current,n=s.current;if(n!==e){const a=i.current,r=o(t);e?p("MOUNT"):"none"===r||"none"===(null==t?void 0:t.display)?p("UNMOUNT"):p(n&&a!==r?"ANIMATION_OUT":"UNMOUNT"),s.current=e}}),[e,p]),(0,l.N)((()=>{if(t){const e=e=>{const n=o(c.current).includes(e.animationName);e.target===t&&n&&(0,r.flushSync)((()=>p("ANIMATION_END")))},n=e=>{e.target===t&&(i.current=o(c.current))};return t.addEventListener("animationstart",n),t.addEventListener("animationcancel",e),t.addEventListener("animationend",e),()=>{t.removeEventListener("animationstart",n),t.removeEventListener("animationcancel",e),t.removeEventListener("animationend",e)}}p("ANIMATION_END")}),[t,p]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:(0,a.useCallback)((e=>{e&&(c.current=getComputedStyle(e)),n(e)}),[])}}(t),i="function"==typeof n?n({present:s.isPresent}):a.Children.only(n),d=(0,c.s)(s.ref,i.ref);return"function"==typeof n||s.isPresent?(0,a.cloneElement)(i,{ref:d}):null};function o(e){return(null==e?void 0:e.animationName)||"none"}s.displayName="Presence"}}]);