1 line
7.1 KiB
JavaScript
1 line
7.1 KiB
JavaScript
|
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[510],{68698:(e,t,l)=>{l.d(t,{A:()=>r});function r(e){let{editorHTMLElementRef:t,fieldObject:l,setRefresh:r,language:i="javascript",entry:a,jsonTextEditors:s,editorRef:n,readOnly:c,initialContent:o,options:d}=e;try{var h;if(!(null===(h=ace)||void 0===h?void 0:h.edit)||!t.current){console.log("Ace Editor not found!"),setTimeout(()=>{null==r||r(e=>e+1)},1e3);return}let e=ace.edit(t.current);e.setOptions({mode:"ace/mode/"+i,value:o||((null==l?void 0:l.defaultValue)?l.defaultValue:(null==l?void 0:l.fieldName)&&(null==a?void 0:a[l.fieldName])?(()=>{if("json"!==i)return a[l.fieldName];try{return JSON.stringify(JSON.parse(a[l.fieldName]),null,4)}catch(e){return a[l.fieldName]}})():""),placeholder:"json"==i?"{}":"",enableBasicAutocompletion:!0,enableLiveAutocompletion:!0,readOnly:c,...d}),n&&(null==l?void 0:l.fieldName)&&(null==s||s.current.push({fieldName:l.fieldName,ref:n}),n.current=e);try{ace.require("ace/ext/beautify").beautify(e.session)}catch(e){}}catch(e){console.log("JSON Editor ERROR =>",e.message)}}},41301:(e,t,l)=>{l.d(t,{A:()=>a});var r=l(74848),i=l(62027);function a(e){let{selectOptions:t,name:l,onChangeHandler:a,required:s,setAlert:n,title:c,defaultValue:o,info:d,id:h}=e;try{function u(e){if(e.type.match(/enter/i)&&window.innerWidth<1200)return;let t=e.target.closest(".info-wrapper"),l=t.querySelector(".info-dropdown");if(e.type.match(/leave/i)&&!l.classList.contains("hidden")){l.classList.add("hidden");return}if(!(e.type.match(/leave/i)&&l.classList.contains("hidden"))){if(!t){l.classList.add("hidden");return}if(l.classList.contains("hidden")){l.classList.remove("hidden");return}l.classList.add("hidden")}}return(0,r.jsxs)("div",{className:"form-select-block flex items-start flex-col gap-0.5 w-full relative"+(d?" pr-8":""),children:[c&&(0,r.jsxs)("label",{htmlFor:l,children:[c,s?"":" (optional)"]}),(0,r.jsxs)("div",{className:"flex items-center w-full relative",children:[(0,r.jsx)("select",{name:l,id:h||l,className:"w-full bg-white",required:s,onChange:e=>{n&&n(null),e.target.classList.remove("warning"),a&&a(e)},defaultValue:o||void 0,children:t.map((e,t)=>{let{payload:l,title:i}=e;return(0,r.jsx)("option",{value:l,selected:!!e.default,children:i},t+1)})}),(0,r.jsx)(i.A,{className:"absolute right-2 text-base text-slate-500 pointer-events-none",size:20}),d&&(0,r.jsxs)("div",{className:"info-wrapper absolute -right-10 w-8 h-8 rounded-full bg-white flex items-center justify-center z-10",style:{top:"50%",transform:"translate(0,-50%)"},onMouseEnter:u,onMouseLeave:u,onClick:u,children:[(0,r.jsx)("img",{src:"/images/info-outlined-black.png",alt:"",className:"w-6 h-6 object-contain opacity-60 pointer-events-none"}),(0,r.jsx)("div",{className:"info-dropdown absolute top-9 right-0 bg-white w-52 md:w-96 p-2 sm:p-6 shadow-xl rounded hidden text-center border border-slate-300 border-solid",children:(0,r.jsx)("span",{children:d})}),(0,r.jsx)("div",{className:"absolute -top-2 w-12",style:{height:"45px"}})]})]})]})}catch(e){return console.log("ERROR in FormSelect =>",e),(0,r.jsx)("div",{children:"Form Select Error"})}}l(96540)},79285:(e,t,l)=>{l.d(t,{A:()=>c});var r=l(74848),i=l(23698),a=l(96540),s=l(68698),n=l(50856);function c(e){let{editorRef:t,content:l,readOnly:c,language:o="javascript",options:d,wrapperProps:h}=e;try{let e=a.useRef(),[i,u]=a.useState(0);return a.useEffect(()=>{(0,s.A)({editorRef:t,fieldObject:{fieldName:"test"},editorHTMLElementRef:e,setRefresh:u,language:o,readOnly:c,initialContent:l,options:d})},[i,l]),(0,r.jsx)("div",{...h,ref:e,className:(0,n.QP)("ace-editor-wrapper w-full h-full minimal-scrollbars all-children",null==h?void 0:h.className)})}catch(e){return a.useEffect(()=>{(0,i.A)("/api/admin/clientError",{method:"post",body:{component:"AceEditor/main-catch-error",message:e.message,user:{}}})},[]),(0,r.jsx)(a.Fragment,{children:(0,r.jsx)("h2",{className:"text-xl m-0",children:"Editor Error"})})}}},35681:(e,t,l)=>{l.d(t,{A:()=>n});var r=l(74848),i=l(96540),a=l(51105),s=l(87220);function n(e){let{content:t,language:l,style:n,showCopy:c
|