import{b as m,$ as b,h as I,k as _,i as w,j as t,_ as n}from"./main.2.8.1.js";import{u as M,h as S,d as r}from"./react-router-dom.9mCuUg3q.js";import{S as v}from"./SnackMsg.S8DrwLlT.js";import"./Note.BeM7sN-p.js";import{S as y,I as F,s as N}from"./Integrations.D2bgBas2.js";import{h as c,c as l}from"./MoxieCRMCommonFunc.y9gJP06f.js";import{M as R}from"./MoxieCRMIntegLayout.DQzni6jx.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";function H({allIntegURL:f}){const p=M(),{id:k}=S(),[i,E]=m(b),[e,a]=m(I),[g,x]=r.useState(!1),[u,h]=r.useState({}),[j,s]=r.useState({show:!1}),d=_(w),C=()=>{if(!l(e)){s({show:!0,msg:n("Please map mandatory fields","bit-integrations")});return}N({flow:i,allIntegURL:f,conf:e,navigate:p,edit:1,setIsLoading:x,setSnackbar:s})};return t.jsxs("div",{style:{width:900},children:[t.jsx(v,{snack:j,setSnackbar:s}),t.jsxs("div",{className:"flx mt-3",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:n("Integration Name:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5",onChange:o=>c(o,e,a),name:"name",value:e.name,type:"text",placeholder:n("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(y,{entity:i.triggered_entity,setSnackbar:s}),t.jsx(R,{formID:i.triggered_entity_id,formFields:d,handleInput:o=>c(o,e,a),moxiecrmConf:e,setMoxieCRMConf:a,loading:u,setLoading:h,setSnackbar:s}),t.jsx(F,{edit:!0,saveConfig:C,disabled:!l(e),isLoading:g,dataConf:e,setDataConf:a,formFields:d}),t.jsx("br",{})]})}export{H as default};
