import{b as c,$ as S,h as I,k as _,i as w,j as e,_ as a,q as m}from"./main.2.8.1.js";import{u as C,h as N,d as r}from"./react-router-dom.9mCuUg3q.js";import{S as k}from"./SnackMsg.S8DrwLlT.js";import"./Note.BeM7sN-p.js";import{S as v,I as y,s as F}from"./Integrations.D2bgBas2.js";import{h as l,c as f}from"./AsanaCommonFunc.CL0P85Ce.js";import{A}from"./AsanaIntegLayout.eGpW563B.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:p}){const g=C(),{id:P}=N(),[i,E]=c(S),[t,n]=c(I),[u,L]=r.useState(!1),[x,h]=r.useState({}),[j,s]=r.useState({show:!1}),d=_(w),b=()=>{if(!f(t)){s({show:!0,msg:a("Please map mandatory fields","bit-integrations")});return}if(t.actionName==="task"){if(!t.selectedProject){m.error(a("Please select a project","bit-integrations"));return}if(!t.selectedSections&&t.actionName==="task"){m.error(a("Please select a Section","bit-integrations"));return}}F({flow:i,allIntegURL:p,conf:t,navigate:g,edit:1,setSnackbar:s})};return e.jsxs("div",{style:{width:900},children:[e.jsx(k,{snack:j,setSnackbar:s}),e.jsxs("div",{className:"flx mt-3",children:[e.jsx("b",{className:"wdt-200 d-in-b",children:a("Integration Name:","bit-integrations")}),e.jsx("input",{className:"btcd-paper-inp w-5",onChange:o=>l(o,t,n),name:"name",value:t.name,type:"text",placeholder:a("Integration Name...","bit-integrations")})]}),e.jsx("br",{}),e.jsx(v,{entity:i.triggered_entity,setSnackbar:s}),e.jsx(A,{formID:i.triggered_entity_id,formFields:d,handleInput:o=>l(o,t,n),asanaConf:t,setAsanaConf:n,loading:x,setLoading:h,setSnackbar:s}),e.jsx(y,{edit:!0,saveConfig:b,disabled:!f(t),isLoading:u,dataConf:t,setDataConf:n,formFields:d}),e.jsx("br",{})]})}export{O as default};
