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