"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[3323],{43323:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var l=a(65043),s=a(89923),n=a(70579);const r=e=>{let{onChange:t}=e;const[a,r]=(0,l.useState)(!1),[u,o]=(0,l.useState)(""),[c,d]=(0,l.useState)(""),[i,m]=(0,l.useState)(""),[g,h]=(0,l.useState)(""),[p,b]=(0,l.useState)(""),[v,x]=(0,l.useState)(""),[j,f]=(0,l.useState)(""),[S,k]=(0,l.useState)("namespace"),[C,_]=(0,l.useState)(""),[w,E]=(0,l.useState)(""),[y,B]=(0,l.useState)(""),q=(0,l.useCallback)((()=>`${p}:${v}@tcp(${c}:${g})/${i}`),[p,v,c,g,i]);(0,l.useEffect)((()=>{if(""!==u){t([{key:"dsn_string",value:u},{key:"table",value:j},{key:"format",value:S},{key:"queue_dir",value:C},{key:"queue_limit",value:w},{key:"comment",value:y}])}}),[u,j,S,C,w,y,t]),(0,l.useEffect)((()=>{const e=q();o(e)}),[p,i,v,g,c,o,q]);return(0,n.jsxs)(s.Hbc,{withBorders:!1,containerPadding:!1,children:[(0,n.jsx)(s.dOG,{label:"Enter DNS String",checked:a,id:"checkedB",name:"checkedB",onChange:e=>{if(e.target.checked){const e=q();o(e)}else{const e=(e=>{let t=new Map;const a=/(.*?):(.*?)@tcp\((.*?):(.*?)\)\/(.*?)$/gm;let l;for(;null!==(l=a.exec(e));)l.index===a.lastIndex&&a.lastIndex++,t.set("user",l[1]),t.set("password",l[2]),t.set("host",l[3]),t.set("port",l[4]),t.set("dbname",l[5]);return t})(u);d(e.get("host")?e.get("host")+"":""),h(e.get("port")?e.get("port")+"":""),m(e.get("dbname")?e.get("dbname")+"":""),b(e.get("user")?e.get("user")+"":""),x(e.get("password")?e.get("password")+"":"")}r(e.target.checked)},value:"dnsString"}),a?(0,n.jsx)(l.Fragment,{children:(0,n.jsx)(s.azJ,{className:"inputItem",children:(0,n.jsx)(s.cl_,{id:"dsn-string",name:"dsn_string",label:"DSN String",value:u,onChange:e=>{o(e.target.value)}})})}):(0,n.jsxs)(l.Fragment,{children:[(0,n.jsx)(s.azJ,{children:(0,n.jsxs)(s.azJ,{withBorders:!0,useBackground:!0,sx:{overflowY:"auto",height:170,marginBottom:12},children:[(0,n.jsx)(s.cl_,{id:"host",name:"host",label:"",placeholder:"Enter Host",value:c,onChange:e=>{d(e.target.value)}}),(0,n.jsx)(s.cl_,{id:"db-name",name:"db-name",label:"",placeholder:"Enter DB Name",value:i,onChange:e=>{m(e.target.value)}}),(0,n.jsx)(s.cl_,{id:"port",name:"port",label:"",placeholder:"Enter Port",value:g,onChange:e=>{h(e.target.value)}}),(0,n.jsx)(s.cl_,{id:"user",name:"user",label:"",placeholder:"Enter User",value:p,onChange:e=>{b(e.target.value)}}),(0,n.jsx)(s.cl_,{id:"password",name:"password",label:"",placeholder:"Enter Password",type:"password",value:v,onChange:e=>{x(e.target.value)}})]})}),(0,n.jsx)(s.xA9,{item:!0,xs:12,sx:{margin:"12px 0"},children:(0,n.jsx)(s.EmB,{label:"Connection String",multiLine:!0,children:u})})]}),(0,n.jsx)(s.cl_,{id:"table",name:"table",label:"Table",placeholder:"Enter Table Name",value:j,tooltip:"DB table name to store/update events, table is auto-created",onChange:e=>{f(e.target.value)}}),(0,n.jsx)(s.z6M,{currentValue:S,id:"format",name:"format",label:"Format",onChange:e=>{k(e.target.value)},tooltip:"'namespace' reflects current bucket/object list and 'access' reflects a journal of object operations, defaults to 'namespace'",selectorOptions:[{label:"Namespace",value:"namespace"},{label:"Access",value:"access"}]}),(0,n.jsx)(s.cl_,{id:"queue-dir",name:"queue_dir",label:"Queue Dir",placeholder:"Enter Queue Dir",value:C,tooltip:"Staging directory for undelivered messages e.g. '/home/events'",onChange:e=>{_(e.target.value)}}),(0,n.jsx)(s.cl_,{id:"queue-limit",name:"queue_limit",label:"Queue Limit",placeholder:"Enter Queue Limit",type:"number",value:w,tooltip:"Maximum limit for undelivered messages, defaults to '10000'",onChange:e=>{E(e.target.value)}}),(0,n.jsx)(s.hFj,{id:"comment",name:"comment",label:"Comment",placeholder:"Enter custom notes if any",value:y,onChange:e=>{B(e.target.value)}})]})}}}]);
//# sourceMappingURL=3323.8de9a2da.chunk.js.map