var v=Object.defineProperty;var g=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var x=(a,t,s)=>t in a?v(a,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[t]=s,c=(a,t)=>{for(var s in t||(t={}))y.call(t,s)&&x(a,s,t[s]);if(g)for(var s of g(t))z.call(t,s)&&x(a,s,t[s]);return a};import{_ as i,j as e}from"./main.2.9.0.js";import{b as j}from"./react-router.DMwpH23k.js";import{y as _,a9 as E}from"./Note.NSUdvR3c.js";import{a as S}from"./SlackCommonFunc.D8dlseea.js";import{T as I}from"./TutorialLink.CFG7bS5c.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.CEA_lFLo.js";function O({formID:a,slackConf:t,setSlackConf:s,step:l,setstep:k,isLoading:d,setIsLoading:N,setSnackbar:T,redirectLocation:$,isInfo:n}){const[r,f]=j.useState(!1),[m,b]=j.useState({accessToken:""}),A=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),k(2)},p=o=>{const h=c({},t),u=c({},m);u[o.target.name]="",h[o.target.name]=o.target.value,b(u),s(h)},w=`
            <h4>${i("Get Access Token few step","bit-integrations")}</h4>
            <ul>
                <li>${i("First create app.","bit-integrations")}</li>
                <li>${i("Add an OAuth Scope <b>'channels:read, channels:write, chat:write, files:read, files:write'</b>.","bit-integrations")}</li>
                <li>${i("Generate Access Token clicking <b> 'install to Workspace'</b>.","bit-integrations")}</li>
            </ul>`;return e.jsxs("div",{className:"btcd-stp-page",style:{width:l===1&&900,height:l===1&&"auto"},children:[e.jsx(I,{linkKey:"slack"}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Integration Name:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:p,name:"name",value:t.name,type:"text",placeholder:i("Integration Name...","bit-integrations"),disabled:n}),e.jsxs("small",{className:"d-blk mt-5",children:[i("To get access Token , Please Visit","bit-integrations")," ",e.jsx("a",{className:"btcd-link",href:"https://api.slack.com/apps?new_app=1/",target:"_blank",rel:"noreferrer",children:i("Slack Console","bit-integrations")})]}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Access Token:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:p,name:"accessToken",value:t.accessToken,type:"text",placeholder:i("Access Token...","bit-integrations"),disabled:n}),e.jsx("div",{style:{color:"red"},children:m.accessToken}),!n&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>S(t,s,b,f,N,T),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:r||d,children:[r?i("Authorized ✔","bit-integrations"):i("Authorize","bit-integrations"),d&&e.jsx(_,{size:"20",clr:"#022217",className:"ml-2"})]}),e.jsx("br",{}),e.jsxs("button",{onClick:A,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!r,children:[i("Next","bit-integrations"),e.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),e.jsx(E,{note:w})]})}export{O as default};
