var N=Object.defineProperty,v=Object.defineProperties;var j=Object.getOwnPropertyDescriptors;var l=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var c=(e,t,o)=>t in e?N(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,f=(e,t)=>{for(var o in t||(t={}))S.call(t,o)&&c(e,o,t[o]);if(l)for(var o of l(t))I.call(t,o)&&c(e,o,t[o]);return e},g=(e,t)=>v(e,j(t));import{j as a,_}from"./main.2.8.10.js";import{u as w,b as r}from"./react-router.DMwpH23k.js";import{S as C}from"./StepPage.Dcszwd6s.js";import{S as y}from"./Steps.B84Ui3GU.js";import{s as L}from"./GoogleIntegrationHelpers.CQstGYRP.js";import{I as k}from"./Integrations.BFhED4ck.js";import E from"./NotionAuthorization.Bwx9VkeG.js";import{n as F,d as P}from"./NotionCommonFunc.DXnv7q7e.js";import{N as R}from"./NotionIntegLayout.Df3PsD4I.js";import"./react-vendor.P7K3d6op.js";import"./Note.DalStCGz.js";import"./CopyIcn.BnhKHfEP.js";import"./SnackMsg.7BjcJK1j.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./TutorialLink.D6K_DiHL.js";import"./GlobalIntegrationHelper.Belqr4OT.js";import"./TagifyInput.C4ilRm4k.js";import"./lodash.DCvQBX3r.js";function tt({formFields:e,setFlow:t,flow:o,allIntegURL:u}){const x=w();r.useEffect(()=>{window.opener&&L("notion")},[]);const[i,d]=r.useState(1),[n,p]=r.useState({auth:!1,list:!1,page:!1,field:!1}),[s,m]=r.useState({name:"Notion",type:"Notion",clientId:"",clientSecret:"",databaseId:"",field_map:[{formFields:"",notionFormFields:""}],notionFields:""}),b=h=>{p(g(f({},n),{page:h}))};return a.jsxs("div",{children:[a.jsx("div",{className:"txt-center mt-2",children:a.jsx(y,{step:3,active:i})}),a.jsx(E,{step:i,setStep:d,notionConf:s,setNotionConf:m,loading:n,setLoading:p}),a.jsxs(C,{step:i,stepNo:2,style:{width:900,height:"auto",overflow:"visible"},children:[a.jsx(R,{notionConf:s,setNotionConf:m,formFields:e,loading:n,setLoading:p}),(s==null?void 0:s.databaseId)&&a.jsxs("button",{onClick:()=>F(s,d,3),disabled:!s.databaseId||s.field_map.length<1,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[_("Next")," ",a.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),s.databaseId&&a.jsx(k,{step:i,saveConfig:()=>P(o,t,u,s,x,b),isLoading:n.page,dataConf:s,setDataConf:m,formFields:e})]})}export{tt as default};
