"use strict";(globalThis.webpackChunkcomplianz_gdpr=globalThis.webpackChunkcomplianz_gdpr||[]).push([[9736,9091,9713,9758,5228,2489,4759,4078,2010,2921],{99091:(e,t,a)=>{a.r(t),a.d(t,{UseCookieScanData:()=>n});var l=a(81621),r=a(9588);const n=(0,l.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))))})))},89713:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var l=a(86087),r=a(70470),n=(a(43158),a(51289),a(20047),a(27723)),c=a(45111);const s=(0,l.memo)((e=>{let t=e.mode?e.mode:"css",a=e.height?e.height:"200px",s=e.field&&e.field.default?e.field.default:e.placeholder;const[i,o]=(0,l.useState)(e.value),[d,p]=(0,l.useState)(!1);(0,l.useEffect)((()=>{if(i===e.value)return;const t=setTimeout((()=>{e.onChange(i)}),500);return()=>{clearTimeout(t)}}),[i]);let m=e.disabled?"cmplz-editor-disabled":"";return(0,l.createElement)("div",{className:m},d&&(0,l.createElement)("div",{className:"cmplz-error-text"},(0,l.createElement)(c.default,{name:"error",size:13,color:"red"}),(0,l.createElement)("p",null,(0,n.__)("Write your JavaScript without wrapping it in script tags.","complianz-gdpr"))),(0,l.createElement)(r.Ay,{readOnly:e.disabled,placeholder:"//"+s,mode:t,theme:"monokai",width:"100%",height:a,onChange:e=>(e=>{(e.includes("<script>")||e.includes("<\/script>"))&&p(!0),e=(e=e.replace(/<script>/gi,"")).replace(/<\/script>/gi,""),o(e)})(e),fontSize:12,showPrintMargin:!0,showGutter:!0,highlightActiveLine:!0,value:i,setOptions:{enableBasicAutocompletion:!1,enableLiveAutocompletion:!1,enableSnippets:!1,showLineNumbers:!0,tabSize:2,useWorker:!1}}))}))},79758:(e,t,a)=>{a.r(t),a.d(t,{default:()=>d});var l=a(86087),r=a(9588),n=a(4219),c=a(52043),s=a(56427),i=a(99091),o=a(32828);const d=(0,l.memo)((({type:e="action",style:t="tertiary",label:a,onClick:d,href:p="",target:m="",disabled:u,action:h,field:g,children:b})=>{if(!a&&!b)return null;const f=(g&&g.button_text?g.button_text:a)||b,{fetchFieldsData:_,showSavedSettingsNotice:E}=(0,n.default)(),{setInitialLoadCompleted:y,setProgress:v}=(0,i.UseCookieScanData)(),{setProgressLoaded:k}=(0,o.default)(),{selectedSubMenuItem:z}=(0,c.default)(),[w,C]=(0,l.useState)(!1),N=`button cmplz-button button--${t} button-${e}`,A=async e=>{await r.doAction(g.action,{}).then((e=>{e.success&&(_(z),"reset_settings"===e.id&&(y(!1),v(0),k(!1)),E(e.message))}))},S=g&&g.warn?g.warn:"";return"action"===e?(0,l.createElement)(l.Fragment,null,s.__experimentalConfirmDialog&&(0,l.createElement)(s.__experimentalConfirmDialog,{isOpen:w,onConfirm:async()=>{C(!1),await A()},onCancel:()=>{C(!1)}},S),(0,l.createElement)("button",{className:N,onClick:async t=>{if("action"!==e||!d)return"action"===e&&h?s.__experimentalConfirmDialog?void(g&&g.warn?C(!0):await A()):void await A():void(window.location.href=g.url);d(t)},disabled:u},f)):"link"===e?(0,l.createElement)("a",{className:N,href:p,target:m},f):void 0}))},81366:(e,t,a)=>{a.r(t),a.d(t,{default:()=>S});var l=a(86087),r=a(58168),n=a(51609),c=a(91071),s=a(62133),i=a(9957),o=a(81351),d=a(85357),p=a(31769),m=a(7971),u=a(12579);const h="Checkbox",[g,b]=(0,s.A)(h),[f,_]=g(h),E=(0,n.forwardRef)(((e,t)=>{const{__scopeCheckbox:a,name:l,checked:s,defaultChecked:d,required:p,disabled:m,value:h="on",onCheckedChange:g,...b}=e,[_,E]=(0,n.useState)(null),z=(0,c.s)(t,(e=>E(e))),w=(0,n.useRef)(!1),C=!_||Boolean(_.closest("form")),[N=!1,A]=(0,o.i)({prop:s,defaultProp:d,onChange:g}),S=(0,n.useRef)(N);return(0,n.useEffect)((()=>{const e=null==_?void 0:_.form;if(e){const t=()=>A(S.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}}),[_,A]),(0,n.createElement)(f,{scope:a,state:N,disabled:m},(0,n.createElement)(u.sG.button,(0,r.A)({type:"button",role:"checkbox","aria-checked":v(N)?"mixed":N,"aria-required":p,"data-state":k(N),"data-disabled":m?"":void 0,disabled:m,value:h},b,{ref:z,onKeyDown:(0,i.m)(e.onKeyDown,(e=>{"Enter"===e.key&&e.preventDefault()})),onClick:(0,i.m)(e.onClick,(e=>{A((e=>!!v(e)||!e)),C&&(w.current=e.isPropagationStopped(),w.current||e.stopPropagation())}))})),C&&(0,n.createElement)(y,{control:_,bubbles:!w.current,name:l,value:h,checked:N,required:p,disabled:m,style:{transform:"translateX(-100%)"}}))})),y=e=>{const{control:t,checked:a,bubbles:l=!0,...c}=e,s=(0,n.useRef)(null),i=(0,d.Z)(a),o=(0,p.X)(t);return(0,n.useEffect)((()=>{const e=s.current,t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(i!==a&&r){const t=new Event("click",{bubbles:l});e.indeterminate=v(a),r.call(e,!v(a)&&a),e.dispatchEvent(t)}}),[i,a,l]),(0,n.createElement)("input",(0,r.A)({type:"checkbox","aria-hidden":!0,defaultChecked:!v(a)&&a},c,{tabIndex:-1,ref:s,style:{...e.style,...o,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function v(e){return"indeterminate"===e}function k(e){return v(e)?"indeterminate":e?"checked":"unchecked"}const z=E,w=(0,n.forwardRef)(((e,t)=>{const{__scopeCheckbox:a,forceMount:l,...c}=e,s=_("CheckboxIndicator",a);return(0,n.createElement)(m.C,{present:l||v(s.state)||!0===s.state},(0,n.createElement)(u.sG.span,(0,r.A)({"data-state":k(s.state),"data-disabled":s.disabled?"":void 0},c,{ref:t,style:{pointerEvents:"none",...e.style}})))}));var C=a(27723),N=a(45111),A=a(79758);const S=(0,l.memo)((({indeterminate:e,label:t,value:a,id:r,onChange:n,required:c,disabled:s,options:i={}})=>{const[o,d]=(0,l.useState)(!1),[p,m]=(0,l.useState)(!1);let u=a;Array.isArray(u)||(u=""===u?[]:[u]),(0,l.useEffect)((()=>{let e=1===Object.keys(i).length&&"true"===Object.keys(i)[0];d(e)}),[]),e&&(a=!0);const h=u;let g=!1;Object.keys(i).length>10&&(g=!0);const b=e=>o?a:h.includes(""+e)||h.includes(parseInt(e)),f=()=>{m(!p)};let _=s&&!Array.isArray(s);return 0===Object.keys(i).length?(0,l.createElement)(l.Fragment,null,(0,C.__)("No options found","complianz-gdpr")):(0,l.createElement)("div",{className:"cmplz-checkbox-group"},Object.entries(i).map((([i,d],m)=>(0,l.createElement)("div",{key:i,className:"cmplz-checkbox-group__item"+(!p&&m>9?" cmplz-hidden":"")},(0,l.createElement)(z,{className:"cmplz-checkbox-group__checkbox",id:r+"_"+i,checked:b(i),"aria-label":t,disabled:_||Array.isArray(s)&&s.includes(i),required:c,onCheckedChange:e=>((e,t)=>{if(o)n(!a);else{const e=h.includes(""+t)||h.includes(parseInt(t))?h.filter((e=>e!==""+t&&e!==parseInt(t))):[...h,t];n(e)}})(0,i)},(0,l.createElement)(w,{className:"cmplz-checkbox-group__indicator"},(0,l.createElement)(N.default,{name:e?"indeterminate":"check",size:14,color:"dark-blue"}))),(0,l.createElement)("label",{className:"cmplz-checkbox-group__label",htmlFor:r+"_"+i},d)))),!p&&g&&(0,l.createElement)(A.default,{onClick:()=>f()},(0,C.__)("Show more","complianz-gdpr")),p&&g&&(0,l.createElement)(A.default,{onClick:()=>f()},(0,C.__)("Show less","complianz-gdpr")))}))},7320:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});var l=a(86087),r=a(62848);const n=(0,l.memo)((({label:e,id:t,value:a,onChange:n,required:c,defaultValue:s,disabled:i,options:o={}})=>(0,l.createElement)(r.bL,{disabled:i&&!Array.isArray(i),className:"cmplz-input-group cmplz-radio-group",value:a,"aria-label":e,onValueChange:n,required:c,default:s},Object.entries(o).map((([e,a])=>(0,l.createElement)("div",{key:e,className:"cmplz-radio-group__item"},(0,l.createElement)(r.q7,{disabled:Array.isArray(i)&&i.includes(e),value:e,id:t+"_"+e},(0,l.createElement)(r.C1,{className:"cmplz-radio-group__indicator"})),(0,l.createElement)("label",{className:"cmplz-radio-label",htmlFor:t+"_"+e},a)))))))},25228:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var l=a(86087),r=a(45296),n=a(45111),c=a(27723);const s=(0,l.memo)((({value:e=!1,onChange:t,required:a,defaultValue:s,disabled:i,options:o={},canBeEmpty:d=!0,label:p})=>{if(Array.isArray(o)){let e={};o.map((t=>{e[t.value]=t.label})),o=e}return d?(""===e||!1===e||0===e)&&(e="0",o={0:(0,c.__)("Select an option","complianz-gdpr"),...o}):e||(e=Object.keys(o)[0]),(0,l.createElement)("div",{className:"cmplz-input-group cmplz-select-group",key:p},(0,l.createElement)(r.bL,{value:e,defaultValue:s,onValueChange:t,required:a,disabled:i&&!Array.isArray(i)},(0,l.createElement)(r.l9,{className:"cmplz-select-group__trigger"},(0,l.createElement)(r.WT,null),(0,l.createElement)(n.default,{name:"chevron-down"})),(0,l.createElement)(r.UC,{className:"cmplz-select-group__content",position:"popper"},(0,l.createElement)(r.PP,{className:"cmplz-select-group__scroll-button"},(0,l.createElement)(n.default,{name:"chevron-up"})),(0,l.createElement)(r.LM,{className:"cmplz-select-group__viewport"},(0,l.createElement)(r.YJ,null,Object.entries(o).map((([e,t])=>(0,l.createElement)(r.q7,{disabled:Array.isArray(i)&&i.includes(e),className:"cmplz-select-group__item",key:e,value:e},(0,l.createElement)(r.p4,null,t)))))),(0,l.createElement)(r.wn,{className:"cmplz-select-group__scroll-button"},(0,l.createElement)(n.default,{name:"chevron-down"})))))}))},10800:(e,t,a)=>{a.r(t),a.d(t,{default:()=>w});var l=a(86087),r=a(58168),n=a(51609),c=a(9957),s=a(91071),i=a(62133),o=a(81351),d=a(85357),p=a(31769),m=a(12579);const u="Switch",[h,g]=(0,i.A)(u),[b,f]=h(u),_=(0,n.forwardRef)(((e,t)=>{const{__scopeSwitch:a,name:l,checked:i,defaultChecked:d,required:p,disabled:u,value:h="on",onCheckedChange:g,...f}=e,[_,v]=(0,n.useState)(null),k=(0,s.s)(t,(e=>v(e))),z=(0,n.useRef)(!1),w=!_||Boolean(_.closest("form")),[C=!1,N]=(0,o.i)({prop:i,defaultProp:d,onChange:g});return(0,n.createElement)(b,{scope:a,checked:C,disabled:u},(0,n.createElement)(m.sG.button,(0,r.A)({type:"button",role:"switch","aria-checked":C,"aria-required":p,"data-state":y(C),"data-disabled":u?"":void 0,disabled:u,value:h},f,{ref:k,onClick:(0,c.m)(e.onClick,(e=>{N((e=>!e)),w&&(z.current=e.isPropagationStopped(),z.current||e.stopPropagation())}))})),w&&(0,n.createElement)(E,{control:_,bubbles:!z.current,name:l,value:h,checked:C,required:p,disabled:u,style:{transform:"translateX(-100%)"}}))})),E=e=>{const{control:t,checked:a,bubbles:l=!0,...c}=e,s=(0,n.useRef)(null),i=(0,d.Z)(a),o=(0,p.X)(t);return(0,n.useEffect)((()=>{const e=s.current,t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(i!==a&&r){const t=new Event("click",{bubbles:l});r.call(e,a),e.dispatchEvent(t)}}),[i,a,l]),(0,n.createElement)("input",(0,r.A)({type:"checkbox","aria-hidden":!0,defaultChecked:a},c,{tabIndex:-1,ref:s,style:{...e.style,...o,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function y(e){return e?"checked":"unchecked"}const v=_,k=(0,n.forwardRef)(((e,t)=>{const{__scopeSwitch:a,...l}=e,c=f("SwitchThumb",a);return(0,n.createElement)(m.sG.span,(0,r.A)({"data-state":y(c.checked),"data-disabled":c.disabled?"":void 0},l,{ref:t}))}));var z=a(4219);const w=(0,l.memo)((({value:e,onChange:t,required:a,disabled:r,className:n,label:c,id:s})=>{const{getField:i}=(0,z.default)();let o=e;return"0"!==e&&"1"!==e||(o="1"===e),(0,l.createElement)("div",{className:"cmplz-input-group cmplz-switch-group"},(0,l.createElement)(v,{className:"cmplz-switch-root "+n,checked:o,onCheckedChange:e=>{"banner"===i(s).data_target&&(e=e?"1":"0"),t(e)},disabled:r,required:a},(0,l.createElement)(k,{className:"cmplz-switch-thumb"})))}))},32489:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});var l=a(86087),r=a(51609);const n=(0,r.memo)((({value:e,onChange:t,required:a,disabled:n,id:c,name:s,placeholder:i})=>{const o=c||s,[d,p]=(0,r.useState)("");return(0,r.useEffect)((()=>{p(e||"")}),[e]),(0,r.useEffect)((()=>{if(e===d)return;const a=setTimeout((()=>{t(d)}),400);return()=>{clearTimeout(a)}}),[d]),(0,l.createElement)("div",{className:"cmplz-input-group cmplz-text-input-group"},(0,l.createElement)("input",{type:"text",id:o,name:s,value:d,onChange:e=>(e=>{p(e)})(e.target.value),required:a,disabled:n,className:"cmplz-text-input-group__input",placeholder:i}))}))},31356:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var l=a(86087),r=a(7320),n=a(27723),c=a(34759);const s=e=>{const{setScript:t,fetching:a}=(0,c.default)(),s=e.script,i={statistics:(0,n.__)("Statistics","complianz-gdpr"),marketing:(0,n.__)("Marketing","complianz-gdpr")};return(0,l.createElement)(l.Fragment,null,(0,l.createElement)("label",null,(0,n.__)("Category","complianz-gdpr")),(0,l.createElement)(r.default,{disabled:a,label:(0,n.__)("Marketing","complianz-gdpr"),id:"category",value:s.category,onChange:a=>((a,l)=>{let r={...s};r.category=a,t(r,e.type)})(a),defaultValue:"marketing",options:i}))}},48033:(e,t,a)=>{a.r(t),a.d(t,{default:()=>i});var l=a(86087),r=a(27723),n=(a(10800),a(25228)),c=a(34759),s=a(81366);const i=e=>{const{setScript:t,blockedScripts:a,fetching:i}=(0,c.default)(),o=a,d=e.script,p=e=>{if(!d.dependency||0===d.dependency.length)return"";let t=Object.entries(d.dependency);for(const[a,l]of t)if(a===e)return l;return""},m=(e,t)=>{let a={...e};for(const[e,l]of Object.entries(a))if(l===t){delete a[e];break}return a};let u=d.hasOwnProperty("urls")?Object.entries(d.urls):[""];return(0,l.createElement)(l.Fragment,null,(0,l.createElement)("div",{className:"cmplz-details-row cmplz-details-row__checkbox"},(0,l.createElement)(s.default,{id:d.id+"dependency",disabled:i,value:d.enable_dependency,onChange:a=>((a,l)=>{let r={...d};r.enable_dependency=a,t(r,e.type)})(a),options:{true:(0,r.__)("Enable dependency","complianz-gdpr")}})),!!d.enable_dependency&&(0,l.createElement)("div",{className:"cmplz-details-row cmplz-details-row"},u.length>1&&u.map((([a,c],s)=>(0,l.createElement)("div",{key:s,className:"cmplz-scriptcenter-dependencies"},(0,l.createElement)(n.default,{disabled:i,value:p(c),options:m(o,c),onChange:a=>((a,l)=>{let r={...d},n={...r.dependency};n[l]=a,r.dependency=n,t(r,e.type)})(a,c)}),(0,l.createElement)("div",null,(0,r.__)("waits for: ","complianz-gdpr"),c||(0,r.__)("Empty URL","complianz-gdpr"))))),u.length<=1&&(0,l.createElement)(l.Fragment,null,(0,r.__)("Add a URL to create a dependency between two URLs","complianz-gdpr"))))}},34759:(e,t,a)=>{a.r(t),a.d(t,{default:()=>c});var l=a(81621),r=a(16535),n=a(9588);const c=(0,l.vt)(((e,t)=>({integrationsLoaded:!1,fetching:!1,services:[],plugins:[],scripts:[],placeholders:[],blockedScripts:[],setScript:(t,a)=>{e((0,r.Ay)((e=>{if("block_script"===a){let a=e.blockedScripts;if(t.urls){for(const[e,l]of Object.entries(t.urls)){if(!l||0===l.length)continue;let e=!1;for(const[t,r]of Object.entries(a))l===t&&(e=!0);e||(a[l]=l)}e.blockedScripts=a}}const l=e.scripts[a].findIndex((e=>e.id===t.id));-1!==l&&(e.scripts[a][l]=t)})))},fetchIntegrationsData:async()=>{if(t().fetching)return;e({fetching:!0});const{services:a,plugins:l,scripts:r,placeholders:n,blocked_scripts:c}=await s();let i=r;i.block_script&&i.block_script.length>0&&i.block_script.forEach(((e,t)=>{e.id=t})),i.add_script&&i.add_script.length>0&&i.add_script.forEach(((e,t)=>{e.id=t})),i.whitelist_script&&i.whitelist_script.length>0&&i.whitelist_script.forEach(((e,t)=>{e.id=t})),e((()=>({integrationsLoaded:!0,services:a,plugins:l,scripts:i,fetching:!1,placeholders:n,blockedScripts:c})))},addScript: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=>{e.scripts[a].push({name:"general",id:e.scripts[a].length,enable:!0})})));let l=t().scripts;return n.doAction("update_scripts",{scripts:l}).then((t=>(e({fetching:!1}),t))).catch((e=>{console.error(e)}))},saveScript:(a,l)=>{e({fetching:!0}),t().scripts[l]&&Array.isArray(t().scripts[l])||e((0,r.Ay)((e=>{e.scripts[l]=[]}))),e((0,r.Ay)((e=>{const t=e.scripts[l].findIndex((e=>e.id===a.id));-1!==t&&(e.scripts[l][t]=a)})));let c=t().scripts;return n.doAction("update_scripts",{scripts:c}).then((t=>(e({fetching:!1}),t))).catch((e=>{console.error(e)}))},deleteScript:(a,l)=>{e({fetching:!0}),t().scripts[l]&&Array.isArray(t().scripts[l])||e((0,r.Ay)((e=>{e.scripts[l]=[]}))),e((0,r.Ay)((e=>{const t=e.scripts[l].findIndex((e=>e.id===a.id));-1!==t&&e.scripts[l].splice(t,1)})));let c=t().scripts;return n.doAction("update_scripts",{scripts:c}).then((t=>(e({fetching:!1}),t))).catch((e=>{console.error(e)}))},updatePluginStatus:async(t,a)=>{e({fetching:!0}),e((0,r.Ay)((e=>{const l=e.plugins.findIndex((e=>e.id===t));-1!==l&&(e.plugins[l].enabled=a)})));const l=await n.doAction("update_plugin_status",{plugin:t,enabled:a}).then((e=>e)).catch((e=>{console.error(e)}));return e({fetching:!1}),l},updatePlaceholderStatus:async(t,a,l)=>{e({fetching:!0}),l&&e((0,r.Ay)((e=>{const l=e.plugins.findIndex((e=>e.id===t));-1!==l&&(e.plugins[l].placeholder=a?"enabled":"disabled")})));const c=await n.doAction("update_placeholder_status",{id:t,enabled:a}).then((e=>e)).catch((e=>{console.error(e)}));return e({fetching:!1}),c}}))),s=()=>n.doAction("get_integrations_data",{}).then((e=>e)).catch((e=>{console.error(e)}))},60847:(e,t,a)=>{a.r(t),a.d(t,{default:()=>d});var l=a(86087),r=(a(10800),a(32921)),n=a(32489),c=a(25228),s=a(27723),i=a(34759),o=a(81366);const d=e=>{const{setScript:t,fetching:a,placeholders:d}=(0,i.default)(),p=e.script,m=e.type,u=(a,l)=>{let r={...p};r[l]=a,t(r,e.type)};return(0,l.createElement)(l.Fragment,null,(0,l.createElement)("div",{className:"cmplz-details-row cmplz-details-row__checkbox"},(0,l.createElement)("label",null,(0,s.__)("Placeholder","complianz-gdpr")),(0,l.createElement)(o.default,{id:p.id+"placeholder",disabled:a,value:p.enable_placeholder,onChange:e=>u(e,"enable_placeholder"),options:{true:(0,s.__)("Enable placeholder","complianz-gdpr")}})),!!p.enable_placeholder&&(0,l.createElement)(l.Fragment,null,"block_script"===m&&(0,l.createElement)("div",{className:"cmplz-details-row cmplz-details-row__checkbox"},(0,l.createElement)(o.default,{id:p.id+"iframe",disabled:a,value:p.iframe||"",onChange:e=>u(e||"","iframe"),options:{true:(0,s.__)("The blocked content is an iframe","complianz-gdpr")}})),!p.iframe&&(0,l.createElement)("div",{className:"cmplz-details-row cmplz-details-row"},(0,l.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,l.createElement)(n.default,{disabled:a,value:p.placeholder_class||"",onChange:e=>u(e||"","placeholder_class"),name:"placeholder_class",placeholder:(0,s.__)("Your CSS class","complianz-gdpr")})),(0,l.createElement)("div",{className:"cmplz-details-row cmplz-details-row__checkbox"},(0,l.createElement)(c.default,{disabled:a,value:p.placeholder?p.placeholder:"default",options:d,onChange:e=>u(e||"default","placeholder")}))))}},59736:(e,t,a)=>{a.r(t),a.d(t,{default:()=>h});var l=a(86087),r=a(52010),n=a(27723),c=a(34759),s=a(89713),i=a(10800),o=a(31356),d=a(60847),p=a(48033),m=a(44078),u=a(81366);const h=(0,l.memo)((e=>{const{setScript:t,fetching:a,saveScript:h,deleteScript:g}=(0,c.default)(),b=e.script,f=(a,l)=>{let r={...b};r[l]=a,t(r,e.type),h(r,e.type)},_=(a,l)=>{let r={...b};r[l]=a,t(r,e.type)},E=()=>{h(b,e.type)},y=()=>{g(b,e.type)};return b?(0,l.createElement)(l.Fragment,null,(0,l.createElement)(r.default,{summary:b.name,icons:(e=>(0,l.createElement)(l.Fragment,null,(0,l.createElement)(i.default,{className:"cmplz-switch-input-tiny",onChange:e=>f(e,"enable"),value:e.enable})))(b),details:((e,t)=>{const{fetching:a}=(0,c.default)();return(0,l.createElement)(l.Fragment,null,(0,l.createElement)("div",{className:"cmplz-details-row"},(0,l.createElement)("label",null,(0,n.__)("Name","complianz-gdpr")),(0,l.createElement)("input",{disabled:a,onChange:e=>_(e.target.value,"name"),type:"text",placeholder:(0,n.__)("Name","complianz-gdpr"),value:e.name})),"add_script"===t&&(0,l.createElement)("div",{className:"cmplz-details-row"},(0,l.createElement)(s.default,{disabled:a,onChange:e=>(e=>{_(e,"editor")})(e),placeholder:"Enter your script here",value:e.editor?e.editor:console.log("marketing enabled")})),("block_script"===t||"whitelist_script"===t)&&(0,l.createElement)(m.default,{script:e,type:t}),"whitelist_script"!==t&&(0,l.createElement)(l.Fragment,null,(0,l.createElement)("div",{className:"cmplz-details-row cmplz-details-row__checkbox"},(0,l.createElement)(u.default,{id:e.id,disabled:a,value:e.async,onChange:e=>_(e,"async"),options:{true:(0,n.__)("This script contains an async attribute.","complianz-gdpr")}})),(0,l.createElement)("div",{className:"cmplz-details-row"},(0,l.createElement)(o.default,{script:e,type:t})),(0,l.createElement)(d.default,{script:e,type:t})),"block_script"===t&&(0,l.createElement)("div",{className:"cmplz-details-row cmplz-details-row__checkbox"},(0,l.createElement)("label",null,(0,n.__)("Dependency","complianz-gdpr")),(0,l.createElement)(p.default,{script:e,type:t})),(0,l.createElement)("div",{className:"cmplz-details-row cmplz-details-row__buttons"},(0,l.createElement)("button",{disabled:a,onClick:e=>E(),className:"button button-default"},(0,n.__)("Save","complianz-gdpr")),(0,l.createElement)("button",{disabled:a,className:"button button-default cmplz-reset-button",onClick:e=>y()},(0,n.__)("Delete","complianz-gdpr"))))})(b,e.type)})):(0,l.createElement)(r.default,{summary:"..."})}))},44078:(e,t,a)=>{a.r(t),a.d(t,{default:()=>d});var l=a(86087),r=a(27723),n=a(32921),c=a(32489),s=a(45111),i=a(34759),o=a(51609);const d=e=>{const{setScript:t,fetching:a}=(0,i.default)(),[d,p]=(0,o.useState)(!1),m=e.script,u=e.type;(0,o.useEffect)((()=>{(m.hasOwnProperty("urls")?Object.values(m.urls):[""]).includes("")?p(!0):p(!1)}),[m]);let h=m.hasOwnProperty("urls")?Object.entries(m.urls):[""];return(0,l.createElement)("div",{className:"cmplz-details-row"},(0,l.createElement)("label",null,"block_script"===u&&(0,r.__)("URLs that should be blocked before consent.","complianz-gdpr"),"whitelist_script"===u&&(0,l.createElement)(l.Fragment,null,(0,r.__)("URLs that should be whitelisted.","complianz-gdpr"),(0,n.default)("https://complianz.io/whitelisting-inline-script/"))),h.map((([r,n],i)=>(0,l.createElement)("div",{key:i,className:"cmplz-scriptcenter-url"},(0,l.createElement)(c.default,{disabled:a,value:n||"",onChange:a=>((a,l)=>{let r={...m},n={...r.urls};n[a]=l,r.urls=n,t(r,e.type)})(r,a),id:i+"_url",name:"url"}),0===i&&!d&&(0,l.createElement)("button",{className:"button button-default",onClick:()=>(()=>{let a={...m},l=a.hasOwnProperty("urls")?{...a.urls}:[""];l[Object.keys(l).length+1]="",a.urls=l,t(a,e.type)})()}," ",(0,l.createElement)(s.default,{name:"plus",size:14})),0!==i&&(0,l.createElement)("button",{className:"button button-default",onClick:()=>(a=>{let l={...m},r={...l.urls};delete r[a],l.urls=r,t(l,e.type)})(r)}," ",(0,l.createElement)(s.default,{name:"minus",size:14}))))))}},52010:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});var l=a(86087),r=a(45111);const n=e=>{const[t,a]=(0,l.useState)(!1);return(0,l.createElement)("div",{className:"cmplz-panel__list__item",style:e.style?e.style:{}},(0,l.createElement)("details",{open:t},(0,l.createElement)("summary",{onClick:e=>(e=>{e.preventDefault(),a(!t)})(e)},e.icon&&(0,l.createElement)(r.default,{name:e.icon}),(0,l.createElement)("h5",{className:"cmplz-panel__list__item__title"},e.summary),(0,l.createElement)("div",{className:"cmplz-panel__list__item__comment"},e.comment),(0,l.createElement)("div",{className:"cmplz-panel__list__item__icons"},e.icons),(0,l.createElement)(r.default,{name:"chevron-down",size:18})),(0,l.createElement)("div",{className:"cmplz-panel__list__item__details"},t&&e.details)))}},32921:(e,t,a)=>{a.r(t),a.d(t,{default:()=>c});var l=a(86087),r=a(27723),n=a(44124);const c=e=>(0,l.createElement)(l.Fragment,null," ",(0,l.createElement)(n.default,{url:e,target:"_blank",rel:"noopener noreferrer",text:(0,r.__)("For more information, please read this %sarticle%s.","complianz-gdpr")})," ")}}]);