File: /var/www/html/wordpress/wp-content/plugins/bit-integrations/assets/bi.41.60.js
import{u as v,e as d,r as n,f as w,j as e}from"./main-685.js";import{$ as C,e as F,f as I,_ as a,V as m}from"./bi.878.0.js";import{S as _}from"./bi.674.13.js";import"./bi.451.455.js";import{S as N,I as y,s as k}from"./bi.776.3.js";import{h as p,c}from"./bi.237.819.js";import{H as E}from"./bi.676.820.js";import"./bi.327.9.js";import"./bi.601.11.js";import"./bi.825.14.js";import"./bi.768.751.js";import"./bi.666.752.js";import"./bi.463.750.js";function J({allIntegURL:f}){const u=v(),[r,H]=d(C),[t,i]=d(F),[g,x]=n.useState(!1),[b,s]=n.useState({show:!1}),l=w(I),[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}}k({flow:r,allIntegURL:f,conf:t,navigate:u,edit:1,setIsLoading:x,setSnackbar:s})};return e.jsxs("div",{style:{width:900},children:[e.jsx(_,{snack:b,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:l,handleInput:o=>p(o,t,i),hubspotConf:t,setHubspotConf:i,setSnackbar:s,loading:h,setLoading:j}),e.jsx(y,{edit:!0,saveConfig:S,disabled:!c(t),isLoading:g,dataConf:t,setDataConf:i,formFields:l}),e.jsx("br",{})]})}export{J as default};