var R=Object.defineProperty,z=Object.defineProperties;var E=Object.getOwnPropertyDescriptors;var j=Object.getOwnPropertySymbols;var N=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable;var S=(t,e,i)=>e in t?R(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,x=(t,e)=>{for(var i in e||(e={}))N.call(e,i)&&S(t,i,e[i]);if(j)for(var i of j(e))_.call(e,i)&&S(t,i,e[i]);return t},I=(t,e)=>z(t,E(e));var w=(t,e,i)=>new Promise((h,p)=>{var n=s=>{try{o(i.next(s))}catch(m){p(m)}},b=s=>{try{o(i.throw(s))}catch(m){p(m)}},o=s=>s.done?h(s.value):Promise.resolve(s.value).then(n,b);o((i=i.apply(t,e)).next())});import{k as v,g as L,_ as a,j as r}from"./main.2.8.1.js";import{d as $}from"./react-router-dom.9mCuUg3q.js";import{S as D,I as g,E as k,G,A as U}from"./StepPage.B2uuvkiP.js";import{a9 as F}from"./Note.BeM7sN-p.js";import{h as y,c as O,a as B}from"./NotionCommonFunc.Dv7od-KB.js";import{t as H}from"./tutorialLinks.kMkIDzcD.js";import{T as f}from"./TutorialLink.BAFX--T3.js";import"./CopyIcn.3gZpHton.js";import"./Integrations.D2bgBas2.js";import"./SnackMsg.S8DrwLlT.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";function et({notionConf:t,setNotionConf:e,step:i,setStep:h,isInfo:p,loading:n,setLoading:b}){const o=v(L),[s,m]=$.useState(!1),[l,d]=$.useState({clientId:"",clientSecret:""}),{notion:c}=H,A=()=>w(null,null,function*(){setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),h(2),b(I(x({},n),{page:!0})),(yield B(t,e))&&b(I(x({},n),{page:!1}))}),T=`
  <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(f,{title:"Notion",youTubeLink:c==null?void 0:c.youTubeLink}),r.jsx(f,{title:"Notion",docLink:c==null?void 0:c.docLink}),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:u=>y(u,t,e,l,d)}),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:u=>y(u,t,e,l,d)}),r.jsx(k,{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:u=>y(u,t,e,l,d)}),r.jsx(k,{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(U,{onclick:()=>O(t,e,l,d,m,n,b,o),nextPage:A,auth:s,loading:n.auth})]}),r.jsx(F,{note:T})]})}export{et as default};
