var S=Object.defineProperty;var f=Object.getOwnPropertySymbols;var C=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable;var u=(t,e,s)=>e in t?S(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,h=(t,e)=>{for(var s in e||(e={}))C.call(e,s)&&u(t,s,e[s]);if(f)for(var s of f(e))D.call(e,s)&&u(t,s,e[s]);return t};import{u as I,k,r as d,j as o}from"./main-406.js";import{d as _,_ as y,I as N,s as T}from"./bi.394.85.js";import{S as w}from"./bi.68.941.js";import L from"./bi.89.337.js";import{h as B}from"./bi.145.931.js";import{D as E}from"./bi.261.930.js";import{B as A}from"./bi.46.744.js";import"./bi.150.760.js";/* empty css          */function O({formFields:t,setFlow:e,flow:s,allIntegURL:x}){const g=I(),{formID:v}=k(),[m,l]=d.useState(!1),[n,p]=d.useState(1),[b,i]=d.useState({show:!1}),[a,r]=d.useState({name:"Discord",type:"Discord",accessToken:"",parse_mode:"HTML",field_map:[{formField:"",discordFormField:""}],server_id:"",channel_id:"",body:"",actions:{}}),j=c=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),c===3&&a.name!==""&&a.selectedChannel&&a.selectedServer&&p(c)};return o.jsxs("div",{children:[o.jsx(_,{snack:b,setSnackbar:i}),o.jsx("div",{className:"txt-center mt-2",children:o.jsx(w,{step:3,active:n})}),o.jsx(L,{formID:v,discordConf:a,setDiscordConf:r,step:n,setstep:p,isLoading:m,setIsLoading:l,setSnackbar:i}),o.jsxs("div",{className:"btcd-stp-page",style:h({},n===2&&{width:900,height:"auto",overflow:"visible"}),children:[o.jsx(E,{formFields:t,handleInput:c=>B(c,a,r),discordConf:a,setDiscordConf:r,isLoading:m,setIsLoading:l,setSnackbar:i}),o.jsxs("button",{onClick:()=>j(3),disabled:a.selectedChannel===""||a.selectedServer==="",className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[y("Next","bit-integrations"),o.jsx(A,{className:"ml-1 rev-icn"})]})]}),o.jsx(N,{step:n,saveConfig:()=>T({flow:s,setFlow:e,allIntegURL:x,conf:a,navigate:g,setIsLoading:l,setSnackbar:i}),isLoading:m,dataConf:a,setDataConf:r,formFields:t})]})}export{O as default};
