var j=Object.defineProperty;var f=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var u=(e,t,s)=>t in e?j(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,h=(e,t)=>{for(var s in t||(t={}))v.call(t,s)&&u(e,s,t[s]);if(f)for(var s of f(t))I.call(t,s)&&u(e,s,t[s]);return e};import{j as a,_}from"./main.2.8.1.js";import{u as C,h as y,d as c}from"./react-router-dom.9mCuUg3q.js";import"./Note.BeM7sN-p.js";import{S as N}from"./SnackMsg.S8DrwLlT.js";import{S as w}from"./Steps.1hz7v9Vj.js";import{I as L,s as T}from"./Integrations.D2bgBas2.js";import B from"./SlackAuthorization.AX8rlxP4.js";import{h as E}from"./SlackCommonFunc.lwaW_xKy.js";import{S as A}from"./SlackIntegLayout.B64MGeCX.js";import{B as D}from"./BackIcn._kGL_vVw.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./tutorialLinks.kMkIDzcD.js";import"./TutorialLink.BAFX--T3.js";function Y({formFields:e,setFlow:t,flow:s,allIntegURL:x}){const S=C(),{formID:g}=y(),[m,l]=c.useState(!1),[n,d]=c.useState(1),[k,i]=c.useState({show:!1}),[o,r]=c.useState({name:"Slack",type:"Slack",parse_mode:"HTML",field_map:[{formField:"",slackFormField:""}],channel_id:"",body:"",actions:{}}),b=p=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),o.name!==""&&o.channel_id&&d(p)};return a.jsxs("div",{children:[a.jsx(N,{snack:k,setSnackbar:i}),a.jsx("div",{className:"txt-center mt-2",children:a.jsx(w,{step:3,active:n})}),a.jsx(B,{formID:g,slackConf:o,setSlackConf:r,step:n,setstep:d,isLoading:m,setIsLoading:l,setSnackbar:i}),a.jsxs("div",{className:"btcd-stp-page",style:h({},n===2&&{width:900,height:"auto",overflow:"visible"}),children:[a.jsx(A,{formFields:e,handleInput:p=>E(p,o,r),slackConf:o,setSlackConf:r,isLoading:m,setIsLoading:l,setSnackbar:i}),a.jsxs("button",{onClick:()=>b(3),disabled:o.channel_id==="",className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[_("Next","bit-integrations"),a.jsx(D,{className:"ml-1 rev-icn"})]})]}),a.jsx(L,{step:n,saveConfig:()=>T({flow:s,setFlow:t,allIntegURL:x,conf:o,navigate:S,setIsLoading:l,setSnackbar:i}),isLoading:m,dataConf:o,setDataConf:r,formFields:e})]})}export{Y as default};
