mobility-toolbox-js 1.7.1 → 1.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common/mixins/TrackerLayerMixin.js +18 -8
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/ol/controls/RoutingControl.js +150 -27
- package/ol/controls/RoutingControl.test.js +69 -2
- package/ol/layers/TralisLayer.test.js +40 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("mobility-toolbox-js",[],t):"object"==typeof exports?exports["mobility-toolbox-js"]=t():e["mobility-toolbox-js"]=t()}(this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=27)}([function(e,t){e.exports=require("ol/style")},function(e,t){e.exports=require("ol/proj")},function(e,t){e.exports=require("ol/extent")},function(e,t){e.exports=require("ol/Observable")},function(e,t){e.exports=require("ol/geom")},function(e,t){e.exports=require("ol/Feature")},function(e,t){e.exports=require("ol/format/GeoJSON")},function(e,t){e.exports=require("query-string")},function(e,t){e.exports=require("ol/layer")},function(e,t){e.exports=require("ol/transform")},function(e,t){e.exports=require("ol/Object")},function(e,t){e.exports=require("ol/layer/Layer")},function(e,t){e.exports=require("mapbox-gl")},function(e,t){e.exports=require("ol/source/Source")},function(e,t){e.exports=require("ol/source")},function(e,t){e.exports=require("ol")},function(e,t){e.exports=require("ol/geom/GeometryType")},function(e,t){e.exports=require("ol/format")},function(e,t){e.exports=require("@turf/transform-rotate")},function(e,t){e.exports=require("@turf/helpers")},function(e,t){e.exports=require("ol/Map")},function(e,t){e.exports=require("ol/control")},function(e,t){e.exports=require("ol/layer/Group")},function(e,t){e.exports=require("uuid")},function(e,t){e.exports=require("ol/geom/Point")},function(e,t){e.exports=require("ol/interaction")},function(e,t){e.exports=require("ol/events/condition")},function(e,t,r){e.exports=r(28)},function(e,t,r){"use strict";r.r(t);var n=r(20),o=r.n(n),i=r(21),c=r(3),a=r.n(c),u=r(22),s=r.n(u),l=r(23);function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){h(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=j(e);if(t){var o=j(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return g(this,r)}}function g(e,t){if(t&&("object"===f(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return O(e)}function O(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function j(e){return(j=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var w=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}(i,e);var t,r,n,o=m(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};b(this,i),(e=o.call(this)).defineProperties(t);var r=t.onClick,n=t.onHover;return n&&e.onHover(n),r&&e.onClick(r),t.copyrights&&(e.copyrights=t.copyrights),e.onUserClickCallback=e.onUserClickCallback.bind(O(e)),e.onUserMoveCallback=e.onUserMoveCallback.bind(O(e)),e}return t=i,(r=[{key:"defineProperties",value:function(e){var t=this,r=y({isQueryable:!0,isClickActive:!0,isHoverActive:!0},e),n=r.name,o=r.key,i=r.children,c=r.visible,a=r.properties,u=r.isBaseLayer,s=r.isQueryable,f=r.isClickActive,p=r.isHoverActive,h=r.hitTolerance,b=Object(l.v4)(),v=n||b;Object.defineProperties(this,{options:{value:e},name:{value:v},key:{value:o||v.toLowerCase()},isBaseLayer:{value:!!u},isQueryable:{value:!!s},isClickActive:{value:!!s&&!!f},isHoverActive:{value:!!s&&!!p},hitTolerance:{value:h||5,writable:!0},isReactSpatialLayer:{value:!0},children:{value:i||[],writable:!0},copyrights:{get:function(){return t.get("copyrights")},set:function(e){var r=Array.isArray(e)?e:[e];t.set("copyrights",r)}},visible:{value:void 0===c||c,writable:!0},properties:{value:y({},a||{})},map:{writable:!0},clickCallbacks:{value:[]},hoverCallbacks:{value:[]}})}},{key:"init",value:function(e){this.terminate(),this.map=e}},{key:"terminate",value:function(){}},{key:"get",value:function(e){return this.properties[e]}},{key:"set",value:function(e,t){this.properties[e]=t,this.dispatchEvent({type:"change:".concat(e),target:this})}},{key:"setVisible",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e!==this.visible&&(this.visible=e,this.dispatchEvent({type:"change:visible",target:this,stopPropagationDown:t,stopPropagationUp:r,stopPropagationSiblings:n}))}},{key:"getVisibleChildren",value:function(){return this.children.filter((function(e){return e.visible}))}},{key:"hasVisibleChildren",value:function(){return!!this.hasChildren(!0)}},{key:"hasChildren",value:function(e){return!!this.children.find((function(t){return t.visible===e}))}},{key:"addChild",value:function(e){this.children.unshift(e),this.dispatchEvent({type:"change:children",target:this})}},{key:"removeChild",value:function(e){for(var t=0;t<this.children.length;t+=1)if(this.children[t].name===e){this.children.splice(t,1);break}this.dispatchEvent({type:"change:children",target:this})}},{key:"getFeatureInfoAtCoordinate",value:function(e,t){return console.error("getFeatureInfoAtCoordinate must be implemented by inheriting layers",this.key),Promise.resolve({layer:this,features:[],coordinate:e})}},{key:"onClick",value:function(e){if("function"!=typeof e)throw new Error("onClick callback must be of type function:",e);this.clickCallbacks.includes(e)||this.clickCallbacks.push(e)}},{key:"unClick",value:function(e){if("function"==typeof e){var t=this.clickCallbacks.indexOf(e);t>-1&&this.clickCallbacks.splice(t,1)}}},{key:"onUserClickCallback",value:function(e){var t=this,r={features:[],layer:this,coordinate:e.coordinate,event:e};return this.isClickActive&&this.clickCallbacks.length?this.getFeatureInfoAtCoordinate(e.coordinate).then((function(e){var r=e.features,n=e.layer,o=e.coordinate;return t.clickCallbacks.forEach((function(e){return e(r,n,o)})),e})).catch((function(){return r})):Promise.resolve(r)}},{key:"onHover",value:function(e){if("function"!=typeof e)throw new Error("callback must be of type function.");this.hoverCallbacks.includes(e)||this.hoverCallbacks.push(e)}},{key:"unHover",value:function(e){if("function"==typeof e){var t=this.hoverCallbacks.indexOf(e);t>-1&&this.hoverCallbacks.splice(t,1)}}},{key:"onUserMoveCallback",value:function(e){var t=this,r={features:[],layer:this,coordinate:e.coordinate,event:e};return this.isHoverActive&&this.hoverCallbacks.length?this.getFeatureInfoAtCoordinate(e.coordinate).then((function(e){var r=e.features,n=e.layer,o=e.coordinate;return t.hoverCallbacks.forEach((function(e){return e(r,n,o)})),e})).catch((function(){return r})):Promise.resolve(r)}}])&&v(t.prototype,r),n&&v(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(a.a);function P(e){return(P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function S(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?k(Object(r),!0).forEach((function(t){T(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function T(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function C(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function E(){return(E="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=x(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function x(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=I(e)););return e}function R(e,t){return(R=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=I(e);if(t){var o=I(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return D(this,r)}}function D(e,t){if(t&&("object"===P(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function I(e){return(I=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var A=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&R(e,t)}(i,e);var t,r,n,o=_(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).olLayer&&t.olLayer.setVisible(t.visible),t}return t=i,(r=[{key:"defineProperties",value:function(e){E(I(i.prototype),"defineProperties",this).call(this,e),Object.defineProperties(this,{olLayer:{value:e.olLayer,writable:!0},olListenersKeys:{value:[]}})}},{key:"init",value:function(e){var t=this;if(E(I(i.prototype),"init",this).call(this,e),this.map&&(this.olListenersKeys.push(this.map.getLayers().on("remove",(function(e){e.element===t.olLayer&&t.terminate()}))),(this.isClickActive||this.isHoverActive)&&(this.toggleVisibleListeners(),this.olListenersKeys.push(this.on("change:visible",this.toggleVisibleListeners))),this.copyrights&&this.olLayer)){var r=this.copyrights||[];this.olLayer instanceof s.a?this.olLayer.getLayers().getArray().forEach((function(e){e.getSource().setAttributions(r)})):this.olLayer.getSource&&this.olLayer.getSource().setAttributions(r)}}},{key:"terminate",value:function(){Object(c.unByKey)(this.olListenersKeys),E(I(i.prototype),"terminate",this).call(this)}},{key:"setVisible",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e!==this.visible&&(E(I(i.prototype),"setVisible",this).call(this,e,t,r,n),this.olLayer&&this.olLayer.setVisible(this.visible))}},{key:"toggleVisibleListeners",value:function(){var e=this;this.isClickListenerKey&&this.isHoverListenerKey&&[this.isClickListenerKey,this.isHoverListenerKey].forEach((function(t){var r=e.olListenersKeys.indexOf(t);r>-1&&e.olListenersKeys.splice(r,1),Object(c.unByKey)([e.isHoverListenerKey,e.isClickListenerKey])})),this.visible&&(this.isClickActive&&(this.isClickListenerKey=this.map.on("singleclick",this.onUserClickCallback)),this.isHoverActive&&(this.isHoverListenerKey=this.map.on("pointermove",this.onUserMoveCallback)),this.olListenersKeys.push(this.isClickListenerKey,this.isHoverListenerKey))}},{key:"clone",value:function(e){return new i(S(S({},this.options),e))}}])&&C(t.prototype,r),n&&C(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(w),M=r(10),L=r.n(M);function B(e){return(B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?V(Object(r),!0).forEach((function(t){U(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function U(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function q(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function N(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function H(e,t){return(H=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function K(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Z(e);if(t){var o=Z(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return z(this,r)}}function z(e,t){if(t&&("object"===B(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Z(e){return(Z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var G=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&H(e,t)}(i,e);var t,r,n,o=K(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};q(this,i),(e=o.call(this,t)).defineProperties(t);var r=F({active:!1!==t.active},t),n=r.active;return e.active=n,e}return t=i,(r=[{key:"defineProperties",value:function(e){var t=this,r=F({},e),n=r.target,o=r.element,i=r.render;Object.defineProperties(this,{active:{get:function(){return t.get("active")},set:function(e){t.set("active",e),e?t.activate():t.deactivate(),t.render()}},map:{get:function(){return t.get("map")},set:function(e){if(t.map&&t.element&&t.element.parentNode&&t.element.parentNode.removeChild(t.element),t.deactivate(),t.set("map",e),t.map){var r=t.target||t.map.getContainer();t.element||t.createDefaultElement(),t.element&&r.appendChild(t.element),t.active&&t.activate()}t.render()}},target:{value:n},element:{value:o,writable:!0},render:{value:i||this.render,writable:!0}})}},{key:"activate",value:function(){this.deactivate()}},{key:"deactivate",value:function(){}},{key:"render",value:function(){}},{key:"createDefaultElement",value:function(){}}])&&N(t.prototype,r),n&&N(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(L.a);function W(e){return(W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function J(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$(Object(r),!0).forEach((function(t){Q(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Q(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function X(){return(X="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Y(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Y(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=ne(e)););return e}function ee(e,t){return(ee=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function te(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ne(e);if(t){var o=ne(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return re(this,r)}}function re(e,t){if(t&&("object"===W(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ne(e){return(ne=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function oe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ie(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ce(e,t,r){return t&&ie(e.prototype,t),r&&ie(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var ae=function(e){return function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ee(e,t)}(r,e);var t=te(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return oe(this,r),(e=t.call(this,J(J({},n),{},{layers:[],controls:[]}))).mobilityLayers=[],e.mobilityControls=[],(n.controls||[]).forEach((function(t){e.addControl(t)})),(n.layers||[]).forEach((function(t){e.addLayer(t)})),e}return ce(r,[{key:"getMobilityLayers",value:function(){return this.mobilityLayers}},{key:"getMobilityControls",value:function(){return this.mobilityControls}},{key:"addMobilityControl",value:function(e){this.mobilityControls.push(e),e.map=this}},{key:"removeMobilityControl",value:function(e){e.map=null,this.mobilityControls=this.mobilityControls.filter((function(t){return t!==e}))}},{key:"addControl",value:function(e,t){e instanceof G?this.addMobilityControl(e):X(ne(r.prototype),"addControl",this).call(this,e,t)}},{key:"removeControl",value:function(e){e instanceof G?this.removeMobilityControl(e):X(ne(r.prototype),"removeControl",this).call(this,e)}}]),r}(e)},ue=r(11),se=r.n(ue);function le(e){return(le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function fe(e,t){return(fe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function pe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=he(e);if(t){var o=he(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ye(this,r)}}function ye(e,t){if(t&&("object"===le(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function he(e){return(he=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function be(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ve(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function de(e,t,r){return t&&ve(e.prototype,t),r&&ve(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var me=function(e){return function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fe(e,t)}(r,e);var t=pe(r);function r(){return be(this,r),t.apply(this,arguments)}return de(r,[{key:"render",value:function(){this.element&&(this.element.innerHTML=this.active?this.getCopyrights().join(" | "):"")}},{key:"createDefaultElement",value:function(){this.element=document.createElement("div"),this.element.id="mbt-copyright",Object.assign(this.element.style,{position:"absolute",bottom:0,right:0,fontSize:".8rem",padding:"0 10px"})}}]),r}(e)};function ge(e){return function(e){if(Array.isArray(e))return Oe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Oe(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Oe(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var je=function(e){var t=e.filter((function(e){return null!=e&&e.trim&&e.trim()})),r=t.map((function(e){return e.toLowerCase()}));return ge(new Set(r)).map((function(e){return t.find((function(t){return t.toLowerCase()===e}))}))};function we(e){return(we="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Pe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ke(){return(ke="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Se(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Se(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Re(e)););return e}function Te(e,t){return(Te=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ce(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Re(e);if(t){var o=Re(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ee(this,r)}}function Ee(e,t){if(t&&("object"===we(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return xe(e)}function xe(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Re(e){return(Re=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var _e=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Te(e,t)}(i,e);var t,r,n,o=Ce(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).onPostRender=t.onPostRender.bind(xe(t)),t}return t=i,(r=[{key:"getCopyrights",value:function(){var e=this;if(!this.frameState)return[];var t=[];return this.frameState.layerStatesArray.forEach((function(r){var n=r.layer;Object(ue.inView)(r,e.frameState.viewState)&&n&&n.getSource&&n.getSource()&&n.getSource().getAttributions()&&(t=t.concat(n.getSource().getAttributions()(e.frameState)))})),je(t)}},{key:"activate",value:function(){ke(Re(i.prototype),"activate",this).call(this),this.map&&this.map.on("postrender",this.onPostRender)}},{key:"deactivate",value:function(){this.map&&this.map.un("postrender",this.onPostRender),ke(Re(i.prototype),"deactivate",this).call(this)}},{key:"onPostRender",value:function(e){this.map&&this.element&&(this.frameState=e.frameState,this.render())}}])&&Pe(t.prototype,r),n&&Pe(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(me(G));function De(e){return(De="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ie(e){return function(e){if(Array.isArray(e))return Ae(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Ae(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ae(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ae(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Me(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Le(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Me(Object(r),!0).forEach((function(t){Be(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Me(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Be(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ve(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ue(){return(Ue="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=qe(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function qe(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=ze(e)););return e}function Ne(e,t){return(Ne=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function He(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ze(e);if(t){var o=ze(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ke(this,r)}}function Ke(e,t){if(t&&("object"===De(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ze(e){return(ze=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ze=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ne(e,t)}(c,e);var t,r,n,o=He(c);function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ve(this,c),o.call(this,Le({controls:[].concat(Ie(Object(i.defaults)({attribution:!1}).getArray()),[new _e])},e))}return t=c,(r=[{key:"getContainer",value:function(){return this.getTargetElement()}},{key:"addLayer",value:function(e){e instanceof A?(e.init(this),this.mobilityLayers.push(e),e.olLayer&&Ue(ze(c.prototype),"addLayer",this).call(this,e.olLayer),this.dispatchEvent({type:"change:mobilityLayers",target:this})):Ue(ze(c.prototype),"addLayer",this).call(this,e)}},{key:"removeLayer",value:function(e){e instanceof A?(e.terminate(),this.mobilityLayers=this.mobilityLayers.filter((function(t){return t!==e})),e.olLayer&&Ue(ze(c.prototype),"removeLayer",this).call(this,e)):Ue(ze(c.prototype),"removeLayer",this).call(this,e)}},{key:"addControl",value:function(e){Ue(ze(c.prototype),"addControl",this).call(this,e)}},{key:"removeControl",value:function(e){Ue(ze(c.prototype),"removeControl",this).call(this,e)}}])&&Fe(t.prototype,r),n&&Fe(t,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(ae(o.a)),Ge=r(1),We=r(12),$e=r.n(We),Je=r(13),Qe=r.n(Je),Xe=r(6),Ye=r.n(Xe),et=r(7),tt=r.n(et);function rt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function nt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rt(Object(r),!0).forEach((function(t){ot(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ot(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var it=function(e,t,r){if(!1===e)return r;var n=tt.a.parseUrl(r);return!e&&n.query[t]?r:e?tt.a.stringifyUrl(nt(nt({},n),{},{query:nt(nt({},n.query),{},ot({},t,e))})):(console.warn("No apiKey is defined for request to ".concat(r)),null)},ct=function(e){if(!e||!e.style)return[];var t=e.style.sourceCaches,r=[];return Object.values(t).forEach((function(e){if(e.used){var t=e.getSource(),n=t.attribution||t.options&&t.options.attribution;n&&(r=r.concat(n.replace(/©/g,"©").split(/(<a.*?<\/a>)/)))}})),je(r)},at={0:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],1:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],2:[0,0,0,0,0,2,2,3,7,7,7,12,15,15,15,15,15],3:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],4:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],5:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],6:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],7:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],8:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],9:[0,0,0,0,0,2,2,3,7,7,7,12,15,15,15,15,15]},ut=[/^Tram/i,/^Subway( \/ Metro \/ S-Bahn)?/i,/^Train/i,/^Bus/i,/^Ferry/i,/^Cable ?Car/i,/^Gondola/i,/^Funicular/i,/^(Long distance bus|coach)/i,/^Rail/i],st=["#ffb400","#ff5400","#ff8080","#ea0000","#3000ff","#ffb400","#41a27b","#00d237","#b5b5b5","#ff8080"],lt=["#000000","#ffffff","#000000","#ffffff","#ffffff","#000000","#ffffff","#000000","#000000","#000000"],ft=[1e5,5e4,4e4,3e4,2e4,15e3,1e4,5e3,2e3,1e3,400,300,250,180,90,60,50,50,50,50,50],pt=function(e){return"string"==typeof e?ut.findIndex((function(t){return t.test(e)})):e},yt=function(e,t){try{var r=pt(e||0);return at[r][t]}catch(e){return 1}},ht=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;try{var t=pt(e);return st[t]}catch(e){return 1}},bt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;try{var t=pt(e);return lt[t]}catch(e){return 1}},vt=function(e,t,r,n){e.font="bold ".concat(n,"px Arial");for(var o=e.measureText(r),i=0;o.width>t-6&&i<25;)n-=.5,e.font="bold ".concat(n,"px arial, sans-serif"),o=e.measureText(r),i+=1;return n},dt=function(e,t,r){return t?r?"#ff0000":"#a0a0a0":e>=36e5?"#ed004c":e>=5e5?"#e80000":e>=3e5?"#ff4a00":e>=18e4?"#f7bf00":null===e?"#a0a0a0":"#00a00c"},mt=function(e,t){if(t)return String.fromCodePoint(215);if(e>36e5){var r=Math.round(e/36e5);return"+".concat(r,"h")}if(e>59e3){var n=Math.round(e/6e4);return"+".concat(n,"m")}return e>0?"+".concat(e,"s"):""},gt=function(e,t){var r=document.createElement("canvas");return r.width=e,r.height=t,r},Ot={},jt={},wt={},Pt={},kt={},St=function(e,t,r){var n=r.hoverVehicleId,o=r.selectedVehicleId,i=r.useDelayStyle,c=r.delayOutlineColor,a=r.delayDisplay,u=t.zoom,s=t.pixelRatio,l=e.line,f=e.type,p=e.id,y=e.delay,h=e.cancelled,b=void 0!==h&&h,v=e.operator_provides_realtime_journey;f||(f="Rail"),l||(l={});var d=l,m=d.name,g=d.text_color,O=d.color;m||(m="I"),g||(g="#000000"),O&&"#"!==O[0]&&(O="#".concat(O)),"#"!==g[0]&&(g="#".concat(g));var j=Math.min(Math.floor(u||1),16),w=n===p,P=o===p,k=yt(f,j)*s,S=k>=7*s;(w||P)&&(k=S?k+5*s:14*s);var T=k>10*s,C="".concat(k).concat(f).concat(O).concat(w).concat(P).concat(b).concat(y);if(i&&(C+="".concat(v)),T&&(C+="".concat(m).concat(g)),!kt[C]){if(0===k)return kt[C]=null,null;var E,x=1*s,R=k+2,_=2*k,D=2*R+2*x+100*s,I=D/2,A=gt(D,D),M=A.getContext("2d");if(S&&null!==y){var L=function(e,t,r){var n="".concat(e,", ").concat(t,", ").concat(r);if(!Ot[n]){var o=gt(2*e,2*e),i=o.getContext("2d");i.beginPath(),i.arc(e,e,t,0,2*Math.PI,!1),i.fillStyle=r,i.filter="blur(1px)",i.fill(),Ot[n]=o}return Ot[n]}(I,R,dt(y,b));M.drawImage(L,0,0)}if(S&&(w||y>=a||b)){var B=Math.max(b?19:14,Math.min(b?19:17,1.2*k))*s,V=mt(y,b);if(V){var F=function(e,t,r,n,o,i,c){var a="".concat(e,", ").concat(t,", ").concat(n,", ").concat(o,", ").concat(i,", ").concat(c);if(!jt[a]){var u=gt(e,r+8*c),s=u.getContext("2d");s.textAlign="left",s.textBaseline="middle",s.font=n,s.fillStyle=o,s.strokeStyle=i,s.lineWidth=1.5*c;var l=t;s.strokeText(l,0,r),s.fillText(l,0,r),jt[a]=u}return jt[a]}(V.length*B,V,B,"bold ".concat(B,"px arial, sans-serif"),dt(y,b,!0),c,s);M.drawImage(F,I+R+x,I-B)}}var U=function(e,t,r,n,o,i){var c="".concat(e,", ").concat(t,", ").concat(r,", ").concat(n,", ").concat(o,", ").concat(i);if(!wt[c]){var a=gt(2*e,2*e),u=a.getContext("2d");u.fillStyle=r,n&&(u.lineWidth=1*i,u.strokeStyle="#000000"),u.beginPath(),u.arc(e,e,t,0,2*Math.PI,!1),u.fill(),o&&u.setLineDash([5,3]),n&&u.stroke(),wt[c]=a}return wt[c]}(I,k,E=i?dt(y,b):O||ht(f),S||w||P,S&&i&&null===y&&"yes"===v,s);if(M.drawImage(U,0,0),T){var q=Math.max(k,10),N=function(e,t,r,n,o,i,c){var a="".concat(e,", ").concat(t,", ").concat(r,", ").concat(n,",").concat(o,", ").concat(i,", ").concat(c);if(!Pt[a]){var u=gt(2*t,2*t),s=u.getContext("2d");i&&(s.save(),s.textBaseline="middle",s.textAlign="center",s.font="bold ".concat(r+2,"px Arial"),s.strokeStyle=o,s.strokeText(e,t,t),s.restore()),s.textBaseline="middle",s.textAlign="center",s.fillStyle=n,s.font="bold ".concat(r,"px Arial"),s.strokeStyle=o,s.strokeText(e,t,t),s.fillText(e,t,t),Pt[a]=u}return Pt[a]}(m,I,vt(M,_,m,q),i?"#000000":g||bt(f),E,i&&null===y&&"yes"===v,s);M.drawImage(N,0,0)}kt[C]=A}return kt[C]},Tt=document.createElement("canvas");Tt.width=15,Tt.height=15;var Ct=Tt.getContext("2d");Ct.arc(8,8,5,0,2*Math.PI,!1),Ct.fillStyle="#8ED6FF",Ct.fill(),Ct.lineWidth=3,Ct.strokeStyle="black",Ct.stroke(),Ct.lineWidth=3;var Et=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,t=(e.getUTCMonth()+1).toString();t=1===t.length?"0".concat(t):t;var r=e.getUTCDate().toString();return r=1===r.length?"0".concat(r):r,[e.getUTCFullYear(),t,r].join("")},xt=function(e){return[e.getUTCHours(),e.getUTCMinutes(),"".concat(e.getUTCSeconds(),".").concat(e.getUTCMilliseconds())].join(":")};function Rt(e){return(Rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],c=!0,a=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);c=!0);}catch(e){a=!0,o=e}finally{try{c||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Dt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Dt(e,t)}(e,t)||function(){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 Dt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function It(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function At(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?It(Object(r),!0).forEach((function(t){Mt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):It(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Mt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Lt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Vt(){return(Vt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Ft(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Ft(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Kt(e)););return e}function Ut(e,t){return(Ut=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function qt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Kt(e);if(t){var o=Kt(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Nt(this,r)}}function Nt(e,t){if(t&&("object"===Rt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ht(e)}function Ht(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Kt(e){return(Kt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var zt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ut(e,t)}(i,e);var t,r,n,o=qt(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Lt(this,i);var r=new se.a({source:new Qe.a({}),render:function(t){if(!e.mbMap)return console.warn("Mapbox map doesn't exist."),null;var r=!1,n=e.mbMap.getCanvas(),o=t.viewState,i=e.olLayer.getVisible();e.renderState.visible!==i&&(n.style.display=i?"block":"none",e.renderState.visible=i,n.style.position="absolute");var c=e.olLayer.getOpacity();e.renderState.opacity!==c&&(n.style.opacity=c,e.renderState.opacity=c);var a=o.rotation;e.renderState.rotation!==a&&(e.mbMap.rotateTo(180*-(a||0)/Math.PI,{animate:!1}),r=!0,e.renderState.rotation=a),e.renderState.zoom===o.zoom&&e.renderState.center[0]===o.center[0]&&e.renderState.center[1]===o.center[1]||(e.mbMap.jumpTo({center:Object(Ge.toLonLat)(o.center),zoom:o.zoom-1,animate:!1}),r=!0,e.renderState.zoom=o.zoom,e.renderState.center=o.center);var u=e.map.getSize();if(e.renderState.size[0]===u[0]&&e.renderState.size[1]===u[1]||(r=!0,e.renderState.size=u),e.mbMap&&e.mbMap.style&&e.mbMap.isStyleLoaded()&&r)try{e.mbMap._frame&&(e.mbMap._frame.cancel(),e.mbMap._frame=null),e.mbMap._render()}catch(e){console.warn(e)}return n}});return(e=o.call(this,At(At({},t),{},{olLayer:r}))).styleUrl=t.url,e.apiKey=t.apiKey,e.apiKeyName=t.apiKeyName||"key",e.updateAttribution=e.updateAttribution.bind(Ht(e)),e}return t=i,(r=[{key:"init",value:function(e){var t=this;Vt(Kt(i.prototype),"init",this).call(this,e),this.map&&!this.mbMap&&(this.format=new Ye.a({featureProjection:this.map.getView().getProjection()}),this.loadMbMap(),this.olListenersKeys.push(this.map.on("change:size",(function(){try{t.mbMap&&t.mbMap.resize()}catch(e){console.warn(e)}}))))}},{key:"createStyleUrl",value:function(){return it(this.apiKey,this.apiKeyName,this.styleUrl)}},{key:"loadMbMap",value:function(){var e=this;if(this.olListenersKeys.push(this.map.on("change:target",(function(){e.loadMbMap()}))),this.map.getTargetElement())if(this.visible){var t=_t(this.map.getView().getCenter(),2),r=t[0],n=t[1];r&&n||(r=0,n=0);var o=this.createStyleUrl();try{this.mbMap=new $e.a.Map({style:o,attributionControl:!1,boxZoom:!1,center:Object(Ge.toLonLat)([r,n]),container:this.map.getTargetElement(),interactive:!1,fadeDuration:"fadeDuration"in this.options?this.options.fadeDuration:300,preserveDrawingBuffer:this.options.preserveDrawingBuffer||!1})}catch(e){console.warn("Failed creating mapbox map: ",e)}this.renderState={center:[r,n],zoom:null,rotation:null,visible:null,opacity:null,size:[0,0]},this.mbMap.once("load",(function(){e.loaded=!0,e.copyrights=e.copyrights||ct(e.mbMap)||[],e.olLayer.getSource().setAttributions(e.copyrights),e.dispatchEvent({type:"load",target:e})}));var i=this.mbMap.getCanvas();i&&(this.options.tabIndex?i.setAttribute("tabindex",this.options.tabIndex):i.removeAttribute("tabindex")),this.mbMap.on("idle",this.updateAttribution)}else this.olListenersKeys.push(this.once("change:visible",(function(){e.loadMbMap()})))}},{key:"updateAttribution",value:function(e){var t=this.copyrights||ct(e.target)||[];this.copyrights.toString()!==t.toString()&&this.olLayer.getSource().setAttributions(t)}},{key:"getFeatureInfoAtCoordinate",value:function(e,t){var r=this;if(!(t&&this.format&&this.mbMap&&this.mbMap.isStyleLoaded()))return Promise.resolve({coordinate:e,features:[],layer:this});var n=e&&this.mbMap.project(Object(Ge.toLonLat)(e));if(this.hitTolerance){var o=n,i=o.x,c=o.y;n=[{x:i-this.hitTolerance,y:c-this.hitTolerance},{x:i+this.hitTolerance,y:c+this.hitTolerance}]}var a=this.mbMap.queryRenderedFeatures(n,t).map((function(e){var t=r.format.readFeature(e);return t&&t.set("mapboxFeature",e),t}));return Promise.resolve({layer:this,features:a,coordinate:e})}},{key:"terminate",value:function(){this.mbMap&&(this.mbMap.off("idle",this.updateAttribution),this.mbMap.triggerRepaint=function(){},this.mbMap.remove(),this.mbMap=null),this.loaded=!1,Vt(Kt(i.prototype),"terminate",this).call(this)}},{key:"clone",value:function(e){return new i(At(At({},this.options),e))}}])&&Bt(t.prototype,r),n&&Bt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(A);var Zt=r(0),Gt=r(14),Wt=r(8);var $t=new Zt.Circle({radius:6,fill:new Zt.Fill({color:[255,0,0,1]}),stroke:new Zt.Stroke({color:[0,0,0,1],width:1})}),Jt=(new Zt.Style({stroke:new Zt.Stroke({color:[0,0,0,1],width:5})}),new Zt.Style({image:$t,stroke:new Zt.Stroke({color:[255,0,0,1],width:3})}),new Zt.Style({image:$t,stroke:new Zt.Stroke({color:[255,0,0,1],width:3,lineDash:[1,10]})}),r(9)),Qt=r(2),Xt=r(5),Yt=r.n(Xt),er=r(16),tr=r.n(er);function rr(e){return function(e){if(Array.isArray(e))return ir(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||or(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],c=!0,a=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);c=!0);}catch(e){a=!0,o=e}finally{try{c||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||or(e,t)||function(){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 or(e,t){if(e){if("string"==typeof e)return ir(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ir(e,t):void 0}}function ir(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function cr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ar(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ur(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var sr=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?cr(Object(r),!0).forEach((function(t){ar(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({interpolate:!0},t);this.pixelRatio=t.pixelRatio||window.devicePixelRatio||1,this.trajectories=[],this.renderedTrajectories=[],this.interpolate=!!r.interpolate,this.hoverVehicleId=r.hoverVehicleId,this.selectedVehicleId=r.selectedVehicleId,this.filter=r.filter,this.sort=r.sort,this.style=r.style,this.canvas=r.canvas||document.createElement("canvas"),this.canvas.width=r.width*this.pixelRatio,this.canvas.height=r.height*this.pixelRatio,this.canvas.setAttribute("style",["position: absolute","top: 0","bottom: 0","width: ".concat(r.width,"px"),"height: ".concat(r.height,"px"),"pointer-events: none","visibility: visible","margin-top: inherit"].join(";")),this.canvasContext=this.canvas.getContext("2d")}var t,r,n;return t=e,(r=[{key:"setVisible",value:function(e){this.canvas&&(this.canvas.style.visibility=e?"visible":"hidden")}},{key:"setTrajectories",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.sort&&e.sort(this.sort),this.trajectories=e}},{key:"getTrajectories",value:function(){return this.trajectories||[]}},{key:"clear",value:function(){this.canvasContext&&this.canvasContext.clearRect(0,0,this.canvas.width,this.canvas.height)}},{key:"renderTrajectories",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=e.time,n=void 0===r?Date.now():r,o=e.size,i=void 0===o?[]:o,c=e.center,a=e.resolution,u=e.rotation,s=void 0===u?0:u,l=e.pixelRatio;this.clear();var f=nr(i,2),p=f[0],y=f[1];if(p&&y&&(this.canvas.width!==p||this.canvas.height!==y)){var h=[p*l,y*l];this.canvas.width=h[0],this.canvas.height=h[1]}var b,v,d,m,g,O,j,w,P=Object(Jt.compose)(Object(Jt.create)(),i[0]/2,i[1]/2,1/a,-1/a,-s,-c[0],-c[1]);this.canvas.style.width="".concat(this.canvas.width/l,"px"),this.canvas.style.height="".concat(this.canvas.height/l,"px"),this.currResolution=a||this.currResolution,this.renderedTrajectories=[];for(var k=(this.trajectories||[]).length-1;k>=0;k-=1){var S=this.trajectories[k];this.trajectories[k].rendered=!1;var T=S.geometry,C=S.timeIntervals,E=S.timeOffset;if(!this.filter||this.filter(S,k,this.trajectories)){var x=null,R=void 0;if(!S.coordinate||!t&&this.interpolate){if(C&&C.length>1){for(var _=n-(E||0),D=void 0,I=void 0,A=void 0,M=void 0,L=void 0,B=0;B<C.length-1;B+=1){var V=nr(C[B],3);D=V[0],A=V[1],R=V[2];var F=nr(C[B+1],2);if(I=F[0],M=F[1],D<=_&&_<=I)break;D=null,I=null}if(T.getType()===tr.a.POINT)x=T.getCoordinates();else if(T.getType()===tr.a.LINE_STRING){if(D&&I){L=this.interpolate?Math.min((_-D)/(I-D),1):0;var U=this.interpolate?L*(M-A)+A:0;x=T.getCoordinateAt(U),this.trajectories[k].rotation=R,this.trajectories[k].endFraction=L}else if(_<C[0][0]){var q=nr(C,1),N=nr(q[0],3);R=N[2],L=0,x=T.getFirstCoordinate()}else if(_>C[C.length-1][0]){var H=nr(C[C.length-1],3);R=H[2],L=1,x=T.getLastCoordinate()}}else console.error("This geometry type is not supported. Only Point or LineString are. Current geometry: ",T);this.trajectories[k].rotation=R,this.trajectories[k].endFraction=L||0}}else x=S.coordinate;if(x){this.trajectories[k].coordinate=x;var K=Object(Jt.apply)(P,rr(x));if(!K)continue;if((K=K.map((function(e){return e*l})))[0]<0||K[0]>this.canvas.width||K[1]<0||K[1]>this.canvas.height)continue;var z=this.style(S,e);if(!z)continue;this.trajectories[k].rendered=!0,this.renderedTrajectories.push(this.trajectories[k]);var Z=z.width,G=z.height;this.hoverVehicleId!==S.id&&this.selectedVehicleId!==S.id&&this.canvasContext.drawImage(z,K[0]-Z/2,K[1]-G/2,Z,G),this.hoverVehicleId===S.id&&(b=z,v=K,d=Z,m=G),this.selectedVehicleId===S.id&&(g=z,O=K,j=Z,w=G)}}}g&&this.canvasContext.drawImage(g,O[0]-j/2,O[1]-w/2,j,w),b&&this.canvasContext.drawImage(b,v[0]-d/2,v[1]-m/2,d,m)}},{key:"destroy",value:function(){this.renderedTrajectories=[],this.clear()}}])&&ur(t.prototype,r),n&&ur(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),lr=function(e,t,r,n){var o=[];if(!(e||t||r||n))return null;if(n){var i="string"==typeof n?[n]:n;o.push((function(e){var t=e.name||e.line&&e.line.name||"";return!!t&&i.some((function(e){return new RegExp(e,"i").test(t)}))}))}if(e){var c=("string"==typeof e?e.split(","):e).map((function(e){return e.replace(/\s+/g,"").toUpperCase()}));o.push((function(e){var t=(e.name||e.line&&e.line.name||"").toUpperCase();return!!t&&c.includes(t)}))}if(t){var a=("string"==typeof t?t.split(","):t).map((function(e){return parseInt(e,10)}));o.push((function(e){var t=parseInt(e.routeIdentifier.split(".")[0],10);return a.includes(t)}))}if(r){var u="string"==typeof r?[r]:r;o.push((function(e){return u.some((function(t){return new RegExp(t,"i").test(e.operator)}))}))}return o.length?function(e){for(var t=0;t<o.length;t+=1)if(!o[t](e))return!1;return!0}:null};function fr(e){return(fr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pr(e){return function(e){if(Array.isArray(e))return yr(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return yr(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yr(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function hr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function br(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?hr(Object(r),!0).forEach((function(t){vr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function vr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dr(){return(dr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=mr(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function mr(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Pr(e)););return e}function gr(e,t){return(gr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Or(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Pr(e);if(t){var o=Pr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return jr(this,r)}}function jr(e,t){if(t&&("object"===fr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return wr(e)}function wr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Pr(e){return(Pr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function kr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Tr(e,t,r){return t&&Sr(e.prototype,t),r&&Sr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var Cr=function(e){return function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gr(e,t)}(r,e);var t=Or(r);function r(e){var n;return kr(this,r),(n=t.call(this,br({hitTolerance:10},e))).onFeatureHover=n.onFeatureHover.bind(wr(n)),n.onFeatureClick=n.onFeatureClick.bind(wr(n)),n}return Tr(r,[{key:"defineProperties",value:function(e){var t=this,n=br({},e),o=n.style,i=n.speed,c=e.pixelRatio,a=e.interpolate,u=e.hoverVehicleId,s=e.selectedVehicleId,l=e.filter,f=e.sort,p=e.time,y=e.live,h=e.regexPublishedLineName,b=e.publishedLineName,v=e.tripNumber,d=e.operator,m={pixelRatio:c||window.devicePixelRatio||1,interpolate:a,hoverVehicleId:u,selectedVehicleId:s,filter:l,sort:f,style:o};Object.keys(m).forEach((function(e){return void 0===m[e]&&delete m[e]}));var g=i||1,O=p||new Date;dr(Pr(r.prototype),"defineProperties",this).call(this,e),Object.defineProperties(this,{isTrackerLayer:{value:!0},style:{value:o||this.defaultStyle},speed:{get:function(){return g},set:function(e){g=e,t.start()}},filter:{get:function(){return t.tracker?t.tracker.filter:t.initTrackerOptions.filter},set:function(e){t.tracker?t.tracker.filter=e:t.initTrackerOptions.filter=e}},sort:{get:function(){return t.tracker?t.tracker.sort:t.initTrackerOptions.sort},set:function(e){t.tracker?t.tracker.sort=e:t.initTrackerOptions.sort=e}},tracker:{value:null,writable:!0},styleCache:{value:{}},live:{value:!1!==y||y,writable:!0},time:{get:function(){return O},set:function(e){O=e&&e.getTime?e:new Date(e),t.renderTrajectories()}},trajectories:{get:function(){return t.tracker&&t.tracker.trajectories||[]}},renderedTrajectories:{get:function(){return t.tracker&&t.tracker.renderedTrajectories||[]}},hoverVehicleId:{get:function(){return t.tracker?t.tracker.hoverVehicleId:t.initTrackerOptions.hoverVehicleId},set:function(e){t.tracker?t.tracker.hoverVehicleId=e:t.initTrackerOptions.hoverVehicleId=e}},selectedVehicleId:{get:function(){return t.tracker?t.tracker.selectedVehicleId:t.initTrackerOptions.selectedVehicleId},set:function(e){t.tracker?t.tracker.selectedVehicleId=e:t.initTrackerOptions.selectedVehicleId=e}},pixelRatio:{get:function(){return t.tracker?t.tracker.pixelRatio:t.initTrackerOptions.pixelRatio},set:function(e){t.tracker?t.tracker.pixelRatio=e:t.initTrackerOptions.pixelRatio=e}},initTrackerOptions:{value:m,writable:!1},useRequestAnimationFrame:{default:!1,writable:!0},publishedLineName:{get:function(){return b},set:function(e){b=e,t.updateFilters()}},tripNumber:{get:function(){return v},set:function(e){v=e,t.updateFilters()}},operator:{get:function(){return d},set:function(e){d=e,t.updateFilters()}},regexPublishedLineName:{get:function(){return h},set:function(e){h=e,t.updateFilters()}},delayDisplay:{value:e.delayDisplay||3e5,writable:!0},delayOutlineColor:{value:e.delayOutlineColor||"#000000",writable:!0},useDelayStyle:{value:e.useDelayStyle||!1,writable:!0}}),this.useDelayStyle&&!this.sort&&(this.sort=function(e,t){return null===e.delay&&null!==t.delay?1:null===t.delay&&null!==e.delay?-1:e.cancelled&&!t.cancelled?t.delay<18e4?-1:1:t.cancelled&&!e.cancelled?e.delay<18e4?1:-1:t.delay-e.delay})}},{key:"init",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};dr(Pr(r.prototype),"init",this).call(this,e),this.tracker=new sr(br(br({style:function(e,r){return t.style(e,r)}},this.initTrackerOptions),n)),this.visible&&this.start(),this.visibilityRef=this.on("change:visible",(function(e){e.target.visible?t.start():t.stop()}))}},{key:"terminate",value:function(){this.stop(),Object(c.unByKey)(this.visibilityRef),this.tracker&&(this.tracker.destroy(),this.tracker=null),dr(Pr(r.prototype),"terminate",this).call(this)}},{key:"start",value:function(){this.stop(),this.updateFilters(),this.tracker.setVisible(!0),this.renderTrajectories(),this.startUpdateTime(),this.isClickActive&&this.onClick(this.onFeatureClick),this.isHoverActive&&this.onHover(this.onFeatureHover)}},{key:"startUpdateTime",value:function(){var e=this;this.stopUpdateTime(),this.updateTimeDelay=this.getRefreshTimeInMs(),this.updateTimeInterval=setInterval((function(){e.time=e.live?new Date:e.time.getTime()+e.updateTimeDelay*e.speed}),this.updateTimeDelay)}},{key:"stop",value:function(){this.stopUpdateTime(),this.tracker&&(this.tracker.setVisible(!1),this.tracker.clear())}},{key:"stopUpdateTime",value:function(){this.updateTimeInterval&&clearInterval(this.updateTimeInterval)}},{key:"renderTrajectoriesInternal",value:function(e,t){if(!this.tracker)return!1;var r=this.live?Date.now():this.time;return this.tracker.renderTrajectories(br(br({},e),{},{time:r}),t),!0}},{key:"renderTrajectories",value:function(e,t){var r=this;this.requestId&&cancelAnimationFrame(this.requestId),this.useRequestAnimationFrame?this.requestId=requestAnimationFrame((function(){r.renderTrajectoriesInternal(e,t)})):this.renderTrajectoriesInternal(e,t)}},{key:"getVehicle",value:function(e){return this.tracker.getTrajectories().filter(e)}},{key:"getVehiclesAtCoordinate",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,n=Object(Qt.buffer)([].concat(pr(e),pr(e)),this.hitTolerance*t),o=this.tracker.getTrajectories(),i=[],c=0;c<o.length&&(o[c].coordinate&&Object(Qt.containsCoordinate)(n,o[c].coordinate)&&i.push(o[c]),i.length!==r);c+=1);return i}},{key:"getFeatureInfoAtCoordinate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.resolution,n=t.nb,o=this.getVehiclesAtCoordinate(e,r,n);return Promise.resolve({layer:this,features:o.map((function(e){var t=new Yt.a({geometry:e.geometry});return t.setProperties(br({},e)),t})),coordinate:e})}},{key:"onZoomEnd",value:function(e){this.startUpdateTime()}},{key:"onFeatureClick",value:function(){}},{key:"onFeatureHover",value:function(){}},{key:"getRefreshTimeInMs",value:function(e){var t=Math.round(e),r=ft[t]||25;return Math.max(25,r/this.speed)}},{key:"updateFilters",value:function(){var e=tt.a.parse(window.location.search.toLowerCase());this.filter=lr(this.publishedLineName||e.publishedlinename,this.tripNumber||e.tripnumber,this.operator||e.operator,this.regexPublishedLineName)}},{key:"defaultStyle",value:function(e,t){return St(e,t,this)}}]),r}(e)};function Er(e){return(Er="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Rr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xr(Object(r),!0).forEach((function(t){_r(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Dr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ir(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ar(){return(Ar="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Mr(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Mr(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Fr(e)););return e}function Lr(e,t){return(Lr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Br(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Fr(e);if(t){var o=Fr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Vr(this,r)}}function Vr(e,t){if(t&&("object"===Er(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Fr(e){return(Fr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ur=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Lr(e,t)}(i,e);var t,r,n,o=Br(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Dr(this,i),(e=o.call(this,Rr({},t))).renderWhenInteracting=t.renderWhenInteracting||function(){return e.tracker&&e.tracker.renderedTrajectories&&e.tracker.renderedTrajectories.length<=200},e.olLayer=t.olLayer||new Wt.Group({layers:[new Wt.Vector({source:new Gt.Vector({features:[]})}),new Wt.Layer({source:new Qe.a({}),render:function(t){if(!e.tracker||!e.tracker.canvas)return null;if(e.container||(e.container=document.createElement("div"),e.container.style.position="absolute",e.container.style.width="100%",e.container.style.height="100%",e.transformContainer=document.createElement("div"),e.transformContainer.style.position="absolute",e.transformContainer.style.width="100%",e.transformContainer.style.height="100%",e.container.appendChild(e.transformContainer),e.tracker.canvas.style.position="absolute",e.tracker.canvas.style.top="0",e.tracker.canvas.style.left="0",e.tracker.canvas.style.transformOrigin="top left",e.transformContainer.appendChild(e.tracker.canvas)),e.renderedViewState){var r=t.viewState,n=r.center,o=r.resolution,i=r.rotation,c=e.renderedViewState,a=c.center,u=c.resolution,s=c.rotation;if(e.renderWhenInteracting&&e.renderWhenInteracting(t.viewState,e.renderedViewState))e.renderTrajectories(!0);else if(u/o>=3)e.tracker.clear();else{var l=e.map.getPixelFromCoordinate(a),f=e.map.getPixelFromCoordinate(n);e.transformContainer.style.transform=Object(Jt.composeCssTransform)(l[0]-f[0],l[1]-f[1],u/o,u/o,i-s,0,0)}}return e.container}})]}),e.vectorLayer=e.olLayer.getLayers().item(0),e.renderState={center:[0,0],zoom:null,rotation:0},e}return t=i,(r=[{key:"init",value:function(e){var t=this;Ar(Fr(i.prototype),"init",this).call(this,e),this.map&&this.olListenersKeys.push(this.map.on("moveend",(function(e){var r=t.map.getView();if(!r.getAnimating()&&!r.getInteracting()){var n=r.getZoom();t.currentZoom!==n&&t.onZoomEnd(e),t.currentZoom=n,t.onMoveEnd(e)}})))}},{key:"terminate",value:function(){Ar(Fr(i.prototype),"terminate",this).call(this),this.container=null}},{key:"hasFeatureInfoAtCoordinate",value:function(e){if(this.map&&this.tracker&&this.tracker.canvas){var t=this.tracker.canvas.getContext("2d"),r=this.map.getPixelFromCoordinate(e);return!!t.getImageData(r[0]*this.pixelRatio,r[1]*this.pixelRatio,1,1).data[3]}return!1}},{key:"renderTrajectories",value:function(e){var t=this.map.getView();Ar(Fr(i.prototype),"renderTrajectories",this).call(this,{size:this.map.getSize(),center:this.map.getView().getCenter(),extent:t.calculateExtent(),resolution:t.getResolution(),rotation:t.getRotation(),zoom:t.getZoom(),pixelRatio:this.pixelRatio},e)}},{key:"renderTrajectoriesInternal",value:function(e,t){(this.renderWhenInteracting(e,this.renderedViewState)||!this.map.getView().getAnimating()&&!this.map.getView().getInteracting())&&Ar(Fr(i.prototype),"renderTrajectoriesInternal",this).call(this,e,t)&&(this.renderedViewState=Rr({},e),this.transformContainer&&(this.transformContainer.style.transform=""))}},{key:"getRefreshTimeInMs",value:function(){return Ar(Fr(i.prototype),"getRefreshTimeInMs",this).call(this,this.map.getView().getZoom())}},{key:"getVehiclesAtCoordinate",value:function(e,t){var r=this.map.getView().getResolution();return Ar(Fr(i.prototype),"getVehiclesAtCoordinate",this).call(this,e,r,t)}},{key:"getFeatureInfoAtCoordinate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.hasFeatureInfoAtCoordinate(e))return Promise.resolve({features:[],layer:this,coordinate:e});var r=this.map.getView().getResolution();return Ar(Fr(i.prototype),"getFeatureInfoAtCoordinate",this).call(this,e,Rr({resolution:r},t))}},{key:"onMoveEnd",value:function(e){}},{key:"onZoomEnd",value:function(e){Ar(Fr(i.prototype),"onZoomEnd",this).call(this,e)}},{key:"onFeatureHover",value:function(e,t,r){Ar(Fr(i.prototype),"onFeatureHover",this).call(this,e,t,r),this.map.getTargetElement().style.cursor=e.length?"pointer":"auto"}},{key:"onFeatureClick",value:function(e,t,r){Ar(Fr(i.prototype),"onFeatureClick",this).call(this,e,t,r),!e.length&&this.vectorLayer&&this.vectorLayer.getSource().clear()}},{key:"clone",value:function(e){return new i(Rr(Rr({},this.options),e))}}])&&Ir(t.prototype,r),n&&Ir(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Cr(A)),qr=r(4);function Nr(e){return(Nr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Hr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Kr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Hr(Object(r),!0).forEach((function(t){zr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function zr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Zr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Gr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Wr(e,t){return(Wr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function $r(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Qr(e);if(t){var o=Qr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Jr(this,r)}}function Jr(e,t){if(t&&("object"===Nr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Qr(e){return(Qr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Xr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Wr(e,t)}(i,e);var t,r,n,o=$r(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Zr(this,i),(e=o.call(this)).url=t.url,e.apiKey=t.apiKey,e}return t=i,(r=[{key:"fetch",value:function(e){function t(t,r,n){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e,t,r){var n=Kr(Kr({},t||{}),{},{key:this.apiKey}),o=Kr({},n);return Object.keys(n).forEach((function(e){return(void 0===o[e]||null===o[e])&&delete o[e]})),this.apiKey?fetch("".concat(this.url).concat(e||"","?").concat(tt.a.stringify(o)),r).then((function(e){try{return e.json().then((function(e){if(e.error)throw new Error(e.error);return e}))}catch(e){return Promise.reject(new Error(e))}})):Promise.reject(new Error("No apiKey defined for request to ".concat(this.url)))}))}])&&Gr(t.prototype,r),n&&Gr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(L.a);function Yr(e){return(Yr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function en(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function tn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?en(Object(r),!0).forEach((function(t){rn(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):en(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function rn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function on(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function cn(e,t){return(cn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function an(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=sn(e);if(t){var o=sn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return un(this,r)}}function un(e,t){if(t&&("object"===Yr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function sn(e){return(sn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ln=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cn(e,t)}(i,e);var t,r,n,o=an(i);function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return nn(this,i),o.call(this,tn({url:"https://api.geops.io/stops/v1/"},e))}return t=i,(r=[{key:"search",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("",e,{signal:t.signal}).then((function(e){return e.features}))}}])&&on(t.prototype,r),n&&on(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Xr);function fn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function pn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var yn=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],r=0;r<e.length;r+=1){var n=e[r],o=n.d,i=n.m,c=n.y;t.push({day:o,month:i,year:c})}return t},hn=function(e){var t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fn(Object(r),!0).forEach((function(t){pn(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e);["a","f","tt"].forEach((function(e){t[e]||(t[e]={})}));for(var r=t.id,n=t.hs,o=t.t,i=t.ln,c=t.sn,a=t.wa,u=t.ba,s=t.rt,l=t.fid,f=t.rid,p=t.c,y=t.tc,h=t.a,b=h.n,v=h.u,d=h.tz,m=t.f,g=m.n,O=m.u,j=m.tz,w=t.tt,P=w.n,k=w.p,S=w.t,T=t.sts,C=yn(P),E=yn(k),x=p&&"#".concat(p),R=y&&"#".concat(y),_=[],D=0;D<(T||[]).length;D+=1){var I=T[D],A=I.sid,M=I.n,L=I.p,B=I.at,V=I.dt,F=I.ap,U=I.dp,q=I.ad,N=I.dd,H=I.dot,K=I.put,z=I.c,Z=I.wa;_.push({stationId:A,stationName:M,coordinates:L,arrivalTime:-1!==B?1e3*F:null,departureTime:-1!==V?1e3*U:null,arrivalDelay:q,departureDelay:N,noDropOff:!!H,noPickUp:!!K,cancelled:!!z,wheelchairAccessible:!!Z})}return{id:r,destination:n,backgroundColor:x,color:R,vehicleType:o,routeIdentifier:f,longName:i,shortName:c,stations:_,wheelchairAccessible:!!a,bicyclesAllowed:!!u,realTime:s,feedsId:l,operatingInformations:{operatingPeriod:S,notOperatingDays:C,additionalOperatingDays:E},operator:b,operatorUrl:v,operatorTimeZone:d,publisher:g,publisherUrl:O,publisherTimeZone:j}},bn=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],r=0;r<e.length;r+=1){var n=e[r],o=new qr.LineString(n.geometry.coordinates),i=n.properties,c=i.ID,a=i.ProductIdentifier,u=i.PublishedLineName,s=i.RouteIdentifier,l=i.DirectionText,f=i.Operator,p=i.OperatorURL,y=i.Publisher,h=i.PublisherURL,b=i.License,v=i.LicenseUrl,d=i.LicenseNote,m=i.Color,g=i.JourneyIdentifier,O=i.RealtimeAvailable,j=i.OperatorProvidesRealtime,w=i.DayOfOperation,P=i.Delay,k=i.TimeIntervals,S=i.TextColor,T=i.Cancelled;t.push({id:c,type:a,name:u,routeIdentifier:s,directionText:l,operator:f,operatorUrl:p,publisher:y,publisherUrl:h,license:b,licenseUrl:v,licenseNote:d,journeyIdentifier:g,realtimeAvailable:O,operatorProvidesRealtime:j,dayOfOperation:w,delay:P,timeIntervals:k,color:m&&"#".concat(m),textColor:S&&"#".concat(S),geometry:o,cancelled:T})}return t};function vn(e){return(vn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function dn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function mn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?dn(Object(r),!0).forEach((function(t){gn(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function gn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function On(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function wn(e,t){return(wn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Pn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Sn(e);if(t){var o=Sn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return kn(this,r)}}function kn(e,t){if(t&&("object"===vn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Sn(e){return(Sn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Tn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&wn(e,t)}(i,e);var t,r,n,o=Pn(i);function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return On(this,i),o.call(this,mn({url:"https://api.geops.io/tracker/v1"},e))}return t=i,(r=[{key:"fetchTrajectoryById",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("/trajectorybyid",e,{signal:t.signal})}},{key:"fetchTrajectories",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("/trajectory_collection",e,{signal:t.signal}).then((function(e){return bn(e.features)}))}},{key:"fetchTrajectoryStations",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("/trajstations",e,{signal:t.signal}).then((function(e){return hn(e)}))}}])&&jn(t.prototype,r),n&&jn(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Xr);function Cn(e){return function(e){if(Array.isArray(e))return En(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return En(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return En(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function En(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function xn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Rn=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.defineProperties()}var t,r,n;return t=e,n=[{key:"getRequestString",value:function(e,t){var r="".concat(e," ").concat(t.channel);return r+=t.args?" ".concat(t.args):"",(r+=t.id?" ".concat(t.id):"").trim()}}],(r=[{key:"defineProperties",value:function(){var e=this;Object.defineProperties(this,{closed:{get:function(){return!(!e.websocket||e.websocket.readyState!==e.websocket.CLOSED)}},closing:{get:function(){return!(!e.websocket||e.websocket.readyState!==e.websocket.CLOSING)}},connecting:{get:function(){return!(!e.websocket||e.websocket.readyState!==e.websocket.CONNECTING)}},open:{get:function(){return!(!e.websocket||e.websocket.readyState!==e.websocket.OPEN)}},messagesOnOpen:{value:[],writable:!0},subscriptions:{value:[],writable:!0},subscribed:{value:{},writable:!0}})}},{key:"connect",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};this.websocket&&!this.closed&&this.websocket.close(),this.websocket=new WebSocket(e),this.open?(r(),this.subscribePreviousSubscriptions()):this.websocket.addEventListener("open",(function(){r(),t.subscribePreviousSubscriptions()}))}},{key:"close",value:function(){this.websocket&&(this.websocket.onclose=null,this.websocket.close(),this.websocket=null,this.messagesOnOpen=[])}},{key:"send",value:function(e){var t=this;if(this.websocket){var r=function(){t.websocket.send(e)};this.open?this.messagesOnOpen.includes(e)||r():this.messagesOnOpen.includes(e)||(this.messagesOnOpen.push(e),this.websocket.addEventListener("open",(function(){t.messagesOnOpen=[],r()})),this.websocket.addEventListener("close",(function(){t.messagesOnOpen=[]})))}}},{key:"listen",value:function(e,t,r){this.unlisten(e,t);var n=function(r){var n=JSON.parse(r.data),o=e.channel;o+=e.args?" ".concat(e.args):"",n.source!==o||e.id&&e.id!==n.client_reference||t(n)};return this.websocket&&(this.websocket.addEventListener("message",n),r&&(this.websocket.addEventListener("error",r),this.websocket.addEventListener("close",r))),{onMessageCb:n,onErrorCb:r}}},{key:"unlisten",value:function(e,t){var r=this;this.websocket&&this.subscriptions.filter((function(r){return r.params.channel===e.channel&&(!t||r.cb===t)})).forEach((function(e){var t=e.onMessageCb,n=e.onErrorCb;r.websocket&&(r.websocket.removeEventListener("message",t),n&&(r.websocket.removeEventListener("error",n),r.websocket.removeEventListener("close",n)))}))}},{key:"get",value:function(t,r,n){var o=e.getRequestString("GET",t);this.send(o),this.listen(t,r,n)}},{key:"subscribe",value:function(t,r,n){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=this.listen(t,r,n),c=i.onMessageCb,a=i.onErrorCb,u=e.getRequestString("",t),s=this.subscriptions.findIndex((function(e){return t.channel===e.params.channel&&r===e.cb})),l={params:t,cb:r,errorCb:n,onMessageCb:c,onErrorCb:a,quiet:o};s>-1?this.subscriptions[s]=l:this.subscriptions.push(l),this.subscribed[u]||(l.quiet||(this.send("GET ".concat(u)),this.send("SUB ".concat(u))),this.subscribed[u]=!0)}},{key:"unsubscribe",value:function(e,t){var r=this,n=this.subscriptions.filter((function(r){return r.params.channel===e&&(!t||r.cb===t)}));n.forEach((function(e){var t=e.onMessageCb,n=e.onErrorCb;r.websocket&&(r.websocket.removeEventListener("message",t),n&&(r.websocket.removeEventListener("error",n),r.websocket.removeEventListener("close",n)))})),this.subscriptions=this.subscriptions.filter((function(r){return r.params.channel!==e||t&&r.cb!==t})),e&&this.subscribed[e]&&!this.subscriptions.find((function(t){return t.params.channel===e}))&&n.find((function(e){return!e.quiet}))&&(this.send("DEL ".concat(e)),this.subscribed[e]=!1)}},{key:"subscribePreviousSubscriptions",value:function(){var e=this;Object.keys(this.subscribed).forEach((function(t){e.subscribed[t]=!1})),Cn(this.subscriptions).forEach((function(t){e.subscribe(t.params,t.cb,t.errorCb,t.quiet)}))}}])&&xn(t.prototype,r),n&&xn(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),_n=function(e,t){return e===t.SCHEMATIC?"_schematic":""},Dn=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=["HIDDEN","LEAVING","BOARDING"],o=e.has_fzo&&n.indexOf(e.state)>-1,i=t.has_fzo&&n.indexOf(t.state)>-1;if(o||i){if(o!==i)return o?-1:1;if(e.state!==t.state)return n.indexOf(e.state)-n.indexOf(t.state)}var c=null,a=null,u=Date.now();return r?(c=new Date(e.min_arrival_time||e.time).getTime()-u,a=new Date(t.min_arrival_time||t.time).getTime()-u):(c=new Date(e.time).getTime()-u,a=new Date(t.time).getTime()-u),c-a},In=function(e){if(e)return e.stations.forEach((function(e){e.arrivalTimeWithDelay=e.arrivalTime,e.departureTime&&(e.departureTimeWithDelay=e.departureTime),e.arrivalDelay&&(e.arrivalTime-=e.arrivalDelay,e.departureTime&&(e.departureTime-=e.arrivalDelay))})),e};function An(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Ln={RAW:"raw",TOPOGRAPHIC:"topographic",SCHEMATIC:"schematic"},Bn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};An(this,e),this.defineProperties(t),this.subscribedStationUic=null,this.departureUpdateTimeout=null,this.maxDepartureAge=30,this.extraGeoms={},this.prefix=t.prefix||"",this.onOpen=this.onOpen.bind(this)}var t,r,n;return t=e,(r=[{key:"defineProperties",value:function(e){var t=this,r=e;"string"==typeof e&&(r={url:e});var n=r.apiKey,o=r,i=o.url,c=o.projection,a=o.bbox,u=new Rn;n&&(i="".concat(i||"wss://tralis-tracker-api.geops.io/ws","?key=").concat(n)),Object.defineProperties(this,{url:{get:function(){return i},set:function(e){i=e,t.open()}},projection:{get:function(){return c},set:function(e){e!==c&&(c=e,t.conn&&t.conn.send("PROJECTION ".concat(c)))}},bbox:{get:function(){return a},set:function(e){JSON.stringify(e)!==JSON.stringify(a)&&(a=e,t.conn&&t.conn.send("BBOX ".concat(a.join(" "))))}},conn:{value:u,writable:!0},pingIntervalMs:{value:e.pingIntervalMs||1e4,writable:!0},reconnectTimeoutMs:{value:e.pingIntervalMs||100,writable:!0}})}},{key:"open",value:function(){var e=this;this.close(),this.conn.connect(this.url,this.onOpen),this.conn.websocket.onclose=function(){e.onClose()}}},{key:"close",value:function(){this.conn.close()}},{key:"reset",value:function(){this.conn.send("RESET")}},{key:"onOpen",value:function(){var e=this;this.projection&&this.conn.send("PROJECTION ".concat(this.projection)),this.bbox&&this.conn.send("BBOX ".concat(this.bbox.join(" "))),this.pingIntervalMs&&(window.clearInterval(this.pingInterval),this.pingInterval=setInterval((function(){e.conn.send("PING")}),this.pingIntervalMs))}},{key:"onClose",value:function(){var e=this;window.clearTimeout(this.pingInterval),window.clearTimeout(this.reconnectTimeout),this.reconnectTimeoutMs&&(this.reconnectTimeout=window.setTimeout((function(){return e.open()}),this.reconnectTimeoutMs))}},{key:"subscribe",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.conn.subscribe({channel:e},t,r,n)}},{key:"unsubscribe",value:function(e,t,r){this.conn.unsubscribe("".concat(e).concat(_n(Ln.SCHEMATIC,Ln)).concat(t),r),this.conn.unsubscribe("".concat(e).concat(_n(Ln.TOPOGRAPHIC,Ln)).concat(t||""),r)}},{key:"filterDepartures",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=Object.keys(e).map((function(t){return e[t]}));r.sort((function(e,r){return Dn(e,r,t)}));var n=new Date;n.setMinutes(n.getMinutes()+this.maxDepartureAge),n=n.getTime();var o=new Date;o.setMinutes(o.getMinutes()-this.maxDepartureAge),o=o.getTime();for(var i=[],c=[],a=null,u=r.length-1;u>=0;u-=1){var s=r[u],l=new Date(s.time).getTime();l>o&&l<n&&("BOARDING"===s.state&&(-1===c.indexOf(s.platform)?c.push(s.platform):s.state="HIDDEN"),a&&s.to[0]===a.to[0]&&Math.abs(l-a.time)<1e3&&s.line.name===a.line.name&&(s.state="HIDDEN"),/(STOP_CANCELLED|JOURNEY_CANCELLED)/.test(s.state)&&(s.cancelled=!0),(a=s).time=l,i.unshift(s))}return i}},{key:"subscribeDepartures",value:function(e,t,r){var n=this;window.clearTimeout(this.departureUpdateTimeout),this.unsubscribeDepartures(),this.subscribedStationUic=e;var o=e?"timetable_".concat(e):null,i={};this.subscribe(o,(function(e){if(e.source===o){var c=e.content||{},a=new Date(c.timestamp).getTime()-Date.now();c.timediff=a,i[c.call_id]=c,window.clearTimeout(n.departureUpdateTimeout),n.departureUpdateTimeout=window.setTimeout((function(){var e=n.filterDepartures(i,t||!1);r(e)}),100)}}),(function(){r([])}))}},{key:"unsubscribeDepartures",value:function(e){this.subscribedStationUic&&(this.unsubscribe("timetable_".concat(this.subscribedStationUic),"",e),this.subscribedStationUic=null)}},{key:"subscribeDisruptions",value:function(e){this.subscribe("".concat(this.prefix,"newsticker"),(function(t){e(t.content)}))}},{key:"unsubscribeDisruptions",value:function(e){this.unsubscribe("".concat(this.prefix,"newsticker"),"",e)}},{key:"getStation",value:function(e,t){var r=this,n={channel:"station".concat(_n(t,Ln)),args:e};return new Promise((function(e,t){r.conn.get(n,(function(r){r.content?e(r.content):t()}))}))}},{key:"getStations",value:function(e){var t=this,r=[],n={channel:"station".concat(_n(e,Ln))};return window.clearTimeout(this.stationUpdateTimeout),new Promise((function(e,o){t.conn.get(n,(function(n){n.content?(r.push(n.content),window.clearTimeout(t.stationUpdateTimeout),t.stationUpdateTimeout=window.setTimeout((function(){e(r)}),50)):o(n.content)}))}))}},{key:"subscribeStations",value:function(e,t){this.unsubscribeStations(),this.subscribe("station".concat(_n(e,Ln)),(function(e){e.content&&t(e.content)}))}},{key:"unsubscribeStations",value:function(e){window.clearTimeout(this.stationUpdateTimeout),this.unsubscribe("station","",e)}},{key:"subscribeExtraGeoms",value:function(e){var t=this;this.subscribe("extra_geoms",(function(r){var n=r.content;if(n){var o=n.properties.ref;"Feature"===n.type?t.extraGeoms[o]=n:delete t.extraGeoms[o],e(Object.keys(t.extraGeoms).map((function(e){return t.extraGeoms[e]})))}}))}},{key:"unsubscribeExtraGeoms",value:function(e){this.unsubscribe("extra_geoms","",e)}},{key:"subscribeTrajectory",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.unsubscribeTrajectory(t),this.subscribe("trajectory".concat(_n(e,Ln)),t,null,r)}},{key:"unsubscribeTrajectory",value:function(e){this.unsubscribe("trajectory","",e)}},{key:"subscribeDeletedVehicles",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.unsubscribeDeletedVehicles(t),this.subscribe("deleted_vehicles".concat(_n(e,Ln)),t,null,r)}},{key:"unsubscribeDeletedVehicles",value:function(e){this.unsubscribe("deleted_vehicles","",e)}},{key:"getFullTrajectory",value:function(e,t,r){var n=this,o=["full_trajectory".concat(_n(t,Ln))];e&&o.push(e),t&&t!==Ln.TOPOGRAPHIC||!r||o.push("gen".concat(r));var i={channel:o.join("_")};return new Promise((function(e){n.conn.get(i,(function(t){t.content&&e(t.content)}))}))}},{key:"getFullTrajectories",value:function(e,t,r){var n=this,o=e.map((function(e){return n.getFullTrajectory(e,t,r)}));return Promise.all(o)}},{key:"subscribeFullTrajectory",value:function(e,t){this.unsubscribeFullTrajectory(e),this.subscribe("full_trajectory".concat(_n(t,Ln),"_").concat(e),(function(e){console.log("subscribe full_trajectory",e)}),(function(e){console.log("subscribe full_trajectory error",e)}))}},{key:"unsubscribeFullTrajectory",value:function(e,t){this.unsubscribe("full_trajectory","_".concat(e),t)}},{key:"getStopSequence",value:function(e){var t=this,r={channel:"stopsequence_".concat(e)};return new Promise((function(e,n){t.conn.get(r,(function(t){if(t.content&&t.content.length){var r=t.content.map((function(e){return In(e)}));e(r)}e([])}),(function(e){n(e)}))}))}},{key:"getStopSequences",value:function(e){var t=this,r=e.map((function(e){return t.getStopSequence(e)}));return Promise.all(r)}},{key:"subscribeStopSequence",value:function(e,t){window.clearTimeout(this.fullTrajectoryUpdateTimeout),this.unsubscribeStopSequence(e),this.subscribe("stopsequence_".concat(e),(function(e){if(e.content&&e.content.length){var r=e.content.map((function(e){return In(e)}));t(r)}}),(function(e){console.log("subscribe stopsequence error",e)}))}},{key:"unsubscribeStopSequence",value:function(e,t){this.unsubscribe("stopsequence","_".concat(e),t)}},{key:"subscribeHealthCheck",value:function(e){this.unsubscribeHealthCheck(),this.subscribe("healthcheck",e)}},{key:"unsubscribeHealthCheck",value:function(){this.unsubscribe("healthcheck")}}])&&Mn(t.prototype,r),n&&Mn(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Vn(e){return(Vn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Fn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Un(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Fn(Object(r),!0).forEach((function(t){qn(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function qn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Nn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],c=!0,a=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);c=!0);}catch(e){a=!0,o=e}finally{try{c||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Hn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Hn(e,t)}(e,t)||function(){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 Hn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Kn(){return(Kn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=zn(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function zn(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=$n(e)););return e}function Zn(e,t){return(Zn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Gn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=$n(e);if(t){var o=$n(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Wn(this,r)}}function Wn(e,t){if(t&&("object"===Vn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function $n(e){return($n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Jn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Xn(e,t,r){return t&&Qn(e.prototype,t),r&&Qn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var Yn=function(e){return function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zn(e,t)}(r,e);var t=Gn(r);function r(){return Jn(this,r),t.apply(this,arguments)}return Xn(r,[{key:"defineProperties",value:function(e){var t=this;Kn($n(r.prototype),"defineProperties",this).call(this,e);var n,o=3;if(!e.api){var i={};e.url&&(i.url=e.url),e.apiKey&&(i.apiKey=e.apiKey),n=new Tn(i)}Object.defineProperties(this,{requestIntervalSeconds:{get:function(){return o},set:function(e){e!==o&&(o=e,t.visible&&t.start())}},api:{value:e.api||n}})}},{key:"init",value:function(e){Kn($n(r.prototype),"init",this).call(this,e),this.sortFc?this.sort=this.sortFc:this.useDelayStyle&&(this.sort=function(e,t){return null===e.delay||e.delay<t.delay?1:-1})}},{key:"start",value:function(){this.updateFilters(),Kn($n(r.prototype),"start",this).call(this),this.startUpdateTrajectories()}},{key:"stop",value:function(){this.stopUpdateTrajectories(),this.abortFetchTrajectories(),Kn($n(r.prototype),"stop",this).call(this)}},{key:"onFeatureHover",value:function(e,t,n){var o=Nn(e,1)[0],i=null;o&&(i=o.get("id")),this.hoverVehicleId!==i&&(this.hoverVehicleId=i,this.renderTrajectories()),Kn($n(r.prototype),"onFeatureHover",this).call(this,e,t,n)}},{key:"onFeatureClick",value:function(e,t,n){var o=Nn(e,1)[0];o?(this.selectedVehicleId=o.get("id"),this.journeyId=o.get("journeyIdentifier"),this.highlightTrajectory()):(this.selectedVehicleId=null,this.journeyId=null),Kn($n(r.prototype),"onFeatureClick",this).call(this,e,t,n)}},{key:"highlightTrajectory",value:function(){var e=this,t=this.selectedVehicleId,r=this.journeyId,n=[this.api.fetchTrajectoryStations(this.getParams({id:t,time:xt(new Date)})),this.api.fetchTrajectoryById(this.getParams({id:r,time:xt(new Date)}))];Promise.all(n).then((function(t){var r=Nn(t,2),n=r[0],o=r[1],i=[];if(n&&n.stations.forEach((function(e){i.push(e.coordinates)})),o){var c=o.p,a=o.t,u=o.c,s=[];c.forEach((function(e){e.forEach((function(e){s.push([e.x,e.y])}))}));var l=u?"#".concat(u):ht(a),f=/#ffffff/i.test(l)?"#ff0000":l;e.drawFullTrajectory(i,s,e.useDelayStyle?"#a0a0a0":f)}})).catch((function(){e.drawFullTrajectory()}))}},{key:"abortFetchTrajectories",value:function(){this.abortController&&this.abortController.abort()}},{key:"getParams",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=1e3*(this.requestIntervalSeconds+5),r=this.speed*t,n=this.time,o=!0;if(this.later&&n.getTime()>this.later.getTime()-1e3*this.requestIntervalSeconds&&(o=!1),!this.later||!o||this.later.getTime()-n.getTime()>r){var i=new Date(n.getTime()+r);this.later=i}var c=Un(Un({},e),{},{btime:xt(n),etime:xt(this.later),date:Et(n),rid:1,a:1,cd:1,nm:1,fl:1});return c}},{key:"startUpdateTrajectories",value:function(){var e=this;this.stopUpdateTrajectories(),this.updateTrajectories(),this.updateInterval=window.setInterval((function(){e.updateTrajectories()}),1e3*this.requestIntervalSeconds)}},{key:"stopUpdateTrajectories",value:function(){clearInterval(this.updateInterval)}},{key:"updateTrajectories",value:function(){var e=this;this.abortFetchTrajectories(),this.abortController=new AbortController,this.api.fetchTrajectories(this.getParams({attr_det:1}),this.abortController).catch((function(e){if("AbortError"!==e.name)throw e})).then((function(t){t&&(e.tracker.setTrajectories(t),e.renderTrajectories())}))}},{key:"drawFullTrajectory",value:function(e,t,r){}},{key:"defaultStyle",value:function(e,t){var r=t.zoom,n=e.type,o=e.name,i=e.id,c=e.color,a=e.textColor,u=e.delay,s=e.cancelled,l=e.operatorProvidesRealtime,f=Math.min(Math.floor(r||1),16),p=this.hoverVehicleId===i,y=this.selectedVehicleId===i,h="".concat(f).concat(n).concat(o).concat(l).concat(u).concat(p).concat(y).concat(s),b=yt(n,f)*this.pixelRatio,v=b>=7*this.pixelRatio;(p||y)&&(b=v?b+5*this.pixelRatio:14*this.pixelRatio);var d=b>10*this.pixelRatio;if(d||(h="".concat(f).concat(n).concat(c).concat(l).concat(u).concat(p).concat(y).concat(s)),!this.styleCache[h]){if(0===b)return this.styleCache[h]=null,null;var m=1*this.pixelRatio,g=b+2,O=2*b,j=document.createElement("canvas");j.width=2*g+2*m+100*this.pixelRatio,j.height=2*g+2*m+100*this.pixelRatio;var w,P=j.getContext("2d"),k=j.width/2;if(v&&null!==u&&(P.save(),P.beginPath(),P.arc(k,k,g,0,2*Math.PI,!1),P.fillStyle=dt(u,s),P.filter="blur(1px)",P.fill(),P.restore()),v&&(p||u>=this.delayDisplay||s)){P.save(),P.textAlign="left",P.textBaseline="middle",P.font="bold ".concat(Math.max(s?19:14,Math.min(s?19:17,1.2*b)),"px arial, sans-serif"),P.fillStyle=dt(u,s,!0),P.strokeStyle=this.delayOutlineColor,P.lineWidth=1.5*this.pixelRatio;var S=mt(u,s);P.strokeText(S,k+g+m,k),P.fillText(S,k+g+m,k),P.restore()}if(w=this.useDelayStyle?dt(u,s):c||ht(n),P.save(),(v||p||y)&&(P.lineWidth=1*this.pixelRatio,P.strokeStyle="#000000"),P.fillStyle=w,P.beginPath(),P.arc(k,k,b,0,2*Math.PI,!1),P.fill(),v&&this.useDelayStyle&&null===u&&"yes"===l&&P.setLineDash([5,3]),(v||p||y)&&P.stroke(),P.restore(),d){var T=Math.max(b,10*this.pixelRatio),C=vt(P,O,o,T);this.useDelayStyle&&null===u&&"yes"===l&&(P.save(),P.textBaseline="middle",P.textAlign="center",P.font="bold ".concat(C+2,"px Arial"),P.strokeStyle=w,P.strokeText(o,k,k),P.restore()),P.save(),P.textBaseline="middle",P.textAlign="center",P.fillStyle=this.useDelayStyle?"#000000":a||bt(n),P.font="bold ".concat(C,"px Arial"),P.strokeStyle=w,P.strokeText(o,k,k),P.fillText(o,k,k),P.restore()}this.styleCache[h]=j}return this.styleCache[h]}}]),r}(e)};function eo(e){return(eo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function to(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ro(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?to(Object(r),!0).forEach((function(t){no(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):to(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function no(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function io(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function co(){return(co="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=ao(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function ao(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=fo(e)););return e}function uo(e,t){return(uo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function so(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=fo(e);if(t){var o=fo(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return lo(this,r)}}function lo(e,t){if(t&&("object"===eo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function fo(e){return(fo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var po=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&uo(e,t)}(i,e);var t,r,n,o=so(i);function i(){return oo(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"start",value:function(){var e=this;this.map&&(co(fo(i.prototype),"start",this).call(this),this.olEventsKeys=[this.map.on("movestart",(function(){e.abortFetchTrajectories()})),this.map.on("moveend",this.onMoveEnd.bind(this))])}},{key:"stop",value:function(){Object(c.unByKey)(this.olEventsKeys),co(fo(i.prototype),"stop",this).call(this)}},{key:"onMoveEnd",value:function(){var e=this.map.getView().getZoom();e!==this.currentZoom&&(this.currentZoom=e,this.requestIntervalSeconds=200/e||1e3),this.abortFetchTrajectories(),this.map.getView().getAnimating()||this.map.getView().getInteracting()||this.updateTrajectories(),this.selectedVehicleId&&this.journeyId&&this.highlightTrajectory()}},{key:"drawFullTrajectory",value:function(e,t,r){var n=this.vectorLayer.getSource();if(n.clear(),e){var o=new qr.MultiPoint(e.map((function(e){return Object(Ge.fromLonLat)(e)}))),i=new Yt.a(o);i.setStyle(new Zt.Style({zIndex:1,image:new Zt.Circle({radius:5,fill:new Zt.Fill({color:"#000000"})})}));var c=new Yt.a(o);c.setStyle(new Zt.Style({zIndex:4,image:new Zt.Circle({radius:4,fill:new Zt.Fill({color:r})})})),n.addFeatures([i,c])}if(t){var a=new Yt.a({geometry:new qr.LineString(t)});a.setStyle([new Zt.Style({zIndex:2,stroke:new Zt.Stroke({color:"#000000",width:6})}),new Zt.Style({zIndex:3,stroke:new Zt.Stroke({color:r,width:4})})]),n.addFeature(a)}}},{key:"getParams",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.map.getView().calculateExtent(),r=Object(Qt.buffer)(t,Object(Qt.getWidth)(t)/10).join(","),n=this.map.getView().getZoom();return co(fo(i.prototype),"getParams",this).call(this,ro(ro({},e),{},{bbox:r,s:n<10?1:0,z:n}))}},{key:"clone",value:function(e){return new i(ro(ro({},this.options),e))}}])&&io(t.prototype,r),n&&io(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Yn(Ur)),yo=r(24),ho=r.n(yo);function bo(e){return(bo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function vo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],c=!0,a=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);c=!0);}catch(e){a=!0,o=e}finally{try{c||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||go(e,t)||function(){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 mo(e){return function(e){if(Array.isArray(e))return Oo(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||go(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function go(e,t){if(e){if("string"==typeof e)return Oo(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Oo(e,t):void 0}}function Oo(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function jo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function wo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?jo(Object(r),!0).forEach((function(t){Po(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jo(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Po(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ko(){return(ko="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=So(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function So(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Ro(e)););return e}function To(e,t){return(To=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Co(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Ro(e);if(t){var o=Ro(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Eo(this,r)}}function Eo(e,t){if(t&&("object"===bo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return xo(e)}function xo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ro(e){return(Ro=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Do(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Io(e,t,r){return t&&Do(e.prototype,t),r&&Do(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var Ao=function(e){return function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&To(e,t)}(r,e);var t=Co(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return _o(this,r),(e=t.call(this,wo({},n))).debug=n.debug,e.mode=n.mode||Ln.TOPOGRAPHIC,e.api=n.api||new Bn(n),e.tenant=n.tenant||"",e.minZoomNonTrain=n.minZoomNonTrain||9,e.format=new Ye.a,e.generalizationLevelByZoom=n.generalizationLevelByZoom||{0:5,1:5,2:5,3:5,4:5,5:5,6:5,7:5,8:10,9:30,10:30,11:100,12:100,13:100},e.isUpdateBboxOnMoveEnd=!1!==n.isUpdateBboxOnMoveEnd,e.onTrajectoryMessage=e.onTrajectoryMessage.bind(xo(e)),e.onDeleteTrajectoryMessage=e.onDeleteTrajectoryMessage.bind(xo(e)),e}return Io(r,[{key:"start",value:function(){ko(Ro(r.prototype),"start",this).call(this),this.api.open(),this.api.subscribeTrajectory(this.mode,this.onTrajectoryMessage,this.isUpdateBboxOnMoveEnd),this.api.subscribeDeletedVehicles(this.mode,this.onDeleteTrajectoryMessage,this.isUpdateBboxOnMoveEnd),this.isUpdateBboxOnMoveEnd&&this.setBbox()}},{key:"stop",value:function(){ko(Ro(r.prototype),"stop",this).call(this),this.api.unsubscribeTrajectory(this.onTrajectoryMessage),this.api.unsubscribeDeletedVehicles(this.onDeleteTrajectoryMessage),this.api.close()}},{key:"setBbox",value:function(e,t){for(var r=this.trajectories.length-1;r>=0;r-=1){var n=this.trajectories[r];if(this.mustNotBeDisplayed(n,e,t)){var o=mo(this.trajectories);o.splice(r,1),this.tracker.setTrajectories(o)}}var i=mo(e);this.isUpdateBboxOnMoveEnd&&(i.push(t),this.tenant&&i.push("tenant=".concat(this.tenant)),this.generalizationLevel=this.generalizationLevelByZoom[t],this.generalizationLevel&&i.push("gen=".concat(this.generalizationLevel))),this.api.bbox=i}},{key:"setMode",value:function(e){this.mode!==e&&(this.mode=e,this.api.subscribeTrajectory(this.mode,this.onTrajectoryMessage,this.isUpdateBboxOnMoveEnd),this.api.subscribeDeletedVehicles(this.mode,this.onDeleteTrajectoryMessage,this.isUpdateBboxOnMoveEnd))}},{key:"getTrajectoryInfos",value:function(e){var t=[this.api.getStopSequence(e,this.mode),this.api.getFullTrajectory(e,this.mode,this.generalizationLevel)];return Promise.all(t).then((function(e){var t=vo(e,2);return{stopSequence:t[0],fullTrajectory:t[1]}}))}},{key:"mustNotBeDisplayed",value:function(e,t,r){return!Object(Qt.intersects)(t,e.bounds)||"rail"!==e.type&&r<(this.minZoomNonTrain||9)}},{key:"addTrajectory",value:function(e,t){var r=this.trajectories.findIndex((function(t){return t.train_id===e.train_id})),n=e.time_intervals,o=wo(wo({},e),{},{id:e.train_id,timeIntervals:n});t?(this.trajectories.unshift(o),-1!==r&&this.tracker.trajectories.splice(r+1,1)):(this.trajectories.push(o),-1!==r&&this.tracker.trajectories.splice(r,1)),this.tracker.setTrajectories(this.trajectories)}},{key:"removeTrajectory",value:function(e){for(var t=0,r=this.trajectories.length;t<r;t+=1)if(this.trajectories[t].train_id===e){this.trajectories.splice(t,1);break}}},{key:"onTrajectoryMessage",value:function(e){if(e.content){var t=this.format.readFeature(e.content);if(t.set("timeOffset",Date.now()-e.timestamp),t.get("time_since_update")>=0){if(this.debug&&this.mode===Ln.TOPOGRAPHIC&&t.get("raw_coordinates")){var r=new ho.a(t.get("raw_coordinates"));r.transform("EPSG:4326",this.map.getView().getProjection()),t.setGeometry(r)}this.mustNotBeDisplayed(t.getProperties())||this.addTrajectory(t.getProperties(),!t.get("line"))}}}},{key:"onDeleteTrajectoryMessage",value:function(e){e.content&&this.removeTrajectory(e.content)}},{key:"onFeatureHover",value:function(e,t,n){var o=vo(e,1)[0],i=null;o&&(i=o.get("train_id")),this.hoverVehicleId!==i&&(this.hoverVehicleId=i,this.renderTrajectories()),ko(Ro(r.prototype),"onFeatureHover",this).call(this,e,t,n)}},{key:"onFeatureClick",value:function(e,t,n){var o=vo(e,1)[0],i=null;o&&(i=o.get("train_id")),this.selectedVehicleId!==i&&(this.selectedVehicleId=i,this.selectedVehicle=o,this.renderTrajectories()),ko(Ro(r.prototype),"onFeatureClick",this).call(this,e,t,n)}}]),r}(e)};function Mo(e){return(Mo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Lo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Bo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Lo(Object(r),!0).forEach((function(t){Vo(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lo(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Vo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Uo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function qo(){return(qo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=No(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function No(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Zo(e)););return e}function Ho(e,t){return(Ho=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ko(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Zo(e);if(t){var o=Zo(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return zo(this,r)}}function zo(e,t){if(t&&("object"===Mo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Zo(e){return(Zo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Go=new Ye.a,Wo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ho(e,t)}(i,e);var t,r,n,o=Ko(i);function i(){return Fo(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"mustNotBeDisplayed",value:function(e,t,r){return qo(Zo(i.prototype),"mustNotBeDisplayed",this).call(this,e,t||this.map.getView().calculateExtent(),r||this.map.getView().getZoom())}},{key:"setBbox",value:function(e,t){var r=e,n=t;!r&&this.isUpdateBboxOnMoveEnd&&(r=e||this.map.getView().calculateExtent(),n=Math.floor(this.map.getView().getZoom())),qo(Zo(i.prototype),"setBbox",this).call(this,r,n)}},{key:"onMoveEnd",value:function(e){qo(Zo(i.prototype),"onMoveEnd",this).call(this,e),this.visible&&this.isUpdateBboxOnMoveEnd&&this.setBbox(),this.visible&&this.isUpdateBboxOnMoveEnd&&this.isClickActive&&this.selectedVehicleId&&this.highlightTrajectory(this.selectedVehicleId)}},{key:"onFeatureClick",value:function(e,t,r){qo(Zo(i.prototype),"onFeatureClick",this).call(this,e,t,r),this.selectedVehicleId&&this.highlightTrajectory(this.selectedVehicleId)}},{key:"highlightTrajectory",value:function(e){var t=this;this.getTrajectoryInfos(e).then((function(e){var r=e.stopSequence,n=e.fullTrajectory,o=t.vectorLayer.getSource();o.clear();var i="#ffffff";if(t.useDelayStyle)i="#a0a0a0";else{if(n){var c=n.features[0].properties,a=c.type,u=c.stroke;u&&"#"!==u[0]&&(u="#".concat(u)),i=u||ht(a)}i=/#ffffff/i.test(i)?"#ff0000":i}if(r.forEach((function(e){if(e.stations){var t=new qr.MultiPoint(e.stations.map((function(e){return e.coordinate}))),r=new Yt.a(t);r.setStyle(new Zt.Style({zIndex:1,image:new Zt.Circle({radius:5,fill:new Zt.Fill({color:"#000000"})})}));var n=new Yt.a(t);n.setStyle(new Zt.Style({zIndex:4,image:new Zt.Circle({radius:4,fill:new Zt.Fill({color:i})})})),o.addFeatures([r,n])}})),n){var s=[new Zt.Style({zIndex:2,stroke:new Zt.Stroke({color:"#000000",width:6})}),new Zt.Style({zIndex:3,stroke:new Zt.Stroke({color:i,width:4})})],l=Go.readFeatures(n);l.forEach((function(e){e.setStyle(s)})),t.vectorLayer.getSource().addFeatures(l)}}))}},{key:"clone",value:function(e){return new i(Bo(Bo({},this.options),e))}}])&&Uo(t.prototype,r),n&&Uo(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Ao(Ur));function $o(e){return($o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Jo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Qo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Jo(Object(r),!0).forEach((function(t){Xo(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Jo(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Xo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Yo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ei(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ti(e,t){return(ti=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ri(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=oi(e);if(t){var o=oi(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ni(this,r)}}function ni(e,t){if(t&&("object"===$o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function oi(e){return(oi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ii=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ti(e,t)}(i,e);var t,r,n,o=ri(i);function i(){return Yo(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"getFeatureInfoAtCoordinate",value:function(e){var t=this,r=[];if(this.map){var n=this.map.getPixelFromCoordinate(e);r=this.map.getFeaturesAtPixel(n,{layerFilter:function(e){return e===t.olLayer},hitTolerance:this.hitTolerance})}return Promise.resolve({features:r,layer:this,coordinate:e})}},{key:"clone",value:function(e){return new i(Qo(Qo({},this.options),e))}}])&&ei(t.prototype,r),n&&ei(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(A);function ci(e){return(ci="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ai(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ui(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ai(Object(r),!0).forEach((function(t){si(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ai(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function si(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function li(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fi(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function pi(e,t){return(pi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function yi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=bi(e);if(t){var o=bi(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return hi(this,r)}}function hi(e,t){if(t&&("object"===ci(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function bi(e){return(bi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var vi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pi(e,t)}(i,e);var t,r,n,o=yi(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return li(this,i),(e=o.call(this,t)).abortController=new AbortController,e.format=new Ye.a,e}return t=i,(r=[{key:"getFeatureInfoUrl",value:function(e){var t=this.map.getView().getProjection(),r=this.map.getView().getResolution();return!!this.olLayer.getSource().getFeatureInfoUrl&&this.olLayer.getSource().getFeatureInfoUrl(e,r,t,{info_format:"application/json",query_layers:this.olLayer.getSource().getParams().layers})}},{key:"getFeatureInfoAtCoordinate",value:function(e){var t=this;this.abortController.abort(),this.abortController=new AbortController;var r=this.abortController.signal;return fetch(this.getFeatureInfoUrl(e),{signal:r}).then((function(e){return e.json()})).then((function(e){return e.features})).then((function(r){return{layer:t,coordinate:e,features:r.map((function(e){return t.format.readFeature(e)}))}})).catch((function(){return Promise.resolve({features:[],coordinate:e,layer:t})}))}},{key:"clone",value:function(e){return new i(ui(ui({},this.options),e))}}])&&fi(t.prototype,r),n&&fi(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(A);r(15),r(25),r(26),r(17);function di(e){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function mi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function gi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?mi(Object(r),!0).forEach((function(t){Oi(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Oi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ji(e,t){return(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function wi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ki(e);if(t){var o=ki(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return Pi(this,r)}}function Pi(e,t){if(t&&("object"===di(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ki(e){return(Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Si(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ti(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ci(e,t,r){return t&&Ti(e.prototype,t),r&&Ti(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ei(e){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ri(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _i(e,t){return(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Di(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Ai(e);if(t){var o=Ai(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return Ii(this,r)}}function Ii(e,t){if(t&&("object"===Ei(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Ai(e){return(Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Mi=G;var Mi;function Li(e){return(Li="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Bi(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Vi(){return(Vi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Fi(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Fi(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Ki(e)););return e}function Ui(e,t){return(Ui=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function qi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Ki(e);if(t){var o=Ki(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ni(this,r)}}function Ni(e,t){if(t&&("object"===Li(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Hi(e)}function Hi(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ki(e){return(Ki=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var zi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ui(e,t)}(i,e);var t,r,n,o=qi(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).render=t.render.bind(Hi(t)),t}return t=i,(r=[{key:"activate",value:function(){Vi(Ki(i.prototype),"activate",this).call(this),this.map&&(this.map.on("sourcedata",this.render),this.map.on("styledata",this.render),this.map.on("idle",this.render))}},{key:"deactivate",value:function(){this.map&&(this.map.off("sourcedata",this.render),this.map.off("styledata",this.render),this.map.off("idle",this.render)),Vi(Ki(i.prototype),"deactivate",this).call(this)}},{key:"getCopyrights",value:function(){return ct(this.map)}}])&&Bi(t.prototype,r),n&&Bi(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(me(G));function Zi(e){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Gi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Wi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gi(Object(r),!0).forEach((function(t){$i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function $i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ji(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Qi(){return("undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Xi(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Xi(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==rc(e););return e}function Yi(e,t){return(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ec(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=rc(e);if(t){var o=rc(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return tc(this,r)}}function tc(e,t){if(t&&("object"===Zi(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function rc(e){return(Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}ae(We.Map);var nc=r(18),oc=r.n(nc),ic=r(19);function cc(e){return(cc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ac(e){return function(e){if(Array.isArray(e))return uc(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return uc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return uc(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function sc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function lc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?sc(Object(r),!0).forEach((function(t){fc(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function fc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function hc(){return(hc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=bc(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function bc(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=gc(e)););return e}function vc(e,t){return(vc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function dc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=gc(e);if(t){var o=gc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return mc(this,r)}}function mc(e,t){if(t&&("object"===cc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function gc(e){return(gc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Oc(e){return function(e){if(Array.isArray(e))return jc(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return jc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return jc(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var wc=function(e){var t=e.getBounds().toArray(),r=Object(Ge.fromLonLat)(t[0]),n=Object(Ge.fromLonLat)(t[1]),o=[].concat(Oc(r),Oc(n)),i=e.getCanvas(),c=i.width,a=i.height,u=Object(Qt.getWidth)(o)/c,s=Object(Qt.getHeight)(o)/a;return Math.max(u,s)},Pc=function(e,t){var r=e.getCanvas(),n=r.width,o=r.height,i=e.unproject({x:0,y:0}),c=e.unproject({x:0,y:o/t}),a=e.unproject({x:n/t,y:o/t}),u=e.unproject({x:n/t,y:0});return[[i.lng,i.lat],[u.lng,u.lat],[a.lng,a.lat],[c.lng,c.lat]]};function kc(e){return(kc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Sc(e){return function(e){if(Array.isArray(e))return Tc(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Tc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Tc(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Tc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Cc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ec(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Cc(Object(r),!0).forEach((function(t){xc(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function xc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Rc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Dc(){return(Dc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Ic(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Ic(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Vc(e)););return e}function Ac(e,t){return(Ac=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Mc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Vc(e);if(t){var o=Vc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Lc(this,r)}}function Lc(e,t){if(t&&("object"===kc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Bc(e)}function Bc(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Vc(e){return(Vc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Fc=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ac(e,t)}(i,e);var t,r,n,o=Mc(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Rc(this,i),(e=o.call(this,Ec({},t))).onMove=e.onMove.bind(Bc(e)),e.onMoveEnd=e.onMoveEnd.bind(Bc(e)),e.onZoomEnd=e.onZoomEnd.bind(Bc(e)),e.onVisibilityChange=e.onVisibilityChange.bind(Bc(e)),e}return t=i,(r=[{key:"init",value:function(e,t){if(e){var r=e.getCanvas();Dc(Vc(i.prototype),"init",this).call(this,e,{width:r.width/this.pixelRatio,height:r.height/this.pixelRatio});var n={type:"canvas",canvas:this.tracker.canvas,coordinates:Pc(e,this.pixelRatio),animate:!0,attribution:this.copyrights&&this.copyrights.join(", ")};this.beforeId=t,this.layer={id:this.key,type:"raster",source:this.key,layout:{visibility:this.visible?"visible":"none"},paint:{"raster-opacity":1,"raster-fade-duration":0,"raster-resampling":"nearest"}},e.addSource(this.key,n),e.addLayer(this.layer,this.beforeId),this.listeners=[this.on("change:visible",this.onVisibilityChange)]}}},{key:"terminate",value:function(){this.map&&(this.listeners.forEach((function(e){Object(c.unByKey)(e)})),this.map.getLayer(this.key)&&this.map.removeLayer(this.key),this.map.getSource(this.key)&&this.map.removeSource(this.key)),Dc(Vc(i.prototype),"terminate",this).call(this)}},{key:"start",value:function(){Dc(Vc(i.prototype),"start",this).call(this),this.map.on("move",this.onMove),this.map.on("moveend",this.onMoveEnd),this.map.on("zoomend",this.onZoomEnd)}},{key:"stop",value:function(){Dc(Vc(i.prototype),"stop",this).call(this),this.map&&(this.map.off("move",this.onMove),this.map.off("moveend",this.onMoveEnd),this.map.off("zoomend",this.onZoomEnd))}},{key:"onUserClickCallback",value:function(e){Dc(Vc(i.prototype),"onUserClickCallback",this).call(this,Ec({coordinate:Object(Ge.fromLonLat)(e.lngLat.toArray())},e))}},{key:"onUserMoveCallback",value:function(e){Dc(Vc(i.prototype),"onUserMoveCallback",this).call(this,Ec({coordinate:Object(Ge.fromLonLat)(e.lngLat.toArray())},e))}},{key:"renderTrajectories",value:function(e){var t=this.map.getCanvas(),r=t.width,n=t.height,o=this.map.getCenter(),c=this.map.unproject({x:0,y:n/this.pixelRatio}),a=this.map.unproject({x:r/this.pixelRatio,y:0}),u=oc()(Object(ic.point)([c.lng,c.lat]),-this.map.getBearing(),{pivot:[o.lng,o.lat]}).geometry.coordinates,s=oc()(Object(ic.point)([a.lng,a.lat]),-this.map.getBearing(),{pivot:[o.lng,o.lat]}).geometry.coordinates,l=[].concat(Sc(Object(Ge.fromLonLat)(u)),Sc(Object(Ge.fromLonLat)(s))),f=Object(Qt.getWidth)(l)/(r/this.pixelRatio),p=Object(Qt.getHeight)(l)/(n/this.pixelRatio),y=Math.max(f,p),h={size:[r/this.pixelRatio,n/this.pixelRatio],center:Object(Ge.fromLonLat)([o.lng,o.lat]),extent:l,resolution:y,zoom:this.map.getZoom(),rotation:-this.map.getBearing()*Math.PI/180,pixelRatio:this.pixelRatio};Dc(Vc(i.prototype),"renderTrajectories",this).call(this,h,e)}},{key:"getRefreshTimeInMs",value:function(){return Dc(Vc(i.prototype),"getRefreshTimeInMs",this).call(this,this.map.getZoom())}},{key:"getVehiclesAtCoordinate",value:function(e,t){var r=wc(this.map);return Dc(Vc(i.prototype),"getVehiclesAtCoordinate",this).call(this,e,r,t)}},{key:"getFeatureInfoAtCoordinate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=wc(this.map);return Dc(Vc(i.prototype),"getFeatureInfoAtCoordinate",this).call(this,e,Ec({resolution:r},t))}},{key:"onVisibilityChange",value:function(){this.visible&&!this.map.getLayer(this.key)?this.map.addLayer(this.layer,this.beforeId):this.map.getLayer(this.key)&&this.map.removeLayer(this.key)}},{key:"onMove",value:function(){var e=Pc(this.map,this.pixelRatio),t=this.map.getSource(this.key);t&&t.setCoordinates(e),this.renderTrajectories()}},{key:"onMoveEnd",value:function(){}},{key:"onFeatureHover",value:function(e,t,r){Dc(Vc(i.prototype),"onFeatureHover",this).call(this,e,t,r),this.map.getCanvasContainer().style.cursor=e.length?"pointer":"auto"}}])&&_c(t.prototype,r),n&&_c(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Cr(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vc(e,t)}(i,e);var t,r,n,o=dc(i);function i(){return pc(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"init",value:function(e){hc(gc(i.prototype),"init",this).call(this,e),this.map&&(this.isClickActive||this.isHoverActive)&&(this.toggleVisibleListeners(),this.onChangeVisibleKey=this.on("change:visible",this.toggleVisibleListeners))}},{key:"terminate",value:function(e){this.map&&(this.map.off("mousemove",this.onUserMoveCallback),this.map.off("click",this.onUserClickCallback),Object(c.unByKey)(this.onChangeVisibleKey)),hc(gc(i.prototype),"terminate",this).call(this,e)}},{key:"onUserClickCallback",value:function(e){hc(gc(i.prototype),"onUserClickCallback",this).call(this,lc({coordinate:e.lngLat.toArray()},e))}},{key:"onUserMoveCallback",value:function(e){hc(gc(i.prototype),"onUserMoveCallback",this).call(this,lc({coordinate:e.lngLat.toArray()},e))}},{key:"toggleVisibleListeners",value:function(){this.visible?(this.isClickActive&&this.map.on("click",this.onUserClickCallback),this.isHoverActive&&this.map.on("mousemove",this.onUserMoveCallback)):(this.isClickActive&&this.map.off("click",this.onUserClickCallback),this.isHoverActive&&this.map.off("mousemove",this.onUserMoveCallback))}},{key:"getMercatorExtent",value:function(){var e=this.map.getBounds().toArray();return Object(Ge.transformExtent)([].concat(ac(e[0]),ac(e[1])),"EPSG:4326","EPSG:3857")}},{key:"getOlZoom",value:function(){return this.map.getZoom()+1}},{key:"clone",value:function(e){return new i(lc(lc({},this.options),e))}}])&&yc(t.prototype,r),n&&yc(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(w)));function Uc(e){return(Uc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function qc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Hc(){return(Hc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Kc(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Kc(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Wc(e)););return e}function zc(e,t){return(zc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Zc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Wc(e);if(t){var o=Wc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Gc(this,r)}}function Gc(e,t){if(t&&("object"===Uc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Wc(e){return(Wc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var $c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zc(e,t)}(i,e);var t,r,n,o=Zc(i);function i(){return qc(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"mustNotBeDisplayed",value:function(e,t,r){return Hc(Wc(i.prototype),"mustNotBeDisplayed",this).call(this,e,t||this.getMercatorExtent(),r||Math.floor(this.map.getZoom()+1))}},{key:"setBbox",value:function(e,t){var r=e,n=t;!r&&this.isUpdateBboxOnMoveEnd&&(r=e||this.getMercatorExtent(),n=Math.floor(this.getOlZoom())),Hc(Wc(i.prototype),"setBbox",this).call(this,r,n)}},{key:"onMoveEnd",value:function(e){Hc(Wc(i.prototype),"onMoveEnd",this).call(this,e),this.visible&&this.isUpdateBboxOnMoveEnd&&this.setBbox()}}])&&Nc(t.prototype,r),n&&Nc(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Ao(Fc));function Jc(e){return(Jc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Qc(e){return function(e){if(Array.isArray(e))return Xc(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Xc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Xc(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Yc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ea(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Yc(Object(r),!0).forEach((function(t){ta(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ta(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ra(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function na(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function oa(){return(oa="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=ia(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function ia(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=la(e)););return e}function ca(e,t){return(ca=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function aa(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=la(e);if(t){var o=la(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ua(this,r)}}function ua(e,t){if(t&&("object"===Jc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return sa(e)}function sa(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function la(e){return(la=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var fa={mapbox:{TrajservLayer:function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ca(e,t)}(i,e);var t,r,n,o=aa(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ra(this,i),(e=o.call(this,ea({},t))).onMove=e.onMove.bind(sa(e)),e.onMoveEnd=e.onMoveEnd.bind(sa(e)),e.onVisibilityChange=e.onVisibilityChange.bind(sa(e)),e}return t=i,(r=[{key:"terminate",value:function(){this.map&&(this.listeners.forEach((function(e){Object(c.unByKey)(e)})),this.map.removeLayer(this.key),this.map.removeSource(this.key)),oa(la(i.prototype),"terminate",this).call(this)}},{key:"start",value:function(){this.map&&(oa(la(i.prototype),"start",this).call(this),this.map.on("move",this.onMove),this.map.on("moveend",this.onMoveEnd))}},{key:"stop",value:function(){this.map&&(this.map.off("move",this.onMove),this.map.off("moveend",this.onMoveEnd)),oa(la(i.prototype),"stop",this).call(this)}},{key:"onMoveEnd",value:function(){this.updateTrajectories(),this.selectedVehicleId&&this.journeyId&&this.highlightTrajectory()}},{key:"getParams",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.map.getBounds().toArray(),r=Object(Ge.fromLonLat)(t[0]),n=Object(Ge.fromLonLat)(t[1]),o=[].concat(Qc(r),Qc(n)),c=Object(Qt.buffer)(o,Object(Qt.getWidth)(o)/10).join(","),a=this.map.getZoom();return oa(la(i.prototype),"getParams",this).call(this,ea(ea({},e),{},{bbox:c,s:a<10?1:0,z:a}))}},{key:"drawFullTrajectory",value:function(e,t,r){console.log("to be implemented")}}])&&na(t.prototype,r),n&&na(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Yn(Fc)),TralisLayer:$c},ol:{Map:Ze,Layer:A,WMSLayer:vi,MapboxLayer:zt,TrajservLayer:po,TralisLayer:Wo,VectorLayer:ii}};t.default=fa}])}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("mobility-toolbox-js",[],t):"object"==typeof exports?exports["mobility-toolbox-js"]=t():e["mobility-toolbox-js"]=t()}(this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=27)}([function(e,t){e.exports=require("ol/style")},function(e,t){e.exports=require("ol/proj")},function(e,t){e.exports=require("ol/geom")},function(e,t){e.exports=require("ol/extent")},function(e,t){e.exports=require("ol/Observable")},function(e,t){e.exports=require("ol/Feature")},function(e,t){e.exports=require("ol/format/GeoJSON")},function(e,t){e.exports=require("query-string")},function(e,t){e.exports=require("ol/layer")},function(e,t){e.exports=require("ol/transform")},function(e,t){e.exports=require("ol/Object")},function(e,t){e.exports=require("ol/layer/Layer")},function(e,t){e.exports=require("mapbox-gl")},function(e,t){e.exports=require("ol/source/Source")},function(e,t){e.exports=require("ol/source")},function(e,t){e.exports=require("ol")},function(e,t){e.exports=require("ol/geom/GeometryType")},function(e,t){e.exports=require("ol/format")},function(e,t){e.exports=require("@turf/transform-rotate")},function(e,t){e.exports=require("@turf/helpers")},function(e,t){e.exports=require("ol/Map")},function(e,t){e.exports=require("ol/control")},function(e,t){e.exports=require("ol/layer/Group")},function(e,t){e.exports=require("uuid")},function(e,t){e.exports=require("ol/geom/Point")},function(e,t){e.exports=require("ol/interaction")},function(e,t){e.exports=require("ol/events/condition")},function(e,t,r){e.exports=r(28)},function(e,t,r){"use strict";r.r(t);var n=r(20),o=r.n(n),i=r(21),c=r(4),a=r.n(c),u=r(22),s=r.n(u),l=r(23);function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){h(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=j(e);if(t){var o=j(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return g(this,r)}}function g(e,t){if(t&&("object"===f(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return O(e)}function O(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function j(e){return(j=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var w=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}(i,e);var t,r,n,o=m(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};b(this,i),(e=o.call(this)).defineProperties(t);var r=t.onClick,n=t.onHover;return n&&e.onHover(n),r&&e.onClick(r),t.copyrights&&(e.copyrights=t.copyrights),e.onUserClickCallback=e.onUserClickCallback.bind(O(e)),e.onUserMoveCallback=e.onUserMoveCallback.bind(O(e)),e}return t=i,(r=[{key:"defineProperties",value:function(e){var t=this,r=y({isQueryable:!0,isClickActive:!0,isHoverActive:!0},e),n=r.name,o=r.key,i=r.children,c=r.visible,a=r.properties,u=r.isBaseLayer,s=r.isQueryable,f=r.isClickActive,p=r.isHoverActive,h=r.hitTolerance,b=Object(l.v4)(),v=n||b;Object.defineProperties(this,{options:{value:e},name:{value:v},key:{value:o||v.toLowerCase()},isBaseLayer:{value:!!u},isQueryable:{value:!!s},isClickActive:{value:!!s&&!!f},isHoverActive:{value:!!s&&!!p},hitTolerance:{value:h||5,writable:!0},isReactSpatialLayer:{value:!0},children:{value:i||[],writable:!0},copyrights:{get:function(){return t.get("copyrights")},set:function(e){var r=Array.isArray(e)?e:[e];t.set("copyrights",r)}},visible:{value:void 0===c||c,writable:!0},properties:{value:y({},a||{})},map:{writable:!0},clickCallbacks:{value:[]},hoverCallbacks:{value:[]}})}},{key:"init",value:function(e){this.terminate(),this.map=e}},{key:"terminate",value:function(){}},{key:"get",value:function(e){return this.properties[e]}},{key:"set",value:function(e,t){this.properties[e]=t,this.dispatchEvent({type:"change:".concat(e),target:this})}},{key:"setVisible",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e!==this.visible&&(this.visible=e,this.dispatchEvent({type:"change:visible",target:this,stopPropagationDown:t,stopPropagationUp:r,stopPropagationSiblings:n}))}},{key:"getVisibleChildren",value:function(){return this.children.filter((function(e){return e.visible}))}},{key:"hasVisibleChildren",value:function(){return!!this.hasChildren(!0)}},{key:"hasChildren",value:function(e){return!!this.children.find((function(t){return t.visible===e}))}},{key:"addChild",value:function(e){this.children.unshift(e),this.dispatchEvent({type:"change:children",target:this})}},{key:"removeChild",value:function(e){for(var t=0;t<this.children.length;t+=1)if(this.children[t].name===e){this.children.splice(t,1);break}this.dispatchEvent({type:"change:children",target:this})}},{key:"getFeatureInfoAtCoordinate",value:function(e,t){return console.error("getFeatureInfoAtCoordinate must be implemented by inheriting layers",this.key),Promise.resolve({layer:this,features:[],coordinate:e})}},{key:"onClick",value:function(e){if("function"!=typeof e)throw new Error("onClick callback must be of type function:",e);this.clickCallbacks.includes(e)||this.clickCallbacks.push(e)}},{key:"unClick",value:function(e){if("function"==typeof e){var t=this.clickCallbacks.indexOf(e);t>-1&&this.clickCallbacks.splice(t,1)}}},{key:"onUserClickCallback",value:function(e){var t=this,r={features:[],layer:this,coordinate:e.coordinate,event:e};return this.isClickActive&&this.clickCallbacks.length?this.getFeatureInfoAtCoordinate(e.coordinate).then((function(e){var r=e.features,n=e.layer,o=e.coordinate;return t.clickCallbacks.forEach((function(e){return e(r,n,o)})),e})).catch((function(){return r})):Promise.resolve(r)}},{key:"onHover",value:function(e){if("function"!=typeof e)throw new Error("callback must be of type function.");this.hoverCallbacks.includes(e)||this.hoverCallbacks.push(e)}},{key:"unHover",value:function(e){if("function"==typeof e){var t=this.hoverCallbacks.indexOf(e);t>-1&&this.hoverCallbacks.splice(t,1)}}},{key:"onUserMoveCallback",value:function(e){var t=this,r={features:[],layer:this,coordinate:e.coordinate,event:e};return this.isHoverActive&&this.hoverCallbacks.length?this.getFeatureInfoAtCoordinate(e.coordinate).then((function(e){var r=e.features,n=e.layer,o=e.coordinate;return t.hoverCallbacks.forEach((function(e){return e(r,n,o)})),e})).catch((function(){return r})):Promise.resolve(r)}}])&&v(t.prototype,r),n&&v(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(a.a);function P(e){return(P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function S(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?k(Object(r),!0).forEach((function(t){T(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function T(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function C(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function E(){return(E="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=x(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function x(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=I(e)););return e}function R(e,t){return(R=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=I(e);if(t){var o=I(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return D(this,r)}}function D(e,t){if(t&&("object"===P(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function I(e){return(I=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var A=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&R(e,t)}(i,e);var t,r,n,o=_(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).olLayer&&t.olLayer.setVisible(t.visible),t}return t=i,(r=[{key:"defineProperties",value:function(e){E(I(i.prototype),"defineProperties",this).call(this,e),Object.defineProperties(this,{olLayer:{value:e.olLayer,writable:!0},olListenersKeys:{value:[]}})}},{key:"init",value:function(e){var t=this;if(E(I(i.prototype),"init",this).call(this,e),this.map&&(this.olListenersKeys.push(this.map.getLayers().on("remove",(function(e){e.element===t.olLayer&&t.terminate()}))),(this.isClickActive||this.isHoverActive)&&(this.toggleVisibleListeners(),this.olListenersKeys.push(this.on("change:visible",this.toggleVisibleListeners))),this.copyrights&&this.olLayer)){var r=this.copyrights||[];this.olLayer instanceof s.a?this.olLayer.getLayers().getArray().forEach((function(e){e.getSource().setAttributions(r)})):this.olLayer.getSource&&this.olLayer.getSource().setAttributions(r)}}},{key:"terminate",value:function(){Object(c.unByKey)(this.olListenersKeys),E(I(i.prototype),"terminate",this).call(this)}},{key:"setVisible",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e!==this.visible&&(E(I(i.prototype),"setVisible",this).call(this,e,t,r,n),this.olLayer&&this.olLayer.setVisible(this.visible))}},{key:"toggleVisibleListeners",value:function(){var e=this;this.isClickListenerKey&&this.isHoverListenerKey&&[this.isClickListenerKey,this.isHoverListenerKey].forEach((function(t){var r=e.olListenersKeys.indexOf(t);r>-1&&e.olListenersKeys.splice(r,1),Object(c.unByKey)([e.isHoverListenerKey,e.isClickListenerKey])})),this.visible&&(this.isClickActive&&(this.isClickListenerKey=this.map.on("singleclick",this.onUserClickCallback)),this.isHoverActive&&(this.isHoverListenerKey=this.map.on("pointermove",this.onUserMoveCallback)),this.olListenersKeys.push(this.isClickListenerKey,this.isHoverListenerKey))}},{key:"clone",value:function(e){return new i(S(S({},this.options),e))}}])&&C(t.prototype,r),n&&C(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(w),M=r(10),L=r.n(M);function B(e){return(B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?V(Object(r),!0).forEach((function(t){U(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function U(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function q(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function N(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function H(e,t){return(H=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function K(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Z(e);if(t){var o=Z(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return z(this,r)}}function z(e,t){if(t&&("object"===B(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Z(e){return(Z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var G=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&H(e,t)}(i,e);var t,r,n,o=K(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};q(this,i),(e=o.call(this,t)).defineProperties(t);var r=F({active:!1!==t.active},t),n=r.active;return e.active=n,e}return t=i,(r=[{key:"defineProperties",value:function(e){var t=this,r=F({},e),n=r.target,o=r.element,i=r.render;Object.defineProperties(this,{active:{get:function(){return t.get("active")},set:function(e){t.set("active",e),e?t.activate():t.deactivate(),t.render()}},map:{get:function(){return t.get("map")},set:function(e){if(t.map&&t.element&&t.element.parentNode&&t.element.parentNode.removeChild(t.element),t.deactivate(),t.set("map",e),t.map){var r=t.target||t.map.getContainer();t.element||t.createDefaultElement(),t.element&&r.appendChild(t.element),t.active&&t.activate()}t.render()}},target:{value:n},element:{value:o,writable:!0},render:{value:i||this.render,writable:!0}})}},{key:"activate",value:function(){this.deactivate()}},{key:"deactivate",value:function(){}},{key:"render",value:function(){}},{key:"createDefaultElement",value:function(){}}])&&N(t.prototype,r),n&&N(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(L.a);function W(e){return(W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function J(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$(Object(r),!0).forEach((function(t){Q(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Q(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function X(){return(X="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Y(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Y(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=ne(e)););return e}function ee(e,t){return(ee=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function te(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ne(e);if(t){var o=ne(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return re(this,r)}}function re(e,t){if(t&&("object"===W(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ne(e){return(ne=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function oe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ie(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ce(e,t,r){return t&&ie(e.prototype,t),r&&ie(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var ae=function(e){return function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ee(e,t)}(r,e);var t=te(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return oe(this,r),(e=t.call(this,J(J({},n),{},{layers:[],controls:[]}))).mobilityLayers=[],e.mobilityControls=[],(n.controls||[]).forEach((function(t){e.addControl(t)})),(n.layers||[]).forEach((function(t){e.addLayer(t)})),e}return ce(r,[{key:"getMobilityLayers",value:function(){return this.mobilityLayers}},{key:"getMobilityControls",value:function(){return this.mobilityControls}},{key:"addMobilityControl",value:function(e){this.mobilityControls.push(e),e.map=this}},{key:"removeMobilityControl",value:function(e){e.map=null,this.mobilityControls=this.mobilityControls.filter((function(t){return t!==e}))}},{key:"addControl",value:function(e,t){e instanceof G?this.addMobilityControl(e):X(ne(r.prototype),"addControl",this).call(this,e,t)}},{key:"removeControl",value:function(e){e instanceof G?this.removeMobilityControl(e):X(ne(r.prototype),"removeControl",this).call(this,e)}}]),r}(e)},ue=r(11),se=r.n(ue);function le(e){return(le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function fe(e,t){return(fe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function pe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=he(e);if(t){var o=he(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ye(this,r)}}function ye(e,t){if(t&&("object"===le(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function he(e){return(he=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function be(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ve(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function de(e,t,r){return t&&ve(e.prototype,t),r&&ve(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var me=function(e){return function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fe(e,t)}(r,e);var t=pe(r);function r(){return be(this,r),t.apply(this,arguments)}return de(r,[{key:"render",value:function(){this.element&&(this.element.innerHTML=this.active?this.getCopyrights().join(" | "):"")}},{key:"createDefaultElement",value:function(){this.element=document.createElement("div"),this.element.id="mbt-copyright",Object.assign(this.element.style,{position:"absolute",bottom:0,right:0,fontSize:".8rem",padding:"0 10px"})}}]),r}(e)};function ge(e){return function(e){if(Array.isArray(e))return Oe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Oe(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Oe(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var je=function(e){var t=e.filter((function(e){return null!=e&&e.trim&&e.trim()})),r=t.map((function(e){return e.toLowerCase()}));return ge(new Set(r)).map((function(e){return t.find((function(t){return t.toLowerCase()===e}))}))};function we(e){return(we="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Pe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ke(){return(ke="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Se(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Se(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Re(e)););return e}function Te(e,t){return(Te=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ce(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Re(e);if(t){var o=Re(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ee(this,r)}}function Ee(e,t){if(t&&("object"===we(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return xe(e)}function xe(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Re(e){return(Re=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var _e=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Te(e,t)}(i,e);var t,r,n,o=Ce(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).onPostRender=t.onPostRender.bind(xe(t)),t}return t=i,(r=[{key:"getCopyrights",value:function(){var e=this;if(!this.frameState)return[];var t=[];return this.frameState.layerStatesArray.forEach((function(r){var n=r.layer;Object(ue.inView)(r,e.frameState.viewState)&&n&&n.getSource&&n.getSource()&&n.getSource().getAttributions()&&(t=t.concat(n.getSource().getAttributions()(e.frameState)))})),je(t)}},{key:"activate",value:function(){ke(Re(i.prototype),"activate",this).call(this),this.map&&this.map.on("postrender",this.onPostRender)}},{key:"deactivate",value:function(){this.map&&this.map.un("postrender",this.onPostRender),ke(Re(i.prototype),"deactivate",this).call(this)}},{key:"onPostRender",value:function(e){this.map&&this.element&&(this.frameState=e.frameState,this.render())}}])&&Pe(t.prototype,r),n&&Pe(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(me(G));function De(e){return(De="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ie(e){return function(e){if(Array.isArray(e))return Ae(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Ae(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ae(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ae(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Me(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Le(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Me(Object(r),!0).forEach((function(t){Be(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Me(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Be(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ve(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ue(){return(Ue="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=qe(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function qe(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=ze(e)););return e}function Ne(e,t){return(Ne=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function He(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ze(e);if(t){var o=ze(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ke(this,r)}}function Ke(e,t){if(t&&("object"===De(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ze(e){return(ze=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ze=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ne(e,t)}(c,e);var t,r,n,o=He(c);function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ve(this,c),o.call(this,Le({controls:[].concat(Ie(Object(i.defaults)({attribution:!1}).getArray()),[new _e])},e))}return t=c,(r=[{key:"getContainer",value:function(){return this.getTargetElement()}},{key:"addLayer",value:function(e){e instanceof A?(e.init(this),this.mobilityLayers.push(e),e.olLayer&&Ue(ze(c.prototype),"addLayer",this).call(this,e.olLayer),this.dispatchEvent({type:"change:mobilityLayers",target:this})):Ue(ze(c.prototype),"addLayer",this).call(this,e)}},{key:"removeLayer",value:function(e){e instanceof A?(e.terminate(),this.mobilityLayers=this.mobilityLayers.filter((function(t){return t!==e})),e.olLayer&&Ue(ze(c.prototype),"removeLayer",this).call(this,e)):Ue(ze(c.prototype),"removeLayer",this).call(this,e)}},{key:"addControl",value:function(e){Ue(ze(c.prototype),"addControl",this).call(this,e)}},{key:"removeControl",value:function(e){Ue(ze(c.prototype),"removeControl",this).call(this,e)}}])&&Fe(t.prototype,r),n&&Fe(t,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(ae(o.a)),Ge=r(1),We=r(12),$e=r.n(We),Je=r(13),Qe=r.n(Je),Xe=r(6),Ye=r.n(Xe),et=r(7),tt=r.n(et);function rt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function nt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rt(Object(r),!0).forEach((function(t){ot(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ot(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var it=function(e,t,r){if(!1===e)return r;var n=tt.a.parseUrl(r);return!e&&n.query[t]?r:e?tt.a.stringifyUrl(nt(nt({},n),{},{query:nt(nt({},n.query),{},ot({},t,e))})):(console.warn("No apiKey is defined for request to ".concat(r)),null)},ct=function(e){if(!e||!e.style)return[];var t=e.style.sourceCaches,r=[];return Object.values(t).forEach((function(e){if(e.used){var t=e.getSource(),n=t.attribution||t.options&&t.options.attribution;n&&(r=r.concat(n.replace(/©/g,"©").split(/(<a.*?<\/a>)/)))}})),je(r)},at={0:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],1:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],2:[0,0,0,0,0,2,2,3,7,7,7,12,15,15,15,15,15],3:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],4:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],5:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],6:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],7:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],8:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],9:[0,0,0,0,0,2,2,3,7,7,7,12,15,15,15,15,15]},ut=[/^Tram/i,/^Subway( \/ Metro \/ S-Bahn)?/i,/^Train/i,/^Bus/i,/^Ferry/i,/^Cable ?Car/i,/^Gondola/i,/^Funicular/i,/^(Long distance bus|coach)/i,/^Rail/i],st=["#ffb400","#ff5400","#ff8080","#ea0000","#3000ff","#ffb400","#41a27b","#00d237","#b5b5b5","#ff8080"],lt=["#000000","#ffffff","#000000","#ffffff","#ffffff","#000000","#ffffff","#000000","#000000","#000000"],ft=[1e5,5e4,4e4,3e4,2e4,15e3,1e4,5e3,2e3,1e3,400,300,250,180,90,60,50,50,50,50,50],pt=function(e){return"string"==typeof e?ut.findIndex((function(t){return t.test(e)})):e},yt=function(e,t){try{var r=pt(e||0);return at[r][t]}catch(e){return 1}},ht=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;try{var t=pt(e);return st[t]}catch(e){return 1}},bt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;try{var t=pt(e);return lt[t]}catch(e){return 1}},vt=function(e,t,r,n){e.font="bold ".concat(n,"px Arial");for(var o=e.measureText(r),i=0;o.width>t-6&&i<25;)n-=.5,e.font="bold ".concat(n,"px arial, sans-serif"),o=e.measureText(r),i+=1;return n},dt=function(e,t,r){return t?r?"#ff0000":"#a0a0a0":e>=36e5?"#ed004c":e>=5e5?"#e80000":e>=3e5?"#ff4a00":e>=18e4?"#f7bf00":null===e?"#a0a0a0":"#00a00c"},mt=function(e,t){if(t)return String.fromCodePoint(215);if(e>36e5){var r=Math.round(e/36e5);return"+".concat(r,"h")}if(e>59e3){var n=Math.round(e/6e4);return"+".concat(n,"m")}return e>0?"+".concat(e,"s"):""},gt=function(e,t){var r=document.createElement("canvas");return r.width=e,r.height=t,r},Ot={},jt={},wt={},Pt={},kt={},St=function(e,t,r){var n=r.hoverVehicleId,o=r.selectedVehicleId,i=r.useDelayStyle,c=r.delayOutlineColor,a=r.delayDisplay,u=t.zoom,s=t.pixelRatio,l=e.line,f=e.type,p=e.id,y=e.delay,h=e.cancelled,b=void 0!==h&&h,v=e.operator_provides_realtime_journey;f||(f="Rail"),l||(l={});var d=l,m=d.name,g=d.text_color,O=d.color;m||(m="I"),g||(g="#000000"),O&&"#"!==O[0]&&(O="#".concat(O)),"#"!==g[0]&&(g="#".concat(g));var j=Math.min(Math.floor(u||1),16),w=n===p,P=o===p,k=yt(f,j)*s,S=k>=7*s;(w||P)&&(k=S?k+5*s:14*s);var T=k>10*s,C="".concat(k).concat(f).concat(O).concat(w).concat(P).concat(b).concat(y);if(i&&(C+="".concat(v)),T&&(C+="".concat(m).concat(g)),!kt[C]){if(0===k)return kt[C]=null,null;var E,x=1*s,R=k+2,_=2*k,D=2*R+2*x+100*s,I=D/2,A=gt(D,D),M=A.getContext("2d");if(S&&null!==y){var L=function(e,t,r){var n="".concat(e,", ").concat(t,", ").concat(r);if(!Ot[n]){var o=gt(2*e,2*e),i=o.getContext("2d");i.beginPath(),i.arc(e,e,t,0,2*Math.PI,!1),i.fillStyle=r,i.filter="blur(1px)",i.fill(),Ot[n]=o}return Ot[n]}(I,R,dt(y,b));M.drawImage(L,0,0)}if(S&&(w||y>=a||b)){var B=Math.max(b?19:14,Math.min(b?19:17,1.2*k))*s,V=mt(y,b);if(V){var F=function(e,t,r,n,o,i,c){var a="".concat(e,", ").concat(t,", ").concat(n,", ").concat(o,", ").concat(i,", ").concat(c);if(!jt[a]){var u=gt(e,r+8*c),s=u.getContext("2d");s.textAlign="left",s.textBaseline="middle",s.font=n,s.fillStyle=o,s.strokeStyle=i,s.lineWidth=1.5*c;var l=t;s.strokeText(l,0,r),s.fillText(l,0,r),jt[a]=u}return jt[a]}(V.length*B,V,B,"bold ".concat(B,"px arial, sans-serif"),dt(y,b,!0),c,s);M.drawImage(F,I+R+x,I-B)}}var U=function(e,t,r,n,o,i){var c="".concat(e,", ").concat(t,", ").concat(r,", ").concat(n,", ").concat(o,", ").concat(i);if(!wt[c]){var a=gt(2*e,2*e),u=a.getContext("2d");u.fillStyle=r,n&&(u.lineWidth=1*i,u.strokeStyle="#000000"),u.beginPath(),u.arc(e,e,t,0,2*Math.PI,!1),u.fill(),o&&u.setLineDash([5,3]),n&&u.stroke(),wt[c]=a}return wt[c]}(I,k,E=i?dt(y,b):O||ht(f),S||w||P,S&&i&&null===y&&"yes"===v,s);if(M.drawImage(U,0,0),T){var q=Math.max(k,10),N=function(e,t,r,n,o,i,c){var a="".concat(e,", ").concat(t,", ").concat(r,", ").concat(n,",").concat(o,", ").concat(i,", ").concat(c);if(!Pt[a]){var u=gt(2*t,2*t),s=u.getContext("2d");i&&(s.save(),s.textBaseline="middle",s.textAlign="center",s.font="bold ".concat(r+2,"px Arial"),s.strokeStyle=o,s.strokeText(e,t,t),s.restore()),s.textBaseline="middle",s.textAlign="center",s.fillStyle=n,s.font="bold ".concat(r,"px Arial"),s.strokeStyle=o,s.strokeText(e,t,t),s.fillText(e,t,t),Pt[a]=u}return Pt[a]}(m,I,vt(M,_,m,q),i?"#000000":g||bt(f),E,i&&null===y&&"yes"===v,s);M.drawImage(N,0,0)}kt[C]=A}return kt[C]},Tt=document.createElement("canvas");Tt.width=15,Tt.height=15;var Ct=Tt.getContext("2d");Ct.arc(8,8,5,0,2*Math.PI,!1),Ct.fillStyle="#8ED6FF",Ct.fill(),Ct.lineWidth=3,Ct.strokeStyle="black",Ct.stroke(),Ct.lineWidth=3;var Et=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,t=(e.getUTCMonth()+1).toString();t=1===t.length?"0".concat(t):t;var r=e.getUTCDate().toString();return r=1===r.length?"0".concat(r):r,[e.getUTCFullYear(),t,r].join("")},xt=function(e){return[e.getUTCHours(),e.getUTCMinutes(),"".concat(e.getUTCSeconds(),".").concat(e.getUTCMilliseconds())].join(":")};function Rt(e){return(Rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],c=!0,a=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);c=!0);}catch(e){a=!0,o=e}finally{try{c||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Dt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Dt(e,t)}(e,t)||function(){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 Dt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function It(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function At(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?It(Object(r),!0).forEach((function(t){Mt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):It(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Mt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Lt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Vt(){return(Vt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Ft(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Ft(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Kt(e)););return e}function Ut(e,t){return(Ut=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function qt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Kt(e);if(t){var o=Kt(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Nt(this,r)}}function Nt(e,t){if(t&&("object"===Rt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ht(e)}function Ht(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Kt(e){return(Kt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var zt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ut(e,t)}(i,e);var t,r,n,o=qt(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Lt(this,i);var r=new se.a({source:new Qe.a({}),render:function(t){if(!e.mbMap)return console.warn("Mapbox map doesn't exist."),null;var r=!1,n=e.mbMap.getCanvas(),o=t.viewState,i=e.olLayer.getVisible();e.renderState.visible!==i&&(n.style.display=i?"block":"none",e.renderState.visible=i,n.style.position="absolute");var c=e.olLayer.getOpacity();e.renderState.opacity!==c&&(n.style.opacity=c,e.renderState.opacity=c);var a=o.rotation;e.renderState.rotation!==a&&(e.mbMap.rotateTo(180*-(a||0)/Math.PI,{animate:!1}),r=!0,e.renderState.rotation=a),e.renderState.zoom===o.zoom&&e.renderState.center[0]===o.center[0]&&e.renderState.center[1]===o.center[1]||(e.mbMap.jumpTo({center:Object(Ge.toLonLat)(o.center),zoom:o.zoom-1,animate:!1}),r=!0,e.renderState.zoom=o.zoom,e.renderState.center=o.center);var u=e.map.getSize();if(e.renderState.size[0]===u[0]&&e.renderState.size[1]===u[1]||(r=!0,e.renderState.size=u),e.mbMap&&e.mbMap.style&&e.mbMap.isStyleLoaded()&&r)try{e.mbMap._frame&&(e.mbMap._frame.cancel(),e.mbMap._frame=null),e.mbMap._render()}catch(e){console.warn(e)}return n}});return(e=o.call(this,At(At({},t),{},{olLayer:r}))).styleUrl=t.url,e.apiKey=t.apiKey,e.apiKeyName=t.apiKeyName||"key",e.updateAttribution=e.updateAttribution.bind(Ht(e)),e}return t=i,(r=[{key:"init",value:function(e){var t=this;Vt(Kt(i.prototype),"init",this).call(this,e),this.map&&!this.mbMap&&(this.format=new Ye.a({featureProjection:this.map.getView().getProjection()}),this.loadMbMap(),this.olListenersKeys.push(this.map.on("change:size",(function(){try{t.mbMap&&t.mbMap.resize()}catch(e){console.warn(e)}}))))}},{key:"createStyleUrl",value:function(){return it(this.apiKey,this.apiKeyName,this.styleUrl)}},{key:"loadMbMap",value:function(){var e=this;if(this.olListenersKeys.push(this.map.on("change:target",(function(){e.loadMbMap()}))),this.map.getTargetElement())if(this.visible){var t=_t(this.map.getView().getCenter(),2),r=t[0],n=t[1];r&&n||(r=0,n=0);var o=this.createStyleUrl();try{this.mbMap=new $e.a.Map({style:o,attributionControl:!1,boxZoom:!1,center:Object(Ge.toLonLat)([r,n]),container:this.map.getTargetElement(),interactive:!1,fadeDuration:"fadeDuration"in this.options?this.options.fadeDuration:300,preserveDrawingBuffer:this.options.preserveDrawingBuffer||!1})}catch(e){console.warn("Failed creating mapbox map: ",e)}this.renderState={center:[r,n],zoom:null,rotation:null,visible:null,opacity:null,size:[0,0]},this.mbMap.once("load",(function(){e.loaded=!0,e.copyrights=e.copyrights||ct(e.mbMap)||[],e.olLayer.getSource().setAttributions(e.copyrights),e.dispatchEvent({type:"load",target:e})}));var i=this.mbMap.getCanvas();i&&(this.options.tabIndex?i.setAttribute("tabindex",this.options.tabIndex):i.removeAttribute("tabindex")),this.mbMap.on("idle",this.updateAttribution)}else this.olListenersKeys.push(this.once("change:visible",(function(){e.loadMbMap()})))}},{key:"updateAttribution",value:function(e){var t=this.copyrights||ct(e.target)||[];this.copyrights.toString()!==t.toString()&&this.olLayer.getSource().setAttributions(t)}},{key:"getFeatureInfoAtCoordinate",value:function(e,t){var r=this;if(!(t&&this.format&&this.mbMap&&this.mbMap.isStyleLoaded()))return Promise.resolve({coordinate:e,features:[],layer:this});var n=e&&this.mbMap.project(Object(Ge.toLonLat)(e));if(this.hitTolerance){var o=n,i=o.x,c=o.y;n=[{x:i-this.hitTolerance,y:c-this.hitTolerance},{x:i+this.hitTolerance,y:c+this.hitTolerance}]}var a=this.mbMap.queryRenderedFeatures(n,t).map((function(e){var t=r.format.readFeature(e);return t&&t.set("mapboxFeature",e),t}));return Promise.resolve({layer:this,features:a,coordinate:e})}},{key:"terminate",value:function(){this.mbMap&&(this.mbMap.off("idle",this.updateAttribution),this.mbMap.triggerRepaint=function(){},this.mbMap.remove(),this.mbMap=null),this.loaded=!1,Vt(Kt(i.prototype),"terminate",this).call(this)}},{key:"clone",value:function(e){return new i(At(At({},this.options),e))}}])&&Bt(t.prototype,r),n&&Bt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(A);var Zt=r(0),Gt=r(14),Wt=r(8);var $t=new Zt.Circle({radius:6,fill:new Zt.Fill({color:[255,0,0,1]}),stroke:new Zt.Stroke({color:[0,0,0,1],width:1})}),Jt=(new Zt.Style({stroke:new Zt.Stroke({color:[0,0,0,1],width:5})}),new Zt.Style({image:$t,stroke:new Zt.Stroke({color:[255,0,0,1],width:3})}),new Zt.Style({image:$t,stroke:new Zt.Stroke({color:[255,0,0,1],width:3,lineDash:[1,10]})}),r(9)),Qt=r(3),Xt=r(5),Yt=r.n(Xt),er=r(16),tr=r.n(er);function rr(e){return function(e){if(Array.isArray(e))return ir(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||or(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],c=!0,a=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);c=!0);}catch(e){a=!0,o=e}finally{try{c||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||or(e,t)||function(){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 or(e,t){if(e){if("string"==typeof e)return ir(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ir(e,t):void 0}}function ir(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function cr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ar(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ur(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var sr=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?cr(Object(r),!0).forEach((function(t){ar(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({interpolate:!0},t);this.pixelRatio=t.pixelRatio||window.devicePixelRatio||1,this.trajectories=[],this.renderedTrajectories=[],this.interpolate=!!r.interpolate,this.hoverVehicleId=r.hoverVehicleId,this.selectedVehicleId=r.selectedVehicleId,this.filter=r.filter,this.sort=r.sort,this.style=r.style,this.canvas=r.canvas||document.createElement("canvas"),this.canvas.width=r.width*this.pixelRatio,this.canvas.height=r.height*this.pixelRatio,this.canvas.setAttribute("style",["position: absolute","top: 0","bottom: 0","width: ".concat(r.width,"px"),"height: ".concat(r.height,"px"),"pointer-events: none","visibility: visible","margin-top: inherit"].join(";")),this.canvasContext=this.canvas.getContext("2d")}var t,r,n;return t=e,(r=[{key:"setVisible",value:function(e){this.canvas&&(this.canvas.style.visibility=e?"visible":"hidden")}},{key:"setTrajectories",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.sort&&e.sort(this.sort),this.trajectories=e}},{key:"getTrajectories",value:function(){return this.trajectories||[]}},{key:"clear",value:function(){this.canvasContext&&this.canvasContext.clearRect(0,0,this.canvas.width,this.canvas.height)}},{key:"renderTrajectories",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=e.time,n=void 0===r?Date.now():r,o=e.size,i=void 0===o?[]:o,c=e.center,a=e.resolution,u=e.rotation,s=void 0===u?0:u,l=e.pixelRatio;this.clear();var f=nr(i,2),p=f[0],y=f[1];if(p&&y&&(this.canvas.width!==p||this.canvas.height!==y)){var h=[p*l,y*l];this.canvas.width=h[0],this.canvas.height=h[1]}var b,v,d,m,g,O,j,w,P=Object(Jt.compose)(Object(Jt.create)(),i[0]/2,i[1]/2,1/a,-1/a,-s,-c[0],-c[1]);this.canvas.style.width="".concat(this.canvas.width/l,"px"),this.canvas.style.height="".concat(this.canvas.height/l,"px"),this.currResolution=a||this.currResolution,this.renderedTrajectories=[];for(var k=(this.trajectories||[]).length-1;k>=0;k-=1){var S=this.trajectories[k];this.trajectories[k].rendered=!1;var T=S.geometry,C=S.timeIntervals,E=S.timeOffset;if(!this.filter||this.filter(S,k,this.trajectories)){var x=null,R=void 0;if(!S.coordinate||!t&&this.interpolate){if(C&&C.length>1){for(var _=n-(E||0),D=void 0,I=void 0,A=void 0,M=void 0,L=void 0,B=0;B<C.length-1;B+=1){var V=nr(C[B],3);D=V[0],A=V[1],R=V[2];var F=nr(C[B+1],2);if(I=F[0],M=F[1],D<=_&&_<=I)break;D=null,I=null}if(T.getType()===tr.a.POINT)x=T.getCoordinates();else if(T.getType()===tr.a.LINE_STRING){if(D&&I){L=this.interpolate?Math.min((_-D)/(I-D),1):0;var U=this.interpolate?L*(M-A)+A:0;x=T.getCoordinateAt(U),this.trajectories[k].rotation=R,this.trajectories[k].endFraction=L}else if(_<C[0][0]){var q=nr(C,1),N=nr(q[0],3);R=N[2],L=0,x=T.getFirstCoordinate()}else if(_>C[C.length-1][0]){var H=nr(C[C.length-1],3);R=H[2],L=1,x=T.getLastCoordinate()}}else console.error("This geometry type is not supported. Only Point or LineString are. Current geometry: ",T);this.trajectories[k].rotation=R,this.trajectories[k].endFraction=L||0}}else x=S.coordinate;if(x){this.trajectories[k].coordinate=x;var K=Object(Jt.apply)(P,rr(x));if(!K)continue;if((K=K.map((function(e){return e*l})))[0]<0||K[0]>this.canvas.width||K[1]<0||K[1]>this.canvas.height)continue;var z=this.style(S,e);if(!z)continue;this.trajectories[k].rendered=!0,this.renderedTrajectories.push(this.trajectories[k]);var Z=z.width,G=z.height;this.hoverVehicleId!==S.id&&this.selectedVehicleId!==S.id&&this.canvasContext.drawImage(z,K[0]-Z/2,K[1]-G/2,Z,G),this.hoverVehicleId===S.id&&(b=z,v=K,d=Z,m=G),this.selectedVehicleId===S.id&&(g=z,O=K,j=Z,w=G)}}}g&&this.canvasContext.drawImage(g,O[0]-j/2,O[1]-w/2,j,w),b&&this.canvasContext.drawImage(b,v[0]-d/2,v[1]-m/2,d,m)}},{key:"destroy",value:function(){this.renderedTrajectories=[],this.clear()}}])&&ur(t.prototype,r),n&&ur(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),lr=function(e,t,r,n){var o=[];if(!(e||t||r||n))return null;if(n){var i="string"==typeof n?[n]:n;o.push((function(e){var t=e.name||e.line&&e.line.name||"";return!!t&&i.some((function(e){return new RegExp(e,"i").test(t)}))}))}if(e){var c=("string"==typeof e?e.split(","):e).map((function(e){return e.replace(/\s+/g,"").toUpperCase()}));o.push((function(e){var t=(e.name||e.line&&e.line.name||"").toUpperCase();return!!t&&c.includes(t)}))}if(t){var a=("string"==typeof t?t.split(","):t).map((function(e){return parseInt(e,10)}));o.push((function(e){var t=parseInt(e.routeIdentifier.split(".")[0],10);return a.includes(t)}))}if(r){var u="string"==typeof r?[r]:r;o.push((function(e){return u.some((function(t){return new RegExp(t,"i").test(e.operator)}))}))}return o.length?function(e){for(var t=0;t<o.length;t+=1)if(!o[t](e))return!1;return!0}:null};function fr(e){return(fr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pr(e){return function(e){if(Array.isArray(e))return yr(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return yr(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yr(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function hr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function br(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?hr(Object(r),!0).forEach((function(t){vr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function vr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dr(){return(dr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=mr(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function mr(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Pr(e)););return e}function gr(e,t){return(gr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Or(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Pr(e);if(t){var o=Pr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return jr(this,r)}}function jr(e,t){if(t&&("object"===fr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return wr(e)}function wr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Pr(e){return(Pr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function kr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Tr(e,t,r){return t&&Sr(e.prototype,t),r&&Sr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var Cr=function(e){return function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gr(e,t)}(r,e);var t=Or(r);function r(e){var n;return kr(this,r),(n=t.call(this,br({hitTolerance:10},e))).onFeatureHover=n.onFeatureHover.bind(wr(n)),n.onFeatureClick=n.onFeatureClick.bind(wr(n)),n}return Tr(r,[{key:"defineProperties",value:function(e){var t=this,n=br({},e),o=n.style,i=n.speed,c=e.pixelRatio,a=e.interpolate,u=e.hoverVehicleId,s=e.selectedVehicleId,l=e.filter,f=e.sort,p=e.time,y=e.live,h=e.regexPublishedLineName,b=e.publishedLineName,v=e.tripNumber,d=e.operator,m={pixelRatio:c||window.devicePixelRatio||1,interpolate:a,hoverVehicleId:u,selectedVehicleId:s,filter:l,sort:f,style:o};Object.keys(m).forEach((function(e){return void 0===m[e]&&delete m[e]}));var g=i||1,O=p||new Date;dr(Pr(r.prototype),"defineProperties",this).call(this,e),Object.defineProperties(this,{isTrackerLayer:{value:!0},style:{value:o||this.defaultStyle},speed:{get:function(){return g},set:function(e){g=e,t.start()}},filter:{get:function(){return t.tracker?t.tracker.filter:t.initTrackerOptions.filter},set:function(e){t.tracker?t.tracker.filter=e:t.initTrackerOptions.filter=e}},sort:{get:function(){return t.tracker?t.tracker.sort:t.initTrackerOptions.sort},set:function(e){t.tracker?t.tracker.sort=e:t.initTrackerOptions.sort=e}},tracker:{value:null,writable:!0},styleCache:{value:{}},live:{value:!1!==y||y,writable:!0},time:{get:function(){return O},set:function(e){O=e&&e.getTime?e:new Date(e),t.renderTrajectories()}},trajectories:{get:function(){return t.tracker&&t.tracker.trajectories||[]}},renderedTrajectories:{get:function(){return t.tracker&&t.tracker.renderedTrajectories||[]}},hoverVehicleId:{get:function(){return t.tracker?t.tracker.hoverVehicleId:t.initTrackerOptions.hoverVehicleId},set:function(e){t.tracker?t.tracker.hoverVehicleId=e:t.initTrackerOptions.hoverVehicleId=e}},selectedVehicleId:{get:function(){return t.tracker?t.tracker.selectedVehicleId:t.initTrackerOptions.selectedVehicleId},set:function(e){t.tracker?t.tracker.selectedVehicleId=e:t.initTrackerOptions.selectedVehicleId=e}},pixelRatio:{get:function(){return t.tracker?t.tracker.pixelRatio:t.initTrackerOptions.pixelRatio},set:function(e){t.tracker?t.tracker.pixelRatio=e:t.initTrackerOptions.pixelRatio=e}},initTrackerOptions:{value:m,writable:!1},useRequestAnimationFrame:{default:!1,writable:!0},publishedLineName:{get:function(){return b},set:function(e){b=e,t.updateFilters()}},tripNumber:{get:function(){return v},set:function(e){v=e,t.updateFilters()}},operator:{get:function(){return d},set:function(e){d=e,t.updateFilters()}},regexPublishedLineName:{get:function(){return h},set:function(e){h=e,t.updateFilters()}},delayDisplay:{value:e.delayDisplay||3e5,writable:!0},delayOutlineColor:{value:e.delayOutlineColor||"#000000",writable:!0},useDelayStyle:{value:e.useDelayStyle||!1,writable:!0}}),this.useDelayStyle&&!this.sort&&(this.sort=function(e,t){return null===e.delay&&null!==t.delay?1:null===t.delay&&null!==e.delay?-1:e.cancelled&&!t.cancelled?t.delay<18e4?-1:1:t.cancelled&&!e.cancelled?e.delay<18e4?1:-1:t.delay-e.delay}),this.updateFilters()}},{key:"init",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};dr(Pr(r.prototype),"init",this).call(this,e),this.tracker=new sr(br(br({style:function(e,r){return t.style(e,r)}},this.initTrackerOptions),n)),this.visible&&this.start(),this.visibilityRef=this.on("change:visible",(function(e){e.target.visible?t.start():t.stop()}))}},{key:"terminate",value:function(){this.stop(),Object(c.unByKey)(this.visibilityRef),this.tracker&&(this.tracker.destroy(),this.tracker=null),dr(Pr(r.prototype),"terminate",this).call(this)}},{key:"start",value:function(){this.stop(),this.tracker.setVisible(!0),this.renderTrajectories(),this.startUpdateTime(),this.isClickActive&&this.onClick(this.onFeatureClick),this.isHoverActive&&this.onHover(this.onFeatureHover)}},{key:"startUpdateTime",value:function(){var e=this;this.stopUpdateTime(),this.updateTimeDelay=this.getRefreshTimeInMs(),this.updateTimeInterval=setInterval((function(){e.time=e.live?new Date:e.time.getTime()+e.updateTimeDelay*e.speed}),this.updateTimeDelay)}},{key:"stop",value:function(){this.stopUpdateTime(),this.tracker&&(this.tracker.setVisible(!1),this.tracker.clear())}},{key:"stopUpdateTime",value:function(){this.updateTimeInterval&&clearInterval(this.updateTimeInterval)}},{key:"renderTrajectoriesInternal",value:function(e,t){if(!this.tracker)return!1;var r=this.live?Date.now():this.time;return this.tracker.renderTrajectories(br(br({},e),{},{time:r}),t),!0}},{key:"renderTrajectories",value:function(e,t){var r=this;this.requestId&&cancelAnimationFrame(this.requestId),this.useRequestAnimationFrame?this.requestId=requestAnimationFrame((function(){r.renderTrajectoriesInternal(e,t)})):this.renderTrajectoriesInternal(e,t)}},{key:"getVehicle",value:function(e){return this.tracker.getTrajectories().filter(e)}},{key:"getVehiclesAtCoordinate",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,n=Object(Qt.buffer)([].concat(pr(e),pr(e)),this.hitTolerance*t),o=this.tracker.getTrajectories(),i=[],c=0;c<o.length&&(o[c].coordinate&&Object(Qt.containsCoordinate)(n,o[c].coordinate)&&i.push(o[c]),i.length!==r);c+=1);return i}},{key:"getFeatureInfoAtCoordinate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.resolution,n=t.nb,o=this.getVehiclesAtCoordinate(e,r,n);return Promise.resolve({layer:this,features:o.map((function(e){var t=new Yt.a({geometry:e.geometry});return t.setProperties(br({},e)),t})),coordinate:e})}},{key:"onZoomEnd",value:function(e){this.startUpdateTime()}},{key:"onFeatureClick",value:function(){}},{key:"onFeatureHover",value:function(){}},{key:"getRefreshTimeInMs",value:function(e){var t=Math.round(e),r=ft[t]||25;return Math.max(25,r/this.speed)}},{key:"updateFilters",value:function(){var e=tt.a.parse(window.location.search.toLowerCase()),t=this.publishedLineName||e.publishedlinename,r=this.tripNumber||e.tripnumber,n=this.operator||e.operator,o=this.regexPublishedLineName;(t||r||n||o)&&(this.filter=lr(t,r,n,o))}},{key:"defaultStyle",value:function(e,t){return St(e,t,this)}}]),r}(e)};function Er(e){return(Er="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Rr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xr(Object(r),!0).forEach((function(t){_r(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Dr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ir(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ar(){return(Ar="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Mr(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Mr(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Fr(e)););return e}function Lr(e,t){return(Lr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Br(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Fr(e);if(t){var o=Fr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Vr(this,r)}}function Vr(e,t){if(t&&("object"===Er(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Fr(e){return(Fr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ur=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Lr(e,t)}(i,e);var t,r,n,o=Br(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Dr(this,i),(e=o.call(this,Rr({},t))).renderWhenInteracting=t.renderWhenInteracting||function(){return e.tracker&&e.tracker.renderedTrajectories&&e.tracker.renderedTrajectories.length<=200},e.olLayer=t.olLayer||new Wt.Group({layers:[new Wt.Vector({source:new Gt.Vector({features:[]})}),new Wt.Layer({source:new Qe.a({}),render:function(t){if(!e.tracker||!e.tracker.canvas)return null;if(e.container||(e.container=document.createElement("div"),e.container.style.position="absolute",e.container.style.width="100%",e.container.style.height="100%",e.transformContainer=document.createElement("div"),e.transformContainer.style.position="absolute",e.transformContainer.style.width="100%",e.transformContainer.style.height="100%",e.container.appendChild(e.transformContainer),e.tracker.canvas.style.position="absolute",e.tracker.canvas.style.top="0",e.tracker.canvas.style.left="0",e.tracker.canvas.style.transformOrigin="top left",e.transformContainer.appendChild(e.tracker.canvas)),e.renderedViewState){var r=t.viewState,n=r.center,o=r.resolution,i=r.rotation,c=e.renderedViewState,a=c.center,u=c.resolution,s=c.rotation;if(e.renderWhenInteracting&&e.renderWhenInteracting(t.viewState,e.renderedViewState))e.renderTrajectories(!0);else if(u/o>=3)e.tracker.clear();else{var l=e.map.getPixelFromCoordinate(a),f=e.map.getPixelFromCoordinate(n);e.transformContainer.style.transform=Object(Jt.composeCssTransform)(l[0]-f[0],l[1]-f[1],u/o,u/o,i-s,0,0)}}return e.container}})]}),e.vectorLayer=e.olLayer.getLayers().item(0),e.renderState={center:[0,0],zoom:null,rotation:0},e}return t=i,(r=[{key:"init",value:function(e){var t=this;Ar(Fr(i.prototype),"init",this).call(this,e),this.map&&this.olListenersKeys.push(this.map.on("moveend",(function(e){var r=t.map.getView();if(!r.getAnimating()&&!r.getInteracting()){var n=r.getZoom();t.currentZoom!==n&&t.onZoomEnd(e),t.currentZoom=n,t.onMoveEnd(e)}})))}},{key:"terminate",value:function(){Ar(Fr(i.prototype),"terminate",this).call(this),this.container=null}},{key:"hasFeatureInfoAtCoordinate",value:function(e){if(this.map&&this.tracker&&this.tracker.canvas){var t=this.tracker.canvas.getContext("2d"),r=this.map.getPixelFromCoordinate(e);return!!t.getImageData(r[0]*this.pixelRatio,r[1]*this.pixelRatio,1,1).data[3]}return!1}},{key:"renderTrajectories",value:function(e){var t=this.map.getView();Ar(Fr(i.prototype),"renderTrajectories",this).call(this,{size:this.map.getSize(),center:this.map.getView().getCenter(),extent:t.calculateExtent(),resolution:t.getResolution(),rotation:t.getRotation(),zoom:t.getZoom(),pixelRatio:this.pixelRatio},e)}},{key:"renderTrajectoriesInternal",value:function(e,t){(this.renderWhenInteracting(e,this.renderedViewState)||!this.map.getView().getAnimating()&&!this.map.getView().getInteracting())&&Ar(Fr(i.prototype),"renderTrajectoriesInternal",this).call(this,e,t)&&(this.renderedViewState=Rr({},e),this.transformContainer&&(this.transformContainer.style.transform=""))}},{key:"getRefreshTimeInMs",value:function(){return Ar(Fr(i.prototype),"getRefreshTimeInMs",this).call(this,this.map.getView().getZoom())}},{key:"getVehiclesAtCoordinate",value:function(e,t){var r=this.map.getView().getResolution();return Ar(Fr(i.prototype),"getVehiclesAtCoordinate",this).call(this,e,r,t)}},{key:"getFeatureInfoAtCoordinate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.hasFeatureInfoAtCoordinate(e))return Promise.resolve({features:[],layer:this,coordinate:e});var r=this.map.getView().getResolution();return Ar(Fr(i.prototype),"getFeatureInfoAtCoordinate",this).call(this,e,Rr({resolution:r},t))}},{key:"onMoveEnd",value:function(e){}},{key:"onZoomEnd",value:function(e){Ar(Fr(i.prototype),"onZoomEnd",this).call(this,e)}},{key:"onFeatureHover",value:function(e,t,r){Ar(Fr(i.prototype),"onFeatureHover",this).call(this,e,t,r),this.map.getTargetElement().style.cursor=e.length?"pointer":"auto"}},{key:"onFeatureClick",value:function(e,t,r){Ar(Fr(i.prototype),"onFeatureClick",this).call(this,e,t,r),!e.length&&this.vectorLayer&&this.vectorLayer.getSource().clear()}},{key:"clone",value:function(e){return new i(Rr(Rr({},this.options),e))}}])&&Ir(t.prototype,r),n&&Ir(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Cr(A)),qr=r(2);function Nr(e){return(Nr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Hr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Kr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Hr(Object(r),!0).forEach((function(t){zr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function zr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Zr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Gr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Wr(e,t){return(Wr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function $r(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Qr(e);if(t){var o=Qr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Jr(this,r)}}function Jr(e,t){if(t&&("object"===Nr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Qr(e){return(Qr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Xr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Wr(e,t)}(i,e);var t,r,n,o=$r(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Zr(this,i),(e=o.call(this)).url=t.url,e.apiKey=t.apiKey,e}return t=i,(r=[{key:"fetch",value:function(e){function t(t,r,n){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e,t,r){var n=Kr(Kr({},t||{}),{},{key:this.apiKey}),o=Kr({},n);return Object.keys(n).forEach((function(e){return(void 0===o[e]||null===o[e])&&delete o[e]})),this.apiKey?fetch("".concat(this.url).concat(e||"","?").concat(tt.a.stringify(o)),r).then((function(e){try{return e.json().then((function(e){if(e.error)throw new Error(e.error);return e}))}catch(e){return Promise.reject(new Error(e))}})):Promise.reject(new Error("No apiKey defined for request to ".concat(this.url)))}))}])&&Gr(t.prototype,r),n&&Gr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(L.a);function Yr(e){return(Yr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function en(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function tn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?en(Object(r),!0).forEach((function(t){rn(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):en(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function rn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function on(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function cn(e,t){return(cn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function an(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=sn(e);if(t){var o=sn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return un(this,r)}}function un(e,t){if(t&&("object"===Yr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function sn(e){return(sn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ln=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cn(e,t)}(i,e);var t,r,n,o=an(i);function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return nn(this,i),o.call(this,tn({url:"https://api.geops.io/stops/v1/"},e))}return t=i,(r=[{key:"search",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("",e,{signal:t.signal}).then((function(e){return e.features}))}}])&&on(t.prototype,r),n&&on(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Xr);function fn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function pn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var yn=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],r=0;r<e.length;r+=1){var n=e[r],o=n.d,i=n.m,c=n.y;t.push({day:o,month:i,year:c})}return t},hn=function(e){var t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fn(Object(r),!0).forEach((function(t){pn(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e);["a","f","tt"].forEach((function(e){t[e]||(t[e]={})}));for(var r=t.id,n=t.hs,o=t.t,i=t.ln,c=t.sn,a=t.wa,u=t.ba,s=t.rt,l=t.fid,f=t.rid,p=t.c,y=t.tc,h=t.a,b=h.n,v=h.u,d=h.tz,m=t.f,g=m.n,O=m.u,j=m.tz,w=t.tt,P=w.n,k=w.p,S=w.t,T=t.sts,C=yn(P),E=yn(k),x=p&&"#".concat(p),R=y&&"#".concat(y),_=[],D=0;D<(T||[]).length;D+=1){var I=T[D],A=I.sid,M=I.n,L=I.p,B=I.at,V=I.dt,F=I.ap,U=I.dp,q=I.ad,N=I.dd,H=I.dot,K=I.put,z=I.c,Z=I.wa;_.push({stationId:A,stationName:M,coordinates:L,arrivalTime:-1!==B?1e3*F:null,departureTime:-1!==V?1e3*U:null,arrivalDelay:q,departureDelay:N,noDropOff:!!H,noPickUp:!!K,cancelled:!!z,wheelchairAccessible:!!Z})}return{id:r,destination:n,backgroundColor:x,color:R,vehicleType:o,routeIdentifier:f,longName:i,shortName:c,stations:_,wheelchairAccessible:!!a,bicyclesAllowed:!!u,realTime:s,feedsId:l,operatingInformations:{operatingPeriod:S,notOperatingDays:C,additionalOperatingDays:E},operator:b,operatorUrl:v,operatorTimeZone:d,publisher:g,publisherUrl:O,publisherTimeZone:j}},bn=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],r=0;r<e.length;r+=1){var n=e[r],o=new qr.LineString(n.geometry.coordinates),i=n.properties,c=i.ID,a=i.ProductIdentifier,u=i.PublishedLineName,s=i.RouteIdentifier,l=i.DirectionText,f=i.Operator,p=i.OperatorURL,y=i.Publisher,h=i.PublisherURL,b=i.License,v=i.LicenseUrl,d=i.LicenseNote,m=i.Color,g=i.JourneyIdentifier,O=i.RealtimeAvailable,j=i.OperatorProvidesRealtime,w=i.DayOfOperation,P=i.Delay,k=i.TimeIntervals,S=i.TextColor,T=i.Cancelled;t.push({id:c,type:a,name:u,routeIdentifier:s,directionText:l,operator:f,operatorUrl:p,publisher:y,publisherUrl:h,license:b,licenseUrl:v,licenseNote:d,journeyIdentifier:g,realtimeAvailable:O,operatorProvidesRealtime:j,dayOfOperation:w,delay:P,timeIntervals:k,color:m&&"#".concat(m),textColor:S&&"#".concat(S),geometry:o,cancelled:T})}return t};function vn(e){return(vn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function dn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function mn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?dn(Object(r),!0).forEach((function(t){gn(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function gn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function On(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function wn(e,t){return(wn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Pn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Sn(e);if(t){var o=Sn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return kn(this,r)}}function kn(e,t){if(t&&("object"===vn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Sn(e){return(Sn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Tn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&wn(e,t)}(i,e);var t,r,n,o=Pn(i);function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return On(this,i),o.call(this,mn({url:"https://api.geops.io/tracker/v1"},e))}return t=i,(r=[{key:"fetchTrajectoryById",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("/trajectorybyid",e,{signal:t.signal})}},{key:"fetchTrajectories",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("/trajectory_collection",e,{signal:t.signal}).then((function(e){return bn(e.features)}))}},{key:"fetchTrajectoryStations",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("/trajstations",e,{signal:t.signal}).then((function(e){return hn(e)}))}}])&&jn(t.prototype,r),n&&jn(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Xr);function Cn(e){return function(e){if(Array.isArray(e))return En(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return En(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return En(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function En(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function xn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Rn=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.defineProperties()}var t,r,n;return t=e,n=[{key:"getRequestString",value:function(e,t){var r="".concat(e," ").concat(t.channel);return r+=t.args?" ".concat(t.args):"",(r+=t.id?" ".concat(t.id):"").trim()}}],(r=[{key:"defineProperties",value:function(){var e=this;Object.defineProperties(this,{closed:{get:function(){return!(!e.websocket||e.websocket.readyState!==e.websocket.CLOSED)}},closing:{get:function(){return!(!e.websocket||e.websocket.readyState!==e.websocket.CLOSING)}},connecting:{get:function(){return!(!e.websocket||e.websocket.readyState!==e.websocket.CONNECTING)}},open:{get:function(){return!(!e.websocket||e.websocket.readyState!==e.websocket.OPEN)}},messagesOnOpen:{value:[],writable:!0},subscriptions:{value:[],writable:!0},subscribed:{value:{},writable:!0}})}},{key:"connect",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};this.websocket&&!this.closed&&this.websocket.close(),this.websocket=new WebSocket(e),this.open?(r(),this.subscribePreviousSubscriptions()):this.websocket.addEventListener("open",(function(){r(),t.subscribePreviousSubscriptions()}))}},{key:"close",value:function(){this.websocket&&(this.websocket.onclose=null,this.websocket.close(),this.websocket=null,this.messagesOnOpen=[])}},{key:"send",value:function(e){var t=this;if(this.websocket){var r=function(){t.websocket.send(e)};this.open?this.messagesOnOpen.includes(e)||r():this.messagesOnOpen.includes(e)||(this.messagesOnOpen.push(e),this.websocket.addEventListener("open",(function(){t.messagesOnOpen=[],r()})),this.websocket.addEventListener("close",(function(){t.messagesOnOpen=[]})))}}},{key:"listen",value:function(e,t,r){this.unlisten(e,t);var n=function(r){var n=JSON.parse(r.data),o=e.channel;o+=e.args?" ".concat(e.args):"",n.source!==o||e.id&&e.id!==n.client_reference||t(n)};return this.websocket&&(this.websocket.addEventListener("message",n),r&&(this.websocket.addEventListener("error",r),this.websocket.addEventListener("close",r))),{onMessageCb:n,onErrorCb:r}}},{key:"unlisten",value:function(e,t){var r=this;this.websocket&&this.subscriptions.filter((function(r){return r.params.channel===e.channel&&(!t||r.cb===t)})).forEach((function(e){var t=e.onMessageCb,n=e.onErrorCb;r.websocket&&(r.websocket.removeEventListener("message",t),n&&(r.websocket.removeEventListener("error",n),r.websocket.removeEventListener("close",n)))}))}},{key:"get",value:function(t,r,n){var o=e.getRequestString("GET",t);this.send(o),this.listen(t,r,n)}},{key:"subscribe",value:function(t,r,n){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=this.listen(t,r,n),c=i.onMessageCb,a=i.onErrorCb,u=e.getRequestString("",t),s=this.subscriptions.findIndex((function(e){return t.channel===e.params.channel&&r===e.cb})),l={params:t,cb:r,errorCb:n,onMessageCb:c,onErrorCb:a,quiet:o};s>-1?this.subscriptions[s]=l:this.subscriptions.push(l),this.subscribed[u]||(l.quiet||(this.send("GET ".concat(u)),this.send("SUB ".concat(u))),this.subscribed[u]=!0)}},{key:"unsubscribe",value:function(e,t){var r=this,n=this.subscriptions.filter((function(r){return r.params.channel===e&&(!t||r.cb===t)}));n.forEach((function(e){var t=e.onMessageCb,n=e.onErrorCb;r.websocket&&(r.websocket.removeEventListener("message",t),n&&(r.websocket.removeEventListener("error",n),r.websocket.removeEventListener("close",n)))})),this.subscriptions=this.subscriptions.filter((function(r){return r.params.channel!==e||t&&r.cb!==t})),e&&this.subscribed[e]&&!this.subscriptions.find((function(t){return t.params.channel===e}))&&n.find((function(e){return!e.quiet}))&&(this.send("DEL ".concat(e)),this.subscribed[e]=!1)}},{key:"subscribePreviousSubscriptions",value:function(){var e=this;Object.keys(this.subscribed).forEach((function(t){e.subscribed[t]=!1})),Cn(this.subscriptions).forEach((function(t){e.subscribe(t.params,t.cb,t.errorCb,t.quiet)}))}}])&&xn(t.prototype,r),n&&xn(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),_n=function(e,t){return e===t.SCHEMATIC?"_schematic":""},Dn=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=["HIDDEN","LEAVING","BOARDING"],o=e.has_fzo&&n.indexOf(e.state)>-1,i=t.has_fzo&&n.indexOf(t.state)>-1;if(o||i){if(o!==i)return o?-1:1;if(e.state!==t.state)return n.indexOf(e.state)-n.indexOf(t.state)}var c=null,a=null,u=Date.now();return r?(c=new Date(e.min_arrival_time||e.time).getTime()-u,a=new Date(t.min_arrival_time||t.time).getTime()-u):(c=new Date(e.time).getTime()-u,a=new Date(t.time).getTime()-u),c-a},In=function(e){if(e)return e.stations.forEach((function(e){e.arrivalTimeWithDelay=e.arrivalTime,e.departureTime&&(e.departureTimeWithDelay=e.departureTime),e.arrivalDelay&&(e.arrivalTime-=e.arrivalDelay,e.departureTime&&(e.departureTime-=e.arrivalDelay))})),e};function An(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Ln={RAW:"raw",TOPOGRAPHIC:"topographic",SCHEMATIC:"schematic"},Bn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};An(this,e),this.defineProperties(t),this.subscribedStationUic=null,this.departureUpdateTimeout=null,this.maxDepartureAge=30,this.extraGeoms={},this.prefix=t.prefix||"",this.onOpen=this.onOpen.bind(this)}var t,r,n;return t=e,(r=[{key:"defineProperties",value:function(e){var t=this,r=e;"string"==typeof e&&(r={url:e});var n=r.apiKey,o=r,i=o.url,c=o.projection,a=o.bbox,u=new Rn;n&&(i="".concat(i||"wss://tralis-tracker-api.geops.io/ws","?key=").concat(n)),Object.defineProperties(this,{url:{get:function(){return i},set:function(e){i=e,t.open()}},projection:{get:function(){return c},set:function(e){e!==c&&(c=e,t.conn&&t.conn.send("PROJECTION ".concat(c)))}},bbox:{get:function(){return a},set:function(e){JSON.stringify(e)!==JSON.stringify(a)&&(a=e,t.conn&&t.conn.send("BBOX ".concat(a.join(" "))))}},conn:{value:u,writable:!0},pingIntervalMs:{value:e.pingIntervalMs||1e4,writable:!0},reconnectTimeoutMs:{value:e.pingIntervalMs||100,writable:!0}})}},{key:"open",value:function(){var e=this;this.close(),this.conn.connect(this.url,this.onOpen),this.conn.websocket.onclose=function(){e.onClose()}}},{key:"close",value:function(){this.conn.close()}},{key:"reset",value:function(){this.conn.send("RESET")}},{key:"onOpen",value:function(){var e=this;this.projection&&this.conn.send("PROJECTION ".concat(this.projection)),this.bbox&&this.conn.send("BBOX ".concat(this.bbox.join(" "))),this.pingIntervalMs&&(window.clearInterval(this.pingInterval),this.pingInterval=setInterval((function(){e.conn.send("PING")}),this.pingIntervalMs))}},{key:"onClose",value:function(){var e=this;window.clearTimeout(this.pingInterval),window.clearTimeout(this.reconnectTimeout),this.reconnectTimeoutMs&&(this.reconnectTimeout=window.setTimeout((function(){return e.open()}),this.reconnectTimeoutMs))}},{key:"subscribe",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.conn.subscribe({channel:e},t,r,n)}},{key:"unsubscribe",value:function(e,t,r){this.conn.unsubscribe("".concat(e).concat(_n(Ln.SCHEMATIC,Ln)).concat(t),r),this.conn.unsubscribe("".concat(e).concat(_n(Ln.TOPOGRAPHIC,Ln)).concat(t||""),r)}},{key:"filterDepartures",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=Object.keys(e).map((function(t){return e[t]}));r.sort((function(e,r){return Dn(e,r,t)}));var n=new Date;n.setMinutes(n.getMinutes()+this.maxDepartureAge),n=n.getTime();var o=new Date;o.setMinutes(o.getMinutes()-this.maxDepartureAge),o=o.getTime();for(var i=[],c=[],a=null,u=r.length-1;u>=0;u-=1){var s=r[u],l=new Date(s.time).getTime();l>o&&l<n&&("BOARDING"===s.state&&(-1===c.indexOf(s.platform)?c.push(s.platform):s.state="HIDDEN"),a&&s.to[0]===a.to[0]&&Math.abs(l-a.time)<1e3&&s.line.name===a.line.name&&(s.state="HIDDEN"),/(STOP_CANCELLED|JOURNEY_CANCELLED)/.test(s.state)&&(s.cancelled=!0),(a=s).time=l,i.unshift(s))}return i}},{key:"subscribeDepartures",value:function(e,t,r){var n=this;window.clearTimeout(this.departureUpdateTimeout),this.unsubscribeDepartures(),this.subscribedStationUic=e;var o=e?"timetable_".concat(e):null,i={};this.subscribe(o,(function(e){if(e.source===o){var c=e.content||{},a=new Date(c.timestamp).getTime()-Date.now();c.timediff=a,i[c.call_id]=c,window.clearTimeout(n.departureUpdateTimeout),n.departureUpdateTimeout=window.setTimeout((function(){var e=n.filterDepartures(i,t||!1);r(e)}),100)}}),(function(){r([])}))}},{key:"unsubscribeDepartures",value:function(e){this.subscribedStationUic&&(this.unsubscribe("timetable_".concat(this.subscribedStationUic),"",e),this.subscribedStationUic=null)}},{key:"subscribeDisruptions",value:function(e){this.subscribe("".concat(this.prefix,"newsticker"),(function(t){e(t.content)}))}},{key:"unsubscribeDisruptions",value:function(e){this.unsubscribe("".concat(this.prefix,"newsticker"),"",e)}},{key:"getStation",value:function(e,t){var r=this,n={channel:"station".concat(_n(t,Ln)),args:e};return new Promise((function(e,t){r.conn.get(n,(function(r){r.content?e(r.content):t()}))}))}},{key:"getStations",value:function(e){var t=this,r=[],n={channel:"station".concat(_n(e,Ln))};return window.clearTimeout(this.stationUpdateTimeout),new Promise((function(e,o){t.conn.get(n,(function(n){n.content?(r.push(n.content),window.clearTimeout(t.stationUpdateTimeout),t.stationUpdateTimeout=window.setTimeout((function(){e(r)}),50)):o(n.content)}))}))}},{key:"subscribeStations",value:function(e,t){this.unsubscribeStations(),this.subscribe("station".concat(_n(e,Ln)),(function(e){e.content&&t(e.content)}))}},{key:"unsubscribeStations",value:function(e){window.clearTimeout(this.stationUpdateTimeout),this.unsubscribe("station","",e)}},{key:"subscribeExtraGeoms",value:function(e){var t=this;this.subscribe("extra_geoms",(function(r){var n=r.content;if(n){var o=n.properties.ref;"Feature"===n.type?t.extraGeoms[o]=n:delete t.extraGeoms[o],e(Object.keys(t.extraGeoms).map((function(e){return t.extraGeoms[e]})))}}))}},{key:"unsubscribeExtraGeoms",value:function(e){this.unsubscribe("extra_geoms","",e)}},{key:"subscribeTrajectory",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.unsubscribeTrajectory(t),this.subscribe("trajectory".concat(_n(e,Ln)),t,null,r)}},{key:"unsubscribeTrajectory",value:function(e){this.unsubscribe("trajectory","",e)}},{key:"subscribeDeletedVehicles",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.unsubscribeDeletedVehicles(t),this.subscribe("deleted_vehicles".concat(_n(e,Ln)),t,null,r)}},{key:"unsubscribeDeletedVehicles",value:function(e){this.unsubscribe("deleted_vehicles","",e)}},{key:"getFullTrajectory",value:function(e,t,r){var n=this,o=["full_trajectory".concat(_n(t,Ln))];e&&o.push(e),t&&t!==Ln.TOPOGRAPHIC||!r||o.push("gen".concat(r));var i={channel:o.join("_")};return new Promise((function(e){n.conn.get(i,(function(t){t.content&&e(t.content)}))}))}},{key:"getFullTrajectories",value:function(e,t,r){var n=this,o=e.map((function(e){return n.getFullTrajectory(e,t,r)}));return Promise.all(o)}},{key:"subscribeFullTrajectory",value:function(e,t){this.unsubscribeFullTrajectory(e),this.subscribe("full_trajectory".concat(_n(t,Ln),"_").concat(e),(function(e){console.log("subscribe full_trajectory",e)}),(function(e){console.log("subscribe full_trajectory error",e)}))}},{key:"unsubscribeFullTrajectory",value:function(e,t){this.unsubscribe("full_trajectory","_".concat(e),t)}},{key:"getStopSequence",value:function(e){var t=this,r={channel:"stopsequence_".concat(e)};return new Promise((function(e,n){t.conn.get(r,(function(t){if(t.content&&t.content.length){var r=t.content.map((function(e){return In(e)}));e(r)}e([])}),(function(e){n(e)}))}))}},{key:"getStopSequences",value:function(e){var t=this,r=e.map((function(e){return t.getStopSequence(e)}));return Promise.all(r)}},{key:"subscribeStopSequence",value:function(e,t){window.clearTimeout(this.fullTrajectoryUpdateTimeout),this.unsubscribeStopSequence(e),this.subscribe("stopsequence_".concat(e),(function(e){if(e.content&&e.content.length){var r=e.content.map((function(e){return In(e)}));t(r)}}),(function(e){console.log("subscribe stopsequence error",e)}))}},{key:"unsubscribeStopSequence",value:function(e,t){this.unsubscribe("stopsequence","_".concat(e),t)}},{key:"subscribeHealthCheck",value:function(e){this.unsubscribeHealthCheck(),this.subscribe("healthcheck",e)}},{key:"unsubscribeHealthCheck",value:function(){this.unsubscribe("healthcheck")}}])&&Mn(t.prototype,r),n&&Mn(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Vn(e){return(Vn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Fn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Un(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Fn(Object(r),!0).forEach((function(t){qn(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function qn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Nn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],c=!0,a=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);c=!0);}catch(e){a=!0,o=e}finally{try{c||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Hn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Hn(e,t)}(e,t)||function(){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 Hn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Kn(){return(Kn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=zn(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function zn(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=$n(e)););return e}function Zn(e,t){return(Zn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Gn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=$n(e);if(t){var o=$n(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Wn(this,r)}}function Wn(e,t){if(t&&("object"===Vn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function $n(e){return($n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Jn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Xn(e,t,r){return t&&Qn(e.prototype,t),r&&Qn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var Yn=function(e){return function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zn(e,t)}(r,e);var t=Gn(r);function r(){return Jn(this,r),t.apply(this,arguments)}return Xn(r,[{key:"defineProperties",value:function(e){var t=this;Kn($n(r.prototype),"defineProperties",this).call(this,e);var n,o=3;if(!e.api){var i={};e.url&&(i.url=e.url),e.apiKey&&(i.apiKey=e.apiKey),n=new Tn(i)}Object.defineProperties(this,{requestIntervalSeconds:{get:function(){return o},set:function(e){e!==o&&(o=e,t.visible&&t.start())}},api:{value:e.api||n}})}},{key:"init",value:function(e){Kn($n(r.prototype),"init",this).call(this,e),this.sortFc?this.sort=this.sortFc:this.useDelayStyle&&(this.sort=function(e,t){return null===e.delay||e.delay<t.delay?1:-1})}},{key:"start",value:function(){this.updateFilters(),Kn($n(r.prototype),"start",this).call(this),this.startUpdateTrajectories()}},{key:"stop",value:function(){this.stopUpdateTrajectories(),this.abortFetchTrajectories(),Kn($n(r.prototype),"stop",this).call(this)}},{key:"onFeatureHover",value:function(e,t,n){var o=Nn(e,1)[0],i=null;o&&(i=o.get("id")),this.hoverVehicleId!==i&&(this.hoverVehicleId=i,this.renderTrajectories()),Kn($n(r.prototype),"onFeatureHover",this).call(this,e,t,n)}},{key:"onFeatureClick",value:function(e,t,n){var o=Nn(e,1)[0];o?(this.selectedVehicleId=o.get("id"),this.journeyId=o.get("journeyIdentifier"),this.highlightTrajectory()):(this.selectedVehicleId=null,this.journeyId=null),Kn($n(r.prototype),"onFeatureClick",this).call(this,e,t,n)}},{key:"highlightTrajectory",value:function(){var e=this,t=this.selectedVehicleId,r=this.journeyId,n=[this.api.fetchTrajectoryStations(this.getParams({id:t,time:xt(new Date)})),this.api.fetchTrajectoryById(this.getParams({id:r,time:xt(new Date)}))];Promise.all(n).then((function(t){var r=Nn(t,2),n=r[0],o=r[1],i=[];if(n&&n.stations.forEach((function(e){i.push(e.coordinates)})),o){var c=o.p,a=o.t,u=o.c,s=[];c.forEach((function(e){e.forEach((function(e){s.push([e.x,e.y])}))}));var l=u?"#".concat(u):ht(a),f=/#ffffff/i.test(l)?"#ff0000":l;e.drawFullTrajectory(i,s,e.useDelayStyle?"#a0a0a0":f)}})).catch((function(){e.drawFullTrajectory()}))}},{key:"abortFetchTrajectories",value:function(){this.abortController&&this.abortController.abort()}},{key:"getParams",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=1e3*(this.requestIntervalSeconds+5),r=this.speed*t,n=this.time,o=!0;if(this.later&&n.getTime()>this.later.getTime()-1e3*this.requestIntervalSeconds&&(o=!1),!this.later||!o||this.later.getTime()-n.getTime()>r){var i=new Date(n.getTime()+r);this.later=i}var c=Un(Un({},e),{},{btime:xt(n),etime:xt(this.later),date:Et(n),rid:1,a:1,cd:1,nm:1,fl:1});return c}},{key:"startUpdateTrajectories",value:function(){var e=this;this.stopUpdateTrajectories(),this.updateTrajectories(),this.updateInterval=window.setInterval((function(){e.updateTrajectories()}),1e3*this.requestIntervalSeconds)}},{key:"stopUpdateTrajectories",value:function(){clearInterval(this.updateInterval)}},{key:"updateTrajectories",value:function(){var e=this;this.abortFetchTrajectories(),this.abortController=new AbortController,this.api.fetchTrajectories(this.getParams({attr_det:1}),this.abortController).catch((function(e){if("AbortError"!==e.name)throw e})).then((function(t){t&&(e.tracker.setTrajectories(t),e.renderTrajectories())}))}},{key:"drawFullTrajectory",value:function(e,t,r){}},{key:"defaultStyle",value:function(e,t){var r=t.zoom,n=e.type,o=e.name,i=e.id,c=e.color,a=e.textColor,u=e.delay,s=e.cancelled,l=e.operatorProvidesRealtime,f=Math.min(Math.floor(r||1),16),p=this.hoverVehicleId===i,y=this.selectedVehicleId===i,h="".concat(f).concat(n).concat(o).concat(l).concat(u).concat(p).concat(y).concat(s),b=yt(n,f)*this.pixelRatio,v=b>=7*this.pixelRatio;(p||y)&&(b=v?b+5*this.pixelRatio:14*this.pixelRatio);var d=b>10*this.pixelRatio;if(d||(h="".concat(f).concat(n).concat(c).concat(l).concat(u).concat(p).concat(y).concat(s)),!this.styleCache[h]){if(0===b)return this.styleCache[h]=null,null;var m=1*this.pixelRatio,g=b+2,O=2*b,j=document.createElement("canvas");j.width=2*g+2*m+100*this.pixelRatio,j.height=2*g+2*m+100*this.pixelRatio;var w,P=j.getContext("2d"),k=j.width/2;if(v&&null!==u&&(P.save(),P.beginPath(),P.arc(k,k,g,0,2*Math.PI,!1),P.fillStyle=dt(u,s),P.filter="blur(1px)",P.fill(),P.restore()),v&&(p||u>=this.delayDisplay||s)){P.save(),P.textAlign="left",P.textBaseline="middle",P.font="bold ".concat(Math.max(s?19:14,Math.min(s?19:17,1.2*b)),"px arial, sans-serif"),P.fillStyle=dt(u,s,!0),P.strokeStyle=this.delayOutlineColor,P.lineWidth=1.5*this.pixelRatio;var S=mt(u,s);P.strokeText(S,k+g+m,k),P.fillText(S,k+g+m,k),P.restore()}if(w=this.useDelayStyle?dt(u,s):c||ht(n),P.save(),(v||p||y)&&(P.lineWidth=1*this.pixelRatio,P.strokeStyle="#000000"),P.fillStyle=w,P.beginPath(),P.arc(k,k,b,0,2*Math.PI,!1),P.fill(),v&&this.useDelayStyle&&null===u&&"yes"===l&&P.setLineDash([5,3]),(v||p||y)&&P.stroke(),P.restore(),d){var T=Math.max(b,10*this.pixelRatio),C=vt(P,O,o,T);this.useDelayStyle&&null===u&&"yes"===l&&(P.save(),P.textBaseline="middle",P.textAlign="center",P.font="bold ".concat(C+2,"px Arial"),P.strokeStyle=w,P.strokeText(o,k,k),P.restore()),P.save(),P.textBaseline="middle",P.textAlign="center",P.fillStyle=this.useDelayStyle?"#000000":a||bt(n),P.font="bold ".concat(C,"px Arial"),P.strokeStyle=w,P.strokeText(o,k,k),P.fillText(o,k,k),P.restore()}this.styleCache[h]=j}return this.styleCache[h]}}]),r}(e)};function eo(e){return(eo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function to(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ro(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?to(Object(r),!0).forEach((function(t){no(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):to(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function no(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function io(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function co(){return(co="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=ao(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function ao(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=fo(e)););return e}function uo(e,t){return(uo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function so(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=fo(e);if(t){var o=fo(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return lo(this,r)}}function lo(e,t){if(t&&("object"===eo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function fo(e){return(fo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var po=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&uo(e,t)}(i,e);var t,r,n,o=so(i);function i(){return oo(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"start",value:function(){var e=this;this.map&&(co(fo(i.prototype),"start",this).call(this),this.olEventsKeys=[this.map.on("movestart",(function(){e.abortFetchTrajectories()})),this.map.on("moveend",this.onMoveEnd.bind(this))])}},{key:"stop",value:function(){Object(c.unByKey)(this.olEventsKeys),co(fo(i.prototype),"stop",this).call(this)}},{key:"onMoveEnd",value:function(){var e=this.map.getView().getZoom();e!==this.currentZoom&&(this.currentZoom=e,this.requestIntervalSeconds=200/e||1e3),this.abortFetchTrajectories(),this.map.getView().getAnimating()||this.map.getView().getInteracting()||this.updateTrajectories(),this.selectedVehicleId&&this.journeyId&&this.highlightTrajectory()}},{key:"drawFullTrajectory",value:function(e,t,r){var n=this.vectorLayer.getSource();if(n.clear(),e){var o=new qr.MultiPoint(e.map((function(e){return Object(Ge.fromLonLat)(e)}))),i=new Yt.a(o);i.setStyle(new Zt.Style({zIndex:1,image:new Zt.Circle({radius:5,fill:new Zt.Fill({color:"#000000"})})}));var c=new Yt.a(o);c.setStyle(new Zt.Style({zIndex:4,image:new Zt.Circle({radius:4,fill:new Zt.Fill({color:r})})})),n.addFeatures([i,c])}if(t){var a=new Yt.a({geometry:new qr.LineString(t)});a.setStyle([new Zt.Style({zIndex:2,stroke:new Zt.Stroke({color:"#000000",width:6})}),new Zt.Style({zIndex:3,stroke:new Zt.Stroke({color:r,width:4})})]),n.addFeature(a)}}},{key:"getParams",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.map.getView().calculateExtent(),r=Object(Qt.buffer)(t,Object(Qt.getWidth)(t)/10).join(","),n=this.map.getView().getZoom();return co(fo(i.prototype),"getParams",this).call(this,ro(ro({},e),{},{bbox:r,s:n<10?1:0,z:n}))}},{key:"clone",value:function(e){return new i(ro(ro({},this.options),e))}}])&&io(t.prototype,r),n&&io(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Yn(Ur)),yo=r(24),ho=r.n(yo);function bo(e){return(bo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function vo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],c=!0,a=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);c=!0);}catch(e){a=!0,o=e}finally{try{c||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||go(e,t)||function(){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 mo(e){return function(e){if(Array.isArray(e))return Oo(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||go(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function go(e,t){if(e){if("string"==typeof e)return Oo(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Oo(e,t):void 0}}function Oo(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function jo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function wo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?jo(Object(r),!0).forEach((function(t){Po(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jo(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Po(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ko(){return(ko="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=So(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function So(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Ro(e)););return e}function To(e,t){return(To=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Co(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Ro(e);if(t){var o=Ro(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Eo(this,r)}}function Eo(e,t){if(t&&("object"===bo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return xo(e)}function xo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ro(e){return(Ro=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Do(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Io(e,t,r){return t&&Do(e.prototype,t),r&&Do(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var Ao=function(e){return function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&To(e,t)}(r,e);var t=Co(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return _o(this,r),(e=t.call(this,wo({},n))).debug=n.debug,e.mode=n.mode||Ln.TOPOGRAPHIC,e.api=n.api||new Bn(n),e.tenant=n.tenant||"",e.minZoomNonTrain=n.minZoomNonTrain||9,e.format=new Ye.a,e.generalizationLevelByZoom=n.generalizationLevelByZoom||{0:5,1:5,2:5,3:5,4:5,5:5,6:5,7:5,8:10,9:30,10:30,11:100,12:100,13:100},e.isUpdateBboxOnMoveEnd=!1!==n.isUpdateBboxOnMoveEnd,e.onTrajectoryMessage=e.onTrajectoryMessage.bind(xo(e)),e.onDeleteTrajectoryMessage=e.onDeleteTrajectoryMessage.bind(xo(e)),e}return Io(r,[{key:"start",value:function(){ko(Ro(r.prototype),"start",this).call(this),this.api.open(),this.api.subscribeTrajectory(this.mode,this.onTrajectoryMessage,this.isUpdateBboxOnMoveEnd),this.api.subscribeDeletedVehicles(this.mode,this.onDeleteTrajectoryMessage,this.isUpdateBboxOnMoveEnd),this.isUpdateBboxOnMoveEnd&&this.setBbox()}},{key:"stop",value:function(){ko(Ro(r.prototype),"stop",this).call(this),this.api.unsubscribeTrajectory(this.onTrajectoryMessage),this.api.unsubscribeDeletedVehicles(this.onDeleteTrajectoryMessage),this.api.close()}},{key:"setBbox",value:function(e,t){for(var r=this.trajectories.length-1;r>=0;r-=1){var n=this.trajectories[r];if(this.mustNotBeDisplayed(n,e,t)){var o=mo(this.trajectories);o.splice(r,1),this.tracker.setTrajectories(o)}}var i=mo(e);this.isUpdateBboxOnMoveEnd&&(i.push(t),this.tenant&&i.push("tenant=".concat(this.tenant)),this.generalizationLevel=this.generalizationLevelByZoom[t],this.generalizationLevel&&i.push("gen=".concat(this.generalizationLevel))),this.api.bbox=i}},{key:"setMode",value:function(e){this.mode!==e&&(this.mode=e,this.api.subscribeTrajectory(this.mode,this.onTrajectoryMessage,this.isUpdateBboxOnMoveEnd),this.api.subscribeDeletedVehicles(this.mode,this.onDeleteTrajectoryMessage,this.isUpdateBboxOnMoveEnd))}},{key:"getTrajectoryInfos",value:function(e){var t=[this.api.getStopSequence(e,this.mode),this.api.getFullTrajectory(e,this.mode,this.generalizationLevel)];return Promise.all(t).then((function(e){var t=vo(e,2);return{stopSequence:t[0],fullTrajectory:t[1]}}))}},{key:"mustNotBeDisplayed",value:function(e,t,r){return!Object(Qt.intersects)(t,e.bounds)||"rail"!==e.type&&r<(this.minZoomNonTrain||9)}},{key:"addTrajectory",value:function(e,t){var r=this.trajectories.findIndex((function(t){return t.train_id===e.train_id})),n=e.time_intervals,o=wo(wo({},e),{},{id:e.train_id,timeIntervals:n});t?(this.trajectories.unshift(o),-1!==r&&this.tracker.trajectories.splice(r+1,1)):(this.trajectories.push(o),-1!==r&&this.tracker.trajectories.splice(r,1)),this.tracker.setTrajectories(this.trajectories)}},{key:"removeTrajectory",value:function(e){for(var t=0,r=this.trajectories.length;t<r;t+=1)if(this.trajectories[t].train_id===e){this.trajectories.splice(t,1);break}}},{key:"onTrajectoryMessage",value:function(e){if(e.content){var t=this.format.readFeature(e.content);if(t.set("timeOffset",Date.now()-e.timestamp),t.get("time_since_update")>=0){if(this.debug&&this.mode===Ln.TOPOGRAPHIC&&t.get("raw_coordinates")){var r=new ho.a(t.get("raw_coordinates"));r.transform("EPSG:4326",this.map.getView().getProjection()),t.setGeometry(r)}this.mustNotBeDisplayed(t.getProperties())||this.addTrajectory(t.getProperties(),!t.get("line"))}}}},{key:"onDeleteTrajectoryMessage",value:function(e){e.content&&this.removeTrajectory(e.content)}},{key:"onFeatureHover",value:function(e,t,n){var o=vo(e,1)[0],i=null;o&&(i=o.get("train_id")),this.hoverVehicleId!==i&&(this.hoverVehicleId=i,this.renderTrajectories()),ko(Ro(r.prototype),"onFeatureHover",this).call(this,e,t,n)}},{key:"onFeatureClick",value:function(e,t,n){var o=vo(e,1)[0],i=null;o&&(i=o.get("train_id")),this.selectedVehicleId!==i&&(this.selectedVehicleId=i,this.selectedVehicle=o,this.renderTrajectories()),ko(Ro(r.prototype),"onFeatureClick",this).call(this,e,t,n)}}]),r}(e)};function Mo(e){return(Mo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Lo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Bo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Lo(Object(r),!0).forEach((function(t){Vo(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lo(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Vo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Uo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function qo(){return(qo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=No(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function No(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Zo(e)););return e}function Ho(e,t){return(Ho=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ko(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Zo(e);if(t){var o=Zo(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return zo(this,r)}}function zo(e,t){if(t&&("object"===Mo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Zo(e){return(Zo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Go=new Ye.a,Wo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ho(e,t)}(i,e);var t,r,n,o=Ko(i);function i(){return Fo(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"mustNotBeDisplayed",value:function(e,t,r){return qo(Zo(i.prototype),"mustNotBeDisplayed",this).call(this,e,t||this.map.getView().calculateExtent(),r||this.map.getView().getZoom())}},{key:"setBbox",value:function(e,t){var r=e,n=t;!r&&this.isUpdateBboxOnMoveEnd&&(r=e||this.map.getView().calculateExtent(),n=Math.floor(this.map.getView().getZoom())),qo(Zo(i.prototype),"setBbox",this).call(this,r,n)}},{key:"onMoveEnd",value:function(e){qo(Zo(i.prototype),"onMoveEnd",this).call(this,e),this.visible&&this.isUpdateBboxOnMoveEnd&&this.setBbox(),this.visible&&this.isUpdateBboxOnMoveEnd&&this.isClickActive&&this.selectedVehicleId&&this.highlightTrajectory(this.selectedVehicleId)}},{key:"onFeatureClick",value:function(e,t,r){qo(Zo(i.prototype),"onFeatureClick",this).call(this,e,t,r),this.selectedVehicleId&&this.highlightTrajectory(this.selectedVehicleId)}},{key:"highlightTrajectory",value:function(e){var t=this;this.getTrajectoryInfos(e).then((function(e){var r=e.stopSequence,n=e.fullTrajectory,o=t.vectorLayer.getSource();o.clear();var i="#ffffff";if(t.useDelayStyle)i="#a0a0a0";else{if(n){var c=n.features[0].properties,a=c.type,u=c.stroke;u&&"#"!==u[0]&&(u="#".concat(u)),i=u||ht(a)}i=/#ffffff/i.test(i)?"#ff0000":i}if(r.forEach((function(e){if(e.stations){var t=new qr.MultiPoint(e.stations.map((function(e){return e.coordinate}))),r=new Yt.a(t);r.setStyle(new Zt.Style({zIndex:1,image:new Zt.Circle({radius:5,fill:new Zt.Fill({color:"#000000"})})}));var n=new Yt.a(t);n.setStyle(new Zt.Style({zIndex:4,image:new Zt.Circle({radius:4,fill:new Zt.Fill({color:i})})})),o.addFeatures([r,n])}})),n){var s=[new Zt.Style({zIndex:2,stroke:new Zt.Stroke({color:"#000000",width:6})}),new Zt.Style({zIndex:3,stroke:new Zt.Stroke({color:i,width:4})})],l=Go.readFeatures(n);l.forEach((function(e){e.setStyle(s)})),t.vectorLayer.getSource().addFeatures(l)}}))}},{key:"clone",value:function(e){return new i(Bo(Bo({},this.options),e))}}])&&Uo(t.prototype,r),n&&Uo(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Ao(Ur));function $o(e){return($o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Jo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Qo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Jo(Object(r),!0).forEach((function(t){Xo(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Jo(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Xo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Yo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ei(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ti(e,t){return(ti=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ri(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=oi(e);if(t){var o=oi(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ni(this,r)}}function ni(e,t){if(t&&("object"===$o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function oi(e){return(oi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ii=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ti(e,t)}(i,e);var t,r,n,o=ri(i);function i(){return Yo(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"getFeatureInfoAtCoordinate",value:function(e){var t=this,r=[];if(this.map){var n=this.map.getPixelFromCoordinate(e);r=this.map.getFeaturesAtPixel(n,{layerFilter:function(e){return e===t.olLayer},hitTolerance:this.hitTolerance})}return Promise.resolve({features:r,layer:this,coordinate:e})}},{key:"clone",value:function(e){return new i(Qo(Qo({},this.options),e))}}])&&ei(t.prototype,r),n&&ei(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(A);function ci(e){return(ci="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ai(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ui(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ai(Object(r),!0).forEach((function(t){si(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ai(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function si(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function li(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fi(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function pi(e,t){return(pi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function yi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=bi(e);if(t){var o=bi(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return hi(this,r)}}function hi(e,t){if(t&&("object"===ci(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function bi(e){return(bi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var vi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pi(e,t)}(i,e);var t,r,n,o=yi(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return li(this,i),(e=o.call(this,t)).abortController=new AbortController,e.format=new Ye.a,e}return t=i,(r=[{key:"getFeatureInfoUrl",value:function(e){var t=this.map.getView().getProjection(),r=this.map.getView().getResolution();return!!this.olLayer.getSource().getFeatureInfoUrl&&this.olLayer.getSource().getFeatureInfoUrl(e,r,t,{info_format:"application/json",query_layers:this.olLayer.getSource().getParams().layers})}},{key:"getFeatureInfoAtCoordinate",value:function(e){var t=this;this.abortController.abort(),this.abortController=new AbortController;var r=this.abortController.signal;return fetch(this.getFeatureInfoUrl(e),{signal:r}).then((function(e){return e.json()})).then((function(e){return e.features})).then((function(r){return{layer:t,coordinate:e,features:r.map((function(e){return t.format.readFeature(e)}))}})).catch((function(){return Promise.resolve({features:[],coordinate:e,layer:t})}))}},{key:"clone",value:function(e){return new i(ui(ui({},this.options),e))}}])&&fi(t.prototype,r),n&&fi(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(A);r(15),r(25),r(26),r(17);function di(e){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function mi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function gi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?mi(Object(r),!0).forEach((function(t){Oi(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Oi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ji(e,t){return(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function wi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ki(e);if(t){var o=ki(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return Pi(this,r)}}function Pi(e,t){if(t&&("object"===di(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ki(e){return(Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Si(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ti(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ci(e,t,r){return t&&Ti(e.prototype,t),r&&Ti(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ei(e){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ri(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _i(e,t){return(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Di(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Ai(e);if(t){var o=Ai(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return Ii(this,r)}}function Ii(e,t){if(t&&("object"===Ei(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Ai(e){return(Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Mi=G;var Mi;function Li(e){return(Li="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Bi(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Vi(){return(Vi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Fi(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Fi(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Ki(e)););return e}function Ui(e,t){return(Ui=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function qi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Ki(e);if(t){var o=Ki(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ni(this,r)}}function Ni(e,t){if(t&&("object"===Li(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Hi(e)}function Hi(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ki(e){return(Ki=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var zi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ui(e,t)}(i,e);var t,r,n,o=qi(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).render=t.render.bind(Hi(t)),t}return t=i,(r=[{key:"activate",value:function(){Vi(Ki(i.prototype),"activate",this).call(this),this.map&&(this.map.on("sourcedata",this.render),this.map.on("styledata",this.render),this.map.on("idle",this.render))}},{key:"deactivate",value:function(){this.map&&(this.map.off("sourcedata",this.render),this.map.off("styledata",this.render),this.map.off("idle",this.render)),Vi(Ki(i.prototype),"deactivate",this).call(this)}},{key:"getCopyrights",value:function(){return ct(this.map)}}])&&Bi(t.prototype,r),n&&Bi(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(me(G));function Zi(e){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Gi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Wi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gi(Object(r),!0).forEach((function(t){$i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function $i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ji(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Qi(){return("undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Xi(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Xi(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==rc(e););return e}function Yi(e,t){return(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ec(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=rc(e);if(t){var o=rc(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return tc(this,r)}}function tc(e,t){if(t&&("object"===Zi(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function rc(e){return(Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}ae(We.Map);var nc=r(18),oc=r.n(nc),ic=r(19);function cc(e){return(cc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ac(e){return function(e){if(Array.isArray(e))return uc(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return uc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return uc(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function sc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function lc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?sc(Object(r),!0).forEach((function(t){fc(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function fc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function hc(){return(hc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=bc(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function bc(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=gc(e)););return e}function vc(e,t){return(vc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function dc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=gc(e);if(t){var o=gc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return mc(this,r)}}function mc(e,t){if(t&&("object"===cc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function gc(e){return(gc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Oc(e){return function(e){if(Array.isArray(e))return jc(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return jc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return jc(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var wc=function(e){var t=e.getBounds().toArray(),r=Object(Ge.fromLonLat)(t[0]),n=Object(Ge.fromLonLat)(t[1]),o=[].concat(Oc(r),Oc(n)),i=e.getCanvas(),c=i.width,a=i.height,u=Object(Qt.getWidth)(o)/c,s=Object(Qt.getHeight)(o)/a;return Math.max(u,s)},Pc=function(e,t){var r=e.getCanvas(),n=r.width,o=r.height,i=e.unproject({x:0,y:0}),c=e.unproject({x:0,y:o/t}),a=e.unproject({x:n/t,y:o/t}),u=e.unproject({x:n/t,y:0});return[[i.lng,i.lat],[u.lng,u.lat],[a.lng,a.lat],[c.lng,c.lat]]};function kc(e){return(kc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Sc(e){return function(e){if(Array.isArray(e))return Tc(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Tc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Tc(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Tc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Cc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ec(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Cc(Object(r),!0).forEach((function(t){xc(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function xc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Rc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Dc(){return(Dc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Ic(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Ic(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Vc(e)););return e}function Ac(e,t){return(Ac=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Mc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Vc(e);if(t){var o=Vc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Lc(this,r)}}function Lc(e,t){if(t&&("object"===kc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Bc(e)}function Bc(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Vc(e){return(Vc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Fc=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ac(e,t)}(i,e);var t,r,n,o=Mc(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Rc(this,i),(e=o.call(this,Ec({},t))).onMove=e.onMove.bind(Bc(e)),e.onMoveEnd=e.onMoveEnd.bind(Bc(e)),e.onZoomEnd=e.onZoomEnd.bind(Bc(e)),e.onVisibilityChange=e.onVisibilityChange.bind(Bc(e)),e}return t=i,(r=[{key:"init",value:function(e,t){if(e){var r=e.getCanvas();Dc(Vc(i.prototype),"init",this).call(this,e,{width:r.width/this.pixelRatio,height:r.height/this.pixelRatio});var n={type:"canvas",canvas:this.tracker.canvas,coordinates:Pc(e,this.pixelRatio),animate:!0,attribution:this.copyrights&&this.copyrights.join(", ")};this.beforeId=t,this.layer={id:this.key,type:"raster",source:this.key,layout:{visibility:this.visible?"visible":"none"},paint:{"raster-opacity":1,"raster-fade-duration":0,"raster-resampling":"nearest"}},e.addSource(this.key,n),e.addLayer(this.layer,this.beforeId),this.listeners=[this.on("change:visible",this.onVisibilityChange)]}}},{key:"terminate",value:function(){this.map&&(this.listeners.forEach((function(e){Object(c.unByKey)(e)})),this.map.getLayer(this.key)&&this.map.removeLayer(this.key),this.map.getSource(this.key)&&this.map.removeSource(this.key)),Dc(Vc(i.prototype),"terminate",this).call(this)}},{key:"start",value:function(){Dc(Vc(i.prototype),"start",this).call(this),this.map.on("move",this.onMove),this.map.on("moveend",this.onMoveEnd),this.map.on("zoomend",this.onZoomEnd)}},{key:"stop",value:function(){Dc(Vc(i.prototype),"stop",this).call(this),this.map&&(this.map.off("move",this.onMove),this.map.off("moveend",this.onMoveEnd),this.map.off("zoomend",this.onZoomEnd))}},{key:"onUserClickCallback",value:function(e){Dc(Vc(i.prototype),"onUserClickCallback",this).call(this,Ec({coordinate:Object(Ge.fromLonLat)(e.lngLat.toArray())},e))}},{key:"onUserMoveCallback",value:function(e){Dc(Vc(i.prototype),"onUserMoveCallback",this).call(this,Ec({coordinate:Object(Ge.fromLonLat)(e.lngLat.toArray())},e))}},{key:"renderTrajectories",value:function(e){var t=this.map.getCanvas(),r=t.width,n=t.height,o=this.map.getCenter(),c=this.map.unproject({x:0,y:n/this.pixelRatio}),a=this.map.unproject({x:r/this.pixelRatio,y:0}),u=oc()(Object(ic.point)([c.lng,c.lat]),-this.map.getBearing(),{pivot:[o.lng,o.lat]}).geometry.coordinates,s=oc()(Object(ic.point)([a.lng,a.lat]),-this.map.getBearing(),{pivot:[o.lng,o.lat]}).geometry.coordinates,l=[].concat(Sc(Object(Ge.fromLonLat)(u)),Sc(Object(Ge.fromLonLat)(s))),f=Object(Qt.getWidth)(l)/(r/this.pixelRatio),p=Object(Qt.getHeight)(l)/(n/this.pixelRatio),y=Math.max(f,p),h={size:[r/this.pixelRatio,n/this.pixelRatio],center:Object(Ge.fromLonLat)([o.lng,o.lat]),extent:l,resolution:y,zoom:this.map.getZoom(),rotation:-this.map.getBearing()*Math.PI/180,pixelRatio:this.pixelRatio};Dc(Vc(i.prototype),"renderTrajectories",this).call(this,h,e)}},{key:"getRefreshTimeInMs",value:function(){return Dc(Vc(i.prototype),"getRefreshTimeInMs",this).call(this,this.map.getZoom())}},{key:"getVehiclesAtCoordinate",value:function(e,t){var r=wc(this.map);return Dc(Vc(i.prototype),"getVehiclesAtCoordinate",this).call(this,e,r,t)}},{key:"getFeatureInfoAtCoordinate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=wc(this.map);return Dc(Vc(i.prototype),"getFeatureInfoAtCoordinate",this).call(this,e,Ec({resolution:r},t))}},{key:"onVisibilityChange",value:function(){this.visible&&!this.map.getLayer(this.key)?this.map.addLayer(this.layer,this.beforeId):this.map.getLayer(this.key)&&this.map.removeLayer(this.key)}},{key:"onMove",value:function(){var e=Pc(this.map,this.pixelRatio),t=this.map.getSource(this.key);t&&t.setCoordinates(e),this.renderTrajectories()}},{key:"onMoveEnd",value:function(){}},{key:"onFeatureHover",value:function(e,t,r){Dc(Vc(i.prototype),"onFeatureHover",this).call(this,e,t,r),this.map.getCanvasContainer().style.cursor=e.length?"pointer":"auto"}}])&&_c(t.prototype,r),n&&_c(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Cr(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vc(e,t)}(i,e);var t,r,n,o=dc(i);function i(){return pc(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"init",value:function(e){hc(gc(i.prototype),"init",this).call(this,e),this.map&&(this.isClickActive||this.isHoverActive)&&(this.toggleVisibleListeners(),this.onChangeVisibleKey=this.on("change:visible",this.toggleVisibleListeners))}},{key:"terminate",value:function(e){this.map&&(this.map.off("mousemove",this.onUserMoveCallback),this.map.off("click",this.onUserClickCallback),Object(c.unByKey)(this.onChangeVisibleKey)),hc(gc(i.prototype),"terminate",this).call(this,e)}},{key:"onUserClickCallback",value:function(e){hc(gc(i.prototype),"onUserClickCallback",this).call(this,lc({coordinate:e.lngLat.toArray()},e))}},{key:"onUserMoveCallback",value:function(e){hc(gc(i.prototype),"onUserMoveCallback",this).call(this,lc({coordinate:e.lngLat.toArray()},e))}},{key:"toggleVisibleListeners",value:function(){this.visible?(this.isClickActive&&this.map.on("click",this.onUserClickCallback),this.isHoverActive&&this.map.on("mousemove",this.onUserMoveCallback)):(this.isClickActive&&this.map.off("click",this.onUserClickCallback),this.isHoverActive&&this.map.off("mousemove",this.onUserMoveCallback))}},{key:"getMercatorExtent",value:function(){var e=this.map.getBounds().toArray();return Object(Ge.transformExtent)([].concat(ac(e[0]),ac(e[1])),"EPSG:4326","EPSG:3857")}},{key:"getOlZoom",value:function(){return this.map.getZoom()+1}},{key:"clone",value:function(e){return new i(lc(lc({},this.options),e))}}])&&yc(t.prototype,r),n&&yc(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(w)));function Uc(e){return(Uc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function qc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Hc(){return(Hc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Kc(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Kc(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Wc(e)););return e}function zc(e,t){return(zc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Zc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Wc(e);if(t){var o=Wc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Gc(this,r)}}function Gc(e,t){if(t&&("object"===Uc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Wc(e){return(Wc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var $c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zc(e,t)}(i,e);var t,r,n,o=Zc(i);function i(){return qc(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"mustNotBeDisplayed",value:function(e,t,r){return Hc(Wc(i.prototype),"mustNotBeDisplayed",this).call(this,e,t||this.getMercatorExtent(),r||Math.floor(this.map.getZoom()+1))}},{key:"setBbox",value:function(e,t){var r=e,n=t;!r&&this.isUpdateBboxOnMoveEnd&&(r=e||this.getMercatorExtent(),n=Math.floor(this.getOlZoom())),Hc(Wc(i.prototype),"setBbox",this).call(this,r,n)}},{key:"onMoveEnd",value:function(e){Hc(Wc(i.prototype),"onMoveEnd",this).call(this,e),this.visible&&this.isUpdateBboxOnMoveEnd&&this.setBbox()}}])&&Nc(t.prototype,r),n&&Nc(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Ao(Fc));function Jc(e){return(Jc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Qc(e){return function(e){if(Array.isArray(e))return Xc(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Xc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Xc(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Yc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ea(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Yc(Object(r),!0).forEach((function(t){ta(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ta(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ra(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function na(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function oa(){return(oa="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=ia(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function ia(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=la(e)););return e}function ca(e,t){return(ca=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function aa(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=la(e);if(t){var o=la(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ua(this,r)}}function ua(e,t){if(t&&("object"===Jc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return sa(e)}function sa(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function la(e){return(la=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var fa={mapbox:{TrajservLayer:function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ca(e,t)}(i,e);var t,r,n,o=aa(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ra(this,i),(e=o.call(this,ea({},t))).onMove=e.onMove.bind(sa(e)),e.onMoveEnd=e.onMoveEnd.bind(sa(e)),e.onVisibilityChange=e.onVisibilityChange.bind(sa(e)),e}return t=i,(r=[{key:"terminate",value:function(){this.map&&(this.listeners.forEach((function(e){Object(c.unByKey)(e)})),this.map.removeLayer(this.key),this.map.removeSource(this.key)),oa(la(i.prototype),"terminate",this).call(this)}},{key:"start",value:function(){this.map&&(oa(la(i.prototype),"start",this).call(this),this.map.on("move",this.onMove),this.map.on("moveend",this.onMoveEnd))}},{key:"stop",value:function(){this.map&&(this.map.off("move",this.onMove),this.map.off("moveend",this.onMoveEnd)),oa(la(i.prototype),"stop",this).call(this)}},{key:"onMoveEnd",value:function(){this.updateTrajectories(),this.selectedVehicleId&&this.journeyId&&this.highlightTrajectory()}},{key:"getParams",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.map.getBounds().toArray(),r=Object(Ge.fromLonLat)(t[0]),n=Object(Ge.fromLonLat)(t[1]),o=[].concat(Qc(r),Qc(n)),c=Object(Qt.buffer)(o,Object(Qt.getWidth)(o)/10).join(","),a=this.map.getZoom();return oa(la(i.prototype),"getParams",this).call(this,ea(ea({},e),{},{bbox:c,s:a<10?1:0,z:a}))}},{key:"drawFullTrajectory",value:function(e,t,r){console.log("to be implemented")}}])&&na(t.prototype,r),n&&na(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Yn(Fc)),TralisLayer:$c},ol:{Map:Ze,Layer:A,WMSLayer:vi,MapboxLayer:zt,TrajservLayer:po,TralisLayer:Wo,VectorLayer:ii}};t.default=fa}])}));
|
|
2
2
|
//# sourceMappingURL=index.js.map
|