MCPcopy Create free account
hub / github.com/MankaiHuang/screen-visualization / aD

Function aD

public/iframe/lib/js/L7-min.js:42–42  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

40 *
41 * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
42 * @license MIT
43 */
44function t(e,t){if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0}function n(e){return r.Buffer&&"function"==typeof r.Buffer.isBuffer?r.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}var i=Object.prototype.hasOwnProperty,o=Array.prototype.slice,a="foo"===function(){}.name;function s(e){return Object.prototype.toString.call(e)}function u(e){return!n(e)&&("function"==typeof r.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}var c=e.exports=v,l=/\s*function\s+([^\(\s]*)\s*/;function f(e){if(HC.isFunction(e)){if(a)return e.name;var t=e.toString().match(l);return t&&t[1]}}function h(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function d(e){if(a||!HC.isFunction(e))return HC.inspect(e);var t=f(e);return"[Function"+(t?": "+t:"")+"]"}function p(e,t,n,r,i){throw new c.AssertionError({message:n,actual:e,expected:t,operator:r,stackStartFunction:i})}function v(e,t){e||p(e,!0,t,"==",c.ok)}function g(e,r,i,a){if(e===r)return!0;if(n(e)&&n(r))return 0===t(e,r);if(HC.isDate(e)&&HC.isDate(r))return e.getTime()===r.getTime();if(HC.isRegExp(e)&&HC.isRegExp(r))return e.source===r.source&&e.global===r.global&&e.multiline===r.multiline&&e.lastIndex===r.lastIndex&&e.ignoreCase===r.ignoreCase;if(null!==e&&"object"==typeof e||null!==r&&"object"==typeof r){if(u(e)&&u(r)&&s(e)===s(r)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===t(new Uint8Array(e.buffer),new Uint8Array(r.buffer));if(n(e)!==n(r))return!1;var c=(a=a||{actual:[],expected:[]}).actual.indexOf(e);return-1!==c&&c===a.expected.indexOf(r)||(a.actual.push(e),a.expected.push(r),function(e,t,n,r){if(null==e||null==t)return!1;if(HC.isPrimitive(e)||HC.isPrimitive(t))return e===t;if(n&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var i=m(e),a=m(t);if(i&&!a||!i&&a)return!1;if(i)return e=o.call(e),t=o.call(t),g(e,t,n);var s,u,c=_(e),l=_(t);if(c.length!==l.length)return!1;for(c.sort(),l.sort(),u=c.length-1;u>=0;u--)if(c[u]!==l[u])return!1;for(u=c.length-1;u>=0;u--)if(s=c[u],!g(e[s],t[s],n,r))return!1;return!0}(e,r,i,a))}return i?e===r:e==r}function m(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function y(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function b(e,t,n,r){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof n&&(r=n,n=null),i=function(e){var t;try{e()}catch(e){t=e}return t}(t),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!i&&p(i,n,"Missing expected exception"+r);var o="string"==typeof r,a=!e&&i&&!n;if((!e&&HC.isError(i)&&o&&y(i,n)||a)&&p(i,n,"Got unwanted exception"+r),e&&i&&n&&!y(i,n)||!e&&i)throw i}c.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return h(d(e.actual),128)+" "+e.operator+" "+h(d(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||p;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var n=new Error;if(n.stack){var r=n.stack,i=f(t),o=r.indexOf("\n"+i);if(o>=0){var a=r.indexOf("\n",o+1);r=r.substring(a+1)}this.stack=r}}},HC.inherits(c.AssertionError,Error),c.fail=p,c.ok=v,c.equal=function(e,t,n){e!=t&&p(e,t,n,"==",c.equal)},c.notEqual=function(e,t,n){e==t&&p(e,t,n,"!=",c.notEqual)},c.deepEqual=function(e,t,n){g(e,t,!1)||p(e,t,n,"deepEqual",c.deepEqual)},c.deepStrictEqual=function(e,t,n){g(e,t,!0)||p(e,t,n,"deepStrictEqual",c.deepStrictEqual)},c.notDeepEqual=function(e,t,n){g(e,t,!1)&&p(e,t,n,"notDeepEqual",c.notDeepEqual)},c.notDeepStrictEqual=function e(t,n,r){g(t,n,!0)&&p(t,n,r,"notDeepStrictEqual",e)},c.strictEqual=function(e,t,n){e!==t&&p(e,t,n,"===",c.strictEqual)},c.notStrictEqual=function(e,t,n){e===t&&p(e,t,n,"!==",c.notStrictEqual)},c.throws=function(e,t,n){b(!0,e,t,n)},c.doesNotThrow=function(e,t,n){b(!1,e,t,n)},c.ifError=function(e){if(e)throw e},c.strict=UC((function e(t,n){t||p(t,!0,n,"==",e)}),c,{equal:c.strictEqual,deepEqual:c.deepStrictEqual,notEqual:c.notStrictEqual,notDeepEqual:c.notDeepStrictEqual}),c.strict.strict=c.strict;var _=Object.keys||function(e){var t=[];for(var n in e)i.call(e,n)&&t.push(n);return t}}))),WC=o((function(e,t){var n=/^\[object .+?Constructor\]$/,i=/^(?:0|[1-9]\d*)$/,o={};o["[object Float32Array]"]=o["[object Float64Array]"]=o["[object Int8Array]"]=o["[object Int16Array]"]=o["[object Int32Array]"]=o["[object Uint8Array]"]=o["[object Uint8ClampedArray]"]=o["[object Uint16Array]"]=o["[object Uint32Array]"]=!0,o["[object Arguments]"]=o["[object Array]"]=o["[object ArrayBuffer]"]=o["[object Boolean]"]=o["[object DataView]"]=o["[object Date]"]=o["[object Error]"]=o["[object Function]"]=o["[object Map]"]=o["[object Number]"]=o["[object Object]"]=o["[object RegExp]"]=o["[object Set]"]=o["[object String]"]=o["[object WeakMap]"]=!1;var a="object"==typeof r&&r&&r.Object===Object&&r,s="object"==typeof self&&self&&self.Object===Object&&self,u=a||s||Function("return this")(),c=t&&!t.nodeType&&t,l=c&&e&&!e.nodeType&&e,f=l&&l.exports===c,h=f&&a.process,d=function(){try{var e=l&&l.require&&l.require("util").types;return e||h&&h.binding&&h.binding("util")}catch(e){}}(),p=d&&d.isTypedArray;function v(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var g=Array.prototype,m=Function.prototype,y=Object.prototype,b=u["__core-js_shared__"],_=m.toString,x=y.hasOwnProperty,w=function(){var e=/[^.]+$/.exec(b&&b.keys&&b.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),S=y.toString,E=_.call(Object),A=RegExp("^"+_.call(x).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),T=f?u.Buffer:void 0,k=u.Symbol,M=u.Uint8Array,C=T?T.allocUnsafe:void 0,I=function(e,t){return function(n){return e(t(n))}}(Object.getPrototypeOf,Object),P=Object.create,O=y.propertyIsEnumerable,R=g.splice,L=k?k.toStringTag:void 0,N=function(){try{var e=ae(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),D=T?T.isBuffer:void 0,j=Math.max,z=Date.now,F=ae(u,"Map"),B=ae(Object,"create"),U=function(){function e(){}return function(t){if(!xe(t))return{};if(P)return P(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function V(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function G(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function H(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Z(e){var t=this.__data__=new G(e);this.size=t.size}function W(e,t){var n=ge(e),r=!n&&ve(e),i=!n&&!r&&ye(e),o=!n&&!r&&!i&&Se(e),a=n||r||i||o,s=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],u=s.length;for(var c in e)!t&&!x.call(e,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||se(c,u))||s.push(c);return s}function q(e,t,n){(void 0!==n&&!pe(e[t],n)||void 0===n&&!(t in e))&&K(e,t,n)}function X(e,t,n){var r=e[t];x.call(e,t)&&pe(r,n)&&(void 0!==n||t in e)||K(e,t,n)}function Y(e,t){for(var n=e.length;n--;)if(pe(e[n][0],t))return n;return-1}function K(e,t,n){"__proto__"==t&&N?N(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}V.prototype.clear=function(){this.__data__=B?B(null):{},this.size=0},V.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},V.prototype.get=function(e){var t=this.__data__;if(B){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return x.call(t,e)?t[e]:void 0},V.prototype.has=function(e){var t=this.__data__;return B?void 0!==t[e]:x.call(t,e)},V.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=B&&void 0===t?"__lodash_hash_undefined__":t,this},G.prototype.clear=function(){this.__data__=[],this.size=0},G.prototype.delete=function(e){var t=this.__data__,n=Y(t,e);return!(n<0)&&(n==t.length-1?t.pop():R.call(t,n,1),--this.size,!0)},G.prototype.get=function(e){var t=this.__data__,n=Y(t,e);return n<0?void 0:t[n][1]},G.prototype.has=function(e){return Y(this.__data__,e)>-1},G.prototype.set=function(e,t){var n=this.__data__,r=Y(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},H.prototype.clear=function(){this.size=0,this.__data__={hash:new V,map:new(F||G),string:new V}},H.prototype.delete=function(e){var t=oe(this,e).delete(e);return this.size-=t?1:0,t},H.prototype.get=function(e){return oe(this,e).get(e)},H.prototype.has=function(e){return oe(this,e).has(e)},H.prototype.set=function(e,t){var n=oe(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Z.prototype.clear=function(){this.__data__=new G,this.size=0},Z.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Z.prototype.get=function(e){return this.__data__.get(e)},Z.prototype.has=function(e){return this.__data__.has(e)},Z.prototype.set=function(e,t){var n=this.__data__;if(n instanceof G){var r=n.__data__;if(!F||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new H(r)}return n.set(e,t),this.size=n.size,this};var Q,J=function(e,t,n){for(var r=-1,i=Object(e),o=n(e),a=o.length;a--;){var s=o[Q?a:++r];if(!1===t(i[s],s,i))break}return e};function $(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":L&&L in Object(e)?function(e){var t=x.call(e,L),n=e[L];try{e[L]=void 0;var r=!0}catch(e){}var i=S.call(e);r&&(t?e[L]=n:delete e[L]);return i}(e):function(e){return S.call(e)}(e)}function ee(e){return we(e)&&"[object Arguments]"==$(e)}function te(e){return!(!xe(e)||(t=e,w&&w in t))&&(be(e)?A:n).test(function(e){if(null!=e){try{return _.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t}function ne(e){if(!xe(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=ue(e),n=[];for(var r in e)("constructor"!=r||!t&&x.call(e,r))&&n.push(r);return n}function re(e,t,n,r,i){e!==t&&J(t,(function(o,a){if(i||(i=new Z),xe(o))!function(e,t,n,r,i,o,a){var s=ce(e,n),u=ce(t,n),c=a.get(u);if(c)return void q(e,n,c);var l=o?o(s,u,n+"",e,t,a):void 0,f=void 0===l;if(f){var h=ge(u),d=!h&&ye(u),p=!h&&!d&&Se(u);l=u,h||d||p?ge(s)?l=s:we(m=s)&&me(m)?l=function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n<r;)t[n]=e[n];return t}(s):d?(f=!1,l=function(e,t){if(t)return e.slice();var n=e.length,r=C?C(n):new e.constructor(n);return e.copy(r),r}(u,!0)):p?(f=!1,v=u,g=!0?function(e){var t=new e.constructor(e.byteLength);return new M(t).set(new M(e)),t}(v.buffer):v.buffer,l=new v.constructor(g,v.byteOffset,v.length)):l=[]:function(e){if(!we(e)||"[object Object]"!=$(e))return!1;var t=I(e);if(null===t)return!0;var n=x.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&_.call(n)==E}(u)||ve(u)?(l=s,ve(s)?l=function(e){return function(e,t,n,r){var i=!n;n||(n={});var o=-1,a=t.length;for(;++o<a;){var s=t[o],u=r?r(n[s],e[s],s,n,e):void 0;void 0===u&&(u=e[s]),i?K(n,s,u):X(n,s,u)}return n}(e,Ee(e))}(s):xe(s)&&!be(s)||(l=function(e){return"function"!=typeof e.constructor||ue(e)?{}:U(I(e))}(u))):f=!1}var v,g;var m;f&&(a.set(u,l),i(l,u,r,o,a),a.delete(u));q(e,n,l)}(e,t,a,n,re,r,i);else{var s=r?r(ce(e,a),o,a+"",e,t,i):void 0;void 0===s&&(s=o),q(e,a,s)}}),Ee)}function ie(e,t){return de(function(e,t,n){return t=j(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=j(r.length-t,0),a=Array(o);++i<o;)a[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(a),v(e,this,s)}}(e,t,ke),e+"")}function oe(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function ae(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return te(n)?n:void 0}function se(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&i.test(e))&&e>-1&&e%1==0&&e<t}function ue(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||y)}function ce(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var le,fe,he,de=(le=N?function(e,t){return N(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:ke,fe=0,he=0,function(){var e=z(),t=16-(e-he);if(he=e,t>0){if(++fe>=800)return arguments[0]}else fe=0;return le.apply(void 0,arguments)});function pe(e,t){return e===t||e!=e&&t!=t}var ve=ee(function(){return arguments}())?ee:function(e){return we(e)&&x.call(e,"callee")&&!O.call(e,"callee")},ge=Array.isArray;function me(e){return null!=e&&_e(e.length)&&!be(e)}var ye=D||function(){return!1};function be(e){if(!xe(e))return!1;var t=$(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function _e(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function xe(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function we(e){return null!=e&&"object"==typeof e}var Se=p?function(e){return function(t){return e(t)}}(p):function(e){return we(e)&&_e(e.length)&&!!o[$(e)]};function Ee(e){return me(e)?W(e,!0):ne(e)}var Ae,Te=(Ae=function(e,t,n,r){re(e,t,n,r)},ie((function(e,t){var n=-1,r=t.length,i=r>1?t[r-1]:void 0,o=r>2?t[2]:void 0;for(i=Ae.length>3&&"function"==typeof i?(r--,i):void 0,o&&function(e,t,n){if(!xe(n))return!1;var r=typeof t;return!!("number"==r?me(n)&&se(t,n.length):"string"==r&&t in n)&&pe(n[t],e)}(t[0],t[1],o)&&(i=r<3?void 0:i,r=1),e=Object(e);++n<r;){var a=t[n];a&&Ae(e,a,n,i)}return e})));function ke(e){return e}e.exports=Te}));var qC=function(e){return null==e},XC=Array.isArray,YC=/^\[object .+?Constructor\]$/,KC="object"==typeof r&&r&&r.Object===Object&&r,QC="object"==typeof self&&self&&self.Object===Object&&self,JC=KC||QC||Function("return this")();function $C(e,t){return!!(e?e.length:0)&&function(e,t,n){if(t!=t)return function(e,t,n,r){var i=e.length,o=n+(r?1:-1);for(;r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}(e,tI,n);var r=n-1,i=e.length;for(;++r<i;)if(e[r]===t)return r;return-1}(e,t,0)>-1}function eI(e,t,n){for(var r=-1,i=e?e.length:0;++r<i;)if(n(t,e[r]))return!0;return!1}function tI(e){return e!=e}function nI(e,t){return e.has(t)}function rI(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var iI=Array.prototype,oI=Function.prototype,aI=Object.prototype,sI=JC["__core-js_shared__"],uI=function(){var e=/[^.]+$/.exec(sI&&sI.keys&&sI.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),cI=oI.toString,lI=aI.hasOwnProperty,fI=aI.toString,hI=RegExp("^"+cI.call(lI).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),dI=iI.splice,pI=AI(JC,"Map"),vI=AI(JC,"Set"),gI=AI(Object,"create");function mI(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function yI(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function bI(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function _I(e){var t=-1,n=e?e.length:0;for(this.__data__=new bI;++t<n;)this.add(e[t])}function xI(e,t){for(var n,r,i=e.length;i--;)if((n=e[i][0])===(r=t)||n!=n&&r!=r)return i;return-1}function wI(e){return!(!TI(e)||(t=e,uI&&uI in t))&&(function(e){var t=TI(e)?fI.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?hI:YC).test(function(e){if(null!=e){try{return cI.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t}mI.prototype.clear=function(){this.__data__=gI?gI(null):{}},mI.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},mI.prototype.get=function(e){var t=this.__data__;if(gI){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return lI.call(t,e)?t[e]:void 0},mI.prototype.has=function(e){var t=this.__data__;return gI?void 0!==t[e]:lI.call(t,e)},mI.prototype.set=function(e,t){return this.__data__[e]=gI&&void 0===t?"__lodash_hash_undefined__":t,this},yI.prototype.clear=function(){this.__data__=[]},yI.prototype.delete=function(e){var t=this.__data__,n=xI(t,e);return!(n<0)&&(n==t.length-1?t.pop():dI.call(t,n,1),!0)},yI.prototype.get=function(e){var t=this.__data__,n=xI(t,e);return n<0?void 0:t[n][1]},yI.prototype.has=function(e){return xI(this.__data__,e)>-1},yI.prototype.set=function(e,t){var n=this.__data__,r=xI(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},bI.prototype.clear=function(){this.__data__={hash:new mI,map:new(pI||yI),string:new mI}},bI.prototype.delete=function(e){return EI(this,e).delete(e)},bI.prototype.get=function(e){return EI(this,e).get(e)},bI.prototype.has=function(e){return EI(this,e).has(e)},bI.prototype.set=function(e,t){return EI(this,e).set(e,t),this},_I.prototype.add=_I.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},_I.prototype.has=function(e){return this.__data__.has(e)};var SI=vI&&1/rI(new vI([,-0]))[1]==1/0?function(e){return new vI(e)}:function(){};function EI(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function AI(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return wI(n)?n:void 0}function TI(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var kI=function(e){return e&&e.length?function(e,t,n){var r=-1,i=$C,o=e.length,a=!0,s=[],u=s;if(n)a=!1,i=eI;else if(o>=200){var c=t?null:SI(e);if(c)return rI(c);a=!1,i=nI,u=new _I}else u=t?[]:s;e:for(;++r<o;){var l=e[r],f=t?t(l):l;if(l=n||0!==l?l:0,a&&f==f){for(var h=u.length;h--;)if(u[h]===f)continue e;t&&u.push(f),s.push(l)}else i(u,f,n)||(u!==s&&u.push(f),s.push(l))}return s}(e):[]};var MI=Function.prototype,CI=Object.prototype,II=MI.toString,PI=CI.hasOwnProperty,OI=II.call(Object),RI=CI.toString,LI=function(e,t){return function(n){return e(t(n))}}(Object.getPrototypeOf,Object);var NI,DI,jI,zI,FI,BI=function(e){if(!function(e){return!!e&&"object"==typeof e}(e)||"[object Object]"!=RI.call(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e))return!1;var t=LI(e);if(null===t)return!0;var n=PI.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&II.call(n)==OI},UI=i(o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,n.default)((0,o.default)(e)&&e.length>=1,"Must merge at least 1 JSON schema."),r.default.apply(void 0,[{}].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(e),[function(e,t,r){if(!(0,i.default)(e)){if("required"===r)return(0,a.default)(e.concat(t));if((0,s.default)(e)){if(!(0,s.default)(t))throw new Error('Failed to merge schemas because "'+r+'" has different values.')}else n.default.deepEqual(e,t,'Failed to merge schemas because "'+r+'" has different values: '+JSON.stringify(e)+" and "+JSON.stringify(t)+".")}}]))};var n=u(ZC),r=u(WC),i=u(qC),o=u(XC),a=u(kI),s=u(BI);function u(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default})));var VI,GI,HI,ZI,WI,qI,XI,YI,KI,QI,JI,$I,eP,tP=(NI=Q(),DI=J(nr.IGlobalConfigService),NI((FI=go((zI=function(){function e(){Wi(this,e),vo(this,"configService",FI,this),this.enabled=void 0}return Xi(e,[{key:"apply",value:function(e,t){var n=this,r=(t.rendererService,t.postProcessingPassFactory),i=t.normalPassFactory;e.hooks.init.tap("MultiPassRendererPlugin",(function(){var t=e.getLayerConfig(),o=t.enableMultiPassRenderer,a=t.passes,s=void 0===a?[]:a;n.enabled=!!o&&!1!==e.getLayerConfig().enableMultiPassRenderer,n.enabled&&(e.multiPassRenderer=n.createMultiPassRenderer(e,s,r,i),e.multiPassRenderer.setRenderFlag(!0))})),e.hooks.beforeRender.tap("MultiPassRendererPlugin",(function(){}))}},{key:"createMultiPassRenderer",value:function(e,t,n,r){var i=e.multiPassRenderer,o=e.getLayerConfig(),a=o.enablePicking;o.enableTAA;return a&&i.add(r("pixelPicking")),i}}]),e}()).prototype,"configService",[DI],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),jI=zI))||jI),nP=(Yi(VI={},e.BlendType.additive,{enable:!0,func:{srcRGB:e.gl.ONE,dstRGB:e.gl.ONE,srcAlpha:1,dstAlpha:1}}),Yi(VI,e.BlendType.none,{enable:!1}),Yi(VI,e.BlendType.normal,{enable:!0,func:{srcRGB:e.gl.SRC_ALPHA,dstRGB:e.gl.ONE_MINUS_SRC_ALPHA,srcAlpha:1,dstAlpha:1}}),Yi(VI,e.BlendType.subtractive,{enable:!0,func:{srcRGB:e.gl.ONE,dstRGB:e.gl.ONE,srcAlpha:e.gl.ZERO,dstAlpha:e.gl.ONE_MINUS_SRC_COLOR},equation:{rgb:e.gl.FUNC_SUBTRACT,alpha:e.gl.FUNC_SUBTRACT}}),Yi(VI,e.BlendType.max,{enable:!0,func:{srcRGB:e.gl.ONE,dstRGB:e.gl.ONE},equation:{rgb:e.gl.MAX_EXT}}),Yi(VI,e.BlendType.min,{enable:!0,func:{srcRGB:e.gl.ONE,dstRGB:e.gl.ONE},equation:{rgb:e.gl.MIN_EXT}}),VI),rP={properties:{enablePicking:{type:"boolean"},enableHighlight:{type:"boolean"},highlightColor:{oneOf:[{type:"array",items:{type:"number",minimum:0,maximum:1}},{type:"string"}]}}},iP=0,oP=(GI=VE(nr.ILogService),HI=VE(nr.IGlobalConfigService),ZI=VE(nr.IShaderModuleService),qI=go((WI=function(t){Ji(r,t);var n=so(r);function r(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Wi(this,r),(e=n.call(this)).id="".concat(iP++),e.name="".concat(iP),e.type=void 0,e.visible=!0,e.zIndex=0,e.minZoom=void 0,e.maxZoom=void 0,e.inited=!1,e.layerModelNeedUpdate=!1,e.pickedFeatureID=null,e.selectedFeatureID=null,e.styleNeedUpdate=!1,e.dataState={dataSourceNeedUpdate:!1,dataMappingNeedUpdate:!1,filterNeedUpdate:!1,featureScaleNeedUpdate:!1,StyleAttrNeedUpdate:!1},e.hooks={init:new vx,afterInit:new vx,beforeRender:new vx,beforeRenderData:new px,afterRender:new cx,beforePickingEncode:new cx,afterPickingEncode:new cx,beforeHighlight:new cx(["pickedColor"]),afterHighlight:new cx,beforeSelect:new cx(["pickedColor"]),afterSelect:new cx,beforeDestroy:new cx,afterDestroy:new cx},e.models=[],e.multiPassRenderer=void 0,e.plugins=void 0,e.sourceOption=void 0,e.layerModel=void 0,vo(e,"logger",qI,oo(e)),vo(e,"configService",XI,oo(e)),vo(e,"shaderModuleService",YI,oo(e)),e.cameraService=void 0,e.coordinateService=void 0,e.iconService=void 0,e.fontService=void 0,e.rendererService=void 0,e.layerService=void 0,e.interactionService=void 0,e.mapService=void 0,e.styleAttributeService=void 0,e.layerSource=void 0,e.postProcessingPassFactory=void 0,e.normalPassFactory=void 0,e.animateOptions={enable:!1},e.container=void 0,e.encodedData=void 0,e.configSchema=void 0,e.currentPickId=null,e.rawConfig=void 0,e.needUpdateConfig=void 0,e.pendingStyleAttributes=[],e.scaleOptions={},e.animateStartTime=void 0,e.aniamateStatus=!1,e.sourceEvent=function(){e.dataState.dataSourceNeedUpdate=!0;var t=e.getLayerConfig(),n=t.autoFit,r=t.fitBoundsOptions;n&&e.fitBounds(r),e.emit("dataUpdate"),e.reRender()},e.name=t.name||e.id,e.zIndex=t.zIndex||0,e.rawConfig=t,e}return Xi(r,[{key:"getLayerConfig",value:function(){return this.configService.getLayerConfig(this.id)}},{key:"updateLayerConfig",value:function(e){if(this.inited){var t=this.container.get(nr.SceneID);this.configService.setLayerConfig(t,this.id,Qi(Qi(Qi({},this.configService.getLayerConfig(this.id)),this.needUpdateConfig),e)),this.needUpdateConfig={}}else this.needUpdateConfig=Qi(Qi({},this.needUpdateConfig),e)}},{key:"setContainer",value:function(e){this.container=e}},{key:"getContainer",value:function(){return this.container}},{key:"addPlugin",value:function(e){return this.plugins.push(e),this}},{key:"init",value:function(){var e=this,t=this.container.get(nr.SceneID),n=this.rawConfig.enableMultiPassRenderer,r=void 0!==n&&n;this.configService.setLayerConfig(t,this.id,{enableMultiPassRenderer:r}),this.iconService=this.container.get(nr.IIconService),this.fontService=this.container.get(nr.IFontService),this.rendererService=this.container.get(nr.IRendererService),this.layerService=this.container.get(nr.ILayerService),this.interactionService=this.container.get(nr.IInteractionService),this.mapService=this.container.get(nr.IMapService),this.cameraService=this.container.get(nr.ICameraService),this.coordinateService=this.container.get(nr.ICoordinateSystemService),this.postProcessingPassFactory=this.container.get(nr.IFactoryPostProcessingPass),this.normalPassFactory=this.container.get(nr.IFactoryNormalPass),this.styleAttributeService=this.container.get(nr.IStyleAttributeService),this.multiPassRenderer=this.container.get(nr.IMultiPassRenderer),this.multiPassRenderer.setLayer(this),this.pendingStyleAttributes.forEach((function(t){var n=t.attributeName,r=t.attributeField,i=t.attributeValues,o=t.updateOptions;e.styleAttributeService.updateStyleAttribute(n,{scale:Qi({field:r},e.splitValuesAndCallbackInAttribute(i,e.getLayerConfig()[n]))},o)})),this.pendingStyleAttributes=[],this.plugins=this.container.getAll(nr.ILayerPlugin);var i,o=po(this.plugins);try{for(o.s();!(i=o.n()).done;){i.value.apply(this,{rendererService:this.rendererService,mapService:this.mapService,styleAttributeService:this.styleAttributeService,normalPassFactory:this.normalPassFactory,postProcessingPassFactory:this.postProcessingPassFactory})}}catch(e){o.e(e)}finally{o.f()}return this.hooks.init.call(),this.hooks.afterInit.call(),this.emit("inited",{target:this,type:"inited"}),this.emit("add",{target:this,type:"add"}),this}},{key:"prepareBuildModel",value:function(){this.inited=!0,this.updateLayerConfig(Qi(Qi({},this.getDefaultConfig()),this.rawConfig));var e=this.getLayerConfig().animateOption;(null==e?void 0:e.enable)&&(this.layerService.startAnimate(),this.aniamateStatus=!0)}},{key:"color",value:function(e,t,n){return this.updateStyleAttribute("color",e,t,n),this}},{key:"size",value:function(e,t,n){return this.updateStyleAttribute("size",e,t,n),this}},{key:"filter",value:function(e,t,n){return this.updateStyleAttribute("filter",e,t,n),this}},{key:"shape",value:function(e,t,n){return this.updateStyleAttribute("shape",e,t,n),this}},{key:"label",value:function(e,t,n){return this.pendingStyleAttributes.push({attributeName:"label",attributeField:e,attributeValues:t,updateOptions:n}),this}},{key:"animate",value:function(e){var t={};return zg(e)?(t.enable=!0,t=Qi(Qi({},t),e)):t.enable=e,this.updateLayerConfig({animateOption:t}),this}},{key:"source",value:function(e,t){return this.sourceOption={data:e,options:t},this}},{key:"setData",value:function(e,t){var n=this;return this.inited?this.layerSource.setData(e,t):this.on("inited",(function(){n.layerSource.setData(e,t)})),this}},{key:"style",value:function(e){var t=this,n=e.passes,r=io(e,["passes"]);return n&&function(e){return e.map((function(e){return"string"==typeof e&&(e=[e,{}]),e}))}(n).forEach((function(e){var n=t.multiPassRenderer.getPostProcessor().getPostProcessingPassByName(e[0]);n&&n.updateOptions(e[1])})),this.rawConfig=Qi(Qi({},this.rawConfig),r),this.container&&(this.updateLayerConfig(this.rawConfig),this.styleNeedUpdate=!0),this}},{key:"scale",value:function(e,t){return zg(e)?this.scaleOptions=Qi(Qi({},this.scaleOptions),e):this.scaleOptions[e]=t,this}},{key:"render",value:function(){return this.renderModels(),this}},{key:"active",value:function(e){var t={};return t.enableHighlight=!!zg(e)||e,zg(e)?(t.enableHighlight=!0,e.color&&(t.highlightColor=e.color)):t.enableHighlight=!!e,this.updateLayerConfig(t),this}},{key:"setActive",value:function(e,t){var n=this;if(zg(e)){var r=e.x,i=void 0===r?0:r,o=e.y,a=void 0===o?0:o;this.updateLayerConfig({highlightColor:zg(t)?t.color:this.getLayerConfig().highlightColor}),this.pick({x:i,y:a})}else this.updateLayerConfig({pickedFeatureID:e,highlightColor:zg(t)?t.color:this.getLayerConfig().highlightColor}),this.hooks.beforeSelect.call(Xh(e)).then((function(){setTimeout((function(){n.reRender()}),1)}))}},{key:"select",value:function(e){var t={};return t.enableSelect=!!zg(e)||e,zg(e)?(t.enableSelect=!0,e.color&&(t.selectColor=e.color)):t.enableSelect=!!e,this.updateLayerConfig(t),this}},{key:"setSelect",value:function(e,t){var n=this;if(zg(e)){var r=e.x,i=void 0===r?0:r,o=e.y,a=void 0===o?0:o;this.updateLayerConfig({selectColor:zg(t)?t.color:this.getLayerConfig().selectColor}),this.pick({x:i,y:a})}else this.updateLayerConfig({pickedFeatureID:e,selectColor:zg(t)?t.color:this.getLayerConfig().selectColor}),this.hooks.beforeSelect.call(Xh(e)).then((function(){setTimeout((function(){n.reRender()}),1)}))}},{key:"setBlend",value:function(e){this.updateLayerConfig({blend:e}),this.layerModelNeedUpdate=!0,this.reRender()}},{key:"show",value:function(){return this.updateLayerConfig({visible:!0}),this.reRender(),this}},{key:"hide",value:function(){return this.updateLayerConfig({visible:!1}),this.reRender(),this}},{key:"setIndex",value:function(e){return this.zIndex=e,this.layerService.updateRenderOrder(),this}},{key:"setCurrentPickId",value:function(e){this.currentPickId=e}},{key:"getCurrentPickId",value:function(){return this.currentPickId}},{key:"setCurrentSelectedId",value:function(e){this.selectedFeatureID=e}},{key:"getCurrentSelectedId",value:function(){return this.selectedFeatureID}},{key:"isVisible",value:function(){var e=this.mapService.getZoom(),t=this.getLayerConfig(),n=t.visible,r=t.minZoom,i=void 0===r?-1/0:r,o=t.maxZoom;return!!n&&e>=i&&e<=(void 0===o?1/0:o)}},{key:"setMinZoom",value:function(e){return this.updateLayerConfig({minZoom:e}),this}},{key:"getMinZoom",value:function(){return this.getLayerConfig().minZoom}},{key:"getMaxZoom",value:function(){return this.getLayerConfig().maxZoom}},{key:"get",value:function(e){return this.getLayerConfig()[e]}},{key:"setMaxZoom",value:function(e){return this.updateLayerConfig({maxZoom:e}),this}},{key:"fitBounds",value:function(e){if(!this.inited)return this.updateLayerConfig({autoFit:!0}),this;var t=this.getSource().extent;return t.some((function(e){return Math.abs(e)===1/0}))||this.mapService.fitBounds([[t[0],t[1]],[t[2],t[3]]],e),this}},{key:"destroy",value:function(){this.hooks.beforeDestroy.call(),this.layerSource.off("update",this.sourceEvent),this.multiPassRenderer.destroy(),this.styleAttributeService.clearAllAttributes(),this.hooks.afterDestroy.call(),this.emit("remove",{target:this,type:"remove"}),this.removeAllListeners()}},{key:"clear",value:function(){this.styleAttributeService.clearAllAttributes()}},{key:"clearModels",value:function(){this.models.forEach((function(e){return e.destroy()})),this.layerModel.clearModels()}},{key:"isDirty",value:function(){return!!(this.styleAttributeService.getLayerStyleAttributes()||[]).filter((function(e){return e.needRescale||e.needRemapping||e.needRegenerateVertices})).length}},{key:"setSource",value:function(e){this.layerSource=e;var t=this.mapService.getZoom();this.layerSource.cluster&&this.layerSource.updateClusterData(t),this.layerSource.on("update",this.sourceEvent)}},{key:"getSource",value:function(){return this.layerSource}},{key:"getScaleOptions",value:function(){return this.scaleOptions}},{key:"setEncodedData",value:function(e){this.encodedData=e}},{key:"getEncodedData",value:function(){return this.encodedData}},{key:"getConfigSchemaForValidation",value:function(){return this.configSchema||(this.configSchema=UI([rP,this.getConfigSchema()])),this.configSchema}},{key:"getLegendItems",value:function(e){var t=this.styleAttributeService.getLayerAttributeScale(e);return t?t.ticks?t.ticks().map((function(n){return Yi({value:n},e,t(n))})):t.invertExtent?t.range().map((function(n){return Yi({value:t.invertExtent(n)},e,n)})):void 0:[]}},{key:"pick",value:function(e){var t=e.x,n=e.y;this.interactionService.triggerHover({x:t,y:n})}},{key:"buildLayerModel",value:function(t){var n=t.moduleName,r=t.vertexShader,i=t.fragmentShader,o=t.triangulation,a=io(t,["moduleName","vertexShader","fragmentShader","triangulation"]);this.shaderModuleService.registerModule(n,{vs:r,fs:i});var s=this.shaderModuleService.getModule(n),u=s.vs,c=s.fs,l=s.uniforms,f=this.rendererService.createModel,h=this.styleAttributeService.createAttributesAndIndices(this.encodedData,o);return f(Qi({attributes:h.attributes,uniforms:l,fs:c,vs:u,elements:h.elements,blend:nP[e.BlendType.normal]},a))}},{key:"getTime",value:function(){return this.layerService.clock.getDelta()}},{key:"setAnimateStartTime",value:function(){this.animateStartTime=this.layerService.clock.getElapsedTime()}},{key:"stopAnimate",value:function(){this.aniamateStatus&&(this.layerService.stopAnimate(),this.aniamateStatus=!1,this.updateLayerConfig({animateOption:{enable:!1}}))}},{key:"getLayerAnimateTime",value:function(){return this.layerService.clock.getElapsedTime()-this.animateStartTime}},{key:"needPick",value:function(e){var t=this.getLayerConfig(),n=t.enableHighlight,r=void 0===n||n,i=t.enableSelect,o=void 0===i||i,a=-1!==this.eventNames().indexOf(e)||-1!==this.eventNames().indexOf("un"+e);return"click"!==e&&"dblclick"!==e||!o||(a=!0),"mousemove"!==e||!r&&-1===this.eventNames().indexOf("mouseenter")&&-1===this.eventNames().indexOf("unmousemove")&&-1===this.eventNames().indexOf("mouseout")||(a=!0),this.isVisible()&&a}},{key:"buildModels",value:function(){throw new Error("Method not implemented.")}},{key:"rebuildModels",value:function(){throw new Error("Method not implemented.")}},{key:"renderModels",value:function(){var e=this;return this.layerModelNeedUpdate&&this.layerModel&&(this.models=this.layerModel.buildModels(),this.hooks.beforeRender.call(),this.layerModelNeedUpdate=!1),this.models.forEach((function(t){t.draw({uniforms:e.layerModel.getUninforms()})})),this}},{key:"getConfigSchema",value:function(){throw new Error("Method not implemented.")}},{key:"getModelType",value:function(){throw new Error("Method not implemented.")}},{key:"getDefaultConfig",value:function(){return{}}},{key:"reRender",value:function(){this.inited&&this.layerService.renderLayers()}},{key:"splitValuesAndCallbackInAttribute",value:function(e,t){return{values:Fg(e)?void 0:e||t,callback:Fg(e)?e:void 0}}},{key:"updateStyleAttribute",value:function(e,t,n,r){this.inited?this.styleAttributeService.updateStyleAttribute(e,{scale:Qi({field:t},this.splitValuesAndCallbackInAttribute(n,this.getLayerConfig()[t]))},r):this.pendingStyleAttributes.push({attributeName:e,attributeField:t,attributeValues:n,updateOptions:r})}}]),r}(s)).prototype,"logger",[GI],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),XI=go(WI.prototype,"configService",[HI],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),YI=go(WI.prototype,"shaderModuleService",[ZI],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),WI),aP=(KI=VE(nr.IGlobalConfigService),QI=VE(nr.IShaderModuleService),$I=go((JI=function(){function t(e){Wi(this,t),this.triangulation=void 0,this.layer=void 0,vo(this,"configService",$I,this),vo(this,"shaderModuleService",eP,this),this.rendererService=void 0,this.iconService=void 0,this.fontService=void 0,this.styleAttributeService=void 0,this.mapService=void 0,this.cameraService=void 0,this.layerService=void 0,this.layer=e,this.rendererService=e.getContainer().get(nr.IRendererService),this.styleAttributeService=e.getContainer().get(nr.IStyleAttributeService),this.mapService=e.getContainer().get(nr.IMapService),this.iconService=e.getContainer().get(nr.IIconService),this.fontService=e.getContainer().get(nr.IFontService),this.cameraService=e.getContainer().get(nr.ICameraService),this.layerService=e.getContainer().get(nr.ILayerService),this.registerBuiltinAttributes(),this.startModelAnimate()}return Xi(t,[{key:"getBlend",value:function(){var t=this.layer.getLayerConfig().blend,n=void 0===t?"normal":t;return nP[e.BlendType[n]]}},{key:"getDefaultStyle",value:function(){return{}}},{key:"getUninforms",value:function(){throw new Error("Method not implemented.")}},{key:"getAnimateUniforms",value:function(){return{}}},{key:"needUpdate",value:function(){return!1}},{key:"buildModels",value:function(){throw new Error("Method not implemented.")}},{key:"initModels",value:function(){throw new Error("Method not implemented.")}},{key:"clearModels",value:function(){}},{key:"getAttribute",value:function(){throw new Error("Method not implemented.")}},{key:"render",value:function(){throw new Error("Method not implemented.")}},{key:"registerBuiltinAttributes",value:function(){throw new Error("Method not implemented.")}},{key:"animateOption2Array",value:function(e){return[e.enable?0:1,e.duration||4,e.interval||.2,e.trailLength||.1]}},{key:"startModelAnimate",value:function(){this.layer.getLayerConfig().animateOption.enable&&this.layer.setAnimateStartTime()}}]),t}()).prototype,"configService",[KI],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),eP=go(JI.prototype,"shaderModuleService",[QI],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),JI),sP=cP,uP=cP;function cP(e,t,n){n=n||2;var r,i,o,a,s,u,c,l=t&&t.length,f=l?t[0]*n:e.length,h=lP(e,0,f,n,!0),d=[];if(!h||h.next===h.prev)return d;if(l&&(h=function(e,t,n,r){var i,o,a,s,u,c=[];for(i=0,o=t.length;i<o;i++)a=t[i]*r,s=i<o-1?t[i+1]*r:e.length,(u=lP(e,a,s,r,!1))===u.next&&(u.steiner=!0),c.push(xP(u));for(c.sort(mP),i=0;i<c.length;i++)yP(c[i],n),n=fP(n,n.next);return n}(e,t,h,n)),e.length>80*n){r=o=e[0],i=a=e[1];for(var p=n;p<f;p+=n)(s=e[p])<r&&(r=s),(u=e[p+1])<i&&(i=u),s>o&&(o=s),u>a&&(a=u);c=0!==(c=Math.max(o-r,a-i))?1/c:0}return hP(h,d,n,r,i,c),d}function lP(e,t,n,r,i){var o,a;if(i===LP(e,t,n,r)>0)for(o=t;o<n;o+=r)a=PP(o,e[o],e[o+1],a);else for(o=n-r;o>=t;o-=r)a=PP(o,e[o],e[o+1],a);return a&&AP(a,a.next)&&(OP(a),a=a.next),a}function fP(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!AP(r,r.next)&&0!==EP(r.prev,r,r.next))r=r.next;else{if(OP(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function hP(e,t,n,r,i,o,a){if(e){!a&&o&&function(e,t,n,r){var i=e;do{null===i.z&&(i.z=_P(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n,r,i,o,a,s,u,c=1;do{for(n=e,e=null,o=null,a=0;n;){for(a++,r=n,s=0,t=0;t<c&&(s++,r=r.nextZ);t++);for(u=c;s>0||u>0&&r;)0!==s&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,u--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;n=r}o.nextZ=null,c*=2}while(a>1)}(i)}(e,r,i,o);for(var s,u,c=e;e.prev!==e.next;)if(s=e.prev,u=e.next,o?pP(e,r,i,o):dP(e))t.push(s.i/n),t.push(e.i/n),t.push(u.i/n),OP(e),e=u.next,c=u.next;else if((e=u)===c){a?1===a?hP(e=vP(fP(e),t,n),t,n,r,i,o,2):2===a&&gP(e,t,n,r,i,o):hP(fP(e),t,n,r,i,o,1);break}}}function dP(e){var t=e.prev,n=e,r=e.next;if(EP(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(wP(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&EP(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function pP(e,t,n,r){var i=e.prev,o=e,a=e.next;if(EP(i,o,a)>=0)return!1;for(var s=i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,u=i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,c=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,l=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,f=_P(s,u,t,n,r),h=_P(c,l,t,n,r),d=e.prevZ,p=e.nextZ;d&&d.z>=f&&p&&p.z<=h;){if(d!==e.prev&&d!==e.next&&wP(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&EP(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,p!==e.prev&&p!==e.next&&wP(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&EP(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&wP(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&EP(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&wP(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&EP(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function vP(e,t,n){var r=e;do{var i=r.prev,o=r.next.next;!AP(i,o)&&TP(i,r,r.next,o)&&CP(i,o)&&CP(o,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(o.i/n),OP(r),OP(r.next),r=e=o),r=r.next}while(r!==e);return fP(r)}function gP(e,t,n,r,i,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&SP(a,s)){var u=IP(a,s);return a=fP(a,a.next),u=fP(u,u.next),hP(a,t,n,r,i,o),void hP(u,t,n,r,i,o)}s=s.next}a=a.next}while(a!==e)}function mP(e,t){return e.x-t.x}function yP(e,t){if(t=function(e,t){var n,r=t,i=e.x,o=e.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a){if(a=s,s===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(i===a)return n;var u,c=n,l=n.x,f=n.y,h=1/0;r=n;do{i>=r.x&&r.x>=l&&i!==r.x&&wP(o<f?i:a,o,l,f,o<f?a:i,o,r.x,r.y)&&(u=Math.abs(o-r.y)/(i-r.x),CP(r,e)&&(u<h||u===h&&(r.x>n.x||r.x===n.x&&bP(n,r)))&&(n=r,h=u)),r=r.next}while(r!==c);return n}(e,t)){var n=IP(t,e);fP(t,t.next),fP(n,n.next)}}function bP(e,t){return EP(e.prev,e,t.prev)<0&&EP(t.next,e,e.next)<0}function _P(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function xP(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function wP(e,t,n,r,i,o,a,s){return(i-a)*(t-s)-(e-a)*(o-s)>=0&&(e-a)*(r-s)-(n-a)*(t-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function SP(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&TP(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(CP(e,t)&&CP(t,e)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(EP(e.prev,e,t.prev)||EP(e,t.prev,t))||AP(e,t)&&EP(e.prev,e,e.next)>0&&EP(t.prev,t,t.next)>0)}function EP(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function AP(e,t){return e.x===t.x&&e.y===t.y}function TP(e,t,n,r){var i=MP(EP(e,t,n)),o=MP(EP(e,t,r)),a=MP(EP(n,r,e)),s=MP(EP(n,r,t));return i!==o&&a!==s||(!(0!==i||!kP(e,n,t))||(!(0!==o||!kP(e,r,t))||(!(0!==a||!kP(n,e,r))||!(0!==s||!kP(n,t,r)))))}function kP(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function MP(e){return e>0?1:e<0?-1:0}function CP(e,t){return EP(e.prev,e,e.next)<0?EP(e,t,e.next)>=0&&EP(e,e.prev,t)>=0:EP(e,t,e.prev)<0||EP(e,e.next,t)<0}function IP(e,t){var n=new RP(e.i,e.x,e.y),r=new RP(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function PP(e,t,n,r){var i=new RP(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function OP(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function RP(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function LP(e,t,n,r){for(var i=0,o=t,a=n-r;o<n;o+=r)i+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return i}cP.deviation=function(e,t,n,r){var i=t&&t.length,o=i?t[0]*n:e.length,a=Math.abs(LP(e,0,o,n));if(i)for(var s=0,u=t.length;s<u;s++){var c=t[s]*n,l=s<u-1?t[s+1]*n:e.length;a-=Math.abs(LP(e,c,l,n))}var f=0;for(s=0;s<r.length;s+=3){var h=r[s]*n,d=r[s+1]*n,p=r[s+2]*n;f+=Math.abs((e[h]-e[p])*(e[d+1]-e[h+1])-(e[h]-e[d])*(e[p+1]-e[h+1]))}return 0===a&&0===f?0:Math.abs((f-a)/a)},cP.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,i=0;i<e.length;i++){for(var o=0;o<e[i].length;o++)for(var a=0;a<t;a++)n.vertices.push(e[i][o][a]);i>0&&(r+=e[i-1].length,n.holes.push(r))}return n},sP.default=uP;yi("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),Ti);var NP=Xv(),DP=(Xv(),Xv()),jP=Xv(),zP=Xv();function FP(e,t){return function(e,t,n){return e[0]=t,e[1]=n,e}(e,-t[1],t[0])}function BP(e,t,n){return ag(e,t,n),$v(e,e),e}var UP=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Wi(this,e),this.complex=void 0,this.join=void 0,this.cap=void 0,this.miterLimit=void 0,this.thickness=void 0,this.normal=void 0,this.lastFlip=-1,this.miter=Yv(0,0),this.started=!1,this.dash=!1,this.totalDistance=0,this.join=t.join||"miter",this.cap=t.cap||"butt",this.miterLimit=t.miterLimit||10,this.thickness=t.thickness||1,this.dash=t.dash||!1,this.complex={positions:[],indices:[],normals:[],startIndex:0}}return Xi(e,[{key:"extrude",value:function(e){var t=this.complex;if(e.length<=1)return t;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;for(var n=e.length,r=t.startIndex,i=1;i<n;i++){var o=e[i-1],a=e[i],s=i<e.length-1?e[i+1]:null;r+=this.segment(t,r,o,a,s)}if(this.dash)for(var u=0;u<t.positions.length/6;u++)t.positions[6*u+5]=this.totalDistance;return t.startIndex=t.positions.length/6,t}},{key:"segment",value:function(e,t,n,r,i){var o=0,a=e.indices,s=e.positions,u=e.normals,c="square"===this.cap,l="bevel"===this.join,f=nh([r[0],r[1]]),h=nh([n[0],n[1]]);BP(DP,f,h);var d,p,v=0;if(this.dash&&(v=this.lineSegmentDistance(f,h),this.totalDistance+=v),this.normal||(this.normal=Xv(),FP(this.normal,DP)),!this.started)if(this.started=!0,c){var g=Xv(),m=Xv();Qv(g,this.normal,DP),Qv(m,this.normal,DP),u.push(m[0],m[1],0),u.push(g[0],g[1],0),s.push(n[0],n[1],0,this.totalDistance-v,-this.thickness,0),s.push(n[0],n[1],0,this.totalDistance-v,this.thickness,0)}else this.extrusions(s,u,n,this.normal,this.thickness,this.totalDistance-v);if(a.push(t+0,t+1,t+2),i){var y=nh([i[0],i[1]]);p=y,(d=f)[0]===p[0]&&d[1]===p[1]&&Qv(y,f,$v(y,Jv(y,f,h))),BP(jP,y,f);var b=co(function(e,t,n,r,i){return Qv(e,n,r),$v(e,e),[i/eg(t=Yv(-e[1],e[0]),Yv(-n[1],n[0])),t]}(zP,Xv(),DP,jP,this.thickness),2),_=b[0],x=b[1],w=eg(zP,this.normal)<0?-1:1,S=l;if(!S&&"miter"===this.join)_>this.miterLimit&&(S=!0);S?(u.push(this.normal[0],this.normal[1],0),u.push(x[0],x[1],0),s.push(r[0],r[1],0,this.totalDistance,-this.thickness*w,0),s.push(r[0],r[1],0,this.totalDistance,this.thickness*w,0),a.push.apply(a,lo(this.lastFlip!==-w?[t,t+2,t+3]:[t+2,t+1,t+3])),a.push(t+2,t+3,t+4),FP(NP,jP),Kv(this.normal,NP),u.push(this.normal[0],this.normal[1],0),s.push(r[0],r[1],0,this.totalDistance,-this.thickness*w,0),o+=3):(this.extrusions(s,u,r,x,_,this.totalDistance),a.push.apply(a,lo(1===this.lastFlip?[t,t+2,t+3]:[t+2,t+1,t+3])),w=-1,Kv(this.normal,x),o+=2),this.lastFlip=w}else{if(FP(this.normal,DP),c){var E=Xv(),A=Xv();ag(A,DP,this.normal),Qv(E,DP,this.normal),u.push(A[0],A[1],0),u.push(E[0],E[1],0),s.push(r[0],r[1],0,this.totalDistance,this.thickness,0),s.push(r[0],r[1],0,this.totalDistance,this.thickness,0)}else this.extrusions(s,u,r,this.normal,this.thickness,this.totalDistance);a.push.apply(a,lo(1===this.lastFlip?[t,t+2,t+3]:[t+2,t+1,t+3])),o+=2}return o}},{key:"extrusions",value:function(e,t,n,r,i,o){t.push(r[0],r[1],0),t.push(r[0],r[1],0),e.push(n[0],n[1],0,o,-i,0),e.push(n[0],n[1],0,o,i,0)}},{key:"lineSegmentDistance",value:function(e,t){var n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)}}]),e}();var VP,GP,HP,ZP=function(e){return"number"==typeof e||Fm(e)&&"[object Number]"==jg(e)};function WP(e){if(ZP(e[0]))return e;if(ZP(e[0][0]))throw new Error("当前数据不支持标注");if(ZP(e[0][0][0])){var t=0,n=0,r=0;return e.forEach((function(e){e.forEach((function(e){t+=e[0],n+=e[1],r++}))})),[t/r,n/r,0]}throw new Error("当前数据不支持标注")}function qP(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e[0][0],r=e[0][e[0].length-1];n[0]===r[0]&&n[1]===r[1]&&(e[0]=e[0].slice(0,e[0].length-1));for(var i=e[0].length,o=sP.flatten(e),a=o.vertices,s=o.dimensions,u=[],c=[],l=[],f=0;f<a.length/s;f++)2===s?u.push(a[2*f],a[2*f+1],1,-1,-1):u.push(a[3*f],a[3*f+1],1,-1,-1),l.push(0,0,1);var h=sP(o.vertices,o.holes,o.dimensions);c.push.apply(c,lo(h));for(var d=function(e){var n=o.vertices.slice(e*s,(e+1)*s),r=o.vertices.slice((e+1)*s,(e+2)*s);0===r.length&&(r=o.vertices.slice(0,s));var i=u.length/5;u.push(n[0],n[1],1,0,0,r[0],r[1],1,.1,0,n[0],n[1],0,0,.8,r[0],r[1],0,.1,.8);var a=XP([r[0],r[1],1],[n[0],n[1],0],[n[0],n[1],1],t);l.push.apply(l,lo(a).concat(lo(a),lo(a),lo(a))),c.push.apply(c,lo([1,2,0,3,2,1].map((function(e){return e+i}))))},p=0;p<i;p++)d(p);return{positions:u,index:c,normals:l}}function XP(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=wv(),o=wv(),a=wv();r&&(e=Jf(e),t=Jf(t),n=Jf(n));var s=Ev.apply(Hv,lo(e)),u=Ev.apply(Hv,lo(t)),c=Ev.apply(Hv,lo(n));Dv(i,c,u),Dv(o,s,u),Lv(a,i,o);var l=wv();return Ov(l,a),l}function YP(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=2*Math.PI/e,r=[],i=0;i<e;i++)r.push(n*i+t*Math.PI/12);var o=r.map((function(e){return[Math.sin(e+Math.PI/4),Math.cos(e+Math.PI/4),0]}));return o}function KP(){return YP(30)}function QP(){return YP(4)}function JP(){return YP(3)}function $P(){return YP(6,1)}function eO(){return YP(5)}!function(e){e.CYLINDER="cylinder",e.SQUARECOLUMN="squareColumn",e.TRIANGLECOLUMN="triangleColumn",e.HEXAGONCOLUMN="hexagonColumn",e.PENTAGONCOLUMN="pentagonColumn"}(GP||(GP={})),function(e){e.CIRCLE="circle",e.SQUARE="square",e.TRIANGLE="triangle",e.HEXAGON="hexagon",e.PENTAGON="pentagon"}(HP||(HP={}));var tO=(Yi(VP={},HP.CIRCLE,KP),Yi(VP,HP.HEXAGON,$P),Yi(VP,HP.TRIANGLE,JP),Yi(VP,HP.SQUARE,QP),Yi(VP,HP.PENTAGON,eO),Yi(VP,GP.CYLINDER,KP),Yi(VP,GP.HEXAGONCOLUMN,$P),Yi(VP,GP.TRIANGLECOLUMN,JP),Yi(VP,GP.SQUARECOLUMN,QP),Yi(VP,GP.PENTAGONCOLUMN,eO),VP),nO={};function rO(e){var t=WP(e.coordinates);return{vertices:[].concat(lo(t),lo(t),lo(t),lo(t)),indices:[0,1,2,2,3,0],size:t.length}}function iO(e){var t=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(nO&&nO[e])return nO[e];var n=tO[e]?tO[e]():tO.cylinder(),r=qP([n],t);return nO[e]=r,r}(e.shape,!1);return{vertices:t.positions,indices:t.index,normals:t.normals,size:5}}function oO(e){var t=WP(e.coordinates);return{vertices:lo(t),indices:[0],size:t.length}}function aO(e){var t=e.coordinates,n=t;Array.isArray(n[0][0])||(n=[t]);var r=new UP({dash:!0,join:"bevel"});n.forEach((function(e){r.extrude(e)}));var i=r.complex;return{vertices:i.positions,indices:i.indices,normals:i.normals,size:6}}function sO(e){var t=e.coordinates,n=sP.flatten(t),r=n.vertices,i=n.dimensions,o=n.holes;return{indices:sP(r,o,i),vertices:r,size:i}}function uO(e){var t=qP(e.coordinates,!0);return{vertices:t.positions,indices:t.index,normals:t.normals,size:5}}function cO(e){var t=function(e){var t=tO[e]?tO[e]():tO.circle();return-1===["cylinder","triangleColumn","hexagonColumn","squareColumn"].indexOf(e)?(n=[t],r=sP.flatten(n),i=sP(r.vertices,r.holes,r.dimensions),{positions:r.vertices,index:i}):function(e){var t=e[0][0],n=e[0][e[0].length-1];t[0]===n[0]&&t[1]===n[1]&&(e[0]=e[0].slice(0,e[0].length-1));for(var r=e[0].length,i=sP.flatten(e),o=i.vertices,a=i.dimensions,s=[],u=[],c=0;c<o.length/a;c++)2===a?s.push(o[2*c],o[2*c+1],1):s.push(o[3*c],o[3*c+1],1);var l=sP(i.vertices,i.holes,i.dimensions);u.push.apply(u,lo(l));for(var f=function(e){var t=i.vertices.slice(e*a,(e+1)*a),n=i.vertices.slice((e+1)*a,(e+2)*a);0===n.length&&(n=i.vertices.slice(0,a));var r=s.length/3;s.push(t[0],t[1],1,n[0],n[1],1,t[0],t[1],0,n[0],n[1],0),u.push.apply(u,lo([0,2,1,2,3,1].map((function(e){return e+r}))))},h=0;h<r;h++)f(h);return{positions:s,index:u}}([t]);var n,r,i}(e.shape);return{vertices:t.positions,indices:t.index,size:3}}function lO(e){var t=e.coordinates;return{vertices:[].concat(lo(t[0]),[0,0,1,t[1][0],t[0][1],0,1,1],lo(t[1]),[0,1,0],lo(t[0]),[0,0,1],lo(t[1]),[0,1,0,t[0][0],t[1][1],0,0,0]),indices:[0,1,2,3,4,5],size:5}}function fO(e){for(var t=e.coordinates,n=[],r=[],i=function(e){n.push(e,1,e,t[0][0],t[0][1],t[1][0],t[1][1],e,-1,e,t[0][0],t[0][1],t[1][0],t[1][1]),29!==e&&r.push.apply(r,lo([0,1,2,1,3,2].map((function(t){return 2*e+t}))))},o=0;o<30;o++)i(o);return{vertices:n,indices:r,size:7}}function hO(e){var t=e.coordinates;2===t.length&&t.push(0);e.size;var n=dO(-1,1),r=dO(1,1),i=dO(-1,-1),o=dO(1,-1);return{vertices:[].concat(lo(t),lo(n),lo(t),lo(i),lo(t),lo(o),lo(t),lo(r)),indices:[0,1,2,3,0,2],size:5}}function dO(e,t){return[(e+1)/2,(t+1)/2]}var pO=function(t){Ji(r,t);var n=so(r);function r(){return Wi(this,r),n.apply(this,arguments)}return Xi(r,[{key:"getUninforms",value:function(){var e=this.layer.getLayerConfig(),t=e.opacity,n=void 0===t?1:t,r=e.baseColor,i=void 0===r?"rgb(16,16,16)":r,o=e.brightColor,a=void 0===o?"rgb(255,176,38)":o,s=e.windowColor,u=void 0===s?"rgb(30,60,89)":s,c=e.time,l=void 0===c?0:c;return{u_opacity:n,u_baseColor:Wh(i),u_brightColor:Wh(a),u_windowColor:Wh(u),u_time:this.layer.getLayerAnimateTime()||l}}},{key:"initModels",value:function(){return this.startModelAnimate(),[this.layer.buildLayerModel({moduleName:"cityBuilding",vertexShader:'precision highp float;\n#define ambientRatio 0.5\n#define diffuseRatio 0.3\n#define specularRatio 0.2\nattribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute float a_Size;\nuniform mat4 u_ModelMatrix;\nattribute vec2 a_Uv;\nvarying vec2 v_texCoord;\nvarying vec4 v_Color;\n#pragma include "projection"\n#pragma include "light"\n#pragma include "picking"\nvoid main() {\nvec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);\nvec4 project_pos = project_position(pos);\nv_texCoord = a_Uv;\ngl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\nfloat lightWeight = calc_lighting(pos);\nv_Color = vec4(a_Color.rgb * lightWeight, a_Color.w);\nsetPickingColor(a_PickingColor);\n}',fragmentShader:'uniform float u_opacity: 1.0;\nuniform vec4 u_baseColor : [ 1.0, 0, 0, 1.0 ];\nuniform vec4 u_brightColor : [ 1.0, 0, 0, 1.0 ];\nuniform vec4 u_windowColor : [ 1.0, 0, 0, 1.0 ];\nuniform float u_near : 0;\nuniform float u_far : 1;\nvarying vec4 v_Color;\nvarying vec2 v_texCoord;\nuniform float u_Zoom : 1;\nuniform float u_time;\n#pragma include "picking"\nvec3 getWindowColor(float n, float hot, vec3 brightColor, vec3 darkColor) {\nfloat s = step(hot, n);\nvec3 color = mix(brightColor,vec3(0.9,0.9,1.0),n);\nreturn mix(darkColor, color, s);\n}\nfloat random (vec2 st) {\nreturn fract(sin(dot(st.xy, vec2(12.9898,78.233)))* 43758.5453123);\n}\nfloat LinearizeDepth()\n{\nfloat z = gl_FragCoord.z * 2.0 - 1.0;\nreturn (2.0 * u_near * u_far) / (u_far + u_near - z * (u_far - u_near));\n}\nvec3 fog(vec3 color, vec3 fogColor, float depth){\nfloat fogFactor=clamp(depth,0.0,1.0);\nvec3 output_color=mix(fogColor,color,fogFactor);\nreturn output_color;\n}\nfloat sdRect(vec2 p, vec2 sz) {\nvec2 d = abs(p) - sz;\nfloat outside = length(max(d, 0.));\nfloat inside = min(max(d.x, d.y), 0.);\nreturn outside + inside;\n}\nvoid main() {\ngl_FragColor = v_Color;\nvec3 baseColor = u_baseColor.xyz;\nvec3 brightColor = u_brightColor.xyz;\nvec3 windowColor = u_windowColor.xyz;\nfloat targetColId = 5.;\nfloat depth = 1.0 - LinearizeDepth() / u_far * u_Zoom;\nvec3 fogColor = vec3(23.0/255.0,31.0/255.0,51.0/255.0);\nif(v_texCoord.x < 0.) {\nvec3 foggedColor = fog(baseColor.xyz + vec3(0.12*0.9,0.2*0.9,0.3*0.9),fogColor,depth);\ngl_FragColor = vec4( foggedColor, v_Color.w);\n}else {\nvec2 st = v_texCoord;\nvec2 UvScale = v_texCoord;\nfloat tStep = min(0.08,max(0.05* (18.0-u_Zoom),0.02));\nfloat tStart = 0.25 * tStep;\nfloat tEnd = 0.75 * tStep;\nfloat u = mod(UvScale.x, tStep);\nfloat v = mod(UvScale.y, tStep);\nfloat ux = floor(UvScale.x/tStep);\nfloat uy = floor(UvScale.y/tStep);\nfloat n = random(vec2(ux,uy));\nfloat lightP = u_time;\nfloat head = 1.0- step(0.005,st.y);\nfloat sU = step(tStart, u) - step(tEnd, u);\nfloat sV = step(tStart, v) - step(tEnd, v);\nvec2 windowSize = vec2(abs(tEnd-tStart),abs(tEnd-tStart));\nfloat dist = sdRect(vec2(u,v), windowSize);\nfloat s = sU * sV;\nfloat curColId = floor(UvScale.x / tStep);\nfloat sCol = step(targetColId - 0.2, curColId) - step(targetColId + 0.2, curColId);\nfloat mLightP = mod(lightP, 2.);\nfloat sRow = step(mLightP - 0.2, st.y) - step(mLightP, st.y);\nif(ux == targetColId){\nn =0.;\n}\nfloat timeP = min(0.75, abs ( sin(u_time/3.0) ) );\nfloat hot = smoothstep(1.0,0.0,timeP);\nvec3 color = mix(baseColor, getWindowColor(n,hot,brightColor,windowColor), s);\nfloat sFinal = s * sCol * sRow;\ncolor += mix(baseColor, brightColor, sFinal*n);\nif (st.y<0.01){\ncolor = baseColor;\n}\nif(head ==1.0) {\ncolor = brightColor;\n}\ncolor = color * v_Color.rgb;\nvec3 foggedColor = fog(color,fogColor,depth);\ngl_FragColor = vec4(foggedColor,1.0);\n}\ngl_FragColor.a *= u_opacity;\ngl_FragColor = filterColor(gl_FragColor);\n}',triangulation:uO})]}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"normal",type:e.AttributeType.Attribute,descriptor:{name:"a_Normal",buffer:{usage:e.gl.STATIC_DRAW,data:[],type:e.gl.FLOAT},size:3,update:function(e,t,n,r,i){return i}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:e.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:e.gl.DYNAMIC_DRAW,data:[],type:e.gl.FLOAT},size:1,update:function(e,t,n,r){var i=e.size,o=void 0===i?10:i;return Array.isArray(o)?[o[0]]:[o]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:e.AttributeType.Attribute,descriptor:{name:"a_Uv",buffer:{usage:e.gl.DYNAMIC_DRAW,data:[],type:e.gl.FLOAT},size:2,update:function(e,t,n,r){e.size;return[n[3],n[4]]}}})}}]),r}(aP),vO=function(e){Ji(n,e);var t=so(n);function n(){var e;Wi(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).type="PolygonLayer",e}return Xi(n,[{key:"buildModels",value:function(){this.layerModel=new pO(this),this.models=this.layerModel.initModels()}},{key:"rebuildModels",value:function(){this.models=this.layerModel.buildModels()}},{key:"setLight",value:function(e){this.updateLayerConfig({time:e})}},{key:"getConfigSchema",value:function(){return{properties:{opacity:{type:"number",minimum:0,maximum:1}}}}},{key:"getModelType",value:function(){return"citybuilding"}}]),n}(oP),gO='precision highp float;\nvarying vec4 v_color;\nuniform float u_opacity: 1;\n#pragma include "picking"\nvoid main() {\ngl_FragColor = v_color;\ngl_FragColor.a *= u_opacity;\ngl_FragColor = filterColor(gl_FragColor);\n}',mO=function(t){Ji(r,t);var n=so(r);function r(){return Wi(this,r),n.apply(this,arguments)}return Xi(r,[{key:"getUninforms",value:function(){var e=this.layer.getLayerConfig();return{u_opacity:e.opacity||1,u_coverage:e.coverage||.9,u_angle:e.angle||0,u_radius:[this.layer.getSource().data.xOffset,this.layer.getSource().data.yOffset]}}},{key:"initModels",value:function(){return this.buildModels()}},{key:"buildModels",value:function(){return[this.layer.buildLayerModel({moduleName:"gridheatmap",vertexShader:'precision highp float;\nattribute vec3 a_Position;\nattribute vec3 a_Pos;\r\nattribute float a_Size;\r\nattribute vec4 a_Color;\r\nuniform vec2 u_radius;\r\nuniform float u_coverage: 0.9;\r\nuniform float u_angle: 0;\r\nuniform mat4 u_ModelMatrix;\r\nvarying vec4 v_color;\r\n#pragma include "projection"\r\n#pragma include "project"\r\n#pragma include "picking"\r\nvoid main() {\r\nv_color = a_Color;\r\nmat2 rotationMatrix = mat2(cos(u_angle), sin(u_angle), -sin(u_angle), cos(u_angle));\r\nvec2 offset = a_Position.xy * u_radius * rotationMatrix * u_coverage ;\r\nvec2 lnglat = unProjectFlat(a_Pos.xy + offset);\r\nvec4 project_pos = project_position(vec4(lnglat, 0, 1.0));\r\ngl_Position = project_common_position_to_clipspace(project_pos);\r\nsetPickingColor(a_PickingColor);\r\n}',fragmentShader:gO,triangulation:cO,depth:{enable:!1},primitive:e.gl.TRIANGLES,blend:this.getBlend()})]}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"pos",type:e.AttributeType.Attribute,descriptor:{name:"a_Pos",buffer:{usage:e.gl.DYNAMIC_DRAW,data:[],type:e.gl.FLOAT},size:3,update:function(e,t){var n=e.coordinates;return[n[0],n[1],0]}}})}}]),r}(aP),yO=function(t){Ji(r,t);var n=so(r);function r(){return Wi(this,r),n.apply(this,arguments)}return Xi(r,[{key:"getUninforms",value:function(){var e=this.layer.getLayerConfig();return{u_opacity:e.opacity||1,u_coverage:e.coverage||1,u_angle:e.angle||0,u_radius:[this.layer.getSource().data.xOffset,this.layer.getSource().data.yOffset]}}},{key:"initModels",value:function(){return this.buildModels()}},{key:"buildModels",value:function(){return[this.layer.buildLayerModel({moduleName:"grid3dheatmap",vertexShader:'precision highp float;\nattribute vec3 a_Position;\nattribute vec3 a_Pos;\nattribute vec3 a_Normal;\nattribute float a_Size;\nattribute vec4 a_Color;\nuniform vec2 u_radius;\nuniform float u_coverage: 0.9;\nuniform float u_angle: 0;\nuniform mat4 u_ModelMatrix;\nvarying vec4 v_color;\n#pragma include "projection"\n#pragma include "project"\n#pragma include "light"\n#pragma include "picking"\nvoid main() {\nmat2 rotationMatrix = mat2(cos(u_angle), sin(u_angle), -sin(u_angle), cos(u_angle));\nvec2 offset =(vec2(a_Position.xy * u_radius * rotationMatrix * u_coverage));\nvec2 lnglat = unProjectFlat(a_Pos.xy + offset);\nvec4 project_pos = project_position(vec4(lnglat, a_Position.z * a_Size, 1.0));\nfloat lightWeight = calc_lighting(project_pos);\nv_color =vec4(a_Color.rgb*lightWeight, a_Color.w);\ngl_Position = project_common_position_to_clipspace(project_pos);\nsetPickingColor(a_PickingColor);\n}',fragmentShader:gO,triangulation:iO,depth:{enable:!0},blend:this.getBlend()})]}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:e.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:e.gl.DYNAMIC_DRAW,data:[],type:e.gl.FLOAT},size:1,update:function(e,t,n,r){var i=e.size;return Array.isArray(i)?[i[0]]:[i]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:e.AttributeType.Attribute,descriptor:{name:"a_Normal",buffer:{usage:e.gl.STATIC_DRAW,data:[],type:e.gl.FLOAT},size:3,update:function(e,t,n,r,i){return i}}}),this.styleAttributeService.registerStyleAttribute({name:"pos",type:e.AttributeType.Attribute,descriptor:{name:"a_Pos",buffer:{usage:e.gl.DYNAMIC_DRAW,data:[],type:e.gl.FLOAT},size:3,update:function(e,t){var n=e.coordinates;return[n[0],n[1],0]}}})}}]),r}(aP);var bO=function(t){Ji(r,t);var n=so(r);function r(){var e;Wi(this,r);for(var t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];return(e=n.call.apply(n,[this].concat(i))).texture=void 0,e.colorTexture=void 0,e.heatmapFramerBuffer=void 0,e.intensityModel=void 0,e.colorModel=void 0,e.shapeType=void 0,e}return Xi(r,[{key:"render",value:function(){var e=this,t=this.rendererService,n=t.clear;(0,t.useFramebuffer)(this.heatmapFramerBuffer,(function(){n({color:[0,0,0,0],depth:1,stencil:0,framebuffer:e.heatmapFramerBuffer}),e.drawIntensityMode()})),this.layer.styleNeedUpdate&&this.updateColorTexture(),"heatmap"===this.shapeType?this.drawColorMode():this.draw3DHeatMap()}},{key:"getUninforms",value:function(){throw new Error("Method not implemented.")}},{key:"initModels",value:function(){var t,n=this.rendererService,r=n.createFramebuffer,i=(n.clear,n.getViewportSize),o=n.createTexture2D,a=(n.useFramebuffer,this.styleAttributeService.getLayerStyleAttribute("shape")),s=(null==a||null===(t=a.scale)||void 0===t?void 0:t.field)||"heatmap";this.shapeType=s,this.intensityModel=this.buildHeatMapIntensity(),this.colorModel="heatmap"===s?this.buildHeatmapColor():this.build3dHeatMap();Yh(this.layer.getLayerConfig().rampColors);var u=i(),c=u.width,l=u.height;return this.heatmapFramerBuffer=r({color:o({width:Math.floor(c/4),height:Math.floor(l/4),wrapS:e.gl.CLAMP_TO_EDGE,wrapT:e.gl.CLAMP_TO_EDGE,min:e.gl.LINEAR,mag:e.gl.LINEAR}),depth:!1}),this.updateColorTexture(),[this.intensityModel,this.colorModel]}},{key:"buildModels",value:function(){return this.initModels()}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"dir",type:e.AttributeType.Attribute,descriptor:{name:"a_Dir",buffer:{usage:e.gl.DYNAMIC_DRAW,data:[],type:e.gl.FLOAT},size:2,update:function(e,t,n,r){return[n[3],n[4]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:e.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:e.gl.DYNAMIC_DRAW,data:[],type:e.gl.FLOAT},size:1,update:function(e,t,n,r){var i=e.size;return[void 0===i?1:i]}}})}},{key:"buildHeatMapIntensity",value:function(){return this.layer.buildLayerModel({moduleName:"heatmapintensity",vertexShader:'precision highp float;\nattribute vec3 a_Position;\nattribute float a_Size;\nattribute vec2 a_Dir;\nuniform float u_intensity;\nuniform float u_radius;\nvarying vec2 v_extrude;\nvarying float v_weight;\nuniform mat4 u_ModelMatrix;\n#define GAUSS_COEF 0.3989422804014327\n#pragma include "projection"\nvoid main(){\nv_weight = a_Size;\nfloat ZERO = 1.0 / 255.0 / 16.0;\nfloat extrude_x = a_Dir.x * 2.0 -1.0;\nfloat extrude_y = a_Dir.y * 2.0 -1.0;\nvec2 extrude_dir = normalize(vec2(extrude_x,extrude_y));\nfloat S = sqrt(-2.0 * log(ZERO / a_Size / u_intensity / GAUSS_COEF)) / 3.0;\nv_extrude = extrude_dir * S;\nvec2 offset = project_pixel(v_extrude * u_radius);\nvec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0));\ngl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, 0.0, 1.0));\n}',fragmentShader:"precision highp float;\nuniform float u_intensity;\nvarying float v_weight;\nvarying vec2 v_extrude;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(){\nfloat d = -0.5 * 3.0 * 3.0 * dot(v_extrude, v_extrude);\nfloat val = v_weight * u_intensity * GAUSS_COEF * exp(d);\ngl_FragColor = vec4(val, 1., 1., 1.);\n}",triangulation:hO,depth:{enable:!1},blend:{enable:!0,func:{srcRGB:e.gl.ONE,srcAlpha:1,dstRGB:e.gl.ONE,dstAlpha:1}}})}},{key:"buildHeatmapColor",value:function(){this.shaderModuleService.registerModule("heatmapColor",{vs:"precision highp float;\nattribute vec3 a_Position;\nattribute vec2 a_Uv;\nuniform sampler2D u_texture;\nvarying vec2 v_texCoord;\nvarying float v_intensity;\nvoid main() {\nv_texCoord = a_Uv;\nv_intensity = texture2D(u_texture, v_texCoord).r;\ngl_Position = vec4(a_Position.xy, 0, 1.);\n}",fs:"uniform sampler2D u_texture;\nuniform sampler2D u_colorTexture;\nuniform float u_opacity;\nvarying vec2 v_texCoord;\nvarying float v_intensity;\nvoid main(){\nfloat intensity = texture2D(u_texture, v_texCoord).r;\nvec4 color = texture2D(u_colorTexture,vec2(intensity, 0));\ngl_FragColor =color;\ngl_FragColor.a = color.a * smoothstep(0.,0.1,intensity) * u_opacity;\n}"});var t=this.shaderModuleService.getModule("heatmapColor"),n=t.vs,r=t.fs,i=t.uniforms,o=this.rendererService,a=o.createAttribute,s=o.createElements,u=o.createBuffer;return(0,o.createModel)({vs:n,fs:r,attributes:{a_Position:a({buffer:u({data:[-1,1,0,1,1,0,-1,-1,0,1,-1,0],type:e.gl.FLOAT}),size:3}),a_Uv:a({buffer:u({data:[0,1,1,1,0,0,1,0],type:e.gl.FLOAT}),size:2})},uniforms:Qi({},i),depth:{enable:!1},blend:this.getBlend(),count:6,elements:s({data:[0,2,1,2,3,1],type:e.gl.UNSIGNED_INT,count:6})})}},{key:"drawIntensityMode",value:function(){var e=this.layer.getLayerConfig(),t=e.opacity,n=e.intensity,r=void 0===n?10:n,i=e.radius,o=void 0===i?5:i;this.intensityModel.draw({uniforms:{u_opacity:t||1,u_radius:o,u_intensity:r}})}},{key:"drawColorMode",value:function(){var e=this.layer.getLayerConfig().opacity;this.colorModel.draw({uniforms:{u_opacity:e||1,u_colorTexture:this.colorTexture,u_texture:this.heatmapFramerBuffer}})}},{key:"draw3DHeatMap",value:function(){var e=this.layer.getLayerConfig().opacity,t=ov(tv(),rv.apply(xv,lo(this.cameraService.getViewProjectionMatrixUncentered())));this.colorModel.draw({uniforms:{u_opacity:e||1,u_colorTexture:this.colorTexture,u_texture:this.heatmapFramerBuffer,u_ViewProjectionMatrixUncentered:this.cameraService.getViewProjectionMatrixUncentered(),u_InverseViewProjectionMatrix:lo(t)}})}},{key:"build3dHeatMap",value:function(){var t=(0,this.rendererService.getViewportSize)(),n=function(e,t){for(var n=[],r=[],i=[],o=e+1,a=t+1,s=e/2,u=t/2,c=0;c<a;c++)for(var l=c-u,f=0;f<o;f++){var h=f-s;r.push(h/s,-l/u,0),i.push(f/e),i.push(1-c/t)}for(var d=0;d<t;d++)for(var p=0;p<e;p++){var v=p+o*d,g=p+o*(d+1),m=p+1+o*(d+1),y=p+1+o*d;n.push(v,g,y),n.push(g,m,y)}return{vertices:r,indices:n,uvs:i}}(t.width/4,t.height/4);this.shaderModuleService.registerModule("heatmap3dColor",{vs:'precision highp float;\nattribute vec3 a_Position;\nattribute vec2 a_Uv;\nuniform sampler2D u_texture;\nvarying vec2 v_texCoord;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_InverseViewProjectionMatrix;\nuniform mat4 u_ViewProjectionMatrixUncentered;\nvarying float v_intensity;\nvec2 toBezier(float t, vec2 P0, vec2 P1, vec2 P2, vec2 P3) {\nfloat t2 = t * t;\nfloat one_minus_t = 1.0 - t;\nfloat one_minus_t2 = one_minus_t * one_minus_t;\nreturn (P0 * one_minus_t2 * one_minus_t + P1 * 3.0 * t * one_minus_t2 + P2 * 3.0 * t2 * one_minus_t + P3 * t2 * t);\n}\nvec2 toBezier(float t, vec4 p){\nreturn toBezier(t, vec2(0.0, 0.0), vec2(p.x, p.y), vec2(p.z, p.w), vec2(1.0, 1.0));\n}\n#pragma include "projection"\nvoid main() {\nv_texCoord = a_Uv;\nvec2 pos =(a_Uv * vec2(2.0) - vec2(1.0));\nvec4 p1 = vec4(pos, 0.0, 1.0);\nvec4 p2 = vec4(pos, 1.0, 1.0);\nvec4 inverseP1 = u_InverseViewProjectionMatrix * p1;\nvec4 inverseP2 = u_InverseViewProjectionMatrix * p2;\ninverseP1 = inverseP1 / inverseP1.w;\ninverseP2 = inverseP2 / inverseP2.w;\nfloat zPos = (0.0 - inverseP1.z) / (inverseP2.z - inverseP1.z);\nvec4 position = inverseP1 + zPos * (inverseP2 - inverseP1);\nvec4 b= vec4(0.5000, 0, 1, 0.5000);\nfloat fh;\nv_intensity = texture2D(u_texture, v_texCoord).r;\nfh = toBezier(v_intensity, b).y;\ngl_Position = u_ViewProjectionMatrixUncentered * vec4(position.xy, fh * project_pixel(50.), 1.0);\n}',fs:"uniform sampler2D u_texture;\nuniform sampler2D u_colorTexture;\nuniform float u_opacity;\nvarying vec2 v_texCoord;\nvarying float v_intensity;\nvoid main(){\nfloat intensity = texture2D(u_texture, v_texCoord).r;\nvec4 color = texture2D(u_colorTexture,vec2(intensity, 0));\ngl_FragColor = color;\ngl_FragColor.a = color.a * smoothstep(0.,0.1,intensity) * u_opacity;\n}"});var r=this.shaderModuleService.getModule("heatmap3dColor"),i=r.vs,o=r.fs,a=r.uniforms,s=this.rendererService,u=s.createAttribute,c=s.createElements,l=s.createBuffer;return(0,s.createModel)({vs:i,fs:o,attributes:{a_Position:u({buffer:l({data:n.vertices,type:e.gl.FLOAT}),size:3}),a_Uv:u({buffer:l({data:n.uvs,type:e.gl.FLOAT}),size:2})},primitive:e.gl.TRIANGLES,uniforms:Qi({},a),depth:{enable:!0},blend:{enable:!0,func:{srcRGB:e.gl.SRC_ALPHA,srcAlpha:1,dstRGB:e.gl.ONE_MINUS_SRC_ALPHA,dstAlpha:1}},elements:c({data:n.indices,type:e.gl.UNSIGNED_INT,count:n.indices.length})})}},{key:"updateStyle",value:function(){this.updateColorTexture()}},{key:"updateColorTexture",value:function(){var t=this.rendererService.createTexture2D;this.texture&&this.texture.destroy();var n=Yh(this.layer.getLayerConfig().rampColors);this.colorTexture=t({data:new Uint8Array(n.data),width:n.width,height:n.height,wrapS:e.gl.CLAMP_TO_EDGE,wrapT:e.gl.CLAMP_TO_EDGE,min:e.gl.NEAREST,mag:e.gl.NEAREST,flipY:!1})}}]),r}(aP),_O={heatmap:bO,heatmap3d:bO,grid:mO,grid3d:yO,hexagon:function(t){Ji(r,t);var n=so(r);function r(){return Wi(this,r),n.apply(this,arguments)}return Xi(r,[{key:"getUninforms",value:function(){var e=this.layer.getLayerConfig();return{u_opacity:e.opacity||1,u_coverage:e.coverage||.9,u_angle:e.angle||0,u_radius:[this.layer.getSource().data.xOffset,this.layer.getSource().data.yOffset]}}},{key:"initModels",value:function(){return this.buildModels()}},{key:"buildModels",value:function(){return[this.layer.buildLayerModel({moduleName:"hexagonheatmap",vertexShader:'precision highp float;\nattribute vec3 a_Position;\nattribute vec3 a_Pos;\nattribute float a_Size;\nattribute vec4 a_Color;\nuniform vec2 u_radius;\nuniform float u_coverage: 0.9;\nuniform float u_angle: 0;\nuniform mat4 u_ModelMatrix;\nvarying vec4 v_color;\n#pragma include "projection"\n#pragma include "project"\n#pragma include "picking"\nvoid main() {\nv_color = a_Color;\nmat2 rotationMatrix = mat2(cos(u_angle), sin(u_angle), -sin(u_angle), cos(u_angle));\nvec2 offset =(vec2(a_Position.xy * u_radius * rotationMatrix * u_coverage));\nvec2 lnglat = unProjectFlat(a_Pos.xy + offset);\nvec4 project_pos = project_position(vec4(lnglat, 0, 1.0));\ngl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, 0., 1.0));\nsetPickingColor(a_PickingColor);\n}',fragmentShader:gO,triangulation:cO,depth:{enable:!1},primitive:e.gl.TRIANGLES,blend:this.getBlend()})]}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"pos",type:e.AttributeType.Attribute,descriptor:{name:"a_Pos",buffer:{usage:e.gl.DYNAMIC_DRAW,data:[],type:e.gl.FLOAT},size:3,update:function(e,t){var n=e.coordinates;return[n[0],n[1],0]}}})}}]),r}(aP)},xO=function(e){Ji(n,e);var t=so(n);function n(){var e;Wi(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).type="HeatMapLayer",e}return Xi(n,[{key:"buildModels",value:function(){var e=this.getModelType();this.layerModel=new _O[e](this),this.models=this.layerModel.initModels()}},{key:"rebuildModels",value:function(){this.models=this.layerModel.buildModels()}},{key:"renderModels",value:function(){var e=this;return"heatmap"===this.getModelType()?(this.layerModel&&this.layerModel.render(),this):(this.layerModelNeedUpdate&&(this.models=this.layerModel.buildModels(),this.layerModelNeedUpdate=!1),this.models.forEach((function(t){return t.draw({uniforms:e.layerModel.getUninforms()})})),this)}},{key:"getConfigSchema",value:function(){return{properties:{opacity:{type:"number",minimum:0,maximum:1}}}}},{key:"getModelType",value:function(){var e,t=this.styleAttributeService.getLayerStyleAttribute("shape"),n=this.getLayerConfig().shape3d,r=this.getSource().data.type,i=(null==t||null===(e=t.scale)||void 0===e?void 0:e.field)||"heatmap";return"heatmap"===i||"heatmap3d"===i?"heatmap":"hexagon"===r?-1===(null==n?void 0:n.indexOf(i))?"hexagon":"grid3d":"grid"===r?-1===(null==n?void 0:n.indexOf(i))?"grid":"grid3d":"heatmap"}}]),n}(oP),wO={image:function(t){Ji(r,t);var n=so(r);function r(){var e;Wi(this,r);for(var t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];return(e=n.call.apply(n,[this].concat(i))).texture=void 0,e}return Xi(r,[{key:"getUninforms",value:function(){return{u_opacity:this.layer.getLayerConfig().opacity||1,u_texture:this.texture}}},{key:"initModels",value:function(){var t=this,n=this.layer.getSource(),r=this.rendererService.createTexture2D;return this.texture=r({height:0,width:0}),n.data.images.then((function(e){t.texture=r({data:e[0],width:e[0].width,height:e[0].height}),t.layerService.renderLayers()})),[this.layer.buildLayerModel({moduleName:"RasterImage",vertexShader:'precision highp float;\nuniform mat4 u_ModelMatrix;\nattribute vec3 a_Position;\nattribute vec2 a_Uv;\nvarying vec2 v_texCoord;\n#pragma include "projection"\nvoid main() {\nv_texCoord = a_Uv;\nvec4 project_pos = project_position(vec4(a_Position, 1.0));\ngl_Position = project_common_position_to_clipspace(vec4(project_pos.xy,0., 1.0));\n}',fragmentShader:"precision mediump float;\nuniform float u_opacity: 1.0;\nuniform sampler2D u_texture;\nvarying vec2 v_texCoord;\nvoid main() {\nvec4 color = texture2D(u_texture,vec2(v_texCoord.x,v_texCoord.y));\ngl_FragColor = color;\n}",triangulation:lO,primitive:e.gl.TRIANGLES,depth:{enable:!1},blend:this.getBlend()})]}},{key:"buildModels",value:function(){return this.initModels()}},{key:"getConfigSchema",value:function(){return{properties:{opacity:{type:"number",minimum:0,maximum:1}}}}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:e.AttributeType.Attribute,descriptor:{name:"a_Uv",buffer:{usage:e.gl.DYNAMIC_DRAW,data:[],type:e.gl.FLOAT},size:2,update:function(e,t,n,r){return[n[3],n[4]]}}})}}]),r}(aP)},SO=function(e){Ji(n,e);var t=so(n);function n(){var e;Wi(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).type="ImageLayer",e}return Xi(n,[{key:"buildModels",value:function(){var e=this.getModelType();this.layerModel=new wO[e](this),this.models=this.layerModel.initModels()}},{key:"rebuildModels",value:function(){this.models=this.layerModel.buildModels()}},{key:"getConfigSchema",value:function(){return{properties:{opacity:{type:"number",minimum:0,maximum:1}}}}},{key:"getDefaultConfig",value:function(){return{image:{}}[this.getModelType()]}},{key:"getModelType",value:function(){return"image"}}]),n}(oP),EO='#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\nuniform float u_opacity;\nuniform float u_blur : 0.9;\nuniform float u_line_type: 0.0;\nvarying vec2 v_normal;\nvarying vec4 v_dash_array;\nvarying float v_distance_ratio;\nvarying vec4 v_color;\nuniform float u_time;\nuniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];\n#pragma include "picking"\nvoid main() {\ngl_FragColor = v_color;\ngl_FragColor.a *= u_opacity;\nif(u_line_type == LineTypeDash) {\nfloat flag = 0.;\nfloat dashLength = mod(v_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);\nif(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) {\nflag = 1.;\n}\ngl_FragColor.a *=flag;\n}\nif(u_aimate.x == Animate) {\nfloat alpha =1.0 - fract( mod(1.0- v_distance_ratio, u_aimate.z)* (1.0/ u_aimate.z) + u_time / u_aimate.y);\nalpha = (alpha + u_aimate.w -1.0) / u_aimate.w;\nalpha = smoothstep(0., 1., alpha);\ngl_FragColor.a *= alpha;\n}\ngl_FragColor = filterColor(gl_FragColor);\n}',AO={solid:0,dash:1},TO=function(t){Ji(r,t);var n=so(r);function r(){return Wi(this,r),n.apply(this,arguments)}return Xi(r,[{key:"getUninforms",value:function(){var e=this.layer.getLayerConfig(),t=e.opacity,n=e.lineType,r=void 0===n?"solid":n,i=e.dashArray,o=void 0===i?[10,5]:i;return 2===o.length&&o.push(0,0),{u_opacity:t||1,segmentNumber:30,u_line_type:AO[r||"solid"],u_dash_array:o,u_blur:.9}}},{key:"getAnimateUniforms",value:function(){var e=this.layer.getLayerConfig().animateOption;return{u_aimate:this.animateOption2Array(e),u_time:this.layer.getLayerAnimateTime()}}},{key:"initModels",value:function(){return this.buildModels()}},{key:"buildModels",value:function(){return[this.layer.buildLayerModel({moduleName:"arc2dline",vertexShader:'#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\nattribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec4 a_Instance;\nattribute float a_Size;\nuniform mat4 u_ModelMatrix;\nuniform float segmentNumber;\nuniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_distance_ratio;\nuniform float u_line_type: 0.0;\nuniform vec4 u_dash_array: [10.0, 5., 0, 0];\nvarying vec4 v_dash_array;\n#pragma include "projection"\n#pragma include "project"\n#pragma include "picking"\nfloat bezier3(vec3 arr, float t) {\nfloat ut = 1. - t;\nreturn (arr.x * ut + arr.y * t) * ut + (arr.y * ut + arr.z * t) * t;\n}\nvec2 midPoint(vec2 source, vec2 target) {\nvec2 center = target - source;\nfloat r = length(center);\nfloat theta = atan(center.y, center.x);\nfloat thetaOffset = 0.314;\nfloat r2 = r / 2.0 / cos(thetaOffset);\nfloat theta2 = theta + thetaOffset;\nvec2 mid = vec2(r2*cos(theta2) + source.x, r2*sin(theta2) + source.y);\nreturn mid;\n}\nfloat getSegmentRatio(float index) {\nreturn smoothstep(0.0, 1.0, index / (segmentNumber - 1.));\n}\nvec2 interpolate (vec2 source, vec2 target, float t) {\nvec2 mid = midPoint(source, target);\nvec3 x = vec3(source.x, mid.x, target.x);\nvec3 y = vec3(source.y, mid.y, target.y);\nreturn vec2(bezier3(x ,t), bezier3(y,t));\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {\nvec2 dir_screenspace = normalize(line_clipspace);\ndir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\nvec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size) / 2.0;\nreturn offset;\n}\nvec2 getNormal(vec2 line_clipspace, float offset_direction) {\nvec2 dir_screenspace = normalize(line_clipspace);\ndir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\nreturn reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction);\n}\nvoid main() {\nv_color = a_Color;\nvec2 source = a_Instance.rg;\nvec2 target = a_Instance.ba;\nfloat segmentIndex = a_Position.x;\nfloat segmentRatio = getSegmentRatio(segmentIndex);\nfloat indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\nfloat nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\nif(u_line_type == LineTypeDash) {\nv_distance_ratio = segmentIndex / segmentNumber;\nfloat total_Distance = pixelDistance(a_Instance.rg, a_Instance.ba) / 2.0 * PI;\nv_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex);\n}\nif(u_aimate.x == Animate) {\nv_distance_ratio = segmentIndex / segmentNumber;\n}\nvec4 curr = project_position(vec4(interpolate(source, target, segmentRatio), 0.0, 1.0));\nvec4 next = project_position(vec4(interpolate(source, target, nextSegmentRatio), 0.0, 1.0));\nv_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y);\nvec2 offset = project_pixel(getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y));\ngl_Position = project_common_position_to_clipspace(vec4(curr.xy + offset, 0, 1.0));\nsetPickingColor(a_PickingColor);\n}',fragmentShader:EO,triangulation:fO,depth:{enable:!1},blend:this.getBlend()})]}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:e.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:e.gl.DYNAMIC_DRAW,data:[],type:e.gl.FLOAT},size:1,update:function(e,t,n,r){var i=e.size,o=void 0===i?1:i;return Array.isArray(o)?[o[0]]:[o]}}}),this.styleAttributeService.registerStyleAttribute({name:"instance",type:e.AttributeType.Attribute,descriptor:{name:"a_Instance",buffer:{usage:e.gl.STATIC_DRAW,data:[],type:e.gl.FLOAT},size:4,update:function(e,t,n,r){return[n[3],n[4],n[5],n[6]]}}})}}]),r}(aP),kO={solid:0,dash:1},MO=function(t){Ji(r,t);var n=so(r);function r(){return Wi(this,r),n.apply(this,arguments)}return Xi(r,[{key:"getUninforms",value:function(){var e=this.layer.getLayerConfig(),t=e.opacity,n=e.lineType,r=void 0===n?"solid":n,i=e.dashArray,o=void 0===i?[10,5]:i;return 2===o.length&&o.push(0,0),{u_opacity:t||1,segmentNumber:30,u_line_type:kO[r]||0,u_dash_array:o}}},{key:"getAnimateUniforms",value:function(){var e=this.layer.getLayerConfig().animateOption;return{u_aimate:this.animateOption2Array(e),u_time:this.layer.getLayerAnimateTime()}}},{key:"initModels",value:function(){return this.buildModels()}},{key:"buildModels",value:function(){return[this.layer.buildLayerModel({moduleName:"arc3Dline",vertexShader:'#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\nattribute vec3 a_Position;\nattribute vec4 a_Instance;\nattribute vec4 a_Color;\nattribute float a_Size;\nuniform mat4 u_ModelMatrix;\nuniform float segmentNumber;\nuniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_distance_ratio;\nuniform float u_line_type: 0.0;\nuniform vec4 u_dash_array: [10.0, 5., 0, 0];\nvarying vec4 v_dash_array;\n#pragma include "projection"\n#pragma include "project"\n#pragma include "picking"\nfloat maps (float value, float start1, float stop1, float start2, float stop2) {\nreturn start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1));\n}\nfloat getSegmentRatio(float index) {\nreturn smoothstep(0.0, 1.0, index / (segmentNumber - 1.0));\n}\nfloat paraboloid(vec2 source, vec2 target, float ratio) {\nvec2 x = mix(source, target, ratio);\nvec2 center = mix(source, target, 0.5);\nfloat dSourceCenter = distance(source, center);\nfloat dXCenter = distance(x, center);\nreturn (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);\n}\nvec3 getPos(vec2 source, vec2 target, float segmentRatio) {\nfloat vertex_height = paraboloid(source, target, segmentRatio);\nreturn vec3(\nmix(source, target, segmentRatio),\nsqrt(max(0.0, vertex_height))\n);\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {\nvec2 dir_screenspace = normalize(line_clipspace);\ndir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\nvec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size) / 2.0;\nreturn offset;\n}\nvec2 getNormal(vec2 line_clipspace, float offset_direction) {\nvec2 dir_screenspace = normalize(line_clipspace);\ndir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\nreturn reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction);\n}\nvoid main() {\nv_color = a_Color;\nvec2 source = project_position(vec4(a_Instance.rg, 0, 0)).xy;\nvec2 target = project_position(vec4(a_Instance.ba, 0, 0)).xy;\nfloat segmentIndex = a_Position.x;\nfloat segmentRatio = getSegmentRatio(segmentIndex);\nfloat indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\nif(u_line_type == LineTypeDash) {\nv_distance_ratio = segmentIndex / segmentNumber;\nfloat total_Distance = pixelDistance(a_Instance.rg, a_Instance.ba) / 2.0 * PI;\nv_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex);\n}\nif(u_aimate.x == Animate) {\nv_distance_ratio = segmentIndex / segmentNumber;\n}\nfloat nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\nvec3 curr = getPos(source, target, segmentRatio);\nvec3 next = getPos(source, target, nextSegmentRatio);\nvec2 offset = getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y);\nv_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y);\ngl_Position = project_common_position_to_clipspace(vec4(curr.xy + project_pixel(offset), curr.z, 1.0));\nsetPickingColor(a_PickingColor);\n}',fragmentShader:EO,triangulation:fO,blend:this.getBlend()})]}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:e.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:e.gl.DYNAMIC_DRAW,data:[],type:e.gl.FLOAT},size:1,update:function(e,t,n,r){var i=e.size,o=void 0===i?1:i;return Array.isArray(o)?[o[0]]:[o]}}}),this.styleAttributeService.registerStyleAttribute({name:"instance",type:e.AttributeType.Attribute,descriptor:{name:"a_Instance",buffer:{usage:e.gl.STATIC_DRAW,data:[],type:e.gl.FLOAT},size:4,update:function(e,t,n,r){return[n[3],n[4],n[5],n[6]]}}})}}]),r}(aP),CO={solid:0,dash:1},IO=function(t){Ji(r,t);var n=so(r);function r(){return Wi(this,r),n.apply(this,arguments)}return Xi(r,[{key:"getUninforms",value:function(){var e=this.layer.getLayerConfig(),t=e.opacity,n=e.lineType,r=void 0===n?"solid":n,i=e.dashArray,o=void 0===i?[10,5]:i;return 2===o.length&&o.push(0,0),{u_opacity:t||1,segmentNumber:30,u_line_type:CO[r]||0,u_dash_array:o}}},{key:"getAnimateUniforms",value:function(){var e=this.layer.getLayerConfig().animateOption;return{u_aimate:this.animateOption2Array(e),u_time:this.layer.getLayerAnimateTime()}}},{key:"initModels",value:function(){return this.buildModels()}},{key:"buildModels",value:function(){return[this.layer.buildLayerModel({moduleName:"arc2dline",vertexShader:'#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\nattribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec4 a_Instance;\nattribute float a_Size;\nuniform mat4 u_ModelMatrix;\nuniform float segmentNumber;\nuniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_distance_ratio;\nuniform float u_line_type: 0.0;\nuniform vec4 u_dash_array: [10.0, 5., 0, 0];\nvarying vec4 v_dash_array;\n#pragma include "projection"\n#pragma include "project"\n#pragma include "picking"\nfloat maps (float value, float start1, float stop1, float start2, float stop2) {\nreturn start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1));\n}\nfloat getSegmentRatio(float index) {\nreturn smoothstep(0.0, 1.0, index / (segmentNumber - 1.));\n}\nfloat paraboloid(vec2 source, vec2 target, float ratio) {\nvec2 x = mix(source, target, ratio);\nvec2 center = mix(source, target, 0.5);\nfloat dSourceCenter = distance(source, center);\nfloat dXCenter = distance(x, center);\nreturn (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);\n}\nvec3 getPos(vec2 source, vec2 target, float segmentRatio) {\nfloat vertex_height = paraboloid(source, target, segmentRatio);\nreturn vec3(\nmix(source, target, segmentRatio),\nsqrt(max(0.0, vertex_height))\n);\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {\nvec2 dir_screenspace = normalize(line_clipspace);\ndir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\nvec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size)/ 2.0;\nreturn offset;\n}\nvec2 getNormal(vec2 line_clipspace, float offset_direction) {\nvec2 dir_screenspace = normalize(line_clipspace);\ndir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\nreturn reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction);\n}\nfloat getAngularDist (vec2 source, vec2 target) {\nvec2 delta = source - target;\nvec2 sin_half_delta = sin(delta / 2.0);\nfloat a =\nsin_half_delta.y * sin_half_delta.y +\ncos(source.y) * cos(target.y) *\nsin_half_delta.x * sin_half_delta.x;\nreturn 2.0 * atan(sqrt(a), sqrt(1.0 - a));\n}\nvec2 interpolate (vec2 source, vec2 target, float angularDist, float t) {\nif(abs(angularDist - PI) < 0.001) {\nreturn (1.0 - t) * source + t * target;\n}\nfloat a = sin((1.0 - t) * angularDist) / sin(angularDist);\nfloat b = sin(t * angularDist) / sin(angularDist);\nvec2 sin_source = sin(source);\nvec2 cos_source = cos(source);\nvec2 sin_target = sin(target);\nvec2 cos_target = cos(target);\nfloat x = a * cos_source.y * cos_source.x + b * cos_target.y * cos_target.x;\nfloat y = a * cos_source.y * sin_source.x + b * cos_target.y * sin_target.x;\nfloat z = a * sin_source.y + b * sin_target.y;\nreturn vec2(atan(y, x), atan(z, sqrt(x * x + y * y)));\n}\nvoid main() {\nv_color = a_Color;\nvec2 source = radians(a_Instance.rg);\nvec2 target = radians(a_Instance.ba);\nfloat angularDist = getAngularDist(source, target);\nfloat segmentIndex = a_Position.x;\nfloat segmentRatio = getSegmentRatio(segmentIndex);\nfloat indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\nif(u_line_type == LineTypeDash) {\nv_distance_ratio = segmentIndex / segmentNumber;\nfloat total_Distance = pixelDistance(a_Instance.rg, a_Instance.ba);\nv_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex);\n}\nif(u_aimate.x == Animate) {\nv_distance_ratio = segmentIndex / segmentNumber;\n}\nfloat nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\nv_distance_ratio = segmentIndex / segmentNumber;\nvec4 curr = project_position(vec4(degrees(interpolate(source, target, angularDist, segmentRatio)), 0.0, 1.0));\nvec4 next = project_position(vec4(degrees(interpolate(source, target, angularDist, nextSegmentRatio)), 0.0, 1.0));\nv_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y);\nvec2 offset = project_pixel(getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y));\ngl_Position = project_common_position_to_clipspace(vec4(curr.xy + offset, curr.z, 1.0));\nsetPickingColor(a_PickingColor);\n}',fragmentShader:EO,triangulation:fO,depth:{enable:!1},blend:this.getBlend()})]}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:e.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:e.gl.DYNAMIC_DRAW,data:[],type:e.gl.FLOAT},size:1,update:function(e,t,n,r){var i=e.size,o=void 0===i?1:i;return Array.isArray(o)?[o[0]]:[o]}}}),this.styleAttributeService.registerStyleAttribute({name:"instance",type:e.AttributeType.Attribute,descriptor:{name:"a_Instance",buffer:{usage:e.gl.STATIC_DRAW,data:[],type:e.gl.FLOAT},size:4,update:function(e,t,n,r){return[n[3],n[4],n[5],n[6]]}}})}}]),r}(aP),PO={solid:0,dash:1},OO=function(t){Ji(r,t);var n=so(r);function r(){return Wi(this,r),n.apply(this,arguments)}return Xi(r,[{key:"getUninforms",value:function(){var e=this.layer.getLayerConfig(),t=e.opacity,n=e.lineType,r=void 0===n?"solid":n,i=e.dashArray,o=void 0===i?[10,5,0,0]:i;return 2===o.length&&o.push(0,0),{u_opacity:t||1,u_line_type:PO[r],u_dash_array:o}}},{key:"getAnimateUniforms",value:function(){var e=this.layer.getLayerConfig().animateOption;return{u_aimate:this.animateOption2Array(e),u_time:this.layer.getLayerAnimateTime()}}},{key:"initModels",value:function(){return this.buildModels()}},{key:"buildModels",value:function(){return[this.layer.buildLayerModel({moduleName:"line",vertexShader:'#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\nattribute float a_Miter;\nattribute vec4 a_Color;\nattribute vec2 a_Size;\nattribute vec3 a_Normal;\nattribute vec3 a_Position;\nattribute float a_Total_Distance;\nattribute float a_Distance;\nuniform mat4 u_ModelMatrix;\nuniform float u_line_type: 0.0;\nuniform vec4 u_dash_array: [10.0, 5.,0, 0];\nuniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];\n#pragma include "projection"\n#pragma include "picking"\nvarying vec4 v_color;\nvarying vec4 v_dash_array;\nvarying vec2 v_normal;\nvarying float v_distance_ratio;\nvarying float v_side;\nvoid main() {\nif(u_line_type == LineTypeDash) {\nv_distance_ratio = a_Distance / a_Total_Distance;\nv_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / a_Total_Distance;\n}\nif(u_aimate.x == Animate) {\nv_distance_ratio = a_Distance / a_Total_Distance;\n}\nv_normal = vec2(reverse_offset_normal(a_Normal) * sign(a_Miter));\nv_color = a_Color;\nvec3 size = a_Miter * setPickingSize(a_Size.x) * reverse_offset_normal(a_Normal);\nvec2 offset = project_pixel(size.xy);\nv_side = a_Miter * a_Size.x;\nvec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));\ngl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, a_Size.y, 1.0));\nsetPickingColor(a_PickingColor);\n}',fragmentShader:'#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\nuniform float u_blur : 0.99;\nuniform float u_line_type: 0.0;\nuniform float u_opacity : 1.0;\nvarying vec4 v_color;\nvarying vec2 v_normal;\nuniform float u_dash_offset : 0.0;\nuniform float u_dash_ratio : 0.1;\nvarying float v_distance_ratio;\nvarying vec4 v_dash_array;\nvarying float v_side;\n#pragma include "picking"\nuniform float u_time;\nuniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];\nvoid main() {\ngl_FragColor = v_color;\nif(u_aimate.x == Animate) {\nfloat alpha =1.0 - fract( mod(1.0- v_distance_ratio, u_aimate.z)* (1.0/ u_aimate.z) + u_time / u_aimate.y);\nalpha = (alpha + u_aimate.w -1.0) / u_aimate.w;\nalpha = smoothstep(0., 1., alpha);\ngl_FragColor.a *= alpha;\n}\nif(u_line_type == LineTypeDash) {\nfloat flag = 0.;\nfloat dashLength = mod(v_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);\nif(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) {\nflag = 1.;\n}\ngl_FragColor.a *=flag;\n}\ngl_FragColor = filterColor(gl_FragColor);\n}',triangulation:aO,primitive:e.gl.TRIANGLES,blend:this.getBlend(),depth:{enable:!1}})]}},{key:"registerBuiltinAttributes",value:function(){this.layer.getLayerConfig().lineType;this.styleAttributeService.registerStyleAttribute({name:"distance",type:e.AttributeType.Attribute,descriptor:{name:"a_Distance",buffer:{usage:e.gl.STATIC_DRAW,data:[],type:e.gl.FLOAT},size:1,update:function(e,t,n,r){return[n[3]]}}}),this.styleAttributeService.registerStyleAttribute({name:"total_distance",type:e.AttributeType.Attribute,descriptor:{name:"a_Total_Distance",buffer:{usage:e.gl.STATIC_DRAW,data:[],type:e.gl.FLOAT},size:1,update:function(e,t,n,r){return[n[5]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:e.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:e.gl.DYNAMIC_DRAW,data:[],type:e.gl.FLOAT},size:2,update:function(e,t,n,r){var i=e.size,o=void 0===i?1:i;return Array.isArray(o)?[o[0],o[1]]:[o,0]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:e.AttributeType.Attribute,descriptor:{name:"a_Normal",buffer:{usage:e.gl.STATIC_DRAW,data:[],type:e.gl.FLOAT},size:3,update:function(e,t,n,r,i){return i}}}),this.styleAttributeService.registerStyleAttribute({name:"miter",type:e.AttributeType.Attribute,descriptor:{name:"a_Miter",buffer:{usage:e.gl.STATIC_DRAW,data:[],type:e.gl.FLOAT},size:1,update:function(e,t,n,r){return[n[4]]}}})}}]),r}(aP),RO={arc:TO,arc3d:MO,greatcircle:IO,line:OO},LO=function(e){Ji(n,e);var t=so(n);function n(){var e;Wi(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).type="LineLayer",e}return Xi(n,[{key:"buildModels",value:function(){var e=this.getModelType();this.layerModel=new RO[e](this),this.models=this.layerModel.initModels()}},{key:"rebuildModels",value:function(){this.models=this.layerModel.buildModels()}},{key:"getConfigSchema",value:function(){return{properties:{opacity:{type:"number",minimum:0,maximum:1}}}}},{key:"getDefaultConfig",value:function(){return{line:{},arc3d:{blend:"additive"},arc:{blend:"additive"},greatcircle:{blend:"additive"}}[this.getModelType()]}},{key:"getModelType",value:function(){var e,t=this.styleAttributeService.getLayerStyleAttribute("shape");return(null==t||null===(e=t.scale)||void 0===e?void 0:e.field)||"line"}}]),n}(oP),NO=function(t){Ji(r,t);var n=so(r);function r(){return Wi(this,r),n.apply(this,arguments)}return Xi(r,[{key:"getUninforms",value:function(){var e=this.layer.getLayerConfig();return{u_opacity:e.opacity||1,u_offsets:e.offsets||[0,0]}}},{key:"initModels",value:function(){return this.buildModels()}},{key:"buildModels",value:function(){return[this.layer.buildLayerModel({moduleName:"pointExtrude2",vertexShader:'precision highp float;\n#define ambientRatio 0.5\n#define diffuseRatio 0.3\n#define specularRatio 0.2\nattribute vec3 a_Position;\nattribute vec3 a_Pos;\nattribute vec4 a_Color;\nattribute vec3 a_Size;\nattribute vec3 a_Normal;\nuniform mat4 u_ModelMatrix;\nuniform vec2 u_offsets;\nvarying vec4 v_color;\n#pragma include "projection"\n#pragma include "light"\n#pragma include "picking"\nvoid main() {\nvec3 size = a_Size * a_Position;\nvec2 offset = project_pixel(size.xy);\nvec4 project_pos = project_position(vec4(a_Pos.xy, 0., 1.0));\nvec4 pos = vec4(project_pos.xy + offset, project_pixel(size.z), 1.0);\nfloat lightWeight = calc_lighting(pos);\nv_color =vec4(a_Color.rgb * lightWeight, a_Color.w);\ngl_Position = project_common_position_to_clipspace(pos);\nsetPickingColor(a_PickingColor);\n}',fragmentShader:'varying vec4 v_color;\nuniform float u_opacity: 1.0;\n#pragma include "picking"\nvoid main() {\ngl_FragColor = v_color;\ngl_FragColor.a *= u_opacity;\ngl_FragColor = filterColor(gl_FragColor);\n}',triangulation:iO,blend:this.getBlend()})]}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:e.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:e.gl.DYNAMIC_DRAW,data:[],type:e.gl.FLOAT},size:3,update:function(e,t,n,r){var i=e.size;if(i){var o=[];return Array.isArray(i)&&(o=2===i.length?[i[0],i[0],i[1]]:i),Array.isArray(i)||(o=[i]),o}return[2,2,2]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:e.AttributeType.Attribute,descriptor:{name:"a_Normal",buffer:{usage:e.gl.STATIC_DRAW,data:[],type:e.gl.FLOAT},size:3,update:function(e,t,n,r,i){return i}}}),this.styleAttributeService.registerStyleAttribute({name:"pos",type:e.AttributeType.Attribute,descriptor:{name:"a_Pos",buffer:{usage:e.gl.DYNAMIC_DRAW,data:[],type:e.gl.FLOAT},size:3,update:function(e,t){var n=WP(e.coordinates);return[n[0],n[1],0]}}})}}]),r}(aP),DO=function(t){Ji(r,t);var n=so(r);function r(){return Wi(this,r),n.apply(this,arguments)}return Xi(r,[{key:"getUninforms",value:function(){var e=this.layer.getLayerConfig(),t=e.opacity,n=void 0===t?1:t,r=e.stroke,i=void 0===r?"rgb(0,0,0,0)":r,o=e.strokeWidth,a=void 0===o?1:o,s=e.strokeOpacity,u=void 0===s?1:s,c=e.offsets,l=void 0===c?[0,0]:c;return{u_opacity:n,u_stroke_width:a,u_stroke_color:Wh(i),u_stroke_opacity:u,u_offsets:[-l[0],l[1]]}}},{key:"getAnimateUniforms",value:function(){var e=this.layer.getLayerConfig().animateOption;return{u_aimate:this.animateOption2Array(e),u_time:this.layer.getLayerAnimateTime()}}},{key:"getAttribute",value:function(){return this.styleAttributeService.createAttributesAndIndices(this.layer.getEncodedData(),rO)}},{key:"initModels",value:function(){return this.buildModels()}},{key:"buildModels",value:function(){return[this.layer.buildLayerModel({moduleName:"pointfill",vertexShader:'attribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec2 a_Extrude;\nattribute float a_Size;\nattribute float a_Shape;\nuniform mat4 u_ModelMatrix;\nuniform float u_stroke_width : 2;\nuniform vec2 u_offsets;\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\n#pragma include "projection"\n#pragma include "picking"\nvoid main() {\nv_color = a_Color;\nvec2 extrude = a_Extrude;\nfloat shape_type = a_Shape;\nfloat newSize = setPickingSize(a_Size);\nv_radius = newSize;\nvec2 offset = project_pixel(extrude * (newSize + u_stroke_width) + u_offsets);\nvec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0));\ngl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, 0.0, 1.0));\nfloat antialiasblur = 1.0 / u_DevicePixelRatio / (newSize + u_stroke_width);\nv_data = vec4(extrude, antialiasblur,shape_type);\nsetPickingColor(a_PickingColor);\n}',fragmentShader:'#define Animate 0.0\nuniform float u_blur : 0;\nuniform float u_opacity : 1;\nuniform float u_stroke_width : 1;\nuniform vec4 u_stroke_color : [0, 0, 0, 0];\nuniform float u_stroke_opacity : 1;\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\nuniform float u_time;\nuniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];\n#pragma include "sdf_2d"\n#pragma include "picking"\nvoid main() {\nint shape = int(floor(v_data.w + 0.5));\nlowp float antialiasblur = v_data.z;\nfloat antialiased_blur = -max(u_blur, antialiasblur);\nfloat r = v_radius / (v_radius + u_stroke_width);\nfloat outer_df;\nfloat inner_df;\nif (shape == 0) {\nouter_df = sdCircle(v_data.xy, 1.0);\ninner_df = sdCircle(v_data.xy, r);\n} else if (shape == 1) {\nouter_df = sdEquilateralTriangle(1.1 * v_data.xy);\ninner_df = sdEquilateralTriangle(1.1 / r * v_data.xy);\n} else if (shape == 2) {\nouter_df = sdBox(v_data.xy, vec2(1.));\ninner_df = sdBox(v_data.xy, vec2(r));\n} else if (shape == 3) {\nouter_df = sdPentagon(v_data.xy, 0.8);\ninner_df = sdPentagon(v_data.xy, r * 0.8);\n} else if (shape == 4) {\nouter_df = sdHexagon(v_data.xy, 0.8);\ninner_df = sdHexagon(v_data.xy, r * 0.8);\n} else if (shape == 5) {\nouter_df = sdOctogon(v_data.xy, 1.0);\ninner_df = sdOctogon(v_data.xy, r);\n} else if (shape == 6) {\nouter_df = sdHexagram(v_data.xy, 0.52);\ninner_df = sdHexagram(v_data.xy, r * 0.52);\n} else if (shape == 7) {\nouter_df = sdRhombus(v_data.xy, vec2(1.0));\ninner_df = sdRhombus(v_data.xy, vec2(r));\n} else if (shape == 8) {\nouter_df = sdVesica(v_data.xy, 1.1, 0.8);\ninner_df = sdVesica(v_data.xy, r * 1.1, r * 0.8);\n}\nfloat opacity_t = smoothstep(0.0, antialiased_blur, outer_df);\nfloat color_t = u_stroke_width < 0.01 ? 0.0 : smoothstep(\nantialiased_blur,\n0.0,\ninner_df\n);\nvec4 strokeColor = u_stroke_color == vec4(0) ? v_color : u_stroke_color;\nfloat PI = 3.14159;\nfloat N_RINGS = 3.0;\nfloat FREQ = 1.0;\ngl_FragColor = mix(vec4(v_color.rgb, v_color.a * u_opacity), strokeColor * u_stroke_opacity, color_t);\ngl_FragColor.a = gl_FragColor.a * opacity_t;\nif(u_aimate.x == Animate) {\nfloat d = length(v_data.xy);\nfloat intensity = clamp(cos(d * PI), 0.0, 1.0) * clamp(cos(2.0 * PI * (d * 2.0 * u_aimate.z - u_aimate.y * u_time)), 0.0, 1.0);\ngl_FragColor = vec4(gl_FragColor.xyz, intensity);\n}\ngl_FragColor = filterColor(gl_FragColor);\n}',triangulation:rO,depth:{enable:!1},blend:this.getBlend()})]}},{key:"animateOption2Array",value:function(e){return[e.enable?0:1,e.speed||1,e.rings||3,0]}},{key:"registerBuiltinAttributes",value:function(){var t=this;this.styleAttributeService.registerStyleAttribute({name:"extrude",type:e.AttributeType.Attribute,descriptor:{name:"a_Extrude",buffer:{usage:e.gl.DYNAMIC_DRAW,data:[],type:e.gl.FLOAT},size:2,update:function(e,t,n,r){var i=[1,1,-1,1,-1,-1,1,-1],o=r%4*2;return[i[o],i[o+1]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:e.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:e.gl.DYNAMIC_DRAW,data:[],type:e.gl.FLOAT},size:1,update:function(e,t,n,r){var i=e.size,o=void 0===i?5:i;return Array.isArray(o)?[o[0]]:[o]}}}),this.styleAttributeService.registerStyleAttribute({name:"shape",type:e.AttributeType.Attribute,descriptor:{name:"a_Shape",buffer:{usage:e.gl.DYNAMIC_DRAW,data:[],type:e.gl.FLOAT},size:1,update:function(e,n,r,i){var o=e.shape,a=void 0===o?2:o;return[t.layer.getLayerConfig().shape2d.indexOf(a)]}}})}}]),r}(aP),jO='uniform sampler2D u_texture;\nvarying vec4 v_color;\nvarying vec2 v_uv;\nuniform vec2 u_textSize;\nuniform float u_stroke_width : 1;\nuniform vec4 u_stroke_color : [1, 1, 1, 1];\nuniform float u_stroke_opacity : 1;\nuniform float u_opacity : 1;\nvarying float v_size;\n#pragma include "picking"\nvoid main(){\nvec2 pos= v_uv / u_textSize + gl_PointCoord / u_textSize * 64.;\nvec2 fragmentPosition = 2.0*gl_PointCoord - 1.0;\nfloat distance = length(fragmentPosition);\nfloat distanceSqrd = distance * distance;\nfloat radius = 1.;\nfloat r = 1.0 - smoothstep(radius-(radius*0.01),\nradius+(radius*0.01),\ndistanceSqrd);\nvec4 textureColor=texture2D(u_texture,pos);\nif(all(lessThan(v_color, vec4(1.0+0.00001))) && all(greaterThan(v_color, vec4(1.0-0.00001))) || v_color==vec4(1.0)){\ngl_FragColor= vec4(textureColor.xyz, textureColor.w);\n}else {\ngl_FragColor= step(0.01, textureColor.z) * v_color;\n}\ngl_FragColor.a =gl_FragColor.a * u_opacity;\ngl_FragColor = filterColor(gl_FragColor);\n}',zO='precision highp float;\nattribute vec3 a_Position;\nattribute vec4 a_Color;\nattribute vec2 a_Uv;\nattribute float a_Size;\nvarying vec4 v_color;\nvarying vec2 v_uv;\nuniform mat4 u_ModelMatrix;\nuniform float u_stroke_width : 1;\nuniform vec2 u_offsets;\nvarying float v_size;\n#pragma include "projection"\n#pragma include "picking"\nvoid main() {\nv_color = a_Color;\nv_uv = a_Uv;\nvec4 project_pos = project_position(vec4(a_Position, 1.0));\nv_size = a_Size;\nvec2 offset = project_pixel(u_offsets);\ngl_Position = project_common_position_to_clipspace(vec4(vec2(project_pos.xy + offset),project_pos.z, 1.0));\ngl_PointSize = a_Size * 2.0 * u_DevicePixelRatio;\nsetPickingColor(a_PickingColor);\n}',FO=function(t){Ji(r,t);var n=so(r);function r(){var e;Wi(this,r);for(var t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];return(e=n.call.apply(n,[this].concat(i))).texture=void 0,e}return Xi(r,[{key:"getUninforms",value:function(){return{u_opacity:this.layer.getLayerConfig().opacity||1,u_texture:this.texture,u_textSize:[1024,this.iconService.canvasHeight||128]}}},{key:"initModels",value:function(){var t=this;return this.initIconFontGlyphs(),this.registerBuiltinAttributes(),this.updateTexture(),this.iconService.on("imageUpdate",(function(){t.updateTexture(),t.layer.render()})),[this.layer.buildLayerModel({moduleName:"pointiconImage",vertexShader:zO,fragmentShader:jO,triangulation:oO,primitive:e.gl.POINTS,depth:{enable:!1},blend:this.getBlend()})]}},{key:"registerBuiltinAttributes",value:function(){var t=this;this.styleAttributeService.registerStyleAttribute({name:"size",type:e.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:e.gl.DYNAMIC_DRAW,data:[],type:e.gl.FLOAT},size:1,update:function(e,t,n,r){var i=e.size;return Array.isArray(i)?[i[0]]:[i]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:e.AttributeType.Attribute,descriptor:{name:"a_Uv",buffer:{usage:e.gl.DYNAMIC_DRAW,data:[],type:e.gl.FLOAT},size:2,update:function(e,n,r,i){var o=t.fontService.mapping,a=e.shape,s=o[t.fontService.getGlyph(a)];return[s.x,s.y]}}})}},{key:"updateTexture",value:function(){var t=this.rendererService.createTexture2D,n=this.fontService.canvas;this.texture=t({data:n,mag:e.gl.LINEAR,min:e.gl.LINEAR,width:n.width,height:n.height})}},{key:"initIconFontGlyphs",value:function(){var e=this,t=this.layer.getLayerConfig(),n=t.fontWeight,r=void 0===n?"normal":n,i=t.fontFamily,o=void 0===i?"sans-serif":i,a=this.layer.getEncodedData(),s=[];a.forEach((function(t){var n=t.shape,r=void 0===n?"":n;r=r.toString();var i=e.fontService.getGlyph(r);-1===s.indexOf(i)&&s.push(i)})),this.fontService.setFontOptions({characterSet:s,fontWeight:r,fontFamily:o,fontSize:48})}}]),r}(aP),BO=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(t=n.call.apply(n,[this].concat(o))).texture=void 0,t.updateTexture=function(){var n=t.rendererService.createTexture2D;if(t.texture)return t.texture.update({data:t.iconService.getCanvas()}),void t.layer.render();t.texture=n({data:t.iconService.getCanvas(),mag:e.gl.LINEAR,min:e.gl.LINEAR,width:1024,height:t.iconService.canvasHeight||128})},t}return Xi(r,[{key:"getUninforms",value:function(){var e=this.layer.getLayerConfig(),t=e.opacity,n=e.offsets,r=void 0===n?[0,0]:n;return this.rendererService.getDirty()&&this.texture.bind(),{u_opacity:t||1,u_texture:this.texture,u_textSize:[1024,this.iconService.canvasHeight||128],u_offsets:[-r[0],r[1]]}}},{key:"initModels",value:function(){return this.registerBuiltinAttributes(),this.updateTexture(),this.iconService.on("imageUpdate",this.updateTexture),this.buildModels()}},{key:"clearModels",value:function(){this.texture&&this.texture.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}},{key:"buildModels",value:function(){return[this.layer.buildLayerModel({moduleName:"pointImage",vertexShader:zO,fragmentShader:jO,triangulation:oO,primitive:e.gl.POINTS,depth:{enable:!1},blend:this.getBlend()})]}},{key:"registerBuiltinAttributes",value:function(){var t=this;this.styleAttributeService.registerStyleAttribute({name:"size",type:e.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:e.gl.DYNAMIC_DRAW,data:[],type:e.gl.FLOAT},size:1,update:function(e,t,n,r){var i=e.size,o=void 0===i?5:i;return Array.isArray(o)?[o[0]]:[o]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:e.AttributeType.Attribute,descriptor:{name:"a_Uv",buffer:{usage:e.gl.DYNAMIC_DRAW,data:[],type:e.gl.FLOAT},size:2,update:function(e,n,r,i){var o=t.iconService.getIconMap()[e.shape]||{x:0,y:0};return[o.x,o.y]}}})}}]),r}(aP);function UO(e){var t=e.coordinates;return{vertices:lo(t),indices:[0],size:t.length}}var VO=function(t){Ji(r,t);var n=so(r);function r(){return Wi(this,r),n.apply(this,arguments)}return Xi(r,[{key:"getDefaultStyle",value:function(){return{blend:"additive"}}},{key:"getUninforms",value:function(){var e=this.layer.getLayerConfig(),t=e.opacity,n=void 0===t?1:t,r=e.stroke,i=void 0===r?"rgb(0,0,0,0)":r,o=e.strokeWidth,a=void 0===o?1:o,s=e.offsets,u=void 0===s?[0,0]:s;return{u_opacity:n,u_stroke_width:a,u_stroke_color:Wh(i),u_offsets:[-u[0],u[1]]}}},{key:"initModels",value:function(){return this.buildModels()}},{key:"buildModels",value:function(){return[this.layer.buildLayerModel({moduleName:"normalpoint",vertexShader:'attribute vec3 a_Position;\nuniform mat4 u_ModelMatrix;\nattribute float a_Size;\nattribute vec4 a_Color;\nvarying vec4 v_color;\nuniform vec2 u_offsets;\n#pragma include "projection"\n#pragma include "picking"\nvoid main() {\nv_color = a_Color;\nvec2 offset = project_pixel(u_offsets);\nvec4 project_pos = project_position(vec4(a_Position, 1.0)) + vec4(a_Size / 2.,-a_Size /2.,0.,0.);\ngl_Position = project_common_position_to_clipspace(vec4(vec2(project_pos.xy+offset),project_pos.z,project_pos.w));\ngl_PointSize = a_Size * 2.0 * u_DevicePixelRatio;\nsetPickingColor(a_PickingColor);\n}',fragmentShader:'uniform float u_opacity : 1;\nuniform vec2 u_offsets;\nvarying vec4 v_color;\n#pragma include "picking"\nvoid main() {\ngl_FragColor = v_color;\ngl_FragColor.a =gl_FragColor.a * u_opacity;\ngl_FragColor = filterColor(gl_FragColor);\n}',triangulation:UO,depth:{enable:!1},primitive:e.gl.POINTS,blend:this.getBlend()})]}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:e.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:e.gl.DYNAMIC_DRAW,data:[],type:e.gl.FLOAT},size:1,update:function(e,t,n,r){var i=e.size,o=void 0===i?1:i;return Array.isArray(o)?[o[0]]:[o]}}})}},{key:"defaultStyleOptions",value:function(){return{blend:e.BlendType.additive}}}]),r}(aP),GO=function(){function e(t,n,r){Wi(this,e),this.boxCells=[],this.xCellCount=void 0,this.yCellCount=void 0,this.boxKeys=void 0,this.bboxes=void 0,this.width=void 0,this.height=void 0,this.xScale=void 0,this.yScale=void 0,this.boxUid=void 0;var i=this.boxCells;this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(n/r);for(var o=0;o<this.xCellCount*this.yCellCount;o++)i.push([]);this.boxKeys=[],this.bboxes=[],this.width=t,this.height=n,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/n,this.boxUid=0}return Xi(e,[{key:"insert",value:function(e,t,n,r,i){this.forEachCell(t,n,r,i,this.insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(t),this.bboxes.push(n),this.bboxes.push(r),this.bboxes.push(i)}},{key:"query",value:function(e,t,n,r,i){return this.queryHitTest(e,t,n,r,!1,i)}},{key:"hitTest",value:function(e,t,n,r,i){return this.queryHitTest(e,t,n,r,!0,i)}},{key:"insertBoxCell",value:function(e,t,n,r,i,o){this.boxCells[i].push(o)}},{key:"queryHitTest",value:function(e,t,n,r,i,o){if(n<0||e>this.width||r<0||t>this.height)return!i&&[];var a=[];if(e<=0&&t<=0&&this.width<=n&&this.height<=r){if(i)return!0;for(var s=0;s<this.boxKeys.length;s++)a.push({key:this.boxKeys[s],x1:this.bboxes[4*s],y1:this.bboxes[4*s+1],x2:this.bboxes[4*s+2],y2:this.bboxes[4*s+3]});return o?a.filter(o):a}var u={hitTest:i,seenUids:{box:{},circle:{}}};return this.forEachCell(e,t,n,r,this.queryCell,a,u,o),i?a.length>0:a}},{key:"queryCell",value:function(e,t,n,r,i,o,a,s){var u=a.seenUids,c=this.boxCells[i];if(null!==c){var l,f=this.bboxes,h=po(c);try{for(h.s();!(l=h.n()).done;){var d=l.value;if(!u.box[d]){u.box[d]=!0;var p=4*d;if(e<=f[p+2]&&t<=f[p+3]&&n>=f[p+0]&&r>=f[p+1]&&(!s||s(this.boxKeys[d]))){if(a.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[d],x1:f[p],y1:f[p+1],x2:f[p+2],y2:f[p+3]})}}}}catch(e){h.e(e)}finally{h.f()}}return!1}},{key:"forEachCell",value:function(e,t,n,r,i,o,a,s){for(var u=this.convertToXCellCoord(e),c=this.convertToYCellCoord(t),l=this.convertToXCellCoord(n),f=this.convertToYCellCoord(r),h=u;h<=l;h++)for(var d=c;d<=f;d++){var p=this.xCellCount*d+h;if(i.call(this,e,t,n,r,p,o,a,s))return}}},{key:"convertToXCellCoord",value:function(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}},{key:"convertToYCellCoord",value:function(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}}]),e}(),HO=function(){function e(t,n){Wi(this,e),this.width=void 0,this.height=void 0,this.grid=void 0,this.viewportPadding=100,this.screenRightBoundary=void 0,this.screenBottomBoundary=void 0,this.gridRightBoundary=void 0,this.gridBottomBoundary=void 0,this.width=t,this.height=n,this.viewportPadding=Math.max(t,n),this.grid=new GO(t+this.viewportPadding,n+this.viewportPadding,25),this.screenRightBoundary=t+this.viewportPadding,this.screenBottomBoundary=n+this.viewportPadding,this.gridRightBoundary=t+2*this.viewportPadding,this.gridBottomBoundary=n+2*this.viewportPadding}return Xi(e,[{key:"placeCollisionBox",value:function(e){var t=e.x1+e.anchorPointX+this.viewportPadding,n=e.y1+e.anchorPointY+this.viewportPadding,r=e.x2+e.anchorPointX+this.viewportPadding,i=e.y2+e.anchorPointY+this.viewportPadding;return!this.isInsideGrid(t,n,r,i)||this.grid.hitTest(t,n,r,i)?{box:[]}:{box:[t,n,r,i]}}},{key:"insertCollisionBox",value:function(e,t){var n={featureIndex:t};this.grid.insert(n,e[0],e[1],e[2],e[3])}},{key:"project",value:function(e,t,n){var r=Wv(t,n,0,1),i=Zv();return qv(i,r,rv.apply(xv,lo(e))),{x:(i[0]/i[3]+1)/2*this.width+this.viewportPadding,y:(-i[1]/i[3]+1)/2*this.height+this.viewportPadding}}},{key:"isInsideGrid",value:function(e,t,n,r){return n>=0&&e<this.gridRightBoundary&&r>=0&&t<this.gridBottomBoundary}}]),e}();function ZO(e,t,n,r,i,o,a){var s=0,u=-8,c=0,l=e.positionedGlyphs,f="right"===o?1:"left"===o?0:.5,h=l.length;n.forEach((function(e){if(e.split("").forEach((function(e){var n=t[e];n&&(l.push({glyph:e,x:s,y:u+0,vertical:!1,scale:1,metrics:n}),s+=n.advance+a)})),l.length!==h){var n=s-a;c=Math.max(n,c),function(e,t,n,r,i){if(i){var o=e[r],a=o.glyph;if(a)for(var s=t[a].advance*o.scale,u=(e[r].x+s)*i,c=n;c<=r;c++)e[c].x-=u}}(l,t,h,l.length-1,f)}s=0,u+=r}));var d=function(e){var t=.5,n=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0;break;default:t=.5}switch(e){case"bottom":case"bottom-right":case"bottom-left":n=1;break;case"top":case"top-right":case"top-left":n=0;break;default:n=.5}return{horizontalAlign:t,verticalAlign:n}}(i),p=d.horizontalAlign,v=d.verticalAlign;!function(e,t,n,r,i,o,a){var s,u=(t-n)*i,c=(-r*a+.5)*o,l=po(e);try{for(l.s();!(s=l.n()).done;){var f=s.value;f.x+=u,f.y+=c}}catch(e){l.e(e)}finally{l.f()}}(l,f,p,v,c,r,n.length);var g=u- -8;e.top+=-v*g,e.bottom=e.top+g,e.left+=-p*c,e.right=e.left+c}var WO='#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105\n#define FONT_SIZE 48.0\nuniform sampler2D u_sdf_map;\nuniform float u_gamma_scale : 0.5;\nuniform float u_opacity : 1.0;\nuniform float u_stroke_opacity: 1.0;\nuniform vec4 u_stroke : [0, 0, 0, 1];\nuniform float u_strokeWidth : 2.0;\nuniform float u_halo_blur : 0.5;\nuniform float u_DevicePixelRatio;\nvarying vec4 v_color;\nvarying vec2 v_uv;\nvarying float v_gamma_scale;\nvarying float v_fontScale;\n#pragma include "picking"\nvoid main() {\nfloat dist = texture2D(u_sdf_map, v_uv).a;\nlowp float buff = (6.0 - u_strokeWidth / v_fontScale) / SDF_PX;\nhighp float gamma = (u_halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / (v_fontScale * u_gamma_scale) / 1.0;\nhighp float gamma_scaled = gamma * v_gamma_scale;\nhighp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist);\ngl_FragColor = mix(vec4(v_color.rgb, v_color.a * u_opacity), vec4(u_stroke.rgb, u_stroke.a * u_opacity), smoothstep(0., 0.5, 1. - dist));\ngl_FragColor.a= gl_FragColor.a * alpha;\ngl_FragColor = filterColor(gl_FragColor);\n}',qO='#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105\n#define FONT_SIZE 24.0\nattribute vec3 a_Position;\nattribute vec2 a_tex;\nattribute vec2 a_textOffsets;\nattribute vec4 a_Color;\nattribute float a_Size;\nuniform vec2 u_sdf_map_size;\nuniform mat4 u_ModelMatrix;\nvarying vec2 v_uv;\nvarying float v_gamma_scale;\nvarying vec4 v_color;\nvarying float v_fontScale;\n#pragma include "projection"\n#pragma include "picking"\nvoid main() {\nv_color = a_Color;\nv_uv = a_tex / u_sdf_map_size;\nfloat fontScale = a_Size / FONT_SIZE;\nv_fontScale = fontScale;\nvec4 project_pos = project_position(vec4(a_Position, 1.0));\nvec4 projected_position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\ngl_Position = vec4(projected_position.xy / projected_position.w\n+ a_textOffsets * fontScale / u_ViewportSize * 2.0 * u_DevicePixelRatio, 0.0, 1.0);\nv_gamma_scale = gl_Position.w;\nsetPickingColor(a_PickingColor);\n}';function XO(e){var t=e.id,n=[],r=[];if(!this.glyphInfoMap||!this.glyphInfoMap[t])return{vertices:[],indices:[],size:7};var i=this.glyphInfoMap[t].centroid,o=2===i.length?[i[0],i[1],0]:i;return this.glyphInfoMap[t].glyphQuads.forEach((function(e,t){n.push.apply(n,lo(o).concat([e.tex.x,e.tex.y+e.tex.height,e.tl.x,e.tl.y],lo(o),[e.tex.x+e.tex.width,e.tex.y+e.tex.height,e.tr.x,e.tr.y],lo(o),[e.tex.x+e.tex.width,e.tex.y,e.br.x,e.br.y],lo(o),[e.tex.x,e.tex.y,e.bl.x,e.bl.y])),r.push(0+4*t,1+4*t,2+4*t,2+4*t,3+4*t,0+4*t)})),{vertices:n,indices:r,size:7}}var YO,KO,QO,JO,$O,eR,tR,nR=function(t){Ji(r,t);var n=so(r);function r(){var e;Wi(this,r);for(var t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];return(e=n.call.apply(n,[this].concat(i))).glyphInfo=void 0,e.glyphInfoMap={},e.texture=void 0,e.currentZoom=-1,e.extent=void 0,e.textureHeight=0,e.textCount=0,e.preTextStyle={},e.buildModels=function(){return e.initGlyph(),e.updateTexture(),e.filterGlyphs(),[e.layer.buildLayerModel({moduleName:"pointText",vertexShader:qO,fragmentShader:WO,triangulation:XO.bind(oo(e)),depth:{enable:!1},blend:e.getBlend()})]},e}return Xi(r,[{key:"getUninforms",value:function(){var e=this.layer.getLayerConfig(),t=e.opacity,n=void 0===t?1:t,r=e.stroke,i=void 0===r?"#fff":r,o=e.strokeWidth,a=void 0===o?0:o,s=e.strokeOpacity,u=void 0===s?1:s,c=e.textAnchor,l=void 0===c?"center":c,f=e.textAllowOverlap,h=void 0!==f&&f,d=e.halo,p=void 0===d?.5:d,v=e.gamma,g=void 0===v?2:v,m=this.fontService,y=m.canvas,b=m.mapping;return Object.keys(b).length!==this.textCount&&(this.updateTexture(),this.textCount=Object.keys(b).length),this.preTextStyle={textAnchor:l,textAllowOverlap:h},{u_opacity:n,u_stroke_opacity:u,u_sdf_map:this.texture,u_stroke:Wh(i),u_halo_blur:p,u_gamma_scale:g,u_sdf_map_size:[y.width,y.height],u_strokeWidth:a}}},{key:"initModels",value:function(){this.layer.on("remapping",this.buildModels),this.extent=this.textExtent();var e=this.layer.getLayerConfig(),t=e.textAnchor,n=void 0===t?"center":t,r=e.textAllowOverlap,i=void 0===r||r;return this.preTextStyle={textAnchor:n,textAllowOverlap:i},this.buildModels()}},{key:"needUpdate",value:function(){var e=this.layer.getLayerConfig().textAllowOverlap,t=void 0!==e&&e,n=this.mapService.getZoom(),r=this.mapService.getBounds(),i=oh(this.extent,r);return(!t&&(Math.abs(this.currentZoom-n)>1||!i)||t!==this.preTextStyle.textAllowOverlap)&&(this.reBuildModel(),!0)}},{key:"clearModels",value:function(){this.layer.off("remapping",this.buildModels)}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"textOffsets",type:e.AttributeType.Attribute,descriptor:{name:"a_textOffsets",buffer:{usage:e.gl.STATIC_DRAW,data:[],type:e.gl.FLOAT},size:2,update:function(e,t,n,r){return[n[5],n[6]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:e.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:e.gl.DYNAMIC_DRAW,data:[],type:e.gl.FLOAT},size:1,update:function(e,t,n,r){var i=e.size,o=void 0===i?12:i;return Array.isArray(o)?[o[0]]:[o]}}}),this.styleAttributeService.registerStyleAttribute({name:"textUv",type:e.AttributeType.Attribute,descriptor:{name:"a_tex",buffer:{usage:e.gl.DYNAMIC_DRAW,data:[],type:e.gl.FLOAT},size:2,update:function(e,t,n,r){return[n[3],n[4]]}}})}},{key:"textExtent",value:function(){return ih(this.mapService.getBounds(),.5)}},{key:"initTextFont",value:function(){var e=this.layer.getLayerConfig(),t=e.fontWeight,n=void 0===t?"400":t,r=e.fontFamily,i=void 0===r?"sans-serif":r,o=this.layer.getEncodedData(),a=[];o.forEach((function(e){var t,n=e.shape,r=void 0===n?"":n,i=po(r=r.toString());try{for(i.s();!(t=i.n()).done;){var o=t.value;-1===a.indexOf(o)&&a.push(o)}}catch(e){i.e(e)}finally{i.f()}})),this.fontService.setFontOptions({characterSet:a,fontWeight:n,fontFamily:i})}},{key:"generateGlyphLayout",value:function(){var e=this,t=this.fontService.mapping,n=this.layer.getLayerConfig(),r=n.spacing,i=void 0===r?2:r,o=n.textAnchor,a=void 0===o?"center":o,s=n.textOffset,u=this.layer.getEncodedData();this.glyphInfo=u.map((function(n){var r=n.shape,o=void 0===r?"":r,u=n.coordinates,c=n.id,l=n.size,f=void 0===l?1:l,h=function(e,t,n,r,i,o){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:[0,0],s=e.split("\n"),u=[],c={positionedGlyphs:u,top:a[1],bottom:a[1],left:a[0],right:a[0],lineCount:s.length,text:e};return ZO(c,t,s,n,r,i,o),!!u.length&&c}(o.toString(),t,f,a,"center",i,s),d=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0],r=arguments.length>2?arguments[2]:void 0,i=e.positionedGlyphs,o=void 0===i?[]:i,a=[],s=po(o);try{for(s.s();!(t=s.n()).done;){var u=t.value,c=u.metrics,l=4,f=c.advance*u.scale/2,h=r?[u.x+f,u.y]:[0,0],d=r?[0,0]:[u.x+f+n[0],u.y+n[1]],p=(0-l)*u.scale-f+d[0],v=(0-l)*u.scale+d[1],g=p+c.width*u.scale,m=v+c.height*u.scale,y={x:p,y:v},b={x:g,y:v},_={x:p,y:m},x={x:g,y:m};a.push({tl:y,tr:b,bl:_,br:x,tex:c,glyphOffset:h})}}catch(e){s.e(e)}finally{s.f()}return a}(h,s,!1);return n.shaping=h,n.glyphQuads=d,n.centroid=WP(u),e.glyphInfoMap[c]={shaping:h,glyphQuads:d,centroid:WP(u)},n}))}},{key:"filterGlyphs",value:function(){var e=this,t=this.layer.getLayerConfig(),n=t.padding,r=void 0===n?[4,4]:n,i=t.textAllowOverlap;if(!(void 0!==i&&i)){this.glyphInfoMap={},this.currentZoom=this.mapService.getZoom(),this.extent=this.textExtent();var o=this.rendererService.getViewportSize(),a=o.width,s=o.height,u=new HO(a,s);this.glyphInfo.filter((function(t){var n=t.shaping,i=t.id,o=void 0===i?0:i,a=t.centroid,s=t.size/24,c=e.mapService.lngLatToContainer(a),l=u.placeCollisionBox({x1:n.left*s-r[0],x2:n.right*s+r[0],y1:n.top*s-r[1],y2:n.bottom*s+r[1],anchorPointX:c.x,anchorPointY:c.y}).box;return!(!l||!l.length)&&(u.insertCollisionBox(l,o),!0)})).forEach((function(t){e.glyphInfoMap[t.id]=t}))}}},{key:"initGlyph",value:function(){this.initTextFont(),this.generateGlyphLayout()}},{key:"updateTexture",value:function(){var t=this.rendererService.createTexture2D,n=this.fontService.canvas;this.textureHeight=n.height,this.texture&&this.texture.destroy(),this.texture=t({data:n,mag:e.gl.LINEAR,min:e.gl.LINEAR,width:n.width,height:n.height})}},{key:"reBuildModel",value:function(){this.filterGlyphs(),this.layer.models=[this.layer.buildLayerModel({moduleName:"pointText",vertexShader:qO,fragmentShader:WO,triangulation:XO.bind(this),depth:{enable:!1},blend:this.getBlend()})]}}]),r}(aP),rR={fill:DO,image:BO,normal:VO,extrude:NO,text:nR,icon:FO},iR=function(e){Ji(n,e);var t=so(n);function n(){var e;Wi(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).type="PointLayer",e}return Xi(n,[{key:"buildModels",value:function(){var e=this.getModelType();this.layerModel=new rR[e](this),this.models=this.layerModel.initModels()}},{key:"rebuildModels",value:function(){this.models=this.layerModel.buildModels()}},{key:"getConfigSchema",value:function(){return{properties:{opacity:{type:"number",minimum:0,maximum:1}}}}},{key:"getDefaultConfig",value:function(){return{normal:{blend:"additive"},fill:{blend:"normal"},extrude:{},image:{},icon:{},text:{blend:"normal"}}[this.getModelType()]}},{key:"getModelType",value:function(){var e=this.getEncodedData(),t=this.getLayerConfig(),n=t.shape2d,r=t.shape3d,i=this.iconService.getIconMap(),o=e.find((function(e){return e.hasOwnProperty("shape")}));if(o){var a=o.shape;return"dot"===a?"normal":-1!==(null==n?void 0:n.indexOf(a))?"fill":-1!==(null==r?void 0:r.indexOf(a))?"extrude":i.hasOwnProperty(a)?"image":""!==this.fontService.getGlyph(a)?"icon":"text"}return"normal"}}]),n}(oP),oR=function(t){Ji(r,t);var n=so(r);function r(){return Wi(this,r),n.apply(this,arguments)}return Xi(r,[{key:"getUninforms",value:function(){var e=this.layer.getLayerConfig().opacity;return{u_opacity:void 0===e?1:e}}},{key:"initModels",value:function(){return this.buildModels()}},{key:"buildModels",value:function(){return[this.layer.buildLayerModel({moduleName:"polygonExtrude",vertexShader:'precision highp float;\n#define ambientRatio 0.5\n#define diffuseRatio 0.3\n#define specularRatio 0.2\nattribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute float a_Size;\nuniform mat4 u_ModelMatrix;\nvarying vec4 v_Color;\n#pragma include "projection"\n#pragma include "light"\n#pragma include "picking"\nvoid main() {\nvec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);\nvec4 project_pos = project_position(pos);\ngl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\nfloat lightWeight = calc_lighting(pos);\nv_Color = vec4(a_Color.rgb * lightWeight, a_Color.w);\nsetPickingColor(a_PickingColor);\n}',fragmentShader:'uniform float u_opacity: 1.0;\nvarying vec4 v_Color;\n#pragma include "picking"\nvoid main() {\ngl_FragColor = v_Color;\ngl_FragColor.a *= u_opacity;\ngl_FragColor = filterColor(gl_FragColor);\n}',triangulation:uO})]}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"normal",type:e.AttributeType.Attribute,descriptor:{name:"a_Normal",buffer:{usage:e.gl.STATIC_DRAW,data:[],type:e.gl.FLOAT},size:3,update:function(e,t,n,r,i){return i}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:e.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:e.gl.DYNAMIC_DRAW,data:[],type:e.gl.FLOAT},size:1,update:function(e,t,n,r){var i=e.size,o=void 0===i?10:i;return Array.isArray(o)?[o[0]]:[o]}}})}}]),r}(aP),aR={fill:function(e){Ji(n,e);var t=so(n);function n(){return Wi(this,n),t.apply(this,arguments)}return Xi(n,[{key:"getUninforms",value:function(){var e=this.layer.getLayerConfig().opacity;return{u_opacity:void 0===e?1:e}}},{key:"initModels",value:function(){return this.buildModels()}},{key:"buildModels",value:function(){return[this.layer.buildLayerModel({moduleName:"polygon",vertexShader:'attribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute float a_Size;\nuniform mat4 u_ModelMatrix;\nvarying vec4 v_Color;\n#pragma include "projection"\n#pragma include "picking"\nvoid main() {\nv_Color = a_Color;\nvec4 project_pos = project_position(vec4(a_Position, 1.0));\ngl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\nsetPickingColor(a_PickingColor);\n}',fragmentShader:'uniform float u_opacity: 1.0;\nvarying vec4 v_Color;\n#pragma include "picking"\nvoid main() {\ngl_FragColor = v_Color;\ngl_FragColor.a *= u_opacity;\ngl_FragColor = filterColor(gl_FragColor);\n}',triangulation:sO,blend:this.getBlend(),depth:{enable:!1}})]}},{key:"registerBuiltinAttributes",value:function(){}}]),n}(aP),line:OO,extrude:oR,text:nR,point_fill:DO,point_image:BO,point_normal:VO,point_extrude:NO},sR=function(e){Ji(n,e);var t=so(n);function n(){var e;Wi(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).type="PolygonLayer",e}return Xi(n,[{key:"buildModels",value:function(){var e=this.getModelType();this.layerModel=new aR[e](this),this.models=this.layerModel.initModels()}},{key:"rebuildModels",value:function(){this.models=this.layerModel.buildModels()}},{key:"getConfigSchema",value:function(){return{properties:{opacity:{type:"number",minimum:0,maximum:1}}}}},{key:"getModelType",value:function(){var e,t=this.styleAttributeService.getLayerStyleAttribute("shape"),n=null==t||null===(e=t.scale)||void 0===e?void 0:e.field;return"fill"===n?"fill":"extrude"===n?"extrude":"line"===n?"line":this.getPointModelType()}},{key:"getPointModelType",value:function(){var e=this.getEncodedData(),t=this.getLayerConfig(),n=t.shape2d,r=t.shape3d,i=this.iconService.getIconMap(),o=e.find((function(e){return e.hasOwnProperty("shape")}));if(o){var a=o.shape;return"dot"===a?"point_normal":-1!==(null==n?void 0:n.indexOf(a))?"point_fill":-1!==(null==r?void 0:r.indexOf(a))?"point_extrude":i.hasOwnProperty(a)?"point_image":"text"}return"fill"}}]),n}(oP),uR=function(t){Ji(r,t);var n=so(r);function r(){var e;Wi(this,r);for(var t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];return(e=n.call.apply(n,[this].concat(i))).texture=void 0,e.colorTexture=void 0,e}return Xi(r,[{key:"getUninforms",value:function(){var e=this.layer.getLayerConfig(),t=e.opacity,n=void 0===t?1:t,r=e.clampLow,i=void 0===r||r,o=e.clampHigh,a=void 0===o||o,s=e.noDataValue,u=void 0===s?-9999999:s,c=e.domain,l=void 0===c?[0,1]:c;return this.updateColorTexure(),{u_opacity:n||1,u_texture:this.texture,u_domain:l,u_clampLow:i,u_clampHigh:void 0!==a?a:i,u_noDataValue:u,u_colorTexture:this.colorTexture}}},{key:"initModels",value:function(){var t=this.layer.getSource(),n=this.rendererService.createTexture2D,r=t.data.dataArray[0];this.texture=n({data:r.data,width:r.width,height:r.height,format:e.gl.LUMINANCE,type:e.gl.FLOAT});var i=Yh(this.layer.getLayerConfig().rampColors);return this.colorTexture=n({data:i.data,width:i.width,height:i.height,flipY:!1}),[this.layer.buildLayerModel({moduleName:"RasterImageData",vertexShader:'precision highp float;\nuniform mat4 u_ModelMatrix;\nattribute vec3 a_Position;\nattribute vec2 a_Uv;\nvarying vec2 v_texCoord;\n#pragma include "projection"\nvoid main() {\nv_texCoord = a_Uv;\nvec4 project_pos = project_position(vec4(a_Position, 1.0));\ngl_Position = project_common_position_to_clipspace(vec4(project_pos.xy,0., 1.0));\n}',fragmentShader:"precision mediump float;\nuniform float u_opacity: 1.0;\nuniform sampler2D u_texture;\nuniform sampler2D u_colorTexture;\nuniform float u_min;\nuniform float u_max;\nuniform vec2 u_domain;\nuniform float u_noDataValue;\nuniform bool u_clampLow: true;\nuniform bool u_clampHigh: true;\nvarying vec2 v_texCoord;\nvoid main() {\nfloat value = texture2D(u_texture,vec2(v_texCoord.x,v_texCoord.y)).r;\nif (value == u_noDataValue)\ngl_FragColor = vec4(0.0, 0, 0, 0.0);\nelse if ((!u_clampLow && value < u_domain[0]) || (!u_clampHigh && value > u_domain[1]))\ngl_FragColor = vec4(0, 0, 0, 0);\nelse {\nfloat normalisedValue =(value - u_domain[0]) / (u_domain[1] -u_domain[0]);\nvec4 color = texture2D(u_colorTexture,vec2(normalisedValue, 0));\ngl_FragColor = color;\ngl_FragColor.a = gl_FragColor.a * u_opacity ;\n}\n}",triangulation:lO,primitive:e.gl.TRIANGLES,depth:{enable:!1},blend:this.getBlend()})]}},{key:"buildModels",value:function(){return this.initModels()}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:e.AttributeType.Attribute,descriptor:{name:"a_Uv",buffer:{usage:e.gl.DYNAMIC_DRAW,data:[],type:e.gl.FLOAT},size:2,update:function(e,t,n,r){return[n[3],n[4]]}}})}},{key:"updateColorTexure",value:function(){var e=this.rendererService.createTexture2D,t=Yh(this.layer.getLayerConfig().rampColors);this.colorTexture=e({data:t.data,width:t.width,height:t.height,flipY:!1})}}]),r}(aP),cR={raster:uR,raster3d:uR},lR=function(e){Ji(n,e);var t=so(n);function n(){var e;Wi(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).type="RasterLayer",e}return Xi(n,[{key:"buildModels",value:function(){var e=this.getModelType();this.layerModel=new cR[e](this),this.models=this.layerModel.initModels()}},{key:"rebuildModels",value:function(){this.models=this.layerModel.buildModels()}},{key:"getConfigSchema",value:function(){return{properties:{opacity:{type:"number",minimum:0,maximum:1}}}}},{key:"getDefaultConfig",value:function(){return{raster:{},raster3d:{}}[this.getModelType()]}},{key:"getModelType",value:function(){return"raster"}}]),n}(oP),fR=(YO=Q(),KO=J(nr.IGlobalConfigService),QO=J(nr.ILogService),YO((eR=go(($O=function(){function e(){Wi(this,e),vo(this,"configService",eR,this),vo(this,"logger",tR,this)}return Xi(e,[{key:"apply",value:function(e,t){var n=this,r=t.styleAttributeService;e.hooks.init.tap("DataMappingPlugin",(function(){n.generateMaping(e,{styleAttributeService:r})})),e.hooks.beforeRenderData.tap("DataMappingPlugin",(function(){return e.dataState.dataMappingNeedUpdate=!1,n.generateMaping(e,{styleAttributeService:r}),!0})),e.hooks.beforeRender.tap("DataMappingPlugin",(function(){if(!e.layerModelNeedUpdate){var t=r.getLayerStyleAttributes()||[],i=r.getLayerStyleAttribute("filter"),o=e.getSource().data.dataArray,a=t.filter((function(e){return e.needRemapping})),s=o;(null==i?void 0:i.needRemapping)&&(null==i?void 0:i.scale)&&(s=o.filter((function(e){return n.applyAttributeMapping(i,e)[0]}))),a.length&&((null==i?void 0:i.needRemapping)?(e.setEncodedData(n.mapping(t,s)),i.needRemapping=!1):e.setEncodedData(n.mapping(a,s,e.getEncodedData())),n.logger.debug("remapping finished"),e.emit("remapping",null))}}))}},{key:"generateMaping",value:function(e,t){var n=this,r=t.styleAttributeService,i=r.getLayerStyleAttributes()||[],o=r.getLayerStyleAttribute("filter"),a=e.getSource().data.dataArray,s=a;(null==o?void 0:o.scale)&&(s=a.filter((function(e){return n.applyAttributeMapping(o,e)[0]}))),e.setEncodedData(this.mapping(i,s))}},{key:"mapping",value:function(e,t,n){var r=this;return t.map((function(t,i){var o=n?n[i]:{},a=Qi({id:t._id,coordinates:t.coordinates},o);return e.filter((function(e){return void 0!==e.scale})).forEach((function(e){var n=r.applyAttributeMapping(e,t);e.needRemapping=!1,"color"===e.name&&(n=n.map((function(e){return Wh(e)}))),a[e.name]=Array.isArray(n)&&1===n.length?n[0]:n})),a}))}},{key:"applyAttributeMapping",value:function(e,t){var n;if(!e.scale)return[];var r=(null==e||null===(n=e.scale)||void 0===n?void 0:n.scalers)||[],i=[];return r.forEach((function(n){var r,o=n.field;(t.hasOwnProperty(o)||"variable"===(null===(r=e.scale)||void 0===r?void 0:r.type))&&i.push(t[o])})),e.mapping?e.mapping(i):[]}}]),e}()).prototype,"configService",[KO],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),tR=go($O.prototype,"logger",[QO],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),JO=$O))||JO),hR={},dR={},pR=function(e){return dR[e]},vR=function(e,t){dR[e]=t},gR=function(e,t){hR[e]=t},mR={},yR={};function bR(e){return new Function("d","return {"+e.map((function(e,t){return JSON.stringify(e)+": d["+t+'] || ""'})).join(",")+"}")}function _R(e){var t=Object.create(null),n=[];return e.forEach((function(e){for(var r in e)r in t||n.push(t[r]=r)})),n}function xR(e,t){var n=e+"",r=n.length;return r<t?new Array(t-r+1).join(0)+n:n}function wR(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),r=e.getUTCSeconds(),i=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":function(e){return e<0?"-"+xR(-e,6):e>9999?"+"+xR(e,6):xR(e,4)}(e.getUTCFullYear())+"-"+xR(e.getUTCMonth()+1,2)+"-"+xR(e.getUTCDate(),2)+(i?"T"+xR(t,2)+":"+xR(n,2)+":"+xR(r,2)+"."+xR(i,3)+"Z":r?"T"+xR(t,2)+":"+xR(n,2)+":"+xR(r,2)+"Z":n||t?"T"+xR(t,2)+":"+xR(n,2)+"Z":"")}var SR=function(e){var t=new RegExp('["'+e+"\n\r]"),n=e.charCodeAt(0);function r(e,t){var r,i=[],o=e.length,a=0,s=0,u=o<=0,c=!1;function l(){if(u)return yR;if(c)return c=!1,mR;var t,r,i=a;if(34===e.charCodeAt(i)){for(;a++<o&&34!==e.charCodeAt(a)||34===e.charCodeAt(++a););return(t=a)>=o?u=!0:10===(r=e.charCodeAt(a++))?c=!0:13===r&&(c=!0,10===e.charCodeAt(a)&&++a),e.slice(i+1,t-1).replace(/""/g,'"')}for(;a<o;){if(10===(r=e.charCodeAt(t=a++)))c=!0;else if(13===r)c=!0,10===e.charCodeAt(a)&&++a;else if(r!==n)continue;return e.slice(i,t)}return u=!0,e.slice(i,o)}for(10===e.charCodeAt(o-1)&&--o,13===e.charCodeAt(o-1)&&--o;(r=l())!==yR;){for(var f=[];r!==mR&&r!==yR;)f.push(r),r=l();t&&null==(f=t(f,s++))||i.push(f)}return i}function i(t,n){return t.map((function(t){return n.map((function(e){return a(t[e])})).join(e)}))}function o(t){return t.map(a).join(e)}function a(e){return null==e?"":e instanceof Date?wR(e):t.test(e+="")?'"'+e.replace(/"/g,'""')+'"':e}return{parse:function(e,t){var n,i,o=r(e,(function(e,r){if(n)return n(e,r-1);i=e,n=t?function(e,t){var n=bR(e);return function(r,i){return t(n(r),i,e)}}(e,t):bR(e)}));return o.columns=i||[],o},parseRows:r,format:function(t,n){return null==n&&(n=_R(t)),[n.map(a).join(e)].concat(i(t,n)).join("\n")},formatBody:function(e,t){return null==t&&(t=_R(e)),i(e,t).join("\n")},formatRows:function(e){return e.map(o).join("\n")},formatRow:o,formatValue:a}}(",").parse,ER=6378137;function AR(e){var t=0;if(e&&e.length>0){t+=Math.abs(TR(e[0]));for(var n=1;n<e.length;n++)t-=Math.abs(TR(e[n]))}return t}function TR(e){var t,n,r,i,o,a,s=0,u=e.length;if(u>2){for(a=0;a<u;a++)a===u-2?(r=u-2,i=u-1,o=0):a===u-1?(r=u-1,i=0,o=1):(r=a,i=a+1,o=a+2),t=e[r],n=e[i],s+=(kR(e[o][0])-kR(t[0]))*Math.sin(kR(n[1]));s=s*ER*ER/2}return s}function kR(e){return e*Math.PI/180}var MR={geometry:function e(t){var n,r=0;switch(t.type){case"Polygon":return AR(t.coordinates);case"MultiPolygon":for(n=0;n<t.coordinates.length;n++)r+=AR(t.coordinates[n]);return r;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(n=0;n<t.geometries.length;n++)r+=e(t.geometries[n]);return r}},ring:TR},CR=function e(t,n){switch(t&&t.type||null){case"FeatureCollection":return t.features=t.features.map(IR(e,n)),t;case"GeometryCollection":return t.geometries=t.geometries.map(IR(e,n)),t;case"Feature":return t.geometry=e(t.geometry,n),t;case"Polygon":case"MultiPolygon":return function(e,t){"Polygon"===e.type?e.coordinates=PR(e.coordinates,t):"MultiPolygon"===e.type&&(e.coordinates=e.coordinates.map(IR(PR,t)));return e}(t,n);default:return t}};function IR(e,t){return function(n){return e(n,t)}}function PR(e,t){t=!!t,e[0]=OR(e[0],t);for(var n=1;n<e.length;n++)e[n]=OR(e[n],!t);return e}function OR(e,t){return function(e){return MR.ring(e)>=0}(e)===t?e:e.reverse()}function RR(e,t){var n=t.x,r=t.y,i=t.x1,o=t.y1,a=t.coordinates,s=[];return e.forEach((function(e,t){var u=[];(n&&r&&(u=[parseFloat(e[n]),parseFloat(e[r])]),n&&r&&i&&o)&&(u=[[parseFloat(e[n]),parseFloat(e[r])],[parseFloat(e[i]),parseFloat(e[o])]]);if(a){var c="Polygon";Array.isArray(a[0])||(c="Point"),Array.isArray(a[0])&&!Array.isArray(a[0][0])&&(c="LineString");var l={type:c,coordinates:lo(e[a])};CR(l,!0),u=l.coordinates}var f=Qi(Qi({},e),{},{_id:t,coordinates:u});s.push(f)})),{dataArray:s}}var LR=o((function(e,t){function n(e,t,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}function r(e,t,r){return void 0===r&&(r={}),n({type:"Point",coordinates:e},t,r)}function i(e,t,r){void 0===r&&(r={});for(var i=0,o=e;i<o.length;i++){var a=o[i];if(a.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<a[a.length-1].length;s++)if(a[a.length-1][s]!==a[0][s])throw new Error("First and last Position are not equivalent.")}return n({type:"Polygon",coordinates:e},t,r)}function o(e,t,r){if(void 0===r&&(r={}),e.length<2)throw new Error("coordinates must be an array of two or more positions");return n({type:"LineString",coordinates:e},t,r)}function a(e,t){void 0===t&&(t={});var n={type:"FeatureCollection"};return t.id&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.features=e,n}function s(e,t,r){return void 0===r&&(r={}),n({type:"MultiLineString",coordinates:e},t,r)}function u(e,t,r){return void 0===r&&(r={}),n({type:"MultiPoint",coordinates:e},t,r)}function c(e,t,r){return void 0===r&&(r={}),n({type:"MultiPolygon",coordinates:e},t,r)}function l(e,n){void 0===n&&(n="kilometers");var r=t.factors[n];if(!r)throw new Error(n+" units is invalid");return e*r}function f(e,n){void 0===n&&(n="kilometers");var r=t.factors[n];if(!r)throw new Error(n+" units is invalid");return e/r}function h(e){return 180*(e%(2*Math.PI))/Math.PI}function d(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)&&!/^\s*$/.test(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.earthRadius=6371008.8,t.factors={centimeters:100*t.earthRadius,centimetres:100*t.earthRadius,degrees:t.earthRadius/111325,feet:3.28084*t.earthRadius,inches:39.37*t.earthRadius,kilometers:t.earthRadius/1e3,kilometres:t.earthRadius/1e3,meters:t.earthRadius,metres:t.earthRadius,miles:t.earthRadius/1609.344,millimeters:1e3*t.earthRadius,millimetres:1e3*t.earthRadius,nauticalmiles:t.earthRadius/1852,radians:1,yards:t.earthRadius/1.0936},t.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/t.earthRadius,yards:1/1.0936},t.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046},t.feature=n,t.geometry=function(e,t,n){switch(e){case"Point":return r(t).geometry;case"LineString":return o(t).geometry;case"Polygon":return i(t).geometry;case"MultiPoint":return u(t).geometry;case"MultiLineString":return s(t).geometry;case"MultiPolygon":return c(t).geometry;default:throw new Error(e+" is invalid")}},t.point=r,t.points=function(e,t,n){return void 0===n&&(n={}),a(e.map((function(e){return r(e,t)})),n)},t.polygon=i,t.polygons=function(e,t,n){return void 0===n&&(n={}),a(e.map((function(e){return i(e,t)})),n)},t.lineString=o,t.lineStrings=function(e,t,n){return void 0===n&&(n={}),a(e.map((function(e){return o(e,t)})),n)},t.featureCollection=a,t.multiLineString=s,t.multiPoint=u,t.multiPolygon=c,t.geometryCollection=function(e,t,r){return void 0===r&&(r={}),n({type:"GeometryCollection",geometries:e},t,r)},t.round=function(e,t){if(void 0===t&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var n=Math.pow(10,t||0);return Math.round(e*n)/n},t.radiansToLength=l,t.lengthToRadians=f,t.lengthToDegrees=function(e,t){return h(f(e,t))},t.bearingToAzimuth=function(e){var t=e%360;return t<0&&(t+=360),t},t.radiansToDegrees=h,t.degreesToRadians=function(e){return e%360*Math.PI/180},t.convertLength=function(e,t,n){if(void 0===t&&(t="kilometers"),void 0===n&&(n="kilometers"),!(e>=0))throw new Error("length must be a positive number");return l(f(e,t),n)},t.convertArea=function(e,n,r){if(void 0===n&&(n="meters"),void 0===r&&(r="kilometers"),!(e>=0))throw new Error("area must be a positive number");var i=t.areaFactors[n];if(!i)throw new Error("invalid original units");var o=t.areaFactors[r];if(!o)throw new Error("invalid final units");return e/i*o},t.isNumber=d,t.isObject=function(e){return!!e&&e.constructor===Object},t.validateBBox=function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach((function(e){if(!d(e))throw new Error("bbox must only contain numbers")}))},t.validateId=function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(Gi(e)))throw new Error("id must be a number or a string")},t.radians2degrees=function(){throw new Error("method has been renamed to `radiansToDegrees`")},t.degrees2radians=function(){throw new Error("method has been renamed to `degreesToRadians`")},t.distanceToDegrees=function(){throw new Error("method has been renamed to `lengthToDegrees`")},t.distanceToRadians=function(){throw new Error("method has been renamed to `lengthToRadians`")},t.radiansToDistance=function(){throw new Error("method has been renamed to `radiansToLength`")},t.bearingToAngle=function(){throw new Error("method has been renamed to `bearingToAzimuth`")},t.convertDistance=function(){throw new Error("method has been renamed to `convertLength`")}}));i(LR);LR.earthRadius,LR.factors,LR.unitsFactors,LR.areaFactors,LR.feature,LR.geometry,LR.point,LR.points,LR.polygon,LR.polygons,LR.lineString,LR.lineStrings,LR.featureCollection,LR.multiLineString,LR.multiPoint,LR.multiPolygon,LR.geometryCollection,LR.round,LR.radiansToLength,LR.lengthToRadians,LR.lengthToDegrees,LR.bearingToAzimuth,LR.radiansToDegrees,LR.degreesToRadians,LR.convertLength,LR.convertArea,LR.isNumber,LR.isObject,LR.validateBBox,LR.validateId,LR.radians2degrees,LR.degrees2radians,LR.distanceToDegrees,LR.distanceToRadians,LR.radiansToDistance,LR.bearingToAngle,LR.convertDistance;var NR=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getCoord=function(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return e.geometry.coordinates;if("Point"===e.type)return e.coordinates}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw new Error("coord must be GeoJSON Point or an Array of numbers")},t.getCoords=function(e){if(Array.isArray(e))return e;if("Feature"===e.type){if(null!==e.geometry)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")},t.containsNumber=function e(t){if(t.length>1&&LR.isNumber(t[0])&&LR.isNumber(t[1]))return!0;if(Array.isArray(t[0])&&t[0].length)return e(t[0]);throw new Error("coordinates must only contain numbers")},t.geojsonType=function(e,t,n){if(!t||!n)throw new Error("type and name required");if(!e||e.type!==t)throw new Error("Invalid input to "+n+": must be a "+t+", given "+e.type)},t.featureOf=function(e,t,n){if(!e)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!e||"Feature"!==e.type||!e.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!e.geometry||e.geometry.type!==t)throw new Error("Invalid input to "+n+": must be a "+t+", given "+e.geometry.type)},t.collectionOf=function(e,t,n){if(!e)throw new Error("No featureCollection passed");if(!n)throw new Error(".collectionOf() requires a name");if(!e||"FeatureCollection"!==e.type)throw new Error("Invalid input to "+n+", FeatureCollection required");for(var r=0,i=e.features;r<i.length;r++){var o=i[r];if(!o||"Feature"!==o.type||!o.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!o.geometry||o.geometry.type!==t)throw new Error("Invalid input to "+n+": must be a "+t+", given "+o.geometry.type)}},t.getGeom=function(e){return"Feature"===e.type?e.geometry:e},t.getType=function(e,t){return"FeatureCollection"===e.type?"FeatureCollection":"GeometryCollection"===e.type?"GeometryCollection":"Feature"===e.type&&null!==e.geometry?e.geometry.type:e.type}}));i(NR);NR.getCoord;var DR=NR.getCoords,jR=(NR.containsNumber,NR.geojsonType,NR.featureOf,NR.collectionOf,NR.getGeom,NR.getType,o((function(e,t){function n(e,t,r){if(null!==e)for(var i,o,a,s,u,c,l,f,h=0,d=0,p=e.type,v="FeatureCollection"===p,g="Feature"===p,m=v?e.features.length:1,y=0;y<m;y++){u=(f=!!(l=v?e.features[y].geometry:g?e.geometry:e)&&"GeometryCollection"===l.type)?l.geometries.length:1;for(var b=0;b<u;b++){var _=0,x=0;if(null!==(s=f?l.geometries[b]:l)){c=s.coordinates;var w=s.type;switch(h=!r||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===t(c,d,y,_,x))return!1;d++,_++;break;case"LineString":case"MultiPoint":for(i=0;i<c.length;i++){if(!1===t(c[i],d,y,_,x))return!1;d++,"MultiPoint"===w&&_++}"LineString"===w&&_++;break;case"Polygon":case"MultiLineString":for(i=0;i<c.length;i++){for(o=0;o<c[i].length-h;o++){if(!1===t(c[i][o],d,y,_,x))return!1;d++}"MultiLineString"===w&&_++,"Polygon"===w&&x++}"Polygon"===w&&_++;break;case"MultiPolygon":for(i=0;i<c.length;i++){for(x=0,o=0;o<c[i].length;o++){for(a=0;a<c[i][o].length-h;a++){if(!1===t(c[i][o][a],d,y,_,x))return!1;d++}x++}_++}break;case"GeometryCollection":for(i=0;i<s.geometries.length;i++)if(!1===n(s.geometries[i],t,r))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function r(e,t){var n;switch(e.type){case"FeatureCollection":for(n=0;n<e.features.length&&!1!==t(e.features[n].properties,n);n++);break;case"Feature":t(e.properties,0)}}function i(e,t){if("Feature"===e.type)t(e,0);else if("FeatureCollection"===e.type)for(var n=0;n<e.features.length&&!1!==t(e.features[n],n);n++);}function o(e,t){var n,r,i,o,a,s,u,c,l,f,h=0,d="FeatureCollection"===e.type,p="Feature"===e.type,v=d?e.features.length:1;for(n=0;n<v;n++){for(s=d?e.features[n].geometry:p?e.geometry:e,c=d?e.features[n].properties:p?e.properties:{},l=d?e.features[n].bbox:p?e.bbox:void 0,f=d?e.features[n].id:p?e.id:void 0,a=(u=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,i=0;i<a;i++)if(null!==(o=u?s.geometries[i]:s))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===t(o,h,c,l,f))return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===t(o.geometries[r],h,c,l,f))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===t(null,h,c,l,f))return!1;h++}}function a(e,t){o(e,(function(e,n,r,i,o){var a,s=null===e?null:e.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return!1!==t(LR.feature(e,r,{bbox:i,id:o}),n,0)&&void 0}switch(s){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}for(var u=0;u<e.coordinates.length;u++){var c={type:a,coordinates:e.coordinates[u]};if(!1===t(LR.feature(c,r),n,u))return!1}}))}function s(e,t){a(e,(function(e,r,i){var o=0;if(e.geometry){var a=e.geometry.type;if("Point"!==a&&"MultiPoint"!==a){var s,u=0,c=0,l=0;return!1!==n(e,(function(n,a,f,h,d){if(void 0===s||r>u||h>c||d>l)return s=n,u=r,c=h,l=d,void(o=0);var p=LR.lineString([s,n],e.properties);if(!1===t(p,r,i,d,o))return!1;o++,s=n}))&&void 0}}}))}function u(e,t){if(!e)throw new Error("geojson is required");a(e,(function(e,n,r){if(null!==e.geometry){var i=e.geometry.type,o=e.geometry.coordinates;switch(i){case"LineString":if(!1===t(e,n,r,0,0))return!1;break;case"Polygon":for(var a=0;a<o.length;a++)if(!1===t(LR.lineString(o[a],e.properties),n,r,a))return!1}}}))}Object.defineProperty(t,"__esModule",{value:!0}),t.coordEach=n,t.coordReduce=function(e,t,r,i){var o=r;return n(e,(function(e,n,i,a,s){o=0===n&&void 0===r?e:t(o,e,n,i,a,s)}),i),o},t.propEach=r,t.propReduce=function(e,t,n){var i=n;return r(e,(function(e,r){i=0===r&&void 0===n?e:t(i,e,r)})),i},t.featureEach=i,t.featureReduce=function(e,t,n){var r=n;return i(e,(function(e,i){r=0===i&&void 0===n?e:t(r,e,i)})),r},t.coordAll=function(e){var t=[];return n(e,(function(e){t.push(e)})),t},t.geomEach=o,t.geomReduce=function(e,t,n){var r=n;return o(e,(function(e,i,o,a,s){r=0===i&&void 0===n?e:t(r,e,i,o,a,s)})),r},t.flattenEach=a,t.flattenReduce=function(e,t,n){var r=n;return a(e,(function(e,i,o){r=0===i&&0===o&&void 0===n?e:t(r,e,i,o)})),r},t.segmentEach=s,t.segmentReduce=function(e,t,n){var r=n,i=!1;return s(e,(function(e,o,a,s,u){r=!1===i&&void 0===n?e:t(r,e,o,a,s,u),i=!0})),r},t.lineEach=u,t.lineReduce=function(e,t,n){var r=n;return u(e,(function(e,i,o,a){r=0===i&&void 0===n?e:t(r,e,i,o,a)})),r},t.findSegment=function(e,t){if(t=t||{},!LR.isObject(t))throw new Error("options is invalid");var n,r=t.featureIndex||0,i=t.multiFeatureIndex||0,o=t.geometryIndex||0,a=t.segmentIndex||0,s=t.properties;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),s=s||e.features[r].properties,n=e.features[r].geometry;break;case"Feature":s=s||e.properties,n=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=e;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var u=n.coordinates;switch(n.type){case"Point":case"MultiPoint":return null;case"LineString":return a<0&&(a=u.length+a-1),LR.lineString([u[a],u[a+1]],s,t);case"Polygon":return o<0&&(o=u.length+o),a<0&&(a=u[o].length+a-1),LR.lineString([u[o][a],u[o][a+1]],s,t);case"MultiLineString":return i<0&&(i=u.length+i),a<0&&(a=u[i].length+a-1),LR.lineString([u[i][a],u[i][a+1]],s,t);case"MultiPolygon":return i<0&&(i=u.length+i),o<0&&(o=u[i].length+o),a<0&&(a=u[i][o].length-a-1),LR.lineString([u[i][o][a],u[i][o][a+1]],s,t)}throw new Error("geojson is invalid")},t.findPoint=function(e,t){if(t=t||{},!LR.isObject(t))throw new Error("options is invalid");var n,r=t.featureIndex||0,i=t.multiFeatureIndex||0,o=t.geometryIndex||0,a=t.coordIndex||0,s=t.properties;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),s=s||e.features[r].properties,n=e.features[r].geometry;break;case"Feature":s=s||e.properties,n=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=e;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var u=n.coordinates;switch(n.type){case"Point":return LR.point(u,s,t);case"MultiPoint":return i<0&&(i=u.length+i),LR.point(u[i],s,t);case"LineString":return a<0&&(a=u.length+a),LR.point(u[a],s,t);case"Polygon":return o<0&&(o=u.length+o),a<0&&(a=u[o].length+a),LR.point(u[o][a],s,t);case"MultiLineString":return i<0&&(i=u.length+i),a<0&&(a=u[i].length+a),LR.point(u[i][a],s,t);case"MultiPolygon":return i<0&&(i=u.length+i),o<0&&(o=u[i].length+o),a<0&&(a=u[i][o].length-a),LR.point(u[i][o][a],s,t)}throw new Error("geojson is invalid")}})));i(jR);jR.coordEach,jR.coordReduce,jR.propEach,jR.propReduce,jR.featureEach,jR.featureReduce,jR.coordAll,jR.geomEach,jR.geomReduce;var zR=jR.flattenEach;jR.flattenReduce,jR.segmentEach,jR.segmentReduce,jR.lineEach,jR.lineReduce,jR.findSegment,jR.findPoint;function FR(e,t){var n=t.extent;return{images:new Promise((function(t){!function(e,t){var n=e,r=[];if("string"==typeof n)xf({url:n},(function(e,n){r.push(n),t(r)}));else{var i=n.length,o=0;n.forEach((function(e){xf({url:e},(function(e,n){o++,r.push(n),o===i&&t(r)}))}))}}(e,(function(e){t(e)}))})),_id:1,dataArray:[{_id:0,coordinates:[[n[0],n[1]],[n[2],n[3]]]}]}}var BR=function(e){return"string"==typeof e||!Zm(e)&&Fm(e)&&"[object String]"==jg(e)};var UR=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e},VR=Lm(Object.keys,Object),GR=Object.prototype.hasOwnProperty;var HR=function(e){if(!jm(e))return VR(e);var t=[];for(var n in Object(e))GR.call(e,n)&&"constructor"!=n&&t.push(n);return t};var ZR=function(e){return qm(e)?my(e):HR(e)};var WR=function(e,t){return e&&hy(t,ZR(t),e)};var qR=function(e,t){return e&&hy(t,xy(t),e)};var XR=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o};var YR=function(){return[]},KR=Object.prototype.propertyIsEnumerable,QR=Object.getOwnPropertySymbols,JR=QR?function(e){return null==e?[]:(e=Object(e),XR(QR(e),(function(t){return KR.call(e,t)})))}:YR;var $R=function(e,t){return hy(e,JR(e),t)};var eL=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e},tL=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)eL(t,JR(e)),e=Nm(e);return t}:YR;var nL=function(e,t){return hy(e,tL(e),t)};var rL=function(e,t,n){var r=t(e);return Zm(e)?r:eL(r,n(e))};var iL=function(e){return rL(e,ZR,JR)};var oL=function(e){return rL(e,xy,tL)},aL=$g(kg,"DataView"),sL=$g(kg,"Promise"),uL=$g(kg,"WeakMap"),cL=Hg(aL),lL=Hg(em),fL=Hg(sL),hL=Hg(vw),dL=Hg(uL),pL=jg;(aL&&"[object DataView]"!=pL(new aL(new ArrayBuffer(1)))||em&&"[object Map]"!=pL(new em)||sL&&"[object Promise]"!=pL(sL.resolve())||vw&&"[object Set]"!=pL(new vw)||uL&&"[object WeakMap]"!=pL(new uL))&&(pL=function(e){var t=jg(e),n="[object Object]"==t?e.constructor:void 0,r=n?Hg(n):"";if(r)switch(r){case cL:return"[object DataView]";case lL:return"[object Map]";case fL:return"[object Promise]";case hL:return"[object Set]";case dL:return"[object WeakMap]"}return t});var vL=pL,gL=Object.prototype.hasOwnProperty;var mL=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&gL.call(e,"index")&&(n.index=e.index,n.input=e.input),n};var yL=function(e,t){var n=t?Cm(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)},bL=/\w*$/;var _L=function(e){var t=new e.constructor(e.source,bL.exec(e));return t.lastIndex=e.lastIndex,t},xL=Mg?Mg.prototype:void 0,wL=xL?xL.valueOf:void 0;var SL=function(e){return wL?Object(wL.call(e)):{}};var EL=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return Cm(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return yL(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Im(e,n);case"[object Map]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return _L(e);case"[object Set]":return new r;case"[object Symbol]":return SL(e)}};var AL=function(e){return Fm(e)&&"[object Map]"==vL(e)},TL=ay&&ay.isMap,kL=TL?oy(TL):AL;var ML=function(e){return Fm(e)&&"[object Set]"==vL(e)},CL=ay&&ay.isSet,IL=CL?oy(CL):ML,PL={};PL["[object Arguments]"]=PL["[object Array]"]=PL["[object ArrayBuffer]"]=PL["[object DataView]"]=PL["[object Boolean]"]=PL["[object Date]"]=PL["[object Float32Array]"]=PL["[object Float64Array]"]=PL["[object Int8Array]"]=PL["[object Int16Array]"]=PL["[object Int32Array]"]=PL["[object Map]"]=PL["[object Number]"]=PL["[object Object]"]=PL["[object RegExp]"]=PL["[object Set]"]=PL["[object String]"]=PL["[object Symbol]"]=PL["[object Uint8Array]"]=PL["[object Uint8ClampedArray]"]=PL["[object Uint16Array]"]=PL["[object Uint32Array]"]=!0,PL["[object Error]"]=PL["[object Function]"]=PL["[object WeakMap]"]=!1;var OL=function e(t,n,r,i,o,a){var s,u=1&n,c=2&n,l=4&n;if(r&&(s=o?r(t,i,o,a):r(t)),void 0!==s)return s;if(!zg(t))return t;var f=Zm(t);if(f){if(s=mL(t),!u)return Pm(t,s)}else{var h=vL(t),d="[object Function]"==h||"[object GeneratorFunction]"==h;if(Km(t))return km(t,u);if("[object Object]"==h||"[object Arguments]"==h||d&&!o){if(s=c||d?{}:zm(t),!u)return c?nL(t,qR(s,t)):$R(t,WR(s,t))}else{if(!PL[h])return o?t:{};s=EL(t,h,u)}}a||(a=new wm);var p=a.get(t);if(p)return p;a.set(t,s),IL(t)?t.forEach((function(i){s.add(e(i,n,r,i,t,a))})):kL(t)&&t.forEach((function(i,o){s.set(o,e(i,n,r,o,t,a))}));var v=f?void 0:(l?c?oL:iL:c?xy:ZR)(t);return UR(v||t,(function(i,o){v&&(i=t[o=i]),fy(s,o,e(i,n,r,o,t,a))})),s};var RL=function(e){return OL(e,5)};function LL(e,t){var n=t.radius,r=void 0===n?40:n,i=t.maxZoom,o=void 0===i?18:i,a=t.minZoom,s=void 0===a?0:a,u=t.zoom,c=void 0===u?2:u;if(e.pointIndex){var l=e.pointIndex.getClusters(e.extent,Math.floor(c));return e.dataArray=l.map((function(e,t){return Qi({coordinates:e.geometry.coordinates,_id:t+1},e.properties)})),e}var f=new xA({radius:r,minZoom:s,maxZoom:o}),h={type:"FeatureCollection",features:[]};return h.features=e.dataArray.map((function(e){return{type:"Feature",geometry:{type:"Point",coordinates:e.coordinates},properties:Qi({},e)}})),f.load(h.features),f}function NL(e){if(0===e.length)return 0;for(var t,n=e[0],r=0,i=1;i<e.length;i++)t=n+1*e[i],Math.abs(n)>=Math.abs(e[i])?r+=n-t+e[i]:r+=e[i]-t+n,n=t;return n+1*r}var DL={min:function(e){if(0===e.length)throw new Error("min requires at least one data point");for(var t=e[0],n=1;n<e.length;n++)e[n]<t&&(t=e[n]);return t},max:function(e){if(0===e.length)throw new Error("max requires at least one data point");for(var t=e[0],n=1;n<e.length;n++)e[n]>t&&(t=e[n]);return t},mean:function(e){if(0===e.length)throw new Error("mean requires at least one data point");return NL(e)/e.length},sum:NL};var jL=function(e){Ji(n,e);var t=so(n);function n(e,r){var i;return Wi(this,n),(i=t.call(this)).data=void 0,i.extent=void 0,i.hooks={init:new cx},i.parser={type:"geojson"},i.transforms=[],i.cluster=!1,i.clusterOptions={enable:!1,radius:40,maxZoom:20,zoom:-99,method:"count"},i.originData=void 0,i.rawData=void 0,i.clusterIndex=void 0,i.originData=e,i.initCfg(r),i.hooks.init.tap("parser",(function(){i.excuteParser()})),i.hooks.init.tap("cluster",(function(){i.initCluster()})),i.hooks.init.tap("transform",(function(){i.executeTrans()})),i.init(),i}return Xi(n,[{key:"setData",value:function(e,t){this.rawData=e,this.originData=e,this.initCfg(t),this.init(),this.emit("update")}},{key:"getClusters",value:function(e){return this.clusterIndex.getClusters(this.extent,e)}},{key:"getClustersLeaves",value:function(e){return this.clusterIndex.getLeaves(e,1/0)}},{key:"updateClusterData",value:function(e){var t=this,n=this.clusterOptions,r=n.method,i=void 0===r?"sum":r,o=n.field,a=ih(ah(this.extent),2),s=this.clusterIndex.getClusters(a[0].concat(a[1]),Math.floor(e));this.clusterOptions.zoom=e,s.forEach((function(e){e.id||(e.properties.point_count=1)})),(o||Fg(i))&&(s=s.map((function(e){var n=e.id;if(n){var r,a=t.clusterIndex.getLeaves(n,1/0).map((function(e){return e.properties}));if(BR(i)&&o){var s=function(e,t){return e.map((function(e){return 1*e[t]}))}(a,o);r=DL[i](s)}Fg(i)&&(r=i(a)),e.properties.stat=r}else e.properties.point_count=1;return e}))),this.data=pR("geojson")({type:"FeatureCollection",features:s}),this.executeTrans()}},{key:"getFeatureById",value:function(e){var t=this.parser.type;if("geojson"!==(void 0===t?"geojson":t)||this.cluster)return e<this.data.dataArray.length?this.data.dataArray[e]:"null";var n=e<this.originData.features.length?this.originData.features[e]:"null",r=RL(n);if(0!==this.transforms.length){var i=this.data.dataArray.find((function(t){return t._id===e}));r.properties=i}return r}},{key:"getFeatureId",value:function(e,t){var n=this.data.dataArray.find((function(t){return t[e]===name}));return null==n?void 0:n._id}},{key:"destroy",value:function(){this.removeAllListeners(),this.originData=null,this.clusterIndex=null,this.data=null}},{key:"initCfg",value:function(e){e&&(e.parser&&(this.parser=e.parser),e.transforms&&(this.transforms=e.transforms),this.cluster=e.cluster||!1,e.clusterOptions&&(this.cluster=!0,this.clusterOptions=Qi(Qi({},this.clusterOptions),e.clusterOptions)))}},{key:"excuteParser",value:function(){var e=this.parser,t=e.type||"geojson",n=pR(t);this.data=n(this.originData,e),this.extent=Qf(this.data.dataArray)}},{key:"executeTrans",value:function(){var e=this;this.transforms.forEach((function(t){var n=function(e){return hR[e]}(t.type)(e.data,t);Object.assign(e.data,n)}))}},{key:"initCluster",value:function(){if(this.cluster){var e=this.clusterOptions||{};this.clusterIndex=LL(this.data,e)}}},{key:"init",value:function(){this.hooks.init.call(this)}}]),n}(s);var zL=ie.isFinite,FL=Number.isFinite||function(e){return"number"==typeof e&&zL(e)};Pt({target:"Number",stat:!0},{isFinite:FL});var BL=Math.PI/3,UL=[0,BL,2*BL,3*BL,4*BL,5*BL];function VL(e){return e[0]}function GL(e){return e[1]}var HL;vR("geojson",(function(e,t){var n=[],r={};return e.features=e.features.filter((function(e){var t=e.geometry;return null!=e&&t&&t.type&&t.coordinates&&t.coordinates.length>0})),CR(e,!0),0===e.features.length?{dataArray:[],featureKeys:r}:(zR(e,(function(e,t){var r=DR(e),i=t,o=Qi(Qi({},e.properties),{},{coordinates:r,_id:i});n.push(o)})),{dataArray:n,featureKeys:r})})),vR("image",FR),vR("csv",(function(e,t){return RR(SR(e),t)})),vR("json",RR),vR("raster",(function(e,t){var n=t.extent,r=t.width,i=t.height,o=t.min,a=t.max;return{_id:1,dataArray:[{_id:1,data:Array.from(e),width:r,height:i,min:o,max:a,coordinates:[[n[0],n[1]],[n[2],n[3]]]}]}})),gR("cluster",LL),gR("filter",(function(e,t){var n=t.callback;return n&&(e.dataArray=e.dataArray.filter(n)),e})),gR("join",(function(e,t){var n=t.sourceField,r=t.targetField,i=t.data,o={};return i.forEach((function(e){o[e[n]]=e})),e.dataArray=e.dataArray.map((function(e){var t=e[r];return Qi(Qi({},e),o[t])})),e})),gR("map",(function(e,t){var n=t.callback;return n&&(e.dataArray=e.dataArray.map(n)),e})),gR("grid",(function(e,t){var n=e.dataArray,r=t.size,i=void 0===r?10:r,o=i/(2*Math.PI*6378e3)*(256<<20)/2,a=function(e,t){var n,r,i=1/0,o=-1/0,a=po(e);try{for(a.s();!(r=a.n()).done;){var s=r.value;n=s.coordinates[1],Number.isFinite(n)&&(i=n<i?n:i,o=n>o?n:o)}}catch(e){a.e(e)}finally{a.f()}var u=function(e,t){var n=(i=e,i/6378e3*(180/Math.PI)),r=function(e,t){return t/6378e3*(180/Math.PI)/Math.cos(e*Math.PI/180)}(t,e);var i;return{yOffset:n,xOffset:r}}(t,(i+o)/2);if(u.xOffset<=0||u.yOffset<=0)return{gridHash:{},gridOffset:u};var c,l={},f=po(e);try{for(f.s();!(c=f.n()).done;){var h=c.value,d=h.coordinates[1],p=h.coordinates[0];if(Number.isFinite(d)&&Number.isFinite(p)){var v=Math.floor((d+90)/u.yOffset),g=Math.floor((p+180)/u.xOffset),m="".concat(v,"-").concat(g);l[m]=l[m]||{count:0,points:[]},l[m].count+=1,l[m].points.push(h)}}}catch(e){f.e(e)}finally{f.f()}return{gridHash:l,gridOffset:u}}(n,i);return{yOffset:o,xOffset:o,radius:o,type:"grid",dataArray:function(e,t,n){return Object.keys(e).reduce((function(r,i,o){var a=i.split("-"),s=parseInt(a[0],10),u=parseInt(a[1],10),c={};if(n.field&&n.method){var l=cd(e[i].points,n.field);c[n.method]=ud[n.method](l)}return Object.assign(c,{_id:o,coordinates:nh([t.xOffset*(u+.5)-180,t.yOffset*(s+.5)-90]),rawData:e[i].points,count:e[i].count}),r.push(c),r}),[])}(a.gridHash,a.gridOffset,t)}})),gR("hexagon",(function(e,t){var n=e.dataArray,r=t.size,i=void 0===r?10:r,o=t.method,a=void 0===o?"sum":o,s=i/(2*Math.PI*6378e3)*(256<<20)/2,u=n.map((function(e){var t=co(nh(e.coordinates),2),n=t[0],r=t[1];return Qi(Qi({},e),{},{coordinates:[n,r]})}));return{dataArray:function(){var e,t,n,r=0,i=0,o=1,a=1,s=VL,u=GL;function c(e){var r,i={},o=[],a=e.length;for(r=0;r<a;++r)if(!isNaN(l=+s.call(null,c=e[r],r,e))&&!isNaN(f=+u.call(null,c,r,e))){var c,l,f,h=Math.round(f/=n),d=Math.round(l=l/t-(1&h)/2),p=f-h;if(3*Math.abs(p)>1){var v=l-d,g=d+(l<d?-1:1)/2,m=h+(f<h?-1:1),y=l-g,b=f-m;v*v+p*p>y*y+b*b&&(d=g+(1&h?1:-1)/2,h=m)}var _=d+"-"+h,x=i[_];x?x.push(c):(o.push(x=i[_]=[c]),x.x=(d+(1&h)/2)*t,x.y=h*n)}return o}function l(e){var t=0,n=0;return UL.map((function(r){var i=Math.sin(r)*e,o=-Math.cos(r)*e,a=i-t,s=o-n;return t=i,n=o,[a,s]}))}return c.hexagon=function(t){return"m"+l(null==t?e:+t).join("l")+"z"},c.centers=function(){for(var s=[],u=Math.round(i/n),c=Math.round(r/t),l=u*n;l<a+e;l+=n,++u)for(var f=c*t+(1&u)*t/2;f<o+t/2;f+=t)s.push([f,l]);return s},c.mesh=function(){var t=l(e).slice(0,4).join("l");return c.centers().map((function(e){return"M"+e+"m"+t})).join("")},c.x=function(e){return arguments.length?(s=e,c):s},c.y=function(e){return arguments.length?(u=e,c):u},c.radius=function(r){return arguments.length?(t=2*(e=+r)*Math.sin(BL),n=1.5*e,c):e},c.size=function(e){return arguments.length?(r=i=0,o=+e[0],a=+e[1],c):[o-r,a-i]},c.extent=function(e){return arguments.length?(r=+e[0][0],i=+e[0][1],o=+e[1][0],a=+e[1][1],c):[[r,i],[o,a]]},c.radius(1)}().radius(s).x((function(e){return e.coordinates[0]})).y((function(e){return e.coordinates[1]}))(u).map((function(e,n){var r;if(t.field&&a){var i=cd(e,t.field);e[a]=ud[a](i)}return Yi(r={},t.method,e[a]),Yi(r,"count",e.length),Yi(r,"rawData",e),Yi(r,"coordinates",[e.x,e.y]),Yi(r,"_id",n),r})),radius:s,xOffset:s,yOffset:s,type:"hexagon"}}));var ZL=Q()(HL=function(){function e(){Wi(this,e),this.mapService=void 0}return Xi(e,[{key:"apply",value:function(e){var t=this;this.mapService=e.getContainer().get(nr.IMapService),e.hooks.init.tap("DataSourcePlugin",(function(){var n=e.sourceOption,r=n.data,i=n.options;e.setSource(new jL(r,i)),t.updateClusterData(e)})),e.hooks.beforeRenderData.tap("DataSourcePlugin",(function(){var n=t.updateClusterData(e),r=e.dataState.dataSourceNeedUpdate;return e.dataState.dataSourceNeedUpdate=!1,n||r}))}},{key:"updateClusterData",value:function(e){var t=e.getSource(),n=t.cluster,r=t.clusterOptions,i=r.zoom,o=void 0===i?0:i,a=r.maxZoom,s=void 0===a?16:a,u=this.mapService.getZoom()-1;return!!(n&&Math.abs(o-u)>1&&s>o)&&(t.updateClusterData(Math.floor(u)),!0)}}]),e}())||HL;function WL(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function qL(e){return 1===e.length&&(e=function(e){return function(t,n){return WL(e(t),n)}}(e)),{left:function(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){var o=r+i>>>1;e(t[o],n)<0?r=o+1:i=o}return r},right:function(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){var o=r+i>>>1;e(t[o],n)>0?i=o:r=o+1}return r}}}var XL=qL(WL).right;function YL(e){return null===e?NaN:+e}var KL=Math.sqrt(50),QL=Math.sqrt(10),JL=Math.sqrt(2);function $L(e,t,n){var r,i,o,a,s=-1;if(n=+n,(e=+e)===(t=+t)&&n>0)return[e];if((r=t<e)&&(i=e,e=t,t=i),0===(a=eN(e,t,n))||!isFinite(a))return[];if(a>0)for(e=Math.ceil(e/a),t=Math.floor(t/a),o=new Array(i=Math.ceil(t-e+1));++s<i;)o[s]=(e+s)*a;else for(e=Math.floor(e*a),t=Math.ceil(t*a),o=new Array(i=Math.ceil(e-t+1));++s<i;)o[s]=(e-s)/a;return r&&o.reverse(),o}function eN(e,t,n){var r=(t-e)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/Math.pow(10,i);return i>=0?(o>=KL?10:o>=QL?5:o>=JL?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=KL?10:o>=QL?5:o>=JL?2:1)}function tN(e,t,n){var r=Math.abs(t-e)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=KL?i*=10:o>=QL?i*=5:o>=JL&&(i*=2),t<e?-i:i}function nN(e,t,n){if(null==n&&(n=YL),r=e.length){if((t=+t)<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),a=+n(e[o],o,e);return a+(+n(e[o+1],o+1,e)-a)*(i-o)}}function rN(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function iN(){}function oN(e,t){var n=new iN;if(e instanceof iN)e.each((function(e,t){n.set(t,e)}));else if(Array.isArray(e)){var r,i=-1,o=e.length;if(null==t)for(;++i<o;)n.set(i,e[i]);else for(;++i<o;)n.set(t(r=e[i],i,e),r)}else if(e)for(var a in e)n.set(a,e[a]);return n}function aN(){}iN.prototype=oN.prototype={constructor:iN,has:function(e){return"$"+e in this},get:function(e){return this["$"+e]},set:function(e,t){return this["$"+e]=t,this},remove:function(e){var t="$"+e;return t in this&&delete this[t]},clear:function(){for(var e in this)"$"===e[0]&&delete this[e]},keys:function(){var e=[];for(var t in this)"$"===t[0]&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)"$"===t[0]&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)"$"===t[0]&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)"$"===t[0]&&++e;return e},empty:function(){for(var e in this)if("$"===e[0])return!1;return!0},each:function(e){for(var t in this)"$"===t[0]&&e(this[t],t.slice(1),this)}};var sN=oN.prototype;aN.prototype=function(e,t){var n=new aN;if(e instanceof aN)e.each((function(e){n.add(e)}));else if(e){var r=-1,i=e.length;if(null==t)for(;++r<i;)n.add(e[r]);else for(;++r<i;)n.add(t(e[r],r,e))}return n}.prototype={constructor:aN,has:sN.has,add:function(e){return this["$"+(e+="")]=e,this},remove:sN.remove,clear:sN.clear,values:sN.keys,size:sN.size,empty:sN.empty,each:sN.each};var uN=Array.prototype,cN=uN.map,lN=uN.slice,fN={name:"implicit"};function hN(){var e=oN(),t=[],n=[],r=fN;function i(i){var o=i+"",a=e.get(o);if(!a){if(r!==fN)return r;e.set(o,a=t.push(i))}return n[(a-1)%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=oN();for(var r,o,a=-1,s=n.length;++a<s;)e.has(o=(r=n[a])+"")||e.set(o,t.push(r));return i},i.range=function(e){return arguments.length?(n=lN.call(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return hN(t,n).unknown(r)},rN.apply(i,arguments),i}function dN(e){return function(){return e}}function pN(e){return 1==(e=+e)?vN:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):dN(isNaN(t)?n:t)}}function vN(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):dN(isNaN(e)?t:e)}var gN=function e(t){var n=pN(t);function r(e,t){var r=n((e=jh(e)).r,(t=jh(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=vN(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function mN(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,i=t.slice();return function(o){for(n=0;n<r;++n)i[n]=e[n]*(1-o)+t[n]*o;return i}}function yN(e,t){var n,r=t?t.length:0,i=e?Math.min(r,e.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=AN(e[n],t[n]);for(;n<r;++n)a[n]=t[n];return function(e){for(n=0;n<i;++n)a[n]=o[n](e);return a}}function bN(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function _N(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function xN(e,t){var n,r={},i={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=AN(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}var wN=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,SN=new RegExp(wN.source,"g");function EN(e,t){var n,r,i,o=wN.lastIndex=SN.lastIndex=0,a=-1,s=[],u=[];for(e+="",t+="";(n=wN.exec(e))&&(r=SN.exec(t));)(i=r.index)>o&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:_N(n,r)})),o=SN.lastIndex;return o<t.length&&(i=t.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?u[0]?function(e){return function(t){return e(t)+""}}(u[0].x):function(e){return function(){return e}}(t):(t=u.length,function(e){for(var n,r=0;r<t;++r)s[(n=u[r]).i]=n.x(e);return s.join("")})}function AN(e,t){var n,r,i=typeof t;return null==t||"boolean"===i?dN(t):("number"===i?_N:"string"===i?(n=Rh(t))?(t=n,gN):EN:t instanceof Rh?gN:t instanceof Date?bN:(r=t,!ArrayBuffer.isView(r)||r instanceof DataView?Array.isArray(t)?yN:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?xN:_N:mN))(e,t)}function TN(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function kN(e){return+e}var MN=[0,1];function CN(e){return e}function IN(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:(n=isNaN(t)?NaN:.5,function(){return n});var n}function PN(e){var t,n=e[0],r=e[e.length-1];return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function ON(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=IN(i,r),o=n(a,o)):(r=IN(r,i),o=n(o,a)),function(e){return o(r(e))}}function RN(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=IN(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(t){var n=XL(e,t,1,r)-1;return o[n](i[n](t))}}function LN(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function NN(){var e,t,n,r,i,o,a=MN,s=MN,u=AN,c=CN;function l(){return r=Math.min(a.length,s.length)>2?RN:ON,i=o=null,f}function f(t){return isNaN(t=+t)?n:(i||(i=r(a.map(e),s,u)))(e(c(t)))}return f.invert=function(n){return c(t((o||(o=r(s,a.map(e),_N)))(n)))},f.domain=function(e){return arguments.length?(a=cN.call(e,kN),c===CN||(c=PN(a)),l()):a.slice()},f.range=function(e){return arguments.length?(s=lN.call(e),l()):s.slice()},f.rangeRound=function(e){return s=lN.call(e),u=TN,l()},f.clamp=function(e){return arguments.length?(c=e?PN(a):CN,f):c!==CN},f.interpolate=function(e){return arguments.length?(u=e,l()):u},f.unknown=function(e){return arguments.length?(n=e,f):n},function(n,r){return e=n,t=r,l()}}function DN(e,t){return NN()(e,t)}function jN(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function zN(e){return(e=jN(Math.abs(e)))?e[1]:NaN}var FN,BN=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function UN(e){if(!(t=BN.exec(e)))throw new Error("invalid format: "+e);var t;return new VN({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function VN(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function GN(e,t){var n=jN(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}UN.prototype=VN.prototype,VN.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var HN={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return GN(100*e,t)},r:GN,s:function(e,t){var n=jN(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(FN=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+jN(e,Math.max(0,t+o-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function ZN(e){return e}var WN,qN,XN,YN=Array.prototype.map,KN=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function QN(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?ZN:(t=YN.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,o=[],a=0,s=t[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),o.push(e.substring(i-=s,i+s)),!((u+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?ZN:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(YN.call(e.numerals,String)),u=void 0===e.percent?"%":e.percent+"",c=void 0===e.minus?"-":e.minus+"",l=void 0===e.nan?"NaN":e.nan+"";function f(e){var t=(e=UN(e)).fill,n=e.align,f=e.sign,h=e.symbol,d=e.zero,p=e.width,v=e.comma,g=e.precision,m=e.trim,y=e.type;"n"===y?(v=!0,y="g"):HN[y]||(void 0===g&&(g=12),m=!0,y="g"),(d||"0"===t&&"="===n)&&(d=!0,t="0",n="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",_="$"===h?o:/[%p]/.test(y)?u:"",x=HN[y],w=/[defgprs%]/.test(y);function S(e){var i,o,u,h=b,S=_;if("c"===y)S=x(e)+S,e="";else{var E=(e=+e)<0||1/e<0;if(e=isNaN(e)?l:x(Math.abs(e),g),m&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r<n;++r)switch(e[r]){case".":i=t=r;break;case"0":0===i&&(i=r),t=r;break;default:if(!+e[r])break e;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),E&&0==+e&&"+"!==f&&(E=!1),h=(E?"("===f?f:c:"-"===f||"("===f?"":f)+h,S=("s"===y?KN[8+FN/3]:"")+S+(E&&"("===f?")":""),w)for(i=-1,o=e.length;++i<o;)if(48>(u=e.charCodeAt(i))||u>57){S=(46===u?a+e.slice(i+1):e.slice(i))+S,e=e.slice(0,i);break}}v&&!d&&(e=r(e,1/0));var A=h.length+e.length+S.length,T=A<p?new Array(p-A+1).join(t):"";switch(v&&d&&(e=r(T+e,T.length?p-S.length:1/0),T=""),n){case"<":e=h+e+S+T;break;case"=":e=h+T+e+S;break;case"^":e=T.slice(0,A=T.length>>1)+h+e+S+T.slice(A);break;default:e=T+h+e+S}return s(e)}return g=void 0===g?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),S.toString=function(){return e+""},S}return{format:f,formatPrefix:function(e,t){var n=f(((e=UN(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(zN(t)/3))),i=Math.pow(10,-r),o=KN[8+r/3];return function(e){return n(i*e)+o}}}}function JN(e,t,n,r){var i,o=tN(e,t,n);switch((r=UN(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(zN(t)/3)))-zN(Math.abs(e)))}(o,a))||(r.precision=i),XN(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,zN(t)-zN(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(e){return Math.max(0,-zN(Math.abs(e)))}(o))||(r.precision=i-2*("%"===r.type))}return qN(r)}function $N(e){var t=e.domain;return e.ticks=function(e){var n=t();return $L(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return JN(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i=t(),o=0,a=i.length-1,s=i[o],u=i[a];return u<s&&(r=s,s=u,u=r,r=o,o=a,a=r),(r=eN(s,u,n))>0?r=eN(s=Math.floor(s/r)*r,u=Math.ceil(u/r)*r,n):r<0&&(r=eN(s=Math.ceil(s*r)/r,u=Math.floor(u*r)/r,n)),r>0?(i[o]=Math.floor(s/r)*r,i[a]=Math.ceil(u/r)*r,t(i)):r<0&&(i[o]=Math.ceil(s*r)/r,i[a]=Math.floor(u*r)/r,t(i)),e},e}function eD(e,t){var n,r=0,i=(e=e.slice()).length-1,o=e[r],a=e[i];return a<o&&(n=r,r=i,i=n,n=o,o=a,a=n),e[r]=t.floor(o),e[i]=t.ceil(a),e}function tD(e){return Math.log(e)}function nD(e){return Math.exp(e)}function rD(e){return-Math.log(-e)}function iD(e){return-Math.exp(-e)}function oD(e){return isFinite(e)?+("1e"+e):e<0?0:e}function aD(e){return function(t){return-e(-t)}}function sD(e){var t,n,r=e(tD,nD),i=r.domain,o=10;function a(){return t=function(e){return e===Math.E?Math.log:10===e&&Math.log10||2===e&&Math.log2||(e=Math.log(e),function(t){return Math.log(t)/e})}(o),n=function(e){return 10===e?oD:e===Math.E?Math.exp:function(t){return Math.pow(e,t)}}(o),i()[0]<0?(t=aD(t),n=aD(n),e(rD,iD)):e(tD,nD),r}return r.base=function(e){return arguments.length?(o=+e,a()):o},r.domain=function(e){return arguments.length?(i(e),a()):i()},r.ticks=function(e){var r,a=i(),s=a[0],u=a[a.length-1];(r=u<s)&&(h=s,s=u,u=h);var c,l,f,h=t(s),d=t(u),p=null==e?10:+e,v=[];if(!(o%1)&&d-h<p){if(h=Math.round(h)-1,d=Math.round(d)+1,s>0){for(;h<d;++h)for(l=1,c=n(h);l<o;++l)if(!((f=c*l)<s)){if(f>u)break;v.push(f)}}else for(;h<d;++h)for(l=o-1,c=n(h);l>=1;--l)if(!((f=c*l)<s)){if(f>u)break;v.push(f)}}else v=$L(h,d,Math.min(d-h,p)).map(n);return r?v.reverse():v},r.tickFormat=function(e,i){if(null==i&&(i=10===o?".0e":","),"function"!=typeof i&&(i=qN(i)),e===1/0)return i;null==e&&(e=10);var a=Math.max(1,o*e/r.ticks().length);return function(e){var r=e/n(Math.round(t(e)));return r*o<o-.5&&(r*=o),r<=a?i(e):""}},r.nice=function(){return i(eD(i(),{floor:function(e){return n(Math.floor(t(e)))},ceil:function(e){return n(Math.ceil(t(e)))}}))},r}function uD(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function cD(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function lD(e){return e<0?-e*e:e*e}function fD(e){var t=e(CN,CN),n=1;function r(){return 1===n?e(CN,CN):.5===n?e(cD,lD):e(uD(n),uD(1/n))}return t.exponent=function(e){return arguments.length?(n=+e,r()):n},$N(t)}WN=QN({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),qN=WN.format,XN=WN.formatPrefix;var hD=new Date,dD=new Date;function pD(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=function(t){return e(t=new Date(+t)),t},i.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},i.round=function(e){var t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=function(e,n){return t(e=new Date(+e),null==n?1:Math.floor(n)),e},i.range=function(n,r,o){var a,s=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return s;do{s.push(a=new Date(+n)),t(n,o),e(n)}while(a<n&&n<r);return s},i.filter=function(n){return pD((function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),(function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}))},n&&(i.count=function(t,r){return hD.setTime(+t),dD.setTime(+r),e(hD),e(dD),Math.floor(n(hD,dD))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?function(t){return r(t)%e==0}:function(t){return i.count(0,t)%e==0}):i:null}),i}var vD=pD((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e}));vD.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?pD((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,n){t.setTime(+t+n*e)}),(function(t,n){return(n-t)/e})):vD:null};var gD=pD((function(e){e.setTime(e-e.getMilliseconds())}),(function(e,t){e.setTime(+e+1e3*t)}),(function(e,t){return(t-e)/1e3}),(function(e){return e.getUTCSeconds()})),mD=pD((function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds())}),(function(e,t){e.setTime(+e+6e4*t)}),(function(e,t){return(t-e)/6e4}),(function(e){return e.getMinutes()})),yD=pD((function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds()-6e4*e.getMinutes())}),(function(e,t){e.setTime(+e+36e5*t)}),(function(e,t){return(t-e)/36e5}),(function(e){return e.getHours()})),bD=pD((function(e){e.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5}),(function(e){return e.getDate()-1}));function _D(e){return pD((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/6048e5}))}var xD=_D(0),wD=_D(1),SD=(_D(2),_D(3),_D(4)),ED=(_D(5),_D(6),pD((function(e){e.setDate(1),e.setHours(0,0,0,0)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return e.getMonth()}))),AD=pD((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()}));AD.every=function(e){return isFinite(e=Math.floor(e))&&e>0?pD((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n*e)})):null};var TD=pD((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/864e5}),(function(e){return e.getUTCDate()-1}));function kD(e){return pD((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/6048e5}))}var MD=kD(0),CD=kD(1),ID=(kD(2),kD(3),kD(4)),PD=(kD(5),kD(6),pD((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()})));function OD(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function RD(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function LD(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}PD.every=function(e){return isFinite(e=Math.floor(e))&&e>0?pD((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null};var ND,DD,jD={"-":"",_:" ",0:"0"},zD=/^\s*\d+/,FD=/^%/,BD=/[\\^$*+?|[\]().{}]/g;function UD(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function VD(e){return e.replace(BD,"\\$&")}function GD(e){return new RegExp("^(?:"+e.map(VD).join("|")+")","i")}function HD(e){for(var t={},n=-1,r=e.length;++n<r;)t[e[n].toLowerCase()]=n;return t}function ZD(e,t,n){var r=zD.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function WD(e,t,n){var r=zD.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function qD(e,t,n){var r=zD.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function XD(e,t,n){var r=zD.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function YD(e,t,n){var r=zD.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function KD(e,t,n){var r=zD.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function QD(e,t,n){var r=zD.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function JD(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function $D(e,t,n){var r=zD.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function ej(e,t,n){var r=zD.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function tj(e,t,n){var r=zD.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function nj(e,t,n){var r=zD.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function rj(e,t,n){var r=zD.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function ij(e,t,n){var r=zD.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function oj(e,t,n){var r=zD.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function aj(e,t,n){var r=zD.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function sj(e,t,n){var r=zD.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function uj(e,t,n){var r=FD.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function cj(e,t,n){var r=zD.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function lj(e,t,n){var r=zD.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function fj(e,t){return UD(e.getDate(),t,2)}function hj(e,t){return UD(e.getHours(),t,2)}function dj(e,t){return UD(e.getHours()%12||12,t,2)}function pj(e,t){return UD(1+bD.count(AD(e),e),t,3)}function vj(e,t){return UD(e.getMilliseconds(),t,3)}function gj(e,t){return vj(e,t)+"000"}function mj(e,t){return UD(e.getMonth()+1,t,2)}function yj(e,t){return UD(e.getMinutes(),t,2)}function bj(e,t){return UD(e.getSeconds(),t,2)}function _j(e){var t=e.getDay();return 0===t?7:t}function xj(e,t){return UD(xD.count(AD(e)-1,e),t,2)}function wj(e){var t=e.getDay();return t>=4||0===t?SD(e):SD.ceil(e)}function Sj(e,t){return e=wj(e),UD(SD.count(AD(e),e)+(4===AD(e).getDay()),t,2)}function Ej(e){return e.getDay()}function Aj(e,t){return UD(wD.count(AD(e)-1,e),t,2)}function Tj(e,t){return UD(e.getFullYear()%100,t,2)}function kj(e,t){return UD((e=wj(e)).getFullYear()%100,t,2)}function Mj(e,t){return UD(e.getFullYear()%1e4,t,4)}function Cj(e,t){var n=e.getDay();return UD((e=n>=4||0===n?SD(e):SD.ceil(e)).getFullYear()%1e4,t,4)}function Ij(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+UD(t/60|0,"0",2)+UD(t%60,"0",2)}function Pj(e,t){return UD(e.getUTCDate(),t,2)}function Oj(e,t){return UD(e.getUTCHours(),t,2)}function Rj(e,t){return UD(e.getUTCHours()%12||12,t,2)}function Lj(e,t){return UD(1+TD.count(PD(e),e),t,3)}function Nj(e,t){return UD(e.getUTCMilliseconds(),t,3)}function Dj(e,t){return Nj(e,t)+"000"}function jj(e,t){return UD(e.getUTCMonth()+1,t,2)}function zj(e,t){return UD(e.getUTCMinutes(),t,2)}function Fj(e,t){return UD(e.getUTCSeconds(),t,2)}function Bj(e){var t=e.getUTCDay();return 0===t?7:t}function Uj(e,t){return UD(MD.count(PD(e)-1,e),t,2)}function Vj(e){var t=e.getUTCDay();return t>=4||0===t?ID(e):ID.ceil(e)}function Gj(e,t){return e=Vj(e),UD(ID.count(PD(e),e)+(4===PD(e).getUTCDay()),t,2)}function Hj(e){return e.getUTCDay()}function Zj(e,t){return UD(CD.count(PD(e)-1,e),t,2)}function Wj(e,t){return UD(e.getUTCFullYear()%100,t,2)}function qj(e,t){return UD((e=Vj(e)).getUTCFullYear()%100,t,2)}function Xj(e,t){return UD(e.getUTCFullYear()%1e4,t,4)}function Yj(e,t){var n=e.getUTCDay();return UD((e=n>=4||0===n?ID(e):ID.ceil(e)).getUTCFullYear()%1e4,t,4)}function Kj(){return"+0000"}function Qj(){return"%"}function Jj(e){return+e}function $j(e){return Math.floor(+e/1e3)}!function(e){ND=function(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,u=e.shortMonths,c=GD(i),l=HD(i),f=GD(o),h=HD(o),d=GD(a),p=HD(a),v=GD(s),g=HD(s),m=GD(u),y=HD(u),b={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return u[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:fj,e:fj,f:gj,g:kj,G:Cj,H:hj,I:dj,j:pj,L:vj,m:mj,M:yj,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:Jj,s:$j,S:bj,u:_j,U:xj,V:Sj,w:Ej,W:Aj,x:null,X:null,y:Tj,Y:Mj,Z:Ij,"%":Qj},_={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return u[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:Pj,e:Pj,f:Dj,g:qj,G:Yj,H:Oj,I:Rj,j:Lj,L:Nj,m:jj,M:zj,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:Jj,s:$j,S:Fj,u:Bj,U:Uj,V:Gj,w:Hj,W:Zj,x:null,X:null,y:Wj,Y:Xj,Z:Kj,"%":Qj},x={a:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=p[r[0].toLowerCase()],n+r[0].length):-1},A:function(e,t,n){var r=f.exec(t.slice(n));return r?(e.w=h[r[0].toLowerCase()],n+r[0].length):-1},b:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=y[r[0].toLowerCase()],n+r[0].length):-1},B:function(e,t,n){var r=v.exec(t.slice(n));return r?(e.m=g[r[0].toLowerCase()],n+r[0].length):-1},c:function(e,n,r){return E(e,t,n,r)},d:tj,e:tj,f:sj,g:QD,G:KD,H:rj,I:rj,j:nj,L:aj,m:ej,M:ij,p:function(e,t,n){var r=c.exec(t.slice(n));return r?(e.p=l[r[0].toLowerCase()],n+r[0].length):-1},q:$D,Q:cj,s:lj,S:oj,u:WD,U:qD,V:XD,w:ZD,W:YD,x:function(e,t,r){return E(e,n,t,r)},X:function(e,t,n){return E(e,r,t,n)},y:QD,Y:KD,Z:JD,"%":uj};function w(e,t){return function(n){var r,i,o,a=[],s=-1,u=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++s<c;)37===e.charCodeAt(s)&&(a.push(e.slice(u,s)),null!=(i=jD[r=e.charAt(++s)])?r=e.charAt(++s):i="e"===r?" ":"0",(o=t[r])&&(r=o(n,i)),a.push(r),u=s+1);return a.push(e.slice(u,s)),a.join("")}}function S(e,t){return function(n){var r,i,o=LD(1900,void 0,1);if(E(o,e,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(t&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=RD(LD(o.y,0,1))).getUTCDay(),r=i>4||0===i?CD.ceil(r):CD(r),r=TD.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=OD(LD(o.y,0,1))).getDay(),r=i>4||0===i?wD.ceil(r):wD(r),r=bD.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?RD(LD(o.y,0,1)).getUTCDay():OD(LD(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,RD(o)):OD(o)}}function E(e,t,n,r){for(var i,o,a=0,s=t.length,u=n.length;a<s;){if(r>=u)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=x[i in jD?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=w(n,b),b.X=w(r,b),b.c=w(t,b),_.x=w(n,_),_.X=w(r,_),_.c=w(t,_),{format:function(e){var t=w(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=S(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=w(e+="",_);return t.toString=function(){return e},t},utcParse:function(e){var t=S(e+="",!0);return t.toString=function(){return e},t}}}(e),DD=ND.format,ND.parse,ND.utcFormat,ND.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var ez,tz,nz,rz,iz,oz,az,sz;function uz(e){return new Date(e)}function cz(e){return e instanceof Date?+e:+new Date(+e)}function lz(e,t,n,r,i,o,a,s,u){var c=DN(CN,CN),l=c.invert,f=c.domain,h=u(".%L"),d=u(":%S"),p=u("%I:%M"),v=u("%I %p"),g=u("%a %d"),m=u("%b %d"),y=u("%B"),b=u("%Y"),_=[[a,1,1e3],[a,5,5e3],[a,15,15e3],[a,30,3e4],[o,1,6e4],[o,5,3e5],[o,15,9e5],[o,30,18e5],[i,1,36e5],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,864e5],[r,2,1728e5],[n,1,6048e5],[t,1,2592e6],[t,3,7776e6],[e,1,31536e6]];function x(s){return(a(s)<s?h:o(s)<s?d:i(s)<s?p:r(s)<s?v:t(s)<s?n(s)<s?g:m:e(s)<s?y:b)(s)}function w(t,n,r,i){if(null==t&&(t=10),"number"==typeof t){var o=Math.abs(r-n)/t,a=qL((function(e){return e[2]})).right(_,o);a===_.length?(i=tN(n/31536e6,r/31536e6,t),t=e):a?(i=(a=_[o/_[a-1][2]<_[a][2]/o?a-1:a])[1],t=a[0]):(i=Math.max(tN(n,r,t),1),t=s)}return null==i?t:t.every(i)}return c.invert=function(e){return new Date(l(e))},c.domain=function(e){return arguments.length?f(cN.call(e,cz)):f().map(uz)},c.ticks=function(e,t){var n,r=f(),i=r[0],o=r[r.length-1],a=o<i;return a&&(n=i,i=o,o=n),n=(n=w(e,i,o,t))?n.range(i,o+1):[],a?n.reverse():n},c.tickFormat=function(e,t){return null==t?x:u(t)},c.nice=function(e,t){var n=f();return(e=w(e,n[0],n[n.length-1],t))?f(eD(n,e)):c},c.copy=function(){return LN(c,lz(e,t,n,r,i,o,a,s,u))},c}var fz,hz,dz,pz,vz,gz,mz,yz,bz,_z,xz=/^(?:(?!0000)[0-9]{4}([-/.]+)(?:(?:0?[1-9]|1[0-2])\1(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])\1(?:29|30)|(?:0?[13578]|1[02])\1(?:31))|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)([-/.]?)0?2\2(?:29))(\s+([01]|([01][0-9]|2[0-3])):([0-9]|[0-5][0-9]):([0-9]|[0-5][0-9]))?$/,wz=(Yi(ez={},e.ScaleTypes.LINEAR,(function e(){var t=DN(CN,CN);return t.copy=function(){return LN(t,e())},rN.apply(t,arguments),$N(t)})),Yi(ez,e.ScaleTypes.POWER,(function e(){var t=fD(NN());return t.copy=function(){return LN(t,e()).exponent(t.exponent())},rN.apply(t,arguments),t})),Yi(ez,e.ScaleTypes.LOG,(function e(){var t=sD(NN()).domain([1,10]);return t.copy=function(){return LN(t,e()).base(t.base())},rN.apply(t,arguments),t})),Yi(ez,e.ScaleTypes.IDENTITY,(function e(t){var n;function r(e){return isNaN(e=+e)?n:e}return r.invert=r,r.domain=r.range=function(e){return arguments.length?(t=cN.call(e,kN),r):t.slice()},r.unknown=function(e){return arguments.length?(n=e,r):n},r.copy=function(){return e(t).unknown(n)},t=arguments.length?cN.call(t,kN):[0,1],$N(r)})),Yi(ez,e.ScaleTypes.TIME,(function(){return rN.apply(lz(AD,ED,xD,bD,yD,mD,gD,vD,DD).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)})),Yi(ez,e.ScaleTypes.QUANTILE,(function e(){var t,n=[],r=[],i=[];function o(){var e=0,t=Math.max(1,r.length);for(i=new Array(t-1);++e<t;)i[e-1]=nN(n,e/t);return a}function a(e){return isNaN(e=+e)?t:r[XL(i,e)]}return a.invertExtent=function(e){var t=r.indexOf(e);return t<0?[NaN,NaN]:[t>0?i[t-1]:n[0],t<i.length?i[t]:n[n.length-1]]},a.domain=function(e){if(!arguments.length)return n.slice();n=[];for(var t,r=0,i=e.length;r<i;++r)null==(t=e[r])||isNaN(t=+t)||n.push(t);return n.sort(WL),o()},a.range=function(e){return arguments.length?(r=lN.call(e),o()):r.slice()},a.unknown=function(e){return arguments.length?(t=e,a):t},a.quantiles=function(){return i.slice()},a.copy=function(){return e().domain(n).range(r).unknown(t)},rN.apply(a,arguments)})),Yi(ez,e.ScaleTypes.QUANTIZE,(function e(){var t,n=0,r=1,i=1,o=[.5],a=[0,1];function s(e){return e<=e?a[XL(o,e,0,i)]:t}function u(){var e=-1;for(o=new Array(i);++e<i;)o[e]=((e+1)*r-(e-i)*n)/(i+1);return s}return s.domain=function(e){return arguments.length?(n=+e[0],r=+e[1],u()):[n,r]},s.range=function(e){return arguments.length?(i=(a=lN.call(e)).length-1,u()):a.slice()},s.invertExtent=function(e){var t=a.indexOf(e);return t<0?[NaN,NaN]:t<1?[n,o[0]]:t>=i?[o[i-1],r]:[o[t-1],o[t]]},s.unknown=function(e){return arguments.length?(t=e,s):s},s.thresholds=function(){return o.slice()},s.copy=function(){return e().domain([n,r]).range(a).unknown(t)},rN.apply($N(s),arguments)})),Yi(ez,e.ScaleTypes.THRESHOLD,(function e(){var t,n=[.5],r=[0,1],i=1;function o(e){return e<=e?r[XL(n,e,0,i)]:t}return o.domain=function(e){return arguments.length?(n=lN.call(e),i=Math.min(n.length,r.length-1),o):n.slice()},o.range=function(e){return arguments.length?(r=lN.call(e),i=Math.min(n.length,r.length-1),o):r.slice()},o.invertExtent=function(e){var t=r.indexOf(e);return[n[t-1],n[t]]},o.unknown=function(e){return arguments.length?(t=e,o):t},o.copy=function(){return e().domain(n).range(r).unknown(t)},rN.apply(o,arguments)})),Yi(ez,e.ScaleTypes.CAT,hN),ez),Sz=(tz=Q(),nz=J(nr.IGlobalConfigService),rz=J(nr.ILogService),tz((az=go((oz=function(){function t(){Wi(this,t),vo(this,"configService",az,this),vo(this,"logger",sz,this),this.scaleCache={},this.scaleOptions={}}return Xi(t,[{key:"apply",value:function(e,t){var n=this,r=t.styleAttributeService;e.hooks.init.tap("FeatureScalePlugin",(function(){n.scaleOptions=e.getScaleOptions();var t=r.getLayerStyleAttributes(),i=e.getSource().data.dataArray;0!==i.length&&n.caculateScalesForAttributes(t||[],i)})),e.hooks.beforeRenderData.tap("FeatureScalePlugin",(function(){n.scaleOptions=e.getScaleOptions();var t=r.getLayerStyleAttributes(),i=e.getSource().data.dataArray;return n.caculateScalesForAttributes(t||[],i),e.layerModelNeedUpdate=!0,!0})),e.hooks.beforeRender.tap("FeatureScalePlugin",(function(){if(!e.layerModelNeedUpdate){n.scaleOptions=e.getScaleOptions();var t=r.getLayerStyleAttributes();if(t){var i=e.getSource().data.dataArray;if(0===i.length)return;var o=t.filter((function(e){return e.needRescale}));o.length&&(n.caculateScalesForAttributes(o,i),n.logger.debug("rescale finished"))}}}))}},{key:"isNumber",value:function(e){return!isNaN(parseFloat(e))&&isFinite(e)}},{key:"caculateScalesForAttributes",value:function(t,n){var r=this;this.scaleCache={},t.forEach((function(t){if(t.scale){var i=t.scale,o=t.name;i.names=r.parseFields(t.scale.field||[]);var a=[];i.names.forEach((function(e){a.push(r.getOrCreateScale(e,t,n))})),a.some((function(t){return t.type===e.StyleScaleType.VARIABLE}))?(i.type=e.StyleScaleType.VARIABLE,a.forEach((function(e){var t;if(!i.callback)if(i.values&&"text"!==i.values){var n;if("linear"===(null===(n=e.option)||void 0===n?void 0:n.type)&&i.values.length>2){var r=e.scale.ticks(i.values.length);"color"===o&&e.scale.domain(r)}e.scale.range(i.values)}else"cat"===(null===(t=e.option)||void 0===t?void 0:t.type)&&e.scale.range(e.option.domain)}))):(i.type=e.StyleScaleType.CONSTANT,i.defaultValues=a.map((function(e,t){return e.scale(i.names[t])}))),i.scalers=a.map((function(e){return{field:e.field,func:e.scale,option:e.option}})),t.needRescale=!1}}))}},{key:"getOrCreateScale",value:function(e,t,n){[e,t.name].join("_");var r,i=null===(r=t.scale)||void 0===r?void 0:r.values;return this.createScale(e,t.name,i,n)}},{key:"parseFields",value:function(e){return Array.isArray(e)?e:BR(e)?e.split("*"):[e]}},{key:"createScale",value:function(t,n,r,i){var o,a=this.scaleOptions[n]&&this.scaleOptions[n].field===t?this.scaleOptions[n]:this.scaleOptions[t],s={field:t,scale:void 0,type:e.StyleScaleType.VARIABLE,option:a};if(!i||!i.length)return a&&a.type?s.scale=this.createDefaultScale(a):(s.scale=hN([t]),s.type=e.StyleScaleType.CONSTANT),s;var u=null===(o=i.find((function(e){return!n_(e[t])})))||void 0===o?void 0:o[t];if(this.isNumber(t)||n_(u)&&!a)s.scale=hN([t]),s.type=e.StyleScaleType.CONSTANT;else{var c=a&&a.type||this.getDefaultType(u);"text"===r&&(c=e.ScaleTypes.CAT);var l=this.createDefaultScaleConfig(c,t,i);Object.assign(l,a),s.scale=this.createDefaultScale(l),s.option=l}return s}},{key:"getDefaultType",value:function(t){var n=e.ScaleTypes.LINEAR;return"string"==typeof t&&(n=xz.test(t)?e.ScaleTypes.TIME:e.ScaleTypes.CAT),n}},{key:"createDefaultScaleConfig",value:function(t,n,r){var i={type:t},o=(null==r?void 0:r.map((function(e){return e[n]})))||[];return t!==e.ScaleTypes.CAT&&t!==e.ScaleTypes.QUANTILE?i.domain=function(e,t){var n,r,i,o=e.length,a=-1;if(null==t){for(;++a<o;)if(null!=(n=e[a])&&n>=n)for(r=i=n;++a<o;)null!=(n=e[a])&&(r>n&&(r=n),i<n&&(i=n))}else for(;++a<o;)if(null!=(n=t(e[a],a,e))&&n>=n)for(r=i=n;++a<o;)null!=(n=t(e[a],a,e))&&(r>n&&(r=n),i<n&&(i=n));return[r,i]}(o):t===e.ScaleTypes.CAT?i.domain=_w(o):t===e.ScaleTypes.QUANTILE&&(i.domain=o),i}},{key:"createDefaultScale",value:function(e){var t=e.type,n=e.domain,r=wz[t]();return n&&r.domain(n),r}}]),t}()).prototype,"configService",[nz],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),sz=go(oz.prototype,"logger",[rz],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),iz=oz))||iz),Ez=(fz=Q(),hz=J(nr.ICameraService),dz=J(nr.IRendererService),fz((gz=go((vz=function(){function e(){Wi(this,e),vo(this,"cameraService",gz,this),vo(this,"rendererService",mz,this)}return Xi(e,[{key:"apply",value:function(e){e.hooks.beforeRender.tap("LayerAnimateStylePlugin",(function(){e.models.forEach((function(t){t.addUniforms(Qi({},e.layerModel.getAnimateUniforms()))}))}))}}]),e}()).prototype,"cameraService",[hz],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),mz=go(vz.prototype,"rendererService",[dz],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),pz=vz))||pz),Az=Q()(yz=function(){function e(){Wi(this,e)}return Xi(e,[{key:"apply",value:function(e){e.hooks.init.tap("LayerModelPlugin",(function(){e.prepareBuildModel(),e.buildModels(),e.styleNeedUpdate=!1})),e.hooks.beforeRenderData.tap("DataSourcePlugin",(function(){return e.prepareBuildModel(),e.clearModels(),e.buildModels(),e.layerModelNeedUpdate=!1,!1}))}}]),e}())||yz,Tz=Q()(bz=function(){function e(){Wi(this,e)}return Xi(e,[{key:"apply",value:function(e){e.hooks.afterInit.tap("LayerStylePlugin",(function(){e.updateLayerConfig({});var t=e.getLayerConfig(),n=t.autoFit,r=t.fitBoundsOptions;n&&setTimeout((function(){e.fitBounds(r)}),100)}))}}]),e}())||bz,kz={directional:{lights:"u_DirectionalLights",num:"u_NumOfDirectionalLights"},spot:{lights:"u_SpotLights",num:"u_NumOfSpotLights"}},Mz={type:"directional",direction:[1,10.5,12],ambient:[.2,.2,.2],diffuse:[.6,.6,.6],specular:[.1,.1,.1]},Cz={direction:[0,0,0],ambient:[0,0,0],diffuse:[0,0,0],specular:[0,0,0]},Iz={position:[0,0,0],direction:[0,0,0],ambient:[0,0,0],diffuse:[0,0,0],specular:[0,0,0],constant:1,linear:0,quadratic:0,angle:14,exponent:40,blur:5};var Pz,Oz,Rz,Lz,Nz,Dz,jz,zz,Fz,Bz,Uz,Vz,Gz,Hz,Zz,Wz,qz,Xz,Yz,Kz,Qz,Jz=Q()(_z=function(){function e(){Wi(this,e)}return Xi(e,[{key:"apply",value:function(e){e.hooks.beforeRender.tap("LightingPlugin",(function(){e.getLayerConfig().enableLighting&&e.models.forEach((function(e){return e.addUniforms(Qi({},(n={u_DirectionalLights:new Array(3).fill(Qi({},Cz)),u_NumOfDirectionalLights:0,u_SpotLights:new Array(3).fill(Qi({},Iz)),u_NumOfSpotLights:0},t&&t.length||(t=[Mz]),t.forEach((function(e,t){var r=e.type,i=void 0===r?"directional":r,o=io(e,["type"]),a=kz[i].lights,s=kz[i].num,u=n[s];n[a][u]=Qi(Qi({},n[a][u]),o),n[s]++})),n)));var t,n}))}))}}]),e}())||_z,$z=1,eF=2,tF=Q()(Pz=function(){function t(){Wi(this,t)}return Xi(t,[{key:"apply",value:function(t,n){n.rendererService;var r=n.styleAttributeService;t.hooks.init.tap("PixelPickingPlugin",(function(){var n=t.getLayerConfig().enablePicking;r.registerStyleAttribute({name:"pickingColor",type:e.AttributeType.Attribute,descriptor:{name:"a_PickingColor",buffer:{data:[],type:e.gl.FLOAT},size:3,update:function(e,t){var r=e.id;return n?Xh(r):[0,0,0]}}})})),t.hooks.beforePickingEncode.tap("PixelPickingPlugin",(function(){t.getLayerConfig().enablePicking&&t.isVisible()&&t.models.forEach((function(e){return e.addUniforms({u_PickingStage:$z})}))})),t.hooks.afterPickingEncode.tap("PixelPickingPlugin",(function(){t.getLayerConfig().enablePicking&&t.isVisible()&&t.models.forEach((function(e){return e.addUniforms({u_PickingStage:eF})}))})),t.hooks.beforeHighlight.tap("PixelPickingPlugin",(function(e){var n=t.getLayerConfig().highlightColor,r="string"==typeof n?Wh(n):n||[1,0,0,1];t.updateLayerConfig({pickedFeatureID:qh(new Uint8Array(e))}),t.models.forEach((function(t){return t.addUniforms({u_PickingStage:eF,u_PickingColor:e,u_HighlightColor:r.map((function(e){return 255*e}))})}))})),t.hooks.beforeSelect.tap("PixelPickingPlugin",(function(e){var n=t.getLayerConfig().selectColor,r="string"==typeof n?Wh(n):n||[1,0,0,1];t.updateLayerConfig({pickedFeatureID:qh(new Uint8Array(e))}),t.models.forEach((function(t){return t.addUniforms({u_PickingStage:eF,u_PickingColor:e,u_HighlightColor:r.map((function(e){return 255*e}))})}))}))}}]),t}())||Pz,nF=(Oz=Q(),Rz=J(nr.ILogService),Oz((Dz=go((Nz=function(){function t(){Wi(this,t),vo(this,"logger",Dz,this)}return Xi(t,[{key:"apply",value:function(e,t){var n=this,r=t.styleAttributeService;e.hooks.init.tap("RegisterStyleAttributePlugin",(function(){n.registerBuiltinAttributes(r)}))}},{key:"registerBuiltinAttributes",value:function(t){t.registerStyleAttribute({name:"position",type:e.AttributeType.Attribute,descriptor:{name:"a_Position",buffer:{data:[],type:e.gl.FLOAT},size:3,update:function(e,t,n){return 2===n.length?[n[0],n[1],0]:[n[0],n[1],n[2]]}}}),t.registerStyleAttribute({name:"filter",type:e.AttributeType.Attribute,descriptor:{name:"filter",buffer:{usage:e.gl.DYNAMIC_DRAW,data:[],type:e.gl.FLOAT},size:1,update:function(e,t){return e.filter?[1]:[0]}}}),t.registerStyleAttribute({name:"color",type:e.AttributeType.Attribute,descriptor:{name:"a_Color",buffer:{usage:e.gl.DYNAMIC_DRAW,data:[],type:e.gl.FLOAT},size:4,update:function(e,t){var n=e.color;return n&&n.length?n:[1,1,1,1]}}})}}]),t}()).prototype,"logger",[Rz],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Lz=Nz))||Lz),rF=(jz=Q(),zz=J(nr.ICameraService),Fz=J(nr.ICoordinateSystemService),Bz=J(nr.IRendererService),jz((Gz=go((Vz=function(){function e(){Wi(this,e),vo(this,"cameraService",Gz,this),vo(this,"coordinateSystemService",Hz,this),vo(this,"rendererService",Zz,this)}return Xi(e,[{key:"apply",value:function(e){var t=this;e.hooks.beforeRender.tap("ShaderUniformPlugin",(function(){t.coordinateSystemService.refresh();var n=t.rendererService.getViewportSize(),r=n.width,i=n.height;e.models.forEach((function(n){var o;return n.addUniforms((Yi(o={},cA.ProjectionMatrix,t.cameraService.getProjectionMatrix()),Yi(o,cA.ViewMatrix,t.cameraService.getViewMatrix()),Yi(o,cA.ViewProjectionMatrix,t.cameraService.getViewProjectionMatrix()),Yi(o,cA.Zoom,t.cameraService.getZoom()),Yi(o,cA.ZoomScale,t.cameraService.getZoomScale()),Yi(o,cA.FocalDistance,t.cameraService.getFocalDistance()),Yi(o,cA.CameraPosition,t.cameraService.getCameraPosition()),Yi(o,fb.CoordinateSystem,t.coordinateSystemService.getCoordinateSystem()),Yi(o,fb.ViewportCenter,t.coordinateSystemService.getViewportCenter()),Yi(o,fb.ViewportCenterProjection,t.coordinateSystemService.getViewportCenterProjection()),Yi(o,fb.PixelsPerDegree,t.coordinateSystemService.getPixelsPerDegree()),Yi(o,fb.PixelsPerDegree2,t.coordinateSystemService.getPixelsPerDegree2()),Yi(o,fb.PixelsPerMeter,t.coordinateSystemService.getPixelsPerMeter()),Yi(o,"u_ViewportSize",[r,i]),Yi(o,"u_DevicePixelRatio",window.devicePixelRatio),Yi(o,"u_ModelMatrix",[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Yi(o,"u_PickingBuffer",e.getLayerConfig().pickingBuffer||0),o))}))}))}}]),e}()).prototype,"cameraService",[zz],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Hz=go(Vz.prototype,"coordinateSystemService",[Fz],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Zz=go(Vz.prototype,"rendererService",[Bz],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Uz=Vz))||Uz),iF=Q()(Wz=function(){function e(){Wi(this,e)}return Xi(e,[{key:"apply",value:function(e){e.hooks.beforeRender.tap("UpdateModelPlugin",(function(){e.layerModel&&e.layerModel.needUpdate()}))}}]),e}())||Wz,oF=(qz=Q(),Xz=J(nr.ILogService),qz((Qz=go((Kz=function(){function e(){Wi(this,e),vo(this,"logger",Qz,this)}return Xi(e,[{key:"apply",value:function(e,t){var n=this,r=t.styleAttributeService;e.hooks.init.tap("UpdateStyleAttributePlugin",(function(){n.initStyleAttribute(e,{styleAttributeService:r})})),e.hooks.beforeRender.tap("UpdateStyleAttributePlugin",(function(){e.layerModelNeedUpdate||n.updateStyleAtrribute(e,{styleAttributeService:r})}))}},{key:"updateStyleAtrribute",value:function(e,t){var n=this,r=t.styleAttributeService,i=r.getLayerStyleAttributes()||[],o=r.getLayerStyleAttribute("filter"),a=r.getLayerStyleAttribute("shape");if(o&&o.needRegenerateVertices||a&&a.needRegenerateVertices)return e.layerModelNeedUpdate=!0,void i.forEach((function(e){return e.needRegenerateVertices=!1}));i.filter((function(e){return e.needRegenerateVertices})).forEach((function(t){r.updateAttributeByFeatureRange(t.name,e.getEncodedData(),t.featureRange.startIndex,t.featureRange.endIndex),t.needRegenerateVertices=!1,n.logger.debug("regenerate vertex attributes: ".concat(t.name," finished"))}))}},{key:"initStyleAttribute",value:function(e,t){var n=this,r=t.styleAttributeService;(r.getLayerStyleAttributes()||[]).filter((function(e){return e.needRegenerateVertices})).forEach((function(t){r.updateAttributeByFeatureRange(t.name,e.getEncodedData(),t.featureRange.startIndex,t.featureRange.endIndex),t.needRegenerateVertices=!1,n.logger.debug("init vertex attributes: ".concat(t.name," finished"))}))}}]),e}()).prototype,"logger",[Xz],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Yz=Kz))||Yz);BE.bind(nr.ILayerPlugin).to(ZL).inRequestScope(),BE.bind(nr.ILayerPlugin).to(nF).inRequestScope(),BE.bind(nr.ILayerPlugin).to(Sz).inRequestScope(),BE.bind(nr.ILayerPlugin).to(fR).inRequestScope(),BE.bind(nr.ILayerPlugin).to(Tz).inRequestScope(),BE.bind(nr.ILayerPlugin).to(oF).inRequestScope(),BE.bind(nr.ILayerPlugin).to(iF).inRequestScope(),BE.bind(nr.ILayerPlugin).to(tP).inRequestScope(),BE.bind(nr.ILayerPlugin).to(rF).inRequestScope(),BE.bind(nr.ILayerPlugin).to(Ez).inRequestScope(),BE.bind(nr.ILayerPlugin).to(Jz).inRequestScope(),BE.bind(nr.ILayerPlugin).to(tF).inRequestScope(),BE.bind(nr.ILayerPlugin).to(Az).inRequestScope();e.BKDRHash=function(e){var t=0;e+="x";for(var n=Math.floor(65745979961613.07),r=0;r<e.length;r++)t>n&&(t=Math.floor(t/137)),t=131*t+e.charCodeAt(r);return t},e.BaseLayer=oP,e.BasePostProcessingPass=vE,e.CameraUniform=cA,e.CityBuildingLayer=vO,e.Control=hA,e.CoordinateUniform=fb,e.DOM=Fa,e.GaodeMap=FT,e.HeatmapLayer=xO,e.ImageLayer=SO,e.LRUCache=ph,e.Layers=dA,e.LineLayer=LO,e.Logo=pA,e.Map=gC,e.MapServiceEvent=uA,e.Mapbox=DC,e.Marker=_A,e.MarkerLayer=wA,e.PointLayer=iR,e.PolygonLayer=sR,e.Popup=SA,e.RasterLayer=lR,e.Satistics=fd,e.Scale=vA,e.Scene=CT,e.SceneEventList=lA,e.TYPES=nr,e.Zoom=gA,e.aProjectFlat=nh,e.anchorTranslate=Kh,e.applyAnchorClass=Qh,e.bBoxToBounds=ah,e.bindAll=vh,e.boundsContains=oh,e.container=BE,e.createLayerContainer=ZE,e.createSceneContainer=HE,e.decodePickingColor=qh,e.djb2hash=function(e){for(var t=5381,n=(e=e.toString()).length;n;)t=33*t^e.charCodeAt(--n);return t>>>0},e.encodePickingColor=Xh,e.extent=Qf,e.generateColorRamp=Yh,e.getArrayBuffer=_f,e.getImage=xf,e.getJSON=function(e,t){var n=bf(e);return n.setRequestHeader("Accept","application/json"),n.onerror=function(){t(new Error(n.statusText))},n.onload=function(){if(n.status>=200&&n.status<300&&n.response){var r;try{r=JSON.parse(n.response)}catch(e){return t(e)}t(null,r)}else 401===n.status?t(new yf("".concat(n.statusText),n.status,e.url)):t(new yf(n.statusText,n.status,e.url))},n.send(),n},e.latitude=eh,e.lazyInject=VE,e.lazyMultiInject=function(e){var t=UE.lazyMultiInject(e);return function(e,n,r){t.call(this,e,n),r&&(r.initializer=function(){return e[n]})}},e.lngLatToMeters=Jf,e.lnglatDistance=rh,e.longitude=$f,e.metersToLngLat=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,n=e[0],r=e[1],i=n/Kf*180,o=r/Kf*180;return o=180/Math.PI*(2*Math.atan(Math.exp(o*Math.PI/180))-Math.PI/2),null!=t&&(i=Number(i.toFixed(t)),o=Number(o.toFixed(t))),3===e.length?[i,o,e[2]]:[i,o]},e.packCircleVertex=function(e){var t=e.color,n=e.radius,r=e.tileX,i=e.tileY,o=e.shape,a=e.opacity,s=e.stroke,u=e.strokeWidth,c=e.strokeOpacity,l=[],f=[],h=[],d=[aA(t[0],t[1]),aA(t[2],t[3])],p=[aA(s[0],s[1]),aA(s[2],s[3])];return[[-1,-1],[1,-1],[1,1],[-1,1]].forEach((function(e){var t=co(e,2),s=t[0],v=t[1];l.push([].concat(d,[8388608*(s+1)+2097152*(v+1)+131072*tA(o)+n,524288*(r+512)+64*(i+512)])),f.push([].concat(p,[u,c])),h.push([a,0,0,0])})),{packedBuffer:l,packedBuffer2:f,packedBuffer3:h}},e.padBounds=ih,e.project=function(e){var t=Math.PI/180,n=85.0511287798,r=Math.max(Math.min(n,e[1]),-n),i=Math.sin(r*t);return[6378137*e[0]*t,6378137*Math.log((1+i)/(1-i))/2]},e.rgb2arr=Wh,e.tranfrormCoord=function(e,t){return function e(t,n){if(Array.isArray(t[0]))return t.map((function(t){return e(t,n)}));return n(t)}(e,t)},e.unProjectFlat=function(e){var t=.5/Math.PI,n=-.5/Math.PI,r=.5,i=co(e,2),o=i[0],a=i[1];return o=(o/(256<<20)-.5)/t,a=(a/(256<<20)-r)/n,a=2*(Math.atan(Math.pow(Math.E,a))-Math.PI/4),[o/(r=Math.PI/180),a/r]},e.validateLngLat=th,e.version="2.2.43",Object.defineProperty(e,"__esModule",{value:!0})}));

Callers 1

aFunction · 0.85

Calls 1

eFunction · 0.70

Tested by

no test coverage detected