import{_ as U}from"./StatusBadge-CjHHKSUG.js";import{_ as E,a as F}from"./CardButton-D2yx9NRX.js";import{_ as q}from"./ServerStatusBadge.vue_vue_type_script_setup_true_lang-Cxfq-4-V.js";import{r as A,Y as H,v as P,m as Y}from"./bootstrap-vue-next-DwS3lKQb.js";import{_ as z}from"./IconDots-hRD0_8ej.js";import{_ as G}from"./UserNote-8i0DdDDd.js";import{_ as J}from"./IconCard-_anr564X.js";import{d as K,x as Q,r as W,m as X,E as Z,c as p,o as D,a as o,b as s,w as a,j as d,e as x,h as ee,t as l,F as te,i as se,n as re}from"./index-CmCGXBst.js";import{f as I}from"./time-DenPiOX5.js";import{i as oe}from"./BlockBalanceAgreement-qtspRQ_B.js";import{_ as ne}from"./_plugin-vue_export-helper-DlAUqK2U.js";const ae={class:"btn btn--dots"},ie={class:"tw-flex tw-items-center tw-gap-4 tw-mt-10 xl:tw-mt-0"},de={class:"tw-flex tw-gap-2 tw-items-center"},le={class:"tw-flex"},ce={class:"tw-text-lg"},ue={class:"tw-text-sky-400 tw-mt-2"},me={class:"tw-flex tw-flex-col lg:tw-items-center lg:tw-flex-row lg:tw-justify-between"},we={class:"tw-flex tw-flex-wrap tw-gap-x-4 tw-gap-y-1 tw-mt-2 tw-text-sm tw-text-gray-500"},fe={class:"last:tw-font-bold"},ve={class:"tw-flex tw-items-center tw-gap-2 tw-mt-2 tw-text-nowrap"},pe={class:"hosting-status__date"},De={__name:"DSCard",props:{params:{type:Array,default:()=>[]},server:{type:Object,required:!0},isLast:{type:Boolean,default:!1},isSeveral:{type:Boolean,default:!1},selectedRows:{type:Object,required:!0}},emits:["delete","transfer","manage"],setup(t,{emit:S}){const i=t,_=S,O=K(),b=Q("emitter"),f=W({...i.selectedRows}),y=()=>{_("update-selected-rows",f.value)};X(()=>i.selectedRows,r=>{f.value={...r}},{deep:!0});function $(r){if(!r)return I(new Date);const e=new Date,v=new Date(e.getTime()+r*24*60*60*1e3);return I(v)}function k(r){oe()||O.push(`/DSOrders/${r}`)}function C(){_("delete",i.server.ID,i.server.OrderID)}function B(){_("transfer",{ServiceOrderID:i.server.ID,ServiceID:i.server.ServiceID})}function h(r){b.emit("open-modal",{component:"StatusHistory",data:{modeID:"DSOrders",rowID:r}})}function N(r){if(!r)return"";const e=new Date(parseInt(r)*1e3),g=new Date-e,c=Math.floor(g/1e3),u=Math.floor(c/60),m=Math.floor(u/60),w=Math.floor(m/24);return c<60?`${c} сек. от статуса`:u<60?`${u} мин. от статуса`:m<24?`${m} ч. от статуса`:`${w} дн. от статуса`}return(r,e)=>{const v=J,g=E,c=G,u=z,m=Z("router-link"),w=A,R=H,V=P,j=Y,M=q,T=F,L=U;return D(),p("div",{onClick:e[7]||(e[7]=n=>k(t.server.OrderID)),class:"tw-relative tw-p-4 tw-border tw-border-gray-200 tw-rounded tw-cursor-pointer hover:tw-bg-sky-100"},[o("div",{onClick:e[3]||(e[3]=d(()=>{},["stop"])),class:"tw-absolute tw-right-4 tw-top-4 tw-flex tw-items-center tw-gap-1"},[s(g,{onClick:e[0]||(e[0]=d(n=>r.$router.push(`/DSOrderPay/${t.server.OrderID}`),["stop"]))},{default:a(()=>[s(v),e[8]||(e[8]=o("div",null,"Оплатить",-1))]),_:1,__:[8]}),s(c,{text:t.server.UserNotice,"order-id":t.server.OrderID,emit:"updateDSOrdersList"},null,8,["text","order-id"]),s(V,{class:"dropdown-dots",right:""},{"button-content":a(()=>[o("span",ae,[s(u)])]),default:a(()=>[s(w,null,{default:a(()=>[s(m,{to:`DSOrders/${t.server.OrderID}`},{default:a(()=>e[9]||(e[9]=[x("Дополнительная информация",-1)])),_:1,__:[9]},8,["to"])]),_:1}),s(w,{onClick:e[1]||(e[1]=d(n=>B(),["stop"]))},{default:a(()=>e[10]||(e[10]=[x("Передать на другой аккаунт",-1)])),_:1,__:[10]}),s(R),s(w,{class:"color-red",onClick:e[2]||(e[2]=d(n=>C(),["stop"]))},{default:a(()=>e[11]||(e[11]=[x("Удалить",-1)])),_:1,__:[11]})]),_:1})]),o("div",ie,[t.isSeveral?(D(),p("div",{key:0,onClick:e[5]||(e[5]=d(()=>{},["stop"]))},[s(j,{id:"checkbox-"+t.server.OrderID,modelValue:f.value[t.server.OrderID],"onUpdate:modelValue":e[4]||(e[4]=n=>f.value[t.server.OrderID]=n),name:"checkbox-"+t.server.OrderID,onChange:y},null,8,["id","modelValue","name"])])):ee("",!0),o("div",de,[s(M,{indicators:t.server.Graphs?.Last},null,8,["indicators"]),s(T,{orderId:t.server.OrderID},null,8,["orderId"])]),o("div",le,[o("span",ce,l(t.server.IP),1)])]),o("div",ue,l(t.server.Customer),1),o("div",me,[o("div",we,[(D(!0),p(te,null,se(t.params,n=>(D(),p("div",fe,l(n),1))),256))]),o("div",ve,[o("span",{class:re(["hosting-item__date tw-pl-0",{danger:Number(t.server.DaysRemainded)<14}])},l($(t.server.DaysRemainded))+" • "+l(t.server.DaysRemainded||0)+" дн. ",3),s(L,{class:"status-badge tw-cursor-pointer",status:t.server.StatusID,"status-table":"DSOrders",onClick:e[6]||(e[6]=d(n=>h(t.server.ID),["stop"]))},null,8,["status"]),o("div",pe,l(N(t.server.StatusDate)),1)])])])}}},Be=ne(De,[["__scopeId","data-v-d09fb2ea"]]);export{Be as _};
