import{j as t,_ as i,s as y,d as k}from"./main.2.8.1.js";import{d as r}from"./react-router-dom.9mCuUg3q.js";import{B as v}from"./BackIcn._kGL_vVw.js";import{z as L,y as w}from"./Note.BeM7sN-p.js";import{g as z}from"./RestrictContentCommonFunc.CEEFyJFV.js";import{T as u}from"./TutorialLink.BAFX--T3.js";import{t as C}from"./tutorialLinks.kMkIDzcD.js";import"./CopyIcn.3gZpHton.js";function D({formID:I,restrictConf:a,setRestrictConf:c,step:l,setStep:h,setSnackbar:p}){const[n,g]=r.useState(!1),[m,o]=r.useState(!1),[b,x]=r.useState(!1),{restrictContent:e}=C,f=()=>{o("auth"),k({},"restrict_authorize").then(s=>{s!=null&&s.success&&(g(!0),p({show:!0,msg:i("Connected with Restrict Content Successfully","bit-integrations")})),o(!1),x(!0)})},j=s=>{const d=w(a);d[s.target.name]=s.target.value,c(d)},N=()=>{z(a,c,o),h(2)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:l===1&&900,height:l===1&&"auto"},children:[t.jsx(u,{title:"Restrict Content",youTubeLink:e==null?void 0:e.youTubeLink}),t.jsx(u,{title:"Restrict Content",docLink:e==null?void 0:e.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:j,name:"name",value:a.name,type:"text",placeholder:i("Integration Name...","bit-integrations")}),m==="auth"&&t.jsxs("div",{className:"flx mt-5",children:[t.jsx(L,{size:25,clr:"#022217",className:"mr-2"}),"Checking if restrict content is active!!!"]}),b&&!n&&!m&&t.jsxs("div",{className:"flx mt-5",style:{color:"red"},children:[t.jsx("span",{className:"btcd-icn mr-2",style:{fontSize:30,marginTop:-5},children:"×"}),y(i("%s plugin must be activated to integrate with Bit Integrations","bit-integrations"),"RestrictContent")]}),!n&&t.jsx("button",{onClick:f,className:"btn btcd-btn-lg purple sh-sm flx mt-5",type:"button",children:i("Connect","bit-integrations")}),n&&t.jsxs("button",{onClick:()=>N(),className:"btn btcd-btn-lg purple sh-sm flx mt-5",type:"button",disabled:!n,children:[i("Next","bit-integrations"),t.jsx(v,{className:"ml-1 rev-icn"})]})]})}export{D as default};
