| 23 | !function(t,n,r,i){var o,a=["","webkit","Moz","MS","ms","o"],s=n.createElement("div"),u=Math.round,c=Math.abs,l=Date.now;function f(e,t,n){return setTimeout(y(e,n),t)}function h(e,t,n){return!!Array.isArray(e)&&(d(e,n[t],n),!0)}function d(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(void 0!==e.length)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function p(e,n,r){var i="DEPRECATED METHOD: "+n+"\n"+r+" AT \n";return function(){var n=new Error("get-stack-trace"),r=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=t.console&&(t.console.warn||t.console.log);return o&&o.call(t.console,i,r),e.apply(this,arguments)}}o="function"!=typeof Object.assign?function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])}return t}:Object.assign;var v=p((function(e,t,n){for(var r=Object.keys(t),i=0;i<r.length;)(!n||n&&void 0===e[r[i]])&&(e[r[i]]=t[r[i]]),i++;return e}),"extend","Use `assign`."),g=p((function(e,t){return v(e,t,!0)}),"merge","Use `assign`.");function m(e,t,n){var r,i=t.prototype;(r=e.prototype=Object.create(i)).constructor=e,r._super=i,n&&o(r,n)}function y(e,t){return function(){return e.apply(t,arguments)}}function b(e,t){return"function"==typeof e?e.apply(t&&t[0]||void 0,t):e}function _(e,t){return void 0===e?t:e}function x(e,t,n){d(A(t),(function(t){e.addEventListener(t,n,!1)}))}function w(e,t,n){d(A(t),(function(t){e.removeEventListener(t,n,!1)}))}function S(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function E(e,t){return e.indexOf(t)>-1}function A(e){return e.trim().split(/\s+/g)}function T(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}function k(e){return Array.prototype.slice.call(e,0)}function M(e,t,n){for(var r=[],i=[],o=0;o<e.length;){var a=t?e[o][t]:e[o];T(i,a)<0&&r.push(e[o]),i[o]=a,o++}return n&&(r=t?r.sort((function(e,n){return e[t]>n[t]})):r.sort()),r}function C(e,t){for(var n,r,i=t[0].toUpperCase()+t.slice(1),o=0;o<a.length;){if((r=(n=a[o])?n+i:t)in e)return r;o++}}var I=1;function P(e){var n=e.ownerDocument||e;return n.defaultView||n.parentWindow||t}var O="ontouchstart"in t,R=void 0!==C(t,"PointerEvent"),L=O&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),N=["x","y"],D=["clientX","clientY"];function j(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){b(e.options.enable,[e])&&n.handler(t)},this.init()}function z(e,t,n){var r=n.pointers.length,i=n.changedPointers.length,o=1&t&&r-i==0,a=12&t&&r-i==0;n.isFirst=!!o,n.isFinal=!!a,o&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,r=t.pointers,i=r.length;n.firstInput||(n.firstInput=F(t));i>1&&!n.firstMultiple?n.firstMultiple=F(t):1===i&&(n.firstMultiple=!1);var o=n.firstInput,a=n.firstMultiple,s=a?a.center:o.center,u=t.center=B(r);t.timeStamp=l(),t.deltaTime=t.timeStamp-o.timeStamp,t.angle=H(s,u),t.distance=G(s,u),function(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},o=e.prevInput||{};1!==t.eventType&&4!==o.eventType||(i=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y});t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}(n,t),t.offsetDirection=V(t.deltaX,t.deltaY);var f=U(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=f.x,t.overallVelocityY=f.y,t.overallVelocity=c(f.x)>c(f.y)?f.x:f.y,t.scale=a?(h=a.pointers,d=r,G(d[0],d[1],D)/G(h[0],h[1],D)):1,t.rotation=a?function(e,t){return H(t[1],t[0],D)+H(e[1],e[0],D)}(a.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,r,i,o,a=e.lastInterval||t,s=t.timeStamp-a.timeStamp;if(8!=t.eventType&&(s>25||void 0===a.velocity)){var u=t.deltaX-a.deltaX,l=t.deltaY-a.deltaY,f=U(s,u,l);r=f.x,i=f.y,n=c(f.x)>c(f.y)?f.x:f.y,o=V(u,l),e.lastInterval=t}else n=a.velocity,r=a.velocityX,i=a.velocityY,o=a.direction;t.velocity=n,t.velocityX=r,t.velocityY=i,t.direction=o}(n,t);var h,d;var p=e.element;S(t.srcEvent.target,p)&&(p=t.srcEvent.target);t.target=p}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function F(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:u(e.pointers[n].clientX),clientY:u(e.pointers[n].clientY)},n++;return{timeStamp:l(),pointers:t,center:B(t),deltaX:e.deltaX,deltaY:e.deltaY}}function B(e){var t=e.length;if(1===t)return{x:u(e[0].clientX),y:u(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:u(n/t),y:u(r/t)}}function U(e,t,n){return{x:t/e||0,y:n/e||0}}function V(e,t){return e===t?1:c(e)>=c(t)?e<0?2:4:t<0?8:16}function G(e,t,n){n||(n=N);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function H(e,t,n){n||(n=N);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}j.prototype={handler:function(){},init:function(){this.evEl&&x(this.element,this.evEl,this.domHandler),this.evTarget&&x(this.target,this.evTarget,this.domHandler),this.evWin&&x(P(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(P(this.element),this.evWin,this.domHandler)}};var Z={mousedown:1,mousemove:2,mouseup:4};function W(){this.evEl="mousedown",this.evWin="mousemove mouseup",this.pressed=!1,j.apply(this,arguments)}m(W,j,{handler:function(e){var t=Z[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))}});var q={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},X={2:"touch",3:"pen",4:"mouse",5:"kinect"},Y="pointerdown",K="pointermove pointerup pointercancel";function Q(){this.evEl=Y,this.evWin=K,j.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(Y="MSPointerDown",K="MSPointerMove MSPointerUp MSPointerCancel"),m(Q,j,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=q[r],o=X[e.pointerType]||e.pointerType,a="touch"==o,s=T(t,e.pointerId,"pointerId");1&i&&(0===e.button||a)?s<0&&(t.push(e),s=t.length-1):12&i&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(s,1))}});var J={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function $(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,j.apply(this,arguments)}function ee(e,t){var n=k(e.touches),r=k(e.changedTouches);return 12&t&&(n=M(n.concat(r),"identifier",!0)),[n,r]}m($,j,{handler:function(e){var t=J[e.type];if(1===t&&(this.started=!0),this.started){var n=ee.call(this,e,t);12&t&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:e})}}});var te={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function ne(){this.evTarget="touchstart touchmove touchend touchcancel",this.targetIds={},j.apply(this,arguments)}function re(e,t){var n=k(e.touches),r=this.targetIds;if(3&t&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,a=k(e.changedTouches),s=[],u=this.target;if(o=n.filter((function(e){return S(e.target,u)})),1===t)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<a.length;)r[a[i].identifier]&&s.push(a[i]),12&t&&delete r[a[i].identifier],i++;return s.length?[M(o.concat(s),"identifier",!0),s]:void 0}m(ne,j,{handler:function(e){var t=te[e.type],n=re.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:e})}});function ie(){j.apply(this,arguments);var e=y(this.handler,this);this.touch=new ne(this.manager,e),this.mouse=new W(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function oe(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,ae.call(this,t)):12&e&&ae.call(this,t)}function ae(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var r=this.lastTouches;setTimeout((function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)}),2500)}}function se(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],o=Math.abs(t-i.x),a=Math.abs(n-i.y);if(o<=25&&a<=25)return!0}return!1}m(ie,j,{handler:function(e,t,n){var r="touch"==n.pointerType,i="mouse"==n.pointerType;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)oe.call(this,t,n);else if(i&&se.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var ue=C(s.style,"touchAction"),ce=void 0!==ue,le=function(){if(!ce)return!1;var e={},n=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(r){e[r]=!n||t.CSS.supports("touch-action",r)})),e}();function fe(e,t){this.manager=e,this.set(t)}fe.prototype={set:function(e){"compute"==e&&(e=this.compute()),ce&&this.manager.element.style&&le[e]&&(this.manager.element.style[ue]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return d(this.manager.recognizers,(function(t){b(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(E(e,"none"))return"none";var t=E(e,"pan-x"),n=E(e,"pan-y");if(t&&n)return"none";if(t||n)return t?"pan-x":"pan-y";if(E(e,"manipulation"))return"manipulation";return"auto"}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var r=this.actions,i=E(r,"none")&&!le.none,o=E(r,"pan-y")&&!le["pan-y"],a=E(r,"pan-x")&&!le["pan-x"];if(i){var s=1===e.pointers.length,u=e.distance<2,c=e.deltaTime<250;if(s&&u&&c)return}if(!a||!o)return i||o&&6&n||a&&24&n?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};function he(e){this.options=o({},this.defaults,e||{}),this.id=I++,this.manager=null,this.options.enable=_(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function de(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function pe(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function ve(e,t){var n=t.manager;return n?n.get(e):e}function ge(){he.apply(this,arguments)}function me(){ge.apply(this,arguments),this.pX=null,this.pY=null}function ye(){ge.apply(this,arguments)}function be(){he.apply(this,arguments),this._timer=null,this._input=null}function _e(){ge.apply(this,arguments)}function xe(){ge.apply(this,arguments)}function we(){he.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Se(e,t){return(t=t||{}).recognizers=_(t.recognizers,Se.defaults.preset),new Ee(e,t)}he.prototype={defaults:{},set:function(e){return o(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(h(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=ve(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return h(e,"dropRecognizeWith",this)||(e=ve(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(h(e,"requireFailure",this))return this;var t=this.requireFail;return-1===T(t,e=ve(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(h(e,"dropRequireFailure",this))return this;e=ve(e,this);var t=T(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<8&&r(t.options.event+de(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=8&&r(t.options.event+de(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=32},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},recognize:function(e){var t=o({},e);if(!b(this.options.enable,[this,t]))return this.reset(),void(this.state=32);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},m(ge,he,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,r=6&t,i=this.attrTest(e);return r&&(8&n||!i)?16|t:r||i?4&n?8|t:2&t?4|t:2:32}}),m(me,ge,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push("pan-y"),24&e&&t.push("pan-x"),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,o=e.deltaX,a=e.deltaY;return i&t.direction||(6&t.direction?(i=0===o?1:o<0?2:4,n=o!=this.pX,r=Math.abs(e.deltaX)):(i=0===a?1:a<0?8:16,n=a!=this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},attrTest:function(e){return ge.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=pe(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),m(ye,ge,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return["none"]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),m(be,he,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime>t.time;if(this._input=e,!r||!n||12&e.eventType&&!i)this.reset();else if(1&e.eventType)this.reset(),this._timer=f((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}}),m(_e,ge,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return["none"]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),m(xe,ge,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return me.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return 30&n?t=e.overallVelocity:6&n?t=e.overallVelocityX:24&n&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&c(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=pe(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),m(we,he,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return["manipulation"]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime<t.time;if(this.reset(),1&e.eventType&&0===this.count)return this.failTimeout();if(r&&i&&n){if(4!=e.eventType)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,a=!this.pCenter||G(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,a&&o?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=f((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return 32},failTimeout:function(){return this._timer=f((function(){this.state=32}),this.options.interval,this),32},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Se.VERSION="2.0.7",Se.defaults={domEvents:!1,touchAction:"compute",enable:!0,inputTarget:null,inputClass:null,preset:[[_e,{enable:!1}],[ye,{enable:!1},["rotate"]],[xe,{direction:6}],[me,{direction:6},["swipe"]],[we],[we,{event:"doubletap",taps:2},["tap"]],[be]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Ee(e,t){var n;this.options=o({},Se.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((n=this).options.inputClass||(R?Q:L?ne:O?ie:W))(n,z),this.touchAction=new fe(this,this.options.touchAction),Ae(this,!0),d(this.options.recognizers,(function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}function Ae(e,t){var n,r=e.element;r.style&&(d(e.options.cssProps,(function(i,o){n=C(r.style,o),t?(e.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=e.oldCssProps[n]||""})),t||(e.oldCssProps={}))}Ee.prototype={set:function(e){return o(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var n;this.touchAction.preventDefaults(e);var r=this.recognizers,i=t.curRecognizer;(!i||i&&8&i.state)&&(i=t.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],2===t.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(e),!i&&14&n.state&&(i=t.curRecognizer=n),o++}},get:function(e){if(e instanceof he)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(h(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(h(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=T(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(void 0!==e&&void 0!==t){var n=this.handlers;return d(A(e),(function(e){n[e]=n[e]||[],n[e].push(t)})),this}},off:function(e,t){if(void 0!==e){var n=this.handlers;return d(A(e),(function(e){t?n[e]&&n[e].splice(T(n[e],t),1):delete n[e]})),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var r=n.createEvent("Event");r.initEvent(e,!0,!0),r.gesture=t,t.target.dispatchEvent(r)}(e,t);var r=this.handlers[e]&&this.handlers[e].slice();if(r&&r.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var i=0;i<r.length;)r[i](t),i++}},destroy:function(){this.element&&Ae(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},o(Se,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:32,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:24,DIRECTION_ALL:30,Manager:Ee,Input:j,TouchAction:fe,TouchInput:ne,MouseInput:W,PointerEventInput:Q,TouchMouseInput:ie,SingleTouchInput:$,Recognizer:he,AttrRecognizer:ge,Tap:we,Pan:me,Swipe:xe,Pinch:ye,Rotate:_e,Press:be,on:x,off:w,each:d,merge:g,extend:v,assign:o,inherit:m,bindFn:y,prefixed:C}),(void 0!==t?t:"undefined"!=typeof self?self:{}).Hammer=Se,e.exports?e.exports=Se:t.Hammer=Se}(window,document)}));(rb=e.InteractionEvent||(e.InteractionEvent={})).Hover="hover",rb.Click="click",rb.Select="select",rb.Active="active",rb.Drag="drag";var vb={panstart:"dragstart",panmove:"dragging",panend:"dragend",pancancel:"dragcancle"},gb=(ib=Q(),ob=J(nr.IMapService),ab=J(nr.ILogService),ib((cb=go((ub=function(t){Ji(r,t);var n=so(r);function r(){var t;Wi(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return vo(t=n.call.apply(n,[this].concat(o)),"mapService",cb,oo(t)),vo(t,"logger",lb,oo(t)),t.hammertime=void 0,t.lastClickTime=0,t.lastClickXY=[-1,-1],t.clickTimer=void 0,t.$containter=void 0,t.onDrag=function(n){var r=t.interactionEvent(n);r.type=vb[r.type],t.emit(e.InteractionEvent.Drag,r)},t.onHammer=function(n){n.srcEvent.stopPropagation();var r=t.interactionEvent(n);t.emit(e.InteractionEvent.Hover,r)},t.onTouch=function(e){var n=e.touches[0];t.onHover({x:n.pageX,y:n.pageY,type:"touch"})},t.onHover=function(n){var r=n.clientX,i=n.clientY,o=n.type,a=t.mapService.getMapContainer();if(a){var s=a.getBoundingClientRect(),u=s.top;r=r-s.left-a.clientLeft,i=i-u-a.clientTop}var c=t.mapService.containerToLngLat([r,i]);if("click"!==o)"touch"!==o?"click"!==o&&"dblclick"!==o&&t.emit(e.InteractionEvent.Hover,{x:r,y:i,lngLat:c,type:o,target:n}):t.isDoubleTap(r,i,c);else{if("ontouchstart"in document.documentElement==!0)return;t.isDoubleTap(r,i,c)}},t}return Xi(r,[{key:"init",value:function(){this.addEventListenerOnMap(),this.$containter=this.mapService.getMapContainer()}},{key:"destroy",value:function(){this.hammertime&&this.hammertime.destroy(),this.removeEventListenerOnMap(),this.off(e.InteractionEvent.Hover)}},{key:"triggerHover",value:function(t){var n=t.x,r=t.y;this.emit(e.InteractionEvent.Hover,{x:n,y:r})}},{key:"triggerSelect",value:function(t){this.emit(e.InteractionEvent.Select,{featureId:t})}},{key:"triggerActive",value:function(t){this.emit(e.InteractionEvent.Active,{featureId:t})}},{key:"addEventListenerOnMap",value:function(){var e=this.mapService.getMapContainer();if(e){var t=new pb.Manager(e);t.add(new pb.Tap({event:"dblclick",taps:2})),t.add(new pb.Tap({event:"click"})),t.add(new pb.Pan({threshold:0,pointers:0})),t.add(new pb.Press({})),t.on("dblclick click",this.onHammer),t.on("panstart panmove panend pancancel",this.onDrag),e.addEventListener("mousemove",this.onHover),e.addEventListener("mousedown",this.onHover),e.addEventListener("mouseup",this.onHover),e.addEventListener("contextmenu",this.onHover),this.hammertime=t,this.logger.debug("add event listeners on canvas")}}},{key:"removeEventListenerOnMap",value:function(){var e=this.mapService.getMapContainer();e&&(e.removeEventListener("mousemove",this.onHover),this.hammertime.off("panstart panmove panend pancancel",this.onDrag),e.removeEventListener("mousedown",this.onHover),e.removeEventListener("mouseup",this.onHover),e.removeEventListener("contextmenu",this.onHover))}},{key:"interactionEvent",value:function(e){var t,n,r=e.type;"touch"===e.pointerType?(n=Math.floor(e.pointers[0].clientY),t=Math.floor(e.pointers[0].clientX)):(n=Math.floor(e.srcEvent.y),t=Math.floor(e.srcEvent.x));var i=this.mapService.getMapContainer();if(i){var o=i.getBoundingClientRect(),a=o.top;t-=o.left,n-=a}return{x:t,y:n,lngLat:this.mapService.containerToLngLat([t,n]),type:r,target:e.srcEvent}}},{key:"isDoubleTap",value:function(t,n,r){var i=this,o=(new Date).getTime(),a="click";o-this.lastClickTime<400&&Math.abs(this.lastClickXY[0]-t)<10&&Math.abs(this.lastClickXY[1]-n)<10?(this.lastClickTime=0,this.lastClickXY=[-1,-1],this.clickTimer&&clearTimeout(this.clickTimer),a="dblclick",this.emit(e.InteractionEvent.Hover,{x:t,y:n,lngLat:r,type:a})):(this.lastClickTime=o,this.lastClickXY=[t,n],this.clickTimer=setTimeout((function(){a="click",i.emit(e.InteractionEvent.Hover,{x:t,y:n,lngLat:r,type:a})}),400))}}]),r}(a)).prototype,"mapService",[ob],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),lb=go(ub.prototype,"logger",[ab],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),sb=ub))||sb),mb=ln.some,yb=vr("some"),bb=br("some");Pt({target:"Array",proto:!0,forced:!yb||!bb},{some:function(e){return mb(this,e,arguments.length>1?arguments[1]:void 0)}});var _b,xb,wb,Sb,Eb,Ab,Tb,kb,Mb,Cb,Ib,Pb;o((function(e){var t=function(e){var t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var i=t&&t.prototype instanceof f?t:f,o=Object.create(i.prototype),a=new S(r||[]);return o._invoke=function(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return A()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=_(a,n);if(s){if(s===l)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(e,n,a),o}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var l={};function f(){}function h(){}function d(){}var p={};p[i]=function(){return this};var v=Object.getPrototypeOf,g=v&&v(v(E([])));g&&g!==t&&n.call(g,i)&&(p=g);var m=d.prototype=f.prototype=Object.create(p);function y(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){var r;this._invoke=function(i,o){function a(){return new t((function(r,a){!function r(i,o,a,s){var u=c(e[i],e,o);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==typeof f&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(f).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}(i,o,r,a)}))}return r=r?r.then(a,a):a()}}function _(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,_(e,t),"throw"===t.method))return l;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=c(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,l;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function E(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:A}}function A(){return{value:void 0,done:!0}}return h.prototype=m.constructor=d,d.constructor=h,h.displayName=s(d,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,s(e,a,"GeneratorFunction")),e.prototype=Object.create(m),e},e.awrap=function(e){return{__await:e}},y(b.prototype),b.prototype[o]=function(){return this},e.AsyncIterator=b,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new b(u(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},y(m),s(m,a,"Generator"),m[i]=function(){return this},m.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=E,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(s&&u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),l},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),w(n),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;w(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:E(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}));(_b=e.gl||(e.gl={}))[_b.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",_b[_b.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",_b[_b.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",_b[_b.POINTS=0]="POINTS",_b[_b.LINES=1]="LINES",_b[_b.LINE_LOOP=2]="LINE_LOOP",_b[_b.LINE_STRIP=3]="LINE_STRIP",_b[_b.TRIANGLES=4]="TRIANGLES",_b[_b.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",_b[_b.TRIANGLE_FAN=6]="TRIANGLE_FAN",_b[_b.ZERO=0]="ZERO",_b[_b.ONE=1]="ONE",_b[_b.SRC_COLOR=768]="SRC_COLOR",_b[_b.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",_b[_b.SRC_ALPHA=770]="SRC_ALPHA",_b[_b.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",_b[_b.DST_ALPHA=772]="DST_ALPHA",_b[_b.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",_b[_b.DST_COLOR=774]="DST_COLOR",_b[_b.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",_b[_b.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",_b[_b.FUNC_ADD=32774]="FUNC_ADD",_b[_b.BLEND_EQUATION=32777]="BLEND_EQUATION",_b[_b.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",_b[_b.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",_b[_b.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",_b[_b.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",_b[_b.MAX_EXT=32776]="MAX_EXT",_b[_b.MIN_EXT=32775]="MIN_EXT",_b[_b.BLEND_DST_RGB=32968]="BLEND_DST_RGB",_b[_b.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",_b[_b.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",_b[_b.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",_b[_b.CONSTANT_COLOR=32769]="CONSTANT_COLOR",_b[_b.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",_b[_b.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",_b[_b.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",_b[_b.BLEND_COLOR=32773]="BLEND_COLOR",_b[_b.ARRAY_BUFFER=34962]="ARRAY_BUFFER",_b[_b.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",_b[_b.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",_b[_b.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",_b[_b.STREAM_DRAW=35040]="STREAM_DRAW",_b[_b.STATIC_DRAW=35044]="STATIC_DRAW",_b[_b.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",_b[_b.BUFFER_SIZE=34660]="BUFFER_SIZE",_b[_b.BUFFER_USAGE=34661]="BUFFER_USAGE",_b[_b.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",_b[_b.FRONT=1028]="FRONT",_b[_b.BACK=1029]="BACK",_b[_b.FRONT_AND_BACK=1032]="FRONT_AND_BACK",_b[_b.CULL_FACE=2884]="CULL_FACE",_b[_b.BLEND=3042]="BLEND",_b[_b.DITHER=3024]="DITHER",_b[_b.STENCIL_TEST=2960]="STENCIL_TEST",_b[_b.DEPTH_TEST=2929]="DEPTH_TEST",_b[_b.SCISSOR_TEST=3089]="SCISSOR_TEST",_b[_b.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",_b[_b.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",_b[_b.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",_b[_b.NO_ERROR=0]="NO_ERROR",_b[_b.INVALID_ENUM=1280]="INVALID_ENUM",_b[_b.INVALID_VALUE=1281]="INVALID_VALUE",_b[_b.INVALID_OPERATION=1282]="INVALID_OPERATION",_b[_b.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",_b[_b.CW=2304]="CW",_b[_b.CCW=2305]="CCW",_b[_b.LINE_WIDTH=2849]="LINE_WIDTH",_b[_b.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",_b[_b.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",_b[_b.CULL_FACE_MODE=2885]="CULL_FACE_MODE",_b[_b.FRONT_FACE=2886]="FRONT_FACE",_b[_b.DEPTH_RANGE=2928]="DEPTH_RANGE",_b[_b.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",_b[_b.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",_b[_b.DEPTH_FUNC=2932]="DEPTH_FUNC",_b[_b.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",_b[_b.STENCIL_FUNC=2962]="STENCIL_FUNC",_b[_b.STENCIL_FAIL=2964]="STENCIL_FAIL",_b[_b.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",_b[_b.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",_b[_b.STENCIL_REF=2967]="STENCIL_REF",_b[_b.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",_b[_b.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",_b[_b.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",_b[_b.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",_b[_b.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",_b[_b.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",_b[_b.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",_b[_b.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",_b[_b.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",_b[_b.VIEWPORT=2978]="VIEWPORT",_b[_b.SCISSOR_BOX=3088]="SCISSOR_BOX",_b[_b.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",_b[_b.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",_b[_b.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",_b[_b.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",_b[_b.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",_b[_b.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",_b[_b.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",_b[_b.RED_BITS=3410]="RED_BITS",_b[_b.GREEN_BITS=3411]="GREEN_BITS",_b[_b.BLUE_BITS=3412]="BLUE_BITS",_b[_b.ALPHA_BITS=3413]="ALPHA_BITS",_b[_b.DEPTH_BITS=3414]="DEPTH_BITS",_b[_b.STENCIL_BITS=3415]="STENCIL_BITS",_b[_b.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",_b[_b.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",_b[_b.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",_b[_b.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",_b[_b.SAMPLES=32937]="SAMPLES",_b[_b.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",_b[_b.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",_b[_b.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",_b[_b.DONT_CARE=4352]="DONT_CARE",_b[_b.FASTEST=4353]="FASTEST",_b[_b.NICEST=4354]="NICEST",_b[_b.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",_b[_b.BYTE=5120]="BYTE",_b[_b.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",_b[_b.SHORT=5122]="SHORT",_b[_b.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",_b[_b.INT=5124]="INT",_b[_b.UNSIGNED_INT=5125]="UNSIGNED_INT",_b[_b.FLOAT=5126]="FLOAT",_b[_b.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",_b[_b.ALPHA=6406]="ALPHA",_b[_b.RGB=6407]="RGB",_b[_b.RGBA=6408]="RGBA",_b[_b.LUMINANCE=6409]="LUMINANCE",_b[_b.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",_b[_b.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",_b[_b.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",_b[_b.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",_b[_b.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",_b[_b.VERTEX_SHADER=35633]="VERTEX_SHADER",_b[_b.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",_b[_b.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",_b[_b.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",_b[_b.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",_b[_b.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",_b[_b.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",_b[_b.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",_b[_b.SHADER_TYPE=35663]="SHADER_TYPE",_b[_b.DELETE_STATUS=35712]="DELETE_STATUS",_b[_b.LINK_STATUS=35714]="LINK_STATUS",_b[_b.VALIDATE_STATUS=35715]="VALIDATE_STATUS",_b[_b.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",_b[_b.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",_b[_b.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",_b[_b.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",_b[_b.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",_b[_b.NEVER=512]="NEVER",_b[_b.LESS=513]="LESS",_b[_b.EQUAL=514]="EQUAL",_b[_b.LEQUAL=515]="LEQUAL",_b[_b.GREATER=516]="GREATER",_b[_b.NOTEQUAL=517]="NOTEQUAL",_b[_b.GEQUAL=518]="GEQUAL",_b[_b.ALWAYS=519]="ALWAYS",_b[_b.KEEP=7680]="KEEP",_b[_b.REPLACE=7681]="REPLACE",_b[_b.INCR=7682]="INCR",_b[_b.DECR=7683]="DECR",_b[_b.INVERT=5386]="INVERT",_b[_b.INCR_WRAP=34055]="INCR_WRAP",_b[_b.DECR_WRAP=34056]="DECR_WRAP",_b[_b.VENDOR=7936]="VENDOR",_b[_b.RENDERER=7937]="RENDERER",_b[_b.VERSION=7938]="VERSION",_b[_b.NEAREST=9728]="NEAREST",_b[_b.LINEAR=9729]="LINEAR",_b[_b.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",_b[_b.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",_b[_b.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",_b[_b.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",_b[_b.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",_b[_b.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",_b[_b.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",_b[_b.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",_b[_b.TEXTURE_2D=3553]="TEXTURE_2D",_b[_b.TEXTURE=5890]="TEXTURE",_b[_b.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",_b[_b.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",_b[_b.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",_b[_b.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",_b[_b.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",_b[_b.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",_b[_b.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",_b[_b.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",_b[_b.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",_b[_b.TEXTURE0=33984]="TEXTURE0",_b[_b.TEXTURE1=33985]="TEXTURE1",_b[_b.TEXTURE2=33986]="TEXTURE2",_b[_b.TEXTURE3=33987]="TEXTURE3",_b[_b.TEXTURE4=33988]="TEXTURE4",_b[_b.TEXTURE5=33989]="TEXTURE5",_b[_b.TEXTURE6=33990]="TEXTURE6",_b[_b.TEXTURE7=33991]="TEXTURE7",_b[_b.TEXTURE8=33992]="TEXTURE8",_b[_b.TEXTURE9=33993]="TEXTURE9",_b[_b.TEXTURE10=33994]="TEXTURE10",_b[_b.TEXTURE11=33995]="TEXTURE11",_b[_b.TEXTURE12=33996]="TEXTURE12",_b[_b.TEXTURE13=33997]="TEXTURE13",_b[_b.TEXTURE14=33998]="TEXTURE14",_b[_b.TEXTURE15=33999]="TEXTURE15",_b[_b.TEXTURE16=34e3]="TEXTURE16",_b[_b.TEXTURE17=34001]="TEXTURE17",_b[_b.TEXTURE18=34002]="TEXTURE18",_b[_b.TEXTURE19=34003]="TEXTURE19",_b[_b.TEXTURE20=34004]="TEXTURE20",_b[_b.TEXTURE21=34005]="TEXTURE21",_b[_b.TEXTURE22=34006]="TEXTURE22",_b[_b.TEXTURE23=34007]="TEXTURE23",_b[_b.TEXTURE24=34008]="TEXTURE24",_b[_b.TEXTURE25=34009]="TEXTURE25",_b[_b.TEXTURE26=34010]="TEXTURE26",_b[_b.TEXTURE27=34011]="TEXTURE27",_b[_b.TEXTURE28=34012]="TEXTURE28",_b[_b.TEXTURE29=34013]="TEXTURE29",_b[_b.TEXTURE30=34014]="TEXTURE30",_b[_b.TEXTURE31=34015]="TEXTURE31",_b[_b.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",_b[_b.REPEAT=10497]="REPEAT",_b[_b.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",_b[_b.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",_b[_b.FLOAT_VEC2=35664]="FLOAT_VEC2",_b[_b.FLOAT_VEC3=35665]="FLOAT_VEC3",_b[_b.FLOAT_VEC4=35666]="FLOAT_VEC4",_b[_b.INT_VEC2=35667]="INT_VEC2",_b[_b.INT_VEC3=35668]="INT_VEC3",_b[_b.INT_VEC4=35669]="INT_VEC4",_b[_b.BOOL=35670]="BOOL",_b[_b.BOOL_VEC2=35671]="BOOL_VEC2",_b[_b.BOOL_VEC3=35672]="BOOL_VEC3",_b[_b.BOOL_VEC4=35673]="BOOL_VEC4",_b[_b.FLOAT_MAT2=35674]="FLOAT_MAT2",_b[_b.FLOAT_MAT3=35675]="FLOAT_MAT3",_b[_b.FLOAT_MAT4=35676]="FLOAT_MAT4",_b[_b.SAMPLER_2D=35678]="SAMPLER_2D",_b[_b.SAMPLER_CUBE=35680]="SAMPLER_CUBE",_b[_b.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",_b[_b.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",_b[_b.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",_b[_b.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",_b[_b.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",_b[_b.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",_b[_b.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",_b[_b.COMPILE_STATUS=35713]="COMPILE_STATUS",_b[_b.LOW_FLOAT=36336]="LOW_FLOAT",_b[_b.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",_b[_b.HIGH_FLOAT=36338]="HIGH_FLOAT",_b[_b.LOW_INT=36339]="LOW_INT",_b[_b.MEDIUM_INT=36340]="MEDIUM_INT",_b[_b.HIGH_INT=36341]="HIGH_INT",_b[_b.FRAMEBUFFER=36160]="FRAMEBUFFER",_b[_b.RENDERBUFFER=36161]="RENDERBUFFER",_b[_b.RGBA4=32854]="RGBA4",_b[_b.RGB5_A1=32855]="RGB5_A1",_b[_b.RGB565=36194]="RGB565",_b[_b.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",_b[_b.STENCIL_INDEX=6401]="STENCIL_INDEX",_b[_b.STENCIL_INDEX8=36168]="STENCIL_INDEX8",_b[_b.DEPTH_STENCIL=34041]="DEPTH_STENCIL",_b[_b.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",_b[_b.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",_b[_b.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",_b[_b.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",_b[_b.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",_b[_b.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",_b[_b.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",_b[_b.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",_b[_b.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",_b[_b.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",_b[_b.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",_b[_b.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",_b[_b.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",_b[_b.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",_b[_b.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",_b[_b.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",_b[_b.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",_b[_b.NONE=0]="NONE",_b[_b.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",_b[_b.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",_b[_b.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",_b[_b.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",_b[_b.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",_b[_b.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",_b[_b.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",_b[_b.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",_b[_b.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",_b[_b.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",_b[_b.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",_b[_b.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",_b[_b.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",_b[_b.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL";var Ob,Rb,Lb,Nb,Db,jb,zb,Fb=(xb=Q(),wb=J(nr.IRendererService),Sb=J(nr.IGlobalConfigService),Eb=J(nr.IInteractionService),Ab=J(nr.ILayerService),xb((Mb=go((kb=function(){function t(){var e=this;Wi(this,t),vo(this,"rendererService",Mb,this),vo(this,"configService",Cb,this),vo(this,"interactionService",Ib,this),vo(this,"layerService",Pb,this),this.pickingFBO=void 0,this.width=0,this.height=0,this.alreadyInPicking=!1,this.pickBufferScale=1,this.pickFromPickingFBO=function(t,n){var r,i=n.x,o=n.y,a=n.lngLat,s=n.type,u=n.target,c=!1,l=e.rendererService,f=(l.getViewportSize,l.readPixels),h=(0,l.getContainer)().getBoundingClientRect(),d=h.width,p=h.height;d*=window.devicePixelRatio,p*=window.devicePixelRatio;var v,g=t.getLayerConfig(),m=g.enableHighlight,y=g.enableSelect,b=i*window.devicePixelRatio,_=o*window.devicePixelRatio;if(b>d-1*window.devicePixelRatio||b<0||_>p-1*window.devicePixelRatio||_<0)return!1;if(0!==(v=f({x:Math.floor(b/e.pickBufferScale),y:Math.floor((p-(o+1)*window.devicePixelRatio)/e.pickBufferScale),width:1,height:1,data:new Uint8Array(4),framebuffer:e.pickingFBO}))[0]||0!==v[1]||0!==v[2]){var x=qh(v),w=t.getSource().getFeatureById(x);x!==t.getCurrentPickId()&&"mousemove"===s&&(s="mouseenter");var S={x:i,y:o,type:s,lngLat:a,featureId:x,feature:w,target:u};w&&(c=!0,t.setCurrentPickId(x),e.triggerHoverOnLayer(t,S))}else{var E={x:i,y:o,lngLat:a,type:null!==t.getCurrentPickId()&&"mousemove"===s?"mouseout":"un"+s,featureId:null,target:u,feature:null};e.triggerHoverOnLayer(t,Qi(Qi({},E),{},{type:"unpick"})),e.triggerHoverOnLayer(t,E),t.setCurrentPickId(null)}if(m&&e.highlightPickedFeature(t,v),y&&"click"===s&&(null===(r=v)||void 0===r?void 0:r.toString())!==[0,0,0,0].toString()){var A=qh(v);null===t.getCurrentSelectedId()||A!==t.getCurrentSelectedId()?(e.selectFeature(t,v),t.setCurrentSelectedId(A)):(e.selectFeature(t,new Uint8Array([0,0,0,0])),t.setCurrentSelectedId(null))}return c}}var n,r;return Xi(t,[{key:"init",value:function(t){var n=this.rendererService,r=n.createTexture2D,i=n.createFramebuffer,o=(n.getViewportSize,(0,n.getContainer)().getBoundingClientRect()),a=o.width,s=o.height;a*=window.devicePixelRatio,s*=window.devicePixelRatio,this.pickBufferScale=this.configService.getSceneConfig(t).pickBufferScale||1,this.pickingFBO=i({color:r({width:Math.round(a/this.pickBufferScale),height:Math.round(s/this.pickBufferScale),wrapS:e.gl.CLAMP_TO_EDGE,wrapT:e.gl.CLAMP_TO_EDGE})}),this.interactionService.on(e.InteractionEvent.Hover,this.pickingAllLayer.bind(this))}},{key:"pickingAllLayer",value:(r=Zi(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.alreadyInPicking&&!this.layerService.alreadyInRendering){e.next=2;break}return e.abrupt("return");case 2:return this.alreadyInPicking=!0,e.next=5,this.pickingLayers(t);case 5:this.layerService.renderLayers(),this.alreadyInPicking=!1;case 7:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"pickingLayers",value:(n=Zi(regeneratorRuntime.mark((function e(t){var n,r,i,o,a,s,u,c=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(n=this.rendererService).getViewportSize,r=n.useFramebuffer,i=n.clear,o=n.getContainer,a=o().getBoundingClientRect(),s=a.width,u=a.height,s*=window.devicePixelRatio,u*=window.devicePixelRatio,this.width===s&&this.height===u||(this.pickingFBO.resize({width:Math.round(s/this.pickBufferScale),height:Math.round(u/this.pickBufferScale)}),this.width=s,this.height=u),r(this.pickingFBO,(function(){c.layerService.getLayers().filter((function(e){return e.needPick(t.type)})).reverse().some((function(e){return i({framebuffer:c.pickingFBO,color:[0,0,0,0],stencil:0,depth:1}),e.hooks.beforePickingEncode.call(),e.renderModels(),e.hooks.afterPickingEncode.call(),c.pickFromPickingFBO(e,t)&&!e.getLayerConfig().enablePropagation}))}));case 6:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"triggerHoverOnLayer",value:function(e,t){e.emit(t.type,t)}},{key:"highlightPickedFeature",value:function(e,t){var n=co(t,3),r=n[0],i=n[1],o=n[2];e.hooks.beforeHighlight.call([r,i,o])}},{key:"selectFeature",value:function(e,t){var n=co(t,3),r=n[0],i=n[1],o=n[2];e.hooks.beforeSelect.call([r,i,o])}}]),t}()).prototype,"rendererService",[wb],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Cb=go(kb.prototype,"configService",[Sb],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ib=go(kb.prototype,"interactionService",[Eb],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Pb=go(kb.prototype,"layerService",[Ab],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Tb=kb))||Tb),Bb=function(){function e(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];Wi(this,e),this.autoStart=void 0,this.startTime=0,this.oldTime=0,this.running=!1,this.elapsedTime=0,this.autoStart=t}return Xi(e,[{key:"start",value:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}},{key:"stop",value:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}},{key:"getElapsedTime",value:function(){return this.getDelta(),this.elapsedTime}},{key:"getDelta",value:function(){var e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var t=("undefined"==typeof performance?Date:performance).now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}]),e}(),Ub=(Ob=Q(),Rb=J(nr.IRendererService),Lb=J(nr.IGlobalConfigService),Ob((jb=go((Db=function(){function e(){Wi(this,e),this.clock=new Bb,this.alreadyInRendering=!1,this.layers=[],this.layerRenderID=void 0,this.sceneInited=!1,this.animateInstanceCount=0,vo(this,"renderService",jb,this),vo(this,"configService",zb,this)}return Xi(e,[{key:"add",value:function(e){this.sceneInited&&e.init(),this.layers.push(e)}},{key:"initLayers",value:function(){this.sceneInited=!0,this.layers.forEach((function(e){e.inited||e.init()}))}},{key:"getLayers",value:function(){return this.layers}},{key:"getLayer",value:function(e){return this.layers.find((function(t){return t.id===e}))}},{key:"getLayerByName",value:function(e){return this.layers.find((function(t){return t.name===e}))}},{key:"remove",value:function(e){var t=this.layers.indexOf(e);t>-1&&this.layers.splice(t,1),e.emit("remove",null),e.destroy(),this.renderLayers()}},{key:"removeAllLayers",value:function(){this.destroy()}},{key:"renderLayers",value:function(){this.alreadyInRendering||(this.alreadyInRendering=!0,this.clear(),this.updateRenderOrder(),this.layers.filter((function(e){return e.inited})).filter((function(e){return e.isVisible()})).forEach((function(e){e.hooks.beforeRenderData.call(),e.hooks.beforeRender.call(),e.render(),e.hooks.afterRender.call()})),this.alreadyInRendering=!1)}},{key:"updateRenderOrder",value:function(){this.layers.sort((function(e,t){return e.zIndex-t.zIndex}))}},{key:"destroy",value:function(){this.layers.forEach((function(e){return e.destroy()})),this.layers=[],this.renderLayers()}},{key:"startAnimate",value:function(){0==this.animateInstanceCount++&&(this.clock.start(),this.runRender())}},{key:"stopAnimate",value:function(){0==--this.animateInstanceCount&&(this.stopRender(),this.clock.stop())}},{key:"clear",value:function(){this.renderService.clear({color:[0,0,0,0],depth:1,stencil:0,framebuffer:null})}},{key:"runRender",value:function(){this.renderLayers(),this.layerRenderID=requestAnimationFrame(this.runRender.bind(this))}},{key:"stopRender",value:function(){cancelAnimationFrame(this.layerRenderID)}}]),e}()).prototype,"renderService",[Rb],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),zb=go(Db.prototype,"configService",[Lb],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Nb=Db))||Nb),Vb=Du.left,Gb=vr("reduce"),Hb=br("reduce",{1:0});Pt({target:"Array",proto:!0,forced:!Gb||!Hb||!Fd&&ur>79&&ur<83},{reduce:function(e){return Vb(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}});var Zb=lr("slice"),Wb=br("slice",{ACCESSORS:!0,0:0,1:2}),qb=Qt("species"),Xb=[].slice,Yb=Math.max;Pt({target:"Array",proto:!0,forced:!Zb||!Wb},{slice:function(e,t){var n,r,i,o=ge(this),a=ct(o.length),s=ht(e,a),u=ht(void 0===t?a:t,a);if(Lt(o)&&("function"!=typeof(n=o.constructor)||n!==Array&&!Lt(n.prototype)?me(n)&&null===(n=n[qb])&&(n=void 0):n=void 0,n===Array||void 0===n))return Xb.call(o,s,u);for(r=new(void 0===n?Array:n)(Yb(u-s,0)),i=0;s<u;s++,i++)s in o&&rr(r,i,o[s]);return r.length=i,r}}),Pt({target:"Object",stat:!0,forced:Object.assign!==vc},{assign:vc});var Kb,Qb,Jb,$b,e_,t_,n_=function(e){return null==e},r_=function(){function e(t){var n=this;Wi(this,e),this.name=void 0,this.type=void 0,this.scale=void 0,this.descriptor=void 0,this.featureBufferLayout=[],this.needRescale=!1,this.needRemapping=!1,this.needRegenerateVertices=!1,this.featureRange={startIndex:0,endIndex:1/0},this.vertexAttribute=void 0,this.defaultCallback=function(e){var t;return 0===e.length?(null===(t=n.scale)||void 0===t?void 0:t.defaultValues)||[]:e.map((function(e,t){var r;return(null===(r=n.scale)||void 0===r?void 0:r.scalers[t].func)(e)}))},this.setProps(t)}return Xi(e,[{key:"setProps",value:function(e){Object.assign(this,e)}},{key:"mapping",value:function(e){var t;if(null===(t=this.scale)||void 0===t?void 0:t.callback){var n,r=null===(n=this.scale)||void 0===n?void 0:n.callback.apply(n,lo(e));if(!n_(r))return[r]}return this.defaultCallback(e)}},{key:"resetDescriptor",value:function(){this.descriptor&&(this.descriptor.buffer.data=[])}}]),e}(),i_=(Yi(Kb={},e.gl.FLOAT,4),Yi(Kb,e.gl.UNSIGNED_BYTE,1),Yi(Kb,e.gl.UNSIGNED_SHORT,2),Kb),o_=(Qb=Q(),Jb=J(nr.IRendererService),Qb((t_=go((e_=function(){function t(){Wi(this,t),this.attributesAndIndices=void 0,vo(this,"rendererService",t_,this),this.attributes=[],this.triangulation=void 0,this.featureLayout={sizePerElement:0,elements:[]}}return Xi(t,[{key:"registerStyleAttribute",value:function(e){var t=this.getLayerStyleAttribute(e.name||"");return t?t.setProps(e):(t=new r_(e),this.attributes.push(t)),t}},{key:"updateStyleAttribute",value:function(e,t,n){var r=this.getLayerStyleAttribute(e);r||(r=this.registerStyleAttribute(Qi(Qi({},t),{},{name:e})));var i=t.scale;i&&r&&(r.scale=i,r.needRescale=!0,r.needRemapping=!0,r.needRegenerateVertices=!0,n&&n.featureRange&&(r.featureRange=n.featureRange))}},{key:"getLayerStyleAttributes",value:function(){return this.attributes}},{key:"getLayerStyleAttribute",value:function(e){return this.attributes.find((function(t){return t.name===e}))}},{key:"getLayerAttributeScale",value:function(e){var t,n=this.getLayerStyleAttribute(e),r=null==n||null===(t=n.scale)||void 0===t?void 0:t.scalers;return r&&r[0]?r[0].func:null}},{key:"updateAttributeByFeatureRange",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0,o=this.attributes.find((function(e){return e.name===t}));if(o&&o.descriptor){var a=o.descriptor,s=a.update,u=a.buffer,c=a.size,l=void 0===c?0:c,f=i_[u.type||e.gl.FLOAT];if(s){var h=this.featureLayout,d=h.elements,p=h.sizePerElement,v=d.slice(r,i);if(!v.length)return;var g=v[0].offset,m=g*l*f,y=v.map((function(e,t){for(var r=e.featureIdx,i=e.vertices,o=e.normals,a=i.length/p,u=[],c=0;c<a;c++){var l=o?o.slice(3*c,3*c+3):[];u.push.apply(u,lo(s(n[r],r,i.slice(c*p,c*p+p),t,l)))}return u})).reduce((function(e,t){return e.push.apply(e,lo(t)),e}),[]);o.vertexAttribute.updateBuffer({data:y,offset:m})}}}},{key:"createAttributesAndIndices",value:function(t,n){var r=this;this.featureLayout={sizePerElement:0,elements:[]},n&&(this.triangulation=n);var i=this.attributes.map((function(e){return e.resetDescriptor(),e.descriptor})),o=0,a=[],s=3;t.forEach((function(e,t){var n=r.triangulation(e),u=n.indices,c=n.vertices,l=n.normals,f=n.size;u.forEach((function(e){a.push(e+o)})),s=f;var h=c.length/f;r.featureLayout.sizePerElement=s,r.featureLayout.elements.push({featureIdx:t,vertices:c,normals:l,offset:o}),o+=h;for(var d=function(n){var r=(null==l?void 0:l.slice(3*n,3*n+3))||[],o=c.slice(n*f,n*f+f);i.forEach((function(i,a){var s;i&&i.update&&(s=i.buffer.data).push.apply(s,lo(i.update(e,t,o,n,r)))}))},p=0;p<h;p++)d(p)}));var u=this.rendererService,c=u.createAttribute,l=u.createBuffer,f=u.createElements,h={};i.forEach((function(e,t){if(e){var n=e.buffer,i=(e.update,e.name,io(e,["buffer","update","name"])),o=c(Qi({buffer:l(n)},i));h[e.name||""]=o,r.attributes[t].vertexAttribute=o}}));var d=f({data:a,type:e.gl.UNSIGNED_INT,count:a.length});return this.attributesAndIndices={attributes:h,elements:d},this.attributesAndIndices}},{key:"clearAllAttributes",value:function(){var e;this.attributes.forEach((function(e){e.vertexAttribute&&e.vertexAttribute.destroy()})),null===(e=this.attributesAndIndices)||void 0===e||e.elements.destroy(),this.attributes=[]}}]),t}()).prototype,"rendererService",[Jb],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),$b=e_))||$b);function a_(e){return(a_="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)}var s_={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"===("undefined"==typeof process?"undefined":a_(process))&&process},u_=s_.window||s_.self||s_.global,c_=s_.process||{},l_="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",f_=!("object"===("undefined"==typeof process?"undefined":a_(process))&&"[object process]"===String(process)&&!process.browser)||function(e){if("undefined"!=typeof window&&"object"===a_(window.process)&&"renderer"===window.process.type)return!0;if("undefined"!=typeof process&&"object"===a_(process.versions)&&Boolean(process.versions.electron))return!0;var t="object"===("undefined"==typeof navigator?"undefined":a_(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,n=e||t;return!!(n&&n.indexOf("Electron")>=0)}();function h_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function d_(e,t){if(e){if("string"==typeof e)return h_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h_(e,t):void 0}}function p_(e){return function(e){if(Array.isArray(e))return h_(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||d_(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 v_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g_(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function m_(e,t,n){return t&&g_(e.prototype,t),n&&g_(e,n),e}function y_(e){try{var t=window[e],n="__storage_test__";return t.setItem(n,n),t.removeItem(n),t}catch(e){return null}}var b_=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";v_(this,e),this.storage=y_(r),this.id=t,this.config={},Object.assign(this.config,n),this._loadConfiguration()}return m_(e,[{key:"getConfiguration",value:function(){return this.config}},{key:"setConfiguration",value:function(e){return this.config={},this.updateConfiguration(e)}},{key:"updateConfiguration",value:function(e){if(Object.assign(this.config,e),this.storage){var t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}},{key:"_loadConfiguration",value:function(){var e={};if(this.storage){var t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}]),e}();function __(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,i=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>r&&(n=Math.min(n,r/e.width));var o=e.width*n,a=e.height*n,s=["font-size:1px;","padding:".concat(Math.floor(a/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(a,"px;"),"background:url(".concat(i,");"),"background-size:".concat(o,"px ").concat(a,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var x_={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function w_(e){return"string"==typeof e?x_[e.toUpperCase()]||x_.WHITE:e}function S_(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=function(e,t){if(!e)return;if("string"==typeof e)return E_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return E_(e,t)}(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,o=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw i}}}}function E_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function A_(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(r),o=S_(i);try{var a=function(){var r=t.value;"function"==typeof e[r]&&(n.find((function(e){return r===e}))||(e[r]=e[r].bind(e)))};for(o.s();!(t=o.n()).done;)a()}catch(e){o.e(e)}finally{o.f()}}function T_(e,t){if(!e)throw new Error(t||"Assertion failed")}function k_(){var e;if(f_&&u_.performance)e=u_.performance.now();else if(c_.hrtime){var t=c_.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}var M_={debug:f_&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},C_={enabled:!0,level:0};function I_(){}var P_={},O_={once:!0};function R_(e){for(var t in e)for(var n in e[t])return n||"untitled";return"empty"}var L_,N_=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.id;v_(this,e),this.id=n,this.VERSION=l_,this._startTs=k_(),this._deltaTs=k_(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new b_("__probe-".concat(this.id,"__"),C_),this.userData={},this.timeStamp("".concat(this.id," started")),A_(this),Object.seal(this)}return m_(e,[{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getLevel",value:function(){return this._storage.config.level}},{key:"getTotal",value:function(){return Number((k_()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((k_()-this._deltaTs).toPrecision(10))}},{key:"getPriority",value:function(){return this.level}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:e}),this}},{key:"setLevel",value:function(e){return this._storage.updateConfiguration({level:e}),this}},{key:"assert",value:function(e,t){T_(e,t)}},{key:"warn",value:function(e){return this._getLogFunction(0,e,M_.warn,arguments,O_)}},{key:"error",value:function(e){return this._getLogFunction(0,e,M_.error,arguments)}},{key:"deprecated",value:function(e,t){return this.warn("`".concat(e,"` is deprecated and will be removed in a later version. Use `").concat(t,"` instead"))}},{key:"removed",value:function(e,t){return this.error("`".concat(e,"` has been removed. Use `").concat(t,"` instead"))}},{key:"probe",value:function(e,t){return this._getLogFunction(e,t,M_.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(e,t){return this._getLogFunction(e,t,M_.debug,arguments)}},{key:"info",value:function(e,t){return this._getLogFunction(e,t,console.info,arguments)}},{key:"once",value:function(e,t){return this._getLogFunction(e,t,M_.debug||M_.info,arguments,O_)}},{key:"table",value:function(e,t,n){return t?this._getLogFunction(e,t,console.table||I_,n&&[n],{tag:R_(t)}):I_}},{key:"image",value:function(e){var t=e.logLevel,n=e.priority,r=e.image,i=e.message,o=void 0===i?"":i,a=e.scale,s=void 0===a?1:a;return this._shouldLog(t||n)?f_?function(e){var t=e.image,n=e.message,r=void 0===n?"":n,i=e.scale,o=void 0===i?1:i;if("string"==typeof t){var a=new Image;return a.onload=function(){var e,t=__(a,r,o);(e=console).log.apply(e,p_(t))},a.src=t,I_}var s=t.nodeName||"";if("img"===s.toLowerCase()){var u;return(u=console).log.apply(u,p_(__(t,r,o))),I_}if("canvas"===s.toLowerCase()){var c=new Image;return c.onload=function(){var e;return(e=console).log.apply(e,p_(__(c,r,o)))},c.src=t.toDataURL(),I_}return I_}({image:r,message:o,scale:s}):function(e){var t=e.image,n=(e.message,e.scale),r=void 0===n?1:n,i=null;try{i=module.require("asciify-image")}catch(e){}if(i)return function(){return i(t,{fit:"box",width:"".concat(Math.round(80*r),"%")}).then((function(e){return console.log(e)}))};return I_}({image:r,message:o,scale:s}):I_}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"get",value:function(e){return this._storage.config[e]}},{key:"set",value:function(e,t){this._storage.updateConfiguration(function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},e,t))}},{key:"time",value:function(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}},{key:"timeEnd",value:function(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}},{key:"timeStamp",value:function(e,t){return this._getLogFunction(e,t,console.timeStamp||I_)}},{key:"group",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},r=n=j_({logLevel:e,message:t,opts:n}),i=r.collapsed;return n.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}},{key:"groupCollapsed",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(e,t,Object.assign({},n,{collapsed:!0}))}},{key:"groupEnd",value:function(e){return this._getLogFunction(e,"",console.groupEnd||I_)}},{key:"withGroup",value:function(e,t,n){this.group(e,t)();try{n()}finally{this.groupEnd(e)()}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(e){return this.isEnabled()&&this.getLevel()>=D_(e)}},{key:"_getLogFunction",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4?arguments[4]:void 0;if(this._shouldLog(e)){var o;i=j_({logLevel:e,message:t,args:r,opts:i}),T_(n=n||i.method),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=k_();var a=i.tag||i.message;if(i.once){if(P_[a])return I_;P_[a]=k_()}return t=z_(this.id,i.message,i),(o=n).bind.apply(o,[console,t].concat(p_(i.args)))}return I_}},{key:"level",set:function(e){this.setLevel(e)},get:function(){return this.getLevel()}},{key:"priority",set:function(e){this.level=e},get:function(){return this.level}}]),e}();function D_(e){if(!e)return 0;var t;switch(a_(e)){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return T_(Number.isFinite(t)&&t>=0),t}function j_(e){var t=e.logLevel,n=e.message;e.logLevel=D_(t);for(var r=e.args?Array.from(e.args):[];r.length&&r.shift()!==n;);switch(e.args=r,a_(t)){case"string":case"function":void 0!==n&&r.unshift(n),e.message=t;break;case"object":Object.assign(e,t)}"function"==typeof e.message&&(e.message=e.message());var i=a_(e.message);return T_("string"===i||"object"===i),Object.assign(e,e.opts)}function z_(e,t,n){if("string"==typeof t){var r=n.time?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=Math.max(t-e.length,0);return"".concat(" ".repeat(n)).concat(e)}((i=n.total)<10?"".concat(i.toFixed(2),"ms"):i<100?"".concat(i.toFixed(1),"ms"):i<1e3?"".concat(i.toFixed(0),"ms"):"".concat((i/1e3).toFixed(2),"s")):"";t=function(e,t,n){return f_||"string"!=typeof e||(t&&(t=w_(t),e="[".concat(t,"m").concat(e,"[39m")),n&&(t=w_(n),e="[".concat(n+10,"m").concat(e,"[49m"))),e}(t=n.time?"".concat(e,": ").concat(r," ").concat(t):"".concat(e,": ").concat(t),n.color,n.background)}var i;return t}N_.VERSION=l_;var F_=new N_({id:"L7"}).enable(!1);F_.priority=5;var B_=Q()(L_=function(){function e(){Wi(this,e)}return Xi(e,[{key:"error",value:function(e){F_.error(e)()}},{key:"warn",value:function(e){F_.probe(1,e)()}},{key:"info",value:function(e){F_.info(3,e)()}},{key:"debug",value:function(e){F_.probe(4,e)()}}]),e}())||L_; |