import{b as c,$ as j,h as I,k as y,i as S,j as t,_ as a,q as n}from"./main.2.8.1.js";import{u as w,d as r}from"./react-router-dom.9mCuUg3q.js";import{S as C}from"./SnackMsg.S8DrwLlT.js";import{S as v,I as F,s as N}from"./Integrations.D2bgBas2.js";import{h as k,c as l}from"./ACPTCommonFunc.Bw3Hgvq6.js";import{A}from"./ACPTIntegLayout.BxTzVKoE.js";import"./Note.BeM7sN-p.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./ProUtilHelpers.fQlR3mWW.js";import"./TagifyInput.Cu0YIRbG.js";import"./tagify.YxUZd8Ix.js";function K({allIntegURL:m}){const g=w(),[s,P]=c(j),[e,o]=c(I),[f,d]=r.useState(!1),[u,_]=r.useState({}),[x,i]=r.useState({show:!1}),p=y(S),b=()=>{if(!l(e)){n.error(a("Please map mandatory fields","bit-integrations"));return}if(["create_cpt","update_cpt","create_option_page","update_option_page"].includes(e.module)&&!(e!=null&&e.icon)){n.error(a("Please select Icon","bit-integrations"));return}if(["create_option_page","update_option_page"].includes(e.module)&&!(e!=null&&e.capability)){n.error(a("Please select Capability","bit-integrations"));return}N({flow:s,allIntegURL:m,conf:e,navigate:g,edit:1,setIsLoading:d,setSnackbar:i})};return t.jsxs("div",{style:{width:900},children:[t.jsx(C,{snack:x,setSnackbar:i}),t.jsxs("div",{className:"flx mt-3",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:a("Integration Name:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5",onChange:h=>k(h,e,o),name:"name",value:e.name,type:"text",placeholder:a("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(v,{entity:s.triggered_entity,setSnackbar:i}),t.jsx(A,{formID:s.triggered_entity_id,formFields:p,acptConf:e,setAcptConf:o,loading:u,setLoading:_,setIsLoading:d,setSnackbar:i}),t.jsx(F,{edit:!0,saveConfig:b,disabled:!l(e),isLoading:f,dataConf:e,setDataConf:o,formFields:p}),t.jsx("br",{})]})}export{K as default};
