1import{j as s}from"./chunk-CHPXP26E.js";import{v as e,r as t,u as i,l as a,E as n,aK as r,aL as o,am as c,n as l,ak as m,Z as p,Y as d,_ as u}from"./chunk-BIodJjId.js";import{m as j,F as h}from"./chunk-CXVmiye8.js";import{g as k}from"./chunk-BUBHVWjm.js";import{g as x}from"./chunk-CxkDOCLw.js";import{I as f}from"./chunk-Bn3d7APC.js";import{I as v}from"../entries/src_pages.ajikvuZU.js";import{I as y}from"./chunk-CcTU0fVx.js";import{a as g}from"./chunk-Dkjvrxnc.js";import{I as N}from"./chunk-CZd-ntFb.js";import{E as C}from"./chunk-8Pzk_JVx.js";import"./chunk-DYycXddY.js";import{I as b}from"./chunk-CO9260Ij.js";import{S as $}from"./chunk-c8iSlhlM.js";import{T as I}from"./chunk-BmtH2H7W.js";import{C as L}from"./chunk-BlbsXjoI.js";import"./chunk-BhLMWRjL.js";import"./chunk-d5pl6CS0.js";import"./chunk-CrgSjA09.js";import"./chunk-BZdPK2Gl.js";import"./chunk-BLZMmKYD.js";import"./chunk-xhCkp7uf.js";import"./chunk-CZkF0E3J.js";import"./chunk-_F9124nm.js";import"./chunk-BxDgbgO6.js";import"./chunk-I3GkG-TK.js";import"./chunk-CeFMUgER.js";import"./chunk-C_NABtUk.js";import"./chunk-jAowUkwz.js";import"./chunk-B9kWNVmC.js";import"./chunk-oN8PVRr9.js";import"./chunk-j_zEfePq.js";import"./chunk-lHMmHsTf.js";import"./chunk-Bptc359o.js";import"./chunk-Biqc47oa.js";import"./chunk-D8A3YXSB.js";import"./chunk-CXS5uJci.js";import"./chunk-PKaWmY92.js";import"./chunk-Dt7fLkyA.js";/* empty css */import"./chunk-xtG4Eayc.js";import"./chunk-eu5b1ctJ.js";import"./chunk-CSI5KBb8.js";const P="KX-jsCbE",V="LO89Vzz6",w="W6n44KA1",M="_5dHqU4oc",q="Bd7I5-Il",z="DU0atCNm",F=(s=s=>s)=>[{text:`${s("ÐÐ»Ð°Ð½Ð¾Ð²Ð°Ñ ÑÑожайноÑÑÑ")} ${s("Ñ/Ðа")}`,key:"yieldPlan"},{text:`${s("ФакÑиÑеÑÐºÐ°Ñ ÑÑожайноÑÑÑ")} ${s("Ñ/Ðа")}`,key:"yieldFact"},{text:s("ÐлановÑе заÑÑаÑÑ Ð½Ð° Ðа"),key:"costsPlan"},{text:s("ФакÑиÑеÑкие заÑÑаÑÑ Ð½Ð° Ðа"),key:"costsFact"},{text:s("Ð ÑноÑÐ½Ð°Ñ ÑÑоимоÑÑÑ ÑÑÐ¾Ð¶Ð°Ñ Ð·Ð° ÑенÑнеÑ"),key:"marketValue",customPrice:!0}],_=({fcf:e,keyName:i,onClick:a})=>{const n=t.useRef(void 0),r=l(Number(e?.[`${i}Pct`]),2),o=r>0||r<0,c=r>0?"#1b8":"#f44",m=o?s.jsx("svg",{width:10,height:12,viewBox:"0 0 7 8",fill:"none",style:{marginLeft:15},children:s.jsx("path",{d:r>0?"M3.5 1v6M1 3l2.5-2L6 3":"M3.5 7V1M6 5 3.5 7 1 5",stroke:c,strokeLinecap:"round",strokeLinejoin:"round"})}):null;return s.jsxs("div",{className:M,onClick:a,children:[s.jsxs("div",{className:q,children:[Number(e?.[i])," ",m," ",o&&s.jsxs("span",{ref:n,style:{color:c},children:[Math.abs(r),"%"]})]}),o&&s.jsx(u,{ref:n,children:"Ðинамика по ÑÑÐ°Ð²Ð½ÐµÐ½Ð¸Ñ Ñ Ð¿ÑоÑлÑм Ñезоном"})]})},E=()=>{const{t:u}=e(),M=t.useRef(void 0),[q,E]=t.useState(!1),[K,S]=t.useState(void 0),A=K&&K?.plant&&F(u).every(s=>!!/fact/gi.test(s?.key)&&!/pct/gi.test(s?.key)||!!K?.[s?.key]),B=i(),{isFarmCropFinancesLoading:D}=a(n),O=a(r),{isLoading:R,plants:T}=a(o),{plantPrices:U=[]}=a(c),H=s=>()=>{E(!0),S(s)},Q=s=>()=>{B(j(s,h.delete)),S(void 0)},W=t.useMemo(()=>T.map(e=>{return{...e,ratio:0,render:(t=e,()=>s.jsx("div",{style:{color:d(t.id)},children:t.name},t.id))};var t}),[T]),X=s=>e=>{if(M?.current&&s&&void 0!==e)if("plant"===s){const{render:s,ratio:t,...i}=e||{};S(s=>({...s||{},plant:i,plantId:i?.id}))}else S(t=>({...t||{},[s]:Number(e)}))},Y=U.filter(s=>s?.plantId===K?.plant?.id),Z=Y.map(s=>({title:s?.class?.name?`${s?.class?.name} - ${m(l(s?.cost,2))}`:`${m(l(s?.cost,2))}`,value:l(s?.cost,2)}));return t.useEffect(()=>{void 0!==K?.plant?.id&&B(x([K?.plant?.id]))},[K?.plant?.id]),s.jsxs("div",{className:P,children:[s.jsx("div",{className:V,children:u("ÐобавÑÑе кÑлÑÑÑÑÑ, коÑоÑÑе планиÑÑÑÑÑÑ Ð² ÑевообоÑоÑе и ÑкажиÑе ÑÑеднÑÑ ÑебеÑÑоимоÑÑÑ Ð²Ð¾Ð·Ð´ÐµÐ»ÑÐ²Ð°Ð½Ð¸Ñ ÐºÑлÑÑÑÑ Ð² Ñ
озÑйÑÑве.")}),s.jsx($,{header:s.jsx("div",{className:w,children:u("Ðобавление кÑлÑÑÑÑÑ")}),footer:s.jsx(g,{text:u("СоÑ
ÑаниÑÑ"),onClick:()=>{E(!1),B(j(K,h.save))},disabled:!A}),onClose:()=>{S(void 0),E(!1)},isVisible:q,children:s.jsxs("div",{className:P,children:[s.jsx("div",{className:V,children:u("ÐÑбеÑиÑе кÑлÑÑÑÑÑ Ð¸ ÑкажиÑе ее показаÑели")}),s.jsx(b,{arrow:!0,hint:u("ÐÑлÑÑÑÑа"),items:W,onChange:X("plant"),loading:R,value:K?.plant?.id,textValue:K?.plant?.id?s.jsx(L,{crop:{plant:K?.plant}}):void 0,searchText:u("ÐоиÑк кÑлÑÑÑÑÑ"),placeholder:!K?.plant?.id&&u("ÐÑбÑаÑÑ"),autocomplete:s=>B(k(void 0,s))}),s.jsx("form",{ref:M,onSubmit:s=>s.preventDefault(),children:F(u).map(({text:e,key:t,customPrice:i})=>i&&Y?.length?s.jsx(C,{name:t,required:!0,items:Z,placeholder:e,defaultValue:K?.[t]||0,onChange:X(t)},t):s.jsx(N,{name:t,required:!0,isNumber:!0,placeholder:e,defaultValue:K?.[t]||0,onChange:X(t)},t))})]})}),s.jsx(I,{disabled:D,borderless:!0,align:"center",valign:"middle",title:[s.jsx(g,{view:"link",text:u("ÐобавиÑÑ ÐºÑлÑÑÑÑÑ"),icon:s.jsx(y,{color:"var(--blue",size:12}),onClick:s=>{s.stopPropagation(),S(void 0),E(!0)}}),...F(u).map(({text:s})=>s),""],lines:O.map(e=>[...e&&e?.id&&[{component:s.jsx(L,{crop:e}),value:e?.plant?.id||e?.detectedPlant?.id}],...F(u).map(({key:t})=>({key:`${e.id}_${t}`,value:Number(e?.[t]),component:s.jsx(_,{fcf:e,keyName:t,onClick:H(e)},t)})),s.jsx(g,{view:"link",tooltip:u("УдалиÑÑ"),icon:s.jsx(f,{size:15}),disabled:D,onClick:Q(e)})])}),s.jsxs("div",{className:p(z,V),children:[s.jsx(v,{style:{opacity:"var(--opacity-minor"}}),u("CебеÑÑоимоÑÑÑ Ð±ÑÐ´ÐµÑ ÑÑиÑÑваÑÑÑÑ Ð² ÑоÑмаÑ
ÑÑаÑиÑÑики и авÑомаÑиÑеÑкой генеÑаÑии ÑевообоÑоÑа.")]})]})};export{E 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.