DD.WellWorkover.Cloud/AsbCloudWebApi/wwwroot/static/js/main.98821dab.chunk.js

2 lines
52 KiB
JavaScript

(this.webpackJsonpasb_cloud_front_react=this.webpackJsonpasb_cloud_front_react||[]).push([[0],{167:function(e,t,a){},185:function(e,t,a){},186:function(e,t,a){},275:function(e,t,a){"use strict";a.r(t);var s=a(0),l=a.n(s),r=a(36),c=a.n(r),o=(a(185),a(186),a(33)),n=a(32),i=a(174),d=a(281),b=a(282),j=a(283),u=a(58),h=a(286),m=a(287),x="data:image/png;base64,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",p=a(5);function O(){return Object(p.jsxs)("div",{className:"lds-ripple",children:[Object(p.jsx)("div",{}),Object(p.jsx)("div",{})]})}class y extends Error{constructor(e,t){super(t),this.url=void 0,this.status=void 0,this.statusText=void 0,this.body=void 0,this.url=e.url,this.status=e.status,this.statusText=e.statusText,this.body=e.body}}const g={BASE:"",VERSION:"1",WITH_CREDENTIALS:!1,TOKEN:void 0,USERNAME:void 0,PASSWORD:void 0,HEADERS:void 0};function f(e){return void 0!==e&&null!==e}function v(e){return"string"===typeof e}function S(e){return v(e)&&""!==e}function N(e){return e instanceof Blob}function A(e){const t=e.path.replace(/[:]/g,"_"),a=`${g.BASE}${t}`;return e.query?`${a}${function(e){const t=[];return Object.keys(e).forEach((a=>{const s=e[a];f(s)&&(Array.isArray(s)?s.forEach((e=>{t.push(`${encodeURIComponent(a)}=${encodeURIComponent(String(e))}`)})):t.push(`${encodeURIComponent(a)}=${encodeURIComponent(String(s))}`))})),t.length>0?`?${t.join("&")}`:""}(e.query)}`:a}async function w(e,t){return"function"===typeof t?t(e):t}async function D(e){const t=await w(e,g.TOKEN),a=await w(e,g.USERNAME),s=await w(e,g.PASSWORD),l=await w(e,g.HEADERS),r=new Headers({Accept:"application/json",...l,...e.headers});if(S(t)&&r.append("Authorization",`Bearer ${t}`),S(a)&&S(s)){const e=btoa(`${a}:${s}`);r.append("Authorization",`Basic ${e}`)}return e.body&&(N(e.body)?r.append("Content-Type",e.body.type||"application/octet-stream"):v(e.body)?r.append("Content-Type","text/plain"):r.append("Content-Type","application/json")),r}function k(e){return e.formData?function(e){const t=new FormData;return Object.keys(e).forEach((a=>{const s=e[a];f(s)&&t.append(a,s)})),t}(e.formData):e.body?v(e.body)||N(e.body)?e.body:JSON.stringify(e.body):void 0}async function I(e){const t=A(e),a=await async function(e,t){const a={method:e.method,headers:await D(e),body:k(e)};return g.WITH_CREDENTIALS&&(a.credentials="include"),await fetch(t,a)}(e,t),s=await async function(e){try{const t=e.headers.get("Content-Type");if(t)return t.toLowerCase().startsWith("application/json")?await e.json():await e.text()}catch(t){console.error(t)}return null}(a),l=function(e,t){if(t){const a=e.headers.get(t);if(v(a))return a}return null}(a,e.responseHeader),r={url:t,ok:a.ok,status:a.status,statusText:a.statusText,body:l||s};return function(e,t){const a={400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable",...e.errors}[t.status];if(a)throw new y(t,a);if(!t.ok)throw new y(t,"Generic Error")}(e,r),r}class C{static async getData(e,t,a=600,s=1024){return(await I({method:"GET",path:`/api/well/${e}/data`,query:{begin:t,intervalSec:a,approxPointsCount:s}})).body}static async getDataDatesRange(e){return(await I({method:"GET",path:`/api/well/${e}/dataDatesRange`})).body}}class R{static async getMessage(e,t,a=32,s,l,r){return(await I({method:"GET",path:`/api/well/${e}/message`,query:{skip:t,take:a,categoryids:s,begin:l,end:r}})).body}static async getMessagesDateRange(e){return(await I({method:"GET",path:`/api/well/${e}/messagesDatesRange`})).body}}class M{static async createReport(e,t,a,s,l){return(await I({method:"POST",path:`/api/report/${e}/report`,query:{stepSeconds:t,format:a,begin:s,end:l}})).body}static async getReport(e,t){return(await I({method:"GET",path:`/api/report/${e}/${t}`})).body}static async getSuitableReportsNames(e,t,a,s,l){return(await I({method:"GET",path:`/api/report/${e}/suitableReports`,query:{stepSeconds:t,format:a,begin:s,end:l}})).body}static async getReportSize(e,t,a,s,l){return(await I({method:"GET",path:`/api/report/${e}/reportSize`,query:{stepSeconds:t,format:a,begin:s,end:l}})).body}static async getReportsDateRange(e){return(await I({method:"GET",path:`/api/report/${e}/reportsDatesRange`})).body}}class P{static async getWells(){return(await I({method:"GET",path:"/api/well"})).body}static async getTransmittingWells(){return(await I({method:"GET",path:"/api/well/transmittingWells"})).body}}const{login:E}=class{static async login(e){return(await I({method:"POST",path:"/auth/login",body:e,errors:{400:"\u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442"}})).body}static async refresh(){return(await I({method:"GET",path:"/auth/refresh"})).body}};function T(){const[e,t]=Object(s.useState)(!1),a=Object(n.g)(),l=Object(p.jsx)("img",{src:x,alt:"\u0410\u0421\u0411",className:"logo"});return Object(p.jsxs)("div",{className:"login_page shadow",children:[Object(p.jsx)(d.a,{title:"\u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430",className:"shadow",bordered:!0,style:{width:350},extra:l,children:Object(p.jsxs)(b.a,{onFinish:async e=>{t(!0);try{(e=>{g.TOKEN=e.token,localStorage.token=e.token,localStorage.login=e.login})(await E(e)),t(!1),a.push("well")}catch(r){400===r.status&&(s=r.message,i.a.error({message:l||"\u041e\u0448\u0438\u0431\u043a\u0430",description:s})),console.error(`Error ${r}`),t(!1)}var s,l},children:[Object(p.jsx)(b.a.Item,{name:"login",rules:[{required:!0,message:"\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430 \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u0438\u043c\u044f!"}],children:Object(p.jsx)(j.a,{placeholder:"\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c",prefix:Object(p.jsx)(h.a,{})})}),Object(p.jsx)(b.a.Item,{name:"password",rules:[{required:!0,message:"\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430 \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u043f\u0430\u0440\u043e\u043b\u044c!"}],children:Object(p.jsx)(j.a.Password,{placeholder:"\u043f\u0430\u0440\u043e\u043b\u044c",prefix:Object(p.jsx)(m.a,{})})}),Object(p.jsx)(b.a.Item,{children:Object(p.jsx)(u.a,{type:"primary",htmlType:"submit",children:"\u0412\u0445\u043e\u0434"})})]})}),e&&Object(p.jsx)(O,{})]})}function L({show:e,fade:t=!0,children:a}){return Object(p.jsxs)("div",{className:"loader-container",children:[Object(p.jsx)("div",{className:"loader-content",children:a}),e&&t&&Object(p.jsx)("div",{className:"loader-fade"}),e&&Object(p.jsx)("div",{className:"loader-overlay",children:Object(p.jsx)(O,{})})]})}var F=a(278);const q={error:"\u041e\u0448\u0438\u0431\u043a\u0430",warning:"\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0435\u043d\u0438\u0435",info:"\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f"};function Y(e,t="info"){i.a[t]({description:e,message:q[t],type:t,placement:"bottomRight",duration:10})}const G=[{title:"\u041c\u0435\u0441\u0442\u043e\u0440\u043e\u0436\u0434\u0435\u043d\u0438\u0435",dataIndex:"deposit",key:"deposit"},{title:"\u041a\u0443\u0441\u0442",dataIndex:"cluster",key:"cluster"},{title:"\u0421\u043a\u0432\u0430\u0436\u0438\u043d\u0430",dataIndex:"caption",key:"caption"},{title:"\u0414\u0430\u043d\u043d\u044b\u0435",dataIndex:"lastData",key:"lastData"}];function W(e){const[t,a]=Object(s.useState)([]),[l,r]=Object(s.useState)(!1),c=Object(n.g)();return Object(s.useEffect)((()=>(async()=>{r(!0);try{let e=(await P.getWells()).map((e=>({key:e.id,...e})));console.log(e),a(e)}catch(e){Y("\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u043a\u0432\u0430\u0436\u0438\u043d","error"),console.error(`${e}`)}r(!1)})()),[]),Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)("h2",{children:"\u0421\u043a\u0432\u0430\u0436\u0438\u043d\u044b"}),Object(p.jsx)(L,{show:l,children:Object(p.jsx)(F.a,{dataSource:t,columns:G,onRow:e=>({onClick:t=>{c.push(`/well/${e.id}/`)}})})})]})}var H=a(277),V=a(80),z=a(290),K=a(291);function U(e){return Object(p.jsx)("div",{className:"menu-title",children:Object(p.jsx)("h2",{children:"\u0424\u0430\u0439\u043b\u044b"})})}var Q=a(279),$=a(60),Z=a(71),B=a(21),J=a(97),X=a(93),_=a.n(X);function ee(){let e=25869874412483*(new Date).getTime()*(performance&&performance.now&&performance.now())%0x9db3ccef09dd;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){let a=Math.random();return e=e>272?e/=17:e=e*a*a*557833831325167%0x9db3ccef09dd,a=Math.floor(a*e%16),("x"===t?a:11&a).toString(16)}))}var te=a(108),ae=a(177),se=a(285),le=a(27),re=a.n(le),ce=a(39),oe=(a(265),a(154));ce.c.register(ce.i,ce.g,ce.e,ce.f,ce.h,ce.d,oe.a);const ne={responsive:!0,aspectRatio:.45,animation:!1,events:["mousemove","mouseout","click","touchstart","touchmove"],scales:{y:{type:"time",reverse:!0,time:{stepSize:20,displayFormats:{millisecond:"HH:mm:ss.SSS",second:"HH:mm:ss",minute:"HH:mm:ss",hour:"DD HH:mm:ss",day:"MM.DD HH:mm",week:"yy.MM.DD HH:mm",month:"yyyy.MM.DD",quarter:"yyyy.MM.DD",year:"yyyy.MM"}},grid:{drawTicks:!1},ticks:{z:1,display:!1,textStrokeColor:"#ffff",textStrokeWidth:2,color:"#000"}},x:{type:"linear",position:"top",beginAtZero:!0}},elements:{point:{radius:0,hoverRadius:5}},plugins:{legend:{display:!1},datalabels:{display:!1}}},ie=({options:e,dataParams:t})=>{const a=Object(s.useRef)(null),[l,r]=Object(s.useState)();return Object(s.useEffect)((()=>{if(a.current&&!l){let s={};Object.assign(s,ne,e);let c=new ce.c(a.current,{type:"line",plugins:[oe.a],options:s,data:t.data});return r(c),()=>null===l||void 0===l?void 0:l.destroy()}}),[l,e,t]),Object(s.useEffect)((()=>{if(l){if(l.data=t.data,l.options.aspectRatio=null===e||void 0===e?void 0:e.aspectRatio,t.yStart){var a,s;let e=Number(null!==(a=t.yInterval)&&void 0!==a?a:600),c=new Date(t.yStart),o=new Date(t.yStart);o.setSeconds(o.getSeconds()+e);let{unit:n,stepSize:i}=(e=>{let t=e,a=(e=>e<=60?"millisecond":e<=1920?"second":e<=115200?"minute":e<=1382400?"hour":e<=2764800?"day":e<=19353600?"week":e<=84153600?"month":e<=336614400?"quarter":"year")(e);switch(a){case"millisecond":t*=1e3;break;case"second":break;case"minute":t/=60;break;case"hour":t/=3600;break;case"day":t/=86400;break;case"week":t/=604800;break;case"month":t/=2592e3;break;case"quarter":t/=7862400;break;case"year":t/=31557600}return t=Math.round(t/32),t=t>0?t:1,{unit:a,stepSize:t}})(e);var r;if(null===(s=l.options.scales)||void 0===s?void 0:s.y)l.options.scales.y.max=o.getTime(),l.options.scales.y.min=c.getTime(),l.options.scales.y.ticks.display=null===(r=t.displayLabels)||void 0===r||r,l.options.scales.y.time.unit=n,l.options.scales.y.time.stepSize=i}l.update()}}),[l,t,e]),Object(p.jsx)("canvas",{ref:a})},de=e=>{var t,a,s,l,r,c,o;let n=null!==(t=null!==(a=null!==(s=e.borderColor)&&void 0!==s?s:e.backgroundColor)&&void 0!==a?a:e.color)&&void 0!==t?t:"#"+Math.floor(16777215*Math.random()).toString(16);return{label:e.label,data:[],backgroundColor:null!==(l=e.backgroundColor)&&void 0!==l?l:n,borderColor:null!==(r=e.borderColor)&&void 0!==r?r:n,borderWidth:null!==(c=e.borderWidth)&&void 0!==c?c:1,borderDash:null!==(o=e.dash)&&void 0!==o?o:[]}},be={},je=({lines:e,data:t,yDisplay:a,rangeDate:l,chartRatio:r})=>{const[c,o]=Object(s.useState)({data:{datasets:[]}});Object(s.useEffect)((()=>{if(!e||!t)return;let s=e.map((e=>{let a=de(e);return a.data=t.map((t=>{var a;return{x:t[e.xAccessorName],y:new Date(t[null!==(a=e.yAccessorName)&&void 0!==a?a:"date"])}})),a})),r=l?(l[1]-l[0])/1e3:null,c=l?l[0]:re()();o({yInterval:r,yStart:c,displayLabels:null!==a&&void 0!==a&&a,data:{datasets:s}})}),[t,e,a,l,r]);const n=be;return n.aspectRatio=r,Object(p.jsx)(ie,{dataParams:c,options:n})};var ue=a(288);const{Option:he}=te.a,me=[{label:"\u0413\u043b\u0443\u0431\u0438\u043d\u0430 \u0437\u0430\u0431\u043e\u044f",xAccessorName:"wellDepth",color:"#f00"},{label:"\u041f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430",xAccessorName:"bitDepth",color:"#ff0"},{label:"\u041f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0442\u0430\u043b\u0435\u0432\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430",xAccessorName:"blockPosition",color:"#f0f"},{label:"\u0422\u0430\u043b\u0435\u0432\u044b\u0439 \u0431\u043b\u043e\u043a. \u041c\u0438\u043d \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435",xAccessorName:"blockPositionMin",color:"#0ff"},{label:"\u0422\u0430\u043b\u0435\u0432\u044b\u0439 \u0431\u043b\u043e\u043a. \u041c\u0430\u043a\u0441 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435",xAccessorName:"blockPositionMax",color:"#0f0"},{label:"\u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0442\u0430\u043b\u0435\u0432\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430",xAccessorName:"blockSpeed",color:"#00f"},{label:"\u0421\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0442\u0430\u043b\u0435\u0432\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430. \u0417\u0430\u0434\u0430\u043d\u0438\u0435",xAccessorName:"blockSpeedSp",color:"#c00"},{label:"\u0422\u0430\u043b\u0435\u0432\u044b\u0439 \u0431\u043b\u043e\u043a. \u0417\u0430\u0434\u0430\u043d\u0438\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0440\u043e\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0431\u0443\u0440\u0435\u043d\u0438\u044f",xAccessorName:"blockSpeedSpRotor",color:"#cc0"},{label:"\u0422\u0430\u043b\u0435\u0432\u044b\u0439 \u0431\u043b\u043e\u043a. \u0417\u0430\u0434\u0430\u043d\u0438\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0440\u0435\u0436\u0438\u043c\u0430 \u0441\u043b\u0430\u0439\u0434\u0430",xAccessorName:"blockSpeedSpSlide",color:"#c0c"},{label:"\u0422\u0430\u043b\u0435\u0432\u044b\u0439 \u0431\u043b\u043e\u043a. \u0417\u0430\u0434\u0430\u043d\u0438\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0438",xAccessorName:"blockSpeedSpDevelop",color:"#0cc"},{label:"\u0414\u0430\u0432\u043b\u0435\u043d\u0438\u0435",xAccessorName:"pressure",color:"#0c0"},{label:"\u0414\u0430\u0432\u043b\u0435\u043d\u0438\u0435. \u0425\u043e\u043b\u043e\u0441\u0442\u043e\u0439 \u0445\u043e\u0434",xAccessorName:"pressureIdle",color:"#00c"},{label:"\u0414\u0430\u0432\u043b\u0435\u043d\u0438\u0435. \u0417\u0430\u0434\u0430\u043d\u0438\u0435",xAccessorName:"pressureSp",color:"#900"},{label:"\u0414\u0430\u0432\u043b\u0435\u043d\u0438\u0435. \u0417\u0430\u0434\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u0440\u043e\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0431\u0443\u0440\u0435\u043d\u0438\u044f",xAccessorName:"pressureSpRotor",color:"#990"},{label:"\u0414\u0430\u0432\u043b\u0435\u043d\u0438\u0435. \u0417\u0430\u0434\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u0440\u0435\u0436\u0438\u043c\u0430 \u0441\u043b\u0430\u0439\u0434\u0430",xAccessorName:"pressureSpSlide",color:"#909"},{label:"\u0414\u0430\u0432\u043b\u0435\u043d\u0438\u0435. \u0417\u0430\u0434\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u0440\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0438",xAccessorName:"pressureSpDevelop",color:"#099"},{label:"\u0414\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0438\u0444\u0444. \u0410\u0432\u0430\u0440\u0438\u0439\u043d\u043e\u0435 \u043c\u0430\u043a\u0441.",xAccessorName:"pressureDeltaLimitMax",color:"#090"},{label:"\u041e\u0441\u0435\u0432\u0430\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430",xAccessorName:"axialLoad",color:"#009"},{label:"\u041e\u0441\u0435\u0432\u0430\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430. \u0417\u0430\u0434\u0430\u043d\u0438\u0435",xAccessorName:"axialLoadSp",color:"#600"},{label:"\u041e\u0441\u0435\u0432\u0430\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430. \u0410\u0432\u0430\u0440\u0438\u0439\u043d\u0430\u044f \u043c\u0430\u043a\u0441.",xAccessorName:"axialLoadLimitMax",color:"#660"},{label:"\u0412\u0435\u0441 \u043d\u0430 \u043a\u0440\u044e\u043a\u0435",xAccessorName:"hookWeight",color:"#606"},{label:"\u0412\u0435\u0441 \u043d\u0430 \u043a\u0440\u044e\u043a\u0435. \u0425\u043e\u043b\u043e\u0441\u0442\u043e\u0439 \u0445\u043e\u0434",xAccessorName:"hookWeightIdle",color:"#066"},{label:"\u0412\u0435\u0441 \u043d\u0430 \u043a\u0440\u044e\u043a\u0435. \u041f\u043e\u0441\u0430\u0434\u043a\u0430",xAccessorName:"hookWeightLimitMin",color:"#060"},{label:"\u0412\u0435\u0441 \u043d\u0430 \u043a\u0440\u044e\u043a\u0435. \u0417\u0430\u0442\u044f\u0436\u043a\u0430",xAccessorName:"hookWeightLimitMax",color:"#006"},{label:"\u041c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430 \u0440\u043e\u0442\u043e\u0440\u0435",xAccessorName:"rotorTorque",color:"#300"},{label:"\u041c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430 \u0440\u043e\u0442\u043e\u0440\u0435. \u0425\u043e\u043b\u043e\u0441\u0442\u043e\u0439 \u0445\u043e\u0434",xAccessorName:"rotorTorqueIdle",color:"#330"},{label:"\u041c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430 \u0440\u043e\u0442\u043e\u0440\u0435. \u0417\u0430\u0434\u0430\u043d\u0438\u0435",xAccessorName:"rotorTorqueSp",color:"#303"},{label:"\u041c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430 \u0440\u043e\u0442\u043e\u0440\u0435. \u0410\u0432\u0430\u0440\u0438\u0439\u043d\u044b\u0439 \u043c\u0430\u043a\u0441.",xAccessorName:"rotorTorqueLimitMax",color:"#033"},{label:"\u041e\u0431\u043e\u0440\u043e\u0442\u044b \u0440\u043e\u0442\u043e\u0440\u0430",xAccessorName:"rotorSpeed",color:"#030"},{label:"\u0420\u0430\u0441\u0445\u043e\u0434",xAccessorName:"flow",color:"#003"},{label:"\u0420\u0430\u0441\u0445\u043e\u0434. \u0425\u043e\u043b\u043e\u0441\u0442\u043e\u0439 \u0445\u043e\u0434",xAccessorName:"flowIdle",color:"#666"},{label:"\u0420\u0430\u0441\u0445\u043e\u0434. \u0410\u0432\u0430\u0440\u0438\u0439\u043d\u044b\u0439 \u043c\u0430\u043a\u0441.",xAccessorName:"flowDeltaLimitMax",color:"#ccc"}],xe=({label:e,value:t,closable:a,onClose:s})=>{var l;let r=null===(l=me.find((e=>e.xAccessorName===t)))||void 0===l?void 0:l.color;return Object(p.jsxs)(ae.a,{onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},closable:a,onClose:s,style:{marginRight:3},children:[Object(p.jsx)("span",{style:{backgroundColor:r},children:"\xa0\xa0\xa0\xa0\xa0"}),Object(p.jsxs)("span",{children:["\xa0",e]})]})};function pe({data:e,config:t,rangeDate:a,chartRatio:l,onRemoveChart:r,onSaveConfig:c}){var o;const[n,i]=Object(s.useState)([]);Object(s.useEffect)((()=>{i(t.lines)}),[t]);let d=null!==(o=null===n||void 0===n?void 0:n.map((e=>e.xAccessorName)))&&void 0!==o?o:[];const b=Object(p.jsx)(te.a,{mode:"multiple",placeholder:"\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043b\u0438\u043d\u0438\u0438",value:d,allowClear:!1,showArrow:!0,bordered:!1,tagRender:xe,onChange:e=>{let a=me.filter((t=>e.includes(t.xAccessorName)));t.lines=a,c&&c(),i(a)},style:{minWidth:"300px",maxWidth:"400px"},children:me.map((e=>Object(p.jsx)(he,{value:e.xAccessorName,color:e.color,children:e.label},e.xAccessorName)))}),j=Object(p.jsxs)(J.a,{children:[b,Object(p.jsx)(Z.a,{title:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0433\u0440\u0430\u0444\u0438\u043a",children:Object(p.jsx)(u.a,{onClick:()=>r(t.id),children:Object(p.jsx)(ue.a,{})})})]});return Object(p.jsx)(p.Fragment,{children:Object(p.jsx)(se.a,{content:j,children:Object(p.jsx)("div",{children:Object(p.jsx)(je,{data:e,yDisplay:t.yDisplay,lines:n,rangeDate:a,chartRatio:l})})})})}const{RangePicker:Oe}=Q.a,ye=(e,t)=>{let a=JSON.stringify(t);localStorage.setItem(e,a)};function ge(){let{id:e}=Object(n.h)();const[t,a]=Object(s.useState)([]),[l,r]=Object(s.useState)([]),[c,o]=Object(s.useState)([re()().subtract(3,"hours"),re()()]),[i,d]=Object(s.useState)({ratioRest:1,ratio1st:1,wRest:.5,w1st:.5}),[b,j]=Object(s.useState)(!1),h="chartsCfgs",m=Object(s.useRef)(),x=e=>{e&&a(e)},O=e=>{let t=l.filter((t=>t.id!==e));r(t)},y=()=>{ye(h,l)};Object(s.useLayoutEffect)((()=>{if(m.current&&(null===l||void 0===l?void 0:l.length)){let e=m.current.offsetWidth;e=e>0?e:1792;let t=m.current.offsetTop,a=m.current.offsetParent.offsetHeight-t-32;a=a>0?a:761;let s=l.length,r=8,c=8,o=Math.floor((e-r)/s)-c,n=o+r;d({ratio1st:n/a,ratioRest:o/a,w1st:n,wRest:o})}}),[m,l]),Object(s.useEffect)((()=>{let e=(e=>{let t=localStorage.getItem(e);return t?JSON.parse(t):null})(h);e&&r(e)}),[]),Object(s.useEffect)((()=>{ye(h,l)}),[l]),Object(s.useEffect)((()=>{let t=(c[1]-c[0])/1e3,a=c[0].toISOString();j(!0),C.getData(e,a,t,2048).then(x).catch((t=>{Y(`\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u0441\u043a\u0432\u0430\u0436\u0438\u043d\u0435 (${e}) c ${c[0]} \u043f\u043e ${c[1]}`,"error"),console.error(t)})).finally((()=>j(!1)))}),[e,c]);let g=null;return l.length>0&&(l[0].yDisplay=!0,g=l.map(((e,a)=>Object(p.jsx)($.a,{flex:`${0===a?i.w1st:i.wRest}px`,children:Object(p.jsx)(pe,{data:t,rangeDate:c,chartRatio:0===a?i.ratio1st:i.ratioRest,onRemoveChart:O,onSaveConfig:y,config:e})},e.id)))),Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(Z.a,{title:"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u043a",children:Object(p.jsx)(u.a,{type:"primary",onClick:()=>{let e=[...l,{id:ee(),yDisplay:!1,aspectRatio:1}];r(e)},disabled:l.length>=6,children:"+"})}),Object(p.jsx)(B.a,{locale:_.a,children:Object(p.jsx)(Oe,{showTime:!0,allowClear:!1,onChange:e=>{o(e)},value:c})}),Object(p.jsx)(L,{show:b,children:Object(p.jsx)(J.a,{ref:m,children:g})})]})}a(167);const{Option:fe}=te.a,{RangePicker:ve}=Q.a,Se={1:{title:"\u0410\u0432\u0430\u0440\u0438\u044f"},2:{title:"\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435"},3:{title:"\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f"}},Ne=[{title:"\u0414\u0430\u0442\u0430",key:"date",dataIndex:"date",render:e=>re()(e).format("DD MMM YYYY, HH:MM:ss")},{title:"\u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f",key:"categoryId",dataIndex:"categoryId",render:(e,t)=>Se[t.categoryId].title,style:(e,t)=>Se[t.categoryId].style,ellipsis:!0},{title:"\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435",key:"message",dataIndex:"message"},{title:"\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c",key:"user",dataIndex:"user"}],Ae=[{label:"\u0410\u0432\u0430\u0440\u0438\u044f",value:1},{label:"\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435",value:2},{label:"\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f",value:3}];function we(){let{id:e}=Object(n.h)();const[t,a]=Object(s.useState)([]),[l,r]=Object(s.useState)(null),[c,o]=Object(s.useState)(1),[i,d]=Object(s.useState)([]),[b,j]=Object(s.useState)([]),[u,h]=Object(s.useState)(!1),m=Ae.map((e=>Object(p.jsx)(fe,{children:e.label},e.value)));return Object(s.useEffect)((()=>{(async()=>{h(!0);try{let t=null,s=null;(null===i||void 0===i?void 0:i.length)>1&&(t=i[0].toISOString(),s=i[1].toISOString());let l=await R.getMessage(`${e}`,26*(c-1),26,b,t,s);a(l.items.map((e=>({key:e.id,categoryids:Se[e.categoryId],begin:e.date,...e})))),r({total:l.count,current:Math.floor(l.skip/26)})}catch(t){Y(`\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043f\u043e \u0441\u043a\u0432\u0430\u0436\u0438\u043d\u0435 "${e}"`,"error"),console.log(t)}h(!1)})()}),[e,c,b,i]),Object(p.jsxs)(p.Fragment,{children:[Object(p.jsxs)("div",{className:"filter-group",children:[Object(p.jsx)("h3",{className:"filter-group__heading",children:"\u0424\u0438\u043b\u044c\u0442\u0440 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439"}),Object(p.jsx)(te.a,{mode:"multiple",allowClear:!0,placeholder:"\u0424\u0438\u043b\u044c\u0442\u0440 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439",className:"filter-selector",value:b,onChange:j,children:m}),Object(p.jsx)(B.a,{locale:_.a,children:Object(p.jsx)(ve,{showTime:!0,onChange:e=>{d(e)}})})]}),Object(p.jsx)(L,{show:u,children:Object(p.jsx)(F.a,{columns:Ne,dataSource:t,rowClassName:e=>`event_message_${e.categoryId} event_message`,size:"small",pagination:{pageSize:26,showSizeChanger:!1,total:null===l||void 0===l?void 0:l.total,current:c,onChange:e=>o(e)},rowKey:e=>e.id})})]})}var De=a(284),ke=a(133),Ie=(a(270),a(110));const Ce={accessTokenFactory:()=>localStorage.token,transport:1},Re={"hubs/telemetry":(new Ie.a).withUrl("http://localhost:5000/hubs/telemetry",Ce).withAutomaticReconnect().build(),"hubs/reports":(new Ie.a).withUrl("http://localhost:5000/hubs/reports",Ce).withAutomaticReconnect().build()};let Me;const Pe=async e=>{let t=Re[e];return t.state===Ie.b.Disconnected&&(Me=t.start()),t.state!==Ie.b.Connected&&await Me,t},Ee=(e,t,a="",s)=>(Pe(e).then((async e=>{a&&await e.send("AddToGroup",a),e.on(t,s)})),a?()=>{Re[e].send("RemoveFromGroup",a).finally((()=>Re[e].off(t)))}:()=>Re[e].off(t)),{RangePicker:Te}=Q.a,{Option:Le}=te.a;let Fe={from:re()("0001-01-01T00:00:00"),to:re()("9999-12-31T23:59:59.9999999")};const qe={600:"1 \u043c\u0438\u043d\u0443\u0442\u0430",86400:"1 \u0434\u0435\u043d\u044c",604800:"1 \u043d\u0435\u0434\u0435\u043b\u044f"},Ye={".pdf":"/images/pdf.png",".las":"/images/las.png"};function Ge(e){const[t,a]=Object(s.useState)([re()().subtract(1,"days"),re()()]),[l,r]=Object(s.useState)(600),[c,o]=Object(s.useState)(0),[d,j]=Object(s.useState)(0),[h,m]=Object(s.useState)([]),[x,O]=Object(s.useState)(!1);let y=Object(n.h)().id;const g=[{title:"",dataIndex:"reportFormat",key:"reportFormat",render:e=>Object(p.jsx)("img",{src:Ye[e],width:"50",alt:e})},{title:"\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043e\u0442\u0447\u0435\u0442\u0430",dataIndex:"reportParams",key:"reportParams"},{title:"\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u0447\u0435\u0442\u0430",dataIndex:"reportName",key:"reportName",render:e=>Object(p.jsx)("a",{onClick:t=>v(t,e),download:e,children:e})}],f=({progressData:e})=>{var t;return e=null!==(t=e)&&void 0!==t?t:{progress:0,operation:"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0442\u0447\u0435\u0442\u0430",reportName:""},Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(De.a,{percent:e.progress}),Object(p.jsx)("br",{}),Object(p.jsxs)("span",{children:[" ",e.operation," "]}),Object(p.jsx)("br",{}),Object(p.jsx)("a",{onClick:t=>{v(t,e.reportName)},download:e.reportName,children:e.reportName})]})},v=async(e,a)=>{const s=e.target;if(!s.href.length)try{await fetch(`/api/report/${y}/${a}`,{headers:{Authorization:"Bearer "+localStorage.token}}).then((async e=>{const t=await e.blob();let a=new FileReader;a.readAsDataURL(t),a.onload=function(e){s.href=e.target.result,s.click()}}))}catch(l){Y(`\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u043e\u0442\u0447\u0435\u0442 \u043f\u043e \u0441\u043a\u0432\u0430\u0436\u0438\u043d\u0435 (${y}) c \n ${t[0].format("DD.MM.YYYY hh:mm:ss")} \u043f\u043e \n ${t[1].format("DD.MM.YYYY hh:mm:ss")}`,"error"),console.log(l)}};return Object(s.useEffect)((()=>{!async function(){let e=t[0].toISOString(),a=t[1].toISOString();try{let t=await M.getReportSize(y,l,c,e,a);j(t)}catch(s){Y(`\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u0442\u0447\u0435\u0442\u0430 c \n ${t[0].format("DD.MM.YYYY hh:mm:ss")} \u043f\u043e \n ${t[1].format("DD.MM.YYYY hh:mm:ss")}`,"error"),console.log(s)}finally{O(!1)}}()}),[t,l,c]),Object(s.useEffect)((()=>{!async function(){let e=t[0].toISOString(),a=t[1].toISOString();try{O(!0);let t=(await M.getSuitableReportsNames(y,l,c,e,a)).map((e=>({key:e.id,reportFormat:e.format,reportParams:`\u0414\u0430\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f: ${new Date(e.date).toLocaleDateString()}, \n \u0414\u0430\u043d\u043d\u044b\u0435 \u043e\u0442 ${new Date(e.begin).toLocaleString()} \n \u0434\u043e ${new Date(e.end).toLocaleString()}, \n \u0428\u0430\u0433: ${qe[e.step]}`,reportName:e.name})));m(t)}catch(s){Y(`\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u043f\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c \u043e\u0442\u0447\u0435\u0442\u044b c \n ${t[0].format("DD.MM.YYYY hh:mm:ss")} \u043f\u043e \n ${t[1].format("DD.MM.YYYY hh:mm:ss")}`,"error"),console.log(s)}finally{O(!1)}}()}),[t,l,c]),Object(s.useEffect)((()=>{!async function(){let e=await M.getReportsDateRange(y);Fe.from=re()(e.from),Fe.to=re()(e.to)}()}),[]),Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)("div",{className:"w-100 mt-20px",children:Object(p.jsx)(b.a,{layout:"vertical",name:"reportForm",initialValues:{remember:!0},onFinish:async e=>{let a=t[0].toISOString(),s=t[1].toISOString();try{const t=await M.createReport(y,e.step,e.format,a,s);if(!t)return;const l=Ee("hubs/reports","GetReportProgress",`Report_${t}`,(e=>{var a;e&&(i.a.open({key:t,message:"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0442\u0447\u0435\u0442\u0430:",description:Object(p.jsx)(f,{progressData:e}),duration:0}),(null===(a=e.reportName)||void 0===a?void 0:a.length)&&l())}))}catch(l){Y(`\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0442\u0447\u0435\u0442 \u043f\u043e \u0441\u043a\u0432\u0430\u0436\u0438\u043d\u0435 (${y}) c \n ${t[0].format("DD.MM.YYYY hh:mm:ss")} \u043f\u043e \n ${t[1].format("DD.MM.YYYY hh:mm:ss")}`,"error"),console.log(l)}},children:Object(p.jsxs)("div",{className:"d-flex",children:[Object(p.jsx)(b.a.Item,{label:"\u0414\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0434\u0430\u0442 \u043e\u0442\u0447\u0435\u0442\u0430",name:"period",initialValue:[t[0],t[1]],children:Object(p.jsx)(Te,{disabledDate:function(e){return Fe.From>=e||Fe.To<=e},allowClear:!1,onCalendarChange:(e,t,s)=>{a([re()(t[0]),re()(t[1])])},locale:_.a,showTime:!0})}),Object(p.jsx)(b.a.Item,{label:"\u0428\u0430\u0433 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432",name:"step",initialValue:l,className:"ml-30px",children:Object(p.jsxs)(te.a,{onChange:e=>r(e),children:[Object(p.jsx)(Le,{value:600,children:"1 \u043c\u0438\u043d\u0443\u0442\u0430"}),Object(p.jsx)(Le,{value:86400,children:"1 \u0434\u0435\u043d\u044c"}),Object(p.jsx)(Le,{value:604800,children:"1 \u043d\u0435\u0434\u0435\u043b\u044f"})]})}),Object(p.jsx)(b.a.Item,{label:"\u0424\u043e\u0440\u043c\u0430\u0442 \u043e\u0442\u0447\u0435\u0442\u0430",name:"format",initialValue:c,onChange:e=>o(e.target.value),className:"ml-30px",children:Object(p.jsxs)(ke.a.Group,{children:[Object(p.jsx)(ke.a.Button,{value:0,children:"PDF"}),Object(p.jsx)(ke.a.Button,{value:1,children:"LAS"})]})}),Object(p.jsxs)(u.a,{type:"primary",htmlType:"submit",className:"mt-30px ml-30px",children:[Object(p.jsx)("span",{children:"\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0430\u043f\u043e\u0440\u0442"}),Object(p.jsxs)("span",{className:"ml-5px",children:["(",d," \u0441\u0442\u0440.)"]}),Object(p.jsx)("span",{style:{display:d>100?"inline":"none"},className:"ml-5px",children:"!!!"})]})]})})}),Object(p.jsx)("br",{}),Object(p.jsx)("h3",{children:"\u041e\u0442\u0447\u0435\u0442\u044b \u0441 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0434\u043b\u044f \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f:"})," ",Object(p.jsx)("br",{}),Object(p.jsx)(L,{show:x,children:Object(p.jsx)(F.a,{dataSource:h,columns:g})})]})}function We(e){return Object(p.jsxs)("div",{className:"menu_title",children:[Object(p.jsx)("h2",{children:"\u0410\u043d\u0430\u043b\u0438\u0437"}),Object(p.jsx)("hr",{})]})}function He(e,t){let a=null===e||void 0===e?void 0:e.datasets.find((e=>e.label===t.label));if(!a){var s,l,r,c,o,n,i;let d=null!==(s=null!==(l=null!==(r=t.borderColor)&&void 0!==r?r:t.backgroundColor)&&void 0!==l?l:t.color)&&void 0!==s?s:"#"+Math.floor(16777215*Math.random()).toString(16);a={label:t.label,data:[],backgroundColor:null!==(c=t.backgroundColor)&&void 0!==c?c:d,borderColor:null!==(o=t.borderColor)&&void 0!==o?o:d,borderWidth:null!==(n=t.borderWidth)&&void 0!==n?n:1,borderDash:null!==(i=t.dash)&&void 0!==i?i:[],showLine:t.showLine},e.datasets.push(a)}return a}const Ve=e=>{const[t,a]=Object(s.useState)({data:{datasets:[]},yStart:new Date});Object(s.useEffect)((()=>{(null===e||void 0===e?void 0:e.lines)&&(null===e||void 0===e?void 0:e.data)&&0!==e.lines.length&&0!==e.data.length&&a((t=>(e.lines.forEach((a=>{let s=He(t.data,a),l=e.data.map((e=>{var t;return{x:null!==(t=a.xConstValue)&&void 0!==t?t:e[a.xAccessorName],label:e[a.xAccessorName],y:new Date(e[a.yAccessorName])}})),r=[...s.data,...l];(null===l||void 0===l?void 0:l.length)>2&&r.sort(((e,t)=>e.y>t.y?1:-1)),r.length>1024&&r.splice(0,1024-r.length),s.data=r})),t.yStart=new Date,t.yStart.setSeconds(t.yStart.getSeconds()-e.interval),t.yInterval=e.interval,t.displayLabels=e.yDisplay,t)))}),[e.data,e.lines,e.interval,e.yDisplay]);return Object(p.jsx)(ie,{dataParams:t,options:{plugins:{legend:{display:!1},datalabels:{backgroundColor:"transparent",borderRadius:4,color:"#000B",display:function(e){return"wellDepth"===e.dataset.label&&"auto"},formatter:function(e,t){return`${e.y.toLocaleTimeString()} ${e.label.toPrecision(4)}`},padding:6,align:"left",anchor:"center",clip:!0}}}})};var ze=a(178),Ke=a(179);const Ue=({prefix:e,value:t,suffix:a,isArrowVisible:l})=>{const[r,c]=Object(s.useState)(NaN),[o,n]=Object(s.useState)("---"),[i,d]=Object(s.useState)(0);Object(s.useEffect)((()=>{if(t)if(Number.isFinite(+t)){var e;if(l){let e=0;t>r&&(e=1),t<r&&(e=-1),d(e),c(t)}n(null!==(e=(+t).toPrecision(4))&&void 0!==e?e:"---")}else n(t)}),[t,l,r]);let b=null;switch(i){case 1:b=Object(p.jsx)(ze.a,{style:{color:"red"}});break;case-1:b=Object(p.jsx)(Ke.a,{style:{color:"red"}})}return Object(p.jsxs)("span",{className:"display_value",children:[e," ",o," ",a,b]})},Qe=e=>{const{label:t}=e;return Object(p.jsxs)("div",{className:e.className,children:[Object(p.jsx)("div",{className:"display_label",children:t}),Object(p.jsx)("div",{style:{display:"flex",flexGrow:1},children:Object(p.jsx)(Ue,{...e})})]})};var $e=a(289);const Ze=e=>{const{data:t,lineIdle:a,lineSp:s,linesOther:l}=e;let r=null,c=null;t&&s&&(r=t[s.xAccessorName]),t&&a&&(c=t[a.xAccessorName]);let o=Object(p.jsx)(Ue,{value:r}),n=null===l||void 0===l?void 0:l.map((e=>{let a=null;return t&&(a=t[e.xAccessorName]),Object(p.jsxs)("div",{children:[e.label,Object(p.jsx)(Ue,{value:a})]},e.label)}));return o=n?Object(p.jsx)(se.a,{content:n,children:Object(p.jsxs)("div",{className:"chart-footer",children:[Object(p.jsx)($e.a,{className:"display_label"}),o]})}):Object(p.jsx)("div",{style:{display:"flex"},children:o}),Object(p.jsxs)("div",{children:[o,Object(p.jsxs)("div",{style:{display:"flex"},children:[Object(p.jsx)("span",{className:"display_label",children:"\u0445.\u0445."}),Object(p.jsx)(Ue,{value:c})]})]})},Be=({data:e})=>{const t=e[e.length-1],a=[{label:"\u0420\u043e\u0442., \u043e\u0431/\u043c\u0438\u043d",accessorName:"rotorSpeed"},{label:"\u0414\u043e\u043b\u043e\u0442\u043e, \u043c",accessorName:"bitDepth"},{label:"\u0417\u0430\u0431\u043e\u0439, \u043c",accessorName:"wellDepth"},{label:"\u0420\u0430\u0441\u0445\u043e\u0434, \u043c\xb3/\u0447",accessorName:"flow"},{label:"\u0420\u0430\u0441\u0445\u043e\u0434 \u0445.\u0445., \u043c\xb3/\u0447",accessorName:"flowIdle"}];return t?a.forEach((e=>{var a,s;return e.value=null!==(a=null===(s=t[e.accessorName])||void 0===s?void 0:s.toPrecision(4))&&void 0!==a?a:"-"})):a.forEach((e=>e.value="-")),Object(p.jsx)(p.Fragment,{children:a.map((e=>Object(p.jsx)(Qe,{className:"border_small display_flex_container",label:e.label,value:e.value,suffix:e.units},e.label)))})},Je=({data:e})=>{const t=e[e.length-1],a=[{label:"\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c",accessorName:"user"}];return t?a.forEach((e=>{var a;return e.value=null!==(a=t[e.accessorName])&&void 0!==a?a:"-"})):a.forEach((e=>e.value="-")),Object(p.jsx)(p.Fragment,{children:a.map((e=>Object(p.jsx)(Qe,{className:"border_small display_flex_container user_card",label:e.label,value:e.value,suffix:e.units},e.label)))})},Xe={0:"\u0420\u0443\u0447\u043d\u043e\u0439",1:"\u0411\u0443\u0440\u0435\u043d\u0438\u0435 \u0432 \u0440\u043e\u0442\u043e\u0440\u0435",2:"\u041f\u0440\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0430",3:"\u0411\u0443\u0440\u0435\u043d\u0438\u0435 \u0432 \u0441\u043b\u0430\u0439\u0434\u0435",4:"\u0421\u043f\u0443\u0441\u043a \u0421\u041f\u041e",5:"\u041f\u043e\u0434\u044a\u0435\u043c \u0421\u041f\u041e",6:"\u041f\u043e\u0434\u044a\u0435\u043c \u0441 \u043f\u0440\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439",10:"\u0411\u041b\u041e\u041a\u0418\u0420\u041e\u0412\u041a\u0410"},_e=e=>{let t="---";if(e.data.length>0){var a;let s=e.data[e.data.length-1].mode;s>=0&&(t=null!==(a=Xe[s])&&void 0!==a?a:s)}return Object(p.jsxs)("div",{className:"display_header",children:[Object(p.jsx)("span",{className:"display_label",children:"\u0420\u0435\u0436\u0438\u043c:"}),Object(p.jsx)("span",{className:"display_value",children:t})]})},{Option:et}=te.a,tt=[7,3],at=[{label:"\u0412\u044b\u0441\u043e\u0442\u0430 \u0431\u043b\u043e\u043a\u0430",yDisplay:!1,linePv:{label:"blockPosition",units:"\u043c",xAccessorName:"blockPosition",yAccessorName:"date",color:"#333"},lineOther:{label:"wellDepth",units:"\u043c",xAccessorName:"wellDepth",yAccessorName:"date",color:"#333",showLine:!1,xConstValue:30}},{label:"\u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0431\u043b\u043e\u043a\u0430",yDisplay:!1,linePv:{label:"blockSpeed",units:"\u043c/\u0447",xAccessorName:"blockSpeed",yAccessorName:"date",color:"#0a0"},lineSp:{label:"blockSpeedSp",units:"\u043c/\u0447",xAccessorName:"blockSpeedSp",yAccessorName:"date",color:"#0a0"}},{label:"\u0414\u0430\u0432\u043b\u0435\u043d\u0438\u0435",yDisplay:!1,linePv:{label:"pressure",units:"\u0430\u0442\u043c",xAccessorName:"pressure",yAccessorName:"date",color:"#c00"},lineSp:{label:"pressureSp",units:"\u0430\u0442\u043c",xAccessorName:"pressureSp",yAccessorName:"date",color:"#c00"},lineIdle:{label:"pressureIdle",units:"\u0430\u0442\u043c",xAccessorName:"pressureIdle",yAccessorName:"date",color:"#c00"},linesOther:[{label:"\u043c\u0435\u043a\u0441. \u043f\u0435\u0440\u0435\u043f\u0430\u0434",units:"\u0430\u0442\u043c",xAccessorName:"pressureDeltaLimitMax",yAccessorName:"date",color:"#c00"}]},{label:"\u041e\u0441\u0435\u0432\u0430\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430",yDisplay:!1,linePv:{label:"axialLoad",units:"\u0442",xAccessorName:"axialLoad",yAccessorName:"date",color:"#00a"},lineSp:{label:"axialLoadSp",units:"\u0442",xAccessorName:"axialLoadSp",yAccessorName:"date",color:"#00a",dash:tt},linesOther:[{label:"axialLoadLimitMax",units:"\u0442",xAccessorName:"axialLoadLimitMax",yAccessorName:"date",color:"#00a"}]},{label:"\u0412\u0435\u0441 \u043d\u0430 \u043a\u0440\u044e\u043a\u0435",yDisplay:!1,linePv:{label:"hookWeight",units:"\u0442",xAccessorName:"hookWeight",yAccessorName:"date",color:"#0aa"},lineIdle:{label:"hookWeightIdle",units:"\u0442",xAccessorName:"hookWeightIdle",yAccessorName:"date",color:"#0aa",dash:tt},linesOther:[{label:"hookWeightLimitMin",units:"\u0442",xAccessorName:"hookWeightLimitMin",yAccessorName:"date",color:"#0aa"},{label:"hookWeightLimitMax",units:"\u0442",xAccessorName:"hookWeightLimitMax",yAccessorName:"date",color:"#0aa"}]},{label:"\u041c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430 \u0440\u043e\u0442\u043e\u0440\u0435",yDisplay:!1,linePv:{label:"rotorTorque",units:"\u043a\u041d\xb7\u043c",xAccessorName:"rotorTorque",yAccessorName:"date",color:"#a0a"},lineSp:{label:"rotorTorqueSp",units:"\u043a\u041d\xb7\u043c",xAccessorName:"rotorTorqueSp",yAccessorName:"date",color:"#a0a"},lineIdle:{label:"rotorTorqueIdle",units:"\u043a\u041d\xb7\u043c",xAccessorName:"rotorTorqueIdle",yAccessorName:"date",color:"#a0a"},linesOther:[{label:"rotorTorqueLimitMax",units:"\u043a\u041d\xb7\u043c",xAccessorName:"rotorTorqueLimitMax",yAccessorName:"date",color:"#a0a"}]}],st=({lineGroup:e,data:t,interval:a})=>{var s;let l=[e.linePv];e.lineSp&&l.push(e.lineSp),e.lineOther&&l.push(e.lineOther);let r=null,c=null;var o;(null===t||void 0===t?void 0:t.length)>0&&(r=t[t.length-1],e.linePv&&(c=r[null===(o=e.linePv)||void 0===o?void 0:o.xAccessorName]));return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(Qe,{label:e.label,value:c,suffix:null===(s=e.linePv)||void 0===s?void 0:s.units,isArrowVisible:!0}),Object(p.jsx)(Ve,{data:t,yDisplay:e.yDisplay,lines:l,interval:a}),Object(p.jsx)(Ze,{data:r,...e})]})},lt={1:{title:"\u0410\u0432\u0430\u0440\u0438\u044f"},2:{title:"\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435"},3:{title:"\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f"}},rt=[{title:"\u0414\u0430\u0442\u0430",dataIndex:"date",render:e=>re()(e).format("DD MMM YYYY, HH:MM:ss"),sorter:(e,t)=>new Date(t.date)-new Date(e.date),sortDirections:["descend","ascend"]},{title:"\u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f",dataIndex:"categoryId",render:(e,t)=>lt[t.categoryId].title,style:(e,t)=>lt[t.categoryId].style,sorter:(e,t)=>e.categoryId-t.categoryId,sortDirections:["descend","ascend"]},{title:"\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435",dataIndex:"message",onFilter:(e,t)=>0===t.name.indexOf(e)},{title:"\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c",dataIndex:"user"}];function ct(e){let{id:t}=Object(n.h)();const[a,l]=Object(s.useState)([]),[r,c]=Object(s.useState)(600),[o,i]=Object(s.useState)([]),[d,b]=Object(s.useState)(!1),j=e=>{e&&l(e)},u=e=>{e&&i(e.items.splice(0,4))};Object(s.useEffect)((()=>{b(!0);let e=C.getData(t).then(j).catch((e=>{Y(`\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u0441\u043a\u0432\u0430\u0436\u0438\u043d\u0435 "${t}"`,"error"),console.log(e)})),a=R.getMessage(t).then(u).catch((e=>{Y(`\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043f\u043e \u0441\u043a\u0432\u0430\u0436\u0438\u043d\u0435 "${t}"`,"error"),console.log(e)}));Promise.all([e,a]).then((()=>b(!1)));let s=Ee("hubs/telemetry","ReceiveDataSaub",`well_${t}`,j),l=Ee("hubs/telemetry","ReceiveMessages",`well_${t}`,u);return()=>{s(),l()}}),[t]),Object(s.useEffect)((()=>{b(!0),C.getData(t,null,r).then(j).catch((e=>console.error(e))).finally((()=>b(!1)))}),[t,r]);const h=24/at.length;return Object(p.jsxs)(L,{show:d,children:[Object(p.jsxs)(J.a,{style:{marginBottom:"1rem"},children:[Object(p.jsx)($.a,{children:Object(p.jsx)(_e,{data:a})}),Object(p.jsx)("span",{style:{flexGrow:.1},children:"\xa0"}),Object(p.jsxs)($.a,{children:["\u0418\u043d\u0442\u0435\u0440\u0432\u0430\u043b:\xa0",Object(p.jsxs)(te.a,{defaultValue:"600",onChange:c,children:[Object(p.jsx)(et,{value:"600",children:"10 \u043c\u0438\u043d\u0443\u0442"}),Object(p.jsx)(et,{value:"1800",children:"30 \u043c\u0438\u043d\u0443\u0442"}),Object(p.jsx)(et,{value:"3600",children:"1 \u0447\u0430\u0441"}),Object(p.jsx)(et,{value:"21600",children:"6 \u0447\u0430\u0441"}),Object(p.jsx)(et,{value:"86400",children:"1 \u0434\u0435\u043d\u044c"})]})]}),Object(p.jsx)("span",{style:{flexGrow:1},children:"\xa0"}),Object(p.jsx)($.a,{children:Object(p.jsx)(Je,{data:a})})]}),Object(p.jsxs)(J.a,{children:[Object(p.jsx)($.a,{span:2,children:Object(p.jsx)(Be,{data:a})}),Object(p.jsx)($.a,{span:22,children:Object(p.jsx)(J.a,{children:at.map((e=>Object(p.jsx)($.a,{span:h,className:"border_small",children:Object(p.jsx)(st,{data:a,lineGroup:e,interval:r})},e.label)))})})]}),Object(p.jsx)(F.a,{showHeader:!1,columns:rt,dataSource:o,rowClassName:e=>`event_message_${e.categoryId} event_message`,className:"message_table",size:"small",pagination:!1,rowKey:e=>e.id})]})}const{Content:ot}=H.a;function nt(){let{id:e}=Object(n.h)();return Object(p.jsx)(p.Fragment,{children:Object(p.jsxs)(H.a,{children:[Object(p.jsxs)(V.a,{mode:"horizontal",selectable:!0,className:"well_menu",children:[Object(p.jsx)(V.a.Item,{icon:Object(p.jsx)(z.a,{}),children:Object(p.jsx)(o.b,{to:"telemetry",children:"\u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433"})},"1"),Object(p.jsx)(V.a.Item,{icon:Object(p.jsx)(K.a,{}),children:Object(p.jsx)(o.b,{to:"message",children:"\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f"})},"2"),Object(p.jsx)(V.a.Item,{icon:Object(p.jsx)(K.a,{}),children:Object(p.jsx)(o.b,{to:"report",children:"\u0420\u0430\u043f\u043e\u0440\u0442"})},"3"),Object(p.jsx)(V.a.Item,{icon:Object(p.jsx)(K.a,{}),children:Object(p.jsx)(o.b,{to:"analysis",children:"\u0410\u043d\u0430\u043b\u0438\u0437"})},"4"),Object(p.jsx)(V.a.Item,{icon:Object(p.jsx)(K.a,{}),children:Object(p.jsx)(o.b,{to:"file",children:"\u0424\u0430\u0439\u043b\u044b"})},"5"),Object(p.jsx)(V.a.Item,{icon:Object(p.jsx)(K.a,{}),children:Object(p.jsx)(o.b,{to:"archive",children:"\u0410\u0440\u0445\u0438\u0432"})},"6")]}),Object(p.jsx)(H.a,{children:Object(p.jsx)(ot,{className:"site-layout-background",children:Object(p.jsxs)(n.d,{children:[Object(p.jsx)(n.b,{path:"/well/:id/file",children:Object(p.jsx)(U,{})}),Object(p.jsx)(n.b,{path:"/well/:id/archive",children:Object(p.jsx)(ge,{})}),Object(p.jsx)(n.b,{path:"/well/:id/message",children:Object(p.jsx)(we,{})}),Object(p.jsx)(n.b,{path:"/well/:id/report",children:Object(p.jsx)(Ge,{})}),Object(p.jsx)(n.b,{path:"/well/:id/analysis",children:Object(p.jsx)(We,{})}),Object(p.jsx)(n.b,{path:"/well/:id/telemetry",children:Object(p.jsx)(ct,{})}),Object(p.jsx)(n.b,{path:"/",children:Object(p.jsx)(n.a,{to:{pathname:`/well/${e}/telemetry`}})})]})})})]})})}var it=a(280);const dt=(e,...t)=>{let a=t[0],s=e.reduce(((e,s)=>{let l=s[a],r=e.find((e=>e.title===l));return r||(r={title:l,value:1===t.length?`${s.id}`:`${a} ${l} ${s.id}`,selectable:1===t.length,children:[]},e.push(r)),t.length>1&&r.children.push(s),e}),[]);if(t.length>1)for(let l of s)l.children=dt(l.children,...t.slice(1));return s};function bt(e){const[t,a]=Object(s.useState)([]),[l,r]=Object(s.useState)(!1),c=Object(n.g)();let{id:o}=Object(n.h)();Object(s.useEffect)((()=>{(async()=>{r(!0);try{let e=(await P.getWells()).map((e=>({key:e.id,...e}))),t=dt(e,"deposit","cluster","caption");a(t)}catch(e){Y("\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u043a\u0432\u0430\u0436\u0438\u043d","error"),console.error(`${e.message}`)}r(!1)})()}),[]);return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(it.a,{className:"header-tree-select",bordered:!1,dropdownMatchSelectWidth:!1,placeholder:"\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043c\u0435\u0441\u0442\u043e\u0440\u043e\u0436\u0434\u0435\u043d\u0438\u0435",treeData:t,treeDefaultExpandAll:!0,onSelect:e=>{e&&c.push(`/well/${e}/`),console.log(e)},value:o}),l&&Object(p.jsx)(O,{})]})}const{Header:jt}=H.a;function ut({title:e="\u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433",wellsList:t}){const a=localStorage.login;return Object(p.jsx)(H.a,{children:Object(p.jsxs)(jt,{className:"header",children:[Object(p.jsx)("img",{src:x,alt:"\u0410\u0421\u0411",className:"logo"}),Object(p.jsx)(bt,{wellsList:t}),Object(p.jsx)("h1",{className:"title",children:e}),Object(p.jsx)(o.b,{to:"/login",onClick:()=>{localStorage.removeItem("login"),localStorage.removeItem("token")},children:Object(p.jsxs)(u.a,{icon:Object(p.jsx)(h.a,{}),children:["(",a,") \u0412\u044b\u0445\u043e\u0434"]})})]})})}const{Content:ht}=H.a;function mt({title:e,children:t}){return Object(p.jsxs)(ht,{children:[Object(p.jsx)(ut,{title:e}),Object(p.jsx)(H.a,{children:Object(p.jsx)(ht,{className:"site-layout-background sheet",children:t})})]})}function xt(){return Object(p.jsxs)(n.d,{children:[Object(p.jsx)(n.b,{path:"/well/:id/",children:Object(p.jsx)(mt,{children:Object(p.jsx)(nt,{})})}),Object(p.jsx)(n.b,{path:"/well",children:Object(p.jsx)(mt,{children:Object(p.jsx)(W,{})})}),Object(p.jsx)(n.b,{path:"/",children:Object(p.jsx)(n.a,{to:{pathname:"/well"}})})]})}function pt({children:e,...t}){let a=localStorage.token;return Object(p.jsx)(n.b,{...t,render:({location:t})=>a?e:Object(p.jsx)(n.a,{to:{pathname:"/login",state:{from:t}}})})}function Ot(){return Object(p.jsx)(o.a,{children:Object(p.jsxs)(n.d,{children:[Object(p.jsx)(n.b,{path:"/login",children:Object(p.jsx)(T,{})}),Object(p.jsx)(pt,{path:"/",children:Object(p.jsx)(xt,{})})]})})}g.TOKEN=localStorage.token;var yt=e=>{e&&e instanceof Function&&a.e(3).then(a.bind(null,292)).then((({getCLS:t,getFID:a,getFCP:s,getLCP:l,getTTFB:r})=>{t(e),a(e),s(e),l(e),r(e)}))};c.a.render(Object(p.jsx)(l.a.StrictMode,{children:Object(p.jsx)(Ot,{})}),document.getElementById("root")),yt()}},[[275,1,2]]]);
//# sourceMappingURL=main.98821dab.chunk.js.map