"use strict";(globalThis.webpackChunkcomplianz_gdpr=globalThis.webpackChunkcomplianz_gdpr||[]).push([[7120],{37120:(e,t,i)=>{i.r(t),i.d(t,{default:()=>o});var l=i(51280),a=i(88496),r=i(33496),n=(i(72256),i(40012),i(7424),i(93396)),c=i(15832);const o=(0,a.memo)((e=>{let t=e.mode?e.mode:"css",i=e.height?e.height:"200px",o=e.field&&e.field.default?e.field.default:e.placeholder;const[s,p]=(0,a.useState)(e.value),[d,u]=(0,a.useState)(!1);(0,a.useEffect)((()=>{if(s===e.value)return;const t=setTimeout((()=>{e.onChange(s)}),500);return()=>{clearTimeout(t)}}),[s]);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.cp,{readOnly:e.disabled,placeholder:"//"+o,mode:t,theme:"monokai",width:"100%",height:i,onChange:e=>(e=>{(e.includes("<script>")||e.includes("<\/script>"))&&u(!0),e=(e=e.replace(/<script>/gi,"")).replace(/<\/script>/gi,""),p(e)})(e),fontSize:12,showPrintMargin:!0,showGutter:!0,highlightActiveLine:!0,value:s,setOptions:{enableBasicAutocompletion:!1,enableLiveAutocompletion:!1,enableSnippets:!1,showLineNumbers:!0,tabSize:2,useWorker:!1}}))}))}}]);