PageSourceSearch

https://fleet.heliot.co.th/js/714-legacy.fcff1c1e.js

js heliot.co.th collected 2026-10-02 02:13:12 UTC 116,876 bytes, 2 lines download raw bytes

1(self["webpackChunkheliot_fleet_v4"]=self["webpackChunkheliot_fleet_v4"]||[]).push([[714],{73714:function(e,t,n){"use strict";n.d(t,{UF:function(){return In},Ay:function(){return Nn},km:function(){return Dn},aA:function(){return Fn},_o:function(){return On},FK:function(){return Rn},Cz:function(){return Cn}});var i=n.cw(function(e,t){function n(e){if(Array.isArray(e))return e}function i(e,t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e)){var n=[],i=!0,a=!1,r=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done);i=!0)if(n.push(o.value),t&&n.length===t)break}catch(c){a=!0,r=c}finally{try{i||null==s["return"]||s["return"]()}finally{if(a)throw r}}return n}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function r(e,t){if(e){if("string"===typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}function o(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(e,t){return n(e)||i(e,t)||r(e,t)||o()}Object.defineProperty(t,"__esModule",{value:!0});var c={"PointValueExtractor<unknown>":e=>"function"===typeof e,XYDataPoint:e=>void 0!==e&&null!==e&&c["X"](e["x"])&&"number"===typeof e["y"],X:e=>"number"===typeof e||e instanceof Date};function u(e,t,n){return Math.abs((e[0]-n[0])*(t[1]-e[1])-(e[0]-t[0])*(n[1]-e[1]))/2}function l(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var i=t.length;if(i){for(var a=0,r=0,o=0;o<i;o++)a+=t[o][0],r+=t[o][1];return[a/i,r/i]}}function d(e,t){if(2===e.length)return[[e[0]],[e[1]]];for(var n=e[0],i=e.slice(1,e.length-1),a=e[e.length-1],r=i.length/(t-2),o=[[n]],s=0;s<t-2;s++){var c=Math.floor(s*r),u=Math.floor((s+1)*r),l=i.slice(c,u);o.push(l)}return o.push([a]),o}var m=e=>{for(var t=0,n=0;n<e.length;n+=1)t+=e[n];return t/e.length},p=e=>{for(var t=m(e),n=0,i=0;i<e.length;i+=1)n+=(e[i]-t)*(e[i]-t);return Math.sqrt(n/e.length)},h=(e,t)=>{for(var n=e.length,i=new Array(n),a=0;a<n;a++)i[a]=t(e[a],a);return i},f=e=>c["PointValueExtractor<unknown>"](e)?e:t=>t[e],g=(e,t)=>{var n=f(e),i=f(t);return e=>h(e,(e,t)=>[n(e,t),i(e,t)])},v=(e,t)=>({x:e,y:t}),y=()=>({x:e=>{var t=c["XYDataPoint"](e)?e.x:e[0];return t instanceof Date?t.getTime():t},y:e=>"y"in e?e.y:e[1],toPoint:v}),_=(e,t)=>new e.constructor(t),k=function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=[],a=0,r=0;r<t;r++)a+=e[r];for(var o=t;o<=e.length;o++)(o-t)%n===0&&i.push(a/t),a+=e[o]-e[o-t];return i},w=e=>{var t=f(e.x),n=f(e.y),i=e.toPoint;return function(e,a){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(0===e.length)return e;for(var o,s=h(e,n),c=h(e,t),u=_(e,0),l=0,d=0;d<a;d++)l+=s[d];for(var m=a;m<=s.length;m++)(m-a)%r===0&&(o=i((c[m-a]+c[m-1])/2,l/a,m-a),u[u.length]=o),l+=s[m]-s[m-a];return u}},S=w(y());function b(e,t){if(e.length!=t.length)throw"Mismatched lengths";var n=e.length;0!=n&&(0==(n&n-1)?A(e,t):x(e,t))}function T(e,t){b(t,e)}function A(e,t){if(e.length!=t.length)throw"Mismatched lengths";var n=e.length;if(1!=n){for(var i=-1,a=0;a<32;a++)1<<a==n&&(i=a);if(-1==i)throw"Length is not a power of 2";for(var r=new Array(n/2),o=new Array(n/2),s=0;s<n/2;s++)r[s]=Math.cos(2*Math.PI*s/n),o[s]=Math.sin(2*Math.PI*s/n);for(var c=0;c<n;c++){var u=E(c,i);if(u>c){var l=e[c];e[c]=e[u],e[u]=l,l=t[c],t[c]=t[u],t[u]=l}}for(var d=2;d<=n;d*=2)for(var m=d/2,p=n/d,h=0;h<n;h+=d)for(var f=h,g=0;f<h+m;f++,g+=p){var v=e[f+m]*r[g]+t[f+m]*o[g],y=-e[f+m]*o[g]+t[f+m]*r[g];e[f+m]=e[f]-v,t[f+m]=t[f]-y,e[f]+=v,t[f]+=y}}}function E(e,t){for(var n=0,i=0;i<t;i++)n=n<<1|1&e,e>>>=1;return n}function x(e,t){if(e.length!=t.length)throw"Mismatched lengths";var n=e.length,i=1;while(i<2*n+1)i*=2;for(var a=new Array(n),r=new Array(n),o=0;o<n;o++){var s=o*o%(2*n);a[o]=Math.cos(Math.PI*s/n),r[o]=Math.sin(Math.PI*s/n)}for(var c=new Array(i),u=new Array(i),l=0;l<n;l++)c[l]=e[l]*a[l]+t[l]*r[l],u[l]=-e[l]*r[l]+t[l]*a[l];for(var d=n;d<i;d++)c[d]=u[d]=0;var m=new Array(i),p=new Array(i);m[0]=a[0],p[0]=r[0];for(var h=1;h<n;
1h++)m[h]=m[i-h]=a[h],p[h]=p[i-h]=r[h];for(var f=n;f<=i-n;f++)m[f]=p[f]=0;var g=new Array(i),v=new Array(i);N(c,u,m,p,g,v);for(var y=0;y<n;y++)e[y]=g[y]*a[y]+v[y]*r[y],t[y]=-g[y]*r[y]+v[y]*a[y]}function N(e,t,n,i,a,r){if(e.length!=t.length||e.length!=n.length||n.length!=i.length||e.length!=a.length||a.length!=r.length)throw"Mismatched lengths";var o=e.length;e=e.slice(),t=t.slice(),n=n.slice(),i=i.slice(),b(e,t),b(n,i);for(var s=0;s<o;s++){var c=e[s]*n[s]-t[s]*i[s];t[s]=t[s]*n[s]+e[s]*i[s],e[s]=c}T(e,t);for(var u=0;u<o;u++)a[u]=e[u]/o,r[u]=t[u]/o}var R=e=>{var t=e.length-1;if(t<1)return[];for(var n=new Array(t),i=0;i<t;i++)n[i]=e[i+1]-e[i];return n},F=e=>p(R(e)),D=e=>{for(var t,n,i=e.length,a=m(e),r=0,o=0,s=0;s<i;s++)t=e[s]-a,n=t*t,r+=n*n,o+=n;return i*r/(o*o)},C=(e,t,n,i,a,r)=>{while(e<=t){var o=Math.round((e+t)/2),s=k(n,o,1),c=D(s);if(c>=a){var u=F(s);u<i&&(r=o,i=u),e=o+1}else t=o-1}return r},O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.2,n=e.length;if(n<=1)return[[],0];var i=0,a=[];if(e.length>1)for(var r=e[1]>e[0],o=1,s=2;s<e.length;s+=1)!r&&e[s]>e[s-1]?(o=s,r=!r):r&&e[s]>e[o]?o=s:r&&e[s]<e[s-1]&&(o>1&&e[o]>t&&(a.push(o),e[o]>i&&(i=e[o])),r=!r);if(a.length<=1)for(var c=2;c<n;c+=1)a.push(c);return[a,i]},I=(e,t)=>{for(var n=e.length,i=m(e),a=Math.pow(2,Math.trunc(Math.log2(n))+1),r=new Array(a).fill(0),o=new Array(a).fill(0),c=0;c<n;c+=1)r[c]=e[c]-i;b(r,o);for(var u=0;u<r.length;u+=1)r[u]=Math.pow(r[u],2)+Math.pow(o[u],2),o[u]=0;T(r,o);for(var l=[],d=1;d<t;d++)l[d]=r[d]/r[0];var p=O(l),h=s(p,2),f=h[0],g=h[1];return{correlations:l,peaks:f,maxCorrelation:g}},M=e=>{var t=f(e.y),n=w(e);return function e(i,a){if(0===i.length)return i;if(a<=0)throw new Error("Supplied non-positive resolution parameter to ASAP: ".concat(a));if(i.length>=2*a){var r=Math.trunc(i.length/a);return e(n(i,r,r),a)}for(var o=h(i,t),s=I(o,Math.round(o.length/10)),c=s.correlations,u=s.peaks,l=s.maxCorrelation,d=D(o),m=F(o),p=1,f=1,g=-1,v=o.length/10,y=u.length-1;y>=0;y-=1){var _=u[y];if(_<f||1===_)break;if(!(Math.sqrt(1-c[_])*p>Math.sqrt(1-c[p])*_)){var w=k(o,_,1),S=D(w),b=F(w);S>=d&&(b<m&&(m=b,p=_),f=Math.round(Math.max(_*Math.sqrt((l-1)/(c[_]-1)),f)),g<0&&(g=y))}}return g>0&&(g<u.length-2&&(v=u[g+1]),f=Math.max(f,u[g]+1)),p=C(f,v,o,m,d,p),n(i,p,1)}},Y=M(y());function L(e){for(var t=e.length,n=[0],i=1,a=e[0][0],r=1;r<t-1;r++){var o=e[r],s=e[r+1],c=l(...s);if(void 0!==c){for(var d=-1,m=-1,p=0;p<o.length;p++){var h=o[p],f=u(a,h,c);f>d&&(d=f,m=p)}a=o[m],n.push(i+m),i+=o.length}}return n.push(i),n}var P=e=>{var t=g(e.x,e.y);return(e,n)=>{if(n<0)throw new Error("Supplied negative desiredLength parameter to LTTB: ".concat(n));var i=e.length;if(i<=1||i<=n)return e;for(var a=t(e),r=d(a,n),o=L(r),s=_(e,o.length),c=0;c<o.length;c++)s[c]=e[o[c]];return s}},q=P(y()),B=(e,t)=>{var n=e[t],i=e[t+1];if(!n||!i)throw new Error("Bucket index out of range for merging: ".concat(t," (allowed indexes are 0 - ").concat(e.length-2));var a=[...n,...i],r=e.slice();return r.splice(t,2,a),r},H=(e,t)=>{var n=e[t];if(!n)throw new Error("Bucket index out of range for splitting: ".concat(t," (allowed indexes are 0 - ").concat(e.length-1));var i=n.length;if(i<2)return e;var a=Math.ceil(i/2),r=n.slice(0,a),o=n.slice(a),s=e.slice();return s.splice(t,1,r,o),s},j=e=>{for(var t=e.length,n=0,i=0,a=0;a<t;a++)n+=e[a][0],i+=e[a][1];n/=t,i/=t;
1for(var r=0,o=0,c=0;c<t;c++){var u=s(e[c],2),l=u[0],d=u[1];r+=(l-n)*(d-i),o+=(l-n)*(l-n)}var m=r/o,p=i-m*n;return[m,p]},V=e=>{for(var t=j(e),n=s(t,2),i=n[0],a=n[1],r=0,o=0;o<e.length;o++){var c=e[o],u=c[1]-(i*c[0]+a);r+=u*u}return r},W=e=>{for(var t=[0],n=1;n<e.length-1;n++){var i=e[n-1],a=e[n],r=e[n+1],o=[i[i.length-1],...a,r[0]];t.push(V(o))}return t.push(0),t},U=(e,t)=>{for(var n=Number.MAX_VALUE,i=void 0,a=1;a<e.length-2;a++)a!==t&&a+1!==t&&e[a]+e[a+1]<n&&(n=e[a]+e[a+1],i=a);return i},G=(e,t)=>{for(var n=0,i=void 0,a=1;a<t.length-1;a++)e[a].length>1&&t[a]>n&&(n=t[a],i=a);return i},Q=e=>{var t=g(e.x,e.y);return(e,n)=>{if(n<0)throw new Error("Supplied negative desiredLength parameter to LTD: ".concat(n));var i=e.length;if(i<=2||i<=n)return e;for(var a=t(e),r=d(a,n),o=10*i/n,s=0;s<o;s++){var c=W(r),u=G(r,c);if(void 0===u)break;var l=U(c,u);if(void 0===l)break;r=H(r,u),r=B(r,l>u?l+1:l)}for(var m=L(r),p=m.length,h=_(e,p),f=0;f<p;f++)h[f]=e[m[f]];return h}},K=Q(y()),z=e=>{var t=g(e.x,e.y);return(e,n)=>{if(n<0)throw new Error("Supplied negative desiredLength parameter to LTOB: ".concat(n));var i=e.length;if(i<=1||i<=n)return e;var a=i/n,r=t(e),o=Math.max(2,n),s=_(e,o);s[0]=e[0],s[o-1]=e[i-1];for(var c=1;c<n-1;c++){for(var l=Math.floor(c*a),d=Math.min(i-1,(c+1)*a),m=-1,p=-1,h=l;h<d;h++){var f=r[h-1],g=r[h],v=r[h+1],y=u(f,g,v);y>m&&(m=y,p=h)}s[c]=e[p]}return s}},$=z(y()),X={ASAP:Y,LTD:K,LTOB:$,LTTB:q,SMA:S,createASAP:M,createLTD:Q,createLTOB:z,createLTTB:P,createSMA:w};t.ASAP=Y,t.LTD=K,t.LTOB=$,t.LTTB=q,t.SMA=S,t.createASAP=M,t.createLTD=Q,t.createLTOB=z,t.createLTTB=P,t.createSMA=w,t["default"]=X}),a=n(32362),r=(n(52811),n(9217)),o=n(24634),s=(n(28706),n(33771),n(44114),n(62010),n(18111),n(7588),n(9868),n(79432),n(26099),n(23500),n(69026)),c=n(24974),u=n.n(c),l=n(75642),d=n(25979),m=n(65045),p=n(67182);const h=Object.prototype.toString;function f(e,t){return h.call(e)===`[object ${t}]`}function g(e){return f(e,"Object")}function v(e){return Boolean(e&&e.then&&"function"===typeof e.then)}function y(e){return e&&e.Math==Math?e:void 0}const _="object"==typeof globalThis&&y(globalThis)||"object"==typeof window&&y(window)||"object"==typeof self&&y(self)||"object"==typeof n.g&&y(n.g)||function(){return this}()||{};function k(e,t,n){const i=n||_,a=i.__SENTRY__=i.__SENTRY__||{},r=a[e]||(a[e]=t());return r}function w(){const e=_,t=e.crypto||e.msCrypto;let n=()=>16*Math.random();try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(n=()=>{const e=new Uint8Array(1);return t.getRandomValues(e),e[0]})}catch(i){}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,e=>(e^(15&n())>>e/4).toString(16))}function S(e){return Array.isArray(e)?e:[e]}const b=1e3;function T(){return Date.now()/b}function A(){const{performance:e}=_;if(!e||!e.now)return T;const t=Date.now()-e.now(),n=void 0==e.timeOrigin?t:e.timeOrigin;return()=>(n+e.now())/b}const E=A();let x;(()=>{const{performance:e}=_;if(!e||!e.now)return void(x="none");const t=36e5,n=e.now(),i=Date.now(),a=e.timeOrigin?Math.abs(e.timeOrigin+n-i):t,r=a<t,o=e.timing&&e.timing.navigationStart,s="number"===typeof o,c=s?Math.abs(o+n-i):t,u=c<t;r||u?a<=c?(x="timeOrigin",e.timeOrigin):x="navigationStart":x="dateNow"})();const N="undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,R="Sentry Logger ",F=["debug","info","warn","error","log","assert","trace"],D={};function C(e){if(!("console"in _))return e();const t=_.console,n={},i=Object.keys(D);i.forEach(e=>{const i=D[e];n[e]=t[e],t[e]=i});try{return e()}finally{i.forEach(e=>{t[e]=n[e]})}}function O(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return N?F.forEach(n=>{t[n]=(...t)=>{e&&C(()=>{_.console[n](`${R}[${n}]:`,...t)})}}):F.forEach(e=>{t[e]=()=>{}}),t}const I=O(),M="production",Y="undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;var L;(function(e){const t=0;e[e["PENDING"]=t]="PENDING";const n=1;e[e["RESOLVED"]=n]="RESOLVED";const i=2;e[e["REJECTED"]=i]="REJECTED"})(L||(L={}));class P{constructor(e){P.prototype.__init.call(this),P.prototype.__init2.call(this),P.prototype.__init3.call(this),P.prototype.__init4.call(this),this._state=L.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(t){this._reject(t)}}then(e,t){return new P((n,i)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(a){i(a)}else n(t)},e=>{if(t)try{n(t(e))}catch(a){i(a)}else i(e)}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(e){return new P((t,n)=>{let i,a;return this.then(t=>{a=!1,i=t,e&&e()},t=>{a=!0,i=t,e&&e()}).then(()=>{a?n(i):t(i)})})}__init(){this._resolve=e=>{this._setResult(L.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(L.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{this._state===L.PENDING&&(v(t)?t.then(this._resolve,this._reject):(this._state=e,this._value=t,this._executeHandlers()))}}__init4(){this._executeHandlers=()=>
1{if(this._state===L.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||(this._state===L.RESOLVED&&e[1](this._value),this._state===L.REJECTED&&e[2](this._value),e[0]=!0)})}}}function q(){return k("globalEventProcessors",()=>[])}function B(e,t,n,i=0){return new P((a,r)=>{const o=e[i];if(null===t||"function"!==typeof o)a(t);else{const s=o({...t},n);Y&&o.id&&null===s&&I.log(`Event processor "${o.id}" dropped event`),v(s)?s.then(t=>B(e,t,n,i+1).then(a)).then(null,r):B(e,s,n,i+1).then(a).then(null,r)}})}function H(e){const t=new Map;return j(e,t)}function j(e,t){if(V(e)){const n=t.get(e);if(void 0!==n)return n;const i={};t.set(e,i);for(const a of Object.keys(e))"undefined"!==typeof e[a]&&(i[a]=j(e[a],t));return i}if(Array.isArray(e)){const n=t.get(e);if(void 0!==n)return n;const i=[];return t.set(e,i),e.forEach(e=>{i.push(j(e,t))}),i}return e}function V(e){if(!g(e))return!1;try{const t=Object.getPrototypeOf(e).constructor.name;return!t||"Object"===t}catch(t){return!0}}function W(e){const t=E(),n={sid:w(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>Q(n)};return e&&U(n,e),n}function U(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||E(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:w()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"===typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"===typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"===typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function G(e,t){let n={};t?n={status:t}:"ok"===e.status&&(n={status:"exited"}),U(e,n)}function Q(e){return H({sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"===typeof e.did||"string"===typeof e.did?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}function K(e){return e.transaction}const z=1;function $(e){const{spanId:t,traceId:n}=e.spanContext(),{data:i,op:a,parent_span_id:r,status:o,tags:s,origin:c}=X(e);return H({data:i,op:a,parent_span_id:r,span_id:t,status:o,tags:s,trace_id:n,origin:c})}function X(e){return Z(e)?e.getSpanJSON():"function"===typeof e.toJSON?e.toJSON():{}}function Z(e){return"function"===typeof e.getSpanJSON}function J(e){const{traceFlags:t}=e.spanContext();return Boolean(t&z)}function ee(e,t,n){const i=t.getOptions(),{publicKey:a}=t.getDsn()||{},{segment:r}=n&&n.getUser()||{},o=H({environment:i.environment||M,release:i.release,user_segment:r,public_key:a,trace_id:e});return t.emit&&t.emit("createDsc",o),o}function te(e){const t=xe();if(!t)return{};const n=ee(X(e).trace_id||"",t,Ne()),i=K(e);if(!i)return n;const a=i&&i._frozenDynamicSamplingContext;if(a)return a;const{sampleRate:r,source:o}=i.metadata;null!=r&&(n.sample_rate=`${r}`);const s=X(i);return o&&"url"!==o&&(n.transaction=s.description),n.sampled=String(J(i)),t.emit&&t.emit("createDsc",n),n}function ne(e,t){const{fingerprint:n,span:i,breadcrumbs:a,sdkProcessingMetadata:r}=t;ie(e,t),i&&oe(e,i),se(e,n),ae(e,a),re(e,r)}function ie(e,t){const{extra:n,tags:i,user:a,contexts:r,level:o,transactionName:s}=t,c=H(n);c&&Object.keys(c).length&&(e.extra={...c,...e.extra});const u=H(i);u&&Object.keys(u).length&&(e.tags={...u,...e.tags});const l=H(a);l&&Object.keys(l).length&&(e.user={...l,...e.user});const d=H(r);d&&Object.keys(d).length&&(e.contexts={...d,...e.contexts}),o&&(e.level=o),s&&(e.transaction=s)}function ae(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function re(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function oe(e,t){e.contexts={trace:$(t),...e.contexts};const n=K(t);if(n){e.sdkProcessingMetadata={dynamicSamplingContext:te(t),...e.sdkProcessingMetadata};const i=X(n).description;i&&(e.tags={transaction:i,...e.tags})}}function se(e,t){e.fingerprint=e.fingerprint?S(e.fingerprint):[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}const ce=100;class ue{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=le()}static clone(e){return e?e.clone():new ue}clone(){const e=new ue;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},e._user=this._user,e._level=this._level,e._span=this._span,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e}setClient(e){this._client=e}getClient(){return this._client}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,segment:void 0,username:void 0},this._session&&U(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const e=this._span;return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const t="function"===typeof e?e(this):e;if(t instanceof ue){const e=t.getScopeData();this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&Object.keys(e.user).length&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint.length&&(this._fingerprint=e.fingerprint),t.getRequestSession()&&(this._requestSession=t.getRequestSession()),e.propagationContext&&(this._propagationContext=e.propagationContext)}else if(g(t)){const t=e;this._tags={...this._tags,...t.tags},this._extra={...this._extra,...t.extra},this._contexts={...this._contexts,...t.contexts},t.user&&(this._user=t.user),t.level&&(this._level=t.level),t.fingerprint&&(this._fingerprint=t.fingerprint),t.requestSession&&(this._requestSession=t.requestSession),t.propagationContext&&(this._propagationContext=t.propagationContext)}return this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=le(),this}addBreadcrumb(e,t){const n="number"===typeof t?t:ce;if(n<=0)return this;const i={timestamp:T(),...e},a=this._breadcrumbs;return a.push(i),this._breadcrumbs=a.length>n?a.slice(-n):a,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){const e=this.getScopeData();return e.attachments}clearAttachments(){return this._attachments=[],this}getScopeData(){const{_breadcrumbs:e,_attachments:t,_contexts:n,_tags:i,_extra:a,_user:r,_level:o,_fingerprint:s,_eventProcessors:c,_propagationContext:u,_sdkProcessingMetadata:l,_transactionName:d,_span:m}=this;return{breadcrumbs:e,attachments:t,contexts:n,tags:i,extra:a,user:r,level:o,fingerprint:s||[],eventProcessors:c,prop
1agationContext:u,sdkProcessingMetadata:l,transactionName:d,span:m}}applyToEvent(e,t={},n=[]){ne(e,this.getScopeData());const i=[...n,...q(),...this._eventProcessors];return B(i,e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const n=t&&t.event_id?t.event_id:w();if(!this._client)return I.warn("No client configured on scope - will not capture exception!"),n;const i=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:i,...t,event_id:n},this),n}captureMessage(e,t,n){const i=n&&n.event_id?n.event_id:w();if(!this._client)return I.warn("No client configured on scope - will not capture message!"),i;const a=new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:a,...n,event_id:i},this),i}captureEvent(e,t){const n=t&&t.event_id?t.event_id:w();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(I.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}function le(){return{traceId:w(),spanId:w().substring(16)}}const de="7.120.4",me=parseFloat(de),pe=100;class he{constructor(e,t,n,i=me){let a,r;this._version=i,t?a=t:(a=new ue,a.setClient(e)),n?r=n:(r=new ue,r.setClient(e)),this._stack=[{scope:a}],e&&this.bindClient(e),this._isolationScope=r}isOlderThan(e){return this._version<e}bindClient(e){const t=this.getStackTop();t.client=e,t.scope.setClient(e),e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){const e=this.getScope().clone();return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}withScope(e){const t=this.pushScope();let n;try{n=e(t)}catch(i){throw this.popScope(),i}return v(n)?n.then(e=>(this.popScope(),e),e=>{throw this.popScope(),e}):(this.popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){const n=this._lastEventId=t&&t.event_id?t.event_id:w(),i=new Error("Sentry syntheticException");return this.getScope().captureException(e,{originalException:e,syntheticException:i,...t,event_id:n}),n}captureMessage(e,t,n){const i=this._lastEventId=n&&n.event_id?n.event_id:w(),a=new Error(e);return this.getScope().captureMessage(e,t,{originalException:e,syntheticException:a,...n,event_id:i}),i}captureEvent(e,t){const n=t&&t.event_id?t.event_id:w();return e.type||(this._lastEventId=n),this.getScope().captureEvent(e,{...t,event_id:n}),n}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:n,client:i}=this.getStackTop();if(!i)return;const{beforeBreadcrumb:a=null,maxBreadcrumbs:r=pe}=i.getOptions&&i.getOptions()||{};if(r<=0)return;const o=T(),s={timestamp:o,...e},c=a?C(()=>a(s,t)):s;null!==c&&(i.emit&&i.emit("beforeAddBreadcrumb",c,t),n.addBreadcrumb(c,r))}setUser(e){this.getScope().setUser(e),this.getIsolationScope().setUser(e)}setTags(e){this.getScope().setTags(e),this.getIsolationScope().setTags(e)}setExtras(e){this.getScope().setExtras(e),this.getIsolationScope().setExtras(e)}setTag(e,t){this.getScope().setTag(e,t),this.getIsolationScope().setTag(e,t)}setExtra(e,t){this.getScope().setExtra(e,t),this.getIsolationScope().setExtra(e,t)}setContext(e,t){this.getScope().setContext(e,t),this.getIsolationScope().setContext(e,t)}configureScope(e){const{scope:t,client:n}=this.getStackTop();n&&e(t)}run(e){const t=ge(this);try{e(this)}finally{ge(t)}}getIntegration(e){const t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(n){return Y&&I.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){const n=this._callExtensionMethod("startTransaction",e,t);if(Y&&!n){const e=this.getClient();e?I.warn("Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n"):I.warn("Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")}return n}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){const e=this.getStackTop(),t=e.scope,n=t.getSession();n&&G(n),this._sendSessionUpdate(),t.setSession()}startSession(e){const{scope:t,client:n}=this.getStackTop(),{release:i,environment:a=M}=n&&n.getOptions()||{},{userAgent:r}=_.navigator||{},o=W({release:i,environment:a,user:t.getUser(),...r&&{userAgent:r},...e}),s=t.getSession&&t.getSession();return s&&"ok"===s.status&&U(s,{status:"exited"}),this.endSession(),t.setSession(o),o}shouldSendDefaultPii(){const e=this.getClient(),t=e&&e.getOptions();return Boolean(t&&t.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:t}=this.getStackTop(),n=e.getSession();n&&t&&t.captureSession&&t.captureSession(n)}_callExtensionMethod(e,...t){const n=fe(),i=n.__SENTRY__;if(i&&i.extensions&&"function"===typeof i.extensions[e])return i.extensions[e].apply(this,t);Y&&I.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function fe(){return _.__SENTRY__=_.__SENTRY__||{extensions:{},hub:void 0},_}function ge(e){const t=fe(),n=ke(t);return we(t,e),n}function ve(){const e=fe();if(e.__SENTRY__&&e.__SENTRY__.acs){const t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return ye(e)}function ye(e=fe()){return _e(e)&&!ke(e).isOlderThan(me)||we(e,new he),ke(e)}function _e(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function ke(e){return k("hub",()=>new he,e)}function we(e,t){if(!e)return!1;const n=e.__SENTRY__=e.__SENTRY__||{};return n.hub=t,!0}new WeakMap;function Se(e){if(e)return be(e)||Ae(e)?{captureContext:e}:e}function be(e){return e instanceof ue||"function"===typeof e}const Te=["user","level","extra","contexts","tags","fingerprint","requestSession","propagationContext"];function Ae(e){return Object.keys(e).some(e=>Te.includes(e))}function Ee(e,t){return ve().captureException(e,Se(t))}function xe(){return ve().getClient()}function Ne(){return ve().getScope()}var Re=n(85149),Fe=function(e,t,n,i){var a={},r={},o={};return t.forEach(function(t){a[t.imei]=a[t.imei]||[];var c=(0,p.Lv)(n,t),u=s.A.unix(t.startTime).format("YYYY-MM-DD"),l=t.imei+"_"+u;r[l]=r[l]||0,o[l]=o[l]||0,a[t.imei][u]=a[t.imei][u]||[];var d,h,f=parseFloat((0,p.fn)(e,t.imei,t.positionDataEnd).toFixed(2)-(0,p.fn)(e,t.imei,t.positionDataStart).toFixed(2));
1r[l]=parseFloat((f+r[l]).toFixed(2)),o[l]=t.stopTime-t.startTime+o[l],h="undefined"!=typeof t.mcr_license_no?t.mcr_license_no:"";var g=t.mcr_driver_name||"";d=[(0,p.NS)(e,t.imei),(0,p.ZD)(e,t.imei),(0,p.Yq)(t.startTime),(0,p.Yq)(t.stopTime),(0,p.a3)(t.startTime,t.stopTime),parseFloat((0,p.fn)(e,t.imei,t.positionDataEnd).toFixed(2)),f,c.start,c.end,"undefined"!=typeof i&&h in i?i[h].name:(0,p.Cb)(h,g),t.maxSpeed?parseFloat(t.maxSpeed).toFixed(1):"",t.avgSpeed?parseFloat(t.avgSpeed).toFixed(1):"",(0,m.lO)(t.positionDataStart.io),(0,m.lO)(t.positionDataEnd.io),t.startTime,t.stopTime,u,r[l],o[l]],a[t.imei][u].push(d)}),a},De=function(e,t,n,i,a,r){var o=Fe(t,n,i,a),s=[];s=["ทะเบียนรถ","ชื่อ","วัน เวลา เริ่มต้น","วัน เวลา สิ้นสุด","รวมเวลา","เลขกม.สะสม","รวมระยะทาง (กม.)","ตำแหน่งเริ่มต้น","ตำแหน่งสิ้นสุด","ผู้ใช้รถ","ความเร็วสูงสุด","ความเร็วเฉลี่ย","อุณหภูมิเริ่มต้น","อุณหภูมิสิ้นสุด","timestamp เริ่มต้น","timestamp สิ้นสุด"];var c=[{key:"plate_number",width:10,style:{font:p.Rv}},{key:"name",width:22,style:{numFmt:"0"}},{key:"start",width:20},{key:"stop",width:20},{key:"totalTime",width:8},{key:"totolStopTime",width:14},{key:"totolMovingTime",width:14},{key:"totolIdlingTime",width:14},{key:"cumOdometer",width:12},{key:"totalDistance",width:16},{key:"geolocationstart",width:40},{key:"geolocationend",width:40},{key:"driver",width:15},{key:"maxSpeed",width:8},{key:"avgSpeed",width:8},{key:"startTemp",width:12},{key:"stopTemp",width:12},{key:"timeStampStart",width:20},{key:"timeStampStop",width:20}];Oe({fileName:e,reportByVehicle:o,tableHead:s,columnsSpec:c,statusColumn:null,logo:r})},Ce=function(){var e=(0,o.A)((0,r.A)().m(function e(t,n,i,a,c,u,m,p){var h;return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:return h=s.A.unix(a).format("D_MMM_YY")+"-ถึง-"+s.A.unix(c).format("D_MMM_YY"),e.n=1,l.A.post("".concat(d.Ay.coreApi,"/report-trip-24-hr"),{eventType:"END_TRIP",imeis:i,start:a,stop:c}).then(function(){var e=(0,o.A)((0,r.A)().m(function e(t){var i;return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:i="Trip24hr_Report_"+h,De(i,n,t.data,u,m,p);case 1:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}()).catch(function(e){console.log("An error occurred:",e),Ee(e),Re.A.dispatch("loading/setReportLoading",!1)});case 1:return e.a(2)}},e)}));return function(t,n,i,a,r,o,s,c){return e.apply(this,arguments)}}(),Oe=function(){var e=(0,o.A)((0,r.A)().m(function e(t){var n,i,a,o,c,l,d,m,h,f,g;return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:if(n=t.fileName,i=t.reportByVehicle,a=t.tableHead,o=t.columnsSpec,c=t.statusColumn,l=t.logo,d=new(u().Workbook),m={properties:{tabColor:{argb:"FF41C173"}},pageSetup:{paperSize:9,orientation:"landscape"}},!l||!l.url){e.n=2;break}return f=l.ext.substring(1),e.n=1,(0,p.kX)(l);case 1:g=e.v,h=d.addImage({base64:g,extension:f});case 2:Object.keys(i).length>
10?Object.keys(i).forEach(function(e){var t=0,n=null,r="",u=0,f=0,g=0,v="",y="",_=1;Object.keys(i[e]).forEach(function(k,w){var S=i[e][k];0==t&&(r=S[0][0],n=d.addWorksheet(r,m),n.pageSetup.margins=p.Yy,n.columns=o,l&&l.url&&0==w&&(_=2,(0,p.U0)(n,h)));var b=S[S.length-1][17],T=(0,s.A)("1970-01-01").startOf("day").seconds(S[S.length-1][18]).format("HH:mm:ss");v="รายงานการเดินทาง (ตัดเที่ยงคืน) ของ พาหนะทะเบียน ".concat(r," เวลาเริ่ม ").concat(S[0][2]," ถึง ").concat(S[S.length-1][3]),y="รวมระยะทางทั้งสิ้น ".concat(b," กม. รวมเวลา ").concat(T," ชม.:นาที:วินาที"),f+=b,g+=S[S.length-1][18],n.addRow([v]),n.addRow([y]),n.addRow([]),n.addRow(a),n.addRows(S),n.addRow([]),n.addRow([]),c&&n.getColumn(c).eachCell(function(e){e.fill={type:"pattern",pattern:"solid",fgColor:(0,p.qY)(e.value)}}),(0,p.hK)(n,_+3+u),(0,p.LQ)(n,_+u),(0,p.LQ)(n,_+1+u,"FFA29BFC"),u=u+S.length+6,t++});var k=(0,s.A)("1970-01-01").startOf("day").seconds(g).format("HH:mm:ss");n.addRow(["รวมระทางทั้งสิ้น ".concat(f.toFixed(2)," กม. รวมเวลา ").concat(k," ชม.:นาที:วินาที")]),(0,p.LQ)(n,_+u,"FFE821AA")}):d.addWorksheet("ไม่พบข้อมูล",m),(0,p.ti)(d,n);case 3:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),Ie=Ce,Me=n(23354);n(2008),n(62062),n(26910),n(22489),n(61701),n(18237);function Ye(e){var t=e.resultsByImei,n=e.vehicles,i={};Object.keys(t).forEach(function(e){var n={};t[e].forEach(function(e){var t=s.A.unix(e.startTime).startOf("day").unix();t in n||(n[t]={count:0,speeds:[]}),n[t].count++,n[t].speeds.push(e.maxSpeed)}),i[e]=Object.keys(n).map(function(e){var t=n[e].speeds;return{date:s.A.unix(e).format("D MMM YYYY"),count:n[e].count,maxSpeed:Math.max.apply(Math,(0,Me.A)(t))}})});var a=[],r=Object.keys(i).map(function(e){var t=(0,p.NS)(n,parseInt(e)),a=i[e].reduce(function(e,t){return e+t.count},0),r=i[e].map(function(e){return e.maxSpeed});return{plateNumber:t,count:a,maxSpeed:Math.max.apply(Math,(0,Me.A)(r))}});return r.sort(function(e,t){return t.maxSpeed-e.maxSpeed}).forEach(function(e,t){a.push([t+1,e.plateNumber,e.count,e.maxSpeed])}),{columnSpec:[{key:"no",width:5,style:{numFmt:"0",font:p.Rv}},{key:"name",width:20},{key:"count",width:15},{key:"maxSpeed",width:20}],summaryByImei:Object.keys(i).map(function(e){return{title:"สรุปรายงานความเร็วเกิน ของ รถทะเบียน ".concat((0,p.NS)(n,parseInt(e))),tableHead:["ที่","วันที่","จำนวนที่เกิน","ความเร็วสูงสุด (กม./ชม.)"],tableData:i[e].map(function(e,t){return[t+1,e.date,e.count,e.maxSpeed]})}}),summaryAll:{title:"สรุปรายงานความเร็วเกินของทะเบียนรถทั้งหมด",tableHead:["ที่","ทะเบียน","จำนวนที่เกิน","ความเร็วสูงสุด (กม./ชม.)"],tableData:a}}}function Le(e){var t=e.resultsByImei,n=e.vehicles,i=e.geofences,a=e.dictOfDriver,r=[];return Object.keys(t).forEach(function(e){var o=t[e],c=(0,p.NS)(n,parseInt(e)),u=(0,p.ZD)(n,parseInt(e)),l=0,d=0,m=[];o.forEach(function(e){var t=(0,p.Lv)(i,e),r=parseFloat((e.positionDataEnd.io[65]-e.positionDataStart.io[65])/1e3);m.push([c,u,(0,p.Yq)(e.startTime),(0,p.Yq)(e.stopTime),(0,p.a3)(e.startTime,e.stopTime),parseFloat(e.maxSpeed),parseFloat((0,p.fn)(n,e.imei,e.positionDataEnd).toFixed(2)),parseFloat(r.toFixed()),t.start,t.end,"".concat(e.positionDataStart.latitude/1e7,", ").concat(e.positionDataStart.longitude/1e7),"undefined"!=typeof a&&e.mcr_license_no in a?a[e.mcr_license_no].name:(0,p.Cb)(e.mcr_license_no,e.mcr_driver_name),e.startTime,e.stopTime]),l+=r,d+=parseInt(e.stopTime-e.startTime)}),r.push({sheetName:c,title:"รายงานความเร็วเกิน ของ รถทะเบียน ".concat(c," เวลาเริ่ม ").concat((0,p.Yq)(o[0].startTime)," ถึง ").concat((0,p.Yq)(o[o.length-1].stopTime)),meta:"รวมระยะทางทั้งสิ้น ".concat(l.toFixed(1)," กม. รวมเวลา ").concat((0,s.A)("1970-01-01").startOf("day").seconds(d).format("HH:mm:ss")," ชม.:นาที:วินาที"),columnSpec:[{key:"plate_number",width:15,style:{font:p.Rv}},{key:"name",width:22,style:{numFmt:"0"}},{key:"start",width:20}
1,{key:"stop",width:20},{key:"totalTime",width:12},{key:"maxSpeed",width:20},{key:"cumOdometer",width:12},{key:"totalDistance",width:16},{key:"reversegeolocationstart",width:40},{key:"reversegeolocationend",width:40},{key:"geolocation",width:30},{key:"driver",width:15},{key:"timeStampStart",width:15},{key:"timeStampStop",width:15}],tableHead:["ทะเบียนรถ","ชื่อ","วัน เวลา เริ่มต้น","วัน เวลา สิ้นสุด","รวมเวลา","ความเร็วสูงสุด (กม./ชม.)","เลขกม.สะสม","รวมระยะทาง (กม.)","ตำแหน่งเริ่มต้น","ตำแหน่งสิ้นสุด","ละติจูด ลองจิจูด","ผู้ใช้รถ","timestamp เริ่มต้น","timestamp สิ้นสุด"],tableData:m})}),r}var Pe=function(){var e=(0,o.A)((0,r.A)().m(function e(t,n,i,a,o,c,m,h){var f,g,v,y,_,k,w,S,b,T,A,E,x;return(0,r.A)().w(function(e){while(1)switch(e.p=e.n){case 0:return e.p=0,e.n=1,l.A.post("".concat(d.Ay.coreApi,"/report-event"),{imeis:n,start:i,stop:a,eventType:"OVER_SPEED_END"}).then(function(e){return e.data.filter(function(e){return e.stopTime-e.startTime>=o})}).catch(function(e){throw e});case 1:if(f=e.v,g=new(u().Workbook),v={properties:{tabColor:{argb:"FF41C173"}},pageSetup:{paperSize:9,orientation:"landscape"}},!(f.length>0)){e.n=4;break}if(y={},f.forEach(function(e){e.imei in y||(y[e.imei]=[]),y[e.imei].push(e)}),_=Ye({resultsByImei:y,vehicles:t}),k=g.addWorksheet("สรุป",v),k.pageSetup.margins=p.Yy,k.columns=_.columnSpec,w=1,_.summaryByImei.forEach(function(e){k.addRow([e.title]),k.addRow(e.tableHead),k.addRows(e.tableData),k.addRows([[],[]]),(0,p.LQ)(k,w),(0,p.hK)(k,w+1),w=w+2+e.tableData.length+2}),k.addRow([_.summaryAll.title]),k.addRow(_.summaryAll.tableHead),k.addRows(_.summaryAll.tableData),(0,p.LQ)(k,w),(0,p.hK)(k,w+1),!h||!h.url){e.n=3;break}return b=h.ext.substring(1),e.n=2,(0,p.kX)(h);case 2:T=e.v,S=g.addImage({base64:T,extension:b});case 3:A=Le({resultsByImei:y,vehicles:t,geofences:c,dictOfDriver:m}),A.forEach(function(e){var t=1,n=g.addWorksheet(e.sheetName,v);n.pageSetup.margins=p.Yy,n.columns=e.columnSpec,h&&h.url&&(t=2,(0,p.U0)(n,S)),n.addRow([e.title]),n.addRow([e.meta]),n.addRow([]),n.addRow(e.tableHead),n.addRows(e.tableData),(0,p.hK)(n,t+3),(0,p.LQ)(n,t),(0,p.LQ)(n,t+1)}),e.n=5;break;case 4:g.addWorksheet("ไม่พบข้อมูล",v);case 5:return E="OverSpeed_Report_"+s.A.unix(i).format("D_MMM_YY")+"-ถึง-"+s.A.unix(a).format("D_MMM_YY"),e.a(2,(0,p.ti)(g,E));case 6:return e.p=6,x=e.v,console.error("getOverSpeedReport",x),Ee(x),e.a(2)}},e,null,[[0,6]])}));return function(t,n,i,a,r,o,s,c){return e.apply(this,arguments)}}(),qe=Pe,Be=n(7180),He=(n(2892),n(17711)),je=function(){var e=(0,o.A)((0,r.A)().m(function e(t,n,i,a,c,u,m,h,f){return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:return e.n=1,l.A.post("".concat(d.Ay.coreApi,"/report-positions"),{imeis:n,start:i,stop:a,customergroup:f,minSecData:"undefined"!==typeof c?Number(c):0}).then(function(){var e=(0,o.A)((0,r.A)().m(function e(n){var o,c,l,d,f;return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:console.log(n),o=We(t,n.data,u,m,0),c=s.A.unix(i).format("D_MMM_YY")+"-ถึง-"+s.A.unix(a).format("D_MMM_YY"),l="Position_Report_"+c,d=["ทะเบียนรถ","ชื่อ","วัน เวลา","สถานะ","ละติจูด","ลองจิจูด","อุณหภูมิ","PTO1","PTO2","PTO3","GSM","ดาวเทียม","ความเร็ว","ตำแหน่ง","เลขกม.สะสม","แบตเตอรี่รถยนต์","เชื้อเพลิง","เลขที่ใบขับขี่","ชื่อคนขับ","สถานะบัตร","ประเภทบัตร","AIN1","timestamp","GoogleMap","Coolant","Fuel rate","Engine hour","RPM","Fuel used","Pedal position","อุณหภูมิ2"],f=[{key:"plate_number",width:10,style:{font:p.Rv}},{key:"name",width:22,style:{numFmt:"0"}},{key:"time",width:20},{key:"engineStatus",width:15},{key:"latitude",width:12},{key:"longitude",width:12},{key:"temp",width:8},{key:"pto1",width:7},{key:"pto2",width:7},{key:"pto3",width:7},{key:"gsm",width:10},{key:"sattelite",width:10},{key:"speed",width:8},{key:"geolocation",width:40},{key:"odo",width:10},{key:"carbattery",width:14},{key:"fuel",width:8},{key:"mcr_license_no",width:12},{key:"mcr_driver_name",width:30},{key:"mcr_card_status",width:10},{key:"mcr_plt_code",width:10},{key:"io22",width:10},{key:"timestamp",width:12},{key:"GoogleMap",width:10},{key:"Coolant",width:10},{key:"FuelRate",width:10},{key:"EngineHour",width:10},{key:"RPM",width:10},{key:"Fuelused",width:10},{key:"PedalSpeed",width:10},{key:"temp2",width:8}],Ve({fileName:l,reportByVehicle:o,tableHead:d,columnsSpec:f,statusColumn:4,vehicles:t,logo:h,position:n.data});case 1:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}()).catch(function(e){console.log(e),Ee(e),Re.A.dispatch("loading/setReportLoading",!1)});case 1:return e.a(2)}},e)}));return function(t,n,i,a,r,o,s,c,u){return e.apply(this,arguments)}}(),Ve=function(){var e=(0,o.A)((0,r.A)().m(function e(t){var n,i,a,o,s,c,l,d,m,h,f,g,v;return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:if(n=t.fileName,i=t.reportByVehicle,a=t.tableHead,o=t.columnsSpec,s=t.statusColumn,c=t.vehicles,l=t.logo,d=t.position,m=new(u().Workbook),h={properties:{tabColor:{argb:"FF41C173"}},pageSetup:{paperSize:9,orientation:"landscape"}},!l||!l.url){e.n=2;break}return g=l.ext.substring(1),e.n=1,(0,p.kX)(l);case 1:v=e.v,f=m.addImage({base64:v,extension:g});case 2:Object.keys(i).length>
10?Object.keys(i).forEach(function(e){if(i[e].length>0){var t=i[e][0][0],n=m.addWorksheet(t,h);n.pageSetup.margins=p.Yy,n.columns=o;var r=c.filter(function(t){return parseFloat(t.imei)===parseFloat(e)}),u=d.filter(function(t){return t.imei===Number(e)}),g=(0,p.Gx)(r[0].odo_canbus_enable||r[0].canbus_truck_enabled,u),v=(0,p.a3)(i[e][0][22],i[e][i[e].length-1][22]),y="รายงานตำแหน่ง ของ รถทะเบียน ".concat(t," เวลาเริ่ม ").concat(i[e][0][2]," ถึง ").concat(i[e][i[e].length-1][2]),_="รวมระยะทางทั้งสิ้น ".concat(g," กม. รวมเวลา ").concat(v," ชม.:นาที:วินาที"),k=1;l&&l.url&&(k=2,(0,p.U0)(n,f)),n.addRow([y]),n.addRow([_]),n.addRow([]),n.addRow(a),n.addRows(i[e]),s&&n.getColumn(s).eachCell(function(e){e.fill={type:"pattern",pattern:"solid",fgColor:(0,p.qY)(e.value)}}),n.getColumn(13).eachCell(function(e){(0,p.rL)(e.value,r[0].overspeed_limit)&&(e.fill={type:"pattern",pattern:"solid",fgColor:(0,p.rL)(e.value,r[0].overspeed_limit)})}),n.getColumn(24).font={underline:!0,bold:!0},n.getColumn(24).alignment={horizontal:"center"},(0,p.hK)(n,k+3),(0,p.LQ)(n,k),(0,p.LQ)(n,k+1)}}):m.addWorksheet("ไม่พบข้อมูล",h),(0,p.ti)(m,n);case 3:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),We=function(e,t,n,i,a){var r={},o={},s={},c={};for(var u in e)c[e[u].imei]=e[u];return t.forEach(function(t){r[t.imei]=r[t.imei]||[];var u=c[t.imei].overspeed_limit,l=0;l=1==(0,p.DC)(e,t.imei)?t&&"fuelLitreCanbusTruck"in t&&t.fuelLitreCanbusTruck?t.fuelLitreCanbusTruck.toFixed(2):"":0==(0,p.Qt)(e,t.imei)?t&&"fuelLitre"in t&&t.fuelLitre?t.fuelLitre.toFixed(2):"":t&&"fuelLitreCanbus"in t&&t.fuelLitreCanbus?t.fuelLitreCanbus.toFixed(2):"";var d="",h=(0,m.CV)(n,t.latitude/1e7,t.longitude/1e7);d=""!=h?h:t.location?(0,He.RD)(t.location):"",t.speed>u&&(t.engineStatus="OVER_SPEED_END");var f="https://www.google.com/maps/search/?api=1&query=".concat(t.latitude/1e7,",").concat(t.longitude/1e7),g="";s[t.imei]&&("undefined"!==typeof t.mcr_license_no&&"undefined"!==typeof s[t.imei].mcr_license_no&&""===t.mcr_license_no&&s[t.imei].mcr_license_no.length>0&&(g="ออก"),"undefined"!==typeof t.mcr_license_no&&"undefined"!==typeof s[t.imei].mcr_license_no&&t.mcr_license_no.length>0&&""===s[t.imei].mcr_license_no&&(g="เข้า")),(0===parseInt(a)||!(t.imei in o)||t.timestamp-o[t.imei].timestamp>=parseInt(a))&&(r[t.imei].push([(0,p.NS)(e,t.imei),(0,p.ZD)(e,t.imei),(0,p.Yq)(t.timestamp),(0,p.t2)(t.engineStatus),t.latitude/1e7,t.longitude/1e7,(0,m.lO)(t.io),1==t.io[2]?"ใช้งาน":"",1==t.io[3]?"ใช้งาน":"",1==t.io[4]?"ใช้งาน":"",parseFloat(t.io[27]),t.satellites,parseFloat((0,p.Bd)(t.speed)),d,parseFloat((0,p.fn)(e,t.imei,t).toFixed(2)),parseFloat((0,m.dk)(t.io).toFixed(1)),isNaN(parseFloat(l))?0:parseFloat(l),t.mcr_license_no||"-",t.mcr_license_no?(0,m.EX)(!1,{device:{position:{mcr_license_no:t.mcr_license_no,mcr_driver_name:t.mcr_driver_name}}},"undefined"!=typeof i&&t.mcr_license_no in i?i[t.mcr_license_no]:null):"-",g,t.mcr_plt_code,parseFloat(t.io[22]),t.timestamp,t.value={text:"link",hyperlink:f},(0,m.VK)(c[t.imei],t.io),(0,m.HY)(c[t.imei],t.io),(0,m.n7)(c[t.imei],t.io),(0,m.wI)(c[t.imei],t.io),(0,m.AD)(c[t.imei],t.io),(0,m.EJ)(c[t.imei],t.io),(0,m.lO)(t.io,79)]),o[t.imei]=(0,Be.A)({},t)),s[t.imei]=(0,Be.A)({},t)}),r},Ue=je,Ge=n(95148),Qe=n(29486),Ke=n.n(Qe),ze=function(){var e=(0,o.A)((0,r.A)().m(function e(t,n,i,a,o,c,u){return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:return e.n=1,Ge.Vs.resetStore();case 1:return e.n=2,Ge.Vs.query({query:Ke(),variables:{imeis:n,start:i,stop:a}}).then(function(e){var n=Xe(t,e.data.positions,o,c),r=s.A.unix(i).format("D_MMM_YY")+"-ถึง-"+s.A.unix(a).format("D_MMM_YY"),l="Fuel_Report_"+r,d=["ทะเบียนรถ","ชื่อ","วัน เวลา","เชื้อเพลิง","ตำแหน่ง","สถานที่","ความเร็ว","เลขกม.สะสม","เลขที่ใบขับขี่","timestamp"],m=[{key:"plate_number",width:10,style:{font:p.Rv}},{key:"name",width:22,style:{numFmt:"0"}},{key:"time",width:20},{key:"fuel",width:12},{key:"latLng",width:24},{key:"geolocation",width:30},{key:"speed",width:8},{key:"odo",width:10},{key:"mcr_license_no",width:12},{key:"timestamp",width:12}];$e({fileName:l,reportByVehicle:n,tableHead:d,columnsSpec:m,statusColumn:!1,logo:u})}).catch(function(e){console.log(e),Ee(e),Re.A.dispatch("loading/setReportLoading",!1)});case 2:return e.a(2)}},e)}));return function(t,n,i,a,r,o,s){return e.apply(this,arguments)}}(),$e=function(){var e=(0,o.A)((0,r.A)().m(function e(t){var n,i,a,o,s,c,l,d,m,h,f;return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:if(n=t.fileName,i=t.reportByVehicle,a=t.tableHead,o=t.columnsSpec,s=t.statusColumn,c=t.logo,l=new(u().Workbook),d={properties:{tabColor:{argb:"FF41C173"}},pageSetup:{paperSize:9,orientation:"landscape"}},!c||!c.url){e.n=2;break}return h=c.ext.substring(1),e.n=1,(0,p.kX)(c);case 1:f=e.v,m=l.addImage({base64:f,extension:h});case 2:Object.keys(i).length>
10?Object.keys(i).forEach(function(e){if(i[e].length>0){var t=i[e][0][0],n=l.addWorksheet(t,d);n.pageSetup.margins=p.Yy,n.columns=o;var r=(i[e][i[e].length-1][7]-i[e][0][7]).toFixed(2),u=(0,p.a3)(i[e][0][9],i[e][i[e].length-1][9]),h="รายงานเชื้อเพลิง ของ รถทะเบียน ".concat(t," เวลาเริ่ม ").concat(i[e][0][2]," ถึง ").concat(i[e][i[e].length-1][2]),f="รวมระยะทางทั้งสิ้น ".concat(r," กม. รวมเวลา ").concat(u," ชม.:นาที:วินาที"),g=1;c&&c.url&&(g=2,(0,p.U0)(n,m)),n.addRow([h]),n.addRow([f]),n.addRow([]),n.addRow(a),n.addRows(i[e]),s&&n.getColumn(s).eachCell(function(e){e.fill={type:"pattern",pattern:"solid",fgColor:(0,p.qY)(e.value)}}),(0,p.hK)(n,g+3),(0,p.LQ)(n,g),(0,p.LQ)(n,g+1)}}):l.addWorksheet("ไม่พบข้อมูล",d),(0,p.ti)(l,n);case 3:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),Xe=function(e,t,n,i){var a={};return t.forEach(function(t){a[t.imei]=a[t.imei]||[];var r=(0,p.Yj)(n,t),o=0;o=1==(0,p.DC)(e,t.imei)?"fuelLitreCanbusTruck"in t&&null!=t.fuelLitreCanbusTruck&&!isNaN(t.fuelLitreCanbusTruck)?t.fuelLitreCanbusTruck.toFixed(2):0:0==(0,p.Qt)(e,t.imei)?"fuelLitre"in t&&!isNaN(t.fuelLitre)?t.fuelLitre.toFixed(2):0:"fuelLitreCanbus"in t&&t.fuelLitreCanbus&&!isNaN(t.fuelLitreCanbus)?t.fuelLitreCanbus.toFixed(2):0,a[t.imei].push([(0,p.NS)(e,t.imei),(0,p.ZD)(e,t.imei),(0,p.Yq)(t.timestamp),parseFloat(o),t.latitude/1e7+", "+t.longitude/1e7,r,parseFloat((0,p.Bd)(t.speed)),parseFloat((0,p.fn)(e,t.imei,t).toFixed(1)),"undefined"!=typeof i&&t.mcr_license_no in i?i[t.mcr_license_no].name:(0,p.Cb)(t.mcr_license_no,t.mcr_driver_name),t.timestamp])}),a},Ze=ze,Je=(n(50113),n(74423),n(20116),n(21699),n(2543)),et=n.n(Je),tt=n(97868),nt=i(),it=nt.LTTB,at=function(){var e=(0,o.A)((0,r.A)().m(function e(t,n,i){var a,o;return(0,r.A)().w(function(e){while(1)switch(e.p=e.n){case 0:return e.p=0,e.n=1,(0,tt.BI)([Number(t)]);case 1:return a=e.v,e.a(2,(a||[]).filter(function(e){return"FUEL_LEVEL_ALERT"===e.type&&e.message&&"number"===typeof e.message.window_start_ts&&"number"===typeof e.message.window_end_ts&&e.message.window_end_ts>=n&&e.message.window_start_ts<=i}).map(function(e){return{x:1e3*e.message.window_start_ts,x2:1e3*e.message.window_end_ts,liters:e.message.fuel_drop_liters,minutes:"number"===typeof e.message.evaluation_window_seconds?Math.round(e.message.evaluation_window_seconds/60):null}}));case 2:return e.p=2,o=e.v,console.error("getRapidDropEvents error",o),e.a(2,[])}},e,null,[[0,2]])}));return function(t,n,i){return e.apply(this,arguments)}}(),rt=function(){var e=(0,o.A)((0,r.A)().m(function e(t,n,i,a){return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:return e.n=1,Ge.Vs.resetStore();case 1:return e.n=2,Ge.Vs.query({query:Ke(),variables:{imeis:n,start:i,stop:a}}).then(function(){var e=(0,o.A)((0,r.A)().m(function e(o){var c,u,l,d,m,h,f,g,v,y,_,k;return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:if(c=o.data.positions,!(c&&c.length>0)){e.n=2;break}return u=(0,Me.A)(c.map(function(e,n){var i=(0,p.Jb)(t,e.imei,e);return{x:n,y:parseFloat(i)}})),l=it(u,1440).map(function(e){return e.x}),d=c.filter(function(e,t){return l.includes(t)}),m={VEHICLE_MOVING:[],ENGINE_IDLE:[],ENGINE_STOP:[]},h=null,f=d[0].io[65],d.map(function(e){var n=(0,p.Jb)(t,e.imei,e);return e.engineStatus&&(null!==n?(ot(h,e.engineStatus)||(m[h].push([s.A.unix(e.timestamp).valueOf()-2,e.io[22],(e.io[65]-f)/1e3,e.latitude,n,e.longitude]),m[h].push([s.A.unix(e.timestamp).valueOf()-1,null,null,null,null,null])),m[e.engineStatus].push([s.A.unix(e.timestamp).valueOf(),e.io[22],(e.io[65]-f)/1e3,e.latitude,n,e.longitude])):m[e.engineStatus].push([s.A.unix(e.timestamp).valueOf(),e.io[22],(e.io[65]-f)/1e3,e.latitude,null,e.longitude])),h=e.engineStatus,[s.A.unix(e.timestamp).valueOf(),n||0]}),Re.A.dispatch("loading/setReportLoading",!1),g=et().find(t,{imei:n}),"undefined"!==typeof g&&"odo_canbus_enable"in g||(g.odo_canbus_enable=!1),v=(0,p.Gx)(g.odo_canbus_enable||g.canbus_truck_enabled,d),e.n=1,at(n,i,a);case 1:return y=e.v,_=[{name:"รถวิ่ง",data:m["VEHICLE_MOVING"]},{name:"จอดติดเครื่อง",data:m["ENGINE_IDLE"]},{name:"รถจอด",data:m["ENGINE_STOP"]}],k=v,e.a(2,{rapidDropEvents:y,chartData:_,totalDistance:k});case 2:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}()).catch(function(e){console.log(e),Re.A.dispatch("loading/setReportLoading",!1),Ee(e)});case 2:return e.a(2,e.v)}},e)}));return function(t,n,i,a){return e.apply(this,arguments)}}(),ot=function(e,t){return null==e||e==t}
1,st=rt,ct=n(85471),ut=n(18865),lt=n(34937),dt=n(52726),mt=n(1214),pt=n(94198);ct["default"].use(ut.Ay);var ht="api-token",ft=d.Ay.graphAPI,gt=ft.substr(0,ft.indexOf("/graphql"));function vt(){return localStorage.getItem(ht)}ct["default"].prototype.$filesRoot=gt;var yt=(0,dt.$)({uri:ft}),_t=(0,pt.o)(function(e,t){var n=t.headers,i=vt();return{headers:(0,Be.A)((0,Be.A)({},n),{},{authorization:i||""})}}),kt=new mt.D9,wt=new lt.Ri({link:_t.concat(yt),cache:kt,defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"}}});var St=n(90453),bt=n.n(St),Tt=function(){var e=(0,o.A)((0,r.A)().m(function e(t,n,i,a,c,u,l,d){return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:return e.n=1,wt.resetStore();case 1:wt.query({query:bt(),variables:{eventTypes:t,imeis:i,start:a,stop:c}}).then(function(){var e=(0,o.A)((0,r.A)().m(function e(t){var i,o,m,h,f;return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:i=Et(n,t.data.eventsTypeByIMEI,u,l),o=s.A.unix(a).format("D_MMM_YY")+"-ถึง-"+s.A.unix(c).format("D_MMM_YY"),m="PTO_Report_"+o,h=["ทะเบียนรถ","name","วัน เวลา เริ่มต้น","วัน เวลา สิ้นสุด","PTO ที่","รวมเวลา","ตำแหน่งเริ่มต้น","ตำแหน่งสิ้นสุด","ละติจูด ลองจิจูด","ผู้ใช้รถ","timestamp เริ่มต้น","timestamp สิ้นสุด"],f=[{key:"plate_number",width:10,style:{font:p.Rv}},{key:"name",width:22,style:{numFmt:"0"}},{key:"start",width:20},{key:"stop",width:20},{key:"pto",width:8},{key:"totalTime",width:8},{key:"reversegeolocationstart",width:40},{key:"reversegeolocationend",width:40},{key:"geolocation",width:30},{key:"driver",width:15},{key:"timeStampStart",width:15},{key:"timeStampStop",width:15}],At({fileName:m,reportByVehicle:i,tableHead:h,columnsSpec:f,statusColumn:null,logo:d});case 1:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}()).catch(function(e){console.log(e),Ee(e),Re.A.dispatch("loading/setReportLoading",!1)});case 2:return e.a(2)}},e)}));return function(t,n,i,a,r,o,s,c){return e.apply(this,arguments)}}(),At=function(){var e=(0,o.A)((0,r.A)().m(function e(t){var n,i,a,o,c,l,d,m,h,f,g;return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:if(n=t.fileName,i=t.reportByVehicle,a=t.tableHead,o=t.columnsSpec,c=t.statusColumn,l=t.logo,d=new(u().Workbook),m={properties:{tabColor:{argb:"FF41C173"}},pageSetup:{paperSize:9,orientation:"landscape"}},!l||!l.url){e.n=2;break}return f=l.ext.substring(1),e.n=1,(0,p.kX)(l);case 1:g=e.v,h=d.addImage({base64:g,extension:f});case 2:Object.keys(i).length>
10?Object.keys(i).forEach(function(e){if(i[e].length>0){var t=1,n=i[e][0][0],r=d.addWorksheet(n,m);r.pageSetup.margins=p.Yy,r.columns=o;var u=i[e][i[e].length-1][12],f=(0,s.A)("1970-01-01").startOf("day").seconds(u).format("HH:mm:ss"),g="รายงาน PTO ของ รถทะเบียน ".concat(n," เวลาเริ่ม ").concat(i[e][0][2]," ถึง ").concat(i[e][i[e].length-1][3]),v="รวมเวลา ".concat(f," ชม.:นาที:วินาที");l&&l.url&&(t=2,(0,p.U0)(r,h)),r.addRow([g]),r.addRow([v]),r.addRow([]),r.addRow(a),r.addRows(i[e]),c&&r.getColumn(c).eachCell(function(e){e.fill={type:"pattern",pattern:"solid",fgColor:(0,p.qY)(e.value)}}),(0,p.hK)(r,t+3),(0,p.LQ)(r,t),(0,p.LQ)(r,t+1)}}):d.addWorksheet("ไม่พบข้อมูล",m),(0,p.ti)(d,n);case 3:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),Et=function(e,t,n,i){var a={},r={};return t.forEach(function(t){var o=t.positionDataStart.mcr_license_no,s=t.positionDataStart.mcr_driver_name;a[t.imei]=a[t.imei]||[],r[t.imei]=r[t.imei]||0;var c=(0,p.Lv)(n,t);r[t.imei]=parseInt(r[t.imei])+parseInt(t.stopTime-t.startTime),a[t.imei].push([(0,p.NS)(e,t.imei),(0,p.ZD)(e,t.imei),(0,p.Yq)(t.startTime),(0,p.Yq)(t.stopTime),t.pto,(0,p.a3)(t.startTime,t.stopTime),c.start,c.end,"".concat(t.lat/1e7,", ").concat(t.lng/1e7),"undefined"!=typeof i&&o in i?i[o].name:(0,p.Cb)(o,s),t.startTime,t.stopTime,r[t.imei]])}),a},xt=Tt,Nt=(n(52675),n(89463),n(2259),n(16280),n(47764),n(62953),n(45929));function Rt(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError((0,Nt.A)(e)+" is not iterable")}function Ft(e){var t=Object(e),n=[];for(var i in t)n.unshift(i);return function e(){for(;n.length;)if((i=n.pop())in t)return e.value=i,e.done=!1,e;return e.done=!0,e}}n(54554);var Dt=function(){var e=(0,o.A)((0,r.A)().m(function e(t,n,i,a,o,c,u,m,h,f){var g,v,y,_,k,w,S,b,T,A,E,x,N,R,F,D,C,O,I;return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:if(g=null,"idlingOpenPTO"!==h){e.n=2;break}return e.n=1,l.A.post("".concat(d.Ay.coreApi,"/report-event"),{imeis:i,start:a,stop:o,eventType:"ENGINE_IDLE_END",pto:!0}).then(function(e){return e}).catch(function(e){console.log(e),Ee(e),Re.A.dispatch("loading/setReportLoading",!1)});case 1:v=e.v,g=v.data,e.n=5;break;case 2:return e.n=3,wt.resetStore();case 3:return e.n=4,wt.query({query:bt(),variables:{eventTypes:t,imeis:i,start:a,stop:o}});case 4:y=e.v,g=y.data.eventsTypeByIMEI;case 5:if(_=Mt(n,g,c,u,m,h),k=s.A.unix(a).format("D_MMM_YY")+"-ถึง-"+s.A.unix(o).format("D_MMM_YY"),w="","idlingSummary"!=h){e.n=10;break}return e.n=6,l.A.post("".concat(d.Ay.coreApi,"/report-summary-event"),{eventType:"END_TRIP",imeis:i,start:a,stop:o}).then(function(e){return e}).catch(function(e){console.log(e),Ee(e),Re.A.dispatch("loading/setReportLoading",!1)});case 6:S=e.v,b={},T=(0,r.A)().m(function e(){var t,n,i,a,o,s,c,u,l,d,m,h;return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:for(n in b[A]={},t=0,b[A]["IDLE"]=[],b[A]["IDLE"]=_[A].filter(function(e){return"IDLE"===e[4]}).map(function(e){return t+=e[11]-e[10],e[12]=t,e.splice(4,1),e.splice(5,0,""),e}),t=0,b[A]["PTO"]=[],b[A]["PTO"]=_[A].filter(function(e){return"PTO"===e[4]}).map(function(e){return t+=e[11]-e[10],e[12]=t,e.splice(4,1),e.splice(6,0,""),e}),b[A]["IDLE"])for(o in i=b[A]["IDLE"][n][10],a=b[A]["IDLE"][n][11],b[A]["PTO"])i<=b[A]["PTO"][o][10]&&a>=b[A]["PTO"][o][11]&&(b[A]["IDLE"][n][4]=""===b[A]["IDLE"][n][4]?0:"",b[A]["IDLE"][n][5]=""===b[A]["IDLE"][n][5]?0:"",b[A]["IDLE"][n][4]=1,b[A]["IDLE"][n][5]=+b[A]["PTO"][o][11]-b[A]["PTO"][o][10]);if(s=b[A]["IDLE"].length,s>0){for(d in c=0,u=b[A]["IDLE"][s-1][12],l=0,b[A]["IDLE"])""!==b[A]["IDLE"][d][4]&&(c=parseInt(b[A]["IDLE"][d][4])+c),""!==b[A]["IDLE"][d][5]&&(l=Number(b[A]["IDLE"][d][5])+l,b[A]["IDLE"][d][5]=(0,p.a3)(0,b[A]["IDLE"][d][5]));m=(0,p.a3)(0,l),h=(0,p.a3)(0,u),b[A]["IDLE"].push(["","","","",c,m,h,"","","","","",""])}case 1:return e.a(2)}},e)}),O=Ft(_);case 7:if((I=O()).done){e.n=9;break}return A=I.value,e.d(Rt(T()),8);case 8:e.n=7;break;case 9:w="IdlingPTO_Report_Summary_"+k,E=["ทะเบียนรถ","ชื่อ","วัน เวลา เริ่มต้น","วัน เวลา สิ้นสุด","เปิด PTO(ครั้ง)","รวมเวลา PTO","รวมเวลา จอดรถติดเครื่อง","ตำแหน่ง","ละติจูด ลองจิจูด","ผู้ใช้รถ","timestamp เริ่มต้น","timestamp สิ้นสุด"],x=["ทะเบียนรถ","ชื่อ","วัน เวลา เริ่มต้น","วัน เวลา สิ้นสุด","PTO ที่","รวมเวลา","-","ตำแหน่ง","ละติจูด ลองจิจูด","ผู้ใช้รถ","timestamp เริ่มต้น","timestamp สิ้นสุด"],N=[{key:"plate_number",width:10,style:{font:p.Rv}},{key:"name",width:28,style:{numFmt:"0"}},{key:"start",width:20,alignment:{vertical:"middle",horizontal:"right"}}
1,{key:"stop",width:20,alignment:{vertical:"middle",horizontal:"right"}},{key:"pto",width:20},{key:"totalTimePTO",width:20},{key:"totalTime",width:20},{key:"reversegeolocationend",width:40},{key:"geolocation",width:30},{key:"driver",width:15},{key:"timeStampStart",width:15},{key:"timeStampStop",width:15}],Ot({fileName:w,reportByVehicleForSummary:b,tableHeadIdling:E,tableHeadPTO:x,columnsSpec:N,statusColumn:null,summaryData:S.data,start:a,stop:o,logo:f}),e.n=11;break;case 10:"idlingOpenPTO"==h?(w="Idling_Open_PTO_Report_"+k,R=["ทะเบียนรถ","ชื่อ","วัน เวลา เริ่มต้น","วัน เวลา สิ้นสุด","รวมเวลา","ตำแหน่ง","ละติจูด ลองจิจูด","PTO1","PTO2","PTO3","ผู้ใช้รถ","timestamp เริ่มต้น","timestamp สิ้นสุด"],F=[{key:"plate_number",width:10,style:{font:p.Rv}},{key:"name",width:22,style:{numFmt:"0"}},{key:"start",width:20},{key:"stop",width:20},{key:"totalTime",width:8},{key:"reversegeolocationend",width:40},{key:"geolocation",width:30},{key:"PTO1",width:15},{key:"PTO2",width:15},{key:"PTO3",width:15},{key:"driver",width:15},{key:"timeStampStart",width:15},{key:"timeStampStop",width:15}],It({fileName:w,reportByVehicle:_,tableHead:R,columnsSpec:F,statusColumn:8,logo:f})):(w="Idling_Report_"+k,D=["ทะเบียนรถ","ชื่อ","วัน เวลา เริ่มต้น","วัน เวลา สิ้นสุด","รวมเวลา","ตำแหน่ง","ละติจูด ลองจิจูด","ผู้ใช้รถ","timestamp เริ่มต้น","timestamp สิ้นสุด"],C=[{key:"plate_number",width:10,style:{font:p.Rv}},{key:"name",width:22,style:{numFmt:"0"}},{key:"start",width:20},{key:"stop",width:20},{key:"totalTime",width:8},{key:"reversegeolocationend",width:40},{key:"geolocation",width:30},{key:"driver",width:15},{key:"timeStampStart",width:15},{key:"timeStampStop",width:15}],Ct({fileName:w,reportByVehicle:_,tableHead:D,columnsSpec:C,statusColumn:null,logo:f}));case 11:return e.a(2)}},e)}));return function(t,n,i,a,r,o,s,c,u,l){return e.apply(this,arguments)}}(),Ct=function(){var e=(0,o.A)((0,r.A)().m(function e(t){var n,i,a,o,c,l,d,m,h,f,g;return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:if(n=t.fileName,i=t.reportByVehicle,a=t.tableHead,o=t.columnsSpec,c=t.statusColumn,l=t.logo,d=new(u().Workbook),m={properties:{tabColor:{argb:"FF41C173"}},pageSetup:{paperSize:9,orientation:"landscape"}},!l||!l.url){e.n=2;break}return f=l.ext.substring(1),e.n=1,(0,p.kX)(l);case 1:g=e.v,h=d.addImage({base64:g,extension:f});case 2:Object.keys(i).length>
10?Object.keys(i).forEach(function(e){if(i[e].length>0){var t=1,n=i[e][0][0],r=d.addWorksheet(n,m);r.pageSetup.margins=p.Yy,r.columns=o;var u=i[e][i[e].length-1][10],f=(0,s.A)("1970-01-01").startOf("day").seconds(u).format("HH:mm:ss"),g="รายงานจอดรถติดเครื่อง ของ รถทะเบียน ".concat(n," เวลาเริ่ม ").concat(i[e][0][2]," ถึง ").concat(i[e][i[e].length-1][3]),v="รวมเวลา ".concat(f," ชม.:นาที:วินาที");l&&l.url&&(t=2,(0,p.U0)(r,h)),r.addRow([g]),r.addRow([v]),r.addRow([]),r.addRow(a),r.addRows(i[e]),c&&r.getColumn(c).eachCell(function(e){e.font={color:{argb:"FFF5223E"}}}),(0,p.hK)(r,t+3),(0,p.LQ)(r,t),(0,p.LQ)(r,t+1)}}):d.addWorksheet("ไม่พบข้อมูล",m),(0,p.ti)(d,n);case 3:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),Ot=function(){var e=(0,o.A)((0,r.A)().m(function e(t){var n,i,a,o,c,l,d,m,h,f,g,v,y,_,k;return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:if(n=t.fileName,i=t.reportByVehicleForSummary,a=t.tableHeadIdling,o=t.tableHeadPTO,c=t.columnsSpec,l=t.statusColumn,d=t.summaryData,m=t.start,h=t.stop,f=t.logo,g=new(u().Workbook),v={properties:{tabColor:{argb:"FF41C173"}},pageSetup:{paperSize:9,orientation:"landscape"},headerFooter:{differentFirst:!1,firstFooter:"โดย บริษัทเฮลลิออท จำกัด https://www.heliot.co.th อีเมล์ [email protected]"}},!f||!f.url){e.n=2;break}return _=f.ext.substring(1),e.n=1,(0,p.kX)(f);case 1:k=e.v,y=g.addImage({base64:k,extension:_});case 2:Object.keys(i).length>
10?Object.keys(i).forEach(function(e){if(i[e]["PTO"].length>0||i[e]["IDLE"].length>0){var t=1,n=1,r=0,u=i[e]["IDLE"][0][0]||i[e]["PTO"][0][0],_=g.addWorksheet(u,v);_.pageSetup.margins=p.Yy,_.columns=c;var k=i[e]["IDLE"].length?i[e]["IDLE"].length-1:0,w=i[e]["PTO"].length>0?i[e]["PTO"].length-1:0,S=w>0?i[e]["PTO"][w][12]:0,b=(0,s.A)("1970-01-01").startOf("day").seconds(S).format("HH:mm:ss"),T=d[e],A="รายงานสรุป ของ พาหนะทะเบียน ".concat(u," เวลาเริ่ม ").concat((0,p.Yq)(m)," ถึง ").concat((0,p.Yq)(h));for(var E in f&&f.url&&(n=2,t=2,(0,p.U0)(_,y)),_.addRow([A]),_.addRow([]),_.addRow(["ที่","เหตุการณ์","ค่ารายงาน","หน่วย"]),T)_.addRow([n,T[E].title,T[E].value,T[E].unit]),n++;_.addRow([]),_.addRow([]),(0,p.LQ)(_,t),(0,p.hK)(_,t+2+r),_.getColumn(2).eachCell(function(e,n){n>t+2&&(e.alignment={vertical:"middle",horizontal:"right"},e.fill={type:"pattern",pattern:"solid",fgColor:{argb:"FFF0EFFC"},bgColor:{argb:"FF0000FF"}},e.border={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}})});var x="รายงานจอดรถติดเครื่อง ของ รถทะเบียน ".concat(u);if(_.addRow([x]),_.addRow([]),_.addRow(a),k>0&&_.addRows(i[e]["IDLE"]),l&&_.getColumn(l).eachCell(function(e){e.fill={type:"pattern",pattern:"solid",fgColor:(0,p.qY)(e.value)}}),_.addRow([]),(0,p.LQ)(_,n+5),(0,p.hK)(_,n+7),_.addRow([]),_.addRow([]),w>0){var N="รายงาน PTO ของ รถทะเบียน ".concat(u),R="รวมเวลา ".concat(b," ชม.:นาที:วินาที");_.addRow([N]),_.addRow([]),_.addRow(o),_.addRows(i[e]["PTO"]),l&&_.getColumn(l).eachCell(function(e){e.fill={type:"pattern",pattern:"solid",fgColor:(0,p.qY)(e.value)}}),_.addRow([R]),(0,p.LQ)(_,n+11+i[e]["IDLE"].length),(0,p.hK)(_,n+13+i[e]["IDLE"].length)}}}):g.addWorksheet("ไม่พบข้อมูล",v),(0,p.ti)(g,n);case 3:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),It=function(){var e=(0,o.A)((0,r.A)().m(function e(t){var n,i,a,o,c,l,d,m,h,f,g;return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:if(n=t.fileName,i=t.reportByVehicle,a=t.tableHead,o=t.columnsSpec,c=t.statusColumn,l=t.logo,d=new(u().Workbook),m={properties:{tabColor:{argb:"FF41C173"}},pageSetup:{paperSize:9,orientation:"landscape"}},!l||!l.url){e.n=2;break}return f=l.ext.substring(1),e.n=1,(0,p.kX)(l);case 1:g=e.v,h=d.addImage({base64:g,extension:f});case 2:Object.keys(i).length>
10?Object.keys(i).forEach(function(e){if(i[e].length>0){var t=1,n=i[e][0][0],r=d.addWorksheet(n,m);r.pageSetup.margins=p.Yy,r.columns=o;var u=i[e][i[e].length-1][10],f=(0,s.A)("1970-01-01").startOf("day").seconds(u).format("HH:mm:ss"),g="รายงานจอดรถติดเครื่อง ของ รถทะเบียน ".concat(n," เวลาเริ่ม ").concat(i[e][0][2]," ถึง ").concat(i[e][i[e].length-1][3]),v="รวมเวลา ".concat(f," ชม.:นาที:วินาที");l&&l.url&&(t=2,(0,p.U0)(r,h)),r.addRow([g]),r.addRow([v]),r.addRow([]),r.addRow(a),r.addRows(i[e]),r.addRow([]),r.addRow([]),r.addRow([]),r.addRow(["","","","","","","รวมเวลาเปิด PTO1",(0,s.A)("1970-01-01").startOf("day").seconds(i[e][i[e].length-1][14]).format("HH:mm:ss")]),r.addRow(["","","","","","","รวมเวลาเปิด PTO2",(0,s.A)("1970-01-01").startOf("day").seconds(i[e][i[e].length-1][15]).format("HH:mm:ss")]),r.addRow(["","","","","","","รวมเวลาเปิด PTO3",(0,s.A)("1970-01-01").startOf("day").seconds(i[e][i[e].length-1][16]).format("HH:mm:ss")]),c&&r.getColumn(c).eachCell(function(e){e.font={color:{argb:"FFF5223E"}}}),(0,p.hK)(r,t+3),(0,p.LQ)(r,t),(0,p.LQ)(r,t+1)}}):d.addWorksheet("ไม่พบข้อมูล",m),(0,p.ti)(d,n);case 3:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),Mt=function(e,t,n,i,a,r){var o={},s={},c={},u={},l={};return t.forEach(function(t){o[t.imei]=o[t.imei]||[],s[t.imei]=s[t.imei]||0,c[t.imei]=c[t.imei]||0,u[t.imei]=u[t.imei]||0,l[t.imei]=l[t.imei]||0;var d=(0,p.Lv)(i,t),m="undefined"!=typeof t.positionDataStart.mcr_license_no?t.positionDataStart.mcr_license_no:"",h=t.positionDataStart.mcr_driver_name||"";if(t.stopTime-t.startTime>=n)if(s[t.imei]=parseInt(s[t.imei])+parseInt(t.stopTime-t.startTime),c[t.imei]=parseInt(c[t.imei])+parseInt(t.pto1spendingTimeTotal),u[t.imei]=parseInt(u[t.imei])+parseInt(t.pto2spendingTimeTotal),l[t.imei]=parseInt(l[t.imei])+parseInt(t.pto3spendingTimeTotal),"idlingSummary"==r)o[t.imei].push([(0,p.NS)(e,t.imei),(0,p.ZD)(e,t.imei),(0,p.Yq)(t.startTime),(0,p.Yq)(t.stopTime),"PTO_STOP"==t.eventType?"PTO":"IDLE",t.pto?t.pto:"",(0,p.a3)(t.startTime,t.stopTime),d.end,"".concat(t.lat/1e7,", ").concat(t.lng/1e7),"undefined"!=typeof a&&m in a?a[m].name:(0,p.Cb)(m,h),t.startTime,t.stopTime,s[t.imei]]);else if("idlingOpenPTO"==r){var f=0,g=0;"positionDataStart"in t?(f=t.positionDataStart.latitude,g=t.positionDataStart.longitude):(f=t.lat,g=t.lng),o[t.imei].push([(0,p.NS)(e,t.imei),(0,p.ZD)(e,t.imei),(0,p.Yq)(t.startTime),(0,p.Yq)(t.stopTime),(0,p.a3)(t.startTime,t.stopTime),d.end,"".concat(f/1e7,", ").concat(g/1e7),t.pto1?"เปิดใช้งาน":"-",t.pto2?"เปิดใช้งาน":"-",t.pto3?"เปิดใช้งาน":"-","undefined"!=typeof a&&m in a?a[m].name:(0,p.Cb)(m,h),t.startTime,t.stopTime,s[t.imei],c[t.imei],u[t.imei],l[t.imei]])}else o[t.imei].push([(0,p.NS)(e,t.imei),(0,p.ZD)(e,t.imei),(0,p.Yq)(t.startTime),(0,p.Yq)(t.stopTime),(0,p.a3)(t.startTime,t.stopTime),d.end,"".concat(t.lat/1e7,", ").concat(t.lng/1e7),"undefined"!=typeof a&&m in a?a[m].name:(0,p.Cb)(m,h),t.startTime,t.stopTime,s[t.imei]])}),o},Yt=Dt,Lt=function(e,t){var n={},i={},a={},r={};if(1===t.length){var o=t[0];n[o.imei]=[];var c=s.A.unix(o.posExit.timestamp).format("YYYY-MM-DD"),u=o.imei+"_"+c;i[u]=i[u]||0,a[u]=a[u]||0,n[o.imei][c]=n[o.imei][c]||[];var l=parseFloat(((o.posExit.io[65]-o.posEnter.io[65])/1e3).toFixed(2));i[u]=parseFloat((l+i[u]).toFixed(2)),a[u]=o.posExit.timestamp-o.timeEnterExitSrc.enterTime+a[u],n[o.imei][c].push([(0,p.NS)(e,o.imei),(0,p.ZD)(e,o.imei),o.exitGeofence.name,o.enterGeofence.name,l,(0,p.a3)(o.timeEnterExitSrc.enterTime,o.posExit.timestamp),(0,p.Yq)(o.timeEnterExitSrc.enterTime),(0,p.Yq)(o.timeEnterExitSrc.exitTime),(0,p.a3)(o.timeEnterExitSrc.enterTime,o.timeEnterExitSrc.exitTime),(0,p.Yq)(o.timeEnterExitSrc.enterTime),(0,p.Yq)(o.timeEnterExitSrc.exitTime),(0,p.a3)(o.timeEnterExitSrc.enterTime,o.timeEnterExitSrc.exitTime),o.posEnter.timestamp,o.posExit.timestamp,c+"",i[u],a[u]])}else t.forEach(function(t){if(t.imei in n){var o=s.A.unix(t.posExit.timestamp).format("YYYY-MM-DD"),c=t.
1imei+"_"+o;i[c]=i[c]||0,a[c]=a[c]||0,n[t.imei][o]=n[t.imei][o]||[];var u=0;t.posEnter.timestamp==t.posExit.timestamp?(u=parseFloat(((t.posExit.io[65]-r[t.imei].posExit.io[65])/1e3).toFixed(2)),i[c]=parseFloat((u+i[c]).toFixed(2)),a[c]=t.posExit.timestamp-r[t.imei].timeEnterExitSrc.enterTime+a[c],n[t.imei][o].push([(0,p.NS)(e,t.imei),(0,p.ZD)(e,t.imei),t.prevGeofence.name,t.enterGeofence.name,u,(0,p.a3)(r[t.imei].timeEnterExitSrc.enterTime,t.posEnter.timestamp),(0,p.Yq)(r[t.imei].timeEnterExitSrc.enterTime),(0,p.Yq)(r[t.imei].timeEnterExitSrc.exitTime),(0,p.a3)(r[t.imei].timeEnterExitSrc.enterTime,r[t.imei].timeEnterExitSrc.exitTime),(0,p.Yq)(t.timeEnterExitSrc.enterTime),null,null,t.posEnter.timestamp,t.posExit.timestamp,o+"",i[c],a[c]])):(u=parseFloat(((t.posExit.io[65]-r[t.imei].posExit.io[65])/1e3).toFixed(2)),i[c]=parseFloat((u+i[c]).toFixed(2)),a[c]=t.posExit.timestamp-r[t.imei].timeEnterExitSrc.enterTime+a[c],n[t.imei][o].push([(0,p.NS)(e,t.imei),(0,p.ZD)(e,t.imei),t.exitGeofence.name,t.enterGeofence.name,u,(0,p.a3)(r[t.imei].timeEnterExitSrc.enterTime,t.posExit.timestamp),(0,p.Yq)(r[t.imei].timeEnterExitSrc.enterTime),(0,p.Yq)(r[t.imei].timeEnterExitSrc.exitTime),(0,p.a3)(r[t.imei].timeEnterExitSrc.enterTime,r[t.imei].timeEnterExitSrc.exitTime),(0,p.Yq)(t.timeEnterExitSrc.enterTime),(0,p.Yq)(t.timeEnterExitSrc.exitTime),(0,p.a3)(t.timeEnterExitSrc.enterTime,t.timeEnterExitSrc.exitTime),t.posEnter.timestamp,t.posExit.timestamp,o+"",i[c],a[c]])),r[t.imei]={timeEnterExitSrc:t.timeEnterExitSrc,posExit:t.posExit}}else n[t.imei]=[],r[t.imei]={timeEnterExitSrc:t.timeEnterExitSrc,posExit:t.posExit}});return n},Pt=function(e,t,n,i){var a=Lt(t,n),r=["ทะเบียนรถ","ชื่อ","ต้นทาง","ปลายทาง","ระยะทาง","ระยะเวลา","เข้าต้นทาง","ออกต้นทาง","รวมเวลาต้นทาง","เข้าปลายทาง","ออกปลายทาง","รวมเวลาปลายทาง"],o=[{key:"plate_number",width:10,style:{font:p.Rv}},{key:"name",width:22,style:{numFmt:"0"}},{key:"exitGeofence",width:25},{key:"enterGeofence",width:25},{key:"totalDistance",width:16},{key:"totalTime",width:20},{key:"enterTimeSrc",width:20},{key:"exitTimeSrc",width:20},{key:"totalTimeSrc",width:20},{key:"enterTimeDest",width:20},{key:"exitTimeDest",width:20},{key:"totalTimeDest",width:20}];Bt({fileName:e,reportByVehicle:a,tableHead:r,columnsSpec:o,logo:i,vehicles:t})},qt=function(){var e=(0,o.A)((0,r.A)().m(function e(t,n,i,a,c,u){var m;return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:return m=s.A.unix(i).format("D_MMM_YY")+"-ถึง-"+s.A.unix(a).format("D_MMM_YY"),e.n=1,l.A.post("".concat(d.Ay.coreApi,"/report-geofence"),{eventType:"END_TRIP",imeis:n,start:i,stop:a,customergroup:c.id,selectedGeofences:u}).then(function(){var e=(0,o.A)((0,r.A)().m(function e(n){var i;return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:i="Geofences_Report_"+m,Pt(i,t,n.data,c.logo);case 1:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}()).catch(function(e){console.log("An error occurred:",e),Ee(e),Re.A.dispatch("loading/setReportLoading",!1)});case 1:return e.a(2)}},e)}));return function(t,n,i,a,r,o){return e.apply(this,arguments)}}(),Bt=function(){var e=(0,o.A)((0,r.A)().m(function e(t){var n,i,a,o,c,l,d,m,h,f,g;return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:if(n=t.fileName,i=t.reportByVehicle,a=t.tableHead,o=t.columnsSpec,c=t.logo,l=t.vehicles,d=new(u().Workbook),m={properties:{tabColor:{argb:"FF41C173"}},pageSetup:{paperSize:9,orientation:"landscape"}},!c||!c.url){e.n=2;break}return f=c.ext.substring(1),e.n=1,(0,p.kX)(c);case 1:g=e.v,h=d.addImage({base64:g,extension:f});case 2:Object.keys(i).length>
10?Object.keys(i).forEach(function(e){var t=1,n=0,r=null,u="",f=0,g=0,v=0,y="",_="";u=(0,p.NS)(l,Number(e)),r=d.addWorksheet(u,m),r.pageSetup.margins=p.Yy,r.columns=o,c&&c.url&&(t=2,(0,p.U0)(r,h)),Object.keys(i[e]).forEach(function(o){var c=i[e][o];0==n&&(u=c[0][0]);var l=c[c.length-1][15],d=(0,s.A)("1970-01-01").startOf("day").seconds(c[c.length-1][16]).format("HH:mm:ss");y="รายงานสถานีถึงสถานี ของ รถทะเบียน ".concat(u," เวลาเริ่ม ").concat(c[0][6]," ถึง ").concat(c[c.length-1][9]),_="รวมระทางทั้งสิ้น ".concat(l," กม. รวมเวลา ").concat(d," ชม.:นาที:วินาที"),g+=l,v+=c[c.length-1][16],r.addRow([y]),r.addRow([_]),r.addRow([]),r.addRow(a),r.addRows(c),r.addRow([]),r.addRow([]),(0,p.hK)(r,t+3+f),(0,p.LQ)(r,t+f),(0,p.LQ)(r,t+1+f),f=f+c.length+6,n++});var k=(0,s.A)("1970-01-01").startOf("day").seconds(v).format("HH:mm:ss");r.addRow(["รวมระทางทั้งสิ้น ".concat(g.toFixed(2)," กม. รวมเวลา ").concat(k," ชม.:นาที:วินาที")]),(0,p.LQ)(r,t+f,"FF0306A6")}):d.addWorksheet("ไม่พบข้อมูล",m),(0,p.ti)(d,n);case 3:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),Ht=qt,jt=function(e,t,n,i,a,r,o){var s=["ที่","เหตุการณ์","ค่ารายงาน","หน่วย"],c=[{key:"no",width:5,style:{numFmt:"0",font:p.Rv}},{key:"item",width:42,style:{font:p.Rv}},{key:"amount",width:18,style:{numFmt:"0",font:p.Rv,bold:!0},alignment:{vertical:"middle",horizontal:"right"}},{key:"unit",width:32,style:{font:p.Rv}}];Wt({fileName:e,reportByVehicle:n,tableHead:s,columnsSpec:c,vehicles:t,start:i,stop:a,logo:r,isSummarizedByDay:o})},Vt=function(){var e=(0,o.A)((0,r.A)().m(function e(t,n,i,a,c,u){var m;return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:return m=s.A.unix(i).format("D_MMM_YY")+"-ถึง-"+s.A.unix(a).format("D_MMM_YY"),e.n=1,l.A.post("".concat(d.Ay.coreApi,"/report-summary-event"),{eventType:"END_TRIP",imeis:n,start:i,stop:a,isSummarizedByDay:u}).then(function(){var e=(0,o.A)((0,r.A)().m(function e(n){var o;return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:o="Summary_Report_"+m,jt(o,t,n.data,i,a,c,u);case 1:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}()).catch(function(e){console.log("An error occurred:",e),Ee(e),Re.A.dispatch("loading/setReportLoading",!1)});case 1:return e.a(2)}},e)}));return function(t,n,i,a,r,o){return e.apply(this,arguments)}}(),Wt=function(){var e=(0,o.A)((0,r.A)().m(function e(t){var n,i,a,o,c,l,d,m,h,f,g,v,y,_,k;return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:if(n=t.fileName,i=t.reportByVehicle,a=t.tableHead,o=t.columnsSpec,c=t.vehicles,l=t.start,d=t.stop,m=t.logo,h=t.isSummarizedByDay,f=new(u().Workbook),g={properties:{tabColor:{argb:"FF41C173"}},pageSetup:{paperSize:9,orientation:"portrait",fitToPage:!0},headerFooter:{differentFirst:!1,firstFooter:"โดย บริษัทเฮลลิออท จำกัด https://www.heliot.co.th อีเมล์ [email protected]"}},!m||!m.url){e.n=2;break}return y=m.ext.substring(1),e.n=1,(0,p.kX)(m);case 1:_=e.v,v=f.addImage({base64:_,extension:y});case 2:Object.keys(i).length>0?(k=Object.keys(i).filter(function(e){return"_fleetSummary"!==e}),k.forEach(function(e){var t=1,n=0,r=null,u="",y=i[e];if(0==n&&(u=(0,p.NS)(c,Number(e)),r=f.addWorksheet(u,g),r.pageSetup.margins=p.Yy,r.columns=o),m&&m.url&&(t=2,(0,p.U0)(r,v)),h){var _=0;for(var k in y){_+=1;var w=y[k],S=(0,s.A)(k).hour(0).minute(0).second(0),b=(0,s.A)(k).hour(23).minute(59).second(59),T=parseInt(S.valueOf()/1e3),A=parseInt(b.valueOf()/1e3);1===_&&(T=l),_===Object.keys(y).length&&(A=d);var E="รายงานสรุป พาหนะทะเบียน ".concat(u," เวลาเริ่ม ").concat((0,p.Yq)(T)," ถึง ").concat((0,p.Yq)(A));r.addRow([E]),r.addRow([]),r.addRow(a);var x=1;for(var N in w)r.addRow([x,w[N].title,w[N].value,w[N].unit]),x++;r.addRow([]),r.addRow([]),(0,p.LQ)(r,t),(0,p.hK)(r,t+2),r.getColumn("amount").eachCell(function(e,n){
1n>t+2&&(e.alignment={vertical:"middle",horizontal:"right"},e.fill={type:"pattern",pattern:"solid",fgColor:{argb:"FFF0EFFC"},bgColor:{argb:"FF0000FF"}},e.border={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}})}),t=t+Object.keys(w).length+5}}else{var R=0,F="รายงานสรุป ของ พาหนะทะเบียน ".concat(u," เวลาเริ่ม ").concat((0,p.Yq)(l)," ถึง ").concat((0,p.Yq)(d));r.addRow([F]),r.addRow([]),r.addRow(a);var D=1;for(var C in y)r.addRow([D,y[C].title,y[C].value,y[C].unit]),D++;r.addRow([]),r.addRow([]),(0,p.LQ)(r,t),(0,p.hK)(r,t+2+R),r.getColumn("amount").eachCell(function(e,n){n>t+2&&(e.alignment={vertical:"middle",horizontal:"right"},e.fill={type:"pattern",pattern:"solid",fgColor:{argb:"FFF0EFFC"},bgColor:{argb:"FF0000FF"}},e.border={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}})})}n++})):f.addWorksheet("ไม่พบข้อมูล",g),(0,p.ti)(f,n);case 3:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),Ut=Vt,Gt=function(){var e=(0,o.A)((0,r.A)().m(function e(t,n,i,a,o,c,u){var m;return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:return m=s.A.unix(i).format("D_MMM_YY")+"-ถึง-"+s.A.unix(a).format("D_MMM_YY"),e.n=1,l.A.post("".concat(d.Ay.coreApi,"/report-temperature"),{imeis:n,start:i,stop:a,customergroup:o,sec:parseInt(c),vehicles:t,dictOfDriver:u}).then(function(e){var n=Kt(t,e.data,u),i="Temperature_Report_"+m,a=["ทะเบียนรถ","IMEI","วัน เวลา","ความเร็ว","อุณหภูมิ","ตำแหน่ง","สถานที่","เลขกม.สะสม","เลขที่ใบขับขี่","timestamp"],r=[{key:"plate_number",width:14,style:{font:p.Rv}},{key:"imei",width:18,alignment:{horizontal:"center"},style:{numFmt:"0.0"}},{key:"time",width:20},{key:"speed",width:12},{key:"fuel",width:12},{key:"latLng",width:24},{key:"geolocation",width:30},{key:"odo",width:10},{key:"mcr_license_no",width:12},{key:"timestamp",width:12}];Qt({fileName:i,reportByVehicle:n,tableHead:a,columnsSpec:r,statusColumn:!1})}).catch(function(e){console.log(e),Ee(e),Re.A.dispatch("loading/setReportLoading",!1)});case 1:return e.a(2)}},e)}));return function(t,n,i,a,r,o,s){return e.apply(this,arguments)}}(),Qt=function(e){var t=e.fileName,n=e.reportByVehicle,i=e.tableHead,a=e.columnsSpec,r=e.statusColumn,o=new(u().Workbook),s={properties:{tabColor:{argb:"FF41C173"}},pageSetup:{paperSize:9,orientation:"landscape"}};Object.keys(n).length>0?Object.keys(n).forEach(function(e){if(n[e].length>0){var t=n[e][0][0],c=o.addWorksheet(t,s);c.pageSetup.margins=p.Yy,c.columns=a;var u=null,l=null,d=0,m=0;for(var h in n[e]){var f=parseFloat(n[e][h][4]);(f>u||null===u)&&(u=f),(l>f||null===l)&&(l=f),m+=f}d=m/n[e].length;var g=(n[e][n[e].length-1][7]-n[e][0][7]).toFixed(2),v=(0,p.a3)(n[e][0][9],n[e][n[e].length-1][9]),y="รายงานอุณหภูมิ ของ รถทะเบียน ".concat(t," เวลาเริ่ม ").concat(n[e][0][2]," ถึง ").concat(n[e][n[e].length-1][2]),_="รวมระยะทางทั้งสิ้น ".concat(g," กม. รวมเวลา ").concat(v," ชม.:นาที:วินาที");c.addRow([y]),c.addRow([_]),c.addRow(["ค่าอุณหภูมิสูงสุด",parseFloat(u.toFixed(2)),"องศาเซลเซียส"]),c.addRow(["ค่าอุณหภูมิต่ำสุด",parseFloat(l.toFixed(2)),"องศาเซลเซียส"]),c.addRow(["ค่าอุณหภูมิเฉลี่ย",parseFloat(d.toFixed(2)),"องศาเซลเซียส"]),c.addRow([]),c.addRow(i),c.addRows(n[e]),r&&c.getColumn(r).eachCell(function(e){e.fill={type:"pattern",pattern:"solid",fgColor:(0,p.qY)(e.value)}}),(0,p.hK)(c,7),(0,p.LQ)(c,1),(0,p.LQ)(c,2)}}):o.addWorksheet("ไม่พบข้อมูล",s),(0,p.ti)(o,t)},Kt=function(e,t,n){var i={};return t.forEach(function(t){i[t.imei]=i[t.imei]||[],i[t.imei].push([(0,p.NS)(e,t.imei),t.imei,(0,p.Yq)(t.timestamp),t.speed,parseFloat(t.temperature),t.latitude/1e7+", "+t.longitude/1e7,t.locationName,parseFloat((0,p.fn)(e,t.imei,t).toFixed(1)),"undefined"!=typeof n&&t.mcr_license_no in n?n[t.mcr_license_no].name:(0,p.Cb)(t.mcr_license_no,t.mcr_driver_name),t.timestamp])}),i},zt=Gt,$t=function(){var e=(0,o.A)((0,r.A)().m(function e(t,n,i,a,c){var u;return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:return u=s.A.unix(i).format("D_MMM_YY")+"-ถึง-"+s.A.unix(a).format("D_MMM_YY"),e.n=1,l.A.post("".concat(d.Ay.c
1oreApi,"/report-summary-event"),{eventType:"END_TRIP",imeis:n,start:i,stop:a}).then(function(){var e=(0,o.A)((0,r.A)().m(function e(n){var o;return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:o="Summary_Report_"+u,Xt(o,t,n.data,i,a,c);case 1:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}()).catch(function(e){console.log("An error occurred:",e),Ee(e),Re.A.dispatch("loading/setReportLoading",!1)});case 1:return e.a(2)}},e)}));return function(t,n,i,a,r){return e.apply(this,arguments)}}(),Xt=function(){var e=(0,o.A)((0,r.A)().m(function e(t,n,i,a,o,c){var l,d,m,h,f,g,v,y,_,k,w,S,b,T,A,E,x,N,R,F,D;return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:if(l=new(u().Workbook),d={properties:{tabColor:{argb:"FF41C173"}},pageSetup:{paperSize:9,orientation:"landscape"}},!c||!c.url){e.n=2;break}return h=c.ext.substring(1),e.n=1,(0,p.kX)(c);case 1:f=e.v,m=l.addImage({base64:f,extension:h});case 2:for(T in g=["ทะเบียนรถ","Idling >5 min (ครั้ง)","Idling >5 min (นาที)","stop >10 min (ครั้ง)","stop >10 min (นาที)","overspeed (ครั้ง)","distance (กม)","จำนวนน้ำมัน","สูตรอัตราสิ้นเปลือง"],v=[{key:"plate_no",width:30,style:{font:p.Rv}},{key:"totalCountIdling",width:25},{key:"idtotalTimeIdlingling",width:25},{key:"totalCountstop",width:25},{key:"totalTimeStop",width:25},{key:"overspeed",width:25},{key:"distance",width:25},{key:"fuel",width:25},{key:"fuelUsedRate",width:25}],y=s.A.unix(a).format("D_MMM_YYYY")+"-ถึง-"+s.A.unix(o).format("D_MMM_YYYY"),_="รายงานสรุปพร้อมอัตราสิ้นเปลือง ประจำวันที่ ".concat(y),k=" ",w=l.addWorksheet("Summary",d),S=1,w.pageSetup.margins=p.Yy,w.columns=v,c&&c.url&&(S=2,(0,p.U0)(w,m)),w.addRow([_]),w.addRow([k]),w.addRow([]),w.addRow(g),b=4,n)A=n[T].imei,A in i&&(b+=1,E="totalCountIdling"in i[A]?i[A].totalCountIdling.value:0,x="totalTimeIdling"in i[A]?i[A].totalTimeIdling.value:0,N="totalCountStop"in i[A]?i[A].totalCountStop.value:0,R="totalTimeStop"in i[A]?i[A].totalTimeStop.value:0,F="overSpeedCount"in i[A]?i[A].overSpeedCount.value:0,D="totalDistance"in i[A]?i[A].totalDistance.value:0,w.addRow([n[T].plate,E,x,N,R,F,D,0]),w.getCell("I".concat(b)).value={formula:"G".concat(b,"/H").concat(b),result:0});(0,p.hK)(w,S+3),(0,p.LQ)(w,S),(0,p.ti)(l,t);case 3:return e.a(2)}},e)}));return function(t,n,i,a,r,o){return e.apply(this,arguments)}}(),Zt=$t,Jt=function(e,t,n){var i={},a={},r={};return t.forEach(function(t){i[t.imei]=i[t.imei]||[];var o=(0,p.Lv)(n,t),s=t.imei;a[s]=a[s]||0,r[s]=r[s]||0;var c,u=t.positionDataStart,l=t.positionDataEnd,d=parseFloat((0,p.fn)(e,t.imei,t.positionDataEnd).toFixed(2)-(0,p.fn)(e,t.imei,t.positionDataStart).toFixed(2)),m="https://www.google.com/maps/dir/?api=1&origin=".concat(u.latitude/1e7,",").concat(u.longitude/1e7,"&destination=").concat(l.latitude/1e7,",").concat(l.longitude/1e7,"&travelmode=driving");a[s]=parseFloat((d+a[s]).toFixed(2)),r[s]=t.stopTime-t.startTime+r[s],c=[(0,p.Yq)(t.startTime),o.start,(0,p.Yq)(t.stopTime),o.end,(0,p.a3)(t.startTime,t.stopTime),d,parseFloat((0,p.fn)(e,t.imei,t.positionDataEnd).toFixed(2)),t.value={text:"link",hyperlink:m},(0,p.NS)(e,t.imei),a[s],r[s],(0,p.ZD)(e,t.imei)],i[t.imei].push(c)}),i},en=function(e,t,n,i,a){var r=Jt(t,n,i),o=["วัน เวลา เริ่มต้น","ตำแหน่งเริ่มต้น","วัน เวลา สิ้นสุด","ตำแหน่งสิ้นสุด","รวมเวลา","รวมระยะทาง (กม.)","เลขกม.สะสม","GoogleMap"],s=[{key:"start",width:20},{key:"geolocationstart",width:60},{key:"stop",width:20},{key:"geolocationend",width:60},{key:"totalTime",width:20},{key:"totalDistance",width:16},{key:"cumOdometer",width:12},{key:"GoogleMap",width:12}];nn({fileName:e,reportByVehicle:r,tableHead:o,columnsSpec:s,statusColumn:null,logo:a})},tn=function(){var e=(0,o.A)((0,r.A)().m(function e(t,n,i,a,c,u,m){var p;return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:return p=s.A.unix(a).format("D_MMM_YY")+"-ถึง-"+s.A.unix(c).format("D_MMM_YY"),e.n=1,l.A.post("".concat(d.Ay.c
1oreApi,"/report-event"),{imeis:i,start:a,stop:c,eventType:"END_TRIP"}).then(function(){var e=(0,o.A)((0,r.A)().m(function e(t){var i;return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:i="Trip_A4_Report_"+p,en(i,n,t.data,u,m);case 1:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}()).catch(function(e){console.log(e),Ee(e),Re.A.dispatch("loading/setReportLoading",!1)});case 1:return e.a(2)}},e)}));return function(t,n,i,a,r,o,s){return e.apply(this,arguments)}}(),nn=function(){var e=(0,o.A)((0,r.A)().m(function e(t){var n,i,a,o,c,l,d,m,h,f,g;return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:if(n=t.fileName,i=t.reportByVehicle,a=t.tableHead,o=t.columnsSpec,c=t.statusColumn,l=t.logo,d=new(u().Workbook),m={properties:{tabColor:{argb:"FF41C173"}},pageSetup:{paperSize:9,orientation:"landscape"}},!l||!l.url){e.n=2;break}return f=l.ext.substring(1),e.n=1,(0,p.kX)(l);case 1:g=e.v,h=d.addImage({base64:g,extension:f});case 2:Object.keys(i).length>0?Object.keys(i).forEach(function(e){var t,n=1,r=null,u="",f=0,g="",v="",y=i[e];u=y[0][8],t=y[0][11],r=d.addWorksheet(u,m),r.pageSetup.margins=p.Yy,r.columns=o;var _=y[y.length-1][9],k=(0,s.A)("1970-01-01").startOf("day").seconds(y[y.length-1][10]).format("HH:mm:ss");g="รายงานการเดินทางของ ".concat(t," ทะเบียน ").concat(u," เวลาเริ่ม ").concat(y[0][0]," ถึง ").concat(y[y.length-1][2]),v="รวมระยะทางทั้งสิ้น ".concat(_," กม. รวมเวลา ").concat(k," ชม.:นาที:วินาที");var w=[];for(var S in y)w.push(y[S].filter(function(e,t){return t<8}));l&&l.url&&(n=2,(0,p.U0)(r,h)),r.addRow([g]),r.addRow([v]),r.addRow([]),r.addRow(a),r.addRows(w),r.addRow([]),r.addRow([]),c&&r.getColumn(c).eachCell(function(e){e.fill={type:"pattern",pattern:"solid",fgColor:(0,p.qY)(e.value)}}),r.getColumn(8).font={underline:!0,bold:!0,color:{argb:"FF0000FF"}},r.getColumn(8).alignment={horizontal:"center"},(0,p.hK)(r,n+3+f),(0,p.LQ)(r,n+f),(0,p.LQ)(r,n+1+f,"FFA29BFC"),f=f+y.length+6}):d.addWorksheet("ไม่พบข้อมูล",m),(0,p.ti)(d,n);case 3:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),an=tn;function rn(e,t){var n=s.A.duration(1e3*t);e.push(["","","","","รวม","".concat(n.days()," วัน ").concat(n.hours(),":").concat(n.minutes(),":").concat(n.seconds())])}function on(e,t,n,i,a){return sn.apply(this,arguments)}function sn(){return sn=(0,o.A)((0,r.A)().m(function e(t,n,i,a,o){var c;return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:return c=s.A.unix(i).format("D_MMM_YY")+"-ถึง-"+s.A.unix(a).format("D_MMM_YY"),e.n=1,l.A.post("".concat(d.Ay.coreApi,"/report-enter-exit-geofence"),{imeis:t,selectedGeofences:n,start:i,stop:a}).then(function(e){var t="Enter_Exit_Geofence_Report_"+c;cn(t,e.data,o.logo)}).catch(function(e){console.log("An error occurred:",e),Ee(e),Re.A.dispatch("loading/setReportLoading",!1)});case 1:return e.a(2)}},e)})),sn.apply(this,arguments)}function cn(e,t,n){var i={},a=(0,Me.A)(Re.A.getters["vehicle/vehicles"].map(function(e){return{plate:e.plate_number,name:e.name,odo_canbus_offset:e.odo_canbus_offset,canbus_fuel_enable:e.canbus_fuel_enable,odo_canbus_enable:e.odo_canbus_enable,overspeed_limit:e.overspeed_limit,imei:e.device?parseFloat(e.device.imei):""}}));return Object.keys(t).forEach(function(e){if(t[e].length>0){e in i||(i[e]={data:[],startTime:(0,p.Yq)(t[e][0]["enter_time"]),endTime:(0,p.Yq)(t[e][t[e].length-1]["exit_time"])});for(var n=0,r=0;r<=t[e].length-1;r++){var o=t[e][r];if(r>0){var s=t[e][r-1];o["name"]!==s["name"]&&(rn(i[e].data,n),n=0)}n=n+o["exit_time"]-o["enter_time"],i[e].data.push([o["name"],(0,p.NS)(a,Number(e)),(0,p.ZD)(a,Number(e)),(0,p.Yq)(o["enter_time"]),(0,p.Yq)(o["exit_time"]),(0,p.a3)(o["enter_time"],o["exit_time"])]),r===t[e].length-1&&rn(i[e].data,n)}}}),un(e,i,n)}function un(e,t,n){return ln.apply(this,arguments)}function ln(){return ln=(0,o.A)((0,r.A)().m(function e(t,n,i){var a,o,s,c,l,d,m;return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:if(a=["ชื่อสถานี","ทะเบียน","ชื่อ","เวลาเข้า","เวลาออก","รวมระยะเวลา"],o=[{key:"geofenceName",width:25},{key:"plateNumber",width:15,style:{font:p.Rv}},{key:"name",width:15,style:{numFmt:"0"}},{key:"enterTime",width:20},{key:"exitTime",width:20},{key:"totalSpendingTime",width:20}],s=new(u().Workbook),c={properties:{tabColor:{argb:"FF41C173"}},pageSetup:{paperSize:9,orientation:"landscape"}},!i||!i.url){e.n=2;break}return d=i.ext.substring(1),e.n=1,(0,p.kX)(i);case 1:m=e.v,l=s.addImage({base64:m,extension:d});case 2:return Object.keys(n).length>
10?Object.keys(n).forEach(function(e){var t=1,r=null,u=n[e]["data"][0][1];r=s.addWorksheet(u,c),r.pageSetup.margins=p.Yy,r.columns=o;var d="รายงานเข้า-ออกสถานี ของ รถทะเบียน ".concat(u," เวลาเริ่ม ").concat(n[e].startTime," ถึง ").concat(n[e].endTime);i&&i.url&&(t=2,(0,p.U0)(r,l)),r.addRow([d]),r.addRow([]),r.addRow(a),r.addRows(n[e].data),r.addRow([]),r.addRow([]),(0,p.hK)(r,t+2),(0,p.LQ)(r,t)}):s.addWorksheet("ไม่พบข้อมูล",c),e.a(2,(0,p.ti)(s,t))}},e)})),ln.apply(this,arguments)}var dn=on;function mn(e){var t=e.resultsByImei,n=e.vehicles,i={};Object.keys(t).forEach(function(e){var n={};t[e].forEach(function(e){var t=s.A.unix(e.startTime).startOf("day").unix();t in n||(n[t]={count:0,totalTimeSec:0}),n[t].count++,n[t].totalTimeSec=n[t].totalTimeSec+parseInt(e.stopTime-e.startTime)}),i[e]=Object.keys(n).map(function(e){return{date:s.A.unix(e).format("D MMM YYYY"),count:n[e].count,totalTimeSec:n[e].totalTimeSec}})});var a=[],r=0,o=0,c=Object.keys(i).map(function(e){var t=(0,p.NS)(n,parseInt(e)),a=i[e].reduce(function(e,t){return e+t.count},0),r=i[e].reduce(function(e,t){return e+t.totalTimeSec},0);return{plateNumber:t,count:a,totalTimeSec:r}});return c.sort(function(e,t){return t.totalTimeSec-e.totalTimeSec}).forEach(function(e,t){a.push([t+1,e.plateNumber,e.count,(0,p.a3)(0,e.totalTimeSec)]),r+=e.count,o+=e.totalTimeSec}),a.push([null,"รวม",r,(0,p.a3)(0,o)]),{columnSpec:[{key:"no",width:5,style:{numFmt:"0",font:p.Rv}},{key:"name",width:20},{key:"count",width:15},{key:"totalTimeSec",width:15}],summaryByImei:Object.keys(i).map(function(e){return{title:"สรุปรายงานจอดรถติดเครื่อง ของ รถทะเบียน ".concat((0,p.NS)(n,parseInt(e))),tableHead:["ที่","วันที่","จำนวนที่เกิน","เวลารวม"],tableData:i[e].map(function(e,t){return[t+1,e.date,e.count,(0,p.a3)(0,e.totalTimeSec)]})}}),summaryAll:{title:"สรุปรายงานจอดรถติดเครื่องของทะเบียนรถทั้งหมด",tableHead:["ที่","ทะเบียน","จำนวนที่เกิน","เวลารวม"],tableData:a}}}function pn(e){var t=e.resultsByImei,n=e.vehicles,i=e.geofences,a=e.dictOfDriver,r=[];return Object.keys(t).forEach(function(e){var o=t[e],c=(0,p.NS)(n,parseInt(e)),u=(0,p.ZD)(n,parseInt(e)),l=0,d=[];o.forEach(function(e){var t=(0,p.Lv)(i,e),n="undefined"!=typeof e.positionDataStart.mcr_license_no?e.positionDataStart.mcr_license_no:"",r=e.positionDataStart.mcr_driver_name||"";d.push([c,u,(0,p.Yq)(e.startTime),(0,p.Yq)(e.stopTime),(0,p.a3)(e.startTime,e.stopTime),t.end,"".concat(e.lat/1e7,", ").concat(e.lng/1e7),"undefined"!=typeof a&&n in a?a[n].name:(0,p.Cb)(n,r),e.startTime,e.stopTime]),l+=parseInt(e.stopTime-e.startTime)}),r.push({sheetName:c,title:"รายงานจอดรถติดเครื่อง ของ รถทะเบียน ".concat(c," เวลาเริ่ม ").concat((0,p.Yq)(o[0].startTime)," ถึง ").concat((0,p.Yq)(o[o.length-1].stopTime)),meta:"รวมเวลา ".concat((0,s.A)("1970-01-01").startOf("day").seconds(l).format("HH:mm:ss")," ชม.:นาที:วินาที"),columnSpec:[{key:"plate_number",width:12,style:{font:p.Rv}},{key:"name",width:22,style:{numFmt:"0"}},{key:"start",width:20},{key:"stop",width:20},{key:"totalTime",width:12},{key:"reversegeolocationend",width:40},{key:"geolocation",width:30},{key:"driver",width:15},{key:"timeStampStart",width:15},{key:"timeStampStop",width:15}],tableHead:["ทะเบียนรถ","ชื่อ","วัน เวลา เริ่มต้น","วัน เวลา สิ้นสุด","รวมเวลา","ตำแหน่ง","ละติจูด ลองจิจูด","ผู้ใช้รถ","timestamp เริ่มต้น","timestamp สิ้นสุด"],tableData:d})}),r}var hn=function(){var e=(0,o.A)((0,r.A)().m(function e(t,n,i,a,o,c,l,d,m){var h,f,g,v,y,_,k,w,S,b,T,A,E;return(0,r.A)().w(function(e){while(1)switch(e.p=e.n){case 0:return e.p=0,e.n=1,wt.resetStore();case 1:return e.n=2,wt.query({query:bt(),variables:{eventTypes:t,imeis:i,start:a,stop:o}}).then(function(e){return e.data.eventsTypeByIMEI.filter(function(e){return e.stopTime-e.startTime>=c})}).catch(function(e){throw e});case 2:if(h=e.v,f=new(u().Workbook),g={properties:{tabColor:{argb:"FF41C173"}},pageSetup:{paperSize:9,orientation:"landscape"}},!(h.length>0)){e.n=5;break}if(v={},h.forEach(function(e){e.imei in v||(v[e.imei]=[]),v[e.imei].push(e)}),y=pn({resultsByImei:v,vehicles:n,geofences:l,dictOfDriver:d}),_=mn({resultsByImei:v,vehicles:n}),k=f.addWorksheet("สรุป",g),k.pageSetup.margins=p.Yy,k.columns=_.columnSpec,w=1,_.summaryByImei.forEac
1h(function(e){k.addRow([e.title]),k.addRow(e.tableHead),k.addRows(e.tableData),k.addRows([[],[]]),(0,p.LQ)(k,w),(0,p.hK)(k,w+1),w=w+2+e.tableData.length+2}),k.addRow([_.summaryAll.title]),k.addRow(_.summaryAll.tableHead),k.addRows(_.summaryAll.tableData),(0,p.LQ)(k,w),(0,p.hK)(k,w+1),!m||!m.url){e.n=4;break}return b=m.ext.substring(1),e.n=3,(0,p.kX)(m);case 3:T=e.v,S=f.addImage({base64:T,extension:b});case 4:y.forEach(function(e){var t=1,n=f.addWorksheet(e.sheetName,g);n.pageSetup.margins=p.Yy,n.columns=e.columnSpec,m&&m.url&&(t=2,(0,p.U0)(n,S)),n.addRow([e.title]),n.addRow([e.meta]),n.addRow([]),n.addRow(e.tableHead),n.addRows(e.tableData),(0,p.hK)(n,t+3),(0,p.LQ)(n,t),(0,p.LQ)(n,t+1)}),e.n=6;break;case 5:f.addWorksheet("ไม่พบข้อมูล",g);case 6:return A="Idling_Report_".concat(s.A.unix(a).format("D_MMM_YY")+"-ถึง-"+s.A.unix(o).format("D_MMM_YY")),e.a(2,(0,p.ti)(f,A));case 7:return e.p=7,E=e.v,console.error("newIdlingReport",E),e.a(2,E)}},e,null,[[0,7]])}));return function(t,n,i,a,r,o,s,c,u){return e.apply(this,arguments)}}(),fn=hn,gn=n(25229),vn=["ทะเบียน","เวลา","ประเภทแจ้งเตือน","สถานที่","alarm source","alarm level","alarm status","alarm speed","alarm sign","รูปภาพ"],yn=[{key:"plate_number",width:20,style:{numFmt:"0",font:p.Rv}},{key:"start_time",width:20},{key:"type",width:30},{key:"location",width:28},{key:"alarm_source",width:18},{key:"alarm_level",width:18},{key:"alarm_status",width:18},{key:"alarm_speed",width:18},{key:"alarm_sign",width:18},{key:"images",width:20}];function _n(e){return kn.apply(this,arguments)}function kn(){return kn=(0,o.A)((0,r.A)().m(function e(t){var n,i,a;return(0,r.A)().w(function(e){while(1)switch(e.p=e.n){case 0:return e.p=0,e.n=1,fetch(t);case 1:return n=e.v,e.n=2,n.arrayBuffer();case 2:return i=e.v,e.a(2,i);case 3:return e.p=3,a=e.v,console.error(a),e.a(2,null)}},e,null,[[0,3]])})),kn.apply(this,arguments)}function wn(e){var t=e.split(".").pop().split("?")[0].toLowerCase(),n={jpg:"jpeg",jpeg:"jpeg",png:"png",gif:"gif"};return n[t]||"png"}function Sn(e){var t={};return e.forEach(function(e){t[e.licenseNum]=t[e.licenseNum]||[],t[e.licenseNum].push(e)}),t}function bn(e,t,n,i,a){return Tn.apply(this,arguments)}function Tn(){return Tn=(0,o.A)((0,r.A)().m(function e(t,n,i,a,s){var c,l,d,m,h,f,g,v,y,_,k,w,S,b,T,A,E,x,N,R,F;return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:if(c=new(u().Workbook),l={properties:{tabColor:{argb:"FF41C173"},defaultColWidth:20},pageSetup:{paperSize:9,orientation:"portrait",fitToPage:!0}},!s||!s.url){e.n=2;break}return m=s.ext.substring(1),e.n=1,(0,p.kX)(s);case 1:h=e.v,d=c.addImage({base64:h,extension:m});case 2:if(!(Object.keys(n).length>0)){e.n=10;break}f=0,g=Object.keys(n);case 3:if(!(f<g.length)){e.n=9;break}v=g[f],y=1,_=c.addWorksheet(v,l),_.pageSetup.margins=p.Yy,_.columns=yn,k="รายงานแจ้งเตือนความปลอดภัย ของ รถทะเบียน ".concat(v," เวลาเริ่ม ").concat((0,p.Yq)(i)," ถึง ").concat((0,p.Yq)(a)),s&&s.url&&(y=2,(0,p.U0)(_,d)),_.addRow([k]),_.addRow([]),_.addRow(vn),R=Ft(n[v]);case 4:if((F=R()).done){e.n=7;break}if(w=F.value,S=n[v][w],b=_.addRow({plate_number:S.licenseNum,start_time:S.startTime,type:S.alarmType,location:S.location,alarm_source:S.alarmSource,alarm_level:S.alarmLevel,alarm_status:S.alarmStatus,alarm_speed:S.alarmSpeed,alarm_sign:S.alarmSign}),!(S.images.length>0)){e.n=6;break}return e.n=5,Promise.all(S.images.map(function(){var e=(0,o.A)((0,r.A)().m(function e(t){return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:return e.n=1,_n(t);case 1:return e.a(2,e.v)}},e)}));return function(t){return e.apply(this,arguments)}}()));case 5:for(T=e.v,A=0;A<=T.length-1;A++)E=T[A],E&&(b.height=90,b.alignment={vertical:"middle"},x=S.images[A],N=c.addImage({buffer:E,extension:wn(x)}),_.addImage(N,{tl:{col:9.1+A,row:b.number-.9},ext:{width:140,height:140}}));case 6:e.n=4;break;case 7:(0,p.hK)(_,y+2),_.getRow(y+2).alignment={horizontal:"center"},(0,p.LQ)(_,y);case 8:f++,e.n=3;break;case 9:e.n=11;break;case 10:c.addWorksheet("ไม่พบข้อมูล",l);case 11:return e.a(2,(0,p.ti)(c,t))}},e)})),Tn.apply(this,arguments)}function An(e,t,n,i){return En.apply(this,arguments)}function En(){return En=(0,o.A)((0,r.A)().m(function e(t,n,i,a){var o,c,u,m,p,h;return(0,r.A)().w(function(e){while(1)switch(e.n){case 0:return o=s.A.unix(n),c=s.A.unix(i),e.n=1,l.A.post("".concat(d.Ay.richmorApi,"/safety-alarm-list"),{license_num:t,start_time:o.format("YYYY-MM-DD HH:mm:ss"),end_time:c.format("YYYY-MM-DD HH:mm:ss")}).then(function(e){var t=e.data;return t.data||[]}).catch(function(e){return console.log("An error occurred:",e),[]});case 1:return u=e.v,m=Sn(u),p=o.format("D_MMM_YY")+"-ถึง-"+c.format("D_MMM_YY"),h="Safety_Alarm_Report_"+p,e.n=2,bn(h,m,n,i,a);case 2:return e.a(2,e.v)}},e)})),En.apply(this,arguments)}var xn=An,Nn={tripReport:Ie,overSpeedReport:qe,positionReport:Ue,fuelChartData:st,fuelReport:Ze,ptoReport:xt,idlingReport:Yt,geofenceReport:Ht,summaryReport:Ut,temperatureReport:zt,fuelUsedRateSumReport:Zt,tripA4Report:an,enterExitGeofenceReport:dn,newIdlingReport:fn,getSafetyAlarmReport:xn},Rn=Object.freeze({S01GeofenceCurrent:"geofence_current_report",S02FuelRate:"fuel_rate_report",S03FleetSummary:"fleet_summary_report",S04TempWithChart:"temperature_with_chart",S05TempPdf:"report_temperature_pdf",N01Daily:"daily",N02Trip:"trip",N03Trip24hr:"trip24hr",N04TripOver4hour:"tripOver4hour",N05Fuel:"fuel",N06Temperature:"temperature",N07Overspeed:"overspeed",N08Position:"position",N09FuelChart:"fuelChart",N10TempChart:"tempChart",N11Pto:"pto",N12Idling:"idling",N13IdlingSummary:"idlingSummary",N14Geofences:"geofences",N15Summary:"summary",N16FuelUsedRateSummary:"fuelUsedRateSummary",N17IdlingOpenPTO:"idlingOpenPTO",N18TripA4:"tripA4",N19SpeedChart:"speedChart",N20VehicleUsageSummary:"vehicleUsageSummary",N21EnterExitGeofenceReport:"enterExitGeofenceReport",N22SummaryByDay:"summaryByDay",N23FuelStdRate:"fuelStdRate",N24TripOver8hour:"tripOver8hour",N25AllDevice:"allDevice",N26KPIDriver:"kpiDriver",
1N27SafetyAlarm:"safetyAlarm"}),Fn=function(){return[{no:1,label:gn.A.t("reports.reportTypes.geofenceCurrent"),value:Rn.S01GeofenceCurrent},{no:2,label:gn.A.t("reports.reportTypes.fuelRate"),value:Rn.S02FuelRate},{no:3,label:gn.A.t("reports.reportTypes.fleetSummary"),value:Rn.S03FleetSummary},{no:4,label:gn.A.t("reports.reportTypes.tempWithChart"),value:Rn.S04TempWithChart},{no:5,label:gn.A.t("reports.reportTypes.tempPdf"),value:Rn.S05TempPdf}]},Dn=function(){return[{no:1,label:gn.A.t("reports.reportTypes.daily"),value:Rn.N01Daily},{no:2,label:gn.A.t("reports.reportTypes.trip"),value:Rn.N02Trip},{no:6,label:gn.A.t("reports.reportTypes.temperature"),value:Rn.N06Temperature},{no:8,label:gn.A.t("reports.reportTypes.position"),value:Rn.N08Position},{no:20,label:gn.A.t("reports.reportTypes.vehicleUsageSummary"),value:Rn.N20VehicleUsageSummary}]},Cn=[{no:1,value:Rn.S01GeofenceCurrent,labelKey:"geofenceCurrent"},{no:2,value:Rn.S02FuelRate,labelKey:"fuelRate"},{no:3,value:Rn.S03FleetSummary,labelKey:"fleetSummary"},{no:4,value:Rn.S04TempWithChart,labelKey:"tempWithChart"},{no:5,value:Rn.S05TempPdf,labelKey:"tempPdf"}],On=[{no:1,value:Rn.N01Daily,labelKey:"daily"},{no:2,value:Rn.N02Trip,labelKey:"trip"},{no:6,value:Rn.N06Temperature,labelKey:"temperature"},{no:8,value:Rn.N08Position,labelKey:"position"},{no:20,value:Rn.N20VehicleUsageSummary,labelKey:"vehicleUsageSummary"}];function In(e){var t,n=(t={},(0,a.A)((0,a.A)((0,a.A)((0,a.A)((0,a.A)((0,a.A)((0,a.A)((0,a.A)((0,a.A)((0,a.A)(t,Rn.S01GeofenceCurrent,"geofenceCurrent"),Rn.S02FuelRate,"fuelRate"),Rn.S03FleetSummary,"fleetSummary"),Rn.S04TempWithChart,"tempWithChart"),Rn.S05TempPdf,"tempPdf"),Rn.N01Daily,"daily"),Rn.N02Trip,"trip"),Rn.N03Trip24hr,"trip24hr"),Rn.N04TripOver4hour,"tripOver4hour"),Rn.N05Fuel,"fuel"),(0,a.A)((0,a.A)((0,a.A)((0,a.A)((0,a.A)((0,a.A)((0,a.A)((0,a.A)((0,a.A)((0,a.A)(t,Rn.N06Temperature,"temperature"),Rn.N07Overspeed,"overspeed"),Rn.N08Position,"position"),Rn.N09FuelChart,"fuelChart"),Rn.N10TempChart,"tempChart"),Rn.N11Pto,"pto"),Rn.N12Idling,"idling"),Rn.N13IdlingSummary,"idlingSummary"),Rn.N14Geofences,"geofences"),Rn.N15Summary,"summary"),(0,a.A)((0,a.A)((0,a.A)((0,a.A)((0,a.A)((0,a.A)((0,a.A)((0,a.A)((0,a.A)((0,a.A)(t,Rn.N16FuelUsedRateSummary,"fuelUsedRateSummary"),Rn.N17IdlingOpenPTO,"idlingOpenPTO"),Rn.N18TripA4,"tripA4"),Rn.N19SpeedChart,"speedChart"),Rn.N20VehicleUsageSummary,"vehicleUsageSummary"),Rn.N21EnterExitGeofenceReport,"enterExitGeofence"),Rn.N22SummaryByDay,"summaryByDay"),Rn.N23FuelStdRate,"fuelStdRate"),Rn.N24TripOver8hour,"tripOver8hour"),Rn.N25AllDevice,"allDevice"),(0,a.A)((0,a.A)(t,Rn.N26KPIDriver,"kpiDriver"),Rn.N27SafetyAlarm,"safetyAlarm")),i=n[e];return i?gn.A.t("reports.reportTypes.".concat(i)):"-"}},90453:function(e){var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"eventsTypeByIMEI"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"eventTypes"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"imeis"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"start"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"stop"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"eventsTypeByIMEI"},arguments:[{kind:"Argument",name:{kind:"Name",value:"eventTypes"},value:{kind:"Variable",name:{kind:"Name",value:"eventTypes"}}},{kind:"Argument",name:{kind:"Name",value:"imeis"},value:{kind:"Variable",name:{kind:"Name",value:"imeis"}}},{kind:"Argument",name:{kind:"Name",value:"start"},value:{kind:"Variable",name:{kind:"Name",value:"start"}}},{kind:"Argument",name:{kind:"Name",value:"stop"},value:{kind:"Variable",name:{kind:"Name",value:"stop"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"eventType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"imei"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"startTime"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"stopTime"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lat"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lng"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"maxSpeed"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"avgSpeed"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"locationStart"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"locationEnd"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"positionDataStart"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"speed"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"timestamp"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"longitude"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"latitude"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"event_id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"imei"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"io"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"mcr_license_no"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"positionDataEnd"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"speed"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"timestamp"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"longitude"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"latitude"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"event_id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"imei"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"io"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"pto"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:621}};t.loc.source={body:"query eventsTypeByIMEI(\n  $eventTypes: [String]!\n  $imeis: [Float]!\n  $start: Int!\n  $stop: Int!\n) {\n  eventsTypeByIMEI(\n    eventTypes: $eventTypes\n    imeis: $imeis\n    start: $start\n    stop: $stop\n  ) {\n    id\n    eventType\n    imei\n    startTime\n    stopTime\n    lat\n    lng\n    maxSpeed\n    avgSpeed\n    locationStart\n    locationEnd\n    positionDataStart {\n      speed\n      timestamp\n      longitude\n      latitude\n      event_id\n      imei\n      io\n      mcr_license_no\n    }\n    positionDataEnd {\n      speed\n      timestamp\n      longitude\n      latitude\n      event_id\n      imei\n      io\n    }\n    pto\n  }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function n(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);
1else if("VariableDefinition"===e.kind){var i=e.type;"NamedType"===i.kind&&t.add(i.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(e){n(e,t)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(e){n(e,t)}),e.definitions&&e.definitions.forEach(function(e){n(e,t)})}var i={};function a(e,t){for(var n=0;n<e.definitions.length;n++){var i=e.definitions[n];if(i.name&&i.name.value==t)return i}}function r(e,t){var n={kind:e.kind,definitions:[a(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=i[t]||new Set,o=new Set,s=new Set;r.forEach(function(e){s.add(e)});while(s.size>0){var c=s;s=new Set,c.forEach(function(e){if(!o.has(e)){o.add(e);var t=i[e]||new Set;t.forEach(function(e){s.add(e)})}})}return o.forEach(function(t){var i=a(e,t);i&&n.definitions.push(i)}),n}(function(){t.definitions.forEach(function(e){if(e.name){var t=new Set;n(e,t),i[e.name.value]=t}})})(),e.exports=t,e.exports.eventsTypeByIMEI=r(t,"eventsTypeByIMEI")},29486:function(e){var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"positions"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"imeis"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"start"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"stop"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"positions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"imei_in"},value:{kind:"Variable",name:{kind:"Name",value:"imeis"}}},{kind:"ObjectField",name:{kind:"Name",value:"timestamp_gte"},value:{kind:"Variable",name:{kind:"Name",value:"start"}}},{kind:"ObjectField",name:{kind:"Name",value:"timestamp_lte"},value:{kind:"Variable",name:{kind:"Name",value:"stop"}}}]}},{kind:"Argument",name:{kind:"Name",value:"sort"},value:{kind:"StringValue",value:"timestamp:asc",block:!1}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"timestamp"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"latitude"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"longitude"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"angle"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"satellites"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"speed"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"io"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"imei"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"location"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"fuelLitre"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"fuelLitreCanbus"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"engineStatus"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"mcr_license_no"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"mcr_driver_name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"mcr_card_status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"fuelLitreCanbusTruck"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"odo"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:438}};t.loc.source={body:'query positions($imeis: [Float]!, $start: Int!, $stop: Int!) {\n  positions(\n    where: { imei_in: $imeis, timestamp_gte: $start, timestamp_lte: $stop }\n    sort: "timestamp:asc"\n  ) {\n    timestamp\n    latitude\n    longitude\n    angle\n    satellites\n    speed\n    io\n    imei\n    location\n    fuelLitre\n    fuelLitreCanbus\n    engineStatus\n    mcr_license_no\n    mcr_driver_name\n    mcr_card_status\n    fuelLitreCanbusTruck\n    odo\n  }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};function n(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);
1else if("VariableDefinition"===e.kind){var i=e.type;"NamedType"===i.kind&&t.add(i.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(e){n(e,t)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(e){n(e,t)}),e.definitions&&e.definitions.forEach(function(e){n(e,t)})}var i={};function a(e,t){for(var n=0;n<e.definitions.length;n++){var i=e.definitions[n];if(i.name&&i.name.value==t)return i}}function r(e,t){var n={kind:e.kind,definitions:[a(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=i[t]||new Set,o=new Set,s=new Set;r.forEach(function(e){s.add(e)});while(s.size>0){var c=s;s=new Set,c.forEach(function(e){if(!o.has(e)){o.add(e);var t=i[e]||new Set;t.forEach(function(e){s.add(e)})}})}return o.forEach(function(t){var i=a(e,t);i&&n.definitions.push(i)}),n}(function(){t.definitions.forEach(function(e){if(e.name){var t=new Set;n(e,t),i[e.name.value]=t}})})(),e.exports=t,e.exports.positions=r(t,"positions")}}]);
2//# sourceMappingURL=714-legacy.fcff1c1e.js.map

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.