"use strict";(globalThis.webpackChunkcomplianz_gdpr=globalThis.webpackChunkcomplianz_gdpr||[]).push([[8324,5074,2752],{35074:(e,t,a)=>{a.r(t),a.d(t,{default:()=>z});var c=a(51280),r=a(88496),n=a(45072),l=a(3608),o=a(40304),u=a(59016),s=a(84664),d=a(37408),i=a(15920),p=a(61480);const h="Switch",[m,b]=(0,u._)(h),[f,v]=m(h),g=(0,c.forwardRef)(((e,t)=>{const{__scopeSwitch:a,name:r,checked:u,defaultChecked:d,required:i,disabled:h,value:m="on",onCheckedChange:b,...v}=e,[g,w]=(0,c.useState)(null),C=(0,o.q)(t,(e=>w(e))),_=(0,c.useRef)(!1),z=!g||Boolean(g.closest("form")),[x=!1,y]=(0,s.W)({prop:u,defaultProp:d,onChange:b});return(0,c.createElement)(f,{scope:a,checked:x,disabled:h},(0,c.createElement)(p.K0.button,(0,n.c)({type:"button",role:"switch","aria-checked":x,"aria-required":i,"data-state":E(x),"data-disabled":h?"":void 0,disabled:h,value:m},v,{ref:C,onClick:(0,l.K)(e.onClick,(e=>{y((e=>!e)),z&&(_.current=e.isPropagationStopped(),_.current||e.stopPropagation())}))})),z&&(0,c.createElement)(k,{control:g,bubbles:!_.current,name:r,value:m,checked:x,required:i,disabled:h,style:{transform:"translateX(-100%)"}}))})),k=e=>{const{control:t,checked:a,bubbles:r=!0,...l}=e,o=(0,c.useRef)(null),u=(0,d.i)(a),s=(0,i.k)(t);return(0,c.useEffect)((()=>{const e=o.current,t=window.HTMLInputElement.prototype,c=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==a&&c){const t=new Event("click",{bubbles:r});c.call(e,a),e.dispatchEvent(t)}}),[u,a,r]),(0,c.createElement)("input",(0,n.c)({type:"checkbox","aria-hidden":!0,defaultChecked:a},l,{tabIndex:-1,ref:o,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function E(e){return e?"checked":"unchecked"}const w=g,C=(0,c.forwardRef)(((e,t)=>{const{__scopeSwitch:a,...r}=e,l=v("SwitchThumb",a);return(0,c.createElement)(p.K0.span,(0,n.c)({"data-state":E(l.checked),"data-disabled":l.disabled?"":void 0},r,{ref:t}))}));var _=a(25536);const z=(0,r.memo)((({value:e,onChange:t,required:a,disabled:r,className:n,label:l,id:o})=>{const{getField:u}=(0,_.default)();let s=e;return"0"!==e&&"1"!==e||(s="1"===e),(0,c.createElement)("div",{className:"cmplz-input-group cmplz-switch-group"},(0,c.createElement)(w,{className:"cmplz-switch-root "+n,checked:s,onCheckedChange:e=>{"banner"===u(o).data_target&&(e=e?"1":"0"),t(e)},disabled:r,required:a},(0,c.createElement)(C,{className:"cmplz-switch-thumb"})))}))},2752:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var c=a(51280);const r=(0,c.memo)((({value:e,onChange:t,required:a,disabled:r,id:n,name:l,placeholder:o})=>{const u=n||l,[s,d]=(0,c.useState)("");return(0,c.useEffect)((()=>{d(e||"")}),[e]),(0,c.useEffect)((()=>{if(e===s)return;const a=setTimeout((()=>{t(s)}),400);return()=>{clearTimeout(a)}}),[s]),(0,c.createElement)("div",{className:"cmplz-input-group cmplz-text-input-group"},(0,c.createElement)("input",{type:"text",id:u,name:l,value:s,onChange:e=>(e=>{d(e)})(e.target.value),required:a,disabled:r,className:"cmplz-text-input-group__input",placeholder:o}))}))},18324:(e,t,a)=>{a.r(t),a.d(t,{default:()=>o});var c=a(51280),r=a(2752),n=a(35074),l=a(93396);const o=(0,c.memo)((({label:e,value:t,onChange:a,placeholder:o=""})=>{const[u,s]=(0,c.useState)(!1);return(0,c.useEffect)((()=>{t.show?s(!1):s(!0)}),[t]),(0,c.createElement)("div",{className:"cmplz-text-checkbox-input"},(0,c.createElement)(r.default,{value:t.text,onChange:e=>{let c={...t};c.text=e,a(c)},placeholder:o,disabled:u}),(0,c.createElement)(n.default,{label:(0,l.__)("Show","complianz-gdpr"),value:t.show,onChange:e=>{let c={...t};c.show=e,a(c)}}))}))},37408:(e,t,a)=>{a.d(t,{i:()=>r});var c=a(51280);function r(e){const t=(0,c.useRef)({value:e,previous:e});return(0,c.useMemo)((()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous)),[e])}}}]);