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.9.0.js";import{u as j,b as d}from"./react-router.DMwpH23k.js";import{S}from"./SnackMsg.DYSD96P4.js";import{S as T,I,s as k}from"./Integrations.DL8wqGct.js";import{T as w}from"./TheEventsCalendarIntegLayout.OIiP0IEC.js";import{h as c,T as N,c as y}from"./theEventsCalendarCommonFunctions.B52F1C2_.js";import"./react-vendor.P7K3d6op.js";import"./Note.NSUdvR3c.js";import"./CopyIcn.CEA_lFLo.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./TagifyInput.KPPRQJ1B.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};
