import{_ as f,b as d,a1 as b,c as n,a as e,q as x,t as m,j as y,d as _,w as g,N as k,x as p,o as r,X as w,W as C}from"./app-583c7dce.js";const N={class:"container pb-5 my-5 installer-container"},V={class:"card col-12 col-lg-7 mt-5 mb-4 d-block mx-auto"},B={class:"card-body shadow"},P={class:"mt-5 fw-bolder mb-3"},q={key:0,class:"text-danger"},S={class:"d-flex justify-content-center gap-3"},D=["disabled"],E={__name:"Purchasecode",setup(R){const c=d({purchase_code:""}),o=d({}),s=d(!1),i=b(),v=()=>{delete axios.defaults.headers.common["X-Requested-With"],delete axios.defaults.headers.common["X-CSRF-TOKEN"],s.value=!0,axios.post(w("api/purchase-code/check"),c.value).then(t=>{(t==null?void 0:t.data.message)==="success"&&(s.value=!0,axios.get(t==null?void 0:t.data.url).then(a=>{var l;((l=a==null?void 0:a.data)==null?void 0:l.message)==="verified"&&(i.success("Purchase code verified successfully"),C.push({name:"environmentSetup",query:{purchase_code:c.value.purchase_code}}))}).catch(({response:a})=>{var l,u;(a==null?void 0:a.status)===422?o.value=(l=a==null?void 0:a.data)==null?void 0:l.errors:i.error((u=a==null?void 0:a.data)==null?void 0:u.message)}).finally(()=>s.value=!1)),o.value={}}).catch(({response:t})=>{(t==null?void 0:t.status)===422&&(o.value=t.data.errors),s.value=!1})};return(t,a)=>{const l=p("app-input"),u=p("app-button-loader");return r(),n("div",N,[a[4]||(a[4]=e("div",{class:"overflow-auto custom-scrollbar text-center"},[e("ul",{class:"multi-steps text-nowrap p-0"},[e("li",null,"Server Requirement"),e("li",{class:"is-active"},"Purchase Code"),e("li",null,"Database Configure"),e("li",null,"Admin Information"),e("li",null,"Company information"),e("li",null,"Email setup")])],-1)),e("div",V,[e("div",B,[e("h4",P,[x(m(t.$t("purchase_code"))+" ",1),a[1]||(a[1]=e("span",{class:"text-danger"},"*",-1))]),y(l,{type:"text",id:"purchases_code",placeholder:t.$t("purchase_code"),modelValue:c.value.purchase_code,"onUpdate:modelValue":a[0]||(a[0]=h=>c.value.purchase_code=h),errors:t.$errors(o.value,"purchase_code")},null,8,["placeholder","modelValue","errors"]),o.value.purchase_key?(r(),n("small",q,m(o.value.purchase_key[0]),1)):_("",!0)]),e("div",S,[a[3]||(a[3]=e("a",{href:"/installation",class:"btn btn-secondary btn-sm py-3 px-5 text-center text-white mb-5"},[e("span",null,"Go Back")],-1)),e("button",{type:"button",class:"btn btn-primary btn-sm py-3 px-5 text-center installer_btn mb-5",disabled:s.value,onClick:g(v,["prevent"])},[s.value?(r(),k(u,{key:0})):_("",!0),a[2]||(a[2]=e("span",null,"Next",-1))],8,D)])])])}}},X=f(E,[["__scopeId","data-v-7740c043"]]);export{X as default};
