import{h as c,$ as j,g as S,k as w,i as F,j as t,_ as s,q as o}from"./main.2.9.0.js";import{u as I,b as r}from"./react-router.DMwpH23k.js";import{S as L}from"./SnackMsg.DYSD96P4.js";import"./Note.NSUdvR3c.js";import"./CopyIcn.CEA_lFLo.js";import{S as y,I as v,s as C}from"./Integrations.DL8wqGct.js";import{h as N,c as d}from"./LMFWCCommonFunc.CV-Xm892.js";import{L as k}from"./LMFWCIntegLayout.DIFqw86G.js";import"./react-vendor.P7K3d6op.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./ProUtilHelpers.CHf_DzPf.js";function H({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{H as default};
