import{b as d,$ as j,h as k,k as I,i as S,j as t,_ as s,q as n}from"./main.2.8.1.js";import{u as _,h as w,d as l}from"./react-router-dom.9mCuUg3q.js";import{S as F}from"./SnackMsg.S8DrwLlT.js";import"./Note.BeM7sN-p.js";import{S as v,I as y,s as N}from"./Integrations.D2bgBas2.js";import{h as m,c as p}from"./ClickupCommonFunc.CRon7DBn.js";import{C as P}from"./ClickupIntegLayout.DkdxIejK.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./TagifyInput.Cu0YIRbG.js";import"./tagify.YxUZd8Ix.js";function O({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{O as default};
