import{_ as N}from"./EmptyStateBlock-Dt7jmbAi.js";import{f as O,i as d}from"./common-U_VzDrmL.js";import{_ as k}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{d as P,o as r,c as a,a as s,t as m,B as j,i as D,F as h,h as S,G as A,b as f,w as E,f as L,n as w,r as V,g as b,x as F,m as G}from"./index-Bb2UEb_P.js";import{_ as q}from"./ClausesKeeper-CyJ_9bTp.js";import{_ as z}from"./BlockBalanceAgreement-396E9Da8.js";import{u as K}from"./hosting-DD69tSAn.js";import{u as M}from"./server-KemHlIfj.js";import"./HtmlContent-DrkJBX3e.js";import"./IconCloseCircle-ctElXVvc.js";import"./clauses-Bhz_DuFa.js";import"./index-Dax_IkAt.js";import"./ButtonDefault-CzWpVlv6.js";const R={class:"hosting-order-item__wrapper"},T={class:"hosting-order-item__header"},J={class:"hosting-order-item__name"},Q={key:0,class:"hosting-order-item__price"},U={class:"hosting-order-item__content"},W={class:"hosting-order-item__row"},X={class:"hosting-order-item__list"},Y={class:"hosting-order-item__row"},Z={class:"hosting-order-item__note"},ee={__name:"HostingOrderItem",props:{data:{type:Object,default:()=>{}}},setup(n){return(p,_)=>{const c=P("router-link");return r(),a("div",{class:w(["hosting-order-item",{"hosting-order-item--special":n.data?.note}])},[s("div",R,[s("div",T,[s("div",J,m(n.data?.name),1),n.data?.price?(r(),a("div",Q,m(j(O)(n.data?.price))+" в месяц ",1)):D("",!0)]),s("div",U,[s("div",W,[s("ul",X,[(r(!0),a(h,null,S(n.data?.specifications,l=>(r(),a("li",{key:l},m(l),1))),128))])]),n.data?.note?A(p.$slots,"default",{key:0},()=>[s("div",Y,[s("div",Z,m(n.data?.note),1)])],!0):D("",!0),f(c,{class:"btn btn--wide btn--border btn--wide",to:`/HostingSchemes/${n.data?.ID}`},{default:E(()=>_[0]||(_[0]=[L(" Заказать ",-1)])),_:1,__:[0]},8,["to"])])])],2)}}},te=k(ee,[["__scopeId","data-v-0fb48d5a"]]),se={class:"tw-px-4 md:tw-px-8 tw-mb-6"},re={class:"section-nav"},oe=["data-title","onClick"],ne={class:"section-text section-text--margin"},ae={key:0,class:"list"},ie={__name:"HostingSchemes",async setup(n){let p,_;const c=K(),l=M(),u=V(0),g=b(()=>{let e=[];return c.hostingSchemes&&(Object.keys(c.hostingSchemes).forEach(t=>{c.hostingSchemes[t]?.ServersGroupID==u.value&&e.push(c.hostingSchemes[t])}),e=e.filter(t=>t.IsActive),e.sort((t,o)=>t.SortID-o.SortID)),e});function x(e){u.value=e}function C(e){return{ID:e?.ID,name:e?.Name,price:e?.CostMonth,specifications:[d(e?.SchemeParams?.limit_webdomains),d(e?.SchemeParams?.limit_quota),d(e?.SchemeParams?.limit_emails),d(e?.SchemeParams?.disklimit),d(e?.SchemeParams?.maillimit)],note:e?.Comment}}const y=b(()=>l?.serverGroupsList?.Servers);function I(){let e={};return Object.values(y.value).forEach(t=>{if(t.ServiceID==1e4){const o=t.ServersGroupID;e[o]||(e[o]={SortID:t.SortID,ServersGroupID:o,servers:[]}),e[o].servers.push(t)}}),Object.values(e).sort((t,o)=>t.SortID-o.SortID)}function v(e){return l?.serverGroupsList?.ServersGroups?.[e]}return[p,_]=F(()=>c.fetchHostingSchemes()),await p,_(),u.value=I()?.[0]?.ServersGroupID,(e,t)=>{const o=z,$=q,B=te,H=N;return r(),a(h,null,[f(o),s("div",se,[t[0]||(t[0]=s("h1",{class:"tw-text-xl sm:tw-text-4xl tw-mb-4"},"Заказать хостинг",-1)),f($),s("div",re,[(r(!0),a(h,null,S(I(),i=>(r(),a("div",{key:i?.ServersGroupID,class:w([{active:String(u.value)===String(i?.ServersGroupID)},"section-nav__item"]),"data-title":v(i?.ServersGroupID)?.Comment,onClick:ce=>x(i?.ServersGroupID)},m(v(i?.ServersGroupID)?.Name),11,oe))),128))]),s("div",ne,m(v(u.value)?.Comment),1),g.value?(r(),a("div",ae,[(r(!0),a(h,null,S(g.value,i=>(r(),G(B,{key:i?.ID,data:C(i)},null,8,["data"]))),128))])):(r(),G(H,{key:1,label:"Нет доступных тарифов"}))])],64)}}},be=k(ie,[["__scopeId","data-v-6e55ba77"]]);export{be as default};
