import{h as d,$ as j,g as _,k as w,i as C,j as e,_ as s,q as l}from"./main.2.9.0.js";import{u as I,b as n}from"./react-router.DMwpH23k.js";import{S as N}from"./SnackMsg.DYSD96P4.js";import{S as v,I as y,s as F}from"./Integrations.DL8wqGct.js";import{h as k,c}from"./SmartSuiteCommonFunc.BODPe02n.js";import{S as E}from"./SmartSuiteIntegLayout.Bwm3H-rV.js";import"./react-vendor.P7K3d6op.js";import"./Note.NSUdvR3c.js";import"./CopyIcn.CEA_lFLo.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./FieldMapHelper.D-WuI2oA.js";import"./TagifyInput.KPPRQJ1B.js";import"./lodash.DCvQBX3r.js";import"./ProUtilHelpers.CHf_DzPf.js";function Q({allIntegURL:p}){const f=I(),[i,L]=d(j),[t,o]=d(_),[g,r]=n.useState(!1),[u,x]=n.useState({}),[S,a]=n.useState({show:!1}),m=w(C),b=()=>{if(!c(t)){a({show:!0,msg:s("Please map mandatory fields","bit-integrations")});return}if((t.actionName==="table"||t.actionName==="record")&&!t.selectedSolution){l.error(s("Please select a solution","bit-integrations"));return}if(t.actionName==="record"&&!t.selectedTable){l.error(s("Please select a table","bit-integrations"));return}F({flow:i,allIntegURL:p,conf:t,navigate:f,edit:1,setIsLoading:r,setSnackbar:a})};return e.jsxs("div",{style:{width:900},children:[e.jsx(N,{snack:S,setSnackbar:a}),e.jsxs("div",{className:"flx mt-3",children:[e.jsx("b",{className:"wdt-200 d-in-b",children:s("Integration Name:","bit-integrations")}),e.jsx("input",{className:"btcd-paper-inp w-5",onChange:h=>k(h,t,o),name:"name",value:t.name,type:"text",placeholder:s("Integration Name...","bit-integrations")})]}),e.jsx("br",{}),e.jsx(v,{entity:i.triggered_entity,setSnackbar:a}),e.jsx(E,{formID:i.triggered_entity_id,formFields:m,smartSuiteConf:t,setSmartSuiteConf:o,loading:u,setLoading:x,setIsLoading:r,setSnackbar:a}),e.jsx(y,{edit:!0,saveConfig:b,disabled:!c(t),isLoading:g,dataConf:t,setDataConf:o,formFields:m}),e.jsx("br",{})]})}export{Q as default};
