var T=Object.defineProperty;var x=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var g=(e,s,a)=>s in e?T(e,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[s]=a,b=(e,s)=>{for(var a in s||(s={}))_.call(s,a)&&g(e,a,s[a]);if(x)for(var a of x(s))E.call(s,a)&&g(e,a,s[a]);return e};import{_ as i,j as t}from"./main.2.8.1.js";import{d as j}from"./react-router-dom.9mCuUg3q.js";import{z,a9 as L}from"./Note.BeM7sN-p.js";import{w as P}from"./WoodpeckerCommonFunc.dq-IRStb.js";import{t as f}from"./tutorialLinks.kMkIDzcD.js";import{T as k}from"./TutorialLink.BAFX--T3.js";import"./CopyIcn.3gZpHton.js";function O({woodpeckerConf:e,setWoodpeckerConf:s,step:a,setStep:y,loading:r,setLoading:N,isInfo:o}){const[l,A]=j.useState(!1),[p,m]=j.useState({api_token:""}),{woodpecker:n}=f,v=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),e!=null&&e.default,y(2)},d=c=>{const u=b({},e),h=b({},p);h[c.target.name]="",u[c.target.name]=c.target.value,m(h),s(u)},I=`
            <h4>${i("Get API Key","bit-integrations")}</h4>
            <ul>
                <li>${i("Log into your Woodpecker account on","bit-integrations")} <a className="btcd-link" href="https://app.woodpecker.co/panel" target="_blank">${i("app.woodpecker.co.","bit-integrations")}</a></li>
                <li>${i("Go to the <b>Marketplace</b> → <b>INTEGRATIONS</b> → <b>API keys</b>.","bit-integrations")}</li>
                <li>${i("Use the purple button to <b>CREATE A KEY</b>.","bit-integrations")}</li>
            </ul>`;return t.jsxs("div",{className:"btcd-stp-page",style:{width:a===1&&900,height:a===1&&"auto"},children:[t.jsx(k,{title:"Woodpecker",youTubeLink:n==null?void 0:n.youTubeLink}),t.jsx(k,{title:"Woodpecker",docLink:n==null?void 0:n.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:d,name:"name",value:e.name,type:"text",placeholder:i("Integration Name...","bit-integrations"),disabled:o}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:i("API Key:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"api_key",value:e.api_key,type:"text",placeholder:i("API Key...","bit-integrations"),disabled:o}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:p.api_key}),t.jsxs("small",{className:"d-blk mt-3",children:[i("To get API key, please visit","bit-integrations")," ",t.jsx("a",{className:"btcd-link",href:"https://app.woodpecker.co/panel?u=411340#marketplace/integrations/api-keys",target:"_blank",children:i("Woodpecker API Key","bit-integrations")})]}),t.jsx("br",{}),t.jsx("br",{}),!o&&t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>P(e,m,A,r,N),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:l||r.auth,children:[l?i("Authorized ✔","bit-integrations"):i("Authorize","bit-integrations"),r.auth&&t.jsx(z,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:v,className:"btn ml-auto btcd-btn-lg purple sh-sm flx",type:"button",disabled:!l,children:[i("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),t.jsx(L,{note:I})]})}export{O as default};
