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.9.0.js";import{u as w,b as r}from"./react-router.DMwpH23k.js";import{S as C}from"./StepPage.6Rz8L_er.js";import{S as y}from"./Steps.BYe8zHkm.js";import{s as L}from"./GoogleIntegrationHelpers.C5BmN2Z3.js";import{I as k}from"./Integrations.DL8wqGct.js";import E from"./NotionAuthorization.W4DS1lWB.js";import{n as F,d as P}from"./NotionCommonFunc.DDPBtj7g.js";import{N as R}from"./NotionIntegLayout.BxwkStPr.js";import"./react-vendor.P7K3d6op.js";import"./Note.NSUdvR3c.js";import"./CopyIcn.CEA_lFLo.js";import"./SnackMsg.DYSD96P4.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./TutorialLink.CFG7bS5c.js";import"./GlobalIntegrationHelper.B6YI8w_n.js";import"./TagifyInput.KPPRQJ1B.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};
