import{h as m,$ as v,g as C,k as _,i as b,j as t,_ as s,z as r}from"./main.2.8.10.js";import{u as j,b as d}from"./react-router.DMwpH23k.js";import{S}from"./SnackMsg.7BjcJK1j.js";import{S as T,I,s as k}from"./Integrations.BFhED4ck.js";import{T as w}from"./TheEventsCalendarIntegLayout.BS8ZOuNv.js";import{h as c,T as N,c as y}from"./theEventsCalendarCommonFunctions.dSRBTcV7.js";import"./react-vendor.P7K3d6op.js";import"./Note.DalStCGz.js";import"./CopyIcn.BnhKHfEP.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./TagifyInput.C4ilRm4k.js";import"./lodash.DCvQBX3r.js";function G({allIntegURL:f}){const p=j(),[i,F]=m(v),[e,a]=m(C),[g,L]=d.useState(!1),[u,h]=d.useState({auth:!1,events:!1}),[x,n]=d.useState({show:!1}),l=_(b),E=()=>{if(!e.selectedTask){r.error(s("Please select a task!","bit-integrations"));return}if(e.selectedTask===N.NEW_ATTENDEE&&!e.selectedEvent){r.error(s("Please select a event!","bit-integrations"));return}if(!y(e)){r.error(s("Please map mandatory fields!","bit-integrations"));return}k({flow:i,allIntegURL:f,conf:e,navigate:p,edit:1,setSnackbar:n})};return t.jsxs("div",{style:{width:900},children:[t.jsx(S,{snack:x,setSnackbar:n}),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:o=>c(o,e,a),name:"name",defaultValue:e.name||"",type:"text",placeholder:s("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(T,{entity:i.triggered_entity,setSnackbar:n}),t.jsx(w,{formID:i.triggered_entity_id,formFields:l,handleInput:o=>c(o,e,a),theEventsCalendarConf:e,setTheEventsCalendarConf:a,loading:u,setLoading:h,setSnackbar:n}),t.jsx(I,{edit:!0,saveConfig:E,isLoading:g,dataConf:e,setDataConf:a,formFields:l}),t.jsx("br",{})]})}export{G as default};
