PageSourceSearch

https://agrokomakchi.uz/static/js/7206.dba131ef.chunk.js

js agrokomakchi.uz collected 2026-10-04 01:45:21 UTC 8,224 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkagrokumakchi_web=self.webpackChunkagrokumakchi_web||[]).push([[7206],{17206:(e,t,i)=>{i.r(t),i.d(t,{default:()=>j});var o=i(36150),r=i(46025),n=i(23072),l=i(13863),a=i(4159),s=i.n(a),d=i(74283),c=i(9950),u=i(67818),p=i(28429),v=i(52867),x=i(80801),g=i(49111),h=i(72612),m=i(52160),y=i(39452),f=i(22875),w=i(44414);const b=e=>{var t;const{t:i}=(0,u.Bd)(),{dateStrings:r,regionId:n,defaultMonth:l,setDefaultMonth:a,productCodes:d,districtId:p}=e,[g,b]=(0,c.useState)(0),[j,C]=(0,c.useState)(0),{data:Y,isLoading:k}=(0,o.I)({queryKey:["export-local-price-timeseries",r,n,d,p],queryFn:async()=>await x.Ay.get("export/local/price/timeseries/",{params:{from_date:r[0],to_date:r[1],region_id:n,district_id:p,products_codes:d}}),enabled:!!n&&!!p});if((0,c.useEffect)((()=>{var e,t,i,o,r;Y&&(null===Y||void 0===Y||null===(e=Y.data)||void 0===e||null===(t=e.prices)||void 0===t?void 0:t.length)>0&&(b(null===Y||void 0===Y||null===(i=Y.data)||void 0===i?void 0:i.prices[0]),C(null===Y||void 0===Y||null===(o=Y.data)||void 0===o?void 0:o.prices[(null===Y||void 0===Y||null===(r=Y.data)||void 0===r?void 0:r.prices.length)-1]))}),[Y]),k)return(0,w.jsx)("div",{style:{width:"100%",height:"500px",justifyContent:"center",alignItems:"center",display:"flex"},children:(0,w.jsx)(h.A,{})});if(null!==Y&&void 0!==Y&&null!==(t=Y.data)&&void 0!==t&&t.prices){var A,M,S;let e=(j-g).toFixed(2);return(0,w.jsxs)("div",{style:{marginBottom:"20px"},children:[j&&g&&(0,w.jsxs)("div",{style:{border:"1px solid #00000020",width:"250px",padding:"10px",borderRadius:"4px",backgroundColor:"white",marginBottom:"10px",marginLeft:"auto"},children:[(0,w.jsxs)("h1",{style:{fontSize:"18px",fontWeight:"bold",margin:"0"},children:[(0,v.Hu)(j)," ",i("sum")]}),(0,w.jsxs)("div",{style:{display:"flex",gap:"5px",fontSize:"14px"},children:[(0,w.jsxs)("span",{style:{color:e>=0?"green":"red"},children:[e>=0?(0,w.jsx)(f.uCC,{size:"12px"}):(0,w.jsx)(f.$TP,{size:"12px"})," ",(100*j/g-100).toFixed(2),"%"]}),(0,w.jsxs)("span",{children:[e," ",i("sum")]}),(0,w.jsxs)("span",{style:{color:"grey"},children:[l," ",i("in-month")]})]})]}),(0,w.jsx)(y.A,{options:{chart:{zoom:{type:"x",enabled:!0,autoScaleYaxis:!0},toolbar:{autoSelected:"zoom"}},dataLabels:{enabled:!1},stroke:{curve:"straight",width:2},fill:{type:"gradient",gradient:{shadeIntensity:1,inverseColors:!1,opacityFrom:.5,opacityTo:0,stops:[0,90,100]}},grid:{row:{colors:["#f3f3f3","transparent"],opacity:.5}},xaxis:{categories:null===Y||void 0===Y||null===(A=Y.data)||void 0===A||null===(M=A.dates)||void 0===M?void 0:M.map(((e,t)=>s()(e).format("YYYY-MM-DD"))),labels:{formatter:function(e){return e},show:!1}},yaxis:{labels:{formatter:function(e){return(0,v.Hu)(e)}}},tooltip:{y:{formatter:function(e){return(0,v.Hu)(e)+i("sum")}}}},series:[{name:i("price"),data:null===Y||void 0===Y||null===(S=Y.data)||void 0===S?void 0:S.prices}],type:"area",width:"100%",height:"500px"}),(0,w.jsxs)("div",{style:{display:"flex",gap:"5px",justifyContent:"center",overflow:"auto"},children:[(0,w.jsxs)(m.Ay,{onClick:()=>a(6),type:6===l&&"primary",children:["6 ",i("monthly")]}),(0,w.jsxs)(m.Ay,{onClick:()=>a(12),type:12===l&&"primary",children:["1 ",i("yearly")]}),(0,w.jsxs)(m.Ay,{onClick:()=>a(36),type:36===l&&"primary",children:["3 ",i("yearly")]})]})]})}},j=()=>{var e;const t=(0,p.Zp)(),i=(0,p.g)(),{title:a}=d.A.parse(window.location.search),h=null===i||void 0===i||null===(e=i.productCodes)||void 0===e?void 0:e.split(","),{t:m}=(0,u.Bd)(),[y,f]=(0,c.useState)(null),[j,C]=(0,c.useState)(null),[Y,k]=(0,c.useState)(6),A=(0,c.useMemo)((()=>[s()().subtract(6,"month"),s()()]),[]),[M,S]=(0,c.useState)(A.map((e=>e.format("YYYY-MM-DD")))),_=(0,c.useMemo)((()=>({products_codes:h})),[h]),{data:D,isLoading:I,isError:N}=(0,o.I)({queryKey:["export-local-price-data",_],queryFn:async()=>await x.Ay.get("export/local/price/data/",{params:_})}),{data:L,isLoading:z}=(0,o.I)({queryKey:["export-local-price-regions"],queryFn:async()=>await x.Ay.get("export/local/price/regions/")}),{data:F,isLoading:q}=(0,o.I)({queryKey:["export-local-price-districts",y],queryFn:async()=>await x.Ay.get("export/local/price/districts/",{params:{region_id:y}}),enabled:!!y}),H=[{title:"#",dataIndex:"id",key:"region",render:(e,t,i)=>(0,w.jsxs)("span",{children:[" ",i+1," "]}),width:"60px",align:"center"},{title:m("region"),dataIndex:["region","name"],key:"region",width:"200px",align:"center"},{title:m("last-price"),dataIndex:"price",key:"price",width:"200px",align:"center",render:e=>(0,w.jsxs)("span",{children:[(0,v.Hu)(e)," ",m("sum")]})},{title:m("date-inter"),dataIndex:"date_inter",key:"date_inter",width:"200px",align:"center",render:e=>s()(e).format("YYYY-MM-DD")}];return(0,c.useEffect)((()=>{S([s()().subtract(Y,"month").format("YYYY-MM-DD"),s()().format("YYYY-MM-DD")])}),[Y]),(0,c.useEffect)((()=>{L&&(null===L||void 0===L?void 0:L.length)>0&&f(L[0].id)}),[L]),(0,c.useEffect)((()=>{F&&(null===F||void 0===F?void 0:F.length)>0&&C(F[0].id)}),[F]),N?(0,w.jsx)(g.A,{}):(0,w.jsxs)("div",{className:"p-5",style:{minHeight:"calc(100vh - 250px)"},children:[(0,w.jsxs)("div",{className:"mb-5 flex align-center",children:[(0,w.jsx)("div",{className:"arrow-icon",onClick:()=>t(-1)}),(0,w.jsx)("h2",{className:"m-0",children:a})]}),(0,w.jsxs)("div",{className:"flex justify-between items-center mb-2 xl:flex-row lg:flex-row md:flex-row flex-col",children:[(0,w.jsx)("span",{}),(0,w.jsxs)("div",{className:"filter-wrap mb-2",children:[(0,w.jsx)(r.A,{placeholder:m("
1category"),loading:z,value:y,options:(0,v.lb)(L,"name"),onChange:e=>{f(e),C(null)},allowClear:!1,showSearch:!0,filterOption:(e,t)=>((null===t||void 0===t?void 0:t.label)||"").toLowerCase().includes(e.toLowerCase())}),(0,w.jsx)(r.A,{placeholder:m("category"),loading:q,value:j,options:(0,v.lb)(F,"name"),allowClear:!1,onChange:e=>C(e),showSearch:!0,filterOption:(e,t)=>((null===t||void 0===t?void 0:t.label)||"").toLowerCase().includes(e.toLowerCase())})]})]}),(0,w.jsx)(b,{dateStrings:M,regionId:y,districtId:j,setDefaultMonth:k,defaultMonth:Y,productCodes:h}),(0,w.jsx)(n.A,{className:"my-10"}),(0,w.jsx)("h2",{children:m("final-avg-price")}),(0,w.jsx)(l.A,{columns:H,dataSource:D,loading:I,rowKey:"id",pagination:{pageSize:20},onRow:(e,t)=>({onClick:t=>{var i;f(null===e||void 0===e||null===(i=e.region)||void 0===i?void 0:i.id)}}),rowClassName:(e,t)=>{var i;return(null===e||void 0===e||null===(i=e.region)||void 0===i?void 0:i.id)===y?"active-table-row cursor-pointer":"cursor-pointer"}})]})}},52867:(e,t,i)=>{i.d(t,{Hu:()=>s,IY:()=>a,Q9:()=>l,Up:()=>u,lb:()=>n});var o=i(4159),r=i.n(o);const n=function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";return e&&(null===e||void 0===e?void 0:e.map((e=>({label:"function"===typeof t?t(e):e[t],value:e[i]}))))||[]};function l(e){if(!e)return"";const t=null===e||void 0===e?void 0:e.match(/v=([a-zA-Z0-9_-]+)/),i=null===e||void 0===e?void 0:e.match(/youtu\.be\/([a-zA-Z0-9_-]+)/),o=null===e||void 0===e?void 0:e.match(/youtube\.com\/shorts\/([a-zA-Z0-9_-]+)/);return t&&(null===t||void 0===t?void 0:t.length)>1?t[1]:i&&i.length>1?i[1]:o&&o.length>1?o[1]:""}const a=(e,t)=>r()(new Date(e)).format(t||"YYYY-MM-DD ");function s(e){return(""+e).replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,")}const d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const i=Number(e);return Number.isFinite(i)?i.toFixed(t).replace(/\.0+$/,""):"\u2014"},c=(e,t,i)=>{const o=Number(e),r=(e=>String(e||"").trim().toLowerCase())(t);if(!Number.isFinite(o))return{v:"\u2014",u:""};if("g"===r||r.includes("gram"))return{v:d(o/1e3),u:"kg"};if("kg"===r||r.includes("\u043a\u0438\u043b")||r.includes("kilo"))return{v:d(o),u:"kg"};if(r.includes("piece")||r.includes("pcs")||r.includes("dona")){const e="function"===typeof i?i("pieces"):"dona";return o>=1e6?{v:d(o/1e6),u:"mln ".concat(e)}:o>=1e3?{v:d(o/1e3),u:"k ".concat(e)}:{v:d(o,0),u:e}}return{v:d(o),u:t||""}},u=(e,t,i)=>{if(!Array.isArray(e))return null;const o=e.find((e=>String(null===e||void 0===e?void 0:e.product)===t));return o?c(null===o||void 0===o?void 0:o.power,(null===o||void 0===o?void 0:o.power_measure)||(null===o||void 0===o?void 0:o.power_messure)||(null===o||void 0===o?void 0:o.power_meassure),i):null}}}]);

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.