import{_ as K}from"./EmptyStateBlock-Dt7jmbAi.js";import{_ as U}from"./InfoCard.vue_vue_type_script_setup_true_lang-CWF_aA31.js";import{I as W}from"./IconProfile-DRzOpH_Z.js";import{_ as M}from"./WhiteButton.vue_vue_type_script_setup_true_lang-DlfUhvlb.js";import{_ as q}from"./InputToggle.vue_vue_type_script_setup_true_lang-wuxKjsmu.js";import{_ as z}from"./BlueButton.vue_vue_type_script_setup_true_lang-CY8chwQm.js";import{_ as G}from"./HtmlContent-DrkJBX3e.js";import{_ as J}from"./StatusBadge-74LYchi-.js";import{_ as Q}from"./ClausesKeeper-CyJ_9bTp.js";import{_ as X}from"./BlockBalanceAgreement-396E9Da8.js";import{r as C,x as Y,g,v as Z,l as tt,o as r,c as l,b as o,a,F as c,t as i,f as u,w as m,B as et,i as f,m as $,d as ot,j as st,e as at,A as rt,h as nt}from"./index-Bb2UEb_P.js";import{u as lt}from"./orders-B7i92Ara.js";import{u as it}from"./services-DEZoSah0.js";import{b as ut}from"./common-U_VzDrmL.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./IconCloseCircle-ctElXVvc.js";import"./clauses-Bhz_DuFa.js";import"./index-Dax_IkAt.js";import"./ButtonDefault-CzWpVlv6.js";const mt={class:"tw-px-4 md:tw-px-8"},dt={class:"tw-text-2xl sm:tw-text-4xl"},ct={class:"tw-text-gray-500 tw-text-sm tw-mt-2"},_t={class:"tw-grid tw-grid-cols-1 xl:tw-grid-cols-2 tw-gap-4 tw-mt-4"},pt={key:0,class:"tw-grid tw-grid-cols-3 tw-gap-4"},vt={class:"tw-font-bold"},ft={class:"tw-flex tw-gap-4 tw-mt-4"},wt={class:"tw-flex tw-flex-wrap tw-gap-4 tw-mt-4"},Tt={__name:"ExtraIPOrdersId",async setup(gt){let I,x;const D=st(),B=at(),w=it(),_=lt(),n=C(!1),S=C(!0),k=rt("emitter");[I,x]=Y(()=>_.fetchAllOrders()),await I,x();const t=g(()=>_.orders[D.params.id]),y=g(()=>_.orders[t.value?.DependOrderID]),p=g(()=>w.ServicesList[t.value?.ServiceID]);Z(t,()=>{t.value&&(n.value=t.value.IsAutoProlong)},{immediate:!0});function P(v,e){let d="";e==="Default"?d="Orders":d=e+"Orders",k.emit("open-modal",{component:"StatusHistory",data:{modeID:d,rowID:v}})}function A(){k.emit("open-modal",{component:"OrdersTransfer",data:{ServiceOrderID:t.value?.ID,ServiceID:t.value?.ServiceID}})}function b(){B.push(`/ExtraIPOrderPay/${D.params.id}`)}async function R(){let{result:v}=await _.autoProlong(n.value,t.value.OrderID);v==="ERROR"&&(n.value=!n.value)}return tt(async()=>{await w.fetchAdditionalServiceScheme(t.value?.Code),await w.fetchExtraIPOrders(),S.value=!1}),(v,e)=>{const d=X,V=ot("RouterLink"),N=Q,h=J,E=G,L=z,T=q,O=M,F=W,H=U,j=K;return r(),l(c,null,[o(d,{"contract-id":t.value?.ContractID},null,8,["contract-id"]),a("div",mt,[t.value?(r(),l(c,{key:0},[a("div",null,[a("h1",dt,i(p.value?.Name),1),a("div",ct,[y.value?(r(),l(c,{key:0},[e[5]||(e[5]=u(" Относится к заказу ",-1)),o(V,{to:et(ut)(y.value.Code,t.value.DependOrderID),class:"tw-text-sky-500"},{default:m(()=>[u(" #"+i(t.value.DependOrderID),1)]),_:1},8,["to"]),e[6]||(e[6]=u(" / ",-1))],64)):f("",!0),u(" "+i(p.value.Name)+" #"+i(t.value.ID),1)])]),o(N),a("div",_t,[p.value&&t.value?(r(),$(H,{key:0,title:p.value.Name},{badge:m(()=>[o(h,{status:t.value.StatusID,"status-table":"Orders",class:"tw-cursor-pointer",onClick:e[0]||(e[0]=s=>P(t.value.ServiceOrderID,t.value?.Code))},null,8,["status"])]),body:m(()=>[t.value.AdditionalInfo?.length>0?(r(),l("div",pt,[(r(!0),l(c,null,nt(t.value.AdditionalInfo,s=>(r(),l(c,{key:s.Key},[a("div",vt,i(s.Key),1),o(E,{content:s.Value,class:"tw-col-span-2"},null,8,["content"])],64))),128))])):f("",!0),a("div",ft,[o(L,{class:"tw-w-30 sm:tw-w-40",onClick:e[1]||(e[1]=s=>b())},{default:m(()=>[u(i(t.value.StatusID==="ClaimForRegister"||t.value.StatusID==="Waiting"?"Оплатить":"Продлить"),1)]),_:1}),o(O,null,{default:m(()=>[e[7]||(e[7]=a("div",null,"Автопродление",-1)),o(T,{modelValue:n.value,"onUpdate:modelValue":e[2]||(e[2]=s=>n.value=s),onChange:e[3]||(e[3]=s=>R())},null,8,["modelValue"])]),_:1,__:[7]})]),a("div",wt,[o(O,{onClick:e[4]||(e[4]=s=>A())},{default:m(()=>[o(F),e[8]||(e[8]=u(" Передать на другой аккаунт ",-1))]),_:1,__:[8]})])]),_:1},8,["title"])):f("",!0)])],64)):S.value?f("",!0):(r(),$(j,{key:1,label:"Заказ не найден"}))])],64)}}};export{Tt as default};
