var k=Object.defineProperty,R=Object.defineProperties;var z=Object.getOwnPropertyDescriptors;var y=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var j=(t,e,i)=>e in t?k(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,d=(t,e)=>{for(var i in e||(e={}))E.call(e,i)&&j(t,i,e[i]);if(y)for(var i of y(e))T.call(e,i)&&j(t,i,e[i]);return t},x=(t,e)=>R(t,z(e));var S=(t,e,i)=>new Promise((h,p)=>{var s=n=>{try{o(i.next(n))}catch(m){p(m)}},b=n=>{try{o(i.throw(n))}catch(m){p(m)}},o=n=>n.done?h(n.value):Promise.resolve(n.value).then(s,b);o((i=i.apply(t,e)).next())});import{k as _,f as v,_ as a,j as r}from"./main.2.9.0.js";import{b as w}from"./react-router.DMwpH23k.js";import{S as D,I as g,E as $,G,A as N}from"./StepPage.6Rz8L_er.js";import{a9 as U}from"./Note.NSUdvR3c.js";import{h as I,c as F,a as O}from"./NotionCommonFunc.DDPBtj7g.js";import{T as B}from"./TutorialLink.CFG7bS5c.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.CEA_lFLo.js";import"./Integrations.DL8wqGct.js";import"./SnackMsg.DYSD96P4.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";function C({notionConf:t,setNotionConf:e,step:i,setStep:h,isInfo:p,loading:s,setLoading:b}){const o=_(v),[n,m]=w.useState(!1),[l,u]=w.useState({clientId:"",clientSecret:""}),f=()=>S(null,null,function*(){setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),h(2),b(x(d({},s),{page:!0})),(yield O(t,e))&&b(x(d({},s),{page:!1}))}),A=`
  <h4>${a("Step of get Client Id & Client Secret","bit-integrations")}</h4>
  <ul>
    <li>${a("Goto","bit-integrations")}Goto <a href="https://www.notion.so/my-integrations" target='_blank'>My integrations.</a></li>
    <li>${a("Click new integration.","bit-integrations")}</li>
    <li>${a("Name to identify your integration to users.","bit-integrations")}</li>
    <li>${a("<b>User Capabilities</b> always select read user information including email addresses","bit-integrations")}</li>
    <li><b>${a("Submit","bit-integrations")}</b></li>
    <li>${a("Select <b>Integration type</b> Public","bit-integrations")}</li>
    <li>${a("Fill up <b>OAuth Domain & URIs</b> information","bit-integrations")}</li>
    <li>${a("Homepage & Redirect URIs copy from Integration Settings","bit-integrations")}</li>
    <li>${a("Finally, click <b>Authorize</b> button.","bit-integrations")}</li>
</ul>
`;return r.jsxs(D,{step:i,stepNo:1,style:{width:900,height:"auto"},children:[r.jsx(B,{linkKey:"notion"}),r.jsxs("div",{className:"mt-2",children:[r.jsx(g,{label:a("Integration Name","bit-integrations"),name:"name",placeholder:a("Integration Name...","bit-integrations"),value:t.name,onchange:c=>I(c,t,e,l,u)}),r.jsx(g,{label:"Homepage",copytext:window.location.origin,setToast:!0}),r.jsx(g,{label:"Redirect URIs",copytext:`${o.api}/redirect`,setToast:!0}),r.jsx(g,{label:a("OAuth client ID","bit-integrations"),name:"clientId",placeholder:a("client ID...","bit-integrations"),value:t.clientId,onchange:c=>I(c,t,e,l,u)}),r.jsx($,{error:l.clientId}),r.jsx(g,{label:a("OAuth client secret","bit-integrations"),name:"clientSecret",placeholder:a("client Secret...","bit-integrations"),value:t.clientSecret,onchange:c=>I(c,t,e,l,u)}),r.jsx($,{error:l.clientSecret}),r.jsx(G,{url:"https://www.notion.so/my-integrations",info:a("Notion My integrations, please visit","bit-integrations")}),!p&&r.jsx(N,{onclick:()=>F(t,e,l,u,m,s,b,o),nextPage:f,auth:n,loading:s.auth})]}),r.jsx(U,{note:A})]})}export{C as default};
