import{h as d,$ as b,g as I,k as _,i as w,j as t,_ as n}from"./main.2.9.0.js";import{u as M,e as S,b as r}from"./react-router.DMwpH23k.js";import{S as v}from"./SnackMsg.DYSD96P4.js";import"./Note.NSUdvR3c.js";import"./CopyIcn.CEA_lFLo.js";import{S as y,I as F,s as N}from"./Integrations.DL8wqGct.js";import{h as c,c as l}from"./MoxieCRMCommonFunc.MhWMPA1f.js";import{M as R}from"./MoxieCRMIntegLayout.cjaVu5eG.js";import"./react-vendor.P7K3d6op.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";function J({allIntegURL:f}){const p=M(),{id:k}=S(),[i,E]=d(b),[e,a]=d(I),[g,x]=r.useState(!1),[u,h]=r.useState({}),[j,s]=r.useState({show:!1}),m=_(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:m,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:m}),t.jsx("br",{})]})}export{J as default};
