var $=Object.defineProperty;var y=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable;var j=(n,e,a)=>e in n?$(n,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[e]=a,c=(n,e)=>{for(var a in e||(e={}))w.call(e,a)&&j(n,a,e[a]);if(y)for(var a of y(e))P.call(e,a)&&j(n,a,e[a]);return n};import{_ as i,j as t}from"./main.2.9.0.js";import{b as A}from"./react-router.DMwpH23k.js";import{y as D,a9 as T}from"./Note.NSUdvR3c.js";import{d as z,g as E}from"./FreshdeskCommonFunc.Cmq8WzI3.js";import{T as I}from"./TutorialLink.CFG7bS5c.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.CEA_lFLo.js";function V({formID:n,freshdeskConf:e,setFreshdeskConf:a,step:d,setstep:k,isLoading:m,setIsLoading:h,setSnackbar:b,redirectLocation:S,isInfo:s}){const[r,N]=A.useState(!1),[o,g]=A.useState({api_key:""}),v=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),E(e,a,h,b),k(2)},l=p=>{const u=c({},e),x=c({},o);x[p.target.name]="",u[p.target.name]=p.target.value,g(x),a(u)},_=`
            <h4>${i("Locate Your App Domain","bit-integrations")}</h4>
            <ul>
                <li>${i("Access your Freshdesk account.","bit-integrations")}</li>
                <li>${i("Copy the URL displayed in your browser’s address bar","bit-integrations")} (e.g., https://domain.freshdesk.com/)</li>
                <li>${i("Paste the copied App Domain into the designated “App Domain” field within the integrations you’re setting up.","bit-integrations")}</li>
            </ul>
            <h4>${i("Retrieve Your App API Key","bit-integrations")}</h4>
            <ul>
                <li>${i("Within your Freshdesk account, click on your profile icon, situated in the top right corner.","bit-integrations")}</li>
                <li>${i("Select “Profile Settings” from the options that appear.","bit-integrations")}</li>
                <li>${i("Locate your App API key, prominently displayed on the top right side of the Profile Settings page.","bit-integrations")}</li>
                <li>${i("Copy this key.","bit-integrations")}</li>
                <li>${i("Paste the copied App API key into the designated “App API key” field within the integrations you’re configuring.","bit-integrations")}</li>
            </ul>`;return t.jsxs("div",{className:"btcd-stp-page",style:{width:d===1&&900,height:d===1&&"auto"},children:[t.jsx(I,{linkKey:"freshdesk"}),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:l,name:"name",value:e.name,type:"text",placeholder:i("Integration Name...","bit-integrations"),disabled:s}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:i("Your App Domain:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:l,name:"app_domain",value:e.app_domain,type:"text",placeholder:i("App Domain...","bit-integrations"),disabled:s}),t.jsx("small",{className:"d-blk mt-2",children:`${i("App Domain Example","bit-integrations")}: https://domain.freshdesk.com`}),t.jsx("div",{style:{color:"red"},children:o.app_domain}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:i("App api key:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:l,name:"api_key",value:e.api_key,type:"text",placeholder:i("Access Token...","bit-integrations"),disabled:s}),t.jsxs("small",{className:"d-blk mt-2",children:[i("To get access Token , Please Visit","bit-integrations")," ",t.jsx("a",{className:"btcd-link",href:`${(e==null?void 0:e.app_domain)||"https://domain.freshdesk.com"}/a/profiles/72009210017/edit`,target:"_blank",rel:"noreferrer",children:i("FreshDesk Console","bit-integrations")})]}),t.jsx("div",{style:{color:"red"},children:o.api_key}),!s&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:()=>z(e,a,g,N,h,b),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:r||m,children:[r?i("Authorized ✔","bit-integrations"):i("Authorize","bit-integrations"),m&&t.jsx(D,{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:!r,children:[i("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),t.jsx(T,{note:_})]})}export{V as default};
