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