var k=Object.defineProperty;var f=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;var b=(i,t,s)=>t in i?k(i,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[t]=s,d=(i,t)=>{for(var s in t||(t={}))S.call(t,s)&&b(i,s,t[s]);if(f)for(var s of f(t))y.call(t,s)&&b(i,s,t[s]);return i};import{u as w,k as G,r,j as a}from"./main-406.js";import{d as _,I,_ as N,s as C}from"./bi.394.85.js";import{S as q}from"./bi.68.941.js";import{s as D}from"./bi.93.731.js";import L from"./bi.644.235.js";import{c as T}from"./bi.545.758.js";import{G as E}from"./bi.384.759.js";import"./bi.150.760.js";import"./bi.704.707.js";import"./bi.701.708.js";import"./bi.285.720.js";import"./bi.840.704.js";function U({formFields:i,setFlow:t,flow:s,allIntegURL:x}){const h=w(),{flowID:c}=G(),[m,p]=r.useState(!1),[o,u]=r.useState(1),[v,n]=r.useState({show:!1}),g=[{key:"start",label:"Start Date Time",required:!0},{key:"end",label:"End Date Time",required:!0},{key:"summary",label:"Title",required:!1},{key:"location",label:"Location",required:!1},{key:"description",label:"Description",required:!1}],[e,l]=r.useState({name:"Google Calendar",type:"Google Calendar",clientId:"",clientSecret:"",field_map:[{formField:"",googleCalendarFormField:""}],reminder_field_map:[{method:"popup",minutes:"30"}],default:g,calendarLists:[],actions:{}});r.useEffect(()=>{window.opener&&D("googleCalendar")},[]);const j=()=>{C({flow:s,setFlow:t,allIntegURL:x,conf:e,navigate:h,setIsLoading:p,setSnackbar:n})};return a.jsxs("div",{children:[a.jsx(_,{snack:v,setSnackbar:n}),a.jsx("div",{className:"txt-center mt-2",children:a.jsx(q,{step:3,active:o})}),a.jsx(L,{flowID:c,googleCalendarConf:e,setGoogleCalendarConf:l,step:o,setStep:u,isLoading:m,setIsLoading:p,setSnackbar:n}),a.jsx("div",{className:"btcd-stp-page",style:d({},o===2&&{width:900,height:"auto",overflow:"visible"}),children:a.jsx(E,{flowID:c,formFields:i,googleCalendarConf:e,setGoogleCalendarConf:l})}),a.jsx(I,{step:o,saveConfig:()=>j(),isLoading:m,dataConf:e,setDataConf:l,formFields:i}),a.jsx("div",{className:"btcd-stp-page",style:d({},o===2&&{width:900,height:"auto",overflow:"visible"}),children:a.jsxs("button",{onClick:()=>u(3),disabled:!(e!=null&&e.calendarId)||!(e!=null&&e.timeZone)||!T(e==null?void 0:e.field_map),className:"btn ml-auto btcd-btn-lg purple sh-sm flx",type:"button",children:[N("Next","bit-integrations")," ",a.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})})]})}export{U as default};
