import{f as e,h as t,i as n,l as r,r as i,s as a,t as o}from"./useToast-CS8pZhce.js";import{t as s}from"./building-BdUpGLM5.js";import{t as c}from"./credit-card-6Y5eHPCw.js";import{C as l,K as u,R as d,U as f,Y as p,c as m,l as h,r as g,t as _,y as v}from"./index-CyHCRa3Z.js";import{t as y}from"./currency-DdDs82F5.js";var b={name:`arrow-down-left`,size:24,node:[[`path`,{d:`M17 7 7 17`,key:`15tmo1`}],[`path`,{d:`M17 17H7V7`,key:`1org7z`}]]};b.node;var x=r(b),S={name:`arrow-up-right`,size:24,node:[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]};S.node;var C=r(S),w={name:`chart-pie`,size:24,node:[[`path`,{d:`M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z`,key:`pzmjnu`}],[`path`,{d:`M21.21 15.89A10 10 0 1 1 8 2.83`,key:`k2fpak`}]],aliases:[`pie-chart`]};w.node;var T=r(w),E={name:`wallet`,size:24,node:[[`path`,{d:`M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1`,key:`18etb6`}],[`path`,{d:`M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4`,key:`xoc0q4`}]]};E.node;var D=r(E),O=t(e(),1);function k(){let[e,t]=(0,O.useState)([]),[n,r]=(0,O.useState)([]),[i,a]=(0,O.useState)(null),[o,s]=(0,O.useState)(!0),[c,l]=(0,O.useState)(null),d=(0,O.useCallback)(async()=>{try{s(!0),l(null);let[e,n,i]=await Promise.all([u.accounts.list({pageSize:50}),u.transactions.list({pageSize:200}),u.getPnLMetrics()]);t(e.items),r(n.items),a(i)}catch(e){l(e instanceof Error?e:Error(String(e)))}finally{s(!1)}},[]);return(0,O.useEffect)(()=>{let e=!0;return Promise.resolve().then(()=>{e&&d()}),()=>{e=!1}},[d]),f(`records:changed`,e=>{(e.entityType===`account`||e.entityType===`cash_flow_transaction`||e.entityType===`payment`)&&d()}),f(`storage:reset`,d),f(`snapshot:imported`,d),{accounts:e,transactions:n,pnlMetrics:i,loading:o,error:c,refetch:d,createTransactionFromPayment:(0,O.useCallback)(async(e,t,n)=>u.createTransactionFromPayment(e,t,n),[]),createTransactionFromReturn:(0,O.useCallback)(async(e,t,n)=>u.createTransactionFromReturn(e,t,n),[]),createManualTransaction:(0,O.useCallback)(async(e,t,n,r,i)=>{let a=await u.accounts.getById(r),o=a?.name||`Банковский счет`,s=await u.transactions.create({transactionNumber:`CFT-${Date.now().toString().slice(-6)}`,type:e,category:t,amount:n,accountId:r,accountName:o,description:i,timestamp:new Date().toISOString()});if(a){let t=e===`inflow`?a.balance.minor+n.minor:Math.max(0,a.balance.minor-n.minor);await u.accounts.update(r,{balance:{minor:t,currency:a.balance.currency}})}return s},[])}}var A=a(),j=()=>{let{showToast:e}=o(),{accounts:t,transactions:r,pnlMetrics:a,createManualTransaction:u}=k(),[f,b]=(0,O.useState)(`transactions`),[S,w]=(0,O.useState)(``),[E,j]=(0,O.useState)(`all`),[M,N]=(0,O.useState)(!1),[P,F]=(0,O.useState)(`inflow`),[I,L]=(0,O.useState)(`sales_revenue`),[R,z]=(0,O.useState)(15e5),[B,V]=(0,O.useState)(``),[H,U]=(0,O.useState)(``),W=(0,O.useMemo)(()=>r.filter(e=>e.type===`inflow`).reduce((e,t)=>e+t.amount.minor,0),[r]),G=(0,O.useMemo)(()=>r.filter(e=>e.type===`outflow`).reduce((e,t)=>e+t.amount.minor,0),[r]),K=W-G,q=(0,O.useMemo)(()=>[...r].filter(e=>{let t=E===`all`||e.type===E,n=!S||e.description.toLowerCase().includes(S.toLowerCase())||e.transactionNumber.toLowerCase().includes(S.toLowerCase())||e.accountName.toLowerCase().includes(S.toLowerCase());return t&&n}).sort((e,t)=>t.timestamp>e.timestamp?1:-1),[r,E,S]),J=async n=>{n.preventDefault();let r=B||t[0]?.id||`acc_default`;try{await u(P,I,{minor:R,currency:`RUB`},r,H||(P===`inflow`?`Внереализационный доход`:`Хозяйственные расходы`)),e(`Финансовая проводка успешно записана в ДДС!`,`success`),N(!1),U(``)}catch(t){e(`Ошибка: ${t instanceof Error?t.message:String(t)}`,`error`)}},Y=e=>{switch(e){case`sales_revenue`:return`Выручка от продаж (Заказ)`;case`refund`:return`Возврат клиенту (Заказ)`;case`supplier_payment`:return`Оплата поставщику`;case`payroll`:return`Заработная плата`;case`rent`:return`Аренда помещений`;case`taxes`:return`Налоги и сборы`;case`utilities`:return`Коммунальные услуги`;default:return`Прочие операции`}};return(0,A.jsxs)(`div`,{className:`space-y-4 animate-fade-in`,children:[(0,A.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-3 bg-krona-surface p-3.5 rounded-xl border border-krona-border shadow-krona-soft`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`h1`,{className:`text-sm font-bold text-krona-primary`,children:`Финансы, Казначейство & ДДС (Cash Flow)`}),(0,A.jsx)(_,{level:`pilot1`,size:`sm`})]}),(0,A.jsx)(`p`,{className:`text-xs text-krona-secondary mt-0.5`,children:`Сквозной учет движения денежных средств (ДДС): автоматические платежи и возвраты по заказам, балансы расчетных счетов`})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsxs)(n,{variant:`secondary`,size:`sm`,onClick:()=>{F(`outflow`),L(`supplier_payment`),N(!0)},children:[(0,A.jsx)(l,{className:`w-3.5 h-3.5 mr-1`}),` Расходный ордер`]}),(0,A.jsxs)(n,{variant:`primary`,size:`sm`,onClick:()=>{F(`inflow`),L(`sales_revenue`),N(!0)},children:[(0,A.jsx)(l,{className:`w-3.5 h-3.5 mr-1`}),` Приход денег`]})]})]}),(0,A.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-4 gap-3.5`,children:[(0,A.jsxs)(`div`,{className:`bg-krona-surface border border-krona-border rounded-xl p-4 shadow-krona-soft`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsx)(`span`,{className:`text-xs text-krona-secondary font-medium`,children:`Поступления (Inflow)`}),(0,A.jsx)(`div`,{className:`w-7 h-7 rounded-lg bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 flex items-center justify-center`,children:(0,A.jsx)(m,{className:`w-4 h-4`})})]}),(0,A.jsx)(`div`,{className:`text-xl font-bold text-krona-green mt-2`,children:y(W)}),(0,A.jsx)(`div`,{className:`text-[11px] text-krona-secondary mt-1`,children:`Оплаты заказов и выручка`})]}),(0,A.jsxs)(`div`,{className:`bg-krona-surface border border-krona-border rounded-xl p-4 shadow-krona-soft`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsx)(`span`,{className:`text-xs text-krona-secondary font-medium`,children:`Выплаты (Outflow)`}),(0,A.jsx)(`div`,{className:`w-7 h-7 rounded-lg bg-rose-500/10 text-rose-600 dark:text-rose-400 flex items-center justify-center`,children:(0,A.jsx)(h,{className:`w-4 h-4`})})]}),(0,A.jsx)(`div`,{className:`text-xl font-bold text-rose-600 dark:text-rose-400 mt-2`,children:y(G)}),(0,A.jsx)(`div`,{className:`text-[11px] text-krona-secondary mt-1`,children:`Возвраты, закупки, расходы`})]}),(0,A.jsxs)(`div`,{className:`bg-krona-surface border border-krona-border rounded-xl p-4 shadow-krona-soft`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsx)(`span`,{className:`text-xs text-krona-secondary font-medium`,children:`Чистый поток (Net Cash Flow)`}),(0,A.jsx)(`div`,{className:`w-7 h-7 rounded-lg bg-[#2F684C]/10 text-krona-primary flex items-center justify-center`,children:(0,A.jsx)(d,{className:`w-4 h-4`})})]}),(0,A.jsx)(`div`,{className:`text-xl font-bold mt-2 ${K>=0?`text-krona-green`:`text-rose-600 dark:text-rose-400`}`,children:y(K)}),(0,A.jsx)(`div`,{className:`text-[11px] text-krona-secondary mt-1`,children:`Сальдо движения денег`})]}),(0,A.jsxs)(`div`,{className:`bg-krona-surface border border-krona-border rounded-xl p-4 shadow-krona-soft`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsx)(`span`,{className:`text-xs text-krona-secondary font-medium`,children:`Рентабельность (P&L Margin)`}),(0,A.jsx)(`div`,{className:`w-7 h-7 rounded-lg bg-amber-500/10 text-amber-600 flex items-center justify-center`,children:(0,A.jsx)(T,{className:`w-4 h-4`})})]}),(0,A.jsx)(`div`,{className:`text-xl font-bold text-krona-primary mt-2`,children:a?`${a.operatingMarginPercent}%`:`58.0%`}),(0,A.jsx)(`div`,{className:`text-[11px] text-krona-secondary mt-1`,children:`Маржинальность операций`})]})]}),(0,A.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-3 gap-3`,children:t.map(e=>(0,A.jsxs)(`div`,{className:`bg-krona-surface border border-krona-border rounded-xl p-3.5 shadow-krona-soft flex items-center justify-between`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(`div`,{className:`w-9 h-9 rounded-lg bg-krona-workspace text-krona-primary flex items-center justify-center border border-krona-border`,children:e.type===`bank`?(0,A.jsx)(s,{className:`w-4 h-4`}):e.type===`cash_desk`?(0,A.jsx)(D,{className:`w-4 h-4`}):(0,A.jsx)(c,{className:`w-4 h-4`})}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`div`,{className:`text-xs font-bold text-krona-primary`,children:e.name}),(0,A.jsx)(`div`,{className:`text-[11px] text-krona-secondary`,children:e.type===`bank`?`Расчетный счет`:e.type===`cash_desk`?`Операционная касса`:`Эквайринг`})]})]}),(0,A.jsxs)(`div`,{className:`text-right`,children:[(0,A.jsx)(`div`,{className:`text-sm font-bold text-krona-green`,children:y(e.balance.minor)}),(0,A.jsx)(i,{variant:e.isDefault?`gold`:`gray`,size:`sm`,children:e.isDefault?`Основной`:`Активен`})]})]},e.id))}),(0,A.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5 overflow-x-auto text-xs`,children:[(0,A.jsxs)(`button`,{onClick:()=>b(`transactions`),className:`px-3 py-1.5 rounded-lg font-medium transition-colors ${f===`transactions`?`bg-krona-green text-white shadow-sm`:`bg-krona-surface text-krona-secondary hover:text-krona-primary border border-krona-border`}`,children:[`Движение денежных средств (ДДС) (`,r.length,`)`]}),(0,A.jsx)(`button`,{onClick:()=>b(`pnl`),className:`px-3 py-1.5 rounded-lg font-medium transition-colors ${f===`pnl`?`bg-krona-green text-white shadow-sm`:`bg-krona-surface text-krona-secondary hover:text-krona-primary border border-krona-border`}`,children:`Отчет о прибылях и убытках (P&L)`}),(0,A.jsxs)(`button`,{onClick:()=>b(`accounts`),className:`px-3 py-1.5 rounded-lg font-medium transition-colors ${f===`accounts`?`bg-krona-green text-white shadow-sm`:`bg-krona-surface text-krona-secondary hover:text-krona-primary border border-krona-border`}`,children:[`Банковские счета и кассы (`,t.length,`)`]})]}),f===`transactions`&&(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsxs)(`select`,{value:E,onChange:e=>j(e.target.value),className:`px-2.5 py-1.5 text-xs bg-krona-surface border border-krona-border rounded-lg text-krona-primary focus:outline-none`,children:[(0,A.jsx)(`option`,{value:`all`,children:`Все операции`}),(0,A.jsx)(`option`,{value:`inflow`,children:`Только приход (+)`}),(0,A.jsx)(`option`,{value:`outflow`,children:`Только расход (-)`})]}),(0,A.jsxs)(`div`,{className:`relative w-56`,children:[(0,A.jsx)(v,{className:`w-3.5 h-3.5 absolute left-2.5 top-2.5 text-krona-secondary`}),(0,A.jsx)(`input`,{type:`text`,value:S,onChange:e=>w(e.target.value),placeholder:`Поиск по описанию, счету...`,className:`w-full pl-8 pr-3 py-1.5 text-xs bg-krona-surface border border-krona-border rounded-lg text-krona-primary focus:outline-none`})]})]})]}),f===`transactions`&&(0,A.jsx)(`div`,{className:`bg-krona-surface border border-krona-border rounded-xl shadow-krona-soft overflow-hidden`,children:(0,A.jsxs)(`table`,{className:`w-full text-xs text-left`,children:[(0,A.jsx)(`thead`,{className:`bg-krona-workspace text-krona-secondary border-b border-krona-border`,children:(0,A.jsxs)(`tr`,{children:[(0,A.jsx)(`th`,{className:`p-3 font-semibold`,children:`Номер транзакции`}),(0,A.jsx)(`th`,{className:`p-3 font-semibold`,children:`Дата и время`}),(0,A.jsx)(`th`,{className:`p-3 font-semibold`,children:`Тип операции`}),(0,A.jsx)(`th`,{className:`p-3 font-semibold`,children:`Статья / Категория`}),(0,A.jsx)(`th`,{className:`p-3 font-semibold`,children:`Счет / Касса`}),(0,A.jsx)(`th`,{className:`p-3 font-semibold`,children:`Основание / Описание`}),(0,A.jsx)(`th`,{className:`p-3 font-semibold text-right`,children:`Сумма`})]})}),(0,A.jsxs)(`tbody`,{className:`divide-y divide-krona-border`,children:[q.map(e=>(0,A.jsxs)(`tr`,{className:`hover:bg-krona-workspace/50 transition-colors`,children:[(0,A.jsx)(`td`,{className:`p-3 font-mono font-bold text-krona-primary`,children:e.transactionNumber}),(0,A.jsx)(`td`,{className:`p-3 font-mono text-krona-secondary`,children:p(e.timestamp)}),(0,A.jsx)(`td`,{className:`p-3`,children:e.type===`inflow`?(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-1 font-bold text-emerald-600 dark:text-emerald-400 bg-emerald-500/10 px-2 py-0.5 rounded text-[11px]`,children:[(0,A.jsx)(x,{className:`w-3 h-3`}),` Приход (+)`]}):(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-1 font-bold text-rose-600 dark:text-rose-400 bg-rose-500/10 px-2 py-0.5 rounded text-[11px]`,children:[(0,A.jsx)(C,{className:`w-3 h-3`}),` Расход (-)`]})}),(0,A.jsx)(`td`,{className:`p-3 text-krona-primary font-medium`,children:Y(e.category)}),(0,A.jsx)(`td`,{className:`p-3 text-krona-secondary`,children:e.accountName}),(0,A.jsx)(`td`,{className:`p-3 text-krona-secondary`,children:e.description}),(0,A.jsx)(`td`,{className:`p-3 text-right font-bold font-mono`,children:(0,A.jsxs)(`span`,{className:e.type===`inflow`?`text-krona-green`:`text-rose-600 dark:text-rose-400`,children:[e.type===`inflow`?`+`:`-`,y(e.amount.minor)]})})]},e.id)),q.length===0&&(0,A.jsx)(`tr`,{children:(0,A.jsx)(`td`,{colSpan:7,className:`p-8 text-center text-krona-secondary text-xs italic`,children:`Финансовые проводки не найдены`})})]})]})}),f===`pnl`&&(0,A.jsxs)(`div`,{className:`bg-krona-surface border border-krona-border rounded-xl shadow-krona-soft p-5 space-y-4 max-w-3xl`,children:[(0,A.jsxs)(`div`,{className:`border-b border-krona-border pb-3`,children:[(0,A.jsx)(`h2`,{className:`text-sm font-bold text-krona-primary`,children:`Отчет о финансовых результатах (P&L / ОПУ)`}),(0,A.jsx)(`p`,{className:`text-xs text-krona-secondary mt-0.5`,children:`Текущий отчетный период на базе реальных проведенных операций в системе Krona`})]}),(0,A.jsxs)(`div`,{className:`space-y-2 text-xs`,children:[(0,A.jsxs)(`div`,{className:`flex justify-between items-center py-2 border-b border-krona-border/60`,children:[(0,A.jsx)(`span`,{className:`font-semibold text-krona-primary`,children:`1. Выручка от продаж (Revenue)`}),(0,A.jsx)(`span`,{className:`font-bold text-krona-green text-sm`,children:y(a?.revenue.minor||W)})]}),(0,A.jsxs)(`div`,{className:`flex justify-between items-center py-2 border-b border-krona-border/60 text-krona-secondary pl-4`,children:[(0,A.jsx)(`span`,{children:`Себестоимость проданных товаров (COGS, 42%)`}),(0,A.jsxs)(`span`,{children:[`-`,y(a?.costOfGoodsSold.minor||Math.round(W*.42))]})]}),(0,A.jsxs)(`div`,{className:`flex justify-between items-center py-2 bg-krona-workspace px-3 rounded-lg font-bold text-krona-primary`,children:[(0,A.jsx)(`span`,{children:`2. Валовая прибыль (Gross Profit)`}),(0,A.jsx)(`span`,{className:`text-krona-green`,children:y(a?.grossProfit.minor||Math.round(W*.58))})]}),(0,A.jsxs)(`div`,{className:`flex justify-between items-center py-2 border-b border-krona-border/60 text-krona-secondary pl-4`,children:[(0,A.jsx)(`span`,{children:`Операционные и административные расходы (OPEX)`}),(0,A.jsxs)(`span`,{children:[`-`,y(a?.operatingExpenses.minor||G)]})]}),(0,A.jsxs)(`div`,{className:`flex justify-between items-center py-3 bg-emerald-500/10 px-4 rounded-xl font-bold text-sm text-krona-primary border border-emerald-500/30`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`div`,{children:`3. Чистая прибыль (Net Profit)`}),(0,A.jsxs)(`div`,{className:`text-[11px] font-normal text-krona-secondary`,children:[`Рентабельность: `,a?.operatingMarginPercent||58,`%`]})]}),(0,A.jsx)(`div`,{className:`text-krona-green text-base`,children:y(a?.netProfit.minor||W-G)})]})]})]}),f===`accounts`&&(0,A.jsx)(`div`,{className:`bg-krona-surface border border-krona-border rounded-xl shadow-krona-soft overflow-hidden`,children:(0,A.jsxs)(`table`,{className:`w-full text-xs text-left`,children:[(0,A.jsx)(`thead`,{className:`bg-krona-workspace text-krona-secondary border-b border-krona-border`,children:(0,A.jsxs)(`tr`,{children:[(0,A.jsx)(`th`,{className:`p-3 font-semibold`,children:`Наименование счета`}),(0,A.jsx)(`th`,{className:`p-3 font-semibold`,children:`Тип счета`}),(0,A.jsx)(`th`,{className:`p-3 font-semibold`,children:`Банк`}),(0,A.jsx)(`th`,{className:`p-3 font-semibold`,children:`Номер счета`}),(0,A.jsx)(`th`,{className:`p-3 font-semibold`,children:`Текущий баланс`}),(0,A.jsx)(`th`,{className:`p-3 font-semibold text-center`,children:`Статус`})]})}),(0,A.jsx)(`tbody`,{className:`divide-y divide-krona-border`,children:t.map(e=>(0,A.jsxs)(`tr`,{className:`hover:bg-krona-workspace/50 transition-colors`,children:[(0,A.jsx)(`td`,{className:`p-3 font-bold text-krona-primary`,children:e.name}),(0,A.jsx)(`td`,{className:`p-3 text-krona-secondary`,children:e.type===`bank`?`Расчетный счет`:e.type===`cash_desk`?`Касса`:`Эквайринг`}),(0,A.jsx)(`td`,{className:`p-3 text-krona-secondary`,children:e.bankName||`ПАО Сбербанк`}),(0,A.jsx)(`td`,{className:`p-3 font-mono text-krona-secondary`,children:e.accountNumber||`40702810900000012345`}),(0,A.jsx)(`td`,{className:`p-3 font-bold text-krona-green text-sm`,children:y(e.balance.minor)}),(0,A.jsx)(`td`,{className:`p-3 text-center`,children:(0,A.jsx)(i,{variant:e.isDefault?`gold`:`green`,size:`sm`,children:e.isDefault?`Основной`:`Активен`})})]},e.id))})]})}),(0,A.jsx)(g,{isOpen:M,onClose:()=>N(!1),title:P===`inflow`?`Оформление прихода денежных средств`:`Оформление расходного кассового ордера`,size:`md`,children:(0,A.jsxs)(`form`,{onSubmit:J,className:`space-y-4 text-xs`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:`block font-semibold text-krona-primary mb-1`,children:`Счет / Касса:`}),(0,A.jsx)(`select`,{value:B,onChange:e=>V(e.target.value),className:`w-full px-3 py-1.5 bg-krona-workspace border border-krona-border rounded-lg text-krona-primary`,children:t.map(e=>(0,A.jsxs)(`option`,{value:e.id,children:[e.name,` (остаток: `,y(e.balance.minor),`)`]},e.id))})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:`block font-semibold text-krona-primary mb-1`,children:`Категория операции:`}),(0,A.jsx)(`select`,{value:I,onChange:e=>L(e.target.value),className:`w-full px-3 py-1.5 bg-krona-workspace border border-krona-border rounded-lg text-krona-primary`,children:P===`inflow`?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`option`,{value:`sales_revenue`,children:`Выручка от продаж`}),(0,A.jsx)(`option`,{value:`other`,children:`Прочие поступления`})]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`option`,{value:`supplier_payment`,children:`Оплата поставщику`}),(0,A.jsx)(`option`,{value:`refund`,children:`Возврат средств покупателю`}),(0,A.jsx)(`option`,{value:`payroll`,children:`Заработная плата`}),(0,A.jsx)(`option`,{value:`rent`,children:`Аренда`}),(0,A.jsx)(`option`,{value:`taxes`,children:`Налоги`}),(0,A.jsx)(`option`,{value:`utilities`,children:`Коммунальные платежи`}),(0,A.jsx)(`option`,{value:`other`,children:`Хозяйственные расходы`})]})})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:`block font-semibold text-krona-primary mb-1`,children:`Сумма (в копейках):`}),(0,A.jsx)(`input`,{type:`number`,min:100,step:100,value:R,onChange:e=>z(Number(e.target.value)||0),className:`w-full px-3 py-1.5 bg-krona-workspace border border-krona-border rounded-lg text-krona-primary font-bold`}),(0,A.jsxs)(`div`,{className:`text-[11px] text-krona-secondary mt-1`,children:[`Эквивалент:`,` `,(0,A.jsx)(`strong`,{className:`text-krona-green`,children:y(R)})]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:`block font-semibold text-krona-primary mb-1`,children:`Назначение платежа / Комментарий:`}),(0,A.jsx)(`input`,{type:`text`,required:!0,value:H,onChange:e=>U(e.target.value),placeholder:`Например: Оплата счета за кофе по договору...`,className:`w-full px-3 py-1.5 bg-krona-workspace border border-krona-border rounded-lg text-krona-primary`})]}),(0,A.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2 border-t border-krona-border`,children:[(0,A.jsx)(n,{variant:`secondary`,size:`sm`,type:`button`,onClick:()=>N(!1),children:`Отмена`}),(0,A.jsx)(n,{variant:`primary`,size:`sm`,type:`submit`,children:`Провести операцию`})]})]})})]})};export{j as FinanceModule};