var z=Object.defineProperty;var k=Object.getOwnPropertySymbols;var $=Object.prototype.hasOwnProperty,L=Object.prototype.propertyIsEnumerable;var j=(n,e,s)=>e in n?z(n,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[e]=s,c=(n,e)=>{for(var s in e||(e={}))$.call(e,s)&&j(n,s,e[s]);if(k)for(var s of k(e))L.call(e,s)&&j(n,s,e[s]);return n};import{_ as i,j as t}from"./main.2.8.1.js";import{d as T}from"./react-router-dom.9mCuUg3q.js";import{z as S,a9 as E}from"./Note.BeM7sN-p.js";import{b as _,g as B}from"./DiscordCommonFunc.CxpQNkyY.js";import{t as D}from"./tutorialLinks.kMkIDzcD.js";import{T as N}from"./TutorialLink.BAFX--T3.js";import"./CopyIcn.3gZpHton.js";function H({formID:n,discordConf:e,setDiscordConf:s,step:b,setstep:f,isLoading:m,setIsLoading:d,setSnackbar:v,redirectLocation:I,isInfo:r}){const[o,A]=T.useState(!1),[p,h]=T.useState({accessToken:""}),{discord:a}=D,y=()=>{B(e,s,d),setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),f(2)},u=l=>{const g=c({},e),x=c({},p);x[l.target.name]="",g[l.target.name]=l.target.value,h(x),s(g)},w=`
            <h4>${i("Get Access Token few step","bit-integrations")}</h4>
            <ul>
                <li>${i("First create app.","bit-integrations")}</li>
                <li>${i("Click on OAuth2.","bit-integrations")}</li>
                <li>${i("Select <b>bot</b> from scopes.","bit-integrations")}</li>
                <li>${i("Select permissions from <b>Bot Permissions</b>.","bit-integrations")}</li>
                <li>${i("Then copy the <b>generated url</b> and paste it in the browser and hit enter.","bit-integrations")}</li>
                <li>${i("Then click on <b>Bot</b>  from left navbar and copy the <b>Access token</b>.","bit-integrations")}</li>
            </ul>`;return t.jsxs("div",{className:"btcd-stp-page",style:{width:b===1&&900,height:b===1&&"auto"},children:[t.jsx(N,{title:"Discord",youTubeLink:a==null?void 0:a.youTubeLink}),t.jsx(N,{title:"Discord",docLink:a==null?void 0:a.docLink}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:i("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:u,name:"name",value:e.name,type:"text",placeholder:i("Integration Name...","bit-integrations"),disabled:r}),t.jsxs("small",{className:"d-blk mt-5",children:[i("To get access Token , Please Visit","bit-integrations")," ",t.jsx("a",{className:"btcd-link",href:"https://discord.com/developers/applications",target:"_blank",rel:"noreferrer",children:i("Discord Console","bit-integrations")})]}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:i("Access Token:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:u,name:"accessToken",value:e.accessToken,type:"text",placeholder:i("Access Token...","bit-integrations"),disabled:r}),t.jsx("div",{style:{color:"red"},children:p.accessToken}),!r&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:()=>_(e,s,h,A,d,v),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:o||m,children:[o?i("Authorized ✔","bit-integrations"):i("Authorize","bit-integrations"),m&&t.jsx(S,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:y,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!o,children:[i("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),t.jsx(E,{note:w})]})}export{H as default};
