import{_ as U}from"./BlueButton.vue_vue_type_script_setup_true_lang-CY8chwQm.js";import{_ as A}from"./TotalAmount.vue_vue_type_script_setup_true_lang-BCu2SNOJ.js";import{_ as L}from"./BlockOrderPay-BP1936HA.js";import{_ as T}from"./InputSelectService-CZ0-qM8M.js";import{_ as E}from"./InputSelectContract.vue_vue_type_script_setup_true_lang-Dll1Hpi-.js";import{_ as F}from"./ClausesKeeper-CyJ_9bTp.js";import{_ as H}from"./TabsAdditionalServices-Q4t33JY-.js";import{_ as K}from"./BlockBalanceAgreement-396E9Da8.js";import{r as u,g as d,x as R,o as p,c as D,b as r,a,t as x,f as y,B as j,m as N,i as v,w as q,F as z,e as G}from"./index-Bb2UEb_P.js";import{u as J}from"./index-Dax_IkAt.js";import{u as M}from"./services-DEZoSah0.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./common-U_VzDrmL.js";import"./bootstrap-vue-next-C0pyDr3k.js";import"./component-C-Q4t0gB.js";import"./global-BK91p1BE.js";import"./IconHelp-wlsb2dRe.js";import"./IconCross-Cfk4fnHT.js";import"./BasicInput-BG-lQkv5.js";import"./InputSelect.vue_vue_type_script_setup_true_lang-DDGr1dhD.js";import"./IconChevronDown-NfcUpI8U.js";import"./HtmlContent-DrkJBX3e.js";import"./IconCloseCircle-ctElXVvc.js";import"./clauses-Bhz_DuFa.js";import"./server-KemHlIfj.js";import"./multiselect-Bk-p1X5E.js";import"./ButtonDefault-CzWpVlv6.js";const Q={class:"tw-px-4 md:tw-px-8"},W={key:0,class:"tw-mt-4 tw-mb-6"},X={class:"tw-text-xl sm:tw-text-4xl"},Y={class:"tw-flex tw-flex-col md:tw-flex-row md:tw-items-center tw-gap-4 tw-mt-4"},Z={class:"tw-w-full"},ee={class:"tw-my-6"},Ie={__name:"DNSmanagerSchemes",async setup(te){let f,w;const S=G(),n=M(),B=J(),l=u(!1),c=u(null),t=u(null),m=u(),_=d(()=>n.ServicesList[52e3]),i=d(()=>B.contractsList[c.value]),h=d(()=>i.value?.Balance>=t.value?.CostPay?"Оплатить с баланса договора":"Добавить в корзину");async function V(){l.value=!0;const{result:g,info:e}=await n.DNSmanagerOrder({DNSmanagerSchemeID:m.value.ID,ContractID:c.value,ServiceID:52e3});if(g==="SUCCESS")try{const o=await n.DNSmanagerOrderPay({DNSmanagerOrderID:e.DNSmanagerOrderID,DaysPay:t.value?.actualDays});o==="UseBasket"?S.push("/Basket"):o==="NoBasket"?S.push("/DNSmanagerOrders"):console.error("Ошибка оплаты заказа")}catch(o){console.error("DNSmanagerOrderPay error:",o),l.value=!1}l.value=!1}return[f,w]=R(()=>n.fetchDNSmanagerSchemes()),await f,w(),(g,e)=>{const o=K,k=H,C=F,I=E,O=T,b=L,$=A,P=U;return p(),D(z,null,[r(o,{"contract-id":i.value?.ID},null,8,["contract-id"]),a("div",Q,[r(k),_.value?(p(),D("div",W,[a("h1",X,x(_.value.Name),1),r(C,{partition:"Header:/DNSmanagerOrders",class:"tw-mt-4"}),a("div",Y,[e[4]||(e[4]=a("div",{class:"tw-flex-none tw-w-64"},[y(" Выбрать договор "),a("span",{class:"tw-text-red-500 tw-ml-1"},"*")],-1)),a("div",Z,[r(I,{modelValue:c.value,"onUpdate:modelValue":e[0]||(e[0]=s=>c.value=s)},null,8,["modelValue"])])]),r(O,{modelValue:m.value,"onUpdate:modelValue":e[1]||(e[1]=s=>m.value=s),schemes:j(n).DNSmanagerSchemes,service:_.value},null,8,["modelValue","schemes","service"]),i.value?(p(),N(b,{key:0,modelValue:t.value,"onUpdate:modelValue":e[2]||(e[2]=s=>t.value=s),contract:i.value,scheme:m.value,"service-id":52e3},null,8,["modelValue","contract","scheme"])):v("",!0),a("div",ee,[t.value?(p(),N($,{key:0,tariff:t.value},null,8,["tariff"])):v("",!0),r(P,{disabled:t.value===null||t.value?.price===null,loading:l.value,class:"tw-w-full",onClick:e[3]||(e[3]=s=>V())},{default:q(()=>[y(x(h.value),1)]),_:1},8,["disabled","loading"])])])):v("",!0)])],64)}}};export{Ie as default};
