1import{q as P,r as l,$ as D,j as t,m as N,G as f}from"./theme-3dfVej7W.js";import{fE as z,fF as $}from"./PrivateApp-BFO3_Tbx.js";import{f as A,a as _}from"./formatAmount-Dd0K_EhI.js";import{F as i}from"./index-BzeA_MbD.js";import{T as c,D as M,F as E}from"./index-C86gn5Ct.js";import{D as O}from"./index-DbyqvX_N.js";import{C as Y}from"./index-BKUOnk1C.js";import{R as B,C as s}from"./row-M1qaIYld.js";import{I as v}from"./index-CQ9iPbHV.js";import{S as m}from"./AntdIcon-B8e_FEAo.js";import{S as R}from"./index-C63dYVM1.js";import{M as W}from"./index-C016Db5J.js";import"./vite-preload-helper-BXl3LOEh.js";import"./index-LRpAibSh.js";import"../remoteEntry.js";import"./index-BEDcFE4N.js";import"./SignatureContext-BIIScoJU.js";import"./registerCabinetApi-CKnIRFA1.js";import"./downloadFileByUrl-w19mXwt2.js";import"./index-I1ZxXO3B.js";import"./LeftOutlined-zZTRbrqI.js";import"./purify.es-LQkvcK5U.js";import"./formatAmount-BO0bCaMt.js";import"./index-wH3ULS13.js";import"./PurePanel-CIovuaru.js";import"./useBreakpoint-DBaSuQQQ.js";import"./useForm-Cmblz3t1.js";import"./index-CwLtvCkV.js";import"./Sider-CaqjhNAo.js";import"./EllipsisOutlined-fLaExTxN.js";import"./index-D10blwUV.js";import"./index-CPNG8-3L.js";import"./PlusOutlined-DJbYRZlH.js";import"./isMobile-B_S5qVvp.js";import"./EyeOutlined-DGpwx6h2.js";const G=["show_tariff_contract","show_tariff_act","drop_tariff","show_invoice","supplementary_agreement"];function ke(){const{t:e,i18n:x}=P("wallet"),[p]=i.useForm(),[h,u]=l.useState({}),[S,d]=l.useState(1),[b,g]=l.useState(10),n=D(),[j]=z(),{data:o,isFetching:w}=$({page:S,size:b,...h}),y=r=>{const a={status_id:r.status_id??void 0,contract_number:r.contract_number??void 0,contract_status:r.contract_status??void 0,act_number:r.act_number??void 0,act_status:r.act_status??void 0};d(1),u(Object.fromEntries(Object.entries(a).filter(([,F])=>F!==void 0)))},k=r=>{switch(r){case"show_tariff_contract":return e("paidServices.viewContract");case"show_tariff_act":return e("paidServices.viewAct");case"drop_tariff":return e("paidServices.dropTariff");case"show_invoice":return e("paidServices.viewInvoice");case"supplementary_agreement":return e("paidServices.supplementaryAgreement")}},C=(r,a)=>{switch(r){case"show_tariff_contract":n(`/cabinet/wallet/paid-services/${a.id}/contract`);break;case"show_tariff_act":n(`/cabinet/wallet/paid-services/${a.id}/act`);break;case"drop_tariff":W.confirm({title:e("paidServices.dropTariffConfirmTitle"),content:e("paidServices.dropTariffConfirmContent"),okText:e("common.delete"),cancelText:e("common.cancel"),okButtonProps:{danger:!0},onOk:()=>j(a.id).unwrap()});break;case"show_invoice":a.contract_id&&n(`/cabinet/wallet/paid-services/${a.contract_id}/invoice`);break;case"supplementary_agreement":n(`/cabinet/wallet/paid-services/${a.id}/supplementary-agreement`);break}},I=r=>G.filter(a=>r.available_actions?.includes(a)).filter(a=>a!=="show_invoice"||r.contract_id).map(a=>({key:a,label:k(a),danger:a==="drop_tariff",onClick:()=>C(a,r)})),T=[{title:e("paidServices.id"),dataIndex:"id"},{title:e("paidServices.name"),key:"name",render:(r,a)=>(x.language==="kz"?a.tariff_name_kz:a.tariff_name_ru)??a.tariff_name_ru??"â"},{title:e("paidServices.contractNumber"),dataIndex:"contract_number"},{title:e("paidServices.contractStatus"),dataIndex:"contract_status_name_ru",render:r=>t.jsx(c,{variant:"outlined",children:r})},{title:e("paidServices.actNumber"),width:"220px",render:r=>t.jsx(O,{column:1,layout:"vertical",items:[{label:e("paidServices.actSignDate"),children:N(r?.act_sign_date).format("YYYY-MM-DD HH:mm:ss")}]})},{title:e("paidServices.cost"),dataIndex:"tariff_cost",align:"right",render:r=>A(r)},{title:e("paidServices.statusTariff"),dataIndex:"status_name_ru",render:r=>t.jsx(c,{style:{whiteSpace:"normal",wordBreak:"normal"},variant:"outlined",children:r})},{title:e("paidServices.period"),key:"period",render:(r,a)=>`${_(a.period_start)} â ${_(a.period_end)}`},{title:e("paidServices.active"),dataIndex:"is_active",render:r=>r?t.jsx(c,{variant:"outlined",color:"success",children:e("paidServices.isActive")}):t.jsx(c,{variant:"outlined",children:e("paidServices.isInactive")})},{title:e("paidServices.actions"),render:r=>{const a=I(r);return a?.length?t.jsx(M,{trigger:["click"],menu:{items:a},children:t.jsx("span",{className:"cursor-pointer",children:"â®"})}):null}}];return t.jsxs(Y,{title:e("nav.paidServices"),children:[t.jsx(i,{form:p,layout:"vertical",className:"mb-4",onFinish:y,children:t.jsxs(B,{gutter:16,children:[t.jsx(s,{xs:24,md:6,children:t.jsx(i.Item,{name:"contract_number",label:e("outgoingPayments.filters.docNum"),children:t.jsx(v,{allowClear:!0})})}),t.jsx(s,{xs:24,md:6,children:t.jsx(i.Item,{name:"act_number",label:e("paidServices.actNumber"),children:t.jsx(v,{allowClear:!0})})}),t.jsx(s,{xs:24,md:6,children:t.jsx(i.Item,{name:"contract_status",label:e("outgoingPayments.filters.status"),children:t.jsx(m,{allowClear:!0,options:[]})})}),t.jsx(s,{xs:24,md:6,children:t.jsx(i.Item,{name:"act_status",label:e("paidServices.actStatus"),children:t.jsx(m,{allowClear:!0,options:[]})})}),t.jsx(s,{xs:24,md:6,children:t.jsx(i.Item,{name:"bank",label:e("paidServices.statusTariff"),children:t.jsx(m,{allowClear:!0,options:[]})})}),t.jsx(s,{xs:24,md:18,className:"flex items-end justify-end",children:t.jsxs(R,{children:[t.jsx(f,{type:"primary",htmlType:"submit",children:e("common.search")}),t.jsx(f,{onClick:()=>{p.resetFields(),d(1),u({})},children:e("common.reset")})]})})]})}),t.jsx(E,{rowKey:"id",loading:w,className:"border rounded-xl",dataSource:o?.items??[],columns:T,scroll:{x:"1440px"},pagination:{position:["bottomCenter"],current:o?.page,pageSize:o?.size,total:o?.total,onChange:(r,a)=>{d(r),g(a)},showSizeChanger:!0}})]})}export{ke as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.