import{_ as B}from"./LoadingIndicator-BUC-Eplr.js";import{_ as $}from"./EmptyStateBlock-Dt7jmbAi.js";import{_ as H,a as L}from"./BlockDependentServices-DgyaIf9K.js";import{_ as N}from"./ClausesKeeper-CyJ_9bTp.js";import{_ as C}from"./BlockBalanceAgreement-396E9Da8.js";import{u as A,r as j,g as p,x as R,o as i,c as g,b as s,a as m,F as D,t as V,w as I,m as b,d as E,j as F,f as O}from"./index-Bb2UEb_P.js";import{u as G}from"./hosting-DD69tSAn.js";import{u as K}from"./services-DEZoSah0.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./BlueButton.vue_vue_type_script_setup_true_lang-CY8chwQm.js";import"./common-U_VzDrmL.js";import"./StatusBadge-74LYchi-.js";import"./HtmlContent-DrkJBX3e.js";import"./IconCloseCircle-ctElXVvc.js";import"./clauses-Bhz_DuFa.js";import"./index-Dax_IkAt.js";import"./ButtonDefault-CzWpVlv6.js";const P={class:"tw-px-4 md:tw-px-8 tw-mb-6"},T={class:"tw-text-gray-500 tw-text-sm tw-mt-2"},U={class:"tw-flex tw-items-center tw-gap-8 tw-border-b tw-border-gray-200 tw-mt-4 tw-whitespace-nowrap tw-mb-6"},me={__name:"HostingServices",async setup(q){let _,v;const x=F(),n=G(),h=K(),a=A(),w=j(!0),e=p(()=>Object.values(n.hostingList).find(c=>c.OrderID===Number(x.params.id))),S=p(()=>n.hostingSchemes[e.value.SchemeID]),k=p(()=>{if(!e.value?.OrderID||!a?.userOrders)return[];const c=e.value.OrderID;return Object.keys(a.userOrders).map(t=>a.userOrders[t]).filter(t=>{const o=String(t?.DependOrderID)===String(c),u=t?.ServiceID,d=h.ServicesList[t.ServiceID];return o&&u&&d}).sort((t,o)=>Number(t?.ID)-Number(o?.ID))});return[_,v]=R(()=>Promise.all([n.fetchHostingOrders(),n.fetchHostingSchemes(),a.fetchUserOrders()])),await _,v(),w.value=!1,(c,r)=>{const f=C,l=E("RouterLink"),t=N,o=H,u=L,d=$,y=B;return i(),g(D,null,[s(f,{"contract-id":e.value?.ContractID},null,8,["contract-id"]),m("div",P,[e.value&&S.value?(i(),g(D,{key:0},[r[2]||(r[2]=m("h1",{class:"tw-text-xl sm:tw-text-4xl"},"Дополнительные услуги",-1)),m("div",T,"Хостинг # "+V(e.value.OrderID),1),m("div",U,[s(l,{class:"tw-py-2 tw-cursor-pointer -tw-mb-[1px]","active-class":"tw-text-sky-400 tw-border-b-2 tw-border-sky-400",to:`/HostingOrders/${e.value.OrderID}`},{default:I(()=>r[0]||(r[0]=[O(" Хостинг ",-1)])),_:1,__:[0]},8,["to"]),s(l,{class:"tw-py-2 tw-cursor-pointer -tw-mb-[1px]","active-class":"tw-text-sky-400 tw-border-b-2 tw-border-sky-400",to:`/HostingOrders/${e.value.OrderID}/Services`},{default:I(()=>r[1]||(r[1]=[O(" Услуги ",-1)])),_:1,__:[1]},8,["to"])]),s(t),s(o,{services:k.value},null,8,["services"]),s(u,{"order-id":e.value.OrderID,"service-search-params":{ServiceID:e.value.ServiceID,ServersGroupID:S.value.ServersGroupID},class:"tw-mt-8"},null,8,["order-id","service-search-params"])],64)):w.value?(i(),b(y,{key:2,class:"tw-mt-10"})):(i(),b(d,{key:1,label:"Заказ не найден"}))])],64)}}};export{me as default};
