import{h as c,g as j,$ as w,k,i as I,j as e,_ as o}from"./main.2.8.10.js";import{e as _,u as C,b as l}from"./react-router.DMwpH23k.js";import{S}from"./SnackMsg.7BjcJK1j.js";import"./Note.DalStCGz.js";import"./CopyIcn.BnhKHfEP.js";import{S as v,I as y,s as N}from"./Integrations.BFhED4ck.js";import{h as p,c as D}from"./ZohoDeskCommonFunc.HGbTsWRd.js";import{Z as F}from"./ZohoDeskIntegLayout.DCQdhgsS.js";import"./react-vendor.P7K3d6op.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./TagifyInput.C4ilRm4k.js";import"./lodash.DCvQBX3r.js";function J({allIntegURL:f}){const{id:E,formID:r}=_(),g=C(),[t,n]=c(j),[m,u]=c(w),[h,i]=l.useState(!1),[x,s]=l.useState({show:!1}),d=k(I),b=()=>{var a;if(!D(t)){s({show:!0,msg:o("Please map mandatory fields","bit-integrations")});return}if(!((a=t.actions)!=null&&a.ticket_owner)){s({show:!0,msg:o("Please select a ticket owner","bit-integrations")});return}N({flow:m,setFlow:u,allIntegURL:f,conf:t,navigate:g,edit:1,setIsLoading:i,setSnackbar:s})};return e.jsxs("div",{style:{width:900},children:[e.jsx(S,{snack:x,setSnackbar:s}),e.jsxs("div",{className:"flx mt-3",children:[e.jsx("b",{className:"wdt-200 d-in-b",children:o("Integration Name:","bit-integrations")}),e.jsx("input",{className:"btcd-paper-inp w-7",onChange:a=>p(a,t,n),name:"name",value:t.name,type:"text",placeholder:o("Integration Name...","bit-integrations")})]}),e.jsx("br",{}),e.jsx("br",{}),e.jsx(v,{entity:m.triggered_entity,setSnackbar:s}),e.jsx(F,{formID:r,formFields:d,handleInput:a=>p(a,t,n,r,i,s),deskConf:t,setDeskConf:n,isLoading:h,setIsLoading:i,setSnackbar:s}),e.jsx(y,{edit:!0,saveConfig:b,disabled:t.department===""||t.table===""||t.field_map.length<1,dataConf:t,setDataConf:n,formFields:d})]})}export{J as default};
