import{b as l,$ as v,h as w,k as C,i as F,j as e,_ as a,z as m}from"./main.2.8.1.js";import{u as I,d as n}from"./react-router-dom.9mCuUg3q.js";import{S as _}from"./SnackMsg.S8DrwLlT.js";import"./Note.BeM7sN-p.js";import{S as N,I as k,s as y}from"./Integrations.D2bgBas2.js";import{h as p,c}from"./HubspotCommonFunc.B--GaSYa.js";import{H as E}from"./HubspotIntegLayout.akUYLarm.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./TagifyInput.Cu0YIRbG.js";import"./tagify.YxUZd8Ix.js";import"./ActionProFeatureLabels.CuihmlQ8.js";function K({allIntegURL:f}){const u=I(),[r,H]=l(v),[t,i]=l(w),[g,b]=n.useState(!1),[x,s]=n.useState({show:!1}),d=C(F),[h,j]=n.useState({auth:!1,customFields:!1,hubSpotFields:!0}),S=()=>{if(!c(t)){s({show:!0,msg:a("Please map mandatory fields","bit-integrations")});return}if(t.actionName==="ticket"){if(t.pipeline===void 0){m.error(a("Please select a pipeline","bit-integrations"));return}if(t.stage===void 0){m.error(a("Please select a stage","bit-integrations"));return}}y({flow:r,allIntegURL:f,conf:t,navigate:u,edit:1,setIsLoading:b,setSnackbar:s})};return e.jsxs("div",{style:{width:900},children:[e.jsx(_,{snack:x,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=>p(o,t,i),name:"name",value:t.name,type:"text",placeholder:a("Integration Name...","bit-integrations")})]}),e.jsx("br",{}),e.jsx(N,{entity:r.triggered_entity,setSnackbar:s}),e.jsx(E,{formFields:d,handleInput:o=>p(o,t,i),hubspotConf:t,setHubspotConf:i,setSnackbar:s,loading:h,setLoading:j}),e.jsx(k,{edit:!0,saveConfig:S,disabled:!c(t),isLoading:g,dataConf:t,setDataConf:i,formFields:d}),e.jsx("br",{})]})}export{K as default};
