import{_ as B}from"./LoadingIndicator-BUC-Eplr.js";import{_ as $}from"./EmptyStateBlock-Dt7jmbAi.js";import{_ as N,a as A}from"./BlockDependentServices-DgyaIf9K.js";import{_ as C}from"./ClausesKeeper-CyJ_9bTp.js";import{_ as L}from"./BlockBalanceAgreement-396E9Da8.js";import{J as j,u as R,r as V,g as d,x as E,o as n,c as w,b as s,a as i,F as D,t as F,w as f,m as O,A as G,d as P,j as U,f as b}from"./index-Bb2UEb_P.js";import{u as J}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 K={class:"tw-px-4 md:tw-px-8 tw-mb-6"},T={class:"tw-text-gray-500 tw-text-sm tw-mt-2"},q={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"},le={__name:"DSServices",async setup(z){let u,p;const I=U(),a=j(),x=J(),o=R();G("emitter").on("updateDSIDPage",()=>{o.fetchUserOrders()});const _=V(!0),e=d(()=>Object.values(a.dsOrders).find(c=>c.OrderID===Number(I.params.id))),v=d(()=>a.DSSchemes[e.value.SchemeID]),k=d(()=>{if(!e.value?.OrderID||!o?.userOrders)return[];const c=e.value.OrderID;return Object.keys(o.userOrders).map(t=>o.userOrders[t]).filter(t=>t.DependOrderID==c&&t.ServiceID&&x.ServicesList[t.ServiceID]).sort((t,l)=>Number(t?.ID)-Number(l?.ID))});return[u,p]=E(()=>Promise.all([a.fetchDSOrders(),a.fetchDSSchemes(),o.fetchUserOrders()])),await u,p(),_.value=!1,(c,r)=>{const S=L,m=P("RouterLink"),t=C,l=N,y=A,h=$,g=B;return n(),w(D,null,[s(S,{"contract-id":e.value?.ContractID},null,8,["contract-id"]),i("div",K,[e.value&&v.value?(n(),w(D,{key:0},[r[2]||(r[2]=i("h1",{class:"tw-text-xl sm:tw-text-4xl"},"Дополнительные услуги",-1)),i("div",T," Выделенный сервер # "+F(e.value.OrderID),1),i("div",q,[s(m,{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:`/DSOrders/${e.value.OrderID}`},{default:f(()=>r[0]||(r[0]=[b(" Сервер ",-1)])),_:1,__:[0]},8,["to"]),s(m,{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:`/DSOrders/${e.value.OrderID}/Services`},{default:f(()=>r[1]||(r[1]=[b(" Услуги ",-1)])),_:1,__:[1]},8,["to"])]),s(t),s(l,{services:k.value},null,8,["services"]),s(y,{"order-id":e.value.OrderID,"service-search-params":{ServiceID:e.value.ServiceID,ServersGroupID:v.value.ServersGroupID},class:"tw-mt-8"},null,8,["order-id","service-search-params"])],64)):_.value?(n(),O(g,{key:2,class:"tw-mt-10"})):(n(),O(h,{key:1,label:"Заказ не найден"}))])],64)}}};export{le as default};
