import{h as p,$ as j,g as C,k as w,i as I,j as t,_ as o,q as k}from"./main.2.9.0.js";import{u as S,e as v,b as r}from"./react-router.DMwpH23k.js";import{S as y}from"./SnackMsg.DYSD96P4.js";import"./Note.NSUdvR3c.js";import"./CopyIcn.CEA_lFLo.js";import{S as F,I as N,s as E}from"./Integrations.DL8wqGct.js";import{h as l,c as f}from"./WoodpeckerCommonFunc.BtRSD3lL.js";import{W as L}from"./WoodpeckerIntegLayout.BJy8n2lb.js";import"./react-vendor.P7K3d6op.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";function J({allIntegURL:g}){const u=S(),{id:W}=v(),[n,$]=p(j),[e,a]=p(C),[d,m]=r.useState(!1),[x,h]=r.useState({}),[_,s]=r.useState({show:!1}),c=w(I),b=()=>{if(!f(e)){s({show:!0,msg:o("Please map mandatory fields","bit-integrations")});return}if(e.actionName==="adding_prospects_to_the_campaign"&&!e.selectedCampaign){k.error(o("Please select a Campaign","bit-integrations"));return}E({flow:n,allIntegURL:g,conf:e,navigate:u,edit:1,setIsLoading:m,setSnackbar:s})};return t.jsxs("div",{style:{width:900},children:[t.jsx(y,{snack:_,setSnackbar:s}),t.jsxs("div",{className:"flx mt-3",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:o("Integration Name:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5",onChange:i=>l(i,e,a),name:"name",value:e.name,type:"text",placeholder:o("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(F,{entity:n.triggered_entity,setSnackbar:s}),t.jsx(L,{formID:n.triggered_entity_id,formFields:c,handleInput:i=>l(i,e,a),woodpeckerConf:e,setWoodpeckerConf:a,loading:x,setLoading:h,isLoading:d,setIsLoading:m,setSnackbar:s}),t.jsx(N,{edit:!0,saveConfig:b,disabled:!f(e),isLoading:d,dataConf:e,setDataConf:a,formFields:c}),t.jsx("br",{})]})}export{J as default};
