var T=Object.defineProperty;var g=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var j=(i,a,n)=>a in i?T(i,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[a]=n,d=(i,a)=>{for(var n in a||(a={}))w.call(a,n)&&j(i,n,a[n]);if(g)for(var n of g(a))I.call(a,n)&&j(i,n,a[n]);return i};import{j as t,_ as e}from"./main.2.9.0.js";import{b as k}from"./react-router.DMwpH23k.js";import{y as E,a9 as P}from"./Note.NSUdvR3c.js";import{T as z,t as $}from"./TutorialLink.CFG7bS5c.js";import{z as f}from"./ZendeskSupportCommonFunc.CsKw2ZlJ.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.CEA_lFLo.js";function Y({zendeskSupportConf:i,setZendeskSupportConf:a,step:n,setStep:N,loading:l,setLoading:A,isInfo:s}){var h,p;const[c,v]=k.useState(!1),[r,m]=k.useState({subdomain:"",email:"",apiToken:""}),y=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),N(2)},o=b=>{const u=d({},i),x=d({},r);x[b.target.name]="",u[b.target.name]=b.target.value,m(x),a(u)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:n===1&&900,height:n===1&&"auto"},children:[t.jsx(z,{title:"Zendesk Support",links:((h=$)==null?void 0:h.zendeskSupport)||{}}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:e("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:o,name:"name",value:i.name,type:"text",placeholder:e("Integration Name...","bit-integrations"),disabled:s}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:e("Subdomain:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:o,name:"subdomain",value:i.subdomain,type:"text",placeholder:e("your-subdomain","bit-integrations"),disabled:s}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:r.subdomain}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:e("Email:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:o,name:"email",value:i.email,type:"text",placeholder:e("agent@example.com","bit-integrations"),disabled:s}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:r.email}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:e("API Token:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:o,name:"apiToken",value:i.apiToken,type:"text",placeholder:e("API Token...","bit-integrations"),disabled:s}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:r.apiToken}),t.jsxs("small",{className:"d-blk mt-3",children:[e("Enable token access and create a token at","bit-integrations")," ",t.jsx("a",{className:"btcd-link",href:`https://${(p=i==null?void 0:i.subdomain)!=null?p:"#"}.zendesk.com/admin/apps-integrations/apis/api-tokens`,target:"_blank",rel:"noreferrer",children:e("Zendesk API Settings","bit-integrations")})]}),t.jsx("br",{}),t.jsx("br",{}),!s&&t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>f(i,a,m,v,l,A),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:c||l.auth,children:[c?e("Authorized ✔","bit-integrations"):e("Authorize","bit-integrations"),l.auth&&t.jsx(E,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:y,className:"btn ml-auto btcd-btn-lg purple sh-sm flx",type:"button",disabled:!c,children:[e("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),t.jsx(P,{note:Z})]})}const Z=`
    <h4>${e("How to connect Zendesk Support:","bit-integrations")}</h4>
    <ul>
      <li>${e("Your <b>Subdomain</b> is the part before <b>.zendesk.com</b> in your account URL. Example: for <b>https://acme.zendesk.com</b> the subdomain is <b>acme</b>.","bit-integrations")}</li>
      <li>${e("Use the <b>Email</b> of an agent/admin account that has API access.","bit-integrations")}</li>
      <li>${e("In Zendesk, go to <b>Admin Center → Apps and integrations → APIs → Zendesk API</b> and enable <b>Token access</b>, then click <b>Add API token</b>.","bit-integrations")}</li>
      <li>${e("Copy the generated token and paste it into the <b>API Token</b> field below.","bit-integrations")}</li>
      <li>${e("Finally, click the <b>Authorize</b> button.","bit-integrations")}</li>
    </ul>
  `;export{Y as default};
