import{_ as N}from"./BlueButton.vue_vue_type_script_setup_true_lang-CY8chwQm.js";import{_ as $}from"./TotalAmount.vue_vue_type_script_setup_true_lang-BCu2SNOJ.js";import{_ as U}from"./BlockOrderPay-BP1936HA.js";import{_ as A}from"./InputSelectService-CZ0-qM8M.js";import{_ as L}from"./InputSelectContract.vue_vue_type_script_setup_true_lang-Dll1Hpi-.js";import{_ as T}from"./ClausesKeeper-CyJ_9bTp.js";import{_ as F}from"./TabsAdditionalServices-Q4t33JY-.js";import{_ as H}from"./BlockBalanceAgreement-396E9Da8.js";import{r as u,g as p,x as K,o as d,c as R,b as r,a as o,t as I,f as S,B as j,m as y,i as P,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={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"},ke={__name:"ExtraIPSchemes",async setup(te){let _,v;const f=G(),n=M(),B=J(),c=u(!1),m=u(null),t=u(null),l=u(),w=p(()=>n.ServicesList[5e4]),i=p(()=>B.contractsList[m.value]),D=p(()=>i.value?.Balance>=t.value?.CostPay?"Оплатить с баланса договора":"Добавить в корзину");async function h(){c.value=!0;const{result:x,info:e}=await n.ExtraIPOrder({ExtraIPSchemeID:l.value.ID,ContractID:m.value,ServiceID:5e4,DependOrderID:l.value.DependOrderID});if(x==="SUCCESS")try{const a=await n.ExtraIPOrderPay({ExtraIPOrderID:e.ExtraIPOrderID,DaysPay:t.value?.actualDays});a==="UseBasket"?f.push("/Basket"):a==="NoBasket"?f.push("/ExtraIPOrders"):console.error("Ошибка оплаты заказа")}catch(a){console.error("ExtraIPOrderPay error:",a),c.value=!1}c.value=!1}return[_,v]=K(()=>n.fetchExtraIPSchemes()),await _,v(),(x,e)=>{const a=H,V=F,E=T,g=L,k=A,C=U,O=$,b=N;return d(),R(z,null,[r(a,{"contract-id":i.value?.ID},null,8,["contract-id"]),o("div",Q,[r(V),o("div",W,[o("h1",X,I(w.value.Name),1),r(E,{partition:"Header:/ExtraIPOrders",class:"tw-mt-4"}),o("div",Y,[e[4]||(e[4]=o("div",{class:"tw-flex-none tw-w-64"},[S(" Выбрать договор "),o("span",{class:"tw-text-red-500 tw-ml-1"},"*")],-1)),o("div",Z,[r(g,{modelValue:m.value,"onUpdate:modelValue":e[0]||(e[0]=s=>m.value=s)},null,8,["modelValue"])])]),r(k,{modelValue:l.value,"onUpdate:modelValue":e[1]||(e[1]=s=>l.value=s),schemes:j(n).extraIPSchemes,service:w.value},null,8,["modelValue","schemes","service"]),i.value?(d(),y(C,{key:0,modelValue:t.value,"onUpdate:modelValue":e[2]||(e[2]=s=>t.value=s),contract:i.value,scheme:l.value,"service-id":5e4},null,8,["modelValue","contract","scheme"])):P("",!0),o("div",ee,[t.value?(d(),y(O,{key:0,tariff:t.value},null,8,["tariff"])):P("",!0),r(b,{disabled:t.value===null||t.value?.price===null,loading:c.value,class:"tw-w-full",onClick:e[3]||(e[3]=s=>h())},{default:q(()=>[S(I(D.value),1)]),_:1},8,["disabled","loading"])])])])],64)}}};export{ke as default};
