var z=Object.defineProperty;var x=Object.getOwnPropertySymbols;var L=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var k=(n,e,s)=>e in n?z(n,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[e]=s,l=(n,e)=>{for(var s in e||(e={}))L.call(e,s)&&k(n,s,e[s]);if(x)for(var s of x(e))S.call(e,s)&&k(n,s,e[s]);return n};import{_ as i,j as t}from"./main.2.8.1.js";import{d as j}from"./react-router-dom.9mCuUg3q.js";import{z as _,a9 as E}from"./Note.BeM7sN-p.js";import{a as I}from"./SlackCommonFunc.lwaW_xKy.js";import{t as $}from"./tutorialLinks.kMkIDzcD.js";import{T}from"./TutorialLink.BAFX--T3.js";import"./CopyIcn.3gZpHton.js";function W({formID:n,slackConf:e,setSlackConf:s,step:d,setstep:N,isLoading:m,setIsLoading:f,setSnackbar:A,redirectLocation:C,isInfo:r}){const[o,w]=j.useState(!1),[b,p]=j.useState({accessToken:""}),{slack:a}=$,v=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),N(2)},h=c=>{const u=l({},e),g=l({},b);g[c.target.name]="",u[c.target.name]=c.target.value,p(g),s(u)},y=`
            <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 t.jsxs("div",{className:"btcd-stp-page",style:{width:d===1&&900,height:d===1&&"auto"},children:[t.jsx(T,{title:"Slack",youTubeLink:a==null?void 0:a.youTubeLink}),t.jsx(T,{title:"Slack",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:h,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://api.slack.com/apps?new_app=1/",target:"_blank",rel:"noreferrer",children:i("Slack 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:h,name:"accessToken",value:e.accessToken,type:"text",placeholder:i("Access Token...","bit-integrations"),disabled:r}),t.jsx("div",{style:{color:"red"},children:b.accessToken}),!r&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:()=>I(e,s,p,w,f,A),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(_,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:v,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:y})]})}export{W as default};
