import{h as d,$ as j,g as k,k as I,i as S,j as t,_ as s,q as n}from"./main.2.8.10.js";import{u as _,e as w,b as l}from"./react-router.DMwpH23k.js";import{S as F}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 m,c as p}from"./ClickupCommonFunc.-eeBvG2k.js";import{C as P}from"./ClickupIntegLayout.CBwMsp9C.js";import"./react-vendor.P7K3d6op.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./TagifyInput.C4ilRm4k.js";import"./lodash.DCvQBX3r.js";function Q({allIntegURL:f}){const g=_(),{id:L}=w(),[o,E]=d(j),[e,i]=d(k),[u,$]=l.useState(!1),[x,b]=l.useState({}),[h,a]=l.useState({show:!1}),c=I(S),C=()=>{if(!p(e)){a({show:!0,msg:s("Please map mandatory fields","bit-integrations")});return}if(e.actionName==="task"){if(!e.selectedTeam){n.error(s("Please select a team","bit-integrations"));return}if(!e.selectedSpace){n.error(s("Please select a space","bit-integrations"));return}if(!e.selectedFolder){n.error(s("Please select a folder","bit-integrations"));return}if(!e.selectedList){n.error(s("Please select a list","bit-integrations"));return}}N({flow:o,allIntegURL:f,conf:e,navigate:g,edit:1,setSnackbar:a})};return t.jsxs("div",{style:{width:900},children:[t.jsx(F,{snack:h,setSnackbar:a}),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:r=>m(r,e,i),name:"name",value:e.name,type:"text",placeholder:s("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(v,{entity:o.triggered_entity,setSnackbar:a}),t.jsx(P,{formID:o.triggered_entity_id,formFields:c,handleInput:r=>m(r,e,i),clickupConf:e,setClickupConf:i,loading:x,setLoading:b,setSnackbar:a}),t.jsx(y,{edit:!0,saveConfig:C,disabled:!p(e),isLoading:u,dataConf:e,setDataConf:i,formFields:c}),t.jsx("br",{})]})}export{Q as default};
